-
Notifications
You must be signed in to change notification settings - Fork 2.9k
add vr test to react-tags #28484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
add vr test to react-tags #28484
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f6ec291
vr
YuanboXue-Amber 1fcb79e
vr
YuanboXue-Amber 3156539
pkg.json
YuanboXue-Amber 33ab5a7
update import to preview
YuanboXue-Amber 1db8cca
Merge branch 'master' into tag-vr
YuanboXue-Amber dc165e0
hover for both content and dimiss
YuanboXue-Amber 2d831c3
Merge branches 'tag-vr' and 'tag-vr' of https://github.com/YuanboXue-…
YuanboXue-Amber 984f200
split
YuanboXue-Amber 5ee61e2
remove some stories
YuanboXue-Amber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
83 changes: 83 additions & 0 deletions
83
apps/vr-tests-react-components/src/stories/Tag/InteractionTag.stories.tsx
This file contains hidden or 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 { bundleIcon, CalendarMonthFilled, CalendarMonthRegular } from '@fluentui/react-icons'; | ||
| import { ComponentMeta } from '@storybook/react'; | ||
| import { getStoryVariant, withStoryWrightSteps, DARK_MODE, HIGH_CONTRAST, RTL } from '../../utilities'; | ||
| import { Avatar } from '@fluentui/react-avatar'; | ||
| import { Steps } from 'storywright'; | ||
|
|
||
| const CalendarMonth = bundleIcon(CalendarMonthFilled, CalendarMonthRegular); | ||
|
|
||
| const steps = new Steps().snapshot('default', { cropTo: '.testWrapper' }).end(); | ||
|
|
||
| export default { | ||
| title: 'InteractionTag Converged', | ||
| Component: InteractionTag, | ||
| decorators: [story => withStoryWrightSteps({ story, steps })], | ||
| } as ComponentMeta<typeof InteractionTag>; | ||
|
|
||
| export const Default = () => <InteractionTag>Primary Text</InteractionTag>; | ||
|
|
||
| export const DefaultRTL = getStoryVariant(Default, RTL); | ||
| export const DefaultDarkMode = getStoryVariant(Default, DARK_MODE); | ||
| export const DefaultHighContrast = getStoryVariant(Default, HIGH_CONTRAST); | ||
|
|
||
| // disabled | ||
| export const Disabled = () => ( | ||
| <InteractionTag disabled dismissible icon={<CalendarMonth />}> | ||
| Primary Text | ||
| </InteractionTag> | ||
| ); | ||
| export const DisabledHighContrast = getStoryVariant(Disabled, HIGH_CONTRAST); | ||
| export const DisabledDarkMode = getStoryVariant(Disabled, DARK_MODE); | ||
|
|
||
| export const OutlineDisabled = () => ( | ||
| <InteractionTag appearance="outline" disabled dismissible icon={<CalendarMonth />}> | ||
| Primary Text | ||
| </InteractionTag> | ||
| ); | ||
| export const OutlineDisabledHighContrast = getStoryVariant(OutlineDisabled, HIGH_CONTRAST); | ||
| export const OutlineDisabledDarkMode = getStoryVariant(OutlineDisabled, DARK_MODE); | ||
|
|
||
| export const BrandDisabled = () => ( | ||
| <InteractionTag appearance="brand" disabled dismissible icon={<CalendarMonth />}> | ||
| Primary Text | ||
| </InteractionTag> | ||
| ); | ||
| export const BrandDisabledHighContrast = getStoryVariant(BrandDisabled, HIGH_CONTRAST); | ||
| export const BrandDisabledDarkMode = getStoryVariant(BrandDisabled, DARK_MODE); | ||
|
|
||
| // size | ||
| export const SizeSmall = () => <InteractionTag size="small">Primary Text</InteractionTag>; | ||
| export const SizeSmallDismissible = () => ( | ||
| <InteractionTag size="small" dismissible> | ||
| Primary Text | ||
| </InteractionTag> | ||
| ); | ||
| export const SizeSmallWithIcon = () => ( | ||
| <InteractionTag size="small" icon={<CalendarMonth />}> | ||
| Primary Text | ||
| </InteractionTag> | ||
| ); | ||
| export const SizeSmallWithMedia = () => ( | ||
| <InteractionTag size="small" media={<Avatar name="Lydia Bauer" badge={{ status: 'available' }} />}> | ||
| Primary Text | ||
| </InteractionTag> | ||
| ); | ||
|
|
||
| export const SizeExtraSmall = () => <InteractionTag size="extra-small">Primary Text</InteractionTag>; | ||
| export const SizeExtraSmallDismissible = () => ( | ||
| <InteractionTag size="extra-small" dismissible> | ||
| Primary Text | ||
| </InteractionTag> | ||
| ); | ||
| export const SizeExtraSmallWithIcon = () => ( | ||
| <InteractionTag size="extra-small" icon={<CalendarMonth />}> | ||
| Primary Text | ||
| </InteractionTag> | ||
| ); | ||
| export const SizeExtraSmallWithMedia = () => ( | ||
| <InteractionTag size="extra-small" media={<Avatar name="Lydia Bauer" badge={{ status: 'available' }} />}> | ||
| Primary Text | ||
| </InteractionTag> | ||
| ); |
83 changes: 83 additions & 0 deletions
83
apps/vr-tests-react-components/src/stories/Tag/Tag.stories.tsx
This file contains hidden or 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 { 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, RTL } from '../../utilities'; | ||
| import { Avatar } from '@fluentui/react-avatar'; | ||
| import { Steps } from 'storywright'; | ||
|
|
||
| const CalendarMonth = bundleIcon(CalendarMonthFilled, CalendarMonthRegular); | ||
|
|
||
| const steps = new Steps().snapshot('default', { cropTo: '.testWrapper' }).end(); | ||
|
|
||
| export default { | ||
| title: 'Tag Converged', | ||
| Component: Tag, | ||
| decorators: [story => withStoryWrightSteps({ story, steps })], | ||
| } as ComponentMeta<typeof Tag>; | ||
|
|
||
| export const Default = () => <Tag>Primary Text</Tag>; | ||
|
|
||
| export const DefaultRTL = getStoryVariant(Default, RTL); | ||
| export const DefaultDarkMode = getStoryVariant(Default, DARK_MODE); | ||
| export const DefaultHighContrast = getStoryVariant(Default, HIGH_CONTRAST); | ||
|
|
||
| // disabled | ||
| export const Disabled = () => ( | ||
| <Tag disabled dismissible icon={<CalendarMonth />}> | ||
| Primary Text | ||
| </Tag> | ||
| ); | ||
| export const DisabledHighContrast = getStoryVariant(Disabled, HIGH_CONTRAST); | ||
| export const DisabledDarkMode = getStoryVariant(Disabled, DARK_MODE); | ||
|
|
||
| export const OutlineDisabled = () => ( | ||
| <Tag appearance="outline" disabled dismissible icon={<CalendarMonth />}> | ||
| Primary Text | ||
| </Tag> | ||
| ); | ||
| export const OutlineDisabledHighContrast = getStoryVariant(OutlineDisabled, HIGH_CONTRAST); | ||
| export const OutlineDisabledDarkMode = getStoryVariant(OutlineDisabled, DARK_MODE); | ||
|
|
||
| export const BrandDisabled = () => ( | ||
| <Tag appearance="brand" disabled dismissible icon={<CalendarMonth />}> | ||
| Primary Text | ||
| </Tag> | ||
| ); | ||
| export const BrandDisabledHighContrast = getStoryVariant(BrandDisabled, HIGH_CONTRAST); | ||
| export const BrandDisabledDarkMode = getStoryVariant(BrandDisabled, DARK_MODE); | ||
|
|
||
| // size | ||
| export const SizeSmall = () => <Tag size="small">Primary Text</Tag>; | ||
| export const SizeSmallDismissible = () => ( | ||
| <Tag size="small" dismissible> | ||
| Primary Text | ||
| </Tag> | ||
| ); | ||
| export const SizeSmallWithIcon = () => ( | ||
| <Tag size="small" icon={<CalendarMonth />}> | ||
| Primary Text | ||
| </Tag> | ||
| ); | ||
| export const SizeSmallWithMedia = () => ( | ||
| <Tag size="small" media={<Avatar name="Lydia Bauer" badge={{ status: 'available' }} />}> | ||
| Primary Text | ||
| </Tag> | ||
| ); | ||
|
|
||
| export const SizeExtraSmall = () => <Tag size="extra-small">Primary Text</Tag>; | ||
| export const SizeExtraSmallDismissible = () => ( | ||
| <Tag size="extra-small" dismissible> | ||
| Primary Text | ||
| </Tag> | ||
| ); | ||
| export const SizeExtraSmallWithIcon = () => ( | ||
| <Tag size="extra-small" icon={<CalendarMonth />}> | ||
| Primary Text | ||
| </Tag> | ||
| ); | ||
| export const SizeExtraSmallWithMedia = () => ( | ||
| <Tag size="extra-small" media={<Avatar name="Lydia Bauer" badge={{ status: 'available' }} />}> | ||
| Primary Text | ||
| </Tag> | ||
| ); |
55 changes: 55 additions & 0 deletions
55
apps/vr-tests-react-components/src/stories/Tag/TagGroup.stories.tsx
This file contains hidden or 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,55 @@ | ||
| import * as React from 'react'; | ||
| import { TagGroup, Tag, InteractionTag } from '@fluentui/react-tags-preview'; | ||
| import { ComponentMeta } from '@storybook/react'; | ||
| import { Steps } from 'storywright'; | ||
| import { withStoryWrightSteps } from '../../utilities'; | ||
|
|
||
| const steps = new Steps().snapshot('default', { cropTo: '.testWrapper' }).end(); | ||
|
|
||
| export default { | ||
| title: 'TagGroup Converged', | ||
| Component: TagGroup, | ||
| decorators: [story => withStoryWrightSteps({ story, steps })], | ||
| } as ComponentMeta<typeof TagGroup>; | ||
|
|
||
| export const Default = () => ( | ||
| <TagGroup> | ||
| <Tag>Tag 1</Tag> | ||
| <Tag>Tag 2</Tag> | ||
| <Tag>Tag 3</Tag> | ||
| </TagGroup> | ||
| ); | ||
|
|
||
| const onDismiss = () => ({}); | ||
| export const Dismissible = () => ( | ||
| <TagGroup onDismiss={onDismiss}> | ||
| <Tag>Tag 1</Tag> | ||
| <Tag>Tag 2</Tag> | ||
| <Tag>Tag 3</Tag> | ||
| </TagGroup> | ||
| ); | ||
|
|
||
| export const DismissibleWithInteractionTag = () => ( | ||
| <TagGroup onDismiss={onDismiss}> | ||
| <InteractionTag>Tag 1</InteractionTag> | ||
| <InteractionTag>Tag 2</InteractionTag> | ||
| <InteractionTag>Tag 3</InteractionTag> | ||
| </TagGroup> | ||
| ); | ||
|
|
||
| // size | ||
| export const SizeSmall = () => ( | ||
| <TagGroup size="small"> | ||
| <Tag>Tag 1</Tag> | ||
| <Tag>Tag 2</Tag> | ||
| <Tag>Tag 3</Tag> | ||
| </TagGroup> | ||
| ); | ||
|
|
||
| export const SizeExtraSmall = () => ( | ||
| <TagGroup size="extra-small"> | ||
| <Tag>Tag 1</Tag> | ||
| <Tag>Tag 2</Tag> | ||
| <Tag>Tag 3</Tag> | ||
| </TagGroup> | ||
| ); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.