@dxc-technology/halstack-react 0.0.0-e201636 → 0.0.0-e26622f
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/accordion/Accordion.js +122 -103
- package/accordion/Accordion.stories.tsx +2 -3
- package/accordion/Accordion.test.js +9 -10
- package/accordion/types.d.ts +5 -4
- package/accordion-group/AccordionGroup.js +2 -21
- package/accordion-group/AccordionGroup.stories.tsx +27 -1
- package/accordion-group/AccordionGroup.test.js +20 -45
- package/accordion-group/types.d.ts +10 -3
- package/alert/Alert.js +1 -1
- package/bleed/Bleed.js +1 -34
- package/bleed/Bleed.stories.tsx +94 -95
- package/bleed/types.d.ts +1 -1
- package/box/Box.js +1 -1
- package/box/types.d.ts +1 -0
- package/bulleted-list/BulletedList.d.ts +7 -0
- package/bulleted-list/BulletedList.js +123 -0
- package/bulleted-list/BulletedList.stories.tsx +200 -0
- package/bulleted-list/types.d.ts +11 -0
- package/{list → bulleted-list}/types.js +0 -0
- package/button/Button.js +43 -61
- package/button/Button.stories.tsx +9 -0
- package/button/types.d.ts +7 -7
- package/card/Card.js +34 -36
- package/card/types.d.ts +1 -0
- package/checkbox/Checkbox.js +87 -95
- package/checkbox/Checkbox.test.js +93 -16
- package/checkbox/types.d.ts +2 -2
- package/chip/types.d.ts +1 -1
- package/common/variables.js +56 -18
- package/date-input/DateInput.js +3 -3
- package/dialog/Dialog.js +52 -28
- package/dialog/Dialog.stories.tsx +57 -2
- package/dialog/Dialog.test.js +34 -4
- package/dialog/types.d.ts +3 -2
- package/dropdown/Dropdown.d.ts +1 -1
- package/dropdown/Dropdown.js +244 -247
- package/dropdown/Dropdown.stories.tsx +126 -63
- package/dropdown/Dropdown.test.js +509 -108
- package/dropdown/DropdownMenu.d.ts +4 -0
- package/dropdown/DropdownMenu.js +80 -0
- package/dropdown/DropdownMenuItem.d.ts +4 -0
- package/dropdown/DropdownMenuItem.js +92 -0
- package/dropdown/types.d.ts +25 -5
- package/flex/Flex.d.ts +4 -0
- package/flex/Flex.js +69 -0
- package/flex/Flex.stories.tsx +103 -0
- package/flex/types.d.ts +32 -0
- package/{row → flex}/types.js +0 -0
- package/footer/Footer.stories.tsx +8 -1
- package/footer/Icons.js +1 -1
- package/footer/types.d.ts +2 -1
- package/header/Header.js +74 -72
- package/header/Header.stories.tsx +4 -4
- package/header/Icons.js +2 -2
- package/header/types.d.ts +3 -2
- package/inset/Inset.js +1 -34
- package/inset/Inset.stories.tsx +36 -36
- package/inset/types.d.ts +1 -1
- package/layout/ApplicationLayout.d.ts +15 -6
- package/layout/ApplicationLayout.js +37 -65
- package/layout/ApplicationLayout.stories.tsx +80 -44
- package/layout/types.d.ts +17 -27
- package/link/Link.js +1 -1
- package/link/Link.stories.tsx +13 -6
- package/link/types.d.ts +1 -1
- package/main.d.ts +5 -8
- package/main.js +28 -52
- package/number-input/NumberInput.test.js +1 -1
- package/package.json +10 -9
- package/paginator/Paginator.test.js +42 -0
- package/paragraph/Paragraph.d.ts +6 -0
- package/paragraph/Paragraph.js +38 -0
- package/paragraph/Paragraph.stories.tsx +44 -0
- package/password-input/PasswordInput.test.js +13 -12
- package/progress-bar/ProgressBar.d.ts +2 -2
- package/progress-bar/ProgressBar.js +56 -50
- package/progress-bar/ProgressBar.stories.jsx +3 -1
- package/progress-bar/ProgressBar.test.js +67 -22
- package/progress-bar/types.d.ts +3 -4
- package/quick-nav/QuickNav.js +25 -20
- package/quick-nav/QuickNav.stories.tsx +131 -26
- package/radio-group/Radio.d.ts +1 -1
- package/radio-group/Radio.js +43 -28
- package/radio-group/RadioGroup.js +26 -29
- package/radio-group/RadioGroup.stories.tsx +1 -0
- package/radio-group/RadioGroup.test.js +28 -58
- package/radio-group/types.d.ts +2 -2
- package/resultsetTable/ResultsetTable.test.js +42 -0
- package/select/Listbox.d.ts +1 -1
- package/select/Listbox.js +53 -7
- package/select/Select.js +42 -43
- package/select/Select.stories.tsx +131 -98
- package/select/Select.test.js +105 -50
- package/select/types.d.ts +2 -5
- package/sidenav/Sidenav.d.ts +6 -5
- package/sidenav/Sidenav.js +176 -55
- package/sidenav/Sidenav.stories.tsx +154 -156
- package/sidenav/Sidenav.test.js +25 -37
- package/sidenav/types.d.ts +50 -27
- package/slider/Slider.js +116 -92
- package/slider/Slider.stories.tsx +7 -1
- package/slider/Slider.test.js +121 -21
- package/slider/types.d.ts +2 -2
- package/switch/Switch.d.ts +1 -1
- package/switch/Switch.js +132 -66
- package/switch/Switch.stories.tsx +8 -30
- package/switch/Switch.test.js +144 -17
- package/switch/types.d.ts +3 -4
- package/tabs/Tab.d.ts +4 -0
- package/tabs/Tab.js +135 -0
- package/tabs/Tabs.js +360 -104
- package/tabs/Tabs.stories.tsx +74 -0
- package/tabs/Tabs.test.js +217 -6
- package/tabs/types.d.ts +15 -5
- package/tabs-nav/NavTabs.js +5 -5
- package/tabs-nav/Tab.js +3 -5
- package/tabs-nav/types.d.ts +1 -1
- package/tag/Tag.js +1 -1
- package/tag/types.d.ts +1 -1
- package/text-input/Icons.d.ts +8 -0
- package/text-input/Icons.js +60 -0
- package/text-input/Suggestion.js +7 -5
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +134 -0
- package/text-input/TextInput.js +181 -278
- package/text-input/TextInput.stories.tsx +189 -182
- package/text-input/TextInput.test.js +165 -163
- package/text-input/types.d.ts +22 -3
- package/toggle-group/types.d.ts +1 -1
- package/typography/Typography.d.ts +4 -0
- package/typography/Typography.js +131 -0
- package/typography/Typography.stories.tsx +198 -0
- package/typography/types.d.ts +18 -0
- package/{stack → typography}/types.js +0 -0
- package/wizard/Wizard.js +9 -16
- package/wizard/Wizard.stories.tsx +20 -1
- package/wizard/types.d.ts +5 -4
- 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/row/Row.d.ts +0 -3
- package/row/Row.js +0 -127
- package/row/Row.stories.tsx +0 -237
- package/row/types.d.ts +0 -28
- package/stack/Stack.d.ts +0 -3
- package/stack/Stack.js +0 -97
- package/stack/Stack.stories.tsx +0 -164
- package/stack/types.d.ts +0 -24
- package/text/Text.d.ts +0 -7
- package/text/Text.js +0 -30
- package/text/Text.stories.tsx +0 -19
|
@@ -13,8 +13,6 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
13
13
|
|
|
14
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
15
|
|
|
16
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
|
-
|
|
18
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
17
|
|
|
20
18
|
var _Header = _interopRequireDefault(require("../header/Header"));
|
|
@@ -29,13 +27,11 @@ var _variables = require("../common/variables.js");
|
|
|
29
27
|
|
|
30
28
|
var _Icons = require("./Icons");
|
|
31
29
|
|
|
32
|
-
var _uuid = require("uuid");
|
|
33
|
-
|
|
34
30
|
var _SidenavContext = require("./SidenavContext");
|
|
35
31
|
|
|
36
32
|
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
37
33
|
|
|
38
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8
|
|
34
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
39
35
|
|
|
40
36
|
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); }
|
|
41
37
|
|
|
@@ -43,24 +39,15 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
43
39
|
|
|
44
40
|
var year = new Date().getFullYear();
|
|
45
41
|
|
|
46
|
-
var
|
|
42
|
+
var Main = function Main(_ref) {
|
|
47
43
|
var children = _ref.children;
|
|
48
44
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children);
|
|
49
45
|
};
|
|
50
46
|
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
var Footer = function Footer(_ref3) {
|
|
57
|
-
var children = _ref3.children;
|
|
58
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
var Sidenav = function Sidenav(_ref4) {
|
|
62
|
-
var childProps = (0, _extends2["default"])({}, _ref4);
|
|
63
|
-
return /*#__PURE__*/_react["default"].createElement(_Sidenav["default"], childProps, childProps.children);
|
|
47
|
+
var defaultHeader = function defaultHeader() {
|
|
48
|
+
return /*#__PURE__*/_react["default"].createElement(_Header["default"], {
|
|
49
|
+
underlined: true
|
|
50
|
+
});
|
|
64
51
|
};
|
|
65
52
|
|
|
66
53
|
var defaultFooter = function defaultFooter() {
|
|
@@ -89,47 +76,37 @@ var defaultFooter = function defaultFooter() {
|
|
|
89
76
|
});
|
|
90
77
|
};
|
|
91
78
|
|
|
92
|
-
var defaultHeader = function defaultHeader() {
|
|
93
|
-
return /*#__PURE__*/_react["default"].createElement(_Header["default"], {
|
|
94
|
-
underlined: true
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
|
|
98
79
|
var childTypeExists = function childTypeExists(children, childType) {
|
|
99
80
|
return children.find(function (child) {
|
|
100
81
|
return (child === null || child === void 0 ? void 0 : child.type) === childType;
|
|
101
82
|
});
|
|
102
83
|
};
|
|
103
84
|
|
|
104
|
-
var DxcApplicationLayout = function DxcApplicationLayout(
|
|
105
|
-
var
|
|
106
|
-
visibilityToggleLabel =
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
appLayoutId = _useState2[0];
|
|
85
|
+
var DxcApplicationLayout = function DxcApplicationLayout(_ref2) {
|
|
86
|
+
var _ref2$visibilityToggl = _ref2.visibilityToggleLabel,
|
|
87
|
+
visibilityToggleLabel = _ref2$visibilityToggl === void 0 ? "" : _ref2$visibilityToggl,
|
|
88
|
+
header = _ref2.header,
|
|
89
|
+
sidenav = _ref2.sidenav,
|
|
90
|
+
footer = _ref2.footer,
|
|
91
|
+
children = _ref2.children;
|
|
112
92
|
|
|
113
|
-
var
|
|
93
|
+
var _useState = (0, _react.useState)(false),
|
|
94
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
95
|
+
isSidenavVisibleResponsive = _useState2[0],
|
|
96
|
+
setIsSidenavVisibleResponsive = _useState2[1];
|
|
114
97
|
|
|
115
98
|
var _useState3 = (0, _react.useState)(false),
|
|
116
99
|
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
var _useState5 = (0, _react.useState)(false),
|
|
121
|
-
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
122
|
-
isResponsive = _useState6[0],
|
|
123
|
-
setIsResponsive = _useState6[1];
|
|
100
|
+
isResponsive = _useState4[0],
|
|
101
|
+
setIsResponsive = _useState4[1];
|
|
124
102
|
|
|
125
103
|
var ref = (0, _react.useRef)(null);
|
|
126
104
|
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
127
105
|
|
|
128
106
|
var childrenArray = _react["default"].Children.toArray(children);
|
|
129
107
|
|
|
130
|
-
var
|
|
131
|
-
var
|
|
132
|
-
var sidenav = childTypeExists(childrenArray, Sidenav);
|
|
108
|
+
var headerContent = header || defaultHeader();
|
|
109
|
+
var footerContent = footer || defaultFooter();
|
|
133
110
|
var main = childTypeExists(childrenArray, Main);
|
|
134
111
|
|
|
135
112
|
var handleResize = function handleResize() {
|
|
@@ -142,58 +119,53 @@ var DxcApplicationLayout = function DxcApplicationLayout(_ref5) {
|
|
|
142
119
|
});
|
|
143
120
|
};
|
|
144
121
|
|
|
145
|
-
(0, _react.
|
|
122
|
+
(0, _react.useLayoutEffect)(function () {
|
|
146
123
|
handleResize();
|
|
147
124
|
window.addEventListener("resize", handleResize);
|
|
148
125
|
return function () {
|
|
149
126
|
window.removeEventListener("resize", handleResize);
|
|
150
127
|
};
|
|
151
|
-
}, [
|
|
128
|
+
}, []);
|
|
152
129
|
(0, _react.useEffect)(function () {
|
|
153
130
|
!isResponsive && setIsSidenavVisibleResponsive(false);
|
|
154
|
-
}, [isResponsive
|
|
131
|
+
}, [isResponsive]);
|
|
155
132
|
return /*#__PURE__*/_react["default"].createElement(ApplicationLayoutContainer, {
|
|
156
133
|
hasSidenav: sidenav ? true : false,
|
|
157
134
|
isSidenavVisible: isSidenavVisibleResponsive,
|
|
158
135
|
ref: ref
|
|
159
|
-
}, /*#__PURE__*/_react["default"].createElement(HeaderContainer, null,
|
|
136
|
+
}, /*#__PURE__*/_react["default"].createElement(HeaderContainer, null, headerContent), sidenav && isResponsive && /*#__PURE__*/_react["default"].createElement(VisibilityToggle, null, /*#__PURE__*/_react["default"].createElement(HamburgerTrigger, {
|
|
160
137
|
onClick: handleSidenavVisibility,
|
|
161
|
-
"aria-labelledby": visibilityToggleLabel ? visibilityToggleLabelId : undefined,
|
|
162
138
|
"aria-label": visibilityToggleLabel ? undefined : translatedLabels.applicationLayout.visibilityToggleTitle,
|
|
163
139
|
title: translatedLabels.applicationLayout.visibilityToggleTitle
|
|
164
|
-
}, _Icons.hamburgerIcon
|
|
165
|
-
id: visibilityToggleLabelId
|
|
166
|
-
}, visibilityToggleLabel)), /*#__PURE__*/_react["default"].createElement(BodyContainer, null, /*#__PURE__*/_react["default"].createElement(_SidenavContext.SidenavContextProvider, {
|
|
140
|
+
}, _Icons.hamburgerIcon, visibilityToggleLabel)), /*#__PURE__*/_react["default"].createElement(BodyContainer, null, /*#__PURE__*/_react["default"].createElement(_SidenavContext.SidenavContextProvider, {
|
|
167
141
|
value: setIsSidenavVisibleResponsive
|
|
168
|
-
}, sidenav && (isResponsive ? isSidenavVisibleResponsive : true) && /*#__PURE__*/_react["default"].createElement(SidenavContainer, null, sidenav)), /*#__PURE__*/_react["default"].createElement(MainContainer, null, /*#__PURE__*/_react["default"].createElement(MainContentContainer, null, main),
|
|
142
|
+
}, sidenav && (isResponsive ? isSidenavVisibleResponsive : true) && /*#__PURE__*/_react["default"].createElement(SidenavContainer, null, sidenav)), /*#__PURE__*/_react["default"].createElement(MainContainer, null, /*#__PURE__*/_react["default"].createElement(MainContentContainer, null, main), footerContent)));
|
|
169
143
|
};
|
|
170
144
|
|
|
171
145
|
var ApplicationLayoutContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n top: 64px;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n flex-direction: column;\n\n @media (max-width: ", "rem) {\n ", ";\n ", "\n }\n"])), _variables.responsiveSizes.medium, function (props) {
|
|
172
|
-
return props.hasSidenav && "top:
|
|
146
|
+
return props.hasSidenav && "top: 116px";
|
|
173
147
|
}, function (props) {
|
|
174
148
|
return props.isSidenavVisible && "overflow: hidden;";
|
|
175
149
|
});
|
|
176
150
|
|
|
177
151
|
var HeaderContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n z-index: 3;\n"])));
|
|
178
152
|
|
|
179
|
-
var VisibilityToggle = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n position: fixed;\n top: 64px;\n left: 0;\n right: 0;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n padding:
|
|
180
|
-
|
|
181
|
-
var HamburgerTrigger = _styledComponents["default"].button(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n border: 0px solid transparent;\n border-radius: 2px;\n padding: 3px;\n background-color: transparent;\n box-shadow: 0 0 0 2px transparent;\n cursor: pointer;\n\n :hover {\n background-color: #e6e6e6;\n }\n :active {\n background-color: #cccccc;\n }\n :focus,\n :focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px #0095ff;\n }\n & > svg {\n height: 20px;\n width: 20px;\n }\n"])));
|
|
153
|
+
var VisibilityToggle = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n position: fixed;\n top: 64px;\n left: 0;\n right: 0;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n padding: 4px 16px;\n width: 100%;\n background-color: #f2f2f2;\n user-select: none;\n z-index: 2;\n"])));
|
|
182
154
|
|
|
183
|
-
var
|
|
155
|
+
var HamburgerTrigger = _styledComponents["default"].button(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n border: 0px solid transparent;\n border-radius: 2px;\n padding: 12px 4px;\n background-color: transparent;\n box-shadow: 0 0 0 2px transparent;\n font-family: Open Sans, sans-serif;\n font-weight: 600;\n font-size: 14px;\n color: #000;\n cursor: pointer;\n :active {\n background-color: #cccccc;\n }\n :focus,\n :focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px #0095ff;\n }\n & > svg {\n height: 20px;\n width: 20px;\n }\n"])));
|
|
184
156
|
|
|
185
|
-
var BodyContainer = _styledComponents["default"].div(
|
|
157
|
+
var BodyContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n flex: 1;\n"])));
|
|
186
158
|
|
|
187
|
-
var SidenavContainer = _styledComponents["default"].div(
|
|
159
|
+
var SidenavContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n position: sticky;\n top: 64px;\n display: flex;\n height: calc(100vh - 64px);\n z-index: 1;\n\n @media (max-width: ", "rem) {\n position: absolute;\n top: 0px;\n height: 100%;\n }\n"])), _variables.responsiveSizes.medium);
|
|
188
160
|
|
|
189
|
-
var MainContainer = _styledComponents["default"].div(
|
|
161
|
+
var MainContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n width: 100%;\n"])));
|
|
190
162
|
|
|
191
|
-
var MainContentContainer = _styledComponents["default"].div(
|
|
163
|
+
var MainContentContainer = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n flex: 1;\n"])));
|
|
192
164
|
|
|
193
|
-
DxcApplicationLayout.Header =
|
|
165
|
+
DxcApplicationLayout.Header = _Header["default"];
|
|
194
166
|
DxcApplicationLayout.Main = Main;
|
|
195
|
-
DxcApplicationLayout.Footer =
|
|
196
|
-
DxcApplicationLayout.SideNav =
|
|
167
|
+
DxcApplicationLayout.Footer = _Footer["default"];
|
|
168
|
+
DxcApplicationLayout.SideNav = _Sidenav["default"];
|
|
197
169
|
DxcApplicationLayout.useResponsiveSidenavVisibility = _SidenavContext.useResponsiveSidenavVisibility;
|
|
198
170
|
var _default = DxcApplicationLayout;
|
|
199
171
|
exports["default"] = _default;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import DxcApplicationLayout from "./ApplicationLayout";
|
|
3
|
-
import DxcSidenav from "../sidenav/Sidenav";
|
|
4
3
|
import Title from "../../.storybook/components/Title";
|
|
5
4
|
import { INITIAL_VIEWPORTS } from "@storybook/addon-viewport";
|
|
6
5
|
|
|
@@ -30,15 +29,25 @@ export const DefaultApplicationLayout = () => (
|
|
|
30
29
|
|
|
31
30
|
export const ApplicationLayoutWithDefaultSidenav = () => (
|
|
32
31
|
<>
|
|
33
|
-
<DxcApplicationLayout
|
|
34
|
-
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
<DxcApplicationLayout
|
|
33
|
+
sidenav={
|
|
34
|
+
<DxcApplicationLayout.SideNav
|
|
35
|
+
title={
|
|
36
|
+
<DxcApplicationLayout.SideNav.Title>
|
|
37
|
+
Application layout with push sidenav
|
|
38
|
+
</DxcApplicationLayout.SideNav.Title>
|
|
39
|
+
}
|
|
40
|
+
>
|
|
41
|
+
<DxcApplicationLayout.SideNav.Section>
|
|
42
|
+
<p>SideNav Content</p>
|
|
43
|
+
<p>SideNav Content</p>
|
|
44
|
+
<p>SideNav Content</p>
|
|
45
|
+
<p>SideNav Content</p>
|
|
46
|
+
<p>SideNav Content</p>
|
|
47
|
+
</DxcApplicationLayout.SideNav.Section>
|
|
48
|
+
</DxcApplicationLayout.SideNav>
|
|
49
|
+
}
|
|
50
|
+
>
|
|
42
51
|
<DxcApplicationLayout.Main>
|
|
43
52
|
<p>Main Content</p>
|
|
44
53
|
<p>Main Content</p>
|
|
@@ -51,15 +60,26 @@ export const ApplicationLayoutWithDefaultSidenav = () => (
|
|
|
51
60
|
|
|
52
61
|
export const ApplicationLayoutWithResponsiveSidenav = () => (
|
|
53
62
|
<>
|
|
54
|
-
<DxcApplicationLayout
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
<DxcApplicationLayout
|
|
64
|
+
visibilityToggleLabel="Example"
|
|
65
|
+
sidenav={
|
|
66
|
+
<DxcApplicationLayout.SideNav
|
|
67
|
+
title={
|
|
68
|
+
<DxcApplicationLayout.SideNav.Title>
|
|
69
|
+
Application layout with push sidenav
|
|
70
|
+
</DxcApplicationLayout.SideNav.Title>
|
|
71
|
+
}
|
|
72
|
+
>
|
|
73
|
+
<DxcApplicationLayout.SideNav.Section>
|
|
74
|
+
<p>SideNav Content</p>
|
|
75
|
+
<p>SideNav Content</p>
|
|
76
|
+
<p>SideNav Content</p>
|
|
77
|
+
<p>SideNav Content</p>
|
|
78
|
+
<p>SideNav Content</p>
|
|
79
|
+
</DxcApplicationLayout.SideNav.Section>
|
|
80
|
+
</DxcApplicationLayout.SideNav>
|
|
81
|
+
}
|
|
82
|
+
>
|
|
63
83
|
<DxcApplicationLayout.Main>
|
|
64
84
|
<p>Main Content</p>
|
|
65
85
|
<p>Main Content</p>
|
|
@@ -74,23 +94,31 @@ ApplicationLayoutWithResponsiveSidenav.parameters = {
|
|
|
74
94
|
viewport: {
|
|
75
95
|
defaultViewport: "pixel",
|
|
76
96
|
},
|
|
97
|
+
chromatic: { viewports: [540] },
|
|
77
98
|
};
|
|
78
99
|
|
|
79
100
|
export const ApplicationLayoutWithCustomHeader = () => (
|
|
80
101
|
<>
|
|
81
|
-
<DxcApplicationLayout
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
<DxcApplicationLayout
|
|
103
|
+
header={<p>Custom Header</p>}
|
|
104
|
+
sidenav={
|
|
105
|
+
<DxcApplicationLayout.SideNav
|
|
106
|
+
title={
|
|
107
|
+
<DxcApplicationLayout.SideNav.Title>
|
|
108
|
+
Application layout with push sidenav
|
|
109
|
+
</DxcApplicationLayout.SideNav.Title>
|
|
110
|
+
}
|
|
111
|
+
>
|
|
112
|
+
<DxcApplicationLayout.SideNav.Section>
|
|
113
|
+
<p>SideNav Content</p>
|
|
114
|
+
<p>SideNav Content</p>
|
|
115
|
+
<p>SideNav Content</p>
|
|
116
|
+
<p>SideNav Content</p>
|
|
117
|
+
<p>SideNav Content</p>
|
|
118
|
+
</DxcApplicationLayout.SideNav.Section>
|
|
119
|
+
</DxcApplicationLayout.SideNav>
|
|
120
|
+
}
|
|
121
|
+
>
|
|
94
122
|
<DxcApplicationLayout.Main>
|
|
95
123
|
<p>Main Content</p>
|
|
96
124
|
<p>Main Content</p>
|
|
@@ -103,24 +131,32 @@ export const ApplicationLayoutWithCustomHeader = () => (
|
|
|
103
131
|
|
|
104
132
|
export const ApplicationLayoutWithCustomFooter = () => (
|
|
105
133
|
<>
|
|
106
|
-
<DxcApplicationLayout
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
<
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
134
|
+
<DxcApplicationLayout
|
|
135
|
+
footer={<p>Custom Footer</p>}
|
|
136
|
+
sidenav={
|
|
137
|
+
<DxcApplicationLayout.SideNav
|
|
138
|
+
title={
|
|
139
|
+
<DxcApplicationLayout.SideNav.Title>
|
|
140
|
+
Application layout with push sidenav
|
|
141
|
+
</DxcApplicationLayout.SideNav.Title>
|
|
142
|
+
}
|
|
143
|
+
>
|
|
144
|
+
<DxcApplicationLayout.SideNav.Section>
|
|
145
|
+
<p>SideNav Content</p>
|
|
146
|
+
<p>SideNav Content</p>
|
|
147
|
+
<p>SideNav Content</p>
|
|
148
|
+
<p>SideNav Content</p>
|
|
149
|
+
<p>SideNav Content</p>
|
|
150
|
+
</DxcApplicationLayout.SideNav.Section>
|
|
151
|
+
</DxcApplicationLayout.SideNav>
|
|
152
|
+
}
|
|
153
|
+
>
|
|
115
154
|
<DxcApplicationLayout.Main>
|
|
116
155
|
<p>Main Content</p>
|
|
117
156
|
<p>Main Content</p>
|
|
118
157
|
<p>Main Content</p>
|
|
119
158
|
<p>Main Content</p>
|
|
120
159
|
</DxcApplicationLayout.Main>
|
|
121
|
-
<DxcApplicationLayout.Footer>
|
|
122
|
-
<p>Custom Footer</p>
|
|
123
|
-
</DxcApplicationLayout.Footer>
|
|
124
160
|
</DxcApplicationLayout>
|
|
125
161
|
</>
|
|
126
162
|
);
|
package/layout/types.d.ts
CHANGED
|
@@ -1,42 +1,20 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare type
|
|
3
|
-
declare type Padding = {
|
|
4
|
-
top?: Space;
|
|
5
|
-
bottom?: Space;
|
|
6
|
-
left?: Space;
|
|
7
|
-
right?: Space;
|
|
8
|
-
};
|
|
9
|
-
declare type ChildrenType = AppLayoutHeaderPropsType | AppLayoutMainPropsType | AppLayoutFooterPropsType | AppLayoutSidenavPropsType;
|
|
10
|
-
export declare type AppLayoutHeaderPropsType = {
|
|
11
|
-
/**
|
|
12
|
-
* Everything between this tags will be displayed as a header, at the top of the screen.
|
|
13
|
-
* This is optional and if it is not specified, the DxcHeader will be shown by default.
|
|
14
|
-
*/
|
|
15
|
-
children?: React.ReactNode;
|
|
16
|
-
};
|
|
2
|
+
declare type ChildrenType = AppLayoutMainPropsType | AppLayoutSidenavPropsType;
|
|
17
3
|
export declare type AppLayoutMainPropsType = {
|
|
18
4
|
/**
|
|
19
5
|
* Everything between the tags will be displayed as the content of the main part of the application.
|
|
20
6
|
*/
|
|
21
7
|
children: React.ReactNode;
|
|
22
8
|
};
|
|
23
|
-
export declare type AppLayoutFooterPropsType = {
|
|
24
|
-
/**
|
|
25
|
-
* Everything between the tags will be displayed as a footer, at the bottom of the screen.
|
|
26
|
-
* This is optional and if it is not specified, the DxcFooter will be shown by default.
|
|
27
|
-
*/
|
|
28
|
-
children?: React.ReactNode;
|
|
29
|
-
};
|
|
30
9
|
export declare type AppLayoutSidenavPropsType = {
|
|
31
10
|
/**
|
|
32
|
-
*
|
|
33
|
-
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
11
|
+
* The area inside the sidenav. This area can be used to render the content inside the sidenav.
|
|
34
12
|
*/
|
|
35
|
-
|
|
13
|
+
children: React.ReactNode;
|
|
36
14
|
/**
|
|
37
|
-
* The area
|
|
15
|
+
* The area assigned to render the sidenav title. It is highly recommended to use the sidenav title.
|
|
38
16
|
*/
|
|
39
|
-
|
|
17
|
+
title?: React.ReactNode;
|
|
40
18
|
};
|
|
41
19
|
declare type AppLayoutPropsType = {
|
|
42
20
|
/**
|
|
@@ -44,6 +22,18 @@ declare type AppLayoutPropsType = {
|
|
|
44
22
|
* visibility of the sidenav.
|
|
45
23
|
*/
|
|
46
24
|
visibilityToggleLabel?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Header content.
|
|
27
|
+
*/
|
|
28
|
+
header?: React.ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Sidenav content
|
|
31
|
+
*/
|
|
32
|
+
sidenav?: React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Footer content
|
|
35
|
+
*/
|
|
36
|
+
footer?: React.ReactNode;
|
|
47
37
|
/**
|
|
48
38
|
* The area inside the sidenav. This area can be used to render custom content.
|
|
49
39
|
*/
|
package/link/Link.js
CHANGED
|
@@ -82,7 +82,7 @@ var DxcLink = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
82
82
|
})));
|
|
83
83
|
});
|
|
84
84
|
|
|
85
|
-
var StyledLink = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-size: ", ";\n font-weight: ", ";\n font-style: ", ";\n font-family: ", ";\n text-decoration-color: transparent;\n width: fit-content;\n\n ", "\n ", "\n color: ", ";\n ", "\n\n &:visited {\n color: ", ";\n &:hover {\n ", "\n }\n }\n &:hover {\n ", "\n }\n &:focus {\n border-radius: 2px;\n outline: 2px solid ", ";\n ", "\n }\n &:active {\n ", "\n }\n"])), function (props) {
|
|
85
|
+
var StyledLink = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: baseline;\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-size: ", ";\n font-weight: ", ";\n font-style: ", ";\n font-family: ", ";\n text-decoration-color: transparent;\n width: fit-content;\n\n ", "\n ", "\n color: ", ";\n ", "\n\n &:visited {\n color: ", ";\n &:hover {\n ", "\n }\n }\n &:hover {\n ", "\n }\n &:focus {\n border-radius: 2px;\n outline: 2px solid ", ";\n ", "\n }\n &:active {\n ", "\n }\n"])), function (props) {
|
|
86
86
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
87
87
|
}, function (props) {
|
|
88
88
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
package/link/Link.stories.tsx
CHANGED
|
@@ -9,7 +9,7 @@ export default {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
const icon = (
|
|
12
|
-
<svg viewBox="0 0 24 24"
|
|
12
|
+
<svg viewBox="0 0 24 24" enableBackground="new 0 0 24 24" fill="currentColor">
|
|
13
13
|
<g id="Bounding_Box">
|
|
14
14
|
<rect fill="none" width="24" height="24" />
|
|
15
15
|
</g>
|
|
@@ -68,11 +68,18 @@ export const Chromatic = () => (
|
|
|
68
68
|
</ExampleContainer>
|
|
69
69
|
<ExampleContainer pseudoState="pseudo-hover">
|
|
70
70
|
<Title title="Long text with hover" theme="light" level={4} />
|
|
71
|
-
Lorem
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
Lorem{" "}
|
|
72
|
+
<DxcLink href="https://www.google.com" icon={icon}>
|
|
73
|
+
Test
|
|
74
|
+
</DxcLink>{" "}
|
|
75
|
+
ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
|
|
76
|
+
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
77
|
+
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
78
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit{" "}
|
|
79
|
+
<DxcLink href="https://www.google.com" icon={icon} iconPosition="after">
|
|
80
|
+
Test
|
|
81
|
+
</DxcLink>{" "}
|
|
82
|
+
anim id est laborum.
|
|
76
83
|
</ExampleContainer>
|
|
77
84
|
<ExampleContainer pseudoState="pseudo-focus">
|
|
78
85
|
<Title title="Long text with focus" theme="light" level={4} />
|
package/link/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare type Margin = {
|
|
|
6
6
|
left?: Space;
|
|
7
7
|
right?: Space;
|
|
8
8
|
};
|
|
9
|
-
declare type SVG = React.SVGProps<SVGSVGElement>;
|
|
9
|
+
declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
10
10
|
export declare type LinkProps = {
|
|
11
11
|
/**
|
|
12
12
|
* If true, the color is inherited from parent.
|
package/main.d.ts
CHANGED
|
@@ -5,8 +5,6 @@ import DxcCard from "./card/Card";
|
|
|
5
5
|
import DxcCheckbox from "./checkbox/Checkbox";
|
|
6
6
|
import DxcDialog from "./dialog/Dialog";
|
|
7
7
|
import DxcDropdown from "./dropdown/Dropdown";
|
|
8
|
-
import DxcFooter from "./footer/Footer";
|
|
9
|
-
import DxcHeader from "./header/Header";
|
|
10
8
|
import DxcSlider from "./slider/Slider";
|
|
11
9
|
import DxcSwitch from "./switch/Switch";
|
|
12
10
|
import DxcTabs from "./tabs/Tabs";
|
|
@@ -16,7 +14,6 @@ import DxcTable from "./table/Table";
|
|
|
16
14
|
import DxcBox from "./box/Box";
|
|
17
15
|
import DxcTag from "./tag/Tag";
|
|
18
16
|
import DxcPaginator from "./paginator/Paginator";
|
|
19
|
-
import DxcSidenav from "./sidenav/Sidenav";
|
|
20
17
|
import DxcWizard from "./wizard/Wizard";
|
|
21
18
|
import DxcLink from "./link/Link";
|
|
22
19
|
import DxcHeading from "./heading/Heading";
|
|
@@ -33,15 +30,15 @@ import DxcNumberInput from "./number-input/NumberInput";
|
|
|
33
30
|
import DxcTextarea from "./textarea/Textarea";
|
|
34
31
|
import DxcSelect from "./select/Select";
|
|
35
32
|
import DxcFileInput from "./file-input/FileInput";
|
|
36
|
-
import DxcStack from "./stack/Stack";
|
|
37
|
-
import DxcRow from "./row/Row";
|
|
38
|
-
import DxcText from "./text/Text";
|
|
39
|
-
import DxcList from "./list/List";
|
|
40
33
|
import DxcRadioGroup from "./radio-group/RadioGroup";
|
|
41
34
|
import DxcBleed from "./bleed/Bleed";
|
|
42
35
|
import DxcInset from "./inset/Inset";
|
|
43
36
|
import DxcQuickNav from "./quick-nav/QuickNav";
|
|
44
37
|
import DxcNavTabs from "./tabs-nav/NavTabs";
|
|
38
|
+
import DxcFlex from "./flex/Flex";
|
|
39
|
+
import DxcTypography from "./typography/Typography";
|
|
40
|
+
import DxcParagraph from "./paragraph/Paragraph";
|
|
41
|
+
import DxcBulletedList from "./bulleted-list/BulletedList";
|
|
45
42
|
import HalstackContext, { HalstackProvider, HalstackLanguageContext } from "./HalstackContext";
|
|
46
43
|
import { BackgroundColorProvider } from "./BackgroundColorContext";
|
|
47
|
-
export { DxcAlert, DxcButton,
|
|
44
|
+
export { DxcAlert, DxcButton, DxcCheckbox, DxcTextInput, DxcDropdown, DxcSwitch, DxcSlider, DxcTable, DxcTabs, DxcToggleGroup, DxcDialog, DxcCard, DxcProgressBar, DxcAccordion, DxcSpinner, DxcBox, DxcTag, DxcPaginator, DxcWizard, DxcLink, DxcHeading, DxcResultsetTable, DxcChip, DxcApplicationLayout, HalstackContext, HalstackLanguageContext, HalstackProvider, BackgroundColorProvider, DxcAccordionGroup, DxcBadge, DxcPasswordInput, DxcDateInput, DxcNumberInput, DxcTextarea, DxcSelect, DxcFileInput, DxcRadioGroup, DxcBleed, DxcInset, DxcQuickNav, DxcNavTabs, DxcFlex, DxcTypography, DxcParagraph, DxcBulletedList, };
|