@refineui/react 0.0.5 → 0.0.7

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
@@ -114,7 +114,7 @@ var componentColorTokens = {
114
114
  border: semanticToken("borderDefault")
115
115
  },
116
116
  menu: {
117
- background: semanticToken("backgroundPrimary"),
117
+ background: semanticToken("surfaceFrosted"),
118
118
  border: semanticToken("borderDefault"),
119
119
  title: semanticToken("foregroundPrimary"),
120
120
  itemText: semanticToken("foregroundPrimary"),
@@ -128,6 +128,10 @@ var componentColorTokens = {
128
128
  placeholder: semanticToken("foregroundPlaceholder"),
129
129
  background: semanticToken("backgroundPrimary"),
130
130
  disabledBackground: semanticToken("backgroundSurfaceDisabled"),
131
+ menu: {
132
+ background: semanticToken("surfaceFrosted"),
133
+ border: semanticToken("borderDefault")
134
+ },
131
135
  border: {
132
136
  default: semanticToken("borderDefault"),
133
137
  disabled: semanticToken("borderDisabled"),
@@ -519,15 +523,15 @@ var componentColorTokens = {
519
523
  },
520
524
  menu: {
521
525
  panel: {
522
- /** Matches Menu.style panel classes */
523
- background: semanticToken("backgroundPrimary"),
526
+ /** Frosted glass `surfaceFrosted` fill + `surfaceFrost` blur in refineui.css */
527
+ background: semanticToken("surfaceFrosted"),
524
528
  border: semanticToken("borderDefault")
525
529
  },
526
530
  popover: {
527
531
  background: "transparent"
528
532
  },
529
533
  list: {
530
- background: semanticToken("backgroundPrimary"),
534
+ background: semanticToken("surfaceFrosted"),
531
535
  border: semanticToken("borderDefault")
532
536
  },
533
537
  section: semanticToken("foregroundPrimary"),
@@ -768,7 +772,7 @@ var componentTypographyTokens = {
768
772
  link: role("bodyMd"),
769
773
  copyright: role("bodyMd")
770
774
  },
771
- /** App sidebar — group labels match menu sections; links match menu rows. */
775
+ /** App sidebar — group labels share `captionLg` + tight py with Menu/Dropdown/Select/Command. */
772
776
  sidebar: {
773
777
  brand: role("bodyMd"),
774
778
  groupLabel: role("captionLg"),
@@ -963,7 +967,10 @@ var componentTokens = {
963
967
  foundation: semanticElevations.surface
964
968
  },
965
969
  motion: {
966
- /** Indicator slide after first layout */
970
+ /**
971
+ * Indicator slide after first layout.
972
+ * CSS applies transform=`medium` / width=`slow` so edges arrive apart.
973
+ */
967
974
  indicator: motion.indicator,
968
975
  /** Item label color fade */
969
976
  itemColor: motion.fast
@@ -1594,6 +1601,7 @@ function InputOTP({
1594
1601
  function InputOTPSlot({
1595
1602
  index,
1596
1603
  className,
1604
+ style,
1597
1605
  onChange,
1598
1606
  onKeyDown,
1599
1607
  onPaste,
@@ -1680,6 +1688,10 @@ function InputOTPSlot({
1680
1688
  value: char,
1681
1689
  "aria-label": `Digit ${index + 1} of ${maxLength}`,
1682
1690
  className: clsx5(inputOtpStyles.slot, inputOtpSlotSizeClass[size], className),
1691
+ style: {
1692
+ ...style,
1693
+ ["--refineui-input-otp-slot-index"]: index
1694
+ },
1683
1695
  onChange: onSlotChange,
1684
1696
  onKeyDown: onSlotKeyDown,
1685
1697
  onPaste: onSlotPaste,
@@ -2937,8 +2949,9 @@ var selectStyles = {
2937
2949
  iconWrap: "inline-flex size-refineui-icon-xsmall shrink-0 items-center justify-center",
2938
2950
  chevron: "shrink-0 transition-transform duration-[var(--refineui-motion-duration-fast)] ease-[var(--refineui-motion-easing-ease-out)]",
2939
2951
  chevronOpen: "rotate-180",
2940
- positioner: "z-refineui-popup flex flex-col overflow-hidden",
2941
- contentShell: "box-border flex w-full min-h-0 flex-col overflow-hidden rounded-refineui-large border-refineui-hairline border-refineui-alias-border-default bg-refineui-alias-background-primary p-refineui-size-xx-small shadow-refineui-2 outline-none",
2952
+ /* No overflow-hidden it isolates descendants and kills panel `backdrop-filter`. */
2953
+ positioner: "z-refineui-popup flex flex-col",
2954
+ contentShell: "box-border flex w-full min-h-0 flex-col overflow-hidden rounded-refineui-xx-large border-refineui-hairline border-refineui-alias-border-default p-refineui-size-xx-small shadow-refineui-2 outline-none",
2942
2955
  contentPopper: "h-auto max-h-[var(--refineui-select-content-available-height,100dvh)]",
2943
2956
  contentItemAligned: "max-h-full",
2944
2957
  viewportPopper: "relative flex max-h-full min-h-0 min-w-full w-full flex-col",
@@ -2948,7 +2961,7 @@ var selectStyles = {
2948
2961
  group: "flex flex-col gap-px",
2949
2962
  label: clsx27(
2950
2963
  componentTextClass(componentTypographyTokens.select.label),
2951
- "px-refineui-size-x-small py-refineui-size-x-small text-refineui-alias-foreground-tertiary"
2964
+ "px-refineui-size-x-small py-refineui-size-xxx-small text-refineui-alias-foreground-tertiary"
2952
2965
  ),
2953
2966
  separator: "my-refineui-size-x-small h-px bg-refineui-alias-border-default",
2954
2967
  item: clsx27(
@@ -3603,9 +3616,6 @@ function SelectGroup({ children, className, ...props }) {
3603
3616
  function SelectLabel({ children, className, ...props }) {
3604
3617
  return /* @__PURE__ */ jsx22("div", { className: clsx28(selectStyles.label, className), ...props, children });
3605
3618
  }
3606
- function SelectSection({ children, className, ...props }) {
3607
- return /* @__PURE__ */ jsx22("div", { className: clsx28(selectStyles.label, className), ...props, children });
3608
- }
3609
3619
  function SelectSeparator({ className, ...props }) {
3610
3620
  return /* @__PURE__ */ jsx22("div", { role: "separator", className: clsx28(selectStyles.separator, className), ...props });
3611
3621
  }
@@ -4253,7 +4263,7 @@ var COMMAND_LIST_MAX_HEIGHT = `min(60vh, ${foundationSizes2.foundationSize3200})
4253
4263
  var commandStyles = {
4254
4264
  root: clsx33(
4255
4265
  "flex w-full flex-col overflow-hidden outline-none",
4256
- "rounded-refineui-large border-refineui-hairline border-refineui-alias-border-default",
4266
+ "rounded-refineui-xx-large border-refineui-hairline border-refineui-alias-border-default",
4257
4267
  "bg-refineui-alias-background-primary text-refineui-alias-foreground-primary",
4258
4268
  "shadow-refineui-2"
4259
4269
  ),
@@ -4281,7 +4291,7 @@ var commandStyles = {
4281
4291
  group: "flex flex-col gap-refineui-size-xxx-small overflow-hidden",
4282
4292
  groupHeading: clsx33(
4283
4293
  componentTextClass(componentTypographyTokens.command.group),
4284
- "flex w-full items-center overflow-hidden px-refineui-size-x-small pb-refineui-size-xxx-small pt-refineui-size-x-small text-refineui-alias-foreground-tertiary"
4294
+ "flex w-full items-center overflow-hidden px-refineui-size-x-small py-refineui-size-xxx-small text-refineui-alias-foreground-tertiary"
4285
4295
  ),
4286
4296
  separatorWrap: "flex w-full items-center px-refineui-size-x-small py-refineui-size-x-small",
4287
4297
  separatorLine: "h-px w-full shrink-0 bg-refineui-alias-border-default",
@@ -6991,6 +7001,7 @@ import { forwardRef as forwardRef12 } from "react";
6991
7001
  import { iconSizes as iconSizes11 } from "@refineui/tokens";
6992
7002
 
6993
7003
  // src/components/Breadcrumb/style.ts
7004
+ var ellipsisChip = "box-border inline-flex min-h-refineui-button-min-height-sm min-w-refineui-button-min-height-sm shrink-0 items-center justify-center rounded-refineui-large p-refineui-size-xx-small leading-none";
6994
7005
  var breadcrumbStyles = {
6995
7006
  textRow: `${componentTextClass(componentTypographyTokens.breadcrumb.row)} whitespace-nowrap`,
6996
7007
  root: "py-refineui-size-x-small",
@@ -7000,8 +7011,9 @@ var breadcrumbStyles = {
7000
7011
  page: "inline-flex items-center px-refineui-size-medium py-refineui-size-x-small font-medium text-refineui-alias-foreground-primary",
7001
7012
  separator: "inline-flex shrink-0 items-center",
7002
7013
  separatorText: "inline-flex items-center text-refineui-alias-foreground-tertiary select-none",
7003
- ellipsis: "box-border inline-flex min-h-refineui-button-min-height-sm shrink-0 items-center justify-center rounded-refineui-large px-refineui-size-medium py-refineui-size-x-small text-refineui-alias-foreground-tertiary leading-none",
7004
- ellipsisTrigger: "box-border inline-flex min-h-refineui-button-min-height-sm shrink-0 cursor-pointer items-center justify-center rounded-refineui-large border-none bg-transparent px-refineui-size-medium py-refineui-size-x-small text-refineui-alias-foreground-tertiary leading-none outline-none transition-[color,background-color] duration-[var(--refineui-motion-duration-fast)]"
7014
+ ellipsis: `${ellipsisChip} text-refineui-alias-foreground-tertiary`,
7015
+ /** Color only size/layout come from Button `layout="icon" size="sm"`. */
7016
+ ellipsisTrigger: "text-refineui-alias-foreground-tertiary"
7005
7017
  };
7006
7018
 
7007
7019
  // src/components/Breadcrumb/Breadcrumb.tsx
@@ -7074,52 +7086,43 @@ function BreadcrumbSeparator({ children, className, ...props }) {
7074
7086
  }
7075
7087
  );
7076
7088
  }
7089
+ function EllipsisIcon() {
7090
+ return /* @__PURE__ */ jsx43(
7091
+ WebIcon,
7092
+ {
7093
+ name: "more-horizontal",
7094
+ size: iconSizes11.small,
7095
+ color: "currentColor",
7096
+ fallback: "\u22EF",
7097
+ className: "items-center justify-center"
7098
+ }
7099
+ );
7100
+ }
7077
7101
  function BreadcrumbEllipsis({ className, ...props }) {
7078
7102
  return /* @__PURE__ */ jsx43(
7079
7103
  "span",
7080
7104
  {
7081
7105
  "data-refineui": "breadcrumb-ellipsis",
7082
- className: clsx55(
7083
- breadcrumbStyles.ellipsis,
7084
- className
7085
- ),
7106
+ className: clsx55(breadcrumbStyles.ellipsis, className),
7086
7107
  ...props,
7087
- children: /* @__PURE__ */ jsx43(
7088
- WebIcon,
7089
- {
7090
- name: "more-horizontal",
7091
- size: iconSizes11.small,
7092
- color: "currentColor",
7093
- fallback: "\u22EF",
7094
- className: "items-center justify-center"
7095
- }
7096
- )
7108
+ children: /* @__PURE__ */ jsx43(EllipsisIcon, {})
7097
7109
  }
7098
7110
  );
7099
7111
  }
7100
7112
  var BreadcrumbEllipsisTrigger = forwardRef12(
7101
7113
  function BreadcrumbEllipsisTrigger2({ className, type = "button", children, ...props }, ref) {
7102
7114
  return /* @__PURE__ */ jsx43(
7103
- "button",
7115
+ Button,
7104
7116
  {
7105
7117
  ref,
7106
7118
  type,
7119
+ variant: "ghost",
7120
+ size: "sm",
7121
+ layout: "icon",
7107
7122
  "data-refineui": "breadcrumb-ellipsis",
7108
- className: clsx55(
7109
- breadcrumbStyles.ellipsisTrigger,
7110
- className
7111
- ),
7123
+ className: clsx55(breadcrumbStyles.ellipsisTrigger, className),
7112
7124
  ...props,
7113
- children: children ?? /* @__PURE__ */ jsx43(
7114
- WebIcon,
7115
- {
7116
- name: "more-horizontal",
7117
- size: iconSizes11.small,
7118
- color: "currentColor",
7119
- fallback: "\u22EF",
7120
- className: "items-center justify-center"
7121
- }
7122
- )
7125
+ children: children ?? /* @__PURE__ */ jsx43(EllipsisIcon, {})
7123
7126
  }
7124
7127
  );
7125
7128
  }
@@ -8587,13 +8590,17 @@ import { resolveColorTokenValue as resolveColorTokenValue7 } from "@refineui/uti
8587
8590
 
8588
8591
  // src/components/Dropdown/style.ts
8589
8592
  import { clsx as clsx69 } from "clsx";
8593
+ var dropdownPanelChrome = "box-border flex w-refineui-dropdown-menu-width min-w-refineui-dropdown-menu-width flex-col overflow-hidden rounded-refineui-xx-large border-refineui-hairline border-refineui-alias-border-default shadow-refineui-2 outline-none";
8590
8594
  var dropdownStyles = {
8591
- menuShell: "box-border flex w-refineui-dropdown-menu-width min-w-refineui-dropdown-menu-width max-w-[min(100vw-16px,calc(100vw-2rem))] flex-col overflow-hidden rounded-refineui-large border-refineui-hairline border-refineui-alias-border-default bg-refineui-alias-background-primary shadow-refineui-2 outline-none",
8592
- submenuShell: "box-border flex w-refineui-dropdown-menu-width min-w-refineui-dropdown-menu-width flex-col overflow-hidden rounded-refineui-large border-refineui-hairline border-refineui-alias-border-default bg-refineui-alias-background-primary shadow-refineui-2 outline-none",
8595
+ menuShell: clsx69(
8596
+ dropdownPanelChrome,
8597
+ "max-w-[min(100vw-16px,calc(100vw-2rem))]"
8598
+ ),
8599
+ submenuShell: dropdownPanelChrome,
8593
8600
  menuViewport: "box-border flex flex-col gap-px p-refineui-size-xx-small",
8594
8601
  label: clsx69(
8595
8602
  componentTextClass(componentTypographyTokens.dropdown.label),
8596
- "shrink-0 px-refineui-size-x-small py-refineui-size-x-small text-refineui-alias-foreground-tertiary"
8603
+ "shrink-0 px-refineui-size-x-small py-refineui-size-xxx-small text-refineui-alias-foreground-tertiary"
8597
8604
  ),
8598
8605
  item: clsx69(
8599
8606
  componentTextClass(componentTypographyTokens.dropdown.item),
@@ -9472,16 +9479,21 @@ import { Slot as Slot2, getMergeableTriggerChild as getMergeableTriggerChild2 }
9472
9479
 
9473
9480
  // src/components/Menu/style.ts
9474
9481
  import { clsx as clsx75 } from "clsx";
9482
+ var menuPanelChrome = "box-border flex flex-col gap-px overflow-hidden rounded-refineui-xx-large border-refineui-hairline border-refineui-alias-border-default p-refineui-size-xx-small shadow-refineui-2";
9475
9483
  var menuStyles = {
9476
- /** Panel chrome — Web Kit Menu `633:4268` (fill matches Dropdown elevated panel for contrast on docs) */
9477
- panel: "box-border flex w-refineui-menu-panel-width flex-col gap-px overflow-hidden rounded-refineui-large border-refineui-hairline border-refineui-alias-border-default bg-refineui-alias-background-primary p-refineui-size-xx-small shadow-refineui-2",
9484
+ /** Panel chrome — Web Kit Menu `633:4268` (fill/blur: `surfaceFrosted` + `surfaceFrost`) */
9485
+ panel: clsx75(menuPanelChrome, "w-refineui-menu-panel-width"),
9478
9486
  root: "relative inline-flex items-center leading-none",
9479
9487
  triggerFallback: "cursor-pointer border-none bg-transparent p-0 font-inherit text-inherit",
9480
9488
  /** Portal shell — position/z-index from `MenuPopover` fixed style */
9481
9489
  popover: "z-refineui-messages",
9482
- list: "box-border flex w-full min-w-refineui-menu-panel-width flex-col gap-px overflow-hidden rounded-refineui-large border-refineui-hairline border-refineui-alias-border-default bg-refineui-alias-background-primary p-refineui-size-xx-small shadow-refineui-2 outline-none",
9483
- subPanel: "box-border flex w-refineui-menu-panel-width min-w-refineui-menu-panel-width flex-col gap-px overflow-hidden rounded-refineui-large border-refineui-hairline border-refineui-alias-border-default bg-refineui-alias-background-primary p-refineui-size-xx-small shadow-refineui-2 outline-none",
9484
- section: "flex w-full items-center overflow-hidden px-refineui-size-x-small py-refineui-size-x-small",
9490
+ list: clsx75(menuPanelChrome, "w-full min-w-refineui-menu-panel-width outline-none"),
9491
+ subPanel: clsx75(
9492
+ menuPanelChrome,
9493
+ "w-refineui-menu-panel-width min-w-refineui-menu-panel-width outline-none"
9494
+ ),
9495
+ /** Vertical density matches Sidebar `groupLabel` (`py-xxx-small`). */
9496
+ section: "flex w-full items-center overflow-hidden px-refineui-size-x-small py-refineui-size-xxx-small",
9485
9497
  sectionText: clsx75(
9486
9498
  componentTextClass(componentTypographyTokens.menu.section),
9487
9499
  "text-refineui-alias-foreground-tertiary"
@@ -9664,11 +9676,11 @@ function MenuList({ className, ...props }) {
9664
9676
  }
9665
9677
  );
9666
9678
  }
9667
- function MenuSection({ className, children, ...props }) {
9679
+ function MenuLabel({ className, children, ...props }) {
9668
9680
  return /* @__PURE__ */ jsx58(
9669
9681
  "div",
9670
9682
  {
9671
- "data-refineui": "menu-section",
9683
+ "data-refineui": "menu-label",
9672
9684
  className: clsx76(menuStyles.section, className),
9673
9685
  ...props,
9674
9686
  children: /* @__PURE__ */ jsx58("span", { className: menuStyles.sectionText, children })
@@ -14709,7 +14721,7 @@ var CHART_VIEWBOX_HEIGHT = 320;
14709
14721
  var CHART_PLOT_PADDING_TOP = parseFloat(spacings7.sizeMedium);
14710
14722
  var CHART_PLOT_PADDING_BOTTOM = parseFloat(spacings7.sizeXXSmall);
14711
14723
  var CHART_PLOT_PADDING_X = parseFloat(spacings7.sizeMedium);
14712
- var CHART_BAR_RADIUS = parseFloat(borderRadii.roundedMedium);
14724
+ var CHART_BAR_RADIUS = parseFloat(borderRadii.roundedXLarge);
14713
14725
  var CHART_BAR_BAND_FILL = 0.5;
14714
14726
  var CHART_POINT_RADIUS = parseFloat(foundationSizes3.foundationSize40);
14715
14727
  var CHART_POINT_STROKE = parseFloat(foundationSizes3.foundationSize20);
@@ -15359,48 +15371,68 @@ import { Slot as Slot5 } from "@refineui/utilities/react";
15359
15371
 
15360
15372
  // src/components/Collapsible/Collapsible.tsx
15361
15373
  import {
15362
- createContext as createContext27,
15363
15374
  forwardRef as forwardRef16,
15364
- useContext as useContext31,
15365
- useEffect as useEffect21,
15375
+ useCallback as useCallback22,
15366
15376
  useId as useId18,
15367
- useLayoutEffect as useLayoutEffect14,
15368
- useRef as useRef24,
15369
- useState as useState32
15377
+ useMemo as useMemo23,
15378
+ useState as useState33
15370
15379
  } from "react";
15371
15380
  import { clsx as clsx108 } from "clsx";
15372
- import { semanticInteraction as semanticInteraction9 } from "@refineui/tokens";
15373
15381
  import { Slot as Slot6 } from "@refineui/utilities/react";
15374
- import { jsx as jsx78 } from "react/jsx-runtime";
15382
+
15383
+ // src/components/Collapsible/context.ts
15384
+ import { createContext as createContext27, useContext as useContext31, useEffect as useEffect21, useState as useState32 } from "react";
15385
+ import { semanticInteraction as semanticInteraction9 } from "@refineui/tokens";
15386
+ import { getReducedMotionQuery as getReducedMotionQuery3 } from "@refineui/utilities/animation";
15375
15387
  var CollapsibleContext = createContext27(null);
15376
- function useCollapsible() {
15388
+ function useCollapsibleContext(part) {
15377
15389
  const value = useContext31(CollapsibleContext);
15378
- if (!value) throw new Error("Collapsible parts must be used inside Collapsible.Root");
15390
+ if (!value) throw new Error(`${part} must be used within Collapsible`);
15379
15391
  return value;
15380
15392
  }
15381
15393
  function usePrefersReducedMotion3() {
15382
15394
  const [reduce, setReduce] = useState32(false);
15383
15395
  useEffect21(() => {
15384
- const query = window.matchMedia("(prefers-reduced-motion: reduce)");
15385
- const sync = () => setReduce(query.matches);
15396
+ const mql = window.matchMedia(getReducedMotionQuery3().replace("@media ", ""));
15397
+ const sync = () => setReduce(mql.matches);
15386
15398
  sync();
15387
- query.addEventListener("change", sync);
15388
- return () => query.removeEventListener("change", sync);
15399
+ mql.addEventListener("change", sync);
15400
+ return () => mql.removeEventListener("change", sync);
15389
15401
  }, []);
15390
15402
  return reduce;
15391
15403
  }
15392
- var CollapsibleRoot = forwardRef16(function CollapsibleRoot2({ open: openProp, defaultOpen = false, onOpenChange, asChild = false, className, children, ...props }, ref) {
15393
- const [uncontrolled, setUncontrolled] = useState32(defaultOpen);
15404
+ var PANEL_HEIGHT_MS2 = Number.parseFloat(semanticInteraction9.duration.panel) / 1e3;
15405
+ var PANEL_CONTENT_MS2 = Number.parseFloat(semanticInteraction9.duration.normal) / 1e3;
15406
+ var PANEL_HEIGHT_EASE2 = semanticInteraction9.easing.panel;
15407
+ var PANEL_CONTENT_EASE2 = semanticInteraction9.easing.content;
15408
+
15409
+ // src/components/Collapsible/style.ts
15410
+ var collapsibleStyles = {
15411
+ panelOuter: "min-h-0 overflow-hidden"
15412
+ };
15413
+
15414
+ // src/components/Collapsible/Collapsible.tsx
15415
+ import { jsx as jsx78 } from "react/jsx-runtime";
15416
+ var Collapsible = forwardRef16(function Collapsible2({ open: openProp, defaultOpen = false, onOpenChange, asChild = false, className, children, ...props }, ref) {
15417
+ const [uncontrolled, setUncontrolled] = useState33(defaultOpen);
15394
15418
  const open = openProp ?? uncontrolled;
15395
- const openRef = useRef24(open);
15396
- openRef.current = open;
15397
15419
  const reactId = useId18();
15398
15420
  const reduceMotion = usePrefersReducedMotion3();
15399
- const toggle = () => {
15400
- const next = !openRef.current;
15421
+ const toggle = useCallback22(() => {
15422
+ const next = !(openProp ?? uncontrolled);
15401
15423
  if (openProp === void 0) setUncontrolled(next);
15402
15424
  onOpenChange?.(next);
15403
- };
15425
+ }, [onOpenChange, openProp, uncontrolled]);
15426
+ const contextValue = useMemo23(
15427
+ () => ({
15428
+ open,
15429
+ toggle,
15430
+ contentId: `${reactId}-content`,
15431
+ triggerId: `${reactId}-trigger`,
15432
+ reduceMotion
15433
+ }),
15434
+ [open, reactId, reduceMotion, toggle]
15435
+ );
15404
15436
  const shared = {
15405
15437
  ...props,
15406
15438
  ref,
@@ -15408,94 +15440,73 @@ var CollapsibleRoot = forwardRef16(function CollapsibleRoot2({ open: openProp, d
15408
15440
  "data-refineui": "collapsible",
15409
15441
  className
15410
15442
  };
15411
- return /* @__PURE__ */ jsx78(
15412
- CollapsibleContext.Provider,
15413
- {
15414
- value: {
15415
- open,
15416
- toggle,
15417
- contentId: `${reactId}-content`,
15418
- triggerId: `${reactId}-trigger`,
15419
- reduceMotion
15420
- },
15421
- children: asChild ? /* @__PURE__ */ jsx78(Slot6, { ...shared, children }) : /* @__PURE__ */ jsx78("div", { ...shared, children })
15422
- }
15423
- );
15424
- });
15425
- var CollapsibleTrigger = forwardRef16(function CollapsibleTrigger2({ asChild = false, onClick, className, children, ...props }, ref) {
15426
- const { open, toggle, contentId, triggerId } = useCollapsible();
15427
- const shared = {
15428
- ...props,
15429
- ref,
15430
- id: triggerId,
15431
- "aria-expanded": open,
15432
- "aria-controls": contentId,
15433
- "data-state": open ? "open" : "closed",
15434
- "data-refineui": "collapsible-trigger",
15435
- className,
15436
- onClick: (event) => {
15437
- onClick?.(event);
15438
- if (!event.defaultPrevented) toggle();
15439
- }
15440
- };
15441
- if (asChild) return /* @__PURE__ */ jsx78(Slot6, { ...shared, children });
15442
- return /* @__PURE__ */ jsx78("button", { ...shared, type: "button", children });
15443
+ return /* @__PURE__ */ jsx78(CollapsibleContext.Provider, { value: contextValue, children: asChild ? /* @__PURE__ */ jsx78(Slot6, { ...shared, children }) : /* @__PURE__ */ jsx78("div", { ...shared, children }) });
15443
15444
  });
15444
- var CollapsibleContent = forwardRef16(function CollapsibleContent2({ className, children, style, ...props }, ref) {
15445
- const { open, contentId, triggerId, reduceMotion } = useCollapsible();
15446
- const innerRef = useRef24(null);
15447
- const [size, setSize] = useState32({ height: 0, width: 0 });
15448
- useLayoutEffect14(() => {
15449
- const node = innerRef.current;
15450
- if (!node) return;
15451
- const measure = () => {
15452
- setSize({ height: node.scrollHeight, width: node.scrollWidth });
15453
- };
15454
- measure();
15455
- const observer = new ResizeObserver(measure);
15456
- observer.observe(node);
15457
- return () => observer.disconnect();
15458
- }, [children, open]);
15459
- const clipStyle = {
15460
- ["--refineui-collapsible-content-height"]: `${size.height}px`,
15461
- ["--refineui-collapsible-content-width"]: `${size.width}px`,
15462
- height: open ? size.height : 0,
15463
- overflow: "hidden",
15464
- transition: reduceMotion ? void 0 : `height ${semanticInteraction9.duration.panel} ${semanticInteraction9.easing.panel}`
15465
- };
15466
- return /* @__PURE__ */ jsx78(
15467
- "div",
15468
- {
15445
+ var CollapsibleTrigger = forwardRef16(
15446
+ function CollapsibleTrigger2({ asChild = false, onClick, className, children, ...props }, ref) {
15447
+ const { open, toggle, contentId, triggerId } = useCollapsibleContext("CollapsibleTrigger");
15448
+ const shared = {
15469
15449
  ...props,
15470
15450
  ref,
15471
- id: contentId,
15472
- role: "region",
15473
- "aria-labelledby": triggerId,
15474
- "aria-hidden": !open,
15451
+ id: triggerId,
15452
+ "aria-expanded": open,
15453
+ "aria-controls": contentId,
15475
15454
  "data-state": open ? "open" : "closed",
15476
- "data-refineui": "collapsible-content",
15477
- style: clipStyle,
15478
- children: /* @__PURE__ */ jsx78("div", { ref: innerRef, className: clsx108(className), style, children })
15479
- }
15480
- );
15481
- });
15482
- var Collapsible = Object.assign(CollapsibleRoot, {
15483
- Root: CollapsibleRoot,
15484
- Trigger: CollapsibleTrigger,
15485
- Content: CollapsibleContent
15486
- });
15455
+ "data-refineui": "collapsible-trigger",
15456
+ className,
15457
+ onClick: (event) => {
15458
+ onClick?.(event);
15459
+ if (!event.defaultPrevented) toggle();
15460
+ }
15461
+ };
15462
+ if (asChild) return /* @__PURE__ */ jsx78(Slot6, { ...shared, children });
15463
+ return /* @__PURE__ */ jsx78("button", { ...shared, type: "button", children });
15464
+ }
15465
+ );
15466
+ var CollapsibleContent = forwardRef16(
15467
+ function CollapsibleContent2({ className, children, style, ...props }, ref) {
15468
+ const { open, contentId, triggerId, reduceMotion } = useCollapsibleContext("CollapsibleContent");
15469
+ const gridStyle = {
15470
+ display: "grid",
15471
+ gridTemplateRows: open ? "1fr" : "0fr",
15472
+ transition: reduceMotion ? void 0 : `grid-template-rows ${PANEL_HEIGHT_MS2}s ${PANEL_HEIGHT_EASE2}`
15473
+ };
15474
+ const innerMotionStyle = {
15475
+ opacity: open ? 1 : 0,
15476
+ transform: open ? "translate3d(0, 0, 0)" : "translate3d(0, calc(-1 * var(--refineui-spacing-size-x-small)), 0)",
15477
+ transition: reduceMotion ? void 0 : `opacity ${PANEL_CONTENT_MS2}s ${PANEL_CONTENT_EASE2}, transform ${PANEL_CONTENT_MS2}s ${PANEL_CONTENT_EASE2}`,
15478
+ pointerEvents: open ? void 0 : "none",
15479
+ ...style
15480
+ };
15481
+ return /* @__PURE__ */ jsx78(
15482
+ "div",
15483
+ {
15484
+ ...props,
15485
+ ref,
15486
+ id: contentId,
15487
+ role: "region",
15488
+ "aria-labelledby": triggerId,
15489
+ "aria-hidden": !open,
15490
+ "data-state": open ? "open" : "closed",
15491
+ "data-refineui": "collapsible-content",
15492
+ style: gridStyle,
15493
+ children: /* @__PURE__ */ jsx78("div", { className: collapsibleStyles.panelOuter, children: /* @__PURE__ */ jsx78("div", { className: clsx108(className), style: innerMotionStyle, children }) })
15494
+ }
15495
+ );
15496
+ }
15497
+ );
15487
15498
 
15488
15499
  // src/components/ContextMenu/ContextMenu.tsx
15489
15500
  import {
15490
15501
  createContext as createContext28,
15491
15502
  forwardRef as forwardRef17,
15492
- useCallback as useCallback22,
15503
+ useCallback as useCallback23,
15493
15504
  useContext as useContext32,
15494
15505
  useEffect as useEffect22,
15495
- useLayoutEffect as useLayoutEffect15,
15496
- useMemo as useMemo23,
15497
- useRef as useRef25,
15498
- useState as useState33
15506
+ useLayoutEffect as useLayoutEffect14,
15507
+ useMemo as useMemo24,
15508
+ useRef as useRef24,
15509
+ useState as useState34
15499
15510
  } from "react";
15500
15511
  import { createPortal as createPortal7 } from "react-dom";
15501
15512
  import { clsx as clsx109 } from "clsx";
@@ -15509,7 +15520,7 @@ var MenuContext2 = createContext28(null);
15509
15520
  var SubContext = createContext28(null);
15510
15521
  function useMenu() {
15511
15522
  const value = useContext32(MenuContext2);
15512
- if (!value) throw new Error("Context menu parts must be used inside ContextMenu.Root");
15523
+ if (!value) throw new Error("Context menu parts must be used within ContextMenu");
15513
15524
  return value;
15514
15525
  }
15515
15526
  function placeInView(element, x, y) {
@@ -15523,28 +15534,28 @@ function placeInView(element, x, y) {
15523
15534
  element.style.left = `${left}px`;
15524
15535
  element.style.top = `${top}px`;
15525
15536
  }
15526
- function ContextMenuRoot({ modal = true, onOpenChange, children }) {
15537
+ function ContextMenu({ modal = true, onOpenChange, children }) {
15527
15538
  void modal;
15528
- const [open, setOpen] = useState33(false);
15529
- const [point, setPoint] = useState33({ x: 0, y: 0 });
15530
- const openRef = useRef25(false);
15531
- const onOpenChangeRef = useRef25(onOpenChange);
15539
+ const [open, setOpen] = useState34(false);
15540
+ const [point, setPoint] = useState34({ x: 0, y: 0 });
15541
+ const openRef = useRef24(false);
15542
+ const onOpenChangeRef = useRef24(onOpenChange);
15532
15543
  openRef.current = open;
15533
15544
  onOpenChangeRef.current = onOpenChange;
15534
- const close = useCallback22(() => {
15545
+ const close = useCallback23(() => {
15535
15546
  if (!openRef.current) return;
15536
15547
  openRef.current = false;
15537
15548
  setOpen(false);
15538
15549
  onOpenChangeRef.current?.(false);
15539
15550
  }, []);
15540
- const openAt = useCallback22((x, y) => {
15551
+ const openAt = useCallback23((x, y) => {
15541
15552
  setPoint({ x, y });
15542
15553
  const wasOpen = openRef.current;
15543
15554
  openRef.current = true;
15544
15555
  setOpen(true);
15545
15556
  if (!wasOpen) onOpenChangeRef.current?.(true);
15546
15557
  }, []);
15547
- const value = useMemo23(() => ({ open, point, openAt, close }), [open, point, openAt, close]);
15558
+ const value = useMemo24(() => ({ open, point, openAt, close }), [open, point, openAt, close]);
15548
15559
  return /* @__PURE__ */ jsx79(MenuContext2.Provider, { value, children });
15549
15560
  }
15550
15561
  var ContextMenuTrigger = forwardRef17(function ContextMenuTrigger2({ asChild = false, onContextMenu, children, ...props }, ref) {
@@ -15568,9 +15579,9 @@ function ContextMenuPortal({ children }) {
15568
15579
  }
15569
15580
  var ContextMenuContent = forwardRef17(function ContextMenuContent2({ className, style, onPointerDown, children, ...props }, ref) {
15570
15581
  const { open, point, close } = useMenu();
15571
- const localRef = useRef25(null);
15572
- const [shouldRender, setShouldRender] = useState33(open);
15573
- const [isClosing, setIsClosing] = useState33(false);
15582
+ const localRef = useRef24(null);
15583
+ const [shouldRender, setShouldRender] = useState34(open);
15584
+ const [isClosing, setIsClosing] = useState34(false);
15574
15585
  useEffect22(() => {
15575
15586
  if (open) {
15576
15587
  setShouldRender(true);
@@ -15585,7 +15596,7 @@ var ContextMenuContent = forwardRef17(function ContextMenuContent2({ className,
15585
15596
  }, CLOSE_MS);
15586
15597
  return () => window.clearTimeout(timeout);
15587
15598
  }, [open, shouldRender]);
15588
- useLayoutEffect15(() => {
15599
+ useLayoutEffect14(() => {
15589
15600
  if (!shouldRender || !localRef.current) return;
15590
15601
  placeInView(localRef.current, point.x, point.y);
15591
15602
  }, [shouldRender, point.x, point.y]);
@@ -15727,19 +15738,19 @@ var ContextMenuSeparator = forwardRef17(
15727
15738
  );
15728
15739
  }
15729
15740
  );
15730
- function ContextMenuSection({ className, children, ...props }) {
15731
- return /* @__PURE__ */ jsx79("div", { "data-refineui": "menu-section", className: clsx109(menuStyles.section, className), ...props, children: /* @__PURE__ */ jsx79("span", { className: menuStyles.sectionText, children }) });
15741
+ function ContextMenuLabel({ className, children, ...props }) {
15742
+ return /* @__PURE__ */ jsx79("div", { "data-refineui": "menu-label", className: clsx109(menuStyles.section, className), ...props, children: /* @__PURE__ */ jsx79("span", { className: menuStyles.sectionText, children }) });
15732
15743
  }
15733
15744
  function ContextMenuSub({ children }) {
15734
- const [open, setOpen] = useState33(false);
15735
- const triggerRef = useRef25(null);
15736
- const timer = useRef25(null);
15745
+ const [open, setOpen] = useState34(false);
15746
+ const triggerRef = useRef24(null);
15747
+ const timer = useRef24(null);
15737
15748
  const clear = () => {
15738
15749
  if (timer.current != null) window.clearTimeout(timer.current);
15739
15750
  timer.current = null;
15740
15751
  };
15741
15752
  useEffect22(() => clear, []);
15742
- const value = useMemo23(
15753
+ const value = useMemo24(
15743
15754
  () => ({
15744
15755
  open,
15745
15756
  triggerRef,
@@ -15758,7 +15769,7 @@ function ContextMenuSub({ children }) {
15758
15769
  }
15759
15770
  function useSub2() {
15760
15771
  const value = useContext32(SubContext);
15761
- if (!value) throw new Error("ContextMenu.SubTrigger must be used inside ContextMenu.Sub");
15772
+ if (!value) throw new Error("ContextMenuSubTrigger must be used within ContextMenuSub");
15762
15773
  return value;
15763
15774
  }
15764
15775
  var ContextMenuSubTrigger = forwardRef17(
@@ -15825,9 +15836,9 @@ var ContextMenuSubTrigger = forwardRef17(
15825
15836
  var ContextMenuSubContent = forwardRef17(
15826
15837
  function ContextMenuSubContent2({ className, style, onPointerDown, onMouseEnter, onMouseLeave, ...props }, ref) {
15827
15838
  const sub = useSub2();
15828
- const localRef = useRef25(null);
15829
- const [side, setSide] = useState33("right");
15830
- useLayoutEffect15(() => {
15839
+ const localRef = useRef24(null);
15840
+ const [side, setSide] = useState34("right");
15841
+ useLayoutEffect14(() => {
15831
15842
  const trigger = sub.triggerRef.current;
15832
15843
  const element = localRef.current;
15833
15844
  if (!sub.open || !trigger || !element) return;
@@ -15881,18 +15892,6 @@ var ContextMenuSubContent = forwardRef17(
15881
15892
  );
15882
15893
  }
15883
15894
  );
15884
- var ContextMenu = Object.assign(ContextMenuRoot, {
15885
- Root: ContextMenuRoot,
15886
- Trigger: ContextMenuTrigger,
15887
- Portal: ContextMenuPortal,
15888
- Content: ContextMenuContent,
15889
- Item: ContextMenuItem,
15890
- Section: ContextMenuSection,
15891
- Separator: ContextMenuSeparator,
15892
- Sub: ContextMenuSub,
15893
- SubTrigger: ContextMenuSubTrigger,
15894
- SubContent: ContextMenuSubContent
15895
- });
15896
15895
  export {
15897
15896
  Accordion,
15898
15897
  AccordionContent,
@@ -15964,7 +15963,6 @@ export {
15964
15963
  Chip,
15965
15964
  Collapsible,
15966
15965
  CollapsibleContent,
15967
- CollapsibleRoot,
15968
15966
  CollapsibleTrigger,
15969
15967
  Command,
15970
15968
  CommandDialog,
@@ -15980,9 +15978,8 @@ export {
15980
15978
  ContextMenu,
15981
15979
  ContextMenuContent,
15982
15980
  ContextMenuItem,
15981
+ ContextMenuLabel,
15983
15982
  ContextMenuPortal,
15984
- ContextMenuRoot,
15985
- ContextMenuSection,
15986
15983
  ContextMenuSeparator,
15987
15984
  ContextMenuSub,
15988
15985
  ContextMenuSubContent,
@@ -16050,9 +16047,9 @@ export {
16050
16047
  Menu,
16051
16048
  MenuDivider,
16052
16049
  MenuItem,
16050
+ MenuLabel,
16053
16051
  MenuList,
16054
16052
  MenuPopover,
16055
- MenuSection,
16056
16053
  MenuSub,
16057
16054
  MenuSubContent,
16058
16055
  MenuSubTrigger,
@@ -16109,7 +16106,6 @@ export {
16109
16106
  SelectPortal,
16110
16107
  SelectScrollDownButton,
16111
16108
  SelectScrollUpButton,
16112
- SelectSection,
16113
16109
  SelectSeparator,
16114
16110
  SelectTrigger,
16115
16111
  SelectValue,