@dxc-technology/halstack-react 0.0.0-c2834c3 → 0.0.0-c291a0c
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/badge/Badge.d.ts +1 -1
- package/badge/Badge.js +5 -3
- package/badge/types.d.ts +1 -0
- package/bleed/Bleed.js +1 -34
- package/bleed/Bleed.stories.tsx +62 -63
- package/bleed/types.d.ts +1 -1
- package/box/Box.js +22 -32
- package/card/Card.js +34 -36
- package/common/variables.js +4 -18
- package/footer/Icons.js +1 -1
- package/inline/Inline.d.ts +4 -0
- package/inline/Inline.js +54 -0
- package/inline/Inline.stories.tsx +264 -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 +33 -33
- package/inset/types.d.ts +1 -1
- package/layout/ApplicationLayout.d.ts +4 -3
- package/layout/ApplicationLayout.js +83 -102
- package/layout/ApplicationLayout.stories.tsx +14 -59
- package/layout/Icons.d.ts +5 -0
- package/layout/Icons.js +13 -2
- package/layout/SidenavContext.d.ts +5 -0
- package/layout/SidenavContext.js +19 -0
- package/layout/types.d.ts +5 -10
- package/link/Link.d.ts +2 -2
- package/link/Link.js +23 -49
- package/link/types.d.ts +2 -3
- package/list/List.js +1 -1
- package/list/List.stories.tsx +16 -22
- package/list/types.d.ts +1 -1
- package/main.d.ts +3 -2
- package/main.js +16 -8
- package/package.json +2 -1
- package/paginator/Paginator.test.js +42 -0
- package/progress-bar/ProgressBar.js +1 -1
- package/progress-bar/ProgressBar.stories.jsx +11 -11
- package/quick-nav/QuickNav.js +19 -23
- package/resultsetTable/ResultsetTable.test.js +42 -0
- package/select/Listbox.d.ts +1 -1
- package/select/Listbox.js +30 -7
- package/select/Select.js +73 -67
- package/select/Select.stories.tsx +130 -98
- package/select/Select.test.js +299 -194
- package/select/types.d.ts +3 -4
- package/sidenav/Sidenav.d.ts +1 -1
- package/sidenav/Sidenav.js +20 -9
- package/stack/Stack.d.ts +2 -1
- package/stack/Stack.js +23 -70
- package/stack/Stack.stories.tsx +139 -78
- package/stack/types.d.ts +11 -7
- package/tabs-nav/NavTabs.d.ts +8 -0
- package/tabs-nav/NavTabs.js +125 -0
- package/tabs-nav/NavTabs.stories.tsx +170 -0
- package/tabs-nav/NavTabs.test.js +82 -0
- package/tabs-nav/Tab.d.ts +4 -0
- package/tabs-nav/Tab.js +132 -0
- package/tabs-nav/types.d.ts +53 -0
- package/tabs-nav/types.js +5 -0
- package/radio/Radio.d.ts +0 -4
- package/radio/Radio.js +0 -173
- package/radio/Radio.stories.tsx +0 -192
- package/radio/Radio.test.js +0 -71
- package/radio/types.d.ts +0 -54
package/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.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { LinkProps } from "./types";
|
|
3
|
-
declare const DxcLink:
|
|
3
|
+
declare const DxcLink: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
4
4
|
export default DxcLink;
|
package/link/Link.js
CHANGED
|
@@ -13,7 +13,11 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
|
13
13
|
|
|
14
14
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
|
+
|
|
18
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
19
|
+
|
|
20
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
21
|
|
|
18
22
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
19
23
|
|
|
@@ -21,7 +25,9 @@ var _variables = require("../common/variables.js");
|
|
|
21
25
|
|
|
22
26
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
23
27
|
|
|
24
|
-
var _templateObject, _templateObject2, _templateObject3
|
|
28
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
29
|
+
|
|
30
|
+
var _excluded = ["inheritColor", "disabled", "icon", "iconPosition", "href", "newWindow", "onClick", "margin", "tabIndex", "children"];
|
|
25
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
|
|
|
@@ -31,14 +37,14 @@ var LinkContent = /*#__PURE__*/_react["default"].memo(function (_ref) {
|
|
|
31
37
|
var iconPosition = _ref.iconPosition,
|
|
32
38
|
icon = _ref.icon,
|
|
33
39
|
children = _ref.children;
|
|
34
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
40
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, iconPosition === "after" && children, icon && /*#__PURE__*/_react["default"].createElement(LinkIconContainer, {
|
|
35
41
|
iconPosition: iconPosition
|
|
36
42
|
}, typeof icon === "string" ? /*#__PURE__*/_react["default"].createElement(LinkIcon, {
|
|
37
43
|
src: icon
|
|
38
44
|
}) : icon), iconPosition === "before" && children);
|
|
39
45
|
});
|
|
40
46
|
|
|
41
|
-
var DxcLink = function
|
|
47
|
+
var DxcLink = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
42
48
|
var _ref2$inheritColor = _ref2.inheritColor,
|
|
43
49
|
inheritColor = _ref2$inheritColor === void 0 ? false : _ref2$inheritColor,
|
|
44
50
|
_ref2$disabled = _ref2.disabled,
|
|
@@ -54,35 +60,29 @@ var DxcLink = function DxcLink(_ref2) {
|
|
|
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(
|
|
62
|
-
margin: margin
|
|
63
|
-
}, typeof children === "string" && (href || onClick) ? /*#__PURE__*/_react["default"].createElement(StyledLink, {
|
|
68
|
+
}, /*#__PURE__*/_react["default"].createElement(StyledLink, (0, _extends2["default"])({
|
|
64
69
|
as: href ? "a" : "button",
|
|
65
70
|
tabIndex: tabIndex,
|
|
66
71
|
onClick: !disabled && onClick,
|
|
67
72
|
href: !disabled && href ? href : undefined,
|
|
68
73
|
target: href ? newWindow ? "_blank" : "_self" : undefined,
|
|
69
74
|
disabled: disabled,
|
|
70
|
-
inheritColor: inheritColor
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
children: children
|
|
75
|
-
})) : /*#__PURE__*/_react["default"].createElement(CustomLinkContainer, {
|
|
76
|
-
disabled: disabled,
|
|
77
|
-
inheritColor: inheritColor
|
|
78
|
-
}, /*#__PURE__*/_react["default"].createElement(LinkContent, {
|
|
75
|
+
inheritColor: inheritColor,
|
|
76
|
+
margin: margin,
|
|
77
|
+
ref: ref
|
|
78
|
+
}, otherProps), /*#__PURE__*/_react["default"].createElement(LinkContent, {
|
|
79
79
|
iconPosition: iconPosition,
|
|
80
80
|
icon: icon,
|
|
81
81
|
children: children
|
|
82
|
-
})))
|
|
83
|
-
};
|
|
82
|
+
})));
|
|
83
|
+
});
|
|
84
84
|
|
|
85
|
-
var
|
|
85
|
+
var StyledLink = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-size: ", ";\n font-weight: ", ";\n font-style: ", ";\n font-family: ", ";\n text-decoration-color: transparent;\n width: fit-content;\n\n ", "\n ", "\n color: ", ";\n ", "\n\n &:visited {\n color: ", ";\n &:hover {\n ", "\n }\n }\n &:hover {\n ", "\n }\n &:focus {\n border-radius: 2px;\n outline: 2px solid ", ";\n ", "\n }\n &:active {\n ", "\n }\n"])), function (props) {
|
|
86
86
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
87
87
|
}, function (props) {
|
|
88
88
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
@@ -100,9 +100,7 @@ var LinkContainer = _styledComponents["default"].div(_templateObject || (_templa
|
|
|
100
100
|
return props.theme.fontStyle;
|
|
101
101
|
}, function (props) {
|
|
102
102
|
return props.theme.fontFamily;
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
var StyledLink = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n ", "\n ", "\n color: ", ";\n ", "\n\n &:visited {\n color: ", ";\n &:hover {\n ", "\n }\n }\n &:hover {\n ", "\n }\n &:focus {\n border-radius: 2px;\n outline: 2px solid ", ";\n ", "\n }\n &:active {\n ", "\n }\n"])), function (props) {
|
|
103
|
+
}, function (props) {
|
|
106
104
|
return "padding-bottom: ".concat(props.theme.underlineSpacing, ";\n border-bottom: ").concat(props.theme.underlineThickness, " ").concat(props.theme.underlineStyle, " transparent;");
|
|
107
105
|
}, function (props) {
|
|
108
106
|
return props.disabled && "cursor: default;";
|
|
@@ -124,33 +122,9 @@ var StyledLink = _styledComponents["default"].div(_templateObject2 || (_template
|
|
|
124
122
|
return "color: ".concat(props.theme.activeFontColor, " !important;\n border-bottom-color: ").concat(props.theme.activeUnderlineColor, " !important;");
|
|
125
123
|
});
|
|
126
124
|
|
|
127
|
-
var
|
|
128
|
-
return "padding-bottom: ".concat(props.theme.underlineSpacing, ";\n border-bottom: ").concat(props.theme.underlineThickness, " ").concat(props.theme.underlineStyle, " transparent;");
|
|
129
|
-
}, function (props) {
|
|
130
|
-
return props.disabled && "cursor: default;";
|
|
131
|
-
}, function (props) {
|
|
132
|
-
return props.disabled ? "pointer-events: none;" : "";
|
|
133
|
-
}, function (props) {
|
|
134
|
-
return props.inheritColor ? "inherit" : !props.disabled ? props.theme.fontColor : props.theme.disabledColor;
|
|
135
|
-
}, function (props) {
|
|
136
|
-
return props.theme.hoverFontColor;
|
|
137
|
-
}, function (props) {
|
|
138
|
-
return "border-bottom-color: ".concat(props.theme.hoverUnderlineColor, ";\n cursor: pointer;");
|
|
139
|
-
}, function (props) {
|
|
140
|
-
return props.theme.focusColor;
|
|
141
|
-
}, function (props) {
|
|
142
|
-
return props.disabled && "outline: none";
|
|
143
|
-
}, function (props) {
|
|
144
|
-
return props.theme.activeFontColor;
|
|
145
|
-
}, function (props) {
|
|
146
|
-
return "border-bottom-color: ".concat(props.theme.activeUnderlineColor, " !important;");
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
var LinkText = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: baseline;\n max-width: 100%;\n"])));
|
|
150
|
-
|
|
151
|
-
var LinkIcon = _styledComponents["default"].img(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])([""])));
|
|
125
|
+
var LinkIcon = _styledComponents["default"].img(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])([""])));
|
|
152
126
|
|
|
153
|
-
var LinkIconContainer = _styledComponents["default"].div(
|
|
127
|
+
var LinkIconContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n ", ";\n overflow: hidden;\n align-self: center;\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
|
|
154
128
|
return props.theme.iconSize;
|
|
155
129
|
}, function (props) {
|
|
156
130
|
return props.theme.iconSize;
|
package/link/types.d.ts
CHANGED
|
@@ -43,10 +43,9 @@ export declare type LinkProps = {
|
|
|
43
43
|
*/
|
|
44
44
|
tabIndex?: number;
|
|
45
45
|
/**
|
|
46
|
-
* Content of the link.
|
|
47
|
-
* The component will apply the styles to the custom link.
|
|
46
|
+
* Content of the link.
|
|
48
47
|
*/
|
|
49
|
-
children
|
|
48
|
+
children: string;
|
|
50
49
|
/**
|
|
51
50
|
* Element or path used as the icon that will be placed next to the link text.
|
|
52
51
|
*/
|
package/list/List.js
CHANGED
|
@@ -24,7 +24,7 @@ function List(_ref) {
|
|
|
24
24
|
_ref$type = _ref.type,
|
|
25
25
|
type = _ref$type === void 0 ? "disc" : _ref$type,
|
|
26
26
|
_ref$gutter = _ref.gutter,
|
|
27
|
-
gutter = _ref$gutter === void 0 ? "
|
|
27
|
+
gutter = _ref$gutter === void 0 ? "0.25rem" : _ref$gutter;
|
|
28
28
|
return /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
|
|
29
29
|
as: type === "number" ? "ol" : "ul",
|
|
30
30
|
gutter: gutter
|
package/list/List.stories.tsx
CHANGED
|
@@ -41,52 +41,46 @@ export const Chromatic = () => (
|
|
|
41
41
|
<DxcText>Text 2.</DxcText>
|
|
42
42
|
</DxcList>
|
|
43
43
|
</Container>
|
|
44
|
-
<Title title="gutter =
|
|
45
|
-
<DxcList gutter="
|
|
44
|
+
<Title title="gutter = 0rem" theme="light" level={4} />
|
|
45
|
+
<DxcList gutter="0rem">
|
|
46
46
|
<DxcText>Text 1.</DxcText>
|
|
47
47
|
<DxcText>Text 2.</DxcText>
|
|
48
48
|
</DxcList>
|
|
49
|
-
<Title title="gutter =
|
|
50
|
-
<DxcList gutter="
|
|
49
|
+
<Title title="gutter = 0.125rem" theme="light" level={4} />
|
|
50
|
+
<DxcList gutter="0.125rem">
|
|
51
51
|
<DxcText>Text 1.</DxcText>
|
|
52
52
|
<DxcText>Text 2.</DxcText>
|
|
53
53
|
</DxcList>
|
|
54
|
-
<Title title="gutter =
|
|
55
|
-
<DxcList gutter="
|
|
54
|
+
<Title title="gutter = 0.25rem" theme="light" level={4} />
|
|
55
|
+
<DxcList gutter="0.25rem">
|
|
56
56
|
<DxcText>Text 1.</DxcText>
|
|
57
57
|
<DxcText>Text 2.</DxcText>
|
|
58
58
|
</DxcList>
|
|
59
|
-
<Title title="gutter =
|
|
60
|
-
<DxcList gutter="
|
|
59
|
+
<Title title="gutter = 0.5rem" theme="light" level={4} />
|
|
60
|
+
<DxcList gutter="0.5rem">
|
|
61
61
|
<DxcText>Text 1.</DxcText>
|
|
62
62
|
<DxcText>Text 2.</DxcText>
|
|
63
63
|
</DxcList>
|
|
64
|
-
<Title title="gutter =
|
|
65
|
-
<DxcList gutter="
|
|
64
|
+
<Title title="gutter = 0.75rem" theme="light" level={4} />
|
|
65
|
+
<DxcList gutter="0.75rem">
|
|
66
66
|
<DxcText>Text 1.</DxcText>
|
|
67
67
|
<DxcText>Text 2.</DxcText>
|
|
68
68
|
</DxcList>
|
|
69
|
-
<Title title="gutter =
|
|
70
|
-
<DxcList gutter="
|
|
69
|
+
<Title title="gutter = 1rem" theme="light" level={4} />
|
|
70
|
+
<DxcList gutter="1rem">
|
|
71
71
|
<DxcText>Text 1.</DxcText>
|
|
72
72
|
<DxcText>Text 2.</DxcText>
|
|
73
73
|
</DxcList>
|
|
74
|
-
<Title title="gutter =
|
|
75
|
-
<DxcList gutter="
|
|
74
|
+
<Title title="gutter = 1.5rem" theme="light" level={4} />
|
|
75
|
+
<DxcList gutter="1.5rem">
|
|
76
76
|
<DxcText>Text 1.</DxcText>
|
|
77
77
|
<DxcText>Text 2.</DxcText>
|
|
78
78
|
</DxcList>
|
|
79
|
-
<Title title="gutter =
|
|
80
|
-
<DxcList gutter="
|
|
79
|
+
<Title title="gutter = 2rem" theme="light" level={4} />
|
|
80
|
+
<DxcList gutter="2rem">
|
|
81
81
|
<DxcText>Text 1.</DxcText>
|
|
82
82
|
<DxcText>Text 2.</DxcText>
|
|
83
83
|
</DxcList>
|
|
84
|
-
<Title title="gutter = xxxlarge" theme="light" level={4} />
|
|
85
|
-
<DxcList gutter="xxxlarge">
|
|
86
|
-
<DxcText>Text 1.</DxcText>
|
|
87
|
-
<DxcText>Text 2.</DxcText>
|
|
88
|
-
</DxcList>
|
|
89
|
-
|
|
90
84
|
</>
|
|
91
85
|
);
|
|
92
86
|
|
package/list/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare type Props = {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
-
gutter?: "
|
|
4
|
+
gutter?: "0rem" | "0.125rem" | "0.25rem" | "0.5rem" | "0.75rem" | "1rem" | "1.5rem" | "2rem";
|
|
5
5
|
type?: "disc" | "circle" | "square" | "number";
|
|
6
6
|
};
|
|
7
7
|
export default Props;
|
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";
|
|
@@ -42,6 +41,8 @@ import DxcRadioGroup from "./radio-group/RadioGroup";
|
|
|
42
41
|
import DxcBleed from "./bleed/Bleed";
|
|
43
42
|
import DxcInset from "./inset/Inset";
|
|
44
43
|
import DxcQuickNav from "./quick-nav/QuickNav";
|
|
44
|
+
import DxcNavTabs from "./tabs-nav/NavTabs";
|
|
45
|
+
import DxcInline from "./inline/Inline";
|
|
45
46
|
import HalstackContext, { HalstackProvider, HalstackLanguageContext } from "./HalstackContext";
|
|
46
47
|
import { BackgroundColorProvider } from "./BackgroundColorContext";
|
|
47
|
-
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() {
|
|
@@ -139,6 +145,12 @@ Object.defineProperty(exports, "DxcList", {
|
|
|
139
145
|
return _List["default"];
|
|
140
146
|
}
|
|
141
147
|
});
|
|
148
|
+
Object.defineProperty(exports, "DxcNavTabs", {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
get: function get() {
|
|
151
|
+
return _NavTabs["default"];
|
|
152
|
+
}
|
|
153
|
+
});
|
|
142
154
|
Object.defineProperty(exports, "DxcNumberInput", {
|
|
143
155
|
enumerable: true,
|
|
144
156
|
get: function get() {
|
|
@@ -169,12 +181,6 @@ Object.defineProperty(exports, "DxcQuickNav", {
|
|
|
169
181
|
return _QuickNav["default"];
|
|
170
182
|
}
|
|
171
183
|
});
|
|
172
|
-
Object.defineProperty(exports, "DxcRadio", {
|
|
173
|
-
enumerable: true,
|
|
174
|
-
get: function get() {
|
|
175
|
-
return _Radio["default"];
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
184
|
Object.defineProperty(exports, "DxcRadioGroup", {
|
|
179
185
|
enumerable: true,
|
|
180
186
|
get: function get() {
|
|
@@ -314,8 +320,6 @@ var _Footer = _interopRequireDefault(require("./footer/Footer"));
|
|
|
314
320
|
|
|
315
321
|
var _Header = _interopRequireDefault(require("./header/Header"));
|
|
316
322
|
|
|
317
|
-
var _Radio = _interopRequireDefault(require("./radio/Radio"));
|
|
318
|
-
|
|
319
323
|
var _Slider = _interopRequireDefault(require("./slider/Slider"));
|
|
320
324
|
|
|
321
325
|
var _Switch = _interopRequireDefault(require("./switch/Switch"));
|
|
@@ -384,6 +388,10 @@ var _Inset = _interopRequireDefault(require("./inset/Inset"));
|
|
|
384
388
|
|
|
385
389
|
var _QuickNav = _interopRequireDefault(require("./quick-nav/QuickNav"));
|
|
386
390
|
|
|
391
|
+
var _NavTabs = _interopRequireDefault(require("./tabs-nav/NavTabs"));
|
|
392
|
+
|
|
393
|
+
var _Inline = _interopRequireDefault(require("./inline/Inline"));
|
|
394
|
+
|
|
387
395
|
var _HalstackContext = _interopRequireWildcard(require("./HalstackContext"));
|
|
388
396
|
|
|
389
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-c291a0c",
|
|
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",
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
6
|
+
|
|
7
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
8
|
+
|
|
5
9
|
var _react = _interopRequireDefault(require("react"));
|
|
6
10
|
|
|
7
11
|
var _react2 = require("@testing-library/react");
|
|
@@ -10,6 +14,44 @@ var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
|
|
|
10
14
|
|
|
11
15
|
var _Paginator = _interopRequireDefault(require("./Paginator"));
|
|
12
16
|
|
|
17
|
+
// Mocking DOMRect for Radix Primitive Popover
|
|
18
|
+
global.globalThis = global;
|
|
19
|
+
|
|
20
|
+
global.ResizeObserver = /*#__PURE__*/function () {
|
|
21
|
+
function ResizeObserver(cb) {
|
|
22
|
+
(0, _classCallCheck2["default"])(this, ResizeObserver);
|
|
23
|
+
this.cb = cb;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
(0, _createClass2["default"])(ResizeObserver, [{
|
|
27
|
+
key: "observe",
|
|
28
|
+
value: function observe() {
|
|
29
|
+
this.cb([{
|
|
30
|
+
borderBoxSize: {
|
|
31
|
+
inlineSize: 0,
|
|
32
|
+
blockSize: 0
|
|
33
|
+
}
|
|
34
|
+
}]);
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
key: "unobserve",
|
|
38
|
+
value: function unobserve() {}
|
|
39
|
+
}]);
|
|
40
|
+
return ResizeObserver;
|
|
41
|
+
}();
|
|
42
|
+
|
|
43
|
+
global.DOMRect = {
|
|
44
|
+
fromRect: function fromRect() {
|
|
45
|
+
return {
|
|
46
|
+
top: 0,
|
|
47
|
+
left: 0,
|
|
48
|
+
bottom: 0,
|
|
49
|
+
right: 0,
|
|
50
|
+
width: 0,
|
|
51
|
+
height: 0
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
};
|
|
13
55
|
describe("Paginator component tests", function () {
|
|
14
56
|
test("Paginator renders with default values", function () {
|
|
15
57
|
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Paginator["default"], null)),
|
|
@@ -37,7 +37,7 @@ var DxcProgressBar = function DxcProgressBar(_ref) {
|
|
|
37
37
|
_ref$helperText = _ref.helperText,
|
|
38
38
|
helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
|
|
39
39
|
_ref$overlay = _ref.overlay,
|
|
40
|
-
overlay = _ref$overlay === void 0 ?
|
|
40
|
+
overlay = _ref$overlay === void 0 ? false : _ref$overlay,
|
|
41
41
|
value = _ref.value,
|
|
42
42
|
_ref$showValue = _ref.showValue,
|
|
43
43
|
showValue = _ref$showValue === void 0 ? false : _ref$showValue,
|
|
@@ -12,40 +12,40 @@ export const Chromatic = () => (
|
|
|
12
12
|
<>
|
|
13
13
|
<ExampleContainer>
|
|
14
14
|
<Title title="Without labels" theme="light" level={4} />
|
|
15
|
-
<DxcProgressBar
|
|
15
|
+
<DxcProgressBar value={50} showValue />
|
|
16
16
|
<Title title="With helperText" theme="light" level={4} />
|
|
17
|
-
<DxcProgressBar helperText="Helper text" value={50}
|
|
17
|
+
<DxcProgressBar helperText="Helper text" value={50} showValue />
|
|
18
18
|
<Title title="Without default value" theme="light" level={4} />
|
|
19
|
-
<DxcProgressBar label="Loading..."
|
|
19
|
+
<DxcProgressBar label="Loading..." showValue />
|
|
20
20
|
</ExampleContainer>
|
|
21
21
|
<Title title="Margins" theme="light" level={2} />
|
|
22
22
|
<ExampleContainer>
|
|
23
23
|
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
24
|
-
<DxcProgressBar label="Margin xxsmall" margin="xxsmall"
|
|
24
|
+
<DxcProgressBar label="Margin xxsmall" margin="xxsmall" value={50} showValue />
|
|
25
25
|
</ExampleContainer>
|
|
26
26
|
<ExampleContainer>
|
|
27
27
|
<Title title="Xsmall margin" theme="light" level={4} />
|
|
28
|
-
<DxcProgressBar label="Margin xsmall" margin="xsmall"
|
|
28
|
+
<DxcProgressBar label="Margin xsmall" margin="xsmall" value={50} showValue />
|
|
29
29
|
</ExampleContainer>
|
|
30
30
|
<ExampleContainer>
|
|
31
31
|
<Title title="Small margin" theme="light" level={4} />
|
|
32
|
-
<DxcProgressBar label="Margin small" margin="small"
|
|
32
|
+
<DxcProgressBar label="Margin small" margin="small" value={50} showValue />
|
|
33
33
|
</ExampleContainer>
|
|
34
34
|
<ExampleContainer>
|
|
35
35
|
<Title title="Medium margin" theme="light" level={4} />
|
|
36
|
-
<DxcProgressBar label="Margin medium" margin="medium"
|
|
36
|
+
<DxcProgressBar label="Margin medium" margin="medium" value={50} showValue />
|
|
37
37
|
</ExampleContainer>
|
|
38
38
|
<ExampleContainer>
|
|
39
39
|
<Title title="Large margin" theme="light" level={4} />
|
|
40
|
-
<DxcProgressBar label="Margin large" margin="large"
|
|
40
|
+
<DxcProgressBar label="Margin large" margin="large" value={50} showValue />
|
|
41
41
|
</ExampleContainer>
|
|
42
42
|
<ExampleContainer>
|
|
43
43
|
<Title title="Xlarge margin" theme="light" level={4} />
|
|
44
|
-
<DxcProgressBar label="Margin xlarge" margin="xlarge"
|
|
44
|
+
<DxcProgressBar label="Margin xlarge" margin="xlarge" value={50} showValue />
|
|
45
45
|
</ExampleContainer>
|
|
46
46
|
<ExampleContainer>
|
|
47
47
|
<Title title="XxLarge margin" theme="light" level={4} />
|
|
48
|
-
<DxcProgressBar label="Margin xxlarge" margin="xxlarge"
|
|
48
|
+
<DxcProgressBar label="Margin xxlarge" margin="xxlarge" value={50} showValue />
|
|
49
49
|
</ExampleContainer>
|
|
50
50
|
</>
|
|
51
51
|
);
|
|
@@ -53,6 +53,6 @@ export const Chromatic = () => (
|
|
|
53
53
|
export const ProgressBarOverlay = () => (
|
|
54
54
|
<ExampleContainer>
|
|
55
55
|
<Title title="Overlay" theme="dark" level={4} />
|
|
56
|
-
<DxcProgressBar label="Overlay" helperText="Helper text" showValue value={50} />
|
|
56
|
+
<DxcProgressBar label="Overlay" helperText="Helper text" overlay={true} showValue value={50} />
|
|
57
57
|
</ExampleContainer>
|
|
58
58
|
);
|