@dxc-technology/halstack-react 0.0.0-459df48 → 0.0.0-460d7ec
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/accordion/Accordion.d.ts +4 -0
- package/accordion/Accordion.js +12 -43
- package/accordion/types.d.ts +68 -0
- package/accordion/types.js +5 -0
- package/accordion-group/AccordionGroup.d.ts +7 -0
- package/accordion-group/AccordionGroup.js +58 -72
- package/accordion-group/types.d.ts +72 -0
- package/accordion-group/types.js +5 -0
- package/box/Box.stories.jsx +132 -0
- package/card/Card.d.ts +4 -0
- package/card/Card.js +13 -48
- package/card/types.d.ts +69 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.stories.tsx +192 -0
- package/checkbox/types.d.ts +2 -3
- package/common/variables.js +1 -1
- package/dialog/Dialog.d.ts +4 -0
- package/dialog/Dialog.js +4 -23
- package/dialog/types.d.ts +43 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/dropdown/Dropdown.js +7 -40
- package/dropdown/types.d.ts +89 -0
- package/dropdown/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +4 -35
- package/footer/Footer.stories.jsx +151 -0
- package/footer/types.d.ts +61 -0
- package/footer/types.js +5 -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/number-input/NumberInput.stories.jsx +115 -0
- package/package.json +1 -1
- package/paginator/Paginator.stories.tsx +63 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/progress-bar/ProgressBar.js +3 -21
- package/progress-bar/types.d.ts +37 -0
- package/progress-bar/types.js +5 -0
- package/radio/Radio.d.ts +4 -0
- package/radio/Radio.js +3 -24
- package/radio/Radio.stories.tsx +192 -0
- package/radio/types.d.ts +54 -0
- package/radio/types.js +5 -0
- package/select/index.d.ts +4 -4
- package/slider/Slider.d.ts +4 -0
- package/slider/Slider.js +26 -60
- package/slider/types.d.ts +83 -0
- package/slider/types.js +5 -0
- package/spinner/Spinner.js +6 -6
- package/spinner/Spinner.stories.jsx +102 -0
- package/table/Table.d.ts +4 -0
- package/table/Table.stories.jsx +276 -0
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +5 -53
- package/tabs/types.d.ts +71 -0
- package/tabs/types.js +5 -0
- package/text-input/index.d.ts +2 -2
- package/textarea/Textarea.stories.jsx +135 -0
- package/accordion/index.d.ts +0 -28
- package/accordion-group/index.d.ts +0 -16
- package/card/index.d.ts +0 -22
- package/dialog/index.d.ts +0 -18
- package/dropdown/index.d.ts +0 -26
- package/footer/index.d.ts +0 -25
- package/header/index.d.ts +0 -25
- package/progress-bar/index.d.ts +0 -18
- package/radio/index.d.ts +0 -23
- package/slider/index.d.ts +0 -29
- package/table/index.d.ts +0 -13
- package/tabs/index.d.ts +0 -19
package/slider/Slider.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 _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
15
13
|
|
|
16
14
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
@@ -23,8 +21,6 @@ var _Slider = _interopRequireDefault(require("@material-ui/lab/Slider"));
|
|
|
23
21
|
|
|
24
22
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
25
23
|
|
|
26
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
|
-
|
|
28
24
|
var _TextInput = _interopRequireDefault(require("../text-input/TextInput"));
|
|
29
25
|
|
|
30
26
|
var _variables = require("../common/variables.js");
|
|
@@ -42,30 +38,35 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
42
38
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
43
39
|
|
|
44
40
|
var DxcSlider = function DxcSlider(_ref) {
|
|
45
|
-
var label = _ref.label,
|
|
46
|
-
|
|
41
|
+
var _ref$label = _ref.label,
|
|
42
|
+
label = _ref$label === void 0 ? "" : _ref$label,
|
|
43
|
+
_ref$name = _ref.name,
|
|
44
|
+
name = _ref$name === void 0 ? "" : _ref$name,
|
|
45
|
+
value = _ref.value,
|
|
46
|
+
_ref$helperText = _ref.helperText,
|
|
47
|
+
helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
|
|
47
48
|
_ref$minValue = _ref.minValue,
|
|
48
49
|
minValue = _ref$minValue === void 0 ? 0 : _ref$minValue,
|
|
49
50
|
_ref$maxValue = _ref.maxValue,
|
|
50
51
|
maxValue = _ref$maxValue === void 0 ? 100 : _ref$maxValue,
|
|
51
52
|
_ref$step = _ref.step,
|
|
52
53
|
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
53
|
-
value = _ref.value,
|
|
54
54
|
_ref$showLimitsValues = _ref.showLimitsValues,
|
|
55
55
|
showLimitsValues = _ref$showLimitsValues === void 0 ? false : _ref$showLimitsValues,
|
|
56
56
|
_ref$showInput = _ref.showInput,
|
|
57
57
|
showInput = _ref$showInput === void 0 ? false : _ref$showInput,
|
|
58
|
-
name = _ref.name,
|
|
59
|
-
onChange = _ref.onChange,
|
|
60
|
-
onDragEnd = _ref.onDragEnd,
|
|
61
58
|
_ref$disabled = _ref.disabled,
|
|
62
59
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
63
60
|
_ref$marks = _ref.marks,
|
|
64
61
|
marks = _ref$marks === void 0 ? false : _ref$marks,
|
|
62
|
+
onChange = _ref.onChange,
|
|
63
|
+
onDragEnd = _ref.onDragEnd,
|
|
65
64
|
labelFormatCallback = _ref.labelFormatCallback,
|
|
66
65
|
margin = _ref.margin,
|
|
67
66
|
_ref$size = _ref.size,
|
|
68
|
-
size = _ref$size === void 0 ? "fillParent" : _ref$size
|
|
67
|
+
size = _ref$size === void 0 ? "fillParent" : _ref$size,
|
|
68
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
69
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
69
70
|
|
|
70
71
|
var _useState = (0, _react.useState)(0),
|
|
71
72
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
@@ -82,36 +83,24 @@ var DxcSlider = function DxcSlider(_ref) {
|
|
|
82
83
|
}, [labelFormatCallback, maxValue]);
|
|
83
84
|
|
|
84
85
|
var handlerSliderChange = function handlerSliderChange(event, newValue) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
setInnerValue(newValue);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
86
|
+
var valueToCheck = value !== null && value !== void 0 ? value : innerValue;
|
|
87
|
+
valueToCheck !== newValue && setInnerValue(newValue);
|
|
88
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
89
|
+
};
|
|
92
90
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
91
|
+
var handleSliderOnChangeCommited = function handleSliderOnChangeCommited(event, selectedValue) {
|
|
92
|
+
onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd(selectedValue);
|
|
96
93
|
};
|
|
97
94
|
|
|
98
95
|
var handlerInputChange = function handlerInputChange(event) {
|
|
99
96
|
var intValue = parseInt(event.value, 10);
|
|
100
97
|
|
|
101
98
|
if (value == null) {
|
|
102
|
-
if (!Number.isNaN(intValue))
|
|
103
|
-
setInnerValue(intValue > maxValue ? maxValue : intValue);
|
|
104
|
-
} else {
|
|
105
|
-
setInnerValue("");
|
|
106
|
-
}
|
|
99
|
+
if (!Number.isNaN(intValue)) setInnerValue(intValue > maxValue ? maxValue : intValue);
|
|
107
100
|
}
|
|
108
101
|
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
onChange(intValue > maxValue ? maxValue : intValue);
|
|
112
|
-
} else {
|
|
113
|
-
onChange("");
|
|
114
|
-
}
|
|
102
|
+
if (!Number.isNaN(intValue)) {
|
|
103
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(intValue > maxValue ? maxValue : intValue);
|
|
115
104
|
}
|
|
116
105
|
};
|
|
117
106
|
|
|
@@ -130,12 +119,11 @@ var DxcSlider = function DxcSlider(_ref) {
|
|
|
130
119
|
min: minValue,
|
|
131
120
|
max: maxValue,
|
|
132
121
|
onChange: handlerSliderChange,
|
|
133
|
-
onChangeCommitted:
|
|
134
|
-
return onDragEnd(selectedValue);
|
|
135
|
-
},
|
|
122
|
+
onChangeCommitted: handleSliderOnChangeCommited,
|
|
136
123
|
step: step,
|
|
137
124
|
marks: marks || [],
|
|
138
|
-
disabled: disabled
|
|
125
|
+
disabled: disabled,
|
|
126
|
+
tabIndex: tabIndex
|
|
139
127
|
}), showLimitsValues && /*#__PURE__*/_react["default"].createElement(MaxLabelContainer, {
|
|
140
128
|
backgroundType: backgroundType,
|
|
141
129
|
disabled: disabled,
|
|
@@ -145,7 +133,8 @@ var DxcSlider = function DxcSlider(_ref) {
|
|
|
145
133
|
value: value != null && value >= 0 && value || innerValue,
|
|
146
134
|
disabled: disabled,
|
|
147
135
|
onChange: handlerInputChange,
|
|
148
|
-
size: "fillParent"
|
|
136
|
+
size: "fillParent",
|
|
137
|
+
tabIndex: tabIndex
|
|
149
138
|
})))));
|
|
150
139
|
};
|
|
151
140
|
|
|
@@ -313,28 +302,5 @@ var StyledTextInput = _styledComponents["default"].div(_templateObject7 || (_tem
|
|
|
313
302
|
return props.theme.inputMarginLeft;
|
|
314
303
|
});
|
|
315
304
|
|
|
316
|
-
DxcSlider.propTypes = {
|
|
317
|
-
label: _propTypes["default"].string,
|
|
318
|
-
helperText: _propTypes["default"].string,
|
|
319
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
320
|
-
minValue: _propTypes["default"].number,
|
|
321
|
-
maxValue: _propTypes["default"].number,
|
|
322
|
-
step: _propTypes["default"].number,
|
|
323
|
-
value: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]),
|
|
324
|
-
showLimitsValues: _propTypes["default"].bool,
|
|
325
|
-
showInput: _propTypes["default"].bool,
|
|
326
|
-
name: _propTypes["default"].string,
|
|
327
|
-
onChange: _propTypes["default"].func,
|
|
328
|
-
onDragEnd: _propTypes["default"].func,
|
|
329
|
-
disabled: _propTypes["default"].bool,
|
|
330
|
-
marks: _propTypes["default"].bool,
|
|
331
|
-
labelFormatCallback: _propTypes["default"].func,
|
|
332
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
333
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
334
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
335
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
336
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
337
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
|
|
338
|
-
};
|
|
339
305
|
var _default = DxcSlider;
|
|
340
306
|
exports["default"] = _default;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
declare type Size = "medium" | "large" | "fillParent";
|
|
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 Props = {
|
|
10
|
+
/**
|
|
11
|
+
* Text to be placed above the slider.
|
|
12
|
+
*/
|
|
13
|
+
label?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Name attribute of the input element.
|
|
16
|
+
*/
|
|
17
|
+
name?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The selected value. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
|
|
20
|
+
*/
|
|
21
|
+
value?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Helper text to be placed above the slider.
|
|
24
|
+
*/
|
|
25
|
+
helperText?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The minimum value available for selection.
|
|
28
|
+
*/
|
|
29
|
+
minValue?: number;
|
|
30
|
+
/**
|
|
31
|
+
* The maximum value available for selection.
|
|
32
|
+
*/
|
|
33
|
+
maxValue?: number;
|
|
34
|
+
/**
|
|
35
|
+
* The step interval between values available for selection.
|
|
36
|
+
*/
|
|
37
|
+
step?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the min/max value labels should be displayed next to the slider
|
|
40
|
+
*/
|
|
41
|
+
showLimitsValues?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the input element for displaying/controlling the slider value should be displayed next to the slider.
|
|
44
|
+
*/
|
|
45
|
+
showInput?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* If true, the component will be disabled.
|
|
48
|
+
*/
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the marks between each step should be shown or not.
|
|
52
|
+
*/
|
|
53
|
+
marks?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* This function will be called when the slider changes its value, as it's being dragged.
|
|
56
|
+
* The new value will be passed as a parameter when this function is executed.
|
|
57
|
+
*/
|
|
58
|
+
onChange?: (value: number) => void;
|
|
59
|
+
/**
|
|
60
|
+
* This function will be called when the slider changes its value, but only when the thumb is released.
|
|
61
|
+
* The new value will be passed as a parameter when this function is executed.
|
|
62
|
+
*/
|
|
63
|
+
onDragEnd?: (value: number) => void;
|
|
64
|
+
/**
|
|
65
|
+
* This function will be used to format the labels displayed next to the slider.
|
|
66
|
+
* The value will be passed as parameter and the function must return the formatted value.
|
|
67
|
+
*/
|
|
68
|
+
labelFormatCallback?: (value: number) => void;
|
|
69
|
+
/**
|
|
70
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
71
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
72
|
+
*/
|
|
73
|
+
margin?: Space | Margin;
|
|
74
|
+
/**
|
|
75
|
+
* Size of the component.
|
|
76
|
+
*/
|
|
77
|
+
size?: Size;
|
|
78
|
+
/**
|
|
79
|
+
* Value of the tabindex attribute.
|
|
80
|
+
*/
|
|
81
|
+
tabIndex?: number;
|
|
82
|
+
};
|
|
83
|
+
export default Props;
|
package/slider/types.js
ADDED
package/spinner/Spinner.js
CHANGED
|
@@ -172,15 +172,15 @@ var DXCSpinner = _styledComponents["default"].div(_templateObject || (_templateO
|
|
|
172
172
|
}, function (props) {
|
|
173
173
|
return props.mode === "overlay" ? 1300 : "";
|
|
174
174
|
}, function (props) {
|
|
175
|
-
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
175
|
+
return props.mode != "overlay" ? props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px" : "";
|
|
176
176
|
}, function (props) {
|
|
177
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
177
|
+
return props.mode != "overlay" ? props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "" : "";
|
|
178
178
|
}, function (props) {
|
|
179
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
179
|
+
return props.mode != "overlay" ? props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "" : "";
|
|
180
180
|
}, function (props) {
|
|
181
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
181
|
+
return props.mode != "overlay" ? props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "" : "";
|
|
182
182
|
}, function (props) {
|
|
183
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
183
|
+
return props.mode != "overlay" ? props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "" : "";
|
|
184
184
|
});
|
|
185
185
|
|
|
186
186
|
var SpinnerContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n align-items: center;\n display: flex;\n height: ", ";\n width: ", ";\n justify-content: center;\n position: relative;\n background-color: transparent;\n\n @keyframes spinner-svg {\n 0% {\n transform: rotateZ(0deg);\n }\n 100% {\n transform: rotateZ(360deg);\n }\n }\n @keyframes svg-circle-large {\n 0% {\n stroke-dashoffset: 400;\n transform: rotate(0);\n }\n\n 50% {\n stroke-dashoffset: 75;\n transform: rotate(45deg);\n }\n\n 100% {\n stroke-dashoffset: 400;\n transform: rotate(360deg);\n }\n }\n @keyframes svg-circle-small {\n 0% {\n stroke-dashoffset: 35;\n transform: rotate(0);\n }\n\n 50% {\n stroke-dashoffset: 8;\n transform: rotate(45deg);\n }\n\n 100% {\n stroke-dashoffset: 35;\n transform: rotate(360deg);\n }\n }\n"])), function (props) {
|
|
@@ -245,7 +245,7 @@ var SpinnerLabel = _styledComponents["default"].p(_templateObject11 || (_templat
|
|
|
245
245
|
return props.mode === "overlay" ? props.theme.overlayLabelLetterSpacing : props.theme.labelLetterSpacing;
|
|
246
246
|
});
|
|
247
247
|
|
|
248
|
-
var SpinnerProgress = _styledComponents["default"].p(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: ", ";\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n font-style: ", ";\n
|
|
248
|
+
var SpinnerProgress = _styledComponents["default"].p(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0;\n width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: ", ";\n font-family: ", ";\n font-weight: ", ";\n font-size: ", ";\n font-style: ", ";\n color: ", ";\n text-align: ", ";\n letter-spacing: ", ";\n"])), function (props) {
|
|
249
249
|
return props.value !== "" && props.showValue === true && "block" || "none";
|
|
250
250
|
}, function (props) {
|
|
251
251
|
return props.mode === "overlay" ? props.theme.overlayProgressValueFontFamily : props.theme.progressValueFontFamily;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import DxcSpinner from "./Spinner";
|
|
3
|
+
import Title from "../../.storybook/components/Title";
|
|
4
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Spinner",
|
|
8
|
+
component: DxcSpinner,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Chromatic = () => (
|
|
12
|
+
<>
|
|
13
|
+
<ExampleContainer>
|
|
14
|
+
<Title title="With label" theme="light" level={4} />
|
|
15
|
+
<DxcSpinner label="Label" value="50"></DxcSpinner>
|
|
16
|
+
<Title title="With value label" theme="light" level={4} />
|
|
17
|
+
<DxcSpinner value="50" showValue></DxcSpinner>
|
|
18
|
+
<Title title="With label and value label" theme="light" level={4} />
|
|
19
|
+
<DxcSpinner label="Label" value="50" showValue></DxcSpinner>
|
|
20
|
+
<Title title="With 100%" theme="light" level={4} />
|
|
21
|
+
<DxcSpinner label="Label" value="100" showValue></DxcSpinner>
|
|
22
|
+
</ExampleContainer>
|
|
23
|
+
<Title title="Modes" theme="light" level={2} />
|
|
24
|
+
<ExampleContainer>
|
|
25
|
+
<Title title="Mode large" theme="light" level={4} />
|
|
26
|
+
<DxcSpinner mode="large" value="50"></DxcSpinner>
|
|
27
|
+
<Title title="Mode small" theme="light" level={4} />
|
|
28
|
+
<DxcSpinner mode="small" value="50"></DxcSpinner>
|
|
29
|
+
<Title title="Mode small with 100%" theme="light" level={4} />
|
|
30
|
+
<DxcSpinner mode="small" value="100" showValue></DxcSpinner>
|
|
31
|
+
</ExampleContainer>
|
|
32
|
+
<Title title="Margins with large mode" theme="light" level={2} />
|
|
33
|
+
<ExampleContainer>
|
|
34
|
+
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
35
|
+
<DxcSpinner margin="xxsmall" value="75"></DxcSpinner>
|
|
36
|
+
<Title title="Xsmall margin" theme="light" level={4} />
|
|
37
|
+
<DxcSpinner margin="xsmall" value="75"></DxcSpinner>
|
|
38
|
+
<Title title="Small margin" theme="light" level={4} />
|
|
39
|
+
<DxcSpinner margin="small" value="75"></DxcSpinner>
|
|
40
|
+
<Title title="Medium margin" theme="light" level={4} />
|
|
41
|
+
<DxcSpinner margin="medium" value="75"></DxcSpinner>
|
|
42
|
+
<Title title="Large margin" theme="light" level={4} />
|
|
43
|
+
<DxcSpinner margin="large" value="75"></DxcSpinner>
|
|
44
|
+
<Title title="Xlarge margin" theme="light" level={4} />
|
|
45
|
+
<DxcSpinner margin="xlarge" value="75"></DxcSpinner>
|
|
46
|
+
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
47
|
+
<DxcSpinner margin="xxlarge" value="75"></DxcSpinner>
|
|
48
|
+
</ExampleContainer>
|
|
49
|
+
<Title title="Margins with small mode" theme="light" level={2} />
|
|
50
|
+
<ExampleContainer>
|
|
51
|
+
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
52
|
+
<DxcSpinner margin="xxsmall" mode="small" value="75"></DxcSpinner>
|
|
53
|
+
<Title title="Xsmall margin" theme="light" level={4} />
|
|
54
|
+
<DxcSpinner margin="xsmall" mode="small" value="75"></DxcSpinner>
|
|
55
|
+
<Title title="Small margin" theme="light" level={4} />
|
|
56
|
+
<DxcSpinner margin="small" mode="small" value="75"></DxcSpinner>
|
|
57
|
+
<Title title="Medium margin" theme="light" level={4} />
|
|
58
|
+
<DxcSpinner margin="medium" mode="small" value="75"></DxcSpinner>
|
|
59
|
+
<Title title="Large margin" theme="light" level={4} />
|
|
60
|
+
<DxcSpinner margin="large" mode="small" value="75"></DxcSpinner>
|
|
61
|
+
<Title title="Xlarge margin" theme="light" level={4} />
|
|
62
|
+
<DxcSpinner margin="xlarge" mode="small" value="75"></DxcSpinner>
|
|
63
|
+
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
64
|
+
<DxcSpinner margin="xxlarge" mode="small" value="75"></DxcSpinner>
|
|
65
|
+
</ExampleContainer>
|
|
66
|
+
</>
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
export const SpinnerOverlay = () => (
|
|
70
|
+
<ExampleContainer>
|
|
71
|
+
<Title title="Mode overlay" theme="light" level={4} />
|
|
72
|
+
<DxcSpinner mode="overlay" value="25"></DxcSpinner>
|
|
73
|
+
</ExampleContainer>
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
export const SpinnerOverlayWith100 = () => (
|
|
77
|
+
<ExampleContainer>
|
|
78
|
+
<Title title="Mode overlay" theme="light" level={4} />
|
|
79
|
+
<DxcSpinner mode="overlay" value="100"></DxcSpinner>
|
|
80
|
+
</ExampleContainer>
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
export const SpinnerOverlayWithLabel = () => (
|
|
84
|
+
<ExampleContainer>
|
|
85
|
+
<Title title="Mode overlay" theme="light" level={4} />
|
|
86
|
+
<DxcSpinner mode="overlay" value="50" label="Label"></DxcSpinner>
|
|
87
|
+
</ExampleContainer>
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
export const SpinnerOverlayWithValue = () => (
|
|
91
|
+
<ExampleContainer>
|
|
92
|
+
<Title title="Mode overlay" theme="light" level={4} />
|
|
93
|
+
<DxcSpinner mode="overlay" value="50" showValue></DxcSpinner>
|
|
94
|
+
</ExampleContainer>
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
export const SpinnerOverlayWithValueAndLabel = () => (
|
|
98
|
+
<ExampleContainer>
|
|
99
|
+
<Title title="Mode overlay" theme="light" level={4} />
|
|
100
|
+
<DxcSpinner mode="overlay" label="Label" value="50" showValue></DxcSpinner>
|
|
101
|
+
</ExampleContainer>
|
|
102
|
+
);
|
package/table/Table.d.ts
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import DxcTable from "./Table";
|
|
3
|
+
import Title from "../../.storybook/components/Title";
|
|
4
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Table",
|
|
8
|
+
component: DxcTable,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Chromatic = () => (
|
|
12
|
+
<>
|
|
13
|
+
<ExampleContainer>
|
|
14
|
+
<Title title="Default" theme="light" level={4} />
|
|
15
|
+
<DxcTable>
|
|
16
|
+
<tr>
|
|
17
|
+
<th>header 1</th>
|
|
18
|
+
<th>header 2</th>
|
|
19
|
+
<th>header 3</th>
|
|
20
|
+
</tr>
|
|
21
|
+
<tr>
|
|
22
|
+
<td>cell 1</td>
|
|
23
|
+
<td>cell 2</td>
|
|
24
|
+
<td>cell 3</td>
|
|
25
|
+
</tr>
|
|
26
|
+
<tr>
|
|
27
|
+
<td>cell 4</td>
|
|
28
|
+
<td>cell 5</td>
|
|
29
|
+
<td>cell 6</td>
|
|
30
|
+
</tr>
|
|
31
|
+
<tr>
|
|
32
|
+
<td>cell 7</td>
|
|
33
|
+
<td>cell 8</td>
|
|
34
|
+
<td>Cell 9</td>
|
|
35
|
+
</tr>
|
|
36
|
+
</DxcTable>
|
|
37
|
+
</ExampleContainer>
|
|
38
|
+
<ExampleContainer>
|
|
39
|
+
<Title title="With scrollbar" theme="light" level={4} />
|
|
40
|
+
<div
|
|
41
|
+
style={{ height: 200 + "px", display: "flex", flexDirection: "row", width: 100 + "%", marginBottom: 50 + "px" }}
|
|
42
|
+
>
|
|
43
|
+
<DxcTable>
|
|
44
|
+
<tr>
|
|
45
|
+
<th>
|
|
46
|
+
header<br></br>subheader
|
|
47
|
+
</th>
|
|
48
|
+
<th>
|
|
49
|
+
header<br></br>subheader
|
|
50
|
+
</th>
|
|
51
|
+
<th>
|
|
52
|
+
header<br></br>subheader
|
|
53
|
+
</th>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr>
|
|
56
|
+
<td>
|
|
57
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
|
58
|
+
dolore magna aliqua.
|
|
59
|
+
</td>
|
|
60
|
+
<td>
|
|
61
|
+
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
|
62
|
+
consequat.
|
|
63
|
+
</td>
|
|
64
|
+
<td>
|
|
65
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
66
|
+
</td>
|
|
67
|
+
</tr>
|
|
68
|
+
<tr>
|
|
69
|
+
<td>cell data</td>
|
|
70
|
+
<td>cell data</td>
|
|
71
|
+
<td>cell data</td>
|
|
72
|
+
</tr>
|
|
73
|
+
<tr>
|
|
74
|
+
<td>cell data</td>
|
|
75
|
+
<td>cell data</td>
|
|
76
|
+
<td>cell data</td>
|
|
77
|
+
</tr>
|
|
78
|
+
<tr>
|
|
79
|
+
<td>cell data</td>
|
|
80
|
+
<td>cell data</td>
|
|
81
|
+
<td>cell data</td>
|
|
82
|
+
</tr>
|
|
83
|
+
<tr>
|
|
84
|
+
<td>cell data</td>
|
|
85
|
+
<td>cell data</td>
|
|
86
|
+
<td>cell data</td>
|
|
87
|
+
</tr>
|
|
88
|
+
<tr>
|
|
89
|
+
<td>cell data</td>
|
|
90
|
+
<td>cell data</td>
|
|
91
|
+
<td>cell data</td>
|
|
92
|
+
</tr>
|
|
93
|
+
<tr>
|
|
94
|
+
<td>cell data</td>
|
|
95
|
+
<td>cell data</td>
|
|
96
|
+
<td>cell data</td>
|
|
97
|
+
</tr>
|
|
98
|
+
<tr>
|
|
99
|
+
<td>cell data</td>
|
|
100
|
+
<td>cell data</td>
|
|
101
|
+
<td>cell data</td>
|
|
102
|
+
</tr>
|
|
103
|
+
<tr>
|
|
104
|
+
<td>cell data</td>
|
|
105
|
+
<td>cell data</td>
|
|
106
|
+
<td>cell data</td>
|
|
107
|
+
</tr>
|
|
108
|
+
</DxcTable>
|
|
109
|
+
</div>
|
|
110
|
+
</ExampleContainer>
|
|
111
|
+
<Title title="Margins" theme="light" level={2} />
|
|
112
|
+
<ExampleContainer>
|
|
113
|
+
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
114
|
+
<DxcTable margin="xxsmall">
|
|
115
|
+
<tr>
|
|
116
|
+
<th>header 1</th>
|
|
117
|
+
<th>header 2</th>
|
|
118
|
+
<th>header 3</th>
|
|
119
|
+
</tr>
|
|
120
|
+
<tr>
|
|
121
|
+
<td>cell 1</td>
|
|
122
|
+
<td>cell 2</td>
|
|
123
|
+
<td>cell 3</td>
|
|
124
|
+
</tr>
|
|
125
|
+
<tr>
|
|
126
|
+
<td>cell 4</td>
|
|
127
|
+
<td>cell 5</td>
|
|
128
|
+
<td>cell 6</td>
|
|
129
|
+
</tr>
|
|
130
|
+
<tr>
|
|
131
|
+
<td>cell 7</td>
|
|
132
|
+
<td>cell 8</td>
|
|
133
|
+
<td>Cell 9</td>
|
|
134
|
+
</tr>
|
|
135
|
+
</DxcTable>
|
|
136
|
+
<Title title="Xsmall margin" theme="light" level={4} />
|
|
137
|
+
<DxcTable margin="xsmall">
|
|
138
|
+
<tr>
|
|
139
|
+
<th>header 1</th>
|
|
140
|
+
<th>header 2</th>
|
|
141
|
+
<th>header 3</th>
|
|
142
|
+
</tr>
|
|
143
|
+
<tr>
|
|
144
|
+
<td>cell 1</td>
|
|
145
|
+
<td>cell 2</td>
|
|
146
|
+
<td>cell 3</td>
|
|
147
|
+
</tr>
|
|
148
|
+
<tr>
|
|
149
|
+
<td>cell 4</td>
|
|
150
|
+
<td>cell 5</td>
|
|
151
|
+
<td>cell 6</td>
|
|
152
|
+
</tr>
|
|
153
|
+
<tr>
|
|
154
|
+
<td>cell 7</td>
|
|
155
|
+
<td>cell 8</td>
|
|
156
|
+
<td>Cell 9</td>
|
|
157
|
+
</tr>
|
|
158
|
+
</DxcTable>
|
|
159
|
+
<Title title="Small margin" theme="light" level={4} />
|
|
160
|
+
<DxcTable margin="small">
|
|
161
|
+
<tr>
|
|
162
|
+
<th>header 1</th>
|
|
163
|
+
<th>header 2</th>
|
|
164
|
+
<th>header 3</th>
|
|
165
|
+
</tr>
|
|
166
|
+
<tr>
|
|
167
|
+
<td>cell 1</td>
|
|
168
|
+
<td>cell 2</td>
|
|
169
|
+
<td>cell 3</td>
|
|
170
|
+
</tr>
|
|
171
|
+
<tr>
|
|
172
|
+
<td>cell 4</td>
|
|
173
|
+
<td>cell 5</td>
|
|
174
|
+
<td>cell 6</td>
|
|
175
|
+
</tr>
|
|
176
|
+
<tr>
|
|
177
|
+
<td>cell 7</td>
|
|
178
|
+
<td>cell 8</td>
|
|
179
|
+
<td>Cell 9</td>
|
|
180
|
+
</tr>
|
|
181
|
+
</DxcTable>
|
|
182
|
+
<Title title="Medium margin" theme="light" level={4} />
|
|
183
|
+
<DxcTable margin="medium">
|
|
184
|
+
<tr>
|
|
185
|
+
<th>header 1</th>
|
|
186
|
+
<th>header 2</th>
|
|
187
|
+
<th>header 3</th>
|
|
188
|
+
</tr>
|
|
189
|
+
<tr>
|
|
190
|
+
<td>cell 1</td>
|
|
191
|
+
<td>cell 2</td>
|
|
192
|
+
<td>cell 3</td>
|
|
193
|
+
</tr>
|
|
194
|
+
<tr>
|
|
195
|
+
<td>cell 4</td>
|
|
196
|
+
<td>cell 5</td>
|
|
197
|
+
<td>cell 6</td>
|
|
198
|
+
</tr>
|
|
199
|
+
<tr>
|
|
200
|
+
<td>cell 7</td>
|
|
201
|
+
<td>cell 8</td>
|
|
202
|
+
<td>Cell 9</td>
|
|
203
|
+
</tr>
|
|
204
|
+
</DxcTable>
|
|
205
|
+
<Title title="Large margin" theme="light" level={4} />
|
|
206
|
+
<DxcTable margin="large">
|
|
207
|
+
<tr>
|
|
208
|
+
<th>header 1</th>
|
|
209
|
+
<th>header 2</th>
|
|
210
|
+
<th>header 3</th>
|
|
211
|
+
</tr>
|
|
212
|
+
<tr>
|
|
213
|
+
<td>cell 1</td>
|
|
214
|
+
<td>cell 2</td>
|
|
215
|
+
<td>cell 3</td>
|
|
216
|
+
</tr>
|
|
217
|
+
<tr>
|
|
218
|
+
<td>cell 4</td>
|
|
219
|
+
<td>cell 5</td>
|
|
220
|
+
<td>cell 6</td>
|
|
221
|
+
</tr>
|
|
222
|
+
<tr>
|
|
223
|
+
<td>cell 7</td>
|
|
224
|
+
<td>cell 8</td>
|
|
225
|
+
<td>Cell 9</td>
|
|
226
|
+
</tr>
|
|
227
|
+
</DxcTable>
|
|
228
|
+
<Title title="Xlarge margin" theme="light" level={4} />
|
|
229
|
+
<DxcTable margin="xlarge">
|
|
230
|
+
<tr>
|
|
231
|
+
<th>header 1</th>
|
|
232
|
+
<th>header 2</th>
|
|
233
|
+
<th>header 3</th>
|
|
234
|
+
</tr>
|
|
235
|
+
<tr>
|
|
236
|
+
<td>cell 1</td>
|
|
237
|
+
<td>cell 2</td>
|
|
238
|
+
<td>cell 3</td>
|
|
239
|
+
</tr>
|
|
240
|
+
<tr>
|
|
241
|
+
<td>cell 4</td>
|
|
242
|
+
<td>cell 5</td>
|
|
243
|
+
<td>cell 6</td>
|
|
244
|
+
</tr>
|
|
245
|
+
<tr>
|
|
246
|
+
<td>cell 7</td>
|
|
247
|
+
<td>cell 8</td>
|
|
248
|
+
<td>Cell 9</td>
|
|
249
|
+
</tr>
|
|
250
|
+
</DxcTable>
|
|
251
|
+
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
252
|
+
<DxcTable margin="xxlarge">
|
|
253
|
+
<tr>
|
|
254
|
+
<th>header 1</th>
|
|
255
|
+
<th>header 2</th>
|
|
256
|
+
<th>header 3</th>
|
|
257
|
+
</tr>
|
|
258
|
+
<tr>
|
|
259
|
+
<td>cell 1</td>
|
|
260
|
+
<td>cell 2</td>
|
|
261
|
+
<td>cell 3</td>
|
|
262
|
+
</tr>
|
|
263
|
+
<tr>
|
|
264
|
+
<td>cell 4</td>
|
|
265
|
+
<td>cell 5</td>
|
|
266
|
+
<td>cell 6</td>
|
|
267
|
+
</tr>
|
|
268
|
+
<tr>
|
|
269
|
+
<td>cell 7</td>
|
|
270
|
+
<td>cell 8</td>
|
|
271
|
+
<td>Cell 9</td>
|
|
272
|
+
</tr>
|
|
273
|
+
</DxcTable>
|
|
274
|
+
</ExampleContainer>
|
|
275
|
+
</>
|
|
276
|
+
);
|