@esmate/shadcn 3.3.2 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/dist/components/ui/badge.js +1 -1
- package/dist/components/ui/button-group.d.ts +11 -0
- package/dist/components/ui/button-group.js +42 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/button.js +3 -1
- package/dist/components/ui/calendar.js +1 -1
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/context-menu.js +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -1
- package/dist/components/ui/empty.d.ts +11 -0
- package/dist/components/ui/empty.js +60 -0
- package/dist/components/ui/field.d.ts +24 -0
- package/dist/components/ui/field.js +134 -0
- package/dist/components/ui/input-group.d.ts +16 -0
- package/dist/components/ui/input-group.js +89 -0
- package/dist/components/ui/item.d.ts +23 -0
- package/dist/components/ui/item.js +118 -0
- package/dist/components/ui/kbd.d.ts +3 -0
- package/dist/components/ui/kbd.js +16 -0
- package/dist/components/ui/select.d.ts +1 -1
- package/dist/components/ui/select.js +2 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/slider.js +1 -1
- package/dist/components/ui/sonner.d.ts +1 -1
- package/dist/components/ui/sonner.js +20 -1
- package/dist/components/ui/spinner.d.ts +2 -0
- package/dist/components/ui/spinner.js +11 -0
- package/dist/components/ui/toggle-group.d.ts +3 -1
- package/dist/components/ui/toggle-group.js +12 -5
- package/package.json +15 -15
- package/dist/ui/accordion.d.ts +0 -7
- package/dist/ui/accordion.js +0 -39
- package/dist/ui/alert-dialog.d.ts +0 -14
- package/dist/ui/alert-dialog.js +0 -80
- package/dist/ui/alert.d.ts +0 -9
- package/dist/ui/alert.js +0 -39
- package/dist/ui/aspect-ratio.d.ts +0 -3
- package/dist/ui/aspect-ratio.js +0 -9
- package/dist/ui/avatar.d.ts +0 -6
- package/dist/ui/avatar.js +0 -26
- package/dist/ui/badge.d.ts +0 -9
- package/dist/ui/badge.js +0 -28
- package/dist/ui/breadcrumb.d.ts +0 -11
- package/dist/ui/breadcrumb.js +0 -66
- package/dist/ui/button.d.ts +0 -10
- package/dist/ui/button.js +0 -39
- package/dist/ui/calendar.d.ts +0 -8
- package/dist/ui/calendar.js +0 -103
- package/dist/ui/card.d.ts +0 -9
- package/dist/ui/card.js +0 -52
- package/dist/ui/carousel.d.ts +0 -19
- package/dist/ui/carousel.js +0 -135
- package/dist/ui/chart.d.ts +0 -40
- package/dist/ui/chart.js +0 -138
- package/dist/ui/checkbox.d.ts +0 -4
- package/dist/ui/checkbox.js +0 -18
- package/dist/ui/collapsible.d.ts +0 -5
- package/dist/ui/collapsible.js +0 -21
- package/dist/ui/command.d.ts +0 -18
- package/dist/ui/command.js +0 -78
- package/dist/ui/context-menu.d.ts +0 -25
- package/dist/ui/context-menu.js +0 -120
- package/dist/ui/dialog.d.ts +0 -15
- package/dist/ui/dialog.js +0 -79
- package/dist/ui/drawer.d.ts +0 -13
- package/dist/ui/drawer.js +0 -75
- package/dist/ui/dropdown-menu.d.ts +0 -25
- package/dist/ui/dropdown-menu.js +0 -121
- package/dist/ui/form.d.ts +0 -24
- package/dist/ui/form.js +0 -86
- package/dist/ui/hover-card.d.ts +0 -6
- package/dist/ui/hover-card.js +0 -28
- package/dist/ui/input-otp.d.ts +0 -11
- package/dist/ui/input-otp.js +0 -42
- package/dist/ui/input.d.ts +0 -3
- package/dist/ui/input.js +0 -11
- package/dist/ui/label.d.ts +0 -4
- package/dist/ui/label.js +0 -12
- package/dist/ui/menubar.d.ts +0 -26
- package/dist/ui/menubar.js +0 -131
- package/dist/ui/navigation-menu.d.ts +0 -14
- package/dist/ui/navigation-menu.js +0 -71
- package/dist/ui/pagination.d.ts +0 -13
- package/dist/ui/pagination.js +0 -71
- package/dist/ui/popover.d.ts +0 -7
- package/dist/ui/popover.js +0 -32
- package/dist/ui/progress.d.ts +0 -4
- package/dist/ui/progress.js +0 -18
- package/dist/ui/radio-group.d.ts +0 -5
- package/dist/ui/radio-group.js +0 -25
- package/dist/ui/resizable.d.ts +0 -8
- package/dist/ui/resizable.js +0 -30
- package/dist/ui/scroll-area.d.ts +0 -5
- package/dist/ui/scroll-area.js +0 -26
- package/dist/ui/select.d.ts +0 -15
- package/dist/ui/select.js +0 -89
- package/dist/ui/separator.d.ts +0 -4
- package/dist/ui/separator.js +0 -14
- package/dist/ui/sheet.d.ts +0 -13
- package/dist/ui/sheet.js +0 -78
- package/dist/ui/sidebar.d.ts +0 -69
- package/dist/ui/sidebar.js +0 -368
- package/dist/ui/skeleton.d.ts +0 -2
- package/dist/ui/skeleton.js +0 -9
- package/dist/ui/slider.d.ts +0 -4
- package/dist/ui/slider.js +0 -37
- package/dist/ui/sonner.d.ts +0 -3
- package/dist/ui/sonner.js +0 -17
- package/dist/ui/switch.d.ts +0 -4
- package/dist/ui/switch.js +0 -15
- package/dist/ui/table.d.ts +0 -10
- package/dist/ui/table.js +0 -63
- package/dist/ui/tabs.d.ts +0 -7
- package/dist/ui/tabs.js +0 -33
- package/dist/ui/textarea.d.ts +0 -3
- package/dist/ui/textarea.js +0 -10
- package/dist/ui/toggle-group.d.ts +0 -7
- package/dist/ui/toggle-group.js +0 -37
- package/dist/ui/toggle.d.ts +0 -9
- package/dist/ui/toggle.js +0 -34
- package/dist/ui/tooltip.d.ts +0 -7
- package/dist/ui/tooltip.js +0 -34
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Supercharge your UI development with Shadcn—components, hooks, and styles all in one package.
|
|
4
4
|
|
|
5
5
|
- 🔧 **Zero Config**: Works out of the box with Tailwind and pre-styled themes like `new-york.css`.
|
|
6
|
-
- 🧩 **Ready-to-Use UI**: Composable Shadcn components via `@esmate/shadcn/ui/*`, no boilerplate needed.
|
|
6
|
+
- 🧩 **Ready-to-Use UI**: Composable Shadcn components via `@esmate/shadcn/components/ui/*`, no boilerplate needed.
|
|
7
7
|
- ⚙️ **Built-in Hooks**: Includes smart hooks like `useIsMobile` and `useZodForm` for fast logic handling.
|
|
8
8
|
- 🛠 **Useful Utilities**: Handy functions like `cn` for class merging, all in one place.
|
|
9
9
|
- 🎨 **Customizable Styles**: Easy theming with design tokens, dark mode, and editable base styles.
|
|
@@ -45,7 +45,8 @@ import { Card, CardContent } from "@esmate/shadcn/components/ui/card";
|
|
|
45
45
|
|
|
46
46
|
### UI Components
|
|
47
47
|
|
|
48
|
-
All Shadcn [UI components](https://ui.shadcn.com/docs/components/) are available via `@esmate/shadcn/ui/*`
|
|
48
|
+
All Shadcn [UI components](https://ui.shadcn.com/docs/components/) are available via `@esmate/shadcn/components/ui/*`
|
|
49
|
+
imports.
|
|
49
50
|
|
|
50
51
|
```typescript
|
|
51
52
|
import { Button } from "@esmate/shadcn/components/ui/button";
|
|
@@ -72,7 +73,7 @@ import { useIsMobile } from "@esmate/shadcn/hooks/use-mobile";
|
|
|
72
73
|
`@esmate/shadcn/hooks/*` also includes custom hooks, such as React Hook Form integrated with Zod support, like this:
|
|
73
74
|
|
|
74
75
|
```typescript
|
|
75
|
-
import { z } from "@esmate/shadcn/zod";
|
|
76
|
+
import { z } from "@esmate/shadcn/pkgs/zod";
|
|
76
77
|
import { useZodForm } from "@esmate/shadcn/hooks/use-zod-form";
|
|
77
78
|
|
|
78
79
|
const FormSchema = z.object({
|
|
@@ -252,6 +253,7 @@ import { useForm } from "@esmate/shadcn/pkgs/react-hook-form";
|
|
|
252
253
|
import { zodResolver } from "@esmate/shadcn/pkgs/hookform/resolvers";
|
|
253
254
|
import { Accordion } from "@esmate/shadcn/pkgs/radix-ui/react-accordion";
|
|
254
255
|
import { z } from "@esmate/shadcn/pkgs/zod";
|
|
255
|
-
|
|
256
|
-
// You can check src/pkgs or dist/pkgs to find more modules
|
|
257
256
|
```
|
|
257
|
+
|
|
258
|
+
You can check [@esmate/shadcn/src/pkgs](https://github.com/VienDinhCom/esmate/tree/main/packages/shadcn/src/pkgs) or
|
|
259
|
+
`node_modules/@esmate/shadcn/dist/pkgs` to find more modules
|
|
@@ -2,7 +2,7 @@ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE__radix_ui_react_slot_85c2da36__ from "@radix-ui/react-slot";
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_class_variance_authority_159ad65c__ from "class-variance-authority";
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__ from "../../lib/utils.js";
|
|
5
|
-
const badgeVariants = (0, __WEBPACK_EXTERNAL_MODULE_class_variance_authority_159ad65c__.cva)("inline-flex items-center justify-center rounded-
|
|
5
|
+
const badgeVariants = (0, __WEBPACK_EXTERNAL_MODULE_class_variance_authority_159ad65c__.cva)("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", {
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
8
8
|
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import { Separator } from "./separator";
|
|
3
|
+
declare const buttonGroupVariants: (props?: ({
|
|
4
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function ButtonGroup({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function ButtonGroupText({ className, asChild, ...props }: React.ComponentProps<"div"> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function ButtonGroupSeparator({ className, orientation, ...props }: React.ComponentProps<typeof Separator>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants, };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE__radix_ui_react_slot_85c2da36__ from "@radix-ui/react-slot";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_class_variance_authority_159ad65c__ from "class-variance-authority";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__ from "../../lib/utils.js";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__separator_js_5c835db5__ from "./separator.js";
|
|
5
|
+
const buttonGroupVariants = (0, __WEBPACK_EXTERNAL_MODULE_class_variance_authority_159ad65c__.cva)("flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2", {
|
|
6
|
+
variants: {
|
|
7
|
+
orientation: {
|
|
8
|
+
horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
9
|
+
vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
orientation: "horizontal"
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
function ButtonGroup({ className, orientation, ...props }) {
|
|
17
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
18
|
+
role: "group",
|
|
19
|
+
"data-slot": "button-group",
|
|
20
|
+
"data-orientation": orientation,
|
|
21
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)(buttonGroupVariants({
|
|
22
|
+
orientation
|
|
23
|
+
}), className),
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function ButtonGroupText({ className, asChild = false, ...props }) {
|
|
28
|
+
const Comp = asChild ? __WEBPACK_EXTERNAL_MODULE__radix_ui_react_slot_85c2da36__.Slot : "div";
|
|
29
|
+
return /*#__PURE__*/ React.createElement(Comp, {
|
|
30
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className),
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function ButtonGroupSeparator({ className, orientation = "vertical", ...props }) {
|
|
35
|
+
return /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__separator_js_5c835db5__.Separator, {
|
|
36
|
+
"data-slot": "button-group-separator",
|
|
37
|
+
orientation: orientation,
|
|
38
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto", className),
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
-
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
8
|
asChild?: boolean;
|
|
@@ -16,7 +16,9 @@ const buttonVariants = (0, __WEBPACK_EXTERNAL_MODULE_class_variance_authority_15
|
|
|
16
16
|
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
17
17
|
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
18
18
|
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
19
|
-
icon: "size-9"
|
|
19
|
+
icon: "size-9",
|
|
20
|
+
"icon-sm": "size-8",
|
|
21
|
+
"icon-lg": "size-10"
|
|
20
22
|
}
|
|
21
23
|
},
|
|
22
24
|
defaultVariants: {
|
|
@@ -38,7 +38,7 @@ function Calendar({ className, classNames, showOutsideDays = true, captionLayout
|
|
|
38
38
|
week: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("flex w-full mt-2", defaultClassNames.week),
|
|
39
39
|
week_number_header: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("select-none w-(--cell-size)", defaultClassNames.week_number_header),
|
|
40
40
|
week_number: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("text-[0.8rem] select-none text-muted-foreground", defaultClassNames.week_number),
|
|
41
|
-
day: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("relative w-full h-full p-0 text-center [&:
|
|
41
|
+
day: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none", props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md", defaultClassNames.day),
|
|
42
42
|
range_start: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("rounded-l-md bg-accent", defaultClassNames.range_start),
|
|
43
43
|
range_middle: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("rounded-none", defaultClassNames.range_middle),
|
|
44
44
|
range_end: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
@@ -10,7 +10,7 @@ function Card({ className, ...props }) {
|
|
|
10
10
|
function CardHeader({ className, ...props }) {
|
|
11
11
|
return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__.createElement("div", {
|
|
12
12
|
"data-slot": "card-header",
|
|
13
|
-
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-
|
|
13
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className),
|
|
14
14
|
...props
|
|
15
15
|
});
|
|
16
16
|
}
|
|
@@ -10,7 +10,7 @@ function Checkbox({ className, ...props }) {
|
|
|
10
10
|
...props
|
|
11
11
|
}, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__.createElement(__WEBPACK_EXTERNAL_MODULE__radix_ui_react_checkbox_76684228__.Indicator, {
|
|
12
12
|
"data-slot": "checkbox-indicator",
|
|
13
|
-
className: "
|
|
13
|
+
className: "grid place-content-center text-current transition-none"
|
|
14
14
|
}, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__.createElement(__WEBPACK_EXTERNAL_MODULE_lucide_react_f128bbbb__.CheckIcon, {
|
|
15
15
|
className: "size-3.5"
|
|
16
16
|
})));
|
|
@@ -43,7 +43,7 @@ function ContextMenuSubTrigger({ className, inset, children, ...props }) {
|
|
|
43
43
|
return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__.createElement(__WEBPACK_EXTERNAL_MODULE__radix_ui_react_context_menu_293d36e3__.SubTrigger, {
|
|
44
44
|
"data-slot": "context-menu-sub-trigger",
|
|
45
45
|
"data-inset": inset,
|
|
46
|
-
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
46
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
47
47
|
...props
|
|
48
48
|
}, children, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__.createElement(__WEBPACK_EXTERNAL_MODULE_lucide_react_f128bbbb__.ChevronRightIcon, {
|
|
49
49
|
className: "ml-auto"
|
|
@@ -105,7 +105,7 @@ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
|
105
105
|
return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__.createElement(__WEBPACK_EXTERNAL_MODULE__radix_ui_react_dropdown_menu_dbc6754d__.SubTrigger, {
|
|
106
106
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
107
107
|
"data-inset": inset,
|
|
108
|
-
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8", className),
|
|
108
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
109
109
|
...props
|
|
110
110
|
}, children, /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__.createElement(__WEBPACK_EXTERNAL_MODULE_lucide_react_f128bbbb__.ChevronRightIcon, {
|
|
111
111
|
className: "ml-auto size-4"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
declare function Empty({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function EmptyHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const emptyMediaVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "icon" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function EmptyTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function EmptyDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function EmptyContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia, };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_class_variance_authority_159ad65c__ from "class-variance-authority";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__ from "../../lib/utils.js";
|
|
3
|
+
function Empty({ className, ...props }) {
|
|
4
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
5
|
+
"data-slot": "empty",
|
|
6
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12", className),
|
|
7
|
+
...props
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
function EmptyHeader({ className, ...props }) {
|
|
11
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
12
|
+
"data-slot": "empty-header",
|
|
13
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("flex max-w-sm flex-col items-center gap-2 text-center", className),
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const emptyMediaVariants = (0, __WEBPACK_EXTERNAL_MODULE_class_variance_authority_159ad65c__.cva)("flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
18
|
+
variants: {
|
|
19
|
+
variant: {
|
|
20
|
+
default: "bg-transparent",
|
|
21
|
+
icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: "default"
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
function EmptyMedia({ className, variant = "default", ...props }) {
|
|
29
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
30
|
+
"data-slot": "empty-icon",
|
|
31
|
+
"data-variant": variant,
|
|
32
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)(emptyMediaVariants({
|
|
33
|
+
variant,
|
|
34
|
+
className
|
|
35
|
+
})),
|
|
36
|
+
...props
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function EmptyTitle({ className, ...props }) {
|
|
40
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
41
|
+
"data-slot": "empty-title",
|
|
42
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("text-lg font-medium tracking-tight", className),
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function EmptyDescription({ className, ...props }) {
|
|
47
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
48
|
+
"data-slot": "empty-description",
|
|
49
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4", className),
|
|
50
|
+
...props
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function EmptyContent({ className, ...props }) {
|
|
54
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
55
|
+
"data-slot": "empty-content",
|
|
56
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance", className),
|
|
57
|
+
...props
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import { Label } from "./label";
|
|
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
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare const fieldVariants: (props?: ({
|
|
9
|
+
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
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
|
+
declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): import("react/jsx-runtime").JSX.Element;
|
|
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
|
+
children?: React.ReactNode;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<"div"> & {
|
|
20
|
+
errors?: Array<{
|
|
21
|
+
message?: string;
|
|
22
|
+
} | undefined>;
|
|
23
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
24
|
+
export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_class_variance_authority_159ad65c__ from "class-variance-authority";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__ from "../../lib/utils.js";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__label_js_9a908b9b__ from "./label.js";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__separator_js_5c835db5__ from "./separator.js";
|
|
7
|
+
function FieldSet({ className, ...props }) {
|
|
8
|
+
return /*#__PURE__*/ React.createElement("fieldset", {
|
|
9
|
+
"data-slot": "field-set",
|
|
10
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("flex flex-col gap-6", "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className),
|
|
11
|
+
...props
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function FieldLegend({ className, variant = "legend", ...props }) {
|
|
15
|
+
return /*#__PURE__*/ React.createElement("legend", {
|
|
16
|
+
"data-slot": "field-legend",
|
|
17
|
+
"data-variant": variant,
|
|
18
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("mb-3 font-medium", "data-[variant=legend]:text-base", "data-[variant=label]:text-sm", className),
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function FieldGroup({ className, ...props }) {
|
|
23
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
24
|
+
"data-slot": "field-group",
|
|
25
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.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),
|
|
26
|
+
...props
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
const fieldVariants = (0, __WEBPACK_EXTERNAL_MODULE_class_variance_authority_159ad65c__.cva)("group/field flex w-full gap-3 data-[invalid=true]:text-destructive", {
|
|
30
|
+
variants: {
|
|
31
|
+
orientation: {
|
|
32
|
+
vertical: [
|
|
33
|
+
"flex-col [&>*]:w-full [&>.sr-only]:w-auto"
|
|
34
|
+
],
|
|
35
|
+
horizontal: [
|
|
36
|
+
"flex-row items-center",
|
|
37
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
|
38
|
+
"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
39
|
+
],
|
|
40
|
+
responsive: [
|
|
41
|
+
"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto",
|
|
42
|
+
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
43
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: {
|
|
48
|
+
orientation: "vertical"
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
function Field({ className, orientation = "vertical", ...props }) {
|
|
52
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
53
|
+
role: "group",
|
|
54
|
+
"data-slot": "field",
|
|
55
|
+
"data-orientation": orientation,
|
|
56
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)(fieldVariants({
|
|
57
|
+
orientation
|
|
58
|
+
}), className),
|
|
59
|
+
...props
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function FieldContent({ className, ...props }) {
|
|
63
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
64
|
+
"data-slot": "field-content",
|
|
65
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", className),
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function FieldLabel({ className, ...props }) {
|
|
70
|
+
return /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__label_js_9a908b9b__.Label, {
|
|
71
|
+
"data-slot": "field-label",
|
|
72
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.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),
|
|
73
|
+
...props
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function FieldTitle({ className, ...props }) {
|
|
77
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
78
|
+
"data-slot": "field-label",
|
|
79
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50", className),
|
|
80
|
+
...props
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function FieldDescription({ className, ...props }) {
|
|
84
|
+
return /*#__PURE__*/ React.createElement("p", {
|
|
85
|
+
"data-slot": "field-description",
|
|
86
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance", "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5", "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4", className),
|
|
87
|
+
...props
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function FieldSeparator({ children, className, ...props }) {
|
|
91
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
92
|
+
"data-slot": "field-separator",
|
|
93
|
+
"data-content": !!children,
|
|
94
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className),
|
|
95
|
+
...props
|
|
96
|
+
}, /*#__PURE__*/ React.createElement(__WEBPACK_EXTERNAL_MODULE__separator_js_5c835db5__.Separator, {
|
|
97
|
+
className: "absolute inset-0 top-1/2"
|
|
98
|
+
}), children && /*#__PURE__*/ React.createElement("span", {
|
|
99
|
+
className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
|
|
100
|
+
"data-slot": "field-separator-content"
|
|
101
|
+
}, children));
|
|
102
|
+
}
|
|
103
|
+
function FieldError({ className, children, errors, ...props }) {
|
|
104
|
+
const content = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
|
|
105
|
+
if (children) return children;
|
|
106
|
+
if (!(null == errors ? void 0 : errors.length)) return null;
|
|
107
|
+
const uniqueErrors = [
|
|
108
|
+
...new Map(errors.map((error)=>[
|
|
109
|
+
null == error ? void 0 : error.message,
|
|
110
|
+
error
|
|
111
|
+
])).values()
|
|
112
|
+
];
|
|
113
|
+
if ((null == uniqueErrors ? void 0 : uniqueErrors.length) == 1) {
|
|
114
|
+
var _uniqueErrors_;
|
|
115
|
+
return null == (_uniqueErrors_ = uniqueErrors[0]) ? void 0 : _uniqueErrors_.message;
|
|
116
|
+
}
|
|
117
|
+
return /*#__PURE__*/ React.createElement("ul", {
|
|
118
|
+
className: "ml-4 flex list-disc flex-col gap-1"
|
|
119
|
+
}, uniqueErrors.map((error, index)=>(null == error ? void 0 : error.message) && /*#__PURE__*/ React.createElement("li", {
|
|
120
|
+
key: index
|
|
121
|
+
}, error.message)));
|
|
122
|
+
}, [
|
|
123
|
+
children,
|
|
124
|
+
errors
|
|
125
|
+
]);
|
|
126
|
+
if (!content) return null;
|
|
127
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
128
|
+
role: "alert",
|
|
129
|
+
"data-slot": "field-error",
|
|
130
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("text-destructive text-sm font-normal", className),
|
|
131
|
+
...props
|
|
132
|
+
}, content);
|
|
133
|
+
}
|
|
134
|
+
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { Button } from "./button";
|
|
4
|
+
declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const inputGroupAddonVariants: (props?: ({
|
|
6
|
+
align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const inputGroupButtonVariants: (props?: ({
|
|
10
|
+
size?: "sm" | "icon-sm" | "xs" | "icon-xs" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
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
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_class_variance_authority_159ad65c__ from "class-variance-authority";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__ from "../../lib/utils.js";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__button_js_821b8d9d__ from "./button.js";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__input_js_53f4619d__ from "./input.js";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__textarea_js_9a8e5957__ from "./textarea.js";
|
|
8
|
+
function InputGroup({ className, ...props }) {
|
|
9
|
+
return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__.createElement("div", {
|
|
10
|
+
"data-slot": "input-group",
|
|
11
|
+
role: "group",
|
|
12
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none", "h-9 min-w-0 has-[>textarea]:h-auto", "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", "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]", "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),
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
const inputGroupAddonVariants = (0, __WEBPACK_EXTERNAL_MODULE_class_variance_authority_159ad65c__.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", {
|
|
17
|
+
variants: {
|
|
18
|
+
align: {
|
|
19
|
+
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
20
|
+
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
21
|
+
"block-start": "order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5",
|
|
22
|
+
"block-end": "order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
align: "inline-start"
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
function InputGroupAddon({ className, align = "inline-start", ...props }) {
|
|
30
|
+
return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__.createElement("div", {
|
|
31
|
+
role: "group",
|
|
32
|
+
"data-slot": "input-group-addon",
|
|
33
|
+
"data-align": align,
|
|
34
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)(inputGroupAddonVariants({
|
|
35
|
+
align
|
|
36
|
+
}), className),
|
|
37
|
+
onClick: (e)=>{
|
|
38
|
+
var _e_currentTarget_parentElement_querySelector, _e_currentTarget_parentElement;
|
|
39
|
+
if (e.target.closest("button")) return;
|
|
40
|
+
null == (_e_currentTarget_parentElement = e.currentTarget.parentElement) || null == (_e_currentTarget_parentElement_querySelector = _e_currentTarget_parentElement.querySelector("input")) || _e_currentTarget_parentElement_querySelector.focus();
|
|
41
|
+
},
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const inputGroupButtonVariants = (0, __WEBPACK_EXTERNAL_MODULE_class_variance_authority_159ad65c__.cva)("text-sm shadow-none flex gap-2 items-center", {
|
|
46
|
+
variants: {
|
|
47
|
+
size: {
|
|
48
|
+
xs: "h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",
|
|
49
|
+
sm: "h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5",
|
|
50
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
51
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
defaultVariants: {
|
|
55
|
+
size: "xs"
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
function InputGroupButton({ className, type = "button", variant = "ghost", size = "xs", ...props }) {
|
|
59
|
+
return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__.createElement(__WEBPACK_EXTERNAL_MODULE__button_js_821b8d9d__.Button, {
|
|
60
|
+
type: type,
|
|
61
|
+
"data-size": size,
|
|
62
|
+
variant: variant,
|
|
63
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)(inputGroupButtonVariants({
|
|
64
|
+
size
|
|
65
|
+
}), className),
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function InputGroupText({ className, ...props }) {
|
|
70
|
+
return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__.createElement("span", {
|
|
71
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className),
|
|
72
|
+
...props
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function InputGroupInput({ className, ...props }) {
|
|
76
|
+
return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__.createElement(__WEBPACK_EXTERNAL_MODULE__input_js_53f4619d__.Input, {
|
|
77
|
+
"data-slot": "input-group-control",
|
|
78
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent", className),
|
|
79
|
+
...props
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function InputGroupTextarea({ className, ...props }) {
|
|
83
|
+
return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__.createElement(__WEBPACK_EXTERNAL_MODULE__textarea_js_9a8e5957__.Textarea, {
|
|
84
|
+
"data-slot": "input-group-control",
|
|
85
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE__lib_utils_js_c09d30d7__.cn)("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent", className),
|
|
86
|
+
...props
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { Separator } from "./separator";
|
|
4
|
+
declare function ItemGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function ItemSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const itemVariants: (props?: ({
|
|
7
|
+
variant?: "default" | "outline" | "muted" | null | undefined;
|
|
8
|
+
size?: "default" | "sm" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
declare function Item({ className, variant, size, asChild, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const itemMediaVariants: (props?: ({
|
|
14
|
+
variant?: "image" | "default" | "icon" | null | undefined;
|
|
15
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
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
|
+
export { Item, ItemMedia, ItemContent, ItemActions, ItemGroup, ItemSeparator, ItemTitle, ItemDescription, ItemHeader, ItemFooter, };
|