@dxc-technology/halstack-react 0.0.0-8f8dc10 → 0.0.0-9005464
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/Alert.stories.tsx +170 -0
- package/box/Box.d.ts +4 -0
- package/box/Box.js +9 -32
- package/box/{Box.stories.jsx → Box.stories.tsx} +0 -0
- package/box/types.d.ts +47 -0
- package/box/types.js +5 -0
- package/button/Button.d.ts +1 -1
- package/button/Button.js +7 -12
- package/button/Button.stories.tsx +217 -234
- package/button/types.d.ts +10 -10
- package/checkbox/Checkbox.stories.tsx +192 -0
- package/common/variables.js +29 -21
- package/date-input/DateInput.stories.tsx +138 -0
- package/header/Header.d.ts +7 -0
- package/header/Header.js +26 -28
- package/header/Icons.js +2 -27
- package/header/types.d.ts +45 -0
- package/header/types.js +5 -0
- package/link/Link.d.ts +3 -0
- package/link/Link.js +1 -23
- package/link/Link.stories.tsx +70 -0
- package/link/types.d.ts +74 -0
- package/link/types.js +5 -0
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +2 -44
- package/number-input/{NumberInput.stories.jsx → NumberInput.stories.tsx} +0 -0
- package/number-input/types.d.ts +117 -0
- package/number-input/types.js +5 -0
- package/package.json +1 -1
- package/password-input/PasswordInput.d.ts +4 -0
- package/password-input/PasswordInput.js +0 -37
- package/password-input/{PasswordInput.stories.jsx → PasswordInput.stories.tsx} +1 -1
- package/password-input/types.d.ts +100 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.stories.jsx +58 -0
- package/radio/Radio.stories.tsx +192 -0
- package/select/Select.stories.tsx +572 -0
- package/sidenav/Sidenav.d.ts +9 -0
- package/sidenav/Sidenav.js +4 -13
- package/sidenav/types.d.ts +50 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +1 -1
- package/slider/Slider.js +39 -28
- package/slider/Slider.stories.tsx +172 -0
- package/slider/types.d.ts +2 -7
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +0 -17
- package/spinner/Spinner.stories.jsx +102 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/switch/Switch.js +2 -2
- package/switch/Switch.stories.tsx +160 -0
- package/table/Table.d.ts +4 -0
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +20 -35
- package/tag/Tag.stories.tsx +145 -0
- package/tag/types.d.ts +60 -0
- package/tag/types.js +5 -0
- package/toggle-group/ToggleGroup.stories.tsx +178 -0
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +11 -51
- package/wizard/types.d.ts +64 -0
- package/wizard/types.js +5 -0
- package/box/index.d.ts +0 -25
- package/header/index.d.ts +0 -25
- package/link/index.d.ts +0 -23
- package/number-input/index.d.ts +0 -113
- package/password-input/index.d.ts +0 -94
- package/sidenav/index.d.ts +0 -13
- package/spinner/index.d.ts +0 -17
- package/table/index.d.ts +0 -13
- package/tag/index.d.ts +0 -24
- package/wizard/index.d.ts +0 -18
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { userEvent, within } from "@storybook/testing-library";
|
|
3
|
+
import DxcToggleGroup from "./ToggleGroup";
|
|
4
|
+
import Title from "../../.storybook/components/Title";
|
|
5
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: "ToggleGroup",
|
|
9
|
+
component: DxcToggleGroup,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const ethernetSVG = () => {
|
|
13
|
+
return (
|
|
14
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
|
|
15
|
+
<path d="M0 0h24v24H0V0z" fill="none" />
|
|
16
|
+
<path d="M7.77 6.76L6.23 5.48.82 12l5.41 6.52 1.54-1.28L3.42 12l4.35-5.24zM7 13h2v-2H7v2zm10-2h-2v2h2v-2zm-6 2h2v-2h-2v2zm6.77-7.52l-1.54 1.28L20.58 12l-4.35 5.24 1.54 1.28L23.18 12l-5.41-6.52z" />
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
const gMobileSVG = () => {
|
|
21
|
+
return (
|
|
22
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
|
|
23
|
+
<g>
|
|
24
|
+
<path d="M0,0h24v24H0V0z" fill="none" />
|
|
25
|
+
</g>
|
|
26
|
+
<g>
|
|
27
|
+
<g>
|
|
28
|
+
<path d="M3,7v2h5v2H4v2h4v2H3v2h5c1.1,0,2-0.9,2-2v-1.5c0-0.83-0.67-1.5-1.5-1.5c0.83,0,1.5-0.67,1.5-1.5V9c0-1.1-0.9-2-2-2H3z M21,11v4c0,1.1-0.9,2-2,2h-5c-1.1,0-2-0.9-2-2V9c0-1.1,0.9-2,2-2h5c1.1,0,2,0.9,2,2h-7v6h5v-2h-2.5v-2H21z" />
|
|
29
|
+
</g>
|
|
30
|
+
</g>
|
|
31
|
+
</svg>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
const wifiSVG = () => {
|
|
35
|
+
return (
|
|
36
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
|
|
37
|
+
<path d="M0 0h24v24H0V0zm0 0h24v24H0V0z" fill="none" />
|
|
38
|
+
<path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3c-1.65-1.66-4.34-1.66-6 0zm-4-4l2 2c2.76-2.76 7.24-2.76 10 0l2-2C15.14 9.14 8.87 9.14 5 13z" />
|
|
39
|
+
</svg>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
const options = [
|
|
43
|
+
{
|
|
44
|
+
value: 1,
|
|
45
|
+
label: "Facebook",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
value: 2,
|
|
49
|
+
label: "Twitter",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
value: 3,
|
|
53
|
+
label: "Linkedin",
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
const optionsWithIcon = [
|
|
57
|
+
{
|
|
58
|
+
value: 1,
|
|
59
|
+
icon: wifiSVG,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: 2,
|
|
63
|
+
icon: ethernetSVG,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
value: 3,
|
|
67
|
+
icon: gMobileSVG,
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
const optionsWithIconAndLabel = [
|
|
71
|
+
{
|
|
72
|
+
value: 1,
|
|
73
|
+
label: "Wi-fi",
|
|
74
|
+
icon: wifiSVG,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
value: 2,
|
|
78
|
+
label: "Ethernet",
|
|
79
|
+
icon: ethernetSVG,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
value: 3,
|
|
83
|
+
label: "3G Mobile",
|
|
84
|
+
icon: gMobileSVG,
|
|
85
|
+
},
|
|
86
|
+
];
|
|
87
|
+
const twoOptions = [
|
|
88
|
+
{
|
|
89
|
+
value: 1,
|
|
90
|
+
label: "Facebook",
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
value: 2,
|
|
94
|
+
label: "Twitter",
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
export const Chromatic = () => (
|
|
98
|
+
<>
|
|
99
|
+
<ExampleContainer>
|
|
100
|
+
<Title title="Basic toggle group" theme="light" level={4} />
|
|
101
|
+
<DxcToggleGroup label="Toggle group" helperText="HelperText" options={options} />
|
|
102
|
+
</ExampleContainer>
|
|
103
|
+
<ExampleContainer>
|
|
104
|
+
<Title title="Selected" theme="light" level={4} />
|
|
105
|
+
<DxcToggleGroup label="Selected" helperText="HelperText" value={2} options={options} />
|
|
106
|
+
</ExampleContainer>
|
|
107
|
+
<ExampleContainer>
|
|
108
|
+
<Title title="Icons toggle group" theme="light" level={4} />
|
|
109
|
+
<DxcToggleGroup label="Icons group" options={optionsWithIcon} />
|
|
110
|
+
</ExampleContainer>
|
|
111
|
+
<ExampleContainer>
|
|
112
|
+
<Title title="Icons & label toggle group" theme="light" level={4} />
|
|
113
|
+
<DxcToggleGroup label="Icons & label" options={optionsWithIconAndLabel} />
|
|
114
|
+
</ExampleContainer>
|
|
115
|
+
<ExampleContainer>
|
|
116
|
+
<Title title="Disabled" theme="light" level={4} />
|
|
117
|
+
<DxcToggleGroup label="Disabled" value={2} options={options} disabled />
|
|
118
|
+
</ExampleContainer>
|
|
119
|
+
<ExampleContainer pseudoState="pseudo-hover">
|
|
120
|
+
<Title title="Hovered" theme="light" level={4} />
|
|
121
|
+
<DxcToggleGroup label="Hovered" options={twoOptions} value={2} />
|
|
122
|
+
</ExampleContainer>
|
|
123
|
+
<ExampleContainer>
|
|
124
|
+
<Title title="Multiple toggleGroup" theme="light" level={4} />
|
|
125
|
+
<DxcToggleGroup
|
|
126
|
+
label="Toggle group"
|
|
127
|
+
helperText="Please select one or more"
|
|
128
|
+
options={options}
|
|
129
|
+
value={[1, 3]}
|
|
130
|
+
multiple
|
|
131
|
+
></DxcToggleGroup>
|
|
132
|
+
</ExampleContainer>
|
|
133
|
+
<Title title="Margins" theme="light" level={2} />
|
|
134
|
+
<ExampleContainer>
|
|
135
|
+
<Title title="xxSmall" theme="light" level={4} />
|
|
136
|
+
<DxcToggleGroup label="xxSmall margin" options={options} margin="xxsmall" />
|
|
137
|
+
</ExampleContainer>
|
|
138
|
+
<ExampleContainer>
|
|
139
|
+
<Title title="xSmall" theme="light" level={4} />
|
|
140
|
+
<DxcToggleGroup label="xSmall margin" options={options} margin="xsmall" />
|
|
141
|
+
</ExampleContainer>
|
|
142
|
+
<ExampleContainer>
|
|
143
|
+
<Title title="Small" theme="light" level={4} />
|
|
144
|
+
<DxcToggleGroup label="Small margin" options={options} margin="small" />
|
|
145
|
+
</ExampleContainer>
|
|
146
|
+
<ExampleContainer>
|
|
147
|
+
<Title title="Medium" theme="light" level={4} />
|
|
148
|
+
<DxcToggleGroup label="Medium margin" options={options} margin="medium" />
|
|
149
|
+
</ExampleContainer>
|
|
150
|
+
<ExampleContainer>
|
|
151
|
+
<Title title="Large" theme="light" level={4} />
|
|
152
|
+
<DxcToggleGroup label="Large margin" options={options} margin="large" />
|
|
153
|
+
</ExampleContainer>
|
|
154
|
+
<ExampleContainer>
|
|
155
|
+
<Title title="xLarge" theme="light" level={4} />
|
|
156
|
+
<DxcToggleGroup label="xLarge margin" options={options} margin="xlarge" />
|
|
157
|
+
</ExampleContainer>
|
|
158
|
+
<ExampleContainer>
|
|
159
|
+
<Title title="xxLarge" theme="light" level={4} />
|
|
160
|
+
<DxcToggleGroup label="xxLarge margin" options={options} margin="xxlarge" />
|
|
161
|
+
</ExampleContainer>
|
|
162
|
+
</>
|
|
163
|
+
);
|
|
164
|
+
const OptionSelected = () => <DxcToggleGroup label="Toggle group" helperText="HelperText" options={options} />;
|
|
165
|
+
|
|
166
|
+
export const ToggleGroupSelectedActived = OptionSelected.bind({});
|
|
167
|
+
ToggleGroupSelectedActived.play = async ({ canvasElement }) => {
|
|
168
|
+
const canvas = within(canvasElement);
|
|
169
|
+
const option = canvas.getByText("Linkedin");
|
|
170
|
+
await userEvent.click(option);
|
|
171
|
+
};
|
|
172
|
+
export const ToggleGroupUnselectedActived = OptionSelected.bind({});
|
|
173
|
+
ToggleGroupUnselectedActived.play = async ({ canvasElement }) => {
|
|
174
|
+
const canvas = within(canvasElement);
|
|
175
|
+
const option = canvas.getByText("Twitter");
|
|
176
|
+
await userEvent.click(option);
|
|
177
|
+
userEvent.tab();
|
|
178
|
+
};
|
package/wizard/Wizard.js
CHANGED
|
@@ -9,8 +9,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports["default"] = void 0;
|
|
11
11
|
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
13
|
|
|
16
14
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
@@ -21,15 +19,13 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
21
19
|
|
|
22
20
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
23
21
|
|
|
24
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
|
-
|
|
26
22
|
var _variables = require("../common/variables.js");
|
|
27
23
|
|
|
28
24
|
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
29
25
|
|
|
30
26
|
var _Icons = require("./Icons");
|
|
31
27
|
|
|
32
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13
|
|
28
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
|
|
33
29
|
|
|
34
30
|
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); }
|
|
35
31
|
|
|
@@ -68,11 +64,11 @@ var DxcWizard = function DxcWizard(_ref) {
|
|
|
68
64
|
}, /*#__PURE__*/_react["default"].createElement(StepsContainer, {
|
|
69
65
|
mode: mode,
|
|
70
66
|
margin: margin
|
|
71
|
-
}, steps.map(function (step, i) {
|
|
67
|
+
}, steps === null || steps === void 0 ? void 0 : steps.map(function (step, i) {
|
|
72
68
|
return /*#__PURE__*/_react["default"].createElement(StepContainer, {
|
|
73
69
|
key: "step".concat(i),
|
|
74
70
|
mode: mode,
|
|
75
|
-
lastStep: i === steps.length - 1
|
|
71
|
+
lastStep: i === (steps === null || steps === void 0 ? void 0 : steps.length) - 1
|
|
76
72
|
}, /*#__PURE__*/_react["default"].createElement(Step, {
|
|
77
73
|
tabIndex: tabIndex,
|
|
78
74
|
onClick: function onClick() {
|
|
@@ -81,17 +77,14 @@ var DxcWizard = function DxcWizard(_ref) {
|
|
|
81
77
|
mode: mode,
|
|
82
78
|
disabled: step.disabled,
|
|
83
79
|
first: i === 0,
|
|
84
|
-
last: i === steps.length - 1
|
|
80
|
+
last: i === (steps === null || steps === void 0 ? void 0 : steps.length) - 1
|
|
85
81
|
}, /*#__PURE__*/_react["default"].createElement(StepHeader, null, /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
86
82
|
current: i === renderedCurrent,
|
|
87
83
|
visited: i < renderedCurrent,
|
|
88
84
|
disabled: step.disabled
|
|
89
85
|
}, step.icon ? /*#__PURE__*/_react["default"].createElement(StepIconContainer, {
|
|
90
86
|
disabled: step.disabled
|
|
91
|
-
}, (0, _typeof2["default"])(step.icon) === "object" ? step.icon
|
|
92
|
-
current: i === renderedCurrent,
|
|
93
|
-
img: step.icon.props.src
|
|
94
|
-
}) : step.icon : /*#__PURE__*/_react["default"].createElement(step.icon)) : step.iconSrc ? /*#__PURE__*/_react["default"].createElement(Icon, {
|
|
87
|
+
}, (0, _typeof2["default"])(step.icon) === "object" ? step.icon : /*#__PURE__*/_react["default"].createElement(step.icon)) : step.iconSrc ? /*#__PURE__*/_react["default"].createElement(Icon, {
|
|
95
88
|
src: step.iconSrc
|
|
96
89
|
}) : /*#__PURE__*/_react["default"].createElement(Number, {
|
|
97
90
|
disabled: step.disabled,
|
|
@@ -172,20 +165,7 @@ var StepIconContainer = _styledComponents["default"].div(_templateObject7 || (_t
|
|
|
172
165
|
return props.theme.stepContainerIconSize;
|
|
173
166
|
});
|
|
174
167
|
|
|
175
|
-
var
|
|
176
|
-
return props.current ? props.theme.stepContainerSelectedFontColor : props.theme.stepContainerFontColor;
|
|
177
|
-
}, function (_ref2) {
|
|
178
|
-
var img = _ref2.img;
|
|
179
|
-
return img;
|
|
180
|
-
}, function (props) {
|
|
181
|
-
return "".concat(props.theme.stepContainerIconSize, " ").concat(props.theme.stepContainerIconSize);
|
|
182
|
-
}, function (props) {
|
|
183
|
-
return props.theme.stepContainerIconSize;
|
|
184
|
-
}, function (props) {
|
|
185
|
-
return props.theme.stepContainerIconSize;
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
var Number = _styledComponents["default"].p(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-family: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n opacity: 1;\n margin: 0px 0px 0px 1px;\n"])), function (props) {
|
|
168
|
+
var Number = _styledComponents["default"].p(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-family: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n opacity: 1;\n margin: 0px 0px 0px 1px;\n"])), function (props) {
|
|
189
169
|
return props.theme.stepContainerFontSize;
|
|
190
170
|
}, function (props) {
|
|
191
171
|
return props.theme.stepContainerFontFamily;
|
|
@@ -197,11 +177,11 @@ var Number = _styledComponents["default"].p(_templateObject9 || (_templateObject
|
|
|
197
177
|
return props.theme.stepContainerLetterSpacing;
|
|
198
178
|
});
|
|
199
179
|
|
|
200
|
-
var ValidityIconContainer = _styledComponents["default"].div(
|
|
180
|
+
var ValidityIconContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n width: 18px;\n height: 18px;\n position: absolute;\n top: 22.5px;\n left: 22.5px;\n"])));
|
|
201
181
|
|
|
202
|
-
var InfoContainer = _styledComponents["default"].div(
|
|
182
|
+
var InfoContainer = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: 12px;\n"])));
|
|
203
183
|
|
|
204
|
-
var Label = _styledComponents["default"].p(
|
|
184
|
+
var Label = _styledComponents["default"].p(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2["default"])(["\n text-align: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n ", ";\n text-transform: ", ";\n margin: 0;\n"])), function (props) {
|
|
205
185
|
return props.theme.labelTextAlign;
|
|
206
186
|
}, function (props) {
|
|
207
187
|
return props.theme.labelFontFamily;
|
|
@@ -219,7 +199,7 @@ var Label = _styledComponents["default"].p(_templateObject12 || (_templateObject
|
|
|
219
199
|
return props.theme.labelFontTextTransform;
|
|
220
200
|
});
|
|
221
201
|
|
|
222
|
-
var Description = _styledComponents["default"].p(
|
|
202
|
+
var Description = _styledComponents["default"].p(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["\n text-align: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n ", ";\n margin: 0;\n"])), function (props) {
|
|
223
203
|
return props.theme.descriptionTextAlign;
|
|
224
204
|
}, function (props) {
|
|
225
205
|
return props.theme.descriptionFontFamily;
|
|
@@ -237,7 +217,7 @@ var Description = _styledComponents["default"].p(_templateObject13 || (_template
|
|
|
237
217
|
return props.disabled ? "color: ".concat(props.theme.disabledFontColor, ";") : "color: ".concat(props.visited ? props.theme.visitedDescriptionFontColor : props.theme.descriptionFontColor, ";");
|
|
238
218
|
});
|
|
239
219
|
|
|
240
|
-
var StepSeparator = _styledComponents["default"].div(
|
|
220
|
+
var StepSeparator = _styledComponents["default"].div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n ", "\n border: ", ";\n opacity: 1;\n flex-grow: 1;\n"])), function (props) {
|
|
241
221
|
return props.mode === "horizontal" ? "" : "0";
|
|
242
222
|
}, function (props) {
|
|
243
223
|
return props.mode === "horizontal" ? "0" : "";
|
|
@@ -247,25 +227,5 @@ var StepSeparator = _styledComponents["default"].div(_templateObject14 || (_temp
|
|
|
247
227
|
return "".concat(props.theme.separatorBorderStyle, " ").concat(props.theme.separatorBorderThickness, " ").concat(props.theme.separatorColor);
|
|
248
228
|
});
|
|
249
229
|
|
|
250
|
-
DxcWizard.propTypes = {
|
|
251
|
-
mode: _propTypes["default"].oneOf(["horizontal", "vertical"]),
|
|
252
|
-
currentStep: _propTypes["default"].number,
|
|
253
|
-
onStepClick: _propTypes["default"].func,
|
|
254
|
-
steps: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
255
|
-
label: _propTypes["default"].string,
|
|
256
|
-
description: _propTypes["default"].string,
|
|
257
|
-
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
258
|
-
iconSrc: _propTypes["default"].string,
|
|
259
|
-
disabled: _propTypes["default"].bool,
|
|
260
|
-
valid: _propTypes["default"].bool
|
|
261
|
-
})),
|
|
262
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
263
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
264
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
265
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
266
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
267
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
268
|
-
tabIndex: _propTypes["default"].number
|
|
269
|
-
};
|
|
270
230
|
var _default = DxcWizard;
|
|
271
231
|
exports["default"] = _default;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
declare type Margin = {
|
|
4
|
+
top?: Space;
|
|
5
|
+
bottom?: Space;
|
|
6
|
+
left?: Space;
|
|
7
|
+
right?: Space;
|
|
8
|
+
};
|
|
9
|
+
declare type SVG = React.SVGProps<SVGSVGElement> | React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
10
|
+
declare type Step = {
|
|
11
|
+
/**
|
|
12
|
+
* Step label.
|
|
13
|
+
*/
|
|
14
|
+
label: string;
|
|
15
|
+
/**
|
|
16
|
+
* Description that will be placed next to the step.
|
|
17
|
+
*/
|
|
18
|
+
description?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Element used as the icon to be displayed in the step.
|
|
21
|
+
*/
|
|
22
|
+
icon?: SVG;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated URL of the icon to be displayed in the step.
|
|
25
|
+
*/
|
|
26
|
+
iconSrc?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the step is disabled or not.
|
|
29
|
+
*/
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the step is valid or not.
|
|
33
|
+
*/
|
|
34
|
+
valid?: boolean;
|
|
35
|
+
};
|
|
36
|
+
declare type Props = {
|
|
37
|
+
/**
|
|
38
|
+
* The wizard can be showed in horizontal or vertical.
|
|
39
|
+
*/
|
|
40
|
+
mode?: "horizontal" | "vertical";
|
|
41
|
+
/**
|
|
42
|
+
* Defines which step is marked as the current. The numeration starts in 0.
|
|
43
|
+
*/
|
|
44
|
+
currentStep?: number;
|
|
45
|
+
/**
|
|
46
|
+
* This function will be called when the user clicks a step. The step
|
|
47
|
+
* number will be passed as a parameter.
|
|
48
|
+
*/
|
|
49
|
+
onStepClick?: (newCurrentStep: number) => void;
|
|
50
|
+
/**
|
|
51
|
+
* An array of objects representing the steps.
|
|
52
|
+
*/
|
|
53
|
+
steps: [Step, ...Step[]];
|
|
54
|
+
/**
|
|
55
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
56
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
57
|
+
*/
|
|
58
|
+
margin?: Space | Margin;
|
|
59
|
+
/**
|
|
60
|
+
* Value of the tabindex attribute that is given to all the steps.
|
|
61
|
+
*/
|
|
62
|
+
tabIndex?: number;
|
|
63
|
+
};
|
|
64
|
+
export default Props;
|
package/wizard/types.js
ADDED
package/box/index.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
type Size = "small" | "medium" | "large" | "fillParent" | "fitContent";
|
|
2
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
-
type Margin = {
|
|
4
|
-
top?: Space;
|
|
5
|
-
bottom?: Space;
|
|
6
|
-
left?: Space;
|
|
7
|
-
right?: Space;
|
|
8
|
-
};
|
|
9
|
-
type Padding = {
|
|
10
|
-
top?: Space;
|
|
11
|
-
bottom?: Space;
|
|
12
|
-
left?: Space;
|
|
13
|
-
right?: Space;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
type Props = {
|
|
18
|
-
shadowDepth?: 0 | 1 | 2;
|
|
19
|
-
margin?: Space | Margin;
|
|
20
|
-
padging?: Space | Padding;
|
|
21
|
-
display: string;
|
|
22
|
-
size: Size;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default function DxcBox(props: Props): JSX.Element;
|
package/header/index.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
-
type Margin = {
|
|
3
|
-
top?: Space;
|
|
4
|
-
bottom?: Space;
|
|
5
|
-
left?: Space;
|
|
6
|
-
right?: Space;
|
|
7
|
-
};
|
|
8
|
-
type Padding = {
|
|
9
|
-
top?: Space;
|
|
10
|
-
bottom?: Space;
|
|
11
|
-
left?: Space;
|
|
12
|
-
right?: Space;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
type Props = {
|
|
16
|
-
underlined?: boolean;
|
|
17
|
-
onClick?: void;
|
|
18
|
-
content?: any;
|
|
19
|
-
responsiveContent?: any;
|
|
20
|
-
margin?: Space | Margin;
|
|
21
|
-
padding?: Space | Padding;
|
|
22
|
-
tabIndex?: number;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default function DxcHeader(props: Props): JSX.Element;
|
package/link/index.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
-
type Margin = {
|
|
3
|
-
top?: Space;
|
|
4
|
-
bottom?: Space;
|
|
5
|
-
left?: Space;
|
|
6
|
-
right?: Space;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
type Props = {
|
|
10
|
-
inheritColor?: boolean;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
iconSrc?: string;
|
|
13
|
-
icon?: any;
|
|
14
|
-
iconPosition?: "before" | "after";
|
|
15
|
-
href?: string;
|
|
16
|
-
newWindow?: boolean;
|
|
17
|
-
onClick?: void;
|
|
18
|
-
text?: string;
|
|
19
|
-
margin?: Space | Margin;
|
|
20
|
-
tabIndex?: number;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default function DxcLink(props: Props): JSX.Element;
|
package/number-input/index.d.ts
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
type Size = "small" | "medium" | "large" | "fillParent";
|
|
2
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
-
type Margin = {
|
|
4
|
-
top?: Space;
|
|
5
|
-
bottom?: Space;
|
|
6
|
-
left?: Space;
|
|
7
|
-
right?: Space;
|
|
8
|
-
};
|
|
9
|
-
type Props = {
|
|
10
|
-
/**
|
|
11
|
-
* Text to be placed above the number.
|
|
12
|
-
*/
|
|
13
|
-
label?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Name attribute of the input element.
|
|
16
|
-
*/
|
|
17
|
-
name?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Value of the input element. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
|
|
20
|
-
*/
|
|
21
|
-
value?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Helper text to be placed above the number.
|
|
24
|
-
*/
|
|
25
|
-
helperText?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Text to be put as placeholder of the number.
|
|
28
|
-
*/
|
|
29
|
-
placeholder?: string;
|
|
30
|
-
/**
|
|
31
|
-
* If true, the component will be disabled.
|
|
32
|
-
*/
|
|
33
|
-
disabled?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* If true, the number will be optional, showing '(Optional)'
|
|
36
|
-
* next to the label. Otherwise, the field will be considered required
|
|
37
|
-
* and an error will be passed as a parameter to the OnBlur and onChange
|
|
38
|
-
* functions when it has not been filled.
|
|
39
|
-
*/
|
|
40
|
-
optional?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Prefix to be placed before the number value.
|
|
43
|
-
*/
|
|
44
|
-
prefix?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Suffix to be placed after the number value.
|
|
47
|
-
*/
|
|
48
|
-
suffix?: string;
|
|
49
|
-
/**
|
|
50
|
-
* Minimum value allowed by the number input. If the typed value by the user is
|
|
51
|
-
* lower than min, the onBlur and onChange functions will be called with
|
|
52
|
-
* the current value and an internal error informing that the current
|
|
53
|
-
* value is not correct. If a valid state is reached, the error parameter
|
|
54
|
-
* will be null in both events.
|
|
55
|
-
*/
|
|
56
|
-
min?: number;
|
|
57
|
-
/**
|
|
58
|
-
* Maximum value allowed by the number input. If the typed value by the user
|
|
59
|
-
* surpasses max, the onBlur and onChange functions will be called with
|
|
60
|
-
* the current value and an internal error informing that the current
|
|
61
|
-
* value is not correct. If a valid state is reached, the error parameter
|
|
62
|
-
* will be null in both events.
|
|
63
|
-
*/
|
|
64
|
-
max?: number;
|
|
65
|
-
/**
|
|
66
|
-
* The step interval to use when using the up and down arrows to adjust the value.
|
|
67
|
-
*/
|
|
68
|
-
step?: number;
|
|
69
|
-
/**
|
|
70
|
-
* This function will be called when the user types within the input
|
|
71
|
-
* element of the component. An object including the current value and
|
|
72
|
-
* the error (if the value entered is not valid) will be passed to this
|
|
73
|
-
* function. If there is no error, error will be null.
|
|
74
|
-
*/
|
|
75
|
-
onChange?: (val: { value: string; error: string }) => void;
|
|
76
|
-
/**
|
|
77
|
-
* This function will be called when the input element loses the focus.
|
|
78
|
-
* An object including the input value and the error (if the value
|
|
79
|
-
* entered is not valid) will be passed to this function. If there is no error,
|
|
80
|
-
* error will be null.
|
|
81
|
-
*/
|
|
82
|
-
onBlur?: (val: { value: string; error: string }) => void;
|
|
83
|
-
/**
|
|
84
|
-
* If it is defined, the component will change its appearance, showing
|
|
85
|
-
* the error below the input component. If it is not defined, the error
|
|
86
|
-
* messages will be managed internally, but never displayed on its own.
|
|
87
|
-
*/
|
|
88
|
-
error?: string;
|
|
89
|
-
/**
|
|
90
|
-
* HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the input value.
|
|
91
|
-
* Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
|
|
92
|
-
*/
|
|
93
|
-
autocomplete?: string;
|
|
94
|
-
/**
|
|
95
|
-
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
96
|
-
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
97
|
-
*/
|
|
98
|
-
margin?: Space | Margin;
|
|
99
|
-
/**
|
|
100
|
-
* Size of the component ('small' | 'medium' | 'large' | 'fillParent').
|
|
101
|
-
*/
|
|
102
|
-
size?: Size;
|
|
103
|
-
/**
|
|
104
|
-
* Value of the tabindex attribute.
|
|
105
|
-
*/
|
|
106
|
-
tabIndex?: number;
|
|
107
|
-
/**
|
|
108
|
-
* Reference to the component.
|
|
109
|
-
*/
|
|
110
|
-
ref?: React.RefObject<HTMLDivElement>;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export default function DxcNumberInput(props: Props): JSX.Element;
|