-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(TDOPS-4875): elevation improvements and added story in DS
- Loading branch information
Showing
4 changed files
with
95 additions
and
10 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
38 changes: 38 additions & 0 deletions
38
packages/storybook/src/design-system/Elevation/Elevation.stories.mdx
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,38 @@ | ||
import { Meta, Story } from '@storybook/addon-docs'; | ||
import { FigmaImage, FigmaLink, Use } from '~docs'; | ||
|
||
import { Modal } from '@talend/design-system'; | ||
|
||
import * as Stories from './Elevation.stories'; | ||
|
||
<Meta | ||
title="Design System/Elevation" | ||
parameters={{ | ||
status: { figma: 'ok', storybook: 'wip', react: 'ok', i18n: 'na' }, | ||
figmaLink: 'https://www.figma.com/file/0Jolh2prAAdfO5224n3OU3/Modal', | ||
}} | ||
/> | ||
|
||
# Elevation for different components combination | ||
|
||
Different component overlay | ||
|
||
## Zoning | ||
|
||
### Variations | ||
|
||
**Modal with info in Popover** | ||
|
||
<Canvas> | ||
<Story height="5rem" story={Stories.DialogWithTooltipAndPopover} /> | ||
</Canvas> | ||
|
||
## States | ||
|
||
## Interactions | ||
|
||
## Content | ||
|
||
## Usage | ||
|
||
## Accessibility |
49 changes: 49 additions & 0 deletions
49
packages/storybook/src/design-system/Elevation/Elevation.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,49 @@ | ||
import { Story, ComponentStory } from '@storybook/react'; | ||
Check warning on line 1 in packages/storybook/src/design-system/Elevation/Elevation.stories.tsx GitHub Actions / ESLint Report Analysispackages/storybook/src/design-system/Elevation/Elevation.stories.tsx#L1
|
||
import { useState } from 'react'; | ||
import { action } from '@storybook/addon-actions'; | ||
|
||
import { Popover, ButtonIcon, ButtonPrimary, Modal } from '@talend/design-system'; | ||
import { ModalPropsType } from '@talend/design-system/lib/components/Modal'; | ||
Check warning on line 6 in packages/storybook/src/design-system/Elevation/Elevation.stories.tsx GitHub Actions / ESLint Report Analysispackages/storybook/src/design-system/Elevation/Elevation.stories.tsx#L6
|
||
|
||
export default { | ||
component: Modal, | ||
}; | ||
|
||
function ModalStory(props: Partial<ModalPropsType>) { | ||
const [modalOpen, setModalOpen] = useState(false); | ||
|
||
return ( | ||
<> | ||
<ButtonPrimary onClick={() => setModalOpen(true)} data-test="open-modal"> | ||
See | ||
</ButtonPrimary> | ||
|
||
{modalOpen && ( | ||
<Modal | ||
header={{ title: '(Default story title)' }} | ||
onClose={() => { | ||
action('onClose'); | ||
setModalOpen(false); | ||
}} | ||
{...props} | ||
/> | ||
)} | ||
</> | ||
); | ||
} | ||
|
||
export const DialogWithTooltipAndPopover: ComponentStory<typeof Modal> = props => ( | ||
<ModalStory {...props} header={{ title: 'Dialog with Tooltip and Popover' }}> | ||
<Popover | ||
isFixed | ||
disclosure={ | ||
<ButtonIcon size="M" icon="pencil" onClick={() => action('click')}> | ||
Hey I am tooltip. Click to see the Popover | ||
</ButtonIcon> | ||
} | ||
> | ||
Hey I am Popover | ||
</Popover> | ||
Default story child | ||
</ModalStory> | ||
); |