@dxc-technology/halstack-react 0.0.0-b821bfb → 0.0.0-b903d8a

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 (126) hide show
  1. package/README.md +46 -0
  2. package/dist/index.d.mts +6516 -0
  3. package/dist/index.d.ts +6516 -0
  4. package/dist/index.js +12982 -0
  5. package/dist/index.mjs +12925 -0
  6. package/package.json +82 -72
  7. package/BackgroundColorContext.js +0 -46
  8. package/ThemeContext.js +0 -250
  9. package/V3Select/V3Select.js +0 -549
  10. package/V3Select/index.d.ts +0 -27
  11. package/V3Textarea/V3Textarea.js +0 -264
  12. package/V3Textarea/index.d.ts +0 -27
  13. package/accordion/Accordion.js +0 -353
  14. package/accordion/index.d.ts +0 -28
  15. package/accordion-group/AccordionGroup.js +0 -186
  16. package/accordion-group/index.d.ts +0 -16
  17. package/alert/Alert.js +0 -403
  18. package/alert/index.d.ts +0 -51
  19. package/badge/Badge.js +0 -63
  20. package/box/Box.js +0 -156
  21. package/box/index.d.ts +0 -25
  22. package/button/Button.js +0 -238
  23. package/button/Button.stories.js +0 -27
  24. package/button/index.d.ts +0 -24
  25. package/card/Card.js +0 -254
  26. package/card/index.d.ts +0 -22
  27. package/checkbox/Checkbox.js +0 -299
  28. package/checkbox/index.d.ts +0 -24
  29. package/chip/Chip.js +0 -265
  30. package/chip/index.d.ts +0 -22
  31. package/common/OpenSans.css +0 -81
  32. package/common/RequiredComponent.js +0 -40
  33. package/common/fonts/OpenSans-Bold.ttf +0 -0
  34. package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
  35. package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
  36. package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  37. package/common/fonts/OpenSans-Italic.ttf +0 -0
  38. package/common/fonts/OpenSans-Light.ttf +0 -0
  39. package/common/fonts/OpenSans-LightItalic.ttf +0 -0
  40. package/common/fonts/OpenSans-Regular.ttf +0 -0
  41. package/common/fonts/OpenSans-SemiBold.ttf +0 -0
  42. package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  43. package/common/utils.js +0 -22
  44. package/common/variables.js +0 -1567
  45. package/date/Date.js +0 -379
  46. package/date/index.d.ts +0 -27
  47. package/date-input/DateInput.js +0 -400
  48. package/date-input/index.d.ts +0 -95
  49. package/dialog/Dialog.js +0 -218
  50. package/dialog/index.d.ts +0 -18
  51. package/dropdown/Dropdown.js +0 -544
  52. package/dropdown/index.d.ts +0 -26
  53. package/file-input/FileInput.js +0 -644
  54. package/file-input/FileItem.js +0 -287
  55. package/file-input/index.d.ts +0 -81
  56. package/footer/Footer.js +0 -421
  57. package/footer/Icons.js +0 -77
  58. package/footer/index.d.ts +0 -25
  59. package/header/Header.js +0 -470
  60. package/header/Icons.js +0 -59
  61. package/header/index.d.ts +0 -25
  62. package/heading/Heading.js +0 -230
  63. package/heading/index.d.ts +0 -17
  64. package/input-text/Icons.js +0 -22
  65. package/input-text/InputText.js +0 -705
  66. package/input-text/index.d.ts +0 -36
  67. package/layout/ApplicationLayout.js +0 -327
  68. package/layout/Icons.js +0 -55
  69. package/link/Link.js +0 -237
  70. package/link/index.d.ts +0 -23
  71. package/main.d.ts +0 -40
  72. package/main.js +0 -359
  73. package/number-input/NumberInput.js +0 -136
  74. package/number-input/NumberInputContext.js +0 -16
  75. package/number-input/index.d.ts +0 -113
  76. package/paginator/Icons.js +0 -66
  77. package/paginator/Paginator.js +0 -305
  78. package/paginator/index.d.ts +0 -20
  79. package/password-input/PasswordInput.js +0 -203
  80. package/password-input/index.d.ts +0 -94
  81. package/progress-bar/ProgressBar.js +0 -242
  82. package/progress-bar/index.d.ts +0 -18
  83. package/radio/Radio.js +0 -209
  84. package/radio/index.d.ts +0 -23
  85. package/resultsetTable/ResultsetTable.js +0 -358
  86. package/resultsetTable/index.d.ts +0 -19
  87. package/select/Select.js +0 -1138
  88. package/select/index.d.ts +0 -131
  89. package/sidenav/Sidenav.js +0 -179
  90. package/sidenav/index.d.ts +0 -13
  91. package/slider/Slider.js +0 -404
  92. package/slider/index.d.ts +0 -29
  93. package/spinner/Spinner.js +0 -381
  94. package/spinner/index.d.ts +0 -17
  95. package/switch/Switch.js +0 -222
  96. package/switch/index.d.ts +0 -24
  97. package/table/Table.js +0 -132
  98. package/table/index.d.ts +0 -13
  99. package/tabs/Tabs.js +0 -343
  100. package/tabs/index.d.ts +0 -19
  101. package/tag/Tag.js +0 -282
  102. package/tag/index.d.ts +0 -24
  103. package/text-input/TextInput.js +0 -992
  104. package/text-input/index.d.ts +0 -135
  105. package/textarea/Textarea.js +0 -369
  106. package/textarea/index.d.ts +0 -117
  107. package/toggle/Toggle.js +0 -220
  108. package/toggle/index.d.ts +0 -21
  109. package/toggle-group/ToggleGroup.js +0 -327
  110. package/toggle-group/index.d.ts +0 -21
  111. package/upload/Upload.js +0 -205
  112. package/upload/buttons-upload/ButtonsUpload.js +0 -135
  113. package/upload/buttons-upload/Icons.js +0 -40
  114. package/upload/dragAndDropArea/DragAndDropArea.js +0 -329
  115. package/upload/dragAndDropArea/Icons.js +0 -39
  116. package/upload/file-upload/FileToUpload.js +0 -189
  117. package/upload/file-upload/Icons.js +0 -66
  118. package/upload/files-upload/FilesToUpload.js +0 -123
  119. package/upload/index.d.ts +0 -15
  120. package/upload/transaction/Icons.js +0 -160
  121. package/upload/transaction/Transaction.js +0 -148
  122. package/upload/transactions/Transactions.js +0 -138
  123. package/useTheme.js +0 -22
  124. package/wizard/Icons.js +0 -65
  125. package/wizard/Wizard.js +0 -405
  126. package/wizard/index.d.ts +0 -18
@@ -1,287 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
-
5
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
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 _propTypes = _interopRequireDefault(require("prop-types"));
17
-
18
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
19
-
20
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
21
-
22
- function _templateObject10() {
23
- var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
24
-
25
- _templateObject10 = function _templateObject10() {
26
- return data;
27
- };
28
-
29
- return data;
30
- }
31
-
32
- function _templateObject9() {
33
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n font-size: 1rem;\n font-family: ", ";\n border: 1px solid transparent;\n border-radius: 4px;\n margin-left: 4px;\n background-color: transparent;\n padding: 3px;\n cursor: pointer;\n svg {\n line-height: 18px;\n }\n &:hover {\n background-color: ", ";\n }\n &:focus {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n"]);
34
-
35
- _templateObject9 = function _templateObject9() {
36
- return data;
37
- };
38
-
39
- return data;
40
- }
41
-
42
- function _templateObject8() {
43
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n padding: 3px;\n height: 18px;\n width: 18px;\n color: #d0011b;\n"]);
44
-
45
- _templateObject8 = function _templateObject8() {
46
- return data;
47
- };
48
-
49
- return data;
50
- }
51
-
52
- function _templateObject7() {
53
- var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n width: ", ";\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
54
-
55
- _templateObject7 = function _templateObject7() {
56
- return data;
57
- };
58
-
59
- return data;
60
- }
61
-
62
- function _templateObject6() {
63
- var data = (0, _taggedTemplateLiteral2["default"])([""]);
64
-
65
- _templateObject6 = function _templateObject6() {
66
- return data;
67
- };
68
-
69
- return data;
70
- }
71
-
72
- function _templateObject5() {
73
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 12px;\n background-color: ", ";\n width: 48px;\n height: 48px;\n border-radius: 2px;\n color: ", ";\n"]);
74
-
75
- _templateObject5 = function _templateObject5() {
76
- return data;
77
- };
78
-
79
- return data;
80
- }
81
-
82
- function _templateObject4() {
83
- var data = (0, _taggedTemplateLiteral2["default"])(["\n width: 48px;\n height: 48px;\n object-fit: contain;\n margin-right: 12px;\n border-radius: 2px;\n"]);
84
-
85
- _templateObject4 = function _templateObject4() {
86
- return data;
87
- };
88
-
89
- return data;
90
- }
91
-
92
- function _templateObject3() {
93
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n align-items: center;\n"]);
94
-
95
- _templateObject3 = function _templateObject3() {
96
- return data;
97
- };
98
-
99
- return data;
100
- }
101
-
102
- function _templateObject2() {
103
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n"]);
104
-
105
- _templateObject2 = function _templateObject2() {
106
- return data;
107
- };
108
-
109
- return data;
110
- }
111
-
112
- function _templateObject() {
113
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n padding: ", ";\n background-color: ", ";\n border-radius: ", ";\n width: ", ";\n min-height: ", ";\n border-color: ", ";\n border-width: ", ";\n border-style: ", ";\n display: flex;\n justify-content: center;\n"]);
114
-
115
- _templateObject = function _templateObject() {
116
- return data;
117
- };
118
-
119
- return data;
120
- }
121
-
122
- var deleteIcon = _react["default"].createElement("svg", {
123
- xmlns: "http://www.w3.org/2000/svg",
124
- width: "24",
125
- height: "24",
126
- viewBox: "0 0 24 24",
127
- fill: "currentColor"
128
- }, _react["default"].createElement("path", {
129
- d: "M0 0h24v24H0V0z",
130
- fill: "none"
131
- }), _react["default"].createElement("path", {
132
- d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
133
- }));
134
-
135
- var errorIcon = _react["default"].createElement("svg", {
136
- xmlns: "http://www.w3.org/2000/svg",
137
- height: "24px",
138
- viewBox: "0 0 24 24",
139
- width: "24px",
140
- fill: "currentColor"
141
- }, _react["default"].createElement("path", {
142
- d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
143
- }));
144
-
145
- var FileItem = function FileItem(_ref) {
146
- var mode = _ref.mode,
147
- multiple = _ref.multiple,
148
- _ref$name = _ref.name,
149
- name = _ref$name === void 0 ? "" : _ref$name,
150
- _ref$error = _ref.error,
151
- error = _ref$error === void 0 ? "" : _ref$error,
152
- showPreview = _ref.showPreview,
153
- preview = _ref.preview,
154
- type = _ref.type,
155
- numFiles = _ref.numFiles,
156
- onDelete = _ref.onDelete;
157
- var colorsTheme = (0, _useTheme["default"])();
158
- var isImage = type.includes("image");
159
-
160
- var getIconAriaLabel = function getIconAriaLabel() {
161
- if (type.includes("video")) {
162
- return "video";
163
- }
164
-
165
- if (type.includes("audio")) {
166
- return "audio";
167
- }
168
-
169
- return "file";
170
- };
171
-
172
- return _react["default"].createElement(_styledComponents.ThemeProvider, {
173
- theme: colorsTheme.fileInput
174
- }, _react["default"].createElement(Container, {
175
- mode: mode,
176
- multiple: multiple,
177
- error: error,
178
- showPreview: showPreview,
179
- numFiles: numFiles
180
- }, showPreview && (isImage ? _react["default"].createElement(ImagePreview, {
181
- src: preview,
182
- alt: name
183
- }) : _react["default"].createElement(IconPreviewContainer, {
184
- error: error,
185
- "aria-label": getIconAriaLabel()
186
- }, _react["default"].createElement(IconPreview, {
187
- error: error
188
- }, preview))), _react["default"].createElement(FileItemContent, null, _react["default"].createElement(FileItemContainer, null, _react["default"].createElement(FileName, {
189
- mode: mode,
190
- multiple: multiple,
191
- error: error,
192
- showPreview: showPreview,
193
- numFiles: numFiles
194
- }, name), error && _react["default"].createElement(ErrorIcon, {
195
- "aria-label": "Error"
196
- }, errorIcon), _react["default"].createElement(DeleteIcon, {
197
- error: error,
198
- onClick: function onClick() {
199
- return onDelete(name);
200
- },
201
- "aria-label": "Remove ".concat(name)
202
- }, deleteIcon)), error && (multiple || numFiles > 1) && _react["default"].createElement(ErrorMessage, null, error))));
203
- };
204
-
205
- var Container = _styledComponents["default"].div(_templateObject(), function (props) {
206
- return props.showPreview ? "8px" : "8px 8px 8px 16px";
207
- }, function (props) {
208
- return props.error && props.theme.errorFileItemBackgroundColor;
209
- }, function (props) {
210
- return props.theme.fileItemBorderRadius;
211
- }, function (props) {
212
- return props.mode === "file" && !props.multiple && props.numFiles === 1 ? "calc(230px - 26px)" : !props.showPreview ? "calc(320px - 26px)" : props.showPreview && "calc(320px - 18px)";
213
- }, function (props) {
214
- return props.mode === "file" && !props.multiple && props.numFiles === 1 || !props.showPreview && !props.error ? "calc(40px - 18px)" : !props.showPreview && props.error ? "calc(59px - 18px)" : "calc(64px - 18px)";
215
- }, function (props) {
216
- return props.error ? props.theme.errorFileItemBorderColor : props.theme.fileItemBorderColor;
217
- }, function (props) {
218
- return props.theme.fileItemBorderThickness;
219
- }, function (props) {
220
- return props.theme.fileItemBorderStyle;
221
- });
222
-
223
- var FileItemContent = _styledComponents["default"].div(_templateObject2());
224
-
225
- var FileItemContainer = _styledComponents["default"].div(_templateObject3());
226
-
227
- var ImagePreview = _styledComponents["default"].img(_templateObject4());
228
-
229
- var IconPreviewContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
230
- return props.error ? props.theme.errorFileItemIconBackgroundColor : props.theme.fileItemIconBackgroundColor;
231
- }, function (props) {
232
- return props.error ? props.theme.errorFileItemIconColor : props.theme.fileItemIconColor;
233
- });
234
-
235
- var IconPreview = _styledComponents["default"].div(_templateObject6());
236
-
237
- var FileName = _styledComponents["default"].span(_templateObject7(), function (props) {
238
- return props.theme.fileNameFontColor;
239
- }, function (props) {
240
- return props.mode === "file" && !props.multiple && props.error && props.numFiles === 1 ? "calc(230px - 76px)" : props.mode === "file" && !props.multiple && !props.error && props.numFiles === 1 ? "calc(230px - 50px)" : !props.showPreview && !props.error ? "calc(320px - 52px)" : !props.showPreview && props.error ? "calc(320px - 76px)" : props.showPreview && props.error ? "calc(320px - 128px)" : props.showPreview && !props.error && "calc(320px - 102px)";
241
- }, function (props) {
242
- return props.theme.fileItemFontFamily;
243
- }, function (props) {
244
- return props.theme.fileItemFontSize;
245
- }, function (props) {
246
- return props.theme.fileItemFontWeight;
247
- }, function (props) {
248
- return props.theme.fileItemLineHeight;
249
- });
250
-
251
- var ErrorIcon = _styledComponents["default"].span(_templateObject8());
252
-
253
- var DeleteIcon = _styledComponents["default"].button(_templateObject9(), function (props) {
254
- return props.theme.fontFamily;
255
- }, function (props) {
256
- return props.error ? props.theme.errorHoverDeleteFileItemBackgroundColor : props.theme.hoverDeleteFileItemBackgroundColor;
257
- }, function (props) {
258
- return props.error ? props.theme.errorHoverDeleteFileItemBackgroundColor : props.theme.hoverDeleteFileItemBackgroundColor;
259
- }, function (props) {
260
- return props.error ? props.theme.errorActiveDeleteFileItemBackgroundColor : props.theme.activeDeleteFileItemBackgroundColor;
261
- });
262
-
263
- var ErrorMessage = _styledComponents["default"].span(_templateObject10(), function (props) {
264
- return props.theme.errorMessageFontColor;
265
- }, function (props) {
266
- return props.theme.errorMessageFontFamily;
267
- }, function (props) {
268
- return props.theme.errorMessageFontSize;
269
- }, function (props) {
270
- return props.theme.errorMessageFontWeight;
271
- }, function (props) {
272
- return props.theme.errorMessageLineHeight;
273
- });
274
-
275
- FileItem.propTypes = {
276
- mode: _propTypes["default"].string,
277
- multiple: _propTypes["default"].bool,
278
- name: _propTypes["default"].string,
279
- type: _propTypes["default"].string,
280
- showPreview: _propTypes["default"]["boolean"],
281
- numFiles: _propTypes["default"].number,
282
- preview: _propTypes["default"].string,
283
- error: _propTypes["default"].string,
284
- onDelete: _propTypes["default"].func
285
- };
286
- var _default = FileItem;
287
- exports["default"] = _default;
@@ -1,81 +0,0 @@
1
- type Size = "small" | "medium" | "large" | "fillParent";
2
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- type Margin = {
4
- top?: Space;
5
- bottom?: Space;
6
- left?: Space;
7
- right?: Space;
8
- };
9
- type FileData = {
10
- error?: string;
11
- file?: File;
12
- preview?: string;
13
- };
14
-
15
- type Props = {
16
- /**
17
- * Name attribute of the file input element.
18
- */
19
- name?: string;
20
- /**
21
- * Text to be placed above the file input.
22
- */
23
- label?: string;
24
- /**
25
- * Uses one of the available file input modes:
26
- * 'file': Files are selected by clicking the button and selecting it through the file explorer.
27
- * 'filedrop': Files can be selected by clicking the button and selecting it through the file explorer or by dropping them inside the drag and drop area.
28
- * 'dropzone': Files can be selected by clicking the button and selecting it through the file explorer or by dropping them inside the drag and drop area.
29
- * The drag and drop area of this mode is bigger than the one of the filedrop mode.
30
- */
31
- mode?: "file" | "filedrop" | "dropzone";
32
- /**
33
- * Helper text to be placed above the file input.
34
- */
35
- helperText?: string;
36
- /**
37
- * Defines the file types accepted by the component. It is not possible to select a file with a non valid type.
38
- */
39
- accept?: string;
40
- /**
41
- * An array of FileData representing the selected files.
42
- */
43
- value?: FileData[];
44
- /**
45
- * Minimum file size allowed (in bytes). If the file size does not comply the minSize, an error will be passed to the FileData.
46
- */
47
- minSize?: number;
48
- /**
49
- * Maximum file size allowed (in bytes). If the file size does not comply the maxSize, an error will be passed to the FileData.
50
- */
51
- maxSize?: number;
52
- /**
53
- * If true and if the file is an image, a preview of it will be shown. If it is not an image, an icon refering to the file's type will be shown.
54
- * If mode is not multiple and there is one file already selected, the file will be replaced by the last selected one.
55
- */
56
- showPreview?: boolean;
57
- /**
58
- * If true, more than one file can be selected. If false, only one file can be selected.
59
- */
60
- multiple?: boolean;
61
- /**
62
- * If true, the component will be disabled.
63
- */
64
- disabled?: boolean;
65
- /**
66
- * This function will be called when the user selects or drops a file. The list of files will be sent as a parameter.
67
- * In this function, the files can be updated or returned as they come. These files must be passed to the value in order to be shown.
68
- */
69
- callbackFile?: (files: FileData[]) => void;
70
- /**
71
- * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
72
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
73
- */
74
- margin?: Space | Margin;
75
- /**
76
- * Value of the tabindex attribute.
77
- */
78
- tabIndex?: number;
79
- };
80
-
81
- export default function DxcFileInput(props: Props): JSX.Element;