@codefast/ui 0.3.13-canary.3 → 0.3.13-canary.4
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 +19 -0
- package/dist/components/accordion.d.mts +37 -0
- package/dist/components/accordion.mjs +53 -0
- package/dist/components/alert-dialog.d.mts +74 -0
- package/dist/components/alert-dialog.mjs +92 -0
- package/dist/components/alert.d.mts +30 -0
- package/dist/components/alert.mjs +49 -0
- package/dist/components/aspect-ratio.d.mts +10 -0
- package/dist/components/aspect-ratio.mjs +12 -0
- package/dist/components/avatar.d.mts +21 -0
- package/dist/components/avatar.mjs +28 -0
- package/dist/components/badge.d.mts +24 -0
- package/dist/components/badge.mjs +56 -0
- package/dist/components/breadcrumb.d.mts +44 -0
- package/dist/components/breadcrumb.mjs +67 -0
- package/dist/components/button-group.d.mts +34 -0
- package/dist/components/button-group.mjs +53 -0
- package/dist/components/button.d.mts +38 -0
- package/dist/components/button.mjs +99 -0
- package/dist/components/calendar.d.mts +27 -0
- package/dist/components/calendar.mjs +114 -0
- package/dist/components/card.d.mts +41 -0
- package/dist/components/card.mjs +55 -0
- package/dist/components/carousel.d.mts +68 -0
- package/dist/components/carousel.mjs +135 -0
- package/dist/components/chart.d.mts +93 -0
- package/dist/components/chart.mjs +189 -0
- package/dist/components/checkbox-cards.d.mts +17 -0
- package/dist/components/checkbox-cards.mjs +30 -0
- package/dist/components/checkbox-group.d.mts +16 -0
- package/dist/components/checkbox-group.mjs +27 -0
- package/dist/components/checkbox.d.mts +11 -0
- package/dist/components/checkbox.mjs +20 -0
- package/dist/components/collapsible.d.mts +18 -0
- package/dist/components/collapsible.mjs +24 -0
- package/dist/components/command.d.mts +57 -0
- package/dist/components/command.mjs +92 -0
- package/dist/components/context-menu.d.mts +91 -0
- package/dist/components/context-menu.mjs +122 -0
- package/dist/components/dialog.d.mts +65 -0
- package/dist/components/dialog.mjs +93 -0
- package/dist/components/drawer.d.mts +65 -0
- package/dist/components/drawer.mjs +78 -0
- package/dist/components/dropdown-menu.d.mts +92 -0
- package/dist/components/dropdown-menu.mjs +129 -0
- package/dist/components/empty.d.mts +44 -0
- package/dist/components/empty.mjs +64 -0
- package/dist/components/field.d.mts +79 -0
- package/dist/components/field.mjs +132 -0
- package/dist/components/form.d.mts +48 -0
- package/dist/components/form.mjs +92 -0
- package/dist/components/hover-card.d.mts +26 -0
- package/dist/components/hover-card.mjs +35 -0
- package/dist/components/input-group.d.mts +61 -0
- package/dist/components/input-group.mjs +142 -0
- package/dist/components/input-number.d.mts +28 -0
- package/dist/components/input-number.mjs +61 -0
- package/dist/components/input-otp.d.mts +29 -0
- package/dist/components/input-otp.mjs +48 -0
- package/dist/components/input-password.d.mts +13 -0
- package/dist/components/input-password.mjs +38 -0
- package/dist/components/input-search.d.mts +20 -0
- package/dist/components/input-search.mjs +50 -0
- package/dist/components/input.d.mts +11 -0
- package/dist/components/input.mjs +14 -0
- package/dist/components/item.d.mts +82 -0
- package/dist/components/item.mjs +137 -0
- package/dist/components/kbd.d.mts +15 -0
- package/dist/components/kbd.mjs +19 -0
- package/dist/components/label.d.mts +11 -0
- package/dist/components/label.mjs +14 -0
- package/dist/components/menubar.d.mts +100 -0
- package/dist/components/menubar.mjs +133 -0
- package/dist/components/native-select.d.mts +19 -0
- package/dist/components/native-select.mjs +34 -0
- package/dist/components/navigation-menu.d.mts +44 -0
- package/dist/components/navigation-menu.mjs +79 -0
- package/dist/components/pagination.d.mts +46 -0
- package/dist/components/pagination.mjs +71 -0
- package/dist/components/popover.d.mts +30 -0
- package/dist/components/popover.mjs +41 -0
- package/dist/components/progress-circle.d.mts +124 -0
- package/dist/components/progress-circle.mjs +120 -0
- package/dist/components/progress.d.mts +12 -0
- package/dist/components/progress.mjs +19 -0
- package/dist/components/{radio-cards.d.ts → radio-cards.d.mts} +10 -5
- package/dist/components/radio-cards.mjs +29 -0
- package/dist/components/radio-group.d.mts +16 -0
- package/dist/components/radio-group.mjs +25 -0
- package/dist/components/radio.d.mts +14 -0
- package/dist/components/radio.mjs +16 -0
- package/dist/components/resizable.d.mts +23 -0
- package/dist/components/resizable.mjs +32 -0
- package/dist/components/scroll-area.d.mts +40 -0
- package/dist/components/scroll-area.mjs +101 -0
- package/dist/components/select.d.mts +62 -0
- package/dist/components/select.mjs +101 -0
- package/dist/components/separator.d.mts +32 -0
- package/dist/components/separator.mjs +45 -0
- package/dist/components/sheet.d.mts +75 -0
- package/dist/components/sheet.mjs +134 -0
- package/dist/components/sidebar.d.mts +195 -0
- package/dist/components/sidebar.mjs +375 -0
- package/dist/components/skeleton.d.mts +10 -0
- package/dist/components/skeleton.mjs +12 -0
- package/dist/components/slider.d.mts +15 -0
- package/dist/components/slider.mjs +40 -0
- package/dist/components/sonner.d.mts +10 -0
- package/dist/components/sonner.mjs +21 -0
- package/dist/components/spinner.d.mts +14 -0
- package/dist/components/spinner.mjs +40 -0
- package/dist/components/switch.d.mts +11 -0
- package/dist/components/switch.mjs +18 -0
- package/dist/components/table.d.mts +45 -0
- package/dist/components/table.mjs +65 -0
- package/dist/components/tabs.d.mts +26 -0
- package/dist/components/tabs.mjs +35 -0
- package/dist/components/textarea.d.mts +10 -0
- package/dist/components/textarea.mjs +12 -0
- package/dist/components/toggle-group.d.mts +30 -0
- package/dist/components/toggle-group.mjs +53 -0
- package/dist/components/toggle.d.mts +28 -0
- package/dist/components/toggle.mjs +53 -0
- package/dist/components/tooltip.d.mts +30 -0
- package/dist/components/tooltip.mjs +42 -0
- package/dist/hooks/{use-animated-value.d.ts → use-animated-value.d.mts} +4 -2
- package/dist/hooks/use-animated-value.mjs +62 -0
- package/dist/hooks/{use-copy-to-clipboard.d.ts → use-copy-to-clipboard.d.mts} +11 -6
- package/dist/hooks/use-copy-to-clipboard.mjs +43 -0
- package/dist/hooks/{use-is-mobile.d.ts → use-is-mobile.d.mts} +4 -2
- package/dist/hooks/use-is-mobile.mjs +26 -0
- package/dist/hooks/{use-media-query.d.ts → use-media-query.d.mts} +4 -2
- package/dist/hooks/use-media-query.mjs +50 -0
- package/dist/hooks/{use-mutation-observer.d.ts → use-mutation-observer.d.mts} +6 -3
- package/dist/hooks/use-mutation-observer.mjs +41 -0
- package/dist/hooks/use-pagination.d.mts +44 -0
- package/dist/hooks/use-pagination.mjs +107 -0
- package/dist/index.d.mts +69 -0
- package/dist/index.mjs +69 -0
- package/dist/lib/utils.d.mts +13 -0
- package/dist/lib/utils.mjs +10 -0
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/clsx.d.mts +6 -0
- package/dist/primitives/checkbox-group.d.mts +144 -0
- package/dist/primitives/checkbox-group.mjs +126 -0
- package/dist/primitives/input-number.d.mts +73 -0
- package/dist/primitives/input-number.mjs +514 -0
- package/dist/primitives/input.d.mts +72 -0
- package/dist/primitives/input.mjs +75 -0
- package/dist/primitives/progress-circle.d.mts +146 -0
- package/dist/primitives/progress-circle.mjs +178 -0
- package/package.json +164 -170
- package/dist/components/accordion.d.ts +0 -19
- package/dist/components/accordion.d.ts.map +0 -1
- package/dist/components/accordion.js +0 -26
- package/dist/components/alert-dialog.d.ts +0 -39
- package/dist/components/alert-dialog.d.ts.map +0 -1
- package/dist/components/alert-dialog.js +0 -39
- package/dist/components/alert.d.ts +0 -19
- package/dist/components/alert.d.ts.map +0 -1
- package/dist/components/alert.js +0 -41
- package/dist/components/aspect-ratio.d.ts +0 -7
- package/dist/components/aspect-ratio.d.ts.map +0 -1
- package/dist/components/aspect-ratio.js +0 -10
- package/dist/components/avatar.d.ts +0 -11
- package/dist/components/avatar.d.ts.map +0 -1
- package/dist/components/avatar.js +0 -17
- package/dist/components/badge.d.ts +0 -18
- package/dist/components/badge.d.ts.map +0 -1
- package/dist/components/badge.js +0 -59
- package/dist/components/breadcrumb.d.ts +0 -22
- package/dist/components/breadcrumb.d.ts.map +0 -1
- package/dist/components/breadcrumb.js +0 -31
- package/dist/components/button-group.d.ts +0 -20
- package/dist/components/button-group.d.ts.map +0 -1
- package/dist/components/button-group.js +0 -48
- package/dist/components/button.d.ts +0 -29
- package/dist/components/button.d.ts.map +0 -1
- package/dist/components/button.js +0 -92
- package/dist/components/calendar.d.ts +0 -13
- package/dist/components/calendar.d.ts.map +0 -1
- package/dist/components/calendar.js +0 -104
- package/dist/components/card.d.ts +0 -18
- package/dist/components/card.d.ts.map +0 -1
- package/dist/components/card.js +0 -27
- package/dist/components/carousel.d.ts +0 -38
- package/dist/components/carousel.d.ts.map +0 -1
- package/dist/components/carousel.js +0 -103
- package/dist/components/chart.d.ts +0 -58
- package/dist/components/chart.d.ts.map +0 -1
- package/dist/components/chart.js +0 -198
- package/dist/components/checkbox-cards.d.ts +0 -11
- package/dist/components/checkbox-cards.d.ts.map +0 -1
- package/dist/components/checkbox-cards.js +0 -16
- package/dist/components/checkbox-group.d.ts +0 -9
- package/dist/components/checkbox-group.d.ts.map +0 -1
- package/dist/components/checkbox-group.js +0 -15
- package/dist/components/checkbox.d.ts +0 -7
- package/dist/components/checkbox.d.ts.map +0 -1
- package/dist/components/checkbox.js +0 -12
- package/dist/components/collapsible.d.ts +0 -11
- package/dist/components/collapsible.d.ts.map +0 -1
- package/dist/components/collapsible.js +0 -16
- package/dist/components/command.d.ts +0 -26
- package/dist/components/command.d.ts.map +0 -1
- package/dist/components/command.js +0 -41
- package/dist/components/context-menu.d.ts +0 -42
- package/dist/components/context-menu.d.ts.map +0 -1
- package/dist/components/context-menu.js +0 -54
- package/dist/components/dialog.d.ts +0 -35
- package/dist/components/dialog.d.ts.map +0 -1
- package/dist/components/dialog.js +0 -41
- package/dist/components/drawer.d.ts +0 -34
- package/dist/components/drawer.d.ts.map +0 -1
- package/dist/components/drawer.js +0 -36
- package/dist/components/dropdown-menu.d.ts +0 -42
- package/dist/components/dropdown-menu.d.ts.map +0 -1
- package/dist/components/dropdown-menu.js +0 -54
- package/dist/components/empty.d.ts +0 -23
- package/dist/components/empty.d.ts.map +0 -1
- package/dist/components/empty.js +0 -47
- package/dist/components/field.d.ts +0 -42
- package/dist/components/field.d.ts.map +0 -1
- package/dist/components/field.js +0 -85
- package/dist/components/form.d.ts +0 -27
- package/dist/components/form.d.ts.map +0 -1
- package/dist/components/form.js +0 -76
- package/dist/components/hover-card.d.ts +0 -13
- package/dist/components/hover-card.d.ts.map +0 -1
- package/dist/components/hover-card.js +0 -20
- package/dist/components/input-group.d.ts +0 -37
- package/dist/components/input-group.d.ts.map +0 -1
- package/dist/components/input-group.js +0 -127
- package/dist/components/input-number.d.ts +0 -8
- package/dist/components/input-number.d.ts.map +0 -1
- package/dist/components/input-number.js +0 -20
- package/dist/components/input-otp.d.ts +0 -16
- package/dist/components/input-otp.d.ts.map +0 -1
- package/dist/components/input-otp.js +0 -25
- package/dist/components/input-password.d.ts +0 -7
- package/dist/components/input-password.d.ts.map +0 -1
- package/dist/components/input-password.js +0 -17
- package/dist/components/input-search.d.ts +0 -11
- package/dist/components/input-search.d.ts.map +0 -1
- package/dist/components/input-search.js +0 -22
- package/dist/components/input.d.ts +0 -6
- package/dist/components/input.d.ts.map +0 -1
- package/dist/components/input.js +0 -10
- package/dist/components/item.d.ts +0 -46
- package/dist/components/item.d.ts.map +0 -1
- package/dist/components/item.js +0 -94
- package/dist/components/kbd.d.ts +0 -8
- package/dist/components/kbd.d.ts.map +0 -1
- package/dist/components/kbd.js +0 -12
- package/dist/components/label.d.ts +0 -7
- package/dist/components/label.d.ts.map +0 -1
- package/dist/components/label.js +0 -11
- package/dist/components/menubar.d.ts +0 -44
- package/dist/components/menubar.d.ts.map +0 -1
- package/dist/components/menubar.js +0 -57
- package/dist/components/native-select.d.ts +0 -10
- package/dist/components/native-select.d.ts.map +0 -1
- package/dist/components/native-select.js +0 -16
- package/dist/components/navigation-menu.d.ts +0 -21
- package/dist/components/navigation-menu.d.ts.map +0 -1
- package/dist/components/navigation-menu.js +0 -43
- package/dist/components/pagination.d.ts +0 -26
- package/dist/components/pagination.d.ts.map +0 -1
- package/dist/components/pagination.js +0 -29
- package/dist/components/popover.d.ts +0 -15
- package/dist/components/popover.d.ts.map +0 -1
- package/dist/components/popover.js +0 -23
- package/dist/components/progress-circle.d.ts +0 -107
- package/dist/components/progress-circle.d.ts.map +0 -1
- package/dist/components/progress-circle.js +0 -83
- package/dist/components/progress.d.ts +0 -7
- package/dist/components/progress.d.ts.map +0 -1
- package/dist/components/progress.js +0 -13
- package/dist/components/radio-cards.d.ts.map +0 -1
- package/dist/components/radio-cards.js +0 -15
- package/dist/components/radio-group.d.ts +0 -9
- package/dist/components/radio-group.d.ts.map +0 -1
- package/dist/components/radio-group.js +0 -14
- package/dist/components/radio.d.ts +0 -8
- package/dist/components/radio.d.ts.map +0 -1
- package/dist/components/radio.js +0 -11
- package/dist/components/resizable.d.ts +0 -13
- package/dist/components/resizable.d.ts.map +0 -1
- package/dist/components/resizable.js +0 -18
- package/dist/components/scroll-area.d.ts +0 -28
- package/dist/components/scroll-area.d.ts.map +0 -1
- package/dist/components/scroll-area.js +0 -77
- package/dist/components/select.d.ts +0 -29
- package/dist/components/select.d.ts.map +0 -1
- package/dist/components/select.js +0 -49
- package/dist/components/separator.d.ts +0 -23
- package/dist/components/separator.d.ts.map +0 -1
- package/dist/components/separator.js +0 -36
- package/dist/components/sheet.d.ts +0 -43
- package/dist/components/sheet.d.ts.map +0 -1
- package/dist/components/sheet.js +0 -90
- package/dist/components/sidebar.d.ts +0 -102
- package/dist/components/sidebar.d.ts.map +0 -1
- package/dist/components/sidebar.js +0 -241
- package/dist/components/skeleton.d.ts +0 -6
- package/dist/components/skeleton.d.ts.map +0 -1
- package/dist/components/skeleton.js +0 -9
- package/dist/components/slider.d.ts +0 -7
- package/dist/components/slider.d.ts.map +0 -1
- package/dist/components/slider.js +0 -18
- package/dist/components/sonner.d.ts +0 -8
- package/dist/components/sonner.d.ts.map +0 -1
- package/dist/components/sonner.js +0 -18
- package/dist/components/spinner.d.ts +0 -8
- package/dist/components/spinner.d.ts.map +0 -1
- package/dist/components/spinner.js +0 -27
- package/dist/components/switch.d.ts +0 -7
- package/dist/components/switch.d.ts.map +0 -1
- package/dist/components/switch.js +0 -11
- package/dist/components/table.d.ts +0 -20
- package/dist/components/table.d.ts.map +0 -1
- package/dist/components/table.js +0 -30
- package/dist/components/tabs.d.ts +0 -13
- package/dist/components/tabs.d.ts.map +0 -1
- package/dist/components/tabs.js +0 -20
- package/dist/components/textarea.d.ts +0 -6
- package/dist/components/textarea.d.ts.map +0 -1
- package/dist/components/textarea.js +0 -9
- package/dist/components/toggle-group.d.ts +0 -16
- package/dist/components/toggle-group.d.ts.map +0 -1
- package/dist/components/toggle-group.js +0 -35
- package/dist/components/toggle.d.ts +0 -21
- package/dist/components/toggle.d.ts.map +0 -1
- package/dist/components/toggle.js +0 -49
- package/dist/components/tooltip.d.ts +0 -15
- package/dist/components/tooltip.d.ts.map +0 -1
- package/dist/components/tooltip.js +0 -23
- package/dist/hooks/use-animated-value.d.ts.map +0 -1
- package/dist/hooks/use-animated-value.js +0 -71
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +0 -1
- package/dist/hooks/use-copy-to-clipboard.js +0 -46
- package/dist/hooks/use-is-mobile.d.ts.map +0 -1
- package/dist/hooks/use-is-mobile.js +0 -23
- package/dist/hooks/use-media-query.d.ts.map +0 -1
- package/dist/hooks/use-media-query.js +0 -53
- package/dist/hooks/use-mutation-observer.d.ts.map +0 -1
- package/dist/hooks/use-mutation-observer.js +0 -40
- package/dist/hooks/use-pagination.d.ts +0 -37
- package/dist/hooks/use-pagination.d.ts.map +0 -1
- package/dist/hooks/use-pagination.js +0 -107
- package/dist/index.d.ts +0 -131
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -68
- package/dist/lib/utils.d.ts +0 -10
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/lib/utils.js +0 -10
- package/dist/primitives/checkbox-group.d.ts +0 -123
- package/dist/primitives/checkbox-group.d.ts.map +0 -1
- package/dist/primitives/checkbox-group.js +0 -112
- package/dist/primitives/input-number.d.ts +0 -63
- package/dist/primitives/input-number.d.ts.map +0 -1
- package/dist/primitives/input-number.js +0 -458
- package/dist/primitives/input.d.ts +0 -67
- package/dist/primitives/input.d.ts.map +0 -1
- package/dist/primitives/input.js +0 -76
- package/dist/primitives/progress-circle.d.ts +0 -116
- package/dist/primitives/progress-circle.d.ts.map +0 -1
- package/dist/primitives/progress-circle.js +0 -163
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "#lib/utils";
|
|
4
|
-
import { useTheme } from "next-themes";
|
|
5
|
-
import { Toaster as Sonner } from "sonner";
|
|
6
|
-
function Toaster({ ...props }) {
|
|
7
|
-
const { theme = "system" } = useTheme();
|
|
8
|
-
return (_jsx(Sonner, { className: cn("group", "toaster"), style: {
|
|
9
|
-
"--normal-bg": "var(--popover)",
|
|
10
|
-
"--normal-border": "var(--border)",
|
|
11
|
-
"--normal-text": "var(--popover-foreground)",
|
|
12
|
-
}, theme: theme, ...props }));
|
|
13
|
-
}
|
|
14
|
-
/* -----------------------------------------------------------------------------
|
|
15
|
-
* Exports
|
|
16
|
-
* -------------------------------------------------------------------------- */
|
|
17
|
-
export { toast, useSonner } from "sonner";
|
|
18
|
-
export { Toaster };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
-
interface SpinnerProps extends ComponentProps<"span"> {
|
|
3
|
-
loading?: boolean;
|
|
4
|
-
}
|
|
5
|
-
declare function Spinner({ children, className, loading, ...props }: SpinnerProps): ReactNode;
|
|
6
|
-
export { Spinner };
|
|
7
|
-
export type { SpinnerProps };
|
|
8
|
-
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,CA4C3F;AAMD,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "#lib/utils";
|
|
4
|
-
import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
|
5
|
-
/* -----------------------------------------------------------------------------
|
|
6
|
-
* Component: Spinner
|
|
7
|
-
* -------------------------------------------------------------------------- */
|
|
8
|
-
const SPINNER_COUNT = 8;
|
|
9
|
-
function Spinner({ children, className, loading = true, ...props }) {
|
|
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: cn("contents", "invisible"), children: children }), _jsx(VisuallyHidden, { children: children }), _jsx("span", { className: cn("absolute flex items-center justify-center", "inset-0"), children: spinner })] }));
|
|
23
|
-
}
|
|
24
|
-
/* -----------------------------------------------------------------------------
|
|
25
|
-
* Exports
|
|
26
|
-
* -------------------------------------------------------------------------- */
|
|
27
|
-
export { Spinner };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from "react";
|
|
2
|
-
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
3
|
-
type SwitchProps = ComponentProps<typeof SwitchPrimitives.Root>;
|
|
4
|
-
declare function Switch({ className, ...props }: SwitchProps): JSX.Element;
|
|
5
|
-
export { Switch };
|
|
6
|
-
export type { SwitchProps };
|
|
7
|
-
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,CAmCjE;AAMD,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "#lib/utils";
|
|
4
|
-
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
5
|
-
function Switch({ className, ...props }) {
|
|
6
|
-
return (_jsx(SwitchPrimitives.Root, { className: cn("peer inline-flex h-5 w-9 shrink-0 items-center p-0.75", "rounded-full border border-transparent shadow-xs outline-hidden", "transition-all", "focus-visible:ring-3 focus-visible:ring-ring/50", "focus-visible:not-data-checked:border-ring/60", "disabled:opacity-50", "data-checked:bg-primary", "data-checked:focus-visible:ring-primary/20", "dark:data-checked:focus-visible:ring-primary/40", "data-unchecked:bg-input", "dark:data-unchecked:bg-input/80", className), "data-slot": "switch", ...props, children: _jsx(SwitchPrimitives.Thumb, { className: cn("block", "size-3.5", "rounded-full", "bg-background shadow-sm", "pointer-events-none transition-transform", "dark:not-data-checked:bg-foreground", "data-checked:translate-x-3.5", "data-unchecked:translate-x-0"), "data-slot": "switch-thumb" }) }));
|
|
7
|
-
}
|
|
8
|
-
/* -----------------------------------------------------------------------------
|
|
9
|
-
* Exports
|
|
10
|
-
* -------------------------------------------------------------------------- */
|
|
11
|
-
export { Switch };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from "react";
|
|
2
|
-
type TableProps = ComponentProps<"table">;
|
|
3
|
-
declare function Table({ className, ...props }: TableProps): JSX.Element;
|
|
4
|
-
type TableHeaderProps = ComponentProps<"thead">;
|
|
5
|
-
declare function TableHeader({ className, ...props }: TableHeaderProps): JSX.Element;
|
|
6
|
-
type TableBodyProps = ComponentProps<"tbody">;
|
|
7
|
-
declare function TableBody({ className, ...props }: TableBodyProps): JSX.Element;
|
|
8
|
-
type TableFooterProps = ComponentProps<"tfoot">;
|
|
9
|
-
declare function TableFooter({ className, ...props }: TableFooterProps): JSX.Element;
|
|
10
|
-
type TableRowProps = ComponentProps<"tr">;
|
|
11
|
-
declare function TableRow({ className, ...props }: TableRowProps): JSX.Element;
|
|
12
|
-
type TableHeadProps = ComponentProps<"th">;
|
|
13
|
-
declare function TableHead({ className, ...props }: TableHeadProps): JSX.Element;
|
|
14
|
-
type TableCellProps = ComponentProps<"td">;
|
|
15
|
-
declare function TableCell({ className, ...props }: TableCellProps): JSX.Element;
|
|
16
|
-
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, };
|
|
20
|
-
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,CAa3E;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,CAerE;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
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "#lib/utils";
|
|
3
|
-
function Table({ className, ...props }) {
|
|
4
|
-
return (_jsx("div", { className: cn("relative", "w-full overflow-auto"), "data-slot": "table-cotainer", children: _jsx("table", { className: cn("w-full text-sm", "caption-bottom", className), "data-slot": "table", ...props }) }));
|
|
5
|
-
}
|
|
6
|
-
function TableHeader({ className, ...props }) {
|
|
7
|
-
return (_jsx("thead", { className: cn("*:border-b", "*:has-aria-expanded:bg-transparent", className), "data-slot": "table-header", ...props }));
|
|
8
|
-
}
|
|
9
|
-
function TableBody({ className, ...props }) {
|
|
10
|
-
return (_jsx("tbody", { className: cn("*:last-child:border-0", className), "data-slot": "table-body", ...props }));
|
|
11
|
-
}
|
|
12
|
-
function TableFooter({ className, ...props }) {
|
|
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 }));
|
|
14
|
-
}
|
|
15
|
-
function TableRow({ className, ...props }) {
|
|
16
|
-
return (_jsx("tr", { className: cn("border-b", "transition-colors", "hover:bg-muted/50", "has-aria-expanded:bg-muted/50", "data-selected:bg-muted", className), "data-slot": "table-row", ...props }));
|
|
17
|
-
}
|
|
18
|
-
function TableHead({ className, ...props }) {
|
|
19
|
-
return (_jsx("th", { className: cn("p-2", "text-left align-middle font-medium", className), "data-slot": "table-head", ...props }));
|
|
20
|
-
}
|
|
21
|
-
function TableCell({ className, ...props }) {
|
|
22
|
-
return _jsx("td", { className: cn("p-2", "align-middle", className), "data-slot": "table-cell", ...props });
|
|
23
|
-
}
|
|
24
|
-
function TableCaption({ className, ...props }) {
|
|
25
|
-
return (_jsx("caption", { className: cn("mt-4", "text-sm text-muted-foreground", className), "data-slot": "table-caption", ...props }));
|
|
26
|
-
}
|
|
27
|
-
/* -----------------------------------------------------------------------------
|
|
28
|
-
* Exports
|
|
29
|
-
* -------------------------------------------------------------------------- */
|
|
30
|
-
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from "react";
|
|
2
|
-
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
3
|
-
type TabsProps = ComponentProps<typeof TabsPrimitive.Root>;
|
|
4
|
-
declare function Tabs({ className, ...props }: TabsProps): JSX.Element;
|
|
5
|
-
type TabsListProps = ComponentProps<typeof TabsPrimitive.List>;
|
|
6
|
-
declare function TabsList({ className, ...props }: TabsListProps): JSX.Element;
|
|
7
|
-
type TabsTriggerProps = ComponentProps<typeof TabsPrimitive.Trigger>;
|
|
8
|
-
declare function TabsTrigger({ className, ...props }: TabsTriggerProps): JSX.Element;
|
|
9
|
-
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 };
|
|
13
|
-
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,CAarE;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,CAyB3E;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,CAa3E;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
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "#lib/utils";
|
|
4
|
-
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
5
|
-
function Tabs({ className, ...props }) {
|
|
6
|
-
return (_jsx(TabsPrimitive.Root, { className: cn("flex flex-col gap-2", className), "data-slot": "tabs", ...props }));
|
|
7
|
-
}
|
|
8
|
-
function TabsList({ className, ...props }) {
|
|
9
|
-
return (_jsx(TabsPrimitive.List, { className: cn("inline-flex w-fit items-center justify-center gap-1 px-1 py-1", "rounded-xl", "bg-muted text-muted-foreground", className), "data-slot": "tabs-list", ...props }));
|
|
10
|
-
}
|
|
11
|
-
function TabsTrigger({ className, ...props }) {
|
|
12
|
-
return (_jsx(TabsPrimitive.Trigger, { className: cn("inline-flex items-center justify-center gap-1.5", "px-2 py-1.5", "rounded-lg", "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", "dark:focus-visible:-outline-offset-1 dark:focus-visible:outline-ring", "data-active:bg-background data-active:text-foreground data-active:shadow-sm", "dark:data-active:bg-input/50", "dark:focus-visible:data-active:outline-1", "[&_svg]:shrink-0", "[&_svg:not([class*='size-'])]:size-4", className), "data-slot": "tabs-trigger", ...props }));
|
|
13
|
-
}
|
|
14
|
-
function TabsContent({ className, ...props }) {
|
|
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 }));
|
|
16
|
-
}
|
|
17
|
-
/* -----------------------------------------------------------------------------
|
|
18
|
-
* Exports
|
|
19
|
-
* -------------------------------------------------------------------------- */
|
|
20
|
-
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from "react";
|
|
2
|
-
type TextareaProps = ComponentProps<"textarea">;
|
|
3
|
-
declare function Textarea({ className, ...props }: TextareaProps): JSX.Element;
|
|
4
|
-
export { Textarea };
|
|
5
|
-
export type { TextareaProps };
|
|
6
|
-
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,CAwBrE;AAMD,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "#lib/utils";
|
|
3
|
-
function Textarea({ className, ...props }) {
|
|
4
|
-
return (_jsx("textarea", { className: cn("flex min-h-16 w-full grow px-3 py-2", "rounded-lg border border-input shadow-xs outline-hidden", "text-base", "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 }));
|
|
5
|
-
}
|
|
6
|
-
/* -----------------------------------------------------------------------------
|
|
7
|
-
* Exports
|
|
8
|
-
* -------------------------------------------------------------------------- */
|
|
9
|
-
export { Textarea };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Scope } from "@radix-ui/react-context";
|
|
2
|
-
import type { ComponentProps, JSX } from "react";
|
|
3
|
-
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
4
|
-
import type { ToggleVariants } from "#components/toggle";
|
|
5
|
-
type ScopedProps<P> = P & {
|
|
6
|
-
__scopeToggleGroup?: Scope;
|
|
7
|
-
};
|
|
8
|
-
type ToggleGroupProps = ComponentProps<typeof ToggleGroupPrimitive.Root> & ToggleVariants & {
|
|
9
|
-
spacing?: number;
|
|
10
|
-
};
|
|
11
|
-
declare function ToggleGroup({ __scopeToggleGroup, children, className, size, spacing, variant, ...props }: ScopedProps<ToggleGroupProps>): JSX.Element;
|
|
12
|
-
type ToggleGroupItemProps = ScopedProps<ComponentProps<typeof ToggleGroupPrimitive.Item>>;
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,CAwB7C;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,CAkCpC;AAMD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;AACxC,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "#lib/utils";
|
|
4
|
-
import { createContextScope } from "@radix-ui/react-context";
|
|
5
|
-
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
6
|
-
import { createToggleGroupScope } from "@radix-ui/react-toggle-group";
|
|
7
|
-
import { toggleVariants } from "#components/toggle";
|
|
8
|
-
/* -----------------------------------------------------------------------------
|
|
9
|
-
* Context: ToggleGroup
|
|
10
|
-
* -------------------------------------------------------------------------- */
|
|
11
|
-
const TOGGLE_GROUP_NAME = "ToggleGroup";
|
|
12
|
-
const [createToggleGroupContext] = createContextScope(TOGGLE_GROUP_NAME, [createToggleGroupScope]);
|
|
13
|
-
const useToggleGroupScope = createToggleGroupScope();
|
|
14
|
-
const [ToggleGroupProvider, useToggleGroupContext] = createToggleGroupContext(TOGGLE_GROUP_NAME);
|
|
15
|
-
function ToggleGroup({ __scopeToggleGroup, children, className, size, spacing = 0, variant, ...props }) {
|
|
16
|
-
const toggleGroupScope = useToggleGroupScope(__scopeToggleGroup);
|
|
17
|
-
return (_jsx(ToggleGroupProvider, { scope: __scopeToggleGroup, size: size, spacing: spacing, variant: variant, children: _jsx(ToggleGroupPrimitive.Root, { className: cn("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))]", "rounded-lg", "data-[spacing=default]:data-[variant=outline]:shadow-xs", className), "data-size": size, "data-slot": "toggle-group", "data-spacing": spacing, "data-variant": variant, style: { "--gap": spacing }, ...toggleGroupScope, ...props, children: children }) }));
|
|
18
|
-
}
|
|
19
|
-
/* -----------------------------------------------------------------------------
|
|
20
|
-
* Component: ToggleGroupItem
|
|
21
|
-
* -------------------------------------------------------------------------- */
|
|
22
|
-
const TOGGLE_GROUP_ITEM_NAME = "ToggleGroupItem";
|
|
23
|
-
function ToggleGroupItem({ __scopeToggleGroup, children, className, ...props }) {
|
|
24
|
-
const { size, spacing, variant } = useToggleGroupContext(TOGGLE_GROUP_ITEM_NAME, __scopeToggleGroup);
|
|
25
|
-
const toggleGroupScope = useToggleGroupScope(__scopeToggleGroup);
|
|
26
|
-
return (_jsx(ToggleGroupPrimitive.Item, { className: cn("w-auto min-w-0 shrink-0 px-3", "focus:z-10", "focus-visible:z-10", "data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none", "data-[spacing=0]:first:rounded-l-lg", "data-[spacing=0]:last:rounded-r-lg", "data-[spacing=0]:data-[variant=outline]:border-l-0", "data-[spacing=0]:data-[variant=outline]:first:border-l", toggleVariants({
|
|
27
|
-
className,
|
|
28
|
-
size,
|
|
29
|
-
variant,
|
|
30
|
-
})), "data-size": size, "data-slot": "toggle-group-item", "data-spacing": spacing, "data-variant": variant, ...toggleGroupScope, ...props, children: children }));
|
|
31
|
-
}
|
|
32
|
-
/* -----------------------------------------------------------------------------
|
|
33
|
-
* Exports
|
|
34
|
-
* -------------------------------------------------------------------------- */
|
|
35
|
-
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { VariantProps } from "#lib/utils";
|
|
2
|
-
import type { ComponentProps, JSX } from "react";
|
|
3
|
-
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
4
|
-
declare const toggleVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
5
|
-
size: {
|
|
6
|
-
default: string[];
|
|
7
|
-
lg: string[];
|
|
8
|
-
sm: string[];
|
|
9
|
-
};
|
|
10
|
-
variant: {
|
|
11
|
-
default: string;
|
|
12
|
-
outline: string[];
|
|
13
|
-
};
|
|
14
|
-
}, Record<string, never>>;
|
|
15
|
-
type ToggleVariants = VariantProps<typeof toggleVariants>;
|
|
16
|
-
interface ToggleProps extends ComponentProps<typeof TogglePrimitive.Root>, ToggleVariants {
|
|
17
|
-
}
|
|
18
|
-
declare function Toggle({ children, className, size, variant, ...props }: ToggleProps): JSX.Element;
|
|
19
|
-
export { Toggle, toggleVariants };
|
|
20
|
-
export type { ToggleProps, ToggleVariants };
|
|
21
|
-
//# sourceMappingURL=toggle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../src/components/toggle.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAM1D,QAAA,MAAM,cAAc;;QAiBd,OAAO;QACP,EAAE;QACF,EAAE;;;QAGF,OAAO;QACP,OAAO;;yBAWX,CAAC;AAEH,KAAK,cAAc,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;AAM1D,UAAU,WAAY,SAAQ,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,EAAE,cAAc;CAAG;AAE5F,iBAAS,MAAM,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAU1F;AAMD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { tv } from "#lib/utils";
|
|
4
|
-
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
5
|
-
/* -----------------------------------------------------------------------------
|
|
6
|
-
* Variant: Toggle
|
|
7
|
-
* -------------------------------------------------------------------------- */
|
|
8
|
-
const toggleVariants = tv({
|
|
9
|
-
base: [
|
|
10
|
-
"inline-flex items-center justify-center gap-2",
|
|
11
|
-
"rounded-lg outline-none",
|
|
12
|
-
"text-sm font-medium whitespace-nowrap",
|
|
13
|
-
"transition-[color,box-shadow]",
|
|
14
|
-
"hover:bg-muted hover:text-muted-foreground",
|
|
15
|
-
"focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
16
|
-
"disabled:pointer-events-none disabled:opacity-50",
|
|
17
|
-
"aria-invalid:border-destructive aria-invalid:ring-destructive/20",
|
|
18
|
-
"data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
|
|
19
|
-
"dark:aria-invalid:ring-destructive/40",
|
|
20
|
-
"[&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
21
|
-
"[&_svg:not([class*='size-'])]:size-4",
|
|
22
|
-
],
|
|
23
|
-
variants: {
|
|
24
|
-
size: {
|
|
25
|
-
default: ["h-9 min-w-9", "px-2"],
|
|
26
|
-
lg: ["h-10 min-w-10", "px-2.5"],
|
|
27
|
-
sm: ["h-8 min-w-8", "px-1.5"],
|
|
28
|
-
},
|
|
29
|
-
variant: {
|
|
30
|
-
default: "bg-transparent",
|
|
31
|
-
outline: [
|
|
32
|
-
"border border-input",
|
|
33
|
-
"bg-transparent shadow-xs",
|
|
34
|
-
"hover:bg-accent hover:text-accent-foreground",
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
defaultVariants: {
|
|
39
|
-
size: "default",
|
|
40
|
-
variant: "default",
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
function Toggle({ children, className, size, variant, ...props }) {
|
|
44
|
-
return (_jsx(TogglePrimitive.Root, { className: toggleVariants({ className, size, variant }), "data-slot": "toggle", ...props, children: children }));
|
|
45
|
-
}
|
|
46
|
-
/* -----------------------------------------------------------------------------
|
|
47
|
-
* Exports
|
|
48
|
-
* -------------------------------------------------------------------------- */
|
|
49
|
-
export { Toggle, toggleVariants };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from "react";
|
|
2
|
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
|
-
type TooltipProviderProps = ComponentProps<typeof TooltipPrimitive.Provider>;
|
|
4
|
-
declare function TooltipProvider({ ...props }: TooltipProviderProps): JSX.Element;
|
|
5
|
-
type TooltipProps = ComponentProps<typeof TooltipPrimitive.Root>;
|
|
6
|
-
declare function Tooltip({ ...props }: TooltipProps): JSX.Element;
|
|
7
|
-
type TooltipTriggerProps = ComponentProps<typeof TooltipPrimitive.Trigger>;
|
|
8
|
-
declare function TooltipTrigger({ ...props }: TooltipTriggerProps): JSX.Element;
|
|
9
|
-
type TooltipContentProps = ComponentProps<typeof TooltipPrimitive.Content>;
|
|
10
|
-
declare function TooltipContent({ children, className, sideOffset, ...props }: TooltipContentProps): JSX.Element;
|
|
11
|
-
type TooltipArrowProps = ComponentProps<typeof TooltipPrimitive.Arrow>;
|
|
12
|
-
declare function TooltipArrow({ className, ...props }: TooltipArrowProps): JSX.Element;
|
|
13
|
-
export { Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
14
|
-
export type { TooltipArrowProps, TooltipContentProps, TooltipProps, TooltipProviderProps, TooltipTriggerProps, };
|
|
15
|
-
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/components/tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAM5D,KAAK,oBAAoB,GAAG,cAAc,CAAC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AAE7E,iBAAS,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,GAAG,GAAG,CAAC,OAAO,CAExE;AAMD,KAAK,YAAY,GAAG,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;AAEjE,iBAAS,OAAO,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,GAAG,GAAG,CAAC,OAAO,CAExD;AAMD,KAAK,mBAAmB,GAAG,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAE3E,iBAAS,cAAc,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAEtE;AAMD,KAAK,mBAAmB,GAAG,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAE3E,iBAAS,cAAc,CAAC,EACtB,QAAQ,EACR,SAAS,EACT,UAAc,EACd,GAAG,KAAK,EACT,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAgCnC;AAMD,KAAK,iBAAiB,GAAG,cAAc,CAAC,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;AAEvE,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CAQ7E;AAMD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC;AAClF,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,GACpB,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "#lib/utils";
|
|
4
|
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
5
|
-
function TooltipProvider({ ...props }) {
|
|
6
|
-
return _jsx(TooltipPrimitive.Provider, { "data-slot": "tooltip-provider", ...props });
|
|
7
|
-
}
|
|
8
|
-
function Tooltip({ ...props }) {
|
|
9
|
-
return _jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props });
|
|
10
|
-
}
|
|
11
|
-
function TooltipTrigger({ ...props }) {
|
|
12
|
-
return _jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
13
|
-
}
|
|
14
|
-
function TooltipContent({ children, className, sideOffset = 4, ...props }) {
|
|
15
|
-
return (_jsx(TooltipPrimitive.Portal, { children: _jsxs(TooltipPrimitive.Content, { className: cn("z-50", "w-fit max-w-(--radix-tooltip-content-available-width) px-3 py-1.5", "rounded-md", "bg-primary text-xs text-balance text-primary-foreground", "ease-ui data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95", "data-[state=delayed-open]:data-side-top:slide-in-from-bottom-2", "data-[state=delayed-open]:data-side-right:slide-in-from-left-2", "data-[state=delayed-open]:data-side-bottom:slide-in-from-top-2", "data-[state=delayed-open]:data-side-left:slide-in-from-right-2", "data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", "data-closed:data-side-top:slide-out-to-bottom-2", "data-closed:data-side-right:slide-out-to-left-2", "data-closed:data-side-bottom:slide-out-to-top-2", "data-closed:data-side-left:slide-out-to-right-2", "origin-(--radix-tooltip-content-transform-origin)", className), collisionPadding: 8, "data-slot": "tooltip-content", sideOffset: sideOffset, ...props, children: [children, _jsx(TooltipArrow, {})] }) }));
|
|
16
|
-
}
|
|
17
|
-
function TooltipArrow({ className, ...props }) {
|
|
18
|
-
return (_jsx(TooltipPrimitive.Arrow, { className: cn("fill-primary", className), "data-slot": "tooltip-arrow", ...props }));
|
|
19
|
-
}
|
|
20
|
-
/* -----------------------------------------------------------------------------
|
|
21
|
-
* Exports
|
|
22
|
-
* -------------------------------------------------------------------------- */
|
|
23
|
-
export { Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-animated-value.d.ts","sourceRoot":"","sources":["../../src/hooks/use-animated-value.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,IAAI,GAAG,MAAM,EAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,OAAO,GAChB,MAAM,CAqER"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect, useRef, useState } from "react";
|
|
3
|
-
/**
|
|
4
|
-
* Produce a smoothly animated numeric value in response to changes.
|
|
5
|
-
*
|
|
6
|
-
* Applies a time-based easing (easeOutQuad) between the current and target values
|
|
7
|
-
* over the specified duration. When disabled, the value updates immediately.
|
|
8
|
-
*
|
|
9
|
-
* @param targetValue - Target number to animate toward; null resolves to 0.
|
|
10
|
-
* @param duration - Animation duration in milliseconds.
|
|
11
|
-
* @param animate - When false, bypasses animation and sets the value directly.
|
|
12
|
-
* @returns The current (rounded) animated value.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```tsx
|
|
16
|
-
* const value = useAnimatedValue(75, 1000, true);
|
|
17
|
-
* return <div>{value}%</div>;
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export function useAnimatedValue(targetValue, duration, animate) {
|
|
21
|
-
// Default to 0 when targetValue is null
|
|
22
|
-
const actualTargetValue = targetValue ?? 0;
|
|
23
|
-
// Current animated output
|
|
24
|
-
const [animatedValue, setAnimatedValue] = useState(actualTargetValue);
|
|
25
|
-
// Prevent stale closures inside RAF loop
|
|
26
|
-
const animatedValueRef = useRef(actualTargetValue);
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
animatedValueRef.current = animatedValue;
|
|
29
|
-
}, [animatedValue]);
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (!animate) {
|
|
32
|
-
setAnimatedValue(actualTargetValue);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
// Starting value
|
|
36
|
-
const currentValue = animatedValueRef.current;
|
|
37
|
-
// Total delta across the animation
|
|
38
|
-
const valueRange = actualTargetValue - currentValue;
|
|
39
|
-
// Start timestamp
|
|
40
|
-
const startTime = performance.now();
|
|
41
|
-
if (duration <= 0 || valueRange === 0) {
|
|
42
|
-
setAnimatedValue(actualTargetValue);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
// requestAnimationFrame id for cleanup
|
|
46
|
-
let animationFrame;
|
|
47
|
-
// RAF step
|
|
48
|
-
const animateValue = (currentTime) => {
|
|
49
|
-
// Elapsed milliseconds
|
|
50
|
-
const elapsedTime = currentTime - startTime;
|
|
51
|
-
if (elapsedTime >= duration) {
|
|
52
|
-
setAnimatedValue(actualTargetValue);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
// Linear progress (0..1)
|
|
56
|
-
const progress = elapsedTime / duration;
|
|
57
|
-
// easeOutQuad easing
|
|
58
|
-
const easeProgress = 1 - (1 - progress) * (1 - progress);
|
|
59
|
-
// Interpolated value
|
|
60
|
-
const nextValue = currentValue + valueRange * easeProgress;
|
|
61
|
-
setAnimatedValue(nextValue);
|
|
62
|
-
animationFrame = requestAnimationFrame(animateValue);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
animationFrame = requestAnimationFrame(animateValue);
|
|
66
|
-
return () => {
|
|
67
|
-
cancelAnimationFrame(animationFrame);
|
|
68
|
-
};
|
|
69
|
-
}, [actualTargetValue, duration, animate]);
|
|
70
|
-
return Math.round(animatedValue);
|
|
71
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-copy-to-clipboard.d.ts","sourceRoot":"","sources":["../../src/hooks/use-copy-to-clipboard.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,OAAc,EACf,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG;IAClD,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,QAAQ,EAAE,OAAO,CAAC;CACnB,CAiCA"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
/**
|
|
4
|
-
* Provide clipboard copy capability with a transient copied state.
|
|
5
|
-
*
|
|
6
|
-
* Internally uses the Clipboard API when available and sets a temporary
|
|
7
|
-
* `isCopied` flag for UI feedback. A custom callback may be invoked upon copy.
|
|
8
|
-
*
|
|
9
|
-
* @param options - Configuration options.
|
|
10
|
-
* - onCopy: Callback invoked after a successful copy.
|
|
11
|
-
* - timeout: Duration in milliseconds to keep `isCopied` true. Defaults to 2000.
|
|
12
|
-
* @returns An object with a `copyToClipboard` function and an `isCopied` flag.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```tsx
|
|
16
|
-
* const { copyToClipboard, isCopied } = useCopyToClipboard({ timeout: 1500 });
|
|
17
|
-
* <button onClick={() => copyToClipboard("Hello")}>{isCopied ? "Copied" : "Copy"}</button>
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export function useCopyToClipboard({ onCopy, timeout = 2000, } = {}) {
|
|
21
|
-
const [isCopied, setIsCopied] = useState(false);
|
|
22
|
-
const copyToClipboard = async (value) => {
|
|
23
|
-
if (typeof window === "undefined" ||
|
|
24
|
-
!("clipboard" in navigator) ||
|
|
25
|
-
typeof navigator.clipboard.writeText !== "function") {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (!value) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
try {
|
|
32
|
-
await navigator.clipboard.writeText(value);
|
|
33
|
-
setIsCopied(true);
|
|
34
|
-
if (onCopy) {
|
|
35
|
-
onCopy();
|
|
36
|
-
}
|
|
37
|
-
setTimeout(() => {
|
|
38
|
-
setIsCopied(false);
|
|
39
|
-
}, timeout);
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
console.error(error);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
return { copyToClipboard, isCopied };
|
|
46
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-is-mobile.d.ts","sourceRoot":"","sources":["../../src/hooks/use-is-mobile.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,gBAAgB,SAAM,GAAG,OAAO,CAE3D"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useMediaQuery } from "#hooks/use-media-query";
|
|
3
|
-
/**
|
|
4
|
-
* Determine whether the current viewport should be treated as mobile.
|
|
5
|
-
*
|
|
6
|
-
* Uses {@link useMediaQuery} to evaluate a max-width media query derived from the
|
|
7
|
-
* provided breakpoint. By default, widths below 768px are considered mobile.
|
|
8
|
-
*
|
|
9
|
-
* @param mobileBreakpoint - Pixel width used as the mobile breakpoint. Values strictly
|
|
10
|
-
* less than this breakpoint are treated as mobile. Defaults to 768.
|
|
11
|
-
* @returns true when the viewport width is less than the given breakpoint; otherwise false.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```tsx
|
|
15
|
-
* const isMobile = useIsMobile();
|
|
16
|
-
* if (isMobile) {
|
|
17
|
-
* // Render compact layout
|
|
18
|
-
* }
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export function useIsMobile(mobileBreakpoint = 768) {
|
|
22
|
-
return useMediaQuery(`(max-width: ${(mobileBreakpoint - 1).toString()}px)`);
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-media-query.d.ts","sourceRoot":"","sources":["../../src/hooks/use-media-query.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CA2CpD"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
/**
|
|
4
|
-
* Subscribe to a CSS media query and receive its match state.
|
|
5
|
-
*
|
|
6
|
-
* Evaluates the query immediately (when supported) and updates on changes
|
|
7
|
-
* via an event listener.
|
|
8
|
-
*
|
|
9
|
-
* @param query - A valid media query string (e.g., "(max-width: 768px)").
|
|
10
|
-
* @returns true when the media query currently matches; otherwise false.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```tsx
|
|
14
|
-
* const isNarrow = useMediaQuery("(max-width: 768px)");
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export function useMediaQuery(query) {
|
|
18
|
-
/**
|
|
19
|
-
* State to store whether the query matches.
|
|
20
|
-
* The initial value is calculated based on the current window state.
|
|
21
|
-
*/
|
|
22
|
-
const [matches, setMatches] = useState(() => {
|
|
23
|
-
// Ensure initial state matches current media query status
|
|
24
|
-
if (typeof window !== "undefined" && typeof window.matchMedia === "function") {
|
|
25
|
-
return window.matchMedia(query).matches;
|
|
26
|
-
}
|
|
27
|
-
return false;
|
|
28
|
-
});
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
// Only run in a browser environment where matchMedia is available
|
|
31
|
-
if (typeof window === "undefined") {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* MediaQueryList to evaluate and observe the provided query.
|
|
36
|
-
*/
|
|
37
|
-
const mediaQueryList = window.matchMedia(query);
|
|
38
|
-
/**
|
|
39
|
-
* Update state when the media query status changes.
|
|
40
|
-
*/
|
|
41
|
-
const onChange = (event) => {
|
|
42
|
-
setMatches(event.matches);
|
|
43
|
-
};
|
|
44
|
-
mediaQueryList.addEventListener("change", onChange);
|
|
45
|
-
/**
|
|
46
|
-
* Remove the event listener on unmount or when the query changes.
|
|
47
|
-
*/
|
|
48
|
-
return () => {
|
|
49
|
-
mediaQueryList.removeEventListener("change", onChange);
|
|
50
|
-
};
|
|
51
|
-
}, [query]);
|
|
52
|
-
return matches;
|
|
53
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-mutation-observer.d.ts","sourceRoot":"","sources":["../../src/hooks/use-mutation-observer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAcvC;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAClC,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,GAAE,oBAAqC,GAC7C,IAAI,CAkBN"}
|