@dxc-technology/halstack-react 0.0.0-fdc49d2 → 0.0.0-ff5083e
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/HalstackContext.d.ts +12 -0
- package/HalstackContext.js +295 -0
- package/accordion/Accordion.js +5 -27
- package/accordion/Accordion.stories.tsx +3 -3
- package/accordion-group/AccordionGroup.d.ts +1 -1
- package/accordion-group/AccordionGroup.js +13 -15
- package/accordion-group/AccordionGroup.stories.tsx +1 -1
- package/accordion-group/AccordionGroup.test.js +24 -6
- package/accordion-group/types.d.ts +4 -0
- package/alert/Alert.js +4 -1
- package/badge/Badge.d.ts +1 -1
- package/badge/Badge.js +5 -3
- package/badge/types.d.ts +1 -0
- package/bleed/Bleed.js +1 -34
- package/bleed/Bleed.stories.tsx +31 -32
- package/bleed/types.d.ts +1 -1
- package/box/Box.js +22 -32
- package/bulleted-list/BulletedList.d.ts +7 -0
- package/bulleted-list/BulletedList.js +120 -0
- package/bulleted-list/BulletedList.stories.tsx +203 -0
- package/bulleted-list/types.d.ts +11 -0
- package/{list → bulleted-list}/types.js +0 -0
- package/button/Button.js +14 -11
- package/card/Card.js +24 -27
- package/checkbox/Checkbox.d.ts +1 -1
- package/checkbox/Checkbox.js +38 -28
- package/checkbox/Checkbox.stories.tsx +124 -128
- package/checkbox/types.d.ts +3 -3
- package/common/variables.js +197 -84
- package/date-input/DateInput.js +38 -20
- package/date-input/DateInput.test.js +9 -22
- package/date-input/types.d.ts +12 -9
- package/dialog/Dialog.js +4 -32
- package/dropdown/Dropdown.js +13 -17
- package/file-input/FileInput.js +9 -6
- package/file-input/FileItem.js +7 -5
- package/footer/Footer.js +15 -88
- package/header/Header.js +27 -48
- package/header/Header.stories.tsx +46 -36
- package/header/Header.test.js +18 -2
- package/inset/Inset.js +1 -34
- package/inset/Inset.stories.tsx +32 -32
- package/inset/types.d.ts +25 -1
- package/layout/ApplicationLayout.d.ts +4 -3
- package/layout/ApplicationLayout.js +82 -114
- package/layout/ApplicationLayout.stories.tsx +14 -59
- package/layout/Icons.d.ts +5 -0
- package/layout/Icons.js +13 -2
- package/layout/SidenavContext.d.ts +5 -0
- package/layout/SidenavContext.js +19 -0
- package/layout/types.d.ts +5 -10
- package/link/Link.d.ts +3 -2
- package/link/Link.js +57 -74
- package/link/Link.stories.tsx +87 -52
- package/link/Link.test.js +7 -15
- package/link/types.d.ts +7 -23
- package/main.d.ts +6 -5
- package/main.js +37 -23
- package/number-input/NumberInput.test.js +2 -4
- package/number-input/types.d.ts +13 -10
- package/package.json +6 -5
- package/paginator/Paginator.js +17 -38
- package/paragraph/Paragraph.d.ts +6 -0
- package/paragraph/Paragraph.js +38 -0
- package/paragraph/Paragraph.stories.tsx +44 -0
- package/password-input/PasswordInput.js +7 -4
- package/password-input/PasswordInput.test.js +3 -6
- package/password-input/types.d.ts +14 -11
- package/progress-bar/ProgressBar.js +1 -1
- package/progress-bar/ProgressBar.stories.jsx +11 -11
- package/quick-nav/QuickNav.js +75 -23
- package/quick-nav/QuickNav.stories.tsx +13 -13
- package/quick-nav/types.d.ts +4 -8
- package/radio-group/Radio.js +1 -1
- package/radio-group/RadioGroup.js +8 -6
- package/select/Listbox.d.ts +4 -0
- package/select/Listbox.js +152 -0
- package/select/Option.js +1 -1
- package/select/Select.js +66 -161
- package/select/Select.stories.tsx +14 -2
- package/select/Select.test.js +335 -231
- package/select/types.d.ts +33 -11
- package/sidenav/Sidenav.d.ts +1 -1
- package/sidenav/Sidenav.js +20 -9
- package/slider/Slider.d.ts +1 -1
- package/slider/Slider.js +2 -1
- package/slider/Slider.stories.tsx +8 -8
- package/slider/Slider.test.js +31 -10
- package/slider/types.d.ts +4 -0
- package/spinner/Spinner.js +1 -1
- package/switch/Switch.d.ts +1 -1
- package/switch/Switch.js +19 -16
- package/switch/Switch.stories.tsx +8 -8
- package/switch/types.d.ts +2 -2
- package/tabs/Tabs.d.ts +1 -1
- package/tabs/Tabs.js +9 -11
- package/tabs/Tabs.stories.tsx +0 -8
- package/tabs/Tabs.test.js +26 -9
- package/tabs/types.d.ts +4 -0
- package/tabs-nav/NavTabs.d.ts +8 -0
- package/tabs-nav/NavTabs.js +125 -0
- package/tabs-nav/NavTabs.stories.tsx +170 -0
- package/tabs-nav/NavTabs.test.js +82 -0
- package/tabs-nav/Tab.d.ts +4 -0
- package/tabs-nav/Tab.js +132 -0
- package/tabs-nav/types.d.ts +53 -0
- package/{radio → tabs-nav}/types.js +0 -0
- package/tag/Tag.js +5 -8
- package/text-input/Suggestion.d.ts +4 -0
- package/text-input/Suggestion.js +55 -0
- package/text-input/TextInput.js +48 -76
- package/text-input/TextInput.test.js +22 -35
- package/text-input/types.d.ts +27 -12
- package/textarea/Textarea.js +10 -19
- package/textarea/types.d.ts +10 -7
- package/toggle-group/ToggleGroup.d.ts +1 -1
- package/toggle-group/ToggleGroup.js +5 -4
- package/toggle-group/ToggleGroup.stories.tsx +4 -4
- package/toggle-group/ToggleGroup.test.js +35 -4
- package/toggle-group/types.d.ts +8 -0
- package/typography/Typography.d.ts +4 -0
- package/typography/Typography.js +131 -0
- package/typography/Typography.stories.tsx +175 -0
- package/typography/types.d.ts +18 -0
- package/typography/types.js +5 -0
- package/typography/typographyContextTypes.d.ts +16 -0
- package/typography/typographyContextTypes.js +5 -0
- package/useTheme.js +2 -2
- package/useTranslatedLabels.d.ts +2 -0
- package/useTranslatedLabels.js +20 -0
- package/wizard/Wizard.js +35 -29
- package/ThemeContext.d.ts +0 -10
- package/ThemeContext.js +0 -243
- package/list/List.d.ts +0 -4
- package/list/List.js +0 -47
- package/list/List.stories.tsx +0 -95
- package/list/types.d.ts +0 -7
- package/radio/Radio.d.ts +0 -4
- package/radio/Radio.js +0 -174
- package/radio/Radio.stories.tsx +0 -192
- package/radio/Radio.test.js +0 -71
- package/radio/types.d.ts +0 -54
- package/text/Text.d.ts +0 -7
- package/text/Text.js +0 -30
- package/text/Text.stories.tsx +0 -19
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports["default"] = void 0;
|
|
11
|
+
|
|
12
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
16
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
17
|
+
|
|
18
|
+
var _Stack = _interopRequireDefault(require("../stack/Stack"));
|
|
19
|
+
|
|
20
|
+
var _Typography = _interopRequireDefault(require("../typography/Typography"));
|
|
21
|
+
|
|
22
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
23
|
+
|
|
24
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
25
|
+
|
|
26
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
27
|
+
|
|
28
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
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
|
+
|
|
32
|
+
var BulletedListItem = function BulletedListItem(_ref) {
|
|
33
|
+
var children = _ref.children;
|
|
34
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var DxcBulletedList = function DxcBulletedList(_ref2) {
|
|
38
|
+
var children = _ref2.children,
|
|
39
|
+
_ref2$type = _ref2.type,
|
|
40
|
+
type = _ref2$type === void 0 ? "disc" : _ref2$type,
|
|
41
|
+
_ref2$icon = _ref2.icon,
|
|
42
|
+
icon = _ref2$icon === void 0 ? "" : _ref2$icon;
|
|
43
|
+
var colorsTheme = (0, _useTheme["default"])();
|
|
44
|
+
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
45
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
46
|
+
theme: colorsTheme.bulletedList
|
|
47
|
+
}, /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
|
|
48
|
+
as: type === "number" ? "ol" : "ul",
|
|
49
|
+
gutter: "xxsmall"
|
|
50
|
+
}, _react["default"].Children.map(children, function (child, index) {
|
|
51
|
+
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"], {
|
|
52
|
+
color: backgroundType && backgroundType === "dark" ? colorsTheme.bulletedList.fontColorOnDark : colorsTheme.bulletedList.fontColor
|
|
53
|
+
}, index + 1, ".")) : type === "square" ? /*#__PURE__*/_react["default"].createElement(Bullet, null, /*#__PURE__*/_react["default"].createElement(Square, {
|
|
54
|
+
backgroundType: backgroundType
|
|
55
|
+
})) : type === "circle" ? /*#__PURE__*/_react["default"].createElement(Bullet, null, /*#__PURE__*/_react["default"].createElement(Circle, {
|
|
56
|
+
backgroundType: backgroundType
|
|
57
|
+
})) : type === "icon" ? /*#__PURE__*/_react["default"].createElement(Bullet, null, /*#__PURE__*/_react["default"].createElement(Icon, {
|
|
58
|
+
backgroundType: backgroundType
|
|
59
|
+
}, icon)) : /*#__PURE__*/_react["default"].createElement(Bullet, null, /*#__PURE__*/_react["default"].createElement(Disc, {
|
|
60
|
+
backgroundType: backgroundType
|
|
61
|
+
})), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
62
|
+
color: backgroundType && backgroundType === "dark" ? colorsTheme.bulletedList.fontColorOnDark : colorsTheme.bulletedList.fontColor
|
|
63
|
+
}, child)));
|
|
64
|
+
})));
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
DxcBulletedList.Item = BulletedListItem;
|
|
68
|
+
|
|
69
|
+
var Bullet = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-self: flex-start;\n align-items: center;\n height: 1.5rem;\n"])));
|
|
70
|
+
|
|
71
|
+
var GeneralContent = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: grid;\n grid-template-columns: auto 1fr;\n align-items: center;\n"])));
|
|
72
|
+
|
|
73
|
+
var Icon = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (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) {
|
|
74
|
+
return props.theme.bulletMarginRight;
|
|
75
|
+
}, function (props) {
|
|
76
|
+
return props.backgroundType && props.backgroundType === "dark" ? props.theme.fontColorOnDark : props.theme.fontColor;
|
|
77
|
+
}, function (props) {
|
|
78
|
+
return props.theme.bulletIconHeight;
|
|
79
|
+
}, function (props) {
|
|
80
|
+
return props.theme.bulletIconWidth;
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
var Number = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (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) {
|
|
84
|
+
return props.theme.bulletMarginRight;
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
var Square = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n height: ", ";\n width: ", ";\n margin-right: ", ";\n"])), function (props) {
|
|
88
|
+
return props.backgroundType && props.backgroundType === "dark" ? props.theme.fontColorOnDark : props.theme.fontColor;
|
|
89
|
+
}, function (props) {
|
|
90
|
+
return props.theme.bulletHeight;
|
|
91
|
+
}, function (props) {
|
|
92
|
+
return props.theme.bulletWidth;
|
|
93
|
+
}, function (props) {
|
|
94
|
+
return props.theme.bulletMarginRight;
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
var Circle = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n border-radius: 50%;\n border: 1px solid;\n border-color: ", ";\n margin-right: ", ";\n"])), function (props) {
|
|
98
|
+
return props.theme.bulletHeight;
|
|
99
|
+
}, function (props) {
|
|
100
|
+
return props.theme.bulletWidth;
|
|
101
|
+
}, function (props) {
|
|
102
|
+
return props.backgroundType && props.backgroundType === "dark" ? props.theme.fontColorOnDark : props.theme.fontColor;
|
|
103
|
+
}, function (props) {
|
|
104
|
+
return props.theme.bulletMarginRight;
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
var Disc = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n height: ", ";\n width: ", ";\n border-radius: 50%;\n margin-right: ", ";\n"])), function (props) {
|
|
108
|
+
return props.backgroundType && props.backgroundType === "dark" ? props.theme.fontColorOnDark : props.theme.fontColor;
|
|
109
|
+
}, function (props) {
|
|
110
|
+
return props.theme.bulletHeight;
|
|
111
|
+
}, function (props) {
|
|
112
|
+
return props.theme.bulletWidth;
|
|
113
|
+
}, function (props) {
|
|
114
|
+
return props.theme.bulletMarginRight;
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
var ListItem = _styledComponents["default"].li(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0px;\n padding: 0px;\n list-style: none;\n display: flex;\n font-size: \"1em\";\n"])));
|
|
118
|
+
|
|
119
|
+
var _default = DxcBulletedList;
|
|
120
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import Title from "../../.storybook/components/Title";
|
|
4
|
+
import { BackgroundColorProvider } from "../BackgroundColorContext";
|
|
5
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
6
|
+
|
|
7
|
+
import DxcBulletedList from "./BulletedList";
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: "BulletedList",
|
|
11
|
+
component: DxcBulletedList,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const icon = (
|
|
15
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
|
|
16
|
+
<path d="M0 0h24v24H0V0z" fill="none" />
|
|
17
|
+
<path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" />
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export const Chromatic = () => (
|
|
22
|
+
<>
|
|
23
|
+
<ExampleContainer>
|
|
24
|
+
<Title title="Icon list" theme="light" level={4} />
|
|
25
|
+
<DxcBulletedList type="icon" icon={icon}>
|
|
26
|
+
<DxcBulletedList.Item>Code</DxcBulletedList.Item>
|
|
27
|
+
<DxcBulletedList.Item>Usage</DxcBulletedList.Item>
|
|
28
|
+
<DxcBulletedList.Item>Specifications</DxcBulletedList.Item>
|
|
29
|
+
</DxcBulletedList>
|
|
30
|
+
<Title title="Number list" theme="light" level={4} />
|
|
31
|
+
<DxcBulletedList type="number">
|
|
32
|
+
<DxcBulletedList.Item>Code</DxcBulletedList.Item>
|
|
33
|
+
<DxcBulletedList.Item>Usage</DxcBulletedList.Item>
|
|
34
|
+
<DxcBulletedList.Item>Specifications</DxcBulletedList.Item>
|
|
35
|
+
</DxcBulletedList>
|
|
36
|
+
<Title title="Square" theme="light" level={4} />
|
|
37
|
+
<DxcBulletedList type="square">
|
|
38
|
+
<DxcBulletedList.Item>Code</DxcBulletedList.Item>
|
|
39
|
+
<DxcBulletedList.Item>Usage</DxcBulletedList.Item>
|
|
40
|
+
<DxcBulletedList.Item>Specifications</DxcBulletedList.Item>
|
|
41
|
+
</DxcBulletedList>
|
|
42
|
+
<Title title="Circle" theme="light" level={4} />
|
|
43
|
+
<DxcBulletedList type="circle">
|
|
44
|
+
<DxcBulletedList.Item>Code</DxcBulletedList.Item>
|
|
45
|
+
<DxcBulletedList.Item>Usage</DxcBulletedList.Item>
|
|
46
|
+
<DxcBulletedList.Item>Specifications</DxcBulletedList.Item>
|
|
47
|
+
</DxcBulletedList>
|
|
48
|
+
<Title title="Disc" theme="light" level={4} />
|
|
49
|
+
<DxcBulletedList>
|
|
50
|
+
<DxcBulletedList.Item>Code</DxcBulletedList.Item>
|
|
51
|
+
<DxcBulletedList.Item>Usage</DxcBulletedList.Item>
|
|
52
|
+
<DxcBulletedList.Item>Specifications</DxcBulletedList.Item>
|
|
53
|
+
</DxcBulletedList>
|
|
54
|
+
|
|
55
|
+
<Title title="Multiple lines" theme="light" level={4} />
|
|
56
|
+
<Container>
|
|
57
|
+
<Title title="Number" theme="light" level={4} />
|
|
58
|
+
<DxcBulletedList type="number">
|
|
59
|
+
<DxcBulletedList.Item>
|
|
60
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
|
61
|
+
dolore magna aliqua.
|
|
62
|
+
</DxcBulletedList.Item>
|
|
63
|
+
<DxcBulletedList.Item>Text 2.</DxcBulletedList.Item>
|
|
64
|
+
</DxcBulletedList>
|
|
65
|
+
</Container>
|
|
66
|
+
<Container>
|
|
67
|
+
<Title title="Square" theme="light" level={4} />
|
|
68
|
+
<DxcBulletedList type="square">
|
|
69
|
+
<DxcBulletedList.Item>
|
|
70
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
|
71
|
+
dolore magna aliqua.
|
|
72
|
+
</DxcBulletedList.Item>
|
|
73
|
+
<DxcBulletedList.Item>Text 2.</DxcBulletedList.Item>
|
|
74
|
+
</DxcBulletedList>
|
|
75
|
+
</Container>
|
|
76
|
+
<Container>
|
|
77
|
+
<Title title="Circle" theme="light" level={4} />
|
|
78
|
+
<DxcBulletedList type="circle">
|
|
79
|
+
<DxcBulletedList.Item>
|
|
80
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
|
81
|
+
dolore magna aliqua.
|
|
82
|
+
</DxcBulletedList.Item>
|
|
83
|
+
<DxcBulletedList.Item>Text 2.</DxcBulletedList.Item>
|
|
84
|
+
</DxcBulletedList>
|
|
85
|
+
</Container>
|
|
86
|
+
<Title title="Disc" theme="light" level={4} />
|
|
87
|
+
<Container>
|
|
88
|
+
<DxcBulletedList>
|
|
89
|
+
<DxcBulletedList.Item>
|
|
90
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
|
91
|
+
dolore magna aliqua.
|
|
92
|
+
</DxcBulletedList.Item>
|
|
93
|
+
<DxcBulletedList.Item>Text 2.</DxcBulletedList.Item>
|
|
94
|
+
</DxcBulletedList>
|
|
95
|
+
</Container>
|
|
96
|
+
<Container>
|
|
97
|
+
<Title title="Icon" theme="light" level={4} />
|
|
98
|
+
<DxcBulletedList type="icon" icon={icon}>
|
|
99
|
+
<DxcBulletedList.Item>
|
|
100
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
|
101
|
+
dolore magna aliqua.
|
|
102
|
+
</DxcBulletedList.Item>
|
|
103
|
+
<DxcBulletedList.Item>Text 2.</DxcBulletedList.Item>
|
|
104
|
+
</DxcBulletedList>
|
|
105
|
+
</Container>
|
|
106
|
+
</ExampleContainer>
|
|
107
|
+
<BackgroundColorProvider color="#333333">
|
|
108
|
+
<DarkContainerForBulletedList>
|
|
109
|
+
<Title title="Icon list" theme="dark" level={4} />
|
|
110
|
+
<DxcBulletedList type="icon" icon={icon}>
|
|
111
|
+
<DxcBulletedList.Item>Code</DxcBulletedList.Item>
|
|
112
|
+
<DxcBulletedList.Item>Usage</DxcBulletedList.Item>
|
|
113
|
+
<DxcBulletedList.Item>Specifications</DxcBulletedList.Item>
|
|
114
|
+
</DxcBulletedList>
|
|
115
|
+
<Title title="Number list" theme="dark" level={4} />
|
|
116
|
+
<DxcBulletedList type="number">
|
|
117
|
+
<DxcBulletedList.Item>Code</DxcBulletedList.Item>
|
|
118
|
+
<DxcBulletedList.Item>Usage</DxcBulletedList.Item>
|
|
119
|
+
<DxcBulletedList.Item>Specifications</DxcBulletedList.Item>
|
|
120
|
+
</DxcBulletedList>
|
|
121
|
+
<Title title="Square" theme="dark" level={4} />
|
|
122
|
+
<DxcBulletedList type="square">
|
|
123
|
+
<DxcBulletedList.Item>Code</DxcBulletedList.Item>
|
|
124
|
+
<DxcBulletedList.Item>Usage</DxcBulletedList.Item>
|
|
125
|
+
<DxcBulletedList.Item>Specifications</DxcBulletedList.Item>
|
|
126
|
+
</DxcBulletedList>
|
|
127
|
+
<Title title="Circle" theme="dark" level={4} />
|
|
128
|
+
<DxcBulletedList type="circle">
|
|
129
|
+
<DxcBulletedList.Item>Code</DxcBulletedList.Item>
|
|
130
|
+
<DxcBulletedList.Item>Usage</DxcBulletedList.Item>
|
|
131
|
+
<DxcBulletedList.Item>Specifications</DxcBulletedList.Item>
|
|
132
|
+
</DxcBulletedList>
|
|
133
|
+
<Title title="Disc" theme="dark" level={4} />
|
|
134
|
+
<DxcBulletedList>
|
|
135
|
+
<DxcBulletedList.Item>Code</DxcBulletedList.Item>
|
|
136
|
+
<DxcBulletedList.Item>Usage</DxcBulletedList.Item>
|
|
137
|
+
<DxcBulletedList.Item>Specifications</DxcBulletedList.Item>
|
|
138
|
+
</DxcBulletedList>
|
|
139
|
+
|
|
140
|
+
<Title title="Multiple lines" theme="dark" level={4} />
|
|
141
|
+
<Container>
|
|
142
|
+
<Title title="Number" theme="dark" level={4} />
|
|
143
|
+
<DxcBulletedList type="number">
|
|
144
|
+
<DxcBulletedList.Item>
|
|
145
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
|
146
|
+
dolore magna aliqua.
|
|
147
|
+
</DxcBulletedList.Item>
|
|
148
|
+
<DxcBulletedList.Item>Text 2.</DxcBulletedList.Item>
|
|
149
|
+
</DxcBulletedList>
|
|
150
|
+
</Container>
|
|
151
|
+
<Container>
|
|
152
|
+
<Title title="Square" theme="dark" level={4} />
|
|
153
|
+
<DxcBulletedList type="square">
|
|
154
|
+
<DxcBulletedList.Item>
|
|
155
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
|
156
|
+
dolore magna aliqua.
|
|
157
|
+
</DxcBulletedList.Item>
|
|
158
|
+
<DxcBulletedList.Item>Text 2.</DxcBulletedList.Item>
|
|
159
|
+
</DxcBulletedList>
|
|
160
|
+
</Container>
|
|
161
|
+
<Container>
|
|
162
|
+
<Title title="Circle" theme="dark" level={4} />
|
|
163
|
+
<DxcBulletedList type="circle">
|
|
164
|
+
<DxcBulletedList.Item>
|
|
165
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
|
166
|
+
dolore magna aliqua.
|
|
167
|
+
</DxcBulletedList.Item>
|
|
168
|
+
<DxcBulletedList.Item>Text 2.</DxcBulletedList.Item>
|
|
169
|
+
</DxcBulletedList>
|
|
170
|
+
</Container>
|
|
171
|
+
<Title title="Disc" theme="dark" level={4} />
|
|
172
|
+
<Container>
|
|
173
|
+
<DxcBulletedList>
|
|
174
|
+
<DxcBulletedList.Item>
|
|
175
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
|
176
|
+
dolore magna aliqua.
|
|
177
|
+
</DxcBulletedList.Item>
|
|
178
|
+
<DxcBulletedList.Item>Text 2.</DxcBulletedList.Item>
|
|
179
|
+
</DxcBulletedList>
|
|
180
|
+
</Container>
|
|
181
|
+
<Container>
|
|
182
|
+
<Title title="Icon" theme="dark" level={4} />
|
|
183
|
+
<DxcBulletedList type="icon" icon={icon}>
|
|
184
|
+
<DxcBulletedList.Item>
|
|
185
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
|
186
|
+
dolore magna aliqua.
|
|
187
|
+
</DxcBulletedList.Item>
|
|
188
|
+
<DxcBulletedList.Item>Text 2.</DxcBulletedList.Item>
|
|
189
|
+
</DxcBulletedList>
|
|
190
|
+
</Container>
|
|
191
|
+
</DarkContainerForBulletedList>
|
|
192
|
+
</BackgroundColorProvider>
|
|
193
|
+
</>
|
|
194
|
+
);
|
|
195
|
+
|
|
196
|
+
const Container = styled.div`
|
|
197
|
+
width: 400px;
|
|
198
|
+
`;
|
|
199
|
+
|
|
200
|
+
const DarkContainerForBulletedList = styled.div`
|
|
201
|
+
background-color: #333333;
|
|
202
|
+
padding: 5px;
|
|
203
|
+
`;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type SVG = React.SVGProps<SVGSVGElement> | React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
3
|
+
declare type Props = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
type?: "disc" | "circle" | "square" | "number" | "icon";
|
|
6
|
+
icon?: string | SVG;
|
|
7
|
+
};
|
|
8
|
+
export default Props;
|
|
9
|
+
export declare type BulletedListItemPropsType = {
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
};
|
|
File without changes
|
package/button/Button.js
CHANGED
|
@@ -45,14 +45,22 @@ var DxcButton = function DxcButton(_ref) {
|
|
|
45
45
|
_ref$type = _ref.type,
|
|
46
46
|
type = _ref$type === void 0 ? "button" : _ref$type,
|
|
47
47
|
icon = _ref.icon,
|
|
48
|
-
|
|
48
|
+
_ref$onClick = _ref.onClick,
|
|
49
|
+
_onClick = _ref$onClick === void 0 ? function () {} : _ref$onClick,
|
|
49
50
|
margin = _ref.margin,
|
|
50
51
|
_ref$size = _ref.size,
|
|
51
52
|
size = _ref$size === void 0 ? "fitContent" : _ref$size,
|
|
52
53
|
_ref$tabIndex = _ref.tabIndex,
|
|
53
54
|
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
55
|
+
|
|
54
56
|
var colorsTheme = (0, _useTheme["default"])();
|
|
55
57
|
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
58
|
+
|
|
59
|
+
var labelComponent = /*#__PURE__*/_react["default"].createElement(LabelContainer, {
|
|
60
|
+
icon: icon,
|
|
61
|
+
iconPosition: iconPosition
|
|
62
|
+
}, label);
|
|
63
|
+
|
|
56
64
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
57
65
|
theme: colorsTheme.button
|
|
58
66
|
}, /*#__PURE__*/_react["default"].createElement(DxCButton, {
|
|
@@ -73,15 +81,12 @@ var DxcButton = function DxcButton(_ref) {
|
|
|
73
81
|
onClick: function onClick() {
|
|
74
82
|
_onClick();
|
|
75
83
|
}
|
|
76
|
-
}, label && /*#__PURE__*/_react["default"].createElement(
|
|
77
|
-
icon: icon,
|
|
78
|
-
iconPosition: iconPosition
|
|
79
|
-
}, label), icon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
84
|
+
}, label && iconPosition === "after" && labelComponent, icon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
80
85
|
label: label,
|
|
81
86
|
iconPosition: iconPosition
|
|
82
87
|
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement(ButtonIcon, {
|
|
83
88
|
src: icon
|
|
84
|
-
}) : icon))));
|
|
89
|
+
}) : icon), label && iconPosition === "before" && labelComponent)));
|
|
85
90
|
};
|
|
86
91
|
|
|
87
92
|
var sizes = {
|
|
@@ -118,7 +123,7 @@ var IconContainer = _styledComponents["default"].div(_templateObject2 || (_templ
|
|
|
118
123
|
|
|
119
124
|
var ButtonIcon = _styledComponents["default"].img(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])([""])));
|
|
120
125
|
|
|
121
|
-
var DxCButton = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n display: inline-block;\n width: ", ";\n cursor: ", ";\n\n .MuiButtonBase-root {\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n\n .MuiButton-label {\n display: flex;\n
|
|
126
|
+
var DxCButton = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n display: inline-block;\n width: ", ";\n cursor: ", ";\n\n .MuiButtonBase-root {\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n\n .MuiButton-label {\n display: flex;\n align-items: center;\n }\n\n box-shadow: 0 0 0 2px transparent;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n min-width: ", ";\n width: 100%;\n height: 40px;\n transition: none !important;\n\n &:focus {\n border-color: transparent;\n box-shadow: 0 0 0 2px\n ", ";\n }\n\n ", "\n }\n"])), function (props) {
|
|
122
127
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
123
128
|
}, function (props) {
|
|
124
129
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
@@ -140,8 +145,6 @@ var DxCButton = _styledComponents["default"].div(_templateObject4 || (_templateO
|
|
|
140
145
|
return props.theme.paddingTop;
|
|
141
146
|
}, function (props) {
|
|
142
147
|
return props.theme.paddingBottom;
|
|
143
|
-
}, function (props) {
|
|
144
|
-
return props.iconPosition === "after" && "row" || "row-reverse";
|
|
145
148
|
}, function (props) {
|
|
146
149
|
return props.theme.fontFamily;
|
|
147
150
|
}, function (props) {
|
|
@@ -159,9 +162,9 @@ var DxCButton = _styledComponents["default"].div(_templateObject4 || (_templateO
|
|
|
159
162
|
backgroundType = props.backgroundType;
|
|
160
163
|
|
|
161
164
|
if (mode === "primary") {
|
|
162
|
-
return "\n border-radius: ".concat(props.theme.primaryBorderRadius, ";\n border-width: ").concat(props.theme.primaryBorderThickness, ";\n border-style: ").concat(props.theme.primaryBorderStyle, ";\n font-family: ").concat(props.theme.primaryFontFamily, ";\n font-size: ").concat(props.theme.primaryFontSize, ";\n font-weight: ").concat(props.theme.primaryFontWeight, ";\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryBackgroundColorOnDark : props.theme.primaryBackgroundColor, ";\n color: ").concat(backgroundType && backgroundType === "dark" ? props.theme.primaryFontColorOnDark : props.theme.primaryFontColor, " !important;\n\n &:hover {\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryHoverBackgroundColorOnDark : props.theme.primaryHoverBackgroundColor, ";\n }\n &:active {\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryActiveBackgroundColorOnDark : props.theme.primaryActiveBackgroundColor, " !important;\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n &:disabled { \n cursor: not-allowed;\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryDisabledBackgroundColorOnDark : props.theme.primaryDisabledBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.primaryDisabledFontColorOnDark : props.theme.primaryDisabledFontColor, "!important; \n }\n
|
|
165
|
+
return "\n border-radius: ".concat(props.theme.primaryBorderRadius, ";\n border-width: ").concat(props.theme.primaryBorderThickness, ";\n border-style: ").concat(props.theme.primaryBorderStyle, ";\n font-family: ").concat(props.theme.primaryFontFamily, ";\n font-size: ").concat(props.theme.primaryFontSize, ";\n font-weight: ").concat(props.theme.primaryFontWeight, ";\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryBackgroundColorOnDark : props.theme.primaryBackgroundColor, ";\n color: ").concat(backgroundType && backgroundType === "dark" ? props.theme.primaryFontColorOnDark : props.theme.primaryFontColor, " !important;\n\n &:hover {\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryHoverBackgroundColorOnDark : props.theme.primaryHoverBackgroundColor, ";\n }\n &:active {\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryActiveBackgroundColorOnDark : props.theme.primaryActiveBackgroundColor, " !important;\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n &:disabled { \n cursor: not-allowed;\n background-color: ").concat(backgroundType === "dark" ? props.theme.primaryDisabledBackgroundColorOnDark : props.theme.primaryDisabledBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.primaryDisabledFontColorOnDark : props.theme.primaryDisabledFontColor, " !important; \n }\n ");
|
|
163
166
|
} else if (mode === "secondary") {
|
|
164
|
-
return "\n border-radius: ".concat(props.theme.secondaryBorderRadius, ";\n border-width: ").concat(props.theme.secondaryBorderThickness, ";\n border-style: ").concat(props.theme.secondaryBorderStyle, ";\n font-family: ").concat(props.theme.secondaryFontFamily, ";\n font-size: ").concat(props.theme.secondaryFontSize, ";\n font-weight: ").concat(props.theme.secondaryFontWeight, ";\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryBackgroundColorOnDark : props.theme.secondaryBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryFontColorOnDark : props.theme.secondaryFontColor, " !important;\n border-color: ").concat(backgroundType === "dark" ? props.theme.secondaryBorderColorOnDark : props.theme.secondaryBorderColor, ";\n\n &:hover {\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverBackgroundColorOnDark : props.theme.secondaryHoverBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor, " !important;\n }\n &:active {\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryActiveBackgroundColorOnDark : props.theme.secondaryActiveBackgroundColor, " !important;\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor, " !important;\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n &:disabled {\n cursor: not-allowed;\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryDisabledBackgroundColorOnDark : props.theme.secondaryDisabledBackgroundColor, " !important;\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryDisabledFontColorOnDark : props.theme.secondaryDisabledFontColor, " !important;\n border-color: ").concat(backgroundType === "dark" ? props.theme.secondaryDisabledBorderColorOnDark : props.theme.secondaryDisabledBorderColor, ";\n }\n
|
|
167
|
+
return "\n border-radius: ".concat(props.theme.secondaryBorderRadius, ";\n border-width: ").concat(props.theme.secondaryBorderThickness, ";\n border-style: ").concat(props.theme.secondaryBorderStyle, ";\n font-family: ").concat(props.theme.secondaryFontFamily, ";\n font-size: ").concat(props.theme.secondaryFontSize, ";\n font-weight: ").concat(props.theme.secondaryFontWeight, ";\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryBackgroundColorOnDark : props.theme.secondaryBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryFontColorOnDark : props.theme.secondaryFontColor, " !important;\n border-color: ").concat(backgroundType === "dark" ? props.theme.secondaryBorderColorOnDark : props.theme.secondaryBorderColor, ";\n\n &:hover {\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverBackgroundColorOnDark : props.theme.secondaryHoverBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor, " !important;\n }\n &:active {\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryActiveBackgroundColorOnDark : props.theme.secondaryActiveBackgroundColor, " !important;\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryHoverFontColorOnDark : props.theme.secondaryHoverFontColor, " !important;\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n &:disabled {\n cursor: not-allowed;\n background-color: ").concat(backgroundType === "dark" ? props.theme.secondaryDisabledBackgroundColorOnDark : props.theme.secondaryDisabledBackgroundColor, " !important;\n color: ").concat(backgroundType === "dark" ? props.theme.secondaryDisabledFontColorOnDark : props.theme.secondaryDisabledFontColor, " !important;\n border-color: ").concat(backgroundType === "dark" ? props.theme.secondaryDisabledBorderColorOnDark : props.theme.secondaryDisabledBorderColor, ";\n }\n ");
|
|
165
168
|
} else if (mode === "text") {
|
|
166
169
|
return "\n border-radius: ".concat(props.theme.textBorderRadius, ";\n border-width: ").concat(props.theme.textBorderThickness, ";\n border-style: ").concat(props.theme.textBorderStyle, ";\n font-family: ").concat(props.theme.textFontFamily, ";\n font-size: ").concat(props.theme.textFontSize, ";\n font-weight: ").concat(props.theme.textFontWeight, ";\n background-color: ").concat(backgroundType === "dark" ? props.theme.textBackgroundColorOnDark : props.theme.textBackgroundColor, ";\n color: ").concat(backgroundType === "dark" ? props.theme.textFontColorOnDark : props.theme.textFontColor, " !important;\n\n &:hover {\n background-color: ").concat(backgroundType === "dark" ? props.theme.textHoverBackgroundColorOnDark : props.theme.textHoverBackgroundColor, ";\n }\n &:active {\n background-color: ").concat(backgroundType === "dark" ? props.theme.textActiveBackgroundColorOnDark : props.theme.textActiveBackgroundColor, " !important;\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n &:disabled {\n cursor:not-allowed;\n color: ").concat(backgroundType === "dark" ? props.theme.textDisabledFontColorOnDark : props.theme.textDisabledFontColor, " !important;\n background-color: ").concat(backgroundType === "dark" ? props.theme.textDisabledBackgroundColorOnDark : props.theme.textDisabledBackgroundColor, ";\n }\n ");
|
|
167
170
|
}
|
package/card/Card.js
CHANGED
|
@@ -25,7 +25,7 @@ var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
|
25
25
|
|
|
26
26
|
var _Box = _interopRequireDefault(require("../box/Box"));
|
|
27
27
|
|
|
28
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5
|
|
28
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
29
29
|
|
|
30
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
31
|
|
|
@@ -56,22 +56,13 @@ var DxcCard = function DxcCard(_ref) {
|
|
|
56
56
|
isHovered = _useState2[0],
|
|
57
57
|
changeIsHovered = _useState2[1];
|
|
58
58
|
|
|
59
|
-
var
|
|
60
|
-
shadowDepth: !outlined ? 0 : isHovered && (onClick || linkHref) ? 2 : 1
|
|
61
|
-
}, /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
62
|
-
theme: colorsTheme.card
|
|
63
|
-
}, /*#__PURE__*/_react["default"].createElement(CardContainer, {
|
|
64
|
-
hasAction: onClick || linkHref,
|
|
65
|
-
imagePosition: imagePosition
|
|
66
|
-
}, imageSrc && /*#__PURE__*/_react["default"].createElement(ImageContainer, {
|
|
59
|
+
var imageComponent = /*#__PURE__*/_react["default"].createElement(ImageContainer, {
|
|
67
60
|
imageBgColor: imageBgColor
|
|
68
61
|
}, /*#__PURE__*/_react["default"].createElement(TagImage, {
|
|
69
62
|
imagePadding: imagePadding,
|
|
70
63
|
cover: imageCover,
|
|
71
64
|
src: imageSrc
|
|
72
|
-
}))
|
|
73
|
-
contentPadding: contentPadding
|
|
74
|
-
}, children))));
|
|
65
|
+
}));
|
|
75
66
|
|
|
76
67
|
return /*#__PURE__*/_react["default"].createElement(StyledDxcCard, {
|
|
77
68
|
margin: margin,
|
|
@@ -82,15 +73,23 @@ var DxcCard = function DxcCard(_ref) {
|
|
|
82
73
|
return changeIsHovered(false);
|
|
83
74
|
},
|
|
84
75
|
onClick: onClick,
|
|
85
|
-
hasAction: onClick,
|
|
86
|
-
tabIndex:
|
|
87
|
-
|
|
88
|
-
tabIndex: tabIndex,
|
|
76
|
+
hasAction: onClick || linkHref,
|
|
77
|
+
tabIndex: onClick || linkHref ? tabIndex : -1,
|
|
78
|
+
as: linkHref && "a",
|
|
89
79
|
href: linkHref
|
|
90
|
-
},
|
|
80
|
+
}, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
81
|
+
shadowDepth: !outlined ? 0 : isHovered && (onClick || linkHref) ? 2 : 1
|
|
82
|
+
}, /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
83
|
+
theme: colorsTheme.card
|
|
84
|
+
}, /*#__PURE__*/_react["default"].createElement(CardContainer, {
|
|
85
|
+
hasAction: onClick || linkHref,
|
|
86
|
+
imagePosition: imagePosition
|
|
87
|
+
}, imageSrc && imagePosition === "before" && imageComponent, /*#__PURE__*/_react["default"].createElement(CardContent, {
|
|
88
|
+
contentPadding: contentPadding
|
|
89
|
+
}, children), imageSrc && imagePosition === "after" && imageComponent))));
|
|
91
90
|
};
|
|
92
91
|
|
|
93
|
-
var StyledDxcCard = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n cursor: ", ";\n outline: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n
|
|
92
|
+
var StyledDxcCard = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n cursor: ", ";\n outline: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n text-decoration: none;\n\n ", "\n"])), function (_ref2) {
|
|
94
93
|
var hasAction = _ref2.hasAction;
|
|
95
94
|
return hasAction && "pointer" || "unset";
|
|
96
95
|
}, function (_ref3) {
|
|
@@ -111,12 +110,12 @@ var StyledDxcCard = _styledComponents["default"].div(_templateObject || (_templa
|
|
|
111
110
|
}, function (_ref8) {
|
|
112
111
|
var margin = _ref8.margin;
|
|
113
112
|
return margin && margin.left ? _variables.spaces[margin.left] : "";
|
|
113
|
+
}, function (_ref9) {
|
|
114
|
+
var hasAction = _ref9.hasAction;
|
|
115
|
+
return hasAction && ":focus {\n outline: #0095ff auto 1px;\n }";
|
|
114
116
|
});
|
|
115
117
|
|
|
116
|
-
var CardContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n
|
|
117
|
-
var imagePosition = _ref9.imagePosition;
|
|
118
|
-
return imagePosition === "before" && "row" || "row-reverse";
|
|
119
|
-
}, function (props) {
|
|
118
|
+
var CardContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n height: ", ";\n width: ", ";\n &:hover {\n border-color: ", ";\n }\n"])), function (props) {
|
|
120
119
|
return props.theme.height;
|
|
121
120
|
}, function (props) {
|
|
122
121
|
return props.theme.width;
|
|
@@ -125,9 +124,7 @@ var CardContainer = _styledComponents["default"].div(_templateObject2 || (_templ
|
|
|
125
124
|
return hasAction ? "" : "unset";
|
|
126
125
|
});
|
|
127
126
|
|
|
128
|
-
var
|
|
129
|
-
|
|
130
|
-
var TagImage = _styledComponents["default"].img(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n object-fit: ", ";\n"])), function (_ref11) {
|
|
127
|
+
var TagImage = _styledComponents["default"].img(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n object-fit: ", ";\n"])), function (_ref11) {
|
|
131
128
|
var imagePadding = _ref11.imagePadding;
|
|
132
129
|
return !imagePadding ? "100%" : "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
|
|
133
130
|
}, function (_ref12) {
|
|
@@ -138,12 +135,12 @@ var TagImage = _styledComponents["default"].img(_templateObject4 || (_templateOb
|
|
|
138
135
|
return cover ? "cover" : "contain";
|
|
139
136
|
});
|
|
140
137
|
|
|
141
|
-
var ImageContainer = _styledComponents["default"].div(
|
|
138
|
+
var ImageContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n width: 35%;\n height: 100%;\n flex-shrink: 0;\n background: ", ";\n justify-content: center;\n align-items: center;\n display: inline-flex;\n"])), function (_ref14) {
|
|
142
139
|
var imageBgColor = _ref14.imageBgColor;
|
|
143
140
|
return imageBgColor;
|
|
144
141
|
});
|
|
145
142
|
|
|
146
|
-
var CardContent = _styledComponents["default"].div(
|
|
143
|
+
var CardContent = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n flex-grow: 1;\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n overflow: hidden;\n"])), function (_ref15) {
|
|
147
144
|
var contentPadding = _ref15.contentPadding;
|
|
148
145
|
return contentPadding && (0, _typeof2["default"])(contentPadding) !== "object" ? _variables.spaces[contentPadding] : "0px";
|
|
149
146
|
}, function (_ref16) {
|
package/checkbox/Checkbox.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import CheckboxPropsType from "./types";
|
|
3
|
-
declare const DxcCheckbox: ({ checked, defaultChecked, value, label, labelPosition, name, disabled,
|
|
3
|
+
declare const DxcCheckbox: ({ checked, defaultChecked, value, label, labelPosition, name, disabled, optional, onChange, margin, size, tabIndex, }: CheckboxPropsType) => JSX.Element;
|
|
4
4
|
export default DxcCheckbox;
|