Skip to content

Commit

Permalink
Convert @fluentui/react-text stories to index.stories.tsx approach (#…
Browse files Browse the repository at this point in the history
…23662)

* chore: Convert Text to index based stories

* changefile
  • Loading branch information
micahgodbolt authored Jun 23, 2022
1 parent 4405e16 commit 36d25e9
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: Convert Text to index based stories",
"packageName": "@fluentui/react-text",
"email": "[email protected]",
"dependentChangeType": "none"
}
2 changes: 1 addition & 1 deletion packages/react-components/react-text/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const rootMain = require('../../../../.storybook/main');

module.exports = /** @type {Omit<import('../../../../.storybook/main'), 'typescript'|'babel'>} */ ({
...rootMain,
stories: [...rootMain.stories, '../src/**/*.stories.mdx', '../src/**/*.stories.@(ts|tsx)'],
stories: [...rootMain.stories, '../src/**/*.stories.mdx', '../src/**/index.stories.@(ts|tsx)'],
addons: [...rootMain.addons],
webpackFinal: (config, options) => {
const localConfig = { ...rootMain.webpackFinal(config, options) };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { makeStyles } from '@griffel/react';
import { Text } from '../Text';
import type { TextProps } from '../Text';
import { Text } from '@fluentui/react-text';
import type { TextProps } from '@fluentui/react-text';

const useStyles = makeStyles({
container: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Text } from '../index';
import { Text } from '@fluentui/react-text';

export const Font = () => (
<div style={{ display: 'flex', gap: 20 }}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import { Text } from '../index';
import { Text } from '@fluentui/react-text';

export const Italic = () => <Text italic>Italic text</Text>;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Text } from '../index';
import { Text } from '@fluentui/react-text';

export const Size = () => (
<div style={{ display: 'flex', gap: 10, alignItems: 'baseline' }}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import { Text } from '../index';
import { Text } from '@fluentui/react-text';

export const StrikeThrough = () => <Text strikethrough>Strikethrough text</Text>;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Text } from '../index';
import { Text } from '@fluentui/react-text';

export const Truncate = () => (
<Text truncate style={{ width: 100, overflow: 'hidden', whiteSpace: 'nowrap' }} block>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import * as React from 'react';
import { Body1, Caption1, Display, Subtitle1, LargeTitle, Title1, Title2, Title3, Subtitle2, Caption2 } from '../index';
import {
Body1,
Caption1,
Display,
Subtitle1,
LargeTitle,
Title1,
Title2,
Title3,
Subtitle2,
Caption2,
} from '@fluentui/react-text';

export const Typography = () => (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as React from 'react';
import { Text } from '../index';
import { Text } from '@fluentui/react-text';

export const Underline = () => <Text underline>Underlined text</Text>;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Text } from '../index';
import { Text } from '@fluentui/react-text';

export const Weight = () => (
<div style={{ display: 'flex', gap: 20 }}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Meta } from '@storybook/react';
import { Text } from '../Text';
import { Text } from '@fluentui/react-text';
import textDescriptionMd from './TextDescription.md';
import textBestPractices from './TextBestPractices.md';

Expand Down

0 comments on commit 36d25e9

Please sign in to comment.