Skip to content

Commit 792c505

Browse files
authored
feat: use design tokens for text-input (#443)
* feat: use tokens for text-input, password-input and number-input
1 parent 7469bae commit 792c505

15 files changed

+524
-254
lines changed

.eslintrc.yaml

+52-62
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ overrides:
3333
'react/display-name': 0
3434
- files: ['*.visualspec.js']
3535
globals:
36-
page: true
37-
HOST: true
36+
page: true
37+
HOST: true
3838
settings:
3939
import/ignore:
4040
# included by default, but replaced if explicitly configured
@@ -49,63 +49,53 @@ settings:
4949
version: detect
5050

5151
rules:
52-
'class-methods-use-this':
53-
- 'error'
54-
- exceptMethods: [
55-
'render',
56-
'getInitialState',
57-
'getDefaultProps',
58-
'getChildContext',
59-
'shouldComponentUpdate',
60-
'UNSAFE_componentWillMount',
61-
'UNSAFE_componentWillReceiveProps',
62-
'UNSAFE_componentWillUpdate',
63-
'componentWillUnmount',
64-
'componentDidMount',
65-
'componentDidUpdate',
66-
]
67-
'function-paren-newline': 0
68-
# ui-kit is a mapped module in bundle tests, so it will not be found
69-
# settting ignorePackages will disable the extension warning for it.
70-
'import/extensions': [
71-
'error',
72-
'ignorePackages',
73-
{
74-
js: 'never',
75-
},
76-
]
77-
'import/no-extraneous-dependencies': 0
78-
'import/no-named-as-default': 0
79-
# ui-kit is a mapped module in bundle tests, so it will not be found
80-
# We exclude it from the checks
81-
'import/no-unresolved': [2, { ignore: ['ui-kit'] }]
82-
'import/first': 0
83-
'import/order': 2
84-
'no-restricted-globals': ['error', 'find', 'name', 'location']
85-
'no-warning-comments': 0
86-
'no-use-before-define': [
87-
'error',
88-
{
89-
functions: false,
90-
},
91-
]
92-
'no-underscore-dangle': 0
93-
'jest/no-identical-title': 'warn'
94-
'jest/no-focused-tests': 2
95-
'react/jsx-uses-vars': 2
96-
'react/wrap-multilines': 0
97-
'react/no-deprecated': 'error'
98-
'react/no-find-dom-node': 0
99-
'react/display-name': [
100-
1,
101-
{
102-
ignoreTranspilerName: true,
103-
}
104-
]
105-
'prefer-object-spread/prefer-object-spread': 2
106-
'prefer-destructuring': 0
107-
'prefer-promise-reject-errors': 'warn'
108-
'react/jsx-no-target-blank': 0
109-
'lines-between-class-members': 0
110-
# NOTE: The regular rule does not support do-expressions. The equivalent rule of babel does.
111-
'no-unused-expressions': 0
52+
'class-methods-use-this':
53+
- 'error'
54+
- exceptMethods:
55+
- render
56+
- getInitialState
57+
- getDefaultProps
58+
- getChildContext
59+
- shouldComponentUpdate
60+
- UNSAFE_componentWillMount
61+
- UNSAFE_componentWillReceiveProps
62+
- UNSAFE_componentWillUpdate
63+
- componentWillUnmount
64+
- componentDidMount
65+
- componentDidUpdate
66+
'function-paren-newline': 0
67+
# ui-kit is a mapped module in bundle tests, so it will not be found
68+
# settting ignorePackages will disable the extension warning for it.
69+
'import/extensions':
70+
- error
71+
- ignorePackages
72+
- js: 'never'
73+
'import/no-extraneous-dependencies': 0
74+
'import/no-named-as-default': 0
75+
# ui-kit is a mapped module in bundle tests, so it will not be found
76+
# We exclude it from the checks
77+
'import/no-unresolved': [2, { ignore: ['ui-kit'] }]
78+
'import/first': 0
79+
'import/order': 2
80+
'no-restricted-globals': ['error', 'find', 'name', 'location']
81+
'no-warning-comments': 0
82+
'no-use-before-define':
83+
- error
84+
- functions: false
85+
'no-underscore-dangle': 0
86+
'jest/no-identical-title': 'warn'
87+
'jest/no-focused-tests': 2
88+
'react/jsx-uses-vars': 2
89+
'react/wrap-multilines': 0
90+
'react/no-deprecated': 'error'
91+
'react/no-find-dom-node': 0
92+
'react/display-name':
93+
- 1
94+
- ignoreTranspilerName: true
95+
'prefer-object-spread/prefer-object-spread': 2
96+
'prefer-destructuring': 0
97+
'prefer-promise-reject-errors': 'warn'
98+
'react/jsx-no-target-blank': 0
99+
'lines-between-class-members': 0
100+
# NOTE: The regular rule does not support do-expressions. The equivalent rule of babel does.
101+
'no-unused-expressions': 0

lint-staged.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
22
'*.md': ['yarn format:md', 'git add'],
3+
'*.yaml': ['yarn format:yaml', 'git add'],
34
'*.js': [
45
// NOTE: apparently if you pass some argument that is not a flag AFTER the `reporters`
56
// flag, jest does not seem correctly parse the arguments.

materials/custom-properties.css

+19
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
--border-radius-4: 4px;
3636
--border-radius-6: 6px;
3737
--border-radius-20: 20px;
38+
--font-family-body: 'Open Sans', sans-serif;
39+
--font-size-m: 13px;
3840
--shadow-1: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
3941
--shadow-2: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
4042
--shadow-3: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
@@ -78,6 +80,8 @@
7880
--background-color-tag-disabled: hsl(0, 0%, 95%);
7981
--background-color-tag-normal-hover: hsl(0, 0%, 60%);
8082
--background-color-tag-warning-hover: #f16d0e;
83+
--background-color-for-input: #fff;
84+
--background-color-for-input-when-disabled: hsl(195, 35.2941176471%, 98%);
8185
--border-color-input-pristine: hsl(0, 0%, 60%);
8286
--border-color-input-focus: #00b39e;
8387
--border-color-input-disabled: #ccc;
@@ -89,15 +93,30 @@
8993
--border-color-tag-focus: #00b39e;
9094
--border-color-tag-warning-hover: #f16d0e;
9195
--border-color-separator: #ccc;
96+
--border-color-for-input: hsl(0, 0%, 60%);
97+
--border-color-for-input-when-focused: #00b39e;
98+
--border-color-for-input-when-disabled: #ccc;
99+
--border-color-for-input-when-readonly: #ccc;
100+
--border-color-for-input-when-error: #e60050;
101+
--border-color-for-input-when-warning: #f16d0e;
92102
--border-radius-input: 6px;
93103
--border-radius-tag: 2px;
104+
--border-radius-for-input: 6px;
94105
--font-color-default: #1a1a1a;
95106
--font-color-disabled: hsl(0, 0%, 60%);
96107
--font-color-error: #e60050;
97108
--font-color-success: #00b39e;
98109
--font-color-warning: #f16d0e;
99110
--font-color-readonly: hsl(0, 0%, 60%);
100111
--font-color-placeholder: hsl(0, 0%, 60%);
112+
--font-color-for-input: #1a1a1a;
113+
--font-color-for-input-when-disabled: hsl(0, 0%, 60%);
114+
--font-color-for-input-when-error: #e60050;
115+
--font-color-for-input-when-readonly: hsl(0, 0%, 60%);
116+
--font-color-for-input-when-warning: #f16d0e;
117+
--font-family: 'Open Sans', sans-serif;
118+
--placeholder-font-color-for-input: hsl(0, 0%, 60%);
119+
--font-size-for-input: 13px;
101120
--shadow-box-tag-when-hovered: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
102121
--big-button-height: 32px;
103122
--small-button-height: 24px;

materials/custom-properties.json

+19
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
"--border-radius-4": "4px",
2929
"--border-radius-6": "6px",
3030
"--border-radius-20": "20px",
31+
"--font-family-body": "'Open Sans', sans-serif",
32+
"--font-size-m": "13px",
3133
"--shadow-1": "0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24)",
3234
"--shadow-2": "0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23)",
3335
"--shadow-3": "0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23)",
@@ -71,6 +73,8 @@
7173
"--background-color-tag-disabled": "hsl(0, 0%, 95%)",
7274
"--background-color-tag-normal-hover": "hsl(0, 0%, 60%)",
7375
"--background-color-tag-warning-hover": "#f16d0e",
76+
"--background-color-for-input": "#fff",
77+
"--background-color-for-input-when-disabled": "hsl(195, 35.2941176471%, 98%)",
7478
"--border-color-input-pristine": "hsl(0, 0%, 60%)",
7579
"--border-color-input-focus": "#00b39e",
7680
"--border-color-input-disabled": "#ccc",
@@ -82,15 +86,30 @@
8286
"--border-color-tag-focus": "#00b39e",
8387
"--border-color-tag-warning-hover": "#f16d0e",
8488
"--border-color-separator": "#ccc",
89+
"--border-color-for-input": "hsl(0, 0%, 60%)",
90+
"--border-color-for-input-when-focused": "#00b39e",
91+
"--border-color-for-input-when-disabled": "#ccc",
92+
"--border-color-for-input-when-readonly": "#ccc",
93+
"--border-color-for-input-when-error": "#e60050",
94+
"--border-color-for-input-when-warning": "#f16d0e",
8595
"--border-radius-input": "6px",
8696
"--border-radius-tag": "2px",
97+
"--border-radius-for-input": "6px",
8798
"--font-color-default": "#1a1a1a",
8899
"--font-color-disabled": "hsl(0, 0%, 60%)",
89100
"--font-color-error": "#e60050",
90101
"--font-color-success": "#00b39e",
91102
"--font-color-warning": "#f16d0e",
92103
"--font-color-readonly": "hsl(0, 0%, 60%)",
93104
"--font-color-placeholder": "hsl(0, 0%, 60%)",
105+
"--font-color-for-input": "#1a1a1a",
106+
"--font-color-for-input-when-disabled": "hsl(0, 0%, 60%)",
107+
"--font-color-for-input-when-error": "#e60050",
108+
"--font-color-for-input-when-readonly": "hsl(0, 0%, 60%)",
109+
"--font-color-for-input-when-warning": "#f16d0e",
110+
"--font-family": "'Open Sans', sans-serif",
111+
"--placeholder-font-color-for-input": "hsl(0, 0%, 60%)",
112+
"--font-size-for-input": "13px",
94113
"--shadow-box-tag-when-hovered": "0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24)",
95114
"--big-button-height": "32px",
96115
"--small-button-height": "24px",

0 commit comments

Comments
 (0)