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

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 (217) hide show
  1. package/README.md +46 -0
  2. package/dist/index.d.mts +6703 -0
  3. package/dist/index.d.ts +6703 -0
  4. package/dist/index.js +1 -0
  5. package/dist/index.mjs +1 -0
  6. package/package.json +70 -66
  7. package/BackgroundColorContext.js +0 -50
  8. package/ThemeContext.js +0 -246
  9. package/V3Select/V3Select.js +0 -455
  10. package/V3Select/index.d.ts +0 -27
  11. package/V3Textarea/V3Textarea.js +0 -260
  12. package/V3Textarea/index.d.ts +0 -27
  13. package/accordion/Accordion.d.ts +0 -4
  14. package/accordion/Accordion.js +0 -258
  15. package/accordion/types.d.ts +0 -68
  16. package/accordion/types.js +0 -5
  17. package/accordion-group/AccordionGroup.d.ts +0 -7
  18. package/accordion-group/AccordionGroup.js +0 -170
  19. package/accordion-group/types.d.ts +0 -72
  20. package/accordion-group/types.js +0 -5
  21. package/alert/Alert.d.ts +0 -4
  22. package/alert/Alert.js +0 -290
  23. package/alert/Alert.stories.tsx +0 -170
  24. package/alert/types.d.ts +0 -49
  25. package/alert/types.js +0 -5
  26. package/badge/Badge.js +0 -59
  27. package/box/Box.d.ts +0 -4
  28. package/box/Box.js +0 -126
  29. package/box/Box.stories.tsx +0 -132
  30. package/box/types.d.ts +0 -43
  31. package/box/types.js +0 -5
  32. package/button/Button.d.ts +0 -4
  33. package/button/Button.js +0 -179
  34. package/button/Button.stories.tsx +0 -276
  35. package/button/types.d.ts +0 -57
  36. package/button/types.js +0 -5
  37. package/card/Card.d.ts +0 -4
  38. package/card/Card.js +0 -164
  39. package/card/Card.stories.tsx +0 -201
  40. package/card/ice-cream.jpg +0 -0
  41. package/card/types.d.ts +0 -67
  42. package/card/types.js +0 -5
  43. package/checkbox/Checkbox.d.ts +0 -4
  44. package/checkbox/Checkbox.js +0 -253
  45. package/checkbox/Checkbox.stories.tsx +0 -192
  46. package/checkbox/types.d.ts +0 -60
  47. package/checkbox/types.js +0 -5
  48. package/chip/Chip.js +0 -221
  49. package/chip/Chip.stories.tsx +0 -121
  50. package/chip/index.d.ts +0 -22
  51. package/common/OpenSans.css +0 -81
  52. package/common/RequiredComponent.js +0 -32
  53. package/common/fonts/OpenSans-Bold.ttf +0 -0
  54. package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
  55. package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
  56. package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  57. package/common/fonts/OpenSans-Italic.ttf +0 -0
  58. package/common/fonts/OpenSans-Light.ttf +0 -0
  59. package/common/fonts/OpenSans-LightItalic.ttf +0 -0
  60. package/common/fonts/OpenSans-Regular.ttf +0 -0
  61. package/common/fonts/OpenSans-SemiBold.ttf +0 -0
  62. package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  63. package/common/utils.js +0 -22
  64. package/common/variables.js +0 -1577
  65. package/date/Date.js +0 -373
  66. package/date/index.d.ts +0 -27
  67. package/date-input/DateInput.d.ts +0 -4
  68. package/date-input/DateInput.js +0 -361
  69. package/date-input/DateInput.stories.tsx +0 -138
  70. package/date-input/types.d.ts +0 -100
  71. package/date-input/types.js +0 -5
  72. package/dialog/Dialog.d.ts +0 -4
  73. package/dialog/Dialog.js +0 -165
  74. package/dialog/Dialog.stories.tsx +0 -212
  75. package/dialog/types.d.ts +0 -43
  76. package/dialog/types.js +0 -5
  77. package/dropdown/Dropdown.d.ts +0 -4
  78. package/dropdown/Dropdown.js +0 -417
  79. package/dropdown/types.d.ts +0 -89
  80. package/dropdown/types.js +0 -5
  81. package/file-input/FileInput.d.ts +0 -4
  82. package/file-input/FileInput.js +0 -511
  83. package/file-input/FileItem.d.ts +0 -14
  84. package/file-input/FileItem.js +0 -182
  85. package/file-input/types.d.ts +0 -87
  86. package/file-input/types.js +0 -5
  87. package/footer/Footer.d.ts +0 -4
  88. package/footer/Footer.js +0 -266
  89. package/footer/Footer.stories.jsx +0 -151
  90. package/footer/Icons.js +0 -77
  91. package/footer/types.d.ts +0 -61
  92. package/footer/types.js +0 -5
  93. package/header/Header.d.ts +0 -7
  94. package/header/Header.js +0 -324
  95. package/header/Header.stories.tsx +0 -162
  96. package/header/Icons.js +0 -34
  97. package/header/types.d.ts +0 -47
  98. package/header/types.js +0 -5
  99. package/heading/Heading.d.ts +0 -4
  100. package/heading/Heading.js +0 -159
  101. package/heading/Heading.stories.tsx +0 -53
  102. package/heading/types.d.ts +0 -33
  103. package/heading/types.js +0 -5
  104. package/input-text/Icons.js +0 -22
  105. package/input-text/InputText.js +0 -611
  106. package/input-text/index.d.ts +0 -36
  107. package/layout/ApplicationLayout.js +0 -235
  108. package/layout/Icons.js +0 -55
  109. package/link/Link.d.ts +0 -3
  110. package/link/Link.js +0 -161
  111. package/link/Link.stories.tsx +0 -146
  112. package/link/types.d.ts +0 -74
  113. package/link/types.js +0 -5
  114. package/main.d.ts +0 -44
  115. package/main.js +0 -363
  116. package/number-input/NumberInput.d.ts +0 -4
  117. package/number-input/NumberInput.js +0 -86
  118. package/number-input/NumberInput.stories.tsx +0 -115
  119. package/number-input/NumberInputContext.d.ts +0 -4
  120. package/number-input/NumberInputContext.js +0 -19
  121. package/number-input/numberInputContextTypes.d.ts +0 -19
  122. package/number-input/numberInputContextTypes.js +0 -5
  123. package/number-input/types.d.ts +0 -117
  124. package/number-input/types.js +0 -5
  125. package/paginator/Icons.js +0 -66
  126. package/paginator/Paginator.d.ts +0 -4
  127. package/paginator/Paginator.js +0 -198
  128. package/paginator/Paginator.stories.tsx +0 -63
  129. package/paginator/types.d.ts +0 -38
  130. package/paginator/types.js +0 -5
  131. package/password-input/PasswordInput.d.ts +0 -4
  132. package/password-input/PasswordInput.js +0 -162
  133. package/password-input/PasswordInput.stories.tsx +0 -131
  134. package/password-input/types.d.ts +0 -105
  135. package/password-input/types.js +0 -5
  136. package/progress-bar/ProgressBar.d.ts +0 -4
  137. package/progress-bar/ProgressBar.js +0 -170
  138. package/progress-bar/ProgressBar.stories.jsx +0 -58
  139. package/progress-bar/types.d.ts +0 -37
  140. package/progress-bar/types.js +0 -5
  141. package/radio/Radio.d.ts +0 -4
  142. package/radio/Radio.js +0 -174
  143. package/radio/Radio.stories.tsx +0 -192
  144. package/radio/types.d.ts +0 -54
  145. package/radio/types.js +0 -5
  146. package/resultsetTable/ResultsetTable.d.ts +0 -4
  147. package/resultsetTable/ResultsetTable.js +0 -249
  148. package/resultsetTable/types.d.ts +0 -63
  149. package/resultsetTable/types.js +0 -5
  150. package/select/Select.js +0 -865
  151. package/select/Select.stories.tsx +0 -572
  152. package/select/index.d.ts +0 -131
  153. package/sidenav/Sidenav.d.ts +0 -9
  154. package/sidenav/Sidenav.js +0 -136
  155. package/sidenav/Sidenav.stories.tsx +0 -165
  156. package/sidenav/types.d.ts +0 -50
  157. package/sidenav/types.js +0 -5
  158. package/slider/Slider.d.ts +0 -4
  159. package/slider/Slider.js +0 -317
  160. package/slider/Slider.stories.tsx +0 -177
  161. package/slider/types.d.ts +0 -78
  162. package/slider/types.js +0 -5
  163. package/spinner/Spinner.d.ts +0 -4
  164. package/spinner/Spinner.js +0 -250
  165. package/spinner/Spinner.stories.jsx +0 -102
  166. package/spinner/types.d.ts +0 -32
  167. package/spinner/types.js +0 -5
  168. package/switch/Switch.d.ts +0 -4
  169. package/switch/Switch.js +0 -179
  170. package/switch/Switch.stories.tsx +0 -160
  171. package/switch/types.d.ts +0 -58
  172. package/switch/types.js +0 -5
  173. package/table/Table.d.ts +0 -4
  174. package/table/Table.js +0 -118
  175. package/table/Table.stories.jsx +0 -276
  176. package/table/types.d.ts +0 -21
  177. package/table/types.js +0 -5
  178. package/tabs/Tabs.d.ts +0 -4
  179. package/tabs/Tabs.js +0 -213
  180. package/tabs/types.d.ts +0 -70
  181. package/tabs/types.js +0 -5
  182. package/tag/Tag.d.ts +0 -4
  183. package/tag/Tag.js +0 -193
  184. package/tag/Tag.stories.tsx +0 -145
  185. package/tag/types.d.ts +0 -60
  186. package/tag/types.js +0 -5
  187. package/text-input/TextInput.d.ts +0 -4
  188. package/text-input/TextInput.js +0 -785
  189. package/text-input/types.d.ts +0 -157
  190. package/text-input/types.js +0 -5
  191. package/textarea/Textarea.js +0 -317
  192. package/textarea/Textarea.stories.jsx +0 -135
  193. package/textarea/index.d.ts +0 -117
  194. package/toggle/Toggle.js +0 -186
  195. package/toggle/index.d.ts +0 -21
  196. package/toggle-group/ToggleGroup.js +0 -243
  197. package/toggle-group/ToggleGroup.stories.tsx +0 -178
  198. package/toggle-group/index.d.ts +0 -21
  199. package/upload/Upload.js +0 -201
  200. package/upload/buttons-upload/ButtonsUpload.js +0 -111
  201. package/upload/buttons-upload/Icons.js +0 -40
  202. package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
  203. package/upload/dragAndDropArea/Icons.js +0 -39
  204. package/upload/file-upload/FileToUpload.js +0 -115
  205. package/upload/file-upload/Icons.js +0 -66
  206. package/upload/files-upload/FilesToUpload.js +0 -109
  207. package/upload/index.d.ts +0 -15
  208. package/upload/transaction/Icons.js +0 -160
  209. package/upload/transaction/Transaction.js +0 -104
  210. package/upload/transactions/Transactions.js +0 -94
  211. package/useTheme.js +0 -22
  212. package/wizard/Icons.js +0 -65
  213. package/wizard/Wizard.d.ts +0 -4
  214. package/wizard/Wizard.js +0 -231
  215. package/wizard/Wizard.stories.jsx +0 -224
  216. package/wizard/types.d.ts +0 -64
  217. 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.js"));
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.js"));
25
-
26
- var _BackgroundColorContext = require("../BackgroundColorContext.js");
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;