Skip to content
Merged

Beta #369

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
cc6ca3e
chore: install and configure TypeScript
WesSouza Jul 20, 2022
659d102
feat(anchor): convert to TypeScript and export types
WesSouza Jul 21, 2022
fc7c8a9
chore(deps): upgrade @types/react and @types/react-dom to 18
WesSouza Jul 25, 2022
f63cbe5
chore(types): add helper type CommonStyledProps
WesSouza Jul 25, 2022
1f3b5f1
chore(anchor): compose type with CommonStyledProps
WesSouza Jul 25, 2022
dcd27b0
chore(anchor): fix import path
WesSouza Jul 25, 2022
105c6c6
chore(types): remove baseUrl from tsconfig.json
WesSouza Jul 25, 2022
334cf5e
feat(appbar): convert to TypeScript and export types
WesSouza Jul 24, 2022
b41b51e
feat(common): convert to TypeScript and export types
WesSouza Jul 24, 2022
e1ed277
chore(types): add missing desktopBackground theme property
WesSouza Jul 25, 2022
c419365
feat(bar): convert to TypeScript and export types
WesSouza Jul 25, 2022
25bcc7c
feat(divider): convert to TypeScript and export types
arturbien Jul 25, 2022
5a69d1d
refactor(getsize): create 'getSize' util
arturbien Jul 25, 2022
58473f5
feat(avatar): convert to TypeScript and export types
WesSouza Jul 25, 2022
cd40930
refactor(appbar): change to named exports
WesSouza Jul 25, 2022
4ba305d
feat(counter): convert to TypeScript and export types
WesSouza Jul 25, 2022
878a07e
feat(desktop): convert to TypeScript and export types
WesSouza Jul 25, 2022
42c02b2
feat(panel): convert to TypeScript and export types
WesSouza Jul 25, 2022
ff380b9
chore(lint): disable no-undef on TypeScript files
WesSouza Jul 25, 2022
0c9d7c4
chore(switchbase): convert to TypeScript and export types
WesSouza Jul 25, 2022
d42af74
refactor(common): change isDisabled common prop to $disabled
WesSouza Jul 26, 2022
1c16025
feat(checkbox): convert to TypeScript and export types
WesSouza Jul 25, 2022
8d37b0c
feat(button): convert to TypeScript and export types
WesSouza Jul 25, 2022
0b29e5f
feat(hourglass): convert to TypeScript and export types
WesSouza Jul 25, 2022
c4bb628
feat(radio): convert to TypeScript and export types
WesSouza Jul 26, 2022
a7eeda1
feat(cutout): convert to TypeScript and export types
WesSouza Jul 25, 2022
0f3c9ff
chore(lint): add eslint-plugin-react-hooks
WesSouza Jul 26, 2022
3c8729a
feat(select): convert to TypeScript and export types
WesSouza Jul 26, 2022
bb6720d
feat(progress): convert to TypeScript and export types
WesSouza Jul 25, 2022
2616fe5
feat(loadingindicator): convert to TypeScript and export types
WesSouza Jul 25, 2022
d5887d4
feat(colorinput): convert to TypeScript and export types
WesSouza Jul 25, 2022
680e083
feat(list,listitem): convert to TypeScript and export types
arturbien Jul 26, 2022
375646b
feat(slider): convert to TypeScript and export types
WesSouza Jul 26, 2022
59b6350
feat(tab,tabbody,tabs): convert to TypeScript and export types
WesSouza Jul 26, 2022
ec7c478
chore(common): convert useControlledOrUncontrolled to TypeScript
WesSouza Jul 27, 2022
64e4279
feat(numberfield,textfield): convert to TypeScript and export types
WesSouza Jul 26, 2022
33f52e9
feat(table,tablebody,tabledatacell,tablehead,tableheadcell,tablerow):…
WesSouza Jul 26, 2022
6c727af
feat(tooltip): convert to TypeScript and export types
WesSouza Jul 27, 2022
ac438b5
feat(window): convert to TypeScript and export types
WesSouza Jul 27, 2022
895279d
feat(toolbar): convert to TypeScript and export types
WesSouza Jul 26, 2022
a96f801
feat(fieldset): convert to TypeScript and export types
WesSouza Jul 27, 2022
cfa6f6e
feat(tree): convert to TypeScript and export types
WesSouza Jul 27, 2022
7cef5d9
fix(types): fix multiple TypeScript issues
WesSouza Jul 27, 2022
38f7cf6
fix(select): fix type issues with onChange
WesSouza Jul 27, 2022
49ab26b
feat(datepicker): convert to TypeScript and export types
WesSouza Jul 25, 2022
5abcb3e
fix(slider): fix thumb rendering off the slider when value was not set
WesSouza Aug 3, 2022
71a964e
ci: add lint and type checking
WesSouza Jul 27, 2022
2eac4e8
feat(storybook): Reimplement "Themes" add on with React95 style
WesSouza Aug 4, 2022
64aee8b
chore: restore React 16 support
WesSouza Jul 28, 2022
dcb7382
docs: improve Storybook, add docs pages as stories
WesSouza Aug 1, 2022
aeca001
docs(anchor): categorize under Typography
WesSouza Jul 30, 2022
51df038
chore(appbar): categorize under Environment
WesSouza Jul 31, 2022
d83eb88
docs(avatar): categorize under Other
WesSouza Jul 31, 2022
bfd4f45
refactor(handle): categorize under Controls, rename Bar to Handle
WesSouza Jul 31, 2022
6e6b9bd
docs(button): categorize under Controls
WesSouza Jul 31, 2022
201d1c0
docs(checkbox): categorize under Controls
WesSouza Jul 31, 2022
d2d1022
docs(colorinput): categorize under Controls
WesSouza Jul 31, 2022
b25a9e8
docs(counter): categorize under Other
WesSouza Jul 31, 2022
7c32d16
refactor(separator): categorize under Layout, rename Divider to Separ…
WesSouza Aug 1, 2022
3f09b49
refactor(scrollview): categorize under Layout, rename Cutout to Scrol…
WesSouza Jul 31, 2022
e06e601
refactor(monitor): categorize under Other, rename Desktop to Monitor
WesSouza Jul 31, 2022
276bdd4
refactor(groupbox): categorize under Controls, rename Fieldset to Gro…
WesSouza Jul 31, 2022
ce0b2cd
docs(hourglass): categorize under Other
WesSouza Jul 31, 2022
e2e0d22
refactor(menulist): categorize under Controls, rename List to MenuList
WesSouza Jul 31, 2022
17146e9
docs(progressbar): categorize under Controls
WesSouza Jul 31, 2022
38ce6cd
chore(loadingindicator): remove LoadingIndicator
WesSouza Aug 4, 2022
24630c8
refactor(numberinput): categorize under Controls, rename from NumberF…
WesSouza Jul 31, 2022
8256a47
docs(tabs): categorize under Controls
WesSouza Jul 31, 2022
bde588c
refactor(frame): categorize under Layout, rename Panel to Frame
WesSouza Jul 31, 2022
b19e15b
docs(radio): categorize under Controls
WesSouza Jul 31, 2022
ce592ab
docs(select): categorize under Controls
WesSouza Jul 31, 2022
c1d84d4
docs(slider): categorize under Controls
WesSouza Jul 31, 2022
b2b2230
docs(table): categorize under Controls
WesSouza Jul 31, 2022
f10e7fe
refactor(textinput): categorize under Controls, rename TextField to T…
WesSouza Aug 1, 2022
c42c3b4
docs(tooltip): categorize under Controls
WesSouza Aug 1, 2022
918d1eb
refactor(treeview): categorize under Controls, rename Tree to TreeView
WesSouza Aug 1, 2022
f106bd4
docs(window): categorize under Environment
WesSouza Aug 1, 2022
cfe475d
chore(datepicker): add displayName to component
WesSouza Aug 1, 2022
746e9c0
refactor(common): move SwitchBase to common folder
WesSouza Aug 1, 2022
e3c0338
refactor(frame): update variants to align with guideline
WesSouza Aug 4, 2022
74f56ec
refactor(appbar): add position prop
WesSouza Aug 4, 2022
7d9067b
refactor(anchor): add underline property, default true
WesSouza Aug 4, 2022
f7103b9
build: remove babel-plugin-polyfill-corejs3 to avoid Babel issue buil…
WesSouza Aug 6, 2022
7efe96c
build: update build to preserve modules and use @rollup/plugin-typesc…
WesSouza Jul 28, 2022
2177c67
fix(coverage): fix Jest coverage not properly referencing code points…
WesSouza Aug 10, 2022
2a0d9ba
chore(usecontrolledoruncontrolled): emulate React's uncontrolled warn…
WesSouza Aug 12, 2022
107fe15
refactor(select): improve keyboard and events, split native to Select…
WesSouza Aug 8, 2022
b0517dd
fix(hourglass): accept style prop
arturbien Oct 28, 2022
acaacd8
fix(slider): fix thumb not draggable
arturbien Oct 30, 2022
f49a107
feat(button): add 'raised' button
arturbien Nov 1, 2022
2c6e141
fix(slider): do not pass event to onChange handlers
arturbien Nov 9, 2022
0471ccb
fix(checkbox): add missing semicolon in styles
arturbien Nov 9, 2022
390edd8
fix(tabs): pass 'value' as first argument in 'onChange'
arturbien Nov 9, 2022
ec6f392
fix(numberinput): pass otherProps down to the wrapper
arturbien Nov 10, 2022
10de27a
style(slider): change 'newValue' to 'value' in onChange handler
arturbien Nov 10, 2022
f5047a0
style(textinput.stories): fix typo in file name
arturbien Nov 10, 2022
06cba7c
docs(storybook): make story 100% height
arturbien Nov 10, 2022
17eec67
fix(checkbox): remove 'menu' variant
arturbien Nov 10, 2022
c76f191
fix(radio): remove 'menu' variant
arturbien Nov 10, 2022
eabc391
docs(readme): add link to 'react95-native'
arturbien Nov 13, 2022
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
  •  
  •  
  •  
63 changes: 49 additions & 14 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,24 +1,59 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env",
{
"modules": false
"shippedProposals": true,
"loose": true
}
],
"@babel/preset-react"
"@babel/preset-typescript"
],
"plugins": [
"babel-plugin-styled-components",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-runtime"
],
"env": {
"test": {
"presets": ["@babel/preset-env"],
"plugins": [
["babel-plugin-styled-components", { "ssr": false, "displayName": false }]
]
}
}
"@babel/plugin-transform-shorthand-properties",
"@babel/plugin-transform-block-scoping",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
}
],
[
"@babel/plugin-proposal-private-property-in-object",
{
"loose": true
}
],
[
"@babel/plugin-proposal-private-methods",
{
"loose": true
}
],
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-syntax-dynamic-import",
[
"@babel/plugin-proposal-object-rest-spread",
{
"loose": true,
"useBuiltIns": true
}
],
"@babel/plugin-transform-classes",
"@babel/plugin-transform-arrow-functions",
"@babel/plugin-transform-parameters",
"@babel/plugin-transform-destructuring",
"@babel/plugin-transform-spread",
"@babel/plugin-transform-for-of",
"babel-plugin-macros",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-nullish-coalescing-operator"
]
}
6 changes: 4 additions & 2 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"installCommand": "install:codesandbox",
"buildCommand": "build:prod",
"sandboxes": ["react95-template-xkfj0"]
"node": "16",
"sandboxes": [
"react95-template-xkfj0"
]
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = yes
insert_final_newline = yes
54 changes: 48 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,72 @@
module.exports = {
extends: ['airbnb', 'plugin:prettier/recommended'],
parser: '@babel/eslint-parser',
extends: [
'plugin:@typescript-eslint/recommended',
'airbnb',
'plugin:prettier/recommended',
'plugin:react-hooks/recommended'
],
parser: '@typescript-eslint/parser',
plugins: ['react', 'prettier'],
env: {
browser: true,
es6: true,
jest: true
},
rules: {
'import/no-unresolved': ['error', { ignore: ['react95'] }],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_\\d*$'
}
],
'import/extensions': ['error', { js: 'never', ts: 'never', tsx: 'never' }],
'import/no-unresolved': [
'error',
// TODO: Remove ../../test/utils when TypeScript migration is complete
{ ignore: ['react95', '../../test/utils'] }
],
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/prefer-default-export': 'off',
'jsx-a11y/label-has-associated-control': ['error', { assert: 'either' }],
'jsx-a11y/label-has-for': 'off',
'no-nested-ternary': 'off',
'prettier/prettier': 'error',
'react/forbid-prop-types': 'off',
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'react/jsx-filename-extension': [
'warn',
{ extensions: ['.js', '.jsx', '.tsx'] }
],
'react/jsx-props-no-spreading': 'off',
'react/no-array-index-key': 'off',
'react/prop-types': 'off',
'react/require-default-props': 'off',
'react/static-property-placement': ['error', 'static public field']
},
overrides: [
{
files: ['*.spec.@(js|jsx)', '*.stories.@(js|jsx)'],
files: ['*.spec.@(js|jsx|ts|tsx)', '*.stories.@(js|jsx|ts|tsx)'],
rules: {
'no-console': 'off'
}
},
{
files: ['*.@(ts|tsx)'],
rules: {
// This is handled by @typescript-eslint/no-unused-vars
'no-undef': 'off'
}
}
],
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx']
},
'import/resolver': {
typescript: {}
}
]
}
};
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,58 @@ on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Cache packages
uses: actions/cache@v3
with:
key: node_modules-v4-${{ hashFiles('yarn.lock') }}
path: |-
node_modules
*/node_modules
restore-keys: 'node_modules-v4-'

- name: Yarn install
run: yarn install --ignore-optional --frozen-lockfile

- name: Lint
run: yarn run lint

type-check:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Cache packages
uses: actions/cache@v3
with:
key: node_modules-v4-${{ hashFiles('yarn.lock') }}
path: |-
node_modules
*/node_modules
restore-keys: 'node_modules-v4-'

- name: Yarn install
run: yarn install --ignore-optional --frozen-lockfile

- name: Type Check
run: yarn run typescript

test:
runs-on: ubuntu-latest
steps:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { DecoratorFn } from '@storybook/react';
import React from 'react';
import { createGlobalStyle } from 'styled-components';

import styleReset from '../../src/common/styleReset';
// TODO is there a way to keep import paths consistent with what end user will get?
import ms_sans_serif from '../../src/assets/fonts/dist/ms_sans_serif.woff2';
import ms_sans_serif_bold from '../../src/assets/fonts/dist/ms_sans_serif_bold.woff2';
import styleReset from '../../src/common/styleReset';

const GlobalStyle = createGlobalStyle`
${styleReset}
Expand All @@ -20,14 +20,21 @@ const GlobalStyle = createGlobalStyle`
font-weight: bold;
font-style: normal
}
html, body, #root {
height: 100%;
}
#root > * {
height: 100%;
box-sizing: border-box;
}
body {
font-family: 'ms_sans_serif', 'sans-serif';
}
`;

export default storyFn => (
export const withGlobalStyle: DecoratorFn = story => (
<>
<GlobalStyle />
{storyFn()}
{story()}
</>
);
Binary file added .storybook/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 0 additions & 18 deletions .storybook/main.js

This file was deleted.

52 changes: 52 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import type { StorybookConfig } from '@storybook/react/types';
import type { PropItem } from 'react-docgen-typescript';

const path = require('path');

const storybookConfig: StorybookConfig = {
stories: ['../@(docs|src)/**/*.stories.@(tsx|mdx)'],
addons: [
{
name: '@storybook/addon-docs',
options: {
sourceLoaderOptions: {
injectStoryParameters: false
}
}
},
'@storybook/addon-storysource',
'./theme-picker/register.ts'
],
core: {
builder: 'webpack5'
},
features: {
babelModeV7: true,
storyStoreV7: true,
modernInlineRender: true,
postcss: false
},
typescript: {
check: false,
checkOptions: {},
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
propFilter: (prop: PropItem) =>
prop.parent ? !/node_modules/.test(prop.parent.fileName) : true
}
},
webpackFinal: config => {
config.resolve = {
...config.resolve,
alias: {
...config.resolve?.alias,
react95: path.resolve(__dirname, '../src/index')
}
};

return config;
}
};

module.exports = storybookConfig;
7 changes: 7 additions & 0 deletions .storybook/manager.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* Remove from the sidebar menu stories that contains "unstable" */
a[data-item-id$='-unstable'].sidebar-item,
a[data-item-id*='-unstable-'].sidebar-item,
button[data-item-id$='-unstable'].sidebar-item,
button[data-item-id$='-unstable-'].sidebar-item {
display: none !important;
}
8 changes: 8 additions & 0 deletions .storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import './manager.css';

import { addons } from '@storybook/addons';
import theme from './theme';

addons.setConfig({
theme
});
40 changes: 0 additions & 40 deletions .storybook/preview.js

This file was deleted.

Loading