@mantine-vue/core 3.3.0 → 3.4.0

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/esm/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { Comment, Fragment, Teleport, Text as Text$1, cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, guardReactiveProps, h, inject, isVNode, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onBeforeUpdate, onMounted, onUnmounted, onUpdated, openBlock, provide, reactive, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toRef, toValue, unref, useAttrs, useSlots, watch, watchEffect, withCtx } from "vue";
2
- import { DOTS, assignRef, clampUseMovePosition, mergeRefs, normalizeRadialValue, useClickOutside, useClipboard, useCollapse, useElementSize, useFloatingWindow, useFocusReturn, useFocusTrap, useHorizontalCollapse, useId, useLongPress, useMounted, useMove, usePagination, useRadialMove, useReducedMotion, useScrollSpy, useScroller, useUncontrolled, useWindowEvent } from "@mantine-vue/hooks";
1
+ import { Comment, Fragment, Teleport, Text as Text$1, cloneVNode, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, guardReactiveProps, h, inject, isVNode, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onBeforeUpdate, onMounted, onUnmounted, onUpdated, openBlock, provide, reactive, ref, renderList, renderSlot, resolveComponent, resolveDynamicComponent, shallowRef, toDisplayString, toRef, toValue, unref, useAttrs, useId, useSlots, watch, watchEffect, withCtx } from "vue";
2
+ import { DOTS, assignRef, clampUseMovePosition, mergeRefs, normalizeRadialValue, useClickOutside, useClipboard, useCollapse, useElementSize, useFloatingWindow, useFocusReturn, useFocusTrap, useHorizontalCollapse, useId as useId$1, useLongPress, useMounted, useMove, usePagination, useRadialMove, useReducedMotion, useScrollSpy, useScroller, useUncontrolled, useWindowEvent } from "@mantine-vue/hooks";
3
3
  import { arrow, autoUpdate, flip, hide, inline, limitShift, offset, shift, size, useFloating } from "@floating-ui/vue";
4
4
  //#region ../utils/esm/index.mjs
5
5
  function keys(object) {
@@ -1737,7 +1737,7 @@ function hashStyleProps(styles, media) {
1737
1737
  return `mantine-vue-${Math.abs(hash).toString(36)}`;
1738
1738
  }
1739
1739
  function useRandomClassName() {
1740
- return `mantine-vue-${Math.random().toString(36).slice(2, 9)}`;
1740
+ return `mantine-vue-${(getCurrentInstance() ? useId() : Math.random().toString(36).slice(2, 9)).replace(/[^A-Za-z0-9_-]/g, "-")}`;
1741
1741
  }
1742
1742
  //#endregion
1743
1743
  //#region src/core/Box/style-props/style-props-data.ts
@@ -6119,7 +6119,7 @@ var Alert = factory(/* @__PURE__ */ defineComponent({
6119
6119
  const slots = useSlots();
6120
6120
  const attrs = useAttrs();
6121
6121
  const props = useProps("Alert", null, rawProps);
6122
- const rootId = useId(props.id);
6122
+ const rootId = useId$1(props.id);
6123
6123
  const getStyles = useStyles({
6124
6124
  name: "Alert",
6125
6125
  props,
@@ -8826,7 +8826,7 @@ var Accordion_default = /* @__PURE__ */ defineComponent({
8826
8826
  const slots = useSlots();
8827
8827
  const attrs = useAttrs();
8828
8828
  const props = useProps("Accordion", defaultProps$46, rawProps);
8829
- const uid = useId(props.id);
8829
+ const uid = useId$1(props.id);
8830
8830
  const [currentValue, setCurrentValue] = useUncontrolled({
8831
8831
  value: () => props.value,
8832
8832
  defaultValue: props.defaultValue,
@@ -11703,7 +11703,7 @@ var Spoiler = factory(/* @__PURE__ */ defineComponent({
11703
11703
  vars: props.vars,
11704
11704
  varsResolver: varsResolver$48
11705
11705
  });
11706
- const id = useId(props.id);
11706
+ const id = useId$1(props.id);
11707
11707
  const [show, setShowState] = useUncontrolled({
11708
11708
  value: computed(() => props.expanded),
11709
11709
  defaultValue: props.defaultExpanded,
@@ -12435,7 +12435,7 @@ var InputWrapper = Object.assign(/* @__PURE__ */ defineComponent({
12435
12435
  const slots = useSlots();
12436
12436
  const attrs = useAttrs();
12437
12437
  const props = useProps("InputWrapper", { labelElement: "label" }, rawProps);
12438
- const idBase = useId(props.id);
12438
+ const idBase = useId$1(props.id);
12439
12439
  const getStyles = useStyles({
12440
12440
  name: "InputWrapper",
12441
12441
  props,
@@ -13851,13 +13851,21 @@ var leadingZerosPattern = /^-?0\d+(\.\d+)?\.?$/;
13851
13851
  var trailingZerosPattern = /\.\d*0$/;
13852
13852
  var trailingDecimalSeparatorPattern = /^-?\d+\.$/;
13853
13853
  function clamp$3(value, min, max) {
13854
- return Math.min(max ?? value, Math.max(min ?? value, value));
13854
+ return Math.min(max ?? Number.POSITIVE_INFINITY, Math.max(min ?? Number.NEGATIVE_INFINITY, value));
13855
13855
  }
13856
13856
  function clampBigInt(value, min, max) {
13857
13857
  if (min !== void 0 && value < min) return min;
13858
13858
  if (max !== void 0 && value > max) return max;
13859
13859
  return value;
13860
13860
  }
13861
+ function canStep(value) {
13862
+ if (typeof value === "number") return value < Number.MAX_SAFE_INTEGER;
13863
+ return value === "" || value !== "-" && !Number.isNaN(Number(value)) && Number(value) < Number.MAX_SAFE_INTEGER;
13864
+ }
13865
+ function canStepBigInt(value, allowNegative) {
13866
+ if (typeof value === "bigint") return true;
13867
+ return value === "" || value !== "-" && (allowNegative || !value.startsWith("-")) && /^-?\d+$/.test(value);
13868
+ }
13861
13869
  function stripFormatting(value, options) {
13862
13870
  let next = value;
13863
13871
  if (options.prefix && next.startsWith(options.prefix)) next = next.slice(options.prefix.length);
@@ -13887,9 +13895,19 @@ function parseNumberInputValue(rawValue, allowDecimal, allowNegative, allowLeadi
13887
13895
  return parsed;
13888
13896
  }
13889
13897
  function sanitizeNumberInputString(rawValue, allowDecimal, allowNegative, decimalScale) {
13890
- let normalized = rawValue;
13891
- if (!allowNegative) normalized = normalized.replace(/-/g, "");
13892
- if (!allowDecimal) return normalized.split(".")[0];
13898
+ let normalized = "";
13899
+ let hasDecimalSeparator = false;
13900
+ for (const character of rawValue) {
13901
+ if (character === "." && !allowDecimal) break;
13902
+ if (/\d/.test(character)) normalized += character;
13903
+ else if (character === "-" && allowNegative && normalized.length === 0) normalized = "-";
13904
+ else if (character === "." && allowDecimal && !hasDecimalSeparator) {
13905
+ normalized += character;
13906
+ hasDecimalSeparator = true;
13907
+ }
13908
+ }
13909
+ if (normalized.startsWith(".")) normalized = `0${normalized}`;
13910
+ else if (normalized.startsWith("-.")) normalized = `-0${normalized.slice(1)}`;
13893
13911
  if (typeof decimalScale === "number" && normalized.includes(".")) {
13894
13912
  const [integerPart, decimalPart = ""] = normalized.split(".");
13895
13913
  return `${integerPart}.${decimalPart.slice(0, decimalScale)}`;
@@ -14109,7 +14127,6 @@ var NumberInput = factory(/* @__PURE__ */ defineComponent({
14109
14127
  const slots = useSlots();
14110
14128
  const attrs = useAttrs();
14111
14129
  const inputRef = ref(null);
14112
- const isEditing = ref(false);
14113
14130
  const isBigIntMode = computed(() => typeof props.modelValue === "bigint" || typeof props.defaultValue === "bigint");
14114
14131
  const [value, setValue] = useUncontrolled({
14115
14132
  value: () => props.modelValue,
@@ -14142,11 +14159,7 @@ var NumberInput = factory(/* @__PURE__ */ defineComponent({
14142
14159
  thousandsGroupStyle: props.thousandsGroupStyle,
14143
14160
  thousandSeparator: props.thousandSeparator
14144
14161
  }));
14145
- const getFormatterOptions = (nextValue = value.value) => ({
14146
- ...formatterOptions.value,
14147
- fixedDecimalScale: isEditing.value || typeof nextValue === "string" ? false : formatterOptions.value.fixedDecimalScale
14148
- });
14149
- const displayValue = computed(() => value.value === "" || value.value === "-" ? String(value.value) : formatNumber(value.value, getFormatterOptions()));
14162
+ const displayValue = computed(() => value.value === "" || value.value === "-" ? String(value.value) : formatNumber(value.value, formatterOptions.value));
14150
14163
  const clampCaretToFormatting = (input) => {
14151
14164
  const { min, max } = getCaretBoundaries(input.value, formatterOptions.value);
14152
14165
  const start = input.selectionStart;
@@ -14159,6 +14172,14 @@ var NumberInput = factory(/* @__PURE__ */ defineComponent({
14159
14172
  const scheduleCaretClamp = (input) => {
14160
14173
  setTimeout(() => clampCaretToFormatting(input), 0);
14161
14174
  };
14175
+ const getFormattedCaretPosition = (value, formattedValue, position) => {
14176
+ let formattedPosition = 0;
14177
+ for (const character of value.slice(0, position)) {
14178
+ const nextPosition = formattedValue.indexOf(character, formattedPosition);
14179
+ if (nextPosition !== -1) formattedPosition = nextPosition + 1;
14180
+ }
14181
+ return formattedPosition;
14182
+ };
14162
14183
  const commitValue = (nextValue, source = "event") => {
14163
14184
  if (props.clampBehavior === "strict") {
14164
14185
  const numeric = toNumeric(nextValue);
@@ -14170,18 +14191,19 @@ var NumberInput = factory(/* @__PURE__ */ defineComponent({
14170
14191
  const raw = typeof nextValue === "bigint" ? nextValue.toString() : String(nextValue);
14171
14192
  emit("value-change", {
14172
14193
  floatValue: typeof nextValue === "number" ? nextValue : Number.isNaN(Number(raw)) ? void 0 : Number(raw),
14173
- formattedValue: nextValue === "" ? "" : formatNumber(nextValue, getFormatterOptions(nextValue)),
14194
+ formattedValue: nextValue === "" ? "" : formatNumber(nextValue, formatterOptions.value),
14174
14195
  value: raw
14175
14196
  }, { source });
14176
14197
  };
14198
+ const canStepValue = computed(() => isBigIntMode.value ? canStepBigInt(value.value, props.allowNegative) : canStep(value.value));
14177
14199
  const stepValue = (direction) => {
14178
- if (props.disabled || props.readOnly) return;
14200
+ if (props.disabled || props.readOnly || !canStepValue.value) return;
14179
14201
  if (isBigIntMode.value) {
14180
14202
  const current = typeof value.value === "bigint" ? value.value : BigInt(0);
14181
14203
  const step = typeof props.step === "bigint" ? props.step : BigInt(props.step);
14182
14204
  const start = typeof props.startValue === "bigint" ? props.startValue : BigInt(props.startValue);
14183
14205
  const next = (value.value === "" || value.value === "-" ? start : current) + step * BigInt(direction);
14184
- const min = typeof props.min === "bigint" ? props.min : props.min === void 0 ? void 0 : BigInt(props.min);
14206
+ const min = typeof props.min === "bigint" ? props.min : props.min === void 0 ? props.allowNegative ? void 0 : BigInt(0) : BigInt(props.min);
14185
14207
  const max = typeof props.max === "bigint" ? props.max : props.max === void 0 ? void 0 : BigInt(props.max);
14186
14208
  const clamped = clampBigInt(next, min, max);
14187
14209
  if (max !== void 0 && next > max) emit("max-reached");
@@ -14271,7 +14293,7 @@ var NumberInput = factory(/* @__PURE__ */ defineComponent({
14271
14293
  onPointercancel: clearHold
14272
14294
  }, () => h(NumberInputChevron, { direction: "down" }))]);
14273
14295
  /** The step controls double as the right section unless one was supplied. */
14274
- const rightSection = computed(() => props.hideControls || props.readOnly ? props.rightSection : props.rightSection !== void 0 || slots.rightSection ? props.rightSection : controls);
14296
+ const rightSection = computed(() => props.hideControls || props.readOnly || !canStepValue.value ? props.rightSection : props.rightSection !== void 0 || slots.rightSection ? props.rightSection : controls);
14275
14297
  const rightSectionPointerEvents = computed(() => props.rightSectionPointerEvents ?? (props.disabled ? "none" : void 0));
14276
14298
  const rightSectionWidth = computed(() => props.rightSectionWidth ?? `var(--ni-right-section-width-${props.size || "sm"})`);
14277
14299
  /** `bigint` values are integers only, so the numeric keypad is the right hint. */
@@ -14288,22 +14310,52 @@ var NumberInput = factory(/* @__PURE__ */ defineComponent({
14288
14310
  };
14289
14311
  __expose({ rootElement });
14290
14312
  function onInput(event) {
14291
- isEditing.value = true;
14292
14313
  const input = event.currentTarget;
14293
- const rawValue = stripFormatting(input.value, formatterOptions.value);
14314
+ const inputValue = input.value;
14315
+ const selectionStart = input.selectionStart;
14316
+ const selectionEnd = input.selectionEnd;
14317
+ const rawValue = stripFormatting(inputValue, formatterOptions.value);
14294
14318
  const decimalSeparator = props.decimalSeparator || ".";
14295
- const sanitized = sanitizeNumberInputString(props.allowedDecimalSeparators.filter((separator) => separator !== decimalSeparator).reduce((acc, separator) => acc.split(separator).join("."), rawValue.replace(decimalSeparator, ".")), props.allowDecimal, props.allowNegative, props.decimalScale);
14319
+ const sanitized = sanitizeNumberInputString(props.allowedDecimalSeparators.filter((separator) => separator !== decimalSeparator).reduce((acc, separator) => acc.split(separator).join("."), rawValue.replace(decimalSeparator, ".")), isBigIntMode.value ? false : props.allowDecimal, props.allowNegative, props.decimalScale);
14296
14320
  const nextValue = isBigIntMode.value ? parseBigIntInputValue(sanitized, props.allowNegative, props.allowLeadingZeros) : parseNumberInputValue(sanitized, props.allowDecimal, props.allowNegative, props.allowLeadingZeros, props.decimalScale, props.fixedDecimalScale);
14297
14321
  if (props.clampBehavior === "strict" && !isBigIntMode.value && !isStrictAllowed(nextValue, typeof props.min === "number" ? props.min : void 0, typeof props.max === "number" ? props.max : void 0)) {
14298
14322
  restoreInputValue(input, displayValue.value);
14299
14323
  return;
14300
14324
  }
14301
- const formattedNextValue = nextValue === "" || nextValue === "-" ? String(nextValue) : formatNumber(nextValue, getFormatterOptions(nextValue));
14302
- if (input.value !== formattedNextValue) restoreInputValue(input, formattedNextValue);
14325
+ const formattedNextValue = nextValue === "" || nextValue === "-" ? String(nextValue) : formatNumber(nextValue, formatterOptions.value);
14326
+ if (input.value !== formattedNextValue) {
14327
+ restoreInputValue(input, formattedNextValue);
14328
+ if (props.fixedDecimalScale && selectionStart !== null && selectionEnd !== null) input.setSelectionRange(getFormattedCaretPosition(inputValue, formattedNextValue, selectionStart), getFormattedCaretPosition(inputValue, formattedNextValue, selectionEnd));
14329
+ }
14303
14330
  scheduleCaretClamp(input);
14304
- commitValue(nextValue);
14331
+ if (!Object.is(nextValue, value.value)) commitValue(nextValue);
14305
14332
  }
14306
14333
  function onKeydown(event) {
14334
+ const input = event.currentTarget;
14335
+ if (event.key === "Backspace" && !props.readOnly && !props.disabled && input.selectionStart !== null && input.selectionStart === input.selectionEnd) {
14336
+ if (input.selectionStart === 0) event.preventDefault();
14337
+ else if (props.fixedDecimalScale && typeof props.decimalScale === "number") {
14338
+ const decimalPosition = input.value.indexOf(props.decimalSeparator);
14339
+ const isAfterDecimalSeparator = input.value[input.selectionStart - 1] === props.decimalSeparator;
14340
+ const deletePosition = input.selectionStart - (isAfterDecimalSeparator ? 2 : 1);
14341
+ if (deletePosition >= 0 && deletePosition < decimalPosition) {
14342
+ const nextInputValue = input.value.slice(0, deletePosition) + input.value.slice(deletePosition + 1);
14343
+ const unformattedValue = stripFormatting(nextInputValue, formatterOptions.value);
14344
+ const [integerPart, decimalPart = ""] = (unformattedValue.startsWith("-") ? unformattedValue.slice(1) : unformattedValue).split(".");
14345
+ if (!/\d/.test(integerPart) && /^0*$/.test(decimalPart)) {
14346
+ event.preventDefault();
14347
+ input.value = "";
14348
+ input.setSelectionRange(0, 0);
14349
+ input.dispatchEvent(new Event("input", { bubbles: true }));
14350
+ } else if (isAfterDecimalSeparator) {
14351
+ event.preventDefault();
14352
+ input.value = nextInputValue;
14353
+ input.setSelectionRange(deletePosition, deletePosition);
14354
+ input.dispatchEvent(new Event("input", { bubbles: true }));
14355
+ }
14356
+ }
14357
+ }
14358
+ }
14307
14359
  if (!props.readOnly && props.withKeyboardEvents && event.key === "ArrowUp") {
14308
14360
  event.preventDefault();
14309
14361
  stepValue(1);
@@ -14312,7 +14364,7 @@ var NumberInput = factory(/* @__PURE__ */ defineComponent({
14312
14364
  event.preventDefault();
14313
14365
  stepValue(-1);
14314
14366
  }
14315
- scheduleCaretClamp(event.currentTarget);
14367
+ scheduleCaretClamp(input);
14316
14368
  }
14317
14369
  function onKeyup(event) {
14318
14370
  scheduleCaretClamp(event.currentTarget);
@@ -14321,12 +14373,10 @@ var NumberInput = factory(/* @__PURE__ */ defineComponent({
14321
14373
  scheduleCaretClamp(event.currentTarget);
14322
14374
  }
14323
14375
  function onFocus(event) {
14324
- isEditing.value = true;
14325
14376
  if (props.selectAllOnFocus) window.setTimeout(() => inputRef.value?.select(), 0);
14326
14377
  else scheduleCaretClamp(event.currentTarget);
14327
14378
  }
14328
14379
  function onBlur() {
14329
- isEditing.value = false;
14330
14380
  let sanitizedValue = value.value;
14331
14381
  const min = typeof props.min === "number" ? props.min : void 0;
14332
14382
  const max = typeof props.max === "number" ? props.max : void 0;
@@ -14638,7 +14688,7 @@ var PinInput = factory(/* @__PURE__ */ defineComponent({
14638
14688
  const emit = __emit;
14639
14689
  const attrs = useAttrs();
14640
14690
  const props = useProps("PinInput", defaultProps$29, rawProps);
14641
- const uuid = useId(props.id);
14691
+ const uuid = useId$1(props.id);
14642
14692
  const focusedIndex = ref(-1);
14643
14693
  const inputsRef = ref([]);
14644
14694
  /** Guards `onComplete` so it fires once per completion, not on every keystroke after. */
@@ -16005,8 +16055,8 @@ var Rating = factory(/* @__PURE__ */ defineComponent({
16005
16055
  const hovered = ref(-1);
16006
16056
  const isOutside = ref(true);
16007
16057
  const { dir } = useDirection();
16008
- const name = useId(props.name);
16009
- const id = useId(props.id);
16058
+ const name = useId$1(props.name);
16059
+ const id = useId$1(props.id);
16010
16060
  const [currentValue, setCurrentValue] = useUncontrolled({
16011
16061
  value: () => props.modelValue,
16012
16062
  defaultValue: props.defaultValue,
@@ -16445,7 +16495,7 @@ var SegmentedControl = Object.assign(/* @__PURE__ */ defineComponent({
16445
16495
  const emit = __emit;
16446
16496
  const attrs = useAttrs();
16447
16497
  const theme = useMantineTheme();
16448
- const uuid = useId(props.name);
16498
+ const uuid = useId$1(props.name);
16449
16499
  const mounted = useMounted();
16450
16500
  const parent = ref(null);
16451
16501
  const itemRefs = reactive({});
@@ -17514,7 +17564,7 @@ var Tabs_default = /* @__PURE__ */ defineComponent({
17514
17564
  const emit = __emit;
17515
17565
  const attrs = useAttrs();
17516
17566
  const props = useProps("Tabs", defaultProps$21, rawProps);
17517
- const uid = useId(props.id);
17567
+ const uid = useId$1(props.id);
17518
17568
  const [currentTab, setCurrentTab] = useUncontrolled({
17519
17569
  value: () => props.modelValue,
17520
17570
  defaultValue: props.defaultValue,
@@ -18850,7 +18900,7 @@ var PasswordInput = Object.assign(/* @__PURE__ */ defineComponent({
18850
18900
  const slots = useSlots();
18851
18901
  const attrs = useAttrs();
18852
18902
  const props = useProps("PasswordInput", defaultProps$19, rawProps);
18853
- const uuid = useId(props.id);
18903
+ const uuid = useId$1(props.id);
18854
18904
  const fallbackId = ref(`password-input-${Math.random().toString(36).slice(2)}`);
18855
18905
  const [visible, setVisible] = useUncontrolled({
18856
18906
  value: () => props.visible,
@@ -19867,7 +19917,7 @@ var Checkbox = factory(/* @__PURE__ */ defineComponent({
19867
19917
  const slots = useSlots();
19868
19918
  const attrs = useAttrs();
19869
19919
  const props = useProps("Checkbox", defaultProps$17, rawProps);
19870
- const uuid = useId(props.id);
19920
+ const uuid = useId$1(props.id);
19871
19921
  const groupContext = useCheckboxGroupContext();
19872
19922
  const [localChecked, setLocalChecked] = useUncontrolled({
19873
19923
  value: () => props.modelValue !== void 0 ? props.modelValue : props.checked,
@@ -20177,7 +20227,7 @@ var Chip = factory(/* @__PURE__ */ defineComponent({
20177
20227
  const attrs = useAttrs();
20178
20228
  const props = useProps("Chip", defaultProps$16, rawProps);
20179
20229
  const groupContext = useChipGroupContext();
20180
- const uuid = useId(props.id);
20230
+ const uuid = useId$1(props.id);
20181
20231
  const [value, setValue] = useUncontrolled({
20182
20232
  value: () => props.modelValue !== void 0 ? props.modelValue : props.checked,
20183
20233
  defaultValue: props.defaultChecked,
@@ -20934,7 +20984,7 @@ var RadioGroup = Object.assign(/* @__PURE__ */ defineComponent({
20934
20984
  const slots = useSlots();
20935
20985
  const attrs = useAttrs();
20936
20986
  const props = useProps("RadioGroup", null, rawProps);
20937
- const name = useId(props.name);
20987
+ const name = useId$1(props.name);
20938
20988
  const [value, setValue] = useUncontrolled({
20939
20989
  value: () => props.modelValue,
20940
20990
  defaultValue: props.defaultValue,
@@ -21388,7 +21438,7 @@ var Radio = factory(/* @__PURE__ */ defineComponent({
21388
21438
  const slots = useSlots();
21389
21439
  const attrs = useAttrs();
21390
21440
  const props = useProps("Radio", defaultProps$15, rawProps);
21391
- const uuid = useId(props.id);
21441
+ const uuid = useId$1(props.id);
21392
21442
  const groupContext = useRadioGroupContext();
21393
21443
  const [localChecked, setLocalChecked] = useUncontrolled({
21394
21444
  value: () => props.modelValue !== void 0 ? props.modelValue : props.checked,
@@ -21854,7 +21904,7 @@ var Switch = factory(/* @__PURE__ */ defineComponent({
21854
21904
  const slots = useSlots();
21855
21905
  const attrs = useAttrs();
21856
21906
  const props = useProps("Switch", defaultProps$13, rawProps);
21857
- const uuid = useId(props.id);
21907
+ const uuid = useId$1(props.id);
21858
21908
  const groupContext = useSwitchGroupContext();
21859
21909
  const [checked, setChecked] = useUncontrolled({
21860
21910
  value: () => props.modelValue,
@@ -23065,7 +23115,7 @@ var TableOfContents = factory(/* @__PURE__ */ defineComponent({
23065
23115
  const rawProps = __props;
23066
23116
  const attrs = useAttrs();
23067
23117
  const props = useProps("TableOfContents", defaultProps$9, rawProps);
23068
- const id = useId();
23118
+ const id = useId$1();
23069
23119
  const spy = useScrollSpy(props.scrollSpyOptions ?? {});
23070
23120
  assignRef(props.reinitializeRef, spy.reinitialize);
23071
23121
  const getStyles = useStyles({
@@ -28205,7 +28255,7 @@ function useLockScroll(opened) {
28205
28255
  //#endregion
28206
28256
  //#region src/components/ModalBase/use-modal.ts
28207
28257
  function useModal(input) {
28208
- const id = useId(input.id);
28258
+ const id = useId$1(input.id);
28209
28259
  const titleMounted = ref(false);
28210
28260
  const bodyMounted = ref(false);
28211
28261
  useWindowEvent("keydown", (event) => {
@@ -28283,7 +28333,7 @@ var ModalBase = factory(/* @__PURE__ */ defineComponent({
28283
28333
  const props = __props;
28284
28334
  const emit = __emit;
28285
28335
  const attrs = useAttrs();
28286
- const fallbackId = useId(props.id);
28336
+ const fallbackId = useId$1(props.id);
28287
28337
  const modal = useModal({
28288
28338
  id: props.id,
28289
28339
  opened: () => props.opened,
@@ -29955,7 +30005,7 @@ var Popover_default = /* @__PURE__ */ defineComponent({
29955
30005
  const emit = __emit;
29956
30006
  const props = useProps("Popover", defaults$2, rawProps);
29957
30007
  const { dir } = useDirection();
29958
- const id = useId(props.id);
30008
+ const id = useId$1(props.id);
29959
30009
  const internal = ref(props.defaultOpened);
29960
30010
  const isControlled = computed(() => rawProps.opened !== void 0);
29961
30011
  const opened = computed(() => isControlled.value ? !!rawProps.opened : internal.value);
@@ -32581,7 +32631,7 @@ var Menubar_default = /* @__PURE__ */ defineComponent({
32581
32631
  const setRootRef = (el) => {
32582
32632
  rootRef.value = el?.$el ?? el;
32583
32633
  };
32584
- const menubarId = useId();
32634
+ const menubarId = useId$1();
32585
32635
  const revision = ref(0);
32586
32636
  const [openIndexRef, setOpenIndex] = useUncontrolled({
32587
32637
  value: () => props.openIndex,
@@ -32845,7 +32895,7 @@ var MenubarMenu = /* @__PURE__ */ defineComponent({
32845
32895
  const props = __props;
32846
32896
  const attrs = useAttrs();
32847
32897
  const ctx = useMenubarContext();
32848
- const id = useId();
32898
+ const id = useId$1();
32849
32899
  const index = computed(() => props.__index);
32850
32900
  const opened = computed(() => ctx.openIndex !== null && index.value !== -1 && ctx.openIndex === index.value);
32851
32901
  /** Getters keep the provided object reactive without changing the shape consumers read. */
@@ -33675,7 +33725,7 @@ var ComboboxGroup_default = /* @__PURE__ */ defineComponent({
33675
33725
  const props = __props;
33676
33726
  const attrs = useAttrs();
33677
33727
  const ctx = useComboboxContext();
33678
- const id = useId(props.id);
33728
+ const id = useId$1(props.id);
33679
33729
  const groupStyles = computed(() => ctx.getStyles("group", {
33680
33730
  className: attrs.class,
33681
33731
  style: attrs.style
@@ -33767,7 +33817,7 @@ var ComboboxOption_default = /* @__PURE__ */ defineComponent({
33767
33817
  const props = __props;
33768
33818
  const attrs = useAttrs();
33769
33819
  const ctx = useComboboxContext();
33770
- const id = useId(props.id);
33820
+ const id = useId$1(props.id);
33771
33821
  /**
33772
33822
  * The consumer handlers are chained explicitly below, so they must not also reach the
33773
33823
  * element through the fallthrough attributes or they would fire twice.
@@ -33842,7 +33892,7 @@ var ComboboxOptions_default = /* @__PURE__ */ defineComponent({
33842
33892
  const props = __props;
33843
33893
  const attrs = useAttrs();
33844
33894
  const ctx = useComboboxContext();
33845
- const id = useId(props.id);
33895
+ const id = useId$1(props.id);
33846
33896
  onMounted(() => ctx.store.setListId(id.value));
33847
33897
  /**
33848
33898
  * The consumer handler is chained explicitly below, so it must not also reach the
@@ -35622,7 +35672,7 @@ var Select = Object.assign(/* @__PURE__ */ defineComponent({
35622
35672
  watch(() => search(), () => {
35623
35673
  if (props.selectFirstOptionOnChange) nextTick(combobox.selectFirstOption);
35624
35674
  });
35625
- const id = useId(attrs.id);
35675
+ const id = useId$1(attrs.id);
35626
35676
  function clear(event) {
35627
35677
  event?.stopPropagation();
35628
35678
  changeValue(null, null);
@@ -35925,7 +35975,7 @@ var Autocomplete = Object.assign(/* @__PURE__ */ defineComponent({
35925
35975
  watch(() => current(), () => {
35926
35976
  if (props.selectFirstOptionOnChange) nextTick(combobox.selectFirstOption);
35927
35977
  });
35928
- const id = useId(attrs.id);
35978
+ const id = useId$1(attrs.id);
35929
35979
  function clear(event) {
35930
35980
  event?.stopPropagation();
35931
35981
  change("");
@@ -37952,7 +38002,7 @@ var Cascader = Object.assign(/* @__PURE__ */ defineComponent({
37952
38002
  const emit = __emit;
37953
38003
  const slots = useSlots();
37954
38004
  const attrs = useAttrs();
37955
- const id = useId(attrs.id);
38005
+ const id = useId$1(attrs.id);
37956
38006
  const internalValue = ref(props.defaultValue ?? null);
37957
38007
  const currentValue = computed(() => props.modelValue !== void 0 ? props.modelValue : internalValue.value);
37958
38008
  const pathOptions = computed(() => getCascaderPathOptions(props.data, currentValue.value));