@dxc-technology/halstack-react 0.0.0-b3de035 → 0.0.0-b3e1a2f

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 (366) 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/bleed/Bleed.d.ts +3 -0
  26. package/bleed/Bleed.js +84 -0
  27. package/bleed/Bleed.stories.tsx +342 -0
  28. package/bleed/types.d.ts +13 -0
  29. package/bleed/types.js +5 -0
  30. package/box/Box.d.ts +4 -0
  31. package/{dist/box → box}/Box.js +15 -45
  32. package/box/Box.stories.tsx +132 -0
  33. package/box/types.d.ts +43 -0
  34. package/box/types.js +5 -0
  35. package/button/Button.d.ts +4 -0
  36. package/{dist/button → button}/Button.js +26 -93
  37. package/button/Button.stories.tsx +274 -0
  38. package/button/types.d.ts +53 -0
  39. package/button/types.js +5 -0
  40. package/card/Card.d.ts +4 -0
  41. package/{dist/card → card}/Card.js +34 -124
  42. package/card/Card.stories.tsx +201 -0
  43. package/card/ice-cream.jpg +0 -0
  44. package/card/types.d.ts +67 -0
  45. package/card/types.js +5 -0
  46. package/checkbox/Checkbox.d.ts +4 -0
  47. package/{dist/checkbox → checkbox}/Checkbox.js +15 -61
  48. package/checkbox/Checkbox.stories.tsx +192 -0
  49. package/checkbox/types.d.ts +60 -0
  50. package/checkbox/types.js +5 -0
  51. package/chip/Chip.d.ts +4 -0
  52. package/{dist/chip → chip}/Chip.js +22 -88
  53. package/chip/Chip.stories.tsx +121 -0
  54. package/chip/types.d.ts +53 -0
  55. package/chip/types.js +5 -0
  56. package/{dist/common → common}/OpenSans.css +0 -0
  57. package/{dist/common → common}/RequiredComponent.js +3 -11
  58. package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
  59. package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
  60. package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
  61. package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  62. package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
  63. package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
  64. package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
  65. package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
  66. package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
  67. package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  68. package/{dist/common → common}/utils.js +0 -0
  69. package/{dist/common → common}/variables.js +126 -88
  70. package/{dist/date → date}/Date.js +17 -23
  71. package/{dist/date → date}/index.d.ts +0 -0
  72. package/date-input/DateInput.d.ts +4 -0
  73. package/{dist/date-input → date-input}/DateInput.js +32 -74
  74. package/date-input/DateInput.stories.tsx +138 -0
  75. package/date-input/types.d.ts +100 -0
  76. package/date-input/types.js +5 -0
  77. package/dialog/Dialog.d.ts +4 -0
  78. package/{dist/dialog → dialog}/Dialog.js +24 -76
  79. package/dialog/Dialog.stories.tsx +212 -0
  80. package/dialog/types.d.ts +43 -0
  81. package/dialog/types.js +5 -0
  82. package/dropdown/Dropdown.d.ts +4 -0
  83. package/{dist/dropdown → dropdown}/Dropdown.js +45 -172
  84. package/dropdown/Dropdown.stories.tsx +247 -0
  85. package/dropdown/types.d.ts +89 -0
  86. package/dropdown/types.js +5 -0
  87. package/file-input/FileInput.d.ts +4 -0
  88. package/file-input/FileInput.js +590 -0
  89. package/file-input/FileInput.stories.tsx +507 -0
  90. package/file-input/FileItem.d.ts +14 -0
  91. package/file-input/FileItem.js +184 -0
  92. package/file-input/types.d.ts +112 -0
  93. package/file-input/types.js +5 -0
  94. package/footer/Footer.d.ts +4 -0
  95. package/footer/Footer.js +260 -0
  96. package/footer/Footer.stories.tsx +130 -0
  97. package/footer/Icons.d.ts +2 -0
  98. package/{dist/footer → footer}/Icons.js +15 -15
  99. package/footer/types.d.ts +65 -0
  100. package/footer/types.js +5 -0
  101. package/header/Header.d.ts +7 -0
  102. package/{dist/header → header}/Header.js +58 -204
  103. package/header/Header.stories.tsx +162 -0
  104. package/header/Icons.d.ts +2 -0
  105. package/{dist/header → header}/Icons.js +7 -32
  106. package/header/types.d.ts +47 -0
  107. package/header/types.js +5 -0
  108. package/heading/Heading.d.ts +4 -0
  109. package/{dist/heading → heading}/Heading.js +25 -96
  110. package/heading/Heading.stories.tsx +54 -0
  111. package/heading/types.d.ts +33 -0
  112. package/heading/types.js +5 -0
  113. package/{dist/input-text → input-text}/Icons.js +2 -2
  114. package/{dist/input-text → input-text}/InputText.js +38 -132
  115. package/{dist/input-text → input-text}/index.d.ts +1 -1
  116. package/inset/Inset.d.ts +3 -0
  117. package/inset/Inset.js +84 -0
  118. package/inset/Inset.stories.tsx +229 -0
  119. package/inset/types.d.ts +13 -0
  120. package/inset/types.js +5 -0
  121. package/layout/ApplicationLayout.d.ts +10 -0
  122. package/{dist/layout → layout}/ApplicationLayout.js +39 -141
  123. package/layout/ApplicationLayout.stories.tsx +171 -0
  124. package/{dist/layout → layout}/Icons.js +7 -7
  125. package/layout/types.d.ts +57 -0
  126. package/layout/types.js +5 -0
  127. package/link/Link.d.ts +3 -0
  128. package/{dist/link → link}/Link.js +19 -95
  129. package/link/Link.stories.tsx +146 -0
  130. package/link/types.d.ts +74 -0
  131. package/link/types.js +5 -0
  132. package/list/List.d.ts +4 -0
  133. package/list/List.js +47 -0
  134. package/list/List.stories.tsx +95 -0
  135. package/list/types.d.ts +7 -0
  136. package/list/types.js +5 -0
  137. package/main.d.ts +48 -0
  138. package/{dist/main.js → main.js} +118 -82
  139. package/number-input/NumberInput.d.ts +4 -0
  140. package/number-input/NumberInput.js +83 -0
  141. package/number-input/NumberInput.stories.tsx +115 -0
  142. package/number-input/NumberInputContext.d.ts +4 -0
  143. package/{dist/number-input → number-input}/NumberInputContext.js +5 -2
  144. package/number-input/numberInputContextTypes.d.ts +19 -0
  145. package/number-input/numberInputContextTypes.js +5 -0
  146. package/number-input/types.d.ts +117 -0
  147. package/number-input/types.js +5 -0
  148. package/package.json +30 -17
  149. package/{dist/paginator → paginator}/Icons.js +9 -9
  150. package/paginator/Paginator.d.ts +4 -0
  151. package/paginator/Paginator.js +192 -0
  152. package/paginator/Paginator.stories.tsx +63 -0
  153. package/paginator/types.d.ts +38 -0
  154. package/paginator/types.js +5 -0
  155. package/password-input/PasswordInput.d.ts +4 -0
  156. package/{dist/password-input → password-input}/PasswordInput.js +37 -77
  157. package/password-input/PasswordInput.stories.tsx +131 -0
  158. package/password-input/types.d.ts +107 -0
  159. package/password-input/types.js +5 -0
  160. package/progress-bar/ProgressBar.d.ts +4 -0
  161. package/{dist/progress-bar → progress-bar}/ProgressBar.js +22 -94
  162. package/progress-bar/ProgressBar.stories.jsx +58 -0
  163. package/progress-bar/types.d.ts +37 -0
  164. package/progress-bar/types.js +5 -0
  165. package/radio/Radio.d.ts +4 -0
  166. package/{dist/radio → radio}/Radio.js +17 -52
  167. package/radio/Radio.stories.tsx +192 -0
  168. package/radio/types.d.ts +54 -0
  169. package/radio/types.js +5 -0
  170. package/radio-group/Radio.d.ts +4 -0
  171. package/radio-group/Radio.js +130 -0
  172. package/radio-group/RadioGroup.d.ts +4 -0
  173. package/radio-group/RadioGroup.js +268 -0
  174. package/radio-group/RadioGroup.stories.tsx +79 -0
  175. package/radio-group/types.d.ts +36 -0
  176. package/radio-group/types.js +5 -0
  177. package/resultsetTable/ResultsetTable.d.ts +4 -0
  178. package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +39 -146
  179. package/resultsetTable/ResultsetTable.stories.tsx +275 -0
  180. package/resultsetTable/types.d.ts +67 -0
  181. package/resultsetTable/types.js +5 -0
  182. package/row/Row.d.ts +3 -0
  183. package/row/Row.js +127 -0
  184. package/row/Row.stories.tsx +237 -0
  185. package/row/types.d.ts +10 -0
  186. package/row/types.js +5 -0
  187. package/select/Select.d.ts +4 -0
  188. package/{dist/select → select}/Select.js +271 -477
  189. package/select/Select.stories.tsx +572 -0
  190. package/select/types.d.ts +170 -0
  191. package/select/types.js +5 -0
  192. package/sidenav/Sidenav.d.ts +9 -0
  193. package/{dist/sidenav → sidenav}/Sidenav.js +21 -64
  194. package/sidenav/Sidenav.stories.tsx +182 -0
  195. package/sidenav/types.d.ts +50 -0
  196. package/sidenav/types.js +5 -0
  197. package/slider/Slider.d.ts +4 -0
  198. package/{dist/slider → slider}/Slider.js +74 -161
  199. package/slider/Slider.stories.tsx +177 -0
  200. package/slider/types.d.ts +78 -0
  201. package/slider/types.js +5 -0
  202. package/spinner/Spinner.d.ts +4 -0
  203. package/spinner/Spinner.js +250 -0
  204. package/spinner/Spinner.stories.jsx +103 -0
  205. package/spinner/types.d.ts +32 -0
  206. package/spinner/types.js +5 -0
  207. package/stack/Stack.d.ts +3 -0
  208. package/stack/Stack.js +97 -0
  209. package/stack/Stack.stories.tsx +164 -0
  210. package/stack/types.d.ts +9 -0
  211. package/stack/types.js +5 -0
  212. package/switch/Switch.d.ts +4 -0
  213. package/{dist/switch → switch}/Switch.js +28 -71
  214. package/switch/Switch.stories.tsx +160 -0
  215. package/switch/types.d.ts +58 -0
  216. package/switch/types.js +5 -0
  217. package/table/Table.d.ts +4 -0
  218. package/{dist/table → table}/Table.js +12 -26
  219. package/table/Table.stories.jsx +277 -0
  220. package/table/types.d.ts +21 -0
  221. package/table/types.js +5 -0
  222. package/tabs/Tabs.d.ts +4 -0
  223. package/tabs/Tabs.js +213 -0
  224. package/tabs/Tabs.stories.tsx +120 -0
  225. package/tabs/types.d.ts +78 -0
  226. package/tabs/types.js +5 -0
  227. package/tag/Tag.d.ts +4 -0
  228. package/tag/Tag.js +193 -0
  229. package/tag/Tag.stories.tsx +145 -0
  230. package/tag/types.d.ts +60 -0
  231. package/tag/types.js +5 -0
  232. package/text/Text.d.ts +7 -0
  233. package/text/Text.js +30 -0
  234. package/text/Text.stories.tsx +19 -0
  235. package/text-input/TextInput.d.ts +4 -0
  236. package/{dist/text-input → text-input}/TextInput.js +278 -458
  237. package/text-input/TextInput.stories.tsx +456 -0
  238. package/text-input/types.d.ts +159 -0
  239. package/text-input/types.js +5 -0
  240. package/textarea/Textarea.d.ts +4 -0
  241. package/{dist/textarea → textarea}/Textarea.js +38 -123
  242. package/textarea/Textarea.stories.jsx +136 -0
  243. package/textarea/types.d.ts +130 -0
  244. package/textarea/types.js +5 -0
  245. package/{dist/toggle → toggle}/Toggle.js +16 -50
  246. package/{dist/toggle → toggle}/index.d.ts +0 -0
  247. package/toggle-group/ToggleGroup.d.ts +4 -0
  248. package/{dist/toggle-group → toggle-group}/ToggleGroup.js +35 -148
  249. package/toggle-group/ToggleGroup.stories.tsx +173 -0
  250. package/toggle-group/types.d.ts +97 -0
  251. package/toggle-group/types.js +5 -0
  252. package/{dist/upload → upload}/Upload.js +11 -15
  253. package/upload/buttons-upload/ButtonsUpload.js +111 -0
  254. package/{dist/upload → upload}/buttons-upload/Icons.js +7 -7
  255. package/upload/dragAndDropArea/DragAndDropArea.js +225 -0
  256. package/{dist/upload → upload}/dragAndDropArea/Icons.js +6 -6
  257. package/upload/file-upload/FileToUpload.js +115 -0
  258. package/{dist/upload → upload}/file-upload/Icons.js +13 -13
  259. package/{dist/upload → upload}/files-upload/FilesToUpload.js +13 -27
  260. package/{dist/upload → upload}/index.d.ts +0 -0
  261. package/{dist/upload → upload}/transaction/Icons.js +31 -31
  262. package/upload/transaction/Transaction.js +104 -0
  263. package/upload/transactions/Transactions.js +94 -0
  264. package/useTheme.d.ts +2 -0
  265. package/{dist/useTheme.js → useTheme.js} +1 -1
  266. package/wizard/Wizard.d.ts +4 -0
  267. package/wizard/Wizard.js +281 -0
  268. package/wizard/Wizard.stories.tsx +224 -0
  269. package/wizard/types.d.ts +60 -0
  270. package/wizard/types.js +5 -0
  271. package/README.md +0 -66
  272. package/babel.config.js +0 -8
  273. package/dist/BackgroundColorContext.js +0 -46
  274. package/dist/ThemeContext.js +0 -250
  275. package/dist/accordion/index.d.ts +0 -28
  276. package/dist/accordion-group/AccordionGroup.js +0 -186
  277. package/dist/accordion-group/index.d.ts +0 -16
  278. package/dist/alert/index.d.ts +0 -51
  279. package/dist/badge/Badge.js +0 -63
  280. package/dist/box/index.d.ts +0 -25
  281. package/dist/button/index.d.ts +0 -24
  282. package/dist/card/index.d.ts +0 -22
  283. package/dist/checkbox/index.d.ts +0 -24
  284. package/dist/chip/index.d.ts +0 -22
  285. package/dist/date-input/index.d.ts +0 -95
  286. package/dist/dialog/index.d.ts +0 -18
  287. package/dist/dropdown/index.d.ts +0 -26
  288. package/dist/file-input/FileInput.js +0 -644
  289. package/dist/file-input/FileItem.js +0 -287
  290. package/dist/file-input/index.d.ts +0 -81
  291. package/dist/footer/Footer.js +0 -421
  292. package/dist/footer/index.d.ts +0 -25
  293. package/dist/header/index.d.ts +0 -25
  294. package/dist/heading/index.d.ts +0 -17
  295. package/dist/link/index.d.ts +0 -23
  296. package/dist/main.d.ts +0 -40
  297. package/dist/number-input/NumberInput.js +0 -136
  298. package/dist/number-input/index.d.ts +0 -113
  299. package/dist/paginator/Paginator.js +0 -283
  300. package/dist/paginator/index.d.ts +0 -20
  301. package/dist/password-input/index.d.ts +0 -94
  302. package/dist/progress-bar/index.d.ts +0 -18
  303. package/dist/radio/index.d.ts +0 -23
  304. package/dist/resultsetTable/index.d.ts +0 -19
  305. package/dist/select/index.d.ts +0 -53
  306. package/dist/sidenav/index.d.ts +0 -13
  307. package/dist/slider/index.d.ts +0 -29
  308. package/dist/spinner/Spinner.js +0 -381
  309. package/dist/spinner/index.d.ts +0 -17
  310. package/dist/switch/index.d.ts +0 -24
  311. package/dist/table/index.d.ts +0 -13
  312. package/dist/tabs/Tabs.js +0 -343
  313. package/dist/tabs/index.d.ts +0 -19
  314. package/dist/tag/Tag.js +0 -282
  315. package/dist/tag/index.d.ts +0 -24
  316. package/dist/text-input/index.d.ts +0 -135
  317. package/dist/textarea/index.d.ts +0 -117
  318. package/dist/toggle-group/index.d.ts +0 -21
  319. package/dist/upload/buttons-upload/ButtonsUpload.js +0 -135
  320. package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -329
  321. package/dist/upload/file-upload/FileToUpload.js +0 -189
  322. package/dist/upload/transaction/Transaction.js +0 -148
  323. package/dist/upload/transactions/Transactions.js +0 -138
  324. package/dist/wizard/Icons.js +0 -65
  325. package/dist/wizard/Wizard.js +0 -405
  326. package/dist/wizard/index.d.ts +0 -18
  327. package/test/Accordion.test.js +0 -33
  328. package/test/AccordionGroup.test.js +0 -125
  329. package/test/Alert.test.js +0 -53
  330. package/test/Box.test.js +0 -10
  331. package/test/Button.test.js +0 -18
  332. package/test/Card.test.js +0 -30
  333. package/test/Checkbox.test.js +0 -45
  334. package/test/Chip.test.js +0 -25
  335. package/test/Date.test.js +0 -395
  336. package/test/DateInput.test.js +0 -242
  337. package/test/Dialog.test.js +0 -23
  338. package/test/Dropdown.test.js +0 -145
  339. package/test/FileInput.test.js +0 -201
  340. package/test/Footer.test.js +0 -94
  341. package/test/Header.test.js +0 -34
  342. package/test/Heading.test.js +0 -83
  343. package/test/InputText.test.js +0 -248
  344. package/test/Link.test.js +0 -43
  345. package/test/NumberInput.test.js +0 -259
  346. package/test/Paginator.test.js +0 -177
  347. package/test/PasswordInput.test.js +0 -83
  348. package/test/ProgressBar.test.js +0 -35
  349. package/test/Radio.test.js +0 -37
  350. package/test/ResultsetTable.test.js +0 -329
  351. package/test/Sidenav.test.js +0 -45
  352. package/test/Slider.test.js +0 -74
  353. package/test/Spinner.test.js +0 -32
  354. package/test/Switch.test.js +0 -45
  355. package/test/Table.test.js +0 -36
  356. package/test/Tabs.test.js +0 -109
  357. package/test/Tag.test.js +0 -32
  358. package/test/TextInput.test.js +0 -732
  359. package/test/Textarea.test.js +0 -193
  360. package/test/ToggleGroup.test.js +0 -85
  361. package/test/Upload.test.js +0 -60
  362. package/test/V3Select.test.js +0 -212
  363. package/test/V3TextArea.test.js +0 -51
  364. package/test/Wizard.test.js +0 -130
  365. package/test/mocks/pngMock.js +0 -1
  366. 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;