@dxc-technology/halstack-react 0.0.0-d20b360 → 0.0.0-d238e47
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/alert/types.d.ts +1 -1
- package/box/Box.d.ts +4 -0
- package/box/Box.js +4 -30
- package/box/{Box.stories.jsx → Box.stories.tsx} +0 -0
- package/box/types.d.ts +43 -0
- package/box/types.js +5 -0
- package/button/Button.d.ts +1 -1
- package/button/Button.js +7 -10
- package/button/Button.stories.tsx +217 -234
- package/button/types.d.ts +11 -11
- package/card/Card.js +4 -5
- 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/chip/Chip.stories.tsx +121 -0
- package/common/variables.js +29 -21
- package/date-input/DateInput.stories.tsx +138 -0
- package/dialog/Dialog.stories.tsx +212 -0
- package/file-input/FileInput.d.ts +4 -0
- package/file-input/FileInput.js +7 -28
- package/file-input/FileItem.d.ts +14 -0
- package/file-input/FileItem.js +4 -15
- package/file-input/types.d.ts +87 -0
- package/file-input/types.js +5 -0
- package/footer/types.d.ts +1 -1
- package/header/Header.stories.tsx +162 -0
- package/header/types.d.ts +4 -2
- package/heading/Heading.d.ts +4 -0
- package/heading/Heading.js +6 -23
- package/heading/Heading.stories.tsx +53 -0
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -0
- package/link/Link.d.ts +3 -0
- package/link/Link.js +3 -25
- package/link/Link.stories.tsx +146 -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/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/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 +105 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.stories.jsx +58 -0
- package/radio/types.d.ts +2 -2
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/resultsetTable/ResultsetTable.js +0 -25
- package/resultsetTable/types.d.ts +63 -0
- package/resultsetTable/types.js +5 -0
- package/select/Select.stories.tsx +572 -0
- package/sidenav/Sidenav.d.ts +9 -0
- package/sidenav/Sidenav.js +4 -13
- package/sidenav/Sidenav.stories.tsx +165 -0
- package/sidenav/types.d.ts +50 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +1 -1
- package/slider/Slider.js +41 -30
- package/slider/Slider.stories.tsx +177 -0
- package/slider/types.d.ts +2 -7
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +0 -17
- 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/Table.js +1 -1
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tabs/Tabs.js +3 -1
- package/tabs/types.d.ts +2 -3
- 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/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +4 -44
- package/text-input/types.d.ts +157 -0
- package/text-input/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/Wizard.stories.jsx +224 -0
- package/wizard/types.d.ts +64 -0
- package/wizard/types.js +5 -0
- package/box/index.d.ts +0 -25
- package/file-input/index.d.ts +0 -81
- package/heading/index.d.ts +0 -17
- package/link/index.d.ts +0 -23
- package/number-input/index.d.ts +0 -113
- package/password-input/index.d.ts +0 -94
- package/resultsetTable/index.d.ts +0 -19
- 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/text-input/index.d.ts +0 -135
- package/wizard/index.d.ts +0 -18
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
+
declare type Margin = {
|
|
3
|
+
top?: Space;
|
|
4
|
+
bottom?: Space;
|
|
5
|
+
left?: Space;
|
|
6
|
+
right?: Space;
|
|
7
|
+
};
|
|
8
|
+
declare type Props = {
|
|
9
|
+
/**
|
|
10
|
+
* Text to be placed above the number.
|
|
11
|
+
*/
|
|
12
|
+
label?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Name attribute of the input element.
|
|
15
|
+
*/
|
|
16
|
+
name?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Value of the input element. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
|
|
19
|
+
*/
|
|
20
|
+
value?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Helper text to be placed above the number.
|
|
23
|
+
*/
|
|
24
|
+
helperText?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Text to be put as placeholder of the number.
|
|
27
|
+
*/
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
/**
|
|
30
|
+
* If true, the component will be disabled.
|
|
31
|
+
*/
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* If true, the number will be optional, showing '(Optional)'
|
|
35
|
+
* next to the label. Otherwise, the field will be considered required
|
|
36
|
+
* and an error will be passed as a parameter to the OnBlur and onChange
|
|
37
|
+
* functions when it has not been filled.
|
|
38
|
+
*/
|
|
39
|
+
optional?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Prefix to be placed before the number value.
|
|
42
|
+
*/
|
|
43
|
+
prefix?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Suffix to be placed after the number value.
|
|
46
|
+
*/
|
|
47
|
+
suffix?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Minimum value allowed by the number input. If the typed value by the user is
|
|
50
|
+
* lower than min, the onBlur and onChange functions will be called with
|
|
51
|
+
* the current value and an internal error informing that the current
|
|
52
|
+
* value is not correct. If a valid state is reached, the error parameter
|
|
53
|
+
* will be null in both events.
|
|
54
|
+
*/
|
|
55
|
+
min?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Maximum value allowed by the number input. If the typed value by the user
|
|
58
|
+
* surpasses max, the onBlur and onChange functions will be called with
|
|
59
|
+
* the current value and an internal error informing that the current
|
|
60
|
+
* value is not correct. If a valid state is reached, the error parameter
|
|
61
|
+
* will be null in both events.
|
|
62
|
+
*/
|
|
63
|
+
max?: number;
|
|
64
|
+
/**
|
|
65
|
+
* The step interval to use when using the up and down arrows to adjust the value.
|
|
66
|
+
*/
|
|
67
|
+
step?: number;
|
|
68
|
+
/**
|
|
69
|
+
* This function will be called when the user types within the input
|
|
70
|
+
* element of the component. An object including the current value and
|
|
71
|
+
* the error (if the value entered is not valid) will be passed to this
|
|
72
|
+
* function. If there is no error, error will be null.
|
|
73
|
+
*/
|
|
74
|
+
onChange?: (val: {
|
|
75
|
+
value: string;
|
|
76
|
+
error: string | null;
|
|
77
|
+
}) => void;
|
|
78
|
+
/**
|
|
79
|
+
* This function will be called when the input element loses the focus.
|
|
80
|
+
* An object including the input value and the error (if the value
|
|
81
|
+
* entered is not valid) will be passed to this function. If there is no error,
|
|
82
|
+
* error will be null.
|
|
83
|
+
*/
|
|
84
|
+
onBlur?: (val: {
|
|
85
|
+
value: string;
|
|
86
|
+
error: string | null;
|
|
87
|
+
}) => void;
|
|
88
|
+
/**
|
|
89
|
+
* If it is defined, the component will change its appearance, showing
|
|
90
|
+
* the error below the input component. If it is not defined, the error
|
|
91
|
+
* messages will be managed internally, but never displayed on its own.
|
|
92
|
+
*/
|
|
93
|
+
error?: string;
|
|
94
|
+
/**
|
|
95
|
+
* HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the input value.
|
|
96
|
+
* Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
|
|
97
|
+
*/
|
|
98
|
+
autocomplete?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
101
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
102
|
+
*/
|
|
103
|
+
margin?: Space | Margin;
|
|
104
|
+
/**
|
|
105
|
+
* Size of the component ('small' | 'medium' | 'large' | 'fillParent').
|
|
106
|
+
*/
|
|
107
|
+
size?: "small" | "medium" | "large" | "fillParent";
|
|
108
|
+
/**
|
|
109
|
+
* Value of the tabindex attribute.
|
|
110
|
+
*/
|
|
111
|
+
tabIndex?: number;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Reference to the component.
|
|
115
|
+
*/
|
|
116
|
+
export declare type RefType = HTMLDivElement;
|
|
117
|
+
export default Props;
|
package/package.json
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 _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -19,12 +17,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
19
17
|
|
|
20
18
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
21
19
|
|
|
22
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
|
-
|
|
24
20
|
var _TextInput = _interopRequireDefault(require("../text-input/TextInput"));
|
|
25
21
|
|
|
26
|
-
var _variables = require("../common/variables.js");
|
|
27
|
-
|
|
28
22
|
var _templateObject;
|
|
29
23
|
|
|
30
24
|
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); }
|
|
@@ -162,38 +156,7 @@ var DxcPasswordInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref,
|
|
|
162
156
|
}));
|
|
163
157
|
});
|
|
164
158
|
|
|
165
|
-
var sizes = {
|
|
166
|
-
small: "240px",
|
|
167
|
-
medium: "360px",
|
|
168
|
-
large: "480px",
|
|
169
|
-
fillParent: "100%"
|
|
170
|
-
};
|
|
171
|
-
|
|
172
159
|
var PasswordInput = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n & ::-ms-reveal {\n display: none;\n }\n"])));
|
|
173
160
|
|
|
174
|
-
DxcPasswordInput.propTypes = {
|
|
175
|
-
label: _propTypes["default"].string,
|
|
176
|
-
name: _propTypes["default"].string,
|
|
177
|
-
value: _propTypes["default"].string,
|
|
178
|
-
helperText: _propTypes["default"].string,
|
|
179
|
-
error: _propTypes["default"].string,
|
|
180
|
-
clearable: _propTypes["default"].bool,
|
|
181
|
-
onChange: _propTypes["default"].func,
|
|
182
|
-
onBlur: _propTypes["default"].func,
|
|
183
|
-
autocomplete: _propTypes["default"].string,
|
|
184
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
185
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
186
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
187
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
188
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
189
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
190
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
191
|
-
pattern: _propTypes["default"].string,
|
|
192
|
-
length: _propTypes["default"].shape({
|
|
193
|
-
min: _propTypes["default"].number,
|
|
194
|
-
max: _propTypes["default"].number
|
|
195
|
-
}),
|
|
196
|
-
tabIndex: _propTypes["default"].number
|
|
197
|
-
};
|
|
198
161
|
var _default = DxcPasswordInput;
|
|
199
162
|
exports["default"] = _default;
|
|
@@ -7,7 +7,7 @@ import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
|
7
7
|
import DarkContainer from "../../.storybook/components/DarkSection";
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
|
-
title: "Password input
|
|
10
|
+
title: "Password input",
|
|
11
11
|
component: DxcPasswordInput,
|
|
12
12
|
};
|
|
13
13
|
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
+
declare type Margin = {
|
|
3
|
+
top?: Space;
|
|
4
|
+
bottom?: Space;
|
|
5
|
+
left?: Space;
|
|
6
|
+
right?: Space;
|
|
7
|
+
};
|
|
8
|
+
declare type RequiredMinLength = {
|
|
9
|
+
min: number;
|
|
10
|
+
max?: number;
|
|
11
|
+
};
|
|
12
|
+
declare type RequiredMaxLength = {
|
|
13
|
+
min?: number;
|
|
14
|
+
max: number;
|
|
15
|
+
};
|
|
16
|
+
declare type Props = {
|
|
17
|
+
/**
|
|
18
|
+
* Text to be placed above the password.
|
|
19
|
+
*/
|
|
20
|
+
label?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Name attribute of the input element.
|
|
23
|
+
*/
|
|
24
|
+
name?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Value of the input element. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
|
|
27
|
+
*/
|
|
28
|
+
value?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Helper text to be placed above the password.
|
|
31
|
+
*/
|
|
32
|
+
helperText?: string;
|
|
33
|
+
/**
|
|
34
|
+
* If true, the password input will have an action to clear the entered value.
|
|
35
|
+
*/
|
|
36
|
+
clearable?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* This function will be called when the user types within the input
|
|
39
|
+
* element of the component. An object including the current value and
|
|
40
|
+
* the error (if the value entered is not valid) will be passed to this
|
|
41
|
+
* function. If there is no error, error will be null.
|
|
42
|
+
* */
|
|
43
|
+
onChange?: (val: {
|
|
44
|
+
value: string;
|
|
45
|
+
error: string | null;
|
|
46
|
+
}) => void;
|
|
47
|
+
/**
|
|
48
|
+
* This function will be called when the input element loses the focus.
|
|
49
|
+
* An object including the input value and the error (if the value entered is
|
|
50
|
+
* not valid) will be passed to this function. If there is no error, error will be null.
|
|
51
|
+
*/
|
|
52
|
+
onBlur?: (val: {
|
|
53
|
+
value: string;
|
|
54
|
+
error: string | null;
|
|
55
|
+
}) => void;
|
|
56
|
+
/**
|
|
57
|
+
* If it is defined, the component will change its appearance, showing
|
|
58
|
+
* the error below the password input component. If it is not defined, the
|
|
59
|
+
* error messages will be managed internally, but never displayed on its own.
|
|
60
|
+
*/
|
|
61
|
+
error?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Regular expression that defines the valid format allowed by the
|
|
64
|
+
* password input. This will be checked both when the input element loses the
|
|
65
|
+
* focus and while typing within it. If the string entered does not match
|
|
66
|
+
* the pattern, the onBlur and onChange functions will be called with the
|
|
67
|
+
* current value and an internal error informing that this value does not
|
|
68
|
+
* match the pattern. If the pattern is met, the error parameter of both
|
|
69
|
+
* events will be null.
|
|
70
|
+
*/
|
|
71
|
+
pattern?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Specifies the minimun and maximum length allowed by the password input.
|
|
74
|
+
* This will be checked both when the input element loses the
|
|
75
|
+
* focus and while typing within it. If the string entered does not
|
|
76
|
+
* comply the length, the onBlur and onChange functions will be called
|
|
77
|
+
* with the current value and an internal error informing that the value
|
|
78
|
+
* length does not comply the specified range. If a valid length is
|
|
79
|
+
* reached, the error parameter of both events will be null.
|
|
80
|
+
*/
|
|
81
|
+
length?: RequiredMinLength | RequiredMaxLength;
|
|
82
|
+
/**
|
|
83
|
+
* HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the input value.
|
|
84
|
+
* Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
|
|
85
|
+
*/
|
|
86
|
+
autocomplete?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
89
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
90
|
+
*/
|
|
91
|
+
margin?: Space | Margin;
|
|
92
|
+
/**
|
|
93
|
+
* Size of the component ('small' | 'medium' | 'large' | 'fillParent').
|
|
94
|
+
*/
|
|
95
|
+
size?: "small" | "medium" | "large" | "fillParent";
|
|
96
|
+
/**
|
|
97
|
+
* Value of the tabindex attribute.
|
|
98
|
+
*/
|
|
99
|
+
tabIndex?: number;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Reference to the component.
|
|
103
|
+
*/
|
|
104
|
+
export declare type RefType = HTMLDivElement;
|
|
105
|
+
export default Props;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import DxcProgressBar from "./ProgressBar";
|
|
3
|
+
import Title from "../../.storybook/components/Title";
|
|
4
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "ProgressBar",
|
|
8
|
+
component: DxcProgressBar,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Chromatic = () => (
|
|
12
|
+
<>
|
|
13
|
+
<ExampleContainer>
|
|
14
|
+
<Title title="Without labels" theme="light" level={4} />
|
|
15
|
+
<DxcProgressBar overlay={false} value={50} showValue />
|
|
16
|
+
<Title title="With helperText" theme="light" level={4} />
|
|
17
|
+
<DxcProgressBar helperText="Helper text" value={50} overlay={false} showValue />
|
|
18
|
+
<Title title="Without default value" theme="light" level={4} />
|
|
19
|
+
<DxcProgressBar label="Loading..." overlay={false} showValue />
|
|
20
|
+
</ExampleContainer>
|
|
21
|
+
<Title title="Margins" theme="light" level={2} />
|
|
22
|
+
<ExampleContainer>
|
|
23
|
+
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
24
|
+
<DxcProgressBar label="Margin xxsmall" margin="xxsmall" overlay={false} value={50} showValue />
|
|
25
|
+
</ExampleContainer>
|
|
26
|
+
<ExampleContainer>
|
|
27
|
+
<Title title="Xsmall margin" theme="light" level={4} />
|
|
28
|
+
<DxcProgressBar label="Margin xsmall" margin="xsmall" overlay={false} value={50} showValue />
|
|
29
|
+
</ExampleContainer>
|
|
30
|
+
<ExampleContainer>
|
|
31
|
+
<Title title="Small margin" theme="light" level={4} />
|
|
32
|
+
<DxcProgressBar label="Margin small" margin="small" overlay={false} value={50} showValue />
|
|
33
|
+
</ExampleContainer>
|
|
34
|
+
<ExampleContainer>
|
|
35
|
+
<Title title="Medium margin" theme="light" level={4} />
|
|
36
|
+
<DxcProgressBar label="Margin medium" margin="medium" overlay={false} value={50} showValue />
|
|
37
|
+
</ExampleContainer>
|
|
38
|
+
<ExampleContainer>
|
|
39
|
+
<Title title="Large margin" theme="light" level={4} />
|
|
40
|
+
<DxcProgressBar label="Margin large" margin="large" overlay={false} value={50} showValue />
|
|
41
|
+
</ExampleContainer>
|
|
42
|
+
<ExampleContainer>
|
|
43
|
+
<Title title="Xlarge margin" theme="light" level={4} />
|
|
44
|
+
<DxcProgressBar label="Margin xlarge" margin="xlarge" overlay={false} value={50} showValue />
|
|
45
|
+
</ExampleContainer>
|
|
46
|
+
<ExampleContainer>
|
|
47
|
+
<Title title="XxLarge margin" theme="light" level={4} />
|
|
48
|
+
<DxcProgressBar label="Margin xxlarge" margin="xxlarge" overlay={false} value={50} showValue />
|
|
49
|
+
</ExampleContainer>
|
|
50
|
+
</>
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
export const ProgressBarOverlay = () => (
|
|
54
|
+
<ExampleContainer>
|
|
55
|
+
<Title title="Overlay" theme="dark" level={4} />
|
|
56
|
+
<DxcProgressBar label="Overlay" helperText="Helper text" showValue value={50} />
|
|
57
|
+
</ExampleContainer>
|
|
58
|
+
);
|
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, itemsPerPage, itemsPerPageOptions, itemsPerPageFunction, margin, tabIndex, }: ResultsetTablePropsType) => JSX.Element;
|
|
4
|
+
export default DxcResultsetTable;
|
|
@@ -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 _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -21,8 +19,6 @@ 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 _Table = _interopRequireDefault(require("../table/Table"));
|
|
@@ -249,26 +245,5 @@ var DxcResultsetTableContainer = _styledComponents["default"].div(_templateObjec
|
|
|
249
245
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
250
246
|
});
|
|
251
247
|
|
|
252
|
-
DxcResultsetTable.propTypes = {
|
|
253
|
-
rows: _propTypes["default"].array,
|
|
254
|
-
columns: _propTypes["default"].array,
|
|
255
|
-
itemsPerPage: _propTypes["default"].number,
|
|
256
|
-
itemsPerPageOptions: _propTypes["default"].arrayOf(_propTypes["default"].number),
|
|
257
|
-
itemsPerPageFunction: _propTypes["default"].func,
|
|
258
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
259
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
260
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
261
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
262
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
263
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
264
|
-
tabIndex: _propTypes["default"].number
|
|
265
|
-
};
|
|
266
|
-
DxcResultsetTable.defaultProps = {
|
|
267
|
-
rows: [],
|
|
268
|
-
columns: [],
|
|
269
|
-
itemsPerPage: 5,
|
|
270
|
-
itemsPerPageOptions: null,
|
|
271
|
-
itemsPerPageFunction: null
|
|
272
|
-
};
|
|
273
248
|
var _default = DxcResultsetTable;
|
|
274
249
|
exports["default"] = _default;
|
|
@@ -0,0 +1,63 @@
|
|
|
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 Column = {
|
|
10
|
+
/**
|
|
11
|
+
* Column display value.
|
|
12
|
+
*/
|
|
13
|
+
displayValue: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Boolean value to indicate whether the column is sortable or not.
|
|
16
|
+
*/
|
|
17
|
+
isSortable?: boolean;
|
|
18
|
+
};
|
|
19
|
+
declare type Row = {
|
|
20
|
+
/**
|
|
21
|
+
* Value to be displayed in the cell.
|
|
22
|
+
*/
|
|
23
|
+
displayValue: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Value to be used when sorting the table by that
|
|
26
|
+
* column. If not indicated displayValue will be used for sorting.
|
|
27
|
+
*/
|
|
28
|
+
sortValue?: string;
|
|
29
|
+
};
|
|
30
|
+
declare type Props = {
|
|
31
|
+
/**
|
|
32
|
+
* An array of objects representing the columns of the table.
|
|
33
|
+
*/
|
|
34
|
+
columns: [Column, ...Column[]];
|
|
35
|
+
/**
|
|
36
|
+
* An array of objects representing the rows of the table, you will have
|
|
37
|
+
* as many objects as columns in the table.
|
|
38
|
+
*/
|
|
39
|
+
rows: [Row, ...Row[]];
|
|
40
|
+
/**
|
|
41
|
+
* Number of items per page.
|
|
42
|
+
*/
|
|
43
|
+
itemsPerPage?: number;
|
|
44
|
+
/**
|
|
45
|
+
* An array of numbers representing the items per page options.
|
|
46
|
+
*/
|
|
47
|
+
itemsPerPageOptions?: number[];
|
|
48
|
+
/**
|
|
49
|
+
* This function will be called when the user selects an item per page
|
|
50
|
+
* option. The value selected will be passed as a parameter.
|
|
51
|
+
*/
|
|
52
|
+
itemsPerPageFunction?: (newValue: number) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Size of the margin to be applied to the component. You can pass an object with 'top',
|
|
55
|
+
* 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
56
|
+
*/
|
|
57
|
+
margin?: Space | Margin;
|
|
58
|
+
/**
|
|
59
|
+
* Value of the tabindex attribute given to the sortable icon.
|
|
60
|
+
*/
|
|
61
|
+
tabIndex?: number;
|
|
62
|
+
};
|
|
63
|
+
export default Props;
|