-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Create public-website-v9 from old migration package, import react-component stories #22578
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
micahgodbolt
merged 5 commits into
microsoft:master
from
micahgodbolt:public-docsite-v9
Apr 21, 2022
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6f7199f
changed upgrade v9 to public docsite v9, pulled in all existing react…
micahgodbolt ce4a065
Merge branch 'master' into public-docsite-v9
micahgodbolt e13714d
remove comments
micahgodbolt b02d76b
revert back to minimal move
micahgodbolt 90112c6
remove moved mdx files
micahgodbolt 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
File renamed without changes.
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,33 @@ | ||
| const utils = require('./main.utils'); | ||
| const rootMain = require('../../../.storybook/main'); | ||
|
|
||
| module.exports = { | ||
| stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(ts|tsx)', ...utils.getVnextStories()], | ||
| addons: [ | ||
| { | ||
| name: '@storybook/addon-docs', | ||
| options: { | ||
| configureJSX: true, | ||
| babelOptions: {}, | ||
| sourceLoaderOptions: null, | ||
| transcludeMarkdown: true, | ||
| }, | ||
| }, | ||
| ], | ||
| core: { | ||
| builder: 'webpack5', | ||
| }, | ||
| babel: {}, | ||
| typescript: { | ||
| // disable react-docgen-typescript (totally not needed here, slows things down a lot) | ||
| reactDocgen: false, | ||
| }, | ||
| webpackFinal: (config, options) => { | ||
| const localConfig = { ...rootMain.webpackFinal(config, options) }; | ||
|
|
||
| // add your own webpack tweaks if needed | ||
|
|
||
| return localConfig; | ||
| }, | ||
| addons: ['@storybook/addon-actions', '@storybook/addon-docs'], | ||
| }; |
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,22 @@ | ||
| /** | ||
| * This file contains utils for main.js to mitigate diffs when migration generator is being invoked in batch (via --all flag) | ||
| * Code in this module is supposed to run only against node js env (webpack) - thus it uses commonjs modules | ||
| */ | ||
|
|
||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
|
|
||
| function getVnextStories() { | ||
| /** @type {Record<string,unknown>} */ | ||
| const packageJson = JSON.parse( | ||
| fs.readFileSync(path.resolve(__dirname, '../../../packages/react-components/package.json'), 'utf-8'), | ||
| ); | ||
|
|
||
| const dependencies = /** @type {Record<string,string>} */ (packageJson.dependencies); | ||
|
|
||
| return Object.keys({ ...dependencies, '@fluentui/react-components': '' }) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add the actual react-components repo to dep list so that stories in that package are imported. Hope to move all those stories somewhere else eventually |
||
| .filter(pkgName => pkgName.startsWith('@fluentui/')) | ||
| .map(pkgName => '../../../packages/' + pkgName.replace('@fluentui/', '') + '/src/**/*.stories.@(ts|tsx|mdx)'); | ||
| } | ||
|
|
||
| exports.getVnextStories = getVnextStories; | ||
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,21 @@ | ||
| /// <reference types="jest" /> | ||
| const utils = require('./main.utils'); | ||
|
|
||
| describe(`main utils`, () => { | ||
| describe(`#getVnextStories`, () => { | ||
| it(`should generate storybook stories string array of glob based on package.json#dependencies field`, () => { | ||
| const actual = utils.getVnextStories(); | ||
|
|
||
| const expected = [ | ||
| expect.stringContaining('../../react-'), | ||
| expect.stringContaining('/src/**/*.stories.@(ts|tsx|mdx)'), | ||
| ]; | ||
|
|
||
| expect(actual).toEqual(expect.arrayContaining(expected)); | ||
|
|
||
| const first = actual[0]; | ||
| expect(first.startsWith('../../react-')).toBeTruthy(); | ||
| expect(first.endsWith('/src/**/*.stories.@(ts|tsx|mdx)')).toBeTruthy(); | ||
| }); | ||
| }); | ||
| }); |
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,121 @@ | ||
| <!-- | ||
| Override the default favicon used in the Storybook in the browser tab. | ||
| --> | ||
| <link rel="shortcut icon" href="https://www.microsoft.com/design/fluent/assets/favicons/favicon-192.png" /> | ||
| <link | ||
| rel="icon" | ||
| type="image/png" | ||
| href="https://www.microsoft.com/design/fluent/assets/favicons/favicon-192.png" | ||
| sizes="192x192" | ||
| /> | ||
|
|
||
| <!-- | ||
| Override the default styles used in the Storybook svg icons for the left tree panel. | ||
|
|
||
| @see https://storybook.js.org/docs/react/configure/theming#css-escape-hatches | ||
|
|
||
| > 💡 NOTE: | ||
| > | ||
| > This is brittle way for providing custom non thenable styles for manager UI | ||
| > | ||
| > Those selectors might change on any storybook version bump. | ||
| --> | ||
|
|
||
| <style> | ||
| @font-face { | ||
| font-family: 'Segoe UI'; | ||
| src: local('Segoe UI Light'), | ||
| url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff2) format('woff2'), | ||
| url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff) format('woff'), | ||
| url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.ttf) format('truetype'); | ||
| font-weight: 100; | ||
| } | ||
|
|
||
| @font-face { | ||
| font-family: 'Segoe UI'; | ||
| src: local('Segoe UI Semilight'), | ||
| url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.woff2) format('woff2'), | ||
| url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.woff) format('woff'), | ||
| url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.ttf) format('truetype'); | ||
| font-weight: 200; | ||
| } | ||
|
|
||
| @font-face { | ||
| font-family: 'Segoe UI'; | ||
| src: local('Segoe UI'), | ||
| url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.woff2) format('woff2'), | ||
| url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.woff) format('woff'), | ||
| url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.ttf) format('truetype'); | ||
| font-weight: 400; | ||
| } | ||
|
|
||
| @font-face { | ||
| font-family: 'Segoe UI'; | ||
| src: local('Segoe UI Semibold'), | ||
| url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.woff2) format('woff2'), | ||
| url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.woff) format('woff'), | ||
| url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.ttf) format('truetype'); | ||
| font-weight: 600; | ||
| } | ||
|
|
||
| @font-face { | ||
| font-family: 'Segoe UI'; | ||
| src: local('Segoe UI Bold'), | ||
| url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.woff2) format('woff2'), | ||
| url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.woff) format('woff'), | ||
| url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.ttf) format('truetype'); | ||
| font-weight: 700; | ||
| } | ||
|
|
||
| #storybook-explorer-searchfield { | ||
| font-weight: 400 !important; | ||
| font-size: 14px !important; | ||
| letter-spacing: -0.01em !important; | ||
| line-height: 14px !important; | ||
| } | ||
|
|
||
| .sidebar-item svg, | ||
| .sidebar-svg-icon { | ||
| color: #11100f !important; | ||
| } | ||
|
|
||
| .sidebar-item[data-selected='true'] svg, | ||
| .sidebar-item[data-selected='true'] .sidebar-svg-icon { | ||
| color: #ffffff !important; | ||
| } | ||
|
|
||
| .sidebar-subheading { | ||
| font-weight: 600 !important; | ||
| font-size: 16px !important; | ||
| letter-spacing: 0px !important; | ||
| line-height: 24px !important; | ||
| text-transform: none !important; | ||
| color: #11100f !important; | ||
| } | ||
|
|
||
| .sidebar-item { | ||
| font-weight: 400 !important; | ||
| font-size: 14px !important; | ||
| letter-spacing: -0.01em !important; | ||
| line-height: 14px !important; | ||
| color: #11100f !important; | ||
| } | ||
|
|
||
| .sidebar-item[data-selected='true'] { | ||
| font-weight: 600 !important; | ||
| font-size: 14px !important; | ||
| letter-spacing: -0.01em !important; | ||
| line-height: 14px !important; | ||
| color: #ffffff !important; | ||
| } | ||
|
|
||
| /* | ||
| Storybook has proposed a feature for this in https://github.com/storybookjs/storybook/issues/9209 | ||
| which will configure stories to exist in deeplink URL format, but do not appear in the nav tree or the docs page | ||
| Usign suggested temporary workaround until storybook gets proper support | ||
| See https://github.com/microsoft/fluentui/blob/master/rfcs/convergence/authoring-stories.md#10-internal-stories-for-testing | ||
| */ | ||
| [id*='accessibility-scenario'] { | ||
| display: none !important; | ||
| } | ||
| </style> |
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,6 @@ | ||
| import { addons } from '@storybook/addons'; | ||
| import fluentStorybookTheme from './theme'; | ||
|
|
||
| addons.setConfig({ | ||
| theme: fluentStorybookTheme, | ||
| }); |
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,26 @@ | ||
| /** @type {typeof rootPreview.parameters} */ | ||
| export const parameters = { | ||
| options: { | ||
| storySort: { | ||
| method: 'alphabetical', | ||
| /** | ||
| * @see https://storybook.js.org/docs/react/writing-stories/naming-components-and-hierarchy#sorting-stories | ||
| */ | ||
| order: [ | ||
| 'Concepts', | ||
| [ | ||
| 'Introduction', | ||
| 'Developer', | ||
| ['Quick Start', 'Styling Components', 'Positioning Components'], | ||
| 'Upgrading', | ||
| [ | ||
| 'from v8', | ||
| ['Overview', 'Important changes', 'Planning your journey', 'Component Mapping', 'Troubleshooting'], | ||
| ], | ||
| ], | ||
| 'Theme', | ||
| 'Components', | ||
| ], | ||
| }, | ||
| }, | ||
| }; |
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,41 @@ | ||
| import { create } from '@storybook/theming'; | ||
| import logo from '../public/fluent.svg'; | ||
|
|
||
| /** | ||
| * Theming and branding the storybook to fluent. Taken from https://storybook.js.org/docs/react/configure/theming | ||
| */ | ||
| const theme = create({ | ||
| base: 'light', | ||
|
|
||
| // Storybook-specific color palette | ||
| colorPrimary: 'rgba(255, 255, 255, .4)', | ||
| colorSecondary: '#0078d4', | ||
|
|
||
| // UI | ||
| appBg: '#ffffff', | ||
| appContentBg: '#ffffff', | ||
| appBorderColor: '#e0e0e0', // use msft gray | ||
| appBorderRadius: 4, | ||
|
|
||
| // Fonts | ||
| fontBase: | ||
| '"Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;', | ||
| fontCode: 'monospace', | ||
|
|
||
| // Text colors | ||
| textColor: '#11100f', | ||
| textInverseColor: '#0078d4', // use msft primary blue default | ||
|
|
||
| // Toolbar default and active colors | ||
| barSelectedColor: '#0078d4', // use msft primary blue default | ||
|
|
||
| // Form colors | ||
| inputBorderRadius: 4, | ||
|
|
||
| // Use the fluent branding for the upper left image | ||
| brandTitle: 'Fluent UI React Components', | ||
| brandUrl: 'https://github.com/microsoft/fluentui', | ||
| brandImage: logo, | ||
| }); | ||
|
|
||
| export default theme; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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
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.