@docyrus/shadcn 0.1.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/README.md +158 -0
- package/dist/default/accordion.d.ts +9 -0
- package/dist/default/accordion.js +51 -0
- package/dist/default/accordion.js.map +1 -0
- package/dist/default/alert-dialog.d.ts +23 -0
- package/dist/default/alert-dialog.js +153 -0
- package/dist/default/alert-dialog.js.map +1 -0
- package/dist/default/alert.d.ts +11 -0
- package/dist/default/alert.js +56 -0
- package/dist/default/alert.js.map +1 -0
- package/dist/default/aspect-ratio.d.ts +6 -0
- package/dist/default/aspect-ratio.js +8 -0
- package/dist/default/aspect-ratio.js.map +1 -0
- package/dist/default/avatar.d.ts +8 -0
- package/dist/default/avatar.js +46 -0
- package/dist/default/avatar.js.map +1 -0
- package/dist/default/badge.d.ts +13 -0
- package/dist/default/badge.js +32 -0
- package/dist/default/badge.js.map +1 -0
- package/dist/default/breadcrumb.d.ts +22 -0
- package/dist/default/breadcrumb.js +94 -0
- package/dist/default/breadcrumb.js.map +1 -0
- package/dist/default/button-group.d.ts +17 -0
- package/dist/default/button-group.js +98 -0
- package/dist/default/button-group.js.map +1 -0
- package/dist/default/button.d.ts +14 -0
- package/dist/default/button.js +54 -0
- package/dist/default/button.js.map +1 -0
- package/dist/default/calendar.d.ts +13 -0
- package/dist/default/calendar.js +231 -0
- package/dist/default/calendar.js.map +1 -0
- package/dist/default/card.d.ts +10 -0
- package/dist/default/card.js +66 -0
- package/dist/default/card.js.map +1 -0
- package/dist/default/carousel.d.ts +23 -0
- package/dist/default/carousel.js +237 -0
- package/dist/default/carousel.js.map +1 -0
- package/dist/default/chart.d.ts +69 -0
- package/dist/default/chart.js +241 -0
- package/dist/default/chart.js.map +1 -0
- package/dist/default/checkbox.d.ts +6 -0
- package/dist/default/checkbox.js +34 -0
- package/dist/default/checkbox.js.map +1 -0
- package/dist/default/collapsible.d.ts +8 -0
- package/dist/default/collapsible.js +9 -0
- package/dist/default/collapsible.js.map +1 -0
- package/dist/default/command.d.ts +83 -0
- package/dist/default/command.js +169 -0
- package/dist/default/command.js.map +1 -0
- package/dist/default/context-menu.d.ts +30 -0
- package/dist/default/context-menu.js +146 -0
- package/dist/default/context-menu.js.map +1 -0
- package/dist/default/dialog.d.ts +22 -0
- package/dist/default/dialog.js +101 -0
- package/dist/default/dialog.js.map +1 -0
- package/dist/default/drawer.d.ts +27 -0
- package/dist/default/drawer.js +99 -0
- package/dist/default/drawer.js.map +1 -0
- package/dist/default/dropdown-menu.d.ts +30 -0
- package/dist/default/dropdown-menu.js +143 -0
- package/dist/default/dropdown-menu.js.map +1 -0
- package/dist/default/empty.d.ts +15 -0
- package/dist/default/empty.js +104 -0
- package/dist/default/empty.js.map +1 -0
- package/dist/default/field.d.ts +30 -0
- package/dist/default/field.js +253 -0
- package/dist/default/field.js.map +1 -0
- package/dist/default/form.d.ts +28 -0
- package/dist/default/form.js +121 -0
- package/dist/default/form.js.map +1 -0
- package/dist/default/hover-card.d.ts +8 -0
- package/dist/default/hover-card.js +30 -0
- package/dist/default/hover-card.js.map +1 -0
- package/dist/default/index.d.ts +95 -0
- package/dist/default/index.js +4029 -0
- package/dist/default/index.js.map +1 -0
- package/dist/default/input-group.d.ts +20 -0
- package/dist/default/input-group.js +225 -0
- package/dist/default/input-group.js.map +1 -0
- package/dist/default/input-otp.d.ts +37 -0
- package/dist/default/input-otp.js +53 -0
- package/dist/default/input-otp.js.map +1 -0
- package/dist/default/input.d.ts +5 -0
- package/dist/default/input.js +30 -0
- package/dist/default/input.js.map +1 -0
- package/dist/default/item.d.ts +28 -0
- package/dist/default/item.js +203 -0
- package/dist/default/item.js.map +1 -0
- package/dist/default/kbd.d.ts +6 -0
- package/dist/default/kbd.js +37 -0
- package/dist/default/kbd.js.map +1 -0
- package/dist/default/label.d.ts +8 -0
- package/dist/default/label.js +26 -0
- package/dist/default/label.js.map +1 -0
- package/dist/default/menubar.d.ts +31 -0
- package/dist/default/menubar.js +194 -0
- package/dist/default/menubar.js.map +1 -0
- package/dist/default/navigation-menu.d.ts +15 -0
- package/dist/default/navigation-menu.js +106 -0
- package/dist/default/navigation-menu.js.map +1 -0
- package/dist/default/pagination.d.ts +33 -0
- package/dist/default/pagination.js +146 -0
- package/dist/default/pagination.js.map +1 -0
- package/dist/default/popover.d.ts +8 -0
- package/dist/default/popover.js +30 -0
- package/dist/default/popover.js.map +1 -0
- package/dist/default/progress.d.ts +6 -0
- package/dist/default/progress.js +32 -0
- package/dist/default/progress.js.map +1 -0
- package/dist/default/radio-group.d.ts +7 -0
- package/dist/default/radio-group.js +41 -0
- package/dist/default/radio-group.js.map +1 -0
- package/dist/default/resizable.d.ts +27 -0
- package/dist/default/resizable.js +42 -0
- package/dist/default/resizable.js.map +1 -0
- package/dist/default/scroll-area.d.ts +7 -0
- package/dist/default/scroll-area.js +44 -0
- package/dist/default/scroll-area.js.map +1 -0
- package/dist/default/select.d.ts +15 -0
- package/dist/default/select.js +121 -0
- package/dist/default/select.js.map +1 -0
- package/dist/default/separator.d.ts +6 -0
- package/dist/default/separator.js +31 -0
- package/dist/default/separator.js.map +1 -0
- package/dist/default/sheet.d.ts +29 -0
- package/dist/default/sheet.js +112 -0
- package/dist/default/sheet.js.map +1 -0
- package/dist/default/sidebar.d.ts +71 -0
- package/dist/default/sidebar.js +780 -0
- package/dist/default/sidebar.js.map +1 -0
- package/dist/default/skeleton.d.ts +5 -0
- package/dist/default/skeleton.js +24 -0
- package/dist/default/skeleton.js.map +1 -0
- package/dist/default/slider.d.ts +6 -0
- package/dist/default/slider.js +30 -0
- package/dist/default/slider.js.map +1 -0
- package/dist/default/sonner.d.ts +7 -0
- package/dist/default/sonner.js +35 -0
- package/dist/default/sonner.js.map +1 -0
- package/dist/default/spinner.d.ts +5 -0
- package/dist/default/spinner.js +24 -0
- package/dist/default/spinner.js.map +1 -0
- package/dist/default/styles.css +149 -0
- package/dist/default/switch.d.ts +6 -0
- package/dist/default/switch.js +34 -0
- package/dist/default/switch.js.map +1 -0
- package/dist/default/table.d.ts +12 -0
- package/dist/default/table.js +87 -0
- package/dist/default/table.js.map +1 -0
- package/dist/default/tabs.d.ts +9 -0
- package/dist/default/tabs.js +51 -0
- package/dist/default/tabs.js.map +1 -0
- package/dist/default/textarea.d.ts +5 -0
- package/dist/default/textarea.js +27 -0
- package/dist/default/textarea.js.map +1 -0
- package/dist/default/toggle-group.d.ts +15 -0
- package/dist/default/toggle-group.js +77 -0
- package/dist/default/toggle-group.js.map +1 -0
- package/dist/default/toggle.d.ts +15 -0
- package/dist/default/toggle.js +44 -0
- package/dist/default/toggle.js.map +1 -0
- package/dist/default/tooltip.d.ts +9 -0
- package/dist/default/tooltip.js +29 -0
- package/dist/default/tooltip.js.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +21 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +21 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/index.d.ts +98 -0
- package/dist/index.js +4029 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.js +11 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +11 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/new-york/accordion.d.ts +10 -0
- package/dist/new-york/accordion.js +68 -0
- package/dist/new-york/accordion.js.map +1 -0
- package/dist/new-york/alert-dialog.d.ts +17 -0
- package/dist/new-york/alert-dialog.js +171 -0
- package/dist/new-york/alert-dialog.js.map +1 -0
- package/dist/new-york/alert.d.ts +13 -0
- package/dist/new-york/alert.js +71 -0
- package/dist/new-york/alert.js.map +1 -0
- package/dist/new-york/aspect-ratio.d.ts +6 -0
- package/dist/new-york/aspect-ratio.js +12 -0
- package/dist/new-york/aspect-ratio.js.map +1 -0
- package/dist/new-york/avatar.d.ts +9 -0
- package/dist/new-york/avatar.js +58 -0
- package/dist/new-york/avatar.js.map +1 -0
- package/dist/new-york/badge.d.ts +13 -0
- package/dist/new-york/badge.js +46 -0
- package/dist/new-york/badge.js.map +1 -0
- package/dist/new-york/breadcrumb.d.ts +14 -0
- package/dist/new-york/breadcrumb.js +104 -0
- package/dist/new-york/breadcrumb.js.map +1 -0
- package/dist/new-york/button-group.d.ts +17 -0
- package/dist/new-york/button-group.js +100 -0
- package/dist/new-york/button-group.js.map +1 -0
- package/dist/new-york/button.d.ts +14 -0
- package/dist/new-york/button.js +58 -0
- package/dist/new-york/button.js.map +1 -0
- package/dist/new-york/calendar.d.ts +13 -0
- package/dist/new-york/calendar.js +237 -0
- package/dist/new-york/calendar.js.map +1 -0
- package/dist/new-york/card.d.ts +12 -0
- package/dist/new-york/card.js +91 -0
- package/dist/new-york/card.js.map +1 -0
- package/dist/new-york/carousel.d.ts +24 -0
- package/dist/new-york/carousel.js +246 -0
- package/dist/new-york/carousel.js.map +1 -0
- package/dist/new-york/chart.d.ts +43 -0
- package/dist/new-york/chart.js +243 -0
- package/dist/new-york/chart.js.map +1 -0
- package/dist/new-york/checkbox.d.ts +7 -0
- package/dist/new-york/checkbox.js +37 -0
- package/dist/new-york/checkbox.js.map +1 -0
- package/dist/new-york/collapsible.d.ts +8 -0
- package/dist/new-york/collapsible.js +35 -0
- package/dist/new-york/collapsible.js.map +1 -0
- package/dist/new-york/command.d.ts +22 -0
- package/dist/new-york/command.js +266 -0
- package/dist/new-york/command.js.map +1 -0
- package/dist/new-york/context-menu.d.ts +28 -0
- package/dist/new-york/context-menu.js +215 -0
- package/dist/new-york/context-menu.js.map +1 -0
- package/dist/new-york/dialog.d.ts +18 -0
- package/dist/new-york/dialog.js +134 -0
- package/dist/new-york/dialog.js.map +1 -0
- package/dist/new-york/drawer.d.ts +16 -0
- package/dist/new-york/drawer.js +125 -0
- package/dist/new-york/drawer.js.map +1 -0
- package/dist/new-york/dropdown-menu.d.ts +28 -0
- package/dist/new-york/dropdown-menu.js +224 -0
- package/dist/new-york/dropdown-menu.js.map +1 -0
- package/dist/new-york/empty.d.ts +15 -0
- package/dist/new-york/empty.js +104 -0
- package/dist/new-york/empty.js.map +1 -0
- package/dist/new-york/field.d.ts +30 -0
- package/dist/new-york/field.js +263 -0
- package/dist/new-york/field.js.map +1 -0
- package/dist/new-york/form.d.ts +28 -0
- package/dist/new-york/form.js +131 -0
- package/dist/new-york/form.js.map +1 -0
- package/dist/new-york/hover-card.d.ts +9 -0
- package/dist/new-york/hover-card.js +42 -0
- package/dist/new-york/hover-card.js.map +1 -0
- package/dist/new-york/index.d.ts +92 -0
- package/dist/new-york/index.js +4965 -0
- package/dist/new-york/index.js.map +1 -0
- package/dist/new-york/input-group.d.ts +20 -0
- package/dist/new-york/input-group.js +226 -0
- package/dist/new-york/input-group.js.map +1 -0
- package/dist/new-york/input-otp.d.ts +14 -0
- package/dist/new-york/input-otp.js +70 -0
- package/dist/new-york/input-otp.js.map +1 -0
- package/dist/new-york/input.d.ts +6 -0
- package/dist/new-york/input.js +28 -0
- package/dist/new-york/input.js.map +1 -0
- package/dist/new-york/item.d.ts +28 -0
- package/dist/new-york/item.js +205 -0
- package/dist/new-york/item.js.map +1 -0
- package/dist/new-york/kbd.d.ts +6 -0
- package/dist/new-york/kbd.js +37 -0
- package/dist/new-york/kbd.js.map +1 -0
- package/dist/new-york/label.d.ts +7 -0
- package/dist/new-york/label.js +28 -0
- package/dist/new-york/label.js.map +1 -0
- package/dist/new-york/menubar.d.ts +29 -0
- package/dist/new-york/menubar.js +243 -0
- package/dist/new-york/menubar.js.map +1 -0
- package/dist/new-york/navigation-menu.d.ts +18 -0
- package/dist/new-york/navigation-menu.js +169 -0
- package/dist/new-york/navigation-menu.js.map +1 -0
- package/dist/new-york/pagination.d.ts +18 -0
- package/dist/new-york/pagination.js +147 -0
- package/dist/new-york/pagination.js.map +1 -0
- package/dist/new-york/popover.d.ts +10 -0
- package/dist/new-york/popover.js +47 -0
- package/dist/new-york/popover.js.map +1 -0
- package/dist/new-york/progress.d.ts +7 -0
- package/dist/new-york/progress.js +38 -0
- package/dist/new-york/progress.js.map +1 -0
- package/dist/new-york/radio-group.d.ts +8 -0
- package/dist/new-york/radio-group.js +50 -0
- package/dist/new-york/radio-group.js.map +1 -0
- package/dist/new-york/resizable.d.ts +11 -0
- package/dist/new-york/resizable.js +53 -0
- package/dist/new-york/resizable.js.map +1 -0
- package/dist/new-york/scroll-area.d.ts +8 -0
- package/dist/new-york/scroll-area.js +65 -0
- package/dist/new-york/scroll-area.js.map +1 -0
- package/dist/new-york/select.d.ts +18 -0
- package/dist/new-york/select.js +169 -0
- package/dist/new-york/select.js.map +1 -0
- package/dist/new-york/separator.d.ts +7 -0
- package/dist/new-york/separator.js +32 -0
- package/dist/new-york/separator.js.map +1 -0
- package/dist/new-york/sheet.d.ts +16 -0
- package/dist/new-york/sheet.js +126 -0
- package/dist/new-york/sheet.js.map +1 -0
- package/dist/new-york/sidebar.d.ts +75 -0
- package/dist/new-york/sidebar.js +859 -0
- package/dist/new-york/sidebar.js.map +1 -0
- package/dist/new-york/skeleton.d.ts +5 -0
- package/dist/new-york/skeleton.js +22 -0
- package/dist/new-york/skeleton.js.map +1 -0
- package/dist/new-york/slider.d.ts +7 -0
- package/dist/new-york/slider.js +69 -0
- package/dist/new-york/slider.js.map +1 -0
- package/dist/new-york/sonner.d.ts +6 -0
- package/dist/new-york/sonner.js +34 -0
- package/dist/new-york/sonner.js.map +1 -0
- package/dist/new-york/spinner.d.ts +5 -0
- package/dist/new-york/spinner.js +24 -0
- package/dist/new-york/spinner.js.map +1 -0
- package/dist/new-york/styles.css +129 -0
- package/dist/new-york/switch.d.ts +7 -0
- package/dist/new-york/switch.js +37 -0
- package/dist/new-york/switch.js.map +1 -0
- package/dist/new-york/table.d.ts +13 -0
- package/dist/new-york/table.js +114 -0
- package/dist/new-york/table.js.map +1 -0
- package/dist/new-york/tabs.d.ts +10 -0
- package/dist/new-york/tabs.js +70 -0
- package/dist/new-york/tabs.js.map +1 -0
- package/dist/new-york/textarea.d.ts +6 -0
- package/dist/new-york/textarea.js +25 -0
- package/dist/new-york/textarea.js.map +1 -0
- package/dist/new-york/toggle-group.d.ts +14 -0
- package/dist/new-york/toggle-group.js +95 -0
- package/dist/new-york/toggle-group.js.map +1 -0
- package/dist/new-york/toggle.d.ts +13 -0
- package/dist/new-york/toggle.js +49 -0
- package/dist/new-york/toggle.js.map +1 -0
- package/dist/new-york/tooltip.d.ts +10 -0
- package/dist/new-york/tooltip.js +58 -0
- package/dist/new-york/tooltip.js.map +1 -0
- package/package.json +133 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import { Button } from './button.js';
|
|
6
|
+
|
|
7
|
+
declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
8
|
+
declare const inputGroupAddonVariants: (props?: ({
|
|
9
|
+
align?: "inline-end" | "inline-start" | "block-end" | "block-start" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare const inputGroupButtonVariants: (props?: ({
|
|
13
|
+
size?: "sm" | "icon-sm" | "xs" | "icon-xs" | null | undefined;
|
|
14
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
|
+
declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): react_jsx_runtime.JSX.Element;
|
|
16
|
+
declare function InputGroupText({ className, ...props }: React.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare function InputGroupInput({ className, ...props }: React.ComponentProps<"input">): react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">): react_jsx_runtime.JSX.Element;
|
|
19
|
+
|
|
20
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
var buttonVariants = cva(
|
|
11
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
variant: {
|
|
15
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
16
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
17
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
18
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
19
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
20
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
24
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
25
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
26
|
+
icon: "size-9",
|
|
27
|
+
"icon-sm": "size-8",
|
|
28
|
+
"icon-lg": "size-10"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
variant: "default",
|
|
33
|
+
size: "default"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
function Button({
|
|
38
|
+
className,
|
|
39
|
+
variant,
|
|
40
|
+
size,
|
|
41
|
+
asChild = false,
|
|
42
|
+
...props
|
|
43
|
+
}) {
|
|
44
|
+
const Comp = asChild ? Slot : "button";
|
|
45
|
+
return /* @__PURE__ */ jsx(
|
|
46
|
+
Comp,
|
|
47
|
+
{
|
|
48
|
+
"data-slot": "button",
|
|
49
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
50
|
+
...props
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function Input({ className, type, ...props }) {
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
56
|
+
"input",
|
|
57
|
+
{
|
|
58
|
+
type,
|
|
59
|
+
"data-slot": "input",
|
|
60
|
+
className: cn(
|
|
61
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
62
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
63
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
64
|
+
className
|
|
65
|
+
),
|
|
66
|
+
...props
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
function Textarea({ className, ...props }) {
|
|
71
|
+
return /* @__PURE__ */ jsx(
|
|
72
|
+
"textarea",
|
|
73
|
+
{
|
|
74
|
+
"data-slot": "textarea",
|
|
75
|
+
className: cn(
|
|
76
|
+
"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
77
|
+
className
|
|
78
|
+
),
|
|
79
|
+
...props
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
function InputGroup({ className, ...props }) {
|
|
84
|
+
return /* @__PURE__ */ jsx(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
"data-slot": "input-group",
|
|
88
|
+
role: "group",
|
|
89
|
+
className: cn(
|
|
90
|
+
"group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none",
|
|
91
|
+
"h-9 min-w-0 has-[>textarea]:h-auto",
|
|
92
|
+
// Variants based on alignment.
|
|
93
|
+
"has-[>[data-align=inline-start]]:[&>input]:pl-2",
|
|
94
|
+
"has-[>[data-align=inline-end]]:[&>input]:pr-2",
|
|
95
|
+
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
|
|
96
|
+
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
|
|
97
|
+
// Focus state.
|
|
98
|
+
"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]",
|
|
99
|
+
// Error state.
|
|
100
|
+
"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
|
|
101
|
+
className
|
|
102
|
+
),
|
|
103
|
+
...props
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
var inputGroupAddonVariants = cva(
|
|
108
|
+
"text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50",
|
|
109
|
+
{
|
|
110
|
+
variants: {
|
|
111
|
+
align: {
|
|
112
|
+
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
113
|
+
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
114
|
+
"block-start": "order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5",
|
|
115
|
+
"block-end": "order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
defaultVariants: {
|
|
119
|
+
align: "inline-start"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
function InputGroupAddon({
|
|
124
|
+
className,
|
|
125
|
+
align = "inline-start",
|
|
126
|
+
...props
|
|
127
|
+
}) {
|
|
128
|
+
return /* @__PURE__ */ jsx(
|
|
129
|
+
"div",
|
|
130
|
+
{
|
|
131
|
+
role: "group",
|
|
132
|
+
"data-slot": "input-group-addon",
|
|
133
|
+
"data-align": align,
|
|
134
|
+
className: cn(inputGroupAddonVariants({ align }), className),
|
|
135
|
+
onClick: (e) => {
|
|
136
|
+
if (e.target.closest("button")) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
140
|
+
},
|
|
141
|
+
...props
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
var inputGroupButtonVariants = cva(
|
|
146
|
+
"text-sm shadow-none flex gap-2 items-center",
|
|
147
|
+
{
|
|
148
|
+
variants: {
|
|
149
|
+
size: {
|
|
150
|
+
xs: "h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",
|
|
151
|
+
sm: "h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5",
|
|
152
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
153
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
defaultVariants: {
|
|
157
|
+
size: "xs"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
function InputGroupButton({
|
|
162
|
+
className,
|
|
163
|
+
type = "button",
|
|
164
|
+
variant = "ghost",
|
|
165
|
+
size = "xs",
|
|
166
|
+
...props
|
|
167
|
+
}) {
|
|
168
|
+
return /* @__PURE__ */ jsx(
|
|
169
|
+
Button,
|
|
170
|
+
{
|
|
171
|
+
type,
|
|
172
|
+
"data-size": size,
|
|
173
|
+
variant,
|
|
174
|
+
className: cn(inputGroupButtonVariants({ size }), className),
|
|
175
|
+
...props
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
function InputGroupText({ className, ...props }) {
|
|
180
|
+
return /* @__PURE__ */ jsx(
|
|
181
|
+
"span",
|
|
182
|
+
{
|
|
183
|
+
className: cn(
|
|
184
|
+
"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
185
|
+
className
|
|
186
|
+
),
|
|
187
|
+
...props
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
function InputGroupInput({
|
|
192
|
+
className,
|
|
193
|
+
...props
|
|
194
|
+
}) {
|
|
195
|
+
return /* @__PURE__ */ jsx(
|
|
196
|
+
Input,
|
|
197
|
+
{
|
|
198
|
+
"data-slot": "input-group-control",
|
|
199
|
+
className: cn(
|
|
200
|
+
"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
201
|
+
className
|
|
202
|
+
),
|
|
203
|
+
...props
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
function InputGroupTextarea({
|
|
208
|
+
className,
|
|
209
|
+
...props
|
|
210
|
+
}) {
|
|
211
|
+
return /* @__PURE__ */ jsx(
|
|
212
|
+
Textarea,
|
|
213
|
+
{
|
|
214
|
+
"data-slot": "input-group-control",
|
|
215
|
+
className: cn(
|
|
216
|
+
"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
217
|
+
className
|
|
218
|
+
),
|
|
219
|
+
...props
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
|
|
225
|
+
//# sourceMappingURL=input-group.js.map
|
|
226
|
+
//# sourceMappingURL=input-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/new-york/button.tsx","../../src/new-york/input.tsx","../../src/new-york/textarea.tsx","../../src/new-york/input-group.tsx"],"names":["jsx","cva"],"mappings":"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","file":"input-group.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n \"icon-sm\": \"size-8\",\n \"icon-lg\": \"size-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? Slot : \"button\"\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n )\n}\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Input({ className, type, ...props }: React.ComponentProps<\"input\">) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n \"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n \"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Input }\n","import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Textarea({ className, ...props }: React.ComponentProps<\"textarea\">) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n \"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Textarea }\n","\"use client\"\n\nimport * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/new-york/button\"\nimport { Input } from \"@/new-york/input\"\nimport { Textarea } from \"@/new-york/textarea\"\n\nfunction InputGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n \"group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none\",\n \"h-9 min-w-0 has-[>textarea]:h-auto\",\n\n // Variants based on alignment.\n \"has-[>[data-align=inline-start]]:[&>input]:pl-2\",\n \"has-[>[data-align=inline-end]]:[&>input]:pr-2\",\n \"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3\",\n \"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3\",\n\n // Focus state.\n \"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]\",\n\n // Error state.\n \"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40\",\n\n className\n )}\n {...props}\n />\n )\n}\n\nconst inputGroupAddonVariants = cva(\n \"text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50\",\n {\n variants: {\n align: {\n \"inline-start\":\n \"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]\",\n \"inline-end\":\n \"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]\",\n \"block-start\":\n \"order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5\",\n \"block-end\":\n \"order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5\",\n },\n },\n defaultVariants: {\n align: \"inline-start\",\n },\n }\n)\n\nfunction InputGroupAddon({\n className,\n align = \"inline-start\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof inputGroupAddonVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"button\")) {\n return\n }\n e.currentTarget.parentElement?.querySelector(\"input\")?.focus()\n }}\n {...props}\n />\n )\n}\n\nconst inputGroupButtonVariants = cva(\n \"text-sm shadow-none flex gap-2 items-center\",\n {\n variants: {\n size: {\n xs: \"h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2\",\n sm: \"h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5\",\n \"icon-xs\":\n \"size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0\",\n \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\",\n },\n },\n defaultVariants: {\n size: \"xs\",\n },\n }\n)\n\nfunction InputGroupButton({\n className,\n type = \"button\",\n variant = \"ghost\",\n size = \"xs\",\n ...props\n}: Omit<React.ComponentProps<typeof Button>, \"size\"> &\n VariantProps<typeof inputGroupButtonVariants>) {\n return (\n <Button\n type={type}\n data-size={size}\n variant={variant}\n className={cn(inputGroupButtonVariants({ size }), className)}\n {...props}\n />\n )\n}\n\nfunction InputGroupText({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction InputGroupInput({\n className,\n ...props\n}: React.ComponentProps<\"input\">) {\n return (\n <Input\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction InputGroupTextarea({\n className,\n ...props\n}: React.ComponentProps<\"textarea\">) {\n return (\n <Textarea\n data-slot=\"input-group-control\"\n className={cn(\n \"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupText,\n InputGroupInput,\n InputGroupTextarea,\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { OTPInput } from 'input-otp';
|
|
4
|
+
|
|
5
|
+
declare function InputOTP({ className, containerClassName, ...props }: React.ComponentProps<typeof OTPInput> & {
|
|
6
|
+
containerClassName?: string;
|
|
7
|
+
}): react_jsx_runtime.JSX.Element;
|
|
8
|
+
declare function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
9
|
+
declare function InputOTPSlot({ index, className, ...props }: React.ComponentProps<"div"> & {
|
|
10
|
+
index: number;
|
|
11
|
+
}): react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare function InputOTPSeparator({ ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { OTPInput, OTPInputContext } from 'input-otp';
|
|
3
|
+
import { MinusIcon } from 'lucide-react';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
5
|
+
import { twMerge } from 'tailwind-merge';
|
|
6
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
// src/new-york/input-otp.tsx
|
|
9
|
+
function cn(...inputs) {
|
|
10
|
+
return twMerge(clsx(inputs));
|
|
11
|
+
}
|
|
12
|
+
function InputOTP({
|
|
13
|
+
className,
|
|
14
|
+
containerClassName,
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
OTPInput,
|
|
19
|
+
{
|
|
20
|
+
"data-slot": "input-otp",
|
|
21
|
+
containerClassName: cn(
|
|
22
|
+
"flex items-center gap-2 has-disabled:opacity-50",
|
|
23
|
+
containerClassName
|
|
24
|
+
),
|
|
25
|
+
className: cn("disabled:cursor-not-allowed", className),
|
|
26
|
+
...props
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
function InputOTPGroup({ className, ...props }) {
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
"data-slot": "input-otp-group",
|
|
35
|
+
className: cn("flex items-center", className),
|
|
36
|
+
...props
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
function InputOTPSlot({
|
|
41
|
+
index,
|
|
42
|
+
className,
|
|
43
|
+
...props
|
|
44
|
+
}) {
|
|
45
|
+
const inputOTPContext = React.useContext(OTPInputContext);
|
|
46
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
47
|
+
return /* @__PURE__ */ jsxs(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
"data-slot": "input-otp-slot",
|
|
51
|
+
"data-active": isActive,
|
|
52
|
+
className: cn(
|
|
53
|
+
"data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",
|
|
54
|
+
className
|
|
55
|
+
),
|
|
56
|
+
...props,
|
|
57
|
+
children: [
|
|
58
|
+
char,
|
|
59
|
+
hasFakeCaret && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" }) })
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
function InputOTPSeparator({ ...props }) {
|
|
65
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ jsx(MinusIcon, {}) });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
69
|
+
//# sourceMappingURL=input-otp.js.map
|
|
70
|
+
//# sourceMappingURL=input-otp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/new-york/input-otp.tsx"],"names":[],"mappings":";;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACCA,SAAS,QAAA,CAAS;AAAA,EAChB,SAAA;AAAA,EACA,kBAAA;AAAA,EACA,GAAG;AACL,CAAA,EAEG;AACD,EAAA,uBACE,GAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,WAAA;AAAA,MACV,kBAAA,EAAoB,EAAA;AAAA,QAClB,iDAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,SAAA,EAAW,EAAA,CAAG,6BAAA,EAA+B,SAAS,CAAA;AAAA,MACrD,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,aAAA,CAAc,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgC;AAC3E,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,iBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,mBAAA,EAAqB,SAAS,CAAA;AAAA,MAC3C,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,YAAA,CAAa;AAAA,EACpB,KAAA;AAAA,EACA,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAEG;AACD,EAAA,MAAM,eAAA,GAAwB,iBAAW,eAAe,CAAA;AACxD,EAAA,MAAM,EAAE,MAAM,YAAA,EAAc,QAAA,KAAa,eAAA,EAAiB,KAAA,CAAM,KAAK,CAAA,IAAK,EAAC;AAE3E,EAAA,uBACE,IAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,gBAAA;AAAA,MACV,aAAA,EAAa,QAAA;AAAA,MACb,SAAA,EAAW,EAAA;AAAA,QACT,0fAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA,QAAA,IAAA;AAAA,QACA,YAAA,wBACE,KAAA,EAAA,EAAI,SAAA,EAAU,yEACb,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,0DAAA,EAA2D,CAAA,EAC5E;AAAA;AAAA;AAAA,GAEJ;AAEJ;AAEA,SAAS,iBAAA,CAAkB,EAAE,GAAG,KAAA,EAAM,EAAgC;AACpE,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,WAAA,EAAU,qBAAA,EAAsB,IAAA,EAAK,aAAa,GAAG,KAAA,EACxD,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,CAAA,EACb,CAAA;AAEJ","file":"input-otp.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\nimport { OTPInput, OTPInputContext } from \"input-otp\"\nimport { MinusIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction InputOTP({\n className,\n containerClassName,\n ...props\n}: React.ComponentProps<typeof OTPInput> & {\n containerClassName?: string\n}) {\n return (\n <OTPInput\n data-slot=\"input-otp\"\n containerClassName={cn(\n \"flex items-center gap-2 has-disabled:opacity-50\",\n containerClassName\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n />\n )\n}\n\nfunction InputOTPGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"input-otp-group\"\n className={cn(\"flex items-center\", className)}\n {...props}\n />\n )\n}\n\nfunction InputOTPSlot({\n index,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n index: number\n}) {\n const inputOTPContext = React.useContext(OTPInputContext)\n const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}\n\n return (\n <div\n data-slot=\"input-otp-slot\"\n data-active={isActive}\n className={cn(\n \"data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]\",\n className\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground h-4 w-px duration-1000\" />\n </div>\n )}\n </div>\n )\n}\n\nfunction InputOTPSeparator({ ...props }: React.ComponentProps<\"div\">) {\n return (\n <div data-slot=\"input-otp-separator\" role=\"separator\" {...props}>\n <MinusIcon />\n </div>\n )\n}\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/lib/utils.ts
|
|
6
|
+
function cn(...inputs) {
|
|
7
|
+
return twMerge(clsx(inputs));
|
|
8
|
+
}
|
|
9
|
+
function Input({ className, type, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
"input",
|
|
12
|
+
{
|
|
13
|
+
type,
|
|
14
|
+
"data-slot": "input",
|
|
15
|
+
className: cn(
|
|
16
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
17
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
18
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
19
|
+
className
|
|
20
|
+
),
|
|
21
|
+
...props
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { Input };
|
|
27
|
+
//# sourceMappingURL=input.js.map
|
|
28
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/utils.ts","../../src/new-york/input.tsx"],"names":[],"mappings":";;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACDA,SAAS,MAAM,EAAE,SAAA,EAAW,IAAA,EAAM,GAAG,OAAM,EAAkC;AAC3E,EAAA,uBACE,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,IAAA;AAAA,MACA,WAAA,EAAU,OAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,4bAAA;AAAA,QACA,+EAAA;AAAA,QACA,wGAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ","file":"input.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Input({ className, type, ...props }: React.ComponentProps<\"input\">) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n \"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]\",\n \"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Input }\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import { Separator } from './separator.js';
|
|
6
|
+
import '@radix-ui/react-separator';
|
|
7
|
+
|
|
8
|
+
declare function ItemGroup({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
9
|
+
declare function ItemSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): react_jsx_runtime.JSX.Element;
|
|
10
|
+
declare const itemVariants: (props?: ({
|
|
11
|
+
variant?: "default" | "outline" | "muted" | null | undefined;
|
|
12
|
+
size?: "default" | "sm" | null | undefined;
|
|
13
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
14
|
+
declare function Item({ className, variant, size, asChild, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
}): react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare const itemMediaVariants: (props?: ({
|
|
18
|
+
variant?: "default" | "image" | "icon" | null | undefined;
|
|
19
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
20
|
+
declare function ItemMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>): react_jsx_runtime.JSX.Element;
|
|
21
|
+
declare function ItemContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
22
|
+
declare function ItemTitle({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
23
|
+
declare function ItemDescription({ className, ...props }: React.ComponentProps<"p">): react_jsx_runtime.JSX.Element;
|
|
24
|
+
declare function ItemActions({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
25
|
+
declare function ItemHeader({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
26
|
+
declare function ItemFooter({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
27
|
+
|
|
28
|
+
export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle };
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
// src/new-york/item.tsx
|
|
9
|
+
function cn(...inputs) {
|
|
10
|
+
return twMerge(clsx(inputs));
|
|
11
|
+
}
|
|
12
|
+
function Separator({
|
|
13
|
+
className,
|
|
14
|
+
orientation = "horizontal",
|
|
15
|
+
decorative = true,
|
|
16
|
+
...props
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
SeparatorPrimitive.Root,
|
|
20
|
+
{
|
|
21
|
+
"data-slot": "separator",
|
|
22
|
+
decorative,
|
|
23
|
+
orientation,
|
|
24
|
+
className: cn(
|
|
25
|
+
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
26
|
+
className
|
|
27
|
+
),
|
|
28
|
+
...props
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
function ItemGroup({ className, ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
role: "list",
|
|
37
|
+
"data-slot": "item-group",
|
|
38
|
+
className: cn("group/item-group flex flex-col", className),
|
|
39
|
+
...props
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
function ItemSeparator({
|
|
44
|
+
className,
|
|
45
|
+
...props
|
|
46
|
+
}) {
|
|
47
|
+
return /* @__PURE__ */ jsx(
|
|
48
|
+
Separator,
|
|
49
|
+
{
|
|
50
|
+
"data-slot": "item-separator",
|
|
51
|
+
orientation: "horizontal",
|
|
52
|
+
className: cn("my-0", className),
|
|
53
|
+
...props
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
var itemVariants = cva(
|
|
58
|
+
"group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
59
|
+
{
|
|
60
|
+
variants: {
|
|
61
|
+
variant: {
|
|
62
|
+
default: "bg-transparent",
|
|
63
|
+
outline: "border-border",
|
|
64
|
+
muted: "bg-muted/50"
|
|
65
|
+
},
|
|
66
|
+
size: {
|
|
67
|
+
default: "p-4 gap-4 ",
|
|
68
|
+
sm: "py-3 px-4 gap-2.5"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
defaultVariants: {
|
|
72
|
+
variant: "default",
|
|
73
|
+
size: "default"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
function Item({
|
|
78
|
+
className,
|
|
79
|
+
variant = "default",
|
|
80
|
+
size = "default",
|
|
81
|
+
asChild = false,
|
|
82
|
+
...props
|
|
83
|
+
}) {
|
|
84
|
+
const Comp = asChild ? Slot : "div";
|
|
85
|
+
return /* @__PURE__ */ jsx(
|
|
86
|
+
Comp,
|
|
87
|
+
{
|
|
88
|
+
"data-slot": "item",
|
|
89
|
+
"data-variant": variant,
|
|
90
|
+
"data-size": size,
|
|
91
|
+
className: cn(itemVariants({ variant, size, className })),
|
|
92
|
+
...props
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
var itemMediaVariants = cva(
|
|
97
|
+
"flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5",
|
|
98
|
+
{
|
|
99
|
+
variants: {
|
|
100
|
+
variant: {
|
|
101
|
+
default: "bg-transparent",
|
|
102
|
+
icon: "size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4",
|
|
103
|
+
image: "size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
defaultVariants: {
|
|
107
|
+
variant: "default"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
function ItemMedia({
|
|
112
|
+
className,
|
|
113
|
+
variant = "default",
|
|
114
|
+
...props
|
|
115
|
+
}) {
|
|
116
|
+
return /* @__PURE__ */ jsx(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
"data-slot": "item-media",
|
|
120
|
+
"data-variant": variant,
|
|
121
|
+
className: cn(itemMediaVariants({ variant, className })),
|
|
122
|
+
...props
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
function ItemContent({ className, ...props }) {
|
|
127
|
+
return /* @__PURE__ */ jsx(
|
|
128
|
+
"div",
|
|
129
|
+
{
|
|
130
|
+
"data-slot": "item-content",
|
|
131
|
+
className: cn(
|
|
132
|
+
"flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none",
|
|
133
|
+
className
|
|
134
|
+
),
|
|
135
|
+
...props
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
function ItemTitle({ className, ...props }) {
|
|
140
|
+
return /* @__PURE__ */ jsx(
|
|
141
|
+
"div",
|
|
142
|
+
{
|
|
143
|
+
"data-slot": "item-title",
|
|
144
|
+
className: cn(
|
|
145
|
+
"flex w-fit items-center gap-2 text-sm leading-snug font-medium",
|
|
146
|
+
className
|
|
147
|
+
),
|
|
148
|
+
...props
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
function ItemDescription({ className, ...props }) {
|
|
153
|
+
return /* @__PURE__ */ jsx(
|
|
154
|
+
"p",
|
|
155
|
+
{
|
|
156
|
+
"data-slot": "item-description",
|
|
157
|
+
className: cn(
|
|
158
|
+
"text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance",
|
|
159
|
+
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
160
|
+
className
|
|
161
|
+
),
|
|
162
|
+
...props
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
function ItemActions({ className, ...props }) {
|
|
167
|
+
return /* @__PURE__ */ jsx(
|
|
168
|
+
"div",
|
|
169
|
+
{
|
|
170
|
+
"data-slot": "item-actions",
|
|
171
|
+
className: cn("flex items-center gap-2", className),
|
|
172
|
+
...props
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
function ItemHeader({ className, ...props }) {
|
|
177
|
+
return /* @__PURE__ */ jsx(
|
|
178
|
+
"div",
|
|
179
|
+
{
|
|
180
|
+
"data-slot": "item-header",
|
|
181
|
+
className: cn(
|
|
182
|
+
"flex basis-full items-center justify-between gap-2",
|
|
183
|
+
className
|
|
184
|
+
),
|
|
185
|
+
...props
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
function ItemFooter({ className, ...props }) {
|
|
190
|
+
return /* @__PURE__ */ jsx(
|
|
191
|
+
"div",
|
|
192
|
+
{
|
|
193
|
+
"data-slot": "item-footer",
|
|
194
|
+
className: cn(
|
|
195
|
+
"flex basis-full items-center justify-between gap-2",
|
|
196
|
+
className
|
|
197
|
+
),
|
|
198
|
+
...props
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle };
|
|
204
|
+
//# sourceMappingURL=item.js.map
|
|
205
|
+
//# sourceMappingURL=item.js.map
|