@dxc-technology/halstack-react 9.0.0 → 9.0.1
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 +2 -2
- package/BackgroundColorContext.js +1 -1
- package/HalstackContext.d.ts +1329 -5
- package/HalstackContext.js +60 -68
- package/accordion/Accordion.js +6 -11
- package/accordion/Accordion.test.js +1 -1
- package/accordion/types.d.ts +3 -3
- package/accordion-group/AccordionGroup.js +2 -2
- package/accordion-group/AccordionGroup.test.js +1 -1
- package/accordion-group/types.d.ts +2 -2
- package/alert/Alert.js +3 -5
- package/alert/Alert.test.js +1 -1
- package/box/Box.js +2 -2
- package/box/Box.test.js +1 -1
- package/button/Button.js +2 -2
- package/button/Button.test.js +1 -1
- package/button/types.d.ts +3 -3
- package/card/Card.js +12 -13
- package/card/Card.stories.tsx +12 -13
- package/card/Card.test.js +1 -1
- package/checkbox/Checkbox.js +3 -3
- package/checkbox/Checkbox.test.js +1 -1
- package/checkbox/types.d.ts +2 -2
- package/chip/Chip.js +2 -4
- package/chip/Chip.test.js +3 -5
- package/common/utils.d.ts +1 -0
- package/common/utils.js +4 -4
- package/common/variables.d.ts +1625 -0
- package/common/variables.js +2 -2
- package/dialog/Dialog.js +1 -1
- package/dialog/Dialog.test.js +24 -24
- package/dialog/types.d.ts +2 -2
- package/dropdown/Dropdown.js +2 -2
- package/dropdown/Dropdown.test.js +3 -2
- package/dropdown/DropdownMenuItem.js +0 -2
- package/dropdown/types.d.ts +3 -3
- package/file-input/FileInput.js +1 -2
- package/file-input/FileInput.test.js +1 -1
- package/footer/Footer.js +6 -8
- package/footer/Footer.test.js +14 -26
- package/header/Header.d.ts +3 -2
- package/header/Header.js +3 -3
- package/header/Header.test.js +2 -2
- package/header/types.d.ts +2 -2
- package/heading/Heading.js +1 -1
- package/heading/Heading.test.js +1 -1
- package/layout/ApplicationLayout.d.ts +1 -1
- package/layout/ApplicationLayout.js +1 -1
- package/link/Link.js +2 -2
- package/link/Link.test.js +2 -4
- package/link/types.d.ts +2 -2
- package/nav-tabs/NavTabs.test.js +1 -1
- package/nav-tabs/Tab.js +7 -7
- package/number-input/NumberInput.test.js +1 -1
- package/package.json +2 -2
- package/paginator/Paginator.js +1 -3
- package/paginator/Paginator.test.js +27 -37
- package/paragraph/Paragraph.d.ts +3 -4
- package/paragraph/Paragraph.js +5 -5
- package/password-input/PasswordInput.test.js +1 -1
- package/progress-bar/ProgressBar.d.ts +2 -2
- package/progress-bar/ProgressBar.js +1 -1
- package/progress-bar/ProgressBar.test.js +1 -1
- package/progress-bar/types.d.ts +4 -3
- package/radio-group/RadioGroup.test.js +1 -1
- package/resultsetTable/ResultsetTable.js +2 -2
- package/resultsetTable/ResultsetTable.test.js +1 -1
- package/resultsetTable/types.d.ts +3 -3
- package/select/Select.js +13 -11
- package/select/Select.test.js +59 -59
- package/sidenav/Sidenav.js +1 -1
- package/slider/Slider.js +2 -3
- package/slider/Slider.test.js +1 -1
- package/slider/types.d.ts +2 -2
- package/spinner/Spinner.js +15 -21
- package/spinner/Spinner.stories.jsx +28 -28
- package/spinner/Spinner.test.js +1 -1
- package/switch/Switch.js +2 -2
- package/switch/Switch.test.js +1 -1
- package/switch/types.d.ts +2 -2
- package/table/Table.js +2 -2
- package/table/Table.test.js +1 -1
- package/tabs/Tab.js +9 -9
- package/tabs/Tabs.js +1 -3
- package/tabs/Tabs.test.js +4 -5
- package/tabs/types.d.ts +2 -2
- package/tag/Tag.js +7 -9
- package/tag/Tag.test.js +1 -1
- package/text-input/Suggestion.js +2 -2
- package/text-input/TextInput.js +3 -3
- package/text-input/TextInput.test.js +1 -2
- package/textarea/Textarea.js +3 -3
- package/textarea/Textarea.test.js +1 -1
- package/toggle-group/ToggleGroup.js +7 -4
- package/toggle-group/ToggleGroup.test.js +1 -1
- package/toggle-group/types.d.ts +1 -1
- package/typography/Typography.d.ts +2 -2
- package/typography/Typography.js +14 -113
- package/typography/Typography.stories.tsx +1 -1
- package/useTheme.d.ts +1234 -1
- package/useTheme.js +1 -1
- package/useTranslatedLabels.d.ts +84 -1
- package/utils/BaseTypography.d.ts +21 -0
- package/utils/BaseTypography.js +108 -0
- package/wizard/Wizard.js +2 -2
- package/wizard/Wizard.test.js +1 -1
- package/wizard/types.d.ts +5 -6
package/card/Card.js
CHANGED
|
@@ -19,7 +19,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
19
19
|
|
|
20
20
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
21
|
|
|
22
|
-
var _variables = require("../common/variables
|
|
22
|
+
var _variables = require("../common/variables");
|
|
23
23
|
|
|
24
24
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
25
25
|
|
|
@@ -60,7 +60,7 @@ var DxcCard = function DxcCard(_ref) {
|
|
|
60
60
|
imageBgColor: imageBgColor
|
|
61
61
|
}, /*#__PURE__*/_react["default"].createElement(TagImage, {
|
|
62
62
|
imagePadding: imagePadding,
|
|
63
|
-
|
|
63
|
+
imageCover: imageCover,
|
|
64
64
|
src: imageSrc
|
|
65
65
|
}));
|
|
66
66
|
|
|
@@ -82,14 +82,13 @@ var DxcCard = function DxcCard(_ref) {
|
|
|
82
82
|
}, /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
83
83
|
theme: colorsTheme.card
|
|
84
84
|
}, /*#__PURE__*/_react["default"].createElement(CardContainer, {
|
|
85
|
-
hasAction: onClick || linkHref
|
|
86
|
-
imagePosition: imagePosition
|
|
85
|
+
hasAction: onClick || linkHref
|
|
87
86
|
}, imageSrc && imagePosition === "before" && imageComponent, /*#__PURE__*/_react["default"].createElement(CardContent, {
|
|
88
87
|
contentPadding: contentPadding
|
|
89
88
|
}, children), imageSrc && imagePosition === "after" && imageComponent))));
|
|
90
89
|
};
|
|
91
90
|
|
|
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
|
|
91
|
+
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"])), function (_ref2) {
|
|
93
92
|
var hasAction = _ref2.hasAction;
|
|
94
93
|
return hasAction && "pointer" || "unset";
|
|
95
94
|
}, function (_ref3) {
|
|
@@ -100,16 +99,16 @@ var StyledDxcCard = _styledComponents["default"].div(_templateObject || (_templa
|
|
|
100
99
|
return margin && (0, _typeof2["default"])(margin) !== "object" ? _variables.spaces[margin] : "0px";
|
|
101
100
|
}, function (_ref5) {
|
|
102
101
|
var margin = _ref5.margin;
|
|
103
|
-
return margin && margin.top ? _variables.spaces[margin.top] : "";
|
|
102
|
+
return margin && (0, _typeof2["default"])(margin) === "object" && margin.top ? _variables.spaces[margin.top] : "";
|
|
104
103
|
}, function (_ref6) {
|
|
105
104
|
var margin = _ref6.margin;
|
|
106
|
-
return margin && margin.right ? _variables.spaces[margin.right] : "";
|
|
105
|
+
return margin && (0, _typeof2["default"])(margin) === "object" && margin.right ? _variables.spaces[margin.right] : "";
|
|
107
106
|
}, function (_ref7) {
|
|
108
107
|
var margin = _ref7.margin;
|
|
109
|
-
return margin && margin.bottom ? _variables.spaces[margin.bottom] : "";
|
|
108
|
+
return margin && (0, _typeof2["default"])(margin) === "object" && margin.bottom ? _variables.spaces[margin.bottom] : "";
|
|
110
109
|
}, function (_ref8) {
|
|
111
110
|
var margin = _ref8.margin;
|
|
112
|
-
return margin && margin.left ? _variables.spaces[margin.left] : "";
|
|
111
|
+
return margin && (0, _typeof2["default"])(margin) === "object" && margin.left ? _variables.spaces[margin.left] : "";
|
|
113
112
|
}, function (_ref9) {
|
|
114
113
|
var hasAction = _ref9.hasAction;
|
|
115
114
|
return hasAction && ":focus {\n outline: #0095ff auto 1px;\n }";
|
|
@@ -126,13 +125,13 @@ var CardContainer = _styledComponents["default"].div(_templateObject2 || (_templ
|
|
|
126
125
|
|
|
127
126
|
var TagImage = _styledComponents["default"].img(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n object-fit: ", ";\n"])), function (_ref11) {
|
|
128
127
|
var imagePadding = _ref11.imagePadding;
|
|
129
|
-
return !imagePadding ? "100%" : "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
|
|
128
|
+
return !imagePadding ? "100%" : (0, _typeof2["default"])(imagePadding) !== "object" && "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
|
|
130
129
|
}, function (_ref12) {
|
|
131
130
|
var imagePadding = _ref12.imagePadding;
|
|
132
|
-
return !imagePadding ? "100%" : "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
|
|
131
|
+
return !imagePadding ? "100%" : (0, _typeof2["default"])(imagePadding) !== "object" && "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
|
|
133
132
|
}, function (_ref13) {
|
|
134
|
-
var
|
|
135
|
-
return
|
|
133
|
+
var imageCover = _ref13.imageCover;
|
|
134
|
+
return imageCover ? "cover" : "contain";
|
|
136
135
|
});
|
|
137
136
|
|
|
138
137
|
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) {
|
package/card/Card.stories.tsx
CHANGED
|
@@ -2,7 +2,6 @@ import React from "react";
|
|
|
2
2
|
import Title from "../../.storybook/components/Title";
|
|
3
3
|
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
4
4
|
import DxcCard from "./Card";
|
|
5
|
-
import imagePath from "./ice-cream.jpg";
|
|
6
5
|
import { userEvent, within } from "@storybook/testing-library";
|
|
7
6
|
|
|
8
7
|
export default {
|
|
@@ -38,72 +37,72 @@ const Card = () => (
|
|
|
38
37
|
</ExampleContainer>
|
|
39
38
|
<Title title="Default with image" theme="light" level={4} />
|
|
40
39
|
<ExampleContainer>
|
|
41
|
-
<DxcCard imageSrc=
|
|
40
|
+
<DxcCard imageSrc="https://picsum.photos/id/1022/200/300">Default</DxcCard>
|
|
42
41
|
</ExampleContainer>
|
|
43
42
|
<Title title="Default image with background color" theme="light" level={4} />
|
|
44
43
|
<ExampleContainer>
|
|
45
|
-
<DxcCard imageSrc=
|
|
44
|
+
<DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imageBgColor="yellow">
|
|
46
45
|
Background color
|
|
47
46
|
</DxcCard>
|
|
48
47
|
</ExampleContainer>
|
|
49
48
|
<Title title="Default image with position after" theme="light" level={4} />
|
|
50
49
|
<ExampleContainer>
|
|
51
|
-
<DxcCard imageSrc=
|
|
50
|
+
<DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePosition="after">
|
|
52
51
|
Position after
|
|
53
52
|
</DxcCard>
|
|
54
53
|
</ExampleContainer>
|
|
55
54
|
<Title title="Image cover" theme="light" level={4} />
|
|
56
55
|
<ExampleContainer>
|
|
57
|
-
<DxcCard imageSrc=
|
|
56
|
+
<DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imageCover>
|
|
58
57
|
Image cover
|
|
59
58
|
</DxcCard>
|
|
60
59
|
</ExampleContainer>
|
|
61
60
|
<Title title="Image cover with position after" theme="light" level={4} />
|
|
62
61
|
<ExampleContainer>
|
|
63
|
-
<DxcCard imageSrc=
|
|
62
|
+
<DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imageCover imagePosition="after">
|
|
64
63
|
Image cover with position after
|
|
65
64
|
</DxcCard>
|
|
66
65
|
</ExampleContainer>
|
|
67
66
|
<Title title="Image padding" theme="light" level={2} />
|
|
68
67
|
<ExampleContainer>
|
|
69
68
|
<Title title="Xxsmall" theme="light" level={4} />
|
|
70
|
-
<DxcCard imageSrc=
|
|
69
|
+
<DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="xxsmall" imageCover>
|
|
71
70
|
Xxsmall
|
|
72
71
|
</DxcCard>
|
|
73
72
|
</ExampleContainer>
|
|
74
73
|
<ExampleContainer>
|
|
75
74
|
<Title title="Xsmall" theme="light" level={4} />
|
|
76
|
-
<DxcCard imageSrc=
|
|
75
|
+
<DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="xsmall" imageCover>
|
|
77
76
|
Xsmall
|
|
78
77
|
</DxcCard>
|
|
79
78
|
</ExampleContainer>
|
|
80
79
|
<ExampleContainer>
|
|
81
80
|
<Title title="Small" theme="light" level={4} />
|
|
82
|
-
<DxcCard imageSrc=
|
|
81
|
+
<DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="small" imageCover>
|
|
83
82
|
Small
|
|
84
83
|
</DxcCard>
|
|
85
84
|
</ExampleContainer>
|
|
86
85
|
<ExampleContainer>
|
|
87
86
|
<Title title="Medium" theme="light" level={4} />
|
|
88
|
-
<DxcCard imageSrc=
|
|
87
|
+
<DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="medium" imageCover>
|
|
89
88
|
Medium
|
|
90
89
|
</DxcCard>
|
|
91
90
|
</ExampleContainer>
|
|
92
91
|
<ExampleContainer>
|
|
93
92
|
<Title title="Large" theme="light" level={4} />
|
|
94
|
-
<DxcCard imageSrc=
|
|
93
|
+
<DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="large" imageCover>
|
|
95
94
|
Large
|
|
96
95
|
</DxcCard>
|
|
97
96
|
</ExampleContainer>
|
|
98
97
|
<ExampleContainer>
|
|
99
98
|
<Title title="Xlarge" theme="light" level={4} />
|
|
100
|
-
<DxcCard imageSrc=
|
|
99
|
+
<DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="xlarge" imageCover>
|
|
101
100
|
Xlarge
|
|
102
101
|
</DxcCard>
|
|
103
102
|
</ExampleContainer>
|
|
104
103
|
<ExampleContainer>
|
|
105
104
|
<Title title="Xxlarge" theme="light" level={4} />
|
|
106
|
-
<DxcCard imageSrc=
|
|
105
|
+
<DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="xxlarge" imageCover>
|
|
107
106
|
Xxlarge
|
|
108
107
|
</DxcCard>
|
|
109
108
|
</ExampleContainer>
|
package/card/Card.test.js
CHANGED
|
@@ -6,7 +6,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
6
6
|
|
|
7
7
|
var _react2 = require("@testing-library/react");
|
|
8
8
|
|
|
9
|
-
var _Card = _interopRequireDefault(require("./Card"));
|
|
9
|
+
var _Card = _interopRequireDefault(require("./Card.tsx"));
|
|
10
10
|
|
|
11
11
|
describe("Card component tests", function () {
|
|
12
12
|
test("Card renders with correct content", function () {
|
package/checkbox/Checkbox.js
CHANGED
|
@@ -19,9 +19,9 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
19
19
|
|
|
20
20
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
21
|
|
|
22
|
-
var _variables = require("../common/variables
|
|
22
|
+
var _variables = require("../common/variables");
|
|
23
23
|
|
|
24
|
-
var _utils = require("../common/utils
|
|
24
|
+
var _utils = require("../common/utils");
|
|
25
25
|
|
|
26
26
|
var _uuid = require("uuid");
|
|
27
27
|
|
|
@@ -222,7 +222,7 @@ var Checkbox = _styledComponents["default"].span(_templateObject4 || (_templateO
|
|
|
222
222
|
return props.disabled && "pointer-events: none;";
|
|
223
223
|
});
|
|
224
224
|
|
|
225
|
-
var MainContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: center;\n gap: ", ";\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n
|
|
225
|
+
var MainContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: center;\n gap: ", ";\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n cursor: ", ";\n\n &:hover ", " {\n border: 2px solid\n ", ";\n background-color: ", ";\n color: ", ";\n }\n"])), function (props) {
|
|
226
226
|
return props.theme.checkLabelSpacing;
|
|
227
227
|
}, function (props) {
|
|
228
228
|
return calculateWidth(props.margin, props.size);
|
|
@@ -8,7 +8,7 @@ var _react2 = require("@testing-library/react");
|
|
|
8
8
|
|
|
9
9
|
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
10
10
|
|
|
11
|
-
var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
11
|
+
var _Checkbox = _interopRequireDefault(require("./Checkbox.tsx"));
|
|
12
12
|
|
|
13
13
|
describe("Checkbox component tests", function () {
|
|
14
14
|
test("Checkbox renders with correct aria-labelledby and aria-required", function () {
|
package/checkbox/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
+
declare type Margin = {
|
|
3
3
|
top?: Space;
|
|
4
4
|
bottom?: Space;
|
|
5
5
|
left?: Space;
|
package/chip/Chip.js
CHANGED
|
@@ -17,9 +17,9 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
17
17
|
|
|
18
18
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
19
19
|
|
|
20
|
-
var _variables = require("../common/variables
|
|
20
|
+
var _variables = require("../common/variables");
|
|
21
21
|
|
|
22
|
-
var _utils = require("../common/utils
|
|
22
|
+
var _utils = require("../common/utils");
|
|
23
23
|
|
|
24
24
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
25
25
|
|
|
@@ -49,7 +49,6 @@ var DxcChip = function DxcChip(_ref) {
|
|
|
49
49
|
disabled: disabled,
|
|
50
50
|
prefixIcon: true,
|
|
51
51
|
label: label,
|
|
52
|
-
mode: "prefix",
|
|
53
52
|
tabIndex: typeof onClickPrefix === "function" && !disabled ? tabIndex : -1,
|
|
54
53
|
onClick: function onClick() {
|
|
55
54
|
return onClickPrefix && !disabled && onClickPrefix();
|
|
@@ -62,7 +61,6 @@ var DxcChip = function DxcChip(_ref) {
|
|
|
62
61
|
}, label), suffixIcon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
63
62
|
disabled: disabled,
|
|
64
63
|
suffixIcon: true,
|
|
65
|
-
mode: "suffix",
|
|
66
64
|
label: label,
|
|
67
65
|
tabIndex: typeof onClickSuffix === "function" && !disabled ? tabIndex : -1,
|
|
68
66
|
onClick: function onClick() {
|
package/chip/Chip.test.js
CHANGED
|
@@ -6,9 +6,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
6
6
|
|
|
7
7
|
var _react2 = require("@testing-library/react");
|
|
8
8
|
|
|
9
|
-
var _Chip = _interopRequireDefault(require("./Chip"));
|
|
10
|
-
|
|
11
|
-
var _invision = _interopRequireDefault(require("../../app/src/images/invision.svg"));
|
|
9
|
+
var _Chip = _interopRequireDefault(require("./Chip.tsx"));
|
|
12
10
|
|
|
13
11
|
describe("Chip component tests", function () {
|
|
14
12
|
test("Chip renders with correct text", function () {
|
|
@@ -24,7 +22,7 @@ describe("Chip component tests", function () {
|
|
|
24
22
|
|
|
25
23
|
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Chip["default"], {
|
|
26
24
|
label: "Chip",
|
|
27
|
-
prefixIcon:
|
|
25
|
+
prefixIcon: "https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons/images/icon-and-image-large-icon-settings_2x.png",
|
|
28
26
|
onClickPrefix: onClick
|
|
29
27
|
})),
|
|
30
28
|
getByText = _render2.getByText,
|
|
@@ -41,7 +39,7 @@ describe("Chip component tests", function () {
|
|
|
41
39
|
|
|
42
40
|
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Chip["default"], {
|
|
43
41
|
label: "Chip",
|
|
44
|
-
suffixIcon:
|
|
42
|
+
suffixIcon: "https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons/images/icon-and-image-large-icon-settings_2x.png",
|
|
45
43
|
onClickSuffix: onClick
|
|
46
44
|
})),
|
|
47
45
|
getByText = _render3.getByText,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getMargin: (marginProp: string | object, side: string) => any;
|
package/common/utils.js
CHANGED
|
@@ -9,14 +9,14 @@ exports.getMargin = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
11
|
|
|
12
|
-
var _variables = require("./variables
|
|
12
|
+
var _variables = require("./variables");
|
|
13
13
|
|
|
14
14
|
var getMargin = function getMargin(marginProp, side) {
|
|
15
15
|
if (marginProp && (0, _typeof2["default"])(marginProp) === "object") {
|
|
16
16
|
return marginProp[side] && _variables.spaces[marginProp[side]] || "0px";
|
|
17
|
-
} else {
|
|
18
|
-
return
|
|
19
|
-
}
|
|
17
|
+
} else if (marginProp && typeof marginProp === "string") {
|
|
18
|
+
return _variables.spaces[marginProp];
|
|
19
|
+
} else return "0px";
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
exports.getMargin = getMargin;
|