@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
@@ -1,391 +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 _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
17
-
18
- var _react = _interopRequireWildcard(require("react"));
19
-
20
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
21
-
22
- var _Popper = _interopRequireDefault(require("@material-ui/core/Popper"));
23
-
24
- var _MenuItem = _interopRequireDefault(require("@material-ui/core/MenuItem"));
25
-
26
- var _core = require("@material-ui/core");
27
-
28
- var _Grow = _interopRequireDefault(require("@material-ui/core/Grow"));
29
-
30
- var _Paper = _interopRequireDefault(require("@material-ui/core/Paper"));
31
-
32
- var _MenuList = _interopRequireDefault(require("@material-ui/core/MenuList"));
33
-
34
- var _variables = require("../common/variables.js");
35
-
36
- var _utils = require("../common/utils.js");
37
-
38
- var _useTheme = _interopRequireDefault(require("../useTheme"));
39
-
40
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
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 DxcDropdown = function DxcDropdown(_ref) {
47
- var options = _ref.options,
48
- _ref$optionsIconPosit = _ref.optionsIconPosition,
49
- optionsIconPosition = _ref$optionsIconPosit === void 0 ? "before" : _ref$optionsIconPosit,
50
- icon = _ref.icon,
51
- _ref$iconPosition = _ref.iconPosition,
52
- iconPosition = _ref$iconPosition === void 0 ? "before" : _ref$iconPosition,
53
- _ref$label = _ref.label,
54
- label = _ref$label === void 0 ? "" : _ref$label,
55
- _ref$caretHidden = _ref.caretHidden,
56
- caretHidden = _ref$caretHidden === void 0 ? false : _ref$caretHidden,
57
- onSelectOption = _ref.onSelectOption,
58
- _ref$expandOnHover = _ref.expandOnHover,
59
- expandOnHover = _ref$expandOnHover === void 0 ? false : _ref$expandOnHover,
60
- margin = _ref.margin,
61
- _ref$size = _ref.size,
62
- size = _ref$size === void 0 ? "fitContent" : _ref$size,
63
- _ref$tabIndex = _ref.tabIndex,
64
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex,
65
- _ref$disabled = _ref.disabled,
66
- disabled = _ref$disabled === void 0 ? false : _ref$disabled;
67
-
68
- var _useState = (0, _react.useState)(),
69
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
70
- width = _useState2[0],
71
- setWidth = _useState2[1];
72
-
73
- var colorsTheme = (0, _useTheme["default"])();
74
- var ref = (0, _react.useRef)(null);
75
-
76
- var handleResize = function handleResize() {
77
- if (ref.current) setWidth(ref.current.offsetWidth);
78
- };
79
-
80
- (0, _react.useEffect)(function () {
81
- if (ref.current) {
82
- ref.current.addEventListener("resize", handleResize);
83
- handleResize();
84
- }
85
-
86
- return function () {
87
- if (ref.current) ref.current.removeEventListener("resize", handleResize);
88
- };
89
- }, []);
90
-
91
- var _useState3 = (0, _react.useState)(null),
92
- _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
93
- anchorEl = _useState4[0],
94
- setAnchorEl = _useState4[1];
95
-
96
- function handleClickListItem(event) {
97
- setAnchorEl(event.currentTarget);
98
- }
99
-
100
- function handleMenuItemClick(option) {
101
- setAnchorEl(null);
102
- onSelectOption(option.value);
103
- }
104
-
105
- function handleClose() {
106
- setAnchorEl(null);
107
- }
108
-
109
- var handleCloseOver = expandOnHover ? handleClose : undefined;
110
-
111
- var UpArrowIcon = function UpArrowIcon() {
112
- return /*#__PURE__*/_react["default"].createElement("svg", {
113
- xmlns: "http://www.w3.org/2000/svg",
114
- width: "24",
115
- height: "24",
116
- viewBox: "0 0 24 24",
117
- fill: "currentColor"
118
- }, /*#__PURE__*/_react["default"].createElement("path", {
119
- d: "M7 14l5-5 5 5z"
120
- }), /*#__PURE__*/_react["default"].createElement("path", {
121
- d: "M0 0h24v24H0z",
122
- fill: "none"
123
- }));
124
- };
125
-
126
- var DownArrowIcon = function DownArrowIcon() {
127
- return /*#__PURE__*/_react["default"].createElement("svg", {
128
- xmlns: "http://www.w3.org/2000/svg",
129
- width: "24",
130
- height: "24",
131
- viewBox: "0 0 24 24",
132
- fill: "currentColor"
133
- }, /*#__PURE__*/_react["default"].createElement("path", {
134
- d: "M7 10l5 5 5-5z"
135
- }), /*#__PURE__*/_react["default"].createElement("path", {
136
- d: "M0 0h24v24H0z",
137
- fill: "none"
138
- }));
139
- };
140
-
141
- var labelComponent = /*#__PURE__*/_react["default"].createElement(DropdownTriggerLabel, {
142
- iconPosition: iconPosition,
143
- label: label
144
- }, label);
145
-
146
- return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
147
- theme: colorsTheme.dropdown
148
- }, /*#__PURE__*/_react["default"].createElement(DXCDropdownContainer, {
149
- margin: margin,
150
- size: size,
151
- disabled: disabled
152
- }, /*#__PURE__*/_react["default"].createElement("div", {
153
- onMouseOver: expandOnHover && !disabled ? handleClickListItem : undefined,
154
- onMouseOut: handleCloseOver,
155
- onFocus: handleCloseOver,
156
- onBlur: handleCloseOver
157
- }, /*#__PURE__*/_react["default"].createElement(DropdownTrigger, {
158
- opened: anchorEl === null ? false : true,
159
- onClick: handleClickListItem,
160
- disabled: disabled,
161
- label: label,
162
- caretHidden: caretHidden,
163
- margin: margin,
164
- size: size,
165
- ref: ref,
166
- tabIndex: tabIndex
167
- }, /*#__PURE__*/_react["default"].createElement(DropdownTriggerContainer, {
168
- caretHidden: caretHidden
169
- }, iconPosition === "after" && labelComponent, icon && /*#__PURE__*/_react["default"].createElement(ButtonIconContainer, {
170
- label: label,
171
- iconPosition: iconPosition,
172
- disabled: disabled
173
- }, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement(ButtonIcon, {
174
- src: icon
175
- }) : icon), iconPosition === "before" && labelComponent), /*#__PURE__*/_react["default"].createElement(CaretIconContainer, {
176
- caretHidden: caretHidden,
177
- disabled: disabled
178
- }, !caretHidden && (anchorEl === null ? /*#__PURE__*/_react["default"].createElement(DownArrowIcon, null) : /*#__PURE__*/_react["default"].createElement(UpArrowIcon, null)))), /*#__PURE__*/_react["default"].createElement(DXCMenu, {
179
- anchorEl: anchorEl,
180
- open: Boolean(anchorEl),
181
- onClose: handleClose,
182
- getContentAnchorEl: null,
183
- anchorOrigin: {
184
- vertical: "bottom",
185
- horizontal: "left"
186
- },
187
- transformOrigin: {
188
- vertical: "top",
189
- horizontal: "left"
190
- },
191
- size: size,
192
- width: width,
193
- role: undefined,
194
- transition: true,
195
- disablePortal: true,
196
- placement: "bottom-start"
197
- }, function (_ref2) {
198
- var TransitionProps = _ref2.TransitionProps;
199
- return /*#__PURE__*/_react["default"].createElement(_Grow["default"], TransitionProps, /*#__PURE__*/_react["default"].createElement(_Paper["default"], null, /*#__PURE__*/_react["default"].createElement(_core.ClickAwayListener, {
200
- onClickAway: handleClose
201
- }, /*#__PURE__*/_react["default"].createElement(_MenuList["default"], {
202
- autoFocusItem: Boolean(anchorEl),
203
- id: "menu-list-grow"
204
- }, options.map(function (option) {
205
- return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
206
- key: option.value,
207
- value: option.value,
208
- disableRipple: true,
209
- onClick: function onClick(event) {
210
- return handleMenuItemClick(option);
211
- }
212
- }, optionsIconPosition === "after" && /*#__PURE__*/_react["default"].createElement("span", {
213
- className: "optionLabel"
214
- }, option.label), option.icon && /*#__PURE__*/_react["default"].createElement(ListIconContainer, {
215
- label: option.label,
216
- iconPosition: optionsIconPosition
217
- }, typeof option.icon === "string" ? /*#__PURE__*/_react["default"].createElement(ListIcon, {
218
- src: option.icon
219
- }) : option.icon), optionsIconPosition === "before" && /*#__PURE__*/_react["default"].createElement("span", {
220
- className: "optionLabel"
221
- }, option.label));
222
- })))));
223
- }))));
224
- };
225
-
226
- var sizes = {
227
- small: "60px",
228
- medium: "240px",
229
- large: "480px",
230
- fillParent: "100%",
231
- fitContent: "unset"
232
- };
233
-
234
- var calculateWidth = function calculateWidth(margin, size) {
235
- if (size === "fillParent") {
236
- return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
237
- }
238
-
239
- return sizes[size];
240
- };
241
-
242
- var DXCDropdownContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n text-overflow: ellipsis;\n overflow: hidden;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n display: inline-block;\n"])), function (props) {
243
- return calculateWidth(props.margin, props.size);
244
- }, function (props) {
245
- return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
246
- }, function (props) {
247
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
248
- }, function (props) {
249
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
250
- }, function (props) {
251
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
252
- }, function (props) {
253
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
254
- });
255
-
256
- var DXCMenu = (0, _styledComponents["default"])(_Popper["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n z-index: 1;\n\n .MuiMenuItem-gutters {\n width: ", ";\n }\n .MuiMenuItem-root {\n min-height: 36px;\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n height: auto;\n }\n .MuiPaper-root {\n min-width: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n border-top-left-radius: 0px;\n border-top-right-radius: 0px;\n max-height: 230px;\n overflow-y: auto;\n\n ::-webkit-scrollbar {\n width: 3px;\n }\n ::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 3px;\n }\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 3px;\n }\n\n .MuiList-padding {\n padding-top: 0px;\n padding-bottom: 0px;\n }\n .MuiListItem-button {\n display: flex;\n background-color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n cursor: pointer;\n }\n .MuiListItem-button:focus {\n outline: ", " solid 2px;\n outline-offset: -2px;\n }\n .MuiListItem-button:hover {\n background-color: ", ";\n }\n .MuiListItem-button:active {\n background-color: ", ";\n outline: ", " solid 2px;\n outline-offset: -2px;\n }\n }\n"])), function (props) {
257
- return calculateWidth(props.margin, props.size);
258
- }, function (props) {
259
- return props.theme.optionPaddingTop;
260
- }, function (props) {
261
- return props.theme.optionPaddingBottom;
262
- }, function (props) {
263
- return props.theme.optionPaddingLeft;
264
- }, function (props) {
265
- return props.theme.optionPaddingRight;
266
- }, function (props) {
267
- return "".concat(props.width, "px");
268
- }, function (props) {
269
- return props.theme.borderThickness;
270
- }, function (props) {
271
- return props.theme.borderStyle;
272
- }, function (props) {
273
- return props.theme.borderColor;
274
- }, function (props) {
275
- return props.theme.borderRadius;
276
- }, function (props) {
277
- return props.theme.borderRadius;
278
- }, function (props) {
279
- return props.theme.scrollBarTrackColor;
280
- }, function (props) {
281
- return props.theme.scrollBarThumbColor;
282
- }, function (props) {
283
- return props.theme.optionBackgroundColor;
284
- }, function (props) {
285
- return props.theme.optionFontFamily;
286
- }, function (props) {
287
- return props.theme.optionFontSize;
288
- }, function (props) {
289
- return props.theme.optionFontStyle;
290
- }, function (props) {
291
- return props.theme.optionFontWeight;
292
- }, function (props) {
293
- return props.theme.optionFontColor;
294
- }, function (props) {
295
- return props.theme.focusColor;
296
- }, function (props) {
297
- return props.theme.hoverOptionBackgroundColor;
298
- }, function (props) {
299
- return props.theme.activeOptionBackgroundColor;
300
- }, function (props) {
301
- return props.theme.focusColor;
302
- });
303
-
304
- var DropdownTrigger = _styledComponents["default"].button(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: auto;\n min-height: 40px;\n cursor: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n min-width: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n background-color: ", ";\n color: ", ";\n border-bottom-right-radius: ", ";\n border-bottom-left-radius: ", ";\n\n ", ";\n"])), function (props) {
305
- return props.disabled ? "not-allowed" : "pointer";
306
- }, function (props) {
307
- return props.theme.buttonFontFamily;
308
- }, function (props) {
309
- return props.theme.buttonFontSize;
310
- }, function (props) {
311
- return props.theme.buttonFontStyle;
312
- }, function (props) {
313
- return props.theme.buttonFontWeight;
314
- }, function (props) {
315
- return props.theme.borderRadius;
316
- }, function (props) {
317
- return props.theme.borderThickness;
318
- }, function (props) {
319
- return props.theme.borderStyle;
320
- }, function (props) {
321
- return props.disabled ? props.theme.disabledBorderColor : props.theme.borderColor;
322
- }, function (props) {
323
- return props.label === "" ? "0px" : calculateWidth(props.margin, props.size);
324
- }, function (props) {
325
- return props.theme.buttonPaddingTop;
326
- }, function (props) {
327
- return props.theme.buttonPaddingBottom;
328
- }, function (props) {
329
- return props.theme.buttonPaddingLeft;
330
- }, function (props) {
331
- return props.theme.buttonPaddingRight;
332
- }, function (props) {
333
- return props.disabled ? props.theme.disabledButtonBackgroundColor : props.theme.buttonBackgroundColor;
334
- }, function (props) {
335
- return props.disabled ? props.theme.disabledColor : props.theme.buttonFontColor;
336
- }, function (props) {
337
- return props.opened ? "0px" : props.theme.borderRadius;
338
- }, function (props) {
339
- return props.opened ? "0px" : props.theme.borderRadius;
340
- }, function (props) {
341
- return !props.disabled && " \n &:focus {\n outline: none;\n }\n &:focus-visible {\n outline: ".concat(props.theme.focusColor, " solid 2px;\n outline-offset: -2px;\n }\n &:hover {\n background-color: ").concat(props.theme.hoverButtonBackgroundColor, ";\n }\n &:active {\n background-color: ").concat(props.theme.activeButtonBackgroundColor, ";\n }\n ");
342
- });
343
-
344
- var DropdownTriggerLabel = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n text-align: left;\n text-overflow: ellipsis;\n overflow: hidden;\n"])));
345
-
346
- var DropdownTriggerContainer = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n margin-left: 0px;\n margin-right: 0px;\n width: ", ";\n white-space: nowrap;\n"])), function (props) {
347
- return props.caretHidden ? "100%" : "calc(100% - 36px)";
348
- });
349
-
350
- var ButtonIcon = _styledComponents["default"].img(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])([""])));
351
-
352
- var ButtonIconContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n color: ", ";\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
353
- return props.theme.buttonIconSize;
354
- }, function (props) {
355
- return props.theme.buttonIconSize;
356
- }, function (props) {
357
- return props.iconPosition === "after" && props.label !== "" && props.theme.buttonIconSpacing || "0px";
358
- }, function (props) {
359
- return props.iconPosition === "before" && props.label !== "" && props.theme.buttonIconSpacing || "0px";
360
- }, function (props) {
361
- return props.disabled ? props.theme.disabledColor : props.theme.buttonIconColor;
362
- });
363
-
364
- var ListIcon = _styledComponents["default"].img(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])([""])));
365
-
366
- var ListIconContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n color: ", ";\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
367
- return props.theme.optionIconSize;
368
- }, function (props) {
369
- return props.theme.optionIconSize;
370
- }, function (props) {
371
- return props.iconPosition === "after" && props.label !== "" && props.theme.optionIconSpacing || "0px";
372
- }, function (props) {
373
- return props.iconPosition === "before" && props.label !== "" && props.theme.optionIconSpacing || "0px";
374
- }, function (props) {
375
- return props.theme.optionIconColor;
376
- });
377
-
378
- var CaretIconContainer = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n display: ", ";\n margin-left: ", ";\n color: ", ";\n\n svg {\n width: ", ";\n height: ", ";\n }\n"])), function (props) {
379
- return props.caretHidden ? "none" : "inline-flex";
380
- }, function (props) {
381
- return props.theme.caretIconSpacing;
382
- }, function (props) {
383
- return props.disabled ? props.theme.disabledColor : props.theme.caretIconColor;
384
- }, function (props) {
385
- return props.theme.caretIconSize;
386
- }, function (props) {
387
- return props.theme.caretIconSize;
388
- });
389
-
390
- var _default = DxcDropdown;
391
- exports["default"] = _default;
@@ -1,249 +0,0 @@
1
- import React from "react";
2
- import { userEvent, within } from "@storybook/testing-library";
3
- import DxcDropdown from "./Dropdown";
4
- import Title from "../../.storybook/components/Title";
5
- import ExampleContainer from "../../.storybook/components/ExampleContainer";
6
-
7
- export default {
8
- title: "Dropdown",
9
- component: DxcDropdown,
10
- };
11
-
12
- const iconSVG = (
13
- <svg viewBox="0 0 24 24" fill="currentColor">
14
- <path d="M0 0h24v24H0z" fill="none" />
15
- <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />
16
- </svg>
17
- );
18
-
19
- const iconSVGLarge = (
20
- <svg enableBackground="new 0 0 24 24" height="48px" viewBox="0 0 24 24" width="48px" fill="currentColor">
21
- <g>
22
- <path d="M0,0h24v24H0V0z" fill="none" />
23
- <path d="M0,0h24v24H0V0z" fill="none" />
24
- </g>
25
- <g>
26
- <path d="M12,17.27L18.18,21l-1.64-7.03L22,9.24l-7.19-0.61L12,2L9.19,8.63L2,9.24l5.46,4.73L5.82,21L12,17.27z" />
27
- </g>
28
- </svg>
29
- );
30
-
31
- const options: any = [
32
- {
33
- value: "1",
34
- label: "Amazon with a very long text",
35
- },
36
- {
37
- value: "2",
38
- label: "Ebay",
39
- },
40
- {
41
- value: "3",
42
- label: "Apple",
43
- },
44
- ];
45
-
46
- const option: any = [
47
- {
48
- value: "1",
49
- label: "Ebay",
50
- },
51
- ];
52
-
53
- const icons = [
54
- iconSVG,
55
- iconSVGLarge,
56
- "https://iconape.com/wp-content/files/yd/367773/svg/logo-linkedin-logo-icon-png-svg.png",
57
- ];
58
-
59
- const optionsIcon: any = options.map((op, i) => ({ ...op, icon: icons[i] }));
60
-
61
- export const Chromatic = () => (
62
- <>
63
- <ExampleContainer>
64
- <Title title="Default" theme="light" level={4} />
65
- <DxcDropdown label="Default" options={options} onSelectOption={(value) => {}} />
66
- </ExampleContainer>
67
- <ExampleContainer pseudoState="pseudo-hover">
68
- <Title title="Hovered" theme="light" level={4} />
69
- <DxcDropdown label="Hovered" options={options} onSelectOption={(value) => {}} />
70
- </ExampleContainer>
71
- <ExampleContainer pseudoState="pseudo-focus-visible">
72
- <Title title="Focused" theme="light" level={4} />
73
- <DxcDropdown label="Focused" options={options} onSelectOption={(value) => {}} />
74
- </ExampleContainer>
75
- <ExampleContainer pseudoState="pseudo-active">
76
- <Title title="Actived" theme="light" level={4} />
77
- <DxcDropdown label="Actived" options={options} onSelectOption={(value) => {}} />
78
- </ExampleContainer>
79
- <ExampleContainer>
80
- <Title title="Disabled" theme="light" level={4} />
81
- <DxcDropdown label="Disabled" options={options} onSelectOption={(value) => {}} disabled />
82
- </ExampleContainer>
83
- <ExampleContainer>
84
- <Title title="Caret hidden" theme="light" level={4} />
85
- <DxcDropdown label="Caret hidden" options={options} onSelectOption={(value) => {}} caretHidden />
86
- </ExampleContainer>
87
- <ExampleContainer>
88
- <Title title="With icon before" theme="light" level={4} />
89
- <DxcDropdown label="Icon before" options={options} onSelectOption={(value) => {}} icon={iconSVG} />
90
- </ExampleContainer>
91
- <ExampleContainer>
92
- <Title title="With icon after" theme="light" level={4} />
93
- <DxcDropdown
94
- label="Icon after"
95
- options={options}
96
- onSelectOption={(value) => {}}
97
- icon="https://iconape.com/wp-content/files/yd/367773/svg/logo-linkedin-logo-icon-png-svg.png"
98
- iconPosition="after"
99
- />
100
- </ExampleContainer>
101
- <ExampleContainer>
102
- <Title title="Only icon" theme="light" level={4} />
103
- <DxcDropdown options={options} onSelectOption={(value) => {}} icon={iconSVG} />
104
- </ExampleContainer>
105
- <ExampleContainer>
106
- <Title title="Large icon" theme="light" level={4} />
107
- <DxcDropdown label="Large icon" options={options} onSelectOption={(value) => {}} icon={iconSVGLarge} />
108
- </ExampleContainer>
109
- <ExampleContainer>
110
- <Title title="Disabled with icon" theme="light" level={4} />
111
- <DxcDropdown
112
- label="Disabled with icon"
113
- options={options}
114
- onSelectOption={(value) => {}}
115
- icon={iconSVG}
116
- disabled
117
- />
118
- </ExampleContainer>
119
- <ExampleContainer>
120
- <Title title="Ellipsis" theme="light" level={4} />
121
- <DxcDropdown
122
- label="Very long text in dropdown button"
123
- options={options}
124
- onSelectOption={(value) => {}}
125
- icon={iconSVG}
126
- size="medium"
127
- />
128
- </ExampleContainer>
129
- <Title title="Margins" theme="light" level={2} />
130
- <ExampleContainer>
131
- <Title title="Xxsmall" theme="light" level={4} />
132
- <DxcDropdown label="Xxsmall" options={options} onSelectOption={(value) => {}} icon={iconSVG} margin="xxsmall" />
133
- </ExampleContainer>
134
- <ExampleContainer>
135
- <Title title="Xsmall" theme="light" level={4} />
136
- <DxcDropdown label="Xsmall" options={options} onSelectOption={(value) => {}} icon={iconSVG} margin="xsmall" />
137
- </ExampleContainer>
138
- <ExampleContainer>
139
- <Title title="Small" theme="light" level={4} />
140
- <DxcDropdown label="Small" options={options} onSelectOption={(value) => {}} icon={iconSVG} margin="small" />
141
- </ExampleContainer>
142
- <ExampleContainer>
143
- <Title title="Medium" theme="light" level={4} />
144
- <DxcDropdown label="Medium" options={options} onSelectOption={(value) => {}} icon={iconSVG} margin="medium" />
145
- </ExampleContainer>
146
- <ExampleContainer>
147
- <Title title="Large" theme="light" level={4} />
148
- <DxcDropdown label="Large" options={options} onSelectOption={(value) => {}} icon={iconSVG} margin="large" />
149
- </ExampleContainer>
150
- <ExampleContainer>
151
- <Title title="Xlarge" theme="light" level={4} />
152
- <DxcDropdown label="Xlarge" options={options} onSelectOption={(value) => {}} icon={iconSVG} margin="xlarge" />
153
- </ExampleContainer>
154
- <ExampleContainer>
155
- <Title title="Xxlarge" theme="light" level={4} />
156
- <DxcDropdown label="Xxlarge" options={options} onSelectOption={(value) => {}} icon={iconSVG} margin="xxlarge" />
157
- </ExampleContainer>
158
- <Title title="Sizes" theme="light" level={2} />
159
- <ExampleContainer>
160
- <Title title="Small" theme="light" level={4} />
161
- <DxcDropdown label="Small" options={options} onSelectOption={(value) => {}} icon={iconSVG} size="small" />
162
- </ExampleContainer>
163
- <ExampleContainer>
164
- <Title title="Medium" theme="light" level={4} />
165
- <DxcDropdown label="Medium" options={options} onSelectOption={(value) => {}} icon={iconSVG} size="medium" />
166
- </ExampleContainer>
167
- <ExampleContainer>
168
- <Title title="Large" theme="light" level={4} />
169
- <DxcDropdown label="Large" options={options} onSelectOption={(value) => {}} icon={iconSVG} size="large" />
170
- </ExampleContainer>
171
- <ExampleContainer>
172
- <Title title="FitContent" theme="light" level={4} />
173
- <DxcDropdown
174
- label="FitContent"
175
- options={options}
176
- onSelectOption={(value) => {}}
177
- icon={iconSVG}
178
- size="fitContent"
179
- />
180
- </ExampleContainer>
181
- <ExampleContainer>
182
- <Title title="FillParent" theme="light" level={4} />
183
- <DxcDropdown
184
- label="FillParent"
185
- options={options}
186
- onSelectOption={(value) => {}}
187
- icon={iconSVG}
188
- size="fillParent"
189
- />
190
- </ExampleContainer>
191
- </>
192
- );
193
-
194
- const DropdownWithOptions = () => (
195
- <ExampleContainer expanded>
196
- <Title title="Options" theme="light" level={4} />
197
- <DxcDropdown label="Options with icon" options={optionsIcon} onSelectOption={(value) => {}} />
198
- </ExampleContainer>
199
- );
200
-
201
- const DropdownHoverOption = () => (
202
- <ExampleContainer pseudoState="pseudo-hover" expanded>
203
- <Title title="Hovered option" theme="light" level={4} />
204
- <DxcDropdown label="Hovered options" options={option} onSelectOption={(value) => {}} />
205
- </ExampleContainer>
206
- );
207
-
208
- const DropdownActiveOption = () => (
209
- <ExampleContainer pseudoState="pseudo-active" expanded>
210
- <Title title="Actived option" theme="light" level={4} />
211
- <DxcDropdown label="Actived options" options={option} onSelectOption={(value) => {}} />
212
- </ExampleContainer>
213
- );
214
-
215
- const DropdownWithOptionsIconAfter = () => (
216
- <ExampleContainer expanded>
217
- <Title title="Icon after options" theme="light" level={4} />
218
- <DxcDropdown
219
- label="Icon after options"
220
- options={optionsIcon}
221
- onSelectOption={(value) => {}}
222
- optionsIconPosition="after"
223
- />
224
- </ExampleContainer>
225
- );
226
-
227
- export const DropdownOptions = DropdownWithOptions.bind({});
228
- DropdownOptions.play = async ({ canvasElement }) => {
229
- const canvas = within(canvasElement);
230
- await userEvent.click(canvas.getByRole("button"));
231
- };
232
-
233
- export const DropdownHoveredOption = DropdownHoverOption.bind({});
234
- DropdownHoveredOption.play = async ({ canvasElement }) => {
235
- const canvas = within(canvasElement);
236
- await userEvent.click(canvas.getByRole("button"));
237
- };
238
-
239
- export const DropdownActivedOption = DropdownActiveOption.bind({});
240
- DropdownActivedOption.play = async ({ canvasElement }) => {
241
- const canvas = within(canvasElement);
242
- await userEvent.click(canvas.getByRole("button"));
243
- };
244
-
245
- export const DropdownOptionsIconAfter = DropdownWithOptionsIconAfter.bind({});
246
- DropdownOptionsIconAfter.play = async ({ canvasElement }) => {
247
- const canvas = within(canvasElement);
248
- await userEvent.click(canvas.getByRole("button"));
249
- };