@codefast/ui 0.3.11-canary.0 → 0.3.11-canary.2

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 (221) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/components/accordion.d.ts +29 -10
  3. package/dist/components/accordion.js +38 -37
  4. package/dist/components/alert-dialog.d.ts +60 -24
  5. package/dist/components/alert-dialog.js +69 -72
  6. package/dist/components/alert.d.ts +27 -15
  7. package/dist/components/alert.js +29 -31
  8. package/dist/components/aspect-ratio.d.ts +8 -4
  9. package/dist/components/aspect-ratio.js +7 -5
  10. package/dist/components/avatar.d.ts +17 -6
  11. package/dist/components/avatar.js +19 -17
  12. package/dist/components/badge.d.ts +21 -14
  13. package/dist/components/badge.js +19 -22
  14. package/dist/components/breadcrumb.d.ts +35 -12
  15. package/dist/components/breadcrumb.js +48 -54
  16. package/dist/components/button-group.d.ts +29 -14
  17. package/dist/components/button-group.js +27 -32
  18. package/dist/components/button.d.ts +35 -25
  19. package/dist/components/button.js +50 -48
  20. package/dist/components/calendar.d.ts +24 -9
  21. package/dist/components/calendar.js +92 -98
  22. package/dist/components/card.d.ts +34 -10
  23. package/dist/components/card.js +39 -37
  24. package/dist/components/carousel.d.ts +55 -24
  25. package/dist/components/carousel.js +113 -130
  26. package/dist/components/chart.d.ts +72 -36
  27. package/dist/components/chart.js +154 -166
  28. package/dist/components/checkbox-cards.d.ts +15 -8
  29. package/dist/components/checkbox-cards.js +22 -25
  30. package/dist/components/checkbox-group.d.ts +16 -8
  31. package/dist/components/checkbox-group.js +19 -19
  32. package/dist/components/checkbox.d.ts +9 -4
  33. package/dist/components/checkbox.js +14 -14
  34. package/dist/components/collapsible.d.ts +14 -6
  35. package/dist/components/collapsible.js +18 -16
  36. package/dist/components/command.d.ts +55 -23
  37. package/dist/components/command.js +70 -85
  38. package/dist/components/context-menu.d.ts +72 -22
  39. package/dist/components/context-menu.js +88 -109
  40. package/dist/components/dialog.d.ts +53 -22
  41. package/dist/components/dialog.js +71 -85
  42. package/dist/components/drawer.d.ts +60 -28
  43. package/dist/components/drawer.js +59 -67
  44. package/dist/components/dropdown-menu.d.ts +73 -22
  45. package/dist/components/dropdown-menu.js +95 -112
  46. package/dist/components/empty.d.ts +37 -15
  47. package/dist/components/empty.js +43 -45
  48. package/dist/components/field.d.ts +63 -25
  49. package/dist/components/field.js +88 -104
  50. package/dist/components/form.d.ts +37 -15
  51. package/dist/components/form.js +65 -70
  52. package/dist/components/hover-card.d.ts +21 -7
  53. package/dist/components/hover-card.js +24 -24
  54. package/dist/components/input-group.d.ts +53 -28
  55. package/dist/components/input-group.js +63 -77
  56. package/dist/components/input-number.d.ts +28 -7
  57. package/dist/components/input-number.js +55 -59
  58. package/dist/components/input-otp.d.ts +24 -10
  59. package/dist/components/input-otp.js +33 -37
  60. package/dist/components/input-password.d.ts +12 -5
  61. package/dist/components/input-password.js +31 -32
  62. package/dist/components/input-search.d.ts +18 -8
  63. package/dist/components/input-search.js +43 -41
  64. package/dist/components/input.d.ts +10 -4
  65. package/dist/components/input.js +9 -7
  66. package/dist/components/item.d.ts +69 -32
  67. package/dist/components/item.js +89 -92
  68. package/dist/components/kbd.d.ts +13 -5
  69. package/dist/components/kbd.js +13 -11
  70. package/dist/components/label.d.ts +9 -4
  71. package/dist/components/label.js +9 -7
  72. package/dist/components/menubar.d.ts +80 -23
  73. package/dist/components/menubar.js +97 -118
  74. package/dist/components/native-select.d.ts +16 -6
  75. package/dist/components/native-select.js +25 -26
  76. package/dist/components/navigation-menu.d.ts +36 -12
  77. package/dist/components/navigation-menu.js +60 -75
  78. package/dist/components/pagination.d.ts +35 -14
  79. package/dist/components/pagination.js +54 -69
  80. package/dist/components/popover.d.ts +24 -8
  81. package/dist/components/popover.js +28 -28
  82. package/dist/components/progress-circle.d.ts +106 -88
  83. package/dist/components/progress-circle.js +106 -138
  84. package/dist/components/progress.d.ts +10 -4
  85. package/dist/components/progress.js +14 -14
  86. package/dist/components/radio-cards.d.ts +10 -4
  87. package/dist/components/radio-cards.js +22 -23
  88. package/dist/components/radio-group.d.ts +13 -5
  89. package/dist/components/radio-group.js +18 -16
  90. package/dist/components/radio.d.ts +12 -5
  91. package/dist/components/radio.js +10 -8
  92. package/dist/components/resizable.d.ts +18 -7
  93. package/dist/components/resizable.js +22 -22
  94. package/dist/components/scroll-area.d.ts +33 -20
  95. package/dist/components/scroll-area.js +84 -88
  96. package/dist/components/select.d.ts +50 -16
  97. package/dist/components/select.js +77 -96
  98. package/dist/components/separator.d.ts +29 -19
  99. package/dist/components/separator.js +36 -34
  100. package/dist/components/sheet.d.ts +62 -29
  101. package/dist/components/sheet.js +79 -100
  102. package/dist/components/sidebar.d.ts +160 -66
  103. package/dist/components/sidebar.js +294 -336
  104. package/dist/components/skeleton.d.ts +9 -4
  105. package/dist/components/skeleton.js +8 -6
  106. package/dist/components/slider.d.ts +13 -4
  107. package/dist/components/slider.js +34 -40
  108. package/dist/components/sonner.d.ts +10 -7
  109. package/dist/components/sonner.js +16 -14
  110. package/dist/components/spinner.d.ts +12 -5
  111. package/dist/components/spinner.js +33 -35
  112. package/dist/components/switch.d.ts +9 -4
  113. package/dist/components/switch.js +13 -11
  114. package/dist/components/table.d.ts +37 -11
  115. package/dist/components/table.js +47 -45
  116. package/dist/components/tabs.d.ts +21 -7
  117. package/dist/components/tabs.js +24 -22
  118. package/dist/components/textarea.d.ts +9 -4
  119. package/dist/components/textarea.js +8 -6
  120. package/dist/components/toggle-group.d.ts +24 -9
  121. package/dist/components/toggle-group.js +41 -42
  122. package/dist/components/toggle.d.ts +25 -17
  123. package/dist/components/toggle.js +30 -28
  124. package/dist/components/tooltip.d.ts +24 -8
  125. package/dist/components/tooltip.js +29 -32
  126. package/dist/hooks/use-animated-value.d.ts +4 -1
  127. package/dist/hooks/use-animated-value.js +57 -36
  128. package/dist/hooks/use-copy-to-clipboard.d.ts +11 -5
  129. package/dist/hooks/use-copy-to-clipboard.js +39 -20
  130. package/dist/hooks/use-is-mobile.d.ts +4 -1
  131. package/dist/hooks/use-is-mobile.js +21 -1
  132. package/dist/hooks/use-media-query.d.ts +4 -1
  133. package/dist/hooks/use-media-query.js +45 -18
  134. package/dist/hooks/use-mutation-observer.d.ts +6 -2
  135. package/dist/hooks/use-mutation-observer.js +34 -16
  136. package/dist/hooks/use-pagination.d.ts +22 -14
  137. package/dist/hooks/use-pagination.js +100 -49
  138. package/dist/index.d.ts +69 -130
  139. package/dist/index.js +11 -11
  140. package/dist/primitives/checkbox-group.d.ts +105 -83
  141. package/dist/primitives/checkbox-group.js +111 -84
  142. package/dist/primitives/input-number.d.ts +51 -40
  143. package/dist/primitives/input-number.js +483 -350
  144. package/dist/primitives/input.d.ts +48 -42
  145. package/dist/primitives/input.js +65 -43
  146. package/dist/primitives/progress-circle.d.ts +79 -48
  147. package/dist/primitives/progress-circle.js +154 -105
  148. package/package.json +81 -156
  149. package/dist/components/accordion.cjs +0 -98
  150. package/dist/components/alert-dialog.cjs +0 -156
  151. package/dist/components/alert.cjs +0 -84
  152. package/dist/components/aspect-ratio.cjs +0 -44
  153. package/dist/components/avatar.cjs +0 -66
  154. package/dist/components/badge.cjs +0 -67
  155. package/dist/components/breadcrumb.cjs +0 -125
  156. package/dist/components/button-group.cjs +0 -87
  157. package/dist/components/button.cjs +0 -92
  158. package/dist/components/calendar.cjs +0 -151
  159. package/dist/components/card.cjs +0 -105
  160. package/dist/components/carousel.cjs +0 -211
  161. package/dist/components/chart.cjs +0 -251
  162. package/dist/components/checkbox-cards.cjs +0 -70
  163. package/dist/components/checkbox-group.cjs +0 -64
  164. package/dist/components/checkbox.cjs +0 -54
  165. package/dist/components/collapsible.cjs +0 -62
  166. package/dist/components/command.cjs +0 -168
  167. package/dist/components/context-menu.cjs +0 -219
  168. package/dist/components/dialog.cjs +0 -165
  169. package/dist/components/drawer.cjs +0 -144
  170. package/dist/components/dropdown-menu.cjs +0 -222
  171. package/dist/components/empty.cjs +0 -113
  172. package/dist/components/field.cjs +0 -194
  173. package/dist/components/form.cjs +0 -152
  174. package/dist/components/hover-card.cjs +0 -78
  175. package/dist/components/input-group.cjs +0 -156
  176. package/dist/components/input-number.cjs +0 -99
  177. package/dist/components/input-otp.cjs +0 -102
  178. package/dist/components/input-password.cjs +0 -72
  179. package/dist/components/input-search.cjs +0 -81
  180. package/dist/components/input.cjs +0 -46
  181. package/dist/components/item.cjs +0 -186
  182. package/dist/components/kbd.cjs +0 -54
  183. package/dist/components/label.cjs +0 -46
  184. package/dist/components/menubar.cjs +0 -233
  185. package/dist/components/native-select.cjs +0 -75
  186. package/dist/components/navigation-menu.cjs +0 -146
  187. package/dist/components/pagination.cjs +0 -138
  188. package/dist/components/popover.cjs +0 -87
  189. package/dist/components/progress-circle.cjs +0 -185
  190. package/dist/components/progress.cjs +0 -53
  191. package/dist/components/radio-cards.cjs +0 -67
  192. package/dist/components/radio-group.cjs +0 -60
  193. package/dist/components/radio.cjs +0 -48
  194. package/dist/components/resizable.cjs +0 -72
  195. package/dist/components/scroll-area.cjs +0 -141
  196. package/dist/components/select.cjs +0 -181
  197. package/dist/components/separator.cjs +0 -83
  198. package/dist/components/sheet.cjs +0 -185
  199. package/dist/components/sidebar.cjs +0 -507
  200. package/dist/components/skeleton.cjs +0 -44
  201. package/dist/components/slider.cjs +0 -80
  202. package/dist/components/sonner.cjs +0 -58
  203. package/dist/components/spinner.cjs +0 -76
  204. package/dist/components/switch.cjs +0 -50
  205. package/dist/components/table.cjs +0 -118
  206. package/dist/components/tabs.cjs +0 -76
  207. package/dist/components/textarea.cjs +0 -44
  208. package/dist/components/toggle-group.cjs +0 -91
  209. package/dist/components/toggle.cjs +0 -72
  210. package/dist/components/tooltip.cjs +0 -91
  211. package/dist/hooks/use-animated-value.cjs +0 -75
  212. package/dist/hooks/use-copy-to-clipboard.cjs +0 -58
  213. package/dist/hooks/use-is-mobile.cjs +0 -40
  214. package/dist/hooks/use-media-query.cjs +0 -57
  215. package/dist/hooks/use-mutation-observer.cjs +0 -57
  216. package/dist/hooks/use-pagination.cjs +0 -93
  217. package/dist/index.cjs +0 -1081
  218. package/dist/primitives/checkbox-group.cjs +0 -151
  219. package/dist/primitives/input-number.cjs +0 -439
  220. package/dist/primitives/input.cjs +0 -99
  221. package/dist/primitives/progress-circle.cjs +0 -199
@@ -1,43 +1,45 @@
1
1
  "use client";
2
- import { jsx } from "react/jsx-runtime";
3
2
  import { cn, tv } from "@codefast/tailwind-variants";
4
- import { Root } from "@radix-ui/react-separator";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
5
+ //#region src/components/separator.tsx
5
6
  const separatorVariants = tv({
6
- base: "relative flex shrink-0 items-center bg-border",
7
- defaultVariants: {
8
- align: "center",
9
- orientation: "horizontal"
10
- },
11
- variants: {
12
- align: {
13
- center: "justify-center",
14
- end: "justify-end",
15
- start: "justify-start"
16
- },
17
- orientation: {
18
- horizontal: "h-px w-full",
19
- vertical: "h-full w-px flex-col"
20
- }
21
- }
7
+ base: "relative flex shrink-0 items-center bg-border",
8
+ defaultVariants: {
9
+ align: "center",
10
+ orientation: "horizontal"
11
+ },
12
+ variants: {
13
+ align: {
14
+ center: "justify-center",
15
+ end: "justify-end",
16
+ start: "justify-start"
17
+ },
18
+ orientation: {
19
+ horizontal: "h-px w-full",
20
+ vertical: "h-full w-px flex-col"
21
+ }
22
+ }
22
23
  });
23
24
  function Separator({ align, className, decorative = true, orientation, ...props }) {
24
- return /*#__PURE__*/ jsx(Root, {
25
- className: separatorVariants({
26
- align,
27
- className,
28
- orientation
29
- }),
30
- "data-slot": "separator",
31
- decorative: decorative,
32
- orientation: orientation,
33
- ...props
34
- });
25
+ return /* @__PURE__ */ jsx(SeparatorPrimitive.Root, {
26
+ className: separatorVariants({
27
+ align,
28
+ className,
29
+ orientation
30
+ }),
31
+ "data-slot": "separator",
32
+ decorative,
33
+ orientation,
34
+ ...props
35
+ });
35
36
  }
36
37
  function SeparatorItem({ className, ...props }) {
37
- return /*#__PURE__*/ jsx("div", {
38
- className: cn("absolute mx-2 bg-background px-2 text-sm text-muted-foreground", className),
39
- "data-slot": "separator-item",
40
- ...props
41
- });
38
+ return /* @__PURE__ */ jsx("div", {
39
+ className: cn("absolute mx-2 bg-background px-2 text-sm text-muted-foreground", className),
40
+ "data-slot": "separator-item",
41
+ ...props
42
+ });
42
43
  }
44
+ //#endregion
43
45
  export { Separator, SeparatorItem, separatorVariants };
@@ -1,42 +1,75 @@
1
- import type { VariantProps } from "@codefast/tailwind-variants";
2
- import type { ComponentProps, JSX } from "react";
1
+ import { buttonVariants } from "./button.js";
2
+ import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
3
+ import { VariantProps } from "@codefast/tailwind-variants";
4
+ import { ComponentProps, JSX } from "react";
3
5
  import * as SheetPrimitive from "@radix-ui/react-dialog";
4
- import { buttonVariants } from "./button";
5
- declare const sheetContentVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
6
- side: {
7
- bottom: string;
8
- left: string;
9
- right: string;
10
- top: string;
11
- };
6
+
7
+ //#region src/components/sheet.d.ts
8
+ declare const sheetContentVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
9
+ side: {
10
+ bottom: string;
11
+ left: string;
12
+ right: string;
13
+ top: string;
14
+ };
12
15
  }, Record<string, never>>;
13
16
  type SheetProps = ComponentProps<typeof SheetPrimitive.Root>;
14
- declare function Sheet({ children, ...props }: SheetProps): JSX.Element;
17
+ declare function Sheet({
18
+ children,
19
+ ...props
20
+ }: SheetProps): JSX.Element;
15
21
  type SheetTriggerProps = ComponentProps<typeof SheetPrimitive.Trigger>;
16
- declare function SheetTrigger({ ...props }: SheetTriggerProps): JSX.Element;
22
+ declare function SheetTrigger({
23
+ ...props
24
+ }: SheetTriggerProps): JSX.Element;
17
25
  interface SheetContentProps extends ComponentProps<typeof SheetPrimitive.Content>, VariantProps<typeof sheetContentVariants> {
18
- classNames?: {
19
- close?: string;
20
- content?: string;
21
- overlay?: string;
22
- };
26
+ classNames?: {
27
+ close?: string;
28
+ content?: string;
29
+ overlay?: string;
30
+ };
23
31
  }
24
- declare function SheetContent({ children, className, classNames, side, ...props }: SheetContentProps): JSX.Element;
32
+ declare function SheetContent({
33
+ children,
34
+ className,
35
+ classNames,
36
+ side,
37
+ ...props
38
+ }: SheetContentProps): JSX.Element;
25
39
  type SheetHeaderProps = ComponentProps<"div">;
26
- declare function SheetHeader({ className, ...props }: SheetHeaderProps): JSX.Element;
40
+ declare function SheetHeader({
41
+ className,
42
+ ...props
43
+ }: SheetHeaderProps): JSX.Element;
27
44
  type SheetBodyProps = ComponentProps<"div">;
28
- declare function SheetBody({ className, ...props }: SheetBodyProps): JSX.Element;
45
+ declare function SheetBody({
46
+ className,
47
+ ...props
48
+ }: SheetBodyProps): JSX.Element;
29
49
  type SheetFooterProps = ComponentProps<"div">;
30
- declare function SheetFooter({ className, ...props }: SheetFooterProps): JSX.Element;
50
+ declare function SheetFooter({
51
+ className,
52
+ ...props
53
+ }: SheetFooterProps): JSX.Element;
31
54
  type SheetTitleProps = ComponentProps<typeof SheetPrimitive.Title>;
32
- declare function SheetTitle({ className, ...props }: SheetTitleProps): JSX.Element;
55
+ declare function SheetTitle({
56
+ className,
57
+ ...props
58
+ }: SheetTitleProps): JSX.Element;
33
59
  type SheetDescriptionProps = ComponentProps<typeof SheetPrimitive.Description>;
34
- declare function SheetDescription({ className, ...props }: SheetDescriptionProps): JSX.Element;
60
+ declare function SheetDescription({
61
+ className,
62
+ ...props
63
+ }: SheetDescriptionProps): JSX.Element;
35
64
  interface SheetCloseProps extends ComponentProps<typeof SheetPrimitive.Close> {
36
- size?: VariantProps<typeof buttonVariants>["size"];
37
- variant?: VariantProps<typeof buttonVariants>["variant"];
65
+ size?: VariantProps<typeof buttonVariants>["size"];
66
+ variant?: VariantProps<typeof buttonVariants>["variant"];
38
67
  }
39
- declare function SheetClose({ className, size, variant, ...props }: SheetCloseProps): JSX.Element;
40
- export { sheetContentVariants };
41
- export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, };
42
- export type { SheetBodyProps, SheetCloseProps, SheetContentProps, SheetDescriptionProps, SheetFooterProps, SheetHeaderProps, SheetProps, SheetTitleProps, SheetTriggerProps, };
68
+ declare function SheetClose({
69
+ className,
70
+ size,
71
+ variant,
72
+ ...props
73
+ }: SheetCloseProps): JSX.Element;
74
+ //#endregion
75
+ export { Sheet, SheetBody, type SheetBodyProps, SheetClose, type SheetCloseProps, SheetContent, type SheetContentProps, SheetDescription, type SheetDescriptionProps, SheetFooter, type SheetFooterProps, SheetHeader, type SheetHeaderProps, type SheetProps, SheetTitle, type SheetTitleProps, SheetTrigger, type SheetTriggerProps, sheetContentVariants };
@@ -1,124 +1,103 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { buttonVariants } from "./button.js";
3
3
  import { cn, tv } 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 SheetPrimitive from "@radix-ui/react-dialog";
7
+ //#region src/components/sheet.tsx
7
8
  const sheetContentVariants = tv({
8
- base: "fixed z-50 flex flex-col overflow-auto bg-background shadow-lg ease-ui data-[state=closed]:animate-out data-[state=closed]:animation-duration-500 data-[state=open]:animate-in data-[state=open]:animation-duration-500",
9
- defaultVariants: {
10
- side: "right"
11
- },
12
- variants: {
13
- side: {
14
- bottom: "inset-x-0 bottom-0 max-h-[80vh] border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
15
- left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
16
- right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
17
- top: "inset-x-0 top-0 max-h-[80vh] border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top"
18
- }
19
- }
9
+ base: "fixed z-50 flex flex-col overflow-auto bg-background shadow-lg ease-ui data-[state=closed]:animate-out data-[state=closed]:animation-duration-500 data-[state=open]:animate-in data-[state=open]:animation-duration-500",
10
+ defaultVariants: { side: "right" },
11
+ variants: { side: {
12
+ bottom: "inset-x-0 bottom-0 max-h-[80vh] border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
13
+ left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
14
+ right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
15
+ top: "inset-x-0 top-0 max-h-[80vh] border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top"
16
+ } }
20
17
  });
21
18
  function Sheet({ children, ...props }) {
22
- return /*#__PURE__*/ jsx(Root, {
23
- "data-slot": "sheet",
24
- ...props,
25
- children: children
26
- });
19
+ return /* @__PURE__ */ jsx(SheetPrimitive.Root, {
20
+ "data-slot": "sheet",
21
+ ...props,
22
+ children
23
+ });
27
24
  }
28
25
  function SheetTrigger({ ...props }) {
29
- return /*#__PURE__*/ jsx(Trigger, {
30
- "data-slot": "sheet-trigger",
31
- ...props
32
- });
26
+ return /* @__PURE__ */ jsx(SheetPrimitive.Trigger, {
27
+ "data-slot": "sheet-trigger",
28
+ ...props
29
+ });
33
30
  }
34
31
  function SheetContent({ children, className, classNames, side = "right", ...props }) {
35
- return /*#__PURE__*/ jsxs(Portal, {
36
- children: [
37
- /*#__PURE__*/ jsx(Overlay, {
38
- className: cn("fixed inset-0 z-50 bg-black/50 ease-ui data-[state=closed]:animate-out data-[state=closed]:animation-duration-500 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:animation-duration-500 data-[state=open]:fade-in-0", classNames?.overlay),
39
- "data-slot": "sheet-overlay"
40
- }),
41
- /*#__PURE__*/ jsxs(Content, {
42
- className: sheetContentVariants({
43
- className: [
44
- classNames?.content,
45
- className
46
- ],
47
- side
48
- }),
49
- "data-slot": "sheet-content",
50
- ...props,
51
- children: [
52
- children,
53
- /*#__PURE__*/ jsxs(Close, {
54
- className: buttonVariants({
55
- className: [
56
- "absolute top-4 right-4 size-7",
57
- classNames?.close
58
- ],
59
- size: "icon",
60
- variant: "ghost"
61
- }),
62
- "data-slot": "sheet-close",
63
- children: [
64
- /*#__PURE__*/ jsx(XIcon, {
65
- className: "size-4"
66
- }),
67
- /*#__PURE__*/ jsx("span", {
68
- className: "sr-only",
69
- children: "Close"
70
- })
71
- ]
72
- })
73
- ]
74
- })
75
- ]
76
- });
32
+ return /* @__PURE__ */ jsxs(SheetPrimitive.Portal, { children: [/* @__PURE__ */ jsx(SheetPrimitive.Overlay, {
33
+ className: cn("fixed inset-0 z-50 bg-black/50 ease-ui data-[state=closed]:animate-out data-[state=closed]:animation-duration-500 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:animation-duration-500 data-[state=open]:fade-in-0", classNames?.overlay),
34
+ "data-slot": "sheet-overlay"
35
+ }), /* @__PURE__ */ jsxs(SheetPrimitive.Content, {
36
+ className: sheetContentVariants({
37
+ className: [classNames?.content, className],
38
+ side
39
+ }),
40
+ "data-slot": "sheet-content",
41
+ ...props,
42
+ children: [children, /* @__PURE__ */ jsxs(SheetPrimitive.Close, {
43
+ className: buttonVariants({
44
+ className: ["absolute top-4 right-4 size-7", classNames?.close],
45
+ size: "icon",
46
+ variant: "ghost"
47
+ }),
48
+ "data-slot": "sheet-close",
49
+ children: [/* @__PURE__ */ jsx(XIcon, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
50
+ className: "sr-only",
51
+ children: "Close"
52
+ })]
53
+ })]
54
+ })] });
77
55
  }
78
56
  function SheetHeader({ className, ...props }) {
79
- return /*#__PURE__*/ jsx("header", {
80
- className: cn("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-4 text-center sm:text-left", className),
81
- "data-slot": "sheet-header",
82
- ...props
83
- });
57
+ return /* @__PURE__ */ jsx("header", {
58
+ className: cn("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-4 text-center sm:text-left", className),
59
+ "data-slot": "sheet-header",
60
+ ...props
61
+ });
84
62
  }
85
63
  function SheetBody({ className, ...props }) {
86
- return /*#__PURE__*/ jsx("main", {
87
- className: cn("px-6 py-2", className),
88
- "data-slot": "sheet-body",
89
- ...props
90
- });
64
+ return /* @__PURE__ */ jsx("main", {
65
+ className: cn("px-6 py-2", className),
66
+ "data-slot": "sheet-body",
67
+ ...props
68
+ });
91
69
  }
92
70
  function SheetFooter({ className, ...props }) {
93
- return /*#__PURE__*/ jsx("footer", {
94
- className: cn("flex shrink-0 flex-col-reverse gap-2 px-6 pt-4 pb-6 sm:flex-row sm:justify-end", className),
95
- "data-slot": "sheet-footer",
96
- ...props
97
- });
71
+ return /* @__PURE__ */ jsx("footer", {
72
+ className: cn("flex shrink-0 flex-col-reverse gap-2 px-6 pt-4 pb-6 sm:flex-row sm:justify-end", className),
73
+ "data-slot": "sheet-footer",
74
+ ...props
75
+ });
98
76
  }
99
77
  function SheetTitle({ className, ...props }) {
100
- return /*#__PURE__*/ jsx(Title, {
101
- className: cn("text-lg font-semibold text-foreground", className),
102
- "data-slot": "sheet-title",
103
- ...props
104
- });
78
+ return /* @__PURE__ */ jsx(SheetPrimitive.Title, {
79
+ className: cn("text-lg font-semibold text-foreground", className),
80
+ "data-slot": "sheet-title",
81
+ ...props
82
+ });
105
83
  }
106
84
  function SheetDescription({ className, ...props }) {
107
- return /*#__PURE__*/ jsx(Description, {
108
- className: cn("text-sm text-muted-foreground", className),
109
- "data-slot": "sheet-description",
110
- ...props
111
- });
85
+ return /* @__PURE__ */ jsx(SheetPrimitive.Description, {
86
+ className: cn("text-sm text-muted-foreground", className),
87
+ "data-slot": "sheet-description",
88
+ ...props
89
+ });
112
90
  }
113
91
  function SheetClose({ className, size, variant = "outline", ...props }) {
114
- return /*#__PURE__*/ jsx(Close, {
115
- className: buttonVariants({
116
- className,
117
- size,
118
- variant
119
- }),
120
- "data-slot": "sheet-close",
121
- ...props
122
- });
92
+ return /* @__PURE__ */ jsx(SheetPrimitive.Close, {
93
+ className: buttonVariants({
94
+ className,
95
+ size,
96
+ variant
97
+ }),
98
+ "data-slot": "sheet-close",
99
+ ...props
100
+ });
123
101
  }
102
+ //#endregion
124
103
  export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, sheetContentVariants };
@@ -1,101 +1,195 @@
1
- import type { VariantProps } from "@codefast/tailwind-variants";
2
- import type { ComponentProps, Dispatch, JSX, SetStateAction } from "react";
3
- import { Button } from "./button";
4
- import { Input } from "./input";
5
- import { Separator } from "./separator";
6
- import { TooltipContent } from "./tooltip";
7
- declare const sidebarMenuButtonVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
8
- size: {
9
- sm: string;
10
- md: string;
11
- lg: string;
12
- };
13
- variant: {
14
- default: string;
15
- outline: string;
16
- };
1
+ import { Button } from "./button.js";
2
+ import { Separator } from "./separator.js";
3
+ import { Input } from "./input.js";
4
+ import { TooltipContent } from "./tooltip.js";
5
+ import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
6
+ import { VariantProps } from "@codefast/tailwind-variants";
7
+ import { ComponentProps, Dispatch, JSX, SetStateAction } from "react";
8
+
9
+ //#region src/components/sidebar.d.ts
10
+ declare const sidebarMenuButtonVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
11
+ size: {
12
+ sm: string;
13
+ md: string;
14
+ lg: string;
15
+ };
16
+ variant: {
17
+ default: string;
18
+ outline: string;
19
+ };
17
20
  }, Record<string, never>>;
18
21
  interface SidebarContextValue {
19
- isMobile: boolean;
20
- open: boolean;
21
- openMobile: boolean;
22
- setOpen: (open: boolean) => void;
23
- setOpenMobile: Dispatch<SetStateAction<boolean>>;
24
- state: "collapsed" | "expanded";
25
- toggleSidebar: () => void;
22
+ isMobile: boolean;
23
+ open: boolean;
24
+ openMobile: boolean;
25
+ setOpen: (open: boolean) => void;
26
+ setOpenMobile: Dispatch<SetStateAction<boolean>>;
27
+ state: "collapsed" | "expanded";
28
+ toggleSidebar: () => void;
26
29
  }
27
30
  declare const useSidebar: (consumerName: string) => SidebarContextValue;
28
31
  interface SidebarProviderProps extends ComponentProps<"div"> {
29
- defaultOpen?: boolean;
30
- onOpenChange?: (open: boolean) => void;
31
- open?: boolean;
32
+ defaultOpen?: boolean;
33
+ onOpenChange?: (open: boolean) => void;
34
+ open?: boolean;
32
35
  }
33
- declare function SidebarProvider({ children, className, defaultOpen, onOpenChange: setOpenProperty, open: openProperty, style, ...props }: SidebarProviderProps): JSX.Element;
36
+ declare function SidebarProvider({
37
+ children,
38
+ className,
39
+ defaultOpen,
40
+ onOpenChange: setOpenProperty,
41
+ open: openProperty,
42
+ style,
43
+ ...props
44
+ }: SidebarProviderProps): JSX.Element;
34
45
  interface SidebarProps extends ComponentProps<"div"> {
35
- collapsible?: "icon" | "none" | "offcanvas";
36
- side?: "left" | "right";
37
- variant?: "floating" | "inset" | "sidebar";
46
+ collapsible?: "icon" | "none" | "offcanvas";
47
+ side?: "left" | "right";
48
+ variant?: "floating" | "inset" | "sidebar";
38
49
  }
39
- declare function Sidebar({ children, className, collapsible, side, variant, ...props }: SidebarProps): JSX.Element;
50
+ declare function Sidebar({
51
+ children,
52
+ className,
53
+ collapsible,
54
+ side,
55
+ variant,
56
+ ...props
57
+ }: SidebarProps): JSX.Element;
40
58
  type SidebarTriggerProps = ComponentProps<typeof Button>;
41
- declare function SidebarTrigger({ className, onClick, ...props }: SidebarTriggerProps): JSX.Element;
59
+ declare function SidebarTrigger({
60
+ className,
61
+ onClick,
62
+ ...props
63
+ }: SidebarTriggerProps): JSX.Element;
42
64
  type SidebarRailProps = ComponentProps<"button">;
43
- declare function SidebarRail({ className, ...props }: SidebarRailProps): JSX.Element;
65
+ declare function SidebarRail({
66
+ className,
67
+ ...props
68
+ }: SidebarRailProps): JSX.Element;
44
69
  type SidebarInsetProps = ComponentProps<"main">;
45
- declare function SidebarInset({ className, ...props }: SidebarInsetProps): JSX.Element;
70
+ declare function SidebarInset({
71
+ className,
72
+ ...props
73
+ }: SidebarInsetProps): JSX.Element;
46
74
  type SidebarInputProps = ComponentProps<typeof Input>;
47
- declare function SidebarInput({ className, ...props }: SidebarInputProps): JSX.Element;
75
+ declare function SidebarInput({
76
+ className,
77
+ ...props
78
+ }: SidebarInputProps): JSX.Element;
48
79
  type SidebarHeaderProps = ComponentProps<"div">;
49
- declare function SidebarHeader({ className, ...props }: SidebarHeaderProps): JSX.Element;
80
+ declare function SidebarHeader({
81
+ className,
82
+ ...props
83
+ }: SidebarHeaderProps): JSX.Element;
50
84
  type SidebarFooterProps = ComponentProps<"div">;
51
- declare function SidebarFooter({ className, ...props }: SidebarFooterProps): JSX.Element;
85
+ declare function SidebarFooter({
86
+ className,
87
+ ...props
88
+ }: SidebarFooterProps): JSX.Element;
52
89
  type SidebarSeparatorProps = ComponentProps<typeof Separator>;
53
- declare function SidebarSeparator({ className, ...props }: SidebarSeparatorProps): JSX.Element;
90
+ declare function SidebarSeparator({
91
+ className,
92
+ ...props
93
+ }: SidebarSeparatorProps): JSX.Element;
54
94
  type SidebarContentProps = ComponentProps<"div">;
55
- declare function SidebarContent({ className, ...props }: SidebarContentProps): JSX.Element;
95
+ declare function SidebarContent({
96
+ className,
97
+ ...props
98
+ }: SidebarContentProps): JSX.Element;
56
99
  type SidebarGroupProps = ComponentProps<"div">;
57
- declare function SidebarGroup({ className, ...props }: SidebarGroupProps): JSX.Element;
100
+ declare function SidebarGroup({
101
+ className,
102
+ ...props
103
+ }: SidebarGroupProps): JSX.Element;
58
104
  interface SidebarGroupLabelProps extends ComponentProps<"div"> {
59
- asChild?: boolean;
105
+ asChild?: boolean;
60
106
  }
61
- declare function SidebarGroupLabel({ asChild, className, ...props }: SidebarGroupLabelProps): JSX.Element;
107
+ declare function SidebarGroupLabel({
108
+ asChild,
109
+ className,
110
+ ...props
111
+ }: SidebarGroupLabelProps): JSX.Element;
62
112
  interface SidebarGroupActionProps extends ComponentProps<"button"> {
63
- asChild?: boolean;
113
+ asChild?: boolean;
64
114
  }
65
- declare function SidebarGroupAction({ asChild, className, ...props }: SidebarGroupActionProps): JSX.Element;
115
+ declare function SidebarGroupAction({
116
+ asChild,
117
+ className,
118
+ ...props
119
+ }: SidebarGroupActionProps): JSX.Element;
66
120
  type SidebarGroupContentProps = ComponentProps<"div">;
67
- declare function SidebarGroupContent({ className, ...props }: SidebarGroupContentProps): JSX.Element;
121
+ declare function SidebarGroupContent({
122
+ className,
123
+ ...props
124
+ }: SidebarGroupContentProps): JSX.Element;
68
125
  type SidebarMenuProps = ComponentProps<"ul">;
69
- declare function SidebarMenu({ className, ...props }: SidebarMenuProps): JSX.Element;
126
+ declare function SidebarMenu({
127
+ className,
128
+ ...props
129
+ }: SidebarMenuProps): JSX.Element;
70
130
  type SidebarMenuItemProps = ComponentProps<"li">;
71
- declare function SidebarMenuItem({ className, ...props }: SidebarMenuItemProps): JSX.Element;
131
+ declare function SidebarMenuItem({
132
+ className,
133
+ ...props
134
+ }: SidebarMenuItemProps): JSX.Element;
72
135
  interface SidebarMenuButtonProps extends ComponentProps<"button">, VariantProps<typeof sidebarMenuButtonVariants> {
73
- asChild?: boolean;
74
- isActive?: boolean;
75
- tooltip?: ComponentProps<typeof TooltipContent> | string;
136
+ asChild?: boolean;
137
+ isActive?: boolean;
138
+ tooltip?: ComponentProps<typeof TooltipContent> | string;
76
139
  }
77
- declare function SidebarMenuButton({ asChild, className, isActive, size, tooltip, variant, ...props }: SidebarMenuButtonProps): JSX.Element;
140
+ declare function SidebarMenuButton({
141
+ asChild,
142
+ className,
143
+ isActive,
144
+ size,
145
+ tooltip,
146
+ variant,
147
+ ...props
148
+ }: SidebarMenuButtonProps): JSX.Element;
78
149
  interface SidebarMenuActionProps extends ComponentProps<"button"> {
79
- asChild?: boolean;
80
- showOnHover?: boolean;
150
+ asChild?: boolean;
151
+ showOnHover?: boolean;
81
152
  }
82
- declare function SidebarMenuAction({ asChild, className, showOnHover, ...props }: SidebarMenuActionProps): JSX.Element;
153
+ declare function SidebarMenuAction({
154
+ asChild,
155
+ className,
156
+ showOnHover,
157
+ ...props
158
+ }: SidebarMenuActionProps): JSX.Element;
83
159
  type SidebarMenuBadgeProps = ComponentProps<"div">;
84
- declare function SidebarMenuBadge({ className, ...props }: SidebarMenuBadgeProps): JSX.Element;
160
+ declare function SidebarMenuBadge({
161
+ className,
162
+ ...props
163
+ }: SidebarMenuBadgeProps): JSX.Element;
85
164
  interface SidebarMenuSkeletonProps extends ComponentProps<"div"> {
86
- showIcon?: boolean;
165
+ showIcon?: boolean;
87
166
  }
88
- declare function SidebarMenuSkeleton({ className, showIcon, ...props }: SidebarMenuSkeletonProps): JSX.Element;
167
+ declare function SidebarMenuSkeleton({
168
+ className,
169
+ showIcon,
170
+ ...props
171
+ }: SidebarMenuSkeletonProps): JSX.Element;
89
172
  type SidebarMenuSubProps = ComponentProps<"ul">;
90
- declare function SidebarMenuSub({ className, ...props }: SidebarMenuSubProps): JSX.Element;
173
+ declare function SidebarMenuSub({
174
+ className,
175
+ ...props
176
+ }: SidebarMenuSubProps): JSX.Element;
91
177
  type SidebarMenuSubItemProps = ComponentProps<"li">;
92
- declare function SidebarMenuSubItem({ className, ...props }: SidebarMenuSubItemProps): JSX.Element;
178
+ declare function SidebarMenuSubItem({
179
+ className,
180
+ ...props
181
+ }: SidebarMenuSubItemProps): JSX.Element;
93
182
  interface SidebarMenuSubButtonProps extends ComponentProps<"a"> {
94
- asChild?: boolean;
95
- isActive?: boolean;
96
- size?: "md" | "sm";
183
+ asChild?: boolean;
184
+ isActive?: boolean;
185
+ size?: "md" | "sm";
97
186
  }
98
- declare function SidebarMenuSubButton({ asChild, className, isActive, size, ...props }: SidebarMenuSubButtonProps): JSX.Element;
99
- export { sidebarMenuButtonVariants };
100
- export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, };
101
- export type { SidebarContentProps, SidebarFooterProps, SidebarGroupActionProps, SidebarGroupContentProps, SidebarGroupLabelProps, SidebarGroupProps, SidebarHeaderProps, SidebarInputProps, SidebarInsetProps, SidebarMenuActionProps, SidebarMenuBadgeProps, SidebarMenuButtonProps, SidebarMenuItemProps, SidebarMenuProps, SidebarMenuSkeletonProps, SidebarMenuSubButtonProps, SidebarMenuSubItemProps, SidebarMenuSubProps, SidebarProps, SidebarProviderProps, SidebarRailProps, SidebarSeparatorProps, SidebarTriggerProps, };
187
+ declare function SidebarMenuSubButton({
188
+ asChild,
189
+ className,
190
+ isActive,
191
+ size,
192
+ ...props
193
+ }: SidebarMenuSubButtonProps): JSX.Element;
194
+ //#endregion
195
+ export { Sidebar, SidebarContent, type SidebarContentProps, SidebarFooter, type SidebarFooterProps, SidebarGroup, SidebarGroupAction, type SidebarGroupActionProps, SidebarGroupContent, type SidebarGroupContentProps, SidebarGroupLabel, type SidebarGroupLabelProps, type SidebarGroupProps, SidebarHeader, type SidebarHeaderProps, SidebarInput, type SidebarInputProps, SidebarInset, type SidebarInsetProps, SidebarMenu, SidebarMenuAction, type SidebarMenuActionProps, SidebarMenuBadge, type SidebarMenuBadgeProps, SidebarMenuButton, type SidebarMenuButtonProps, SidebarMenuItem, type SidebarMenuItemProps, type SidebarMenuProps, SidebarMenuSkeleton, type SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, type SidebarMenuSubButtonProps, SidebarMenuSubItem, type SidebarMenuSubItemProps, type SidebarMenuSubProps, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarRail, type SidebarRailProps, SidebarSeparator, type SidebarSeparatorProps, SidebarTrigger, type SidebarTriggerProps, sidebarMenuButtonVariants, useSidebar };