Skip to content

Commit c6e4ab3

Browse files
authored
UIDS 18 react select wrappers (#19)
UIDS-18 Add a wrapper to the ReactSelect and colors This adds a wrapper to the Async component from React Select. This adds React Select as a dependency of this library as well as brings over some styling we had on it from the main repo. Also add a SingleSelect component to hold logic for that style of component. This is largely meant to help us standardize styles for these components which use CSS in JS. In adding input colors separated out the color palette from other semantic color variables. This led to moving the palette to be colors in js and scss and added separate files for the palette (which defines the base colors we should use) as well as other files for input colors which are joined in a common color output. Additionally brought some ESLint rules to the top level instead of just living in src.
1 parent 9e605a8 commit c6e4ab3

File tree

22 files changed

+978
-23
lines changed

22 files changed

+978
-23
lines changed

.eslintrc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@
2222
"babel/semi": 2,
2323
"import/prefer-default-export": 0,
2424
"jsx-a11y/anchor-is-valid": 1,
25-
"jsx-a11y/label-has-associated-control": [ 2, {
26-
"assert": "either",
27-
"controlComponents": [],
28-
"depth": 25,
29-
"labelAttributes": ["label"],
30-
"labelComponents": []
31-
}],
3225
"jsx-a11y/label-has-for": 0,
3326
"no-alert": 0,
3427
"react/destructuring-assignment": 0,
@@ -118,6 +111,13 @@
118111
"function-paren-newline": ["error", "consistent"],
119112
"func-names": ["error", "never"],
120113
"implicit-arrow-linebreak": 0,
114+
"jsx-a11y/label-has-associated-control": [ 2, {
115+
"assert": "either",
116+
"controlComponents": ["AsyncSelect", "SingleSelect"],
117+
"depth": 25,
118+
"labelAttributes": ["label"],
119+
"labelComponents": []
120+
}],
121121
"linebreak-style": 0,
122122
"no-case-declarations": "warn",
123123
"no-confusing-arrow": 0,
@@ -131,6 +131,7 @@
131131
"prefer-destructuring": "warn",
132132
"quotes": ["error", "single", { "allowTemplateLiterals" : true }],
133133
"radix": 0,
134+
"react/jsx-fragments": 0,
134135
"symbol-description": 0,
135136
"template-curly-spacing": "off",
136137
"indent": "off"

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"react-transition-group": "^4.3.0",
1616
"react-copy-to-clipboard": "^5.0.2",
1717
"react-popper": "^1.3.7",
18+
"react-select": "^3.0.8",
1819
"react-tracking": "^7.3.0",
1920
"uuid": "^7.0.2"
2021
},

scss/buttons.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import './palette';
1+
@import './colors';
22

33
.btn-link--neutral {
44
color: $ux-gray-500;

scss/colors.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@import './colors/inputs';
2+
@import './colors/palette';

scss/colors/inputs.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@import './palette';
2+
3+
$input-border-color: $ux-gray-400; // Override bootstrap default
4+
$input-disabled-bg: $ux-gray-300; // Override bootstrap default

scss/palette.scss renamed to scss/colors/palette.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// When updating this file, please consider the values in src/Styles/palette.js
22

33
$ux-black: #000000;
4-
$ux-blue: #337ab7;
4+
$ux-blue: #337AB7;
55
$ux-gray: #A1A1A1;
66
$ux-green: #6DBD63;
77
$ux-light-blue: #7CCBF2;

scss/theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@import './box_shadow';
22
@import './buttons';
3+
@import './colors';
34
@import './lists';
45
@import './navbar';
5-
@import './palette';
66
@import './typography';
77
@import './z_stack';

0 commit comments

Comments
 (0)