@dxc-technology/halstack-react 0.0.0-acb1a24 → 0.0.0-adde6ce

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 (351) hide show
  1. package/BackgroundColorContext.d.ts +10 -0
  2. package/BackgroundColorContext.js +47 -0
  3. package/ThemeContext.d.ts +15 -0
  4. package/ThemeContext.js +243 -0
  5. package/{dist/V3Select → V3Select}/V3Select.js +35 -129
  6. package/{dist/V3Select → V3Select}/index.d.ts +0 -0
  7. package/{dist/V3Textarea → V3Textarea}/V3Textarea.js +12 -16
  8. package/{dist/V3Textarea → V3Textarea}/index.d.ts +0 -0
  9. package/accordion/Accordion.d.ts +4 -0
  10. package/{dist/accordion → accordion}/Accordion.js +37 -132
  11. package/accordion/Accordion.stories.tsx +307 -0
  12. package/accordion/types.d.ts +68 -0
  13. package/accordion/types.js +5 -0
  14. package/accordion-group/AccordionGroup.d.ts +7 -0
  15. package/accordion-group/AccordionGroup.js +170 -0
  16. package/accordion-group/AccordionGroup.stories.tsx +225 -0
  17. package/accordion-group/types.d.ts +72 -0
  18. package/accordion-group/types.js +5 -0
  19. package/alert/Alert.d.ts +4 -0
  20. package/{dist/alert → alert}/Alert.js +40 -153
  21. package/alert/Alert.stories.tsx +170 -0
  22. package/alert/types.d.ts +49 -0
  23. package/alert/types.js +5 -0
  24. package/badge/Badge.js +59 -0
  25. package/box/Box.d.ts +4 -0
  26. package/{dist/box → box}/Box.js +15 -45
  27. package/box/Box.stories.tsx +132 -0
  28. package/box/types.d.ts +43 -0
  29. package/box/types.js +5 -0
  30. package/button/Button.d.ts +4 -0
  31. package/{dist/button → button}/Button.js +24 -83
  32. package/button/Button.stories.tsx +276 -0
  33. package/button/types.d.ts +57 -0
  34. package/button/types.js +5 -0
  35. package/card/Card.d.ts +4 -0
  36. package/{dist/card → card}/Card.js +34 -124
  37. package/card/Card.stories.tsx +201 -0
  38. package/card/ice-cream.jpg +0 -0
  39. package/card/types.d.ts +67 -0
  40. package/card/types.js +5 -0
  41. package/checkbox/Checkbox.d.ts +4 -0
  42. package/{dist/checkbox → checkbox}/Checkbox.js +15 -61
  43. package/checkbox/Checkbox.stories.tsx +192 -0
  44. package/checkbox/types.d.ts +60 -0
  45. package/checkbox/types.js +5 -0
  46. package/chip/Chip.d.ts +4 -0
  47. package/{dist/chip → chip}/Chip.js +22 -88
  48. package/chip/Chip.stories.tsx +121 -0
  49. package/chip/types.d.ts +53 -0
  50. package/chip/types.js +5 -0
  51. package/{dist/common → common}/OpenSans.css +0 -0
  52. package/{dist/common → common}/RequiredComponent.js +3 -11
  53. package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
  54. package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
  55. package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
  56. package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  57. package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
  58. package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
  59. package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
  60. package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
  61. package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
  62. package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  63. package/{dist/common → common}/utils.js +0 -0
  64. package/{dist/common → common}/variables.js +126 -88
  65. package/{dist/date → date}/Date.js +17 -23
  66. package/{dist/date → date}/index.d.ts +0 -0
  67. package/date-input/DateInput.d.ts +4 -0
  68. package/{dist/date-input → date-input}/DateInput.js +26 -68
  69. package/date-input/DateInput.stories.tsx +138 -0
  70. package/date-input/types.d.ts +100 -0
  71. package/date-input/types.js +5 -0
  72. package/dialog/Dialog.d.ts +4 -0
  73. package/{dist/dialog → dialog}/Dialog.js +24 -76
  74. package/dialog/Dialog.stories.tsx +212 -0
  75. package/dialog/types.d.ts +43 -0
  76. package/dialog/types.js +5 -0
  77. package/dropdown/Dropdown.d.ts +4 -0
  78. package/{dist/dropdown → dropdown}/Dropdown.js +45 -172
  79. package/dropdown/Dropdown.stories.tsx +247 -0
  80. package/dropdown/types.d.ts +89 -0
  81. package/dropdown/types.js +5 -0
  82. package/file-input/FileInput.d.ts +4 -0
  83. package/file-input/FileInput.js +590 -0
  84. package/file-input/FileInput.stories.tsx +507 -0
  85. package/file-input/FileItem.d.ts +14 -0
  86. package/file-input/FileItem.js +184 -0
  87. package/file-input/types.d.ts +112 -0
  88. package/file-input/types.js +5 -0
  89. package/footer/Footer.d.ts +4 -0
  90. package/footer/Footer.js +260 -0
  91. package/footer/Footer.stories.tsx +130 -0
  92. package/footer/Icons.d.ts +2 -0
  93. package/{dist/footer → footer}/Icons.js +15 -15
  94. package/footer/types.d.ts +65 -0
  95. package/footer/types.js +5 -0
  96. package/header/Header.d.ts +7 -0
  97. package/{dist/header → header}/Header.js +58 -204
  98. package/header/Header.stories.tsx +162 -0
  99. package/header/Icons.d.ts +2 -0
  100. package/{dist/header → header}/Icons.js +7 -32
  101. package/header/types.d.ts +47 -0
  102. package/header/types.js +5 -0
  103. package/heading/Heading.d.ts +4 -0
  104. package/{dist/heading → heading}/Heading.js +25 -96
  105. package/heading/Heading.stories.tsx +54 -0
  106. package/heading/types.d.ts +33 -0
  107. package/heading/types.js +5 -0
  108. package/{dist/input-text → input-text}/Icons.js +2 -2
  109. package/{dist/input-text → input-text}/InputText.js +38 -132
  110. package/{dist/input-text → input-text}/index.d.ts +1 -1
  111. package/layout/ApplicationLayout.d.ts +10 -0
  112. package/{dist/layout → layout}/ApplicationLayout.js +39 -141
  113. package/layout/ApplicationLayout.stories.tsx +171 -0
  114. package/{dist/layout → layout}/Icons.js +7 -7
  115. package/layout/types.d.ts +57 -0
  116. package/layout/types.js +5 -0
  117. package/link/Link.d.ts +3 -0
  118. package/{dist/link → link}/Link.js +19 -95
  119. package/link/Link.stories.tsx +146 -0
  120. package/link/types.d.ts +74 -0
  121. package/link/types.js +5 -0
  122. package/list/List.d.ts +8 -0
  123. package/list/List.js +47 -0
  124. package/list/List.stories.tsx +95 -0
  125. package/main.d.ts +48 -0
  126. package/{dist/main.js → main.js} +118 -82
  127. package/number-input/NumberInput.d.ts +4 -0
  128. package/number-input/NumberInput.js +83 -0
  129. package/number-input/NumberInput.stories.tsx +115 -0
  130. package/number-input/NumberInputContext.d.ts +4 -0
  131. package/{dist/number-input → number-input}/NumberInputContext.js +5 -2
  132. package/number-input/numberInputContextTypes.d.ts +19 -0
  133. package/number-input/numberInputContextTypes.js +5 -0
  134. package/number-input/types.d.ts +117 -0
  135. package/number-input/types.js +5 -0
  136. package/package.json +31 -18
  137. package/{dist/paginator → paginator}/Icons.js +9 -9
  138. package/paginator/Paginator.d.ts +4 -0
  139. package/paginator/Paginator.js +192 -0
  140. package/paginator/Paginator.stories.tsx +63 -0
  141. package/paginator/types.d.ts +38 -0
  142. package/paginator/types.js +5 -0
  143. package/password-input/PasswordInput.d.ts +4 -0
  144. package/{dist/password-input → password-input}/PasswordInput.js +37 -77
  145. package/password-input/PasswordInput.stories.tsx +131 -0
  146. package/password-input/types.d.ts +107 -0
  147. package/password-input/types.js +5 -0
  148. package/progress-bar/ProgressBar.d.ts +4 -0
  149. package/{dist/progress-bar → progress-bar}/ProgressBar.js +22 -94
  150. package/progress-bar/ProgressBar.stories.jsx +58 -0
  151. package/progress-bar/types.d.ts +37 -0
  152. package/progress-bar/types.js +5 -0
  153. package/radio/Radio.d.ts +4 -0
  154. package/{dist/radio → radio}/Radio.js +17 -52
  155. package/radio/Radio.stories.tsx +192 -0
  156. package/radio/types.d.ts +54 -0
  157. package/radio/types.js +5 -0
  158. package/radio-group/Radio.d.ts +4 -0
  159. package/radio-group/Radio.js +130 -0
  160. package/radio-group/RadioGroup.d.ts +4 -0
  161. package/radio-group/RadioGroup.js +268 -0
  162. package/radio-group/RadioGroup.stories.tsx +79 -0
  163. package/radio-group/types.d.ts +36 -0
  164. package/radio-group/types.js +5 -0
  165. package/resultsetTable/ResultsetTable.d.ts +4 -0
  166. package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +39 -146
  167. package/resultsetTable/ResultsetTable.stories.tsx +277 -0
  168. package/resultsetTable/types.d.ts +67 -0
  169. package/resultsetTable/types.js +5 -0
  170. package/row/Row.d.ts +11 -0
  171. package/row/Row.js +127 -0
  172. package/row/Row.stories.tsx +239 -0
  173. package/select/Select.d.ts +4 -0
  174. package/{dist/select → select}/Select.js +258 -491
  175. package/select/Select.stories.tsx +572 -0
  176. package/select/types.d.ts +170 -0
  177. package/select/types.js +5 -0
  178. package/sidenav/Sidenav.d.ts +9 -0
  179. package/{dist/sidenav → sidenav}/Sidenav.js +21 -64
  180. package/sidenav/Sidenav.stories.tsx +182 -0
  181. package/sidenav/types.d.ts +50 -0
  182. package/sidenav/types.js +5 -0
  183. package/slider/Slider.d.ts +4 -0
  184. package/{dist/slider → slider}/Slider.js +74 -161
  185. package/slider/Slider.stories.tsx +177 -0
  186. package/slider/types.d.ts +78 -0
  187. package/slider/types.js +5 -0
  188. package/spinner/Spinner.d.ts +4 -0
  189. package/spinner/Spinner.js +250 -0
  190. package/spinner/Spinner.stories.jsx +103 -0
  191. package/spinner/types.d.ts +32 -0
  192. package/spinner/types.js +5 -0
  193. package/stack/Stack.d.ts +10 -0
  194. package/stack/Stack.js +97 -0
  195. package/stack/Stack.stories.tsx +166 -0
  196. package/switch/Switch.d.ts +4 -0
  197. package/{dist/switch → switch}/Switch.js +28 -71
  198. package/switch/Switch.stories.tsx +160 -0
  199. package/switch/types.d.ts +58 -0
  200. package/switch/types.js +5 -0
  201. package/table/Table.d.ts +4 -0
  202. package/{dist/table → table}/Table.js +12 -26
  203. package/table/Table.stories.jsx +277 -0
  204. package/table/types.d.ts +21 -0
  205. package/table/types.js +5 -0
  206. package/tabs/Tabs.d.ts +4 -0
  207. package/tabs/Tabs.js +213 -0
  208. package/tabs/Tabs.stories.tsx +122 -0
  209. package/tabs/types.d.ts +70 -0
  210. package/tabs/types.js +5 -0
  211. package/tag/Tag.d.ts +4 -0
  212. package/tag/Tag.js +193 -0
  213. package/tag/Tag.stories.tsx +145 -0
  214. package/tag/types.d.ts +60 -0
  215. package/tag/types.js +5 -0
  216. package/text/Text.d.ts +7 -0
  217. package/text/Text.js +30 -0
  218. package/text/Text.stories.tsx +19 -0
  219. package/text-input/TextInput.d.ts +4 -0
  220. package/{dist/text-input → text-input}/TextInput.js +269 -457
  221. package/text-input/TextInput.stories.tsx +456 -0
  222. package/text-input/types.d.ts +159 -0
  223. package/text-input/types.js +5 -0
  224. package/textarea/Textarea.d.ts +4 -0
  225. package/{dist/textarea → textarea}/Textarea.js +38 -123
  226. package/textarea/Textarea.stories.jsx +136 -0
  227. package/textarea/types.d.ts +130 -0
  228. package/textarea/types.js +5 -0
  229. package/{dist/toggle → toggle}/Toggle.js +16 -50
  230. package/{dist/toggle → toggle}/index.d.ts +0 -0
  231. package/toggle-group/ToggleGroup.d.ts +4 -0
  232. package/{dist/toggle-group → toggle-group}/ToggleGroup.js +35 -148
  233. package/toggle-group/ToggleGroup.stories.tsx +173 -0
  234. package/toggle-group/types.d.ts +97 -0
  235. package/toggle-group/types.js +5 -0
  236. package/{dist/upload → upload}/Upload.js +11 -15
  237. package/upload/buttons-upload/ButtonsUpload.js +111 -0
  238. package/{dist/upload → upload}/buttons-upload/Icons.js +7 -7
  239. package/upload/dragAndDropArea/DragAndDropArea.js +225 -0
  240. package/{dist/upload → upload}/dragAndDropArea/Icons.js +6 -6
  241. package/upload/file-upload/FileToUpload.js +115 -0
  242. package/{dist/upload → upload}/file-upload/Icons.js +13 -13
  243. package/{dist/upload → upload}/files-upload/FilesToUpload.js +13 -27
  244. package/{dist/upload → upload}/index.d.ts +0 -0
  245. package/{dist/upload → upload}/transaction/Icons.js +31 -31
  246. package/upload/transaction/Transaction.js +104 -0
  247. package/upload/transactions/Transactions.js +94 -0
  248. package/useTheme.d.ts +2 -0
  249. package/{dist/useTheme.js → useTheme.js} +1 -1
  250. package/wizard/Wizard.d.ts +4 -0
  251. package/wizard/Wizard.js +281 -0
  252. package/wizard/Wizard.stories.tsx +224 -0
  253. package/wizard/types.d.ts +60 -0
  254. package/wizard/types.js +5 -0
  255. package/README.md +0 -66
  256. package/babel.config.js +0 -8
  257. package/dist/BackgroundColorContext.js +0 -46
  258. package/dist/ThemeContext.js +0 -250
  259. package/dist/accordion/index.d.ts +0 -28
  260. package/dist/accordion-group/AccordionGroup.js +0 -186
  261. package/dist/accordion-group/index.d.ts +0 -16
  262. package/dist/alert/index.d.ts +0 -51
  263. package/dist/badge/Badge.js +0 -63
  264. package/dist/box/index.d.ts +0 -25
  265. package/dist/button/index.d.ts +0 -24
  266. package/dist/card/index.d.ts +0 -22
  267. package/dist/checkbox/index.d.ts +0 -24
  268. package/dist/chip/index.d.ts +0 -22
  269. package/dist/date-input/index.d.ts +0 -95
  270. package/dist/dialog/index.d.ts +0 -18
  271. package/dist/dropdown/index.d.ts +0 -26
  272. package/dist/file-input/FileInput.js +0 -644
  273. package/dist/file-input/FileItem.js +0 -287
  274. package/dist/file-input/index.d.ts +0 -81
  275. package/dist/footer/Footer.js +0 -421
  276. package/dist/footer/index.d.ts +0 -25
  277. package/dist/header/index.d.ts +0 -25
  278. package/dist/heading/index.d.ts +0 -17
  279. package/dist/link/index.d.ts +0 -23
  280. package/dist/main.d.ts +0 -40
  281. package/dist/number-input/NumberInput.js +0 -136
  282. package/dist/number-input/index.d.ts +0 -113
  283. package/dist/paginator/Paginator.js +0 -305
  284. package/dist/paginator/index.d.ts +0 -20
  285. package/dist/password-input/index.d.ts +0 -94
  286. package/dist/progress-bar/index.d.ts +0 -18
  287. package/dist/radio/index.d.ts +0 -23
  288. package/dist/resultsetTable/index.d.ts +0 -19
  289. package/dist/select/index.d.ts +0 -53
  290. package/dist/sidenav/index.d.ts +0 -13
  291. package/dist/slider/index.d.ts +0 -29
  292. package/dist/spinner/Spinner.js +0 -381
  293. package/dist/spinner/index.d.ts +0 -17
  294. package/dist/switch/index.d.ts +0 -24
  295. package/dist/table/index.d.ts +0 -13
  296. package/dist/tabs/Tabs.js +0 -343
  297. package/dist/tabs/index.d.ts +0 -19
  298. package/dist/tag/Tag.js +0 -282
  299. package/dist/tag/index.d.ts +0 -24
  300. package/dist/text-input/index.d.ts +0 -135
  301. package/dist/textarea/index.d.ts +0 -117
  302. package/dist/toggle-group/index.d.ts +0 -21
  303. package/dist/upload/buttons-upload/ButtonsUpload.js +0 -135
  304. package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -329
  305. package/dist/upload/file-upload/FileToUpload.js +0 -189
  306. package/dist/upload/transaction/Transaction.js +0 -148
  307. package/dist/upload/transactions/Transactions.js +0 -138
  308. package/dist/wizard/Icons.js +0 -65
  309. package/dist/wizard/Wizard.js +0 -405
  310. package/dist/wizard/index.d.ts +0 -18
  311. package/test/Accordion.test.js +0 -33
  312. package/test/AccordionGroup.test.js +0 -125
  313. package/test/Alert.test.js +0 -53
  314. package/test/Box.test.js +0 -10
  315. package/test/Button.test.js +0 -18
  316. package/test/Card.test.js +0 -30
  317. package/test/Checkbox.test.js +0 -45
  318. package/test/Chip.test.js +0 -25
  319. package/test/Date.test.js +0 -395
  320. package/test/DateInput.test.js +0 -242
  321. package/test/Dialog.test.js +0 -23
  322. package/test/Dropdown.test.js +0 -145
  323. package/test/FileInput.test.js +0 -201
  324. package/test/Footer.test.js +0 -94
  325. package/test/Header.test.js +0 -34
  326. package/test/Heading.test.js +0 -83
  327. package/test/InputText.test.js +0 -240
  328. package/test/Link.test.js +0 -43
  329. package/test/NumberInput.test.js +0 -259
  330. package/test/Paginator.test.js +0 -181
  331. package/test/PasswordInput.test.js +0 -83
  332. package/test/ProgressBar.test.js +0 -35
  333. package/test/Radio.test.js +0 -37
  334. package/test/ResultsetTable.test.js +0 -330
  335. package/test/Select.test.js +0 -415
  336. package/test/Sidenav.test.js +0 -45
  337. package/test/Slider.test.js +0 -74
  338. package/test/Spinner.test.js +0 -32
  339. package/test/Switch.test.js +0 -45
  340. package/test/Table.test.js +0 -36
  341. package/test/Tabs.test.js +0 -109
  342. package/test/Tag.test.js +0 -32
  343. package/test/TextInput.test.js +0 -732
  344. package/test/Textarea.test.js +0 -193
  345. package/test/ToggleGroup.test.js +0 -85
  346. package/test/Upload.test.js +0 -60
  347. package/test/V3Select.test.js +0 -212
  348. package/test/V3TextArea.test.js +0 -51
  349. package/test/Wizard.test.js +0 -130
  350. package/test/mocks/pngMock.js +0 -1
  351. package/test/mocks/svgMock.js +0 -1
@@ -0,0 +1,68 @@
1
+ /// <reference types="react" />
2
+ declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ declare type Margin = {
4
+ top?: Space;
5
+ bottom?: Space;
6
+ left?: Space;
7
+ right?: Space;
8
+ };
9
+ declare type Padding = {
10
+ top?: Space;
11
+ bottom?: Space;
12
+ left?: Space;
13
+ right?: Space;
14
+ };
15
+ declare type SVG = React.SVGProps<SVGSVGElement> | React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
16
+ declare type Props = {
17
+ /**
18
+ * The panel label.
19
+ */
20
+ label: string;
21
+ /**
22
+ * Represents the state of the panel. When true, the component will be
23
+ * expanded. If undefined, the component will be uncontrolled and its
24
+ * value will be managed internally by the component.
25
+ */
26
+ isExpanded?: boolean;
27
+ /**
28
+ * Element used as the icon that will be placed next to panel label.
29
+ */
30
+ icon?: SVG;
31
+ /**
32
+ * @deprecated URL of the icon that will be placed next to panel label.
33
+ */
34
+ iconSrc?: string;
35
+ /**
36
+ * Assistive text to be placed on the right side of the panel.
37
+ */
38
+ assistiveText?: string;
39
+ /**
40
+ * If true, the component will be disabled.
41
+ */
42
+ disabled?: boolean;
43
+ /**
44
+ * This function will be called when the user clicks the accordion to expand or collapse
45
+ * the panel. The new state of the panel will be passed as a parameter.
46
+ */
47
+ onChange?: (isExpanded: boolean) => void;
48
+ /**
49
+ * The expanded panel of the accordion. This area can be used to render
50
+ * custom content.
51
+ */
52
+ children: React.ReactNode;
53
+ /**
54
+ * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
55
+ * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
56
+ */
57
+ margin?: Space | Margin;
58
+ /**
59
+ * Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
60
+ * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
61
+ */
62
+ padding?: Space | Padding;
63
+ /**
64
+ * Value of the tabindex.
65
+ */
66
+ tabIndex?: number;
67
+ };
68
+ export default Props;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import AccordionGroupPropsType, { AccordionPropsType } from "./types";
3
+ declare const DxcAccordionGroup: {
4
+ ({ indexActive, disabled, onActiveChange, margin, children, }: AccordionGroupPropsType): JSX.Element;
5
+ Accordion: ({ ...childProps }: AccordionPropsType) => JSX.Element;
6
+ };
7
+ export default DxcAccordionGroup;
@@ -0,0 +1,170 @@
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 _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
+
18
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
19
+
20
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
21
+
22
+ var _react = _interopRequireWildcard(require("react"));
23
+
24
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
25
+
26
+ var _Accordion = _interopRequireDefault(require("../accordion/Accordion"));
27
+
28
+ var _utils = require("../common/utils.js");
29
+
30
+ var _variables = require("../common/variables.js");
31
+
32
+ var _useTheme = _interopRequireDefault(require("../useTheme"));
33
+
34
+ var _templateObject;
35
+
36
+ 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); }
37
+
38
+ 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; }
39
+
40
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
41
+
42
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
43
+
44
+ var AccordionGroupAccordionContext = /*#__PURE__*/(0, _react.createContext)(null);
45
+
46
+ var AccordionGroupAccordion = function AccordionGroupAccordion(_ref) {
47
+ var childProps = (0, _extends2["default"])({}, _ref);
48
+
49
+ var _useContext = (0, _react.useContext)(AccordionGroupAccordionContext),
50
+ innerIsExpanded = _useContext.innerIsExpanded,
51
+ handlerActiveChange = _useContext.handlerActiveChange,
52
+ disabled = _useContext.disabled,
53
+ index = _useContext.index;
54
+
55
+ return /*#__PURE__*/_react["default"].createElement(_Accordion["default"], (0, _extends2["default"])({
56
+ isExpanded: innerIsExpanded === index,
57
+ onChange: function onChange() {
58
+ handlerActiveChange(index);
59
+ },
60
+ disabled: disabled
61
+ }, childProps), childProps.children);
62
+ };
63
+
64
+ var DxcAccordionGroup = function DxcAccordionGroup(_ref2) {
65
+ var indexActive = _ref2.indexActive,
66
+ _ref2$disabled = _ref2.disabled,
67
+ disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
68
+ onActiveChange = _ref2.onActiveChange,
69
+ margin = _ref2.margin,
70
+ children = _ref2.children;
71
+ var colorsTheme = (0, _useTheme["default"])();
72
+
73
+ var _useState = (0, _react.useState)(0),
74
+ _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
75
+ innerIsExpanded = _useState2[0],
76
+ setInnerIsExpanded = _useState2[1];
77
+
78
+ var handlerActiveChange = (0, _react.useCallback)(function (index) {
79
+ indexActive === undefined ? setInnerIsExpanded(function (prev) {
80
+ return index === prev ? -1 : index;
81
+ }) : setInnerIsExpanded(indexActive);
82
+ !disabled && (onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(index));
83
+ }, [disabled, indexActive, onActiveChange]);
84
+ var value = (0, _react.useMemo)(function () {
85
+ return {
86
+ innerIsExpanded: innerIsExpanded,
87
+ handlerActiveChange: handlerActiveChange,
88
+ disabled: disabled
89
+ };
90
+ }, [innerIsExpanded, disabled]);
91
+ (0, _react.useEffect)(function () {
92
+ setInnerIsExpanded(indexActive);
93
+ }, [indexActive]);
94
+ return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
95
+ theme: colorsTheme.accordion
96
+ }, /*#__PURE__*/_react["default"].createElement(AccordionGroupContainer, {
97
+ margin: margin,
98
+ disabled: disabled
99
+ }, (Array.isArray(children) ? children : [children]).filter(function (child) {
100
+ return child.type === AccordionGroupAccordion;
101
+ }).map(function (accordion, index) {
102
+ return /*#__PURE__*/_react["default"].createElement(AccordionGroupAccordionContext.Provider, {
103
+ value: _objectSpread({
104
+ index: index
105
+ }, value)
106
+ }, accordion);
107
+ })));
108
+ };
109
+
110
+ DxcAccordionGroup.Accordion = AccordionGroupAccordion;
111
+
112
+ var calculateWidth = function calculateWidth(margin) {
113
+ return "calc(100% - ".concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
114
+ };
115
+
116
+ var AccordionGroupContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-block;\n width: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n cursor: ", ";\n\n & > :not(div:last-child) {\n & > div:first-child {\n border-radius: 0;\n border-bottom: ", ";\n border-color: ", ";\n\n & > .Mui-expanded {\n border-radius: 0;\n }\n & > .MuiButtonBase-root {\n border-radius: 0;\n }\n }\n }\n\n & > div:first-child {\n & > div:first-child {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n border-bottom: ", ";\n border-color: ", ";\n\n & > .Mui-expanded {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n }\n & > .MuiButtonBase-root {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n }\n }\n }\n\n & > div:last-child {\n & > div:first-child {\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n\n & > .Mui-expanded {\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n & > .MuiButtonBase-root {\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n }\n }\n"])), function (props) {
117
+ return calculateWidth(props.margin);
118
+ }, function (_ref3) {
119
+ var margin = _ref3.margin;
120
+ return margin && (0, _typeof2["default"])(margin) !== "object" ? _variables.spaces[margin] : "0px";
121
+ }, function (_ref4) {
122
+ var margin = _ref4.margin;
123
+ return margin && (0, _typeof2["default"])(margin) === "object" && margin.top ? _variables.spaces[margin.top] : "";
124
+ }, function (_ref5) {
125
+ var margin = _ref5.margin;
126
+ return margin && (0, _typeof2["default"])(margin) === "object" && margin.right ? _variables.spaces[margin.right] : "";
127
+ }, function (_ref6) {
128
+ var margin = _ref6.margin;
129
+ return margin && (0, _typeof2["default"])(margin) === "object" && margin.bottom ? _variables.spaces[margin.bottom] : "";
130
+ }, function (_ref7) {
131
+ var margin = _ref7.margin;
132
+ return margin && (0, _typeof2["default"])(margin) === "object" && margin.left ? _variables.spaces[margin.left] : "";
133
+ }, function (props) {
134
+ return props.disabled ? "not-allowed" : "pointer";
135
+ }, function (props) {
136
+ return "".concat(props.theme.accordionGroupSeparatorBorderThickness, " ").concat(props.theme.accordionGroupSeparatorBorderStyle);
137
+ }, function (props) {
138
+ return props.theme.accordionGroupSeparatorBorderColor;
139
+ }, function (props) {
140
+ return props.theme.borderRadius;
141
+ }, function (props) {
142
+ return props.theme.borderRadius;
143
+ }, function (props) {
144
+ return "".concat(props.theme.accordionGroupSeparatorBorderThickness, " ").concat(props.theme.accordionGroupSeparatorBorderStyle);
145
+ }, function (props) {
146
+ return props.theme.accordionGroupSeparatorBorderColor;
147
+ }, function (props) {
148
+ return props.theme.borderRadius;
149
+ }, function (props) {
150
+ return props.theme.borderRadius;
151
+ }, function (props) {
152
+ return props.theme.borderRadius;
153
+ }, function (props) {
154
+ return props.theme.borderRadius;
155
+ }, function (props) {
156
+ return props.theme.borderRadius;
157
+ }, function (props) {
158
+ return props.theme.borderRadius;
159
+ }, function (props) {
160
+ return props.theme.borderRadius;
161
+ }, function (props) {
162
+ return props.theme.borderRadius;
163
+ }, function (props) {
164
+ return props.theme.borderRadius;
165
+ }, function (props) {
166
+ return props.theme.borderRadius;
167
+ });
168
+
169
+ var _default = DxcAccordionGroup;
170
+ exports["default"] = _default;
@@ -0,0 +1,225 @@
1
+ import React from "react";
2
+ import DxcAccordionGroup from "./AccordionGroup";
3
+ import Title from "../../.storybook/components/Title";
4
+ import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
+
6
+ export default {
7
+ title: "Accordion group",
8
+ component: DxcAccordionGroup,
9
+ };
10
+
11
+ export const Chromatic = () => (
12
+ <>
13
+ <Title title="States" theme="light" level={2} />
14
+ <ExampleContainer>
15
+ <Title title="Default" theme="light" level={4} />
16
+ <DxcAccordionGroup>
17
+ <DxcAccordionGroup.Accordion label="Accordion1" assistiveText="Assistive text" padding="medium">
18
+ <div>
19
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit
20
+ leo lobortis eget.
21
+ </div>
22
+ </DxcAccordionGroup.Accordion>
23
+ <DxcAccordionGroup.Accordion label="Accordion2" assistiveText="Assistive text" padding="medium">
24
+ <div>
25
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit
26
+ leo lobortis eget.
27
+ </div>
28
+ </DxcAccordionGroup.Accordion>
29
+ <DxcAccordionGroup.Accordion label="Accordion2" assistiveText="Assistive text" padding="medium">
30
+ <div>
31
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit
32
+ leo lobortis eget.
33
+ </div>
34
+ </DxcAccordionGroup.Accordion>
35
+ </DxcAccordionGroup>
36
+ </ExampleContainer>
37
+ <ExampleContainer>
38
+ <Title title="Expanded" theme="light" level={4} />
39
+ <DxcAccordionGroup indexActive={1}>
40
+ <DxcAccordionGroup.Accordion label="Accordion1" padding="medium">
41
+ <div>
42
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
43
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
44
+ ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
45
+ nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
46
+ anim id est laborum.
47
+ </div>
48
+ </DxcAccordionGroup.Accordion>
49
+ <DxcAccordionGroup.Accordion label="Accordion2" padding="medium">
50
+ <div>
51
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit
52
+ leo lobortis eget.
53
+ </div>
54
+ </DxcAccordionGroup.Accordion>
55
+ <DxcAccordionGroup.Accordion label="Accordion2" padding="medium">
56
+ <div>
57
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit
58
+ leo lobortis eget.
59
+ </div>
60
+ </DxcAccordionGroup.Accordion>
61
+ </DxcAccordionGroup>
62
+ </ExampleContainer>
63
+ <ExampleContainer>
64
+ <Title title="Disabled" theme="light" level={4} />
65
+ <DxcAccordionGroup disabled>
66
+ <DxcAccordionGroup.Accordion label="Accordion1" padding="medium">
67
+ <div>
68
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
69
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
70
+ ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
71
+ nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
72
+ anim id est laborum.
73
+ </div>
74
+ </DxcAccordionGroup.Accordion>
75
+ <DxcAccordionGroup.Accordion label="Accordion2" padding="medium">
76
+ <div>
77
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit
78
+ leo lobortis eget.
79
+ </div>
80
+ </DxcAccordionGroup.Accordion>
81
+ </DxcAccordionGroup>
82
+ </ExampleContainer>
83
+ <Title title="Margins" theme="light" level={2} />
84
+ <ExampleContainer>
85
+ <Title title="Xxsmall" theme="light" level={4} />
86
+ <DxcAccordionGroup margin="xxsmall">
87
+ <DxcAccordionGroup.Accordion label="Accordion1" padding="medium">
88
+ <div>
89
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
90
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
91
+ ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
92
+ nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
93
+ anim id est laborum.
94
+ </div>
95
+ </DxcAccordionGroup.Accordion>
96
+ <DxcAccordionGroup.Accordion label="Accordion2" padding="medium">
97
+ <div>
98
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit
99
+ leo lobortis eget.
100
+ </div>
101
+ </DxcAccordionGroup.Accordion>
102
+ </DxcAccordionGroup>
103
+ </ExampleContainer>
104
+ <ExampleContainer>
105
+ <Title title="Xsmall" theme="light" level={4} />
106
+ <DxcAccordionGroup margin="xsmall">
107
+ <DxcAccordionGroup.Accordion label="Accordion1" padding="medium">
108
+ <div>
109
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
110
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
111
+ ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
112
+ nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
113
+ anim id est laborum.
114
+ </div>
115
+ </DxcAccordionGroup.Accordion>
116
+ <DxcAccordionGroup.Accordion label="Accordion2" padding="medium">
117
+ <div>
118
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit
119
+ leo lobortis eget.
120
+ </div>
121
+ </DxcAccordionGroup.Accordion>
122
+ </DxcAccordionGroup>
123
+ </ExampleContainer>
124
+ <ExampleContainer>
125
+ <Title title="Small" theme="light" level={4} />
126
+ <DxcAccordionGroup margin="small">
127
+ <DxcAccordionGroup.Accordion label="Accordion1" padding="medium">
128
+ <div>
129
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
130
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
131
+ ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
132
+ nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
133
+ anim id est laborum.
134
+ </div>
135
+ </DxcAccordionGroup.Accordion>
136
+ <DxcAccordionGroup.Accordion label="Accordion2" padding="medium">
137
+ <div>
138
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit
139
+ leo lobortis eget.
140
+ </div>
141
+ </DxcAccordionGroup.Accordion>
142
+ </DxcAccordionGroup>
143
+ </ExampleContainer>
144
+ <ExampleContainer>
145
+ <Title title="Medium" theme="light" level={4} />
146
+ <DxcAccordionGroup margin="medium">
147
+ <DxcAccordionGroup.Accordion label="Accordion1" padding="medium">
148
+ <div>
149
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
150
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
151
+ ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
152
+ nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
153
+ anim id est laborum.
154
+ </div>
155
+ </DxcAccordionGroup.Accordion>
156
+ <DxcAccordionGroup.Accordion label="Accordion2" padding="medium">
157
+ <div>
158
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit
159
+ leo lobortis eget.
160
+ </div>
161
+ </DxcAccordionGroup.Accordion>
162
+ </DxcAccordionGroup>
163
+ </ExampleContainer>
164
+ <ExampleContainer>
165
+ <Title title="Large" theme="light" level={4} />
166
+ <DxcAccordionGroup margin="large">
167
+ <DxcAccordionGroup.Accordion label="Accordion1" padding="medium">
168
+ <div>
169
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
170
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
171
+ ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
172
+ nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
173
+ anim id est laborum.
174
+ </div>
175
+ </DxcAccordionGroup.Accordion>
176
+ <DxcAccordionGroup.Accordion label="Accordion2" padding="medium">
177
+ <div>
178
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit
179
+ leo lobortis eget.
180
+ </div>
181
+ </DxcAccordionGroup.Accordion>
182
+ </DxcAccordionGroup>
183
+ </ExampleContainer>
184
+ <ExampleContainer>
185
+ <Title title="Xlarge" theme="light" level={4} />
186
+ <DxcAccordionGroup margin="xlarge">
187
+ <DxcAccordionGroup.Accordion label="Accordion1" padding="medium">
188
+ <div>
189
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
190
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
191
+ ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
192
+ nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
193
+ anim id est laborum.
194
+ </div>
195
+ </DxcAccordionGroup.Accordion>
196
+ <DxcAccordionGroup.Accordion label="Accordion2" padding="medium">
197
+ <div>
198
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit
199
+ leo lobortis eget.
200
+ </div>
201
+ </DxcAccordionGroup.Accordion>
202
+ </DxcAccordionGroup>
203
+ </ExampleContainer>
204
+ <ExampleContainer>
205
+ <Title title="Xxlarge" theme="light" level={4} />
206
+ <DxcAccordionGroup margin="xxlarge">
207
+ <DxcAccordionGroup.Accordion label="Accordion1" padding="medium">
208
+ <div>
209
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
210
+ dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
211
+ ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
212
+ nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
213
+ anim id est laborum.
214
+ </div>
215
+ </DxcAccordionGroup.Accordion>
216
+ <DxcAccordionGroup.Accordion label="Accordion2" padding="medium">
217
+ <div>
218
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit
219
+ leo lobortis eget.
220
+ </div>
221
+ </DxcAccordionGroup.Accordion>
222
+ </DxcAccordionGroup>
223
+ </ExampleContainer>
224
+ </>
225
+ );
@@ -0,0 +1,72 @@
1
+ /// <reference types="react" />
2
+ declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ declare type Margin = {
4
+ top?: Space;
5
+ bottom?: Space;
6
+ left?: Space;
7
+ right?: Space;
8
+ };
9
+ declare type Padding = {
10
+ top?: Space;
11
+ bottom?: Space;
12
+ left?: Space;
13
+ right?: Space;
14
+ };
15
+ declare type SVG = React.SVGProps<SVGSVGElement> | React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
16
+ export declare type AccordionPropsType = {
17
+ /**
18
+ * The panel label.
19
+ */
20
+ label: string;
21
+ /**
22
+ * Element used as the icon that will be placed next to panel label.
23
+ */
24
+ icon?: SVG;
25
+ /**
26
+ * @deprecated URL of the icon that will be placed next to panel label.
27
+ */
28
+ iconSrc?: string;
29
+ /**
30
+ * Assistive text to be placed on the right side of the panel.
31
+ */
32
+ assistiveText?: string;
33
+ /**
34
+ * If true, the component will be disabled.
35
+ */
36
+ disabled?: boolean;
37
+ /**
38
+ * Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
39
+ * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
40
+ */
41
+ padding?: Space | Padding;
42
+ /**
43
+ * The expanded panel of the accordion. This area can be used to render
44
+ * custom content.
45
+ */
46
+ children: React.ReactNode;
47
+ };
48
+ declare type Props = {
49
+ /**
50
+ * The index of the active accordion. If undefined, the component will be uncontrolled and the active accordion will be managed internally by the component.
51
+ * If null, the component will be controlled and all accordions will be closed.
52
+ */
53
+ indexActive?: number;
54
+ /**
55
+ * If true, the component will be disabled.
56
+ */
57
+ disabled?: boolean;
58
+ /**
59
+ * This function will be called when the user clicks on an accordion. The index of the clicked accordion will be passed as a parameter.
60
+ */
61
+ onActiveChange?: (indexActive: number) => void;
62
+ /**
63
+ * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
64
+ * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
65
+ */
66
+ margin?: Space | Margin;
67
+ /**
68
+ * Customized accordion(s) that are allowed inside an Accordion Group.
69
+ */
70
+ children: React.ReactElement<AccordionPropsType>[] | React.ReactElement<AccordionPropsType>;
71
+ };
72
+ export default Props;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import AlertPropsType from "./types";
3
+ declare const DxcAlert: ({ type, mode, inlineText, onClose, children, margin, size, tabIndex, }: AlertPropsType) => JSX.Element;
4
+ export default DxcAlert;