@dxc-technology/halstack-react 0.0.0-1c4cbc0 → 0.0.0-1d5e7bf
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 +15 -14
- package/accordion/Accordion.stories.tsx +1 -1
- package/accordion-group/AccordionGroup.js +1 -0
- 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 +19 -14
- package/dropdown/Dropdown.stories.tsx +1 -1
- package/footer/Icons.js +1 -1
- package/inline/Inline.d.ts +4 -0
- package/inline/Inline.js +60 -0
- package/inline/Inline.stories.tsx +319 -0
- package/inline/types.d.ts +36 -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/Link.stories.tsx +1 -1
- 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 +65 -18
- package/quick-nav/QuickNav.stories.tsx +30 -3
- package/radio-group/RadioGroup.js +2 -1
- 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 +29 -70
- package/stack/Stack.stories.tsx +189 -90
- package/stack/types.d.ts +15 -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/select/types.d.ts
CHANGED
|
@@ -201,11 +201,10 @@ export declare type ListboxProps = {
|
|
|
201
201
|
optionalItem: Option;
|
|
202
202
|
searchable: boolean;
|
|
203
203
|
handleOptionOnClick: (option: Option) => void;
|
|
204
|
+
styles: {
|
|
205
|
+
width: number;
|
|
206
|
+
};
|
|
204
207
|
};
|
|
205
|
-
/**
|
|
206
|
-
* Reference to the listbox component.
|
|
207
|
-
*/
|
|
208
|
-
export declare type ListboxRefType = HTMLUListElement;
|
|
209
208
|
/**
|
|
210
209
|
* Reference to the select component.
|
|
211
210
|
*/
|
package/sidenav/Sidenav.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import SidenavPropsType, { SidenavTitlePropsType, SidenavSubtitlePropsType, SidenavLinkPropsType } from "./types
|
|
2
|
+
import SidenavPropsType, { SidenavTitlePropsType, SidenavSubtitlePropsType, SidenavLinkPropsType } from "./types";
|
|
3
3
|
declare const DxcSidenav: {
|
|
4
4
|
({ padding, children }: SidenavPropsType): JSX.Element;
|
|
5
5
|
Title: ({ children }: SidenavTitlePropsType) => JSX.Element;
|
package/sidenav/Sidenav.js
CHANGED
|
@@ -21,6 +21,8 @@ var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
|
21
21
|
|
|
22
22
|
var _BackgroundColorContext = require("../BackgroundColorContext");
|
|
23
23
|
|
|
24
|
+
var _SidenavContext = require("../layout/SidenavContext");
|
|
25
|
+
|
|
24
26
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
25
27
|
|
|
26
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); }
|
|
@@ -33,7 +35,7 @@ var DxcSidenav = function DxcSidenav(_ref) {
|
|
|
33
35
|
var colorsTheme = (0, _useTheme["default"])();
|
|
34
36
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
35
37
|
theme: colorsTheme.sidenav
|
|
36
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
38
|
+
}, /*#__PURE__*/_react["default"].createElement(SidenavContainer, {
|
|
37
39
|
padding: padding
|
|
38
40
|
}, /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
39
41
|
color: colorsTheme.sidenav.backgroundColor
|
|
@@ -42,12 +44,12 @@ var DxcSidenav = function DxcSidenav(_ref) {
|
|
|
42
44
|
|
|
43
45
|
var Title = function Title(_ref2) {
|
|
44
46
|
var children = _ref2.children;
|
|
45
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
47
|
+
return /*#__PURE__*/_react["default"].createElement(SidenavMenuTitle, null, children);
|
|
46
48
|
};
|
|
47
49
|
|
|
48
50
|
var Subtitle = function Subtitle(_ref3) {
|
|
49
51
|
var children = _ref3.children;
|
|
50
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
52
|
+
return /*#__PURE__*/_react["default"].createElement(SidenavMenuSubTitle, null, children);
|
|
51
53
|
};
|
|
52
54
|
|
|
53
55
|
var Link = function Link(_ref4) {
|
|
@@ -56,15 +58,24 @@ var Link = function Link(_ref4) {
|
|
|
56
58
|
href = _ref4.href,
|
|
57
59
|
onClick = _ref4.onClick,
|
|
58
60
|
children = _ref4.children;
|
|
59
|
-
|
|
61
|
+
var setIsSidenavVisibleResponsive = (0, _SidenavContext.useResponsiveSidenavVisibility)();
|
|
62
|
+
|
|
63
|
+
var handleClick = function handleClick() {
|
|
64
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
65
|
+
setIsSidenavVisibleResponsive === null || setIsSidenavVisibleResponsive === void 0 ? void 0 : setIsSidenavVisibleResponsive(false);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return /*#__PURE__*/_react["default"].createElement(SidenavMenuLink, {
|
|
60
69
|
tabIndex: tabIndex,
|
|
61
70
|
href: href,
|
|
62
|
-
onClick:
|
|
71
|
+
onClick: handleClick
|
|
63
72
|
}, children);
|
|
64
73
|
};
|
|
65
74
|
|
|
66
|
-
var
|
|
75
|
+
var SidenavContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n background-color: ", ";\n\n @media (max-width: ", "rem) {\n width: ", ";\n }\n\n width: ", ";\n padding: ", ";\n\n overflow-y: auto;\n overflow-x: hidden;\n ::-webkit-scrollbar {\n width: 2px;\n }\n ::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 3px;\n }\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 3px;\n }\n"])), function (props) {
|
|
67
76
|
return props.theme.backgroundColor;
|
|
77
|
+
}, _variables.responsiveSizes.medium, function (props) {
|
|
78
|
+
return props.padding ? "calc(100vw - ".concat(_variables.spaces[props.padding], " - ").concat(_variables.spaces[props.padding], ")") : "100vw";
|
|
68
79
|
}, function (props) {
|
|
69
80
|
return props.padding ? "calc(300px - ".concat(_variables.spaces[props.padding], " - ").concat(_variables.spaces[props.padding], ")") : "300px";
|
|
70
81
|
}, function (props) {
|
|
@@ -75,7 +86,7 @@ var SideNavContainer = _styledComponents["default"].div(_templateObject || (_tem
|
|
|
75
86
|
return props.theme.scrollBarThumbColor;
|
|
76
87
|
});
|
|
77
88
|
|
|
78
|
-
var
|
|
89
|
+
var SidenavMenuTitle = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n margin-bottom: 16px;\n"])), function (props) {
|
|
79
90
|
return props.theme.titleFontFamily;
|
|
80
91
|
}, function (props) {
|
|
81
92
|
return props.theme.titleFontSize;
|
|
@@ -91,7 +102,7 @@ var SideNavMenuTitle = _styledComponents["default"].div(_templateObject2 || (_te
|
|
|
91
102
|
return props.theme.titleFontTextTransform;
|
|
92
103
|
});
|
|
93
104
|
|
|
94
|
-
var
|
|
105
|
+
var SidenavMenuSubTitle = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n margin-bottom: 4px;\n"])), function (props) {
|
|
95
106
|
return props.theme.subtitleFontFamily;
|
|
96
107
|
}, function (props) {
|
|
97
108
|
return props.theme.subtitleFontSize;
|
|
@@ -107,7 +118,7 @@ var SideNavMenuSubTitle = _styledComponents["default"].div(_templateObject3 || (
|
|
|
107
118
|
return props.theme.subtitleFontTextTransform;
|
|
108
119
|
});
|
|
109
120
|
|
|
110
|
-
var
|
|
121
|
+
var SidenavMenuLink = _styledComponents["default"].a(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n text-decoration: ", ";\n margin: ", ";\n cursor: pointer;\n\n :focus-visible {\n outline: 2px solid ", ";\n outline-offset: 1px;\n }\n"])), function (props) {
|
|
111
122
|
return props.theme.linkFontFamily;
|
|
112
123
|
}, function (props) {
|
|
113
124
|
return props.theme.linkFontSize;
|
package/stack/Stack.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import StackPropsType from "./types";
|
|
3
|
-
|
|
3
|
+
declare const DxcStack: ({ alignX, as, divider, gutter, reverse, wrap, children, }: StackPropsType) => JSX.Element;
|
|
4
|
+
export default DxcStack;
|
package/stack/Stack.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports["default"] =
|
|
8
|
+
exports["default"] = void 0;
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
@@ -15,83 +15,42 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
15
15
|
|
|
16
16
|
var _templateObject, _templateObject2;
|
|
17
17
|
|
|
18
|
-
function
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
align = _ref.align,
|
|
18
|
+
var DxcStack = function DxcStack(_ref) {
|
|
19
|
+
var _ref$alignX = _ref.alignX,
|
|
20
|
+
alignX = _ref$alignX === void 0 ? "stretch" : _ref$alignX,
|
|
22
21
|
_ref$as = _ref.as,
|
|
23
22
|
as = _ref$as === void 0 ? "div" : _ref$as,
|
|
23
|
+
_ref$divider = _ref.divider,
|
|
24
|
+
divider = _ref$divider === void 0 ? false : _ref$divider,
|
|
25
|
+
_ref$gutter = _ref.gutter,
|
|
26
|
+
gutter = _ref$gutter === void 0 ? "0rem" : _ref$gutter,
|
|
27
|
+
_ref$reverse = _ref.reverse,
|
|
28
|
+
reverse = _ref$reverse === void 0 ? false : _ref$reverse,
|
|
29
|
+
_ref$wrap = _ref.wrap,
|
|
30
|
+
wrap = _ref$wrap === void 0 ? false : _ref$wrap,
|
|
24
31
|
children = _ref.children;
|
|
25
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
32
|
+
return /*#__PURE__*/_react["default"].createElement(Stack, {
|
|
26
33
|
gutter: gutter,
|
|
34
|
+
alignX: alignX,
|
|
35
|
+
reverse: reverse,
|
|
36
|
+
as: as,
|
|
27
37
|
divider: divider,
|
|
28
|
-
|
|
29
|
-
as: as
|
|
38
|
+
wrap: wrap
|
|
30
39
|
}, _react["default"].Children.map(children, function (child, index) {
|
|
31
40
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, child, divider && index !== _react["default"].Children.count(children) - 1 && /*#__PURE__*/_react["default"].createElement(Divider, null));
|
|
32
41
|
}));
|
|
33
|
-
}
|
|
42
|
+
};
|
|
34
43
|
|
|
35
|
-
var Divider = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n height: 1px;\n background-color: #999999;\n"])));
|
|
44
|
+
var Divider = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\n height: 1px;\n background-color: #999999;\n"])));
|
|
36
45
|
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return "center";
|
|
46
|
-
|
|
47
|
-
case "end":
|
|
48
|
-
return "flex-end";
|
|
49
|
-
|
|
50
|
-
case "baseline":
|
|
51
|
-
return "baseline";
|
|
52
|
-
|
|
53
|
-
case "stretch":
|
|
54
|
-
return "stretch";
|
|
55
|
-
|
|
56
|
-
default:
|
|
57
|
-
return "initial";
|
|
58
|
-
}
|
|
59
|
-
}, function (_ref3) {
|
|
60
|
-
var gutter = _ref3.gutter,
|
|
61
|
-
divider = _ref3.divider;
|
|
62
|
-
|
|
63
|
-
switch (gutter) {
|
|
64
|
-
case "none":
|
|
65
|
-
return "0";
|
|
66
|
-
|
|
67
|
-
case "xxxsmall":
|
|
68
|
-
return "calc(0.125rem / ".concat(divider ? 2 : 1, ")");
|
|
69
|
-
|
|
70
|
-
case "xxsmall":
|
|
71
|
-
return "calc(0.25rem / ".concat(divider ? 2 : 1, ")");
|
|
72
|
-
|
|
73
|
-
case "xsmall":
|
|
74
|
-
return "calc(0.5rem / ".concat(divider ? 2 : 1, ")");
|
|
75
|
-
|
|
76
|
-
case "small":
|
|
77
|
-
return "calc(1rem / ".concat(divider ? 2 : 1, ")");
|
|
78
|
-
|
|
79
|
-
case "medium":
|
|
80
|
-
return "calc(1.5rem / ".concat(divider ? 2 : 1, ")");
|
|
81
|
-
|
|
82
|
-
case "large":
|
|
83
|
-
return "calc(2rem / ".concat(divider ? 2 : 1, ")");
|
|
84
|
-
|
|
85
|
-
case "xlarge":
|
|
86
|
-
return "calc(3rem / ".concat(divider ? 2 : 1, ")");
|
|
87
|
-
|
|
88
|
-
case "xxlarge":
|
|
89
|
-
return "calc(4rem / ".concat(divider ? 2 : 1, ")");
|
|
90
|
-
|
|
91
|
-
case "xxxlarge":
|
|
92
|
-
return "calc(5rem / ".concat(divider ? 2 : 1, ")");
|
|
46
|
+
var Stack = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n ", "\n padding: 0px;\n margin: 0px;\n height: 100%;\n"])), function (_ref2) {
|
|
47
|
+
var alignX = _ref2.alignX,
|
|
48
|
+
gutter = _ref2.gutter,
|
|
49
|
+
reverse = _ref2.reverse,
|
|
50
|
+
divider = _ref2.divider,
|
|
51
|
+
wrap = _ref2.wrap;
|
|
52
|
+
return "\n flex-direction: ".concat(reverse ? "column-reverse" : "column", ";\n align-items: ").concat(alignX === "start" || alignX === "end" ? "flex-".concat(alignX) : alignX, ";\n gap: ").concat(divider ? "calc(".concat(gutter, "/2 - 1px)") : gutter, ";\n flex-wrap: ").concat(wrap ? "wrap" : "nowrap", ";\n ");
|
|
53
|
+
});
|
|
93
54
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
});
|
|
55
|
+
var _default = DxcStack;
|
|
56
|
+
exports["default"] = _default;
|
package/stack/Stack.stories.tsx
CHANGED
|
@@ -13,152 +13,251 @@ export const Chromatic = () => (
|
|
|
13
13
|
<Title title="Default" theme="light" level={4} />
|
|
14
14
|
<Container>
|
|
15
15
|
<DxcStack>
|
|
16
|
-
<Placeholder
|
|
17
|
-
<Placeholder
|
|
18
|
-
<Placeholder
|
|
16
|
+
<Placeholder height="small" width="small" />
|
|
17
|
+
<Placeholder height="medium" width="medium" />
|
|
18
|
+
<Placeholder height="large" width="large" />
|
|
19
|
+
<Placeholder height="small" width="large" />
|
|
19
20
|
</DxcStack>
|
|
20
21
|
</Container>
|
|
21
|
-
<Title title="
|
|
22
|
+
<Title title="Default with divider" theme="light" level={4} />
|
|
22
23
|
<Container>
|
|
23
|
-
<DxcStack
|
|
24
|
-
<Placeholder
|
|
25
|
-
<Placeholder
|
|
26
|
-
<Placeholder
|
|
24
|
+
<DxcStack divider>
|
|
25
|
+
<Placeholder height="medium" width="medium" />
|
|
26
|
+
<Placeholder height="large" width="large" />
|
|
27
|
+
<Placeholder height="small" width="large" />
|
|
27
28
|
</DxcStack>
|
|
28
29
|
</Container>
|
|
29
|
-
<Title title="
|
|
30
|
+
<Title title="Alignment with divider" theme="light" level={4} />
|
|
30
31
|
<Container>
|
|
31
|
-
<DxcStack
|
|
32
|
-
<Placeholder
|
|
33
|
-
<Placeholder
|
|
34
|
-
<Placeholder
|
|
32
|
+
<DxcStack alignX="end" divider>
|
|
33
|
+
<Placeholder height="small" width="small" />
|
|
34
|
+
<Placeholder height="small" width="medium" />
|
|
35
|
+
<Placeholder height="medium" width="small" />
|
|
35
36
|
</DxcStack>
|
|
36
37
|
</Container>
|
|
37
|
-
<Title title="
|
|
38
|
+
<Title title="Default with one child" theme="light" level={4} />
|
|
38
39
|
<Container>
|
|
39
|
-
<DxcStack
|
|
40
|
-
<Placeholder
|
|
41
|
-
<Placeholder></Placeholder>
|
|
42
|
-
<Placeholder paddingLeft={60}></Placeholder>
|
|
40
|
+
<DxcStack divider>
|
|
41
|
+
<Placeholder height="large" width="xlarge" />
|
|
43
42
|
</DxcStack>
|
|
44
43
|
</Container>
|
|
45
|
-
<Title title="
|
|
44
|
+
<Title title="Wrap" theme="light" level={4} />
|
|
45
|
+
<FlexContainer customHeight>
|
|
46
|
+
<DxcStack wrap>
|
|
47
|
+
<Placeholder height="small" width="small" />
|
|
48
|
+
<Placeholder height="large" width="medium" />
|
|
49
|
+
<Placeholder height="medium" width="small" />
|
|
50
|
+
<Placeholder height="large" width="medium" />
|
|
51
|
+
</DxcStack>
|
|
52
|
+
</FlexContainer>
|
|
53
|
+
<Title title="No wrap in a flex container" theme="light" level={4} />
|
|
54
|
+
<FlexContainer customHeight>
|
|
55
|
+
<DxcStack>
|
|
56
|
+
<Placeholder height="small" width="small" />
|
|
57
|
+
<Placeholder height="medium" width="small" />
|
|
58
|
+
<Placeholder height="small" width="medium" />
|
|
59
|
+
</DxcStack>
|
|
60
|
+
</FlexContainer>
|
|
61
|
+
<Title title="No wrap (default)" theme="light" level={4} />
|
|
62
|
+
<Container customHeight>
|
|
63
|
+
<DxcStack>
|
|
64
|
+
<Placeholder height="small" width="medium" />
|
|
65
|
+
<Placeholder height="small" width="small" />
|
|
66
|
+
</DxcStack>
|
|
67
|
+
</Container>
|
|
68
|
+
<Title title="AlignX = start" theme="light" level={4} />
|
|
46
69
|
<Container>
|
|
47
|
-
<DxcStack
|
|
48
|
-
<Placeholder
|
|
49
|
-
<Placeholder
|
|
50
|
-
<Placeholder
|
|
70
|
+
<DxcStack alignX="start">
|
|
71
|
+
<Placeholder height="small" width="small" />
|
|
72
|
+
<Placeholder height="large" width="medium" />
|
|
73
|
+
<Placeholder height="medium" width="small" />
|
|
74
|
+
<Placeholder height="large" width="medium" />
|
|
51
75
|
</DxcStack>
|
|
52
76
|
</Container>
|
|
53
|
-
<Title title="
|
|
77
|
+
<Title title="AlignX = end" theme="light" level={4} />
|
|
54
78
|
<Container>
|
|
55
|
-
<DxcStack
|
|
56
|
-
<Placeholder
|
|
57
|
-
<Placeholder
|
|
58
|
-
<Placeholder
|
|
79
|
+
<DxcStack alignX="end">
|
|
80
|
+
<Placeholder height="small" width="small" />
|
|
81
|
+
<Placeholder height="large" width="medium" />
|
|
82
|
+
<Placeholder height="medium" width="small" />
|
|
59
83
|
</DxcStack>
|
|
60
84
|
</Container>
|
|
61
|
-
<Title title="
|
|
85
|
+
<Title title="AlignX = center" theme="light" level={4} />
|
|
62
86
|
<Container>
|
|
63
|
-
<DxcStack
|
|
64
|
-
<Placeholder
|
|
65
|
-
<Placeholder
|
|
66
|
-
<Placeholder
|
|
87
|
+
<DxcStack alignX="center">
|
|
88
|
+
<Placeholder height="small" width="small" />
|
|
89
|
+
<Placeholder height="large" width="medium" />
|
|
90
|
+
<Placeholder height="medium" width="small" />
|
|
91
|
+
<Placeholder height="large" width="medium" />
|
|
67
92
|
</DxcStack>
|
|
68
93
|
</Container>
|
|
69
|
-
<Title title="
|
|
94
|
+
<Title title="AlignX = baseline" theme="light" level={4} />
|
|
70
95
|
<Container>
|
|
71
|
-
<DxcStack
|
|
72
|
-
<Placeholder
|
|
73
|
-
<Placeholder
|
|
74
|
-
<Placeholder
|
|
96
|
+
<DxcStack alignX="baseline">
|
|
97
|
+
<Placeholder height="small" width="small" />
|
|
98
|
+
<Placeholder height="large" width="medium" />
|
|
99
|
+
<Placeholder height="medium" width="small" />
|
|
75
100
|
</DxcStack>
|
|
76
101
|
</Container>
|
|
77
|
-
<Title title="
|
|
102
|
+
<Title title="AlignX with wrapped items" theme="light" level={4} />
|
|
103
|
+
<Container customHeight>
|
|
104
|
+
<DxcStack alignX="center" wrap>
|
|
105
|
+
<Placeholder height="small" width="medium" />
|
|
106
|
+
<Placeholder height="small" width="small" />
|
|
107
|
+
</DxcStack>
|
|
108
|
+
</Container>
|
|
109
|
+
<Title title="Gutter = 0rem" theme="light" level={4} />
|
|
110
|
+
<Container>
|
|
111
|
+
<DxcStack gutter="0rem">
|
|
112
|
+
<Placeholder height="small" width="medium" />
|
|
113
|
+
<Placeholder height="large" width="small" />
|
|
114
|
+
<Placeholder height="medium" width="medium" />
|
|
115
|
+
<Placeholder height="large" width="small" />
|
|
116
|
+
<Placeholder height="small" width="medium" />
|
|
117
|
+
</DxcStack>
|
|
118
|
+
</Container>
|
|
119
|
+
<Title title="Gutter = 0.125rem" theme="light" level={4} />
|
|
78
120
|
<Container>
|
|
79
|
-
<DxcStack gutter="
|
|
80
|
-
<Placeholder
|
|
81
|
-
<Placeholder
|
|
82
|
-
<Placeholder
|
|
121
|
+
<DxcStack gutter="0.125rem">
|
|
122
|
+
<Placeholder height="small" width="small" />
|
|
123
|
+
<Placeholder height="large" width="medium" />
|
|
124
|
+
<Placeholder height="medium" width="small" />
|
|
83
125
|
</DxcStack>
|
|
84
126
|
</Container>
|
|
85
|
-
<Title title="
|
|
127
|
+
<Title title="Gutter = 0.25rem" theme="light" level={4} />
|
|
86
128
|
<Container>
|
|
87
|
-
<DxcStack gutter="
|
|
88
|
-
<Placeholder
|
|
89
|
-
<Placeholder
|
|
90
|
-
<Placeholder
|
|
129
|
+
<DxcStack gutter="0.25rem">
|
|
130
|
+
<Placeholder height="small" width="medium" />
|
|
131
|
+
<Placeholder height="large" width="small" />
|
|
132
|
+
<Placeholder height="medium" width="medium" />
|
|
133
|
+
<Placeholder height="large" width="small" />
|
|
134
|
+
<Placeholder height="small" width="medium" />
|
|
91
135
|
</DxcStack>
|
|
92
136
|
</Container>
|
|
93
|
-
<Title title="
|
|
137
|
+
<Title title="Gutter = 0.5rem" theme="light" level={4} />
|
|
94
138
|
<Container>
|
|
95
|
-
<DxcStack gutter="
|
|
96
|
-
<Placeholder
|
|
97
|
-
<Placeholder
|
|
98
|
-
<Placeholder
|
|
139
|
+
<DxcStack gutter="0.5rem">
|
|
140
|
+
<Placeholder height="small" width="small" />
|
|
141
|
+
<Placeholder height="large" width="medium" />
|
|
142
|
+
<Placeholder height="medium" width="small" />
|
|
99
143
|
</DxcStack>
|
|
100
144
|
</Container>
|
|
101
|
-
<Title title="
|
|
145
|
+
<Title title="Gutter = 0.75rem" theme="light" level={4} />
|
|
102
146
|
<Container>
|
|
103
|
-
<DxcStack gutter="
|
|
104
|
-
<Placeholder
|
|
105
|
-
<Placeholder
|
|
106
|
-
<Placeholder
|
|
147
|
+
<DxcStack gutter="0.75rem">
|
|
148
|
+
<Placeholder height="small" width="medium" />
|
|
149
|
+
<Placeholder height="large" width="small" />
|
|
150
|
+
<Placeholder height="medium" width="medium" />
|
|
151
|
+
<Placeholder height="large" width="small" />
|
|
152
|
+
<Placeholder height="small" width="medium" />
|
|
107
153
|
</DxcStack>
|
|
108
154
|
</Container>
|
|
109
|
-
<Title title="
|
|
155
|
+
<Title title="Gutter = 1rem" theme="light" level={4} />
|
|
110
156
|
<Container>
|
|
111
|
-
<DxcStack gutter="
|
|
112
|
-
<Placeholder
|
|
113
|
-
<Placeholder
|
|
114
|
-
<Placeholder
|
|
157
|
+
<DxcStack gutter="1rem">
|
|
158
|
+
<Placeholder height="small" width="small" />
|
|
159
|
+
<Placeholder height="large" width="medium" />
|
|
160
|
+
<Placeholder height="medium" width="small" />
|
|
115
161
|
</DxcStack>
|
|
116
162
|
</Container>
|
|
117
|
-
<Title title="
|
|
163
|
+
<Title title="Gutter = 1.5rem" theme="light" level={4} />
|
|
118
164
|
<Container>
|
|
119
|
-
<DxcStack gutter="
|
|
120
|
-
<Placeholder
|
|
121
|
-
<Placeholder
|
|
122
|
-
<Placeholder
|
|
165
|
+
<DxcStack gutter="1.5rem">
|
|
166
|
+
<Placeholder height="small" width="medium" />
|
|
167
|
+
<Placeholder height="large" width="small" />
|
|
168
|
+
<Placeholder height="medium" width="medium" />
|
|
169
|
+
<Placeholder height="large" width="small" />
|
|
170
|
+
<Placeholder height="small" width="medium" />
|
|
123
171
|
</DxcStack>
|
|
124
172
|
</Container>
|
|
125
|
-
<Title title="
|
|
173
|
+
<Title title="Gutter = 2rem & divider" theme="light" level={4} />
|
|
126
174
|
<Container>
|
|
127
|
-
<DxcStack gutter="
|
|
128
|
-
<Placeholder
|
|
129
|
-
<Placeholder
|
|
130
|
-
<Placeholder
|
|
175
|
+
<DxcStack gutter="2rem" divider>
|
|
176
|
+
<Placeholder height="small" width="small" />
|
|
177
|
+
<Placeholder height="large" width="medium" />
|
|
178
|
+
<Placeholder height="medium" width="small" />
|
|
131
179
|
</DxcStack>
|
|
132
180
|
</Container>
|
|
133
|
-
<Title title="
|
|
181
|
+
<Title title="Gutter = 3rem" theme="light" level={4} />
|
|
134
182
|
<Container>
|
|
135
|
-
<DxcStack gutter="
|
|
136
|
-
<Placeholder
|
|
137
|
-
<Placeholder
|
|
138
|
-
<Placeholder
|
|
183
|
+
<DxcStack gutter="3rem">
|
|
184
|
+
<Placeholder height="small" width="small" />
|
|
185
|
+
<Placeholder height="large" width="medium" />
|
|
186
|
+
<Placeholder height="medium" width="small" />
|
|
139
187
|
</DxcStack>
|
|
140
188
|
</Container>
|
|
141
|
-
<Title title="
|
|
189
|
+
<Title title="Gutter = 4rem" theme="light" level={4} />
|
|
142
190
|
<Container>
|
|
143
|
-
<DxcStack gutter="
|
|
144
|
-
<Placeholder
|
|
145
|
-
<Placeholder
|
|
146
|
-
<Placeholder></Placeholder>
|
|
191
|
+
<DxcStack gutter="4rem">
|
|
192
|
+
<Placeholder height="large" width="medium" />
|
|
193
|
+
<Placeholder height="medium" width="small" />
|
|
147
194
|
</DxcStack>
|
|
148
195
|
</Container>
|
|
196
|
+
<Title title="Gutter = 5rem" theme="light" level={4} />
|
|
197
|
+
<Container>
|
|
198
|
+
<DxcStack gutter="5rem">
|
|
199
|
+
<Placeholder height="small" width="small" />
|
|
200
|
+
<Placeholder height="medium" width="small" />
|
|
201
|
+
</DxcStack>
|
|
202
|
+
</Container>
|
|
203
|
+
<Title title="Reverse" theme="light" level={4} />
|
|
204
|
+
<Container>
|
|
205
|
+
<DxcStack reverse>
|
|
206
|
+
<Placeholder height="small" width="medium">
|
|
207
|
+
1
|
|
208
|
+
</Placeholder>
|
|
209
|
+
<Placeholder height="large" width="small">
|
|
210
|
+
2
|
|
211
|
+
</Placeholder>
|
|
212
|
+
<Placeholder height="medium" width="medium">
|
|
213
|
+
3
|
|
214
|
+
</Placeholder>
|
|
215
|
+
<Placeholder height="large" width="small">
|
|
216
|
+
4
|
|
217
|
+
</Placeholder>
|
|
218
|
+
</DxcStack>
|
|
219
|
+
</Container>
|
|
220
|
+
<Title title="Wrapped and reversed children" theme="light" level={4} />
|
|
221
|
+
<FlexContainer customHeight>
|
|
222
|
+
<DxcStack reverse wrap>
|
|
223
|
+
<Placeholder height="small" width="medium">
|
|
224
|
+
1
|
|
225
|
+
</Placeholder>
|
|
226
|
+
<Placeholder height="large" width="small">
|
|
227
|
+
2
|
|
228
|
+
</Placeholder>
|
|
229
|
+
<Placeholder height="medium" width="medium">
|
|
230
|
+
3
|
|
231
|
+
</Placeholder>
|
|
232
|
+
<Placeholder height="large" width="small">
|
|
233
|
+
4
|
|
234
|
+
</Placeholder>
|
|
235
|
+
</DxcStack>
|
|
236
|
+
</FlexContainer>
|
|
149
237
|
</>
|
|
150
238
|
);
|
|
151
239
|
|
|
152
|
-
const
|
|
240
|
+
const FlexContainer = styled.div<{ customHeight?: boolean }>`
|
|
241
|
+
display: flex;
|
|
242
|
+
${({ customHeight }) => customHeight && `height: 100px;`};
|
|
153
243
|
background: #f2eafa;
|
|
154
|
-
padding: 10px;
|
|
155
244
|
`;
|
|
156
245
|
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
246
|
+
const Container = styled.div<{ customHeight?: boolean }>`
|
|
247
|
+
background: #f2eafa;
|
|
248
|
+
${({ customHeight }) => customHeight && `height: 100px;`};
|
|
249
|
+
`;
|
|
250
|
+
|
|
251
|
+
type PlaceholderProps = {
|
|
252
|
+
width?: "xlarge" | "large" | "medium" | "small" | "auto";
|
|
253
|
+
height?: "large" | "medium" | "small" | "auto";
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
const Placeholder = styled.div<PlaceholderProps>`
|
|
257
|
+
${({ width }) =>
|
|
258
|
+
width &&
|
|
259
|
+
`width: ${width === "xlarge" ? "350px" : width === "large" ? "150px" : width === "medium" ? "100px" : "50px"};`};
|
|
260
|
+
${({ height }) => height && `height: ${height === "large" ? "100px" : height === "medium" ? "80px" : "50px"};`};
|
|
160
261
|
border: 1px solid #a46ede;
|
|
161
262
|
background-color: #e5d5f6;
|
|
162
|
-
padding-left: ${({ paddingLeft }) => `${paddingLeft ?? 0}px`};
|
|
163
|
-
padding-right: ${({ paddingRight }) => `${paddingRight ?? 0}px`};
|
|
164
263
|
`;
|
package/stack/types.d.ts
CHANGED
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare type Props = {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Alignment applied to children in the main axis.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
alignX?: "start" | "end" | "center" | "baseline" | "stretch";
|
|
7
|
+
/**
|
|
8
|
+
* Specifies the HTML tag or component that is rendered as the wrapper element.
|
|
9
|
+
*/
|
|
10
|
+
as?: React.ElementType;
|
|
7
11
|
/**
|
|
8
12
|
* If true, a divider is shown between children.
|
|
9
13
|
*/
|
|
10
14
|
divider?: boolean;
|
|
11
15
|
/**
|
|
12
|
-
*
|
|
16
|
+
* Space applied between each child.
|
|
13
17
|
*/
|
|
14
|
-
|
|
18
|
+
gutter?: "0rem" | "0.125rem" | "0.25rem" | "0.5rem" | "0.75rem" | "1rem" | "1.5rem" | "2rem" | "3rem" | "4rem" | "5rem";
|
|
15
19
|
/**
|
|
16
|
-
*
|
|
20
|
+
* Change the direction of the stack to reverse.
|
|
17
21
|
*/
|
|
18
|
-
|
|
22
|
+
reverse?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Sets whether the children are forced onto one column or can wrap onto multiple columns.
|
|
25
|
+
*/
|
|
26
|
+
wrap?: boolean;
|
|
19
27
|
/**
|
|
20
28
|
* Custom content inside the stack.
|
|
21
29
|
*/
|
|
22
|
-
children: React.ReactNode;
|
|
30
|
+
children: React.ReactNode[] | React.ReactNode;
|
|
23
31
|
};
|
|
24
32
|
export default Props;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { NavTabsContextProps, NavTabsProps } from "./types";
|
|
3
|
+
export declare const NavTabsContext: React.Context<NavTabsContextProps>;
|
|
4
|
+
declare const DxcNavTabs: {
|
|
5
|
+
({ iconPosition, tabIndex, children }: NavTabsProps): JSX.Element;
|
|
6
|
+
Tab: React.ForwardRefExoticComponent<import("./types").TabProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
7
|
+
};
|
|
8
|
+
export default DxcNavTabs;
|