@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,143 +1,122 @@
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-context-menu";
5
3
  import { CheckIcon, ChevronRightIcon, DotIcon } from "lucide-react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
6
+ //#region src/components/context-menu.tsx
6
7
  function ContextMenu({ ...props }) {
7
- return /*#__PURE__*/ jsx(Root, {
8
- "data-slot": "context-menu",
9
- ...props
10
- });
8
+ return /* @__PURE__ */ jsx(ContextMenuPrimitive.Root, {
9
+ "data-slot": "context-menu",
10
+ ...props
11
+ });
11
12
  }
12
13
  function ContextMenuTrigger({ ...props }) {
13
- return /*#__PURE__*/ jsx(Trigger, {
14
- "data-slot": "context-menu-trigger",
15
- ...props
16
- });
14
+ return /* @__PURE__ */ jsx(ContextMenuPrimitive.Trigger, {
15
+ "data-slot": "context-menu-trigger",
16
+ ...props
17
+ });
17
18
  }
18
19
  function ContextMenuGroup({ ...props }) {
19
- return /*#__PURE__*/ jsx(Group, {
20
- "data-slot": "context-menu-group",
21
- ...props
22
- });
20
+ return /* @__PURE__ */ jsx(ContextMenuPrimitive.Group, {
21
+ "data-slot": "context-menu-group",
22
+ ...props
23
+ });
23
24
  }
24
25
  function ContextMenuSub({ ...props }) {
25
- return /*#__PURE__*/ jsx(Sub, {
26
- "data-slot": "context-menu-sub",
27
- ...props
28
- });
26
+ return /* @__PURE__ */ jsx(ContextMenuPrimitive.Sub, {
27
+ "data-slot": "context-menu-sub",
28
+ ...props
29
+ });
29
30
  }
30
31
  function ContextMenuRadioGroup({ ...props }) {
31
- return /*#__PURE__*/ jsx(RadioGroup, {
32
- "data-slot": "context-menu-radio-group",
33
- ...props
34
- });
32
+ return /* @__PURE__ */ jsx(ContextMenuPrimitive.RadioGroup, {
33
+ "data-slot": "context-menu-radio-group",
34
+ ...props
35
+ });
35
36
  }
36
37
  function ContextMenuSubTrigger({ 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 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
39
- "data-inset": inset,
40
- "data-slot": "context-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(ContextMenuPrimitive.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 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
40
+ "data-inset": inset,
41
+ "data-slot": "context-menu-sub-trigger",
42
+ ...props,
43
+ children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })]
44
+ });
49
45
  }
50
46
  function ContextMenuSubContent({ className, ...props }) {
51
- return /*#__PURE__*/ jsx(Portal, {
52
- children: /*#__PURE__*/ jsx(SubContent, {
53
- className: cn("z-50 min-w-32 origin-(--radix-context-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),
54
- "data-slot": "context-menu-sub-content",
55
- ...props
56
- })
57
- });
47
+ return /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(ContextMenuPrimitive.SubContent, {
48
+ className: cn("z-50 min-w-32 origin-(--radix-context-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),
49
+ "data-slot": "context-menu-sub-content",
50
+ ...props
51
+ }) });
58
52
  }
59
53
  function ContextMenuContent({ className, ...props }) {
60
- return /*#__PURE__*/ jsx(Portal, {
61
- children: /*#__PURE__*/ jsx(Content, {
62
- className: cn("z-50 max-h-(--radix-context-menu-content-available-height) min-w-32 origin-(--radix-context-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=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),
63
- "data-slot": "context-menu-content",
64
- ...props
65
- })
66
- });
54
+ return /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(ContextMenuPrimitive.Content, {
55
+ className: cn("z-50 max-h-(--radix-context-menu-content-available-height) min-w-32 origin-(--radix-context-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=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),
56
+ "data-slot": "context-menu-content",
57
+ ...props
58
+ }) });
67
59
  }
68
60
  function ContextMenuItem({ className, inset, variant, ...props }) {
69
- return /*#__PURE__*/ jsx(Item, {
70
- className: cn("group/context-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),
71
- "data-inset": inset,
72
- "data-slot": "context-menu-item",
73
- "data-variant": variant,
74
- ...props
75
- });
61
+ return /* @__PURE__ */ jsx(ContextMenuPrimitive.Item, {
62
+ className: cn("group/context-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),
63
+ "data-inset": inset,
64
+ "data-slot": "context-menu-item",
65
+ "data-variant": variant,
66
+ ...props
67
+ });
76
68
  }
77
69
  function ContextMenuCheckboxItem({ checked, children, className, ...props }) {
78
- return /*#__PURE__*/ jsxs(CheckboxItem, {
79
- checked: checked,
80
- className: cn("group/context-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),
81
- "data-slot": "context-menu-checkbox-item",
82
- ...props,
83
- children: [
84
- /*#__PURE__*/ jsx("span", {
85
- className: "absolute left-2 flex items-center justify-center",
86
- children: /*#__PURE__*/ jsx(ItemIndicator, {
87
- children: /*#__PURE__*/ jsx(CheckIcon, {
88
- className: "size-4"
89
- })
90
- })
91
- }),
92
- children
93
- ]
94
- });
70
+ return /* @__PURE__ */ jsxs(ContextMenuPrimitive.CheckboxItem, {
71
+ checked,
72
+ className: cn("group/context-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),
73
+ "data-slot": "context-menu-checkbox-item",
74
+ ...props,
75
+ children: [/* @__PURE__ */ jsx("span", {
76
+ className: "absolute left-2 flex items-center justify-center",
77
+ children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
78
+ }), children]
79
+ });
95
80
  }
96
81
  function ContextMenuRadioItem({ children, className, ...props }) {
97
- return /*#__PURE__*/ jsxs(RadioItem, {
98
- className: cn("group/context-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),
99
- "data-slot": "context-menu-radio-item",
100
- ...props,
101
- children: [
102
- /*#__PURE__*/ jsx("span", {
103
- className: "absolute left-2 flex items-center justify-center",
104
- children: /*#__PURE__*/ jsx(ItemIndicator, {
105
- children: /*#__PURE__*/ jsx(DotIcon, {
106
- className: "size-4 fill-current"
107
- })
108
- })
109
- }),
110
- children
111
- ]
112
- });
82
+ return /* @__PURE__ */ jsxs(ContextMenuPrimitive.RadioItem, {
83
+ className: cn("group/context-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": "context-menu-radio-item",
85
+ ...props,
86
+ children: [/* @__PURE__ */ jsx("span", {
87
+ className: "absolute left-2 flex items-center justify-center",
88
+ children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(DotIcon, { className: "size-4 fill-current" }) })
89
+ }), children]
90
+ });
113
91
  }
114
92
  function ContextMenuLabel({ className, inset, ...props }) {
115
- return /*#__PURE__*/ jsx(Label, {
116
- className: cn("flex items-center gap-x-2 px-2 py-1.5 text-sm font-semibold data-inset:pl-8", className),
117
- "data-inset": inset,
118
- "data-slot": "context-menu-label",
119
- ...props
120
- });
93
+ return /* @__PURE__ */ jsx(ContextMenuPrimitive.Label, {
94
+ className: cn("flex items-center gap-x-2 px-2 py-1.5 text-sm font-semibold data-inset:pl-8", className),
95
+ "data-inset": inset,
96
+ "data-slot": "context-menu-label",
97
+ ...props
98
+ });
121
99
  }
122
100
  function ContextMenuSeparator({ className, ...props }) {
123
- return /*#__PURE__*/ jsx(Separator, {
124
- className: cn("mx-2 my-1 h-px bg-border", className),
125
- "data-slot": "context-menu-separator",
126
- ...props
127
- });
101
+ return /* @__PURE__ */ jsx(ContextMenuPrimitive.Separator, {
102
+ className: cn("mx-2 my-1 h-px bg-border", className),
103
+ "data-slot": "context-menu-separator",
104
+ ...props
105
+ });
128
106
  }
129
107
  function ContextMenuShortcut({ className, ...props }) {
130
- return /*#__PURE__*/ jsx("span", {
131
- className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-data-[variant=destructive]/context-menu-item:text-destructive/80", className),
132
- "data-slot": "context-menu-shortcut",
133
- ...props
134
- });
108
+ return /* @__PURE__ */ jsx("span", {
109
+ className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-data-[variant=destructive]/context-menu-item:text-destructive/80", className),
110
+ "data-slot": "context-menu-shortcut",
111
+ ...props
112
+ });
135
113
  }
136
114
  function ContextMenuArrow({ className, ...props }) {
137
- return /*#__PURE__*/ jsx(Arrow, {
138
- className: cn("fill-popover", className),
139
- "data-slot": "context-menu-arrow",
140
- ...props
141
- });
115
+ return /* @__PURE__ */ jsx(ContextMenuPrimitive.Arrow, {
116
+ className: cn("fill-popover", className),
117
+ "data-slot": "context-menu-arrow",
118
+ ...props
119
+ });
142
120
  }
121
+ //#endregion
143
122
  export { ContextMenu, ContextMenuArrow, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger };
@@ -1,34 +1,65 @@
1
- import type { VariantProps } from "@codefast/tailwind-variants";
2
- import type { ComponentProps, JSX } from "react";
1
+ import { buttonVariants } from "./button.js";
2
+ import { VariantProps } from "@codefast/tailwind-variants";
3
+ import { ComponentProps, JSX } from "react";
3
4
  import * as DialogPrimitive from "@radix-ui/react-dialog";
4
- import { buttonVariants } from "./button";
5
+
6
+ //#region src/components/dialog.d.ts
5
7
  type DialogProps = ComponentProps<typeof DialogPrimitive.Root>;
6
- declare function Dialog({ ...props }: DialogProps): JSX.Element;
8
+ declare function Dialog({
9
+ ...props
10
+ }: DialogProps): JSX.Element;
7
11
  type DialogTriggerProps = ComponentProps<typeof DialogPrimitive.Trigger>;
8
- declare function DialogTrigger({ ...props }: DialogTriggerProps): JSX.Element;
12
+ declare function DialogTrigger({
13
+ ...props
14
+ }: DialogTriggerProps): JSX.Element;
9
15
  interface DialogContentProps extends ComponentProps<typeof DialogPrimitive.Content> {
10
- classNames?: {
11
- close?: string;
12
- content?: string;
13
- overlay?: string;
14
- wrapper?: string;
15
- };
16
+ classNames?: {
17
+ close?: string;
18
+ content?: string;
19
+ overlay?: string;
20
+ wrapper?: string;
21
+ };
16
22
  }
17
- declare function DialogContent({ children, className, classNames, ...props }: DialogContentProps): JSX.Element;
23
+ declare function DialogContent({
24
+ children,
25
+ className,
26
+ classNames,
27
+ ...props
28
+ }: DialogContentProps): JSX.Element;
18
29
  type DialogHeaderProps = ComponentProps<"div">;
19
- declare function DialogHeader({ className, ...props }: DialogHeaderProps): JSX.Element;
30
+ declare function DialogHeader({
31
+ className,
32
+ ...props
33
+ }: DialogHeaderProps): JSX.Element;
20
34
  type DialogBodyProps = ComponentProps<"div">;
21
- declare function DialogBody({ className, ...props }: DialogBodyProps): JSX.Element;
35
+ declare function DialogBody({
36
+ className,
37
+ ...props
38
+ }: DialogBodyProps): JSX.Element;
22
39
  type DialogFooterProps = ComponentProps<"div">;
23
- declare function DialogFooter({ className, ...props }: DialogFooterProps): JSX.Element;
40
+ declare function DialogFooter({
41
+ className,
42
+ ...props
43
+ }: DialogFooterProps): JSX.Element;
24
44
  type DialogTitleProps = ComponentProps<typeof DialogPrimitive.Title>;
25
- declare function DialogTitle({ className, ...props }: DialogTitleProps): JSX.Element;
45
+ declare function DialogTitle({
46
+ className,
47
+ ...props
48
+ }: DialogTitleProps): JSX.Element;
26
49
  type DialogDescriptionProps = ComponentProps<typeof DialogPrimitive.Description>;
27
- declare function DialogDescription({ className, ...props }: DialogDescriptionProps): JSX.Element;
50
+ declare function DialogDescription({
51
+ className,
52
+ ...props
53
+ }: DialogDescriptionProps): JSX.Element;
28
54
  interface DialogCloseProps extends Omit<ComponentProps<typeof DialogPrimitive.Close>, "ref"> {
29
- size?: VariantProps<typeof buttonVariants>["size"];
30
- variant?: VariantProps<typeof buttonVariants>["variant"];
55
+ size?: VariantProps<typeof buttonVariants>["size"];
56
+ variant?: VariantProps<typeof buttonVariants>["variant"];
31
57
  }
32
- declare function DialogClose({ className, size, variant, ...props }: DialogCloseProps): JSX.Element;
33
- export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, };
34
- export type { DialogBodyProps, DialogCloseProps, DialogContentProps, DialogDescriptionProps, DialogFooterProps, DialogHeaderProps, DialogProps, DialogTitleProps, DialogTriggerProps, };
58
+ declare function DialogClose({
59
+ className,
60
+ size,
61
+ variant,
62
+ ...props
63
+ }: DialogCloseProps): JSX.Element;
64
+ //#endregion
65
+ export { Dialog, DialogBody, type DialogBodyProps, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps };
@@ -1,107 +1,93 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { buttonVariants } from "./button.js";
3
3
  import { cn } from "@codefast/tailwind-variants";
4
- import { Close, Content, Description, Overlay, Portal, Root, Title, Trigger } from "@radix-ui/react-dialog";
5
4
  import { XIcon } from "lucide-react";
6
- import { buttonVariants } from "./button.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
7
+ //#region src/components/dialog.tsx
7
8
  function Dialog({ ...props }) {
8
- return /*#__PURE__*/ jsx(Root, {
9
- "data-slot": "dialog",
10
- ...props
11
- });
9
+ return /* @__PURE__ */ jsx(DialogPrimitive.Root, {
10
+ "data-slot": "dialog",
11
+ ...props
12
+ });
12
13
  }
13
14
  function DialogTrigger({ ...props }) {
14
- return /*#__PURE__*/ jsx(Trigger, {
15
- "data-slot": "dialog-trigger",
16
- ...props
17
- });
15
+ return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, {
16
+ "data-slot": "dialog-trigger",
17
+ ...props
18
+ });
18
19
  }
19
20
  function DialogContent({ children, className, classNames, ...props }) {
20
- return /*#__PURE__*/ jsxs(Portal, {
21
- children: [
22
- /*#__PURE__*/ jsx(Overlay, {
23
- className: cn("fixed inset-0 z-50 bg-black/50 ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", classNames?.overlay),
24
- "data-slot": "dialog-overlay"
25
- }),
26
- /*#__PURE__*/ jsx(Content, {
27
- className: cn("fixed inset-0 z-50 grid grid-rows-[1fr_auto] justify-items-center overflow-auto ease-ui data-[state=closed]:animate-out data-[state=open]:animate-in max-sm:data-[state=closed]:animation-duration-500 max-sm:data-[state=closed]:slide-out-to-bottom max-sm:data-[state=open]:animation-duration-500 max-sm:data-[state=open]:slide-in-from-bottom sm:grid-rows-[1fr_auto_3fr] sm:p-4 sm:data-[state=closed]:fade-out-0 sm:data-[state=closed]:zoom-out-95 sm:data-[state=open]:fade-in-0 sm:data-[state=open]:zoom-in-95", classNames?.wrapper),
28
- "data-slot": "dialog-content-wrapper",
29
- ...props,
30
- children: /*#__PURE__*/ jsxs("div", {
31
- className: cn("relative row-start-2 flex w-full flex-col rounded-t-2xl border bg-popover text-popover-foreground shadow-lg sm:max-w-lg sm:rounded-2xl", classNames?.content, className),
32
- "data-slot": "dialog-content",
33
- children: [
34
- children,
35
- /*#__PURE__*/ jsxs(Close, {
36
- className: buttonVariants({
37
- className: [
38
- "absolute top-2.5 right-2.5 size-7",
39
- classNames?.close
40
- ],
41
- size: "icon",
42
- variant: "ghost"
43
- }),
44
- "data-slot": "dialog-close",
45
- children: [
46
- /*#__PURE__*/ jsx(XIcon, {
47
- className: "size-4"
48
- }),
49
- /*#__PURE__*/ jsx("span", {
50
- className: "sr-only",
51
- children: "Close"
52
- })
53
- ]
54
- })
55
- ]
56
- })
57
- })
58
- ]
59
- });
21
+ return /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { children: [/* @__PURE__ */ jsx(DialogPrimitive.Overlay, {
22
+ className: cn("fixed inset-0 z-50 bg-black/50 ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", classNames?.overlay),
23
+ "data-slot": "dialog-overlay"
24
+ }), /* @__PURE__ */ jsx(DialogPrimitive.Content, {
25
+ className: cn("fixed inset-0 z-50 grid grid-rows-[1fr_auto] justify-items-center overflow-auto ease-ui data-[state=closed]:animate-out data-[state=open]:animate-in max-sm:data-[state=closed]:animation-duration-500 max-sm:data-[state=closed]:slide-out-to-bottom max-sm:data-[state=open]:animation-duration-500 max-sm:data-[state=open]:slide-in-from-bottom sm:grid-rows-[1fr_auto_3fr] sm:p-4 sm:data-[state=closed]:fade-out-0 sm:data-[state=closed]:zoom-out-95 sm:data-[state=open]:fade-in-0 sm:data-[state=open]:zoom-in-95", classNames?.wrapper),
26
+ "data-slot": "dialog-content-wrapper",
27
+ ...props,
28
+ children: /* @__PURE__ */ jsxs("div", {
29
+ className: cn("relative row-start-2 flex w-full flex-col rounded-t-2xl border bg-popover text-popover-foreground shadow-lg sm:max-w-lg sm:rounded-2xl", classNames?.content, className),
30
+ "data-slot": "dialog-content",
31
+ children: [children, /* @__PURE__ */ jsxs(DialogPrimitive.Close, {
32
+ className: buttonVariants({
33
+ className: ["absolute top-2.5 right-2.5 size-7", classNames?.close],
34
+ size: "icon",
35
+ variant: "ghost"
36
+ }),
37
+ "data-slot": "dialog-close",
38
+ children: [/* @__PURE__ */ jsx(XIcon, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
39
+ className: "sr-only",
40
+ children: "Close"
41
+ })]
42
+ })]
43
+ })
44
+ })] });
60
45
  }
61
46
  function DialogHeader({ className, ...props }) {
62
- return /*#__PURE__*/ jsx("header", {
63
- className: cn("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-2 text-center sm:text-left", className),
64
- "data-slot": "dialog-header",
65
- ...props
66
- });
47
+ return /* @__PURE__ */ jsx("header", {
48
+ className: cn("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-2 text-center sm:text-left", className),
49
+ "data-slot": "dialog-header",
50
+ ...props
51
+ });
67
52
  }
68
53
  function DialogBody({ className, ...props }) {
69
- return /*#__PURE__*/ jsx("main", {
70
- className: cn("overflow-auto px-6 py-2", className),
71
- "data-slot": "dialog-body",
72
- ...props
73
- });
54
+ return /* @__PURE__ */ jsx("main", {
55
+ className: cn("overflow-auto px-6 py-2", className),
56
+ "data-slot": "dialog-body",
57
+ ...props
58
+ });
74
59
  }
75
60
  function DialogFooter({ className, ...props }) {
76
- return /*#__PURE__*/ jsx("footer", {
77
- className: cn("flex shrink-0 flex-col-reverse gap-2 px-6 pt-2 pb-6 sm:flex-row sm:justify-end", className),
78
- "data-slot": "dialog-footer",
79
- ...props
80
- });
61
+ return /* @__PURE__ */ jsx("footer", {
62
+ className: cn("flex shrink-0 flex-col-reverse gap-2 px-6 pt-2 pb-6 sm:flex-row sm:justify-end", className),
63
+ "data-slot": "dialog-footer",
64
+ ...props
65
+ });
81
66
  }
82
67
  function DialogTitle({ className, ...props }) {
83
- return /*#__PURE__*/ jsx(Title, {
84
- className: cn("text-lg leading-none font-semibold tracking-tight", className),
85
- "data-slot": "dialog-title",
86
- ...props
87
- });
68
+ return /* @__PURE__ */ jsx(DialogPrimitive.Title, {
69
+ className: cn("text-lg leading-none font-semibold tracking-tight", className),
70
+ "data-slot": "dialog-title",
71
+ ...props
72
+ });
88
73
  }
89
74
  function DialogDescription({ className, ...props }) {
90
- return /*#__PURE__*/ jsx(Description, {
91
- className: cn("text-sm text-muted-foreground", className),
92
- "data-slot": "dialog-description",
93
- ...props
94
- });
75
+ return /* @__PURE__ */ jsx(DialogPrimitive.Description, {
76
+ className: cn("text-sm text-muted-foreground", className),
77
+ "data-slot": "dialog-description",
78
+ ...props
79
+ });
95
80
  }
96
81
  function DialogClose({ className, size, variant = "outline", ...props }) {
97
- return /*#__PURE__*/ jsx(Close, {
98
- className: buttonVariants({
99
- className,
100
- size,
101
- variant
102
- }),
103
- "data-slot": "dialog-close",
104
- ...props
105
- });
82
+ return /* @__PURE__ */ jsx(DialogPrimitive.Close, {
83
+ className: buttonVariants({
84
+ className,
85
+ size,
86
+ variant
87
+ }),
88
+ "data-slot": "dialog-close",
89
+ ...props
90
+ });
106
91
  }
92
+ //#endregion
107
93
  export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
@@ -1,33 +1,65 @@
1
- import type { VariantProps } from "@codefast/tailwind-variants";
2
- import type { ComponentProps, JSX } from "react";
3
- import { Drawer as DrawerPrimitive } from "vaul";
4
- import { buttonVariants } from "./button";
5
- type DrawerProps = ComponentProps<typeof DrawerPrimitive.Root>;
6
- declare function Drawer({ shouldScaleBackground, ...props }: DrawerProps): JSX.Element;
7
- type DrawerTriggerProps = ComponentProps<typeof DrawerPrimitive.Trigger>;
8
- declare function DrawerTrigger({ ...props }: DrawerTriggerProps): JSX.Element;
9
- interface DrawerContentProps extends ComponentProps<typeof DrawerPrimitive.Content> {
10
- classNames?: {
11
- content?: string;
12
- handle?: string;
13
- overlay?: string;
14
- };
1
+ import { buttonVariants } from "./button.js";
2
+ import { VariantProps } from "@codefast/tailwind-variants";
3
+ import { ComponentProps, JSX } from "react";
4
+ import { Drawer as Drawer$1 } from "vaul";
5
+
6
+ //#region src/components/drawer.d.ts
7
+ type DrawerProps = ComponentProps<typeof Drawer$1.Root>;
8
+ declare function Drawer({
9
+ shouldScaleBackground,
10
+ ...props
11
+ }: DrawerProps): JSX.Element;
12
+ type DrawerTriggerProps = ComponentProps<typeof Drawer$1.Trigger>;
13
+ declare function DrawerTrigger({
14
+ ...props
15
+ }: DrawerTriggerProps): JSX.Element;
16
+ interface DrawerContentProps extends ComponentProps<typeof Drawer$1.Content> {
17
+ classNames?: {
18
+ content?: string;
19
+ handle?: string;
20
+ overlay?: string;
21
+ };
15
22
  }
16
- declare function DrawerContent({ children, className, classNames, ...props }: DrawerContentProps): JSX.Element;
23
+ declare function DrawerContent({
24
+ children,
25
+ className,
26
+ classNames,
27
+ ...props
28
+ }: DrawerContentProps): JSX.Element;
17
29
  type DrawerHeaderProps = ComponentProps<"div">;
18
- declare function DrawerHeader({ className, ...props }: DrawerHeaderProps): JSX.Element;
30
+ declare function DrawerHeader({
31
+ className,
32
+ ...props
33
+ }: DrawerHeaderProps): JSX.Element;
19
34
  type DrawerBodyProps = ComponentProps<"div">;
20
- declare function DrawerBody({ className, ...props }: DrawerBodyProps): JSX.Element;
35
+ declare function DrawerBody({
36
+ className,
37
+ ...props
38
+ }: DrawerBodyProps): JSX.Element;
21
39
  type DrawerFooterProps = ComponentProps<"div">;
22
- declare function DrawerFooter({ className, ...props }: DrawerFooterProps): JSX.Element;
23
- type DrawerTitleProps = ComponentProps<typeof DrawerPrimitive.Title>;
24
- declare function DrawerTitle({ className, ...props }: DrawerTitleProps): JSX.Element;
25
- type DrawerDescriptionProps = ComponentProps<typeof DrawerPrimitive.Description>;
26
- declare function DrawerDescription({ className, ...props }: DrawerDescriptionProps): JSX.Element;
27
- interface DrawerCloseProps extends ComponentProps<typeof DrawerPrimitive.Close> {
28
- size?: VariantProps<typeof buttonVariants>["size"];
29
- variant?: VariantProps<typeof buttonVariants>["variant"];
40
+ declare function DrawerFooter({
41
+ className,
42
+ ...props
43
+ }: DrawerFooterProps): JSX.Element;
44
+ type DrawerTitleProps = ComponentProps<typeof Drawer$1.Title>;
45
+ declare function DrawerTitle({
46
+ className,
47
+ ...props
48
+ }: DrawerTitleProps): JSX.Element;
49
+ type DrawerDescriptionProps = ComponentProps<typeof Drawer$1.Description>;
50
+ declare function DrawerDescription({
51
+ className,
52
+ ...props
53
+ }: DrawerDescriptionProps): JSX.Element;
54
+ interface DrawerCloseProps extends ComponentProps<typeof Drawer$1.Close> {
55
+ size?: VariantProps<typeof buttonVariants>["size"];
56
+ variant?: VariantProps<typeof buttonVariants>["variant"];
30
57
  }
31
- declare function DrawerClose({ className, size, variant, ...props }: DrawerCloseProps): JSX.Element;
32
- export { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, };
33
- export type { DrawerBodyProps, DrawerCloseProps, DrawerContentProps, DrawerDescriptionProps, DrawerFooterProps, DrawerHeaderProps, DrawerProps, DrawerTitleProps, DrawerTriggerProps, };
58
+ declare function DrawerClose({
59
+ className,
60
+ size,
61
+ variant,
62
+ ...props
63
+ }: DrawerCloseProps): JSX.Element;
64
+ //#endregion
65
+ export { Drawer, DrawerBody, type DrawerBodyProps, DrawerClose, type DrawerCloseProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, type DrawerProps, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps };