@dxc-technology/halstack-react 0.0.0-59568e7 → 0.0.0-5aa300b
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 +7 -11
- package/accordion/Accordion.js +117 -104
- package/accordion/Accordion.stories.tsx +54 -15
- package/accordion/Accordion.test.js +9 -10
- package/accordion/types.d.ts +5 -4
- package/accordion-group/AccordionGroup.js +2 -21
- package/accordion-group/AccordionGroup.stories.tsx +27 -1
- package/accordion-group/AccordionGroup.test.js +20 -45
- package/accordion-group/types.d.ts +10 -3
- package/alert/Alert.js +1 -1
- package/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 +94 -95
- package/bleed/types.d.ts +1 -1
- package/box/Box.js +23 -33
- package/box/types.d.ts +1 -0
- package/bulleted-list/BulletedList.d.ts +7 -0
- package/bulleted-list/BulletedList.js +123 -0
- package/bulleted-list/BulletedList.stories.tsx +200 -0
- package/bulleted-list/types.d.ts +11 -0
- package/{list → bulleted-list}/types.js +0 -0
- package/button/Button.js +50 -70
- package/button/Button.stories.tsx +61 -1
- package/button/types.d.ts +7 -7
- package/card/Card.js +34 -36
- package/card/types.d.ts +1 -0
- package/checkbox/Checkbox.d.ts +2 -2
- package/checkbox/Checkbox.js +92 -99
- package/checkbox/Checkbox.stories.tsx +79 -59
- package/checkbox/Checkbox.test.js +93 -16
- package/checkbox/types.d.ts +6 -2
- package/chip/Chip.js +11 -23
- package/chip/Chip.stories.tsx +41 -9
- package/chip/types.d.ts +1 -1
- package/common/variables.js +186 -158
- package/date-input/Calendar.d.ts +4 -0
- package/date-input/Calendar.js +258 -0
- package/date-input/DateInput.js +77 -222
- package/date-input/DateInput.stories.tsx +30 -17
- package/date-input/DateInput.test.js +411 -138
- package/date-input/DatePicker.d.ts +4 -0
- package/date-input/DatePicker.js +160 -0
- package/date-input/YearPicker.d.ts +4 -0
- package/date-input/YearPicker.js +115 -0
- package/date-input/types.d.ts +53 -0
- package/dialog/Dialog.js +52 -28
- package/dialog/Dialog.stories.tsx +57 -2
- package/dialog/Dialog.test.js +34 -4
- package/dialog/types.d.ts +3 -2
- package/dropdown/Dropdown.d.ts +1 -1
- package/dropdown/Dropdown.js +247 -249
- package/dropdown/Dropdown.stories.tsx +135 -64
- package/dropdown/Dropdown.test.js +504 -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/file-input/FileInput.d.ts +2 -2
- package/file-input/FileInput.js +177 -219
- package/file-input/FileInput.stories.tsx +38 -10
- package/file-input/FileInput.test.js +53 -12
- package/file-input/FileItem.d.ts +4 -14
- package/file-input/FileItem.js +38 -63
- package/file-input/types.d.ts +17 -0
- package/flex/Flex.d.ts +4 -0
- package/flex/Flex.js +69 -0
- package/flex/Flex.stories.tsx +103 -0
- package/flex/types.d.ts +32 -0
- package/{radio → flex}/types.js +0 -0
- package/footer/Footer.stories.tsx +8 -1
- package/footer/Icons.js +1 -1
- package/footer/types.d.ts +2 -1
- package/header/Header.js +74 -72
- package/header/Header.stories.tsx +4 -4
- package/header/Icons.js +2 -2
- package/header/types.d.ts +3 -2
- package/inset/Inset.js +1 -34
- package/inset/Inset.stories.tsx +36 -36
- package/inset/types.d.ts +1 -1
- package/layout/ApplicationLayout.d.ts +16 -6
- package/layout/ApplicationLayout.js +70 -117
- package/layout/ApplicationLayout.stories.tsx +84 -93
- 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 +18 -33
- package/link/Link.d.ts +2 -2
- package/link/Link.js +24 -50
- package/link/Link.stories.tsx +13 -6
- package/link/types.d.ts +3 -4
- package/main.d.ts +6 -9
- package/main.js +32 -56
- package/number-input/NumberInput.test.js +43 -7
- package/package.json +16 -20
- package/paginator/Icons.d.ts +5 -0
- package/paginator/Icons.js +16 -28
- package/paginator/Paginator.js +6 -12
- package/paginator/Paginator.test.js +43 -1
- package/paragraph/Paragraph.d.ts +6 -0
- package/paragraph/Paragraph.js +38 -0
- package/paragraph/Paragraph.stories.tsx +44 -0
- package/password-input/PasswordInput.test.js +13 -12
- package/progress-bar/ProgressBar.d.ts +2 -2
- package/progress-bar/ProgressBar.js +56 -50
- package/progress-bar/ProgressBar.stories.jsx +3 -1
- package/progress-bar/ProgressBar.test.js +67 -22
- package/progress-bar/types.d.ts +3 -4
- package/quick-nav/QuickNav.js +25 -20
- package/quick-nav/QuickNav.stories.tsx +131 -26
- package/radio-group/Radio.d.ts +1 -1
- package/radio-group/Radio.js +43 -28
- package/radio-group/RadioGroup.js +23 -22
- package/radio-group/RadioGroup.stories.tsx +1 -0
- package/radio-group/RadioGroup.test.js +123 -96
- package/radio-group/types.d.ts +2 -2
- package/resultsetTable/Icons.d.ts +7 -0
- package/resultsetTable/Icons.js +51 -0
- package/resultsetTable/ResultsetTable.js +48 -107
- package/resultsetTable/ResultsetTable.stories.tsx +50 -25
- package/resultsetTable/ResultsetTable.test.js +65 -41
- package/resultsetTable/types.d.ts +2 -2
- package/select/Listbox.d.ts +1 -1
- package/select/Listbox.js +53 -7
- package/select/Option.js +8 -10
- package/select/Select.js +43 -43
- package/select/Select.stories.tsx +225 -136
- package/select/Select.test.js +363 -250
- package/select/types.d.ts +2 -5
- package/sidenav/Sidenav.d.ts +6 -5
- package/sidenav/Sidenav.js +182 -52
- package/sidenav/Sidenav.stories.tsx +163 -156
- package/sidenav/Sidenav.test.js +25 -37
- package/sidenav/types.d.ts +50 -27
- package/slider/Slider.d.ts +2 -2
- package/slider/Slider.js +120 -95
- package/slider/Slider.stories.tsx +7 -1
- package/slider/Slider.test.js +121 -21
- package/slider/types.d.ts +6 -2
- package/spinner/Spinner.js +2 -2
- package/switch/Switch.d.ts +2 -2
- package/switch/Switch.js +135 -68
- package/switch/Switch.stories.tsx +8 -30
- package/switch/Switch.test.js +144 -17
- package/switch/types.d.ts +6 -2
- package/table/Table.js +1 -1
- package/table/Table.test.js +1 -1
- package/tabs/Tab.d.ts +4 -0
- package/tabs/Tab.js +133 -0
- package/tabs/Tabs.js +360 -104
- package/tabs/Tabs.stories.tsx +81 -5
- package/tabs/Tabs.test.js +217 -6
- package/tabs/types.d.ts +15 -5
- package/tabs-nav/NavTabs.d.ts +8 -0
- package/tabs-nav/NavTabs.js +125 -0
- package/tabs-nav/NavTabs.stories.tsx +172 -0
- package/tabs-nav/NavTabs.test.js +82 -0
- package/tabs-nav/Tab.d.ts +4 -0
- package/tabs-nav/Tab.js +128 -0
- package/tabs-nav/types.d.ts +53 -0
- package/{row → tabs-nav}/types.js +0 -0
- package/tag/Tag.js +1 -1
- package/tag/types.d.ts +1 -1
- package/text-input/Icons.d.ts +8 -0
- package/text-input/Icons.js +60 -0
- package/text-input/Suggestion.js +38 -9
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +134 -0
- package/text-input/TextInput.js +195 -292
- package/text-input/TextInput.stories.tsx +211 -185
- package/text-input/TextInput.test.js +737 -725
- package/text-input/types.d.ts +22 -3
- package/toggle-group/types.d.ts +1 -1
- package/typography/Typography.d.ts +4 -0
- package/typography/Typography.js +131 -0
- package/typography/Typography.stories.tsx +198 -0
- package/typography/types.d.ts +18 -0
- package/{stack → typography}/types.js +0 -0
- package/wizard/Wizard.js +9 -16
- package/wizard/Wizard.stories.tsx +20 -1
- package/wizard/types.d.ts +5 -4
- package/common/RequiredComponent.js +0 -32
- 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/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/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/layout/types.d.ts
CHANGED
|
@@ -1,54 +1,39 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare type
|
|
3
|
-
declare type Padding = {
|
|
4
|
-
top?: Space;
|
|
5
|
-
bottom?: Space;
|
|
6
|
-
left?: Space;
|
|
7
|
-
right?: Space;
|
|
8
|
-
};
|
|
9
|
-
declare type ChildrenType = AppLayoutHeaderPropsType | AppLayoutMainPropsType | AppLayoutFooterPropsType | AppLayoutSidenavPropsType;
|
|
10
|
-
export declare type AppLayoutHeaderPropsType = {
|
|
11
|
-
/**
|
|
12
|
-
* Everything between this tags will be displayed as a header, at the top of the screen.
|
|
13
|
-
* This is optional and if it is not specified, the DxcHeader will be shown by default.
|
|
14
|
-
*/
|
|
15
|
-
children?: React.ReactNode;
|
|
16
|
-
};
|
|
2
|
+
declare type ChildrenType = AppLayoutMainPropsType | AppLayoutSidenavPropsType;
|
|
17
3
|
export declare type AppLayoutMainPropsType = {
|
|
18
4
|
/**
|
|
19
5
|
* Everything between the tags will be displayed as the content of the main part of the application.
|
|
20
6
|
*/
|
|
21
7
|
children: React.ReactNode;
|
|
22
8
|
};
|
|
23
|
-
export declare type
|
|
9
|
+
export declare type AppLayoutSidenavPropsType = {
|
|
10
|
+
/**
|
|
11
|
+
* The area inside the sidenav. This area can be used to render the content inside the sidenav.
|
|
12
|
+
*/
|
|
13
|
+
children: React.ReactNode;
|
|
24
14
|
/**
|
|
25
|
-
*
|
|
26
|
-
* This is optional and if it is not specified, the DxcFooter will be shown by default.
|
|
15
|
+
* The area assigned to render the sidenav title. It is highly recommended to use the sidenav title.
|
|
27
16
|
*/
|
|
28
|
-
|
|
17
|
+
title?: React.ReactNode;
|
|
29
18
|
};
|
|
30
|
-
|
|
19
|
+
declare type AppLayoutPropsType = {
|
|
31
20
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
21
|
+
* Text to be placed next to the hamburger button that toggles the
|
|
22
|
+
* visibility of the sidenav.
|
|
34
23
|
*/
|
|
35
|
-
|
|
24
|
+
visibilityToggleLabel?: string;
|
|
36
25
|
/**
|
|
37
|
-
*
|
|
26
|
+
* Header content.
|
|
38
27
|
*/
|
|
39
|
-
|
|
28
|
+
header?: React.ReactNode;
|
|
40
29
|
/**
|
|
41
|
-
*
|
|
42
|
-
* In lower resolutions the arrow will be always displayed.
|
|
30
|
+
* Sidenav content
|
|
43
31
|
*/
|
|
44
|
-
|
|
32
|
+
sidenav?: React.ReactNode;
|
|
45
33
|
/**
|
|
46
|
-
*
|
|
47
|
-
* In lower resolutions the mode will always be overlay.
|
|
34
|
+
* Footer content
|
|
48
35
|
*/
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
declare type AppLayoutPropsType = {
|
|
36
|
+
footer?: React.ReactNode;
|
|
52
37
|
/**
|
|
53
38
|
* The area inside the sidenav. This area can be used to render custom content.
|
|
54
39
|
*/
|
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
|
-
onClick: !disabled
|
|
71
|
+
onClick: !disabled ? onClick : undefined,
|
|
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 align-items: baseline;\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-size: ", ";\n font-weight: ", ";\n font-style: ", ";\n font-family: ", ";\n text-decoration-color: transparent;\n width: fit-content;\n\n ", "\n ", "\n color: ", ";\n ", "\n\n &:visited {\n color: ", ";\n &:hover {\n ", "\n }\n }\n &:hover {\n ", "\n }\n &:focus {\n border-radius: 2px;\n outline: 2px solid ", ";\n ", "\n }\n &:active {\n ", "\n }\n"])), function (props) {
|
|
86
86
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
87
87
|
}, function (props) {
|
|
88
88
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
@@ -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/Link.stories.tsx
CHANGED
|
@@ -9,7 +9,7 @@ export default {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
const icon = (
|
|
12
|
-
<svg viewBox="0 0 24 24"
|
|
12
|
+
<svg viewBox="0 0 24 24" enableBackground="new 0 0 24 24" fill="currentColor">
|
|
13
13
|
<g id="Bounding_Box">
|
|
14
14
|
<rect fill="none" width="24" height="24" />
|
|
15
15
|
</g>
|
|
@@ -68,11 +68,18 @@ export const Chromatic = () => (
|
|
|
68
68
|
</ExampleContainer>
|
|
69
69
|
<ExampleContainer pseudoState="pseudo-hover">
|
|
70
70
|
<Title title="Long text with hover" theme="light" level={4} />
|
|
71
|
-
Lorem
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
Lorem{" "}
|
|
72
|
+
<DxcLink href="https://www.google.com" icon={icon}>
|
|
73
|
+
Test
|
|
74
|
+
</DxcLink>{" "}
|
|
75
|
+
ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
|
|
76
|
+
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
77
|
+
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
78
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit{" "}
|
|
79
|
+
<DxcLink href="https://www.google.com" icon={icon} iconPosition="after">
|
|
80
|
+
Test
|
|
81
|
+
</DxcLink>{" "}
|
|
82
|
+
anim id est laborum.
|
|
76
83
|
</ExampleContainer>
|
|
77
84
|
<ExampleContainer pseudoState="pseudo-focus">
|
|
78
85
|
<Title title="Long text with focus" theme="light" level={4} />
|
package/link/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare type Margin = {
|
|
|
6
6
|
left?: Space;
|
|
7
7
|
right?: Space;
|
|
8
8
|
};
|
|
9
|
-
declare type SVG = React.SVGProps<SVGSVGElement>;
|
|
9
|
+
declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
|
|
10
10
|
export declare type LinkProps = {
|
|
11
11
|
/**
|
|
12
12
|
* If true, the color is inherited from parent.
|
|
@@ -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/main.d.ts
CHANGED
|
@@ -5,9 +5,6 @@ import DxcCard from "./card/Card";
|
|
|
5
5
|
import DxcCheckbox from "./checkbox/Checkbox";
|
|
6
6
|
import DxcDialog from "./dialog/Dialog";
|
|
7
7
|
import DxcDropdown from "./dropdown/Dropdown";
|
|
8
|
-
import DxcFooter from "./footer/Footer";
|
|
9
|
-
import DxcHeader from "./header/Header";
|
|
10
|
-
import DxcRadio from "./radio/Radio";
|
|
11
8
|
import DxcSlider from "./slider/Slider";
|
|
12
9
|
import DxcSwitch from "./switch/Switch";
|
|
13
10
|
import DxcTabs from "./tabs/Tabs";
|
|
@@ -17,7 +14,6 @@ import DxcTable from "./table/Table";
|
|
|
17
14
|
import DxcBox from "./box/Box";
|
|
18
15
|
import DxcTag from "./tag/Tag";
|
|
19
16
|
import DxcPaginator from "./paginator/Paginator";
|
|
20
|
-
import DxcSidenav from "./sidenav/Sidenav";
|
|
21
17
|
import DxcWizard from "./wizard/Wizard";
|
|
22
18
|
import DxcLink from "./link/Link";
|
|
23
19
|
import DxcHeading from "./heading/Heading";
|
|
@@ -34,14 +30,15 @@ import DxcNumberInput from "./number-input/NumberInput";
|
|
|
34
30
|
import DxcTextarea from "./textarea/Textarea";
|
|
35
31
|
import DxcSelect from "./select/Select";
|
|
36
32
|
import DxcFileInput from "./file-input/FileInput";
|
|
37
|
-
import DxcStack from "./stack/Stack";
|
|
38
|
-
import DxcRow from "./row/Row";
|
|
39
|
-
import DxcText from "./text/Text";
|
|
40
|
-
import DxcList from "./list/List";
|
|
41
33
|
import DxcRadioGroup from "./radio-group/RadioGroup";
|
|
42
34
|
import DxcBleed from "./bleed/Bleed";
|
|
43
35
|
import DxcInset from "./inset/Inset";
|
|
44
36
|
import DxcQuickNav from "./quick-nav/QuickNav";
|
|
37
|
+
import DxcNavTabs from "./tabs-nav/NavTabs";
|
|
38
|
+
import DxcFlex from "./flex/Flex";
|
|
39
|
+
import DxcTypography from "./typography/Typography";
|
|
40
|
+
import DxcParagraph from "./paragraph/Paragraph";
|
|
41
|
+
import DxcBulletedList from "./bulleted-list/BulletedList";
|
|
45
42
|
import HalstackContext, { HalstackProvider, HalstackLanguageContext } from "./HalstackContext";
|
|
46
43
|
import { BackgroundColorProvider } from "./BackgroundColorContext";
|
|
47
|
-
export { DxcAlert, DxcButton,
|
|
44
|
+
export { DxcAlert, DxcButton, DxcCheckbox, DxcTextInput, DxcDropdown, DxcSwitch, DxcSlider, DxcTable, DxcTabs, DxcToggleGroup, DxcDialog, DxcCard, DxcProgressBar, DxcAccordion, DxcSpinner, DxcBox, DxcTag, DxcPaginator, DxcWizard, DxcLink, DxcHeading, DxcResultsetTable, DxcChip, DxcApplicationLayout, HalstackContext, HalstackLanguageContext, HalstackProvider, BackgroundColorProvider, DxcAccordionGroup, DxcBadge, DxcPasswordInput, DxcDateInput, DxcNumberInput, DxcTextarea, DxcSelect, DxcFileInput, DxcRadioGroup, DxcBleed, DxcInset, DxcQuickNav, DxcNavTabs, DxcFlex, DxcTypography, DxcParagraph, DxcBulletedList, };
|
package/main.js
CHANGED
|
@@ -55,6 +55,12 @@ Object.defineProperty(exports, "DxcBox", {
|
|
|
55
55
|
return _Box["default"];
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
|
+
Object.defineProperty(exports, "DxcBulletedList", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function get() {
|
|
61
|
+
return _BulletedList["default"];
|
|
62
|
+
}
|
|
63
|
+
});
|
|
58
64
|
Object.defineProperty(exports, "DxcButton", {
|
|
59
65
|
enumerable: true,
|
|
60
66
|
get: function get() {
|
|
@@ -103,16 +109,10 @@ Object.defineProperty(exports, "DxcFileInput", {
|
|
|
103
109
|
return _FileInput["default"];
|
|
104
110
|
}
|
|
105
111
|
});
|
|
106
|
-
Object.defineProperty(exports, "
|
|
112
|
+
Object.defineProperty(exports, "DxcFlex", {
|
|
107
113
|
enumerable: true,
|
|
108
114
|
get: function get() {
|
|
109
|
-
return
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
Object.defineProperty(exports, "DxcHeader", {
|
|
113
|
-
enumerable: true,
|
|
114
|
-
get: function get() {
|
|
115
|
-
return _Header["default"];
|
|
115
|
+
return _Flex["default"];
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
118
|
Object.defineProperty(exports, "DxcHeading", {
|
|
@@ -133,10 +133,10 @@ Object.defineProperty(exports, "DxcLink", {
|
|
|
133
133
|
return _Link["default"];
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
|
-
Object.defineProperty(exports, "
|
|
136
|
+
Object.defineProperty(exports, "DxcNavTabs", {
|
|
137
137
|
enumerable: true,
|
|
138
138
|
get: function get() {
|
|
139
|
-
return
|
|
139
|
+
return _NavTabs["default"];
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
142
|
Object.defineProperty(exports, "DxcNumberInput", {
|
|
@@ -151,6 +151,12 @@ Object.defineProperty(exports, "DxcPaginator", {
|
|
|
151
151
|
return _Paginator["default"];
|
|
152
152
|
}
|
|
153
153
|
});
|
|
154
|
+
Object.defineProperty(exports, "DxcParagraph", {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
get: function get() {
|
|
157
|
+
return _Paragraph["default"];
|
|
158
|
+
}
|
|
159
|
+
});
|
|
154
160
|
Object.defineProperty(exports, "DxcPasswordInput", {
|
|
155
161
|
enumerable: true,
|
|
156
162
|
get: function get() {
|
|
@@ -169,12 +175,6 @@ Object.defineProperty(exports, "DxcQuickNav", {
|
|
|
169
175
|
return _QuickNav["default"];
|
|
170
176
|
}
|
|
171
177
|
});
|
|
172
|
-
Object.defineProperty(exports, "DxcRadio", {
|
|
173
|
-
enumerable: true,
|
|
174
|
-
get: function get() {
|
|
175
|
-
return _Radio["default"];
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
178
|
Object.defineProperty(exports, "DxcRadioGroup", {
|
|
179
179
|
enumerable: true,
|
|
180
180
|
get: function get() {
|
|
@@ -187,24 +187,12 @@ Object.defineProperty(exports, "DxcResultsetTable", {
|
|
|
187
187
|
return _ResultsetTable["default"];
|
|
188
188
|
}
|
|
189
189
|
});
|
|
190
|
-
Object.defineProperty(exports, "DxcRow", {
|
|
191
|
-
enumerable: true,
|
|
192
|
-
get: function get() {
|
|
193
|
-
return _Row["default"];
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
190
|
Object.defineProperty(exports, "DxcSelect", {
|
|
197
191
|
enumerable: true,
|
|
198
192
|
get: function get() {
|
|
199
193
|
return _Select["default"];
|
|
200
194
|
}
|
|
201
195
|
});
|
|
202
|
-
Object.defineProperty(exports, "DxcSidenav", {
|
|
203
|
-
enumerable: true,
|
|
204
|
-
get: function get() {
|
|
205
|
-
return _Sidenav["default"];
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
196
|
Object.defineProperty(exports, "DxcSlider", {
|
|
209
197
|
enumerable: true,
|
|
210
198
|
get: function get() {
|
|
@@ -217,12 +205,6 @@ Object.defineProperty(exports, "DxcSpinner", {
|
|
|
217
205
|
return _Spinner["default"];
|
|
218
206
|
}
|
|
219
207
|
});
|
|
220
|
-
Object.defineProperty(exports, "DxcStack", {
|
|
221
|
-
enumerable: true,
|
|
222
|
-
get: function get() {
|
|
223
|
-
return _Stack["default"];
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
208
|
Object.defineProperty(exports, "DxcSwitch", {
|
|
227
209
|
enumerable: true,
|
|
228
210
|
get: function get() {
|
|
@@ -247,12 +229,6 @@ Object.defineProperty(exports, "DxcTag", {
|
|
|
247
229
|
return _Tag["default"];
|
|
248
230
|
}
|
|
249
231
|
});
|
|
250
|
-
Object.defineProperty(exports, "DxcText", {
|
|
251
|
-
enumerable: true,
|
|
252
|
-
get: function get() {
|
|
253
|
-
return _Text["default"];
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
232
|
Object.defineProperty(exports, "DxcTextInput", {
|
|
257
233
|
enumerable: true,
|
|
258
234
|
get: function get() {
|
|
@@ -271,6 +247,12 @@ Object.defineProperty(exports, "DxcToggleGroup", {
|
|
|
271
247
|
return _ToggleGroup["default"];
|
|
272
248
|
}
|
|
273
249
|
});
|
|
250
|
+
Object.defineProperty(exports, "DxcTypography", {
|
|
251
|
+
enumerable: true,
|
|
252
|
+
get: function get() {
|
|
253
|
+
return _Typography["default"];
|
|
254
|
+
}
|
|
255
|
+
});
|
|
274
256
|
Object.defineProperty(exports, "DxcWizard", {
|
|
275
257
|
enumerable: true,
|
|
276
258
|
get: function get() {
|
|
@@ -310,12 +292,6 @@ var _Dialog = _interopRequireDefault(require("./dialog/Dialog"));
|
|
|
310
292
|
|
|
311
293
|
var _Dropdown = _interopRequireDefault(require("./dropdown/Dropdown"));
|
|
312
294
|
|
|
313
|
-
var _Footer = _interopRequireDefault(require("./footer/Footer"));
|
|
314
|
-
|
|
315
|
-
var _Header = _interopRequireDefault(require("./header/Header"));
|
|
316
|
-
|
|
317
|
-
var _Radio = _interopRequireDefault(require("./radio/Radio"));
|
|
318
|
-
|
|
319
295
|
var _Slider = _interopRequireDefault(require("./slider/Slider"));
|
|
320
296
|
|
|
321
297
|
var _Switch = _interopRequireDefault(require("./switch/Switch"));
|
|
@@ -334,8 +310,6 @@ var _Tag = _interopRequireDefault(require("./tag/Tag"));
|
|
|
334
310
|
|
|
335
311
|
var _Paginator = _interopRequireDefault(require("./paginator/Paginator"));
|
|
336
312
|
|
|
337
|
-
var _Sidenav = _interopRequireDefault(require("./sidenav/Sidenav"));
|
|
338
|
-
|
|
339
313
|
var _Wizard = _interopRequireDefault(require("./wizard/Wizard"));
|
|
340
314
|
|
|
341
315
|
var _Link = _interopRequireDefault(require("./link/Link"));
|
|
@@ -368,14 +342,6 @@ var _Select = _interopRequireDefault(require("./select/Select"));
|
|
|
368
342
|
|
|
369
343
|
var _FileInput = _interopRequireDefault(require("./file-input/FileInput"));
|
|
370
344
|
|
|
371
|
-
var _Stack = _interopRequireDefault(require("./stack/Stack"));
|
|
372
|
-
|
|
373
|
-
var _Row = _interopRequireDefault(require("./row/Row"));
|
|
374
|
-
|
|
375
|
-
var _Text = _interopRequireDefault(require("./text/Text"));
|
|
376
|
-
|
|
377
|
-
var _List = _interopRequireDefault(require("./list/List"));
|
|
378
|
-
|
|
379
345
|
var _RadioGroup = _interopRequireDefault(require("./radio-group/RadioGroup"));
|
|
380
346
|
|
|
381
347
|
var _Bleed = _interopRequireDefault(require("./bleed/Bleed"));
|
|
@@ -384,6 +350,16 @@ var _Inset = _interopRequireDefault(require("./inset/Inset"));
|
|
|
384
350
|
|
|
385
351
|
var _QuickNav = _interopRequireDefault(require("./quick-nav/QuickNav"));
|
|
386
352
|
|
|
353
|
+
var _NavTabs = _interopRequireDefault(require("./tabs-nav/NavTabs"));
|
|
354
|
+
|
|
355
|
+
var _Flex = _interopRequireDefault(require("./flex/Flex"));
|
|
356
|
+
|
|
357
|
+
var _Typography = _interopRequireDefault(require("./typography/Typography"));
|
|
358
|
+
|
|
359
|
+
var _Paragraph = _interopRequireDefault(require("./paragraph/Paragraph"));
|
|
360
|
+
|
|
361
|
+
var _BulletedList = _interopRequireDefault(require("./bulleted-list/BulletedList"));
|
|
362
|
+
|
|
387
363
|
var _HalstackContext = _interopRequireWildcard(require("./HalstackContext"));
|
|
388
364
|
|
|
389
365
|
var _BackgroundColorContext = require("./BackgroundColorContext");
|
|
@@ -83,7 +83,7 @@ describe("Number input component tests", function () {
|
|
|
83
83
|
})),
|
|
84
84
|
getByRole = _render8.getByRole;
|
|
85
85
|
|
|
86
|
-
var input = getByRole("
|
|
86
|
+
var input = getByRole("spinbutton");
|
|
87
87
|
|
|
88
88
|
_userEvent["default"].type(input, "1");
|
|
89
89
|
|
|
@@ -366,12 +366,7 @@ describe("Number input component tests", function () {
|
|
|
366
366
|
expect(number.value).toBe("10");
|
|
367
367
|
});
|
|
368
368
|
test("Increment and decrement the value with min, max and step", function () {
|
|
369
|
-
var onBlur = jest.fn(
|
|
370
|
-
var value = _ref3.value,
|
|
371
|
-
error = _ref3.error;
|
|
372
|
-
expect(value).toBe("1");
|
|
373
|
-
expect(error).toBe("Value must be greater than or equal to 5.");
|
|
374
|
-
});
|
|
369
|
+
var onBlur = jest.fn();
|
|
375
370
|
|
|
376
371
|
var _render20 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_NumberInput["default"], {
|
|
377
372
|
label: "Number input label",
|
|
@@ -389,6 +384,10 @@ describe("Number input component tests", function () {
|
|
|
389
384
|
|
|
390
385
|
_react2.fireEvent.blur(number);
|
|
391
386
|
|
|
387
|
+
expect(onBlur).toHaveBeenCalledWith({
|
|
388
|
+
value: "1",
|
|
389
|
+
error: "Value must be greater than or equal to 5."
|
|
390
|
+
});
|
|
392
391
|
var increment = getAllByRole("button")[1];
|
|
393
392
|
|
|
394
393
|
_userEvent["default"].click(increment);
|
|
@@ -503,4 +502,41 @@ describe("Number input component tests", function () {
|
|
|
503
502
|
var increment = getAllByRole("button")[1];
|
|
504
503
|
expect(increment.getAttribute("aria-label")).toBe("Increment value");
|
|
505
504
|
});
|
|
505
|
+
test("Number input submits correct values in a form", function () {
|
|
506
|
+
var handlerOnSubmit = jest.fn(function (e) {
|
|
507
|
+
e.preventDefault();
|
|
508
|
+
var formData = new FormData(e.target);
|
|
509
|
+
var formProps = Object.fromEntries(formData);
|
|
510
|
+
expect(formProps).toStrictEqual({
|
|
511
|
+
data: "0"
|
|
512
|
+
});
|
|
513
|
+
});
|
|
514
|
+
|
|
515
|
+
var _render23 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement("form", {
|
|
516
|
+
onSubmit: handlerOnSubmit
|
|
517
|
+
}, /*#__PURE__*/_react["default"].createElement(_NumberInput["default"], {
|
|
518
|
+
label: "Number input label",
|
|
519
|
+
name: "data"
|
|
520
|
+
}), /*#__PURE__*/_react["default"].createElement("button", {
|
|
521
|
+
type: "submit"
|
|
522
|
+
}, "Submit"))),
|
|
523
|
+
getByText = _render23.getByText,
|
|
524
|
+
getAllByRole = _render23.getAllByRole;
|
|
525
|
+
|
|
526
|
+
var less = getAllByRole("button")[0];
|
|
527
|
+
var more = getAllByRole("button")[1];
|
|
528
|
+
var submit = getByText("Submit");
|
|
529
|
+
|
|
530
|
+
_userEvent["default"].click(more);
|
|
531
|
+
|
|
532
|
+
expect(handlerOnSubmit).not.toHaveBeenCalled();
|
|
533
|
+
|
|
534
|
+
_userEvent["default"].click(less);
|
|
535
|
+
|
|
536
|
+
expect(handlerOnSubmit).not.toHaveBeenCalled();
|
|
537
|
+
|
|
538
|
+
_userEvent["default"].click(submit);
|
|
539
|
+
|
|
540
|
+
expect(handlerOnSubmit).toHaveBeenCalled();
|
|
541
|
+
});
|
|
506
542
|
});
|