@moldable-ai/ui 0.2.0 → 0.2.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/dist/components/ui/accordion.d.ts +2 -2
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion.js +7 -6
- package/dist/components/ui/alert-dialog.d.ts +4 -4
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +11 -10
- package/dist/components/ui/alert.d.ts +5 -5
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +9 -8
- package/dist/components/ui/aspect-ratio.d.ts +1 -1
- package/dist/components/ui/aspect-ratio.js +2 -2
- package/dist/components/ui/avatar.d.ts +2 -2
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar.js +6 -5
- package/dist/components/ui/badge.d.ts +3 -3
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +11 -10
- package/dist/components/ui/breadcrumb.d.ts +8 -8
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.js +11 -10
- package/dist/components/ui/button-group.d.ts +4 -4
- package/dist/components/ui/button-group.d.ts.map +1 -1
- package/dist/components/ui/button-group.js +12 -11
- package/dist/components/ui/button.d.ts +3 -3
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +20 -19
- package/dist/components/ui/calendar.d.ts +4 -4
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +45 -45
- package/dist/components/ui/card.d.ts +8 -8
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +9 -8
- package/dist/components/ui/carousel.d.ts +7 -7
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js +26 -25
- package/dist/components/ui/chart.d.ts +7 -7
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +37 -37
- package/dist/components/ui/checkbox.d.ts +2 -2
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +5 -5
- package/dist/components/ui/collapsible.d.ts +1 -1
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +2 -1
- package/dist/components/ui/command.d.ts +4 -4
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +14 -13
- package/dist/components/ui/context-menu.d.ts +4 -4
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +14 -14
- package/dist/components/ui/dialog.d.ts +4 -4
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +10 -9
- package/dist/components/ui/drawer.d.ts +4 -4
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js +9 -9
- package/dist/components/ui/dropdown-menu.d.ts +4 -4
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +14 -13
- package/dist/components/ui/empty.d.ts +7 -7
- package/dist/components/ui/empty.d.ts.map +1 -1
- package/dist/components/ui/empty.js +12 -11
- package/dist/components/ui/field.d.ts +12 -12
- package/dist/components/ui/field.d.ts.map +1 -1
- package/dist/components/ui/field.js +26 -25
- package/dist/components/ui/form.d.ts +7 -7
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/form.js +12 -12
- package/dist/components/ui/hover-card.d.ts +2 -2
- package/dist/components/ui/hover-card.d.ts.map +1 -1
- package/dist/components/ui/hover-card.js +5 -5
- package/dist/components/ui/input-group.d.ts +9 -9
- package/dist/components/ui/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group.js +27 -27
- package/dist/components/ui/input-otp.d.ts +5 -5
- package/dist/components/ui/input-otp.d.ts.map +1 -1
- package/dist/components/ui/input-otp.js +8 -7
- package/dist/components/ui/input.d.ts +2 -2
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +3 -2
- package/dist/components/ui/item.d.ts +12 -12
- package/dist/components/ui/item.d.ts.map +1 -1
- package/dist/components/ui/item.js +28 -27
- package/dist/components/ui/kbd.d.ts +2 -2
- package/dist/components/ui/kbd.d.ts.map +1 -1
- package/dist/components/ui/kbd.js +4 -3
- package/dist/components/ui/label.d.ts +2 -2
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +4 -4
- package/dist/components/ui/menubar.d.ts +4 -4
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar.js +17 -16
- package/dist/components/ui/navigation-menu.d.ts +2 -2
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +14 -13
- package/dist/components/ui/pagination.d.ts +7 -7
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js +12 -11
- package/dist/components/ui/popover.d.ts +2 -2
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +5 -5
- package/dist/components/ui/progress.d.ts +2 -2
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +4 -3
- package/dist/components/ui/radio-group.d.ts +2 -2
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +6 -6
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js +1 -0
- package/dist/components/ui/scroll-area.d.ts +2 -2
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +8 -8
- package/dist/components/ui/select.d.ts +3 -3
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +15 -14
- package/dist/components/ui/separator.d.ts +2 -2
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/separator.js +5 -5
- package/dist/components/ui/sheet.d.ts +5 -5
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +15 -14
- package/dist/components/ui/sidebar.d.ts +31 -31
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +79 -79
- package/dist/components/ui/skeleton.d.ts +1 -1
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/skeleton.js +3 -2
- package/dist/components/ui/slider.d.ts +2 -2
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/slider.js +5 -5
- package/dist/components/ui/sonner.d.ts +1 -1
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/sonner.js +9 -8
- package/dist/components/ui/spinner.d.ts +1 -1
- package/dist/components/ui/spinner.d.ts.map +1 -1
- package/dist/components/ui/spinner.js +4 -3
- package/dist/components/ui/switch.d.ts +2 -2
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +4 -4
- package/dist/components/ui/table.d.ts +9 -9
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +10 -9
- package/dist/components/ui/tabs.d.ts +2 -2
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +7 -7
- package/dist/components/ui/textarea.d.ts +2 -2
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +3 -2
- package/dist/components/ui/toggle-group.d.ts +4 -4
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +9 -8
- package/dist/components/ui/toggle.d.ts +3 -3
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/toggle.js +11 -10
- package/dist/components/ui/tooltip.d.ts +2 -2
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +4 -4
- package/dist/hooks/use-mobile.js +3 -3
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
declare function FieldSet({ className, ...props }: React.ComponentProps<
|
|
4
|
-
declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<
|
|
5
|
-
variant?:
|
|
1
|
+
import { Label } from './label';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare function FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<'legend'> & {
|
|
5
|
+
variant?: 'legend' | 'label';
|
|
6
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare function FieldGroup({ className, ...props }: React.ComponentProps<
|
|
7
|
+
declare function FieldGroup({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
declare const fieldVariants: (props?: ({
|
|
9
9
|
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
10
10
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
-
declare function Field({ className, orientation, ...props }: React.ComponentProps<
|
|
12
|
-
declare function FieldContent({ className, ...props }: React.ComponentProps<
|
|
11
|
+
declare function Field({ className, orientation, ...props }: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function FieldContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
declare function FieldTitle({ className, ...props }: React.ComponentProps<
|
|
15
|
-
declare function FieldDescription({ className, ...props }: React.ComponentProps<
|
|
16
|
-
declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<
|
|
14
|
+
declare function FieldTitle({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function FieldDescription({ className, ...props }: React.ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<'div'> & {
|
|
17
17
|
children?: React.ReactNode;
|
|
18
18
|
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<
|
|
19
|
+
declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<'div'> & {
|
|
20
20
|
errors?: Array<{
|
|
21
21
|
message?: string;
|
|
22
22
|
} | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../src/components/ui/field.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../src/components/ui/field.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAEjE,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,2CAY1E;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,OAAkB,EAClB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;CAAE,2CAcnE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWvE;AAED,QAAA,MAAM,aAAa;;8EAsBlB,CAAA;AAED,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,WAAwB,EACxB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,2CAUlE;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWzE;AAED,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,2CAapC;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWvE;AAED,iBAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,2CAa3E;AAED,iBAAS,cAAc,CAAC,EACtB,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,2CAsBA;AAED,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,QAAQ,EACR,MAAM,EACN,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC,CAAA;CACjD,kDA0CA;AAED,OAAO,EACL,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,UAAU,GACX,CAAA"}
|
|
@@ -1,55 +1,56 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
import { Label } from './label';
|
|
6
|
+
import { Separator } from './separator';
|
|
7
|
+
import { cva } from 'class-variance-authority';
|
|
7
8
|
function FieldSet({ className, ...props }) {
|
|
8
|
-
return (_jsx("fieldset", { "data-slot": "field-set", className: cn(
|
|
9
|
+
return (_jsx("fieldset", { "data-slot": "field-set", className: cn('flex flex-col gap-6', 'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3', className), ...props }));
|
|
9
10
|
}
|
|
10
|
-
function FieldLegend({ className, variant =
|
|
11
|
-
return (_jsx("legend", { "data-slot": "field-legend", "data-variant": variant, className: cn(
|
|
11
|
+
function FieldLegend({ className, variant = 'legend', ...props }) {
|
|
12
|
+
return (_jsx("legend", { "data-slot": "field-legend", "data-variant": variant, className: cn('mb-3 font-medium', 'data-[variant=legend]:text-base', 'data-[variant=label]:text-sm', className), ...props }));
|
|
12
13
|
}
|
|
13
14
|
function FieldGroup({ className, ...props }) {
|
|
14
|
-
return (_jsx("div", { "data-slot": "field-group", className: cn(
|
|
15
|
+
return (_jsx("div", { "data-slot": "field-group", className: cn('group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4', className), ...props }));
|
|
15
16
|
}
|
|
16
|
-
const fieldVariants = cva(
|
|
17
|
+
const fieldVariants = cva('group/field flex w-full gap-3 data-[invalid=true]:text-destructive', {
|
|
17
18
|
variants: {
|
|
18
19
|
orientation: {
|
|
19
|
-
vertical: [
|
|
20
|
+
vertical: ['flex-col [&>*]:w-full [&>.sr-only]:w-auto'],
|
|
20
21
|
horizontal: [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
'flex-row items-center',
|
|
23
|
+
'[&>[data-slot=field-label]]:flex-auto',
|
|
24
|
+
'has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
|
|
24
25
|
],
|
|
25
26
|
responsive: [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
'flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto',
|
|
28
|
+
'@md/field-group:[&>[data-slot=field-label]]:flex-auto',
|
|
29
|
+
'@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
|
|
29
30
|
],
|
|
30
31
|
},
|
|
31
32
|
},
|
|
32
33
|
defaultVariants: {
|
|
33
|
-
orientation:
|
|
34
|
+
orientation: 'vertical',
|
|
34
35
|
},
|
|
35
36
|
});
|
|
36
|
-
function Field({ className, orientation =
|
|
37
|
+
function Field({ className, orientation = 'vertical', ...props }) {
|
|
37
38
|
return (_jsx("div", { role: "group", "data-slot": "field", "data-orientation": orientation, className: cn(fieldVariants({ orientation }), className), ...props }));
|
|
38
39
|
}
|
|
39
40
|
function FieldContent({ className, ...props }) {
|
|
40
|
-
return (_jsx("div", { "data-slot": "field-content", className: cn(
|
|
41
|
+
return (_jsx("div", { "data-slot": "field-content", className: cn('group/field-content flex flex-1 flex-col gap-1.5 leading-snug', className), ...props }));
|
|
41
42
|
}
|
|
42
43
|
function FieldLabel({ className, ...props }) {
|
|
43
|
-
return (_jsx(Label, { "data-slot": "field-label", className: cn(
|
|
44
|
+
return (_jsx(Label, { "data-slot": "field-label", className: cn('group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50', 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4', 'has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10', className), ...props }));
|
|
44
45
|
}
|
|
45
46
|
function FieldTitle({ className, ...props }) {
|
|
46
|
-
return (_jsx("div", { "data-slot": "field-label", className: cn(
|
|
47
|
+
return (_jsx("div", { "data-slot": "field-label", className: cn('flex w-fit items-center gap-2 text-sm font-medium leading-snug group-data-[disabled=true]/field:opacity-50', className), ...props }));
|
|
47
48
|
}
|
|
48
49
|
function FieldDescription({ className, ...props }) {
|
|
49
|
-
return (_jsx("p", { "data-slot": "field-description", className: cn(
|
|
50
|
+
return (_jsx("p", { "data-slot": "field-description", className: cn('text-muted-foreground text-sm font-normal leading-normal group-has-[[data-orientation=horizontal]]/field:text-balance', 'nth-last-2:-mt-1 last:mt-0 [[data-variant=legend]+&]:-mt-1.5', '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4', className), ...props }));
|
|
50
51
|
}
|
|
51
52
|
function FieldSeparator({ children, className, ...props }) {
|
|
52
|
-
return (_jsxs("div", { "data-slot": "field-separator", "data-content": !!children, className: cn(
|
|
53
|
+
return (_jsxs("div", { "data-slot": "field-separator", "data-content": !!children, className: cn('relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2', className), ...props, children: [_jsx(Separator, { className: "absolute inset-0 top-1/2" }), children && (_jsx("span", { className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2", "data-slot": "field-separator-content", children: children }))] }));
|
|
53
54
|
}
|
|
54
55
|
function FieldError({ className, children, errors, ...props }) {
|
|
55
56
|
const content = useMemo(() => {
|
|
@@ -70,6 +71,6 @@ function FieldError({ className, children, errors, ...props }) {
|
|
|
70
71
|
if (!content) {
|
|
71
72
|
return null;
|
|
72
73
|
}
|
|
73
|
-
return (_jsx("div", { role: "alert", "data-slot": "field-error", className: cn(
|
|
74
|
+
return (_jsx("div", { role: "alert", "data-slot": "field-error", className: cn('text-destructive text-sm font-normal', className), ...props, children: content }));
|
|
74
75
|
}
|
|
75
76
|
export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { type ControllerProps, type FieldPath, type FieldValues } from
|
|
1
|
+
import type * as LabelPrimitive from '@radix-ui/react-label';
|
|
2
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { type ControllerProps, type FieldPath, type FieldValues } from 'react-hook-form';
|
|
5
5
|
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
6
6
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
declare const useFormField: () => {
|
|
@@ -16,10 +16,10 @@ declare const useFormField: () => {
|
|
|
16
16
|
formDescriptionId: string;
|
|
17
17
|
formMessageId: string;
|
|
18
18
|
};
|
|
19
|
-
declare function FormItem({ className, ...props }: React.ComponentProps<
|
|
19
|
+
declare function FormItem({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
declare function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
declare function FormControl({ ...props }: React.ComponentProps<typeof Slot>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
declare function FormDescription({ className, ...props }: React.ComponentProps<
|
|
23
|
-
declare function FormMessage({ className, ...props }: React.ComponentProps<
|
|
22
|
+
declare function FormDescription({ className, ...props }: React.ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function FormMessage({ className, ...props }: React.ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element | null;
|
|
24
24
|
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|
|
25
25
|
//# sourceMappingURL=form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../src/components/ui/form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../src/components/ui/form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,cAAc,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,WAAW,EAIjB,MAAM,iBAAiB,CAAA;AAIxB,QAAA,MAAM,IAAI,4MAAe,CAAA;AAazB,QAAA,MAAM,SAAS,GACb,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,cAEC,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,4CAMtC,CAAA;AAED,QAAA,MAAM,YAAY;;;;;;;;;;;CAqBjB,CAAA;AAUD,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAYrE;AAED,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,2CAYlD;AAED,iBAAS,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,2CAgBnE;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,2CAW1E;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,kDAkBtE;AAED,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,eAAe,EACf,WAAW,EACX,SAAS,GACV,CAAA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { Controller, FormProvider, useFormContext, useFormState, } from
|
|
6
|
-
import { cn } from
|
|
7
|
-
import { Label } from
|
|
3
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { Controller, FormProvider, useFormContext, useFormState, } from 'react-hook-form';
|
|
6
|
+
import { cn } from '../../lib/utils';
|
|
7
|
+
import { Label } from './label';
|
|
8
8
|
const Form = FormProvider;
|
|
9
9
|
const FormFieldContext = React.createContext({});
|
|
10
10
|
const FormField = ({ ...props }) => {
|
|
@@ -17,7 +17,7 @@ const useFormField = () => {
|
|
|
17
17
|
const formState = useFormState({ name: fieldContext.name });
|
|
18
18
|
const fieldState = getFieldState(fieldContext.name, formState);
|
|
19
19
|
if (!fieldContext) {
|
|
20
|
-
throw new Error(
|
|
20
|
+
throw new Error('useFormField should be used within <FormField>');
|
|
21
21
|
}
|
|
22
22
|
const { id } = itemContext;
|
|
23
23
|
return {
|
|
@@ -32,11 +32,11 @@ const useFormField = () => {
|
|
|
32
32
|
const FormItemContext = React.createContext({});
|
|
33
33
|
function FormItem({ className, ...props }) {
|
|
34
34
|
const id = React.useId();
|
|
35
|
-
return (_jsx(FormItemContext.Provider, { value: { id }, children: _jsx("div", { "data-slot": "form-item", className: cn(
|
|
35
|
+
return (_jsx(FormItemContext.Provider, { value: { id }, children: _jsx("div", { "data-slot": "form-item", className: cn('grid gap-2', className), ...props }) }));
|
|
36
36
|
}
|
|
37
37
|
function FormLabel({ className, ...props }) {
|
|
38
38
|
const { error, formItemId } = useFormField();
|
|
39
|
-
return (_jsx(Label, { "data-slot": "form-label", "data-error": !!error, className: cn(
|
|
39
|
+
return (_jsx(Label, { "data-slot": "form-label", "data-error": !!error, className: cn('data-[error=true]:text-destructive', className), htmlFor: formItemId, ...props }));
|
|
40
40
|
}
|
|
41
41
|
function FormControl({ ...props }) {
|
|
42
42
|
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
@@ -46,14 +46,14 @@ function FormControl({ ...props }) {
|
|
|
46
46
|
}
|
|
47
47
|
function FormDescription({ className, ...props }) {
|
|
48
48
|
const { formDescriptionId } = useFormField();
|
|
49
|
-
return (_jsx("p", { "data-slot": "form-description", id: formDescriptionId, className: cn(
|
|
49
|
+
return (_jsx("p", { "data-slot": "form-description", id: formDescriptionId, className: cn('text-muted-foreground text-sm', className), ...props }));
|
|
50
50
|
}
|
|
51
51
|
function FormMessage({ className, ...props }) {
|
|
52
52
|
const { error, formMessageId } = useFormField();
|
|
53
|
-
const body = error ? String(error?.message ??
|
|
53
|
+
const body = error ? String(error?.message ?? '') : props.children;
|
|
54
54
|
if (!body) {
|
|
55
55
|
return null;
|
|
56
56
|
}
|
|
57
|
-
return (_jsx("p", { "data-slot": "form-message", id: formMessageId, className: cn(
|
|
57
|
+
return (_jsx("p", { "data-slot": "form-message", id: formMessageId, className: cn('text-destructive text-sm', className), ...props, children: body }));
|
|
58
58
|
}
|
|
59
59
|
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
declare function HoverCard({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare function HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare function HoverCardContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof HoverCardPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/hover-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/hover-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAA;AAChE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,iBAAS,SAAS,CAAC,EACjB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,2CAEtD;AAED,iBAAS,gBAAgB,CAAC,EACxB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,2CAIzD;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,KAAgB,EAChB,UAAc,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,2CAezD;AAED,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as HoverCardPrimitive from
|
|
4
|
-
import { cn } from
|
|
3
|
+
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
5
|
function HoverCard({ ...props }) {
|
|
6
6
|
return _jsx(HoverCardPrimitive.Root, { "data-slot": "hover-card", ...props });
|
|
7
7
|
}
|
|
8
8
|
function HoverCardTrigger({ ...props }) {
|
|
9
9
|
return (_jsx(HoverCardPrimitive.Trigger, { "data-slot": "hover-card-trigger", ...props }));
|
|
10
10
|
}
|
|
11
|
-
function HoverCardContent({ className, align =
|
|
12
|
-
return (_jsx(HoverCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: _jsx(HoverCardPrimitive.Content, { "data-slot": "hover-card-content", align: align, sideOffset: sideOffset, className: cn(
|
|
11
|
+
function HoverCardContent({ className, align = 'center', sideOffset = 4, ...props }) {
|
|
12
|
+
return (_jsx(HoverCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: _jsx(HoverCardPrimitive.Content, { "data-slot": "hover-card-content", align: align, sideOffset: sideOffset, className: cn('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-hover-card-content-transform-origin) outline-hidden z-50 w-64 rounded-md border p-4 shadow-md', className), ...props }) }));
|
|
13
13
|
}
|
|
14
14
|
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
declare function InputGroup({ className, ...props }: React.ComponentProps<
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button } from './button';
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
4
|
+
declare function InputGroup({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare const inputGroupAddonVariants: (props?: ({
|
|
6
6
|
align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
-
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<
|
|
8
|
+
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
declare const inputGroupButtonVariants: (props?: ({
|
|
10
10
|
size?: "sm" | "icon-sm" | "xs" | "icon-xs" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
-
declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>,
|
|
13
|
-
declare function InputGroupText({ className, ...props }: React.ComponentProps<
|
|
14
|
-
declare function InputGroupInput({ className, ...props }: React.ComponentProps<
|
|
15
|
-
declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<
|
|
12
|
+
declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, 'size'> & VariantProps<typeof inputGroupButtonVariants>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function InputGroupText({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function InputGroupInput({ className, ...props }: React.ComponentProps<'input'>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<'textarea'>): import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
|
|
17
17
|
//# sourceMappingURL=input-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../../src/components/ui/input-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../../src/components/ui/input-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAGjC,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAEjE,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CA0BvE;AAED,QAAA,MAAM,uBAAuB;;8EAmB5B,CAAA;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,KAAsB,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,uBAAuB,CAAC,2CAgB5E;AAED,QAAA,MAAM,wBAAwB;;8EAgB7B,CAAA;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,IAAe,EACf,OAAiB,EACjB,IAAW,EACX,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,MAAM,CAAC,GAClD,YAAY,CAAC,OAAO,wBAAwB,CAAC,2CAU9C;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,2CAU5E;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAW/B;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,2CAWlC;AAED,OAAO,EACL,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,GACnB,CAAA"}
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
import { Button } from './button';
|
|
5
|
+
import { Input } from './input';
|
|
6
|
+
import { Textarea } from './textarea';
|
|
7
|
+
import { cva } from 'class-variance-authority';
|
|
8
8
|
function InputGroup({ className, ...props }) {
|
|
9
|
-
return (_jsx("div", { "data-slot": "input-group", role: "group", className: cn(
|
|
9
|
+
return (_jsx("div", { "data-slot": "input-group", role: "group", className: cn('group/input-group border-input dark:bg-input/30 shadow-xs relative flex w-full items-center rounded-md border outline-none transition-[color,box-shadow]', 'h-9 min-w-0 has-[>textarea]:h-auto',
|
|
10
10
|
// Variants based on alignment.
|
|
11
|
-
|
|
11
|
+
'has-[>[data-align=inline-start]]:[&>input]:pl-2', 'has-[>[data-align=inline-end]]:[&>input]:pr-2', 'has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3', 'has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3',
|
|
12
12
|
// Focus state.
|
|
13
|
-
|
|
13
|
+
'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]',
|
|
14
14
|
// Error state.
|
|
15
|
-
|
|
15
|
+
'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', className), ...props }));
|
|
16
16
|
}
|
|
17
17
|
const inputGroupAddonVariants = cva("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", {
|
|
18
18
|
variants: {
|
|
19
19
|
align: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
'inline-start': 'order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]',
|
|
21
|
+
'inline-end': 'order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]',
|
|
22
|
+
'block-start': 'order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5',
|
|
23
|
+
'block-end': 'order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5',
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
defaultVariants: {
|
|
27
|
-
align:
|
|
27
|
+
align: 'inline-start',
|
|
28
28
|
},
|
|
29
29
|
});
|
|
30
|
-
function InputGroupAddon({ className, align =
|
|
30
|
+
function InputGroupAddon({ className, align = 'inline-start', ...props }) {
|
|
31
31
|
return (_jsx("div", { role: "group", "data-slot": "input-group-addon", "data-align": align, className: cn(inputGroupAddonVariants({ align }), className), onClick: (e) => {
|
|
32
|
-
if (e.target.closest(
|
|
32
|
+
if (e.target.closest('button')) {
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
-
e.currentTarget.parentElement?.querySelector(
|
|
35
|
+
e.currentTarget.parentElement?.querySelector('input')?.focus();
|
|
36
36
|
}, ...props }));
|
|
37
37
|
}
|
|
38
|
-
const inputGroupButtonVariants = cva(
|
|
38
|
+
const inputGroupButtonVariants = cva('text-sm shadow-none flex gap-2 items-center', {
|
|
39
39
|
variants: {
|
|
40
40
|
size: {
|
|
41
41
|
xs: "h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",
|
|
42
|
-
sm:
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
sm: 'h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5',
|
|
43
|
+
'icon-xs': 'size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0',
|
|
44
|
+
'icon-sm': 'size-8 p-0 has-[>svg]:p-0',
|
|
45
45
|
},
|
|
46
46
|
},
|
|
47
47
|
defaultVariants: {
|
|
48
|
-
size:
|
|
48
|
+
size: 'xs',
|
|
49
49
|
},
|
|
50
50
|
});
|
|
51
|
-
function InputGroupButton({ className, type =
|
|
51
|
+
function InputGroupButton({ className, type = 'button', variant = 'ghost', size = 'xs', ...props }) {
|
|
52
52
|
return (_jsx(Button, { type: type, "data-size": size, variant: variant, className: cn(inputGroupButtonVariants({ size }), className), ...props }));
|
|
53
53
|
}
|
|
54
54
|
function InputGroupText({ className, ...props }) {
|
|
55
|
-
return (_jsx("span", { className: cn("text-muted-foreground flex items-center gap-2 text-sm [&_svg
|
|
55
|
+
return (_jsx("span", { className: cn("text-muted-foreground flex items-center gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none", className), ...props }));
|
|
56
56
|
}
|
|
57
57
|
function InputGroupInput({ className, ...props }) {
|
|
58
|
-
return (_jsx(Input, { "data-slot": "input-group-control", className: cn(
|
|
58
|
+
return (_jsx(Input, { "data-slot": "input-group-control", className: cn('flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent', className), ...props }));
|
|
59
59
|
}
|
|
60
60
|
function InputGroupTextarea({ className, ...props }) {
|
|
61
|
-
return (_jsx(Textarea, { "data-slot": "input-group-control", className: cn(
|
|
61
|
+
return (_jsx(Textarea, { "data-slot": "input-group-control", className: cn('flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent', className), ...props }));
|
|
62
62
|
}
|
|
63
63
|
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { OTPInput } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { OTPInput } from 'input-otp';
|
|
3
3
|
declare function InputOTP({ className, containerClassName, ...props }: React.ComponentProps<typeof OTPInput> & {
|
|
4
4
|
containerClassName?: string;
|
|
5
5
|
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare function InputOTPGroup({ className, ...props }: React.ComponentProps<
|
|
7
|
-
declare function InputOTPSlot({ index, className, ...props }: React.ComponentProps<
|
|
6
|
+
declare function InputOTPGroup({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function InputOTPSlot({ index, className, ...props }: React.ComponentProps<'div'> & {
|
|
8
8
|
index: number;
|
|
9
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
declare function InputOTPSeparator({ ...props }: React.ComponentProps<
|
|
10
|
+
declare function InputOTPSeparator({ ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
|
|
12
12
|
//# sourceMappingURL=input-otp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-otp.d.ts","sourceRoot":"","sources":["../../../src/components/ui/input-otp.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"input-otp.d.ts","sourceRoot":"","sources":["../../../src/components/ui/input-otp.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,QAAQ,EAAmB,MAAM,WAAW,CAAA;AAErD,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,kBAAkB,EAClB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,GAAG;IACzC,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B,2CAYA;AAED,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQ1E;AAED,iBAAS,YAAY,CAAC,EACpB,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAA;CACd,2CAsBA;AAED,iBAAS,iBAAiB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAMnE;AAED,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { MinusIcon } from 'lucide-react';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
import { OTPInput, OTPInputContext } from 'input-otp';
|
|
6
7
|
function InputOTP({ className, containerClassName, ...props }) {
|
|
7
|
-
return (_jsx(OTPInput, { "data-slot": "input-otp", containerClassName: cn(
|
|
8
|
+
return (_jsx(OTPInput, { "data-slot": "input-otp", containerClassName: cn('flex items-center gap-2 has-disabled:opacity-50', containerClassName), className: cn('disabled:cursor-not-allowed', className), ...props }));
|
|
8
9
|
}
|
|
9
10
|
function InputOTPGroup({ className, ...props }) {
|
|
10
|
-
return (_jsx("div", { "data-slot": "input-otp-group", className: cn(
|
|
11
|
+
return (_jsx("div", { "data-slot": "input-otp-group", className: cn('flex items-center', className), ...props }));
|
|
11
12
|
}
|
|
12
13
|
function InputOTPSlot({ index, className, ...props }) {
|
|
13
14
|
const inputOTPContext = React.useContext(OTPInputContext);
|
|
14
15
|
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
15
|
-
return (_jsxs("div", { "data-slot": "input-otp-slot", "data-active": isActive, className: cn(
|
|
16
|
+
return (_jsxs("div", { "data-slot": "input-otp-slot", "data-active": isActive, className: cn('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 shadow-xs relative flex h-9 w-9 items-center justify-center border-y border-r text-sm outline-none transition-all first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]', className), ...props, children: [char, hasFakeCaret && (_jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: _jsx("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" }) }))] }));
|
|
16
17
|
}
|
|
17
18
|
function InputOTPSeparator({ ...props }) {
|
|
18
19
|
return (_jsx("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: _jsx(MinusIcon, {}) }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
declare function Input({ className, type, ...props }: React.ComponentProps<
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare function Input({ className, type, ...props }: React.ComponentProps<'input'>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export { Input };
|
|
4
4
|
//# sourceMappingURL=input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/ui/input.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/ui/input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAc1E;AAED,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
3
4
|
function Input({ className, type, ...props }) {
|
|
4
|
-
return (_jsx("input", { type: type, "data-slot": "input", className: cn(
|
|
5
|
+
return (_jsx("input", { type: type, "data-slot": "input", className: cn('file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input shadow-xs h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base outline-none transition-[color,box-shadow] 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', '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', className), ...props }));
|
|
5
6
|
}
|
|
6
7
|
export { Input };
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
declare function ItemGroup({ className, ...props }: React.ComponentProps<
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Separator } from './separator';
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
4
|
+
declare function ItemGroup({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare function ItemSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
declare const itemVariants: (props?: ({
|
|
7
7
|
variant?: "default" | "outline" | "muted" | null | undefined;
|
|
8
8
|
size?: "default" | "sm" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
-
declare function Item({ className, variant, size, asChild, ...props }: React.ComponentProps<
|
|
10
|
+
declare function Item({ className, variant, size, asChild, ...props }: React.ComponentProps<'div'> & VariantProps<typeof itemVariants> & {
|
|
11
11
|
asChild?: boolean;
|
|
12
12
|
}): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
declare const itemMediaVariants: (props?: ({
|
|
14
14
|
variant?: "image" | "default" | "icon" | null | undefined;
|
|
15
15
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
|
-
declare function ItemMedia({ className, variant, ...props }: React.ComponentProps<
|
|
17
|
-
declare function ItemContent({ className, ...props }: React.ComponentProps<
|
|
18
|
-
declare function ItemTitle({ className, ...props }: React.ComponentProps<
|
|
19
|
-
declare function ItemDescription({ className, ...props }: React.ComponentProps<
|
|
20
|
-
declare function ItemActions({ className, ...props }: React.ComponentProps<
|
|
21
|
-
declare function ItemHeader({ className, ...props }: React.ComponentProps<
|
|
22
|
-
declare function ItemFooter({ className, ...props }: React.ComponentProps<
|
|
16
|
+
declare function ItemMedia({ className, variant, ...props }: React.ComponentProps<'div'> & VariantProps<typeof itemMediaVariants>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function ItemContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare function ItemTitle({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function ItemDescription({ className, ...props }: React.ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function ItemActions({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function ItemHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare function ItemFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
export { Item, ItemMedia, ItemContent, ItemActions, ItemGroup, ItemSeparator, ItemTitle, ItemDescription, ItemHeader, ItemFooter, };
|
|
24
24
|
//# sourceMappingURL=item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../src/components/ui/item.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../src/components/ui/item.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAEjE,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAStE;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,2CASxC;AAED,QAAA,MAAM,YAAY;;;8EAmBjB,CAAA;AAED,iBAAS,IAAI,CAAC,EACZ,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,OAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAC5B,YAAY,CAAC,OAAO,YAAY,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,2CAW1D;AAED,QAAA,MAAM,iBAAiB;;8EAetB,CAAA;AAED,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,2CAStE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWxE;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWtE;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,2CAY1E;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQxE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWvE;AAED,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWvE;AAED,OAAO,EACL,IAAI,EACJ,SAAS,EACT,WAAW,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,SAAS,EACT,eAAe,EACf,UAAU,EACV,UAAU,GACX,CAAA"}
|