@dxc-technology/halstack-react 0.0.0-dddc3c4 → 0.0.0-de7c6b0
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 +117 -77
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +110 -114
- package/accordion/Accordion.stories.tsx +104 -114
- package/accordion/Accordion.test.js +10 -11
- package/accordion/types.d.ts +0 -11
- package/accordion-group/AccordionGroup.d.ts +4 -3
- package/accordion-group/AccordionGroup.js +24 -65
- package/accordion-group/AccordionGroup.stories.tsx +93 -66
- package/accordion-group/AccordionGroup.test.js +27 -62
- package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
- package/accordion-group/AccordionGroupAccordion.js +43 -0
- package/accordion-group/types.d.ts +6 -11
- package/alert/Alert.js +5 -9
- package/alert/Alert.stories.tsx +28 -0
- package/alert/Alert.test.js +1 -1
- package/bleed/Bleed.stories.tsx +1 -0
- package/box/Box.d.ts +1 -1
- package/box/Box.js +8 -27
- package/box/Box.stories.tsx +38 -51
- package/box/Box.test.js +1 -1
- package/box/types.d.ts +0 -11
- 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 +13 -16
- package/button/Button.stories.tsx +151 -9
- package/button/Button.test.js +1 -1
- package/button/types.d.ts +3 -3
- package/card/Card.d.ts +1 -1
- package/card/Card.js +27 -45
- package/card/Card.stories.tsx +12 -42
- package/card/Card.test.js +1 -1
- package/card/types.d.ts +1 -6
- package/checkbox/Checkbox.d.ts +2 -2
- package/checkbox/Checkbox.js +94 -101
- package/checkbox/Checkbox.stories.tsx +131 -59
- package/checkbox/Checkbox.test.js +94 -17
- package/checkbox/types.d.ts +4 -0
- package/chip/Chip.js +28 -49
- package/chip/Chip.stories.tsx +121 -26
- 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 +990 -1137
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +258 -0
- package/date-input/DateInput.js +134 -237
- package/date-input/DateInput.stories.tsx +199 -33
- package/date-input/DateInput.test.js +494 -138
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +146 -0
- package/date-input/Icons.d.ts +6 -0
- package/date-input/Icons.js +75 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +126 -0
- package/date-input/types.d.ts +51 -0
- package/dialog/Dialog.d.ts +1 -1
- package/dialog/Dialog.js +54 -85
- package/dialog/Dialog.stories.tsx +154 -170
- package/dialog/Dialog.test.js +302 -3
- package/dialog/types.d.ts +0 -12
- package/dropdown/Dropdown.js +43 -42
- package/dropdown/Dropdown.stories.tsx +210 -84
- package/dropdown/Dropdown.test.js +22 -27
- package/dropdown/DropdownMenu.js +12 -18
- package/dropdown/DropdownMenuItem.js +5 -18
- package/dropdown/types.d.ts +3 -3
- package/file-input/FileInput.d.ts +2 -2
- package/file-input/FileInput.js +174 -220
- package/file-input/FileInput.stories.tsx +122 -11
- package/file-input/FileInput.test.js +14 -14
- package/file-input/FileItem.d.ts +4 -14
- package/file-input/FileItem.js +39 -63
- package/file-input/types.d.ts +17 -0
- package/flex/Flex.d.ts +1 -1
- package/flex/Flex.js +33 -19
- package/flex/Flex.stories.tsx +35 -26
- package/flex/types.d.ts +83 -7
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +8 -23
- package/footer/Footer.stories.tsx +26 -16
- package/footer/Footer.test.js +14 -26
- package/footer/types.d.ts +0 -5
- 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 +4 -3
- package/header/Header.js +20 -49
- package/header/Header.stories.tsx +115 -36
- package/header/Header.test.js +2 -2
- package/header/types.d.ts +1 -14
- 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 +5 -5
- package/layout/ApplicationLayout.js +1 -1
- package/layout/types.d.ts +2 -3
- package/link/Link.js +4 -4
- 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 +110 -6
- package/{tabs-nav → nav-tabs}/NavTabs.test.js +1 -1
- package/{tabs-nav → nav-tabs}/Tab.js +49 -33
- package/{tabs-nav → nav-tabs}/types.d.ts +8 -9
- package/nav-tabs/types.js +5 -0
- package/number-input/NumberInput.test.js +44 -8
- package/package.json +13 -18
- package/paginator/Icons.d.ts +5 -0
- package/paginator/Icons.js +16 -28
- package/paginator/Paginator.js +8 -16
- package/paginator/Paginator.stories.tsx +24 -0
- package/paginator/Paginator.test.js +58 -48
- package/paragraph/Paragraph.d.ts +3 -4
- package/paragraph/Paragraph.js +5 -5
- package/password-input/PasswordInput.test.js +14 -13
- 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.js +11 -12
- package/quick-nav/QuickNav.stories.tsx +111 -19
- package/radio-group/Radio.d.ts +1 -1
- package/radio-group/Radio.js +46 -31
- package/radio-group/RadioGroup.js +23 -23
- package/radio-group/RadioGroup.stories.tsx +132 -18
- package/radio-group/RadioGroup.test.js +124 -97
- package/radio-group/types.d.ts +2 -2
- package/resultsetTable/Icons.d.ts +7 -0
- package/resultsetTable/Icons.js +51 -0
- package/resultsetTable/ResultsetTable.js +49 -108
- package/resultsetTable/ResultsetTable.stories.tsx +50 -25
- package/resultsetTable/ResultsetTable.test.js +41 -64
- package/resultsetTable/types.d.ts +1 -1
- package/select/Listbox.d.ts +1 -1
- package/select/Listbox.js +5 -35
- package/select/Option.js +11 -24
- package/select/Select.js +59 -36
- package/select/Select.stories.tsx +494 -150
- package/select/Select.test.js +341 -288
- package/select/types.d.ts +2 -2
- 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 -96
- package/sidenav/Sidenav.stories.tsx +165 -63
- package/sidenav/types.d.ts +21 -18
- package/slider/Slider.d.ts +2 -2
- package/slider/Slider.js +24 -15
- package/slider/Slider.stories.tsx +57 -0
- package/slider/Slider.test.js +1 -1
- package/slider/types.d.ts +6 -2
- package/spinner/Spinner.js +17 -23
- package/spinner/Spinner.stories.jsx +53 -27
- package/spinner/Spinner.test.js +1 -1
- package/switch/Switch.d.ts +3 -3
- package/switch/Switch.js +96 -85
- package/switch/Switch.stories.tsx +33 -0
- package/switch/Switch.test.js +27 -14
- package/switch/types.d.ts +8 -3
- package/table/Table.js +3 -3
- package/table/Table.stories.jsx +80 -1
- package/table/Table.test.js +2 -2
- package/tabs/Tab.js +12 -15
- package/tabs/Tabs.js +11 -17
- package/tabs/Tabs.stories.tsx +45 -5
- package/tabs/Tabs.test.js +4 -5
- package/tabs/types.d.ts +2 -2
- package/tag/Tag.js +8 -10
- package/tag/Tag.stories.tsx +14 -1
- package/tag/Tag.test.js +1 -1
- package/text-input/Icons.d.ts +8 -0
- package/text-input/Icons.js +60 -0
- package/text-input/Suggestion.js +40 -11
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +134 -0
- package/text-input/TextInput.js +189 -277
- package/text-input/TextInput.stories.tsx +280 -184
- package/text-input/TextInput.test.js +736 -725
- package/text-input/types.d.ts +21 -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/card/ice-cream.jpg +0 -0
- package/common/RequiredComponent.js +0 -32
- /package/{tabs-nav → grid}/types.js +0 -0
- /package/{tabs-nav → nav-tabs}/Tab.d.ts +0 -0
|
@@ -6,7 +6,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
6
6
|
|
|
7
7
|
var _react2 = require("@testing-library/react");
|
|
8
8
|
|
|
9
|
-
var _ProgressBar = _interopRequireDefault(require("./ProgressBar"));
|
|
9
|
+
var _ProgressBar = _interopRequireDefault(require("./ProgressBar.tsx"));
|
|
10
10
|
|
|
11
11
|
describe("ProgressBar component tests", function () {
|
|
12
12
|
test("ProgressBar renders with label and helperText", function () {
|
package/progress-bar/types.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
+
declare type Size = {
|
|
3
3
|
top?: Space;
|
|
4
4
|
bottom?: Space;
|
|
5
5
|
left?: Space;
|
|
6
6
|
right?: Space;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
declare type Props = {
|
|
9
9
|
/**
|
|
10
10
|
* Text to be placed above the progress bar.
|
|
11
11
|
*/
|
|
@@ -34,3 +34,4 @@ export declare type Props = {
|
|
|
34
34
|
*/
|
|
35
35
|
margin?: Space | Size;
|
|
36
36
|
};
|
|
37
|
+
export default Props;
|
package/quick-nav/QuickNav.js
CHANGED
|
@@ -48,13 +48,10 @@ var DxcQuickNav = function DxcQuickNav(_ref) {
|
|
|
48
48
|
}, /*#__PURE__*/_react["default"].createElement(_Heading["default"], {
|
|
49
49
|
level: 4,
|
|
50
50
|
text: title || translatedLabels.quickNav.contentTitle
|
|
51
|
-
}), /*#__PURE__*/_react["default"].createElement(ListColumn, null,
|
|
52
|
-
direction: "column",
|
|
53
|
-
gap: "0.5rem"
|
|
54
|
-
}, links.map(function (link) {
|
|
51
|
+
}), /*#__PURE__*/_react["default"].createElement(ListColumn, null, links.map(function (link) {
|
|
55
52
|
var _link$links;
|
|
56
53
|
|
|
57
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
54
|
+
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
58
55
|
key: link.label
|
|
59
56
|
}, /*#__PURE__*/_react["default"].createElement(_Inset["default"], {
|
|
60
57
|
space: "0.25rem"
|
|
@@ -62,18 +59,20 @@ var DxcQuickNav = function DxcQuickNav(_ref) {
|
|
|
62
59
|
href: "#".concat((0, _slugify["default"])(link === null || link === void 0 ? void 0 : link.label, {
|
|
63
60
|
lower: true
|
|
64
61
|
}))
|
|
65
|
-
}, link === null || link === void 0 ? void 0 : link.label), (_link$links = link.links) === null || _link$links === void 0 ? void 0 : _link$links.map(function (sublink) {
|
|
66
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
62
|
+
}, link === null || link === void 0 ? void 0 : link.label), /*#__PURE__*/_react["default"].createElement(ListSecondColumn, null, (_link$links = link.links) === null || _link$links === void 0 ? void 0 : _link$links.map(function (sublink) {
|
|
63
|
+
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
67
64
|
key: sublink.label
|
|
68
65
|
}, /*#__PURE__*/_react["default"].createElement(_Inset["default"], {
|
|
69
66
|
horizontal: "0.5rem"
|
|
70
67
|
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], null, /*#__PURE__*/_react["default"].createElement(Link, {
|
|
71
|
-
href: "#".concat((0, _slugify["default"])(
|
|
68
|
+
href: "#".concat((0, _slugify["default"])(link === null || link === void 0 ? void 0 : link.label, {
|
|
69
|
+
lower: true
|
|
70
|
+
}), "-").concat((0, _slugify["default"])(sublink === null || sublink === void 0 ? void 0 : sublink.label, {
|
|
72
71
|
lower: true
|
|
73
72
|
}))
|
|
74
73
|
}, sublink === null || sublink === void 0 ? void 0 : sublink.label))));
|
|
75
|
-
}))));
|
|
76
|
-
})))))
|
|
74
|
+
})))));
|
|
75
|
+
})))));
|
|
77
76
|
};
|
|
78
77
|
|
|
79
78
|
var QuickNavContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n border-left: 2px solid ", ";\n"])), function (props) {
|
|
@@ -88,9 +87,9 @@ var QuickNavContainer = _styledComponents["default"].div(_templateObject || (_te
|
|
|
88
87
|
return props.theme.dividerBorderColor;
|
|
89
88
|
});
|
|
90
89
|
|
|
91
|
-
var ListColumn = _styledComponents["default"].ul(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
90
|
+
var ListColumn = _styledComponents["default"].ul(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n margin: 0;\n padding: 0;\n list-style-type: none;\n"])));
|
|
92
91
|
|
|
93
|
-
var
|
|
92
|
+
var ListSecondColumn = _styledComponents["default"].ul(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n margin: 0;\n padding: 0;\n list-style-type: none;\n"])));
|
|
94
93
|
|
|
95
94
|
var Link = _styledComponents["default"].a(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n text-decoration: none;\n font-size: ", ";\n font-family: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n display: block;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n width: fit-content;\n max-width: 100%;\n\n &:hover {\n color: ", ";\n }\n &:focus {\n outline-color: ", ";\n outline-style: ", ";\n outline-width: ", ";\n border-radius: ", ";\n }\n"])), function (props) {
|
|
96
95
|
return props.theme.fontSize;
|
|
@@ -5,39 +5,74 @@ import DxcHeading from "../heading/Heading";
|
|
|
5
5
|
import DxcParagraph from "../paragraph/Paragraph";
|
|
6
6
|
import Title from "../../.storybook/components/Title";
|
|
7
7
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
8
|
+
import { HalstackProvider } from "../HalstackContext";
|
|
8
9
|
|
|
9
10
|
export default {
|
|
10
11
|
title: "QuickNav",
|
|
11
12
|
component: DxcQuickNav,
|
|
12
13
|
};
|
|
13
14
|
|
|
15
|
+
const opinionatedTheme = {
|
|
16
|
+
quickNav: {
|
|
17
|
+
fontColor: "#666666",
|
|
18
|
+
accentColor: "#9a6bb2",
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const defaultLinks = [
|
|
23
|
+
{
|
|
24
|
+
label: "Overview",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: "Principles",
|
|
28
|
+
links: [{ label: "Color" }, { label: "Spacing" }, { label: "Typography" }],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: "Components",
|
|
32
|
+
links: [
|
|
33
|
+
{
|
|
34
|
+
label: "Accordion",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: "Button",
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
|
|
14
43
|
const links = [
|
|
15
44
|
{
|
|
16
45
|
label: "Overview",
|
|
17
|
-
id: "overview",
|
|
18
46
|
links: [
|
|
19
47
|
{
|
|
20
48
|
label: "Introduction",
|
|
21
|
-
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: "Components",
|
|
54
|
+
links: [
|
|
55
|
+
{
|
|
56
|
+
label: "Introduction",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: "Accordion",
|
|
22
60
|
},
|
|
23
61
|
],
|
|
24
62
|
},
|
|
25
63
|
{
|
|
26
64
|
label: "Principles very very very very very very very very long",
|
|
27
|
-
id: "principles",
|
|
28
65
|
links: [
|
|
29
|
-
{ label: "Color very very very very very very very very long"
|
|
30
|
-
{ label: "Spacingveryveryveryveryveryveryveryverylong"
|
|
31
|
-
{ label: "Typography"
|
|
66
|
+
{ label: "Color very very very very very very very very long" },
|
|
67
|
+
{ label: "Spacingveryveryveryveryveryveryveryverylong" },
|
|
68
|
+
{ label: "Typography" },
|
|
32
69
|
],
|
|
33
70
|
},
|
|
34
71
|
{
|
|
35
72
|
label: "Componentsveryveryveryveryveryveryveryverylong",
|
|
36
|
-
id: "components",
|
|
37
73
|
links: [
|
|
38
74
|
{
|
|
39
75
|
label: "Accordion",
|
|
40
|
-
id: "accordion",
|
|
41
76
|
},
|
|
42
77
|
],
|
|
43
78
|
},
|
|
@@ -48,19 +83,25 @@ export const Chromatic = () => (
|
|
|
48
83
|
<ExampleContainer>
|
|
49
84
|
<Title title="Default" level={4} />
|
|
50
85
|
<QuickNavContainer>
|
|
51
|
-
<DxcQuickNav links={
|
|
86
|
+
<DxcQuickNav links={defaultLinks} />
|
|
87
|
+
</QuickNavContainer>
|
|
88
|
+
</ExampleContainer>
|
|
89
|
+
<ExampleContainer>
|
|
90
|
+
<Title title="Text overflow" level={4} />
|
|
91
|
+
<QuickNavContainer>
|
|
92
|
+
<DxcQuickNav links={links} />
|
|
52
93
|
</QuickNavContainer>
|
|
53
94
|
</ExampleContainer>
|
|
54
95
|
<ExampleContainer pseudoState="pseudo-hover">
|
|
55
96
|
<Title title="Link hovered" level={4} />
|
|
56
97
|
<QuickNavContainer>
|
|
57
|
-
<DxcQuickNav links={links}
|
|
98
|
+
<DxcQuickNav links={links} />
|
|
58
99
|
</QuickNavContainer>
|
|
59
100
|
</ExampleContainer>
|
|
60
101
|
<ExampleContainer pseudoState="pseudo-focus">
|
|
61
102
|
<Title title="Link focus" level={4} />
|
|
62
103
|
<QuickNavContainer>
|
|
63
|
-
<DxcQuickNav links={links}
|
|
104
|
+
<DxcQuickNav links={links} />
|
|
64
105
|
</QuickNavContainer>
|
|
65
106
|
</ExampleContainer>
|
|
66
107
|
<ExampleContainer>
|
|
@@ -87,7 +128,7 @@ export const Chromatic = () => (
|
|
|
87
128
|
open source design system for insurance products and digital experiences. Our system provides all the
|
|
88
129
|
tools and resources needed to create superior, beautiful but above all, functional user experiences.
|
|
89
130
|
</DxcParagraph>
|
|
90
|
-
<Content id="introduction">
|
|
131
|
+
<Content id="overview-introduction">
|
|
91
132
|
<DxcHeading level={2} text="Introduction" margin={{ top: "xsmall", bottom: "xsmall" }} />
|
|
92
133
|
<DxcParagraph>
|
|
93
134
|
Design principles Halstack design principles are the fundamental part of DXC Technology's approach to
|
|
@@ -122,9 +163,54 @@ export const Chromatic = () => (
|
|
|
122
163
|
</DxcParagraph>
|
|
123
164
|
</Content>
|
|
124
165
|
</Content>
|
|
125
|
-
<Content id="
|
|
166
|
+
<Content id="components">
|
|
167
|
+
<DxcHeading level={1} text="Components" margin={{ top: "small", bottom: "xsmall" }} />
|
|
168
|
+
<Content id="components-introduction">
|
|
169
|
+
<DxcHeading level={2} text="Introduction" margin={{ top: "xsmall", bottom: "xsmall" }} />
|
|
170
|
+
<DxcParagraph>
|
|
171
|
+
Design principles Halstack design principles are the fundamental part of DXC Technology's approach to
|
|
172
|
+
provide guidance for development teams in order to deliver delightful and consistent user experiences to
|
|
173
|
+
our customers: Balance Consistency Visual hierarchy All our components, design tokens, accessibility
|
|
174
|
+
guidelines, responsive design techniques, and layout proposals have been carefully curated by DXC design
|
|
175
|
+
and engineering teams with the objective of creating a unique visual language and ecosystem for our
|
|
176
|
+
applications. This is the DXC way of creating User Experiences. Open Source Halstack is an open source
|
|
177
|
+
design system, this means that we work towards DXC Technology bussines needs, but it is open for anyone
|
|
178
|
+
to use and contribute back to. We are charmed to receive external contributions to help us find bugs,
|
|
179
|
+
design new features, or help us improve the project documentation. If you're interested, definitely
|
|
180
|
+
check out our contribution guidelines.Design principles Halstack design principles are the fundamental
|
|
181
|
+
part of DXC Technology's approach to provide guidance for development teams in order to deliver
|
|
182
|
+
delightful and consistent user experiences to our customers: Balance Consistency Visual hierarchy All
|
|
183
|
+
our components, design tokens, accessibility guidelines, responsive design techniques, and layout
|
|
184
|
+
proposals have been carefully curated by DXC design and engineering teams with the objective of creating
|
|
185
|
+
a unique visual language and ecosystem for our applications. This is the DXC way of creating User
|
|
186
|
+
Experiences. Open Source Halstack is an open source design system, this means that we work towards DXC
|
|
187
|
+
Technology bussines needs, but it is open for anyone to use and contribute back to. We are charmed to
|
|
188
|
+
receive external contributions to help us find bugs, design new features, or help us improve the project
|
|
189
|
+
documentation. If you're interested, definitely check out our contribution guidelines.Design principles
|
|
190
|
+
Halstack design principles are the fundamental part of DXC Technology's approach to provide guidance for
|
|
191
|
+
development teams in order to deliver delightful and consistent user experiences to our customers:
|
|
192
|
+
Balance Consistency Visual hierarchy All our components, design tokens, accessibility guidelines,
|
|
193
|
+
responsive design techniques, and layout proposals have been carefully curated by DXC design and
|
|
194
|
+
engineering teams with the objective of creating a unique visual language and ecosystem for our
|
|
195
|
+
applications. This is the DXC way of creating User Experiences. Open Source Halstack is an open source
|
|
196
|
+
design system, this means that we work towards DXC Technology bussines needs, but it is open for anyone
|
|
197
|
+
to use and contribute back to. We are charmed to receive external contributions to help us find bugs,
|
|
198
|
+
design new features, or help us improve the project documentation. If you're interested, definitely
|
|
199
|
+
check out our contribution guidelines.
|
|
200
|
+
</DxcParagraph>
|
|
201
|
+
</Content>
|
|
202
|
+
<Content id="components-accordion">
|
|
203
|
+
<DxcHeading level={2} text="Accordion" margin={{ top: "xsmall", bottom: "xsmall" }} />
|
|
204
|
+
<DxcParagraph>
|
|
205
|
+
Accordions are used to group similar content and hide or show it depending on user needs or preferences.
|
|
206
|
+
Accordions give users more granular control over the interface and help digest content in stages, rather
|
|
207
|
+
than all at once.
|
|
208
|
+
</DxcParagraph>
|
|
209
|
+
</Content>
|
|
210
|
+
</Content>
|
|
211
|
+
<Content id="principles-very-very-very-very-very-very-very-very-long">
|
|
126
212
|
<DxcHeading level={1} text="Principles" margin={{ top: "small", bottom: "xsmall" }} />
|
|
127
|
-
<Content id="color">
|
|
213
|
+
<Content id="principles-very-very-very-very-very-very-very-very-long-color-very-very-very-very-very-very-very-very-long">
|
|
128
214
|
<DxcHeading level={2} text="Color" margin={{ top: "xsmall", bottom: "xsmall" }} />
|
|
129
215
|
<DxcParagraph>
|
|
130
216
|
The color palette is an essential asset as a communication resource of our design system. Halstack color
|
|
@@ -161,7 +247,7 @@ export const Chromatic = () => (
|
|
|
161
247
|
role-based color palettes and must not be used outside this context.
|
|
162
248
|
</DxcParagraph>
|
|
163
249
|
</Content>
|
|
164
|
-
<Content id="
|
|
250
|
+
<Content id="principles-very-very-very-very-very-very-very-very-long-spacingveryveryveryveryveryveryveryverylong">
|
|
165
251
|
<DxcHeading level={2} text="Spacing" margin={{ top: "xsmall", bottom: "xsmall" }} />
|
|
166
252
|
<DxcParagraph>
|
|
167
253
|
In the search of consistent alignment between the elements we provide a spacing scale based on a root
|
|
@@ -183,7 +269,7 @@ export const Chromatic = () => (
|
|
|
183
269
|
easily multiplied, they provide flexible and consistent, yet distinct enough, steps between them.
|
|
184
270
|
</DxcParagraph>
|
|
185
271
|
</Content>
|
|
186
|
-
<Content id="typography">
|
|
272
|
+
<Content id="principles-very-very-very-very-very-very-very-very-long-typography">
|
|
187
273
|
<DxcHeading level={2} text="Typography" margin={{ top: "xsmall", bottom: "xsmall" }} />
|
|
188
274
|
<DxcParagraph>
|
|
189
275
|
Our selected typography helps in structuring our user's experience based on the visual impact that it
|
|
@@ -220,9 +306,9 @@ export const Chromatic = () => (
|
|
|
220
306
|
</DxcParagraph>
|
|
221
307
|
</Content>
|
|
222
308
|
</Content>
|
|
223
|
-
<Content id="
|
|
309
|
+
<Content id="componentsveryveryveryveryveryveryveryverylong">
|
|
224
310
|
<DxcHeading level={1} text="Components" margin={{ top: "small", bottom: "xsmall" }} />
|
|
225
|
-
<Content id="accordion">
|
|
311
|
+
<Content id="componentsveryveryveryveryveryveryveryverylong-accordion">
|
|
226
312
|
<DxcHeading level={2} text="Accordion" margin={{ top: "xsmall", bottom: "xsmall" }} />
|
|
227
313
|
<DxcParagraph>
|
|
228
314
|
Accordions are used to group similar content and hide or show it depending on user needs or preferences.
|
|
@@ -233,10 +319,16 @@ export const Chromatic = () => (
|
|
|
233
319
|
</Content>
|
|
234
320
|
</ContentContainer>
|
|
235
321
|
<QuickNavContainer>
|
|
236
|
-
<DxcQuickNav title="Sections" links={links}
|
|
322
|
+
<DxcQuickNav title="Sections" links={links} />
|
|
237
323
|
</QuickNavContainer>
|
|
238
324
|
</Container>
|
|
239
325
|
</ExampleContainer>
|
|
326
|
+
<Title title="Opinionated theme" level={2} />
|
|
327
|
+
<ExampleContainer>
|
|
328
|
+
<HalstackProvider theme={opinionatedTheme}>
|
|
329
|
+
<DxcQuickNav links={defaultLinks} />
|
|
330
|
+
</HalstackProvider>
|
|
331
|
+
</ExampleContainer>
|
|
240
332
|
</>
|
|
241
333
|
);
|
|
242
334
|
|
package/radio-group/Radio.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { RadioProps } from "./types";
|
|
3
|
-
declare const _default: React.MemoExoticComponent<({
|
|
3
|
+
declare const _default: React.MemoExoticComponent<({ label, checked, onClick, error, disabled, focused, readonly, tabIndex, }: RadioProps) => JSX.Element>;
|
|
4
4
|
export default _default;
|
package/radio-group/Radio.js
CHANGED
|
@@ -21,17 +21,17 @@ var _uuid = require("uuid");
|
|
|
21
21
|
|
|
22
22
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _Flex = _interopRequireDefault(require("../flex/Flex"));
|
|
25
|
+
|
|
26
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
25
27
|
|
|
26
28
|
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
29
|
|
|
28
30
|
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; }
|
|
29
31
|
|
|
30
32
|
var DxcRadio = function DxcRadio(_ref) {
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
var option = _ref.option,
|
|
34
|
-
currentValue = _ref.currentValue,
|
|
33
|
+
var label = _ref.label,
|
|
34
|
+
checked = _ref.checked,
|
|
35
35
|
onClick = _ref.onClick,
|
|
36
36
|
error = _ref.error,
|
|
37
37
|
disabled = _ref.disabled,
|
|
@@ -50,7 +50,7 @@ var DxcRadio = function DxcRadio(_ref) {
|
|
|
50
50
|
var _ref$current;
|
|
51
51
|
|
|
52
52
|
onClick();
|
|
53
|
-
|
|
53
|
+
document.activeElement !== (ref === null || ref === void 0 ? void 0 : ref.current) && (ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus());
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
var _useState3 = (0, _react.useState)(true),
|
|
@@ -58,7 +58,7 @@ var DxcRadio = function DxcRadio(_ref) {
|
|
|
58
58
|
firstUpdate = _useState4[0],
|
|
59
59
|
setFirstUpdate = _useState4[1];
|
|
60
60
|
|
|
61
|
-
(0, _react.
|
|
61
|
+
(0, _react.useEffect)(function () {
|
|
62
62
|
var _ref$current2;
|
|
63
63
|
|
|
64
64
|
// Don't apply in the first render
|
|
@@ -71,56 +71,59 @@ var DxcRadio = function DxcRadio(_ref) {
|
|
|
71
71
|
}, [focused]);
|
|
72
72
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
73
73
|
theme: colorsTheme.radioGroup
|
|
74
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
74
|
+
}, /*#__PURE__*/_react["default"].createElement(_Flex["default"], null, /*#__PURE__*/_react["default"].createElement(RadioContainer, {
|
|
75
75
|
error: error,
|
|
76
76
|
disabled: disabled,
|
|
77
77
|
readonly: readonly,
|
|
78
|
-
|
|
79
|
-
// Prevents div's onClick from stealing the radio input's focus
|
|
80
|
-
event.preventDefault();
|
|
81
|
-
},
|
|
82
|
-
onClick: handleOnClick
|
|
78
|
+
onClick: disabled ? undefined : handleOnClick
|
|
83
79
|
}, /*#__PURE__*/_react["default"].createElement(RadioInputContainer, null, /*#__PURE__*/_react["default"].createElement(RadioInput, {
|
|
84
80
|
error: error,
|
|
85
81
|
disabled: disabled,
|
|
86
82
|
readonly: readonly,
|
|
87
83
|
role: "radio",
|
|
88
|
-
"aria-checked":
|
|
89
|
-
"aria-disabled":
|
|
84
|
+
"aria-checked": checked,
|
|
85
|
+
"aria-disabled": disabled,
|
|
90
86
|
"aria-labelledby": radioLabelId,
|
|
91
87
|
tabIndex: disabled ? -1 : focused ? tabIndex : -1,
|
|
92
88
|
ref: ref
|
|
93
|
-
},
|
|
89
|
+
}, checked && /*#__PURE__*/_react["default"].createElement(Dot, {
|
|
94
90
|
disabled: disabled,
|
|
95
91
|
readonly: readonly,
|
|
96
92
|
error: error
|
|
97
93
|
}))), /*#__PURE__*/_react["default"].createElement(Label, {
|
|
98
94
|
id: radioLabelId,
|
|
99
95
|
disabled: disabled
|
|
100
|
-
},
|
|
96
|
+
}, label))));
|
|
101
97
|
};
|
|
102
98
|
|
|
103
|
-
var
|
|
99
|
+
var getRadioInputStateColor = function getRadioInputStateColor(props, state) {
|
|
100
|
+
switch (state) {
|
|
101
|
+
case "enabled":
|
|
102
|
+
return props.disabled ? props.theme.disabledRadioInputColor : props.error ? props.theme.errorRadioInputColor : props.readonly ? props.theme.readonlyRadioInputColor : props.theme.radioInputColor;
|
|
104
103
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}, function (props) {
|
|
108
|
-
return !props.disabled ? "\n &:hover {\n & > div > div { \n border-color: ".concat(props.error ? props.theme.hoverErrorRadioInputColor : props.readonly ? props.theme.hoverReadonlyRadioInputColor : props.theme.hoverRadioInputColor, ";\n & > span {\n background-color: ").concat(props.error ? props.theme.hoverErrorRadioInputColor : props.readonly ? props.theme.hoverReadonlyRadioInputColor : props.theme.hoverRadioInputColor, ";\n }\n };\n }\n &:active {\n & > div > div {\n border-color: ").concat(props.error ? props.theme.activeErrorRadioInputColor : props.readonly ? props.theme.activeReadonlyRadioInputColor : props.theme.activeRadioInputColor, ";\n & > span {\n background-color: ").concat(props.error ? props.theme.activeErrorRadioInputColor : props.readonly ? props.theme.activeReadonlyRadioInputColor : props.theme.activeRadioInputColor, ";\n }\n }\n }\n ") : "pointer-events: none;";
|
|
109
|
-
});
|
|
104
|
+
case "hover":
|
|
105
|
+
return props.error ? props.theme.hoverErrorRadioInputColor : props.readonly ? props.theme.hoverReadonlyRadioInputColor : props.theme.hoverRadioInputColor;
|
|
110
106
|
|
|
111
|
-
|
|
107
|
+
case "active":
|
|
108
|
+
return props.error ? props.theme.activeErrorRadioInputColor : props.readonly ? props.theme.activeReadonlyRadioInputColor : props.theme.activeRadioInputColor;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
112
111
|
|
|
113
|
-
var
|
|
114
|
-
|
|
112
|
+
var RadioInputContainer = _styledComponents["default"].span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: 24px;\n width: 24px;\n"])));
|
|
113
|
+
|
|
114
|
+
var RadioInput = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 18px;\n height: 18px;\n border: 2px solid ", ";\n border-radius: 50%;\n\n &:focus {\n outline: 2px solid ", ";\n outline-offset: 1px;\n }\n ", "\n"])), function (props) {
|
|
115
|
+
return getRadioInputStateColor(props, "enabled");
|
|
116
|
+
}, function (props) {
|
|
117
|
+
return props.theme.focusBorderColor;
|
|
115
118
|
}, function (props) {
|
|
116
|
-
return
|
|
119
|
+
return props.disabled && "pointer-events: none;";
|
|
117
120
|
});
|
|
118
121
|
|
|
119
|
-
var Dot = _styledComponents["default"].span(
|
|
120
|
-
|
|
122
|
+
var Dot = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n height: 10px;\n width: 10px;\n border-radius: 50%;\n background-color: ", ";\n"])), function (props) {
|
|
123
|
+
return getRadioInputStateColor(props, "enabled");
|
|
121
124
|
});
|
|
122
125
|
|
|
123
|
-
var Label = _styledComponents["default"].span(
|
|
126
|
+
var Label = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n ", "\n"])), function (props) {
|
|
124
127
|
return props.theme.radioInputLabelMargin;
|
|
125
128
|
}, function (props) {
|
|
126
129
|
return props.theme.fontFamily;
|
|
@@ -133,7 +136,19 @@ var Label = _styledComponents["default"].span(_templateObject6 || (_templateObje
|
|
|
133
136
|
}, function (props) {
|
|
134
137
|
return props.theme.radioInputLabelLineHeight;
|
|
135
138
|
}, function (props) {
|
|
136
|
-
return props.disabled ? "color: ".concat(props.theme.disabledRadioInputLabelFontColor, ";
|
|
139
|
+
return props.disabled ? "color: ".concat(props.theme.disabledRadioInputLabelFontColor, ";") : "color: ".concat(props.theme.radioInputLabelFontColor);
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
var RadioContainer = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: center;\n cursor: ", ";\n\n &:hover {\n ", " {\n border-color: ", ";\n }\n ", " {\n background-color: ", ";\n }\n }\n &:active {\n ", " {\n border-color: ", ";\n }\n ", " {\n background-color: ", ";\n }\n }\n"])), function (props) {
|
|
143
|
+
return props.disabled ? "not-allowed" : props.readonly ? "default" : "pointer";
|
|
144
|
+
}, RadioInput, function (props) {
|
|
145
|
+
return !props.disabled && getRadioInputStateColor(props, "hover");
|
|
146
|
+
}, Dot, function (props) {
|
|
147
|
+
return !props.disabled && getRadioInputStateColor(props, "hover");
|
|
148
|
+
}, RadioInput, function (props) {
|
|
149
|
+
return !props.disabled && getRadioInputStateColor(props, "active");
|
|
150
|
+
}, Dot, function (props) {
|
|
151
|
+
return !props.disabled && getRadioInputStateColor(props, "active");
|
|
137
152
|
});
|
|
138
153
|
|
|
139
154
|
var _default = /*#__PURE__*/_react["default"].memo(DxcRadio);
|
|
@@ -41,6 +41,8 @@ var getInitialFocusIndex = function getInitialFocusIndex(innerOptions, value) {
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
var DxcRadioGroup = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
44
|
+
var _ref2;
|
|
45
|
+
|
|
44
46
|
var label = _ref.label,
|
|
45
47
|
name = _ref.name,
|
|
46
48
|
helperText = _ref.helperText,
|
|
@@ -81,14 +83,13 @@ var DxcRadioGroup = /*#__PURE__*/_react["default"].forwardRef(function (_ref, re
|
|
|
81
83
|
|
|
82
84
|
var colorsTheme = (0, _useTheme["default"])();
|
|
83
85
|
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
84
|
-
var optionalItem = {
|
|
85
|
-
label: optionalItemLabel || translatedLabels.radioGroup.optionalItemLabelDefault,
|
|
86
|
-
value: "",
|
|
87
|
-
disabled: disabled
|
|
88
|
-
};
|
|
89
86
|
var innerOptions = (0, _react.useMemo)(function () {
|
|
90
|
-
return optional ? [].concat((0, _toConsumableArray2["default"])(options), [
|
|
91
|
-
|
|
87
|
+
return optional ? [].concat((0, _toConsumableArray2["default"])(options), [{
|
|
88
|
+
label: optionalItemLabel !== null && optionalItemLabel !== void 0 ? optionalItemLabel : translatedLabels.radioGroup.optionalItemLabelDefault,
|
|
89
|
+
value: "",
|
|
90
|
+
disabled: disabled
|
|
91
|
+
}]) : options;
|
|
92
|
+
}, [optional, options, optionalItemLabel, translatedLabels]);
|
|
92
93
|
|
|
93
94
|
var _useState7 = (0, _react.useState)(getInitialFocusIndex(innerOptions, value !== null && value !== void 0 ? value : innerValue)),
|
|
94
95
|
_useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
|
|
@@ -102,11 +103,11 @@ var DxcRadioGroup = /*#__PURE__*/_react["default"].forwardRef(function (_ref, re
|
|
|
102
103
|
value !== null && value !== void 0 ? value : setInnerValue(newValue);
|
|
103
104
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
104
105
|
}
|
|
105
|
-
}, [value, innerValue,
|
|
106
|
+
}, [value, innerValue, onChange]);
|
|
106
107
|
|
|
107
|
-
var handleOnBlur = function handleOnBlur(
|
|
108
|
+
var handleOnBlur = function handleOnBlur(event) {
|
|
108
109
|
// If the radio group loses the focus to an element not contained inside it...
|
|
109
|
-
if (!
|
|
110
|
+
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
110
111
|
setFirstTimeFocus(true);
|
|
111
112
|
var currentValue = value !== null && value !== void 0 ? value : innerValue;
|
|
112
113
|
!optional && !Boolean(currentValue) ? onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
@@ -166,8 +167,7 @@ var DxcRadioGroup = /*#__PURE__*/_react["default"].forwardRef(function (_ref, re
|
|
|
166
167
|
setNextRadioChecked();
|
|
167
168
|
break;
|
|
168
169
|
|
|
169
|
-
case "
|
|
170
|
-
case "Space":
|
|
170
|
+
case " ":
|
|
171
171
|
event.preventDefault();
|
|
172
172
|
handleOnChange(innerOptions[currentFocusIndex].value);
|
|
173
173
|
break;
|
|
@@ -182,7 +182,7 @@ var DxcRadioGroup = /*#__PURE__*/_react["default"].forwardRef(function (_ref, re
|
|
|
182
182
|
id: radioGroupLabelId,
|
|
183
183
|
helperText: helperText,
|
|
184
184
|
disabled: disabled
|
|
185
|
-
}, label,
|
|
185
|
+
}, label, optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, " ".concat(translatedLabels.formFields.optionalLabel))), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
186
186
|
disabled: disabled
|
|
187
187
|
}, helperText), /*#__PURE__*/_react["default"].createElement(RadioGroup, {
|
|
188
188
|
onBlur: handleOnBlur,
|
|
@@ -192,20 +192,21 @@ var DxcRadioGroup = /*#__PURE__*/_react["default"].forwardRef(function (_ref, re
|
|
|
192
192
|
role: "radiogroup",
|
|
193
193
|
"aria-disabled": disabled,
|
|
194
194
|
"aria-labelledby": radioGroupLabelId,
|
|
195
|
-
"aria-invalid": error ?
|
|
195
|
+
"aria-invalid": error ? true : false,
|
|
196
196
|
"aria-errormessage": error ? errorId : undefined,
|
|
197
197
|
"aria-required": !disabled && !readonly && !optional,
|
|
198
198
|
"aria-readonly": readonly,
|
|
199
199
|
"aria-orientation": stacking === "column" ? "vertical" : "horizontal"
|
|
200
200
|
}, /*#__PURE__*/_react["default"].createElement(ValueInput, {
|
|
201
201
|
name: name,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
disabled: disabled,
|
|
203
|
+
value: (_ref2 = value !== null && value !== void 0 ? value : innerValue) !== null && _ref2 !== void 0 ? _ref2 : "",
|
|
204
|
+
readOnly: true
|
|
205
205
|
}), innerOptions.map(function (option, index) {
|
|
206
206
|
return /*#__PURE__*/_react["default"].createElement(_Radio["default"], {
|
|
207
|
-
|
|
208
|
-
|
|
207
|
+
key: "radio-".concat(index),
|
|
208
|
+
label: option.label,
|
|
209
|
+
checked: (value !== null && value !== void 0 ? value : innerValue) === option.value,
|
|
209
210
|
onClick: function onClick() {
|
|
210
211
|
handleOnChange(option.value);
|
|
211
212
|
setCurrentFocusIndex(index);
|
|
@@ -214,8 +215,7 @@ var DxcRadioGroup = /*#__PURE__*/_react["default"].forwardRef(function (_ref, re
|
|
|
214
215
|
disabled: option.disabled || disabled,
|
|
215
216
|
focused: currentFocusIndex === index,
|
|
216
217
|
readonly: readonly,
|
|
217
|
-
tabIndex: tabIndex
|
|
218
|
-
key: "radio-".concat(index)
|
|
218
|
+
tabIndex: tabIndex
|
|
219
219
|
});
|
|
220
220
|
})), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
|
|
221
221
|
id: errorId,
|
|
@@ -223,7 +223,7 @@ var DxcRadioGroup = /*#__PURE__*/_react["default"].forwardRef(function (_ref, re
|
|
|
223
223
|
}, error)));
|
|
224
224
|
});
|
|
225
225
|
|
|
226
|
-
var RadioGroupContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n flex-direction: column;\n
|
|
226
|
+
var RadioGroupContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: inline-flex;\n flex-direction: column;\n"])));
|
|
227
227
|
|
|
228
228
|
var Label = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n ", "\n"])), function (props) {
|
|
229
229
|
return props.disabled ? props.theme.disabledLabelFontColor : props.theme.labelFontColor;
|
|
@@ -261,7 +261,7 @@ var HelperText = _styledComponents["default"].span(_templateObject4 || (_templat
|
|
|
261
261
|
return props.theme.groupLabelMargin;
|
|
262
262
|
});
|
|
263
263
|
|
|
264
|
-
var RadioGroup = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n flex-direction: ", ";\n
|
|
264
|
+
var RadioGroup = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n flex-direction: ", ";\n row-gap: ", ";\n column-gap: ", ";\n"])), function (props) {
|
|
265
265
|
return props.stacking;
|
|
266
266
|
}, function (props) {
|
|
267
267
|
return props.theme.groupVerticalGutter;
|