@dxc-technology/halstack-react 0.0.0-c2834c3 → 0.0.0-c291a0c
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.js +1 -4
- 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 +62 -63
- package/bleed/types.d.ts +1 -1
- package/box/Box.js +22 -32
- package/card/Card.js +34 -36
- package/common/variables.js +4 -18
- package/footer/Icons.js +1 -1
- package/inline/Inline.d.ts +4 -0
- package/inline/Inline.js +54 -0
- package/inline/Inline.stories.tsx +264 -0
- package/inline/types.d.ts +32 -0
- package/{radio → inline}/types.js +0 -0
- package/inset/Inset.js +1 -34
- package/inset/Inset.stories.tsx +33 -33
- package/inset/types.d.ts +1 -1
- package/layout/ApplicationLayout.d.ts +4 -3
- package/layout/ApplicationLayout.js +83 -102
- 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 +2 -2
- package/link/Link.js +23 -49
- package/link/types.d.ts +2 -3
- package/list/List.js +1 -1
- package/list/List.stories.tsx +16 -22
- package/list/types.d.ts +1 -1
- package/main.d.ts +3 -2
- package/main.js +16 -8
- package/package.json +2 -1
- package/paginator/Paginator.test.js +42 -0
- package/progress-bar/ProgressBar.js +1 -1
- package/progress-bar/ProgressBar.stories.jsx +11 -11
- package/quick-nav/QuickNav.js +19 -23
- package/resultsetTable/ResultsetTable.test.js +42 -0
- package/select/Listbox.d.ts +1 -1
- package/select/Listbox.js +30 -7
- package/select/Select.js +73 -67
- package/select/Select.stories.tsx +130 -98
- package/select/Select.test.js +299 -194
- package/select/types.d.ts +3 -4
- package/sidenav/Sidenav.d.ts +1 -1
- package/sidenav/Sidenav.js +20 -9
- package/stack/Stack.d.ts +2 -1
- package/stack/Stack.js +23 -70
- package/stack/Stack.stories.tsx +139 -78
- package/stack/types.d.ts +11 -7
- 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/tabs-nav/types.js +5 -0
- package/radio/Radio.d.ts +0 -4
- package/radio/Radio.js +0 -173
- package/radio/Radio.stories.tsx +0 -192
- package/radio/Radio.test.js +0 -71
- package/radio/types.d.ts +0 -54
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
|
|
|
@@ -64,17 +64,6 @@ var DxcCard = function DxcCard(_ref) {
|
|
|
64
64
|
src: imageSrc
|
|
65
65
|
}));
|
|
66
66
|
|
|
67
|
-
var tagContent = /*#__PURE__*/_react["default"].createElement(_Box["default"], {
|
|
68
|
-
shadowDepth: !outlined ? 0 : isHovered && (onClick || linkHref) ? 2 : 1
|
|
69
|
-
}, /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
70
|
-
theme: colorsTheme.card
|
|
71
|
-
}, /*#__PURE__*/_react["default"].createElement(CardContainer, {
|
|
72
|
-
hasAction: onClick || linkHref,
|
|
73
|
-
imagePosition: imagePosition
|
|
74
|
-
}, imageSrc && imagePosition === "before" && imageComponent, /*#__PURE__*/_react["default"].createElement(CardContent, {
|
|
75
|
-
contentPadding: contentPadding
|
|
76
|
-
}, children), imageSrc && imagePosition === "after" && imageComponent)));
|
|
77
|
-
|
|
78
67
|
return /*#__PURE__*/_react["default"].createElement(StyledDxcCard, {
|
|
79
68
|
margin: margin,
|
|
80
69
|
onMouseEnter: function onMouseEnter() {
|
|
@@ -84,15 +73,23 @@ var DxcCard = function DxcCard(_ref) {
|
|
|
84
73
|
return changeIsHovered(false);
|
|
85
74
|
},
|
|
86
75
|
onClick: onClick,
|
|
87
|
-
hasAction: onClick,
|
|
88
|
-
tabIndex:
|
|
89
|
-
|
|
90
|
-
tabIndex: tabIndex,
|
|
76
|
+
hasAction: onClick || linkHref,
|
|
77
|
+
tabIndex: onClick || linkHref ? tabIndex : -1,
|
|
78
|
+
as: linkHref && "a",
|
|
91
79
|
href: linkHref
|
|
92
|
-
},
|
|
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))));
|
|
93
90
|
};
|
|
94
91
|
|
|
95
|
-
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) {
|
|
96
93
|
var hasAction = _ref2.hasAction;
|
|
97
94
|
return hasAction && "pointer" || "unset";
|
|
98
95
|
}, function (_ref3) {
|
|
@@ -113,49 +110,50 @@ var StyledDxcCard = _styledComponents["default"].div(_templateObject || (_templa
|
|
|
113
110
|
}, function (_ref8) {
|
|
114
111
|
var margin = _ref8.margin;
|
|
115
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 }";
|
|
116
116
|
});
|
|
117
117
|
|
|
118
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) {
|
|
119
119
|
return props.theme.height;
|
|
120
120
|
}, function (props) {
|
|
121
121
|
return props.theme.width;
|
|
122
|
-
}, function (
|
|
123
|
-
var hasAction =
|
|
122
|
+
}, function (_ref10) {
|
|
123
|
+
var hasAction = _ref10.hasAction;
|
|
124
124
|
return hasAction ? "" : "unset";
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
var
|
|
128
|
-
|
|
129
|
-
var TagImage = _styledComponents["default"].img(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n object-fit: ", ";\n"])), function (_ref10) {
|
|
130
|
-
var imagePadding = _ref10.imagePadding;
|
|
131
|
-
return !imagePadding ? "100%" : "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
|
|
132
|
-
}, function (_ref11) {
|
|
127
|
+
var TagImage = _styledComponents["default"].img(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n object-fit: ", ";\n"])), function (_ref11) {
|
|
133
128
|
var imagePadding = _ref11.imagePadding;
|
|
134
129
|
return !imagePadding ? "100%" : "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
|
|
135
130
|
}, function (_ref12) {
|
|
136
|
-
var
|
|
131
|
+
var imagePadding = _ref12.imagePadding;
|
|
132
|
+
return !imagePadding ? "100%" : "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
|
|
133
|
+
}, function (_ref13) {
|
|
134
|
+
var cover = _ref13.cover;
|
|
137
135
|
return cover ? "cover" : "contain";
|
|
138
136
|
});
|
|
139
137
|
|
|
140
|
-
var ImageContainer = _styledComponents["default"].div(
|
|
141
|
-
var imageBgColor =
|
|
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) {
|
|
139
|
+
var imageBgColor = _ref14.imageBgColor;
|
|
142
140
|
return imageBgColor;
|
|
143
141
|
});
|
|
144
142
|
|
|
145
|
-
var CardContent = _styledComponents["default"].div(
|
|
146
|
-
var contentPadding = _ref14.contentPadding;
|
|
147
|
-
return contentPadding && (0, _typeof2["default"])(contentPadding) !== "object" ? _variables.spaces[contentPadding] : "0px";
|
|
148
|
-
}, function (_ref15) {
|
|
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) {
|
|
149
144
|
var contentPadding = _ref15.contentPadding;
|
|
150
|
-
return contentPadding && (0, _typeof2["default"])(contentPadding)
|
|
145
|
+
return contentPadding && (0, _typeof2["default"])(contentPadding) !== "object" ? _variables.spaces[contentPadding] : "0px";
|
|
151
146
|
}, function (_ref16) {
|
|
152
147
|
var contentPadding = _ref16.contentPadding;
|
|
153
|
-
return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.
|
|
148
|
+
return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.top ? _variables.spaces[contentPadding.top] : "";
|
|
154
149
|
}, function (_ref17) {
|
|
155
150
|
var contentPadding = _ref17.contentPadding;
|
|
156
|
-
return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.
|
|
151
|
+
return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.right ? _variables.spaces[contentPadding.right] : "";
|
|
157
152
|
}, function (_ref18) {
|
|
158
153
|
var contentPadding = _ref18.contentPadding;
|
|
154
|
+
return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.bottom ? _variables.spaces[contentPadding.bottom] : "";
|
|
155
|
+
}, function (_ref19) {
|
|
156
|
+
var contentPadding = _ref19.contentPadding;
|
|
159
157
|
return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.left ? _variables.spaces[contentPadding.left] : "";
|
|
160
158
|
});
|
|
161
159
|
|
package/common/variables.js
CHANGED
|
@@ -800,24 +800,6 @@ var componentTokens = {
|
|
|
800
800
|
fontStyle: globalTokens.type_normal,
|
|
801
801
|
fontWeight: globalTokens.type_regular
|
|
802
802
|
},
|
|
803
|
-
radio: {
|
|
804
|
-
circleLabelSpacing: "10px",
|
|
805
|
-
circleSize: "24px",
|
|
806
|
-
color: globalTokens.black,
|
|
807
|
-
colorOnDark: globalTokens.white,
|
|
808
|
-
disabledColor: globalTokens.lighterBlack,
|
|
809
|
-
disabledColorOnDark: "#575757",
|
|
810
|
-
disabledFontColor: globalTokens.lighterBlack,
|
|
811
|
-
disabledFontColorOnDark: "#575757",
|
|
812
|
-
focusColor: globalTokens.hal_blue_l_50,
|
|
813
|
-
focusColorOnDark: "#1682FF",
|
|
814
|
-
fontColor: globalTokens.inherit,
|
|
815
|
-
fontColorOnDark: globalTokens.white,
|
|
816
|
-
fontFamily: globalTokens.type_sans,
|
|
817
|
-
fontSize: globalTokens.type_scale_root,
|
|
818
|
-
fontStyle: globalTokens.type_normal,
|
|
819
|
-
fontWeight: globalTokens.type_regular
|
|
820
|
-
},
|
|
821
803
|
radioGroup: {
|
|
822
804
|
fontFamily: globalTokens.type_sans,
|
|
823
805
|
radioInputColor: globalTokens.hal_blue_l_45,
|
|
@@ -1168,6 +1150,7 @@ var componentTokens = {
|
|
|
1168
1150
|
disabledFontColor: "#999999",
|
|
1169
1151
|
disabledIconColor: "#999999",
|
|
1170
1152
|
disabledFontStyle: globalTokens.type_normal,
|
|
1153
|
+
disabledBadgeBackgroundColor: "#0000004D",
|
|
1171
1154
|
hoverBackgroundColor: "#f2eafa",
|
|
1172
1155
|
pressedBackgroundColor: "#e5d5f6",
|
|
1173
1156
|
pressedFontWeight: globalTokens.type_semibold,
|
|
@@ -1479,6 +1462,9 @@ var defaultTranslatedComponentLabels = {
|
|
|
1479
1462
|
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
1480
1463
|
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
|
1481
1464
|
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
|
1465
|
+
},
|
|
1466
|
+
applicationLayout: {
|
|
1467
|
+
visibilityToggleTitle: "Toggle visibility sidenav"
|
|
1482
1468
|
}
|
|
1483
1469
|
};
|
|
1484
1470
|
exports.defaultTranslatedComponentLabels = defaultTranslatedComponentLabels;
|
package/footer/Icons.js
CHANGED
|
@@ -12,7 +12,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
12
12
|
var dxcLogo = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
13
13
|
id: "g10",
|
|
14
14
|
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
-
width: "
|
|
15
|
+
width: "100%",
|
|
16
16
|
height: "32",
|
|
17
17
|
viewBox: "0 0 280.781 32"
|
|
18
18
|
}, /*#__PURE__*/_react["default"].createElement("title", null, "DXC Logo"), /*#__PURE__*/_react["default"].createElement("g", {
|
package/inline/Inline.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
|
|
16
|
+
var _templateObject, _templateObject2;
|
|
17
|
+
|
|
18
|
+
var DxcInline = function DxcInline(_ref) {
|
|
19
|
+
var _ref$alignX = _ref.alignX,
|
|
20
|
+
alignX = _ref$alignX === void 0 ? "start" : _ref$alignX,
|
|
21
|
+
_ref$alignY = _ref.alignY,
|
|
22
|
+
alignY = _ref$alignY === void 0 ? "stretch" : _ref$alignY,
|
|
23
|
+
_ref$as = _ref.as,
|
|
24
|
+
as = _ref$as === void 0 ? "div" : _ref$as,
|
|
25
|
+
_ref$divider = _ref.divider,
|
|
26
|
+
divider = _ref$divider === void 0 ? false : _ref$divider,
|
|
27
|
+
_ref$gutter = _ref.gutter,
|
|
28
|
+
gutter = _ref$gutter === void 0 ? "0rem" : _ref$gutter,
|
|
29
|
+
_ref$reverse = _ref.reverse,
|
|
30
|
+
reverse = _ref$reverse === void 0 ? false : _ref$reverse,
|
|
31
|
+
children = _ref.children;
|
|
32
|
+
return /*#__PURE__*/_react["default"].createElement(Inline, {
|
|
33
|
+
as: as,
|
|
34
|
+
alignX: alignX,
|
|
35
|
+
alignY: alignY,
|
|
36
|
+
gutter: gutter,
|
|
37
|
+
reverse: reverse
|
|
38
|
+
}, _react["default"].Children.map(children, function (child, index) {
|
|
39
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, child, divider && index !== _react["default"].Children.count(children) - 1 && /*#__PURE__*/_react["default"].createElement(Divider, null));
|
|
40
|
+
}));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var Inline = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n ", "\n flex-wrap: wrap;\n"])), function (_ref2) {
|
|
44
|
+
var alignX = _ref2.alignX,
|
|
45
|
+
alignY = _ref2.alignY,
|
|
46
|
+
gutter = _ref2.gutter,
|
|
47
|
+
reverse = _ref2.reverse;
|
|
48
|
+
return "\n flex-direction: ".concat(reverse ? "row-reverse" : "row", ";\n align-items: ").concat(alignY === "start" || alignY === "end" ? "flex-".concat(alignY) : alignY, ";\n justify-content: ").concat(alignX === "start" || alignX === "end" ? "flex-".concat(alignX) : alignX, ";\n gap: ").concat(gutter, ";\n ");
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
var Divider = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n width: 1px;\n background-color: #999999;\n"])));
|
|
52
|
+
|
|
53
|
+
var _default = DxcInline;
|
|
54
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Title from "../../.storybook/components/Title";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import DxcInline from "./Inline";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Inline",
|
|
8
|
+
component: DxcInline,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Chromatic = () => (
|
|
12
|
+
<>
|
|
13
|
+
<Title title="Default" theme="light" level={4} />
|
|
14
|
+
<Container>
|
|
15
|
+
<DxcInline>
|
|
16
|
+
<Placeholder height="small" width="small" />
|
|
17
|
+
<Placeholder height="medium" width="medium" />
|
|
18
|
+
<Placeholder height="large" width="large" />
|
|
19
|
+
<Placeholder height="small" width="large" />
|
|
20
|
+
</DxcInline>
|
|
21
|
+
</Container>
|
|
22
|
+
<Title title="Default with divider" theme="light" level={4} />
|
|
23
|
+
<Container>
|
|
24
|
+
<DxcInline divider>
|
|
25
|
+
<Placeholder height="small" width="small" />
|
|
26
|
+
<Placeholder height="medium" width="medium" />
|
|
27
|
+
<Placeholder height="large" width="large" />
|
|
28
|
+
<Placeholder height="small" width="large" />
|
|
29
|
+
<Placeholder height="large" width="large" />
|
|
30
|
+
<Placeholder height="medium" width="small" />
|
|
31
|
+
</DxcInline>
|
|
32
|
+
</Container>
|
|
33
|
+
<Title title="One child larger than flex container" theme="light" level={4} />
|
|
34
|
+
<FlexContainer customWidth>
|
|
35
|
+
<DxcInline>
|
|
36
|
+
<Placeholder height="large" width="xlarge" />
|
|
37
|
+
</DxcInline>
|
|
38
|
+
</FlexContainer>
|
|
39
|
+
<Title title="Wrap" theme="light" level={4} />
|
|
40
|
+
<Container customWidth>
|
|
41
|
+
<DxcInline>
|
|
42
|
+
<Placeholder height="large" width="small" />
|
|
43
|
+
<Placeholder height="large" width="medium" />
|
|
44
|
+
<Placeholder height="medium" width="small" />
|
|
45
|
+
<Placeholder height="large" width="medium" />
|
|
46
|
+
</DxcInline>
|
|
47
|
+
</Container>
|
|
48
|
+
<Title title="AlignY = start" theme="light" level={4} />
|
|
49
|
+
<Container>
|
|
50
|
+
<DxcInline alignY="stretch">
|
|
51
|
+
<Placeholder width="small" />
|
|
52
|
+
<Placeholder height="medium" width="medium" />
|
|
53
|
+
<Placeholder height="large" width="large" />
|
|
54
|
+
<Placeholder height="small" width="large" />
|
|
55
|
+
</DxcInline>
|
|
56
|
+
</Container>
|
|
57
|
+
<Title title="AlignY = end" theme="light" level={4} />
|
|
58
|
+
<Container>
|
|
59
|
+
<DxcInline alignY="end">
|
|
60
|
+
<Placeholder height="small" width="small" />
|
|
61
|
+
<Placeholder height="medium" width="medium" />
|
|
62
|
+
<Placeholder height="large" width="large" />
|
|
63
|
+
<Placeholder height="small" width="large" />
|
|
64
|
+
</DxcInline>
|
|
65
|
+
</Container>
|
|
66
|
+
<Title title="AlignY = center" theme="light" level={4} />
|
|
67
|
+
<Container>
|
|
68
|
+
<DxcInline alignY="center">
|
|
69
|
+
<Placeholder height="small" width="small" />
|
|
70
|
+
<Placeholder height="medium" width="medium" />
|
|
71
|
+
<Placeholder height="large" width="large" />
|
|
72
|
+
<Placeholder height="small" width="large" />
|
|
73
|
+
</DxcInline>
|
|
74
|
+
</Container>
|
|
75
|
+
<Title title="AlignY with wrapped items" theme="light" level={4} />
|
|
76
|
+
<Container customWidth>
|
|
77
|
+
<DxcInline alignY="end">
|
|
78
|
+
<Placeholder height="large" width="small" />
|
|
79
|
+
<Placeholder height="large" width="medium" />
|
|
80
|
+
<Placeholder height="medium" width="small" />
|
|
81
|
+
<Placeholder height="large" width="medium" />
|
|
82
|
+
<Placeholder height="medium" width="small" />
|
|
83
|
+
<Placeholder height="small" width="medium" />
|
|
84
|
+
</DxcInline>
|
|
85
|
+
</Container>
|
|
86
|
+
<Title title="AlignY = baseline" theme="light" level={4} />
|
|
87
|
+
<Container>
|
|
88
|
+
<DxcInline alignY="baseline">
|
|
89
|
+
<Placeholder height="small" width="small" />
|
|
90
|
+
<Placeholder height="medium" width="medium" />
|
|
91
|
+
<Placeholder height="large" width="large" />
|
|
92
|
+
<Placeholder height="small" width="large" />
|
|
93
|
+
</DxcInline>
|
|
94
|
+
</Container>
|
|
95
|
+
<Title title="AlignX = start" theme="light" level={4} />
|
|
96
|
+
<Container>
|
|
97
|
+
<DxcInline alignX="start">
|
|
98
|
+
<Placeholder height="small" width="small" />
|
|
99
|
+
<Placeholder height="medium" width="medium" />
|
|
100
|
+
<Placeholder height="large" width="large" />
|
|
101
|
+
<Placeholder height="small" />
|
|
102
|
+
</DxcInline>
|
|
103
|
+
</Container>
|
|
104
|
+
<Title title="AlignX = end" theme="light" level={4} />
|
|
105
|
+
<Container>
|
|
106
|
+
<DxcInline alignX="end">
|
|
107
|
+
<Placeholder height="small" width="small" />
|
|
108
|
+
<Placeholder height="medium" width="medium" />
|
|
109
|
+
<Placeholder height="small" width="small" />
|
|
110
|
+
<Placeholder height="large" width="large" />
|
|
111
|
+
<Placeholder height="small" width="large" />
|
|
112
|
+
</DxcInline>
|
|
113
|
+
</Container>
|
|
114
|
+
<Title title="AlignX = center" theme="light" level={4} />
|
|
115
|
+
<Container>
|
|
116
|
+
<DxcInline alignX="center">
|
|
117
|
+
<Placeholder height="small" width="small" />
|
|
118
|
+
<Placeholder height="medium" width="medium" />
|
|
119
|
+
<Placeholder height="large" width="large" />
|
|
120
|
+
<Placeholder height="small" width="large" />
|
|
121
|
+
</DxcInline>
|
|
122
|
+
</Container>
|
|
123
|
+
<Title title="AlignX with wrapped items" theme="light" level={4} />
|
|
124
|
+
<Container customWidth>
|
|
125
|
+
<DxcInline alignX="center">
|
|
126
|
+
<Placeholder height="small" width="small" />
|
|
127
|
+
<Placeholder height="large" width="medium" />
|
|
128
|
+
<Placeholder height="medium" width="small" />
|
|
129
|
+
<Placeholder height="large" width="large" />
|
|
130
|
+
<Placeholder height="medium" width="small" />
|
|
131
|
+
<Placeholder height="small" width="large" />
|
|
132
|
+
<Placeholder height="large" width="large" />
|
|
133
|
+
<Placeholder height="large" width="medium" />
|
|
134
|
+
</DxcInline>
|
|
135
|
+
</Container>
|
|
136
|
+
<Title title="Gutter = 0.125rem" theme="light" level={4} />
|
|
137
|
+
<Container>
|
|
138
|
+
<DxcInline gutter="0.125rem">
|
|
139
|
+
<Placeholder height="small" width="small" />
|
|
140
|
+
<Placeholder height="medium" width="medium" />
|
|
141
|
+
<Placeholder height="large" width="large" />
|
|
142
|
+
<Placeholder height="small" width="large" />
|
|
143
|
+
</DxcInline>
|
|
144
|
+
</Container>
|
|
145
|
+
<Title title="Gutter = 0.25rem" theme="light" level={4} />
|
|
146
|
+
<Container>
|
|
147
|
+
<DxcInline gutter="0.25rem">
|
|
148
|
+
<Placeholder height="small" width="small" />
|
|
149
|
+
<Placeholder height="medium" width="medium" />
|
|
150
|
+
<Placeholder height="large" width="large" />
|
|
151
|
+
<Placeholder height="small" width="large" />
|
|
152
|
+
</DxcInline>
|
|
153
|
+
</Container>
|
|
154
|
+
<Title title="Gutter = 0.5rem" theme="light" level={4} />
|
|
155
|
+
<Container>
|
|
156
|
+
<DxcInline gutter="0.5rem">
|
|
157
|
+
<Placeholder height="small" width="small" />
|
|
158
|
+
<Placeholder height="medium" width="medium" />
|
|
159
|
+
<Placeholder height="large" width="large" />
|
|
160
|
+
<Placeholder height="small" width="large" />
|
|
161
|
+
</DxcInline>
|
|
162
|
+
</Container>
|
|
163
|
+
<Title title="Gutter = 0.75rem" theme="light" level={4} />
|
|
164
|
+
<Container>
|
|
165
|
+
<DxcInline gutter="0.75rem">
|
|
166
|
+
<Placeholder height="small" width="small" />
|
|
167
|
+
<Placeholder height="medium" width="medium" />
|
|
168
|
+
<Placeholder height="large" width="large" />
|
|
169
|
+
<Placeholder height="small" width="large" />
|
|
170
|
+
</DxcInline>
|
|
171
|
+
</Container>
|
|
172
|
+
<Title title="Gutter = 1rem" theme="light" level={4} />
|
|
173
|
+
<Container>
|
|
174
|
+
<DxcInline gutter="1rem">
|
|
175
|
+
<Placeholder height="small" width="small" />
|
|
176
|
+
<Placeholder height="medium" width="medium" />
|
|
177
|
+
<Placeholder height="large" width="large" />
|
|
178
|
+
<Placeholder height="small" width="large" />
|
|
179
|
+
</DxcInline>
|
|
180
|
+
</Container>
|
|
181
|
+
<Title title="Gutter = 1.5rem" theme="light" level={4} />
|
|
182
|
+
<Container>
|
|
183
|
+
<DxcInline gutter="1.5rem">
|
|
184
|
+
<Placeholder height="small" width="small" />
|
|
185
|
+
<Placeholder height="medium" width="medium" />
|
|
186
|
+
<Placeholder height="large" width="large" />
|
|
187
|
+
<Placeholder height="small" width="large" />
|
|
188
|
+
</DxcInline>
|
|
189
|
+
</Container>
|
|
190
|
+
<Title title="Gutter = 2rem and divider" theme="light" level={4} />
|
|
191
|
+
<Container>
|
|
192
|
+
<DxcInline gutter="2rem" divider>
|
|
193
|
+
<Placeholder height="small" width="small" />
|
|
194
|
+
<Placeholder height="medium" width="medium" />
|
|
195
|
+
<Placeholder height="large" width="large" />
|
|
196
|
+
<Placeholder height="small" width="large" />
|
|
197
|
+
</DxcInline>
|
|
198
|
+
</Container>
|
|
199
|
+
<Title title="Gutter = 3rem" theme="light" level={4} />
|
|
200
|
+
<Container>
|
|
201
|
+
<DxcInline gutter="3rem">
|
|
202
|
+
<Placeholder height="small" width="small" />
|
|
203
|
+
<Placeholder height="medium" width="medium" />
|
|
204
|
+
<Placeholder height="large" width="large" />
|
|
205
|
+
</DxcInline>
|
|
206
|
+
</Container>
|
|
207
|
+
<Title title="Gutter = 4rem" theme="light" level={4} />
|
|
208
|
+
<Container>
|
|
209
|
+
<DxcInline gutter="4rem">
|
|
210
|
+
<Placeholder height="small" width="small" />
|
|
211
|
+
<Placeholder height="medium" width="medium" />
|
|
212
|
+
</DxcInline>
|
|
213
|
+
</Container>
|
|
214
|
+
<Title title="Gutter = 5rem" theme="light" level={4} />
|
|
215
|
+
<Container>
|
|
216
|
+
<DxcInline gutter="5rem">
|
|
217
|
+
<Placeholder height="small" width="small" />
|
|
218
|
+
<Placeholder height="medium" width="medium" />
|
|
219
|
+
</DxcInline>
|
|
220
|
+
</Container>
|
|
221
|
+
<Title title="Reverse" theme="light" level={4} />
|
|
222
|
+
<Container>
|
|
223
|
+
<DxcInline reverse>
|
|
224
|
+
<Placeholder height="small" width="small">
|
|
225
|
+
1
|
|
226
|
+
</Placeholder>
|
|
227
|
+
<Placeholder height="medium" width="medium">
|
|
228
|
+
2
|
|
229
|
+
</Placeholder>
|
|
230
|
+
<Placeholder height="large" width="large">
|
|
231
|
+
3
|
|
232
|
+
</Placeholder>
|
|
233
|
+
<Placeholder height="small" width="large">
|
|
234
|
+
4
|
|
235
|
+
</Placeholder>
|
|
236
|
+
</DxcInline>
|
|
237
|
+
</Container>
|
|
238
|
+
</>
|
|
239
|
+
);
|
|
240
|
+
|
|
241
|
+
const FlexContainer = styled.div<{ customWidth?: boolean }>`
|
|
242
|
+
display: flex;
|
|
243
|
+
${({ customWidth }) => customWidth && `width: 200px;`};
|
|
244
|
+
background: #f2eafa;
|
|
245
|
+
`;
|
|
246
|
+
|
|
247
|
+
const Container = styled.div<{ customWidth?: boolean }>`
|
|
248
|
+
background: #f2eafa;
|
|
249
|
+
${({ customWidth }) => customWidth && `width: 300px;`};
|
|
250
|
+
`;
|
|
251
|
+
|
|
252
|
+
type PlaceholderProps = {
|
|
253
|
+
width?: "xlarge" | "large" | "medium" | "small" | "auto";
|
|
254
|
+
height?: "large" | "medium" | "small" | "auto";
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
const Placeholder = styled.div<PlaceholderProps>`
|
|
258
|
+
${({ width }) =>
|
|
259
|
+
width &&
|
|
260
|
+
`width: ${width === "xlarge" ? "350px" : width === "large" ? "150px" : width === "medium" ? "100px" : "50px"};`};
|
|
261
|
+
${({ height }) => height && `height: ${height === "large" ? "150px" : height === "medium" ? "100px" : "50px"};`};
|
|
262
|
+
border: 1px solid #a46ede;
|
|
263
|
+
background-color: #e5d5f6;
|
|
264
|
+
`;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Props = {
|
|
3
|
+
/**
|
|
4
|
+
* Alignment applied to children in the main axis.
|
|
5
|
+
*/
|
|
6
|
+
alignX?: "start" | "end" | "center";
|
|
7
|
+
/**
|
|
8
|
+
* Alignment applied to children in the cross axis.
|
|
9
|
+
*/
|
|
10
|
+
alignY?: "start" | "end" | "center" | "baseline" | "stretch";
|
|
11
|
+
/**
|
|
12
|
+
* Specifies the HTML tag or component that is rendered as the wrapper element.
|
|
13
|
+
*/
|
|
14
|
+
as?: React.ElementType;
|
|
15
|
+
/**
|
|
16
|
+
* If true, a divider is shown between each child.
|
|
17
|
+
*/
|
|
18
|
+
divider?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Space applied between each child.
|
|
21
|
+
*/
|
|
22
|
+
gutter?: "0rem" | "0.125rem" | "0.25rem" | "0.5rem" | "0.75rem" | "1rem" | "1.5rem" | "2rem" | "3rem" | "4rem" | "5rem";
|
|
23
|
+
/**
|
|
24
|
+
* If true, it changes the direction of the inline to reverse.
|
|
25
|
+
*/
|
|
26
|
+
reverse?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Custom content inside the stack.
|
|
29
|
+
*/
|
|
30
|
+
children: React.ReactNode[] | React.ReactNode;
|
|
31
|
+
};
|
|
32
|
+
export default Props;
|
|
File without changes
|
package/inset/Inset.js
CHANGED
|
@@ -36,40 +36,7 @@ function Inset(_ref) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
function getSpacingValue(spacingName) {
|
|
39
|
-
|
|
40
|
-
case "none":
|
|
41
|
-
return "0rem";
|
|
42
|
-
|
|
43
|
-
case "xxxsmall":
|
|
44
|
-
return "0.125rem";
|
|
45
|
-
|
|
46
|
-
case "xxsmall":
|
|
47
|
-
return "0.25rem";
|
|
48
|
-
|
|
49
|
-
case "xsmall":
|
|
50
|
-
return "0.5rem";
|
|
51
|
-
|
|
52
|
-
case "small":
|
|
53
|
-
return "1rem";
|
|
54
|
-
|
|
55
|
-
case "medium":
|
|
56
|
-
return "1.5rem";
|
|
57
|
-
|
|
58
|
-
case "large":
|
|
59
|
-
return "2rem";
|
|
60
|
-
|
|
61
|
-
case "xlarge":
|
|
62
|
-
return "3rem";
|
|
63
|
-
|
|
64
|
-
case "xxlarge":
|
|
65
|
-
return "4rem";
|
|
66
|
-
|
|
67
|
-
case "xxxlarge":
|
|
68
|
-
return "5rem";
|
|
69
|
-
|
|
70
|
-
default:
|
|
71
|
-
return "0rem";
|
|
72
|
-
}
|
|
39
|
+
return spacingName ? spacingName : "0rem";
|
|
73
40
|
}
|
|
74
41
|
|
|
75
42
|
var StyledInset = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n"])), function (_ref2) {
|