From dd86813301e892ea6491292984351a4cf6a68783 Mon Sep 17 00:00:00 2001 From: Miroslav Stastny Date: Thu, 19 May 2022 16:58:30 +0200 Subject: [PATCH 01/11] fix(react-theme): Remove webHighContrast theme --- apps/vr-tests-react-components/.storybook/preview.js | 4 ++-- .../react-card/src/stories/CardAppearance.stories.tsx | 4 ++-- .../react-components/etc/react-components.api.md | 3 --- packages/react-components/react-components/src/index.ts | 1 - .../etc/react-storybook-addon.api.md | 4 ---- .../react-components/react-storybook-addon/src/theme.ts | 2 -- .../react-storybook/src/knobs/useFluentTheme.ts | 2 -- .../react-switch/src/stories/SwitchThemed.stories.tsx | 6 +++--- .../react-components/react-theme/etc/react-theme.api.md | 3 --- packages/react-components/react-theme/src/index.ts | 9 +-------- .../react-theme/src/themes/web/highContrastTheme.ts | 4 ---- .../react-components/react-theme/src/themes/web/index.ts | 1 - 12 files changed, 8 insertions(+), 35 deletions(-) delete mode 100644 packages/react-components/react-theme/src/themes/web/highContrastTheme.ts diff --git a/apps/vr-tests-react-components/.storybook/preview.js b/apps/vr-tests-react-components/.storybook/preview.js index 9075813bbd9ff..cf398f5828d91 100644 --- a/apps/vr-tests-react-components/.storybook/preview.js +++ b/apps/vr-tests-react-components/.storybook/preview.js @@ -1,7 +1,7 @@ // @ts-check import * as React from 'react'; import { setAddon } from '@storybook/react'; -import { webLightTheme, webHighContrastTheme, webDarkTheme } from '@fluentui/react-theme'; +import { webLightTheme, teamsHighContrastTheme, webDarkTheme } from '@fluentui/react-theme'; import { FluentProvider } from '@fluentui/react-provider'; /** @@ -44,7 +44,7 @@ setAddon({ } if (config.includeHighContrast) { this.add(storyName + ' - High Contrast', context => { - return {storyFn(context)}; + return {storyFn(context)}; }); } diff --git a/packages/react-components/react-card/src/stories/CardAppearance.stories.tsx b/packages/react-components/react-card/src/stories/CardAppearance.stories.tsx index fc75419322bf4..a3e8c5b4cbe8d 100644 --- a/packages/react-components/react-card/src/stories/CardAppearance.stories.tsx +++ b/packages/react-components/react-card/src/stories/CardAppearance.stories.tsx @@ -4,7 +4,7 @@ import { Headline, Title3 } from '@fluentui/react-text'; import { makeStyles, shorthands } from '@griffel/react'; import { SampleCard } from './SampleCard.stories'; import { FluentProvider } from '@fluentui/react-provider'; -import { webDarkTheme, webHighContrastTheme, webLightTheme } from '@fluentui/react-theme'; +import { webDarkTheme, teamsHighContrastTheme, webLightTheme } from '@fluentui/react-theme'; const useStyles = makeStyles({ container: { @@ -85,7 +85,7 @@ export const Appearance = () => { - + diff --git a/packages/react-components/react-components/etc/react-components.api.md b/packages/react-components/react-components/etc/react-components.api.md index f97407be2390f..e84fac1954de2 100644 --- a/packages/react-components/react-components/etc/react-components.api.md +++ b/packages/react-components/react-components/etc/react-components.api.md @@ -547,7 +547,6 @@ import { useTooltip_unstable } from '@fluentui/react-tooltip'; import { useTooltipStyles_unstable } from '@fluentui/react-tooltip'; import { VerticalSpacingTokens } from '@fluentui/react-theme'; import { webDarkTheme } from '@fluentui/react-theme'; -import { webHighContrastTheme } from '@fluentui/react-theme'; import { webLightTheme } from '@fluentui/react-theme'; export { __styles } @@ -1636,8 +1635,6 @@ export { VerticalSpacingTokens } export { webDarkTheme } -export { webHighContrastTheme } - export { webLightTheme } // (No @packageDocumentation comment for this package) diff --git a/packages/react-components/react-components/src/index.ts b/packages/react-components/react-components/src/index.ts index bb0d8b1b16699..763f3ef982e07 100644 --- a/packages/react-components/react-components/src/index.ts +++ b/packages/react-components/react-components/src/index.ts @@ -86,7 +86,6 @@ export { tokens, typographyStyles, webDarkTheme, - webHighContrastTheme, webLightTheme, } from '@fluentui/react-theme'; export type { diff --git a/packages/react-components/react-storybook-addon/etc/react-storybook-addon.api.md b/packages/react-components/react-storybook-addon/etc/react-storybook-addon.api.md index b1244a204d005..c9d140b21ddb9 100644 --- a/packages/react-components/react-storybook-addon/etc/react-storybook-addon.api.md +++ b/packages/react-components/react-storybook-addon/etc/react-storybook-addon.api.md @@ -35,10 +35,6 @@ export const themes: readonly [{ readonly id: "web-dark"; readonly label: "Web Dark"; readonly theme: Theme; -}, { - readonly id: "web-high-contrast"; - readonly label: "Web High Contrast"; - readonly theme: Theme; }, { readonly id: "teams-light"; readonly label: "Teams Light"; diff --git a/packages/react-components/react-storybook-addon/src/theme.ts b/packages/react-components/react-storybook-addon/src/theme.ts index e69ac8d2bfa5e..6727b72a73c84 100644 --- a/packages/react-components/react-storybook-addon/src/theme.ts +++ b/packages/react-components/react-storybook-addon/src/theme.ts @@ -1,7 +1,6 @@ import { webLightTheme, webDarkTheme, - webHighContrastTheme, teamsLightTheme, teamsDarkTheme, teamsHighContrastTheme, @@ -14,7 +13,6 @@ export { FluentProvider } from '@fluentui/react-provider'; export const themes = [ { id: 'web-light', label: 'Web Light', theme: webLightTheme }, { id: 'web-dark', label: 'Web Dark', theme: webDarkTheme }, - { id: 'web-high-contrast', label: 'Web High Contrast', theme: webHighContrastTheme }, { id: 'teams-light', label: 'Teams Light', theme: teamsLightTheme }, { id: 'teams-dark', label: 'Teams Dark', theme: teamsDarkTheme }, { id: 'teams-high-contrast', label: 'Teams High Contrast', theme: teamsHighContrastTheme }, diff --git a/packages/react-components/react-storybook/src/knobs/useFluentTheme.ts b/packages/react-components/react-storybook/src/knobs/useFluentTheme.ts index 558cf43ae69dc..0d52aafdf149f 100644 --- a/packages/react-components/react-storybook/src/knobs/useFluentTheme.ts +++ b/packages/react-components/react-storybook/src/knobs/useFluentTheme.ts @@ -1,7 +1,6 @@ import { webLightTheme, webDarkTheme, - webHighContrastTheme, teamsLightTheme, teamsDarkTheme, teamsHighContrastTheme, @@ -14,7 +13,6 @@ const themeSelectorLabel = 'Theme'; const themeOptions = [ { label: 'Web Light', theme: webLightTheme }, { label: 'Web Dark', theme: webDarkTheme }, - { label: 'Web High Contrast', theme: webHighContrastTheme }, { label: 'Teams Light', theme: teamsLightTheme }, { label: 'Teams Dark', theme: teamsDarkTheme }, { label: 'Teams High Contrast', theme: teamsHighContrastTheme }, diff --git a/packages/react-components/react-switch/src/stories/SwitchThemed.stories.tsx b/packages/react-components/react-switch/src/stories/SwitchThemed.stories.tsx index 6e6c5a34a5251..dda58fe7752bf 100644 --- a/packages/react-components/react-switch/src/stories/SwitchThemed.stories.tsx +++ b/packages/react-components/react-switch/src/stories/SwitchThemed.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { FluentProvider } from '@fluentui/react-provider'; -import { webDarkTheme, webHighContrastTheme, webLightTheme } from '@fluentui/react-theme'; +import { webDarkTheme, teamsHighContrastTheme, webLightTheme } from '@fluentui/react-theme'; import { Switch } from '../index'; const outerWrapperStyle: React.CSSProperties = { @@ -33,7 +33,7 @@ export const Themed = () => ( - + @@ -47,7 +47,7 @@ export const Themed = () => ( - + diff --git a/packages/react-components/react-theme/etc/react-theme.api.md b/packages/react-components/react-theme/etc/react-theme.api.md index 5305cc58552dd..c96aa8b2d0883 100644 --- a/packages/react-components/react-theme/etc/react-theme.api.md +++ b/packages/react-components/react-theme/etc/react-theme.api.md @@ -522,9 +522,6 @@ export type VerticalSpacingTokens = { // @public (undocumented) export const webDarkTheme: Theme; -// @public (undocumented) -export const webHighContrastTheme: Theme; - // @public (undocumented) export const webLightTheme: Theme; diff --git a/packages/react-components/react-theme/src/index.ts b/packages/react-components/react-theme/src/index.ts index 8c9615fd9a795..e53cf670bcd50 100644 --- a/packages/react-components/react-theme/src/index.ts +++ b/packages/react-components/react-theme/src/index.ts @@ -1,11 +1,4 @@ -export { - teamsDarkTheme, - teamsHighContrastTheme, - teamsLightTheme, - webDarkTheme, - webHighContrastTheme, - webLightTheme, -} from './themes/index'; +export { teamsDarkTheme, teamsHighContrastTheme, teamsLightTheme, webDarkTheme, webLightTheme } from './themes/index'; export { createDarkTheme, createHighContrastTheme, createLightTheme, createTeamsDarkTheme } from './utils/index'; export { themeToTokensObject } from './themeToTokensObject'; diff --git a/packages/react-components/react-theme/src/themes/web/highContrastTheme.ts b/packages/react-components/react-theme/src/themes/web/highContrastTheme.ts deleted file mode 100644 index cb730cf71b03d..0000000000000 --- a/packages/react-components/react-theme/src/themes/web/highContrastTheme.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { createHighContrastTheme } from '../../utils/createHighContrastTheme'; -import type { Theme } from '../../types'; - -export const webHighContrastTheme: Theme = createHighContrastTheme(); diff --git a/packages/react-components/react-theme/src/themes/web/index.ts b/packages/react-components/react-theme/src/themes/web/index.ts index 553fc643a162b..a5747057dff72 100644 --- a/packages/react-components/react-theme/src/themes/web/index.ts +++ b/packages/react-components/react-theme/src/themes/web/index.ts @@ -1,3 +1,2 @@ export * from './lightTheme'; export * from './darkTheme'; -export * from './highContrastTheme'; From ee9846751cbaaae3c54aa8e15314f00802ff55cc Mon Sep 17 00:00:00 2001 From: Miroslav Stastny Date: Thu, 19 May 2022 17:05:42 +0200 Subject: [PATCH 02/11] change file --- ...ct-components-fa0246a1-fd02-43e4-a4fb-5ba0c3bedea2.json | 7 +++++++ ...i-react-theme-a6575400-7777-47a9-bc10-00cc0cdb1775.json | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 change/@fluentui-react-components-fa0246a1-fd02-43e4-a4fb-5ba0c3bedea2.json create mode 100644 change/@fluentui-react-theme-a6575400-7777-47a9-bc10-00cc0cdb1775.json diff --git a/change/@fluentui-react-components-fa0246a1-fd02-43e4-a4fb-5ba0c3bedea2.json b/change/@fluentui-react-components-fa0246a1-fd02-43e4-a4fb-5ba0c3bedea2.json new file mode 100644 index 0000000000000..5bafae266acb8 --- /dev/null +++ b/change/@fluentui-react-components-fa0246a1-fd02-43e4-a4fb-5ba0c3bedea2.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Remove webHighContrast theme", + "packageName": "@fluentui/react-components", + "email": "miroslav.stastny@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-theme-a6575400-7777-47a9-bc10-00cc0cdb1775.json b/change/@fluentui-react-theme-a6575400-7777-47a9-bc10-00cc0cdb1775.json new file mode 100644 index 0000000000000..7e3856b6e75e3 --- /dev/null +++ b/change/@fluentui-react-theme-a6575400-7777-47a9-bc10-00cc0cdb1775.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Remove webHighContrast theme", + "packageName": "@fluentui/react-theme", + "email": "miroslav.stastny@microsoft.com", + "dependentChangeType": "patch" +} From 98ef426ab4419d2bec09ce11aecb887e86d89586 Mon Sep 17 00:00:00 2001 From: Makoto Morimoto Date: Thu, 19 May 2022 15:09:06 -0700 Subject: [PATCH 03/11] react-button: Removing deprecated block prop from all button components (#23071) * react-button: Removing deprecated block prop from all button components. * Removing block stories. * Adding changefile. * Removing block prop from migration guide and vr tests. --- .../src/stories/Button.stories.tsx | 228 ------------------ ...-fd44c043-6794-4163-b728-31531b359075.json | 7 + .../react-button/etc/react-button.api.md | 7 +- .../src/components/Button/Button.types.ts | 12 +- .../src/components/Button/MIGRATION.md | 3 +- .../src/components/Button/SPEC.md | 75 +----- .../Button/stories/ButtonBlock.stories.tsx | 15 -- .../src/components/Button/useButton.ts | 3 - .../src/components/Button/useButtonStyles.ts | 19 +- .../CompoundButton/CompoundButton.types.ts | 2 +- .../stories/CompoundButtonBlock.stories.tsx | 17 -- .../components/MenuButton/MenuButton.types.ts | 2 +- .../stories/MenuButtonBlock.stories.tsx | 25 -- .../stories/SplitButtonBlock.stories.tsx | 29 --- .../components/SplitButton/useSplitButton.ts | 4 - .../SplitButton/useSplitButtonStyles.ts | 14 +- .../stories/ToggleButtonBlock.stories.tsx | 15 -- 17 files changed, 17 insertions(+), 460 deletions(-) create mode 100644 change/@fluentui-react-button-fd44c043-6794-4163-b728-31531b359075.json delete mode 100644 packages/react-components/react-button/src/components/Button/stories/ButtonBlock.stories.tsx delete mode 100644 packages/react-components/react-button/src/components/CompoundButton/stories/CompoundButtonBlock.stories.tsx delete mode 100644 packages/react-components/react-button/src/components/MenuButton/stories/MenuButtonBlock.stories.tsx delete mode 100644 packages/react-components/react-button/src/components/SplitButton/stories/SplitButtonBlock.stories.tsx delete mode 100644 packages/react-components/react-button/src/components/ToggleButton/stories/ToggleButtonBlock.stories.tsx diff --git a/apps/vr-tests-react-components/src/stories/Button.stories.tsx b/apps/vr-tests-react-components/src/stories/Button.stories.tsx index 87a60be745751..68be66eb1cd8b 100644 --- a/apps/vr-tests-react-components/src/stories/Button.stories.tsx +++ b/apps/vr-tests-react-components/src/stories/Button.stories.tsx @@ -152,58 +152,6 @@ storiesOf('Button Converged', module) includeRtl: true, }); -storiesOf('Button Block Converged', module) - .addDecorator(story => {story()}) - .addStory( - 'Default', - () => ( - - ), - { includeRtl: true }, - ) - .addStory('Circular', () => ( - - )) - .addStory('Outline', () => ( - - )) - .addStory('Primary', () => ( - - )) - .addStory('Subtle', () => ( - - )) - .addStory('Transparent', () => ( - - )) - .addStory('Disabled', () => ( - - )) - .addStory('Size small', () => ( - - )) - .addStory('Size large', () => ( - - )); - storiesOf('CompoundButton Converged', module) .addDecorator(story => ( {story()}) - .addStory( - 'Default', - () => ( - - Hello, world - - ), - { includeRtl: true }, - ) - .addStory('Circular', () => ( - - Hello, world - - )) - .addStory('Outline', () => ( - - Hello, world - - )) - .addStory('Primary', () => ( - - Hello, world - - )) - .addStory('Subtle', () => ( - - Hello, world - - )) - .addStory('Transparent', () => ( - - Hello, world - - )) - .addStory('Disabled', () => ( - - Hello, world - - )) - .addStory('Size small', () => ( - - Hello, world - - )) - .addStory('Size large', () => ( - - Hello, world - - )); - storiesOf('ToggleButton Converged', module) .addDecorator(story => {story()}) .addStory('Default', () => Hello, world, { @@ -469,78 +365,6 @@ storiesOf('ToggleButton Converged', module) )); -storiesOf('ToggleButton Block Converged', module) - .addDecorator(story => {story()}) - .addStory( - 'Default', - () => ( - - Hello, world - - ), - { includeRtl: true }, - ) - .addStory('Circular', () => ( - - Hello, world - - )) - .addStory('Outline', () => ( - - Hello, world - - )) - .addStory('Primary', () => ( - - Hello, world - - )) - .addStory('Subtle', () => ( - - Hello, world - - )) - .addStory('Transparent', () => ( - - Hello, world - - )) - .addStory('Disabled', () => ( - - Hello, world - - )) - .addStory('Size small', () => ( - - Hello, world - - )) - .addStory('Size large', () => ( - - Hello, world - - )) - .addStory('Checked', () => ( - - Hello, world - - )) - .addStory('Primary Checked', () => ( - - Hello, world - - )) - .addStory('Subtle Checked', () => ( - - Hello, world - - )) - .addStory('Transparent Checked', () => ( - - Hello, world - - )); - storiesOf('MenuButton Converged', module) .addDecorator(story => {story()}) .addStory('Default', () => Hello, world, { includeRtl: true }) @@ -611,55 +435,3 @@ storiesOf('MenuButton Converged', module) )) .addStory('Icon only', () => ) .addStory('Circular and icon only', () => ); - -storiesOf('MenuButton Block Converged', module) - .addDecorator(story => {story()}) - .addStory( - 'Default', - () => ( - - Hello, world - - ), - { includeRtl: true }, - ) - .addStory('Circular', () => ( - - Hello, world - - )) - .addStory('Outline', () => ( - - Hello, world - - )) - .addStory('Primary', () => ( - - Hello, world - - )) - .addStory('Subtle', () => ( - - Hello, world - - )) - .addStory('Transparent', () => ( - - Hello, world - - )) - .addStory('Disabled', () => ( - - Hello, world - - )) - .addStory('Size small', () => ( - - Hello, world - - )) - .addStory('Size large', () => ( - - Hello, world - - )); diff --git a/change/@fluentui-react-button-fd44c043-6794-4163-b728-31531b359075.json b/change/@fluentui-react-button-fd44c043-6794-4163-b728-31531b359075.json new file mode 100644 index 0000000000000..6557ae8cb6ac2 --- /dev/null +++ b/change/@fluentui-react-button-fd44c043-6794-4163-b728-31531b359075.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Removing deprecated block prop from all button components.", + "packageName": "@fluentui/react-button", + "email": "Humberto.Morimoto@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-button/etc/react-button.api.md b/packages/react-components/react-button/etc/react-button.api.md index 58f6cabb2edb2..c098a7c86e472 100644 --- a/packages/react-components/react-button/etc/react-button.api.md +++ b/packages/react-components/react-button/etc/react-button.api.md @@ -24,7 +24,6 @@ export const buttonClassNames: SlotClassNames; // @public (undocumented) export type ButtonProps = ComponentProps & { appearance?: 'secondary' | 'primary' | 'outline' | 'subtle' | 'transparent'; - block?: boolean; disabledFocusable?: boolean; disabled?: boolean; iconPosition?: 'before' | 'after'; @@ -39,7 +38,7 @@ export type ButtonSlots = { }; // @public (undocumented) -export type ButtonState = ComponentState & Required> & { +export type ButtonState = ComponentState & Required> & { iconOnly: boolean; }; @@ -53,7 +52,7 @@ export const compoundButtonClassName: string; export const compoundButtonClassNames: SlotClassNames; // @public (undocumented) -export type CompoundButtonProps = ComponentProps> & Pick; +export type CompoundButtonProps = ComponentProps> & Pick; // @public (undocumented) export type CompoundButtonSlots = ButtonSlots & { @@ -74,7 +73,7 @@ export const menuButtonClassName: string; export const menuButtonClassNames: SlotClassNames; // @public (undocumented) -export type MenuButtonProps = ComponentProps & Pick; +export type MenuButtonProps = ComponentProps & Pick; // @public (undocumented) export type MenuButtonSlots = ButtonSlots & { diff --git a/packages/react-components/react-button/src/components/Button/Button.types.ts b/packages/react-components/react-button/src/components/Button/Button.types.ts index 91dbfb92c8ee2..5b078d8c14c9c 100644 --- a/packages/react-components/react-button/src/components/Button/Button.types.ts +++ b/packages/react-components/react-button/src/components/Button/Button.types.ts @@ -26,14 +26,6 @@ export type ButtonProps = ComponentProps & { */ appearance?: 'secondary' | 'primary' | 'outline' | 'subtle' | 'transparent'; - /** - * A button can fill the width of its container. - * @default false - * - * @deprecated - Use style overrides instead. - */ - block?: boolean; - /** * When set, allows the button to be focusable even when it has been disabled. This is used in scenarios where it * is important to keep a consistent tab order for screen reader and keyboard users. The primary example of this @@ -73,9 +65,7 @@ export type ButtonProps = ComponentProps & { }; export type ButtonState = ComponentState & - Required< - Pick - > & { + Required> & { /** * A button can contain only an icon. * diff --git a/packages/react-components/react-button/src/components/Button/MIGRATION.md b/packages/react-components/react-button/src/components/Button/MIGRATION.md index 54e7b2d7396c9..68562e9ddedf0 100644 --- a/packages/react-components/react-button/src/components/Button/MIGRATION.md +++ b/packages/react-components/react-button/src/components/Button/MIGRATION.md @@ -100,7 +100,6 @@ Common buttons now all map to `Button`: ### Renamed props -- `fluid` => `block` - `text` => `transparent` ### Props removed because we can get them from HTML props @@ -142,7 +141,7 @@ Common buttons now all map to `Button`: | `description` | | | | `disabled` | `disabled` | `disabled` | | `elementRef` | | `ref` | -| | `fluid` | `block` | +| | `fluid` | | | `getClassNames` | | | | `getSplitButtonClassNames` | | | | `href` | | `href` | diff --git a/packages/react-components/react-button/src/components/Button/SPEC.md b/packages/react-components/react-button/src/components/Button/SPEC.md index fe9f853746432..e37420d74651b 100644 --- a/packages/react-components/react-button/src/components/Button/SPEC.md +++ b/packages/react-components/react-button/src/components/Button/SPEC.md @@ -60,10 +60,6 @@ The `Button` component can include an `icon` that appears before or after its `c The `Button` component supports different sizing with at least three different sizes: `small`, `medium` (default) and `large`. -### Block - -The `Button` component can completely fill the width of its container. - ### Loading The `Button` component can be loading if it's waiting for another action to occur before allowing itself to be interacted with. @@ -78,76 +74,7 @@ The `Button` component can be loading if it's waiting for another action to occu ### Props -```ts -export type ButtonProps = ComponentPropsCompat & - React.ButtonHTMLAttributes & { - /** - * A button can have its content and borders styled for greater emphasis or to be subtle. - * - 'primary': Emphasizes the button as a primary action. - * - 'outline': Removes background styling. - * - 'subtle': Minimzes emphasis to blend into the background until hovered or focused. - * - 'transparent': Removes background and border styling. - */ - appearance?: 'primary' | 'outline' | 'subtle' | 'transparent'; - - /** - * Icon slot that, if specified, renders an icon either before or after the `children` as specified by the - * `iconPosition` prop. - */ - icon?: ShorthandPropsCompat>; - - // /** - // * Loader slot that, if specified, renders a `loader` before the `icon` and `children` while the `loading` flag - // * is set to `true`. - // */ - // loader?: ShorthandPropsCompat>; - - /** - * A button can fill the width of its container. - * @default false - */ - block?: boolean; - - /** - * A button can show that it cannot be interacted with. - * @default false - */ - disabled?: boolean; - - /** - * When set, allows the button to be focusable even when it has been disabled. This is used in scenarios where it - * is important to keep a consistent tab order for screen reader and keyboard users. The primary example of this - * pattern is when the disabled button is in a menu or a commandbar and is seldom used for standalone buttons. - * @default false - */ - disabledFocusable?: boolean; - - /** - * A button can format its icon to appear before or after its content. - * @default 'before' - */ - iconPosition?: 'before' | 'after'; - - // /** - // * A button can show a loading indicator if it is waiting for another action to happen before allowing itself to - // * be interacted with. - // * @default false - // */ - // loading?: boolean; - - /** - * A button can be rounded, circular, or square. - * @default 'rounded' - */ - shape?: 'rounded' | 'circular' | 'square'; - - /** - * A button supports different sizes. - * @default 'medium' - */ - size?: 'small' | 'medium' | 'large'; - }; -``` +See API interface in [Button.types.ts](./Button.types.ts). ### Styling Tokens diff --git a/packages/react-components/react-button/src/components/Button/stories/ButtonBlock.stories.tsx b/packages/react-components/react-button/src/components/Button/stories/ButtonBlock.stories.tsx deleted file mode 100644 index 1b70f32a0a663..0000000000000 --- a/packages/react-components/react-button/src/components/Button/stories/ButtonBlock.stories.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import * as React from 'react'; -import { Button } from '../../../Button'; - -export const Block = () => ( - <> - - -); -Block.parameters = { - docs: { - description: { - story: 'A button can fill the width of its container.', - }, - }, -}; diff --git a/packages/react-components/react-button/src/components/Button/useButton.ts b/packages/react-components/react-button/src/components/Button/useButton.ts index d7fb6b4952f55..bd9d09f0eca00 100644 --- a/packages/react-components/react-button/src/components/Button/useButton.ts +++ b/packages/react-components/react-button/src/components/Button/useButton.ts @@ -16,8 +16,6 @@ export const useButton_unstable = ( const { appearance = 'secondary', as, - // eslint-disable-next-line deprecation/deprecation - block = false, disabled = false, disabledFocusable = false, icon, @@ -30,7 +28,6 @@ export const useButton_unstable = ( return { // Props passed at the top-level appearance, - block, disabled, disabledFocusable, iconPosition, diff --git a/packages/react-components/react-button/src/components/Button/useButtonStyles.ts b/packages/react-components/react-button/src/components/Button/useButtonStyles.ts index 9435b14bff5ed..5da2fb1e84a11 100644 --- a/packages/react-components/react-button/src/components/Button/useButtonStyles.ts +++ b/packages/react-components/react-button/src/components/Button/useButtonStyles.ts @@ -89,12 +89,6 @@ const useRootStyles = makeStyles({ }, }, - // Block styles - block: { - maxWidth: '100%', - width: '100%', - }, - // Appearance variations outline: { backgroundColor: tokens.colorTransparentBackground, @@ -437,17 +431,7 @@ export const useButtonStyles_unstable = (state: ButtonState): ButtonState => { const rootIconOnlyStyles = useRootIconOnlyStyles(); const iconStyles = useIconStyles(); - const { - appearance, - // eslint-disable-next-line deprecation/deprecation - block, - disabled, - disabledFocusable, - iconOnly, - iconPosition, - shape, - size, - } = state; + const { appearance, disabled, disabledFocusable, iconOnly, iconPosition, shape, size } = state; state.root.className = mergeClasses( buttonClassNames.root, @@ -455,7 +439,6 @@ export const useButtonStyles_unstable = (state: ButtonState): ButtonState => { // Root styles rootStyles.base, rootStyles.highContrast, - block && rootStyles.block, appearance && rootStyles[appearance], rootStyles[size], rootStyles[shape], diff --git a/packages/react-components/react-button/src/components/CompoundButton/CompoundButton.types.ts b/packages/react-components/react-button/src/components/CompoundButton/CompoundButton.types.ts index 482f399ce7d70..59f4e6a54cd5b 100644 --- a/packages/react-components/react-button/src/components/CompoundButton/CompoundButton.types.ts +++ b/packages/react-components/react-button/src/components/CompoundButton/CompoundButton.types.ts @@ -14,7 +14,7 @@ export type CompoundButtonSlots = ButtonSlots & { }; export type CompoundButtonProps = ComponentProps> & - Pick; + Pick; export type CompoundButtonState = ComponentState & Omit; diff --git a/packages/react-components/react-button/src/components/CompoundButton/stories/CompoundButtonBlock.stories.tsx b/packages/react-components/react-button/src/components/CompoundButton/stories/CompoundButtonBlock.stories.tsx deleted file mode 100644 index bb9bdc39c77b4..0000000000000 --- a/packages/react-components/react-button/src/components/CompoundButton/stories/CompoundButtonBlock.stories.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import * as React from 'react'; -import { CompoundButton } from '../../../CompoundButton'; - -export const Block = () => ( - <> - - Block - - -); -Block.parameters = { - docs: { - description: { - story: 'A compound button can fill the width of its container.', - }, - }, -}; diff --git a/packages/react-components/react-button/src/components/MenuButton/MenuButton.types.ts b/packages/react-components/react-button/src/components/MenuButton/MenuButton.types.ts index e538bc39baed8..f630f660ac85b 100644 --- a/packages/react-components/react-button/src/components/MenuButton/MenuButton.types.ts +++ b/packages/react-components/react-button/src/components/MenuButton/MenuButton.types.ts @@ -9,7 +9,7 @@ export type MenuButtonSlots = ButtonSlots & { }; export type MenuButtonProps = ComponentProps & - Pick; + Pick; export type MenuButtonState = ComponentState & Omit; diff --git a/packages/react-components/react-button/src/components/MenuButton/stories/MenuButtonBlock.stories.tsx b/packages/react-components/react-button/src/components/MenuButton/stories/MenuButtonBlock.stories.tsx deleted file mode 100644 index ae82b5de3732b..0000000000000 --- a/packages/react-components/react-button/src/components/MenuButton/stories/MenuButtonBlock.stories.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import * as React from 'react'; -import { Menu, MenuItem, MenuList, MenuPopover, MenuTrigger } from '@fluentui/react-menu'; -import { MenuButton } from '../../../MenuButton'; - -export const Block = () => ( - - - Block - - - - - Item a - Item b - - - -); -Block.parameters = { - docs: { - description: { - story: 'A menu button can fill the width of its container.', - }, - }, -}; diff --git a/packages/react-components/react-button/src/components/SplitButton/stories/SplitButtonBlock.stories.tsx b/packages/react-components/react-button/src/components/SplitButton/stories/SplitButtonBlock.stories.tsx deleted file mode 100644 index 8a72dd27990d5..0000000000000 --- a/packages/react-components/react-button/src/components/SplitButton/stories/SplitButtonBlock.stories.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import * as React from 'react'; -import { Menu, MenuItem, MenuList, MenuPopover, MenuTrigger } from '@fluentui/react-menu'; -import { SplitButton, MenuButtonProps } from '../../../index'; - -export const Block = () => ( - - - {(triggerProps: MenuButtonProps) => ( - - Block - - )} - - - - - Item a - Item b - - - -); -Block.parameters = { - docs: { - description: { - story: 'A split button can fill the width of its container.', - }, - }, -}; diff --git a/packages/react-components/react-button/src/components/SplitButton/useSplitButton.ts b/packages/react-components/react-button/src/components/SplitButton/useSplitButton.ts index 91eb55a1f8b2b..aad478a4c7df6 100644 --- a/packages/react-components/react-button/src/components/SplitButton/useSplitButton.ts +++ b/packages/react-components/react-button/src/components/SplitButton/useSplitButton.ts @@ -15,8 +15,6 @@ export const useSplitButton_unstable = ( ): SplitButtonState => { const { appearance = 'secondary', - // eslint-disable-next-line deprecation/deprecation - block = false, children, disabled = false, disabledFocusable = false, @@ -46,7 +44,6 @@ export const useSplitButton_unstable = ( const primaryActionButtonShorthand = resolveShorthand(primaryActionButton, { defaultProps: { appearance, - block, children, disabled, disabledFocusable, @@ -73,7 +70,6 @@ export const useSplitButton_unstable = ( return { // Props passed at the top-level appearance, - block, disabled, disabledFocusable, iconPosition, diff --git a/packages/react-components/react-button/src/components/SplitButton/useSplitButtonStyles.ts b/packages/react-components/react-button/src/components/SplitButton/useSplitButtonStyles.ts index 74dc9330f92b3..96e31224f8039 100644 --- a/packages/react-components/react-button/src/components/SplitButton/useSplitButtonStyles.ts +++ b/packages/react-components/react-button/src/components/SplitButton/useSplitButtonStyles.ts @@ -49,11 +49,6 @@ const useRootStyles = makeStyles({ }, }, - // Block styles - block: { - width: '100%', - }, - // Appearance variations outline: { /* No styles */ @@ -163,18 +158,11 @@ export const useSplitButtonStyles_unstable = (state: SplitButtonState): SplitBut const rootStyles = useRootStyles(); const focusStyles = useFocusStyles(); - const { - appearance, - // eslint-disable-next-line deprecation/deprecation - block, - disabled, - disabledFocusable, - } = state; + const { appearance, disabled, disabledFocusable } = state; state.root.className = mergeClasses( splitButtonClassNames.root, rootStyles.base, - block && rootStyles.block, appearance && rootStyles[appearance], (disabled || disabledFocusable) && rootStyles.disabled, (disabled || disabledFocusable) && rootStyles.disabledHighContrast, diff --git a/packages/react-components/react-button/src/components/ToggleButton/stories/ToggleButtonBlock.stories.tsx b/packages/react-components/react-button/src/components/ToggleButton/stories/ToggleButtonBlock.stories.tsx deleted file mode 100644 index 159cd4fdd225d..0000000000000 --- a/packages/react-components/react-button/src/components/ToggleButton/stories/ToggleButtonBlock.stories.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import * as React from 'react'; -import { ToggleButton } from '../../../ToggleButton'; - -export const Block = () => ( - <> - Block - -); -Block.parameters = { - docs: { - description: { - story: 'A toggle button can fill the width of its container.', - }, - }, -}; From 2b3c2bb4288d172d32b77f38766b707648257ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Dias=20=28he/him=29?= <39736248+andrefcdias@users.noreply.github.com> Date: Fri, 20 May 2022 00:16:33 +0200 Subject: [PATCH 04/11] fix(react-text): Update typography wrappers to latest naming (#22934) * fix: change Headline to Subtitle1 * fix: change Subheadline to Subtitle2 * fix: change Body to Body1 * fix: change Caption to Caption1 * feat: add Caption2 * chore: use better vr story name * chore: add change files * chore: update api * fix: rename components in missing story * feat: removed unused `caption2ClassName` * chore: disable classname conformance test * chore: remove deprecated className * chore: add conformance test exception --- .../src/stories/Card.stories.tsx | 14 ++-- .../src/stories/Text.stories.tsx | 20 +++--- ...-8ea6ca1b-f0cb-4ce3-b211-063c7d40338a.json | 7 ++ ...-91f14a73-d74c-4da0-8619-edbf5662b45d.json | 7 ++ .../src/stories/CardAppearance.stories.tsx | 6 +- .../src/stories/CardDefault.stories.tsx | 8 +-- .../src/stories/SampleCard.stories.tsx | 8 +-- .../etc/react-components.api.md | 68 ++++++------------- .../react-components/src/index.ts | 38 +++-------- .../InputContentBeforeAfter.stories.tsx | 14 ++-- .../src/demos.stories.tsx | 4 +- .../react-components/react-text/README.md | 8 +-- .../bundle-size/Text.Wrappers.fixture.js | 10 +-- .../react-text/etc/react-text.api.md | 55 ++++----------- .../react-components/react-text/src/Body.ts | 1 - .../react-components/react-text/src/Body1.ts | 1 + .../react-text/src/Caption.ts | 1 - .../react-text/src/Caption1.ts | 1 + .../react-text/src/Caption2.ts | 1 + .../react-text/src/Headline.ts | 1 - .../react-text/src/Subheadline.ts | 1 - .../react-text/src/Subtitle1.ts | 1 + .../react-text/src/Subtitle2.ts | 1 + .../Body/__snapshots__/Body.test.tsx.snap | 11 --- .../react-text/src/components/Body/index.ts | 1 - .../Body.test.tsx => Body1/Body1.test.tsx} | 11 +-- .../{Body/Body.tsx => Body1/Body1.tsx} | 16 ++--- .../Body1/__snapshots__/Body1.test.tsx.snap | 11 +++ .../react-text/src/components/Body1/index.ts | 1 + .../src/components/Caption/Caption.test.tsx | 16 ----- .../__snapshots__/Caption.test.tsx.snap | 11 --- .../src/components/Caption/index.ts | 1 - .../src/components/Caption1/Caption1.test.tsx | 17 +++++ .../Caption.tsx => Caption1/Caption1.tsx} | 16 ++--- .../__snapshots__/Caption1.test.tsx.snap | 11 +++ .../src/components/Caption1/index.ts | 1 + .../src/components/Caption2/Caption2.test.tsx | 17 +++++ .../src/components/Caption2/Caption2.tsx | 26 +++++++ .../__snapshots__/Caption2.test.tsx.snap | 11 +++ .../src/components/Caption2/index.ts | 1 + .../src/components/Display/Display.test.tsx | 1 + .../src/components/Display/Display.tsx | 4 -- .../src/components/Headline/Headline.test.tsx | 16 ----- .../__snapshots__/Headline.test.tsx.snap | 11 --- .../src/components/Headline/index.ts | 1 - .../components/LargeTitle/LargeTitle.test.tsx | 1 + .../src/components/LargeTitle/LargeTitle.tsx | 4 -- .../Subheadline/Subheadline.test.tsx | 16 ----- .../__snapshots__/Subheadline.test.tsx.snap | 11 --- .../src/components/Subheadline/index.ts | 1 - .../components/Subtitle1/Subtitle1.test.tsx | 17 +++++ .../Headline.tsx => Subtitle1/Subtitle1.tsx} | 16 ++--- .../__snapshots__/Subtitle1.test.tsx.snap | 11 +++ .../src/components/Subtitle1/index.ts | 1 + .../components/Subtitle2/Subtitle2.test.tsx | 17 +++++ .../Subtitle2.tsx} | 16 ++--- .../__snapshots__/Subtitle2.test.tsx.snap | 11 +++ .../src/components/Subtitle2/index.ts | 1 + .../src/components/Text/Text.test.tsx | 1 + .../src/components/Text/useTextStyles.ts | 4 -- .../src/components/Title1/Title1.test.tsx | 1 + .../src/components/Title1/Title1.tsx | 4 -- .../src/components/Title2/Title2.test.tsx | 1 + .../src/components/Title2/Title2.tsx | 4 -- .../src/components/Title3/Title3.test.tsx | 1 + .../src/components/Title3/Title3.tsx | 4 -- .../react-components/react-text/src/index.ts | 29 +++----- .../src/stories/TextTypography.stories.tsx | 11 +-- 68 files changed, 320 insertions(+), 351 deletions(-) create mode 100644 change/@fluentui-react-components-8ea6ca1b-f0cb-4ce3-b211-063c7d40338a.json create mode 100644 change/@fluentui-react-text-91f14a73-d74c-4da0-8619-edbf5662b45d.json delete mode 100644 packages/react-components/react-text/src/Body.ts create mode 100644 packages/react-components/react-text/src/Body1.ts delete mode 100644 packages/react-components/react-text/src/Caption.ts create mode 100644 packages/react-components/react-text/src/Caption1.ts create mode 100644 packages/react-components/react-text/src/Caption2.ts delete mode 100644 packages/react-components/react-text/src/Headline.ts delete mode 100644 packages/react-components/react-text/src/Subheadline.ts create mode 100644 packages/react-components/react-text/src/Subtitle1.ts create mode 100644 packages/react-components/react-text/src/Subtitle2.ts delete mode 100644 packages/react-components/react-text/src/components/Body/__snapshots__/Body.test.tsx.snap delete mode 100644 packages/react-components/react-text/src/components/Body/index.ts rename packages/react-components/react-text/src/components/{Body/Body.test.tsx => Body1/Body1.test.tsx} (50%) rename packages/react-components/react-text/src/components/{Body/Body.tsx => Body1/Body1.tsx} (55%) create mode 100644 packages/react-components/react-text/src/components/Body1/__snapshots__/Body1.test.tsx.snap create mode 100644 packages/react-components/react-text/src/components/Body1/index.ts delete mode 100644 packages/react-components/react-text/src/components/Caption/Caption.test.tsx delete mode 100644 packages/react-components/react-text/src/components/Caption/__snapshots__/Caption.test.tsx.snap delete mode 100644 packages/react-components/react-text/src/components/Caption/index.ts create mode 100644 packages/react-components/react-text/src/components/Caption1/Caption1.test.tsx rename packages/react-components/react-text/src/components/{Caption/Caption.tsx => Caption1/Caption1.tsx} (53%) create mode 100644 packages/react-components/react-text/src/components/Caption1/__snapshots__/Caption1.test.tsx.snap create mode 100644 packages/react-components/react-text/src/components/Caption1/index.ts create mode 100644 packages/react-components/react-text/src/components/Caption2/Caption2.test.tsx create mode 100644 packages/react-components/react-text/src/components/Caption2/Caption2.tsx create mode 100644 packages/react-components/react-text/src/components/Caption2/__snapshots__/Caption2.test.tsx.snap create mode 100644 packages/react-components/react-text/src/components/Caption2/index.ts delete mode 100644 packages/react-components/react-text/src/components/Headline/Headline.test.tsx delete mode 100644 packages/react-components/react-text/src/components/Headline/__snapshots__/Headline.test.tsx.snap delete mode 100644 packages/react-components/react-text/src/components/Headline/index.ts delete mode 100644 packages/react-components/react-text/src/components/Subheadline/Subheadline.test.tsx delete mode 100644 packages/react-components/react-text/src/components/Subheadline/__snapshots__/Subheadline.test.tsx.snap delete mode 100644 packages/react-components/react-text/src/components/Subheadline/index.ts create mode 100644 packages/react-components/react-text/src/components/Subtitle1/Subtitle1.test.tsx rename packages/react-components/react-text/src/components/{Headline/Headline.tsx => Subtitle1/Subtitle1.tsx} (53%) create mode 100644 packages/react-components/react-text/src/components/Subtitle1/__snapshots__/Subtitle1.test.tsx.snap create mode 100644 packages/react-components/react-text/src/components/Subtitle1/index.ts create mode 100644 packages/react-components/react-text/src/components/Subtitle2/Subtitle2.test.tsx rename packages/react-components/react-text/src/components/{Subheadline/Subheadline.tsx => Subtitle2/Subtitle2.tsx} (51%) create mode 100644 packages/react-components/react-text/src/components/Subtitle2/__snapshots__/Subtitle2.test.tsx.snap create mode 100644 packages/react-components/react-text/src/components/Subtitle2/index.ts diff --git a/apps/vr-tests-react-components/src/stories/Card.stories.tsx b/apps/vr-tests-react-components/src/stories/Card.stories.tsx index 79e460c82d57d..aa9e03e209ddb 100644 --- a/apps/vr-tests-react-components/src/stories/Card.stories.tsx +++ b/apps/vr-tests-react-components/src/stories/Card.stories.tsx @@ -3,7 +3,7 @@ import * as React from 'react'; import Screener from 'screener-storybook/src/screener'; import { Card, CardHeader, CardFooter, CardPreview } from '@fluentui/react-card'; import { Open16Regular, Share16Regular } from '@fluentui/react-icons'; -import { Body, Caption } from '@fluentui/react-text'; +import { Body1, Caption1 } from '@fluentui/react-text'; import { Button } from '@fluentui/react-button'; import { action } from '@storybook/addon-actions'; @@ -17,11 +17,11 @@ const SampleCardContent = () => ( } header={ - + App Name - + } - description={Developer} + description={Developer} />
Donut chocolate bar oat cake. Dragée tiramisu lollipop bear claw. Marshmallow pastry jujubes toffee sugar plum. @@ -52,11 +52,11 @@ storiesOf('Card Converged', module) } header={ - + Sales analysis 2019 presentation - + } - description={Folder > Presentations} + description={Folder > Presentations} />
diff --git a/apps/vr-tests-react-components/src/stories/Text.stories.tsx b/apps/vr-tests-react-components/src/stories/Text.stories.tsx index 7057ffbdf9a5e..52edf3df66c81 100644 --- a/apps/vr-tests-react-components/src/stories/Text.stories.tsx +++ b/apps/vr-tests-react-components/src/stories/Text.stories.tsx @@ -2,16 +2,17 @@ import * as React from 'react'; import { storiesOf } from '@storybook/react'; import Screener from 'screener-storybook/src/screener'; import { - Body, - Caption, + Body1, + Caption1, Display, - Headline, + Subtitle1, LargeTitle, - Subheadline, + Subtitle2, Text, Title1, Title2, Title3, + Caption2, } from '@fluentui/react-text'; storiesOf('Text Converged', module) @@ -137,7 +138,7 @@ storiesOf('Text Converged', module) { includeRtl: true, includeHighContrast: true, includeDarkMode: true }, ) .addStory( - 'Display', + 'Typography wrappers', () => ( <> Display @@ -145,10 +146,11 @@ storiesOf('Text Converged', module) Title1 Title2 Title3 - Headline - Subheadline - Body - Caption + Subtitle1 + Subtitle2 + Body1 + Caption1 + Caption2 ), { includeRtl: true }, diff --git a/change/@fluentui-react-components-8ea6ca1b-f0cb-4ce3-b211-063c7d40338a.json b/change/@fluentui-react-components-8ea6ca1b-f0cb-4ce3-b211-063c7d40338a.json new file mode 100644 index 0000000000000..343311b53d5ea --- /dev/null +++ b/change/@fluentui-react-components-8ea6ca1b-f0cb-4ce3-b211-063c7d40338a.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "fix(react-text): Change typography wrapper component names to match new design spec", + "packageName": "@fluentui/react-components", + "email": "39736248+andrefcdias@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-text-91f14a73-d74c-4da0-8619-edbf5662b45d.json b/change/@fluentui-react-text-91f14a73-d74c-4da0-8619-edbf5662b45d.json new file mode 100644 index 0000000000000..f4105e33f70df --- /dev/null +++ b/change/@fluentui-react-text-91f14a73-d74c-4da0-8619-edbf5662b45d.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "fix: Change typography wrapper component names to match new design spec", + "packageName": "@fluentui/react-text", + "email": "39736248+andrefcdias@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-card/src/stories/CardAppearance.stories.tsx b/packages/react-components/react-card/src/stories/CardAppearance.stories.tsx index 940b460782a34..f9c87fc9b68cd 100644 --- a/packages/react-components/react-card/src/stories/CardAppearance.stories.tsx +++ b/packages/react-components/react-card/src/stories/CardAppearance.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { action } from '@storybook/addon-actions'; -import { Headline } from '@fluentui/react-text'; +import { Subtitle1 } from '@fluentui/react-text'; import { makeStyles, shorthands } from '@griffel/react'; import { SampleCard } from './SampleCard.stories'; @@ -24,9 +24,9 @@ const Title = (props: { children: React.ReactNode }) => { const styles = useStyles(); return ( - + {props.children} - + ); }; diff --git a/packages/react-components/react-card/src/stories/CardDefault.stories.tsx b/packages/react-components/react-card/src/stories/CardDefault.stories.tsx index c4ff8ba0cd853..a0843a8fff311 100644 --- a/packages/react-components/react-card/src/stories/CardDefault.stories.tsx +++ b/packages/react-components/react-card/src/stories/CardDefault.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { Body, Caption } from '@fluentui/react-text'; +import { Body1, Caption1 } from '@fluentui/react-text'; import { Button } from '@fluentui/react-button'; import { ArrowReplyRegular, ShareRegular } from '@fluentui/react-icons'; @@ -17,11 +17,11 @@ export const Default = () => { } header={ - + Elvia Atkins mentioned you - + } - description={5h ago · About us - Overview} + description={5h ago · About us - Overview} /> }> diff --git a/packages/react-components/react-card/src/stories/SampleCard.stories.tsx b/packages/react-components/react-card/src/stories/SampleCard.stories.tsx index 0d2877aca9c81..b0868f3167f50 100644 --- a/packages/react-components/react-card/src/stories/SampleCard.stories.tsx +++ b/packages/react-components/react-card/src/stories/SampleCard.stories.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { Button } from '@fluentui/react-button'; import { Open16Regular, Share16Regular } from '@fluentui/react-icons'; -import { Body, Caption } from '@fluentui/react-text'; +import { Body1, Caption1 } from '@fluentui/react-text'; import { Card, CardHeader, CardFooter, CardPreview } from '../index'; import type { CardProps } from '../index'; @@ -19,11 +19,11 @@ export const SampleCard = (props: CardProps) => ( } header={ - + App Name - + } - description={Developer} + description={Developer} />
Donut chocolate bar oat cake. Dragée tiramisu lollipop bear claw. Marshmallow pastry jujubes toffee sugar plum. diff --git a/packages/react-components/react-components/etc/react-components.api.md b/packages/react-components/react-components/etc/react-components.api.md index afe6cb419886f..67350f7b26efb 100644 --- a/packages/react-components/react-components/etc/react-components.api.md +++ b/packages/react-components/react-components/etc/react-components.api.md @@ -59,9 +59,8 @@ import { badgeClassNames } from '@fluentui/react-badge'; import { BadgeProps } from '@fluentui/react-badge'; import { BadgeSlots } from '@fluentui/react-badge'; import { BadgeState } from '@fluentui/react-badge'; -import { Body as Body_2 } from '@fluentui/react-text'; -import { bodyClassName } from '@fluentui/react-text'; -import { bodyClassNames } from '@fluentui/react-text'; +import { Body1 } from '@fluentui/react-text'; +import { body1ClassNames } from '@fluentui/react-text'; import { BorderRadiusTokens } from '@fluentui/react-theme'; import { BrandVariants } from '@fluentui/react-theme'; import { Button } from '@fluentui/react-button'; @@ -70,9 +69,10 @@ import { buttonClassNames } from '@fluentui/react-button'; import { ButtonProps } from '@fluentui/react-button'; import { ButtonSlots } from '@fluentui/react-button'; import { ButtonState } from '@fluentui/react-button'; -import { Caption } from '@fluentui/react-text'; -import { captionClassName } from '@fluentui/react-text'; -import { captionClassNames } from '@fluentui/react-text'; +import { Caption1 } from '@fluentui/react-text'; +import { caption1ClassNames } from '@fluentui/react-text'; +import { Caption2 } from '@fluentui/react-text'; +import { caption2ClassNames } from '@fluentui/react-text'; import { Checkbox } from '@fluentui/react-checkbox'; import { checkboxClassName } from '@fluentui/react-checkbox'; import { checkboxClassNames } from '@fluentui/react-checkbox'; @@ -106,7 +106,6 @@ import { createLightTheme } from '@fluentui/react-theme'; import { createTeamsDarkTheme } from '@fluentui/react-theme'; import { CurveTokens } from '@fluentui/react-theme'; import { Display } from '@fluentui/react-text'; -import { displayClassName } from '@fluentui/react-text'; import { displayClassNames } from '@fluentui/react-text'; import { Divider } from '@fluentui/react-divider'; import { dividerClassName } from '@fluentui/react-divider'; @@ -132,9 +131,6 @@ import { getNativeProps } from '@fluentui/react-utilities'; import { getPartitionedNativeProps } from '@fluentui/react-utilities'; import { getSlots } from '@fluentui/react-utilities'; import { GriffelStyle } from '@griffel/react'; -import { Headline } from '@fluentui/react-text'; -import { headlineClassName } from '@fluentui/react-text'; -import { headlineClassNames } from '@fluentui/react-text'; import { HorizontalSpacingTokens } from '@fluentui/react-theme'; import { Image as Image_2 } from '@fluentui/react-image'; import { imageClassName } from '@fluentui/react-image'; @@ -156,7 +152,6 @@ import { LabelProps } from '@fluentui/react-label'; import { LabelSlots } from '@fluentui/react-label'; import { LabelState } from '@fluentui/react-label'; import { LargeTitle } from '@fluentui/react-text'; -import { largeTitleClassName } from '@fluentui/react-text'; import { largeTitleClassNames } from '@fluentui/react-text'; import { LineHeightTokens } from '@fluentui/react-theme'; import { Link } from '@fluentui/react-link'; @@ -381,9 +376,10 @@ import { SplitButtonSlots } from '@fluentui/react-button'; import { SplitButtonState } from '@fluentui/react-button'; import { SSRProvider } from '@fluentui/react-utilities'; import { StrokeWidthTokens } from '@fluentui/react-theme'; -import { Subheadline } from '@fluentui/react-text'; -import { subheadlineClassName } from '@fluentui/react-text'; -import { subheadlineClassNames } from '@fluentui/react-text'; +import { Subtitle1 } from '@fluentui/react-text'; +import { subtitle1ClassNames } from '@fluentui/react-text'; +import { Subtitle2 } from '@fluentui/react-text'; +import { subtitle2ClassNames } from '@fluentui/react-text'; import { Switch } from '@fluentui/react-switch'; import { switchClassNames } from '@fluentui/react-switch'; import { SwitchOnChangeData } from '@fluentui/react-switch'; @@ -415,7 +411,6 @@ import { textareaClassNames } from '@fluentui/react-textarea'; import { TextareaProps } from '@fluentui/react-textarea'; import { TextareaSlots } from '@fluentui/react-textarea'; import { TextareaState } from '@fluentui/react-textarea'; -import { textClassName } from '@fluentui/react-text'; import { textClassNames } from '@fluentui/react-text'; import { TextProps } from '@fluentui/react-text'; import { TextSlots } from '@fluentui/react-text'; @@ -423,13 +418,10 @@ import { TextState } from '@fluentui/react-text'; import { Theme } from '@fluentui/react-theme'; import { themeToTokensObject } from '@fluentui/react-theme'; import { Title1 } from '@fluentui/react-text'; -import { title1ClassName } from '@fluentui/react-text'; import { title1ClassNames } from '@fluentui/react-text'; import { Title2 } from '@fluentui/react-text'; -import { title2ClassName } from '@fluentui/react-text'; import { title2ClassNames } from '@fluentui/react-text'; import { Title3 } from '@fluentui/react-text'; -import { title3ClassName } from '@fluentui/react-text'; import { title3ClassNames } from '@fluentui/react-text'; import { ToggleButton } from '@fluentui/react-button'; import { toggleButtonClassName } from '@fluentui/react-button'; @@ -679,11 +671,9 @@ export { BadgeSlots } export { BadgeState } -export { Body_2 as Body } +export { Body1 } -export { bodyClassName } - -export { bodyClassNames } +export { body1ClassNames } export { BorderRadiusTokens } @@ -701,11 +691,13 @@ export { ButtonSlots } export { ButtonState } -export { Caption } +export { Caption1 } + +export { caption1ClassNames } -export { captionClassName } +export { Caption2 } -export { captionClassNames } +export { caption2ClassNames } export { Checkbox } @@ -773,8 +765,6 @@ export { CurveTokens } export { Display } -export { displayClassName } - export { displayClassNames } export { Divider } @@ -825,12 +815,6 @@ export { getSlots } export { GriffelStyle } -export { Headline } - -export { headlineClassName } - -export { headlineClassNames } - export { HorizontalSpacingTokens } export { Image_2 as Image } @@ -873,8 +857,6 @@ export { LabelState } export { LargeTitle } -export { largeTitleClassName } - export { largeTitleClassNames } export { LineHeightTokens } @@ -1323,11 +1305,13 @@ export { SSRProvider } export { StrokeWidthTokens } -export { Subheadline } +export { Subtitle1 } + +export { subtitle1ClassNames } -export { subheadlineClassName } +export { Subtitle2 } -export { subheadlineClassNames } +export { subtitle2ClassNames } export { Switch } @@ -1391,8 +1375,6 @@ export { TextareaSlots } export { TextareaState } -export { textClassName } - export { textClassNames } export { TextProps } @@ -1407,20 +1389,14 @@ export { themeToTokensObject } export { Title1 } -export { title1ClassName } - export { title1ClassNames } export { Title2 } -export { title2ClassName } - export { title2ClassNames } export { Title3 } -export { title3ClassName } - export { title3ClassNames } export { ToggleButton } diff --git a/packages/react-components/react-components/src/index.ts b/packages/react-components/react-components/src/index.ts index 252cddf88f877..7bb5e7ab5ca3e 100644 --- a/packages/react-components/react-components/src/index.ts +++ b/packages/react-components/react-components/src/index.ts @@ -582,43 +582,25 @@ export type { TabListState, } from '@fluentui/react-tabs'; export { - Body, - Caption, + Body1, + Caption1, + Caption2, Display, - Headline, + Subtitle1, LargeTitle, - Subheadline, + Subtitle2, Text, Title1, Title2, Title3, - /* eslint-disable-next-line deprecation/deprecation */ - bodyClassName, - /* eslint-disable-next-line deprecation/deprecation */ - captionClassName, - /* eslint-disable-next-line deprecation/deprecation */ - displayClassName, - /* eslint-disable-next-line deprecation/deprecation */ - headlineClassName, - /* eslint-disable-next-line deprecation/deprecation */ - largeTitleClassName, - bodyClassNames, - captionClassNames, + body1ClassNames, + caption1ClassNames, + caption2ClassNames, displayClassNames, - headlineClassNames, + subtitle1ClassNames, largeTitleClassNames, renderText_unstable, - /* eslint-disable-next-line deprecation/deprecation */ - subheadlineClassName, - /* eslint-disable-next-line deprecation/deprecation */ - textClassName, - /* eslint-disable-next-line deprecation/deprecation */ - title1ClassName, - /* eslint-disable-next-line deprecation/deprecation */ - title2ClassName, - /* eslint-disable-next-line deprecation/deprecation */ - title3ClassName, - subheadlineClassNames, + subtitle2ClassNames, textClassNames, title1ClassNames, title2ClassNames, diff --git a/packages/react-components/react-input/src/stories/InputContentBeforeAfter.stories.tsx b/packages/react-components/react-input/src/stories/InputContentBeforeAfter.stories.tsx index 6ebfd63e08322..e3d968647a499 100644 --- a/packages/react-components/react-input/src/stories/InputContentBeforeAfter.stories.tsx +++ b/packages/react-components/react-input/src/stories/InputContentBeforeAfter.stories.tsx @@ -5,7 +5,7 @@ import { makeStyles, shorthands } from '@griffel/react'; import { PersonRegular, MicRegular } from '@fluentui/react-icons'; import { Button } from '@fluentui/react-button'; import type { ButtonProps } from '@fluentui/react-button'; -import { Body, Text } from '@fluentui/react-text'; +import { Body1, Text } from '@fluentui/react-text'; import { Input } from '../index'; const useStyles = makeStyles({ @@ -31,9 +31,9 @@ const ContentBefore = () => { <> } id={id} /> - + An input with a decorative icon in the contentBefore slot. - + ); }; @@ -45,9 +45,9 @@ const ContentAfter = () => { <> } id={id} /> - + An input with a button in the contentAfter slot. - + ); }; @@ -74,10 +74,10 @@ const ContentBeforeAndAfter = () => { aria-labelledby={`${id} ${beforeId} ${afterId}`} id={id} /> - + An input with a presentational value in the contentBefore slot and another presentational value in the contentAfter slot. - + ); }; diff --git a/packages/react-components/react-storybook-addon/src/demos.stories.tsx b/packages/react-components/react-storybook-addon/src/demos.stories.tsx index 0bde1e4d3a4f3..6fdf251c3b2a7 100644 --- a/packages/react-components/react-storybook-addon/src/demos.stories.tsx +++ b/packages/react-components/react-storybook-addon/src/demos.stories.tsx @@ -1,12 +1,12 @@ import * as React from 'react'; import { Button } from '@fluentui/react-button'; -import { Headline, Text } from '@fluentui/react-text'; +import { Subtitle1, Text } from '@fluentui/react-text'; import { action } from '@storybook/addon-actions'; export const Demos = () => { return (
- This story is for testing purposes of this addon + This story is for testing purposes of this addon