@stackframe/stack-ui 2.6.19 → 2.6.21

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 (84) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/components/copy-button.d.ts +4 -2
  3. package/dist/components/copy-button.js +2 -2
  4. package/dist/components/data-table/data-table.d.ts +14 -16
  5. package/dist/components/data-table/data-table.js +36 -4
  6. package/dist/components/ui/accordion.d.ts +9 -3
  7. package/dist/components/ui/accordion.js +4 -4
  8. package/dist/components/ui/alert.d.ts +10 -4
  9. package/dist/components/ui/alert.js +4 -4
  10. package/dist/components/ui/avatar.d.ts +9 -3
  11. package/dist/components/ui/avatar.js +4 -4
  12. package/dist/components/ui/badge.d.ts +3 -1
  13. package/dist/components/ui/badge.js +2 -2
  14. package/dist/components/ui/breadcrumb.d.ts +17 -7
  15. package/dist/components/ui/breadcrumb.js +6 -6
  16. package/dist/components/ui/button.d.ts +3 -1
  17. package/dist/components/ui/button.js +3 -3
  18. package/dist/components/ui/card.d.ts +24 -8
  19. package/dist/components/ui/card.js +9 -9
  20. package/dist/components/ui/checkbox.d.ts +3 -1
  21. package/dist/components/ui/checkbox.js +2 -2
  22. package/dist/components/ui/command.d.ts +8 -72
  23. package/dist/components/ui/command.js +8 -8
  24. package/dist/components/ui/context-menu.d.ts +27 -11
  25. package/dist/components/ui/context-menu.js +9 -9
  26. package/dist/components/ui/dialog.d.ts +12 -4
  27. package/dist/components/ui/dialog.js +5 -5
  28. package/dist/components/ui/dropdown-menu.d.ts +30 -12
  29. package/dist/components/ui/dropdown-menu.js +10 -9
  30. package/dist/components/ui/form.d.ts +15 -5
  31. package/dist/components/ui/form.js +6 -5
  32. package/dist/components/ui/hover-card.d.ts +3 -1
  33. package/dist/components/ui/hover-card.js +2 -2
  34. package/dist/components/ui/inline-code.d.ts +3 -1
  35. package/dist/components/ui/inline-code.js +2 -2
  36. package/dist/components/ui/input-otp.d.ts +12 -29
  37. package/dist/components/ui/input-otp.js +5 -4
  38. package/dist/components/ui/input.d.ts +6 -2
  39. package/dist/components/ui/input.js +3 -2
  40. package/dist/components/ui/label.d.ts +6 -2
  41. package/dist/components/ui/label.js +3 -3
  42. package/dist/components/ui/menubar.d.ts +4 -5
  43. package/dist/components/ui/menubar.js +2 -1
  44. package/dist/components/ui/navigation-menu.d.ts +18 -6
  45. package/dist/components/ui/navigation-menu.js +7 -7
  46. package/dist/components/ui/password-input.d.ts +3 -1
  47. package/dist/components/ui/password-input.js +3 -2
  48. package/dist/components/ui/popover.d.ts +3 -1
  49. package/dist/components/ui/popover.js +2 -2
  50. package/dist/components/ui/progress.d.ts +3 -1
  51. package/dist/components/ui/progress.js +2 -2
  52. package/dist/components/ui/radio-group.d.ts +6 -2
  53. package/dist/components/ui/radio-group.js +3 -3
  54. package/dist/components/ui/scroll-area.d.ts +6 -2
  55. package/dist/components/ui/scroll-area.js +3 -3
  56. package/dist/components/ui/select.d.ts +21 -7
  57. package/dist/components/ui/select.js +8 -8
  58. package/dist/components/ui/separator.d.ts +3 -1
  59. package/dist/components/ui/separator.js +2 -2
  60. package/dist/components/ui/sheet.d.ts +12 -4
  61. package/dist/components/ui/sheet.js +5 -5
  62. package/dist/components/ui/slider.d.ts +3 -1
  63. package/dist/components/ui/slider.js +2 -2
  64. package/dist/components/ui/spinner.d.ts +3 -1
  65. package/dist/components/ui/spinner.js +2 -2
  66. package/dist/components/ui/switch.d.ts +3 -1
  67. package/dist/components/ui/switch.js +3 -3
  68. package/dist/components/ui/table.d.ts +24 -8
  69. package/dist/components/ui/table.js +9 -9
  70. package/dist/components/ui/tabs.d.ts +9 -3
  71. package/dist/components/ui/tabs.js +4 -4
  72. package/dist/components/ui/textarea.d.ts +3 -1
  73. package/dist/components/ui/textarea.js +2 -2
  74. package/dist/components/ui/toast.d.ts +19 -7
  75. package/dist/components/ui/toast.js +7 -7
  76. package/dist/components/ui/toggle-group.d.ts +8 -4
  77. package/dist/components/ui/toggle-group.js +3 -2
  78. package/dist/components/ui/toggle.d.ts +4 -2
  79. package/dist/components/ui/toggle.js +2 -2
  80. package/dist/components/ui/tooltip.d.ts +6 -2
  81. package/dist/components/ui/tooltip.js +3 -3
  82. package/dist/components/ui/typography.d.ts +3 -1
  83. package/dist/components/ui/typography.js +2 -2
  84. package/package.json +52 -44
@@ -1,26 +1,26 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import React from "react";
3
+ import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
4
4
  import { MagnifyingGlassIcon } from "@radix-ui/react-icons";
5
5
  import { Command as CommandPrimitive } from "cmdk";
6
6
  import { cn } from "../../lib/utils";
7
7
  import { Dialog, DialogBody, DialogContent } from "./dialog";
8
- const Command = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive, { ref: ref, className: cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", className), ...props })));
8
+ const Command = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(CommandPrimitive, { ref: ref, className: cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", className), ...props })));
9
9
  Command.displayName = CommandPrimitive.displayName;
10
10
  const CommandDialog = ({ children, ...props }) => {
11
11
  return (_jsx(Dialog, { ...props, children: _jsx(DialogContent, { className: "overflow-hidden p-0", children: _jsx(DialogBody, { children: _jsx(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[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 }) }) }) }));
12
12
  };
13
- const CommandInput = React.forwardRef(({ className, ...props }, ref) => (_jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [_jsx(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), _jsx(CommandPrimitive.Input, { ref: ref, className: cn("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className), ...props })] })));
13
+ const CommandInput = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [_jsx(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), _jsx(CommandPrimitive.Input, { ref: ref, className: cn("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className), ...props })] })));
14
14
  CommandInput.displayName = CommandPrimitive.Input.displayName;
15
- const CommandList = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.List, { ref: ref, className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className), ...props })));
15
+ const CommandList = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(CommandPrimitive.List, { ref: ref, className: cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className), ...props })));
16
16
  CommandList.displayName = CommandPrimitive.List.displayName;
17
- const CommandEmpty = React.forwardRef((props, ref) => (_jsx(CommandPrimitive.Empty, { ref: ref, className: "py-6 text-center text-sm", ...props })));
17
+ const CommandEmpty = forwardRefIfNeeded((props, ref) => (_jsx(CommandPrimitive.Empty, { ref: ref, className: "py-6 text-center text-sm", ...props })));
18
18
  CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
19
- const CommandGroup = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Group, { ref: ref, 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 })));
19
+ const CommandGroup = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Group, { ref: ref, 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 })));
20
20
  CommandGroup.displayName = CommandPrimitive.Group.displayName;
21
- const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Separator, { ref: ref, className: cn("-mx-1 h-px bg-border", className), ...props })));
21
+ const CommandSeparator = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Separator, { ref: ref, className: cn("-mx-1 h-px bg-border", className), ...props })));
22
22
  CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
23
- const CommandItem = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Item, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50", className), ...props })));
23
+ const CommandItem = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Item, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50", className), ...props })));
24
24
  CommandItem.displayName = CommandPrimitive.Item.displayName;
25
25
  const CommandShortcut = ({ className, ...props }) => {
26
26
  return (_jsx("span", { className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className), ...props }));
@@ -6,20 +6,36 @@ declare const ContextMenuGroup: React.ForwardRefExoticComponent<ContextMenuPrimi
6
6
  declare const ContextMenuPortal: React.FC<ContextMenuPrimitive.ContextMenuPortalProps>;
7
7
  declare const ContextMenuSub: React.FC<ContextMenuPrimitive.ContextMenuSubProps>;
8
8
  declare const ContextMenuRadioGroup: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
9
- declare const ContextMenuSubTrigger: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
9
+ declare const ContextMenuSubTrigger: React.FC<Omit<ContextMenuPrimitive.ContextMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
10
10
  inset?: boolean | undefined;
11
- } & React.RefAttributes<HTMLDivElement>>;
12
- declare const ContextMenuSubContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
- declare const ContextMenuContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
- declare const ContextMenuItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
11
+ } & {
12
+ ref?: React.Ref<HTMLDivElement> | undefined;
13
+ }>;
14
+ declare const ContextMenuSubContent: React.FC<Omit<ContextMenuPrimitive.ContextMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
15
+ ref?: React.Ref<HTMLDivElement> | undefined;
16
+ }>;
17
+ declare const ContextMenuContent: React.FC<Omit<ContextMenuPrimitive.ContextMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
18
+ ref?: React.Ref<HTMLDivElement> | undefined;
19
+ }>;
20
+ declare const ContextMenuItem: React.FC<Omit<ContextMenuPrimitive.ContextMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
15
21
  inset?: boolean | undefined;
16
- } & React.RefAttributes<HTMLDivElement>>;
17
- declare const ContextMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
- declare const ContextMenuRadioItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
19
- declare const ContextMenuLabel: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
22
+ } & {
23
+ ref?: React.Ref<HTMLDivElement> | undefined;
24
+ }>;
25
+ declare const ContextMenuCheckboxItem: React.FC<Omit<ContextMenuPrimitive.ContextMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
26
+ ref?: React.Ref<HTMLDivElement> | undefined;
27
+ }>;
28
+ declare const ContextMenuRadioItem: React.FC<Omit<ContextMenuPrimitive.ContextMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
29
+ ref?: React.Ref<HTMLDivElement> | undefined;
30
+ }>;
31
+ declare const ContextMenuLabel: React.FC<Omit<ContextMenuPrimitive.ContextMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
20
32
  inset?: boolean | undefined;
21
- } & React.RefAttributes<HTMLDivElement>>;
22
- declare const ContextMenuSeparator: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
33
+ } & {
34
+ ref?: React.Ref<HTMLDivElement> | undefined;
35
+ }>;
36
+ declare const ContextMenuSeparator: React.FC<Omit<ContextMenuPrimitive.ContextMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
37
+ ref?: React.Ref<HTMLDivElement> | undefined;
38
+ }>;
23
39
  declare const ContextMenuShortcut: {
24
40
  ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
25
41
  displayName: string;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import React from "react";
3
+ import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
4
4
  import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
5
5
  import { CheckIcon, ChevronRightIcon, DotFilledIcon, } from "@radix-ui/react-icons";
6
6
  import { cn } from "../../lib/utils";
@@ -10,22 +10,22 @@ const ContextMenuGroup = ContextMenuPrimitive.Group;
10
10
  const ContextMenuPortal = ContextMenuPrimitive.Portal;
11
11
  const ContextMenuSub = ContextMenuPrimitive.Sub;
12
12
  const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
13
- const ContextMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(ContextMenuPrimitive.SubTrigger, { ref: ref, className: cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto h-4 w-4" })] })));
13
+ const ContextMenuSubTrigger = forwardRefIfNeeded(({ className, inset, children, ...props }, ref) => (_jsxs(ContextMenuPrimitive.SubTrigger, { ref: ref, className: cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto h-4 w-4" })] })));
14
14
  ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
15
- const ContextMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(ContextMenuPrimitive.SubContent, { ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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", className), ...props })));
15
+ const ContextMenuSubContent = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(ContextMenuPrimitive.SubContent, { ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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", className), ...props })));
16
16
  ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
17
- const ContextMenuContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.Content, { ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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", className), ...props }) })));
17
+ const ContextMenuContent = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.Content, { ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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", className), ...props }) })));
18
18
  ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
19
- const ContextMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(ContextMenuPrimitive.Item, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className), ...props })));
19
+ const ContextMenuItem = forwardRefIfNeeded(({ className, inset, ...props }, ref) => (_jsx(ContextMenuPrimitive.Item, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className), ...props })));
20
20
  ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
21
- const ContextMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(ContextMenuPrimitive.CheckboxItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(ContextMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "h-4 w-4" }) }) }), children] })));
21
+ const ContextMenuCheckboxItem = forwardRefIfNeeded(({ className, children, checked, ...props }, ref) => (_jsxs(ContextMenuPrimitive.CheckboxItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(ContextMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "h-4 w-4" }) }) }), children] })));
22
22
  ContextMenuCheckboxItem.displayName =
23
23
  ContextMenuPrimitive.CheckboxItem.displayName;
24
- const ContextMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(ContextMenuPrimitive.RadioItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(ContextMenuPrimitive.ItemIndicator, { children: _jsx(DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }), children] })));
24
+ const ContextMenuRadioItem = forwardRefIfNeeded(({ className, children, ...props }, ref) => (_jsxs(ContextMenuPrimitive.RadioItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(ContextMenuPrimitive.ItemIndicator, { children: _jsx(DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }), children] })));
25
25
  ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
26
- const ContextMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(ContextMenuPrimitive.Label, { ref: ref, className: cn("px-2 py-1.5 text-sm font-semibold text-foreground", inset && "pl-8", className), ...props })));
26
+ const ContextMenuLabel = forwardRefIfNeeded(({ className, inset, ...props }, ref) => (_jsx(ContextMenuPrimitive.Label, { ref: ref, className: cn("px-2 py-1.5 text-sm font-semibold text-foreground", inset && "pl-8", className), ...props })));
27
27
  ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
28
- const ContextMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(ContextMenuPrimitive.Separator, { ref: ref, className: cn("-mx-1 my-1 h-px bg-border", className), ...props })));
28
+ const ContextMenuSeparator = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(ContextMenuPrimitive.Separator, { ref: ref, className: cn("-mx-1 my-1 h-px bg-border", className), ...props })));
29
29
  ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
30
30
  const ContextMenuShortcut = ({ className, ...props }) => {
31
31
  return (_jsx("span", { className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className), ...props }));
@@ -4,8 +4,12 @@ declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
4
4
  declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
5
  declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
6
6
  declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
7
- declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
- declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ declare const DialogOverlay: React.FC<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
8
+ ref?: React.Ref<HTMLDivElement> | undefined;
9
+ }>;
10
+ declare const DialogContent: React.FC<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
11
+ ref?: React.Ref<HTMLDivElement> | undefined;
12
+ }>;
9
13
  declare const DialogBody: ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
10
14
  declare const DialogHeader: {
11
15
  ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
@@ -15,6 +19,10 @@ declare const DialogFooter: {
15
19
  ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
16
20
  displayName: string;
17
21
  };
18
- declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
19
- declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
22
+ declare const DialogTitle: React.FC<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & {
23
+ ref?: React.Ref<HTMLHeadingElement> | undefined;
24
+ }>;
25
+ declare const DialogDescription: React.FC<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & {
26
+ ref?: React.Ref<HTMLParagraphElement> | undefined;
27
+ }>;
20
28
  export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogBody, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import React from "react";
3
+ import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
4
4
  import * as DialogPrimitive from "@radix-ui/react-dialog";
5
5
  import { Cross2Icon } from "@radix-ui/react-icons";
6
6
  import { cn } from "../../lib/utils";
@@ -8,17 +8,17 @@ const Dialog = DialogPrimitive.Root;
8
8
  const DialogTrigger = DialogPrimitive.Trigger;
9
9
  const DialogPortal = DialogPrimitive.Portal;
10
10
  const DialogClose = DialogPrimitive.Close;
11
- const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props })));
11
+ const DialogOverlay = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Overlay, { ref: ref, className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className), ...props })));
12
12
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
13
- const DialogContent = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn("fixed left-[50%] top-[50%] max-h-screen z-50 flex flex-col w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background p-6 shadow-lg duration-100 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className), ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [_jsx(Cross2Icon, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] })));
13
+ const DialogContent = forwardRefIfNeeded(({ className, children, ...props }, ref) => (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { ref: ref, className: cn("fixed left-[50%] top-[50%] max-h-screen z-50 flex flex-col w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background p-6 shadow-lg duration-100 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className), ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [_jsx(Cross2Icon, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] })));
14
14
  DialogContent.displayName = DialogPrimitive.Content.displayName;
15
15
  const DialogBody = ({ className, ...props }) => (_jsx("div", { className: cn("overflow-y-auto flex flex-col gap-4 w-[calc(100%+3rem)] -mx-6 px-6 my-2 py-2", className), ...props }));
16
16
  const DialogHeader = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props }));
17
17
  DialogHeader.displayName = "DialogHeader";
18
18
  const DialogFooter = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className), ...props }));
19
19
  DialogFooter.displayName = "DialogFooter";
20
- const DialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Title, { ref: ref, className: cn("text-lg font-semibold leading-none tracking-tight", className), ...props })));
20
+ const DialogTitle = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Title, { ref: ref, className: cn("text-lg font-semibold leading-none tracking-tight", className), ...props })));
21
21
  DialogTitle.displayName = DialogPrimitive.Title.displayName;
22
- const DialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Description, { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
22
+ const DialogDescription = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(DialogPrimitive.Description, { ref: ref, className: cn("text-sm text-muted-foreground", className), ...props })));
23
23
  DialogDescription.displayName = DialogPrimitive.Description.displayName;
24
24
  export { Dialog, DialogPortal, DialogOverlay, DialogTrigger, DialogClose, DialogContent, DialogBody, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
@@ -1,26 +1,44 @@
1
1
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
2
2
  import React from "react";
3
- declare const DropdownMenu: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuProps & React.RefAttributes<never>>;
3
+ declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps & {
4
+ ref?: React.Ref<never> | undefined;
5
+ }>;
4
6
  declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
7
  declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
6
8
  declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
7
9
  declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
8
10
  declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
9
- declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
11
+ declare const DropdownMenuSubTrigger: React.FC<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
10
12
  inset?: boolean | undefined;
11
- } & React.RefAttributes<HTMLDivElement>>;
12
- declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
- declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
- declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref">, "onClick"> & {
13
+ } & {
14
+ ref?: React.Ref<HTMLDivElement> | undefined;
15
+ }>;
16
+ declare const DropdownMenuSubContent: React.FC<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
17
+ ref?: React.Ref<HTMLDivElement> | undefined;
18
+ }>;
19
+ declare const DropdownMenuContent: React.FC<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
20
+ ref?: React.Ref<HTMLDivElement> | undefined;
21
+ }>;
22
+ declare const DropdownMenuItem: React.FC<Omit<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref">, "onClick"> & {
15
23
  inset?: boolean | undefined;
16
24
  onClick?: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void | Promise<void>) | undefined;
17
- } & React.RefAttributes<HTMLDivElement>>;
18
- declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
19
- declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
20
- declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
25
+ } & {
26
+ ref?: React.Ref<HTMLDivElement> | undefined;
27
+ }>;
28
+ declare const DropdownMenuCheckboxItem: React.FC<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
29
+ ref?: React.Ref<HTMLDivElement> | undefined;
30
+ }>;
31
+ declare const DropdownMenuRadioItem: React.FC<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
32
+ ref?: React.Ref<HTMLDivElement> | undefined;
33
+ }>;
34
+ declare const DropdownMenuLabel: React.FC<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
21
35
  inset?: boolean | undefined;
22
- } & React.RefAttributes<HTMLDivElement>>;
23
- declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
36
+ } & {
37
+ ref?: React.Ref<HTMLDivElement> | undefined;
38
+ }>;
39
+ declare const DropdownMenuSeparator: React.FC<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
40
+ ref?: React.Ref<HTMLDivElement> | undefined;
41
+ }>;
24
42
  declare const DropdownMenuShortcut: {
25
43
  ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
26
44
  displayName: string;
@@ -3,13 +3,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
4
4
  import { CheckIcon, ChevronRightIcon, DotFilledIcon } from "@radix-ui/react-icons";
5
5
  import React from "react";
6
+ import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
6
7
  import { useAsyncCallback } from "@stackframe/stack-shared/dist/hooks/use-async-callback";
7
8
  import { throwErr } from "@stackframe/stack-shared/dist/utils/errors";
8
9
  import { runAsynchronouslyWithAlert } from "@stackframe/stack-shared/dist/utils/promises";
9
10
  import { cn } from "../../lib/utils";
10
11
  import { Spinner } from "./spinner";
11
12
  const DropdownMenuContext = React.createContext(undefined);
12
- const DropdownMenu = React.forwardRef(({ ...props }, ref) => {
13
+ const DropdownMenu = forwardRefIfNeeded(({ ...props }, ref) => {
13
14
  const [open, setOpen] = React.useState(!!props.open);
14
15
  return (_jsx(DropdownMenuContext.Provider, { value: {
15
16
  open,
@@ -28,15 +29,15 @@ const DropdownMenuGroup = DropdownMenuPrimitive.Group;
28
29
  const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
29
30
  const DropdownMenuSub = DropdownMenuPrimitive.Sub;
30
31
  const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
31
- const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto h-4 w-4" })] })));
32
+ const DropdownMenuSubTrigger = forwardRefIfNeeded(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto h-4 w-4" })] })));
32
33
  DropdownMenuSubTrigger.displayName =
33
34
  DropdownMenuPrimitive.SubTrigger.displayName;
34
- const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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", className), ...props })));
35
+ const DropdownMenuSubContent = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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", className), ...props })));
35
36
  DropdownMenuSubContent.displayName =
36
37
  DropdownMenuPrimitive.SubContent.displayName;
37
- const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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", className), ...props }) })));
38
+ const DropdownMenuContent = forwardRefIfNeeded(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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", className), ...props }) })));
38
39
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
39
- const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => {
40
+ const DropdownMenuItem = forwardRefIfNeeded(({ className, inset, ...props }, ref) => {
40
41
  const { setOpen } = React.useContext(DropdownMenuContext) ?? throwErr("No DropdownMenuContext found");
41
42
  const [handleClick, isLoading] = useAsyncCallback(async (e) => {
42
43
  await props.onClick?.(e);
@@ -48,14 +49,14 @@ const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref)
48
49
  } : undefined, children: [_jsx("div", { style: { visibility: isLoading ? "visible" : "hidden", position: "absolute", inset: 0, display: "flex", justifyContent: "center", alignItems: "center" }, children: _jsx(Spinner, {}) }), _jsx("div", { style: { visibility: isLoading ? "hidden" : "visible" }, children: props.children })] });
49
50
  });
50
51
  DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
51
- const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "h-4 w-4" }) }) }), children] })));
52
+ const DropdownMenuCheckboxItem = forwardRefIfNeeded(({ className, children, checked, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "h-4 w-4" }) }) }), children] })));
52
53
  DropdownMenuCheckboxItem.displayName =
53
54
  DropdownMenuPrimitive.CheckboxItem.displayName;
54
- const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.RadioItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }), children] })));
55
+ const DropdownMenuRadioItem = forwardRefIfNeeded(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.RadioItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }), children] })));
55
56
  DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
56
- const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Label, { ref: ref, className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className), ...props })));
57
+ const DropdownMenuLabel = forwardRefIfNeeded(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Label, { ref: ref, className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className), ...props })));
57
58
  DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
58
- const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Separator, { ref: ref, className: cn("-mx-1 my-1 h-px bg-muted", className), ...props })));
59
+ const DropdownMenuSeparator = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Separator, { ref: ref, className: cn("-mx-1 my-1 h-px bg-muted", className), ...props })));
59
60
  DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
60
61
  const DropdownMenuShortcut = ({ className, ...props }) => {
61
62
  return (_jsx("span", { className: cn("ml-auto text-xs tracking-widest opacity-60", className), ...props }));
@@ -15,9 +15,19 @@ declare const useFormField: () => {
15
15
  formDescriptionId: string;
16
16
  formMessageId: string;
17
17
  };
18
- declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
19
- declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
20
- declare const FormControl: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-slot").SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
21
- declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
22
- declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
18
+ declare const FormItem: React.FC<React.HTMLAttributes<HTMLDivElement> & {
19
+ ref?: React.Ref<HTMLDivElement> | undefined;
20
+ }>;
21
+ declare const FormLabel: React.FC<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & {
22
+ ref?: React.Ref<HTMLLabelElement> | undefined;
23
+ }>;
24
+ declare const FormControl: React.FC<Omit<import("@radix-ui/react-slot").SlotProps & React.RefAttributes<HTMLElement>, "ref"> & {
25
+ ref?: React.Ref<HTMLElement> | undefined;
26
+ }>;
27
+ declare const FormDescription: React.FC<React.HTMLAttributes<HTMLParagraphElement> & {
28
+ ref?: React.Ref<HTMLParagraphElement> | undefined;
29
+ }>;
30
+ declare const FormMessage: React.FC<React.HTMLAttributes<HTMLParagraphElement> & {
31
+ ref?: React.Ref<HTMLParagraphElement> | undefined;
32
+ }>;
23
33
  export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
@@ -2,6 +2,7 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { Slot } from "@radix-ui/react-slot";
4
4
  import React from "react";
5
+ import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
5
6
  import { Controller, FormProvider, useFormContext, } from "react-hook-form";
6
7
  import { StackAssertionError } from "@stackframe/stack-shared/dist/utils/errors";
7
8
  import { cn } from "../../lib/utils";
@@ -31,29 +32,29 @@ const useFormField = () => {
31
32
  };
32
33
  };
33
34
  const FormItemContext = React.createContext({});
34
- const FormItem = React.forwardRef(({ className, ...props }, ref) => {
35
+ const FormItem = forwardRefIfNeeded(({ className, ...props }, ref) => {
35
36
  const id = React.useId();
36
37
  return (_jsx(FormItemContext.Provider, { value: { id }, children: _jsx("div", { ref: ref, className: cn("space-y-2", className), ...props }) }));
37
38
  });
38
39
  FormItem.displayName = "FormItem";
39
- const FormLabel = React.forwardRef(({ className, ...props }, ref) => {
40
+ const FormLabel = forwardRefIfNeeded(({ className, ...props }, ref) => {
40
41
  const { error } = useFormField();
41
42
  return (_jsx(SpanLabel, { ref: ref, className: cn(error && "text-destructive", className), ...props }));
42
43
  });
43
44
  FormLabel.displayName = "FormLabel";
44
- const FormControl = React.forwardRef(({ ...props }, ref) => {
45
+ const FormControl = forwardRefIfNeeded(({ ...props }, ref) => {
45
46
  const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
46
47
  return (_jsx(Slot, { ref: ref, id: formItemId, "aria-describedby": !error
47
48
  ? `${formDescriptionId}`
48
49
  : `${formDescriptionId} ${formMessageId}`, "aria-invalid": !!error, ...props }));
49
50
  });
50
51
  FormControl.displayName = "FormControl";
51
- const FormDescription = React.forwardRef(({ className, ...props }, ref) => {
52
+ const FormDescription = forwardRefIfNeeded(({ className, ...props }, ref) => {
52
53
  const { formDescriptionId } = useFormField();
53
54
  return (_jsx("p", { ref: ref, id: formDescriptionId, className: cn("text-[0.8rem] text-muted-foreground", className), ...props }));
54
55
  });
55
56
  FormDescription.displayName = "FormDescription";
56
- const FormMessage = React.forwardRef(({ className, children, ...props }, ref) => {
57
+ const FormMessage = forwardRefIfNeeded(({ className, children, ...props }, ref) => {
57
58
  const { error, formMessageId } = useFormField();
58
59
  const body = error ? String(error.message) : children;
59
60
  if (!body) {
@@ -2,5 +2,7 @@ import React from "react";
2
2
  import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
3
3
  declare const HoverCard: React.FC<HoverCardPrimitive.HoverCardProps>;
4
4
  declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
5
- declare const HoverCardContent: React.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
+ declare const HoverCardContent: React.FC<Omit<HoverCardPrimitive.HoverCardContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
6
+ ref?: React.Ref<HTMLDivElement> | undefined;
7
+ }>;
6
8
  export { HoverCard, HoverCardTrigger, HoverCardContent };
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import React from "react";
3
+ import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
4
4
  import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
5
5
  import { cn } from "../../lib/utils";
6
6
  const HoverCard = HoverCardPrimitive.Root;
7
7
  const HoverCardTrigger = HoverCardPrimitive.Trigger;
8
- const HoverCardContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => (_jsx(HoverCardPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, className: cn("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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", className), ...props })));
8
+ const HoverCardContent = forwardRefIfNeeded(({ className, align = "center", sideOffset = 4, ...props }, ref) => (_jsx(HoverCardPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, className: cn("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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", className), ...props })));
9
9
  HoverCardContent.displayName = HoverCardPrimitive.Content.displayName;
10
10
  export { HoverCard, HoverCardTrigger, HoverCardContent };
@@ -1,3 +1,5 @@
1
1
  import React from "react";
2
- declare const InlineCode: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
2
+ declare const InlineCode: React.FC<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
3
+ ref?: React.Ref<HTMLElement> | undefined;
4
+ }>;
3
5
  export { InlineCode };
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { cn } from "../../lib/utils";
4
- import React from "react";
4
+ import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
5
5
  import { hasClickableParent } from "@stackframe/stack-shared/dist/utils/dom";
6
6
  import { getNodeText } from "@stackframe/stack-shared/dist/utils/react";
7
7
  import { runAsynchronously } from "@stackframe/stack-shared/dist/utils/promises";
8
8
  import { useToast } from "./use-toast";
9
- const InlineCode = React.forwardRef((props, ref) => {
9
+ const InlineCode = forwardRefIfNeeded((props, ref) => {
10
10
  const { toast } = useToast();
11
11
  return _jsx("code", { ref: ref, ...props, className: cn("bg-zinc-200 text-zinc-700 dark:bg-zinc-800 dark:text-zinc-300 rounded-sm px-1 cursor-pointer", props.className), onClick: (e) => {
12
12
  props.onClick?.(e);
@@ -1,33 +1,16 @@
1
1
  import React from "react";
2
- declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "containerClassName" | "noScriptCSSFallback"> & {
3
- value?: string | undefined;
4
- onChange?: ((newValue: string) => unknown) | undefined;
5
- maxLength: number;
6
- textAlign?: "center" | "right" | "left" | undefined;
7
- onComplete?: ((...args: any[]) => unknown) | undefined;
8
- pushPasswordManagerStrategy?: "none" | "increase-width" | undefined;
9
- containerClassName?: string | undefined;
10
- noScriptCSSFallback?: string | null | undefined;
11
- } & {
12
- render: (props: import("input-otp").RenderProps) => React.ReactNode;
13
- children?: undefined;
14
- } & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "containerClassName" | "noScriptCSSFallback"> & {
15
- value?: string | undefined;
16
- onChange?: ((newValue: string) => unknown) | undefined;
17
- maxLength: number;
18
- textAlign?: "center" | "right" | "left" | undefined;
19
- onComplete?: ((...args: any[]) => unknown) | undefined;
20
- pushPasswordManagerStrategy?: "none" | "increase-width" | undefined;
21
- containerClassName?: string | undefined;
22
- noScriptCSSFallback?: string | null | undefined;
23
- } & {
24
- render?: undefined;
25
- children: React.ReactNode;
26
- } & React.RefAttributes<HTMLInputElement>, "ref">) & React.RefAttributes<HTMLInputElement>>;
27
- declare const InputOTPGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
28
- declare const InputOTPSlot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
2
+ import { OTPInput } from "input-otp";
3
+ declare const InputOTP: React.FC<React.ComponentPropsWithoutRef<typeof OTPInput>>;
4
+ declare const InputOTPGroup: React.FC<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
5
+ ref?: React.Ref<HTMLDivElement> | undefined;
6
+ }>;
7
+ declare const InputOTPSlot: React.FC<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
29
8
  index: number;
30
9
  size?: "default" | "lg" | undefined;
31
- } & React.RefAttributes<HTMLDivElement>>;
32
- declare const InputOTPSeparator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
+ } & {
11
+ ref?: React.Ref<HTMLDivElement> | undefined;
12
+ }>;
13
+ declare const InputOTPSeparator: React.FC<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
14
+ ref?: React.Ref<HTMLDivElement> | undefined;
15
+ }>;
33
16
  export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
@@ -1,19 +1,20 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import React from "react";
4
+ import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
4
5
  import { DashIcon } from "@radix-ui/react-icons";
5
6
  import { OTPInput, OTPInputContext } from "input-otp";
6
7
  import { cn } from "../../lib/utils";
7
- const InputOTP = React.forwardRef(({ className, containerClassName, ...props }, ref) => (_jsx(OTPInput, { ref: ref, containerClassName: cn("flex items-center gap-2 has-[:disabled]:opacity-50", containerClassName), className: cn("disabled:cursor-not-allowed", className), ...props })));
8
+ const InputOTP = forwardRefIfNeeded(({ className, containerClassName, ...props }, ref) => (_jsx(OTPInput, { ref: ref, containerClassName: cn("flex items-center gap-2 has-[:disabled]:opacity-50", containerClassName), className: cn("disabled:cursor-not-allowed", className), ...props })));
8
9
  InputOTP.displayName = "InputOTP";
9
- const InputOTPGroup = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex items-center gap-1", className), ...props })));
10
+ const InputOTPGroup = forwardRefIfNeeded(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex items-center gap-1", className), ...props })));
10
11
  InputOTPGroup.displayName = "InputOTPGroup";
11
- const InputOTPSlot = React.forwardRef(({ index, className, size = 'default', ...props }, ref) => {
12
+ const InputOTPSlot = forwardRefIfNeeded(({ index, className, size = 'default', ...props }, ref) => {
12
13
  const inputOTPContext = React.useContext(OTPInputContext);
13
14
  const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
14
15
  return (_jsxs("div", { ref: ref, className: cn("relative flex h-9 w-9 items-center justify-center border border-input text-sm rounded-md", size === 'lg' ? 'h-10 w-10 text-lg font-medium' : '', isActive && "z-10 ring-1 ring-ring", className), ...props, children: [char, hasFakeCaret && (_jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: _jsx("div", { className: "h-4 w-px animate-caret-blink bg-foreground duration-1000" }) }))] }));
15
16
  });
16
17
  InputOTPSlot.displayName = "InputOTPSlot";
17
- const InputOTPSeparator = React.forwardRef(({ ...props }, ref) => (_jsx("div", { ref: ref, role: "separator", ...props, children: _jsx(DashIcon, {}) })));
18
+ const InputOTPSeparator = forwardRefIfNeeded(({ ...props }, ref) => (_jsx("div", { ref: ref, role: "separator", ...props, children: _jsx(DashIcon, {}) })));
18
19
  InputOTPSeparator.displayName = "InputOTPSeparator";
19
20
  export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
@@ -1,9 +1,13 @@
1
1
  import React from "react";
2
2
  export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
3
3
  }
4
- declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
4
+ declare const Input: React.FC<InputProps & {
5
+ ref?: React.Ref<HTMLInputElement> | undefined;
6
+ }>;
5
7
  export { Input };
6
8
  export interface DelayedInputProps extends InputProps {
7
9
  delay?: number;
8
10
  }
9
- export declare const DelayedInput: React.ForwardRefExoticComponent<DelayedInputProps & React.RefAttributes<HTMLInputElement>>;
11
+ export declare const DelayedInput: React.FC<DelayedInputProps & {
12
+ ref?: React.Ref<HTMLInputElement> | undefined;
13
+ }>;
@@ -1,12 +1,13 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from "react";
3
+ import { forwardRefIfNeeded } from "@stackframe/stack-shared/dist/utils/react";
3
4
  import { cn } from "../../lib/utils";
4
- const Input = React.forwardRef(({ className, type, ...props }, ref) => {
5
+ const Input = forwardRefIfNeeded(({ className, type, ...props }, ref) => {
5
6
  return (_jsx("input", { type: type, className: cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", className), ref: ref, ...props }));
6
7
  });
7
8
  Input.displayName = "Input";
8
9
  export { Input };
9
- export const DelayedInput = React.forwardRef(({ delay = 500, defaultValue, ...props }, ref) => {
10
+ export const DelayedInput = forwardRefIfNeeded(({ delay = 500, defaultValue, ...props }, ref) => {
10
11
  const [value, setValue] = React.useState(defaultValue ?? "");
11
12
  const timeout = React.useRef(null);
12
13
  const onChange = (e) => {
@@ -1,6 +1,10 @@
1
1
  import React from "react";
2
2
  import * as LabelPrimitive from "@radix-ui/react-label";
3
3
  import { type VariantProps } from "class-variance-authority";
4
- declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/types").ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
5
- declare const SpanLabel: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/types").ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
4
+ declare const Label: React.FC<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/types").ClassProp | undefined) => string> & {
5
+ ref?: React.Ref<HTMLLabelElement> | undefined;
6
+ }>;
7
+ declare const SpanLabel: React.FC<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/types").ClassProp | undefined) => string> & {
8
+ ref?: React.Ref<HTMLLabelElement> | undefined;
9
+ }>;
6
10
  export { Label, SpanLabel };