-
Notifications
You must be signed in to change notification settings - Fork 2.9k
react-tags-preview: add more vr test #28582
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
Changes from 11 commits
Commits
Show all changes
16 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 60d7c00
Revert "remove some stories"
YuanboXue-Amber 28f4bb3
delete other tests
YuanboXue-Amber f3ede49
Merge branch 'master' into tag-vr-2
YuanboXue-Amber 7bd3501
remove id from non-focusable-tag
YuanboXue-Amber 06856cd
fix crud
YuanboXue-Amber f4461da
Merge branch 'tag-vr-2' of https://github.com/YuanboXue-Amber/fluentu…
YuanboXue-Amber e20b974
add attribute for focus
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
70 changes: 70 additions & 0 deletions
70
apps/vr-tests-react-components/src/stories/Tag/InteractionTagAppearances.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,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 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,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); |
49 changes: 49 additions & 0 deletions
49
apps/vr-tests-react-components/src/stories/Tag/TagAppearances.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,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); |
67 changes: 67 additions & 0 deletions
67
apps/vr-tests-react-components/src/stories/Tag/TagShape.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,67 @@ | ||
| import * as React from 'react'; | ||
| import { Tag } 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 tagId = 'tag-id'; | ||
| const steps = new Steps() | ||
| .snapshot('default', { cropTo: '.testWrapper' }) | ||
| .focus(`#${tagId}}`) | ||
| .snapshot('focused', { cropTo: '.testWrapper' }) | ||
| .end(); | ||
|
|
||
| export default { | ||
| title: 'Tag Converged', | ||
| Component: Tag, | ||
| decorators: [story => withStoryWrightSteps({ story, steps })], | ||
| } as ComponentMeta<typeof Tag>; | ||
|
|
||
| export const Rounded = () => <Tag id={tagId}>Primary Text</Tag>; | ||
|
|
||
| export const RoundedWithSecondaryText = () => ( | ||
| <Tag id={tagId} secondaryText="Secondary Text"> | ||
| Primary Text | ||
| </Tag> | ||
| ); | ||
|
|
||
| export const RoundedWithMedia = () => ( | ||
| <Tag id={tagId} media={<Avatar name="Lydia Bauer" badge={{ status: 'available' }} />}> | ||
| Primary Text | ||
| </Tag> | ||
| ); | ||
| export const RoundedWithMediaRTL = getStoryVariant(RoundedWithMedia, RTL); | ||
|
|
||
| export const RoundedDismissible = () => ( | ||
| <Tag id={tagId} dismissible> | ||
| Primary Text | ||
| </Tag> | ||
| ); | ||
| export const RoundedDismissibleRTL = getStoryVariant(RoundedDismissible, RTL); | ||
|
|
||
| export const Circular = () => ( | ||
| <Tag id={tagId} shape="circular"> | ||
| Primary Text | ||
| </Tag> | ||
| ); | ||
|
|
||
| export const CircularWithSecondaryText = () => ( | ||
| <Tag id={tagId} secondaryText="Secondary Text"> | ||
| Primary Text | ||
| </Tag> | ||
| ); | ||
|
|
||
| export const CircularWithMedia = () => ( | ||
| <Tag id={tagId} shape="circular" media={<Avatar name="Lydia Bauer" badge={{ status: 'available' }} />}> | ||
| Primary Text | ||
| </Tag> | ||
| ); | ||
| export const CircularWithMediaRTL = getStoryVariant(CircularWithMedia, RTL); | ||
|
|
||
| export const CircularDismissible = () => ( | ||
| <Tag id={tagId} shape="circular" dismissible> | ||
| Primary Text | ||
| </Tag> | ||
| ); | ||
| export const CircularDismissibleRTL = getStoryVariant(CircularDismissible, RTL); |
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.