@cbrl/design 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +124 -2
- package/dist/components/alert-dialog.d.ts +14 -0
- package/dist/components/alert-dialog.js +82 -0
- package/dist/components/app-shell.d.ts +38 -0
- package/dist/components/app-shell.js +72 -0
- package/dist/components/auth-split-screen.d.ts +30 -0
- package/dist/components/auth-split-screen.js +45 -0
- package/dist/components/avatar.d.ts +11 -0
- package/dist/components/avatar.js +50 -0
- package/dist/components/badge.d.ts +9 -0
- package/dist/components/badge.js +27 -0
- package/dist/components/breadcrumb.d.ts +11 -0
- package/dist/components/breadcrumb.js +69 -0
- package/dist/components/button.d.ts +10 -0
- package/dist/components/button.js +47 -0
- package/dist/components/calendar.d.ts +7 -0
- package/dist/components/calendar.js +142 -0
- package/dist/components/card.d.ts +13 -0
- package/dist/components/card.js +57 -0
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.js +20 -0
- package/dist/components/collapsible.d.ts +5 -0
- package/dist/components/collapsible.js +23 -0
- package/dist/components/date-field.d.ts +31 -0
- package/dist/components/date-field.js +129 -0
- package/dist/components/dialog.d.ts +17 -0
- package/dist/components/dialog.js +95 -0
- package/dist/components/dropdown-menu.d.ts +29 -0
- package/dist/components/dropdown-menu.js +127 -0
- package/dist/components/empty-state.d.ts +32 -0
- package/dist/components/empty-state.js +61 -0
- package/dist/components/field.d.ts +25 -0
- package/dist/components/field.js +121 -0
- package/dist/components/highlighted-textarea.d.ts +6 -0
- package/dist/components/highlighted-textarea.js +68 -0
- package/dist/components/icons/brand-icon.d.ts +6 -0
- package/dist/components/icons/brand-icon.js +13 -0
- package/dist/components/icons/google-icon.d.ts +7 -0
- package/dist/components/icons/google-icon.js +33 -0
- package/dist/components/icons/whatsapp-icon.d.ts +7 -0
- package/dist/components/icons/whatsapp-icon.js +18 -0
- package/dist/components/input-group.d.ts +8 -0
- package/dist/components/input-group.js +28 -0
- package/dist/components/input.d.ts +3 -0
- package/dist/components/input.js +13 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.js +14 -0
- package/dist/components/list.d.ts +174 -0
- package/dist/components/list.js +281 -0
- package/dist/components/main.d.ts +10 -0
- package/dist/components/main.js +36 -0
- package/dist/components/pagination.d.ts +25 -0
- package/dist/components/pagination.js +104 -0
- package/dist/components/popover.d.ts +6 -0
- package/dist/components/popover.js +28 -0
- package/dist/components/radio-group.d.ts +5 -0
- package/dist/components/radio-group.js +27 -0
- package/dist/components/scroll-area.d.ts +5 -0
- package/dist/components/scroll-area.js +35 -0
- package/dist/components/select.d.ts +15 -0
- package/dist/components/select.js +95 -0
- package/dist/components/separator.d.ts +4 -0
- package/dist/components/separator.js +16 -0
- package/dist/components/setting-row.d.ts +8 -0
- package/dist/components/setting-row.js +36 -0
- package/dist/components/settings-section.d.ts +7 -0
- package/dist/components/settings-section.js +36 -0
- package/dist/components/sheet.d.ts +14 -0
- package/dist/components/sheet.js +89 -0
- package/dist/components/sidebar-core.d.ts +33 -0
- package/dist/components/sidebar-core.js +220 -0
- package/dist/components/sidebar-menu.d.ts +38 -0
- package/dist/components/sidebar-menu.js +168 -0
- package/dist/components/sidebar.d.ts +3 -0
- package/dist/components/skeleton.d.ts +2 -0
- package/dist/components/skeleton.js +11 -0
- package/dist/components/sonner.d.ts +3 -0
- package/dist/components/sonner.js +31 -0
- package/dist/components/stepper.d.ts +8 -0
- package/dist/components/stepper.js +58 -0
- package/dist/components/switch.d.ts +6 -0
- package/dist/components/switch.js +19 -0
- package/dist/components/table.d.ts +10 -0
- package/dist/components/table.js +65 -0
- package/dist/components/tabs.d.ts +7 -0
- package/dist/components/tabs.js +35 -0
- package/dist/components/textarea.d.ts +3 -0
- package/dist/components/textarea.js +12 -0
- package/dist/components/theme-provider.d.ts +15 -0
- package/dist/components/theme-provider.js +22 -0
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.js +35 -0
- package/dist/components/typography.d.ts +9 -0
- package/dist/components/typography.js +45 -0
- package/dist/components/user-menu.d.ts +27 -0
- package/dist/components/user-menu.js +49 -0
- package/dist/globals.css +60 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +17 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.js +51 -0
- package/dist/lib/cn.d.ts +2 -0
- package/dist/lib/cn.js +7 -0
- package/dist/lib/css-vars.js +5 -0
- package/dist/lib/date.js +38 -0
- package/dist/lib/initials.d.ts +8 -0
- package/dist/lib/initials.js +15 -0
- package/dist/lib/nav.d.ts +15 -0
- package/dist/lib/nav.js +11 -0
- package/dist/lib/toaster-theme.js +5 -0
- package/dist/shadcn.css +635 -0
- package/dist/tokens.css +160 -0
- package/package.json +85 -3
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { DropdownMenu as DropdownMenu$1 } from "radix-ui";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
7
|
+
// src/components/dropdown-menu.tsx
|
|
8
|
+
function DropdownMenu({ ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Root, {
|
|
10
|
+
"data-slot": "dropdown-menu",
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function DropdownMenuPortal({ ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Portal, {
|
|
16
|
+
"data-slot": "dropdown-menu-portal",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
21
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Trigger, {
|
|
22
|
+
"data-slot": "dropdown-menu-trigger",
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function DropdownMenuContent({ className, align = "start", sideOffset = 4, ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Portal, { children: /* @__PURE__ */ jsx(DropdownMenu$1.Content, {
|
|
28
|
+
"data-slot": "dropdown-menu-content",
|
|
29
|
+
sideOffset,
|
|
30
|
+
align,
|
|
31
|
+
className: cn("bg-popover text-popover-foreground ring-foreground/10 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg p-1 shadow-md ring-1 duration-100 data-[state=closed]:overflow-hidden", className),
|
|
32
|
+
...props
|
|
33
|
+
}) });
|
|
34
|
+
}
|
|
35
|
+
function DropdownMenuGroup({ ...props }) {
|
|
36
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Group, {
|
|
37
|
+
"data-slot": "dropdown-menu-group",
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Item, {
|
|
43
|
+
"data-slot": "dropdown-menu-item",
|
|
44
|
+
"data-inset": inset,
|
|
45
|
+
"data-variant": variant,
|
|
46
|
+
className: cn("group/dropdown-menu-item focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:*:[svg]:text-destructive relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
47
|
+
...props
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }) {
|
|
51
|
+
return /* @__PURE__ */ jsxs(DropdownMenu$1.CheckboxItem, {
|
|
52
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
53
|
+
"data-inset": inset,
|
|
54
|
+
className: cn("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
55
|
+
checked,
|
|
56
|
+
...props,
|
|
57
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
58
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
59
|
+
"data-slot": "dropdown-menu-checkbox-item-indicator",
|
|
60
|
+
children: /* @__PURE__ */ jsx(DropdownMenu$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
61
|
+
}), children]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function DropdownMenuRadioGroup({ ...props }) {
|
|
65
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.RadioGroup, {
|
|
66
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
67
|
+
...props
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function DropdownMenuRadioItem({ className, children, inset, ...props }) {
|
|
71
|
+
return /* @__PURE__ */ jsxs(DropdownMenu$1.RadioItem, {
|
|
72
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
73
|
+
"data-inset": inset,
|
|
74
|
+
className: cn("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
75
|
+
...props,
|
|
76
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
77
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
78
|
+
"data-slot": "dropdown-menu-radio-item-indicator",
|
|
79
|
+
children: /* @__PURE__ */ jsx(DropdownMenu$1.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
80
|
+
}), children]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
84
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Label, {
|
|
85
|
+
"data-slot": "dropdown-menu-label",
|
|
86
|
+
"data-inset": inset,
|
|
87
|
+
className: cn("text-muted-foreground px-1.5 py-1 text-xs font-medium data-inset:pl-7", className),
|
|
88
|
+
...props
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
92
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Separator, {
|
|
93
|
+
"data-slot": "dropdown-menu-separator",
|
|
94
|
+
className: cn("bg-border -mx-1 my-1 h-px", className),
|
|
95
|
+
...props
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
|
99
|
+
return /* @__PURE__ */ jsx("span", {
|
|
100
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
101
|
+
className: cn("text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-xs tracking-widest", className),
|
|
102
|
+
...props
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function DropdownMenuSub({ ...props }) {
|
|
106
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.Sub, {
|
|
107
|
+
"data-slot": "dropdown-menu-sub",
|
|
108
|
+
...props
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
112
|
+
return /* @__PURE__ */ jsxs(DropdownMenu$1.SubTrigger, {
|
|
113
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
114
|
+
"data-inset": inset,
|
|
115
|
+
className: cn("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-inset:pl-7 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
116
|
+
...props,
|
|
117
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })]
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
function DropdownMenuSubContent({ className, ...props }) {
|
|
121
|
+
return /* @__PURE__ */ jsx(DropdownMenu$1.SubContent, {
|
|
122
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
123
|
+
className: cn("bg-popover text-popover-foreground ring-foreground/10 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 z-50 min-w-[96px] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg p-1 shadow-lg ring-1 duration-100", className),
|
|
124
|
+
...props
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type EmptyStateAction = {
|
|
3
|
+
label: string;
|
|
4
|
+
} & ({
|
|
5
|
+
href: string;
|
|
6
|
+
onClick?: never;
|
|
7
|
+
} | {
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
href?: never;
|
|
10
|
+
});
|
|
11
|
+
type EmptyStateProps = React.ComponentProps<'div'> & {
|
|
12
|
+
/** Short, value-oriented headline — e.g. "Nenhuma unidade cadastrada". */
|
|
13
|
+
title: string;
|
|
14
|
+
/** Optional supporting copy that frames the value of creating the first item. */
|
|
15
|
+
description?: string;
|
|
16
|
+
/** Optional leading icon (typically a `lucide-react` glyph). */
|
|
17
|
+
icon?: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Primary call-to-action. Either a link (`href`) or a click handler
|
|
20
|
+
* (`onClick`) — never both. Rendered as a `Button`; when `href` is set the
|
|
21
|
+
* caller can wrap with their router's `<Link asChild>` via `actionAsChild`.
|
|
22
|
+
*/
|
|
23
|
+
action?: EmptyStateAction;
|
|
24
|
+
/**
|
|
25
|
+
* When the action uses `href`, render the Button `asChild` so the consumer
|
|
26
|
+
* can pass a framework `<Link>` as the single child instead of the label.
|
|
27
|
+
* Defaults to false (plain anchor via `<a href>`).
|
|
28
|
+
*/
|
|
29
|
+
actionSlot?: React.ReactNode;
|
|
30
|
+
};
|
|
31
|
+
declare function EmptyState({ title, description, icon, action, actionSlot, className, ...props }: EmptyStateProps): React.JSX.Element;
|
|
32
|
+
export { EmptyState, type EmptyStateProps };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { Button } from "./button.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
// src/components/empty-state.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Actionable empty state for list/CRUD surfaces: a value-oriented headline,
|
|
8
|
+
* optional supporting copy + icon, and a primary CTA that opens the real
|
|
9
|
+
* creation flow. Shared so every area renders the same affordance instead of a
|
|
10
|
+
* bare "Nenhum X cadastrado" line.
|
|
11
|
+
*/
|
|
12
|
+
function renderAction(action, actionSlot) {
|
|
13
|
+
if (actionSlot) return /* @__PURE__ */ jsx(Button, {
|
|
14
|
+
asChild: true,
|
|
15
|
+
className: "mt-1",
|
|
16
|
+
children: actionSlot
|
|
17
|
+
});
|
|
18
|
+
if (!action) return null;
|
|
19
|
+
if (action.href) return /* @__PURE__ */ jsx(Button, {
|
|
20
|
+
asChild: true,
|
|
21
|
+
className: "mt-1",
|
|
22
|
+
children: /* @__PURE__ */ jsx("a", {
|
|
23
|
+
href: action.href,
|
|
24
|
+
children: action.label
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
28
|
+
type: "button",
|
|
29
|
+
onClick: action.onClick,
|
|
30
|
+
className: "mt-1",
|
|
31
|
+
children: action.label
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function EmptyState({ title, description, icon, action, actionSlot, className, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
36
|
+
"data-slot": "empty-state",
|
|
37
|
+
className: cn("border-border bg-muted/20 flex w-full flex-col items-center gap-3 rounded-md border p-12 text-center", className),
|
|
38
|
+
...props,
|
|
39
|
+
children: [
|
|
40
|
+
icon ? /* @__PURE__ */ jsx("div", {
|
|
41
|
+
"data-slot": "empty-state-icon",
|
|
42
|
+
className: "text-muted-foreground [&_svg]:size-8",
|
|
43
|
+
children: icon
|
|
44
|
+
}) : null,
|
|
45
|
+
/* @__PURE__ */ jsxs("div", {
|
|
46
|
+
className: "flex flex-col gap-1",
|
|
47
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
48
|
+
"data-slot": "empty-state-title",
|
|
49
|
+
className: "text-foreground text-sm font-medium",
|
|
50
|
+
children: title
|
|
51
|
+
}), description ? /* @__PURE__ */ jsx("p", {
|
|
52
|
+
"data-slot": "empty-state-description",
|
|
53
|
+
className: "text-muted-foreground text-sm",
|
|
54
|
+
children: description
|
|
55
|
+
}) : null]
|
|
56
|
+
}),
|
|
57
|
+
renderAction(action, actionSlot)
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
export { EmptyState };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Label } from "./label.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
declare function FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>): React.JSX.Element;
|
|
5
|
+
declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<'legend'> & {
|
|
6
|
+
variant?: 'legend' | 'label';
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
declare function FieldGroup({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
9
|
+
declare const fieldVariants: (props?: ({
|
|
10
|
+
orientation?: "vertical" | "horizontal" | "responsive" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
declare function Field({ className, orientation, ...props }: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>): React.JSX.Element;
|
|
13
|
+
declare function FieldContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
14
|
+
declare function FieldLabel({ className, required, children, ...props }: React.ComponentProps<typeof Label> & {
|
|
15
|
+
required?: boolean;
|
|
16
|
+
}): React.JSX.Element;
|
|
17
|
+
declare function FieldTitle({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
18
|
+
declare function FieldDescription({ className, ...props }: React.ComponentProps<'p'>): React.JSX.Element;
|
|
19
|
+
declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
20
|
+
declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<'div'> & {
|
|
21
|
+
errors?: Array<{
|
|
22
|
+
message?: string;
|
|
23
|
+
} | undefined>;
|
|
24
|
+
}): React.JSX.Element | null;
|
|
25
|
+
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { Label } from "./label.js";
|
|
4
|
+
import { Separator } from "./separator.js";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
// src/components/field.tsx
|
|
9
|
+
function FieldSet({ className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx("fieldset", {
|
|
11
|
+
"data-slot": "field-set",
|
|
12
|
+
className: cn("flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className),
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function FieldLegend({ className, variant = "legend", ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx("legend", {
|
|
18
|
+
"data-slot": "field-legend",
|
|
19
|
+
"data-variant": variant,
|
|
20
|
+
className: cn("mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base", className),
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function FieldGroup({ className, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx("div", {
|
|
26
|
+
"data-slot": "field-group",
|
|
27
|
+
className: cn("group/field-group @container/field-group flex w-full flex-col gap-6 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4", className),
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const fieldVariants = cva("group/field data-[invalid=true]:text-destructive flex w-full gap-3", {
|
|
32
|
+
variants: { orientation: {
|
|
33
|
+
vertical: "flex-col [&>*]:w-full [&>.sr-only]:w-auto",
|
|
34
|
+
horizontal: [
|
|
35
|
+
"flex-row items-center",
|
|
36
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
|
37
|
+
"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio],[data-slot=switch]]:mt-px"
|
|
38
|
+
],
|
|
39
|
+
responsive: ["flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto", "@md/field-group:[&>[data-slot=field-label]]:flex-auto"]
|
|
40
|
+
} },
|
|
41
|
+
defaultVariants: { orientation: "vertical" }
|
|
42
|
+
});
|
|
43
|
+
function Field({ className, orientation = "vertical", ...props }) {
|
|
44
|
+
return /* @__PURE__ */ jsx("div", {
|
|
45
|
+
role: "group",
|
|
46
|
+
"data-slot": "field",
|
|
47
|
+
"data-orientation": orientation,
|
|
48
|
+
className: cn(fieldVariants({ orientation }), className),
|
|
49
|
+
...props
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function FieldContent({ className, ...props }) {
|
|
53
|
+
return /* @__PURE__ */ jsx("div", {
|
|
54
|
+
"data-slot": "field-content",
|
|
55
|
+
className: cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", className),
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function FieldLabel({ className, required, children, ...props }) {
|
|
60
|
+
return /* @__PURE__ */ jsx(Label, {
|
|
61
|
+
"data-slot": "field-label",
|
|
62
|
+
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", className),
|
|
63
|
+
...props,
|
|
64
|
+
children: required ? /* @__PURE__ */ jsxs("span", {
|
|
65
|
+
className: "inline-flex items-center gap-1.5",
|
|
66
|
+
children: [children, /* @__PURE__ */ jsx("span", {
|
|
67
|
+
"aria-hidden": true,
|
|
68
|
+
className: "text-destructive",
|
|
69
|
+
children: "*"
|
|
70
|
+
})]
|
|
71
|
+
}) : children
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function FieldTitle({ className, ...props }) {
|
|
75
|
+
return /* @__PURE__ */ jsx("div", {
|
|
76
|
+
"data-slot": "field-label",
|
|
77
|
+
className: cn("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50", className),
|
|
78
|
+
...props
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function FieldDescription({ className, ...props }) {
|
|
82
|
+
return /* @__PURE__ */ jsx("p", {
|
|
83
|
+
"data-slot": "field-description",
|
|
84
|
+
className: cn("text-muted-foreground text-xs leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance", className),
|
|
85
|
+
...props
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function FieldSeparator({ children, className, ...props }) {
|
|
89
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
90
|
+
"data-slot": "field-separator",
|
|
91
|
+
"data-content": !!children,
|
|
92
|
+
className: cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className),
|
|
93
|
+
...props,
|
|
94
|
+
children: [/* @__PURE__ */ jsx(Separator, { className: "absolute inset-0 top-1/2" }), children ? /* @__PURE__ */ jsx("span", {
|
|
95
|
+
className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
|
|
96
|
+
"data-slot": "field-separator-content",
|
|
97
|
+
children
|
|
98
|
+
}) : null]
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function FieldError({ className, children, errors, ...props }) {
|
|
102
|
+
const content = React.useMemo(() => {
|
|
103
|
+
if (children) return children;
|
|
104
|
+
if (!errors) return null;
|
|
105
|
+
const list = errors.filter((e) => e !== void 0);
|
|
106
|
+
if (list.length === 1 && list[0]?.message) return list[0].message;
|
|
107
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
108
|
+
className: "ml-4 flex list-disc flex-col gap-1",
|
|
109
|
+
children: list.map((e, i) => e?.message ? /* @__PURE__ */ jsx("li", { children: e.message }, i) : null)
|
|
110
|
+
});
|
|
111
|
+
}, [children, errors]);
|
|
112
|
+
if (!content) return null;
|
|
113
|
+
return /* @__PURE__ */ jsx("div", {
|
|
114
|
+
role: "alert",
|
|
115
|
+
"data-slot": "field-error",
|
|
116
|
+
className: cn("text-destructive text-sm font-normal", className),
|
|
117
|
+
...props,
|
|
118
|
+
children: content
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function HighlightedTextarea({ value, tokens, className, onScroll, ...props }: Omit<React.ComponentProps<'textarea'>, 'value'> & {
|
|
3
|
+
value: string;
|
|
4
|
+
tokens: readonly string[];
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
export { HighlightedTextarea };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
// src/components/highlighted-textarea.tsx
|
|
6
|
+
function escapeRegExp(value) {
|
|
7
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
8
|
+
}
|
|
9
|
+
function segment(text, tokens) {
|
|
10
|
+
const active = tokens.filter((t) => t.length > 0);
|
|
11
|
+
if (active.length === 0) return [{
|
|
12
|
+
text,
|
|
13
|
+
match: false
|
|
14
|
+
}];
|
|
15
|
+
const pattern = [...active].sort((a, b) => b.length - a.length).map(escapeRegExp).join("|");
|
|
16
|
+
const re = new RegExp(pattern, "g");
|
|
17
|
+
const out = [];
|
|
18
|
+
let last = 0;
|
|
19
|
+
for (let m = re.exec(text); m !== null; m = re.exec(text)) {
|
|
20
|
+
if (m.index > last) out.push({
|
|
21
|
+
text: text.slice(last, m.index),
|
|
22
|
+
match: false
|
|
23
|
+
});
|
|
24
|
+
out.push({
|
|
25
|
+
text: m[0],
|
|
26
|
+
match: true
|
|
27
|
+
});
|
|
28
|
+
last = m.index + m[0].length;
|
|
29
|
+
}
|
|
30
|
+
if (last < text.length) out.push({
|
|
31
|
+
text: text.slice(last),
|
|
32
|
+
match: false
|
|
33
|
+
});
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
function syncScrollToBackdrop(textarea) {
|
|
37
|
+
const backdrop = textarea.previousElementSibling;
|
|
38
|
+
if (!(backdrop instanceof HTMLElement)) return;
|
|
39
|
+
backdrop.scrollTop = textarea.scrollTop;
|
|
40
|
+
backdrop.scrollLeft = textarea.scrollLeft;
|
|
41
|
+
}
|
|
42
|
+
const SHARED_BOX = "w-full rounded-lg border px-2.5 py-2 text-base whitespace-pre-wrap break-words md:text-sm";
|
|
43
|
+
function HighlightedTextarea({ value, tokens, className, onScroll, ...props }) {
|
|
44
|
+
function handleScroll(event) {
|
|
45
|
+
syncScrollToBackdrop(event.currentTarget);
|
|
46
|
+
onScroll?.(event);
|
|
47
|
+
}
|
|
48
|
+
const segments = segment(value, tokens);
|
|
49
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
50
|
+
"data-slot": "highlighted-textarea",
|
|
51
|
+
className: "relative",
|
|
52
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
53
|
+
"aria-hidden": "true",
|
|
54
|
+
className: cn(SHARED_BOX, "text-foreground border-transparent", "pointer-events-none absolute inset-0 overflow-auto select-none", className),
|
|
55
|
+
children: [segments.map((seg, i) => seg.match ? /* @__PURE__ */ jsx("mark", {
|
|
56
|
+
className: "bg-primary/15 text-primary rounded-[3px] px-0.5 font-medium",
|
|
57
|
+
children: seg.text
|
|
58
|
+
}, i) : /* @__PURE__ */ jsx(React.Fragment, { children: seg.text }, i)), "\n"]
|
|
59
|
+
}), /* @__PURE__ */ jsx("textarea", {
|
|
60
|
+
"data-slot": "highlighted-textarea-input",
|
|
61
|
+
value,
|
|
62
|
+
onScroll: handleScroll,
|
|
63
|
+
className: cn(SHARED_BOX, "border-input focus-visible:border-ring focus-visible:ring-ring/50 caret-foreground relative bg-transparent text-transparent transition-colors outline-none focus-visible:ring-3", "disabled:cursor-not-allowed disabled:opacity-50", "placeholder:text-muted-foreground field-sizing-content min-h-16 resize-y", className),
|
|
64
|
+
...props
|
|
65
|
+
})]
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
export { HighlightedTextarea, syncScrollToBackdrop };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Props shared by the brand icons: any `<svg>` prop plus an optional `title`. */
|
|
3
|
+
export type BrandIconProps = Omit<React.ComponentProps<'svg'>, 'children'> & {
|
|
4
|
+
/** Accessible name. Without it the icon is decorative (`aria-hidden`). */
|
|
5
|
+
title?: string;
|
|
6
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
// src/components/icons/brand-icon.tsx
|
|
3
|
+
function BrandIcon({ title, viewBox, children, ...props }) {
|
|
4
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
viewBox,
|
|
7
|
+
focusable: "false",
|
|
8
|
+
...title ? { role: "img" } : { "aria-hidden": true },
|
|
9
|
+
...props,
|
|
10
|
+
children: [title ? /* @__PURE__ */ jsx("title", { children: title }) : null, children]
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export { BrandIcon };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BrandIconProps } from "./brand-icon.js";
|
|
2
|
+
/**
|
|
3
|
+
* Multicolor Google "G" for "Continue with Google" buttons, sized by the
|
|
4
|
+
* caller. Decorative unless a `title` is given.
|
|
5
|
+
*/
|
|
6
|
+
declare function GoogleIcon(props: BrandIconProps): import("react").JSX.Element;
|
|
7
|
+
export { GoogleIcon };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BrandIcon } from "./brand-icon.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
// src/components/icons/google-icon.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Multicolor Google "G" for "Continue with Google" buttons, sized by the
|
|
6
|
+
* caller. Decorative unless a `title` is given.
|
|
7
|
+
*/
|
|
8
|
+
function GoogleIcon(props) {
|
|
9
|
+
return /* @__PURE__ */ jsxs(BrandIcon, {
|
|
10
|
+
"data-slot": "google-icon",
|
|
11
|
+
viewBox: "0 0 18 18",
|
|
12
|
+
...props,
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ jsx("path", {
|
|
15
|
+
fill: "#4285F4",
|
|
16
|
+
d: "M17.64 9.205c0-.639-.057-1.252-.164-1.841H9v3.481h4.844a4.14 4.14 0 0 1-1.796 2.716v2.258h2.908c1.702-1.567 2.684-3.875 2.684-6.614Z"
|
|
17
|
+
}),
|
|
18
|
+
/* @__PURE__ */ jsx("path", {
|
|
19
|
+
fill: "#34A853",
|
|
20
|
+
d: "M9 18c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H.957v2.332A8.997 8.997 0 0 0 9 18Z"
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ jsx("path", {
|
|
23
|
+
fill: "#FBBC05",
|
|
24
|
+
d: "M3.964 10.71A5.41 5.41 0 0 1 3.682 9c0-.593.102-1.17.282-1.71V4.958H.957A8.996 8.996 0 0 0 0 9c0 1.452.348 2.827.957 4.042l3.007-2.332Z"
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ jsx("path", {
|
|
27
|
+
fill: "#EA4335",
|
|
28
|
+
d: "M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0A8.997 8.997 0 0 0 .957 4.958L3.964 7.29C4.672 5.163 6.656 3.58 9 3.58Z"
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export { GoogleIcon };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BrandIconProps } from "./brand-icon.js";
|
|
2
|
+
/**
|
|
3
|
+
* WhatsApp glyph in `currentColor`, sized by the caller (`className="size-4"`).
|
|
4
|
+
* Decorative unless a `title` is given.
|
|
5
|
+
*/
|
|
6
|
+
declare function WhatsappIcon(props: BrandIconProps): import("react").JSX.Element;
|
|
7
|
+
export { WhatsappIcon };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BrandIcon } from "./brand-icon.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
// src/components/icons/whatsapp-icon.tsx
|
|
4
|
+
const PATH = "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.297-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.885-9.885 9.885m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z";
|
|
5
|
+
/**
|
|
6
|
+
* WhatsApp glyph in `currentColor`, sized by the caller (`className="size-4"`).
|
|
7
|
+
* Decorative unless a `title` is given.
|
|
8
|
+
*/
|
|
9
|
+
function WhatsappIcon(props) {
|
|
10
|
+
return /* @__PURE__ */ jsx(BrandIcon, {
|
|
11
|
+
"data-slot": "whatsapp-icon",
|
|
12
|
+
viewBox: "0 0 24 24",
|
|
13
|
+
fill: "currentColor",
|
|
14
|
+
...props,
|
|
15
|
+
children: /* @__PURE__ */ jsx("path", { d: PATH })
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export { WhatsappIcon };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Input } from "./input.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function InputGroup({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
4
|
+
declare function InputGroupInput({ className, ...props }: React.ComponentProps<typeof Input>): React.JSX.Element;
|
|
5
|
+
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<'div'> & {
|
|
6
|
+
align?: 'inline-start' | 'inline-end';
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
export { InputGroup, InputGroupAddon, InputGroupInput };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { Input } from "./input.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
// src/components/input-group.tsx
|
|
6
|
+
function InputGroup({ className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx("div", {
|
|
8
|
+
"data-slot": "input-group",
|
|
9
|
+
role: "group",
|
|
10
|
+
className: cn("group/input-group border-input relative flex w-full items-center gap-1.5 rounded-lg border bg-transparent px-2.5 transition-[color,box-shadow] outline-none", "has-[input:focus-visible]:border-ring has-[input:focus-visible]:ring-ring/50 has-[input:focus-visible]:ring-3", "has-[[aria-invalid=true]]:border-destructive has-[[aria-invalid=true]]:ring-destructive/20 has-[[aria-invalid=true]]:ring-3", "dark:bg-input/30", className),
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function InputGroupInput({ className, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
16
|
+
"data-slot": "input-group-control",
|
|
17
|
+
className: cn("h-8 flex-1 rounded-none border-0 bg-transparent px-0 shadow-none focus-visible:border-0 focus-visible:ring-0 disabled:bg-transparent dark:bg-transparent dark:disabled:bg-transparent", className),
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function InputGroupAddon({ className, align = "inline-end", ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx("div", {
|
|
23
|
+
"data-slot": "input-group-addon",
|
|
24
|
+
className: cn("text-muted-foreground flex shrink-0 items-center [&_svg]:size-4 [&_svg]:shrink-0", align === "inline-start" ? "order-first" : "order-last", className),
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export { InputGroup, InputGroupAddon, InputGroupInput };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
// src/components/input.tsx
|
|
5
|
+
function Input({ className, type, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx("input", {
|
|
7
|
+
type,
|
|
8
|
+
"data-slot": "input",
|
|
9
|
+
className: cn("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 h-8 w-full min-w-0 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-3 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 md:text-sm", className),
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export { Input };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/cn.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Label as Label$1 } from "radix-ui";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
// src/components/label.tsx
|
|
7
|
+
function Label({ className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Label$1.Root, {
|
|
9
|
+
"data-slot": "label",
|
|
10
|
+
className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className),
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export { Label };
|