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