-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into add-portal-slot-to-combos
- Loading branch information
Showing
294 changed files
with
2,518 additions
and
1,645 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
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); |
83 changes: 83 additions & 0 deletions
83
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,83 @@ | ||
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' }) | ||
|
||
// This needs to be added so that the focus outline is shown correctly | ||
.executeScript(`document.querySelector('#${contentId}').setAttribute('data-fui-focus-visible', '')`) | ||
.focus(`#${contentId}`) | ||
.snapshot('focus content', { cropTo: '.testWrapper' }) | ||
.executeScript(`document.querySelector('#${contentId}').removeAttribute('data-fui-focus-visible')`) | ||
|
||
// This needs to be added so that the focus outline is shown correctly | ||
.executeScript(`document.querySelector('#${dismissButtonId}').setAttribute('data-fui-focus-visible', '')`) | ||
.focus(`#${dismissButtonId}`) | ||
.snapshot('focus dismiss', { cropTo: '.testWrapper' }) | ||
.executeScript(`document.querySelector('#${dismissButtonId}').removeAttribute('data-fui-focus-visible')`) | ||
|
||
.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); |
49 changes: 49 additions & 0 deletions
49
apps/vr-tests-react-components/src/stories/Tag/TagAppearances.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 * as React from 'react'; | ||
import { Tag } 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 tagId = 'tag-id'; | ||
const steps = new Steps() | ||
.snapshot('default', { cropTo: '.testWrapper' }) | ||
.hover(`#${tagId}}`) | ||
.snapshot('hover', { cropTo: '.testWrapper' }) | ||
.mouseDown(`#${tagId}}`) | ||
.snapshot('pressed', { cropTo: '.testWrapper' }) | ||
.end(); | ||
|
||
export default { | ||
title: 'Tag Converged', | ||
Component: Tag, | ||
decorators: [story => withStoryWrightSteps({ story, steps })], | ||
} as ComponentMeta<typeof Tag>; | ||
|
||
export const Filled = () => ( | ||
<Tag id={tagId} appearance="filled" dismissible icon={<CalendarMonth />}> | ||
Primary Text | ||
</Tag> | ||
); | ||
|
||
export const FilledHighContrast = getStoryVariant(Filled, HIGH_CONTRAST); | ||
export const FilledDarkMode = getStoryVariant(Filled, DARK_MODE); | ||
|
||
export const Outline = () => ( | ||
<Tag id={tagId} appearance="outline" dismissible icon={<CalendarMonth />}> | ||
Primary Text | ||
</Tag> | ||
); | ||
|
||
export const OutlineHighContrast = getStoryVariant(Outline, HIGH_CONTRAST); | ||
export const OutlineDarkMode = getStoryVariant(Outline, DARK_MODE); | ||
|
||
export const Brand = () => ( | ||
<Tag id={tagId} appearance="brand" dismissible icon={<CalendarMonth />}> | ||
Primary Text | ||
</Tag> | ||
); | ||
export const BrandHighContrast = getStoryVariant(Brand, HIGH_CONTRAST); | ||
export const BrandDarkMode = getStoryVariant(Brand, DARK_MODE); |
Oops, something went wrong.