@dxc-technology/halstack-react 0.0.0-b39a2d8 → 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 (162) hide show
  1. package/BackgroundColorContext.d.ts +10 -0
  2. package/BackgroundColorContext.js +1 -4
  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 +307 -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/badge/Badge.js +1 -1
  15. package/bleed/Bleed.d.ts +3 -0
  16. package/bleed/Bleed.js +84 -0
  17. package/bleed/Bleed.stories.tsx +342 -0
  18. package/bleed/types.d.ts +13 -0
  19. package/bleed/types.js +5 -0
  20. package/box/Box.js +2 -2
  21. package/button/Button.d.ts +1 -1
  22. package/button/Button.js +13 -19
  23. package/button/Button.stories.tsx +6 -8
  24. package/button/types.d.ts +5 -9
  25. package/card/Card.js +1 -1
  26. package/card/Card.stories.tsx +1 -1
  27. package/checkbox/Checkbox.js +2 -2
  28. package/checkbox/types.d.ts +1 -1
  29. package/chip/Chip.d.ts +4 -0
  30. package/chip/Chip.js +5 -27
  31. package/chip/types.d.ts +53 -0
  32. package/chip/types.js +5 -0
  33. package/common/variables.js +57 -22
  34. package/date/Date.js +1 -1
  35. package/date-input/DateInput.js +10 -13
  36. package/dialog/Dialog.js +4 -3
  37. package/dropdown/Dropdown.js +1 -1
  38. package/dropdown/Dropdown.stories.tsx +247 -0
  39. package/dropdown/types.d.ts +1 -1
  40. package/file-input/FileInput.d.ts +1 -1
  41. package/file-input/FileInput.js +160 -81
  42. package/file-input/FileInput.stories.tsx +507 -0
  43. package/file-input/FileItem.js +8 -6
  44. package/file-input/types.d.ts +32 -7
  45. package/footer/Footer.d.ts +1 -1
  46. package/footer/Footer.js +12 -18
  47. package/footer/{Footer.stories.jsx → Footer.stories.tsx} +1 -22
  48. package/footer/Icons.d.ts +2 -0
  49. package/footer/Icons.js +3 -3
  50. package/footer/types.d.ts +21 -17
  51. package/header/Header.js +2 -2
  52. package/header/Icons.d.ts +2 -0
  53. package/heading/Heading.js +1 -1
  54. package/heading/Heading.stories.tsx +54 -0
  55. package/input-text/InputText.js +2 -2
  56. package/inset/Inset.d.ts +3 -0
  57. package/inset/Inset.js +84 -0
  58. package/inset/Inset.stories.tsx +229 -0
  59. package/inset/types.d.ts +13 -0
  60. package/inset/types.js +5 -0
  61. package/layout/ApplicationLayout.d.ts +10 -0
  62. package/layout/ApplicationLayout.js +9 -19
  63. package/layout/ApplicationLayout.stories.tsx +171 -0
  64. package/layout/types.d.ts +57 -0
  65. package/layout/types.js +5 -0
  66. package/link/Link.js +1 -1
  67. package/list/List.d.ts +4 -0
  68. package/list/List.js +47 -0
  69. package/list/List.stories.tsx +95 -0
  70. package/list/types.d.ts +7 -0
  71. package/list/types.js +5 -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 +4 -2
  80. package/paginator/Paginator.js +2 -8
  81. package/password-input/PasswordInput.js +19 -18
  82. package/password-input/PasswordInput.stories.tsx +3 -3
  83. package/password-input/types.d.ts +17 -10
  84. package/progress-bar/ProgressBar.js +4 -4
  85. package/radio/Radio.js +2 -2
  86. package/radio-group/Radio.d.ts +4 -0
  87. package/radio-group/Radio.js +130 -0
  88. package/radio-group/RadioGroup.d.ts +4 -0
  89. package/radio-group/RadioGroup.js +268 -0
  90. package/radio-group/RadioGroup.stories.tsx +79 -0
  91. package/radio-group/types.d.ts +36 -0
  92. package/radio-group/types.js +5 -0
  93. package/resultsetTable/ResultsetTable.d.ts +4 -0
  94. package/resultsetTable/ResultsetTable.js +5 -28
  95. package/resultsetTable/ResultsetTable.stories.tsx +275 -0
  96. package/resultsetTable/types.d.ts +67 -0
  97. package/resultsetTable/types.js +5 -0
  98. package/row/Row.d.ts +3 -0
  99. package/row/Row.js +127 -0
  100. package/row/Row.stories.tsx +237 -0
  101. package/row/types.d.ts +10 -0
  102. package/row/types.js +5 -0
  103. package/select/Select.d.ts +4 -0
  104. package/select/Select.js +20 -22
  105. package/select/types.d.ts +170 -0
  106. package/select/types.js +5 -0
  107. package/sidenav/Sidenav.js +2 -2
  108. package/sidenav/Sidenav.stories.tsx +182 -0
  109. package/slider/Slider.js +4 -4
  110. package/spinner/Spinner.js +2 -2
  111. package/spinner/Spinner.stories.jsx +1 -0
  112. package/stack/Stack.d.ts +3 -0
  113. package/stack/Stack.js +97 -0
  114. package/stack/Stack.stories.tsx +164 -0
  115. package/stack/types.d.ts +9 -0
  116. package/stack/types.js +5 -0
  117. package/switch/Switch.js +2 -2
  118. package/switch/Switch.stories.tsx +1 -1
  119. package/table/Table.js +3 -3
  120. package/table/Table.stories.jsx +2 -1
  121. package/tabs/Tabs.js +11 -9
  122. package/tabs/Tabs.stories.tsx +120 -0
  123. package/tabs/types.d.ts +23 -15
  124. package/tag/Tag.js +1 -1
  125. package/tag/Tag.stories.tsx +1 -1
  126. package/text/Text.d.ts +7 -0
  127. package/text/Text.js +30 -0
  128. package/text/Text.stories.tsx +19 -0
  129. package/text-input/TextInput.d.ts +4 -0
  130. package/text-input/TextInput.js +54 -85
  131. package/text-input/TextInput.stories.tsx +456 -0
  132. package/text-input/types.d.ts +159 -0
  133. package/text-input/types.js +5 -0
  134. package/textarea/Textarea.d.ts +4 -0
  135. package/textarea/Textarea.js +27 -60
  136. package/textarea/Textarea.stories.jsx +4 -3
  137. package/textarea/types.d.ts +130 -0
  138. package/textarea/types.js +5 -0
  139. package/toggle/Toggle.js +1 -1
  140. package/toggle-group/ToggleGroup.d.ts +4 -0
  141. package/toggle-group/ToggleGroup.js +16 -45
  142. package/toggle-group/ToggleGroup.stories.tsx +23 -28
  143. package/toggle-group/types.d.ts +97 -0
  144. package/toggle-group/types.js +5 -0
  145. package/upload/buttons-upload/ButtonsUpload.js +2 -2
  146. package/upload/dragAndDropArea/DragAndDropArea.js +2 -2
  147. package/upload/file-upload/FileToUpload.js +1 -1
  148. package/upload/files-upload/FilesToUpload.js +1 -1
  149. package/upload/transaction/Transaction.js +2 -2
  150. package/upload/transactions/Transactions.js +1 -1
  151. package/useTheme.d.ts +2 -0
  152. package/useTheme.js +1 -1
  153. package/wizard/Wizard.js +59 -9
  154. package/wizard/{Wizard.stories.jsx → Wizard.stories.tsx} +0 -0
  155. package/wizard/types.d.ts +3 -7
  156. package/chip/index.d.ts +0 -22
  157. package/resultsetTable/index.d.ts +0 -19
  158. package/select/index.d.ts +0 -131
  159. package/text-input/index.d.ts +0 -135
  160. package/textarea/index.d.ts +0 -117
  161. package/toggle-group/index.d.ts +0 -21
  162. package/wizard/Icons.js +0 -65
@@ -0,0 +1,342 @@
1
+ import React from "react";
2
+ import styled from "styled-components";
3
+ import Title from "../../.storybook/components/Title";
4
+ import DxcBleed from "./Bleed";
5
+ import DxcStack from "../stack/Stack";
6
+
7
+ export default {
8
+ title: "Bleed",
9
+ component: DxcBleed,
10
+ };
11
+
12
+ export const Chromatic = () => (
13
+ <>
14
+ <Title title="Space = none" theme="light" level={4} />
15
+ <Container>
16
+ <DxcStack gutter="medium">
17
+ <Placeholder></Placeholder>
18
+ <DxcBleed space="none">
19
+ <Placeholder></Placeholder>
20
+ </DxcBleed>
21
+ <Placeholder></Placeholder>
22
+ </DxcStack>
23
+ </Container>
24
+ <Title title="Space = xxxsmall" theme="light" level={4} />
25
+ <Container>
26
+ <DxcStack gutter="medium">
27
+ <Placeholder></Placeholder>
28
+ <DxcBleed space="xxxsmall">
29
+ <Placeholder></Placeholder>
30
+ </DxcBleed>
31
+ <Placeholder></Placeholder>
32
+ </DxcStack>
33
+ </Container>
34
+ <Title title="Space = xxsmall" theme="light" level={4} />
35
+ <Container>
36
+ <DxcStack gutter="medium">
37
+ <Placeholder></Placeholder>
38
+ <DxcBleed space="xxsmall">
39
+ <Placeholder></Placeholder>
40
+ </DxcBleed>
41
+ <Placeholder></Placeholder>
42
+ </DxcStack>
43
+ </Container>
44
+ <Title title="Space = xsmall" theme="light" level={4} />
45
+ <Container>
46
+ <DxcStack gutter="medium">
47
+ <Placeholder></Placeholder>
48
+ <DxcBleed space="xsmall">
49
+ <Placeholder></Placeholder>
50
+ </DxcBleed>
51
+ <Placeholder></Placeholder>
52
+ </DxcStack>
53
+ </Container>
54
+ <Title title="Space = small" theme="light" level={4} />
55
+ <Container>
56
+ <DxcStack gutter="medium">
57
+ <Placeholder></Placeholder>
58
+ <DxcBleed space="small">
59
+ <Placeholder></Placeholder>
60
+ </DxcBleed>
61
+ <Placeholder></Placeholder>
62
+ </DxcStack>
63
+ </Container>
64
+ <Title title="Space = medium" theme="light" level={4} />
65
+ <Container>
66
+ <DxcStack gutter="medium">
67
+ <Placeholder></Placeholder>
68
+ <DxcBleed space="medium">
69
+ <Placeholder></Placeholder>
70
+ </DxcBleed>
71
+ <Placeholder></Placeholder>
72
+ </DxcStack>
73
+ </Container>
74
+ <Title title="Space = large" theme="light" level={4} />
75
+ <Container>
76
+ <DxcStack gutter="medium">
77
+ <Placeholder></Placeholder>
78
+ <DxcBleed space="large">
79
+ <Placeholder></Placeholder>
80
+ </DxcBleed>
81
+ <Placeholder></Placeholder>
82
+ </DxcStack>
83
+ </Container>
84
+ <Title title="Space = xlarge" theme="light" level={4} />
85
+ <Container>
86
+ <DxcStack gutter="medium">
87
+ <Placeholder></Placeholder>
88
+ <DxcBleed space="xlarge">
89
+ <Placeholder></Placeholder>
90
+ </DxcBleed>
91
+ <Placeholder></Placeholder>
92
+ </DxcStack>
93
+ </Container>
94
+ <Title title="Space = xxlarge" theme="light" level={4} />
95
+ <Container>
96
+ <DxcStack gutter="medium">
97
+ <Placeholder></Placeholder>
98
+ <DxcBleed space="xxlarge">
99
+ <Placeholder></Placeholder>
100
+ </DxcBleed>
101
+ <Placeholder></Placeholder>
102
+ </DxcStack>
103
+ </Container>
104
+ <Title title="Space = xxxlarge" theme="light" level={4} />
105
+ <Container>
106
+ <DxcStack gutter="medium">
107
+ <Placeholder></Placeholder>
108
+ <DxcBleed space="xxxlarge">
109
+ <Placeholder></Placeholder>
110
+ </DxcBleed>
111
+ <Placeholder></Placeholder>
112
+ </DxcStack>
113
+ </Container>
114
+
115
+ <Title title="Horizontal = none" theme="light" level={4} />
116
+ <Container>
117
+ <DxcStack gutter="medium">
118
+ <Placeholder></Placeholder>
119
+ <DxcBleed horizontal="none">
120
+ <Placeholder></Placeholder>
121
+ </DxcBleed>
122
+ <Placeholder></Placeholder>
123
+ </DxcStack>
124
+ </Container>
125
+ <Title title="Horizontal = xxxsmall" theme="light" level={4} />
126
+ <Container>
127
+ <DxcStack gutter="medium">
128
+ <Placeholder></Placeholder>
129
+ <DxcBleed horizontal="xxxsmall">
130
+ <Placeholder></Placeholder>
131
+ </DxcBleed>
132
+ <Placeholder></Placeholder>
133
+ </DxcStack>
134
+ </Container>
135
+ <Title title="Horizontal = xxsmall" theme="light" level={4} />
136
+ <Container>
137
+ <DxcStack gutter="medium">
138
+ <Placeholder></Placeholder>
139
+ <DxcBleed horizontal="xxsmall">
140
+ <Placeholder></Placeholder>
141
+ </DxcBleed>
142
+ <Placeholder></Placeholder>
143
+ </DxcStack>
144
+ </Container>
145
+ <Title title="Horizontal = xsmall" theme="light" level={4} />
146
+ <Container>
147
+ <DxcStack gutter="medium">
148
+ <Placeholder></Placeholder>
149
+ <DxcBleed horizontal="xsmall">
150
+ <Placeholder></Placeholder>
151
+ </DxcBleed>
152
+ <Placeholder></Placeholder>
153
+ </DxcStack>
154
+ </Container>
155
+ <Title title="Horizontal = small" theme="light" level={4} />
156
+ <Container>
157
+ <DxcStack gutter="medium">
158
+ <Placeholder></Placeholder>
159
+ <DxcBleed horizontal="small">
160
+ <Placeholder></Placeholder>
161
+ </DxcBleed>
162
+ <Placeholder></Placeholder>
163
+ </DxcStack>
164
+ </Container>
165
+ <Title title="Horizontal = medium" theme="light" level={4} />
166
+ <Container>
167
+ <DxcStack gutter="medium">
168
+ <Placeholder></Placeholder>
169
+ <DxcBleed horizontal="medium">
170
+ <Placeholder></Placeholder>
171
+ </DxcBleed>
172
+ <Placeholder></Placeholder>
173
+ </DxcStack>
174
+ </Container>
175
+ <Title title="Horizontal = large" theme="light" level={4} />
176
+ <Container>
177
+ <DxcStack gutter="medium">
178
+ <Placeholder></Placeholder>
179
+ <DxcBleed horizontal="large">
180
+ <Placeholder></Placeholder>
181
+ </DxcBleed>
182
+ <Placeholder></Placeholder>
183
+ </DxcStack>
184
+ </Container>
185
+ <Title title="Horizontal = xlarge" theme="light" level={4} />
186
+ <Container>
187
+ <DxcStack gutter="medium">
188
+ <Placeholder></Placeholder>
189
+ <DxcBleed horizontal="xlarge">
190
+ <Placeholder></Placeholder>
191
+ </DxcBleed>
192
+ <Placeholder></Placeholder>
193
+ </DxcStack>
194
+ </Container>
195
+ <Title title="Horizontal = xxlarge" theme="light" level={4} />
196
+ <Container>
197
+ <DxcStack gutter="medium">
198
+ <Placeholder></Placeholder>
199
+ <DxcBleed horizontal="xxlarge">
200
+ <Placeholder></Placeholder>
201
+ </DxcBleed>
202
+ <Placeholder></Placeholder>
203
+ </DxcStack>
204
+ </Container>
205
+ <Title title="Horizontal = xxxlarge" theme="light" level={4} />
206
+ <Container>
207
+ <DxcStack gutter="medium">
208
+ <Placeholder></Placeholder>
209
+ <DxcBleed horizontal="xxxlarge">
210
+ <Placeholder></Placeholder>
211
+ </DxcBleed>
212
+ <Placeholder></Placeholder>
213
+ </DxcStack>
214
+ </Container>
215
+
216
+ <Title title="Vertical = none" theme="light" level={4} />
217
+ <Container>
218
+ <DxcStack gutter="medium">
219
+ <Placeholder></Placeholder>
220
+ <DxcBleed vertical="none">
221
+ <Placeholder></Placeholder>
222
+ </DxcBleed>
223
+ <Placeholder></Placeholder>
224
+ </DxcStack>
225
+ </Container>
226
+ <Title title="Vertical = xxxsmall" theme="light" level={4} />
227
+ <Container>
228
+ <DxcStack gutter="medium">
229
+ <Placeholder></Placeholder>
230
+ <DxcBleed vertical="xxxsmall">
231
+ <Placeholder></Placeholder>
232
+ </DxcBleed>
233
+ <Placeholder></Placeholder>
234
+ </DxcStack>
235
+ </Container>
236
+ <Title title="Vertical = xxsmall" theme="light" level={4} />
237
+ <Container>
238
+ <DxcStack gutter="medium">
239
+ <Placeholder></Placeholder>
240
+ <DxcBleed vertical="xxsmall">
241
+ <Placeholder></Placeholder>
242
+ </DxcBleed>
243
+ <Placeholder></Placeholder>
244
+ </DxcStack>
245
+ </Container>
246
+ <Title title="Vertical = xsmall" theme="light" level={4} />
247
+ <Container>
248
+ <DxcStack gutter="medium">
249
+ <Placeholder></Placeholder>
250
+ <DxcBleed vertical="xsmall">
251
+ <Placeholder></Placeholder>
252
+ </DxcBleed>
253
+ <Placeholder></Placeholder>
254
+ </DxcStack>
255
+ </Container>
256
+ <Title title="Vertical = small" theme="light" level={4} />
257
+ <Container>
258
+ <DxcStack gutter="medium">
259
+ <Placeholder></Placeholder>
260
+ <DxcBleed vertical="small">
261
+ <Placeholder></Placeholder>
262
+ </DxcBleed>
263
+ <Placeholder></Placeholder>
264
+ </DxcStack>
265
+ </Container>
266
+ <Title title="Vertical = medium" theme="light" level={4} />
267
+ <Container>
268
+ <DxcStack gutter="medium">
269
+ <Placeholder></Placeholder>
270
+ <DxcBleed vertical="medium">
271
+ <Placeholder></Placeholder>
272
+ </DxcBleed>
273
+ <Placeholder></Placeholder>
274
+ </DxcStack>
275
+ </Container>
276
+ <Title title="Vertical = large" theme="light" level={4} />
277
+ <Container>
278
+ <DxcStack gutter="medium">
279
+ <Placeholder></Placeholder>
280
+ <DxcBleed vertical="large">
281
+ <Placeholder></Placeholder>
282
+ </DxcBleed>
283
+ <Placeholder></Placeholder>
284
+ </DxcStack>
285
+ </Container>
286
+ <Title title="Vertical = xlarge" theme="light" level={4} />
287
+ <Container>
288
+ <DxcStack gutter="medium">
289
+ <Placeholder></Placeholder>
290
+ <DxcBleed vertical="xlarge">
291
+ <Placeholder></Placeholder>
292
+ </DxcBleed>
293
+ <Placeholder></Placeholder>
294
+ </DxcStack>
295
+ </Container>
296
+ <Title title="Vertical = xxlarge" theme="light" level={4} />
297
+ <Container>
298
+ <DxcStack gutter="medium">
299
+ <Placeholder></Placeholder>
300
+ <DxcBleed vertical="xxlarge">
301
+ <Placeholder></Placeholder>
302
+ </DxcBleed>
303
+ <Placeholder></Placeholder>
304
+ </DxcStack>
305
+ </Container>
306
+ <Title title="Vertical = xxxlarge" theme="light" level={4} />
307
+ <Container>
308
+ <DxcStack gutter="medium">
309
+ <Placeholder></Placeholder>
310
+ <DxcBleed vertical="xxxlarge">
311
+ <Placeholder></Placeholder>
312
+ </DxcBleed>
313
+ <Placeholder></Placeholder>
314
+ </DxcStack>
315
+ </Container>
316
+
317
+ <Title title="Top = xsmall, right = small, bottom = medium and left = large" theme="light" level={4} />
318
+ <Container>
319
+ <DxcStack gutter="medium">
320
+ <Placeholder></Placeholder>
321
+ <DxcBleed top="xsmall" right="small" bottom="medium" left="large">
322
+ <Placeholder></Placeholder>
323
+ </DxcBleed>
324
+ <Placeholder></Placeholder>
325
+ </DxcStack>
326
+ </Container>
327
+ </>
328
+ );
329
+
330
+ const Container = styled.div`
331
+ background: #f2eafa;
332
+ padding: 5rem;
333
+ margin: 2.5rem;
334
+ `;
335
+
336
+ const Placeholder = styled.div`
337
+ min-height: 40px;
338
+ min-width: 120px;
339
+ border: 1px solid #a46ede;
340
+ background-color: #e5d5f6;
341
+ `;
342
+
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ declare type Spacing = "none" | "xxxsmall" | "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge" | "xxxlarge";
3
+ declare type Props = {
4
+ space?: Spacing;
5
+ horizontal?: Spacing;
6
+ vertical?: Spacing;
7
+ top?: Spacing;
8
+ right?: Spacing;
9
+ bottom?: Spacing;
10
+ left?: Spacing;
11
+ children: React.ReactNode;
12
+ };
13
+ export default Props;
package/bleed/types.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
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
 
@@ -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, onClick, margin, size, tabIndex, }: ButtonPropsType) => JSX.Element;
4
4
  export default DxcButton;
package/button/Button.js CHANGED
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports["default"] = void 0;
11
11
 
12
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
-
14
12
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
15
13
 
14
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
+
16
16
  var _react = _interopRequireWildcard(require("react"));
17
17
 
18
18
  var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
@@ -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
 
@@ -45,9 +45,7 @@ var DxcButton = function DxcButton(_ref) {
45
45
  _ref$type = _ref.type,
46
46
  type = _ref$type === void 0 ? "button" : _ref$type,
47
47
  icon = _ref.icon,
48
- _ref$iconSrc = _ref.iconSrc,
49
- iconSrc = _ref$iconSrc === void 0 ? "" : _ref$iconSrc,
50
- onClick = _ref.onClick,
48
+ _onClick = _ref.onClick,
51
49
  margin = _ref.margin,
52
50
  _ref$size = _ref.size,
53
51
  size = _ref$size === void 0 ? "fitContent" : _ref$size,
@@ -72,18 +70,18 @@ var DxcButton = function DxcButton(_ref) {
72
70
  disableRipple: true,
73
71
  "aria-disabled": disabled,
74
72
  tabIndex: disabled ? -1 : tabIndex,
75
- onClick: onClick
73
+ onClick: function onClick() {
74
+ _onClick();
75
+ }
76
76
  }, label && /*#__PURE__*/_react["default"].createElement(LabelContainer, {
77
77
  icon: icon,
78
78
  iconPosition: iconPosition
79
- }, label), icon ? /*#__PURE__*/_react["default"].createElement(IconContainer, {
79
+ }, label), icon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
80
80
  label: label,
81
81
  iconPosition: iconPosition
82
- }, (0, _typeof2["default"])(icon) === "object" ? icon : /*#__PURE__*/_react["default"].createElement(icon)) : iconSrc && /*#__PURE__*/_react["default"].createElement(ButtonIcon, {
83
- label: label,
84
- iconPosition: iconPosition,
85
- src: iconSrc
86
- }))));
82
+ }, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement(ButtonIcon, {
83
+ src: icon
84
+ }) : icon))));
87
85
  };
88
86
 
89
87
  var sizes = {
@@ -118,11 +116,7 @@ var IconContainer = _styledComponents["default"].div(_templateObject2 || (_templ
118
116
  return !props.label ? "0px" : props.iconPosition === "before" && props.label !== "" && "8px" || "8px";
119
117
  });
120
118
 
121
- var ButtonIcon = _styledComponents["default"].img(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 24px;\n max-width: 24px;\n margin-left: ", ";\n margin-right: ", ";\n"])), function (props) {
122
- return props.iconPosition === "after" && props.label !== "" && "10px" || "0px";
123
- }, function (props) {
124
- return props.iconPosition === "before" && props.label !== "" && "10px" || "0px";
125
- });
119
+ var ButtonIcon = _styledComponents["default"].img(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])([""])));
126
120
 
127
121
  var DxCButton = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n display: inline-block;\n width: ", ";\n cursor: ", ";\n\n .MuiButtonBase-root {\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n\n .MuiButton-label {\n display: flex;\n flex-direction: ", ";\n align-items: center;\n }\n\n box-shadow: 0 0 0 2px transparent;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n min-width: ", ";\n width: 100%;\n height: 40px;\n transition: none !important;\n\n &:focus {\n border-color: transparent;\n box-shadow: 0 0 0 2px\n ", ";\n }\n\n ", "\n }\n"])), function (props) {
128
122
  return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
@@ -10,14 +10,12 @@ export default {
10
10
  component: DxcButton,
11
11
  };
12
12
 
13
- const iconSVG = () => {
14
- return (
15
- <svg viewBox="0 0 24 24" fill="currentColor">
16
- <path d="M0 0h24v24H0z" fill="none" />
17
- <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />
18
- </svg>
19
- );
20
- };
13
+ const iconSVG = (
14
+ <svg viewBox="0 0 24 24" fill="currentColor">
15
+ <path d="M0 0h24v24H0z" fill="none" />
16
+ <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />
17
+ </svg>
18
+ );
21
19
  export const Chromatic = () => (
22
20
  <>
23
21
  <Title title="Primary" theme="light" level={2} />
package/button/types.d.ts CHANGED
@@ -6,7 +6,7 @@ declare type Margin = {
6
6
  left?: Space;
7
7
  right?: Space;
8
8
  };
9
- declare type SVG = React.SVGProps<SVGSVGElement> | React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
9
+ declare type SVG = React.SVGProps<SVGSVGElement>;
10
10
  declare type Props = {
11
11
  /**
12
12
  * Text to be placed next to the button.
@@ -29,17 +29,13 @@ declare type Props = {
29
29
  */
30
30
  type?: "button" | "reset" | "submit";
31
31
  /**
32
- * Element used as the icon that will be placed next to the button label.
32
+ * Element or path used as the icon that will be placed next to the button label.
33
33
  */
34
- icon?: SVG;
34
+ icon?: string | SVG;
35
35
  /**
36
- * @deprecated URL of the icon that will be placed next to the button label.
36
+ * This function will be called when the user clicks the button.
37
37
  */
38
- iconSrc?: string;
39
- /**
40
- * This function will be called when the user clicks the button. The event object will be passed as a parameter.
41
- */
42
- onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
38
+ onClick?: () => void;
43
39
  /**
44
40
  * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
45
41
  * 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
 
@@ -174,7 +174,7 @@ const actionCard = () => (
174
174
  <Title title="Focused default with action" theme="light" level={4} />
175
175
  <DxcCard onClick={() => {}}>Focused default with action</DxcCard>
176
176
  </ExampleContainer>
177
- <ExampleContainer>
177
+ <ExampleContainer expanded>
178
178
  <Title title="Hovered default with action" theme="light" level={4} />
179
179
  <DxcCard onClick={() => {}}>Hovered default with action</DxcCard>
180
180
  </ExampleContainer>
@@ -27,9 +27,9 @@ var _variables = require("../common/variables.js");
27
27
 
28
28
  var _utils = require("../common/utils.js");
29
29
 
30
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
30
+ var _useTheme = _interopRequireDefault(require("../useTheme"));
31
31
 
32
- var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
32
+ var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
33
33
 
34
34
  var _templateObject, _templateObject2, _templateObject3;
35
35
 
@@ -19,7 +19,7 @@ declare type Props = {
19
19
  /**
20
20
  * Text to be placed next to the checkbox.
21
21
  */
22
- label: string;
22
+ label?: string;
23
23
  /**
24
24
  * Whether the label should appear after or before the checkbox.
25
25
  */
package/chip/Chip.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import ChipPropsType from "./types";
3
+ declare const DxcChip: ({ label, suffixIcon, prefixIcon, suffixIconSrc, onClickSuffix, prefixIconSrc, onClickPrefix, disabled, margin, tabIndex, }: ChipPropsType) => JSX.Element;
4
+ export default DxcChip;
package/chip/Chip.js CHANGED
@@ -9,8 +9,6 @@ Object.defineProperty(exports, "__esModule", {
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"));
@@ -19,13 +17,11 @@ var _react = _interopRequireDefault(require("react"));
19
17
 
20
18
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
21
19
 
22
- var _propTypes = _interopRequireDefault(require("prop-types"));
23
-
24
20
  var _variables = require("../common/variables.js");
25
21
 
26
22
  var _utils = require("../common/utils.js");
27
23
 
28
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
24
+ var _useTheme = _interopRequireDefault(require("../useTheme"));
29
25
 
30
26
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
31
27
 
@@ -58,7 +54,7 @@ var DxcChip = function DxcChip(_ref) {
58
54
  mode: "prefix",
59
55
  tabIndex: typeof onClickPrefix === "function" && !disabled ? tabIndex : -1,
60
56
  onClick: function onClick() {
61
- return onClickPrefix && !disabled && onClickPrefix(label);
57
+ return onClickPrefix && !disabled && onClickPrefix();
62
58
  },
63
59
  interactuable: typeof onClickPrefix === "function" && !disabled
64
60
  }, (0, _typeof2["default"])(prefixIcon) === "object" ? prefixIcon : /*#__PURE__*/_react["default"].createElement(prefixIcon)) : prefixIconSrc && /*#__PURE__*/_react["default"].createElement(PrefixIconContainer, {
@@ -67,7 +63,7 @@ var DxcChip = function DxcChip(_ref) {
67
63
  label: label,
68
64
  tabIndex: typeof onClickPrefix === "function" && !disabled ? tabIndex : -1,
69
65
  onClick: function onClick() {
70
- return onClickPrefix && !disabled && onClickPrefix(label);
66
+ return onClickPrefix && !disabled && onClickPrefix();
71
67
  },
72
68
  interactuable: typeof onClickPrefix === "function" && !disabled
73
69
  }), label && /*#__PURE__*/_react["default"].createElement(ChipTextContainer, {
@@ -81,7 +77,7 @@ var DxcChip = function DxcChip(_ref) {
81
77
  label: label,
82
78
  tabIndex: typeof onClickSuffix === "function" && !disabled ? tabIndex : -1,
83
79
  onClick: function onClick() {
84
- return onClickSuffix && !disabled && onClickSuffix(label);
80
+ return onClickSuffix && !disabled && onClickSuffix();
85
81
  },
86
82
  interactuable: typeof onClickSuffix === "function" && !disabled
87
83
  }, (0, _typeof2["default"])(suffixIcon) === "object" ? suffixIcon : /*#__PURE__*/_react["default"].createElement(suffixIcon)) : suffixIconSrc && /*#__PURE__*/_react["default"].createElement(SuffixIconContainer, {
@@ -90,7 +86,7 @@ var DxcChip = function DxcChip(_ref) {
90
86
  label: label,
91
87
  tabIndex: typeof onClickSuffix === "function" && !disabled ? tabIndex : -1,
92
88
  onClick: function onClick() {
93
- return onClickSuffix && !disabled && onClickSuffix(label);
89
+ return onClickSuffix && !disabled && onClickSuffix();
94
90
  },
95
91
  interactuable: typeof onClickSuffix === "function" && !disabled
96
92
  })));
@@ -199,23 +195,5 @@ var IconContainer = _styledComponents["default"].div(_templateObject5 || (_templ
199
195
  return props.disabled && "outline: none;";
200
196
  });
201
197
 
202
- DxcChip.propTypes = {
203
- label: _propTypes["default"].string,
204
- disabled: _propTypes["default"].bool,
205
- theme: _propTypes["default"].oneOf(["dark", "light"]),
206
- suffixIcon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
207
- prefixIcon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
208
- suffixIconSrc: _propTypes["default"].string,
209
- prefixIconSrc: _propTypes["default"].string,
210
- onClickSuffix: _propTypes["default"].func,
211
- onClickPrefix: _propTypes["default"].func,
212
- margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
213
- top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
214
- bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
215
- left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
216
- right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
217
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
218
- tabIndex: _propTypes["default"].number
219
- };
220
198
  var _default = DxcChip;
221
199
  exports["default"] = _default;