@dxc-technology/halstack-react 0.0.0-e33af28 → 0.0.0-e35a79c

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 (299) hide show
  1. package/README.md +46 -0
  2. package/dist/index.d.mts +6540 -0
  3. package/dist/index.d.ts +6540 -0
  4. package/dist/index.js +12938 -0
  5. package/dist/index.mjs +12881 -0
  6. package/package.json +74 -72
  7. package/BackgroundColorContext.d.ts +0 -10
  8. package/BackgroundColorContext.js +0 -47
  9. package/ThemeContext.d.ts +0 -10
  10. package/ThemeContext.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 -171
  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 -164
  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 -247
  59. package/checkbox/Checkbox.stories.tsx +0 -192
  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 -395
  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 -3
  143. package/link/Link.js +0 -153
  144. package/link/Link.stories.tsx +0 -151
  145. package/link/Link.test.js +0 -91
  146. package/link/types.d.ts +0 -70
  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 -66
  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/radio/Radio.d.ts +0 -4
  190. package/radio/Radio.js +0 -174
  191. package/radio/Radio.stories.tsx +0 -192
  192. package/radio/Radio.test.js +0 -71
  193. package/radio/types.d.ts +0 -54
  194. package/radio/types.js +0 -5
  195. package/radio-group/Radio.d.ts +0 -4
  196. package/radio-group/Radio.js +0 -141
  197. package/radio-group/RadioGroup.d.ts +0 -4
  198. package/radio-group/RadioGroup.js +0 -280
  199. package/radio-group/RadioGroup.stories.tsx +0 -100
  200. package/radio-group/RadioGroup.test.js +0 -695
  201. package/radio-group/types.d.ts +0 -114
  202. package/radio-group/types.js +0 -5
  203. package/resultsetTable/ResultsetTable.d.ts +0 -4
  204. package/resultsetTable/ResultsetTable.js +0 -254
  205. package/resultsetTable/ResultsetTable.stories.tsx +0 -275
  206. package/resultsetTable/ResultsetTable.test.js +0 -306
  207. package/resultsetTable/types.d.ts +0 -67
  208. package/resultsetTable/types.js +0 -5
  209. package/row/Row.d.ts +0 -3
  210. package/row/Row.js +0 -127
  211. package/row/Row.stories.tsx +0 -237
  212. package/row/types.d.ts +0 -28
  213. package/row/types.js +0 -5
  214. package/select/Icons.d.ts +0 -10
  215. package/select/Icons.js +0 -93
  216. package/select/Option.d.ts +0 -4
  217. package/select/Option.js +0 -110
  218. package/select/Select.d.ts +0 -4
  219. package/select/Select.js +0 -732
  220. package/select/Select.stories.tsx +0 -582
  221. package/select/Select.test.js +0 -2057
  222. package/select/types.d.ts +0 -194
  223. package/select/types.js +0 -5
  224. package/sidenav/Sidenav.d.ts +0 -9
  225. package/sidenav/Sidenav.js +0 -136
  226. package/sidenav/Sidenav.stories.tsx +0 -182
  227. package/sidenav/Sidenav.test.js +0 -56
  228. package/sidenav/types.d.ts +0 -50
  229. package/sidenav/types.js +0 -5
  230. package/slider/Slider.d.ts +0 -4
  231. package/slider/Slider.js +0 -318
  232. package/slider/Slider.stories.tsx +0 -177
  233. package/slider/Slider.test.js +0 -150
  234. package/slider/types.d.ts +0 -82
  235. package/slider/types.js +0 -5
  236. package/spinner/Spinner.d.ts +0 -4
  237. package/spinner/Spinner.js +0 -250
  238. package/spinner/Spinner.stories.jsx +0 -103
  239. package/spinner/Spinner.test.js +0 -64
  240. package/spinner/types.d.ts +0 -32
  241. package/spinner/types.js +0 -5
  242. package/stack/Stack.d.ts +0 -3
  243. package/stack/Stack.js +0 -97
  244. package/stack/Stack.stories.tsx +0 -164
  245. package/stack/types.d.ts +0 -24
  246. package/stack/types.js +0 -5
  247. package/switch/Switch.d.ts +0 -4
  248. package/switch/Switch.js +0 -192
  249. package/switch/Switch.stories.tsx +0 -160
  250. package/switch/Switch.test.js +0 -98
  251. package/switch/types.d.ts +0 -62
  252. package/switch/types.js +0 -5
  253. package/table/Table.d.ts +0 -4
  254. package/table/Table.js +0 -118
  255. package/table/Table.stories.jsx +0 -277
  256. package/table/Table.test.js +0 -26
  257. package/table/types.d.ts +0 -21
  258. package/table/types.js +0 -5
  259. package/tabs/Tabs.d.ts +0 -4
  260. package/tabs/Tabs.js +0 -211
  261. package/tabs/Tabs.stories.tsx +0 -118
  262. package/tabs/Tabs.test.js +0 -140
  263. package/tabs/types.d.ts +0 -82
  264. package/tabs/types.js +0 -5
  265. package/tag/Tag.d.ts +0 -4
  266. package/tag/Tag.js +0 -186
  267. package/tag/Tag.stories.tsx +0 -142
  268. package/tag/Tag.test.js +0 -60
  269. package/tag/types.d.ts +0 -69
  270. package/tag/types.js +0 -5
  271. package/text/Text.d.ts +0 -7
  272. package/text/Text.js +0 -30
  273. package/text/Text.stories.tsx +0 -19
  274. package/text-input/TextInput.d.ts +0 -4
  275. package/text-input/TextInput.js +0 -796
  276. package/text-input/TextInput.stories.tsx +0 -474
  277. package/text-input/TextInput.test.js +0 -1712
  278. package/text-input/types.d.ts +0 -166
  279. package/text-input/types.js +0 -5
  280. package/textarea/Textarea.d.ts +0 -4
  281. package/textarea/Textarea.js +0 -286
  282. package/textarea/Textarea.stories.jsx +0 -157
  283. package/textarea/Textarea.test.js +0 -437
  284. package/textarea/types.d.ts +0 -137
  285. package/textarea/types.js +0 -5
  286. package/toggle-group/ToggleGroup.d.ts +0 -4
  287. package/toggle-group/ToggleGroup.js +0 -215
  288. package/toggle-group/ToggleGroup.stories.tsx +0 -173
  289. package/toggle-group/ToggleGroup.test.js +0 -156
  290. package/toggle-group/types.d.ts +0 -105
  291. package/toggle-group/types.js +0 -5
  292. package/useTheme.d.ts +0 -2
  293. package/useTheme.js +0 -22
  294. package/wizard/Wizard.d.ts +0 -4
  295. package/wizard/Wizard.js +0 -286
  296. package/wizard/Wizard.stories.tsx +0 -214
  297. package/wizard/Wizard.test.js +0 -141
  298. package/wizard/types.d.ts +0 -64
  299. package/wizard/types.js +0 -5
@@ -1,395 +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
- return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
142
- theme: colorsTheme.dropdown
143
- }, /*#__PURE__*/_react["default"].createElement(DXCDropdownContainer, {
144
- margin: margin,
145
- size: size,
146
- disabled: disabled
147
- }, /*#__PURE__*/_react["default"].createElement("div", {
148
- onMouseOver: expandOnHover && !disabled ? handleClickListItem : undefined,
149
- onMouseOut: handleCloseOver,
150
- onFocus: handleCloseOver,
151
- onBlur: handleCloseOver
152
- }, /*#__PURE__*/_react["default"].createElement(DropdownTrigger, {
153
- opened: anchorEl === null ? false : true,
154
- onClick: handleClickListItem,
155
- disabled: disabled,
156
- label: label,
157
- caretHidden: caretHidden,
158
- margin: margin,
159
- size: size,
160
- ref: ref,
161
- tabIndex: tabIndex
162
- }, /*#__PURE__*/_react["default"].createElement(DropdownTriggerContainer, {
163
- iconPosition: iconPosition,
164
- caretHidden: caretHidden
165
- }, icon && /*#__PURE__*/_react["default"].createElement(ButtonIconContainer, {
166
- label: label,
167
- iconPosition: iconPosition,
168
- disabled: disabled
169
- }, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement(ButtonIcon, {
170
- src: icon
171
- }) : icon), /*#__PURE__*/_react["default"].createElement(DropdownTriggerLabel, {
172
- iconPosition: iconPosition,
173
- label: label
174
- }, label)), /*#__PURE__*/_react["default"].createElement(CaretIconContainer, {
175
- caretHidden: caretHidden,
176
- disabled: disabled
177
- }, !caretHidden && (anchorEl === null ? /*#__PURE__*/_react["default"].createElement(DownArrowIcon, null) : /*#__PURE__*/_react["default"].createElement(UpArrowIcon, null)))), /*#__PURE__*/_react["default"].createElement(DXCMenu, {
178
- anchorEl: anchorEl,
179
- open: Boolean(anchorEl),
180
- onClose: handleClose,
181
- getContentAnchorEl: null,
182
- anchorOrigin: {
183
- vertical: "bottom",
184
- horizontal: "left"
185
- },
186
- transformOrigin: {
187
- vertical: "top",
188
- horizontal: "left"
189
- },
190
- optionsIconPosition: optionsIconPosition,
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
- }, option.icon && /*#__PURE__*/_react["default"].createElement(ListIconContainer, {
213
- label: option.label,
214
- iconPosition: optionsIconPosition
215
- }, typeof option.icon === "string" ? /*#__PURE__*/_react["default"].createElement(ListIcon, {
216
- src: option.icon
217
- }) : option.icon), /*#__PURE__*/_react["default"].createElement("span", {
218
- className: "optionLabel"
219
- }, option.label));
220
- })))));
221
- }))));
222
- };
223
-
224
- var sizes = {
225
- small: "60px",
226
- medium: "240px",
227
- large: "480px",
228
- fillParent: "100%",
229
- fitContent: "unset"
230
- };
231
-
232
- var calculateWidth = function calculateWidth(margin, size) {
233
- if (size === "fillParent") {
234
- return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
235
- }
236
-
237
- return sizes[size];
238
- };
239
-
240
- 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) {
241
- return calculateWidth(props.margin, props.size);
242
- }, function (props) {
243
- return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
244
- }, function (props) {
245
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
246
- }, function (props) {
247
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
248
- }, function (props) {
249
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
250
- }, function (props) {
251
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
252
- });
253
-
254
- 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 flex-direction: ", ";\n justify-content: ", ";\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) {
255
- return calculateWidth(props.margin, props.size);
256
- }, function (props) {
257
- return props.theme.optionPaddingTop;
258
- }, function (props) {
259
- return props.theme.optionPaddingBottom;
260
- }, function (props) {
261
- return props.theme.optionPaddingLeft;
262
- }, function (props) {
263
- return props.theme.optionPaddingRight;
264
- }, function (props) {
265
- return "".concat(props.width, "px");
266
- }, function (props) {
267
- return props.theme.borderThickness;
268
- }, function (props) {
269
- return props.theme.borderStyle;
270
- }, function (props) {
271
- return props.theme.borderColor;
272
- }, function (props) {
273
- return props.theme.borderRadius;
274
- }, function (props) {
275
- return props.theme.borderRadius;
276
- }, function (props) {
277
- return props.theme.scrollBarTrackColor;
278
- }, function (props) {
279
- return props.theme.scrollBarThumbColor;
280
- }, function (props) {
281
- return props.optionsIconPosition === "after" && "row-reverse" || "row";
282
- }, function (props) {
283
- return props.optionsIconPosition === "after" && "flex-end" || "";
284
- }, function (props) {
285
- return props.theme.optionBackgroundColor;
286
- }, function (props) {
287
- return props.theme.optionFontFamily;
288
- }, function (props) {
289
- return props.theme.optionFontSize;
290
- }, function (props) {
291
- return props.theme.optionFontStyle;
292
- }, function (props) {
293
- return props.theme.optionFontWeight;
294
- }, function (props) {
295
- return props.theme.optionFontColor;
296
- }, function (props) {
297
- return props.theme.focusColor;
298
- }, function (props) {
299
- return props.theme.hoverOptionBackgroundColor;
300
- }, function (props) {
301
- return props.theme.activeOptionBackgroundColor;
302
- }, function (props) {
303
- return props.theme.focusColor;
304
- });
305
-
306
- 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) {
307
- return props.disabled ? "not-allowed" : "pointer";
308
- }, function (props) {
309
- return props.theme.buttonFontFamily;
310
- }, function (props) {
311
- return props.theme.buttonFontSize;
312
- }, function (props) {
313
- return props.theme.buttonFontStyle;
314
- }, function (props) {
315
- return props.theme.buttonFontWeight;
316
- }, function (props) {
317
- return props.theme.borderRadius;
318
- }, function (props) {
319
- return props.theme.borderThickness;
320
- }, function (props) {
321
- return props.theme.borderStyle;
322
- }, function (props) {
323
- return props.disabled ? props.theme.disabledBorderColor : props.theme.borderColor;
324
- }, function (props) {
325
- return props.label === "" ? "0px" : calculateWidth(props.margin, props.size);
326
- }, function (props) {
327
- return props.theme.buttonPaddingTop;
328
- }, function (props) {
329
- return props.theme.buttonPaddingBottom;
330
- }, function (props) {
331
- return props.theme.buttonPaddingLeft;
332
- }, function (props) {
333
- return props.theme.buttonPaddingRight;
334
- }, function (props) {
335
- return props.disabled ? props.theme.disabledButtonBackgroundColor : props.theme.buttonBackgroundColor;
336
- }, function (props) {
337
- return props.disabled ? props.theme.disabledColor : props.theme.buttonFontColor;
338
- }, function (props) {
339
- return props.opened ? "0px" : props.theme.borderRadius;
340
- }, function (props) {
341
- return props.opened ? "0px" : props.theme.borderRadius;
342
- }, function (props) {
343
- 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 ");
344
- });
345
-
346
- var DropdownTriggerLabel = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n text-align: left;\n text-overflow: ellipsis;\n overflow: hidden;\n"])));
347
-
348
- var DropdownTriggerContainer = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n flex-direction: ", ";\n margin-left: 0px;\n margin-right: 0px;\n width: ", ";\n white-space: nowrap;\n"])), function (props) {
349
- return props.iconPosition === "after" && "row-reverse" || "row";
350
- }, function (props) {
351
- return props.caretHidden ? "100%" : "calc(100% - 36px)";
352
- });
353
-
354
- var ButtonIcon = _styledComponents["default"].img(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])([""])));
355
-
356
- 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) {
357
- return props.theme.buttonIconSize;
358
- }, function (props) {
359
- return props.theme.buttonIconSize;
360
- }, function (props) {
361
- return props.iconPosition === "after" && props.label !== "" && props.theme.buttonIconSpacing || "0px";
362
- }, function (props) {
363
- return props.iconPosition === "before" && props.label !== "" && props.theme.buttonIconSpacing || "0px";
364
- }, function (props) {
365
- return props.disabled ? props.theme.disabledColor : props.theme.buttonIconColor;
366
- });
367
-
368
- var ListIcon = _styledComponents["default"].img(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])([""])));
369
-
370
- 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) {
371
- return props.theme.optionIconSize;
372
- }, function (props) {
373
- return props.theme.optionIconSize;
374
- }, function (props) {
375
- return props.iconPosition === "after" && props.label !== "" && props.theme.optionIconSpacing || "0px";
376
- }, function (props) {
377
- return props.iconPosition === "before" && props.label !== "" && props.theme.optionIconSpacing || "0px";
378
- }, function (props) {
379
- return props.theme.optionIconColor;
380
- });
381
-
382
- 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) {
383
- return props.caretHidden ? "none" : "inline-flex";
384
- }, function (props) {
385
- return props.theme.caretIconSpacing;
386
- }, function (props) {
387
- return props.disabled ? props.theme.disabledColor : props.theme.caretIconColor;
388
- }, function (props) {
389
- return props.theme.caretIconSize;
390
- }, function (props) {
391
- return props.theme.caretIconSize;
392
- });
393
-
394
- var _default = DxcDropdown;
395
- 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
- };