@dxc-technology/halstack-react 0.0.0-b4fde6b → 0.0.0-b5ec444
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 +1 -10
- package/BackgroundColorContext.js +4 -21
- package/HalstackContext.d.ts +51 -138
- package/HalstackContext.js +10 -35
- package/README.md +47 -0
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +24 -76
- package/accordion/Accordion.stories.tsx +1 -113
- package/accordion/Accordion.test.js +18 -33
- package/accordion/types.d.ts +5 -17
- package/accordion-group/AccordionGroup.js +15 -42
- package/accordion-group/AccordionGroup.stories.tsx +78 -77
- package/accordion-group/AccordionGroup.test.js +43 -71
- package/accordion-group/AccordionGroupAccordion.js +9 -21
- package/accordion-group/types.d.ts +6 -18
- package/action-icon/ActionIcon.d.ts +4 -0
- package/action-icon/ActionIcon.js +47 -0
- package/action-icon/ActionIcon.stories.tsx +41 -0
- package/action-icon/ActionIcon.test.js +64 -0
- package/action-icon/types.d.ts +26 -0
- package/alert/Alert.js +15 -50
- package/alert/Alert.test.js +28 -45
- package/alert/types.d.ts +5 -5
- package/badge/Badge.d.ts +1 -1
- package/badge/Badge.js +141 -43
- package/badge/Badge.stories.tsx +210 -0
- package/badge/Badge.test.js +30 -0
- package/badge/types.d.ts +52 -3
- package/bleed/Bleed.js +13 -21
- package/bleed/types.d.ts +2 -2
- package/box/Box.js +11 -33
- package/box/Box.test.js +1 -6
- package/box/types.d.ts +3 -3
- package/bulleted-list/BulletedList.js +18 -54
- package/bulleted-list/BulletedList.stories.tsx +1 -92
- package/bulleted-list/types.d.ts +5 -5
- package/button/Button.d.ts +1 -1
- package/button/Button.js +66 -99
- package/button/Button.stories.tsx +6 -87
- package/button/Button.test.js +19 -16
- package/button/types.d.ts +8 -4
- package/card/Card.d.ts +1 -1
- package/card/Card.js +39 -79
- package/card/Card.stories.tsx +0 -29
- package/card/Card.test.js +10 -21
- package/card/types.d.ts +6 -12
- package/checkbox/Checkbox.js +85 -120
- package/checkbox/Checkbox.stories.tsx +16 -54
- package/checkbox/Checkbox.test.js +107 -63
- package/checkbox/types.d.ts +8 -4
- package/chip/Chip.js +12 -31
- package/chip/Chip.stories.tsx +1 -1
- package/chip/Chip.test.js +15 -28
- package/chip/types.d.ts +4 -4
- package/common/coreTokens.d.ts +105 -14
- package/common/coreTokens.js +41 -24
- package/common/utils.js +2 -8
- package/common/variables.d.ts +51 -138
- package/common/variables.js +61 -155
- package/container/Container.d.ts +4 -0
- package/container/Container.js +194 -0
- package/container/Container.stories.tsx +214 -0
- package/container/types.d.ts +74 -0
- package/date-input/Calendar.js +15 -59
- package/date-input/DateInput.js +50 -96
- package/date-input/DateInput.stories.tsx +11 -30
- package/date-input/DateInput.test.js +674 -701
- package/date-input/DatePicker.js +11 -42
- package/date-input/Icons.d.ts +6 -6
- package/date-input/Icons.js +6 -23
- package/date-input/YearPicker.js +8 -34
- package/date-input/types.d.ts +27 -21
- package/dialog/Dialog.js +13 -40
- package/dialog/Dialog.stories.tsx +170 -0
- package/dialog/Dialog.test.js +125 -187
- package/dialog/types.d.ts +18 -13
- package/dropdown/Dropdown.js +48 -100
- package/dropdown/Dropdown.test.js +391 -378
- package/dropdown/DropdownMenu.js +8 -19
- package/dropdown/DropdownMenuItem.js +5 -17
- package/dropdown/types.d.ts +17 -19
- package/file-input/FileInput.js +180 -248
- package/file-input/FileInput.stories.tsx +1 -1
- package/file-input/FileInput.test.js +356 -354
- package/file-input/FileItem.js +14 -41
- package/file-input/types.d.ts +10 -10
- package/flex/Flex.js +25 -39
- package/flex/types.d.ts +6 -6
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +70 -102
- package/footer/Footer.stories.tsx +37 -6
- package/footer/Footer.test.js +21 -33
- package/footer/Icons.d.ts +3 -2
- package/footer/Icons.js +66 -7
- package/footer/types.d.ts +25 -21
- package/grid/Grid.d.ts +1 -1
- package/grid/Grid.js +2 -17
- package/grid/Grid.stories.tsx +38 -38
- package/grid/types.d.ts +10 -10
- package/header/Header.d.ts +2 -2
- package/header/Header.js +31 -114
- package/header/Header.stories.tsx +7 -71
- package/header/Header.test.js +12 -25
- package/header/Icons.d.ts +2 -2
- package/header/Icons.js +2 -7
- package/header/types.d.ts +5 -20
- package/heading/Heading.js +9 -31
- package/heading/Heading.test.js +70 -87
- package/heading/types.d.ts +7 -7
- package/image/Image.d.ts +4 -0
- package/image/Image.js +70 -0
- package/image/Image.stories.tsx +127 -0
- package/image/types.d.ts +72 -0
- package/image/types.js +5 -0
- package/inset/Inset.js +13 -21
- package/inset/types.d.ts +2 -2
- package/layout/ApplicationLayout.d.ts +3 -3
- package/layout/ApplicationLayout.js +28 -65
- package/layout/ApplicationLayout.stories.tsx +1 -1
- package/layout/Icons.d.ts +8 -5
- package/layout/Icons.js +51 -59
- package/layout/SidenavContext.d.ts +1 -1
- package/layout/SidenavContext.js +3 -9
- package/layout/types.d.ts +3 -3
- package/link/Link.js +21 -42
- package/link/Link.test.js +23 -41
- package/link/types.d.ts +14 -14
- package/main.d.ts +6 -4
- package/main.js +25 -59
- package/nav-tabs/NavTabs.js +17 -46
- package/nav-tabs/NavTabs.stories.tsx +7 -5
- package/nav-tabs/NavTabs.test.js +38 -44
- package/nav-tabs/Tab.js +22 -50
- package/nav-tabs/types.d.ts +9 -9
- package/number-input/NumberInput.d.ts +7 -0
- package/number-input/NumberInput.js +47 -37
- package/number-input/NumberInput.stories.tsx +42 -26
- package/number-input/NumberInput.test.js +859 -412
- package/number-input/types.d.ts +11 -5
- package/package.json +30 -28
- package/paginator/Icons.d.ts +5 -5
- package/paginator/Icons.js +5 -19
- package/paginator/Paginator.js +15 -43
- package/paginator/Paginator.test.js +224 -207
- package/paginator/types.d.ts +3 -3
- package/paragraph/Paragraph.js +3 -19
- package/paragraph/Paragraph.stories.tsx +0 -17
- package/password-input/Icons.d.ts +6 -0
- package/password-input/Icons.js +35 -0
- package/password-input/PasswordInput.js +57 -126
- package/password-input/PasswordInput.stories.tsx +1 -33
- package/password-input/PasswordInput.test.js +157 -140
- package/password-input/types.d.ts +8 -7
- package/progress-bar/ProgressBar.js +21 -53
- package/progress-bar/{ProgressBar.stories.jsx → ProgressBar.stories.tsx} +1 -1
- package/progress-bar/ProgressBar.test.js +35 -52
- package/progress-bar/types.d.ts +3 -3
- package/quick-nav/QuickNav.js +4 -27
- package/quick-nav/QuickNav.stories.tsx +1 -1
- package/quick-nav/types.d.ts +10 -10
- package/radio-group/Radio.d.ts +1 -1
- package/radio-group/Radio.js +22 -54
- package/radio-group/RadioGroup.js +37 -83
- package/radio-group/RadioGroup.stories.tsx +10 -10
- package/radio-group/RadioGroup.test.js +504 -470
- package/radio-group/types.d.ts +8 -8
- package/resultset-table/Icons.d.ts +7 -0
- package/{resultsetTable → resultset-table}/Icons.js +1 -5
- package/resultset-table/ResultsetTable.d.ts +7 -0
- package/{resultsetTable → resultset-table}/ResultsetTable.js +36 -64
- package/{resultsetTable → resultset-table}/ResultsetTable.stories.tsx +102 -5
- package/{resultsetTable → resultset-table}/ResultsetTable.test.js +138 -92
- package/{resultsetTable → resultset-table}/types.d.ts +13 -7
- package/resultset-table/types.js +5 -0
- package/select/Icons.d.ts +7 -7
- package/select/Icons.js +1 -5
- package/select/Listbox.js +13 -39
- package/select/Option.js +17 -27
- package/select/Select.js +87 -163
- package/select/Select.stories.tsx +3 -3
- package/select/Select.test.js +1946 -1804
- package/select/types.d.ts +14 -15
- package/sidenav/Icons.d.ts +4 -4
- package/sidenav/Icons.js +1 -5
- package/sidenav/Sidenav.js +26 -68
- package/sidenav/Sidenav.test.js +3 -10
- package/sidenav/types.d.ts +18 -18
- package/slider/Slider.js +68 -125
- package/slider/Slider.test.js +107 -103
- package/slider/types.d.ts +4 -4
- package/spinner/Spinner.js +16 -54
- package/spinner/Spinner.test.js +25 -34
- package/spinner/types.d.ts +3 -3
- package/status-light/StatusLight.d.ts +4 -0
- package/status-light/StatusLight.js +51 -0
- package/status-light/StatusLight.stories.tsx +74 -0
- package/status-light/StatusLight.test.js +25 -0
- package/status-light/types.d.ts +17 -0
- package/status-light/types.js +5 -0
- package/switch/Switch.js +49 -97
- package/switch/Switch.stories.tsx +0 -34
- package/switch/Switch.test.js +51 -96
- package/switch/types.d.ts +4 -4
- package/table/ActionsCell.d.ts +4 -0
- package/table/ActionsCell.js +68 -0
- package/table/DropdownTheme.js +62 -0
- package/table/Table.d.ts +4 -1
- package/table/Table.js +24 -30
- package/table/{Table.stories.jsx → Table.stories.tsx} +304 -2
- package/table/Table.test.js +93 -6
- package/table/types.d.ts +45 -6
- package/tabs/Tab.js +17 -33
- package/tabs/Tabs.js +52 -129
- package/tabs/Tabs.stories.tsx +1 -1
- package/tabs/Tabs.test.js +62 -118
- package/tabs/types.d.ts +19 -19
- package/tag/Tag.js +21 -51
- package/tag/Tag.test.js +19 -30
- package/tag/types.d.ts +7 -7
- package/text-input/Icons.d.ts +5 -5
- package/text-input/Icons.js +1 -5
- package/text-input/Suggestion.js +9 -26
- package/text-input/Suggestions.d.ts +1 -1
- package/text-input/Suggestions.js +15 -65
- package/text-input/TextInput.js +218 -326
- package/text-input/TextInput.stories.tsx +48 -152
- package/text-input/TextInput.test.js +1227 -1194
- package/text-input/types.d.ts +25 -17
- package/textarea/Textarea.js +67 -109
- package/textarea/{Textarea.stories.jsx → Textarea.stories.tsx} +58 -100
- package/textarea/Textarea.test.js +150 -179
- package/textarea/types.d.ts +9 -5
- package/toggle-group/ToggleGroup.js +90 -107
- package/toggle-group/ToggleGroup.stories.tsx +7 -4
- package/toggle-group/ToggleGroup.test.js +68 -87
- package/toggle-group/types.d.ts +26 -17
- package/typography/Typography.js +4 -13
- package/typography/types.d.ts +1 -1
- package/useTheme.d.ts +48 -135
- package/useTheme.js +1 -8
- package/useTranslatedLabels.js +1 -7
- package/utils/BaseTypography.d.ts +2 -2
- package/utils/BaseTypography.js +16 -30
- package/utils/FocusLock.js +25 -39
- package/wizard/Wizard.js +14 -49
- package/wizard/Wizard.test.js +53 -80
- package/wizard/types.d.ts +6 -6
- package/card/ice-cream.jpg +0 -0
- package/number-input/NumberInputContext.d.ts +0 -4
- package/number-input/NumberInputContext.js +0 -19
- package/number-input/numberInputContextTypes.d.ts +0 -19
- package/resultsetTable/Icons.d.ts +0 -7
- package/resultsetTable/ResultsetTable.d.ts +0 -4
- package/slider/Slider.stories.tsx +0 -240
- /package/{resultsetTable → action-icon}/types.js +0 -0
- /package/{number-input/numberInputContextTypes.js → container/types.js} +0 -0
- /package/spinner/{Spinner.stories.jsx → Spinner.stories.tsx} +0 -0
package/button/Button.js
CHANGED
|
@@ -1,102 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports["default"] = void 0;
|
|
11
|
-
|
|
12
9
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
-
|
|
14
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
-
|
|
16
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
-
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
18
12
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
19
|
-
|
|
20
13
|
var _variables = require("../common/variables");
|
|
21
|
-
|
|
22
14
|
var _utils = require("../common/utils");
|
|
23
|
-
|
|
24
15
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
25
|
-
|
|
26
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
27
|
-
|
|
28
16
|
var _templateObject, _templateObject2, _templateObject3;
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
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; }
|
|
33
|
-
|
|
34
|
-
var sizes = {
|
|
35
|
-
small: "42px",
|
|
36
|
-
medium: "120px",
|
|
37
|
-
large: "240px",
|
|
38
|
-
fillParent: "100%",
|
|
39
|
-
fitContent: "fit-content"
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
var calculateWidth = function calculateWidth(margin, size) {
|
|
43
|
-
if (size === "fillParent") {
|
|
44
|
-
return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return sizes[size];
|
|
48
|
-
};
|
|
49
|
-
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
50
19
|
var DxcButton = function DxcButton(_ref) {
|
|
51
20
|
var _ref$label = _ref.label,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
21
|
+
label = _ref$label === void 0 ? "" : _ref$label,
|
|
22
|
+
_ref$mode = _ref.mode,
|
|
23
|
+
mode = _ref$mode === void 0 ? "primary" : _ref$mode,
|
|
24
|
+
_ref$disabled = _ref.disabled,
|
|
25
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
26
|
+
_ref$iconPosition = _ref.iconPosition,
|
|
27
|
+
iconPosition = _ref$iconPosition === void 0 ? "before" : _ref$iconPosition,
|
|
28
|
+
title = _ref.title,
|
|
29
|
+
_ref$type = _ref.type,
|
|
30
|
+
type = _ref$type === void 0 ? "button" : _ref$type,
|
|
31
|
+
icon = _ref.icon,
|
|
32
|
+
_ref$onClick = _ref.onClick,
|
|
33
|
+
_onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
34
|
+
margin = _ref.margin,
|
|
35
|
+
_ref$size = _ref.size,
|
|
36
|
+
size = _ref$size === void 0 ? "fitContent" : _ref$size,
|
|
37
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
38
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
70
39
|
var colorsTheme = (0, _useTheme["default"])();
|
|
71
|
-
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
72
40
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
73
41
|
theme: colorsTheme.button
|
|
74
42
|
}, /*#__PURE__*/_react["default"].createElement(Button, {
|
|
75
|
-
|
|
76
|
-
mode: mode !== "primary" && mode !== "secondary" && mode !== "text" ? "primary" : mode,
|
|
43
|
+
"aria-label": title,
|
|
77
44
|
disabled: disabled,
|
|
78
|
-
tabIndex: disabled ? -1 : tabIndex,
|
|
79
|
-
backgroundType: backgroundType,
|
|
80
|
-
size: size,
|
|
81
|
-
margin: margin,
|
|
82
45
|
onClick: function onClick() {
|
|
83
46
|
_onClick();
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
label:
|
|
90
|
-
|
|
91
|
-
|
|
47
|
+
},
|
|
48
|
+
tabIndex: disabled ? -1 : tabIndex,
|
|
49
|
+
title: title,
|
|
50
|
+
type: type,
|
|
51
|
+
$mode: mode !== "primary" && mode !== "secondary" && mode !== "text" ? "primary" : mode,
|
|
52
|
+
hasLabel: label ? true : false,
|
|
53
|
+
hasIcon: icon ? true : false,
|
|
54
|
+
iconPosition: iconPosition,
|
|
55
|
+
size: size,
|
|
56
|
+
margin: margin
|
|
57
|
+
}, label && /*#__PURE__*/_react["default"].createElement(LabelContainer, null, label), icon && /*#__PURE__*/_react["default"].createElement(IconContainer, null, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
92
58
|
src: icon
|
|
93
|
-
}) : icon)
|
|
94
|
-
icon: icon,
|
|
95
|
-
iconPosition: iconPosition
|
|
96
|
-
}, label)));
|
|
59
|
+
}) : icon)));
|
|
97
60
|
};
|
|
98
|
-
|
|
99
|
-
|
|
61
|
+
var sizes = {
|
|
62
|
+
small: "42px",
|
|
63
|
+
medium: "120px",
|
|
64
|
+
large: "240px",
|
|
65
|
+
fillParent: "100%",
|
|
66
|
+
fitContent: "fit-content"
|
|
67
|
+
};
|
|
68
|
+
var calculateWidth = function calculateWidth(margin, size) {
|
|
69
|
+
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
70
|
+
};
|
|
71
|
+
var getButtonStyles = function getButtonStyles($mode, theme) {
|
|
72
|
+
return "\n border-color: ".concat($mode === "secondary" ? theme.secondaryBorderColor : "", ";\n border-radius: ").concat($mode === "primary" ? theme.primaryBorderRadius : $mode === "secondary" ? theme.secondaryBorderRadius : theme.textBorderRadius, ";\n border-width: ").concat($mode === "primary" ? theme.primaryBorderThickness : $mode === "secondary" ? theme.secondaryBorderThickness : theme.textBorderThickness, ";\n border-style: ").concat($mode === "primary" ? theme.primaryBorderStyle : $mode === "secondary" ? theme.secondaryBorderStyle : theme.textBorderStyle, ";\n font-family: ").concat($mode === "primary" ? theme.primaryFontFamily : $mode === "secondary" ? theme.secondaryFontFamily : theme.textFontFamily, ";\n font-size: ").concat($mode === "primary" ? theme.primaryFontSize : $mode === "secondary" ? theme.secondaryFontSize : theme.textFontSize, ";\n font-weight: ").concat($mode === "primary" ? theme.primaryFontWeight : $mode === "secondary" ? theme.secondaryFontWeight : theme.textFontWeight, ";\n background-color: ").concat($mode === "primary" ? theme.primaryBackgroundColor : $mode === "secondary" ? theme.secondaryBackgroundColor : theme.textBackgroundColor, ";\n color: ").concat($mode === "primary" ? theme.primaryFontColor : $mode === "secondary" ? theme.secondaryFontColor : theme.textFontColor, ";\n ");
|
|
73
|
+
};
|
|
74
|
+
var getButtonStates = function getButtonStates(disabled, $mode, theme) {
|
|
75
|
+
return "\n &:hover {\n background-color: ".concat($mode === "primary" ? theme.primaryHoverBackgroundColor : $mode === "secondary" ? theme.secondaryHoverBackgroundColor : theme.textHoverBackgroundColor, ";\n color: ").concat($mode === "secondary" ? theme.secondaryHoverFontColor : "", ";\n }\n &:focus {\n border-color: ").concat($mode === "secondary" ? "transparent" : "", ";\n }\n &:active {\n background-color: ").concat($mode === "primary" ? theme.primaryActiveBackgroundColor : $mode === "secondary" ? theme.secondaryActiveBackgroundColor : theme.textActiveBackgroundColor, ";\n color: ").concat($mode === "secondary" ? theme.secondaryHoverFontColor : "", ";\n border-color: ").concat($mode === "secondary" ? "transparent" : "", ";\n outline: none;\n box-shadow: ").concat(!disabled ? "0 0 0 2px ".concat(theme.focusBorderColor) : "", ";\n }\n &:disabled {\n cursor: not-allowed;\n background-color: ").concat($mode === "primary" ? theme.primaryDisabledBackgroundColor : $mode === "secondary" ? theme.secondaryDisabledBackgroundColor : theme.textDisabledBackgroundColor, ";\n color: ").concat($mode === "primary" ? theme.primaryDisabledFontColor : $mode === "secondary" ? theme.secondaryDisabledFontColor : theme.textDisabledFontColor, ";\n border-color: ").concat($mode === "secondary" ? theme.secondaryDisabledBorderColor : "", ";\n }\n");
|
|
76
|
+
};
|
|
77
|
+
var Button = _styledComponents["default"].button(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n flex-direction: ", ";\n gap: 0.5rem;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: 40px;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n box-shadow: 0 0 0 2px transparent;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n cursor: pointer;\n\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ", ";\n }\n\n ", "\n ", "\n"])), function (props) {
|
|
78
|
+
return props.iconPosition === "after" ? "row" : "row-reverse";
|
|
79
|
+
}, function (props) {
|
|
80
|
+
return calculateWidth(props.margin, props.size);
|
|
81
|
+
}, function (props) {
|
|
100
82
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
101
83
|
}, function (props) {
|
|
102
84
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
@@ -106,16 +88,14 @@ var Button = _styledComponents["default"].button(_templateObject || (_templateOb
|
|
|
106
88
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
107
89
|
}, function (props) {
|
|
108
90
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
109
|
-
}, function (props) {
|
|
110
|
-
return calculateWidth(props.margin, props.size);
|
|
111
|
-
}, function (props) {
|
|
112
|
-
return props.theme.paddingLeft;
|
|
113
|
-
}, function (props) {
|
|
114
|
-
return props.theme.paddingRight;
|
|
115
91
|
}, function (props) {
|
|
116
92
|
return props.theme.paddingTop;
|
|
117
93
|
}, function (props) {
|
|
118
94
|
return props.theme.paddingBottom;
|
|
95
|
+
}, function (props) {
|
|
96
|
+
return props.hasIcon && !props.hasLabel ? props.theme.paddingLeft : "calc(".concat(props.theme.paddingLeft, " + 8px)");
|
|
97
|
+
}, function (props) {
|
|
98
|
+
return props.hasIcon && !props.hasLabel ? props.theme.paddingRight : "calc(".concat(props.theme.paddingRight, " + 8px)");
|
|
119
99
|
}, function (props) {
|
|
120
100
|
return props.theme.fontFamily;
|
|
121
101
|
}, function (props) {
|
|
@@ -125,29 +105,16 @@ var Button = _styledComponents["default"].button(_templateObject || (_templateOb
|
|
|
125
105
|
}, function (props) {
|
|
126
106
|
return props.theme.labelLetterSpacing;
|
|
127
107
|
}, function (props) {
|
|
128
|
-
return props.
|
|
108
|
+
return props.theme.focusBorderColor;
|
|
109
|
+
}, function (props) {
|
|
110
|
+
return getButtonStyles(props.$mode, props.theme);
|
|
129
111
|
}, function (props) {
|
|
130
|
-
|
|
131
|
-
backgroundType = props.backgroundType,
|
|
132
|
-
disabled = props.disabled;
|
|
133
|
-
return "\n border-radius: ".concat(props.mode === "primary" ? props.theme.primaryBorderRadius : props.mode === "secondary" ? props.theme.secondaryBorderRadius : props.theme.textBorderRadius, ";\n border-width: ").concat(props.mode === "primary" ? props.theme.primaryBorderThickness : props.mode === "secondary" ? props.theme.secondaryBorderThickness : props.theme.textBorderThickness, ";\n border-style: ").concat(mode === "primary" ? props.theme.primaryBorderStyle : mode === "secondary" ? props.theme.secondaryBorderStyle : props.theme.textBorderStyle, ";\n font-family: ").concat(mode === "primary" ? props.theme.primaryFontFamily : mode === "secondary" ? props.theme.secondaryFontFamily : props.theme.textFontFamily, ";\n font-size: ").concat(mode === "primary" ? props.theme.primaryFontSize : mode === "secondary" ? props.theme.secondaryFontSize : props.theme.textFontSize, ";\n font-weight: ").concat(mode === "primary" ? props.theme.primaryFontWeight : mode === "secondary" ? props.theme.secondaryFontWeight : props.theme.textFontWeight, ";\n background-color: ").concat(mode === "primary" ? backgroundType === "dark" ? props.theme.primaryBackgroundColorOnDark : props.theme.primaryBackgroundColor : mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryBackgroundColorOnDark : props.theme.secondaryBackgroundColor : backgroundType === "dark" ? props.theme.textBackgroundColorOnDark : props.theme.textBackgroundColor, ";\n color: ").concat(mode === "primary" ? backgroundType === "dark" ? props.theme.primaryFontColorOnDark : props.theme.primaryFontColor : mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryFontColorOnDark : props.theme.secondaryFontColor : backgroundType === "dark" ? props.theme.textFontColorOnDark : props.theme.textFontColor, ";\n border-color: ").concat(mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryBorderColorOnDark : props.theme.secondaryBorderColor : "", ";\n &:hover {\n background-color: ").concat(mode === "primary" ? backgroundType === "dark" ? props.theme.primaryHoverBackgroundColorOnDark : props.theme.primaryHoverBackgroundColor : mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryHoverBackgroundColorOnDark : props.theme.secondaryHoverBackgroundColor : backgroundType === "dark" ? props.theme.textHoverBackgroundColorOnDark : props.theme.textHoverBackgroundColor, ";\n color: ").concat(mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor : "", ";\n }\n &:focus {\n border-color: ").concat(mode === "secondary" ? "transparent" : "", ";\n }\n &:active {\n background-color: ").concat(mode === "primary" ? backgroundType === "dark" ? props.theme.primaryActiveBackgroundColorOnDark : props.theme.primaryActiveBackgroundColor : mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryActiveBackgroundColorOnDark : props.theme.secondaryActiveBackgroundColor : backgroundType === "dark" ? props.theme.textActiveBackgroundColorOnDark : props.theme.textActiveBackgroundColor, ";\n color: ").concat(mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor : "", ";\n border-color: ").concat(mode === "secondary" ? "transparent" : "", ";\n outline: none;\n box-shadow: ").concat(!disabled ? "0 0 0 2px ".concat(backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor) : "", ";\n }\n &:disabled {\n cursor: not-allowed;\n background-color: ").concat(mode === "primary" ? backgroundType === "dark" ? props.theme.primaryDisabledBackgroundColorOnDark : props.theme.primaryDisabledBackgroundColor : mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryDisabledBackgroundColorOnDark : props.theme.secondaryDisabledBackgroundColor : backgroundType === "dark" ? props.theme.textDisabledBackgroundColorOnDark : props.theme.textDisabledBackgroundColor, ";\n color: ").concat(mode === "primary" ? backgroundType === "dark" ? props.theme.primaryDisabledFontColorOnDark : props.theme.primaryDisabledFontColor : mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryDisabledFontColorOnDark : props.theme.secondaryDisabledFontColor : backgroundType === "dark" ? props.theme.textDisabledFontColorOnDark : props.theme.textDisabledFontColor, ";\n border-color: ").concat(mode === "secondary" ? backgroundType === "dark" ? props.theme.secondaryDisabledBorderColorOnDark : props.theme.secondaryDisabledBorderColor : "", ";\n }\n ");
|
|
112
|
+
return getButtonStates(props.disabled, props.$mode, props.theme);
|
|
134
113
|
});
|
|
135
|
-
|
|
136
|
-
var LabelContainer = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n line-height: ", ";\n font-size: ", ";\n text-overflow: ellipsis;\n overflow: hidden;\n text-transform: none;\n white-space: nowrap;\n margin-right: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
114
|
+
var LabelContainer = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n line-height: ", ";\n font-size: ", ";\n text-overflow: ellipsis;\n overflow: hidden;\n text-transform: none;\n white-space: nowrap;\n"])), function (props) {
|
|
137
115
|
return props.theme.labelFontLineHeight;
|
|
138
116
|
}, function (props) {
|
|
139
117
|
return props.theme.fontSize;
|
|
140
|
-
}, function (props) {
|
|
141
|
-
return !props.icon || props.iconPosition === "before" ? "8px" : "0px";
|
|
142
|
-
}, function (props) {
|
|
143
|
-
return !props.icon || props.iconPosition === "after" ? "8px" : "0px";
|
|
144
118
|
});
|
|
145
|
-
|
|
146
|
-
var
|
|
147
|
-
return !props.label ? "0px" : props.iconPosition === "after" && props.label !== "" && "8px" || "8px";
|
|
148
|
-
}, function (props) {
|
|
149
|
-
return !props.label ? "0px" : props.iconPosition === "before" && props.label !== "" && "8px" || "8px";
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
var _default = DxcButton;
|
|
153
|
-
exports["default"] = _default;
|
|
119
|
+
var IconContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n\n img,\n svg {\n height: 24px;\n width: 24px;\n }\n"])));
|
|
120
|
+
var _default = exports["default"] = DxcButton;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { BackgroundColorProvider } from "../BackgroundColorContext";
|
|
3
2
|
import DxcButton from "./Button";
|
|
4
3
|
import DxcFlex from "./../flex/Flex";
|
|
5
4
|
import Title from "../../.storybook/components/Title";
|
|
6
5
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
7
|
-
import DarkContainer from "../../.storybook/components/DarkSection";
|
|
8
6
|
import { HalstackProvider } from "../HalstackContext";
|
|
9
7
|
|
|
10
8
|
export default {
|
|
@@ -165,88 +163,9 @@ export const Chromatic = () => (
|
|
|
165
163
|
<Title title="Only icon (image)" theme="light" level={4} />
|
|
166
164
|
<DxcButton
|
|
167
165
|
mode="text"
|
|
168
|
-
icon="https://
|
|
166
|
+
icon="https://www.freepnglogos.com/uploads/facebook-logo-design-1.png"
|
|
169
167
|
/>
|
|
170
168
|
</ExampleContainer>
|
|
171
|
-
<BackgroundColorProvider color="#333333">
|
|
172
|
-
<DarkContainer>
|
|
173
|
-
<Title title="Primary" theme="dark" level={2} />
|
|
174
|
-
<ExampleContainer>
|
|
175
|
-
<Title title="Enabled" theme="dark" level={4} />
|
|
176
|
-
<DxcButton label="Primary enabled" />
|
|
177
|
-
</ExampleContainer>
|
|
178
|
-
<ExampleContainer pseudoState="pseudo-hover">
|
|
179
|
-
<Title title="Hovered" theme="dark" level={4} />
|
|
180
|
-
<DxcButton label="Primary hovered" />
|
|
181
|
-
</ExampleContainer>
|
|
182
|
-
<ExampleContainer pseudoState="pseudo-focus">
|
|
183
|
-
<Title title="Focused" theme="dark" level={4} />
|
|
184
|
-
<DxcButton label="Primary focused" />
|
|
185
|
-
</ExampleContainer>
|
|
186
|
-
<ExampleContainer pseudoState="pseudo-active">
|
|
187
|
-
<Title title="Actived" theme="dark" level={4} />
|
|
188
|
-
<DxcButton label="Primary actived" />
|
|
189
|
-
</ExampleContainer>
|
|
190
|
-
<ExampleContainer>
|
|
191
|
-
<Title title="Disabled" theme="dark" level={4} />
|
|
192
|
-
<DxcButton label="Primary disabled" disabled icon={iconSVG} />
|
|
193
|
-
</ExampleContainer>
|
|
194
|
-
<ExampleContainer>
|
|
195
|
-
<Title title="With icon" theme="dark" level={4} />
|
|
196
|
-
<DxcButton label="Primary" icon={iconSVG} />
|
|
197
|
-
</ExampleContainer>
|
|
198
|
-
<Title title="Secondary" theme="dark" level={2} />
|
|
199
|
-
<ExampleContainer>
|
|
200
|
-
<Title title="Enabled" theme="dark" level={4} />
|
|
201
|
-
<DxcButton mode="secondary" label="Secondary enabled" />
|
|
202
|
-
</ExampleContainer>
|
|
203
|
-
<ExampleContainer pseudoState="pseudo-hover">
|
|
204
|
-
<Title title="Hovered" theme="dark" level={4} />
|
|
205
|
-
<DxcButton mode="secondary" label="Secondary hovered" />
|
|
206
|
-
</ExampleContainer>
|
|
207
|
-
<ExampleContainer pseudoState="pseudo-focus">
|
|
208
|
-
<Title title="Focused" theme="dark" level={4} />
|
|
209
|
-
<DxcButton mode="secondary" label="Secondary focused" />
|
|
210
|
-
</ExampleContainer>
|
|
211
|
-
<ExampleContainer pseudoState="pseudo-active">
|
|
212
|
-
<Title title="Actived" theme="dark" level={4} />
|
|
213
|
-
<DxcButton mode="secondary" label="Secondary actived" />
|
|
214
|
-
</ExampleContainer>
|
|
215
|
-
<ExampleContainer>
|
|
216
|
-
<Title title="Disabled" theme="dark" level={4} />
|
|
217
|
-
<DxcButton mode="secondary" disabled label="Secondary disabled" icon={iconSVG} />
|
|
218
|
-
</ExampleContainer>
|
|
219
|
-
<ExampleContainer>
|
|
220
|
-
<Title title="With icon" theme="dark" level={4} />
|
|
221
|
-
<DxcButton mode="secondary" label="Primary" icon={iconSVG} />
|
|
222
|
-
</ExampleContainer>
|
|
223
|
-
<Title title="Text" theme="dark" level={2} />
|
|
224
|
-
<ExampleContainer>
|
|
225
|
-
<Title title="Enabled" theme="dark" level={4} />
|
|
226
|
-
<DxcButton mode="text" label="Text enabled" />
|
|
227
|
-
</ExampleContainer>
|
|
228
|
-
<ExampleContainer pseudoState="pseudo-hover">
|
|
229
|
-
<Title title="Hovered" theme="dark" level={4} />
|
|
230
|
-
<DxcButton mode="text" label="Text hovered" />
|
|
231
|
-
</ExampleContainer>
|
|
232
|
-
<ExampleContainer pseudoState="pseudo-focus">
|
|
233
|
-
<Title title="Focused" theme="dark" level={4} />
|
|
234
|
-
<DxcButton mode="text" label="Text focused" />
|
|
235
|
-
</ExampleContainer>
|
|
236
|
-
<ExampleContainer pseudoState="pseudo-active">
|
|
237
|
-
<Title title="Actived" theme="dark" level={4} />
|
|
238
|
-
<DxcButton mode="text" label="Text actived" />
|
|
239
|
-
</ExampleContainer>
|
|
240
|
-
<ExampleContainer>
|
|
241
|
-
<Title title="Disabled" theme="dark" level={4} />
|
|
242
|
-
<DxcButton mode="text" label="Text disabled" disabled icon={iconSVG} />
|
|
243
|
-
</ExampleContainer>
|
|
244
|
-
<ExampleContainer>
|
|
245
|
-
<Title title="With icon" theme="dark" level={4} />
|
|
246
|
-
<DxcButton mode="text" label="Primary" icon={iconSVG} />
|
|
247
|
-
</ExampleContainer>
|
|
248
|
-
</DarkContainer>
|
|
249
|
-
</BackgroundColorProvider>
|
|
250
169
|
<Title title="Sizes" theme="light" level={2} />
|
|
251
170
|
<ExampleContainer>
|
|
252
171
|
<Title title="Small size" theme="light" level={4} />
|
|
@@ -254,7 +173,7 @@ export const Chromatic = () => (
|
|
|
254
173
|
</ExampleContainer>
|
|
255
174
|
<ExampleContainer>
|
|
256
175
|
<Title title="Medium size" theme="light" level={4} />
|
|
257
|
-
<DxcButton label="
|
|
176
|
+
<DxcButton label="MediumSize" size="medium" />
|
|
258
177
|
</ExampleContainer>
|
|
259
178
|
<ExampleContainer>
|
|
260
179
|
<Title title="Medium size with ellipsis" theme="light" level={4} />
|
|
@@ -262,11 +181,11 @@ export const Chromatic = () => (
|
|
|
262
181
|
</ExampleContainer>
|
|
263
182
|
<ExampleContainer>
|
|
264
183
|
<Title title="Medium size icon after" theme="light" level={4} />
|
|
265
|
-
<DxcButton label="
|
|
184
|
+
<DxcButton label="Medium" iconPosition="after" icon={iconSVG} size="medium" />
|
|
266
185
|
</ExampleContainer>
|
|
267
186
|
<ExampleContainer>
|
|
268
187
|
<Title title="Medium size icon before" theme="light" level={4} />
|
|
269
|
-
<DxcButton label="
|
|
188
|
+
<DxcButton label="Medium" iconPosition="before" icon={iconSVG} size="medium" />
|
|
270
189
|
</ExampleContainer>
|
|
271
190
|
<ExampleContainer>
|
|
272
191
|
<Title title="Medium size icon after with ellipsis" theme="light" level={4} />
|
|
@@ -286,11 +205,11 @@ export const Chromatic = () => (
|
|
|
286
205
|
</ExampleContainer>
|
|
287
206
|
<ExampleContainer>
|
|
288
207
|
<Title title="Large size icon after" theme="light" level={4} />
|
|
289
|
-
<DxcButton label="
|
|
208
|
+
<DxcButton label="LargeSizePrimaryButton" iconPosition="after" icon={iconSVG} size="large" />
|
|
290
209
|
</ExampleContainer>
|
|
291
210
|
<ExampleContainer>
|
|
292
211
|
<Title title="Large size icon before" theme="light" level={4} />
|
|
293
|
-
<DxcButton label="
|
|
212
|
+
<DxcButton label="LargeSizePrimaryButton" iconPosition="before" icon={iconSVG} size="large" />
|
|
294
213
|
</ExampleContainer>
|
|
295
214
|
<ExampleContainer>
|
|
296
215
|
<Title title="Large size icon after with ellipsis" theme="light" level={4} />
|
package/button/Button.test.js
CHANGED
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
|
|
7
5
|
var _react2 = require("@testing-library/react");
|
|
8
|
-
|
|
9
6
|
var _Button = _interopRequireDefault(require("./Button.tsx"));
|
|
10
|
-
|
|
11
7
|
describe("Button component tests", function () {
|
|
12
8
|
test("Button renders with correct text", function () {
|
|
13
9
|
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
label: "Button"
|
|
11
|
+
})),
|
|
12
|
+
getByText = _render.getByText;
|
|
18
13
|
expect(getByText("Button")).toBeTruthy();
|
|
19
14
|
});
|
|
20
15
|
test("Calls correct function on click", function () {
|
|
21
16
|
var onClick = jest.fn();
|
|
22
|
-
|
|
23
17
|
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
label: "Button",
|
|
19
|
+
onClick: onClick
|
|
20
|
+
})),
|
|
21
|
+
getByText = _render2.getByText;
|
|
29
22
|
var button = getByText("Button");
|
|
30
|
-
|
|
31
23
|
_react2.fireEvent.click(button);
|
|
32
|
-
|
|
33
24
|
expect(onClick).toHaveBeenCalled();
|
|
34
25
|
});
|
|
26
|
+
test("Renders with correct accessibility attributes", function () {
|
|
27
|
+
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
28
|
+
label: "Home",
|
|
29
|
+
title: "Go home",
|
|
30
|
+
tabIndex: 1
|
|
31
|
+
})),
|
|
32
|
+
getByRole = _render3.getByRole;
|
|
33
|
+
var button = getByRole("button");
|
|
34
|
+
expect(button.getAttribute("aria-label")).toBe("Go home");
|
|
35
|
+
expect(button.getAttribute("title")).toBe("Go home");
|
|
36
|
+
expect(button.getAttribute("tabindex")).toBe("1");
|
|
37
|
+
});
|
|
35
38
|
});
|
package/button/types.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
type Margin = {
|
|
4
4
|
top?: Space;
|
|
5
5
|
bottom?: Space;
|
|
6
6
|
left?: Space;
|
|
7
7
|
right?: Space;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
10
|
+
type Props = {
|
|
11
11
|
/**
|
|
12
12
|
* Text to be placed in the button.
|
|
13
13
|
*/
|
|
@@ -24,6 +24,10 @@ declare type Props = {
|
|
|
24
24
|
* Whether the icon should appear after or before the label.
|
|
25
25
|
*/
|
|
26
26
|
iconPosition?: "before" | "after";
|
|
27
|
+
/**
|
|
28
|
+
* Value for the HTML properties title and aria-label.
|
|
29
|
+
*/
|
|
30
|
+
title?: string;
|
|
27
31
|
/**
|
|
28
32
|
* 'type' html prop of the button.
|
|
29
33
|
*/
|
package/card/Card.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import CardPropsType from "./types";
|
|
3
|
-
declare const DxcCard: ({ imageSrc, imageBgColor, imagePadding, imagePosition, linkHref, onClick, imageCover, margin,
|
|
3
|
+
declare const DxcCard: ({ imageSrc, imageBgColor, imagePadding, imagePosition, linkHref, onClick, imageCover, margin, tabIndex, outlined, children, }: CardPropsType) => JSX.Element;
|
|
4
4
|
export default DxcCard;
|