@dxc-technology/halstack-react 0.0.0-63eb520 → 0.0.0-646cad5

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 (309) hide show
  1. package/README.md +46 -0
  2. package/dist/index.d.mts +6670 -0
  3. package/dist/index.d.ts +6670 -0
  4. package/dist/index.js +14353 -0
  5. package/dist/index.mjs +14296 -0
  6. package/package.json +69 -71
  7. package/BackgroundColorContext.d.ts +0 -10
  8. package/BackgroundColorContext.js +0 -47
  9. package/HalstackContext.d.ts +0 -10
  10. package/HalstackContext.js +0 -243
  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 -168
  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 -290
  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 -59
  31. package/badge/types.d.ts +0 -4
  32. package/badge/types.js +0 -5
  33. package/bleed/Bleed.d.ts +0 -3
  34. package/bleed/Bleed.js +0 -84
  35. package/bleed/Bleed.stories.tsx +0 -342
  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 -126
  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/button/Button.d.ts +0 -4
  45. package/button/Button.js +0 -174
  46. package/button/Button.stories.tsx +0 -274
  47. package/button/Button.test.js +0 -35
  48. package/button/types.d.ts +0 -53
  49. package/button/types.js +0 -5
  50. package/card/Card.d.ts +0 -4
  51. package/card/Card.js +0 -163
  52. package/card/Card.stories.tsx +0 -201
  53. package/card/Card.test.js +0 -50
  54. package/card/ice-cream.jpg +0 -0
  55. package/card/types.d.ts +0 -67
  56. package/card/types.js +0 -5
  57. package/checkbox/Checkbox.d.ts +0 -4
  58. package/checkbox/Checkbox.js +0 -254
  59. package/checkbox/Checkbox.stories.tsx +0 -188
  60. package/checkbox/Checkbox.test.js +0 -78
  61. package/checkbox/types.d.ts +0 -64
  62. package/checkbox/types.js +0 -5
  63. package/chip/Chip.d.ts +0 -4
  64. package/chip/Chip.js +0 -161
  65. package/chip/Chip.stories.tsx +0 -119
  66. package/chip/Chip.test.js +0 -56
  67. package/chip/types.d.ts +0 -45
  68. package/chip/types.js +0 -5
  69. package/common/OpenSans.css +0 -81
  70. package/common/RequiredComponent.js +0 -32
  71. package/common/fonts/OpenSans-Bold.ttf +0 -0
  72. package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
  73. package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
  74. package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  75. package/common/fonts/OpenSans-Italic.ttf +0 -0
  76. package/common/fonts/OpenSans-Light.ttf +0 -0
  77. package/common/fonts/OpenSans-LightItalic.ttf +0 -0
  78. package/common/fonts/OpenSans-Regular.ttf +0 -0
  79. package/common/fonts/OpenSans-SemiBold.ttf +0 -0
  80. package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  81. package/common/utils.js +0 -22
  82. package/common/variables.js +0 -1372
  83. package/date-input/DateInput.d.ts +0 -4
  84. package/date-input/DateInput.js +0 -369
  85. package/date-input/DateInput.stories.tsx +0 -138
  86. package/date-input/DateInput.test.js +0 -479
  87. package/date-input/types.d.ts +0 -107
  88. package/date-input/types.js +0 -5
  89. package/dialog/Dialog.d.ts +0 -4
  90. package/dialog/Dialog.js +0 -138
  91. package/dialog/Dialog.stories.tsx +0 -212
  92. package/dialog/Dialog.test.js +0 -40
  93. package/dialog/types.d.ts +0 -43
  94. package/dialog/types.js +0 -5
  95. package/dropdown/Dropdown.d.ts +0 -4
  96. package/dropdown/Dropdown.js +0 -391
  97. package/dropdown/Dropdown.stories.tsx +0 -249
  98. package/dropdown/Dropdown.test.js +0 -189
  99. package/dropdown/types.d.ts +0 -80
  100. package/dropdown/types.js +0 -5
  101. package/file-input/FileInput.d.ts +0 -4
  102. package/file-input/FileInput.js +0 -590
  103. package/file-input/FileInput.stories.tsx +0 -507
  104. package/file-input/FileInput.test.js +0 -457
  105. package/file-input/FileItem.d.ts +0 -14
  106. package/file-input/FileItem.js +0 -184
  107. package/file-input/types.d.ts +0 -112
  108. package/file-input/types.js +0 -5
  109. package/footer/Footer.d.ts +0 -4
  110. package/footer/Footer.js +0 -183
  111. package/footer/Footer.stories.tsx +0 -130
  112. package/footer/Footer.test.js +0 -109
  113. package/footer/Icons.d.ts +0 -2
  114. package/footer/Icons.js +0 -77
  115. package/footer/types.d.ts +0 -65
  116. package/footer/types.js +0 -5
  117. package/header/Header.d.ts +0 -7
  118. package/header/Header.js +0 -300
  119. package/header/Header.stories.tsx +0 -172
  120. package/header/Header.test.js +0 -79
  121. package/header/Icons.d.ts +0 -2
  122. package/header/Icons.js +0 -34
  123. package/header/types.d.ts +0 -47
  124. package/header/types.js +0 -5
  125. package/heading/Heading.d.ts +0 -4
  126. package/heading/Heading.js +0 -159
  127. package/heading/Heading.stories.tsx +0 -54
  128. package/heading/Heading.test.js +0 -186
  129. package/heading/types.d.ts +0 -33
  130. package/heading/types.js +0 -5
  131. package/inset/Inset.d.ts +0 -3
  132. package/inset/Inset.js +0 -84
  133. package/inset/Inset.stories.tsx +0 -229
  134. package/inset/types.d.ts +0 -37
  135. package/inset/types.js +0 -5
  136. package/layout/ApplicationLayout.d.ts +0 -10
  137. package/layout/ApplicationLayout.js +0 -218
  138. package/layout/ApplicationLayout.stories.tsx +0 -171
  139. package/layout/Icons.js +0 -55
  140. package/layout/types.d.ts +0 -57
  141. package/layout/types.js +0 -5
  142. package/link/Link.d.ts +0 -4
  143. package/link/Link.js +0 -162
  144. package/link/Link.stories.tsx +0 -186
  145. package/link/Link.test.js +0 -83
  146. package/link/types.d.ts +0 -55
  147. package/link/types.js +0 -5
  148. package/list/List.d.ts +0 -4
  149. package/list/List.js +0 -47
  150. package/list/List.stories.tsx +0 -95
  151. package/list/types.d.ts +0 -7
  152. package/list/types.js +0 -5
  153. package/main.d.ts +0 -47
  154. package/main.js +0 -387
  155. package/number-input/NumberInput.d.ts +0 -4
  156. package/number-input/NumberInput.js +0 -76
  157. package/number-input/NumberInput.stories.tsx +0 -115
  158. package/number-input/NumberInput.test.js +0 -506
  159. package/number-input/NumberInputContext.d.ts +0 -4
  160. package/number-input/NumberInputContext.js +0 -19
  161. package/number-input/numberInputContextTypes.d.ts +0 -19
  162. package/number-input/numberInputContextTypes.js +0 -5
  163. package/number-input/types.d.ts +0 -124
  164. package/number-input/types.js +0 -5
  165. package/paginator/Icons.js +0 -66
  166. package/paginator/Paginator.d.ts +0 -4
  167. package/paginator/Paginator.js +0 -192
  168. package/paginator/Paginator.stories.tsx +0 -63
  169. package/paginator/Paginator.test.js +0 -266
  170. package/paginator/types.d.ts +0 -38
  171. package/paginator/types.js +0 -5
  172. package/password-input/PasswordInput.d.ts +0 -4
  173. package/password-input/PasswordInput.js +0 -163
  174. package/password-input/PasswordInput.stories.tsx +0 -131
  175. package/password-input/PasswordInput.test.js +0 -181
  176. package/password-input/types.d.ts +0 -110
  177. package/password-input/types.js +0 -5
  178. package/progress-bar/ProgressBar.d.ts +0 -4
  179. package/progress-bar/ProgressBar.js +0 -170
  180. package/progress-bar/ProgressBar.stories.jsx +0 -58
  181. package/progress-bar/ProgressBar.test.js +0 -65
  182. package/progress-bar/types.d.ts +0 -37
  183. package/progress-bar/types.js +0 -5
  184. package/quick-nav/QuickNav.d.ts +0 -4
  185. package/quick-nav/QuickNav.js +0 -64
  186. package/quick-nav/QuickNav.stories.tsx +0 -237
  187. package/quick-nav/types.d.ts +0 -21
  188. package/quick-nav/types.js +0 -5
  189. package/quick-nav-container/HeadingLink.d.ts +0 -8
  190. package/quick-nav-container/HeadingLink.js +0 -58
  191. package/quick-nav-container/QuickNavContainer.d.ts +0 -4
  192. package/quick-nav-container/QuickNavContainer.js +0 -69
  193. package/quick-nav-container/Section.d.ts +0 -9
  194. package/quick-nav-container/Section.js +0 -37
  195. package/quick-nav-container/types.d.ts +0 -34
  196. package/quick-nav-container/types.js +0 -5
  197. package/radio/Radio.d.ts +0 -4
  198. package/radio/Radio.js +0 -173
  199. package/radio/Radio.stories.tsx +0 -192
  200. package/radio/Radio.test.js +0 -71
  201. package/radio/types.d.ts +0 -54
  202. package/radio/types.js +0 -5
  203. package/radio-group/Radio.d.ts +0 -4
  204. package/radio-group/Radio.js +0 -141
  205. package/radio-group/RadioGroup.d.ts +0 -4
  206. package/radio-group/RadioGroup.js +0 -280
  207. package/radio-group/RadioGroup.stories.tsx +0 -100
  208. package/radio-group/RadioGroup.test.js +0 -695
  209. package/radio-group/types.d.ts +0 -114
  210. package/radio-group/types.js +0 -5
  211. package/resultsetTable/ResultsetTable.d.ts +0 -4
  212. package/resultsetTable/ResultsetTable.js +0 -254
  213. package/resultsetTable/ResultsetTable.stories.tsx +0 -275
  214. package/resultsetTable/ResultsetTable.test.js +0 -306
  215. package/resultsetTable/types.d.ts +0 -67
  216. package/resultsetTable/types.js +0 -5
  217. package/row/Row.d.ts +0 -3
  218. package/row/Row.js +0 -127
  219. package/row/Row.stories.tsx +0 -237
  220. package/row/types.d.ts +0 -28
  221. package/row/types.js +0 -5
  222. package/select/Icons.d.ts +0 -10
  223. package/select/Icons.js +0 -93
  224. package/select/Listbox.d.ts +0 -4
  225. package/select/Listbox.js +0 -148
  226. package/select/Option.d.ts +0 -4
  227. package/select/Option.js +0 -110
  228. package/select/Select.d.ts +0 -4
  229. package/select/Select.js +0 -655
  230. package/select/Select.stories.tsx +0 -582
  231. package/select/Select.test.js +0 -2057
  232. package/select/types.d.ts +0 -213
  233. package/select/types.js +0 -5
  234. package/sidenav/Sidenav.d.ts +0 -9
  235. package/sidenav/Sidenav.js +0 -136
  236. package/sidenav/Sidenav.stories.tsx +0 -182
  237. package/sidenav/Sidenav.test.js +0 -56
  238. package/sidenav/types.d.ts +0 -50
  239. package/sidenav/types.js +0 -5
  240. package/slider/Slider.d.ts +0 -4
  241. package/slider/Slider.js +0 -318
  242. package/slider/Slider.stories.tsx +0 -177
  243. package/slider/Slider.test.js +0 -150
  244. package/slider/types.d.ts +0 -82
  245. package/slider/types.js +0 -5
  246. package/spinner/Spinner.d.ts +0 -4
  247. package/spinner/Spinner.js +0 -250
  248. package/spinner/Spinner.stories.jsx +0 -103
  249. package/spinner/Spinner.test.js +0 -64
  250. package/spinner/types.d.ts +0 -32
  251. package/spinner/types.js +0 -5
  252. package/stack/Stack.d.ts +0 -3
  253. package/stack/Stack.js +0 -97
  254. package/stack/Stack.stories.tsx +0 -164
  255. package/stack/types.d.ts +0 -24
  256. package/stack/types.js +0 -5
  257. package/switch/Switch.d.ts +0 -4
  258. package/switch/Switch.js +0 -192
  259. package/switch/Switch.stories.tsx +0 -160
  260. package/switch/Switch.test.js +0 -98
  261. package/switch/types.d.ts +0 -62
  262. package/switch/types.js +0 -5
  263. package/table/Table.d.ts +0 -4
  264. package/table/Table.js +0 -118
  265. package/table/Table.stories.jsx +0 -277
  266. package/table/Table.test.js +0 -26
  267. package/table/types.d.ts +0 -21
  268. package/table/types.js +0 -5
  269. package/tabs/Tabs.d.ts +0 -4
  270. package/tabs/Tabs.js +0 -211
  271. package/tabs/Tabs.stories.tsx +0 -112
  272. package/tabs/Tabs.test.js +0 -140
  273. package/tabs/types.d.ts +0 -82
  274. package/tabs/types.js +0 -5
  275. package/tag/Tag.d.ts +0 -4
  276. package/tag/Tag.js +0 -183
  277. package/tag/Tag.stories.tsx +0 -142
  278. package/tag/Tag.test.js +0 -60
  279. package/tag/types.d.ts +0 -69
  280. package/tag/types.js +0 -5
  281. package/text/Text.d.ts +0 -7
  282. package/text/Text.js +0 -30
  283. package/text/Text.stories.tsx +0 -19
  284. package/text-input/TextInput.d.ts +0 -4
  285. package/text-input/TextInput.js +0 -796
  286. package/text-input/TextInput.stories.tsx +0 -474
  287. package/text-input/TextInput.test.js +0 -1712
  288. package/text-input/types.d.ts +0 -166
  289. package/text-input/types.js +0 -5
  290. package/textarea/Textarea.d.ts +0 -4
  291. package/textarea/Textarea.js +0 -286
  292. package/textarea/Textarea.stories.jsx +0 -157
  293. package/textarea/Textarea.test.js +0 -437
  294. package/textarea/types.d.ts +0 -137
  295. package/textarea/types.js +0 -5
  296. package/toggle-group/ToggleGroup.d.ts +0 -4
  297. package/toggle-group/ToggleGroup.js +0 -215
  298. package/toggle-group/ToggleGroup.stories.tsx +0 -173
  299. package/toggle-group/ToggleGroup.test.js +0 -156
  300. package/toggle-group/types.d.ts +0 -105
  301. package/toggle-group/types.js +0 -5
  302. package/useTheme.d.ts +0 -2
  303. package/useTheme.js +0 -22
  304. package/wizard/Wizard.d.ts +0 -4
  305. package/wizard/Wizard.js +0 -290
  306. package/wizard/Wizard.stories.tsx +0 -214
  307. package/wizard/Wizard.test.js +0 -141
  308. package/wizard/types.d.ts +0 -64
  309. 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 enable-background="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
- };