@codefast/ui 0.3.11 → 0.3.12-canary.0
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 +15 -0
- package/README.md +4 -0
- package/dist/components/accordion.d.ts +11 -29
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +10 -37
- package/dist/components/alert-dialog.d.ts +25 -60
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +16 -69
- package/dist/components/alert.d.ts +16 -27
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +22 -30
- package/dist/components/aspect-ratio.d.ts +5 -8
- package/dist/components/aspect-ratio.d.ts.map +1 -0
- package/dist/components/aspect-ratio.js +5 -7
- package/dist/components/avatar.d.ts +7 -17
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +7 -18
- package/dist/components/badge.d.ts +15 -21
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +23 -20
- package/dist/components/breadcrumb.d.ts +13 -35
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +13 -49
- package/dist/components/button-group.d.ts +15 -29
- package/dist/components/button-group.d.ts.map +1 -0
- package/dist/components/button-group.js +22 -27
- package/dist/components/button.d.ts +26 -35
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +43 -51
- package/dist/components/calendar.d.ts +10 -24
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +75 -92
- package/dist/components/card.d.ts +11 -34
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +11 -39
- package/dist/components/carousel.d.ts +25 -55
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +82 -114
- package/dist/components/chart.d.ts +37 -72
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +161 -150
- package/dist/components/checkbox-cards.d.ts +9 -15
- package/dist/components/checkbox-cards.d.ts.map +1 -0
- package/dist/components/checkbox-cards.js +8 -22
- package/dist/components/checkbox-group.d.ts +9 -16
- package/dist/components/checkbox-group.d.ts.map +1 -0
- package/dist/components/checkbox-group.js +7 -19
- package/dist/components/checkbox.d.ts +5 -9
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +6 -14
- package/dist/components/collapsible.d.ts +7 -14
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +7 -15
- package/dist/components/command.d.ts +24 -55
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +18 -69
- package/dist/components/context-menu.d.ts +23 -72
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +21 -89
- package/dist/components/dialog.d.ts +23 -53
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +20 -72
- package/dist/components/drawer.d.ts +29 -60
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +16 -58
- package/dist/components/dropdown-menu.d.ts +23 -73
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +21 -96
- package/dist/components/empty.d.ts +16 -37
- package/dist/components/empty.d.ts.map +1 -0
- package/dist/components/empty.js +24 -44
- package/dist/components/field.d.ts +26 -63
- package/dist/components/field.d.ts.map +1 -0
- package/dist/components/field.js +46 -89
- package/dist/components/form.d.ts +16 -37
- package/dist/components/form.d.ts.map +1 -0
- package/dist/components/form.js +50 -66
- package/dist/components/hover-card.d.ts +8 -21
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +8 -23
- package/dist/components/input-group.d.ts +29 -53
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +59 -66
- package/dist/components/input-number.d.ts +8 -28
- package/dist/components/input-number.d.ts.map +1 -0
- package/dist/components/input-number.js +14 -55
- package/dist/components/input-otp.d.ts +11 -24
- package/dist/components/input-otp.d.ts.map +1 -0
- package/dist/components/input-otp.js +13 -34
- package/dist/components/input-password.d.ts +6 -12
- package/dist/components/input-password.d.ts.map +1 -0
- package/dist/components/input-password.js +10 -31
- package/dist/components/input-search.d.ts +9 -18
- package/dist/components/input-search.d.ts.map +1 -0
- package/dist/components/input-search.js +16 -44
- package/dist/components/input.d.ts +5 -10
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +5 -9
- package/dist/components/item.d.ts +33 -69
- package/dist/components/item.d.ts.map +1 -0
- package/dist/components/item.js +47 -90
- package/dist/components/kbd.d.ts +6 -13
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +6 -13
- package/dist/components/label.d.ts +5 -9
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +5 -8
- package/dist/components/menubar.d.ts +24 -80
- package/dist/components/menubar.d.ts.map +1 -0
- package/dist/components/menubar.js +23 -99
- package/dist/components/native-select.d.ts +7 -16
- package/dist/components/native-select.d.ts.map +1 -0
- package/dist/components/native-select.js +7 -25
- package/dist/components/navigation-menu.d.ts +13 -36
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/navigation-menu.js +25 -61
- package/dist/components/pagination.d.ts +15 -35
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +13 -55
- package/dist/components/popover.d.ts +9 -24
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +9 -27
- package/dist/components/progress-circle.d.ts +89 -106
- package/dist/components/progress-circle.d.ts.map +1 -0
- package/dist/components/progress-circle.js +70 -103
- package/dist/components/progress.d.ts +5 -10
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +7 -13
- package/dist/components/radio-cards.d.ts +5 -10
- package/dist/components/radio-cards.d.ts.map +1 -0
- package/dist/components/radio-cards.js +7 -21
- package/dist/components/radio-group.d.ts +6 -13
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +6 -17
- package/dist/components/radio.d.ts +6 -12
- package/dist/components/radio.d.ts.map +1 -0
- package/dist/components/radio.js +5 -10
- package/dist/components/resizable.d.ts +8 -18
- package/dist/components/resizable.d.ts.map +1 -0
- package/dist/components/resizable.js +7 -21
- package/dist/components/scroll-area.d.ts +21 -33
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +64 -84
- package/dist/components/select.d.ts +17 -50
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +26 -78
- package/dist/components/separator.d.ts +20 -29
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +27 -36
- package/dist/components/sheet.d.ts +30 -62
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +36 -80
- package/dist/components/sidebar.d.ts +67 -160
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar.js +166 -301
- package/dist/components/skeleton.d.ts +5 -9
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +5 -8
- package/dist/components/slider.d.ts +5 -13
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +12 -34
- package/dist/components/sonner.d.ts +8 -10
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +13 -16
- package/dist/components/spinner.d.ts +6 -12
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +20 -33
- package/dist/components/switch.d.ts +5 -9
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +5 -12
- package/dist/components/table.d.ts +12 -37
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +12 -47
- package/dist/components/tabs.d.ts +8 -21
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +8 -23
- package/dist/components/textarea.d.ts +5 -9
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +5 -8
- package/dist/components/toggle-group.d.ts +10 -24
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +20 -38
- package/dist/components/toggle.d.ts +18 -25
- package/dist/components/toggle.d.ts.map +1 -0
- package/dist/components/toggle.js +24 -29
- package/dist/components/tooltip.d.ts +9 -24
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +9 -28
- package/dist/hooks/use-animated-value.d.ts +2 -4
- package/dist/hooks/use-animated-value.d.ts.map +1 -0
- package/dist/hooks/use-animated-value.js +67 -58
- package/dist/hooks/use-copy-to-clipboard.d.ts +6 -11
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.js +42 -39
- package/dist/hooks/use-is-mobile.d.ts +2 -4
- package/dist/hooks/use-is-mobile.d.ts.map +1 -0
- package/dist/hooks/use-is-mobile.js +20 -23
- package/dist/hooks/use-media-query.d.ts +2 -4
- package/dist/hooks/use-media-query.d.ts.map +1 -0
- package/dist/hooks/use-media-query.js +49 -46
- package/dist/hooks/use-mutation-observer.d.ts +3 -6
- package/dist/hooks/use-mutation-observer.d.ts.map +1 -0
- package/dist/hooks/use-mutation-observer.js +33 -34
- package/dist/hooks/use-pagination.d.ts +15 -22
- package/dist/hooks/use-pagination.d.ts.map +1 -0
- package/dist/hooks/use-pagination.js +99 -99
- package/dist/index.d.ts +131 -69
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +68 -69
- package/dist/primitives/checkbox-group.d.ts +84 -105
- package/dist/primitives/checkbox-group.d.ts.map +1 -0
- package/dist/primitives/checkbox-group.js +91 -105
- package/dist/primitives/input-number.d.ts +41 -51
- package/dist/primitives/input-number.d.ts.map +1 -0
- package/dist/primitives/input-number.js +417 -473
- package/dist/primitives/input.d.ts +43 -48
- package/dist/primitives/input.d.ts.map +1 -0
- package/dist/primitives/input.js +67 -66
- package/dist/primitives/progress-circle.d.ts +49 -79
- package/dist/primitives/progress-circle.d.ts.map +1 -0
- package/dist/primitives/progress-circle.js +134 -149
- package/package.json +17 -10
- package/{dist → src}/css/preset.css +1 -1
- /package/{dist → src}/css/amber.css +0 -0
- /package/{dist → src}/css/blue.css +0 -0
- /package/{dist → src}/css/cyan.css +0 -0
- /package/{dist → src}/css/emerald.css +0 -0
- /package/{dist → src}/css/fuchsia.css +0 -0
- /package/{dist → src}/css/gray.css +0 -0
- /package/{dist → src}/css/green.css +0 -0
- /package/{dist → src}/css/indigo.css +0 -0
- /package/{dist → src}/css/lime.css +0 -0
- /package/{dist → src}/css/neutral.css +0 -0
- /package/{dist → src}/css/orange.css +0 -0
- /package/{dist → src}/css/pink.css +0 -0
- /package/{dist → src}/css/purple.css +0 -0
- /package/{dist → src}/css/red.css +0 -0
- /package/{dist → src}/css/rose.css +0 -0
- /package/{dist → src}/css/sky.css +0 -0
- /package/{dist → src}/css/slate.css +0 -0
- /package/{dist → src}/css/stone.css +0 -0
- /package/{dist → src}/css/style.css +0 -0
- /package/{dist → src}/css/teal.css +0 -0
- /package/{dist → src}/css/violet.css +0 -0
- /package/{dist → src}/css/yellow.css +0 -0
- /package/{dist → src}/css/zinc.css +0 -0
|
@@ -1,40 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { cn } from "@codefast/tailwind-variants";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { useMemo } from "react";
|
|
5
4
|
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
6
|
-
|
|
5
|
+
import { useMemo } from "react";
|
|
7
6
|
function Slider({ className, defaultValue, max = 100, min = 0, value, ...props }) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
});
|
|
7
|
+
const _values = useMemo(() => {
|
|
8
|
+
if (Array.isArray(value)) {
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
return Array.isArray(defaultValue) ? defaultValue : [min, max];
|
|
12
|
+
}, [value, defaultValue, min, max]);
|
|
13
|
+
return (_jsxs(SliderPrimitive.Root, { 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), "data-slot": "slider", defaultValue: defaultValue, max: max, min: min, value: value, ...props, children: [_jsx(SliderPrimitive.Track, { 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", "data-slot": "slider-track", children: _jsx(SliderPrimitive.Range, { className: "absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full", "data-slot": "slider-range" }) }), Array.from({ length: _values.length }, (_, index) => (_jsx(SliderPrimitive.Thumb, { "aria-label": "Volume", 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"), "data-slot": "slider-thumb" }, index)))] }));
|
|
38
14
|
}
|
|
39
|
-
|
|
15
|
+
/* -----------------------------------------------------------------------------
|
|
16
|
+
* Exports
|
|
17
|
+
* -------------------------------------------------------------------------- */
|
|
40
18
|
export { Slider };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { JSX } from "react";
|
|
2
|
-
import { ToasterProps as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
export { Toaster, type ToasterProps, toast, useSonner };
|
|
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 };
|
|
8
|
+
//# sourceMappingURL=sonner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../src/components/sonner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,GAAG,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AASjE,KAAK,YAAY,GAAG,kBAAkB,CAAC;AAEvC,iBAAS,OAAO,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,GAAG,GAAG,CAAC,OAAO,CAiBxD;AAMD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useTheme } from "next-themes";
|
|
4
|
-
import { Toaster as
|
|
5
|
-
//#region src/components/sonner.tsx
|
|
4
|
+
import { Toaster as Sonner } from "sonner";
|
|
6
5
|
function Toaster({ ...props }) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"--normal-text": "var(--popover-foreground)"
|
|
14
|
-
},
|
|
15
|
-
theme,
|
|
16
|
-
...props
|
|
17
|
-
});
|
|
6
|
+
const { theme = "system" } = useTheme();
|
|
7
|
+
return (_jsx(Sonner, { className: "toaster group", style: {
|
|
8
|
+
"--normal-bg": "var(--popover)",
|
|
9
|
+
"--normal-border": "var(--border)",
|
|
10
|
+
"--normal-text": "var(--popover-foreground)",
|
|
11
|
+
}, theme: theme, ...props }));
|
|
18
12
|
}
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
/* -----------------------------------------------------------------------------
|
|
14
|
+
* Exports
|
|
15
|
+
* -------------------------------------------------------------------------- */
|
|
16
|
+
export { toast, useSonner } from "sonner";
|
|
17
|
+
export { Toaster };
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { ComponentProps, ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
//#region src/components/spinner.d.ts
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
4
2
|
interface SpinnerProps extends ComponentProps<"span"> {
|
|
5
|
-
|
|
3
|
+
loading?: boolean;
|
|
6
4
|
}
|
|
7
|
-
declare function Spinner({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
...props
|
|
12
|
-
}: SpinnerProps): ReactNode;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { Spinner, type SpinnerProps };
|
|
5
|
+
declare function Spinner({ children, className, loading, ...props }: SpinnerProps): ReactNode;
|
|
6
|
+
export { Spinner };
|
|
7
|
+
export type { SpinnerProps };
|
|
8
|
+
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/components/spinner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAWtE,UAAU,YAAa,SAAQ,cAAc,CAAC,MAAM,CAAC;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,iBAAS,OAAO,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAc,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,GAAG,SAAS,CA0C3F;AAMD,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,40 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
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
|
-
|
|
5
|
+
/* -----------------------------------------------------------------------------
|
|
6
|
+
* Component: Spinner
|
|
7
|
+
* -------------------------------------------------------------------------- */
|
|
6
8
|
const SPINNER_COUNT = 8;
|
|
7
9
|
function Spinner({ children, className, loading = true, ...props }) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
});
|
|
10
|
+
if (!loading) {
|
|
11
|
+
return children;
|
|
12
|
+
}
|
|
13
|
+
const spinner = (_jsx("span", { className: cn("relative flex size-4 items-center justify-center opacity-60", className), ...props, children: Array.from({ length: SPINNER_COUNT }, (_, index) => (_jsx("span", { 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"), style: {
|
|
14
|
+
"--spinner-delay": `-${((SPINNER_COUNT - index) * 100).toString()}ms`,
|
|
15
|
+
"--spinner-duration": `${(SPINNER_COUNT * 100).toString()}ms`,
|
|
16
|
+
"--spinner-rotate": `${((360 / SPINNER_COUNT) * index).toString()}deg`,
|
|
17
|
+
width: `${(100 / SPINNER_COUNT).toString()}%`,
|
|
18
|
+
} }, index))) }));
|
|
19
|
+
if (children === undefined) {
|
|
20
|
+
return spinner;
|
|
21
|
+
}
|
|
22
|
+
return (_jsxs("span", { className: "relative", children: [_jsx("span", { "aria-hidden": true, className: "invisible contents", children: children }), _jsx(VisuallyHidden, { children: children }), _jsx("span", { className: "absolute inset-0 flex items-center justify-center", children: spinner })] }));
|
|
38
23
|
}
|
|
39
|
-
|
|
24
|
+
/* -----------------------------------------------------------------------------
|
|
25
|
+
* Exports
|
|
26
|
+
* -------------------------------------------------------------------------- */
|
|
40
27
|
export { Spinner };
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import { ComponentProps, JSX } from "react";
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
2
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
3
|
-
|
|
4
|
-
//#region src/components/switch.d.ts
|
|
5
3
|
type SwitchProps = ComponentProps<typeof SwitchPrimitives.Root>;
|
|
6
|
-
declare function Switch({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
//#endregion
|
|
11
|
-
export { Switch, type SwitchProps };
|
|
4
|
+
declare function Switch({ className, ...props }: SwitchProps): JSX.Element;
|
|
5
|
+
export { Switch };
|
|
6
|
+
export type { SwitchProps };
|
|
7
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/components/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAM3D,KAAK,WAAW,GAAG,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;AAEhE,iBAAS,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAgBjE;AAMD,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { cn } from "@codefast/tailwind-variants";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
5
|
-
//#region src/components/switch.tsx
|
|
6
5
|
function Switch({ className, ...props }) {
|
|
7
|
-
|
|
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
|
-
});
|
|
6
|
+
return (_jsx(SwitchPrimitives.Root, { 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), "data-slot": "switch", ...props, children: _jsx(SwitchPrimitives.Thumb, { 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", "data-slot": "switch-thumb" }) }));
|
|
16
7
|
}
|
|
17
|
-
|
|
8
|
+
/* -----------------------------------------------------------------------------
|
|
9
|
+
* Exports
|
|
10
|
+
* -------------------------------------------------------------------------- */
|
|
18
11
|
export { Switch };
|
|
@@ -1,45 +1,20 @@
|
|
|
1
|
-
import { ComponentProps, JSX } from "react";
|
|
2
|
-
|
|
3
|
-
//#region src/components/table.d.ts
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
4
2
|
type TableProps = ComponentProps<"table">;
|
|
5
|
-
declare function Table({
|
|
6
|
-
className,
|
|
7
|
-
...props
|
|
8
|
-
}: TableProps): JSX.Element;
|
|
3
|
+
declare function Table({ className, ...props }: TableProps): JSX.Element;
|
|
9
4
|
type TableHeaderProps = ComponentProps<"thead">;
|
|
10
|
-
declare function TableHeader({
|
|
11
|
-
className,
|
|
12
|
-
...props
|
|
13
|
-
}: TableHeaderProps): JSX.Element;
|
|
5
|
+
declare function TableHeader({ className, ...props }: TableHeaderProps): JSX.Element;
|
|
14
6
|
type TableBodyProps = ComponentProps<"tbody">;
|
|
15
|
-
declare function TableBody({
|
|
16
|
-
className,
|
|
17
|
-
...props
|
|
18
|
-
}: TableBodyProps): JSX.Element;
|
|
7
|
+
declare function TableBody({ className, ...props }: TableBodyProps): JSX.Element;
|
|
19
8
|
type TableFooterProps = ComponentProps<"tfoot">;
|
|
20
|
-
declare function TableFooter({
|
|
21
|
-
className,
|
|
22
|
-
...props
|
|
23
|
-
}: TableFooterProps): JSX.Element;
|
|
9
|
+
declare function TableFooter({ className, ...props }: TableFooterProps): JSX.Element;
|
|
24
10
|
type TableRowProps = ComponentProps<"tr">;
|
|
25
|
-
declare function TableRow({
|
|
26
|
-
className,
|
|
27
|
-
...props
|
|
28
|
-
}: TableRowProps): JSX.Element;
|
|
11
|
+
declare function TableRow({ className, ...props }: TableRowProps): JSX.Element;
|
|
29
12
|
type TableHeadProps = ComponentProps<"th">;
|
|
30
|
-
declare function TableHead({
|
|
31
|
-
className,
|
|
32
|
-
...props
|
|
33
|
-
}: TableHeadProps): JSX.Element;
|
|
13
|
+
declare function TableHead({ className, ...props }: TableHeadProps): JSX.Element;
|
|
34
14
|
type TableCellProps = ComponentProps<"td">;
|
|
35
|
-
declare function TableCell({
|
|
36
|
-
className,
|
|
37
|
-
...props
|
|
38
|
-
}: TableCellProps): JSX.Element;
|
|
15
|
+
declare function TableCell({ className, ...props }: TableCellProps): JSX.Element;
|
|
39
16
|
type TableCaptionProps = ComponentProps<"caption">;
|
|
40
|
-
declare function TableCaption({
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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 };
|
|
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, };
|
|
20
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/components/table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAQjD,KAAK,UAAU,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;AAE1C,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CAU/D;AAMD,KAAK,gBAAgB,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;AAEhD,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAQ3E;AAMD,KAAK,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;AAE9C,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CAIvE;AAMD,KAAK,gBAAgB,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;AAEhD,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAW3E;AAMD,KAAK,aAAa,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;AAE1C,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAWrE;AAMD,KAAK,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;AAE3C,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CAQvE;AAMD,KAAK,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;AAE3C,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CAEvE;AAMD,KAAK,iBAAiB,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;AAEnD,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CAQ7E;AAMD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;AACpG,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,aAAa,GACd,CAAC"}
|
package/dist/components/table.js
CHANGED
|
@@ -1,65 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { cn } from "@codefast/tailwind-variants";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
//#region src/components/table.tsx
|
|
4
3
|
function Table({ className, ...props }) {
|
|
5
|
-
|
|
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
|
-
});
|
|
4
|
+
return (_jsx("div", { className: "relative w-full overflow-auto", "data-slot": "table-cotainer", children: _jsx("table", { className: cn("w-full caption-bottom text-sm", className), "data-slot": "table", ...props }) }));
|
|
14
5
|
}
|
|
15
6
|
function TableHeader({ className, ...props }) {
|
|
16
|
-
|
|
17
|
-
className: cn("*:border-b *:has-aria-expanded:bg-transparent", className),
|
|
18
|
-
"data-slot": "table-header",
|
|
19
|
-
...props
|
|
20
|
-
});
|
|
7
|
+
return (_jsx("thead", { className: cn("*:border-b *:has-aria-expanded:bg-transparent", className), "data-slot": "table-header", ...props }));
|
|
21
8
|
}
|
|
22
9
|
function TableBody({ className, ...props }) {
|
|
23
|
-
|
|
24
|
-
className: cn("*:last-child:border-0", className),
|
|
25
|
-
"data-slot": "table-body",
|
|
26
|
-
...props
|
|
27
|
-
});
|
|
10
|
+
return (_jsx("tbody", { className: cn("*:last-child:border-0", className), "data-slot": "table-body", ...props }));
|
|
28
11
|
}
|
|
29
12
|
function TableFooter({ className, ...props }) {
|
|
30
|
-
|
|
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
|
-
});
|
|
13
|
+
return (_jsx("tfoot", { className: cn("bg-muted/50 font-medium *:border-t *:border-b-0 *:has-aria-expanded:bg-transparent", className), "data-slot": "table-footer", ...props }));
|
|
35
14
|
}
|
|
36
15
|
function TableRow({ className, ...props }) {
|
|
37
|
-
|
|
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
|
-
});
|
|
16
|
+
return (_jsx("tr", { className: cn("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className), "data-slot": "table-row", ...props }));
|
|
42
17
|
}
|
|
43
18
|
function TableHead({ className, ...props }) {
|
|
44
|
-
|
|
45
|
-
className: cn("p-2 text-left align-middle font-medium", className),
|
|
46
|
-
"data-slot": "table-head",
|
|
47
|
-
...props
|
|
48
|
-
});
|
|
19
|
+
return (_jsx("th", { className: cn("p-2 text-left align-middle font-medium", className), "data-slot": "table-head", ...props }));
|
|
49
20
|
}
|
|
50
21
|
function TableCell({ className, ...props }) {
|
|
51
|
-
|
|
52
|
-
className: cn("p-2 align-middle", className),
|
|
53
|
-
"data-slot": "table-cell",
|
|
54
|
-
...props
|
|
55
|
-
});
|
|
22
|
+
return _jsx("td", { className: cn("p-2 align-middle", className), "data-slot": "table-cell", ...props });
|
|
56
23
|
}
|
|
57
24
|
function TableCaption({ className, ...props }) {
|
|
58
|
-
|
|
59
|
-
className: cn("mt-4 text-sm text-muted-foreground", className),
|
|
60
|
-
"data-slot": "table-caption",
|
|
61
|
-
...props
|
|
62
|
-
});
|
|
25
|
+
return (_jsx("caption", { className: cn("mt-4 text-sm text-muted-foreground", className), "data-slot": "table-caption", ...props }));
|
|
63
26
|
}
|
|
64
|
-
|
|
27
|
+
/* -----------------------------------------------------------------------------
|
|
28
|
+
* Exports
|
|
29
|
+
* -------------------------------------------------------------------------- */
|
|
65
30
|
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -1,26 +1,13 @@
|
|
|
1
|
-
import { ComponentProps, JSX } from "react";
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
2
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
3
|
-
|
|
4
|
-
//#region src/components/tabs.d.ts
|
|
5
3
|
type TabsProps = ComponentProps<typeof TabsPrimitive.Root>;
|
|
6
|
-
declare function Tabs({
|
|
7
|
-
className,
|
|
8
|
-
...props
|
|
9
|
-
}: TabsProps): JSX.Element;
|
|
4
|
+
declare function Tabs({ className, ...props }: TabsProps): JSX.Element;
|
|
10
5
|
type TabsListProps = ComponentProps<typeof TabsPrimitive.List>;
|
|
11
|
-
declare function TabsList({
|
|
12
|
-
className,
|
|
13
|
-
...props
|
|
14
|
-
}: TabsListProps): JSX.Element;
|
|
6
|
+
declare function TabsList({ className, ...props }: TabsListProps): JSX.Element;
|
|
15
7
|
type TabsTriggerProps = ComponentProps<typeof TabsPrimitive.Trigger>;
|
|
16
|
-
declare function TabsTrigger({
|
|
17
|
-
className,
|
|
18
|
-
...props
|
|
19
|
-
}: TabsTriggerProps): JSX.Element;
|
|
8
|
+
declare function TabsTrigger({ className, ...props }: TabsTriggerProps): JSX.Element;
|
|
20
9
|
type TabsContentProps = ComponentProps<typeof TabsPrimitive.Content>;
|
|
21
|
-
declare function TabsContent({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
//#endregion
|
|
26
|
-
export { Tabs, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTrigger, type TabsTriggerProps };
|
|
10
|
+
declare function TabsContent({ className, ...props }: TabsContentProps): JSX.Element;
|
|
11
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
12
|
+
export type { TabsContentProps, TabsListProps, TabsProps, TabsTriggerProps };
|
|
13
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/components/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,KAAK,aAAa,MAAM,sBAAsB,CAAC;AAMtD,KAAK,SAAS,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;AAE3D,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAQ7D;AAMD,KAAK,aAAa,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;AAE/D,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAWrE;AAMD,KAAK,gBAAgB,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;AAErE,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAW3E;AAMD,KAAK,gBAAgB,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;AAErE,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAW3E;AAMD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;AACpD,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/components/tabs.js
CHANGED
|
@@ -1,35 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import { cn } from "@codefast/tailwind-variants";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
5
|
-
//#region src/components/tabs.tsx
|
|
6
5
|
function Tabs({ className, ...props }) {
|
|
7
|
-
|
|
8
|
-
className: cn("flex flex-col gap-2", className),
|
|
9
|
-
"data-slot": "tabs",
|
|
10
|
-
...props
|
|
11
|
-
});
|
|
6
|
+
return (_jsx(TabsPrimitive.Root, { className: cn("flex flex-col gap-2", className), "data-slot": "tabs", ...props }));
|
|
12
7
|
}
|
|
13
8
|
function TabsList({ className, ...props }) {
|
|
14
|
-
|
|
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
|
-
});
|
|
9
|
+
return (_jsx(TabsPrimitive.List, { className: cn("inline-flex w-fit items-center justify-center gap-1 rounded-xl bg-muted px-1 py-1 text-muted-foreground", className), "data-slot": "tabs-list", ...props }));
|
|
19
10
|
}
|
|
20
11
|
function TabsTrigger({ className, ...props }) {
|
|
21
|
-
|
|
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
|
-
});
|
|
12
|
+
return (_jsx(TabsPrimitive.Trigger, { 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), "data-slot": "tabs-trigger", ...props }));
|
|
26
13
|
}
|
|
27
14
|
function TabsContent({ className, ...props }) {
|
|
28
|
-
|
|
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
|
-
});
|
|
15
|
+
return (_jsx(TabsPrimitive.Content, { className: cn("mt-2 rounded-xl ring-ring/50 outline-ring focus-visible:ring-4 focus-visible:outline-1", className), "data-slot": "tabs-content", ...props }));
|
|
33
16
|
}
|
|
34
|
-
|
|
17
|
+
/* -----------------------------------------------------------------------------
|
|
18
|
+
* Exports
|
|
19
|
+
* -------------------------------------------------------------------------- */
|
|
35
20
|
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { ComponentProps, JSX } from "react";
|
|
2
|
-
|
|
3
|
-
//#region src/components/textarea.d.ts
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
4
2
|
type TextareaProps = ComponentProps<"textarea">;
|
|
5
|
-
declare function Textarea({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
export { Textarea, type TextareaProps };
|
|
3
|
+
declare function Textarea({ className, ...props }: TextareaProps): JSX.Element;
|
|
4
|
+
export { Textarea };
|
|
5
|
+
export type { TextareaProps };
|
|
6
|
+
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../src/components/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAQjD,KAAK,aAAa,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;AAEhD,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAWrE;AAMD,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { cn } from "@codefast/tailwind-variants";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
//#region src/components/textarea.tsx
|
|
4
3
|
function Textarea({ className, ...props }) {
|
|
5
|
-
|
|
6
|
-
className: cn("flex min-h-16 w-full grow rounded-lg border border-input px-3 py-2 text-base shadow-xs outline-hidden transition placeholder:text-muted-foreground hover:not-disabled:not-focus-visible:border-ring/60 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50 aria-invalid:border-destructive focus-within:aria-invalid:ring-destructive/20 hover:not-disabled:not-focus-within:aria-invalid:border-destructive/60 md:text-sm dark:bg-input/30 dark:focus-within:aria-invalid:ring-destructive/40", className),
|
|
7
|
-
"data-slot": "textarea",
|
|
8
|
-
...props
|
|
9
|
-
});
|
|
4
|
+
return (_jsx("textarea", { className: cn("flex min-h-16 w-full grow rounded-lg border border-input px-3 py-2 text-base shadow-xs outline-hidden transition placeholder:text-muted-foreground hover:not-disabled:not-focus-visible:border-ring/60 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50 aria-invalid:border-destructive focus-within:aria-invalid:ring-destructive/20 hover:not-disabled:not-focus-within:aria-invalid:border-destructive/60 md:text-sm dark:bg-input/30 dark:focus-within:aria-invalid:ring-destructive/40", className), "data-slot": "textarea", ...props }));
|
|
10
5
|
}
|
|
11
|
-
|
|
6
|
+
/* -----------------------------------------------------------------------------
|
|
7
|
+
* Exports
|
|
8
|
+
* -------------------------------------------------------------------------- */
|
|
12
9
|
export { Textarea };
|
|
@@ -1,30 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ComponentProps, JSX } from "react";
|
|
3
|
-
import { Scope } from "@radix-ui/react-context";
|
|
1
|
+
import type { Scope } from "@radix-ui/react-context";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
4
3
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
5
|
-
|
|
6
|
-
//#region src/components/toggle-group.d.ts
|
|
4
|
+
import type { ToggleVariants } from "#components/toggle";
|
|
7
5
|
type ScopedProps<P> = P & {
|
|
8
|
-
|
|
6
|
+
__scopeToggleGroup?: Scope;
|
|
9
7
|
};
|
|
10
8
|
type ToggleGroupProps = ComponentProps<typeof ToggleGroupPrimitive.Root> & ToggleVariants & {
|
|
11
|
-
|
|
9
|
+
spacing?: number;
|
|
12
10
|
};
|
|
13
|
-
declare function ToggleGroup({
|
|
14
|
-
__scopeToggleGroup,
|
|
15
|
-
children,
|
|
16
|
-
className,
|
|
17
|
-
size,
|
|
18
|
-
spacing,
|
|
19
|
-
variant,
|
|
20
|
-
...props
|
|
21
|
-
}: ScopedProps<ToggleGroupProps>): JSX.Element;
|
|
11
|
+
declare function ToggleGroup({ __scopeToggleGroup, children, className, size, spacing, variant, ...props }: ScopedProps<ToggleGroupProps>): JSX.Element;
|
|
22
12
|
type ToggleGroupItemProps = ScopedProps<ComponentProps<typeof ToggleGroupPrimitive.Item>>;
|
|
23
|
-
declare function ToggleGroupItem({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
...props
|
|
28
|
-
}: ToggleGroupItemProps): JSX.Element;
|
|
29
|
-
//#endregion
|
|
30
|
-
export { ToggleGroup, ToggleGroupItem, type ToggleGroupItemProps, type ToggleGroupProps };
|
|
13
|
+
declare function ToggleGroupItem({ __scopeToggleGroup, children, className, ...props }: ToggleGroupItemProps): JSX.Element;
|
|
14
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
15
|
+
export type { ToggleGroupItemProps, ToggleGroupProps };
|
|
16
|
+
//# sourceMappingURL=toggle-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group.d.ts","sourceRoot":"","sources":["../../src/components/toggle-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAiB,GAAG,EAAE,MAAM,OAAO,CAAC;AAIhE,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAGrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAUzD,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAgBzD,KAAK,gBAAgB,GAAG,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,GACtE,cAAc,GAAG;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEJ,iBAAS,WAAW,CAAC,EACnB,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,OAAW,EACX,OAAO,EACP,GAAG,KAAK,EACT,EAAE,WAAW,CAAC,gBAAgB,CAAC,GAAG,GAAG,CAAC,OAAO,CAsB7C;AAQD,KAAK,oBAAoB,GAAG,WAAW,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC;AAE1F,iBAAS,eAAe,CAAC,EACvB,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,oBAAoB,GAAG,GAAG,CAAC,OAAO,CA4BpC;AAMD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;AACxC,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,CAAC"}
|