@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.
- package/CHANGELOG.md +36 -0
- package/README.md +34 -14
- package/dist/components/accordion.d.ts +29 -10
- package/dist/components/accordion.js +38 -37
- package/dist/components/alert-dialog.d.ts +60 -24
- package/dist/components/alert-dialog.js +69 -72
- package/dist/components/alert.d.ts +27 -15
- package/dist/components/alert.js +29 -31
- package/dist/components/aspect-ratio.d.ts +8 -4
- package/dist/components/aspect-ratio.js +7 -5
- package/dist/components/avatar.d.ts +17 -6
- package/dist/components/avatar.js +19 -17
- package/dist/components/badge.d.ts +21 -14
- package/dist/components/badge.js +19 -22
- package/dist/components/breadcrumb.d.ts +35 -12
- package/dist/components/breadcrumb.js +48 -54
- package/dist/components/button-group.d.ts +29 -14
- package/dist/components/button-group.js +27 -32
- package/dist/components/button.d.ts +35 -25
- package/dist/components/button.js +50 -48
- package/dist/components/calendar.d.ts +24 -9
- package/dist/components/calendar.js +92 -98
- package/dist/components/card.d.ts +34 -10
- package/dist/components/card.js +39 -37
- package/dist/components/carousel.d.ts +55 -24
- package/dist/components/carousel.js +113 -130
- package/dist/components/chart.d.ts +72 -36
- package/dist/components/chart.js +154 -166
- package/dist/components/checkbox-cards.d.ts +15 -8
- package/dist/components/checkbox-cards.js +22 -25
- package/dist/components/checkbox-group.d.ts +16 -8
- package/dist/components/checkbox-group.js +19 -19
- package/dist/components/checkbox.d.ts +9 -4
- package/dist/components/checkbox.js +14 -14
- package/dist/components/collapsible.d.ts +14 -6
- package/dist/components/collapsible.js +18 -16
- package/dist/components/command.d.ts +55 -23
- package/dist/components/command.js +70 -85
- package/dist/components/context-menu.d.ts +72 -22
- package/dist/components/context-menu.js +88 -109
- package/dist/components/dialog.d.ts +53 -22
- package/dist/components/dialog.js +71 -85
- package/dist/components/drawer.d.ts +60 -28
- package/dist/components/drawer.js +59 -67
- package/dist/components/dropdown-menu.d.ts +73 -22
- package/dist/components/dropdown-menu.js +95 -112
- package/dist/components/empty.d.ts +37 -15
- package/dist/components/empty.js +43 -45
- package/dist/components/field.d.ts +63 -25
- package/dist/components/field.js +88 -104
- package/dist/components/form.d.ts +37 -15
- package/dist/components/form.js +65 -70
- package/dist/components/hover-card.d.ts +21 -7
- package/dist/components/hover-card.js +24 -24
- package/dist/components/input-group.d.ts +53 -28
- package/dist/components/input-group.js +63 -77
- package/dist/components/input-number.d.ts +28 -7
- package/dist/components/input-number.js +55 -59
- package/dist/components/input-otp.d.ts +24 -10
- package/dist/components/input-otp.js +33 -37
- package/dist/components/input-password.d.ts +12 -5
- package/dist/components/input-password.js +31 -32
- package/dist/components/input-search.d.ts +18 -8
- package/dist/components/input-search.js +43 -41
- package/dist/components/input.d.ts +10 -4
- package/dist/components/input.js +9 -7
- package/dist/components/item.d.ts +69 -32
- package/dist/components/item.js +89 -92
- package/dist/components/kbd.d.ts +13 -5
- package/dist/components/kbd.js +13 -11
- package/dist/components/label.d.ts +9 -4
- package/dist/components/label.js +9 -7
- package/dist/components/menubar.d.ts +80 -23
- package/dist/components/menubar.js +97 -118
- package/dist/components/native-select.d.ts +16 -6
- package/dist/components/native-select.js +25 -26
- package/dist/components/navigation-menu.d.ts +36 -12
- package/dist/components/navigation-menu.js +60 -75
- package/dist/components/pagination.d.ts +35 -14
- package/dist/components/pagination.js +54 -69
- package/dist/components/popover.d.ts +24 -8
- package/dist/components/popover.js +28 -28
- package/dist/components/progress-circle.d.ts +106 -88
- package/dist/components/progress-circle.js +106 -138
- package/dist/components/progress.d.ts +10 -4
- package/dist/components/progress.js +14 -14
- package/dist/components/radio-cards.d.ts +10 -4
- package/dist/components/radio-cards.js +22 -23
- package/dist/components/radio-group.d.ts +13 -5
- package/dist/components/radio-group.js +18 -16
- package/dist/components/radio.d.ts +12 -5
- package/dist/components/radio.js +10 -8
- package/dist/components/resizable.d.ts +18 -7
- package/dist/components/resizable.js +22 -22
- package/dist/components/scroll-area.d.ts +33 -20
- package/dist/components/scroll-area.js +84 -88
- package/dist/components/select.d.ts +50 -16
- package/dist/components/select.js +77 -96
- package/dist/components/separator.d.ts +29 -19
- package/dist/components/separator.js +36 -34
- package/dist/components/sheet.d.ts +62 -29
- package/dist/components/sheet.js +79 -100
- package/dist/components/sidebar.d.ts +160 -66
- package/dist/components/sidebar.js +294 -336
- package/dist/components/skeleton.d.ts +9 -4
- package/dist/components/skeleton.js +8 -6
- package/dist/components/slider.d.ts +13 -4
- package/dist/components/slider.js +34 -40
- package/dist/components/sonner.d.ts +10 -7
- package/dist/components/sonner.js +16 -14
- package/dist/components/spinner.d.ts +12 -5
- package/dist/components/spinner.js +33 -35
- package/dist/components/switch.d.ts +9 -4
- package/dist/components/switch.js +13 -11
- package/dist/components/table.d.ts +37 -11
- package/dist/components/table.js +47 -45
- package/dist/components/tabs.d.ts +21 -7
- package/dist/components/tabs.js +24 -22
- package/dist/components/textarea.d.ts +9 -4
- package/dist/components/textarea.js +8 -6
- package/dist/components/toggle-group.d.ts +24 -9
- package/dist/components/toggle-group.js +41 -42
- package/dist/components/toggle.d.ts +25 -17
- package/dist/components/toggle.js +30 -28
- package/dist/components/tooltip.d.ts +24 -8
- package/dist/components/tooltip.js +29 -32
- package/dist/hooks/use-animated-value.d.ts +4 -1
- package/dist/hooks/use-animated-value.js +57 -36
- package/dist/hooks/use-copy-to-clipboard.d.ts +11 -5
- package/dist/hooks/use-copy-to-clipboard.js +39 -20
- package/dist/hooks/use-is-mobile.d.ts +4 -1
- package/dist/hooks/use-is-mobile.js +21 -1
- package/dist/hooks/use-media-query.d.ts +4 -1
- package/dist/hooks/use-media-query.js +45 -18
- package/dist/hooks/use-mutation-observer.d.ts +6 -2
- package/dist/hooks/use-mutation-observer.js +34 -16
- package/dist/hooks/use-pagination.d.ts +22 -14
- package/dist/hooks/use-pagination.js +100 -49
- package/dist/index.d.ts +69 -130
- package/dist/index.js +11 -11
- package/dist/primitives/checkbox-group.d.ts +105 -83
- package/dist/primitives/checkbox-group.js +111 -84
- package/dist/primitives/input-number.d.ts +51 -40
- package/dist/primitives/input-number.js +483 -350
- package/dist/primitives/input.d.ts +48 -42
- package/dist/primitives/input.js +65 -43
- package/dist/primitives/progress-circle.d.ts +79 -48
- package/dist/primitives/progress-circle.js +154 -105
- package/package.json +6 -7
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentProps, JSX } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/skeleton.d.ts
|
|
2
4
|
type SkeletonProps = ComponentProps<"div">;
|
|
3
|
-
declare function Skeleton({
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
|
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({
|
|
5
|
-
|
|
6
|
-
|
|
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 {
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Toaster, toast, useSonner };
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/spinner.d.ts
|
|
2
4
|
interface SpinnerProps extends ComponentProps<"span"> {
|
|
3
|
-
|
|
5
|
+
loading?: boolean;
|
|
4
6
|
}
|
|
5
|
-
declare function Spinner({
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
|
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({
|
|
5
|
-
|
|
6
|
-
|
|
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 {
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
1
|
+
import { ComponentProps, JSX } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/table.d.ts
|
|
2
4
|
type TableProps = ComponentProps<"table">;
|
|
3
|
-
declare function Table({
|
|
5
|
+
declare function Table({
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}: TableProps): JSX.Element;
|
|
4
9
|
type TableHeaderProps = ComponentProps<"thead">;
|
|
5
|
-
declare function TableHeader({
|
|
10
|
+
declare function TableHeader({
|
|
11
|
+
className,
|
|
12
|
+
...props
|
|
13
|
+
}: TableHeaderProps): JSX.Element;
|
|
6
14
|
type TableBodyProps = ComponentProps<"tbody">;
|
|
7
|
-
declare function TableBody({
|
|
15
|
+
declare function TableBody({
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
}: TableBodyProps): JSX.Element;
|
|
8
19
|
type TableFooterProps = ComponentProps<"tfoot">;
|
|
9
|
-
declare function TableFooter({
|
|
20
|
+
declare function TableFooter({
|
|
21
|
+
className,
|
|
22
|
+
...props
|
|
23
|
+
}: TableFooterProps): JSX.Element;
|
|
10
24
|
type TableRowProps = ComponentProps<"tr">;
|
|
11
|
-
declare function TableRow({
|
|
25
|
+
declare function TableRow({
|
|
26
|
+
className,
|
|
27
|
+
...props
|
|
28
|
+
}: TableRowProps): JSX.Element;
|
|
12
29
|
type TableHeadProps = ComponentProps<"th">;
|
|
13
|
-
declare function TableHead({
|
|
30
|
+
declare function TableHead({
|
|
31
|
+
className,
|
|
32
|
+
...props
|
|
33
|
+
}: TableHeadProps): JSX.Element;
|
|
14
34
|
type TableCellProps = ComponentProps<"td">;
|
|
15
|
-
declare function TableCell({
|
|
35
|
+
declare function TableCell({
|
|
36
|
+
className,
|
|
37
|
+
...props
|
|
38
|
+
}: TableCellProps): JSX.Element;
|
|
16
39
|
type TableCaptionProps = ComponentProps<"caption">;
|
|
17
|
-
declare function TableCaption({
|
|
18
|
-
|
|
19
|
-
|
|
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 };
|
package/dist/components/table.js
CHANGED
|
@@ -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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
|
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({
|
|
6
|
+
declare function Tabs({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: TabsProps): JSX.Element;
|
|
5
10
|
type TabsListProps = ComponentProps<typeof TabsPrimitive.List>;
|
|
6
|
-
declare function TabsList({
|
|
11
|
+
declare function TabsList({
|
|
12
|
+
className,
|
|
13
|
+
...props
|
|
14
|
+
}: TabsListProps): JSX.Element;
|
|
7
15
|
type TabsTriggerProps = ComponentProps<typeof TabsPrimitive.Trigger>;
|
|
8
|
-
declare function TabsTrigger({
|
|
16
|
+
declare function TabsTrigger({
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}: TabsTriggerProps): JSX.Element;
|
|
9
20
|
type TabsContentProps = ComponentProps<typeof TabsPrimitive.Content>;
|
|
10
|
-
declare function TabsContent({
|
|
11
|
-
|
|
12
|
-
|
|
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 };
|
package/dist/components/tabs.js
CHANGED
|
@@ -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 {
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
|
1
|
+
import { ComponentProps, JSX } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/textarea.d.ts
|
|
2
4
|
type TextareaProps = ComponentProps<"textarea">;
|
|
3
|
-
declare function Textarea({
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
declare function Textarea({
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}: TextareaProps): JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Textarea, type TextareaProps };
|