-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refactor dialog content + add story, add footer story
- Loading branch information
1 parent
664e46b
commit 546f489
Showing
12 changed files
with
103 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/app/ui/components/containers/dialog/components/dialog-card.layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Flex } from 'leather-styles/jsx'; | ||
|
||
import { HasChildren } from '@app/common/has-children'; | ||
|
||
// TODO name this better / merge with dialog-content.layout | ||
/** deprecated */ | ||
export function DialogCard({ children }: HasChildren) { | ||
return ( | ||
<Flex alignItems="center" flexDirection="column" pb={['space.05', 'space.08']} px="space.05"> | ||
{children} | ||
</Flex> | ||
); | ||
} |
50 changes: 44 additions & 6 deletions
50
src/app/ui/components/containers/dialog/components/dialog-content.layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,49 @@ | ||
import { Flex } from 'leather-styles/jsx'; | ||
import { ReactNode } from 'react'; | ||
|
||
import { HasChildren } from '@app/common/has-children'; | ||
import { css } from 'leather-styles/css'; | ||
import { Box } from 'leather-styles/jsx'; | ||
|
||
export function DialogContent({ children }: HasChildren) { | ||
import { Footer } from '../../footers/footer'; | ||
|
||
interface DialogContentProps { | ||
children: ReactNode; | ||
footer: ReactNode; | ||
header: ReactNode; | ||
} | ||
// TODO - move this up a level into Dialog | ||
|
||
/** @deprecated */ | ||
export function DialogContent({ children, header, footer }: DialogContentProps) { | ||
// TODO re-test this app wide - getting rid of offets and adding new header variant 'big-title' | ||
// need to make sure this doesnt introduce weird scrolling | ||
return ( | ||
<Flex alignItems="center" flexDirection="column" pb={['space.05', 'space.08']} px="space.05"> | ||
{children} | ||
</Flex> | ||
// maxHeight + overflow hidden to stop header being able to move on scroll | ||
<Box maxHeight="100vh" overflowY="hidden"> | ||
{/* standard header height is 68px */} | ||
{/* <Box | ||
className={css({ | ||
position: 'fixed', | ||
width: '100%', | ||
height: '68px', | ||
padding: '16px', | ||
})} | ||
> */} | ||
{header} | ||
{/* </Box> */} | ||
<Box | ||
className={css({ | ||
// paddingTop: '68px', // offset based on height of header - make this smarter | ||
|
||
// allow scroll on small heights | ||
overflowY: 'scroll', | ||
'&::-webkit-scrollbar': { | ||
display: 'none', | ||
}, | ||
})} | ||
> | ||
{children} | ||
</Box> | ||
{footer && <Footer>{footer}</Footer>} | ||
</Box> | ||
); | ||
} |
15 changes: 15 additions & 0 deletions
15
src/app/ui/components/containers/dialog/dialog.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { Meta } from '@storybook/react'; | ||
|
||
import { Dialog as Component, DialogProps } from './dialog'; | ||
|
||
const meta: Meta<typeof Component> = { | ||
component: Component, | ||
tags: ['autodocs'], | ||
title: 'Design System/Containers/Dialog', | ||
}; | ||
|
||
export default meta; | ||
|
||
export function Dialog(args: DialogProps) { | ||
return <Component {...args} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/app/ui/components/containers/footers/footer.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { Meta } from '@storybook/react'; | ||
|
||
import { Footer as Component, FooterProps } from './footer'; | ||
|
||
const meta: Meta<typeof Component> = { | ||
component: Component, | ||
tags: ['autodocs'], | ||
title: 'Design System/Containers/Footer', | ||
}; | ||
|
||
export default meta; | ||
|
||
export function Footer(args: FooterProps) { | ||
return <Component {...args} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.