@vinyasa/form 1.0.22 → 1.0.23
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/cjs/autocomplete.cjs +709 -309
- package/dist/cjs/autocomplete.css +1 -1
- package/dist/cjs/checkbox.cjs +399 -244
- package/dist/cjs/checkbox.css +5 -1
- package/dist/cjs/color-picker.cjs +478 -325
- package/dist/cjs/color-picker.css +1 -1
- package/dist/cjs/combobox.cjs +574 -359
- package/dist/cjs/combobox.css +1 -1
- package/dist/cjs/date-picker.cjs +522 -322
- package/dist/cjs/date-picker.css +1 -1
- package/dist/cjs/dropzone.cjs +562 -391
- package/dist/cjs/dropzone.css +1 -1
- package/dist/cjs/field.cjs +353 -0
- package/dist/cjs/field.css +139 -0
- package/dist/cjs/file-upload.cjs +667 -380
- package/dist/cjs/file-upload.css +44 -1
- package/dist/cjs/index.cjs +3066 -2546
- package/dist/cjs/index.css +9 -1
- package/dist/cjs/input.cjs +220 -74
- package/dist/cjs/input.css +1 -1
- package/dist/cjs/multi-select.cjs +756 -400
- package/dist/cjs/multi-select.css +1 -1
- package/dist/cjs/number-input.cjs +267 -125
- package/dist/cjs/number-input.css +1 -1
- package/dist/cjs/otp-input.cjs +232 -85
- package/dist/cjs/otp-input.css +1 -1
- package/dist/cjs/password-input.cjs +239 -93
- package/dist/cjs/password-input.css +1 -1
- package/dist/cjs/radio-group.cjs +388 -246
- package/dist/cjs/radio-group.css +1 -1
- package/dist/cjs/range-slider.cjs +106 -62
- package/dist/cjs/rich-text-editor.cjs +549 -517
- package/dist/cjs/rich-text-editor.css +1 -1
- package/dist/cjs/search-input.cjs +244 -98
- package/dist/cjs/search-input.css +1 -1
- package/dist/cjs/select.cjs +485 -353
- package/dist/cjs/select.css +1 -1
- package/dist/cjs/slider.cjs +129 -155
- package/dist/cjs/switch.cjs +376 -239
- package/dist/cjs/switch.css +5 -1
- package/dist/cjs/tags-input.cjs +264 -113
- package/dist/cjs/tags-input.css +1 -1
- package/dist/cjs/textarea.cjs +225 -79
- package/dist/cjs/textarea.css +1 -1
- package/dist/cjs/time-picker.cjs +546 -371
- package/dist/cjs/time-picker.css +1 -1
- package/dist/cjs/toggle-button.cjs +18 -15
- package/dist/esm/{switch.css → 1485.css} +4 -0
- package/dist/esm/1485.js +28 -0
- package/dist/esm/{2995.css → 2315.css} +1 -1
- package/dist/esm/{2995.js → 2315.js} +96 -4
- package/dist/esm/2692.js +114 -0
- package/dist/esm/27.js +23 -27
- package/dist/esm/345.js +81 -0
- package/dist/esm/5074.js +66 -0
- package/dist/esm/5333.js +72 -0
- package/dist/esm/6982.js +35 -0
- package/dist/esm/7580.js +34 -0
- package/dist/esm/7678.js +101 -0
- package/dist/esm/7800.js +131 -0
- package/dist/esm/8479.js +115 -0
- package/dist/esm/{checkbox.css → 9167.css} +4 -0
- package/dist/esm/9167.js +30 -0
- package/dist/esm/9545.js +118 -0
- package/dist/esm/{2942.css → 9559.css} +43 -0
- package/dist/esm/9559.js +179 -0
- package/dist/esm/autocomplete.js +2 -95
- package/dist/esm/checkbox.js +1 -38
- package/dist/esm/color-picker.js +1 -130
- package/dist/esm/combobox.js +1 -126
- package/dist/esm/components/autocomplete/Autocomplete.d.ts +26 -16
- package/dist/esm/components/autocomplete/index.d.ts +1 -3
- package/dist/esm/components/checkbox/Checkbox.d.ts +12 -4
- package/dist/esm/components/checkbox/index.d.ts +1 -3
- package/dist/esm/components/color-picker/ColorPicker.d.ts +28 -21
- package/dist/esm/components/color-picker/index.d.ts +1 -3
- package/dist/esm/components/combobox/Combobox.d.ts +55 -29
- package/dist/esm/components/combobox/index.d.ts +1 -3
- package/dist/esm/components/date-picker/DatePicker.d.ts +28 -24
- package/dist/esm/components/date-picker/index.d.ts +1 -3
- package/dist/esm/components/dropzone/Dropzone.d.ts +52 -9
- package/dist/esm/components/dropzone/index.d.ts +1 -3
- package/dist/esm/components/field/Field.d.ts +106 -0
- package/dist/esm/components/field/index.d.ts +1 -0
- package/dist/esm/components/file-upload/FileUpload.d.ts +11 -18
- package/dist/esm/components/file-upload/index.d.ts +1 -3
- package/dist/esm/components/icon-button/IconButton.d.ts +1 -1
- package/dist/esm/components/input/Input.d.ts +3 -5
- package/dist/esm/components/multi-select/MultiSelect.d.ts +37 -30
- package/dist/esm/components/multi-select/index.d.ts +1 -3
- package/dist/esm/components/number-input/NumberInput.d.ts +3 -5
- package/dist/esm/components/otp-input/OtpInput.d.ts +2 -4
- package/dist/esm/components/password-input/PasswordInput.d.ts +3 -5
- package/dist/esm/components/radio-group/RadioGroup.d.ts +18 -10
- package/dist/esm/components/radio-group/index.d.ts +1 -3
- package/dist/esm/components/range-slider/RangeSlider.d.ts +1 -1
- package/dist/esm/components/rich-text-editor/RichTextEditor.d.ts +44 -7
- package/dist/esm/components/rich-text-editor/index.d.ts +1 -3
- package/dist/esm/components/search-input/SearchInput.d.ts +3 -5
- package/dist/esm/components/select/Select.d.ts +36 -23
- package/dist/esm/components/select/index.d.ts +1 -3
- package/dist/esm/components/slider/Slider.d.ts +17 -10
- package/dist/esm/components/slider/index.d.ts +1 -3
- package/dist/esm/components/switch/Switch.d.ts +10 -5
- package/dist/esm/components/switch/index.d.ts +1 -3
- package/dist/esm/components/tags-input/TagsInput.d.ts +3 -5
- package/dist/esm/components/textarea/Textarea.d.ts +3 -5
- package/dist/esm/components/time-picker/TimePicker.d.ts +31 -23
- package/dist/esm/components/time-picker/index.d.ts +1 -3
- package/dist/esm/date-picker.js +1 -118
- package/dist/esm/dropzone.js +1 -137
- package/dist/esm/field.d.ts +2 -24
- package/dist/esm/field.js +1 -0
- package/dist/esm/file-upload.js +2 -123
- package/dist/esm/index.d.ts +15 -14
- package/dist/esm/index.js +15 -14
- package/dist/esm/input.js +16 -25
- package/dist/esm/multi-select.js +2 -164
- package/dist/esm/number-input.js +65 -78
- package/dist/esm/otp-input.js +31 -38
- package/dist/esm/password-input.js +32 -41
- package/dist/esm/radio-group.js +1 -44
- package/dist/esm/range-slider.js +15 -8
- package/dist/esm/rich-text-editor.js +1 -212
- package/dist/esm/search-input.js +35 -44
- package/dist/esm/select.js +1 -87
- package/dist/esm/slider.js +1 -4
- package/dist/esm/switch.js +1 -36
- package/dist/esm/tags-input.js +51 -59
- package/dist/esm/textarea.js +22 -31
- package/dist/esm/time-picker.js +1 -137
- package/package.json +18 -9
- package/dist/esm/2942.js +0 -13
- package/dist/esm/4557.js +0 -39
- package/dist/esm/dropzone.css +0 -43
- /package/dist/esm/{date-picker.css → 2692.css} +0 -0
- /package/dist/esm/{select.css → 5333.css} +0 -0
- /package/dist/esm/{radio-group.css → 7580.css} +0 -0
- /package/dist/esm/{color-picker.css → 7678.css} +0 -0
- /package/dist/esm/{rich-text-editor.css → 9545.css} +0 -0
package/dist/cjs/file-upload.cjs
CHANGED
|
@@ -1,228 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
400 (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
4
|
-
function toPrimitive(t, r) {
|
|
5
|
-
if ("object" != typeof t || !t) return t;
|
|
6
|
-
var e = t[Symbol.toPrimitive];
|
|
7
|
-
if (void 0 !== e) {
|
|
8
|
-
var i = e.call(t, r || "default");
|
|
9
|
-
if ("object" != typeof i) return i;
|
|
10
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
11
|
-
}
|
|
12
|
-
return ("string" === r ? String : Number)(t);
|
|
13
|
-
}
|
|
14
|
-
function toPropertyKey(t) {
|
|
15
|
-
var i = toPrimitive(t, "string");
|
|
16
|
-
return "symbol" == typeof i ? i : String(i);
|
|
17
|
-
}
|
|
18
|
-
function _defineProperty(obj, key, value) {
|
|
19
|
-
key = toPropertyKey(key);
|
|
20
|
-
if (key in obj) Object.defineProperty(obj, key, {
|
|
21
|
-
value: value,
|
|
22
|
-
enumerable: true,
|
|
23
|
-
configurable: true,
|
|
24
|
-
writable: true
|
|
25
|
-
});
|
|
26
|
-
else obj[key] = value;
|
|
27
|
-
return obj;
|
|
28
|
-
}
|
|
29
|
-
function ownKeys(e, r) {
|
|
30
|
-
var t = Object.keys(e);
|
|
31
|
-
if (Object.getOwnPropertySymbols) {
|
|
32
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
33
|
-
r && (o = o.filter(function(r) {
|
|
34
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
35
|
-
})), t.push.apply(t, o);
|
|
36
|
-
}
|
|
37
|
-
return t;
|
|
38
|
-
}
|
|
39
|
-
function _objectSpread2(e) {
|
|
40
|
-
for(var r = 1; r < arguments.length; r++){
|
|
41
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
42
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
|
|
43
|
-
_defineProperty(e, r, t[r]);
|
|
44
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
|
|
45
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
return e;
|
|
49
|
-
}
|
|
50
|
-
function mapValues(input, fn) {
|
|
51
|
-
var result = {};
|
|
52
|
-
for(var _key in input)result[_key] = fn(input[_key], _key);
|
|
53
|
-
return result;
|
|
54
|
-
}
|
|
55
|
-
var shouldApplyCompound = (compoundCheck, selections, defaultVariants)=>{
|
|
56
|
-
for (var key of Object.keys(compoundCheck)){
|
|
57
|
-
var _selections$key;
|
|
58
|
-
if (compoundCheck[key] !== (null != (_selections$key = selections[key]) ? _selections$key : defaultVariants[key])) return false;
|
|
59
|
-
}
|
|
60
|
-
return true;
|
|
61
|
-
};
|
|
62
|
-
var createRuntimeFn = (config)=>{
|
|
63
|
-
var runtimeFn = (options)=>{
|
|
64
|
-
var className = config.defaultClassName;
|
|
65
|
-
var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
|
|
66
|
-
for(var variantName in selections){
|
|
67
|
-
var _selections$variantNa;
|
|
68
|
-
var variantSelection = null != (_selections$variantNa = selections[variantName]) ? _selections$variantNa : config.defaultVariants[variantName];
|
|
69
|
-
if (null != variantSelection) {
|
|
70
|
-
var selection = variantSelection;
|
|
71
|
-
if ('boolean' == typeof selection) selection = true === selection ? 'true' : 'false';
|
|
72
|
-
var selectionClassName = config.variantClassNames[variantName][selection];
|
|
73
|
-
if (selectionClassName) className += ' ' + selectionClassName;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
for (var [compoundCheck, compoundClassName] of config.compoundVariants)if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) className += ' ' + compoundClassName;
|
|
77
|
-
return className;
|
|
78
|
-
};
|
|
79
|
-
runtimeFn.variants = ()=>Object.keys(config.variantClassNames);
|
|
80
|
-
runtimeFn.classNames = {
|
|
81
|
-
get base () {
|
|
82
|
-
return config.defaultClassName.split(' ')[0];
|
|
83
|
-
},
|
|
84
|
-
get variants () {
|
|
85
|
-
return mapValues(config.variantClassNames, (classNames)=>mapValues(classNames, (className)=>className.split(' ')[0]));
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
return runtimeFn;
|
|
89
|
-
};
|
|
90
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
91
|
-
c: ()=>createRuntimeFn
|
|
92
|
-
});
|
|
93
|
-
},
|
|
94
|
-
860 (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
95
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
96
|
-
$Y: ()=>fileList,
|
|
97
|
-
af: ()=>fileListWrapper,
|
|
98
|
-
gM: ()=>fileMeta,
|
|
99
|
-
Md: ()=>fileName,
|
|
100
|
-
vH: ()=>fileNameIcon,
|
|
101
|
-
$u: ()=>fileNameText,
|
|
102
|
-
ZN: ()=>fileRemove,
|
|
103
|
-
ho: ()=>fileRow,
|
|
104
|
-
Ov: ()=>fileSize,
|
|
105
|
-
xX: ()=>rejectionText,
|
|
106
|
-
hZ: ()=>trigger
|
|
107
|
-
});
|
|
108
|
-
var fileList = '_3ltn2y2';
|
|
109
|
-
var fileListWrapper = '_3ltn2y1';
|
|
110
|
-
var fileMeta = '_3ltn2y7';
|
|
111
|
-
var fileName = '_3ltn2y4';
|
|
112
|
-
var fileNameIcon = '_3ltn2y5';
|
|
113
|
-
var fileNameText = '_3ltn2y6';
|
|
114
|
-
var fileRemove = '_3ltn2y9';
|
|
115
|
-
var fileRow = '_3ltn2y3';
|
|
116
|
-
var fileSize = '_3ltn2y8';
|
|
117
|
-
var rejectionText = '_3ltn2ya';
|
|
118
|
-
var trigger = '_3ltn2y0';
|
|
119
|
-
},
|
|
120
|
-
891 (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
121
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
122
|
-
ij: ()=>descriptionText,
|
|
123
|
-
kc: ()=>errorText,
|
|
124
|
-
Pf: ()=>label,
|
|
125
|
-
Zy: ()=>requiredMark
|
|
126
|
-
});
|
|
127
|
-
var createRuntimeFn_62c9670f_esm = __webpack_require__(400);
|
|
128
|
-
var descriptionText = 'sbqkrxd';
|
|
129
|
-
var errorText = 'sbqkrxe';
|
|
130
|
-
(0, createRuntimeFn_62c9670f_esm.c)({
|
|
131
|
-
defaultClassName: 'sbqkrx0',
|
|
132
|
-
variantClassNames: {
|
|
133
|
-
size: {
|
|
134
|
-
sm: 'sbqkrx1',
|
|
135
|
-
md: 'sbqkrx2',
|
|
136
|
-
lg: 'sbqkrx3'
|
|
137
|
-
},
|
|
138
|
-
invalid: {
|
|
139
|
-
true: 'sbqkrx4'
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
defaultVariants: {
|
|
143
|
-
size: 'md'
|
|
144
|
-
},
|
|
145
|
-
compoundVariants: []
|
|
146
|
-
});
|
|
147
|
-
var label = 'sbqkrxb';
|
|
148
|
-
var requiredMark = 'sbqkrxc';
|
|
149
|
-
},
|
|
150
|
-
140 (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
151
|
-
var react_jsx_runtime__rspack_import_0 = __webpack_require__(732);
|
|
152
|
-
var _field_css__rspack_import_1 = __webpack_require__(891);
|
|
153
|
-
const describedByIds = (id, { description, error })=>{
|
|
154
|
-
const ids = [];
|
|
155
|
-
if (description) ids.push(`${id}-description`);
|
|
156
|
-
if (error) ids.push(`${id}-error`);
|
|
157
|
-
return ids.length > 0 ? ids.join(' ') : void 0;
|
|
158
|
-
};
|
|
159
|
-
const FieldChrome = ({ id, label, description, error, required, children, disableLabelFor = false })=>/*#__PURE__*/ (0, react_jsx_runtime__rspack_import_0.jsxs)("div", {
|
|
160
|
-
children: [
|
|
161
|
-
label ? /*#__PURE__*/ (0, react_jsx_runtime__rspack_import_0.jsxs)("label", {
|
|
162
|
-
htmlFor: disableLabelFor ? void 0 : id,
|
|
163
|
-
id: `${id}-label`,
|
|
164
|
-
className: _field_css__rspack_import_1.Pf,
|
|
165
|
-
children: [
|
|
166
|
-
label,
|
|
167
|
-
required ? /*#__PURE__*/ (0, react_jsx_runtime__rspack_import_0.jsx)("span", {
|
|
168
|
-
className: _field_css__rspack_import_1.Zy,
|
|
169
|
-
"aria-hidden": "true",
|
|
170
|
-
children: "*"
|
|
171
|
-
}) : null
|
|
172
|
-
]
|
|
173
|
-
}) : null,
|
|
174
|
-
children,
|
|
175
|
-
description ? /*#__PURE__*/ (0, react_jsx_runtime__rspack_import_0.jsx)("p", {
|
|
176
|
-
id: `${id}-description`,
|
|
177
|
-
className: _field_css__rspack_import_1.ij,
|
|
178
|
-
children: description
|
|
179
|
-
}) : null,
|
|
180
|
-
error ? /*#__PURE__*/ (0, react_jsx_runtime__rspack_import_0.jsx)("p", {
|
|
181
|
-
id: `${id}-error`,
|
|
182
|
-
className: _field_css__rspack_import_1.kc,
|
|
183
|
-
role: "alert",
|
|
184
|
-
children: error
|
|
185
|
-
}) : null
|
|
186
|
-
]
|
|
187
|
-
});
|
|
188
|
-
const __rspack_default_export = FieldChrome;
|
|
189
|
-
__webpack_require__.d(__webpack_exports__, {}, {
|
|
190
|
-
A: __rspack_default_export,
|
|
191
|
-
z: describedByIds
|
|
192
|
-
});
|
|
193
|
-
},
|
|
194
|
-
586 (module) {
|
|
195
|
-
module.exports = require("@vinyasa/icons");
|
|
196
|
-
},
|
|
197
|
-
15 (module) {
|
|
198
|
-
module.exports = require("react");
|
|
199
|
-
},
|
|
200
|
-
29 (module) {
|
|
201
|
-
module.exports = require("react-dropzone");
|
|
202
|
-
},
|
|
203
|
-
732 (module) {
|
|
204
|
-
module.exports = require("react/jsx-runtime");
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
var __webpack_module_cache__ = {};
|
|
208
|
-
function __webpack_require__(moduleId) {
|
|
209
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
210
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
211
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
212
|
-
exports: {}
|
|
213
|
-
};
|
|
214
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
215
|
-
return module.exports;
|
|
216
|
-
}
|
|
217
|
-
(()=>{
|
|
218
|
-
__webpack_require__.n = (module)=>{
|
|
219
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
220
|
-
__webpack_require__.d(getter, {
|
|
221
|
-
a: getter
|
|
222
|
-
});
|
|
223
|
-
return getter;
|
|
224
|
-
};
|
|
225
|
-
})();
|
|
2
|
+
var __webpack_require__ = {};
|
|
226
3
|
(()=>{
|
|
227
4
|
__webpack_require__.d = (exports1, getters, values)=>{
|
|
228
5
|
var define = (defs, kind)=>{
|
|
@@ -249,179 +26,689 @@ function __webpack_require__(moduleId) {
|
|
|
249
26
|
};
|
|
250
27
|
})();
|
|
251
28
|
var __webpack_exports__ = {};
|
|
252
|
-
(
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
FileUpload: ()=>FileUpload,
|
|
32
|
+
FileUploadFileItem: ()=>DropzoneFileItem,
|
|
33
|
+
FileUploadFileList: ()=>DropzoneFileList,
|
|
34
|
+
FileUploadRejection: ()=>DropzoneRejection,
|
|
35
|
+
FileUploadTrigger: ()=>FileUploadTrigger
|
|
36
|
+
});
|
|
37
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
38
|
+
const icons_namespaceObject = require("@vinyasa/icons");
|
|
39
|
+
const external_react_namespaceObject = require("react");
|
|
40
|
+
const external_react_dropzone_namespaceObject = require("react-dropzone");
|
|
41
|
+
const react_slot_namespaceObject = require("@radix-ui/react-slot");
|
|
42
|
+
function toPrimitive(t, r) {
|
|
43
|
+
if ("object" != typeof t || !t) return t;
|
|
44
|
+
var e = t[Symbol.toPrimitive];
|
|
45
|
+
if (void 0 !== e) {
|
|
46
|
+
var i = e.call(t, r || "default");
|
|
47
|
+
if ("object" != typeof i) return i;
|
|
48
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
49
|
+
}
|
|
50
|
+
return ("string" === r ? String : Number)(t);
|
|
51
|
+
}
|
|
52
|
+
function toPropertyKey(t) {
|
|
53
|
+
var i = toPrimitive(t, "string");
|
|
54
|
+
return "symbol" == typeof i ? i : String(i);
|
|
55
|
+
}
|
|
56
|
+
function _defineProperty(obj, key, value) {
|
|
57
|
+
key = toPropertyKey(key);
|
|
58
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
59
|
+
value: value,
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true,
|
|
62
|
+
writable: true
|
|
256
63
|
});
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
var
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
64
|
+
else obj[key] = value;
|
|
65
|
+
return obj;
|
|
66
|
+
}
|
|
67
|
+
function createRuntimeFn_62c9670f_esm_ownKeys(e, r) {
|
|
68
|
+
var t = Object.keys(e);
|
|
69
|
+
if (Object.getOwnPropertySymbols) {
|
|
70
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
71
|
+
r && (o = o.filter(function(r) {
|
|
72
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
73
|
+
})), t.push.apply(t, o);
|
|
74
|
+
}
|
|
75
|
+
return t;
|
|
76
|
+
}
|
|
77
|
+
function _objectSpread2(e) {
|
|
78
|
+
for(var r = 1; r < arguments.length; r++){
|
|
79
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
80
|
+
r % 2 ? createRuntimeFn_62c9670f_esm_ownKeys(Object(t), !0).forEach(function(r) {
|
|
81
|
+
_defineProperty(e, r, t[r]);
|
|
82
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : createRuntimeFn_62c9670f_esm_ownKeys(Object(t)).forEach(function(r) {
|
|
83
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
269
84
|
});
|
|
270
|
-
else obj[key] = value;
|
|
271
|
-
return obj;
|
|
272
85
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
86
|
+
return e;
|
|
87
|
+
}
|
|
88
|
+
function mapValues(input, fn) {
|
|
89
|
+
var result = {};
|
|
90
|
+
for(var _key in input)result[_key] = fn(input[_key], _key);
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
var shouldApplyCompound = (compoundCheck, selections, defaultVariants)=>{
|
|
94
|
+
for (var key of Object.keys(compoundCheck)){
|
|
95
|
+
var _selections$key;
|
|
96
|
+
if (compoundCheck[key] !== (null != (_selections$key = selections[key]) ? _selections$key : defaultVariants[key])) return false;
|
|
97
|
+
}
|
|
98
|
+
return true;
|
|
99
|
+
};
|
|
100
|
+
var createRuntimeFn = (config)=>{
|
|
101
|
+
var runtimeFn = (options)=>{
|
|
102
|
+
var className = config.defaultClassName;
|
|
103
|
+
var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
|
|
104
|
+
for(var variantName in selections){
|
|
105
|
+
var _selections$variantNa;
|
|
106
|
+
var variantSelection = null != (_selections$variantNa = selections[variantName]) ? _selections$variantNa : config.defaultVariants[variantName];
|
|
107
|
+
if (null != variantSelection) {
|
|
108
|
+
var selection = variantSelection;
|
|
109
|
+
if ('boolean' == typeof selection) selection = true === selection ? 'true' : 'false';
|
|
110
|
+
var selectionClassName = config.variantClassNames[variantName][selection];
|
|
111
|
+
if (selectionClassName) className += ' ' + selectionClassName;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
for (var [compoundCheck, compoundClassName] of config.compoundVariants)if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) className += ' ' + compoundClassName;
|
|
115
|
+
return className;
|
|
116
|
+
};
|
|
117
|
+
runtimeFn.variants = ()=>Object.keys(config.variantClassNames);
|
|
118
|
+
runtimeFn.classNames = {
|
|
119
|
+
get base () {
|
|
120
|
+
return config.defaultClassName.split(' ')[0];
|
|
121
|
+
},
|
|
122
|
+
get variants () {
|
|
123
|
+
return mapValues(config.variantClassNames, (classNames)=>mapValues(classNames, (className)=>className.split(' ')[0]));
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
return runtimeFn;
|
|
127
|
+
};
|
|
128
|
+
var descriptionText = 'sbqkrxd';
|
|
129
|
+
var errorText = 'sbqkrxe';
|
|
130
|
+
createRuntimeFn({
|
|
131
|
+
defaultClassName: 'sbqkrx0',
|
|
132
|
+
variantClassNames: {
|
|
133
|
+
size: {
|
|
134
|
+
sm: 'sbqkrx1',
|
|
135
|
+
md: 'sbqkrx2',
|
|
136
|
+
lg: 'sbqkrx3'
|
|
137
|
+
},
|
|
138
|
+
invalid: {
|
|
139
|
+
true: 'sbqkrx4'
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
defaultVariants: {
|
|
143
|
+
size: 'md'
|
|
144
|
+
},
|
|
145
|
+
compoundVariants: []
|
|
146
|
+
});
|
|
147
|
+
var label = 'sbqkrxb';
|
|
148
|
+
var requiredMark = 'sbqkrxc';
|
|
149
|
+
function _define_property(obj, key, value) {
|
|
150
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
151
|
+
value: value,
|
|
152
|
+
enumerable: true,
|
|
153
|
+
configurable: true,
|
|
154
|
+
writable: true
|
|
155
|
+
});
|
|
156
|
+
else obj[key] = value;
|
|
157
|
+
return obj;
|
|
158
|
+
}
|
|
159
|
+
function _object_spread(target) {
|
|
160
|
+
for(var i = 1; i < arguments.length; i++){
|
|
161
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
162
|
+
var ownKeys = Object.keys(source);
|
|
163
|
+
if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
164
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
165
|
+
}));
|
|
166
|
+
ownKeys.forEach(function(key) {
|
|
167
|
+
_define_property(target, key, source[key]);
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
return target;
|
|
171
|
+
}
|
|
172
|
+
function Field_ownKeys(object, enumerableOnly) {
|
|
173
|
+
var keys = Object.keys(object);
|
|
174
|
+
if (Object.getOwnPropertySymbols) {
|
|
175
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
176
|
+
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
177
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
178
|
+
});
|
|
179
|
+
keys.push.apply(keys, symbols);
|
|
180
|
+
}
|
|
181
|
+
return keys;
|
|
182
|
+
}
|
|
183
|
+
function _object_spread_props(target, source) {
|
|
184
|
+
source = null != source ? source : {};
|
|
185
|
+
if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
186
|
+
else Field_ownKeys(Object(source)).forEach(function(key) {
|
|
187
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
188
|
+
});
|
|
189
|
+
return target;
|
|
190
|
+
}
|
|
191
|
+
function _object_without_properties(source, excluded) {
|
|
192
|
+
if (null == source) return {};
|
|
193
|
+
var target = {}, sourceKeys, key, i;
|
|
194
|
+
if ("u" > typeof Reflect && Reflect.ownKeys) {
|
|
195
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
196
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
197
|
+
key = sourceKeys[i];
|
|
198
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
199
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
200
|
+
}
|
|
283
201
|
}
|
|
284
202
|
return target;
|
|
285
203
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
204
|
+
target = _object_without_properties_loose(source, excluded);
|
|
205
|
+
if (Object.getOwnPropertySymbols) {
|
|
206
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
207
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
208
|
+
key = sourceKeys[i];
|
|
209
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
210
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
211
|
+
}
|
|
294
212
|
}
|
|
295
|
-
return keys;
|
|
296
213
|
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
214
|
+
return target;
|
|
215
|
+
}
|
|
216
|
+
function _object_without_properties_loose(source, excluded) {
|
|
217
|
+
if (null == source) return {};
|
|
218
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
219
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
220
|
+
key = sourceKeys[i];
|
|
221
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
222
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return target;
|
|
226
|
+
}
|
|
227
|
+
const FieldContext = /*#__PURE__*/ (0, external_react_namespaceObject.createContext)(null);
|
|
228
|
+
const useFieldContext = ()=>(0, external_react_namespaceObject.useContext)(FieldContext);
|
|
229
|
+
const useResolvedFieldProps = (props)=>{
|
|
230
|
+
var _ref, _props_id, _ref1, _props_invalid, _props_describedBy;
|
|
231
|
+
const context = useFieldContext();
|
|
232
|
+
const generatedId = (0, external_react_namespaceObject.useId)();
|
|
233
|
+
return {
|
|
234
|
+
id: null != (_ref = null != (_props_id = props.id) ? _props_id : null == context ? void 0 : context.id) ? _ref : generatedId,
|
|
235
|
+
invalid: null != (_ref1 = null != (_props_invalid = props.invalid) ? _props_invalid : null == context ? void 0 : context.invalid) ? _ref1 : false,
|
|
236
|
+
describedBy: null != (_props_describedBy = props.describedBy) ? _props_describedBy : null == context ? void 0 : context.describedBy
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
const Field = (_0)=>{
|
|
240
|
+
let { invalid = false, children } = _0, rest = _object_without_properties(_0, [
|
|
241
|
+
"invalid",
|
|
242
|
+
"children"
|
|
243
|
+
]);
|
|
244
|
+
const generatedId = (0, external_react_namespaceObject.useId)();
|
|
245
|
+
const descriptionId = `${generatedId}-description`;
|
|
246
|
+
const errorId = `${generatedId}-error`;
|
|
247
|
+
const labelId = `${generatedId}-label`;
|
|
248
|
+
const directChildren = external_react_namespaceObject.Children.toArray(children).filter(external_react_namespaceObject.isValidElement);
|
|
249
|
+
const describedByIds = directChildren.reduce((ids, child)=>{
|
|
250
|
+
if (child.type === FieldDescription) ids.push(descriptionId);
|
|
251
|
+
if (child.type === FieldError) ids.push(errorId);
|
|
252
|
+
return ids;
|
|
253
|
+
}, []);
|
|
254
|
+
const labelChild = directChildren.find((child)=>child.type === FieldLabel);
|
|
255
|
+
const labelChildText = labelChild && 'string' == typeof labelChild.props.children ? labelChild.props.children : void 0;
|
|
256
|
+
const value = {
|
|
257
|
+
id: generatedId,
|
|
258
|
+
descriptionId,
|
|
259
|
+
errorId,
|
|
260
|
+
describedBy: describedByIds.length > 0 ? describedByIds.join(' ') : void 0,
|
|
261
|
+
invalid,
|
|
262
|
+
labelId: labelChild ? labelId : void 0,
|
|
263
|
+
labelText: labelChildText
|
|
264
|
+
};
|
|
265
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(FieldContext.Provider, {
|
|
266
|
+
value: value,
|
|
267
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", _object_spread_props(_object_spread({}, rest), {
|
|
268
|
+
children: children
|
|
269
|
+
}))
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
Field.displayName = 'Field';
|
|
273
|
+
const FieldLabel = (_0)=>{
|
|
274
|
+
let { required, htmlFor, id, children } = _0, rest = _object_without_properties(_0, [
|
|
275
|
+
"required",
|
|
276
|
+
"htmlFor",
|
|
277
|
+
"id",
|
|
278
|
+
"children"
|
|
279
|
+
]);
|
|
280
|
+
const context = useFieldContext();
|
|
281
|
+
const resolvedHtmlFor = false === htmlFor ? void 0 : null != htmlFor ? htmlFor : null == context ? void 0 : context.id;
|
|
282
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("label", _object_spread_props(_object_spread({
|
|
283
|
+
htmlFor: resolvedHtmlFor,
|
|
284
|
+
id: null != id ? id : null == context ? void 0 : context.labelId,
|
|
285
|
+
className: label
|
|
286
|
+
}, rest), {
|
|
287
|
+
children: [
|
|
288
|
+
children,
|
|
289
|
+
required ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
290
|
+
className: requiredMark,
|
|
291
|
+
"aria-hidden": "true",
|
|
292
|
+
children: "*"
|
|
293
|
+
}) : null
|
|
294
|
+
]
|
|
295
|
+
}));
|
|
296
|
+
};
|
|
297
|
+
FieldLabel.displayName = 'FieldLabel';
|
|
298
|
+
const FieldControl = (_0)=>{
|
|
299
|
+
let { children } = _0, rest = _object_without_properties(_0, [
|
|
300
|
+
"children"
|
|
301
|
+
]);
|
|
302
|
+
const context = useFieldContext();
|
|
303
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_slot_namespaceObject.Slot, _object_spread_props(_object_spread({
|
|
304
|
+
id: null == context ? void 0 : context.id,
|
|
305
|
+
"aria-describedby": null == context ? void 0 : context.describedBy,
|
|
306
|
+
"aria-invalid": null == context ? void 0 : context.invalid
|
|
307
|
+
}, rest), {
|
|
308
|
+
children: children
|
|
309
|
+
}));
|
|
310
|
+
};
|
|
311
|
+
FieldControl.displayName = 'FieldControl';
|
|
312
|
+
const FieldDescription = (_0)=>{
|
|
313
|
+
let { id } = _0, rest = _object_without_properties(_0, [
|
|
314
|
+
"id"
|
|
315
|
+
]);
|
|
316
|
+
const context = useFieldContext();
|
|
317
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", _object_spread({
|
|
318
|
+
id: null != id ? id : null == context ? void 0 : context.descriptionId,
|
|
319
|
+
className: descriptionText
|
|
320
|
+
}, rest));
|
|
321
|
+
};
|
|
322
|
+
FieldDescription.displayName = "FieldDescription";
|
|
323
|
+
const FieldError = (_0)=>{
|
|
324
|
+
let { id } = _0, rest = _object_without_properties(_0, [
|
|
325
|
+
"id"
|
|
326
|
+
]);
|
|
327
|
+
const context = useFieldContext();
|
|
328
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", _object_spread({
|
|
329
|
+
id: null != id ? id : null == context ? void 0 : context.errorId,
|
|
330
|
+
className: errorText,
|
|
331
|
+
role: "alert"
|
|
332
|
+
}, rest));
|
|
333
|
+
};
|
|
334
|
+
FieldError.displayName = 'FieldError';
|
|
335
|
+
var fileList = '_3ltn2y2';
|
|
336
|
+
var fileListWrapper = '_3ltn2y1';
|
|
337
|
+
var fileMeta = '_3ltn2y7';
|
|
338
|
+
var fileName = '_3ltn2y4';
|
|
339
|
+
var fileNameIcon = '_3ltn2y5';
|
|
340
|
+
var fileNameText = '_3ltn2y6';
|
|
341
|
+
var fileRemove = '_3ltn2y9';
|
|
342
|
+
var fileRow = '_3ltn2y3';
|
|
343
|
+
var fileSize = '_3ltn2y8';
|
|
344
|
+
var rejectionText = '_3ltn2ya';
|
|
345
|
+
var trigger = '_3ltn2y0';
|
|
346
|
+
var Dropzone_css_area = 'rnivxt0';
|
|
347
|
+
var areaActive = 'rnivxt1';
|
|
348
|
+
var hint = 'rnivxt3';
|
|
349
|
+
var icon = 'rnivxt2';
|
|
350
|
+
function Dropzone_define_property(obj, key, value) {
|
|
351
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
352
|
+
value: value,
|
|
353
|
+
enumerable: true,
|
|
354
|
+
configurable: true,
|
|
355
|
+
writable: true
|
|
356
|
+
});
|
|
357
|
+
else obj[key] = value;
|
|
358
|
+
return obj;
|
|
359
|
+
}
|
|
360
|
+
function Dropzone_object_spread(target) {
|
|
361
|
+
for(var i = 1; i < arguments.length; i++){
|
|
362
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
363
|
+
var ownKeys = Object.keys(source);
|
|
364
|
+
if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
365
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
366
|
+
}));
|
|
367
|
+
ownKeys.forEach(function(key) {
|
|
368
|
+
Dropzone_define_property(target, key, source[key]);
|
|
302
369
|
});
|
|
370
|
+
}
|
|
371
|
+
return target;
|
|
372
|
+
}
|
|
373
|
+
function Dropzone_ownKeys(object, enumerableOnly) {
|
|
374
|
+
var keys = Object.keys(object);
|
|
375
|
+
if (Object.getOwnPropertySymbols) {
|
|
376
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
377
|
+
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
378
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
379
|
+
});
|
|
380
|
+
keys.push.apply(keys, symbols);
|
|
381
|
+
}
|
|
382
|
+
return keys;
|
|
383
|
+
}
|
|
384
|
+
function Dropzone_object_spread_props(target, source) {
|
|
385
|
+
source = null != source ? source : {};
|
|
386
|
+
if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
387
|
+
else Dropzone_ownKeys(Object(source)).forEach(function(key) {
|
|
388
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
389
|
+
});
|
|
390
|
+
return target;
|
|
391
|
+
}
|
|
392
|
+
function Dropzone_object_without_properties(source, excluded) {
|
|
393
|
+
if (null == source) return {};
|
|
394
|
+
var target = {}, sourceKeys, key, i;
|
|
395
|
+
if ("u" > typeof Reflect && Reflect.ownKeys) {
|
|
396
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
397
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
398
|
+
key = sourceKeys[i];
|
|
399
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
400
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
401
|
+
}
|
|
402
|
+
}
|
|
303
403
|
return target;
|
|
304
404
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
405
|
+
target = Dropzone_object_without_properties_loose(source, excluded);
|
|
406
|
+
if (Object.getOwnPropertySymbols) {
|
|
407
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
408
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
409
|
+
key = sourceKeys[i];
|
|
410
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
411
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return target;
|
|
416
|
+
}
|
|
417
|
+
function Dropzone_object_without_properties_loose(source, excluded) {
|
|
418
|
+
if (null == source) return {};
|
|
419
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
420
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
421
|
+
key = sourceKeys[i];
|
|
422
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
423
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
return target;
|
|
427
|
+
}
|
|
428
|
+
const formatFileSize = (bytes)=>{
|
|
429
|
+
if (bytes < 1024) return `${String(bytes)} B`;
|
|
430
|
+
if (bytes < 1048576) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
431
|
+
return `${(bytes / 1048576).toFixed(1)} MB`;
|
|
432
|
+
};
|
|
433
|
+
const DropzoneContext = /*#__PURE__*/ (0, external_react_namespaceObject.createContext)(null);
|
|
434
|
+
const useDropzoneContext = ()=>(0, external_react_namespaceObject.useContext)(DropzoneContext);
|
|
435
|
+
const Dropzone = ({ value, onValueChange, accept, maxFiles, maxSize, invalid, disabled, id: idProp, children })=>{
|
|
436
|
+
var _useFieldContext;
|
|
437
|
+
const [internalFiles, setInternalFiles] = (0, external_react_namespaceObject.useState)([]);
|
|
438
|
+
const isControlled = void 0 !== value;
|
|
439
|
+
const currentFiles = isControlled ? value : internalFiles;
|
|
440
|
+
const [rejectionMessage, setRejectionMessage] = (0, external_react_namespaceObject.useState)();
|
|
441
|
+
const { id, invalid: isInvalid, describedBy } = useResolvedFieldProps({
|
|
442
|
+
id: idProp,
|
|
443
|
+
invalid
|
|
444
|
+
});
|
|
445
|
+
const labelId = null == (_useFieldContext = useFieldContext()) ? void 0 : _useFieldContext.labelId;
|
|
446
|
+
const setFiles = (next)=>{
|
|
447
|
+
if (!isControlled) setInternalFiles(next);
|
|
448
|
+
null == onValueChange || onValueChange(next);
|
|
309
449
|
};
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
450
|
+
const removeFile = (file)=>{
|
|
451
|
+
setFiles(currentFiles.filter((entry)=>entry !== file));
|
|
452
|
+
};
|
|
453
|
+
const { getRootProps, getInputProps, isDragActive } = (0, external_react_dropzone_namespaceObject.useDropzone)({
|
|
454
|
+
accept,
|
|
455
|
+
maxFiles,
|
|
456
|
+
maxSize,
|
|
457
|
+
disabled,
|
|
458
|
+
onDrop: (acceptedFiles, fileRejections)=>{
|
|
459
|
+
if (fileRejections.length > 0) {
|
|
460
|
+
var _fileRejections__errors_, _fileRejections_;
|
|
461
|
+
setRejectionMessage(null == (_fileRejections_ = fileRejections[0]) ? void 0 : null == (_fileRejections__errors_ = _fileRejections_.errors[0]) ? void 0 : _fileRejections__errors_.message);
|
|
462
|
+
} else setRejectionMessage(void 0);
|
|
463
|
+
if (acceptedFiles.length > 0) setFiles([
|
|
464
|
+
...currentFiles,
|
|
465
|
+
...acceptedFiles
|
|
466
|
+
]);
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DropzoneContext.Provider, {
|
|
470
|
+
value: {
|
|
471
|
+
getRootProps,
|
|
472
|
+
getInputProps,
|
|
473
|
+
isDragActive,
|
|
474
|
+
files: currentFiles,
|
|
475
|
+
removeFile,
|
|
476
|
+
rejectionMessage,
|
|
327
477
|
maxSize,
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
478
|
+
id,
|
|
479
|
+
invalid: isInvalid,
|
|
480
|
+
describedBy,
|
|
481
|
+
labelId,
|
|
482
|
+
disabled
|
|
483
|
+
},
|
|
484
|
+
children: children
|
|
485
|
+
});
|
|
486
|
+
};
|
|
487
|
+
Dropzone.displayName = 'Dropzone';
|
|
488
|
+
const DropzoneTrigger = (_0)=>{
|
|
489
|
+
let { className } = _0, rest = Dropzone_object_without_properties(_0, [
|
|
490
|
+
"className"
|
|
491
|
+
]);
|
|
492
|
+
var _useContext;
|
|
493
|
+
const { getRootProps, getInputProps, isDragActive = false, id, disabled, invalid, describedBy, labelId, maxSize } = null != (_useContext = (0, external_react_namespaceObject.useContext)(DropzoneContext)) ? _useContext : {};
|
|
494
|
+
const base = isDragActive ? `${Dropzone_css_area} ${areaActive}` : Dropzone_css_area;
|
|
495
|
+
const promptText = isDragActive ? 'Drop the files here…' : 'Drag files here, or click to browse';
|
|
496
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", Dropzone_object_spread_props(Dropzone_object_spread(Dropzone_object_spread_props(Dropzone_object_spread({}, null == getRootProps ? void 0 : getRootProps({
|
|
497
|
+
id,
|
|
498
|
+
'data-disabled': disabled
|
|
499
|
+
})), {
|
|
500
|
+
"aria-labelledby": labelId,
|
|
501
|
+
"aria-invalid": invalid,
|
|
502
|
+
"aria-describedby": describedBy,
|
|
503
|
+
className: className ? `${base} ${className}` : base
|
|
504
|
+
}), rest), {
|
|
505
|
+
children: [
|
|
506
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("input", Dropzone_object_spread({}, null == getInputProps ? void 0 : getInputProps())),
|
|
507
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
508
|
+
className: icon,
|
|
509
|
+
"aria-hidden": "true",
|
|
510
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.UploadIcon, {})
|
|
511
|
+
}),
|
|
512
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
513
|
+
children: promptText
|
|
514
|
+
}),
|
|
515
|
+
maxSize ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
516
|
+
className: hint,
|
|
517
|
+
children: [
|
|
518
|
+
"Up to ",
|
|
519
|
+
formatFileSize(maxSize),
|
|
520
|
+
" per file"
|
|
521
|
+
]
|
|
522
|
+
}) : null
|
|
523
|
+
]
|
|
524
|
+
}));
|
|
525
|
+
};
|
|
526
|
+
DropzoneTrigger.displayName = 'DropzoneTrigger';
|
|
527
|
+
const DropzoneRejection = ()=>{
|
|
528
|
+
const context = (0, external_react_namespaceObject.useContext)(DropzoneContext);
|
|
529
|
+
if (!(null == context ? void 0 : context.rejectionMessage)) return null;
|
|
530
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
|
|
531
|
+
className: rejectionText,
|
|
532
|
+
children: context.rejectionMessage
|
|
533
|
+
});
|
|
534
|
+
};
|
|
535
|
+
DropzoneRejection.displayName = 'DropzoneRejection';
|
|
536
|
+
const DropzoneFileItem = ({ file, onRemove })=>{
|
|
537
|
+
const context = (0, external_react_namespaceObject.useContext)(DropzoneContext);
|
|
538
|
+
const handleRemove = null != onRemove ? onRemove : ()=>null == context ? void 0 : context.removeFile(file);
|
|
539
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("li", {
|
|
540
|
+
className: fileRow,
|
|
541
|
+
children: [
|
|
542
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
543
|
+
className: fileName,
|
|
544
|
+
children: [
|
|
545
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.PaperclipIcon, {
|
|
546
|
+
"aria-hidden": "true",
|
|
547
|
+
className: fileNameIcon
|
|
548
|
+
}),
|
|
549
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
550
|
+
className: fileNameText,
|
|
551
|
+
title: file.name,
|
|
552
|
+
children: file.name
|
|
553
|
+
})
|
|
554
|
+
]
|
|
555
|
+
}),
|
|
556
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
557
|
+
className: fileMeta,
|
|
558
|
+
children: [
|
|
559
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
560
|
+
className: fileSize,
|
|
561
|
+
children: formatFileSize(file.size)
|
|
359
562
|
}),
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
]
|
|
367
|
-
})),
|
|
368
|
-
rejectionMessage ? /*#__PURE__*/ (0, jsx_runtime_.jsx)("p", {
|
|
369
|
-
className: FileUpload_css.xX,
|
|
370
|
-
children: rejectionMessage
|
|
371
|
-
}) : null,
|
|
372
|
-
currentFiles.length > 0 ? /*#__PURE__*/ (0, jsx_runtime_.jsx)("div", {
|
|
373
|
-
className: FileUpload_css.af,
|
|
374
|
-
children: /*#__PURE__*/ (0, jsx_runtime_.jsx)("ul", {
|
|
375
|
-
className: FileUpload_css.$Y,
|
|
376
|
-
children: currentFiles.map((file)=>/*#__PURE__*/ (0, jsx_runtime_.jsxs)("li", {
|
|
377
|
-
className: FileUpload_css.ho,
|
|
378
|
-
children: [
|
|
379
|
-
/*#__PURE__*/ (0, jsx_runtime_.jsxs)("span", {
|
|
380
|
-
className: FileUpload_css.Md,
|
|
381
|
-
children: [
|
|
382
|
-
/*#__PURE__*/ (0, jsx_runtime_.jsx)(icons_.PaperclipIcon, {
|
|
383
|
-
"aria-hidden": "true",
|
|
384
|
-
className: FileUpload_css.vH
|
|
385
|
-
}),
|
|
386
|
-
/*#__PURE__*/ (0, jsx_runtime_.jsx)("span", {
|
|
387
|
-
className: FileUpload_css.$u,
|
|
388
|
-
title: file.name,
|
|
389
|
-
children: file.name
|
|
390
|
-
})
|
|
391
|
-
]
|
|
392
|
-
}),
|
|
393
|
-
/*#__PURE__*/ (0, jsx_runtime_.jsxs)("span", {
|
|
394
|
-
className: FileUpload_css.gM,
|
|
395
|
-
children: [
|
|
396
|
-
/*#__PURE__*/ (0, jsx_runtime_.jsx)("span", {
|
|
397
|
-
className: FileUpload_css.Ov,
|
|
398
|
-
children: formatFileSize(file.size)
|
|
399
|
-
}),
|
|
400
|
-
/*#__PURE__*/ (0, jsx_runtime_.jsx)("button", {
|
|
401
|
-
type: "button",
|
|
402
|
-
className: FileUpload_css.ZN,
|
|
403
|
-
"aria-label": `Remove ${file.name}`,
|
|
404
|
-
onClick: ()=>{
|
|
405
|
-
removeFile(file);
|
|
406
|
-
},
|
|
407
|
-
children: /*#__PURE__*/ (0, jsx_runtime_.jsx)(icons_.XIcon, {})
|
|
408
|
-
})
|
|
409
|
-
]
|
|
410
|
-
})
|
|
411
|
-
]
|
|
412
|
-
}, `${file.name}-${String(file.lastModified)}`))
|
|
563
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
564
|
+
type: "button",
|
|
565
|
+
className: fileRemove,
|
|
566
|
+
"aria-label": `Remove ${file.name}`,
|
|
567
|
+
onClick: handleRemove,
|
|
568
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.XIcon, {})
|
|
413
569
|
})
|
|
414
|
-
|
|
415
|
-
|
|
570
|
+
]
|
|
571
|
+
})
|
|
572
|
+
]
|
|
573
|
+
});
|
|
574
|
+
};
|
|
575
|
+
DropzoneFileItem.displayName = 'DropzoneFileItem';
|
|
576
|
+
const DropzoneFileList = ()=>{
|
|
577
|
+
const context = (0, external_react_namespaceObject.useContext)(DropzoneContext);
|
|
578
|
+
if (!context || 0 === context.files.length) return null;
|
|
579
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
580
|
+
className: fileListWrapper,
|
|
581
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("ul", {
|
|
582
|
+
className: fileList,
|
|
583
|
+
children: context.files.map((file)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DropzoneFileItem, {
|
|
584
|
+
file: file
|
|
585
|
+
}, `${file.name}-${String(file.lastModified)}`))
|
|
586
|
+
})
|
|
587
|
+
});
|
|
588
|
+
};
|
|
589
|
+
DropzoneFileList.displayName = 'DropzoneFileList';
|
|
590
|
+
function FileUpload_define_property(obj, key, value) {
|
|
591
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
592
|
+
value: value,
|
|
593
|
+
enumerable: true,
|
|
594
|
+
configurable: true,
|
|
595
|
+
writable: true
|
|
596
|
+
});
|
|
597
|
+
else obj[key] = value;
|
|
598
|
+
return obj;
|
|
599
|
+
}
|
|
600
|
+
function FileUpload_object_spread(target) {
|
|
601
|
+
for(var i = 1; i < arguments.length; i++){
|
|
602
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
603
|
+
var ownKeys = Object.keys(source);
|
|
604
|
+
if ("function" == typeof Object.getOwnPropertySymbols) ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
605
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
606
|
+
}));
|
|
607
|
+
ownKeys.forEach(function(key) {
|
|
608
|
+
FileUpload_define_property(target, key, source[key]);
|
|
416
609
|
});
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
610
|
+
}
|
|
611
|
+
return target;
|
|
612
|
+
}
|
|
613
|
+
function FileUpload_ownKeys(object, enumerableOnly) {
|
|
614
|
+
var keys = Object.keys(object);
|
|
615
|
+
if (Object.getOwnPropertySymbols) {
|
|
616
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
617
|
+
if (enumerableOnly) symbols = symbols.filter(function(sym) {
|
|
618
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
619
|
+
});
|
|
620
|
+
keys.push.apply(keys, symbols);
|
|
621
|
+
}
|
|
622
|
+
return keys;
|
|
623
|
+
}
|
|
624
|
+
function FileUpload_object_spread_props(target, source) {
|
|
625
|
+
source = null != source ? source : {};
|
|
626
|
+
if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
627
|
+
else FileUpload_ownKeys(Object(source)).forEach(function(key) {
|
|
628
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
629
|
+
});
|
|
630
|
+
return target;
|
|
631
|
+
}
|
|
632
|
+
function FileUpload_object_without_properties(source, excluded) {
|
|
633
|
+
if (null == source) return {};
|
|
634
|
+
var target = {}, sourceKeys, key, i;
|
|
635
|
+
if ("u" > typeof Reflect && Reflect.ownKeys) {
|
|
636
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
637
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
638
|
+
key = sourceKeys[i];
|
|
639
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
640
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
return target;
|
|
644
|
+
}
|
|
645
|
+
target = FileUpload_object_without_properties_loose(source, excluded);
|
|
646
|
+
if (Object.getOwnPropertySymbols) {
|
|
647
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
648
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
649
|
+
key = sourceKeys[i];
|
|
650
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
651
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
return target;
|
|
656
|
+
}
|
|
657
|
+
function FileUpload_object_without_properties_loose(source, excluded) {
|
|
658
|
+
if (null == source) return {};
|
|
659
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
660
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
661
|
+
key = sourceKeys[i];
|
|
662
|
+
if (!(excluded.indexOf(key) >= 0)) {
|
|
663
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key)) target[key] = source[key];
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
return target;
|
|
667
|
+
}
|
|
668
|
+
const FileUpload = Dropzone;
|
|
669
|
+
const FileUploadTrigger = (_0)=>{
|
|
670
|
+
let { className, children } = _0, rest = FileUpload_object_without_properties(_0, [
|
|
671
|
+
"className",
|
|
672
|
+
"children"
|
|
673
|
+
]);
|
|
674
|
+
const context = useDropzoneContext();
|
|
675
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("button", FileUpload_object_spread_props(FileUpload_object_spread(FileUpload_object_spread_props(FileUpload_object_spread({
|
|
676
|
+
type: "button"
|
|
677
|
+
}, null == context ? void 0 : context.getRootProps({
|
|
678
|
+
id: context.id,
|
|
679
|
+
role: 'button',
|
|
680
|
+
'data-disabled': context.disabled,
|
|
681
|
+
disabled: context.disabled
|
|
682
|
+
})), {
|
|
683
|
+
"aria-invalid": null == context ? void 0 : context.invalid,
|
|
684
|
+
"aria-describedby": null == context ? void 0 : context.describedBy,
|
|
685
|
+
className: className ? `${trigger} ${className}` : trigger
|
|
686
|
+
}), rest), {
|
|
687
|
+
children: [
|
|
688
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("input", FileUpload_object_spread({}, null == context ? void 0 : context.getInputProps())),
|
|
689
|
+
null != children ? children : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
690
|
+
children: [
|
|
691
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.UploadIcon, {
|
|
692
|
+
"aria-hidden": "true"
|
|
693
|
+
}),
|
|
694
|
+
"Choose files"
|
|
695
|
+
]
|
|
696
|
+
})
|
|
697
|
+
]
|
|
698
|
+
}));
|
|
699
|
+
};
|
|
700
|
+
FileUploadTrigger.displayName = 'FileUploadTrigger';
|
|
701
|
+
exports.FileUpload = __webpack_exports__.FileUpload;
|
|
702
|
+
exports.FileUploadFileItem = __webpack_exports__.FileUploadFileItem;
|
|
703
|
+
exports.FileUploadFileList = __webpack_exports__.FileUploadFileList;
|
|
704
|
+
exports.FileUploadRejection = __webpack_exports__.FileUploadRejection;
|
|
705
|
+
exports.FileUploadTrigger = __webpack_exports__.FileUploadTrigger;
|
|
423
706
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
424
|
-
"
|
|
707
|
+
"FileUpload",
|
|
708
|
+
"FileUploadFileItem",
|
|
709
|
+
"FileUploadFileList",
|
|
710
|
+
"FileUploadRejection",
|
|
711
|
+
"FileUploadTrigger"
|
|
425
712
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
426
713
|
Object.defineProperty(exports, '__esModule', {
|
|
427
714
|
value: true
|