@dxc-technology/halstack-react 0.0.0-e30cba6 → 0.0.0-e832ef8
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/dist/ThemeContext.js +69 -61
- package/dist/V3Textarea/V3Textarea.js +264 -0
- package/dist/alert/Alert.js +5 -5
- package/dist/alert/index.d.ts +51 -0
- package/dist/button/Button.js +1 -1
- package/dist/common/variables.js +341 -139
- package/dist/date/Date.js +10 -12
- package/dist/{new-date/NewDate.js → date-input/DateInput.js} +69 -72
- package/dist/date-input/index.d.ts +95 -0
- package/dist/file-input/FileInput.js +644 -0
- package/dist/file-input/FileItem.js +280 -0
- package/dist/file-input/index.d.ts +81 -0
- package/dist/footer/Footer.js +44 -18
- package/dist/footer/Icons.js +77 -0
- package/dist/header/Header.js +80 -49
- package/dist/header/Icons.js +59 -0
- package/dist/input-text/Icons.js +22 -0
- package/dist/input-text/InputText.js +7 -9
- package/dist/layout/ApplicationLayout.js +5 -9
- package/dist/layout/Icons.js +55 -0
- package/dist/link/Link.js +4 -8
- package/dist/main.d.ts +8 -0
- package/dist/main.js +37 -21
- package/dist/new-select/NewSelect.js +836 -0
- package/dist/new-select/index.d.ts +53 -0
- package/dist/{number/Number.js → number-input/NumberInput.js} +9 -11
- package/dist/{number/NumberContext.js → number-input/NumberInputContext.js} +2 -2
- package/dist/number-input/index.d.ts +113 -0
- package/dist/paginator/Icons.js +66 -0
- package/dist/paginator/Paginator.js +5 -11
- package/dist/{password/Password.js → password-input/PasswordInput.js} +11 -13
- package/dist/password-input/index.d.ts +94 -0
- package/dist/progress-bar/ProgressBar.js +1 -1
- package/dist/select/Select.js +122 -158
- package/dist/sidenav/Sidenav.js +6 -4
- package/dist/slider/Slider.js +104 -19
- package/dist/spinner/Spinner.js +217 -54
- package/dist/tag/Tag.js +26 -32
- package/dist/{new-input-text/NewInputText.js → text-input/TextInput.js} +180 -170
- package/dist/text-input/index.d.ts +135 -0
- package/dist/textarea/Textarea.js +227 -122
- package/dist/textarea/index.d.ts +117 -0
- package/dist/toggle-group/ToggleGroup.js +132 -28
- package/dist/upload/Upload.js +3 -3
- package/dist/upload/buttons-upload/ButtonsUpload.js +7 -11
- package/dist/upload/buttons-upload/Icons.js +40 -0
- package/dist/upload/file-upload/FileToUpload.js +26 -21
- package/dist/upload/file-upload/Icons.js +66 -0
- package/dist/upload/readme.md +2 -2
- package/dist/upload/transaction/Icons.js +160 -0
- package/dist/upload/transaction/Transaction.js +11 -38
- package/dist/wizard/Icons.js +65 -0
- package/dist/wizard/Wizard.js +3 -9
- package/package.json +2 -1
- package/test/Date.test.js +48 -44
- package/test/{NewDate.test.js → DateInput.test.js} +66 -27
- package/test/FileInput.test.js +201 -0
- package/test/Footer.test.js +2 -7
- package/test/Header.test.js +5 -10
- package/test/InputText.test.js +24 -16
- package/test/{Number.test.js → NumberInput.test.js} +84 -66
- package/test/Paginator.test.js +1 -1
- package/test/PasswordInput.test.js +83 -0
- package/test/ResultsetTable.test.js +1 -2
- package/test/Select.test.js +40 -17
- package/test/Slider.test.js +9 -17
- package/test/Spinner.test.js +5 -0
- package/test/{NewInputText.test.js → TextInput.test.js} +146 -231
- package/test/Textarea.test.js +193 -0
- package/test/ToggleGroup.test.js +5 -1
- package/test/Upload.test.js +5 -5
- package/test/{TextArea.test.js → V3TextArea.test.js} +6 -7
- package/dist/footer/Footer.stories.js +0 -94
- package/dist/footer/dxc_logo.svg +0 -15
- package/dist/footer/readme.md +0 -41
- package/dist/header/Header.stories.js +0 -176
- package/dist/header/close_icon.svg +0 -1
- package/dist/header/dxc_logo_black.svg +0 -8
- package/dist/header/hamb_menu_black.svg +0 -1
- package/dist/header/hamb_menu_white.svg +0 -1
- package/dist/header/readme.md +0 -33
- package/dist/input-text/InputText.stories.js +0 -209
- package/dist/input-text/error.svg +0 -1
- package/dist/input-text/readme.md +0 -91
- package/dist/layout/facebook.svg +0 -45
- package/dist/layout/linkedin.svg +0 -50
- package/dist/layout/twitter.svg +0 -53
- package/dist/new-textarea/NewTextarea.js +0 -346
- package/dist/paginator/images/next.svg +0 -3
- package/dist/paginator/images/nextPage.svg +0 -3
- package/dist/paginator/images/previous.svg +0 -3
- package/dist/paginator/images/previousPage.svg +0 -3
- package/dist/paginator/readme.md +0 -50
- package/dist/password/styles.css +0 -3
- package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
- package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
- package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
- package/dist/select/Select.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
- package/dist/upload/buttons-upload/upload-button.svg +0 -1
- package/dist/upload/file-upload/audio-icon.svg +0 -4
- package/dist/upload/file-upload/close.svg +0 -4
- package/dist/upload/file-upload/file-icon.svg +0 -4
- package/dist/upload/file-upload/video-icon.svg +0 -4
- package/dist/upload/transaction/audio-icon-err.svg +0 -4
- package/dist/upload/transaction/audio-icon.svg +0 -4
- package/dist/upload/transaction/error-icon.svg +0 -4
- package/dist/upload/transaction/file-icon-err.svg +0 -4
- package/dist/upload/transaction/file-icon.svg +0 -4
- package/dist/upload/transaction/image-icon-err.svg +0 -4
- package/dist/upload/transaction/image-icon.svg +0 -4
- package/dist/upload/transaction/success-icon.svg +0 -4
- package/dist/upload/transaction/video-icon-err.svg +0 -4
- package/dist/upload/transaction/video-icon.svg +0 -4
- package/dist/wizard/invalid_icon.svg +0 -5
- package/dist/wizard/valid_icon.svg +0 -5
- package/dist/wizard/validation-wrong.svg +0 -6
- package/test/NewTextarea.test.js +0 -201
- package/test/Password.test.js +0 -76
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
type Size = "small" | "medium" | "large" | "fillParent";
|
|
2
|
+
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
type Margin = {
|
|
4
|
+
top?: Space;
|
|
5
|
+
bottom?: Space;
|
|
6
|
+
left?: Space;
|
|
7
|
+
right?: Space;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type Props = {
|
|
11
|
+
/**
|
|
12
|
+
* Text to be placed above the textarea.
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Name attribute of the textarea element.
|
|
17
|
+
*/
|
|
18
|
+
name?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Value of the textarea. If undefined, the component will be uncontrolled and the value will be managed internally.
|
|
21
|
+
*/
|
|
22
|
+
value?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Helper text to be placed above the textarea.
|
|
25
|
+
*/
|
|
26
|
+
helperText?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Text to be put as placeholder of the textarea.
|
|
29
|
+
*/
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
/**
|
|
32
|
+
* If true, the component will be disabled.
|
|
33
|
+
*/
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* If true, the textarea will be optional, showing '(Optional)'
|
|
37
|
+
* next to the label. Otherwise, the field will be considered required
|
|
38
|
+
* and an error will be passed as a parameter to the OnBlur and onChange functions
|
|
39
|
+
* when it has not been filled.
|
|
40
|
+
*/
|
|
41
|
+
optional?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Defines the textarea's ability to resize vertically. It can be:
|
|
44
|
+
* - 'auto': The textarea grows or shrinks automatically in order to fit the content.
|
|
45
|
+
* - 'manual': The height of the textarea is enabled to be manually modified.
|
|
46
|
+
* - 'none': The textarea has a fixed height and can't be modified.
|
|
47
|
+
*/
|
|
48
|
+
verticalGrow?: "auto" | "manual" | "none";
|
|
49
|
+
/**
|
|
50
|
+
* Number of rows of the textarea.
|
|
51
|
+
*/
|
|
52
|
+
rows?: number;
|
|
53
|
+
/**
|
|
54
|
+
* This function will be called when the user types within the textarea.
|
|
55
|
+
* An object including the current value and the error (if the value
|
|
56
|
+
* entered is not valid) will be passed to this function.
|
|
57
|
+
* If there is no error, error will be null.
|
|
58
|
+
*/
|
|
59
|
+
onChange?: (val: { value: string; error: string }) => void;
|
|
60
|
+
/**
|
|
61
|
+
* This function will be called when the textarea loses the focus. An
|
|
62
|
+
* object including the textarea value and the error (if the value entered
|
|
63
|
+
* is not valid) will be passed to this function. If there is no error,
|
|
64
|
+
* error will be null.
|
|
65
|
+
*/
|
|
66
|
+
onBlur?: (val: { value: string; error: string }) => void;
|
|
67
|
+
/**
|
|
68
|
+
* If it is defined, the component will change its appearance, showing
|
|
69
|
+
* the error below the textarea. If it is not defined, the error
|
|
70
|
+
* messages will be managed internally, but never displayed on its own.
|
|
71
|
+
*/
|
|
72
|
+
error?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Regular expression that defines the valid format allowed by the
|
|
75
|
+
* textarea. This will be checked both when the textarea loses the focus
|
|
76
|
+
* and while typing within it. If the string entered does not match the
|
|
77
|
+
* pattern, the onBlur and onChange functions will be called with the
|
|
78
|
+
* current value and an internal error informing that this value does not
|
|
79
|
+
* match the pattern. If the pattern is met, the error parameter of both
|
|
80
|
+
* events will be null.
|
|
81
|
+
*/
|
|
82
|
+
pattern?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Specifies the minimun and maximum length allowed by the textarea.
|
|
85
|
+
* This will be checked both when the textarea loses the
|
|
86
|
+
* focus and while typing within it. If the string entered does not
|
|
87
|
+
* comply the length, the onBlur and onChange functions will be called
|
|
88
|
+
* with the current value and an internal error informing that the value
|
|
89
|
+
* length does not comply the specified range. If a valid length is
|
|
90
|
+
* reached, the error parameter of both events will be null.
|
|
91
|
+
*/
|
|
92
|
+
length?: { min: number; max: number };
|
|
93
|
+
/**
|
|
94
|
+
* HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the textarea value.
|
|
95
|
+
* Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
|
|
96
|
+
*/
|
|
97
|
+
autocomplete?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
100
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
101
|
+
*/
|
|
102
|
+
margin?: Space | Margin;
|
|
103
|
+
/**
|
|
104
|
+
* Size of the component ('small' | 'medium' | 'large' | 'fillParent').
|
|
105
|
+
*/
|
|
106
|
+
size?: Size;
|
|
107
|
+
/**
|
|
108
|
+
* Value of the tabindex attribute.
|
|
109
|
+
*/
|
|
110
|
+
tabIndex?: number;
|
|
111
|
+
/**
|
|
112
|
+
* Reference to the component.
|
|
113
|
+
*/
|
|
114
|
+
ref?: React.RefObject<HTMLDivElement>;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export default function DxcTextarea(props: Props): JSX.Element;
|
|
@@ -21,14 +21,56 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
21
21
|
|
|
22
22
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
23
23
|
|
|
24
|
+
var _uuid = require("uuid");
|
|
25
|
+
|
|
24
26
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
27
|
|
|
26
28
|
var _variables = require("../common/variables.js");
|
|
27
29
|
|
|
28
30
|
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
29
31
|
|
|
32
|
+
function _templateObject9() {
|
|
33
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: ", ";\n height: 24px;\n width: 24px;\n overflow: hidden;\n display: flex;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
|
|
34
|
+
|
|
35
|
+
_templateObject9 = function _templateObject9() {
|
|
36
|
+
return data;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return data;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function _templateObject8() {
|
|
43
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: 24px;\n width: 24px;\n margin-right: ", ";\n"]);
|
|
44
|
+
|
|
45
|
+
_templateObject8 = function _templateObject8() {
|
|
46
|
+
return data;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return data;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function _templateObject7() {
|
|
53
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n"]);
|
|
54
|
+
|
|
55
|
+
_templateObject7 = function _templateObject7() {
|
|
56
|
+
return data;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return data;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function _templateObject6() {
|
|
63
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"]);
|
|
64
|
+
|
|
65
|
+
_templateObject6 = function _templateObject6() {
|
|
66
|
+
return data;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return data;
|
|
70
|
+
}
|
|
71
|
+
|
|
30
72
|
function _templateObject5() {
|
|
31
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
73
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-right: ", ";\n\n ", "\n"]);
|
|
32
74
|
|
|
33
75
|
_templateObject5 = function _templateObject5() {
|
|
34
76
|
return data;
|
|
@@ -38,7 +80,7 @@ function _templateObject5() {
|
|
|
38
80
|
}
|
|
39
81
|
|
|
40
82
|
function _templateObject4() {
|
|
41
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n
|
|
83
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n opacity: 1;\n height: calc(48px - 4px - 4px);\n border-width: ", ";\n border-style: ", ";\n border-radius: ", ";\n border-color: ", ";\n background-color: ", ";\n padding: 4px;\n margin-top: ", ";\n"]);
|
|
42
84
|
|
|
43
85
|
_templateObject4 = function _templateObject4() {
|
|
44
86
|
return data;
|
|
@@ -48,7 +90,7 @@ function _templateObject4() {
|
|
|
48
90
|
}
|
|
49
91
|
|
|
50
92
|
function _templateObject3() {
|
|
51
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
93
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n flex-direction: column;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
|
|
52
94
|
|
|
53
95
|
_templateObject3 = function _templateObject3() {
|
|
54
96
|
return data;
|
|
@@ -58,7 +100,7 @@ function _templateObject3() {
|
|
|
58
100
|
}
|
|
59
101
|
|
|
60
102
|
function _templateObject2() {
|
|
61
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
103
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
|
|
62
104
|
|
|
63
105
|
_templateObject2 = function _templateObject2() {
|
|
64
106
|
return data;
|
|
@@ -68,7 +110,7 @@ function _templateObject2() {
|
|
|
68
110
|
}
|
|
69
111
|
|
|
70
112
|
function _templateObject() {
|
|
71
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
113
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
|
|
72
114
|
|
|
73
115
|
_templateObject = function _templateObject() {
|
|
74
116
|
return data;
|
|
@@ -78,7 +120,9 @@ function _templateObject() {
|
|
|
78
120
|
}
|
|
79
121
|
|
|
80
122
|
var DxcToggleGroup = function DxcToggleGroup(_ref) {
|
|
81
|
-
var
|
|
123
|
+
var label = _ref.label,
|
|
124
|
+
helperText = _ref.helperText,
|
|
125
|
+
value = _ref.value,
|
|
82
126
|
onChange = _ref.onChange,
|
|
83
127
|
_ref$disabled = _ref.disabled,
|
|
84
128
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
@@ -96,6 +140,10 @@ var DxcToggleGroup = function DxcToggleGroup(_ref) {
|
|
|
96
140
|
selectedValue = _useState2[0],
|
|
97
141
|
setSelectedValue = _useState2[1];
|
|
98
142
|
|
|
143
|
+
var _useState3 = (0, _react.useState)("toggle-group-".concat((0, _uuid.v4)())),
|
|
144
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 1),
|
|
145
|
+
toggleGroupId = _useState4[0];
|
|
146
|
+
|
|
99
147
|
var handleToggleChange = function handleToggleChange(selectedOption) {
|
|
100
148
|
var newSelectedOptions;
|
|
101
149
|
|
|
@@ -139,9 +187,19 @@ var DxcToggleGroup = function DxcToggleGroup(_ref) {
|
|
|
139
187
|
}, _react["default"].createElement(ToggleGroup, {
|
|
140
188
|
margin: margin,
|
|
141
189
|
disabled: disabled
|
|
190
|
+
}, _react["default"].createElement(Label, {
|
|
191
|
+
htmlFor: toggleGroupId,
|
|
192
|
+
disabled: disabled
|
|
193
|
+
}, label), _react["default"].createElement(HelperText, {
|
|
194
|
+
disabled: disabled
|
|
195
|
+
}, helperText), _react["default"].createElement(OptionsContainer, {
|
|
196
|
+
id: toggleGroupId,
|
|
197
|
+
role: multiple ? "group" : "radiogroup"
|
|
142
198
|
}, options.map(function (option, i) {
|
|
143
199
|
return _react["default"].createElement(ToggleContainer, {
|
|
144
200
|
selected: multiple ? value ? value.includes(option.value) : selectedValue.includes(option.value) : value ? option.value === value : option.value === selectedValue,
|
|
201
|
+
role: multiple ? "switch" : "radio",
|
|
202
|
+
"aria-checked": multiple ? value ? value.includes(option.value) : selectedValue.includes(option.value) : value ? option.value === value : option.value === selectedValue,
|
|
145
203
|
tabIndex: !disabled ? tabIndex : -1,
|
|
146
204
|
onClick: function onClick() {
|
|
147
205
|
return !disabled && handleToggleChange(option.value);
|
|
@@ -149,20 +207,50 @@ var DxcToggleGroup = function DxcToggleGroup(_ref) {
|
|
|
149
207
|
isFirst: i === 0,
|
|
150
208
|
isLast: i === options.length - 1,
|
|
151
209
|
isIcon: option.iconSrc || option.icon,
|
|
210
|
+
optionLabel: option.label,
|
|
152
211
|
disabled: disabled,
|
|
153
212
|
onKeyPress: function onKeyPress(event) {
|
|
154
213
|
handleKeyPress(event, option.value);
|
|
155
214
|
},
|
|
156
215
|
key: "toggle-".concat(i, "-").concat(option.label)
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
}) : _react["default"].createElement(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
216
|
+
}, _react["default"].createElement(OptionContent, null, option.icon && _react["default"].createElement(IconContainer, {
|
|
217
|
+
optionLabel: option.label
|
|
218
|
+
}, (0, _typeof2["default"])(option.icon) === "object" ? option.icon : _react["default"].createElement(option.icon)), option.iconSrc && _react["default"].createElement(Icon, {
|
|
219
|
+
src: option.iconSrc,
|
|
220
|
+
optionLabel: option.label
|
|
221
|
+
}), option.label && _react["default"].createElement(LabelContainer, null, option.label)));
|
|
222
|
+
}))));
|
|
163
223
|
};
|
|
164
224
|
|
|
165
|
-
var
|
|
225
|
+
var Label = _styledComponents["default"].label(_templateObject(), function (props) {
|
|
226
|
+
return props.disabled ? props.theme.disabledLabelFontColor : props.theme.labelFontColor;
|
|
227
|
+
}, function (props) {
|
|
228
|
+
return props.theme.labelFontFamily;
|
|
229
|
+
}, function (props) {
|
|
230
|
+
return props.theme.labelFontSize;
|
|
231
|
+
}, function (props) {
|
|
232
|
+
return props.theme.labelFontStyle;
|
|
233
|
+
}, function (props) {
|
|
234
|
+
return props.theme.labelFontWeight;
|
|
235
|
+
}, function (props) {
|
|
236
|
+
return props.theme.labelLineHeight;
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
var HelperText = _styledComponents["default"].span(_templateObject2(), function (props) {
|
|
240
|
+
return props.disabled ? props.theme.disabledHelperTextFontcolor : props.theme.helperTextFontColor;
|
|
241
|
+
}, function (props) {
|
|
242
|
+
return props.theme.helperTextFontFamily;
|
|
243
|
+
}, function (props) {
|
|
244
|
+
return props.theme.helperTextFontSize;
|
|
245
|
+
}, function (props) {
|
|
246
|
+
return props.theme.helperTextFontStyle;
|
|
247
|
+
}, function (props) {
|
|
248
|
+
return props.theme.helperTextFontWeight;
|
|
249
|
+
}, function (props) {
|
|
250
|
+
return props.theme.helperTextLineHeight;
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
var ToggleGroup = _styledComponents["default"].div(_templateObject3(), function (props) {
|
|
166
254
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
167
255
|
}, function (props) {
|
|
168
256
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
@@ -174,33 +262,49 @@ var ToggleGroup = _styledComponents["default"].div(_templateObject(), function (
|
|
|
174
262
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
175
263
|
});
|
|
176
264
|
|
|
177
|
-
var
|
|
178
|
-
return
|
|
179
|
-
})
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
return props.theme.
|
|
265
|
+
var OptionsContainer = _styledComponents["default"].div(_templateObject4(), function (props) {
|
|
266
|
+
return props.theme.containerBorderThickness;
|
|
267
|
+
}, function (props) {
|
|
268
|
+
return props.theme.containerBorderStyle;
|
|
269
|
+
}, function (props) {
|
|
270
|
+
return props.theme.containerBorderRadius;
|
|
183
271
|
}, function (props) {
|
|
184
|
-
return props.theme.
|
|
272
|
+
return props.theme.containerBorderColor;
|
|
185
273
|
}, function (props) {
|
|
186
|
-
return props.theme.
|
|
274
|
+
return props.theme.containerBackgroundColor;
|
|
187
275
|
}, function (props) {
|
|
188
|
-
return props.theme.
|
|
276
|
+
return props.theme.containerMarginTop;
|
|
189
277
|
});
|
|
190
278
|
|
|
191
|
-
var
|
|
192
|
-
return props.
|
|
279
|
+
var ToggleContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
280
|
+
return !props.isLast && "4px";
|
|
193
281
|
}, function (props) {
|
|
194
|
-
return props.theme.
|
|
282
|
+
return "\n background-color: ".concat(props.selected ? props.disabled ? props.theme.selectedDisabledBackgroundColor : props.theme.selectedBackgroundColor : props.disabled ? props.theme.unselectedDisabledBackgroundColor : props.theme.unselectedBackgroundColor, ";\n border-width: ").concat(props.theme.optionBorderThickness, ";\n border-style: ").concat(props.theme.optionBorderStyle, ";\n border-radius: ").concat(props.theme.optionBorderRadius, ";\n padding-left: ").concat(props.optionLabel && props.isIcon || props.optionLabel && !props.isIcon ? props.theme.labelPaddingLeft : props.theme.iconPaddingLeft, ";\n padding-right: ").concat(props.optionLabel && props.isIcon || props.optionLabel && !props.isIcon ? props.theme.labelPaddingRight : props.theme.iconPaddingRight, ";\n ").concat(!props.disabled ? ":hover {\n background-color: ".concat(props.selected ? props.theme.selectedHoverBackgroundColor : props.theme.unselectedHoverBackgroundColor, ";\n }\n :active {\n background-color: ").concat(props.selected ? props.theme.selectedActiveBackgroundColor : props.theme.unselectedActiveBackgroundColor, ";\n color: #ffffff;\n } \n :focus {\n border-color: transparent;\n box-shadow: 0 0 0 ").concat(props.theme.optionFocusBorderThickness, " ").concat(props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor, ";\n }\n &:focus-visible {\n outline: none;\n }\n cursor: pointer;\n color: ").concat(props.selected ? props.theme.selectedFontColor : props.theme.unselectedFontColor, ";\n") : "color: ".concat(props.selected ? props.theme.selectedDisabledFontColor : props.theme.unselectedDisabledFontColor, ";\n cursor: not-allowed;"), "\n ");
|
|
195
283
|
});
|
|
196
284
|
|
|
197
|
-
var
|
|
198
|
-
return props.theme.
|
|
285
|
+
var LabelContainer = _styledComponents["default"].span(_templateObject6(), function (props) {
|
|
286
|
+
return props.theme.optionLabelFontFamily;
|
|
199
287
|
}, function (props) {
|
|
200
|
-
return props.theme.
|
|
288
|
+
return props.theme.optionLabelFontSize;
|
|
289
|
+
}, function (props) {
|
|
290
|
+
return props.theme.optionLabelFontStyle;
|
|
291
|
+
}, function (props) {
|
|
292
|
+
return props.theme.optionLabelFontWeight;
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
var OptionContent = _styledComponents["default"].div(_templateObject7());
|
|
296
|
+
|
|
297
|
+
var Icon = _styledComponents["default"].img(_templateObject8(), function (props) {
|
|
298
|
+
return props.optionLabel && props.theme.iconMarginRight;
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
var IconContainer = _styledComponents["default"].div(_templateObject9(), function (props) {
|
|
302
|
+
return props.optionLabel && props.theme.iconMarginRight;
|
|
201
303
|
});
|
|
202
304
|
|
|
203
305
|
DxcToggleGroup.propTypes = {
|
|
306
|
+
label: _propTypes["default"].string,
|
|
307
|
+
helperText: _propTypes["default"].string,
|
|
204
308
|
value: _propTypes["default"].any,
|
|
205
309
|
onChange: _propTypes["default"].func,
|
|
206
310
|
disabled: _propTypes["default"].bool,
|
package/dist/upload/Upload.js
CHANGED
|
@@ -41,7 +41,7 @@ function _templateObject() {
|
|
|
41
41
|
return data;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var V3DxcUpload = function V3DxcUpload(_ref) {
|
|
45
45
|
var callbackUpload = _ref.callbackUpload,
|
|
46
46
|
margin = _ref.margin,
|
|
47
47
|
_ref$tabIndex = _ref.tabIndex,
|
|
@@ -178,7 +178,7 @@ var DxcUpload = function DxcUpload(_ref) {
|
|
|
178
178
|
}));
|
|
179
179
|
};
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
V3DxcUpload.propTypes = {
|
|
182
182
|
callbackUpload: _propTypes["default"].func,
|
|
183
183
|
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
184
184
|
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
@@ -201,5 +201,5 @@ var DXCUpload = _styledComponents["default"].div(_templateObject(), function (pr
|
|
|
201
201
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
202
202
|
});
|
|
203
203
|
|
|
204
|
-
var _default =
|
|
204
|
+
var _default = V3DxcUpload;
|
|
205
205
|
exports["default"] = _default;
|
|
@@ -19,16 +19,14 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
19
19
|
|
|
20
20
|
var _Button = _interopRequireDefault(require("../../button/Button"));
|
|
21
21
|
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
var _dragDropIcon = _interopRequireDefault(require("./drag-drop-icon.svg"));
|
|
22
|
+
var _Icons = require("./Icons");
|
|
25
23
|
|
|
26
24
|
var _useTheme = _interopRequireDefault(require("../../useTheme.js"));
|
|
27
25
|
|
|
28
26
|
var _BackgroundColorContext = require("../../BackgroundColorContext.js");
|
|
29
27
|
|
|
30
28
|
function _templateObject3() {
|
|
31
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
29
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n margin-right: 5px;\n & svg {\n fill: ", ";\n }\n"]);
|
|
32
30
|
|
|
33
31
|
_templateObject3 = function _templateObject3() {
|
|
34
32
|
return data;
|
|
@@ -81,7 +79,7 @@ var DxcButtonsUpload = function DxcButtonsUpload(_ref) {
|
|
|
81
79
|
theme: colorsTheme.upload
|
|
82
80
|
}, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
83
81
|
color: colorsTheme.upload.backgroundColor
|
|
84
|
-
}, _react["default"].createElement(DXCButtonsUpload, null, _react["default"].createElement(DragAndDropLabel, null, _react["default"].createElement(
|
|
82
|
+
}, _react["default"].createElement(DXCButtonsUpload, null, _react["default"].createElement(DragAndDropLabel, null, _react["default"].createElement(DragAndDropIconContainer, null, _Icons.dragAndDropIcon), "Drag and Drop area"), _react["default"].createElement(_Button["default"], {
|
|
85
83
|
margin: {
|
|
86
84
|
right: "small"
|
|
87
85
|
},
|
|
@@ -99,7 +97,7 @@ var DxcButtonsUpload = function DxcButtonsUpload(_ref) {
|
|
|
99
97
|
}), _react["default"].createElement(_Button["default"], {
|
|
100
98
|
label: "UPLOAD",
|
|
101
99
|
iconPosition: "after",
|
|
102
|
-
|
|
100
|
+
icon: _Icons.uploadIcon,
|
|
103
101
|
onClick: onUpload
|
|
104
102
|
}))));
|
|
105
103
|
};
|
|
@@ -125,14 +123,12 @@ var DragAndDropLabel = _styledComponents["default"].div(_templateObject2(), func
|
|
|
125
123
|
return props.theme.dragAndDropAreaTextFontColor;
|
|
126
124
|
});
|
|
127
125
|
|
|
128
|
-
var
|
|
129
|
-
return props.theme.dragAndDropAreaIconColor;
|
|
130
|
-
}, _dragDropIcon["default"], function (props) {
|
|
131
|
-
return "".concat(props.theme.dragAndDropAreaIconSize, " ").concat(props.theme.dragAndDropAreaIconSize);
|
|
132
|
-
}, function (props) {
|
|
126
|
+
var DragAndDropIconContainer = _styledComponents["default"].div(_templateObject3(), function (props) {
|
|
133
127
|
return props.theme.dragAndDropAreaIconSize;
|
|
134
128
|
}, function (props) {
|
|
135
129
|
return props.theme.dragAndDropAreaIconSize;
|
|
130
|
+
}, function (props) {
|
|
131
|
+
return props.theme.dragAndDropAreaIconColor;
|
|
136
132
|
});
|
|
137
133
|
|
|
138
134
|
var _default = DxcButtonsUpload;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.dragAndDropIcon = exports.uploadIcon = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var uploadIcon = _react["default"].createElement("svg", {
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
width: "24",
|
|
15
|
+
height: "24",
|
|
16
|
+
viewBox: "0 0 24 24",
|
|
17
|
+
fill: "#FFFFFF"
|
|
18
|
+
}, _react["default"].createElement("path", {
|
|
19
|
+
d: "M0 0h24v24H0z",
|
|
20
|
+
fill: "none"
|
|
21
|
+
}), _react["default"].createElement("path", {
|
|
22
|
+
d: "M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
exports.uploadIcon = uploadIcon;
|
|
26
|
+
|
|
27
|
+
var dragAndDropIcon = _react["default"].createElement("svg", {
|
|
28
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
29
|
+
width: "24",
|
|
30
|
+
height: "24",
|
|
31
|
+
viewBox: "0 0 24 24",
|
|
32
|
+
fill: "#666666"
|
|
33
|
+
}, _react["default"].createElement("path", {
|
|
34
|
+
fill: "none",
|
|
35
|
+
d: "M0 0h24v24H0V0z"
|
|
36
|
+
}), _react["default"].createElement("path", {
|
|
37
|
+
d: "M3 13h2v-2H3v2zm0 4h2v-2H3v2zm2 4v-2H3c0 1.1.89 2 2 2zM3 9h2V7H3v2zm12 12h2v-2h-2v2zm4-18H9c-1.11 0-2 .9-2 2v10c0 1.1.89 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 12H9V5h10v10zm-8 6h2v-2h-2v2zm-4 0h2v-2H7v2z"
|
|
38
|
+
}));
|
|
39
|
+
|
|
40
|
+
exports.dragAndDropIcon = dragAndDropIcon;
|
|
@@ -17,18 +17,22 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
17
17
|
|
|
18
18
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _Icons = require("./Icons");
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _useTheme = _interopRequireDefault(require("../../useTheme.js"));
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
function _templateObject8() {
|
|
25
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n border: none;\n display: flex;\n margin-right: 30px;\n margin-top: 11px;\n padding: 0px;\n background: none;\n &:focus {\n visibility: visible;\n }\n & svg {\n fill: ", ";\n height: ", ";\n width: ", ";\n }\n"]);
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
_templateObject8 = function _templateObject8() {
|
|
28
|
+
return data;
|
|
29
|
+
};
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
return data;
|
|
32
|
+
}
|
|
29
33
|
|
|
30
34
|
function _templateObject7() {
|
|
31
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
35
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n text-transform: ", ";\n color: ", ";\n"]);
|
|
32
36
|
|
|
33
37
|
_templateObject7 = function _templateObject7() {
|
|
34
38
|
return data;
|
|
@@ -38,7 +42,7 @@ function _templateObject7() {
|
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
function _templateObject6() {
|
|
41
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n text-transform: ", ";\n color: ", ";\n"]);
|
|
45
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n text-transform: ", ";\n color: ", ";\n margin-bottom: 12px;\n"]);
|
|
42
46
|
|
|
43
47
|
_templateObject6 = function _templateObject6() {
|
|
44
48
|
return data;
|
|
@@ -48,7 +52,7 @@ function _templateObject6() {
|
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
function _templateObject5() {
|
|
51
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
55
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n"]);
|
|
52
56
|
|
|
53
57
|
_templateObject5 = function _templateObject5() {
|
|
54
58
|
return data;
|
|
@@ -58,7 +62,7 @@ function _templateObject5() {
|
|
|
58
62
|
}
|
|
59
63
|
|
|
60
64
|
function _templateObject4() {
|
|
61
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
65
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: 30px;\n width: 70px;\n height: 52px;\n & svg {\n width: 70px;\n height: 52px;\n }\n"]);
|
|
62
66
|
|
|
63
67
|
_templateObject4 = function _templateObject4() {
|
|
64
68
|
return data;
|
|
@@ -106,7 +110,7 @@ var DxcFileToUpload = function DxcFileToUpload(_ref) {
|
|
|
106
110
|
onDelete = _ref.onDelete,
|
|
107
111
|
tabIndexValue = _ref.tabIndexValue;
|
|
108
112
|
|
|
109
|
-
var icon = type.includes("video") &&
|
|
113
|
+
var icon = type.includes("video") && _Icons.videoIcon || type.includes("audio") && _Icons.audioIcon || _Icons.defaultIcon;
|
|
110
114
|
|
|
111
115
|
var hasImage = image && image.includes("image");
|
|
112
116
|
var colorsTheme = (0, _useTheme["default"])();
|
|
@@ -114,13 +118,10 @@ var DxcFileToUpload = function DxcFileToUpload(_ref) {
|
|
|
114
118
|
theme: colorsTheme.upload
|
|
115
119
|
}, _react["default"].createElement(DXCFileToUpload, null, _react["default"].createElement(FileContent, null, hasImage && _react["default"].createElement(FileImage, {
|
|
116
120
|
src: image
|
|
117
|
-
}) || _react["default"].createElement(
|
|
118
|
-
src: icon
|
|
119
|
-
}), _react["default"].createElement(FileInfo, null, _react["default"].createElement(FileName, null, name), _react["default"].createElement(FileType, null, type)), _react["default"].createElement(DeleteFile, {
|
|
120
|
-
className: "delete-file",
|
|
121
|
+
}) || _react["default"].createElement(FileIconContainer, null, icon), _react["default"].createElement(FileInfo, null, _react["default"].createElement(FileName, null, name), _react["default"].createElement(FileType, null, type)), _react["default"].createElement(DeleteFile, {
|
|
121
122
|
onClick: onDelete,
|
|
122
123
|
tabIndex: tabIndexValue
|
|
123
|
-
}))));
|
|
124
|
+
}, _Icons.closeIcon))));
|
|
124
125
|
};
|
|
125
126
|
|
|
126
127
|
DxcFileToUpload.propTypes = {
|
|
@@ -144,9 +145,11 @@ var FileContent = _styledComponents["default"].div(_templateObject2());
|
|
|
144
145
|
|
|
145
146
|
var FileImage = _styledComponents["default"].img(_templateObject3());
|
|
146
147
|
|
|
147
|
-
var
|
|
148
|
+
var FileIconContainer = _styledComponents["default"].div(_templateObject4());
|
|
149
|
+
|
|
150
|
+
var FileInfo = _styledComponents["default"].div(_templateObject5());
|
|
148
151
|
|
|
149
|
-
var FileName = _styledComponents["default"].div(
|
|
152
|
+
var FileName = _styledComponents["default"].div(_templateObject6(), function (props) {
|
|
150
153
|
return props.theme.fileNameFontSize;
|
|
151
154
|
}, function (props) {
|
|
152
155
|
return props.theme.fileNameFontStyle;
|
|
@@ -158,7 +161,7 @@ var FileName = _styledComponents["default"].div(_templateObject5(), function (pr
|
|
|
158
161
|
return props.theme.fileNameFontColor;
|
|
159
162
|
});
|
|
160
163
|
|
|
161
|
-
var FileType = _styledComponents["default"].div(
|
|
164
|
+
var FileType = _styledComponents["default"].div(_templateObject7(), function (props) {
|
|
162
165
|
return props.theme.fileTypeFontSize;
|
|
163
166
|
}, function (props) {
|
|
164
167
|
return props.theme.fileTypeFontStyle;
|
|
@@ -170,10 +173,12 @@ var FileType = _styledComponents["default"].div(_templateObject6(), function (pr
|
|
|
170
173
|
return props.theme.fileTypeFontColor;
|
|
171
174
|
});
|
|
172
175
|
|
|
173
|
-
var DeleteFile = _styledComponents["default"].button(
|
|
176
|
+
var DeleteFile = _styledComponents["default"].button(_templateObject8(), function (props) {
|
|
177
|
+
return props.theme.fileDeleteIconSize;
|
|
178
|
+
}, function (props) {
|
|
179
|
+
return props.theme.fileDeleteIconSize;
|
|
180
|
+
}, function (props) {
|
|
174
181
|
return props.theme.fileDeleteIconColor;
|
|
175
|
-
}, _close["default"], function (props) {
|
|
176
|
-
return "".concat(props.theme.fileDeleteIconSize, " ").concat(props.theme.fileDeleteIconSize);
|
|
177
182
|
}, function (props) {
|
|
178
183
|
return props.theme.fileDeleteIconSize;
|
|
179
184
|
}, function (props) {
|