@dxc-technology/halstack-react 0.0.0-ebf4fe2 → 0.0.0-ec06b53
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 -8
- package/accordion/Accordion.js +122 -103
- package/accordion/Accordion.stories.tsx +2 -3
- package/accordion/Accordion.test.js +9 -10
- package/accordion/types.d.ts +5 -4
- package/accordion-group/AccordionGroup.js +1 -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/bleed/Bleed.stories.tsx +63 -63
- package/box/Box.js +1 -1
- 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/{inline → bulleted-list}/types.js +0 -0
- package/button/Button.js +43 -61
- package/button/Button.stories.tsx +9 -0
- package/button/types.d.ts +7 -7
- package/card/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/types.d.ts +1 -1
- package/common/variables.js +75 -33
- 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 -247
- package/dropdown/Dropdown.stories.tsx +126 -63
- 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/{list → flex}/types.js +0 -0
- package/footer/Footer.stories.tsx +8 -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.stories.tsx +4 -4
- package/layout/ApplicationLayout.d.ts +15 -6
- package/layout/ApplicationLayout.js +36 -64
- package/layout/ApplicationLayout.stories.tsx +80 -44
- package/layout/types.d.ts +17 -27
- package/link/Link.js +2 -2
- package/link/Link.stories.tsx +13 -6
- package/link/types.d.ts +1 -1
- package/main.d.ts +5 -9
- package/main.js +27 -59
- package/number-input/NumberInput.test.js +43 -7
- package/package.json +16 -20
- package/paginator/Paginator.js +2 -2
- package/paginator/Paginator.test.js +1 -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 +18 -17
- 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 +23 -41
- package/resultsetTable/types.d.ts +2 -2
- package/select/Listbox.d.ts +1 -1
- package/select/Listbox.js +25 -2
- package/select/Select.js +17 -32
- package/select/Select.stories.tsx +6 -5
- package/select/Select.test.js +321 -250
- package/select/types.d.ts +2 -4
- package/sidenav/Sidenav.d.ts +6 -5
- package/sidenav/Sidenav.js +176 -55
- package/sidenav/Sidenav.stories.tsx +154 -156
- package/sidenav/Sidenav.test.js +25 -37
- package/sidenav/types.d.ts +50 -27
- package/slider/Slider.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/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 +135 -0
- package/tabs/Tabs.js +360 -104
- package/tabs/Tabs.stories.tsx +74 -0
- package/tabs/Tabs.test.js +217 -6
- package/tabs/types.d.ts +15 -5
- package/tabs-nav/NavTabs.js +5 -5
- package/tabs-nav/Tab.js +3 -5
- package/tabs-nav/types.d.ts +1 -1
- 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 +7 -5
- package/text-input/Suggestions.d.ts +4 -0
- package/text-input/Suggestions.js +134 -0
- package/text-input/TextInput.js +189 -282
- package/text-input/TextInput.stories.tsx +189 -182
- package/text-input/TextInput.test.js +639 -727
- 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/{row → 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/inline/Inline.d.ts +0 -4
- package/inline/Inline.js +0 -60
- package/inline/Inline.stories.tsx +0 -305
- package/inline/types.d.ts +0 -36
- package/list/List.d.ts +0 -4
- package/list/List.js +0 -47
- package/list/List.stories.tsx +0 -89
- package/list/types.d.ts +0 -7
- package/row/Row.d.ts +0 -3
- package/row/Row.js +0 -127
- package/row/Row.stories.tsx +0 -237
- package/row/types.d.ts +0 -28
- package/stack/Stack.d.ts +0 -4
- package/stack/Stack.js +0 -52
- package/stack/Stack.stories.tsx +0 -225
- package/stack/types.d.ts +0 -28
- package/stack/types.js +0 -5
- package/text/Text.d.ts +0 -7
- package/text/Text.js +0 -30
- package/text/Text.stories.tsx +0 -19
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import DxcApplicationLayout from "./ApplicationLayout";
|
|
3
|
-
import DxcSidenav from "../sidenav/Sidenav";
|
|
4
3
|
import Title from "../../.storybook/components/Title";
|
|
5
4
|
import { INITIAL_VIEWPORTS } from "@storybook/addon-viewport";
|
|
6
5
|
|
|
@@ -30,15 +29,25 @@ export const DefaultApplicationLayout = () => (
|
|
|
30
29
|
|
|
31
30
|
export const ApplicationLayoutWithDefaultSidenav = () => (
|
|
32
31
|
<>
|
|
33
|
-
<DxcApplicationLayout
|
|
34
|
-
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
<DxcApplicationLayout
|
|
33
|
+
sidenav={
|
|
34
|
+
<DxcApplicationLayout.SideNav
|
|
35
|
+
title={
|
|
36
|
+
<DxcApplicationLayout.SideNav.Title>
|
|
37
|
+
Application layout with push sidenav
|
|
38
|
+
</DxcApplicationLayout.SideNav.Title>
|
|
39
|
+
}
|
|
40
|
+
>
|
|
41
|
+
<DxcApplicationLayout.SideNav.Section>
|
|
42
|
+
<p>SideNav Content</p>
|
|
43
|
+
<p>SideNav Content</p>
|
|
44
|
+
<p>SideNav Content</p>
|
|
45
|
+
<p>SideNav Content</p>
|
|
46
|
+
<p>SideNav Content</p>
|
|
47
|
+
</DxcApplicationLayout.SideNav.Section>
|
|
48
|
+
</DxcApplicationLayout.SideNav>
|
|
49
|
+
}
|
|
50
|
+
>
|
|
42
51
|
<DxcApplicationLayout.Main>
|
|
43
52
|
<p>Main Content</p>
|
|
44
53
|
<p>Main Content</p>
|
|
@@ -51,15 +60,26 @@ export const ApplicationLayoutWithDefaultSidenav = () => (
|
|
|
51
60
|
|
|
52
61
|
export const ApplicationLayoutWithResponsiveSidenav = () => (
|
|
53
62
|
<>
|
|
54
|
-
<DxcApplicationLayout
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
<DxcApplicationLayout
|
|
64
|
+
visibilityToggleLabel="Example"
|
|
65
|
+
sidenav={
|
|
66
|
+
<DxcApplicationLayout.SideNav
|
|
67
|
+
title={
|
|
68
|
+
<DxcApplicationLayout.SideNav.Title>
|
|
69
|
+
Application layout with push sidenav
|
|
70
|
+
</DxcApplicationLayout.SideNav.Title>
|
|
71
|
+
}
|
|
72
|
+
>
|
|
73
|
+
<DxcApplicationLayout.SideNav.Section>
|
|
74
|
+
<p>SideNav Content</p>
|
|
75
|
+
<p>SideNav Content</p>
|
|
76
|
+
<p>SideNav Content</p>
|
|
77
|
+
<p>SideNav Content</p>
|
|
78
|
+
<p>SideNav Content</p>
|
|
79
|
+
</DxcApplicationLayout.SideNav.Section>
|
|
80
|
+
</DxcApplicationLayout.SideNav>
|
|
81
|
+
}
|
|
82
|
+
>
|
|
63
83
|
<DxcApplicationLayout.Main>
|
|
64
84
|
<p>Main Content</p>
|
|
65
85
|
<p>Main Content</p>
|
|
@@ -74,23 +94,31 @@ ApplicationLayoutWithResponsiveSidenav.parameters = {
|
|
|
74
94
|
viewport: {
|
|
75
95
|
defaultViewport: "pixel",
|
|
76
96
|
},
|
|
97
|
+
chromatic: { viewports: [540] },
|
|
77
98
|
};
|
|
78
99
|
|
|
79
100
|
export const ApplicationLayoutWithCustomHeader = () => (
|
|
80
101
|
<>
|
|
81
|
-
<DxcApplicationLayout
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
<DxcApplicationLayout
|
|
103
|
+
header={<p>Custom Header</p>}
|
|
104
|
+
sidenav={
|
|
105
|
+
<DxcApplicationLayout.SideNav
|
|
106
|
+
title={
|
|
107
|
+
<DxcApplicationLayout.SideNav.Title>
|
|
108
|
+
Application layout with push sidenav
|
|
109
|
+
</DxcApplicationLayout.SideNav.Title>
|
|
110
|
+
}
|
|
111
|
+
>
|
|
112
|
+
<DxcApplicationLayout.SideNav.Section>
|
|
113
|
+
<p>SideNav Content</p>
|
|
114
|
+
<p>SideNav Content</p>
|
|
115
|
+
<p>SideNav Content</p>
|
|
116
|
+
<p>SideNav Content</p>
|
|
117
|
+
<p>SideNav Content</p>
|
|
118
|
+
</DxcApplicationLayout.SideNav.Section>
|
|
119
|
+
</DxcApplicationLayout.SideNav>
|
|
120
|
+
}
|
|
121
|
+
>
|
|
94
122
|
<DxcApplicationLayout.Main>
|
|
95
123
|
<p>Main Content</p>
|
|
96
124
|
<p>Main Content</p>
|
|
@@ -103,24 +131,32 @@ export const ApplicationLayoutWithCustomHeader = () => (
|
|
|
103
131
|
|
|
104
132
|
export const ApplicationLayoutWithCustomFooter = () => (
|
|
105
133
|
<>
|
|
106
|
-
<DxcApplicationLayout
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
<
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
134
|
+
<DxcApplicationLayout
|
|
135
|
+
footer={<p>Custom Footer</p>}
|
|
136
|
+
sidenav={
|
|
137
|
+
<DxcApplicationLayout.SideNav
|
|
138
|
+
title={
|
|
139
|
+
<DxcApplicationLayout.SideNav.Title>
|
|
140
|
+
Application layout with push sidenav
|
|
141
|
+
</DxcApplicationLayout.SideNav.Title>
|
|
142
|
+
}
|
|
143
|
+
>
|
|
144
|
+
<DxcApplicationLayout.SideNav.Section>
|
|
145
|
+
<p>SideNav Content</p>
|
|
146
|
+
<p>SideNav Content</p>
|
|
147
|
+
<p>SideNav Content</p>
|
|
148
|
+
<p>SideNav Content</p>
|
|
149
|
+
<p>SideNav Content</p>
|
|
150
|
+
</DxcApplicationLayout.SideNav.Section>
|
|
151
|
+
</DxcApplicationLayout.SideNav>
|
|
152
|
+
}
|
|
153
|
+
>
|
|
115
154
|
<DxcApplicationLayout.Main>
|
|
116
155
|
<p>Main Content</p>
|
|
117
156
|
<p>Main Content</p>
|
|
118
157
|
<p>Main Content</p>
|
|
119
158
|
<p>Main Content</p>
|
|
120
159
|
</DxcApplicationLayout.Main>
|
|
121
|
-
<DxcApplicationLayout.Footer>
|
|
122
|
-
<p>Custom Footer</p>
|
|
123
|
-
</DxcApplicationLayout.Footer>
|
|
124
160
|
</DxcApplicationLayout>
|
|
125
161
|
</>
|
|
126
162
|
);
|
package/layout/types.d.ts
CHANGED
|
@@ -1,42 +1,20 @@
|
|
|
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 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
9
|
export declare type AppLayoutSidenavPropsType = {
|
|
31
10
|
/**
|
|
32
|
-
*
|
|
33
|
-
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
11
|
+
* The area inside the sidenav. This area can be used to render the content inside the sidenav.
|
|
34
12
|
*/
|
|
35
|
-
|
|
13
|
+
children: React.ReactNode;
|
|
36
14
|
/**
|
|
37
|
-
* The area
|
|
15
|
+
* The area assigned to render the sidenav title. It is highly recommended to use the sidenav title.
|
|
38
16
|
*/
|
|
39
|
-
|
|
17
|
+
title?: React.ReactNode;
|
|
40
18
|
};
|
|
41
19
|
declare type AppLayoutPropsType = {
|
|
42
20
|
/**
|
|
@@ -44,6 +22,18 @@ declare type AppLayoutPropsType = {
|
|
|
44
22
|
* visibility of the sidenav.
|
|
45
23
|
*/
|
|
46
24
|
visibilityToggleLabel?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Header content.
|
|
27
|
+
*/
|
|
28
|
+
header?: React.ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Sidenav content
|
|
31
|
+
*/
|
|
32
|
+
sidenav?: React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Footer content
|
|
35
|
+
*/
|
|
36
|
+
footer?: React.ReactNode;
|
|
47
37
|
/**
|
|
48
38
|
* The area inside the sidenav. This area can be used to render custom content.
|
|
49
39
|
*/
|
package/link/Link.js
CHANGED
|
@@ -68,7 +68,7 @@ var DxcLink = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
68
68
|
}, /*#__PURE__*/_react["default"].createElement(StyledLink, (0, _extends2["default"])({
|
|
69
69
|
as: href ? "a" : "button",
|
|
70
70
|
tabIndex: tabIndex,
|
|
71
|
-
onClick: !disabled
|
|
71
|
+
onClick: !disabled ? onClick : undefined,
|
|
72
72
|
href: !disabled && href ? href : undefined,
|
|
73
73
|
target: href ? newWindow ? "_blank" : "_self" : undefined,
|
|
74
74
|
disabled: disabled,
|
|
@@ -82,7 +82,7 @@ var DxcLink = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
82
82
|
})));
|
|
83
83
|
});
|
|
84
84
|
|
|
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) {
|
|
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] : "";
|
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.
|
package/main.d.ts
CHANGED
|
@@ -5,8 +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
8
|
import DxcSlider from "./slider/Slider";
|
|
11
9
|
import DxcSwitch from "./switch/Switch";
|
|
12
10
|
import DxcTabs from "./tabs/Tabs";
|
|
@@ -16,7 +14,6 @@ import DxcTable from "./table/Table";
|
|
|
16
14
|
import DxcBox from "./box/Box";
|
|
17
15
|
import DxcTag from "./tag/Tag";
|
|
18
16
|
import DxcPaginator from "./paginator/Paginator";
|
|
19
|
-
import DxcSidenav from "./sidenav/Sidenav";
|
|
20
17
|
import DxcWizard from "./wizard/Wizard";
|
|
21
18
|
import DxcLink from "./link/Link";
|
|
22
19
|
import DxcHeading from "./heading/Heading";
|
|
@@ -33,16 +30,15 @@ import DxcNumberInput from "./number-input/NumberInput";
|
|
|
33
30
|
import DxcTextarea from "./textarea/Textarea";
|
|
34
31
|
import DxcSelect from "./select/Select";
|
|
35
32
|
import DxcFileInput from "./file-input/FileInput";
|
|
36
|
-
import DxcStack from "./stack/Stack";
|
|
37
|
-
import DxcRow from "./row/Row";
|
|
38
|
-
import DxcText from "./text/Text";
|
|
39
|
-
import DxcList from "./list/List";
|
|
40
33
|
import DxcRadioGroup from "./radio-group/RadioGroup";
|
|
41
34
|
import DxcBleed from "./bleed/Bleed";
|
|
42
35
|
import DxcInset from "./inset/Inset";
|
|
43
36
|
import DxcQuickNav from "./quick-nav/QuickNav";
|
|
44
37
|
import DxcNavTabs from "./tabs-nav/NavTabs";
|
|
45
|
-
import
|
|
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";
|
|
46
42
|
import HalstackContext, { HalstackProvider, HalstackLanguageContext } from "./HalstackContext";
|
|
47
43
|
import { BackgroundColorProvider } from "./BackgroundColorContext";
|
|
48
|
-
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", {
|
|
@@ -121,12 +121,6 @@ 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
|
-
});
|
|
130
124
|
Object.defineProperty(exports, "DxcInset", {
|
|
131
125
|
enumerable: true,
|
|
132
126
|
get: function get() {
|
|
@@ -139,12 +133,6 @@ Object.defineProperty(exports, "DxcLink", {
|
|
|
139
133
|
return _Link["default"];
|
|
140
134
|
}
|
|
141
135
|
});
|
|
142
|
-
Object.defineProperty(exports, "DxcList", {
|
|
143
|
-
enumerable: true,
|
|
144
|
-
get: function get() {
|
|
145
|
-
return _List["default"];
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
136
|
Object.defineProperty(exports, "DxcNavTabs", {
|
|
149
137
|
enumerable: true,
|
|
150
138
|
get: function get() {
|
|
@@ -163,6 +151,12 @@ Object.defineProperty(exports, "DxcPaginator", {
|
|
|
163
151
|
return _Paginator["default"];
|
|
164
152
|
}
|
|
165
153
|
});
|
|
154
|
+
Object.defineProperty(exports, "DxcParagraph", {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
get: function get() {
|
|
157
|
+
return _Paragraph["default"];
|
|
158
|
+
}
|
|
159
|
+
});
|
|
166
160
|
Object.defineProperty(exports, "DxcPasswordInput", {
|
|
167
161
|
enumerable: true,
|
|
168
162
|
get: function get() {
|
|
@@ -193,24 +187,12 @@ Object.defineProperty(exports, "DxcResultsetTable", {
|
|
|
193
187
|
return _ResultsetTable["default"];
|
|
194
188
|
}
|
|
195
189
|
});
|
|
196
|
-
Object.defineProperty(exports, "DxcRow", {
|
|
197
|
-
enumerable: true,
|
|
198
|
-
get: function get() {
|
|
199
|
-
return _Row["default"];
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
190
|
Object.defineProperty(exports, "DxcSelect", {
|
|
203
191
|
enumerable: true,
|
|
204
192
|
get: function get() {
|
|
205
193
|
return _Select["default"];
|
|
206
194
|
}
|
|
207
195
|
});
|
|
208
|
-
Object.defineProperty(exports, "DxcSidenav", {
|
|
209
|
-
enumerable: true,
|
|
210
|
-
get: function get() {
|
|
211
|
-
return _Sidenav["default"];
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
196
|
Object.defineProperty(exports, "DxcSlider", {
|
|
215
197
|
enumerable: true,
|
|
216
198
|
get: function get() {
|
|
@@ -223,12 +205,6 @@ Object.defineProperty(exports, "DxcSpinner", {
|
|
|
223
205
|
return _Spinner["default"];
|
|
224
206
|
}
|
|
225
207
|
});
|
|
226
|
-
Object.defineProperty(exports, "DxcStack", {
|
|
227
|
-
enumerable: true,
|
|
228
|
-
get: function get() {
|
|
229
|
-
return _Stack["default"];
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
208
|
Object.defineProperty(exports, "DxcSwitch", {
|
|
233
209
|
enumerable: true,
|
|
234
210
|
get: function get() {
|
|
@@ -253,12 +229,6 @@ Object.defineProperty(exports, "DxcTag", {
|
|
|
253
229
|
return _Tag["default"];
|
|
254
230
|
}
|
|
255
231
|
});
|
|
256
|
-
Object.defineProperty(exports, "DxcText", {
|
|
257
|
-
enumerable: true,
|
|
258
|
-
get: function get() {
|
|
259
|
-
return _Text["default"];
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
232
|
Object.defineProperty(exports, "DxcTextInput", {
|
|
263
233
|
enumerable: true,
|
|
264
234
|
get: function get() {
|
|
@@ -277,6 +247,12 @@ Object.defineProperty(exports, "DxcToggleGroup", {
|
|
|
277
247
|
return _ToggleGroup["default"];
|
|
278
248
|
}
|
|
279
249
|
});
|
|
250
|
+
Object.defineProperty(exports, "DxcTypography", {
|
|
251
|
+
enumerable: true,
|
|
252
|
+
get: function get() {
|
|
253
|
+
return _Typography["default"];
|
|
254
|
+
}
|
|
255
|
+
});
|
|
280
256
|
Object.defineProperty(exports, "DxcWizard", {
|
|
281
257
|
enumerable: true,
|
|
282
258
|
get: function get() {
|
|
@@ -316,10 +292,6 @@ var _Dialog = _interopRequireDefault(require("./dialog/Dialog"));
|
|
|
316
292
|
|
|
317
293
|
var _Dropdown = _interopRequireDefault(require("./dropdown/Dropdown"));
|
|
318
294
|
|
|
319
|
-
var _Footer = _interopRequireDefault(require("./footer/Footer"));
|
|
320
|
-
|
|
321
|
-
var _Header = _interopRequireDefault(require("./header/Header"));
|
|
322
|
-
|
|
323
295
|
var _Slider = _interopRequireDefault(require("./slider/Slider"));
|
|
324
296
|
|
|
325
297
|
var _Switch = _interopRequireDefault(require("./switch/Switch"));
|
|
@@ -338,8 +310,6 @@ var _Tag = _interopRequireDefault(require("./tag/Tag"));
|
|
|
338
310
|
|
|
339
311
|
var _Paginator = _interopRequireDefault(require("./paginator/Paginator"));
|
|
340
312
|
|
|
341
|
-
var _Sidenav = _interopRequireDefault(require("./sidenav/Sidenav"));
|
|
342
|
-
|
|
343
313
|
var _Wizard = _interopRequireDefault(require("./wizard/Wizard"));
|
|
344
314
|
|
|
345
315
|
var _Link = _interopRequireDefault(require("./link/Link"));
|
|
@@ -372,14 +342,6 @@ var _Select = _interopRequireDefault(require("./select/Select"));
|
|
|
372
342
|
|
|
373
343
|
var _FileInput = _interopRequireDefault(require("./file-input/FileInput"));
|
|
374
344
|
|
|
375
|
-
var _Stack = _interopRequireDefault(require("./stack/Stack"));
|
|
376
|
-
|
|
377
|
-
var _Row = _interopRequireDefault(require("./row/Row"));
|
|
378
|
-
|
|
379
|
-
var _Text = _interopRequireDefault(require("./text/Text"));
|
|
380
|
-
|
|
381
|
-
var _List = _interopRequireDefault(require("./list/List"));
|
|
382
|
-
|
|
383
345
|
var _RadioGroup = _interopRequireDefault(require("./radio-group/RadioGroup"));
|
|
384
346
|
|
|
385
347
|
var _Bleed = _interopRequireDefault(require("./bleed/Bleed"));
|
|
@@ -390,7 +352,13 @@ var _QuickNav = _interopRequireDefault(require("./quick-nav/QuickNav"));
|
|
|
390
352
|
|
|
391
353
|
var _NavTabs = _interopRequireDefault(require("./tabs-nav/NavTabs"));
|
|
392
354
|
|
|
393
|
-
var
|
|
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"));
|
|
394
362
|
|
|
395
363
|
var _HalstackContext = _interopRequireWildcard(require("./HalstackContext"));
|
|
396
364
|
|
|
@@ -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
|
});
|