@dxc-technology/halstack-react 0.0.0-64fdce7 → 0.0.0-6501724
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.
- package/BackgroundColorContext.d.ts +2 -2
- package/BackgroundColorContext.js +1 -1
- package/HalstackContext.d.ts +1329 -5
- package/HalstackContext.js +113 -72
- package/accordion/Accordion.js +6 -11
- package/accordion/Accordion.stories.tsx +52 -3
- package/accordion/Accordion.test.js +1 -1
- package/accordion/types.d.ts +3 -3
- package/accordion-group/AccordionGroup.d.ts +4 -3
- package/accordion-group/AccordionGroup.js +23 -44
- package/accordion-group/AccordionGroup.test.js +1 -1
- package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
- package/accordion-group/AccordionGroupAccordion.js +43 -0
- package/accordion-group/types.d.ts +2 -2
- package/alert/Alert.js +4 -8
- package/alert/Alert.stories.tsx +28 -0
- package/alert/Alert.test.js +1 -1
- package/bleed/Bleed.stories.tsx +1 -0
- package/box/Box.js +3 -5
- package/box/Box.stories.tsx +15 -0
- package/box/Box.test.js +1 -1
- package/bulleted-list/BulletedList.js +4 -2
- package/bulleted-list/BulletedList.stories.tsx +7 -1
- package/bulleted-list/types.d.ts +31 -4
- package/button/Button.js +2 -3
- package/button/Button.stories.tsx +95 -10
- package/button/Button.test.js +1 -1
- package/button/types.d.ts +3 -3
- package/card/Card.js +12 -13
- package/card/Card.stories.tsx +12 -13
- package/card/Card.test.js +1 -1
- package/checkbox/Checkbox.js +3 -3
- package/checkbox/Checkbox.stories.tsx +52 -0
- package/checkbox/Checkbox.test.js +1 -1
- package/checkbox/types.d.ts +2 -2
- package/chip/Chip.js +25 -34
- package/chip/Chip.stories.tsx +80 -17
- package/chip/Chip.test.js +3 -5
- package/common/OpenSans.css +68 -80
- package/common/coreTokens.d.ts +146 -0
- package/common/coreTokens.js +167 -0
- package/common/utils.d.ts +1 -0
- package/common/utils.js +4 -4
- package/common/variables.d.ts +1482 -0
- package/common/variables.js +962 -1123
- package/date-input/DateInput.stories.tsx +67 -0
- package/dialog/Dialog.d.ts +1 -1
- package/dialog/Dialog.js +55 -86
- package/dialog/Dialog.stories.tsx +145 -217
- package/dialog/Dialog.test.js +302 -3
- package/dialog/types.d.ts +0 -13
- package/dropdown/Dropdown.js +2 -2
- package/dropdown/Dropdown.stories.tsx +46 -1
- package/dropdown/Dropdown.test.js +3 -2
- package/dropdown/DropdownMenu.js +5 -1
- package/dropdown/DropdownMenuItem.js +0 -2
- package/dropdown/types.d.ts +3 -3
- package/file-input/FileInput.js +4 -8
- package/file-input/FileInput.stories.tsx +85 -2
- package/file-input/FileInput.test.js +1 -42
- package/file-input/FileItem.js +1 -0
- package/flex/Flex.js +4 -2
- package/flex/Flex.stories.tsx +35 -26
- package/flex/types.d.ts +70 -5
- package/footer/Footer.js +6 -8
- package/footer/Footer.stories.tsx +91 -0
- package/footer/Footer.test.js +14 -26
- package/grid/Grid.d.ts +7 -0
- package/grid/Grid.js +91 -0
- package/grid/Grid.stories.tsx +219 -0
- package/grid/types.d.ts +115 -0
- package/header/Header.d.ts +3 -2
- package/header/Header.js +3 -3
- package/header/Header.stories.tsx +115 -5
- package/header/Header.test.js +2 -2
- package/header/types.d.ts +2 -2
- package/heading/Heading.js +1 -1
- package/heading/Heading.test.js +1 -1
- package/inset/Inset.stories.tsx +2 -1
- package/layout/ApplicationLayout.d.ts +3 -3
- package/layout/ApplicationLayout.js +1 -1
- package/layout/types.d.ts +2 -3
- package/link/Link.js +3 -3
- package/link/Link.stories.tsx +60 -0
- package/link/Link.test.js +2 -4
- package/link/types.d.ts +2 -2
- package/main.d.ts +3 -2
- package/main.js +9 -1
- package/{tabs-nav → nav-tabs}/NavTabs.d.ts +2 -2
- package/{tabs-nav → nav-tabs}/NavTabs.js +8 -11
- package/{tabs-nav → nav-tabs}/NavTabs.stories.tsx +103 -1
- package/{tabs-nav → nav-tabs}/NavTabs.test.js +1 -1
- package/{tabs-nav → nav-tabs}/Tab.js +47 -29
- package/{tabs-nav → nav-tabs}/types.d.ts +8 -9
- package/nav-tabs/types.js +5 -0
- package/number-input/NumberInput.test.js +1 -1
- package/package.json +2 -2
- package/paginator/Paginator.js +2 -4
- package/paginator/Paginator.stories.tsx +24 -0
- package/paginator/Paginator.test.js +40 -37
- package/paragraph/Paragraph.d.ts +3 -4
- package/paragraph/Paragraph.js +5 -5
- package/password-input/PasswordInput.test.js +1 -1
- package/progress-bar/ProgressBar.d.ts +2 -2
- package/progress-bar/ProgressBar.js +5 -5
- package/progress-bar/ProgressBar.stories.jsx +35 -2
- package/progress-bar/ProgressBar.test.js +1 -1
- package/progress-bar/types.d.ts +4 -3
- package/quick-nav/QuickNav.stories.tsx +14 -0
- package/radio-group/Radio.js +10 -10
- package/radio-group/RadioGroup.js +8 -10
- package/radio-group/RadioGroup.stories.tsx +131 -18
- package/radio-group/RadioGroup.test.js +1 -1
- package/resultsetTable/ResultsetTable.js +2 -2
- package/resultsetTable/ResultsetTable.test.js +1 -1
- package/resultsetTable/types.d.ts +3 -3
- package/select/Select.js +13 -11
- package/select/Select.stories.tsx +477 -175
- package/select/Select.test.js +59 -59
- package/sidenav/Icons.d.ts +7 -0
- package/sidenav/Icons.js +51 -0
- package/sidenav/Sidenav.d.ts +2 -2
- package/sidenav/Sidenav.js +66 -94
- package/sidenav/Sidenav.stories.tsx +110 -17
- package/sidenav/types.d.ts +21 -18
- package/slider/Slider.js +2 -3
- package/slider/Slider.stories.tsx +57 -0
- package/slider/Slider.test.js +1 -1
- package/slider/types.d.ts +2 -2
- package/spinner/Spinner.js +15 -21
- package/spinner/Spinner.stories.jsx +53 -27
- package/spinner/Spinner.test.js +1 -1
- package/switch/Switch.js +2 -2
- package/switch/Switch.stories.tsx +33 -0
- package/switch/Switch.test.js +1 -1
- package/switch/types.d.ts +2 -2
- package/table/Table.js +2 -2
- package/table/Table.stories.jsx +80 -1
- package/table/Table.test.js +1 -1
- package/tabs/Tab.js +9 -10
- package/tabs/Tabs.js +11 -17
- package/tabs/Tabs.stories.tsx +38 -0
- package/tabs/Tabs.test.js +4 -5
- package/tabs/types.d.ts +2 -2
- package/tag/Tag.js +7 -9
- package/tag/Tag.stories.tsx +14 -1
- package/tag/Tag.test.js +1 -1
- package/text-input/Suggestion.js +2 -2
- package/text-input/TextInput.js +4 -4
- package/text-input/TextInput.stories.tsx +69 -1
- package/text-input/TextInput.test.js +1 -2
- package/textarea/Textarea.js +3 -4
- package/textarea/Textarea.stories.jsx +60 -1
- package/textarea/Textarea.test.js +2 -4
- package/toggle-group/ToggleGroup.d.ts +2 -2
- package/toggle-group/ToggleGroup.js +7 -4
- package/toggle-group/ToggleGroup.stories.tsx +42 -0
- package/toggle-group/ToggleGroup.test.js +1 -1
- package/toggle-group/types.d.ts +1 -1
- package/typography/Typography.d.ts +2 -2
- package/typography/Typography.js +14 -113
- package/typography/Typography.stories.tsx +1 -1
- package/useTheme.d.ts +1234 -1
- package/useTheme.js +1 -1
- package/useTranslatedLabels.d.ts +84 -1
- package/utils/BaseTypography.d.ts +21 -0
- package/utils/BaseTypography.js +108 -0
- package/utils/FocusLock.d.ts +13 -0
- package/utils/FocusLock.js +138 -0
- package/wizard/Wizard.js +2 -2
- package/wizard/Wizard.stories.tsx +20 -0
- package/wizard/Wizard.test.js +1 -1
- package/wizard/types.d.ts +5 -6
- /package/{tabs-nav → grid}/types.js +0 -0
- /package/{tabs-nav → nav-tabs}/Tab.d.ts +0 -0
package/dialog/Dialog.test.js
CHANGED
|
@@ -6,8 +6,43 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
6
6
|
|
|
7
7
|
var _react2 = require("@testing-library/react");
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
10
10
|
|
|
11
|
+
var _Dialog = _interopRequireDefault(require("./Dialog.tsx"));
|
|
12
|
+
|
|
13
|
+
var _TextInput = _interopRequireDefault(require("../text-input/TextInput.tsx"));
|
|
14
|
+
|
|
15
|
+
var _Textarea = _interopRequireDefault(require("../textarea/Textarea.tsx"));
|
|
16
|
+
|
|
17
|
+
var _Checkbox = _interopRequireDefault(require("../checkbox/Checkbox.tsx"));
|
|
18
|
+
|
|
19
|
+
var _Select = _interopRequireDefault(require("../select/Select.tsx"));
|
|
20
|
+
|
|
21
|
+
var _Button = _interopRequireDefault(require("../button/Button.tsx"));
|
|
22
|
+
|
|
23
|
+
var _Link = _interopRequireDefault(require("../link/Link.tsx"));
|
|
24
|
+
|
|
25
|
+
var _Card = _interopRequireDefault(require("../card/Card.tsx"));
|
|
26
|
+
|
|
27
|
+
var _RadioGroup = _interopRequireDefault(require("../radio-group/RadioGroup.tsx"));
|
|
28
|
+
|
|
29
|
+
var _Slider = _interopRequireDefault(require("../slider/Slider.tsx"));
|
|
30
|
+
|
|
31
|
+
var _Switch = _interopRequireDefault(require("../switch/Switch.tsx"));
|
|
32
|
+
|
|
33
|
+
var options = [{
|
|
34
|
+
label: "Female",
|
|
35
|
+
value: "female"
|
|
36
|
+
}, {
|
|
37
|
+
label: "Male",
|
|
38
|
+
value: "male"
|
|
39
|
+
}, {
|
|
40
|
+
label: "Non-binary",
|
|
41
|
+
value: "non-binary"
|
|
42
|
+
}, {
|
|
43
|
+
label: "Other",
|
|
44
|
+
value: "other"
|
|
45
|
+
}];
|
|
11
46
|
describe("Dialog component tests", function () {
|
|
12
47
|
test("Dialog renders with correct text and accesibility attributes", function () {
|
|
13
48
|
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, "dialog-text")),
|
|
@@ -50,7 +85,7 @@ describe("Dialog component tests", function () {
|
|
|
50
85
|
|
|
51
86
|
expect(onCloseClick).toHaveBeenCalled();
|
|
52
87
|
});
|
|
53
|
-
test("Calls correct function onCloseClick when '
|
|
88
|
+
test("Calls correct function onCloseClick when 'Escape' key is pressed", function () {
|
|
54
89
|
var onCloseClick = jest.fn();
|
|
55
90
|
|
|
56
91
|
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
@@ -58,7 +93,7 @@ describe("Dialog component tests", function () {
|
|
|
58
93
|
}, "dialog-text")),
|
|
59
94
|
getByRole = _render5.getByRole;
|
|
60
95
|
|
|
61
|
-
_react2.fireEvent.keyDown(getByRole("
|
|
96
|
+
_react2.fireEvent.keyDown(getByRole("dialog"), {
|
|
62
97
|
key: "Escape",
|
|
63
98
|
code: "Escape",
|
|
64
99
|
keyCode: 27,
|
|
@@ -67,4 +102,268 @@ describe("Dialog component tests", function () {
|
|
|
67
102
|
|
|
68
103
|
expect(onCloseClick).toHaveBeenCalled();
|
|
69
104
|
});
|
|
105
|
+
});
|
|
106
|
+
describe("Dialog component: Focus lock tests", function () {
|
|
107
|
+
test("Close action: when there's no focusable content, the focus never leaves the close action (unless you click outside)", function () {
|
|
108
|
+
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, "example-dialog")),
|
|
109
|
+
getByRole = _render6.getByRole;
|
|
110
|
+
|
|
111
|
+
var button = getByRole("button");
|
|
112
|
+
var dialog = getByRole("dialog");
|
|
113
|
+
expect(document.activeElement).toEqual(button);
|
|
114
|
+
expect(button.getAttribute("aria-label")).toBe("Close dialog");
|
|
115
|
+
|
|
116
|
+
_userEvent["default"].tab();
|
|
117
|
+
|
|
118
|
+
expect(document.activeElement).toEqual(button);
|
|
119
|
+
|
|
120
|
+
_react2.fireEvent.keyDown(dialog, {
|
|
121
|
+
key: "Tab",
|
|
122
|
+
shiftKey: true
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
expect(document.activeElement).toEqual(button);
|
|
126
|
+
});
|
|
127
|
+
test("Autofocus with Button component", function () {
|
|
128
|
+
var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
129
|
+
label: "Accept"
|
|
130
|
+
}))),
|
|
131
|
+
getAllByRole = _render7.getAllByRole;
|
|
132
|
+
|
|
133
|
+
var button = getAllByRole("button")[0];
|
|
134
|
+
expect(document.activeElement).toEqual(button);
|
|
135
|
+
expect(button.getAttribute("aria-label")).not.toBe("Close dialog");
|
|
136
|
+
});
|
|
137
|
+
test("Autofocus with Card component", function () {
|
|
138
|
+
var _render8 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
139
|
+
linkHref: "https://developer.dxc.com/halstack/next/components/card/"
|
|
140
|
+
}, "example-card"))),
|
|
141
|
+
getByRole = _render8.getByRole;
|
|
142
|
+
|
|
143
|
+
var card = getByRole("link");
|
|
144
|
+
expect(document.activeElement).toEqual(card);
|
|
145
|
+
});
|
|
146
|
+
test("Autofocus with Checkbox component", function () {
|
|
147
|
+
var _render9 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
148
|
+
label: "Name"
|
|
149
|
+
}))),
|
|
150
|
+
getByRole = _render9.getByRole;
|
|
151
|
+
|
|
152
|
+
var checkbox = getByRole("checkbox");
|
|
153
|
+
expect(document.activeElement).toEqual(checkbox);
|
|
154
|
+
});
|
|
155
|
+
test("Autofocus with Link component", function () {
|
|
156
|
+
var _render10 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, "This is a text with a ", /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
157
|
+
href: "#"
|
|
158
|
+
}, "Link"), " to another page.")),
|
|
159
|
+
getByRole = _render10.getByRole;
|
|
160
|
+
|
|
161
|
+
var link = getByRole("link");
|
|
162
|
+
expect(document.activeElement).toEqual(link);
|
|
163
|
+
});
|
|
164
|
+
test("Autofocus with RadioGroup component", function () {
|
|
165
|
+
var _render11 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, /*#__PURE__*/_react["default"].createElement(_RadioGroup["default"], {
|
|
166
|
+
label: "Example",
|
|
167
|
+
options: options
|
|
168
|
+
}))),
|
|
169
|
+
getAllByRole = _render11.getAllByRole;
|
|
170
|
+
|
|
171
|
+
var checkedRadio = getAllByRole("radio")[0];
|
|
172
|
+
expect(document.activeElement).toEqual(checkedRadio);
|
|
173
|
+
});
|
|
174
|
+
test("Autofocus with Select component", function () {
|
|
175
|
+
var _render12 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
176
|
+
label: "Country",
|
|
177
|
+
options: options
|
|
178
|
+
}))),
|
|
179
|
+
getByRole = _render12.getByRole;
|
|
180
|
+
|
|
181
|
+
var select = getByRole("combobox");
|
|
182
|
+
expect(document.activeElement).toEqual(select);
|
|
183
|
+
});
|
|
184
|
+
test("Autofocus with Slider component", function () {
|
|
185
|
+
var _render13 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, /*#__PURE__*/_react["default"].createElement(_Slider["default"], {
|
|
186
|
+
label: "label",
|
|
187
|
+
minValue: 0,
|
|
188
|
+
maxValue: 100,
|
|
189
|
+
showLimitsValues: true
|
|
190
|
+
}))),
|
|
191
|
+
getByRole = _render13.getByRole;
|
|
192
|
+
|
|
193
|
+
var slider = getByRole("slider");
|
|
194
|
+
expect(document.activeElement).toEqual(slider);
|
|
195
|
+
});
|
|
196
|
+
test("Autofocus with Switch component", function () {
|
|
197
|
+
var _render14 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, /*#__PURE__*/_react["default"].createElement(_Switch["default"], {
|
|
198
|
+
label: "Example"
|
|
199
|
+
}))),
|
|
200
|
+
getByRole = _render14.getByRole;
|
|
201
|
+
|
|
202
|
+
var switchButton = getByRole("switch");
|
|
203
|
+
expect(document.activeElement).toEqual(switchButton);
|
|
204
|
+
});
|
|
205
|
+
test("Autofocus with Text Input component", function () {
|
|
206
|
+
var _render15 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
207
|
+
label: "Name"
|
|
208
|
+
}))),
|
|
209
|
+
getByRole = _render15.getByRole;
|
|
210
|
+
|
|
211
|
+
var input = getByRole("textbox");
|
|
212
|
+
expect(document.activeElement).toEqual(input);
|
|
213
|
+
});
|
|
214
|
+
test("Autofocus with Textarea component", function () {
|
|
215
|
+
var _render16 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, /*#__PURE__*/_react["default"].createElement(_Textarea["default"], {
|
|
216
|
+
label: "Name"
|
|
217
|
+
}))),
|
|
218
|
+
getByRole = _render16.getByRole;
|
|
219
|
+
|
|
220
|
+
var textarea = getByRole("textbox");
|
|
221
|
+
expect(document.activeElement).toEqual(textarea);
|
|
222
|
+
});
|
|
223
|
+
test("Negative tabindex elements are not automatically focused, even if it is enabled and a valid focusable item (programatically and by click)", function () {
|
|
224
|
+
var _render17 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, /*#__PURE__*/_react["default"].createElement("input", {
|
|
225
|
+
label: "Name",
|
|
226
|
+
tabIndex: -1
|
|
227
|
+
}), /*#__PURE__*/_react["default"].createElement("input", {
|
|
228
|
+
label: "Name"
|
|
229
|
+
}))),
|
|
230
|
+
getAllByRole = _render17.getAllByRole,
|
|
231
|
+
getByRole = _render17.getByRole;
|
|
232
|
+
|
|
233
|
+
var inputs = getAllByRole("textbox");
|
|
234
|
+
var button = getByRole("button");
|
|
235
|
+
expect(document.activeElement).toEqual(inputs[1]);
|
|
236
|
+
|
|
237
|
+
_userEvent["default"].tab();
|
|
238
|
+
|
|
239
|
+
expect(document.activeElement).toEqual(button);
|
|
240
|
+
|
|
241
|
+
_userEvent["default"].tab();
|
|
242
|
+
|
|
243
|
+
expect(document.activeElement).toEqual(inputs[1]);
|
|
244
|
+
});
|
|
245
|
+
test("Focus jumps disabled components and negative tabIndexes when autofocusing first item", function () {
|
|
246
|
+
var _render18 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
247
|
+
label: "Accept",
|
|
248
|
+
disabled: true
|
|
249
|
+
}), /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
250
|
+
label: "Older age",
|
|
251
|
+
disabled: true
|
|
252
|
+
}), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
253
|
+
label: "Country",
|
|
254
|
+
options: options,
|
|
255
|
+
disabled: true
|
|
256
|
+
}), /*#__PURE__*/_react["default"].createElement(_RadioGroup["default"], {
|
|
257
|
+
label: "Country",
|
|
258
|
+
options: options,
|
|
259
|
+
disabled: true
|
|
260
|
+
}), /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
261
|
+
label: "Name",
|
|
262
|
+
disabled: true
|
|
263
|
+
}), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
264
|
+
label: "Accept",
|
|
265
|
+
tabIndex: -1
|
|
266
|
+
}), /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
267
|
+
label: "Older age",
|
|
268
|
+
tabIndex: -1
|
|
269
|
+
}), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
270
|
+
label: "Country",
|
|
271
|
+
options: options,
|
|
272
|
+
tabIndex: -1
|
|
273
|
+
}), /*#__PURE__*/_react["default"].createElement(_RadioGroup["default"], {
|
|
274
|
+
label: "Country",
|
|
275
|
+
options: options,
|
|
276
|
+
tabIndex: -1
|
|
277
|
+
}), /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
278
|
+
label: "Name",
|
|
279
|
+
tabIndex: -1
|
|
280
|
+
}), /*#__PURE__*/_react["default"].createElement(_Textarea["default"], {
|
|
281
|
+
label: "Description"
|
|
282
|
+
}))),
|
|
283
|
+
getAllByRole = _render18.getAllByRole;
|
|
284
|
+
|
|
285
|
+
var textarea = getAllByRole("textbox")[2];
|
|
286
|
+
expect(document.activeElement).toEqual(textarea);
|
|
287
|
+
});
|
|
288
|
+
test("Focus jumps from last element to the first", function () {
|
|
289
|
+
var _render19 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
290
|
+
label: "Accept",
|
|
291
|
+
disabled: true
|
|
292
|
+
}), /*#__PURE__*/_react["default"].createElement(_Textarea["default"], {
|
|
293
|
+
label: "Name"
|
|
294
|
+
}), /*#__PURE__*/_react["default"].createElement(_RadioGroup["default"], {
|
|
295
|
+
label: "Name",
|
|
296
|
+
options: options
|
|
297
|
+
}))),
|
|
298
|
+
getByRole = _render19.getByRole;
|
|
299
|
+
|
|
300
|
+
var closeAction = getByRole("button");
|
|
301
|
+
var textarea = getByRole("textbox");
|
|
302
|
+
expect(document.activeElement).toEqual(textarea);
|
|
303
|
+
|
|
304
|
+
_userEvent["default"].tab();
|
|
305
|
+
|
|
306
|
+
_userEvent["default"].tab();
|
|
307
|
+
|
|
308
|
+
expect(document.activeElement).toEqual(closeAction);
|
|
309
|
+
|
|
310
|
+
_userEvent["default"].tab();
|
|
311
|
+
|
|
312
|
+
expect(document.activeElement).toEqual(textarea);
|
|
313
|
+
});
|
|
314
|
+
test("'display: none;', 'visibility: hidden;' and 'type = 'hidden'' elements are never autofocused", function () {
|
|
315
|
+
var _render20 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Dialog["default"], null, /*#__PURE__*/_react["default"].createElement("input", {
|
|
316
|
+
label: "Name",
|
|
317
|
+
style: {
|
|
318
|
+
display: "none"
|
|
319
|
+
}
|
|
320
|
+
}), /*#__PURE__*/_react["default"].createElement("input", {
|
|
321
|
+
label: "Name",
|
|
322
|
+
style: {
|
|
323
|
+
visibility: "hidden"
|
|
324
|
+
}
|
|
325
|
+
}), /*#__PURE__*/_react["default"].createElement("input", {
|
|
326
|
+
type: "hidden",
|
|
327
|
+
name: "example"
|
|
328
|
+
}))),
|
|
329
|
+
getByRole = _render20.getByRole;
|
|
330
|
+
|
|
331
|
+
var closeAction = getByRole("button");
|
|
332
|
+
expect(document.activeElement).toEqual(closeAction);
|
|
333
|
+
|
|
334
|
+
_userEvent["default"].tab();
|
|
335
|
+
|
|
336
|
+
expect(document.activeElement).toEqual(closeAction);
|
|
337
|
+
});
|
|
338
|
+
test("Focus gets trapped in the Dialog when there are not focusable elements inside until it is closed", function () {
|
|
339
|
+
var _render21 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
340
|
+
label: "Name"
|
|
341
|
+
}), /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
|
|
342
|
+
isCloseVisible: false
|
|
343
|
+
}, /*#__PURE__*/_react["default"].createElement("h2", null, "Policy agreement"), /*#__PURE__*/_react["default"].createElement("p", null, "Sample text.")), /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
344
|
+
label: "Surname"
|
|
345
|
+
}))),
|
|
346
|
+
getAllByRole = _render21.getAllByRole;
|
|
347
|
+
|
|
348
|
+
var inputs = getAllByRole("textbox");
|
|
349
|
+
var dialog = getAllByRole("dialog")[0];
|
|
350
|
+
|
|
351
|
+
_userEvent["default"].tab();
|
|
352
|
+
|
|
353
|
+
_userEvent["default"].tab();
|
|
354
|
+
|
|
355
|
+
expect(document.activeElement).not.toEqual(inputs[1]);
|
|
356
|
+
|
|
357
|
+
_react2.fireEvent.keyDown(dialog, {
|
|
358
|
+
key: "Tab",
|
|
359
|
+
shiftKey: true
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
_react2.fireEvent.keyDown(dialog, {
|
|
363
|
+
key: "Tab",
|
|
364
|
+
shiftKey: true
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
expect(document.activeElement).not.toEqual(inputs[0]);
|
|
368
|
+
});
|
|
70
369
|
});
|
package/dialog/types.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
-
export declare type Padding = {
|
|
4
|
-
top?: Space;
|
|
5
|
-
bottom?: Space;
|
|
6
|
-
left?: Space;
|
|
7
|
-
right?: Space;
|
|
8
|
-
};
|
|
9
2
|
declare type Props = {
|
|
10
3
|
/**
|
|
11
4
|
* If true, the close 'x' button will be visible.
|
|
@@ -25,12 +18,6 @@ declare type Props = {
|
|
|
25
18
|
* The responsibility of hiding the modal lies with the user.
|
|
26
19
|
*/
|
|
27
20
|
onBackgroundClick?: () => void;
|
|
28
|
-
/**
|
|
29
|
-
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
30
|
-
* Size of the padding to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
31
|
-
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
32
|
-
*/
|
|
33
|
-
padding?: Padding | Space;
|
|
34
21
|
/**
|
|
35
22
|
* Value of the tabindex given to the close 'x' button.
|
|
36
23
|
*/
|
package/dropdown/Dropdown.js
CHANGED
|
@@ -19,9 +19,9 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
19
19
|
|
|
20
20
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
21
|
|
|
22
|
-
var _variables = require("../common/variables
|
|
22
|
+
var _variables = require("../common/variables");
|
|
23
23
|
|
|
24
|
-
var _utils = require("../common/utils
|
|
24
|
+
var _utils = require("../common/utils");
|
|
25
25
|
|
|
26
26
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
27
27
|
|
|
@@ -6,8 +6,9 @@ import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
|
6
6
|
import DropdownMenu from "./DropdownMenu";
|
|
7
7
|
import { Option } from "./types";
|
|
8
8
|
import useTheme from "../useTheme";
|
|
9
|
-
import { ThemeProvider } from "styled-components";
|
|
10
9
|
import DxcFlex from "../flex/Flex";
|
|
10
|
+
import { HalstackProvider } from "../HalstackContext";
|
|
11
|
+
import { ThemeProvider } from "styled-components";
|
|
11
12
|
|
|
12
13
|
export default {
|
|
13
14
|
title: "Dropdown",
|
|
@@ -91,6 +92,14 @@ const optionWithIcon: Option[] = [
|
|
|
91
92
|
|
|
92
93
|
const optionsIcon: any = options.map((op, i) => ({ ...op, icon: icons[i] }));
|
|
93
94
|
|
|
95
|
+
const opinionatedTheme = {
|
|
96
|
+
dropdown: {
|
|
97
|
+
baseColor: "#ffffff",
|
|
98
|
+
fontColor: "#000000",
|
|
99
|
+
optionFontColor: "#000000",
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
|
|
94
103
|
const Dropdown = () => (
|
|
95
104
|
<>
|
|
96
105
|
<ExampleContainer>
|
|
@@ -374,6 +383,42 @@ Chromatic.play = async ({ canvasElement }) => {
|
|
|
374
383
|
await userEvent.click(buttonList[buttonList.length - 1]);
|
|
375
384
|
};
|
|
376
385
|
|
|
386
|
+
export const OpinionatedTheme = () => (
|
|
387
|
+
<>
|
|
388
|
+
<Title title="Opinionated theme" theme="light" level={2} />
|
|
389
|
+
<ExampleContainer>
|
|
390
|
+
<Title title="Default" theme="light" level={4} />
|
|
391
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
392
|
+
<DxcDropdown label="Default" options={options} onSelectOption={(value) => {}} icon={iconSVG} />
|
|
393
|
+
</HalstackProvider>
|
|
394
|
+
</ExampleContainer>
|
|
395
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
396
|
+
<Title title="Hovered" theme="light" level={4} />
|
|
397
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
398
|
+
<DxcDropdown label="Hovered" options={options} onSelectOption={(value) => {}} icon={iconSVG} />
|
|
399
|
+
</HalstackProvider>
|
|
400
|
+
</ExampleContainer>
|
|
401
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
402
|
+
<Title title="Actived" theme="light" level={4} />
|
|
403
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
404
|
+
<DxcDropdown label="Actived" options={options} onSelectOption={(value) => {}} icon={iconSVG} />
|
|
405
|
+
</HalstackProvider>
|
|
406
|
+
</ExampleContainer>
|
|
407
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
408
|
+
<Title title="Focused" theme="light" level={4} />
|
|
409
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
410
|
+
<DxcDropdown label="Focused" options={options} onSelectOption={(value) => {}} icon={iconSVG} />
|
|
411
|
+
</HalstackProvider>
|
|
412
|
+
</ExampleContainer>
|
|
413
|
+
<ExampleContainer>
|
|
414
|
+
<Title title="Disabled" theme="light" level={4} />
|
|
415
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
416
|
+
<DxcDropdown label="Disabled" options={options} onSelectOption={(value) => {}} icon={iconSVG} disabled />
|
|
417
|
+
</HalstackProvider>
|
|
418
|
+
</ExampleContainer>
|
|
419
|
+
</>
|
|
420
|
+
);
|
|
421
|
+
|
|
377
422
|
export const DropdownMenuStates = DropdownListStates.bind({});
|
|
378
423
|
DropdownMenuStates.play = async ({ canvasElement }) => {
|
|
379
424
|
const canvas = within(canvasElement);
|
|
@@ -10,10 +10,11 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
|
|
11
11
|
var _react2 = require("@testing-library/react");
|
|
12
12
|
|
|
13
|
-
var _Dropdown = _interopRequireDefault(require("./Dropdown"));
|
|
14
|
-
|
|
15
13
|
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
16
14
|
|
|
15
|
+
var _Dropdown = _interopRequireDefault(require("./Dropdown.tsx"));
|
|
16
|
+
|
|
17
|
+
// Mocking DOMRect for Radix Primitive Popover
|
|
17
18
|
global.globalThis = global;
|
|
18
19
|
global.DOMRect = {
|
|
19
20
|
fromRect: function fromRect() {
|
package/dropdown/DropdownMenu.js
CHANGED
|
@@ -53,7 +53,7 @@ var DropdownMenu = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
53
53
|
}));
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
var DropdownMenuContainer = _styledComponents["default"].ul(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n max-height: 230px;\n min-width: min-content;\n
|
|
56
|
+
var DropdownMenuContainer = _styledComponents["default"].ul(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n max-height: 230px;\n min-width: min-content;\n padding: 0;\n margin: 0;\n background-color: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n border-radius: ", ";\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n outline: none;\n\n overflow-y: auto;\n &::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n &::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 6px;\n }\n &::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 6px;\n }\n"])), function (props) {
|
|
57
57
|
return props.theme.optionBackgroundColor;
|
|
58
58
|
}, function (props) {
|
|
59
59
|
return props.theme.borderThickness;
|
|
@@ -63,6 +63,10 @@ var DropdownMenuContainer = _styledComponents["default"].ul(_templateObject || (
|
|
|
63
63
|
return props.theme.borderColor;
|
|
64
64
|
}, function (props) {
|
|
65
65
|
return props.theme.borderRadius;
|
|
66
|
+
}, function (props) {
|
|
67
|
+
return props.theme.scrollBarThumbColor;
|
|
68
|
+
}, function (props) {
|
|
69
|
+
return props.theme.scrollBarTrackColor;
|
|
66
70
|
});
|
|
67
71
|
|
|
68
72
|
var _default = /*#__PURE__*/_react["default"].memo(DropdownMenu);
|
|
@@ -30,8 +30,6 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
30
30
|
role: "menuitem",
|
|
31
31
|
tabIndex: -1
|
|
32
32
|
}, iconPosition === "after" && /*#__PURE__*/_react["default"].createElement(DropdownMenuItemLabel, null, option.label), option.icon && /*#__PURE__*/_react["default"].createElement(DropdownMenuItemIcon, {
|
|
33
|
-
iconPosition: iconPosition,
|
|
34
|
-
label: option.label,
|
|
35
33
|
role: typeof option.icon === "string" ? undefined : "img"
|
|
36
34
|
}, typeof option.icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
37
35
|
src: option.icon
|
package/dropdown/types.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
declare type Margin = {
|
|
4
4
|
top?: Space;
|
|
5
5
|
bottom?: Space;
|
|
6
6
|
left?: Space;
|
|
7
7
|
right?: Space;
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
declare type Size = "small" | "medium" | "large" | "fillParent" | "fitContent";
|
|
10
10
|
declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
11
11
|
export declare type Option = {
|
|
12
12
|
/**
|
package/file-input/FileInput.js
CHANGED
|
@@ -29,7 +29,7 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
29
29
|
|
|
30
30
|
var _uuid = require("uuid");
|
|
31
31
|
|
|
32
|
-
var _variables = require("../common/variables
|
|
32
|
+
var _variables = require("../common/variables");
|
|
33
33
|
|
|
34
34
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
35
35
|
|
|
@@ -250,6 +250,7 @@ var DxcFileInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
250
250
|
return selectedFiles[key];
|
|
251
251
|
});
|
|
252
252
|
addFile(filesArray);
|
|
253
|
+
e.target.value = null;
|
|
253
254
|
};
|
|
254
255
|
|
|
255
256
|
var onDelete = (0, _react.useCallback)(function (fileName) {
|
|
@@ -370,7 +371,6 @@ var DxcFileInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
370
371
|
theme: colorsTheme.fileInput
|
|
371
372
|
}, /*#__PURE__*/_react["default"].createElement(FileInputContainer, {
|
|
372
373
|
margin: margin,
|
|
373
|
-
name: name,
|
|
374
374
|
ref: ref
|
|
375
375
|
}, /*#__PURE__*/_react["default"].createElement(Label, {
|
|
376
376
|
htmlFor: fileInputId,
|
|
@@ -385,10 +385,8 @@ var DxcFileInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
385
385
|
accept: accept,
|
|
386
386
|
multiple: multiple,
|
|
387
387
|
onChange: selectFiles,
|
|
388
|
-
name: name,
|
|
389
388
|
disabled: disabled,
|
|
390
|
-
readOnly: true
|
|
391
|
-
"aria-hidden": "true"
|
|
389
|
+
readOnly: true
|
|
392
390
|
}), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
393
391
|
mode: "secondary",
|
|
394
392
|
label: buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel : multiple ? translatedLabels.fileInput.multipleButtonLabelDefault : translatedLabels.fileInput.singleButtonLabelDefault,
|
|
@@ -414,10 +412,8 @@ var DxcFileInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
414
412
|
accept: accept,
|
|
415
413
|
multiple: multiple,
|
|
416
414
|
onChange: selectFiles,
|
|
417
|
-
name: name,
|
|
418
415
|
disabled: disabled,
|
|
419
|
-
readOnly: true
|
|
420
|
-
"aria-hidden": "true"
|
|
416
|
+
readOnly: true
|
|
421
417
|
}), /*#__PURE__*/_react["default"].createElement(DragDropArea, {
|
|
422
418
|
isDragging: isDragging,
|
|
423
419
|
disabled: disabled,
|
|
@@ -3,13 +3,14 @@ import DxcFileInput from "./FileInput";
|
|
|
3
3
|
import Title from "../../.storybook/components/Title";
|
|
4
4
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
5
|
import FileItem from "./FileItem";
|
|
6
|
+
import { HalstackProvider } from "../HalstackContext";
|
|
6
7
|
|
|
7
8
|
export default {
|
|
8
9
|
title: "File input",
|
|
9
10
|
component: DxcFileInput,
|
|
10
11
|
};
|
|
11
12
|
|
|
12
|
-
const picPreview = "https://cdn.mos.cms.futurecdn.net/CAZ6JXi6huSuN4QGE627NR.jpg"
|
|
13
|
+
const picPreview = "https://cdn.mos.cms.futurecdn.net/CAZ6JXi6huSuN4QGE627NR.jpg";
|
|
13
14
|
|
|
14
15
|
const file1 = new File(["file1"], "file.pdf", { type: "text/plain" });
|
|
15
16
|
const file2 = new File(["file2"], "file2.mp3", {
|
|
@@ -63,6 +64,12 @@ const filesExamples = [
|
|
|
63
64
|
},
|
|
64
65
|
];
|
|
65
66
|
|
|
67
|
+
const opinionatedTheme = {
|
|
68
|
+
fileInput: {
|
|
69
|
+
fontColor: "#000000",
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
|
|
66
73
|
export const Chromatic = () => (
|
|
67
74
|
<>
|
|
68
75
|
<Title title="File item states" theme="light" level={2} />
|
|
@@ -529,7 +536,83 @@ export const Chromatic = () => (
|
|
|
529
536
|
mode="dropzone"
|
|
530
537
|
margin="xxlarge"
|
|
531
538
|
/>
|
|
532
|
-
|
|
539
|
+
</ExampleContainer>
|
|
540
|
+
<Title title="Opinionated theme" theme="light" level={2} />
|
|
541
|
+
<ExampleContainer>
|
|
542
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
543
|
+
<Title title="Single file" theme="light" level={4} />
|
|
544
|
+
<DxcFileInput
|
|
545
|
+
label="File input"
|
|
546
|
+
helperText="Please select files"
|
|
547
|
+
value={fileExample}
|
|
548
|
+
multiple={false}
|
|
549
|
+
callbackFile={() => {}}
|
|
550
|
+
/>
|
|
551
|
+
</HalstackProvider>
|
|
552
|
+
</ExampleContainer>
|
|
553
|
+
<ExampleContainer>
|
|
554
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
555
|
+
<Title title="Invalid single file" theme="light" level={4} />
|
|
556
|
+
<DxcFileInput
|
|
557
|
+
label="File input"
|
|
558
|
+
helperText="Please select files"
|
|
559
|
+
value={fileExampleError}
|
|
560
|
+
multiple={false}
|
|
561
|
+
callbackFile={() => {}}
|
|
562
|
+
/>
|
|
563
|
+
</HalstackProvider>
|
|
564
|
+
</ExampleContainer>
|
|
565
|
+
<ExampleContainer>
|
|
566
|
+
<Title title="Single file" theme="light" level={4} />
|
|
567
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
568
|
+
<DxcFileInput
|
|
569
|
+
mode="filedrop"
|
|
570
|
+
label="File input"
|
|
571
|
+
helperText="Please select files"
|
|
572
|
+
value={fileExample}
|
|
573
|
+
multiple={false}
|
|
574
|
+
callbackFile={() => {}}
|
|
575
|
+
/>
|
|
576
|
+
</HalstackProvider>
|
|
577
|
+
</ExampleContainer>
|
|
578
|
+
<ExampleContainer>
|
|
579
|
+
<Title title="Invalid single file" theme="light" level={4} />
|
|
580
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
581
|
+
<DxcFileInput
|
|
582
|
+
mode="filedrop"
|
|
583
|
+
label="File input"
|
|
584
|
+
helperText="Please select files"
|
|
585
|
+
value={fileExampleError}
|
|
586
|
+
multiple={false}
|
|
587
|
+
callbackFile={() => {}}
|
|
588
|
+
/>
|
|
589
|
+
</HalstackProvider>
|
|
590
|
+
</ExampleContainer>
|
|
591
|
+
<ExampleContainer>
|
|
592
|
+
<Title title="Single file" theme="light" level={4} />
|
|
593
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
594
|
+
<DxcFileInput
|
|
595
|
+
label="File input"
|
|
596
|
+
helperText="Please select files"
|
|
597
|
+
mode="dropzone"
|
|
598
|
+
value={fileExample}
|
|
599
|
+
callbackFile={() => {}}
|
|
600
|
+
multiple={false}
|
|
601
|
+
/>
|
|
602
|
+
</HalstackProvider>
|
|
603
|
+
</ExampleContainer>
|
|
604
|
+
<ExampleContainer>
|
|
605
|
+
<Title title="Invalid single file" theme="light" level={4} />{" "}
|
|
606
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
607
|
+
<DxcFileInput
|
|
608
|
+
label="File input"
|
|
609
|
+
helperText="Please select files"
|
|
610
|
+
mode="dropzone"
|
|
611
|
+
value={fileExampleError}
|
|
612
|
+
callbackFile={() => {}}
|
|
613
|
+
multiple={false}
|
|
614
|
+
/>
|
|
615
|
+
</HalstackProvider>
|
|
533
616
|
</ExampleContainer>
|
|
534
617
|
</>
|
|
535
618
|
);
|