@dxc-technology/halstack-react 0.0.0-d238e47 → 0.0.0-d291075

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/BackgroundColorContext.d.ts +10 -0
  2. package/BackgroundColorContext.js +1 -4
  3. package/HalstackContext.d.ts +12 -0
  4. package/HalstackContext.js +295 -0
  5. package/accordion/Accordion.d.ts +1 -1
  6. package/accordion/Accordion.js +15 -47
  7. package/accordion/Accordion.stories.tsx +307 -0
  8. package/accordion/Accordion.test.js +72 -0
  9. package/accordion/types.d.ts +8 -8
  10. package/accordion-group/AccordionGroup.d.ts +1 -1
  11. package/accordion-group/AccordionGroup.js +15 -17
  12. package/accordion-group/AccordionGroup.stories.tsx +225 -0
  13. package/accordion-group/AccordionGroup.test.js +151 -0
  14. package/accordion-group/types.d.ts +8 -8
  15. package/alert/Alert.js +6 -3
  16. package/alert/Alert.test.js +92 -0
  17. package/badge/Badge.d.ts +4 -0
  18. package/badge/Badge.js +6 -4
  19. package/badge/types.d.ts +5 -0
  20. package/{radio → badge}/types.js +0 -0
  21. package/bleed/Bleed.d.ts +3 -0
  22. package/bleed/Bleed.js +51 -0
  23. package/bleed/Bleed.stories.tsx +341 -0
  24. package/bleed/types.d.ts +37 -0
  25. package/bleed/types.js +5 -0
  26. package/box/Box.js +24 -34
  27. package/box/Box.test.js +18 -0
  28. package/button/Button.d.ts +1 -1
  29. package/button/Button.js +21 -26
  30. package/button/Button.stories.tsx +6 -8
  31. package/button/Button.test.js +35 -0
  32. package/button/types.d.ts +3 -7
  33. package/card/Card.js +25 -28
  34. package/card/Card.stories.tsx +1 -1
  35. package/card/Card.test.js +50 -0
  36. package/checkbox/Checkbox.d.ts +1 -1
  37. package/checkbox/Checkbox.js +45 -41
  38. package/checkbox/Checkbox.stories.tsx +124 -128
  39. package/checkbox/Checkbox.test.js +78 -0
  40. package/checkbox/types.d.ts +8 -4
  41. package/chip/Chip.d.ts +4 -0
  42. package/chip/Chip.js +16 -76
  43. package/chip/Chip.stories.tsx +6 -8
  44. package/chip/Chip.test.js +56 -0
  45. package/chip/types.d.ts +45 -0
  46. package/chip/types.js +5 -0
  47. package/common/variables.js +234 -341
  48. package/date-input/DateInput.js +63 -52
  49. package/date-input/DateInput.stories.tsx +7 -7
  50. package/date-input/DateInput.test.js +479 -0
  51. package/date-input/types.d.ts +16 -9
  52. package/dialog/Dialog.js +8 -35
  53. package/dialog/Dialog.test.js +40 -0
  54. package/dropdown/Dropdown.d.ts +1 -1
  55. package/dropdown/Dropdown.js +22 -48
  56. package/dropdown/Dropdown.stories.tsx +249 -0
  57. package/dropdown/Dropdown.test.js +189 -0
  58. package/dropdown/types.d.ts +6 -15
  59. package/file-input/FileInput.d.ts +1 -1
  60. package/file-input/FileInput.js +165 -83
  61. package/file-input/FileInput.stories.tsx +507 -0
  62. package/file-input/FileInput.test.js +457 -0
  63. package/file-input/FileItem.js +12 -8
  64. package/file-input/types.d.ts +32 -7
  65. package/footer/Footer.d.ts +1 -1
  66. package/footer/Footer.js +32 -113
  67. package/footer/{Footer.stories.jsx → Footer.stories.tsx} +1 -22
  68. package/footer/Footer.test.js +109 -0
  69. package/footer/Icons.d.ts +2 -0
  70. package/footer/Icons.js +4 -4
  71. package/footer/types.d.ts +21 -17
  72. package/header/Header.js +29 -50
  73. package/header/Header.stories.tsx +46 -36
  74. package/header/Header.test.js +79 -0
  75. package/header/Icons.d.ts +2 -0
  76. package/heading/Heading.js +1 -1
  77. package/heading/Heading.stories.tsx +3 -2
  78. package/heading/Heading.test.js +186 -0
  79. package/inline/Inline.d.ts +4 -0
  80. package/inline/Inline.js +54 -0
  81. package/inline/Inline.stories.tsx +240 -0
  82. package/inline/types.d.ts +32 -0
  83. package/inline/types.js +5 -0
  84. package/inset/Inset.d.ts +3 -0
  85. package/inset/Inset.js +51 -0
  86. package/inset/Inset.stories.tsx +229 -0
  87. package/inset/types.d.ts +37 -0
  88. package/inset/types.js +5 -0
  89. package/layout/ApplicationLayout.d.ts +11 -0
  90. package/layout/ApplicationLayout.js +84 -120
  91. package/layout/ApplicationLayout.stories.tsx +126 -0
  92. package/layout/Icons.d.ts +5 -0
  93. package/layout/Icons.js +13 -2
  94. package/layout/SidenavContext.d.ts +5 -0
  95. package/layout/SidenavContext.js +19 -0
  96. package/layout/types.d.ts +52 -0
  97. package/layout/types.js +5 -0
  98. package/link/Link.d.ts +3 -2
  99. package/link/Link.js +61 -86
  100. package/link/Link.stories.tsx +91 -51
  101. package/link/Link.test.js +83 -0
  102. package/link/types.d.ts +9 -29
  103. package/list/List.d.ts +4 -0
  104. package/list/List.js +47 -0
  105. package/list/List.stories.tsx +89 -0
  106. package/list/types.d.ts +7 -0
  107. package/list/types.js +5 -0
  108. package/main.d.ts +13 -9
  109. package/main.js +80 -42
  110. package/number-input/NumberInput.js +14 -24
  111. package/number-input/NumberInput.stories.tsx +5 -5
  112. package/number-input/NumberInput.test.js +506 -0
  113. package/number-input/types.d.ts +17 -10
  114. package/package.json +10 -6
  115. package/paginator/Paginator.js +19 -46
  116. package/paginator/Paginator.test.js +308 -0
  117. package/password-input/PasswordInput.js +23 -19
  118. package/password-input/PasswordInput.stories.tsx +3 -3
  119. package/password-input/PasswordInput.test.js +180 -0
  120. package/password-input/types.d.ts +26 -21
  121. package/progress-bar/ProgressBar.js +5 -5
  122. package/progress-bar/ProgressBar.stories.jsx +11 -11
  123. package/progress-bar/ProgressBar.test.js +65 -0
  124. package/quick-nav/QuickNav.d.ts +4 -0
  125. package/quick-nav/QuickNav.js +112 -0
  126. package/quick-nav/QuickNav.stories.tsx +237 -0
  127. package/quick-nav/types.d.ts +21 -0
  128. package/quick-nav/types.js +5 -0
  129. package/radio-group/Radio.d.ts +4 -0
  130. package/radio-group/Radio.js +141 -0
  131. package/radio-group/RadioGroup.d.ts +4 -0
  132. package/radio-group/RadioGroup.js +282 -0
  133. package/radio-group/RadioGroup.stories.tsx +100 -0
  134. package/radio-group/RadioGroup.test.js +695 -0
  135. package/radio-group/types.d.ts +114 -0
  136. package/radio-group/types.js +5 -0
  137. package/resultsetTable/ResultsetTable.d.ts +1 -1
  138. package/resultsetTable/ResultsetTable.js +9 -4
  139. package/resultsetTable/ResultsetTable.stories.tsx +275 -0
  140. package/resultsetTable/ResultsetTable.test.js +348 -0
  141. package/resultsetTable/types.d.ts +6 -2
  142. package/row/Row.d.ts +3 -0
  143. package/row/Row.js +127 -0
  144. package/row/Row.stories.tsx +237 -0
  145. package/row/types.d.ts +28 -0
  146. package/row/types.js +5 -0
  147. package/select/Icons.d.ts +10 -0
  148. package/select/Icons.js +93 -0
  149. package/select/Listbox.d.ts +4 -0
  150. package/select/Listbox.js +175 -0
  151. package/select/Option.d.ts +4 -0
  152. package/select/Option.js +110 -0
  153. package/select/Select.d.ts +4 -0
  154. package/select/Select.js +161 -366
  155. package/select/Select.stories.tsx +230 -176
  156. package/select/Select.test.js +2162 -0
  157. package/select/types.d.ts +212 -0
  158. package/select/types.js +5 -0
  159. package/sidenav/Sidenav.d.ts +1 -1
  160. package/sidenav/Sidenav.js +22 -11
  161. package/sidenav/Sidenav.stories.tsx +18 -1
  162. package/sidenav/Sidenav.test.js +56 -0
  163. package/slider/Slider.d.ts +1 -1
  164. package/slider/Slider.js +4 -3
  165. package/slider/Slider.stories.tsx +8 -8
  166. package/slider/Slider.test.js +150 -0
  167. package/slider/types.d.ts +4 -0
  168. package/spinner/Spinner.js +3 -3
  169. package/spinner/Spinner.stories.jsx +1 -0
  170. package/spinner/Spinner.test.js +64 -0
  171. package/stack/Stack.d.ts +4 -0
  172. package/stack/Stack.js +50 -0
  173. package/stack/Stack.stories.tsx +203 -0
  174. package/stack/types.d.ts +28 -0
  175. package/stack/types.js +5 -0
  176. package/switch/Switch.d.ts +1 -1
  177. package/switch/Switch.js +37 -21
  178. package/switch/Switch.stories.tsx +15 -15
  179. package/switch/Switch.test.js +98 -0
  180. package/switch/types.d.ts +6 -2
  181. package/table/Table.js +2 -2
  182. package/table/Table.stories.jsx +2 -1
  183. package/table/Table.test.js +26 -0
  184. package/tabs/Tabs.d.ts +1 -1
  185. package/tabs/Tabs.js +17 -19
  186. package/tabs/Tabs.stories.tsx +112 -0
  187. package/tabs/Tabs.test.js +140 -0
  188. package/tabs/types.d.ts +27 -15
  189. package/tabs-nav/NavTabs.d.ts +8 -0
  190. package/tabs-nav/NavTabs.js +125 -0
  191. package/tabs-nav/NavTabs.stories.tsx +170 -0
  192. package/tabs-nav/NavTabs.test.js +82 -0
  193. package/tabs-nav/Tab.d.ts +4 -0
  194. package/tabs-nav/Tab.js +132 -0
  195. package/tabs-nav/types.d.ts +53 -0
  196. package/tabs-nav/types.js +5 -0
  197. package/tag/Tag.d.ts +1 -1
  198. package/tag/Tag.js +18 -28
  199. package/tag/Tag.stories.tsx +26 -29
  200. package/tag/Tag.test.js +60 -0
  201. package/tag/types.d.ts +23 -14
  202. package/text/Text.d.ts +7 -0
  203. package/text/Text.js +30 -0
  204. package/text/Text.stories.tsx +19 -0
  205. package/text-input/Suggestion.d.ts +4 -0
  206. package/text-input/Suggestion.js +55 -0
  207. package/text-input/TextInput.js +88 -103
  208. package/text-input/TextInput.stories.tsx +474 -0
  209. package/text-input/TextInput.test.js +1712 -0
  210. package/text-input/types.d.ts +44 -23
  211. package/textarea/Textarea.d.ts +4 -0
  212. package/textarea/Textarea.js +39 -79
  213. package/textarea/Textarea.stories.jsx +37 -15
  214. package/textarea/Textarea.test.js +437 -0
  215. package/textarea/types.d.ts +137 -0
  216. package/textarea/types.js +5 -0
  217. package/toggle-group/ToggleGroup.d.ts +4 -0
  218. package/toggle-group/ToggleGroup.js +18 -46
  219. package/toggle-group/ToggleGroup.stories.tsx +27 -32
  220. package/toggle-group/ToggleGroup.test.js +156 -0
  221. package/toggle-group/types.d.ts +105 -0
  222. package/toggle-group/types.js +5 -0
  223. package/useTheme.d.ts +2 -0
  224. package/useTheme.js +2 -2
  225. package/useTranslatedLabels.d.ts +2 -0
  226. package/useTranslatedLabels.js +20 -0
  227. package/wizard/Wizard.d.ts +1 -1
  228. package/wizard/Wizard.js +107 -46
  229. package/wizard/{Wizard.stories.jsx → Wizard.stories.tsx} +13 -23
  230. package/wizard/Wizard.test.js +141 -0
  231. package/wizard/types.d.ts +9 -9
  232. package/ThemeContext.js +0 -246
  233. package/V3Select/V3Select.js +0 -455
  234. package/V3Select/index.d.ts +0 -27
  235. package/V3Textarea/V3Textarea.js +0 -260
  236. package/V3Textarea/index.d.ts +0 -27
  237. package/chip/index.d.ts +0 -22
  238. package/date/Date.js +0 -373
  239. package/date/index.d.ts +0 -27
  240. package/input-text/Icons.js +0 -22
  241. package/input-text/InputText.js +0 -611
  242. package/input-text/index.d.ts +0 -36
  243. package/radio/Radio.d.ts +0 -4
  244. package/radio/Radio.js +0 -174
  245. package/radio/Radio.stories.tsx +0 -192
  246. package/radio/types.d.ts +0 -54
  247. package/select/index.d.ts +0 -131
  248. package/textarea/index.d.ts +0 -117
  249. package/toggle/Toggle.js +0 -186
  250. package/toggle/index.d.ts +0 -21
  251. package/toggle-group/index.d.ts +0 -21
  252. package/upload/Upload.js +0 -201
  253. package/upload/buttons-upload/ButtonsUpload.js +0 -111
  254. package/upload/buttons-upload/Icons.js +0 -40
  255. package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
  256. package/upload/dragAndDropArea/Icons.js +0 -39
  257. package/upload/file-upload/FileToUpload.js +0 -115
  258. package/upload/file-upload/Icons.js +0 -66
  259. package/upload/files-upload/FilesToUpload.js +0 -109
  260. package/upload/index.d.ts +0 -15
  261. package/upload/transaction/Icons.js +0 -160
  262. package/upload/transaction/Transaction.js +0 -104
  263. package/upload/transactions/Transactions.js +0 -94
  264. package/wizard/Icons.js +0 -65
@@ -0,0 +1,240 @@
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>
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="AlignY = start" theme="light" level={4} />
49
+ <Container>
50
+ <DxcInline alignY="stretch">
51
+ <Placeholder width="small" />
52
+ <Placeholder height="medium" width="medium" />
53
+ <Placeholder height="large" width="large" />
54
+ <Placeholder height="small" width="large" />
55
+ </DxcInline>
56
+ </Container>
57
+ <Title title="AlignY = end" theme="light" level={4} />
58
+ <Container>
59
+ <DxcInline alignY="end">
60
+ <Placeholder height="small" width="small" />
61
+ <Placeholder height="medium" width="medium" />
62
+ <Placeholder height="large" width="large" />
63
+ <Placeholder height="small" width="large" />
64
+ </DxcInline>
65
+ </Container>
66
+ <Title title="AlignY = center" theme="light" level={4} />
67
+ <Container>
68
+ <DxcInline alignY="center">
69
+ <Placeholder height="small" width="small" />
70
+ <Placeholder height="medium" width="medium" />
71
+ <Placeholder height="large" width="large" />
72
+ <Placeholder height="small" width="large" />
73
+ </DxcInline>
74
+ </Container>
75
+ <Title title="AlignY with wrapped items" theme="light" level={4} />
76
+ <Container customWidth>
77
+ <DxcInline alignY="end">
78
+ <Placeholder height="large" width="small" />
79
+ <Placeholder height="large" width="medium" />
80
+ <Placeholder height="medium" width="small" />
81
+ <Placeholder height="large" width="medium" />
82
+ <Placeholder height="medium" width="small" />
83
+ <Placeholder height="small" width="medium" />
84
+ </DxcInline>
85
+ </Container>
86
+ <Title title="AlignY = baseline" theme="light" level={4} />
87
+ <Container>
88
+ <DxcInline alignY="baseline">
89
+ <Placeholder height="small" width="small" />
90
+ <Placeholder height="medium" width="medium" />
91
+ <Placeholder height="large" width="large" />
92
+ <Placeholder height="small" width="large" />
93
+ </DxcInline>
94
+ </Container>
95
+ <Title title="AlignX = start" theme="light" level={4} />
96
+ <Container>
97
+ <DxcInline alignX="start">
98
+ <Placeholder height="small" width="small" />
99
+ <Placeholder height="medium" width="medium" />
100
+ <Placeholder height="large" width="large" />
101
+ <Placeholder height="small" />
102
+ </DxcInline>
103
+ </Container>
104
+ <Title title="AlignX = end" theme="light" level={4} />
105
+ <Container>
106
+ <DxcInline alignX="end">
107
+ <Placeholder height="small" width="small" />
108
+ <Placeholder height="medium" width="medium" />
109
+ <Placeholder height="small" width="small" />
110
+ <Placeholder height="large" width="large" />
111
+ <Placeholder height="small" width="large" />
112
+ </DxcInline>
113
+ </Container>
114
+ <Title title="AlignX = center" theme="light" level={4} />
115
+ <Container>
116
+ <DxcInline alignX="center">
117
+ <Placeholder height="small" width="small" />
118
+ <Placeholder height="medium" width="medium" />
119
+ <Placeholder height="large" width="large" />
120
+ <Placeholder height="small" width="large" />
121
+ </DxcInline>
122
+ </Container>
123
+ <Title title="AlignX with wrapped items" theme="light" level={4} />
124
+ <Container customWidth>
125
+ <DxcInline alignX="center">
126
+ <Placeholder height="small" width="small" />
127
+ <Placeholder height="large" width="medium" />
128
+ <Placeholder height="medium" width="small" />
129
+ <Placeholder height="large" width="large" />
130
+ <Placeholder height="medium" width="small" />
131
+ <Placeholder height="small" width="large" />
132
+ <Placeholder height="large" width="large" />
133
+ <Placeholder height="large" width="medium" />
134
+ </DxcInline>
135
+ </Container>
136
+ <Title title="Gutter = 0.125rem" theme="light" level={4} />
137
+ <Container>
138
+ <DxcInline gutter="0.125rem">
139
+ <Placeholder height="small" width="small" />
140
+ <Placeholder height="medium" width="medium" />
141
+ <Placeholder height="large" width="large" />
142
+ <Placeholder height="small" width="large" />
143
+ </DxcInline>
144
+ </Container>
145
+ <Title title="Gutter = 0.25rem" theme="light" level={4} />
146
+ <Container>
147
+ <DxcInline gutter="0.25rem">
148
+ <Placeholder height="small" width="small" />
149
+ <Placeholder height="medium" width="medium" />
150
+ <Placeholder height="large" width="large" />
151
+ <Placeholder height="small" width="large" />
152
+ </DxcInline>
153
+ </Container>
154
+ <Title title="Gutter = 0.5rem" theme="light" level={4} />
155
+ <Container>
156
+ <DxcInline gutter="0.5rem">
157
+ <Placeholder height="small" width="small" />
158
+ <Placeholder height="medium" width="medium" />
159
+ <Placeholder height="large" width="large" />
160
+ <Placeholder height="small" width="large" />
161
+ </DxcInline>
162
+ </Container>
163
+ <Title title="Gutter = 0.75rem" theme="light" level={4} />
164
+ <Container>
165
+ <DxcInline gutter="0.75rem">
166
+ <Placeholder height="small" width="small" />
167
+ <Placeholder height="medium" width="medium" />
168
+ <Placeholder height="large" width="large" />
169
+ <Placeholder height="small" width="large" />
170
+ </DxcInline>
171
+ </Container>
172
+ <Title title="Gutter = 1rem" theme="light" level={4} />
173
+ <Container>
174
+ <DxcInline gutter="1rem">
175
+ <Placeholder height="small" width="small" />
176
+ <Placeholder height="medium" width="medium" />
177
+ <Placeholder height="large" width="large" />
178
+ <Placeholder height="small" width="large" />
179
+ </DxcInline>
180
+ </Container>
181
+ <Title title="Gutter = 1.5rem" theme="light" level={4} />
182
+ <Container>
183
+ <DxcInline gutter="1.5rem">
184
+ <Placeholder height="small" width="small" />
185
+ <Placeholder height="medium" width="medium" />
186
+ <Placeholder height="large" width="large" />
187
+ <Placeholder height="small" width="large" />
188
+ </DxcInline>
189
+ </Container>
190
+ <Title title="Gutter = 2rem and divider" theme="light" level={4} />
191
+ <Container>
192
+ <DxcInline gutter="2rem" divider>
193
+ <Placeholder height="small" width="small" />
194
+ <Placeholder height="medium" width="medium" />
195
+ <Placeholder height="large" width="large" />
196
+ <Placeholder height="small" width="large" />
197
+ </DxcInline>
198
+ </Container>
199
+ <Title title="Reverse" theme="light" level={4} />
200
+ <Container>
201
+ <DxcInline reverse>
202
+ <Placeholder height="small" width="small">
203
+ 1
204
+ </Placeholder>
205
+ <Placeholder height="medium" width="medium">
206
+ 2
207
+ </Placeholder>
208
+ <Placeholder height="large" width="large">
209
+ 3
210
+ </Placeholder>
211
+ <Placeholder height="small" width="large">
212
+ 4
213
+ </Placeholder>
214
+ </DxcInline>
215
+ </Container>
216
+ </>
217
+ );
218
+
219
+ const FlexContainer = styled.div<{ customWidth?: boolean }>`
220
+ display: flex;
221
+ ${({ customWidth }) => customWidth && `width: 200px;`};
222
+ background: #f2eafa;
223
+ `;
224
+
225
+ const Container = styled.div<{ customWidth?: boolean }>`
226
+ background: #f2eafa;
227
+ ${({ customWidth }) => customWidth && `width: 300px;`};
228
+ `;
229
+
230
+ type PlaceholderProps = {
231
+ width?: "xlarge" | "large" | "medium" | "small" | "auto";
232
+ height?: "large" | "medium" | "small" | "auto";
233
+ };
234
+
235
+ const Placeholder = styled.div<PlaceholderProps>`
236
+ ${({ width }) => width && `width: ${width === "xlarge" ? "350px" : width === "large" ? "150px" : width === "medium" ? "100px" : "50px"};`};
237
+ ${({ height }) => height && `height: ${height === "large" ? "150px" : height === "medium" ? "100px" : "50px"};`};
238
+ border: 1px solid #a46ede;
239
+ background-color: #e5d5f6;
240
+ `;
@@ -0,0 +1,32 @@
1
+ /// <reference types="react" />
2
+ declare type Props = {
3
+ /**
4
+ * Alignment applied to children in the main axis.
5
+ */
6
+ alignX?: "start" | "end" | "center";
7
+ /**
8
+ * Alignment applied to children in the cross axis.
9
+ */
10
+ alignY?: "start" | "end" | "center" | "baseline" | "stretch";
11
+ /**
12
+ * Specifies the HTML tag or component that is rendered as the wrapper element.
13
+ */
14
+ as?: React.ElementType;
15
+ /**
16
+ * If true, a divider is shown between each child.
17
+ */
18
+ divider?: boolean;
19
+ /**
20
+ * Space applied between each child.
21
+ */
22
+ gutter?: "0rem" | "0.125rem" | "0.25rem" | "0.5rem" | "0.75rem" | "1rem" | "1.5rem" | "2rem";
23
+ /**
24
+ * If true, it changes the direction of the inline to reverse.
25
+ */
26
+ reverse?: boolean;
27
+ /**
28
+ * Custom content inside the stack.
29
+ */
30
+ children: React.ReactElement<React.ReactNode>[] | React.ReactElement<React.ReactNode>;
31
+ };
32
+ export default Props;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import InsetPropsType from "./types";
3
+ export default function Inset({ space, horizontal, vertical, top, right, bottom, left, children, }: InsetPropsType): JSX.Element;
package/inset/Inset.js ADDED
@@ -0,0 +1,51 @@
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"] = Inset;
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 Inset(_ref) {
19
+ var space = _ref.space,
20
+ horizontal = _ref.horizontal,
21
+ vertical = _ref.vertical,
22
+ top = _ref.top,
23
+ right = _ref.right,
24
+ bottom = _ref.bottom,
25
+ left = _ref.left,
26
+ children = _ref.children;
27
+ return /*#__PURE__*/_react["default"].createElement(StyledInset, {
28
+ space: space,
29
+ horizontal: horizontal,
30
+ vertical: vertical,
31
+ top: top,
32
+ right: right,
33
+ bottom: bottom,
34
+ left: left
35
+ }, children);
36
+ }
37
+
38
+ function getSpacingValue(spacingName) {
39
+ return spacingName ? spacingName : "0rem";
40
+ }
41
+
42
+ var StyledInset = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n"])), function (_ref2) {
43
+ var space = _ref2.space,
44
+ horizontal = _ref2.horizontal,
45
+ vertical = _ref2.vertical,
46
+ top = _ref2.top,
47
+ right = _ref2.right,
48
+ bottom = _ref2.bottom,
49
+ left = _ref2.left;
50
+ return "\n padding: ".concat(getSpacingValue(top || vertical || space), " ").concat(getSpacingValue(right || horizontal || space), "\n ").concat(getSpacingValue(bottom || vertical || space), " ").concat(getSpacingValue(left || horizontal || space), ";\n");
51
+ });
@@ -0,0 +1,229 @@
1
+ import React from "react";
2
+ import Title from "../../.storybook/components/Title";
3
+ import styled from "styled-components";
4
+ import DxcStack from "./../stack/Stack";
5
+ import DxcInset from "./Inset";
6
+
7
+ export default {
8
+ title: "Inset",
9
+ component: DxcInset,
10
+ };
11
+
12
+ export const Chromatic = () => (
13
+ <>
14
+ <Title title="Default" level={4} />
15
+ <Container>
16
+ <DxcInset>
17
+ <Placeholder></Placeholder>
18
+ </DxcInset>
19
+ </Container>
20
+ <Title title="space = none" level={4} />
21
+ <Container>
22
+ <DxcInset space="0rem">
23
+ <Placeholder></Placeholder>
24
+ </DxcInset>
25
+ </Container>
26
+ <Title title="space = xxxsmall" level={4} />
27
+ <Container>
28
+ <DxcInset space="0.125rem">
29
+ <Placeholder></Placeholder>
30
+ </DxcInset>
31
+ </Container>
32
+ <Title title="space = xxsmall" level={4} />
33
+ <Container>
34
+ <DxcInset space="0.25rem">
35
+ <Placeholder></Placeholder>
36
+ </DxcInset>
37
+ </Container>
38
+ <Title title="space = xsmall" level={4} />
39
+ <Container>
40
+ <DxcInset space="0.5rem">
41
+ <Placeholder></Placeholder>
42
+ </DxcInset>
43
+ </Container>
44
+ <Title title="space = small" level={4} />
45
+ <Container>
46
+ <DxcInset space="1rem">
47
+ <Placeholder></Placeholder>
48
+ </DxcInset>
49
+ </Container>
50
+ <Title title="space = medium" level={4} />
51
+ <Container>
52
+ <DxcInset space="1.5rem">
53
+ <Placeholder></Placeholder>
54
+ </DxcInset>
55
+ </Container>
56
+ <Title title="space = large" level={4} />
57
+ <Container>
58
+ <DxcInset space="2rem">
59
+ <Placeholder></Placeholder>
60
+ </DxcInset>
61
+ </Container>
62
+ <Title title="space = xlarge" level={4} />
63
+ <Container>
64
+ <DxcInset space="3rem">
65
+ <Placeholder></Placeholder>
66
+ </DxcInset>
67
+ </Container>
68
+ <Title title="space = xxlarge" level={4} />
69
+ <Container>
70
+ <DxcInset space="4rem">
71
+ <Placeholder></Placeholder>
72
+ </DxcInset>
73
+ </Container>
74
+ <Title title="space = xxxlarge" level={4} />
75
+ <Container>
76
+ <DxcInset space="5rem">
77
+ <Placeholder></Placeholder>
78
+ </DxcInset>
79
+ </Container>
80
+ <Title title="horizontal = none" level={4} />
81
+ <Container>
82
+ <DxcInset horizontal="0rem">
83
+ <Placeholder></Placeholder>
84
+ </DxcInset>
85
+ </Container>
86
+ <Title title="horizontal = xxxsmall" level={4} />
87
+ <Container>
88
+ <DxcInset horizontal="0.125rem">
89
+ <Placeholder></Placeholder>
90
+ </DxcInset>
91
+ </Container>
92
+ <Title title="horizontal = xxsmall" level={4} />
93
+ <Container>
94
+ <DxcInset horizontal="0.25rem">
95
+ <Placeholder></Placeholder>
96
+ </DxcInset>
97
+ </Container>
98
+ <Title title="horizontal = xsmall" level={4} />
99
+ <Container>
100
+ <DxcInset horizontal="0.5rem">
101
+ <Placeholder></Placeholder>
102
+ </DxcInset>
103
+ </Container>
104
+ <Title title="horizontal = small" level={4} />
105
+ <Container>
106
+ <DxcInset horizontal="1rem">
107
+ <Placeholder></Placeholder>
108
+ </DxcInset>
109
+ </Container>
110
+ <Title title="horizontal = medium" level={4} />
111
+ <Container>
112
+ <DxcInset horizontal="1.5rem">
113
+ <Placeholder></Placeholder>
114
+ </DxcInset>
115
+ </Container>
116
+ <Title title="horizontal = large" level={4} />
117
+ <Container>
118
+ <DxcInset horizontal="2rem">
119
+ <Placeholder></Placeholder>
120
+ </DxcInset>
121
+ </Container>
122
+ <Title title="horizontal = xlarge" level={4} />
123
+ <Container>
124
+ <DxcInset horizontal="3rem">
125
+ <Placeholder></Placeholder>
126
+ </DxcInset>
127
+ </Container>
128
+ <Title title="horizontal = xxlarge" level={4} />
129
+ <Container>
130
+ <DxcInset horizontal="4rem">
131
+ <Placeholder></Placeholder>
132
+ </DxcInset>
133
+ </Container>
134
+ <Title title="horizontal = xxxlarge" level={4} />
135
+ <Container>
136
+ <DxcInset horizontal="5rem">
137
+ <Placeholder></Placeholder>
138
+ </DxcInset>
139
+ </Container>
140
+ <Title title="vertical = none" level={4} />
141
+ <Container>
142
+ <DxcInset vertical="0rem">
143
+ <Placeholder></Placeholder>
144
+ </DxcInset>
145
+ </Container>
146
+ <Title title="vertical = xxxsmall" level={4} />
147
+ <Container>
148
+ <DxcInset vertical="0.125rem">
149
+ <Placeholder></Placeholder>
150
+ </DxcInset>
151
+ </Container>
152
+ <Title title="vertical = xxsmall" level={4} />
153
+ <Container>
154
+ <DxcInset vertical="0.25rem">
155
+ <Placeholder></Placeholder>
156
+ </DxcInset>
157
+ </Container>
158
+ <Title title="vertical = xsmall" level={4} />
159
+ <Container>
160
+ <DxcInset vertical="0.5rem">
161
+ <Placeholder></Placeholder>
162
+ </DxcInset>
163
+ </Container>
164
+ <Title title="vertical = small" level={4} />
165
+ <Container>
166
+ <DxcInset vertical="1rem">
167
+ <Placeholder></Placeholder>
168
+ </DxcInset>
169
+ </Container>
170
+ <Title title="vertical = medium" level={4} />
171
+ <Container>
172
+ <DxcInset vertical="1.5rem">
173
+ <Placeholder></Placeholder>
174
+ </DxcInset>
175
+ </Container>
176
+ <Title title="vertical = large" level={4} />
177
+ <Container>
178
+ <DxcInset vertical="2rem">
179
+ <Placeholder></Placeholder>
180
+ </DxcInset>
181
+ </Container>
182
+ <Title title="vertical = xlarge" level={4} />
183
+ <Container>
184
+ <DxcInset vertical="3rem">
185
+ <Placeholder></Placeholder>
186
+ </DxcInset>
187
+ </Container>
188
+ <Title title="vertical = xxlarge" level={4} />
189
+ <Container>
190
+ <DxcInset vertical="4rem">
191
+ <Placeholder></Placeholder>
192
+ </DxcInset>
193
+ </Container>
194
+ <Title title="vertical = xxxlarge" level={4} />
195
+ <Container>
196
+ <DxcInset vertical="5rem">
197
+ <Placeholder></Placeholder>
198
+ </DxcInset>
199
+ </Container>
200
+ <Title title="top = xxsmall, right= medium, bottom = large and left = xxlarge" level={4} />
201
+ <Container>
202
+ <DxcInset top="0.25rem" right="1.5rem" bottom="2rem" left="4rem">
203
+ <Placeholder></Placeholder>
204
+ </DxcInset>
205
+ </Container>
206
+ <Title title="Inside a stack" level={4} />
207
+ <Container>
208
+ <DxcStack gutter="0.75rem" divider>
209
+ <Placeholder></Placeholder>
210
+ <DxcInset top="0.25rem" right="1.5rem" bottom="2rem" left="4rem">
211
+ <Placeholder></Placeholder>
212
+ </DxcInset>
213
+ <Placeholder></Placeholder>
214
+ </DxcStack>
215
+ </Container>
216
+ </>
217
+ );
218
+
219
+ const Container = styled.div`
220
+ background: #f2eafa;
221
+ margin: 2.5rem;
222
+ `;
223
+
224
+ const Placeholder = styled.div`
225
+ min-height: 40px;
226
+ min-width: 120px;
227
+ border: 1px solid #a46ede;
228
+ background-color: #e5d5f6;
229
+ `;
@@ -0,0 +1,37 @@
1
+ /// <reference types="react" />
2
+ declare type Spacing = "0rem" | "0.125rem" | "0.25rem" | "0.5rem" | "1rem" | "1.5rem" | "2rem" | "3rem" | "4rem" | "5rem";
3
+ declare type Props = {
4
+ /**
5
+ * Applies the spacing scale to all sides.
6
+ */
7
+ space?: Spacing;
8
+ /**
9
+ * Applies the spacing scale to the left and right sides.
10
+ */
11
+ horizontal?: Spacing;
12
+ /**
13
+ * Applies the spacing scale to the top and bottom sides.
14
+ */
15
+ vertical?: Spacing;
16
+ /**
17
+ * Applies the spacing scale to the top side.
18
+ */
19
+ top?: Spacing;
20
+ /**
21
+ * Applies the spacing scale to the right side.
22
+ */
23
+ right?: Spacing;
24
+ /**
25
+ * Applies the spacing scale to the bottom side.
26
+ */
27
+ bottom?: Spacing;
28
+ /**
29
+ * Applies the spacing scale to the left side.
30
+ */
31
+ left?: Spacing;
32
+ /**
33
+ * Custom content inside the inset.
34
+ */
35
+ children: React.ReactNode;
36
+ };
37
+ export default Props;
package/inset/types.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import AppLayoutPropsType, { AppLayoutSidenavPropsType, AppLayoutFooterPropsType, AppLayoutMainPropsType, AppLayoutHeaderPropsType } from "./types";
3
+ declare const DxcApplicationLayout: {
4
+ ({ visibilityToggleLabel, children }: AppLayoutPropsType): JSX.Element;
5
+ Header: ({ children }: AppLayoutHeaderPropsType) => JSX.Element;
6
+ Main: ({ children }: AppLayoutMainPropsType) => JSX.Element;
7
+ Footer: ({ children }: AppLayoutFooterPropsType) => JSX.Element;
8
+ SideNav: ({ ...childProps }: AppLayoutSidenavPropsType) => JSX.Element;
9
+ useResponsiveSidenavVisibility: () => (isSidenavVisible: boolean) => void;
10
+ };
11
+ export default DxcApplicationLayout;