@codefast/ui 0.3.11-canary.1 → 0.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +34 -14
  3. package/dist/components/accordion.d.ts +29 -10
  4. package/dist/components/accordion.js +38 -37
  5. package/dist/components/alert-dialog.d.ts +60 -24
  6. package/dist/components/alert-dialog.js +69 -72
  7. package/dist/components/alert.d.ts +27 -15
  8. package/dist/components/alert.js +29 -31
  9. package/dist/components/aspect-ratio.d.ts +8 -4
  10. package/dist/components/aspect-ratio.js +7 -5
  11. package/dist/components/avatar.d.ts +17 -6
  12. package/dist/components/avatar.js +19 -17
  13. package/dist/components/badge.d.ts +21 -14
  14. package/dist/components/badge.js +19 -22
  15. package/dist/components/breadcrumb.d.ts +35 -12
  16. package/dist/components/breadcrumb.js +48 -54
  17. package/dist/components/button-group.d.ts +29 -14
  18. package/dist/components/button-group.js +27 -32
  19. package/dist/components/button.d.ts +35 -25
  20. package/dist/components/button.js +50 -48
  21. package/dist/components/calendar.d.ts +24 -9
  22. package/dist/components/calendar.js +92 -98
  23. package/dist/components/card.d.ts +34 -10
  24. package/dist/components/card.js +39 -37
  25. package/dist/components/carousel.d.ts +55 -24
  26. package/dist/components/carousel.js +113 -130
  27. package/dist/components/chart.d.ts +72 -36
  28. package/dist/components/chart.js +154 -166
  29. package/dist/components/checkbox-cards.d.ts +15 -8
  30. package/dist/components/checkbox-cards.js +22 -25
  31. package/dist/components/checkbox-group.d.ts +16 -8
  32. package/dist/components/checkbox-group.js +19 -19
  33. package/dist/components/checkbox.d.ts +9 -4
  34. package/dist/components/checkbox.js +14 -14
  35. package/dist/components/collapsible.d.ts +14 -6
  36. package/dist/components/collapsible.js +18 -16
  37. package/dist/components/command.d.ts +55 -23
  38. package/dist/components/command.js +70 -85
  39. package/dist/components/context-menu.d.ts +72 -22
  40. package/dist/components/context-menu.js +88 -109
  41. package/dist/components/dialog.d.ts +53 -22
  42. package/dist/components/dialog.js +71 -85
  43. package/dist/components/drawer.d.ts +60 -28
  44. package/dist/components/drawer.js +59 -67
  45. package/dist/components/dropdown-menu.d.ts +73 -22
  46. package/dist/components/dropdown-menu.js +95 -112
  47. package/dist/components/empty.d.ts +37 -15
  48. package/dist/components/empty.js +43 -45
  49. package/dist/components/field.d.ts +63 -25
  50. package/dist/components/field.js +88 -104
  51. package/dist/components/form.d.ts +37 -15
  52. package/dist/components/form.js +65 -70
  53. package/dist/components/hover-card.d.ts +21 -7
  54. package/dist/components/hover-card.js +24 -24
  55. package/dist/components/input-group.d.ts +53 -28
  56. package/dist/components/input-group.js +63 -77
  57. package/dist/components/input-number.d.ts +28 -7
  58. package/dist/components/input-number.js +55 -59
  59. package/dist/components/input-otp.d.ts +24 -10
  60. package/dist/components/input-otp.js +33 -37
  61. package/dist/components/input-password.d.ts +12 -5
  62. package/dist/components/input-password.js +31 -32
  63. package/dist/components/input-search.d.ts +18 -8
  64. package/dist/components/input-search.js +43 -41
  65. package/dist/components/input.d.ts +10 -4
  66. package/dist/components/input.js +9 -7
  67. package/dist/components/item.d.ts +69 -32
  68. package/dist/components/item.js +89 -92
  69. package/dist/components/kbd.d.ts +13 -5
  70. package/dist/components/kbd.js +13 -11
  71. package/dist/components/label.d.ts +9 -4
  72. package/dist/components/label.js +9 -7
  73. package/dist/components/menubar.d.ts +80 -23
  74. package/dist/components/menubar.js +97 -118
  75. package/dist/components/native-select.d.ts +16 -6
  76. package/dist/components/native-select.js +25 -26
  77. package/dist/components/navigation-menu.d.ts +36 -12
  78. package/dist/components/navigation-menu.js +60 -75
  79. package/dist/components/pagination.d.ts +35 -14
  80. package/dist/components/pagination.js +54 -69
  81. package/dist/components/popover.d.ts +24 -8
  82. package/dist/components/popover.js +28 -28
  83. package/dist/components/progress-circle.d.ts +106 -88
  84. package/dist/components/progress-circle.js +106 -138
  85. package/dist/components/progress.d.ts +10 -4
  86. package/dist/components/progress.js +14 -14
  87. package/dist/components/radio-cards.d.ts +10 -4
  88. package/dist/components/radio-cards.js +22 -23
  89. package/dist/components/radio-group.d.ts +13 -5
  90. package/dist/components/radio-group.js +18 -16
  91. package/dist/components/radio.d.ts +12 -5
  92. package/dist/components/radio.js +10 -8
  93. package/dist/components/resizable.d.ts +18 -7
  94. package/dist/components/resizable.js +22 -22
  95. package/dist/components/scroll-area.d.ts +33 -20
  96. package/dist/components/scroll-area.js +84 -88
  97. package/dist/components/select.d.ts +50 -16
  98. package/dist/components/select.js +77 -96
  99. package/dist/components/separator.d.ts +29 -19
  100. package/dist/components/separator.js +36 -34
  101. package/dist/components/sheet.d.ts +62 -29
  102. package/dist/components/sheet.js +79 -100
  103. package/dist/components/sidebar.d.ts +160 -66
  104. package/dist/components/sidebar.js +294 -336
  105. package/dist/components/skeleton.d.ts +9 -4
  106. package/dist/components/skeleton.js +8 -6
  107. package/dist/components/slider.d.ts +13 -4
  108. package/dist/components/slider.js +34 -40
  109. package/dist/components/sonner.d.ts +10 -7
  110. package/dist/components/sonner.js +16 -14
  111. package/dist/components/spinner.d.ts +12 -5
  112. package/dist/components/spinner.js +33 -35
  113. package/dist/components/switch.d.ts +9 -4
  114. package/dist/components/switch.js +13 -11
  115. package/dist/components/table.d.ts +37 -11
  116. package/dist/components/table.js +47 -45
  117. package/dist/components/tabs.d.ts +21 -7
  118. package/dist/components/tabs.js +24 -22
  119. package/dist/components/textarea.d.ts +9 -4
  120. package/dist/components/textarea.js +8 -6
  121. package/dist/components/toggle-group.d.ts +24 -9
  122. package/dist/components/toggle-group.js +41 -42
  123. package/dist/components/toggle.d.ts +25 -17
  124. package/dist/components/toggle.js +30 -28
  125. package/dist/components/tooltip.d.ts +24 -8
  126. package/dist/components/tooltip.js +29 -32
  127. package/dist/hooks/use-animated-value.d.ts +4 -1
  128. package/dist/hooks/use-animated-value.js +57 -36
  129. package/dist/hooks/use-copy-to-clipboard.d.ts +11 -5
  130. package/dist/hooks/use-copy-to-clipboard.js +39 -20
  131. package/dist/hooks/use-is-mobile.d.ts +4 -1
  132. package/dist/hooks/use-is-mobile.js +21 -1
  133. package/dist/hooks/use-media-query.d.ts +4 -1
  134. package/dist/hooks/use-media-query.js +45 -18
  135. package/dist/hooks/use-mutation-observer.d.ts +6 -2
  136. package/dist/hooks/use-mutation-observer.js +34 -16
  137. package/dist/hooks/use-pagination.d.ts +22 -14
  138. package/dist/hooks/use-pagination.js +100 -49
  139. package/dist/index.d.ts +69 -130
  140. package/dist/index.js +11 -11
  141. package/dist/primitives/checkbox-group.d.ts +105 -83
  142. package/dist/primitives/checkbox-group.js +111 -84
  143. package/dist/primitives/input-number.d.ts +51 -40
  144. package/dist/primitives/input-number.js +483 -350
  145. package/dist/primitives/input.d.ts +48 -42
  146. package/dist/primitives/input.js +65 -43
  147. package/dist/primitives/progress-circle.d.ts +79 -48
  148. package/dist/primitives/progress-circle.js +154 -105
  149. package/package.json +6 -7
@@ -1,86 +1,78 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import { cn } from "@codefast/tailwind-variants";
4
- import { Drawer } from "vaul";
5
2
  import { buttonVariants } from "./button.js";
6
- function drawer_Drawer({ shouldScaleBackground = true, ...props }) {
7
- return /*#__PURE__*/ jsx(Drawer.Root, {
8
- "data-slot": "drawer",
9
- shouldScaleBackground: shouldScaleBackground,
10
- ...props
11
- });
3
+ import { cn } from "@codefast/tailwind-variants";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { Drawer as Drawer$1 } from "vaul";
6
+ //#region src/components/drawer.tsx
7
+ function Drawer({ shouldScaleBackground = true, ...props }) {
8
+ return /* @__PURE__ */ jsx(Drawer$1.Root, {
9
+ "data-slot": "drawer",
10
+ shouldScaleBackground,
11
+ ...props
12
+ });
12
13
  }
13
14
  function DrawerTrigger({ ...props }) {
14
- return /*#__PURE__*/ jsx(Drawer.Trigger, {
15
- "data-slot": "drawer-trigger",
16
- ...props
17
- });
15
+ return /* @__PURE__ */ jsx(Drawer$1.Trigger, {
16
+ "data-slot": "drawer-trigger",
17
+ ...props
18
+ });
18
19
  }
19
20
  function DrawerContent({ children, className, classNames, ...props }) {
20
- return /*#__PURE__*/ jsxs(Drawer.Portal, {
21
- children: [
22
- /*#__PURE__*/ jsx(Drawer.Overlay, {
23
- className: cn("fixed inset-0 z-50 bg-black/50", classNames?.overlay),
24
- "data-slot": "drawer-overlay"
25
- }),
26
- /*#__PURE__*/ jsxs(Drawer.Content, {
27
- className: cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-background data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-2xl data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-2xl data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm", classNames?.content, className),
28
- "data-slot": "drawer-content",
29
- ...props,
30
- children: [
31
- /*#__PURE__*/ jsx("div", {
32
- className: cn("mx-auto mt-4 hidden h-1.5 w-12 shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block", classNames?.handle)
33
- }),
34
- children
35
- ]
36
- })
37
- ]
38
- });
21
+ return /* @__PURE__ */ jsxs(Drawer$1.Portal, { children: [/* @__PURE__ */ jsx(Drawer$1.Overlay, {
22
+ className: cn("fixed inset-0 z-50 bg-black/50", classNames?.overlay),
23
+ "data-slot": "drawer-overlay"
24
+ }), /* @__PURE__ */ jsxs(Drawer$1.Content, {
25
+ className: cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-background data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-2xl data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-2xl data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm", classNames?.content, className),
26
+ "data-slot": "drawer-content",
27
+ ...props,
28
+ children: [/* @__PURE__ */ jsx("div", { className: cn("mx-auto mt-4 hidden h-1.5 w-12 shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block", classNames?.handle) }), children]
29
+ })] });
39
30
  }
40
31
  function DrawerHeader({ className, ...props }) {
41
- return /*#__PURE__*/ jsx("div", {
42
- className: cn("flex flex-col gap-1.5 p-4", className),
43
- "data-slot": "drawer-header",
44
- ...props
45
- });
32
+ return /* @__PURE__ */ jsx("div", {
33
+ className: cn("flex flex-col gap-1.5 p-4", className),
34
+ "data-slot": "drawer-header",
35
+ ...props
36
+ });
46
37
  }
47
38
  function DrawerBody({ className, ...props }) {
48
- return /*#__PURE__*/ jsx("main", {
49
- className: cn("overflow-auto px-4 py-2", className),
50
- "data-slot": "drawer-body",
51
- ...props
52
- });
39
+ return /* @__PURE__ */ jsx("main", {
40
+ className: cn("overflow-auto px-4 py-2", className),
41
+ "data-slot": "drawer-body",
42
+ ...props
43
+ });
53
44
  }
54
45
  function DrawerFooter({ className, ...props }) {
55
- return /*#__PURE__*/ jsx("div", {
56
- className: cn("mt-auto flex flex-col gap-2 p-4", className),
57
- "data-slot": "drawer-footer",
58
- ...props
59
- });
46
+ return /* @__PURE__ */ jsx("div", {
47
+ className: cn("mt-auto flex flex-col gap-2 p-4", className),
48
+ "data-slot": "drawer-footer",
49
+ ...props
50
+ });
60
51
  }
61
52
  function DrawerTitle({ className, ...props }) {
62
- return /*#__PURE__*/ jsx(Drawer.Title, {
63
- className: cn("font-semibold text-foreground", className),
64
- "data-slot": "drawer-title",
65
- ...props
66
- });
53
+ return /* @__PURE__ */ jsx(Drawer$1.Title, {
54
+ className: cn("font-semibold text-foreground", className),
55
+ "data-slot": "drawer-title",
56
+ ...props
57
+ });
67
58
  }
68
59
  function DrawerDescription({ className, ...props }) {
69
- return /*#__PURE__*/ jsx(Drawer.Description, {
70
- className: cn("text-sm text-muted-foreground", className),
71
- "data-slot": "drawer-description",
72
- ...props
73
- });
60
+ return /* @__PURE__ */ jsx(Drawer$1.Description, {
61
+ className: cn("text-sm text-muted-foreground", className),
62
+ "data-slot": "drawer-description",
63
+ ...props
64
+ });
74
65
  }
75
66
  function DrawerClose({ className, size, variant = "outline", ...props }) {
76
- return /*#__PURE__*/ jsx(Drawer.Close, {
77
- className: buttonVariants({
78
- className,
79
- size,
80
- variant
81
- }),
82
- "data-slot": "drawer-close",
83
- ...props
84
- });
67
+ return /* @__PURE__ */ jsx(Drawer$1.Close, {
68
+ className: buttonVariants({
69
+ className,
70
+ size,
71
+ variant
72
+ }),
73
+ "data-slot": "drawer-close",
74
+ ...props
75
+ });
85
76
  }
86
- export { drawer_Drawer as Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger };
77
+ //#endregion
78
+ export { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger };
@@ -1,41 +1,92 @@
1
- import type { ComponentProps, JSX } from "react";
1
+ import { ComponentProps, JSX } from "react";
2
2
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
3
+
4
+ //#region src/components/dropdown-menu.d.ts
3
5
  type DropdownMenuProps = ComponentProps<typeof DropdownMenuPrimitive.Root>;
4
- declare function DropdownMenu({ ...props }: DropdownMenuProps): JSX.Element;
6
+ declare function DropdownMenu({
7
+ ...props
8
+ }: DropdownMenuProps): JSX.Element;
5
9
  type DropdownMenuTriggerProps = ComponentProps<typeof DropdownMenuPrimitive.Trigger>;
6
- declare function DropdownMenuTrigger({ ...props }: DropdownMenuTriggerProps): JSX.Element;
10
+ declare function DropdownMenuTrigger({
11
+ ...props
12
+ }: DropdownMenuTriggerProps): JSX.Element;
7
13
  type DropdownMenuGroupProps = ComponentProps<typeof DropdownMenuPrimitive.Group>;
8
- declare function DropdownMenuGroup({ ...props }: DropdownMenuGroupProps): JSX.Element;
14
+ declare function DropdownMenuGroup({
15
+ ...props
16
+ }: DropdownMenuGroupProps): JSX.Element;
9
17
  type DropdownMenuSubProps = ComponentProps<typeof DropdownMenuPrimitive.Sub>;
10
- declare function DropdownMenuSub({ ...props }: DropdownMenuSubProps): JSX.Element;
18
+ declare function DropdownMenuSub({
19
+ ...props
20
+ }: DropdownMenuSubProps): JSX.Element;
11
21
  type DropdownMenuRadioGroupProps = ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>;
12
- declare function DropdownMenuRadioGroup({ ...props }: DropdownMenuRadioGroupProps): JSX.Element;
22
+ declare function DropdownMenuRadioGroup({
23
+ ...props
24
+ }: DropdownMenuRadioGroupProps): JSX.Element;
13
25
  interface DropdownMenuSubTriggerProps extends ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> {
14
- inset?: boolean;
26
+ inset?: boolean;
15
27
  }
16
- declare function DropdownMenuSubTrigger({ children, className, inset, ...props }: DropdownMenuSubTriggerProps): JSX.Element;
28
+ declare function DropdownMenuSubTrigger({
29
+ children,
30
+ className,
31
+ inset,
32
+ ...props
33
+ }: DropdownMenuSubTriggerProps): JSX.Element;
17
34
  type DropdownMenuSubContentProps = ComponentProps<typeof DropdownMenuPrimitive.SubContent>;
18
- declare function DropdownMenuSubContent({ className, ...props }: DropdownMenuSubContentProps): JSX.Element;
35
+ declare function DropdownMenuSubContent({
36
+ className,
37
+ ...props
38
+ }: DropdownMenuSubContentProps): JSX.Element;
19
39
  type DropdownMenuContentProps = ComponentProps<typeof DropdownMenuPrimitive.Content>;
20
- declare function DropdownMenuContent({ className, sideOffset, ...props }: DropdownMenuContentProps): JSX.Element;
40
+ declare function DropdownMenuContent({
41
+ className,
42
+ sideOffset,
43
+ ...props
44
+ }: DropdownMenuContentProps): JSX.Element;
21
45
  interface DropdownMenuItemProps extends ComponentProps<typeof DropdownMenuPrimitive.Item> {
22
- inset?: boolean;
23
- variant?: "default" | "destructive";
46
+ inset?: boolean;
47
+ variant?: "default" | "destructive";
24
48
  }
25
- declare function DropdownMenuItem({ className, inset, variant, ...props }: DropdownMenuItemProps): JSX.Element;
49
+ declare function DropdownMenuItem({
50
+ className,
51
+ inset,
52
+ variant,
53
+ ...props
54
+ }: DropdownMenuItemProps): JSX.Element;
26
55
  type DropdownMenuCheckboxItemProps = ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>;
27
- declare function DropdownMenuCheckboxItem({ checked, children, className, ...props }: DropdownMenuCheckboxItemProps): JSX.Element;
56
+ declare function DropdownMenuCheckboxItem({
57
+ checked,
58
+ children,
59
+ className,
60
+ ...props
61
+ }: DropdownMenuCheckboxItemProps): JSX.Element;
28
62
  type DropdownMenuRadioItemProps = ComponentProps<typeof DropdownMenuPrimitive.RadioItem>;
29
- declare function DropdownMenuRadioItem({ children, className, ...props }: DropdownMenuRadioItemProps): JSX.Element;
63
+ declare function DropdownMenuRadioItem({
64
+ children,
65
+ className,
66
+ ...props
67
+ }: DropdownMenuRadioItemProps): JSX.Element;
30
68
  interface DropdownMenuLabelProps extends ComponentProps<typeof DropdownMenuPrimitive.Label> {
31
- inset?: boolean;
69
+ inset?: boolean;
32
70
  }
33
- declare function DropdownMenuLabel({ className, inset, ...props }: DropdownMenuLabelProps): JSX.Element;
71
+ declare function DropdownMenuLabel({
72
+ className,
73
+ inset,
74
+ ...props
75
+ }: DropdownMenuLabelProps): JSX.Element;
34
76
  type DropdownMenuSeparatorProps = ComponentProps<typeof DropdownMenuPrimitive.Separator>;
35
- declare function DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps): JSX.Element;
77
+ declare function DropdownMenuSeparator({
78
+ className,
79
+ ...props
80
+ }: DropdownMenuSeparatorProps): JSX.Element;
36
81
  type DropdownMenuShortcutProps = ComponentProps<"span">;
37
- declare function DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps): JSX.Element;
82
+ declare function DropdownMenuShortcut({
83
+ className,
84
+ ...props
85
+ }: DropdownMenuShortcutProps): JSX.Element;
38
86
  type DropdownMenuArrowProps = ComponentProps<typeof DropdownMenuPrimitive.Arrow>;
39
- declare function DropdownMenuArrow({ className, ...props }: DropdownMenuArrowProps): JSX.Element;
40
- export { DropdownMenu, DropdownMenuArrow, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
41
- export type { DropdownMenuArrowProps, DropdownMenuCheckboxItemProps, DropdownMenuContentProps, DropdownMenuGroupProps, DropdownMenuItemProps, DropdownMenuLabelProps, DropdownMenuProps, DropdownMenuRadioGroupProps, DropdownMenuRadioItemProps, DropdownMenuSeparatorProps, DropdownMenuShortcutProps, DropdownMenuSubContentProps, DropdownMenuSubProps, DropdownMenuSubTriggerProps, DropdownMenuTriggerProps, };
87
+ declare function DropdownMenuArrow({
88
+ className,
89
+ ...props
90
+ }: DropdownMenuArrowProps): JSX.Element;
91
+ //#endregion
92
+ export { DropdownMenu, DropdownMenuArrow, type DropdownMenuArrowProps, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuShortcut, type DropdownMenuShortcutProps, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, type DropdownMenuSubProps, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps };
@@ -1,146 +1,129 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
2
  import { cn } from "@codefast/tailwind-variants";
4
- import { Arrow, CheckboxItem, Content, Group, Item, ItemIndicator, Label, Portal, RadioGroup, RadioItem, Root, Separator, Sub, SubContent, SubTrigger, Trigger } from "@radix-ui/react-dropdown-menu";
5
3
  import { CheckIcon, ChevronRightIcon, DotIcon } from "lucide-react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
6
+ //#region src/components/dropdown-menu.tsx
6
7
  function DropdownMenu({ ...props }) {
7
- return /*#__PURE__*/ jsx(Root, {
8
- "data-slot": "dropdown-menu",
9
- ...props
10
- });
8
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, {
9
+ "data-slot": "dropdown-menu",
10
+ ...props
11
+ });
11
12
  }
12
13
  function DropdownMenuTrigger({ ...props }) {
13
- return /*#__PURE__*/ jsx(Trigger, {
14
- "data-slot": "dropdown-menu-trigger",
15
- ...props
16
- });
14
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Trigger, {
15
+ "data-slot": "dropdown-menu-trigger",
16
+ ...props
17
+ });
17
18
  }
18
19
  function DropdownMenuGroup({ ...props }) {
19
- return /*#__PURE__*/ jsx(Group, {
20
- "data-slot": "dropdown-menu-group",
21
- ...props
22
- });
20
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Group, {
21
+ "data-slot": "dropdown-menu-group",
22
+ ...props
23
+ });
23
24
  }
24
25
  function DropdownMenuSub({ ...props }) {
25
- return /*#__PURE__*/ jsx(Sub, {
26
- "data-slot": "dropdown-menu-sub",
27
- ...props
28
- });
26
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, {
27
+ "data-slot": "dropdown-menu-sub",
28
+ ...props
29
+ });
29
30
  }
30
31
  function DropdownMenuRadioGroup({ ...props }) {
31
- return /*#__PURE__*/ jsx(RadioGroup, {
32
- "data-slot": "dropdown-menu-radio-group",
33
- ...props
34
- });
32
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.RadioGroup, {
33
+ "data-slot": "dropdown-menu-radio-group",
34
+ ...props
35
+ });
35
36
  }
36
37
  function DropdownMenuSubTrigger({ children, className, inset, ...props }) {
37
- return /*#__PURE__*/ jsxs(SubTrigger, {
38
- className: cn("flex cursor-default items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", className),
39
- "data-inset": inset,
40
- "data-slot": "dropdown-menu-sub-trigger",
41
- ...props,
42
- children: [
43
- children,
44
- /*#__PURE__*/ jsx(ChevronRightIcon, {
45
- className: "ml-auto size-4"
46
- })
47
- ]
48
- });
38
+ return /* @__PURE__ */ jsxs(DropdownMenuPrimitive.SubTrigger, {
39
+ className: cn("flex cursor-default items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", className),
40
+ "data-inset": inset,
41
+ "data-slot": "dropdown-menu-sub-trigger",
42
+ ...props,
43
+ children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })]
44
+ });
49
45
  }
50
46
  function DropdownMenuSubContent({ className, ...props }) {
51
- return /*#__PURE__*/ jsx(Portal, {
52
- "data-slot": "dropdown-menu-portal",
53
- children: /*#__PURE__*/ jsx(SubContent, {
54
- className: cn("z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2", className),
55
- "data-slot": "dropdown-menu-sub-content",
56
- ...props
57
- })
58
- });
47
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, {
48
+ "data-slot": "dropdown-menu-portal",
49
+ children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.SubContent, {
50
+ className: cn("z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2", className),
51
+ "data-slot": "dropdown-menu-sub-content",
52
+ ...props
53
+ })
54
+ });
59
55
  }
60
56
  function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
61
- return /*#__PURE__*/ jsx(Portal, {
62
- "data-slot": "dropdown-menu-portal",
63
- children: /*#__PURE__*/ jsx(Content, {
64
- className: cn("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2", className),
65
- "data-slot": "dropdown-menu-content",
66
- sideOffset: sideOffset,
67
- ...props
68
- })
69
- });
57
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, {
58
+ "data-slot": "dropdown-menu-portal",
59
+ children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Content, {
60
+ className: cn("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2", className),
61
+ "data-slot": "dropdown-menu-content",
62
+ sideOffset,
63
+ ...props
64
+ })
65
+ });
70
66
  }
71
67
  function DropdownMenuItem({ className, inset, variant, ...props }) {
72
- return /*#__PURE__*/ jsx(Item, {
73
- className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive/80", className),
74
- "data-inset": inset,
75
- "data-slot": "dropdown-menu-item",
76
- "data-variant": variant,
77
- ...props
78
- });
68
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Item, {
69
+ className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive/80", className),
70
+ "data-inset": inset,
71
+ "data-slot": "dropdown-menu-item",
72
+ "data-variant": variant,
73
+ ...props
74
+ });
79
75
  }
80
76
  function DropdownMenuCheckboxItem({ checked, children, className, ...props }) {
81
- return /*#__PURE__*/ jsxs(CheckboxItem, {
82
- checked: checked,
83
- className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-x-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
84
- "data-slot": "dropdown-menu-checkbox-item",
85
- ...props,
86
- children: [
87
- /*#__PURE__*/ jsx("span", {
88
- className: "absolute left-2 flex items-center justify-center",
89
- children: /*#__PURE__*/ jsx(ItemIndicator, {
90
- children: /*#__PURE__*/ jsx(CheckIcon, {
91
- className: "size-4"
92
- })
93
- })
94
- }),
95
- children
96
- ]
97
- });
77
+ return /* @__PURE__ */ jsxs(DropdownMenuPrimitive.CheckboxItem, {
78
+ checked,
79
+ className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-x-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
80
+ "data-slot": "dropdown-menu-checkbox-item",
81
+ ...props,
82
+ children: [/* @__PURE__ */ jsx("span", {
83
+ className: "absolute left-2 flex items-center justify-center",
84
+ children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
85
+ }), children]
86
+ });
98
87
  }
99
88
  function DropdownMenuRadioItem({ children, className, ...props }) {
100
- return /*#__PURE__*/ jsxs(RadioItem, {
101
- className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-x-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
102
- "data-slot": "dropdown-menu-radio-item",
103
- ...props,
104
- children: [
105
- /*#__PURE__*/ jsx("span", {
106
- className: "absolute left-2 flex items-center justify-center",
107
- children: /*#__PURE__*/ jsx(ItemIndicator, {
108
- children: /*#__PURE__*/ jsx(DotIcon, {
109
- className: "size-4 fill-current"
110
- })
111
- })
112
- }),
113
- children
114
- ]
115
- });
89
+ return /* @__PURE__ */ jsxs(DropdownMenuPrimitive.RadioItem, {
90
+ className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-x-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
91
+ "data-slot": "dropdown-menu-radio-item",
92
+ ...props,
93
+ children: [/* @__PURE__ */ jsx("span", {
94
+ className: "absolute left-2 flex items-center justify-center",
95
+ children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(DotIcon, { className: "size-4 fill-current" }) })
96
+ }), children]
97
+ });
116
98
  }
117
99
  function DropdownMenuLabel({ className, inset, ...props }) {
118
- return /*#__PURE__*/ jsx(Label, {
119
- className: cn("flex items-center gap-x-2 px-2 py-1.5 text-sm font-semibold data-inset:pl-8", className),
120
- "data-inset": inset,
121
- "data-slot": "dropdown-menu-label",
122
- ...props
123
- });
100
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Label, {
101
+ className: cn("flex items-center gap-x-2 px-2 py-1.5 text-sm font-semibold data-inset:pl-8", className),
102
+ "data-inset": inset,
103
+ "data-slot": "dropdown-menu-label",
104
+ ...props
105
+ });
124
106
  }
125
107
  function DropdownMenuSeparator({ className, ...props }) {
126
- return /*#__PURE__*/ jsx(Separator, {
127
- className: cn("mx-2 my-1 h-px bg-border", className),
128
- "data-slot": "dropdown-menu-separator",
129
- ...props
130
- });
108
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Separator, {
109
+ className: cn("mx-2 my-1 h-px bg-border", className),
110
+ "data-slot": "dropdown-menu-separator",
111
+ ...props
112
+ });
131
113
  }
132
114
  function DropdownMenuShortcut({ className, ...props }) {
133
- return /*#__PURE__*/ jsx("span", {
134
- className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-data-[variant=destructive]/dropdown-menu-item:text-destructive/80", className),
135
- "data-slot": "dropdown-menu-shortcut",
136
- ...props
137
- });
115
+ return /* @__PURE__ */ jsx("span", {
116
+ className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-data-[variant=destructive]/dropdown-menu-item:text-destructive/80", className),
117
+ "data-slot": "dropdown-menu-shortcut",
118
+ ...props
119
+ });
138
120
  }
139
121
  function DropdownMenuArrow({ className, ...props }) {
140
- return /*#__PURE__*/ jsx(Arrow, {
141
- className: cn("fill-popover", className),
142
- "data-slot": "dropdown-menu-arrow",
143
- ...props
144
- });
122
+ return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Arrow, {
123
+ className: cn("fill-popover", className),
124
+ "data-slot": "dropdown-menu-arrow",
125
+ ...props
126
+ });
145
127
  }
128
+ //#endregion
146
129
  export { DropdownMenu, DropdownMenuArrow, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
@@ -1,22 +1,44 @@
1
- import type { VariantProps } from "@codefast/tailwind-variants";
2
- import type { ComponentProps, JSX } from "react";
3
- declare const emptyMediaVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
4
- variant: {
5
- default: string;
6
- icon: string;
7
- };
1
+ import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
2
+ import { VariantProps } from "@codefast/tailwind-variants";
3
+ import { ComponentProps, JSX } from "react";
4
+
5
+ //#region src/components/empty.d.ts
6
+ declare const emptyMediaVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
7
+ variant: {
8
+ default: string;
9
+ icon: string;
10
+ };
8
11
  }, Record<string, never>>;
9
12
  type EmptyProps = ComponentProps<"div">;
10
- declare function Empty({ className, ...props }: EmptyProps): JSX.Element;
13
+ declare function Empty({
14
+ className,
15
+ ...props
16
+ }: EmptyProps): JSX.Element;
11
17
  type EmptyHeaderProps = ComponentProps<"div">;
12
- declare function EmptyHeader({ className, ...props }: EmptyHeaderProps): JSX.Element;
18
+ declare function EmptyHeader({
19
+ className,
20
+ ...props
21
+ }: EmptyHeaderProps): JSX.Element;
13
22
  type EmptyMediaProps = ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>;
14
- declare function EmptyMedia({ className, variant, ...props }: EmptyMediaProps): JSX.Element;
23
+ declare function EmptyMedia({
24
+ className,
25
+ variant,
26
+ ...props
27
+ }: EmptyMediaProps): JSX.Element;
15
28
  type EmptyTitleProps = ComponentProps<"div">;
16
- declare function EmptyTitle({ className, ...props }: EmptyTitleProps): JSX.Element;
29
+ declare function EmptyTitle({
30
+ className,
31
+ ...props
32
+ }: EmptyTitleProps): JSX.Element;
17
33
  type EmptyDescriptionProps = ComponentProps<"p">;
18
- declare function EmptyDescription({ className, ...props }: EmptyDescriptionProps): JSX.Element;
34
+ declare function EmptyDescription({
35
+ className,
36
+ ...props
37
+ }: EmptyDescriptionProps): JSX.Element;
19
38
  type EmptyContentProps = ComponentProps<"div">;
20
- declare function EmptyContent({ className, ...props }: EmptyContentProps): JSX.Element;
21
- export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, emptyMediaVariants, EmptyTitle, };
22
- export type { EmptyContentProps, EmptyDescriptionProps, EmptyHeaderProps, EmptyMediaProps, EmptyProps, EmptyTitleProps, };
39
+ declare function EmptyContent({
40
+ className,
41
+ ...props
42
+ }: EmptyContentProps): JSX.Element;
43
+ //#endregion
44
+ export { Empty, EmptyContent, type EmptyContentProps, EmptyDescription, type EmptyDescriptionProps, EmptyHeader, type EmptyHeaderProps, EmptyMedia, type EmptyMediaProps, type EmptyProps, EmptyTitle, type EmptyTitleProps, emptyMediaVariants };