@dxc-technology/halstack-react 0.0.0-9005464 → 0.0.0-9179a3a

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 (143) hide show
  1. package/BackgroundColorContext.d.ts +10 -0
  2. package/BackgroundColorContext.js +1 -3
  3. package/ThemeContext.d.ts +15 -0
  4. package/ThemeContext.js +5 -8
  5. package/V3Select/V3Select.js +2 -2
  6. package/V3Textarea/V3Textarea.js +2 -2
  7. package/accordion/Accordion.js +2 -2
  8. package/accordion/Accordion.stories.tsx +300 -0
  9. package/accordion/types.d.ts +1 -1
  10. package/accordion-group/AccordionGroup.js +2 -2
  11. package/accordion-group/AccordionGroup.stories.tsx +225 -0
  12. package/accordion-group/types.d.ts +1 -1
  13. package/alert/Alert.js +2 -2
  14. package/alert/types.d.ts +1 -1
  15. package/badge/Badge.js +1 -1
  16. package/box/Box.d.ts +1 -1
  17. package/box/Box.js +4 -7
  18. package/box/types.d.ts +0 -4
  19. package/button/Button.d.ts +1 -1
  20. package/button/Button.js +6 -4
  21. package/button/types.d.ts +2 -2
  22. package/card/Card.js +5 -6
  23. package/card/Card.stories.tsx +201 -0
  24. package/card/ice-cream.jpg +0 -0
  25. package/card/types.d.ts +4 -6
  26. package/checkbox/Checkbox.js +2 -2
  27. package/checkbox/types.d.ts +1 -1
  28. package/chip/Chip.d.ts +4 -0
  29. package/chip/Chip.js +5 -27
  30. package/chip/Chip.stories.tsx +121 -0
  31. package/chip/types.d.ts +53 -0
  32. package/chip/types.js +5 -0
  33. package/common/variables.js +19 -22
  34. package/date/Date.js +1 -1
  35. package/date-input/DateInput.js +4 -7
  36. package/dialog/Dialog.js +2 -2
  37. package/dialog/Dialog.stories.tsx +212 -0
  38. package/dropdown/Dropdown.js +1 -1
  39. package/dropdown/types.d.ts +1 -1
  40. package/file-input/FileInput.d.ts +4 -0
  41. package/file-input/FileInput.js +65 -76
  42. package/file-input/FileItem.d.ts +14 -0
  43. package/file-input/FileItem.js +12 -21
  44. package/file-input/types.d.ts +112 -0
  45. package/file-input/types.js +5 -0
  46. package/footer/Footer.d.ts +1 -1
  47. package/footer/Footer.js +12 -18
  48. package/footer/{Footer.stories.jsx → Footer.stories.tsx} +1 -22
  49. package/footer/Icons.d.ts +2 -0
  50. package/footer/Icons.js +3 -3
  51. package/footer/types.d.ts +22 -18
  52. package/header/Header.js +2 -2
  53. package/header/Header.stories.tsx +162 -0
  54. package/header/Icons.d.ts +2 -0
  55. package/header/types.d.ts +4 -2
  56. package/heading/Heading.d.ts +4 -0
  57. package/heading/Heading.js +7 -24
  58. package/heading/Heading.stories.tsx +53 -0
  59. package/heading/types.d.ts +33 -0
  60. package/heading/types.js +5 -0
  61. package/input-text/InputText.js +2 -2
  62. package/layout/ApplicationLayout.d.ts +10 -0
  63. package/layout/ApplicationLayout.js +8 -18
  64. package/layout/ApplicationLayout.stories.tsx +171 -0
  65. package/layout/types.d.ts +57 -0
  66. package/layout/types.js +5 -0
  67. package/link/Link.js +3 -3
  68. package/link/Link.stories.tsx +76 -0
  69. package/list/List.d.ts +7 -0
  70. package/list/List.js +37 -0
  71. package/list/List.stories.tsx +70 -0
  72. package/main.d.ts +7 -3
  73. package/main.js +34 -2
  74. package/number-input/NumberInput.js +3 -6
  75. package/number-input/NumberInputContext.d.ts +4 -0
  76. package/number-input/NumberInputContext.js +5 -2
  77. package/number-input/numberInputContextTypes.d.ts +19 -0
  78. package/number-input/numberInputContextTypes.js +5 -0
  79. package/package.json +1 -1
  80. package/paginator/Paginator.js +2 -8
  81. package/password-input/PasswordInput.js +19 -18
  82. package/password-input/types.d.ts +17 -10
  83. package/progress-bar/ProgressBar.js +2 -2
  84. package/radio/Radio.js +2 -2
  85. package/radio/types.d.ts +2 -2
  86. package/resultsetTable/ResultsetTable.d.ts +4 -0
  87. package/resultsetTable/ResultsetTable.js +4 -27
  88. package/resultsetTable/ResultsetTable.stories.tsx +276 -0
  89. package/resultsetTable/types.d.ts +67 -0
  90. package/resultsetTable/types.js +5 -0
  91. package/row/Row.d.ts +11 -0
  92. package/row/Row.js +124 -0
  93. package/row/Row.stories.tsx +223 -0
  94. package/select/Select.js +15 -17
  95. package/sidenav/Sidenav.js +2 -2
  96. package/sidenav/Sidenav.stories.tsx +165 -0
  97. package/slider/Slider.js +8 -8
  98. package/slider/Slider.stories.tsx +6 -1
  99. package/spinner/Spinner.js +2 -2
  100. package/stack/Stack.d.ts +10 -0
  101. package/stack/Stack.js +94 -0
  102. package/stack/Stack.stories.tsx +150 -0
  103. package/switch/Switch.js +2 -2
  104. package/table/Table.js +3 -3
  105. package/tabs/Tabs.js +4 -2
  106. package/tabs/Tabs.stories.tsx +121 -0
  107. package/tabs/types.d.ts +3 -4
  108. package/tag/Tag.js +1 -1
  109. package/text/Text.d.ts +7 -0
  110. package/text/Text.js +30 -0
  111. package/text/Text.stories.tsx +19 -0
  112. package/text-input/TextInput.d.ts +4 -0
  113. package/text-input/TextInput.js +42 -81
  114. package/text-input/TextInput.stories.tsx +456 -0
  115. package/text-input/types.d.ts +159 -0
  116. package/text-input/types.js +5 -0
  117. package/textarea/Textarea.d.ts +4 -0
  118. package/textarea/Textarea.js +27 -60
  119. package/textarea/types.d.ts +130 -0
  120. package/textarea/types.js +5 -0
  121. package/toggle/Toggle.js +1 -1
  122. package/toggle-group/ToggleGroup.d.ts +4 -0
  123. package/toggle-group/ToggleGroup.js +8 -34
  124. package/toggle-group/types.d.ts +84 -0
  125. package/toggle-group/types.js +5 -0
  126. package/upload/buttons-upload/ButtonsUpload.js +2 -2
  127. package/upload/dragAndDropArea/DragAndDropArea.js +2 -2
  128. package/upload/file-upload/FileToUpload.js +1 -1
  129. package/upload/files-upload/FilesToUpload.js +1 -1
  130. package/upload/transaction/Transaction.js +2 -2
  131. package/upload/transactions/Transactions.js +1 -1
  132. package/useTheme.d.ts +2 -0
  133. package/useTheme.js +1 -1
  134. package/wizard/Wizard.js +2 -2
  135. package/wizard/Wizard.stories.jsx +224 -0
  136. package/wizard/types.d.ts +1 -1
  137. package/chip/index.d.ts +0 -22
  138. package/file-input/index.d.ts +0 -81
  139. package/heading/index.d.ts +0 -17
  140. package/resultsetTable/index.d.ts +0 -19
  141. package/text-input/index.d.ts +0 -135
  142. package/textarea/index.d.ts +0 -117
  143. package/toggle-group/index.d.ts +0 -21
@@ -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
+ );
@@ -17,7 +17,7 @@ export declare type AccordionPropsType = {
17
17
  /**
18
18
  * The panel label.
19
19
  */
20
- label?: string;
20
+ label: string;
21
21
  /**
22
22
  * Element used as the icon that will be placed next to panel label.
23
23
  */
package/alert/Alert.js CHANGED
@@ -21,9 +21,9 @@ var _variables = require("../common/variables.js");
21
21
 
22
22
  var _utils = require("../common/utils.js");
23
23
 
24
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
24
+ var _useTheme = _interopRequireDefault(require("../useTheme"));
25
25
 
26
- var _BackgroundColorContext = require("../BackgroundColorContext.js");
26
+ var _BackgroundColorContext = require("../BackgroundColorContext");
27
27
 
28
28
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
29
29
 
package/alert/types.d.ts CHANGED
@@ -38,7 +38,7 @@ declare type Props = {
38
38
  */
39
39
  margin?: Space | Margin;
40
40
  /**
41
- * Size of the component ('small' | 'medium' | 'large' | 'fillParent' | 'fitContent').
41
+ * Size of the component.
42
42
  */
43
43
  size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
44
44
  /**
package/badge/Badge.js CHANGED
@@ -15,7 +15,7 @@ var _react = _interopRequireDefault(require("react"));
15
15
 
16
16
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
17
17
 
18
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
18
+ var _useTheme = _interopRequireDefault(require("../useTheme"));
19
19
 
20
20
  var _templateObject;
21
21
 
package/box/Box.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import BoxPropsType from "./types";
3
- declare const DxcBox: ({ shadowDepth, display, children, margin, padding, size, tabIndex, }: BoxPropsType) => JSX.Element;
3
+ declare const DxcBox: ({ shadowDepth, display, children, margin, padding, size, }: BoxPropsType) => JSX.Element;
4
4
  export default DxcBox;
package/box/Box.js CHANGED
@@ -21,9 +21,9 @@ var _variables = require("../common/variables.js");
21
21
 
22
22
  var _utils = require("../common/utils.js");
23
23
 
24
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
24
+ var _useTheme = _interopRequireDefault(require("../useTheme"));
25
25
 
26
- var _BackgroundColorContext = require("../BackgroundColorContext.js");
26
+ var _BackgroundColorContext = require("../BackgroundColorContext");
27
27
 
28
28
  var _templateObject;
29
29
 
@@ -40,9 +40,7 @@ var DxcBox = function DxcBox(_ref) {
40
40
  margin = _ref.margin,
41
41
  padding = _ref.padding,
42
42
  _ref$size = _ref.size,
43
- size = _ref$size === void 0 ? "fitContent" : _ref$size,
44
- _ref$tabIndex = _ref.tabIndex,
45
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
43
+ size = _ref$size === void 0 ? "fitContent" : _ref$size;
46
44
  var colorsTheme = (0, _useTheme["default"])();
47
45
  return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
48
46
  theme: colorsTheme.box
@@ -51,8 +49,7 @@ var DxcBox = function DxcBox(_ref) {
51
49
  display: display,
52
50
  margin: margin,
53
51
  padding: padding,
54
- size: size,
55
- tabIndex: tabIndex
52
+ size: size
56
53
  }, /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
57
54
  color: colorsTheme.box.backgroundColor
58
55
  }, children)));
package/box/types.d.ts CHANGED
@@ -39,9 +39,5 @@ declare type Props = {
39
39
  * Size of the component.
40
40
  */
41
41
  size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
42
- /**
43
- * Value of the tabindex attribute.
44
- */
45
- tabIndex?: number;
46
42
  };
47
43
  export default Props;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import ButtonPropsType from "./types";
3
- declare const DxcButton: ({ label, mode, disabled, iconPosition, type, icon, iconSrc, onClick, margin, size, tabIndex }: ButtonPropsType) => JSX.Element;
3
+ declare const DxcButton: ({ label, mode, disabled, iconPosition, type, icon, iconSrc, onClick, margin, size, tabIndex, }: ButtonPropsType) => JSX.Element;
4
4
  export default DxcButton;
package/button/Button.js CHANGED
@@ -23,9 +23,9 @@ var _variables = require("../common/variables.js");
23
23
 
24
24
  var _utils = require("../common/utils.js");
25
25
 
26
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
26
+ var _useTheme = _interopRequireDefault(require("../useTheme"));
27
27
 
28
- var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
28
+ var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
29
29
 
30
30
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
31
31
 
@@ -47,7 +47,7 @@ var DxcButton = function DxcButton(_ref) {
47
47
  icon = _ref.icon,
48
48
  _ref$iconSrc = _ref.iconSrc,
49
49
  iconSrc = _ref$iconSrc === void 0 ? "" : _ref$iconSrc,
50
- onClick = _ref.onClick,
50
+ _onClick = _ref.onClick,
51
51
  margin = _ref.margin,
52
52
  _ref$size = _ref.size,
53
53
  size = _ref$size === void 0 ? "fitContent" : _ref$size,
@@ -72,7 +72,9 @@ var DxcButton = function DxcButton(_ref) {
72
72
  disableRipple: true,
73
73
  "aria-disabled": disabled,
74
74
  tabIndex: disabled ? -1 : tabIndex,
75
- onClick: onClick
75
+ onClick: function onClick() {
76
+ _onClick();
77
+ }
76
78
  }, label && /*#__PURE__*/_react["default"].createElement(LabelContainer, {
77
79
  icon: icon,
78
80
  iconPosition: iconPosition
package/button/types.d.ts CHANGED
@@ -37,9 +37,9 @@ declare type Props = {
37
37
  */
38
38
  iconSrc?: string;
39
39
  /**
40
- * This function will be called when the user clicks the button. The event object will be passed as a parameter.
40
+ * This function will be called when the user clicks the button.
41
41
  */
42
- onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
42
+ onClick?: () => void;
43
43
  /**
44
44
  * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
45
45
  * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
package/card/Card.js CHANGED
@@ -21,7 +21,7 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
21
21
 
22
22
  var _variables = require("../common/variables.js");
23
23
 
24
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
24
+ var _useTheme = _interopRequireDefault(require("../useTheme"));
25
25
 
26
26
  var _Box = _interopRequireDefault(require("../box/Box"));
27
27
 
@@ -47,7 +47,7 @@ var DxcCard = function DxcCard(_ref) {
47
47
  _ref$tabIndex = _ref.tabIndex,
48
48
  tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex,
49
49
  _ref$outlined = _ref.outlined,
50
- outlined = _ref$outlined === void 0 ? false : _ref$outlined,
50
+ outlined = _ref$outlined === void 0 ? true : _ref$outlined,
51
51
  children = _ref.children;
52
52
  var colorsTheme = (0, _useTheme["default"])();
53
53
 
@@ -57,12 +57,11 @@ var DxcCard = function DxcCard(_ref) {
57
57
  changeIsHovered = _useState2[1];
58
58
 
59
59
  var tagContent = /*#__PURE__*/_react["default"].createElement(_Box["default"], {
60
- shadowDepth: outlined ? 0 : isHovered && (onClick || linkHref) ? 2 : 1
60
+ shadowDepth: !outlined ? 0 : isHovered && (onClick || linkHref) ? 2 : 1
61
61
  }, /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
62
62
  theme: colorsTheme.card
63
63
  }, /*#__PURE__*/_react["default"].createElement(CardContainer, {
64
64
  hasAction: onClick || linkHref,
65
- outlined: outlined,
66
65
  imagePosition: imagePosition
67
66
  }, imageSrc && /*#__PURE__*/_react["default"].createElement(ImageContainer, {
68
67
  imageBgColor: imageBgColor
@@ -91,7 +90,7 @@ var DxcCard = function DxcCard(_ref) {
91
90
  }, tagContent) || tagContent);
92
91
  };
93
92
 
94
- var StyledDxcCard = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n cursor: ", ";\n outline: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (_ref2) {
93
+ var StyledDxcCard = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n cursor: ", ";\n outline: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n :focus {\n outline: #0095ff auto 1px;\n }\n"])), function (_ref2) {
95
94
  var hasAction = _ref2.hasAction;
96
95
  return hasAction && "pointer" || "unset";
97
96
  }, function (_ref3) {
@@ -126,7 +125,7 @@ var CardContainer = _styledComponents["default"].div(_templateObject2 || (_templ
126
125
  return hasAction ? "" : "unset";
127
126
  });
128
127
 
129
- var StyledLink = _styledComponents["default"].a(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n cursor: pointer;\n text-decoration: none;\n"])));
128
+ var StyledLink = _styledComponents["default"].a(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n cursor: pointer;\n text-decoration: none;\n\n :focus {\n outline-color: #0095ff;\n }\n"])));
130
129
 
131
130
  var TagImage = _styledComponents["default"].img(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n object-fit: ", ";\n"])), function (_ref11) {
132
131
  var imagePadding = _ref11.imagePadding;
@@ -0,0 +1,201 @@
1
+ import React from "react";
2
+ import Title from "../../.storybook/components/Title";
3
+ import ExampleContainer from "../../.storybook/components/ExampleContainer";
4
+ import DxcCard from "./Card";
5
+ import imagePath from "./ice-cream.jpg";
6
+ import { userEvent, within } from "@storybook/testing-library";
7
+
8
+ export default {
9
+ title: "Card",
10
+ component: DxcCard,
11
+ };
12
+
13
+ const Card = () => (
14
+ <>
15
+ <Title title="Default" theme="light" level={4} />
16
+ <ExampleContainer>
17
+ <DxcCard>Default</DxcCard>
18
+ </ExampleContainer>
19
+ <Title title="Not outlined" theme="light" level={4} />
20
+ <ExampleContainer>
21
+ <DxcCard outlined={false}>Not outlined</DxcCard>
22
+ </ExampleContainer>
23
+ <Title title="Default with link" theme="light" level={4} />
24
+ <ExampleContainer>
25
+ <DxcCard linkHref="https://www.dxc.com">Default with link</DxcCard>
26
+ </ExampleContainer>
27
+ <Title title="Focused default with link" theme="light" level={4} />
28
+ <ExampleContainer>
29
+ <DxcCard linkHref="https://www.dxc.com">Focused default with link</DxcCard>
30
+ </ExampleContainer>
31
+ <Title title="Hovered default with link" theme="light" level={4} />
32
+ <ExampleContainer>
33
+ <DxcCard linkHref="https://www.dxc.com">Hovered default with link</DxcCard>
34
+ </ExampleContainer>
35
+ <Title title="Default with action" theme="light" level={4} />
36
+ <ExampleContainer>
37
+ <DxcCard onClick={() => {}}>Default with action</DxcCard>
38
+ </ExampleContainer>
39
+ <Title title="Default with image" theme="light" level={4} />
40
+ <ExampleContainer>
41
+ <DxcCard imageSrc={imagePath}>Default</DxcCard>
42
+ </ExampleContainer>
43
+ <Title title="Default image with background color" theme="light" level={4} />
44
+ <ExampleContainer>
45
+ <DxcCard imageSrc={imagePath} imageBgColor="yellow">
46
+ Background color
47
+ </DxcCard>
48
+ </ExampleContainer>
49
+ <Title title="Default image with position after" theme="light" level={4} />
50
+ <ExampleContainer>
51
+ <DxcCard imageSrc={imagePath} imagePosition="after">
52
+ Position after
53
+ </DxcCard>
54
+ </ExampleContainer>
55
+ <Title title="Image cover" theme="light" level={4} />
56
+ <ExampleContainer>
57
+ <DxcCard imageSrc={imagePath} imageCover>
58
+ Image cover
59
+ </DxcCard>
60
+ </ExampleContainer>
61
+ <Title title="Image cover with position after" theme="light" level={4} />
62
+ <ExampleContainer>
63
+ <DxcCard imageSrc={imagePath} imageCover imagePosition="after">
64
+ Image cover with position after
65
+ </DxcCard>
66
+ </ExampleContainer>
67
+ <Title title="Image padding" theme="light" level={2} />
68
+ <ExampleContainer>
69
+ <Title title="Xxsmall" theme="light" level={4} />
70
+ <DxcCard imageSrc={imagePath} imagePadding="xxsmall" imageCover>
71
+ Xxsmall
72
+ </DxcCard>
73
+ </ExampleContainer>
74
+ <ExampleContainer>
75
+ <Title title="Xsmall" theme="light" level={4} />
76
+ <DxcCard imageSrc={imagePath} imagePadding="xsmall" imageCover>
77
+ Xsmall
78
+ </DxcCard>
79
+ </ExampleContainer>
80
+ <ExampleContainer>
81
+ <Title title="Small" theme="light" level={4} />
82
+ <DxcCard imageSrc={imagePath} imagePadding="small" imageCover>
83
+ Small
84
+ </DxcCard>
85
+ </ExampleContainer>
86
+ <ExampleContainer>
87
+ <Title title="Medium" theme="light" level={4} />
88
+ <DxcCard imageSrc={imagePath} imagePadding="medium" imageCover>
89
+ Medium
90
+ </DxcCard>
91
+ </ExampleContainer>
92
+ <ExampleContainer>
93
+ <Title title="Large" theme="light" level={4} />
94
+ <DxcCard imageSrc={imagePath} imagePadding="large" imageCover>
95
+ Large
96
+ </DxcCard>
97
+ </ExampleContainer>
98
+ <ExampleContainer>
99
+ <Title title="Xlarge" theme="light" level={4} />
100
+ <DxcCard imageSrc={imagePath} imagePadding="xlarge" imageCover>
101
+ Xlarge
102
+ </DxcCard>
103
+ </ExampleContainer>
104
+ <ExampleContainer>
105
+ <Title title="Xxlarge" theme="light" level={4} />
106
+ <DxcCard imageSrc={imagePath} imagePadding="xxlarge" imageCover>
107
+ Xxlarge
108
+ </DxcCard>
109
+ </ExampleContainer>
110
+ <Title title="Content padding" theme="light" level={2} />
111
+ <ExampleContainer>
112
+ <Title title="Xxsmall" theme="light" level={4} />
113
+ <DxcCard contentPadding="xxsmall">Xxsmall</DxcCard>
114
+ </ExampleContainer>
115
+ <ExampleContainer>
116
+ <Title title="Xsmall" theme="light" level={4} />
117
+ <DxcCard contentPadding="xsmall">Xsmall</DxcCard>
118
+ </ExampleContainer>
119
+ <ExampleContainer>
120
+ <Title title="Small" theme="light" level={4} />
121
+ <DxcCard contentPadding="small">Small</DxcCard>
122
+ </ExampleContainer>
123
+ <ExampleContainer>
124
+ <Title title="Medium" theme="light" level={4} />
125
+ <DxcCard contentPadding="medium">Medium</DxcCard>
126
+ </ExampleContainer>
127
+ <ExampleContainer>
128
+ <Title title="Large" theme="light" level={4} />
129
+ <DxcCard contentPadding="large">Large</DxcCard>
130
+ </ExampleContainer>
131
+ <ExampleContainer>
132
+ <Title title="Xlarge" theme="light" level={4} />
133
+ <DxcCard contentPadding="xlarge">Xlarge</DxcCard>
134
+ </ExampleContainer>
135
+ <ExampleContainer>
136
+ <Title title="Xxlarge" theme="light" level={4} />
137
+ <DxcCard contentPadding="xxlarge">Xxlarge</DxcCard>
138
+ </ExampleContainer>
139
+ <Title title="Margin" theme="light" level={2} />
140
+ <ExampleContainer>
141
+ <Title title="Xxsmall" theme="light" level={4} />
142
+ <DxcCard margin="xxsmall">Xxsmall</DxcCard>
143
+ </ExampleContainer>
144
+ <ExampleContainer>
145
+ <Title title="Xsmall" theme="light" level={4} />
146
+ <DxcCard margin="xsmall">Xsmall</DxcCard>
147
+ </ExampleContainer>
148
+ <ExampleContainer>
149
+ <Title title="Small" theme="light" level={4} />
150
+ <DxcCard margin="small">Small</DxcCard>
151
+ </ExampleContainer>
152
+ <ExampleContainer>
153
+ <Title title="Medium" theme="light" level={4} />
154
+ <DxcCard margin="medium">Medium</DxcCard>
155
+ </ExampleContainer>
156
+ <ExampleContainer>
157
+ <Title title="Large" theme="light" level={4} />
158
+ <DxcCard margin="large">Large</DxcCard>
159
+ </ExampleContainer>
160
+ <ExampleContainer>
161
+ <Title title="Xlarge" theme="light" level={4} />
162
+ <DxcCard margin="xlarge">Xlarge</DxcCard>
163
+ </ExampleContainer>
164
+ <ExampleContainer>
165
+ <Title title="Xxlarge" theme="light" level={4} />
166
+ <DxcCard margin="xxlarge">Xxlarge</DxcCard>
167
+ </ExampleContainer>
168
+ </>
169
+ );
170
+
171
+ const actionCard = () => (
172
+ <>
173
+ <ExampleContainer>
174
+ <Title title="Focused default with action" theme="light" level={4} />
175
+ <DxcCard onClick={() => {}}>Focused default with action</DxcCard>
176
+ </ExampleContainer>
177
+ <ExampleContainer>
178
+ <Title title="Hovered default with action" theme="light" level={4} />
179
+ <DxcCard onClick={() => {}}>Hovered default with action</DxcCard>
180
+ </ExampleContainer>
181
+ </>
182
+ );
183
+
184
+ const linkStates = async (focusCard, hoverCard) => {
185
+ await focusCard.focus();
186
+ await userEvent.hover(hoverCard);
187
+ };
188
+
189
+ export const ActionCardStates = actionCard.bind({});
190
+ ActionCardStates.play = async ({ canvasElement }) => {
191
+ const canvas = within(canvasElement);
192
+ await userEvent.tab();
193
+ await userEvent.hover(canvas.getAllByText("Hovered default with action")[1]);
194
+ };
195
+
196
+ export const Chromatic = Card.bind({});
197
+ Chromatic.play = async ({ canvasElement }) => {
198
+ const canvas = within(canvasElement);
199
+ const linkCards = canvas.getAllByRole("link");
200
+ await linkStates(linkCards[1], linkCards[2]);
201
+ };
Binary file
package/card/types.d.ts CHANGED
@@ -42,15 +42,13 @@ declare type Props = {
42
42
  */
43
43
  imageCover?: boolean;
44
44
  /**
45
- * Size of the margin to be applied to the component. You can pass
46
- * an object with 'top', 'bottom', 'left' and 'right' properties
47
- * in order to specify different margin sizes.
45
+ * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
46
+ * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
48
47
  */
49
48
  margin?: Space | Size;
50
49
  /**
51
- * Size of the padding to be applied to the content area. You can pass
52
- * an object with 'top', 'bottom', 'left' and 'right' properties in
53
- * order to specify different padding sizes.
50
+ * Size of the padding to be applied to the content area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
51
+ * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
54
52
  */
55
53
  contentPadding?: Space | Size;
56
54
  /**