Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions apps/vr-tests-web-components/src/stories/badge/badge.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import * as React from 'react';

@fabricteam fabricteam Aug 9, 2023

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵 fluentui-web-components-v3 Open the Visual Regressions report to inspect the affected screenshots

Badge 10 screenshots
Image Name Diff(in Pixels) Image Type
Badge.Appearance - Dark Mode.normal.chromium.png 0 Added
Badge.Appearance.normal.chromium.png 0 Added
Badge.Color - Dark Mode.normal.chromium.png 0 Added
Badge.Color.normal.chromium.png 0 Added
Badge.Default - Dark Mode.normal.chromium.png 0 Added
Badge.Default.normal.chromium.png 0 Added
Badge.Shape - Dark Mode.normal.chromium.png 0 Added
Badge.Shape.normal.chromium.png 0 Added
Badge.Size - Dark Mode.normal.chromium.png 0 Added
Badge.Size.normal.chromium.png 0 Added
Radio 8 screenshots
Image Name Diff(in Pixels) Image Type
Radio.Checked - Dark Mode.normal.chromium.png 0 Added
Radio.Checked.normal.chromium.png 0 Added
Radio.Default - Dark Mode.normal.chromium.png 0 Added
Radio.Default.normal.chromium.png 0 Added
Radio.Disabled - Dark Mode.normal.chromium.png 0 Added
Radio.Disabled Checked - Dark Mode.normal.chromium.png 0 Added
Radio.Disabled Checked.normal.chromium.png 0 Added
Radio.Disabled.normal.chromium.png 0 Added
RadioGroup 39 screenshots
Image Name Diff(in Pixels) Image Type
RadioGroup.Default - Dark Mode.1st selected.chromium.png 0 Added
RadioGroup.Default - Dark Mode.2nd selected.chromium.png 0 Added
RadioGroup.Default - Dark Mode.normal.chromium.png 0 Added
RadioGroup.Default - RTL.1st selected.chromium.png 0 Added
RadioGroup.Default - RTL.2nd selected.chromium.png 0 Added
RadioGroup.Default - RTL.normal.chromium.png 0 Added
RadioGroup.Default Checked.1st selected.chromium.png 0 Added
RadioGroup.Default Checked.2nd selected.chromium.png 0 Added
RadioGroup.Default Checked.normal.chromium.png 0 Added
RadioGroup.Default.1st selected.chromium.png 0 Added
RadioGroup.Default.2nd selected.chromium.png 0 Added
RadioGroup.Default.normal.chromium.png 0 Added
RadioGroup.Disabled - Dark Mode.1st selected.chromium.png 0 Added
RadioGroup.Disabled - Dark Mode.2nd selected.chromium.png 0 Added
RadioGroup.Disabled - Dark Mode.normal.chromium.png 0 Added
RadioGroup.Disabled Item - Dark Mode.1st selected.chromium.png 0 Added
RadioGroup.Disabled Item - Dark Mode.2nd selected.chromium.png 0 Added
RadioGroup.Disabled Item - Dark Mode.normal.chromium.png 0 Added
RadioGroup.Disabled Item.1st selected.chromium.png 0 Added
RadioGroup.Disabled Item.2nd selected.chromium.png 0 Added
RadioGroup.Disabled Item.normal.chromium.png 0 Added
RadioGroup.Disabled.1st selected.chromium.png 0 Added
RadioGroup.Disabled.2nd selected.chromium.png 0 Added
RadioGroup.Disabled.normal.chromium.png 0 Added
RadioGroup.Horizontal Stacked - RTL.1st selected.chromium.png 0 Added
RadioGroup.Horizontal Stacked - RTL.2nd selected.chromium.png 0 Added
RadioGroup.Horizontal Stacked - RTL.normal.chromium.png 0 Added
RadioGroup.Horizontal Stacked.1st selected.chromium.png 0 Added
RadioGroup.Horizontal Stacked.2nd selected.chromium.png 0 Added
RadioGroup.Horizontal Stacked.normal.chromium.png 0 Added
RadioGroup.Horizontal.1st selected.chromium.png 0 Added
RadioGroup.Horizontal.2nd selected.chromium.png 0 Added
RadioGroup.Horizontal.normal.chromium.png 0 Added
RadioGroup.Vertical - RTL.1st selected.chromium.png 0 Added
RadioGroup.Vertical - RTL.2nd selected.chromium.png 0 Added
RadioGroup.Vertical - RTL.normal.chromium.png 0 Added
RadioGroup.Vertical.1st selected.chromium.png 0 Added
RadioGroup.Vertical.2nd selected.chromium.png 0 Added
RadioGroup.Vertical.normal.chromium.png 0 Added

import parse from 'html-react-parser';
import { Steps, StoryWright } from 'storywright';
import { BadgeDefinition, FluentDesignSystem } from '@fluentui/web-components';
import { DARK_MODE, getStoryVariant } from '../../utilities/WCThemeDecorator';

BadgeDefinition.define(FluentDesignSystem.registry);

export default {
title: 'Badge',
decorators: [
(story: () => React.ReactElement) => {
return (
<StoryWright steps={new Steps().snapshot('normal', { cropTo: '.testWrapper' }).end()}>
<div className="testWrapper" style={{ width: '300px' }}>
{story()}
</div>
</StoryWright>
);
},
],
};

export const Default = () =>
parse(`
<fluent-badge></fluent-badge>
`);

export const DefaultDarkMode = getStoryVariant(Default, DARK_MODE);

export const Appearance = () =>
parse(`
<fluent-badge appearance="filled">filled</fluent-badge>
<fluent-badge appearance="ghost">ghost</fluent-badge>
<fluent-badge appearance="outline">outline</fluent-badge>
<fluent-badge appearance="tint">tint</fluent-badge>
`);

export const AppearanceDarkMode = getStoryVariant(Appearance, DARK_MODE);

export const Color = () =>
parse(`
<fluent-badge color="brand">brand</fluent-badge>
<fluent-badge color="danger">danger</fluent-badge>
<fluent-badge color="important">important</fluent-badge>
<fluent-badge color="informative">informative</fluent-badge>
<fluent-badge color="severe">severe</fluent-badge>
<fluent-badge color="subtle">subtle</fluent-badge>
<fluent-badge color="success">success</fluent-badge>
<fluent-badge color="warning">warning</fluent-badge>
`);

export const ColorDarkMode = getStoryVariant(Color, DARK_MODE);

export const Shape = () =>
parse(`
<fluent-badge shape="circular"></fluent-badge>
<fluent-badge shape="rounded"></fluent-badge>
<fluent-badge shape="square"></fluent-badge>
`);

export const ShapeDarkMode = getStoryVariant(Shape, DARK_MODE);

export const Size = () =>
parse(`
<fluent-badge size="tiny"></fluent-badge>
<fluent-badge size="extra-small"></fluent-badge>
<fluent-badge size="small"></fluent-badge>
<fluent-badge size="medium"></fluent-badge>
<fluent-badge size="large"></fluent-badge>
<fluent-badge size="extra-large"></fluent-badge>
`);

export const SizeDarkMode = getStoryVariant(Size, DARK_MODE);