@dxc-technology/halstack-react 0.0.0-e884f9f → 0.0.0-e9cf865
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/BackgroundColorContext.d.ts +10 -0
- package/BackgroundColorContext.js +1 -3
- package/ThemeContext.d.ts +15 -0
- package/ThemeContext.js +5 -8
- package/V3Select/V3Select.js +2 -2
- package/V3Textarea/V3Textarea.js +2 -2
- package/accordion/Accordion.js +2 -2
- package/accordion-group/AccordionGroup.js +2 -2
- package/accordion-group/AccordionGroup.stories.tsx +225 -0
- package/alert/Alert.js +2 -2
- package/badge/Badge.js +1 -1
- package/box/Box.js +2 -2
- package/button/Button.d.ts +1 -1
- package/button/Button.js +6 -4
- package/button/types.d.ts +2 -2
- package/card/Card.js +1 -1
- package/checkbox/Checkbox.js +2 -2
- package/chip/Chip.d.ts +4 -0
- package/chip/Chip.js +1 -23
- package/chip/types.d.ts +53 -0
- package/chip/types.js +5 -0
- package/common/variables.js +19 -22
- package/date/Date.js +1 -1
- package/date-input/DateInput.js +4 -7
- package/dialog/Dialog.js +2 -2
- package/dropdown/Dropdown.js +1 -1
- package/dropdown/types.d.ts +1 -1
- package/file-input/FileInput.d.ts +1 -1
- package/file-input/FileInput.js +58 -48
- package/file-input/FileItem.js +8 -6
- package/file-input/types.d.ts +32 -7
- package/footer/Footer.d.ts +1 -1
- package/footer/Footer.js +11 -17
- package/footer/{Footer.stories.jsx → Footer.stories.tsx} +1 -22
- package/footer/Icons.d.ts +2 -0
- package/footer/Icons.js +3 -3
- package/footer/types.d.ts +21 -17
- package/header/Header.js +2 -2
- package/header/Icons.d.ts +2 -0
- package/heading/Heading.js +1 -1
- package/input-text/InputText.js +2 -2
- package/layout/ApplicationLayout.d.ts +10 -0
- package/layout/ApplicationLayout.js +8 -18
- package/layout/ApplicationLayout.stories.tsx +171 -0
- package/layout/types.d.ts +57 -0
- package/layout/types.js +5 -0
- package/link/Link.js +1 -1
- package/list/List.d.ts +7 -0
- package/list/List.js +37 -0
- package/list/List.stories.tsx +70 -0
- package/main.d.ts +7 -3
- package/main.js +34 -2
- package/number-input/NumberInput.js +3 -6
- 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/paginator/Paginator.js +2 -8
- package/password-input/PasswordInput.js +19 -18
- package/password-input/types.d.ts +17 -10
- package/progress-bar/ProgressBar.js +2 -2
- package/radio/Radio.js +2 -2
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/resultsetTable/ResultsetTable.js +4 -27
- package/resultsetTable/types.d.ts +67 -0
- package/resultsetTable/types.js +5 -0
- package/row/Row.d.ts +11 -0
- package/row/Row.js +124 -0
- package/row/Row.stories.tsx +223 -0
- package/select/Select.js +15 -17
- package/sidenav/Sidenav.js +2 -2
- package/slider/Slider.js +4 -4
- package/spinner/Spinner.js +2 -2
- package/stack/Stack.d.ts +10 -0
- package/stack/Stack.js +94 -0
- package/stack/Stack.stories.tsx +150 -0
- package/switch/Switch.js +2 -2
- package/table/Table.js +3 -3
- package/tabs/Tabs.js +1 -1
- package/tabs/Tabs.stories.tsx +121 -0
- package/tabs/types.d.ts +1 -1
- package/tag/Tag.js +1 -1
- package/text/Text.d.ts +7 -0
- package/text/Text.js +30 -0
- package/text/Text.stories.tsx +19 -0
- package/text-input/TextInput.d.ts +4 -0
- package/text-input/TextInput.js +42 -81
- 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 +29 -32
- package/textarea/index.d.ts +18 -8
- package/toggle/Toggle.js +1 -1
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/toggle-group/ToggleGroup.js +8 -34
- package/toggle-group/types.d.ts +84 -0
- package/toggle-group/types.js +5 -0
- package/upload/buttons-upload/ButtonsUpload.js +2 -2
- package/upload/dragAndDropArea/DragAndDropArea.js +2 -2
- package/upload/file-upload/FileToUpload.js +1 -1
- package/upload/files-upload/FilesToUpload.js +1 -1
- package/upload/transaction/Transaction.js +2 -2
- package/upload/transactions/Transactions.js +1 -1
- package/useTheme.d.ts +2 -0
- package/useTheme.js +1 -1
- package/wizard/Wizard.js +2 -2
- package/wizard/types.d.ts +1 -1
- package/chip/index.d.ts +0 -22
- package/resultsetTable/index.d.ts +0 -19
- package/text-input/index.d.ts +0 -135
- package/toggle-group/index.d.ts +0 -21
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Title from "../../.storybook/components/Title";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import DxcRow from "./Row";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Row",
|
|
8
|
+
component: DxcRow,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Chromatic = () => (
|
|
12
|
+
<>
|
|
13
|
+
<Title title="Default" theme="light" level={4} />
|
|
14
|
+
<Container>
|
|
15
|
+
<DxcRow>
|
|
16
|
+
<Placeholder></Placeholder>
|
|
17
|
+
<Placeholder></Placeholder>
|
|
18
|
+
<Placeholder></Placeholder>
|
|
19
|
+
</DxcRow>
|
|
20
|
+
</Container>
|
|
21
|
+
<Title title="Justify = center" theme="light" level={4} />
|
|
22
|
+
<Container>
|
|
23
|
+
<DxcRow justify="center">
|
|
24
|
+
<Placeholder></Placeholder>
|
|
25
|
+
<Placeholder></Placeholder>
|
|
26
|
+
<Placeholder></Placeholder>
|
|
27
|
+
</DxcRow>
|
|
28
|
+
</Container>
|
|
29
|
+
<Title title="Justify = end" theme="light" level={4} />
|
|
30
|
+
<Container>
|
|
31
|
+
<DxcRow justify="end">
|
|
32
|
+
<Placeholder></Placeholder>
|
|
33
|
+
<Placeholder></Placeholder>
|
|
34
|
+
<Placeholder></Placeholder>
|
|
35
|
+
</DxcRow>
|
|
36
|
+
</Container>
|
|
37
|
+
<Title title="Justify = spaceAround" theme="light" level={4} />
|
|
38
|
+
<Container>
|
|
39
|
+
<DxcRow justify="spaceAround">
|
|
40
|
+
<Placeholder></Placeholder>
|
|
41
|
+
<Placeholder></Placeholder>
|
|
42
|
+
<Placeholder></Placeholder>
|
|
43
|
+
</DxcRow>
|
|
44
|
+
</Container>
|
|
45
|
+
<Title title="Justify = spaceBetween" theme="light" level={4} />
|
|
46
|
+
<Container>
|
|
47
|
+
<DxcRow justify="spaceBetween">
|
|
48
|
+
<Placeholder></Placeholder>
|
|
49
|
+
<Placeholder></Placeholder>
|
|
50
|
+
<Placeholder></Placeholder>
|
|
51
|
+
</DxcRow>
|
|
52
|
+
</Container>
|
|
53
|
+
<Title title="Justify = spaceEvenly" theme="light" level={4} />
|
|
54
|
+
<Container>
|
|
55
|
+
<DxcRow justify="spaceEvenly">
|
|
56
|
+
<Placeholder></Placeholder>
|
|
57
|
+
<Placeholder></Placeholder>
|
|
58
|
+
<Placeholder></Placeholder>
|
|
59
|
+
</DxcRow>
|
|
60
|
+
</Container>
|
|
61
|
+
<Title title="Justify = start" theme="light" level={4} />
|
|
62
|
+
<Container>
|
|
63
|
+
<DxcRow justify="start">
|
|
64
|
+
<Placeholder></Placeholder>
|
|
65
|
+
<Placeholder></Placeholder>
|
|
66
|
+
<Placeholder></Placeholder>
|
|
67
|
+
</DxcRow>
|
|
68
|
+
</Container>
|
|
69
|
+
<Title title="Align = baseline" theme="light" level={4} />
|
|
70
|
+
<Container>
|
|
71
|
+
<DxcRow align="baseline">
|
|
72
|
+
<Placeholder paddingTop={20}>test</Placeholder>
|
|
73
|
+
<Placeholder>test</Placeholder>
|
|
74
|
+
<Placeholder paddingBottom={60}>test</Placeholder>
|
|
75
|
+
</DxcRow>
|
|
76
|
+
</Container>
|
|
77
|
+
<Title title="Align = center" theme="light" level={4} />
|
|
78
|
+
<Container>
|
|
79
|
+
<DxcRow align="center">
|
|
80
|
+
<Placeholder paddingTop={20}></Placeholder>
|
|
81
|
+
<Placeholder></Placeholder>
|
|
82
|
+
<Placeholder paddingTop={60}></Placeholder>
|
|
83
|
+
</DxcRow>
|
|
84
|
+
</Container>
|
|
85
|
+
<Title title="Align = end" theme="light" level={4} />
|
|
86
|
+
<Container>
|
|
87
|
+
<DxcRow align="end">
|
|
88
|
+
<Placeholder paddingTop={20}></Placeholder>
|
|
89
|
+
<Placeholder></Placeholder>
|
|
90
|
+
<Placeholder paddingTop={60}></Placeholder>
|
|
91
|
+
</DxcRow>
|
|
92
|
+
</Container>
|
|
93
|
+
<Title title="Align = start" theme="light" level={4} />
|
|
94
|
+
<Container>
|
|
95
|
+
<DxcRow align="start">
|
|
96
|
+
<Placeholder paddingTop={20}></Placeholder>
|
|
97
|
+
<Placeholder></Placeholder>
|
|
98
|
+
<Placeholder paddingTop={60}></Placeholder>
|
|
99
|
+
</DxcRow>
|
|
100
|
+
</Container>
|
|
101
|
+
<Title title="Align = stretch" theme="light" level={4} />
|
|
102
|
+
<Container>
|
|
103
|
+
<DxcRow align="stretch">
|
|
104
|
+
<Placeholder paddingTop={20}></Placeholder>
|
|
105
|
+
<Placeholder></Placeholder>
|
|
106
|
+
<Placeholder paddingTop={60}></Placeholder>
|
|
107
|
+
</DxcRow>
|
|
108
|
+
</Container>
|
|
109
|
+
<Title title="gutter = xxsmall" theme="light" level={4} />
|
|
110
|
+
<Container>
|
|
111
|
+
<DxcRow gutter="xxsmall">
|
|
112
|
+
<Placeholder></Placeholder>
|
|
113
|
+
<Placeholder></Placeholder>
|
|
114
|
+
<Placeholder></Placeholder>
|
|
115
|
+
</DxcRow>
|
|
116
|
+
</Container>
|
|
117
|
+
<Title title="gutter = xsmall" theme="light" level={4} />
|
|
118
|
+
<Container>
|
|
119
|
+
<DxcRow gutter="xsmall">
|
|
120
|
+
<Placeholder></Placeholder>
|
|
121
|
+
<Placeholder></Placeholder>
|
|
122
|
+
<Placeholder></Placeholder>
|
|
123
|
+
</DxcRow>
|
|
124
|
+
</Container>
|
|
125
|
+
<Title title="gutter = small" theme="light" level={4} />
|
|
126
|
+
<Container>
|
|
127
|
+
<DxcRow gutter="small">
|
|
128
|
+
<Placeholder></Placeholder>
|
|
129
|
+
<Placeholder></Placeholder>
|
|
130
|
+
<Placeholder></Placeholder>
|
|
131
|
+
</DxcRow>
|
|
132
|
+
</Container>
|
|
133
|
+
<Title title="gutter = medium" theme="light" level={4} />
|
|
134
|
+
<Container>
|
|
135
|
+
<DxcRow gutter="medium">
|
|
136
|
+
<Placeholder></Placeholder>
|
|
137
|
+
<Placeholder></Placeholder>
|
|
138
|
+
<Placeholder></Placeholder>
|
|
139
|
+
</DxcRow>
|
|
140
|
+
</Container>
|
|
141
|
+
<Title title="gutter = large" theme="light" level={4} />
|
|
142
|
+
<Container>
|
|
143
|
+
<DxcRow gutter="large">
|
|
144
|
+
<Placeholder></Placeholder>
|
|
145
|
+
<Placeholder></Placeholder>
|
|
146
|
+
<Placeholder></Placeholder>
|
|
147
|
+
</DxcRow>
|
|
148
|
+
</Container>
|
|
149
|
+
<Title title="gutter = xlarge" theme="light" level={4} />
|
|
150
|
+
<Container>
|
|
151
|
+
<DxcRow gutter="xlarge">
|
|
152
|
+
<Placeholder></Placeholder>
|
|
153
|
+
<Placeholder></Placeholder>
|
|
154
|
+
<Placeholder></Placeholder>
|
|
155
|
+
</DxcRow>
|
|
156
|
+
</Container>
|
|
157
|
+
<Title title="gutter = xxlarge" theme="light" level={4} />
|
|
158
|
+
<Container>
|
|
159
|
+
<DxcRow gutter="xxlarge">
|
|
160
|
+
<Placeholder></Placeholder>
|
|
161
|
+
<Placeholder></Placeholder>
|
|
162
|
+
<Placeholder></Placeholder>
|
|
163
|
+
</DxcRow>
|
|
164
|
+
</Container>
|
|
165
|
+
<Title title="gutter = none" theme="light" level={4} />
|
|
166
|
+
<Container>
|
|
167
|
+
<DxcRow gutter="none">
|
|
168
|
+
<Placeholder></Placeholder>
|
|
169
|
+
<Placeholder></Placeholder>
|
|
170
|
+
<Placeholder></Placeholder>
|
|
171
|
+
</DxcRow>
|
|
172
|
+
</Container>
|
|
173
|
+
<Title title="reverse = false" theme="light" level={4} />
|
|
174
|
+
<Container>
|
|
175
|
+
<DxcRow reverse={false}>
|
|
176
|
+
<Placeholder>1</Placeholder>
|
|
177
|
+
<Placeholder>2</Placeholder>
|
|
178
|
+
<Placeholder>3</Placeholder>
|
|
179
|
+
</DxcRow>
|
|
180
|
+
</Container>
|
|
181
|
+
<Title title="reverse = true" theme="light" level={4} />
|
|
182
|
+
<Container>
|
|
183
|
+
<DxcRow reverse={true}>
|
|
184
|
+
<Placeholder>1</Placeholder>
|
|
185
|
+
<Placeholder>2</Placeholder>
|
|
186
|
+
<Placeholder>3</Placeholder>
|
|
187
|
+
</DxcRow>
|
|
188
|
+
</Container>
|
|
189
|
+
<Title title="wrap = true" theme="light" level={4} />
|
|
190
|
+
<Container width={300}>
|
|
191
|
+
<DxcRow wrap={true}>
|
|
192
|
+
<Placeholder>1</Placeholder>
|
|
193
|
+
<Placeholder>2</Placeholder>
|
|
194
|
+
<Placeholder>3</Placeholder>
|
|
195
|
+
</DxcRow>
|
|
196
|
+
</Container>
|
|
197
|
+
<Title title="wrap = false" theme="light" level={4} />
|
|
198
|
+
<Container width={300}>
|
|
199
|
+
<DxcRow wrap={false}>
|
|
200
|
+
<Placeholder>1</Placeholder>
|
|
201
|
+
<Placeholder>2</Placeholder>
|
|
202
|
+
<Placeholder>3</Placeholder>
|
|
203
|
+
</DxcRow>
|
|
204
|
+
</Container>
|
|
205
|
+
</>
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
const Container = styled.div`
|
|
209
|
+
background: #d0d0d0;
|
|
210
|
+
padding: 10px;
|
|
211
|
+
border-radius: 10px;
|
|
212
|
+
width: ${({ width }) => (width ? `${width}px` : "unset")};
|
|
213
|
+
`;
|
|
214
|
+
|
|
215
|
+
const Placeholder = styled.div`
|
|
216
|
+
min-height: 80px;
|
|
217
|
+
min-width: 120px;
|
|
218
|
+
border: 1px solid #fabada;
|
|
219
|
+
background-color: #fff7fb;
|
|
220
|
+
border-radius: 5px;
|
|
221
|
+
padding-top: ${({ paddingTop }) => `${paddingTop ?? 0}px`};
|
|
222
|
+
padding-bottom: ${({ paddingBottom }) => `${paddingBottom ?? 0}px`};
|
|
223
|
+
`;
|
package/select/Select.js
CHANGED
|
@@ -21,7 +21,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
21
21
|
|
|
22
22
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
23
23
|
|
|
24
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
24
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
25
25
|
|
|
26
26
|
var _variables = require("../common/variables.js");
|
|
27
27
|
|
|
@@ -201,14 +201,12 @@ var getSelectedOption = function getSelectedOption(options, multiple, optional,
|
|
|
201
201
|
var DxcSelect = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
202
202
|
var _selectedOption$label;
|
|
203
203
|
|
|
204
|
-
var
|
|
205
|
-
label = _ref$label === void 0 ? "" : _ref$label,
|
|
204
|
+
var label = _ref.label,
|
|
206
205
|
_ref$name = _ref.name,
|
|
207
206
|
name = _ref$name === void 0 ? "" : _ref$name,
|
|
208
207
|
value = _ref.value,
|
|
209
208
|
options = _ref.options,
|
|
210
|
-
|
|
211
|
-
helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
|
|
209
|
+
helperText = _ref.helperText,
|
|
212
210
|
_ref$placeholder = _ref.placeholder,
|
|
213
211
|
placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
|
|
214
212
|
_ref$disabled = _ref.disabled,
|
|
@@ -221,8 +219,7 @@ var DxcSelect = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
221
219
|
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
|
|
222
220
|
onChange = _ref.onChange,
|
|
223
221
|
onBlur = _ref.onBlur,
|
|
224
|
-
|
|
225
|
-
error = _ref$error === void 0 ? "" : _ref$error,
|
|
222
|
+
error = _ref.error,
|
|
226
223
|
margin = _ref.margin,
|
|
227
224
|
_ref$size = _ref.size,
|
|
228
225
|
size = _ref$size === void 0 ? "medium" : _ref$size,
|
|
@@ -549,13 +546,14 @@ var DxcSelect = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
549
546
|
margin: margin,
|
|
550
547
|
size: size,
|
|
551
548
|
ref: ref
|
|
552
|
-
}, /*#__PURE__*/_react["default"].createElement(Label, {
|
|
549
|
+
}, label && /*#__PURE__*/_react["default"].createElement(Label, {
|
|
553
550
|
id: selectLabelId,
|
|
554
551
|
disabled: disabled,
|
|
555
552
|
onClick: function onClick() {
|
|
556
553
|
selectContainerRef.current.focus();
|
|
557
|
-
}
|
|
558
|
-
|
|
554
|
+
},
|
|
555
|
+
helperText: helperText
|
|
556
|
+
}, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, "(Optional)")), helperText && /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
559
557
|
disabled: disabled
|
|
560
558
|
}, helperText), /*#__PURE__*/_react["default"].createElement(Select, {
|
|
561
559
|
id: selectId,
|
|
@@ -633,7 +631,7 @@ var DxcSelect = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
633
631
|
}, searchable && (filteredOptions.length === 0 || !filteredGroupsHaveOptions()) ? /*#__PURE__*/_react["default"].createElement(OptionsSystemMessage, null, /*#__PURE__*/_react["default"].createElement(NoMatchesFoundIcon, null, selectIcons.searchOff), "No matches found") : optional && !multiple && /*#__PURE__*/_react["default"].createElement(Option, {
|
|
634
632
|
option: optionalEmptyOption,
|
|
635
633
|
index: 0
|
|
636
|
-
}), searchable ? filteredOptions.map(mapOptionFunc) : options.map(mapOptionFunc))), !disabled && /*#__PURE__*/_react["default"].createElement(Error, null, error)));
|
|
634
|
+
}), searchable ? filteredOptions.map(mapOptionFunc) : options.map(mapOptionFunc))), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, null, error)));
|
|
637
635
|
});
|
|
638
636
|
|
|
639
637
|
var sizes = {
|
|
@@ -661,7 +659,7 @@ var SelectContainer = _styledComponents["default"].div(_templateObject || (_temp
|
|
|
661
659
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
662
660
|
});
|
|
663
661
|
|
|
664
|
-
var Label = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n cursor: default;\n"])), function (props) {
|
|
662
|
+
var Label = _styledComponents["default"].span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n cursor: default;\n ", "\n"])), function (props) {
|
|
665
663
|
return props.disabled ? props.theme.disabledColor : props.theme.labelFontColor;
|
|
666
664
|
}, function (props) {
|
|
667
665
|
return props.theme.fontFamily;
|
|
@@ -673,13 +671,15 @@ var Label = _styledComponents["default"].span(_templateObject2 || (_templateObje
|
|
|
673
671
|
return props.theme.labelFontWeight;
|
|
674
672
|
}, function (props) {
|
|
675
673
|
return props.theme.labelLineHeight;
|
|
674
|
+
}, function (props) {
|
|
675
|
+
return !props.helperText && "margin-bottom: 0.25rem";
|
|
676
676
|
});
|
|
677
677
|
|
|
678
678
|
var OptionalLabel = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"])), function (props) {
|
|
679
679
|
return props.theme.optionalLabelFontWeight;
|
|
680
680
|
});
|
|
681
681
|
|
|
682
|
-
var HelperText = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
682
|
+
var HelperText = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-bottom: 0.25rem;\n"])), function (props) {
|
|
683
683
|
return props.disabled ? props.theme.disabledColor : props.theme.helperTextFontColor;
|
|
684
684
|
}, function (props) {
|
|
685
685
|
return props.theme.fontFamily;
|
|
@@ -693,9 +693,7 @@ var HelperText = _styledComponents["default"].span(_templateObject4 || (_templat
|
|
|
693
693
|
return props.theme.helperTextLineHeight;
|
|
694
694
|
});
|
|
695
695
|
|
|
696
|
-
var Select = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n position: relative;\n align-items: center;\n height: calc(2.5rem - 2px);\n
|
|
697
|
-
return "".concat(props.theme.inputMarginTop, " 0 ").concat(props.theme.inputMarginBottom, " 0");
|
|
698
|
-
}, function (props) {
|
|
696
|
+
var Select = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n position: relative;\n align-items: center;\n height: calc(2.5rem - 2px);\n padding: 0 0.5rem;\n outline: none;\n ", ";\n box-shadow: 0 0 0 2px transparent;\n border-radius: 4px;\n border: 1px solid\n ", ";\n ", "\n ", ";\n\n ", ";\n"])), function (props) {
|
|
699
697
|
return props.disabled && "background-color: ".concat(props.theme.disabledInputBackgroundColor);
|
|
700
698
|
}, function (props) {
|
|
701
699
|
return props.disabled ? props.theme.disabledInputBorderColor : props.theme.enabledInputBorderColor;
|
|
@@ -773,7 +771,7 @@ var ErrorIcon = _styledComponents["default"].span(_templateObject13 || (_templat
|
|
|
773
771
|
return props.theme.errorIconColor;
|
|
774
772
|
});
|
|
775
773
|
|
|
776
|
-
var Error = _styledComponents["default"].span(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["\n min-height: 1.5em;\n color: ", ";\n font-family: ", ";\n font-size: 0.75rem;\n font-weight: 400;\n"])), function (props) {
|
|
774
|
+
var Error = _styledComponents["default"].span(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["\n min-height: 1.5em;\n color: ", ";\n font-family: ", ";\n font-size: 0.75rem;\n font-weight: 400;\n line-height: 1.5em;\n margin-top: 0.25rem;\n"])), function (props) {
|
|
777
775
|
return props.theme.errorMessageColor;
|
|
778
776
|
}, function (props) {
|
|
779
777
|
return props.theme.fontFamily;
|
package/sidenav/Sidenav.js
CHANGED
|
@@ -17,9 +17,9 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
17
17
|
|
|
18
18
|
var _variables = require("../common/variables.js");
|
|
19
19
|
|
|
20
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
20
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
21
21
|
|
|
22
|
-
var _BackgroundColorContext = require("../BackgroundColorContext
|
|
22
|
+
var _BackgroundColorContext = require("../BackgroundColorContext");
|
|
23
23
|
|
|
24
24
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
25
25
|
|
package/slider/Slider.js
CHANGED
|
@@ -27,9 +27,9 @@ var _variables = require("../common/variables.js");
|
|
|
27
27
|
|
|
28
28
|
var _utils = require("../common/utils.js");
|
|
29
29
|
|
|
30
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
30
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
31
31
|
|
|
32
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext
|
|
32
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
33
33
|
|
|
34
34
|
var _uuid = require("uuid");
|
|
35
35
|
|
|
@@ -142,7 +142,7 @@ var DxcSlider = function DxcSlider(_ref) {
|
|
|
142
142
|
step: step
|
|
143
143
|
}, maxLabel), showInput && /*#__PURE__*/_react["default"].createElement(StyledTextInput, null, /*#__PURE__*/_react["default"].createElement(_TextInput["default"], {
|
|
144
144
|
name: name,
|
|
145
|
-
value: value != null && value >= 0 && value || innerValue,
|
|
145
|
+
value: value != null && value >= 0 && value.toString() || innerValue.toString(),
|
|
146
146
|
disabled: disabled,
|
|
147
147
|
onChange: handlerInputChange,
|
|
148
148
|
size: "fillParent"
|
|
@@ -187,7 +187,7 @@ var Label = _styledComponents["default"].label(_templateObject2 || (_templateObj
|
|
|
187
187
|
return props.theme.labelLineHeight;
|
|
188
188
|
});
|
|
189
189
|
|
|
190
|
-
var HelperText = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n
|
|
190
|
+
var HelperText = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
191
191
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledHelperTextFontColorOnDark : props.theme.disabledHelperTextFontColor : props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.theme.helperTextFontColor;
|
|
192
192
|
}, function (props) {
|
|
193
193
|
return props.theme.fontFamily;
|
package/spinner/Spinner.js
CHANGED
|
@@ -19,9 +19,9 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
19
19
|
|
|
20
20
|
var _variables = require("../common/variables.js");
|
|
21
21
|
|
|
22
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
22
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
23
23
|
|
|
24
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext
|
|
24
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
25
25
|
|
|
26
26
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
|
|
27
27
|
|
package/stack/Stack.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare type StackProps = {
|
|
3
|
+
gutter?: "none" | "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge" | "xxxlarge";
|
|
4
|
+
divider?: boolean;
|
|
5
|
+
align?: "start" | "center" | "end" | "baseline" | "stretch";
|
|
6
|
+
as?: React.ElementType;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export default function Stack({ gutter, divider, align, as, children }: StackProps): JSX.Element;
|
|
10
|
+
export {};
|
package/stack/Stack.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = Stack;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
|
|
16
|
+
var _templateObject, _templateObject2;
|
|
17
|
+
|
|
18
|
+
function Stack(_ref) {
|
|
19
|
+
var gutter = _ref.gutter,
|
|
20
|
+
divider = _ref.divider,
|
|
21
|
+
align = _ref.align,
|
|
22
|
+
_ref$as = _ref.as,
|
|
23
|
+
as = _ref$as === void 0 ? "div" : _ref$as,
|
|
24
|
+
children = _ref.children;
|
|
25
|
+
return /*#__PURE__*/_react["default"].createElement(StyledStack, {
|
|
26
|
+
gutter: gutter,
|
|
27
|
+
divider: divider,
|
|
28
|
+
align: align,
|
|
29
|
+
as: as
|
|
30
|
+
}, _react["default"].Children.map(children, function (child, index) {
|
|
31
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, child, divider && index !== _react["default"].Children.count(children) - 1 && /*#__PURE__*/_react["default"].createElement(Divider, null));
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
var Divider = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n height: 1px;\n background-color: #999999;\n"])));
|
|
36
|
+
|
|
37
|
+
var StyledStack = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n align-items: ", "};\n gap: ", ";\n margin: 0;\n padding: 0;\n"])), function (_ref2) {
|
|
38
|
+
var align = _ref2.align;
|
|
39
|
+
|
|
40
|
+
switch (align) {
|
|
41
|
+
case "start":
|
|
42
|
+
return "flex-start";
|
|
43
|
+
|
|
44
|
+
case "center":
|
|
45
|
+
return "center";
|
|
46
|
+
|
|
47
|
+
case "end":
|
|
48
|
+
return "flex-end";
|
|
49
|
+
|
|
50
|
+
case "baseline":
|
|
51
|
+
return "baseline";
|
|
52
|
+
|
|
53
|
+
case "stretch":
|
|
54
|
+
return "stretch";
|
|
55
|
+
|
|
56
|
+
default:
|
|
57
|
+
return "initial";
|
|
58
|
+
}
|
|
59
|
+
}, function (_ref3) {
|
|
60
|
+
var gutter = _ref3.gutter,
|
|
61
|
+
divider = _ref3.divider;
|
|
62
|
+
|
|
63
|
+
switch (gutter) {
|
|
64
|
+
case "none":
|
|
65
|
+
return "0";
|
|
66
|
+
|
|
67
|
+
case "xxsmall":
|
|
68
|
+
return "calc(0.125rem / ".concat(divider ? 2 : 1, ")");
|
|
69
|
+
|
|
70
|
+
case "xsmall":
|
|
71
|
+
return "calc(0.25rem / ".concat(divider ? 2 : 1, ")");
|
|
72
|
+
|
|
73
|
+
case "small":
|
|
74
|
+
return "calc(0.5rem / ".concat(divider ? 2 : 1, ")");
|
|
75
|
+
|
|
76
|
+
case "medium":
|
|
77
|
+
return "calc(1rem / ".concat(divider ? 2 : 1, ")");
|
|
78
|
+
|
|
79
|
+
case "large":
|
|
80
|
+
return "calc(1.5rem / ".concat(divider ? 2 : 1, ")");
|
|
81
|
+
|
|
82
|
+
case "xlarge":
|
|
83
|
+
return "calc(2rem / ".concat(divider ? 2 : 1, ")");
|
|
84
|
+
|
|
85
|
+
case "xxlarge":
|
|
86
|
+
return "calc(3rem / ".concat(divider ? 2 : 1, ")");
|
|
87
|
+
|
|
88
|
+
case "xxxlarge":
|
|
89
|
+
return "calc(4rem / ".concat(divider ? 2 : 1, ")");
|
|
90
|
+
|
|
91
|
+
default:
|
|
92
|
+
return "0";
|
|
93
|
+
}
|
|
94
|
+
});
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Title from "../../.storybook/components/Title";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import DxcStack from "./Stack";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Stack",
|
|
8
|
+
component: DxcStack,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Chromatic = () => (
|
|
12
|
+
<>
|
|
13
|
+
<Title title="Default" theme="light" level={4} />
|
|
14
|
+
<Container>
|
|
15
|
+
<DxcStack>
|
|
16
|
+
<Placeholder></Placeholder>
|
|
17
|
+
<Placeholder></Placeholder>
|
|
18
|
+
<Placeholder></Placeholder>
|
|
19
|
+
</DxcStack>
|
|
20
|
+
</Container>
|
|
21
|
+
<Title title="Align = baseline" theme="light" level={4} />
|
|
22
|
+
<Container>
|
|
23
|
+
<DxcStack align="baseline">
|
|
24
|
+
<Placeholder paddingLeft={20}></Placeholder>
|
|
25
|
+
<Placeholder></Placeholder>
|
|
26
|
+
<Placeholder paddingRight={60}></Placeholder>
|
|
27
|
+
</DxcStack>
|
|
28
|
+
</Container>
|
|
29
|
+
<Title title="Align = center" theme="light" level={4} />
|
|
30
|
+
<Container>
|
|
31
|
+
<DxcStack align="center">
|
|
32
|
+
<Placeholder paddingLeft={20}></Placeholder>
|
|
33
|
+
<Placeholder></Placeholder>
|
|
34
|
+
<Placeholder paddingLeft={60}></Placeholder>
|
|
35
|
+
</DxcStack>
|
|
36
|
+
</Container>
|
|
37
|
+
<Title title="Align = end" theme="light" level={4} />
|
|
38
|
+
<Container>
|
|
39
|
+
<DxcStack align="end">
|
|
40
|
+
<Placeholder paddingLeft={20}></Placeholder>
|
|
41
|
+
<Placeholder></Placeholder>
|
|
42
|
+
<Placeholder paddingLeft={60}></Placeholder>
|
|
43
|
+
</DxcStack>
|
|
44
|
+
</Container>
|
|
45
|
+
<Title title="Align = start" theme="light" level={4} />
|
|
46
|
+
<Container>
|
|
47
|
+
<DxcStack align="start">
|
|
48
|
+
<Placeholder paddingLeft={20}></Placeholder>
|
|
49
|
+
<Placeholder></Placeholder>
|
|
50
|
+
<Placeholder paddingLeft={60}></Placeholder>
|
|
51
|
+
</DxcStack>
|
|
52
|
+
</Container>
|
|
53
|
+
<Title title="Align = stretch" theme="light" level={4} />
|
|
54
|
+
<Container>
|
|
55
|
+
<DxcStack align="stretch">
|
|
56
|
+
<Placeholder paddingLeft={20}></Placeholder>
|
|
57
|
+
<Placeholder></Placeholder>
|
|
58
|
+
<Placeholder paddingLeft={60}></Placeholder>
|
|
59
|
+
</DxcStack>
|
|
60
|
+
</Container>
|
|
61
|
+
<Title title="gutter = xxsmall" theme="light" level={4} />
|
|
62
|
+
<Container>
|
|
63
|
+
<DxcStack gutter="xxsmall">
|
|
64
|
+
<Placeholder></Placeholder>
|
|
65
|
+
<Placeholder></Placeholder>
|
|
66
|
+
<Placeholder></Placeholder>
|
|
67
|
+
</DxcStack>
|
|
68
|
+
</Container>
|
|
69
|
+
<Title title="gutter = xsmall" theme="light" level={4} />
|
|
70
|
+
<Container>
|
|
71
|
+
<DxcStack gutter="xsmall">
|
|
72
|
+
<Placeholder></Placeholder>
|
|
73
|
+
<Placeholder></Placeholder>
|
|
74
|
+
<Placeholder></Placeholder>
|
|
75
|
+
</DxcStack>
|
|
76
|
+
</Container>
|
|
77
|
+
<Title title="gutter = small" theme="light" level={4} />
|
|
78
|
+
<Container>
|
|
79
|
+
<DxcStack gutter="small">
|
|
80
|
+
<Placeholder></Placeholder>
|
|
81
|
+
<Placeholder></Placeholder>
|
|
82
|
+
<Placeholder></Placeholder>
|
|
83
|
+
</DxcStack>
|
|
84
|
+
</Container>
|
|
85
|
+
<Title title="gutter = medium" theme="light" level={4} />
|
|
86
|
+
<Container>
|
|
87
|
+
<DxcStack gutter="medium">
|
|
88
|
+
<Placeholder></Placeholder>
|
|
89
|
+
<Placeholder></Placeholder>
|
|
90
|
+
<Placeholder></Placeholder>
|
|
91
|
+
</DxcStack>
|
|
92
|
+
</Container>
|
|
93
|
+
<Title title="gutter = large" theme="light" level={4} />
|
|
94
|
+
<Container>
|
|
95
|
+
<DxcStack gutter="large">
|
|
96
|
+
<Placeholder></Placeholder>
|
|
97
|
+
<Placeholder></Placeholder>
|
|
98
|
+
<Placeholder></Placeholder>
|
|
99
|
+
</DxcStack>
|
|
100
|
+
</Container>
|
|
101
|
+
<Title title="gutter = xlarge" theme="light" level={4} />
|
|
102
|
+
<Container>
|
|
103
|
+
<DxcStack gutter="xlarge">
|
|
104
|
+
<Placeholder></Placeholder>
|
|
105
|
+
<Placeholder></Placeholder>
|
|
106
|
+
<Placeholder></Placeholder>
|
|
107
|
+
</DxcStack>
|
|
108
|
+
</Container>
|
|
109
|
+
<Title title="gutter = xxlarge" theme="light" level={4} />
|
|
110
|
+
<Container>
|
|
111
|
+
<DxcStack gutter="xxlarge">
|
|
112
|
+
<Placeholder></Placeholder>
|
|
113
|
+
<Placeholder></Placeholder>
|
|
114
|
+
<Placeholder></Placeholder>
|
|
115
|
+
</DxcStack>
|
|
116
|
+
</Container>
|
|
117
|
+
<Title title="gutter = xxlarge && divider" theme="light" level={4} />
|
|
118
|
+
<Container>
|
|
119
|
+
<DxcStack gutter="xxlarge" divider>
|
|
120
|
+
<Placeholder></Placeholder>
|
|
121
|
+
<Placeholder></Placeholder>
|
|
122
|
+
<Placeholder></Placeholder>
|
|
123
|
+
</DxcStack>
|
|
124
|
+
</Container>
|
|
125
|
+
<Title title="gutter = none" theme="light" level={4} />
|
|
126
|
+
<Container>
|
|
127
|
+
<DxcStack gutter="none">
|
|
128
|
+
<Placeholder></Placeholder>
|
|
129
|
+
<Placeholder></Placeholder>
|
|
130
|
+
<Placeholder></Placeholder>
|
|
131
|
+
</DxcStack>
|
|
132
|
+
</Container>
|
|
133
|
+
</>
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
const Container = styled.div`
|
|
137
|
+
background: #d0d0d0;
|
|
138
|
+
padding: 10px;
|
|
139
|
+
border-radius: 10px;
|
|
140
|
+
`;
|
|
141
|
+
|
|
142
|
+
const Placeholder = styled.div`
|
|
143
|
+
min-height: 80px;
|
|
144
|
+
min-width: 120px;
|
|
145
|
+
border: 1px solid #fabada;
|
|
146
|
+
background-color: #fff7fb;
|
|
147
|
+
border-radius: 5px;
|
|
148
|
+
padding-left: ${({ paddingLeft }) => `${paddingLeft ?? 0}px`};
|
|
149
|
+
padding-right: ${({ paddingRight }) => `${paddingRight ?? 0}px`};
|
|
150
|
+
`;
|
package/switch/Switch.js
CHANGED
|
@@ -27,9 +27,9 @@ var _variables = require("../common/variables.js");
|
|
|
27
27
|
|
|
28
28
|
var _utils = require("../common/utils.js");
|
|
29
29
|
|
|
30
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
30
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
31
31
|
|
|
32
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext
|
|
32
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
33
33
|
|
|
34
34
|
var _templateObject, _templateObject2;
|
|
35
35
|
|