@dxc-technology/halstack-react 0.0.0-8b5e703 → 0.0.0-8c10296
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/bleed/Bleed.js +1 -34
- package/bleed/Bleed.stories.tsx +31 -32
- package/bleed/types.d.ts +1 -1
- package/box/Box.js +22 -32
- package/card/Card.js +34 -36
- package/common/variables.js +3 -18
- package/inline/Inline.d.ts +4 -0
- package/inline/Inline.js +54 -0
- package/inline/Inline.stories.tsx +240 -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 +32 -32
- 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.js +10 -3
- package/main.d.ts +2 -2
- package/main.js +8 -8
- package/package.json +2 -1
- package/paginator/Paginator.test.js +42 -0
- package/quick-nav/QuickNav.js +2 -2
- package/resultsetTable/ResultsetTable.test.js +42 -0
- package/select/Listbox.d.ts +1 -1
- package/select/Listbox.js +30 -7
- package/select/Select.js +46 -31
- package/select/Select.stories.tsx +130 -98
- package/select/Select.test.js +42 -0
- package/select/types.d.ts +3 -4
- package/sidenav/Sidenav.d.ts +1 -1
- package/sidenav/Sidenav.js +20 -9
- package/tabs-nav/NavTabs.d.ts +2 -1
- package/tabs-nav/NavTabs.js +35 -16
- package/tabs-nav/Tab.js +26 -11
- package/tabs-nav/types.d.ts +6 -4
- 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
|
@@ -13,23 +13,29 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
13
13
|
|
|
14
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
17
|
|
|
18
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _Header = _interopRequireDefault(require("../header/Header"));
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _Footer = _interopRequireDefault(require("../footer/Footer"));
|
|
23
|
+
|
|
24
|
+
var _Sidenav = _interopRequireDefault(require("../sidenav/Sidenav"));
|
|
25
|
+
|
|
26
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
23
27
|
|
|
24
28
|
var _variables = require("../common/variables.js");
|
|
25
29
|
|
|
26
30
|
var _Icons = require("./Icons");
|
|
27
31
|
|
|
28
|
-
var
|
|
32
|
+
var _uuid = require("uuid");
|
|
29
33
|
|
|
30
|
-
var
|
|
34
|
+
var _SidenavContext = require("./SidenavContext");
|
|
31
35
|
|
|
32
|
-
var
|
|
36
|
+
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
37
|
+
|
|
38
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
33
39
|
|
|
34
40
|
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); }
|
|
35
41
|
|
|
@@ -52,17 +58,13 @@ var Footer = function Footer(_ref3) {
|
|
|
52
58
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children);
|
|
53
59
|
};
|
|
54
60
|
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
_props$mode = props.mode,
|
|
59
|
-
mode = _props$mode === void 0 ? "overlay" : _props$mode,
|
|
60
|
-
childProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
61
|
-
return /*#__PURE__*/_react["default"].createElement(_main.DxcSidenav, childProps, childProps.children);
|
|
61
|
+
var Sidenav = function Sidenav(_ref4) {
|
|
62
|
+
var childProps = (0, _extends2["default"])({}, _ref4);
|
|
63
|
+
return /*#__PURE__*/_react["default"].createElement(_Sidenav["default"], childProps, childProps.children);
|
|
62
64
|
};
|
|
63
65
|
|
|
64
66
|
var defaultFooter = function defaultFooter() {
|
|
65
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
67
|
+
return /*#__PURE__*/_react["default"].createElement(_Footer["default"], {
|
|
66
68
|
copyright: "\xA9 DXC Technology ".concat(year, "\u200B\u200B\u200B\u200B. All rights reserved."),
|
|
67
69
|
bottomLinks: [{
|
|
68
70
|
href: "https://www.linkedin.com/company/dxctechnology",
|
|
@@ -88,131 +90,110 @@ var defaultFooter = function defaultFooter() {
|
|
|
88
90
|
};
|
|
89
91
|
|
|
90
92
|
var defaultHeader = function defaultHeader() {
|
|
91
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
93
|
+
return /*#__PURE__*/_react["default"].createElement(_Header["default"], {
|
|
92
94
|
underlined: true
|
|
93
95
|
});
|
|
94
96
|
};
|
|
95
97
|
|
|
96
98
|
var childTypeExists = function childTypeExists(children, childType) {
|
|
97
99
|
return children.find(function (child) {
|
|
98
|
-
return child
|
|
100
|
+
return (child === null || child === void 0 ? void 0 : child.type) === childType;
|
|
99
101
|
});
|
|
100
102
|
};
|
|
101
103
|
|
|
102
|
-
var DxcApplicationLayout = function DxcApplicationLayout(
|
|
103
|
-
var
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
var DxcApplicationLayout = function DxcApplicationLayout(_ref5) {
|
|
105
|
+
var _ref5$visibilityToggl = _ref5.visibilityToggleLabel,
|
|
106
|
+
visibilityToggleLabel = _ref5$visibilityToggl === void 0 ? "" : _ref5$visibilityToggl,
|
|
107
|
+
children = _ref5.children;
|
|
106
108
|
|
|
107
|
-
var _useState = (0, _react.useState)(
|
|
108
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState,
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
var _useState = (0, _react.useState)("appLayout-".concat((0, _uuid.v4)())),
|
|
110
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 1),
|
|
111
|
+
appLayoutId = _useState2[0];
|
|
112
|
+
|
|
113
|
+
var visibilityToggleLabelId = "label-".concat(appLayoutId);
|
|
111
114
|
|
|
112
115
|
var _useState3 = (0, _react.useState)(false),
|
|
113
116
|
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
isSidenavVisibleResponsive = _useState4[0],
|
|
118
|
+
setIsSidenavVisibleResponsive = _useState4[1];
|
|
119
|
+
|
|
120
|
+
var _useState5 = (0, _react.useState)(false),
|
|
121
|
+
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
122
|
+
isResponsive = _useState6[0],
|
|
123
|
+
setIsResponsive = _useState6[1];
|
|
124
|
+
|
|
125
|
+
var ref = (0, _react.useRef)(null);
|
|
126
|
+
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
116
127
|
|
|
117
128
|
var childrenArray = _react["default"].Children.toArray(children);
|
|
118
129
|
|
|
119
|
-
var header = childTypeExists(childrenArray,
|
|
120
|
-
var footer = childTypeExists(childrenArray,
|
|
121
|
-
var
|
|
130
|
+
var header = childTypeExists(childrenArray, _Header["default"]) || childTypeExists(childrenArray, Header) || defaultHeader();
|
|
131
|
+
var footer = childTypeExists(childrenArray, _Footer["default"]) || childTypeExists(childrenArray, Footer) || defaultFooter();
|
|
132
|
+
var sidenav = childTypeExists(childrenArray, Sidenav);
|
|
122
133
|
var main = childTypeExists(childrenArray, Main);
|
|
123
|
-
var displayArrow = sideNav && sideNav.props && sideNav.props.displayArrow;
|
|
124
|
-
var sideNavMode = sideNav && sideNav.props && sideNav.props.mode;
|
|
125
|
-
|
|
126
|
-
var ArrowIcon = function ArrowIcon() {
|
|
127
|
-
return /*#__PURE__*/_react["default"].createElement("svg", {
|
|
128
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
129
|
-
width: "15.995",
|
|
130
|
-
height: "10.01",
|
|
131
|
-
viewBox: "0 0 15.995 10.01"
|
|
132
|
-
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
133
|
-
"data-testid": "arrow-to-right",
|
|
134
|
-
d: "M17.71,11.29l-4-4a1,1,0,0,0-1.42,1.42L14.59,11H3a1,1,0,0,0,0,2H14.59l-2.3,2.29a1,1,0,1,0,1.42,1.42l4-4a1.034,1.034,0,0,0,0-1.42Z",
|
|
135
|
-
transform: "translate(-2 -6.996)"
|
|
136
|
-
}));
|
|
137
|
-
};
|
|
138
134
|
|
|
139
135
|
var handleResize = function handleResize() {
|
|
140
136
|
setIsResponsive(window.matchMedia("(max-width: ".concat(_variables.responsiveSizes.medium, "rem)")).matches);
|
|
141
|
-
setIsSideNavVisible(true);
|
|
142
137
|
};
|
|
143
138
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
139
|
+
var handleSidenavVisibility = function handleSidenavVisibility() {
|
|
140
|
+
setIsSidenavVisibleResponsive(function (isSidenavVisibleResponsive) {
|
|
141
|
+
return !isSidenavVisibleResponsive;
|
|
142
|
+
});
|
|
143
|
+
};
|
|
148
144
|
|
|
145
|
+
(0, _react.useEffect)(function () {
|
|
146
|
+
handleResize();
|
|
147
|
+
window.addEventListener("resize", handleResize);
|
|
149
148
|
return function () {
|
|
150
149
|
window.removeEventListener("resize", handleResize);
|
|
151
150
|
};
|
|
152
|
-
}, [
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
theme: colorsTheme.sidenav
|
|
160
|
-
}, /*#__PURE__*/_react["default"].createElement(ApplicationLayoutContainer, {
|
|
151
|
+
}, [setIsResponsive]);
|
|
152
|
+
(0, _react.useEffect)(function () {
|
|
153
|
+
!isResponsive && setIsSidenavVisibleResponsive(false);
|
|
154
|
+
}, [isResponsive, setIsSidenavVisibleResponsive]);
|
|
155
|
+
return /*#__PURE__*/_react["default"].createElement(ApplicationLayoutContainer, {
|
|
156
|
+
hasSidenav: sidenav ? true : false,
|
|
157
|
+
isSidenavVisible: isSidenavVisibleResponsive,
|
|
161
158
|
ref: ref
|
|
162
|
-
}, /*#__PURE__*/_react["default"].createElement(HeaderContainer, null, header),
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
isSideNavVisible: isSideNavVisible
|
|
173
|
-
}, main), /*#__PURE__*/_react["default"].createElement(FooterContainer, {
|
|
174
|
-
sideNav: sideNav,
|
|
175
|
-
mode: isResponsive ? "overlay" : sideNavMode,
|
|
176
|
-
isSideNavVisible: isSideNavVisible
|
|
177
|
-
}, footer))))));
|
|
159
|
+
}, /*#__PURE__*/_react["default"].createElement(HeaderContainer, null, header), sidenav && isResponsive && /*#__PURE__*/_react["default"].createElement(VisibilityToggle, null, /*#__PURE__*/_react["default"].createElement(HamburgerTrigger, {
|
|
160
|
+
onClick: handleSidenavVisibility,
|
|
161
|
+
"aria-labelledby": visibilityToggleLabel ? visibilityToggleLabelId : undefined,
|
|
162
|
+
"aria-label": visibilityToggleLabel ? undefined : translatedLabels.applicationLayout.visibilityToggleTitle,
|
|
163
|
+
title: translatedLabels.applicationLayout.visibilityToggleTitle
|
|
164
|
+
}, _Icons.hamburgerIcon, visibilityToggleLabel && /*#__PURE__*/_react["default"].createElement(VisibilityToggleLabel, {
|
|
165
|
+
id: visibilityToggleLabelId
|
|
166
|
+
}, visibilityToggleLabel))), /*#__PURE__*/_react["default"].createElement(BodyContainer, null, /*#__PURE__*/_react["default"].createElement(_SidenavContext.SidenavContextProvider, {
|
|
167
|
+
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), footer)));
|
|
178
169
|
};
|
|
179
170
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
var ApplicationLayoutContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n position: absolute;\n top: 64px;\n bottom: 0;\n left: 0;\n right: 0;\n"])));
|
|
186
|
-
|
|
187
|
-
var HeaderContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n z-index: 1250;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n"])));
|
|
171
|
+
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: 112px";
|
|
173
|
+
}, function (props) {
|
|
174
|
+
return props.isSidenavVisible && "overflow: hidden;";
|
|
175
|
+
});
|
|
188
176
|
|
|
189
|
-
var
|
|
177
|
+
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"])));
|
|
190
178
|
|
|
191
|
-
var
|
|
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: 4px 16px;\n width: 100%;\n background-color: #f2f2f2;\n user-select: none;\n z-index: 2;\n"])));
|
|
192
180
|
|
|
193
|
-
var
|
|
181
|
+
var HamburgerTrigger = _styledComponents["default"].button(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n gap: 10px;\n flex-wrap: wrap;\n align-content: center;\n border: 0px solid transparent;\n border-radius: 2px;\n padding: 15px 3px;\n background-color: transparent;\n box-shadow: 0 0 0 2px transparent;\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"])));
|
|
194
182
|
|
|
195
|
-
var
|
|
196
|
-
return props.sideNav ? props.mode === "push" && !props.isSideNavVisible || props.mode === "overlay" ? "-300px" : "" : "";
|
|
197
|
-
});
|
|
183
|
+
var VisibilityToggleLabel = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: Open Sans, sans-serif;\n font-weight: 600;\n font-size: 14px;\n"])));
|
|
198
184
|
|
|
199
|
-
var
|
|
200
|
-
return props.sideNav ? props.mode === "push" && props.isSideNavVisible ? "" : "-297px" : "";
|
|
201
|
-
});
|
|
185
|
+
var BodyContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n flex: 1;\n"])));
|
|
202
186
|
|
|
203
|
-
var
|
|
204
|
-
return props.isSideNavVisible ? "translateX(0)" : !props.isSideNavVisible ? "translateX(-100%)" : "";
|
|
205
|
-
});
|
|
187
|
+
var SidenavContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (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: fixed;\n top: 112px;\n }\n"])), _variables.responsiveSizes.medium);
|
|
206
188
|
|
|
207
|
-
var
|
|
189
|
+
var MainContainer = _styledComponents["default"].div(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n width: 100%;\n"])));
|
|
208
190
|
|
|
209
|
-
var
|
|
210
|
-
return "".concat(props.theme.arrowContainerColor);
|
|
211
|
-
}, function (props) {
|
|
212
|
-
return props.isSideNavVisible ? "rotate(-180deg)" : "rotate(0deg)";
|
|
213
|
-
}, function (props) {
|
|
214
|
-
return props.theme.arrowColor;
|
|
215
|
-
});
|
|
191
|
+
var MainContentContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n flex: 1;\n"])));
|
|
216
192
|
|
|
193
|
+
DxcApplicationLayout.Header = Header;
|
|
194
|
+
DxcApplicationLayout.Main = Main;
|
|
195
|
+
DxcApplicationLayout.Footer = Footer;
|
|
196
|
+
DxcApplicationLayout.SideNav = Sidenav;
|
|
197
|
+
DxcApplicationLayout.useResponsiveSidenavVisibility = _SidenavContext.useResponsiveSidenavVisibility;
|
|
217
198
|
var _default = DxcApplicationLayout;
|
|
218
199
|
exports["default"] = _default;
|
|
@@ -2,8 +2,7 @@ import React from "react";
|
|
|
2
2
|
import DxcApplicationLayout from "./ApplicationLayout";
|
|
3
3
|
import DxcSidenav from "../sidenav/Sidenav";
|
|
4
4
|
import Title from "../../.storybook/components/Title";
|
|
5
|
-
import { INITIAL_VIEWPORTS } from
|
|
6
|
-
import { userEvent, within, waitFor } from "@storybook/testing-library";
|
|
5
|
+
import { INITIAL_VIEWPORTS } from "@storybook/addon-viewport";
|
|
7
6
|
|
|
8
7
|
export default {
|
|
9
8
|
title: "Application Layout ",
|
|
@@ -11,8 +10,8 @@ export default {
|
|
|
11
10
|
parameters: {
|
|
12
11
|
viewport: {
|
|
13
12
|
viewports: INITIAL_VIEWPORTS,
|
|
14
|
-
}
|
|
15
|
-
}
|
|
13
|
+
},
|
|
14
|
+
},
|
|
16
15
|
};
|
|
17
16
|
|
|
18
17
|
export const DefaultApplicationLayout = () => (
|
|
@@ -50,51 +49,9 @@ export const ApplicationLayoutWithDefaultSidenav = () => (
|
|
|
50
49
|
</>
|
|
51
50
|
);
|
|
52
51
|
|
|
53
|
-
export const ApplicationLayoutWithPushSidenav = () => (
|
|
54
|
-
<>
|
|
55
|
-
<DxcApplicationLayout>
|
|
56
|
-
<DxcApplicationLayout.SideNav mode="push">
|
|
57
|
-
<DxcSidenav.Title>Application layout with push sidenav</DxcSidenav.Title>
|
|
58
|
-
<p>SideNav Content</p>
|
|
59
|
-
<p>SideNav Content</p>
|
|
60
|
-
<p>SideNav Content</p>
|
|
61
|
-
<p>SideNav Content</p>
|
|
62
|
-
<p>SideNav Content</p>
|
|
63
|
-
</DxcApplicationLayout.SideNav>
|
|
64
|
-
<DxcApplicationLayout.Main>
|
|
65
|
-
<p>Main Content</p>
|
|
66
|
-
<p>Main Content</p>
|
|
67
|
-
<p>Main Content</p>
|
|
68
|
-
<p>Main Content</p>
|
|
69
|
-
</DxcApplicationLayout.Main>
|
|
70
|
-
</DxcApplicationLayout>
|
|
71
|
-
</>
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
export const ApplicationLayoutWithArrowSidenav = () => (
|
|
75
|
-
<>
|
|
76
|
-
<DxcApplicationLayout>
|
|
77
|
-
<DxcApplicationLayout.SideNav mode="overlay" displayArrow>
|
|
78
|
-
<DxcSidenav.Title>Application layout with push sidenav</DxcSidenav.Title>
|
|
79
|
-
<p>SideNav Content</p>
|
|
80
|
-
<p>SideNav Content</p>
|
|
81
|
-
<p>SideNav Content</p>
|
|
82
|
-
<p>SideNav Content</p>
|
|
83
|
-
<p>SideNav Content</p>
|
|
84
|
-
</DxcApplicationLayout.SideNav>
|
|
85
|
-
<DxcApplicationLayout.Main>
|
|
86
|
-
<p>Main Content</p>
|
|
87
|
-
<p>Main Content</p>
|
|
88
|
-
<p>Main Content</p>
|
|
89
|
-
<p>Main Content</p>
|
|
90
|
-
</DxcApplicationLayout.Main>
|
|
91
|
-
</DxcApplicationLayout>
|
|
92
|
-
</>
|
|
93
|
-
);
|
|
94
|
-
|
|
95
52
|
export const ApplicationLayoutWithResponsiveSidenav = () => (
|
|
96
53
|
<>
|
|
97
|
-
<DxcApplicationLayout>
|
|
54
|
+
<DxcApplicationLayout visibilityToggleLabel="Example">
|
|
98
55
|
<DxcApplicationLayout.SideNav>
|
|
99
56
|
<DxcSidenav.Title>Application layout with push sidenav</DxcSidenav.Title>
|
|
100
57
|
<p>SideNav Content</p>
|
|
@@ -115,16 +72,19 @@ export const ApplicationLayoutWithResponsiveSidenav = () => (
|
|
|
115
72
|
|
|
116
73
|
ApplicationLayoutWithResponsiveSidenav.parameters = {
|
|
117
74
|
viewport: {
|
|
118
|
-
defaultViewport:
|
|
75
|
+
defaultViewport: "pixel",
|
|
119
76
|
},
|
|
120
77
|
};
|
|
121
78
|
|
|
122
79
|
export const ApplicationLayoutWithCustomHeader = () => (
|
|
123
80
|
<>
|
|
124
81
|
<DxcApplicationLayout>
|
|
125
|
-
<DxcApplicationLayout.Header>
|
|
82
|
+
<DxcApplicationLayout.Header>
|
|
83
|
+
{" "}
|
|
84
|
+
<p>Custom Header</p>{" "}
|
|
85
|
+
</DxcApplicationLayout.Header>
|
|
126
86
|
<DxcApplicationLayout.SideNav>
|
|
127
|
-
<DxcSidenav.Title>Application layout with
|
|
87
|
+
<DxcSidenav.Title>Application layout with custom header</DxcSidenav.Title>
|
|
128
88
|
<p>SideNav Content</p>
|
|
129
89
|
<p>SideNav Content</p>
|
|
130
90
|
<p>SideNav Content</p>
|
|
@@ -145,7 +105,7 @@ export const ApplicationLayoutWithCustomFooter = () => (
|
|
|
145
105
|
<>
|
|
146
106
|
<DxcApplicationLayout>
|
|
147
107
|
<DxcApplicationLayout.SideNav>
|
|
148
|
-
<DxcSidenav.Title>Application layout with
|
|
108
|
+
<DxcSidenav.Title>Application layout with custom footer</DxcSidenav.Title>
|
|
149
109
|
<p>SideNav Content</p>
|
|
150
110
|
<p>SideNav Content</p>
|
|
151
111
|
<p>SideNav Content</p>
|
|
@@ -158,14 +118,9 @@ export const ApplicationLayoutWithCustomFooter = () => (
|
|
|
158
118
|
<p>Main Content</p>
|
|
159
119
|
<p>Main Content</p>
|
|
160
120
|
</DxcApplicationLayout.Main>
|
|
161
|
-
<DxcApplicationLayout.Footer>
|
|
121
|
+
<DxcApplicationLayout.Footer>
|
|
122
|
+
<p>Custom Footer</p>
|
|
123
|
+
</DxcApplicationLayout.Footer>
|
|
162
124
|
</DxcApplicationLayout>
|
|
163
125
|
</>
|
|
164
126
|
);
|
|
165
|
-
|
|
166
|
-
export const ApplicationLayoutWithClosingSidenav = ApplicationLayoutWithArrowSidenav.bind({});
|
|
167
|
-
ApplicationLayoutWithClosingSidenav.play = async ({ canvasElement }) => {
|
|
168
|
-
const canvas = within(canvasElement);
|
|
169
|
-
const arrow = canvas.getByRole("button");
|
|
170
|
-
await userEvent.click(arrow);
|
|
171
|
-
};
|
package/layout/Icons.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.twitterLogo = exports.linkedinLogo = exports.facebookLogo = void 0;
|
|
8
|
+
exports.twitterLogo = exports.linkedinLogo = exports.hamburgerIcon = exports.facebookLogo = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
@@ -52,4 +52,15 @@ var linkedinLogo = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
|
52
52
|
d: "M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123 C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126 h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225 C438.532,59.576,430.49,40.204,414.41,24.123z M133.618,367.157H67.666V169.016h65.952V367.157z M127.626,132.332 c-6.851,6.567-15.893,9.851-27.124,9.851h-0.288c-10.848,0-19.648-3.284-26.407-9.851c-6.76-6.567-10.138-14.703-10.138-24.41 c0-9.897,3.476-18.083,10.421-24.556c6.95-6.471,15.942-9.708,26.98-9.708c11.039,0,19.89,3.237,26.553,9.708 c6.661,6.473,10.088,14.659,10.277,24.556C137.899,117.625,134.477,125.761,127.626,132.332z M370.873,367.157h-65.952v-105.92 c0-29.879-11.036-44.823-33.116-44.823c-8.374,0-15.42,2.331-21.128,6.995c-5.715,4.661-9.996,10.324-12.847,16.991 c-1.335,3.422-1.999,8.75-1.999,15.981v110.775h-65.952c0.571-119.529,0.571-185.579,0-198.142h65.952v27.974 c13.867-21.681,33.558-32.544,59.101-32.544c22.84,0,41.21,7.52,55.104,22.554c13.895,15.037,20.841,37.214,20.841,66.519v113.64 H370.873z"
|
|
53
53
|
})));
|
|
54
54
|
|
|
55
|
-
exports.linkedinLogo = linkedinLogo;
|
|
55
|
+
exports.linkedinLogo = linkedinLogo;
|
|
56
|
+
|
|
57
|
+
var hamburgerIcon = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
58
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
59
|
+
height: "24",
|
|
60
|
+
width: "24",
|
|
61
|
+
viewBox: "0 0 24 24"
|
|
62
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
63
|
+
d: "M3 18V16H21V18ZM3 13V11H21V13ZM3 8V6H21V8Z"
|
|
64
|
+
}));
|
|
65
|
+
|
|
66
|
+
exports.hamburgerIcon = hamburgerIcon;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type SidenavContextType = (isSidenavVisible: boolean) => void;
|
|
3
|
+
export declare const SidenavContextProvider: import("react").Provider<SidenavContextType>;
|
|
4
|
+
export declare const useResponsiveSidenavVisibility: () => SidenavContextType;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useResponsiveSidenavVisibility = exports.SidenavContextProvider = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var SidenavContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
11
|
+
var SidenavContextProvider = SidenavContext.Provider;
|
|
12
|
+
exports.SidenavContextProvider = SidenavContextProvider;
|
|
13
|
+
|
|
14
|
+
var useResponsiveSidenavVisibility = function useResponsiveSidenavVisibility() {
|
|
15
|
+
var changeResponsiveSidenavVisibility = (0, _react.useContext)(SidenavContext);
|
|
16
|
+
return changeResponsiveSidenavVisibility;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
exports.useResponsiveSidenavVisibility = useResponsiveSidenavVisibility;
|
package/layout/types.d.ts
CHANGED
|
@@ -37,18 +37,13 @@ export declare type AppLayoutSidenavPropsType = {
|
|
|
37
37
|
* The area inside the sidenav. This area can be used to render custom content.
|
|
38
38
|
*/
|
|
39
39
|
children: React.ReactNode;
|
|
40
|
-
/**
|
|
41
|
-
* If false, the arrow button is hidden.
|
|
42
|
-
* In lower resolutions the arrow will be always displayed.
|
|
43
|
-
*/
|
|
44
|
-
displayArrow?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Default action over the content of the page, overlay the content or push to the right ('push' | 'overlay').
|
|
47
|
-
* In lower resolutions the mode will always be overlay.
|
|
48
|
-
*/
|
|
49
|
-
mode: "push" | "overlay";
|
|
50
40
|
};
|
|
51
41
|
declare type AppLayoutPropsType = {
|
|
42
|
+
/**
|
|
43
|
+
* Text to be placed next to the hamburger button that toggles the
|
|
44
|
+
* visibility of the sidenav.
|
|
45
|
+
*/
|
|
46
|
+
visibilityToggleLabel?: string;
|
|
52
47
|
/**
|
|
53
48
|
* The area inside the sidenav. This area can be used to render custom content.
|
|
54
49
|
*/
|
package/link/Link.js
CHANGED
|
@@ -13,6 +13,10 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
|
13
13
|
|
|
14
14
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
15
|
|
|
16
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
|
+
|
|
18
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
19
|
+
|
|
16
20
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
21
|
|
|
18
22
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
@@ -23,6 +27,8 @@ var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
|
23
27
|
|
|
24
28
|
var _templateObject, _templateObject2, _templateObject3;
|
|
25
29
|
|
|
30
|
+
var _excluded = ["inheritColor", "disabled", "icon", "iconPosition", "href", "newWindow", "onClick", "margin", "tabIndex", "children"];
|
|
31
|
+
|
|
26
32
|
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); }
|
|
27
33
|
|
|
28
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -54,11 +60,12 @@ var DxcLink = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
54
60
|
margin = _ref2.margin,
|
|
55
61
|
_ref2$tabIndex = _ref2.tabIndex,
|
|
56
62
|
tabIndex = _ref2$tabIndex === void 0 ? 0 : _ref2$tabIndex,
|
|
57
|
-
children = _ref2.children
|
|
63
|
+
children = _ref2.children,
|
|
64
|
+
otherProps = (0, _objectWithoutProperties2["default"])(_ref2, _excluded);
|
|
58
65
|
var colorsTheme = (0, _useTheme["default"])();
|
|
59
66
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
60
67
|
theme: colorsTheme.link
|
|
61
|
-
}, /*#__PURE__*/_react["default"].createElement(StyledLink, {
|
|
68
|
+
}, /*#__PURE__*/_react["default"].createElement(StyledLink, (0, _extends2["default"])({
|
|
62
69
|
as: href ? "a" : "button",
|
|
63
70
|
tabIndex: tabIndex,
|
|
64
71
|
onClick: !disabled && onClick,
|
|
@@ -68,7 +75,7 @@ var DxcLink = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
68
75
|
inheritColor: inheritColor,
|
|
69
76
|
margin: margin,
|
|
70
77
|
ref: ref
|
|
71
|
-
}, /*#__PURE__*/_react["default"].createElement(LinkContent, {
|
|
78
|
+
}, otherProps), /*#__PURE__*/_react["default"].createElement(LinkContent, {
|
|
72
79
|
iconPosition: iconPosition,
|
|
73
80
|
icon: icon,
|
|
74
81
|
children: children
|
package/main.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ import DxcDialog from "./dialog/Dialog";
|
|
|
7
7
|
import DxcDropdown from "./dropdown/Dropdown";
|
|
8
8
|
import DxcFooter from "./footer/Footer";
|
|
9
9
|
import DxcHeader from "./header/Header";
|
|
10
|
-
import DxcRadio from "./radio/Radio";
|
|
11
10
|
import DxcSlider from "./slider/Slider";
|
|
12
11
|
import DxcSwitch from "./switch/Switch";
|
|
13
12
|
import DxcTabs from "./tabs/Tabs";
|
|
@@ -43,6 +42,7 @@ import DxcBleed from "./bleed/Bleed";
|
|
|
43
42
|
import DxcInset from "./inset/Inset";
|
|
44
43
|
import DxcQuickNav from "./quick-nav/QuickNav";
|
|
45
44
|
import DxcNavTabs from "./tabs-nav/NavTabs";
|
|
45
|
+
import DxcInline from "./inline/Inline";
|
|
46
46
|
import HalstackContext, { HalstackProvider, HalstackLanguageContext } from "./HalstackContext";
|
|
47
47
|
import { BackgroundColorProvider } from "./BackgroundColorContext";
|
|
48
|
-
export { DxcAlert, DxcButton, DxcFooter, DxcCheckbox, DxcTextInput, DxcDropdown, DxcSwitch, DxcSlider,
|
|
48
|
+
export { DxcAlert, DxcButton, DxcFooter, DxcCheckbox, DxcTextInput, DxcDropdown, DxcSwitch, DxcSlider, DxcHeader, DxcTable, DxcTabs, DxcToggleGroup, DxcDialog, DxcCard, DxcProgressBar, DxcAccordion, DxcSpinner, DxcBox, DxcTag, DxcPaginator, DxcSidenav, DxcWizard, DxcLink, DxcHeading, DxcResultsetTable, DxcChip, DxcApplicationLayout, HalstackContext, HalstackLanguageContext, HalstackProvider, BackgroundColorProvider, DxcAccordionGroup, DxcBadge, DxcPasswordInput, DxcDateInput, DxcNumberInput, DxcTextarea, DxcSelect, DxcFileInput, DxcStack, DxcRow, DxcText, DxcList, DxcRadioGroup, DxcBleed, DxcInset, DxcQuickNav, DxcNavTabs, DxcInline, };
|
package/main.js
CHANGED
|
@@ -121,6 +121,12 @@ Object.defineProperty(exports, "DxcHeading", {
|
|
|
121
121
|
return _Heading["default"];
|
|
122
122
|
}
|
|
123
123
|
});
|
|
124
|
+
Object.defineProperty(exports, "DxcInline", {
|
|
125
|
+
enumerable: true,
|
|
126
|
+
get: function get() {
|
|
127
|
+
return _Inline["default"];
|
|
128
|
+
}
|
|
129
|
+
});
|
|
124
130
|
Object.defineProperty(exports, "DxcInset", {
|
|
125
131
|
enumerable: true,
|
|
126
132
|
get: function get() {
|
|
@@ -175,12 +181,6 @@ Object.defineProperty(exports, "DxcQuickNav", {
|
|
|
175
181
|
return _QuickNav["default"];
|
|
176
182
|
}
|
|
177
183
|
});
|
|
178
|
-
Object.defineProperty(exports, "DxcRadio", {
|
|
179
|
-
enumerable: true,
|
|
180
|
-
get: function get() {
|
|
181
|
-
return _Radio["default"];
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
184
|
Object.defineProperty(exports, "DxcRadioGroup", {
|
|
185
185
|
enumerable: true,
|
|
186
186
|
get: function get() {
|
|
@@ -320,8 +320,6 @@ var _Footer = _interopRequireDefault(require("./footer/Footer"));
|
|
|
320
320
|
|
|
321
321
|
var _Header = _interopRequireDefault(require("./header/Header"));
|
|
322
322
|
|
|
323
|
-
var _Radio = _interopRequireDefault(require("./radio/Radio"));
|
|
324
|
-
|
|
325
323
|
var _Slider = _interopRequireDefault(require("./slider/Slider"));
|
|
326
324
|
|
|
327
325
|
var _Switch = _interopRequireDefault(require("./switch/Switch"));
|
|
@@ -392,6 +390,8 @@ var _QuickNav = _interopRequireDefault(require("./quick-nav/QuickNav"));
|
|
|
392
390
|
|
|
393
391
|
var _NavTabs = _interopRequireDefault(require("./tabs-nav/NavTabs"));
|
|
394
392
|
|
|
393
|
+
var _Inline = _interopRequireDefault(require("./inline/Inline"));
|
|
394
|
+
|
|
395
395
|
var _HalstackContext = _interopRequireWildcard(require("./HalstackContext"));
|
|
396
396
|
|
|
397
397
|
var _BackgroundColorContext = require("./BackgroundColorContext");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxc-technology/halstack-react",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-8c10296",
|
|
4
4
|
"description": "DXC Halstack React components library",
|
|
5
5
|
"repository": "dxc-technology/halstack-react",
|
|
6
6
|
"homepage": "http://developer.dxc.com/tools/react",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"@material-ui/lab": "4.0.0-alpha.17",
|
|
25
25
|
"@material-ui/pickers": "3.2.2",
|
|
26
26
|
"@material-ui/styles": "4.0.2",
|
|
27
|
+
"@radix-ui/react-popover": "^0.1.6",
|
|
27
28
|
"@types/styled-components": "^5.1.24",
|
|
28
29
|
"@types/uuid": "^8.3.4",
|
|
29
30
|
"color": "^3.1.3",
|