orcs-design-system 3.2.4 → 3.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/es/GlobalStyles.js +1 -31
  2. package/es/SystemThemeProvider.js +11 -5
  3. package/es/assets/Colour/Colour.stories.js +211 -0
  4. package/es/assets/Colour/index.js +3 -3
  5. package/es/components/ActionsMenu/ActionsMenu.stories.js +260 -233
  6. package/es/components/ActionsMenu/index.js +144 -229
  7. package/es/components/Avatar/Avatar.stories.js +212 -196
  8. package/es/components/Avatar/index.js +280 -307
  9. package/es/components/Badge/Badge.stories.js +71 -46
  10. package/es/components/Badge/index.js +71 -74
  11. package/es/components/Box/Box.stories.js +51 -35
  12. package/es/components/Box/index.js +33 -34
  13. package/es/components/Button/Button.stories.js +161 -145
  14. package/es/components/Button/ButtonLink.stories.js +152 -139
  15. package/es/components/Button/index.js +79 -99
  16. package/es/components/ButtonGroup/ButtonGroup.stories.js +43 -42
  17. package/es/components/ButtonGroup/ButtonGroupItem.stories.js +11 -13
  18. package/es/components/ButtonGroup/index.js +103 -99
  19. package/es/components/Card/Card.stories.js +94 -62
  20. package/es/components/Card/index.js +50 -71
  21. package/es/components/Checkbox/Checkbox.stories.js +37 -43
  22. package/es/components/Checkbox/index.js +61 -76
  23. package/es/components/DatePicker/DatePicker.stories.js +86 -118
  24. package/es/components/DatePicker/index.js +71 -187
  25. package/es/components/Divider/Divider.stories.js +39 -42
  26. package/es/components/Divider/index.js +21 -27
  27. package/es/components/Expandable/Expandable.stories.js +46 -36
  28. package/es/components/Expandable/index.js +55 -82
  29. package/es/components/Flex/Flex.stories.js +19 -5
  30. package/es/components/Flex/FlexItem.stories.js +10 -9
  31. package/es/components/Flex/index.js +34 -27
  32. package/es/components/Grid/Grid.stories.js +129 -55
  33. package/es/components/Grid/index.js +25 -24
  34. package/es/components/Header/Header.stories.js +101 -92
  35. package/es/components/Header/index.js +433 -436
  36. package/es/components/HeaderSimple/HeaderSimple.stories.js +23 -27
  37. package/es/components/HeaderSimple/index.js +73 -68
  38. package/es/components/Icon/Icon.stories.js +58 -57
  39. package/es/components/Icon/index.js +48 -46
  40. package/es/components/Loading/Loading.stories.js +32 -39
  41. package/es/components/Loading/index.js +44 -51
  42. package/es/components/Modal/Modal.stories.js +172 -153
  43. package/es/components/Modal/index.js +126 -134
  44. package/es/components/Notification/Notification.stories.js +59 -58
  45. package/es/components/Notification/index.js +123 -133
  46. package/es/components/Popover/Popover.stories.js +134 -102
  47. package/es/components/Popover/index.js +65 -111
  48. package/es/components/ProgressBar/ProgressBar.stories.js +36 -39
  49. package/es/components/ProgressBar/index.js +29 -34
  50. package/es/components/RadioButton/RadioButton.stories.js +32 -37
  51. package/es/components/RadioButton/index.js +170 -184
  52. package/es/components/Range/Range.stories.js +19 -19
  53. package/es/components/Range/index.js +35 -45
  54. package/es/components/Select/Select.stories.js +107 -128
  55. package/es/components/Select/index.js +324 -336
  56. package/es/components/SideNav/NavItem.js +112 -122
  57. package/es/components/SideNav/SideNav.stories.js +84 -57
  58. package/es/components/SideNav/index.js +161 -185
  59. package/es/components/Sidebar/Sidebar.stories.js +50 -33
  60. package/es/components/Sidebar/index.js +152 -155
  61. package/es/components/Spacer/Spacer.stories.js +35 -32
  62. package/es/components/Spacer/index.js +20 -20
  63. package/es/components/StatusDot/StatusDot.stories.js +103 -90
  64. package/es/components/StatusDot/index.js +36 -38
  65. package/es/components/StyledLink/StyledLink.stories.js +68 -69
  66. package/es/components/StyledLink/index.js +47 -48
  67. package/es/components/Table/Table.stories.js +118 -112
  68. package/es/components/Table/getExpandColumnConfig.js +67 -62
  69. package/es/components/Table/index.js +24 -27
  70. package/es/components/Table/muiStyleOverrides.js +10 -8
  71. package/es/components/Tabs/Tab.stories.js +55 -38
  72. package/es/components/Tabs/TabsContainer.stories.js +30 -22
  73. package/es/components/Tabs/index.js +95 -92
  74. package/es/components/Tag/Tag.stories.js +250 -220
  75. package/es/components/Tag/index.js +118 -190
  76. package/es/components/TextArea/TextArea.stories.js +76 -89
  77. package/es/components/TextArea/index.js +117 -115
  78. package/es/components/TextInput/TextInput.stories.js +41 -61
  79. package/es/components/TextInput/index.js +127 -171
  80. package/es/components/Toggle/Toggle.stories.js +63 -62
  81. package/es/components/Toggle/index.js +43 -77
  82. package/es/components/TreeNav/TreeNav.stories.js +7 -8
  83. package/es/components/TreeNav/index.js +72 -69
  84. package/es/components/Typography/Typography.stories.js +174 -0
  85. package/es/components/Typography/index.js +252 -308
  86. package/es/components.test.js +1 -1
  87. package/es/hooks/isVisible.js +6 -10
  88. package/es/hooks/keepInView.js +27 -32
  89. package/es/hooks/keypress.js +14 -14
  90. package/es/hooks/useInputFocus.js +5 -5
  91. package/es/hooks/usePrevious.js +3 -3
  92. package/es/systemThemeCollapsed.js +53 -53
  93. package/es/systemtheme.js +53 -53
  94. package/es/utils/selectUtil.js +1 -1
  95. package/es/utils/selectUtil.test.js +6 -6
  96. package/package.json +29 -38
@@ -1,8 +1,3 @@
1
- import _typeof from "@babel/runtime/helpers/typeof";
2
- import _extends from "@babel/runtime/helpers/extends";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
1
  import React, { forwardRef } from "react";
7
2
  import PropTypes from "prop-types";
8
3
  import styled, { ThemeProvider, useTheme } from "styled-components";
@@ -15,53 +10,52 @@ import shouldForwardProp from "@styled-system/should-forward-prop";
15
10
  import { themeGet } from "@styled-system/theme-get";
16
11
  import { Small } from "../Typography";
17
12
  import useInputFocus from "../../hooks/useInputFocus";
18
- var SelectStyles = compose(space, layout);
19
- var Wrapper = styled("div").withConfig({
20
- shouldForwardProp: shouldForwardProp,
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ const SelectStyles = compose(space, layout);
15
+ const Wrapper = styled("div").withConfig({
16
+ shouldForwardProp,
21
17
  displayName: "Select__Wrapper",
22
18
  componentId: "sc-bfi43f-0"
23
- }).attrs(function (props) {
24
- return {
25
- "data-testid": props["data-testid"] ? props["data-testid"] : null
26
- };
27
- })(css({
19
+ }).attrs(props => ({
20
+ "data-testid": props["data-testid"] ? props["data-testid"] : null
21
+ }))(css({
28
22
  display: "inline-block",
29
23
  width: "100%"
30
24
  }), SelectStyles);
31
- var Label = styled("label").withConfig({
32
- shouldForwardProp: shouldForwardProp,
25
+ const Label = styled("label").withConfig({
26
+ shouldForwardProp,
33
27
  displayName: "Select__Label",
34
28
  componentId: "sc-bfi43f-1"
35
- }).attrs(function (props) {
36
- return {
37
- "for": props.id
38
- };
39
- })(function (props) {
40
- return css({
41
- display: "block",
42
- color: props.inverted ? themeGet("colors.white")(props) : props.invalid ? themeGet("colors.dangerDark")(props) : themeGet("colors.greyDarkest")(props),
43
- fontSize: themeGet("fontSizes.1")(props),
44
- fontWeight: props.bold ? themeGet("fontWeights.2")(props) : themeGet("fontWeights.1")(props),
45
- mb: "xs"
46
- });
47
- });
48
- var MultiValueRemove = function MultiValueRemove(props) {
49
- var innerProps = props.innerProps,
50
- data = props.data;
51
- return /*#__PURE__*/React.createElement(components.MultiValueRemove, _objectSpread(_objectSpread({}, props), {}, {
52
- innerProps: _objectSpread(_objectSpread({}, innerProps), {}, {
29
+ }).attrs(props => ({
30
+ for: props.id
31
+ }))(props => css({
32
+ display: "block",
33
+ color: props.inverted ? themeGet("colors.white")(props) : props.invalid ? themeGet("colors.dangerDark")(props) : themeGet("colors.greyDarkest")(props),
34
+ fontSize: themeGet("fontSizes.1")(props),
35
+ fontWeight: props.bold ? themeGet("fontWeights.2")(props) : themeGet("fontWeights.1")(props),
36
+ mb: "xs"
37
+ }));
38
+ const MultiValueRemove = props => {
39
+ const {
40
+ innerProps,
41
+ data
42
+ } = props;
43
+ return /*#__PURE__*/_jsx(components.MultiValueRemove, {
44
+ ...props,
45
+ innerProps: {
46
+ ...innerProps,
53
47
  "aria-label": "Remove ".concat(data.label)
54
- })
55
- }));
48
+ }
49
+ });
56
50
  };
57
51
  MultiValueRemove.propTypes = {
58
52
  data: PropTypes.object,
59
53
  innerProps: PropTypes.object
60
54
  };
61
- var SELECT_TYPES = {
55
+ const SELECT_TYPES = {
62
56
  creatable: CreatableSelect,
63
57
  async: AsyncSelect,
64
- "default": ReactSelect
58
+ default: ReactSelect
65
59
  };
66
60
 
67
61
  /**
@@ -80,326 +74,320 @@ var SELECT_TYPES = {
80
74
  * For a full list of the changes, see <https://react-select.com/upgrade-guide>.
81
75
  *
82
76
  */
83
- var Select = /*#__PURE__*/forwardRef(function (props, ref) {
77
+ const Select = /*#__PURE__*/forwardRef((props, ref) => {
84
78
  var _SELECT_TYPES$props$s;
85
- var theme = useTheme();
86
- var inputRef = useInputFocus(ref, props.focus);
87
- var _props$updateStyles = props.updateStyles,
88
- updateStyles = _props$updateStyles === void 0 ? function (s) {
89
- return s;
90
- } : _props$updateStyles;
91
- var customStyles = updateStyles({
92
- menu: function menu(provided, state) {
93
- return _objectSpread(_objectSpread({}, provided), {}, {
94
- opacity: state.isDisabled ? 0.7 : 1,
95
- backgroundColor: props.inverted ? themeGet("colors.greyDarker")({
96
- theme: theme
97
- }) : themeGet("colors.white")({
98
- theme: theme
99
- }),
100
- color: props.inverted ? themeGet("colors.greyLighter") : themeGet("colors.greyDarkest")({
101
- theme: theme
102
- }),
103
- fontSize: themeGet("fontSizes.1")({
104
- theme: theme
105
- }),
106
- border: props.inverted ? themeGet("borderWidths.1")({
107
- theme: theme
108
- }) + " solid " + themeGet("colors.primaryLight")({
109
- theme: theme
110
- }) : themeGet("borderWidths.1")({
111
- theme: theme
112
- }) + " solid " + themeGet("colors.primary")({
113
- theme: theme
114
- }),
115
- borderRadius: themeGet("radii.2")({
116
- theme: theme
117
- }),
118
- marginBottom: "0",
119
- marginTop: themeGet("space.xs")({
120
- theme: theme
121
- }),
122
- overflow: "hidden",
123
- zIndex: 12
124
- });
125
- },
126
- menuList: function menuList(provided) {
127
- return _objectSpread(_objectSpread({}, provided), {}, {
128
- paddingTop: "0",
129
- overflow: "auto",
130
- color: props.inverted ? themeGet("colors.greyLightest")({
131
- theme: theme
132
- }) : themeGet("colors.greyDarkest")({
133
- theme: theme
79
+ const theme = useTheme();
80
+ const inputRef = useInputFocus(ref, props.focus);
81
+ const {
82
+ updateStyles = s => s
83
+ } = props;
84
+ const customStyles = updateStyles({
85
+ menu: (provided, state) => ({
86
+ ...provided,
87
+ opacity: state.isDisabled ? 0.7 : 1,
88
+ backgroundColor: props.inverted ? themeGet("colors.greyDarker")({
89
+ theme
90
+ }) : themeGet("colors.white")({
91
+ theme
92
+ }),
93
+ color: props.inverted ? themeGet("colors.greyLighter") : themeGet("colors.greyDarkest")({
94
+ theme
95
+ }),
96
+ fontSize: themeGet("fontSizes.1")({
97
+ theme
98
+ }),
99
+ border: props.inverted ? themeGet("borderWidths.1")({
100
+ theme
101
+ }) + " solid " + themeGet("colors.primaryLight")({
102
+ theme
103
+ }) : themeGet("borderWidths.1")({
104
+ theme
105
+ }) + " solid " + themeGet("colors.primary")({
106
+ theme
107
+ }),
108
+ borderRadius: themeGet("radii.2")({
109
+ theme
110
+ }),
111
+ marginBottom: "0",
112
+ marginTop: themeGet("space.xs")({
113
+ theme
114
+ }),
115
+ overflow: "hidden",
116
+ zIndex: 12
117
+ }),
118
+ menuList: provided => ({
119
+ ...provided,
120
+ paddingTop: "0",
121
+ overflow: "auto",
122
+ color: props.inverted ? themeGet("colors.greyLightest")({
123
+ theme
124
+ }) : themeGet("colors.greyDarkest")({
125
+ theme
126
+ })
127
+ }),
128
+ control: (provided, state) => ({
129
+ ...provided,
130
+ minHeight: props.height ? props.height : themeGet("appScale.inputHeightDefault")({
131
+ theme
132
+ }),
133
+ boxShadow: "none",
134
+ opacity: state.isDisabled ? 0.7 : 1,
135
+ "&:hover": {
136
+ borderColor: props.invalid ? themeGet("colors.danger")({
137
+ theme
138
+ }) : themeGet("colors.primary")({
139
+ theme
134
140
  })
135
- });
136
- },
137
- control: function control(provided, state) {
138
- return _objectSpread(_objectSpread({}, provided), {}, {
139
- minHeight: props.height ? props.height : themeGet("appScale.inputHeightDefault")({
140
- theme: theme
141
- }),
142
- boxShadow: "none",
143
- opacity: state.isDisabled ? 0.7 : 1,
144
- "&:hover": {
145
- borderColor: props.invalid ? themeGet("colors.danger")({
146
- theme: theme
147
- }) : themeGet("colors.primary")({
148
- theme: theme
149
- })
150
- },
151
- "&:focus-within": {
152
- outline: "0",
153
- borderColor: props.invalid ? themeGet("colors.danger")({
154
- theme: theme
155
- }) : themeGet("colors.primary")({
156
- theme: theme
157
- }),
158
- boxShadow: props.invalid ? themeGet("shadows.thickOutline")({
159
- theme: theme
160
- }) + " " + themeGet("colors.danger30")({
161
- theme: theme
162
- }) : themeGet("shadows.thickOutline")({
163
- theme: theme
164
- }) + " " + themeGet("colors.primary30")({
165
- theme: theme
166
- })
167
- },
168
- borderColor: state.isFocused ? themeGet("colors.primary")({
169
- theme: theme
170
- }) : props.inverted ? themeGet("colors.white30")({
171
- theme: theme
172
- }) : themeGet("colors.black30")({
173
- theme: theme
174
- }),
175
- backgroundColor: props.inverted ? themeGet("colors.greyDarker")({
176
- theme: theme
177
- }) : themeGet("colors.white")({
178
- theme: theme
179
- }),
180
- color: props.inverted ? themeGet("colors.greyLighter")({
181
- theme: theme
182
- }) : themeGet("colors.greyDarkest")({
183
- theme: theme
184
- }),
185
- borderRadius: themeGet("radii.2")({
186
- theme: theme
187
- }),
188
- fontSize: themeGet("fontSizes.1")({
189
- theme: theme
190
- }),
191
- overflow: "hidden",
192
- border: "1px solid ".concat(props.invalid ? themeGet("colors.danger")({
193
- theme: theme
194
- }) : themeGet("colors.black30")({
195
- theme: theme
196
- }))
197
- });
198
- },
199
- container: function container(provided, state) {
200
- return _objectSpread(_objectSpread({}, provided), {}, {
201
- opacity: state.isDisabled ? 0.7 : 1,
202
- color: props.inverted ? themeGet("colors.greyLighter")({
203
- theme: theme
204
- }) : themeGet("colors.grey")({
205
- theme: theme
141
+ },
142
+ "&:focus-within": {
143
+ outline: "0",
144
+ borderColor: props.invalid ? themeGet("colors.danger")({
145
+ theme
146
+ }) : themeGet("colors.primary")({
147
+ theme
206
148
  }),
207
- fontSize: themeGet("fontSizes.1")({
208
- theme: theme
149
+ boxShadow: props.invalid ? themeGet("shadows.thickOutline")({
150
+ theme
151
+ }) + " " + themeGet("colors.danger30")({
152
+ theme
153
+ }) : themeGet("shadows.thickOutline")({
154
+ theme
155
+ }) + " " + themeGet("colors.primary30")({
156
+ theme
209
157
  })
210
- });
211
- },
212
- valueContainer: function valueContainer(provided) {
213
- return _objectSpread(_objectSpread({}, provided), {}, {
214
- padding: props.padding ? props.padding : "2px 4px",
215
- overflow: "visible"
216
- });
217
- },
218
- clearIndicator: function clearIndicator(provided, state) {
219
- return _objectSpread(_objectSpread({}, provided), {}, {
220
- opacity: state.isDisabled ? 0.7 : 1,
221
- padding: themeGet("space.xxs")({
222
- theme: theme
223
- }),
224
- color: !state.isFocused && !props.inverted ? themeGet("colors.greyDark")({
225
- theme: theme
226
- }) : state.isFocused && !props.inverted ? themeGet("colors.primary")({
227
- theme: theme
228
- }) : !state.isFocused && props.inverted ? themeGet("colors.white")({
229
- theme: theme
230
- }) : themeGet("colors.primaryLight")({
231
- theme: theme
232
- }),
233
- "&:hover": {
234
- color: themeGet("colors.danger")({
235
- theme: theme
236
- })
237
- }
238
- });
239
- },
240
- dropdownIndicator: function dropdownIndicator(provided, state) {
241
- return _objectSpread(_objectSpread({}, provided), {}, {
242
- opacity: state.isDisabled ? 0.7 : 1,
243
- padding: themeGet("space.xxs")({
244
- theme: theme
245
- }),
246
- color: !state.isFocused && !props.inverted ? themeGet("colors.greyDark")({
247
- theme: theme
248
- }) : state.isFocused && !props.inverted ? themeGet("colors.primary")({
249
- theme: theme
250
- }) : !state.isFocused && props.inverted ? themeGet("colors.white")({
251
- theme: theme
252
- }) : themeGet("colors.primaryLight")({
253
- theme: theme
254
- }),
255
- "&:hover": {
256
- color: !state.isFocused && !props.inverted ? themeGet("colors.primary")({
257
- theme: theme
258
- }) : state.isFocused && !props.inverted ? themeGet("colors.primaryDarkest")({
259
- theme: theme
260
- }) : !state.isFocused && props.inverted ? themeGet("colors.primary")({
261
- theme: theme
262
- }) : themeGet("colors.white")({
263
- theme: theme
264
- })
265
- }
266
- });
267
- },
268
- groupHeading: function groupHeading(provided) {
269
- return _objectSpread(_objectSpread({}, provided), {}, {
270
- textTransform: "none",
271
- fontSize: themeGet("fontSizes.0")({
272
- theme: theme
273
- }),
274
- color: themeGet("colors.greyDark")({
275
- theme: theme
158
+ },
159
+ borderColor: state.isFocused ? themeGet("colors.primary")({
160
+ theme
161
+ }) : props.inverted ? themeGet("colors.white30")({
162
+ theme
163
+ }) : themeGet("colors.black30")({
164
+ theme
165
+ }),
166
+ backgroundColor: props.inverted ? themeGet("colors.greyDarker")({
167
+ theme
168
+ }) : themeGet("colors.white")({
169
+ theme
170
+ }),
171
+ color: props.inverted ? themeGet("colors.greyLighter")({
172
+ theme
173
+ }) : themeGet("colors.greyDarkest")({
174
+ theme
175
+ }),
176
+ borderRadius: themeGet("radii.2")({
177
+ theme
178
+ }),
179
+ fontSize: themeGet("fontSizes.1")({
180
+ theme
181
+ }),
182
+ overflow: "hidden",
183
+ border: "1px solid ".concat(props.invalid ? themeGet("colors.danger")({
184
+ theme
185
+ }) : themeGet("colors.black30")({
186
+ theme
187
+ }))
188
+ }),
189
+ container: (provided, state) => ({
190
+ ...provided,
191
+ opacity: state.isDisabled ? 0.7 : 1,
192
+ color: props.inverted ? themeGet("colors.greyLighter")({
193
+ theme
194
+ }) : themeGet("colors.grey")({
195
+ theme
196
+ }),
197
+ fontSize: themeGet("fontSizes.1")({
198
+ theme
199
+ })
200
+ }),
201
+ valueContainer: provided => ({
202
+ ...provided,
203
+ padding: props.padding ? props.padding : "2px 4px",
204
+ overflow: "visible"
205
+ }),
206
+ clearIndicator: (provided, state) => ({
207
+ ...provided,
208
+ opacity: state.isDisabled ? 0.7 : 1,
209
+ padding: themeGet("space.xxs")({
210
+ theme
211
+ }),
212
+ color: !state.isFocused && !props.inverted ? themeGet("colors.greyDark")({
213
+ theme
214
+ }) : state.isFocused && !props.inverted ? themeGet("colors.primary")({
215
+ theme
216
+ }) : !state.isFocused && props.inverted ? themeGet("colors.white")({
217
+ theme
218
+ }) : themeGet("colors.primaryLight")({
219
+ theme
220
+ }),
221
+ "&:hover": {
222
+ color: themeGet("colors.danger")({
223
+ theme
276
224
  })
277
- });
278
- },
279
- multiValue: function multiValue(provided, state) {
280
- return _objectSpread(_objectSpread({}, provided), {}, {
281
- opacity: state.isDisabled ? 0.7 : 1,
282
- backgroundColor: "transparent",
283
- color: themeGet("colors.white")({
284
- theme: theme
285
- }),
286
- alignItems: "center",
287
- padding: "0 !important",
288
- fontSize: themeGet("fontSizes.1")({
289
- theme: theme
290
- }),
291
- wordWrap: "break-word"
292
- });
293
- },
294
- multiValueLabel: function multiValueLabel(provided, state) {
295
- return _objectSpread(_objectSpread({}, provided), {}, {
296
- backgroundColor: themeGet("colors.primary")({
297
- theme: theme
298
- }),
299
- color: themeGet("colors.white")({
300
- theme: theme
301
- }),
302
- padding: state.data.isFixed ? "4px 10px 5px 10px !important" : "4px 8px 5px 10px !important",
303
- fontSize: "1.3rem",
304
- fontWeight: themeGet("fontWeights.2")({
305
- theme: theme
306
- }),
307
- wordWrap: "break-word",
308
- whiteSpace: "break-spaces",
309
- borderRadius: state.data.isFixed ? "15px" : "15px 0 0 15px"
310
- });
311
- },
312
- multiValueRemove: function multiValueRemove(provided, state) {
313
- return _objectSpread(_objectSpread({}, provided), {}, {
225
+ }
226
+ }),
227
+ dropdownIndicator: (provided, state) => ({
228
+ ...provided,
229
+ opacity: state.isDisabled ? 0.7 : 1,
230
+ padding: themeGet("space.xxs")({
231
+ theme
232
+ }),
233
+ color: !state.isFocused && !props.inverted ? themeGet("colors.greyDark")({
234
+ theme
235
+ }) : state.isFocused && !props.inverted ? themeGet("colors.primary")({
236
+ theme
237
+ }) : !state.isFocused && props.inverted ? themeGet("colors.white")({
238
+ theme
239
+ }) : themeGet("colors.primaryLight")({
240
+ theme
241
+ }),
242
+ "&:hover": {
243
+ color: !state.isFocused && !props.inverted ? themeGet("colors.primary")({
244
+ theme
245
+ }) : state.isFocused && !props.inverted ? themeGet("colors.primaryDarkest")({
246
+ theme
247
+ }) : !state.isFocused && props.inverted ? themeGet("colors.primary")({
248
+ theme
249
+ }) : themeGet("colors.white")({
250
+ theme
251
+ })
252
+ }
253
+ }),
254
+ groupHeading: provided => ({
255
+ ...provided,
256
+ textTransform: "none",
257
+ fontSize: themeGet("fontSizes.0")({
258
+ theme
259
+ }),
260
+ color: themeGet("colors.greyDark")({
261
+ theme
262
+ })
263
+ }),
264
+ multiValue: (provided, state) => ({
265
+ ...provided,
266
+ opacity: state.isDisabled ? 0.7 : 1,
267
+ backgroundColor: "transparent",
268
+ color: themeGet("colors.white")({
269
+ theme
270
+ }),
271
+ alignItems: "center",
272
+ padding: "0 !important",
273
+ fontSize: themeGet("fontSizes.1")({
274
+ theme
275
+ }),
276
+ wordWrap: "break-word"
277
+ }),
278
+ multiValueLabel: (provided, state) => ({
279
+ ...provided,
280
+ backgroundColor: themeGet("colors.primary")({
281
+ theme
282
+ }),
283
+ color: themeGet("colors.white")({
284
+ theme
285
+ }),
286
+ padding: state.data.isFixed ? "4px 10px 5px 10px !important" : "4px 8px 5px 10px !important",
287
+ fontSize: "1.3rem",
288
+ fontWeight: themeGet("fontWeights.2")({
289
+ theme
290
+ }),
291
+ wordWrap: "break-word",
292
+ whiteSpace: "break-spaces",
293
+ borderRadius: state.data.isFixed ? "15px" : "15px 0 0 15px"
294
+ }),
295
+ multiValueRemove: (provided, state) => {
296
+ return {
297
+ ...provided,
314
298
  backgroundColor: themeGet("colors.primary")({
315
- theme: theme
299
+ theme
316
300
  }),
317
301
  color: themeGet("colors.white")({
318
- theme: theme
302
+ theme
319
303
  }),
320
304
  borderLeft: "solid 1px ".concat(themeGet("colors.primaryDark")({
321
- theme: theme
305
+ theme
322
306
  })),
323
307
  padding: "6.5px 6px 6.5px 5px",
324
308
  display: state.data.isFixed ? "none" : provided.display,
325
309
  cursor: "pointer",
326
310
  borderRadius: "0 15px 15px 0",
327
311
  transition: themeGet("transition.transitionDefault")({
328
- theme: theme
312
+ theme
329
313
  }),
330
314
  "&:hover": {
331
315
  backgroundColor: themeGet("colors.primaryDark")({
332
- theme: theme
316
+ theme
333
317
  }),
334
318
  color: themeGet("colors.white")({
335
- theme: theme
319
+ theme
336
320
  })
337
321
  }
338
- });
339
- },
340
- option: function option(provided, state) {
341
- return _objectSpread(_objectSpread({}, provided), {}, {
342
- opacity: state.isDisabled ? 0.7 : 1,
343
- backgroundColor: !state.isFocused && !props.inverted ? themeGet("colors.white")({
344
- theme: theme
345
- }) : state.isFocused && !props.inverted ? themeGet("colors.primaryLightest")({
346
- theme: theme
347
- }) : !state.isFocused && props.inverted ? themeGet("colors.greyDarker")({
348
- theme: theme
349
- }) : themeGet("colors.primaryDark")({
350
- theme: theme
351
- }),
352
- fontSize: themeGet("fontSizes.1")({
353
- theme: theme
354
- }),
355
- whiteSpace: "break-spaces"
356
- });
357
- },
358
- placeholder: function placeholder(provided, state) {
359
- return _objectSpread(_objectSpread({}, provided), {}, {
360
- opacity: state.isDisabled ? 0.7 : 1,
361
- color: props.inverted ? themeGet("colors.greyLightest")({
362
- theme: theme
363
- }) : themeGet("colors.greyDarkest")({
364
- theme: theme
365
- }),
366
- fontSize: themeGet("fontSizes.1")({
367
- theme: theme
368
- })
369
- });
370
- }
322
+ };
323
+ },
324
+ option: (provided, state) => ({
325
+ ...provided,
326
+ opacity: state.isDisabled ? 0.7 : 1,
327
+ backgroundColor: !state.isFocused && !props.inverted ? themeGet("colors.white")({
328
+ theme
329
+ }) : state.isFocused && !props.inverted ? themeGet("colors.primaryLightest")({
330
+ theme
331
+ }) : !state.isFocused && props.inverted ? themeGet("colors.greyDarker")({
332
+ theme
333
+ }) : themeGet("colors.primaryDark")({
334
+ theme
335
+ }),
336
+ fontSize: themeGet("fontSizes.1")({
337
+ theme
338
+ }),
339
+ whiteSpace: "break-spaces"
340
+ }),
341
+ placeholder: (provided, state) => ({
342
+ ...provided,
343
+ opacity: state.isDisabled ? 0.7 : 1,
344
+ color: props.inverted ? themeGet("colors.greyLightest")({
345
+ theme
346
+ }) : themeGet("colors.greyDarkest")({
347
+ theme
348
+ }),
349
+ fontSize: themeGet("fontSizes.1")({
350
+ theme
351
+ })
352
+ })
371
353
  });
372
- var components = _objectSpread({
373
- MultiValueRemove: MultiValueRemove
374
- }, (props === null || props === void 0 ? void 0 : props.components) || {});
375
- var SelectComponent = (_SELECT_TYPES$props$s = SELECT_TYPES[props === null || props === void 0 ? void 0 : props.selectType]) !== null && _SELECT_TYPES$props$s !== void 0 ? _SELECT_TYPES$props$s : SELECT_TYPES["default"];
376
- var component = /*#__PURE__*/React.createElement(Wrapper, _extends({
377
- inverted: props.inverted,
378
- "data-testid": props["data-testid"]
379
- }, SelectStyles), props.label && /*#__PURE__*/React.createElement(Label, {
380
- inverted: props.inverted,
381
- bold: props.bold,
382
- htmlFor: props.inputId,
383
- invalid: props.invalid
384
- }, props.label, props.mandatory && /*#__PURE__*/React.createElement(Small, {
385
- color: "danger",
386
- ml: "xs"
387
- }, "*")), /*#__PURE__*/React.createElement(SelectComponent, _extends({
388
- ref: inputRef,
389
- styles: customStyles,
390
- theme: theme,
391
- inputId: props.inputId,
354
+ const components = {
355
+ MultiValueRemove,
356
+ ...((props === null || props === void 0 ? void 0 : props.components) || {})
357
+ };
358
+ const SelectComponent = (_SELECT_TYPES$props$s = SELECT_TYPES[props === null || props === void 0 ? void 0 : props.selectType]) !== null && _SELECT_TYPES$props$s !== void 0 ? _SELECT_TYPES$props$s : SELECT_TYPES.default;
359
+ const component = /*#__PURE__*/_jsxs(Wrapper, {
392
360
  inverted: props.inverted,
393
- isMulti: props.isMulti,
394
- classNamePrefix: props.classNamePrefix,
395
- onChange: props.onChange,
396
- "aria-label": props.ariaLabel
397
- }, props, {
398
- components: components
399
- })));
400
- return props.theme ? /*#__PURE__*/React.createElement(ThemeProvider, {
401
- theme: props.theme
402
- }, component) : component;
361
+ "data-testid": props["data-testid"],
362
+ ...SelectStyles,
363
+ children: [props.label && /*#__PURE__*/_jsxs(Label, {
364
+ inverted: props.inverted,
365
+ bold: props.bold,
366
+ htmlFor: props.inputId,
367
+ invalid: props.invalid,
368
+ children: [props.label, props.mandatory && /*#__PURE__*/_jsx(Small, {
369
+ color: "danger",
370
+ ml: "xs",
371
+ children: "*"
372
+ })]
373
+ }), /*#__PURE__*/_jsx(SelectComponent, {
374
+ ref: inputRef,
375
+ styles: customStyles,
376
+ theme: theme,
377
+ inputId: props.inputId,
378
+ inverted: props.inverted,
379
+ isMulti: props.isMulti,
380
+ classNamePrefix: props.classNamePrefix,
381
+ onChange: props.onChange,
382
+ "aria-label": props.ariaLabel,
383
+ ...props,
384
+ components: components
385
+ })]
386
+ });
387
+ return props.theme ? /*#__PURE__*/_jsx(ThemeProvider, {
388
+ theme: props.theme,
389
+ children: component
390
+ }) : component;
403
391
  });
404
392
  Select.propTypes = {
405
393
  /** Points to options object, see example code above */
@@ -407,12 +395,12 @@ Select.propTypes = {
407
395
  /** Specifies the label for the `Select` */
408
396
  label: PropTypes.string,
409
397
  // ariaLabel prop must be specified if label is not provided
410
- ariaLabel: function ariaLabel(props, propName) {
398
+ ariaLabel: (props, propName) => {
411
399
  if (!props.label && (props[propName] == null || props[propName] === "")) {
412
400
  return new Error("Missing prop `".concat(propName, "` not specified for Select component. When `label` is not provided, `").concat(propName, "` is required."));
413
401
  }
414
402
  if (props[propName] && typeof props[propName] !== "string") {
415
- return new Error("Invalid propType `".concat(propName, "` supplied to Select component. Expected `string`, received `").concat(_typeof(props[propName]), "`."));
403
+ return new Error("Invalid propType `".concat(propName, "` supplied to Select component. Expected `string`, received `").concat(typeof props[propName], "`."));
416
404
  }
417
405
  return null;
418
406
  },
@@ -421,12 +409,12 @@ Select.propTypes = {
421
409
  /** Makes select disabled */
422
410
  isDisabled: PropTypes.bool,
423
411
  /** Specifies the ID for the rendered Select box. If you use the label prop label will automatically point to this ID, so this is required. */
424
- inputId: function inputId(props, propName) {
412
+ inputId: (props, propName) => {
425
413
  if (props.label && (props[propName] == null || props[propName] === "")) {
426
414
  return new Error("Missing prop `".concat(propName, "` not specified for Select component. When `label` is provided, `").concat(propName, "` is required."));
427
415
  }
428
416
  if (props[propName] && typeof props[propName] !== "string") {
429
- return new Error("Invalid propType `".concat(propName, "` supplied to Select component. Expected `string`, received `").concat(_typeof(props[propName]), "`."));
417
+ return new Error("Invalid propType `".concat(propName, "` supplied to Select component. Expected `string`, received `").concat(typeof props[propName], "`."));
430
418
  }
431
419
  return null;
432
420
  },