@kumix/ui 0.3.10 → 0.3.11

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.
Files changed (105) hide show
  1. package/README.md +14 -14
  2. package/dist/components/motion/adaptive-stepper.d.ts +32 -0
  3. package/dist/components/motion/adaptive-stepper.d.ts.map +1 -0
  4. package/dist/components/motion/adaptive-stepper.js +302 -0
  5. package/dist/components/motion/adaptive-stepper.js.map +1 -0
  6. package/dist/components/motion/combobox/content.js +1 -1
  7. package/dist/components/motion/combobox/context.js +216 -1
  8. package/dist/components/motion/combobox/context.js.map +1 -0
  9. package/dist/components/motion/combobox/list.js +1 -1
  10. package/dist/components/motion/combobox/trigger.js +1 -1
  11. package/dist/components/motion/combobox.js +1 -1
  12. package/dist/components/motion/input.d.ts +2 -0
  13. package/dist/components/motion/input.d.ts.map +1 -1
  14. package/dist/components/motion/input.js +28 -25
  15. package/dist/components/motion/input.js.map +1 -1
  16. package/dist/components/motion/liquid.d.ts +30 -0
  17. package/dist/components/motion/liquid.d.ts.map +1 -0
  18. package/dist/components/motion/liquid.js +248 -0
  19. package/dist/components/motion/liquid.js.map +1 -0
  20. package/dist/components/motion/multi-select/content.d.ts +16 -0
  21. package/dist/components/motion/multi-select/content.d.ts.map +1 -0
  22. package/dist/components/motion/multi-select/content.js +91 -0
  23. package/dist/components/motion/multi-select/content.js.map +1 -0
  24. package/dist/components/motion/multi-select/context.d.ts +64 -0
  25. package/dist/components/motion/multi-select/context.d.ts.map +1 -0
  26. package/dist/{context-BizvUNZv.js → components/motion/multi-select/context.js} +44 -114
  27. package/dist/components/motion/multi-select/context.js.map +1 -0
  28. package/dist/components/motion/multi-select/index.d.ts +5 -0
  29. package/dist/components/motion/multi-select/index.js +6 -0
  30. package/dist/components/motion/multi-select/list.d.ts +40 -0
  31. package/dist/components/motion/multi-select/list.d.ts.map +1 -0
  32. package/dist/components/motion/multi-select/list.js +144 -0
  33. package/dist/components/motion/multi-select/list.js.map +1 -0
  34. package/dist/components/motion/multi-select/trigger.d.ts +22 -0
  35. package/dist/components/motion/multi-select/trigger.d.ts.map +1 -0
  36. package/dist/components/motion/multi-select/trigger.js +185 -0
  37. package/dist/components/motion/multi-select/trigger.js.map +1 -0
  38. package/dist/components/motion/signup-form.js +6 -2
  39. package/dist/components/motion/signup-form.js.map +1 -1
  40. package/dist/components/motion/table/index.js.map +1 -1
  41. package/dist/components/reui/alert.d.ts +1 -1
  42. package/dist/components/reui/badge.d.ts +1 -1
  43. package/dist/components/reui/cascader/cascader-async.d.ts.map +1 -1
  44. package/dist/components/reui/cascader/cascader-async.js.map +1 -1
  45. package/dist/components/reui/cascader/cascader-virtual.d.ts.map +1 -1
  46. package/dist/components/reui/cascader/cascader-virtual.js.map +1 -1
  47. package/dist/components/reui/cascader/cascader.d.ts.map +1 -1
  48. package/dist/components/reui/cascader/cascader.js.map +1 -1
  49. package/dist/components/reui/code-block/code-block.js.map +1 -1
  50. package/dist/components/reui/data-grid/data-grid-cell-selection.d.ts +117 -0
  51. package/dist/components/reui/data-grid/data-grid-cell-selection.d.ts.map +1 -0
  52. package/dist/components/reui/data-grid/data-grid-cell-selection.js +1554 -0
  53. package/dist/components/reui/data-grid/data-grid-cell-selection.js.map +1 -0
  54. package/dist/components/reui/data-grid/data-grid-column-filter.d.ts.map +1 -1
  55. package/dist/components/reui/data-grid/data-grid-column-filter.js +6 -4
  56. package/dist/components/reui/data-grid/data-grid-column-filter.js.map +1 -1
  57. package/dist/components/reui/data-grid/data-grid-column-header.d.ts.map +1 -1
  58. package/dist/components/reui/data-grid/data-grid-column-header.js +10 -7
  59. package/dist/components/reui/data-grid/data-grid-column-header.js.map +1 -1
  60. package/dist/components/reui/data-grid/data-grid-column-visibility.js +3 -2
  61. package/dist/components/reui/data-grid/data-grid-column-visibility.js.map +1 -1
  62. package/dist/components/reui/data-grid/data-grid-i18n.d.ts +2 -0
  63. package/dist/components/reui/data-grid/data-grid-i18n.js +53 -0
  64. package/dist/components/reui/data-grid/data-grid-i18n.js.map +1 -0
  65. package/dist/components/reui/data-grid/data-grid-pagination.js +14 -8
  66. package/dist/components/reui/data-grid/data-grid-pagination.js.map +1 -1
  67. package/dist/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -1
  68. package/dist/components/reui/data-grid/data-grid-scroll-area.js +3 -3
  69. package/dist/components/reui/data-grid/data-grid-scroll-area.js.map +1 -1
  70. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.d.ts.map +1 -1
  71. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js +6 -4
  72. package/dist/components/reui/data-grid/data-grid-table-dnd-rows.js.map +1 -1
  73. package/dist/components/reui/data-grid/data-grid-table-dnd.js +2 -2
  74. package/dist/components/reui/data-grid/data-grid-table-dnd.js.map +1 -1
  75. package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts +17 -1
  76. package/dist/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -1
  77. package/dist/components/reui/data-grid/data-grid-table-virtual.js +146 -50
  78. package/dist/components/reui/data-grid/data-grid-table-virtual.js.map +1 -1
  79. package/dist/components/reui/data-grid/data-grid-table.d.ts +23 -4
  80. package/dist/components/reui/data-grid/data-grid-table.d.ts.map +1 -1
  81. package/dist/components/reui/data-grid/data-grid-table.js +215 -68
  82. package/dist/components/reui/data-grid/data-grid-table.js.map +1 -1
  83. package/dist/components/reui/data-grid/data-grid.d.ts +276 -6
  84. package/dist/components/reui/data-grid/data-grid.d.ts.map +1 -1
  85. package/dist/components/reui/data-grid/data-grid.js +150 -15
  86. package/dist/components/reui/data-grid/data-grid.js.map +1 -1
  87. package/dist/components/reui/filters/filters-advanced.js.map +1 -1
  88. package/dist/components/reui/filters/filters-chip.js.map +1 -1
  89. package/dist/components/reui/filters/filters.d.ts.map +1 -1
  90. package/dist/components/reui/filters/filters.js.map +1 -1
  91. package/dist/components/reui/icon-tile.d.ts +1 -1
  92. package/dist/components/ui/badge.d.ts +1 -1
  93. package/dist/components/ui/bubble.d.ts +1 -1
  94. package/dist/components/ui/button.d.ts +1 -1
  95. package/dist/components/ui/item.d.ts +1 -1
  96. package/dist/components/ui/marker.d.ts +1 -1
  97. package/dist/components/ui/message-scroller.js +1 -1
  98. package/dist/components/ui/message-scroller.js.map +1 -1
  99. package/dist/components/ui/tabs.d.ts +1 -1
  100. package/dist/data-grid-i18n-52UUYPbr.d.ts +66 -0
  101. package/dist/data-grid-i18n-52UUYPbr.d.ts.map +1 -0
  102. package/dist/use-active-option-CmX6Z-4S.js +86 -0
  103. package/dist/use-active-option-CmX6Z-4S.js.map +1 -0
  104. package/package.json +5 -5
  105. package/dist/context-BizvUNZv.js.map +0 -1
@@ -11,7 +11,7 @@ declare const itemVariants: (props?: ({
11
11
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
12
  declare function Item({ className, variant, size, render, ...props }: useRender.ComponentProps<"div"> & VariantProps<typeof itemVariants>): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
13
13
  declare const itemMediaVariants: (props?: ({
14
- variant?: "image" | "default" | "icon" | null | undefined;
14
+ variant?: "default" | "image" | "icon" | null | undefined;
15
15
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
16
16
  declare function ItemMedia({ className, variant, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>): React$1.JSX.Element;
17
17
  declare function ItemContent({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
@@ -3,7 +3,7 @@ import { VariantProps } from "class-variance-authority";
3
3
  import { useRender } from "@base-ui/react/use-render";
4
4
  //#region src/components/ui/marker.d.ts
5
5
  declare const markerVariants: (props?: ({
6
- variant?: "separator" | "default" | "border" | null | undefined;
6
+ variant?: "default" | "separator" | "border" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  declare function Marker({ className, variant, render, ...props }: useRender.ComponentProps<"div"> & VariantProps<typeof markerVariants>): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
9
9
  declare function MarkerIcon({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
@@ -18,7 +18,7 @@ function MessageScroller({ className, ...props }) {
18
18
  function MessageScrollerViewport({ className, ...props }) {
19
19
  return /* @__PURE__ */ jsx(MessageScroller$1.Viewport, {
20
20
  "data-slot": "message-scroller-viewport",
21
- className: cn("scroll-fade-b scrollbar-thin scrollbar-gutter-stable data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent size-full min-h-0 min-w-0 overflow-y-auto overscroll-contain contain-content", className),
21
+ className: cn("scroll-fade-b scrollbar-thin scrollbar-gutter-stable data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent size-full min-h-0 min-w-0 overflow-y-auto overscroll-contain contain-content data-pending-scroll:invisible", className),
22
22
  ...props
23
23
  });
24
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"message-scroller.js","names":["MessageScrollerPrimitive"],"sources":["../../../src/components/ui/message-scroller.tsx"],"sourcesContent":["\"use client\";\n\nimport type * as React from \"react\";\nimport {\n MessageScroller as MessageScrollerPrimitive,\n useMessageScroller,\n useMessageScrollerScrollable,\n useMessageScrollerVisibility,\n} from \"@shadcn/react/message-scroller\";\nimport { ArrowDownIcon } from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { Button } from \"./button\";\n\nfunction MessageScrollerProvider(\n props: React.ComponentProps<typeof MessageScrollerPrimitive.Provider>,\n) {\n return <MessageScrollerPrimitive.Provider {...props} />;\n}\n\nfunction MessageScroller({\n className,\n ...props\n}: React.ComponentProps<typeof MessageScrollerPrimitive.Root>) {\n return (\n <MessageScrollerPrimitive.Root\n data-slot=\"message-scroller\"\n className={cn(\n \"group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction MessageScrollerViewport({\n className,\n ...props\n}: React.ComponentProps<typeof MessageScrollerPrimitive.Viewport>) {\n return (\n <MessageScrollerPrimitive.Viewport\n data-slot=\"message-scroller-viewport\"\n className={cn(\n \"scroll-fade-b scrollbar-thin scrollbar-gutter-stable data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent size-full min-h-0 min-w-0 overflow-y-auto overscroll-contain contain-content\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction MessageScrollerContent({\n className,\n ...props\n}: React.ComponentProps<typeof MessageScrollerPrimitive.Content>) {\n return (\n <MessageScrollerPrimitive.Content\n data-slot=\"message-scroller-content\"\n className={cn(\"flex h-max min-h-full flex-col gap-6\", className)}\n {...props}\n />\n );\n}\n\nfunction MessageScrollerItem({\n className,\n scrollAnchor = false,\n ...props\n}: React.ComponentProps<typeof MessageScrollerPrimitive.Item>) {\n return (\n <MessageScrollerPrimitive.Item\n data-slot=\"message-scroller-item\"\n scrollAnchor={scrollAnchor}\n className={cn(\n \"min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction MessageScrollerButton({\n direction = \"end\",\n className,\n children,\n render,\n variant = \"secondary\",\n size = \"icon-sm\",\n ...props\n}: React.ComponentProps<typeof MessageScrollerPrimitive.Button> &\n Pick<React.ComponentProps<typeof Button>, \"variant\" | \"size\">) {\n return (\n <MessageScrollerPrimitive.Button\n data-slot=\"message-scroller-button\"\n data-direction={direction}\n data-variant={variant}\n data-size={size}\n direction={direction}\n className={cn(\n \"absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:data-[active=false]:-translate-y-full data-[active=false]:pointer-events-none data-[direction=start]:top-4 data-[direction=end]:bottom-4 data-[active=true]:translate-y-0 data-[active=false]:scale-95 data-[active=true]:scale-100 data-[active=false]:opacity-0 data-[active=true]:opacity-100 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180\",\n className,\n )}\n render={render ?? <Button variant={variant} size={size} />}\n {...props}\n >\n {children ?? (\n <>\n <ArrowDownIcon />\n <span className=\"sr-only\">\n {direction === \"end\" ? \"Scroll to end\" : \"Scroll to start\"}\n </span>\n </>\n )}\n </MessageScrollerPrimitive.Button>\n );\n}\n\nexport {\n MessageScroller,\n MessageScrollerButton,\n MessageScrollerContent,\n MessageScrollerItem,\n MessageScrollerProvider,\n MessageScrollerViewport,\n useMessageScroller,\n useMessageScrollerScrollable,\n useMessageScrollerVisibility,\n};\n"],"mappings":";;;;;;;AAcA,SAAS,wBACP,OACA;CACA,OAAO,oBAACA,kBAAyB,UAA1B,EAAmC,GAAI,MAAQ,CAAA;AACxD;AAEA,SAAS,gBAAgB,EACvB,WACA,GAAG,SAC0D;CAC7D,OACE,oBAACA,kBAAyB,MAA1B;EACE,aAAU;EACV,WAAW,GACT,mFACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,wBAAwB,EAC/B,WACA,GAAG,SAC8D;CACjE,OACE,oBAACA,kBAAyB,UAA1B;EACE,aAAU;EACV,WAAW,GACT,mOACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,uBAAuB,EAC9B,WACA,GAAG,SAC6D;CAChE,OACE,oBAACA,kBAAyB,SAA1B;EACE,aAAU;EACV,WAAW,GAAG,wCAAwC,SAAS;EAC/D,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,oBAAoB,EAC3B,WACA,eAAe,OACf,GAAG,SAC0D;CAC7D,OACE,oBAACA,kBAAyB,MAA1B;EACE,aAAU;EACI;EACd,WAAW,GACT,kFACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,sBAAsB,EAC7B,YAAY,OACZ,WACA,UACA,QACA,UAAU,aACV,OAAO,WACP,GAAG,SAE4D;CAC/D,OACE,oBAACA,kBAAyB,QAA1B;EACE,aAAU;EACV,kBAAgB;EAChB,gBAAc;EACd,aAAW;EACA;EACX,WAAW,GACT,yuBACA,SACF;EACA,QAAQ,UAAU,oBAAC,QAAD;GAAiB;GAAe;EAAO,CAAA;EACzD,GAAI;EAEH,UAAA,YACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,eAAD,CAAgB,CAAA,GAChB,oBAAC,QAAD;GAAM,WAAU;GACb,UAAA,cAAc,QAAQ,kBAAkB;EACrC,CAAA,CACN,EAAA,CAAA;CAE2B,CAAA;AAErC"}
1
+ {"version":3,"file":"message-scroller.js","names":["MessageScrollerPrimitive"],"sources":["../../../src/components/ui/message-scroller.tsx"],"sourcesContent":["\"use client\";\n\nimport type * as React from \"react\";\nimport {\n MessageScroller as MessageScrollerPrimitive,\n useMessageScroller,\n useMessageScrollerScrollable,\n useMessageScrollerVisibility,\n} from \"@shadcn/react/message-scroller\";\nimport { ArrowDownIcon } from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { Button } from \"./button\";\n\nfunction MessageScrollerProvider(\n props: React.ComponentProps<typeof MessageScrollerPrimitive.Provider>,\n) {\n return <MessageScrollerPrimitive.Provider {...props} />;\n}\n\nfunction MessageScroller({\n className,\n ...props\n}: React.ComponentProps<typeof MessageScrollerPrimitive.Root>) {\n return (\n <MessageScrollerPrimitive.Root\n data-slot=\"message-scroller\"\n className={cn(\n \"group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction MessageScrollerViewport({\n className,\n ...props\n}: React.ComponentProps<typeof MessageScrollerPrimitive.Viewport>) {\n return (\n <MessageScrollerPrimitive.Viewport\n data-slot=\"message-scroller-viewport\"\n className={cn(\n \"scroll-fade-b scrollbar-thin scrollbar-gutter-stable data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent size-full min-h-0 min-w-0 overflow-y-auto overscroll-contain contain-content data-pending-scroll:invisible\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction MessageScrollerContent({\n className,\n ...props\n}: React.ComponentProps<typeof MessageScrollerPrimitive.Content>) {\n return (\n <MessageScrollerPrimitive.Content\n data-slot=\"message-scroller-content\"\n className={cn(\"flex h-max min-h-full flex-col gap-6\", className)}\n {...props}\n />\n );\n}\n\nfunction MessageScrollerItem({\n className,\n scrollAnchor = false,\n ...props\n}: React.ComponentProps<typeof MessageScrollerPrimitive.Item>) {\n return (\n <MessageScrollerPrimitive.Item\n data-slot=\"message-scroller-item\"\n scrollAnchor={scrollAnchor}\n className={cn(\n \"min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction MessageScrollerButton({\n direction = \"end\",\n className,\n children,\n render,\n variant = \"secondary\",\n size = \"icon-sm\",\n ...props\n}: React.ComponentProps<typeof MessageScrollerPrimitive.Button> &\n Pick<React.ComponentProps<typeof Button>, \"variant\" | \"size\">) {\n return (\n <MessageScrollerPrimitive.Button\n data-slot=\"message-scroller-button\"\n data-direction={direction}\n data-variant={variant}\n data-size={size}\n direction={direction}\n className={cn(\n \"absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:data-[active=false]:-translate-y-full data-[active=false]:pointer-events-none data-[direction=start]:top-4 data-[direction=end]:bottom-4 data-[active=true]:translate-y-0 data-[active=false]:scale-95 data-[active=true]:scale-100 data-[active=false]:opacity-0 data-[active=true]:opacity-100 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180\",\n className,\n )}\n render={render ?? <Button variant={variant} size={size} />}\n {...props}\n >\n {children ?? (\n <>\n <ArrowDownIcon />\n <span className=\"sr-only\">\n {direction === \"end\" ? \"Scroll to end\" : \"Scroll to start\"}\n </span>\n </>\n )}\n </MessageScrollerPrimitive.Button>\n );\n}\n\nexport {\n MessageScroller,\n MessageScrollerButton,\n MessageScrollerContent,\n MessageScrollerItem,\n MessageScrollerProvider,\n MessageScrollerViewport,\n useMessageScroller,\n useMessageScrollerScrollable,\n useMessageScrollerVisibility,\n};\n"],"mappings":";;;;;;;AAcA,SAAS,wBACP,OACA;CACA,OAAO,oBAACA,kBAAyB,UAA1B,EAAmC,GAAI,MAAQ,CAAA;AACxD;AAEA,SAAS,gBAAgB,EACvB,WACA,GAAG,SAC0D;CAC7D,OACE,oBAACA,kBAAyB,MAA1B;EACE,aAAU;EACV,WAAW,GACT,mFACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,wBAAwB,EAC/B,WACA,GAAG,SAC8D;CACjE,OACE,oBAACA,kBAAyB,UAA1B;EACE,aAAU;EACV,WAAW,GACT,iQACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,uBAAuB,EAC9B,WACA,GAAG,SAC6D;CAChE,OACE,oBAACA,kBAAyB,SAA1B;EACE,aAAU;EACV,WAAW,GAAG,wCAAwC,SAAS;EAC/D,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,oBAAoB,EAC3B,WACA,eAAe,OACf,GAAG,SAC0D;CAC7D,OACE,oBAACA,kBAAyB,MAA1B;EACE,aAAU;EACI;EACd,WAAW,GACT,kFACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,sBAAsB,EAC7B,YAAY,OACZ,WACA,UACA,QACA,UAAU,aACV,OAAO,WACP,GAAG,SAE4D;CAC/D,OACE,oBAACA,kBAAyB,QAA1B;EACE,aAAU;EACV,kBAAgB;EAChB,gBAAc;EACd,aAAW;EACA;EACX,WAAW,GACT,yuBACA,SACF;EACA,QAAQ,UAAU,oBAAC,QAAD;GAAiB;GAAe;EAAO,CAAA;EACzD,GAAI;EAEH,UAAA,YACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,eAAD,CAAgB,CAAA,GAChB,oBAAC,QAAD;GAAM,WAAU;GACb,UAAA,cAAc,QAAQ,kBAAkB;EACrC,CAAA,CACN,EAAA,CAAA;CAE2B,CAAA;AAErC"}
@@ -3,7 +3,7 @@ import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
3
3
  //#region src/components/ui/tabs.d.ts
4
4
  declare function Tabs({ className, orientation, ...props }: Tabs$1.Root.Props): import("react").JSX.Element;
5
5
  declare const tabsListVariants: (props?: ({
6
- variant?: "line" | "default" | null | undefined;
6
+ variant?: "default" | "line" | null | undefined;
7
7
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
8
  declare function TabsList({ className, variant, ...props }: Tabs$1.List.Props & VariantProps<typeof tabsListVariants>): import("react").JSX.Element;
9
9
  declare function TabsTrigger({ className, ...props }: Tabs$1.Tab.Props): import("react").JSX.Element;
@@ -0,0 +1,66 @@
1
+ //#region src/components/reui/data-grid/data-grid-i18n.d.ts
2
+ /**
3
+ * Every built-in user-facing string in the data grid, overridable in one
4
+ * place: `<DataGrid i18n={{ labels: { ... } }}>`. The shape follows the
5
+ * event-calendar and gantt convention - a nested config merged per section,
6
+ * with functions for anything interpolated so pluralization and word order
7
+ * live in the label, never in string concatenation at a call site.
8
+ *
9
+ * Precedence, most specific wins: a component-level prop that already
10
+ * existed (`rowCreateLabel`, `loadingMessage`, the pagination label props)
11
+ * beats the matching `i18n` label, which beats the built-in default - so
12
+ * adopting `i18n` is never a breaking change.
13
+ */
14
+ interface DataGridI18nLabels {
15
+ sortAscending: string;
16
+ sortDescending: string;
17
+ pinColumnStart: string;
18
+ pinColumnEnd: string;
19
+ moveColumnStart: string;
20
+ moveColumnEnd: string;
21
+ columnsMenu: string;
22
+ unpinColumn: (title: string) => string;
23
+ toggleColumns: string;
24
+ rowCreate: string;
25
+ pinRow: string;
26
+ unpinRow: string;
27
+ selectRow: string;
28
+ selectAll: string;
29
+ expandRow: string;
30
+ collapseRow: string;
31
+ dragToReorder: string;
32
+ dragToReorderRow: string;
33
+ reorderingUnavailable: string;
34
+ loading: string;
35
+ empty: string;
36
+ allRowsLoaded: string;
37
+ rowsPerPage: string;
38
+ paginationInfo: (info: {
39
+ from: number;
40
+ to: number;
41
+ count: number;
42
+ }) => string;
43
+ previousPage: string;
44
+ nextPage: string;
45
+ goToPage: (page: number) => string;
46
+ paginationEllipsis: string;
47
+ filterSelectedCount: (count: number) => string;
48
+ filterNoResults: string;
49
+ filterClear: string;
50
+ }
51
+ interface DataGridI18nConfig {
52
+ labels: DataGridI18nLabels;
53
+ }
54
+ type DataGridI18nOverrides = {
55
+ labels?: Partial<DataGridI18nLabels>;
56
+ };
57
+ /**
58
+ * A shallow merge per section, deliberately: a deep merge would leak a
59
+ * default back into a function-valued label the consumer replaced. With no
60
+ * overrides the frozen default is returned as-is, so the merge is free to
61
+ * run on every render without producing a new identity.
62
+ */
63
+ declare function mergeDataGridI18n(overrides?: DataGridI18nOverrides): DataGridI18nConfig;
64
+ //#endregion
65
+ export { mergeDataGridI18n as i, DataGridI18nLabels as n, DataGridI18nOverrides as r, DataGridI18nConfig as t };
66
+ //# sourceMappingURL=data-grid-i18n-52UUYPbr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-grid-i18n-52UUYPbr.d.ts","names":[],"sources":["../src/components/reui/data-grid/data-grid-i18n.tsx"],"mappings":";;;;;;;;;;;;;UAeiB;EAEf;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA,iBAAiB;IAAQ;IAAc;IAAY;;EACnD;EACA;EACA,WAAW;EACX;EAEA,sBAAsB;EACtB;EACA;;UAGe;EACf,QAAQ;;KAGE;EACV,SAAS,QAAQ;;;;;;;;iBA+CH,kBAAkB,YAAY,wBAAwB"}
@@ -0,0 +1,86 @@
1
+ import { useCallback, useLayoutEffect, useRef, useState } from "react";
2
+ //#region src/components/motion/combobox/use-active-option.ts
3
+ const isEnabled = (enabledItems, candidate) => candidate !== void 0 && enabledItems.some((i) => i.value === candidate);
4
+ /**
5
+ * The cursor's option, or null once the query or the result set it was placed
6
+ * in has changed. A cursor that outlived either would steal Enter from the row
7
+ * the user is aiming at. The result-set half costs something: a live search
8
+ * that blanks its rows while fetching and returns the same ones loses the moved
9
+ * highlight. That is deliberate — a highlight visibly back at the top beats one
10
+ * silently in the wrong place.
11
+ *
12
+ * It is stamped with the query rather than with the identity of the visible
13
+ * list because callers routinely pass an inline `filter`, which makes that list
14
+ * a fresh array on every render.
15
+ */
16
+ function liveCursorValue(cursor, options) {
17
+ if (cursor === null || cursor.query !== options.query) return null;
18
+ return isEnabled(options.enabledItems, cursor.value) ? cursor.value : null;
19
+ }
20
+ /**
21
+ * Where the highlight sits with no live cursor: the selection if it can be
22
+ * selected, otherwise the first option that can. Only enabled options qualify —
23
+ * an active disabled option would point `aria-activedescendant` at a row Enter
24
+ * then refuses to select.
25
+ */
26
+ function fallbackActive({ value, enabledItems }) {
27
+ return isEnabled(enabledItems, value) ? value : enabledItems[0]?.value ?? null;
28
+ }
29
+ /** The active option, from a cursor that may or may not still be live. */
30
+ const resolveActive = (cursor, options) => liveCursorValue(cursor, options) ?? fallbackActive(options);
31
+ function useActiveOption({ open, ...options }) {
32
+ const { query, value, enabledItems } = options;
33
+ const [cursor, setCursor] = useState(null);
34
+ const live = liveCursorValue(cursor, options);
35
+ if (cursor !== null && live === null) setCursor(null);
36
+ const derived = live ?? fallbackActive(options);
37
+ const [opened, setOpened] = useState(open);
38
+ if (open && !opened) setOpened(true);
39
+ const activeValue = opened ? derived : null;
40
+ const latest = useRef({
41
+ open,
42
+ query,
43
+ value,
44
+ enabledItems
45
+ });
46
+ useLayoutEffect(() => {
47
+ latest.current = {
48
+ open,
49
+ query,
50
+ value,
51
+ enabledItems
52
+ };
53
+ });
54
+ return {
55
+ activeValue,
56
+ setActiveValue: useCallback((next) => {
57
+ setCursor(next === null ? null : {
58
+ value: next,
59
+ query: latest.current.query
60
+ });
61
+ }, []),
62
+ moveActive: useCallback((direction) => {
63
+ const options = latest.current;
64
+ if (!options.open) return;
65
+ const rows = options.enabledItems;
66
+ const last = rows.length - 1;
67
+ if (last < 0) {
68
+ setCursor(null);
69
+ return;
70
+ }
71
+ setCursor((current) => {
72
+ const from = resolveActive(current, options);
73
+ const at = rows.findIndex((item) => item.value === from);
74
+ const index = direction === "first" ? 0 : direction === "last" ? last : (at + direction + rows.length) % rows.length;
75
+ return {
76
+ value: rows[index].value,
77
+ query: options.query
78
+ };
79
+ });
80
+ }, [])
81
+ };
82
+ }
83
+ //#endregion
84
+ export { useActiveOption as t };
85
+
86
+ //# sourceMappingURL=use-active-option-CmX6Z-4S.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-active-option-CmX6Z-4S.js","names":[],"sources":["../src/components/motion/combobox/use-active-option.ts"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useLayoutEffect, useRef, useState } from \"react\";\n\n/**\n * Where the keyboard or the pointer last moved to, stamped with the query it\n * was placed under. Which option is *active* is resolved from this during\n * render, never in an effect: a passive effect runs after the commit, so a list\n * would briefly have none of its options active, and a key arriving in that\n * window would move from nowhere onto the row it was already about to\n * highlight.\n */\ntype ActiveCursor = { value: string; query: string };\n\ntype Options = {\n query: string;\n value: string | undefined;\n /** The enabled, visible options in list order — all this hook reads of them. */\n enabledItems: readonly { value: string }[];\n};\n\nconst isEnabled = (\n enabledItems: Options[\"enabledItems\"],\n candidate: string | undefined,\n): candidate is string =>\n candidate !== undefined && enabledItems.some((i) => i.value === candidate);\n\n/**\n * The cursor's option, or null once the query or the result set it was placed\n * in has changed. A cursor that outlived either would steal Enter from the row\n * the user is aiming at. The result-set half costs something: a live search\n * that blanks its rows while fetching and returns the same ones loses the moved\n * highlight. That is deliberate — a highlight visibly back at the top beats one\n * silently in the wrong place.\n *\n * It is stamped with the query rather than with the identity of the visible\n * list because callers routinely pass an inline `filter`, which makes that list\n * a fresh array on every render.\n */\nfunction liveCursorValue(cursor: ActiveCursor | null, options: Options) {\n if (cursor === null || cursor.query !== options.query) return null;\n return isEnabled(options.enabledItems, cursor.value) ? cursor.value : null;\n}\n\n/**\n * Where the highlight sits with no live cursor: the selection if it can be\n * selected, otherwise the first option that can. Only enabled options qualify —\n * an active disabled option would point `aria-activedescendant` at a row Enter\n * then refuses to select.\n */\nfunction fallbackActive({ value, enabledItems }: Options) {\n return isEnabled(enabledItems, value) ? value : (enabledItems[0]?.value ?? null);\n}\n\n/** The active option, from a cursor that may or may not still be live. */\nconst resolveActive = (cursor: ActiveCursor | null, options: Options) =>\n liveCursorValue(cursor, options) ?? fallbackActive(options);\n\nexport function useActiveOption({ open, ...options }: Options & { open: boolean }) {\n const { query, value, enabledItems } = options;\n const [cursor, setCursor] = useState<ActiveCursor | null>(null);\n\n const live = liveCursorValue(cursor, options);\n // Cleared rather than ignored: React re-runs this render with the cursor\n // gone, so a value that reappears later cannot revive it.\n if (cursor !== null && live === null) setCursor(null);\n const derived = live ?? fallbackActive(options);\n\n // Nothing is active until the list has been opened once. After that the\n // resolution above is already stable across a close — the list keeps\n // filtering by the query it was open with — so the highlight holds its row\n // through the exit without being frozen separately.\n const [opened, setOpened] = useState(open);\n if (open && !opened) setOpened(true);\n const activeValue = opened ? derived : null;\n\n // Both callbacks keep one identity for the life of the component, and read\n // the list through a ref to do it. A caller will put them in a `useMemo` or\n // an effect's dependencies — the exhaustive-deps rule makes it — and\n // `enabledItems` is a fresh array on every render for any consumer passing an\n // inline `filter`, so a callback keyed to it would be rebuilt every render.\n // Written after commit rather than during render: a render React discards\n // still runs the component body, and a handler reading this in that window\n // would step against a list the committed tree does not have.\n const latest = useRef({ open, query, value, enabledItems });\n useLayoutEffect(() => {\n latest.current = { open, query, value, enabledItems };\n });\n\n const setActiveValue = useCallback((next: string | null) => {\n setCursor(next === null ? null : { value: next, query: latest.current.query });\n }, []);\n\n // Steps from the option the cursor really resolves to, inside the update, so\n // that two keys landing in one batch move two rows rather than one.\n const moveActive = useCallback((direction: 1 | -1 | \"first\" | \"last\") => {\n const options = latest.current;\n // While closed the list is still filtering by the query it was open\n // with, so a step taken now would be measured against rows the next\n // render replaces. Opening is the caller's job; stepping waits for it.\n if (!options.open) return;\n const rows = options.enabledItems;\n const last = rows.length - 1;\n if (last < 0) {\n setCursor(null);\n return;\n }\n setCursor((current) => {\n // `resolveActive` always lands on a member of `enabledItems` once the\n // list is non-empty, which the early return above guarantees, so there\n // is always a row to step from.\n const from = resolveActive(current, options);\n const at = rows.findIndex((item) => item.value === from);\n const index =\n direction === \"first\"\n ? 0\n : direction === \"last\"\n ? last\n : (at + direction + rows.length) % rows.length;\n return { value: rows[index].value, query: options.query };\n });\n }, []);\n\n return { activeValue, setActiveValue, moveActive };\n}\n"],"mappings":";;AAqBA,MAAM,aACJ,cACA,cAEA,cAAc,KAAA,KAAa,aAAa,MAAM,MAAM,EAAE,UAAU,SAAS;;;;;;;;;;;;;AAc3E,SAAS,gBAAgB,QAA6B,SAAkB;CACtE,IAAI,WAAW,QAAQ,OAAO,UAAU,QAAQ,OAAO,OAAO;CAC9D,OAAO,UAAU,QAAQ,cAAc,OAAO,KAAK,IAAI,OAAO,QAAQ;AACxE;;;;;;;AAQA,SAAS,eAAe,EAAE,OAAO,gBAAyB;CACxD,OAAO,UAAU,cAAc,KAAK,IAAI,QAAS,aAAa,EAAE,EAAE,SAAS;AAC7E;;AAGA,MAAM,iBAAiB,QAA6B,YAClD,gBAAgB,QAAQ,OAAO,KAAK,eAAe,OAAO;AAE5D,SAAgB,gBAAgB,EAAE,MAAM,GAAG,WAAwC;CACjF,MAAM,EAAE,OAAO,OAAO,iBAAiB;CACvC,MAAM,CAAC,QAAQ,aAAa,SAA8B,IAAI;CAE9D,MAAM,OAAO,gBAAgB,QAAQ,OAAO;CAG5C,IAAI,WAAW,QAAQ,SAAS,MAAM,UAAU,IAAI;CACpD,MAAM,UAAU,QAAQ,eAAe,OAAO;CAM9C,MAAM,CAAC,QAAQ,aAAa,SAAS,IAAI;CACzC,IAAI,QAAQ,CAAC,QAAQ,UAAU,IAAI;CACnC,MAAM,cAAc,SAAS,UAAU;CAUvC,MAAM,SAAS,OAAO;EAAE;EAAM;EAAO;EAAO;CAAa,CAAC;CAC1D,sBAAsB;EACpB,OAAO,UAAU;GAAE;GAAM;GAAO;GAAO;EAAa;CACtD,CAAC;CAoCD,OAAO;EAAE;EAAa,gBAlCC,aAAa,SAAwB;GAC1D,UAAU,SAAS,OAAO,OAAO;IAAE,OAAO;IAAM,OAAO,OAAO,QAAQ;GAAM,CAAC;EAC/E,GAAG,CAAC,CAgC+B;EAAG,YA5BnB,aAAa,cAAyC;GACvE,MAAM,UAAU,OAAO;GAIvB,IAAI,CAAC,QAAQ,MAAM;GACnB,MAAM,OAAO,QAAQ;GACrB,MAAM,OAAO,KAAK,SAAS;GAC3B,IAAI,OAAO,GAAG;IACZ,UAAU,IAAI;IACd;GACF;GACA,WAAW,YAAY;IAIrB,MAAM,OAAO,cAAc,SAAS,OAAO;IAC3C,MAAM,KAAK,KAAK,WAAW,SAAS,KAAK,UAAU,IAAI;IACvD,MAAM,QACJ,cAAc,UACV,IACA,cAAc,SACZ,QACC,KAAK,YAAY,KAAK,UAAU,KAAK;IAC9C,OAAO;KAAE,OAAO,KAAK,MAAM,CAAC;KAAO,OAAO,QAAQ;IAAM;GAC1D,CAAC;EACH,GAAG,CAAC,CAE2C;CAAE;AACnD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumix/ui",
3
- "version": "0.3.10",
3
+ "version": "0.3.11",
4
4
  "description": "Kumix React UI kit: shadcn/ui (Base UI, base-nova) + ReUI components, Tailwind tokens, and hooks. Per-file ESM exports.",
5
5
  "author": "Kumix Labs <hai@kumix.io>",
6
6
  "license": "MIT",
@@ -76,8 +76,8 @@
76
76
  "@kumix/tsconfig": "^0.1.0",
77
77
  "@kumix/utils": "^0.2.0",
78
78
  "@paper-design/shaders-react": "^0.0.80",
79
- "@shadcn/react": "^0.3.0",
80
- "@tanstack/react-table": "^9.2.3",
79
+ "@shadcn/react": "^0.3.1",
80
+ "@tanstack/react-table": "^9.2.4",
81
81
  "@tanstack/react-virtual": "^3.14.10",
82
82
  "@types/react": "^19.2.18",
83
83
  "class-variance-authority": "^0.7.1",
@@ -87,8 +87,8 @@
87
87
  "embla-carousel-react": "^8.6.0",
88
88
  "input-otp": "^1.5.0",
89
89
  "lenis": "^1.3.26",
90
- "lucide-react": "^1.34.0",
91
- "motion": "^13.1.1",
90
+ "lucide-react": "^1.39.0",
91
+ "motion": "^13.2.0",
92
92
  "next-themes": "^0.4.6",
93
93
  "react": "^19.2.8",
94
94
  "react-day-picker": "^10.0.1",
@@ -1 +0,0 @@
1
- {"version":3,"file":"context-BizvUNZv.js","names":[],"sources":["../src/components/motion/combobox/use-active-option.ts","../src/components/motion/combobox/context.tsx"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useLayoutEffect, useRef, useState } from \"react\";\n\n/**\n * Where the keyboard or the pointer last moved to, stamped with the query it\n * was placed under. Which option is *active* is resolved from this during\n * render, never in an effect: a passive effect runs after the commit, so a list\n * would briefly have none of its options active, and a key arriving in that\n * window would move from nowhere onto the row it was already about to\n * highlight.\n */\ntype ActiveCursor = { value: string; query: string };\n\ntype Options = {\n query: string;\n value: string | undefined;\n /** The enabled, visible options in list order — all this hook reads of them. */\n enabledItems: readonly { value: string }[];\n};\n\nconst isEnabled = (\n enabledItems: Options[\"enabledItems\"],\n candidate: string | undefined,\n): candidate is string =>\n candidate !== undefined && enabledItems.some((i) => i.value === candidate);\n\n/**\n * The cursor's option, or null once the query or the result set it was placed\n * in has changed. A cursor that outlived either would steal Enter from the row\n * the user is aiming at. The result-set half costs something: a live search\n * that blanks its rows while fetching and returns the same ones loses the moved\n * highlight. That is deliberate — a highlight visibly back at the top beats one\n * silently in the wrong place.\n *\n * It is stamped with the query rather than with the identity of the visible\n * list because callers routinely pass an inline `filter`, which makes that list\n * a fresh array on every render.\n */\nfunction liveCursorValue(cursor: ActiveCursor | null, options: Options) {\n if (cursor === null || cursor.query !== options.query) return null;\n return isEnabled(options.enabledItems, cursor.value) ? cursor.value : null;\n}\n\n/**\n * Where the highlight sits with no live cursor: the selection if it can be\n * selected, otherwise the first option that can. Only enabled options qualify —\n * an active disabled option would point `aria-activedescendant` at a row Enter\n * then refuses to select.\n */\nfunction fallbackActive({ value, enabledItems }: Options) {\n return isEnabled(enabledItems, value) ? value : (enabledItems[0]?.value ?? null);\n}\n\n/** The active option, from a cursor that may or may not still be live. */\nconst resolveActive = (cursor: ActiveCursor | null, options: Options) =>\n liveCursorValue(cursor, options) ?? fallbackActive(options);\n\nexport function useActiveOption({ open, ...options }: Options & { open: boolean }) {\n const { query, value, enabledItems } = options;\n const [cursor, setCursor] = useState<ActiveCursor | null>(null);\n\n const live = liveCursorValue(cursor, options);\n // Cleared rather than ignored: React re-runs this render with the cursor\n // gone, so a value that reappears later cannot revive it.\n if (cursor !== null && live === null) setCursor(null);\n const derived = live ?? fallbackActive(options);\n\n // Nothing is active until the list has been opened once. After that the\n // resolution above is already stable across a close — the list keeps\n // filtering by the query it was open with — so the highlight holds its row\n // through the exit without being frozen separately.\n const [opened, setOpened] = useState(open);\n if (open && !opened) setOpened(true);\n const activeValue = opened ? derived : null;\n\n // Both callbacks keep one identity for the life of the component, and read\n // the list through a ref to do it. A caller will put them in a `useMemo` or\n // an effect's dependencies — the exhaustive-deps rule makes it — and\n // `enabledItems` is a fresh array on every render for any consumer passing an\n // inline `filter`, so a callback keyed to it would be rebuilt every render.\n // Written after commit rather than during render: a render React discards\n // still runs the component body, and a handler reading this in that window\n // would step against a list the committed tree does not have.\n const latest = useRef({ open, query, value, enabledItems });\n useLayoutEffect(() => {\n latest.current = { open, query, value, enabledItems };\n });\n\n const setActiveValue = useCallback((next: string | null) => {\n setCursor(next === null ? null : { value: next, query: latest.current.query });\n }, []);\n\n // Steps from the option the cursor really resolves to, inside the update, so\n // that two keys landing in one batch move two rows rather than one.\n const moveActive = useCallback((direction: 1 | -1 | \"first\" | \"last\") => {\n const options = latest.current;\n // While closed the list is still filtering by the query it was open\n // with, so a step taken now would be measured against rows the next\n // render replaces. Opening is the caller's job; stepping waits for it.\n if (!options.open) return;\n const rows = options.enabledItems;\n const last = rows.length - 1;\n if (last < 0) {\n setCursor(null);\n return;\n }\n setCursor((current) => {\n // `resolveActive` always lands on a member of `enabledItems` once the\n // list is non-empty, which the early return above guarantees, so there\n // is always a row to step from.\n const from = resolveActive(current, options);\n const at = rows.findIndex((item) => item.value === from);\n const index =\n direction === \"first\"\n ? 0\n : direction === \"last\"\n ? last\n : (at + direction + rows.length) % rows.length;\n return { value: rows[index].value, query: options.query };\n });\n }, []);\n\n return { activeValue, setActiveValue, moveActive };\n}\n","\"use client\";\n\nimport {\n createContext,\n type MutableRefObject,\n type ReactNode,\n type Ref,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useReducedMotion } from \"motion/react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { useActiveOption } from \"./use-active-option\";\n\nexport type RegisteredItem = {\n value: string;\n label: string;\n keywords: string[];\n disabled: boolean;\n groupId: string | null;\n id: string;\n ref: MutableRefObject<HTMLButtonElement | null>;\n};\n\nexport type ComboboxFilter = (value: string, query: string, keywords: string[]) => boolean;\n\nconst defaultFilter: ComboboxFilter = (value, query, keywords) => {\n const needle = query.trim().toLocaleLowerCase();\n if (!needle) return true;\n\n const haystack = [value, ...keywords].join(\" \").toLocaleLowerCase();\n let queryIndex = 0;\n for (const character of haystack) {\n if (character === needle[queryIndex]) queryIndex += 1;\n if (queryIndex === needle.length) return true;\n }\n return false;\n};\n\nexport type ComboboxContextValue = {\n open: boolean;\n setOpen: (open: boolean, restoreFocus?: boolean) => void;\n value: string | undefined;\n select: (value: string) => void;\n query: string;\n setQuery: (query: string) => void;\n /** The option the list is currently pointing at, resolved during render. */\n activeValue: string | null;\n /**\n * Records where the pointer or keyboard moved to. The recorded value is\n * dropped when the query or the result set changes, so it does not always\n * survive to the next `activeValue`.\n */\n setActiveValue: (value: string | null) => void;\n moveActive: (direction: 1 | -1 | \"first\" | \"last\") => void;\n selectActive: () => void;\n registerItem: (item: RegisteredItem) => void;\n unregisterItem: (value: string) => void;\n labelFor: (value: string | undefined) => string | undefined;\n isVisible: (value: string) => boolean;\n hasVisibleItems: (groupId: string) => boolean;\n visibleCount: number;\n activeItemId: string | undefined;\n triggerId: string;\n listId: string;\n inputId: string;\n disabled: boolean;\n reduce: boolean;\n triggerRef: MutableRefObject<HTMLDivElement | null>;\n contentRef: MutableRefObject<HTMLDivElement | null>;\n inputRef: MutableRefObject<HTMLInputElement | null>;\n activeLayoutId: string;\n};\n\nexport const ComboboxContext = createContext<ComboboxContextValue | null>(null);\nexport const ComboboxGroupContext = createContext<string | null>(null);\n\nexport function useComboboxContext(component: string) {\n const context = useContext(ComboboxContext);\n if (!context) throw new Error(`${component} must be used within <Combobox>`);\n return context;\n}\n\nexport function mergeRefs<T>(...refs: Array<Ref<T> | undefined>) {\n return (node: T | null) => {\n for (const ref of refs) {\n if (typeof ref === \"function\") ref(node);\n else if (ref && typeof ref === \"object\") (ref as MutableRefObject<T | null>).current = node;\n }\n };\n}\n\nexport interface ComboboxProps {\n children: ReactNode;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n query?: string;\n defaultQuery?: string;\n onQueryChange?: (query: string) => void;\n filter?: ComboboxFilter;\n disabled?: boolean;\n className?: string;\n}\n\nexport function Combobox({\n children,\n value: controlledValue,\n defaultValue,\n onValueChange,\n open: controlledOpen,\n defaultOpen = false,\n onOpenChange,\n query: controlledQuery,\n defaultQuery = \"\",\n onQueryChange,\n filter = defaultFilter,\n disabled = false,\n className,\n}: ComboboxProps) {\n const reduce = useReducedMotion() ?? false;\n const baseId = useId();\n const rootRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const [internalValue, setInternalValue] = useState(defaultValue);\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const [internalQuery, setInternalQuery] = useState(defaultQuery);\n const [items, setItems] = useState<Map<string, RegisteredItem>>(new Map());\n\n const valueControlled = controlledValue !== undefined;\n const openControlled = controlledOpen !== undefined;\n const queryControlled = controlledQuery !== undefined;\n const value = valueControlled ? controlledValue : internalValue;\n const open = openControlled ? controlledOpen : internalOpen;\n const query = queryControlled ? controlledQuery : internalQuery;\n\n const updateQuery = useCallback(\n (next: string) => {\n if (!queryControlled) setInternalQuery(next);\n onQueryChange?.(next);\n },\n [onQueryChange, queryControlled],\n );\n\n const updateOpen = useCallback(\n (next: boolean, restoreFocus = false) => {\n if (disabled && next) return;\n if (!openControlled) setInternalOpen(next);\n onOpenChange?.(next);\n if (!next) updateQuery(\"\");\n if (restoreFocus)\n requestAnimationFrame(() => inputRef.current?.focus({ preventScroll: true }));\n },\n [disabled, onOpenChange, openControlled, updateQuery],\n );\n\n const registerItem = useCallback((item: RegisteredItem) => {\n setItems((current) => {\n const existing = current.get(item.value);\n if (\n existing?.label === item.label &&\n existing.disabled === item.disabled &&\n existing.id === item.id &&\n existing.ref === item.ref &&\n existing.groupId === item.groupId &&\n existing.keywords.join(\"\\u0000\") === item.keywords.join(\"\\u0000\")\n ) {\n return current;\n }\n const next = new Map(current);\n next.set(item.value, item);\n return next;\n });\n }, []);\n\n const unregisterItem = useCallback((itemValue: string) => {\n setItems((current) => {\n if (!current.has(itemValue)) return current;\n const next = new Map(current);\n next.delete(itemValue);\n return next;\n });\n }, []);\n\n // The query the list filters by. Closing clears `query`, but the panel is\n // still on screen for its exit, so it keeps filtering by the query it was\n // open with rather than repopulating mid-collapse. The input already reads\n // `query` only while open, so nothing the user can see reads the other one.\n const [openQuery, setOpenQuery] = useState(query);\n if (open && openQuery !== query) setOpenQuery(query);\n const listQuery = open ? query : openQuery;\n\n const visibleItems = useMemo(\n () =>\n Array.from(items.values()).filter((item) =>\n filter(item.value, listQuery, [item.label, ...item.keywords]),\n ),\n [filter, items, listQuery],\n );\n const enabledVisibleItems = useMemo(\n () => visibleItems.filter((item) => !item.disabled),\n [visibleItems],\n );\n const visibleValues = useMemo(\n () => new Set(visibleItems.map((item) => item.value)),\n [visibleItems],\n );\n const visibleGroupIds = useMemo(\n () => new Set(visibleItems.map((item) => item.groupId)),\n [visibleItems],\n );\n\n const { activeValue, setActiveValue, moveActive } = useActiveOption({\n open,\n query: listQuery,\n value,\n enabledItems: enabledVisibleItems,\n });\n\n const select = useCallback(\n (next: string) => {\n if (items.get(next)?.disabled) return;\n if (!valueControlled) setInternalValue(next);\n onValueChange?.(next);\n updateOpen(false, true);\n },\n [items, onValueChange, updateOpen, valueControlled],\n );\n\n const selectActive = useCallback(() => {\n if (activeValue) select(activeValue);\n }, [activeValue, select]);\n\n useEffect(() => {\n if (!open) return;\n const frame = requestAnimationFrame(() => inputRef.current?.focus({ preventScroll: true }));\n return () => cancelAnimationFrame(frame);\n }, [open]);\n\n useEffect(() => {\n if (!activeValue || !open) return;\n const item = items.get(activeValue)?.ref.current;\n const list = item?.closest<HTMLElement>(\"[role='listbox']\");\n if (!item || !list) return;\n const itemRect = item.getBoundingClientRect();\n const listRect = list.getBoundingClientRect();\n if (itemRect.top < listRect.top) list.scrollTop -= listRect.top - itemRect.top;\n else if (itemRect.bottom > listRect.bottom) list.scrollTop += itemRect.bottom - listRect.bottom;\n }, [activeValue, items, open]);\n\n useEffect(() => {\n if (!open) return;\n const isInside = (target: Node) =>\n rootRef.current?.contains(target) || contentRef.current?.contains(target);\n const onPointerDown = (event: PointerEvent) => {\n if (!isInside(event.target as Node)) updateOpen(false);\n };\n const onFocusIn = (event: FocusEvent) => {\n if (!isInside(event.target as Node)) updateOpen(false);\n };\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\") return;\n event.preventDefault();\n updateOpen(false, true);\n };\n window.addEventListener(\"pointerdown\", onPointerDown);\n window.addEventListener(\"focusin\", onFocusIn);\n window.addEventListener(\"keydown\", onKeyDown);\n return () => {\n window.removeEventListener(\"pointerdown\", onPointerDown);\n window.removeEventListener(\"focusin\", onFocusIn);\n window.removeEventListener(\"keydown\", onKeyDown);\n };\n }, [open, updateOpen]);\n\n const activeItem = activeValue ? items.get(activeValue) : undefined;\n const context = useMemo<ComboboxContextValue>(\n () => ({\n open,\n setOpen: updateOpen,\n value,\n select,\n query,\n setQuery: updateQuery,\n activeValue,\n setActiveValue,\n moveActive,\n selectActive,\n registerItem,\n unregisterItem,\n labelFor: (itemValue) => (itemValue === undefined ? undefined : items.get(itemValue)?.label),\n isVisible: (itemValue) => !listQuery.trim() || visibleValues.has(itemValue),\n hasVisibleItems: (groupId) => visibleGroupIds.has(groupId),\n visibleCount: visibleItems.length,\n activeItemId: activeItem?.id,\n triggerId: `${baseId}-trigger`,\n listId: `${baseId}-list`,\n inputId: `${baseId}-input`,\n disabled,\n reduce,\n triggerRef,\n contentRef,\n inputRef,\n activeLayoutId: `${baseId}-active`,\n }),\n [\n activeItem?.id,\n activeValue,\n baseId,\n disabled,\n items,\n listQuery,\n moveActive,\n open,\n query,\n reduce,\n registerItem,\n select,\n selectActive,\n setActiveValue,\n unregisterItem,\n updateOpen,\n updateQuery,\n value,\n visibleItems.length,\n visibleGroupIds,\n visibleValues,\n ],\n );\n\n return (\n <ComboboxContext.Provider value={context}>\n <div ref={rootRef} className={cn(\"relative w-full\", className)}>\n {children}\n </div>\n </ComboboxContext.Provider>\n );\n}\n"],"mappings":";;;;;AAqBA,MAAM,aACJ,cACA,cAEA,cAAc,KAAA,KAAa,aAAa,MAAM,MAAM,EAAE,UAAU,SAAS;;;;;;;;;;;;;AAc3E,SAAS,gBAAgB,QAA6B,SAAkB;CACtE,IAAI,WAAW,QAAQ,OAAO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