@uxf/ui 11.11.3 → 11.12.1
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.
|
@@ -82,7 +82,7 @@ const _SelectBase = (props) => {
|
|
|
82
82
|
const dropdown = (0, use_dropdown_1.useDropdown)((_b = props.dropdownPlacement) !== null && _b !== void 0 ? _b : "bottom", (_c = props.dropdownMatchesInputWidth) !== null && _c !== void 0 ? _c : true, props.dropdownStrategy);
|
|
83
83
|
const stableRef = (0, react_2.useMemo)(() => (0, composeRefs_1.composeRefs)(innerRef, props.forwardRef, dropdown.refs.setReference), [dropdown.refs.setReference, props.forwardRef]);
|
|
84
84
|
const HUIComponent = props.HUIComponent;
|
|
85
|
-
return (react_2.default.createElement(HUIComponent, { as: "div", by: "id", className: (0, cx_1.cx)("uxf-form-component uxf-select-base", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.className), "data-
|
|
85
|
+
return (react_2.default.createElement(HUIComponent, { as: "div", by: "id", className: (0, cx_1.cx)("uxf-form-component uxf-select-base", props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isRequired && classes_1.CLASSES.IS_REQUIRED, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.className), "data-name": props.name, disabled: props.isDisabled || props.isReadOnly, onChange: props.onChange, style: props.style, value: props.value }, (renderProps) => (react_2.default.createElement(react_2.default.Fragment, null,
|
|
86
86
|
react_2.default.createElement("div", { className: "uxf-form-component__label" },
|
|
87
87
|
react_2.default.createElement(HUIComponent.Label, { as: label_1.Label, isHidden: props.hiddenLabel, onClick: props.isDisabled || props.isReadOnly ? undefined : input.focus }, props.label)),
|
|
88
88
|
react_2.default.createElement("div", { className: "uxf-form-component__input" },
|
|
@@ -3,7 +3,7 @@ import { ComboboxOption } from "./combobox";
|
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: {
|
|
6
|
-
<ValueId = import("
|
|
6
|
+
<ValueId = import("./combobox").ComboboxValueId, Option = ComboboxOption<ValueId>, Value = Option>(props: import("./combobox").ComboboxProps<ValueId, Option, Value>): React.JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
};
|
|
9
9
|
};
|
package/css/dropzone.css
CHANGED
|
@@ -1,24 +1,39 @@
|
|
|
1
1
|
.uxf-dropzone {
|
|
2
|
-
|
|
2
|
+
border-radius: theme("borderRadius.lg");
|
|
3
|
+
|
|
4
|
+
&:focus {
|
|
5
|
+
outline: none;
|
|
6
|
+
}
|
|
3
7
|
|
|
4
8
|
&__input {
|
|
5
9
|
@apply sr-only;
|
|
6
10
|
}
|
|
7
11
|
|
|
8
12
|
&__label {
|
|
9
|
-
@apply
|
|
10
|
-
|
|
13
|
+
@apply space-y-2;
|
|
14
|
+
|
|
15
|
+
align-items: center;
|
|
16
|
+
border: 2px dashed theme("borderColor.lightBorder");
|
|
17
|
+
border-radius: inherit;
|
|
18
|
+
color: theme("colors.lightLow");
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
font-size: 14px;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
padding: theme("spacing.4");
|
|
11
25
|
|
|
12
26
|
&__icon {
|
|
13
|
-
|
|
27
|
+
height: theme("height.6");
|
|
14
28
|
}
|
|
15
29
|
|
|
16
30
|
&.is-invalid {
|
|
17
|
-
|
|
31
|
+
border: theme("borderColor.error.DEFAULT");
|
|
18
32
|
}
|
|
19
33
|
|
|
20
34
|
&.is-disabled {
|
|
21
|
-
|
|
35
|
+
background-color: theme("backgroundColor.lightBorder/.5");
|
|
36
|
+
cursor: not-allowed;
|
|
22
37
|
}
|
|
23
38
|
}
|
|
24
39
|
}
|
|
@@ -27,40 +42,62 @@
|
|
|
27
42
|
@apply space-y-2;
|
|
28
43
|
|
|
29
44
|
&__item-wrapper {
|
|
30
|
-
@apply
|
|
45
|
+
@apply space-y-1;
|
|
46
|
+
|
|
47
|
+
align-items: center;
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
justify-content: flex-start;
|
|
31
51
|
}
|
|
32
52
|
|
|
33
53
|
&__item {
|
|
34
|
-
@apply
|
|
35
|
-
|
|
54
|
+
@apply space-x-6 sm:rounded-md sm:px-6;
|
|
55
|
+
|
|
56
|
+
align-items: center;
|
|
57
|
+
border-width: 1px;
|
|
58
|
+
box-shadow: theme("boxShadow.sm");
|
|
59
|
+
display: flex;
|
|
60
|
+
justify-content: space-between;
|
|
61
|
+
overflow: auto;
|
|
62
|
+
padding: theme("spacing.3") theme("spacing.4");
|
|
63
|
+
width: 100%;
|
|
36
64
|
|
|
37
65
|
:root .light & {
|
|
38
|
-
|
|
66
|
+
border-color: theme("borderColor.lightBorder");
|
|
67
|
+
color: theme("colors.lightMedium");
|
|
39
68
|
}
|
|
40
69
|
|
|
41
70
|
:root .dark & {
|
|
42
|
-
|
|
71
|
+
background-color: theme("backgroundColor.gray.800");
|
|
72
|
+
border-color: theme("borderColor.gray.700");
|
|
73
|
+
color: theme("colors.gray.200");
|
|
43
74
|
}
|
|
44
75
|
|
|
45
76
|
&.is-invalid {
|
|
46
77
|
:root .light & {
|
|
47
|
-
|
|
78
|
+
border-color: theme("borderColor.error.DEFAULT");
|
|
79
|
+
color: theme("colors.error.DEFAULT");
|
|
48
80
|
}
|
|
49
81
|
|
|
50
82
|
:root .dark & {
|
|
51
|
-
|
|
83
|
+
border-color: theme("borderColor.error.DEFAULT");
|
|
84
|
+
color: theme("colors.error.DEFAULT");
|
|
52
85
|
}
|
|
53
86
|
}
|
|
54
87
|
|
|
55
88
|
&__block {
|
|
56
|
-
@apply
|
|
89
|
+
@apply space-x-4;
|
|
90
|
+
|
|
91
|
+
align-items: center;
|
|
92
|
+
display: flex;
|
|
93
|
+
min-width: 0;
|
|
57
94
|
|
|
58
95
|
&:nth-child(2) {
|
|
59
|
-
|
|
96
|
+
flex-shrink: 0;
|
|
60
97
|
}
|
|
61
98
|
|
|
62
99
|
&__icon {
|
|
63
|
-
|
|
100
|
+
height: theme("height.6");
|
|
64
101
|
}
|
|
65
102
|
|
|
66
103
|
&__file-name {
|
|
@@ -68,16 +105,22 @@
|
|
|
68
105
|
}
|
|
69
106
|
|
|
70
107
|
&__file-name-link {
|
|
71
|
-
@apply truncate
|
|
108
|
+
@apply truncate;
|
|
109
|
+
|
|
110
|
+
&:hover {
|
|
111
|
+
text-decoration: underline;
|
|
112
|
+
text-underline-offset: 2px;
|
|
113
|
+
}
|
|
72
114
|
}
|
|
73
115
|
|
|
74
116
|
&__file-size {
|
|
75
|
-
|
|
117
|
+
flex-shrink: 0;
|
|
118
|
+
white-space: nowrap;
|
|
76
119
|
}
|
|
77
120
|
|
|
78
121
|
&__remove-button {
|
|
79
122
|
&__icon {
|
|
80
|
-
|
|
123
|
+
height: theme("height.4");
|
|
81
124
|
}
|
|
82
125
|
}
|
|
83
126
|
}
|
|
@@ -67,7 +67,6 @@ exports.DropzoneInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
67
67
|
var _a, _b;
|
|
68
68
|
const refValue = (0, react_1.useRef)();
|
|
69
69
|
refValue.current = props.value;
|
|
70
|
-
const inputRef = (0, react_1.useRef)(null);
|
|
71
70
|
const handleFileRejected = async (fileRejections) => {
|
|
72
71
|
fileRejections.forEach((fileRejection) => {
|
|
73
72
|
if (props.maxFileSize && fileRejection.file.size > props.maxFileSize) {
|
|
@@ -78,7 +77,7 @@ exports.DropzoneInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
78
77
|
}
|
|
79
78
|
});
|
|
80
79
|
};
|
|
81
|
-
const handleFileDrop = async (acceptedFiles) => {
|
|
80
|
+
const handleFileDrop = async (acceptedFiles, inputRef) => {
|
|
82
81
|
const files = acceptedFiles.map((file) => ({
|
|
83
82
|
...fileToFileResponse(file),
|
|
84
83
|
abortController: new AbortController(),
|
|
@@ -109,7 +108,7 @@ exports.DropzoneInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
109
108
|
.catch((err) => fileRejectedHandler(err, file, onChange, refValue.current, props.onUploadError));
|
|
110
109
|
}
|
|
111
110
|
};
|
|
112
|
-
const { getRootProps, getInputProps, rootRef } = (0, react_dropzone_1.useDropzone)({
|
|
111
|
+
const { getRootProps, getInputProps, rootRef, inputRef } = (0, react_dropzone_1.useDropzone)({
|
|
113
112
|
accept: props.accept,
|
|
114
113
|
disabled: props.isDisabled,
|
|
115
114
|
maxFiles: props.maxFilesCount,
|
|
@@ -118,7 +117,7 @@ exports.DropzoneInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
118
117
|
multiple: props.maxFilesCount !== 1,
|
|
119
118
|
noClick: props.noClick,
|
|
120
119
|
noDrag: props.noDrag,
|
|
121
|
-
onDrop: handleFileDrop,
|
|
120
|
+
onDrop: (acceptedFiles) => handleFileDrop(acceptedFiles, inputRef),
|
|
122
121
|
preventDropOnDocument: props.noDrag,
|
|
123
122
|
onDropRejected: handleFileRejected,
|
|
124
123
|
});
|
|
@@ -134,6 +133,7 @@ exports.DropzoneInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
134
133
|
typeof props.label === "string" ? react_1.default.createElement("span", null, props.label) : props.label,
|
|
135
134
|
react_1.default.createElement("input", { ...getInputProps({
|
|
136
135
|
className: "uxf-dropzone__input",
|
|
136
|
+
disabled: props.isDisabled,
|
|
137
137
|
id: props.id,
|
|
138
138
|
name: props.name,
|
|
139
139
|
type: "file",
|