@dxc-technology/halstack-react 0.0.0-da4b2be → 0.0.0-da9270d
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 +23 -124
- 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/alert/Alert.js +15 -50
- package/alert/Alert.test.js +28 -45
- package/alert/types.d.ts +5 -5
- package/badge/Badge.js +4 -17
- package/badge/types.d.ts +1 -1
- 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 +17 -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 +23 -124
- package/common/variables.js +27 -135
- 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 +39 -93
- 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 +54 -112
- package/footer/Footer.stories.tsx +19 -95
- package/footer/Footer.test.js +21 -33
- package/footer/Icons.d.ts +2 -2
- package/footer/Icons.js +2 -7
- package/footer/types.d.ts +21 -29
- 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/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 +4 -3
- package/main.js +17 -58
- package/nav-tabs/NavTabs.js +11 -43
- package/nav-tabs/NavTabs.stories.tsx +1 -1
- package/nav-tabs/NavTabs.test.js +36 -43
- package/nav-tabs/Tab.js +16 -45
- package/nav-tabs/types.d.ts +9 -9
- package/number-input/NumberInput.d.ts +7 -0
- package/number-input/NumberInput.js +26 -35
- package/number-input/NumberInput.stories.tsx +42 -26
- package/number-input/NumberInput.test.js +700 -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/{resultsetTable → resultset-table}/ResultsetTable.js +23 -59
- package/{resultsetTable → resultset-table}/ResultsetTable.test.js +72 -92
- package/{resultsetTable → resultset-table}/types.d.ts +7 -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 +9 -26
- package/select/Select.js +70 -155
- 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/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/Table.js +5 -27
- package/table/Table.test.js +1 -6
- package/table/types.d.ts +8 -8
- package/tabs/Tab.js +10 -29
- package/tabs/Tabs.js +52 -129
- 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 +204 -284
- package/text-input/TextInput.stories.tsx +48 -152
- package/text-input/TextInput.test.js +1210 -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 +20 -121
- 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 +22 -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/slider/Slider.stories.tsx +0 -240
- /package/{resultsetTable → container}/types.js +0 -0
- /package/{number-input/numberInputContextTypes.js → image/types.js} +0 -0
- /package/{resultsetTable → resultset-table}/ResultsetTable.d.ts +0 -0
- /package/{resultsetTable → resultset-table}/ResultsetTable.stories.tsx +0 -0
- /package/spinner/{Spinner.stories.jsx → Spinner.stories.tsx} +0 -0
- /package/table/{Table.stories.jsx → Table.stories.tsx} +0 -0
|
@@ -1,47 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
var _typeof = 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 _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
-
|
|
14
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
16
11
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
17
|
-
|
|
18
12
|
var _Flex = _interopRequireDefault(require("../flex/Flex"));
|
|
19
|
-
|
|
20
13
|
var _Typography = _interopRequireDefault(require("../typography/Typography"));
|
|
21
|
-
|
|
22
14
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
23
|
-
|
|
24
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
25
|
-
|
|
26
15
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
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; }
|
|
31
|
-
|
|
16
|
+
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); }
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(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; }
|
|
32
18
|
var BulletedListItem = function BulletedListItem(_ref) {
|
|
33
19
|
var children = _ref.children;
|
|
34
20
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children);
|
|
35
21
|
};
|
|
36
|
-
|
|
37
22
|
var DxcBulletedList = function DxcBulletedList(_ref2) {
|
|
38
23
|
var children = _ref2.children,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
24
|
+
_ref2$type = _ref2.type,
|
|
25
|
+
type = _ref2$type === void 0 ? "disc" : _ref2$type,
|
|
26
|
+
_ref2$icon = _ref2.icon,
|
|
27
|
+
icon = _ref2$icon === void 0 ? "" : _ref2$icon;
|
|
43
28
|
var colorsTheme = (0, _useTheme["default"])();
|
|
44
|
-
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
45
29
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
46
30
|
theme: colorsTheme.bulletedList
|
|
47
31
|
}, /*#__PURE__*/_react["default"].createElement(ListContainer, null, /*#__PURE__*/_react["default"].createElement(_Flex["default"], {
|
|
@@ -50,47 +34,32 @@ var DxcBulletedList = function DxcBulletedList(_ref2) {
|
|
|
50
34
|
gap: "0.125rem"
|
|
51
35
|
}, _react["default"].Children.map(children, function (child, index) {
|
|
52
36
|
return /*#__PURE__*/_react["default"].createElement(ListItem, null, /*#__PURE__*/_react["default"].createElement(GeneralContent, null, type === "number" ? /*#__PURE__*/_react["default"].createElement(Number, null, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
53
|
-
color:
|
|
54
|
-
}, index + 1, ".")) : type === "square" ? /*#__PURE__*/_react["default"].createElement(Bullet, null, /*#__PURE__*/_react["default"].createElement(Square, {
|
|
55
|
-
backgroundType: backgroundType
|
|
56
|
-
})) : type === "circle" ? /*#__PURE__*/_react["default"].createElement(Bullet, null, /*#__PURE__*/_react["default"].createElement(Circle, {
|
|
57
|
-
backgroundType: backgroundType
|
|
58
|
-
})) : type === "icon" ? /*#__PURE__*/_react["default"].createElement(Bullet, null, /*#__PURE__*/_react["default"].createElement(Icon, {
|
|
59
|
-
backgroundType: backgroundType
|
|
60
|
-
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
37
|
+
color: colorsTheme.bulletedList.fontColor
|
|
38
|
+
}, index + 1, ".")) : type === "square" ? /*#__PURE__*/_react["default"].createElement(Bullet, null, /*#__PURE__*/_react["default"].createElement(Square, null)) : type === "circle" ? /*#__PURE__*/_react["default"].createElement(Bullet, null, /*#__PURE__*/_react["default"].createElement(Circle, null)) : type === "icon" ? /*#__PURE__*/_react["default"].createElement(Bullet, null, /*#__PURE__*/_react["default"].createElement(Icon, null, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
61
39
|
src: icon
|
|
62
|
-
}) : icon)) : /*#__PURE__*/_react["default"].createElement(Bullet, null, /*#__PURE__*/_react["default"].createElement(Disc, {
|
|
63
|
-
|
|
64
|
-
})), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
65
|
-
color: backgroundType && backgroundType === "dark" ? colorsTheme.bulletedList.fontColorOnDark : colorsTheme.bulletedList.fontColor
|
|
40
|
+
}) : icon)) : /*#__PURE__*/_react["default"].createElement(Bullet, null, /*#__PURE__*/_react["default"].createElement(Disc, null)), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
41
|
+
color: colorsTheme.bulletedList.fontColor
|
|
66
42
|
}, child)));
|
|
67
43
|
}))));
|
|
68
44
|
};
|
|
69
|
-
|
|
70
45
|
DxcBulletedList.Item = BulletedListItem;
|
|
71
|
-
|
|
72
46
|
var ListContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n ul,\n ol {\n padding: 0;\n margin: 0;\n }\n"])));
|
|
73
|
-
|
|
74
47
|
var Bullet = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-self: flex-start;\n align-items: center;\n height: 1.5rem;\n"])));
|
|
75
|
-
|
|
76
48
|
var GeneralContent = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: grid;\n grid-template-columns: auto 1fr;\n align-items: center;\n"])));
|
|
77
|
-
|
|
78
|
-
var Icon = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n width: auto;\n margin-right: ", ";\n align-content: center;\n color: ", ";\n svg,\n img {\n height: ", ";\n width: ", ";\n }\n"])), function (props) {
|
|
49
|
+
var Icon = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n width: auto;\n margin-right: ", ";\n align-content: center;\n color: ", ";\n\n svg,\n img {\n height: ", ";\n width: ", ";\n }\n"])), function (props) {
|
|
79
50
|
return props.theme.bulletMarginRight;
|
|
80
51
|
}, function (props) {
|
|
81
|
-
return props.
|
|
52
|
+
return props.theme.fontColor;
|
|
82
53
|
}, function (props) {
|
|
83
54
|
return props.theme.bulletIconHeight;
|
|
84
55
|
}, function (props) {
|
|
85
56
|
return props.theme.bulletIconWidth;
|
|
86
57
|
});
|
|
87
|
-
|
|
88
58
|
var Number = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n user-select: none;\n margin-right: ", ";\n display: flex;\n box-sizing: border-box;\n align-self: flex-start;\n min-width: 0;\n"])), function (props) {
|
|
89
59
|
return props.theme.bulletMarginRight;
|
|
90
60
|
});
|
|
91
|
-
|
|
92
61
|
var Square = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n height: ", ";\n width: ", ";\n margin-right: ", ";\n"])), function (props) {
|
|
93
|
-
return props.
|
|
62
|
+
return props.theme.fontColor;
|
|
94
63
|
}, function (props) {
|
|
95
64
|
return props.theme.bulletHeight;
|
|
96
65
|
}, function (props) {
|
|
@@ -98,19 +67,17 @@ var Square = _styledComponents["default"].div(_templateObject6 || (_templateObje
|
|
|
98
67
|
}, function (props) {
|
|
99
68
|
return props.theme.bulletMarginRight;
|
|
100
69
|
});
|
|
101
|
-
|
|
102
70
|
var Circle = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n border-radius: 50%;\n border: 1px solid;\n border-color: ", ";\n margin-right: ", ";\n"])), function (props) {
|
|
103
71
|
return props.theme.bulletHeight;
|
|
104
72
|
}, function (props) {
|
|
105
73
|
return props.theme.bulletWidth;
|
|
106
74
|
}, function (props) {
|
|
107
|
-
return props.
|
|
75
|
+
return props.theme.fontColor;
|
|
108
76
|
}, function (props) {
|
|
109
77
|
return props.theme.bulletMarginRight;
|
|
110
78
|
});
|
|
111
|
-
|
|
112
79
|
var Disc = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n height: ", ";\n width: ", ";\n border-radius: 50%;\n margin-right: ", ";\n"])), function (props) {
|
|
113
|
-
return props.
|
|
80
|
+
return props.theme.fontColor;
|
|
114
81
|
}, function (props) {
|
|
115
82
|
return props.theme.bulletHeight;
|
|
116
83
|
}, function (props) {
|
|
@@ -118,8 +85,5 @@ var Disc = _styledComponents["default"].div(_templateObject8 || (_templateObject
|
|
|
118
85
|
}, function (props) {
|
|
119
86
|
return props.theme.bulletMarginRight;
|
|
120
87
|
});
|
|
121
|
-
|
|
122
|
-
var
|
|
123
|
-
|
|
124
|
-
var _default = DxcBulletedList;
|
|
125
|
-
exports["default"] = _default;
|
|
88
|
+
var ListItem = _styledComponents["default"].li(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n margin: 0px;\n padding: 0px;\n list-style: none;\n font-size: 1em;\n"])));
|
|
89
|
+
var _default = exports["default"] = DxcBulletedList;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import Title from "../../.storybook/components/Title";
|
|
4
|
-
import { BackgroundColorProvider } from "../BackgroundColorContext";
|
|
5
4
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
6
5
|
import DxcBulletedList from "./BulletedList";
|
|
7
6
|
|
|
8
7
|
export default {
|
|
9
|
-
title: "
|
|
8
|
+
title: "Bulleted List",
|
|
10
9
|
component: DxcBulletedList,
|
|
11
10
|
};
|
|
12
11
|
|
|
@@ -108,99 +107,9 @@ export const Chromatic = () => (
|
|
|
108
107
|
</DxcBulletedList>
|
|
109
108
|
</Container>
|
|
110
109
|
</ExampleContainer>
|
|
111
|
-
<BackgroundColorProvider color="#333333">
|
|
112
|
-
<DarkContainerForBulletedList>
|
|
113
|
-
<Title title="Icon list" theme="dark" level={4} />
|
|
114
|
-
<DxcBulletedList type="icon" icon={icon}>
|
|
115
|
-
<DxcBulletedList.Item>Code</DxcBulletedList.Item>
|
|
116
|
-
<DxcBulletedList.Item>Usage</DxcBulletedList.Item>
|
|
117
|
-
<DxcBulletedList.Item>Specifications</DxcBulletedList.Item>
|
|
118
|
-
</DxcBulletedList>
|
|
119
|
-
<Title title="Number list" theme="dark" level={4} />
|
|
120
|
-
<DxcBulletedList type="number">
|
|
121
|
-
<DxcBulletedList.Item>Code</DxcBulletedList.Item>
|
|
122
|
-
<DxcBulletedList.Item>Usage</DxcBulletedList.Item>
|
|
123
|
-
<DxcBulletedList.Item>Specifications</DxcBulletedList.Item>
|
|
124
|
-
</DxcBulletedList>
|
|
125
|
-
<Title title="Square" theme="dark" level={4} />
|
|
126
|
-
<DxcBulletedList type="square">
|
|
127
|
-
<DxcBulletedList.Item>Code</DxcBulletedList.Item>
|
|
128
|
-
<DxcBulletedList.Item>Usage</DxcBulletedList.Item>
|
|
129
|
-
<DxcBulletedList.Item>Specifications</DxcBulletedList.Item>
|
|
130
|
-
</DxcBulletedList>
|
|
131
|
-
<Title title="Circle" theme="dark" level={4} />
|
|
132
|
-
<DxcBulletedList type="circle">
|
|
133
|
-
<DxcBulletedList.Item>Code</DxcBulletedList.Item>
|
|
134
|
-
<DxcBulletedList.Item>Usage</DxcBulletedList.Item>
|
|
135
|
-
<DxcBulletedList.Item>Specifications</DxcBulletedList.Item>
|
|
136
|
-
</DxcBulletedList>
|
|
137
|
-
<Title title="Disc" theme="dark" level={4} />
|
|
138
|
-
<DxcBulletedList>
|
|
139
|
-
<DxcBulletedList.Item>Code</DxcBulletedList.Item>
|
|
140
|
-
<DxcBulletedList.Item>Usage</DxcBulletedList.Item>
|
|
141
|
-
<DxcBulletedList.Item>Specifications</DxcBulletedList.Item>
|
|
142
|
-
</DxcBulletedList>
|
|
143
|
-
<Title title="Multiple lines" theme="dark" level={4} />
|
|
144
|
-
<Container>
|
|
145
|
-
<Title title="Number" theme="dark" level={4} />
|
|
146
|
-
<DxcBulletedList type="number">
|
|
147
|
-
<DxcBulletedList.Item>
|
|
148
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
|
149
|
-
dolore magna aliqua.
|
|
150
|
-
</DxcBulletedList.Item>
|
|
151
|
-
<DxcBulletedList.Item>Text 2.</DxcBulletedList.Item>
|
|
152
|
-
</DxcBulletedList>
|
|
153
|
-
</Container>
|
|
154
|
-
<Container>
|
|
155
|
-
<Title title="Square" theme="dark" level={4} />
|
|
156
|
-
<DxcBulletedList type="square">
|
|
157
|
-
<DxcBulletedList.Item>
|
|
158
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
|
159
|
-
dolore magna aliqua.
|
|
160
|
-
</DxcBulletedList.Item>
|
|
161
|
-
<DxcBulletedList.Item>Text 2.</DxcBulletedList.Item>
|
|
162
|
-
</DxcBulletedList>
|
|
163
|
-
</Container>
|
|
164
|
-
<Container>
|
|
165
|
-
<Title title="Circle" theme="dark" level={4} />
|
|
166
|
-
<DxcBulletedList type="circle">
|
|
167
|
-
<DxcBulletedList.Item>
|
|
168
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
|
169
|
-
dolore magna aliqua.
|
|
170
|
-
</DxcBulletedList.Item>
|
|
171
|
-
<DxcBulletedList.Item>Text 2.</DxcBulletedList.Item>
|
|
172
|
-
</DxcBulletedList>
|
|
173
|
-
</Container>
|
|
174
|
-
<Title title="Disc" theme="dark" level={4} />
|
|
175
|
-
<Container>
|
|
176
|
-
<DxcBulletedList>
|
|
177
|
-
<DxcBulletedList.Item>
|
|
178
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
|
179
|
-
dolore magna aliqua.
|
|
180
|
-
</DxcBulletedList.Item>
|
|
181
|
-
<DxcBulletedList.Item>Text 2.</DxcBulletedList.Item>
|
|
182
|
-
</DxcBulletedList>
|
|
183
|
-
</Container>
|
|
184
|
-
<Container>
|
|
185
|
-
<Title title="Icon" theme="dark" level={4} />
|
|
186
|
-
<DxcBulletedList type="icon" icon={icon}>
|
|
187
|
-
<DxcBulletedList.Item>
|
|
188
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
|
189
|
-
dolore magna aliqua.
|
|
190
|
-
</DxcBulletedList.Item>
|
|
191
|
-
<DxcBulletedList.Item>Text 2.</DxcBulletedList.Item>
|
|
192
|
-
</DxcBulletedList>
|
|
193
|
-
</Container>
|
|
194
|
-
</DarkContainerForBulletedList>
|
|
195
|
-
</BackgroundColorProvider>
|
|
196
110
|
</>
|
|
197
111
|
);
|
|
198
112
|
|
|
199
113
|
const Container = styled.div`
|
|
200
114
|
width: 400px;
|
|
201
115
|
`;
|
|
202
|
-
|
|
203
|
-
const DarkContainerForBulletedList = styled.div`
|
|
204
|
-
background-color: #333333;
|
|
205
|
-
padding: 5px;
|
|
206
|
-
`;
|
package/bulleted-list/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
3
|
+
type IconProps = {
|
|
4
4
|
/**
|
|
5
5
|
* Defines the style of the bullet point in the list.
|
|
6
6
|
*/
|
|
@@ -14,7 +14,7 @@ declare type IconProps = {
|
|
|
14
14
|
*/
|
|
15
15
|
children: React.ReactNode;
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
type OtherProps = {
|
|
18
18
|
/**
|
|
19
19
|
* Defines the style of the bullet point in the list.
|
|
20
20
|
*/
|
|
@@ -28,9 +28,9 @@ declare type OtherProps = {
|
|
|
28
28
|
*/
|
|
29
29
|
children: React.ReactNode;
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
type Props = IconProps | OtherProps;
|
|
32
32
|
export default Props;
|
|
33
|
-
export
|
|
33
|
+
export type BulletedListItemPropsType = {
|
|
34
34
|
/**
|
|
35
35
|
* Text to be shown in the list.
|
|
36
36
|
*/
|
package/button/Button.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import ButtonPropsType from "./types";
|
|
3
|
-
declare const DxcButton: ({ label, mode, disabled, iconPosition, type, icon, onClick, margin, size, tabIndex, }: ButtonPropsType) => JSX.Element;
|
|
3
|
+
declare const DxcButton: ({ label, mode, disabled, iconPosition, title, type, icon, onClick, margin, size, tabIndex, }: ButtonPropsType) => JSX.Element;
|
|
4
4
|
export default DxcButton;
|
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;
|