diff --git a/changelogs/DP-16804.yml b/changelogs/DP-16804.yml index 368b9a9e9c..b75c607cf7 100644 --- a/changelogs/DP-16804.yml +++ b/changelogs/DP-16804.yml @@ -1,5 +1,5 @@ Changed: - project: Patternlab component: UtilityNav - description: Change the state organizations menu from a button to a link directly to the page. #882 + description: Change the state organizations menu from a button to a link directly to the page. (#882) issue: DP-16804 diff --git a/changelogs/DP-17253.yml b/changelogs/DP-17253.yml index 499fdb5103..ea1132f96b 100644 --- a/changelogs/DP-17253.yml +++ b/changelogs/DP-17253.yml @@ -1,5 +1,5 @@ Added: - project: React component: Color - description: Addded Color stories and color gradients. #909 + description: Addded Color stories and color gradients. (#909) issue: DP-17253 diff --git a/changelogs/DP-17320.yml b/changelogs/DP-17320.yml index 20af7d5b7d..57b99cb68d 100644 --- a/changelogs/DP-17320.yml +++ b/changelogs/DP-17320.yml @@ -1,6 +1,6 @@ Changed: - project: React component: Storybook - description: Config storybook to add Mayflower theme. #915 + description: Config storybook to add Mayflower theme. (#915) issue: DP-17320 impact: Patch diff --git a/changelogs/DP-17338.yml b/changelogs/DP-17338.yml new file mode 100644 index 0000000000..82c8980345 --- /dev/null +++ b/changelogs/DP-17338.yml @@ -0,0 +1,11 @@ +Changed: + - project: React + component: Storybook + description: Render welcome page to Mayflower-react. (#916) + issue: DP-17338 + impact: Patch + - project: React + component: Storybook + description: Display `Color` in category "Brand". (#916) + issue: DP-17338 + impact: Patch diff --git a/react/.storybook/config.js b/react/.storybook/config.js index fe89aec6f7..7a4456cdad 100644 --- a/react/.storybook/config.js +++ b/react/.storybook/config.js @@ -11,10 +11,13 @@ addParameters({ showPanel: true // show the code panel by default }, }); -// automatically import all files ending in *.stories.js -const req = require.context('../src', true, /.stories.js$/); + function loadStories() { - req.keys().forEach((filename) => { + // load index story first + require('../src/index.stories.js'); + // automatically import all files ending in *.stories.js + const req = require.context('../src', true, /.stories.js$/); + req.keys().sort().forEach((filename) => { req(filename); }); addDecorator( diff --git a/react/README.md b/react/README.md index 97df6723f4..fea6552cbb 100644 --- a/react/README.md +++ b/react/README.md @@ -1,24 +1,32 @@ # Mayflower-React [![npm package][npm-badge]][npm] -Mayflower-react is a React component library under the enterprise design system for the Commonwealth of Massachusetts. Mayflower-react is a published npm package [@massds/mayflower-react][npm] that is dependent on static assets generate by [Mayflower PatternLab][mayflower-github]. Mayflower PatternLab is published as a dependency npm package [@massds/mayflower][mayflower-npm]. Refer to [Mayflower PatternLab Static Site][mayflower] for a complete list of its UI components. +Mayflower-react is a React component library under the [enterprise design system for the Commonwealth of Massachusetts][mayflower-doc]. -# How to use Mayflower-React in your Project! +- **Live demo:** [mayflower-react storybook][react-storybook] +- **NPM package:** [@massds/mayflower-react][npm]. +- **Codebase:** [Mayflower monorepo][mayflower-github] `react` subdirectory + >[Mayflower monorepo][mayflower-github] comprised of [Mayflower documentation][mayflower-doc], two component libraries — [Mayflower React][react-storybook] and [Mayflower PatternLab][patternLab], and their [shared assets][shared-assets]. + > Refer to [Mayflower PatternLab Static Site][patternlab] for the set of UI components consumed in Mass.gov. -## Quick start +## Using Mayflower-React in Your Project 1. Install mayflower-react into your project as a dependency. `npm i @massds/mayflower-react --save` 2. Import components into your App.js `import { Button } from '@massds/mayflower-react';` 3. Render components in JSX -``