@dxc-technology/halstack-react 0.0.0-ebf4fe2 → 0.0.0-ec06b53

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 (179) hide show
  1. package/HalstackContext.js +7 -8
  2. package/accordion/Accordion.js +122 -103
  3. package/accordion/Accordion.stories.tsx +2 -3
  4. package/accordion/Accordion.test.js +9 -10
  5. package/accordion/types.d.ts +5 -4
  6. package/accordion-group/AccordionGroup.js +1 -21
  7. package/accordion-group/AccordionGroup.stories.tsx +27 -1
  8. package/accordion-group/AccordionGroup.test.js +20 -45
  9. package/accordion-group/types.d.ts +10 -3
  10. package/alert/Alert.js +1 -1
  11. package/bleed/Bleed.stories.tsx +63 -63
  12. package/box/Box.js +1 -1
  13. package/box/types.d.ts +1 -0
  14. package/bulleted-list/BulletedList.d.ts +7 -0
  15. package/bulleted-list/BulletedList.js +123 -0
  16. package/bulleted-list/BulletedList.stories.tsx +200 -0
  17. package/bulleted-list/types.d.ts +11 -0
  18. package/{inline → bulleted-list}/types.js +0 -0
  19. package/button/Button.js +43 -61
  20. package/button/Button.stories.tsx +9 -0
  21. package/button/types.d.ts +7 -7
  22. package/card/types.d.ts +1 -0
  23. package/checkbox/Checkbox.d.ts +2 -2
  24. package/checkbox/Checkbox.js +92 -99
  25. package/checkbox/Checkbox.stories.tsx +79 -59
  26. package/checkbox/Checkbox.test.js +93 -16
  27. package/checkbox/types.d.ts +6 -2
  28. package/chip/types.d.ts +1 -1
  29. package/common/variables.js +75 -33
  30. package/date-input/Calendar.d.ts +4 -0
  31. package/date-input/Calendar.js +258 -0
  32. package/date-input/DateInput.js +77 -222
  33. package/date-input/DateInput.stories.tsx +30 -17
  34. package/date-input/DateInput.test.js +411 -138
  35. package/date-input/DatePicker.d.ts +4 -0
  36. package/date-input/DatePicker.js +160 -0
  37. package/date-input/YearPicker.d.ts +4 -0
  38. package/date-input/YearPicker.js +115 -0
  39. package/date-input/types.d.ts +53 -0
  40. package/dialog/Dialog.js +52 -28
  41. package/dialog/Dialog.stories.tsx +57 -2
  42. package/dialog/Dialog.test.js +34 -4
  43. package/dialog/types.d.ts +3 -2
  44. package/dropdown/Dropdown.d.ts +1 -1
  45. package/dropdown/Dropdown.js +247 -247
  46. package/dropdown/Dropdown.stories.tsx +126 -63
  47. package/dropdown/Dropdown.test.js +504 -108
  48. package/dropdown/DropdownMenu.d.ts +4 -0
  49. package/dropdown/DropdownMenu.js +80 -0
  50. package/dropdown/DropdownMenuItem.d.ts +4 -0
  51. package/dropdown/DropdownMenuItem.js +92 -0
  52. package/dropdown/types.d.ts +25 -5
  53. package/file-input/FileInput.d.ts +2 -2
  54. package/file-input/FileInput.js +177 -219
  55. package/file-input/FileInput.stories.tsx +38 -10
  56. package/file-input/FileInput.test.js +53 -12
  57. package/file-input/FileItem.d.ts +4 -14
  58. package/file-input/FileItem.js +38 -63
  59. package/file-input/types.d.ts +17 -0
  60. package/flex/Flex.d.ts +4 -0
  61. package/flex/Flex.js +69 -0
  62. package/flex/Flex.stories.tsx +103 -0
  63. package/flex/types.d.ts +32 -0
  64. package/{list → flex}/types.js +0 -0
  65. package/footer/Footer.stories.tsx +8 -1
  66. package/footer/types.d.ts +2 -1
  67. package/header/Header.js +74 -72
  68. package/header/Header.stories.tsx +4 -4
  69. package/header/Icons.js +2 -2
  70. package/header/types.d.ts +3 -2
  71. package/inset/Inset.stories.tsx +4 -4
  72. package/layout/ApplicationLayout.d.ts +15 -6
  73. package/layout/ApplicationLayout.js +36 -64
  74. package/layout/ApplicationLayout.stories.tsx +80 -44
  75. package/layout/types.d.ts +17 -27
  76. package/link/Link.js +2 -2
  77. package/link/Link.stories.tsx +13 -6
  78. package/link/types.d.ts +1 -1
  79. package/main.d.ts +5 -9
  80. package/main.js +27 -59
  81. package/number-input/NumberInput.test.js +43 -7
  82. package/package.json +16 -20
  83. package/paginator/Paginator.js +2 -2
  84. package/paginator/Paginator.test.js +1 -1
  85. package/paragraph/Paragraph.d.ts +6 -0
  86. package/paragraph/Paragraph.js +38 -0
  87. package/paragraph/Paragraph.stories.tsx +44 -0
  88. package/password-input/PasswordInput.test.js +13 -12
  89. package/progress-bar/ProgressBar.d.ts +2 -2
  90. package/progress-bar/ProgressBar.js +56 -50
  91. package/progress-bar/ProgressBar.stories.jsx +3 -1
  92. package/progress-bar/ProgressBar.test.js +67 -22
  93. package/progress-bar/types.d.ts +3 -4
  94. package/quick-nav/QuickNav.js +18 -17
  95. package/quick-nav/QuickNav.stories.tsx +131 -26
  96. package/radio-group/Radio.d.ts +1 -1
  97. package/radio-group/Radio.js +43 -28
  98. package/radio-group/RadioGroup.js +23 -22
  99. package/radio-group/RadioGroup.stories.tsx +1 -0
  100. package/radio-group/RadioGroup.test.js +123 -96
  101. package/radio-group/types.d.ts +2 -2
  102. package/resultsetTable/Icons.d.ts +7 -0
  103. package/resultsetTable/Icons.js +51 -0
  104. package/resultsetTable/ResultsetTable.js +48 -107
  105. package/resultsetTable/ResultsetTable.stories.tsx +50 -25
  106. package/resultsetTable/ResultsetTable.test.js +23 -41
  107. package/resultsetTable/types.d.ts +2 -2
  108. package/select/Listbox.d.ts +1 -1
  109. package/select/Listbox.js +25 -2
  110. package/select/Select.js +17 -32
  111. package/select/Select.stories.tsx +6 -5
  112. package/select/Select.test.js +321 -250
  113. package/select/types.d.ts +2 -4
  114. package/sidenav/Sidenav.d.ts +6 -5
  115. package/sidenav/Sidenav.js +176 -55
  116. package/sidenav/Sidenav.stories.tsx +154 -156
  117. package/sidenav/Sidenav.test.js +25 -37
  118. package/sidenav/types.d.ts +50 -27
  119. package/slider/Slider.d.ts +2 -2
  120. package/slider/Slider.js +120 -95
  121. package/slider/Slider.stories.tsx +7 -1
  122. package/slider/Slider.test.js +121 -21
  123. package/slider/types.d.ts +6 -2
  124. package/switch/Switch.d.ts +2 -2
  125. package/switch/Switch.js +135 -68
  126. package/switch/Switch.stories.tsx +8 -30
  127. package/switch/Switch.test.js +144 -17
  128. package/switch/types.d.ts +6 -2
  129. package/table/Table.js +1 -1
  130. package/table/Table.test.js +1 -1
  131. package/tabs/Tab.d.ts +4 -0
  132. package/tabs/Tab.js +135 -0
  133. package/tabs/Tabs.js +360 -104
  134. package/tabs/Tabs.stories.tsx +74 -0
  135. package/tabs/Tabs.test.js +217 -6
  136. package/tabs/types.d.ts +15 -5
  137. package/tabs-nav/NavTabs.js +5 -5
  138. package/tabs-nav/Tab.js +3 -5
  139. package/tabs-nav/types.d.ts +1 -1
  140. package/tag/Tag.js +1 -1
  141. package/tag/types.d.ts +1 -1
  142. package/text-input/Icons.d.ts +8 -0
  143. package/text-input/Icons.js +60 -0
  144. package/text-input/Suggestion.js +7 -5
  145. package/text-input/Suggestions.d.ts +4 -0
  146. package/text-input/Suggestions.js +134 -0
  147. package/text-input/TextInput.js +189 -282
  148. package/text-input/TextInput.stories.tsx +189 -182
  149. package/text-input/TextInput.test.js +639 -727
  150. package/text-input/types.d.ts +22 -3
  151. package/toggle-group/types.d.ts +1 -1
  152. package/typography/Typography.d.ts +4 -0
  153. package/typography/Typography.js +131 -0
  154. package/typography/Typography.stories.tsx +198 -0
  155. package/typography/types.d.ts +18 -0
  156. package/{row → typography}/types.js +0 -0
  157. package/wizard/Wizard.js +9 -16
  158. package/wizard/Wizard.stories.tsx +20 -1
  159. package/wizard/types.d.ts +5 -4
  160. package/inline/Inline.d.ts +0 -4
  161. package/inline/Inline.js +0 -60
  162. package/inline/Inline.stories.tsx +0 -305
  163. package/inline/types.d.ts +0 -36
  164. package/list/List.d.ts +0 -4
  165. package/list/List.js +0 -47
  166. package/list/List.stories.tsx +0 -89
  167. package/list/types.d.ts +0 -7
  168. package/row/Row.d.ts +0 -3
  169. package/row/Row.js +0 -127
  170. package/row/Row.stories.tsx +0 -237
  171. package/row/types.d.ts +0 -28
  172. package/stack/Stack.d.ts +0 -4
  173. package/stack/Stack.js +0 -52
  174. package/stack/Stack.stories.tsx +0 -225
  175. package/stack/types.d.ts +0 -28
  176. package/stack/types.js +0 -5
  177. package/text/Text.d.ts +0 -7
  178. package/text/Text.js +0 -30
  179. package/text/Text.stories.tsx +0 -19
@@ -1,305 +0,0 @@
1
- import React from "react";
2
- import Title from "../../.storybook/components/Title";
3
- import styled from "styled-components";
4
- import DxcInline from "./Inline";
5
-
6
- export default {
7
- title: "Inline",
8
- component: DxcInline,
9
- };
10
-
11
- export const Chromatic = () => (
12
- <>
13
- <Title title="Default" theme="light" level={4} />
14
- <Container>
15
- <DxcInline>
16
- <Placeholder height="small" width="small" />
17
- <Placeholder height="medium" width="medium" />
18
- <Placeholder height="large" width="large" />
19
- <Placeholder height="small" width="large" />
20
- </DxcInline>
21
- </Container>
22
- <Title title="Default with divider" theme="light" level={4} />
23
- <Container>
24
- <DxcInline divider>
25
- <Placeholder height="small" width="small" />
26
- <Placeholder height="medium" width="medium" />
27
- <Placeholder height="large" width="large" />
28
- <Placeholder height="small" width="large" />
29
- <Placeholder height="large" width="large" />
30
- <Placeholder height="medium" width="small" />
31
- </DxcInline>
32
- </Container>
33
- <Title title="One child larger than flex container" theme="light" level={4} />
34
- <FlexContainer customWidth>
35
- <DxcInline>
36
- <Placeholder height="large" width="xlarge" />
37
- </DxcInline>
38
- </FlexContainer>
39
- <Title title="Wrap" theme="light" level={4} />
40
- <Container customWidth>
41
- <DxcInline wrap>
42
- <Placeholder height="large" width="small" />
43
- <Placeholder height="large" width="medium" />
44
- <Placeholder height="medium" width="small" />
45
- <Placeholder height="large" width="medium" />
46
- </DxcInline>
47
- </Container>
48
- <Title title="Nowrap (default)" theme="light" level={4} />
49
- <Container customWidth>
50
- <DxcInline>
51
- <Placeholder height="large" width="small" />
52
- <Placeholder height="large" width="medium" />
53
- <Placeholder height="medium" width="small" />
54
- <Placeholder height="small" width="medium" />
55
- <Placeholder height="large" width="small" />
56
- <Placeholder height="medium" width="large" />
57
- <Placeholder height="small" width="medium" />
58
- </DxcInline>
59
- </Container>
60
- <Title title="Nowrap in a flex container (overflows)" theme="light" level={4} />
61
- <FlexContainer customWidth>
62
- <DxcInline>
63
- <Placeholder height="large" width="small" />
64
- <Placeholder height="large" width="medium" />
65
- <Placeholder height="medium" width="small" />
66
- <Placeholder height="small" width="medium" />
67
- <Placeholder height="large" width="small" />
68
- <Placeholder height="medium" width="large" />
69
- <Placeholder height="small" width="medium" />
70
- </DxcInline>
71
- </FlexContainer>
72
- <Title title="AlignY = start" theme="light" level={4} />
73
- <Container>
74
- <DxcInline alignY="stretch">
75
- <Placeholder width="small" />
76
- <Placeholder height="medium" width="medium" />
77
- <Placeholder height="large" width="large" />
78
- <Placeholder height="small" width="large" />
79
- </DxcInline>
80
- </Container>
81
- <Title title="AlignY = end with divider" theme="light" level={4} />
82
- <Container>
83
- <DxcInline alignY="end" divider>
84
- <Placeholder height="small" width="small" />
85
- <Placeholder height="medium" width="medium" />
86
- <Placeholder height="large" width="large" />
87
- <Placeholder height="small" width="large" />
88
- </DxcInline>
89
- </Container>
90
- <Title title="AlignY = center" theme="light" level={4} />
91
- <Container>
92
- <DxcInline alignY="center">
93
- <Placeholder height="small" width="small" />
94
- <Placeholder height="medium" width="medium" />
95
- <Placeholder height="large" width="large" />
96
- <Placeholder height="small" width="large" />
97
- </DxcInline>
98
- </Container>
99
- <Title title="AlignY with wrapped items" theme="light" level={4} />
100
- <Container customWidth>
101
- <DxcInline alignY="end" wrap>
102
- <Placeholder height="large" width="small" />
103
- <Placeholder height="large" width="medium" />
104
- <Placeholder height="medium" width="small" />
105
- <Placeholder height="large" width="medium" />
106
- <Placeholder height="medium" width="small" />
107
- <Placeholder height="small" width="medium" />
108
- </DxcInline>
109
- </Container>
110
- <Title title="AlignY = baseline" theme="light" level={4} />
111
- <Container>
112
- <DxcInline alignY="baseline">
113
- <Placeholder height="small" width="small" />
114
- <Placeholder height="medium" width="medium" />
115
- <Placeholder height="large" width="large" />
116
- <Placeholder height="small" width="large" />
117
- </DxcInline>
118
- </Container>
119
- <Title title="AlignX = start" theme="light" level={4} />
120
- <Container>
121
- <DxcInline alignX="start">
122
- <Placeholder height="small" width="small" />
123
- <Placeholder height="medium" width="medium" />
124
- <Placeholder height="large" width="large" />
125
- <Placeholder height="small" />
126
- </DxcInline>
127
- </Container>
128
- <Title title="AlignX = end with divider" theme="light" level={4} />
129
- <Container>
130
- <DxcInline alignX="end" divider>
131
- <Placeholder height="small" width="small" />
132
- <Placeholder height="medium" width="medium" />
133
- <Placeholder height="small" width="small" />
134
- <Placeholder height="large" width="large" />
135
- <Placeholder height="small" width="large" />
136
- </DxcInline>
137
- </Container>
138
- <Title title="AlignX = center" theme="light" level={4} />
139
- <Container>
140
- <DxcInline alignX="center">
141
- <Placeholder height="small" width="small" />
142
- <Placeholder height="medium" width="medium" />
143
- <Placeholder height="large" width="large" />
144
- <Placeholder height="small" width="large" />
145
- </DxcInline>
146
- </Container>
147
- <Title title="AlignX with wrapped items" theme="light" level={4} />
148
- <Container customWidth>
149
- <DxcInline alignX="center" wrap>
150
- <Placeholder height="small" width="small" />
151
- <Placeholder height="large" width="medium" />
152
- <Placeholder height="medium" width="small" />
153
- <Placeholder height="large" width="large" />
154
- <Placeholder height="medium" width="small" />
155
- <Placeholder height="small" width="large" />
156
- <Placeholder height="large" width="large" />
157
- <Placeholder height="large" width="medium" />
158
- </DxcInline>
159
- </Container>
160
- <Title title="Gutter = 0.125rem" theme="light" level={4} />
161
- <Container>
162
- <DxcInline gutter="0.125rem">
163
- <Placeholder height="small" width="small" />
164
- <Placeholder height="medium" width="medium" />
165
- <Placeholder height="large" width="large" />
166
- <Placeholder height="small" width="large" />
167
- </DxcInline>
168
- </Container>
169
- <Title title="Gutter = 0.25rem" theme="light" level={4} />
170
- <Container>
171
- <DxcInline gutter="0.25rem">
172
- <Placeholder height="small" width="small" />
173
- <Placeholder height="medium" width="medium" />
174
- <Placeholder height="large" width="large" />
175
- <Placeholder height="small" width="large" />
176
- </DxcInline>
177
- </Container>
178
- <Title title="Gutter = 0.5rem" theme="light" level={4} />
179
- <Container>
180
- <DxcInline gutter="0.5rem">
181
- <Placeholder height="small" width="small" />
182
- <Placeholder height="medium" width="medium" />
183
- <Placeholder height="large" width="large" />
184
- <Placeholder height="small" width="large" />
185
- </DxcInline>
186
- </Container>
187
- <Title title="Gutter = 0.75rem" theme="light" level={4} />
188
- <Container>
189
- <DxcInline gutter="0.75rem">
190
- <Placeholder height="small" width="small" />
191
- <Placeholder height="medium" width="medium" />
192
- <Placeholder height="large" width="large" />
193
- <Placeholder height="small" width="large" />
194
- </DxcInline>
195
- </Container>
196
- <Title title="Gutter = 1rem" theme="light" level={4} />
197
- <Container>
198
- <DxcInline gutter="1rem">
199
- <Placeholder height="small" width="small" />
200
- <Placeholder height="medium" width="medium" />
201
- <Placeholder height="large" width="large" />
202
- <Placeholder height="small" width="large" />
203
- </DxcInline>
204
- </Container>
205
- <Title title="Gutter = 1.5rem" theme="light" level={4} />
206
- <Container>
207
- <DxcInline gutter="1.5rem">
208
- <Placeholder height="small" width="small" />
209
- <Placeholder height="medium" width="medium" />
210
- <Placeholder height="large" width="large" />
211
- <Placeholder height="small" width="large" />
212
- </DxcInline>
213
- </Container>
214
- <Title title="Gutter = 2rem and divider" theme="light" level={4} />
215
- <Container>
216
- <DxcInline gutter="2rem" divider>
217
- <Placeholder height="small" width="small" />
218
- <Placeholder height="medium" width="medium" />
219
- <Placeholder height="large" width="large" />
220
- <Placeholder height="small" width="large" />
221
- </DxcInline>
222
- </Container>
223
- <Title title="Gutter = 3rem" theme="light" level={4} />
224
- <Container>
225
- <DxcInline gutter="3rem">
226
- <Placeholder height="small" width="small" />
227
- <Placeholder height="medium" width="medium" />
228
- <Placeholder height="large" width="large" />
229
- </DxcInline>
230
- </Container>
231
- <Title title="Gutter = 4rem" theme="light" level={4} />
232
- <Container>
233
- <DxcInline gutter="4rem">
234
- <Placeholder height="small" width="small" />
235
- <Placeholder height="medium" width="medium" />
236
- </DxcInline>
237
- </Container>
238
- <Title title="Gutter = 5rem" theme="light" level={4} />
239
- <Container>
240
- <DxcInline gutter="5rem">
241
- <Placeholder height="small" width="small" />
242
- <Placeholder height="medium" width="medium" />
243
- </DxcInline>
244
- </Container>
245
- <Title title="Reverse" theme="light" level={4} />
246
- <Container>
247
- <DxcInline reverse>
248
- <Placeholder height="small" width="small">
249
- 1
250
- </Placeholder>
251
- <Placeholder height="medium" width="medium">
252
- 2
253
- </Placeholder>
254
- <Placeholder height="large" width="large">
255
- 3
256
- </Placeholder>
257
- <Placeholder height="small" width="large">
258
- 4
259
- </Placeholder>
260
- </DxcInline>
261
- </Container>
262
- <Title title="Wrapped and reversed children" theme="light" level={4} />
263
- <Container customWidth>
264
- <DxcInline reverse wrap>
265
- <Placeholder height="small" width="small">
266
- 1
267
- </Placeholder>
268
- <Placeholder height="medium" width="medium">
269
- 2
270
- </Placeholder>
271
- <Placeholder height="large" width="large">
272
- 3
273
- </Placeholder>
274
- <Placeholder height="small" width="large">
275
- 4
276
- </Placeholder>
277
- </DxcInline>
278
- </Container>
279
- </>
280
- );
281
-
282
- const FlexContainer = styled.div<{ customWidth?: boolean }>`
283
- display: flex;
284
- ${({ customWidth }) => customWidth && `width: 200px;`};
285
- background: #f2eafa;
286
- `;
287
-
288
- const Container = styled.div<{ customWidth?: boolean }>`
289
- background: #f2eafa;
290
- ${({ customWidth }) => customWidth && `width: 300px;`};
291
- `;
292
-
293
- type PlaceholderProps = {
294
- width?: "xlarge" | "large" | "medium" | "small" | "auto";
295
- height?: "large" | "medium" | "small" | "auto";
296
- };
297
-
298
- const Placeholder = styled.div<PlaceholderProps>`
299
- ${({ width }) =>
300
- width &&
301
- `width: ${width === "xlarge" ? "350px" : width === "large" ? "150px" : width === "medium" ? "100px" : "50px"};`};
302
- ${({ height }) => height && `height: ${height === "large" ? "150px" : height === "medium" ? "100px" : "50px"};`};
303
- border: 1px solid #a46ede;
304
- background-color: #e5d5f6;
305
- `;
package/inline/types.d.ts DELETED
@@ -1,36 +0,0 @@
1
- /// <reference types="react" />
2
- declare type Props = {
3
- /**
4
- * Sets whether the children are forced onto one line or can wrap onto multiple lines.
5
- */
6
- wrap?: boolean;
7
- /**
8
- * Alignment applied to children in the main axis.
9
- */
10
- alignX?: "start" | "end" | "center";
11
- /**
12
- * Alignment applied to children in the cross axis.
13
- */
14
- alignY?: "start" | "end" | "center" | "baseline" | "stretch";
15
- /**
16
- * Specifies the HTML tag or component that is rendered as the wrapper element.
17
- */
18
- as?: React.ElementType;
19
- /**
20
- * If true, a divider is shown between each child.
21
- */
22
- divider?: boolean;
23
- /**
24
- * Space applied between each child.
25
- */
26
- gutter?: "0rem" | "0.125rem" | "0.25rem" | "0.5rem" | "0.75rem" | "1rem" | "1.5rem" | "2rem" | "3rem" | "4rem" | "5rem";
27
- /**
28
- * If true, it changes the direction of the inline to reverse.
29
- */
30
- reverse?: boolean;
31
- /**
32
- * Custom content inside the stack.
33
- */
34
- children: React.ReactNode[] | React.ReactNode;
35
- };
36
- export default Props;
package/list/List.d.ts DELETED
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import ListPropsType from "./types";
3
- declare function List({ children, type, gutter }: ListPropsType): JSX.Element;
4
- export default List;
package/list/List.js DELETED
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
-
10
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
-
12
- var _react = _interopRequireDefault(require("react"));
13
-
14
- var _styledComponents = _interopRequireDefault(require("styled-components"));
15
-
16
- var _Stack = _interopRequireDefault(require("../stack/Stack"));
17
-
18
- var _Text = _interopRequireDefault(require("../text/Text"));
19
-
20
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
21
-
22
- function List(_ref) {
23
- var children = _ref.children,
24
- _ref$type = _ref.type,
25
- type = _ref$type === void 0 ? "disc" : _ref$type,
26
- _ref$gutter = _ref.gutter,
27
- gutter = _ref$gutter === void 0 ? "0.25rem" : _ref$gutter;
28
- return /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
29
- as: type === "number" ? "ol" : "ul",
30
- gutter: gutter
31
- }, _react["default"].Children.map(children, function (child, index) {
32
- return /*#__PURE__*/_react["default"].createElement(ListItem, null, type === "number" ? /*#__PURE__*/_react["default"].createElement(Number, null, /*#__PURE__*/_react["default"].createElement(_Text["default"], null, index + 1, ".")) : type === "square" ? /*#__PURE__*/_react["default"].createElement(Square, null) : type === "circle" ? /*#__PURE__*/_react["default"].createElement(Circle, null) : /*#__PURE__*/_react["default"].createElement(Disc, null), child);
33
- }));
34
- }
35
-
36
- var Number = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n user-select: none;\n margin-right: 10px;\n flex-shrink: 0;\n"])));
37
-
38
- var Square = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: black;\n width: 5px;\n height: 5px;\n flex-shrink: 0;\n margin-top: 10px;\n margin-right: 10px;\n"])));
39
-
40
- var Circle = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n width: 5px;\n height: 5px;\n border-radius: 50%;\n border: 1px solid black;\n flex-shrink: 0;\n margin-top: 10px;\n margin-right: 10px;\n box-sizing: border-box;\n"])));
41
-
42
- var Disc = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: black;\n width: 5px;\n height: 5px;\n border-radius: 50%;\n flex-shrink: 0;\n margin-top: 10px;\n margin-right: 10px;\n"])));
43
-
44
- var ListItem = _styledComponents["default"].li(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0px;\n padding: 0px;\n list-style: none;\n display: flex;\n"])));
45
-
46
- var _default = List;
47
- exports["default"] = _default;
@@ -1,89 +0,0 @@
1
- import React from "react";
2
- import styled from "styled-components";
3
- import Title from "../../.storybook/components/Title";
4
- import DxcList from "./List";
5
- import DxcText from "../text/Text";
6
-
7
- export default {
8
- title: "List",
9
- component: DxcList,
10
- };
11
-
12
- export const Chromatic = () => (
13
- <>
14
- <Title title="Default list" theme="light" level={4} />
15
- <DxcList>
16
- <DxcText>Text 1.</DxcText>
17
- <DxcText>Text 2.</DxcText>
18
- </DxcList>
19
- <Title title="Number" theme="light" level={4} />
20
- <DxcList type="number">
21
- <DxcText>Text 1.</DxcText>
22
- <DxcText>Text 2.</DxcText>
23
- </DxcList>
24
- <Title title="Square" theme="light" level={4} />
25
- <DxcList type="square">
26
- <DxcText>Text 1.</DxcText>
27
- <DxcText>Text 2.</DxcText>
28
- </DxcList>
29
- <Title title="Circle" theme="light" level={4} />
30
- <DxcList type="circle">
31
- <DxcText>Text 1.</DxcText>
32
- <DxcText>Text 2.</DxcText>
33
- </DxcList>
34
- <Title title="Multiple lines" theme="light" level={4} />
35
- <Container>
36
- <DxcList>
37
- <DxcText>
38
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
39
- magna aliqua.
40
- </DxcText>
41
- <DxcText>Text 2.</DxcText>
42
- </DxcList>
43
- </Container>
44
- <Title title="gutter = 0rem" theme="light" level={4} />
45
- <DxcList gutter="0rem">
46
- <DxcText>Text 1.</DxcText>
47
- <DxcText>Text 2.</DxcText>
48
- </DxcList>
49
- <Title title="gutter = 0.125rem" theme="light" level={4} />
50
- <DxcList gutter="0.125rem">
51
- <DxcText>Text 1.</DxcText>
52
- <DxcText>Text 2.</DxcText>
53
- </DxcList>
54
- <Title title="gutter = 0.25rem" theme="light" level={4} />
55
- <DxcList gutter="0.25rem">
56
- <DxcText>Text 1.</DxcText>
57
- <DxcText>Text 2.</DxcText>
58
- </DxcList>
59
- <Title title="gutter = 0.5rem" theme="light" level={4} />
60
- <DxcList gutter="0.5rem">
61
- <DxcText>Text 1.</DxcText>
62
- <DxcText>Text 2.</DxcText>
63
- </DxcList>
64
- <Title title="gutter = 0.75rem" theme="light" level={4} />
65
- <DxcList gutter="0.75rem">
66
- <DxcText>Text 1.</DxcText>
67
- <DxcText>Text 2.</DxcText>
68
- </DxcList>
69
- <Title title="gutter = 1rem" theme="light" level={4} />
70
- <DxcList gutter="1rem">
71
- <DxcText>Text 1.</DxcText>
72
- <DxcText>Text 2.</DxcText>
73
- </DxcList>
74
- <Title title="gutter = 1.5rem" theme="light" level={4} />
75
- <DxcList gutter="1.5rem">
76
- <DxcText>Text 1.</DxcText>
77
- <DxcText>Text 2.</DxcText>
78
- </DxcList>
79
- <Title title="gutter = 2rem" theme="light" level={4} />
80
- <DxcList gutter="2rem">
81
- <DxcText>Text 1.</DxcText>
82
- <DxcText>Text 2.</DxcText>
83
- </DxcList>
84
- </>
85
- );
86
-
87
- const Container = styled.div`
88
- width: 400px;
89
- `;
package/list/types.d.ts DELETED
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- declare type Props = {
3
- children: React.ReactNode;
4
- gutter?: "0rem" | "0.125rem" | "0.25rem" | "0.5rem" | "0.75rem" | "1rem" | "1.5rem" | "2rem";
5
- type?: "disc" | "circle" | "square" | "number";
6
- };
7
- export default Props;
package/row/Row.d.ts DELETED
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import RowPropsType from "./types";
3
- export default function Row({ gutter, align, justify, wrap, reverse, children, }: RowPropsType): JSX.Element;
package/row/Row.js DELETED
@@ -1,127 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = Row;
9
-
10
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
-
12
- var _react = _interopRequireDefault(require("react"));
13
-
14
- var _styledComponents = _interopRequireDefault(require("styled-components"));
15
-
16
- var _templateObject;
17
-
18
- function Row(_ref) {
19
- var _ref$gutter = _ref.gutter,
20
- gutter = _ref$gutter === void 0 ? "none" : _ref$gutter,
21
- align = _ref.align,
22
- justify = _ref.justify,
23
- _ref$wrap = _ref.wrap,
24
- wrap = _ref$wrap === void 0 ? true : _ref$wrap,
25
- _ref$reverse = _ref.reverse,
26
- reverse = _ref$reverse === void 0 ? false : _ref$reverse,
27
- children = _ref.children;
28
- return /*#__PURE__*/_react["default"].createElement(StyledRow, {
29
- gutter: gutter,
30
- align: align,
31
- justify: justify,
32
- wrap: wrap,
33
- reverse: reverse
34
- }, children);
35
- }
36
-
37
- var StyledRow = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n flex-wrap: ", ";\n align-items: ", ";\n justify-content: ", ";\n gap: ", ";\n"])), function (_ref2) {
38
- var reverse = _ref2.reverse;
39
- return reverse ? "row-reverse" : "row";
40
- }, function (_ref3) {
41
- var wrap = _ref3.wrap;
42
- return wrap ? "wrap" : "nowrap";
43
- }, function (_ref4) {
44
- var align = _ref4.align;
45
-
46
- switch (align) {
47
- case "start":
48
- return "flex-start";
49
-
50
- case "center":
51
- return "center";
52
-
53
- case "end":
54
- return "flex-end";
55
-
56
- case "baseline":
57
- return "baseline";
58
-
59
- case "stretch":
60
- return "stretch";
61
-
62
- default:
63
- return "initial";
64
- }
65
- }, function (_ref5) {
66
- var justify = _ref5.justify;
67
-
68
- switch (justify) {
69
- case "spaceBetween":
70
- return "space-between";
71
-
72
- case "spaceAround":
73
- return "space-around";
74
-
75
- case "spaceEvenly":
76
- return "space-evenly";
77
-
78
- case "start":
79
- return "flex-start";
80
-
81
- case "center":
82
- return "center";
83
-
84
- case "end":
85
- return "flex-end";
86
-
87
- default:
88
- return "initial";
89
- }
90
- }, function (_ref6) {
91
- var gutter = _ref6.gutter;
92
-
93
- switch (gutter) {
94
- case "none":
95
- return "0";
96
-
97
- case "xxxsmall":
98
- return "0.125rem";
99
-
100
- case "xxsmall":
101
- return "0.25rem";
102
-
103
- case "xsmall":
104
- return "0.5rem";
105
-
106
- case "small":
107
- return "1rem";
108
-
109
- case "medium":
110
- return "1.5rem";
111
-
112
- case "large":
113
- return "2rem";
114
-
115
- case "xlarge":
116
- return "3rem";
117
-
118
- case "xxlarge":
119
- return "4rem";
120
-
121
- case "xxxlarge":
122
- return "5rem";
123
-
124
- default:
125
- return "0";
126
- }
127
- });