Skip to content
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

Mayflower v10: Storybook 6.0 Upgrade #1162

Merged
merged 45 commits into from
Sep 29, 2020
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
813e095
Initial stable upgrade to storybook 6.0.
smurrayatwork Aug 12, 2020
efa2d36
WIP.
smurrayatwork Aug 17, 2020
ce7fdd2
Wraps up converting atoms.
smurrayatwork Aug 17, 2020
efb9caa
WIP: Upgrades molecules to use controls.
smurrayatwork Aug 18, 2020
7a49af3
WIP: Adds organisms, templates, pages CSF stories.
smurrayatwork Aug 21, 2020
8560d2f
WIP: Adds misc stories to CSF/MDX format.
smurrayatwork Aug 21, 2020
19b187d
WIP: Misc bug fixes, adds HTML display on doc pages.
smurrayatwork Aug 25, 2020
9c8302f
WIP: Fixes backstop.
smurrayatwork Sep 1, 2020
c4c0638
Code cleanup, removes acorns dev dependencies, updates storybook.
smurrayatwork Sep 2, 2020
f1de7aa
Updates circle to run storybook extract.
smurrayatwork Sep 2, 2020
1cdfa11
Fixes merge conflict.
smurrayatwork Sep 2, 2020
33aba96
Fixes circleci.
smurrayatwork Sep 2, 2020
a116ea3
Fixes circleci.
smurrayatwork Sep 2, 2020
c57cebd
Fixes circleci.
smurrayatwork Sep 2, 2020
5a0b8c6
Fixes circleci.
smurrayatwork Sep 2, 2020
9cd9a21
Fixes circleci.
smurrayatwork Sep 2, 2020
fb3c811
Fixes circleci.
smurrayatwork Sep 2, 2020
f5db5a5
Fixes circleci.
smurrayatwork Sep 2, 2020
e76d2b6
Fixes circleci.
smurrayatwork Sep 8, 2020
805e90a
Fixes circleci.
smurrayatwork Sep 8, 2020
8e87aaf
Fixes circleci.
smurrayatwork Sep 8, 2020
76591c3
Fixes circleci.
smurrayatwork Sep 8, 2020
d2c6944
Fixes circleci.
smurrayatwork Sep 8, 2020
e3a2a81
Fixes circleci.
smurrayatwork Sep 8, 2020
afae61e
Fixes circleci.
smurrayatwork Sep 8, 2020
0354da0
Fixes circleci.
smurrayatwork Sep 8, 2020
19c574c
WIP: Fixes circleci react testing.
smurrayatwork Sep 8, 2020
89cbeff
WIP: Fixes circleci react testing.
smurrayatwork Sep 8, 2020
d983b92
WIP: Fixes circleci react testing.
smurrayatwork Sep 8, 2020
b274f97
WIP: Updates eslint rules to ignore auto generated icons.
smurrayatwork Sep 8, 2020
356dab0
WIP: Changes backstop settings, fixes component docs.
smurrayatwork Sep 9, 2020
2be2968
WIP: Puts back backstop config for async capture limit.
smurrayatwork Sep 9, 2020
ddb09d3
Updates ButtonCopy logic, excludes it from backstop tests.
smurrayatwork Sep 9, 2020
d605fee
Updates title for Docs to component name, fixes ButtonWithIcon story.
smurrayatwork Sep 14, 2020
6e2356d
Updates component propTypes comment structure, misc bug fixes for sto…
smurrayatwork Sep 22, 2020
8ec08fd
WIP.
smurrayatwork Sep 23, 2020
60e4827
WIP: Updates typography story name.
smurrayatwork Sep 24, 2020
c7da733
Round 2 code review fixes.
smurrayatwork Sep 24, 2020
65b4f8e
Updates form stories to work with CSF format and storybook docs.
smurrayatwork Sep 28, 2020
40a3443
Update react/src/components/forms/DateRange/DateRange.stories.js
smurrayatwork Sep 28, 2020
8fc01d7
Removes un-needed portion of typography story.
smurrayatwork Sep 28, 2020
fbc5199
Adds updated backstop screens.
smurrayatwork Sep 28, 2020
aaac8f8
Updates typograph story to remove story component.
smurrayatwork Sep 29, 2020
921ec1d
Adds changelog.
smurrayatwork Sep 29, 2020
c25d3f1
Adds updated backstop files.
smurrayatwork Sep 29, 2020
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
225 changes: 124 additions & 101 deletions react/src/components/base/Typography/Typography.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
import { Meta, Story, Canvas, ArgsTable, CURRENT_SELECTION } from '@storybook/addon-docs/blocks';
import DecorativeLink from 'MayflowerReactLinks/DecorativeLink';
import Heading from 'MayflowerReactHeadings/Heading';
import SidebarHeading from 'MayflowerReactHeadings/SidebarHeading';
Expand All @@ -19,120 +19,143 @@ const slugifyStyle = (style) => {
<Meta
title="brand/typography"
parameters={{
layout: 'fullscreen',
previewTabs: { canvas: { hidden: true } }
}}
/>

<Canvas>
<Story name="About">
<div className="page-content markdown-body">
<Typography />
</div>
</Story>
</Canvas>
<Heading text="Typography" level={1} />

<Canvas>
<Story name="Source Code Pro (Monospace Font)">
<div className="page-content">
<Heading text="Source Code Pro" level={1} />
<SidebarHeading title="Characters" level={2} />
<div className="sb-block sb-block--mono">
<div className="sb-text">{letters.toUpperCase()}</div>
<div className="sb-text">{letters}</div>
<hr />
<div className="sb-text">{numbers}</div>
<hr />
<div className="sb-text">{characters}</div>
<hr />
</div>
<div className="sb-block">
Source Code Pro is an open source font available on Google Fonts.
<DecorativeLink
text="Download the fonts or see more information on Google Fonts"
href="https://fonts.google.com/specimen/Source+Code+Pro"
/>
</div>
</div>
</Story>
</Canvas>
## Texta

**The official typeface of Mass.gov is Texta. We picked Texta for the Mass.gov branding purposes.**

![&quot;Mass.gov&quot; displaying in Texta](https://raw.githubusercontent.com/massgov/mayflower/develop/docs/.gitbook/assets/texta-massgov.png)

![&quot;MA&quot; displaying in Texta](https://raw.githubusercontent.com/massgov/mayflower/develop/docs/.gitbook/assets/texta-ma.png)

**Texta is a versatile, readable font that supports 23 different languages.** They are: Albanian, Alsatian, Aragonese, Arapaho, Arrernte, Asturian, Aymara, Basque, Bislama, Breton, Cebuano, Chamorro, Cheyenne, Corsican, Danish, Dutch, English, Estonian, Faroese, Fijian, Finnish, French, French Creole \(Saint Lucia\), Frisian, Galician, Genoese, German, Gilbertese \(Kiribati\), Greenlandic, Haitian Creole, Hiligaynon, Hmong, Hopi, Ibanag, Iloko \(Ilokano\), Indonesian, Interglossa \(Glosa\), Interlingua, Irish \(Gaelic\), Islandic, Italian, Jèrriais, Lojban, Lombard, Luxembourgian, Malagasy, Manx, Mohawk, Norfolk/Pitcairnese, Northern Sotho \(Pedi\), Norwegian, Occitan, Oromo, Pangasinan, Papiamento, Piedmontese, Portuguese, Potawatomi, Rhaeto-Romance, Romansh \(Rumantsch\), Rotokas, Sami \(Lule\), Samoan, Sardinian \(Sardu\), Scots \(Gaelic\), Seychellois Creole \(Seselwa\), Shona, Sicilian, Somali, Southern Ndebele, Southern Sotho \(Sesotho\), Spanish, Swahili, Swati/Swazi, Swedish, Tagalog \(Filipino/Pilipino\), Tetum \(Tetun\), Tok Pisin, Tswana, Uyghur \(Latinized\), Volapük, Votic \(Latinized\), Walloon, Warlpiri, Xhosa, Yapese and Zulu.

### Usage

Texta font has the following font weight options:

| Font weight | Specs |
| :--- | :--- |
| Light | 300 |
| Medium | 500 |
| Bold | 700 |
| Black | 800 |

All font files can be downloaded either from the [**Mayflower Github repo**](https://github.com/massgov/mayflower/tree/develop/assets/fonts) or from the [**Mayflower NPM package**](https://unpkg.com/@massds/[email protected]/fonts/). Please read the web font [**web font license**](https://www.fontspring.com/lic/htswufoczd) **\*\*carefully to proceed**.\*\*

### License

Fontspring grants Licensee a perpetual, worldwide, non-exclusive and non-transferrable license to install the Texta as webfont **on Websites that are owned by the Commonwealth of Massachusetts** using the @font-face selector in CSS files. For other usage, you may have to acquire an additional license through Fontsprint.

For more details about Texta's terms of use, please refer to our [**web font license**](https://www.fontspring.com/lic/htswufoczd).



<div className="page-content">
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we break source code pro into a different story. Otherwise I like combining the Texta stories

<Heading text="Source Code Pro" level={1} />
<SidebarHeading title="Characters" level={2} />
<div className="sb-block sb-block--mono">
<div className="sb-text">{letters.toUpperCase()}</div>
<div className="sb-text">{letters}</div>
<hr />
<div className="sb-text">{numbers}</div>
<hr />
<div className="sb-text">{characters}</div>
<hr />
</div>
<div className="sb-block">
Source Code Pro is an open source font available on Google Fonts.
<DecorativeLink
text="Download the fonts or see more information on Google Fonts"
href="https://fonts.google.com/specimen/Source+Code+Pro"
/>
</div>

<Heading text="Texta" level={1} />
<SidebarHeading title="Characters" level={2} />
<div className="sb-block">
<div className="sb-text">{letters.toUpperCase()}</div>
<div className="sb-text">{letters}</div>
<hr />
<div className="sb-text">{numbers}</div>
<hr />
<div className="sb-text">{characters}</div>
<hr />
</div>
<SidebarHeading title="Styles" level={2} />
<div className="sb-block sb-grid">
{
styles.map((style) => {
const className = `ma-texta-${slugifyStyle(style)}`;
return(
<React.Fragment>
<span className={className}>{style}</span>
<span className="markdown-body">
<code>{`.${className}`}</code>
</span>
</React.Fragment>
);
})
}
</div>
<SidebarHeading title="Sizes" level={2} />
<div className="sb-block">
{ Object.keys(typographyOptions.size).map((key) => {
const Element = typographyOptions.size[key];
return(
<Element>{key}</Element>
);
})
}
</div>
</div>

export const Template = (args) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this being used?

<div className="page-content">
<Heading text="Texta" level={1} />
<SidebarHeading title="Characters" level={2} />
<div className="sb-block">
<div className="sb-text">{letters.toUpperCase()}</div>
<div className="sb-text">{letters}</div>
<hr />
<div className="sb-text">{numbers}</div>
<hr />
<div className="sb-text">{characters}</div>
<hr />
</div>
<>
<SidebarHeading title="Custom Sentence" level={2} />
<div className="sb-block">
<CustomElement className={`ma-texta-${slugifyStyle(args.style)}`}>
{args.text}
</CustomElement>
</div>
<SidebarHeading title="Styles" level={2} />
<div className="sb-block sb-grid">
{
styles.map((style) => {
const className = `ma-texta-${slugifyStyle(style)}`;
return(
<React.Fragment>
<span className={className}>{style}</span>
<span className="markdown-body">
<code>{`.${className}`}</code>
</span>
</React.Fragment>
);
})
}
</div>
<SidebarHeading title="Sizes" level={2} />
<div className="sb-block">
{ Object.keys(typographyOptions.size).map((key) => {
const Element = typographyOptions.size[key];
return(
<Element>{key}</Element>
);
})
}
</div>
</div>
</>
)

<Canvas>
<Story
name="Texta (Main Font)"
args={{
text: 'Type something in the text knob, and use other knobs to change text styles.',
style: 'Medium Italic',
size: 'p'
}}
argTypes={{
text: {
control: {
type: 'text'
}
},
style: {
control: {
type: 'select',
options: styles
}
},
size: {
control: {
type: 'select',
options: typographyOptions.size
<Story
name="Texta (Main Font)"
args={{
text: 'Type something in the text knob, and use other knobs to change text styles.',
style: 'Medium Italic',
size: 'p'
}}
argTypes={{
text: {
control: {
type: 'text'
}
},
style: {
control: {
type: 'select',
options: styles
}
},
size: {
control: {
type: 'select',
options: typographyOptions.size
}
}
}
}}
>
{Template.bind({})}
</Story>
</Canvas>
}}
>
{Template.bind({})}
</Story>
</Canvas>

<ArgsTable story={CURRENT_SELECTION}/>