@dxc-technology/halstack-react 0.0.0-9bd9511 → 0.0.0-9c20370
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 +3 -3
- package/BackgroundColorContext.js +12 -2
- package/HalstackContext.d.ts +1330 -7
- package/HalstackContext.js +84 -67
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +74 -55
- package/accordion/Accordion.stories.tsx +3 -101
- package/accordion/Accordion.test.js +34 -19
- package/accordion/types.d.ts +4 -16
- package/accordion-group/AccordionGroup.d.ts +4 -3
- package/accordion-group/AccordionGroup.js +49 -42
- package/accordion-group/AccordionGroup.stories.tsx +77 -76
- package/accordion-group/AccordionGroup.test.js +62 -54
- package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
- package/accordion-group/AccordionGroupAccordion.js +43 -0
- package/accordion-group/types.d.ts +6 -18
- package/alert/Alert.js +47 -20
- package/alert/Alert.test.js +46 -29
- package/alert/types.d.ts +3 -3
- package/badge/Badge.js +14 -2
- package/badge/types.d.ts +1 -1
- package/bleed/Bleed.js +21 -13
- package/bleed/Bleed.stories.tsx +1 -0
- package/bleed/types.d.ts +2 -2
- package/box/Box.d.ts +1 -1
- package/box/Box.js +33 -33
- package/box/Box.stories.tsx +25 -53
- package/box/Box.test.js +7 -2
- package/box/types.d.ts +3 -15
- package/bulleted-list/BulletedList.js +36 -9
- package/bulleted-list/BulletedList.stories.tsx +7 -1
- package/bulleted-list/types.d.ts +32 -5
- package/button/Button.d.ts +1 -1
- package/button/Button.js +83 -71
- package/button/Button.stories.tsx +4 -4
- package/button/Button.test.js +28 -8
- package/button/types.d.ts +8 -4
- package/card/Card.d.ts +1 -1
- package/card/Card.js +67 -62
- package/card/Card.stories.tsx +12 -42
- package/card/Card.test.js +22 -11
- package/card/types.d.ts +4 -10
- package/checkbox/Checkbox.js +71 -27
- package/checkbox/Checkbox.test.js +60 -33
- package/checkbox/types.d.ts +4 -4
- package/chip/Chip.js +51 -48
- package/chip/Chip.stories.tsx +25 -17
- package/chip/Chip.test.js +29 -17
- package/chip/types.d.ts +4 -4
- 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 +8 -3
- package/common/variables.d.ts +226 -175
- package/common/variables.js +956 -1133
- package/date-input/Calendar.js +55 -12
- package/date-input/DateInput.js +82 -35
- package/date-input/DateInput.test.js +351 -164
- package/date-input/DatePicker.js +38 -8
- package/date-input/Icons.js +12 -0
- package/date-input/YearPicker.js +30 -5
- package/date-input/types.d.ts +7 -7
- package/dialog/Dialog.d.ts +1 -1
- package/dialog/Dialog.js +83 -86
- package/dialog/Dialog.stories.tsx +127 -221
- package/dialog/Dialog.test.js +331 -18
- package/dialog/types.d.ts +1 -14
- package/dropdown/Dropdown.js +86 -32
- package/dropdown/Dropdown.test.js +211 -104
- package/dropdown/DropdownMenu.js +22 -8
- package/dropdown/DropdownMenuItem.js +15 -6
- package/dropdown/types.d.ts +8 -8
- package/file-input/FileInput.js +218 -134
- package/file-input/FileInput.test.js +343 -331
- package/file-input/FileItem.js +39 -12
- package/file-input/types.d.ts +10 -10
- package/flex/Flex.js +39 -25
- package/flex/Flex.stories.tsx +35 -26
- package/flex/types.d.ts +74 -9
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +80 -68
- package/footer/Footer.stories.tsx +12 -89
- package/footer/Footer.test.js +47 -40
- package/footer/Icons.js +4 -0
- package/footer/types.d.ts +15 -17
- 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 +72 -55
- package/header/Header.stories.tsx +7 -71
- package/header/Header.test.js +26 -13
- package/header/Icons.js +4 -0
- package/header/types.d.ts +2 -16
- package/heading/Heading.js +28 -7
- package/heading/Heading.test.js +88 -71
- package/heading/types.d.ts +3 -3
- package/inset/Inset.js +21 -13
- package/inset/Inset.stories.tsx +2 -1
- package/inset/types.d.ts +2 -2
- package/layout/ApplicationLayout.d.ts +5 -5
- package/layout/ApplicationLayout.js +57 -15
- package/layout/Icons.js +10 -0
- package/layout/SidenavContext.d.ts +1 -1
- package/layout/SidenavContext.js +4 -0
- package/layout/types.d.ts +5 -6
- package/link/Link.js +41 -21
- package/link/Link.test.js +42 -26
- package/link/types.d.ts +4 -4
- package/main.d.ts +2 -1
- package/main.js +55 -0
- package/nav-tabs/NavTabs.d.ts +2 -2
- package/nav-tabs/NavTabs.js +43 -16
- package/nav-tabs/NavTabs.stories.tsx +14 -0
- package/nav-tabs/NavTabs.test.js +44 -37
- package/nav-tabs/Tab.js +71 -45
- package/nav-tabs/types.d.ts +10 -11
- package/number-input/NumberInput.js +30 -20
- package/number-input/NumberInput.test.js +249 -113
- package/number-input/NumberInputContext.js +5 -0
- package/number-input/numberInputContextTypes.d.ts +1 -1
- package/number-input/types.d.ts +4 -4
- package/package.json +7 -7
- package/paginator/Icons.js +10 -0
- package/paginator/Paginator.js +39 -17
- package/paginator/Paginator.test.js +156 -104
- package/paginator/types.d.ts +1 -1
- package/paragraph/Paragraph.d.ts +3 -4
- package/paragraph/Paragraph.js +18 -8
- package/password-input/PasswordInput.js +51 -22
- package/password-input/PasswordInput.test.js +94 -51
- package/password-input/types.d.ts +4 -4
- package/progress-bar/ProgressBar.d.ts +2 -2
- package/progress-bar/ProgressBar.js +39 -14
- package/progress-bar/ProgressBar.test.js +53 -36
- package/progress-bar/types.d.ts +4 -3
- package/quick-nav/QuickNav.js +24 -2
- package/quick-nav/types.d.ts +2 -2
- package/radio-group/Radio.js +53 -22
- package/radio-group/RadioGroup.js +84 -41
- package/radio-group/RadioGroup.test.js +288 -186
- package/radio-group/types.d.ts +4 -4
- package/resultsetTable/Icons.js +3 -0
- package/resultsetTable/ResultsetTable.js +56 -21
- package/resultsetTable/ResultsetTable.test.js +75 -42
- package/resultsetTable/types.d.ts +5 -5
- package/select/Icons.js +3 -0
- package/select/Listbox.js +35 -10
- package/select/Option.js +24 -8
- package/select/Select.js +143 -56
- package/select/Select.test.js +839 -456
- package/select/types.d.ts +12 -12
- package/sidenav/Icons.d.ts +7 -0
- package/sidenav/Icons.js +51 -0
- package/sidenav/Sidenav.d.ts +2 -2
- package/sidenav/Sidenav.js +116 -104
- package/sidenav/Sidenav.stories.tsx +60 -60
- package/sidenav/Sidenav.test.js +10 -3
- package/sidenav/types.d.ts +26 -23
- package/slider/Slider.js +84 -38
- package/slider/Slider.test.js +104 -76
- package/slider/types.d.ts +4 -4
- package/spinner/Spinner.js +51 -28
- package/spinner/Spinner.stories.jsx +28 -28
- package/spinner/Spinner.test.js +35 -26
- package/spinner/types.d.ts +3 -3
- package/switch/Switch.js +66 -24
- package/switch/Switch.test.js +97 -52
- package/switch/types.d.ts +4 -4
- package/table/Table.js +22 -4
- package/table/Table.test.js +7 -2
- package/table/types.d.ts +3 -3
- package/tabs/Tab.js +39 -22
- package/tabs/Tabs.js +131 -62
- package/tabs/Tabs.test.js +122 -67
- package/tabs/types.d.ts +8 -8
- package/tag/Tag.js +54 -27
- package/tag/Tag.test.js +31 -20
- package/tag/types.d.ts +7 -7
- package/text-input/Icons.js +3 -0
- package/text-input/Suggestion.js +24 -8
- package/text-input/Suggestions.js +36 -11
- package/text-input/TextInput.js +144 -59
- package/text-input/TextInput.stories.tsx +1 -1
- package/text-input/TextInput.test.js +858 -539
- package/text-input/types.d.ts +9 -9
- package/textarea/Textarea.js +73 -38
- package/textarea/Textarea.test.js +173 -98
- package/textarea/types.d.ts +4 -4
- package/toggle-group/ToggleGroup.d.ts +2 -2
- package/toggle-group/ToggleGroup.js +59 -21
- package/toggle-group/ToggleGroup.test.js +72 -40
- package/toggle-group/types.d.ts +11 -11
- package/typography/Typography.d.ts +2 -2
- package/typography/Typography.js +23 -110
- package/typography/Typography.stories.tsx +1 -1
- package/typography/types.d.ts +1 -1
- package/useTheme.d.ts +1234 -1
- package/useTheme.js +6 -0
- package/useTranslatedLabels.d.ts +84 -2
- package/useTranslatedLabels.js +5 -0
- 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 +47 -13
- package/wizard/Wizard.test.js +81 -54
- package/wizard/types.d.ts +7 -8
- package/card/ice-cream.jpg +0 -0
- package/translatedLabelsType.d.ts +0 -82
- /package/{translatedLabelsType.js → grid/types.js} +0 -0
|
@@ -1,79 +1,107 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
4
5
|
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
8
10
|
exports["default"] = void 0;
|
|
11
|
+
|
|
9
12
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
+
|
|
10
14
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
+
|
|
11
16
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
+
|
|
12
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
13
20
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
|
+
|
|
14
22
|
var _uuid = require("uuid");
|
|
23
|
+
|
|
15
24
|
var _variables = require("../common/variables");
|
|
25
|
+
|
|
16
26
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
27
|
+
|
|
28
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
29
|
+
|
|
17
30
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
31
|
+
|
|
18
32
|
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); }
|
|
33
|
+
|
|
19
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
+
|
|
20
36
|
var DxcToggleGroup = function DxcToggleGroup(_ref) {
|
|
21
37
|
var label = _ref.label,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
helperText = _ref.helperText,
|
|
39
|
+
defaultValue = _ref.defaultValue,
|
|
40
|
+
value = _ref.value,
|
|
41
|
+
onChange = _ref.onChange,
|
|
42
|
+
_ref$disabled = _ref.disabled,
|
|
43
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
44
|
+
options = _ref.options,
|
|
45
|
+
margin = _ref.margin,
|
|
46
|
+
_ref$multiple = _ref.multiple,
|
|
47
|
+
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
|
|
48
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
49
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
34
50
|
var colorsTheme = (0, _useTheme["default"])();
|
|
51
|
+
|
|
35
52
|
var _useState = (0, _react.useState)(defaultValue !== null && defaultValue !== void 0 ? defaultValue : multiple ? [] : -1),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
53
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
54
|
+
selectedValue = _useState2[0],
|
|
55
|
+
setSelectedValue = _useState2[1];
|
|
56
|
+
|
|
39
57
|
var _useState3 = (0, _react.useState)("toggle-group-".concat((0, _uuid.v4)())),
|
|
40
|
-
|
|
41
|
-
|
|
58
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 1),
|
|
59
|
+
toggleGroupId = _useState4[0];
|
|
60
|
+
|
|
61
|
+
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
62
|
+
|
|
42
63
|
var handleToggleChange = function handleToggleChange(selectedOption) {
|
|
43
64
|
var newSelectedOptions;
|
|
65
|
+
|
|
44
66
|
if (value == null) {
|
|
45
67
|
if (multiple && Array.isArray(selectedValue)) {
|
|
46
68
|
newSelectedOptions = selectedValue.map(function (value) {
|
|
47
69
|
return value;
|
|
48
70
|
});
|
|
71
|
+
|
|
49
72
|
if (newSelectedOptions.includes(selectedOption)) {
|
|
50
73
|
var index = newSelectedOptions.indexOf(selectedOption);
|
|
51
74
|
newSelectedOptions.splice(index, 1);
|
|
52
75
|
} else {
|
|
53
76
|
newSelectedOptions.push(selectedOption);
|
|
54
77
|
}
|
|
78
|
+
|
|
55
79
|
setSelectedValue(newSelectedOptions);
|
|
56
80
|
} else setSelectedValue(selectedOption === selectedValue ? null : selectedOption);
|
|
57
81
|
} else if (multiple) {
|
|
58
82
|
newSelectedOptions = Array.isArray(value) ? value.map(function (v) {
|
|
59
83
|
return v;
|
|
60
84
|
}) : value;
|
|
85
|
+
|
|
61
86
|
if (newSelectedOptions.includes(selectedOption)) {
|
|
62
87
|
var _index = newSelectedOptions.indexOf(selectedOption);
|
|
88
|
+
|
|
63
89
|
newSelectedOptions.splice(_index, 1);
|
|
64
90
|
} else newSelectedOptions.push(selectedOption);
|
|
65
91
|
}
|
|
92
|
+
|
|
66
93
|
onChange === null || onChange === void 0 ? void 0 : onChange(multiple ? newSelectedOptions : selectedOption);
|
|
67
94
|
};
|
|
95
|
+
|
|
68
96
|
var handleKeyPress = function handleKeyPress(event, optionValue) {
|
|
69
97
|
event.preventDefault();
|
|
70
98
|
if (!disabled && (event.nativeEvent.code === "Enter" || event.nativeEvent.code === "Space")) handleToggleChange(optionValue);
|
|
71
99
|
};
|
|
100
|
+
|
|
72
101
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
73
|
-
theme: colorsTheme
|
|
102
|
+
theme: colorsTheme.toggleGroup
|
|
74
103
|
}, /*#__PURE__*/_react["default"].createElement(ToggleGroup, {
|
|
75
|
-
margin: margin
|
|
76
|
-
disabled: disabled
|
|
104
|
+
margin: margin
|
|
77
105
|
}, /*#__PURE__*/_react["default"].createElement(Label, {
|
|
78
106
|
htmlFor: toggleGroupId,
|
|
79
107
|
disabled: disabled
|
|
@@ -86,12 +114,12 @@ var DxcToggleGroup = function DxcToggleGroup(_ref) {
|
|
|
86
114
|
return /*#__PURE__*/_react["default"].createElement(ToggleContainer, {
|
|
87
115
|
selected: multiple ? value ? Array.isArray(value) && value.includes(option.value) : Array.isArray(selectedValue) && selectedValue.includes(option.value) : value ? option.value === value : option.value === selectedValue,
|
|
88
116
|
role: multiple ? "switch" : "radio",
|
|
117
|
+
backgroundType: backgroundType,
|
|
89
118
|
"aria-checked": multiple ? value ? Array.isArray(value) && value.includes(option.value) : Array.isArray(selectedValue) && selectedValue.includes(option.value) : value ? option.value === value : option.value === selectedValue,
|
|
90
119
|
tabIndex: !disabled ? tabIndex : -1,
|
|
91
120
|
onClick: function onClick() {
|
|
92
121
|
return !disabled && handleToggleChange(option.value);
|
|
93
122
|
},
|
|
94
|
-
isFirst: i === 0,
|
|
95
123
|
isLast: i === options.length - 1,
|
|
96
124
|
isIcon: option.icon,
|
|
97
125
|
optionLabel: option.label,
|
|
@@ -107,6 +135,7 @@ var DxcToggleGroup = function DxcToggleGroup(_ref) {
|
|
|
107
135
|
}) : option.icon), option.label && /*#__PURE__*/_react["default"].createElement(LabelContainer, null, option.label)));
|
|
108
136
|
}))));
|
|
109
137
|
};
|
|
138
|
+
|
|
110
139
|
var Label = _styledComponents["default"].label(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
111
140
|
return props.disabled ? props.theme.disabledLabelFontColor : props.theme.labelFontColor;
|
|
112
141
|
}, function (props) {
|
|
@@ -120,6 +149,7 @@ var Label = _styledComponents["default"].label(_templateObject || (_templateObje
|
|
|
120
149
|
}, function (props) {
|
|
121
150
|
return props.theme.labelLineHeight;
|
|
122
151
|
});
|
|
152
|
+
|
|
123
153
|
var HelperText = _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"])), function (props) {
|
|
124
154
|
return props.disabled ? props.theme.disabledHelperTextFontcolor : props.theme.helperTextFontColor;
|
|
125
155
|
}, function (props) {
|
|
@@ -133,6 +163,7 @@ var HelperText = _styledComponents["default"].span(_templateObject2 || (_templat
|
|
|
133
163
|
}, function (props) {
|
|
134
164
|
return props.theme.helperTextLineHeight;
|
|
135
165
|
});
|
|
166
|
+
|
|
136
167
|
var ToggleGroup = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n flex-direction: column;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
137
168
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
138
169
|
}, function (props) {
|
|
@@ -144,6 +175,7 @@ var ToggleGroup = _styledComponents["default"].div(_templateObject3 || (_templat
|
|
|
144
175
|
}, function (props) {
|
|
145
176
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
146
177
|
});
|
|
178
|
+
|
|
147
179
|
var OptionsContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n width: max-content;\n opacity: 1;\n height: calc(48px - 4px - 4px);\n border-width: ", ";\n border-style: ", ";\n border-radius: ", ";\n border-color: ", ";\n background-color: ", ";\n padding: 4px;\n margin-top: ", ";\n"])), function (props) {
|
|
148
180
|
return props.theme.containerBorderThickness;
|
|
149
181
|
}, function (props) {
|
|
@@ -157,11 +189,13 @@ var OptionsContainer = _styledComponents["default"].div(_templateObject4 || (_te
|
|
|
157
189
|
}, function (props) {
|
|
158
190
|
return props.theme.containerMarginTop;
|
|
159
191
|
});
|
|
192
|
+
|
|
160
193
|
var ToggleContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-right: ", ";\n\n ", "\n"])), function (props) {
|
|
161
194
|
return !props.isLast && "4px";
|
|
162
195
|
}, function (props) {
|
|
163
196
|
return "\n background-color: ".concat(props.selected ? props.disabled ? props.theme.selectedDisabledBackgroundColor : props.theme.selectedBackgroundColor : props.disabled ? props.theme.unselectedDisabledBackgroundColor : props.theme.unselectedBackgroundColor, ";\n border-width: ").concat(props.theme.optionBorderThickness, ";\n border-style: ").concat(props.theme.optionBorderStyle, ";\n border-radius: ").concat(props.theme.optionBorderRadius, ";\n padding-left: ").concat(props.optionLabel && props.isIcon || props.optionLabel && !props.isIcon ? props.theme.labelPaddingLeft : props.theme.iconPaddingLeft, ";\n padding-right: ").concat(props.optionLabel && props.isIcon || props.optionLabel && !props.isIcon ? props.theme.labelPaddingRight : props.theme.iconPaddingRight, ";\n ").concat(!props.disabled ? ":hover {\n background-color: ".concat(props.selected ? props.theme.selectedHoverBackgroundColor : props.theme.unselectedHoverBackgroundColor, ";\n }\n :active {\n background-color: ").concat(props.selected ? props.theme.selectedActiveBackgroundColor : props.theme.unselectedActiveBackgroundColor, ";\n color: #ffffff;\n } \n :focus {\n border-color: transparent;\n box-shadow: 0 0 0 ").concat(props.theme.optionFocusBorderThickness, " ").concat(props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor, ";\n }\n &:focus-visible {\n outline: none;\n }\n cursor: pointer;\n color: ").concat(props.selected ? props.theme.selectedFontColor : props.theme.unselectedFontColor, ";\n") : "color: ".concat(props.selected ? props.theme.selectedDisabledFontColor : props.theme.unselectedDisabledFontColor, ";\n cursor: not-allowed;"), "\n ");
|
|
164
197
|
});
|
|
198
|
+
|
|
165
199
|
var LabelContainer = _styledComponents["default"].span(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"])), function (props) {
|
|
166
200
|
return props.theme.optionLabelFontFamily;
|
|
167
201
|
}, function (props) {
|
|
@@ -171,10 +205,14 @@ var LabelContainer = _styledComponents["default"].span(_templateObject6 || (_tem
|
|
|
171
205
|
}, function (props) {
|
|
172
206
|
return props.theme.optionLabelFontWeight;
|
|
173
207
|
});
|
|
208
|
+
|
|
174
209
|
var OptionContent = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n align-items: center;\n"])));
|
|
210
|
+
|
|
175
211
|
var Icon = _styledComponents["default"].img(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])([""])));
|
|
212
|
+
|
|
176
213
|
var IconContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: ", ";\n height: 24px;\n width: 24px;\n overflow: hidden;\n display: flex;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
|
|
177
214
|
return props.optionLabel && props.theme.iconMarginRight;
|
|
178
215
|
});
|
|
216
|
+
|
|
179
217
|
var _default = DxcToggleGroup;
|
|
180
218
|
exports["default"] = _default;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
4
5
|
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
5
7
|
var _react2 = require("@testing-library/react");
|
|
6
|
-
|
|
8
|
+
|
|
9
|
+
var _ToggleGroup = _interopRequireDefault(require("./ToggleGroup.tsx"));
|
|
10
|
+
|
|
7
11
|
var options = [{
|
|
8
12
|
value: 1,
|
|
9
13
|
label: "Amazon"
|
|
@@ -20,11 +24,12 @@ var options = [{
|
|
|
20
24
|
describe("Toggle group component tests", function () {
|
|
21
25
|
test("Toggle group renders with correct labels", function () {
|
|
22
26
|
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ToggleGroup["default"], {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
label: "Toggle group label",
|
|
28
|
+
helperText: "Toggle group helper text",
|
|
29
|
+
options: options
|
|
30
|
+
})),
|
|
31
|
+
getByText = _render.getByText;
|
|
32
|
+
|
|
28
33
|
expect(getByText("Toggle group label")).toBeTruthy();
|
|
29
34
|
expect(getByText("Toggle group helper text")).toBeTruthy();
|
|
30
35
|
expect(getByText("Amazon")).toBeTruthy();
|
|
@@ -34,52 +39,71 @@ describe("Toggle group component tests", function () {
|
|
|
34
39
|
});
|
|
35
40
|
test("Uncontrolled toggle group calls correct function on change with value", function () {
|
|
36
41
|
var onChange = jest.fn();
|
|
42
|
+
|
|
37
43
|
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ToggleGroup["default"], {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
options: options,
|
|
45
|
+
onChange: onChange
|
|
46
|
+
})),
|
|
47
|
+
getByText = _render2.getByText;
|
|
48
|
+
|
|
42
49
|
var option = getByText("Ebay");
|
|
50
|
+
|
|
43
51
|
_react2.fireEvent.click(option);
|
|
52
|
+
|
|
44
53
|
expect(onChange).toHaveBeenCalledWith(2);
|
|
45
54
|
});
|
|
46
55
|
test("Controlled toggle group calls correct function on change with value", function () {
|
|
47
56
|
var onChange = jest.fn();
|
|
57
|
+
|
|
48
58
|
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ToggleGroup["default"], {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
options: options,
|
|
60
|
+
onChange: onChange,
|
|
61
|
+
value: 1
|
|
62
|
+
})),
|
|
63
|
+
getByText = _render3.getByText;
|
|
64
|
+
|
|
54
65
|
var option = getByText("Ebay");
|
|
66
|
+
|
|
55
67
|
_react2.fireEvent.click(option);
|
|
68
|
+
|
|
56
69
|
expect(onChange).toHaveBeenCalledWith(2);
|
|
57
70
|
});
|
|
58
71
|
test("Function on change is not called when disable", function () {
|
|
59
72
|
var onChange = jest.fn();
|
|
73
|
+
|
|
60
74
|
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ToggleGroup["default"], {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
75
|
+
options: options,
|
|
76
|
+
onChange: onChange,
|
|
77
|
+
disabled: true
|
|
78
|
+
})),
|
|
79
|
+
getByText = _render4.getByText;
|
|
80
|
+
|
|
66
81
|
var option = getByText("Ebay");
|
|
82
|
+
|
|
67
83
|
_react2.fireEvent.click(option);
|
|
84
|
+
|
|
68
85
|
expect(onChange).toHaveBeenCalledTimes(0);
|
|
69
86
|
});
|
|
70
87
|
test("Uncontrolled multiple toggle group calls correct function on change with value when is multiple", function () {
|
|
71
88
|
var onChange = jest.fn();
|
|
89
|
+
|
|
72
90
|
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ToggleGroup["default"], {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
91
|
+
options: options,
|
|
92
|
+
onChange: onChange,
|
|
93
|
+
multiple: true
|
|
94
|
+
})),
|
|
95
|
+
getAllByRole = _render5.getAllByRole;
|
|
96
|
+
|
|
78
97
|
var toggleOptions = getAllByRole("switch");
|
|
98
|
+
|
|
79
99
|
_react2.fireEvent.click(toggleOptions[0]);
|
|
100
|
+
|
|
80
101
|
expect(onChange).toHaveBeenCalledWith([1]);
|
|
102
|
+
|
|
81
103
|
_react2.fireEvent.click(toggleOptions[1]);
|
|
104
|
+
|
|
82
105
|
_react2.fireEvent.click(toggleOptions[3]);
|
|
106
|
+
|
|
83
107
|
expect(onChange).toHaveBeenCalledWith([1, 2, 4]);
|
|
84
108
|
expect(toggleOptions[0].getAttribute("aria-checked")).toBe("true");
|
|
85
109
|
expect(toggleOptions[1].getAttribute("aria-checked")).toBe("true");
|
|
@@ -87,36 +111,44 @@ describe("Toggle group component tests", function () {
|
|
|
87
111
|
});
|
|
88
112
|
test("Controlled multiple toggle returns always same values", function () {
|
|
89
113
|
var onChange = jest.fn();
|
|
114
|
+
|
|
90
115
|
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ToggleGroup["default"], {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
116
|
+
options: options,
|
|
117
|
+
onChange: onChange,
|
|
118
|
+
value: [1],
|
|
119
|
+
multiple: true
|
|
120
|
+
})),
|
|
121
|
+
getByText = _render6.getByText;
|
|
122
|
+
|
|
97
123
|
var option = getByText("Ebay");
|
|
124
|
+
|
|
98
125
|
_react2.fireEvent.click(option);
|
|
126
|
+
|
|
99
127
|
expect(onChange).toHaveBeenCalledWith([1, 2]);
|
|
100
128
|
var option2 = getByText("Google");
|
|
129
|
+
|
|
101
130
|
_react2.fireEvent.click(option2);
|
|
131
|
+
|
|
102
132
|
expect(onChange).toHaveBeenNthCalledWith(2, [1, 4]);
|
|
103
133
|
});
|
|
104
134
|
test("Single selection: Renders with correct default value", function () {
|
|
105
135
|
var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ToggleGroup["default"], {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
136
|
+
options: options,
|
|
137
|
+
defaultValue: 2
|
|
138
|
+
})),
|
|
139
|
+
getAllByRole = _render7.getAllByRole;
|
|
140
|
+
|
|
110
141
|
var toggleOptions = getAllByRole("radio");
|
|
111
142
|
expect(toggleOptions[1].getAttribute("aria-checked")).toBe("true");
|
|
112
143
|
});
|
|
113
144
|
test("Multiple selection: Renders with correct default value", function () {
|
|
114
145
|
var _render8 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_ToggleGroup["default"], {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
146
|
+
options: options,
|
|
147
|
+
defaultValue: [2, 4],
|
|
148
|
+
multiple: true
|
|
149
|
+
})),
|
|
150
|
+
getAllByRole = _render8.getAllByRole;
|
|
151
|
+
|
|
120
152
|
var toggleOptions = getAllByRole("switch");
|
|
121
153
|
expect(toggleOptions[1].getAttribute("aria-checked")).toBe("true");
|
|
122
154
|
expect(toggleOptions[3].getAttribute("aria-checked")).toBe("true");
|
package/toggle-group/types.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
-
type Margin = {
|
|
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
|
-
type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
10
|
-
type OptionCommons = {
|
|
9
|
+
declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
10
|
+
declare type OptionCommons = {
|
|
11
11
|
/**
|
|
12
12
|
* Number with the option inner value.
|
|
13
13
|
*/
|
|
14
14
|
value: number;
|
|
15
15
|
};
|
|
16
|
-
type OptionIcon = OptionCommons & {
|
|
16
|
+
declare type OptionIcon = OptionCommons & {
|
|
17
17
|
/**
|
|
18
18
|
* String with the option display value.
|
|
19
19
|
*/
|
|
@@ -23,7 +23,7 @@ type OptionIcon = OptionCommons & {
|
|
|
23
23
|
*/
|
|
24
24
|
icon: string | SVG;
|
|
25
25
|
};
|
|
26
|
-
type OptionLabel = OptionCommons & {
|
|
26
|
+
export declare type OptionLabel = OptionCommons & {
|
|
27
27
|
/**
|
|
28
28
|
* String with the option display value.
|
|
29
29
|
*/
|
|
@@ -33,8 +33,8 @@ type OptionLabel = OptionCommons & {
|
|
|
33
33
|
*/
|
|
34
34
|
icon?: string | SVG;
|
|
35
35
|
};
|
|
36
|
-
type Option = OptionIcon | OptionLabel;
|
|
37
|
-
type CommonProps = {
|
|
36
|
+
declare type Option = OptionIcon | OptionLabel;
|
|
37
|
+
declare type CommonProps = {
|
|
38
38
|
/**
|
|
39
39
|
* Text to be placed above the component.
|
|
40
40
|
*/
|
|
@@ -61,7 +61,7 @@ type CommonProps = {
|
|
|
61
61
|
*/
|
|
62
62
|
tabIndex?: number;
|
|
63
63
|
};
|
|
64
|
-
type SingleSelectionToggle = CommonProps & {
|
|
64
|
+
declare type SingleSelectionToggle = CommonProps & {
|
|
65
65
|
/**
|
|
66
66
|
* If true, the toggle group will support multiple selection. In that case, value must be an array of numbers with the keys of the selected values.
|
|
67
67
|
*/
|
|
@@ -81,7 +81,7 @@ type SingleSelectionToggle = CommonProps & {
|
|
|
81
81
|
*/
|
|
82
82
|
onChange?: (optionIndex: number) => void;
|
|
83
83
|
};
|
|
84
|
-
type MultipleSelectionToggle = CommonProps & {
|
|
84
|
+
declare type MultipleSelectionToggle = CommonProps & {
|
|
85
85
|
/**
|
|
86
86
|
* If true, the toggle group will support multiple selection. In that case, value must be an array of numbers with the keys of the selected values.
|
|
87
87
|
*/
|
|
@@ -101,5 +101,5 @@ type MultipleSelectionToggle = CommonProps & {
|
|
|
101
101
|
*/
|
|
102
102
|
onChange?: (optionIndex: number[]) => void;
|
|
103
103
|
};
|
|
104
|
-
type Props = SingleSelectionToggle | MultipleSelectionToggle;
|
|
104
|
+
declare type Props = SingleSelectionToggle | MultipleSelectionToggle;
|
|
105
105
|
export default Props;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import TypographyPropsTypes from "./types";
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
3
|
+
declare const DxcTypography: ({ textOverflow, whiteSpace, children, ...props }: TypographyPropsTypes) => JSX.Element;
|
|
4
|
+
export default DxcTypography;
|
package/typography/Typography.js
CHANGED
|
@@ -1,119 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
whiteSpace = _ref.whiteSpace,
|
|
30
|
-
children = _ref.children;
|
|
31
|
-
var componentContext = (0, _react.useContext)(TypographyContext);
|
|
32
|
-
var asValue = as !== null && as !== void 0 ? as : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.as) || "span";
|
|
33
|
-
var displayValue = display !== null && display !== void 0 ? display : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.display) || "inline";
|
|
34
|
-
var fontFamilyValue = fontFamily !== null && fontFamily !== void 0 ? fontFamily : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.fontFamily) || "Open Sans, sans-serif";
|
|
35
|
-
var fontSizeValue = fontSize !== null && fontSize !== void 0 ? fontSize : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.fontSize) || "1rem";
|
|
36
|
-
var fontStyleValue = fontStyle !== null && fontStyle !== void 0 ? fontStyle : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.fontStyle) || "normal";
|
|
37
|
-
var fontWeightValue = fontWeight !== null && fontWeight !== void 0 ? fontWeight : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.fontWeight) || "400";
|
|
38
|
-
var letterSpacingValue = letterSpacing !== null && letterSpacing !== void 0 ? letterSpacing : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.letterSpacing) || "0em";
|
|
39
|
-
var lineHeightValue = lineHeight !== null && lineHeight !== void 0 ? lineHeight : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.lineHeight) || "1.5em";
|
|
40
|
-
var textAlignValue = textAlign !== null && textAlign !== void 0 ? textAlign : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.textAlign) || "left";
|
|
41
|
-
var colorValue = color !== null && color !== void 0 ? color : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.color) || "#000000";
|
|
42
|
-
var textDecorationValue = textDecoration !== null && textDecoration !== void 0 ? textDecoration : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.textDecoration) || "none";
|
|
43
|
-
var textOverflowValue = textOverflow !== null && textOverflow !== void 0 ? textOverflow : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.textOverflow) || "unset";
|
|
44
|
-
var whiteSpaceValue = whiteSpace !== null && whiteSpace !== void 0 ? whiteSpace : (componentContext === null || componentContext === void 0 ? void 0 : componentContext.whiteSpace) || "normal";
|
|
45
|
-
return /*#__PURE__*/_react["default"].createElement(TypographyContext.Provider, {
|
|
46
|
-
value: {
|
|
47
|
-
as: asValue,
|
|
48
|
-
display: displayValue,
|
|
49
|
-
fontFamily: fontFamilyValue,
|
|
50
|
-
fontSize: fontSizeValue,
|
|
51
|
-
fontStyle: fontStyleValue,
|
|
52
|
-
fontWeight: fontWeightValue,
|
|
53
|
-
letterSpacing: letterSpacingValue,
|
|
54
|
-
lineHeight: lineHeightValue,
|
|
55
|
-
textAlign: textAlignValue,
|
|
56
|
-
color: colorValue,
|
|
57
|
-
textDecoration: textDecorationValue,
|
|
58
|
-
textOverflow: textOverflowValue,
|
|
59
|
-
whiteSpace: whiteSpaceValue
|
|
60
|
-
}
|
|
61
|
-
}, /*#__PURE__*/_react["default"].createElement(StyledTypography, {
|
|
62
|
-
as: asValue,
|
|
63
|
-
display: displayValue,
|
|
64
|
-
fontFamily: fontFamilyValue,
|
|
65
|
-
fontSize: fontSizeValue,
|
|
66
|
-
fontStyle: fontStyleValue,
|
|
67
|
-
fontWeight: fontWeightValue,
|
|
68
|
-
letterSpacing: letterSpacingValue,
|
|
69
|
-
lineHeight: lineHeightValue,
|
|
70
|
-
textAlign: textAlignValue,
|
|
71
|
-
color: colorValue,
|
|
72
|
-
textDecoration: textDecorationValue,
|
|
73
|
-
textOverflow: textOverflowValue,
|
|
74
|
-
whiteSpace: whiteSpaceValue
|
|
75
|
-
}, children));
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _BaseTypography = _interopRequireDefault(require("../utils/BaseTypography"));
|
|
17
|
+
|
|
18
|
+
var _excluded = ["textOverflow", "whiteSpace", "children"];
|
|
19
|
+
|
|
20
|
+
var DxcTypography = function DxcTypography(_ref) {
|
|
21
|
+
var textOverflow = _ref.textOverflow,
|
|
22
|
+
whiteSpace = _ref.whiteSpace,
|
|
23
|
+
children = _ref.children,
|
|
24
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
25
|
+
return /*#__PURE__*/_react["default"].createElement(_BaseTypography["default"], (0, _extends2["default"])({
|
|
26
|
+
textOverflow: textOverflow,
|
|
27
|
+
whiteSpace: whiteSpace == null && textOverflow != null && textOverflow !== "unset" ? "nowrap" : whiteSpace
|
|
28
|
+
}, props), children);
|
|
76
29
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return display;
|
|
80
|
-
}, function (_ref3) {
|
|
81
|
-
var color = _ref3.color;
|
|
82
|
-
return color;
|
|
83
|
-
}, function (_ref4) {
|
|
84
|
-
var fontFamily = _ref4.fontFamily;
|
|
85
|
-
return fontFamily;
|
|
86
|
-
}, function (_ref5) {
|
|
87
|
-
var fontSize = _ref5.fontSize;
|
|
88
|
-
return fontSize;
|
|
89
|
-
}, function (_ref6) {
|
|
90
|
-
var fontStyle = _ref6.fontStyle;
|
|
91
|
-
return fontStyle;
|
|
92
|
-
}, function (_ref7) {
|
|
93
|
-
var fontWeight = _ref7.fontWeight;
|
|
94
|
-
return fontWeight;
|
|
95
|
-
}, function (_ref8) {
|
|
96
|
-
var letterSpacing = _ref8.letterSpacing;
|
|
97
|
-
return letterSpacing;
|
|
98
|
-
}, function (_ref9) {
|
|
99
|
-
var textAlign = _ref9.textAlign;
|
|
100
|
-
return textAlign;
|
|
101
|
-
}, function (_ref10) {
|
|
102
|
-
var lineHeight = _ref10.lineHeight;
|
|
103
|
-
return lineHeight;
|
|
104
|
-
}, function (_ref11) {
|
|
105
|
-
var textDecoration = _ref11.textDecoration;
|
|
106
|
-
return textDecoration;
|
|
107
|
-
}, function (_ref12) {
|
|
108
|
-
var textOverflow = _ref12.textOverflow;
|
|
109
|
-
return textOverflow;
|
|
110
|
-
}, function (_ref13) {
|
|
111
|
-
var whiteSpace = _ref13.whiteSpace,
|
|
112
|
-
textOverflow = _ref13.textOverflow;
|
|
113
|
-
return whiteSpace !== "normal" ? whiteSpace : textOverflow !== "unset" ? "nowrap" : "normal";
|
|
114
|
-
}, function (_ref14) {
|
|
115
|
-
var textOverflow = _ref14.textOverflow;
|
|
116
|
-
return textOverflow !== "unset" ? "hidden" : "visible";
|
|
117
|
-
});
|
|
118
|
-
var _default = Typography;
|
|
30
|
+
|
|
31
|
+
var _default = DxcTypography;
|
|
119
32
|
exports["default"] = _default;
|
|
@@ -140,7 +140,7 @@ export const Chromatic = () => (
|
|
|
140
140
|
<ExampleContainer>
|
|
141
141
|
<Title title="Typography whitespace" theme="light" level={4} />
|
|
142
142
|
<div style={{ margin: "50px", border: "1px solid red", width: "125px" }}>
|
|
143
|
-
<DxcTypography
|
|
143
|
+
<DxcTypography fontSize="2rem">
|
|
144
144
|
{" "} Normal: A bunch of words you see.
|
|
145
145
|
</DxcTypography>
|
|
146
146
|
</div>
|
package/typography/types.d.ts
CHANGED