@dxc-technology/halstack-react 0.0.0-eb9d984 → 0.0.0-ebe476f

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 (320) hide show
  1. package/README.md +46 -0
  2. package/dist/index.d.mts +6683 -0
  3. package/dist/index.d.ts +6683 -0
  4. package/dist/index.js +1 -0
  5. package/dist/index.mjs +1 -0
  6. package/package.json +69 -70
  7. package/BackgroundColorContext.d.ts +0 -10
  8. package/BackgroundColorContext.js +0 -47
  9. package/HalstackContext.d.ts +0 -12
  10. package/HalstackContext.js +0 -295
  11. package/accordion/Accordion.d.ts +0 -4
  12. package/accordion/Accordion.js +0 -226
  13. package/accordion/Accordion.stories.tsx +0 -307
  14. package/accordion/Accordion.test.js +0 -72
  15. package/accordion/types.d.ts +0 -68
  16. package/accordion/types.js +0 -5
  17. package/accordion-group/AccordionGroup.d.ts +0 -7
  18. package/accordion-group/AccordionGroup.js +0 -169
  19. package/accordion-group/AccordionGroup.stories.tsx +0 -225
  20. package/accordion-group/AccordionGroup.test.js +0 -151
  21. package/accordion-group/types.d.ts +0 -72
  22. package/accordion-group/types.js +0 -5
  23. package/alert/Alert.d.ts +0 -4
  24. package/alert/Alert.js +0 -293
  25. package/alert/Alert.stories.tsx +0 -170
  26. package/alert/Alert.test.js +0 -92
  27. package/alert/types.d.ts +0 -49
  28. package/alert/types.js +0 -5
  29. package/badge/Badge.d.ts +0 -4
  30. package/badge/Badge.js +0 -61
  31. package/badge/types.d.ts +0 -5
  32. package/badge/types.js +0 -5
  33. package/bleed/Bleed.d.ts +0 -3
  34. package/bleed/Bleed.js +0 -51
  35. package/bleed/Bleed.stories.tsx +0 -341
  36. package/bleed/types.d.ts +0 -37
  37. package/bleed/types.js +0 -5
  38. package/box/Box.d.ts +0 -4
  39. package/box/Box.js +0 -116
  40. package/box/Box.stories.tsx +0 -132
  41. package/box/Box.test.js +0 -18
  42. package/box/types.d.ts +0 -43
  43. package/box/types.js +0 -5
  44. package/bulleted-list/BulletedList.d.ts +0 -7
  45. package/bulleted-list/BulletedList.js +0 -123
  46. package/bulleted-list/BulletedList.stories.tsx +0 -200
  47. package/bulleted-list/types.d.ts +0 -11
  48. package/bulleted-list/types.js +0 -5
  49. package/button/Button.d.ts +0 -4
  50. package/button/Button.js +0 -174
  51. package/button/Button.stories.tsx +0 -274
  52. package/button/Button.test.js +0 -35
  53. package/button/types.d.ts +0 -53
  54. package/button/types.js +0 -5
  55. package/card/Card.d.ts +0 -4
  56. package/card/Card.js +0 -161
  57. package/card/Card.stories.tsx +0 -201
  58. package/card/Card.test.js +0 -50
  59. package/card/ice-cream.jpg +0 -0
  60. package/card/types.d.ts +0 -67
  61. package/card/types.js +0 -5
  62. package/checkbox/Checkbox.d.ts +0 -4
  63. package/checkbox/Checkbox.js +0 -257
  64. package/checkbox/Checkbox.stories.tsx +0 -188
  65. package/checkbox/Checkbox.test.js +0 -78
  66. package/checkbox/types.d.ts +0 -64
  67. package/checkbox/types.js +0 -5
  68. package/chip/Chip.d.ts +0 -4
  69. package/chip/Chip.js +0 -161
  70. package/chip/Chip.stories.tsx +0 -119
  71. package/chip/Chip.test.js +0 -56
  72. package/chip/types.d.ts +0 -45
  73. package/chip/types.js +0 -5
  74. package/common/OpenSans.css +0 -81
  75. package/common/RequiredComponent.js +0 -32
  76. package/common/fonts/OpenSans-Bold.ttf +0 -0
  77. package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
  78. package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
  79. package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  80. package/common/fonts/OpenSans-Italic.ttf +0 -0
  81. package/common/fonts/OpenSans-Light.ttf +0 -0
  82. package/common/fonts/OpenSans-LightItalic.ttf +0 -0
  83. package/common/fonts/OpenSans-Regular.ttf +0 -0
  84. package/common/fonts/OpenSans-SemiBold.ttf +0 -0
  85. package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  86. package/common/utils.js +0 -22
  87. package/common/variables.js +0 -1495
  88. package/date-input/DateInput.d.ts +0 -4
  89. package/date-input/DateInput.js +0 -372
  90. package/date-input/DateInput.stories.tsx +0 -138
  91. package/date-input/DateInput.test.js +0 -479
  92. package/date-input/types.d.ts +0 -107
  93. package/date-input/types.js +0 -5
  94. package/dialog/Dialog.d.ts +0 -4
  95. package/dialog/Dialog.js +0 -138
  96. package/dialog/Dialog.stories.tsx +0 -212
  97. package/dialog/Dialog.test.js +0 -40
  98. package/dialog/types.d.ts +0 -43
  99. package/dialog/types.js +0 -5
  100. package/dropdown/Dropdown.d.ts +0 -4
  101. package/dropdown/Dropdown.js +0 -391
  102. package/dropdown/Dropdown.stories.tsx +0 -249
  103. package/dropdown/Dropdown.test.js +0 -189
  104. package/dropdown/types.d.ts +0 -80
  105. package/dropdown/types.js +0 -5
  106. package/file-input/FileInput.d.ts +0 -4
  107. package/file-input/FileInput.js +0 -593
  108. package/file-input/FileInput.stories.tsx +0 -507
  109. package/file-input/FileInput.test.js +0 -457
  110. package/file-input/FileItem.d.ts +0 -14
  111. package/file-input/FileItem.js +0 -186
  112. package/file-input/types.d.ts +0 -112
  113. package/file-input/types.js +0 -5
  114. package/flex/Flex.d.ts +0 -3
  115. package/flex/Flex.js +0 -74
  116. package/flex/Flex.stories.tsx +0 -103
  117. package/flex/types.d.ts +0 -21
  118. package/flex/types.js +0 -5
  119. package/footer/Footer.d.ts +0 -4
  120. package/footer/Footer.js +0 -185
  121. package/footer/Footer.stories.tsx +0 -130
  122. package/footer/Footer.test.js +0 -109
  123. package/footer/Icons.d.ts +0 -2
  124. package/footer/Icons.js +0 -77
  125. package/footer/types.d.ts +0 -65
  126. package/footer/types.js +0 -5
  127. package/header/Header.d.ts +0 -7
  128. package/header/Header.js +0 -303
  129. package/header/Header.stories.tsx +0 -172
  130. package/header/Header.test.js +0 -79
  131. package/header/Icons.d.ts +0 -2
  132. package/header/Icons.js +0 -34
  133. package/header/types.d.ts +0 -47
  134. package/header/types.js +0 -5
  135. package/heading/Heading.d.ts +0 -4
  136. package/heading/Heading.js +0 -159
  137. package/heading/Heading.stories.tsx +0 -54
  138. package/heading/Heading.test.js +0 -186
  139. package/heading/types.d.ts +0 -33
  140. package/heading/types.js +0 -5
  141. package/inset/Inset.d.ts +0 -3
  142. package/inset/Inset.js +0 -51
  143. package/inset/Inset.stories.tsx +0 -229
  144. package/inset/types.d.ts +0 -37
  145. package/inset/types.js +0 -5
  146. package/layout/ApplicationLayout.d.ts +0 -11
  147. package/layout/ApplicationLayout.js +0 -186
  148. package/layout/ApplicationLayout.stories.tsx +0 -130
  149. package/layout/Icons.d.ts +0 -5
  150. package/layout/Icons.js +0 -66
  151. package/layout/SidenavContext.d.ts +0 -5
  152. package/layout/SidenavContext.js +0 -19
  153. package/layout/types.d.ts +0 -44
  154. package/layout/types.js +0 -5
  155. package/link/Link.d.ts +0 -4
  156. package/link/Link.js +0 -136
  157. package/link/Link.stories.tsx +0 -186
  158. package/link/Link.test.js +0 -83
  159. package/link/types.d.ts +0 -54
  160. package/link/types.js +0 -5
  161. package/main.d.ts +0 -49
  162. package/main.js +0 -409
  163. package/number-input/NumberInput.d.ts +0 -4
  164. package/number-input/NumberInput.js +0 -76
  165. package/number-input/NumberInput.stories.tsx +0 -115
  166. package/number-input/NumberInput.test.js +0 -506
  167. package/number-input/NumberInputContext.d.ts +0 -4
  168. package/number-input/NumberInputContext.js +0 -19
  169. package/number-input/numberInputContextTypes.d.ts +0 -19
  170. package/number-input/numberInputContextTypes.js +0 -5
  171. package/number-input/types.d.ts +0 -124
  172. package/number-input/types.js +0 -5
  173. package/paginator/Icons.js +0 -66
  174. package/paginator/Paginator.d.ts +0 -4
  175. package/paginator/Paginator.js +0 -171
  176. package/paginator/Paginator.stories.tsx +0 -63
  177. package/paginator/Paginator.test.js +0 -308
  178. package/paginator/types.d.ts +0 -38
  179. package/paginator/types.js +0 -5
  180. package/paragraph/Paragraph.d.ts +0 -6
  181. package/paragraph/Paragraph.js +0 -38
  182. package/paragraph/Paragraph.stories.tsx +0 -44
  183. package/password-input/PasswordInput.d.ts +0 -4
  184. package/password-input/PasswordInput.js +0 -166
  185. package/password-input/PasswordInput.stories.tsx +0 -131
  186. package/password-input/PasswordInput.test.js +0 -180
  187. package/password-input/types.d.ts +0 -110
  188. package/password-input/types.js +0 -5
  189. package/progress-bar/ProgressBar.d.ts +0 -4
  190. package/progress-bar/ProgressBar.js +0 -170
  191. package/progress-bar/ProgressBar.stories.jsx +0 -58
  192. package/progress-bar/ProgressBar.test.js +0 -65
  193. package/progress-bar/types.d.ts +0 -37
  194. package/progress-bar/types.js +0 -5
  195. package/quick-nav/QuickNav.d.ts +0 -4
  196. package/quick-nav/QuickNav.js +0 -118
  197. package/quick-nav/QuickNav.stories.tsx +0 -264
  198. package/quick-nav/types.d.ts +0 -21
  199. package/quick-nav/types.js +0 -5
  200. package/radio-group/Radio.d.ts +0 -4
  201. package/radio-group/Radio.js +0 -141
  202. package/radio-group/RadioGroup.d.ts +0 -4
  203. package/radio-group/RadioGroup.js +0 -283
  204. package/radio-group/RadioGroup.stories.tsx +0 -100
  205. package/radio-group/RadioGroup.test.js +0 -695
  206. package/radio-group/types.d.ts +0 -114
  207. package/radio-group/types.js +0 -5
  208. package/resultsetTable/ResultsetTable.d.ts +0 -4
  209. package/resultsetTable/ResultsetTable.js +0 -254
  210. package/resultsetTable/ResultsetTable.stories.tsx +0 -275
  211. package/resultsetTable/ResultsetTable.test.js +0 -348
  212. package/resultsetTable/types.d.ts +0 -67
  213. package/resultsetTable/types.js +0 -5
  214. package/row/Row.d.ts +0 -3
  215. package/row/Row.js +0 -127
  216. package/row/Row.stories.tsx +0 -237
  217. package/row/types.d.ts +0 -28
  218. package/row/types.js +0 -5
  219. package/select/Icons.d.ts +0 -10
  220. package/select/Icons.js +0 -93
  221. package/select/Listbox.d.ts +0 -4
  222. package/select/Listbox.js +0 -175
  223. package/select/Option.d.ts +0 -4
  224. package/select/Option.js +0 -110
  225. package/select/Select.d.ts +0 -4
  226. package/select/Select.js +0 -660
  227. package/select/Select.stories.tsx +0 -626
  228. package/select/Select.test.js +0 -2162
  229. package/select/types.d.ts +0 -212
  230. package/select/types.js +0 -5
  231. package/sidenav/Sidenav.d.ts +0 -10
  232. package/sidenav/Sidenav.js +0 -256
  233. package/sidenav/Sidenav.stories.tsx +0 -180
  234. package/sidenav/Sidenav.test.js +0 -44
  235. package/sidenav/types.d.ts +0 -73
  236. package/sidenav/types.js +0 -5
  237. package/slider/Slider.d.ts +0 -4
  238. package/slider/Slider.js +0 -318
  239. package/slider/Slider.stories.tsx +0 -177
  240. package/slider/Slider.test.js +0 -150
  241. package/slider/types.d.ts +0 -82
  242. package/slider/types.js +0 -5
  243. package/spinner/Spinner.d.ts +0 -4
  244. package/spinner/Spinner.js +0 -250
  245. package/spinner/Spinner.stories.jsx +0 -103
  246. package/spinner/Spinner.test.js +0 -64
  247. package/spinner/types.d.ts +0 -32
  248. package/spinner/types.js +0 -5
  249. package/stack/Stack.d.ts +0 -4
  250. package/stack/Stack.js +0 -56
  251. package/stack/Stack.stories.tsx +0 -263
  252. package/stack/types.d.ts +0 -32
  253. package/stack/types.js +0 -5
  254. package/switch/Switch.d.ts +0 -4
  255. package/switch/Switch.js +0 -195
  256. package/switch/Switch.stories.tsx +0 -160
  257. package/switch/Switch.test.js +0 -98
  258. package/switch/types.d.ts +0 -62
  259. package/switch/types.js +0 -5
  260. package/table/Table.d.ts +0 -4
  261. package/table/Table.js +0 -118
  262. package/table/Table.stories.jsx +0 -277
  263. package/table/Table.test.js +0 -26
  264. package/table/types.d.ts +0 -21
  265. package/table/types.js +0 -5
  266. package/tabs/Tabs.d.ts +0 -4
  267. package/tabs/Tabs.js +0 -211
  268. package/tabs/Tabs.stories.tsx +0 -112
  269. package/tabs/Tabs.test.js +0 -140
  270. package/tabs/types.d.ts +0 -82
  271. package/tabs/types.js +0 -5
  272. package/tabs-nav/NavTabs.d.ts +0 -8
  273. package/tabs-nav/NavTabs.js +0 -125
  274. package/tabs-nav/NavTabs.stories.tsx +0 -170
  275. package/tabs-nav/NavTabs.test.js +0 -82
  276. package/tabs-nav/Tab.d.ts +0 -4
  277. package/tabs-nav/Tab.js +0 -132
  278. package/tabs-nav/types.d.ts +0 -53
  279. package/tabs-nav/types.js +0 -5
  280. package/tag/Tag.d.ts +0 -4
  281. package/tag/Tag.js +0 -183
  282. package/tag/Tag.stories.tsx +0 -142
  283. package/tag/Tag.test.js +0 -60
  284. package/tag/types.d.ts +0 -69
  285. package/tag/types.js +0 -5
  286. package/text-input/Suggestion.d.ts +0 -4
  287. package/text-input/Suggestion.js +0 -55
  288. package/text-input/TextInput.d.ts +0 -4
  289. package/text-input/TextInput.js +0 -770
  290. package/text-input/TextInput.stories.tsx +0 -474
  291. package/text-input/TextInput.test.js +0 -1712
  292. package/text-input/types.d.ts +0 -178
  293. package/text-input/types.js +0 -5
  294. package/textarea/Textarea.d.ts +0 -4
  295. package/textarea/Textarea.js +0 -277
  296. package/textarea/Textarea.stories.jsx +0 -157
  297. package/textarea/Textarea.test.js +0 -437
  298. package/textarea/types.d.ts +0 -137
  299. package/textarea/types.js +0 -5
  300. package/toggle-group/ToggleGroup.d.ts +0 -4
  301. package/toggle-group/ToggleGroup.js +0 -215
  302. package/toggle-group/ToggleGroup.stories.tsx +0 -173
  303. package/toggle-group/ToggleGroup.test.js +0 -156
  304. package/toggle-group/types.d.ts +0 -105
  305. package/toggle-group/types.js +0 -5
  306. package/typography/Typography.d.ts +0 -4
  307. package/typography/Typography.js +0 -131
  308. package/typography/Typography.stories.tsx +0 -198
  309. package/typography/types.d.ts +0 -18
  310. package/typography/types.js +0 -5
  311. package/useTheme.d.ts +0 -2
  312. package/useTheme.js +0 -22
  313. package/useTranslatedLabels.d.ts +0 -2
  314. package/useTranslatedLabels.js +0 -20
  315. package/wizard/Wizard.d.ts +0 -4
  316. package/wizard/Wizard.js +0 -285
  317. package/wizard/Wizard.stories.tsx +0 -233
  318. package/wizard/Wizard.test.js +0 -141
  319. package/wizard/types.d.ts +0 -65
  320. package/wizard/types.js +0 -5
package/select/Select.js DELETED
@@ -1,660 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof3 = require("@babel/runtime/helpers/typeof");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports["default"] = void 0;
11
-
12
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
13
-
14
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
-
16
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
17
-
18
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
19
-
20
- var _react = _interopRequireWildcard(require("react"));
21
-
22
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
23
-
24
- var _useTheme = _interopRequireDefault(require("../useTheme"));
25
-
26
- var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
27
-
28
- var _variables = require("../common/variables.js");
29
-
30
- var _uuid = require("uuid");
31
-
32
- var _utils = require("../common/utils.js");
33
-
34
- var _Icons = _interopRequireDefault(require("./Icons"));
35
-
36
- var _Listbox = _interopRequireDefault(require("./Listbox"));
37
-
38
- var Popover = _interopRequireWildcard(require("@radix-ui/react-popover"));
39
-
40
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17;
41
-
42
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
43
-
44
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
45
-
46
- var groupsHaveOptions = function groupsHaveOptions(innerOptions) {
47
- return innerOptions[0].hasOwnProperty("options") ? innerOptions[0].options ? innerOptions.some(function (groupOption) {
48
- return groupOption.options.length > 0;
49
- }) : false : true;
50
- };
51
-
52
- var filteredGroupsHaveOptions = function filteredGroupsHaveOptions(filteredOptions) {
53
- return filteredOptions !== null && filteredOptions !== void 0 && filteredOptions[0].options ? filteredOptions.some(function (groupOption) {
54
- var _groupOption$options;
55
-
56
- return ((_groupOption$options = groupOption.options) === null || _groupOption$options === void 0 ? void 0 : _groupOption$options.length) > 0;
57
- }) : true;
58
- };
59
-
60
- var canOpenOptions = function canOpenOptions(options, disabled) {
61
- return !disabled && (options === null || options === void 0 ? void 0 : options.length) > 0 && groupsHaveOptions(options);
62
- };
63
-
64
- var filterOptionsBySearchValue = function filterOptionsBySearchValue(options, searchValue) {
65
- if ((options === null || options === void 0 ? void 0 : options.length) > 0) {
66
- if (options[0].options) return options.map(function (optionGroup) {
67
- var group = {
68
- label: optionGroup.label,
69
- options: optionGroup.options.filter(function (option) {
70
- return option.label.toUpperCase().includes(searchValue.toUpperCase());
71
- })
72
- };
73
- return group;
74
- });else return options.filter(function (option) {
75
- return option.label.toUpperCase().includes(searchValue.toUpperCase());
76
- });
77
- }
78
- };
79
-
80
- var getLastOptionIndex = function getLastOptionIndex(options, filteredOptions, searchable, optional, multiple) {
81
- var last = 0;
82
-
83
- var reducer = function reducer(acc, current) {
84
- var _current$options;
85
-
86
- return acc + ((_current$options = current.options) === null || _current$options === void 0 ? void 0 : _current$options.length);
87
- };
88
-
89
- if (searchable && filteredOptions.length > 0) filteredOptions[0].options ? last = filteredOptions.reduce(reducer, 0) - 1 : last = filteredOptions.length - 1;else if ((options === null || options === void 0 ? void 0 : options.length) > 0) options[0].options ? last = options.reduce(reducer, 0) - 1 : last = options.length - 1;
90
- return optional && !multiple ? last + 1 : last;
91
- };
92
-
93
- var getSelectedOption = function getSelectedOption(value, options, multiple, optional, optionalItem) {
94
- var selectedOption = multiple ? [] : {};
95
- var singleSelectionIndex;
96
-
97
- if (multiple) {
98
- if ((options === null || options === void 0 ? void 0 : options.length) > 0) {
99
- options.forEach(function (option) {
100
- if (option.options) {
101
- option.options.forEach(function (singleOption) {
102
- if (value.includes(singleOption.value)) selectedOption.push(singleOption);
103
- });
104
- } else if (value.includes(option.value)) selectedOption.push(option);
105
- });
106
- }
107
- } else {
108
- if (optional && value === "") {
109
- selectedOption = optionalItem;
110
- singleSelectionIndex = 0;
111
- } else if ((options === null || options === void 0 ? void 0 : options.length) > 0) {
112
- var group_index = 0;
113
- options.some(function (option, index) {
114
- if (option.options) {
115
- option.options.some(function (singleOption) {
116
- if (singleOption.value === value) {
117
- selectedOption = singleOption;
118
- singleSelectionIndex = optional ? group_index + 1 : group_index;
119
- return true;
120
- }
121
-
122
- group_index++;
123
- });
124
- } else if (option.value === value) {
125
- selectedOption = option;
126
- singleSelectionIndex = optional ? index + 1 : index;
127
- return true;
128
- }
129
- });
130
- }
131
- }
132
-
133
- return {
134
- selectedOption: selectedOption,
135
- singleSelectionIndex: singleSelectionIndex
136
- };
137
- };
138
-
139
- var notOptionalCheck = function notOptionalCheck(value, multiple, optional) {
140
- return !optional && (multiple ? value.length === 0 : value === "");
141
- };
142
-
143
- var DxcSelect = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
144
- var _selectedOption$label;
145
-
146
- var label = _ref.label,
147
- _ref$name = _ref.name,
148
- name = _ref$name === void 0 ? "" : _ref$name,
149
- defaultValue = _ref.defaultValue,
150
- value = _ref.value,
151
- options = _ref.options,
152
- helperText = _ref.helperText,
153
- _ref$placeholder = _ref.placeholder,
154
- placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
155
- _ref$disabled = _ref.disabled,
156
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
157
- _ref$optional = _ref.optional,
158
- optional = _ref$optional === void 0 ? false : _ref$optional,
159
- _ref$searchable = _ref.searchable,
160
- searchable = _ref$searchable === void 0 ? false : _ref$searchable,
161
- _ref$multiple = _ref.multiple,
162
- multiple = _ref$multiple === void 0 ? false : _ref$multiple,
163
- onChange = _ref.onChange,
164
- onBlur = _ref.onBlur,
165
- error = _ref.error,
166
- margin = _ref.margin,
167
- _ref$size = _ref.size,
168
- size = _ref$size === void 0 ? "medium" : _ref$size,
169
- _ref$tabIndex = _ref.tabIndex,
170
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
171
-
172
- var _useState = (0, _react.useState)("select-".concat((0, _uuid.v4)())),
173
- _useState2 = (0, _slicedToArray2["default"])(_useState, 1),
174
- selectId = _useState2[0];
175
-
176
- var selectLabelId = "label-".concat(selectId);
177
- var errorId = "error-".concat(selectId);
178
- var optionsListId = "".concat(selectId, "-listbox");
179
-
180
- var _useState3 = (0, _react.useState)(defaultValue !== null && defaultValue !== void 0 ? defaultValue : multiple ? [] : ""),
181
- _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
182
- innerValue = _useState4[0],
183
- setInnerValue = _useState4[1];
184
-
185
- var _useState5 = (0, _react.useState)(""),
186
- _useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
187
- searchValue = _useState6[0],
188
- setSearchValue = _useState6[1];
189
-
190
- var _useState7 = (0, _react.useState)(-1),
191
- _useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
192
- visualFocusIndex = _useState8[0],
193
- changeVisualFocusIndex = _useState8[1];
194
-
195
- var _useState9 = (0, _react.useState)(false),
196
- _useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
197
- isOpen = _useState10[0],
198
- changeIsOpen = _useState10[1];
199
-
200
- var _useState11 = (0, _react.useState)(null),
201
- _useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
202
- listboxStyles = _useState12[0],
203
- setListboxStyles = _useState12[1];
204
-
205
- var selectRef = (0, _react.useRef)(null);
206
- var selectSearchInputRef = (0, _react.useRef)(null);
207
- var colorsTheme = (0, _useTheme["default"])();
208
- var translatedLabels = (0, _useTranslatedLabels["default"])();
209
- var optionalItem = {
210
- label: placeholder,
211
- value: ""
212
- };
213
- var filteredOptions = (0, _react.useMemo)(function () {
214
- return filterOptionsBySearchValue(options, searchValue);
215
- }, [options, searchValue]);
216
- var lastOptionIndex = (0, _react.useMemo)(function () {
217
- return getLastOptionIndex(options, filteredOptions, searchable, optional, multiple);
218
- }, [options, filteredOptions, searchable, optional, multiple]);
219
-
220
- var _useMemo = (0, _react.useMemo)(function () {
221
- return getSelectedOption(value !== null && value !== void 0 ? value : innerValue, options, multiple, optional, optionalItem);
222
- }, [value, innerValue, options, multiple, optional, optionalItem]),
223
- selectedOption = _useMemo.selectedOption,
224
- singleSelectionIndex = _useMemo.singleSelectionIndex;
225
-
226
- var openOptions = function openOptions() {
227
- if (!isOpen && canOpenOptions(options, disabled)) changeIsOpen(true);
228
- };
229
-
230
- var closeOptions = function closeOptions() {
231
- if (isOpen) {
232
- changeIsOpen(false);
233
- changeVisualFocusIndex(-1);
234
- }
235
- };
236
-
237
- var handleSelectChangeValue = function handleSelectChangeValue(newOption) {
238
- var newValue;
239
-
240
- if (multiple) {
241
- if ((value !== null && value !== void 0 ? value : innerValue).includes(newOption.value)) newValue = (value !== null && value !== void 0 ? value : innerValue).filter(function (optionVal) {
242
- return optionVal !== newOption.value;
243
- });else newValue = [].concat((0, _toConsumableArray2["default"])(value !== null && value !== void 0 ? value : innerValue), [newOption.value]);
244
- } else newValue = newOption.value;
245
-
246
- value !== null && value !== void 0 ? value : setInnerValue(newValue);
247
- notOptionalCheck(newValue, multiple, optional) ? onChange === null || onChange === void 0 ? void 0 : onChange({
248
- value: newValue,
249
- error: translatedLabels.formFields.requiredValueErrorMessage
250
- }) : onChange === null || onChange === void 0 ? void 0 : onChange({
251
- value: newValue
252
- });
253
- };
254
-
255
- var handleSelectOnClick = function handleSelectOnClick() {
256
- searchable && selectSearchInputRef.current.focus();
257
-
258
- if (isOpen) {
259
- closeOptions();
260
- setSearchValue("");
261
- } else openOptions();
262
- };
263
-
264
- var handleSelectOnFocus = function handleSelectOnFocus(event) {
265
- if (!event.currentTarget.contains(event.relatedTarget)) searchable && selectSearchInputRef.current.focus();
266
- };
267
-
268
- var handleSelectOnBlur = function handleSelectOnBlur(event) {
269
- // focus leaves container (outside, not to childs)
270
- if (!event.currentTarget.contains(event.relatedTarget)) {
271
- closeOptions();
272
- setSearchValue("");
273
- var currentValue = value !== null && value !== void 0 ? value : innerValue;
274
- notOptionalCheck(currentValue, multiple, optional) ? onBlur === null || onBlur === void 0 ? void 0 : onBlur({
275
- value: currentValue,
276
- error: translatedLabels.formFields.requiredValueErrorMessage
277
- }) : onBlur === null || onBlur === void 0 ? void 0 : onBlur({
278
- value: currentValue
279
- });
280
- }
281
- };
282
-
283
- var handleSelectOnKeyDown = function handleSelectOnKeyDown(event) {
284
- switch (event.keyCode) {
285
- case 40:
286
- // Arrow Down
287
- event.preventDefault();
288
- singleSelectionIndex !== undefined && (!isOpen || visualFocusIndex === -1 && singleSelectionIndex > -1 && singleSelectionIndex <= lastOptionIndex) ? changeVisualFocusIndex(singleSelectionIndex) : changeVisualFocusIndex(function (visualFocusIndex) {
289
- if (visualFocusIndex < lastOptionIndex) return visualFocusIndex + 1;else if (visualFocusIndex === lastOptionIndex) return 0;
290
- });
291
- openOptions();
292
- break;
293
-
294
- case 38:
295
- // Arrow Up
296
- event.preventDefault();
297
- singleSelectionIndex !== undefined && (!isOpen || visualFocusIndex === -1 && singleSelectionIndex > -1 && singleSelectionIndex <= lastOptionIndex) ? changeVisualFocusIndex(singleSelectionIndex) : changeVisualFocusIndex(function (visualFocusIndex) {
298
- return visualFocusIndex === 0 || visualFocusIndex === -1 ? lastOptionIndex : visualFocusIndex - 1;
299
- });
300
- openOptions();
301
- break;
302
-
303
- case 27:
304
- // Esc
305
- event.preventDefault();
306
- closeOptions();
307
- setSearchValue("");
308
- break;
309
-
310
- case 13:
311
- // Enter
312
- if (isOpen && visualFocusIndex >= 0) {
313
- var accLength = optional && !multiple ? 1 : 0;
314
-
315
- if (searchable) {
316
- if (filteredOptions.length > 0) {
317
- if (optional && !multiple && visualFocusIndex === 0 && filteredGroupsHaveOptions(filteredOptions)) handleSelectChangeValue(optionalItem);else filteredOptions[0].options ? filteredGroupsHaveOptions(filteredOptions) && filteredOptions.some(function (groupOption) {
318
- var groupLength = accLength + groupOption.options.length;
319
- groupLength > visualFocusIndex && handleSelectChangeValue(groupOption.options[visualFocusIndex - accLength]);
320
- accLength = groupLength;
321
- return groupLength > visualFocusIndex;
322
- }) : handleSelectChangeValue(filteredOptions[visualFocusIndex - accLength]);
323
- }
324
- } else {
325
- if (optional && !multiple && visualFocusIndex === 0) handleSelectChangeValue(optionalItem);else options[0].options ? options.some(function (groupOption) {
326
- var groupLength = accLength + groupOption.options.length;
327
- groupLength > visualFocusIndex && handleSelectChangeValue(groupOption.options[visualFocusIndex - accLength]);
328
- accLength = groupLength;
329
- return groupLength > visualFocusIndex;
330
- }) : handleSelectChangeValue(options[visualFocusIndex - accLength]);
331
- }
332
-
333
- !multiple && closeOptions();
334
- setSearchValue("");
335
- }
336
-
337
- break;
338
- }
339
- };
340
-
341
- var handleSearchIOnChange = function handleSearchIOnChange(event) {
342
- setSearchValue(event.target.value);
343
- changeVisualFocusIndex(-1);
344
- openOptions();
345
- };
346
-
347
- var handleClearOptionsActionOnClick = function handleClearOptionsActionOnClick(event) {
348
- event.stopPropagation();
349
- value !== null && value !== void 0 ? value : setInnerValue([]);
350
- !optional ? onChange === null || onChange === void 0 ? void 0 : onChange({
351
- value: [],
352
- error: translatedLabels.formFields.requiredValueErrorMessage
353
- }) : onChange === null || onChange === void 0 ? void 0 : onChange({
354
- value: []
355
- });
356
- };
357
-
358
- var handleClearSearchActionOnClick = function handleClearSearchActionOnClick(event) {
359
- event.stopPropagation();
360
- setSearchValue("");
361
- };
362
-
363
- var handleOptionOnClick = (0, _react.useCallback)(function (option) {
364
- handleSelectChangeValue(option);
365
- !multiple && closeOptions();
366
- setSearchValue("");
367
- }, [handleSelectChangeValue, closeOptions, multiple]);
368
-
369
- var handleListboxResize = function handleListboxResize() {
370
- var _selectRef$current;
371
-
372
- var rect = selectRef === null || selectRef === void 0 ? void 0 : (_selectRef$current = selectRef.current) === null || _selectRef$current === void 0 ? void 0 : _selectRef$current.getBoundingClientRect();
373
- setListboxStyles({
374
- width: rect === null || rect === void 0 ? void 0 : rect.width
375
- });
376
- };
377
-
378
- (0, _react.useEffect)(function () {
379
- handleListboxResize();
380
- window.addEventListener("resize", handleListboxResize);
381
- return function () {
382
- window.removeEventListener("resize", handleListboxResize);
383
- };
384
- }, [setListboxStyles]);
385
- return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
386
- theme: colorsTheme.select
387
- }, /*#__PURE__*/_react["default"].createElement(SelectContainer, {
388
- margin: margin,
389
- size: size,
390
- ref: ref
391
- }, label && /*#__PURE__*/_react["default"].createElement(Label, {
392
- id: selectLabelId,
393
- disabled: disabled,
394
- onClick: function onClick() {
395
- selectRef.current.focus();
396
- },
397
- helperText: helperText
398
- }, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, translatedLabels.formFields.optionalLabel)), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
399
- disabled: disabled
400
- }, helperText), /*#__PURE__*/_react["default"].createElement(Popover.Root, {
401
- open: isOpen
402
- }, /*#__PURE__*/_react["default"].createElement(Popover.Trigger, {
403
- asChild: true
404
- }, /*#__PURE__*/_react["default"].createElement(Select, {
405
- id: selectId,
406
- disabled: disabled,
407
- error: error,
408
- onBlur: handleSelectOnBlur,
409
- onClick: handleSelectOnClick,
410
- onFocus: handleSelectOnFocus,
411
- onKeyDown: handleSelectOnKeyDown,
412
- ref: selectRef,
413
- tabIndex: tabIndex,
414
- role: "combobox",
415
- "aria-controls": optionsListId,
416
- "aria-disabled": disabled,
417
- "aria-expanded": isOpen,
418
- "aria-haspopup": "listbox",
419
- "aria-labelledby": label ? selectLabelId : undefined,
420
- "aria-activedescendant": visualFocusIndex >= 0 ? "option-".concat(visualFocusIndex) : undefined,
421
- "aria-invalid": error ? "true" : "false",
422
- "aria-errormessage": error ? errorId : undefined,
423
- "aria-required": !disabled && !optional
424
- }, multiple && selectedOption.length > 0 && /*#__PURE__*/_react["default"].createElement(SelectionIndicator, null, /*#__PURE__*/_react["default"].createElement(SelectionNumber, {
425
- disabled: disabled
426
- }, selectedOption.length), /*#__PURE__*/_react["default"].createElement(ClearOptionsAction, {
427
- disabled: disabled,
428
- onMouseDown: function onMouseDown(event) {
429
- // Avoid input to lose focus when pressed
430
- event.preventDefault();
431
- },
432
- onClick: handleClearOptionsActionOnClick,
433
- tabIndex: -1,
434
- title: translatedLabels.select.actionClearSelectionTitle,
435
- "aria-label": translatedLabels.select.actionClearSelectionTitle
436
- }, _Icons["default"].clear)), /*#__PURE__*/_react["default"].createElement(SearchableValueContainer, null, /*#__PURE__*/_react["default"].createElement(ValueInput, {
437
- name: name,
438
- value: multiple ? (value !== null && value !== void 0 ? value : innerValue).join(",") : value !== null && value !== void 0 ? value : innerValue,
439
- readOnly: true,
440
- "aria-hidden": "true"
441
- }), searchable && /*#__PURE__*/_react["default"].createElement(SearchInput, {
442
- value: searchValue,
443
- disabled: disabled,
444
- onChange: handleSearchIOnChange,
445
- ref: selectSearchInputRef,
446
- autoComplete: "nope",
447
- autoCorrect: "nope",
448
- size: 1
449
- }), (!searchable || searchValue === "") && (multiple ? /*#__PURE__*/_react["default"].createElement(SelectedOption, {
450
- disabled: disabled,
451
- atBackground: (value !== null && value !== void 0 ? value : innerValue).length === 0 || searchable && isOpen
452
- }, /*#__PURE__*/_react["default"].createElement(SelectedOptionLabel, null, selectedOption.map(function (option) {
453
- return option.label;
454
- }).join(", ")), selectedOption.length === 0 && placeholder) : /*#__PURE__*/_react["default"].createElement(SelectedOption, {
455
- disabled: disabled,
456
- atBackground: !(value !== null && value !== void 0 ? value : innerValue) || searchable && isOpen
457
- }, /*#__PURE__*/_react["default"].createElement(SelectedOptionLabel, null, (_selectedOption$label = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) !== null && _selectedOption$label !== void 0 ? _selectedOption$label : placeholder)))), !disabled && error && /*#__PURE__*/_react["default"].createElement(ErrorIcon, null, _Icons["default"].error), searchable && searchValue.length > 0 && /*#__PURE__*/_react["default"].createElement(ClearSearchAction, {
458
- onMouseDown: function onMouseDown(event) {
459
- // Avoid input to lose focus
460
- event.preventDefault();
461
- },
462
- onClick: handleClearSearchActionOnClick,
463
- tabIndex: -1,
464
- title: translatedLabels.select.actionClearSearchTitle,
465
- "aria-label": translatedLabels.select.actionClearSearchTitle
466
- }, _Icons["default"].clear), /*#__PURE__*/_react["default"].createElement(CollapseIndicator, {
467
- disabled: disabled
468
- }, isOpen ? _Icons["default"].arrowUp : _Icons["default"].arrowDown))), /*#__PURE__*/_react["default"].createElement(Popover.Content, {
469
- sideOffset: 4,
470
- onOpenAutoFocus: function onOpenAutoFocus(event) {
471
- // Avoid select to lose focus when the list is opened
472
- event.preventDefault();
473
- },
474
- onCloseAutoFocus: function onCloseAutoFocus(event) {
475
- // Avoid select to lose focus when the list is closed
476
- event.preventDefault();
477
- }
478
- }, /*#__PURE__*/_react["default"].createElement(_Listbox["default"], {
479
- id: optionsListId,
480
- currentValue: value !== null && value !== void 0 ? value : innerValue,
481
- options: searchable ? filteredOptions : options,
482
- visualFocusIndex: visualFocusIndex,
483
- lastOptionIndex: lastOptionIndex,
484
- multiple: multiple,
485
- optional: optional,
486
- optionalItem: optionalItem,
487
- searchable: searchable,
488
- handleOptionOnClick: handleOptionOnClick,
489
- styles: listboxStyles
490
- }))), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
491
- id: errorId,
492
- "aria-live": error ? "assertive" : "off"
493
- }, error)));
494
- });
495
-
496
- var sizes = {
497
- small: "240px",
498
- medium: "360px",
499
- large: "480px",
500
- fillParent: "100%"
501
- };
502
-
503
- var calculateWidth = function calculateWidth(margin, size) {
504
- return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
505
- };
506
-
507
- var SelectContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
508
- return calculateWidth(props.margin, props.size);
509
- }, function (props) {
510
- return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
511
- }, function (props) {
512
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
513
- }, function (props) {
514
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
515
- }, function (props) {
516
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
517
- }, function (props) {
518
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
519
- });
520
-
521
- var Label = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n cursor: default;\n ", "\n"])), function (props) {
522
- return props.disabled ? props.theme.disabledColor : props.theme.labelFontColor;
523
- }, function (props) {
524
- return props.theme.fontFamily;
525
- }, function (props) {
526
- return props.theme.labelFontSize;
527
- }, function (props) {
528
- return props.theme.labelFontStyle;
529
- }, function (props) {
530
- return props.theme.labelFontWeight;
531
- }, function (props) {
532
- return props.theme.labelLineHeight;
533
- }, function (props) {
534
- return !props.helperText && "margin-bottom: 0.25rem";
535
- });
536
-
537
- var OptionalLabel = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"])), function (props) {
538
- return props.theme.optionalLabelFontWeight;
539
- });
540
-
541
- var HelperText = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-bottom: 0.25rem;\n"])), function (props) {
542
- return props.disabled ? props.theme.disabledColor : props.theme.helperTextFontColor;
543
- }, function (props) {
544
- return props.theme.fontFamily;
545
- }, function (props) {
546
- return props.theme.helperTextFontSize;
547
- }, function (props) {
548
- return props.theme.helperTextFontStyle;
549
- }, function (props) {
550
- return props.theme.helperTextFontWeight;
551
- }, function (props) {
552
- return props.theme.helperTextLineHeight;
553
- });
554
-
555
- var Select = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n position: relative;\n align-items: center;\n height: calc(2.5rem - 2px);\n padding: 0 0.5rem;\n outline: none;\n ", ";\n box-shadow: 0 0 0 2px transparent;\n border-radius: 4px;\n border: 1px solid\n ", ";\n ", "\n ", ";\n\n ", ";\n"])), function (props) {
556
- return props.disabled && "background-color: ".concat(props.theme.disabledInputBackgroundColor);
557
- }, function (props) {
558
- return props.disabled ? props.theme.disabledInputBorderColor : props.theme.enabledInputBorderColor;
559
- }, function (props) {
560
- return props.error && !props.disabled && "border-color: transparent;\n box-shadow: 0 0 0 2px ".concat(props.theme.errorInputBorderColor, ";\n ");
561
- }, function (props) {
562
- return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
563
- }, function (props) {
564
- return !props.disabled && "\n &:hover {\n border-color: ".concat(props.error ? "transparent" : props.theme.hoverInputBorderColor, ";\n ").concat(props.error && "box-shadow: 0 0 0 2px ".concat(props.theme.hoverInputErrorBorderColor, ";"), "\n }\n &:focus-within {\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(props.theme.focusInputBorderColor, ";\n }\n ");
565
- });
566
-
567
- var SelectionIndicator = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n border: 1px solid ", ";\n border-radius: 2px;\n max-height: 22px;\n width: 46px;\n"])), function (props) {
568
- return props.theme.selectionIndicatorBorderColor;
569
- });
570
-
571
- var SelectionNumber = _styledComponents["default"].span(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 22px;\n height: 22px;\n user-select: none;\n ", ";\n border-right: 1px solid ", ";\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n ", "\n"])), function (props) {
572
- return !props.disabled && "background-color: ".concat(props.theme.selectionIndicatorBackgroundColor);
573
- }, function (props) {
574
- return props.theme.selectionIndicatorBorderColor;
575
- }, function (props) {
576
- return props.disabled ? props.theme.disabledColor : props.theme.selectionIndicatorFontColor;
577
- }, function (props) {
578
- return props.theme.fontFamily;
579
- }, function (props) {
580
- return props.theme.selectionIndicatorFontSize;
581
- }, function (props) {
582
- return props.theme.selectionIndicatorFontStyle;
583
- }, function (props) {
584
- return props.theme.selectionIndicatorFontWeight;
585
- }, function (props) {
586
- return props.disabled ? "cursor: not-allowed;" : "cursor: default;";
587
- });
588
-
589
- var ClearOptionsAction = _styledComponents["default"].button(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n width: 23px;\n height: 22px;\n border: none;\n padding: 0.25rem;\n ", "\n background-color: ", ";\n color: ", ";\n\n :focus-visible {\n outline: none;\n }\n ", "\n\n svg {\n line-height: 18px;\n }\n"])), function (props) {
590
- return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
591
- }, function (props) {
592
- return props.disabled ? "transparent" : props.theme.enabledSelectionIndicatorActionBackgroundColor;
593
- }, function (props) {
594
- return props.disabled ? props.theme.disabledColor : props.theme.enabledSelectionIndicatorActionIconColor;
595
- }, function (props) {
596
- return !props.disabled && "\n &:hover {\n background-color: ".concat(props.theme.hoverSelectionIndicatorActionBackgroundColor, ";\n color: ").concat(props.theme.hoverSelectionIndicatorActionIconColor, ";\n }\n &:active {\n background-color: ").concat(props.theme.activeSelectionIndicatorActionBackgroundColor, ";\n color: ").concat(props.theme.activeSelectionIndicatorActionIconColor, ";\n }\n ");
597
- });
598
-
599
- var SearchableValueContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n display: grid;\n width: 100%;\n"])));
600
-
601
- var SelectedOption = _styledComponents["default"].span(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n grid-area: 1 / 1 / 1 / 1;\n display: inline-flex;\n align-items: center;\n height: calc(2.5rem - 2px);\n padding: 0 0.5rem;\n user-select: none;\n overflow: hidden;\n\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"])), function (props) {
602
- if (props.disabled) return props.theme.disabledColor;else if (props.atBackground) return props.theme.placeholderFontColor;else return props.theme.valueFontColor;
603
- }, function (props) {
604
- return props.theme.fontFamily;
605
- }, function (props) {
606
- return props.theme.valueFontSize;
607
- }, function (props) {
608
- return props.theme.valueFontStyle;
609
- }, function (props) {
610
- return props.theme.valueFontWeight;
611
- });
612
-
613
- var SelectedOptionLabel = _styledComponents["default"].span(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));
614
-
615
- var ValueInput = _styledComponents["default"].input(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["\n display: none;\n"])));
616
-
617
- var SearchInput = _styledComponents["default"].input(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["\n grid-area: 1 / 1 / 1 / 1;\n height: calc(2.5rem - 2px);\n background: none;\n border: none;\n outline: none;\n padding: 0 0.5rem;\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n"])), function (props) {
618
- return props.disabled ? props.theme.disabledColor : props.theme.valueFontColor;
619
- }, function (props) {
620
- return props.theme.fontFamily;
621
- }, function (props) {
622
- return props.theme.valueFontSize;
623
- }, function (props) {
624
- return props.theme.valueFontStyle;
625
- }, function (props) {
626
- return props.theme.valueFontWeight;
627
- });
628
-
629
- var ErrorIcon = _styledComponents["default"].span(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n padding: 3px;\n height: 18px;\n width: 18px;\n margin-left: 0.25rem;\n pointer-events: none;\n color: ", ";\n\n svg {\n line-height: 18px;\n font-size: 1.25rem;\n }\n"])), function (props) {
630
- return props.theme.errorIconColor;
631
- });
632
-
633
- var Error = _styledComponents["default"].span(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2["default"])(["\n min-height: 1.5em;\n color: ", ";\n font-family: ", ";\n font-size: 0.75rem;\n font-weight: 400;\n line-height: 1.5em;\n margin-top: 0.25rem;\n"])), function (props) {
634
- return props.theme.errorMessageColor;
635
- }, function (props) {
636
- return props.theme.fontFamily;
637
- });
638
-
639
- var CollapseIndicator = _styledComponents["default"].span(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 16px;\n width: 16px;\n padding: 4px;\n margin-left: 0.25rem;\n color: ", ";\n"])), function (props) {
640
- return props.disabled ? props.theme.disabledColor : props.theme.collapseIndicatorColor;
641
- });
642
-
643
- var ClearSearchAction = _styledComponents["default"].button(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n font-size: 1rem;\n font-family: ", ";\n border: 1px solid transparent;\n border-radius: 2px;\n padding: 3px;\n margin-left: 0.25rem;\n background-color: ", ";\n color: ", ";\n\n cursor: pointer;\n &:hover {\n background-color: ", ";\n color: ", ";\n }\n &:active {\n background-color: ", ";\n color: ", ";\n }\n svg {\n line-height: 18px;\n }\n"])), function (props) {
644
- return props.theme.fontFamily;
645
- }, function (props) {
646
- return props.theme.actionBackgroundColor;
647
- }, function (props) {
648
- return props.theme.actionIconColor;
649
- }, function (props) {
650
- return props.theme.hoverActionBackgroundColor;
651
- }, function (props) {
652
- return props.theme.hoverActionIconColor;
653
- }, function (props) {
654
- return props.theme.activeActionBackgroundColor;
655
- }, function (props) {
656
- return props.theme.activeActionIconColor;
657
- });
658
-
659
- var _default = DxcSelect;
660
- exports["default"] = _default;