Skip to content

Wech 21/support react 18 #311

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

Closed
wants to merge 65 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
31a7ea4
chore: bump react version to 18.2.0
Mar 13, 2023
c9f7f6f
refactor: use react's useId in useGeneratedId
Mar 13, 2023
5891bd1
docs: migrate from docz to storybook (#312)
zackjones11 Mar 20, 2023
cf048b0
docs: migrate components to storybook part 1 (#313)
zackjones11 Mar 20, 2023
023039a
WECH-23: Migrate components to storybook part 2 (#314)
cristianst Mar 23, 2023
8e952a0
feat: remove nanoid (#321)
martimalek Apr 12, 2023
b562d9f
docs: migrate components to storybook
JanHamara Apr 14, 2023
526fb01
migrate to storybook v7 (#323)
Apr 17, 2023
694122f
chore: fix failing storybook
Apr 17, 2023
239252b
docs: migrate component pages to storybook (#316)
aspasov86 Apr 17, 2023
daf750e
docs: migrate components to storybook (#317)
christify30 Apr 17, 2023
474da45
docs: migrate components (#320)
bluessista Apr 19, 2023
ae9425a
docs: migrate essentials to storybook (#322)
vknibbe Apr 19, 2023
ae5004c
docs: migrate Grid docs
Apr 21, 2023
da2f6ae
Merge branch 'next' into WECH-21/support-react-18
Apr 21, 2023
a045eb8
ci: install with legacy in docs pipeline
Apr 21, 2023
34cda7a
Merge remote-tracking branch 'origin/WECH-21/support-react-18' into W…
Apr 21, 2023
5848410
docs: migrate Headline docs
Apr 21, 2023
ffcddfb
docs: migrate HelperText
Apr 21, 2023
0d4dcec
docs: migrate InlineSpinner
Apr 21, 2023
7b5c307
docs: migrate Infobanner docs
Apr 21, 2023
f3cd48e
docs: remove unused code
Apr 24, 2023
d9c1270
docs: move accordion stories to the accordion folder
Apr 24, 2023
1d6a00a
docs: move Box stories to the box folder
Apr 24, 2023
30786b7
docs: move Button stories to the button folder
Apr 24, 2023
488700b
docs: moves Card stories to the card folder
Apr 24, 2023
c746efb
docs: moves Checkbox stories to the checkbox folder
Apr 24, 2023
5889c10
docs: moves Banner stories to the banner folder
Apr 24, 2023
c6d1213
docs: moves Dimming stories to the dimming folder
Apr 24, 2023
ec9c6a2
docs: moves Divider stories to the divider folder
Apr 24, 2023
64e8bb9
docs: moves datepicker stories to the datepicker folder
Apr 25, 2023
1e0b2bb
docs: clean banner docs
Apr 25, 2023
3727e13
docs: use new imports
Apr 25, 2023
de07c95
docs: remove stories folder
Apr 25, 2023
a8d3fe5
docs: migrate Table docs to csf3
Apr 25, 2023
5f31507
docs: migrate Input docs to csf3
Apr 25, 2023
8902acc
docs: migrate Popover docs to csf3
Apr 25, 2023
aa0312e
docs: migrate Label docs to csf3
Apr 25, 2023
7ef196a
docs: migrate Link docs to csf3
Apr 26, 2023
b724948
docs: migrate Tag docs to csf3
Apr 26, 2023
d564c88
docs: migrate Modal docs to csf3
Apr 26, 2023
09673a9
docs: migrate Tooltip docs to csf3
Apr 26, 2023
87e40ad
docs: migrate Toggle docs to csf3
Apr 26, 2023
0fa46b1
docs: migrate Textarea docs to csf3
Apr 26, 2023
663a8c8
docs: migrate Text docs to csf3
Apr 26, 2023
4f53305
docs: show Text default values
Apr 26, 2023
1d40058
docs: migrate Password docs to csf3
Apr 26, 2023
a97cdd9
docs: migrate TabBar docs to csf3
Apr 26, 2023
c89f128
docs: migrate RadioButton docs to csf3
Apr 26, 2023
5bb2814
docs: migrate PhoneInput docs to csf3
Apr 26, 2023
2a3d688
docs: migrate Offcanvas docs to csf3
Apr 26, 2023
eeec04e
docs: migrate FilePicker docs to csf3
Apr 26, 2023
87e0c69
docs: migrate Skeleton docs to csf3
Apr 26, 2023
74e8eab
docs: migrate Select docs to csf3
Apr 26, 2023
54ca704
docs: align naming of doc pages
Apr 26, 2023
225584e
docs: migrate SelectList docs to csf3
Apr 26, 2023
3f38897
docs: migrate Pagination docs to csf3
Apr 26, 2023
fb1df67
docs: use ArgTypes for table
Apr 26, 2023
f85e0c6
docs: use consistent stories import
Apr 26, 2023
878b4fa
docs: polish docs
Apr 26, 2023
ae485f2
docs: use helper for dark background
May 12, 2023
5160eb2
fix(tooltip): use correct props with children type
May 12, 2023
10d929b
docs: Add Storybook documentation landing page (#334)
JanHamara May 25, 2023
561ed91
Update FreenowTheme.ts
JanHamara May 25, 2023
e1dbf15
Update by-freenow.svg
JanHamara May 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 16 additions & 0 deletions .babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": 100
}
}
],
"@babel/preset-typescript",
"@babel/preset-react"
],
"plugins": []
}
3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
node_modules/

# generated files
.docz/
storybook-static/
lib/

# other
Expand All @@ -12,4 +12,3 @@ assets/
fixtures/

src/icons/
src/gatsby-theme-docz
20 changes: 13 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ module.exports = {
'plugin:jest/recommended',
'plugin:promise/recommended',
'plugin:unicorn/recommended',
'prettier'
'prettier',
'plugin:storybook/recommended',
'plugin:storybook/recommended'
],
env: {
node: true,
Expand All @@ -21,11 +23,8 @@ module.exports = {
rules: {
// conflicts with stylelint rule
'unicorn/numeric-separators-style': 'off',

'unicorn/no-useless-undefined': 'off',

'@typescript-eslint/no-unsafe-return': 'off',

'@typescript-eslint/no-unsafe-assignment': 'off',
'react/require-default-props': 'off',
// Often used for this library
Expand All @@ -35,7 +34,7 @@ module.exports = {
'no-prototype-builtins': 'off',
// https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html
'import/prefer-default-export': 'off',
'import/no-default-export': 'error',
'import/no-default-export': 'off',
// Too restrictive: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md
'react/destructuring-assignment': 'off',
// No jsx extension: https://github.com/facebook/create-react-app/issues/87#issuecomment-234627904
Expand All @@ -47,14 +46,21 @@ module.exports = {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-use-before-define': [
'error',
{ functions: false, classes: true, variables: true, typedefs: true }
{
functions: false,
classes: true,
variables: true,
typedefs: true
}
],
// Common abbreviations are known and readable
'unicorn/prevent-abbreviations': 'off',
// Airbnb prefers forEach
'unicorn/no-array-for-each': 'off',
// It's not accurate in the monorepo style
'import/no-extraneous-dependencies': 'off'
'import/no-extraneous-dependencies': 'off',
// Storybook Template.bind returns any type
'@typescript-eslint/no-unsafe-member-access': 'off'
},
overrides: [
{
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ jobs:
node-version: 18
- name: Install dependencies
uses: bahmutov/npm-install@v1
with:
install-command: npm i --legacy-peer-deps
- name: Build docs
run: npm run build:documentation
- uses: actions/upload-artifact@v3
with:
name: docz-dist
path: .docz/dist
name: storybook-dist
path: storybook-static

deploy:
if: github.ref == 'refs/heads/main'
Expand All @@ -32,7 +34,7 @@ jobs:
steps:
- uses: actions/download-artifact@v3
with:
name: docz-dist
name: storybook-dist
path: public
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ coverage/
junit.xml

# project files
.docz/
storybook-static/
*.tgz
.npmrc
node_modules/
Expand Down
3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
package-lock.json
*.mdx
package-lock.json
41 changes: 41 additions & 0 deletions .storybook/FreenowTheme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// .storybook/FreenowTheme.ts
import { create } from '@storybook/theming/create';
import logo from '../public/assets/freenow-logo.svg';

export default create({
base: 'light',

// Typography
fontBase: '"Open Sans", sans-serif',
fontCode: 'monospace',

brandTitle: 'FREENOW',
brandUrl: 'https://wave.free-now.com/',
brandImage: logo,
brandTarget: '_self',

//
colorPrimary: '#CA0928',
colorSecondary: '#585C6D',

// UI
appBg: '#ffffff',
appContentBg: '#ffffff',
appBorderColor: '#585C6D',
appBorderRadius: 4,

// Text colors
textColor: '#10162F',
textInverseColor: '#ffffff',

// Toolbar default and active colors
barTextColor: '#9E9E9E',
barSelectedColor: '#585C6D',
barBg: '#ffffff',

// Form colors
inputBg: '#ffffff',
inputBorder: '#10162F',
inputTextColor: '#10162F',
inputBorderRadius: 2
});
21 changes: 21 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { StorybookConfig } from '@storybook/react-webpack5';

const config: StorybookConfig = {
stories: ['../**/*.storybook.mdx', '../src/**/*.stories.@(ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-viewport'
],
framework: {
name: '@storybook/react-webpack5',
options: {}
},
docs: {
autodocs: true
},
staticDirs: ['../public']
};

export default config;
7 changes: 7 additions & 0 deletions .storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// .storybook/manager.ts
import { addons } from '@storybook/manager-api';
import FreenowTheme from './FreenowTheme';

addons.setConfig({
theme: FreenowTheme
});
77 changes: 77 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import { Preview } from '@storybook/react';
import { themes } from '@storybook/theming';

export const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
viewMode: 'docs',
controls: {
expanded: true,
matchers: {
color: /(background|color)$/i,
date: /Date$/
}
},
docs: {
theme: themes.light
},
backgrounds: {
default: 'light',
values: [
{ name: 'light', value: '#FFFFFF' },
{ name: 'dark', value: '#001E3E' }
]
},
viewport: {
viewports: {
mobile: {
name: 'Mobile',
styles: {
height: '568px',
width: '320px'
},
type: 'mobile'
},
mobile_landscape: {
name: 'Mobile landscape',
styles: {
height: '320px',
width: '568px'
},
type: 'mobile'
},
tablet: {
name: 'Tablet',
styles: {
height: '1112px',
width: '834px'
},
type: 'tablet'
},
tablet_landscape: {
name: 'Tablet landscape',
styles: {
height: '834px',
width: '1112px'
},
type: 'tablet'
},
desktop: {
name: 'Desktop',
styles: {
height: '1080px',
width: '1920px'
},
type: 'desktop'
}
}
},
options: {
storySort: {
order: ['Welcome', 'Essentials', 'Components', 'Form Elements']
}
}
}
};

export default preview;
11 changes: 6 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,18 @@ If an unreviewed ticket reports a bug, try and reproduce it. If you can reproduc

Our documentation is great but it can always be improved. Did you find a typo? Do you think that something should be clarified? Go ahead and suggest a documentation patch!

We use [Docz](https://www.docz.site) to run our documentation site at [wave.free-now.com](https://wave.free-now.com/).
We use [Storybook](https://storybook.js.org) to run our documentation site at [wave.free-now.com](https://wave.free-now.com/).

To add a new component to our documentation site:

1. Create a new file with the `.md` extension for your component in `/components/[component]/docs`.
2. Add the markdown header for the page name, route and parent menu
3. Include a brief description, examples as well as the the `Playground` and `Props` components of [Docz].
1. Create a new file with the `.stories.tsx` prefix for your component in `/src/stories`.
2. Include a brief description and examples. Props should be configurable via Storybook

To learn more how to add stories go to [Storybook docs](https://storybook.js.org/docs/react/writing-stories/introduction)

### Reporting pains and use cases

Speak outloud for us to understand your pains is valuable, challenge current approaches and help us to understand how to do better. Make sure to verify that the topic hasn't being touched yet on the issues poll otherwise open a new one and let's start the conversation
Speak out loud for us to understand your pains is valuable, challenge current approaches and help us to understand how to do better. Make sure to verify that the topic hasn't being touched yet on the issues poll otherwise open a new one and let's start the conversation

### Take from the backlog

Expand Down
33 changes: 0 additions & 33 deletions docs/accessibility.mdx

This file was deleted.

34 changes: 34 additions & 0 deletions docs/accessibility.storybook.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Meta } from '@storybook/blocks';

<Meta title="Accessibility" />

# Accessibility (a11y)

Accessible design not only helps users with disabilities; it provides better user experiences for everyone.

## Overview

Our goal is to provide a consistent user experience for all users, whether they’re navigating with a mouse/touchscreen, keyboard, or screen reader.

An accessible product should:

- Give all users the same quality of experience
- Adapt to users and situations

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.

## Mission

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:

- **zoom** in up to 300% without the text spilling off the screen
- navigate most of the website using just a **keyboard**
- listen to most of the website using a **screen reader**

## Aid development process

- How to [audit Web a11y Video](https://www.youtube.com/watch?v=cOmehxAU_4s)
- Use the [a11y project checklist](https://www.a11yproject.com/checklist/) and aim for at least A level compliance
- 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)
- 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/)
- 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/)
Loading