@dxc-technology/halstack-react 8.0.0 → 9.0.0
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/HalstackContext.js +94 -45
- package/accordion/Accordion.js +7 -13
- package/accordion/Accordion.stories.tsx +102 -13
- package/alert/Alert.stories.tsx +28 -0
- package/box/Box.js +1 -3
- package/box/Box.stories.tsx +15 -0
- package/button/Button.js +11 -13
- package/button/Button.stories.tsx +150 -8
- package/checkbox/Checkbox.stories.tsx +52 -0
- package/chip/Chip.js +16 -22
- package/chip/Chip.stories.tsx +96 -9
- package/common/variables.js +280 -288
- package/date-input/Calendar.d.ts +1 -1
- package/date-input/Calendar.js +43 -43
- package/date-input/DateInput.js +74 -32
- package/date-input/DateInput.stories.tsx +183 -30
- package/date-input/DateInput.test.js +120 -37
- package/date-input/DatePicker.js +38 -52
- package/date-input/Icons.d.ts +6 -0
- package/date-input/Icons.js +75 -0
- package/date-input/YearPicker.d.ts +1 -1
- package/date-input/YearPicker.js +23 -12
- package/date-input/types.d.ts +6 -8
- package/dialog/Dialog.js +60 -73
- package/dialog/Dialog.stories.tsx +211 -159
- package/dialog/Dialog.test.js +301 -2
- package/dropdown/Dropdown.js +3 -6
- package/dropdown/Dropdown.stories.tsx +210 -84
- package/dropdown/DropdownMenu.js +8 -18
- package/dropdown/DropdownMenuItem.js +4 -15
- package/file-input/FileInput.js +3 -6
- package/file-input/FileInput.stories.tsx +85 -2
- package/file-input/FileInput.test.js +0 -41
- package/file-input/FileItem.js +1 -0
- package/footer/Footer.stories.tsx +91 -0
- package/header/Header.js +18 -20
- package/header/Header.stories.tsx +149 -6
- package/link/Link.stories.tsx +60 -0
- package/main.d.ts +1 -1
- package/main.js +1 -1
- package/{tabs-nav → nav-tabs}/NavTabs.js +1 -1
- package/{tabs-nav → nav-tabs}/NavTabs.stories.tsx +96 -6
- package/{tabs-nav → nav-tabs}/Tab.js +35 -15
- package/package.json +1 -1
- package/paginator/Icons.d.ts +5 -0
- package/paginator/Icons.js +16 -28
- package/paginator/Paginator.js +5 -11
- package/paginator/Paginator.stories.tsx +24 -0
- package/paginator/Paginator.test.js +17 -10
- package/progress-bar/ProgressBar.js +4 -4
- package/progress-bar/ProgressBar.stories.jsx +35 -2
- package/quick-nav/QuickNav.stories.tsx +14 -0
- package/radio-group/RadioGroup.stories.tsx +131 -18
- package/resultsetTable/ResultsetTable.test.js +17 -22
- package/select/Listbox.d.ts +1 -1
- package/select/Listbox.js +5 -34
- package/select/Option.js +11 -24
- package/select/Select.js +43 -24
- package/select/Select.stories.tsx +492 -145
- package/select/Select.test.js +17 -22
- package/select/types.d.ts +2 -2
- package/sidenav/Sidenav.js +8 -10
- package/sidenav/Sidenav.stories.tsx +148 -46
- package/slider/Slider.js +4 -4
- package/slider/Slider.stories.tsx +57 -0
- package/spinner/Spinner.js +2 -2
- package/spinner/Spinner.stories.jsx +27 -1
- package/switch/Switch.js +1 -1
- package/switch/Switch.stories.tsx +33 -0
- package/table/Table.stories.jsx +80 -1
- package/tabs/Tab.js +3 -5
- package/tabs/Tabs.js +3 -3
- package/tabs/Tabs.stories.tsx +45 -5
- package/tag/Tag.stories.tsx +14 -1
- package/text-input/Suggestion.js +32 -5
- package/text-input/TextInput.js +7 -11
- package/text-input/TextInput.stories.tsx +92 -4
- package/text-input/TextInput.test.js +125 -25
- package/textarea/Textarea.stories.jsx +60 -1
- package/toggle-group/ToggleGroup.stories.tsx +42 -0
- package/utils/FocusLock.d.ts +13 -0
- package/utils/FocusLock.js +139 -0
- package/wizard/Wizard.stories.tsx +20 -0
- /package/{tabs-nav → nav-tabs}/NavTabs.d.ts +0 -0
- /package/{tabs-nav → nav-tabs}/NavTabs.test.js +0 -0
- /package/{tabs-nav → nav-tabs}/Tab.d.ts +0 -0
- /package/{tabs-nav → nav-tabs}/types.d.ts +0 -0
- /package/{tabs-nav → nav-tabs}/types.js +0 -0
|
@@ -4,12 +4,20 @@ import { BackgroundColorProvider } from "../BackgroundColorContext";
|
|
|
4
4
|
import Title from "../../.storybook/components/Title";
|
|
5
5
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
6
6
|
import DarkContainer from "../../.storybook/components/DarkSection";
|
|
7
|
+
import { HalstackProvider } from "../HalstackContext";
|
|
7
8
|
|
|
8
9
|
export default {
|
|
9
10
|
title: "Switch",
|
|
10
11
|
component: DxcSwitch,
|
|
11
12
|
};
|
|
12
13
|
|
|
14
|
+
const opinionatedTheme = {
|
|
15
|
+
switch: {
|
|
16
|
+
checkedBaseColor: "#5f249f",
|
|
17
|
+
fontColor: "#000000",
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
13
21
|
export const Chromatic = () => (
|
|
14
22
|
<>
|
|
15
23
|
<ExampleContainer>
|
|
@@ -134,5 +142,30 @@ export const Chromatic = () => (
|
|
|
134
142
|
<Title title="FitContent size" theme="light" level={4} />
|
|
135
143
|
<DxcSwitch label="FitContent" size="fitContent" />
|
|
136
144
|
</ExampleContainer>
|
|
145
|
+
<Title title="Opinionated theme" theme="light" level={2} />
|
|
146
|
+
<ExampleContainer>
|
|
147
|
+
<Title title="Checked" theme="light" level={4} />
|
|
148
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
149
|
+
<DxcSwitch label="Switch" defaultChecked />
|
|
150
|
+
</HalstackProvider>
|
|
151
|
+
</ExampleContainer>
|
|
152
|
+
<ExampleContainer>
|
|
153
|
+
<Title title="Default" theme="light" level={4} />
|
|
154
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
155
|
+
<DxcSwitch label="Switch" />
|
|
156
|
+
</HalstackProvider>
|
|
157
|
+
</ExampleContainer>
|
|
158
|
+
<ExampleContainer>
|
|
159
|
+
<Title title="Disabled" theme="light" level={4} />
|
|
160
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
161
|
+
<DxcSwitch label="Switch" disabled />
|
|
162
|
+
</HalstackProvider>
|
|
163
|
+
</ExampleContainer>
|
|
164
|
+
<ExampleContainer>
|
|
165
|
+
<Title title="Disabled checked" theme="light" level={4} />
|
|
166
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
167
|
+
<DxcSwitch label="Switch" disabled defaultChecked />
|
|
168
|
+
</HalstackProvider>
|
|
169
|
+
</ExampleContainer>
|
|
137
170
|
</>
|
|
138
171
|
);
|
package/table/Table.stories.jsx
CHANGED
|
@@ -2,12 +2,21 @@ import React from "react";
|
|
|
2
2
|
import DxcTable from "./Table";
|
|
3
3
|
import Title from "../../.storybook/components/Title";
|
|
4
4
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
|
+
import { HalstackProvider } from "../HalstackContext";
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
title: "Table",
|
|
8
9
|
component: DxcTable,
|
|
9
10
|
};
|
|
10
11
|
|
|
12
|
+
const opinionatedTheme = {
|
|
13
|
+
table: {
|
|
14
|
+
baseColor: "#5f249f",
|
|
15
|
+
headerFontColor: "#ffffff",
|
|
16
|
+
cellFontColor: "#000000",
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
11
20
|
export const Chromatic = () => (
|
|
12
21
|
<>
|
|
13
22
|
<ExampleContainer>
|
|
@@ -271,7 +280,77 @@ export const Chromatic = () => (
|
|
|
271
280
|
<td>Cell 9</td>
|
|
272
281
|
</tr>
|
|
273
282
|
</DxcTable>
|
|
274
|
-
|
|
283
|
+
</ExampleContainer>
|
|
284
|
+
<Title title="Opinionated theme" theme="light" level={2} />
|
|
285
|
+
<ExampleContainer>
|
|
286
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
287
|
+
<DxcTable>
|
|
288
|
+
<tr>
|
|
289
|
+
<th>
|
|
290
|
+
header<br></br>subheader
|
|
291
|
+
</th>
|
|
292
|
+
<th>
|
|
293
|
+
header<br></br>subheader
|
|
294
|
+
</th>
|
|
295
|
+
<th>
|
|
296
|
+
header<br></br>subheader
|
|
297
|
+
</th>
|
|
298
|
+
</tr>
|
|
299
|
+
<tr>
|
|
300
|
+
<td>
|
|
301
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
|
302
|
+
dolore magna aliqua.
|
|
303
|
+
</td>
|
|
304
|
+
<td>
|
|
305
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
306
|
+
consequat.
|
|
307
|
+
</td>
|
|
308
|
+
<td>
|
|
309
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
310
|
+
</td>
|
|
311
|
+
</tr>
|
|
312
|
+
<tr>
|
|
313
|
+
<td>cell data</td>
|
|
314
|
+
<td>cell data</td>
|
|
315
|
+
<td>cell data</td>
|
|
316
|
+
</tr>
|
|
317
|
+
<tr>
|
|
318
|
+
<td>cell data</td>
|
|
319
|
+
<td>cell data</td>
|
|
320
|
+
<td>cell data</td>
|
|
321
|
+
</tr>
|
|
322
|
+
<tr>
|
|
323
|
+
<td>cell data</td>
|
|
324
|
+
<td>cell data</td>
|
|
325
|
+
<td>cell data</td>
|
|
326
|
+
</tr>
|
|
327
|
+
<tr>
|
|
328
|
+
<td>cell data</td>
|
|
329
|
+
<td>cell data</td>
|
|
330
|
+
<td>cell data</td>
|
|
331
|
+
</tr>
|
|
332
|
+
<tr>
|
|
333
|
+
<td>cell data</td>
|
|
334
|
+
<td>cell data</td>
|
|
335
|
+
<td>cell data</td>
|
|
336
|
+
</tr>
|
|
337
|
+
<tr>
|
|
338
|
+
<td>cell data</td>
|
|
339
|
+
<td>cell data</td>
|
|
340
|
+
<td>cell data</td>
|
|
341
|
+
</tr>
|
|
342
|
+
<tr>
|
|
343
|
+
<td>cell data</td>
|
|
344
|
+
<td>cell data</td>
|
|
345
|
+
<td>cell data</td>
|
|
346
|
+
</tr>
|
|
347
|
+
<tr>
|
|
348
|
+
<td>cell data</td>
|
|
349
|
+
<td>cell data</td>
|
|
350
|
+
<td>cell data</td>
|
|
351
|
+
</tr>
|
|
352
|
+
</DxcTable>
|
|
353
|
+
</HalstackProvider>
|
|
275
354
|
</ExampleContainer>
|
|
276
355
|
</>
|
|
277
356
|
);
|
package/tabs/Tab.js
CHANGED
|
@@ -21,7 +21,7 @@ var _Typography = _interopRequireDefault(require("../typography/Typography"));
|
|
|
21
21
|
|
|
22
22
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
23
23
|
|
|
24
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4
|
|
24
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
25
25
|
|
|
26
26
|
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); }
|
|
27
27
|
|
|
@@ -63,7 +63,7 @@ var Tab = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
63
63
|
}, tab.icon && /*#__PURE__*/_react["default"].createElement(TabIconContainer, {
|
|
64
64
|
hasLabelAndIcon: hasLabelAndIcon,
|
|
65
65
|
iconPosition: iconPosition
|
|
66
|
-
}, typeof tab.icon === "string" ? /*#__PURE__*/_react["default"].createElement(
|
|
66
|
+
}, typeof tab.icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
67
67
|
src: tab.icon
|
|
68
68
|
}) : tab.icon), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
69
69
|
color: tab.isDisabled ? colorsTheme.tabs.disabledFontColor : active ? colorsTheme.tabs.selectedFontColor : colorsTheme.tabs.unselectedFontColor,
|
|
@@ -122,14 +122,12 @@ var MainLabelContainer = _styledComponents["default"].div(_templateObject3 || (_
|
|
|
122
122
|
return props.hasBadge ? typeof props.hasBadge === "number" ? "calc(".concat(props.theme.badgeWidthWithNotificationNumber, " + 12px)") : "calc(".concat(props.theme.badgeWidth, " + 12px)") : "unset";
|
|
123
123
|
});
|
|
124
124
|
|
|
125
|
-
var TabIconContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
125
|
+
var TabIconContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n margin-bottom: ", ";\n margin-right: ", ";\n\n img,\n svg {\n height: 22px;\n width: 22px;\n }\n"])), function (props) {
|
|
126
126
|
return props.hasLabelAndIcon && props.iconPosition === "top" && "8px" || "";
|
|
127
127
|
}, function (props) {
|
|
128
128
|
return props.hasLabelAndIcon && props.iconPosition === "left" && "12px" || "";
|
|
129
129
|
});
|
|
130
130
|
|
|
131
|
-
var TabIcon = _styledComponents["default"].img(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\n display: inline-flex;\n align-items: center;\n flex-direction: column;\n justify-content: center;\n"])));
|
|
132
|
-
|
|
133
131
|
var _default = /*#__PURE__*/_react["default"].memo(Tab);
|
|
134
132
|
|
|
135
133
|
exports["default"] = _default;
|
package/tabs/Tabs.js
CHANGED
|
@@ -395,7 +395,7 @@ var DxcTabs = function DxcTabs(_ref) {
|
|
|
395
395
|
}, arrowIcons.right))));
|
|
396
396
|
};
|
|
397
397
|
|
|
398
|
-
var Underline = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n left: 0;\n bottom: 0;\n width: 100%;\n position: absolute;\n height: ", ";\n background-color: ", ";\n
|
|
398
|
+
var Underline = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n left: 0;\n bottom: 0;\n width: 100%;\n position: absolute;\n height: ", ";\n background-color: ", ";\n"])), function (props) {
|
|
399
399
|
return props.theme.dividerThickness;
|
|
400
400
|
}, function (props) {
|
|
401
401
|
return props.theme.dividerColor;
|
|
@@ -441,7 +441,7 @@ var ScrollIndicator = _styledComponents["default"].button(_templateObject4 || (_
|
|
|
441
441
|
return props.theme.unselectedFontColor;
|
|
442
442
|
});
|
|
443
443
|
|
|
444
|
-
var ActiveIndicator = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n left: ", ";\n width: ", ";\n
|
|
444
|
+
var ActiveIndicator = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n left: ", ";\n width: ", ";\n background-color: ", ";\n bottom: 0;\n height: ", ";\n position: absolute;\n &[aria-disabled=\"true\"] {\n background-color: ", ";\n display: none;\n }\n"])), function (props) {
|
|
445
445
|
return "".concat(props.tabLeft, "px");
|
|
446
446
|
}, function (props) {
|
|
447
447
|
return "".concat(props.tabWidth, "px");
|
|
@@ -453,7 +453,7 @@ var ActiveIndicator = _styledComponents["default"].span(_templateObject5 || (_te
|
|
|
453
453
|
return props.theme.disabledFontColor;
|
|
454
454
|
});
|
|
455
455
|
|
|
456
|
-
var TabsContent = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n
|
|
456
|
+
var TabsContent = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex: 1 1 auto;\n display: inline-block;\n position: relative;\n white-space: nowrap;\n overflow-x: scroll;\n ::-webkit-scrollbar {\n display: none;\n }\n"])));
|
|
457
457
|
|
|
458
458
|
var TabList = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n min-height: ", "px;\n"])), function (props) {
|
|
459
459
|
return props.minHeightTabs;
|
package/tabs/Tabs.stories.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import DxcTabs from "./Tabs";
|
|
3
3
|
import Title from "../../.storybook/components/Title";
|
|
4
4
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
|
+
import { HalstackProvider } from "../HalstackContext";
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
title: "Tabs",
|
|
@@ -9,9 +10,8 @@ export default {
|
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
const iconSVG = (
|
|
12
|
-
<svg viewBox="0 0
|
|
13
|
-
<path d="
|
|
14
|
-
<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />
|
|
13
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" height="20" width="20" fill="currentColor">
|
|
14
|
+
<path d="m10 17-1.042-.938q-2.083-1.854-3.437-3.177-1.354-1.323-2.136-2.354Q2.604 9.5 2.302 8.646 2 7.792 2 6.896q0-1.854 1.271-3.125T6.396 2.5q1.021 0 1.979.438.958.437 1.625 1.229.667-.792 1.625-1.229.958-.438 1.979-.438 1.854 0 3.125 1.271T18 6.896q0 .896-.292 1.729-.291.833-1.073 1.854-.781 1.021-2.145 2.365-1.365 1.344-3.49 3.26Zm0-2.021q1.938-1.729 3.188-2.948 1.25-1.219 1.989-2.125.74-.906 1.031-1.614.292-.709.292-1.396 0-1.229-.833-2.063Q14.833 4 13.604 4q-.729 0-1.364.302-.636.302-1.094.844L10.417 6h-.834l-.729-.854q-.458-.542-1.114-.844Q7.083 4 6.396 4q-1.229 0-2.063.833-.833.834-.833 2.063 0 .687.271 1.364.271.678.989 1.573.719.896 1.98 2.125Q8 13.188 10 14.979Zm0-5.5Z" />
|
|
15
15
|
</svg>
|
|
16
16
|
);
|
|
17
17
|
|
|
@@ -74,10 +74,20 @@ const tabsNotification = tabs.map((tab, index) => ({
|
|
|
74
74
|
notificationNumber: (index === 0 && true) || (index === 1 && 5) || (index === 2 && 200),
|
|
75
75
|
}));
|
|
76
76
|
|
|
77
|
-
const tabsIcon = tabs.map((tab) =>
|
|
77
|
+
const tabsIcon = tabs.map((tab, index) =>
|
|
78
|
+
index <= tabs.length / 2
|
|
79
|
+
? { ...tab, icon: "https://cdn-icons-png.flaticon.com/512/5039/5039041.png" }
|
|
80
|
+
: { ...tab, icon: iconSVG }
|
|
81
|
+
);
|
|
78
82
|
|
|
79
83
|
const tabsNotificationIcon = tabsNotification.map((tab) => ({ ...tab, icon: iconSVG }));
|
|
80
84
|
|
|
85
|
+
const opinionatedTheme = {
|
|
86
|
+
tabs: {
|
|
87
|
+
baseColor: "#5f249f",
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
|
|
81
91
|
export const Chromatic = () => (
|
|
82
92
|
<>
|
|
83
93
|
<ExampleContainer>
|
|
@@ -152,7 +162,37 @@ export const Chromatic = () => (
|
|
|
152
162
|
<ExampleContainer>
|
|
153
163
|
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
154
164
|
<DxcTabs tabs={tabs} margin="xxlarge" />
|
|
155
|
-
|
|
165
|
+
</ExampleContainer>
|
|
166
|
+
<Title title="Opinionated theme" theme="light" level={2} />
|
|
167
|
+
<ExampleContainer>
|
|
168
|
+
<Title title="With icon and notification" theme="light" level={4} />
|
|
169
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
170
|
+
<DxcTabs tabs={tabsNotificationIcon} />
|
|
171
|
+
</HalstackProvider>
|
|
172
|
+
</ExampleContainer>
|
|
173
|
+
<ExampleContainer>
|
|
174
|
+
<Title title="Disabled" theme="light" level={4} />
|
|
175
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
176
|
+
<DxcTabs activeTabIndex={0} tabs={disabledTabs} />
|
|
177
|
+
</HalstackProvider>
|
|
178
|
+
</ExampleContainer>
|
|
179
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
180
|
+
<Title title="Hovered" theme="light" level={4} />
|
|
181
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
182
|
+
<DxcTabs tabs={tabs} />
|
|
183
|
+
</HalstackProvider>
|
|
184
|
+
</ExampleContainer>
|
|
185
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
186
|
+
<Title title="Focused" theme="light" level={4} />
|
|
187
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
188
|
+
<DxcTabs tabs={tabs} />
|
|
189
|
+
</HalstackProvider>
|
|
190
|
+
</ExampleContainer>
|
|
191
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
192
|
+
<Title title="Actived" theme="light" level={4} />
|
|
193
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
194
|
+
<DxcTabs tabs={tabs} />
|
|
195
|
+
</HalstackProvider>
|
|
156
196
|
</ExampleContainer>
|
|
157
197
|
</>
|
|
158
198
|
);
|
package/tag/Tag.stories.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { userEvent, within } from "@storybook/testing-library";
|
|
|
3
3
|
import Title from "../../.storybook/components/Title";
|
|
4
4
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
5
|
import DxcTag from "./Tag";
|
|
6
|
+
import { HalstackProvider } from "../HalstackContext";
|
|
6
7
|
|
|
7
8
|
export default {
|
|
8
9
|
title: "Tag",
|
|
@@ -23,6 +24,13 @@ const largeIcon = (
|
|
|
23
24
|
</svg>
|
|
24
25
|
);
|
|
25
26
|
|
|
27
|
+
const opinionatedTheme = {
|
|
28
|
+
tag: {
|
|
29
|
+
fontColor: "#000000",
|
|
30
|
+
iconColor: "#ffffff",
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
26
34
|
export const Chromatic = () => (
|
|
27
35
|
<>
|
|
28
36
|
<ExampleContainer>
|
|
@@ -124,7 +132,12 @@ export const Chromatic = () => (
|
|
|
124
132
|
<Title title="FitContent size" theme="light" level={4} />
|
|
125
133
|
<DxcTag label="FitContent" size="fitContent" icon={icon} />
|
|
126
134
|
</ExampleContainer>
|
|
127
|
-
<
|
|
135
|
+
<Title title="Opinionated theme" theme="light" level={2} />
|
|
136
|
+
<ExampleContainer>
|
|
137
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
138
|
+
<DxcTag label="Tag" icon={icon} />
|
|
139
|
+
</HalstackProvider>
|
|
140
|
+
</ExampleContainer>
|
|
128
141
|
</>
|
|
129
142
|
);
|
|
130
143
|
|
package/text-input/Suggestion.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
@@ -9,12 +11,33 @@ exports["default"] = void 0;
|
|
|
9
11
|
|
|
10
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
13
|
|
|
12
|
-
var _react =
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
15
|
|
|
14
16
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
17
|
|
|
16
18
|
var _templateObject, _templateObject2;
|
|
17
19
|
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
var transformSpecialChars = function transformSpecialChars(str) {
|
|
25
|
+
var specialCharsRegex = /[\\*()\[\]{}+?/]/;
|
|
26
|
+
var value = str;
|
|
27
|
+
|
|
28
|
+
if (specialCharsRegex.test(value)) {
|
|
29
|
+
var regexAsString = specialCharsRegex.toString().split("");
|
|
30
|
+
var uniqueSpecialChars = regexAsString.filter(function (item, index) {
|
|
31
|
+
return regexAsString.indexOf(item) === index;
|
|
32
|
+
});
|
|
33
|
+
uniqueSpecialChars.forEach(function (specialChar) {
|
|
34
|
+
if (str.includes(specialChar)) value = value.replace(specialChar, "\\" + specialChar);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return value;
|
|
39
|
+
};
|
|
40
|
+
|
|
18
41
|
var Suggestion = function Suggestion(_ref) {
|
|
19
42
|
var id = _ref.id,
|
|
20
43
|
value = _ref.value,
|
|
@@ -23,9 +46,13 @@ var Suggestion = function Suggestion(_ref) {
|
|
|
23
46
|
isLast = _ref.isLast,
|
|
24
47
|
visuallyFocused = _ref.visuallyFocused,
|
|
25
48
|
highlighted = _ref.highlighted;
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
49
|
+
var matchedSuggestion = (0, _react.useMemo)(function () {
|
|
50
|
+
var regEx = new RegExp(transformSpecialChars(value), "i");
|
|
51
|
+
return {
|
|
52
|
+
matchedWords: suggestion.match(regEx),
|
|
53
|
+
noMatchedWords: suggestion.replace(regEx, "")
|
|
54
|
+
};
|
|
55
|
+
}, [value, suggestion]);
|
|
29
56
|
return /*#__PURE__*/_react["default"].createElement(SuggestionContainer, {
|
|
30
57
|
id: id,
|
|
31
58
|
onClick: function onClick() {
|
|
@@ -37,7 +64,7 @@ var Suggestion = function Suggestion(_ref) {
|
|
|
37
64
|
}, /*#__PURE__*/_react["default"].createElement(StyledSuggestion, {
|
|
38
65
|
last: isLast,
|
|
39
66
|
visuallyFocused: visuallyFocused
|
|
40
|
-
}, highlighted ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("strong", null, matchedWords), noMatchedWords) : suggestion));
|
|
67
|
+
}, highlighted ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("strong", null, matchedSuggestion.matchedWords), matchedSuggestion.noMatchedWords) : suggestion));
|
|
41
68
|
};
|
|
42
69
|
|
|
43
70
|
var SuggestionContainer = _styledComponents["default"].li(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0 0.5rem;\n line-height: 1.715em;\n cursor: pointer;\n box-shadow: inset 0 0 0 2px\n ", ";\n\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n"])), function (props) {
|
package/text-input/TextInput.js
CHANGED
|
@@ -39,7 +39,7 @@ var _Icons = _interopRequireDefault(require("./Icons"));
|
|
|
39
39
|
|
|
40
40
|
var _uuid = require("uuid");
|
|
41
41
|
|
|
42
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11
|
|
42
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
43
43
|
|
|
44
44
|
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); }
|
|
45
45
|
|
|
@@ -547,7 +547,7 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref2, re
|
|
|
547
547
|
backgroundType: backgroundType,
|
|
548
548
|
tabIndex: tabIndex,
|
|
549
549
|
type: "button"
|
|
550
|
-
}, typeof action.icon === "string" ? /*#__PURE__*/_react["default"].createElement(
|
|
550
|
+
}, typeof action.icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
551
551
|
src: action.icon
|
|
552
552
|
}) : action.icon), suffix && /*#__PURE__*/_react["default"].createElement(Suffix, {
|
|
553
553
|
disabled: disabled,
|
|
@@ -635,11 +635,7 @@ var Input = _styledComponents["default"].input(_templateObject6 || (_templateObj
|
|
|
635
635
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPlaceholderFontColorOnDark : props.theme.disabledPlaceholderFontColor : props.backgroundType === "dark" ? props.theme.placeholderFontColorOnDark : props.theme.placeholderFontColor;
|
|
636
636
|
});
|
|
637
637
|
|
|
638
|
-
var
|
|
639
|
-
|
|
640
|
-
var Action = _styledComponents["default"].button(_templateObject8 || (_templateObject8 = (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: 2px;\n padding: 3px;\n margin-left: 0.25rem;\n ", "\n\n box-shadow: 0 0 0 2px transparent;\n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n svg {\n line-height: 18px;\n }\n"])), function (props) {
|
|
641
|
-
return props.theme.fontFamily;
|
|
642
|
-
}, function (props) {
|
|
638
|
+
var Action = _styledComponents["default"].button(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n border: 1px solid transparent;\n border-radius: 2px;\n width: 24px;\n height: 24px;\n padding: 3px;\n margin-left: 0.25rem;\n ", "\n\n box-shadow: 0 0 0 2px transparent;\n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n img, svg {\n width: 16px;\n height: 16px;\n }\n"])), function (props) {
|
|
643
639
|
return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
|
|
644
640
|
}, function (props) {
|
|
645
641
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionBackgroundColorOnDark : props.theme.disabledActionBackgroundColor : props.backgroundType === "dark" ? props.theme.actionBackgroundColorOnDark : props.theme.actionBackgroundColor;
|
|
@@ -649,25 +645,25 @@ var Action = _styledComponents["default"].button(_templateObject8 || (_templateO
|
|
|
649
645
|
return !props.disabled && "\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ".concat(props.backgroundType === "dark" ? props.theme.focusActionBorderColorOnDark : props.theme.focusActionBorderColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.focusActionIconColorOnDark : props.theme.focusActionIconColor, ";\n }\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px ").concat(props.backgroundType === "dark" ? props.theme.focusActionBorderColorOnDark : props.theme.focusActionBorderColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.focusActionIconColorOnDark : props.theme.focusActionIconColor, ";\n }\n &:hover {\n background-color: ").concat(props.backgroundType === "dark" ? props.theme.hoverActionBackgroundColorOnDark : props.theme.hoverActionBackgroundColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.hoverActionIconColorOnDark : props.theme.hoverActionIconColor, ";\n }\n &:active {\n background-color: ").concat(props.backgroundType === "dark" ? props.theme.activeActionBackgroundColorOnDark : props.theme.activeActionBackgroundColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.activeActionIconColorOnDark : props.theme.activeActionIconColor, ";\n }\n ");
|
|
650
646
|
});
|
|
651
647
|
|
|
652
|
-
var Prefix = _styledComponents["default"].span(
|
|
648
|
+
var Prefix = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n line-height: 1.5rem;\n margin-left: 0.25rem;\n padding: 0 0.5rem 0 0;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"])), function (props) {
|
|
653
649
|
var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPrefixColorOnDark : props.theme.disabledPrefixColor : props.backgroundType === "dark" ? props.theme.prefixColorOnDark : props.theme.prefixColor;
|
|
654
650
|
return "color: ".concat(color, "; border-right: 1px solid ").concat(color, ";");
|
|
655
651
|
}, function (props) {
|
|
656
652
|
return props.theme.fontFamily;
|
|
657
653
|
});
|
|
658
654
|
|
|
659
|
-
var Suffix = _styledComponents["default"].span(
|
|
655
|
+
var Suffix = _styledComponents["default"].span(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n line-height: 1.5rem;\n margin: 0 0.25rem;\n padding: 0 0 0 0.5rem;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"])), function (props) {
|
|
660
656
|
var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledSuffixColorOnDark : props.theme.disabledSuffixColor : props.backgroundType === "dark" ? props.theme.suffixColorOnDark : props.theme.suffixColor;
|
|
661
657
|
return "color: ".concat(color, "; border-left: 1px solid ").concat(color, ";");
|
|
662
658
|
}, function (props) {
|
|
663
659
|
return props.theme.fontFamily;
|
|
664
660
|
});
|
|
665
661
|
|
|
666
|
-
var ErrorIcon = _styledComponents["default"].span(
|
|
662
|
+
var ErrorIcon = _styledComponents["default"].span(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n padding: 3px;\n height: 18px;\n width: 18px;\n margin-left: 0.25rem;\n color: ", ";\n\n svg {\n line-height: 18px;\n font-size: 1.25rem;\n }\n"])), function (props) {
|
|
667
663
|
return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
|
|
668
664
|
});
|
|
669
665
|
|
|
670
|
-
var Error = _styledComponents["default"].span(
|
|
666
|
+
var Error = _styledComponents["default"].span(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n min-height: 1.5em;\n color: ", ";\n font-family: ", ";\n font-size: 0.75rem;\n font-weight: 400;\n line-height: 1.5em;\n margin-top: 0.25rem;\n"])), function (props) {
|
|
671
667
|
return props.backgroundType === "dark" ? props.theme.errorMessageColorOnDark : props.theme.errorMessageColor;
|
|
672
668
|
}, function (props) {
|
|
673
669
|
return props.theme.fontFamily;
|
|
@@ -11,6 +11,7 @@ import DxcFlex from "../flex/Flex";
|
|
|
11
11
|
import Suggestions from "./Suggestions";
|
|
12
12
|
import { ThemeProvider } from "styled-components";
|
|
13
13
|
import useTheme from "../useTheme";
|
|
14
|
+
import { HalstackProvider } from "../HalstackContext";
|
|
14
15
|
|
|
15
16
|
export default {
|
|
16
17
|
title: "Text input",
|
|
@@ -27,7 +28,7 @@ const action = {
|
|
|
27
28
|
),
|
|
28
29
|
};
|
|
29
30
|
|
|
30
|
-
const
|
|
31
|
+
const actionLargeIconSVG = {
|
|
31
32
|
onClick: () => {},
|
|
32
33
|
icon: (
|
|
33
34
|
<svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 0 24 24" width="48px" fill="currentColor">
|
|
@@ -37,6 +38,11 @@ const actionLargeIcon = {
|
|
|
37
38
|
),
|
|
38
39
|
};
|
|
39
40
|
|
|
41
|
+
const actionLargeIconURL = {
|
|
42
|
+
onClick: () => {},
|
|
43
|
+
icon: "https://iconape.com/wp-content/files/yd/367773/svg/logo-linkedin-logo-icon-png-svg.png",
|
|
44
|
+
};
|
|
45
|
+
|
|
40
46
|
const country = ["Afghanistan"];
|
|
41
47
|
const countries = [
|
|
42
48
|
"Afghanistan",
|
|
@@ -61,8 +67,16 @@ const countries = [
|
|
|
61
67
|
"Dominica",
|
|
62
68
|
"Denmark",
|
|
63
69
|
"Djibouti",
|
|
70
|
+
"*",
|
|
64
71
|
];
|
|
65
72
|
|
|
73
|
+
const opinionatedTheme = {
|
|
74
|
+
textInput: {
|
|
75
|
+
fontColor: "#000000",
|
|
76
|
+
hoverBorderColor: "#a46ede",
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
66
80
|
export const Chromatic = () => (
|
|
67
81
|
<>
|
|
68
82
|
<ExampleContainer pseudoState="pseudo-hover">
|
|
@@ -98,12 +112,21 @@ export const Chromatic = () => (
|
|
|
98
112
|
<DxcTextInput label="Text input" clearable defaultValue="Text" helperText="Help message" optional />
|
|
99
113
|
</ExampleContainer>
|
|
100
114
|
<ExampleContainer>
|
|
101
|
-
<Title title="Clearable and large icon action" theme="light" level={4} />
|
|
115
|
+
<Title title="Clearable and large icon action (SVG)" theme="light" level={4} />
|
|
102
116
|
<DxcTextInput
|
|
103
117
|
label="Text input"
|
|
104
118
|
defaultValue="Text text text text text text text text text text"
|
|
105
119
|
clearable
|
|
106
|
-
action={
|
|
120
|
+
action={actionLargeIconSVG}
|
|
121
|
+
/>
|
|
122
|
+
</ExampleContainer>
|
|
123
|
+
<ExampleContainer>
|
|
124
|
+
<Title title="Clearable and large icon action (URL)" theme="light" level={4} />
|
|
125
|
+
<DxcTextInput
|
|
126
|
+
label="Text input"
|
|
127
|
+
defaultValue="Text text text text text text text text text text"
|
|
128
|
+
clearable
|
|
129
|
+
action={actionLargeIconURL}
|
|
107
130
|
/>
|
|
108
131
|
</ExampleContainer>
|
|
109
132
|
<ExampleContainer>
|
|
@@ -297,6 +320,66 @@ export const Chromatic = () => (
|
|
|
297
320
|
<Title title="FillParent size" theme="light" level={4} />
|
|
298
321
|
<DxcTextInput label="FillParent" size="fillParent" />
|
|
299
322
|
</ExampleContainer>
|
|
323
|
+
<Title title="Opinionated theme" theme="light" level={2} />
|
|
324
|
+
<ExampleContainer>
|
|
325
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
326
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
327
|
+
<Title title="Hovered input" theme="light" level={4} />
|
|
328
|
+
<DxcTextInput label="Text input" helperText="Help message" />
|
|
329
|
+
</ExampleContainer>
|
|
330
|
+
<ExampleContainer pseudoState="pseudo-focus-within">
|
|
331
|
+
<Title title="Focused input" theme="light" level={4} />
|
|
332
|
+
<DxcTextInput label="Text input" helperText="Help message" />
|
|
333
|
+
</ExampleContainer>
|
|
334
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
335
|
+
<Title title="Hovered action" theme="light" level={4} />
|
|
336
|
+
<DxcTextInput label="Text input" helperText="Help message" defaultValue="Text" clearable />
|
|
337
|
+
</ExampleContainer>
|
|
338
|
+
<ExampleContainer pseudoState="pseudo-active">
|
|
339
|
+
<Title title="Actived action" theme="light" level={4} />
|
|
340
|
+
<DxcTextInput label="Text input" helperText="Help message" action={action} clearable />
|
|
341
|
+
</ExampleContainer>
|
|
342
|
+
<ExampleContainer pseudoState="pseudo-focus">
|
|
343
|
+
<Title title="Focused action" theme="light" level={4} />
|
|
344
|
+
<DxcTextInput label="Text input" helperText="Help message" action={action} clearable />
|
|
345
|
+
</ExampleContainer>
|
|
346
|
+
<ExampleContainer>
|
|
347
|
+
<Title title="Prefix" theme="light" level={4} />
|
|
348
|
+
<DxcTextInput label="With prefix" prefix="+34" helperText="Help message" />
|
|
349
|
+
</ExampleContainer>
|
|
350
|
+
<ExampleContainer>
|
|
351
|
+
<Title title="Suffix and action" theme="light" level={4} />
|
|
352
|
+
<DxcTextInput label="With suffix" helperText="Help message" suffix="USD" action={action} />
|
|
353
|
+
</ExampleContainer>
|
|
354
|
+
<ExampleContainer>
|
|
355
|
+
<Title title="Invalid" theme="light" level={4} />
|
|
356
|
+
<DxcTextInput
|
|
357
|
+
label="Error text input"
|
|
358
|
+
helperText="Help message"
|
|
359
|
+
error="Error message."
|
|
360
|
+
defaultValue="Text"
|
|
361
|
+
clearable
|
|
362
|
+
optional
|
|
363
|
+
action={action}
|
|
364
|
+
/>
|
|
365
|
+
</ExampleContainer>
|
|
366
|
+
<ExampleContainer>
|
|
367
|
+
<Title title="Disabled and placeholder" theme="light" level={4} />
|
|
368
|
+
<DxcTextInput label="Disabled text input" disabled placeholder="Placeholder" prefix="+34" suffix="USD" />
|
|
369
|
+
</ExampleContainer>
|
|
370
|
+
<ExampleContainer>
|
|
371
|
+
<Title title="Disabled, helper text, optional, value and action" theme="light" level={4} />
|
|
372
|
+
<DxcTextInput
|
|
373
|
+
label="Disabled text input"
|
|
374
|
+
helperText="Help message"
|
|
375
|
+
disabled
|
|
376
|
+
optional
|
|
377
|
+
defaultValue="Text"
|
|
378
|
+
action={action}
|
|
379
|
+
/>
|
|
380
|
+
</ExampleContainer>
|
|
381
|
+
</HalstackProvider>
|
|
382
|
+
</ExampleContainer>
|
|
300
383
|
</>
|
|
301
384
|
);
|
|
302
385
|
|
|
@@ -308,7 +391,11 @@ const AutosuggestListbox = () => {
|
|
|
308
391
|
<ExampleContainer>
|
|
309
392
|
<Title title="Autosuggest listbox" theme="light" level={2} />
|
|
310
393
|
<ExampleContainer>
|
|
311
|
-
<Title
|
|
394
|
+
<Title
|
|
395
|
+
title="List dialog uses a Radix Popover to appear over elements with a certain z-index"
|
|
396
|
+
theme="light"
|
|
397
|
+
level={3}
|
|
398
|
+
/>
|
|
312
399
|
<div
|
|
313
400
|
style={{
|
|
314
401
|
display: "flex",
|
|
@@ -322,6 +409,7 @@ const AutosuggestListbox = () => {
|
|
|
322
409
|
borderRadius: "4px",
|
|
323
410
|
overflow: "auto",
|
|
324
411
|
zIndex: "1300",
|
|
412
|
+
position: "relative",
|
|
325
413
|
}}
|
|
326
414
|
>
|
|
327
415
|
<DxcTextInput
|