Skip to content

Commit a9bb3a7

Browse files
authored
feat: Wizard component (#1358)
* feat: introduce Wizard component * fix: get rid of a button length console error
1 parent 23d396c commit a9bb3a7

20 files changed

+3885
-182
lines changed

Diff for: .eslintrc

+189-181
Original file line numberDiff line numberDiff line change
@@ -1,187 +1,195 @@
11
{
2-
"env": {
3-
"browser": true,
4-
"node": true,
5-
"es6": true,
6-
"jest": true
7-
},
8-
"parser": "babel-eslint",
9-
"plugins": [
10-
"compat",
11-
"ie11",
12-
"jsx-a11y",
13-
"loosely-restrict-imports",
14-
"react",
15-
"eslint-plugin-local-rules"
16-
],
17-
"settings": {
18-
"react": {
19-
"version": "detect"
2+
"env": {
3+
"browser": true,
4+
"node": true,
5+
"es6": true,
6+
"jest": true
7+
},
8+
"parser": "babel-eslint",
9+
"plugins": [
10+
"compat",
11+
"ie11",
12+
"jsx-a11y",
13+
"loosely-restrict-imports",
14+
"react",
15+
"eslint-plugin-local-rules"
16+
],
17+
"settings": {
18+
"react": {
19+
"version": "detect"
20+
}
21+
},
22+
"rules": {
23+
"brace-style": 2,
24+
"camelcase": 2,
25+
"comma-dangle": [2, "never"],
26+
"comma-spacing": 2,
27+
"comma-style": [2, "last"],
28+
"compat/compat": 2,
29+
"default-case": 2,
30+
"dot-notation": 2,
31+
"eol-last": 2,
32+
"eqeqeq": 2,
33+
"guard-for-in": 2,
34+
"handle-callback-err": 2,
35+
"ie11/no-collection-args": 2,
36+
"ie11/no-for-in-const": 2,
37+
"ie11/no-weak-collections": 2,
38+
"indent": [2, 4, {
39+
"SwitchCase": 1,
40+
"ignoredNodes": ["TemplateLiteral"]
2041
}
21-
},
22-
"rules": {
23-
"brace-style": 2,
24-
"camelcase": 2,
25-
"comma-dangle": [2, "never"],
26-
"comma-spacing": 2,
27-
"comma-style": [2, "last"],
28-
"compat/compat": 2,
29-
"default-case": 2,
30-
"dot-notation": 2,
31-
"eol-last": 2,
32-
"eqeqeq": 2,
33-
"guard-for-in": 2,
34-
"handle-callback-err": 2,
35-
"ie11/no-collection-args": 2,
36-
"ie11/no-for-in-const": 2,
37-
"ie11/no-weak-collections": 2,
38-
"indent": [2, 4, {
39-
"SwitchCase": 1,
40-
"ignoredNodes": ["TemplateLiteral"]
41-
}
42-
],
43-
"jsx-a11y/accessible-emoji": 2,
44-
"jsx-a11y/alt-text": 2,
45-
"jsx-a11y/aria-activedescendant-has-tabindex": 2,
46-
"jsx-a11y/aria-props": 2,
47-
"jsx-a11y/aria-proptypes": 2,
48-
"jsx-a11y/aria-role": 2,
49-
"jsx-a11y/aria-unsupported-elements": 2,
50-
"jsx-a11y/heading-has-content": 2,
51-
"jsx-a11y/html-has-lang": 2,
52-
"jsx-a11y/iframe-has-title": 2,
53-
"jsx-a11y/img-redundant-alt": 2,
54-
"jsx-a11y/label-has-for": [2,
55-
{
56-
"allowChildren": true,
57-
"required": {
58-
"every": [
59-
"id"
60-
]
61-
}
62-
}
63-
],
64-
"jsx-a11y/lang": 2,
65-
"jsx-a11y/media-has-caption": 2,
66-
"jsx-a11y/mouse-events-have-key-events": 2,
67-
"jsx-a11y/no-access-key": 2,
68-
"jsx-a11y/no-autofocus": 2,
69-
"jsx-a11y/no-distracting-elements": 2,
70-
"jsx-a11y/no-interactive-element-to-noninteractive-role": 2,
71-
"jsx-a11y/no-noninteractive-tabindex": 2,
72-
"jsx-a11y/no-onchange": 2,
73-
"jsx-a11y/no-redundant-roles": 2,
74-
"jsx-a11y/role-has-required-aria-props": 2,
75-
"jsx-a11y/scope": 2,
76-
"jsx-a11y/tabindex-no-positive": 2,
77-
"jsx-quotes": [2, "prefer-single"],
78-
"key-spacing": 2,
79-
"keyword-spacing": [2, { "before": true }],
80-
"loosely-restrict-imports/loosely-restrict-imports": [2, ".jsx"],
81-
"new-cap": 2,
82-
"no-cond-assign": 2,
83-
"no-console": 2,
84-
"no-constant-condition": 2,
85-
"no-control-regex": 2,
86-
"no-debugger": 2,
87-
"no-dupe-args": 2,
88-
"no-dupe-keys": 2,
89-
"no-duplicate-case": 2,
90-
"no-empty-character-class": 2,
91-
"no-empty": 2,
92-
"no-ex-assign": 2,
93-
"no-extra-bind": 2,
94-
"no-extra-boolean-cast": 0,
95-
"no-extra-parens": 0,
96-
"no-extra-semi": 2,
97-
"no-fallthrough": 2,
98-
"no-floating-decimal": 2,
99-
"no-func-assign": 2,
100-
"no-inner-declarations": 2,
101-
"no-invalid-regexp": 2,
102-
"no-irregular-whitespace": 2,
103-
"no-loop-func": 2,
104-
"no-mixed-spaces-and-tabs": 2,
105-
"no-multi-spaces": 2,
106-
"no-negated-in-lhs": 2,
107-
"no-nested-ternary": 2,
108-
"no-obj-calls": 2,
109-
"no-regex-spaces": 2,
110-
"no-shadow": 2,
111-
"no-spaced-func": 2,
112-
"no-sparse-arrays": 2,
113-
"no-trailing-spaces": 2,
114-
"no-undef": 2,
115-
"no-undefined": 2,
116-
"no-underscore-dangle": 0,
117-
"no-unreachable": 2,
118-
"no-unused-vars": [2, { "ignoreRestSiblings": true }],
119-
"object-curly-spacing": [2, "always"],
120-
"quote-props": [2, "as-needed",
121-
{
122-
"keywords": true,
123-
"unnecessary": false
124-
}
125-
],
126-
"quotes": [2, "single"],
127-
"radix": 2,
128-
"react/display-name": 2,
129-
"react/jsx-boolean-value": 2,
130-
"react/jsx-closing-bracket-location": [2, "after-props"],
131-
"react/jsx-equals-spacing": [2, "never"],
132-
"react/jsx-indent": 2,
133-
"react/jsx-indent-props": 2,
134-
"react/jsx-max-props-per-line": [2, { "maximum": 2 }],
135-
"react/jsx-no-undef": 2,
136-
"react/jsx-tag-spacing": [2, { "beforeSelfClosing": "always"}],
137-
"react/jsx-sort-props": 2,
138-
"react/jsx-uses-react": 2,
139-
"react/jsx-uses-vars": 2,
140-
"react/jsx-wrap-multilines": 2,
141-
"react/no-did-mount-set-state": 2,
142-
"react/no-did-update-set-state": 2,
143-
"react/no-multi-comp": 2,
144-
"react/no-unknown-property": 2,
145-
"react/prop-types": [2, {"ignore": ["cssNamespace"], "skipUndeclared": true}],
146-
"react/react-in-jsx-scope": 2,
147-
"react/self-closing-comp": 2,
148-
"react/sort-prop-types": [2,
149-
{
150-
"callbacksLast": true,
151-
"ignoreCase": true,
152-
"requiredFirst": true
153-
}
154-
],
155-
"semi-spacing": 2,
156-
"semi": 2,
157-
"local-rules/classnames-wrap": 2,
158-
"local-rules/sort-imports": [2,
159-
{
160-
"ignoreCase": true,
161-
"ignoreMemberSort": false,
162-
"memberSyntaxSortOrder": [
163-
"single",
164-
"multiple",
165-
"all",
166-
"none",
167-
"css"
42+
],
43+
"jsx-a11y/accessible-emoji": 2,
44+
"jsx-a11y/alt-text": 2,
45+
"jsx-a11y/aria-activedescendant-has-tabindex": 2,
46+
"jsx-a11y/aria-props": 2,
47+
"jsx-a11y/aria-proptypes": 2,
48+
"jsx-a11y/aria-role": 2,
49+
"jsx-a11y/aria-unsupported-elements": 2,
50+
"jsx-a11y/heading-has-content": 2,
51+
"jsx-a11y/html-has-lang": 2,
52+
"jsx-a11y/iframe-has-title": 2,
53+
"jsx-a11y/img-redundant-alt": 2,
54+
"jsx-a11y/label-has-for": [2,
55+
{
56+
"allowChildren": true,
57+
"required": {
58+
"every": [
59+
"id"
16860
]
16961
}
170-
],
171-
"space-before-blocks": 2,
172-
"space-before-function-paren": [2, "never"],
173-
"space-infix-ops": 2,
174-
"spaced-comment": [0, "always", { "exceptions": ["-"] }],
175-
"strict": [2, "global"],
176-
"use-isnan": 2,
177-
"valid-jsdoc": [2,
178-
{
179-
"prefer": {
180-
"return": "returns"
181-
}
62+
}
63+
],
64+
"jsx-a11y/lang": 2,
65+
"jsx-a11y/media-has-caption": 2,
66+
"jsx-a11y/mouse-events-have-key-events": 2,
67+
"jsx-a11y/no-access-key": 2,
68+
"jsx-a11y/no-autofocus": 2,
69+
"jsx-a11y/no-distracting-elements": 2,
70+
"jsx-a11y/no-interactive-element-to-noninteractive-role": 2,
71+
"jsx-a11y/no-noninteractive-tabindex": 2,
72+
"jsx-a11y/no-onchange": 2,
73+
"jsx-a11y/no-redundant-roles": 2,
74+
"jsx-a11y/role-has-required-aria-props": 2,
75+
"jsx-a11y/scope": 2,
76+
"jsx-a11y/tabindex-no-positive": 2,
77+
"jsx-quotes": [2, "prefer-single"],
78+
"key-spacing": 2,
79+
"keyword-spacing": [2, { "before": true }],
80+
"loosely-restrict-imports/loosely-restrict-imports": [2, ".jsx"],
81+
"new-cap": 2,
82+
"no-cond-assign": 2,
83+
"no-console": 2,
84+
"no-constant-condition": 2,
85+
"no-control-regex": 2,
86+
"no-debugger": 2,
87+
"no-dupe-args": 2,
88+
"no-dupe-keys": 2,
89+
"no-duplicate-case": 2,
90+
"no-empty-character-class": 2,
91+
"no-empty": 2,
92+
"no-ex-assign": 2,
93+
"no-extra-bind": 2,
94+
"no-extra-boolean-cast": 0,
95+
"no-extra-parens": 0,
96+
"no-extra-semi": 2,
97+
"no-fallthrough": 2,
98+
"no-floating-decimal": 2,
99+
"no-func-assign": 2,
100+
"no-inner-declarations": 2,
101+
"no-invalid-regexp": 2,
102+
"no-irregular-whitespace": 2,
103+
"no-loop-func": 2,
104+
"no-mixed-spaces-and-tabs": 2,
105+
"no-multi-spaces": 2,
106+
"no-negated-in-lhs": 2,
107+
"no-nested-ternary": 2,
108+
"no-obj-calls": 2,
109+
"no-regex-spaces": 2,
110+
"no-shadow": 2,
111+
"no-spaced-func": 2,
112+
"no-sparse-arrays": 2,
113+
"no-trailing-spaces": 2,
114+
"no-undef": 2,
115+
"no-undefined": 2,
116+
"no-underscore-dangle": 0,
117+
"no-unreachable": 2,
118+
"no-unused-vars": [2, { "ignoreRestSiblings": true }],
119+
"object-curly-spacing": [2, "always"],
120+
"quote-props": [2, "as-needed",
121+
{
122+
"keywords": true,
123+
"unnecessary": false
124+
}
125+
],
126+
"quotes": [2, "single"],
127+
"radix": 2,
128+
"react/display-name": 2,
129+
"react/jsx-boolean-value": 2,
130+
"react/jsx-closing-bracket-location": [2, "after-props"],
131+
"react/jsx-equals-spacing": [2, "never"],
132+
"react/jsx-indent": 2,
133+
"react/jsx-indent-props": 2,
134+
"react/jsx-max-props-per-line": [2, { "maximum": 2 }],
135+
"react/jsx-no-undef": 2,
136+
"react/jsx-tag-spacing": [2, { "beforeSelfClosing": "always"}],
137+
"react/jsx-sort-props": 2,
138+
"react/jsx-uses-react": 2,
139+
"react/jsx-uses-vars": 2,
140+
"react/jsx-wrap-multilines": 2,
141+
"react/no-did-mount-set-state": 2,
142+
"react/no-did-update-set-state": 2,
143+
"react/no-multi-comp": 2,
144+
"react/no-unknown-property": 2,
145+
"react/prop-types": [2, {"ignore": ["cssNamespace"], "skipUndeclared": true}],
146+
"react/react-in-jsx-scope": 2,
147+
"react/self-closing-comp": 2,
148+
"react/sort-prop-types": [2,
149+
{
150+
"callbacksLast": true,
151+
"ignoreCase": true,
152+
"requiredFirst": true
153+
}
154+
],
155+
"semi-spacing": 2,
156+
"semi": 2,
157+
"local-rules/classnames-wrap": 2,
158+
"local-rules/sort-imports": [2,
159+
{
160+
"ignoreCase": true,
161+
"ignoreMemberSort": false,
162+
"memberSyntaxSortOrder": [
163+
"single",
164+
"multiple",
165+
"all",
166+
"none",
167+
"css"
168+
]
169+
}
170+
],
171+
"space-before-blocks": 2,
172+
"space-before-function-paren": [2, "never"],
173+
"space-infix-ops": 2,
174+
"spaced-comment": [0, "always", { "exceptions": ["-"] }],
175+
"strict": [2, "global"],
176+
"use-isnan": 2,
177+
"valid-jsdoc": [2,
178+
{
179+
"prefer": {
180+
"return": "returns"
182181
}
183-
],
184-
"valid-typeof": 2,
185-
"wrap-iife": [2, "any"]
182+
}
183+
],
184+
"valid-typeof": 2,
185+
"wrap-iife": [2, "any"]
186+
},
187+
"overrides": [
188+
{
189+
"files": ["**/__stories__/*.js"],
190+
"rules": {
191+
"valid-jsdoc": 0
192+
}
186193
}
187-
}
194+
]
195+
}

Diff for: src/Button/Button.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ const validateStateTransitionMessage = (props, propName) => {
148148
};
149149

150150
const badgePropValidation = (props, propName) => {
151-
if (props[propName].length < 1 || props[propName].length > 4) {
151+
if (props[propName]?.length < 1 || props[propName]?.length > 4) {
152152
return new Error(`${propName} must be between 1-4 characters.`);
153153
}
154154
};

0 commit comments

Comments
 (0)