Skip to content

Commit ae9425a

Browse files
vknibbelenavanessa-knibbeNikolai Lopin
authored
docs: migrate essentials to storybook (#322)
* essentials pages * Logo * Icons * remove IE 11 from the list of supported --------- Co-authored-by: lena <[email protected]> Co-authored-by: Vanessa Knibbe <[email protected]> Co-authored-by: Nikolai Lopin <[email protected]>
1 parent 474da45 commit ae9425a

32 files changed

+562
-472
lines changed

.storybook/main.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
import { StorybookConfig } from '@storybook/react-webpack5';
22

33
const config: StorybookConfig = {
4-
stories: ['../src/**/*.(stories|storybook).mdx', '../src/**/*.stories.@(ts|tsx)'],
5-
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions'],
4+
stories: [
5+
'../docs/**/*.(stories|storybook).mdx',
6+
'../src/**/*.(stories|storybook).mdx',
7+
'../src/**/*.stories.@(ts|tsx)'
8+
],
9+
addons: [
10+
'@storybook/addon-links',
11+
'@storybook/addon-essentials',
12+
'@storybook/addon-interactions',
13+
'@storybook/addon-viewport'
14+
],
615
framework: {
716
name: '@storybook/react-webpack5',
817
options: {}

.storybook/preview.ts

+55
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,63 @@ export const preview: Preview = {
1717
{ name: 'light', value: '#FFFFFF' },
1818
{ name: 'dark', value: '#001E3E' }
1919
]
20+
},
21+
viewport: {
22+
viewports: {
23+
mobile: {
24+
name: 'Mobile',
25+
styles: {
26+
height: '568px',
27+
width: '320px'
28+
},
29+
type: 'mobile'
30+
},
31+
mobile_landscape: {
32+
name: 'Mobile landscape',
33+
styles: {
34+
height: '320px',
35+
width: '568px'
36+
},
37+
type: 'mobile'
38+
},
39+
tablet: {
40+
name: 'Tablet',
41+
styles: {
42+
height: '1112px',
43+
width: '834px'
44+
},
45+
type: 'tablet'
46+
},
47+
tablet_landscape: {
48+
name: 'Tablet landscape',
49+
styles: {
50+
height: '834px',
51+
width: '1112px'
52+
},
53+
type: 'tablet'
54+
},
55+
desktop: {
56+
name: 'Desktop',
57+
styles: {
58+
height: '1080px',
59+
width: '1920px'
60+
},
61+
type: 'desktop'
62+
}
63+
}
64+
},
65+
options: {
66+
storySort: {
67+
order: ['Get Started']
68+
}
2069
}
2170
}
2271
};
2372

2473
export default preview;
74+
75+
// (default) 0 - Mobile (portrait)
76+
// 30rem (480px) 1 small Mobile (landscape)
77+
// 48rem (768px) 2 medium Tablet (portrait)
78+
// 62rem (992px) 3 large Tablet (landscape)
79+
// 75rem (1200px) 4 xlarge Laptops (and Desktops)

docs/accessibility.mdx

-33
This file was deleted.

docs/accessibility.stories.mdx

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { Meta } from '@storybook/blocks';
2+
3+
<Meta title="Accessibility" />
4+
5+
# Accessibility (a11y)
6+
7+
Accessible design not only helps users with disabilities; it provides better user experiences for everyone.
8+
9+
## Overview
10+
11+
Our goal is to provide a consistent user experience for all users, whether they’re navigating with a mouse/touchscreen, keyboard, or screen reader.
12+
13+
An accessible product should:
14+
15+
- Give all users the same quality of experience
16+
- Adapt to users and situations
17+
18+
Individually accessible elements and components are part of building accessible products, but the accessibility efforts need for manual testing. When designing new UIs, rely as much as possible on Wave existing components and follow accessible patterns. If you're creating a new component or pattern (one that doesn't exist in Wave), keep in mind accessibility practices before your implementation.
19+
20+
## Mission
21+
22+
The Wave Design System team wants as many people as possible to be able to use Wave powered products. For example, that means you should be able to:
23+
24+
- **zoom** in up to 300% without the text spilling off the screen
25+
- navigate most of the website using just a **keyboard**
26+
- listen to most of the website using a **screen reader**
27+
28+
## Aid development process
29+
30+
- How to [audit Web a11y Video](https://www.youtube.com/watch?v=cOmehxAU_4s)
31+
- Use the [a11y project checklist](https://www.a11yproject.com/checklist/) and aim for at least A level compliance
32+
- Use [axe dev tools](https://chrome.google.com/webstore/detail/axe-devtools-web-accessib/lhdoppojpmngadmnindnejefpokejbdd) for accessibility testing. Check more at [deque Axe](https://www.deque.com/axe/devtools/) and learn [how to use it with this Video](https://www.youtube.com/watch?v=dyU9yrRJ5Eg)
33+
- Use [Lighthouse Chrome extension](https://chrome.google.com/webstore/detail/lighthouse/blipmdconlkpinefehnmjammfjpmpbjk?hl=en) for accessibility score. Check more at [Web.dev a11y](https://web.dev/accessibility-scoring/)
34+
- Use [accessible queries](https://testing-library.com/docs/queries/about#priority) when writing tests. This assume you are using [testing-library](https://testing-library.com/)
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
---
2-
name: Browser support
3-
route: /browser-support
4-
cardHeadline: Browser support
5-
cardSubHeadline: Creating a consistent experience across browsers and devices.
6-
---
1+
import { Meta } from '@storybook/blocks';
2+
3+
<Meta title="Browser support" />
4+
5+
# Browser support
6+
7+
Creating a consistent experience across browsers and devices.
78

89
## Supported Devices
910

1011
The design system should be universally accessible. Components might not look perfect in all scenarios, but everything
1112
should still be accessible to the user.
1213

13-
**Currently, we are supporting the latest 2 versions of Chrome, Firefox, Safari, Edge and Internet Explorer 11.**
14+
**Currently, we are supporting the latest 2 versions of Chrome, Firefox, Safari, and Edge.**

docs/contributing.mdx renamed to docs/contributing.stories.mdx

+12-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
---
2-
name: Contributing
3-
route: /contributing
4-
cardHeadline: Contributing
5-
cardSubHeadline: Everyone is welcome to make contributions to the design system. To make sure that everyone can contribute, we have decided to write out a few steps that help you add your contributions.
6-
---
7-
8-
import workflowImageUrl from './contributing-new-pattern-workflow.svg'
1+
import { Meta } from '@storybook/blocks';
2+
import workflowImageUrl from './contributing-new-pattern-workflow.svg';
93
import { ImageModal } from './components/ImageModal';
104

5+
<Meta title="Contributing" />
6+
7+
# Contributing
8+
9+
Everyone is welcome to make contributions to the design system. To make sure that everyone can contribute, we have decided to write out a few steps that help you add your contributions.
10+
1111
## Reporting Bugs
1212

1313
The design system is used in many places. We have a hard time keeping our eyes on all of them to keep up with the issues
@@ -27,13 +27,13 @@ should be added to the design system.
2727
This is the submission process for new components, essentials and improvements to existing components:
2828

2929
1. [Create a Github issue](https://github.com/freenowtech/wave/issues/new) with the basic information and gather
30-
feedback from the maintainers and your fellow developers
30+
feedback from the maintainers and your fellow developers
3131
2. Align with the maintainers and other developers on the API of the component
3232
3. After the development is done, open a pull request, keeping the
33-
[development guidelines](../CONTRIBUTING.md) in mind. You will get feedback here, but we recommend check-ins with
34-
designers and developers during the development
33+
[development guidelines](../CONTRIBUTING.md) in mind. You will get feedback here, but we recommend check-ins with
34+
designers and developers during the development
3535
4. With the required approvals, you can merge your branch to main and it will be released by the maintainers in the
36-
next version of `@freenow/wave`
36+
next version of `@freenow/wave`
3737

3838
If you need any help during the process, don't hesitate to reach out to one of the maintainers.
3939

@@ -51,7 +51,6 @@ Descriptions, FAQs and explanations are all valuable for us! Documentation PRs a
5151

5252
All the documentation pages are Markdown-based. You don't need to know how to write code to contribute.
5353

54-
5554
## Other Contributions
5655

5756
Not all contributions have to be made in design, code and pull requests. You can for example help your team adopt the

docs/index.mdx renamed to docs/index.stories.mdx

+19-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
---
2-
name: Get Started
3-
route: '/'
4-
cardHeadline: Wave Design System
5-
cardSubHeadline: Welcome to the Design System of FREE NOW. Thanks for stopping by! This is the place where you find the latest components and essentials, that enable you to rapidly build your product.
6-
---
1+
import { Meta } from '@storybook/blocks';
2+
import { Card } from '../src/components/Card/Card';
3+
import { Headline } from '../src/components/Headline/Headline';
4+
import { Text } from '../src/components/Text/Text';
5+
6+
<Meta title="Get Started" />
7+
8+
# Wave Design System
9+
10+
Welcome to the Design System of FREE NOW. Thanks for stopping by! This is the place where you find the latest components and essentials, that enable you to rapidly build your product.
711

812
## Installation
913

@@ -18,16 +22,23 @@ npm i @freenow/wave
1822
All of our components are exported by name from `@freenow/wave`, so you can import them with:
1923

2024
```jsx
21-
import { Button, Card, Headline, Text } from '@freenow/wave';
25+
import { Card, Headline, Text } from '@freenow/wave';
2226

2327
export default () => (
24-
<Card>
28+
<Card level={200}>
2529
<Headline>Welcome</Headline>
2630
<Text>FREE NOW Design System</Text>
2731
</Card>
2832
);
2933
```
3034

35+
You'll see this:
36+
37+
<Card level={200}>
38+
<Headline>Welcome</Headline>
39+
<Text>FREE NOW Design System</Text>
40+
</Card>
41+
3142
## Dynamic Imports & Create React App
3243

3344
If you are using create-react-app for your project, you are already set up and can use the library without additional

docs/migrating.mdx renamed to docs/migrating.stories.mdx

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
---
2-
name: Migrating
3-
route: /migrating
4-
cardHeadline: Migrating
5-
cardSubHeadline: Migrating from one major version to the next with ease.
6-
---
1+
import { Meta } from '@storybook/blocks';
2+
3+
<Meta title="Migrating" />
4+
5+
# Migrating
6+
7+
Migrating from one major version to the next with ease.
78

89
## From v1 to v2
910

@@ -18,7 +19,6 @@ npx jscodeshift -t node_modules/@freenow/wave/codemods/v2.ts path/to/src
1819
The `block` property used to act as a shortcut to give the button components a width of 100%. In the future, use the `width` property
1920
directly. It uses the styled-system variable, which is a lot more flexible than just the boolean flag.
2021

21-
2222
## Codemods
2323

2424
Codemods are scripted transformations that you can run on your code to take care of most of the repetitive work involved

docs/versioning-policy.mdx

-22
This file was deleted.

docs/versioning-policy.stories.mdx

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Meta } from '@storybook/blocks';
2+
3+
<Meta title="Versioning Policy" />
4+
5+
# Versioning Policy
6+
7+
Predictable and consistent versions for Wave
8+
9+
## Semantic Versioning
10+
11+
Our goal is to release update to this library without breaking anyone's projects. Therefore, we are using [SemVer](https://semver.org)
12+
which has the following release types.
13+
14+
- **Major** versions contain breaking changes and may also contain sweeping visual changes, like changing colors (usually includes a codemods).
15+
- **Minor** versions include new components or functionality and properties for existing components.
16+
- **Patch** versions provide internal fixes, documentation changes or package upgrades (anything that does not affect the consumers of this library).
17+
18+
### Deprecations
19+
20+
When deciding on the deprecation of a feature or component in the next major version, we add a warning indicating
21+
the feature is scheduled for deprecation or removal. This is sent to the console in development builds and excluded in
22+
production builds.

src/components/Logo/Logo.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ import { BusinessLogo } from './variants/BusinessLogo';
55
interface LogoProps {
66
/**
77
* Adjust component for display on a dark background
8+
* @default false
89
*/
910
inverted?: boolean;
1011
/**
1112
* Change the logo appearance to reflect the respective part of the organization
13+
* @default default
1214
*/
1315
variant?: 'default' | 'business';
1416
/**
1517
* Change the logo to monochrome version (blue letters for regular version and white letters for inverted)
18+
* @default false
1619
*/
1720
monochrome?: boolean;
1821
}

src/components/Logo/docs/Logo.mdx

-29
This file was deleted.

0 commit comments

Comments
 (0)