@constructive-io/ui 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/components/alert-dialog.js.map +1 -1
  2. package/dist/components/autocomplete.js +11 -3
  3. package/dist/components/autocomplete.js.map +1 -1
  4. package/dist/components/avatar.js.map +1 -1
  5. package/dist/components/breadcrumb.js.map +1 -1
  6. package/dist/components/card.d.ts +1 -1
  7. package/dist/components/checkbox.js +1 -1
  8. package/dist/components/checkbox.js.map +1 -1
  9. package/dist/components/combobox.d.ts +1 -1
  10. package/dist/components/combobox.js +50 -14
  11. package/dist/components/combobox.js.map +1 -1
  12. package/dist/components/command.d.ts +16 -35
  13. package/dist/components/command.js +72 -508
  14. package/dist/components/command.js.map +1 -1
  15. package/dist/components/dialog.js.map +1 -1
  16. package/dist/components/drawer.js +1 -1
  17. package/dist/components/drawer.js.map +1 -1
  18. package/dist/components/dropdown-menu.js +3 -3
  19. package/dist/components/dropdown-menu.js.map +1 -1
  20. package/dist/components/form-control.js.map +1 -1
  21. package/dist/components/form.js.map +1 -1
  22. package/dist/components/input-group.js +3 -3
  23. package/dist/components/input-group.js.map +1 -1
  24. package/dist/components/input.js +1 -1
  25. package/dist/components/input.js.map +1 -1
  26. package/dist/components/json-input.js.map +1 -1
  27. package/dist/components/multi-select.js.map +1 -1
  28. package/dist/components/org-chart/index.d.ts +54 -0
  29. package/dist/components/org-chart/index.js +861 -0
  30. package/dist/components/org-chart/index.js.map +1 -0
  31. package/dist/components/pagination.js.map +1 -1
  32. package/dist/components/popover.js.map +1 -1
  33. package/dist/components/portal.js.map +1 -1
  34. package/dist/components/record-picker.js +3 -3
  35. package/dist/components/record-picker.js.map +1 -1
  36. package/dist/components/resizable.js.map +1 -1
  37. package/dist/components/responsive-diagram.js +6 -4
  38. package/dist/components/responsive-diagram.js.map +1 -1
  39. package/dist/components/select.d.ts +2 -2
  40. package/dist/components/select.js +3 -3
  41. package/dist/components/select.js.map +1 -1
  42. package/dist/components/sheet.js.map +1 -1
  43. package/dist/components/sidebar.js +1 -1
  44. package/dist/components/sidebar.js.map +1 -1
  45. package/dist/components/stack/index.d.ts +11 -0
  46. package/dist/components/stack/index.js +33 -6
  47. package/dist/components/stack/index.js.map +1 -1
  48. package/dist/components/stepper.js.map +1 -1
  49. package/dist/components/table.js.map +1 -1
  50. package/dist/components/tabs.js.map +1 -1
  51. package/dist/components/tags.d.ts +1 -3
  52. package/dist/components/tags.js +107 -388
  53. package/dist/components/tags.js.map +1 -1
  54. package/dist/components/textarea.js +1 -1
  55. package/dist/components/textarea.js.map +1 -1
  56. package/dist/components/tooltip.js.map +1 -1
  57. package/dist/index.cjs +867 -378
  58. package/dist/index.cjs.map +1 -1
  59. package/dist/index.d.cts +82 -24
  60. package/dist/index.d.ts +82 -24
  61. package/dist/index.js +746 -259
  62. package/dist/index.js.map +1 -1
  63. package/package.json +13 -6
  64. package/src/styles/globals.css +1 -1
@@ -41,7 +41,7 @@ function Input({ className, size = "default", unstyled = false, ...props }) {
41
41
  className: cn(
42
42
  !unstyled && [
43
43
  // Base layout
44
- "relative inline-flex w-full rounded-lg border border-input bg-background bg-clip-padding text-base shadow-xs transition-shadow",
44
+ "relative inline-flex w-full rounded-lg border border-input bg-background bg-clip-padding text-base transition-shadow",
45
45
  // Inner shadow highlight
46
46
  "before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)]",
47
47
  "not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)]",
@@ -179,7 +179,7 @@ function ComboboxInput({
179
179
  "div",
180
180
  {
181
181
  "aria-hidden": "true",
182
- className: "[&_svg]:-mx-0.5 pointer-events-none absolute inset-y-0 start-px z-10 flex items-center ps-[calc(--spacing(3)-1px)] opacity-80 has-[+[data-size=sm]]:ps-[calc(--spacing(2.5)-1px)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4",
182
+ className: "[&_svg]:-mx-0.5 pointer-events-none absolute inset-y-0 start-px z-10 flex items-center ps-[calc(--spacing(3)-1px)] has-[+[data-size=sm]]:ps-[calc(--spacing(2.5)-1px)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:opacity-80",
183
183
  "data-slot": "combobox-start-addon",
184
184
  children: startAddon
185
185
  }
@@ -316,7 +316,10 @@ function ComboboxSeparator({
316
316
  }
317
317
  );
318
318
  }
319
- function ComboboxGroup({ className, ...props }) {
319
+ function ComboboxGroup({
320
+ className,
321
+ ...props
322
+ }) {
320
323
  return /* @__PURE__ */ jsx(
321
324
  Combobox$1.Group,
322
325
  {
@@ -342,7 +345,10 @@ function ComboboxGroupLabel({
342
345
  }
343
346
  );
344
347
  }
345
- function ComboboxEmpty({ className, ...props }) {
348
+ function ComboboxEmpty({
349
+ className,
350
+ ...props
351
+ }) {
346
352
  return /* @__PURE__ */ jsx(
347
353
  Combobox$1.Empty,
348
354
  {
@@ -355,7 +361,10 @@ function ComboboxEmpty({ className, ...props }) {
355
361
  }
356
362
  );
357
363
  }
358
- function ComboboxRow({ className, ...props }) {
364
+ function ComboboxRow({
365
+ className,
366
+ ...props
367
+ }) {
359
368
  return /* @__PURE__ */ jsx(
360
369
  Combobox$1.Row,
361
370
  {
@@ -365,10 +374,21 @@ function ComboboxRow({ className, ...props }) {
365
374
  }
366
375
  );
367
376
  }
368
- function ComboboxValue({ ...props }) {
369
- return /* @__PURE__ */ jsx(Combobox$1.Value, { "data-slot": "combobox-value", ...props });
377
+ function ComboboxValue({
378
+ ...props
379
+ }) {
380
+ return /* @__PURE__ */ jsx(
381
+ Combobox$1.Value,
382
+ {
383
+ "data-slot": "combobox-value",
384
+ ...props
385
+ }
386
+ );
370
387
  }
371
- function ComboboxList({ className, ...props }) {
388
+ function ComboboxList({
389
+ className,
390
+ ...props
391
+ }) {
372
392
  return /* @__PURE__ */ jsx(ScrollArea, { scrollbarGutter: true, scrollFade: true, children: /* @__PURE__ */ jsx(
373
393
  Combobox$1.List,
374
394
  {
@@ -381,7 +401,10 @@ function ComboboxList({ className, ...props }) {
381
401
  }
382
402
  ) });
383
403
  }
384
- function ComboboxClear({ className, ...props }) {
404
+ function ComboboxClear({
405
+ className,
406
+ ...props
407
+ }) {
385
408
  return /* @__PURE__ */ jsx(
386
409
  Combobox$1.Clear,
387
410
  {
@@ -407,8 +430,16 @@ function ComboboxStatus({
407
430
  }
408
431
  );
409
432
  }
410
- function ComboboxCollection(props) {
411
- return /* @__PURE__ */ jsx(Combobox$1.Collection, { "data-slot": "combobox-collection", ...props });
433
+ function ComboboxCollection({
434
+ ...props
435
+ }) {
436
+ return /* @__PURE__ */ jsx(
437
+ Combobox$1.Collection,
438
+ {
439
+ "data-slot": "combobox-collection",
440
+ ...props
441
+ }
442
+ );
412
443
  }
413
444
  function ComboboxChips({
414
445
  className,
@@ -421,7 +452,7 @@ function ComboboxChips({
421
452
  Combobox$1.Chips,
422
453
  {
423
454
  className: cn(
424
- "relative inline-flex min-h-9 w-full flex-wrap gap-1 rounded-lg border border-input bg-background not-dark:bg-clip-padding p-[calc(--spacing(1)-1px)] text-base shadow-xs/5 outline-none ring-ring/24 transition-shadow *:min-h-7 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/6%)] focus-within:border-ring focus-within:ring-[3px] has-disabled:pointer-events-none has-data-[size=lg]:min-h-10 has-data-[size=sm]:min-h-8 has-aria-invalid:border-destructive/36 has-disabled:opacity-64 has-[:disabled,:focus-within,[aria-invalid]]:shadow-none focus-within:has-aria-invalid:border-destructive/64 focus-within:has-aria-invalid:ring-destructive/16 has-data-[size=lg]:*:min-h-8 has-data-[size=sm]:*:min-h-6 sm:min-h-8 sm:text-sm sm:has-data-[size=lg]:min-h-9 sm:has-data-[size=sm]:min-h-7 sm:*:min-h-6 sm:has-data-[size=lg]:*:min-h-7 sm:has-data-[size=sm]:*:min-h-5 dark:not-has-disabled:bg-input/32 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]",
455
+ "relative inline-flex min-h-9 w-full flex-wrap gap-1 rounded-lg border border-input bg-background not-dark:bg-clip-padding p-[calc(--spacing(1)-1px)] text-base outline-none ring-ring/24 transition-shadow *:min-h-7 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/6%)] focus-within:border-ring focus-within:ring-[3px] has-disabled:pointer-events-none has-data-[size=lg]:min-h-10 has-data-[size=sm]:min-h-8 has-aria-invalid:border-destructive/36 has-disabled:opacity-64 has-[:disabled,:focus-within,[aria-invalid]]:shadow-none focus-within:has-aria-invalid:border-destructive/64 focus-within:has-aria-invalid:ring-destructive/16 has-data-[size=lg]:*:min-h-8 has-data-[size=sm]:*:min-h-6 sm:min-h-8 sm:text-sm sm:has-data-[size=lg]:min-h-9 sm:has-data-[size=sm]:min-h-7 sm:*:min-h-6 sm:has-data-[size=lg]:*:min-h-7 sm:has-data-[size=sm]:*:min-h-5 dark:not-has-disabled:bg-input/32 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]",
425
456
  className
426
457
  ),
427
458
  "data-slot": "combobox-chips",
@@ -452,7 +483,10 @@ function ComboboxChips({
452
483
  }
453
484
  );
454
485
  }
455
- function ComboboxChip({ children, ...props }) {
486
+ function ComboboxChip({
487
+ children,
488
+ ...props
489
+ }) {
456
490
  return /* @__PURE__ */ jsxs(
457
491
  Combobox$1.Chip,
458
492
  {
@@ -466,7 +500,9 @@ function ComboboxChip({ children, ...props }) {
466
500
  }
467
501
  );
468
502
  }
469
- function ComboboxChipRemove(props) {
503
+ function ComboboxChipRemove({
504
+ ...props
505
+ }) {
470
506
  return /* @__PURE__ */ jsx(
471
507
  Combobox$1.ChipRemove,
472
508
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/utils.ts","../../src/components/portal.tsx","../../src/components/input.tsx","../../src/components/scroll-area.tsx","../../src/components/combobox.tsx"],"names":["React","jsx","InputPrimitive","React2","ScrollAreaPrimitive","ComboboxPrimitive","jsxs"],"mappings":";;;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACuCO,IAAM,cAAA,GAAiB,aAAA;AAM9B,IAAM,gBAAsBA,MAAA,CAAA,aAAA,CAAkC;AAAA,EAC7D,KAAA,EAAO,MAAA;AAAA,EACP,KAAA,EAAO,CAAA;AAAA,EACP,sBAAA,EAAwB,MAAA;AAAA,EACxB,cAAA,EAAgB;AACjB,CAAC,CAAA;AAwEM,SAAS,sBAAA,GAA6C;AAC5D,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAUA,gBAA6B,IAAI,CAAA;AAEzE,EAAMA,uBAAgB,MAAM;AAC3B,IAAA,MAAM,EAAA,GAAK,QAAA,CAAS,cAAA,CAAe,cAAc,CAAA;AACjD,IAAA,YAAA,CAAa,EAAE,CAAA;AAAA,EAChB,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,OAAO,SAAA;AACR;AASO,SAAS,6BAAA,GAGd;AACD,EAAA,MAAM,gBAAgB,sBAAA,EAAuB;AAC7C,EAAA,MAAM,EAAE,sBAAA,EAAwB,cAAA,EAAe,GAAUA,kBAAW,aAAa,CAAA;AAEjF,EAAA,MAAM,SAAA,GAAY,sBAAA,KAA2B,QAAA,GAAW,MAAA,GAAa,aAAA,IAAiB,IAAA;AACtF,EAAA,MAAM,WAAA,GACL,cAAA,KAAmB,UAAA,GAChB,sCAAA,GACA,6BAAA;AAEJ,EAAA,OAAO,EAAE,WA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AAAA,MACC,YAAA,EAAW,QAAA;AAAA,MACX,SAAA,EAAU,mJAAA;AAAA,MACV,WAAA,EAAU,sBAAA;AAAA,MACT,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAAJ,IAAC,KAAA,EAAA,EAAM;AAAA;AAAA,GACT;AAEJ;AAEA,IAAM,oBAAoBI,UAAA,CAAkB;AAE5C,IAAM,eAAA,GAAkB","file":"combobox.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport * as React from 'react';\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Overlay layer type:\n * - 'base': Root level (page content, base floating elements)\n * - 'modal': Inside a modal overlay (dialog, sheet, drawer)\n */\nexport type OverlayLayer = 'base' | 'modal';\n\n/**\n * Where floating overlays should portal:\n * - 'root': always portal into #portal-root\n * - 'nested': let Base UI nest portals into the nearest Base UI portal node\n */\nexport type FloatingPortalStrategy = 'root' | 'nested';\n\n/**\n * Z-index mode for floating overlays.\n * - 'default': --z-layer-floating\n * - 'elevated': --z-layer-floating-elevated\n */\nexport type FloatingZIndex = 'default' | 'elevated';\n\ninterface PortalContextValue {\n\t/** Current overlay layer */\n\tlayer: OverlayLayer;\n\t/** Modal nesting depth (0 for first modal, 1 for nested, etc.) */\n\tdepth: number;\n\t/** Strategy for where floating overlays should portal */\n\tfloatingPortalStrategy: FloatingPortalStrategy;\n\t/** Z-index mode for floating overlays */\n\tfloatingZIndex: FloatingZIndex;\n}\n\n// ============================================================================\n// Constants\n// ============================================================================\n\nexport const PORTAL_ROOT_ID = 'portal-root';\n\n// ============================================================================\n// Context\n// ============================================================================\n\nconst PortalContext = React.createContext<PortalContextValue>({\n\tlayer: 'base',\n\tdepth: 0,\n\tfloatingPortalStrategy: 'root',\n\tfloatingZIndex: 'default',\n});\n\n// ============================================================================\n// Providers\n// ============================================================================\n\n/**\n * Provider for modal overlays (Dialog, Sheet, Drawer, etc.)\n *\n * Wraps modal content to:\n * 1. Create a scoped portal container for nested floating elements\n * 2. Track the overlay layer (so floating elements know to use elevated z-index)\n * 3. Track nesting depth for stacked modals\n *\n * Usage:\n * ```tsx\n * <DialogPopup>\n * <ModalPortalScope>\n * {children} // Popovers inside here will render in the scoped container\n * </ModalPortalScope>\n * </DialogPopup>\n * ```\n */\nexport function ModalPortalScope({\n\tchildren,\n\tfloatingPortalStrategy = 'nested',\n\tfloatingZIndex = 'default',\n}: {\n\tchildren: React.ReactNode;\n\tfloatingPortalStrategy?: FloatingPortalStrategy;\n\tfloatingZIndex?: FloatingZIndex;\n}) {\n\tconst parentContext = React.useContext(PortalContext);\n\n\t// Increment depth from parent if already in modal layer\n\tconst depth = parentContext.layer === 'modal' ? parentContext.depth + 1 : 0;\n\n\tconst value = React.useMemo<PortalContextValue>(\n\t\t() => ({\n\t\t\tlayer: 'modal',\n\t\t\tdepth,\n\t\t\tfloatingPortalStrategy,\n\t\t\tfloatingZIndex,\n\t\t}),\n\t\t[depth, floatingPortalStrategy, floatingZIndex],\n\t);\n\n\treturn <PortalContext.Provider value={value}>{children}</PortalContext.Provider>;\n}\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\n/**\n * Get the current portal context value.\n * Used internally by other hooks.\n */\nexport function usePortalContext(): PortalContextValue {\n\treturn React.useContext(PortalContext);\n}\n\nexport function useInModalOverlay(): boolean {\n\treturn React.useContext(PortalContext).layer === 'modal';\n}\n\n/**\n * Get the root portal container element.\n * Used by modal components (Dialog, Sheet, etc.) to render their portals.\n *\n * @returns The root portal container, or null during SSR/before mount\n */\nexport function useRootPortalContainer(): HTMLElement | null {\n\tconst [container, setContainer] = React.useState<HTMLElement | null>(null);\n\n\tReact.useLayoutEffect(() => {\n\t\tconst el = document.getElementById(PORTAL_ROOT_ID);\n\t\tsetContainer(el);\n\t}, []);\n\n\treturn container;\n}\n\n/**\n * Centralized portal + z-index policy for floating overlays.\n *\n * - When `floatingPortalStrategy` is 'nested', Base UI will automatically portal\n * into the nearest Base UI portal node (so dialog \"inert\" behavior includes it).\n * - When it's 'root', we portal into #portal-root.\n */\nexport function useFloatingOverlayPortalProps(): {\n\tcontainer?: HTMLElement | null;\n\tzIndexClass: string;\n} {\n\tconst rootContainer = useRootPortalContainer();\n\tconst { floatingPortalStrategy, floatingZIndex } = React.useContext(PortalContext);\n\n\tconst container = floatingPortalStrategy === 'nested' ? undefined : (rootContainer ?? null);\n\tconst zIndexClass =\n\t\tfloatingZIndex === 'elevated'\n\t\t\t? 'z-[var(--z-layer-floating-elevated)]'\n\t\t\t: 'z-[var(--z-layer-floating)]';\n\n\treturn { container, zIndexClass };\n}\n\n// ============================================================================\n// Components\n// ============================================================================\n\n/**\n * Portal root component to render in app layout.\n * All overlay components will render their portals inside this container.\n *\n * Usage in layout.tsx:\n * ```tsx\n * import { PortalRoot } from '@constructive-io/ui/portal';\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html>\n * <body>\n * {children}\n * <PortalRoot />\n * </body>\n * </html>\n * );\n * }\n * ```\n */\nexport function PortalRoot() {\n\treturn (\n\t\t<div\n\t\t\tid={PORTAL_ROOT_ID}\n\t\t\tdata-slot='portal-root'\n\t\t\tstyle={{\n\t\t\t\tposition: 'fixed',\n\t\t\t\tinset: 0,\n\t\t\t\tzIndex: 'var(--z-layer-portal-root)',\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\t// Children (portal contents) will have pointer-events: auto\n\t\t\t}}\n\t\t/>\n\t);\n}\n\n/**\n * Hook to get the portal container element for rendering floating UI elements.\n * Returns the element with id=\"portal-root\" if it exists in the DOM.\n *\n * @deprecated Use useRootPortalContainer or useFloatingOverlayPortalProps instead\n */\nexport function usePortalContainer(): HTMLElement | undefined {\n\tif (typeof document === 'undefined') return undefined;\n\tconst el = document.getElementById(PORTAL_ROOT_ID);\n\treturn el instanceof HTMLElement ? el : undefined;\n}\n","'use client';\n\nimport { Input as InputPrimitive } from '@base-ui/react/input';\nimport type * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\ntype InputProps = Omit<InputPrimitive.Props & React.RefAttributes<HTMLInputElement>, 'size'> & {\n\tsize?: 'sm' | 'default' | 'lg' | number;\n\tunstyled?: boolean;\n};\n\nfunction Input({ className, size = 'default', unstyled = false, ...props }: InputProps) {\n\tconst isFloating = props.placeholder === ' ';\n\n\treturn (\n\t\t<span\n\t\t\tclassName={\n\t\t\t\tcn(\n\t\t\t\t\t!unstyled && [\n\t\t\t\t\t\t// Base layout\n\t\t\t\t\t\t'relative inline-flex w-full rounded-lg border border-input bg-background bg-clip-padding text-base shadow-xs transition-shadow',\n\t\t\t\t\t\t// Inner shadow highlight\n\t\t\t\t\t\t'before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)]',\n\t\t\t\t\t\t'not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)]',\n\t\t\t\t\t\t// Focus state - use primary brand color\n\t\t\t\t\t\t'has-focus-visible:border-primary/60 has-focus-visible:ring-[3px] has-focus-visible:ring-primary/35',\n\t\t\t\t\t\t// Invalid state\n\t\t\t\t\t\t'has-aria-invalid:border-destructive/36',\n\t\t\t\t\t\t'has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16',\n\t\t\t\t\t\t// Disabled state\n\t\t\t\t\t\t'has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none',\n\t\t\t\t\t\t// Dark mode\n\t\t\t\t\t\t'sm:text-sm dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border',\n\t\t\t\t\t\t'dark:has-aria-invalid:ring-destructive/24',\n\t\t\t\t\t\t'dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)]',\n\t\t\t\t\t],\n\t\t\t\t\tclassName,\n\t\t\t\t) || undefined\n\t\t\t}\n\t\t\tdata-size={size}\n\t\t\tdata-slot=\"input-control\"\n\t\t>\n\t\t\t<InputPrimitive\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'w-full min-w-0 rounded-[inherit] bg-transparent px-[calc(--spacing(3)-1px)] outline-none',\n\t\t\t\t\tisFloating\n\t\t\t\t\t\t? 'h-11 pt-4.5 pb-1 leading-none placeholder:text-transparent sm:h-10'\n\t\t\t\t\t\t: 'h-8.5 leading-8.5 placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5',\n\t\t\t\t\tsize === 'sm' &&\n\t\t\t\t\t\t(isFloating\n\t\t\t\t\t\t\t? 'h-10 px-[calc(--spacing(2.5)-1px)] pt-4 pb-1 sm:h-9'\n\t\t\t\t\t\t\t: 'h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5'),\n\t\t\t\t\tsize === 'lg' &&\n\t\t\t\t\t\t(isFloating ? 'h-12 pt-5 pb-1.5 sm:h-11' : 'h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5'),\n\t\t\t\t\tprops.type === 'search' &&\n\t\t\t\t\t\t'[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none',\n\t\t\t\t\tprops.type === 'file' &&\n\t\t\t\t\t\t'text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm',\n\t\t\t\t)}\n\t\t\t\tdata-slot=\"input\"\n\t\t\t\tsize={typeof size === 'number' ? size : undefined}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</span>\n\t);\n}\n\nexport { Input };\nexport type { InputProps };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ScrollArea as ScrollAreaPrimitive } from \"@base-ui/react/scroll-area\";\n\nimport { cn } from \"../lib/utils\";\n\ntype ScrollAreaProps = ScrollAreaPrimitive.Root.Props & {\n scrollFade?: boolean;\n scrollbarGutter?: boolean;\n};\n\nconst ScrollArea = React.forwardRef<HTMLDivElement, ScrollAreaProps>(\n (\n { className, children, scrollFade = false, scrollbarGutter = false, ...props },\n ref\n ) => {\n return (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn(\"size-full min-h-0\", className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport\n className={cn(\n \"h-full overscroll-contain rounded-[inherit] outline-none transition-shadows focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background\",\n scrollFade &&\n \"mask-t-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-start)))] mask-b-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-end)))] mask-l-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-start)))] mask-r-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-end)))] [--fade-size:1.5rem]\",\n scrollbarGutter &&\n \"data-has-overflow-y:pe-2.5 data-has-overflow-x:pb-2.5\",\n )}\n data-slot=\"scroll-area-viewport\"\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar orientation=\"vertical\" />\n <ScrollBar orientation=\"horizontal\" />\n <ScrollAreaPrimitive.Corner data-slot=\"scroll-area-corner\" />\n </ScrollAreaPrimitive.Root>\n );\n }\n);\nScrollArea.displayName = \"ScrollArea\";\n\nfunction ScrollBar({\n className,\n orientation = \"vertical\",\n ...props\n}: ScrollAreaPrimitive.Scrollbar.Props) {\n return (\n <ScrollAreaPrimitive.Scrollbar\n className={cn(\n \"m-1 flex opacity-0 transition-opacity delay-300 data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 data-[orientation=horizontal]:flex-col data-hovering:opacity-100 data-scrolling:opacity-100 data-hovering:delay-0 data-scrolling:delay-0 data-hovering:duration-100 data-scrolling:duration-100\",\n className,\n )}\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n {...props}\n >\n <ScrollAreaPrimitive.Thumb\n className=\"relative flex-1 rounded-full bg-foreground/20\"\n data-slot=\"scroll-area-thumb\"\n />\n </ScrollAreaPrimitive.Scrollbar>\n );\n}\n\nexport { ScrollArea, ScrollBar };\n","\"use client\";\n\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react/combobox\";\nimport { ChevronsUpDownIcon, XIcon } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"../lib/utils\";\nimport { useFloatingOverlayPortalProps } from \"./portal\";\nimport { Input } from \"./input\";\nimport { ScrollArea } from \"./scroll-area\";\n\nconst ComboboxContext = React.createContext<{\n chipsRef: React.RefObject<Element | null> | null;\n multiple: boolean;\n}>({\n chipsRef: null,\n multiple: false,\n});\n\ntype ComboboxRootProps<\n ItemValue,\n Multiple extends boolean | undefined,\n> = Parameters<typeof ComboboxPrimitive.Root<ItemValue, Multiple>>[0];\n\nfunction Combobox<ItemValue, Multiple extends boolean | undefined = false>(\n props: ComboboxPrimitive.Root.Props<ItemValue, Multiple>,\n) {\n const chipsRef = React.useRef<Element | null>(null);\n return (\n <ComboboxContext.Provider value={{ chipsRef, multiple: !!props.multiple }}>\n <ComboboxPrimitive.Root\n {...(props as ComboboxRootProps<ItemValue, Multiple>)}\n />\n </ComboboxContext.Provider>\n );\n}\n\nfunction ComboboxInput({\n className,\n showTrigger = true,\n showClear = false,\n startAddon,\n size,\n ...props\n}: Omit<ComboboxPrimitive.Input.Props, \"size\"> & {\n showTrigger?: boolean;\n showClear?: boolean;\n startAddon?: React.ReactNode;\n size?: \"sm\" | \"default\" | \"lg\" | number;\n ref?: React.Ref<HTMLInputElement>;\n}) {\n const { multiple } = React.useContext(ComboboxContext);\n const sizeValue = (size ?? \"default\") as \"sm\" | \"default\" | \"lg\" | number;\n\n // multiple mode\n if (multiple) {\n return (\n <ComboboxPrimitive.Input\n className={cn(\n \"min-w-12 flex-1 text-base outline-none sm:text-sm [[data-slot=combobox-chip]+&]:ps-0.5\",\n sizeValue === \"sm\" ? \"ps-1.5\" : \"ps-2\",\n className,\n )}\n data-size={typeof sizeValue === \"string\" ? sizeValue : undefined}\n data-slot=\"combobox-input\"\n size={typeof sizeValue === \"number\" ? sizeValue : undefined}\n {...props}\n />\n );\n }\n\n // single mode\n return (\n <div className=\"relative not-has-[>*.w-full]:w-fit w-full has-disabled:opacity-64\">\n {startAddon && (\n <div\n aria-hidden=\"true\"\n className=\"[&_svg]:-mx-0.5 pointer-events-none absolute inset-y-0 start-px z-10 flex items-center ps-[calc(--spacing(3)-1px)] opacity-80 has-[+[data-size=sm]]:ps-[calc(--spacing(2.5)-1px)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4\"\n data-slot=\"combobox-start-addon\"\n >\n {startAddon}\n </div>\n )}\n <ComboboxPrimitive.Input\n className={cn(\n startAddon &&\n \"data-[size=sm]:*:data-[slot=combobox-input]:ps-[calc(--spacing(7.5)-1px)] *:data-[slot=combobox-input]:ps-[calc(--spacing(8.5)-1px)] sm:data-[size=sm]:*:data-[slot=combobox-input]:ps-[calc(--spacing(7)-1px)] sm:*:data-[slot=combobox-input]:ps-[calc(--spacing(8)-1px)]\",\n sizeValue === \"sm\"\n ? \"has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-6.5\"\n : \"has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-7\",\n className,\n )}\n data-slot=\"combobox-input\"\n render={<Input className=\"has-disabled:opacity-100\" size={sizeValue} />}\n {...props}\n />\n {showTrigger && (\n <ComboboxTrigger\n className={cn(\n \"-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=combobox-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n sizeValue === \"sm\" ? \"end-0\" : \"end-0.5\",\n )}\n >\n <ChevronsUpDownIcon />\n </ComboboxTrigger>\n )}\n {showClear && (\n <ComboboxClear\n className={cn(\n \"-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=combobox-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n sizeValue === \"sm\" ? \"end-0\" : \"end-0.5\",\n )}\n >\n <XIcon />\n </ComboboxClear>\n )}\n </div>\n );\n}\n\nfunction ComboboxTrigger({\n className,\n ...props\n}: ComboboxPrimitive.Trigger.Props) {\n return (\n <ComboboxPrimitive.Trigger\n className={className}\n data-slot=\"combobox-trigger\"\n {...props}\n />\n );\n}\n\nfunction ComboboxPopup({\n className,\n children,\n sideOffset = 4,\n ...props\n}: ComboboxPrimitive.Popup.Props & {\n sideOffset?: number;\n}) {\n const { chipsRef, multiple } = React.useContext(ComboboxContext);\n const { container, zIndexClass } = useFloatingOverlayPortalProps();\n\n return (\n <ComboboxPrimitive.Portal container={container}>\n <ComboboxPrimitive.Positioner\n {...(multiple ? { anchor: chipsRef } : {})}\n className={cn(\"select-none\", zIndexClass)}\n data-slot=\"combobox-positioner\"\n sideOffset={sideOffset}\n >\n <span\n className={cn(\n \"relative flex max-h-full origin-(--transform-origin) rounded-lg border bg-popover not-dark:bg-clip-padding shadow-lg/5 transition-[scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/6%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]\",\n className,\n )}\n >\n <ComboboxPrimitive.Popup\n className=\"flex max-h-[min(var(--available-height),23rem)] w-(--anchor-width) max-w-(--available-width) flex-col\"\n data-slot=\"combobox-popup\"\n {...props}\n >\n {children}\n </ComboboxPrimitive.Popup>\n </span>\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n );\n}\n\nfunction ComboboxItem({\n className,\n children,\n ...props\n}: ComboboxPrimitive.Item.Props) {\n return (\n <ComboboxPrimitive.Item\n className={cn(\n \"grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 ps-2 pe-4 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n className,\n )}\n data-slot=\"combobox-item\"\n {...props}\n >\n <ComboboxPrimitive.ItemIndicator className=\"col-start-1\">\n <svg\n fill=\"none\"\n height=\"24\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n xmlns=\"http://www.w3.org/1500/svg\"\n >\n <path d=\"M5.252 12.7 10.2 18.63 18.748 5.37\" />\n </svg>\n </ComboboxPrimitive.ItemIndicator>\n <div className=\"col-start-2\">{children}</div>\n </ComboboxPrimitive.Item>\n );\n}\n\nfunction ComboboxSeparator({\n className,\n ...props\n}: ComboboxPrimitive.Separator.Props) {\n return (\n <ComboboxPrimitive.Separator\n className={cn(\"mx-2 my-1 h-px bg-border last:hidden\", className)}\n data-slot=\"combobox-separator\"\n {...props}\n />\n );\n}\n\nfunction ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props) {\n return (\n <ComboboxPrimitive.Group\n className={cn(\"[[role=group]+&]:mt-1.5\", className)}\n data-slot=\"combobox-group\"\n {...props}\n />\n );\n}\n\nfunction ComboboxGroupLabel({\n className,\n ...props\n}: ComboboxPrimitive.GroupLabel.Props) {\n return (\n <ComboboxPrimitive.GroupLabel\n className={cn(\n \"px-2 py-1.5 font-medium text-muted-foreground text-xs\",\n className,\n )}\n data-slot=\"combobox-group-label\"\n {...props}\n />\n );\n}\n\nfunction ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {\n return (\n <ComboboxPrimitive.Empty\n className={cn(\n \"not-empty:p-2 text-center text-base text-muted-foreground sm:text-sm\",\n className,\n )}\n data-slot=\"combobox-empty\"\n {...props}\n />\n );\n}\n\nfunction ComboboxRow({ className, ...props }: ComboboxPrimitive.Row.Props) {\n return (\n <ComboboxPrimitive.Row\n className={className}\n data-slot=\"combobox-row\"\n {...props}\n />\n );\n}\n\nfunction ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {\n return <ComboboxPrimitive.Value data-slot=\"combobox-value\" {...props} />;\n}\n\nfunction ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {\n return (\n <ScrollArea scrollbarGutter scrollFade>\n <ComboboxPrimitive.List\n className={cn(\n \"not-empty:scroll-py-1 not-empty:px-1 not-empty:py-1 in-data-has-overflow-y:pe-3\",\n className,\n )}\n data-slot=\"combobox-list\"\n {...props}\n />\n </ScrollArea>\n );\n}\n\nfunction ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {\n return (\n <ComboboxPrimitive.Clear\n className={className}\n data-slot=\"combobox-clear\"\n {...props}\n />\n );\n}\n\nfunction ComboboxStatus({\n className,\n ...props\n}: ComboboxPrimitive.Status.Props) {\n return (\n <ComboboxPrimitive.Status\n className={cn(\n \"px-3 py-2 font-medium text-muted-foreground text-xs empty:m-0 empty:p-0\",\n className,\n )}\n data-slot=\"combobox-status\"\n {...props}\n />\n );\n}\n\nfunction ComboboxCollection(props: ComboboxPrimitive.Collection.Props) {\n return (\n <ComboboxPrimitive.Collection data-slot=\"combobox-collection\" {...props} />\n );\n}\n\nfunction ComboboxChips({\n className,\n children,\n startAddon,\n ...props\n}: ComboboxPrimitive.Chips.Props & {\n startAddon?: React.ReactNode;\n}) {\n const { chipsRef } = React.useContext(ComboboxContext);\n\n return (\n <ComboboxPrimitive.Chips\n className={cn(\n \"relative inline-flex min-h-9 w-full flex-wrap gap-1 rounded-lg border border-input bg-background not-dark:bg-clip-padding p-[calc(--spacing(1)-1px)] text-base shadow-xs/5 outline-none ring-ring/24 transition-shadow *:min-h-7 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/6%)] focus-within:border-ring focus-within:ring-[3px] has-disabled:pointer-events-none has-data-[size=lg]:min-h-10 has-data-[size=sm]:min-h-8 has-aria-invalid:border-destructive/36 has-disabled:opacity-64 has-[:disabled,:focus-within,[aria-invalid]]:shadow-none focus-within:has-aria-invalid:border-destructive/64 focus-within:has-aria-invalid:ring-destructive/16 has-data-[size=lg]:*:min-h-8 has-data-[size=sm]:*:min-h-6 sm:min-h-8 sm:text-sm sm:has-data-[size=lg]:min-h-9 sm:has-data-[size=sm]:min-h-7 sm:*:min-h-6 sm:has-data-[size=lg]:*:min-h-7 sm:has-data-[size=sm]:*:min-h-5 dark:not-has-disabled:bg-input/32 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]\",\n className,\n )}\n data-slot=\"combobox-chips\"\n onMouseDown={(e) => {\n const target = e.target as HTMLElement;\n const isChip = target.closest('[data-slot=\"combobox-chip\"]');\n if (isChip || !chipsRef?.current) return;\n e.preventDefault();\n const input: HTMLInputElement | null =\n chipsRef.current.querySelector(\"input\");\n if (input && !chipsRef.current.querySelector(\"input:focus\")) {\n input.focus();\n }\n }}\n ref={chipsRef as React.Ref<HTMLDivElement> | null}\n {...props}\n >\n {startAddon && (\n <div\n aria-hidden=\"true\"\n className=\"[&_svg]:-ms-0.5 [&_svg]:-me-1.5 flex shrink-0 items-center ps-2 opacity-80 has-[~[data-size=sm]]:has-[+[data-slot=combobox-chip]]:pe-1.5 has-[~[data-size=sm]]:ps-1.5 has-[+[data-slot=combobox-chip]]:pe-2 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none\"\n data-slot=\"combobox-start-addon\"\n >\n {startAddon}\n </div>\n )}\n {children}\n </ComboboxPrimitive.Chips>\n );\n}\n\nfunction ComboboxChip({ children, ...props }: ComboboxPrimitive.Chip.Props) {\n return (\n <ComboboxPrimitive.Chip\n className=\"flex items-center rounded-[calc(var(--radius-md)-1px)] bg-accent ps-2 font-medium text-accent-foreground text-sm outline-none sm:text-xs/(--text-xs--line-height) [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5\"\n data-slot=\"combobox-chip\"\n {...props}\n >\n {children}\n <ComboboxChipRemove />\n </ComboboxPrimitive.Chip>\n );\n}\n\nfunction ComboboxChipRemove(props: ComboboxPrimitive.ChipRemove.Props) {\n return (\n <ComboboxPrimitive.ChipRemove\n aria-label=\"Remove\"\n className=\"h-full shrink-0 cursor-pointer px-1.5 opacity-80 hover:opacity-100 [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5\"\n data-slot=\"combobox-chip-remove\"\n {...props}\n >\n <XIcon />\n </ComboboxPrimitive.ChipRemove>\n );\n}\n\nconst useComboboxFilter = ComboboxPrimitive.useFilter;\n\nconst ComboboxContent = ComboboxPopup;\n\ntype ComboboxProps<ItemValue = unknown, Multiple extends boolean | undefined = false> =\n ComboboxPrimitive.Root.Props<ItemValue, Multiple>;\ntype ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props;\ntype ComboboxContentProps = React.ComponentProps<typeof ComboboxPopup>;\ntype ComboboxInputProps = React.ComponentProps<typeof ComboboxInput>;\ntype ComboboxListProps = React.ComponentProps<typeof ComboboxList>;\ntype ComboboxEmptyProps = React.ComponentProps<typeof ComboboxEmpty>;\ntype ComboboxGroupProps = React.ComponentProps<typeof ComboboxGroup>;\ntype ComboboxItemProps = React.ComponentProps<typeof ComboboxItem>;\ntype ComboboxSeparatorProps = React.ComponentProps<typeof ComboboxSeparator>;\n\nexport {\n Combobox,\n ComboboxInput,\n ComboboxTrigger,\n ComboboxContent,\n ComboboxPopup,\n ComboboxItem,\n ComboboxSeparator,\n ComboboxGroup,\n ComboboxGroupLabel,\n ComboboxEmpty,\n ComboboxValue,\n ComboboxList,\n ComboboxClear,\n ComboboxStatus,\n ComboboxRow,\n ComboboxCollection,\n ComboboxChips,\n ComboboxChip,\n useComboboxFilter,\n};\n\nexport type {\n ComboboxProps,\n ComboboxTriggerProps,\n ComboboxContentProps,\n ComboboxInputProps,\n ComboboxListProps,\n ComboboxEmptyProps,\n ComboboxGroupProps,\n ComboboxItemProps,\n ComboboxSeparatorProps,\n};\n"]}
1
+ {"version":3,"sources":["../../src/lib/utils.ts","../../src/components/portal.tsx","../../src/components/input.tsx","../../src/components/scroll-area.tsx","../../src/components/combobox.tsx"],"names":["React","jsx","InputPrimitive","React2","ScrollAreaPrimitive","ComboboxPrimitive","jsxs"],"mappings":";;;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACuCO,IAAM,cAAA,GAAiB,aAAA;AAM9B,IAAM,gBAAsBA,MAAA,CAAA,aAAA,CAAkC;AAAA,EAC7D,KAAA,EAAO,MAAA;AAAA,EACP,KAAA,EAAO,CAAA;AAAA,EACP,sBAAA,EAAwB,MAAA;AAAA,EACxB,cAAA,EAAgB;AACjB,CAAC,CAAA;AAwEM,SAAS,sBAAA,GAA6C;AAC5D,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAUA,gBAA6B,IAAI,CAAA;AAEzE,EAAMA,uBAAgB,MAAM;AAC3B,IAAA,MAAM,E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AAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,aAAA,EAAY,MAAA;AAAA,YACZ,SAAA,EAAU,wTAAA;AAAA,YACV,WAAA,EAAU,sBAAA;AAAA,YAET,QAAA,EAAA;AAAA;AAAA,SACH;AAAA,QAED;AAAA;AAAA;AAAA,GACH;AAEJ;AAEA,SAAS,YAAA,CAAa;AAAA,EACpB,QAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAiC;AAC/B,EAAA,uBACEK,IAAAA;AAAA,IAACD,UAAA,CAAkB,IAAA;AAAA,IAAlB;AAAA,MACC,SAAA,EAAU,kPAAA;AAAA,MACV,WAAA,EAAU,eAAA;AAAA,MACT,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA,QAAA,QAAA;AAAA,wBACDJ,IAAC,kBAAA,EAAA,EAAmB;AAAA;AAAA;AAAA,GACtB;AAEJ;AAEA,SAAS,kBAAA,CAAmB;AAAA,EAC1B,GAAG;AACL,CAAA,EAAuC;AACrC,EAAA,uBACEA,GAAAA;AAAA,IAACI,UAAA,CAAkB,UAAA;AAAA,IAAlB;AAAA,MACC,YAAA,EAAW,QAAA;AAAA,MACX,SAAA,EAAU,mJAAA;AAAA,MACV,WAAA,EAAU,sBAAA;AAAA,MACT,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAAJ,IAAC,KAAA,EAAA,EAAM;AAAA;AAAA,GACT;AAEJ;AAEA,IAAM,oBAAoBI,UAAA,CAAkB;AAE5C,IAAM,eAAA,GAAkB","file":"combobox.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport * as React from 'react';\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Overlay layer type:\n * - 'base': Root level (page content, base floating elements)\n * - 'modal': Inside a modal overlay (dialog, sheet, drawer)\n */\nexport type OverlayLayer = 'base' | 'modal';\n\n/**\n * Where floating overlays should portal:\n * - 'root': always portal into #portal-root\n * - 'nested': let Base UI nest portals into the nearest Base UI portal node\n */\nexport type FloatingPortalStrategy = 'root' | 'nested';\n\n/**\n * Z-index mode for floating overlays.\n * - 'default': --z-layer-floating\n * - 'elevated': --z-layer-floating-elevated\n */\nexport type FloatingZIndex = 'default' | 'elevated';\n\ninterface PortalContextValue {\n\t/** Current overlay layer */\n\tlayer: OverlayLayer;\n\t/** Modal nesting depth (0 for first modal, 1 for nested, etc.) */\n\tdepth: number;\n\t/** Strategy for where floating overlays should portal */\n\tfloatingPortalStrategy: FloatingPortalStrategy;\n\t/** Z-index mode for floating overlays */\n\tfloatingZIndex: FloatingZIndex;\n}\n\n// ============================================================================\n// Constants\n// ============================================================================\n\nexport const PORTAL_ROOT_ID = 'portal-root';\n\n// ============================================================================\n// Context\n// ============================================================================\n\nconst PortalContext = React.createContext<PortalContextValue>({\n\tlayer: 'base',\n\tdepth: 0,\n\tfloatingPortalStrategy: 'root',\n\tfloatingZIndex: 'default',\n});\n\n// ============================================================================\n// Providers\n// ============================================================================\n\n/**\n * Provider for modal overlays (Dialog, Sheet, Drawer, etc.)\n *\n * Wraps modal content to:\n * 1. Create a scoped portal container for nested floating elements\n * 2. Track the overlay layer (so floating elements know to use elevated z-index)\n * 3. Track nesting depth for stacked modals\n *\n * Usage:\n * ```tsx\n * <DialogPopup>\n * <ModalPortalScope>\n * {children} // Popovers inside here will render in the scoped container\n * </ModalPortalScope>\n * </DialogPopup>\n * ```\n */\nexport function ModalPortalScope({\n\tchildren,\n\tfloatingPortalStrategy = 'nested',\n\tfloatingZIndex = 'default',\n}: {\n\tchildren: React.ReactNode;\n\tfloatingPortalStrategy?: FloatingPortalStrategy;\n\tfloatingZIndex?: FloatingZIndex;\n}) {\n\tconst parentContext = React.useContext(PortalContext);\n\n\t// Increment depth from parent if already in modal layer\n\tconst depth = parentContext.layer === 'modal' ? parentContext.depth + 1 : 0;\n\n\tconst value = React.useMemo<PortalContextValue>(\n\t\t() => ({\n\t\t\tlayer: 'modal',\n\t\t\tdepth,\n\t\t\tfloatingPortalStrategy,\n\t\t\tfloatingZIndex,\n\t\t}),\n\t\t[depth, floatingPortalStrategy, floatingZIndex],\n\t);\n\n\treturn <PortalContext.Provider value={value}>{children}</PortalContext.Provider>;\n}\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\n/**\n * Get the current portal context value.\n * Used internally by other hooks.\n */\nexport function usePortalContext(): PortalContextValue {\n\treturn React.useContext(PortalContext);\n}\n\nexport function useInModalOverlay(): boolean {\n\treturn React.useContext(PortalContext).layer === 'modal';\n}\n\n/**\n * Get the root portal container element.\n * Used by modal components (Dialog, Sheet, etc.) to render their portals.\n *\n * @returns The root portal container, or null during SSR/before mount\n */\nexport function useRootPortalContainer(): HTMLElement | null {\n\tconst [container, setContainer] = React.useState<HTMLElement | null>(null);\n\n\tReact.useLayoutEffect(() => {\n\t\tconst el = document.getElementById(PORTAL_ROOT_ID);\n\t\tsetContainer(el);\n\t}, []);\n\n\treturn container;\n}\n\n/**\n * Centralized portal + z-index policy for floating overlays.\n *\n * - When `floatingPortalStrategy` is 'nested', Base UI will automatically portal\n * into the nearest Base UI portal node (so dialog \"inert\" behavior includes it).\n * - When it's 'root', we portal into #portal-root.\n */\nexport function useFloatingOverlayPortalProps(): {\n\tcontainer?: HTMLElement | null;\n\tzIndexClass: string;\n} {\n\tconst rootContainer = useRootPortalContainer();\n\tconst { floatingPortalStrategy, floatingZIndex } = React.useContext(PortalContext);\n\n\tconst container = floatingPortalStrategy === 'nested' ? undefined : (rootContainer ?? null);\n\tconst zIndexClass =\n\t\tfloatingZIndex === 'elevated'\n\t\t\t? 'z-[var(--z-layer-floating-elevated)]'\n\t\t\t: 'z-[var(--z-layer-floating)]';\n\n\treturn { container, zIndexClass };\n}\n\n// ============================================================================\n// Components\n// ============================================================================\n\n/**\n * Portal root component to render in app layout.\n * All overlay components will render their portals inside this container.\n *\n * Usage in layout.tsx:\n * ```tsx\n * import { PortalRoot } from '@constructive-io/ui/portal';\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html>\n * <body>\n * {children}\n * <PortalRoot />\n * </body>\n * </html>\n * );\n * }\n * ```\n */\nexport function PortalRoot() {\n\treturn (\n\t\t<div\n\t\t\tid={PORTAL_ROOT_ID}\n\t\t\tdata-slot=\"portal-root\"\n\t\t\tstyle={{\n\t\t\t\tposition: 'fixed',\n\t\t\t\tinset: 0,\n\t\t\t\tzIndex: 'var(--z-layer-portal-root)',\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\t// Children (portal contents) will have pointer-events: auto\n\t\t\t}}\n\t\t/>\n\t);\n}\n\n/**\n * Hook to get the portal container element for rendering floating UI elements.\n * Returns the element with id=\"portal-root\" if it exists in the DOM.\n *\n * @deprecated Use useRootPortalContainer or useFloatingOverlayPortalProps instead\n */\nexport function usePortalContainer(): HTMLElement | undefined {\n\tif (typeof document === 'undefined') return undefined;\n\tconst el = document.getElementById(PORTAL_ROOT_ID);\n\treturn el instanceof HTMLElement ? el : undefined;\n}\n","'use client';\n\nimport { Input as InputPrimitive } from '@base-ui/react/input';\nimport type * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\ntype InputProps = Omit<InputPrimitive.Props & React.RefAttributes<HTMLInputElement>, 'size'> & {\n\tsize?: 'sm' | 'default' | 'lg' | number;\n\tunstyled?: boolean;\n};\n\nfunction Input({ className, size = 'default', unstyled = false, ...props }: InputProps) {\n\tconst isFloating = props.placeholder === ' ';\n\n\treturn (\n\t\t<span\n\t\t\tclassName={\n\t\t\t\tcn(\n\t\t\t\t\t!unstyled && [\n\t\t\t\t\t\t// Base layout\n\t\t\t\t\t\t'relative inline-flex w-full rounded-lg border border-input bg-background bg-clip-padding text-base transition-shadow',\n\t\t\t\t\t\t// Inner shadow highlight\n\t\t\t\t\t\t'before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)]',\n\t\t\t\t\t\t'not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)]',\n\t\t\t\t\t\t// Focus state - use primary brand color\n\t\t\t\t\t\t'has-focus-visible:border-primary/60 has-focus-visible:ring-[3px] has-focus-visible:ring-primary/35',\n\t\t\t\t\t\t// Invalid state\n\t\t\t\t\t\t'has-aria-invalid:border-destructive/36',\n\t\t\t\t\t\t'has-focus-visible:has-aria-invalid:border-destructive/64 has-focus-visible:has-aria-invalid:ring-destructive/16',\n\t\t\t\t\t\t// Disabled state\n\t\t\t\t\t\t'has-disabled:opacity-64 has-[:disabled,:focus-visible,[aria-invalid]]:shadow-none',\n\t\t\t\t\t\t// Dark mode\n\t\t\t\t\t\t'sm:text-sm dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border',\n\t\t\t\t\t\t'dark:has-aria-invalid:ring-destructive/24',\n\t\t\t\t\t\t'dark:not-has-disabled:not-has-focus-visible:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/8%)]',\n\t\t\t\t\t],\n\t\t\t\t\tclassName,\n\t\t\t\t) || undefined\n\t\t\t}\n\t\t\tdata-size={size}\n\t\t\tdata-slot=\"input-control\"\n\t\t>\n\t\t\t<InputPrimitive\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'w-full min-w-0 rounded-[inherit] bg-transparent px-[calc(--spacing(3)-1px)] outline-none',\n\t\t\t\t\tisFloating\n\t\t\t\t\t\t? 'h-11 pt-4.5 pb-1 leading-none placeholder:text-transparent sm:h-10'\n\t\t\t\t\t\t: 'h-8.5 leading-8.5 placeholder:text-muted-foreground/72 sm:h-7.5 sm:leading-7.5',\n\t\t\t\t\tsize === 'sm' &&\n\t\t\t\t\t\t(isFloating\n\t\t\t\t\t\t\t? 'h-10 px-[calc(--spacing(2.5)-1px)] pt-4 pb-1 sm:h-9'\n\t\t\t\t\t\t\t: 'h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5'),\n\t\t\t\t\tsize === 'lg' &&\n\t\t\t\t\t\t(isFloating ? 'h-12 pt-5 pb-1.5 sm:h-11' : 'h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5'),\n\t\t\t\t\tprops.type === 'search' &&\n\t\t\t\t\t\t'[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none',\n\t\t\t\t\tprops.type === 'file' &&\n\t\t\t\t\t\t'text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm',\n\t\t\t\t)}\n\t\t\t\tdata-slot=\"input\"\n\t\t\t\tsize={typeof size === 'number' ? size : undefined}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</span>\n\t);\n}\n\nexport { Input };\nexport type { InputProps };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ScrollArea as ScrollAreaPrimitive } from \"@base-ui/react/scroll-area\";\n\nimport { cn } from \"../lib/utils\";\n\ntype ScrollAreaProps = ScrollAreaPrimitive.Root.Props & {\n scrollFade?: boolean;\n scrollbarGutter?: boolean;\n};\n\nconst ScrollArea = React.forwardRef<HTMLDivElement, ScrollAreaProps>(\n (\n { className, children, scrollFade = false, scrollbarGutter = false, ...props },\n ref\n ) => {\n return (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn(\"size-full min-h-0\", className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport\n className={cn(\n \"h-full overscroll-contain rounded-[inherit] outline-none transition-shadows focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background\",\n scrollFade &&\n \"mask-t-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-start)))] mask-b-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-end)))] mask-l-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-start)))] mask-r-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-end)))] [--fade-size:1.5rem]\",\n scrollbarGutter &&\n \"data-has-overflow-y:pe-2.5 data-has-overflow-x:pb-2.5\",\n )}\n data-slot=\"scroll-area-viewport\"\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar orientation=\"vertical\" />\n <ScrollBar orientation=\"horizontal\" />\n <ScrollAreaPrimitive.Corner data-slot=\"scroll-area-corner\" />\n </ScrollAreaPrimitive.Root>\n );\n }\n);\nScrollArea.displayName = \"ScrollArea\";\n\nfunction ScrollBar({\n className,\n orientation = \"vertical\",\n ...props\n}: ScrollAreaPrimitive.Scrollbar.Props) {\n return (\n <ScrollAreaPrimitive.Scrollbar\n className={cn(\n \"m-1 flex opacity-0 transition-opacity delay-300 data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:w-1.5 data-[orientation=horizontal]:flex-col data-hovering:opacity-100 data-scrolling:opacity-100 data-hovering:delay-0 data-scrolling:delay-0 data-hovering:duration-100 data-scrolling:duration-100\",\n className,\n )}\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n {...props}\n >\n <ScrollAreaPrimitive.Thumb\n className=\"relative flex-1 rounded-full bg-foreground/20\"\n data-slot=\"scroll-area-thumb\"\n />\n </ScrollAreaPrimitive.Scrollbar>\n );\n}\n\nexport { ScrollArea, ScrollBar };\n","\"use client\";\n\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react/combobox\";\nimport { ChevronsUpDownIcon, XIcon } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"../lib/utils\";\nimport { useFloatingOverlayPortalProps } from \"./portal\";\nimport { Input } from \"./input\";\nimport { ScrollArea } from \"./scroll-area\";\n\nconst ComboboxContext = React.createContext<{\n chipsRef: React.RefObject<Element | null> | null;\n multiple: boolean;\n}>({\n chipsRef: null,\n multiple: false,\n});\n\ntype ComboboxRootProps<\n ItemValue,\n Multiple extends boolean | undefined,\n> = Parameters<typeof ComboboxPrimitive.Root<ItemValue, Multiple>>[0];\n\nfunction Combobox<ItemValue, Multiple extends boolean | undefined = false>(\n props: ComboboxPrimitive.Root.Props<ItemValue, Multiple>,\n) {\n const chipsRef = React.useRef<Element | null>(null);\n return (\n <ComboboxContext.Provider value={{ chipsRef, multiple: !!props.multiple }}>\n <ComboboxPrimitive.Root\n {...(props as ComboboxRootProps<ItemValue, Multiple>)}\n />\n </ComboboxContext.Provider>\n );\n}\n\nfunction ComboboxInput({\n className,\n showTrigger = true,\n showClear = false,\n startAddon,\n size,\n ...props\n}: Omit<ComboboxPrimitive.Input.Props, \"size\"> & {\n showTrigger?: boolean;\n showClear?: boolean;\n startAddon?: React.ReactNode;\n size?: \"sm\" | \"default\" | \"lg\" | number;\n ref?: React.Ref<HTMLInputElement>;\n }) {\n const { multiple } = React.useContext(ComboboxContext);\n const sizeValue = (size ?? \"default\") as \"sm\" | \"default\" | \"lg\" | number;\n\n // multiple mode\n if (multiple) {\n return (\n <ComboboxPrimitive.Input\n className={cn(\n \"min-w-12 flex-1 text-base outline-none sm:text-sm [[data-slot=combobox-chip]+&]:ps-0.5\",\n sizeValue === \"sm\" ? \"ps-1.5\" : \"ps-2\",\n className,\n )}\n data-size={typeof sizeValue === \"string\" ? sizeValue : undefined}\n data-slot=\"combobox-input\"\n size={typeof sizeValue === \"number\" ? sizeValue : undefined}\n {...props}\n />\n );\n }\n\n // single mode\n return (\n <div className=\"relative not-has-[>*.w-full]:w-fit w-full has-disabled:opacity-64\">\n {startAddon && (\n <div\n aria-hidden=\"true\"\n className=\"[&_svg]:-mx-0.5 pointer-events-none absolute inset-y-0 start-px z-10 flex items-center ps-[calc(--spacing(3)-1px)] has-[+[data-size=sm]]:ps-[calc(--spacing(2.5)-1px)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:opacity-80\"\n data-slot=\"combobox-start-addon\"\n >\n {startAddon}\n </div>\n )}\n <ComboboxPrimitive.Input\n className={cn(\n startAddon &&\n \"data-[size=sm]:*:data-[slot=combobox-input]:ps-[calc(--spacing(7.5)-1px)] *:data-[slot=combobox-input]:ps-[calc(--spacing(8.5)-1px)] sm:data-[size=sm]:*:data-[slot=combobox-input]:ps-[calc(--spacing(7)-1px)] sm:*:data-[slot=combobox-input]:ps-[calc(--spacing(8)-1px)]\",\n sizeValue === \"sm\"\n ? \"has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-6.5\"\n : \"has-[+[data-slot=combobox-trigger],+[data-slot=combobox-clear]]:*:data-[slot=combobox-input]:pe-7\",\n className,\n )}\n data-slot=\"combobox-input\"\n render={<Input className=\"has-disabled:opacity-100\" size={sizeValue} />}\n {...props}\n />\n {showTrigger && (\n <ComboboxTrigger\n className={cn(\n \"-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=combobox-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n sizeValue === \"sm\" ? \"end-0\" : \"end-0.5\",\n )}\n >\n <ChevronsUpDownIcon />\n </ComboboxTrigger>\n )}\n {showClear && (\n <ComboboxClear\n className={cn(\n \"-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-opacity pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=combobox-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n sizeValue === \"sm\" ? \"end-0\" : \"end-0.5\",\n )}\n >\n <XIcon />\n </ComboboxClear>\n )}\n </div>\n );\n}\n\nfunction ComboboxTrigger({\n className,\n ...props\n}: ComboboxPrimitive.Trigger.Props) {\n return (\n <ComboboxPrimitive.Trigger\n className={className}\n data-slot=\"combobox-trigger\"\n {...props}\n />\n );\n}\n\nfunction ComboboxPopup({\n className,\n children,\n sideOffset = 4,\n ...props\n}: ComboboxPrimitive.Popup.Props & {\n sideOffset?: number;\n }) {\n const { chipsRef, multiple } = React.useContext(ComboboxContext);\n const { container, zIndexClass } = useFloatingOverlayPortalProps();\n\n return (\n <ComboboxPrimitive.Portal container={container}>\n <ComboboxPrimitive.Positioner\n {...(multiple ? { anchor: chipsRef } : {})}\n className={cn(\"select-none\", zIndexClass)}\n data-slot=\"combobox-positioner\"\n sideOffset={sideOffset}\n >\n <span\n className={cn(\n \"relative flex max-h-full origin-(--transform-origin) rounded-lg border bg-popover not-dark:bg-clip-padding shadow-lg/5 transition-[scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/6%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]\",\n className,\n )}\n >\n <ComboboxPrimitive.Popup\n className=\"flex max-h-[min(var(--available-height),23rem)] w-(--anchor-width) max-w-(--available-width) flex-col\"\n data-slot=\"combobox-popup\"\n {...props}\n >\n {children}\n </ComboboxPrimitive.Popup>\n </span>\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n );\n}\n\nfunction ComboboxItem({\n className,\n children,\n ...props\n}: ComboboxPrimitive.Item.Props) {\n return (\n <ComboboxPrimitive.Item\n className={cn(\n \"grid min-h-8 in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] cursor-default grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 ps-2 pe-4 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n className,\n )}\n data-slot=\"combobox-item\"\n {...props}\n >\n <ComboboxPrimitive.ItemIndicator className=\"col-start-1\">\n <svg\n fill=\"none\"\n height=\"24\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n xmlns=\"http://www.w3.org/1500/svg\"\n >\n <path d=\"M5.252 12.7 10.2 18.63 18.748 5.37\" />\n </svg>\n </ComboboxPrimitive.ItemIndicator>\n <div className=\"col-start-2\">{children}</div>\n </ComboboxPrimitive.Item>\n );\n}\n\nfunction ComboboxSeparator({\n className,\n ...props\n}: ComboboxPrimitive.Separator.Props) {\n return (\n <ComboboxPrimitive.Separator\n className={cn(\"mx-2 my-1 h-px bg-border last:hidden\", className)}\n data-slot=\"combobox-separator\"\n {...props}\n />\n );\n}\n\nfunction ComboboxGroup({\n className,\n ...props\n}: ComboboxPrimitive.Group.Props) {\n return (\n <ComboboxPrimitive.Group\n className={cn(\"[[role=group]+&]:mt-1.5\", className)}\n data-slot=\"combobox-group\"\n {...props}\n />\n );\n}\n\nfunction ComboboxGroupLabel({\n className,\n ...props\n}: ComboboxPrimitive.GroupLabel.Props) {\n return (\n <ComboboxPrimitive.GroupLabel\n className={cn(\n \"px-2 py-1.5 font-medium text-muted-foreground text-xs\",\n className,\n )}\n data-slot=\"combobox-group-label\"\n {...props}\n />\n );\n}\n\nfunction ComboboxEmpty({\n className,\n ...props\n}: ComboboxPrimitive.Empty.Props) {\n return (\n <ComboboxPrimitive.Empty\n className={cn(\n \"not-empty:p-2 text-center text-base text-muted-foreground sm:text-sm\",\n className,\n )}\n data-slot=\"combobox-empty\"\n {...props}\n />\n );\n}\n\nfunction ComboboxRow({\n className,\n ...props\n}: ComboboxPrimitive.Row.Props) {\n return (\n <ComboboxPrimitive.Row\n className={className}\n data-slot=\"combobox-row\"\n {...props}\n />\n );\n}\n\nfunction ComboboxValue({\n ...props\n}: ComboboxPrimitive.Value.Props) {\n return (\n <ComboboxPrimitive.Value\n data-slot=\"combobox-value\"\n {...props}\n />\n );\n}\n\nfunction ComboboxList({\n className,\n ...props\n}: ComboboxPrimitive.List.Props) {\n return (\n <ScrollArea scrollbarGutter scrollFade>\n <ComboboxPrimitive.List\n className={cn(\n \"not-empty:scroll-py-1 not-empty:px-1 not-empty:py-1 in-data-has-overflow-y:pe-3\",\n className,\n )}\n data-slot=\"combobox-list\"\n {...props}\n />\n </ScrollArea>\n );\n}\n\nfunction ComboboxClear({\n className,\n ...props\n}: ComboboxPrimitive.Clear.Props) {\n return (\n <ComboboxPrimitive.Clear\n className={className}\n data-slot=\"combobox-clear\"\n {...props}\n />\n );\n}\n\nfunction ComboboxStatus({\n className,\n ...props\n}: ComboboxPrimitive.Status.Props) {\n return (\n <ComboboxPrimitive.Status\n className={cn(\n \"px-3 py-2 font-medium text-muted-foreground text-xs empty:m-0 empty:p-0\",\n className,\n )}\n data-slot=\"combobox-status\"\n {...props}\n />\n );\n}\n\nfunction ComboboxCollection({\n ...props\n}: ComboboxPrimitive.Collection.Props) {\n return (\n <ComboboxPrimitive.Collection\n data-slot=\"combobox-collection\"\n {...props}\n />\n );\n}\n\nfunction ComboboxChips({\n className,\n children,\n startAddon,\n ...props\n}: ComboboxPrimitive.Chips.Props & {\n startAddon?: React.ReactNode;\n }) {\n const { chipsRef } = React.useContext(ComboboxContext);\n\n return (\n <ComboboxPrimitive.Chips\n className={cn(\n \"relative inline-flex min-h-9 w-full flex-wrap gap-1 rounded-lg border border-input bg-background not-dark:bg-clip-padding p-[calc(--spacing(1)-1px)] text-base outline-none ring-ring/24 transition-shadow *:min-h-7 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/6%)] focus-within:border-ring focus-within:ring-[3px] has-disabled:pointer-events-none has-data-[size=lg]:min-h-10 has-data-[size=sm]:min-h-8 has-aria-invalid:border-destructive/36 has-disabled:opacity-64 has-[:disabled,:focus-within,[aria-invalid]]:shadow-none focus-within:has-aria-invalid:border-destructive/64 focus-within:has-aria-invalid:ring-destructive/16 has-data-[size=lg]:*:min-h-8 has-data-[size=sm]:*:min-h-6 sm:min-h-8 sm:text-sm sm:has-data-[size=lg]:min-h-9 sm:has-data-[size=sm]:min-h-7 sm:*:min-h-6 sm:has-data-[size=lg]:*:min-h-7 sm:has-data-[size=sm]:*:min-h-5 dark:not-has-disabled:bg-input/32 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-focus-within:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]\",\n className,\n )}\n data-slot=\"combobox-chips\"\n onMouseDown={(e) => {\n const target = e.target as HTMLElement;\n const isChip = target.closest('[data-slot=\"combobox-chip\"]');\n if (isChip || !chipsRef?.current) return;\n e.preventDefault();\n const input: HTMLInputElement | null =\n chipsRef.current.querySelector(\"input\");\n if (input && !chipsRef.current.querySelector(\"input:focus\")) {\n input.focus();\n }\n }}\n ref={chipsRef as React.Ref<HTMLDivElement> | null}\n {...props}\n >\n {startAddon && (\n <div\n aria-hidden=\"true\"\n className=\"[&_svg]:-ms-0.5 [&_svg]:-me-1.5 flex shrink-0 items-center ps-2 opacity-80 has-[~[data-size=sm]]:has-[+[data-slot=combobox-chip]]:pe-1.5 has-[~[data-size=sm]]:ps-1.5 has-[+[data-slot=combobox-chip]]:pe-2 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none\"\n data-slot=\"combobox-start-addon\"\n >\n {startAddon}\n </div>\n )}\n {children}\n </ComboboxPrimitive.Chips>\n );\n}\n\nfunction ComboboxChip({\n children,\n ...props\n}: ComboboxPrimitive.Chip.Props) {\n return (\n <ComboboxPrimitive.Chip\n className=\"flex items-center rounded-[calc(var(--radius-md)-1px)] bg-accent ps-2 font-medium text-accent-foreground text-sm outline-none sm:text-xs/(--text-xs--line-height) [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5\"\n data-slot=\"combobox-chip\"\n {...props}\n >\n {children}\n <ComboboxChipRemove />\n </ComboboxPrimitive.Chip>\n );\n}\n\nfunction ComboboxChipRemove({\n ...props\n}: ComboboxPrimitive.ChipRemove.Props) {\n return (\n <ComboboxPrimitive.ChipRemove\n aria-label=\"Remove\"\n className=\"h-full shrink-0 cursor-pointer px-1.5 opacity-80 hover:opacity-100 [&_svg:not([class*='size-'])]:size-4 sm:[&_svg:not([class*='size-'])]:size-3.5\"\n data-slot=\"combobox-chip-remove\"\n {...props}\n >\n <XIcon />\n </ComboboxPrimitive.ChipRemove>\n );\n}\n\nconst useComboboxFilter = ComboboxPrimitive.useFilter;\n\nconst ComboboxContent = ComboboxPopup;\n\ntype ComboboxProps<ItemValue = unknown, Multiple extends boolean | undefined = false> =\n ComboboxPrimitive.Root.Props<ItemValue, Multiple>;\ntype ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props;\ntype ComboboxContentProps = React.ComponentProps<typeof ComboboxPopup>;\ntype ComboboxInputProps = React.ComponentProps<typeof ComboboxInput>;\ntype ComboboxListProps = React.ComponentProps<typeof ComboboxList>;\ntype ComboboxEmptyProps = React.ComponentProps<typeof ComboboxEmpty>;\ntype ComboboxGroupProps = React.ComponentProps<typeof ComboboxGroup>;\ntype ComboboxItemProps = React.ComponentProps<typeof ComboboxItem>;\ntype ComboboxSeparatorProps = React.ComponentProps<typeof ComboboxSeparator>;\n\nexport {\n Combobox,\n ComboboxInput,\n ComboboxTrigger,\n ComboboxContent,\n ComboboxPopup,\n ComboboxItem,\n ComboboxSeparator,\n ComboboxGroup,\n ComboboxGroupLabel,\n ComboboxEmpty,\n ComboboxValue,\n ComboboxList,\n ComboboxClear,\n ComboboxStatus,\n ComboboxRow,\n ComboboxCollection,\n ComboboxChips,\n ComboboxChip,\n useComboboxFilter,\n};\n\nexport type {\n ComboboxProps,\n ComboboxTriggerProps,\n ComboboxContentProps,\n ComboboxInputProps,\n ComboboxListProps,\n ComboboxEmptyProps,\n ComboboxGroupProps,\n ComboboxItemProps,\n ComboboxSeparatorProps,\n};\n"]}
@@ -1,43 +1,24 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { Dialog } from '@base-ui/react/dialog';
3
- import { AutocompleteRootProps } from '@base-ui/react/autocomplete';
2
+ import { Command as Command$1 } from 'cmdk';
4
3
  import * as React from 'react';
5
- import { AutocompleteCollection, AutocompleteEmpty, AutocompleteGroup, AutocompleteGroupLabel, AutocompleteInput, AutocompleteItem, AutocompleteList, AutocompleteSeparator } from './autocomplete.js';
6
4
 
7
- declare const CommandDialog: typeof Dialog.Root;
8
- type CommandDialogTriggerProps = Omit<React.ComponentProps<typeof Dialog.Trigger>, "render" | "nativeButton"> & {
9
- /** When true, merges props onto the child element instead of rendering a button */
10
- asChild?: boolean;
11
- /** Whether the child renders a native button. Defaults to true when asChild is used. */
12
- nativeButton?: boolean;
13
- };
14
- declare function CommandDialogTrigger({ asChild, nativeButton, children, ...props }: CommandDialogTriggerProps): react_jsx_runtime.JSX.Element;
15
- declare function CommandDialogPopup({ className, children, ...props }: Dialog.Popup.Props): react_jsx_runtime.JSX.Element;
16
- type CommandProps<ItemValue> = Omit<AutocompleteRootProps<ItemValue>, "autoHighlight" | "keepHighlight" | "open"> & {
17
- className?: string;
18
- autoHighlight?: boolean | "always";
19
- keepHighlight?: boolean;
20
- open?: boolean;
21
- };
22
- declare function Command<ItemValue>({ autoHighlight, keepHighlight, open, ...props }: CommandProps<ItemValue>): react_jsx_runtime.JSX.Element;
23
- type CommandInputProps = Omit<React.ComponentProps<typeof AutocompleteInput>, "onChange"> & {
24
- value?: string;
25
- onValueChange?: (value: string) => void;
26
- };
27
- declare function CommandInput({ className, placeholder, value, onValueChange, ...props }: CommandInputProps): react_jsx_runtime.JSX.Element;
28
- declare function CommandList({ className, ...props }: React.ComponentProps<typeof AutocompleteList>): react_jsx_runtime.JSX.Element;
29
- declare function CommandEmpty({ className, ...props }: React.ComponentProps<typeof AutocompleteEmpty>): react_jsx_runtime.JSX.Element;
5
+ declare function CommandDialog({ className, children, ...props }: React.ComponentProps<typeof Command$1.Dialog>): react_jsx_runtime.JSX.Element;
6
+ declare function CommandDialogPopup({ children, className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
7
+ declare function Command({ className, ...props }: React.ComponentProps<typeof Command$1>): react_jsx_runtime.JSX.Element;
8
+ declare function CommandInput({ className, placeholder, ...props }: React.ComponentProps<typeof Command$1.Input>): react_jsx_runtime.JSX.Element;
9
+ declare function CommandList({ className, ...props }: React.ComponentProps<typeof Command$1.List>): react_jsx_runtime.JSX.Element;
10
+ declare function CommandEmpty({ className, ...props }: React.ComponentProps<typeof Command$1.Empty>): react_jsx_runtime.JSX.Element;
30
11
  declare function CommandPanel({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
31
- type CommandGroupProps = React.ComponentProps<typeof AutocompleteGroup> & {
32
- /** Group heading label */
12
+ declare function CommandGroup({ className, heading, children, ...props }: React.ComponentProps<typeof Command$1.Group> & {
33
13
  heading?: React.ReactNode;
34
- };
35
- declare function CommandGroup({ className, heading, children, ...props }: CommandGroupProps): react_jsx_runtime.JSX.Element;
36
- declare function CommandGroupLabel({ className, ...props }: React.ComponentProps<typeof AutocompleteGroupLabel>): react_jsx_runtime.JSX.Element;
37
- declare function CommandCollection({ ...props }: React.ComponentProps<typeof AutocompleteCollection>): react_jsx_runtime.JSX.Element;
38
- declare function CommandItem({ className, ...props }: React.ComponentProps<typeof AutocompleteItem>): react_jsx_runtime.JSX.Element;
39
- declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof AutocompleteSeparator>): react_jsx_runtime.JSX.Element;
14
+ }): react_jsx_runtime.JSX.Element;
15
+ declare function CommandGroupLabel({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
16
+ declare function CommandCollection({ children }: {
17
+ children: React.ReactNode;
18
+ }): react_jsx_runtime.JSX.Element;
19
+ declare function CommandItem({ className, ...props }: React.ComponentProps<typeof Command$1.Item>): react_jsx_runtime.JSX.Element;
20
+ declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof Command$1.Separator>): react_jsx_runtime.JSX.Element;
40
21
  declare function CommandShortcut({ className, ...props }: React.ComponentProps<"kbd">): react_jsx_runtime.JSX.Element;
41
22
  declare function CommandFooter({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
42
23
 
43
- export { Command, CommandCollection, CommandDialog, CommandDialogPopup, CommandDialogTrigger, CommandEmpty, CommandFooter, CommandGroup, CommandGroupLabel, CommandInput, CommandItem, CommandList, CommandPanel, CommandSeparator, CommandShortcut };
24
+ export { Command, CommandCollection, CommandDialog, CommandDialogPopup, CommandEmpty, CommandFooter, CommandGroup, CommandGroupLabel, CommandInput, CommandItem, CommandList, CommandPanel, CommandSeparator, CommandShortcut };