@timeax/form-palette 0.0.15 → 0.0.17
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/index.d.mts +101 -3
- package/dist/index.d.ts +101 -3
- package/dist/index.js +2027 -576
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2027 -576
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1179,11 +1179,11 @@ var init_parseHeaders = __esm({
|
|
|
1179
1179
|
function normalizeHeader(header) {
|
|
1180
1180
|
return header && String(header).trim().toLowerCase();
|
|
1181
1181
|
}
|
|
1182
|
-
function
|
|
1182
|
+
function normalizeValue2(value) {
|
|
1183
1183
|
if (value === false || value == null) {
|
|
1184
1184
|
return value;
|
|
1185
1185
|
}
|
|
1186
|
-
return utils_default.isArray(value) ? value.map(
|
|
1186
|
+
return utils_default.isArray(value) ? value.map(normalizeValue2) : String(value);
|
|
1187
1187
|
}
|
|
1188
1188
|
function parseTokens(str) {
|
|
1189
1189
|
const tokens = /* @__PURE__ */ Object.create(null);
|
|
@@ -1245,7 +1245,7 @@ var init_AxiosHeaders = __esm({
|
|
|
1245
1245
|
}
|
|
1246
1246
|
const key = utils_default.findKey(self2, lHeader);
|
|
1247
1247
|
if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
|
|
1248
|
-
self2[key || _header] =
|
|
1248
|
+
self2[key || _header] = normalizeValue2(_value);
|
|
1249
1249
|
}
|
|
1250
1250
|
}
|
|
1251
1251
|
const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
@@ -1336,7 +1336,7 @@ var init_AxiosHeaders = __esm({
|
|
|
1336
1336
|
utils_default.forEach(this, (value, header) => {
|
|
1337
1337
|
const key = utils_default.findKey(headers, header);
|
|
1338
1338
|
if (key) {
|
|
1339
|
-
self2[key] =
|
|
1339
|
+
self2[key] = normalizeValue2(value);
|
|
1340
1340
|
delete self2[header];
|
|
1341
1341
|
return;
|
|
1342
1342
|
}
|
|
@@ -1344,7 +1344,7 @@ var init_AxiosHeaders = __esm({
|
|
|
1344
1344
|
if (normalized !== header) {
|
|
1345
1345
|
delete self2[header];
|
|
1346
1346
|
}
|
|
1347
|
-
self2[normalized] =
|
|
1347
|
+
self2[normalized] = normalizeValue2(value);
|
|
1348
1348
|
headers[normalized] = true;
|
|
1349
1349
|
});
|
|
1350
1350
|
return this;
|
|
@@ -14089,516 +14089,6 @@ function CoreRoot(props) {
|
|
|
14089
14089
|
children
|
|
14090
14090
|
] });
|
|
14091
14091
|
}
|
|
14092
|
-
function CoreShell(props) {
|
|
14093
|
-
if (props.wrapped) {
|
|
14094
|
-
const {
|
|
14095
|
-
formProps: formProps2,
|
|
14096
|
-
children: children2,
|
|
14097
|
-
wrapped,
|
|
14098
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
14099
|
-
gap,
|
|
14100
|
-
contentClassName,
|
|
14101
|
-
...coreProps2
|
|
14102
|
-
} = props;
|
|
14103
|
-
const content = /* @__PURE__ */ jsxRuntime.jsx(
|
|
14104
|
-
"div",
|
|
14105
|
-
{
|
|
14106
|
-
className: contentClassName,
|
|
14107
|
-
style: gap !== void 0 ? { gap } : void 0,
|
|
14108
|
-
children: children2
|
|
14109
|
-
}
|
|
14110
|
-
);
|
|
14111
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CoreProvider, { ...coreProps2, children: /* @__PURE__ */ jsxRuntime.jsx(CoreRoot, { ...formProps2 != null ? formProps2 : {}, children: content }) });
|
|
14112
|
-
}
|
|
14113
|
-
const { formProps, children, ...coreProps } = props;
|
|
14114
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CoreProvider, { ...coreProps, children: /* @__PURE__ */ jsxRuntime.jsx(CoreRoot, { ...formProps != null ? formProps : {}, children }) });
|
|
14115
|
-
}
|
|
14116
|
-
function useButton(options) {
|
|
14117
|
-
const form = useCoreContext();
|
|
14118
|
-
const { name, submit, disabled: disabledProp = false, onClick } = options;
|
|
14119
|
-
const [loading, setLoadingState] = React54__namespace.useState(false);
|
|
14120
|
-
const [disabled, setDisabledState] = React54__namespace.useState(
|
|
14121
|
-
Boolean(disabledProp)
|
|
14122
|
-
);
|
|
14123
|
-
const ref = React54__namespace.useRef(null);
|
|
14124
|
-
const optsRef = React54__namespace.useRef(options);
|
|
14125
|
-
React54__namespace.useEffect(() => {
|
|
14126
|
-
optsRef.current = options;
|
|
14127
|
-
}, [options]);
|
|
14128
|
-
const buttonRef = React54__namespace.useRef(null);
|
|
14129
|
-
if (!buttonRef.current) {
|
|
14130
|
-
const btn = {
|
|
14131
|
-
name,
|
|
14132
|
-
// Accessor for "loading" as required by ButtonRef
|
|
14133
|
-
set loading(v) {
|
|
14134
|
-
setLoadingState(v);
|
|
14135
|
-
},
|
|
14136
|
-
// Accessor for "disable" (note: interface uses `disable`, not `disabled`)
|
|
14137
|
-
//@ts-ignore
|
|
14138
|
-
set disable(v) {
|
|
14139
|
-
setDisabledState(v);
|
|
14140
|
-
},
|
|
14141
|
-
// Extra properties used by CoreProvider via any-casts
|
|
14142
|
-
get loading() {
|
|
14143
|
-
return loading;
|
|
14144
|
-
},
|
|
14145
|
-
setDisabled(v) {
|
|
14146
|
-
setDisabledState(v);
|
|
14147
|
-
},
|
|
14148
|
-
get disabled() {
|
|
14149
|
-
return disabled;
|
|
14150
|
-
},
|
|
14151
|
-
ref
|
|
14152
|
-
};
|
|
14153
|
-
btn.setLoading = (v) => {
|
|
14154
|
-
setLoadingState(v);
|
|
14155
|
-
};
|
|
14156
|
-
buttonRef.current = btn;
|
|
14157
|
-
}
|
|
14158
|
-
React54__namespace.useEffect(() => {
|
|
14159
|
-
if (!buttonRef.current) return;
|
|
14160
|
-
buttonRef.current.name = name;
|
|
14161
|
-
}, [name]);
|
|
14162
|
-
React54__namespace.useEffect(() => {
|
|
14163
|
-
if (!buttonRef.current) return;
|
|
14164
|
-
form.button = buttonRef.current;
|
|
14165
|
-
return () => {
|
|
14166
|
-
const anyForm = form;
|
|
14167
|
-
if (anyForm.button === buttonRef.current) {
|
|
14168
|
-
anyForm.button = null;
|
|
14169
|
-
}
|
|
14170
|
-
};
|
|
14171
|
-
}, [form]);
|
|
14172
|
-
const handleClick = (event) => {
|
|
14173
|
-
const currentOpts = optsRef.current;
|
|
14174
|
-
const shouldSubmit = !!currentOpts.submit;
|
|
14175
|
-
if (currentOpts.onClick) {
|
|
14176
|
-
currentOpts.onClick(event, form);
|
|
14177
|
-
}
|
|
14178
|
-
if (event.defaultPrevented) {
|
|
14179
|
-
return;
|
|
14180
|
-
}
|
|
14181
|
-
if (shouldSubmit) {
|
|
14182
|
-
form.setActiveButton(currentOpts.name);
|
|
14183
|
-
form.go();
|
|
14184
|
-
}
|
|
14185
|
-
};
|
|
14186
|
-
const setLoading = (v) => {
|
|
14187
|
-
setLoadingState(v);
|
|
14188
|
-
};
|
|
14189
|
-
const setDisabled = (v) => {
|
|
14190
|
-
setDisabledState(v);
|
|
14191
|
-
};
|
|
14192
|
-
return {
|
|
14193
|
-
loading,
|
|
14194
|
-
setLoading,
|
|
14195
|
-
disabled,
|
|
14196
|
-
setDisabled,
|
|
14197
|
-
ref,
|
|
14198
|
-
onClick: handleClick,
|
|
14199
|
-
buttonProps: {
|
|
14200
|
-
ref,
|
|
14201
|
-
disabled: disabled || loading,
|
|
14202
|
-
"data-loading": loading ? "true" : "false",
|
|
14203
|
-
onClick: handleClick
|
|
14204
|
-
}
|
|
14205
|
-
};
|
|
14206
|
-
}
|
|
14207
|
-
function useField(options) {
|
|
14208
|
-
var _a;
|
|
14209
|
-
const form = useCoreContext();
|
|
14210
|
-
const {
|
|
14211
|
-
name: rawName,
|
|
14212
|
-
bindId: rawBindId,
|
|
14213
|
-
bind: bind2,
|
|
14214
|
-
shared,
|
|
14215
|
-
groupId,
|
|
14216
|
-
alias,
|
|
14217
|
-
main,
|
|
14218
|
-
ignore,
|
|
14219
|
-
required: requiredProp = false,
|
|
14220
|
-
defaultValue,
|
|
14221
|
-
disabled: disabledProp = false,
|
|
14222
|
-
readOnly: readOnlyProp = false,
|
|
14223
|
-
validate,
|
|
14224
|
-
getOriginalValue,
|
|
14225
|
-
onValueChange
|
|
14226
|
-
} = options;
|
|
14227
|
-
const ref = React54__namespace.useRef(null);
|
|
14228
|
-
const stateRef = React54__namespace.useRef({
|
|
14229
|
-
value: defaultValue,
|
|
14230
|
-
error: "",
|
|
14231
|
-
loading: false,
|
|
14232
|
-
original: getOriginalValue ? getOriginalValue(defaultValue) : defaultValue
|
|
14233
|
-
});
|
|
14234
|
-
const [value, setValueState] = React54__namespace.useState(
|
|
14235
|
-
stateRef.current.value
|
|
14236
|
-
);
|
|
14237
|
-
const [error, setErrorState] = React54__namespace.useState(
|
|
14238
|
-
stateRef.current.error
|
|
14239
|
-
);
|
|
14240
|
-
const [loading, setLoadingState] = React54__namespace.useState(
|
|
14241
|
-
stateRef.current.loading
|
|
14242
|
-
);
|
|
14243
|
-
const [required, setRequired] = React54__namespace.useState(
|
|
14244
|
-
Boolean(requiredProp)
|
|
14245
|
-
);
|
|
14246
|
-
const [disabled, setDisabled] = React54__namespace.useState(
|
|
14247
|
-
Boolean(disabledProp)
|
|
14248
|
-
);
|
|
14249
|
-
const [readOnly, setReadOnly] = React54__namespace.useState(
|
|
14250
|
-
Boolean(readOnlyProp)
|
|
14251
|
-
);
|
|
14252
|
-
const id = React54__namespace.useId();
|
|
14253
|
-
const keyRef = React54__namespace.useRef((() => {
|
|
14254
|
-
if (rawName && rawName.trim()) return `${rawName.trim()}-${id}`;
|
|
14255
|
-
if (rawBindId && rawBindId.trim()) return `${rawBindId.trim()}-${id}`;
|
|
14256
|
-
return `field-${Math.random().toString(36).slice(2)}-${id}`;
|
|
14257
|
-
})());
|
|
14258
|
-
const bindIdRef = React54__namespace.useRef(
|
|
14259
|
-
rawBindId && rawBindId.trim() || keyRef.current
|
|
14260
|
-
);
|
|
14261
|
-
const fieldRef = React54__namespace.useRef(null);
|
|
14262
|
-
if (!fieldRef.current) {
|
|
14263
|
-
const key = keyRef.current;
|
|
14264
|
-
const bindId = bindIdRef.current;
|
|
14265
|
-
const trimmedName = (_a = rawName == null ? void 0 : rawName.trim()) != null ? _a : "";
|
|
14266
|
-
const validateFn = (report) => {
|
|
14267
|
-
const curDisabled = disabled || readOnly;
|
|
14268
|
-
if (curDisabled && !report) {
|
|
14269
|
-
return true;
|
|
14270
|
-
}
|
|
14271
|
-
const current = stateRef.current.value;
|
|
14272
|
-
let ok = true;
|
|
14273
|
-
let message2 = "";
|
|
14274
|
-
if (required && (current === void 0 || current === null || typeof current === "string" && current.trim() === "" || Array.isArray(current) && current.length === 0)) {
|
|
14275
|
-
ok = false;
|
|
14276
|
-
message2 = "This field is required.";
|
|
14277
|
-
} else if (validate) {
|
|
14278
|
-
const result = validate(current, !!report);
|
|
14279
|
-
if (typeof result === "string") {
|
|
14280
|
-
ok = false;
|
|
14281
|
-
message2 = result;
|
|
14282
|
-
} else if (result === false) {
|
|
14283
|
-
ok = false;
|
|
14284
|
-
}
|
|
14285
|
-
}
|
|
14286
|
-
if (!report) {
|
|
14287
|
-
return ok;
|
|
14288
|
-
}
|
|
14289
|
-
stateRef.current.error = ok ? "" : message2;
|
|
14290
|
-
setErrorState(ok ? "" : message2);
|
|
14291
|
-
return ok;
|
|
14292
|
-
};
|
|
14293
|
-
const f = {
|
|
14294
|
-
key,
|
|
14295
|
-
bindId,
|
|
14296
|
-
bind: bind2,
|
|
14297
|
-
name: trimmedName,
|
|
14298
|
-
shared,
|
|
14299
|
-
groupId,
|
|
14300
|
-
alias,
|
|
14301
|
-
main,
|
|
14302
|
-
ignore,
|
|
14303
|
-
required,
|
|
14304
|
-
ref,
|
|
14305
|
-
get defaultValue() {
|
|
14306
|
-
return stateRef.current.original;
|
|
14307
|
-
},
|
|
14308
|
-
get value() {
|
|
14309
|
-
return stateRef.current.value;
|
|
14310
|
-
},
|
|
14311
|
-
set value(v) {
|
|
14312
|
-
stateRef.current.value = v;
|
|
14313
|
-
setValueState(v);
|
|
14314
|
-
},
|
|
14315
|
-
get originalValue() {
|
|
14316
|
-
return stateRef.current.original;
|
|
14317
|
-
},
|
|
14318
|
-
get error() {
|
|
14319
|
-
return stateRef.current.error;
|
|
14320
|
-
},
|
|
14321
|
-
set error(msg) {
|
|
14322
|
-
stateRef.current.error = msg;
|
|
14323
|
-
setErrorState(msg);
|
|
14324
|
-
},
|
|
14325
|
-
get loading() {
|
|
14326
|
-
return stateRef.current.loading;
|
|
14327
|
-
},
|
|
14328
|
-
set loading(v) {
|
|
14329
|
-
stateRef.current.loading = v;
|
|
14330
|
-
setLoadingState(v);
|
|
14331
|
-
},
|
|
14332
|
-
validate: validateFn,
|
|
14333
|
-
onChange(value2, old, variant) {
|
|
14334
|
-
if (onValueChange) {
|
|
14335
|
-
onValueChange(value2, old, variant);
|
|
14336
|
-
}
|
|
14337
|
-
}
|
|
14338
|
-
// Flags not directly on the Field interface but used via `as any`
|
|
14339
|
-
// in core-provider (getValue/setValue/reset).
|
|
14340
|
-
};
|
|
14341
|
-
f.getValue = () => stateRef.current.value;
|
|
14342
|
-
f.setValue = (next) => {
|
|
14343
|
-
stateRef.current.value = next;
|
|
14344
|
-
setValueState(next);
|
|
14345
|
-
};
|
|
14346
|
-
f.reset = () => {
|
|
14347
|
-
stateRef.current.value = defaultValue;
|
|
14348
|
-
stateRef.current.error = "";
|
|
14349
|
-
stateRef.current.loading = false;
|
|
14350
|
-
setValueState(defaultValue);
|
|
14351
|
-
setErrorState("");
|
|
14352
|
-
setLoadingState(false);
|
|
14353
|
-
};
|
|
14354
|
-
fieldRef.current = f;
|
|
14355
|
-
}
|
|
14356
|
-
const field = fieldRef.current;
|
|
14357
|
-
React54__namespace.useEffect(() => {
|
|
14358
|
-
setRequired(!!requiredProp);
|
|
14359
|
-
if (field) {
|
|
14360
|
-
field.required = !!requiredProp;
|
|
14361
|
-
}
|
|
14362
|
-
}, [requiredProp, field]);
|
|
14363
|
-
React54__namespace.useEffect(() => {
|
|
14364
|
-
setDisabled(!!disabledProp);
|
|
14365
|
-
}, [disabledProp]);
|
|
14366
|
-
React54__namespace.useEffect(() => {
|
|
14367
|
-
setReadOnly(!!readOnlyProp);
|
|
14368
|
-
}, [readOnlyProp]);
|
|
14369
|
-
React54__namespace.useEffect(() => {
|
|
14370
|
-
if (!field) return;
|
|
14371
|
-
form.addField(field);
|
|
14372
|
-
return () => {
|
|
14373
|
-
const registry3 = form.inputs;
|
|
14374
|
-
if (registry3 && typeof registry3.remove === "function") {
|
|
14375
|
-
registry3.remove(field.key);
|
|
14376
|
-
}
|
|
14377
|
-
};
|
|
14378
|
-
}, [form, field]);
|
|
14379
|
-
function setValue(next, variant = "direct") {
|
|
14380
|
-
var _a2;
|
|
14381
|
-
const prev = stateRef.current.value;
|
|
14382
|
-
if (Object.is(prev, next)) return;
|
|
14383
|
-
const runFormOnChange = () => {
|
|
14384
|
-
var _a3;
|
|
14385
|
-
const props2 = (_a3 = form.props) != null ? _a3 : {};
|
|
14386
|
-
const fn = props2.onChange;
|
|
14387
|
-
if (!fn) return;
|
|
14388
|
-
fn(form, field, {
|
|
14389
|
-
variant,
|
|
14390
|
-
value: next,
|
|
14391
|
-
previous: prev
|
|
14392
|
-
});
|
|
14393
|
-
};
|
|
14394
|
-
const props = (_a2 = form.props) != null ? _a2 : {};
|
|
14395
|
-
const changeBefore = !!props.changeBefore;
|
|
14396
|
-
if (changeBefore) {
|
|
14397
|
-
runFormOnChange();
|
|
14398
|
-
}
|
|
14399
|
-
stateRef.current.value = next;
|
|
14400
|
-
setValueState(next);
|
|
14401
|
-
if (field.onChange) {
|
|
14402
|
-
field.onChange(next, prev, variant);
|
|
14403
|
-
}
|
|
14404
|
-
if (!changeBefore) {
|
|
14405
|
-
runFormOnChange();
|
|
14406
|
-
}
|
|
14407
|
-
form.controlButton();
|
|
14408
|
-
}
|
|
14409
|
-
function setError(message2) {
|
|
14410
|
-
stateRef.current.error = message2;
|
|
14411
|
-
setErrorState(message2);
|
|
14412
|
-
}
|
|
14413
|
-
function setLoading(loading2) {
|
|
14414
|
-
stateRef.current.loading = loading2;
|
|
14415
|
-
setLoadingState(loading2);
|
|
14416
|
-
}
|
|
14417
|
-
return {
|
|
14418
|
-
ref,
|
|
14419
|
-
get key() {
|
|
14420
|
-
return keyRef.current;
|
|
14421
|
-
},
|
|
14422
|
-
value,
|
|
14423
|
-
setValue,
|
|
14424
|
-
error,
|
|
14425
|
-
setError,
|
|
14426
|
-
loading,
|
|
14427
|
-
setLoading,
|
|
14428
|
-
required,
|
|
14429
|
-
setRequired,
|
|
14430
|
-
disabled,
|
|
14431
|
-
setDisabled,
|
|
14432
|
-
readOnly,
|
|
14433
|
-
setReadOnly,
|
|
14434
|
-
name: field.name,
|
|
14435
|
-
bindId: field.bindId,
|
|
14436
|
-
bind: field.bind,
|
|
14437
|
-
shared: field.shared,
|
|
14438
|
-
groupId: field.groupId,
|
|
14439
|
-
alias: field.alias,
|
|
14440
|
-
main: field.main,
|
|
14441
|
-
ignore: field.ignore,
|
|
14442
|
-
get defaultValue() {
|
|
14443
|
-
return stateRef.current.original;
|
|
14444
|
-
},
|
|
14445
|
-
get originalValue() {
|
|
14446
|
-
return stateRef.current.original;
|
|
14447
|
-
},
|
|
14448
|
-
form,
|
|
14449
|
-
validate(report) {
|
|
14450
|
-
var _a2;
|
|
14451
|
-
return (_a2 = field.validate) == null ? void 0 : _a2.call(field, report);
|
|
14452
|
-
}
|
|
14453
|
-
};
|
|
14454
|
-
}
|
|
14455
|
-
function useOptionalField(options) {
|
|
14456
|
-
var _a;
|
|
14457
|
-
try {
|
|
14458
|
-
return useField(options);
|
|
14459
|
-
} catch {
|
|
14460
|
-
}
|
|
14461
|
-
{
|
|
14462
|
-
console.warn(
|
|
14463
|
-
"[FormPalette] useOptionalField: No CoreProvider found. Running in self-managed mode."
|
|
14464
|
-
);
|
|
14465
|
-
}
|
|
14466
|
-
const {
|
|
14467
|
-
name: rawName,
|
|
14468
|
-
bindId: rawBindId,
|
|
14469
|
-
bind: bind2,
|
|
14470
|
-
shared,
|
|
14471
|
-
groupId,
|
|
14472
|
-
alias,
|
|
14473
|
-
main,
|
|
14474
|
-
ignore,
|
|
14475
|
-
required: requiredProp = false,
|
|
14476
|
-
defaultValue,
|
|
14477
|
-
disabled: disabledProp = false,
|
|
14478
|
-
readOnly: readOnlyProp = false,
|
|
14479
|
-
validate,
|
|
14480
|
-
getOriginalValue,
|
|
14481
|
-
onValueChange
|
|
14482
|
-
} = options;
|
|
14483
|
-
const ref = React54__namespace.useRef(null);
|
|
14484
|
-
const [value, setValueState] = React54__namespace.useState(defaultValue);
|
|
14485
|
-
const [error, setErrorState] = React54__namespace.useState("");
|
|
14486
|
-
const [loading, setLoadingState] = React54__namespace.useState(false);
|
|
14487
|
-
const [required, setRequired] = React54__namespace.useState(!!requiredProp);
|
|
14488
|
-
const [disabled, setDisabled] = React54__namespace.useState(!!disabledProp);
|
|
14489
|
-
const [readOnly, setReadOnly] = React54__namespace.useState(!!readOnlyProp);
|
|
14490
|
-
const originalRef = React54__namespace.useRef(
|
|
14491
|
-
getOriginalValue ? getOriginalValue(defaultValue) : defaultValue
|
|
14492
|
-
);
|
|
14493
|
-
const id = React54__namespace.useId();
|
|
14494
|
-
const keyRef = React54__namespace.useRef("");
|
|
14495
|
-
if (!keyRef.current) {
|
|
14496
|
-
if (rawName && rawName.trim()) {
|
|
14497
|
-
keyRef.current = `${rawName.trim()}-${id}`;
|
|
14498
|
-
} else if (rawBindId && rawBindId.trim()) {
|
|
14499
|
-
keyRef.current = `${rawBindId.trim()}-${id}`;
|
|
14500
|
-
} else {
|
|
14501
|
-
keyRef.current = `field-${Math.random().toString(36).slice(2)}-${id}`;
|
|
14502
|
-
}
|
|
14503
|
-
}
|
|
14504
|
-
const bindIdRef = React54__namespace.useRef("");
|
|
14505
|
-
if (!bindIdRef.current) {
|
|
14506
|
-
bindIdRef.current = rawBindId && rawBindId.trim() || keyRef.current;
|
|
14507
|
-
}
|
|
14508
|
-
React54__namespace.useEffect(() => {
|
|
14509
|
-
setRequired(!!requiredProp);
|
|
14510
|
-
}, [requiredProp]);
|
|
14511
|
-
React54__namespace.useEffect(() => {
|
|
14512
|
-
setDisabled(!!disabledProp);
|
|
14513
|
-
}, [disabledProp]);
|
|
14514
|
-
React54__namespace.useEffect(() => {
|
|
14515
|
-
setReadOnly(!!readOnlyProp);
|
|
14516
|
-
}, [readOnlyProp]);
|
|
14517
|
-
function setValue(next, variant = "direct") {
|
|
14518
|
-
const prev = value;
|
|
14519
|
-
if (Object.is(prev, next)) return;
|
|
14520
|
-
setValueState(next);
|
|
14521
|
-
if (onValueChange) {
|
|
14522
|
-
onValueChange(next, prev, variant);
|
|
14523
|
-
}
|
|
14524
|
-
}
|
|
14525
|
-
function setError(message2) {
|
|
14526
|
-
setErrorState(message2);
|
|
14527
|
-
}
|
|
14528
|
-
function setLoading(next) {
|
|
14529
|
-
setLoadingState(next);
|
|
14530
|
-
}
|
|
14531
|
-
function runValidate(report) {
|
|
14532
|
-
const current = value;
|
|
14533
|
-
let ok = true;
|
|
14534
|
-
let message2 = "";
|
|
14535
|
-
if (required && (current === void 0 || current === null || typeof current === "string" && current.trim() === "" || Array.isArray(current) && current.length === 0)) {
|
|
14536
|
-
ok = false;
|
|
14537
|
-
message2 = "This field is required.";
|
|
14538
|
-
} else if (validate) {
|
|
14539
|
-
const result = validate(current, !!report);
|
|
14540
|
-
if (typeof result === "string") {
|
|
14541
|
-
ok = false;
|
|
14542
|
-
message2 = result;
|
|
14543
|
-
} else if (result === false) {
|
|
14544
|
-
ok = false;
|
|
14545
|
-
}
|
|
14546
|
-
}
|
|
14547
|
-
if (report) {
|
|
14548
|
-
setErrorState(ok ? "" : message2);
|
|
14549
|
-
}
|
|
14550
|
-
return ok;
|
|
14551
|
-
}
|
|
14552
|
-
const dummyForm = {};
|
|
14553
|
-
return {
|
|
14554
|
-
ref,
|
|
14555
|
-
get key() {
|
|
14556
|
-
return keyRef.current;
|
|
14557
|
-
},
|
|
14558
|
-
value,
|
|
14559
|
-
setValue,
|
|
14560
|
-
error,
|
|
14561
|
-
setError,
|
|
14562
|
-
loading,
|
|
14563
|
-
setLoading,
|
|
14564
|
-
required,
|
|
14565
|
-
setRequired,
|
|
14566
|
-
disabled,
|
|
14567
|
-
setDisabled,
|
|
14568
|
-
readOnly,
|
|
14569
|
-
setReadOnly,
|
|
14570
|
-
name: (_a = rawName == null ? void 0 : rawName.trim()) != null ? _a : "",
|
|
14571
|
-
bindId: bindIdRef.current,
|
|
14572
|
-
bind: bind2,
|
|
14573
|
-
shared,
|
|
14574
|
-
groupId,
|
|
14575
|
-
alias,
|
|
14576
|
-
main,
|
|
14577
|
-
ignore,
|
|
14578
|
-
get defaultValue() {
|
|
14579
|
-
return originalRef.current;
|
|
14580
|
-
},
|
|
14581
|
-
get originalValue() {
|
|
14582
|
-
return originalRef.current;
|
|
14583
|
-
},
|
|
14584
|
-
form: dummyForm,
|
|
14585
|
-
validate(report) {
|
|
14586
|
-
return runValidate(report);
|
|
14587
|
-
}
|
|
14588
|
-
};
|
|
14589
|
-
}
|
|
14590
|
-
|
|
14591
|
-
// src/variants/registry.ts
|
|
14592
|
-
var registry2 = /* @__PURE__ */ new Map();
|
|
14593
|
-
function registerVariant(module2) {
|
|
14594
|
-
registry2.set(module2.variant, module2);
|
|
14595
|
-
}
|
|
14596
|
-
function getVariant(key) {
|
|
14597
|
-
return registry2.get(key);
|
|
14598
|
-
}
|
|
14599
|
-
function listVariants() {
|
|
14600
|
-
return Array.from(registry2.values());
|
|
14601
|
-
}
|
|
14602
14092
|
|
|
14603
14093
|
// ../../node_modules/clsx/dist/clsx.mjs
|
|
14604
14094
|
function r(e) {
|
|
@@ -17628,6 +17118,516 @@ var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
|
17628
17118
|
function cn(...inputs) {
|
|
17629
17119
|
return twMerge(clsx(inputs));
|
|
17630
17120
|
}
|
|
17121
|
+
function CoreShell(props) {
|
|
17122
|
+
if (props.wrapped) {
|
|
17123
|
+
const {
|
|
17124
|
+
formProps: formProps2,
|
|
17125
|
+
children: children2,
|
|
17126
|
+
wrapped,
|
|
17127
|
+
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
17128
|
+
gap,
|
|
17129
|
+
contentClassName,
|
|
17130
|
+
...coreProps2
|
|
17131
|
+
} = props;
|
|
17132
|
+
const content = /* @__PURE__ */ jsxRuntime.jsx(
|
|
17133
|
+
"div",
|
|
17134
|
+
{
|
|
17135
|
+
className: cn("flex flex-col", contentClassName),
|
|
17136
|
+
style: gap !== void 0 ? { gap } : void 0,
|
|
17137
|
+
children: children2
|
|
17138
|
+
}
|
|
17139
|
+
);
|
|
17140
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CoreProvider, { ...coreProps2, children: /* @__PURE__ */ jsxRuntime.jsx(CoreRoot, { ...formProps2 != null ? formProps2 : {}, children: content }) });
|
|
17141
|
+
}
|
|
17142
|
+
const { formProps, children, ...coreProps } = props;
|
|
17143
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CoreProvider, { ...coreProps, children: /* @__PURE__ */ jsxRuntime.jsx(CoreRoot, { ...formProps != null ? formProps : {}, children }) });
|
|
17144
|
+
}
|
|
17145
|
+
function useButton(options) {
|
|
17146
|
+
const form = useCoreContext();
|
|
17147
|
+
const { name, submit, disabled: disabledProp = false, onClick } = options;
|
|
17148
|
+
const [loading, setLoadingState] = React54__namespace.useState(false);
|
|
17149
|
+
const [disabled, setDisabledState] = React54__namespace.useState(
|
|
17150
|
+
Boolean(disabledProp)
|
|
17151
|
+
);
|
|
17152
|
+
const ref = React54__namespace.useRef(null);
|
|
17153
|
+
const optsRef = React54__namespace.useRef(options);
|
|
17154
|
+
React54__namespace.useEffect(() => {
|
|
17155
|
+
optsRef.current = options;
|
|
17156
|
+
}, [options]);
|
|
17157
|
+
const buttonRef = React54__namespace.useRef(null);
|
|
17158
|
+
if (!buttonRef.current) {
|
|
17159
|
+
const btn = {
|
|
17160
|
+
name,
|
|
17161
|
+
// Accessor for "loading" as required by ButtonRef
|
|
17162
|
+
set loading(v) {
|
|
17163
|
+
setLoadingState(v);
|
|
17164
|
+
},
|
|
17165
|
+
// Accessor for "disable" (note: interface uses `disable`, not `disabled`)
|
|
17166
|
+
//@ts-ignore
|
|
17167
|
+
set disable(v) {
|
|
17168
|
+
setDisabledState(v);
|
|
17169
|
+
},
|
|
17170
|
+
// Extra properties used by CoreProvider via any-casts
|
|
17171
|
+
get loading() {
|
|
17172
|
+
return loading;
|
|
17173
|
+
},
|
|
17174
|
+
setDisabled(v) {
|
|
17175
|
+
setDisabledState(v);
|
|
17176
|
+
},
|
|
17177
|
+
get disabled() {
|
|
17178
|
+
return disabled;
|
|
17179
|
+
},
|
|
17180
|
+
ref
|
|
17181
|
+
};
|
|
17182
|
+
btn.setLoading = (v) => {
|
|
17183
|
+
setLoadingState(v);
|
|
17184
|
+
};
|
|
17185
|
+
buttonRef.current = btn;
|
|
17186
|
+
}
|
|
17187
|
+
React54__namespace.useEffect(() => {
|
|
17188
|
+
if (!buttonRef.current) return;
|
|
17189
|
+
buttonRef.current.name = name;
|
|
17190
|
+
}, [name]);
|
|
17191
|
+
React54__namespace.useEffect(() => {
|
|
17192
|
+
if (!buttonRef.current) return;
|
|
17193
|
+
form.button = buttonRef.current;
|
|
17194
|
+
return () => {
|
|
17195
|
+
const anyForm = form;
|
|
17196
|
+
if (anyForm.button === buttonRef.current) {
|
|
17197
|
+
anyForm.button = null;
|
|
17198
|
+
}
|
|
17199
|
+
};
|
|
17200
|
+
}, [form]);
|
|
17201
|
+
const handleClick = (event) => {
|
|
17202
|
+
const currentOpts = optsRef.current;
|
|
17203
|
+
const shouldSubmit = !!currentOpts.submit;
|
|
17204
|
+
if (currentOpts.onClick) {
|
|
17205
|
+
currentOpts.onClick(event, form);
|
|
17206
|
+
}
|
|
17207
|
+
if (event.defaultPrevented) {
|
|
17208
|
+
return;
|
|
17209
|
+
}
|
|
17210
|
+
if (shouldSubmit) {
|
|
17211
|
+
form.setActiveButton(currentOpts.name);
|
|
17212
|
+
form.go();
|
|
17213
|
+
}
|
|
17214
|
+
};
|
|
17215
|
+
const setLoading = (v) => {
|
|
17216
|
+
setLoadingState(v);
|
|
17217
|
+
};
|
|
17218
|
+
const setDisabled = (v) => {
|
|
17219
|
+
setDisabledState(v);
|
|
17220
|
+
};
|
|
17221
|
+
return {
|
|
17222
|
+
loading,
|
|
17223
|
+
setLoading,
|
|
17224
|
+
disabled,
|
|
17225
|
+
setDisabled,
|
|
17226
|
+
ref,
|
|
17227
|
+
onClick: handleClick,
|
|
17228
|
+
buttonProps: {
|
|
17229
|
+
ref,
|
|
17230
|
+
disabled: disabled || loading,
|
|
17231
|
+
"data-loading": loading ? "true" : "false",
|
|
17232
|
+
onClick: handleClick
|
|
17233
|
+
}
|
|
17234
|
+
};
|
|
17235
|
+
}
|
|
17236
|
+
function useField(options) {
|
|
17237
|
+
var _a;
|
|
17238
|
+
const form = useCoreContext();
|
|
17239
|
+
const {
|
|
17240
|
+
name: rawName,
|
|
17241
|
+
bindId: rawBindId,
|
|
17242
|
+
bind: bind2,
|
|
17243
|
+
shared,
|
|
17244
|
+
groupId,
|
|
17245
|
+
alias,
|
|
17246
|
+
main,
|
|
17247
|
+
ignore,
|
|
17248
|
+
required: requiredProp = false,
|
|
17249
|
+
defaultValue,
|
|
17250
|
+
disabled: disabledProp = false,
|
|
17251
|
+
readOnly: readOnlyProp = false,
|
|
17252
|
+
validate,
|
|
17253
|
+
getOriginalValue,
|
|
17254
|
+
onValueChange
|
|
17255
|
+
} = options;
|
|
17256
|
+
const ref = React54__namespace.useRef(null);
|
|
17257
|
+
const stateRef = React54__namespace.useRef({
|
|
17258
|
+
value: defaultValue,
|
|
17259
|
+
error: "",
|
|
17260
|
+
loading: false,
|
|
17261
|
+
original: getOriginalValue ? getOriginalValue(defaultValue) : defaultValue
|
|
17262
|
+
});
|
|
17263
|
+
const [value, setValueState] = React54__namespace.useState(
|
|
17264
|
+
stateRef.current.value
|
|
17265
|
+
);
|
|
17266
|
+
const [error, setErrorState] = React54__namespace.useState(
|
|
17267
|
+
stateRef.current.error
|
|
17268
|
+
);
|
|
17269
|
+
const [loading, setLoadingState] = React54__namespace.useState(
|
|
17270
|
+
stateRef.current.loading
|
|
17271
|
+
);
|
|
17272
|
+
const [required, setRequired] = React54__namespace.useState(
|
|
17273
|
+
Boolean(requiredProp)
|
|
17274
|
+
);
|
|
17275
|
+
const [disabled, setDisabled] = React54__namespace.useState(
|
|
17276
|
+
Boolean(disabledProp)
|
|
17277
|
+
);
|
|
17278
|
+
const [readOnly, setReadOnly] = React54__namespace.useState(
|
|
17279
|
+
Boolean(readOnlyProp)
|
|
17280
|
+
);
|
|
17281
|
+
const id = React54__namespace.useId();
|
|
17282
|
+
const keyRef = React54__namespace.useRef((() => {
|
|
17283
|
+
if (rawName && rawName.trim()) return `${rawName.trim()}-${id}`;
|
|
17284
|
+
if (rawBindId && rawBindId.trim()) return `${rawBindId.trim()}-${id}`;
|
|
17285
|
+
return `field-${Math.random().toString(36).slice(2)}-${id}`;
|
|
17286
|
+
})());
|
|
17287
|
+
const bindIdRef = React54__namespace.useRef(
|
|
17288
|
+
rawBindId && rawBindId.trim() || keyRef.current
|
|
17289
|
+
);
|
|
17290
|
+
const fieldRef = React54__namespace.useRef(null);
|
|
17291
|
+
if (!fieldRef.current) {
|
|
17292
|
+
const key = keyRef.current;
|
|
17293
|
+
const bindId = bindIdRef.current;
|
|
17294
|
+
const trimmedName = (_a = rawName == null ? void 0 : rawName.trim()) != null ? _a : "";
|
|
17295
|
+
const validateFn = (report) => {
|
|
17296
|
+
const curDisabled = disabled || readOnly;
|
|
17297
|
+
if (curDisabled && !report) {
|
|
17298
|
+
return true;
|
|
17299
|
+
}
|
|
17300
|
+
const current = stateRef.current.value;
|
|
17301
|
+
let ok = true;
|
|
17302
|
+
let message2 = "";
|
|
17303
|
+
if (required && (current === void 0 || current === null || typeof current === "string" && current.trim() === "" || Array.isArray(current) && current.length === 0)) {
|
|
17304
|
+
ok = false;
|
|
17305
|
+
message2 = "This field is required.";
|
|
17306
|
+
} else if (validate) {
|
|
17307
|
+
const result = validate(current, !!report);
|
|
17308
|
+
if (typeof result === "string") {
|
|
17309
|
+
ok = false;
|
|
17310
|
+
message2 = result;
|
|
17311
|
+
} else if (result === false) {
|
|
17312
|
+
ok = false;
|
|
17313
|
+
}
|
|
17314
|
+
}
|
|
17315
|
+
if (!report) {
|
|
17316
|
+
return ok;
|
|
17317
|
+
}
|
|
17318
|
+
stateRef.current.error = ok ? "" : message2;
|
|
17319
|
+
setErrorState(ok ? "" : message2);
|
|
17320
|
+
return ok;
|
|
17321
|
+
};
|
|
17322
|
+
const f = {
|
|
17323
|
+
key,
|
|
17324
|
+
bindId,
|
|
17325
|
+
bind: bind2,
|
|
17326
|
+
name: trimmedName,
|
|
17327
|
+
shared,
|
|
17328
|
+
groupId,
|
|
17329
|
+
alias,
|
|
17330
|
+
main,
|
|
17331
|
+
ignore,
|
|
17332
|
+
required,
|
|
17333
|
+
ref,
|
|
17334
|
+
get defaultValue() {
|
|
17335
|
+
return stateRef.current.original;
|
|
17336
|
+
},
|
|
17337
|
+
get value() {
|
|
17338
|
+
return stateRef.current.value;
|
|
17339
|
+
},
|
|
17340
|
+
set value(v) {
|
|
17341
|
+
stateRef.current.value = v;
|
|
17342
|
+
setValueState(v);
|
|
17343
|
+
},
|
|
17344
|
+
get originalValue() {
|
|
17345
|
+
return stateRef.current.original;
|
|
17346
|
+
},
|
|
17347
|
+
get error() {
|
|
17348
|
+
return stateRef.current.error;
|
|
17349
|
+
},
|
|
17350
|
+
set error(msg) {
|
|
17351
|
+
stateRef.current.error = msg;
|
|
17352
|
+
setErrorState(msg);
|
|
17353
|
+
},
|
|
17354
|
+
get loading() {
|
|
17355
|
+
return stateRef.current.loading;
|
|
17356
|
+
},
|
|
17357
|
+
set loading(v) {
|
|
17358
|
+
stateRef.current.loading = v;
|
|
17359
|
+
setLoadingState(v);
|
|
17360
|
+
},
|
|
17361
|
+
validate: validateFn,
|
|
17362
|
+
onChange(value2, old, variant) {
|
|
17363
|
+
if (onValueChange) {
|
|
17364
|
+
onValueChange(value2, old, variant);
|
|
17365
|
+
}
|
|
17366
|
+
}
|
|
17367
|
+
// Flags not directly on the Field interface but used via `as any`
|
|
17368
|
+
// in core-provider (getValue/setValue/reset).
|
|
17369
|
+
};
|
|
17370
|
+
f.getValue = () => stateRef.current.value;
|
|
17371
|
+
f.setValue = (next) => {
|
|
17372
|
+
stateRef.current.value = next;
|
|
17373
|
+
setValueState(next);
|
|
17374
|
+
};
|
|
17375
|
+
f.reset = () => {
|
|
17376
|
+
stateRef.current.value = defaultValue;
|
|
17377
|
+
stateRef.current.error = "";
|
|
17378
|
+
stateRef.current.loading = false;
|
|
17379
|
+
setValueState(defaultValue);
|
|
17380
|
+
setErrorState("");
|
|
17381
|
+
setLoadingState(false);
|
|
17382
|
+
};
|
|
17383
|
+
fieldRef.current = f;
|
|
17384
|
+
}
|
|
17385
|
+
const field = fieldRef.current;
|
|
17386
|
+
React54__namespace.useEffect(() => {
|
|
17387
|
+
setRequired(!!requiredProp);
|
|
17388
|
+
if (field) {
|
|
17389
|
+
field.required = !!requiredProp;
|
|
17390
|
+
}
|
|
17391
|
+
}, [requiredProp, field]);
|
|
17392
|
+
React54__namespace.useEffect(() => {
|
|
17393
|
+
setDisabled(!!disabledProp);
|
|
17394
|
+
}, [disabledProp]);
|
|
17395
|
+
React54__namespace.useEffect(() => {
|
|
17396
|
+
setReadOnly(!!readOnlyProp);
|
|
17397
|
+
}, [readOnlyProp]);
|
|
17398
|
+
React54__namespace.useEffect(() => {
|
|
17399
|
+
if (!field) return;
|
|
17400
|
+
form.addField(field);
|
|
17401
|
+
return () => {
|
|
17402
|
+
const registry3 = form.inputs;
|
|
17403
|
+
if (registry3 && typeof registry3.remove === "function") {
|
|
17404
|
+
registry3.remove(field.key);
|
|
17405
|
+
}
|
|
17406
|
+
};
|
|
17407
|
+
}, [form, field]);
|
|
17408
|
+
function setValue(next, variant = "direct") {
|
|
17409
|
+
var _a2;
|
|
17410
|
+
const prev = stateRef.current.value;
|
|
17411
|
+
if (Object.is(prev, next)) return;
|
|
17412
|
+
const runFormOnChange = () => {
|
|
17413
|
+
var _a3;
|
|
17414
|
+
const props2 = (_a3 = form.props) != null ? _a3 : {};
|
|
17415
|
+
const fn = props2.onChange;
|
|
17416
|
+
if (!fn) return;
|
|
17417
|
+
fn(form, field, {
|
|
17418
|
+
variant,
|
|
17419
|
+
value: next,
|
|
17420
|
+
previous: prev
|
|
17421
|
+
});
|
|
17422
|
+
};
|
|
17423
|
+
const props = (_a2 = form.props) != null ? _a2 : {};
|
|
17424
|
+
const changeBefore = !!props.changeBefore;
|
|
17425
|
+
if (changeBefore) {
|
|
17426
|
+
runFormOnChange();
|
|
17427
|
+
}
|
|
17428
|
+
stateRef.current.value = next;
|
|
17429
|
+
setValueState(next);
|
|
17430
|
+
if (field.onChange) {
|
|
17431
|
+
field.onChange(next, prev, variant);
|
|
17432
|
+
}
|
|
17433
|
+
if (!changeBefore) {
|
|
17434
|
+
runFormOnChange();
|
|
17435
|
+
}
|
|
17436
|
+
form.controlButton();
|
|
17437
|
+
}
|
|
17438
|
+
function setError(message2) {
|
|
17439
|
+
stateRef.current.error = message2;
|
|
17440
|
+
setErrorState(message2);
|
|
17441
|
+
}
|
|
17442
|
+
function setLoading(loading2) {
|
|
17443
|
+
stateRef.current.loading = loading2;
|
|
17444
|
+
setLoadingState(loading2);
|
|
17445
|
+
}
|
|
17446
|
+
return {
|
|
17447
|
+
ref,
|
|
17448
|
+
get key() {
|
|
17449
|
+
return keyRef.current;
|
|
17450
|
+
},
|
|
17451
|
+
value,
|
|
17452
|
+
setValue,
|
|
17453
|
+
error,
|
|
17454
|
+
setError,
|
|
17455
|
+
loading,
|
|
17456
|
+
setLoading,
|
|
17457
|
+
required,
|
|
17458
|
+
setRequired,
|
|
17459
|
+
disabled,
|
|
17460
|
+
setDisabled,
|
|
17461
|
+
readOnly,
|
|
17462
|
+
setReadOnly,
|
|
17463
|
+
name: field.name,
|
|
17464
|
+
bindId: field.bindId,
|
|
17465
|
+
bind: field.bind,
|
|
17466
|
+
shared: field.shared,
|
|
17467
|
+
groupId: field.groupId,
|
|
17468
|
+
alias: field.alias,
|
|
17469
|
+
main: field.main,
|
|
17470
|
+
ignore: field.ignore,
|
|
17471
|
+
get defaultValue() {
|
|
17472
|
+
return stateRef.current.original;
|
|
17473
|
+
},
|
|
17474
|
+
get originalValue() {
|
|
17475
|
+
return stateRef.current.original;
|
|
17476
|
+
},
|
|
17477
|
+
form,
|
|
17478
|
+
validate(report) {
|
|
17479
|
+
var _a2;
|
|
17480
|
+
return (_a2 = field.validate) == null ? void 0 : _a2.call(field, report);
|
|
17481
|
+
}
|
|
17482
|
+
};
|
|
17483
|
+
}
|
|
17484
|
+
function useOptionalField(options) {
|
|
17485
|
+
var _a;
|
|
17486
|
+
try {
|
|
17487
|
+
return useField(options);
|
|
17488
|
+
} catch {
|
|
17489
|
+
}
|
|
17490
|
+
{
|
|
17491
|
+
console.warn(
|
|
17492
|
+
"[FormPalette] useOptionalField: No CoreProvider found. Running in self-managed mode."
|
|
17493
|
+
);
|
|
17494
|
+
}
|
|
17495
|
+
const {
|
|
17496
|
+
name: rawName,
|
|
17497
|
+
bindId: rawBindId,
|
|
17498
|
+
bind: bind2,
|
|
17499
|
+
shared,
|
|
17500
|
+
groupId,
|
|
17501
|
+
alias,
|
|
17502
|
+
main,
|
|
17503
|
+
ignore,
|
|
17504
|
+
required: requiredProp = false,
|
|
17505
|
+
defaultValue,
|
|
17506
|
+
disabled: disabledProp = false,
|
|
17507
|
+
readOnly: readOnlyProp = false,
|
|
17508
|
+
validate,
|
|
17509
|
+
getOriginalValue,
|
|
17510
|
+
onValueChange
|
|
17511
|
+
} = options;
|
|
17512
|
+
const ref = React54__namespace.useRef(null);
|
|
17513
|
+
const [value, setValueState] = React54__namespace.useState(defaultValue);
|
|
17514
|
+
const [error, setErrorState] = React54__namespace.useState("");
|
|
17515
|
+
const [loading, setLoadingState] = React54__namespace.useState(false);
|
|
17516
|
+
const [required, setRequired] = React54__namespace.useState(!!requiredProp);
|
|
17517
|
+
const [disabled, setDisabled] = React54__namespace.useState(!!disabledProp);
|
|
17518
|
+
const [readOnly, setReadOnly] = React54__namespace.useState(!!readOnlyProp);
|
|
17519
|
+
const originalRef = React54__namespace.useRef(
|
|
17520
|
+
getOriginalValue ? getOriginalValue(defaultValue) : defaultValue
|
|
17521
|
+
);
|
|
17522
|
+
const id = React54__namespace.useId();
|
|
17523
|
+
const keyRef = React54__namespace.useRef("");
|
|
17524
|
+
if (!keyRef.current) {
|
|
17525
|
+
if (rawName && rawName.trim()) {
|
|
17526
|
+
keyRef.current = `${rawName.trim()}-${id}`;
|
|
17527
|
+
} else if (rawBindId && rawBindId.trim()) {
|
|
17528
|
+
keyRef.current = `${rawBindId.trim()}-${id}`;
|
|
17529
|
+
} else {
|
|
17530
|
+
keyRef.current = `field-${Math.random().toString(36).slice(2)}-${id}`;
|
|
17531
|
+
}
|
|
17532
|
+
}
|
|
17533
|
+
const bindIdRef = React54__namespace.useRef("");
|
|
17534
|
+
if (!bindIdRef.current) {
|
|
17535
|
+
bindIdRef.current = rawBindId && rawBindId.trim() || keyRef.current;
|
|
17536
|
+
}
|
|
17537
|
+
React54__namespace.useEffect(() => {
|
|
17538
|
+
setRequired(!!requiredProp);
|
|
17539
|
+
}, [requiredProp]);
|
|
17540
|
+
React54__namespace.useEffect(() => {
|
|
17541
|
+
setDisabled(!!disabledProp);
|
|
17542
|
+
}, [disabledProp]);
|
|
17543
|
+
React54__namespace.useEffect(() => {
|
|
17544
|
+
setReadOnly(!!readOnlyProp);
|
|
17545
|
+
}, [readOnlyProp]);
|
|
17546
|
+
function setValue(next, variant = "direct") {
|
|
17547
|
+
const prev = value;
|
|
17548
|
+
if (Object.is(prev, next)) return;
|
|
17549
|
+
setValueState(next);
|
|
17550
|
+
if (onValueChange) {
|
|
17551
|
+
onValueChange(next, prev, variant);
|
|
17552
|
+
}
|
|
17553
|
+
}
|
|
17554
|
+
function setError(message2) {
|
|
17555
|
+
setErrorState(message2);
|
|
17556
|
+
}
|
|
17557
|
+
function setLoading(next) {
|
|
17558
|
+
setLoadingState(next);
|
|
17559
|
+
}
|
|
17560
|
+
function runValidate(report) {
|
|
17561
|
+
const current = value;
|
|
17562
|
+
let ok = true;
|
|
17563
|
+
let message2 = "";
|
|
17564
|
+
if (required && (current === void 0 || current === null || typeof current === "string" && current.trim() === "" || Array.isArray(current) && current.length === 0)) {
|
|
17565
|
+
ok = false;
|
|
17566
|
+
message2 = "This field is required.";
|
|
17567
|
+
} else if (validate) {
|
|
17568
|
+
const result = validate(current, !!report);
|
|
17569
|
+
if (typeof result === "string") {
|
|
17570
|
+
ok = false;
|
|
17571
|
+
message2 = result;
|
|
17572
|
+
} else if (result === false) {
|
|
17573
|
+
ok = false;
|
|
17574
|
+
}
|
|
17575
|
+
}
|
|
17576
|
+
if (report) {
|
|
17577
|
+
setErrorState(ok ? "" : message2);
|
|
17578
|
+
}
|
|
17579
|
+
return ok;
|
|
17580
|
+
}
|
|
17581
|
+
const dummyForm = {};
|
|
17582
|
+
return {
|
|
17583
|
+
ref,
|
|
17584
|
+
get key() {
|
|
17585
|
+
return keyRef.current;
|
|
17586
|
+
},
|
|
17587
|
+
value,
|
|
17588
|
+
setValue,
|
|
17589
|
+
error,
|
|
17590
|
+
setError,
|
|
17591
|
+
loading,
|
|
17592
|
+
setLoading,
|
|
17593
|
+
required,
|
|
17594
|
+
setRequired,
|
|
17595
|
+
disabled,
|
|
17596
|
+
setDisabled,
|
|
17597
|
+
readOnly,
|
|
17598
|
+
setReadOnly,
|
|
17599
|
+
name: (_a = rawName == null ? void 0 : rawName.trim()) != null ? _a : "",
|
|
17600
|
+
bindId: bindIdRef.current,
|
|
17601
|
+
bind: bind2,
|
|
17602
|
+
shared,
|
|
17603
|
+
groupId,
|
|
17604
|
+
alias,
|
|
17605
|
+
main,
|
|
17606
|
+
ignore,
|
|
17607
|
+
get defaultValue() {
|
|
17608
|
+
return originalRef.current;
|
|
17609
|
+
},
|
|
17610
|
+
get originalValue() {
|
|
17611
|
+
return originalRef.current;
|
|
17612
|
+
},
|
|
17613
|
+
form: dummyForm,
|
|
17614
|
+
validate(report) {
|
|
17615
|
+
return runValidate(report);
|
|
17616
|
+
}
|
|
17617
|
+
};
|
|
17618
|
+
}
|
|
17619
|
+
|
|
17620
|
+
// src/variants/registry.ts
|
|
17621
|
+
var registry2 = /* @__PURE__ */ new Map();
|
|
17622
|
+
function registerVariant(module2) {
|
|
17623
|
+
registry2.set(module2.variant, module2);
|
|
17624
|
+
}
|
|
17625
|
+
function getVariant(key) {
|
|
17626
|
+
return registry2.get(key);
|
|
17627
|
+
}
|
|
17628
|
+
function listVariants() {
|
|
17629
|
+
return Array.from(registry2.values());
|
|
17630
|
+
}
|
|
17631
17631
|
var isEmpty = (val) => val === null || val === void 0 || val === "";
|
|
17632
17632
|
var isAndroid = () => typeof navigator !== "undefined" && /android/i.test(navigator.userAgent || "");
|
|
17633
17633
|
var isIOS = () => typeof navigator !== "undefined" && /(iphone|ipad|ipod)/i.test(navigator.userAgent || "");
|
|
@@ -20603,19 +20603,19 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
20603
20603
|
}
|
|
20604
20604
|
function createContext2(rootComponentName, defaultContext) {
|
|
20605
20605
|
const Context = React54__namespace.createContext(defaultContext);
|
|
20606
|
-
const
|
|
20606
|
+
const Provider2 = (props) => {
|
|
20607
20607
|
const { children, ...context } = props;
|
|
20608
20608
|
const value = React54__namespace.useMemo(() => context, Object.values(context));
|
|
20609
20609
|
return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
|
|
20610
20610
|
};
|
|
20611
|
-
|
|
20611
|
+
Provider2.displayName = rootComponentName + "Provider";
|
|
20612
20612
|
function useContext22(consumerName) {
|
|
20613
20613
|
const context = React54__namespace.useContext(Context);
|
|
20614
20614
|
if (context) return context;
|
|
20615
20615
|
if (defaultContext !== void 0) return defaultContext;
|
|
20616
20616
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
20617
20617
|
}
|
|
20618
|
-
return [
|
|
20618
|
+
return [Provider2, useContext22];
|
|
20619
20619
|
}
|
|
20620
20620
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
20621
20621
|
let defaultContexts = [];
|
|
@@ -20623,14 +20623,14 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
20623
20623
|
const BaseContext = React54__namespace.createContext(defaultContext);
|
|
20624
20624
|
const index2 = defaultContexts.length;
|
|
20625
20625
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
20626
|
-
const
|
|
20626
|
+
const Provider2 = (props) => {
|
|
20627
20627
|
var _a;
|
|
20628
20628
|
const { scope, children, ...context } = props;
|
|
20629
20629
|
const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index2]) || BaseContext;
|
|
20630
20630
|
const value = React54__namespace.useMemo(() => context, Object.values(context));
|
|
20631
20631
|
return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
|
|
20632
20632
|
};
|
|
20633
|
-
|
|
20633
|
+
Provider2.displayName = rootComponentName + "Provider";
|
|
20634
20634
|
function useContext22(consumerName, scope) {
|
|
20635
20635
|
var _a;
|
|
20636
20636
|
const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index2]) || BaseContext;
|
|
@@ -20639,7 +20639,7 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
20639
20639
|
if (defaultContext !== void 0) return defaultContext;
|
|
20640
20640
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
20641
20641
|
}
|
|
20642
|
-
return [
|
|
20642
|
+
return [Provider2, useContext22];
|
|
20643
20643
|
}
|
|
20644
20644
|
const createScope = () => {
|
|
20645
20645
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
@@ -20794,10 +20794,10 @@ function getElementRef(element) {
|
|
|
20794
20794
|
return element.props.ref || element.ref;
|
|
20795
20795
|
}
|
|
20796
20796
|
function createCollection(name) {
|
|
20797
|
-
const
|
|
20798
|
-
const [createCollectionContext, createCollectionScope4] = createContextScope(
|
|
20797
|
+
const PROVIDER_NAME2 = name + "CollectionProvider";
|
|
20798
|
+
const [createCollectionContext, createCollectionScope4] = createContextScope(PROVIDER_NAME2);
|
|
20799
20799
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
|
20800
|
-
|
|
20800
|
+
PROVIDER_NAME2,
|
|
20801
20801
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
20802
20802
|
);
|
|
20803
20803
|
const CollectionProvider = (props) => {
|
|
@@ -20806,7 +20806,7 @@ function createCollection(name) {
|
|
|
20806
20806
|
const itemMap = React54__namespace.default.useRef(/* @__PURE__ */ new Map()).current;
|
|
20807
20807
|
return /* @__PURE__ */ jsxRuntime.jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
20808
20808
|
};
|
|
20809
|
-
CollectionProvider.displayName =
|
|
20809
|
+
CollectionProvider.displayName = PROVIDER_NAME2;
|
|
20810
20810
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
20811
20811
|
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
20812
20812
|
const CollectionSlot = React54__namespace.default.forwardRef(
|
|
@@ -24452,6 +24452,7 @@ var VisuallyHidden = React54__namespace.forwardRef(
|
|
|
24452
24452
|
}
|
|
24453
24453
|
);
|
|
24454
24454
|
VisuallyHidden.displayName = NAME2;
|
|
24455
|
+
var Root3 = VisuallyHidden;
|
|
24455
24456
|
|
|
24456
24457
|
// ../../node_modules/aria-hidden/dist/es2015/index.js
|
|
24457
24458
|
var getDefaultParent = function(originalTarget) {
|
|
@@ -30486,7 +30487,7 @@ __export(custom_components_exports, {
|
|
|
30486
30487
|
NextMonthButton: () => NextMonthButton,
|
|
30487
30488
|
Option: () => Option,
|
|
30488
30489
|
PreviousMonthButton: () => PreviousMonthButton,
|
|
30489
|
-
Root: () =>
|
|
30490
|
+
Root: () => Root4,
|
|
30490
30491
|
Select: () => Select3,
|
|
30491
30492
|
Week: () => Week,
|
|
30492
30493
|
WeekNumber: () => WeekNumber,
|
|
@@ -30676,7 +30677,7 @@ function PreviousMonthButton(props) {
|
|
|
30676
30677
|
const { components } = useDayPicker();
|
|
30677
30678
|
return React54__namespace.default.createElement(components.Button, { ...props });
|
|
30678
30679
|
}
|
|
30679
|
-
function
|
|
30680
|
+
function Root4(props) {
|
|
30680
30681
|
const { rootRef, ...rest } = props;
|
|
30681
30682
|
return React54__namespace.default.createElement("div", { ...rest, ref: rootRef });
|
|
30682
30683
|
}
|
|
@@ -34529,7 +34530,7 @@ SwitchBubbleInput.displayName = BUBBLE_INPUT_NAME2;
|
|
|
34529
34530
|
function getState2(checked) {
|
|
34530
34531
|
return checked ? "checked" : "unchecked";
|
|
34531
34532
|
}
|
|
34532
|
-
var
|
|
34533
|
+
var Root5 = Switch;
|
|
34533
34534
|
var Thumb = SwitchThumb;
|
|
34534
34535
|
function Switch2({
|
|
34535
34536
|
className,
|
|
@@ -34537,7 +34538,7 @@ function Switch2({
|
|
|
34537
34538
|
...props
|
|
34538
34539
|
}) {
|
|
34539
34540
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
34540
|
-
|
|
34541
|
+
Root5,
|
|
34541
34542
|
{
|
|
34542
34543
|
"data-slot": "switch",
|
|
34543
34544
|
className: cn(
|
|
@@ -35140,7 +35141,7 @@ function focusFirst2(candidates, preventScroll = false) {
|
|
|
35140
35141
|
function wrapArray2(array, startIndex) {
|
|
35141
35142
|
return array.map((_, index2) => array[(startIndex + index2) % array.length]);
|
|
35142
35143
|
}
|
|
35143
|
-
var
|
|
35144
|
+
var Root6 = RovingFocusGroup;
|
|
35144
35145
|
var Item2 = RovingFocusGroupItem;
|
|
35145
35146
|
var RADIO_NAME = "Radio";
|
|
35146
35147
|
var [createRadioContext, createRadioScope] = createContextScope(RADIO_NAME);
|
|
@@ -35314,7 +35315,7 @@ var RadioGroup = React54__namespace.forwardRef(
|
|
|
35314
35315
|
value,
|
|
35315
35316
|
onValueChange: setValue,
|
|
35316
35317
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
35317
|
-
|
|
35318
|
+
Root6,
|
|
35318
35319
|
{
|
|
35319
35320
|
asChild: true,
|
|
35320
35321
|
...rovingFocusGroupScope,
|
|
@@ -38569,7 +38570,7 @@ function roundValue(value, decimalCount) {
|
|
|
38569
38570
|
const rounder = Math.pow(10, decimalCount);
|
|
38570
38571
|
return Math.round(value * rounder) / rounder;
|
|
38571
38572
|
}
|
|
38572
|
-
var
|
|
38573
|
+
var Root7 = Slider;
|
|
38573
38574
|
var Track = SliderTrack;
|
|
38574
38575
|
var Range = SliderRange;
|
|
38575
38576
|
var Thumb2 = SliderThumb;
|
|
@@ -38586,7 +38587,7 @@ function Slider2({
|
|
|
38586
38587
|
[value, defaultValue, min3, max3]
|
|
38587
38588
|
);
|
|
38588
38589
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
38589
|
-
|
|
38590
|
+
Root7,
|
|
38590
38591
|
{
|
|
38591
38592
|
"data-slot": "slider",
|
|
38592
38593
|
defaultValue,
|
|
@@ -39426,7 +39427,7 @@ var DescriptionWarning = ({ contentRef, descriptionId }) => {
|
|
|
39426
39427
|
}, [MESSAGE, contentRef, descriptionId]);
|
|
39427
39428
|
return null;
|
|
39428
39429
|
};
|
|
39429
|
-
var
|
|
39430
|
+
var Root8 = Dialog;
|
|
39430
39431
|
var Portal4 = DialogPortal;
|
|
39431
39432
|
var Overlay = DialogOverlay;
|
|
39432
39433
|
var Content3 = DialogContent;
|
|
@@ -39436,7 +39437,7 @@ var Close = DialogClose;
|
|
|
39436
39437
|
function Dialog2({
|
|
39437
39438
|
...props
|
|
39438
39439
|
}) {
|
|
39439
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
39440
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Root8, { "data-slot": "dialog", ...props });
|
|
39440
39441
|
}
|
|
39441
39442
|
function DialogPortal2({
|
|
39442
39443
|
...props
|
|
@@ -41341,7 +41342,7 @@ function useResizeObserver(element, onResize) {
|
|
|
41341
41342
|
}
|
|
41342
41343
|
}, [element, handleResize]);
|
|
41343
41344
|
}
|
|
41344
|
-
var
|
|
41345
|
+
var Root9 = ScrollArea;
|
|
41345
41346
|
var Viewport2 = ScrollAreaViewport;
|
|
41346
41347
|
var Corner = ScrollAreaCorner;
|
|
41347
41348
|
function ScrollArea2({
|
|
@@ -41350,7 +41351,7 @@ function ScrollArea2({
|
|
|
41350
41351
|
...props
|
|
41351
41352
|
}) {
|
|
41352
41353
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
41353
|
-
|
|
41354
|
+
Root9,
|
|
41354
41355
|
{
|
|
41355
41356
|
"data-slot": "scroll-area",
|
|
41356
41357
|
className: cn("relative", className),
|
|
@@ -41622,32 +41623,77 @@ var ShadcnFileVariant = React54__namespace.forwardRef(
|
|
|
41622
41623
|
};
|
|
41623
41624
|
const FileChip = ({ item, condensed = false }) => {
|
|
41624
41625
|
const name = formatFileName ? formatFileName(item) : item.name;
|
|
41625
|
-
|
|
41626
|
-
|
|
41627
|
-
|
|
41628
|
-
|
|
41629
|
-
|
|
41630
|
-
|
|
41631
|
-
)
|
|
41632
|
-
|
|
41633
|
-
children: [
|
|
41634
|
-
/* @__PURE__ */ jsxRuntime.jsx(File2, { className: "h-3 w-3 text-muted-foreground shrink-0" }),
|
|
41635
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate font-medium", children: name }),
|
|
41636
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
41637
|
-
"button",
|
|
41638
|
-
{
|
|
41639
|
-
type: "button",
|
|
41640
|
-
onClick: (e) => {
|
|
41641
|
-
e.stopPropagation();
|
|
41642
|
-
handleRemove(item.id);
|
|
41643
|
-
},
|
|
41644
|
-
className: "ml-auto rounded-full text-muted-foreground/70 hover:text-destructive",
|
|
41645
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(X, { className: "h-3 w-3" })
|
|
41646
|
-
}
|
|
41647
|
-
)
|
|
41648
|
-
]
|
|
41626
|
+
const [preview, setPreview] = React54__namespace.useState(null);
|
|
41627
|
+
const [isOpen, setIsOpen] = React54__namespace.useState(false);
|
|
41628
|
+
React54__namespace.useEffect(() => {
|
|
41629
|
+
var _a;
|
|
41630
|
+
const isImage2 = ((_a = item.type) == null ? void 0 : _a.startsWith("image/")) || item.name.match(/\.(jpg|jpeg|png|gif|webp)$/i);
|
|
41631
|
+
if (!isImage2) {
|
|
41632
|
+
setPreview(null);
|
|
41633
|
+
return;
|
|
41649
41634
|
}
|
|
41650
|
-
|
|
41635
|
+
if (item.file) {
|
|
41636
|
+
const url = URL.createObjectURL(item.file);
|
|
41637
|
+
setPreview(url);
|
|
41638
|
+
return () => URL.revokeObjectURL(url);
|
|
41639
|
+
}
|
|
41640
|
+
if (item.url || item.path) {
|
|
41641
|
+
setPreview(item.url || item.path || null);
|
|
41642
|
+
}
|
|
41643
|
+
}, [item]);
|
|
41644
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Popover2, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
41645
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
41646
|
+
"div",
|
|
41647
|
+
{
|
|
41648
|
+
role: "button",
|
|
41649
|
+
tabIndex: 0,
|
|
41650
|
+
className: cn(
|
|
41651
|
+
"flex items-center gap-1.5 overflow-hidden rounded-sm border bg-muted/60 px-1.5 py-0.5 text-xs transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none cursor-pointer",
|
|
41652
|
+
condensed ? "max-w-[120px]" : "max-w-[200px]"
|
|
41653
|
+
),
|
|
41654
|
+
onClick: (e) => {
|
|
41655
|
+
e.stopPropagation();
|
|
41656
|
+
setIsOpen(true);
|
|
41657
|
+
},
|
|
41658
|
+
onKeyDown: (e) => {
|
|
41659
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
41660
|
+
e.stopPropagation();
|
|
41661
|
+
setIsOpen(true);
|
|
41662
|
+
}
|
|
41663
|
+
},
|
|
41664
|
+
children: [
|
|
41665
|
+
/* @__PURE__ */ jsxRuntime.jsx(File2, { className: "h-3 w-3 text-muted-foreground shrink-0" }),
|
|
41666
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate font-medium", children: name }),
|
|
41667
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
41668
|
+
"button",
|
|
41669
|
+
{
|
|
41670
|
+
type: "button",
|
|
41671
|
+
onClick: (e) => {
|
|
41672
|
+
e.stopPropagation();
|
|
41673
|
+
handleRemove(item.id);
|
|
41674
|
+
},
|
|
41675
|
+
className: "ml-auto flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-muted-foreground/70 hover:bg-destructive/20 hover:text-destructive focus:outline-none",
|
|
41676
|
+
"aria-label": "Remove file",
|
|
41677
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(X, { className: "h-3 w-3" })
|
|
41678
|
+
}
|
|
41679
|
+
)
|
|
41680
|
+
]
|
|
41681
|
+
}
|
|
41682
|
+
) }),
|
|
41683
|
+
/* @__PURE__ */ jsxRuntime.jsxs(PopoverContent2, { className: "w-64 p-0", align: "start", side: "bottom", children: [
|
|
41684
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative aspect-video w-full flex items-center justify-center bg-muted/30 border-b", children: preview ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: preview, alt: item.name, className: "h-full w-full object-contain" }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2 text-muted-foreground/50", children: [
|
|
41685
|
+
/* @__PURE__ */ jsxRuntime.jsx(File2, { className: "h-10 w-10" }),
|
|
41686
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] uppercase", children: "No Preview" })
|
|
41687
|
+
] }) }),
|
|
41688
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3", children: [
|
|
41689
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium text-sm truncate", title: item.name, children: name }),
|
|
41690
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-1 flex items-center justify-between text-xs text-muted-foreground", children: [
|
|
41691
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: formatFileSize(item.size) }),
|
|
41692
|
+
item.type && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "uppercase opacity-70", children: item.type.split("/").pop() })
|
|
41693
|
+
] })
|
|
41694
|
+
] })
|
|
41695
|
+
] })
|
|
41696
|
+
] });
|
|
41651
41697
|
};
|
|
41652
41698
|
const TriggerRegion = React54__namespace.useMemo(() => {
|
|
41653
41699
|
if (showDropArea) {
|
|
@@ -41667,7 +41713,7 @@ var ShadcnFileVariant = React54__namespace.forwardRef(
|
|
|
41667
41713
|
dropAreaClassName
|
|
41668
41714
|
),
|
|
41669
41715
|
children: [
|
|
41670
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-full bg-
|
|
41716
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-full bg-surfaces-input p-3 shadow-sm", children: dropIcon != null ? dropIcon : /* @__PURE__ */ jsxRuntime.jsx(CloudUpload, { className: "h-5 w-5 text-muted-foreground" }) }),
|
|
41671
41717
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
41672
41718
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-foreground", children: dropTitle != null ? dropTitle : "Click or drag to select" }),
|
|
41673
41719
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: dropDescription != null ? dropDescription : multiple ? "Select files" : "Select a file" })
|
|
@@ -41688,7 +41734,7 @@ var ShadcnFileVariant = React54__namespace.forwardRef(
|
|
|
41688
41734
|
className: cn(
|
|
41689
41735
|
"relative flex w-full cursor-pointer items-center gap-2 px-3 transition-all",
|
|
41690
41736
|
heightCls,
|
|
41691
|
-
(!joinControls || !hasExternalControls) && "rounded-md border border-input bg-
|
|
41737
|
+
(!joinControls || !hasExternalControls) && "rounded-md border border-input bg-surfaces-input ring-offset-background hover:bg-accent/5 focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
|
|
41692
41738
|
dragOver && "border-primary ring-2 ring-primary/20",
|
|
41693
41739
|
isDisabled && "cursor-not-allowed opacity-50",
|
|
41694
41740
|
error && "border-destructive text-destructive",
|
|
@@ -41728,7 +41774,7 @@ var ShadcnFileVariant = React54__namespace.forwardRef(
|
|
|
41728
41774
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
41729
41775
|
PopoverContent2,
|
|
41730
41776
|
{
|
|
41731
|
-
className: "w-
|
|
41777
|
+
className: "w-(--radix-popover-trigger-width) p-0",
|
|
41732
41778
|
align: "start",
|
|
41733
41779
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
41734
41780
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between border-b px-3 py-2 text-xs font-medium text-muted-foreground", children: [
|
|
@@ -41800,7 +41846,7 @@ var ShadcnFileVariant = React54__namespace.forwardRef(
|
|
|
41800
41846
|
},
|
|
41801
41847
|
children: [
|
|
41802
41848
|
/* @__PURE__ */ jsxRuntime.jsx(Plus, { className: "mr-2 h-3 w-3" }),
|
|
41803
|
-
"Add files..."
|
|
41849
|
+
multiple ? "Add files..." : items.length ? "Replace file" : "Add file"
|
|
41804
41850
|
]
|
|
41805
41851
|
}
|
|
41806
41852
|
) })
|
|
@@ -41891,7 +41937,7 @@ var ShadcnFileVariant = React54__namespace.forwardRef(
|
|
|
41891
41937
|
children: [
|
|
41892
41938
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(
|
|
41893
41939
|
"flex w-full",
|
|
41894
|
-
joinControls && extendBoxToControls && !showDropArea ? "items-stretch rounded-md border border-input bg-
|
|
41940
|
+
joinControls && extendBoxToControls && !showDropArea ? "items-stretch rounded-md border border-input bg-surfaces-input shadow-xs ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2" : "items-start gap-2"
|
|
41895
41941
|
), children: [
|
|
41896
41942
|
leadingControl && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
|
|
41897
41943
|
"flex items-center",
|
|
@@ -41930,6 +41976,1410 @@ var fileManagerModule = {
|
|
|
41930
41976
|
Variant: file_default,
|
|
41931
41977
|
variant: "file"
|
|
41932
41978
|
};
|
|
41979
|
+
// @__NO_SIDE_EFFECTS__
|
|
41980
|
+
function createSlot18(ownerName) {
|
|
41981
|
+
const SlotClone = /* @__PURE__ */ createSlotClone18(ownerName);
|
|
41982
|
+
const Slot22 = React54__namespace.forwardRef((props, forwardedRef) => {
|
|
41983
|
+
const { children, ...slotProps } = props;
|
|
41984
|
+
const childrenArray = React54__namespace.Children.toArray(children);
|
|
41985
|
+
const slottable = childrenArray.find(isSlottable18);
|
|
41986
|
+
if (slottable) {
|
|
41987
|
+
const newElement = slottable.props.children;
|
|
41988
|
+
const newChildren = childrenArray.map((child) => {
|
|
41989
|
+
if (child === slottable) {
|
|
41990
|
+
if (React54__namespace.Children.count(newElement) > 1) return React54__namespace.Children.only(null);
|
|
41991
|
+
return React54__namespace.isValidElement(newElement) ? newElement.props.children : null;
|
|
41992
|
+
} else {
|
|
41993
|
+
return child;
|
|
41994
|
+
}
|
|
41995
|
+
});
|
|
41996
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React54__namespace.isValidElement(newElement) ? React54__namespace.cloneElement(newElement, void 0, newChildren) : null });
|
|
41997
|
+
}
|
|
41998
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
41999
|
+
});
|
|
42000
|
+
Slot22.displayName = `${ownerName}.Slot`;
|
|
42001
|
+
return Slot22;
|
|
42002
|
+
}
|
|
42003
|
+
// @__NO_SIDE_EFFECTS__
|
|
42004
|
+
function createSlotClone18(ownerName) {
|
|
42005
|
+
const SlotClone = React54__namespace.forwardRef((props, forwardedRef) => {
|
|
42006
|
+
const { children, ...slotProps } = props;
|
|
42007
|
+
if (React54__namespace.isValidElement(children)) {
|
|
42008
|
+
const childrenRef = getElementRef19(children);
|
|
42009
|
+
const props2 = mergeProps18(slotProps, children.props);
|
|
42010
|
+
if (children.type !== React54__namespace.Fragment) {
|
|
42011
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
42012
|
+
}
|
|
42013
|
+
return React54__namespace.cloneElement(children, props2);
|
|
42014
|
+
}
|
|
42015
|
+
return React54__namespace.Children.count(children) > 1 ? React54__namespace.Children.only(null) : null;
|
|
42016
|
+
});
|
|
42017
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
42018
|
+
return SlotClone;
|
|
42019
|
+
}
|
|
42020
|
+
var SLOTTABLE_IDENTIFIER18 = /* @__PURE__ */ Symbol("radix.slottable");
|
|
42021
|
+
function isSlottable18(child) {
|
|
42022
|
+
return React54__namespace.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER18;
|
|
42023
|
+
}
|
|
42024
|
+
function mergeProps18(slotProps, childProps) {
|
|
42025
|
+
const overrideProps = { ...childProps };
|
|
42026
|
+
for (const propName in childProps) {
|
|
42027
|
+
const slotPropValue = slotProps[propName];
|
|
42028
|
+
const childPropValue = childProps[propName];
|
|
42029
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
42030
|
+
if (isHandler) {
|
|
42031
|
+
if (slotPropValue && childPropValue) {
|
|
42032
|
+
overrideProps[propName] = (...args) => {
|
|
42033
|
+
const result = childPropValue(...args);
|
|
42034
|
+
slotPropValue(...args);
|
|
42035
|
+
return result;
|
|
42036
|
+
};
|
|
42037
|
+
} else if (slotPropValue) {
|
|
42038
|
+
overrideProps[propName] = slotPropValue;
|
|
42039
|
+
}
|
|
42040
|
+
} else if (propName === "style") {
|
|
42041
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
42042
|
+
} else if (propName === "className") {
|
|
42043
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
42044
|
+
}
|
|
42045
|
+
}
|
|
42046
|
+
return { ...slotProps, ...overrideProps };
|
|
42047
|
+
}
|
|
42048
|
+
function getElementRef19(element) {
|
|
42049
|
+
var _a, _b;
|
|
42050
|
+
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
42051
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
42052
|
+
if (mayWarn) {
|
|
42053
|
+
return element.ref;
|
|
42054
|
+
}
|
|
42055
|
+
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
42056
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
42057
|
+
if (mayWarn) {
|
|
42058
|
+
return element.props.ref;
|
|
42059
|
+
}
|
|
42060
|
+
return element.props.ref || element.ref;
|
|
42061
|
+
}
|
|
42062
|
+
var NODES16 = [
|
|
42063
|
+
"a",
|
|
42064
|
+
"button",
|
|
42065
|
+
"div",
|
|
42066
|
+
"form",
|
|
42067
|
+
"h2",
|
|
42068
|
+
"h3",
|
|
42069
|
+
"img",
|
|
42070
|
+
"input",
|
|
42071
|
+
"label",
|
|
42072
|
+
"li",
|
|
42073
|
+
"nav",
|
|
42074
|
+
"ol",
|
|
42075
|
+
"p",
|
|
42076
|
+
"select",
|
|
42077
|
+
"span",
|
|
42078
|
+
"svg",
|
|
42079
|
+
"ul"
|
|
42080
|
+
];
|
|
42081
|
+
var Primitive16 = NODES16.reduce((primitive, node) => {
|
|
42082
|
+
const Slot5 = createSlot18(`Primitive.${node}`);
|
|
42083
|
+
const Node2 = React54__namespace.forwardRef((props, forwardedRef) => {
|
|
42084
|
+
const { asChild, ...primitiveProps } = props;
|
|
42085
|
+
const Comp = asChild ? Slot5 : node;
|
|
42086
|
+
if (typeof window !== "undefined") {
|
|
42087
|
+
window[/* @__PURE__ */ Symbol.for("radix-ui")] = true;
|
|
42088
|
+
}
|
|
42089
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
42090
|
+
});
|
|
42091
|
+
Node2.displayName = `Primitive.${node}`;
|
|
42092
|
+
return { ...primitive, [node]: Node2 };
|
|
42093
|
+
}, {});
|
|
42094
|
+
// @__NO_SIDE_EFFECTS__
|
|
42095
|
+
function createSlot19(ownerName) {
|
|
42096
|
+
const SlotClone = /* @__PURE__ */ createSlotClone19(ownerName);
|
|
42097
|
+
const Slot22 = React54__namespace.forwardRef((props, forwardedRef) => {
|
|
42098
|
+
const { children, ...slotProps } = props;
|
|
42099
|
+
const childrenArray = React54__namespace.Children.toArray(children);
|
|
42100
|
+
const slottable = childrenArray.find(isSlottable19);
|
|
42101
|
+
if (slottable) {
|
|
42102
|
+
const newElement = slottable.props.children;
|
|
42103
|
+
const newChildren = childrenArray.map((child) => {
|
|
42104
|
+
if (child === slottable) {
|
|
42105
|
+
if (React54__namespace.Children.count(newElement) > 1) return React54__namespace.Children.only(null);
|
|
42106
|
+
return React54__namespace.isValidElement(newElement) ? newElement.props.children : null;
|
|
42107
|
+
} else {
|
|
42108
|
+
return child;
|
|
42109
|
+
}
|
|
42110
|
+
});
|
|
42111
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React54__namespace.isValidElement(newElement) ? React54__namespace.cloneElement(newElement, void 0, newChildren) : null });
|
|
42112
|
+
}
|
|
42113
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
42114
|
+
});
|
|
42115
|
+
Slot22.displayName = `${ownerName}.Slot`;
|
|
42116
|
+
return Slot22;
|
|
42117
|
+
}
|
|
42118
|
+
// @__NO_SIDE_EFFECTS__
|
|
42119
|
+
function createSlotClone19(ownerName) {
|
|
42120
|
+
const SlotClone = React54__namespace.forwardRef((props, forwardedRef) => {
|
|
42121
|
+
const { children, ...slotProps } = props;
|
|
42122
|
+
if (React54__namespace.isValidElement(children)) {
|
|
42123
|
+
const childrenRef = getElementRef20(children);
|
|
42124
|
+
const props2 = mergeProps19(slotProps, children.props);
|
|
42125
|
+
if (children.type !== React54__namespace.Fragment) {
|
|
42126
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
42127
|
+
}
|
|
42128
|
+
return React54__namespace.cloneElement(children, props2);
|
|
42129
|
+
}
|
|
42130
|
+
return React54__namespace.Children.count(children) > 1 ? React54__namespace.Children.only(null) : null;
|
|
42131
|
+
});
|
|
42132
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
42133
|
+
return SlotClone;
|
|
42134
|
+
}
|
|
42135
|
+
var SLOTTABLE_IDENTIFIER19 = /* @__PURE__ */ Symbol("radix.slottable");
|
|
42136
|
+
function isSlottable19(child) {
|
|
42137
|
+
return React54__namespace.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER19;
|
|
42138
|
+
}
|
|
42139
|
+
function mergeProps19(slotProps, childProps) {
|
|
42140
|
+
const overrideProps = { ...childProps };
|
|
42141
|
+
for (const propName in childProps) {
|
|
42142
|
+
const slotPropValue = slotProps[propName];
|
|
42143
|
+
const childPropValue = childProps[propName];
|
|
42144
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
42145
|
+
if (isHandler) {
|
|
42146
|
+
if (slotPropValue && childPropValue) {
|
|
42147
|
+
overrideProps[propName] = (...args) => {
|
|
42148
|
+
const result = childPropValue(...args);
|
|
42149
|
+
slotPropValue(...args);
|
|
42150
|
+
return result;
|
|
42151
|
+
};
|
|
42152
|
+
} else if (slotPropValue) {
|
|
42153
|
+
overrideProps[propName] = slotPropValue;
|
|
42154
|
+
}
|
|
42155
|
+
} else if (propName === "style") {
|
|
42156
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
42157
|
+
} else if (propName === "className") {
|
|
42158
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
42159
|
+
}
|
|
42160
|
+
}
|
|
42161
|
+
return { ...slotProps, ...overrideProps };
|
|
42162
|
+
}
|
|
42163
|
+
function getElementRef20(element) {
|
|
42164
|
+
var _a, _b;
|
|
42165
|
+
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
42166
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
42167
|
+
if (mayWarn) {
|
|
42168
|
+
return element.ref;
|
|
42169
|
+
}
|
|
42170
|
+
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
42171
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
42172
|
+
if (mayWarn) {
|
|
42173
|
+
return element.props.ref;
|
|
42174
|
+
}
|
|
42175
|
+
return element.props.ref || element.ref;
|
|
42176
|
+
}
|
|
42177
|
+
var NODES17 = [
|
|
42178
|
+
"a",
|
|
42179
|
+
"button",
|
|
42180
|
+
"div",
|
|
42181
|
+
"form",
|
|
42182
|
+
"h2",
|
|
42183
|
+
"h3",
|
|
42184
|
+
"img",
|
|
42185
|
+
"input",
|
|
42186
|
+
"label",
|
|
42187
|
+
"li",
|
|
42188
|
+
"nav",
|
|
42189
|
+
"ol",
|
|
42190
|
+
"p",
|
|
42191
|
+
"select",
|
|
42192
|
+
"span",
|
|
42193
|
+
"svg",
|
|
42194
|
+
"ul"
|
|
42195
|
+
];
|
|
42196
|
+
var Primitive17 = NODES17.reduce((primitive, node) => {
|
|
42197
|
+
const Slot5 = createSlot19(`Primitive.${node}`);
|
|
42198
|
+
const Node2 = React54__namespace.forwardRef((props, forwardedRef) => {
|
|
42199
|
+
const { asChild, ...primitiveProps } = props;
|
|
42200
|
+
const Comp = asChild ? Slot5 : node;
|
|
42201
|
+
if (typeof window !== "undefined") {
|
|
42202
|
+
window[/* @__PURE__ */ Symbol.for("radix-ui")] = true;
|
|
42203
|
+
}
|
|
42204
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
42205
|
+
});
|
|
42206
|
+
Node2.displayName = `Primitive.${node}`;
|
|
42207
|
+
return { ...primitive, [node]: Node2 };
|
|
42208
|
+
}, {});
|
|
42209
|
+
var NAME3 = "Toggle";
|
|
42210
|
+
var Toggle = React54__namespace.forwardRef((props, forwardedRef) => {
|
|
42211
|
+
const { pressed: pressedProp, defaultPressed, onPressedChange, ...buttonProps } = props;
|
|
42212
|
+
const [pressed, setPressed] = useControllableState({
|
|
42213
|
+
prop: pressedProp,
|
|
42214
|
+
onChange: onPressedChange,
|
|
42215
|
+
defaultProp: defaultPressed != null ? defaultPressed : false,
|
|
42216
|
+
caller: NAME3
|
|
42217
|
+
});
|
|
42218
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42219
|
+
Primitive17.button,
|
|
42220
|
+
{
|
|
42221
|
+
type: "button",
|
|
42222
|
+
"aria-pressed": pressed,
|
|
42223
|
+
"data-state": pressed ? "on" : "off",
|
|
42224
|
+
"data-disabled": props.disabled ? "" : void 0,
|
|
42225
|
+
...buttonProps,
|
|
42226
|
+
ref: forwardedRef,
|
|
42227
|
+
onClick: composeEventHandlers(props.onClick, () => {
|
|
42228
|
+
if (!props.disabled) {
|
|
42229
|
+
setPressed(!pressed);
|
|
42230
|
+
}
|
|
42231
|
+
})
|
|
42232
|
+
}
|
|
42233
|
+
);
|
|
42234
|
+
});
|
|
42235
|
+
Toggle.displayName = NAME3;
|
|
42236
|
+
var TOGGLE_GROUP_NAME = "ToggleGroup";
|
|
42237
|
+
var [createToggleGroupContext] = createContextScope(TOGGLE_GROUP_NAME, [
|
|
42238
|
+
createRovingFocusGroupScope
|
|
42239
|
+
]);
|
|
42240
|
+
var useRovingFocusGroupScope2 = createRovingFocusGroupScope();
|
|
42241
|
+
var ToggleGroup = React54__namespace.default.forwardRef((props, forwardedRef) => {
|
|
42242
|
+
const { type, ...toggleGroupProps } = props;
|
|
42243
|
+
if (type === "single") {
|
|
42244
|
+
const singleProps = toggleGroupProps;
|
|
42245
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ToggleGroupImplSingle, { ...singleProps, ref: forwardedRef });
|
|
42246
|
+
}
|
|
42247
|
+
if (type === "multiple") {
|
|
42248
|
+
const multipleProps = toggleGroupProps;
|
|
42249
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ToggleGroupImplMultiple, { ...multipleProps, ref: forwardedRef });
|
|
42250
|
+
}
|
|
42251
|
+
throw new Error(`Missing prop \`type\` expected on \`${TOGGLE_GROUP_NAME}\``);
|
|
42252
|
+
});
|
|
42253
|
+
ToggleGroup.displayName = TOGGLE_GROUP_NAME;
|
|
42254
|
+
var [ToggleGroupValueProvider, useToggleGroupValueContext] = createToggleGroupContext(TOGGLE_GROUP_NAME);
|
|
42255
|
+
var ToggleGroupImplSingle = React54__namespace.default.forwardRef((props, forwardedRef) => {
|
|
42256
|
+
const {
|
|
42257
|
+
value: valueProp,
|
|
42258
|
+
defaultValue,
|
|
42259
|
+
onValueChange = () => {
|
|
42260
|
+
},
|
|
42261
|
+
...toggleGroupSingleProps
|
|
42262
|
+
} = props;
|
|
42263
|
+
const [value, setValue] = useControllableState({
|
|
42264
|
+
prop: valueProp,
|
|
42265
|
+
defaultProp: defaultValue != null ? defaultValue : "",
|
|
42266
|
+
onChange: onValueChange,
|
|
42267
|
+
caller: TOGGLE_GROUP_NAME
|
|
42268
|
+
});
|
|
42269
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42270
|
+
ToggleGroupValueProvider,
|
|
42271
|
+
{
|
|
42272
|
+
scope: props.__scopeToggleGroup,
|
|
42273
|
+
type: "single",
|
|
42274
|
+
value: React54__namespace.default.useMemo(() => value ? [value] : [], [value]),
|
|
42275
|
+
onItemActivate: setValue,
|
|
42276
|
+
onItemDeactivate: React54__namespace.default.useCallback(() => setValue(""), [setValue]),
|
|
42277
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ToggleGroupImpl, { ...toggleGroupSingleProps, ref: forwardedRef })
|
|
42278
|
+
}
|
|
42279
|
+
);
|
|
42280
|
+
});
|
|
42281
|
+
var ToggleGroupImplMultiple = React54__namespace.default.forwardRef((props, forwardedRef) => {
|
|
42282
|
+
const {
|
|
42283
|
+
value: valueProp,
|
|
42284
|
+
defaultValue,
|
|
42285
|
+
onValueChange = () => {
|
|
42286
|
+
},
|
|
42287
|
+
...toggleGroupMultipleProps
|
|
42288
|
+
} = props;
|
|
42289
|
+
const [value, setValue] = useControllableState({
|
|
42290
|
+
prop: valueProp,
|
|
42291
|
+
defaultProp: defaultValue != null ? defaultValue : [],
|
|
42292
|
+
onChange: onValueChange,
|
|
42293
|
+
caller: TOGGLE_GROUP_NAME
|
|
42294
|
+
});
|
|
42295
|
+
const handleButtonActivate = React54__namespace.default.useCallback(
|
|
42296
|
+
(itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]),
|
|
42297
|
+
[setValue]
|
|
42298
|
+
);
|
|
42299
|
+
const handleButtonDeactivate = React54__namespace.default.useCallback(
|
|
42300
|
+
(itemValue) => setValue((prevValue = []) => prevValue.filter((value2) => value2 !== itemValue)),
|
|
42301
|
+
[setValue]
|
|
42302
|
+
);
|
|
42303
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42304
|
+
ToggleGroupValueProvider,
|
|
42305
|
+
{
|
|
42306
|
+
scope: props.__scopeToggleGroup,
|
|
42307
|
+
type: "multiple",
|
|
42308
|
+
value,
|
|
42309
|
+
onItemActivate: handleButtonActivate,
|
|
42310
|
+
onItemDeactivate: handleButtonDeactivate,
|
|
42311
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ToggleGroupImpl, { ...toggleGroupMultipleProps, ref: forwardedRef })
|
|
42312
|
+
}
|
|
42313
|
+
);
|
|
42314
|
+
});
|
|
42315
|
+
ToggleGroup.displayName = TOGGLE_GROUP_NAME;
|
|
42316
|
+
var [ToggleGroupContext, useToggleGroupContext] = createToggleGroupContext(TOGGLE_GROUP_NAME);
|
|
42317
|
+
var ToggleGroupImpl = React54__namespace.default.forwardRef(
|
|
42318
|
+
(props, forwardedRef) => {
|
|
42319
|
+
const {
|
|
42320
|
+
__scopeToggleGroup,
|
|
42321
|
+
disabled = false,
|
|
42322
|
+
rovingFocus = true,
|
|
42323
|
+
orientation,
|
|
42324
|
+
dir,
|
|
42325
|
+
loop = true,
|
|
42326
|
+
...toggleGroupProps
|
|
42327
|
+
} = props;
|
|
42328
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope2(__scopeToggleGroup);
|
|
42329
|
+
const direction = useDirection(dir);
|
|
42330
|
+
const commonProps = { role: "group", dir: direction, ...toggleGroupProps };
|
|
42331
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ToggleGroupContext, { scope: __scopeToggleGroup, rovingFocus, disabled, children: rovingFocus ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
42332
|
+
Root6,
|
|
42333
|
+
{
|
|
42334
|
+
asChild: true,
|
|
42335
|
+
...rovingFocusGroupScope,
|
|
42336
|
+
orientation,
|
|
42337
|
+
dir: direction,
|
|
42338
|
+
loop,
|
|
42339
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Primitive16.div, { ...commonProps, ref: forwardedRef })
|
|
42340
|
+
}
|
|
42341
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(Primitive16.div, { ...commonProps, ref: forwardedRef }) });
|
|
42342
|
+
}
|
|
42343
|
+
);
|
|
42344
|
+
var ITEM_NAME4 = "ToggleGroupItem";
|
|
42345
|
+
var ToggleGroupItem = React54__namespace.default.forwardRef(
|
|
42346
|
+
(props, forwardedRef) => {
|
|
42347
|
+
const valueContext = useToggleGroupValueContext(ITEM_NAME4, props.__scopeToggleGroup);
|
|
42348
|
+
const context = useToggleGroupContext(ITEM_NAME4, props.__scopeToggleGroup);
|
|
42349
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope2(props.__scopeToggleGroup);
|
|
42350
|
+
const pressed = valueContext.value.includes(props.value);
|
|
42351
|
+
const disabled = context.disabled || props.disabled;
|
|
42352
|
+
const commonProps = { ...props, pressed, disabled };
|
|
42353
|
+
const ref = React54__namespace.default.useRef(null);
|
|
42354
|
+
return context.rovingFocus ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
42355
|
+
Item2,
|
|
42356
|
+
{
|
|
42357
|
+
asChild: true,
|
|
42358
|
+
...rovingFocusGroupScope,
|
|
42359
|
+
focusable: !disabled,
|
|
42360
|
+
active: pressed,
|
|
42361
|
+
ref,
|
|
42362
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ToggleGroupItemImpl, { ...commonProps, ref: forwardedRef })
|
|
42363
|
+
}
|
|
42364
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(ToggleGroupItemImpl, { ...commonProps, ref: forwardedRef });
|
|
42365
|
+
}
|
|
42366
|
+
);
|
|
42367
|
+
ToggleGroupItem.displayName = ITEM_NAME4;
|
|
42368
|
+
var ToggleGroupItemImpl = React54__namespace.default.forwardRef(
|
|
42369
|
+
(props, forwardedRef) => {
|
|
42370
|
+
const { __scopeToggleGroup, value, ...itemProps } = props;
|
|
42371
|
+
const valueContext = useToggleGroupValueContext(ITEM_NAME4, __scopeToggleGroup);
|
|
42372
|
+
const singleProps = { role: "radio", "aria-checked": props.pressed, "aria-pressed": void 0 };
|
|
42373
|
+
const typeProps = valueContext.type === "single" ? singleProps : void 0;
|
|
42374
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42375
|
+
Toggle,
|
|
42376
|
+
{
|
|
42377
|
+
...typeProps,
|
|
42378
|
+
...itemProps,
|
|
42379
|
+
ref: forwardedRef,
|
|
42380
|
+
onPressedChange: (pressed) => {
|
|
42381
|
+
if (pressed) {
|
|
42382
|
+
valueContext.onItemActivate(value);
|
|
42383
|
+
} else {
|
|
42384
|
+
valueContext.onItemDeactivate(value);
|
|
42385
|
+
}
|
|
42386
|
+
}
|
|
42387
|
+
}
|
|
42388
|
+
);
|
|
42389
|
+
}
|
|
42390
|
+
);
|
|
42391
|
+
var Root25 = ToggleGroup;
|
|
42392
|
+
var Item23 = ToggleGroupItem;
|
|
42393
|
+
var toggleVariants = cva(
|
|
42394
|
+
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
|
|
42395
|
+
{
|
|
42396
|
+
variants: {
|
|
42397
|
+
variant: {
|
|
42398
|
+
default: "bg-transparent",
|
|
42399
|
+
outline: "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"
|
|
42400
|
+
},
|
|
42401
|
+
size: {
|
|
42402
|
+
default: "h-9 px-2 min-w-9",
|
|
42403
|
+
sm: "h-8 px-1.5 min-w-8",
|
|
42404
|
+
lg: "h-10 px-2.5 min-w-10"
|
|
42405
|
+
}
|
|
42406
|
+
},
|
|
42407
|
+
defaultVariants: {
|
|
42408
|
+
variant: "default",
|
|
42409
|
+
size: "default"
|
|
42410
|
+
}
|
|
42411
|
+
}
|
|
42412
|
+
);
|
|
42413
|
+
var ToggleGroupContext2 = React54__namespace.createContext({
|
|
42414
|
+
size: "default",
|
|
42415
|
+
variant: "default",
|
|
42416
|
+
spacing: 0
|
|
42417
|
+
});
|
|
42418
|
+
function ToggleGroup2({
|
|
42419
|
+
className,
|
|
42420
|
+
variant,
|
|
42421
|
+
size: size4,
|
|
42422
|
+
spacing = 0,
|
|
42423
|
+
children,
|
|
42424
|
+
...props
|
|
42425
|
+
}) {
|
|
42426
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42427
|
+
Root25,
|
|
42428
|
+
{
|
|
42429
|
+
"data-slot": "toggle-group",
|
|
42430
|
+
"data-variant": variant,
|
|
42431
|
+
"data-size": size4,
|
|
42432
|
+
"data-spacing": spacing,
|
|
42433
|
+
style: { "--gap": spacing },
|
|
42434
|
+
className: cn(
|
|
42435
|
+
"group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",
|
|
42436
|
+
className
|
|
42437
|
+
),
|
|
42438
|
+
...props,
|
|
42439
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ToggleGroupContext2.Provider, { value: { variant, size: size4, spacing }, children })
|
|
42440
|
+
}
|
|
42441
|
+
);
|
|
42442
|
+
}
|
|
42443
|
+
function ToggleGroupItem2({
|
|
42444
|
+
className,
|
|
42445
|
+
children,
|
|
42446
|
+
variant,
|
|
42447
|
+
size: size4,
|
|
42448
|
+
...props
|
|
42449
|
+
}) {
|
|
42450
|
+
const context = React54__namespace.useContext(ToggleGroupContext2);
|
|
42451
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42452
|
+
Item23,
|
|
42453
|
+
{
|
|
42454
|
+
"data-slot": "toggle-group-item",
|
|
42455
|
+
"data-variant": context.variant || variant,
|
|
42456
|
+
"data-size": context.size || size4,
|
|
42457
|
+
"data-spacing": context.spacing,
|
|
42458
|
+
className: cn(
|
|
42459
|
+
toggleVariants({
|
|
42460
|
+
variant: context.variant || variant,
|
|
42461
|
+
size: context.size || size4
|
|
42462
|
+
}),
|
|
42463
|
+
"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10",
|
|
42464
|
+
"data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",
|
|
42465
|
+
className
|
|
42466
|
+
),
|
|
42467
|
+
...props,
|
|
42468
|
+
children
|
|
42469
|
+
}
|
|
42470
|
+
);
|
|
42471
|
+
}
|
|
42472
|
+
// @__NO_SIDE_EFFECTS__
|
|
42473
|
+
function createSlot20(ownerName) {
|
|
42474
|
+
const SlotClone = /* @__PURE__ */ createSlotClone20(ownerName);
|
|
42475
|
+
const Slot22 = React54__namespace.forwardRef((props, forwardedRef) => {
|
|
42476
|
+
const { children, ...slotProps } = props;
|
|
42477
|
+
const childrenArray = React54__namespace.Children.toArray(children);
|
|
42478
|
+
const slottable = childrenArray.find(isSlottable20);
|
|
42479
|
+
if (slottable) {
|
|
42480
|
+
const newElement = slottable.props.children;
|
|
42481
|
+
const newChildren = childrenArray.map((child) => {
|
|
42482
|
+
if (child === slottable) {
|
|
42483
|
+
if (React54__namespace.Children.count(newElement) > 1) return React54__namespace.Children.only(null);
|
|
42484
|
+
return React54__namespace.isValidElement(newElement) ? newElement.props.children : null;
|
|
42485
|
+
} else {
|
|
42486
|
+
return child;
|
|
42487
|
+
}
|
|
42488
|
+
});
|
|
42489
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React54__namespace.isValidElement(newElement) ? React54__namespace.cloneElement(newElement, void 0, newChildren) : null });
|
|
42490
|
+
}
|
|
42491
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
42492
|
+
});
|
|
42493
|
+
Slot22.displayName = `${ownerName}.Slot`;
|
|
42494
|
+
return Slot22;
|
|
42495
|
+
}
|
|
42496
|
+
// @__NO_SIDE_EFFECTS__
|
|
42497
|
+
function createSlotClone20(ownerName) {
|
|
42498
|
+
const SlotClone = React54__namespace.forwardRef((props, forwardedRef) => {
|
|
42499
|
+
const { children, ...slotProps } = props;
|
|
42500
|
+
if (React54__namespace.isValidElement(children)) {
|
|
42501
|
+
const childrenRef = getElementRef21(children);
|
|
42502
|
+
const props2 = mergeProps20(slotProps, children.props);
|
|
42503
|
+
if (children.type !== React54__namespace.Fragment) {
|
|
42504
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
42505
|
+
}
|
|
42506
|
+
return React54__namespace.cloneElement(children, props2);
|
|
42507
|
+
}
|
|
42508
|
+
return React54__namespace.Children.count(children) > 1 ? React54__namespace.Children.only(null) : null;
|
|
42509
|
+
});
|
|
42510
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
42511
|
+
return SlotClone;
|
|
42512
|
+
}
|
|
42513
|
+
var SLOTTABLE_IDENTIFIER20 = /* @__PURE__ */ Symbol("radix.slottable");
|
|
42514
|
+
// @__NO_SIDE_EFFECTS__
|
|
42515
|
+
function createSlottable(ownerName) {
|
|
42516
|
+
const Slottable2 = ({ children }) => {
|
|
42517
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
42518
|
+
};
|
|
42519
|
+
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
42520
|
+
Slottable2.__radixId = SLOTTABLE_IDENTIFIER20;
|
|
42521
|
+
return Slottable2;
|
|
42522
|
+
}
|
|
42523
|
+
function isSlottable20(child) {
|
|
42524
|
+
return React54__namespace.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER20;
|
|
42525
|
+
}
|
|
42526
|
+
function mergeProps20(slotProps, childProps) {
|
|
42527
|
+
const overrideProps = { ...childProps };
|
|
42528
|
+
for (const propName in childProps) {
|
|
42529
|
+
const slotPropValue = slotProps[propName];
|
|
42530
|
+
const childPropValue = childProps[propName];
|
|
42531
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
42532
|
+
if (isHandler) {
|
|
42533
|
+
if (slotPropValue && childPropValue) {
|
|
42534
|
+
overrideProps[propName] = (...args) => {
|
|
42535
|
+
const result = childPropValue(...args);
|
|
42536
|
+
slotPropValue(...args);
|
|
42537
|
+
return result;
|
|
42538
|
+
};
|
|
42539
|
+
} else if (slotPropValue) {
|
|
42540
|
+
overrideProps[propName] = slotPropValue;
|
|
42541
|
+
}
|
|
42542
|
+
} else if (propName === "style") {
|
|
42543
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
42544
|
+
} else if (propName === "className") {
|
|
42545
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
42546
|
+
}
|
|
42547
|
+
}
|
|
42548
|
+
return { ...slotProps, ...overrideProps };
|
|
42549
|
+
}
|
|
42550
|
+
function getElementRef21(element) {
|
|
42551
|
+
var _a, _b;
|
|
42552
|
+
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
42553
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
42554
|
+
if (mayWarn) {
|
|
42555
|
+
return element.ref;
|
|
42556
|
+
}
|
|
42557
|
+
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
42558
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
42559
|
+
if (mayWarn) {
|
|
42560
|
+
return element.props.ref;
|
|
42561
|
+
}
|
|
42562
|
+
return element.props.ref || element.ref;
|
|
42563
|
+
}
|
|
42564
|
+
var NODES18 = [
|
|
42565
|
+
"a",
|
|
42566
|
+
"button",
|
|
42567
|
+
"div",
|
|
42568
|
+
"form",
|
|
42569
|
+
"h2",
|
|
42570
|
+
"h3",
|
|
42571
|
+
"img",
|
|
42572
|
+
"input",
|
|
42573
|
+
"label",
|
|
42574
|
+
"li",
|
|
42575
|
+
"nav",
|
|
42576
|
+
"ol",
|
|
42577
|
+
"p",
|
|
42578
|
+
"select",
|
|
42579
|
+
"span",
|
|
42580
|
+
"svg",
|
|
42581
|
+
"ul"
|
|
42582
|
+
];
|
|
42583
|
+
var Primitive18 = NODES18.reduce((primitive, node) => {
|
|
42584
|
+
const Slot5 = createSlot20(`Primitive.${node}`);
|
|
42585
|
+
const Node2 = React54__namespace.forwardRef((props, forwardedRef) => {
|
|
42586
|
+
const { asChild, ...primitiveProps } = props;
|
|
42587
|
+
const Comp = asChild ? Slot5 : node;
|
|
42588
|
+
if (typeof window !== "undefined") {
|
|
42589
|
+
window[/* @__PURE__ */ Symbol.for("radix-ui")] = true;
|
|
42590
|
+
}
|
|
42591
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
42592
|
+
});
|
|
42593
|
+
Node2.displayName = `Primitive.${node}`;
|
|
42594
|
+
return { ...primitive, [node]: Node2 };
|
|
42595
|
+
}, {});
|
|
42596
|
+
var [createTooltipContext] = createContextScope("Tooltip", [
|
|
42597
|
+
createPopperScope
|
|
42598
|
+
]);
|
|
42599
|
+
var usePopperScope3 = createPopperScope();
|
|
42600
|
+
var PROVIDER_NAME = "TooltipProvider";
|
|
42601
|
+
var DEFAULT_DELAY_DURATION = 700;
|
|
42602
|
+
var TOOLTIP_OPEN = "tooltip.open";
|
|
42603
|
+
var [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME);
|
|
42604
|
+
var TooltipProvider = (props) => {
|
|
42605
|
+
const {
|
|
42606
|
+
__scopeTooltip,
|
|
42607
|
+
delayDuration = DEFAULT_DELAY_DURATION,
|
|
42608
|
+
skipDelayDuration = 300,
|
|
42609
|
+
disableHoverableContent = false,
|
|
42610
|
+
children
|
|
42611
|
+
} = props;
|
|
42612
|
+
const isOpenDelayedRef = React54__namespace.useRef(true);
|
|
42613
|
+
const isPointerInTransitRef = React54__namespace.useRef(false);
|
|
42614
|
+
const skipDelayTimerRef = React54__namespace.useRef(0);
|
|
42615
|
+
React54__namespace.useEffect(() => {
|
|
42616
|
+
const skipDelayTimer = skipDelayTimerRef.current;
|
|
42617
|
+
return () => window.clearTimeout(skipDelayTimer);
|
|
42618
|
+
}, []);
|
|
42619
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42620
|
+
TooltipProviderContextProvider,
|
|
42621
|
+
{
|
|
42622
|
+
scope: __scopeTooltip,
|
|
42623
|
+
isOpenDelayedRef,
|
|
42624
|
+
delayDuration,
|
|
42625
|
+
onOpen: React54__namespace.useCallback(() => {
|
|
42626
|
+
window.clearTimeout(skipDelayTimerRef.current);
|
|
42627
|
+
isOpenDelayedRef.current = false;
|
|
42628
|
+
}, []),
|
|
42629
|
+
onClose: React54__namespace.useCallback(() => {
|
|
42630
|
+
window.clearTimeout(skipDelayTimerRef.current);
|
|
42631
|
+
skipDelayTimerRef.current = window.setTimeout(
|
|
42632
|
+
() => isOpenDelayedRef.current = true,
|
|
42633
|
+
skipDelayDuration
|
|
42634
|
+
);
|
|
42635
|
+
}, [skipDelayDuration]),
|
|
42636
|
+
isPointerInTransitRef,
|
|
42637
|
+
onPointerInTransitChange: React54__namespace.useCallback((inTransit) => {
|
|
42638
|
+
isPointerInTransitRef.current = inTransit;
|
|
42639
|
+
}, []),
|
|
42640
|
+
disableHoverableContent,
|
|
42641
|
+
children
|
|
42642
|
+
}
|
|
42643
|
+
);
|
|
42644
|
+
};
|
|
42645
|
+
TooltipProvider.displayName = PROVIDER_NAME;
|
|
42646
|
+
var TOOLTIP_NAME = "Tooltip";
|
|
42647
|
+
var [TooltipContextProvider, useTooltipContext] = createTooltipContext(TOOLTIP_NAME);
|
|
42648
|
+
var Tooltip = (props) => {
|
|
42649
|
+
const {
|
|
42650
|
+
__scopeTooltip,
|
|
42651
|
+
children,
|
|
42652
|
+
open: openProp,
|
|
42653
|
+
defaultOpen,
|
|
42654
|
+
onOpenChange,
|
|
42655
|
+
disableHoverableContent: disableHoverableContentProp,
|
|
42656
|
+
delayDuration: delayDurationProp
|
|
42657
|
+
} = props;
|
|
42658
|
+
const providerContext = useTooltipProviderContext(TOOLTIP_NAME, props.__scopeTooltip);
|
|
42659
|
+
const popperScope = usePopperScope3(__scopeTooltip);
|
|
42660
|
+
const [trigger, setTrigger] = React54__namespace.useState(null);
|
|
42661
|
+
const contentId = useId3();
|
|
42662
|
+
const openTimerRef = React54__namespace.useRef(0);
|
|
42663
|
+
const disableHoverableContent = disableHoverableContentProp != null ? disableHoverableContentProp : providerContext.disableHoverableContent;
|
|
42664
|
+
const delayDuration = delayDurationProp != null ? delayDurationProp : providerContext.delayDuration;
|
|
42665
|
+
const wasOpenDelayedRef = React54__namespace.useRef(false);
|
|
42666
|
+
const [open, setOpen] = useControllableState({
|
|
42667
|
+
prop: openProp,
|
|
42668
|
+
defaultProp: defaultOpen != null ? defaultOpen : false,
|
|
42669
|
+
onChange: (open2) => {
|
|
42670
|
+
if (open2) {
|
|
42671
|
+
providerContext.onOpen();
|
|
42672
|
+
document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN));
|
|
42673
|
+
} else {
|
|
42674
|
+
providerContext.onClose();
|
|
42675
|
+
}
|
|
42676
|
+
onOpenChange == null ? void 0 : onOpenChange(open2);
|
|
42677
|
+
},
|
|
42678
|
+
caller: TOOLTIP_NAME
|
|
42679
|
+
});
|
|
42680
|
+
const stateAttribute = React54__namespace.useMemo(() => {
|
|
42681
|
+
return open ? wasOpenDelayedRef.current ? "delayed-open" : "instant-open" : "closed";
|
|
42682
|
+
}, [open]);
|
|
42683
|
+
const handleOpen = React54__namespace.useCallback(() => {
|
|
42684
|
+
window.clearTimeout(openTimerRef.current);
|
|
42685
|
+
openTimerRef.current = 0;
|
|
42686
|
+
wasOpenDelayedRef.current = false;
|
|
42687
|
+
setOpen(true);
|
|
42688
|
+
}, [setOpen]);
|
|
42689
|
+
const handleClose = React54__namespace.useCallback(() => {
|
|
42690
|
+
window.clearTimeout(openTimerRef.current);
|
|
42691
|
+
openTimerRef.current = 0;
|
|
42692
|
+
setOpen(false);
|
|
42693
|
+
}, [setOpen]);
|
|
42694
|
+
const handleDelayedOpen = React54__namespace.useCallback(() => {
|
|
42695
|
+
window.clearTimeout(openTimerRef.current);
|
|
42696
|
+
openTimerRef.current = window.setTimeout(() => {
|
|
42697
|
+
wasOpenDelayedRef.current = true;
|
|
42698
|
+
setOpen(true);
|
|
42699
|
+
openTimerRef.current = 0;
|
|
42700
|
+
}, delayDuration);
|
|
42701
|
+
}, [delayDuration, setOpen]);
|
|
42702
|
+
React54__namespace.useEffect(() => {
|
|
42703
|
+
return () => {
|
|
42704
|
+
if (openTimerRef.current) {
|
|
42705
|
+
window.clearTimeout(openTimerRef.current);
|
|
42706
|
+
openTimerRef.current = 0;
|
|
42707
|
+
}
|
|
42708
|
+
};
|
|
42709
|
+
}, []);
|
|
42710
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Root2, { ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
42711
|
+
TooltipContextProvider,
|
|
42712
|
+
{
|
|
42713
|
+
scope: __scopeTooltip,
|
|
42714
|
+
contentId,
|
|
42715
|
+
open,
|
|
42716
|
+
stateAttribute,
|
|
42717
|
+
trigger,
|
|
42718
|
+
onTriggerChange: setTrigger,
|
|
42719
|
+
onTriggerEnter: React54__namespace.useCallback(() => {
|
|
42720
|
+
if (providerContext.isOpenDelayedRef.current) handleDelayedOpen();
|
|
42721
|
+
else handleOpen();
|
|
42722
|
+
}, [providerContext.isOpenDelayedRef, handleDelayedOpen, handleOpen]),
|
|
42723
|
+
onTriggerLeave: React54__namespace.useCallback(() => {
|
|
42724
|
+
if (disableHoverableContent) {
|
|
42725
|
+
handleClose();
|
|
42726
|
+
} else {
|
|
42727
|
+
window.clearTimeout(openTimerRef.current);
|
|
42728
|
+
openTimerRef.current = 0;
|
|
42729
|
+
}
|
|
42730
|
+
}, [handleClose, disableHoverableContent]),
|
|
42731
|
+
onOpen: handleOpen,
|
|
42732
|
+
onClose: handleClose,
|
|
42733
|
+
disableHoverableContent,
|
|
42734
|
+
children
|
|
42735
|
+
}
|
|
42736
|
+
) });
|
|
42737
|
+
};
|
|
42738
|
+
Tooltip.displayName = TOOLTIP_NAME;
|
|
42739
|
+
var TRIGGER_NAME5 = "TooltipTrigger";
|
|
42740
|
+
var TooltipTrigger = React54__namespace.forwardRef(
|
|
42741
|
+
(props, forwardedRef) => {
|
|
42742
|
+
const { __scopeTooltip, ...triggerProps } = props;
|
|
42743
|
+
const context = useTooltipContext(TRIGGER_NAME5, __scopeTooltip);
|
|
42744
|
+
const providerContext = useTooltipProviderContext(TRIGGER_NAME5, __scopeTooltip);
|
|
42745
|
+
const popperScope = usePopperScope3(__scopeTooltip);
|
|
42746
|
+
const ref = React54__namespace.useRef(null);
|
|
42747
|
+
const composedRefs = useComposedRefs(forwardedRef, ref, context.onTriggerChange);
|
|
42748
|
+
const isPointerDownRef = React54__namespace.useRef(false);
|
|
42749
|
+
const hasPointerMoveOpenedRef = React54__namespace.useRef(false);
|
|
42750
|
+
const handlePointerUp = React54__namespace.useCallback(() => isPointerDownRef.current = false, []);
|
|
42751
|
+
React54__namespace.useEffect(() => {
|
|
42752
|
+
return () => document.removeEventListener("pointerup", handlePointerUp);
|
|
42753
|
+
}, [handlePointerUp]);
|
|
42754
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
42755
|
+
Primitive18.button,
|
|
42756
|
+
{
|
|
42757
|
+
"aria-describedby": context.open ? context.contentId : void 0,
|
|
42758
|
+
"data-state": context.stateAttribute,
|
|
42759
|
+
...triggerProps,
|
|
42760
|
+
ref: composedRefs,
|
|
42761
|
+
onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {
|
|
42762
|
+
if (event.pointerType === "touch") return;
|
|
42763
|
+
if (!hasPointerMoveOpenedRef.current && !providerContext.isPointerInTransitRef.current) {
|
|
42764
|
+
context.onTriggerEnter();
|
|
42765
|
+
hasPointerMoveOpenedRef.current = true;
|
|
42766
|
+
}
|
|
42767
|
+
}),
|
|
42768
|
+
onPointerLeave: composeEventHandlers(props.onPointerLeave, () => {
|
|
42769
|
+
context.onTriggerLeave();
|
|
42770
|
+
hasPointerMoveOpenedRef.current = false;
|
|
42771
|
+
}),
|
|
42772
|
+
onPointerDown: composeEventHandlers(props.onPointerDown, () => {
|
|
42773
|
+
if (context.open) {
|
|
42774
|
+
context.onClose();
|
|
42775
|
+
}
|
|
42776
|
+
isPointerDownRef.current = true;
|
|
42777
|
+
document.addEventListener("pointerup", handlePointerUp, { once: true });
|
|
42778
|
+
}),
|
|
42779
|
+
onFocus: composeEventHandlers(props.onFocus, () => {
|
|
42780
|
+
if (!isPointerDownRef.current) context.onOpen();
|
|
42781
|
+
}),
|
|
42782
|
+
onBlur: composeEventHandlers(props.onBlur, context.onClose),
|
|
42783
|
+
onClick: composeEventHandlers(props.onClick, context.onClose)
|
|
42784
|
+
}
|
|
42785
|
+
) });
|
|
42786
|
+
}
|
|
42787
|
+
);
|
|
42788
|
+
TooltipTrigger.displayName = TRIGGER_NAME5;
|
|
42789
|
+
var PORTAL_NAME5 = "TooltipPortal";
|
|
42790
|
+
var [PortalProvider3, usePortalContext3] = createTooltipContext(PORTAL_NAME5, {
|
|
42791
|
+
forceMount: void 0
|
|
42792
|
+
});
|
|
42793
|
+
var TooltipPortal = (props) => {
|
|
42794
|
+
const { __scopeTooltip, forceMount, children, container } = props;
|
|
42795
|
+
const context = useTooltipContext(PORTAL_NAME5, __scopeTooltip);
|
|
42796
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PortalProvider3, { scope: __scopeTooltip, forceMount, children: /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Portal, { asChild: true, container, children }) }) });
|
|
42797
|
+
};
|
|
42798
|
+
TooltipPortal.displayName = PORTAL_NAME5;
|
|
42799
|
+
var CONTENT_NAME5 = "TooltipContent";
|
|
42800
|
+
var TooltipContent = React54__namespace.forwardRef(
|
|
42801
|
+
(props, forwardedRef) => {
|
|
42802
|
+
const portalContext = usePortalContext3(CONTENT_NAME5, props.__scopeTooltip);
|
|
42803
|
+
const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
|
|
42804
|
+
const context = useTooltipContext(CONTENT_NAME5, props.__scopeTooltip);
|
|
42805
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ jsxRuntime.jsx(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntime.jsx(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) });
|
|
42806
|
+
}
|
|
42807
|
+
);
|
|
42808
|
+
var TooltipContentHoverable = React54__namespace.forwardRef((props, forwardedRef) => {
|
|
42809
|
+
const context = useTooltipContext(CONTENT_NAME5, props.__scopeTooltip);
|
|
42810
|
+
const providerContext = useTooltipProviderContext(CONTENT_NAME5, props.__scopeTooltip);
|
|
42811
|
+
const ref = React54__namespace.useRef(null);
|
|
42812
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
42813
|
+
const [pointerGraceArea, setPointerGraceArea] = React54__namespace.useState(null);
|
|
42814
|
+
const { trigger, onClose } = context;
|
|
42815
|
+
const content = ref.current;
|
|
42816
|
+
const { onPointerInTransitChange } = providerContext;
|
|
42817
|
+
const handleRemoveGraceArea = React54__namespace.useCallback(() => {
|
|
42818
|
+
setPointerGraceArea(null);
|
|
42819
|
+
onPointerInTransitChange(false);
|
|
42820
|
+
}, [onPointerInTransitChange]);
|
|
42821
|
+
const handleCreateGraceArea = React54__namespace.useCallback(
|
|
42822
|
+
(event, hoverTarget) => {
|
|
42823
|
+
const currentTarget = event.currentTarget;
|
|
42824
|
+
const exitPoint = { x: event.clientX, y: event.clientY };
|
|
42825
|
+
const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());
|
|
42826
|
+
const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide);
|
|
42827
|
+
const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());
|
|
42828
|
+
const graceArea = getHull([...paddedExitPoints, ...hoverTargetPoints]);
|
|
42829
|
+
setPointerGraceArea(graceArea);
|
|
42830
|
+
onPointerInTransitChange(true);
|
|
42831
|
+
},
|
|
42832
|
+
[onPointerInTransitChange]
|
|
42833
|
+
);
|
|
42834
|
+
React54__namespace.useEffect(() => {
|
|
42835
|
+
return () => handleRemoveGraceArea();
|
|
42836
|
+
}, [handleRemoveGraceArea]);
|
|
42837
|
+
React54__namespace.useEffect(() => {
|
|
42838
|
+
if (trigger && content) {
|
|
42839
|
+
const handleTriggerLeave = (event) => handleCreateGraceArea(event, content);
|
|
42840
|
+
const handleContentLeave = (event) => handleCreateGraceArea(event, trigger);
|
|
42841
|
+
trigger.addEventListener("pointerleave", handleTriggerLeave);
|
|
42842
|
+
content.addEventListener("pointerleave", handleContentLeave);
|
|
42843
|
+
return () => {
|
|
42844
|
+
trigger.removeEventListener("pointerleave", handleTriggerLeave);
|
|
42845
|
+
content.removeEventListener("pointerleave", handleContentLeave);
|
|
42846
|
+
};
|
|
42847
|
+
}
|
|
42848
|
+
}, [trigger, content, handleCreateGraceArea, handleRemoveGraceArea]);
|
|
42849
|
+
React54__namespace.useEffect(() => {
|
|
42850
|
+
if (pointerGraceArea) {
|
|
42851
|
+
const handleTrackPointerGrace = (event) => {
|
|
42852
|
+
const target = event.target;
|
|
42853
|
+
const pointerPosition = { x: event.clientX, y: event.clientY };
|
|
42854
|
+
const hasEnteredTarget = (trigger == null ? void 0 : trigger.contains(target)) || (content == null ? void 0 : content.contains(target));
|
|
42855
|
+
const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, pointerGraceArea);
|
|
42856
|
+
if (hasEnteredTarget) {
|
|
42857
|
+
handleRemoveGraceArea();
|
|
42858
|
+
} else if (isPointerOutsideGraceArea) {
|
|
42859
|
+
handleRemoveGraceArea();
|
|
42860
|
+
onClose();
|
|
42861
|
+
}
|
|
42862
|
+
};
|
|
42863
|
+
document.addEventListener("pointermove", handleTrackPointerGrace);
|
|
42864
|
+
return () => document.removeEventListener("pointermove", handleTrackPointerGrace);
|
|
42865
|
+
}
|
|
42866
|
+
}, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);
|
|
42867
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipContentImpl, { ...props, ref: composedRefs });
|
|
42868
|
+
});
|
|
42869
|
+
var [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });
|
|
42870
|
+
var Slottable = createSlottable("TooltipContent");
|
|
42871
|
+
var TooltipContentImpl = React54__namespace.forwardRef(
|
|
42872
|
+
(props, forwardedRef) => {
|
|
42873
|
+
const {
|
|
42874
|
+
__scopeTooltip,
|
|
42875
|
+
children,
|
|
42876
|
+
"aria-label": ariaLabel,
|
|
42877
|
+
onEscapeKeyDown,
|
|
42878
|
+
onPointerDownOutside,
|
|
42879
|
+
...contentProps
|
|
42880
|
+
} = props;
|
|
42881
|
+
const context = useTooltipContext(CONTENT_NAME5, __scopeTooltip);
|
|
42882
|
+
const popperScope = usePopperScope3(__scopeTooltip);
|
|
42883
|
+
const { onClose } = context;
|
|
42884
|
+
React54__namespace.useEffect(() => {
|
|
42885
|
+
document.addEventListener(TOOLTIP_OPEN, onClose);
|
|
42886
|
+
return () => document.removeEventListener(TOOLTIP_OPEN, onClose);
|
|
42887
|
+
}, [onClose]);
|
|
42888
|
+
React54__namespace.useEffect(() => {
|
|
42889
|
+
if (context.trigger) {
|
|
42890
|
+
const handleScroll2 = (event) => {
|
|
42891
|
+
const target = event.target;
|
|
42892
|
+
if (target == null ? void 0 : target.contains(context.trigger)) onClose();
|
|
42893
|
+
};
|
|
42894
|
+
window.addEventListener("scroll", handleScroll2, { capture: true });
|
|
42895
|
+
return () => window.removeEventListener("scroll", handleScroll2, { capture: true });
|
|
42896
|
+
}
|
|
42897
|
+
}, [context.trigger, onClose]);
|
|
42898
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42899
|
+
DismissableLayer,
|
|
42900
|
+
{
|
|
42901
|
+
asChild: true,
|
|
42902
|
+
disableOutsidePointerEvents: false,
|
|
42903
|
+
onEscapeKeyDown,
|
|
42904
|
+
onPointerDownOutside,
|
|
42905
|
+
onFocusOutside: (event) => event.preventDefault(),
|
|
42906
|
+
onDismiss: onClose,
|
|
42907
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
42908
|
+
Content,
|
|
42909
|
+
{
|
|
42910
|
+
"data-state": context.stateAttribute,
|
|
42911
|
+
...popperScope,
|
|
42912
|
+
...contentProps,
|
|
42913
|
+
ref: forwardedRef,
|
|
42914
|
+
style: {
|
|
42915
|
+
...contentProps.style,
|
|
42916
|
+
// re-namespace exposed content custom properties
|
|
42917
|
+
...{
|
|
42918
|
+
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
42919
|
+
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
|
42920
|
+
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
|
42921
|
+
"--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
|
|
42922
|
+
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
42923
|
+
}
|
|
42924
|
+
},
|
|
42925
|
+
children: [
|
|
42926
|
+
/* @__PURE__ */ jsxRuntime.jsx(Slottable, { children }),
|
|
42927
|
+
/* @__PURE__ */ jsxRuntime.jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsxRuntime.jsx(Root3, { id: context.contentId, role: "tooltip", children: ariaLabel || children }) })
|
|
42928
|
+
]
|
|
42929
|
+
}
|
|
42930
|
+
)
|
|
42931
|
+
}
|
|
42932
|
+
);
|
|
42933
|
+
}
|
|
42934
|
+
);
|
|
42935
|
+
TooltipContent.displayName = CONTENT_NAME5;
|
|
42936
|
+
var ARROW_NAME4 = "TooltipArrow";
|
|
42937
|
+
var TooltipArrow = React54__namespace.forwardRef(
|
|
42938
|
+
(props, forwardedRef) => {
|
|
42939
|
+
const { __scopeTooltip, ...arrowProps } = props;
|
|
42940
|
+
const popperScope = usePopperScope3(__scopeTooltip);
|
|
42941
|
+
const visuallyHiddenContentContext = useVisuallyHiddenContentContext(
|
|
42942
|
+
ARROW_NAME4,
|
|
42943
|
+
__scopeTooltip
|
|
42944
|
+
);
|
|
42945
|
+
return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ jsxRuntime.jsx(Arrow2, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
42946
|
+
}
|
|
42947
|
+
);
|
|
42948
|
+
TooltipArrow.displayName = ARROW_NAME4;
|
|
42949
|
+
function getExitSideFromRect(point, rect) {
|
|
42950
|
+
const top = Math.abs(rect.top - point.y);
|
|
42951
|
+
const bottom = Math.abs(rect.bottom - point.y);
|
|
42952
|
+
const right = Math.abs(rect.right - point.x);
|
|
42953
|
+
const left = Math.abs(rect.left - point.x);
|
|
42954
|
+
switch (Math.min(top, bottom, right, left)) {
|
|
42955
|
+
case left:
|
|
42956
|
+
return "left";
|
|
42957
|
+
case right:
|
|
42958
|
+
return "right";
|
|
42959
|
+
case top:
|
|
42960
|
+
return "top";
|
|
42961
|
+
case bottom:
|
|
42962
|
+
return "bottom";
|
|
42963
|
+
default:
|
|
42964
|
+
throw new Error("unreachable");
|
|
42965
|
+
}
|
|
42966
|
+
}
|
|
42967
|
+
function getPaddedExitPoints(exitPoint, exitSide, padding = 5) {
|
|
42968
|
+
const paddedExitPoints = [];
|
|
42969
|
+
switch (exitSide) {
|
|
42970
|
+
case "top":
|
|
42971
|
+
paddedExitPoints.push(
|
|
42972
|
+
{ x: exitPoint.x - padding, y: exitPoint.y + padding },
|
|
42973
|
+
{ x: exitPoint.x + padding, y: exitPoint.y + padding }
|
|
42974
|
+
);
|
|
42975
|
+
break;
|
|
42976
|
+
case "bottom":
|
|
42977
|
+
paddedExitPoints.push(
|
|
42978
|
+
{ x: exitPoint.x - padding, y: exitPoint.y - padding },
|
|
42979
|
+
{ x: exitPoint.x + padding, y: exitPoint.y - padding }
|
|
42980
|
+
);
|
|
42981
|
+
break;
|
|
42982
|
+
case "left":
|
|
42983
|
+
paddedExitPoints.push(
|
|
42984
|
+
{ x: exitPoint.x + padding, y: exitPoint.y - padding },
|
|
42985
|
+
{ x: exitPoint.x + padding, y: exitPoint.y + padding }
|
|
42986
|
+
);
|
|
42987
|
+
break;
|
|
42988
|
+
case "right":
|
|
42989
|
+
paddedExitPoints.push(
|
|
42990
|
+
{ x: exitPoint.x - padding, y: exitPoint.y - padding },
|
|
42991
|
+
{ x: exitPoint.x - padding, y: exitPoint.y + padding }
|
|
42992
|
+
);
|
|
42993
|
+
break;
|
|
42994
|
+
}
|
|
42995
|
+
return paddedExitPoints;
|
|
42996
|
+
}
|
|
42997
|
+
function getPointsFromRect(rect) {
|
|
42998
|
+
const { top, right, bottom, left } = rect;
|
|
42999
|
+
return [
|
|
43000
|
+
{ x: left, y: top },
|
|
43001
|
+
{ x: right, y: top },
|
|
43002
|
+
{ x: right, y: bottom },
|
|
43003
|
+
{ x: left, y: bottom }
|
|
43004
|
+
];
|
|
43005
|
+
}
|
|
43006
|
+
function isPointInPolygon(point, polygon) {
|
|
43007
|
+
const { x, y } = point;
|
|
43008
|
+
let inside = false;
|
|
43009
|
+
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
43010
|
+
const ii = polygon[i];
|
|
43011
|
+
const jj = polygon[j];
|
|
43012
|
+
const xi = ii.x;
|
|
43013
|
+
const yi = ii.y;
|
|
43014
|
+
const xj = jj.x;
|
|
43015
|
+
const yj = jj.y;
|
|
43016
|
+
const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
|
|
43017
|
+
if (intersect) inside = !inside;
|
|
43018
|
+
}
|
|
43019
|
+
return inside;
|
|
43020
|
+
}
|
|
43021
|
+
function getHull(points) {
|
|
43022
|
+
const newPoints = points.slice();
|
|
43023
|
+
newPoints.sort((a, b) => {
|
|
43024
|
+
if (a.x < b.x) return -1;
|
|
43025
|
+
else if (a.x > b.x) return 1;
|
|
43026
|
+
else if (a.y < b.y) return -1;
|
|
43027
|
+
else if (a.y > b.y) return 1;
|
|
43028
|
+
else return 0;
|
|
43029
|
+
});
|
|
43030
|
+
return getHullPresorted(newPoints);
|
|
43031
|
+
}
|
|
43032
|
+
function getHullPresorted(points) {
|
|
43033
|
+
if (points.length <= 1) return points.slice();
|
|
43034
|
+
const upperHull = [];
|
|
43035
|
+
for (let i = 0; i < points.length; i++) {
|
|
43036
|
+
const p = points[i];
|
|
43037
|
+
while (upperHull.length >= 2) {
|
|
43038
|
+
const q = upperHull[upperHull.length - 1];
|
|
43039
|
+
const r2 = upperHull[upperHull.length - 2];
|
|
43040
|
+
if ((q.x - r2.x) * (p.y - r2.y) >= (q.y - r2.y) * (p.x - r2.x)) upperHull.pop();
|
|
43041
|
+
else break;
|
|
43042
|
+
}
|
|
43043
|
+
upperHull.push(p);
|
|
43044
|
+
}
|
|
43045
|
+
upperHull.pop();
|
|
43046
|
+
const lowerHull = [];
|
|
43047
|
+
for (let i = points.length - 1; i >= 0; i--) {
|
|
43048
|
+
const p = points[i];
|
|
43049
|
+
while (lowerHull.length >= 2) {
|
|
43050
|
+
const q = lowerHull[lowerHull.length - 1];
|
|
43051
|
+
const r2 = lowerHull[lowerHull.length - 2];
|
|
43052
|
+
if ((q.x - r2.x) * (p.y - r2.y) >= (q.y - r2.y) * (p.x - r2.x)) lowerHull.pop();
|
|
43053
|
+
else break;
|
|
43054
|
+
}
|
|
43055
|
+
lowerHull.push(p);
|
|
43056
|
+
}
|
|
43057
|
+
lowerHull.pop();
|
|
43058
|
+
if (upperHull.length === 1 && lowerHull.length === 1 && upperHull[0].x === lowerHull[0].x && upperHull[0].y === lowerHull[0].y) {
|
|
43059
|
+
return upperHull;
|
|
43060
|
+
} else {
|
|
43061
|
+
return upperHull.concat(lowerHull);
|
|
43062
|
+
}
|
|
43063
|
+
}
|
|
43064
|
+
var Provider = TooltipProvider;
|
|
43065
|
+
var Root32 = Tooltip;
|
|
43066
|
+
var Trigger4 = TooltipTrigger;
|
|
43067
|
+
var Portal5 = TooltipPortal;
|
|
43068
|
+
var Content23 = TooltipContent;
|
|
43069
|
+
var Arrow22 = TooltipArrow;
|
|
43070
|
+
function TooltipProvider2({
|
|
43071
|
+
delayDuration = 0,
|
|
43072
|
+
...props
|
|
43073
|
+
}) {
|
|
43074
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
43075
|
+
Provider,
|
|
43076
|
+
{
|
|
43077
|
+
"data-slot": "tooltip-provider",
|
|
43078
|
+
delayDuration,
|
|
43079
|
+
...props
|
|
43080
|
+
}
|
|
43081
|
+
);
|
|
43082
|
+
}
|
|
43083
|
+
function Tooltip2({
|
|
43084
|
+
...props
|
|
43085
|
+
}) {
|
|
43086
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider2, { children: /* @__PURE__ */ jsxRuntime.jsx(Root32, { "data-slot": "tooltip", ...props }) });
|
|
43087
|
+
}
|
|
43088
|
+
function TooltipTrigger2({
|
|
43089
|
+
...props
|
|
43090
|
+
}) {
|
|
43091
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Trigger4, { "data-slot": "tooltip-trigger", ...props });
|
|
43092
|
+
}
|
|
43093
|
+
function TooltipContent2({
|
|
43094
|
+
className,
|
|
43095
|
+
sideOffset = 0,
|
|
43096
|
+
children,
|
|
43097
|
+
...props
|
|
43098
|
+
}) {
|
|
43099
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Portal5, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
43100
|
+
Content23,
|
|
43101
|
+
{
|
|
43102
|
+
"data-slot": "tooltip-content",
|
|
43103
|
+
sideOffset,
|
|
43104
|
+
className: cn(
|
|
43105
|
+
"bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
|
|
43106
|
+
className
|
|
43107
|
+
),
|
|
43108
|
+
...props,
|
|
43109
|
+
children: [
|
|
43110
|
+
children,
|
|
43111
|
+
/* @__PURE__ */ jsxRuntime.jsx(Arrow22, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
43112
|
+
]
|
|
43113
|
+
}
|
|
43114
|
+
) });
|
|
43115
|
+
}
|
|
43116
|
+
function mapSizeToToggleSize(size4) {
|
|
43117
|
+
switch (size4) {
|
|
43118
|
+
case "sm":
|
|
43119
|
+
return "sm";
|
|
43120
|
+
case "lg":
|
|
43121
|
+
return "lg";
|
|
43122
|
+
case "md":
|
|
43123
|
+
default:
|
|
43124
|
+
return "default";
|
|
43125
|
+
}
|
|
43126
|
+
}
|
|
43127
|
+
function normalizeValue(val, multiple) {
|
|
43128
|
+
if (multiple) {
|
|
43129
|
+
if (Array.isArray(val)) return val;
|
|
43130
|
+
if (typeof val === "string") return [val];
|
|
43131
|
+
return [];
|
|
43132
|
+
}
|
|
43133
|
+
if (Array.isArray(val)) return val[0] || "";
|
|
43134
|
+
return val || "";
|
|
43135
|
+
}
|
|
43136
|
+
function capitalizeFirst6(label) {
|
|
43137
|
+
if (!label) return label;
|
|
43138
|
+
return label.charAt(0).toUpperCase() + label.slice(1);
|
|
43139
|
+
}
|
|
43140
|
+
function normalizeOption(input, {
|
|
43141
|
+
optionValue,
|
|
43142
|
+
optionLabel,
|
|
43143
|
+
optionIcon,
|
|
43144
|
+
optionDisabled,
|
|
43145
|
+
optionTooltip,
|
|
43146
|
+
optionMeta
|
|
43147
|
+
}, autoCap) {
|
|
43148
|
+
var _a, _b, _c, _d, _e, _f;
|
|
43149
|
+
const anyInput = input;
|
|
43150
|
+
if (optionValue || optionLabel || optionIcon || optionDisabled || optionTooltip || optionMeta) {
|
|
43151
|
+
const rawValue = optionValue != null ? anyInput[optionValue] : (_a = anyInput.value) != null ? _a : input;
|
|
43152
|
+
const value2 = String(rawValue);
|
|
43153
|
+
let label2;
|
|
43154
|
+
if (optionLabel != null) {
|
|
43155
|
+
label2 = anyInput[optionLabel];
|
|
43156
|
+
} else if (anyInput.label != null) {
|
|
43157
|
+
label2 = anyInput.label;
|
|
43158
|
+
} else {
|
|
43159
|
+
label2 = String(rawValue != null ? rawValue : value2);
|
|
43160
|
+
}
|
|
43161
|
+
if (autoCap && typeof label2 === "string") {
|
|
43162
|
+
label2 = capitalizeFirst6(label2);
|
|
43163
|
+
}
|
|
43164
|
+
const icon = optionIcon != null ? anyInput[optionIcon] : (_b = anyInput.icon) != null ? _b : void 0;
|
|
43165
|
+
const disabled = optionDisabled != null ? !!anyInput[optionDisabled] : !!anyInput.disabled;
|
|
43166
|
+
const tooltip = optionTooltip != null ? anyInput[optionTooltip] : (_c = anyInput.tooltip) != null ? _c : void 0;
|
|
43167
|
+
const meta = optionMeta != null ? anyInput[optionMeta] : (_d = anyInput.meta) != null ? _d : void 0;
|
|
43168
|
+
return {
|
|
43169
|
+
ui: {
|
|
43170
|
+
value: value2,
|
|
43171
|
+
label: label2,
|
|
43172
|
+
icon,
|
|
43173
|
+
disabled,
|
|
43174
|
+
tooltip,
|
|
43175
|
+
meta
|
|
43176
|
+
},
|
|
43177
|
+
raw: input
|
|
43178
|
+
};
|
|
43179
|
+
}
|
|
43180
|
+
if (typeof input === "string" || typeof input === "number" || typeof input === "boolean") {
|
|
43181
|
+
const value2 = String(input);
|
|
43182
|
+
let label2 = value2;
|
|
43183
|
+
if (autoCap && typeof label2 === "string") {
|
|
43184
|
+
label2 = capitalizeFirst6(label2);
|
|
43185
|
+
}
|
|
43186
|
+
return {
|
|
43187
|
+
ui: {
|
|
43188
|
+
value: value2,
|
|
43189
|
+
label: label2
|
|
43190
|
+
},
|
|
43191
|
+
raw: input
|
|
43192
|
+
};
|
|
43193
|
+
}
|
|
43194
|
+
const baseValue = (_f = anyInput.value) != null ? _f : String((_e = anyInput.label) != null ? _e : "");
|
|
43195
|
+
const value = String(baseValue);
|
|
43196
|
+
let label = anyInput.label != null ? anyInput.label : String(value);
|
|
43197
|
+
if (autoCap && typeof label === "string") {
|
|
43198
|
+
label = capitalizeFirst6(label);
|
|
43199
|
+
}
|
|
43200
|
+
return {
|
|
43201
|
+
ui: {
|
|
43202
|
+
value,
|
|
43203
|
+
label,
|
|
43204
|
+
icon: anyInput.icon,
|
|
43205
|
+
disabled: !!anyInput.disabled,
|
|
43206
|
+
tooltip: anyInput.tooltip,
|
|
43207
|
+
meta: anyInput.meta
|
|
43208
|
+
},
|
|
43209
|
+
raw: input
|
|
43210
|
+
};
|
|
43211
|
+
}
|
|
43212
|
+
var ShadcnToggleVariant3 = React54__namespace.forwardRef(function ShadcnToggleVariant4(props, ref) {
|
|
43213
|
+
const {
|
|
43214
|
+
value,
|
|
43215
|
+
onValue,
|
|
43216
|
+
disabled,
|
|
43217
|
+
readOnly,
|
|
43218
|
+
error,
|
|
43219
|
+
size: size4 = "md",
|
|
43220
|
+
options = [],
|
|
43221
|
+
multiple = false,
|
|
43222
|
+
variant = "default",
|
|
43223
|
+
layout = "horizontal",
|
|
43224
|
+
gridCols = 2,
|
|
43225
|
+
fillWidth: fullWidth = false,
|
|
43226
|
+
optionValue,
|
|
43227
|
+
optionLabel,
|
|
43228
|
+
optionIcon,
|
|
43229
|
+
optionDisabled,
|
|
43230
|
+
optionTooltip,
|
|
43231
|
+
optionMeta,
|
|
43232
|
+
renderOption,
|
|
43233
|
+
className,
|
|
43234
|
+
itemClassName,
|
|
43235
|
+
activeClassName,
|
|
43236
|
+
autoCap = false,
|
|
43237
|
+
gap: itemGapPx
|
|
43238
|
+
} = props;
|
|
43239
|
+
const isDisabled = !!disabled || !!readOnly;
|
|
43240
|
+
const toggleSize = mapSizeToToggleSize(size4);
|
|
43241
|
+
const currentValue = normalizeValue(value, multiple);
|
|
43242
|
+
const normalizedOptions = React54__namespace.useMemo(
|
|
43243
|
+
() => options.map(
|
|
43244
|
+
(opt) => normalizeOption(
|
|
43245
|
+
opt,
|
|
43246
|
+
{
|
|
43247
|
+
optionValue,
|
|
43248
|
+
optionLabel,
|
|
43249
|
+
optionIcon,
|
|
43250
|
+
optionDisabled,
|
|
43251
|
+
optionTooltip,
|
|
43252
|
+
optionMeta
|
|
43253
|
+
},
|
|
43254
|
+
autoCap
|
|
43255
|
+
)
|
|
43256
|
+
),
|
|
43257
|
+
[
|
|
43258
|
+
options,
|
|
43259
|
+
optionValue,
|
|
43260
|
+
optionLabel,
|
|
43261
|
+
optionIcon,
|
|
43262
|
+
optionDisabled,
|
|
43263
|
+
optionTooltip,
|
|
43264
|
+
optionMeta,
|
|
43265
|
+
autoCap
|
|
43266
|
+
]
|
|
43267
|
+
);
|
|
43268
|
+
const handleChange = React54__namespace.useCallback(
|
|
43269
|
+
(val) => {
|
|
43270
|
+
if (readOnly) return;
|
|
43271
|
+
if (!onValue) return;
|
|
43272
|
+
let rawSelection;
|
|
43273
|
+
if (Array.isArray(val)) {
|
|
43274
|
+
const selected = normalizedOptions.filter(
|
|
43275
|
+
(entry) => val.includes(entry.ui.value)
|
|
43276
|
+
);
|
|
43277
|
+
rawSelection = selected.map((entry) => entry.raw);
|
|
43278
|
+
} else {
|
|
43279
|
+
const found = normalizedOptions.find(
|
|
43280
|
+
(entry) => entry.ui.value === val
|
|
43281
|
+
);
|
|
43282
|
+
rawSelection = found == null ? void 0 : found.raw;
|
|
43283
|
+
}
|
|
43284
|
+
const detail = {
|
|
43285
|
+
source: "variant",
|
|
43286
|
+
raw: rawSelection,
|
|
43287
|
+
// original item(s)
|
|
43288
|
+
nativeEvent: void 0,
|
|
43289
|
+
meta: { action: "toggle" }
|
|
43290
|
+
};
|
|
43291
|
+
onValue(val, detail);
|
|
43292
|
+
},
|
|
43293
|
+
[onValue, readOnly, normalizedOptions]
|
|
43294
|
+
);
|
|
43295
|
+
const layoutClasses = cn(
|
|
43296
|
+
layout === "horizontal" && "flex flex-wrap",
|
|
43297
|
+
layout === "vertical" && "flex flex-col items-stretch",
|
|
43298
|
+
layout === "grid" && "grid",
|
|
43299
|
+
fullWidth && "w-full",
|
|
43300
|
+
fullWidth && layout === "horizontal" && "[&>*]:flex-1",
|
|
43301
|
+
fullWidth && layout === "vertical" && "[&>*]:w-full",
|
|
43302
|
+
className
|
|
43303
|
+
);
|
|
43304
|
+
console.log(layoutClasses, fullWidth, autoCap);
|
|
43305
|
+
const groupStyle = React54__namespace.useMemo(() => {
|
|
43306
|
+
const style = {};
|
|
43307
|
+
if (layout === "grid") {
|
|
43308
|
+
style.gridTemplateColumns = `repeat(${gridCols}, minmax(0, 1fr))`;
|
|
43309
|
+
}
|
|
43310
|
+
if (typeof itemGapPx === "number") {
|
|
43311
|
+
style.gap = itemGapPx;
|
|
43312
|
+
}
|
|
43313
|
+
return Object.keys(style).length ? style : void 0;
|
|
43314
|
+
}, [layout, gridCols, itemGapPx]);
|
|
43315
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
43316
|
+
ToggleGroup2,
|
|
43317
|
+
{
|
|
43318
|
+
ref,
|
|
43319
|
+
type: multiple ? "multiple" : "single",
|
|
43320
|
+
value: currentValue,
|
|
43321
|
+
onValueChange: handleChange,
|
|
43322
|
+
disabled: isDisabled,
|
|
43323
|
+
variant,
|
|
43324
|
+
size: toggleSize,
|
|
43325
|
+
className: layoutClasses,
|
|
43326
|
+
style: groupStyle,
|
|
43327
|
+
"aria-invalid": !!error,
|
|
43328
|
+
children: normalizedOptions.map(({ ui: opt }) => {
|
|
43329
|
+
const isSelected = multiple ? currentValue.includes(opt.value) : currentValue === opt.value;
|
|
43330
|
+
const contentNode = renderOption ? renderOption(opt, isSelected) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 truncate", children: [
|
|
43331
|
+
opt.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0", children: opt.icon }),
|
|
43332
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: opt.label })
|
|
43333
|
+
] });
|
|
43334
|
+
const itemNode = /* @__PURE__ */ jsxRuntime.jsx(
|
|
43335
|
+
ToggleGroupItem2,
|
|
43336
|
+
{
|
|
43337
|
+
value: opt.value,
|
|
43338
|
+
disabled: opt.disabled,
|
|
43339
|
+
"aria-label": typeof opt.label === "string" ? opt.label : opt.value,
|
|
43340
|
+
className: cn(
|
|
43341
|
+
// Base Transitions
|
|
43342
|
+
"transition-all",
|
|
43343
|
+
// Default Active State (Shadcn defaults)
|
|
43344
|
+
"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",
|
|
43345
|
+
// Error State
|
|
43346
|
+
error && "border-destructive/50 hover:bg-destructive/10 data-[state=on]:bg-destructive data-[state=on]:text-destructive-foreground",
|
|
43347
|
+
// Variant: Outline specific tweaks
|
|
43348
|
+
variant === "outline" && layout === "horizontal" && !fullWidth && "first:rounded-l-md last:rounded-r-md rounded-none border-l-0 first:border-l",
|
|
43349
|
+
// Layout tweaks
|
|
43350
|
+
fullWidth && "justify-center",
|
|
43351
|
+
// Custom Item Class
|
|
43352
|
+
itemClassName,
|
|
43353
|
+
// Active Class Name (Applied only when selected)
|
|
43354
|
+
isSelected && activeClassName
|
|
43355
|
+
),
|
|
43356
|
+
children: contentNode
|
|
43357
|
+
},
|
|
43358
|
+
opt.value
|
|
43359
|
+
);
|
|
43360
|
+
if (opt.tooltip && !isDisabled) {
|
|
43361
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider2, { delayDuration: 300, children: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip2, { children: [
|
|
43362
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger2, { asChild: true, children: itemNode }),
|
|
43363
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent2, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: opt.tooltip }) })
|
|
43364
|
+
] }) }, opt.value);
|
|
43365
|
+
}
|
|
43366
|
+
return itemNode;
|
|
43367
|
+
})
|
|
43368
|
+
}
|
|
43369
|
+
);
|
|
43370
|
+
});
|
|
43371
|
+
ShadcnToggleVariant3.displayName = "ShadcnToggleVariant";
|
|
43372
|
+
|
|
43373
|
+
// src/variants/core/toggle-group.tsx
|
|
43374
|
+
var toggleGroupModule = {
|
|
43375
|
+
variant: "toggle-group",
|
|
43376
|
+
Variant: ShadcnToggleVariant3,
|
|
43377
|
+
meta: {
|
|
43378
|
+
label: "Toggle group",
|
|
43379
|
+
description: "Toggle group component buttons.",
|
|
43380
|
+
tags: ["buttons", "toggle"]
|
|
43381
|
+
}
|
|
43382
|
+
};
|
|
41933
43383
|
|
|
41934
43384
|
// src/variants/index.ts
|
|
41935
43385
|
var variants = [
|
|
@@ -41950,13 +43400,14 @@ var variants = [
|
|
|
41950
43400
|
keyValueModule,
|
|
41951
43401
|
custom_default,
|
|
41952
43402
|
treeselect_default2,
|
|
41953
|
-
fileManagerModule
|
|
43403
|
+
fileManagerModule,
|
|
43404
|
+
toggleGroupModule
|
|
41954
43405
|
];
|
|
41955
43406
|
function registerCoreVariants() {
|
|
41956
43407
|
variants.forEach((item) => registerVariant(item));
|
|
41957
43408
|
}
|
|
41958
43409
|
registerCoreVariants();
|
|
41959
|
-
var
|
|
43410
|
+
var NODES19 = [
|
|
41960
43411
|
"a",
|
|
41961
43412
|
"button",
|
|
41962
43413
|
"div",
|
|
@@ -41975,7 +43426,7 @@ var NODES16 = [
|
|
|
41975
43426
|
"svg",
|
|
41976
43427
|
"ul"
|
|
41977
43428
|
];
|
|
41978
|
-
var
|
|
43429
|
+
var Primitive19 = NODES19.reduce((primitive, node) => {
|
|
41979
43430
|
const Slot5 = createSlot10(`Primitive.${node}`);
|
|
41980
43431
|
const Node2 = React54__namespace.forwardRef((props, forwardedRef) => {
|
|
41981
43432
|
const { asChild, ...primitiveProps } = props;
|
|
@@ -41988,10 +43439,10 @@ var Primitive16 = NODES16.reduce((primitive, node) => {
|
|
|
41988
43439
|
Node2.displayName = `Primitive.${node}`;
|
|
41989
43440
|
return { ...primitive, [node]: Node2 };
|
|
41990
43441
|
}, {});
|
|
41991
|
-
var
|
|
43442
|
+
var NAME4 = "Label";
|
|
41992
43443
|
var Label2 = React54__namespace.forwardRef((props, forwardedRef) => {
|
|
41993
43444
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
41994
|
-
|
|
43445
|
+
Primitive19.label,
|
|
41995
43446
|
{
|
|
41996
43447
|
...props,
|
|
41997
43448
|
ref: forwardedRef,
|
|
@@ -42005,14 +43456,14 @@ var Label2 = React54__namespace.forwardRef((props, forwardedRef) => {
|
|
|
42005
43456
|
}
|
|
42006
43457
|
);
|
|
42007
43458
|
});
|
|
42008
|
-
Label2.displayName =
|
|
42009
|
-
var
|
|
43459
|
+
Label2.displayName = NAME4;
|
|
43460
|
+
var Root10 = Label2;
|
|
42010
43461
|
function Label3({
|
|
42011
43462
|
className,
|
|
42012
43463
|
...props
|
|
42013
43464
|
}) {
|
|
42014
43465
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42015
|
-
|
|
43466
|
+
Root10,
|
|
42016
43467
|
{
|
|
42017
43468
|
"data-slot": "label",
|
|
42018
43469
|
className: cn(
|
|
@@ -42752,7 +44203,7 @@ function InputField(props) {
|
|
|
42752
44203
|
].filter(Boolean).join(" ");
|
|
42753
44204
|
const hasStackedLabelBlock = lp !== "hidden" && hasAnyLabelBlockContent;
|
|
42754
44205
|
const stackedGroupClassName = [
|
|
42755
|
-
hasStackedLabelBlock && hasLabelRowContent ? "mt-
|
|
44206
|
+
hasStackedLabelBlock && hasLabelRowContent ? "mt-0.5" : null,
|
|
42756
44207
|
classes == null ? void 0 : classes.group
|
|
42757
44208
|
].filter(Boolean).join(" ");
|
|
42758
44209
|
const Element2 = contain ? "div" : React54__namespace.Fragment;
|