@codefast/ui 0.3.10 → 0.3.11-canary.1
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 +32 -0
- package/README.md +277 -167
- package/dist/components/accordion.d.ts +4 -4
- package/dist/components/accordion.js +5 -5
- package/dist/components/alert-dialog.d.ts +11 -11
- package/dist/components/alert-dialog.js +9 -9
- package/dist/components/alert.d.ts +5 -5
- package/dist/components/alert.js +5 -5
- package/dist/components/aspect-ratio.d.ts +2 -2
- package/dist/components/avatar.d.ts +2 -2
- package/dist/components/avatar.js +3 -3
- package/dist/components/badge.d.ts +3 -3
- package/dist/components/badge.js +7 -7
- package/dist/components/breadcrumb.d.ts +8 -8
- package/dist/components/breadcrumb.js +6 -8
- package/dist/components/button-group.d.ts +5 -5
- package/dist/components/button-group.js +8 -8
- package/dist/components/button.d.ts +6 -6
- package/dist/components/button.js +17 -17
- package/dist/components/calendar.d.ts +5 -5
- package/dist/components/calendar.js +35 -35
- package/dist/components/card.d.ts +8 -8
- package/dist/components/card.js +7 -7
- package/dist/components/carousel.d.ts +10 -10
- package/dist/components/carousel.js +20 -20
- package/dist/components/chart.d.ts +12 -11
- package/dist/components/chart.js +42 -42
- package/dist/components/checkbox-cards.d.ts +2 -2
- package/dist/components/checkbox-cards.js +2 -2
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +2 -2
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +1 -1
- package/dist/components/collapsible.d.ts +2 -2
- package/dist/components/command.d.ts +4 -4
- package/dist/components/command.js +10 -10
- package/dist/components/context-menu.d.ts +4 -4
- package/dist/components/context-menu.js +10 -10
- package/dist/components/dialog.d.ts +10 -10
- package/dist/components/dialog.js +12 -12
- package/dist/components/drawer.d.ts +9 -9
- package/dist/components/drawer.js +9 -9
- package/dist/components/dropdown-menu.d.ts +4 -4
- package/dist/components/dropdown-menu.js +10 -10
- package/dist/components/empty.d.ts +9 -9
- package/dist/components/empty.js +10 -10
- package/dist/components/field.d.ts +14 -14
- package/dist/components/field.js +17 -17
- package/dist/components/form.d.ts +10 -10
- package/dist/components/form.js +8 -8
- package/dist/components/hover-card.d.ts +2 -2
- package/dist/components/hover-card.js +3 -3
- package/dist/components/input-group.d.ts +15 -15
- package/dist/components/input-group.js +20 -20
- package/dist/components/input-number.d.ts +2 -2
- package/dist/components/input-number.js +7 -7
- package/dist/components/input-otp.d.ts +6 -6
- package/dist/components/input-otp.js +4 -4
- package/dist/components/input-password.d.ts +3 -3
- package/dist/components/input-password.js +6 -6
- package/dist/components/input-search.d.ts +3 -3
- package/dist/components/input-search.js +4 -4
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +1 -1
- package/dist/components/item.d.ts +12 -12
- package/dist/components/item.js +23 -23
- package/dist/components/kbd.d.ts +3 -3
- package/dist/components/kbd.js +2 -2
- package/dist/components/label.d.ts +2 -2
- package/dist/components/label.js +1 -1
- package/dist/components/menubar.d.ts +4 -4
- package/dist/components/menubar.js +13 -13
- package/dist/components/native-select.d.ts +4 -4
- package/dist/components/native-select.js +2 -2
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +10 -10
- package/dist/components/pagination.d.ts +10 -10
- package/dist/components/pagination.js +6 -6
- package/dist/components/popover.d.ts +3 -3
- package/dist/components/popover.js +3 -3
- package/dist/components/progress-circle.d.ts +5 -5
- package/dist/components/progress-circle.js +22 -22
- package/dist/components/progress.d.ts +2 -2
- package/dist/components/progress.js +2 -2
- package/dist/components/radio-cards.d.ts +2 -2
- package/dist/components/radio-cards.js +3 -3
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +3 -3
- package/dist/components/radio.d.ts +2 -2
- package/dist/components/radio.js +1 -1
- package/dist/components/resizable.d.ts +2 -2
- package/dist/components/resizable.js +3 -3
- package/dist/components/scroll-area.d.ts +5 -5
- package/dist/components/scroll-area.js +31 -31
- package/dist/components/select.d.ts +5 -5
- package/dist/components/select.js +9 -9
- package/dist/components/separator.d.ts +5 -5
- package/dist/components/separator.js +9 -9
- package/dist/components/sheet.d.ts +9 -9
- package/dist/components/sheet.js +17 -17
- package/dist/components/sidebar.d.ts +31 -31
- package/dist/components/sidebar.js +65 -65
- package/dist/components/skeleton.d.ts +2 -2
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +4 -4
- package/dist/components/sonner.d.ts +3 -3
- package/dist/components/sonner.js +4 -4
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/spinner.js +5 -5
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +2 -2
- package/dist/components/table.d.ts +9 -9
- package/dist/components/table.js +8 -8
- package/dist/components/tabs.d.ts +2 -2
- package/dist/components/tabs.js +4 -4
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +1 -1
- package/dist/components/toggle-group.d.ts +4 -4
- package/dist/components/toggle-group.js +5 -5
- package/dist/components/toggle.d.ts +3 -3
- package/dist/components/toggle.js +8 -8
- package/dist/components/tooltip.d.ts +3 -3
- package/dist/components/tooltip.js +2 -2
- package/dist/css/preset.css +4 -4
- package/dist/css/style.css +3 -3
- package/dist/hooks/use-copy-to-clipboard.d.ts +1 -1
- package/dist/hooks/use-copy-to-clipboard.js +1 -1
- package/dist/hooks/use-media-query.js +3 -3
- package/dist/hooks/use-mutation-observer.d.ts +1 -1
- package/dist/hooks/use-pagination.js +1 -1
- package/dist/index.d.ts +130 -130
- package/dist/primitives/checkbox-group.d.ts +11 -11
- package/dist/primitives/checkbox-group.js +3 -3
- package/dist/primitives/input-number.d.ts +8 -8
- package/dist/primitives/input-number.js +46 -46
- package/dist/primitives/input.d.ts +4 -4
- package/dist/primitives/input.js +7 -7
- package/dist/primitives/progress-circle.d.ts +7 -7
- package/dist/primitives/progress-circle.js +8 -8
- package/package.json +111 -189
- package/dist/components/accordion.cjs +0 -98
- package/dist/components/alert-dialog.cjs +0 -156
- package/dist/components/alert.cjs +0 -84
- package/dist/components/aspect-ratio.cjs +0 -44
- package/dist/components/avatar.cjs +0 -66
- package/dist/components/badge.cjs +0 -67
- package/dist/components/breadcrumb.cjs +0 -127
- package/dist/components/button-group.cjs +0 -87
- package/dist/components/button.cjs +0 -92
- package/dist/components/calendar.cjs +0 -151
- package/dist/components/card.cjs +0 -105
- package/dist/components/carousel.cjs +0 -211
- package/dist/components/chart.cjs +0 -251
- package/dist/components/checkbox-cards.cjs +0 -70
- package/dist/components/checkbox-group.cjs +0 -64
- package/dist/components/checkbox.cjs +0 -54
- package/dist/components/collapsible.cjs +0 -62
- package/dist/components/command.cjs +0 -168
- package/dist/components/context-menu.cjs +0 -219
- package/dist/components/dialog.cjs +0 -165
- package/dist/components/drawer.cjs +0 -144
- package/dist/components/dropdown-menu.cjs +0 -222
- package/dist/components/empty.cjs +0 -113
- package/dist/components/field.cjs +0 -194
- package/dist/components/form.cjs +0 -152
- package/dist/components/hover-card.cjs +0 -78
- package/dist/components/input-group.cjs +0 -156
- package/dist/components/input-number.cjs +0 -99
- package/dist/components/input-otp.cjs +0 -102
- package/dist/components/input-password.cjs +0 -72
- package/dist/components/input-search.cjs +0 -81
- package/dist/components/input.cjs +0 -46
- package/dist/components/item.cjs +0 -186
- package/dist/components/kbd.cjs +0 -54
- package/dist/components/label.cjs +0 -46
- package/dist/components/menubar.cjs +0 -233
- package/dist/components/native-select.cjs +0 -75
- package/dist/components/navigation-menu.cjs +0 -146
- package/dist/components/pagination.cjs +0 -138
- package/dist/components/popover.cjs +0 -87
- package/dist/components/progress-circle.cjs +0 -185
- package/dist/components/progress.cjs +0 -53
- package/dist/components/radio-cards.cjs +0 -67
- package/dist/components/radio-group.cjs +0 -60
- package/dist/components/radio.cjs +0 -48
- package/dist/components/resizable.cjs +0 -72
- package/dist/components/scroll-area.cjs +0 -141
- package/dist/components/select.cjs +0 -181
- package/dist/components/separator.cjs +0 -83
- package/dist/components/sheet.cjs +0 -185
- package/dist/components/sidebar.cjs +0 -507
- package/dist/components/skeleton.cjs +0 -44
- package/dist/components/slider.cjs +0 -80
- package/dist/components/sonner.cjs +0 -58
- package/dist/components/spinner.cjs +0 -76
- package/dist/components/switch.cjs +0 -50
- package/dist/components/table.cjs +0 -118
- package/dist/components/tabs.cjs +0 -76
- package/dist/components/textarea.cjs +0 -44
- package/dist/components/toggle-group.cjs +0 -91
- package/dist/components/toggle.cjs +0 -72
- package/dist/components/tooltip.cjs +0 -91
- package/dist/hooks/use-animated-value.cjs +0 -75
- package/dist/hooks/use-copy-to-clipboard.cjs +0 -58
- package/dist/hooks/use-is-mobile.cjs +0 -40
- package/dist/hooks/use-media-query.cjs +0 -57
- package/dist/hooks/use-mutation-observer.cjs +0 -57
- package/dist/hooks/use-pagination.cjs +0 -93
- package/dist/index.cjs +0 -1081
- package/dist/primitives/checkbox-group.cjs +0 -151
- package/dist/primitives/input-number.cjs +0 -439
- package/dist/primitives/input.cjs +0 -99
- package/dist/primitives/progress-circle.cjs +0 -199
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Scope } from
|
|
2
|
-
import type * as LabelPrimitive from
|
|
3
|
-
import type { ComponentProps, JSX, ReactNode } from
|
|
4
|
-
import type { ControllerProps, FieldPath, FieldValues } from
|
|
5
|
-
import { Slot } from
|
|
6
|
-
import { FormProvider } from
|
|
1
|
+
import type { Scope } from "@radix-ui/react-context";
|
|
2
|
+
import type * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
+
import type { ComponentProps, JSX, ReactNode } from "react";
|
|
4
|
+
import type { ControllerProps, FieldPath, FieldValues } from "react-hook-form";
|
|
5
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
6
|
+
import { FormProvider } from "react-hook-form";
|
|
7
7
|
type FormProps = ComponentProps<typeof FormProvider>;
|
|
8
8
|
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
9
9
|
type ScopedProps<P> = P & {
|
|
@@ -12,15 +12,15 @@ type ScopedProps<P> = P & {
|
|
|
12
12
|
declare const createFormFieldScope: import("@radix-ui/react-context").CreateScope;
|
|
13
13
|
type FormFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = ControllerProps<TFieldValues, TName>;
|
|
14
14
|
declare function FormField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(formFieldProps: ScopedProps<FormFieldProps<TFieldValues, TName>>): JSX.Element;
|
|
15
|
-
type FormItemProps = ComponentProps<
|
|
15
|
+
type FormItemProps = ComponentProps<"div">;
|
|
16
16
|
declare function FormItem({ __scopeFormField, className, ...props }: ScopedProps<FormItemProps>): JSX.Element;
|
|
17
17
|
type FormLabelProps = ComponentProps<typeof LabelPrimitive.Root>;
|
|
18
18
|
declare function FormLabel({ __scopeFormField, ...props }: ScopedProps<FormLabelProps>): JSX.Element;
|
|
19
19
|
type FormControlProps = ComponentProps<typeof Slot>;
|
|
20
20
|
declare function FormControl({ __scopeFormField, ...props }: ScopedProps<FormControlProps>): JSX.Element;
|
|
21
|
-
type FormDescriptionProps = ComponentProps<
|
|
21
|
+
type FormDescriptionProps = ComponentProps<"p">;
|
|
22
22
|
declare function FormDescription({ __scopeFormField, className, ...props }: ScopedProps<FormDescriptionProps>): JSX.Element;
|
|
23
|
-
type FormMessageProps = ComponentProps<
|
|
23
|
+
type FormMessageProps = ComponentProps<"p">;
|
|
24
24
|
declare function FormMessage({ __scopeFormField, children, className, ...props }: ScopedProps<FormMessageProps>): ReactNode;
|
|
25
25
|
export type { FormControlProps, FormDescriptionProps, FormFieldProps, FormItemProps, FormLabelProps, FormMessageProps, FormProps, };
|
|
26
|
-
export { createFormFieldScope, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage };
|
|
26
|
+
export { createFormFieldScope, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, };
|
package/dist/components/form.js
CHANGED
|
@@ -7,7 +7,7 @@ import { useId } from "react";
|
|
|
7
7
|
import { Controller, FormProvider, useFormContext, useFormState } from "react-hook-form";
|
|
8
8
|
import { Label } from "./label.js";
|
|
9
9
|
const Form = FormProvider;
|
|
10
|
-
const FORM_FIELD_NAME =
|
|
10
|
+
const FORM_FIELD_NAME = "FormField";
|
|
11
11
|
const [createFormFieldContext, createFormFieldScope] = createContextScope(FORM_FIELD_NAME);
|
|
12
12
|
const [FormFieldContextProvider, useFormFieldContext] = createFormFieldContext(FORM_FIELD_NAME);
|
|
13
13
|
function useFormItem(consumerName, scope) {
|
|
@@ -37,7 +37,7 @@ function FormField(formFieldProps) {
|
|
|
37
37
|
})
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
const FORM_ITEM_NAME =
|
|
40
|
+
const FORM_ITEM_NAME = "FormItem";
|
|
41
41
|
const [FormItemContextProvider, useFormItemContext] = createFormFieldContext(FORM_ITEM_NAME);
|
|
42
42
|
function FormItem({ __scopeFormField, className, ...props }) {
|
|
43
43
|
const id = useId();
|
|
@@ -45,13 +45,13 @@ function FormItem({ __scopeFormField, className, ...props }) {
|
|
|
45
45
|
id: id,
|
|
46
46
|
scope: __scopeFormField,
|
|
47
47
|
children: /*#__PURE__*/ jsx("div", {
|
|
48
|
-
className: cn(
|
|
48
|
+
className: cn("grid gap-2", className),
|
|
49
49
|
"data-slot": "form-item",
|
|
50
50
|
...props
|
|
51
51
|
})
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
const FORM_LABEL_NAME =
|
|
54
|
+
const FORM_LABEL_NAME = "FormLabel";
|
|
55
55
|
function FormLabel({ __scopeFormField, ...props }) {
|
|
56
56
|
const { error, formItemId } = useFormItem(FORM_LABEL_NAME, __scopeFormField);
|
|
57
57
|
return /*#__PURE__*/ jsx(Label, {
|
|
@@ -61,7 +61,7 @@ function FormLabel({ __scopeFormField, ...props }) {
|
|
|
61
61
|
...props
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
const FORM_CONTROL_NAME =
|
|
64
|
+
const FORM_CONTROL_NAME = "FormControl";
|
|
65
65
|
function FormControl({ __scopeFormField, ...props }) {
|
|
66
66
|
const { error, formDescriptionId, formItemId, formMessageId } = useFormItem(FORM_CONTROL_NAME, __scopeFormField);
|
|
67
67
|
return /*#__PURE__*/ jsx(Slot, {
|
|
@@ -75,19 +75,19 @@ function FormControl({ __scopeFormField, ...props }) {
|
|
|
75
75
|
function FormDescription({ __scopeFormField, className, ...props }) {
|
|
76
76
|
const { formDescriptionId } = useFormItem(FORM_MESSAGE_NAME, __scopeFormField);
|
|
77
77
|
return /*#__PURE__*/ jsx("p", {
|
|
78
|
-
className: cn(
|
|
78
|
+
className: cn("text-xs text-muted-foreground", className),
|
|
79
79
|
"data-slot": "form-description",
|
|
80
80
|
id: formDescriptionId,
|
|
81
81
|
...props
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
const FORM_MESSAGE_NAME =
|
|
84
|
+
const FORM_MESSAGE_NAME = "FormMessage";
|
|
85
85
|
function FormMessage({ __scopeFormField, children, className, ...props }) {
|
|
86
86
|
const { error, formMessageId } = useFormItem(FORM_MESSAGE_NAME, __scopeFormField);
|
|
87
87
|
const body = error?.message ?? children;
|
|
88
88
|
if (!body) return null;
|
|
89
89
|
return /*#__PURE__*/ jsx("p", {
|
|
90
|
-
className: cn(
|
|
90
|
+
className: cn("text-xs", error?.message ? "font-medium text-destructive" : "text-muted-foreground", className),
|
|
91
91
|
"data-slot": "form-message",
|
|
92
92
|
id: formMessageId,
|
|
93
93
|
...props,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as HoverCardPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
3
3
|
type HoverCardProps = ComponentProps<typeof HoverCardPrimitive.Root>;
|
|
4
4
|
declare function HoverCard({ ...props }: HoverCardProps): JSX.Element;
|
|
5
5
|
type HoverCardTriggerProps = ComponentProps<typeof HoverCardPrimitive.Trigger>;
|
|
@@ -14,11 +14,11 @@ function HoverCardTrigger({ ...props }) {
|
|
|
14
14
|
...props
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
function HoverCardContent({ align =
|
|
17
|
+
function HoverCardContent({ align = "center", className, sideOffset = 4, ...props }) {
|
|
18
18
|
return /*#__PURE__*/ jsx(Portal, {
|
|
19
19
|
children: /*#__PURE__*/ jsx(Content, {
|
|
20
20
|
align: align,
|
|
21
|
-
className: cn(
|
|
21
|
+
className: cn("z-50 min-w-32 origin-(--radix-hover-card-content-transform-origin) rounded-lg border bg-popover p-4 text-popover-foreground shadow-lg ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2", className),
|
|
22
22
|
"data-slot": "hover-card-content",
|
|
23
23
|
sideOffset: sideOffset,
|
|
24
24
|
...props
|
|
@@ -27,7 +27,7 @@ function HoverCardContent({ align = 'center', className, sideOffset = 4, ...prop
|
|
|
27
27
|
}
|
|
28
28
|
function HoverCardArrow({ className, ...props }) {
|
|
29
29
|
return /*#__PURE__*/ jsx(Arrow, {
|
|
30
|
-
className: cn(
|
|
30
|
+
className: cn("fill-popover", className),
|
|
31
31
|
"data-slot": "hover-card-arrow",
|
|
32
32
|
...props
|
|
33
33
|
});
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import type { ButtonProps } from
|
|
4
|
-
import type { InputProps } from
|
|
5
|
-
import type { TextareaProps } from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import type { ButtonProps } from "./button";
|
|
4
|
+
import type { InputProps } from "./input";
|
|
5
|
+
import type { TextareaProps } from "./textarea";
|
|
6
6
|
declare const inputGroupVariants: import("@codefast/tailwind-variants").VariantFunctionType<import("@codefast/tailwind-variants").ConfigurationSchema, Record<string, never>>;
|
|
7
7
|
declare const inputGroupAddonVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
8
8
|
align: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
"block-end": string;
|
|
10
|
+
"block-start": string;
|
|
11
|
+
"inline-end": string;
|
|
12
|
+
"inline-start": string;
|
|
13
13
|
};
|
|
14
14
|
}, Record<string, never>>;
|
|
15
15
|
declare const inputGroupButtonVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
16
16
|
size: {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
"icon-sm": string;
|
|
18
|
+
"icon-xs": string;
|
|
19
19
|
sm: string;
|
|
20
20
|
xs: string;
|
|
21
21
|
};
|
|
22
22
|
}, Record<string, never>>;
|
|
23
|
-
type InputGroupProps = ComponentProps<
|
|
23
|
+
type InputGroupProps = ComponentProps<"div">;
|
|
24
24
|
declare function InputGroup({ className, ...props }: InputGroupProps): JSX.Element;
|
|
25
|
-
type InputGroupAddonProps = ComponentProps<
|
|
25
|
+
type InputGroupAddonProps = ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>;
|
|
26
26
|
declare function InputGroupAddon({ align, className, ...props }: InputGroupAddonProps): JSX.Element;
|
|
27
|
-
type InputGroupButtonProps = Omit<ButtonProps,
|
|
27
|
+
type InputGroupButtonProps = Omit<ButtonProps, "size"> & VariantProps<typeof inputGroupButtonVariants>;
|
|
28
28
|
declare function InputGroupButton({ className, size, type, variant, ...props }: InputGroupButtonProps): JSX.Element;
|
|
29
|
-
type InputGroupTextProps = ComponentProps<
|
|
29
|
+
type InputGroupTextProps = ComponentProps<"span">;
|
|
30
30
|
declare function InputGroupText({ className, ...props }: InputGroupTextProps): JSX.Element;
|
|
31
31
|
type InputGroupInputProps = InputProps;
|
|
32
32
|
declare function InputGroupInput({ className, ...props }: InputGroupInputProps): JSX.Element;
|
|
@@ -5,33 +5,33 @@ import { Button } from "./button.js";
|
|
|
5
5
|
import { Input } from "./input.js";
|
|
6
6
|
import { Textarea } from "./textarea.js";
|
|
7
7
|
const inputGroupVariants = tv({
|
|
8
|
-
base: cn(
|
|
8
|
+
base: cn("group/input-group relative flex w-full items-center rounded-lg border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30", "h-9 min-w-0 has-[>textarea]:h-auto", "has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:pl-2", "has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:pr-2", "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>[data-slot=input-group-control]]:pb-3", "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>[data-slot=input-group-control]]:pt-3", "has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50", "has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40")
|
|
9
9
|
});
|
|
10
10
|
const inputGroupAddonVariants = tv({
|
|
11
|
-
base: cn("
|
|
11
|
+
base: cn("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4"),
|
|
12
12
|
defaultVariants: {
|
|
13
|
-
align:
|
|
13
|
+
align: "inline-start"
|
|
14
14
|
},
|
|
15
15
|
variants: {
|
|
16
16
|
align: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
"block-end": "order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3",
|
|
18
|
+
"block-start": "order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3",
|
|
19
|
+
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
20
|
+
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
const inputGroupButtonVariants = tv({
|
|
25
|
-
base: "
|
|
25
|
+
base: "flex items-center gap-2 text-sm shadow-none [&>svg:not([class*='size-'])]:size-4",
|
|
26
26
|
defaultVariants: {
|
|
27
|
-
size:
|
|
27
|
+
size: "xs"
|
|
28
28
|
},
|
|
29
29
|
variants: {
|
|
30
30
|
size: {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
sm:
|
|
34
|
-
xs:
|
|
31
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0",
|
|
32
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
33
|
+
sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
|
|
34
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg]:size-3.5"
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
});
|
|
@@ -45,7 +45,7 @@ function InputGroup({ className, ...props }) {
|
|
|
45
45
|
...props
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
function InputGroupAddon({ align =
|
|
48
|
+
function InputGroupAddon({ align = "inline-start", className, ...props }) {
|
|
49
49
|
return /*#__PURE__*/ jsx("div", {
|
|
50
50
|
className: cn(inputGroupAddonVariants({
|
|
51
51
|
align
|
|
@@ -54,15 +54,15 @@ function InputGroupAddon({ align = 'inline-start', className, ...props }) {
|
|
|
54
54
|
"data-slot": "input-group-addon",
|
|
55
55
|
role: "group",
|
|
56
56
|
onPointerDown: (event)=>{
|
|
57
|
-
if (event.target.closest(
|
|
57
|
+
if (event.target.closest("button")) return;
|
|
58
58
|
event.preventDefault();
|
|
59
|
-
const control = event.currentTarget.parentElement?.querySelector(
|
|
59
|
+
const control = event.currentTarget.parentElement?.querySelector("input, textarea");
|
|
60
60
|
if (control instanceof HTMLElement) control.focus();
|
|
61
61
|
},
|
|
62
62
|
...props
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
function InputGroupButton({ className, size =
|
|
65
|
+
function InputGroupButton({ className, size = "xs", type = "button", variant = "ghost", ...props }) {
|
|
66
66
|
return /*#__PURE__*/ jsx(Button, {
|
|
67
67
|
className: cn(inputGroupButtonVariants({
|
|
68
68
|
size
|
|
@@ -76,21 +76,21 @@ function InputGroupButton({ className, size = 'xs', type = 'button', variant = '
|
|
|
76
76
|
}
|
|
77
77
|
function InputGroupText({ className, ...props }) {
|
|
78
78
|
return /*#__PURE__*/ jsx("span", {
|
|
79
|
-
className: cn("
|
|
79
|
+
className: cn("flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className),
|
|
80
80
|
"data-slot": "input-group-text",
|
|
81
81
|
...props
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
function InputGroupInput({ className, ...props }) {
|
|
85
85
|
return /*#__PURE__*/ jsx(Input, {
|
|
86
|
-
className: cn(
|
|
86
|
+
className: cn("flex-1 rounded-none border-0 bg-transparent px-3 py-1 shadow-none focus-visible:ring-0 dark:bg-transparent", className),
|
|
87
87
|
"data-slot": "input-group-control",
|
|
88
88
|
...props
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
function InputGroupTextarea({ className, ...props }) {
|
|
92
92
|
return /*#__PURE__*/ jsx(Textarea, {
|
|
93
|
-
className: cn(
|
|
93
|
+
className: cn("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent", className),
|
|
94
94
|
"data-slot": "input-group-control",
|
|
95
95
|
...props
|
|
96
96
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as InputNumberPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as InputNumberPrimitive from "../primitives/input-number";
|
|
3
3
|
interface InputNumberProps extends ComponentProps<typeof InputNumberPrimitive.Field>, ComponentProps<typeof InputNumberPrimitive.Root> {
|
|
4
4
|
}
|
|
5
5
|
declare function InputNumber({ ariaDecrementLabel, ariaIncrementLabel, className, defaultValue, disabled, formatOptions, id, loaderPosition, loading, max, min, onChange, prefix, readOnly, spinner, step, suffix, value, ...props }: InputNumberProps): JSX.Element;
|
|
@@ -9,7 +9,7 @@ function InputNumber({ ariaDecrementLabel, ariaIncrementLabel, className, defaul
|
|
|
9
9
|
return /*#__PURE__*/ jsxs(Root, {
|
|
10
10
|
ariaDecrementLabel: ariaDecrementLabel,
|
|
11
11
|
ariaIncrementLabel: ariaIncrementLabel,
|
|
12
|
-
className: cn("group border-input
|
|
12
|
+
className: cn("group peer flex h-9 w-full grow items-center gap-3 rounded-lg border border-input px-3 pr-0 text-base transition not-has-disabled:shadow-xs focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 hover:not-has-disabled:not-focus-within:border-ring/60 has-disabled:opacity-50 has-aria-invalid:border-destructive focus-within:has-aria-invalid:ring-destructive/20 hover:not-has-disabled:not-focus-within:has-aria-invalid:border-destructive/60 md:text-sm dark:bg-input/30 dark:focus-within:has-aria-invalid:ring-destructive/40 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&>svg]:text-muted-foreground", className),
|
|
13
13
|
"data-slot": "input-number",
|
|
14
14
|
defaultValue: defaultValue,
|
|
15
15
|
disabled: disabled,
|
|
@@ -31,19 +31,19 @@ function InputNumber({ ariaDecrementLabel, ariaIncrementLabel, className, defaul
|
|
|
31
31
|
autoCapitalize: "none",
|
|
32
32
|
autoComplete: "off",
|
|
33
33
|
autoCorrect: "off",
|
|
34
|
-
className: "
|
|
34
|
+
className: "h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
35
35
|
spellCheck: "false",
|
|
36
36
|
...props
|
|
37
37
|
}),
|
|
38
38
|
/*#__PURE__*/ jsxs("div", {
|
|
39
|
-
className: cn(
|
|
39
|
+
className: cn("group-hover:not-group-focus-within:not-has-disabled:border-l-border-ring/60 group-hover:not-group-focus-within:not-has-disabled:divide-border-ring/60 order-last ml-auto grid h-full shrink-0 divide-y divide-input border-l border-l-input transition group-focus-within:divide-ring group-focus-within:border-l-ring group-has-aria-invalid:divide-destructive group-has-aria-invalid:border-l-destructive group-hover:group-has-aria-invalid:not-group-focus-within:not-has-disabled:divide-destructive/60 group-hover:group-has-aria-invalid:not-group-focus-within:not-has-disabled:border-l-destructive/60", "*:[button]:focus-visible:bg-ring/50 *:[button]:focus-visible:ring-0 group-has-aria-invalid:*:[button]:focus-visible:bg-destructive/20 dark:group-has-aria-invalid:*:[button]:focus-visible:bg-destructive/40"),
|
|
40
40
|
"data-slot": "input-number-buttons",
|
|
41
41
|
children: [
|
|
42
42
|
/*#__PURE__*/ jsx(IncrementButton, {
|
|
43
43
|
"aria-label": "Increment",
|
|
44
44
|
className: buttonVariants({
|
|
45
|
-
className:
|
|
46
|
-
variant:
|
|
45
|
+
className: "text-muted-foreground h-auto rounded-none rounded-tr-[calc(var(--radius-lg)-1px)]",
|
|
46
|
+
variant: "ghost"
|
|
47
47
|
}),
|
|
48
48
|
"data-slot": "input-number-increment-button",
|
|
49
49
|
children: /*#__PURE__*/ jsx(ChevronUpIcon, {})
|
|
@@ -51,8 +51,8 @@ function InputNumber({ ariaDecrementLabel, ariaIncrementLabel, className, defaul
|
|
|
51
51
|
/*#__PURE__*/ jsx(DecrementButton, {
|
|
52
52
|
"aria-label": "Decrement",
|
|
53
53
|
className: buttonVariants({
|
|
54
|
-
className:
|
|
55
|
-
variant:
|
|
54
|
+
className: "text-muted-foreground h-auto rounded-none rounded-br-[calc(var(--radius-lg)-1px)]",
|
|
55
|
+
variant: "ghost"
|
|
56
56
|
}),
|
|
57
57
|
"data-slot": "input-number-decrement-button",
|
|
58
58
|
children: /*#__PURE__*/ jsx(ChevronDownIcon, {})
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import { OTPInput } from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import { OTPInput } from "input-otp";
|
|
3
3
|
type InputOTPProps = ComponentProps<typeof OTPInput>;
|
|
4
4
|
declare function InputOTP({ className, containerClassName, ...props }: InputOTPProps): JSX.Element;
|
|
5
|
-
type InputOTPGroupProps = ComponentProps<
|
|
5
|
+
type InputOTPGroupProps = ComponentProps<"div">;
|
|
6
6
|
declare function InputOTPGroup({ className, ...props }: InputOTPGroupProps): JSX.Element;
|
|
7
|
-
interface InputOTPSlotProps extends ComponentProps<
|
|
7
|
+
interface InputOTPSlotProps extends ComponentProps<"div"> {
|
|
8
8
|
index: number;
|
|
9
9
|
}
|
|
10
10
|
declare function InputOTPSlot({ className, index, ...props }: InputOTPSlotProps): JSX.Element;
|
|
11
|
-
type InputOTPSeparatorProps = ComponentProps<
|
|
11
|
+
type InputOTPSeparatorProps = ComponentProps<"div">;
|
|
12
12
|
declare function InputOTPSeparator({ ...props }: InputOTPSeparatorProps): JSX.Element;
|
|
13
|
-
export { REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from
|
|
13
|
+
export { REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
|
|
14
14
|
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
15
15
|
export type { InputOTPGroupProps, InputOTPProps, InputOTPSeparatorProps, InputOTPSlotProps };
|
|
@@ -8,14 +8,14 @@ function InputOTP({ className, containerClassName, ...props }) {
|
|
|
8
8
|
return /*#__PURE__*/ jsx(OTPInput, {
|
|
9
9
|
"aria-label": "One-time password",
|
|
10
10
|
className: cn(className),
|
|
11
|
-
containerClassName: cn(
|
|
11
|
+
containerClassName: cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName),
|
|
12
12
|
"data-slot": "input-otp",
|
|
13
13
|
...props
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
function InputOTPGroup({ className, ...props }) {
|
|
17
17
|
return /*#__PURE__*/ jsx("div", {
|
|
18
|
-
className: cn(
|
|
18
|
+
className: cn("flex items-center -space-x-px", className),
|
|
19
19
|
"data-slot": "input-otp-group",
|
|
20
20
|
role: "group",
|
|
21
21
|
...props
|
|
@@ -25,7 +25,7 @@ function InputOTPSlot({ className, index, ...props }) {
|
|
|
25
25
|
const inputOTPContext = use(OTPInputContext);
|
|
26
26
|
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
27
27
|
return /*#__PURE__*/ jsxs("div", {
|
|
28
|
-
className: cn(
|
|
28
|
+
className: cn("relative flex size-9 items-center justify-center border border-input text-sm outline-hidden transition-all not-has-disabled:shadow-xs first:rounded-l-lg last:rounded-r-lg aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-3 data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40", className),
|
|
29
29
|
"data-active": isActive,
|
|
30
30
|
"data-slot": "input-otp-slot",
|
|
31
31
|
...props,
|
|
@@ -34,7 +34,7 @@ function InputOTPSlot({ className, index, ...props }) {
|
|
|
34
34
|
hasFakeCaret ? /*#__PURE__*/ jsx("div", {
|
|
35
35
|
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
36
36
|
children: /*#__PURE__*/ jsx("div", {
|
|
37
|
-
className: "animate-caret-blink bg-foreground animation-duration-1000
|
|
37
|
+
className: "h-4 w-px animate-caret-blink bg-foreground animation-duration-1000"
|
|
38
38
|
})
|
|
39
39
|
}) : null
|
|
40
40
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import { InputGroupInput } from
|
|
3
|
-
type InputPasswordProps = Omit<ComponentProps<typeof InputGroupInput>,
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import { InputGroupInput } from "./input-group";
|
|
3
|
+
type InputPasswordProps = Omit<ComponentProps<typeof InputGroupInput>, "type">;
|
|
4
4
|
declare function InputPassword({ className, disabled, readOnly, ...props }: InputPasswordProps): JSX.Element;
|
|
5
5
|
export { InputPassword };
|
|
6
6
|
export type { InputPasswordProps };
|
|
@@ -4,13 +4,13 @@ import { EyeIcon, EyeOffIcon } from "lucide-react";
|
|
|
4
4
|
import { useCallback, useState } from "react";
|
|
5
5
|
import { InputGroup, InputGroupButton, InputGroupInput } from "./input-group.js";
|
|
6
6
|
function InputPassword({ className, disabled, readOnly, ...props }) {
|
|
7
|
-
const [type, setType] = useState(
|
|
7
|
+
const [type, setType] = useState("password");
|
|
8
8
|
const togglePasswordVisibility = useCallback(()=>{
|
|
9
|
-
setType((previous)=>
|
|
9
|
+
setType((previous)=>"password" === previous ? "text" : "password");
|
|
10
10
|
}, []);
|
|
11
11
|
return /*#__PURE__*/ jsxs(InputGroup, {
|
|
12
12
|
className: className,
|
|
13
|
-
"data-disabled": disabled ?
|
|
13
|
+
"data-disabled": disabled ? "true" : void 0,
|
|
14
14
|
"data-slot": "input-password",
|
|
15
15
|
children: [
|
|
16
16
|
/*#__PURE__*/ jsx(InputGroupInput, {
|
|
@@ -22,15 +22,15 @@ function InputPassword({ className, disabled, readOnly, ...props }) {
|
|
|
22
22
|
...props
|
|
23
23
|
}),
|
|
24
24
|
/*#__PURE__*/ jsx(InputGroupButton, {
|
|
25
|
-
"aria-label":
|
|
26
|
-
className: "focus-visible:not-disabled:bg-input
|
|
25
|
+
"aria-label": "password" === type ? "Show password" : "Hide password",
|
|
26
|
+
className: "rounded-full focus-visible:ring-0 focus-visible:not-disabled:bg-input",
|
|
27
27
|
"data-slot": "input-password-toggle",
|
|
28
28
|
disabled: disabled,
|
|
29
29
|
size: "icon-sm",
|
|
30
30
|
type: "button",
|
|
31
31
|
variant: "ghost",
|
|
32
32
|
onClick: togglePasswordVisibility,
|
|
33
|
-
children:
|
|
33
|
+
children: "password" === type ? /*#__PURE__*/ jsx(EyeOffIcon, {}) : /*#__PURE__*/ jsx(EyeIcon, {})
|
|
34
34
|
})
|
|
35
35
|
]
|
|
36
36
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import { InputGroupInput } from
|
|
3
|
-
interface InputSearchProps extends Omit<ComponentProps<typeof InputGroupInput>,
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import { InputGroupInput } from "./input-group";
|
|
3
|
+
interface InputSearchProps extends Omit<ComponentProps<typeof InputGroupInput>, "defaultValue" | "onChange" | "type" | "value"> {
|
|
4
4
|
defaultValue?: string;
|
|
5
5
|
onChange?: (value?: string) => void;
|
|
6
6
|
value?: string;
|
|
@@ -11,7 +11,7 @@ function InputSearch({ className, defaultValue, disabled, onChange, readOnly, va
|
|
|
11
11
|
});
|
|
12
12
|
return /*#__PURE__*/ jsxs(InputGroup, {
|
|
13
13
|
className: className,
|
|
14
|
-
"data-disabled": disabled ?
|
|
14
|
+
"data-disabled": disabled ? "true" : void 0,
|
|
15
15
|
"data-slot": "input-search",
|
|
16
16
|
children: [
|
|
17
17
|
/*#__PURE__*/ jsx(InputGroupAddon, {
|
|
@@ -23,7 +23,7 @@ function InputSearch({ className, defaultValue, disabled, onChange, readOnly, va
|
|
|
23
23
|
disabled: disabled,
|
|
24
24
|
readOnly: readOnly,
|
|
25
25
|
type: "search",
|
|
26
|
-
value: value ??
|
|
26
|
+
value: value ?? "",
|
|
27
27
|
onChange: (event)=>{
|
|
28
28
|
setValue(event.target.value);
|
|
29
29
|
},
|
|
@@ -31,13 +31,13 @@ function InputSearch({ className, defaultValue, disabled, onChange, readOnly, va
|
|
|
31
31
|
}),
|
|
32
32
|
value ? /*#__PURE__*/ jsx(InputGroupButton, {
|
|
33
33
|
"aria-label": "Clear search",
|
|
34
|
-
className: "focus-visible:not-disabled:bg-input
|
|
34
|
+
className: "rounded-full focus-visible:ring-0 focus-visible:not-disabled:bg-input",
|
|
35
35
|
"data-slot": "input-search-clear",
|
|
36
36
|
disabled: disabled ?? readOnly,
|
|
37
37
|
size: "icon-sm",
|
|
38
38
|
variant: "ghost",
|
|
39
39
|
onClick: ()=>{
|
|
40
|
-
setValue(
|
|
40
|
+
setValue("");
|
|
41
41
|
},
|
|
42
42
|
children: /*#__PURE__*/ jsx(XIcon, {})
|
|
43
43
|
}) : null
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
type InputProps = ComponentProps<
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
type InputProps = ComponentProps<"input">;
|
|
3
3
|
declare function Input({ className, type, ...props }: InputProps): JSX.Element;
|
|
4
4
|
export { Input };
|
|
5
5
|
export type { InputProps };
|
package/dist/components/input.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { cn } from "@codefast/tailwind-variants";
|
|
4
4
|
function Input({ className, type, ...props }) {
|
|
5
5
|
return /*#__PURE__*/ jsx("input", {
|
|
6
|
-
className: cn(
|
|
6
|
+
className: cn("h-9 w-full min-w-0 rounded-lg border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", className),
|
|
7
7
|
"data-slot": "input",
|
|
8
8
|
type: type,
|
|
9
9
|
...props
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import { Separator } from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import { Separator } from "./separator";
|
|
4
4
|
declare const itemVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
5
5
|
size: {
|
|
6
6
|
default: string;
|
|
@@ -19,27 +19,27 @@ declare const itemMediaVariants: import("@codefast/tailwind-variants").VariantFu
|
|
|
19
19
|
image: string;
|
|
20
20
|
};
|
|
21
21
|
}, Record<string, never>>;
|
|
22
|
-
type ItemGroupProps = ComponentProps<
|
|
22
|
+
type ItemGroupProps = ComponentProps<"div">;
|
|
23
23
|
declare function ItemGroup({ className, ...props }: ItemGroupProps): JSX.Element;
|
|
24
24
|
type ItemSeparatorProps = ComponentProps<typeof Separator>;
|
|
25
25
|
declare function ItemSeparator({ className, ...props }: ItemSeparatorProps): JSX.Element;
|
|
26
|
-
type ItemProps = ComponentProps<
|
|
26
|
+
type ItemProps = ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
|
|
27
27
|
asChild?: boolean;
|
|
28
28
|
};
|
|
29
29
|
declare function Item({ asChild, className, size, variant, ...props }: ItemProps): JSX.Element;
|
|
30
|
-
type ItemMediaProps = ComponentProps<
|
|
30
|
+
type ItemMediaProps = ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>;
|
|
31
31
|
declare function ItemMedia({ className, variant, ...props }: ItemMediaProps): JSX.Element;
|
|
32
|
-
type ItemContentProps = ComponentProps<
|
|
32
|
+
type ItemContentProps = ComponentProps<"div">;
|
|
33
33
|
declare function ItemContent({ className, ...props }: ItemContentProps): JSX.Element;
|
|
34
|
-
type ItemTitleProps = ComponentProps<
|
|
34
|
+
type ItemTitleProps = ComponentProps<"div">;
|
|
35
35
|
declare function ItemTitle({ className, ...props }: ItemTitleProps): JSX.Element;
|
|
36
|
-
type ItemDescriptionProps = ComponentProps<
|
|
36
|
+
type ItemDescriptionProps = ComponentProps<"p">;
|
|
37
37
|
declare function ItemDescription({ className, ...props }: ItemDescriptionProps): JSX.Element;
|
|
38
|
-
type ItemActionsProps = ComponentProps<
|
|
38
|
+
type ItemActionsProps = ComponentProps<"div">;
|
|
39
39
|
declare function ItemActions({ className, ...props }: ItemActionsProps): JSX.Element;
|
|
40
|
-
type ItemHeaderProps = ComponentProps<
|
|
40
|
+
type ItemHeaderProps = ComponentProps<"div">;
|
|
41
41
|
declare function ItemHeader({ className, ...props }: ItemHeaderProps): JSX.Element;
|
|
42
|
-
type ItemFooterProps = ComponentProps<
|
|
42
|
+
type ItemFooterProps = ComponentProps<"div">;
|
|
43
43
|
declare function ItemFooter({ className, ...props }: ItemFooterProps): JSX.Element;
|
|
44
44
|
export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, itemMediaVariants, ItemSeparator, ItemTitle, itemVariants, };
|
|
45
45
|
export type { ItemActionsProps, ItemContentProps, ItemDescriptionProps, ItemFooterProps, ItemGroupProps, ItemHeaderProps, ItemMediaProps, ItemProps, ItemSeparatorProps, ItemTitleProps, };
|