@dxc-technology/halstack-react 0.0.0-e884f9f → 0.0.0-e9cf865
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/BackgroundColorContext.d.ts +10 -0
- package/BackgroundColorContext.js +1 -3
- package/ThemeContext.d.ts +15 -0
- package/ThemeContext.js +5 -8
- package/V3Select/V3Select.js +2 -2
- package/V3Textarea/V3Textarea.js +2 -2
- package/accordion/Accordion.js +2 -2
- package/accordion-group/AccordionGroup.js +2 -2
- package/accordion-group/AccordionGroup.stories.tsx +225 -0
- package/alert/Alert.js +2 -2
- package/badge/Badge.js +1 -1
- package/box/Box.js +2 -2
- package/button/Button.d.ts +1 -1
- package/button/Button.js +6 -4
- package/button/types.d.ts +2 -2
- package/card/Card.js +1 -1
- package/checkbox/Checkbox.js +2 -2
- package/chip/Chip.d.ts +4 -0
- package/chip/Chip.js +1 -23
- package/chip/types.d.ts +53 -0
- package/chip/types.js +5 -0
- package/common/variables.js +19 -22
- package/date/Date.js +1 -1
- package/date-input/DateInput.js +4 -7
- package/dialog/Dialog.js +2 -2
- package/dropdown/Dropdown.js +1 -1
- package/dropdown/types.d.ts +1 -1
- package/file-input/FileInput.d.ts +1 -1
- package/file-input/FileInput.js +58 -48
- package/file-input/FileItem.js +8 -6
- package/file-input/types.d.ts +32 -7
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +11 -17
- package/footer/{Footer.stories.jsx → Footer.stories.tsx} +1 -22
- package/footer/Icons.d.ts +2 -0
- package/footer/Icons.js +3 -3
- package/footer/types.d.ts +21 -17
- package/header/Header.js +2 -2
- package/header/Icons.d.ts +2 -0
- package/heading/Heading.js +1 -1
- package/input-text/InputText.js +2 -2
- package/layout/ApplicationLayout.d.ts +10 -0
- package/layout/ApplicationLayout.js +8 -18
- package/layout/ApplicationLayout.stories.tsx +171 -0
- package/layout/types.d.ts +57 -0
- package/layout/types.js +5 -0
- package/link/Link.js +1 -1
- package/list/List.d.ts +7 -0
- package/list/List.js +37 -0
- package/list/List.stories.tsx +70 -0
- package/main.d.ts +7 -3
- package/main.js +34 -2
- package/number-input/NumberInput.js +3 -6
- package/number-input/NumberInputContext.d.ts +4 -0
- package/number-input/NumberInputContext.js +5 -2
- package/number-input/numberInputContextTypes.d.ts +19 -0
- package/number-input/numberInputContextTypes.js +5 -0
- package/package.json +1 -1
- package/paginator/Paginator.js +2 -8
- package/password-input/PasswordInput.js +19 -18
- package/password-input/types.d.ts +17 -10
- package/progress-bar/ProgressBar.js +2 -2
- package/radio/Radio.js +2 -2
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/resultsetTable/ResultsetTable.js +4 -27
- package/resultsetTable/types.d.ts +67 -0
- package/resultsetTable/types.js +5 -0
- package/row/Row.d.ts +11 -0
- package/row/Row.js +124 -0
- package/row/Row.stories.tsx +223 -0
- package/select/Select.js +15 -17
- package/sidenav/Sidenav.js +2 -2
- package/slider/Slider.js +4 -4
- package/spinner/Spinner.js +2 -2
- package/stack/Stack.d.ts +10 -0
- package/stack/Stack.js +94 -0
- package/stack/Stack.stories.tsx +150 -0
- package/switch/Switch.js +2 -2
- package/table/Table.js +3 -3
- package/tabs/Tabs.js +1 -1
- package/tabs/Tabs.stories.tsx +121 -0
- package/tabs/types.d.ts +1 -1
- package/tag/Tag.js +1 -1
- package/text/Text.d.ts +7 -0
- package/text/Text.js +30 -0
- package/text/Text.stories.tsx +19 -0
- package/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +42 -81
- package/text-input/TextInput.stories.tsx +456 -0
- package/text-input/types.d.ts +159 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.js +29 -32
- package/textarea/index.d.ts +18 -8
- package/toggle/Toggle.js +1 -1
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/toggle-group/ToggleGroup.js +8 -34
- package/toggle-group/types.d.ts +84 -0
- package/toggle-group/types.js +5 -0
- package/upload/buttons-upload/ButtonsUpload.js +2 -2
- package/upload/dragAndDropArea/DragAndDropArea.js +2 -2
- package/upload/file-upload/FileToUpload.js +1 -1
- package/upload/files-upload/FilesToUpload.js +1 -1
- package/upload/transaction/Transaction.js +2 -2
- package/upload/transactions/Transactions.js +1 -1
- package/useTheme.d.ts +2 -0
- package/useTheme.js +1 -1
- package/wizard/Wizard.js +2 -2
- package/wizard/types.d.ts +1 -1
- package/chip/index.d.ts +0 -22
- package/resultsetTable/index.d.ts +0 -19
- package/text-input/index.d.ts +0 -135
- package/toggle-group/index.d.ts +0 -21
package/footer/Icons.js
CHANGED
|
@@ -5,11 +5,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports
|
|
8
|
+
exports.dxcLogo = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var dxcLogo = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
13
13
|
id: "g10",
|
|
14
14
|
xmlns: "http://www.w3.org/2000/svg",
|
|
15
15
|
width: "280.781",
|
|
@@ -74,4 +74,4 @@ var _default = /*#__PURE__*/_react["default"].createElement("svg", {
|
|
|
74
74
|
fill: "#fff"
|
|
75
75
|
})));
|
|
76
76
|
|
|
77
|
-
exports
|
|
77
|
+
exports.dxcLogo = dxcLogo;
|
package/footer/types.d.ts
CHANGED
|
@@ -6,34 +6,38 @@ declare type Size = {
|
|
|
6
6
|
left?: Space;
|
|
7
7
|
right?: Space;
|
|
8
8
|
};
|
|
9
|
+
declare type SVG = React.SVGProps<SVGSVGElement>;
|
|
9
10
|
declare type SocialLink = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Element used as the icon for the link.
|
|
13
|
+
*/
|
|
14
|
+
logo: string | SVG;
|
|
15
|
+
/**
|
|
16
|
+
* URL of the page the link goes to.
|
|
17
|
+
*/
|
|
18
|
+
href: string;
|
|
13
19
|
};
|
|
14
20
|
declare type BottomLink = {
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Text for the link.
|
|
23
|
+
*/
|
|
24
|
+
text: string;
|
|
25
|
+
/**
|
|
26
|
+
* URL of the page the link goes to.
|
|
27
|
+
*/
|
|
28
|
+
href: string;
|
|
17
29
|
};
|
|
18
|
-
declare type ImgElement = HTMLElement & (SVGElement | HTMLImageElement);
|
|
19
30
|
declare type FooterPropsType = {
|
|
20
31
|
/**
|
|
21
32
|
* An array of objects representing the links that will be rendered as
|
|
22
|
-
* icons at the top-right side of the footer.
|
|
23
|
-
* following properties:
|
|
24
|
-
* - logo: Element used as the icon for the link.
|
|
25
|
-
* - logoSrc: The path of an icon for the link. @deprecated
|
|
26
|
-
* - href: URL of the page the link goes to.
|
|
33
|
+
* icons at the top-right side of the footer.
|
|
27
34
|
*/
|
|
28
|
-
socialLinks?:
|
|
35
|
+
socialLinks?: SocialLink[];
|
|
29
36
|
/**
|
|
30
37
|
* An array of objects representing the links that will be rendered at
|
|
31
|
-
* the bottom part of the footer.
|
|
32
|
-
* properties:
|
|
33
|
-
* - text: Text for the link.
|
|
34
|
-
* - href: URL of the page the link goes to.
|
|
38
|
+
* the bottom part of the footer.
|
|
35
39
|
*/
|
|
36
|
-
bottomLinks?:
|
|
40
|
+
bottomLinks?: BottomLink[];
|
|
37
41
|
/**
|
|
38
42
|
* The center section of the footer. Can be used to render custom
|
|
39
43
|
* content in this area.
|
package/header/Header.js
CHANGED
|
@@ -27,9 +27,9 @@ var _Icons = require("./Icons");
|
|
|
27
27
|
|
|
28
28
|
var _variables = require("../common/variables.js");
|
|
29
29
|
|
|
30
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
30
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
31
31
|
|
|
32
|
-
var _BackgroundColorContext = _interopRequireWildcard(require("../BackgroundColorContext
|
|
32
|
+
var _BackgroundColorContext = _interopRequireWildcard(require("../BackgroundColorContext"));
|
|
33
33
|
|
|
34
34
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15;
|
|
35
35
|
|
package/heading/Heading.js
CHANGED
|
@@ -19,7 +19,7 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
19
19
|
|
|
20
20
|
var _variables = require("../common/variables.js");
|
|
21
21
|
|
|
22
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
22
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
23
23
|
|
|
24
24
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
25
25
|
|
package/input-text/InputText.js
CHANGED
|
@@ -39,11 +39,11 @@ var _variables = require("../common/variables.js");
|
|
|
39
39
|
|
|
40
40
|
var _utils = require("../common/utils.js");
|
|
41
41
|
|
|
42
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
42
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
43
43
|
|
|
44
44
|
var _Icons = _interopRequireDefault(require("./Icons"));
|
|
45
45
|
|
|
46
|
-
var _BackgroundColorContext = _interopRequireWildcard(require("../BackgroundColorContext
|
|
46
|
+
var _BackgroundColorContext = _interopRequireWildcard(require("../BackgroundColorContext"));
|
|
47
47
|
|
|
48
48
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
49
49
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import AppLayoutPropsType, { AppLayoutFooterPropsType, AppLayoutMainPropsType, AppLayoutHeaderPropsType } from "./types";
|
|
3
|
+
declare const DxcApplicationLayout: {
|
|
4
|
+
({ children }: AppLayoutPropsType): JSX.Element;
|
|
5
|
+
Header: ({ children }: AppLayoutHeaderPropsType) => JSX.Element;
|
|
6
|
+
Main: ({ children }: AppLayoutMainPropsType) => JSX.Element;
|
|
7
|
+
Footer: ({ children }: AppLayoutFooterPropsType) => JSX.Element;
|
|
8
|
+
SideNav: (props: any) => JSX.Element;
|
|
9
|
+
};
|
|
10
|
+
export default DxcApplicationLayout;
|
|
@@ -21,13 +21,11 @@ var _main = require("../main");
|
|
|
21
21
|
|
|
22
22
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
23
23
|
|
|
24
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
|
-
|
|
26
24
|
var _variables = require("../common/variables.js");
|
|
27
25
|
|
|
28
26
|
var _Icons = require("./Icons");
|
|
29
27
|
|
|
30
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
28
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
31
29
|
|
|
32
30
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
33
31
|
|
|
@@ -55,23 +53,14 @@ var Footer = function Footer(_ref3) {
|
|
|
55
53
|
};
|
|
56
54
|
|
|
57
55
|
var SideNav = function SideNav(props) {
|
|
58
|
-
var displayArrow = props.displayArrow,
|
|
59
|
-
|
|
56
|
+
var _props$displayArrow = props.displayArrow,
|
|
57
|
+
displayArrow = _props$displayArrow === void 0 ? true : _props$displayArrow,
|
|
58
|
+
_props$mode = props.mode,
|
|
59
|
+
mode = _props$mode === void 0 ? "overlay" : _props$mode,
|
|
60
60
|
childProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
61
61
|
return /*#__PURE__*/_react["default"].createElement(_main.DxcSidenav, childProps, childProps.children);
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
SideNav.propTypes = {
|
|
65
|
-
mode: _propTypes["default"].oneOf(["overlay", "push", ""]),
|
|
66
|
-
displayArrow: _propTypes["default"].bool,
|
|
67
|
-
padding: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
68
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
69
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
70
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
71
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
72
|
-
})])
|
|
73
|
-
};
|
|
74
|
-
|
|
75
64
|
var defaultFooter = function defaultFooter() {
|
|
76
65
|
return /*#__PURE__*/_react["default"].createElement(_main.DxcFooter, {
|
|
77
66
|
copyright: "\xA9 DXC Technology ".concat(year, "\u200B\u200B\u200B\u200B. All rights reserved."),
|
|
@@ -120,7 +109,7 @@ var DxcApplicationLayout = function DxcApplicationLayout(_ref4) {
|
|
|
120
109
|
isSideNavVisible = _useState2[0],
|
|
121
110
|
setIsSideNavVisible = _useState2[1];
|
|
122
111
|
|
|
123
|
-
var _useState3 = (0, _react.useState)(),
|
|
112
|
+
var _useState3 = (0, _react.useState)(false),
|
|
124
113
|
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
125
114
|
isResponsive = _useState4[0],
|
|
126
115
|
setIsResponsive = _useState4[1];
|
|
@@ -149,7 +138,7 @@ var DxcApplicationLayout = function DxcApplicationLayout(_ref4) {
|
|
|
149
138
|
|
|
150
139
|
var handleResize = function handleResize(width) {
|
|
151
140
|
if (width) {
|
|
152
|
-
|
|
141
|
+
setIsResponsive(width <= _variables.responsiveSizes.tablet);
|
|
153
142
|
setIsSideNavVisible(true);
|
|
154
143
|
}
|
|
155
144
|
};
|
|
@@ -180,6 +169,7 @@ var DxcApplicationLayout = function DxcApplicationLayout(_ref4) {
|
|
|
180
169
|
}, /*#__PURE__*/_react["default"].createElement(HeaderContainer, null, header), /*#__PURE__*/_react["default"].createElement(BodyContainer, null, /*#__PURE__*/_react["default"].createElement(ContentContainer, null, /*#__PURE__*/_react["default"].createElement(SideNavArrowContainer, {
|
|
181
170
|
isSideNavVisible: isSideNavVisible
|
|
182
171
|
}, sideNav, /*#__PURE__*/_react["default"].createElement(ArrowContainer, null, sideNav && (displayArrow || isResponsive) && /*#__PURE__*/_react["default"].createElement(ArrowTrigger, {
|
|
172
|
+
role: "button",
|
|
183
173
|
tabIndex: 0,
|
|
184
174
|
onClick: handleSidenav,
|
|
185
175
|
isSideNavVisible: isSideNavVisible
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import DxcApplicationLayout from "./ApplicationLayout";
|
|
3
|
+
import DxcSidenav from "../sidenav/Sidenav";
|
|
4
|
+
import Title from "../../.storybook/components/Title";
|
|
5
|
+
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
|
|
6
|
+
import { userEvent, within, waitFor } from "@storybook/testing-library";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: "Application Layout ",
|
|
10
|
+
component: DxcApplicationLayout,
|
|
11
|
+
parameters: {
|
|
12
|
+
viewport: {
|
|
13
|
+
viewports: INITIAL_VIEWPORTS,
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const DefaultApplicationLayout = () => (
|
|
19
|
+
<>
|
|
20
|
+
<DxcApplicationLayout>
|
|
21
|
+
<DxcApplicationLayout.Main>
|
|
22
|
+
<Title title="Default application layout" theme="light" level={4} />
|
|
23
|
+
<p>Main Content</p>
|
|
24
|
+
<p>Main Content</p>
|
|
25
|
+
<p>Main Content</p>
|
|
26
|
+
<p>Main Content</p>
|
|
27
|
+
</DxcApplicationLayout.Main>
|
|
28
|
+
</DxcApplicationLayout>
|
|
29
|
+
</>
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
export const ApplicationLayoutWithDefaultSidenav = () => (
|
|
33
|
+
<>
|
|
34
|
+
<DxcApplicationLayout>
|
|
35
|
+
<DxcApplicationLayout.SideNav>
|
|
36
|
+
<DxcSidenav.Title>Application layout with sidenav</DxcSidenav.Title>
|
|
37
|
+
<p>SideNav Content</p>
|
|
38
|
+
<p>SideNav Content</p>
|
|
39
|
+
<p>SideNav Content</p>
|
|
40
|
+
<p>SideNav Content</p>
|
|
41
|
+
<p>SideNav Content</p>
|
|
42
|
+
</DxcApplicationLayout.SideNav>
|
|
43
|
+
<DxcApplicationLayout.Main>
|
|
44
|
+
<p>Main Content</p>
|
|
45
|
+
<p>Main Content</p>
|
|
46
|
+
<p>Main Content</p>
|
|
47
|
+
<p>Main Content</p>
|
|
48
|
+
</DxcApplicationLayout.Main>
|
|
49
|
+
</DxcApplicationLayout>
|
|
50
|
+
</>
|
|
51
|
+
);
|
|
52
|
+
|
|
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
|
+
export const ApplicationLayoutWithResponsiveSidenav = () => (
|
|
96
|
+
<>
|
|
97
|
+
<DxcApplicationLayout>
|
|
98
|
+
<DxcApplicationLayout.SideNav>
|
|
99
|
+
<DxcSidenav.Title>Application layout with push sidenav</DxcSidenav.Title>
|
|
100
|
+
<p>SideNav Content</p>
|
|
101
|
+
<p>SideNav Content</p>
|
|
102
|
+
<p>SideNav Content</p>
|
|
103
|
+
<p>SideNav Content</p>
|
|
104
|
+
<p>SideNav Content</p>
|
|
105
|
+
</DxcApplicationLayout.SideNav>
|
|
106
|
+
<DxcApplicationLayout.Main>
|
|
107
|
+
<p>Main Content</p>
|
|
108
|
+
<p>Main Content</p>
|
|
109
|
+
<p>Main Content</p>
|
|
110
|
+
<p>Main Content</p>
|
|
111
|
+
</DxcApplicationLayout.Main>
|
|
112
|
+
</DxcApplicationLayout>
|
|
113
|
+
</>
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
ApplicationLayoutWithResponsiveSidenav.parameters = {
|
|
117
|
+
viewport: {
|
|
118
|
+
defaultViewport: 'pixel',
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export const ApplicationLayoutWithCustomHeader = () => (
|
|
123
|
+
<>
|
|
124
|
+
<DxcApplicationLayout>
|
|
125
|
+
<DxcApplicationLayout.Header> <p>Custom Header</p> </DxcApplicationLayout.Header>
|
|
126
|
+
<DxcApplicationLayout.SideNav>
|
|
127
|
+
<DxcSidenav.Title>Application layout with push sidenav</DxcSidenav.Title>
|
|
128
|
+
<p>SideNav Content</p>
|
|
129
|
+
<p>SideNav Content</p>
|
|
130
|
+
<p>SideNav Content</p>
|
|
131
|
+
<p>SideNav Content</p>
|
|
132
|
+
<p>SideNav Content</p>
|
|
133
|
+
</DxcApplicationLayout.SideNav>
|
|
134
|
+
<DxcApplicationLayout.Main>
|
|
135
|
+
<p>Main Content</p>
|
|
136
|
+
<p>Main Content</p>
|
|
137
|
+
<p>Main Content</p>
|
|
138
|
+
<p>Main Content</p>
|
|
139
|
+
</DxcApplicationLayout.Main>
|
|
140
|
+
</DxcApplicationLayout>
|
|
141
|
+
</>
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
export const ApplicationLayoutWithCustomFooter = () => (
|
|
145
|
+
<>
|
|
146
|
+
<DxcApplicationLayout>
|
|
147
|
+
<DxcApplicationLayout.SideNav>
|
|
148
|
+
<DxcSidenav.Title>Application layout with push sidenav</DxcSidenav.Title>
|
|
149
|
+
<p>SideNav Content</p>
|
|
150
|
+
<p>SideNav Content</p>
|
|
151
|
+
<p>SideNav Content</p>
|
|
152
|
+
<p>SideNav Content</p>
|
|
153
|
+
<p>SideNav Content</p>
|
|
154
|
+
</DxcApplicationLayout.SideNav>
|
|
155
|
+
<DxcApplicationLayout.Main>
|
|
156
|
+
<p>Main Content</p>
|
|
157
|
+
<p>Main Content</p>
|
|
158
|
+
<p>Main Content</p>
|
|
159
|
+
<p>Main Content</p>
|
|
160
|
+
</DxcApplicationLayout.Main>
|
|
161
|
+
<DxcApplicationLayout.Footer> <p>Custom Footer</p> </DxcApplicationLayout.Footer>
|
|
162
|
+
</DxcApplicationLayout>
|
|
163
|
+
</>
|
|
164
|
+
);
|
|
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
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
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
|
+
};
|
|
17
|
+
export declare type AppLayoutMainPropsType = {
|
|
18
|
+
/**
|
|
19
|
+
* Everything between the tags will be displayed as the content of the main part of the application.
|
|
20
|
+
*/
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
};
|
|
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
|
+
export declare type AppLayoutSidenavPropsType = {
|
|
31
|
+
/**
|
|
32
|
+
* Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
33
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
34
|
+
*/
|
|
35
|
+
padding?: Space | Padding;
|
|
36
|
+
/**
|
|
37
|
+
* The area inside the sidenav. This area can be used to render custom content.
|
|
38
|
+
*/
|
|
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
|
+
};
|
|
51
|
+
declare type AppLayoutPropsType = {
|
|
52
|
+
/**
|
|
53
|
+
* The area inside the sidenav. This area can be used to render custom content.
|
|
54
|
+
*/
|
|
55
|
+
children: React.ReactElement<ChildrenType> | React.ReactElement<ChildrenType>[];
|
|
56
|
+
};
|
|
57
|
+
export default AppLayoutPropsType;
|
package/layout/types.js
ADDED
package/link/Link.js
CHANGED
|
@@ -19,7 +19,7 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
19
19
|
|
|
20
20
|
var _variables = require("../common/variables.js");
|
|
21
21
|
|
|
22
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
22
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
23
23
|
|
|
24
24
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
25
25
|
|
package/list/List.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare type ListProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
gutter?: "none" | "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge" | "xxxlarge";
|
|
5
|
+
};
|
|
6
|
+
declare function List({ children, gutter }: ListProps): JSX.Element;
|
|
7
|
+
export default List;
|
package/list/List.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
|
|
16
|
+
var _Stack = _interopRequireDefault(require("../stack/Stack"));
|
|
17
|
+
|
|
18
|
+
var _templateObject, _templateObject2;
|
|
19
|
+
|
|
20
|
+
function List(_ref) {
|
|
21
|
+
var children = _ref.children,
|
|
22
|
+
_ref$gutter = _ref.gutter,
|
|
23
|
+
gutter = _ref$gutter === void 0 ? "xsmall" : _ref$gutter;
|
|
24
|
+
return /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
|
|
25
|
+
as: "ul",
|
|
26
|
+
gutter: gutter
|
|
27
|
+
}, _react["default"].Children.map(children, function (child) {
|
|
28
|
+
return /*#__PURE__*/_react["default"].createElement(ListItem, null, /*#__PURE__*/_react["default"].createElement(Bullet, null), child);
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var Bullet = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n background-color: black;\n width: 4px;\n height: 4px;\n border-radius: 50%;\n flex-shrink: 0;\n margin-top: 9px;\n margin-right: 10px;\n"])));
|
|
33
|
+
|
|
34
|
+
var ListItem = _styledComponents["default"].li(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0px;\n padding: 0px;\n list-style: none;\n display: flex;\n"])));
|
|
35
|
+
|
|
36
|
+
var _default = List;
|
|
37
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import Title from "../../.storybook/components/Title";
|
|
4
|
+
import DxcList from "./List";
|
|
5
|
+
import DxcText from "../text/Text";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "List",
|
|
9
|
+
component: DxcList,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const Chromatic = () => (
|
|
13
|
+
<>
|
|
14
|
+
<Title title="Default list" theme="light" level={4} />
|
|
15
|
+
<DxcList>
|
|
16
|
+
<DxcText>Text 1.</DxcText>
|
|
17
|
+
<DxcText>Text 2.</DxcText>
|
|
18
|
+
</DxcList>
|
|
19
|
+
<Title title="Multiple lines" theme="light" level={4} />
|
|
20
|
+
<Container>
|
|
21
|
+
<DxcList>
|
|
22
|
+
<DxcText>
|
|
23
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
|
|
24
|
+
magna aliqua.
|
|
25
|
+
</DxcText>
|
|
26
|
+
<DxcText>Text 2.</DxcText>
|
|
27
|
+
</DxcList>
|
|
28
|
+
</Container>
|
|
29
|
+
<Title title="gutter = xxsmall" theme="light" level={4} />
|
|
30
|
+
<DxcList gutter="xxsmall">
|
|
31
|
+
<DxcText>Text 1.</DxcText>
|
|
32
|
+
<DxcText>Text 2.</DxcText>
|
|
33
|
+
</DxcList>
|
|
34
|
+
<Title title="gutter = xsmall" theme="light" level={4} />
|
|
35
|
+
<DxcList gutter="xsmall">
|
|
36
|
+
<DxcText>Text 1.</DxcText>
|
|
37
|
+
<DxcText>Text 2.</DxcText>
|
|
38
|
+
</DxcList>
|
|
39
|
+
<Title title="gutter = small" theme="light" level={4} />
|
|
40
|
+
<DxcList gutter="small">
|
|
41
|
+
<DxcText>Text 1.</DxcText>
|
|
42
|
+
<DxcText>Text 2.</DxcText>
|
|
43
|
+
</DxcList>
|
|
44
|
+
<Title title="gutter = medium" theme="light" level={4} />
|
|
45
|
+
<DxcList gutter="medium">
|
|
46
|
+
<DxcText>Text 1.</DxcText>
|
|
47
|
+
<DxcText>Text 2.</DxcText>
|
|
48
|
+
</DxcList>
|
|
49
|
+
<Title title="gutter = large" theme="light" level={4} />
|
|
50
|
+
<DxcList gutter="large">
|
|
51
|
+
<DxcText>Text 1.</DxcText>
|
|
52
|
+
<DxcText>Text 2.</DxcText>
|
|
53
|
+
</DxcList>
|
|
54
|
+
<Title title="gutter = xlarge" theme="light" level={4} />
|
|
55
|
+
<DxcList gutter="xlarge">
|
|
56
|
+
<DxcText>Text 1.</DxcText>
|
|
57
|
+
<DxcText>Text 2.</DxcText>
|
|
58
|
+
</DxcList>
|
|
59
|
+
<Title title="gutter = xxlarge" theme="light" level={4} />
|
|
60
|
+
<DxcList gutter="xxlarge">
|
|
61
|
+
<DxcText>Text 1.</DxcText>
|
|
62
|
+
<DxcText>Text 2.</DxcText>
|
|
63
|
+
</DxcList>
|
|
64
|
+
|
|
65
|
+
</>
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
const Container = styled.div`
|
|
69
|
+
width: 400px;
|
|
70
|
+
`;
|
package/main.d.ts
CHANGED
|
@@ -39,6 +39,10 @@ import DxcNumberInput from "./number-input/NumberInput";
|
|
|
39
39
|
import DxcTextarea from "./textarea/Textarea";
|
|
40
40
|
import DxcSelect from "./select/Select";
|
|
41
41
|
import DxcFileInput from "./file-input/FileInput";
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
|
|
42
|
+
import DxcStack from "./stack/Stack";
|
|
43
|
+
import DxcRow from "./row/Row";
|
|
44
|
+
import DxcText from "./text/Text";
|
|
45
|
+
import DxcList from "./list/List";
|
|
46
|
+
import ThemeContext, { ThemeProvider } from "./ThemeContext";
|
|
47
|
+
import { BackgroundColorProvider } from "./BackgroundColorContext";
|
|
48
|
+
export { DxcAlert, DxcButton, DxcFooter, DxcCheckbox, V3DxcSelect, DxcInput, DxcTextInput, DxcDropdown, DxcSwitch, DxcSlider, DxcRadio, DxcDate, DxcHeader, DxcTable, DxcTabs, DxcToggleGroup, DxcDialog, DxcCard, DxcProgressBar, DxcAccordion, DxcSpinner, DxcUpload, DxcBox, DxcTag, DxcPaginator, DxcSidenav, DxcWizard, DxcLink, DxcHeading, V3DxcTextarea, DxcResultsetTable, DxcChip, DxcApplicationLayout, ThemeContext, ThemeProvider, BackgroundColorProvider, DxcAccordionGroup, DxcBadge, DxcPasswordInput, DxcDateInput, DxcNumberInput, DxcTextarea, DxcSelect, DxcFileInput, DxcStack, DxcRow, DxcText, DxcList, };
|
package/main.js
CHANGED
|
@@ -133,6 +133,12 @@ Object.defineProperty(exports, "DxcLink", {
|
|
|
133
133
|
return _Link["default"];
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
|
+
Object.defineProperty(exports, "DxcList", {
|
|
137
|
+
enumerable: true,
|
|
138
|
+
get: function get() {
|
|
139
|
+
return _List["default"];
|
|
140
|
+
}
|
|
141
|
+
});
|
|
136
142
|
Object.defineProperty(exports, "DxcNumberInput", {
|
|
137
143
|
enumerable: true,
|
|
138
144
|
get: function get() {
|
|
@@ -169,6 +175,12 @@ Object.defineProperty(exports, "DxcResultsetTable", {
|
|
|
169
175
|
return _ResultsetTable["default"];
|
|
170
176
|
}
|
|
171
177
|
});
|
|
178
|
+
Object.defineProperty(exports, "DxcRow", {
|
|
179
|
+
enumerable: true,
|
|
180
|
+
get: function get() {
|
|
181
|
+
return _Row["default"];
|
|
182
|
+
}
|
|
183
|
+
});
|
|
172
184
|
Object.defineProperty(exports, "DxcSelect", {
|
|
173
185
|
enumerable: true,
|
|
174
186
|
get: function get() {
|
|
@@ -193,6 +205,12 @@ Object.defineProperty(exports, "DxcSpinner", {
|
|
|
193
205
|
return _Spinner["default"];
|
|
194
206
|
}
|
|
195
207
|
});
|
|
208
|
+
Object.defineProperty(exports, "DxcStack", {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
get: function get() {
|
|
211
|
+
return _Stack["default"];
|
|
212
|
+
}
|
|
213
|
+
});
|
|
196
214
|
Object.defineProperty(exports, "DxcSwitch", {
|
|
197
215
|
enumerable: true,
|
|
198
216
|
get: function get() {
|
|
@@ -217,6 +235,12 @@ Object.defineProperty(exports, "DxcTag", {
|
|
|
217
235
|
return _Tag["default"];
|
|
218
236
|
}
|
|
219
237
|
});
|
|
238
|
+
Object.defineProperty(exports, "DxcText", {
|
|
239
|
+
enumerable: true,
|
|
240
|
+
get: function get() {
|
|
241
|
+
return _Text["default"];
|
|
242
|
+
}
|
|
243
|
+
});
|
|
220
244
|
Object.defineProperty(exports, "DxcTextInput", {
|
|
221
245
|
enumerable: true,
|
|
222
246
|
get: function get() {
|
|
@@ -354,9 +378,17 @@ var _Select = _interopRequireDefault(require("./select/Select"));
|
|
|
354
378
|
|
|
355
379
|
var _FileInput = _interopRequireDefault(require("./file-input/FileInput"));
|
|
356
380
|
|
|
357
|
-
var
|
|
381
|
+
var _Stack = _interopRequireDefault(require("./stack/Stack"));
|
|
382
|
+
|
|
383
|
+
var _Row = _interopRequireDefault(require("./row/Row"));
|
|
384
|
+
|
|
385
|
+
var _Text = _interopRequireDefault(require("./text/Text"));
|
|
386
|
+
|
|
387
|
+
var _List = _interopRequireDefault(require("./list/List"));
|
|
388
|
+
|
|
389
|
+
var _ThemeContext = _interopRequireWildcard(require("./ThemeContext"));
|
|
358
390
|
|
|
359
|
-
var _BackgroundColorContext = require("./BackgroundColorContext
|
|
391
|
+
var _BackgroundColorContext = require("./BackgroundColorContext");
|
|
360
392
|
|
|
361
393
|
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); }
|
|
362
394
|
|