@hot-updater/console 0.32.0 → 0.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +3 -3
- package/.output/public/assets/dist-DJX53faP.js +3 -0
- package/.output/public/assets/index-CCUspZZV.js +10 -0
- package/.output/public/assets/routes-D0t6y5Fr.js +54 -0
- package/.output/public/assets/styles-C0q26dS-.css +2 -0
- package/.output/server/{__tanstack-start-server-fn-resolver-ySzPUDlM.mjs → __23tanstack-start-server-fn-resolver-B12pVvhf.mjs} +32 -39
- package/.output/server/_chunks/ssr-renderer.mjs +14 -3
- package/.output/server/_libs/@floating-ui/react-dom+[...].mjs +7 -7
- package/.output/server/_libs/@radix-ui/react-alert-dialog+[...].mjs +142 -93
- package/.output/server/_libs/@radix-ui/react-popper+[...].mjs +32 -11
- package/.output/server/_libs/@radix-ui/react-select+[...].mjs +130 -95
- package/.output/server/_libs/@tanstack/form-core+[...].mjs +1138 -306
- package/.output/server/_libs/@tanstack/react-form+[...].mjs +156 -24
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +2658 -1395
- package/.output/server/_libs/@tanstack/react-table+[...].mjs +1 -1
- package/.output/server/_libs/dayjs.mjs +6 -6
- package/.output/server/_libs/h3+rou3+srvx.mjs +30 -42
- package/.output/server/_libs/lucide-react.mjs +54 -9
- package/.output/server/_libs/next-themes.mjs +1 -1
- package/.output/server/_libs/radix-ui__number.mjs +1 -1
- package/.output/server/_libs/radix-ui__react-arrow.mjs +2 -2
- package/.output/server/_libs/radix-ui__react-collection.mjs +2 -2
- package/.output/server/_libs/radix-ui__react-direction.mjs +2 -2
- package/.output/server/_libs/radix-ui__react-label.mjs +2 -2
- package/.output/server/_libs/radix-ui__react-separator.mjs +2 -2
- package/.output/server/_libs/radix-ui__react-slider.mjs +103 -44
- package/.output/server/_libs/radix-ui__react-switch.mjs +88 -49
- package/.output/server/_libs/radix-ui__react-tooltip.mjs +6 -4
- package/.output/server/_libs/semver.mjs +97 -52
- package/.output/server/_libs/sonner.mjs +1 -1
- package/.output/server/_libs/tailwind-merge.mjs +51 -3
- package/.output/server/_libs/tanstack__history.mjs +28 -8
- package/.output/server/_libs/tanstack__query-core.mjs +200 -174
- package/.output/server/_libs/tanstack__react-query.mjs +14 -13
- package/.output/server/_ssr/{api-rpc-Bwustks9.mjs → api-rpc-ORImfBFu.mjs} +18 -18
- package/.output/server/_ssr/{config.server-xu3W-WAK.mjs → config.server-BSS366KT.mjs} +2 -2
- package/.output/server/_ssr/{createServerFn-CdeRXnVy.mjs → createServerFn-DzU0k62V.mjs} +129 -90
- package/.output/server/_ssr/{deleteBundle-CXxwjwEZ.mjs → deleteBundle-CuujBAH8.mjs} +2 -2
- package/.output/server/_ssr/{dist-CRiLZLfa.mjs → dist-KboydRVk.mjs} +1 -1
- package/.output/server/_ssr/empty-plugin-adapters-B4HCzgmM.mjs +5 -0
- package/.output/server/_ssr/{getBundleChildren-DFqZ6XMp.mjs → getBundleChildren-CVtSiH5t.mjs} +2 -2
- package/.output/server/_ssr/{router-DoC6G-mF.mjs → router-DmdnzGpe.mjs} +12 -10
- package/.output/server/_ssr/{routes-BHVpk6zR.mjs → routes-Be7gDfJS.mjs} +577 -305
- package/.output/server/_ssr/{sidebar-CgbtXkE2.mjs → sidebar-Cv_H0_Jv.mjs} +6 -6
- package/.output/server/_ssr/ssr.mjs +4222 -3153
- package/.output/server/_ssr/start-D4SBEASt.mjs +4 -0
- package/.output/server/_ssr/{storageProfile-wICk5nZZ.mjs → storageProfile-FVkjPoGb.mjs} +1 -1
- package/.output/server/_tanstack-start-manifest_v-BroBMdSR.mjs +20 -0
- package/.output/server/index.mjs +111 -155
- package/package.json +12 -9
- package/.output/public/assets/BaseTanStackRouterDevtoolsPanel-Bmws3ikM-q5p5qKUx.js +0 -486
- package/.output/public/assets/FloatingTanStackRouterDevtools-B7vy70jP-Bzs2Gthe.js +0 -1
- package/.output/public/assets/clsx-CbprLf2V.js +0 -1
- package/.output/public/assets/dist-B5egZOkC.js +0 -9
- package/.output/public/assets/main-DrVuFR7r.js +0 -10
- package/.output/public/assets/preload-helper-C5ST2IKa.js +0 -1
- package/.output/public/assets/routes-C_bgs7kg.js +0 -54
- package/.output/public/assets/styles-DZ0tCVA1.css +0 -2
- package/.output/server/_libs/hookable.mjs +0 -41
- package/.output/server/_libs/tanstack__router-core.mjs +0 -6
- package/.output/server/_libs/unctx.mjs +0 -82
- package/.output/server/_ssr/start-D0X4LIsd.mjs +0 -4
- package/.output/server/_tanstack-start-manifest_v-D2MqgD3d.mjs +0 -22
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { r as __toESM } from "../_runtime.mjs";
|
|
2
|
-
import { E as useControllableState, N as useComposedRefs, O as createContextScope, P as require_jsx_runtime, k as Primitive } from "./@radix-ui/react-alert-dialog+[...].mjs";
|
|
3
2
|
import { u as require_react } from "./@floating-ui/react-dom+[...].mjs";
|
|
3
|
+
import { E as useControllableState, N as useComposedRefs, O as createContextScope, P as require_jsx_runtime, k as Primitive } from "./@radix-ui/react-alert-dialog+[...].mjs";
|
|
4
4
|
import { p as usePrevious } from "./@radix-ui/react-select+[...].mjs";
|
|
5
5
|
import { t as createCollection } from "./radix-ui__react-collection.mjs";
|
|
6
6
|
import { t as composeEventHandlers } from "./radix-ui__primitive.mjs";
|
|
7
7
|
import { t as useDirection } from "./radix-ui__react-direction.mjs";
|
|
8
8
|
import { o as useSize } from "./@radix-ui/react-popper+[...].mjs";
|
|
9
9
|
import { t as clamp } from "./radix-ui__number.mjs";
|
|
10
|
-
//#region ../../node_modules/.pnpm/@radix-ui+react-slider@1.
|
|
10
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-slider@1.4.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+react_c4720e06d3edc591b175d090ab6efa41/node_modules/@radix-ui/react-slider/dist/index.mjs
|
|
11
11
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
12
12
|
var import_jsx_runtime = require_jsx_runtime();
|
|
13
13
|
var PAGE_KEYS = ["PageUp", "PageDown"];
|
|
@@ -51,12 +51,17 @@ var Slider = import_react.forwardRef((props, forwardedRef) => {
|
|
|
51
51
|
const { name, min = 0, max = 100, step = 1, orientation = "horizontal", disabled = false, minStepsBetweenThumbs = 0, defaultValue = [min], value, onValueChange = () => {}, onValueCommit = () => {}, inverted = false, form, ...sliderProps } = props;
|
|
52
52
|
const thumbRefs = import_react.useRef(/* @__PURE__ */ new Set());
|
|
53
53
|
const valueIndexToChangeRef = import_react.useRef(0);
|
|
54
|
+
const isKeyboardInteractionRef = import_react.useRef(false);
|
|
54
55
|
const SliderOrientation = orientation === "horizontal" ? SliderHorizontal : SliderVertical;
|
|
55
56
|
const [values = [], setValues] = useControllableState({
|
|
56
57
|
prop: value,
|
|
57
58
|
defaultProp: defaultValue,
|
|
58
59
|
onChange: (value2) => {
|
|
59
|
-
[...thumbRefs.current][valueIndexToChangeRef.current]?.focus(
|
|
60
|
+
[...thumbRefs.current][valueIndexToChangeRef.current]?.focus({
|
|
61
|
+
preventScroll: true,
|
|
62
|
+
focusVisible: isKeyboardInteractionRef.current
|
|
63
|
+
});
|
|
64
|
+
isKeyboardInteractionRef.current = false;
|
|
60
65
|
onValueChange(value2);
|
|
61
66
|
}
|
|
62
67
|
});
|
|
@@ -105,7 +110,10 @@ var Slider = import_react.forwardRef((props, forwardedRef) => {
|
|
|
105
110
|
...sliderProps,
|
|
106
111
|
ref: forwardedRef,
|
|
107
112
|
onPointerDown: composeEventHandlers(sliderProps.onPointerDown, () => {
|
|
108
|
-
if (!disabled)
|
|
113
|
+
if (!disabled) {
|
|
114
|
+
valuesBeforeSlideStartRef.current = values;
|
|
115
|
+
isKeyboardInteractionRef.current = false;
|
|
116
|
+
}
|
|
109
117
|
}),
|
|
110
118
|
min,
|
|
111
119
|
max,
|
|
@@ -113,10 +121,21 @@ var Slider = import_react.forwardRef((props, forwardedRef) => {
|
|
|
113
121
|
onSlideStart: disabled ? void 0 : handleSlideStart,
|
|
114
122
|
onSlideMove: disabled ? void 0 : handleSlideMove,
|
|
115
123
|
onSlideEnd: disabled ? void 0 : handleSlideEnd,
|
|
116
|
-
onHomeKeyDown: () =>
|
|
117
|
-
|
|
124
|
+
onHomeKeyDown: () => {
|
|
125
|
+
if (!disabled) {
|
|
126
|
+
isKeyboardInteractionRef.current = true;
|
|
127
|
+
updateValues(min, 0, { commit: true });
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
onEndKeyDown: () => {
|
|
131
|
+
if (!disabled) {
|
|
132
|
+
isKeyboardInteractionRef.current = true;
|
|
133
|
+
updateValues(max, values.length - 1, { commit: true });
|
|
134
|
+
}
|
|
135
|
+
},
|
|
118
136
|
onStepKeyDown: ({ event, direction: stepDirection }) => {
|
|
119
137
|
if (!disabled) {
|
|
138
|
+
isKeyboardInteractionRef.current = true;
|
|
120
139
|
const multiplier = PAGE_KEYS.includes(event.key) || event.shiftKey && ARROW_KEYS.includes(event.key) ? 10 : 1;
|
|
121
140
|
const atIndex = valueIndexToChangeRef.current;
|
|
122
141
|
const value2 = values[atIndex];
|
|
@@ -162,7 +181,7 @@ var SliderHorizontal = import_react.forwardRef((props, forwardedRef) => {
|
|
|
162
181
|
ref: composedRefs,
|
|
163
182
|
style: {
|
|
164
183
|
...sliderProps.style,
|
|
165
|
-
|
|
184
|
+
"--radix-slider-thumb-transform": "translateX(-50%)"
|
|
166
185
|
},
|
|
167
186
|
onSlideStart: (event) => {
|
|
168
187
|
const value = getValueFromPointer(event.clientX);
|
|
@@ -210,7 +229,7 @@ var SliderVertical = import_react.forwardRef((props, forwardedRef) => {
|
|
|
210
229
|
ref,
|
|
211
230
|
style: {
|
|
212
231
|
...sliderProps.style,
|
|
213
|
-
|
|
232
|
+
"--radix-slider-thumb-transform": "translateY(50%)"
|
|
214
233
|
},
|
|
215
234
|
onSlideStart: (event) => {
|
|
216
235
|
const value = getValueFromPointer(event.clientY);
|
|
@@ -256,7 +275,10 @@ var SliderImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
|
256
275
|
const target = event.target;
|
|
257
276
|
target.setPointerCapture(event.pointerId);
|
|
258
277
|
event.preventDefault();
|
|
259
|
-
if (context.thumbs.has(target)) target.focus(
|
|
278
|
+
if (context.thumbs.has(target)) target.focus({
|
|
279
|
+
preventScroll: true,
|
|
280
|
+
focusVisible: false
|
|
281
|
+
});
|
|
260
282
|
else onSlideStart(event);
|
|
261
283
|
}),
|
|
262
284
|
onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {
|
|
@@ -307,30 +329,19 @@ var SliderRange = import_react.forwardRef((props, forwardedRef) => {
|
|
|
307
329
|
});
|
|
308
330
|
SliderRange.displayName = RANGE_NAME;
|
|
309
331
|
var THUMB_NAME = "SliderThumb";
|
|
310
|
-
var
|
|
311
|
-
|
|
332
|
+
var [SliderThumbContextProvider, useSliderThumbContext] = createSliderContext(THUMB_NAME);
|
|
333
|
+
var THUMB_PROVIDER_NAME = "SliderThumbProvider";
|
|
334
|
+
function SliderThumbProvider(props) {
|
|
335
|
+
const { __scopeSlider, name, children, internal_do_not_use_render } = props;
|
|
336
|
+
const context = useSliderContext(THUMB_PROVIDER_NAME, __scopeSlider);
|
|
337
|
+
const getItems = useCollection(__scopeSlider);
|
|
312
338
|
const [thumb, setThumb] = import_react.useState(null);
|
|
313
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => setThumb(node));
|
|
314
339
|
const index = import_react.useMemo(() => thumb ? getItems().findIndex((item) => item.ref.current === thumb) : -1, [getItems, thumb]);
|
|
315
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderThumbImpl, {
|
|
316
|
-
...props,
|
|
317
|
-
ref: composedRefs,
|
|
318
|
-
index
|
|
319
|
-
});
|
|
320
|
-
});
|
|
321
|
-
var SliderThumbImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
322
|
-
const { __scopeSlider, index, name, ...thumbProps } = props;
|
|
323
|
-
const context = useSliderContext(THUMB_NAME, __scopeSlider);
|
|
324
|
-
const orientation = useSliderOrientationContext(THUMB_NAME, __scopeSlider);
|
|
325
|
-
const [thumb, setThumb] = import_react.useState(null);
|
|
326
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => setThumb(node));
|
|
327
|
-
const isFormControl = thumb ? context.form || !!thumb.closest("form") : true;
|
|
328
340
|
const size = useSize(thumb);
|
|
341
|
+
const isFormControl = thumb ? !!context.form || !!thumb.closest("form") : true;
|
|
329
342
|
const value = context.values[index];
|
|
343
|
+
const resolvedName = name ?? (context.name ? context.name + (context.values.length > 1 ? "[]" : "") : void 0);
|
|
330
344
|
const percent = value === void 0 ? 0 : convertValueToPercentage(value, context.min, context.max);
|
|
331
|
-
const label = getLabel(index, context.values.length);
|
|
332
|
-
const orientationSize = size?.[orientation.size];
|
|
333
|
-
const thumbInBoundsOffset = orientationSize ? getThumbInBoundsOffset(orientationSize, percent, orientation.direction) : 0;
|
|
334
345
|
import_react.useEffect(() => {
|
|
335
346
|
if (thumb) {
|
|
336
347
|
context.thumbs.add(thumb);
|
|
@@ -339,14 +350,42 @@ var SliderThumbImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
|
339
350
|
};
|
|
340
351
|
}
|
|
341
352
|
}, [thumb, context.thumbs]);
|
|
342
|
-
|
|
353
|
+
const thumbContext = {
|
|
354
|
+
value,
|
|
355
|
+
name: resolvedName,
|
|
356
|
+
form: context.form,
|
|
357
|
+
isFormControl,
|
|
358
|
+
index,
|
|
359
|
+
thumb,
|
|
360
|
+
onThumbChange: setThumb,
|
|
361
|
+
percent,
|
|
362
|
+
size
|
|
363
|
+
};
|
|
364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderThumbContextProvider, {
|
|
365
|
+
scope: __scopeSlider,
|
|
366
|
+
...thumbContext,
|
|
367
|
+
children: isFunction(internal_do_not_use_render) ? internal_do_not_use_render(thumbContext) : children
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
SliderThumbProvider.displayName = THUMB_PROVIDER_NAME;
|
|
371
|
+
var THUMB_TRIGGER_NAME = "SliderThumbTrigger";
|
|
372
|
+
var SliderThumbTrigger = import_react.forwardRef((props, forwardedRef) => {
|
|
373
|
+
const { __scopeSlider, ...thumbProps } = props;
|
|
374
|
+
const context = useSliderContext(THUMB_TRIGGER_NAME, __scopeSlider);
|
|
375
|
+
const orientation = useSliderOrientationContext(THUMB_TRIGGER_NAME, __scopeSlider);
|
|
376
|
+
const { index, value, percent, size, onThumbChange } = useSliderThumbContext(THUMB_TRIGGER_NAME, __scopeSlider);
|
|
377
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => onThumbChange(node));
|
|
378
|
+
const label = getLabel(index, context.values.length);
|
|
379
|
+
const orientationSize = size?.[orientation.size];
|
|
380
|
+
const thumbInBoundsOffset = orientationSize ? getThumbInBoundsOffset(orientationSize, percent, orientation.direction) : 0;
|
|
381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
343
382
|
style: {
|
|
344
383
|
transform: "var(--radix-slider-thumb-transform)",
|
|
345
384
|
position: "absolute",
|
|
346
385
|
[orientation.startEdge]: `calc(${percent}% + ${thumbInBoundsOffset}px)`
|
|
347
386
|
},
|
|
348
|
-
children:
|
|
349
|
-
scope:
|
|
387
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.ItemSlot, {
|
|
388
|
+
scope: __scopeSlider,
|
|
350
389
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.span, {
|
|
351
390
|
role: "slider",
|
|
352
391
|
"aria-label": props["aria-label"] || label,
|
|
@@ -364,16 +403,26 @@ var SliderThumbImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
|
364
403
|
context.valueIndexToChangeRef.current = index;
|
|
365
404
|
})
|
|
366
405
|
})
|
|
367
|
-
})
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
406
|
+
})
|
|
407
|
+
});
|
|
408
|
+
});
|
|
409
|
+
SliderThumbTrigger.displayName = THUMB_TRIGGER_NAME;
|
|
410
|
+
var SliderThumb = import_react.forwardRef((props, forwardedRef) => {
|
|
411
|
+
const { __scopeSlider, name, ...thumbProps } = props;
|
|
412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderThumbProvider, {
|
|
413
|
+
__scopeSlider,
|
|
414
|
+
name,
|
|
415
|
+
internal_do_not_use_render: ({ index, isFormControl }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderThumbTrigger, {
|
|
416
|
+
...thumbProps,
|
|
417
|
+
ref: forwardedRef,
|
|
418
|
+
__scopeSlider
|
|
419
|
+
}), isFormControl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderBubbleInput, { __scopeSlider }, index) : null] })
|
|
372
420
|
});
|
|
373
421
|
});
|
|
374
422
|
SliderThumb.displayName = THUMB_NAME;
|
|
375
|
-
var BUBBLE_INPUT_NAME = "
|
|
376
|
-
var SliderBubbleInput = import_react.forwardRef(({ __scopeSlider,
|
|
423
|
+
var BUBBLE_INPUT_NAME = "SliderBubbleInput";
|
|
424
|
+
var SliderBubbleInput = import_react.forwardRef(({ __scopeSlider, ...props }, forwardedRef) => {
|
|
425
|
+
const { value, name, form } = useSliderThumbContext(BUBBLE_INPUT_NAME, __scopeSlider);
|
|
377
426
|
const ref = import_react.useRef(null);
|
|
378
427
|
const composedRefs = useComposedRefs(ref, forwardedRef);
|
|
379
428
|
const prevValue = usePrevious(value);
|
|
@@ -390,6 +439,8 @@ var SliderBubbleInput = import_react.forwardRef(({ __scopeSlider, value, ...prop
|
|
|
390
439
|
}, [prevValue, value]);
|
|
391
440
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.input, {
|
|
392
441
|
style: { display: "none" },
|
|
442
|
+
name,
|
|
443
|
+
form,
|
|
393
444
|
...props,
|
|
394
445
|
ref: composedRefs,
|
|
395
446
|
defaultValue: value
|
|
@@ -437,15 +488,23 @@ function linearScale(input, output) {
|
|
|
437
488
|
};
|
|
438
489
|
}
|
|
439
490
|
function getDecimalCount(value) {
|
|
440
|
-
|
|
491
|
+
if (!Number.isFinite(value)) return 0;
|
|
492
|
+
const str = value.toString();
|
|
493
|
+
if (str.includes("e")) {
|
|
494
|
+
const [coefficient, exponent] = str.split("e");
|
|
495
|
+
const decimalPart2 = coefficient.split(".")[1] || "";
|
|
496
|
+
const exponentNum = Number(exponent);
|
|
497
|
+
return Math.max(0, decimalPart2.length - exponentNum);
|
|
498
|
+
}
|
|
499
|
+
const decimalPart = str.split(".")[1];
|
|
500
|
+
return decimalPart ? decimalPart.length : 0;
|
|
441
501
|
}
|
|
442
502
|
function roundValue(value, decimalCount) {
|
|
443
503
|
const rounder = Math.pow(10, decimalCount);
|
|
444
504
|
return Math.round(value * rounder) / rounder;
|
|
445
505
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
var Thumb = SliderThumb;
|
|
506
|
+
function isFunction(value) {
|
|
507
|
+
return typeof value === "function";
|
|
508
|
+
}
|
|
450
509
|
//#endregion
|
|
451
|
-
export {
|
|
510
|
+
export { SliderTrack as i, SliderRange as n, SliderThumb as r, Slider as t };
|
|
@@ -1,60 +1,89 @@
|
|
|
1
1
|
import { r as __toESM } from "../_runtime.mjs";
|
|
2
|
-
import { E as useControllableState, N as useComposedRefs, O as createContextScope, P as require_jsx_runtime, k as Primitive } from "./@radix-ui/react-alert-dialog+[...].mjs";
|
|
3
2
|
import { u as require_react } from "./@floating-ui/react-dom+[...].mjs";
|
|
3
|
+
import { E as useControllableState, N as useComposedRefs, O as createContextScope, P as require_jsx_runtime, k as Primitive } from "./@radix-ui/react-alert-dialog+[...].mjs";
|
|
4
4
|
import { p as usePrevious } from "./@radix-ui/react-select+[...].mjs";
|
|
5
5
|
import { t as composeEventHandlers } from "./radix-ui__primitive.mjs";
|
|
6
6
|
import { o as useSize } from "./@radix-ui/react-popper+[...].mjs";
|
|
7
|
-
//#region ../../node_modules/.pnpm/@radix-ui+react-switch@1.
|
|
7
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-switch@1.3.0_@types+react-dom@19.2.3_@types+react@19.2.15__@types+react_55e256c9d19c631edfd6f4015145e5fa/node_modules/@radix-ui/react-switch/dist/index.mjs
|
|
8
8
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
9
9
|
var import_jsx_runtime = require_jsx_runtime();
|
|
10
10
|
var SWITCH_NAME = "Switch";
|
|
11
11
|
var [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);
|
|
12
|
-
var [
|
|
13
|
-
|
|
14
|
-
const { __scopeSwitch,
|
|
15
|
-
const [button, setButton] = import_react.useState(null);
|
|
16
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
|
|
17
|
-
const hasConsumerStoppedPropagationRef = import_react.useRef(false);
|
|
18
|
-
const isFormControl = button ? form || !!button.closest("form") : true;
|
|
12
|
+
var [SwitchProviderImpl, useSwitchContext] = createSwitchContext(SWITCH_NAME);
|
|
13
|
+
function SwitchProvider(props) {
|
|
14
|
+
const { __scopeSwitch, checked: checkedProp, children, defaultChecked, disabled, form, name, onCheckedChange, required, value = "on", internal_do_not_use_render } = props;
|
|
19
15
|
const [checked, setChecked] = useControllableState({
|
|
20
16
|
prop: checkedProp,
|
|
21
17
|
defaultProp: defaultChecked ?? false,
|
|
22
18
|
onChange: onCheckedChange,
|
|
23
19
|
caller: SWITCH_NAME
|
|
24
20
|
});
|
|
25
|
-
|
|
21
|
+
const [control, setControl] = import_react.useState(null);
|
|
22
|
+
const [bubbleInput, setBubbleInput] = import_react.useState(null);
|
|
23
|
+
const context = {
|
|
24
|
+
checked,
|
|
25
|
+
setChecked,
|
|
26
|
+
disabled,
|
|
27
|
+
control,
|
|
28
|
+
setControl,
|
|
29
|
+
name,
|
|
30
|
+
form,
|
|
31
|
+
value,
|
|
32
|
+
hasConsumerStoppedPropagationRef: import_react.useRef(false),
|
|
33
|
+
required,
|
|
34
|
+
defaultChecked,
|
|
35
|
+
isFormControl: control ? !!form || !!control.closest("form") : true,
|
|
36
|
+
bubbleInput,
|
|
37
|
+
setBubbleInput
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SwitchProviderImpl, {
|
|
26
40
|
scope: __scopeSwitch,
|
|
41
|
+
...context,
|
|
42
|
+
children: isFunction(internal_do_not_use_render) ? internal_do_not_use_render(context) : children
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
var TRIGGER_NAME = "SwitchTrigger";
|
|
46
|
+
var SwitchTrigger = import_react.forwardRef(({ __scopeSwitch, onClick, ...switchProps }, forwardedRef) => {
|
|
47
|
+
const { value, disabled, checked, required, setControl, setChecked, hasConsumerStoppedPropagationRef, isFormControl, bubbleInput } = useSwitchContext(TRIGGER_NAME, __scopeSwitch);
|
|
48
|
+
const composedRefs = useComposedRefs(forwardedRef, setControl);
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.button, {
|
|
50
|
+
type: "button",
|
|
51
|
+
role: "switch",
|
|
52
|
+
"aria-checked": checked,
|
|
53
|
+
"aria-required": required,
|
|
54
|
+
"data-state": getState(checked),
|
|
55
|
+
"data-disabled": disabled ? "" : void 0,
|
|
56
|
+
disabled,
|
|
57
|
+
value,
|
|
58
|
+
...switchProps,
|
|
59
|
+
ref: composedRefs,
|
|
60
|
+
onClick: composeEventHandlers(onClick, (event) => {
|
|
61
|
+
setChecked((prevChecked) => !prevChecked);
|
|
62
|
+
if (bubbleInput && isFormControl) {
|
|
63
|
+
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
|
64
|
+
if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
SwitchTrigger.displayName = TRIGGER_NAME;
|
|
70
|
+
var Switch = import_react.forwardRef((props, forwardedRef) => {
|
|
71
|
+
const { __scopeSwitch, name, checked, defaultChecked, required, disabled, value, onCheckedChange, form, ...switchProps } = props;
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SwitchProvider, {
|
|
73
|
+
__scopeSwitch,
|
|
27
74
|
checked,
|
|
75
|
+
defaultChecked,
|
|
28
76
|
disabled,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"data-disabled": disabled ? "" : void 0,
|
|
36
|
-
disabled,
|
|
37
|
-
value,
|
|
77
|
+
required,
|
|
78
|
+
onCheckedChange,
|
|
79
|
+
name,
|
|
80
|
+
form,
|
|
81
|
+
value,
|
|
82
|
+
internal_do_not_use_render: ({ isFormControl }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SwitchTrigger, {
|
|
38
83
|
...switchProps,
|
|
39
|
-
ref:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (isFormControl) {
|
|
43
|
-
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
|
44
|
-
if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
|
|
45
|
-
}
|
|
46
|
-
})
|
|
47
|
-
}), isFormControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SwitchBubbleInput, {
|
|
48
|
-
control: button,
|
|
49
|
-
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
50
|
-
name,
|
|
51
|
-
value,
|
|
52
|
-
checked,
|
|
53
|
-
required,
|
|
54
|
-
disabled,
|
|
55
|
-
form,
|
|
56
|
-
style: { transform: "translateX(-100%)" }
|
|
57
|
-
})]
|
|
84
|
+
ref: forwardedRef,
|
|
85
|
+
__scopeSwitch
|
|
86
|
+
}), isFormControl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SwitchBubbleInput, { __scopeSwitch })] })
|
|
58
87
|
});
|
|
59
88
|
});
|
|
60
89
|
Switch.displayName = SWITCH_NAME;
|
|
@@ -71,30 +100,38 @@ var SwitchThumb = import_react.forwardRef((props, forwardedRef) => {
|
|
|
71
100
|
});
|
|
72
101
|
SwitchThumb.displayName = THUMB_NAME;
|
|
73
102
|
var BUBBLE_INPUT_NAME = "SwitchBubbleInput";
|
|
74
|
-
var SwitchBubbleInput = import_react.forwardRef(({ __scopeSwitch,
|
|
75
|
-
const
|
|
76
|
-
const composedRefs = useComposedRefs(
|
|
103
|
+
var SwitchBubbleInput = import_react.forwardRef(({ __scopeSwitch, ...props }, forwardedRef) => {
|
|
104
|
+
const { control, hasConsumerStoppedPropagationRef, checked, defaultChecked, required, disabled, name, value, form, bubbleInput, setBubbleInput } = useSwitchContext(BUBBLE_INPUT_NAME, __scopeSwitch);
|
|
105
|
+
const composedRefs = useComposedRefs(forwardedRef, setBubbleInput);
|
|
77
106
|
const prevChecked = usePrevious(checked);
|
|
78
107
|
const controlSize = useSize(control);
|
|
79
108
|
import_react.useEffect(() => {
|
|
80
|
-
const input =
|
|
109
|
+
const input = bubbleInput;
|
|
81
110
|
if (!input) return;
|
|
82
111
|
const inputProto = window.HTMLInputElement.prototype;
|
|
83
112
|
const setChecked = Object.getOwnPropertyDescriptor(inputProto, "checked").set;
|
|
113
|
+
const bubbles = !hasConsumerStoppedPropagationRef.current;
|
|
84
114
|
if (prevChecked !== checked && setChecked) {
|
|
85
115
|
const event = new Event("click", { bubbles });
|
|
86
116
|
setChecked.call(input, checked);
|
|
87
117
|
input.dispatchEvent(event);
|
|
88
118
|
}
|
|
89
119
|
}, [
|
|
120
|
+
bubbleInput,
|
|
90
121
|
prevChecked,
|
|
91
122
|
checked,
|
|
92
|
-
|
|
123
|
+
hasConsumerStoppedPropagationRef
|
|
93
124
|
]);
|
|
94
|
-
|
|
125
|
+
const defaultCheckedRef = import_react.useRef(checked);
|
|
126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.input, {
|
|
95
127
|
type: "checkbox",
|
|
96
128
|
"aria-hidden": true,
|
|
97
|
-
defaultChecked:
|
|
129
|
+
defaultChecked: defaultChecked ?? defaultCheckedRef.current,
|
|
130
|
+
required,
|
|
131
|
+
disabled,
|
|
132
|
+
name,
|
|
133
|
+
value,
|
|
134
|
+
form,
|
|
98
135
|
...props,
|
|
99
136
|
tabIndex: -1,
|
|
100
137
|
ref: composedRefs,
|
|
@@ -104,15 +141,17 @@ var SwitchBubbleInput = import_react.forwardRef(({ __scopeSwitch, control, check
|
|
|
104
141
|
position: "absolute",
|
|
105
142
|
pointerEvents: "none",
|
|
106
143
|
opacity: 0,
|
|
107
|
-
margin: 0
|
|
144
|
+
margin: 0,
|
|
145
|
+
transform: "translateX(-100%)"
|
|
108
146
|
}
|
|
109
147
|
});
|
|
110
148
|
});
|
|
111
149
|
SwitchBubbleInput.displayName = BUBBLE_INPUT_NAME;
|
|
150
|
+
function isFunction(value) {
|
|
151
|
+
return typeof value === "function";
|
|
152
|
+
}
|
|
112
153
|
function getState(checked) {
|
|
113
154
|
return checked ? "checked" : "unchecked";
|
|
114
155
|
}
|
|
115
|
-
var Root = Switch;
|
|
116
|
-
var Thumb = SwitchThumb;
|
|
117
156
|
//#endregion
|
|
118
|
-
export {
|
|
157
|
+
export { SwitchThumb as n, Switch as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as __toESM } from "../_runtime.mjs";
|
|
2
|
-
import { E as useControllableState, M as createSlottable, N as useComposedRefs, O as createContextScope, P as require_jsx_runtime, S as DismissableLayer, T as Presence, b as Portal$1, k as Primitive, w as useId } from "./@radix-ui/react-alert-dialog+[...].mjs";
|
|
3
2
|
import { u as require_react } from "./@floating-ui/react-dom+[...].mjs";
|
|
3
|
+
import { E as useControllableState, M as createSlottable, N as useComposedRefs, O as createContextScope, P as require_jsx_runtime, S as DismissableLayer, T as Presence, b as Portal$1, k as Primitive, w as useId } from "./@radix-ui/react-alert-dialog+[...].mjs";
|
|
4
4
|
import { m as Root } from "./@radix-ui/react-select+[...].mjs";
|
|
5
5
|
import { t as composeEventHandlers } from "./radix-ui__primitive.mjs";
|
|
6
6
|
import { a as createPopperScope, i as Root2, n as Arrow, r as Content, t as Anchor } from "./@radix-ui/react-popper+[...].mjs";
|
|
7
|
-
//#region ../../node_modules/.pnpm/@radix-ui+react-tooltip@1.2.
|
|
7
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-tooltip@1.2.9_@types+react-dom@19.2.3_@types+react@19.2.15__@types+reac_5a451308c19916fd9d95f5d7ea3f72f6/node_modules/@radix-ui/react-tooltip/dist/index.mjs
|
|
8
8
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
9
9
|
var import_jsx_runtime = require_jsx_runtime();
|
|
10
10
|
var [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [createPopperScope]);
|
|
@@ -27,10 +27,12 @@ var TooltipProvider = (props) => {
|
|
|
27
27
|
isOpenDelayedRef,
|
|
28
28
|
delayDuration,
|
|
29
29
|
onOpen: import_react.useCallback(() => {
|
|
30
|
+
if (skipDelayDuration <= 0) return;
|
|
30
31
|
window.clearTimeout(skipDelayTimerRef.current);
|
|
31
32
|
isOpenDelayedRef.current = false;
|
|
32
|
-
}, []),
|
|
33
|
+
}, [skipDelayDuration]),
|
|
33
34
|
onClose: import_react.useCallback(() => {
|
|
35
|
+
if (skipDelayDuration <= 0) return;
|
|
34
36
|
window.clearTimeout(skipDelayTimerRef.current);
|
|
35
37
|
skipDelayTimerRef.current = window.setTimeout(() => isOpenDelayedRef.current = true, skipDelayDuration);
|
|
36
38
|
}, [skipDelayDuration]),
|
|
@@ -301,7 +303,7 @@ var TooltipContentImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
|
301
303
|
import_react.useEffect(() => {
|
|
302
304
|
if (context.trigger) {
|
|
303
305
|
const handleScroll = (event) => {
|
|
304
|
-
if (event.target
|
|
306
|
+
if (event.target instanceof Node && event.target.contains(context.trigger)) onClose();
|
|
305
307
|
};
|
|
306
308
|
window.addEventListener("scroll", handleScroll, { capture: true });
|
|
307
309
|
return () => window.removeEventListener("scroll", handleScroll, { capture: true });
|