@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,5 +1,10 @@
1
- import type { ComponentProps, JSX } from "react";
1
+ import { ComponentProps, JSX } from "react";
2
+
3
+ //#region src/components/skeleton.d.ts
2
4
  type SkeletonProps = ComponentProps<"div">;
3
- declare function Skeleton({ className, ...props }: SkeletonProps): JSX.Element;
4
- export { Skeleton };
5
- export type { SkeletonProps };
5
+ declare function Skeleton({
6
+ className,
7
+ ...props
8
+ }: SkeletonProps): JSX.Element;
9
+ //#endregion
10
+ export { Skeleton, type SkeletonProps };
@@ -1,10 +1,12 @@
1
- import { jsx } from "react/jsx-runtime";
2
1
  import { cn } from "@codefast/tailwind-variants";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/components/skeleton.tsx
3
4
  function Skeleton({ className, ...props }) {
4
- return /*#__PURE__*/ jsx("div", {
5
- className: cn("animate-pulse rounded-lg bg-muted", className),
6
- "data-slot": "skeleton",
7
- ...props
8
- });
5
+ return /* @__PURE__ */ jsx("div", {
6
+ className: cn("animate-pulse rounded-lg bg-muted", className),
7
+ "data-slot": "skeleton",
8
+ ...props
9
+ });
9
10
  }
11
+ //#endregion
10
12
  export { Skeleton };
@@ -1,6 +1,15 @@
1
- import type { ComponentProps, JSX } from "react";
1
+ import { ComponentProps, JSX } from "react";
2
2
  import * as SliderPrimitive from "@radix-ui/react-slider";
3
+
4
+ //#region src/components/slider.d.ts
3
5
  type SliderProps = ComponentProps<typeof SliderPrimitive.Root>;
4
- declare function Slider({ className, defaultValue, max, min, value, ...props }: SliderProps): JSX.Element;
5
- export { Slider };
6
- export type { SliderProps };
6
+ declare function Slider({
7
+ className,
8
+ defaultValue,
9
+ max,
10
+ min,
11
+ value,
12
+ ...props
13
+ }: SliderProps): JSX.Element;
14
+ //#endregion
15
+ export { Slider, type SliderProps };
@@ -1,46 +1,40 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
2
  import { cn } from "@codefast/tailwind-variants";
4
- import { Range, Root, Thumb, Track } from "@radix-ui/react-slider";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
5
4
  import { useMemo } from "react";
5
+ import * as SliderPrimitive from "@radix-ui/react-slider";
6
+ //#region src/components/slider.tsx
6
7
  function Slider({ className, defaultValue, max = 100, min = 0, value, ...props }) {
7
- const _values = useMemo(()=>{
8
- if (Array.isArray(value)) return value;
9
- return Array.isArray(defaultValue) ? defaultValue : [
10
- min,
11
- max
12
- ];
13
- }, [
14
- value,
15
- defaultValue,
16
- min,
17
- max
18
- ]);
19
- return /*#__PURE__*/ jsxs(Root, {
20
- className: cn("relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col", className),
21
- "data-slot": "slider",
22
- defaultValue: defaultValue,
23
- max: max,
24
- min: min,
25
- value: value,
26
- ...props,
27
- children: [
28
- /*#__PURE__*/ jsx(Track, {
29
- className: "relative w-full grow overflow-hidden rounded-full bg-input data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1",
30
- "data-slot": "slider-track",
31
- children: /*#__PURE__*/ jsx(Range, {
32
- className: "absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full",
33
- "data-slot": "slider-range"
34
- })
35
- }),
36
- Array.from({
37
- length: _values.length
38
- }, (_, index)=>/*#__PURE__*/ jsx(Thumb, {
39
- "aria-label": "Volume",
40
- className: cn("flex size-4 items-center justify-center rounded-full border-2 border-primary bg-primary shadow-sm outline-hidden after:size-full after:rounded-full after:bg-background after:transition-[width,height] focus-visible:ring-4 focus-visible:ring-primary/20 active:not-data-disabled:after:size-1 dark:focus-visible:ring-primary/40"),
41
- "data-slot": "slider-thumb"
42
- }, index))
43
- ]
44
- });
8
+ const _values = useMemo(() => {
9
+ if (Array.isArray(value)) return value;
10
+ return Array.isArray(defaultValue) ? defaultValue : [min, max];
11
+ }, [
12
+ value,
13
+ defaultValue,
14
+ min,
15
+ max
16
+ ]);
17
+ return /* @__PURE__ */ jsxs(SliderPrimitive.Root, {
18
+ className: cn("relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col", className),
19
+ "data-slot": "slider",
20
+ defaultValue,
21
+ max,
22
+ min,
23
+ value,
24
+ ...props,
25
+ children: [/* @__PURE__ */ jsx(SliderPrimitive.Track, {
26
+ className: "relative w-full grow overflow-hidden rounded-full bg-input data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1",
27
+ "data-slot": "slider-track",
28
+ children: /* @__PURE__ */ jsx(SliderPrimitive.Range, {
29
+ className: "absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full",
30
+ "data-slot": "slider-range"
31
+ })
32
+ }), Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx(SliderPrimitive.Thumb, {
33
+ "aria-label": "Volume",
34
+ className: cn("flex size-4 items-center justify-center rounded-full border-2 border-primary bg-primary shadow-sm outline-hidden after:size-full after:rounded-full after:bg-background after:transition-[width,height] focus-visible:ring-4 focus-visible:ring-primary/20 active:not-data-disabled:after:size-1 dark:focus-visible:ring-primary/40"),
35
+ "data-slot": "slider-thumb"
36
+ }, index))]
37
+ });
45
38
  }
39
+ //#endregion
46
40
  export { Slider };
@@ -1,7 +1,10 @@
1
- import type { JSX } from "react";
2
- import type { ToasterProps as SonnerToasterProps } from "sonner";
3
- type ToasterProps = SonnerToasterProps;
4
- declare function Toaster({ ...props }: ToasterProps): JSX.Element;
5
- export { toast, useSonner } from "sonner";
6
- export { Toaster };
7
- export type { ToasterProps };
1
+ import { JSX } from "react";
2
+ import { ToasterProps as ToasterProps$1, toast, useSonner } from "sonner";
3
+
4
+ //#region src/components/sonner.d.ts
5
+ type ToasterProps = ToasterProps$1;
6
+ declare function Toaster({
7
+ ...props
8
+ }: ToasterProps): JSX.Element;
9
+ //#endregion
10
+ export { Toaster, type ToasterProps, toast, useSonner };
@@ -1,18 +1,20 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { useTheme } from "next-themes";
4
- import { Toaster, toast, useSonner } from "sonner";
5
- function sonner_Toaster({ ...props }) {
6
- const { theme = "system" } = useTheme();
7
- return /*#__PURE__*/ jsx(Toaster, {
8
- className: "toaster group",
9
- style: {
10
- "--normal-bg": "var(--popover)",
11
- "--normal-border": "var(--border)",
12
- "--normal-text": "var(--popover-foreground)"
13
- },
14
- theme: theme,
15
- ...props
16
- });
4
+ import { Toaster as Toaster$1, toast, useSonner } from "sonner";
5
+ //#region src/components/sonner.tsx
6
+ function Toaster({ ...props }) {
7
+ const { theme = "system" } = useTheme();
8
+ return /* @__PURE__ */ jsx(Toaster$1, {
9
+ className: "toaster group",
10
+ style: {
11
+ "--normal-bg": "var(--popover)",
12
+ "--normal-border": "var(--border)",
13
+ "--normal-text": "var(--popover-foreground)"
14
+ },
15
+ theme,
16
+ ...props
17
+ });
17
18
  }
18
- export { sonner_Toaster as Toaster, toast, useSonner };
19
+ //#endregion
20
+ export { Toaster, toast, useSonner };
@@ -1,7 +1,14 @@
1
- import type { ComponentProps, ReactNode } from "react";
1
+ import { ComponentProps, ReactNode } from "react";
2
+
3
+ //#region src/components/spinner.d.ts
2
4
  interface SpinnerProps extends ComponentProps<"span"> {
3
- loading?: boolean;
5
+ loading?: boolean;
4
6
  }
5
- declare function Spinner({ children, className, loading, ...props }: SpinnerProps): ReactNode;
6
- export { Spinner };
7
- export type { SpinnerProps };
7
+ declare function Spinner({
8
+ children,
9
+ className,
10
+ loading,
11
+ ...props
12
+ }: SpinnerProps): ReactNode;
13
+ //#endregion
14
+ export { Spinner, type SpinnerProps };
@@ -1,42 +1,40 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
2
  import { cn } from "@codefast/tailwind-variants";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
5
+ //#region src/components/spinner.tsx
5
6
  const SPINNER_COUNT = 8;
6
7
  function Spinner({ children, className, loading = true, ...props }) {
7
- if (!loading) return children;
8
- const spinner = /*#__PURE__*/ jsx("span", {
9
- className: cn("relative flex size-4 items-center justify-center opacity-60", className),
10
- ...props,
11
- children: Array.from({
12
- length: SPINNER_COUNT
13
- }, (_, index)=>/*#__PURE__*/ jsx("span", {
14
- className: cn("absolute h-full rotate-(--spinner-rotate) before:block before:h-1/3 before:w-full before:animate-out before:rounded-full before:bg-current before:delay-(--spinner-delay) before:animation-duration-(--spinner-duration) before:fade-out-25 before:repeat-infinite"),
15
- style: {
16
- "--spinner-delay": `-${((SPINNER_COUNT - index) * 100).toString()}ms`,
17
- "--spinner-duration": `${(100 * SPINNER_COUNT).toString()}ms`,
18
- "--spinner-rotate": `${(360 / SPINNER_COUNT * index).toString()}deg`,
19
- width: `${(100 / SPINNER_COUNT).toString()}%`
20
- }
21
- }, index))
22
- });
23
- if (void 0 === children) return spinner;
24
- return /*#__PURE__*/ jsxs("span", {
25
- className: "relative",
26
- children: [
27
- /*#__PURE__*/ jsx("span", {
28
- "aria-hidden": true,
29
- className: "invisible contents",
30
- children: children
31
- }),
32
- /*#__PURE__*/ jsx(VisuallyHidden, {
33
- children: children
34
- }),
35
- /*#__PURE__*/ jsx("span", {
36
- className: "absolute inset-0 flex items-center justify-center",
37
- children: spinner
38
- })
39
- ]
40
- });
8
+ if (!loading) return children;
9
+ const spinner = /* @__PURE__ */ jsx("span", {
10
+ className: cn("relative flex size-4 items-center justify-center opacity-60", className),
11
+ ...props,
12
+ children: Array.from({ length: SPINNER_COUNT }, (_, index) => /* @__PURE__ */ jsx("span", {
13
+ className: cn("absolute h-full rotate-(--spinner-rotate) before:block before:h-1/3 before:w-full before:animate-out before:rounded-full before:bg-current before:delay-(--spinner-delay) before:animation-duration-(--spinner-duration) before:fade-out-25 before:repeat-infinite"),
14
+ style: {
15
+ "--spinner-delay": `-${((SPINNER_COUNT - index) * 100).toString()}ms`,
16
+ "--spinner-duration": `${(SPINNER_COUNT * 100).toString()}ms`,
17
+ "--spinner-rotate": `${(360 / SPINNER_COUNT * index).toString()}deg`,
18
+ width: `${(100 / SPINNER_COUNT).toString()}%`
19
+ }
20
+ }, index))
21
+ });
22
+ if (children === void 0) return spinner;
23
+ return /* @__PURE__ */ jsxs("span", {
24
+ className: "relative",
25
+ children: [
26
+ /* @__PURE__ */ jsx("span", {
27
+ "aria-hidden": true,
28
+ className: "invisible contents",
29
+ children
30
+ }),
31
+ /* @__PURE__ */ jsx(VisuallyHidden, { children }),
32
+ /* @__PURE__ */ jsx("span", {
33
+ className: "absolute inset-0 flex items-center justify-center",
34
+ children: spinner
35
+ })
36
+ ]
37
+ });
41
38
  }
39
+ //#endregion
42
40
  export { Spinner };
@@ -1,6 +1,11 @@
1
- import type { ComponentProps, JSX } from "react";
1
+ import { ComponentProps, JSX } from "react";
2
2
  import * as SwitchPrimitives from "@radix-ui/react-switch";
3
+
4
+ //#region src/components/switch.d.ts
3
5
  type SwitchProps = ComponentProps<typeof SwitchPrimitives.Root>;
4
- declare function Switch({ className, ...props }: SwitchProps): JSX.Element;
5
- export { Switch };
6
- export type { SwitchProps };
6
+ declare function Switch({
7
+ className,
8
+ ...props
9
+ }: SwitchProps): JSX.Element;
10
+ //#endregion
11
+ export { Switch, type SwitchProps };
@@ -1,16 +1,18 @@
1
1
  "use client";
2
- import { jsx } from "react/jsx-runtime";
3
2
  import { cn } from "@codefast/tailwind-variants";
4
- import { Root, Thumb } from "@radix-ui/react-switch";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import * as SwitchPrimitives from "@radix-ui/react-switch";
5
+ //#region src/components/switch.tsx
5
6
  function Switch({ className, ...props }) {
6
- return /*#__PURE__*/ jsx(Root, {
7
- className: cn("peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent p-0.75 shadow-xs outline-hidden transition-all focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:not-data-[state=checked]:border-ring/60 disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:focus-visible:ring-primary/20 data-[state=unchecked]:bg-input dark:data-[state=checked]:focus-visible:ring-primary/40 dark:data-[state=unchecked]:bg-input/80", className),
8
- "data-slot": "switch",
9
- ...props,
10
- children: /*#__PURE__*/ jsx(Thumb, {
11
- className: "pointer-events-none block size-3.5 rounded-full bg-background shadow-sm transition-transform data-[state=checked]:translate-x-3.5 data-[state=unchecked]:translate-x-0 dark:not-data-[state=checked]:bg-foreground",
12
- "data-slot": "switch-thumb"
13
- })
14
- });
7
+ return /* @__PURE__ */ jsx(SwitchPrimitives.Root, {
8
+ className: cn("peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent p-0.75 shadow-xs outline-hidden transition-all focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:not-data-[state=checked]:border-ring/60 disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:focus-visible:ring-primary/20 data-[state=unchecked]:bg-input dark:data-[state=checked]:focus-visible:ring-primary/40 dark:data-[state=unchecked]:bg-input/80", className),
9
+ "data-slot": "switch",
10
+ ...props,
11
+ children: /* @__PURE__ */ jsx(SwitchPrimitives.Thumb, {
12
+ className: "pointer-events-none block size-3.5 rounded-full bg-background shadow-sm transition-transform data-[state=checked]:translate-x-3.5 data-[state=unchecked]:translate-x-0 dark:not-data-[state=checked]:bg-foreground",
13
+ "data-slot": "switch-thumb"
14
+ })
15
+ });
15
16
  }
17
+ //#endregion
16
18
  export { Switch };
@@ -1,19 +1,45 @@
1
- import type { ComponentProps, JSX } from "react";
1
+ import { ComponentProps, JSX } from "react";
2
+
3
+ //#region src/components/table.d.ts
2
4
  type TableProps = ComponentProps<"table">;
3
- declare function Table({ className, ...props }: TableProps): JSX.Element;
5
+ declare function Table({
6
+ className,
7
+ ...props
8
+ }: TableProps): JSX.Element;
4
9
  type TableHeaderProps = ComponentProps<"thead">;
5
- declare function TableHeader({ className, ...props }: TableHeaderProps): JSX.Element;
10
+ declare function TableHeader({
11
+ className,
12
+ ...props
13
+ }: TableHeaderProps): JSX.Element;
6
14
  type TableBodyProps = ComponentProps<"tbody">;
7
- declare function TableBody({ className, ...props }: TableBodyProps): JSX.Element;
15
+ declare function TableBody({
16
+ className,
17
+ ...props
18
+ }: TableBodyProps): JSX.Element;
8
19
  type TableFooterProps = ComponentProps<"tfoot">;
9
- declare function TableFooter({ className, ...props }: TableFooterProps): JSX.Element;
20
+ declare function TableFooter({
21
+ className,
22
+ ...props
23
+ }: TableFooterProps): JSX.Element;
10
24
  type TableRowProps = ComponentProps<"tr">;
11
- declare function TableRow({ className, ...props }: TableRowProps): JSX.Element;
25
+ declare function TableRow({
26
+ className,
27
+ ...props
28
+ }: TableRowProps): JSX.Element;
12
29
  type TableHeadProps = ComponentProps<"th">;
13
- declare function TableHead({ className, ...props }: TableHeadProps): JSX.Element;
30
+ declare function TableHead({
31
+ className,
32
+ ...props
33
+ }: TableHeadProps): JSX.Element;
14
34
  type TableCellProps = ComponentProps<"td">;
15
- declare function TableCell({ className, ...props }: TableCellProps): JSX.Element;
35
+ declare function TableCell({
36
+ className,
37
+ ...props
38
+ }: TableCellProps): JSX.Element;
16
39
  type TableCaptionProps = ComponentProps<"caption">;
17
- declare function TableCaption({ className, ...props }: TableCaptionProps): JSX.Element;
18
- export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
19
- export type { TableBodyProps, TableCaptionProps, TableCellProps, TableFooterProps, TableHeaderProps, TableHeadProps, TableProps, TableRowProps, };
40
+ declare function TableCaption({
41
+ className,
42
+ ...props
43
+ }: TableCaptionProps): JSX.Element;
44
+ //#endregion
45
+ export { Table, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, TableCell, type TableCellProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableProps, TableRow, type TableRowProps };
@@ -1,63 +1,65 @@
1
- import { jsx } from "react/jsx-runtime";
2
1
  import { cn } from "@codefast/tailwind-variants";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/components/table.tsx
3
4
  function Table({ className, ...props }) {
4
- return /*#__PURE__*/ jsx("div", {
5
- className: "relative w-full overflow-auto",
6
- "data-slot": "table-cotainer",
7
- children: /*#__PURE__*/ jsx("table", {
8
- className: cn("w-full caption-bottom text-sm", className),
9
- "data-slot": "table",
10
- ...props
11
- })
12
- });
5
+ return /* @__PURE__ */ jsx("div", {
6
+ className: "relative w-full overflow-auto",
7
+ "data-slot": "table-cotainer",
8
+ children: /* @__PURE__ */ jsx("table", {
9
+ className: cn("w-full caption-bottom text-sm", className),
10
+ "data-slot": "table",
11
+ ...props
12
+ })
13
+ });
13
14
  }
14
15
  function TableHeader({ className, ...props }) {
15
- return /*#__PURE__*/ jsx("thead", {
16
- className: cn("*:border-b *:has-aria-expanded:bg-transparent", className),
17
- "data-slot": "table-header",
18
- ...props
19
- });
16
+ return /* @__PURE__ */ jsx("thead", {
17
+ className: cn("*:border-b *:has-aria-expanded:bg-transparent", className),
18
+ "data-slot": "table-header",
19
+ ...props
20
+ });
20
21
  }
21
22
  function TableBody({ className, ...props }) {
22
- return /*#__PURE__*/ jsx("tbody", {
23
- className: cn("*:last-child:border-0", className),
24
- "data-slot": "table-body",
25
- ...props
26
- });
23
+ return /* @__PURE__ */ jsx("tbody", {
24
+ className: cn("*:last-child:border-0", className),
25
+ "data-slot": "table-body",
26
+ ...props
27
+ });
27
28
  }
28
29
  function TableFooter({ className, ...props }) {
29
- return /*#__PURE__*/ jsx("tfoot", {
30
- className: cn("bg-muted/50 font-medium *:border-t *:border-b-0 *:has-aria-expanded:bg-transparent", className),
31
- "data-slot": "table-footer",
32
- ...props
33
- });
30
+ return /* @__PURE__ */ jsx("tfoot", {
31
+ className: cn("bg-muted/50 font-medium *:border-t *:border-b-0 *:has-aria-expanded:bg-transparent", className),
32
+ "data-slot": "table-footer",
33
+ ...props
34
+ });
34
35
  }
35
36
  function TableRow({ className, ...props }) {
36
- return /*#__PURE__*/ jsx("tr", {
37
- className: cn("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className),
38
- "data-slot": "table-row",
39
- ...props
40
- });
37
+ return /* @__PURE__ */ jsx("tr", {
38
+ className: cn("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className),
39
+ "data-slot": "table-row",
40
+ ...props
41
+ });
41
42
  }
42
43
  function TableHead({ className, ...props }) {
43
- return /*#__PURE__*/ jsx("th", {
44
- className: cn("p-2 text-left align-middle font-medium", className),
45
- "data-slot": "table-head",
46
- ...props
47
- });
44
+ return /* @__PURE__ */ jsx("th", {
45
+ className: cn("p-2 text-left align-middle font-medium", className),
46
+ "data-slot": "table-head",
47
+ ...props
48
+ });
48
49
  }
49
50
  function TableCell({ className, ...props }) {
50
- return /*#__PURE__*/ jsx("td", {
51
- className: cn("p-2 align-middle", className),
52
- "data-slot": "table-cell",
53
- ...props
54
- });
51
+ return /* @__PURE__ */ jsx("td", {
52
+ className: cn("p-2 align-middle", className),
53
+ "data-slot": "table-cell",
54
+ ...props
55
+ });
55
56
  }
56
57
  function TableCaption({ className, ...props }) {
57
- return /*#__PURE__*/ jsx("caption", {
58
- className: cn("mt-4 text-sm text-muted-foreground", className),
59
- "data-slot": "table-caption",
60
- ...props
61
- });
58
+ return /* @__PURE__ */ jsx("caption", {
59
+ className: cn("mt-4 text-sm text-muted-foreground", className),
60
+ "data-slot": "table-caption",
61
+ ...props
62
+ });
62
63
  }
64
+ //#endregion
63
65
  export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
@@ -1,12 +1,26 @@
1
- import type { ComponentProps, JSX } from "react";
1
+ import { ComponentProps, JSX } from "react";
2
2
  import * as TabsPrimitive from "@radix-ui/react-tabs";
3
+
4
+ //#region src/components/tabs.d.ts
3
5
  type TabsProps = ComponentProps<typeof TabsPrimitive.Root>;
4
- declare function Tabs({ className, ...props }: TabsProps): JSX.Element;
6
+ declare function Tabs({
7
+ className,
8
+ ...props
9
+ }: TabsProps): JSX.Element;
5
10
  type TabsListProps = ComponentProps<typeof TabsPrimitive.List>;
6
- declare function TabsList({ className, ...props }: TabsListProps): JSX.Element;
11
+ declare function TabsList({
12
+ className,
13
+ ...props
14
+ }: TabsListProps): JSX.Element;
7
15
  type TabsTriggerProps = ComponentProps<typeof TabsPrimitive.Trigger>;
8
- declare function TabsTrigger({ className, ...props }: TabsTriggerProps): JSX.Element;
16
+ declare function TabsTrigger({
17
+ className,
18
+ ...props
19
+ }: TabsTriggerProps): JSX.Element;
9
20
  type TabsContentProps = ComponentProps<typeof TabsPrimitive.Content>;
10
- declare function TabsContent({ className, ...props }: TabsContentProps): JSX.Element;
11
- export { Tabs, TabsContent, TabsList, TabsTrigger };
12
- export type { TabsContentProps, TabsListProps, TabsProps, TabsTriggerProps };
21
+ declare function TabsContent({
22
+ className,
23
+ ...props
24
+ }: TabsContentProps): JSX.Element;
25
+ //#endregion
26
+ export { Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps };
@@ -1,33 +1,35 @@
1
1
  "use client";
2
- import { jsx } from "react/jsx-runtime";
3
2
  import { cn } from "@codefast/tailwind-variants";
4
- import { Content, List, Root, Trigger } from "@radix-ui/react-tabs";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import * as TabsPrimitive from "@radix-ui/react-tabs";
5
+ //#region src/components/tabs.tsx
5
6
  function Tabs({ className, ...props }) {
6
- return /*#__PURE__*/ jsx(Root, {
7
- className: cn("flex flex-col gap-2", className),
8
- "data-slot": "tabs",
9
- ...props
10
- });
7
+ return /* @__PURE__ */ jsx(TabsPrimitive.Root, {
8
+ className: cn("flex flex-col gap-2", className),
9
+ "data-slot": "tabs",
10
+ ...props
11
+ });
11
12
  }
12
13
  function TabsList({ className, ...props }) {
13
- return /*#__PURE__*/ jsx(List, {
14
- className: cn("inline-flex w-fit items-center justify-center gap-1 rounded-xl bg-muted px-1 py-1 text-muted-foreground", className),
15
- "data-slot": "tabs-list",
16
- ...props
17
- });
14
+ return /* @__PURE__ */ jsx(TabsPrimitive.List, {
15
+ className: cn("inline-flex w-fit items-center justify-center gap-1 rounded-xl bg-muted px-1 py-1 text-muted-foreground", className),
16
+ "data-slot": "tabs-list",
17
+ ...props
18
+ });
18
19
  }
19
20
  function TabsTrigger({ className, ...props }) {
20
- return /*#__PURE__*/ jsx(Trigger, {
21
- className: cn("inline-flex items-center justify-center gap-1.5 rounded-lg px-2 py-1.5 text-sm font-medium whitespace-nowrap text-muted-foreground transition not-dark:outline-hidden hover:not-disabled:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm dark:-outline-offset-1 dark:outline-ring dark:data-[state=active]:bg-input/50 dark:data-[state=active]:outline-1 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
22
- "data-slot": "tabs-trigger",
23
- ...props
24
- });
21
+ return /* @__PURE__ */ jsx(TabsPrimitive.Trigger, {
22
+ className: cn("inline-flex items-center justify-center gap-1.5 rounded-lg px-2 py-1.5 text-sm font-medium whitespace-nowrap text-muted-foreground transition not-dark:outline-hidden hover:not-disabled:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm dark:-outline-offset-1 dark:outline-ring dark:data-[state=active]:bg-input/50 dark:data-[state=active]:outline-1 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
23
+ "data-slot": "tabs-trigger",
24
+ ...props
25
+ });
25
26
  }
26
27
  function TabsContent({ className, ...props }) {
27
- return /*#__PURE__*/ jsx(Content, {
28
- className: cn("mt-2 rounded-xl ring-ring/50 outline-ring focus-visible:ring-4 focus-visible:outline-1", className),
29
- "data-slot": "tabs-content",
30
- ...props
31
- });
28
+ return /* @__PURE__ */ jsx(TabsPrimitive.Content, {
29
+ className: cn("mt-2 rounded-xl ring-ring/50 outline-ring focus-visible:ring-4 focus-visible:outline-1", className),
30
+ "data-slot": "tabs-content",
31
+ ...props
32
+ });
32
33
  }
34
+ //#endregion
33
35
  export { Tabs, TabsContent, TabsList, TabsTrigger };
@@ -1,5 +1,10 @@
1
- import type { ComponentProps, JSX } from "react";
1
+ import { ComponentProps, JSX } from "react";
2
+
3
+ //#region src/components/textarea.d.ts
2
4
  type TextareaProps = ComponentProps<"textarea">;
3
- declare function Textarea({ className, ...props }: TextareaProps): JSX.Element;
4
- export { Textarea };
5
- export type { TextareaProps };
5
+ declare function Textarea({
6
+ className,
7
+ ...props
8
+ }: TextareaProps): JSX.Element;
9
+ //#endregion
10
+ export { Textarea, type TextareaProps };