@dxc-technology/halstack-react 0.0.0-e201636 → 0.0.0-e2a3793
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.stories.tsx +1 -1
- package/accordion/types.d.ts +1 -1
- package/accordion-group/AccordionGroup.js +1 -0
- package/accordion-group/types.d.ts +1 -1
- package/bleed/Bleed.js +1 -34
- package/bleed/Bleed.stories.tsx +94 -95
- package/bleed/types.d.ts +1 -1
- 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/chip/types.d.ts +1 -1
- package/common/variables.js +48 -14
- package/date-input/DateInput.js +3 -3
- package/dialog/Dialog.js +52 -28
- package/dialog/Dialog.stories.tsx +1 -2
- package/dialog/Dialog.test.js +34 -4
- package/dialog/types.d.ts +2 -2
- package/dropdown/Dropdown.d.ts +1 -1
- package/dropdown/Dropdown.js +242 -246
- package/dropdown/Dropdown.stories.tsx +126 -63
- package/dropdown/Dropdown.test.js +510 -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 +57 -0
- package/flex/Flex.stories.tsx +103 -0
- package/flex/types.d.ts +21 -0
- package/{row → flex}/types.js +0 -0
- package/footer/Icons.js +1 -1
- package/footer/types.d.ts +1 -1
- package/header/Header.js +74 -72
- package/header/Icons.js +2 -2
- package/header/types.d.ts +2 -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 +79 -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/package.json +8 -7
- 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/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 +21 -15
- package/quick-nav/QuickNav.stories.tsx +41 -14
- package/radio-group/RadioGroup.js +13 -14
- package/resultsetTable/ResultsetTable.test.js +42 -0
- package/select/Listbox.d.ts +1 -1
- package/select/Listbox.js +54 -7
- package/select/Select.js +41 -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 +3 -3
- package/slider/Slider.test.js +37 -0
- package/switch/Switch.d.ts +1 -1
- package/switch/Switch.js +110 -54
- package/switch/Switch.stories.tsx +8 -30
- package/switch/Switch.test.js +122 -8
- package/switch/types.d.ts +3 -4
- package/tabs/types.d.ts +1 -1
- package/tabs-nav/NavTabs.js +5 -5
- package/tabs-nav/Tab.js +3 -5
- package/tabs-nav/types.d.ts +1 -1
- package/tag/types.d.ts +1 -1
- package/text-input/TextInput.js +12 -21
- package/text-input/TextInput.stories.tsx +1 -2
- package/text-input/types.d.ts +1 -1
- 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
package/header/Header.js
CHANGED
|
@@ -19,8 +19,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
19
19
|
|
|
20
20
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
21
|
|
|
22
|
-
var _AppBar = _interopRequireDefault(require("@material-ui/core/AppBar"));
|
|
23
|
-
|
|
24
22
|
var _Dropdown = _interopRequireDefault(require("../dropdown/Dropdown"));
|
|
25
23
|
|
|
26
24
|
var _Icons = require("./Icons");
|
|
@@ -67,30 +65,37 @@ var Dropdown = function Dropdown(props) {
|
|
|
67
65
|
var HeaderDropdown = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n button {\n background-color: transparent;\n :hover {\n background-color: transparent;\n }\n }\n"])));
|
|
68
66
|
|
|
69
67
|
var getLogoElement = function getLogoElement(themeInput, logoLabel) {
|
|
70
|
-
if (!themeInput) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (typeof themeInput === "string") {
|
|
75
|
-
return /*#__PURE__*/_react["default"].createElement(LogoImg, {
|
|
76
|
-
alt: logoLabel,
|
|
77
|
-
src: themeInput
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return themeInput;
|
|
68
|
+
if (!themeInput) return _Icons.dxcLogo;else if (typeof themeInput === "string") return /*#__PURE__*/_react["default"].createElement(LogoImg, {
|
|
69
|
+
alt: logoLabel,
|
|
70
|
+
src: themeInput
|
|
71
|
+
});else return themeInput;
|
|
82
72
|
};
|
|
83
73
|
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
underlined = _ref$underlined === void 0 ? false : _ref$underlined,
|
|
87
|
-
content = _ref.content,
|
|
74
|
+
var Content = function Content(_ref) {
|
|
75
|
+
var isResponsive = _ref.isResponsive,
|
|
88
76
|
responsiveContent = _ref.responsiveContent,
|
|
89
|
-
|
|
90
|
-
margin = _ref.margin,
|
|
77
|
+
handleMenu = _ref.handleMenu,
|
|
91
78
|
padding = _ref.padding,
|
|
92
|
-
|
|
93
|
-
|
|
79
|
+
content = _ref.content;
|
|
80
|
+
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
81
|
+
return isResponsive ? /*#__PURE__*/_react["default"].createElement(MenuContent, {
|
|
82
|
+
backgroundType: backgroundType
|
|
83
|
+
}, responsiveContent(handleMenu)) : /*#__PURE__*/_react["default"].createElement(ContentContainer, {
|
|
84
|
+
padding: padding,
|
|
85
|
+
backgroundType: backgroundType
|
|
86
|
+
}, content);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
var DxcHeader = function DxcHeader(_ref2) {
|
|
90
|
+
var _ref2$underlined = _ref2.underlined,
|
|
91
|
+
underlined = _ref2$underlined === void 0 ? false : _ref2$underlined,
|
|
92
|
+
content = _ref2.content,
|
|
93
|
+
responsiveContent = _ref2.responsiveContent,
|
|
94
|
+
onClick = _ref2.onClick,
|
|
95
|
+
margin = _ref2.margin,
|
|
96
|
+
padding = _ref2.padding,
|
|
97
|
+
_ref2$tabIndex = _ref2.tabIndex,
|
|
98
|
+
tabIndex = _ref2$tabIndex === void 0 ? 0 : _ref2$tabIndex;
|
|
94
99
|
var colorsTheme = (0, _useTheme["default"])();
|
|
95
100
|
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
96
101
|
var ref = (0, _react.useRef)(null);
|
|
@@ -106,17 +111,7 @@ var DxcHeader = function DxcHeader(_ref) {
|
|
|
106
111
|
setIsMenuVisible = _useState4[1];
|
|
107
112
|
|
|
108
113
|
var handleResize = function handleResize() {
|
|
109
|
-
setIsResponsive(window.matchMedia("(max-width: ".concat(_variables.responsiveSizes.medium, "rem)")).matches
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
var ContentContainerComponent = function ContentContainerComponent() {
|
|
113
|
-
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
114
|
-
return isResponsive && /*#__PURE__*/_react["default"].createElement(MenuContent, {
|
|
115
|
-
backgroundType: backgroundType
|
|
116
|
-
}, responsiveContent(handleMenu)) || /*#__PURE__*/_react["default"].createElement(ContentContainer, {
|
|
117
|
-
padding: padding,
|
|
118
|
-
backgroundType: backgroundType
|
|
119
|
-
}, content);
|
|
114
|
+
setIsResponsive(window.matchMedia("(max-width: ".concat(_variables.responsiveSizes.medium, "rem)")).matches);
|
|
120
115
|
};
|
|
121
116
|
|
|
122
117
|
var handleMenu = function handleMenu() {
|
|
@@ -134,67 +129,74 @@ var DxcHeader = function DxcHeader(_ref) {
|
|
|
134
129
|
return getLogoElement(colorsTheme.header.logoResponsive, translatedLabels.formFields.logoAlternativeText);
|
|
135
130
|
}, [colorsTheme.header.logoResponsive]);
|
|
136
131
|
(0, _react.useEffect)(function () {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
handleResize();
|
|
140
|
-
}
|
|
141
|
-
|
|
132
|
+
handleResize();
|
|
133
|
+
window.addEventListener("resize", handleResize);
|
|
142
134
|
return function () {
|
|
143
135
|
window.removeEventListener("resize", handleResize);
|
|
144
136
|
};
|
|
145
137
|
}, []);
|
|
138
|
+
(0, _react.useEffect)(function () {
|
|
139
|
+
!isResponsive && setIsMenuVisible(false);
|
|
140
|
+
}, [isResponsive]);
|
|
146
141
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
147
142
|
theme: colorsTheme.header
|
|
148
143
|
}, /*#__PURE__*/_react["default"].createElement(HeaderContainer, {
|
|
149
|
-
|
|
150
|
-
position: "static",
|
|
144
|
+
underlined: underlined,
|
|
151
145
|
margin: margin,
|
|
152
146
|
ref: ref
|
|
153
147
|
}, /*#__PURE__*/_react["default"].createElement(LogoAnchor, {
|
|
154
|
-
tabIndex:
|
|
155
|
-
interactuable:
|
|
148
|
+
tabIndex: onClick ? tabIndex : -1,
|
|
149
|
+
interactuable: onClick ? true : false,
|
|
156
150
|
onClick: onClick
|
|
157
151
|
}, /*#__PURE__*/_react["default"].createElement(LogoContainer, null, headerLogo)), isResponsive && responsiveContent && /*#__PURE__*/_react["default"].createElement(MainContainer, null, /*#__PURE__*/_react["default"].createElement(ChildContainer, {
|
|
158
152
|
padding: padding
|
|
159
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
153
|
+
}, /*#__PURE__*/_react["default"].createElement(HamburguerTrigger, {
|
|
160
154
|
tabIndex: tabIndex,
|
|
161
|
-
underlined: underlined,
|
|
162
155
|
onClick: handleMenu
|
|
163
|
-
}, hamburgerIcon,
|
|
156
|
+
}, hamburgerIcon, translatedLabels.header.hamburguerTitle)), /*#__PURE__*/_react["default"].createElement(ResponsiveMenu, {
|
|
164
157
|
hasVisibility: isMenuVisible
|
|
165
|
-
}, /*#__PURE__*/_react["default"].createElement(ResponsiveLogoContainer, null, headerResponsiveLogo), /*#__PURE__*/_react["default"].createElement(
|
|
166
|
-
color: colorsTheme.header.menuBackgroundColor
|
|
167
|
-
}, /*#__PURE__*/_react["default"].createElement(ContentContainerComponent, null)), /*#__PURE__*/_react["default"].createElement(CloseContainer, {
|
|
158
|
+
}, /*#__PURE__*/_react["default"].createElement(ResponsiveIconsContainer, null, /*#__PURE__*/_react["default"].createElement(ResponsiveLogoContainer, null, headerResponsiveLogo), /*#__PURE__*/_react["default"].createElement(CloseAction, {
|
|
168
159
|
tabIndex: tabIndex,
|
|
169
160
|
onClick: handleMenu,
|
|
170
|
-
|
|
171
|
-
}, closeIcon)), /*#__PURE__*/_react["default"].createElement(
|
|
161
|
+
"aria-label": translatedLabels.header.closeIcon
|
|
162
|
+
}, closeIcon)), /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
163
|
+
color: colorsTheme.header.menuBackgroundColor
|
|
164
|
+
}, /*#__PURE__*/_react["default"].createElement(Content, {
|
|
165
|
+
isResponsive: isResponsive,
|
|
166
|
+
responsiveContent: responsiveContent,
|
|
167
|
+
handleMenu: handleMenu,
|
|
168
|
+
padding: padding,
|
|
169
|
+
content: content
|
|
170
|
+
}))), /*#__PURE__*/_react["default"].createElement(Overlay, {
|
|
172
171
|
onClick: handleMenu,
|
|
173
172
|
hasVisibility: isMenuVisible
|
|
174
|
-
}))
|
|
173
|
+
})), !isResponsive && /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
175
174
|
color: colorsTheme.header.backgroundColor
|
|
176
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
175
|
+
}, /*#__PURE__*/_react["default"].createElement(Content, {
|
|
176
|
+
isResponsive: isResponsive,
|
|
177
|
+
responsiveContent: responsiveContent,
|
|
178
|
+
handleMenu: handleMenu,
|
|
179
|
+
padding: padding,
|
|
180
|
+
content: content
|
|
181
|
+
}))));
|
|
177
182
|
};
|
|
178
183
|
|
|
179
184
|
DxcHeader.Dropdown = Dropdown;
|
|
180
|
-
|
|
185
|
+
|
|
186
|
+
var HeaderContainer = _styledComponents["default"].header(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n margin-bottom: ", ";\n padding: ", ";\n background-color: ", ";\n border-bottom: ", ";\n min-height: ", ";\n box-shadow: none;\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content: space-between;\n box-sizing: border-box;\n"])), function (props) {
|
|
181
187
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
188
|
+
}, function (props) {
|
|
189
|
+
return "".concat(props.theme.paddingTop, " ").concat(props.theme.paddingRight, " ").concat(props.theme.paddingBottom, " ").concat(props.theme.paddingLeft);
|
|
182
190
|
}, function (props) {
|
|
183
191
|
return props.theme.backgroundColor;
|
|
184
192
|
}, function (props) {
|
|
185
|
-
return props
|
|
193
|
+
return props.underlined && "".concat(props.theme.underlinedThickness, " ").concat(props.theme.underlinedStyle, " ").concat(props.theme.underlinedColor);
|
|
186
194
|
}, function (props) {
|
|
187
195
|
return props.theme.minHeight;
|
|
188
|
-
}, function (props) {
|
|
189
|
-
return "".concat(props.theme.paddingTop, " ").concat(props.theme.paddingRight, " ").concat(props.theme.paddingBottom, " ").concat(props.theme.paddingLeft);
|
|
190
196
|
});
|
|
191
197
|
|
|
192
|
-
var LogoAnchor = _styledComponents["default"].a(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n ", "
|
|
193
|
-
|
|
194
|
-
return "cursor: default; outline:none;";
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
return "cursor: pointer;";
|
|
198
|
+
var LogoAnchor = _styledComponents["default"].a(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n ", ";\n"])), function (props) {
|
|
199
|
+
return props.interactuable ? "cursor: pointer" : "cursor: default; outline:none";
|
|
198
200
|
});
|
|
199
201
|
|
|
200
202
|
var LogoImg = _styledComponents["default"].img(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n max-height: ", ";\n width: ", ";\n"])), function (props) {
|
|
@@ -235,15 +237,13 @@ var ContentContainer = _styledComponents["default"].div(_templateObject7 || (_te
|
|
|
235
237
|
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.left ? _variables.spaces[props.padding.left] : "";
|
|
236
238
|
});
|
|
237
239
|
|
|
238
|
-
var
|
|
240
|
+
var HamburguerTrigger = _styledComponents["default"].button(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 54px;\n cursor: pointer;\n border: 1px solid transparent;\n border-radius: 2px;\n background-color: transparent;\n :hover {\n background-color: ", ";\n }\n &:focus {\n outline: ", " auto 1px;\n }\n & > svg {\n fill: ", ";\n }\n font-family: ", ";\n font-style: ", ";\n font-size: ", ";\n text-transform: ", ";\n font-weight: ", ";\n color: ", ";\n"])), function (props) {
|
|
239
241
|
return props.theme.hamburguerHoverColor;
|
|
240
242
|
}, function (props) {
|
|
241
243
|
return props.theme.hamburguerFocusColor;
|
|
242
244
|
}, function (props) {
|
|
243
245
|
return props.theme.hamburguerIconColor;
|
|
244
|
-
})
|
|
245
|
-
|
|
246
|
-
var HamburguerTitle = _styledComponents["default"].span(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-style: ", ";\n font-size: ", ";\n text-transform: ", ";\n font-weight: ", ";\n color: ", ";\n"])), function (props) {
|
|
246
|
+
}, function (props) {
|
|
247
247
|
return props.theme.hamburguerFontFamily;
|
|
248
248
|
}, function (props) {
|
|
249
249
|
return props.theme.hamburguerFontStyle;
|
|
@@ -257,9 +257,9 @@ var HamburguerTitle = _styledComponents["default"].span(_templateObject9 || (_te
|
|
|
257
257
|
return props.theme.hamburguerFontColor;
|
|
258
258
|
});
|
|
259
259
|
|
|
260
|
-
var MainContainer = _styledComponents["default"].div(
|
|
260
|
+
var MainContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-grow: 1;\n"])));
|
|
261
261
|
|
|
262
|
-
var ResponsiveMenu = _styledComponents["default"].div(
|
|
262
|
+
var ResponsiveMenu = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n background-color: ", ";\n position: fixed;\n top: 0;\n right: 0;\n z-index: ", ";\n\n @media (max-width: ", "rem) and (min-width: ", "rem) {\n //tablet\n width: ", ";\n }\n\n @media (not((max-width: ", "rem) and (min-width: ", "rem))) {\n //mobile phones\n width: ", ";\n }\n\n height: 100vh;\n padding: 20px;\n transform: ", ";\n opacity: ", ";\n transition-property: transform, opacity;\n transition-duration: 0.6s;\n transition-timing-function: ease-in-out;\n box-sizing: border-box;\n"])), function (props) {
|
|
263
263
|
return props.theme.menuBackgroundColor;
|
|
264
264
|
}, function (props) {
|
|
265
265
|
return props.theme.menuZindex;
|
|
@@ -273,17 +273,19 @@ var ResponsiveMenu = _styledComponents["default"].div(_templateObject11 || (_tem
|
|
|
273
273
|
return props.hasVisibility ? "1" : "0.96";
|
|
274
274
|
});
|
|
275
275
|
|
|
276
|
-
var ResponsiveLogoContainer = _styledComponents["default"].div(
|
|
276
|
+
var ResponsiveLogoContainer = _styledComponents["default"].div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n max-height: ", ";\n width: ", ";\n display: flex;\n"])), function (props) {
|
|
277
277
|
return props.theme.logoHeight;
|
|
278
278
|
}, function (props) {
|
|
279
279
|
return props.theme.logoWidth;
|
|
280
280
|
});
|
|
281
281
|
|
|
282
|
-
var
|
|
282
|
+
var ResponsiveIconsContainer = _styledComponents["default"].div(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
283
|
+
|
|
284
|
+
var CloseAction = _styledComponents["default"].button(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["\n cursor: pointer;\n padding: 6px;\n height: 36px;\n width: 36px;\n border: 1px solid transparent;\n border-radius: 2px;\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n background-color: transparent;\n :focus,\n :focus-visible {\n outline: ", " auto 1px;\n }\n"])), function (props) {
|
|
283
285
|
return props.theme.hamburguerFocusColor;
|
|
284
|
-
}
|
|
286
|
+
});
|
|
285
287
|
|
|
286
|
-
var MenuContent = _styledComponents["default"].div(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["\n height: 100%;\n
|
|
288
|
+
var MenuContent = _styledComponents["default"].div(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["\n height: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n color: ", ";\n"])), function (props) {
|
|
287
289
|
return props.backgroundType === "dark" ? props.theme.contentColorOnDark : props.theme.contentColor;
|
|
288
290
|
});
|
|
289
291
|
|
package/header/Icons.js
CHANGED
|
@@ -23,12 +23,12 @@ var dxcLogo = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
|
23
23
|
id: "path14",
|
|
24
24
|
d: "M91.613-28.177v2.514H90.231V-28.15l-2.415-3.82h1.616l1.5,2.532,1.526-2.532h1.571ZM83.9-25.555A3.15,3.15,0,0,1,80.6-28.8v-.018a3.231,3.231,0,0,1,3.294-3.262,3.442,3.442,0,0,1,2.469.865l-.87,1.054a2.311,2.311,0,0,0-1.643-.64,1.891,1.891,0,0,0-1.8,1.964v.018a1.886,1.886,0,0,0,1.9,2,2.2,2.2,0,0,0,1.3-.378v-.9H83.858v-1.2h2.729v2.738A4.071,4.071,0,0,1,83.9-25.555Zm-6.416-3.261a1.913,1.913,0,0,0-1.9-1.982A1.883,1.883,0,0,0,73.7-28.835v.018a1.913,1.913,0,0,0,1.9,1.982A1.883,1.883,0,0,0,77.486-28.8Zm-1.9,3.261a3.225,3.225,0,0,1-3.33-3.243v-.018A3.255,3.255,0,0,1,75.6-32.078a3.225,3.225,0,0,1,3.331,3.243v.018A3.255,3.255,0,0,1,75.583-25.555Zm-9.173-.108V-31.97h1.382v5.045h3.133v1.261Zm-3.433-3.153a1.913,1.913,0,0,0-1.9-1.982,1.883,1.883,0,0,0-1.886,1.964v.018a1.913,1.913,0,0,0,1.9,1.982A1.883,1.883,0,0,0,62.978-28.8Zm-1.9,3.261a3.225,3.225,0,0,1-3.33-3.243v-.018a3.255,3.255,0,0,1,3.348-3.262,3.225,3.225,0,0,1,3.331,3.243v.018A3.255,3.255,0,0,1,61.075-25.555Zm-6.508-.108-3.043-4.009v4.009H50.159V-31.97h1.275l2.944,3.883V-31.97h1.364v6.306Zm-8.246,0v-2.531h-2.55v2.531H42.389V-31.97h1.382v2.5h2.55v-2.5H47.7v6.306Zm-8.432.108A3.178,3.178,0,0,1,34.666-28.8v-.018a3.2,3.2,0,0,1,3.276-3.262,3.237,3.237,0,0,1,2.478.973l-.88,1.018a2.315,2.315,0,0,0-1.606-.712,1.866,1.866,0,0,0-1.822,1.964v.018a1.87,1.87,0,0,0,1.822,1.982,2.265,2.265,0,0,0,1.651-.739l.88.891A3.206,3.206,0,0,1,37.889-25.555Zm-9.805-.108V-31.97h4.739v1.235H29.458v1.279h2.962v1.234H29.458V-26.9h3.411v1.234ZM24.322-30.69v5.027H22.939V-30.69H21.028v-1.28h5.206v1.28H24.322",
|
|
25
25
|
transform: "translate(-21.028 65.555)",
|
|
26
|
-
fill: "#
|
|
26
|
+
fill: "#010101"
|
|
27
27
|
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
28
28
|
id: "path16",
|
|
29
29
|
d: "M75.836-76.712a8.975,8.975,0,0,1,2.246-3.9,8.393,8.393,0,0,1,6.058-2.457h9.824v-5.67H84.139a14.611,14.611,0,0,0-10.232,4.221,14.509,14.509,0,0,0-3.076,4.536,11.913,11.913,0,0,0-.973,3.271Zm0,4.325a8.978,8.978,0,0,0,2.246,3.9,8.394,8.394,0,0,0,6.058,2.457h9.824v5.67H84.139A14.611,14.611,0,0,1,73.907-64.58a14.506,14.506,0,0,1-3.076-4.536,11.91,11.91,0,0,1-.973-3.271ZM57.522-69.832l-7.5,9.473H42.581L53.818-74.55,42.581-88.739H50.02l7.5,9.472,7.5-9.472h7.439L61.225-74.55l11.237,14.19H65.023Zm-12.336-6.88a11.935,11.935,0,0,0-.973-3.271,14.515,14.515,0,0,0-3.076-4.536A14.612,14.612,0,0,0,30.9-88.739H21.081v5.67H30.9a8.394,8.394,0,0,1,6.058,2.457,8.978,8.978,0,0,1,2.246,3.9Zm0,4.325a11.932,11.932,0,0,1-.973,3.271,14.511,14.511,0,0,1-3.076,4.536A14.611,14.611,0,0,1,30.9-60.359H21.081v-5.67H30.9a8.4,8.4,0,0,0,6.058-2.457,8.981,8.981,0,0,0,2.246-3.9h5.978",
|
|
30
30
|
transform: "translate(-21.049 88.739)",
|
|
31
|
-
fill: "#
|
|
31
|
+
fill: "#603494"
|
|
32
32
|
}))));
|
|
33
33
|
|
|
34
34
|
exports.dxcLogo = dxcLogo;
|
package/header/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
-
declare type Padding = {
|
|
2
|
+
export declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
export declare type Padding = {
|
|
4
4
|
top?: Space;
|
|
5
5
|
bottom?: Space;
|
|
6
6
|
left?: Space;
|
package/inset/Inset.js
CHANGED
|
@@ -36,40 +36,7 @@ function Inset(_ref) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
function getSpacingValue(spacingName) {
|
|
39
|
-
|
|
40
|
-
case "none":
|
|
41
|
-
return "0rem";
|
|
42
|
-
|
|
43
|
-
case "xxxsmall":
|
|
44
|
-
return "0.125rem";
|
|
45
|
-
|
|
46
|
-
case "xxsmall":
|
|
47
|
-
return "0.25rem";
|
|
48
|
-
|
|
49
|
-
case "xsmall":
|
|
50
|
-
return "0.5rem";
|
|
51
|
-
|
|
52
|
-
case "small":
|
|
53
|
-
return "1rem";
|
|
54
|
-
|
|
55
|
-
case "medium":
|
|
56
|
-
return "1.5rem";
|
|
57
|
-
|
|
58
|
-
case "large":
|
|
59
|
-
return "2rem";
|
|
60
|
-
|
|
61
|
-
case "xlarge":
|
|
62
|
-
return "3rem";
|
|
63
|
-
|
|
64
|
-
case "xxlarge":
|
|
65
|
-
return "4rem";
|
|
66
|
-
|
|
67
|
-
case "xxxlarge":
|
|
68
|
-
return "5rem";
|
|
69
|
-
|
|
70
|
-
default:
|
|
71
|
-
return "0rem";
|
|
72
|
-
}
|
|
39
|
+
return spacingName ? spacingName : "0rem";
|
|
73
40
|
}
|
|
74
41
|
|
|
75
42
|
var StyledInset = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n"])), function (_ref2) {
|
package/inset/Inset.stories.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Title from "../../.storybook/components/Title";
|
|
3
3
|
import styled from "styled-components";
|
|
4
|
-
import
|
|
4
|
+
import DxcFlex from "./../flex/Flex";
|
|
5
5
|
import DxcInset from "./Inset";
|
|
6
6
|
|
|
7
7
|
export default {
|
|
@@ -19,199 +19,199 @@ export const Chromatic = () => (
|
|
|
19
19
|
</Container>
|
|
20
20
|
<Title title="space = none" level={4} />
|
|
21
21
|
<Container>
|
|
22
|
-
<DxcInset space="
|
|
22
|
+
<DxcInset space="0rem">
|
|
23
23
|
<Placeholder></Placeholder>
|
|
24
24
|
</DxcInset>
|
|
25
25
|
</Container>
|
|
26
26
|
<Title title="space = xxxsmall" level={4} />
|
|
27
27
|
<Container>
|
|
28
|
-
<DxcInset space="
|
|
28
|
+
<DxcInset space="0.125rem">
|
|
29
29
|
<Placeholder></Placeholder>
|
|
30
30
|
</DxcInset>
|
|
31
31
|
</Container>
|
|
32
32
|
<Title title="space = xxsmall" level={4} />
|
|
33
33
|
<Container>
|
|
34
|
-
<DxcInset space="
|
|
34
|
+
<DxcInset space="0.25rem">
|
|
35
35
|
<Placeholder></Placeholder>
|
|
36
36
|
</DxcInset>
|
|
37
37
|
</Container>
|
|
38
38
|
<Title title="space = xsmall" level={4} />
|
|
39
39
|
<Container>
|
|
40
|
-
<DxcInset space="
|
|
40
|
+
<DxcInset space="0.5rem">
|
|
41
41
|
<Placeholder></Placeholder>
|
|
42
42
|
</DxcInset>
|
|
43
43
|
</Container>
|
|
44
44
|
<Title title="space = small" level={4} />
|
|
45
45
|
<Container>
|
|
46
|
-
<DxcInset space="
|
|
46
|
+
<DxcInset space="1rem">
|
|
47
47
|
<Placeholder></Placeholder>
|
|
48
48
|
</DxcInset>
|
|
49
49
|
</Container>
|
|
50
50
|
<Title title="space = medium" level={4} />
|
|
51
51
|
<Container>
|
|
52
|
-
<DxcInset space="
|
|
52
|
+
<DxcInset space="1.5rem">
|
|
53
53
|
<Placeholder></Placeholder>
|
|
54
54
|
</DxcInset>
|
|
55
55
|
</Container>
|
|
56
56
|
<Title title="space = large" level={4} />
|
|
57
57
|
<Container>
|
|
58
|
-
<DxcInset space="
|
|
58
|
+
<DxcInset space="2rem">
|
|
59
59
|
<Placeholder></Placeholder>
|
|
60
60
|
</DxcInset>
|
|
61
61
|
</Container>
|
|
62
62
|
<Title title="space = xlarge" level={4} />
|
|
63
63
|
<Container>
|
|
64
|
-
<DxcInset space="
|
|
64
|
+
<DxcInset space="3rem">
|
|
65
65
|
<Placeholder></Placeholder>
|
|
66
66
|
</DxcInset>
|
|
67
67
|
</Container>
|
|
68
68
|
<Title title="space = xxlarge" level={4} />
|
|
69
69
|
<Container>
|
|
70
|
-
<DxcInset space="
|
|
70
|
+
<DxcInset space="4rem">
|
|
71
71
|
<Placeholder></Placeholder>
|
|
72
72
|
</DxcInset>
|
|
73
73
|
</Container>
|
|
74
74
|
<Title title="space = xxxlarge" level={4} />
|
|
75
75
|
<Container>
|
|
76
|
-
<DxcInset space="
|
|
76
|
+
<DxcInset space="5rem">
|
|
77
77
|
<Placeholder></Placeholder>
|
|
78
78
|
</DxcInset>
|
|
79
79
|
</Container>
|
|
80
80
|
<Title title="horizontal = none" level={4} />
|
|
81
81
|
<Container>
|
|
82
|
-
<DxcInset horizontal="
|
|
82
|
+
<DxcInset horizontal="0rem">
|
|
83
83
|
<Placeholder></Placeholder>
|
|
84
84
|
</DxcInset>
|
|
85
85
|
</Container>
|
|
86
86
|
<Title title="horizontal = xxxsmall" level={4} />
|
|
87
87
|
<Container>
|
|
88
|
-
<DxcInset horizontal="
|
|
88
|
+
<DxcInset horizontal="0.125rem">
|
|
89
89
|
<Placeholder></Placeholder>
|
|
90
90
|
</DxcInset>
|
|
91
91
|
</Container>
|
|
92
92
|
<Title title="horizontal = xxsmall" level={4} />
|
|
93
93
|
<Container>
|
|
94
|
-
<DxcInset horizontal="
|
|
94
|
+
<DxcInset horizontal="0.25rem">
|
|
95
95
|
<Placeholder></Placeholder>
|
|
96
96
|
</DxcInset>
|
|
97
97
|
</Container>
|
|
98
98
|
<Title title="horizontal = xsmall" level={4} />
|
|
99
99
|
<Container>
|
|
100
|
-
<DxcInset horizontal="
|
|
100
|
+
<DxcInset horizontal="0.5rem">
|
|
101
101
|
<Placeholder></Placeholder>
|
|
102
102
|
</DxcInset>
|
|
103
103
|
</Container>
|
|
104
104
|
<Title title="horizontal = small" level={4} />
|
|
105
105
|
<Container>
|
|
106
|
-
<DxcInset horizontal="
|
|
106
|
+
<DxcInset horizontal="1rem">
|
|
107
107
|
<Placeholder></Placeholder>
|
|
108
108
|
</DxcInset>
|
|
109
109
|
</Container>
|
|
110
110
|
<Title title="horizontal = medium" level={4} />
|
|
111
111
|
<Container>
|
|
112
|
-
<DxcInset horizontal="
|
|
112
|
+
<DxcInset horizontal="1.5rem">
|
|
113
113
|
<Placeholder></Placeholder>
|
|
114
114
|
</DxcInset>
|
|
115
115
|
</Container>
|
|
116
116
|
<Title title="horizontal = large" level={4} />
|
|
117
117
|
<Container>
|
|
118
|
-
<DxcInset horizontal="
|
|
118
|
+
<DxcInset horizontal="2rem">
|
|
119
119
|
<Placeholder></Placeholder>
|
|
120
120
|
</DxcInset>
|
|
121
121
|
</Container>
|
|
122
122
|
<Title title="horizontal = xlarge" level={4} />
|
|
123
123
|
<Container>
|
|
124
|
-
<DxcInset horizontal="
|
|
124
|
+
<DxcInset horizontal="3rem">
|
|
125
125
|
<Placeholder></Placeholder>
|
|
126
126
|
</DxcInset>
|
|
127
127
|
</Container>
|
|
128
128
|
<Title title="horizontal = xxlarge" level={4} />
|
|
129
129
|
<Container>
|
|
130
|
-
<DxcInset horizontal="
|
|
130
|
+
<DxcInset horizontal="4rem">
|
|
131
131
|
<Placeholder></Placeholder>
|
|
132
132
|
</DxcInset>
|
|
133
133
|
</Container>
|
|
134
134
|
<Title title="horizontal = xxxlarge" level={4} />
|
|
135
135
|
<Container>
|
|
136
|
-
<DxcInset horizontal="
|
|
136
|
+
<DxcInset horizontal="5rem">
|
|
137
137
|
<Placeholder></Placeholder>
|
|
138
138
|
</DxcInset>
|
|
139
139
|
</Container>
|
|
140
140
|
<Title title="vertical = none" level={4} />
|
|
141
141
|
<Container>
|
|
142
|
-
<DxcInset vertical="
|
|
142
|
+
<DxcInset vertical="0rem">
|
|
143
143
|
<Placeholder></Placeholder>
|
|
144
144
|
</DxcInset>
|
|
145
145
|
</Container>
|
|
146
146
|
<Title title="vertical = xxxsmall" level={4} />
|
|
147
147
|
<Container>
|
|
148
|
-
<DxcInset vertical="
|
|
148
|
+
<DxcInset vertical="0.125rem">
|
|
149
149
|
<Placeholder></Placeholder>
|
|
150
150
|
</DxcInset>
|
|
151
151
|
</Container>
|
|
152
152
|
<Title title="vertical = xxsmall" level={4} />
|
|
153
153
|
<Container>
|
|
154
|
-
<DxcInset vertical="
|
|
154
|
+
<DxcInset vertical="0.25rem">
|
|
155
155
|
<Placeholder></Placeholder>
|
|
156
156
|
</DxcInset>
|
|
157
157
|
</Container>
|
|
158
158
|
<Title title="vertical = xsmall" level={4} />
|
|
159
159
|
<Container>
|
|
160
|
-
<DxcInset vertical="
|
|
160
|
+
<DxcInset vertical="0.5rem">
|
|
161
161
|
<Placeholder></Placeholder>
|
|
162
162
|
</DxcInset>
|
|
163
163
|
</Container>
|
|
164
164
|
<Title title="vertical = small" level={4} />
|
|
165
165
|
<Container>
|
|
166
|
-
<DxcInset vertical="
|
|
166
|
+
<DxcInset vertical="1rem">
|
|
167
167
|
<Placeholder></Placeholder>
|
|
168
168
|
</DxcInset>
|
|
169
169
|
</Container>
|
|
170
170
|
<Title title="vertical = medium" level={4} />
|
|
171
171
|
<Container>
|
|
172
|
-
<DxcInset vertical="
|
|
172
|
+
<DxcInset vertical="1.5rem">
|
|
173
173
|
<Placeholder></Placeholder>
|
|
174
174
|
</DxcInset>
|
|
175
175
|
</Container>
|
|
176
176
|
<Title title="vertical = large" level={4} />
|
|
177
177
|
<Container>
|
|
178
|
-
<DxcInset vertical="
|
|
178
|
+
<DxcInset vertical="2rem">
|
|
179
179
|
<Placeholder></Placeholder>
|
|
180
180
|
</DxcInset>
|
|
181
181
|
</Container>
|
|
182
182
|
<Title title="vertical = xlarge" level={4} />
|
|
183
183
|
<Container>
|
|
184
|
-
<DxcInset vertical="
|
|
184
|
+
<DxcInset vertical="3rem">
|
|
185
185
|
<Placeholder></Placeholder>
|
|
186
186
|
</DxcInset>
|
|
187
187
|
</Container>
|
|
188
188
|
<Title title="vertical = xxlarge" level={4} />
|
|
189
189
|
<Container>
|
|
190
|
-
<DxcInset vertical="
|
|
190
|
+
<DxcInset vertical="4rem">
|
|
191
191
|
<Placeholder></Placeholder>
|
|
192
192
|
</DxcInset>
|
|
193
193
|
</Container>
|
|
194
194
|
<Title title="vertical = xxxlarge" level={4} />
|
|
195
195
|
<Container>
|
|
196
|
-
<DxcInset vertical="
|
|
196
|
+
<DxcInset vertical="5rem">
|
|
197
197
|
<Placeholder></Placeholder>
|
|
198
198
|
</DxcInset>
|
|
199
199
|
</Container>
|
|
200
200
|
<Title title="top = xxsmall, right= medium, bottom = large and left = xxlarge" level={4} />
|
|
201
201
|
<Container>
|
|
202
|
-
<DxcInset top="
|
|
202
|
+
<DxcInset top="0.25rem" right="1.5rem" bottom="2rem" left="4rem">
|
|
203
203
|
<Placeholder></Placeholder>
|
|
204
204
|
</DxcInset>
|
|
205
205
|
</Container>
|
|
206
|
-
<Title title="Inside a
|
|
206
|
+
<Title title="Inside a flex column" level={4} />
|
|
207
207
|
<Container>
|
|
208
|
-
<
|
|
208
|
+
<DxcFlex direction="column" gap="0.75rem">
|
|
209
209
|
<Placeholder></Placeholder>
|
|
210
|
-
<DxcInset top="
|
|
210
|
+
<DxcInset top="0.25rem" right="1.5rem" bottom="2rem" left="4rem">
|
|
211
211
|
<Placeholder></Placeholder>
|
|
212
212
|
</DxcInset>
|
|
213
213
|
<Placeholder></Placeholder>
|
|
214
|
-
</
|
|
214
|
+
</DxcFlex>
|
|
215
215
|
</Container>
|
|
216
216
|
</>
|
|
217
217
|
);
|
package/inset/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare type Spacing = "
|
|
2
|
+
declare type Spacing = "0rem" | "0.125rem" | "0.25rem" | "0.5rem" | "1rem" | "1.5rem" | "2rem" | "3rem" | "4rem" | "5rem";
|
|
3
3
|
declare type Props = {
|
|
4
4
|
/**
|
|
5
5
|
* Applies the spacing scale to all sides.
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
import AppLayoutPropsType, {
|
|
1
|
+
import React from "react";
|
|
2
|
+
import AppLayoutPropsType, { AppLayoutMainPropsType } from "./types";
|
|
3
3
|
declare const DxcApplicationLayout: {
|
|
4
|
-
({ visibilityToggleLabel, children }: AppLayoutPropsType): JSX.Element;
|
|
5
|
-
Header:
|
|
4
|
+
({ visibilityToggleLabel, header, sidenav, footer, children, }: AppLayoutPropsType): JSX.Element;
|
|
5
|
+
Header: {
|
|
6
|
+
({ underlined, content, responsiveContent, onClick, margin, padding, tabIndex, }: import("../header/types").default): JSX.Element;
|
|
7
|
+
Dropdown: (props: any) => JSX.Element;
|
|
8
|
+
};
|
|
6
9
|
Main: ({ children }: AppLayoutMainPropsType) => JSX.Element;
|
|
7
|
-
Footer: ({ children }:
|
|
8
|
-
SideNav:
|
|
10
|
+
Footer: ({ socialLinks, bottomLinks, copyright, children, padding, margin, tabIndex, }: import("../footer/types").default) => JSX.Element;
|
|
11
|
+
SideNav: {
|
|
12
|
+
({ children, title }: import("../sidenav/types").default): JSX.Element;
|
|
13
|
+
Section: ({ children }: import("../sidenav/types").SidenavSectionPropsType) => JSX.Element;
|
|
14
|
+
Group: ({ children, title, collapsable, icon }: import("../sidenav/types").SidenavGroupPropsType) => JSX.Element;
|
|
15
|
+
Link: React.ForwardRefExoticComponent<import("../sidenav/types").SidenavLinkPropsType & React.RefAttributes<HTMLAnchorElement>>;
|
|
16
|
+
Title: ({ children }: import("../sidenav/types").SidenavTitlePropsType) => JSX.Element;
|
|
17
|
+
};
|
|
9
18
|
useResponsiveSidenavVisibility: () => (isSidenavVisible: boolean) => void;
|
|
10
19
|
};
|
|
11
20
|
export default DxcApplicationLayout;
|