@dxc-technology/halstack-react 0.0.0-dcd93c4 → 0.0.0-dddc3c4

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 (121) hide show
  1. package/accordion/types.d.ts +1 -1
  2. package/accordion-group/types.d.ts +1 -1
  3. package/bleed/Bleed.stories.tsx +63 -63
  4. package/bulleted-list/BulletedList.d.ts +7 -0
  5. package/bulleted-list/BulletedList.js +123 -0
  6. package/bulleted-list/BulletedList.stories.tsx +200 -0
  7. package/bulleted-list/types.d.ts +11 -0
  8. package/{inline → bulleted-list}/types.js +0 -0
  9. package/button/Button.js +43 -61
  10. package/button/Button.stories.tsx +9 -0
  11. package/button/types.d.ts +7 -7
  12. package/chip/types.d.ts +1 -1
  13. package/common/variables.js +52 -14
  14. package/date-input/DateInput.js +3 -3
  15. package/dialog/Dialog.js +52 -28
  16. package/dialog/Dialog.stories.tsx +1 -2
  17. package/dialog/Dialog.test.js +34 -4
  18. package/dialog/types.d.ts +2 -2
  19. package/dropdown/Dropdown.d.ts +1 -1
  20. package/dropdown/Dropdown.js +242 -246
  21. package/dropdown/Dropdown.stories.tsx +126 -63
  22. package/dropdown/Dropdown.test.js +510 -108
  23. package/dropdown/DropdownMenu.d.ts +4 -0
  24. package/dropdown/DropdownMenu.js +80 -0
  25. package/dropdown/DropdownMenuItem.d.ts +4 -0
  26. package/dropdown/DropdownMenuItem.js +92 -0
  27. package/dropdown/types.d.ts +25 -5
  28. package/flex/Flex.d.ts +4 -0
  29. package/flex/Flex.js +57 -0
  30. package/flex/Flex.stories.tsx +103 -0
  31. package/flex/types.d.ts +21 -0
  32. package/{list → flex}/types.js +0 -0
  33. package/footer/types.d.ts +1 -1
  34. package/header/Header.js +74 -72
  35. package/header/Header.stories.tsx +4 -4
  36. package/header/Icons.js +2 -2
  37. package/header/types.d.ts +2 -2
  38. package/inset/Inset.stories.tsx +4 -4
  39. package/layout/ApplicationLayout.d.ts +15 -6
  40. package/layout/ApplicationLayout.js +36 -64
  41. package/layout/ApplicationLayout.stories.tsx +80 -44
  42. package/layout/types.d.ts +17 -27
  43. package/link/Link.js +1 -1
  44. package/link/Link.stories.tsx +12 -5
  45. package/link/types.d.ts +1 -1
  46. package/main.d.ts +5 -9
  47. package/main.js +27 -59
  48. package/package.json +9 -9
  49. package/paragraph/Paragraph.d.ts +6 -0
  50. package/paragraph/Paragraph.js +38 -0
  51. package/paragraph/Paragraph.stories.tsx +44 -0
  52. package/progress-bar/ProgressBar.d.ts +2 -2
  53. package/progress-bar/ProgressBar.js +56 -50
  54. package/progress-bar/ProgressBar.stories.jsx +3 -1
  55. package/progress-bar/ProgressBar.test.js +67 -22
  56. package/progress-bar/types.d.ts +3 -4
  57. package/quick-nav/QuickNav.js +15 -13
  58. package/quick-nav/QuickNav.stories.tsx +41 -14
  59. package/radio-group/RadioGroup.js +11 -13
  60. package/select/Listbox.d.ts +1 -1
  61. package/select/Listbox.js +25 -1
  62. package/select/Select.js +14 -31
  63. package/select/Select.stories.tsx +6 -5
  64. package/select/Select.test.js +63 -50
  65. package/select/types.d.ts +2 -4
  66. package/sidenav/Sidenav.d.ts +6 -5
  67. package/sidenav/Sidenav.js +176 -55
  68. package/sidenav/Sidenav.stories.tsx +154 -156
  69. package/sidenav/Sidenav.test.js +25 -37
  70. package/sidenav/types.d.ts +50 -27
  71. package/slider/Slider.js +112 -97
  72. package/slider/Slider.stories.tsx +7 -1
  73. package/slider/Slider.test.js +121 -21
  74. package/slider/types.d.ts +2 -2
  75. package/switch/Switch.d.ts +1 -1
  76. package/switch/Switch.js +110 -54
  77. package/switch/Switch.stories.tsx +8 -30
  78. package/switch/Switch.test.js +122 -8
  79. package/switch/types.d.ts +3 -4
  80. package/tabs/Tab.d.ts +4 -0
  81. package/tabs/Tab.js +135 -0
  82. package/tabs/Tabs.js +360 -104
  83. package/tabs/Tabs.stories.tsx +74 -0
  84. package/tabs/Tabs.test.js +217 -6
  85. package/tabs/types.d.ts +15 -5
  86. package/tabs-nav/NavTabs.js +5 -5
  87. package/tabs-nav/Tab.js +3 -5
  88. package/tabs-nav/types.d.ts +1 -1
  89. package/tag/types.d.ts +1 -1
  90. package/text-input/TextInput.js +12 -21
  91. package/text-input/TextInput.stories.tsx +1 -2
  92. package/text-input/types.d.ts +1 -1
  93. package/toggle-group/types.d.ts +1 -1
  94. package/typography/Typography.d.ts +4 -0
  95. package/typography/Typography.js +131 -0
  96. package/typography/Typography.stories.tsx +198 -0
  97. package/typography/types.d.ts +18 -0
  98. package/{row → typography}/types.js +0 -0
  99. package/wizard/Wizard.js +9 -16
  100. package/wizard/Wizard.stories.tsx +20 -1
  101. package/wizard/types.d.ts +5 -4
  102. package/inline/Inline.d.ts +0 -4
  103. package/inline/Inline.js +0 -60
  104. package/inline/Inline.stories.tsx +0 -319
  105. package/inline/types.d.ts +0 -36
  106. package/list/List.d.ts +0 -4
  107. package/list/List.js +0 -47
  108. package/list/List.stories.tsx +0 -89
  109. package/list/types.d.ts +0 -7
  110. package/row/Row.d.ts +0 -3
  111. package/row/Row.js +0 -127
  112. package/row/Row.stories.tsx +0 -237
  113. package/row/types.d.ts +0 -28
  114. package/stack/Stack.d.ts +0 -4
  115. package/stack/Stack.js +0 -56
  116. package/stack/Stack.stories.tsx +0 -263
  117. package/stack/types.d.ts +0 -32
  118. package/stack/types.js +0 -5
  119. package/text/Text.d.ts +0 -7
  120. package/text/Text.js +0 -30
  121. package/text/Text.stories.tsx +0 -19
@@ -1,319 +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 (width) than the container" theme="light" level={4} />
34
- <FlexContainer customWidth>
35
- <DxcInline>
36
- <Placeholder height="large" width="xlarge" />
37
- </DxcInline>
38
- </FlexContainer>
39
- <Title title="One child larger (min-width) than the container" theme="light" level={4} />
40
- <FlexContainer customWidth customHeight>
41
- <DxcInline>
42
- <MinSizePlaceholder height="medium" />
43
- </DxcInline>
44
- </FlexContainer>
45
- <Title title="Wrap" theme="light" level={4} />
46
- <Container customWidth>
47
- <DxcInline wrap>
48
- <Placeholder height="large" width="small" />
49
- <Placeholder height="large" width="medium" />
50
- <Placeholder height="medium" width="small" />
51
- <Placeholder height="large" width="medium" />
52
- </DxcInline>
53
- </Container>
54
- <Title title="Nowrap in a non-flex container" theme="light" level={4} />
55
- <Container customWidth>
56
- <DxcInline>
57
- <Placeholder height="large" width="small" />
58
- <Placeholder height="large" width="medium" />
59
- <Placeholder height="medium" width="small" />
60
- <Placeholder height="small" width="medium" />
61
- <Placeholder height="large" width="small" />
62
- <Placeholder height="medium" width="large" />
63
- <Placeholder height="small" width="medium" />
64
- </DxcInline>
65
- </Container>
66
- <Title title="Nowrap in a flex container" theme="light" level={4} />
67
- <FlexContainer customWidth>
68
- <DxcInline>
69
- <Placeholder height="large" width="small" />
70
- <Placeholder height="large" width="medium" />
71
- <Placeholder height="medium" width="small" />
72
- <Placeholder height="small" width="medium" />
73
- <Placeholder height="large" width="small" />
74
- <Placeholder height="medium" width="large" />
75
- <Placeholder height="small" width="medium" />
76
- </DxcInline>
77
- </FlexContainer>
78
- <Title title="AlignY = start" theme="light" level={4} />
79
- <Container>
80
- <DxcInline alignY="stretch">
81
- <Placeholder width="small" />
82
- <Placeholder height="medium" width="medium" />
83
- <Placeholder height="large" width="large" />
84
- <Placeholder height="small" width="large" />
85
- </DxcInline>
86
- </Container>
87
- <Title title="AlignY = end with divider" theme="light" level={4} />
88
- <Container>
89
- <DxcInline alignY="end" divider>
90
- <Placeholder height="small" width="small" />
91
- <Placeholder height="medium" width="medium" />
92
- <Placeholder height="large" width="large" />
93
- <Placeholder height="small" width="large" />
94
- </DxcInline>
95
- </Container>
96
- <Title title="AlignY = center" theme="light" level={4} />
97
- <Container>
98
- <DxcInline alignY="center">
99
- <Placeholder height="small" width="small" />
100
- <Placeholder height="medium" width="medium" />
101
- <Placeholder height="large" width="large" />
102
- <Placeholder height="small" width="large" />
103
- </DxcInline>
104
- </Container>
105
- <Title title="AlignY with wrapped items" theme="light" level={4} />
106
- <Container customWidth>
107
- <DxcInline alignY="end" wrap>
108
- <Placeholder height="large" width="small" />
109
- <Placeholder height="large" width="medium" />
110
- <Placeholder height="medium" width="small" />
111
- <Placeholder height="large" width="medium" />
112
- <Placeholder height="medium" width="small" />
113
- <Placeholder height="small" width="medium" />
114
- </DxcInline>
115
- </Container>
116
- <Title title="AlignY = baseline" theme="light" level={4} />
117
- <Container>
118
- <DxcInline alignY="baseline">
119
- <Placeholder height="small" width="small" />
120
- <Placeholder height="medium" width="medium" />
121
- <Placeholder height="large" width="large" />
122
- <Placeholder height="small" width="large" />
123
- </DxcInline>
124
- </Container>
125
- <Title title="AlignX = start" theme="light" level={4} />
126
- <Container>
127
- <DxcInline alignX="start">
128
- <Placeholder height="small" width="small" />
129
- <Placeholder height="medium" width="medium" />
130
- <Placeholder height="large" width="large" />
131
- <Placeholder height="small" />
132
- </DxcInline>
133
- </Container>
134
- <Title title="AlignX = end with divider" theme="light" level={4} />
135
- <Container>
136
- <DxcInline alignX="end" divider>
137
- <Placeholder height="small" width="small" />
138
- <Placeholder height="medium" width="medium" />
139
- <Placeholder height="small" width="small" />
140
- <Placeholder height="large" width="large" />
141
- <Placeholder height="small" width="large" />
142
- </DxcInline>
143
- </Container>
144
- <Title title="AlignX = center" theme="light" level={4} />
145
- <Container>
146
- <DxcInline alignX="center">
147
- <Placeholder height="small" width="small" />
148
- <Placeholder height="medium" width="medium" />
149
- <Placeholder height="large" width="large" />
150
- <Placeholder height="small" width="large" />
151
- </DxcInline>
152
- </Container>
153
- <Title title="AlignX with wrapped items" theme="light" level={4} />
154
- <Container customWidth>
155
- <DxcInline alignX="center" wrap>
156
- <Placeholder height="small" width="small" />
157
- <Placeholder height="large" width="medium" />
158
- <Placeholder height="medium" width="small" />
159
- <Placeholder height="large" width="large" />
160
- <Placeholder height="medium" width="small" />
161
- <Placeholder height="small" width="large" />
162
- <Placeholder height="large" width="large" />
163
- <Placeholder height="large" width="medium" />
164
- </DxcInline>
165
- </Container>
166
- <Title title="Gutter = 0.125rem" theme="light" level={4} />
167
- <Container>
168
- <DxcInline gutter="0.125rem">
169
- <Placeholder height="small" width="small" />
170
- <Placeholder height="medium" width="medium" />
171
- <Placeholder height="large" width="large" />
172
- <Placeholder height="small" width="large" />
173
- </DxcInline>
174
- </Container>
175
- <Title title="Gutter = 0.25rem" theme="light" level={4} />
176
- <Container>
177
- <DxcInline gutter="0.25rem">
178
- <Placeholder height="small" width="small" />
179
- <Placeholder height="medium" width="medium" />
180
- <Placeholder height="large" width="large" />
181
- <Placeholder height="small" width="large" />
182
- </DxcInline>
183
- </Container>
184
- <Title title="Gutter = 0.5rem" theme="light" level={4} />
185
- <Container>
186
- <DxcInline gutter="0.5rem">
187
- <Placeholder height="small" width="small" />
188
- <Placeholder height="medium" width="medium" />
189
- <Placeholder height="large" width="large" />
190
- <Placeholder height="small" width="large" />
191
- </DxcInline>
192
- </Container>
193
- <Title title="Gutter = 0.75rem" theme="light" level={4} />
194
- <Container>
195
- <DxcInline gutter="0.75rem">
196
- <Placeholder height="small" width="small" />
197
- <Placeholder height="medium" width="medium" />
198
- <Placeholder height="large" width="large" />
199
- <Placeholder height="small" width="large" />
200
- </DxcInline>
201
- </Container>
202
- <Title title="Gutter = 1rem" theme="light" level={4} />
203
- <Container>
204
- <DxcInline gutter="1rem">
205
- <Placeholder height="small" width="small" />
206
- <Placeholder height="medium" width="medium" />
207
- <Placeholder height="large" width="large" />
208
- <Placeholder height="small" width="large" />
209
- </DxcInline>
210
- </Container>
211
- <Title title="Gutter = 1.5rem" theme="light" level={4} />
212
- <Container>
213
- <DxcInline gutter="1.5rem">
214
- <Placeholder height="small" width="small" />
215
- <Placeholder height="medium" width="medium" />
216
- <Placeholder height="large" width="large" />
217
- <Placeholder height="small" width="large" />
218
- </DxcInline>
219
- </Container>
220
- <Title title="Gutter = 2rem and divider" theme="light" level={4} />
221
- <Container>
222
- <DxcInline gutter="2rem" divider>
223
- <Placeholder height="small" width="small" />
224
- <Placeholder height="medium" width="medium" />
225
- <Placeholder height="large" width="large" />
226
- <Placeholder height="small" width="large" />
227
- </DxcInline>
228
- </Container>
229
- <Title title="Gutter = 3rem" theme="light" level={4} />
230
- <Container>
231
- <DxcInline gutter="3rem">
232
- <Placeholder height="small" width="small" />
233
- <Placeholder height="medium" width="medium" />
234
- <Placeholder height="large" width="large" />
235
- </DxcInline>
236
- </Container>
237
- <Title title="Gutter = 4rem" theme="light" level={4} />
238
- <Container>
239
- <DxcInline gutter="4rem">
240
- <Placeholder height="small" width="small" />
241
- <Placeholder height="medium" width="medium" />
242
- </DxcInline>
243
- </Container>
244
- <Title title="Gutter = 5rem" theme="light" level={4} />
245
- <Container>
246
- <DxcInline gutter="5rem">
247
- <Placeholder height="small" width="small" />
248
- <Placeholder height="medium" width="medium" />
249
- </DxcInline>
250
- </Container>
251
- <Title title="Reverse" theme="light" level={4} />
252
- <Container>
253
- <DxcInline reverse>
254
- <Placeholder height="small" width="small">
255
- 1
256
- </Placeholder>
257
- <Placeholder height="medium" width="medium">
258
- 2
259
- </Placeholder>
260
- <Placeholder height="large" width="large">
261
- 3
262
- </Placeholder>
263
- <Placeholder height="small" width="large">
264
- 4
265
- </Placeholder>
266
- </DxcInline>
267
- </Container>
268
- <Title title="Wrapped and reversed children" theme="light" level={4} />
269
- <Container customWidth>
270
- <DxcInline reverse wrap>
271
- <Placeholder height="small" width="small">
272
- 1
273
- </Placeholder>
274
- <Placeholder height="medium" width="medium">
275
- 2
276
- </Placeholder>
277
- <Placeholder height="large" width="large">
278
- 3
279
- </Placeholder>
280
- <Placeholder height="small" width="large">
281
- 4
282
- </Placeholder>
283
- </DxcInline>
284
- </Container>
285
- </>
286
- );
287
-
288
- const FlexContainer = styled.div<{ customWidth?: boolean, customHeight?: boolean }>`
289
- display: flex;
290
- ${({ customWidth }) => customWidth && `width: 200px;`};
291
- ${({ customHeight }) => customHeight && `height: 200px;`};
292
- background: #f2eafa;
293
- `;
294
-
295
- const Container = styled.div<{ customWidth?: boolean }>`
296
- background: #f2eafa;
297
- ${({ customWidth }) => customWidth && `width: 300px;`};
298
- `;
299
-
300
- type PlaceholderProps = {
301
- width?: "xlarge" | "large" | "medium" | "small" | "auto";
302
- height?: "large" | "medium" | "small" | "auto";
303
- };
304
-
305
- const Placeholder = styled.div<PlaceholderProps>`
306
- ${({ width }) =>
307
- width &&
308
- `width: ${width === "xlarge" ? "350px" : width === "large" ? "150px" : width === "medium" ? "100px" : "50px"};`};
309
- ${({ height }) => height && `height: ${height === "large" ? "150px" : height === "medium" ? "100px" : "50px"};`};
310
- border: 1px solid #a46ede;
311
- background-color: #e5d5f6;
312
- `;
313
-
314
- const MinSizePlaceholder = styled.div<PlaceholderProps>`
315
- min-width: 300px;
316
- ${({ height }) => height && `height: ${height === "large" ? "150px" : height === "medium" ? "100px" : "50px"};`};
317
- border: 1px solid #a46ede;
318
- background-color: #e5d5f6;
319
- `;
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
- });