@dxc-technology/halstack-react 0.0.0-adde6ce → 0.0.0-adfc848

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 (259) hide show
  1. package/README.md +46 -0
  2. package/dist/index.d.mts +4011 -0
  3. package/dist/index.d.ts +4011 -0
  4. package/dist/index.js +14933 -0
  5. package/dist/index.mjs +14844 -0
  6. package/package.json +86 -71
  7. package/BackgroundColorContext.d.ts +0 -10
  8. package/BackgroundColorContext.js +0 -47
  9. package/ThemeContext.d.ts +0 -15
  10. package/ThemeContext.js +0 -243
  11. package/V3Select/V3Select.js +0 -455
  12. package/V3Select/index.d.ts +0 -27
  13. package/V3Textarea/V3Textarea.js +0 -260
  14. package/V3Textarea/index.d.ts +0 -27
  15. package/accordion/Accordion.d.ts +0 -4
  16. package/accordion/Accordion.js +0 -258
  17. package/accordion/Accordion.stories.tsx +0 -307
  18. package/accordion/types.d.ts +0 -68
  19. package/accordion/types.js +0 -5
  20. package/accordion-group/AccordionGroup.d.ts +0 -7
  21. package/accordion-group/AccordionGroup.js +0 -170
  22. package/accordion-group/AccordionGroup.stories.tsx +0 -225
  23. package/accordion-group/types.d.ts +0 -72
  24. package/accordion-group/types.js +0 -5
  25. package/alert/Alert.d.ts +0 -4
  26. package/alert/Alert.js +0 -290
  27. package/alert/Alert.stories.tsx +0 -170
  28. package/alert/types.d.ts +0 -49
  29. package/alert/types.js +0 -5
  30. package/badge/Badge.js +0 -59
  31. package/box/Box.d.ts +0 -4
  32. package/box/Box.js +0 -126
  33. package/box/Box.stories.tsx +0 -132
  34. package/box/types.d.ts +0 -43
  35. package/box/types.js +0 -5
  36. package/button/Button.d.ts +0 -4
  37. package/button/Button.js +0 -179
  38. package/button/Button.stories.tsx +0 -276
  39. package/button/types.d.ts +0 -57
  40. package/button/types.js +0 -5
  41. package/card/Card.d.ts +0 -4
  42. package/card/Card.js +0 -164
  43. package/card/Card.stories.tsx +0 -201
  44. package/card/ice-cream.jpg +0 -0
  45. package/card/types.d.ts +0 -67
  46. package/card/types.js +0 -5
  47. package/checkbox/Checkbox.d.ts +0 -4
  48. package/checkbox/Checkbox.js +0 -253
  49. package/checkbox/Checkbox.stories.tsx +0 -192
  50. package/checkbox/types.d.ts +0 -60
  51. package/checkbox/types.js +0 -5
  52. package/chip/Chip.d.ts +0 -4
  53. package/chip/Chip.js +0 -199
  54. package/chip/Chip.stories.tsx +0 -121
  55. package/chip/types.d.ts +0 -53
  56. package/chip/types.js +0 -5
  57. package/common/OpenSans.css +0 -81
  58. package/common/RequiredComponent.js +0 -32
  59. package/common/fonts/OpenSans-Bold.ttf +0 -0
  60. package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
  61. package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
  62. package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  63. package/common/fonts/OpenSans-Italic.ttf +0 -0
  64. package/common/fonts/OpenSans-Light.ttf +0 -0
  65. package/common/fonts/OpenSans-LightItalic.ttf +0 -0
  66. package/common/fonts/OpenSans-Regular.ttf +0 -0
  67. package/common/fonts/OpenSans-SemiBold.ttf +0 -0
  68. package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  69. package/common/utils.js +0 -22
  70. package/common/variables.js +0 -1612
  71. package/date/Date.js +0 -373
  72. package/date/index.d.ts +0 -27
  73. package/date-input/DateInput.d.ts +0 -4
  74. package/date-input/DateInput.js +0 -358
  75. package/date-input/DateInput.stories.tsx +0 -138
  76. package/date-input/types.d.ts +0 -100
  77. package/date-input/types.js +0 -5
  78. package/dialog/Dialog.d.ts +0 -4
  79. package/dialog/Dialog.js +0 -166
  80. package/dialog/Dialog.stories.tsx +0 -212
  81. package/dialog/types.d.ts +0 -43
  82. package/dialog/types.js +0 -5
  83. package/dropdown/Dropdown.d.ts +0 -4
  84. package/dropdown/Dropdown.js +0 -417
  85. package/dropdown/Dropdown.stories.tsx +0 -247
  86. package/dropdown/types.d.ts +0 -89
  87. package/dropdown/types.js +0 -5
  88. package/file-input/FileInput.d.ts +0 -4
  89. package/file-input/FileInput.js +0 -590
  90. package/file-input/FileInput.stories.tsx +0 -507
  91. package/file-input/FileItem.d.ts +0 -14
  92. package/file-input/FileItem.js +0 -184
  93. package/file-input/types.d.ts +0 -112
  94. package/file-input/types.js +0 -5
  95. package/footer/Footer.d.ts +0 -4
  96. package/footer/Footer.js +0 -260
  97. package/footer/Footer.stories.tsx +0 -130
  98. package/footer/Icons.d.ts +0 -2
  99. package/footer/Icons.js +0 -77
  100. package/footer/types.d.ts +0 -65
  101. package/footer/types.js +0 -5
  102. package/header/Header.d.ts +0 -7
  103. package/header/Header.js +0 -324
  104. package/header/Header.stories.tsx +0 -162
  105. package/header/Icons.d.ts +0 -2
  106. package/header/Icons.js +0 -34
  107. package/header/types.d.ts +0 -47
  108. package/header/types.js +0 -5
  109. package/heading/Heading.d.ts +0 -4
  110. package/heading/Heading.js +0 -159
  111. package/heading/Heading.stories.tsx +0 -54
  112. package/heading/types.d.ts +0 -33
  113. package/heading/types.js +0 -5
  114. package/input-text/Icons.js +0 -22
  115. package/input-text/InputText.js +0 -611
  116. package/input-text/index.d.ts +0 -36
  117. package/layout/ApplicationLayout.d.ts +0 -10
  118. package/layout/ApplicationLayout.js +0 -225
  119. package/layout/ApplicationLayout.stories.tsx +0 -171
  120. package/layout/Icons.js +0 -55
  121. package/layout/types.d.ts +0 -57
  122. package/layout/types.js +0 -5
  123. package/link/Link.d.ts +0 -3
  124. package/link/Link.js +0 -161
  125. package/link/Link.stories.tsx +0 -146
  126. package/link/types.d.ts +0 -74
  127. package/link/types.js +0 -5
  128. package/list/List.d.ts +0 -8
  129. package/list/List.js +0 -47
  130. package/list/List.stories.tsx +0 -95
  131. package/main.d.ts +0 -48
  132. package/main.js +0 -395
  133. package/number-input/NumberInput.d.ts +0 -4
  134. package/number-input/NumberInput.js +0 -83
  135. package/number-input/NumberInput.stories.tsx +0 -115
  136. package/number-input/NumberInputContext.d.ts +0 -4
  137. package/number-input/NumberInputContext.js +0 -19
  138. package/number-input/numberInputContextTypes.d.ts +0 -19
  139. package/number-input/numberInputContextTypes.js +0 -5
  140. package/number-input/types.d.ts +0 -117
  141. package/number-input/types.js +0 -5
  142. package/paginator/Icons.js +0 -66
  143. package/paginator/Paginator.d.ts +0 -4
  144. package/paginator/Paginator.js +0 -192
  145. package/paginator/Paginator.stories.tsx +0 -63
  146. package/paginator/types.d.ts +0 -38
  147. package/paginator/types.js +0 -5
  148. package/password-input/PasswordInput.d.ts +0 -4
  149. package/password-input/PasswordInput.js +0 -163
  150. package/password-input/PasswordInput.stories.tsx +0 -131
  151. package/password-input/types.d.ts +0 -107
  152. package/password-input/types.js +0 -5
  153. package/progress-bar/ProgressBar.d.ts +0 -4
  154. package/progress-bar/ProgressBar.js +0 -170
  155. package/progress-bar/ProgressBar.stories.jsx +0 -58
  156. package/progress-bar/types.d.ts +0 -37
  157. package/progress-bar/types.js +0 -5
  158. package/radio/Radio.d.ts +0 -4
  159. package/radio/Radio.js +0 -174
  160. package/radio/Radio.stories.tsx +0 -192
  161. package/radio/types.d.ts +0 -54
  162. package/radio/types.js +0 -5
  163. package/radio-group/Radio.d.ts +0 -4
  164. package/radio-group/Radio.js +0 -130
  165. package/radio-group/RadioGroup.d.ts +0 -4
  166. package/radio-group/RadioGroup.js +0 -268
  167. package/radio-group/RadioGroup.stories.tsx +0 -79
  168. package/radio-group/types.d.ts +0 -36
  169. package/radio-group/types.js +0 -5
  170. package/resultsetTable/ResultsetTable.d.ts +0 -4
  171. package/resultsetTable/ResultsetTable.js +0 -251
  172. package/resultsetTable/ResultsetTable.stories.tsx +0 -277
  173. package/resultsetTable/types.d.ts +0 -67
  174. package/resultsetTable/types.js +0 -5
  175. package/row/Row.d.ts +0 -11
  176. package/row/Row.js +0 -127
  177. package/row/Row.stories.tsx +0 -239
  178. package/select/Select.d.ts +0 -4
  179. package/select/Select.js +0 -863
  180. package/select/Select.stories.tsx +0 -572
  181. package/select/types.d.ts +0 -170
  182. package/select/types.js +0 -5
  183. package/sidenav/Sidenav.d.ts +0 -9
  184. package/sidenav/Sidenav.js +0 -136
  185. package/sidenav/Sidenav.stories.tsx +0 -182
  186. package/sidenav/types.d.ts +0 -50
  187. package/sidenav/types.js +0 -5
  188. package/slider/Slider.d.ts +0 -4
  189. package/slider/Slider.js +0 -317
  190. package/slider/Slider.stories.tsx +0 -177
  191. package/slider/types.d.ts +0 -78
  192. package/slider/types.js +0 -5
  193. package/spinner/Spinner.d.ts +0 -4
  194. package/spinner/Spinner.js +0 -250
  195. package/spinner/Spinner.stories.jsx +0 -103
  196. package/spinner/types.d.ts +0 -32
  197. package/spinner/types.js +0 -5
  198. package/stack/Stack.d.ts +0 -10
  199. package/stack/Stack.js +0 -97
  200. package/stack/Stack.stories.tsx +0 -166
  201. package/switch/Switch.d.ts +0 -4
  202. package/switch/Switch.js +0 -179
  203. package/switch/Switch.stories.tsx +0 -160
  204. package/switch/types.d.ts +0 -58
  205. package/switch/types.js +0 -5
  206. package/table/Table.d.ts +0 -4
  207. package/table/Table.js +0 -118
  208. package/table/Table.stories.jsx +0 -277
  209. package/table/types.d.ts +0 -21
  210. package/table/types.js +0 -5
  211. package/tabs/Tabs.d.ts +0 -4
  212. package/tabs/Tabs.js +0 -213
  213. package/tabs/Tabs.stories.tsx +0 -122
  214. package/tabs/types.d.ts +0 -70
  215. package/tabs/types.js +0 -5
  216. package/tag/Tag.d.ts +0 -4
  217. package/tag/Tag.js +0 -193
  218. package/tag/Tag.stories.tsx +0 -145
  219. package/tag/types.d.ts +0 -60
  220. package/tag/types.js +0 -5
  221. package/text/Text.d.ts +0 -7
  222. package/text/Text.js +0 -30
  223. package/text/Text.stories.tsx +0 -19
  224. package/text-input/TextInput.d.ts +0 -4
  225. package/text-input/TextInput.js +0 -786
  226. package/text-input/TextInput.stories.tsx +0 -456
  227. package/text-input/types.d.ts +0 -159
  228. package/text-input/types.js +0 -5
  229. package/textarea/Textarea.d.ts +0 -4
  230. package/textarea/Textarea.js +0 -284
  231. package/textarea/Textarea.stories.jsx +0 -136
  232. package/textarea/types.d.ts +0 -130
  233. package/textarea/types.js +0 -5
  234. package/toggle/Toggle.js +0 -186
  235. package/toggle/index.d.ts +0 -21
  236. package/toggle-group/ToggleGroup.d.ts +0 -4
  237. package/toggle-group/ToggleGroup.js +0 -214
  238. package/toggle-group/ToggleGroup.stories.tsx +0 -173
  239. package/toggle-group/types.d.ts +0 -97
  240. package/toggle-group/types.js +0 -5
  241. package/upload/Upload.js +0 -201
  242. package/upload/buttons-upload/ButtonsUpload.js +0 -111
  243. package/upload/buttons-upload/Icons.js +0 -40
  244. package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
  245. package/upload/dragAndDropArea/Icons.js +0 -39
  246. package/upload/file-upload/FileToUpload.js +0 -115
  247. package/upload/file-upload/Icons.js +0 -66
  248. package/upload/files-upload/FilesToUpload.js +0 -109
  249. package/upload/index.d.ts +0 -15
  250. package/upload/transaction/Icons.js +0 -160
  251. package/upload/transaction/Transaction.js +0 -104
  252. package/upload/transactions/Transactions.js +0 -94
  253. package/useTheme.d.ts +0 -2
  254. package/useTheme.js +0 -22
  255. package/wizard/Wizard.d.ts +0 -4
  256. package/wizard/Wizard.js +0 -281
  257. package/wizard/Wizard.stories.tsx +0 -224
  258. package/wizard/types.d.ts +0 -60
  259. package/wizard/types.js +0 -5
@@ -1,170 +0,0 @@
1
- import React from "react";
2
- import DxcAlert from "./Alert";
3
- import Title from "../../.storybook/components/Title";
4
- import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
-
6
- export default {
7
- title: "Alert",
8
- component: DxcAlert,
9
- };
10
-
11
- export const Chromatic = () => (
12
- <>
13
- <ExampleContainer>
14
- <Title title="Info" theme="light" level={4} />
15
- <DxcAlert inlineText="Info type alert with inline text." />
16
- </ExampleContainer>
17
- <ExampleContainer>
18
- <Title title="Confirm" theme="light" level={4} />
19
- <DxcAlert type="confirm" inlineText="Confirm type alert with inline text." />
20
- </ExampleContainer>
21
- <ExampleContainer>
22
- <Title title="Warning" theme="light" level={4} />
23
- <DxcAlert type="warning" inlineText="Warning type alert with inline text." />
24
- </ExampleContainer>
25
- <ExampleContainer>
26
- <Title title="Error" theme="light" level={4} />
27
- <DxcAlert type="error" inlineText="Error type alert with inline text." />
28
- </ExampleContainer>
29
- <ExampleContainer>
30
- <Title title="With close button" theme="light" level={4} />
31
- <DxcAlert inlineText="Info type alert with inline text and close button." onClose={() => {}} />
32
- </ExampleContainer>
33
- <ExampleContainer pseudoState="pseudo-hover">
34
- <Title title="With hovered close button" theme="light" level={4} />
35
- <DxcAlert inlineText="Info type alert with inline text and close button." onClose={() => {}} />
36
- </ExampleContainer>
37
- <ExampleContainer pseudoState="pseudo-focus">
38
- <Title title="With focused close button" theme="light" level={4} />
39
- <DxcAlert inlineText="Info type alert with inline text and close button." onClose={() => {}} />
40
- </ExampleContainer>
41
- <ExampleContainer pseudoState="pseudo-active">
42
- <Title title="With actived close button" theme="light" level={4} />
43
- <DxcAlert inlineText="Info type alert with inline text and close button." onClose={() => {}} />
44
- </ExampleContainer>
45
- <ExampleContainer>
46
- <Title title="With children" theme="light" level={4} />
47
- <DxcAlert>
48
- <div>
49
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
50
- lobortis eget.
51
- </div>
52
- </DxcAlert>
53
- </ExampleContainer>
54
- <ExampleContainer>
55
- <Title title="With inline text and children" theme="light" level={4} />
56
- <DxcAlert inlineText="Info type alert with inline text.">
57
- <div>
58
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
59
- lobortis eget.
60
- </div>
61
- </DxcAlert>
62
- </ExampleContainer>
63
- <Title title="Margins" theme="light" level={2} />
64
- <ExampleContainer>
65
- <Title title="Xxsmall" theme="light" level={4} />
66
- <DxcAlert margin="xxsmall" inlineText="Info type alert with inline text and xxsmall margin." />
67
- </ExampleContainer>
68
- <ExampleContainer>
69
- <Title title="Xsmall" theme="light" level={4} />
70
- <DxcAlert margin="xsmall" inlineText="Info type alert with inline text and xsmall margin." />
71
- </ExampleContainer>
72
- <ExampleContainer>
73
- <Title title="Small" theme="light" level={4} />
74
- <DxcAlert margin="small" inlineText="Info type alert with inline text and small margin." />
75
- </ExampleContainer>
76
- <ExampleContainer>
77
- <Title title="Medium" theme="light" level={4} />
78
- <DxcAlert margin="medium" inlineText="Info type alert with inline text and medium margin." />
79
- </ExampleContainer>
80
- <ExampleContainer>
81
- <Title title="Large" theme="light" level={4} />
82
- <DxcAlert margin="large" inlineText="Info type alert with inline text and large margin." />
83
- </ExampleContainer>
84
- <ExampleContainer>
85
- <Title title="Xlarge" theme="light" level={4} />
86
- <DxcAlert margin="xlarge" inlineText="Info type alert with inline text and xlarge margin." />
87
- </ExampleContainer>
88
- <ExampleContainer>
89
- <Title title="Xxlarge" theme="light" level={4} />
90
- <DxcAlert margin="xxlarge" inlineText="Info type alert with inline text and xxlarge margin." />
91
- </ExampleContainer>
92
- <Title title="Sizes" theme="light" level={2} />
93
- <ExampleContainer>
94
- <Title title="FitContent" theme="light" level={4} />
95
- <DxcAlert
96
- size="fitContent"
97
- inlineText="Info type alert with inline text, children, close button and fitContent size."
98
- onClose={() => {}}
99
- >
100
- <div>
101
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
102
- lobortis eget.
103
- </div>
104
- </DxcAlert>
105
- </ExampleContainer>
106
- <ExampleContainer>
107
- <Title title="Small" theme="light" level={4} />
108
- <DxcAlert
109
- size="small"
110
- inlineText="Info type alert with inline text, children, close button and small size."
111
- onClose={() => {}}
112
- >
113
- <div>
114
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
115
- lobortis eget.
116
- </div>
117
- </DxcAlert>
118
- </ExampleContainer>
119
- <ExampleContainer>
120
- <Title title="Medium" theme="light" level={4} />
121
- <DxcAlert
122
- size="medium"
123
- inlineText="Info type alert with inline text, children, close button and medium size."
124
- onClose={() => {}}
125
- >
126
- <div>
127
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
128
- lobortis eget.
129
- </div>
130
- </DxcAlert>
131
- </ExampleContainer>
132
- <ExampleContainer>
133
- <Title title="Large" theme="light" level={4} />
134
- <DxcAlert
135
- size="large"
136
- inlineText="Info type alert with inline text, children, close button and large size."
137
- onClose={() => {}}
138
- >
139
- <div>
140
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
141
- lobortis eget.
142
- </div>
143
- </DxcAlert>
144
- </ExampleContainer>
145
- <ExampleContainer>
146
- <Title title="FillParent" theme="light" level={4} />
147
- <DxcAlert
148
- size="fillParent"
149
- inlineText="Info type alert with inline text, children, close button and fillParent size."
150
- onClose={() => {}}
151
- >
152
- <div>
153
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
154
- lobortis eget.
155
- </div>
156
- </DxcAlert>
157
- </ExampleContainer>
158
- </>
159
- );
160
-
161
- export const ModalAlert = () => (
162
- <ExampleContainer>
163
- <DxcAlert inlineText="Modal alert." mode="modal" onClose={() => {}}>
164
- <div>
165
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo
166
- lobortis eget.
167
- </div>
168
- </DxcAlert>
169
- </ExampleContainer>
170
- );
package/alert/types.d.ts DELETED
@@ -1,49 +0,0 @@
1
- /// <reference types="react" />
2
- declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- declare type Margin = {
4
- top?: Space;
5
- bottom?: Space;
6
- left?: Space;
7
- right?: Space;
8
- };
9
- declare type Props = {
10
- /**
11
- * Uses on of the available alert types.
12
- */
13
- type?: "info" | "confirm" | "warning" | "error";
14
- /**
15
- * Uses on of the available alert modes:
16
- * 'inline': If onClose function is received, close button will be visible and the function will be executed when it's clicked.
17
- * There is no overlay layer. Position should be decided by the user.
18
- * 'modal': The alert will be displayed in the middle of the screen with an overlay layer behind.
19
- * The onClose function will be executed when the X button or the overlay is clicked. d
20
- * The user has the responsibility of hidding the modal in the onClose function, otherwise the modal will remain visible.
21
- */
22
- mode?: "inline" | "modal";
23
- /**
24
- * Text to display after icon and alert type and before content.
25
- */
26
- inlineText?: string;
27
- /**
28
- * This function will be called when the user clicks the close button. If there is no function we should close the alert by default.
29
- */
30
- onClose?: () => void;
31
- /**
32
- * The details section of the alert. Can be used to render custom content in this area.
33
- */
34
- children?: React.ReactNode;
35
- /**
36
- * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
37
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
38
- */
39
- margin?: Space | Margin;
40
- /**
41
- * Size of the component.
42
- */
43
- size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
44
- /**
45
- * Tabindex value given to the close button.
46
- */
47
- tabIndex?: number;
48
- };
49
- export default Props;
package/alert/types.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
package/badge/Badge.js DELETED
@@ -1,59 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports["default"] = void 0;
11
-
12
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
-
14
- var _react = _interopRequireDefault(require("react"));
15
-
16
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
17
-
18
- var _useTheme = _interopRequireDefault(require("../useTheme"));
19
-
20
- var _templateObject;
21
-
22
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
-
24
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
-
26
- var DxcBadge = function DxcBadge(_ref) {
27
- var notificationText = _ref.notificationText;
28
- var colorsTheme = (0, _useTheme["default"])();
29
- return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
30
- theme: colorsTheme.tabs
31
- }, /*#__PURE__*/_react["default"].createElement(StyledDxcBadge, {
32
- notificationText: notificationText
33
- }, /*#__PURE__*/_react["default"].createElement("span", null, notificationText)));
34
- };
35
-
36
- var StyledDxcBadge = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n width: ", ";\n height: ", ";\n border-radius: ", ";\n display: flex;\n padding-bottom: 1px;\n padding-right: 1px;\n flex-wrap: wrap;\n box-sizing: border-box;\n align-items: center;\n line-height: 1;\n align-content: center;\n flex-direction: row;\n justify-content: center;\n"])), function (props) {
37
- return props.theme.badgeBackgroundColor;
38
- }, function (props) {
39
- return props.theme.badgeFontFamily;
40
- }, function (props) {
41
- return props.theme.badgeFontSize;
42
- }, function (props) {
43
- return props.theme.badgeFontStyle;
44
- }, function (props) {
45
- return props.theme.badgeFontWeight;
46
- }, function (props) {
47
- return props.theme.badgeFontColor;
48
- }, function (props) {
49
- return props.theme.badgeLetterSpacing;
50
- }, function (props) {
51
- return props.notificationText === true ? props.theme.badgeWidth : props.theme.badgeWidthWithNotificationNumber;
52
- }, function (props) {
53
- return props.notificationText === true ? props.theme.badgeHeight : props.theme.badgeHeightWithNotificationNumber;
54
- }, function (props) {
55
- return props.notificationText === true ? props.theme.badgeRadius : props.theme.badgeRadiusWithNotificationNumber;
56
- });
57
-
58
- var _default = DxcBadge;
59
- exports["default"] = _default;
package/box/Box.d.ts DELETED
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import BoxPropsType from "./types";
3
- declare const DxcBox: ({ shadowDepth, display, children, margin, padding, size, }: BoxPropsType) => JSX.Element;
4
- export default DxcBox;
package/box/Box.js DELETED
@@ -1,126 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof3 = require("@babel/runtime/helpers/typeof");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports["default"] = void 0;
11
-
12
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
13
-
14
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
-
16
- var _react = _interopRequireDefault(require("react"));
17
-
18
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
19
-
20
- var _variables = require("../common/variables.js");
21
-
22
- var _utils = require("../common/utils.js");
23
-
24
- var _useTheme = _interopRequireDefault(require("../useTheme"));
25
-
26
- var _BackgroundColorContext = require("../BackgroundColorContext");
27
-
28
- var _templateObject;
29
-
30
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
-
32
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
33
-
34
- var DxcBox = function DxcBox(_ref) {
35
- var _ref$shadowDepth = _ref.shadowDepth,
36
- shadowDepth = _ref$shadowDepth === void 0 ? 2 : _ref$shadowDepth,
37
- _ref$display = _ref.display,
38
- display = _ref$display === void 0 ? "inline-flex" : _ref$display,
39
- children = _ref.children,
40
- margin = _ref.margin,
41
- padding = _ref.padding,
42
- _ref$size = _ref.size,
43
- size = _ref$size === void 0 ? "fitContent" : _ref$size;
44
- var colorsTheme = (0, _useTheme["default"])();
45
- return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
46
- theme: colorsTheme.box
47
- }, /*#__PURE__*/_react["default"].createElement(StyledDxcBox, {
48
- shadowDepth: shadowDepth,
49
- display: display,
50
- margin: margin,
51
- padding: padding,
52
- size: size
53
- }, /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
54
- color: colorsTheme.box.backgroundColor
55
- }, children)));
56
- };
57
-
58
- var sizes = {
59
- small: "48px",
60
- medium: "240px",
61
- large: "480px",
62
- fillParent: "100%",
63
- fitContent: "unset"
64
- };
65
-
66
- var calculateWidth = function calculateWidth(margin, size, padding) {
67
- if (size === "fillParent") {
68
- return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), " -\n ").concat((0, _utils.getMargin)(padding, "left"), " - ").concat((0, _utils.getMargin)(padding, "right"), ")");
69
- }
70
-
71
- return sizes[size];
72
- };
73
-
74
- var StyledDxcBox = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: ", ";\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n letter-spacing: ", ";\n overflow: hidden;\n width: ", ";\n background-color: ", ";\n box-shadow: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n"])), function (_ref2) {
75
- var display = _ref2.display;
76
- return display;
77
- }, function (props) {
78
- return props.theme.borderRadius;
79
- }, function (props) {
80
- return props.theme.borderThickness;
81
- }, function (props) {
82
- return props.theme.borderStyle;
83
- }, function (props) {
84
- return props.theme.borderColor;
85
- }, function (props) {
86
- return props.theme.letterSpacing;
87
- }, function (props) {
88
- return calculateWidth(props.margin, props.size, props.padding);
89
- }, function (props) {
90
- return props.theme.backgroundColor;
91
- }, function (props) {
92
- return props.shadowDepth === 1 ? "".concat(props.theme.oneShadowDepthShadowOffsetX, " ").concat(props.theme.oneShadowDepthShadowOffsetY, " ").concat(props.theme.oneShadowDepthShadowBlur, " ").concat(props.theme.oneShadowDepthShadowSpread, " ").concat(props.theme.oneShadowDepthShadowColor) : props.shadowDepth === 2 ? "".concat(props.theme.twoShadowDepthShadowOffsetX, " ").concat(props.theme.twoShadowDepthShadowOffsetY, " ").concat(props.theme.twoShadowDepthShadowBlur, " ").concat(props.theme.twoShadowDepthShadowSpread, " ").concat(props.theme.twoShadowDepthShadowColor) : "".concat(props.theme.noneShadowDepthShadowOffsetX, " ").concat(props.theme.noneShadowDepthShadowOffsetY, " ").concat(props.theme.noneShadowDepthShadowBlur, " ").concat(props.theme.noneShadowDepthShadowSpread, " ").concat(props.theme.noneShadowDepthShadowColor);
93
- }, function (_ref3) {
94
- var margin = _ref3.margin;
95
- return margin && (0, _typeof2["default"])(margin) !== "object" ? _variables.spaces[margin] : "0px";
96
- }, function (_ref4) {
97
- var margin = _ref4.margin;
98
- return margin && margin.top ? _variables.spaces[margin.top] : "";
99
- }, function (_ref5) {
100
- var margin = _ref5.margin;
101
- return margin && margin.right ? _variables.spaces[margin.right] : "";
102
- }, function (_ref6) {
103
- var margin = _ref6.margin;
104
- return margin && margin.bottom ? _variables.spaces[margin.bottom] : "";
105
- }, function (_ref7) {
106
- var margin = _ref7.margin;
107
- return margin && margin.left ? _variables.spaces[margin.left] : "";
108
- }, function (_ref8) {
109
- var padding = _ref8.padding;
110
- return padding && (0, _typeof2["default"])(padding) !== "object" ? _variables.spaces[padding] : "0px";
111
- }, function (_ref9) {
112
- var padding = _ref9.padding;
113
- return padding && padding.top ? _variables.spaces[padding.top] : "";
114
- }, function (_ref10) {
115
- var padding = _ref10.padding;
116
- return padding && padding.right ? _variables.spaces[padding.right] : "";
117
- }, function (_ref11) {
118
- var padding = _ref11.padding;
119
- return padding && padding.bottom ? _variables.spaces[padding.bottom] : "";
120
- }, function (_ref12) {
121
- var padding = _ref12.padding;
122
- return padding && padding.left ? _variables.spaces[padding.left] : "";
123
- });
124
-
125
- var _default = DxcBox;
126
- exports["default"] = _default;
@@ -1,132 +0,0 @@
1
- import React from "react";
2
- import Title from "../../.storybook/components/Title";
3
- import ExampleContainer from "../../.storybook/components/ExampleContainer";
4
- import DxcBox from "./Box";
5
-
6
- export default {
7
- title: "Box ",
8
- component: DxcBox,
9
- };
10
-
11
- export const Chromatic = () => (
12
- <>
13
- <Title title="Display flex" theme="light" level={2} />
14
- <ExampleContainer>
15
- <DxcBox display="flex" padding="medium">
16
- Box
17
- </DxcBox>
18
- </ExampleContainer>
19
- <Title title="ShadowDepth" theme="light" level={2} />
20
- <ExampleContainer>
21
- <Title title="ShadowDepth 0" theme="light" level={4} />
22
- <DxcBox shadowDepth={0} margin="medium" padding="medium">
23
- Box
24
- </DxcBox>
25
- </ExampleContainer>
26
- <ExampleContainer>
27
- <Title title="ShadowDepth 1" theme="light" level={4} />
28
- <DxcBox shadowDepth={1} margin="medium" padding="medium">
29
- Box
30
- </DxcBox>
31
- </ExampleContainer>
32
- <ExampleContainer>
33
- <Title title="ShadowDepth 2" theme="light" level={4} />
34
- <DxcBox shadowDepth={2} margin="medium" padding="medium">
35
- Box
36
- </DxcBox>
37
- </ExampleContainer>
38
- <Title title="Paddings" theme="light" level={2} />
39
- <ExampleContainer>
40
- <Title title="Xxsmall padding" theme="light" level={4} />
41
- <DxcBox padding="xxsmall">Box</DxcBox>
42
- </ExampleContainer>
43
- <ExampleContainer>
44
- <Title title="Xsmall padding" theme="light" level={4} />
45
- <DxcBox padding="xsmall">Box</DxcBox>
46
- </ExampleContainer>
47
- <ExampleContainer>
48
- <Title title="Small padding" theme="light" level={4} />
49
- <DxcBox padding="small">Box</DxcBox>
50
- </ExampleContainer>
51
- <ExampleContainer>
52
- <Title title="Medium padding" theme="light" level={4} />
53
- <DxcBox padding="medium">Box</DxcBox>
54
- </ExampleContainer>
55
- <ExampleContainer>
56
- <Title title="Large padding" theme="light" level={4} />
57
- <DxcBox padding="large">Box</DxcBox>
58
- </ExampleContainer>
59
- <ExampleContainer>
60
- <Title title="Xlarge padding" theme="light" level={4} />
61
- <DxcBox padding="xlarge">Box</DxcBox>
62
- </ExampleContainer>
63
- <ExampleContainer>
64
- <Title title="Xxlarge padding" theme="light" level={4} />
65
- <DxcBox padding="xxlarge">Box</DxcBox>
66
- </ExampleContainer>
67
- <Title title="Margins" theme="light" level={2} />
68
- <ExampleContainer>
69
- <Title title="Xxsmall margin" theme="light" level={4} />
70
- <DxcBox margin="xxsmall" padding="medium">
71
- Box
72
- </DxcBox>
73
- </ExampleContainer>
74
- <ExampleContainer>
75
- <Title title="Xsmall margin" theme="light" level={4} />
76
- <DxcBox margin="xsmall" padding="medium">
77
- Box
78
- </DxcBox>
79
- </ExampleContainer>
80
- <ExampleContainer>
81
- <Title title="Small margin" theme="light" level={4} />
82
- <DxcBox margin="small" padding="medium">
83
- Box
84
- </DxcBox>
85
- </ExampleContainer>
86
- <ExampleContainer>
87
- <Title title="Medium margin" theme="light" level={4} />
88
- <DxcBox margin="medium" padding="medium">
89
- Box
90
- </DxcBox>
91
- </ExampleContainer>
92
- <ExampleContainer>
93
- <Title title="Large margin" theme="light" level={4} />
94
- <DxcBox margin="large" padding="medium">
95
- Box
96
- </DxcBox>
97
- </ExampleContainer>
98
- <ExampleContainer>
99
- <Title title="Xlarge margin" theme="light" level={4} />
100
- <DxcBox margin="xlarge" padding="medium">
101
- Box
102
- </DxcBox>
103
- </ExampleContainer>
104
- <ExampleContainer>
105
- <Title title="Xxlarge margin" theme="light" level={4} />
106
- <DxcBox margin="xxlarge" padding="medium">
107
- Box
108
- </DxcBox>
109
- </ExampleContainer>
110
- <Title title="Sizes" theme="light" level={2} />
111
- <ExampleContainer>
112
- <Title title="Small size" theme="light" level={4} />
113
- <DxcBox size="small">Box</DxcBox>
114
- </ExampleContainer>
115
- <ExampleContainer>
116
- <Title title="Medium size" theme="light" level={4} />
117
- <DxcBox size="medium">Box</DxcBox>
118
- </ExampleContainer>
119
- <ExampleContainer>
120
- <Title title="Large size" theme="light" level={4} />
121
- <DxcBox size="large">Box</DxcBox>
122
- </ExampleContainer>
123
- <ExampleContainer>
124
- <Title title="FillParent size" theme="light" level={4} />
125
- <DxcBox size="fillParent">Box</DxcBox>
126
- </ExampleContainer>
127
- <ExampleContainer>
128
- <Title title="FitContent" theme="light" level={4} />
129
- <DxcBox size="fitContent">Box</DxcBox>
130
- </ExampleContainer>
131
- </>
132
- );
package/box/types.d.ts DELETED
@@ -1,43 +0,0 @@
1
- /// <reference types="react" />
2
- declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- declare type Margin = {
4
- top?: Space;
5
- bottom?: Space;
6
- left?: Space;
7
- right?: Space;
8
- };
9
- declare type Padding = {
10
- top?: Space;
11
- bottom?: Space;
12
- left?: Space;
13
- right?: Space;
14
- };
15
- declare type Props = {
16
- /**
17
- * The size of the shadow to be displayed around the box.
18
- */
19
- shadowDepth?: 0 | 1 | 2;
20
- /**
21
- * Changes the display CSS property of the box div.
22
- */
23
- display?: string;
24
- /**
25
- * Custom content that will be placed in the box component.
26
- */
27
- children: React.ReactNode;
28
- /**
29
- * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
30
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
31
- */
32
- margin?: Space | Margin;
33
- /**
34
- * Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
35
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
36
- */
37
- padding?: Space | Padding;
38
- /**
39
- * Size of the component.
40
- */
41
- size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
42
- };
43
- export default Props;
package/box/types.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import ButtonPropsType from "./types";
3
- declare const DxcButton: ({ label, mode, disabled, iconPosition, type, icon, iconSrc, onClick, margin, size, tabIndex, }: ButtonPropsType) => JSX.Element;
4
- export default DxcButton;