@dxc-technology/halstack-react 0.0.0-aea2c74 → 0.0.0-aededfa

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 (251) hide show
  1. package/README.md +46 -0
  2. package/dist/index.d.mts +3960 -0
  3. package/dist/index.d.ts +3960 -0
  4. package/dist/index.js +14592 -0
  5. package/dist/index.mjs +14504 -0
  6. package/package.json +86 -69
  7. package/BackgroundColorContext.d.ts +0 -10
  8. package/BackgroundColorContext.js +0 -48
  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 -300
  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 -1574
  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 -165
  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/FileItem.d.ts +0 -14
  91. package/file-input/FileItem.js +0 -184
  92. package/file-input/types.d.ts +0 -112
  93. package/file-input/types.js +0 -5
  94. package/footer/Footer.d.ts +0 -4
  95. package/footer/Footer.js +0 -260
  96. package/footer/Footer.stories.tsx +0 -130
  97. package/footer/Icons.d.ts +0 -2
  98. package/footer/Icons.js +0 -77
  99. package/footer/types.d.ts +0 -65
  100. package/footer/types.js +0 -5
  101. package/header/Header.d.ts +0 -7
  102. package/header/Header.js +0 -324
  103. package/header/Header.stories.tsx +0 -162
  104. package/header/Icons.d.ts +0 -2
  105. package/header/Icons.js +0 -34
  106. package/header/types.d.ts +0 -47
  107. package/header/types.js +0 -5
  108. package/heading/Heading.d.ts +0 -4
  109. package/heading/Heading.js +0 -159
  110. package/heading/Heading.stories.tsx +0 -53
  111. package/heading/types.d.ts +0 -33
  112. package/heading/types.js +0 -5
  113. package/input-text/Icons.js +0 -22
  114. package/input-text/InputText.js +0 -611
  115. package/input-text/index.d.ts +0 -36
  116. package/layout/ApplicationLayout.d.ts +0 -10
  117. package/layout/ApplicationLayout.js +0 -225
  118. package/layout/ApplicationLayout.stories.tsx +0 -171
  119. package/layout/Icons.js +0 -55
  120. package/layout/types.d.ts +0 -57
  121. package/layout/types.js +0 -5
  122. package/link/Link.d.ts +0 -3
  123. package/link/Link.js +0 -161
  124. package/link/Link.stories.tsx +0 -146
  125. package/link/types.d.ts +0 -74
  126. package/link/types.js +0 -5
  127. package/list/List.d.ts +0 -8
  128. package/list/List.js +0 -47
  129. package/list/List.stories.tsx +0 -85
  130. package/main.d.ts +0 -48
  131. package/main.js +0 -395
  132. package/number-input/NumberInput.d.ts +0 -4
  133. package/number-input/NumberInput.js +0 -83
  134. package/number-input/NumberInput.stories.tsx +0 -115
  135. package/number-input/NumberInputContext.d.ts +0 -4
  136. package/number-input/NumberInputContext.js +0 -19
  137. package/number-input/numberInputContextTypes.d.ts +0 -19
  138. package/number-input/numberInputContextTypes.js +0 -5
  139. package/number-input/types.d.ts +0 -117
  140. package/number-input/types.js +0 -5
  141. package/paginator/Icons.js +0 -66
  142. package/paginator/Paginator.d.ts +0 -4
  143. package/paginator/Paginator.js +0 -192
  144. package/paginator/Paginator.stories.tsx +0 -63
  145. package/paginator/types.d.ts +0 -38
  146. package/paginator/types.js +0 -5
  147. package/password-input/PasswordInput.d.ts +0 -4
  148. package/password-input/PasswordInput.js +0 -163
  149. package/password-input/PasswordInput.stories.tsx +0 -131
  150. package/password-input/types.d.ts +0 -107
  151. package/password-input/types.js +0 -5
  152. package/progress-bar/ProgressBar.d.ts +0 -4
  153. package/progress-bar/ProgressBar.js +0 -170
  154. package/progress-bar/ProgressBar.stories.jsx +0 -58
  155. package/progress-bar/types.d.ts +0 -37
  156. package/progress-bar/types.js +0 -5
  157. package/radio/Radio.d.ts +0 -4
  158. package/radio/Radio.js +0 -174
  159. package/radio/Radio.stories.tsx +0 -192
  160. package/radio/types.d.ts +0 -54
  161. package/radio/types.js +0 -5
  162. package/resultsetTable/ResultsetTable.d.ts +0 -4
  163. package/resultsetTable/ResultsetTable.js +0 -251
  164. package/resultsetTable/ResultsetTable.stories.tsx +0 -276
  165. package/resultsetTable/types.d.ts +0 -67
  166. package/resultsetTable/types.js +0 -5
  167. package/row/Row.d.ts +0 -11
  168. package/row/Row.js +0 -124
  169. package/row/Row.stories.tsx +0 -223
  170. package/select/Select.d.ts +0 -4
  171. package/select/Select.js +0 -863
  172. package/select/Select.stories.tsx +0 -572
  173. package/select/types.d.ts +0 -170
  174. package/select/types.js +0 -5
  175. package/sidenav/Sidenav.d.ts +0 -9
  176. package/sidenav/Sidenav.js +0 -136
  177. package/sidenav/Sidenav.stories.tsx +0 -165
  178. package/sidenav/types.d.ts +0 -50
  179. package/sidenav/types.js +0 -5
  180. package/slider/Slider.d.ts +0 -4
  181. package/slider/Slider.js +0 -317
  182. package/slider/Slider.stories.tsx +0 -177
  183. package/slider/types.d.ts +0 -78
  184. package/slider/types.js +0 -5
  185. package/spinner/Spinner.d.ts +0 -4
  186. package/spinner/Spinner.js +0 -250
  187. package/spinner/Spinner.stories.jsx +0 -102
  188. package/spinner/types.d.ts +0 -32
  189. package/spinner/types.js +0 -5
  190. package/stack/Stack.d.ts +0 -10
  191. package/stack/Stack.js +0 -94
  192. package/stack/Stack.stories.tsx +0 -150
  193. package/switch/Switch.d.ts +0 -4
  194. package/switch/Switch.js +0 -179
  195. package/switch/Switch.stories.tsx +0 -160
  196. package/switch/types.d.ts +0 -58
  197. package/switch/types.js +0 -5
  198. package/table/Table.d.ts +0 -4
  199. package/table/Table.js +0 -118
  200. package/table/Table.stories.jsx +0 -276
  201. package/table/types.d.ts +0 -21
  202. package/table/types.js +0 -5
  203. package/tabs/Tabs.d.ts +0 -4
  204. package/tabs/Tabs.js +0 -213
  205. package/tabs/Tabs.stories.tsx +0 -121
  206. package/tabs/types.d.ts +0 -70
  207. package/tabs/types.js +0 -5
  208. package/tag/Tag.d.ts +0 -4
  209. package/tag/Tag.js +0 -193
  210. package/tag/Tag.stories.tsx +0 -145
  211. package/tag/types.d.ts +0 -60
  212. package/tag/types.js +0 -5
  213. package/text/Text.d.ts +0 -7
  214. package/text/Text.js +0 -30
  215. package/text/Text.stories.tsx +0 -19
  216. package/text-input/TextInput.d.ts +0 -4
  217. package/text-input/TextInput.js +0 -786
  218. package/text-input/TextInput.stories.tsx +0 -456
  219. package/text-input/types.d.ts +0 -159
  220. package/text-input/types.js +0 -5
  221. package/textarea/Textarea.d.ts +0 -4
  222. package/textarea/Textarea.js +0 -284
  223. package/textarea/Textarea.stories.jsx +0 -135
  224. package/textarea/types.d.ts +0 -130
  225. package/textarea/types.js +0 -5
  226. package/toggle/Toggle.js +0 -186
  227. package/toggle/index.d.ts +0 -21
  228. package/toggle-group/ToggleGroup.d.ts +0 -4
  229. package/toggle-group/ToggleGroup.js +0 -214
  230. package/toggle-group/ToggleGroup.stories.tsx +0 -173
  231. package/toggle-group/types.d.ts +0 -97
  232. package/toggle-group/types.js +0 -5
  233. package/upload/Upload.js +0 -201
  234. package/upload/buttons-upload/ButtonsUpload.js +0 -111
  235. package/upload/buttons-upload/Icons.js +0 -40
  236. package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
  237. package/upload/dragAndDropArea/Icons.js +0 -39
  238. package/upload/file-upload/FileToUpload.js +0 -115
  239. package/upload/file-upload/Icons.js +0 -66
  240. package/upload/files-upload/FilesToUpload.js +0 -109
  241. package/upload/index.d.ts +0 -15
  242. package/upload/transaction/Icons.js +0 -160
  243. package/upload/transaction/Transaction.js +0 -104
  244. package/upload/transactions/Transactions.js +0 -94
  245. package/useTheme.d.ts +0 -2
  246. package/useTheme.js +0 -22
  247. package/wizard/Wizard.d.ts +0 -4
  248. package/wizard/Wizard.js +0 -281
  249. package/wizard/Wizard.stories.tsx +0 -224
  250. package/wizard/types.d.ts +0 -60
  251. 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;