@nadicodeai/ui 0.3.1 → 0.4.1

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 (124) hide show
  1. package/AGENTS.md +2 -1
  2. package/README.md +4 -2
  3. package/dist/components/accordion.d.ts +15 -5
  4. package/dist/components/accordion.d.ts.map +1 -1
  5. package/dist/components/accordion.js +34 -9
  6. package/dist/components/ai-elements/chain-of-thought.js +1 -1
  7. package/dist/components/ai-elements/mic-selector.js +1 -1
  8. package/dist/components/ai-elements/plan.d.ts +3 -2
  9. package/dist/components/ai-elements/plan.d.ts.map +1 -1
  10. package/dist/components/ai-elements/reasoning.js +1 -1
  11. package/dist/components/ai-elements/stack-trace.js +1 -1
  12. package/dist/components/ai-elements/transcription.js +1 -1
  13. package/dist/components/ai-elements/voice-selector.d.ts +2 -1
  14. package/dist/components/ai-elements/voice-selector.d.ts.map +1 -1
  15. package/dist/components/ai-elements/voice-selector.js +1 -1
  16. package/dist/components/alert-dialog.d.ts +10 -9
  17. package/dist/components/alert-dialog.d.ts.map +1 -1
  18. package/dist/components/alert-dialog.js +16 -13
  19. package/dist/components/aspect-ratio.d.ts +3 -2
  20. package/dist/components/aspect-ratio.d.ts.map +1 -1
  21. package/dist/components/aspect-ratio.js +6 -3
  22. package/dist/components/avatar.d.ts +5 -5
  23. package/dist/components/avatar.d.ts.map +1 -1
  24. package/dist/components/avatar.js +5 -5
  25. package/dist/components/badge.js +1 -1
  26. package/dist/components/breadcrumb.js +1 -1
  27. package/dist/components/button-group.js +1 -1
  28. package/dist/components/button.d.ts +4 -2
  29. package/dist/components/button.d.ts.map +1 -1
  30. package/dist/components/button.js +21 -17
  31. package/dist/components/checkbox.d.ts +2 -3
  32. package/dist/components/checkbox.d.ts.map +1 -1
  33. package/dist/components/checkbox.js +3 -3
  34. package/dist/components/collapsible.d.ts +8 -4
  35. package/dist/components/collapsible.d.ts.map +1 -1
  36. package/dist/components/collapsible.js +16 -6
  37. package/dist/components/command.d.ts +4 -3
  38. package/dist/components/command.d.ts.map +1 -1
  39. package/dist/components/command.js +13 -12
  40. package/dist/components/context-menu.d.ts +24 -15
  41. package/dist/components/context-menu.d.ts.map +1 -1
  42. package/dist/components/context-menu.js +38 -28
  43. package/dist/components/dialog.d.ts +10 -9
  44. package/dist/components/dialog.d.ts.map +1 -1
  45. package/dist/components/dialog.js +11 -10
  46. package/dist/components/direction.d.ts +6 -5
  47. package/dist/components/direction.d.ts.map +1 -1
  48. package/dist/components/direction.js +3 -4
  49. package/dist/components/drawer.d.ts +22 -10
  50. package/dist/components/drawer.d.ts.map +1 -1
  51. package/dist/components/drawer.js +70 -12
  52. package/dist/components/dropdown-menu.d.ts +25 -16
  53. package/dist/components/dropdown-menu.d.ts.map +1 -1
  54. package/dist/components/dropdown-menu.js +40 -30
  55. package/dist/components/form.d.ts +3 -3
  56. package/dist/components/form.d.ts.map +1 -1
  57. package/dist/components/form.js +1 -1
  58. package/dist/components/hover-card.d.ts +8 -4
  59. package/dist/components/hover-card.d.ts.map +1 -1
  60. package/dist/components/hover-card.js +12 -7
  61. package/dist/components/item.js +1 -1
  62. package/dist/components/label.d.ts +1 -2
  63. package/dist/components/label.d.ts.map +1 -1
  64. package/dist/components/label.js +1 -2
  65. package/dist/components/menubar.d.ts +21 -18
  66. package/dist/components/menubar.d.ts.map +1 -1
  67. package/dist/components/menubar.js +25 -23
  68. package/dist/components/navigation-menu.d.ts +16 -12
  69. package/dist/components/navigation-menu.d.ts.map +1 -1
  70. package/dist/components/navigation-menu.js +16 -13
  71. package/dist/components/popover.d.ts +11 -8
  72. package/dist/components/popover.d.ts.map +1 -1
  73. package/dist/components/popover.js +33 -12
  74. package/dist/components/progress.d.ts +7 -4
  75. package/dist/components/progress.d.ts.map +1 -1
  76. package/dist/components/progress.js +17 -5
  77. package/dist/components/radio-group.d.ts +4 -4
  78. package/dist/components/radio-group.d.ts.map +1 -1
  79. package/dist/components/radio-group.js +4 -4
  80. package/dist/components/scroll-area.d.ts +3 -3
  81. package/dist/components/scroll-area.d.ts.map +1 -1
  82. package/dist/components/scroll-area.js +2 -4
  83. package/dist/components/select.d.ts +11 -11
  84. package/dist/components/select.d.ts.map +1 -1
  85. package/dist/components/select.js +14 -18
  86. package/dist/components/separator.d.ts +2 -3
  87. package/dist/components/separator.d.ts.map +1 -1
  88. package/dist/components/separator.js +3 -3
  89. package/dist/components/sheet.d.ts +8 -7
  90. package/dist/components/sheet.d.ts.map +1 -1
  91. package/dist/components/sheet.js +10 -12
  92. package/dist/components/sidebar.js +1 -1
  93. package/dist/components/slider.d.ts +2 -3
  94. package/dist/components/slider.d.ts.map +1 -1
  95. package/dist/components/slider.js +10 -7
  96. package/dist/components/switch.d.ts +3 -4
  97. package/dist/components/switch.d.ts.map +1 -1
  98. package/dist/components/switch.js +2 -2
  99. package/dist/components/tabs.d.ts +5 -6
  100. package/dist/components/tabs.d.ts.map +1 -1
  101. package/dist/components/tabs.js +5 -5
  102. package/dist/components/theme-mode-switcher.js +1 -1
  103. package/dist/components/toggle-group.d.ts +12 -4
  104. package/dist/components/toggle-group.d.ts.map +1 -1
  105. package/dist/components/toggle-group.js +29 -7
  106. package/dist/components/toggle.d.ts +3 -3
  107. package/dist/components/toggle.d.ts.map +1 -1
  108. package/dist/components/toggle.js +9 -8
  109. package/dist/components/tooltip.d.ts +8 -6
  110. package/dist/components/tooltip.d.ts.map +1 -1
  111. package/dist/components/tooltip.js +7 -6
  112. package/dist/hooks/use-controllable-state.d.ts +9 -0
  113. package/dist/hooks/use-controllable-state.d.ts.map +1 -0
  114. package/dist/hooks/use-controllable-state.js +25 -0
  115. package/dist/lib/base-render.d.ts +14 -0
  116. package/dist/lib/base-render.d.ts.map +1 -0
  117. package/dist/lib/base-render.js +16 -0
  118. package/dist/lib/slot.d.ts +8 -0
  119. package/dist/lib/slot.d.ts.map +1 -0
  120. package/dist/lib/slot.js +17 -0
  121. package/docs/agents/nadicodeai-ui.md +1 -1
  122. package/docs/migration/base-ui-migration.md +49 -0
  123. package/llms.txt +2 -2
  124. package/package.json +3 -6
@@ -1,5 +1,4 @@
1
- import * as React from "react";
2
- import { Checkbox as CheckboxPrimitive } from "radix-ui";
3
- declare function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>): React.JSX.Element;
1
+ import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
2
+ declare function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props): import("react").JSX.Element;
4
3
  export { Checkbox };
5
4
  //# sourceMappingURL=checkbox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAIxD,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,qBAkBrD;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAKvE,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,+BAmBtE;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { CheckIcon } from "lucide-react";
4
- import { Checkbox as CheckboxPrimitive } from "radix-ui";
3
+ import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
5
4
  import { cn } from "../lib/utils.js";
5
+ import { CheckIcon } from "lucide-react";
6
6
  function Checkbox({ className, ...props }) {
7
- return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground", className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "grid place-content-center text-current transition-none", children: _jsx(CheckIcon, { className: "size-3.5" }) }) }));
7
+ return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: cn("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground", className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "grid place-content-center text-current transition-none [&>svg]:size-3.5", children: _jsx(CheckIcon, {}) }) }));
8
8
  }
9
9
  export { Checkbox };
@@ -1,6 +1,10 @@
1
- import { Collapsible as CollapsiblePrimitive } from "radix-ui";
2
- declare function Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>): import("react").JSX.Element;
3
- declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): import("react").JSX.Element;
4
- declare function CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): import("react").JSX.Element;
1
+ import * as React from "react";
2
+ import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
3
+ import { type WithAsChild } from "../lib/base-render";
4
+ declare function Collapsible({ ...props }: WithAsChild<CollapsiblePrimitive.Root.Props>): React.JSX.Element;
5
+ declare function CollapsibleTrigger({ asChild, children, nativeButton, ...props }: WithAsChild<CollapsiblePrimitive.Trigger.Props>): React.JSX.Element;
6
+ declare function CollapsibleContent({ forceMount, ...props }: WithAsChild<CollapsiblePrimitive.Panel.Props> & {
7
+ forceMount?: boolean;
8
+ }): React.JSX.Element;
5
9
  export { Collapsible, CollapsibleTrigger, CollapsibleContent };
6
10
  //# sourceMappingURL=collapsible.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../src/components/collapsible.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE9D,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,+BAExD;AAED,iBAAS,kBAAkB,CAAC,EAC1B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,kBAAkB,CAAC,+BAOtE;AAED,iBAAS,kBAAkB,CAAC,EAC1B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,kBAAkB,CAAC,+BAOtE;AAED,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAA"}
1
+ {"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../src/components/collapsible.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAEhF,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEvE,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,WAAW,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,qBAO9C;AAED,iBAAS,kBAAkB,CAAC,EAC1B,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,WAAW,CAAC,oBAAoB,CAAC,OAAO,CAAC,KAAK,CAAC,qBAkBjD;AAED,iBAAS,kBAAkB,CAAC,EAC1B,UAAU,EACV,GAAG,KAAK,EACT,EAAE,WAAW,CAAC,oBAAoB,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG;IACjD,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,qBAQA;AAED,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAA"}
@@ -1,13 +1,23 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Collapsible as CollapsiblePrimitive } from "radix-ui";
3
+ import * as React from "react";
4
+ import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
5
+ import { withAsChildRender } from "../lib/base-render.js";
4
6
  function Collapsible({ ...props }) {
5
- return _jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
7
+ return (_jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...withAsChildRender(props) }));
6
8
  }
7
- function CollapsibleTrigger({ ...props }) {
8
- return (_jsx(CollapsiblePrimitive.CollapsibleTrigger, { "data-slot": "collapsible-trigger", ...props }));
9
+ function CollapsibleTrigger({ asChild, children, nativeButton, ...props }) {
10
+ const rendersLiteralNonButton = asChild &&
11
+ React.isValidElement(children) &&
12
+ typeof children.type === "string" &&
13
+ children.type !== "button";
14
+ return (_jsx(CollapsiblePrimitive.Trigger, { "data-slot": "collapsible-trigger", nativeButton: nativeButton ?? (rendersLiteralNonButton ? false : undefined), ...withAsChildRender({
15
+ asChild,
16
+ children,
17
+ ...props,
18
+ }) }));
9
19
  }
10
- function CollapsibleContent({ ...props }) {
11
- return (_jsx(CollapsiblePrimitive.CollapsibleContent, { "data-slot": "collapsible-content", ...props }));
20
+ function CollapsibleContent({ forceMount, ...props }) {
21
+ return (_jsx(CollapsiblePrimitive.Panel, { "data-slot": "collapsible-content", keepMounted: forceMount ?? props.keepMounted, ...withAsChildRender(props) }));
12
22
  }
13
23
  export { Collapsible, CollapsibleTrigger, CollapsibleContent };
@@ -2,18 +2,19 @@ import * as React from "react";
2
2
  import { Command as CommandPrimitive } from "cmdk";
3
3
  import { Dialog } from "./dialog";
4
4
  declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): React.JSX.Element;
5
- declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
5
+ declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: Omit<React.ComponentProps<typeof Dialog>, "children"> & {
6
6
  title?: string;
7
7
  description?: string;
8
8
  className?: string;
9
9
  showCloseButton?: boolean;
10
+ children: React.ReactNode;
10
11
  }): React.JSX.Element;
11
12
  declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
12
13
  declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): React.JSX.Element;
13
- declare function CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element;
14
+ declare function CommandEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element;
14
15
  declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): React.JSX.Element;
15
16
  declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): React.JSX.Element;
16
- declare function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): React.JSX.Element;
17
+ declare function CommandItem({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): React.JSX.Element;
17
18
  declare function CommandShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
18
19
  export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
19
20
  //# sourceMappingURL=command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/components/command.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAA;AAIlD,OAAO,EACL,MAAM,EAKP,MAAM,qBAAqB,CAAA;AAE5B,iBAAS,OAAO,CAAC,EACf,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,qBAW/C;AAED,iBAAS,aAAa,CAAC,EACrB,KAAyB,EACzB,WAA8C,EAC9C,QAAQ,EACR,SAAS,EACT,eAAsB,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IACvC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,qBAiBA;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,qBAiBrD;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,qBAWpD;AAED,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,qBAQrD;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,K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AAO,CAAA;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,qBAkBA;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,qBAkBrD;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,qBAWpD;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,qBAQrD;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,qBAWrD;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,SAAS,CAAC,qBAQzD;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,qBAcpD;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAW9B;AAED,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,gBAAgB,GACjB,CAAA"}
@@ -1,34 +1,35 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Command as CommandPrimitive } from "cmdk";
4
- import { SearchIcon } from "lucide-react";
4
+ import { CheckIcon, SearchIcon } from "lucide-react";
5
5
  import { cn } from "../lib/utils.js";
6
6
  import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "./dialog.js";
7
+ import { InputGroup, InputGroupAddon, } from "./input-group.js";
7
8
  function Command({ className, ...props }) {
8
- return (_jsx(CommandPrimitive, { "data-slot": "command", className: cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", className), ...props }));
9
+ return (_jsx(CommandPrimitive, { "data-slot": "command", className: cn("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground", className), ...props }));
9
10
  }
10
- function CommandDialog({ title = "Command Palette", description = "Search for a command to run...", children, className, showCloseButton = true, ...props }) {
11
- return (_jsxs(Dialog, { ...props, children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(DialogContent, { className: cn("overflow-hidden p-0", className), showCloseButton: showCloseButton, children: _jsx(Command, { className: "**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: children }) })] }));
11
+ function CommandDialog({ title = "Command Palette", description = "Search for a command to run...", children, className, showCloseButton = false, ...props }) {
12
+ return (_jsxs(Dialog, { ...props, children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(DialogContent, { className: cn("top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0", className), showCloseButton: showCloseButton, children: children })] }));
12
13
  }
13
14
  function CommandInput({ className, ...props }) {
14
- return (_jsxs("div", { "data-slot": "command-input-wrapper", className: "flex h-9 items-center gap-2 border-b px-3", children: [_jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }), _jsx(CommandPrimitive.Input, { "data-slot": "command-input", className: cn("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className), ...props })] }));
15
+ return (_jsx("div", { "data-slot": "command-input-wrapper", className: "p-1 pb-0", children: _jsxs(InputGroup, { className: "h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!", children: [_jsx(CommandPrimitive.Input, { "data-slot": "command-input", className: cn("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className), ...props }), _jsx(InputGroupAddon, { children: _jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }) })] }) }));
15
16
  }
16
17
  function CommandList({ className, ...props }) {
17
- return (_jsx(CommandPrimitive.List, { "data-slot": "command-list", className: cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", className), ...props }));
18
+ return (_jsx(CommandPrimitive.List, { "data-slot": "command-list", className: cn("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none", className), ...props }));
18
19
  }
19
- function CommandEmpty({ ...props }) {
20
- return (_jsx(CommandPrimitive.Empty, { "data-slot": "command-empty", className: "py-6 text-center text-sm", ...props }));
20
+ function CommandEmpty({ className, ...props }) {
21
+ return (_jsx(CommandPrimitive.Empty, { "data-slot": "command-empty", className: cn("py-6 text-center text-sm", className), ...props }));
21
22
  }
22
23
  function CommandGroup({ className, ...props }) {
23
- return (_jsx(CommandPrimitive.Group, { "data-slot": "command-group", className: cn("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", className), ...props }));
24
+ return (_jsx(CommandPrimitive.Group, { "data-slot": "command-group", className: cn("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground", className), ...props }));
24
25
  }
25
26
  function CommandSeparator({ className, ...props }) {
26
27
  return (_jsx(CommandPrimitive.Separator, { "data-slot": "command-separator", className: cn("-mx-1 h-px bg-border", className), ...props }));
27
28
  }
28
- function CommandItem({ className, ...props }) {
29
- return (_jsx(CommandPrimitive.Item, { "data-slot": "command-item", className: cn("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", className), ...props }));
29
+ function CommandItem({ className, children, ...props }) {
30
+ return (_jsxs(CommandPrimitive.Item, { "data-slot": "command-item", className: cn("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground", className), ...props, children: [children, _jsx(CheckIcon, { className: "ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })] }));
30
31
  }
31
32
  function CommandShortcut({ className, ...props }) {
32
- return (_jsx("span", { "data-slot": "command-shortcut", className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className), ...props }));
33
+ return (_jsx("span", { "data-slot": "command-shortcut", className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground", className), ...props }));
33
34
  }
34
35
  export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
@@ -1,26 +1,35 @@
1
1
  import * as React from "react";
2
- import { ContextMenu as ContextMenuPrimitive } from "radix-ui";
3
- declare function ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>): React.JSX.Element;
4
- declare function ContextMenuTrigger({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>): React.JSX.Element;
5
- declare function ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>): React.JSX.Element;
6
- declare function ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>): React.JSX.Element;
7
- declare function ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>): React.JSX.Element;
8
- declare function ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>): React.JSX.Element;
9
- declare function ContextMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
2
+ import { ContextMenu as ContextMenuPrimitive } from "@base-ui/react/context-menu";
3
+ import { type WithAsChild } from "../lib/base-render";
4
+ declare function ContextMenu({ ...props }: ContextMenuPrimitive.Root.Props): React.JSX.Element;
5
+ declare function ContextMenuPortal({ ...props }: ContextMenuPrimitive.Portal.Props): React.JSX.Element;
6
+ declare function ContextMenuTrigger({ className, ...props }: WithAsChild<ContextMenuPrimitive.Trigger.Props>): React.JSX.Element;
7
+ declare function ContextMenuContent({ className, align, alignOffset, side, sideOffset, ...props }: ContextMenuPrimitive.Popup.Props & Pick<ContextMenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): React.JSX.Element;
8
+ declare function ContextMenuGroup({ ...props }: ContextMenuPrimitive.Group.Props): React.JSX.Element;
9
+ declare function ContextMenuLabel({ className, inset, ...props }: ContextMenuPrimitive.GroupLabel.Props & {
10
10
  inset?: boolean;
11
11
  }): React.JSX.Element;
12
- declare function ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>): React.JSX.Element;
13
- declare function ContextMenuContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Content>): React.JSX.Element;
14
- declare function ContextMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
12
+ type ContextMenuSelectEventHandler = (event: Event) => void;
13
+ type ContextMenuItemProps = WithAsChild<Omit<ContextMenuPrimitive.Item.Props, "onClick" | "onSelect">> & {
15
14
  inset?: boolean;
15
+ onClick?: ContextMenuPrimitive.Item.Props["onClick"];
16
+ onSelect?: ContextMenuSelectEventHandler;
16
17
  variant?: "default" | "destructive";
18
+ };
19
+ declare function ContextMenuItem({ className, inset, onClick, onSelect, variant, ...props }: ContextMenuItemProps): React.JSX.Element;
20
+ declare function ContextMenuSub({ ...props }: ContextMenuPrimitive.SubmenuRoot.Props): React.JSX.Element;
21
+ declare function ContextMenuSubTrigger({ className, inset, children, asChild, ...props }: WithAsChild<ContextMenuPrimitive.SubmenuTrigger.Props> & {
22
+ inset?: boolean;
23
+ }): React.JSX.Element;
24
+ declare function ContextMenuSubContent({ ...props }: React.ComponentProps<typeof ContextMenuContent>): React.JSX.Element;
25
+ declare function ContextMenuCheckboxItem({ className, children, checked, inset, ...props }: ContextMenuPrimitive.CheckboxItem.Props & {
26
+ inset?: boolean;
17
27
  }): React.JSX.Element;
18
- declare function ContextMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>): React.JSX.Element;
19
- declare function ContextMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>): React.JSX.Element;
20
- declare function ContextMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
28
+ declare function ContextMenuRadioGroup({ ...props }: ContextMenuPrimitive.RadioGroup.Props): React.JSX.Element;
29
+ declare function ContextMenuRadioItem({ className, children, inset, ...props }: ContextMenuPrimitive.RadioItem.Props & {
21
30
  inset?: boolean;
22
31
  }): React.JSX.Element;
23
- declare function ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>): React.JSX.Element;
32
+ declare function ContextMenuSeparator({ className, ...props }: ContextMenuPrimitive.Separator.Props): React.JSX.Element;
24
33
  declare function ContextMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
25
34
  export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
26
35
  //# sourceMappingURL=context-menu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../src/components/context-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAI9D,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,qBAExD;AAED,iBAAS,kBAAkB,CAAC,EAC1B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,qBAI3D;AAED,iBAAS,gBAAgB,CAAC,EACxB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,KAAK,CAAC,qBAIzD;AAED,iBAAS,iBAAiB,CAAC,EACzB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,c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ACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,SAAS,CAAC,qBAkB7D;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,KAAK,CAAC,GAAG;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,qBAYA;AAED,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,SAAS,CAAC,qBAQ7D;AAED,iBAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAW9B;AAED,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACtB,CAAA"}
1
+ {"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../src/components/context-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAEjF,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAIvE,iBAAS,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,qBAEjE;AAED,iBAAS,iBAAiB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,CAAC,MAAM,CAAC,KAAK,qBAIzE;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,K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-1,51 +1,61 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
4
- import { ContextMenu as ContextMenuPrimitive } from "radix-ui";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { ContextMenu as ContextMenuPrimitive } from "@base-ui/react/context-menu";
4
+ import { withAsChildRender } from "../lib/base-render.js";
5
5
  import { cn } from "../lib/utils.js";
6
+ import { ChevronRightIcon, CheckIcon } from "lucide-react";
6
7
  function ContextMenu({ ...props }) {
7
8
  return _jsx(ContextMenuPrimitive.Root, { "data-slot": "context-menu", ...props });
8
9
  }
9
- function ContextMenuTrigger({ ...props }) {
10
- return (_jsx(ContextMenuPrimitive.Trigger, { "data-slot": "context-menu-trigger", ...props }));
11
- }
12
- function ContextMenuGroup({ ...props }) {
13
- return (_jsx(ContextMenuPrimitive.Group, { "data-slot": "context-menu-group", ...props }));
14
- }
15
10
  function ContextMenuPortal({ ...props }) {
16
11
  return (_jsx(ContextMenuPrimitive.Portal, { "data-slot": "context-menu-portal", ...props }));
17
12
  }
18
- function ContextMenuSub({ ...props }) {
19
- return _jsx(ContextMenuPrimitive.Sub, { "data-slot": "context-menu-sub", ...props });
13
+ function ContextMenuTrigger({ className, ...props }) {
14
+ return (_jsx(ContextMenuPrimitive.Trigger, { "data-slot": "context-menu-trigger", className: cn("select-none", className), ...withAsChildRender(props) }));
20
15
  }
21
- function ContextMenuRadioGroup({ ...props }) {
22
- return (_jsx(ContextMenuPrimitive.RadioGroup, { "data-slot": "context-menu-radio-group", ...props }));
16
+ function ContextMenuContent({ className, align = "start", alignOffset = 4, side = "right", sideOffset = 0, ...props }) {
17
+ return (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.Positioner, { className: "isolate z-50 outline-none", align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, children: _jsx(ContextMenuPrimitive.Popup, { "data-slot": "context-menu-content", className: cn("z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props }) }) }));
23
18
  }
24
- function ContextMenuSubTrigger({ className, inset, children, ...props }) {
25
- return (_jsxs(ContextMenuPrimitive.SubTrigger, { "data-slot": "context-menu-sub-trigger", "data-inset": inset, className: cn("flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto" })] }));
19
+ function ContextMenuGroup({ ...props }) {
20
+ return (_jsx(ContextMenuPrimitive.Group, { "data-slot": "context-menu-group", ...props }));
26
21
  }
27
- function ContextMenuSubContent({ className, ...props }) {
28
- return (_jsx(ContextMenuPrimitive.SubContent, { "data-slot": "context-menu-sub-content", className: cn("z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", className), ...props }));
22
+ function ContextMenuLabel({ className, inset, ...props }) {
23
+ return (_jsx(ContextMenuPrimitive.GroupLabel, { "data-slot": "context-menu-label", "data-inset": inset, className: cn("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7", className), ...props }));
24
+ }
25
+ function ContextMenuItem({ className, inset, onClick, onSelect, variant = "default", ...props }) {
26
+ const handleClick = (event) => {
27
+ onSelect?.(event.nativeEvent);
28
+ if (event.nativeEvent.defaultPrevented) {
29
+ event.preventBaseUIHandler?.();
30
+ event.preventDefault();
31
+ return;
32
+ }
33
+ onClick?.(event);
34
+ };
35
+ return (_jsx(ContextMenuPrimitive.Item, { "data-slot": "context-menu-item", "data-inset": inset, "data-variant": variant, className: cn("group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive", className), onClick: handleClick, ...withAsChildRender(props) }));
29
36
  }
30
- function ContextMenuContent({ className, ...props }) {
31
- return (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.Content, { "data-slot": "context-menu-content", className: cn("z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", className), ...props }) }));
37
+ function ContextMenuSub({ ...props }) {
38
+ return (_jsx(ContextMenuPrimitive.SubmenuRoot, { "data-slot": "context-menu-sub", ...props }));
32
39
  }
33
- function ContextMenuItem({ className, inset, variant = "default", ...props }) {
34
- return (_jsx(ContextMenuPrimitive.Item, { "data-slot": "context-menu-item", "data-inset": inset, "data-variant": variant, className: cn("relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!", className), ...props }));
40
+ function ContextMenuSubTrigger({ className, inset, children, asChild, ...props }) {
41
+ return (_jsx(ContextMenuPrimitive.SubmenuTrigger, { "data-slot": "context-menu-sub-trigger", "data-inset": inset, className: cn("flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...withAsChildRender({ asChild, children, ...props }), children: !asChild && (_jsxs(_Fragment, { children: [children, _jsx(ChevronRightIcon, { className: "ml-auto" })] })) }));
35
42
  }
36
- function ContextMenuCheckboxItem({ className, children, checked, ...props }) {
37
- return (_jsxs(ContextMenuPrimitive.CheckboxItem, { "data-slot": "context-menu-checkbox-item", className: cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(ContextMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), children] }));
43
+ function ContextMenuSubContent({ ...props }) {
44
+ return (_jsx(ContextMenuContent, { "data-slot": "context-menu-sub-content", className: "shadow-lg", side: "right", ...props }));
38
45
  }
39
- function ContextMenuRadioItem({ className, children, ...props }) {
40
- return (_jsxs(ContextMenuPrimitive.RadioItem, { "data-slot": "context-menu-radio-item", className: cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: _jsx(ContextMenuPrimitive.ItemIndicator, { children: _jsx(CircleIcon, { className: "size-2 fill-current" }) }) }), children] }));
46
+ function ContextMenuCheckboxItem({ className, children, checked, inset, ...props }) {
47
+ return (_jsxs(ContextMenuPrimitive.CheckboxItem, { "data-slot": "context-menu-checkbox-item", "data-inset": inset, className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked, ...props, children: [_jsx("span", { className: "pointer-events-none absolute right-2", children: _jsx(ContextMenuPrimitive.CheckboxItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] }));
41
48
  }
42
- function ContextMenuLabel({ className, inset, ...props }) {
43
- return (_jsx(ContextMenuPrimitive.Label, { "data-slot": "context-menu-label", "data-inset": inset, className: cn("px-2 py-1.5 text-sm font-medium text-foreground data-[inset]:pl-8", className), ...props }));
49
+ function ContextMenuRadioGroup({ ...props }) {
50
+ return (_jsx(ContextMenuPrimitive.RadioGroup, { "data-slot": "context-menu-radio-group", ...props }));
51
+ }
52
+ function ContextMenuRadioItem({ className, children, inset, ...props }) {
53
+ return (_jsxs(ContextMenuPrimitive.RadioItem, { "data-slot": "context-menu-radio-item", "data-inset": inset, className: cn("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [_jsx("span", { className: "pointer-events-none absolute right-2", children: _jsx(ContextMenuPrimitive.RadioItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] }));
44
54
  }
45
55
  function ContextMenuSeparator({ className, ...props }) {
46
56
  return (_jsx(ContextMenuPrimitive.Separator, { "data-slot": "context-menu-separator", className: cn("-mx-1 my-1 h-px bg-border", className), ...props }));
47
57
  }
48
58
  function ContextMenuShortcut({ className, ...props }) {
49
- return (_jsx("span", { "data-slot": "context-menu-shortcut", className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className), ...props }));
59
+ return (_jsx("span", { "data-slot": "context-menu-shortcut", className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground", className), ...props }));
50
60
  }
51
61
  export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup, };
@@ -1,18 +1,19 @@
1
1
  import * as React from "react";
2
- import { Dialog as DialogPrimitive } from "radix-ui";
3
- declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
4
- declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
5
- declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
6
- declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
7
- declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
8
- declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
2
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
3
+ import { type WithAsChild } from "../lib/base-render";
4
+ declare function Dialog({ ...props }: DialogPrimitive.Root.Props): React.JSX.Element;
5
+ declare function DialogTrigger({ ...props }: WithAsChild<DialogPrimitive.Trigger.Props>): React.JSX.Element;
6
+ declare function DialogPortal({ ...props }: DialogPrimitive.Portal.Props): React.JSX.Element;
7
+ declare function DialogClose({ ...props }: WithAsChild<DialogPrimitive.Close.Props>): React.JSX.Element;
8
+ declare function DialogOverlay({ className, ...props }: DialogPrimitive.Backdrop.Props): React.JSX.Element;
9
+ declare function DialogContent({ className, children, showCloseButton, ...props }: DialogPrimitive.Popup.Props & {
9
10
  showCloseButton?: boolean;
10
11
  }): React.JSX.Element;
11
12
  declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
12
13
  declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<"div"> & {
13
14
  showCloseButton?: boolean;
14
15
  }): React.JSX.Element;
15
- declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
16
- declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
16
+ declare function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props): React.JSX.Element;
17
+ declare function DialogDescription({ className, ...props }: DialogPrimitive.Description.Props): React.JSX.Element;
17
18
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
18
19
  //# sourceMappingURL=dialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAKpD,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAEnD;AAED,iBAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAEtD;AAED,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,qBAErD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAEpD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAWtD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,eAAsB,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG;IACxD,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,qBAyBA;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQzE;AAED,iBAAS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Aa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,QAAQ,CAAC,KAAK,qBAWhC;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,eAAsB,EACtB,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,GAAG;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,qBAgCA;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQzE;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,eAAuB,EACvB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,qBAkBA;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,qBAWxE;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,WAAW,CAAC,KAAK,qBAWnC;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAA"}
@@ -1,37 +1,38 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { XIcon } from "lucide-react";
4
- import { Dialog as DialogPrimitive } from "radix-ui";
3
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
4
+ import { withAsChildRender } from "../lib/base-render.js";
5
5
  import { cn } from "../lib/utils.js";
6
6
  import { Button } from "./button.js";
7
+ import { XIcon } from "lucide-react";
7
8
  function Dialog({ ...props }) {
8
9
  return _jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
9
10
  }
10
11
  function DialogTrigger({ ...props }) {
11
- return _jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
12
+ return (_jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...withAsChildRender(props) }));
12
13
  }
13
14
  function DialogPortal({ ...props }) {
14
15
  return _jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
15
16
  }
16
17
  function DialogClose({ ...props }) {
17
- return _jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
18
+ return (_jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...withAsChildRender(props) }));
18
19
  }
19
20
  function DialogOverlay({ className, ...props }) {
20
- return (_jsx(DialogPrimitive.Overlay, { "data-slot": "dialog-overlay", className: cn("fixed inset-0 z-50 bg-foreground/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", className), ...props }));
21
+ return (_jsx(DialogPrimitive.Backdrop, { "data-slot": "dialog-overlay", className: cn("fixed inset-0 isolate z-50 bg-foreground/50 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className), ...props }));
21
22
  }
22
23
  function DialogContent({ className, children, showCloseButton = true, ...props }) {
23
- return (_jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { "data-slot": "dialog-content", className: cn("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-md border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg", className), ...props, children: [children, showCloseButton && (_jsxs(DialogPrimitive.Close, { "data-slot": "dialog-close", className: "absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", children: [_jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: "Close" })] }))] })] }));
24
+ return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Popup, { "data-slot": "dialog-content", className: cn("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className), ...props, children: [children, showCloseButton && (_jsxs(DialogPrimitive.Close, { "data-slot": "dialog-close", render: _jsx(Button, { variant: "ghost", className: "absolute top-2 right-2", size: "icon-sm" }), children: [_jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: "Close" })] }))] })] }));
24
25
  }
25
26
  function DialogHeader({ className, ...props }) {
26
- return (_jsx("div", { "data-slot": "dialog-header", className: cn("flex flex-col gap-2 text-center sm:text-left", className), ...props }));
27
+ return (_jsx("div", { "data-slot": "dialog-header", className: cn("flex flex-col gap-2", className), ...props }));
27
28
  }
28
29
  function DialogFooter({ className, showCloseButton = false, children, ...props }) {
29
- return (_jsxs("div", { "data-slot": "dialog-footer", className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props, children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { asChild: true, children: _jsx(Button, { variant: "outline", children: "Close" }) }))] }));
30
+ return (_jsxs("div", { "data-slot": "dialog-footer", className: cn("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end", className), ...props, children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { render: _jsx(Button, { variant: "outline" }), children: "Close" }))] }));
30
31
  }
31
32
  function DialogTitle({ className, ...props }) {
32
- return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn("text-lg leading-none font-semibold", className), ...props }));
33
+ return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn("text-base leading-none font-medium", className), ...props }));
33
34
  }
34
35
  function DialogDescription({ className, ...props }) {
35
- return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn("text-sm text-muted-foreground", className), ...props }));
36
+ return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className), ...props }));
36
37
  }
37
38
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
@@ -1,8 +1,9 @@
1
1
  import * as React from "react";
2
- import { Direction } from "radix-ui";
3
- declare function DirectionProvider({ dir, direction, children, }: React.ComponentProps<typeof Direction.DirectionProvider> & {
4
- direction?: React.ComponentProps<typeof Direction.DirectionProvider>["dir"];
5
- }): React.JSX.Element;
6
- declare const useDirection: typeof Direction.useDirection;
2
+ import { type DirectionProviderProps as DirectionProviderPrimitiveProps, useDirection } from "@base-ui/react/direction-provider";
3
+ type DirectionProviderProps = Omit<DirectionProviderPrimitiveProps, "direction"> & {
4
+ direction?: DirectionProviderPrimitiveProps["direction"];
5
+ dir?: DirectionProviderPrimitiveProps["direction"];
6
+ };
7
+ declare function DirectionProvider({ dir, direction, ...props }: DirectionProviderProps): React.JSX.Element;
7
8
  export { DirectionProvider, useDirection };
8
9
  //# sourceMappingURL=direction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"direction.d.ts","sourceRoot":"","sources":["../../src/components/direction.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpC,iBAAS,iBAAiB,CAAC,EACzB,GAAG,EACH,SAAS,EACT,QAAQ,GACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,iBAAiB,CAAC,GAAG;IAC5D,SAAS,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,CAAA;CAC5E,qBAMA;AAED,QAAA,MAAM,YAAY,+BAAyB,CAAA;AAE3C,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAA"}
1
+ {"version":3,"file":"direction.d.ts","sourceRoot":"","sources":["../../src/components/direction.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,KAAK,sBAAsB,IAAI,+BAA+B,EAC9D,YAAY,EACb,MAAM,mCAAmC,CAAC;AAE3C,KAAK,sBAAsB,GAAG,IAAI,CAAC,+BAA+B,EAAE,WAAW,CAAC,GAAG;IACjF,SAAS,CAAC,EAAE,+BAA+B,CAAC,WAAW,CAAC,CAAC;IACzD,GAAG,CAAC,EAAE,+BAA+B,CAAC,WAAW,CAAC,CAAC;CACpD,CAAC;AAEF,iBAAS,iBAAiB,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,sBAAsB,qBAQ9E;AAED,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC"}
@@ -1,8 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Direction } from "radix-ui";
4
- function DirectionProvider({ dir, direction, children, }) {
5
- return (_jsx(Direction.DirectionProvider, { dir: direction ?? dir, children: children }));
3
+ import { DirectionProvider as DirectionProviderPrimitive, useDirection, } from "@base-ui/react/direction-provider";
4
+ function DirectionProvider({ dir, direction, ...props }) {
5
+ return (_jsx(DirectionProviderPrimitive, { "data-slot": "direction-provider", direction: direction ?? dir, ...props }));
6
6
  }
7
- const useDirection = Direction.useDirection;
8
7
  export { DirectionProvider, useDirection };
@@ -1,14 +1,26 @@
1
1
  import * as React from "react";
2
- import { Drawer as DrawerPrimitive } from "vaul";
3
- declare function Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): React.JSX.Element;
4
- declare function DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>): React.JSX.Element;
5
- declare function DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>): React.JSX.Element;
6
- declare function DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>): React.JSX.Element;
7
- declare function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>): React.JSX.Element;
8
- declare function DrawerContent({ className, children, ...props }: React.ComponentProps<typeof DrawerPrimitive.Content>): React.JSX.Element;
2
+ import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
3
+ import { type WithAsChild } from "../lib/base-render";
4
+ type DrawerDirection = "top" | "right" | "bottom" | "left";
5
+ type DrawerProps = Omit<DrawerPrimitive.Root.Props, "onSnapPointChange" | "snapPoint" | "swipeDirection"> & {
6
+ activeSnapPoint?: DrawerPrimitive.Root.Props["snapPoint"];
7
+ direction?: DrawerDirection;
8
+ onSnapPointChange?: DrawerPrimitive.Root.Props["onSnapPointChange"];
9
+ setActiveSnapPoint?: DrawerPrimitive.Root.Props["onSnapPointChange"];
10
+ showSwipeHandle?: boolean;
11
+ snapPoint?: DrawerPrimitive.Root.Props["snapPoint"];
12
+ swipeDirection?: DrawerPrimitive.Root.Props["swipeDirection"];
13
+ };
14
+ declare function Drawer({ activeSnapPoint, direction, modal, onSnapPointChange, setActiveSnapPoint, showSwipeHandle, snapPoints, snapPoint, swipeDirection, ...props }: DrawerProps): React.JSX.Element;
15
+ declare function DrawerTrigger({ ...props }: WithAsChild<DrawerPrimitive.Trigger.Props>): React.JSX.Element;
16
+ declare function DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props): React.JSX.Element;
17
+ declare function DrawerClose({ ...props }: WithAsChild<DrawerPrimitive.Close.Props>): React.JSX.Element;
18
+ declare function DrawerOverlay({ className, ...props }: DrawerPrimitive.Backdrop.Props): React.JSX.Element;
19
+ declare function DrawerSwipeHandle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
20
+ declare function DrawerContent({ className, children, ...props }: DrawerPrimitive.Popup.Props): React.JSX.Element;
9
21
  declare function DrawerHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
10
22
  declare function DrawerFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
- declare function DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>): React.JSX.Element;
12
- declare function DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>): React.JSX.Element;
13
- export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
23
+ declare function DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props): React.JSX.Element;
24
+ declare function DrawerDescription({ className, ...props }: DrawerPrimitive.Description.Props): React.JSX.Element;
25
+ export { Drawer, DrawerPortal, DrawerOverlay, DrawerSwipeHandle, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
14
26
  //# sourceMappingURL=drawer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../src/components/drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,MAAM,CAAA;AAIhD,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK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