forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2d831c3
commit 984f200
Showing
6 changed files
with
286 additions
and
229 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
70 changes: 70 additions & 0 deletions
70
apps/vr-tests-react-components/src/stories/Tag/InteractionTagAppearances.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,70 @@ | ||
import * as React from 'react'; | ||
import { InteractionTag } from '@fluentui/react-tags-preview'; | ||
import { bundleIcon, CalendarMonthFilled, CalendarMonthRegular } from '@fluentui/react-icons'; | ||
import { ComponentMeta } from '@storybook/react'; | ||
import { getStoryVariant, withStoryWrightSteps, DARK_MODE, HIGH_CONTRAST } from '../../utilities'; | ||
import { Steps } from 'storywright'; | ||
|
||
const CalendarMonth = bundleIcon(CalendarMonthFilled, CalendarMonthRegular); | ||
|
||
const contentId = 'content-id'; | ||
const dismissButtonId = 'dismiss-button-id'; | ||
const steps = new Steps() | ||
.snapshot('default', { cropTo: '.testWrapper' }) | ||
.hover(`#${contentId}`) | ||
.snapshot('hover content', { cropTo: '.testWrapper' }) | ||
.mouseDown(`#${contentId}`) | ||
.snapshot('pressed content', { cropTo: '.testWrapper' }) | ||
.hover(`#${dismissButtonId}`) | ||
.snapshot('hover dismiss', { cropTo: '.testWrapper' }) | ||
.mouseDown(`#${dismissButtonId}`) | ||
.snapshot('pressed dismiss', { cropTo: '.testWrapper' }) | ||
.end(); | ||
|
||
export default { | ||
title: 'InteractionTag Converged', | ||
Component: InteractionTag, | ||
decorators: [story => withStoryWrightSteps({ story, steps })], | ||
} as ComponentMeta<typeof InteractionTag>; | ||
|
||
export const Filled = () => ( | ||
<InteractionTag | ||
content={{ id: contentId }} | ||
appearance="filled" | ||
dismissible | ||
dismissButton={{ id: dismissButtonId }} | ||
icon={<CalendarMonth />} | ||
> | ||
Primary Text | ||
</InteractionTag> | ||
); | ||
export const FilledHighContrast = getStoryVariant(Filled, HIGH_CONTRAST); | ||
export const FilledDarkMode = getStoryVariant(Filled, DARK_MODE); | ||
|
||
export const Outline = () => ( | ||
<InteractionTag | ||
content={{ id: contentId }} | ||
appearance="outline" | ||
dismissible | ||
dismissButton={{ id: dismissButtonId }} | ||
icon={<CalendarMonth />} | ||
> | ||
Primary Text | ||
</InteractionTag> | ||
); | ||
export const OutlineHighContrast = getStoryVariant(Outline, HIGH_CONTRAST); | ||
export const OutlineDarkMode = getStoryVariant(Outline, DARK_MODE); | ||
|
||
export const Brand = () => ( | ||
<InteractionTag | ||
content={{ id: contentId }} | ||
appearance="brand" | ||
dismissible | ||
dismissButton={{ id: dismissButtonId }} | ||
icon={<CalendarMonth />} | ||
> | ||
Primary Text | ||
</InteractionTag> | ||
); | ||
export const BrandHighContrast = getStoryVariant(Brand, HIGH_CONTRAST); | ||
export const BrandDarkMode = getStoryVariant(Brand, DARK_MODE); |
74 changes: 74 additions & 0 deletions
74
apps/vr-tests-react-components/src/stories/Tag/InteractionTagShape.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,74 @@ | ||
import * as React from 'react'; | ||
import { InteractionTag } from '@fluentui/react-tags-preview'; | ||
import { ComponentMeta } from '@storybook/react'; | ||
import { getStoryVariant, withStoryWrightSteps, RTL } from '../../utilities'; | ||
import { Avatar } from '@fluentui/react-avatar'; | ||
import { Steps } from 'storywright'; | ||
|
||
const contentId = 'content-id'; | ||
const dismissButtonId = 'dismiss-button-id'; | ||
const steps = new Steps() | ||
.snapshot('default', { cropTo: '.testWrapper' }) | ||
.focus(`#${contentId}`) | ||
.snapshot('focus content', { cropTo: '.testWrapper' }) | ||
.focus(`#${dismissButtonId}`) | ||
.snapshot('focus dismiss', { cropTo: '.testWrapper' }) | ||
.end(); | ||
|
||
export default { | ||
title: 'InteractionTag Converged', | ||
Component: InteractionTag, | ||
decorators: [story => withStoryWrightSteps({ story, steps })], | ||
} as ComponentMeta<typeof InteractionTag>; | ||
|
||
export const Rounded = () => <InteractionTag content={{ id: contentId }}>Primary Text</InteractionTag>; | ||
|
||
export const RoundedWithSecondaryText = () => ( | ||
<InteractionTag content={{ id: contentId }} secondaryText="Secondary Text"> | ||
Primary Text | ||
</InteractionTag> | ||
); | ||
|
||
export const RoundedWithMedia = () => ( | ||
<InteractionTag content={{ id: contentId }} media={<Avatar name="Lydia Bauer" badge={{ status: 'available' }} />}> | ||
Primary Text | ||
</InteractionTag> | ||
); | ||
export const RoundedWithMediaRTL = getStoryVariant(RoundedWithMedia, RTL); | ||
|
||
export const RoundedDismissible = () => ( | ||
<InteractionTag content={{ id: contentId }} dismissible dismissButton={{ id: dismissButtonId }}> | ||
Primary Text | ||
</InteractionTag> | ||
); | ||
export const RoundedDismissibleRTL = getStoryVariant(RoundedDismissible, RTL); | ||
|
||
export const Circular = () => ( | ||
<InteractionTag content={{ id: contentId }} shape="circular"> | ||
Primary Text | ||
</InteractionTag> | ||
); | ||
|
||
export const CircularWithSecondaryText = () => ( | ||
<InteractionTag content={{ id: contentId }} shape="circular" secondaryText="Secondary Text"> | ||
Primary Text | ||
</InteractionTag> | ||
); | ||
|
||
export const CircularWithMedia = () => ( | ||
<InteractionTag | ||
content={{ id: contentId }} | ||
shape="circular" | ||
media={<Avatar name="Lydia Bauer" badge={{ status: 'available' }} />} | ||
> | ||
Primary Text | ||
</InteractionTag> | ||
); | ||
export const CircularWithMediaRTL = getStoryVariant(CircularWithMedia, RTL); | ||
|
||
export const CircularDismissible = () => ( | ||
<InteractionTag content={{ id: contentId }} shape="circular" dismissible dismissButton={{ id: dismissButtonId }}> | ||
Primary Text | ||
</InteractionTag> | ||
); | ||
export const CircularDismissibleRTL = getStoryVariant(CircularDismissible, RTL); |
Oops, something went wrong.