@refineui/react 0.1.1 → 0.1.2

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.js CHANGED
@@ -11324,25 +11324,222 @@ import {
11324
11324
  createContext as createContext21,
11325
11325
  useCallback as useCallback17,
11326
11326
  useContext as useContext23,
11327
- useEffect as useEffect15,
11327
+ useEffect as useEffect16,
11328
11328
  useId as useId14,
11329
11329
  useMemo as useMemo17,
11330
11330
  useRef as useRef17,
11331
- useState as useState21
11331
+ useState as useState22
11332
11332
  } from "react";
11333
- import { spacings as spacings5, strokeWidths as strokeWidths2 } from "@refineui/tokens";
11333
+ import { borderRadii, spacings as spacings6 } from "@refineui/tokens";
11334
11334
  import { resolveColorTokenValue as resolveColorTokenValue10 } from "@refineui/utilities/color";
11335
11335
  import { Slot as Slot4, getMergeableTriggerChild as getMergeableTriggerChild3 } from "@refineui/utilities/react";
11336
11336
 
11337
+ // src/components/shared/FloatingSurface.tsx
11338
+ import { useEffect as useEffect15, useLayoutEffect as useLayoutEffect9, useState as useState21 } from "react";
11339
+ import { spacings as spacings5, strokeWidths as strokeWidths2 } from "@refineui/tokens";
11340
+
11341
+ // src/components/shared/floatingOutline.ts
11342
+ var PATH_PRECISION = 100;
11343
+ function fmt(n) {
11344
+ return String(Math.round(n * PATH_PRECISION) / PATH_PRECISION);
11345
+ }
11346
+ function pt(p) {
11347
+ return `${fmt(p.x)} ${fmt(p.y)}`;
11348
+ }
11349
+ function towards(from, to, distance) {
11350
+ const length = Math.hypot(to.x - from.x, to.y - from.y);
11351
+ if (length === 0) return from;
11352
+ const t = distance / length;
11353
+ return { x: from.x + (to.x - from.x) * t, y: from.y + (to.y - from.y) * t };
11354
+ }
11355
+ function floatingShapeSize(panelWidth, panelHeight, side, beakHeight) {
11356
+ const vertical = side === "top" || side === "bottom";
11357
+ return {
11358
+ width: vertical ? panelWidth : panelWidth + beakHeight,
11359
+ height: vertical ? panelHeight + beakHeight : panelHeight
11360
+ };
11361
+ }
11362
+ function resolveBeakCenter(edgeLength, align, beakWidth, radius2, insetStart, insetEnd) {
11363
+ const half = beakWidth / 2;
11364
+ const min = radius2 + half;
11365
+ const max = edgeLength - radius2 - half;
11366
+ if (max < min) return edgeLength / 2;
11367
+ const wanted = align === "center" ? edgeLength / 2 : align === "start" ? insetStart + half : edgeLength - insetEnd - half;
11368
+ return Math.min(max, Math.max(min, wanted));
11369
+ }
11370
+ function buildFloatingOutline({
11371
+ panelWidth,
11372
+ panelHeight,
11373
+ radius: radius2,
11374
+ side,
11375
+ beakCenter,
11376
+ beakWidth,
11377
+ beakHeight,
11378
+ tipRadius,
11379
+ inset = 0
11380
+ }) {
11381
+ const offsetX = side === "left" ? beakHeight : 0;
11382
+ const offsetY = side === "top" ? beakHeight : 0;
11383
+ const x0 = offsetX + inset;
11384
+ const y0 = offsetY + inset;
11385
+ const x1 = offsetX + panelWidth - inset;
11386
+ const y1 = offsetY + panelHeight - inset;
11387
+ const r = Math.max(0, Math.min(radius2 - inset, (x1 - x0) / 2, (y1 - y0) / 2));
11388
+ const half = beakWidth / 2;
11389
+ const sinHalfAngle = half / Math.hypot(half, beakHeight);
11390
+ const reach = beakHeight + inset - inset / sinHalfAngle;
11391
+ const spread = half * reach / beakHeight;
11392
+ const edgeCenter = (side === "top" || side === "bottom" ? offsetX : offsetY) + beakCenter;
11393
+ const beak = (first, tip, second) => {
11394
+ const before = towards(tip, first, tipRadius);
11395
+ const after = towards(tip, second, tipRadius);
11396
+ return ` L ${pt(first)} L ${pt(before)} Q ${pt(tip)} ${pt(after)} L ${pt(second)}`;
11397
+ };
11398
+ let d = `M ${pt({ x: x0 + r, y: y0 })}`;
11399
+ if (side === "top") {
11400
+ d += beak(
11401
+ { x: edgeCenter - spread, y: y0 },
11402
+ { x: edgeCenter, y: y0 - reach },
11403
+ { x: edgeCenter + spread, y: y0 }
11404
+ );
11405
+ }
11406
+ d += ` L ${pt({ x: x1 - r, y: y0 })} A ${fmt(r)} ${fmt(r)} 0 0 1 ${pt({ x: x1, y: y0 + r })}`;
11407
+ if (side === "right") {
11408
+ d += beak(
11409
+ { x: x1, y: edgeCenter - spread },
11410
+ { x: x1 + reach, y: edgeCenter },
11411
+ { x: x1, y: edgeCenter + spread }
11412
+ );
11413
+ }
11414
+ d += ` L ${pt({ x: x1, y: y1 - r })} A ${fmt(r)} ${fmt(r)} 0 0 1 ${pt({ x: x1 - r, y: y1 })}`;
11415
+ if (side === "bottom") {
11416
+ d += beak(
11417
+ { x: edgeCenter + spread, y: y1 },
11418
+ { x: edgeCenter, y: y1 + reach },
11419
+ { x: edgeCenter - spread, y: y1 }
11420
+ );
11421
+ }
11422
+ d += ` L ${pt({ x: x0 + r, y: y1 })} A ${fmt(r)} ${fmt(r)} 0 0 1 ${pt({ x: x0, y: y1 - r })}`;
11423
+ if (side === "left") {
11424
+ d += beak(
11425
+ { x: x0, y: edgeCenter + spread },
11426
+ { x: x0 - reach, y: edgeCenter },
11427
+ { x: x0, y: edgeCenter - spread }
11428
+ );
11429
+ }
11430
+ d += ` L ${pt({ x: x0, y: y0 + r })} A ${fmt(r)} ${fmt(r)} 0 0 1 ${pt({ x: x0 + r, y: y0 })} Z`;
11431
+ return d;
11432
+ }
11433
+
11434
+ // src/components/shared/FloatingSurface.tsx
11435
+ import { jsx as jsx64, jsxs as jsxs24 } from "react/jsx-runtime";
11436
+ var useIsomorphicLayoutEffect6 = typeof document !== "undefined" ? useLayoutEffect9 : useEffect15;
11437
+ var SHADOW_BLEED = parseFloat(spacings5.sizeXXXLarge);
11438
+ var STROKE = parseFloat(strokeWidths2.strokeWidthThin);
11439
+ function usePanelSize(panelRef) {
11440
+ const [size, setSize] = useState21(null);
11441
+ useIsomorphicLayoutEffect6(() => {
11442
+ const panel = panelRef.current;
11443
+ if (!panel) return;
11444
+ const measure = () => {
11445
+ const style = getComputedStyle(panel);
11446
+ const next = { width: parseFloat(style.width), height: parseFloat(style.height) };
11447
+ setSize((prev) => prev && prev.width === next.width && prev.height === next.height ? prev : next);
11448
+ };
11449
+ measure();
11450
+ if (typeof ResizeObserver === "undefined") return;
11451
+ const observer = new ResizeObserver(measure);
11452
+ observer.observe(panel);
11453
+ return () => observer.disconnect();
11454
+ }, [panelRef]);
11455
+ return size;
11456
+ }
11457
+ function FloatingSurface({
11458
+ panelRef,
11459
+ side,
11460
+ align,
11461
+ radius: radius2,
11462
+ beakWidth,
11463
+ beakHeight,
11464
+ tipRadius,
11465
+ beakInsetStart,
11466
+ beakInsetEnd,
11467
+ backgroundColor,
11468
+ borderColor
11469
+ }) {
11470
+ const size = usePanelSize(panelRef);
11471
+ if (!size) return null;
11472
+ const r = parseFloat(radius2);
11473
+ const bw = parseFloat(beakWidth);
11474
+ const bh = parseFloat(beakHeight);
11475
+ const vertical = side === "top" || side === "bottom";
11476
+ const beakCenter = resolveBeakCenter(
11477
+ vertical ? size.width : size.height,
11478
+ align,
11479
+ bw,
11480
+ r,
11481
+ parseFloat(beakInsetStart),
11482
+ parseFloat(beakInsetEnd)
11483
+ );
11484
+ const geometry = {
11485
+ panelWidth: size.width,
11486
+ panelHeight: size.height,
11487
+ radius: r,
11488
+ side,
11489
+ beakCenter,
11490
+ beakWidth: bw,
11491
+ beakHeight: bh,
11492
+ tipRadius: parseFloat(tipRadius)
11493
+ };
11494
+ const shape = buildFloatingOutline(geometry);
11495
+ const outline = buildFloatingOutline({ ...geometry, inset: STROKE / 2 });
11496
+ const box = floatingShapeSize(size.width, size.height, side, bh);
11497
+ const holeSvg = `<svg xmlns="http://www.w3.org/2000/svg" width="${box.width + SHADOW_BLEED * 2}" height="${box.height + SHADOW_BLEED * 2}"><path transform="translate(${SHADOW_BLEED} ${SHADOW_BLEED})" d="${shape}"/></svg>`;
11498
+ const holeMask = `linear-gradient(#000 0 0), url("data:image/svg+xml,${encodeURIComponent(holeSvg)}")`;
11499
+ const rootStyle = {
11500
+ width: box.width,
11501
+ height: box.height,
11502
+ top: side === "top" ? -bh : 0,
11503
+ left: side === "left" ? -bh : 0
11504
+ };
11505
+ const shadowStyle = {
11506
+ inset: -SHADOW_BLEED,
11507
+ maskImage: holeMask,
11508
+ WebkitMaskImage: holeMask,
11509
+ maskComposite: "exclude",
11510
+ WebkitMaskComposite: "xor",
11511
+ maskSize: "100% 100%",
11512
+ WebkitMaskSize: "100% 100%",
11513
+ maskRepeat: "no-repeat",
11514
+ WebkitMaskRepeat: "no-repeat"
11515
+ };
11516
+ const clip = `path("${shape}")`;
11517
+ return /* @__PURE__ */ jsxs24("div", { "data-refineui": "floating-chrome", "aria-hidden": true, className: "pointer-events-none absolute -z-1", style: rootStyle, children: [
11518
+ /* @__PURE__ */ jsx64("div", { className: "absolute", style: shadowStyle, children: /* @__PURE__ */ jsx64("div", { "data-refineui": "floating-shadow", className: "absolute", style: { inset: SHADOW_BLEED }, children: /* @__PURE__ */ jsx64("div", { className: "absolute inset-0", style: { clipPath: clip, backgroundColor: borderColor } }) }) }),
11519
+ /* @__PURE__ */ jsx64("div", { "data-refineui": "floating-surface", className: "absolute inset-0", style: { clipPath: clip, backgroundColor } }),
11520
+ /* @__PURE__ */ jsx64(
11521
+ "svg",
11522
+ {
11523
+ "data-refineui": "floating-outline",
11524
+ className: "absolute inset-0 overflow-visible",
11525
+ width: box.width,
11526
+ height: box.height,
11527
+ viewBox: `0 0 ${box.width} ${box.height}`,
11528
+ fill: "none",
11529
+ children: /* @__PURE__ */ jsx64("path", { d: outline, stroke: borderColor, strokeWidth: STROKE, strokeLinejoin: "round" })
11530
+ }
11531
+ )
11532
+ ] });
11533
+ }
11534
+
11337
11535
  // src/components/PopOver/style.ts
11338
11536
  var popoverStyles = {
11339
11537
  root: "relative inline-block",
11340
11538
  fallbackTrigger: "cursor-pointer border-none bg-transparent p-0 font-inherit text-inherit",
11341
11539
  floatingRoot: "absolute z-refineui-popup",
11342
11540
  panelWrap: "relative inline-block min-w-refineui-popover-panel-width",
11343
- beakWrap: "pointer-events-none absolute z-[1]",
11344
- panel: "relative z-0 box-border min-w-refineui-popover-panel-width rounded-refineui-xx-large border-refineui-thin outline-none",
11345
- panelShadowDefault: "shadow-refineui-8"
11541
+ /** Fill, stroke, and shadow come from `FloatingSurface`; the transparent border keeps the box size. */
11542
+ panel: "relative z-0 box-border min-w-refineui-popover-panel-width rounded-refineui-xx-large border-refineui-thin border-transparent outline-none"
11346
11543
  };
11347
11544
  function popoverFloatingClasses(placement, align) {
11348
11545
  if (placement === "bottom") {
@@ -11366,58 +11563,22 @@ function popoverFloatingClasses(placement, align) {
11366
11563
  }
11367
11564
 
11368
11565
  // src/components/PopOver/PopOver.tsx
11369
- import { jsx as jsx64, jsxs as jsxs24 } from "react/jsx-runtime";
11566
+ import { jsx as jsx65, jsxs as jsxs25 } from "react/jsx-runtime";
11370
11567
  var PopoverContext = createContext21(null);
11371
11568
  function usePopoverContext(component) {
11372
11569
  const ctx = useContext23(PopoverContext);
11373
11570
  if (!ctx) throw new Error(`${component} must be used within <Popover>`);
11374
11571
  return ctx;
11375
11572
  }
11376
- var BEAK_W = foundationSizes.foundationSize160;
11377
- var BEAK_H = foundationSizes.foundationSize80;
11378
- var BEAK_OFFSET = foundationSizes.foundationSize80;
11379
- var BEAK_BORDER_OVERLAP = strokeWidths2.strokeWidthThin;
11380
- var POPOVER_GAP = spacings5.sizeMedium;
11381
- function beakWrapperStyle(placement, align) {
11382
- const insetStart = componentSizes2.popoverBeakInsetFromStartEdge;
11383
- const insetEnd = componentSizes2.popoverBeakInsetFromEndEdge;
11384
- const edge = spacings5.sizeMedium;
11385
- const overlapOffset = `calc(-1 * ${BEAK_OFFSET} + ${BEAK_BORDER_OVERLAP})`;
11386
- switch (placement) {
11387
- case "bottom":
11388
- if (align === "center") return { top: overlapOffset, left: `calc(50% - ${BEAK_W} / 2)` };
11389
- if (align === "start") return { top: overlapOffset, left: insetStart };
11390
- return { top: overlapOffset, right: insetEnd };
11391
- case "top":
11392
- if (align === "center") return { bottom: overlapOffset, left: `calc(50% - ${BEAK_W} / 2)` };
11393
- if (align === "start") return { bottom: overlapOffset, left: insetStart };
11394
- return { bottom: overlapOffset, right: insetEnd };
11395
- case "left":
11396
- if (align === "center") return { right: overlapOffset, top: `calc(50% - ${BEAK_W} / 2)` };
11397
- if (align === "start") return { right: overlapOffset, top: edge };
11398
- return { right: overlapOffset, bottom: edge };
11399
- case "right":
11400
- if (align === "center") return { left: overlapOffset, top: `calc(50% - ${BEAK_W} / 2)` };
11401
- if (align === "start") return { left: overlapOffset, top: edge };
11402
- return { left: overlapOffset, bottom: edge };
11403
- default:
11404
- return {};
11405
- }
11406
- }
11407
- function beakRotateDeg(placement) {
11408
- switch (placement) {
11409
- case "bottom":
11410
- return 0;
11411
- case "top":
11412
- return 180;
11413
- case "left":
11414
- return -90;
11415
- case "right":
11416
- return 90;
11417
- default:
11418
- return 0;
11419
- }
11420
- }
11573
+ var BEAK_TIP_GAP = spacings6.sizeXXSmall;
11574
+ var POPOVER_GAP = `calc(${componentSizes2.popoverBeakHeight} + ${BEAK_TIP_GAP})`;
11575
+ var SIDE_BEAK_INSET = spacings6.sizeMedium;
11576
+ var beakSideByPlacement = {
11577
+ bottom: "top",
11578
+ top: "bottom",
11579
+ left: "right",
11580
+ right: "left"
11581
+ };
11421
11582
  function floatingGapStyle(placement) {
11422
11583
  if (placement === "top") return { marginBottom: POPOVER_GAP };
11423
11584
  if (placement === "bottom") return { marginTop: POPOVER_GAP };
@@ -11425,7 +11586,7 @@ function floatingGapStyle(placement) {
11425
11586
  return { marginLeft: POPOVER_GAP };
11426
11587
  }
11427
11588
  function Popover({ children, className, open: openProp, defaultOpen = false, onOpenChange, ...props }) {
11428
- const [internalOpen, setInternalOpen] = useState21(defaultOpen);
11589
+ const [internalOpen, setInternalOpen] = useState22(defaultOpen);
11429
11590
  const open = openProp ?? internalOpen;
11430
11591
  const setOpen = useCallback17(
11431
11592
  (next) => {
@@ -11439,14 +11600,14 @@ function Popover({ children, className, open: openProp, defaultOpen = false, onO
11439
11600
  const contentRef = useRef17(null);
11440
11601
  const triggerRef = useRef17(null);
11441
11602
  const contentId = useId14();
11442
- useEffect15(() => {
11603
+ useEffect16(() => {
11443
11604
  const handler = (e) => {
11444
11605
  if (containerRef.current && !containerRef.current.contains(e.target)) setOpen(false);
11445
11606
  };
11446
11607
  if (open) document.addEventListener("mousedown", handler);
11447
11608
  return () => document.removeEventListener("mousedown", handler);
11448
11609
  }, [open, setOpen]);
11449
- useEffect15(() => {
11610
+ useEffect16(() => {
11450
11611
  const onKey = (e) => {
11451
11612
  if (e instanceof KeyboardEvent && e.key === "Escape") setOpen(false);
11452
11613
  };
@@ -11475,7 +11636,7 @@ function Popover({ children, className, open: openProp, defaultOpen = false, onO
11475
11636
  }),
11476
11637
  [open, setOpen, toggle, contentId, onTriggerKeyDown]
11477
11638
  );
11478
- return /* @__PURE__ */ jsx64(PopoverContext.Provider, { value, children: /* @__PURE__ */ jsx64(
11639
+ return /* @__PURE__ */ jsx65(PopoverContext.Provider, { value, children: /* @__PURE__ */ jsx65(
11479
11640
  "div",
11480
11641
  {
11481
11642
  ref: containerRef,
@@ -11491,7 +11652,7 @@ function PopoverTrigger({ children, className, ...props }) {
11491
11652
  const mergeEl = getMergeableTriggerChild3(children);
11492
11653
  if (mergeEl) {
11493
11654
  const passthrough = props;
11494
- return /* @__PURE__ */ jsx64(
11655
+ return /* @__PURE__ */ jsx65(
11495
11656
  Slot4,
11496
11657
  {
11497
11658
  ref: triggerRef,
@@ -11513,7 +11674,7 @@ function PopoverTrigger({ children, className, ...props }) {
11513
11674
  );
11514
11675
  }
11515
11676
  const passthroughBtn = props;
11516
- return /* @__PURE__ */ jsx64(
11677
+ return /* @__PURE__ */ jsx65(
11517
11678
  "button",
11518
11679
  {
11519
11680
  type: "button",
@@ -11552,11 +11713,10 @@ function PopoverContent({
11552
11713
  const palette = componentColorTokens.popover.default;
11553
11714
  const bg = resolveColorTokenValue10(palette.background);
11554
11715
  const borderCol = resolveColorTokenValue10(palette.border);
11555
- const bw = beakWrapperStyle(placement, align);
11556
- const rot = beakRotateDeg(placement);
11557
11716
  const gapStyle = floatingGapStyle(placement);
11717
+ const vertical = placement === "top" || placement === "bottom";
11558
11718
  if (!open) return null;
11559
- return /* @__PURE__ */ jsx64(
11719
+ return /* @__PURE__ */ jsx65(
11560
11720
  "div",
11561
11721
  {
11562
11722
  className: clsx85(
@@ -11564,34 +11724,8 @@ function PopoverContent({
11564
11724
  popoverFloatingClasses(placement, align)
11565
11725
  ),
11566
11726
  style: gapStyle,
11567
- children: /* @__PURE__ */ jsxs24("div", { className: popoverStyles.panelWrap, children: [
11568
- /* @__PURE__ */ jsx64("div", { className: popoverStyles.beakWrap, style: { ...bw, width: BEAK_W, height: BEAK_H }, "aria-hidden": true, children: /* @__PURE__ */ jsx64(
11569
- "div",
11570
- {
11571
- style: {
11572
- width: BEAK_W,
11573
- height: BEAK_H,
11574
- transform: `rotate(${rot}deg)`,
11575
- transformOrigin: "center center"
11576
- },
11577
- children: /* @__PURE__ */ jsxs24(
11578
- "svg",
11579
- {
11580
- width: BEAK_W,
11581
- height: BEAK_H,
11582
- viewBox: "0 0 16 8",
11583
- fill: "none",
11584
- xmlns: "http://www.w3.org/2000/svg",
11585
- style: { display: "block" },
11586
- children: [
11587
- /* @__PURE__ */ jsx64("polygon", { points: "8,0 0,8 16,8", fill: borderCol }),
11588
- /* @__PURE__ */ jsx64("polygon", { points: "8,2 2,8 14,8", fill: bg })
11589
- ]
11590
- }
11591
- )
11592
- }
11593
- ) }),
11594
- /* @__PURE__ */ jsx64(
11727
+ children: /* @__PURE__ */ jsxs25("div", { className: popoverStyles.panelWrap, children: [
11728
+ /* @__PURE__ */ jsx65(
11595
11729
  "div",
11596
11730
  {
11597
11731
  ref: contentRef,
@@ -11602,22 +11736,32 @@ function PopoverContent({
11602
11736
  "data-refineui": "popover",
11603
11737
  "data-placement": placement,
11604
11738
  "data-align": align,
11605
- className: clsx85(
11606
- popoverStyles.panel,
11607
- popoverStyles.panelShadowDefault,
11608
- className
11609
- ),
11739
+ className: clsx85(popoverStyles.panel, className),
11610
11740
  style: {
11611
11741
  ...styleProp && typeof styleProp === "object" ? styleProp : {},
11612
11742
  minWidth: componentSizes2.popoverPanelWidth,
11613
- padding: spacings5.sizeLarge,
11614
- backgroundColor: bg,
11615
- color: resolveColorTokenValue10(palette.foreground),
11616
- borderColor: borderCol
11743
+ padding: spacings6.sizeLarge,
11744
+ color: resolveColorTokenValue10(palette.foreground)
11617
11745
  },
11618
11746
  ...props,
11619
11747
  children
11620
11748
  }
11749
+ ),
11750
+ /* @__PURE__ */ jsx65(
11751
+ FloatingSurface,
11752
+ {
11753
+ panelRef: contentRef,
11754
+ side: beakSideByPlacement[placement],
11755
+ align,
11756
+ radius: borderRadii.roundedXXLarge,
11757
+ beakWidth: componentSizes2.popoverBeakWidth,
11758
+ beakHeight: componentSizes2.popoverBeakHeight,
11759
+ tipRadius: componentSizes2.popoverBeakTipRadius,
11760
+ beakInsetStart: vertical ? componentSizes2.popoverBeakInsetFromStartEdge : SIDE_BEAK_INSET,
11761
+ beakInsetEnd: vertical ? componentSizes2.popoverBeakInsetFromEndEdge : SIDE_BEAK_INSET,
11762
+ backgroundColor: bg,
11763
+ borderColor: borderCol
11764
+ }
11621
11765
  )
11622
11766
  ] })
11623
11767
  }
@@ -11631,9 +11775,9 @@ function PopOver({
11631
11775
  className,
11632
11776
  ...props
11633
11777
  }) {
11634
- return /* @__PURE__ */ jsxs24(Popover, { className, ...props, children: [
11635
- /* @__PURE__ */ jsx64(PopoverTrigger, { children: trigger }),
11636
- /* @__PURE__ */ jsx64(PopoverContent, { placement, align, children: content })
11778
+ return /* @__PURE__ */ jsxs25(Popover, { className, ...props, children: [
11779
+ /* @__PURE__ */ jsx65(PopoverTrigger, { children: trigger }),
11780
+ /* @__PURE__ */ jsx65(PopoverContent, { placement, align, children: content })
11637
11781
  ] });
11638
11782
  }
11639
11783
 
@@ -11649,7 +11793,7 @@ var skeletonStyles = {
11649
11793
  };
11650
11794
 
11651
11795
  // src/components/Skeleton/Skeleton.tsx
11652
- import { jsx as jsx65 } from "react/jsx-runtime";
11796
+ import { jsx as jsx66 } from "react/jsx-runtime";
11653
11797
  function Skeleton({
11654
11798
  width,
11655
11799
  height,
@@ -11681,7 +11825,7 @@ function Skeleton({
11681
11825
  w = width ?? "100%";
11682
11826
  }
11683
11827
  const dimStyle = { width: w, height: h };
11684
- return /* @__PURE__ */ jsx65(
11828
+ return /* @__PURE__ */ jsx66(
11685
11829
  "div",
11686
11830
  {
11687
11831
  "data-refineui": "skeleton",
@@ -11699,7 +11843,7 @@ function Skeleton({
11699
11843
 
11700
11844
  // src/components/Slider/Slider.tsx
11701
11845
  import { clsx as clsx87 } from "clsx";
11702
- import { useState as useState22 } from "react";
11846
+ import { useState as useState23 } from "react";
11703
11847
 
11704
11848
  // src/components/Slider/style.ts
11705
11849
  var sliderStyles = {
@@ -11707,7 +11851,7 @@ var sliderStyles = {
11707
11851
  };
11708
11852
 
11709
11853
  // src/components/Slider/Slider.tsx
11710
- import { jsx as jsx66 } from "react/jsx-runtime";
11854
+ import { jsx as jsx67 } from "react/jsx-runtime";
11711
11855
  function clampPct(n) {
11712
11856
  if (Number.isNaN(n)) return 0;
11713
11857
  return Math.min(100, Math.max(0, n));
@@ -11725,12 +11869,12 @@ function Slider({
11725
11869
  style,
11726
11870
  ...props
11727
11871
  }) {
11728
- const [internalFillPct, setInternalFillPct] = useState22(() => {
11872
+ const [internalFillPct, setInternalFillPct] = useState23(() => {
11729
11873
  const v = defaultValue !== void 0 ? Number(defaultValue) : (min + max) / 2;
11730
11874
  return clampPct((v - min) / (max - min) * 100);
11731
11875
  });
11732
11876
  const fillPct = value !== void 0 ? clampPct((Number(value) - min) / (max - min) * 100) : internalFillPct;
11733
- return /* @__PURE__ */ jsx66(
11877
+ return /* @__PURE__ */ jsx67(
11734
11878
  "input",
11735
11879
  {
11736
11880
  type: "range",
@@ -11775,11 +11919,11 @@ import {
11775
11919
  isValidElement as isValidElement5,
11776
11920
  useCallback as useCallback18,
11777
11921
  useContext as useContext24,
11778
- useEffect as useEffect16,
11779
- useLayoutEffect as useLayoutEffect9,
11922
+ useEffect as useEffect17,
11923
+ useLayoutEffect as useLayoutEffect10,
11780
11924
  useMemo as useMemo18,
11781
11925
  useRef as useRef18,
11782
- useState as useState23
11926
+ useState as useState24
11783
11927
  } from "react";
11784
11928
 
11785
11929
  // src/components/Carousel/style.ts
@@ -11812,7 +11956,7 @@ var carouselStyles = {
11812
11956
  };
11813
11957
 
11814
11958
  // src/components/Carousel/Carousel.tsx
11815
- import { jsx as jsx67, jsxs as jsxs25 } from "react/jsx-runtime";
11959
+ import { jsx as jsx68, jsxs as jsxs26 } from "react/jsx-runtime";
11816
11960
  var DRAG_COMMIT_RATIO = 0.18;
11817
11961
  var CarouselContext = createContext22(null);
11818
11962
  function useCarouselContext(component) {
@@ -11835,10 +11979,10 @@ function Carousel({
11835
11979
  ...props
11836
11980
  }) {
11837
11981
  const isControlled = indexControlled !== void 0;
11838
- const [internalIndex, setInternalIndex] = useState23(defaultIndex);
11839
- const [count, setCount] = useState23(0);
11840
- const [trackIndex, setTrackIndex] = useState23(defaultIndex);
11841
- const [instant, setInstant] = useState23(false);
11982
+ const [internalIndex, setInternalIndex] = useState24(defaultIndex);
11983
+ const [count, setCount] = useState24(0);
11984
+ const [trackIndex, setTrackIndex] = useState24(defaultIndex);
11985
+ const [instant, setInstant] = useState24(false);
11842
11986
  const index = isControlled ? indexControlled : internalIndex;
11843
11987
  const loopActive = loop && count > 1;
11844
11988
  const commitLogical = useCallback18(
@@ -11849,13 +11993,13 @@ function Carousel({
11849
11993
  },
11850
11994
  [count, isControlled, onIndexChange]
11851
11995
  );
11852
- useLayoutEffect9(() => {
11996
+ useLayoutEffect10(() => {
11853
11997
  if (count <= 0) return;
11854
11998
  const logical = clampIndex(index, count);
11855
11999
  if (logical !== index) commitLogical(logical);
11856
12000
  setTrackIndex(loopActive ? logical + 1 : logical);
11857
12001
  }, [count, loopActive]);
11858
- useEffect16(() => {
12002
+ useEffect17(() => {
11859
12003
  if (count <= 0) return;
11860
12004
  if (!loopActive) {
11861
12005
  setTrackIndex(clampIndex(index, count));
@@ -11975,7 +12119,7 @@ function Carousel({
11975
12119
  break;
11976
12120
  }
11977
12121
  };
11978
- return /* @__PURE__ */ jsx67(CarouselContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx67(
12122
+ return /* @__PURE__ */ jsx68(CarouselContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx68(
11979
12123
  "div",
11980
12124
  {
11981
12125
  "data-refineui": "carousel",
@@ -12001,11 +12145,11 @@ function CarouselContent({ className, children, ...props }) {
12001
12145
  } = useCarouselContext("CarouselContent");
12002
12146
  const viewportRef = useRef18(null);
12003
12147
  const dragStartX = useRef18(null);
12004
- const [dragPx, setDragPx] = useState23(0);
12005
- const [dragging, setDragging] = useState23(false);
12148
+ const [dragPx, setDragPx] = useState24(0);
12149
+ const [dragging, setDragging] = useState24(false);
12006
12150
  const slides = Children6.toArray(children).filter(isValidElement5);
12007
12151
  const slideCount = slides.length;
12008
- useEffect16(() => {
12152
+ useEffect17(() => {
12009
12153
  setCount(slideCount);
12010
12154
  }, [setCount, slideCount]);
12011
12155
  const trackSlides = loop && slides.length > 1 ? [
@@ -12062,7 +12206,7 @@ function CarouselContent({ className, children, ...props }) {
12062
12206
  };
12063
12207
  const animated = !dragging && !instant;
12064
12208
  const transform = dragPx !== 0 ? `translate3d(calc(-${trackIndex * 100}% + ${dragPx}px), 0, 0)` : `translate3d(-${trackIndex * 100}%, 0, 0)`;
12065
- return /* @__PURE__ */ jsx67(
12209
+ return /* @__PURE__ */ jsx68(
12066
12210
  "div",
12067
12211
  {
12068
12212
  ref: viewportRef,
@@ -12073,7 +12217,7 @@ function CarouselContent({ className, children, ...props }) {
12073
12217
  onPointerMove,
12074
12218
  onPointerUp,
12075
12219
  onPointerCancel,
12076
- children: /* @__PURE__ */ jsx67(
12220
+ children: /* @__PURE__ */ jsx68(
12077
12221
  "div",
12078
12222
  {
12079
12223
  "data-refineui": "carousel-track",
@@ -12090,7 +12234,7 @@ function CarouselContent({ className, children, ...props }) {
12090
12234
  }
12091
12235
  var CarouselItem = forwardRef15(function CarouselItem2({ className, children, ...props }, ref) {
12092
12236
  useCarouselContext("CarouselItem");
12093
- return /* @__PURE__ */ jsx67(
12237
+ return /* @__PURE__ */ jsx68(
12094
12238
  "div",
12095
12239
  {
12096
12240
  ref,
@@ -12105,12 +12249,12 @@ var CarouselItem = forwardRef15(function CarouselItem2({ className, children, ..
12105
12249
  });
12106
12250
  function CarouselControls({ className, children, ...props }) {
12107
12251
  useCarouselContext("CarouselControls");
12108
- return /* @__PURE__ */ jsx67("div", { "data-refineui": "carousel-controls", className: clsx89(carouselStyles.controls, className), ...props, children });
12252
+ return /* @__PURE__ */ jsx68("div", { "data-refineui": "carousel-controls", className: clsx89(carouselStyles.controls, className), ...props, children });
12109
12253
  }
12110
12254
  function CarouselPrevious({ className, disabled, onClick, ...props }) {
12111
12255
  const { scrollPrev, canScrollPrev } = useCarouselContext("CarouselPrevious");
12112
12256
  const isDisabled = disabled || !canScrollPrev;
12113
- return /* @__PURE__ */ jsx67(
12257
+ return /* @__PURE__ */ jsx68(
12114
12258
  Button,
12115
12259
  {
12116
12260
  variant: "outline",
@@ -12126,7 +12270,7 @@ function CarouselPrevious({ className, disabled, onClick, ...props }) {
12126
12270
  onClick?.(e);
12127
12271
  if (!e.defaultPrevented && !isDisabled) scrollPrev();
12128
12272
  },
12129
- children: /* @__PURE__ */ jsx67(
12273
+ children: /* @__PURE__ */ jsx68(
12130
12274
  WebIcon,
12131
12275
  {
12132
12276
  name: "chevron-left",
@@ -12142,7 +12286,7 @@ function CarouselPrevious({ className, disabled, onClick, ...props }) {
12142
12286
  function CarouselNext({ className, disabled, onClick, ...props }) {
12143
12287
  const { scrollNext, canScrollNext } = useCarouselContext("CarouselNext");
12144
12288
  const isDisabled = disabled || !canScrollNext;
12145
- return /* @__PURE__ */ jsx67(
12289
+ return /* @__PURE__ */ jsx68(
12146
12290
  Button,
12147
12291
  {
12148
12292
  variant: "outline",
@@ -12158,7 +12302,7 @@ function CarouselNext({ className, disabled, onClick, ...props }) {
12158
12302
  onClick?.(e);
12159
12303
  if (!e.defaultPrevented && !isDisabled) scrollNext();
12160
12304
  },
12161
- children: /* @__PURE__ */ jsx67(
12305
+ children: /* @__PURE__ */ jsx68(
12162
12306
  WebIcon,
12163
12307
  {
12164
12308
  name: "chevron-right",
@@ -12174,7 +12318,7 @@ function CarouselNext({ className, disabled, onClick, ...props }) {
12174
12318
  function CarouselIndicators({ className, ...props }) {
12175
12319
  const { count, index, scrollTo } = useCarouselContext("CarouselIndicators");
12176
12320
  const trackRef = useRef18(null);
12177
- const [thumb, setThumb] = useState23({ width: 0, x: 0, ready: false });
12321
+ const [thumb, setThumb] = useState24({ width: 0, x: 0, ready: false });
12178
12322
  const updateThumb = useCallback18(() => {
12179
12323
  const el = trackRef.current;
12180
12324
  if (!el || count <= 0) {
@@ -12190,10 +12334,10 @@ function CarouselIndicators({ className, ...props }) {
12190
12334
  ready: true
12191
12335
  });
12192
12336
  }, [count, index]);
12193
- useLayoutEffect9(() => {
12337
+ useLayoutEffect10(() => {
12194
12338
  updateThumb();
12195
12339
  }, [updateThumb]);
12196
- useEffect16(() => {
12340
+ useEffect17(() => {
12197
12341
  const el = trackRef.current;
12198
12342
  if (!el) return;
12199
12343
  const ro = new ResizeObserver(() => updateThumb());
@@ -12205,7 +12349,7 @@ function CarouselIndicators({ className, ...props }) {
12205
12349
  width: thumb.width,
12206
12350
  transform: `translate3d(${thumb.x}px, 0, 0)`
12207
12351
  };
12208
- return /* @__PURE__ */ jsxs25(
12352
+ return /* @__PURE__ */ jsxs26(
12209
12353
  "div",
12210
12354
  {
12211
12355
  ref: trackRef,
@@ -12215,7 +12359,7 @@ function CarouselIndicators({ className, ...props }) {
12215
12359
  className: clsx89(carouselStyles.indicators, className),
12216
12360
  ...props,
12217
12361
  children: [
12218
- /* @__PURE__ */ jsx67(
12362
+ /* @__PURE__ */ jsx68(
12219
12363
  "span",
12220
12364
  {
12221
12365
  "data-refineui": "carousel-indicator-thumb",
@@ -12225,7 +12369,7 @@ function CarouselIndicators({ className, ...props }) {
12225
12369
  style: thumbStyle
12226
12370
  }
12227
12371
  ),
12228
- /* @__PURE__ */ jsx67("div", { "data-refineui": "carousel-indicator-hits", className: carouselStyles.indicatorHitRow, children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx67(
12372
+ /* @__PURE__ */ jsx68("div", { "data-refineui": "carousel-indicator-hits", className: carouselStyles.indicatorHitRow, children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx68(
12229
12373
  "button",
12230
12374
  {
12231
12375
  type: "button",
@@ -12316,7 +12460,7 @@ var bubbleContentVariantClass = {
12316
12460
  };
12317
12461
 
12318
12462
  // src/components/Bubble/Bubble.tsx
12319
- import { jsx as jsx68, jsxs as jsxs26 } from "react/jsx-runtime";
12463
+ import { jsx as jsx69, jsxs as jsxs27 } from "react/jsx-runtime";
12320
12464
  var BubbleContext = createContext23(null);
12321
12465
  function useBubbleContext(component) {
12322
12466
  const value = useContext25(BubbleContext);
@@ -12348,7 +12492,7 @@ function partitionBubbleChildren(children) {
12348
12492
  };
12349
12493
  }
12350
12494
  function BubbleGroup({ className, ...props }) {
12351
- return /* @__PURE__ */ jsx68(
12495
+ return /* @__PURE__ */ jsx69(
12352
12496
  "div",
12353
12497
  {
12354
12498
  "data-refineui": "bubble-group",
@@ -12367,7 +12511,7 @@ function Bubble({
12367
12511
  }) {
12368
12512
  const rootStyle = variant === "ghost" ? style : { maxWidth: BUBBLE_MAX_WIDTH, ...style };
12369
12513
  const { top, middle, bottom, hasTop, hasBottom } = partitionBubbleChildren(children);
12370
- return /* @__PURE__ */ jsx68(BubbleContext.Provider, { value: { variant, align }, children: /* @__PURE__ */ jsx68(
12514
+ return /* @__PURE__ */ jsx69(BubbleContext.Provider, { value: { variant, align }, children: /* @__PURE__ */ jsx69(
12371
12515
  "div",
12372
12516
  {
12373
12517
  "data-refineui": "bubble",
@@ -12382,7 +12526,7 @@ function Bubble({
12382
12526
  ),
12383
12527
  style: rootStyle,
12384
12528
  ...props,
12385
- children: /* @__PURE__ */ jsxs26("div", { "data-refineui": "bubble-surface", className: bubbleStyles.surface, children: [
12529
+ children: /* @__PURE__ */ jsxs27("div", { "data-refineui": "bubble-surface", className: bubbleStyles.surface, children: [
12386
12530
  middle,
12387
12531
  top,
12388
12532
  bottom
@@ -12392,7 +12536,7 @@ function Bubble({
12392
12536
  }
12393
12537
  function BubbleContent({ className, ...props }) {
12394
12538
  const { variant } = useBubbleContext("BubbleContent");
12395
- return /* @__PURE__ */ jsx68(
12539
+ return /* @__PURE__ */ jsx69(
12396
12540
  "div",
12397
12541
  {
12398
12542
  "data-refineui": "bubble-content",
@@ -12413,7 +12557,7 @@ function BubbleReactions({
12413
12557
  }) {
12414
12558
  const { align: bubbleAlign } = useBubbleContext("BubbleReactions");
12415
12559
  const align = alignProp ?? (bubbleAlign === "start" ? "end" : "start");
12416
- return /* @__PURE__ */ jsx68(
12560
+ return /* @__PURE__ */ jsx69(
12417
12561
  "div",
12418
12562
  {
12419
12563
  "data-refineui": "bubble-reactions",
@@ -12439,7 +12583,7 @@ import {
12439
12583
  useContext as useContext26,
12440
12584
  useMemo as useMemo19,
12441
12585
  useRef as useRef19,
12442
- useState as useState24
12586
+ useState as useState25
12443
12587
  } from "react";
12444
12588
 
12445
12589
  // src/components/Stepper/style.ts
@@ -12548,7 +12692,7 @@ var stepperConnectorVars = {
12548
12692
  };
12549
12693
 
12550
12694
  // src/components/Stepper/Stepper.tsx
12551
- import { jsx as jsx69, jsxs as jsxs27 } from "react/jsx-runtime";
12695
+ import { jsx as jsx70, jsxs as jsxs28 } from "react/jsx-runtime";
12552
12696
  var StepperContext = createContext24(null);
12553
12697
  var StepperItemContext = createContext24(null);
12554
12698
  var StepperListRegistryContext = createContext24(null);
@@ -12578,7 +12722,7 @@ function Stepper({
12578
12722
  ...props
12579
12723
  }) {
12580
12724
  const isControlled = valueControlled !== void 0;
12581
- const [internalValue, setInternalValue] = useState24(defaultValue);
12725
+ const [internalValue, setInternalValue] = useState25(defaultValue);
12582
12726
  const value = isControlled ? valueControlled : internalValue;
12583
12727
  const setValue = useCallback19(
12584
12728
  (next) => {
@@ -12596,7 +12740,7 @@ function Stepper({
12596
12740
  }),
12597
12741
  [value, setValue, orientation, onValueChange, isControlled]
12598
12742
  );
12599
- return /* @__PURE__ */ jsx69(StepperContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx69(
12743
+ return /* @__PURE__ */ jsx70(StepperContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx70(
12600
12744
  "div",
12601
12745
  {
12602
12746
  "data-refineui": "stepper",
@@ -12624,7 +12768,7 @@ function StepperList({ className, children, ...props }) {
12624
12768
  }),
12625
12769
  [value]
12626
12770
  );
12627
- return /* @__PURE__ */ jsx69(StepperListRegistryContext.Provider, { value: registry, children: /* @__PURE__ */ jsx69(
12771
+ return /* @__PURE__ */ jsx70(StepperListRegistryContext.Provider, { value: registry, children: /* @__PURE__ */ jsx70(
12628
12772
  "ol",
12629
12773
  {
12630
12774
  "data-refineui": "stepper-list",
@@ -12669,7 +12813,7 @@ function StepperItem({
12669
12813
  () => ({ state, disabled }),
12670
12814
  [state, disabled]
12671
12815
  );
12672
- return /* @__PURE__ */ jsx69(StepperItemContext.Provider, { value: itemCtx, children: /* @__PURE__ */ jsx69(
12816
+ return /* @__PURE__ */ jsx70(StepperItemContext.Provider, { value: itemCtx, children: /* @__PURE__ */ jsx70(
12673
12817
  "li",
12674
12818
  {
12675
12819
  "data-refineui": "stepper-item",
@@ -12697,7 +12841,7 @@ function StepperItem({
12697
12841
  function StepperIndicator({ className, children, ...props }) {
12698
12842
  const { state } = useStepperItemContext("StepperIndicator");
12699
12843
  const stateClass = state === "complete" ? stepperStyles.indicatorComplete : state === "current" ? stepperStyles.indicatorCurrent : stepperStyles.indicatorUpcoming;
12700
- const content = state === "upcoming" ? children : /* @__PURE__ */ jsx69(
12844
+ const content = state === "upcoming" ? children : /* @__PURE__ */ jsx70(
12701
12845
  WebIcon,
12702
12846
  {
12703
12847
  name: "checkmark",
@@ -12708,7 +12852,7 @@ function StepperIndicator({ className, children, ...props }) {
12708
12852
  className: "items-center justify-center"
12709
12853
  }
12710
12854
  );
12711
- return /* @__PURE__ */ jsx69(
12855
+ return /* @__PURE__ */ jsx70(
12712
12856
  "span",
12713
12857
  {
12714
12858
  "data-refineui": "stepper-indicator",
@@ -12723,7 +12867,7 @@ function StepperIndicator({ className, children, ...props }) {
12723
12867
  function StepperContent({ className, ...props }) {
12724
12868
  const { orientation } = useStepperContext("StepperContent");
12725
12869
  useStepperItemContext("StepperContent");
12726
- return /* @__PURE__ */ jsx69(
12870
+ return /* @__PURE__ */ jsx70(
12727
12871
  "div",
12728
12872
  {
12729
12873
  "data-refineui": "stepper-content",
@@ -12739,7 +12883,7 @@ function StepperContent({ className, ...props }) {
12739
12883
  function StepperTitle({ className, ...props }) {
12740
12884
  const { state } = useStepperItemContext("StepperTitle");
12741
12885
  const stateClass = state === "complete" ? stepperStyles.titleComplete : state === "current" ? stepperStyles.titleCurrent : stepperStyles.titleUpcoming;
12742
- return /* @__PURE__ */ jsx69(
12886
+ return /* @__PURE__ */ jsx70(
12743
12887
  "span",
12744
12888
  {
12745
12889
  "data-refineui": "stepper-title",
@@ -12752,7 +12896,7 @@ function StepperTitle({ className, ...props }) {
12752
12896
  function StepperDescription({ className, ...props }) {
12753
12897
  const { state } = useStepperItemContext("StepperDescription");
12754
12898
  const stateClass = state === "complete" ? stepperStyles.descriptionComplete : state === "current" ? stepperStyles.descriptionCurrent : stepperStyles.descriptionUpcoming;
12755
- return /* @__PURE__ */ jsx69(
12899
+ return /* @__PURE__ */ jsx70(
12756
12900
  "span",
12757
12901
  {
12758
12902
  "data-refineui": "stepper-description",
@@ -12767,7 +12911,7 @@ function StepperSeparator({ className, ...props }) {
12767
12911
  const registry = useContext26(StepperListRegistryContext);
12768
12912
  const state = registry?.takeSeparatorState() ?? "upcoming";
12769
12913
  const vertical = orientation === "vertical";
12770
- return /* @__PURE__ */ jsx69(
12914
+ return /* @__PURE__ */ jsx70(
12771
12915
  "li",
12772
12916
  {
12773
12917
  "data-refineui": "stepper-separator",
@@ -12781,7 +12925,7 @@ function StepperSeparator({ className, ...props }) {
12781
12925
  className
12782
12926
  ),
12783
12927
  ...props,
12784
- children: /* @__PURE__ */ jsxs27(
12928
+ children: /* @__PURE__ */ jsxs28(
12785
12929
  "span",
12786
12930
  {
12787
12931
  "data-refineui": "stepper-separator-rail",
@@ -12790,14 +12934,14 @@ function StepperSeparator({ className, ...props }) {
12790
12934
  vertical ? stepperStyles.separatorRailVertical : stepperStyles.separatorRailHorizontal
12791
12935
  ),
12792
12936
  children: [
12793
- /* @__PURE__ */ jsx69(
12937
+ /* @__PURE__ */ jsx70(
12794
12938
  "span",
12795
12939
  {
12796
12940
  "data-refineui": "stepper-separator-track",
12797
12941
  className: stepperStyles.separatorTrack
12798
12942
  }
12799
12943
  ),
12800
- /* @__PURE__ */ jsx69(
12944
+ /* @__PURE__ */ jsx70(
12801
12945
  "span",
12802
12946
  {
12803
12947
  "data-refineui": "stepper-separator-fill",
@@ -12830,10 +12974,10 @@ import {
12830
12974
  useCallback as useCallback20,
12831
12975
  useContext as useContext27,
12832
12976
  useId as useId15,
12833
- useLayoutEffect as useLayoutEffect10,
12977
+ useLayoutEffect as useLayoutEffect11,
12834
12978
  useMemo as useMemo20,
12835
12979
  useRef as useRef20,
12836
- useState as useState25
12980
+ useState as useState26
12837
12981
  } from "react";
12838
12982
 
12839
12983
  // src/components/Resizable/style.ts
@@ -12869,7 +13013,7 @@ var resizableStyles = {
12869
13013
  };
12870
13014
 
12871
13015
  // src/components/Resizable/Resizable.tsx
12872
- import { jsx as jsx70 } from "react/jsx-runtime";
13016
+ import { jsx as jsx71 } from "react/jsx-runtime";
12873
13017
  var KEYBOARD_STEP = 2;
12874
13018
  var KEYBOARD_STEP_LARGE = 10;
12875
13019
  var DEFAULT_SIZE = 50;
@@ -12939,7 +13083,7 @@ function ResizablePanelGroup({
12939
13083
  const groupRef = useRef20(null);
12940
13084
  const panelsRef = useRef20(/* @__PURE__ */ new Map());
12941
13085
  const orderCounterRef = useRef20(0);
12942
- const [sizes, setSizes] = useState25({});
13086
+ const [sizes, setSizes] = useState26({});
12943
13087
  const onLayoutRef = useRef20(onLayout);
12944
13088
  onLayoutRef.current = onLayout;
12945
13089
  const syncInitialSizes = useCallback20(() => {
@@ -13043,7 +13187,7 @@ function ResizablePanelGroup({
13043
13187
  },
13044
13188
  [emitPanelResize]
13045
13189
  );
13046
- useLayoutEffect10(() => {
13190
+ useLayoutEffect11(() => {
13047
13191
  const ids = orderedPanelIds(panelsRef.current);
13048
13192
  if (ids.length === 0) return;
13049
13193
  if (ids.some((id) => sizes[id] === void 0)) return;
@@ -13070,7 +13214,7 @@ function ResizablePanelGroup({
13070
13214
  setBetween
13071
13215
  ]
13072
13216
  );
13073
- return /* @__PURE__ */ jsx70(ResizableContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx70(
13217
+ return /* @__PURE__ */ jsx71(ResizableContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx71(
13074
13218
  "div",
13075
13219
  {
13076
13220
  ref: groupRef,
@@ -13102,7 +13246,7 @@ function ResizablePanel({
13102
13246
  const { orientation, sizes, registerPanel, unregisterPanel } = useResizableContext("ResizablePanel");
13103
13247
  const onResizeRef = useRef20(onResize);
13104
13248
  onResizeRef.current = onResize;
13105
- useLayoutEffect10(() => {
13249
+ useLayoutEffect11(() => {
13106
13250
  registerPanel({
13107
13251
  id,
13108
13252
  defaultSize,
@@ -13129,7 +13273,7 @@ function ResizablePanel({
13129
13273
  flexBasis: 0,
13130
13274
  ...orientation === "horizontal" ? { minWidth: `${minSize}%` } : { minHeight: `${minSize}%` }
13131
13275
  };
13132
- return /* @__PURE__ */ jsx70(
13276
+ return /* @__PURE__ */ jsx71(
13133
13277
  "div",
13134
13278
  {
13135
13279
  "data-refineui": "resizable-panel",
@@ -13161,10 +13305,10 @@ function ResizableHandle({
13161
13305
  setBetween
13162
13306
  } = useResizableContext("ResizableHandle");
13163
13307
  const handleRef = useRef20(null);
13164
- const [active, setActive] = useState25(false);
13165
- const [, setAdjacentReady] = useState25(false);
13308
+ const [active, setActive] = useState26(false);
13309
+ const [, setAdjacentReady] = useState26(false);
13166
13310
  const dragRef = useRef20(null);
13167
- useLayoutEffect10(() => {
13311
+ useLayoutEffect11(() => {
13168
13312
  setAdjacentReady(true);
13169
13313
  }, []);
13170
13314
  const adjacent = handleRef.current ? findAdjacentPanelIds(handleRef.current) : { leftId: null, rightId: null };
@@ -13274,7 +13418,7 @@ function ResizableHandle({
13274
13418
  resizeBetween(leftId, rightId, delta);
13275
13419
  queueMicrotask(keepFocus);
13276
13420
  };
13277
- return /* @__PURE__ */ jsx70(
13421
+ return /* @__PURE__ */ jsx71(
13278
13422
  "div",
13279
13423
  {
13280
13424
  ref: handleRef,
@@ -13304,7 +13448,7 @@ function ResizableHandle({
13304
13448
  onPointerUp: handlePointerUp,
13305
13449
  onPointerCancel: handlePointerUp,
13306
13450
  onKeyDown: handleKeyDown,
13307
- children: withHandle ? /* @__PURE__ */ jsx70(
13451
+ children: withHandle ? /* @__PURE__ */ jsx71(
13308
13452
  "span",
13309
13453
  {
13310
13454
  "aria-hidden": true,
@@ -13320,7 +13464,7 @@ function ResizableHandle({
13320
13464
 
13321
13465
  // src/components/SpinButton/SpinButton.tsx
13322
13466
  import { clsx as clsx96 } from "clsx";
13323
- import { useEffect as useEffect17, useState as useState26 } from "react";
13467
+ import { useEffect as useEffect18, useState as useState27 } from "react";
13324
13468
  import { iconSizes as iconSizes20 } from "@refineui/tokens";
13325
13469
 
13326
13470
  // src/components/SpinButton/style.ts
@@ -13344,7 +13488,7 @@ var spinButtonShellClass = formControlShellHeightClass;
13344
13488
  var spinButtonValueTypo = formControlTypoClass;
13345
13489
 
13346
13490
  // src/components/SpinButton/SpinButton.tsx
13347
- import { jsx as jsx71, jsxs as jsxs28 } from "react/jsx-runtime";
13491
+ import { jsx as jsx72, jsxs as jsxs29 } from "react/jsx-runtime";
13348
13492
  function SpinButton({
13349
13493
  value,
13350
13494
  onChange,
@@ -13358,8 +13502,8 @@ function SpinButton({
13358
13502
  onKeyDown,
13359
13503
  ...props
13360
13504
  }) {
13361
- const [draftValue, setDraftValue] = useState26(String(value));
13362
- useEffect17(() => {
13505
+ const [draftValue, setDraftValue] = useState27(String(value));
13506
+ useEffect18(() => {
13363
13507
  setDraftValue(String(value));
13364
13508
  }, [value]);
13365
13509
  const clampValue2 = (next) => {
@@ -13447,7 +13591,7 @@ function SpinButton({
13447
13591
  const atMax = max !== void 0 && value >= max;
13448
13592
  const atMin = min !== void 0 && value <= min;
13449
13593
  const borderClass = disabled ? spinButtonStyles.borderDisabled : spinButtonStyles.borderDefault;
13450
- return /* @__PURE__ */ jsxs28(
13594
+ return /* @__PURE__ */ jsxs29(
13451
13595
  "div",
13452
13596
  {
13453
13597
  role: "spinbutton",
@@ -13470,7 +13614,7 @@ function SpinButton({
13470
13614
  ...props,
13471
13615
  onKeyDown: handleKeyDown,
13472
13616
  children: [
13473
- /* @__PURE__ */ jsx71(
13617
+ /* @__PURE__ */ jsx72(
13474
13618
  "div",
13475
13619
  {
13476
13620
  "aria-live": "polite",
@@ -13481,7 +13625,7 @@ function SpinButton({
13481
13625
  disabled ? spinButtonStyles.valueTextDisabled : spinButtonStyles.valueTextDefault,
13482
13626
  disabled ? spinButtonStyles.bgDisabled : spinButtonStyles.bgDefault
13483
13627
  ),
13484
- children: /* @__PURE__ */ jsx71(
13628
+ children: /* @__PURE__ */ jsx72(
13485
13629
  "input",
13486
13630
  {
13487
13631
  type: "text",
@@ -13506,7 +13650,7 @@ function SpinButton({
13506
13650
  )
13507
13651
  }
13508
13652
  ),
13509
- /* @__PURE__ */ jsxs28(
13653
+ /* @__PURE__ */ jsxs29(
13510
13654
  "div",
13511
13655
  {
13512
13656
  className: clsx96(
@@ -13514,7 +13658,7 @@ function SpinButton({
13514
13658
  disabled ? spinButtonStyles.bgDisabled : spinButtonStyles.bgDefault
13515
13659
  ),
13516
13660
  children: [
13517
- /* @__PURE__ */ jsx71(
13661
+ /* @__PURE__ */ jsx72(
13518
13662
  "button",
13519
13663
  {
13520
13664
  type: "button",
@@ -13526,7 +13670,7 @@ function SpinButton({
13526
13670
  spinButtonStyles.stepButtonBase,
13527
13671
  disabled || atMax ? spinButtonStyles.stepButtonDisabled : spinButtonStyles.stepButtonEnabled
13528
13672
  ),
13529
- children: /* @__PURE__ */ jsx71(
13673
+ children: /* @__PURE__ */ jsx72(
13530
13674
  WebIcon,
13531
13675
  {
13532
13676
  name: "chevron-up",
@@ -13538,7 +13682,7 @@ function SpinButton({
13538
13682
  )
13539
13683
  }
13540
13684
  ),
13541
- /* @__PURE__ */ jsx71(
13685
+ /* @__PURE__ */ jsx72(
13542
13686
  "button",
13543
13687
  {
13544
13688
  type: "button",
@@ -13550,7 +13694,7 @@ function SpinButton({
13550
13694
  spinButtonStyles.stepButtonBase,
13551
13695
  disabled || atMin ? spinButtonStyles.stepButtonDisabled : spinButtonStyles.stepButtonEnabled
13552
13696
  ),
13553
- children: /* @__PURE__ */ jsx71(
13697
+ children: /* @__PURE__ */ jsx72(
13554
13698
  WebIcon,
13555
13699
  {
13556
13700
  name: "chevron-down",
@@ -13575,14 +13719,14 @@ import { clsx as clsx98 } from "clsx";
13575
13719
  import {
13576
13720
  forwardRef as forwardRef16,
13577
13721
  useCallback as useCallback21,
13578
- useEffect as useEffect18,
13579
- useLayoutEffect as useLayoutEffect11,
13722
+ useEffect as useEffect19,
13723
+ useLayoutEffect as useLayoutEffect12,
13580
13724
  useRef as useRef21,
13581
- useState as useState27,
13725
+ useState as useState28,
13582
13726
  useSyncExternalStore
13583
13727
  } from "react";
13584
13728
  import { createPortal as createPortal7 } from "react-dom";
13585
- import { iconSizes as iconSizes21, spacings as spacings6 } from "@refineui/tokens";
13729
+ import { iconSizes as iconSizes21, spacings as spacings7 } from "@refineui/tokens";
13586
13730
  import { motionMsToNumber as motionMsToNumber6 } from "@refineui/utilities/animation";
13587
13731
  import { resolveColorTokenValue as resolveColorTokenValue11 } from "@refineui/utilities/color";
13588
13732
 
@@ -13617,8 +13761,8 @@ var toastStyles = {
13617
13761
  };
13618
13762
 
13619
13763
  // src/components/Toast/Toast.tsx
13620
- import { jsx as jsx72, jsxs as jsxs29 } from "react/jsx-runtime";
13621
- var useIsomorphicLayoutEffect6 = typeof document !== "undefined" ? useLayoutEffect11 : useEffect18;
13764
+ import { jsx as jsx73, jsxs as jsxs30 } from "react/jsx-runtime";
13765
+ var useIsomorphicLayoutEffect7 = typeof document !== "undefined" ? useLayoutEffect12 : useEffect19;
13622
13766
  var ENTER_MS = 20;
13623
13767
  var LEAVE_MS = motionMsToNumber6(componentTokens.toast.motion.leave) + 60;
13624
13768
  var DEFAULT_DURATION = 4200;
@@ -13641,10 +13785,10 @@ function gapPxFromSpacingToken(token) {
13641
13785
  var TOAST_NARROW_STACK_MQ = "(max-width: 480px), (hover: none)";
13642
13786
  function readToastStackGapPx() {
13643
13787
  if (typeof globalThis.matchMedia === "undefined") {
13644
- return gapPxFromSpacingToken(String(spacings6.sizeLarge));
13788
+ return gapPxFromSpacingToken(String(spacings7.sizeLarge));
13645
13789
  }
13646
13790
  const mq = globalThis.matchMedia(TOAST_NARROW_STACK_MQ);
13647
- return gapPxFromSpacingToken(mq.matches ? String(spacings6.sizeMedium) : String(spacings6.sizeLarge));
13791
+ return gapPxFromSpacingToken(mq.matches ? String(spacings7.sizeMedium) : String(spacings7.sizeLarge));
13648
13792
  }
13649
13793
  function subscribeToastStackGap(onChange) {
13650
13794
  if (typeof globalThis.matchMedia === "undefined") return () => {
@@ -13657,7 +13801,7 @@ function useToastStackGapPx() {
13657
13801
  return useSyncExternalStore(
13658
13802
  subscribeToastStackGap,
13659
13803
  readToastStackGapPx,
13660
- () => gapPxFromSpacingToken(String(spacings6.sizeLarge))
13804
+ () => gapPxFromSpacingToken(String(spacings7.sizeLarge))
13661
13805
  );
13662
13806
  }
13663
13807
  function readToastNaturalHeight(li) {
@@ -13805,7 +13949,7 @@ var Toast = forwardRef16(function Toast2(props, ref) {
13805
13949
  const liveRole = variant === "error" ? "alert" : "status";
13806
13950
  const ariaLive = variant === "error" ? void 0 : variant === "warning" ? "assertive" : "polite";
13807
13951
  const resolvedIconName = iconName ?? variantIconNames[variant];
13808
- const iconContent = icon ?? /* @__PURE__ */ jsx72(
13952
+ const iconContent = icon ?? /* @__PURE__ */ jsx73(
13809
13953
  WebIcon,
13810
13954
  {
13811
13955
  name: resolvedIconName,
@@ -13815,7 +13959,7 @@ var Toast = forwardRef16(function Toast2(props, ref) {
13815
13959
  }
13816
13960
  );
13817
13961
  const isPrimaryAction = !action || typeof action !== "object" || !("variant" in action) || action.variant === "primary";
13818
- const actionEl = typeof action === "object" && action !== null && "label" in action ? /* @__PURE__ */ jsx72(
13962
+ const actionEl = typeof action === "object" && action !== null && "label" in action ? /* @__PURE__ */ jsx73(
13819
13963
  Button,
13820
13964
  {
13821
13965
  variant: isPrimaryAction ? "primary" : "outline",
@@ -13831,7 +13975,7 @@ var Toast = forwardRef16(function Toast2(props, ref) {
13831
13975
  borderColor: resolveColorTokenValue11(color.border),
13832
13976
  color: resolveColorTokenValue11(color.message)
13833
13977
  };
13834
- return /* @__PURE__ */ jsxs29(
13978
+ return /* @__PURE__ */ jsxs30(
13835
13979
  "div",
13836
13980
  {
13837
13981
  ref,
@@ -13844,8 +13988,8 @@ var Toast = forwardRef16(function Toast2(props, ref) {
13844
13988
  style: { ...tokenStyle, ...style },
13845
13989
  className: clsx98(toastStyles.card, className),
13846
13990
  children: [
13847
- /* @__PURE__ */ jsx72("div", { "data-refineui": "toast-icon", className: toastStyles.iconWrap, children: iconContent }),
13848
- /* @__PURE__ */ jsx72("div", { className: toastStyles.contentWrap, children: message != null && message !== "" ? /* @__PURE__ */ jsx72("div", { className: toastStyles.message, children: message }) : null }),
13991
+ /* @__PURE__ */ jsx73("div", { "data-refineui": "toast-icon", className: toastStyles.iconWrap, children: iconContent }),
13992
+ /* @__PURE__ */ jsx73("div", { className: toastStyles.contentWrap, children: message != null && message !== "" ? /* @__PURE__ */ jsx73("div", { className: toastStyles.message, children: message }) : null }),
13849
13993
  action != null && actionEl
13850
13994
  ]
13851
13995
  }
@@ -13856,7 +14000,7 @@ function SwipeableToast({ record, index, swipeDirections, onSwipeStart, onSwipeE
13856
14000
  const dragStartRef = useRef21(null);
13857
14001
  const axisRef = useRef21(null);
13858
14002
  const offsetRef = useRef21({ x: 0, y: 0 });
13859
- const [swiping, setSwiping] = useState27(false);
14003
+ const [swiping, setSwiping] = useState28(false);
13860
14004
  const clearSwipeOffset = useCallback21(() => {
13861
14005
  const el = toastRef.current;
13862
14006
  offsetRef.current = { x: 0, y: 0 };
@@ -13932,7 +14076,7 @@ function SwipeableToast({ record, index, swipeDirections, onSwipeStart, onSwipeE
13932
14076
  clearSwipeOffset();
13933
14077
  onSwipeEnd();
13934
14078
  };
13935
- return /* @__PURE__ */ jsx72(
14079
+ return /* @__PURE__ */ jsx73(
13936
14080
  Toast,
13937
14081
  {
13938
14082
  ref: toastRef,
@@ -13967,15 +14111,15 @@ function Toaster({
13967
14111
  () => activeToasterKey === toasterKeyRef.current,
13968
14112
  () => false
13969
14113
  );
13970
- const [records, setRecords] = useState27([]);
14114
+ const [records, setRecords] = useState28([]);
13971
14115
  const timerMapRef = useRef21({});
13972
14116
  const pausedRef = useRef21(/* @__PURE__ */ new Set());
13973
14117
  const rootRef = useRef21(null);
13974
14118
  const itemRefs = useRef21({});
13975
- const [layoutTick, setLayoutTick] = useState27(0);
14119
+ const [layoutTick, setLayoutTick] = useState28(0);
13976
14120
  const stackGapPx = useToastStackGapPx();
13977
14121
  const resolvedSwipe = swipeDirections ?? DEFAULT_SWIPE_DIRECTIONS;
13978
- useIsomorphicLayoutEffect6(() => {
14122
+ useIsomorphicLayoutEffect7(() => {
13979
14123
  const key = toasterKeyRef.current;
13980
14124
  activeToasterKey = key;
13981
14125
  notifyToasterOwners();
@@ -13986,13 +14130,13 @@ function Toaster({
13986
14130
  }
13987
14131
  };
13988
14132
  }, []);
13989
- useEffect18(() => {
14133
+ useEffect19(() => {
13990
14134
  if (!isPortalOwner) return;
13991
14135
  return subscribeToasts((next) => {
13992
14136
  setRecords(next.slice(0, Math.max(1, maxToasts)));
13993
14137
  });
13994
14138
  }, [isPortalOwner, maxToasts]);
13995
- useEffect18(() => {
14139
+ useEffect19(() => {
13996
14140
  if (!isPortalOwner) return;
13997
14141
  for (const rec of records) {
13998
14142
  if (rec.phase === "leaving") continue;
@@ -14014,7 +14158,7 @@ function Toaster({
14014
14158
  }
14015
14159
  }
14016
14160
  }, [isPortalOwner, records]);
14017
- useEffect18(() => {
14161
+ useEffect19(() => {
14018
14162
  return () => {
14019
14163
  for (const handle of Object.values(timerMapRef.current)) {
14020
14164
  clearTimeout(handle);
@@ -14022,7 +14166,7 @@ function Toaster({
14022
14166
  timerMapRef.current = {};
14023
14167
  };
14024
14168
  }, []);
14025
- useIsomorphicLayoutEffect6(() => {
14169
+ useIsomorphicLayoutEffect7(() => {
14026
14170
  if (!isPortalOwner) return;
14027
14171
  const root = rootRef.current;
14028
14172
  if (!root) return;
@@ -14040,7 +14184,7 @@ function Toaster({
14040
14184
  li.style.height = `${slotHeight(idx)}px`;
14041
14185
  }
14042
14186
  }, [isPortalOwner, layoutTick, records, stackGapPx]);
14043
- useEffect18(() => {
14187
+ useEffect19(() => {
14044
14188
  if (!isPortalOwner) return;
14045
14189
  const root = rootRef.current;
14046
14190
  if (!root) return;
@@ -14074,7 +14218,7 @@ function Toaster({
14074
14218
  return null;
14075
14219
  }
14076
14220
  return createPortal7(
14077
- /* @__PURE__ */ jsx72(
14221
+ /* @__PURE__ */ jsx73(
14078
14222
  "ol",
14079
14223
  {
14080
14224
  ref: rootRef,
@@ -14085,7 +14229,7 @@ function Toaster({
14085
14229
  style: {
14086
14230
  ["--refineui-toast-gap"]: `${stackGapPx}px`
14087
14231
  },
14088
- children: records.map((rec, index) => /* @__PURE__ */ jsx72(
14232
+ children: records.map((rec, index) => /* @__PURE__ */ jsx73(
14089
14233
  "li",
14090
14234
  {
14091
14235
  ref: (node) => {
@@ -14099,7 +14243,7 @@ function Toaster({
14099
14243
  ["--refineui-toast-z-index"]: String(STACK_Z_BASE - index),
14100
14244
  ["--refineui-toast-stack-index"]: String(index)
14101
14245
  },
14102
- children: /* @__PURE__ */ jsx72("div", { "data-refineui": "toast-scale-layer", children: /* @__PURE__ */ jsx72(
14246
+ children: /* @__PURE__ */ jsx73("div", { "data-refineui": "toast-scale-layer", children: /* @__PURE__ */ jsx73(
14103
14247
  SwipeableToast,
14104
14248
  {
14105
14249
  record: rec,
@@ -14124,11 +14268,11 @@ import {
14124
14268
  useCallback as useCallback22,
14125
14269
  useMemo as useMemo21,
14126
14270
  useRef as useRef22,
14127
- useState as useState29
14271
+ useState as useState30
14128
14272
  } from "react";
14129
14273
 
14130
14274
  // src/components/Tree/context.ts
14131
- import { createContext as createContext26, useEffect as useEffect19, useState as useState28 } from "react";
14275
+ import { createContext as createContext26, useEffect as useEffect20, useState as useState29 } from "react";
14132
14276
  import { semanticInteraction as semanticInteraction8 } from "@refineui/tokens";
14133
14277
  import { getReducedMotionQuery as getReducedMotionQuery2 } from "@refineui/utilities/animation";
14134
14278
  var TREE_PANEL_MS = Number.parseFloat(semanticInteraction8.duration.accordionPanel) / 1e3;
@@ -14138,8 +14282,8 @@ var TREE_CONTENT_EASE = semanticInteraction8.easing.content;
14138
14282
  var TreeContext = createContext26(null);
14139
14283
  var TreeItemContext = createContext26(null);
14140
14284
  function usePrefersReducedMotion2() {
14141
- const [reduce, setReduce] = useState28(false);
14142
- useEffect19(() => {
14285
+ const [reduce, setReduce] = useState29(false);
14286
+ useEffect20(() => {
14143
14287
  const mql = window.matchMedia(getReducedMotionQuery2().replace("@media ", ""));
14144
14288
  const sync = () => setReduce(mql.matches);
14145
14289
  sync();
@@ -14194,7 +14338,7 @@ var treeItemTypo = {
14194
14338
  };
14195
14339
 
14196
14340
  // src/components/Tree/Tree.tsx
14197
- import { jsx as jsx73 } from "react/jsx-runtime";
14341
+ import { jsx as jsx74 } from "react/jsx-runtime";
14198
14342
  function Tree({
14199
14343
  size = "md",
14200
14344
  defaultExpanded,
@@ -14208,8 +14352,8 @@ function Tree({
14208
14352
  ...props
14209
14353
  }) {
14210
14354
  const reduceMotion = usePrefersReducedMotion2();
14211
- const [uncontrolledExpanded, setUncontrolledExpanded] = useState29(() => toExpandedSet(defaultExpanded));
14212
- const [uncontrolledSelected, setUncontrolledSelected] = useState29(defaultSelected ?? null);
14355
+ const [uncontrolledExpanded, setUncontrolledExpanded] = useState30(() => toExpandedSet(defaultExpanded));
14356
+ const [uncontrolledSelected, setUncontrolledSelected] = useState30(defaultSelected ?? null);
14213
14357
  const expanded = expandedProp === void 0 ? uncontrolledExpanded : toExpandedSet(expandedProp);
14214
14358
  const selected = selectedProp === void 0 ? uncontrolledSelected : selectedProp;
14215
14359
  const orderRef = useRef22([]);
@@ -14346,7 +14490,7 @@ function Tree({
14346
14490
  toggleExpanded
14347
14491
  ]
14348
14492
  );
14349
- return /* @__PURE__ */ jsx73(TreeContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx73(
14493
+ return /* @__PURE__ */ jsx74(TreeContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx74(
14350
14494
  "ul",
14351
14495
  {
14352
14496
  "data-refineui": "tree",
@@ -14360,13 +14504,13 @@ function Tree({
14360
14504
 
14361
14505
  // src/components/Tree/TreeItem.tsx
14362
14506
  import { clsx as clsx101 } from "clsx";
14363
- import { useContext as useContext28, useId as useId16, useMemo as useMemo22, useState as useState30 } from "react";
14364
- import { jsx as jsx74 } from "react/jsx-runtime";
14507
+ import { useContext as useContext28, useId as useId16, useMemo as useMemo22, useState as useState31 } from "react";
14508
+ import { jsx as jsx75 } from "react/jsx-runtime";
14365
14509
  function TreeItem({ value, disabled = false, className, children, ...props }) {
14366
14510
  const tree = useContext28(TreeContext);
14367
14511
  const parent = useContext28(TreeItemContext);
14368
14512
  if (!tree) throw new Error("TreeItem must be used within Tree.");
14369
- const [hasBranch, setHasBranch] = useState30(false);
14513
+ const [hasBranch, setHasBranch] = useState31(false);
14370
14514
  const uid = useId16().replace(/:/g, "");
14371
14515
  const depth = parent ? parent.depth + 1 : 0;
14372
14516
  const parentValue = parent?.value ?? null;
@@ -14389,7 +14533,7 @@ function TreeItem({ value, disabled = false, className, children, ...props }) {
14389
14533
  }),
14390
14534
  [value, depth, parentValue, expanded, selected, disabled, hasBranch, triggerId, groupId]
14391
14535
  );
14392
- return /* @__PURE__ */ jsx74(TreeItemContext.Provider, { value: itemContext, children: /* @__PURE__ */ jsx74(
14536
+ return /* @__PURE__ */ jsx75(TreeItemContext.Provider, { value: itemContext, children: /* @__PURE__ */ jsx75(
14393
14537
  "li",
14394
14538
  {
14395
14539
  "data-refineui": "tree-item",
@@ -14412,9 +14556,9 @@ function TreeItem({ value, disabled = false, className, children, ...props }) {
14412
14556
  import { clsx as clsx102 } from "clsx";
14413
14557
  import {
14414
14558
  useContext as useContext29,
14415
- useEffect as useEffect20
14559
+ useEffect as useEffect21
14416
14560
  } from "react";
14417
- import { jsx as jsx75, jsxs as jsxs30 } from "react/jsx-runtime";
14561
+ import { jsx as jsx76, jsxs as jsxs31 } from "react/jsx-runtime";
14418
14562
  function TreeItemTrigger({ className, children, onClick, onKeyDown, ...props }) {
14419
14563
  const tree = useContext29(TreeContext);
14420
14564
  const item = useContext29(TreeItemContext);
@@ -14424,7 +14568,7 @@ function TreeItemTrigger({ className, children, onClick, onKeyDown, ...props })
14424
14568
  const mainStyle = {
14425
14569
  paddingInlineStart: item.depth > 0 ? `calc(${depthIndent} * ${item.depth})` : void 0
14426
14570
  };
14427
- useEffect20(() => {
14571
+ useEffect21(() => {
14428
14572
  return () => {
14429
14573
  tree.registerItem(item.value, null, {
14430
14574
  parentValue: item.parentValue,
@@ -14500,7 +14644,7 @@ function TreeItemTrigger({ className, children, onClick, onKeyDown, ...props })
14500
14644
  break;
14501
14645
  }
14502
14646
  };
14503
- return /* @__PURE__ */ jsx75(
14647
+ return /* @__PURE__ */ jsx76(
14504
14648
  "div",
14505
14649
  {
14506
14650
  ref: setRowRef,
@@ -14519,8 +14663,8 @@ function TreeItemTrigger({ className, children, onClick, onKeyDown, ...props })
14519
14663
  className
14520
14664
  ),
14521
14665
  ...props,
14522
- children: /* @__PURE__ */ jsxs30("div", { "data-refineui": "tree-item-main", className: treeStyles.rowMain, style: mainStyle, children: [
14523
- item.hasBranch ? /* @__PURE__ */ jsx75(
14666
+ children: /* @__PURE__ */ jsxs31("div", { "data-refineui": "tree-item-main", className: treeStyles.rowMain, style: mainStyle, children: [
14667
+ item.hasBranch ? /* @__PURE__ */ jsx76(
14524
14668
  "button",
14525
14669
  {
14526
14670
  type: "button",
@@ -14534,10 +14678,10 @@ function TreeItemTrigger({ className, children, onClick, onKeyDown, ...props })
14534
14678
  item.expanded && treeStyles.chevronExpanded,
14535
14679
  tree.reduceMotion && "transition-none"
14536
14680
  ),
14537
- children: /* @__PURE__ */ jsx75(WebIcon, { name: "chevron-right", size: iconSize, color: "currentColor", fallback: "\u203A" })
14681
+ children: /* @__PURE__ */ jsx76(WebIcon, { name: "chevron-right", size: iconSize, color: "currentColor", fallback: "\u203A" })
14538
14682
  }
14539
- ) : /* @__PURE__ */ jsx75("span", { className: treeStyles.chevronSpacer, "aria-hidden": "true" }),
14540
- /* @__PURE__ */ jsx75("span", { className: treeStyles.label, children })
14683
+ ) : /* @__PURE__ */ jsx76("span", { className: treeStyles.chevronSpacer, "aria-hidden": "true" }),
14684
+ /* @__PURE__ */ jsx76("span", { className: treeStyles.label, children })
14541
14685
  ] })
14542
14686
  }
14543
14687
  );
@@ -14545,14 +14689,14 @@ function TreeItemTrigger({ className, children, onClick, onKeyDown, ...props })
14545
14689
 
14546
14690
  // src/components/Tree/TreeItemContent.tsx
14547
14691
  import { clsx as clsx103 } from "clsx";
14548
- import { useContext as useContext30, useLayoutEffect as useLayoutEffect12 } from "react";
14549
- import { jsx as jsx76 } from "react/jsx-runtime";
14692
+ import { useContext as useContext30, useLayoutEffect as useLayoutEffect13 } from "react";
14693
+ import { jsx as jsx77 } from "react/jsx-runtime";
14550
14694
  function TreeItemContent({ className, children, ...props }) {
14551
14695
  const tree = useContext30(TreeContext);
14552
14696
  const item = useContext30(TreeItemContext);
14553
14697
  if (!tree || !item) throw new Error("TreeItemContent must be used within TreeItem.");
14554
14698
  const { setHasBranch, expanded, groupId, triggerId } = item;
14555
- useLayoutEffect12(() => {
14699
+ useLayoutEffect13(() => {
14556
14700
  setHasBranch(true);
14557
14701
  return () => setHasBranch(false);
14558
14702
  }, [setHasBranch]);
@@ -14567,7 +14711,7 @@ function TreeItemContent({ className, children, ...props }) {
14567
14711
  transition: tree.reduceMotion ? void 0 : `opacity ${TREE_CONTENT_MS}s ${TREE_CONTENT_EASE}, transform ${TREE_CONTENT_MS}s ${TREE_CONTENT_EASE}`,
14568
14712
  pointerEvents: expanded ? void 0 : "none"
14569
14713
  };
14570
- return /* @__PURE__ */ jsx76(
14714
+ return /* @__PURE__ */ jsx77(
14571
14715
  "div",
14572
14716
  {
14573
14717
  ref: (el) => {
@@ -14578,7 +14722,7 @@ function TreeItemContent({ className, children, ...props }) {
14578
14722
  "data-refineui": "tree-item-panel",
14579
14723
  "aria-hidden": !expanded,
14580
14724
  style: gridStyle,
14581
- children: /* @__PURE__ */ jsx76("div", { className: treeStyles.panel, children: /* @__PURE__ */ jsx76("div", { className: treeStyles.panelInner, style: innerMotionStyle, children: /* @__PURE__ */ jsx76(
14725
+ children: /* @__PURE__ */ jsx77("div", { className: treeStyles.panel, children: /* @__PURE__ */ jsx77("div", { className: treeStyles.panelInner, style: innerMotionStyle, children: /* @__PURE__ */ jsx77(
14582
14726
  "ul",
14583
14727
  {
14584
14728
  id: groupId,
@@ -14596,82 +14740,26 @@ function TreeItemContent({ className, children, ...props }) {
14596
14740
 
14597
14741
  // src/components/Tooltip/Tooltip.tsx
14598
14742
  import { clsx as clsx105 } from "clsx";
14599
- import { useId as useId17, useRef as useRef23, useState as useState31 } from "react";
14743
+ import { useId as useId17, useRef as useRef23, useState as useState32 } from "react";
14744
+ import { borderRadii as borderRadii2 } from "@refineui/tokens";
14600
14745
  import { resolveColorTokenValue as resolveColorTokenValue12 } from "@refineui/utilities/color";
14601
14746
  import { Slot as Slot5, getMergeableTriggerChild as getMergeableTriggerChild4 } from "@refineui/utilities/react";
14602
14747
 
14603
- // src/components/shared/FrostedBeak.tsx
14604
- import { strokeWidths as strokeWidths3 } from "@refineui/tokens";
14605
- import { jsx as jsx77, jsxs as jsxs31 } from "react/jsx-runtime";
14606
- var triangleClipPath = "polygon(50% 0, 0 100%, 100% 100%)";
14607
- function FrostedBeak({ width, height, rotateDeg, borderColor }) {
14608
- const surfaceStyle = {
14609
- position: "absolute",
14610
- inset: 0,
14611
- clipPath: triangleClipPath
14612
- };
14613
- return /* @__PURE__ */ jsxs31(
14614
- "div",
14615
- {
14616
- style: {
14617
- position: "relative",
14618
- width,
14619
- height,
14620
- transform: `rotate(${rotateDeg}deg)`,
14621
- transformOrigin: "center center"
14622
- },
14623
- children: [
14624
- /* @__PURE__ */ jsx77(
14625
- "span",
14626
- {
14627
- "data-refineui": "floating-beak-surface",
14628
- style: surfaceStyle
14629
- }
14630
- ),
14631
- /* @__PURE__ */ jsx77(
14632
- "svg",
14633
- {
14634
- width,
14635
- height,
14636
- viewBox: "0 0 16 8",
14637
- fill: "none",
14638
- "aria-hidden": true,
14639
- style: { position: "absolute", inset: 0, overflow: "visible" },
14640
- children: /* @__PURE__ */ jsx77(
14641
- "path",
14642
- {
14643
- d: "M0 8L8 0L16 8",
14644
- stroke: borderColor,
14645
- strokeWidth: strokeWidths3.strokeWidthThin,
14646
- strokeLinejoin: "round"
14647
- }
14648
- )
14649
- }
14650
- )
14651
- ]
14652
- }
14653
- );
14654
- }
14655
-
14656
14748
  // src/components/Tooltip/style.ts
14657
- import { spacings as spacings7, strokeWidths as strokeWidths4 } from "@refineui/tokens";
14749
+ import { spacings as spacings8 } from "@refineui/tokens";
14658
14750
  import { clsx as clsx104 } from "clsx";
14659
- var TOOLTIP_BEAK_W = foundationSizes.foundationSize160;
14660
- var TOOLTIP_BEAK_H = foundationSizes.foundationSize80;
14661
- var TOOLTIP_BEAK_OFFSET = foundationSizes.foundationSize80;
14662
- var BEAK_BORDER_OVERLAP2 = strokeWidths4.strokeWidthThin;
14663
- var gap = spacings7.sizeXSmall;
14664
- var edgeInset = spacings7.sizeMedium;
14751
+ var gap = `calc(${componentSizes2.tooltipBeakHeight} + ${spacings8.sizeXXSmall})`;
14752
+ var TOOLTIP_BEAK_INSET = spacings8.sizeMedium;
14665
14753
  var tooltipStyles = {
14666
14754
  root: "relative inline-block",
14667
14755
  fallbackTrigger: "inline-flex outline-none",
14668
- /** Positions the floating stack (beak + panel), like PopOver `floatingRoot`. */
14756
+ /** Positions the floating stack (surface + panel), like PopOver `floatingRoot`. */
14669
14757
  floating: "pointer-events-none absolute z-refineui-popup",
14670
14758
  panelWrap: "relative inline-block max-w-refineui-tooltip-max-width",
14671
- beakWrap: "pointer-events-none absolute z-[1]",
14759
+ /** Fill, stroke, and shadow come from `FloatingSurface`; the transparent border keeps the box size. */
14672
14760
  panel: clsx104(
14673
14761
  componentTextClass(componentTypographyTokens.tooltip),
14674
- "relative z-0 box-border max-w-refineui-tooltip-max-width whitespace-nowrap rounded-refineui-medium border-refineui-thin px-refineui-size-medium py-refineui-size-small shadow-refineui-8"
14762
+ "relative z-0 box-border max-w-refineui-tooltip-max-width whitespace-nowrap rounded-refineui-medium border-refineui-thin border-transparent px-refineui-size-medium py-refineui-size-small"
14675
14763
  )
14676
14764
  };
14677
14765
  function tooltipPlacement(position) {
@@ -14692,6 +14780,15 @@ function tooltipAlignKey(align) {
14692
14780
  if (align === "End") return "end";
14693
14781
  return "center";
14694
14782
  }
14783
+ var beakSideByPlacement2 = {
14784
+ bottom: "top",
14785
+ top: "bottom",
14786
+ left: "right",
14787
+ right: "left"
14788
+ };
14789
+ function tooltipBeakSide(position) {
14790
+ return beakSideByPlacement2[tooltipPlacement(position)];
14791
+ }
14695
14792
  function tooltipFloatingStyle(position, align) {
14696
14793
  switch (position) {
14697
14794
  case "Top":
@@ -14714,45 +14811,6 @@ function tooltipFloatingStyle(position, align) {
14714
14811
  return {};
14715
14812
  }
14716
14813
  }
14717
- function tooltipBeakWrapperStyle(position, align) {
14718
- const overlapOffset = `calc(-1 * ${TOOLTIP_BEAK_OFFSET} + ${BEAK_BORDER_OVERLAP2})`;
14719
- const placement = tooltipPlacement(position);
14720
- const a = tooltipAlignKey(align);
14721
- switch (placement) {
14722
- case "bottom":
14723
- if (a === "center") return { top: overlapOffset, left: `calc(50% - ${TOOLTIP_BEAK_W} / 2)` };
14724
- if (a === "start") return { top: overlapOffset, left: edgeInset };
14725
- return { top: overlapOffset, right: edgeInset };
14726
- case "top":
14727
- if (a === "center") return { bottom: overlapOffset, left: `calc(50% - ${TOOLTIP_BEAK_W} / 2)` };
14728
- if (a === "start") return { bottom: overlapOffset, left: edgeInset };
14729
- return { bottom: overlapOffset, right: edgeInset };
14730
- case "left":
14731
- if (a === "center") return { right: overlapOffset, top: `calc(50% - ${TOOLTIP_BEAK_W} / 2)` };
14732
- if (a === "start") return { right: overlapOffset, top: edgeInset };
14733
- return { right: overlapOffset, bottom: edgeInset };
14734
- case "right":
14735
- if (a === "center") return { left: overlapOffset, top: `calc(50% - ${TOOLTIP_BEAK_W} / 2)` };
14736
- if (a === "start") return { left: overlapOffset, top: edgeInset };
14737
- return { left: overlapOffset, bottom: edgeInset };
14738
- default:
14739
- return {};
14740
- }
14741
- }
14742
- function tooltipBeakRotateDeg(position) {
14743
- switch (tooltipPlacement(position)) {
14744
- case "bottom":
14745
- return 0;
14746
- case "top":
14747
- return 180;
14748
- case "left":
14749
- return -90;
14750
- case "right":
14751
- return 90;
14752
- default:
14753
- return 0;
14754
- }
14755
- }
14756
14814
 
14757
14815
  // src/components/Tooltip/Tooltip.tsx
14758
14816
  import { jsx as jsx78, jsxs as jsxs32 } from "react/jsx-runtime";
@@ -14768,10 +14826,11 @@ function Tooltip({
14768
14826
  className,
14769
14827
  ...props
14770
14828
  }) {
14771
- const [innerOpen, setInnerOpen] = useState31(defaultOpen);
14829
+ const [innerOpen, setInnerOpen] = useState32(defaultOpen);
14772
14830
  const open = ctrlOpen !== void 0 ? ctrlOpen : innerOpen;
14773
14831
  const tooltipId = useId17();
14774
14832
  const showTimer = useRef23(null);
14833
+ const panelRef = useRef23(null);
14775
14834
  const setOpen = (next) => {
14776
14835
  if (ctrlOpen === void 0) setInnerOpen(next);
14777
14836
  onOpenChange?.(next);
@@ -14795,8 +14854,6 @@ function Tooltip({
14795
14854
  setOpen(false);
14796
14855
  };
14797
14856
  const floatingStyle = tooltipFloatingStyle(position, align);
14798
- const beakWrapStyle = tooltipBeakWrapperStyle(position, align);
14799
- const beakRot = tooltipBeakRotateDeg(position);
14800
14857
  const describedBy = open ? tooltipId : void 0;
14801
14858
  const mergeEl = getMergeableTriggerChild4(trigger);
14802
14859
  let triggerNode;
@@ -14841,36 +14898,32 @@ function Tooltip({
14841
14898
  /* @__PURE__ */ jsx78(
14842
14899
  "div",
14843
14900
  {
14844
- className: tooltipStyles.beakWrap,
14845
- style: { ...beakWrapStyle, width: TOOLTIP_BEAK_W, height: TOOLTIP_BEAK_H },
14846
- "aria-hidden": true,
14847
- children: /* @__PURE__ */ jsx78(
14848
- FrostedBeak,
14849
- {
14850
- width: TOOLTIP_BEAK_W,
14851
- height: TOOLTIP_BEAK_H,
14852
- rotateDeg: beakRot,
14853
- borderColor: borderCol
14854
- }
14855
- )
14856
- }
14857
- ),
14858
- /* @__PURE__ */ jsx78(
14859
- "div",
14860
- {
14901
+ ref: panelRef,
14861
14902
  id: tooltipId,
14862
14903
  role: "tooltip",
14863
14904
  "data-refineui": "tooltip-panel",
14864
14905
  "data-position": position,
14865
14906
  "data-align": align,
14866
14907
  className: tooltipStyles.panel,
14867
- style: {
14868
- backgroundColor: bg,
14869
- color: fg,
14870
- borderColor: borderCol
14871
- },
14908
+ style: { color: fg },
14872
14909
  children: content
14873
14910
  }
14911
+ ),
14912
+ /* @__PURE__ */ jsx78(
14913
+ FloatingSurface,
14914
+ {
14915
+ panelRef,
14916
+ side: tooltipBeakSide(position),
14917
+ align: tooltipAlignKey(align),
14918
+ radius: borderRadii2.roundedMedium,
14919
+ beakWidth: componentSizes2.tooltipBeakWidth,
14920
+ beakHeight: componentSizes2.tooltipBeakHeight,
14921
+ tipRadius: componentSizes2.tooltipBeakTipRadius,
14922
+ beakInsetStart: TOOLTIP_BEAK_INSET,
14923
+ beakInsetEnd: TOOLTIP_BEAK_INSET,
14924
+ backgroundColor: bg,
14925
+ borderColor: borderCol
14926
+ }
14874
14927
  )
14875
14928
  ] }) })
14876
14929
  ] });
@@ -14884,9 +14937,9 @@ import {
14884
14937
  isValidElement as isValidElement7,
14885
14938
  useContext as useContext31,
14886
14939
  useId as useId18,
14887
- useLayoutEffect as useLayoutEffect13,
14940
+ useLayoutEffect as useLayoutEffect14,
14888
14941
  useMemo as useMemo23,
14889
- useState as useState32
14942
+ useState as useState33
14890
14943
  } from "react";
14891
14944
  import { opacities } from "@refineui/tokens";
14892
14945
  import { resolveColorTokenValue as resolveColorTokenValue13 } from "@refineui/utilities/color";
@@ -14933,13 +14986,13 @@ var chartStyles = {
14933
14986
  };
14934
14987
 
14935
14988
  // src/components/Chart/utils.ts
14936
- import { borderRadii, foundationSizes as foundationSizes3, spacings as spacings8 } from "@refineui/tokens";
14989
+ import { borderRadii as borderRadii3, foundationSizes as foundationSizes3, spacings as spacings9 } from "@refineui/tokens";
14937
14990
  var CHART_VIEWBOX_WIDTH = 800;
14938
14991
  var CHART_VIEWBOX_HEIGHT = 320;
14939
- var CHART_PLOT_PADDING_TOP = parseFloat(spacings8.sizeMedium);
14940
- var CHART_PLOT_PADDING_BOTTOM = parseFloat(spacings8.sizeXXSmall);
14941
- var CHART_PLOT_PADDING_X = parseFloat(spacings8.sizeMedium);
14942
- var CHART_BAR_RADIUS = parseFloat(borderRadii.roundedXLarge);
14992
+ var CHART_PLOT_PADDING_TOP = parseFloat(spacings9.sizeMedium);
14993
+ var CHART_PLOT_PADDING_BOTTOM = parseFloat(spacings9.sizeXXSmall);
14994
+ var CHART_PLOT_PADDING_X = parseFloat(spacings9.sizeMedium);
14995
+ var CHART_BAR_RADIUS = parseFloat(borderRadii3.roundedXLarge);
14943
14996
  var CHART_BAR_BAND_FILL = 0.5;
14944
14997
  var CHART_POINT_RADIUS = parseFloat(foundationSizes3.foundationSize40);
14945
14998
  var CHART_POINT_STROKE = parseFloat(foundationSizes3.foundationSize20);
@@ -15150,11 +15203,11 @@ function isChartTooltipElement(node) {
15150
15203
  return isValidElement7(node) && node.type === ChartTooltip;
15151
15204
  }
15152
15205
  function Chart({ className, children, ...props }) {
15153
- const [hoverIndex, setHoverIndex] = useState32(null);
15154
- const [selectedIndex, setSelectedIndex] = useState32(null);
15155
- const [pointer, setPointer] = useState32(null);
15156
- const [labels, setLabels] = useState32([]);
15157
- const [series, setSeries] = useState32(null);
15206
+ const [hoverIndex, setHoverIndex] = useState33(null);
15207
+ const [selectedIndex, setSelectedIndex] = useState33(null);
15208
+ const [pointer, setPointer] = useState33(null);
15209
+ const [labels, setLabels] = useState33([]);
15210
+ const [series, setSeries] = useState33(null);
15158
15211
  const context = useMemo23(
15159
15212
  () => ({
15160
15213
  hoverIndex,
@@ -15389,7 +15442,7 @@ function ChartBars({
15389
15442
  const barRadius = Math.min(CHART_BAR_RADIUS, barWidth / 2);
15390
15443
  const baselineY = plotBaselineY();
15391
15444
  const trackHeight = plotHeight();
15392
- useLayoutEffect13(() => {
15445
+ useLayoutEffect14(() => {
15393
15446
  setSeries({ values, seriesColor, max, align: "bar" });
15394
15447
  }, [values, seriesColor, max, setSeries]);
15395
15448
  return /* @__PURE__ */ jsxs33("g", { "data-refineui": "chart-bars", "data-series-color": seriesColor, className, ...props, children: [
@@ -15447,7 +15500,7 @@ function ChartLine({
15447
15500
  const baselineY = plotBaselineY();
15448
15501
  const pointRing = pointStrokeColor();
15449
15502
  const linePath = monotoneLinePath(coords);
15450
- useLayoutEffect13(() => {
15503
+ useLayoutEffect14(() => {
15451
15504
  setSeries({ values, seriesColor, max, align: "line" });
15452
15505
  }, [values, seriesColor, max, setSeries]);
15453
15506
  return /* @__PURE__ */ jsxs33("g", { "data-refineui": "chart-line", "data-series-color": seriesColor, className, ...props, children: [
@@ -15516,7 +15569,7 @@ function ChartAxisLabels({
15516
15569
  const { hoverIndex, selectedIndex, setLabels } = useChartContext("ChartAxisLabels");
15517
15570
  const count = labels.length;
15518
15571
  const centerAt = align === "line" ? linePointCenterRatio : barBandCenterRatio;
15519
- useLayoutEffect13(() => {
15572
+ useLayoutEffect14(() => {
15520
15573
  setLabels(labels);
15521
15574
  }, [labels, setLabels]);
15522
15575
  return /* @__PURE__ */ jsx79(
@@ -15593,13 +15646,13 @@ import {
15593
15646
  useCallback as useCallback23,
15594
15647
  useId as useId19,
15595
15648
  useMemo as useMemo24,
15596
- useState as useState34
15649
+ useState as useState35
15597
15650
  } from "react";
15598
15651
  import { clsx as clsx108 } from "clsx";
15599
15652
  import { Slot as Slot7 } from "@refineui/utilities/react";
15600
15653
 
15601
15654
  // src/components/Collapsible/context.ts
15602
- import { createContext as createContext28, useContext as useContext32, useEffect as useEffect21, useState as useState33 } from "react";
15655
+ import { createContext as createContext28, useContext as useContext32, useEffect as useEffect22, useState as useState34 } from "react";
15603
15656
  import { semanticInteraction as semanticInteraction9 } from "@refineui/tokens";
15604
15657
  import { getReducedMotionQuery as getReducedMotionQuery3 } from "@refineui/utilities/animation";
15605
15658
  var CollapsibleContext = createContext28(null);
@@ -15609,8 +15662,8 @@ function useCollapsibleContext(part) {
15609
15662
  return value;
15610
15663
  }
15611
15664
  function usePrefersReducedMotion3() {
15612
- const [reduce, setReduce] = useState33(false);
15613
- useEffect21(() => {
15665
+ const [reduce, setReduce] = useState34(false);
15666
+ useEffect22(() => {
15614
15667
  const mql = window.matchMedia(getReducedMotionQuery3().replace("@media ", ""));
15615
15668
  const sync = () => setReduce(mql.matches);
15616
15669
  sync();
@@ -15632,7 +15685,7 @@ var collapsibleStyles = {
15632
15685
  // src/components/Collapsible/Collapsible.tsx
15633
15686
  import { jsx as jsx80 } from "react/jsx-runtime";
15634
15687
  var Collapsible = forwardRef17(function Collapsible2({ open: openProp, defaultOpen = false, onOpenChange, asChild = false, className, children, ...props }, ref) {
15635
- const [uncontrolled, setUncontrolled] = useState34(defaultOpen);
15688
+ const [uncontrolled, setUncontrolled] = useState35(defaultOpen);
15636
15689
  const open = openProp ?? uncontrolled;
15637
15690
  const reactId = useId19();
15638
15691
  const reduceMotion = usePrefersReducedMotion3();
@@ -15741,11 +15794,11 @@ import {
15741
15794
  forwardRef as forwardRef18,
15742
15795
  useCallback as useCallback24,
15743
15796
  useContext as useContext33,
15744
- useEffect as useEffect22,
15745
- useLayoutEffect as useLayoutEffect14,
15797
+ useEffect as useEffect23,
15798
+ useLayoutEffect as useLayoutEffect15,
15746
15799
  useMemo as useMemo25,
15747
15800
  useRef as useRef24,
15748
- useState as useState35
15801
+ useState as useState36
15749
15802
  } from "react";
15750
15803
  import { createPortal as createPortal8 } from "react-dom";
15751
15804
  import { clsx as clsx109 } from "clsx";
@@ -15775,8 +15828,8 @@ function placeInView(element, x, y) {
15775
15828
  }
15776
15829
  function ContextMenu({ modal = true, onOpenChange, children }) {
15777
15830
  void modal;
15778
- const [open, setOpen] = useState35(false);
15779
- const [point, setPoint] = useState35({ x: 0, y: 0 });
15831
+ const [open, setOpen] = useState36(false);
15832
+ const [point, setPoint] = useState36({ x: 0, y: 0 });
15780
15833
  const openRef = useRef24(false);
15781
15834
  const onOpenChangeRef = useRef24(onOpenChange);
15782
15835
  openRef.current = open;
@@ -15819,9 +15872,9 @@ function ContextMenuPortal({ children }) {
15819
15872
  var ContextMenuContent = forwardRef18(function ContextMenuContent2({ className, style, onPointerDown, children, ...props }, ref) {
15820
15873
  const { open, point, close } = useMenu();
15821
15874
  const localRef = useRef24(null);
15822
- const [shouldRender, setShouldRender] = useState35(open);
15823
- const [isClosing, setIsClosing] = useState35(false);
15824
- useEffect22(() => {
15875
+ const [shouldRender, setShouldRender] = useState36(open);
15876
+ const [isClosing, setIsClosing] = useState36(false);
15877
+ useEffect23(() => {
15825
15878
  if (open) {
15826
15879
  setShouldRender(true);
15827
15880
  setIsClosing(false);
@@ -15835,11 +15888,11 @@ var ContextMenuContent = forwardRef18(function ContextMenuContent2({ className,
15835
15888
  }, CLOSE_MS);
15836
15889
  return () => window.clearTimeout(timeout);
15837
15890
  }, [open, shouldRender]);
15838
- useLayoutEffect14(() => {
15891
+ useLayoutEffect15(() => {
15839
15892
  if (!shouldRender || !localRef.current) return;
15840
15893
  placeInView(localRef.current, point.x, point.y);
15841
15894
  }, [shouldRender, point.x, point.y]);
15842
- useEffect22(() => {
15895
+ useEffect23(() => {
15843
15896
  if (!open) return;
15844
15897
  const onKey = (event) => {
15845
15898
  if (event.key === "Escape") close();
@@ -15981,14 +16034,14 @@ function ContextMenuLabel({ className, children, ...props }) {
15981
16034
  return /* @__PURE__ */ jsx81("div", { "data-refineui": "menu-label", className: clsx109(menuStyles.section, className), ...props, children: /* @__PURE__ */ jsx81("span", { className: menuStyles.sectionText, children }) });
15982
16035
  }
15983
16036
  function ContextMenuSub({ children }) {
15984
- const [open, setOpen] = useState35(false);
16037
+ const [open, setOpen] = useState36(false);
15985
16038
  const triggerRef = useRef24(null);
15986
16039
  const timer = useRef24(null);
15987
16040
  const clear = () => {
15988
16041
  if (timer.current != null) window.clearTimeout(timer.current);
15989
16042
  timer.current = null;
15990
16043
  };
15991
- useEffect22(() => clear, []);
16044
+ useEffect23(() => clear, []);
15992
16045
  const value = useMemo25(
15993
16046
  () => ({
15994
16047
  open,
@@ -16076,8 +16129,8 @@ var ContextMenuSubContent = forwardRef18(
16076
16129
  function ContextMenuSubContent2({ className, style, onPointerDown, onMouseEnter, onMouseLeave, ...props }, ref) {
16077
16130
  const sub = useSub2();
16078
16131
  const localRef = useRef24(null);
16079
- const [side, setSide] = useState35("right");
16080
- useLayoutEffect14(() => {
16132
+ const [side, setSide] = useState36("right");
16133
+ useLayoutEffect15(() => {
16081
16134
  const trigger = sub.triggerRef.current;
16082
16135
  const element = localRef.current;
16083
16136
  if (!sub.open || !trigger || !element) return;