@dxc-technology/halstack-react 0.0.0-4d89cae → 0.0.0-4e5859a

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 (264) hide show
  1. package/BackgroundColorContext.d.ts +10 -0
  2. package/BackgroundColorContext.js +7 -5
  3. package/ThemeContext.d.ts +15 -0
  4. package/ThemeContext.js +84 -91
  5. package/V3Select/V3Select.js +35 -129
  6. package/V3Textarea/V3Textarea.js +12 -16
  7. package/accordion/Accordion.d.ts +4 -0
  8. package/accordion/Accordion.js +37 -132
  9. package/accordion/Accordion.stories.tsx +300 -0
  10. package/accordion/types.d.ts +68 -0
  11. package/accordion/types.js +5 -0
  12. package/accordion-group/AccordionGroup.d.ts +7 -0
  13. package/accordion-group/AccordionGroup.js +66 -82
  14. package/accordion-group/AccordionGroup.stories.tsx +225 -0
  15. package/accordion-group/types.d.ts +72 -0
  16. package/accordion-group/types.js +5 -0
  17. package/alert/Alert.d.ts +4 -0
  18. package/alert/Alert.js +40 -153
  19. package/alert/Alert.stories.tsx +170 -0
  20. package/alert/types.d.ts +49 -0
  21. package/alert/types.js +5 -0
  22. package/badge/Badge.js +10 -14
  23. package/box/Box.d.ts +4 -0
  24. package/box/Box.js +15 -45
  25. package/box/Box.stories.tsx +132 -0
  26. package/box/types.d.ts +43 -0
  27. package/box/types.js +5 -0
  28. package/button/Button.d.ts +4 -0
  29. package/button/Button.js +24 -83
  30. package/button/Button.stories.tsx +276 -0
  31. package/button/types.d.ts +57 -0
  32. package/button/types.js +5 -0
  33. package/card/Card.d.ts +4 -0
  34. package/card/Card.js +34 -124
  35. package/card/Card.stories.tsx +201 -0
  36. package/card/ice-cream.jpg +0 -0
  37. package/card/types.d.ts +67 -0
  38. package/card/types.js +5 -0
  39. package/checkbox/Checkbox.d.ts +4 -0
  40. package/checkbox/Checkbox.js +15 -61
  41. package/checkbox/Checkbox.stories.tsx +192 -0
  42. package/checkbox/types.d.ts +60 -0
  43. package/checkbox/types.js +5 -0
  44. package/chip/Chip.d.ts +4 -0
  45. package/chip/Chip.js +22 -88
  46. package/chip/Chip.stories.tsx +121 -0
  47. package/chip/types.d.ts +53 -0
  48. package/chip/types.js +5 -0
  49. package/common/RequiredComponent.js +3 -11
  50. package/common/variables.js +52 -45
  51. package/date/Date.js +17 -23
  52. package/date-input/DateInput.d.ts +4 -0
  53. package/date-input/DateInput.js +26 -68
  54. package/date-input/DateInput.stories.tsx +138 -0
  55. package/date-input/types.d.ts +100 -0
  56. package/date-input/types.js +5 -0
  57. package/dialog/Dialog.d.ts +4 -0
  58. package/dialog/Dialog.js +22 -75
  59. package/dialog/Dialog.stories.tsx +212 -0
  60. package/dialog/types.d.ts +43 -0
  61. package/dialog/types.js +5 -0
  62. package/dropdown/Dropdown.d.ts +4 -0
  63. package/dropdown/Dropdown.js +45 -172
  64. package/dropdown/Dropdown.stories.tsx +247 -0
  65. package/dropdown/types.d.ts +89 -0
  66. package/dropdown/types.js +5 -0
  67. package/file-input/FileInput.d.ts +4 -0
  68. package/file-input/FileInput.js +98 -221
  69. package/file-input/FileItem.d.ts +14 -0
  70. package/file-input/FileItem.js +40 -143
  71. package/file-input/types.d.ts +112 -0
  72. package/file-input/types.js +5 -0
  73. package/footer/Footer.d.ts +4 -0
  74. package/footer/Footer.js +46 -207
  75. package/footer/Footer.stories.tsx +130 -0
  76. package/footer/Icons.d.ts +2 -0
  77. package/footer/Icons.js +15 -15
  78. package/footer/types.d.ts +65 -0
  79. package/footer/types.js +5 -0
  80. package/header/Header.d.ts +7 -0
  81. package/header/Header.js +58 -204
  82. package/header/Header.stories.tsx +162 -0
  83. package/header/Icons.d.ts +2 -0
  84. package/header/Icons.js +7 -32
  85. package/header/types.d.ts +47 -0
  86. package/header/types.js +5 -0
  87. package/heading/Heading.d.ts +4 -0
  88. package/heading/Heading.js +25 -96
  89. package/heading/Heading.stories.tsx +53 -0
  90. package/heading/types.d.ts +33 -0
  91. package/heading/types.js +5 -0
  92. package/input-text/Icons.js +2 -2
  93. package/input-text/InputText.js +35 -129
  94. package/layout/ApplicationLayout.d.ts +10 -0
  95. package/layout/ApplicationLayout.js +39 -141
  96. package/layout/ApplicationLayout.stories.tsx +171 -0
  97. package/layout/Icons.js +7 -7
  98. package/layout/types.d.ts +57 -0
  99. package/layout/types.js +5 -0
  100. package/link/Link.d.ts +3 -0
  101. package/link/Link.js +19 -95
  102. package/link/Link.stories.tsx +146 -0
  103. package/link/types.d.ts +74 -0
  104. package/link/types.js +5 -0
  105. package/list/List.d.ts +8 -0
  106. package/list/List.js +47 -0
  107. package/list/List.stories.tsx +85 -0
  108. package/main.d.ts +48 -40
  109. package/main.js +118 -82
  110. package/number-input/NumberInput.d.ts +4 -0
  111. package/number-input/NumberInput.js +10 -63
  112. package/number-input/NumberInput.stories.tsx +115 -0
  113. package/number-input/NumberInputContext.d.ts +4 -0
  114. package/number-input/NumberInputContext.js +5 -2
  115. package/number-input/numberInputContextTypes.d.ts +19 -0
  116. package/number-input/numberInputContextTypes.js +5 -0
  117. package/number-input/types.d.ts +117 -0
  118. package/number-input/types.js +5 -0
  119. package/package.json +15 -12
  120. package/paginator/Icons.js +9 -9
  121. package/paginator/Paginator.d.ts +4 -0
  122. package/paginator/Paginator.js +26 -139
  123. package/paginator/Paginator.stories.tsx +63 -0
  124. package/paginator/types.d.ts +38 -0
  125. package/paginator/types.js +5 -0
  126. package/password-input/PasswordInput.d.ts +4 -0
  127. package/password-input/PasswordInput.js +37 -77
  128. package/password-input/PasswordInput.stories.tsx +131 -0
  129. package/password-input/types.d.ts +107 -0
  130. package/password-input/types.js +5 -0
  131. package/progress-bar/ProgressBar.d.ts +4 -0
  132. package/progress-bar/ProgressBar.js +22 -94
  133. package/progress-bar/ProgressBar.stories.jsx +58 -0
  134. package/progress-bar/types.d.ts +37 -0
  135. package/progress-bar/types.js +5 -0
  136. package/radio/Radio.d.ts +4 -0
  137. package/radio/Radio.js +17 -52
  138. package/radio/Radio.stories.tsx +192 -0
  139. package/radio/types.d.ts +54 -0
  140. package/radio/types.js +5 -0
  141. package/resultsetTable/ResultsetTable.d.ts +4 -0
  142. package/resultsetTable/ResultsetTable.js +39 -146
  143. package/resultsetTable/ResultsetTable.stories.tsx +276 -0
  144. package/resultsetTable/types.d.ts +67 -0
  145. package/resultsetTable/types.js +5 -0
  146. package/row/Row.d.ts +11 -0
  147. package/row/Row.js +124 -0
  148. package/row/Row.stories.tsx +223 -0
  149. package/select/Select.d.ts +4 -0
  150. package/select/Select.js +173 -448
  151. package/select/Select.stories.tsx +572 -0
  152. package/select/types.d.ts +170 -0
  153. package/select/types.js +5 -0
  154. package/sidenav/Sidenav.d.ts +9 -0
  155. package/sidenav/Sidenav.js +21 -64
  156. package/sidenav/Sidenav.stories.tsx +165 -0
  157. package/sidenav/types.d.ts +50 -0
  158. package/sidenav/types.js +5 -0
  159. package/slider/Slider.d.ts +4 -0
  160. package/slider/Slider.js +74 -161
  161. package/slider/Slider.stories.tsx +177 -0
  162. package/slider/types.d.ts +78 -0
  163. package/slider/types.js +5 -0
  164. package/spinner/Spinner.d.ts +4 -0
  165. package/spinner/Spinner.js +45 -176
  166. package/spinner/Spinner.stories.jsx +102 -0
  167. package/spinner/types.d.ts +32 -0
  168. package/spinner/types.js +5 -0
  169. package/stack/Stack.d.ts +10 -0
  170. package/stack/Stack.js +94 -0
  171. package/stack/Stack.stories.tsx +150 -0
  172. package/switch/Switch.d.ts +4 -0
  173. package/switch/Switch.js +28 -71
  174. package/switch/Switch.stories.tsx +160 -0
  175. package/switch/types.d.ts +58 -0
  176. package/switch/types.js +5 -0
  177. package/table/Table.d.ts +4 -0
  178. package/table/Table.js +12 -26
  179. package/table/Table.stories.jsx +276 -0
  180. package/table/types.d.ts +21 -0
  181. package/table/types.js +5 -0
  182. package/tabs/Tabs.d.ts +4 -0
  183. package/tabs/Tabs.js +32 -162
  184. package/tabs/Tabs.stories.tsx +121 -0
  185. package/tabs/types.d.ts +70 -0
  186. package/tabs/types.js +5 -0
  187. package/tag/Tag.d.ts +4 -0
  188. package/tag/Tag.js +38 -127
  189. package/tag/Tag.stories.tsx +145 -0
  190. package/tag/types.d.ts +60 -0
  191. package/tag/types.js +5 -0
  192. package/text/Text.d.ts +7 -0
  193. package/text/Text.js +30 -0
  194. package/text/Text.stories.tsx +19 -0
  195. package/text-input/TextInput.d.ts +4 -0
  196. package/text-input/TextInput.js +134 -340
  197. package/text-input/TextInput.stories.tsx +456 -0
  198. package/text-input/types.d.ts +159 -0
  199. package/text-input/types.js +5 -0
  200. package/textarea/Textarea.d.ts +4 -0
  201. package/textarea/Textarea.js +38 -123
  202. package/textarea/Textarea.stories.jsx +135 -0
  203. package/textarea/types.d.ts +130 -0
  204. package/textarea/types.js +5 -0
  205. package/toggle/Toggle.js +16 -50
  206. package/toggle-group/ToggleGroup.d.ts +4 -0
  207. package/toggle-group/ToggleGroup.js +35 -148
  208. package/toggle-group/ToggleGroup.stories.tsx +173 -0
  209. package/toggle-group/types.d.ts +97 -0
  210. package/toggle-group/types.js +5 -0
  211. package/upload/Upload.js +11 -15
  212. package/upload/buttons-upload/ButtonsUpload.js +15 -39
  213. package/upload/buttons-upload/Icons.js +7 -7
  214. package/upload/dragAndDropArea/DragAndDropArea.js +26 -130
  215. package/upload/dragAndDropArea/Icons.js +6 -6
  216. package/upload/file-upload/FileToUpload.js +17 -91
  217. package/upload/file-upload/Icons.js +13 -13
  218. package/upload/files-upload/FilesToUpload.js +13 -27
  219. package/upload/transaction/Icons.js +31 -31
  220. package/upload/transaction/Transaction.js +19 -63
  221. package/upload/transactions/Transactions.js +14 -58
  222. package/useTheme.d.ts +2 -0
  223. package/useTheme.js +1 -1
  224. package/wizard/Wizard.d.ts +4 -0
  225. package/wizard/Wizard.js +90 -214
  226. package/wizard/Wizard.stories.tsx +224 -0
  227. package/wizard/types.d.ts +60 -0
  228. package/wizard/types.js +5 -0
  229. package/accordion/index.d.ts +0 -28
  230. package/accordion-group/index.d.ts +0 -16
  231. package/alert/index.d.ts +0 -51
  232. package/box/index.d.ts +0 -25
  233. package/button/Button.stories.js +0 -27
  234. package/button/index.d.ts +0 -24
  235. package/card/index.d.ts +0 -22
  236. package/checkbox/index.d.ts +0 -24
  237. package/chip/index.d.ts +0 -22
  238. package/date-input/index.d.ts +0 -95
  239. package/dialog/index.d.ts +0 -18
  240. package/dropdown/index.d.ts +0 -26
  241. package/file-input/index.d.ts +0 -81
  242. package/footer/index.d.ts +0 -25
  243. package/header/index.d.ts +0 -25
  244. package/heading/index.d.ts +0 -17
  245. package/link/index.d.ts +0 -23
  246. package/number-input/index.d.ts +0 -113
  247. package/paginator/index.d.ts +0 -20
  248. package/password-input/index.d.ts +0 -94
  249. package/progress-bar/index.d.ts +0 -18
  250. package/radio/index.d.ts +0 -23
  251. package/resultsetTable/index.d.ts +0 -19
  252. package/select/index.d.ts +0 -131
  253. package/sidenav/index.d.ts +0 -13
  254. package/slider/index.d.ts +0 -29
  255. package/spinner/index.d.ts +0 -17
  256. package/switch/index.d.ts +0 -24
  257. package/table/index.d.ts +0 -13
  258. package/tabs/index.d.ts +0 -19
  259. package/tag/index.d.ts +0 -24
  260. package/text-input/index.d.ts +0 -135
  261. package/textarea/index.d.ts +0 -117
  262. package/toggle-group/index.d.ts +0 -21
  263. package/wizard/Icons.js +0 -65
  264. package/wizard/index.d.ts +0 -18
@@ -1,16 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
-
5
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
4
 
5
+ var _typeof3 = require("@babel/runtime/helpers/typeof");
6
+
7
7
  Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
10
  exports["default"] = void 0;
11
11
 
12
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
-
14
12
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
13
 
16
14
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
@@ -29,121 +27,51 @@ var _ExpansionPanelDetails = _interopRequireDefault(require("@material-ui/core/E
29
27
 
30
28
  var _ExpandMore = _interopRequireDefault(require("@material-ui/icons/ExpandMore"));
31
29
 
32
- var _propTypes = _interopRequireDefault(require("prop-types"));
33
-
34
30
  var _utils = require("../common/utils.js");
35
31
 
36
32
  var _variables = require("../common/variables.js");
37
33
 
38
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
39
-
40
- var _BackgroundColorContext = require("../BackgroundColorContext.js");
41
-
42
- function _templateObject7() {
43
- var data = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n color: ", ";\n"]);
44
-
45
- _templateObject7 = function _templateObject7() {
46
- return data;
47
- };
48
-
49
- return data;
50
- }
34
+ var _useTheme = _interopRequireDefault(require("../useTheme"));
51
35
 
52
- function _templateObject6() {
53
- var data = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n color: ", ";\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
36
+ var _BackgroundColorContext = require("../BackgroundColorContext");
54
37
 
55
- _templateObject6 = function _templateObject6() {
56
- return data;
57
- };
58
-
59
- return data;
60
- }
61
-
62
- function _templateObject5() {
63
- var data = (0, _taggedTemplateLiteral2["default"])(["\n padding-left: ", ";\n padding-right: ", ";\n font-size: ", ";\n font-family: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n flex: 1;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: ", ";\n text-align: end;\n"]);
64
-
65
- _templateObject5 = function _templateObject5() {
66
- return data;
67
- };
68
-
69
- return data;
70
- }
71
-
72
- function _templateObject4() {
73
- var data = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\n"]);
74
-
75
- _templateObject4 = function _templateObject4() {
76
- return data;
77
- };
38
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
78
39
 
79
- return data;
80
- }
40
+ 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); }
81
41
 
82
- function _templateObject3() {
83
- var data = (0, _taggedTemplateLiteral2["default"])([""]);
84
-
85
- _templateObject3 = function _templateObject3() {
86
- return data;
87
- };
88
-
89
- return data;
90
- }
91
-
92
- function _templateObject2() {
93
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row-reverse;\n align-items: center;\n padding-left: ", ";\n padding-right: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n"]);
94
-
95
- _templateObject2 = function _templateObject2() {
96
- return data;
97
- };
98
-
99
- return data;
100
- }
101
-
102
- function _templateObject() {
103
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n min-width: 280px;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n width: ", ";\n cursor: ", ";\n\n .MuiPaper-root {\n min-width: 0;\n display: flex;\n left: 85px;\n background-color: ", " !important;\n box-shadow: ", ";\n position: static;\n width: 100%;\n border-radius: ", ";\n\n &.Mui-expanded {\n border-radius: ", ";\n }\n &.MuiExpansionPanel-root {\n display: flex;\n flex-direction: column;\n min-height: 48px;\n }\n &.MuiExpansionPanel-rounded {\n border-radius: ", ";\n }\n .MuiButtonBase-root.MuiExpansionPanelSummary-root {\n min-height: 48px;\n height: 48px;\n\n :focus {\n outline-color: ", ";\n outline-style: ", ";\n outline-width: ", ";\n background-color: ", ";\n }\n :hover {\n background-color: ", ";\n }\n :active {\n background-color: ", ";\n }\n &.Mui-disabled {\n opacity: 1;\n }\n }\n .MuiButtonBase-root {\n border-radius: ", ";\n\n &.Mui-expanded {\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n .MuiSvgIcon-root {\n opacity: 1;\n }\n }\n &.MuiIconButton-root {\n height: auto;\n }\n .MuiExpansionPanelSummary-content {\n padding-top: ", ";\n padding-bottom: ", ";\n padding-right: ", ";\n padding-left: ", ";\n min-width: 0;\n align-items: baseline;\n &.Mui-expanded {\n div:nth-child(2) {\n opacity: 1;\n }\n }\n :hover {\n div {\n opacity: 1;\n }\n }\n }\n }\n .MuiTouchRipple-root {\n display: none;\n }\n }\n .MuiCollapse-hidden {\n display: none;\n }\n .MuiCollapse-container {\n border-radius: 0px 0px 4px 4px;\n cursor: default;\n width: 100%;\n }\n .MuiIconButton-label {\n & > .MuiSvgIcon-root {\n color: ", ";\n }\n }\n .MuiExpansionPanelDetails-root {\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n }\n"]);
104
-
105
- _templateObject = function _templateObject() {
106
- return data;
107
- };
108
-
109
- return data;
110
- }
42
+ 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; }
111
43
 
112
44
  var DxcAccordion = function DxcAccordion(_ref) {
113
45
  var _ref$label = _ref.label,
114
46
  label = _ref$label === void 0 ? "" : _ref$label,
115
- _ref$iconSrc = _ref.iconSrc,
116
- iconSrc = _ref$iconSrc === void 0 ? "" : _ref$iconSrc,
47
+ isExpanded = _ref.isExpanded,
48
+ iconSrc = _ref.iconSrc,
117
49
  icon = _ref.icon,
118
50
  _ref$assistiveText = _ref.assistiveText,
119
51
  assistiveText = _ref$assistiveText === void 0 ? "" : _ref$assistiveText,
120
52
  _ref$disabled = _ref.disabled,
121
53
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
122
- _ref$onChange = _ref.onChange,
123
- onChange = _ref$onChange === void 0 ? "" : _ref$onChange,
124
- isExpanded = _ref.isExpanded,
54
+ onChange = _ref.onChange,
125
55
  children = _ref.children,
126
56
  margin = _ref.margin,
127
57
  padding = _ref.padding,
128
58
  _ref$tabIndex = _ref.tabIndex,
129
59
  tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
130
60
 
131
- var _React$useState = _react["default"].useState(false),
132
- _React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
133
- innerIsExpanded = _React$useState2[0],
134
- setInnerIsExpanded = _React$useState2[1];
135
-
136
- var _useState = (0, _react.useState)(),
61
+ var _useState = (0, _react.useState)(false),
137
62
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
138
- isResponsive = _useState2[0],
139
- setIsResponsive = _useState2[1];
63
+ innerIsExpanded = _useState2[0],
64
+ setInnerIsExpanded = _useState2[1];
65
+
66
+ var _useState3 = (0, _react.useState)(false),
67
+ _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
68
+ isResponsive = _useState4[0],
69
+ setIsResponsive = _useState4[1];
140
70
 
141
71
  var colorsTheme = (0, _useTheme["default"])();
142
72
 
143
73
  var handleResize = function handleResize(width) {
144
- if (width) {
145
- if (width <= _variables.responsiveSizes.tablet ? setIsResponsive(true) : setIsResponsive(false)) ;
146
- }
74
+ width && width <= _variables.responsiveSizes.tablet ? setIsResponsive(true) : setIsResponsive(false);
147
75
  };
148
76
 
149
77
  var handleEventListener = function handleEventListener() {
@@ -168,32 +96,32 @@ var DxcAccordion = function DxcAccordion(_ref) {
168
96
  }
169
97
  };
170
98
 
171
- return _react["default"].createElement(_styledComponents.ThemeProvider, {
99
+ return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
172
100
  theme: colorsTheme.accordion
173
- }, _react["default"].createElement(DXCAccordion, {
101
+ }, /*#__PURE__*/_react["default"].createElement(DXCAccordion, {
174
102
  padding: padding,
175
103
  margin: margin,
176
104
  disabled: disabled,
177
105
  icon: icon || iconSrc,
178
106
  isResponsive: isResponsive
179
- }, _react["default"].createElement(_ExpansionPanel["default"], {
107
+ }, /*#__PURE__*/_react["default"].createElement(_ExpansionPanel["default"], {
180
108
  disabled: disabled,
181
109
  onChange: handlerAccordion,
182
110
  expanded: isExpanded != null ? isExpanded : innerIsExpanded
183
- }, _react["default"].createElement(_ExpansionPanelSummary["default"], {
184
- expandIcon: _react["default"].createElement(_ExpandMore["default"], null),
111
+ }, /*#__PURE__*/_react["default"].createElement(_ExpansionPanelSummary["default"], {
112
+ expandIcon: /*#__PURE__*/_react["default"].createElement(_ExpandMore["default"], null),
185
113
  tabIndex: disabled ? -1 : tabIndex
186
- }, _react["default"].createElement(AccordionInfo, {
114
+ }, /*#__PURE__*/_react["default"].createElement(AccordionInfo, {
187
115
  disabled: disabled
188
- }, _react["default"].createElement(AccordionLabel, null, label), icon ? _react["default"].createElement(IconContainer, {
116
+ }, /*#__PURE__*/_react["default"].createElement(AccordionLabel, null, label), icon ? /*#__PURE__*/_react["default"].createElement(IconContainer, {
189
117
  disabled: disabled
190
- }, (0, _typeof2["default"])(icon) === "object" ? icon : _react["default"].createElement(icon)) : iconSrc && _react["default"].createElement(AccordionIcon, {
118
+ }, (0, _typeof2["default"])(icon) === "object" ? icon : /*#__PURE__*/_react["default"].createElement(icon)) : iconSrc && /*#__PURE__*/_react["default"].createElement(AccordionIcon, {
191
119
  src: iconSrc
192
- })), assistiveText && _react["default"].createElement(AccordionAssistiveText, {
120
+ })), assistiveText && /*#__PURE__*/_react["default"].createElement(AccordionAssistiveText, {
193
121
  disabled: disabled
194
- }, assistiveText)), _react["default"].createElement(_ExpansionPanelDetails["default"], null, _react["default"].createElement(AccordionContent, {
122
+ }, assistiveText)), /*#__PURE__*/_react["default"].createElement(_ExpansionPanelDetails["default"], null, /*#__PURE__*/_react["default"].createElement(AccordionContent, {
195
123
  disabled: disabled
196
- }, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
124
+ }, /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
197
125
  color: colorsTheme.accordion.backgroundColor
198
126
  }, children))))));
199
127
  };
@@ -202,7 +130,7 @@ var calculateWidth = function calculateWidth(margin) {
202
130
  return "calc(100% - ".concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
203
131
  };
204
132
 
205
- var DXCAccordion = _styledComponents["default"].div(_templateObject(), function (props) {
133
+ var DXCAccordion = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n min-width: 280px;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n width: ", ";\n cursor: ", ";\n\n .MuiPaper-root {\n min-width: 0;\n display: flex;\n left: 85px;\n background-color: ", " !important;\n box-shadow: ", ";\n position: static;\n width: 100%;\n border-radius: ", ";\n\n &.Mui-expanded {\n border-radius: ", ";\n }\n &.MuiExpansionPanel-root {\n display: flex;\n flex-direction: column;\n min-height: 48px;\n }\n &.MuiExpansionPanel-rounded {\n border-radius: ", ";\n }\n .MuiButtonBase-root.MuiExpansionPanelSummary-root {\n min-height: 48px;\n height: 48px;\n\n :focus {\n outline-color: ", ";\n outline-style: ", ";\n outline-width: ", ";\n background-color: ", ";\n }\n :hover {\n background-color: ", ";\n }\n :active {\n background-color: ", ";\n }\n &.Mui-disabled {\n opacity: 1;\n }\n }\n .MuiButtonBase-root {\n border-radius: ", ";\n\n &.Mui-expanded {\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n .MuiSvgIcon-root {\n opacity: 1;\n }\n }\n &.MuiIconButton-root {\n height: auto;\n }\n .MuiExpansionPanelSummary-content {\n padding-top: ", ";\n padding-bottom: ", ";\n padding-right: ", ";\n padding-left: ", ";\n min-width: 0;\n align-items: baseline;\n &.Mui-expanded {\n div:nth-child(2) {\n opacity: 1;\n }\n }\n :hover {\n div {\n opacity: 1;\n }\n }\n }\n }\n .MuiTouchRipple-root {\n display: none;\n }\n }\n .MuiCollapse-hidden {\n display: none;\n }\n .MuiCollapse-container {\n border-radius: 0px 0px 4px 4px;\n cursor: default;\n width: 100%;\n }\n .MuiIconButton-label {\n & > .MuiSvgIcon-root {\n color: ", ";\n }\n }\n .MuiExpansionPanelDetails-root {\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n }\n"])), function (props) {
206
134
  return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
207
135
  }, function (props) {
208
136
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
@@ -262,7 +190,7 @@ var DXCAccordion = _styledComponents["default"].div(_templateObject(), function
262
190
  return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.left ? _variables.spaces[props.padding.left] : "";
263
191
  });
264
192
 
265
- var AccordionInfo = _styledComponents["default"].div(_templateObject2(), function (props) {
193
+ var AccordionInfo = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row-reverse;\n align-items: center;\n padding-left: ", ";\n padding-right: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n"])), function (props) {
266
194
  return props.theme.titlePaddingLeft;
267
195
  }, function (props) {
268
196
  return props.theme.titlePaddingRight;
@@ -278,11 +206,11 @@ var AccordionInfo = _styledComponents["default"].div(_templateObject2(), functio
278
206
  return props.disabled ? props.theme.disabledTitleLabelFontColor : props.theme.titleLabelFontColor;
279
207
  });
280
208
 
281
- var AccordionLabel = _styledComponents["default"].div(_templateObject3());
209
+ var AccordionLabel = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])([""])));
282
210
 
283
- var AccordionContent = _styledComponents["default"].div(_templateObject4());
211
+ var AccordionContent = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\n"])));
284
212
 
285
- var AccordionAssistiveText = _styledComponents["default"].div(_templateObject5(), function (props) {
213
+ var AccordionAssistiveText = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n padding-left: ", ";\n padding-right: ", ";\n font-size: ", ";\n font-family: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n flex: 1;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: ", ";\n text-align: end;\n"])), function (props) {
286
214
  return props.theme.assistiveTextPaddingLeft;
287
215
  }, function (props) {
288
216
  return props.theme.assistiveTextPaddingRight;
@@ -302,7 +230,7 @@ var AccordionAssistiveText = _styledComponents["default"].div(_templateObject5()
302
230
  return props.theme.assistiveTextMinWidth;
303
231
  });
304
232
 
305
- var IconContainer = _styledComponents["default"].div(_templateObject6(), function (props) {
233
+ var IconContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n color: ", ";\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
306
234
  return props.theme.iconSize;
307
235
  }, function (props) {
308
236
  return props.theme.iconSize;
@@ -314,7 +242,7 @@ var IconContainer = _styledComponents["default"].div(_templateObject6(), functio
314
242
  return props.disabled ? props.theme.disabledIconColor : props.theme.iconColor;
315
243
  });
316
244
 
317
- var AccordionIcon = _styledComponents["default"].img(_templateObject7(), function (props) {
245
+ var AccordionIcon = _styledComponents["default"].img(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n color: ", ";\n"])), function (props) {
318
246
  return props.theme.iconSize;
319
247
  }, function (props) {
320
248
  return props.theme.iconSize;
@@ -326,28 +254,5 @@ var AccordionIcon = _styledComponents["default"].img(_templateObject7(), functio
326
254
  return props.disabled ? props.theme.disabledIconColor : props.theme.iconColor;
327
255
  });
328
256
 
329
- DxcAccordion.propTypes = {
330
- label: _propTypes["default"].string,
331
- iconSrc: _propTypes["default"].string,
332
- icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
333
- assistiveText: _propTypes["default"].string,
334
- disabled: _propTypes["default"].bool,
335
- onChange: _propTypes["default"].func,
336
- isExpanded: _propTypes["default"].bool,
337
- children: _propTypes["default"].element,
338
- margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
339
- top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
340
- bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
341
- left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
342
- right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
343
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
344
- padding: _propTypes["default"].oneOfType([_propTypes["default"].shape({
345
- top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
346
- bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
347
- left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
348
- right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
349
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
350
- tabIndex: _propTypes["default"].number
351
- };
352
257
  var _default = DxcAccordion;
353
258
  exports["default"] = _default;
@@ -0,0 +1,300 @@
1
+ import React from "react";
2
+ import DxcAccordion from "./Accordion";
3
+ import DxcHeading from "../heading/Heading";
4
+ import DxcTextInput from "../text-input/TextInput";
5
+ import DxcButton from "../button/Button";
6
+ import Title from "../../.storybook/components/Title";
7
+ import ExampleContainer from "../../.storybook/components/ExampleContainer";
8
+ import { ThemeProvider } from "../ThemeContext";
9
+
10
+ export default {
11
+ title: "Accordion",
12
+ component: DxcAccordion,
13
+ };
14
+
15
+ const folderIcon = (
16
+ <svg
17
+ xmlns="http://www.w3.org/2000/svg"
18
+ enable-background="new 0 0 24 24"
19
+ height="24px"
20
+ viewBox="0 0 24 24"
21
+ width="24px"
22
+ fill="currentColor"
23
+ >
24
+ <g>
25
+ <rect fill="none" height="24" width="24" />
26
+ </g>
27
+ <g>
28
+ <path d="M20,6h-8l-2-2H4C2.9,4,2.01,4.9,2.01,6L2,18c0,1.1,0.9,2,2,2h16c1.1,0,2-0.9,2-2V8C22,6.9,21.1,6,20,6z M16,16h2v-2h-2v-2 h2v-2h-2V8h4v10h-4V16z M16,16h-2v2H4V6h5.17l2,2H14v2h2v2h-2v2h2V16z" />
29
+ </g>
30
+ </svg>
31
+ );
32
+
33
+ const thumbIcon = (
34
+ <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 0 24 24" width="48px" fill="currentColor">
35
+ <path d="M0 0h24v24H0V0z" fill="none" />
36
+ <path d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2z" />
37
+ </svg>
38
+ );
39
+
40
+ const advancedTheme = {
41
+ accordion: {
42
+ backgroundColor: "#000000",
43
+ assistiveTextFontColor: "#ffffff",
44
+ titleLabelFontColor: "#ffffff",
45
+ arrowColor: "#5f249f",
46
+ iconColor: "#5f249f",
47
+ },
48
+ };
49
+
50
+ export const Chromatic = () => (
51
+ <>
52
+ <Title title="Component anatomy" theme="light" level={2} />
53
+ <ExampleContainer>
54
+ <Title title="With label" theme="light" level={4} />
55
+ <DxcAccordion label="Accordion">
56
+ <div>
57
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
58
+ lobortis eget.
59
+ </div>
60
+ </DxcAccordion>
61
+ </ExampleContainer>
62
+ <ExampleContainer>
63
+ <Title title="With assistive text" theme="light" level={4} />
64
+ <DxcAccordion label="Accordion" assistiveText="Assistive text">
65
+ <div>
66
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
67
+ lobortis eget.
68
+ </div>
69
+ </DxcAccordion>
70
+ </ExampleContainer>
71
+ <ExampleContainer>
72
+ <Title title="With icon" theme="light" level={4} />
73
+ <DxcAccordion label="Accordion" assistiveText="Assistive text" icon={folderIcon}>
74
+ <div>
75
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
76
+ lobortis eget.
77
+ </div>
78
+ </DxcAccordion>
79
+ </ExampleContainer>
80
+ <ExampleContainer>
81
+ <Title title="With bigger icon 48x48" theme="light" level={4} />
82
+ <DxcAccordion label="Accordion" assistiveText="Assistive text" icon={thumbIcon}>
83
+ <div>
84
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
85
+ lobortis eget.
86
+ </div>
87
+ </DxcAccordion>
88
+ </ExampleContainer>
89
+ <Title title="States" theme="light" level={2} />
90
+ <ExampleContainer pseudoState="pseudo-focus">
91
+ <Title title="Focused" theme="light" level={4} />
92
+ <DxcAccordion label="Focused">
93
+ <div>
94
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
95
+ lobortis eget.
96
+ </div>
97
+ </DxcAccordion>
98
+ </ExampleContainer>
99
+ <ExampleContainer pseudoState="pseudo-hover">
100
+ <Title title="Hovered" theme="light" level={4} />
101
+ <DxcAccordion label="Hovered">
102
+ <div>
103
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
104
+ lobortis eget.
105
+ </div>
106
+ </DxcAccordion>
107
+ </ExampleContainer>
108
+ <ExampleContainer pseudoState="pseudo-active">
109
+ <Title title="Active" theme="light" level={4} />
110
+ <DxcAccordion label="Active">
111
+ <div>
112
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
113
+ lobortis eget.
114
+ </div>
115
+ </DxcAccordion>
116
+ </ExampleContainer>
117
+ <ExampleContainer>
118
+ <Title title="Disabled" theme="light" level={4} />
119
+ <DxcAccordion label="Disabled" assistiveText="Assistive text" icon={folderIcon} disabled>
120
+ <div>
121
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
122
+ lobortis eget.
123
+ </div>
124
+ </DxcAccordion>
125
+ </ExampleContainer>
126
+ <ExampleContainer>
127
+ <Title title="Background color provider over accordion content" theme="light" level={4} />
128
+ <ThemeProvider advancedTheme={advancedTheme} theme={undefined}>
129
+ <DxcAccordion
130
+ label="Dark Accordion"
131
+ isExpanded
132
+ assistiveText="Assistive text"
133
+ icon={folderIcon}
134
+ padding="medium"
135
+ >
136
+ <div style={{ display: "flex", flexDirection: "column" }}>
137
+ <DxcTextInput label="Label" helperText="HelperText" placeholder="Placeholder" size="fillParent" />
138
+ <DxcButton label="Submit" size="medium" />
139
+ </div>
140
+ </DxcAccordion>
141
+ </ThemeProvider>
142
+ </ExampleContainer>
143
+ <Title title="Paddings" theme="light" level={2} />
144
+ <ExampleContainer>
145
+ <Title title="Xxsmall padding" theme="light" level={4} />
146
+ <DxcAccordion label="Xxsmall padding" isExpanded padding="xxsmall">
147
+ <div>
148
+ <DxcHeading level={5} text="Content header" margin={{ bottom: "xxsmall" }} />
149
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
150
+ magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
151
+ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
152
+ pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
153
+ est laborum.
154
+ </div>
155
+ </DxcAccordion>
156
+ </ExampleContainer>
157
+ <ExampleContainer>
158
+ <Title title="Xsmall padding" theme="light" level={4} />
159
+ <DxcAccordion label="Xsmall padding" isExpanded padding="xsmall">
160
+ <div>
161
+ <DxcHeading level={5} text="Content header" margin={{ bottom: "xxsmall" }} />
162
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
163
+ magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
164
+ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
165
+ pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
166
+ est laborum.
167
+ </div>
168
+ </DxcAccordion>
169
+ </ExampleContainer>
170
+ <ExampleContainer>
171
+ <Title title="Small padding" theme="light" level={4} />
172
+ <DxcAccordion label="Small padding" isExpanded padding="small">
173
+ <div>
174
+ <DxcHeading level={5} text="Content header" margin={{ bottom: "xxsmall" }} />
175
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
176
+ magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
177
+ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
178
+ pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
179
+ est laborum.
180
+ </div>
181
+ </DxcAccordion>
182
+ </ExampleContainer>
183
+ <ExampleContainer>
184
+ <Title title="Medium padding" theme="light" level={4} />
185
+ <DxcAccordion label="Medium padding" isExpanded padding="medium">
186
+ <div>
187
+ <DxcHeading level={5} text="Content header" margin={{ bottom: "xxsmall" }} />
188
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
189
+ magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
190
+ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
191
+ pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
192
+ est laborum.
193
+ </div>
194
+ </DxcAccordion>
195
+ </ExampleContainer>
196
+ <ExampleContainer>
197
+ <Title title="Large padding" theme="light" level={4} />
198
+ <DxcAccordion label="Large padding" isExpanded padding="large">
199
+ <div>
200
+ <DxcHeading level={5} text="Content header" margin={{ bottom: "xxsmall" }} />
201
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
202
+ magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
203
+ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
204
+ pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
205
+ est laborum.
206
+ </div>
207
+ </DxcAccordion>
208
+ </ExampleContainer>
209
+ <ExampleContainer>
210
+ <Title title="Xlarge padding" theme="light" level={4} />
211
+ <DxcAccordion label="Xlarge padding" isExpanded padding="xlarge">
212
+ <div>
213
+ <DxcHeading level={5} text="Content header" margin={{ bottom: "xxsmall" }} />
214
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
215
+ magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
216
+ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
217
+ pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
218
+ est laborum.
219
+ </div>
220
+ </DxcAccordion>
221
+ </ExampleContainer>
222
+ <ExampleContainer>
223
+ <Title title="Xxlarge padding" theme="light" level={4} />
224
+ <DxcAccordion label="Xxlarge padding" isExpanded padding="xxlarge">
225
+ <div>
226
+ <DxcHeading level={5} text="Content header" margin={{ bottom: "xxsmall" }} />
227
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
228
+ magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
229
+ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
230
+ pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
231
+ est laborum.
232
+ </div>
233
+ </DxcAccordion>
234
+ </ExampleContainer>
235
+ <Title title="Margins" theme="light" level={2} />
236
+ <ExampleContainer>
237
+ <Title title="Xxsmall margin" theme="light" level={4} />
238
+ <DxcAccordion label="Xxsmall margin" margin="xxsmall">
239
+ <div>
240
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
241
+ lobortis eget.
242
+ </div>
243
+ </DxcAccordion>
244
+ </ExampleContainer>
245
+ <ExampleContainer>
246
+ <Title title="Xsmall margin" theme="light" level={4} />
247
+ <DxcAccordion label="Xsmall margin" margin="xsmall">
248
+ <div>
249
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
250
+ lobortis eget.
251
+ </div>
252
+ </DxcAccordion>
253
+ </ExampleContainer>
254
+ <ExampleContainer>
255
+ <Title title="Small margin" theme="light" level={4} />
256
+ <DxcAccordion label="Small margin" margin="small">
257
+ <div>
258
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
259
+ lobortis eget.
260
+ </div>
261
+ </DxcAccordion>
262
+ </ExampleContainer>
263
+ <ExampleContainer>
264
+ <Title title="Medium margin" theme="light" level={4} />
265
+ <DxcAccordion label="Medium margin" margin="medium">
266
+ <div>
267
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
268
+ lobortis eget.
269
+ </div>
270
+ </DxcAccordion>
271
+ </ExampleContainer>
272
+ <ExampleContainer>
273
+ <Title title="Large margin" theme="light" level={4} />
274
+ <DxcAccordion label="Large margin" margin="large">
275
+ <div>
276
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
277
+ lobortis eget.
278
+ </div>
279
+ </DxcAccordion>
280
+ </ExampleContainer>
281
+ <ExampleContainer>
282
+ <Title title="Xlarge margin" theme="light" level={4} />
283
+ <DxcAccordion label="Xlarge margin" margin="xlarge">
284
+ <div>
285
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
286
+ lobortis eget.
287
+ </div>
288
+ </DxcAccordion>
289
+ </ExampleContainer>
290
+ <ExampleContainer>
291
+ <Title title="Xxlarge margin" theme="light" level={4} />
292
+ <DxcAccordion label="Xxlarge margin" margin="xxlarge">
293
+ <div>
294
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
295
+ lobortis eget.
296
+ </div>
297
+ </DxcAccordion>
298
+ </ExampleContainer>
299
+ </>
300
+ );
@@ -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;