@dxc-technology/halstack-react 0.0.0-bfdc357 → 0.0.0-c1c5f49
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/alert/types.d.ts +1 -1
- package/button/Button.d.ts +1 -1
- package/button/Button.js +4 -2
- package/button/types.d.ts +2 -2
- package/card/Card.stories.tsx +201 -0
- package/card/ice-cream.jpg +0 -0
- package/card/types.d.ts +4 -6
- package/checkbox/types.d.ts +1 -1
- package/common/variables.js +3 -2
- package/file-input/FileInput.js +22 -22
- package/file-input/FileItem.js +5 -3
- package/header/types.d.ts +4 -2
- package/heading/Heading.stories.tsx +53 -0
- package/number-input/NumberInputContext.d.ts +4 -0
- package/number-input/NumberInputContext.js +5 -2
- package/number-input/numberInputContextTypes.d.ts +19 -0
- package/number-input/numberInputContextTypes.js +5 -0
- package/package.json +1 -1
- package/password-input/PasswordInput.js +4 -2
- package/password-input/types.d.ts +17 -10
- package/radio/types.d.ts +2 -2
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/resultsetTable/ResultsetTable.js +3 -26
- package/resultsetTable/types.d.ts +67 -0
- package/resultsetTable/types.js +5 -0
- package/select/Select.js +1 -1
- package/sidenav/Sidenav.stories.tsx +165 -0
- package/slider/Slider.js +2 -2
- package/table/Table.js +1 -1
- package/tabs/Tabs.js +3 -1
- package/tabs/Tabs.stories.tsx +121 -0
- package/tabs/types.d.ts +2 -3
- package/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +18 -57
- package/text-input/TextInput.stories.tsx +456 -0
- package/text-input/types.d.ts +159 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.js +13 -14
- package/textarea/index.d.ts +18 -8
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/toggle-group/ToggleGroup.js +5 -31
- package/toggle-group/types.d.ts +84 -0
- package/toggle-group/types.js +5 -0
- package/resultsetTable/index.d.ts +0 -19
- package/text-input/index.d.ts +0 -135
- package/toggle-group/index.d.ts +0 -21
package/alert/types.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ declare type Props = {
|
|
|
38
38
|
*/
|
|
39
39
|
margin?: Space | Margin;
|
|
40
40
|
/**
|
|
41
|
-
* Size of the component
|
|
41
|
+
* Size of the component.
|
|
42
42
|
*/
|
|
43
43
|
size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
|
|
44
44
|
/**
|
package/button/Button.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import ButtonPropsType from "./types";
|
|
3
|
-
declare const DxcButton: ({ label, mode, disabled, iconPosition, type, icon, iconSrc, onClick, margin, size, tabIndex }: ButtonPropsType) => JSX.Element;
|
|
3
|
+
declare const DxcButton: ({ label, mode, disabled, iconPosition, type, icon, iconSrc, onClick, margin, size, tabIndex, }: ButtonPropsType) => JSX.Element;
|
|
4
4
|
export default DxcButton;
|
package/button/Button.js
CHANGED
|
@@ -47,7 +47,7 @@ var DxcButton = function DxcButton(_ref) {
|
|
|
47
47
|
icon = _ref.icon,
|
|
48
48
|
_ref$iconSrc = _ref.iconSrc,
|
|
49
49
|
iconSrc = _ref$iconSrc === void 0 ? "" : _ref$iconSrc,
|
|
50
|
-
|
|
50
|
+
_onClick = _ref.onClick,
|
|
51
51
|
margin = _ref.margin,
|
|
52
52
|
_ref$size = _ref.size,
|
|
53
53
|
size = _ref$size === void 0 ? "fitContent" : _ref$size,
|
|
@@ -72,7 +72,9 @@ var DxcButton = function DxcButton(_ref) {
|
|
|
72
72
|
disableRipple: true,
|
|
73
73
|
"aria-disabled": disabled,
|
|
74
74
|
tabIndex: disabled ? -1 : tabIndex,
|
|
75
|
-
onClick: onClick
|
|
75
|
+
onClick: function onClick() {
|
|
76
|
+
_onClick();
|
|
77
|
+
}
|
|
76
78
|
}, label && /*#__PURE__*/_react["default"].createElement(LabelContainer, {
|
|
77
79
|
icon: icon,
|
|
78
80
|
iconPosition: iconPosition
|
package/button/types.d.ts
CHANGED
|
@@ -37,9 +37,9 @@ declare type Props = {
|
|
|
37
37
|
*/
|
|
38
38
|
iconSrc?: string;
|
|
39
39
|
/**
|
|
40
|
-
* This function will be called when the user clicks the button.
|
|
40
|
+
* This function will be called when the user clicks the button.
|
|
41
41
|
*/
|
|
42
|
-
onClick?: (
|
|
42
|
+
onClick?: () => void;
|
|
43
43
|
/**
|
|
44
44
|
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
45
45
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Title from "../../.storybook/components/Title";
|
|
3
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
4
|
+
import DxcCard from "./Card";
|
|
5
|
+
import imagePath from "./ice-cream.jpg";
|
|
6
|
+
import { userEvent, within } from "@storybook/testing-library";
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
title: "Card",
|
|
10
|
+
component: DxcCard,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const Card = () => (
|
|
14
|
+
<>
|
|
15
|
+
<Title title="Default" theme="light" level={4} />
|
|
16
|
+
<ExampleContainer>
|
|
17
|
+
<DxcCard>Default</DxcCard>
|
|
18
|
+
</ExampleContainer>
|
|
19
|
+
<Title title="Not outlined" theme="light" level={4} />
|
|
20
|
+
<ExampleContainer>
|
|
21
|
+
<DxcCard outlined={false}>Not outlined</DxcCard>
|
|
22
|
+
</ExampleContainer>
|
|
23
|
+
<Title title="Default with link" theme="light" level={4} />
|
|
24
|
+
<ExampleContainer>
|
|
25
|
+
<DxcCard linkHref="https://www.dxc.com">Default with link</DxcCard>
|
|
26
|
+
</ExampleContainer>
|
|
27
|
+
<Title title="Focused default with link" theme="light" level={4} />
|
|
28
|
+
<ExampleContainer>
|
|
29
|
+
<DxcCard linkHref="https://www.dxc.com">Focused default with link</DxcCard>
|
|
30
|
+
</ExampleContainer>
|
|
31
|
+
<Title title="Hovered default with link" theme="light" level={4} />
|
|
32
|
+
<ExampleContainer>
|
|
33
|
+
<DxcCard linkHref="https://www.dxc.com">Hovered default with link</DxcCard>
|
|
34
|
+
</ExampleContainer>
|
|
35
|
+
<Title title="Default with action" theme="light" level={4} />
|
|
36
|
+
<ExampleContainer>
|
|
37
|
+
<DxcCard onClick={() => {}}>Default with action</DxcCard>
|
|
38
|
+
</ExampleContainer>
|
|
39
|
+
<Title title="Default with image" theme="light" level={4} />
|
|
40
|
+
<ExampleContainer>
|
|
41
|
+
<DxcCard imageSrc={imagePath}>Default</DxcCard>
|
|
42
|
+
</ExampleContainer>
|
|
43
|
+
<Title title="Default image with background color" theme="light" level={4} />
|
|
44
|
+
<ExampleContainer>
|
|
45
|
+
<DxcCard imageSrc={imagePath} imageBgColor="yellow">
|
|
46
|
+
Background color
|
|
47
|
+
</DxcCard>
|
|
48
|
+
</ExampleContainer>
|
|
49
|
+
<Title title="Default image with position after" theme="light" level={4} />
|
|
50
|
+
<ExampleContainer>
|
|
51
|
+
<DxcCard imageSrc={imagePath} imagePosition="after">
|
|
52
|
+
Position after
|
|
53
|
+
</DxcCard>
|
|
54
|
+
</ExampleContainer>
|
|
55
|
+
<Title title="Image cover" theme="light" level={4} />
|
|
56
|
+
<ExampleContainer>
|
|
57
|
+
<DxcCard imageSrc={imagePath} imageCover>
|
|
58
|
+
Image cover
|
|
59
|
+
</DxcCard>
|
|
60
|
+
</ExampleContainer>
|
|
61
|
+
<Title title="Image cover with position after" theme="light" level={4} />
|
|
62
|
+
<ExampleContainer>
|
|
63
|
+
<DxcCard imageSrc={imagePath} imageCover imagePosition="after">
|
|
64
|
+
Image cover with position after
|
|
65
|
+
</DxcCard>
|
|
66
|
+
</ExampleContainer>
|
|
67
|
+
<Title title="Image padding" theme="light" level={2} />
|
|
68
|
+
<ExampleContainer>
|
|
69
|
+
<Title title="Xxsmall" theme="light" level={4} />
|
|
70
|
+
<DxcCard imageSrc={imagePath} imagePadding="xxsmall" imageCover>
|
|
71
|
+
Xxsmall
|
|
72
|
+
</DxcCard>
|
|
73
|
+
</ExampleContainer>
|
|
74
|
+
<ExampleContainer>
|
|
75
|
+
<Title title="Xsmall" theme="light" level={4} />
|
|
76
|
+
<DxcCard imageSrc={imagePath} imagePadding="xsmall" imageCover>
|
|
77
|
+
Xsmall
|
|
78
|
+
</DxcCard>
|
|
79
|
+
</ExampleContainer>
|
|
80
|
+
<ExampleContainer>
|
|
81
|
+
<Title title="Small" theme="light" level={4} />
|
|
82
|
+
<DxcCard imageSrc={imagePath} imagePadding="small" imageCover>
|
|
83
|
+
Small
|
|
84
|
+
</DxcCard>
|
|
85
|
+
</ExampleContainer>
|
|
86
|
+
<ExampleContainer>
|
|
87
|
+
<Title title="Medium" theme="light" level={4} />
|
|
88
|
+
<DxcCard imageSrc={imagePath} imagePadding="medium" imageCover>
|
|
89
|
+
Medium
|
|
90
|
+
</DxcCard>
|
|
91
|
+
</ExampleContainer>
|
|
92
|
+
<ExampleContainer>
|
|
93
|
+
<Title title="Large" theme="light" level={4} />
|
|
94
|
+
<DxcCard imageSrc={imagePath} imagePadding="large" imageCover>
|
|
95
|
+
Large
|
|
96
|
+
</DxcCard>
|
|
97
|
+
</ExampleContainer>
|
|
98
|
+
<ExampleContainer>
|
|
99
|
+
<Title title="Xlarge" theme="light" level={4} />
|
|
100
|
+
<DxcCard imageSrc={imagePath} imagePadding="xlarge" imageCover>
|
|
101
|
+
Xlarge
|
|
102
|
+
</DxcCard>
|
|
103
|
+
</ExampleContainer>
|
|
104
|
+
<ExampleContainer>
|
|
105
|
+
<Title title="Xxlarge" theme="light" level={4} />
|
|
106
|
+
<DxcCard imageSrc={imagePath} imagePadding="xxlarge" imageCover>
|
|
107
|
+
Xxlarge
|
|
108
|
+
</DxcCard>
|
|
109
|
+
</ExampleContainer>
|
|
110
|
+
<Title title="Content padding" theme="light" level={2} />
|
|
111
|
+
<ExampleContainer>
|
|
112
|
+
<Title title="Xxsmall" theme="light" level={4} />
|
|
113
|
+
<DxcCard contentPadding="xxsmall">Xxsmall</DxcCard>
|
|
114
|
+
</ExampleContainer>
|
|
115
|
+
<ExampleContainer>
|
|
116
|
+
<Title title="Xsmall" theme="light" level={4} />
|
|
117
|
+
<DxcCard contentPadding="xsmall">Xsmall</DxcCard>
|
|
118
|
+
</ExampleContainer>
|
|
119
|
+
<ExampleContainer>
|
|
120
|
+
<Title title="Small" theme="light" level={4} />
|
|
121
|
+
<DxcCard contentPadding="small">Small</DxcCard>
|
|
122
|
+
</ExampleContainer>
|
|
123
|
+
<ExampleContainer>
|
|
124
|
+
<Title title="Medium" theme="light" level={4} />
|
|
125
|
+
<DxcCard contentPadding="medium">Medium</DxcCard>
|
|
126
|
+
</ExampleContainer>
|
|
127
|
+
<ExampleContainer>
|
|
128
|
+
<Title title="Large" theme="light" level={4} />
|
|
129
|
+
<DxcCard contentPadding="large">Large</DxcCard>
|
|
130
|
+
</ExampleContainer>
|
|
131
|
+
<ExampleContainer>
|
|
132
|
+
<Title title="Xlarge" theme="light" level={4} />
|
|
133
|
+
<DxcCard contentPadding="xlarge">Xlarge</DxcCard>
|
|
134
|
+
</ExampleContainer>
|
|
135
|
+
<ExampleContainer>
|
|
136
|
+
<Title title="Xxlarge" theme="light" level={4} />
|
|
137
|
+
<DxcCard contentPadding="xxlarge">Xxlarge</DxcCard>
|
|
138
|
+
</ExampleContainer>
|
|
139
|
+
<Title title="Margin" theme="light" level={2} />
|
|
140
|
+
<ExampleContainer>
|
|
141
|
+
<Title title="Xxsmall" theme="light" level={4} />
|
|
142
|
+
<DxcCard margin="xxsmall">Xxsmall</DxcCard>
|
|
143
|
+
</ExampleContainer>
|
|
144
|
+
<ExampleContainer>
|
|
145
|
+
<Title title="Xsmall" theme="light" level={4} />
|
|
146
|
+
<DxcCard margin="xsmall">Xsmall</DxcCard>
|
|
147
|
+
</ExampleContainer>
|
|
148
|
+
<ExampleContainer>
|
|
149
|
+
<Title title="Small" theme="light" level={4} />
|
|
150
|
+
<DxcCard margin="small">Small</DxcCard>
|
|
151
|
+
</ExampleContainer>
|
|
152
|
+
<ExampleContainer>
|
|
153
|
+
<Title title="Medium" theme="light" level={4} />
|
|
154
|
+
<DxcCard margin="medium">Medium</DxcCard>
|
|
155
|
+
</ExampleContainer>
|
|
156
|
+
<ExampleContainer>
|
|
157
|
+
<Title title="Large" theme="light" level={4} />
|
|
158
|
+
<DxcCard margin="large">Large</DxcCard>
|
|
159
|
+
</ExampleContainer>
|
|
160
|
+
<ExampleContainer>
|
|
161
|
+
<Title title="Xlarge" theme="light" level={4} />
|
|
162
|
+
<DxcCard margin="xlarge">Xlarge</DxcCard>
|
|
163
|
+
</ExampleContainer>
|
|
164
|
+
<ExampleContainer>
|
|
165
|
+
<Title title="Xxlarge" theme="light" level={4} />
|
|
166
|
+
<DxcCard margin="xxlarge">Xxlarge</DxcCard>
|
|
167
|
+
</ExampleContainer>
|
|
168
|
+
</>
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
const actionCard = () => (
|
|
172
|
+
<>
|
|
173
|
+
<ExampleContainer>
|
|
174
|
+
<Title title="Focused default with action" theme="light" level={4} />
|
|
175
|
+
<DxcCard onClick={() => {}}>Focused default with action</DxcCard>
|
|
176
|
+
</ExampleContainer>
|
|
177
|
+
<ExampleContainer>
|
|
178
|
+
<Title title="Hovered default with action" theme="light" level={4} />
|
|
179
|
+
<DxcCard onClick={() => {}}>Hovered default with action</DxcCard>
|
|
180
|
+
</ExampleContainer>
|
|
181
|
+
</>
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
const linkStates = async (focusCard, hoverCard) => {
|
|
185
|
+
await focusCard.focus();
|
|
186
|
+
await userEvent.hover(hoverCard);
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export const ActionCardStates = actionCard.bind({});
|
|
190
|
+
ActionCardStates.play = async ({ canvasElement }) => {
|
|
191
|
+
const canvas = within(canvasElement);
|
|
192
|
+
await userEvent.tab();
|
|
193
|
+
await userEvent.hover(canvas.getAllByText("Hovered default with action")[1]);
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
export const Chromatic = Card.bind({});
|
|
197
|
+
Chromatic.play = async ({ canvasElement }) => {
|
|
198
|
+
const canvas = within(canvasElement);
|
|
199
|
+
const linkCards = canvas.getAllByRole("link");
|
|
200
|
+
await linkStates(linkCards[1], linkCards[2]);
|
|
201
|
+
};
|
|
Binary file
|
package/card/types.d.ts
CHANGED
|
@@ -42,15 +42,13 @@ declare type Props = {
|
|
|
42
42
|
*/
|
|
43
43
|
imageCover?: boolean;
|
|
44
44
|
/**
|
|
45
|
-
* Size of the margin to be applied to the component
|
|
46
|
-
* an object with 'top', 'bottom', 'left' and 'right' properties
|
|
47
|
-
* in order to specify different margin sizes.
|
|
45
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
46
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
48
47
|
*/
|
|
49
48
|
margin?: Space | Size;
|
|
50
49
|
/**
|
|
51
|
-
* Size of the padding to be applied to the content area
|
|
52
|
-
* an object with 'top', 'bottom', 'left' and 'right' properties in
|
|
53
|
-
* order to specify different padding sizes.
|
|
50
|
+
* Size of the padding to be applied to the content area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
51
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
54
52
|
*/
|
|
55
53
|
contentPadding?: Space | Size;
|
|
56
54
|
/**
|
package/checkbox/types.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ declare type Props = {
|
|
|
49
49
|
*/
|
|
50
50
|
margin?: Space | Margin;
|
|
51
51
|
/**
|
|
52
|
-
* Size of the component
|
|
52
|
+
* Size of the component.
|
|
53
53
|
*/
|
|
54
54
|
size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
|
|
55
55
|
/**
|
package/common/variables.js
CHANGED
|
@@ -535,7 +535,7 @@ var componentTokens = {
|
|
|
535
535
|
errorMessageFontFamily: globalTokens.type_sans,
|
|
536
536
|
errorMessageFontSize: globalTokens.type_scale_01,
|
|
537
537
|
errorMessageFontWeight: globalTokens.type_regular,
|
|
538
|
-
errorMessageLineHeight: globalTokens.
|
|
538
|
+
errorMessageLineHeight: globalTokens.type_leading_normal,
|
|
539
539
|
dropBorderThickness: globalTokens.border_width_1,
|
|
540
540
|
dropBorderStyle: globalTokens.border_dashed,
|
|
541
541
|
dropBorderRadius: globalTokens.border_radius_large,
|
|
@@ -545,7 +545,8 @@ var componentTokens = {
|
|
|
545
545
|
hoverDeleteFileItemBackgroundColor: globalTokens.hal_grey_l_95,
|
|
546
546
|
activeDeleteFileItemBackgroundColor: globalTokens.hal_grey_l_80,
|
|
547
547
|
errorHoverDeleteFileItemBackgroundColor: globalTokens.hal_red_l_95,
|
|
548
|
-
errorActiveDeleteFileItemBackgroundColor: globalTokens.hal_red_s_41
|
|
548
|
+
errorActiveDeleteFileItemBackgroundColor: globalTokens.hal_red_s_41,
|
|
549
|
+
focusActionBorderColor: globalTokens.hal_blue_l_50
|
|
549
550
|
},
|
|
550
551
|
footer: {
|
|
551
552
|
height: "124px",
|
package/file-input/FileInput.js
CHANGED
|
@@ -337,22 +337,20 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
337
337
|
}, helperText), mode === "file" ? /*#__PURE__*/_react["default"].createElement(FileContainer, {
|
|
338
338
|
multiple: multiple,
|
|
339
339
|
files: files
|
|
340
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
340
|
+
}, /*#__PURE__*/_react["default"].createElement(HiddenInputFile, {
|
|
341
|
+
id: fileInputId,
|
|
342
|
+
type: "file",
|
|
343
|
+
accept: accept,
|
|
344
|
+
multiple: multiple,
|
|
345
|
+
onChange: selectFiles
|
|
346
|
+
}), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
341
347
|
mode: "secondary",
|
|
342
348
|
label: "Select files",
|
|
343
349
|
onClick: handleClick,
|
|
344
350
|
disabled: disabled,
|
|
345
351
|
size: "medium",
|
|
346
352
|
tabIndex: tabIndex
|
|
347
|
-
}),
|
|
348
|
-
id: fileInputId,
|
|
349
|
-
type: "file",
|
|
350
|
-
accept: accept,
|
|
351
|
-
multiple: multiple,
|
|
352
|
-
onChange: selectFiles
|
|
353
|
-
}), files.length === 1 && files.map(function (file) {
|
|
354
|
-
return file.error && mode === "file" && !multiple && /*#__PURE__*/_react["default"].createElement(ErrorMessage, null, file.error);
|
|
355
|
-
})), files.map(function (file) {
|
|
353
|
+
}), files.map(function (file) {
|
|
356
354
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(FileItemContainer, {
|
|
357
355
|
mode: mode,
|
|
358
356
|
multiple: multiple,
|
|
@@ -377,7 +375,13 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
377
375
|
onDragEnter: handleDragIn,
|
|
378
376
|
onDragOver: handleDrag,
|
|
379
377
|
onDragLeave: handleDragOut
|
|
380
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
|
378
|
+
}, /*#__PURE__*/_react["default"].createElement(HiddenInputFile, {
|
|
379
|
+
id: fileInputId,
|
|
380
|
+
type: "file",
|
|
381
|
+
accept: accept,
|
|
382
|
+
multiple: multiple,
|
|
383
|
+
onChange: selectFiles
|
|
384
|
+
}), /*#__PURE__*/_react["default"].createElement(ButtonContainer, {
|
|
381
385
|
mode: mode
|
|
382
386
|
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
383
387
|
mode: "secondary",
|
|
@@ -385,12 +389,6 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
385
389
|
onClick: handleClick,
|
|
386
390
|
disabled: disabled,
|
|
387
391
|
size: "fitContent"
|
|
388
|
-
}), /*#__PURE__*/_react["default"].createElement("input", {
|
|
389
|
-
id: fileInputId,
|
|
390
|
-
type: "file",
|
|
391
|
-
accept: accept,
|
|
392
|
-
multiple: multiple,
|
|
393
|
-
onChange: selectFiles
|
|
394
392
|
})), /*#__PURE__*/_react["default"].createElement(DropLabel, {
|
|
395
393
|
disabled: disabled
|
|
396
394
|
}, "or drop files")), files.map(function (file) {
|
|
@@ -410,7 +408,9 @@ var DxcFileInput = function DxcFileInput(_ref) {
|
|
|
410
408
|
onDelete: onDelete,
|
|
411
409
|
tabIndex: tabIndex
|
|
412
410
|
}));
|
|
413
|
-
})))
|
|
411
|
+
})), files.length === 1 && files.map(function (file) {
|
|
412
|
+
return file.error && mode === "file" && !multiple && /*#__PURE__*/_react["default"].createElement(ErrorMessage, null, file.error);
|
|
413
|
+
})));
|
|
414
414
|
};
|
|
415
415
|
|
|
416
416
|
var FileInputContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n width: fit-content;\n"])), function (props) {
|
|
@@ -467,13 +467,13 @@ var DragDropArea = _styledComponents["default"].div(_templateObject4 || (_templa
|
|
|
467
467
|
return props.disabled && "not-allowed";
|
|
468
468
|
});
|
|
469
469
|
|
|
470
|
-
var FileContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n"])), function (props) {
|
|
470
|
+
var FileContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n margin-top: 0.25rem;\n"])), function (props) {
|
|
471
471
|
return props.multiple || props.files.length > 1 ? "column" : "row";
|
|
472
472
|
});
|
|
473
473
|
|
|
474
|
-
var
|
|
474
|
+
var HiddenInputFile = _styledComponents["default"].input(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n visibility: hidden;\n position: absolute;\n width: 0px;\n height: 0px;\n"])));
|
|
475
475
|
|
|
476
|
-
var ButtonContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n padding: ", ";\n
|
|
476
|
+
var ButtonContainer = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n padding: ", ";\n"])), function (props) {
|
|
477
477
|
return props.mode === "filedrop" ? "2px 12px 2px 2px" : "47px 122px 8px 122px";
|
|
478
478
|
});
|
|
479
479
|
|
|
@@ -495,7 +495,7 @@ var FileItemContainer = _styledComponents["default"].div(_templateObject10 || (_
|
|
|
495
495
|
return props.mode === "file" && props.files.length === 1 && !props.multiple && "4px";
|
|
496
496
|
});
|
|
497
497
|
|
|
498
|
-
var ErrorMessage = _styledComponents["default"].div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
498
|
+
var ErrorMessage = _styledComponents["default"].div(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: 0.25rem;\n"])), function (props) {
|
|
499
499
|
return props.theme.errorMessageFontColor;
|
|
500
500
|
}, function (props) {
|
|
501
501
|
return props.theme.errorMessageFontFamily;
|
package/file-input/FileItem.js
CHANGED
|
@@ -109,7 +109,7 @@ var FileItem = function FileItem(_ref) {
|
|
|
109
109
|
};
|
|
110
110
|
|
|
111
111
|
var Container = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n padding: ", ";\n background-color: ", ";\n border-radius: ", ";\n width: ", ";\n min-height: ", ";\n border-color: ", ";\n border-width: ", ";\n border-style: ", ";\n display: flex;\n justify-content: center;\n"])), function (props) {
|
|
112
|
-
return props.showPreview ? "8px" : "8px 8px 8px 16px";
|
|
112
|
+
return props.showPreview ? "calc(8px - ".concat(props.theme.fileItemBorderThickness, ") 8px") : "calc(8px - ".concat(props.theme.fileItemBorderThickness, ") 8px calc(8px - ").concat(props.theme.fileItemBorderThickness, ") 16px");
|
|
113
113
|
}, function (props) {
|
|
114
114
|
return props.error && props.theme.errorFileItemBackgroundColor;
|
|
115
115
|
}, function (props) {
|
|
@@ -156,12 +156,14 @@ var FileName = _styledComponents["default"].span(_templateObject7 || (_templateO
|
|
|
156
156
|
|
|
157
157
|
var ErrorIcon = _styledComponents["default"].span(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n padding: 3px;\n height: 18px;\n width: 18px;\n color: #d0011b;\n"])));
|
|
158
158
|
|
|
159
|
-
var DeleteIcon = _styledComponents["default"].button(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n font-size: 1rem;\n font-family: ", ";\n border: 1px solid transparent;\n border-radius:
|
|
159
|
+
var DeleteIcon = _styledComponents["default"].button(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n font-size: 1rem;\n font-family: ", ";\n border: 1px solid transparent;\n border-radius: 2px;\n margin-left: 4px;\n background-color: transparent;\n box-shadow: 0 0 0 2px transparent;\n padding: 3px;\n cursor: pointer;\n svg {\n line-height: 18px;\n }\n &:hover {\n background-color: ", ";\n }\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ", ";\n }\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px ", ";\n }\n &:active {\n background-color: ", ";\n }\n"])), function (props) {
|
|
160
160
|
return props.theme.fontFamily;
|
|
161
161
|
}, function (props) {
|
|
162
162
|
return props.error ? props.theme.errorHoverDeleteFileItemBackgroundColor : props.theme.hoverDeleteFileItemBackgroundColor;
|
|
163
163
|
}, function (props) {
|
|
164
|
-
return props.
|
|
164
|
+
return props.theme.focusActionBorderColor;
|
|
165
|
+
}, function (props) {
|
|
166
|
+
return props.theme.focusActionBorderColor;
|
|
165
167
|
}, function (props) {
|
|
166
168
|
return props.error ? props.theme.errorActiveDeleteFileItemBackgroundColor : props.theme.activeDeleteFileItemBackgroundColor;
|
|
167
169
|
});
|
package/header/types.d.ts
CHANGED
|
@@ -27,11 +27,13 @@ declare type Props = {
|
|
|
27
27
|
*/
|
|
28
28
|
onClick?: () => void;
|
|
29
29
|
/**
|
|
30
|
-
* Size of the bottom margin to be applied to the header
|
|
30
|
+
* Size of the bottom margin to be applied to the header
|
|
31
|
+
* ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
31
32
|
*/
|
|
32
33
|
margin?: Space;
|
|
33
34
|
/**
|
|
34
|
-
* Size of the padding to be applied to the custom area of the component
|
|
35
|
+
* Size of the padding to be applied to the custom area of the component
|
|
36
|
+
* ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
35
37
|
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in
|
|
36
38
|
* order to specify different padding sizes.
|
|
37
39
|
*/
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import DxcHeading from "./Heading";
|
|
3
|
+
import Title from "../../.storybook/components/Title";
|
|
4
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Heading",
|
|
8
|
+
component: DxcHeading,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Chromatic = () => (
|
|
12
|
+
<>
|
|
13
|
+
<Title title="Levels" theme="light" level={2} />
|
|
14
|
+
<ExampleContainer>
|
|
15
|
+
<Title title="Level 1" theme="light" level={4} />
|
|
16
|
+
<DxcHeading text="Heading for sections within the page" />
|
|
17
|
+
<Title title="Level 2" theme="light" level={4} />
|
|
18
|
+
<DxcHeading text="Heading for sections within the page" level={2} />
|
|
19
|
+
<Title title="Level 3" theme="light" level={4} />
|
|
20
|
+
<DxcHeading text="Heading for sections within the page" level={3} />
|
|
21
|
+
<Title title="Level 4" theme="light" level={4} />
|
|
22
|
+
<DxcHeading text="Heading for sections within the page" level={4} />
|
|
23
|
+
<Title title="Level 5" theme="light" level={4} />
|
|
24
|
+
<DxcHeading text="Heading for sections within the page" level={5} />
|
|
25
|
+
</ExampleContainer>
|
|
26
|
+
<Title title="Weights" theme="light" level={2} />
|
|
27
|
+
<ExampleContainer>
|
|
28
|
+
<Title title="'light' Weight" theme="light" level={4} />
|
|
29
|
+
<DxcHeading text="Heading for sections within the page" level={2} weight="light" />
|
|
30
|
+
<Title title="'normal' Weight" theme="light" level={4} />
|
|
31
|
+
<DxcHeading text="Heading for sections within the page" level={4} weight="normal" />
|
|
32
|
+
<Title title="'bold' Weight" theme="light" level={4} />
|
|
33
|
+
<DxcHeading text="Heading for sections within the page" weight="bold" />
|
|
34
|
+
</ExampleContainer>
|
|
35
|
+
<Title title="Margins" theme="light" level={2} />
|
|
36
|
+
<ExampleContainer>
|
|
37
|
+
<Title title="Xxsmall" theme="light" level={4} />
|
|
38
|
+
<DxcHeading text="Xxsmall" margin="xxsmall" />
|
|
39
|
+
<Title title="Xsmall" theme="light" level={4} />
|
|
40
|
+
<DxcHeading text="Xsmall" margin="xsmall" />
|
|
41
|
+
<Title title="Small" theme="light" level={4} />
|
|
42
|
+
<DxcHeading text="Small" margin="small" />
|
|
43
|
+
<Title title="Medium" theme="light" level={4} />
|
|
44
|
+
<DxcHeading text="Medium" margin="medium" />
|
|
45
|
+
<Title title="Large" theme="light" level={4} />
|
|
46
|
+
<DxcHeading text="Large" margin="large" />
|
|
47
|
+
<Title title="Xlarge" theme="light" level={4} />
|
|
48
|
+
<DxcHeading text="Xlarge" margin="xlarge" />
|
|
49
|
+
<Title title="Xxlarge" theme="light" level={4} />
|
|
50
|
+
<DxcHeading text="Xxlarge" margin="xxlarge" />
|
|
51
|
+
</ExampleContainer>
|
|
52
|
+
</>
|
|
53
|
+
);
|
|
@@ -9,8 +9,11 @@ exports["default"] = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
var defaultState = {
|
|
13
|
+
stepNumber: 1
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var NumberInputContext = /*#__PURE__*/_react["default"].createContext(defaultState);
|
|
14
17
|
|
|
15
18
|
var _default = NumberInputContext;
|
|
16
19
|
exports["default"] = _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare type Props = {
|
|
2
|
+
/**
|
|
3
|
+
* Type of the input.
|
|
4
|
+
*/
|
|
5
|
+
typeNumber?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Minimum value allowed by the number input.
|
|
8
|
+
*/
|
|
9
|
+
minNumber?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Maximum value allowed by the number input.
|
|
12
|
+
*/
|
|
13
|
+
maxNumber?: number;
|
|
14
|
+
/**
|
|
15
|
+
* The step interval to use when using the up and down arrows to adjust the value.
|
|
16
|
+
*/
|
|
17
|
+
stepNumber?: number;
|
|
18
|
+
};
|
|
19
|
+
export default Props;
|
package/package.json
CHANGED
|
@@ -40,7 +40,8 @@ var DxcPasswordInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref,
|
|
|
40
40
|
_ref$error = _ref.error,
|
|
41
41
|
error = _ref$error === void 0 ? "" : _ref$error,
|
|
42
42
|
pattern = _ref.pattern,
|
|
43
|
-
|
|
43
|
+
minLength = _ref.minLength,
|
|
44
|
+
maxLength = _ref.maxLength,
|
|
44
45
|
_ref$autocomplete = _ref.autocomplete,
|
|
45
46
|
autocomplete = _ref$autocomplete === void 0 ? "off" : _ref$autocomplete,
|
|
46
47
|
margin = _ref.margin,
|
|
@@ -150,7 +151,8 @@ var DxcPasswordInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref,
|
|
|
150
151
|
margin: margin,
|
|
151
152
|
size: size,
|
|
152
153
|
pattern: pattern,
|
|
153
|
-
|
|
154
|
+
minLength: minLength,
|
|
155
|
+
maxLength: maxLength,
|
|
154
156
|
autocomplete: autocomplete,
|
|
155
157
|
tabIndex: tabIndex
|
|
156
158
|
}));
|
|
@@ -37,10 +37,10 @@ declare type Props = {
|
|
|
37
37
|
error: string | null;
|
|
38
38
|
}) => void;
|
|
39
39
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
* This function will be called when the input element loses the focus.
|
|
41
|
+
* An object including the input value and the error (if the value entered is
|
|
42
|
+
* not valid) will be passed to this function. If there is no error, error will be null.
|
|
43
|
+
*/
|
|
44
44
|
onBlur?: (val: {
|
|
45
45
|
value: string;
|
|
46
46
|
error: string | null;
|
|
@@ -62,18 +62,25 @@ declare type Props = {
|
|
|
62
62
|
*/
|
|
63
63
|
pattern?: string;
|
|
64
64
|
/**
|
|
65
|
-
* Specifies the minimun
|
|
65
|
+
* Specifies the minimun length allowed by the password input.
|
|
66
|
+
* This will be checked both when the input element loses the
|
|
67
|
+
* focus and while typing within it. If the string entered does not
|
|
68
|
+
* comply the minimum length, the onBlur and onChange functions will be called
|
|
69
|
+
* with the current value and an internal error informing that the value
|
|
70
|
+
* length does not comply the specified range. If a valid length is
|
|
71
|
+
* reached, the error parameter of both events will be null.
|
|
72
|
+
*/
|
|
73
|
+
minLength?: number;
|
|
74
|
+
/**
|
|
75
|
+
* Specifies the maximum length allowed by the password input.
|
|
66
76
|
* This will be checked both when the input element loses the
|
|
67
77
|
* focus and while typing within it. If the string entered does not
|
|
68
|
-
* comply the length, the onBlur and onChange functions will be called
|
|
78
|
+
* comply the maximum length, the onBlur and onChange functions will be called
|
|
69
79
|
* with the current value and an internal error informing that the value
|
|
70
80
|
* length does not comply the specified range. If a valid length is
|
|
71
81
|
* reached, the error parameter of both events will be null.
|
|
72
82
|
*/
|
|
73
|
-
|
|
74
|
-
min?: number;
|
|
75
|
-
max?: number;
|
|
76
|
-
};
|
|
83
|
+
maxLength?: number;
|
|
77
84
|
/**
|
|
78
85
|
* HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the input value.
|
|
79
86
|
* Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
|
package/radio/types.d.ts
CHANGED
|
@@ -42,8 +42,8 @@ declare type Props = {
|
|
|
42
42
|
*/
|
|
43
43
|
onClick?: (val: boolean) => void;
|
|
44
44
|
/**
|
|
45
|
-
* Size of the margin to be applied to the component
|
|
46
|
-
* 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
45
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
46
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
47
47
|
*/
|
|
48
48
|
margin?: Space | Margin;
|
|
49
49
|
/**
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import ResultsetTablePropsType from "./types";
|
|
3
|
+
declare const DxcResultsetTable: ({ columns, rows, showGoToPage, itemsPerPage, itemsPerPageOptions, itemsPerPageFunction, margin, tabIndex, }: ResultsetTablePropsType) => JSX.Element;
|
|
4
|
+
export default DxcResultsetTable;
|