@dxc-technology/halstack-react 0.0.0-d3ac293 → 0.0.0-d3df47e
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 +24 -139
- package/HalstackContext.js +11 -36
- package/README.md +47 -0
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +26 -83
- package/accordion/Accordion.stories.tsx +2 -114
- package/accordion/Accordion.test.js +18 -33
- package/accordion/types.d.ts +5 -17
- package/accordion-group/AccordionGroup.d.ts +4 -3
- package/accordion-group/AccordionGroup.js +27 -75
- package/accordion-group/AccordionGroup.stories.tsx +78 -77
- package/accordion-group/AccordionGroup.test.js +43 -71
- package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
- package/accordion-group/AccordionGroupAccordion.js +31 -0
- 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 +17 -56
- 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 +142 -42
- 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/Bleed.stories.tsx +1 -0
- package/bleed/types.d.ts +2 -2
- package/box/Box.d.ts +1 -1
- package/box/Box.js +16 -55
- package/box/Box.stories.tsx +25 -53
- package/box/Box.test.js +1 -6
- package/box/types.d.ts +3 -15
- package/bulleted-list/BulletedList.js +19 -53
- package/bulleted-list/BulletedList.stories.tsx +8 -93
- package/bulleted-list/types.d.ts +32 -5
- package/button/Button.d.ts +1 -1
- package/button/Button.js +66 -100
- package/button/Button.stories.tsx +9 -90
- 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 +47 -88
- package/card/Card.stories.tsx +12 -42
- 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 +34 -68
- package/chip/Chip.stories.tsx +25 -17
- package/chip/Chip.test.js +15 -28
- package/chip/types.d.ts +4 -4
- package/common/OpenSans.css +68 -80
- package/common/coreTokens.d.ts +237 -0
- package/common/coreTokens.js +184 -0
- package/common/utils.js +2 -8
- package/common/variables.d.ts +24 -282
- package/common/variables.js +860 -1125
- 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.d.ts +1 -1
- package/dialog/Dialog.js +15 -60
- package/dialog/Dialog.stories.tsx +215 -169
- package/dialog/Dialog.test.js +125 -187
- package/dialog/types.d.ts +18 -26
- package/dropdown/Dropdown.js +39 -93
- package/dropdown/Dropdown.test.js +391 -378
- package/dropdown/DropdownMenu.js +13 -20
- package/dropdown/DropdownMenuItem.js +5 -19
- package/dropdown/types.d.ts +17 -19
- package/file-input/FileInput.js +180 -249
- 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 +27 -39
- 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 +69 -116
- package/footer/Footer.stories.tsx +38 -95
- 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 -27
- package/grid/Grid.d.ts +7 -0
- package/grid/Grid.js +76 -0
- package/grid/Grid.stories.tsx +219 -0
- package/grid/types.d.ts +115 -0
- package/grid/types.js +5 -0
- package/header/Header.d.ts +4 -3
- package/header/Header.js +33 -116
- 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/Inset.stories.tsx +2 -1
- package/inset/types.d.ts +2 -2
- package/layout/ApplicationLayout.d.ts +5 -5
- 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 +5 -6
- package/link/Link.js +23 -44
- package/link/Link.test.js +23 -41
- package/link/types.d.ts +14 -14
- package/main.d.ts +7 -4
- package/main.js +32 -58
- package/nav-tabs/NavTabs.d.ts +2 -2
- package/nav-tabs/NavTabs.js +22 -54
- package/nav-tabs/NavTabs.stories.tsx +21 -5
- package/nav-tabs/NavTabs.test.js +38 -44
- package/nav-tabs/Tab.js +40 -72
- package/nav-tabs/types.d.ts +14 -15
- 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 +17 -47
- package/paginator/Paginator.test.js +229 -199
- package/paginator/types.d.ts +3 -3
- package/paragraph/Paragraph.d.ts +2 -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.d.ts +2 -2
- 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 +4 -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 +31 -63
- package/radio-group/RadioGroup.js +45 -93
- 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.d.ts +1 -1
- package/{resultsetTable → resultset-table}/ResultsetTable.js +33 -63
- package/{resultsetTable → resultset-table}/ResultsetTable.stories.tsx +19 -0
- package/{resultsetTable → resultset-table}/ResultsetTable.test.js +72 -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 +92 -166
- 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 +7 -0
- package/sidenav/Icons.js +47 -0
- package/sidenav/Sidenav.d.ts +2 -2
- package/sidenav/Sidenav.js +80 -150
- package/sidenav/Sidenav.stories.tsx +60 -60
- package/sidenav/Sidenav.test.js +3 -10
- package/sidenav/types.d.ts +31 -28
- package/slider/Slider.js +68 -126
- package/slider/Slider.test.js +107 -103
- package/slider/types.d.ts +4 -4
- package/spinner/Spinner.js +28 -72
- package/spinner/{Spinner.stories.jsx → Spinner.stories.tsx} +28 -28
- 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/Table.d.ts +1 -1
- package/table/Table.js +23 -30
- package/table/{Table.stories.jsx → Table.stories.tsx} +98 -0
- package/table/Table.test.js +1 -6
- package/table/types.d.ts +12 -6
- package/tabs/Tab.js +19 -36
- package/tabs/Tabs.js +61 -144
- package/tabs/Tabs.stories.tsx +1 -1
- package/tabs/Tabs.test.js +65 -121
- package/tabs/types.d.ts +19 -19
- package/tag/Tag.js +26 -58
- 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 +11 -28
- package/text-input/Suggestions.d.ts +1 -1
- package/text-input/Suggestions.js +15 -65
- package/text-input/TextInput.js +217 -318
- 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 +68 -111
- package/textarea/{Textarea.stories.jsx → Textarea.stories.tsx} +58 -100
- package/textarea/Textarea.test.js +151 -182
- package/textarea/types.d.ts +9 -5
- package/toggle-group/ToggleGroup.d.ts +2 -2
- package/toggle-group/ToggleGroup.js +91 -105
- 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 +21 -136
- 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 +28 -43
- package/wizard/Wizard.js +15 -50
- package/wizard/Wizard.test.js +53 -80
- package/wizard/types.d.ts +8 -9
- 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 → action-icon}/types.js +0 -0
- /package/{number-input/numberInputContextTypes.js → container/types.js} +0 -0
package/badge/types.d.ts
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
3
|
+
type ContextualProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Text to be placed in the badge.
|
|
6
|
+
*/
|
|
7
|
+
label: string;
|
|
8
|
+
/**
|
|
9
|
+
* The available badge modes.
|
|
10
|
+
*/
|
|
11
|
+
mode?: "contextual";
|
|
12
|
+
/**
|
|
13
|
+
* In notification mode, if the number entered as label is greater that this notification limit, +99 will be shown. If not, the entered text will be shown as label.
|
|
14
|
+
*/
|
|
15
|
+
notificationLimit?: never;
|
|
16
|
+
/**
|
|
17
|
+
* Affects the visual style of the badge. It can be used following semantic purposes or not.
|
|
18
|
+
*/
|
|
19
|
+
color?: "grey" | "blue" | "green" | "orange" | "red" | "yellow" | "purple";
|
|
4
20
|
};
|
|
21
|
+
type NotificationProps = {
|
|
22
|
+
/**
|
|
23
|
+
* Text to be placed in the badge.
|
|
24
|
+
*/
|
|
25
|
+
label?: number;
|
|
26
|
+
/**
|
|
27
|
+
* The available badge modes.
|
|
28
|
+
*/
|
|
29
|
+
mode: "notification";
|
|
30
|
+
/**
|
|
31
|
+
* In notification mode, if the number entered as label is greater that this notification limit, +99 will be shown. If not, the entered text will be shown as label.
|
|
32
|
+
*/
|
|
33
|
+
notificationLimit?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Affects the visual style of the badge. It can be used following semantic purposes or not.
|
|
36
|
+
*/
|
|
37
|
+
color?: never;
|
|
38
|
+
};
|
|
39
|
+
type CommonProps = {
|
|
40
|
+
/**
|
|
41
|
+
* Text representing advisory information related to the badge. Under the hood, this prop also serves as an accessible label for the component.
|
|
42
|
+
*/
|
|
43
|
+
title?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Element or path used as the icon that will be placed next to the badge label in contextual mode.
|
|
46
|
+
*/
|
|
47
|
+
icon?: string | SVG;
|
|
48
|
+
/**
|
|
49
|
+
* Size of the component.
|
|
50
|
+
*/
|
|
51
|
+
size?: "small" | "medium" | "large";
|
|
52
|
+
};
|
|
53
|
+
type Props = (ContextualProps | NotificationProps) & CommonProps;
|
|
5
54
|
export default Props;
|
package/bleed/Bleed.js
CHANGED
|
@@ -1,29 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = Bleed;
|
|
9
|
-
|
|
10
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
11
|
var _templateObject;
|
|
17
|
-
|
|
18
12
|
function Bleed(_ref) {
|
|
19
13
|
var space = _ref.space,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
horizontal = _ref.horizontal,
|
|
15
|
+
vertical = _ref.vertical,
|
|
16
|
+
top = _ref.top,
|
|
17
|
+
right = _ref.right,
|
|
18
|
+
bottom = _ref.bottom,
|
|
19
|
+
left = _ref.left,
|
|
20
|
+
children = _ref.children;
|
|
27
21
|
return /*#__PURE__*/_react["default"].createElement(StyledBleed, {
|
|
28
22
|
space: space,
|
|
29
23
|
horizontal: horizontal,
|
|
@@ -34,18 +28,16 @@ function Bleed(_ref) {
|
|
|
34
28
|
left: left
|
|
35
29
|
}, children);
|
|
36
30
|
}
|
|
37
|
-
|
|
38
31
|
function getSpacingValue(spacingName) {
|
|
39
32
|
return spacingName ? spacingName : "0rem";
|
|
40
33
|
}
|
|
41
|
-
|
|
42
34
|
var StyledBleed = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n"])), function (_ref2) {
|
|
43
35
|
var space = _ref2.space,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
36
|
+
horizontal = _ref2.horizontal,
|
|
37
|
+
vertical = _ref2.vertical,
|
|
38
|
+
top = _ref2.top,
|
|
39
|
+
right = _ref2.right,
|
|
40
|
+
bottom = _ref2.bottom,
|
|
41
|
+
left = _ref2.left;
|
|
50
42
|
return "\n margin: -".concat(getSpacingValue(top || vertical || space), " -").concat(getSpacingValue(right || horizontal || space), " -").concat(getSpacingValue(bottom || vertical || space), " -").concat(getSpacingValue(left || horizontal || space), ";\n");
|
|
51
43
|
});
|
package/bleed/Bleed.stories.tsx
CHANGED
package/bleed/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type Spacing = "0rem" | "0.125rem" | "0.25rem" | "0.5rem" | "1rem" | "1.5rem" | "2rem" | "3rem" | "4rem" | "5rem";
|
|
3
|
+
type Props = {
|
|
4
4
|
/**
|
|
5
5
|
* Applies the spacing scale to all sides.
|
|
6
6
|
*/
|
package/box/Box.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import BoxPropsType from "./types";
|
|
3
|
-
declare const DxcBox: ({ shadowDepth, display, children, margin,
|
|
3
|
+
declare const DxcBox: ({ shadowDepth, display, children, margin, size, }: BoxPropsType) => JSX.Element;
|
|
4
4
|
export default DxcBox;
|
package/box/Box.js
CHANGED
|
@@ -1,60 +1,40 @@
|
|
|
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
11
|
var _react = _interopRequireDefault(require("react"));
|
|
17
|
-
|
|
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 = require("../BackgroundColorContext");
|
|
27
|
-
|
|
28
16
|
var _templateObject;
|
|
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
|
-
|
|
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; }
|
|
34
19
|
var DxcBox = function DxcBox(_ref) {
|
|
35
20
|
var _ref$shadowDepth = _ref.shadowDepth,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
size = _ref$size === void 0 ? "fitContent" : _ref$size;
|
|
21
|
+
shadowDepth = _ref$shadowDepth === void 0 ? 2 : _ref$shadowDepth,
|
|
22
|
+
_ref$display = _ref.display,
|
|
23
|
+
display = _ref$display === void 0 ? "inline-flex" : _ref$display,
|
|
24
|
+
children = _ref.children,
|
|
25
|
+
margin = _ref.margin,
|
|
26
|
+
_ref$size = _ref.size,
|
|
27
|
+
size = _ref$size === void 0 ? "fitContent" : _ref$size;
|
|
44
28
|
var colorsTheme = (0, _useTheme["default"])();
|
|
45
29
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
46
30
|
theme: colorsTheme.box
|
|
47
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
31
|
+
}, /*#__PURE__*/_react["default"].createElement(Box, {
|
|
48
32
|
shadowDepth: shadowDepth,
|
|
49
33
|
display: display,
|
|
50
34
|
margin: margin,
|
|
51
|
-
padding: padding,
|
|
52
35
|
size: size
|
|
53
|
-
},
|
|
54
|
-
color: colorsTheme.box.backgroundColor
|
|
55
|
-
}, children)));
|
|
36
|
+
}, children));
|
|
56
37
|
};
|
|
57
|
-
|
|
58
38
|
var sizes = {
|
|
59
39
|
small: "48px",
|
|
60
40
|
medium: "240px",
|
|
@@ -62,16 +42,10 @@ var sizes = {
|
|
|
62
42
|
fillParent: "100%",
|
|
63
43
|
fitContent: "fit-content"
|
|
64
44
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (size === "fillParent") {
|
|
68
|
-
return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), " -\n ").concat((0, _utils.getMargin)(padding, "left"), " - ").concat((0, _utils.getMargin)(padding, "right"), ")");
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return sizes[size];
|
|
45
|
+
var calculateWidth = function calculateWidth(margin, size) {
|
|
46
|
+
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
72
47
|
};
|
|
73
|
-
|
|
74
|
-
var StyledDxcBox = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: ", ";\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n overflow: hidden;\n width: ", ";\n background-color: ", ";\n box-shadow: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n"])), function (props) {
|
|
48
|
+
var Box = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: ", ";\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n overflow: hidden;\n width: ", ";\n background-color: ", ";\n box-shadow: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
75
49
|
return props.display;
|
|
76
50
|
}, function (props) {
|
|
77
51
|
return props.theme.borderRadius;
|
|
@@ -82,7 +56,7 @@ var StyledDxcBox = _styledComponents["default"].div(_templateObject || (_templat
|
|
|
82
56
|
}, function (props) {
|
|
83
57
|
return props.theme.borderColor;
|
|
84
58
|
}, function (props) {
|
|
85
|
-
return calculateWidth(props.margin, props.size
|
|
59
|
+
return calculateWidth(props.margin, props.size);
|
|
86
60
|
}, function (props) {
|
|
87
61
|
return props.theme.backgroundColor;
|
|
88
62
|
}, function (props) {
|
|
@@ -97,18 +71,5 @@ var StyledDxcBox = _styledComponents["default"].div(_templateObject || (_templat
|
|
|
97
71
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
98
72
|
}, function (props) {
|
|
99
73
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
100
|
-
}, function (_ref2) {
|
|
101
|
-
var padding = _ref2.padding;
|
|
102
|
-
return padding && (0, _typeof2["default"])(padding) !== "object" ? _variables.spaces[padding] : "0px";
|
|
103
|
-
}, function (props) {
|
|
104
|
-
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.top ? _variables.spaces[props.padding.top] : "";
|
|
105
|
-
}, function (props) {
|
|
106
|
-
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.right ? _variables.spaces[props.padding.right] : "";
|
|
107
|
-
}, function (props) {
|
|
108
|
-
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.bottom ? _variables.spaces[props.padding.bottom] : "";
|
|
109
|
-
}, function (props) {
|
|
110
|
-
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.left ? _variables.spaces[props.padding.left] : "";
|
|
111
74
|
});
|
|
112
|
-
|
|
113
|
-
var _default = DxcBox;
|
|
114
|
-
exports["default"] = _default;
|
|
75
|
+
var _default = exports["default"] = DxcBox;
|
package/box/Box.stories.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import Title from "../../.storybook/components/Title";
|
|
3
3
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
4
4
|
import DxcBox from "./Box";
|
|
5
|
+
import DxcInset from "../inset/Inset";
|
|
5
6
|
import { HalstackProvider } from "../HalstackContext";
|
|
6
7
|
|
|
7
8
|
export default {
|
|
@@ -19,99 +20,70 @@ export const Chromatic = () => (
|
|
|
19
20
|
<>
|
|
20
21
|
<Title title="Display flex" theme="light" level={2} />
|
|
21
22
|
<ExampleContainer>
|
|
22
|
-
<DxcBox display="flex"
|
|
23
|
-
Box
|
|
23
|
+
<DxcBox display="flex">
|
|
24
|
+
<DxcInset space="2rem">Box</DxcInset>
|
|
24
25
|
</DxcBox>
|
|
25
26
|
</ExampleContainer>
|
|
26
27
|
<Title title="ShadowDepth" theme="light" level={2} />
|
|
27
28
|
<ExampleContainer>
|
|
28
29
|
<Title title="ShadowDepth 0" theme="light" level={4} />
|
|
29
|
-
<DxcBox shadowDepth={0} margin="medium"
|
|
30
|
-
Box
|
|
30
|
+
<DxcBox shadowDepth={0} margin="medium">
|
|
31
|
+
<DxcInset space="2rem">Box</DxcInset>
|
|
31
32
|
</DxcBox>
|
|
32
33
|
</ExampleContainer>
|
|
33
34
|
<ExampleContainer>
|
|
34
35
|
<Title title="ShadowDepth 1" theme="light" level={4} />
|
|
35
|
-
<DxcBox shadowDepth={1} margin="medium"
|
|
36
|
-
Box
|
|
36
|
+
<DxcBox shadowDepth={1} margin="medium">
|
|
37
|
+
<DxcInset space="2rem">Box</DxcInset>
|
|
37
38
|
</DxcBox>
|
|
38
39
|
</ExampleContainer>
|
|
39
40
|
<ExampleContainer>
|
|
40
41
|
<Title title="ShadowDepth 2" theme="light" level={4} />
|
|
41
|
-
<DxcBox shadowDepth={2} margin="medium"
|
|
42
|
-
Box
|
|
42
|
+
<DxcBox shadowDepth={2} margin="medium">
|
|
43
|
+
<DxcInset space="2rem">Box</DxcInset>
|
|
43
44
|
</DxcBox>
|
|
44
45
|
</ExampleContainer>
|
|
45
|
-
<Title title="Paddings" theme="light" level={2} />
|
|
46
|
-
<ExampleContainer>
|
|
47
|
-
<Title title="Xxsmall padding" theme="light" level={4} />
|
|
48
|
-
<DxcBox padding="xxsmall">Box</DxcBox>
|
|
49
|
-
</ExampleContainer>
|
|
50
|
-
<ExampleContainer>
|
|
51
|
-
<Title title="Xsmall padding" theme="light" level={4} />
|
|
52
|
-
<DxcBox padding="xsmall">Box</DxcBox>
|
|
53
|
-
</ExampleContainer>
|
|
54
|
-
<ExampleContainer>
|
|
55
|
-
<Title title="Small padding" theme="light" level={4} />
|
|
56
|
-
<DxcBox padding="small">Box</DxcBox>
|
|
57
|
-
</ExampleContainer>
|
|
58
|
-
<ExampleContainer>
|
|
59
|
-
<Title title="Medium padding" theme="light" level={4} />
|
|
60
|
-
<DxcBox padding="medium">Box</DxcBox>
|
|
61
|
-
</ExampleContainer>
|
|
62
|
-
<ExampleContainer>
|
|
63
|
-
<Title title="Large padding" theme="light" level={4} />
|
|
64
|
-
<DxcBox padding="large">Box</DxcBox>
|
|
65
|
-
</ExampleContainer>
|
|
66
|
-
<ExampleContainer>
|
|
67
|
-
<Title title="Xlarge padding" theme="light" level={4} />
|
|
68
|
-
<DxcBox padding="xlarge">Box</DxcBox>
|
|
69
|
-
</ExampleContainer>
|
|
70
|
-
<ExampleContainer>
|
|
71
|
-
<Title title="Xxlarge padding" theme="light" level={4} />
|
|
72
|
-
<DxcBox padding="xxlarge">Box</DxcBox>
|
|
73
|
-
</ExampleContainer>
|
|
74
46
|
<Title title="Margins" theme="light" level={2} />
|
|
75
47
|
<ExampleContainer>
|
|
76
48
|
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
77
|
-
<DxcBox margin="xxsmall"
|
|
78
|
-
Box
|
|
49
|
+
<DxcBox margin="xxsmall">
|
|
50
|
+
<DxcInset space="2rem">Box</DxcInset>
|
|
79
51
|
</DxcBox>
|
|
80
52
|
</ExampleContainer>
|
|
81
53
|
<ExampleContainer>
|
|
82
54
|
<Title title="Xsmall margin" theme="light" level={4} />
|
|
83
|
-
<DxcBox margin="xsmall"
|
|
84
|
-
Box
|
|
55
|
+
<DxcBox margin="xsmall">
|
|
56
|
+
<DxcInset space="2rem">Box</DxcInset>
|
|
85
57
|
</DxcBox>
|
|
86
58
|
</ExampleContainer>
|
|
87
59
|
<ExampleContainer>
|
|
88
60
|
<Title title="Small margin" theme="light" level={4} />
|
|
89
|
-
<DxcBox margin="small"
|
|
90
|
-
Box
|
|
61
|
+
<DxcBox margin="small">
|
|
62
|
+
<DxcInset space="2rem">Box</DxcInset>
|
|
91
63
|
</DxcBox>
|
|
92
64
|
</ExampleContainer>
|
|
93
65
|
<ExampleContainer>
|
|
94
66
|
<Title title="Medium margin" theme="light" level={4} />
|
|
95
|
-
<DxcBox margin="medium"
|
|
96
|
-
Box
|
|
67
|
+
<DxcBox margin="medium">
|
|
68
|
+
<DxcInset space="2rem">Box</DxcInset>
|
|
97
69
|
</DxcBox>
|
|
98
70
|
</ExampleContainer>
|
|
99
71
|
<ExampleContainer>
|
|
100
72
|
<Title title="Large margin" theme="light" level={4} />
|
|
101
|
-
<DxcBox margin="large"
|
|
102
|
-
Box
|
|
73
|
+
<DxcBox margin="large">
|
|
74
|
+
<DxcInset space="2rem">Box</DxcInset>
|
|
103
75
|
</DxcBox>
|
|
104
76
|
</ExampleContainer>
|
|
105
77
|
<ExampleContainer>
|
|
106
78
|
<Title title="Xlarge margin" theme="light" level={4} />
|
|
107
|
-
<DxcBox margin="xlarge"
|
|
108
|
-
Box
|
|
79
|
+
<DxcBox margin="xlarge">
|
|
80
|
+
<DxcInset space="2rem">Box</DxcInset>
|
|
109
81
|
</DxcBox>
|
|
110
82
|
</ExampleContainer>
|
|
111
83
|
<ExampleContainer>
|
|
112
84
|
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
113
|
-
<DxcBox margin="xxlarge"
|
|
114
|
-
Box
|
|
85
|
+
<DxcBox margin="xxlarge">
|
|
86
|
+
<DxcInset space="2rem">Box</DxcInset>
|
|
115
87
|
</DxcBox>
|
|
116
88
|
</ExampleContainer>
|
|
117
89
|
<Title title="Sizes" theme="light" level={2} />
|
|
@@ -138,8 +110,8 @@ export const Chromatic = () => (
|
|
|
138
110
|
<Title title="Opinionated theme" theme="light" level={2} />
|
|
139
111
|
<ExampleContainer>
|
|
140
112
|
<HalstackProvider theme={opinionatedTheme}>
|
|
141
|
-
<DxcBox display="flex"
|
|
142
|
-
Box
|
|
113
|
+
<DxcBox display="flex">
|
|
114
|
+
<DxcInset space="2rem">Box</DxcInset>
|
|
143
115
|
</DxcBox>
|
|
144
116
|
</HalstackProvider>
|
|
145
117
|
</ExampleContainer>
|
package/box/Box.test.js
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
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 _Card = _interopRequireDefault(require("../card/Card.tsx"));
|
|
10
|
-
|
|
11
7
|
describe("Box component tests", function () {
|
|
12
8
|
test("Box renders with correct text", function () {
|
|
13
9
|
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Card["default"], null, "test-box")),
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
getByText = _render.getByText;
|
|
16
11
|
expect(getByText("test-box")).toBeTruthy();
|
|
17
12
|
});
|
|
18
13
|
});
|
package/box/types.d.ts
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
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
|
-
top?: Space;
|
|
11
|
-
bottom?: Space;
|
|
12
|
-
left?: Space;
|
|
13
|
-
right?: Space;
|
|
14
|
-
};
|
|
15
|
-
declare type Props = {
|
|
9
|
+
type Props = {
|
|
16
10
|
/**
|
|
17
11
|
* The size of the shadow to be displayed around the box.
|
|
18
12
|
*/
|
|
@@ -30,12 +24,6 @@ declare type Props = {
|
|
|
30
24
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
31
25
|
*/
|
|
32
26
|
margin?: Space | Margin;
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
|
|
35
|
-
* Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
36
|
-
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
37
|
-
*/
|
|
38
|
-
padding?: Space | Padding;
|
|
39
27
|
/**
|
|
40
28
|
* Size of the component.
|
|
41
29
|
*/
|
|
@@ -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,45 +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
|
-
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
})) : type === "icon" ? /*#__PURE__*/_react["default"].createElement(Bullet, null, /*#__PURE__*/_react["default"].createElement(Icon, {
|
|
59
|
-
backgroundType: backgroundType
|
|
60
|
-
}, icon)) : /*#__PURE__*/_react["default"].createElement(Bullet, null, /*#__PURE__*/_react["default"].createElement(Disc, {
|
|
61
|
-
backgroundType: backgroundType
|
|
62
|
-
})), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
63
|
-
color: backgroundType && backgroundType === "dark" ? colorsTheme.bulletedList.fontColorOnDark : colorsTheme.bulletedList.fontColor
|
|
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", {
|
|
39
|
+
src: icon
|
|
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
|
|
64
42
|
}, child)));
|
|
65
43
|
}))));
|
|
66
44
|
};
|
|
67
|
-
|
|
68
45
|
DxcBulletedList.Item = BulletedListItem;
|
|
69
|
-
|
|
70
46
|
var ListContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n ul,\n ol {\n padding: 0;\n margin: 0;\n }\n"])));
|
|
71
|
-
|
|
72
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"])));
|
|
73
|
-
|
|
74
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"])));
|
|
75
|
-
|
|
76
|
-
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 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) {
|
|
77
50
|
return props.theme.bulletMarginRight;
|
|
78
51
|
}, function (props) {
|
|
79
|
-
return props.
|
|
52
|
+
return props.theme.fontColor;
|
|
80
53
|
}, function (props) {
|
|
81
54
|
return props.theme.bulletIconHeight;
|
|
82
55
|
}, function (props) {
|
|
83
56
|
return props.theme.bulletIconWidth;
|
|
84
57
|
});
|
|
85
|
-
|
|
86
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) {
|
|
87
59
|
return props.theme.bulletMarginRight;
|
|
88
60
|
});
|
|
89
|
-
|
|
90
61
|
var Square = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n height: ", ";\n width: ", ";\n margin-right: ", ";\n"])), function (props) {
|
|
91
|
-
return props.
|
|
62
|
+
return props.theme.fontColor;
|
|
92
63
|
}, function (props) {
|
|
93
64
|
return props.theme.bulletHeight;
|
|
94
65
|
}, function (props) {
|
|
@@ -96,19 +67,17 @@ var Square = _styledComponents["default"].div(_templateObject6 || (_templateObje
|
|
|
96
67
|
}, function (props) {
|
|
97
68
|
return props.theme.bulletMarginRight;
|
|
98
69
|
});
|
|
99
|
-
|
|
100
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) {
|
|
101
71
|
return props.theme.bulletHeight;
|
|
102
72
|
}, function (props) {
|
|
103
73
|
return props.theme.bulletWidth;
|
|
104
74
|
}, function (props) {
|
|
105
|
-
return props.
|
|
75
|
+
return props.theme.fontColor;
|
|
106
76
|
}, function (props) {
|
|
107
77
|
return props.theme.bulletMarginRight;
|
|
108
78
|
});
|
|
109
|
-
|
|
110
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) {
|
|
111
|
-
return props.
|
|
80
|
+
return props.theme.fontColor;
|
|
112
81
|
}, function (props) {
|
|
113
82
|
return props.theme.bulletHeight;
|
|
114
83
|
}, function (props) {
|
|
@@ -116,8 +85,5 @@ var Disc = _styledComponents["default"].div(_templateObject8 || (_templateObject
|
|
|
116
85
|
}, function (props) {
|
|
117
86
|
return props.theme.bulletMarginRight;
|
|
118
87
|
});
|
|
119
|
-
|
|
120
|
-
var
|
|
121
|
-
|
|
122
|
-
var _default = DxcBulletedList;
|
|
123
|
-
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;
|