luan-ui 0.5.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +7 -3
  2. package/dist/components/accordion/accordion.d.ts +14 -15
  3. package/dist/components/accordion/accordion.js +11 -9
  4. package/dist/components/accordion/accordion.js.map +1 -1
  5. package/dist/components/alert/alert.d.ts +19 -18
  6. package/dist/components/alert/alert.js +35 -15
  7. package/dist/components/alert/alert.js.map +1 -1
  8. package/dist/components/alert-dialog/alert-dialog.d.ts +14 -9
  9. package/dist/components/alert-dialog/alert-dialog.js +21 -15
  10. package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
  11. package/dist/components/avatar/avatar-group.d.ts +3 -2
  12. package/dist/components/avatar/avatar-group.js +4 -4
  13. package/dist/components/avatar/avatar-group.js.map +1 -1
  14. package/dist/components/avatar/avatar.d.ts +8 -4
  15. package/dist/components/avatar/avatar.js +10 -8
  16. package/dist/components/avatar/avatar.js.map +1 -1
  17. package/dist/components/badge/badge.d.ts +12 -5
  18. package/dist/components/badge/badge.js +18 -7
  19. package/dist/components/badge/badge.js.map +1 -1
  20. package/dist/components/button/button.d.ts +24 -18
  21. package/dist/components/button/button.js +30 -15
  22. package/dist/components/button/button.js.map +1 -1
  23. package/dist/components/card/card.d.ts +32 -19
  24. package/dist/components/card/card.js +52 -20
  25. package/dist/components/card/card.js.map +1 -1
  26. package/dist/components/checkbox/checkbox.d.ts +6 -7
  27. package/dist/components/checkbox/checkbox.js +6 -8
  28. package/dist/components/checkbox/checkbox.js.map +1 -1
  29. package/dist/components/dialog/dialog.d.ts +16 -9
  30. package/dist/components/dialog/dialog.js +23 -18
  31. package/dist/components/dialog/dialog.js.map +1 -1
  32. package/dist/components/drawer/drawer.d.ts +19 -9
  33. package/dist/components/drawer/drawer.js +31 -25
  34. package/dist/components/drawer/drawer.js.map +1 -1
  35. package/dist/components/dropdown-menu/dropdown-menu.d.ts +30 -21
  36. package/dist/components/dropdown-menu/dropdown-menu.js +35 -30
  37. package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
  38. package/dist/components/form-field/form-field.d.ts +4 -8
  39. package/dist/components/form-field/form-field.js +3 -4
  40. package/dist/components/form-field/form-field.js.map +1 -1
  41. package/dist/components/form-helper/form-helper.d.ts +4 -6
  42. package/dist/components/form-helper/form-helper.js +2 -3
  43. package/dist/components/form-helper/form-helper.js.map +1 -1
  44. package/dist/components/icon/icon.d.ts +9 -15
  45. package/dist/components/icon/icon.js +20 -19
  46. package/dist/components/icon/icon.js.map +1 -1
  47. package/dist/components/input/input.d.ts +4 -4
  48. package/dist/components/input/input.js +2 -4
  49. package/dist/components/input/input.js.map +1 -1
  50. package/dist/components/label/label.d.ts +3 -4
  51. package/dist/components/label/label.js +5 -6
  52. package/dist/components/label/label.js.map +1 -1
  53. package/dist/components/pagination/pagination.d.ts +25 -21
  54. package/dist/components/pagination/pagination.js +30 -19
  55. package/dist/components/pagination/pagination.js.map +1 -1
  56. package/dist/components/popover/popover.d.ts +30 -14
  57. package/dist/components/popover/popover.js +30 -22
  58. package/dist/components/popover/popover.js.map +1 -1
  59. package/dist/components/progress/progress.d.ts +4 -6
  60. package/dist/components/progress/progress.js +4 -6
  61. package/dist/components/progress/progress.js.map +1 -1
  62. package/dist/components/radio-group/radio-group.d.ts +8 -7
  63. package/dist/components/radio-group/radio-group.js +8 -35
  64. package/dist/components/radio-group/radio-group.js.map +1 -1
  65. package/dist/components/select/select.d.ts +26 -15
  66. package/dist/components/select/select.js +28 -50
  67. package/dist/components/select/select.js.map +1 -1
  68. package/dist/components/skeleton/skeleton.d.ts +3 -1
  69. package/dist/components/skeleton/skeleton.js +3 -6
  70. package/dist/components/skeleton/skeleton.js.map +1 -1
  71. package/dist/components/slider/slider.d.ts +7 -14
  72. package/dist/components/slider/slider.js +23 -13
  73. package/dist/components/slider/slider.js.map +1 -1
  74. package/dist/components/switch/switch.d.ts +7 -7
  75. package/dist/components/switch/switch.js +9 -11
  76. package/dist/components/switch/switch.js.map +1 -1
  77. package/dist/components/table/table.d.ts +17 -8
  78. package/dist/components/table/table.js +24 -41
  79. package/dist/components/table/table.js.map +1 -1
  80. package/dist/components/tabs/tabs.d.ts +9 -5
  81. package/dist/components/tabs/tabs.js +10 -8
  82. package/dist/components/tabs/tabs.js.map +1 -1
  83. package/dist/components/text-area/text-area.d.ts +3 -5
  84. package/dist/components/text-area/text-area.js +2 -4
  85. package/dist/components/text-area/text-area.js.map +1 -1
  86. package/dist/components/toast/toast.d.ts +4 -10
  87. package/dist/components/toast/toast.js +4 -7
  88. package/dist/components/toast/toast.js.map +1 -1
  89. package/dist/components/tooltip/tooltip.d.ts +18 -9
  90. package/dist/components/tooltip/tooltip.js +21 -20
  91. package/dist/components/tooltip/tooltip.js.map +1 -1
  92. package/dist/index.d.ts +2 -2
  93. package/dist/index.js +2 -2
  94. package/dist/index.js.map +1 -1
  95. package/dist/styles/index.css +2 -2
  96. package/dist/utilities/merge-refs/merge-refs.d.ts +2 -2
  97. package/dist/utilities/merge-refs/merge-refs.js +1 -1
  98. package/dist/utilities/merge-refs/merge-refs.js.map +1 -1
  99. package/dist/utilities/responsive/responsive.d.ts +14 -10
  100. package/package.json +71 -72
  101. package/dist/components/slot/slot.d.ts +0 -13
  102. package/dist/components/slot/slot.js +0 -70
  103. package/dist/components/slot/slot.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","sourceRoot":"/","sources":["components/checkbox/checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EACN,WAAW,EACX,kBAAkB,GAElB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAC;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QACzB,QAAQ,EAAE,eAAe;KACzB,CAAC,CAAC;IACH,OAAO,CACN,KAAC,iBAAiB,CAAC,IAAI,IACtB,SAAS,EAAE,cAAc,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EACxD,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,KACd,KAAK,YAET,KAAC,iBAAiB,CAAC,SAAS,cAC3B,KAAC,IAAI,IAAC,OAAO,QAAC,IAAI,EAAE,QAAQ,YAC3B,KAAC,SAAS,KAAG,GACP,GACsB,GACN,CACzB,CAAC;AACH,CAAC,CACD,CAAC;AACF,QAAQ,CAAC,WAAW,GAAG,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC","sourcesContent":["import { useFormContext } from \"@components/form-field/form-field-context\";\nimport { Icon } from \"@components/icon/icon\";\nimport { CheckIcon } from \"@radix-ui/react-icons\";\nimport {\n\tgetVariants,\n\tmapResponsiveValue,\n\ttype ResponsiveValue,\n} from \"@utilities/responsive/responsive\";\nimport { Checkbox as CheckboxPrimitive } from \"radix-ui\";\nimport {\n\ttype ComponentPropsWithoutRef,\n\ttype ComponentRef,\n\tforwardRef,\n} from \"react\";\n\nexport type CheckboxProps = ComponentPropsWithoutRef<\n\ttypeof CheckboxPrimitive.Root\n> & {\n\tsize?: ResponsiveValue<\"small\" | \"medium\" | \"large\">;\n};\n\nexport const SIZES = {\n\tsm: {\n\t\tsmall: \"sm:h-4 sm:w-4\",\n\t\tmedium: \"sm:h-5 sm:w-5\",\n\t\tlarge: \"sm:h-6 sm:w-6\",\n\t},\n\tmd: {\n\t\tsmall: \"md:h-4 md:w-4\",\n\t\tmedium: \"md:h-5 md:w-5\",\n\t\tlarge: \"md:h-6 md:w-6\",\n\t},\n\tlg: {\n\t\tsmall: \"lg:h-4 lg:w-4\",\n\t\tmedium: \"lg:h-5 lg:w-5\",\n\t\tlarge: \"lg:h-6 lg:w-6\",\n\t},\n\txl: {\n\t\tsmall: \"xl:h-4 xl:w-4\",\n\t\tmedium: \"xl:h-5 xl:w-5\",\n\t\tlarge: \"xl:h-6 xl:w-6\",\n\t},\n};\nconst checkboxStyles = getVariants({\n\tbase: \"peer flex h-4 w-4 items-center justify-center rounded-sm border border-gray-700 shadow-sm focus:outline-none focus:ring-1 focus:ring-gray-700 data-[state=checked]:bg-gray-700 data-[state=checked]:text-gray-100\",\n\tvariants: {\n\t\tdisabled: {\n\t\t\ttrue: \"cursor-not-allowed bg-gray-400 opacity-50\",\n\t\t},\n\t\tsize: {\n\t\t\tsmall: \"h-4 w-4\",\n\t\t\tmedium: \"h-5 w-5\",\n\t\t\tlarge: \"h-6 w-6\",\n\t\t},\n\t},\n});\n\nconst iconSizeMap = {\n\tsmall: \"small\",\n\tmedium: \"medium\",\n\tlarge: \"medium\",\n} as const;\n\n/**\n * A checkbox component built on top of Radix UI's checkbox primitive.\n *\n * @example\n * ```tsx\n * <Checkbox id=\"checkbox\" onCheckedChange={(checked) => console.log(checked)} />\n * ```\n */\nexport const Checkbox = forwardRef<\n\tComponentRef<typeof CheckboxPrimitive.Root>,\n\tCheckboxProps\n>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\tdisabled: initialDisabled,\n\t\t\trequired: initialRequired,\n\t\t\tsize = \"medium\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst iconSize = mapResponsiveValue(size, (size) => iconSizeMap[size]);\n\t\tconst { disabled, required } = useFormContext({\n\t\t\tdisabled: initialDisabled,\n\t\t\trequired: initialRequired,\n\t\t});\n\t\treturn (\n\t\t\t<CheckboxPrimitive.Root\n\t\t\t\tclassName={checkboxStyles({ disabled, size, className })}\n\t\t\t\tref={ref}\n\t\t\t\tdisabled={disabled}\n\t\t\t\trequired={required}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<CheckboxPrimitive.Indicator>\n\t\t\t\t\t<Icon asChild size={iconSize}>\n\t\t\t\t\t\t<CheckIcon />\n\t\t\t\t\t</Icon>\n\t\t\t\t</CheckboxPrimitive.Indicator>\n\t\t\t</CheckboxPrimitive.Root>\n\t\t);\n\t},\n);\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n"]}
1
+ {"version":3,"file":"checkbox.js","sourceRoot":"/","sources":["components/checkbox/checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EACN,WAAW,EACX,kBAAkB,GAElB,MAAM,kCAAkC,CAAC;AAW1C,MAAM,CAAC,MAAM,KAAK,GAAG;IACpB,EAAE,EAAE;QACH,KAAK,EAAE,eAAe;QACtB,MAAM,EAAE,eAAe;QACvB,KAAK,EAAE,eAAe;KACtB;IACD,EAAE,EAAE;QACH,KAAK,EAAE,eAAe;QACtB,MAAM,EAAE,eAAe;QACvB,KAAK,EAAE,eAAe;KACtB;IACD,EAAE,EAAE;QACH,KAAK,EAAE,eAAe;QACtB,MAAM,EAAE,eAAe;QACvB,KAAK,EAAE,eAAe;KACtB;IACD,EAAE,EAAE;QACH,KAAK,EAAE,eAAe;QACtB,MAAM,EAAE,eAAe;QACvB,KAAK,EAAE,eAAe;KACtB;CACD,CAAC;AAEF,MAAM,cAAc,GAAG,WAAW,CAAC;IAClC,IAAI,EAAE,uMAAuM;IAC7M,QAAQ,EAAE;QACT,QAAQ,EAAE;YACT,IAAI,EAAE,2CAA2C;SACjD;QACD,IAAI,EAAE;YACL,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,SAAS;SAChB;KACD;CACD,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG;IACnB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,QAAQ;CACN,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,EACxB,SAAS,EACT,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,eAAe,EACzB,IAAI,GAAG,QAAQ,EACf,GAAG,EACH,GAAG,KAAK,EACO;IACf,MAAM,QAAQ,GAAG,kBAAkB,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;IACvE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,cAAc,CAAC;QAC7C,QAAQ,EAAE,eAAe;QACzB,QAAQ,EAAE,eAAe;KACzB,CAAC,CAAC;IACH,OAAO,CACN,KAAC,iBAAiB,CAAC,IAAI,IACtB,SAAS,EAAE,cAAc,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EACxD,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,KACd,KAAK,YAET,KAAC,iBAAiB,CAAC,SAAS,cAC3B,KAAC,IAAI,IAAC,MAAM,EAAE,KAAC,SAAS,KAAG,EAAE,IAAI,EAAE,QAAQ,GAAI,GAClB,GACN,CACzB,CAAC;AACH,CAAC","sourcesContent":["import { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\";\nimport { useFormContext } from \"@components/form-field/form-field-context\";\nimport { Icon } from \"@components/icon/icon\";\nimport { CheckIcon } from \"@radix-ui/react-icons\";\nimport {\n\tgetVariants,\n\tmapResponsiveValue,\n\ttype ResponsiveValue,\n} from \"@utilities/responsive/responsive\";\nimport type { ComponentProps } from \"react\";\n\nexport type CheckboxProps = Omit<\n\tComponentProps<typeof CheckboxPrimitive.Root>,\n\t\"className\"\n> & {\n\tsize?: ResponsiveValue<\"small\" | \"medium\" | \"large\">;\n\tclassName?: string;\n};\n\nexport const SIZES = {\n\tsm: {\n\t\tsmall: \"sm:h-4 sm:w-4\",\n\t\tmedium: \"sm:h-5 sm:w-5\",\n\t\tlarge: \"sm:h-6 sm:w-6\",\n\t},\n\tmd: {\n\t\tsmall: \"md:h-4 md:w-4\",\n\t\tmedium: \"md:h-5 md:w-5\",\n\t\tlarge: \"md:h-6 md:w-6\",\n\t},\n\tlg: {\n\t\tsmall: \"lg:h-4 lg:w-4\",\n\t\tmedium: \"lg:h-5 lg:w-5\",\n\t\tlarge: \"lg:h-6 lg:w-6\",\n\t},\n\txl: {\n\t\tsmall: \"xl:h-4 xl:w-4\",\n\t\tmedium: \"xl:h-5 xl:w-5\",\n\t\tlarge: \"xl:h-6 xl:w-6\",\n\t},\n};\n\nconst checkboxStyles = getVariants({\n\tbase: \"peer flex h-4 w-4 items-center justify-center rounded-sm border border-gray-700 shadow-sm focus:outline-none focus:ring-1 focus:ring-gray-700 data-[checked]:bg-gray-700 data-[checked]:text-gray-100\",\n\tvariants: {\n\t\tdisabled: {\n\t\t\ttrue: \"cursor-not-allowed bg-gray-400 opacity-50\",\n\t\t},\n\t\tsize: {\n\t\t\tsmall: \"h-4 w-4\",\n\t\t\tmedium: \"h-5 w-5\",\n\t\t\tlarge: \"h-6 w-6\",\n\t\t},\n\t},\n});\n\nconst iconSizeMap = {\n\tsmall: \"small\",\n\tmedium: \"medium\",\n\tlarge: \"medium\",\n} as const;\n\n/**\n * A checkbox component built on top of Base UI's checkbox primitive.\n *\n * @example\n * ```tsx\n * <Checkbox id=\"checkbox\" onCheckedChange={(checked) => console.log(checked)} />\n * ```\n */\nexport function Checkbox({\n\tclassName,\n\tdisabled: initialDisabled,\n\trequired: initialRequired,\n\tsize = \"medium\",\n\tref,\n\t...props\n}: CheckboxProps) {\n\tconst iconSize = mapResponsiveValue(size, (size) => iconSizeMap[size]);\n\tconst { disabled, required } = useFormContext({\n\t\tdisabled: initialDisabled,\n\t\trequired: initialRequired,\n\t});\n\treturn (\n\t\t<CheckboxPrimitive.Root\n\t\t\tclassName={checkboxStyles({ disabled, size, className })}\n\t\t\tref={ref}\n\t\t\tdisabled={disabled}\n\t\t\trequired={required}\n\t\t\t{...props}\n\t\t>\n\t\t\t<CheckboxPrimitive.Indicator>\n\t\t\t\t<Icon render={<CheckIcon />} size={iconSize} />\n\t\t\t</CheckboxPrimitive.Indicator>\n\t\t</CheckboxPrimitive.Root>\n\t);\n}\n"]}
@@ -1,10 +1,17 @@
1
- import { Dialog as RadixDialog } from "radix-ui";
2
- declare const Dialog: import("react").FC<RadixDialog.DialogProps>;
3
- declare const DialogTrigger: import("react").ForwardRefExoticComponent<RadixDialog.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
4
- declare const DialogClose: import("react").ForwardRefExoticComponent<RadixDialog.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
5
- declare const DialogContent: import("react").ForwardRefExoticComponent<Omit<RadixDialog.DialogContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
6
- declare const DialogHeader: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
7
- declare const DialogTitle: import("react").ForwardRefExoticComponent<Omit<RadixDialog.DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
8
- declare const DialogDescription: import("react").ForwardRefExoticComponent<Omit<RadixDialog.DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
9
- declare const DialogFooter: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
1
+ import { Dialog as BaseDialog } from "@base-ui/react/dialog";
2
+ import type { ComponentProps } from "react";
3
+ declare const Dialog: typeof BaseDialog.Root;
4
+ declare const DialogTrigger: BaseDialog.Trigger;
5
+ declare const DialogClose: import("react").ForwardRefExoticComponent<import("@base-ui/react/dialog").DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
6
+ export type DialogOverlayProps = ComponentProps<typeof BaseDialog.Backdrop>;
7
+ export type DialogContentProps = ComponentProps<typeof BaseDialog.Popup>;
8
+ declare function DialogContent({ children, className, ref, ...props }: DialogContentProps): import("react/jsx-runtime").JSX.Element;
9
+ export type DialogHeaderProps = ComponentProps<"div">;
10
+ declare function DialogHeader({ className, ref, ...props }: DialogHeaderProps): import("react/jsx-runtime").JSX.Element;
11
+ export type DialogTitleProps = ComponentProps<typeof BaseDialog.Title>;
12
+ declare function DialogTitle({ className, ref, ...props }: DialogTitleProps): import("react/jsx-runtime").JSX.Element;
13
+ export type DialogDescriptionProps = ComponentProps<typeof BaseDialog.Description>;
14
+ declare function DialogDescription({ className, ref, ...props }: DialogDescriptionProps): import("react/jsx-runtime").JSX.Element;
15
+ export type DialogFooterProps = ComponentProps<"div">;
16
+ declare function DialogFooter({ className, ref, ...props }: DialogFooterProps): import("react/jsx-runtime").JSX.Element;
10
17
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, };
@@ -1,23 +1,28 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Dialog as BaseDialog } from "@base-ui/react/dialog";
2
3
  import { Cross1Icon } from "@radix-ui/react-icons";
3
4
  import { cn } from "../../utilities/cn/cn";
4
- import { Dialog as RadixDialog } from "radix-ui";
5
- import { forwardRef, } from "react";
6
- const Dialog = RadixDialog.Root;
7
- const DialogTrigger = RadixDialog.Trigger;
8
- const DialogClose = RadixDialog.Close;
9
- const DialogOverlay = forwardRef(({ className, ...props }, ref) => (_jsx(RadixDialog.Overlay, { ref: ref, className: cn("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-fade-out data-[state=closed]:animate-out data-[state=open]:animate-fade-in data-[state=open]:animate-in", className), ...props })));
10
- DialogOverlay.displayName = RadixDialog.Overlay.displayName;
11
- const DialogContent = forwardRef(({ children, className, ...props }, ref) => {
12
- return (_jsxs(DialogOverlay, { children: [_jsx(DialogOverlay, {}), _jsxs(RadixDialog.Content, { className: cn("-translate-x-1/2 -translate-y-1/2 fixed top-1/2 left-1/2 z-50 flex w-fit max-w-xl flex-col gap-4 rounded-lg bg-white p-4", className), ...props, ref: ref, children: [_jsx(DialogClose, { asChild: true, children: _jsx("button", { type: "button", className: "absolute top-4 right-4", children: _jsx(Cross1Icon, { className: "h-4 w-4" }) }) }), children] })] }));
13
- });
14
- const DialogHeader = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex flex-col gap-1", className), ...props })));
15
- DialogHeader.displayName = "DialogHeader";
16
- const DialogTitle = forwardRef(({ className, ...props }, ref) => (_jsx(RadixDialog.Title, { ref: ref, className: cn("font-semibold text-lg", className), ...props })));
17
- DialogTitle.displayName = "DialogTitle";
18
- const DialogDescription = forwardRef(({ className, ...props }, ref) => (_jsx(RadixDialog.Description, { ref: ref, className: cn("text-gray-500 text-sm", className), ...props })));
19
- DialogDescription.displayName = "DialogDescription";
20
- const DialogFooter = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex justify-end gap-2", className), ...props })));
21
- DialogFooter.displayName = "DialogFooter";
5
+ const Dialog = BaseDialog.Root;
6
+ const DialogTrigger = BaseDialog.Trigger;
7
+ const DialogClose = BaseDialog.Close;
8
+ const DialogPortal = BaseDialog.Portal;
9
+ function DialogOverlay({ className, ref, ...props }) {
10
+ return (_jsx(BaseDialog.Backdrop, { ref: ref, className: cn("fixed inset-0 z-50 bg-black/50 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0", className), ...props }));
11
+ }
12
+ function DialogContent({ children, className, ref, ...props }) {
13
+ return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(BaseDialog.Popup, { className: cn("fixed top-1/2 left-1/2 z-50 flex w-fit max-w-xl -translate-x-1/2 -translate-y-1/2 flex-col gap-4 rounded-lg bg-white p-4 transition-all duration-150 data-ending-style:scale-95 data-starting-style:scale-95 data-ending-style:opacity-0 data-starting-style:opacity-0", className), ...props, ref: ref, children: [_jsx(DialogClose, { className: "absolute top-4 right-4", children: _jsx(Cross1Icon, { className: "h-4 w-4" }) }), children] })] }));
14
+ }
15
+ function DialogHeader({ className, ref, ...props }) {
16
+ return (_jsx("div", { ref: ref, className: cn("flex flex-col gap-1", className), ...props }));
17
+ }
18
+ function DialogTitle({ className, ref, ...props }) {
19
+ return (_jsx(BaseDialog.Title, { ref: ref, className: cn("font-semibold text-lg", className), ...props }));
20
+ }
21
+ function DialogDescription({ className, ref, ...props }) {
22
+ return (_jsx(BaseDialog.Description, { ref: ref, className: cn("text-gray-500 text-sm", className), ...props }));
23
+ }
24
+ function DialogFooter({ className, ref, ...props }) {
25
+ return (_jsx("div", { ref: ref, className: cn("flex justify-end gap-2", className), ...props }));
26
+ }
22
27
  export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, };
23
28
  //# sourceMappingURL=dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","sourceRoot":"/","sources":["components/dialog/dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAGN,UAAU,GACV,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC;AAEhC,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,CAAC;AAE1C,MAAM,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC;AAEtC,MAAM,aAAa,GAAG,UAAU,CAG9B,CA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AAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,KAC7C,KAAK,GACR,CACF,CAAC,CAAC;AAEH,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAExC,MAAM,iBAAiB,GAAG,UAAU,CAGlC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACnC,KAAC,WAAW,CAAC,WAAW,IACvB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,KAC7C,KAAK,GACR,CACF,CAAC,CAAC;AAEH,iBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC;AAEpD,MAAM,YAAY,GAAG,UAAU,CAG7B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACnC,cACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,wBAAwB,EAAE,SAAS,CAAC,KAC9C,KAAK,GACR,CACF,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAC1C,OAAO,EACN,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,GACb,CAAC","sourcesContent":["import { Cross1Icon } from \"@radix-ui/react-icons\";\nimport { cn } from \"@utilities/cn/cn\";\nimport { Dialog as RadixDialog } from \"radix-ui\";\nimport {\n\ttype ComponentPropsWithoutRef,\n\ttype ComponentRef,\n\tforwardRef,\n} from \"react\";\n\nconst Dialog = RadixDialog.Root;\n\nconst DialogTrigger = RadixDialog.Trigger;\n\nconst DialogClose = RadixDialog.Close;\n\nconst DialogOverlay = forwardRef<\n\tComponentRef<typeof RadixDialog.Overlay>,\n\tComponentPropsWithoutRef<typeof RadixDialog.Overlay>\n>(({ className, ...props }, ref) => (\n\t<RadixDialog.Overlay\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-fade-out data-[state=closed]:animate-out data-[state=open]:animate-fade-in data-[state=open]:animate-in\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nDialogOverlay.displayName = RadixDialog.Overlay.displayName;\n\nconst DialogContent = forwardRef<\n\tComponentRef<typeof RadixDialog.Content>,\n\tComponentPropsWithoutRef<typeof RadixDialog.Content>\n>(({ children, className, ...props }, ref) => {\n\treturn (\n\t\t<DialogOverlay>\n\t\t\t<DialogOverlay />\n\t\t\t<RadixDialog.Content\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"-translate-x-1/2 -translate-y-1/2 fixed top-1/2 left-1/2 z-50 flex w-fit max-w-xl flex-col gap-4 rounded-lg bg-white p-4\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<DialogClose asChild>\n\t\t\t\t\t<button type=\"button\" className=\"absolute top-4 right-4\">\n\t\t\t\t\t\t<Cross1Icon className=\"h-4 w-4\" />\n\t\t\t\t\t</button>\n\t\t\t\t</DialogClose>\n\t\t\t\t{children}\n\t\t\t</RadixDialog.Content>\n\t\t</DialogOverlay>\n\t);\n});\n\nconst DialogHeader = forwardRef<\n\tHTMLDivElement,\n\tComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n\t<div ref={ref} className={cn(\"flex flex-col gap-1\", className)} {...props} />\n));\n\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogTitle = forwardRef<\n\tComponentRef<typeof RadixDialog.Title>,\n\tComponentPropsWithoutRef<typeof RadixDialog.Title>\n>(({ className, ...props }, ref) => (\n\t<RadixDialog.Title\n\t\tref={ref}\n\t\tclassName={cn(\"font-semibold text-lg\", className)}\n\t\t{...props}\n\t/>\n));\n\nDialogTitle.displayName = \"DialogTitle\";\n\nconst DialogDescription = forwardRef<\n\tComponentRef<typeof RadixDialog.Description>,\n\tComponentPropsWithoutRef<typeof RadixDialog.Description>\n>(({ className, ...props }, ref) => (\n\t<RadixDialog.Description\n\t\tref={ref}\n\t\tclassName={cn(\"text-gray-500 text-sm\", className)}\n\t\t{...props}\n\t/>\n));\n\nDialogDescription.displayName = \"DialogDescription\";\n\nconst DialogFooter = forwardRef<\n\tHTMLDivElement,\n\tComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n\t<div\n\t\tref={ref}\n\t\tclassName={cn(\"flex justify-end gap-2\", className)}\n\t\t{...props}\n\t/>\n));\n\nDialogFooter.displayName = \"DialogFooter\";\nexport {\n\tDialog,\n\tDialogClose,\n\tDialogContent,\n\tDialogDescription,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n};\n"]}
1
+ {"version":3,"file":"dialog.js","sourceRoot":"/","sources":["components/dialog/dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAGtC,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC;AAE/B,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,CAAC;AAEzC,MAAM,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC;AAErC,MAAM,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC;AAIvC,SAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAsB;IACtE,OAAO,CACN,KAAC,UAAU,CAAC,QAAQ,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,0HAA0H,EAC1H,SAAS,CACT,KACG,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAID,SAAS,aAAa,CAAC,EACtB,QAAQ,EACR,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACY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X,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,GACb,CAAC","sourcesContent":["import { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { Cross1Icon } from \"@radix-ui/react-icons\";\nimport { cn } from \"@utilities/cn/cn\";\nimport type { ComponentProps } from \"react\";\n\nconst Dialog = BaseDialog.Root;\n\nconst DialogTrigger = BaseDialog.Trigger;\n\nconst DialogClose = BaseDialog.Close;\n\nconst DialogPortal = BaseDialog.Portal;\n\nexport type DialogOverlayProps = ComponentProps<typeof BaseDialog.Backdrop>;\n\nfunction DialogOverlay({ className, ref, ...props }: DialogOverlayProps) {\n\treturn (\n\t\t<BaseDialog.Backdrop\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"fixed inset-0 z-50 bg-black/50 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DialogContentProps = ComponentProps<typeof BaseDialog.Popup>;\n\nfunction DialogContent({\n\tchildren,\n\tclassName,\n\tref,\n\t...props\n}: DialogContentProps) {\n\treturn (\n\t\t<DialogPortal>\n\t\t\t<DialogOverlay />\n\t\t\t<BaseDialog.Popup\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"fixed top-1/2 left-1/2 z-50 flex w-fit max-w-xl -translate-x-1/2 -translate-y-1/2 flex-col gap-4 rounded-lg bg-white p-4 transition-all duration-150 data-ending-style:scale-95 data-starting-style:scale-95 data-ending-style:opacity-0 data-starting-style:opacity-0\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<DialogClose className=\"absolute top-4 right-4\">\n\t\t\t\t\t<Cross1Icon className=\"h-4 w-4\" />\n\t\t\t\t</DialogClose>\n\t\t\t\t{children}\n\t\t\t</BaseDialog.Popup>\n\t\t</DialogPortal>\n\t);\n}\n\nexport type DialogHeaderProps = ComponentProps<\"div\">;\n\nfunction DialogHeader({ className, ref, ...props }: DialogHeaderProps) {\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"flex flex-col gap-1\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DialogTitleProps = ComponentProps<typeof BaseDialog.Title>;\n\nfunction DialogTitle({ className, ref, ...props }: DialogTitleProps) {\n\treturn (\n\t\t<BaseDialog.Title\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"font-semibold text-lg\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DialogDescriptionProps = ComponentProps<\n\ttypeof BaseDialog.Description\n>;\n\nfunction DialogDescription({\n\tclassName,\n\tref,\n\t...props\n}: DialogDescriptionProps) {\n\treturn (\n\t\t<BaseDialog.Description\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"text-gray-500 text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DialogFooterProps = ComponentProps<\"div\">;\n\nfunction DialogFooter({ className, ref, ...props }: DialogFooterProps) {\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"flex justify-end gap-2\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tDialog,\n\tDialogClose,\n\tDialogContent,\n\tDialogDescription,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n};\n"]}
@@ -1,16 +1,26 @@
1
- import { Dialog as RadixDialog } from "radix-ui";
1
+ import { Dialog as BaseDialog } from "@base-ui/react/dialog";
2
+ import type { ComponentProps } from "react";
2
3
  /**
3
4
  * Drawer Context
4
5
  */
5
6
  type DrawerContextValue = {
6
7
  side?: "left" | "right" | "top" | "bottom";
7
8
  };
8
- declare const Drawer: ({ children, side, ...props }: RadixDialog.DialogProps & DrawerContextValue) => import("react/jsx-runtime").JSX.Element;
9
- declare const DrawerTrigger: import("react").ForwardRefExoticComponent<RadixDialog.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
10
- declare const DrawerClose: import("react").ForwardRefExoticComponent<RadixDialog.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
11
- declare const DrawerContent: import("react").ForwardRefExoticComponent<Omit<RadixDialog.DialogContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
12
- declare const DrawerHeader: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
13
- declare const DrawerTitle: import("react").ForwardRefExoticComponent<Omit<RadixDialog.DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
14
- declare const DrawerDescription: import("react").ForwardRefExoticComponent<Omit<RadixDialog.DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
15
- declare const DrawerFooter: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
9
+ type DrawerProps = ComponentProps<typeof BaseDialog.Root> & DrawerContextValue;
10
+ declare function Drawer({ children, side, ...props }: DrawerProps): import("react/jsx-runtime").JSX.Element;
11
+ declare const DrawerTrigger: BaseDialog.Trigger;
12
+ declare const DrawerClose: import("react").ForwardRefExoticComponent<import("@base-ui/react/dialog").DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
13
+ export type DrawerOverlayProps = ComponentProps<typeof BaseDialog.Backdrop>;
14
+ export type DrawerContentProps = Omit<ComponentProps<typeof BaseDialog.Popup>, "className"> & {
15
+ className?: string;
16
+ };
17
+ declare function DrawerContent({ children, className, ref, ...props }: DrawerContentProps): import("react/jsx-runtime").JSX.Element;
18
+ export type DrawerHeaderProps = ComponentProps<"div">;
19
+ declare function DrawerHeader({ className, ref, ...props }: DrawerHeaderProps): import("react/jsx-runtime").JSX.Element;
20
+ export type DrawerTitleProps = ComponentProps<typeof BaseDialog.Title>;
21
+ declare function DrawerTitle({ className, ref, ...props }: DrawerTitleProps): import("react/jsx-runtime").JSX.Element;
22
+ export type DrawerDescriptionProps = ComponentProps<typeof BaseDialog.Description>;
23
+ declare function DrawerDescription({ className, ref, ...props }: DrawerDescriptionProps): import("react/jsx-runtime").JSX.Element;
24
+ export type DrawerFooterProps = ComponentProps<"div">;
25
+ declare function DrawerFooter({ className, ref, ...props }: DrawerFooterProps): import("react/jsx-runtime").JSX.Element;
16
26
  export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, };
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Dialog as BaseDialog } from "@base-ui/react/dialog";
2
3
  import { Cross1Icon } from "@radix-ui/react-icons";
3
4
  import { cn } from "../../utilities/cn/cn";
4
5
  import { getVariants } from "../../utilities/responsive/responsive";
5
- import { Dialog as RadixDialog } from "radix-ui";
6
- import { createContext, forwardRef, useContext, useMemo, } from "react";
6
+ import { createContext, useContext, useMemo } from "react";
7
7
  const DrawerContext = createContext(undefined);
8
8
  const useDrawerContext = () => {
9
9
  const context = useContext(DrawerContext);
@@ -12,38 +12,44 @@ const useDrawerContext = () => {
12
12
  }
13
13
  return context;
14
14
  };
15
- const Drawer = ({ children, side, ...props }) => {
15
+ function Drawer({ children, side, ...props }) {
16
16
  const contextValue = useMemo(() => ({
17
17
  side,
18
18
  }), [side]);
19
- return (_jsx(DrawerContext.Provider, { value: contextValue, children: _jsx(RadixDialog.Root, { ...props, children: children }) }));
20
- };
21
- const DrawerTrigger = RadixDialog.Trigger;
22
- const DrawerClose = RadixDialog.Close;
23
- const DrawerOverlay = forwardRef(({ className, ...props }, ref) => (_jsx(RadixDialog.Overlay, { ref: ref, className: cn("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-fade-out data-[state=closed]:animate-out data-[state=open]:animate-fade-in data-[state=open]:animate-in", className), ...props })));
24
- DrawerOverlay.displayName = RadixDialog.Overlay.displayName;
19
+ return (_jsx(DrawerContext.Provider, { value: contextValue, children: _jsx(BaseDialog.Root, { ...props, children: children }) }));
20
+ }
21
+ const DrawerTrigger = BaseDialog.Trigger;
22
+ const DrawerClose = BaseDialog.Close;
23
+ const DrawerPortal = BaseDialog.Portal;
24
+ function DrawerOverlay({ className, ref, ...props }) {
25
+ return (_jsx(BaseDialog.Backdrop, { ref: ref, className: cn("fixed inset-0 z-50 bg-black/50 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0", className), ...props }));
26
+ }
25
27
  const drawerContentStyles = getVariants({
26
- base: "fixed z-50 flex flex-col gap-4 bg-white p-4",
28
+ base: "fixed z-50 flex flex-col gap-4 bg-white p-4 transition-transform duration-300",
27
29
  variants: {
28
30
  side: {
29
- left: "left-0 h-screen w-fit rounded-r-lg data-[state=closed]:animate-slide-out-left data-[state=open]:animate-slide-in-left",
30
- right: "right-0 h-screen w-fit rounded-l-lg data-[state=closed]:animate-slide-out-right data-[state=open]:animate-slide-in-right",
31
- top: "top-0 h-fit w-screen rounded-b-lg data-[state=closed]:animate-slide-out-top data-[state=open]:animate-slide-in-top",
32
- bottom: "bottom-0 h-fit w-screen rounded-t-lg data-[state=closed]:animate-slide-out-bottom data-[state=open]:animate-slide-in-bottom",
31
+ left: "top-0 left-0 h-screen w-fit rounded-r-lg data-ending-style:-translate-x-full data-starting-style:-translate-x-full",
32
+ right: "top-0 right-0 h-screen w-fit rounded-l-lg data-ending-style:translate-x-full data-starting-style:translate-x-full",
33
+ top: "top-0 left-0 h-fit w-screen rounded-b-lg data-ending-style:-translate-y-full data-starting-style:-translate-y-full",
34
+ bottom: "bottom-0 left-0 h-fit w-screen rounded-t-lg data-ending-style:translate-y-full data-starting-style:translate-y-full",
33
35
  },
34
36
  },
35
37
  });
36
- const DrawerContent = forwardRef(({ children, className, ...props }, ref) => {
38
+ function DrawerContent({ children, className, ref, ...props }) {
37
39
  const { side = "right" } = useDrawerContext();
38
- return (_jsx(DrawerOverlay, { children: _jsxs(RadixDialog.Content, { className: drawerContentStyles({ side }), ...props, ref: ref, children: [_jsx(DrawerClose, { asChild: true, children: _jsx("button", { type: "button", className: "absolute top-4 right-4", children: _jsx(Cross1Icon, { className: "h-4 w-4" }) }) }), children] }) }));
39
- });
40
- const DrawerHeader = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex flex-col gap-1", className), ...props })));
41
- DrawerHeader.displayName = "DrawerHeader";
42
- const DrawerTitle = forwardRef(({ className, ...props }, ref) => (_jsx(RadixDialog.Title, { ref: ref, className: cn("font-semibold text-lg", className), ...props })));
43
- DrawerTitle.displayName = "DrawerTitle";
44
- const DrawerDescription = forwardRef(({ className, ...props }, ref) => (_jsx(RadixDialog.Description, { ref: ref, className: cn("text-gray-500 text-sm", className), ...props })));
45
- DrawerDescription.displayName = "DrawerDescription";
46
- const DrawerFooter = forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("flex justify-end gap-2", className), ...props })));
47
- DrawerFooter.displayName = "DrawerFooter";
40
+ return (_jsxs(DrawerPortal, { children: [_jsx(DrawerOverlay, {}), _jsxs(BaseDialog.Popup, { className: drawerContentStyles({ side, className }), ...props, ref: ref, children: [_jsx(DrawerClose, { className: "absolute top-4 right-4", children: _jsx(Cross1Icon, { className: "h-4 w-4" }) }), children] })] }));
41
+ }
42
+ function DrawerHeader({ className, ref, ...props }) {
43
+ return (_jsx("div", { ref: ref, className: cn("flex flex-col gap-1", className), ...props }));
44
+ }
45
+ function DrawerTitle({ className, ref, ...props }) {
46
+ return (_jsx(BaseDialog.Title, { ref: ref, className: cn("font-semibold text-lg", className), ...props }));
47
+ }
48
+ function DrawerDescription({ className, ref, ...props }) {
49
+ return (_jsx(BaseDialog.Description, { ref: ref, className: cn("text-gray-500 text-sm", className), ...props }));
50
+ }
51
+ function DrawerFooter({ className, ref, ...props }) {
52
+ return (_jsx("div", { ref: ref, className: cn("flex justify-end gap-2", className), ...props }));
53
+ }
48
54
  export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, };
49
55
  //# sourceMappingURL=drawer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","sourceRoot":"/","sources":["components/drawer/drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAGN,aAAa,EACb,UAAU,EACV,UAAU,EACV,OAAO,GACP,MAAM,OAAO,CAAC;AAUf,MAAM,aAAa,GAAG,aAAa,CAAiC,SAAS,CAAC,CAAC;AAE/E,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC7B,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,EACf,QAAQ,EACR,IAAI,EACJ,GAAG,KAAK,EACsC,EAAE,EAAE;IAClD,MAAM,YAAY,GAAG,OAAO,CAC3B,GAAG,EAAE,CAAC,CAAC;QACN,IAAI;KACJ,CAAC,EACF,CAAC,IAAI,CAAC,CACN,CAAC;IACF,OAAO,CACN,KAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAC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N,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,GACb,CAAC","sourcesContent":["import { Cross1Icon } from \"@radix-ui/react-icons\";\nimport { cn } from \"@utilities/cn/cn\";\nimport { getVariants } from \"@utilities/responsive/responsive\";\nimport { Dialog as RadixDialog } from \"radix-ui\";\nimport {\n\ttype ComponentPropsWithoutRef,\n\ttype ComponentRef,\n\tcreateContext,\n\tforwardRef,\n\tuseContext,\n\tuseMemo,\n} from \"react\";\n\n/**\n * Drawer Context\n */\n\ntype DrawerContextValue = {\n\tside?: \"left\" | \"right\" | \"top\" | \"bottom\";\n};\n\nconst DrawerContext = createContext<DrawerContextValue | undefined>(undefined);\n\nconst useDrawerContext = () => {\n\tconst context = useContext(DrawerContext);\n\tif (!context) {\n\t\tthrow new Error(\"Drawer components must be used within a Drawer\");\n\t}\n\treturn context;\n};\n\nconst Drawer = ({\n\tchildren,\n\tside,\n\t...props\n}: RadixDialog.DialogProps & DrawerContextValue) => {\n\tconst contextValue = useMemo(\n\t\t() => ({\n\t\t\tside,\n\t\t}),\n\t\t[side],\n\t);\n\treturn (\n\t\t<DrawerContext.Provider value={contextValue}>\n\t\t\t<RadixDialog.Root {...props}>{children}</RadixDialog.Root>\n\t\t</DrawerContext.Provider>\n\t);\n};\n\nconst DrawerTrigger = RadixDialog.Trigger;\n\nconst DrawerClose = RadixDialog.Close;\n\nconst DrawerOverlay = forwardRef<\n\tComponentRef<typeof RadixDialog.Overlay>,\n\tComponentPropsWithoutRef<typeof RadixDialog.Overlay>\n>(({ className, ...props }, ref) => (\n\t<RadixDialog.Overlay\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-fade-out data-[state=closed]:animate-out data-[state=open]:animate-fade-in data-[state=open]:animate-in\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nDrawerOverlay.displayName = RadixDialog.Overlay.displayName;\n\nconst drawerContentStyles = getVariants({\n\tbase: \"fixed z-50 flex flex-col gap-4 bg-white p-4\",\n\tvariants: {\n\t\tside: {\n\t\t\tleft: \"left-0 h-screen w-fit rounded-r-lg data-[state=closed]:animate-slide-out-left data-[state=open]:animate-slide-in-left\",\n\t\t\tright:\n\t\t\t\t\"right-0 h-screen w-fit rounded-l-lg data-[state=closed]:animate-slide-out-right data-[state=open]:animate-slide-in-right\",\n\t\t\ttop: \"top-0 h-fit w-screen rounded-b-lg data-[state=closed]:animate-slide-out-top data-[state=open]:animate-slide-in-top\",\n\t\t\tbottom:\n\t\t\t\t\"bottom-0 h-fit w-screen rounded-t-lg data-[state=closed]:animate-slide-out-bottom data-[state=open]:animate-slide-in-bottom\",\n\t\t},\n\t},\n});\n\nconst DrawerContent = forwardRef<\n\tComponentRef<typeof RadixDialog.Content>,\n\tComponentPropsWithoutRef<typeof RadixDialog.Content>\n>(({ children, className, ...props }, ref) => {\n\tconst { side = \"right\" } = useDrawerContext();\n\treturn (\n\t\t<DrawerOverlay>\n\t\t\t<RadixDialog.Content\n\t\t\t\tclassName={drawerContentStyles({ side })}\n\t\t\t\t{...props}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<DrawerClose asChild>\n\t\t\t\t\t<button type=\"button\" className=\"absolute top-4 right-4\">\n\t\t\t\t\t\t<Cross1Icon className=\"h-4 w-4\" />\n\t\t\t\t\t</button>\n\t\t\t\t</DrawerClose>\n\t\t\t\t{children}\n\t\t\t</RadixDialog.Content>\n\t\t</DrawerOverlay>\n\t);\n});\n\nconst DrawerHeader = forwardRef<\n\tHTMLDivElement,\n\tComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n\t<div ref={ref} className={cn(\"flex flex-col gap-1\", className)} {...props} />\n));\n\nDrawerHeader.displayName = \"DrawerHeader\";\n\nconst DrawerTitle = forwardRef<\n\tComponentRef<typeof RadixDialog.Title>,\n\tComponentPropsWithoutRef<typeof RadixDialog.Title>\n>(({ className, ...props }, ref) => (\n\t<RadixDialog.Title\n\t\tref={ref}\n\t\tclassName={cn(\"font-semibold text-lg\", className)}\n\t\t{...props}\n\t/>\n));\n\nDrawerTitle.displayName = \"DrawerTitle\";\n\nconst DrawerDescription = forwardRef<\n\tComponentRef<typeof RadixDialog.Description>,\n\tComponentPropsWithoutRef<typeof RadixDialog.Description>\n>(({ className, ...props }, ref) => (\n\t<RadixDialog.Description\n\t\tref={ref}\n\t\tclassName={cn(\"text-gray-500 text-sm\", className)}\n\t\t{...props}\n\t/>\n));\n\nDrawerDescription.displayName = \"DrawerDescription\";\n\nconst DrawerFooter = forwardRef<\n\tHTMLDivElement,\n\tComponentPropsWithoutRef<\"div\">\n>(({ className, ...props }, ref) => (\n\t<div\n\t\tref={ref}\n\t\tclassName={cn(\"flex justify-end gap-2\", className)}\n\t\t{...props}\n\t/>\n));\n\nDrawerFooter.displayName = \"DrawerFooter\";\n\nexport {\n\tDrawer,\n\tDrawerClose,\n\tDrawerContent,\n\tDrawerDescription,\n\tDrawerFooter,\n\tDrawerHeader,\n\tDrawerTitle,\n\tDrawerTrigger,\n};\n"]}
1
+ {"version":3,"file":"drawer.js","sourceRoot":"/","sources":["components/drawer/drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAU3D,MAAM,aAAa,GAAG,aAAa,CAAiC,SAAS,CAAC,CAAC;AAE/E,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC7B,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IAC1C,IAAI,CAAC,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WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,GACb,CAAC","sourcesContent":["import { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { Cross1Icon } from \"@radix-ui/react-icons\";\nimport { cn } from \"@utilities/cn/cn\";\nimport { getVariants } from \"@utilities/responsive/responsive\";\nimport type { ComponentProps } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\n/**\n * Drawer Context\n */\n\ntype DrawerContextValue = {\n\tside?: \"left\" | \"right\" | \"top\" | \"bottom\";\n};\n\nconst DrawerContext = createContext<DrawerContextValue | undefined>(undefined);\n\nconst useDrawerContext = () => {\n\tconst context = useContext(DrawerContext);\n\tif (!context) {\n\t\tthrow new Error(\"Drawer components must be used within a Drawer\");\n\t}\n\treturn context;\n};\n\ntype DrawerProps = ComponentProps<typeof BaseDialog.Root> & DrawerContextValue;\n\nfunction Drawer({ children, side, ...props }: DrawerProps) {\n\tconst contextValue = useMemo(\n\t\t() => ({\n\t\t\tside,\n\t\t}),\n\t\t[side],\n\t);\n\treturn (\n\t\t<DrawerContext.Provider value={contextValue}>\n\t\t\t<BaseDialog.Root {...props}>{children}</BaseDialog.Root>\n\t\t</DrawerContext.Provider>\n\t);\n}\n\nconst DrawerTrigger = BaseDialog.Trigger;\n\nconst DrawerClose = BaseDialog.Close;\n\nconst DrawerPortal = BaseDialog.Portal;\n\nexport type DrawerOverlayProps = ComponentProps<typeof BaseDialog.Backdrop>;\n\nfunction DrawerOverlay({ className, ref, ...props }: DrawerOverlayProps) {\n\treturn (\n\t\t<BaseDialog.Backdrop\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"fixed inset-0 z-50 bg-black/50 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nconst drawerContentStyles = getVariants({\n\tbase: \"fixed z-50 flex flex-col gap-4 bg-white p-4 transition-transform duration-300\",\n\tvariants: {\n\t\tside: {\n\t\t\tleft: \"top-0 left-0 h-screen w-fit rounded-r-lg data-ending-style:-translate-x-full data-starting-style:-translate-x-full\",\n\t\t\tright:\n\t\t\t\t\"top-0 right-0 h-screen w-fit rounded-l-lg data-ending-style:translate-x-full data-starting-style:translate-x-full\",\n\t\t\ttop: \"top-0 left-0 h-fit w-screen rounded-b-lg data-ending-style:-translate-y-full data-starting-style:-translate-y-full\",\n\t\t\tbottom:\n\t\t\t\t\"bottom-0 left-0 h-fit w-screen rounded-t-lg data-ending-style:translate-y-full data-starting-style:translate-y-full\",\n\t\t},\n\t},\n});\n\nexport type DrawerContentProps = Omit<\n\tComponentProps<typeof BaseDialog.Popup>,\n\t\"className\"\n> & {\n\tclassName?: string;\n};\n\nfunction DrawerContent({\n\tchildren,\n\tclassName,\n\tref,\n\t...props\n}: DrawerContentProps) {\n\tconst { side = \"right\" } = useDrawerContext();\n\treturn (\n\t\t<DrawerPortal>\n\t\t\t<DrawerOverlay />\n\t\t\t<BaseDialog.Popup\n\t\t\t\tclassName={drawerContentStyles({ side, className })}\n\t\t\t\t{...props}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<DrawerClose className=\"absolute top-4 right-4\">\n\t\t\t\t\t<Cross1Icon className=\"h-4 w-4\" />\n\t\t\t\t</DrawerClose>\n\t\t\t\t{children}\n\t\t\t</BaseDialog.Popup>\n\t\t</DrawerPortal>\n\t);\n}\n\nexport type DrawerHeaderProps = ComponentProps<\"div\">;\n\nfunction DrawerHeader({ className, ref, ...props }: DrawerHeaderProps) {\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"flex flex-col gap-1\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DrawerTitleProps = ComponentProps<typeof BaseDialog.Title>;\n\nfunction DrawerTitle({ className, ref, ...props }: DrawerTitleProps) {\n\treturn (\n\t\t<BaseDialog.Title\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"font-semibold text-lg\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DrawerDescriptionProps = ComponentProps<\n\ttypeof BaseDialog.Description\n>;\n\nfunction DrawerDescription({\n\tclassName,\n\tref,\n\t...props\n}: DrawerDescriptionProps) {\n\treturn (\n\t\t<BaseDialog.Description\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"text-gray-500 text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DrawerFooterProps = ComponentProps<\"div\">;\n\nfunction DrawerFooter({ className, ref, ...props }: DrawerFooterProps) {\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"flex justify-end gap-2\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tDrawer,\n\tDrawerClose,\n\tDrawerContent,\n\tDrawerDescription,\n\tDrawerFooter,\n\tDrawerHeader,\n\tDrawerTitle,\n\tDrawerTrigger,\n};\n"]}
@@ -1,26 +1,35 @@
1
- import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
2
- declare const DropdownMenu: import("react").FC<DropdownMenuPrimitive.DropdownMenuProps>;
3
- declare const DropdownMenuTrigger: import("react").ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
4
- declare const DropdownMenuGroup: import("react").ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & import("react").RefAttributes<HTMLDivElement>>;
5
- declare const DropdownMenuPortal: import("react").FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
6
- declare const DropdownMenuSub: import("react").FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
7
- declare const DropdownMenuRadioGroup: import("react").ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
8
- declare const DropdownMenuSubTrigger: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
1
+ import { Menu } from "@base-ui/react/menu";
2
+ import type { ComponentProps } from "react";
3
+ declare const DropdownMenu: typeof Menu.Root;
4
+ export type DropdownMenuTriggerProps = ComponentProps<typeof Menu.Trigger>;
5
+ declare function DropdownMenuTrigger({ className, ref, ...props }: DropdownMenuTriggerProps): import("react/jsx-runtime").JSX.Element;
6
+ declare const DropdownMenuGroup: import("react").ForwardRefExoticComponent<import("@base-ui/react/menu").MenuGroupProps & import("react").RefAttributes<Element>>;
7
+ declare const DropdownMenuPortal: import("react").ForwardRefExoticComponent<import("@base-ui/react/menu").MenuPortalProps & import("react").RefAttributes<HTMLDivElement>>;
8
+ declare const DropdownMenuSub: typeof Menu.SubmenuRoot;
9
+ declare const DropdownMenuRadioGroup: import("react").NamedExoticComponent<import("@base-ui/react/menu").MenuRadioGroupProps & import("react").RefAttributes<Element>>;
10
+ export type DropdownMenuSubTriggerProps = ComponentProps<typeof Menu.SubmenuTrigger> & {
9
11
  inset?: boolean;
10
- } & import("react").RefAttributes<HTMLDivElement>>;
11
- declare const DropdownMenuSubContent: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
12
- declare const DropdownMenuContent: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
13
- declare const DropdownMenuItem: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
12
+ };
13
+ declare function DropdownMenuSubTrigger({ className, inset, children, ref, ...props }: DropdownMenuSubTriggerProps): import("react/jsx-runtime").JSX.Element;
14
+ export type DropdownMenuSubContentProps = ComponentProps<typeof Menu.Popup>;
15
+ declare function DropdownMenuSubContent({ className, ref, ...props }: DropdownMenuSubContentProps): import("react/jsx-runtime").JSX.Element;
16
+ export type DropdownMenuContentProps = ComponentProps<typeof Menu.Popup> & {
17
+ sideOffset?: number;
18
+ };
19
+ declare function DropdownMenuContent({ className, sideOffset, ref, ...props }: DropdownMenuContentProps): import("react/jsx-runtime").JSX.Element;
20
+ export type DropdownMenuItemProps = ComponentProps<typeof Menu.Item> & {
14
21
  inset?: boolean;
15
- } & import("react").RefAttributes<HTMLDivElement>>;
16
- declare const DropdownMenuCheckboxItem: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
17
- declare const DropdownMenuRadioItem: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
18
- declare const DropdownMenuLabel: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
22
+ };
23
+ declare function DropdownMenuItem({ className, inset, ref, ...props }: DropdownMenuItemProps): import("react/jsx-runtime").JSX.Element;
24
+ export type DropdownMenuCheckboxItemProps = ComponentProps<typeof Menu.CheckboxItem>;
25
+ declare function DropdownMenuCheckboxItem({ className, children, checked, onCheckedChange, ref, ...props }: DropdownMenuCheckboxItemProps): import("react/jsx-runtime").JSX.Element;
26
+ export type DropdownMenuRadioItemProps = ComponentProps<typeof Menu.RadioItem>;
27
+ declare function DropdownMenuRadioItem({ className, children, ref, ...props }: DropdownMenuRadioItemProps): import("react/jsx-runtime").JSX.Element;
28
+ export type DropdownMenuLabelProps = ComponentProps<typeof Menu.GroupLabel> & {
19
29
  inset?: boolean;
20
- } & import("react").RefAttributes<HTMLDivElement>>;
21
- declare const DropdownMenuSeparator: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
22
- declare const DropdownMenuShortcut: {
23
- ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
24
- displayName: string;
25
30
  };
31
+ declare function DropdownMenuLabel({ className, inset, ref, ...props }: DropdownMenuLabelProps): import("react/jsx-runtime").JSX.Element;
32
+ export type DropdownMenuSeparatorProps = ComponentProps<typeof Menu.Separator>;
33
+ declare function DropdownMenuSeparator({ className, ref, ...props }: DropdownMenuSeparatorProps): import("react/jsx-runtime").JSX.Element;
34
+ declare function DropdownMenuShortcut({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
26
35
  export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
@@ -1,36 +1,41 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Menu } from "@base-ui/react/menu";
2
3
  import { CheckIcon, ChevronRightIcon, CircleIcon } from "@radix-ui/react-icons";
3
4
  import { cn } from "../../utilities/cn/cn";
4
- import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
5
- import { forwardRef, } from "react";
6
- const DropdownMenu = DropdownMenuPrimitive.Root;
7
- const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
8
- const DropdownMenuGroup = DropdownMenuPrimitive.Group;
9
- const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
10
- const DropdownMenuSub = DropdownMenuPrimitive.Sub;
11
- const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
12
- const DropdownMenuSubTrigger = forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus-visible:bg-gray-200 focus-visible:text-gray-700 data-[state=open]:bg-gray-200 data-[state=open]:text-gray-900 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto" })] })));
13
- DropdownMenuSubTrigger.displayName =
14
- DropdownMenuPrimitive.SubTrigger.displayName;
15
- const DropdownMenuSubContent = forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cn("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 z-50 min-w-[8rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-hidden rounded-md border border-gray-200 bg-gray-50 p-1 text-gray-700 shadow-lg data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in", className), ...props })));
16
- DropdownMenuSubContent.displayName =
17
- DropdownMenuPrimitive.SubContent.displayName;
18
- const DropdownMenuContent = forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cn("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border border-gray-200 bg-gray-50 p-1 text-gray-700 shadow-md", "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 origin-[--radix-dropdown-menu-content-transform-origin] data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in", className), ...props }) })));
19
- DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
20
- const DropdownMenuItem = forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Item, { ref: ref, className: cn("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus-visible:bg-gray-200 focus-visible:text-gray-700 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0", inset && "pl-8", className), ...props })));
21
- DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
22
- const DropdownMenuCheckboxItem = 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 pr-2 pl-8 text-sm outline-none transition-colors focus-visible:bg-gray-200 focus-visible:text-gray-700 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] })));
23
- DropdownMenuCheckboxItem.displayName =
24
- DropdownMenuPrimitive.CheckboxItem.displayName;
25
- const DropdownMenuRadioItem = 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 pr-2 pl-8 text-sm outline-none transition-colors focus-visible:bg-gray-200 focus-visible:text-gray-900 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(CircleIcon, { className: "h-2 w-2 fill-current" }) }) }), children] })));
26
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
27
- const DropdownMenuLabel = forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Label, { ref: ref, className: cn("px-2 py-1.5 font-semibold text-sm", inset && "pl-8", className), ...props })));
28
- DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
29
- const DropdownMenuSeparator = forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Separator, { ref: ref, className: cn("-mx-1 my-1 h-px bg-gray-200", className), ...props })));
30
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
31
- const DropdownMenuShortcut = ({ className, ...props }) => {
5
+ const DropdownMenu = Menu.Root;
6
+ function DropdownMenuTrigger({ className, ref, ...props }) {
7
+ return _jsx(Menu.Trigger, { ref: ref, className: className, ...props });
8
+ }
9
+ const DropdownMenuGroup = Menu.Group;
10
+ const DropdownMenuPortal = Menu.Portal;
11
+ const DropdownMenuSub = Menu.SubmenuRoot;
12
+ const DropdownMenuRadioGroup = Menu.RadioGroup;
13
+ function DropdownMenuSubTrigger({ className, inset, children, ref, ...props }) {
14
+ return (_jsxs(Menu.SubmenuTrigger, { ref: ref, className: cn("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-highlighted:bg-gray-200 data-popup-open:bg-gray-200 data-highlighted:text-gray-700 data-popup-open:text-gray-900 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRightIcon, { className: "ml-auto" })] }));
15
+ }
16
+ function DropdownMenuSubContent({ className, ref, ...props }) {
17
+ return (_jsx(Menu.Portal, { children: _jsx(Menu.Positioner, { children: _jsx(Menu.Popup, { ref: ref, className: cn("data-[starting-style]:zoom-out-95 data-[ending-style]:zoom-out-95 data-[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 z-50 min-w-32 origin-[--transform-origin] overflow-hidden rounded-md border border-gray-200 bg-gray-50 p-1 text-gray-700 shadow-lg data-ending-style:animate-fade-out data-starting-style:animate-fade-in", className), ...props }) }) }));
18
+ }
19
+ function DropdownMenuContent({ className, sideOffset = 4, ref, ...props }) {
20
+ return (_jsx(Menu.Portal, { children: _jsx(Menu.Positioner, { sideOffset: sideOffset, children: _jsx(Menu.Popup, { ref: ref, className: cn("z-50 max-h-(--available-height) min-w-32 overflow-y-auto overflow-x-hidden rounded-md border border-gray-200 bg-gray-50 p-1 text-gray-700 shadow-md", "data-[ending-style]:zoom-out-95 data-[starting-style]:zoom-out-95 data-[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 origin-[--transform-origin] data-ending-style:animate-fade-out data-starting-style:animate-fade-in", className), ...props }) }) }));
21
+ }
22
+ function DropdownMenuItem({ className, inset, ref, ...props }) {
23
+ return (_jsx(Menu.Item, { ref: ref, className: cn("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-disabled:pointer-events-none data-highlighted:bg-gray-200 data-highlighted:text-gray-700 data-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0", inset && "pl-8", className), ...props }));
24
+ }
25
+ function DropdownMenuCheckboxItem({ className, children, checked, onCheckedChange, ref, ...props }) {
26
+ return (_jsxs(Menu.CheckboxItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none transition-colors data-disabled:pointer-events-none data-highlighted:bg-gray-200 data-highlighted:text-gray-700 data-disabled:opacity-50", className), checked: checked, onCheckedChange: onCheckedChange, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(Menu.CheckboxItemIndicator, { children: _jsx(CheckIcon, { className: "h-4 w-4" }) }) }), children] }));
27
+ }
28
+ function DropdownMenuRadioItem({ className, children, ref, ...props }) {
29
+ return (_jsxs(Menu.RadioItem, { ref: ref, className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none transition-colors data-disabled:pointer-events-none data-highlighted:bg-gray-200 data-highlighted:text-gray-900 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(Menu.RadioItemIndicator, { children: _jsx(CircleIcon, { className: "h-2 w-2 fill-current" }) }) }), children] }));
30
+ }
31
+ function DropdownMenuLabel({ className, inset, ref, ...props }) {
32
+ return (_jsx(Menu.Group, { children: _jsx(Menu.GroupLabel, { ref: ref, className: cn("px-2 py-1.5 font-semibold text-sm", inset && "pl-8", className), ...props }) }));
33
+ }
34
+ function DropdownMenuSeparator({ className, ref, ...props }) {
35
+ return (_jsx(Menu.Separator, { ref: ref, className: cn("-mx-1 my-1 h-px bg-gray-200", className), ...props }));
36
+ }
37
+ function DropdownMenuShortcut({ className, ...props }) {
32
38
  return (_jsx("span", { className: cn("ml-auto text-xs tracking-widest opacity-60", className), ...props }));
33
- };
34
- DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
39
+ }
35
40
  export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
36
41
  //# sourceMappingURL=dropdown-menu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","sourceRoot":"/","sources":["components/dropdown-menu/dropdown-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OA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,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EAC+B,EAAE,EAAE;IAC3C,OAAO,CACN,eACC,SAAS,EAAE,EAAE,CAAC,4CAA4C,EAAE,SAAS,CAAC,KAClE,KAAK,GACR,CACF,CAAC;AACH,CAAC,CAAC;AACF,oBAAoB,CAAC,WAAW,GAAG,sBAAsB,CAAC;AAE1D,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACtB,CAAC","sourcesContent":["import { CheckIcon, ChevronRightIcon, CircleIcon } from \"@radix-ui/react-icons\";\nimport { cn } from \"@utilities/cn/cn\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport {\n\ttype ComponentPropsWithoutRef,\n\ttype ComponentRef,\n\tforwardRef,\n} from \"react\";\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n\t\tinset?: boolean;\n\t}\n>(({ className, inset, children, ...props }, ref) => (\n\t<DropdownMenuPrimitive.SubTrigger\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus-visible:bg-gray-200 focus-visible:text-gray-700 data-[state=open]:bg-gray-200 data-[state=open]:text-gray-900 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n\t\t\tinset && \"pl-8\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t>\n\t\t{children}\n\t\t<ChevronRightIcon className=\"ml-auto\" />\n\t</DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n\tDropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n\t<DropdownMenuPrimitive.SubContent\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"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 z-50 min-w-[8rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-hidden rounded-md border border-gray-200 bg-gray-50 p-1 text-gray-700 shadow-lg data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nDropdownMenuSubContent.displayName =\n\tDropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.Content>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n\t<DropdownMenuPrimitive.Portal>\n\t\t<DropdownMenuPrimitive.Content\n\t\t\tref={ref}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={cn(\n\t\t\t\t\"z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border border-gray-200 bg-gray-50 p-1 text-gray-700 shadow-md\",\n\t\t\t\t\"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 origin-[--radix-dropdown-menu-content-transform-origin] data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t</DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.Item>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n\t\tinset?: boolean;\n\t}\n>(({ className, inset, ...props }, ref) => (\n\t<DropdownMenuPrimitive.Item\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus-visible:bg-gray-200 focus-visible:text-gray-700 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0\",\n\t\t\tinset && \"pl-8\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n\t<DropdownMenuPrimitive.CheckboxItem\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"relative flex cursor-default select-none items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none transition-colors focus-visible:bg-gray-200 focus-visible:text-gray-700 data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n\t\t\tclassName,\n\t\t)}\n\t\tchecked={checked}\n\t\t{...props}\n\t>\n\t\t<span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n\t\t\t<DropdownMenuPrimitive.ItemIndicator>\n\t\t\t\t<CheckIcon className=\"h-4 w-4\" />\n\t\t\t</DropdownMenuPrimitive.ItemIndicator>\n\t\t</span>\n\t\t{children}\n\t</DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n\tDropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n\t<DropdownMenuPrimitive.RadioItem\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"relative flex cursor-default select-none items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none transition-colors focus-visible:bg-gray-200 focus-visible:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t>\n\t\t<span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n\t\t\t<DropdownMenuPrimitive.ItemIndicator>\n\t\t\t\t<CircleIcon className=\"h-2 w-2 fill-current\" />\n\t\t\t</DropdownMenuPrimitive.ItemIndicator>\n\t\t</span>\n\t\t{children}\n\t</DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.Label>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n\t\tinset?: boolean;\n\t}\n>(({ className, inset, ...props }, ref) => (\n\t<DropdownMenuPrimitive.Label\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"px-2 py-1.5 font-semibold text-sm\",\n\t\t\tinset && \"pl-8\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.Separator>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n\t<DropdownMenuPrimitive.Separator\n\t\tref={ref}\n\t\tclassName={cn(\"-mx-1 my-1 h-px bg-gray-200\", className)}\n\t\t{...props}\n\t/>\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n\tclassName,\n\t...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n\treturn (\n\t\t<span\n\t\t\tclassName={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nexport {\n\tDropdownMenu,\n\tDropdownMenuTrigger,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuCheckboxItem,\n\tDropdownMenuRadioItem,\n\tDropdownMenuLabel,\n\tDropdownMenuSeparator,\n\tDropdownMenuShortcut,\n\tDropdownMenuGroup,\n\tDropdownMenuPortal,\n\tDropdownMenuSub,\n\tDropdownMenuSubContent,\n\tDropdownMenuSubTrigger,\n\tDropdownMenuRadioGroup,\n};\n"]}
1
+ {"version":3,"file":"dropdown-menu.js","sourceRoot":"/","sources":["components/dropdown-menu/dropdown-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAGtC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC;AAI/B,SAAS,mBAAmB,CAAC,EAC5B,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AS,iBAAiB,CAAC,EAC1B,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACgB;IACxB,OAAO,CACN,KAAC,IAAI,CAAC,KAAK,cACV,KAAC,IAAI,CAAC,UAAU,IACf,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,mCAAmC,EACnC,KAAK,IAAI,MAAM,EACf,SAAS,CACT,KACG,KAAK,GACR,GACU,CACb,CAAC;AACH,CAAC;AAID,SAAS,qBAAqB,CAAC,EAC9B,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACoB;IAC5B,OAAO,CACN,KAAC,IAAI,CAAC,SAAS,IACd,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,6BAA6B,EAAE,SAAS,CAAC,KACnD,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EAC+B;IACvC,OAAO,CACN,eACC,SAAS,EAAE,EAAE,CAAC,4CAA4C,EAAE,SAAS,CAAC,KAClE,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAED,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACtB,CAAC","sourcesContent":["import { Menu } from \"@base-ui/react/menu\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"@radix-ui/react-icons\";\nimport { cn } from \"@utilities/cn/cn\";\nimport type { ComponentProps } from \"react\";\n\nconst DropdownMenu = Menu.Root;\n\nexport type DropdownMenuTriggerProps = ComponentProps<typeof Menu.Trigger>;\n\nfunction DropdownMenuTrigger({\n\tclassName,\n\tref,\n\t...props\n}: DropdownMenuTriggerProps) {\n\treturn <Menu.Trigger ref={ref} className={className} {...props} />;\n}\n\nconst DropdownMenuGroup = Menu.Group;\n\nconst DropdownMenuPortal = Menu.Portal;\n\nconst DropdownMenuSub = Menu.SubmenuRoot;\n\nconst DropdownMenuRadioGroup = Menu.RadioGroup;\n\nexport type DropdownMenuSubTriggerProps = ComponentProps<\n\ttypeof Menu.SubmenuTrigger\n> & {\n\tinset?: boolean;\n};\n\nfunction DropdownMenuSubTrigger({\n\tclassName,\n\tinset,\n\tchildren,\n\tref,\n\t...props\n}: DropdownMenuSubTriggerProps) {\n\treturn (\n\t\t<Menu.SubmenuTrigger\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-highlighted:bg-gray-200 data-popup-open:bg-gray-200 data-highlighted:text-gray-700 data-popup-open:text-gray-900 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n\t\t\t\tinset && \"pl-8\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<ChevronRightIcon className=\"ml-auto\" />\n\t\t</Menu.SubmenuTrigger>\n\t);\n}\n\nexport type DropdownMenuSubContentProps = ComponentProps<typeof Menu.Popup>;\n\nfunction DropdownMenuSubContent({\n\tclassName,\n\tref,\n\t...props\n}: DropdownMenuSubContentProps) {\n\treturn (\n\t\t<Menu.Portal>\n\t\t\t<Menu.Positioner>\n\t\t\t\t<Menu.Popup\n\t\t\t\t\tref={ref}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"data-[starting-style]:zoom-out-95 data-[ending-style]:zoom-out-95 data-[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 z-50 min-w-32 origin-[--transform-origin] overflow-hidden rounded-md border border-gray-200 bg-gray-50 p-1 text-gray-700 shadow-lg data-ending-style:animate-fade-out data-starting-style:animate-fade-in\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</Menu.Positioner>\n\t\t</Menu.Portal>\n\t);\n}\n\nexport type DropdownMenuContentProps = ComponentProps<typeof Menu.Popup> & {\n\tsideOffset?: number;\n};\n\nfunction DropdownMenuContent({\n\tclassName,\n\tsideOffset = 4,\n\tref,\n\t...props\n}: DropdownMenuContentProps) {\n\treturn (\n\t\t<Menu.Portal>\n\t\t\t<Menu.Positioner sideOffset={sideOffset}>\n\t\t\t\t<Menu.Popup\n\t\t\t\t\tref={ref}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"z-50 max-h-(--available-height) min-w-32 overflow-y-auto overflow-x-hidden rounded-md border border-gray-200 bg-gray-50 p-1 text-gray-700 shadow-md\",\n\t\t\t\t\t\t\"data-[ending-style]:zoom-out-95 data-[starting-style]:zoom-out-95 data-[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 origin-[--transform-origin] data-ending-style:animate-fade-out data-starting-style:animate-fade-in\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</Menu.Positioner>\n\t\t</Menu.Portal>\n\t);\n}\n\nexport type DropdownMenuItemProps = ComponentProps<typeof Menu.Item> & {\n\tinset?: boolean;\n};\n\nfunction DropdownMenuItem({\n\tclassName,\n\tinset,\n\tref,\n\t...props\n}: DropdownMenuItemProps) {\n\treturn (\n\t\t<Menu.Item\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-disabled:pointer-events-none data-highlighted:bg-gray-200 data-highlighted:text-gray-700 data-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0\",\n\t\t\t\tinset && \"pl-8\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DropdownMenuCheckboxItemProps = ComponentProps<\n\ttypeof Menu.CheckboxItem\n>;\n\nfunction DropdownMenuCheckboxItem({\n\tclassName,\n\tchildren,\n\tchecked,\n\tonCheckedChange,\n\tref,\n\t...props\n}: DropdownMenuCheckboxItemProps) {\n\treturn (\n\t\t<Menu.CheckboxItem\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex cursor-default select-none items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none transition-colors data-disabled:pointer-events-none data-highlighted:bg-gray-200 data-highlighted:text-gray-700 data-disabled:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tchecked={checked}\n\t\t\tonCheckedChange={onCheckedChange}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n\t\t\t\t<Menu.CheckboxItemIndicator>\n\t\t\t\t\t<CheckIcon className=\"h-4 w-4\" />\n\t\t\t\t</Menu.CheckboxItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</Menu.CheckboxItem>\n\t);\n}\n\nexport type DropdownMenuRadioItemProps = ComponentProps<typeof Menu.RadioItem>;\n\nfunction DropdownMenuRadioItem({\n\tclassName,\n\tchildren,\n\tref,\n\t...props\n}: DropdownMenuRadioItemProps) {\n\treturn (\n\t\t<Menu.RadioItem\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex cursor-default select-none items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none transition-colors data-disabled:pointer-events-none data-highlighted:bg-gray-200 data-highlighted:text-gray-900 data-disabled:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n\t\t\t\t<Menu.RadioItemIndicator>\n\t\t\t\t\t<CircleIcon className=\"h-2 w-2 fill-current\" />\n\t\t\t\t</Menu.RadioItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</Menu.RadioItem>\n\t);\n}\n\nexport type DropdownMenuLabelProps = ComponentProps<typeof Menu.GroupLabel> & {\n\tinset?: boolean;\n};\n\nfunction DropdownMenuLabel({\n\tclassName,\n\tinset,\n\tref,\n\t...props\n}: DropdownMenuLabelProps) {\n\treturn (\n\t\t<Menu.Group>\n\t\t\t<Menu.GroupLabel\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"px-2 py-1.5 font-semibold text-sm\",\n\t\t\t\t\tinset && \"pl-8\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</Menu.Group>\n\t);\n}\n\nexport type DropdownMenuSeparatorProps = ComponentProps<typeof Menu.Separator>;\n\nfunction DropdownMenuSeparator({\n\tclassName,\n\tref,\n\t...props\n}: DropdownMenuSeparatorProps) {\n\treturn (\n\t\t<Menu.Separator\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"-mx-1 my-1 h-px bg-gray-200\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuShortcut({\n\tclassName,\n\t...props\n}: React.HTMLAttributes<HTMLSpanElement>) {\n\treturn (\n\t\t<span\n\t\t\tclassName={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tDropdownMenu,\n\tDropdownMenuTrigger,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuCheckboxItem,\n\tDropdownMenuRadioItem,\n\tDropdownMenuLabel,\n\tDropdownMenuSeparator,\n\tDropdownMenuShortcut,\n\tDropdownMenuGroup,\n\tDropdownMenuPortal,\n\tDropdownMenuSub,\n\tDropdownMenuSubContent,\n\tDropdownMenuSubTrigger,\n\tDropdownMenuRadioGroup,\n};\n"]}
@@ -1,9 +1,10 @@
1
- import { type ComponentPropsWithoutRef } from "react";
2
- export type FormFieldProps = ComponentPropsWithoutRef<"div"> & {
1
+ import { type ComponentProps, type Ref } from "react";
2
+ export type FormFieldProps = ComponentProps<"div"> & {
3
3
  orientation?: "horizontal" | "vertical";
4
4
  disabled?: boolean;
5
5
  required?: boolean;
6
6
  error?: boolean;
7
+ ref?: Ref<HTMLDivElement>;
7
8
  };
8
9
  /**
9
10
  * A component that displays a form field. Should be used as a parent of a Label, an input element and a FormHelper component.
@@ -17,9 +18,4 @@ export type FormFieldProps = ComponentPropsWithoutRef<"div"> & {
17
18
  * </FormField>
18
19
  * ```
19
20
  */
20
- export declare const FormField: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
21
- orientation?: "horizontal" | "vertical";
22
- disabled?: boolean;
23
- required?: boolean;
24
- error?: boolean;
25
- } & import("react").RefAttributes<HTMLDivElement>>;
21
+ export declare function FormField({ className, children, orientation, disabled, required, error, ref, ...props }: FormFieldProps): import("react/jsx-runtime").JSX.Element | null;