@taicode/common-web 3.2.0 → 3.3.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/output/components/alert-dialog.js +10 -10
- package/output/components/alert.js +5 -5
- package/output/components/avatar.js +7 -7
- package/output/components/badge.js +2 -2
- package/output/components/button.js +2 -2
- package/output/components/card.js +7 -7
- package/output/components/checkbox.js +2 -2
- package/output/components/command.js +10 -10
- package/output/components/dialog.js +7 -7
- package/output/components/dropdown-menu.js +10 -10
- package/output/components/field.js +11 -11
- package/output/components/input-group.js +7 -7
- package/output/components/input.js +2 -2
- package/output/components/item.js +11 -11
- package/output/components/json-view/index.js +2 -2
- package/output/components/kbd.js +3 -3
- package/output/components/label.js +2 -2
- package/output/components/native-select.js +3 -3
- package/output/components/popover.js +5 -5
- package/output/components/progress.js +2 -2
- package/output/components/radio-group.js +3 -3
- package/output/components/scroll-area.js +3 -3
- package/output/components/select.js +9 -9
- package/output/components/separator.js +2 -2
- package/output/components/sheet.js +7 -7
- package/output/components/skeleton.js +2 -2
- package/output/components/spinner.js +2 -2
- package/output/components/switch.js +2 -2
- package/output/components/table.js +9 -9
- package/output/components/tabs.js +5 -5
- package/output/components/textarea.js +2 -2
- package/output/components/tooltip.js +2 -2
- package/output/features/confirm-dialog/index.js +2 -2
- package/output/layout/app/index.js +7 -7
- package/output/layout/dashboard/index.js +2 -2
- package/output/utils/merge-class-names/index.d.ts +3 -0
- package/output/utils/merge-class-names/index.d.ts.map +1 -0
- package/output/utils/{cn → merge-class-names}/index.js +1 -1
- package/output/utils/merge-class-names/index.test.d.ts.map +1 -0
- package/output/utils/merge-class-names/index.test.js +7 -0
- package/package.json +2 -42
- package/output/utils/cn/index.d.ts +0 -3
- package/output/utils/cn/index.d.ts.map +0 -1
- package/output/utils/cn/index.test.d.ts.map +0 -1
- package/output/utils/cn/index.test.js +0 -7
- /package/output/utils/{cn → merge-class-names}/index.test.d.ts +0 -0
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { AlertDialog as AlertDialogPrimitive } from 'radix-ui';
|
|
15
|
-
import {
|
|
15
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
16
16
|
import { Button } from './button.js';
|
|
17
17
|
function AlertDialog(params) {
|
|
18
18
|
const props = __rest(params, []);
|
|
@@ -28,38 +28,38 @@ function AlertDialogPortal(params) {
|
|
|
28
28
|
}
|
|
29
29
|
function AlertDialogOverlay(params) {
|
|
30
30
|
const { className } = params, props = __rest(params, ["className"]);
|
|
31
|
-
return (_jsx(AlertDialogPrimitive.Overlay, Object.assign({ "data-slot": "alert-dialog-overlay", className:
|
|
31
|
+
return (_jsx(AlertDialogPrimitive.Overlay, Object.assign({ "data-slot": "alert-dialog-overlay", className: mergeClassNames('data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50', className) }, props)));
|
|
32
32
|
}
|
|
33
33
|
function AlertDialogContent(params) {
|
|
34
34
|
const { className, size = 'default' } = params, props = __rest(params, ["className", "size"]);
|
|
35
|
-
return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, Object.assign({ "data-slot": "alert-dialog-content", "data-size": size, className:
|
|
35
|
+
return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, Object.assign({ "data-slot": "alert-dialog-content", "data-size": size, className: mergeClassNames('data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-6 rounded-xl p-6 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none', className) }, props))] }));
|
|
36
36
|
}
|
|
37
37
|
function AlertDialogHeader(params) {
|
|
38
38
|
const { className } = params, props = __rest(params, ["className"]);
|
|
39
|
-
return (_jsx("div", Object.assign({ "data-slot": "alert-dialog-header", className:
|
|
39
|
+
return (_jsx("div", Object.assign({ "data-slot": "alert-dialog-header", className: mergeClassNames('grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]', className) }, props)));
|
|
40
40
|
}
|
|
41
41
|
function AlertDialogFooter(params) {
|
|
42
42
|
const { className } = params, props = __rest(params, ["className"]);
|
|
43
|
-
return (_jsx("div", Object.assign({ "data-slot": "alert-dialog-footer", className:
|
|
43
|
+
return (_jsx("div", Object.assign({ "data-slot": "alert-dialog-footer", className: mergeClassNames('flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end', className) }, props)));
|
|
44
44
|
}
|
|
45
45
|
function AlertDialogMedia(params) {
|
|
46
46
|
const { className } = params, props = __rest(params, ["className"]);
|
|
47
|
-
return (_jsx("div", Object.assign({ "data-slot": "alert-dialog-media", className:
|
|
47
|
+
return (_jsx("div", Object.assign({ "data-slot": "alert-dialog-media", className: mergeClassNames("bg-muted mb-2 inline-flex size-16 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8", className) }, props)));
|
|
48
48
|
}
|
|
49
49
|
function AlertDialogTitle(params) {
|
|
50
50
|
const { className } = params, props = __rest(params, ["className"]);
|
|
51
|
-
return (_jsx(AlertDialogPrimitive.Title, Object.assign({ "data-slot": "alert-dialog-title", className:
|
|
51
|
+
return (_jsx(AlertDialogPrimitive.Title, Object.assign({ "data-slot": "alert-dialog-title", className: mergeClassNames('text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2', className) }, props)));
|
|
52
52
|
}
|
|
53
53
|
function AlertDialogDescription(params) {
|
|
54
54
|
const { className } = params, props = __rest(params, ["className"]);
|
|
55
|
-
return (_jsx(AlertDialogPrimitive.Description, Object.assign({ "data-slot": "alert-dialog-description", className:
|
|
55
|
+
return (_jsx(AlertDialogPrimitive.Description, Object.assign({ "data-slot": "alert-dialog-description", className: mergeClassNames('text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3', className) }, props)));
|
|
56
56
|
}
|
|
57
57
|
function AlertDialogAction(params) {
|
|
58
58
|
const { className, variant = 'default', size = 'default' } = params, props = __rest(params, ["className", "variant", "size"]);
|
|
59
|
-
return (_jsx(Button, { variant: variant, size: size, asChild: true, children: _jsx(AlertDialogPrimitive.Action, Object.assign({ "data-slot": "alert-dialog-action", className:
|
|
59
|
+
return (_jsx(Button, { variant: variant, size: size, asChild: true, children: _jsx(AlertDialogPrimitive.Action, Object.assign({ "data-slot": "alert-dialog-action", className: mergeClassNames(className) }, props)) }));
|
|
60
60
|
}
|
|
61
61
|
function AlertDialogCancel(params) {
|
|
62
62
|
const { className, variant = 'outline', size = 'default' } = params, props = __rest(params, ["className", "variant", "size"]);
|
|
63
|
-
return (_jsx(Button, { variant: variant, size: size, asChild: true, children: _jsx(AlertDialogPrimitive.Cancel, Object.assign({ "data-slot": "alert-dialog-cancel", className:
|
|
63
|
+
return (_jsx(Button, { variant: variant, size: size, asChild: true, children: _jsx(AlertDialogPrimitive.Cancel, Object.assign({ "data-slot": "alert-dialog-cancel", className: mergeClassNames(className) }, props)) }));
|
|
64
64
|
}
|
|
65
65
|
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { cva } from 'class-variance-authority';
|
|
15
|
-
import {
|
|
15
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
16
16
|
const alertVariants = cva('grid gap-0.5 rounded-lg border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*="size-"])]:size-4 w-full relative group/alert', {
|
|
17
17
|
variants: {
|
|
18
18
|
variant: { default: 'bg-card text-card-foreground', destructive: 'text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current' },
|
|
@@ -21,18 +21,18 @@ const alertVariants = cva('grid gap-0.5 rounded-lg border px-4 py-3 text-left te
|
|
|
21
21
|
});
|
|
22
22
|
function Alert(params) {
|
|
23
23
|
const { className, variant } = params, props = __rest(params, ["className", "variant"]);
|
|
24
|
-
return _jsx("div", Object.assign({ "data-slot": "alert", role: "alert", className:
|
|
24
|
+
return _jsx("div", Object.assign({ "data-slot": "alert", role: "alert", className: mergeClassNames(alertVariants({ variant }), className) }, props));
|
|
25
25
|
}
|
|
26
26
|
function AlertTitle(params) {
|
|
27
27
|
const { className } = params, props = __rest(params, ["className"]);
|
|
28
|
-
return _jsx("div", Object.assign({ "data-slot": "alert-title", className:
|
|
28
|
+
return _jsx("div", Object.assign({ "data-slot": "alert-title", className: mergeClassNames('font-medium group-has-[>svg]/alert:col-start-2 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3', className) }, props));
|
|
29
29
|
}
|
|
30
30
|
function AlertDescription(params) {
|
|
31
31
|
const { className } = params, props = __rest(params, ["className"]);
|
|
32
|
-
return _jsx("div", Object.assign({ "data-slot": "alert-description", className:
|
|
32
|
+
return _jsx("div", Object.assign({ "data-slot": "alert-description", className: mergeClassNames('text-muted-foreground text-sm text-balance md:text-pretty [&_p:not(:last-child)]:mb-4 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3', className) }, props));
|
|
33
33
|
}
|
|
34
34
|
function AlertAction(params) {
|
|
35
35
|
const { className } = params, props = __rest(params, ["className"]);
|
|
36
|
-
return _jsx("div", Object.assign({ "data-slot": "alert-action", className:
|
|
36
|
+
return _jsx("div", Object.assign({ "data-slot": "alert-action", className: mergeClassNames('absolute top-2.5 right-3', className) }, props));
|
|
37
37
|
}
|
|
38
38
|
export { Alert, AlertTitle, AlertDescription, AlertAction };
|
|
@@ -12,29 +12,29 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
import { Avatar as AvatarPrimitive } from "radix-ui";
|
|
15
|
-
import {
|
|
15
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
16
16
|
function Avatar(params) {
|
|
17
17
|
const { className, size = "default" } = params, props = __rest(params, ["className", "size"]);
|
|
18
|
-
return (_jsx(AvatarPrimitive.Root, Object.assign({ "data-slot": "avatar", "data-size": size, className:
|
|
18
|
+
return (_jsx(AvatarPrimitive.Root, Object.assign({ "data-slot": "avatar", "data-size": size, className: mergeClassNames("size-8 rounded-full after:rounded-full data-[size=lg]:size-10 data-[size=sm]:size-6 after:border-border group/avatar relative flex shrink-0 select-none after:absolute after:inset-0 after:border after:mix-blend-darken dark:after:mix-blend-lighten", className) }, props)));
|
|
19
19
|
}
|
|
20
20
|
function AvatarImage(params) {
|
|
21
21
|
const { className } = params, props = __rest(params, ["className"]);
|
|
22
|
-
return (_jsx(AvatarPrimitive.Image, Object.assign({ "data-slot": "avatar-image", className:
|
|
22
|
+
return (_jsx(AvatarPrimitive.Image, Object.assign({ "data-slot": "avatar-image", className: mergeClassNames("rounded-full aspect-square size-full object-cover", className) }, props)));
|
|
23
23
|
}
|
|
24
24
|
function AvatarFallback(params) {
|
|
25
25
|
const { className } = params, props = __rest(params, ["className"]);
|
|
26
|
-
return (_jsx(AvatarPrimitive.Fallback, Object.assign({ "data-slot": "avatar-fallback", className:
|
|
26
|
+
return (_jsx(AvatarPrimitive.Fallback, Object.assign({ "data-slot": "avatar-fallback", className: mergeClassNames("bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs", className) }, props)));
|
|
27
27
|
}
|
|
28
28
|
function AvatarBadge(params) {
|
|
29
29
|
const { className } = params, props = __rest(params, ["className"]);
|
|
30
|
-
return (_jsx("span", Object.assign({ "data-slot": "avatar-badge", className:
|
|
30
|
+
return (_jsx("span", Object.assign({ "data-slot": "avatar-badge", className: mergeClassNames("bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none", "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden", "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2", "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2", className) }, props)));
|
|
31
31
|
}
|
|
32
32
|
function AvatarGroup(params) {
|
|
33
33
|
const { className } = params, props = __rest(params, ["className"]);
|
|
34
|
-
return (_jsx("div", Object.assign({ "data-slot": "avatar-group", className:
|
|
34
|
+
return (_jsx("div", Object.assign({ "data-slot": "avatar-group", className: mergeClassNames("*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2", className) }, props)));
|
|
35
35
|
}
|
|
36
36
|
function AvatarGroupCount(params) {
|
|
37
37
|
const { className } = params, props = __rest(params, ["className"]);
|
|
38
|
-
return (_jsx("div", Object.assign({ "data-slot": "avatar-group-count", className:
|
|
38
|
+
return (_jsx("div", Object.assign({ "data-slot": "avatar-group-count", className: mergeClassNames("bg-muted text-muted-foreground size-8 rounded-full text-sm group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3 ring-background relative flex shrink-0 items-center justify-center ring-2", className) }, props)));
|
|
39
39
|
}
|
|
40
40
|
export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge, };
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { forwardRef } from 'react';
|
|
14
14
|
import { cva } from 'class-variance-authority';
|
|
15
|
-
import {
|
|
15
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
16
16
|
const badgeVariants = cva('inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors', {
|
|
17
17
|
variants: {
|
|
18
18
|
variant: {
|
|
@@ -26,6 +26,6 @@ const badgeVariants = cva('inline-flex items-center rounded-full border px-2.5 p
|
|
|
26
26
|
});
|
|
27
27
|
export const Badge = forwardRef(function Badge(_a, ref) {
|
|
28
28
|
var { className, variant } = _a, props = __rest(_a, ["className", "variant"]);
|
|
29
|
-
return _jsx("div", Object.assign({ ref: ref, className:
|
|
29
|
+
return _jsx("div", Object.assign({ ref: ref, className: mergeClassNames(badgeVariants({ variant }), className) }, props));
|
|
30
30
|
});
|
|
31
31
|
Badge.displayName = 'Badge';
|
|
@@ -13,7 +13,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import { forwardRef } from 'react';
|
|
14
14
|
import { Slot } from '@radix-ui/react-slot';
|
|
15
15
|
import { cva } from 'class-variance-authority';
|
|
16
|
-
import {
|
|
16
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
17
17
|
const buttonVariants = cva('inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50', {
|
|
18
18
|
variants: {
|
|
19
19
|
variant: {
|
|
@@ -38,7 +38,7 @@ const buttonVariants = cva('inline-flex shrink-0 items-center justify-center gap
|
|
|
38
38
|
export const Button = forwardRef(function Button(_a, ref) {
|
|
39
39
|
var { asChild = false, className, variant, size } = _a, props = __rest(_a, ["asChild", "className", "variant", "size"]);
|
|
40
40
|
const Component = asChild ? Slot : 'button';
|
|
41
|
-
return _jsx(Component, Object.assign({ ref: ref, className:
|
|
41
|
+
return _jsx(Component, Object.assign({ ref: ref, className: mergeClassNames(buttonVariants({ variant, size, className })) }, props));
|
|
42
42
|
});
|
|
43
43
|
Button.displayName = 'Button';
|
|
44
44
|
export { buttonVariants };
|
|
@@ -11,28 +11,28 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { forwardRef } from 'react';
|
|
14
|
-
import {
|
|
14
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
15
15
|
export const Card = forwardRef(function Card(_a, ref) {
|
|
16
16
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
17
|
-
return _jsx("div", Object.assign({ ref: ref, className:
|
|
17
|
+
return _jsx("div", Object.assign({ ref: ref, className: mergeClassNames('rounded-lg border bg-card text-card-foreground shadow-sm', className) }, props));
|
|
18
18
|
});
|
|
19
19
|
export function CardHeader(_a) {
|
|
20
20
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
21
|
-
return _jsx("div", Object.assign({ className:
|
|
21
|
+
return _jsx("div", Object.assign({ className: mergeClassNames('flex flex-col space-y-1.5 p-6', className) }, props));
|
|
22
22
|
}
|
|
23
23
|
export function CardTitle(_a) {
|
|
24
24
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
25
|
-
return _jsx("h3", Object.assign({ className:
|
|
25
|
+
return _jsx("h3", Object.assign({ className: mergeClassNames('font-semibold leading-none tracking-tight', className) }, props));
|
|
26
26
|
}
|
|
27
27
|
export function CardDescription(_a) {
|
|
28
28
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
29
|
-
return _jsx("p", Object.assign({ className:
|
|
29
|
+
return _jsx("p", Object.assign({ className: mergeClassNames('text-sm text-muted-foreground', className) }, props));
|
|
30
30
|
}
|
|
31
31
|
export function CardContent(_a) {
|
|
32
32
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
33
|
-
return _jsx("div", Object.assign({ className:
|
|
33
|
+
return _jsx("div", Object.assign({ className: mergeClassNames('p-6 pt-0', className) }, props));
|
|
34
34
|
}
|
|
35
35
|
export function CardFooter(_a) {
|
|
36
36
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
37
|
-
return _jsx("div", Object.assign({ className:
|
|
37
|
+
return _jsx("div", Object.assign({ className: mergeClassNames('flex items-center p-6 pt-0', className) }, props));
|
|
38
38
|
}
|
|
@@ -13,9 +13,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { Checkbox as CheckboxPrimitive } from 'radix-ui';
|
|
15
15
|
import { CheckIcon } from 'lucide-react';
|
|
16
|
-
import {
|
|
16
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
17
17
|
function Checkbox(params) {
|
|
18
18
|
const { className } = params, props = __rest(params, ["className"]);
|
|
19
|
-
return (_jsx(CheckboxPrimitive.Root, Object.assign({ "data-slot": "checkbox", className:
|
|
19
|
+
return (_jsx(CheckboxPrimitive.Root, Object.assign({ "data-slot": "checkbox", className: mergeClassNames('border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex size-4 items-center justify-center rounded-[4px] border shadow-xs transition-shadow group-has-disabled/field:opacity-50 focus-visible:ring-[3px] aria-invalid:ring-[3px] peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50', className) }, props, { children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "[&>svg]:size-3.5 grid place-content-center text-current transition-none", children: _jsx(CheckIcon, {}) }) })));
|
|
20
20
|
}
|
|
21
21
|
export { Checkbox };
|
|
@@ -12,44 +12,44 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
import { Command as CommandPrimitive } from "cmdk";
|
|
15
|
-
import {
|
|
15
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
16
16
|
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "./dialog.js";
|
|
17
17
|
import { InputGroup, InputGroupAddon, } from "./input-group.js";
|
|
18
18
|
import { SearchIcon, CheckIcon } from "lucide-react";
|
|
19
19
|
function Command(params) {
|
|
20
20
|
const { className } = params, props = __rest(params, ["className"]);
|
|
21
|
-
return (_jsx(CommandPrimitive, Object.assign({ "data-slot": "command", className:
|
|
21
|
+
return (_jsx(CommandPrimitive, Object.assign({ "data-slot": "command", className: mergeClassNames("bg-popover text-popover-foreground rounded-xl! p-1 flex size-full flex-col overflow-hidden", className) }, props)));
|
|
22
22
|
}
|
|
23
23
|
function CommandDialog(params) {
|
|
24
24
|
const { title = "Command Palette", description = "Search for a command to run...", children, className, showCloseButton = false } = params, props = __rest(params, ["title", "description", "children", "className", "showCloseButton"]);
|
|
25
|
-
return (_jsxs(Dialog, Object.assign({}, props, { children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(DialogContent, { className:
|
|
25
|
+
return (_jsxs(Dialog, Object.assign({}, props, { children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(DialogContent, { className: mergeClassNames("rounded-xl! top-1/3 translate-y-0 overflow-hidden p-0", className), showCloseButton: showCloseButton, children: children })] })));
|
|
26
26
|
}
|
|
27
27
|
function CommandInput(params) {
|
|
28
28
|
const { className } = params, props = __rest(params, ["className"]);
|
|
29
|
-
return (_jsx("div", { "data-slot": "command-input-wrapper", className: "p-1 pb-0", children: _jsxs(InputGroup, { className: "bg-input/30 border-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:pl-2!", children: [_jsx(CommandPrimitive.Input, Object.assign({ "data-slot": "command-input", className:
|
|
29
|
+
return (_jsx("div", { "data-slot": "command-input-wrapper", className: "p-1 pb-0", children: _jsxs(InputGroup, { className: "bg-input/30 border-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:pl-2!", children: [_jsx(CommandPrimitive.Input, Object.assign({ "data-slot": "command-input", className: mergeClassNames("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className) }, props)), _jsx(InputGroupAddon, { children: _jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }) })] }) }));
|
|
30
30
|
}
|
|
31
31
|
function CommandList(params) {
|
|
32
32
|
const { className } = params, props = __rest(params, ["className"]);
|
|
33
|
-
return (_jsx(CommandPrimitive.List, Object.assign({ "data-slot": "command-list", className:
|
|
33
|
+
return (_jsx(CommandPrimitive.List, Object.assign({ "data-slot": "command-list", className: mergeClassNames("no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto", className) }, props)));
|
|
34
34
|
}
|
|
35
35
|
function CommandEmpty(params) {
|
|
36
36
|
const { className } = params, props = __rest(params, ["className"]);
|
|
37
|
-
return (_jsx(CommandPrimitive.Empty, Object.assign({ "data-slot": "command-empty", className:
|
|
37
|
+
return (_jsx(CommandPrimitive.Empty, Object.assign({ "data-slot": "command-empty", className: mergeClassNames("py-6 text-center text-sm", className) }, props)));
|
|
38
38
|
}
|
|
39
39
|
function CommandGroup(params) {
|
|
40
40
|
const { className } = params, props = __rest(params, ["className"]);
|
|
41
|
-
return (_jsx(CommandPrimitive.Group, Object.assign({ "data-slot": "command-group", className:
|
|
41
|
+
return (_jsx(CommandPrimitive.Group, Object.assign({ "data-slot": "command-group", className: mergeClassNames("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium", className) }, props)));
|
|
42
42
|
}
|
|
43
43
|
function CommandSeparator(params) {
|
|
44
44
|
const { className } = params, props = __rest(params, ["className"]);
|
|
45
|
-
return (_jsx(CommandPrimitive.Separator, Object.assign({ "data-slot": "command-separator", className:
|
|
45
|
+
return (_jsx(CommandPrimitive.Separator, Object.assign({ "data-slot": "command-separator", className: mergeClassNames("bg-border -mx-1 h-px w-auto", className) }, props)));
|
|
46
46
|
}
|
|
47
47
|
function CommandItem(params) {
|
|
48
48
|
const { className, children } = params, props = __rest(params, ["className", "children"]);
|
|
49
|
-
return (_jsxs(CommandPrimitive.Item, Object.assign({ "data-slot": "command-item", className:
|
|
49
|
+
return (_jsxs(CommandPrimitive.Item, Object.assign({ "data-slot": "command-item", className: mergeClassNames("data-selected:bg-muted data-selected:text-foreground data-selected:**:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none [&_svg:not([class*='size-'])]:size-4 [[data-slot=dialog-content]_&]:rounded-lg! group/command-item data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className) }, props, { children: [children, _jsx(CheckIcon, { className: "ml-auto opacity-0 group-has-[[data-slot=command-shortcut]]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })] })));
|
|
50
50
|
}
|
|
51
51
|
function CommandShortcut(params) {
|
|
52
52
|
const { className } = params, props = __rest(params, ["className"]);
|
|
53
|
-
return (_jsx("span", Object.assign({ "data-slot": "command-shortcut", className:
|
|
53
|
+
return (_jsx("span", Object.assign({ "data-slot": "command-shortcut", className: mergeClassNames("text-muted-foreground group-data-selected/command-item:text-foreground ml-auto text-xs tracking-widest", className) }, props)));
|
|
54
54
|
}
|
|
55
55
|
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { Dialog as DialogPrimitive } from 'radix-ui';
|
|
15
|
-
import {
|
|
15
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
16
16
|
import { Button } from './button.js';
|
|
17
17
|
import { XIcon } from 'lucide-react';
|
|
18
18
|
function Dialog(params) {
|
|
@@ -33,26 +33,26 @@ function DialogClose(params) {
|
|
|
33
33
|
}
|
|
34
34
|
function DialogOverlay(params) {
|
|
35
35
|
const { className } = params, props = __rest(params, ["className"]);
|
|
36
|
-
return (_jsx(DialogPrimitive.Overlay, Object.assign({ "data-slot": "dialog-overlay", className:
|
|
36
|
+
return (_jsx(DialogPrimitive.Overlay, Object.assign({ "data-slot": "dialog-overlay", className: mergeClassNames('data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50', className) }, props)));
|
|
37
37
|
}
|
|
38
38
|
function DialogContent(params) {
|
|
39
39
|
const { className, children, showCloseButton = true } = params, props = __rest(params, ["className", "children", "showCloseButton"]);
|
|
40
|
-
return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, Object.assign({ "data-slot": "dialog-content", className:
|
|
40
|
+
return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, Object.assign({ "data-slot": "dialog-content", className: mergeClassNames('bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-6 rounded-xl p-6 text-sm ring-1 duration-100 sm:max-w-md fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none', className) }, props, { children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", asChild: true, children: _jsxs(Button, { variant: "ghost", className: "absolute top-4 right-4", size: "icon-sm", children: [_jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: "Close" })] }) }))] }))] }));
|
|
41
41
|
}
|
|
42
42
|
function DialogHeader(params) {
|
|
43
43
|
const { className } = params, props = __rest(params, ["className"]);
|
|
44
|
-
return (_jsx("div", Object.assign({ "data-slot": "dialog-header", className:
|
|
44
|
+
return (_jsx("div", Object.assign({ "data-slot": "dialog-header", className: mergeClassNames('gap-2 flex flex-col', className) }, props)));
|
|
45
45
|
}
|
|
46
46
|
function DialogFooter(params) {
|
|
47
47
|
const { className, showCloseButton = false, children } = params, props = __rest(params, ["className", "showCloseButton", "children"]);
|
|
48
|
-
return (_jsxs("div", Object.assign({ "data-slot": "dialog-footer", className:
|
|
48
|
+
return (_jsxs("div", Object.assign({ "data-slot": "dialog-footer", className: mergeClassNames('gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className) }, props, { children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { asChild: true, children: _jsx(Button, { variant: "outline", children: "Close" }) }))] })));
|
|
49
49
|
}
|
|
50
50
|
function DialogTitle(params) {
|
|
51
51
|
const { className } = params, props = __rest(params, ["className"]);
|
|
52
|
-
return (_jsx(DialogPrimitive.Title, Object.assign({ "data-slot": "dialog-title", className:
|
|
52
|
+
return (_jsx(DialogPrimitive.Title, Object.assign({ "data-slot": "dialog-title", className: mergeClassNames('leading-none font-medium', className) }, props)));
|
|
53
53
|
}
|
|
54
54
|
function DialogDescription(params) {
|
|
55
55
|
const { className } = params, props = __rest(params, ["className"]);
|
|
56
|
-
return (_jsx(DialogPrimitive.Description, Object.assign({ "data-slot": "dialog-description", className:
|
|
56
|
+
return (_jsx(DialogPrimitive.Description, Object.assign({ "data-slot": "dialog-description", className: mergeClassNames('text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3', className) }, props)));
|
|
57
57
|
}
|
|
58
58
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -13,7 +13,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import * as React from "react";
|
|
15
15
|
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
16
|
-
import {
|
|
16
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
17
17
|
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
18
18
|
function DropdownMenu(params) {
|
|
19
19
|
const props = __rest(params, []);
|
|
@@ -29,7 +29,7 @@ function DropdownMenuTrigger(params) {
|
|
|
29
29
|
}
|
|
30
30
|
function DropdownMenuContent(params) {
|
|
31
31
|
const { className, align = "start", sideOffset = 4 } = params, props = __rest(params, ["className", "align", "sideOffset"]);
|
|
32
|
-
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, Object.assign({ "data-slot": "dropdown-menu-content", sideOffset: sideOffset, align: align, className:
|
|
32
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, Object.assign({ "data-slot": "dropdown-menu-content", sideOffset: sideOffset, align: align, className: mergeClassNames("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-md p-1 shadow-md ring-1 duration-100 z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto data-[state=closed]:overflow-hidden", className) }, props)) }));
|
|
33
33
|
}
|
|
34
34
|
function DropdownMenuGroup(params) {
|
|
35
35
|
const props = __rest(params, []);
|
|
@@ -37,11 +37,11 @@ function DropdownMenuGroup(params) {
|
|
|
37
37
|
}
|
|
38
38
|
function DropdownMenuItem(params) {
|
|
39
39
|
const { className, inset, variant = "default" } = params, props = __rest(params, ["className", "inset", "variant"]);
|
|
40
|
-
return (_jsx(DropdownMenuPrimitive.Item, Object.assign({ "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className:
|
|
40
|
+
return (_jsx(DropdownMenuPrimitive.Item, Object.assign({ "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: mergeClassNames("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0", className) }, props)));
|
|
41
41
|
}
|
|
42
42
|
function DropdownMenuCheckboxItem(params) {
|
|
43
43
|
const { className, children, checked } = params, props = __rest(params, ["className", "children", "checked"]);
|
|
44
|
-
return (_jsxs(DropdownMenuPrimitive.CheckboxItem, Object.assign({ "data-slot": "dropdown-menu-checkbox-item", className:
|
|
44
|
+
return (_jsxs(DropdownMenuPrimitive.CheckboxItem, Object.assign({ "data-slot": "dropdown-menu-checkbox-item", className: mergeClassNames("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className), checked: checked }, props, { children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none", "data-slot": "dropdown-menu-checkbox-item-indicator", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] })));
|
|
45
45
|
}
|
|
46
46
|
function DropdownMenuRadioGroup(params) {
|
|
47
47
|
const props = __rest(params, []);
|
|
@@ -49,19 +49,19 @@ function DropdownMenuRadioGroup(params) {
|
|
|
49
49
|
}
|
|
50
50
|
function DropdownMenuRadioItem(params) {
|
|
51
51
|
const { className, children } = params, props = __rest(params, ["className", "children"]);
|
|
52
|
-
return (_jsxs(DropdownMenuPrimitive.RadioItem, Object.assign({ "data-slot": "dropdown-menu-radio-item", className:
|
|
52
|
+
return (_jsxs(DropdownMenuPrimitive.RadioItem, Object.assign({ "data-slot": "dropdown-menu-radio-item", className: mergeClassNames("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className) }, props, { children: [_jsx("span", { className: "pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none", "data-slot": "dropdown-menu-radio-item-indicator", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, {}) }) }), children] })));
|
|
53
53
|
}
|
|
54
54
|
function DropdownMenuLabel(params) {
|
|
55
55
|
const { className, inset } = params, props = __rest(params, ["className", "inset"]);
|
|
56
|
-
return (_jsx(DropdownMenuPrimitive.Label, Object.assign({ "data-slot": "dropdown-menu-label", "data-inset": inset, className:
|
|
56
|
+
return (_jsx(DropdownMenuPrimitive.Label, Object.assign({ "data-slot": "dropdown-menu-label", "data-inset": inset, className: mergeClassNames("text-muted-foreground px-2 py-1.5 text-xs font-medium data-[inset]:pl-8", className) }, props)));
|
|
57
57
|
}
|
|
58
58
|
function DropdownMenuSeparator(params) {
|
|
59
59
|
const { className } = params, props = __rest(params, ["className"]);
|
|
60
|
-
return (_jsx(DropdownMenuPrimitive.Separator, Object.assign({ "data-slot": "dropdown-menu-separator", className:
|
|
60
|
+
return (_jsx(DropdownMenuPrimitive.Separator, Object.assign({ "data-slot": "dropdown-menu-separator", className: mergeClassNames("bg-border -mx-1 my-1 h-px", className) }, props)));
|
|
61
61
|
}
|
|
62
62
|
function DropdownMenuShortcut(params) {
|
|
63
63
|
const { className } = params, props = __rest(params, ["className"]);
|
|
64
|
-
return (_jsx("span", Object.assign({ "data-slot": "dropdown-menu-shortcut", className:
|
|
64
|
+
return (_jsx("span", Object.assign({ "data-slot": "dropdown-menu-shortcut", className: mergeClassNames("text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-xs tracking-widest", className) }, props)));
|
|
65
65
|
}
|
|
66
66
|
function DropdownMenuSub(params) {
|
|
67
67
|
const props = __rest(params, []);
|
|
@@ -69,10 +69,10 @@ function DropdownMenuSub(params) {
|
|
|
69
69
|
}
|
|
70
70
|
function DropdownMenuSubTrigger(params) {
|
|
71
71
|
const { className, inset, children } = params, props = __rest(params, ["className", "inset", "children"]);
|
|
72
|
-
return (_jsxs(DropdownMenuPrimitive.SubTrigger, Object.assign({ "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className:
|
|
72
|
+
return (_jsxs(DropdownMenuPrimitive.SubTrigger, Object.assign({ "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: mergeClassNames("focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 flex cursor-default items-center outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0", className) }, props, { children: [children, _jsx(ChevronRightIcon, { className: "ml-auto" })] })));
|
|
73
73
|
}
|
|
74
74
|
function DropdownMenuSubContent(params) {
|
|
75
75
|
const { className } = params, props = __rest(params, ["className"]);
|
|
76
|
-
return (_jsx(DropdownMenuPrimitive.SubContent, Object.assign({ "data-slot": "dropdown-menu-sub-content", className:
|
|
76
|
+
return (_jsx(DropdownMenuPrimitive.SubContent, Object.assign({ "data-slot": "dropdown-menu-sub-content", className: mergeClassNames("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 bg-popover text-popover-foreground min-w-[96px] rounded-md p-1 shadow-lg ring-1 duration-100 z-50 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden", className) }, props)));
|
|
77
77
|
}
|
|
78
78
|
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -13,20 +13,20 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { useMemo } from "react";
|
|
15
15
|
import { cva } from "class-variance-authority";
|
|
16
|
-
import {
|
|
16
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
17
17
|
import { Label } from "./label.js";
|
|
18
18
|
import { Separator } from "./separator.js";
|
|
19
19
|
function FieldSet(params) {
|
|
20
20
|
const { className } = params, props = __rest(params, ["className"]);
|
|
21
|
-
return (_jsx("fieldset", Object.assign({ "data-slot": "field-set", className:
|
|
21
|
+
return (_jsx("fieldset", Object.assign({ "data-slot": "field-set", className: mergeClassNames("gap-6 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col", className) }, props)));
|
|
22
22
|
}
|
|
23
23
|
function FieldLegend(params) {
|
|
24
24
|
const { className, variant = "legend" } = params, props = __rest(params, ["className", "variant"]);
|
|
25
|
-
return (_jsx("legend", Object.assign({ "data-slot": "field-legend", "data-variant": variant, className:
|
|
25
|
+
return (_jsx("legend", Object.assign({ "data-slot": "field-legend", "data-variant": variant, className: mergeClassNames("mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base", className) }, props)));
|
|
26
26
|
}
|
|
27
27
|
function FieldGroup(params) {
|
|
28
28
|
const { className } = params, props = __rest(params, ["className"]);
|
|
29
|
-
return (_jsx("div", Object.assign({ "data-slot": "field-group", className:
|
|
29
|
+
return (_jsx("div", Object.assign({ "data-slot": "field-group", className: mergeClassNames("gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4 group/field-group @container/field-group flex w-full flex-col", className) }, props)));
|
|
30
30
|
}
|
|
31
31
|
const fieldVariants = cva("data-[invalid=true]:text-destructive gap-3 group/field flex w-full", {
|
|
32
32
|
variants: {
|
|
@@ -42,27 +42,27 @@ const fieldVariants = cva("data-[invalid=true]:text-destructive gap-3 group/fiel
|
|
|
42
42
|
});
|
|
43
43
|
function Field(params) {
|
|
44
44
|
const { className, orientation = "vertical" } = params, props = __rest(params, ["className", "orientation"]);
|
|
45
|
-
return (_jsx("div", Object.assign({ role: "group", "data-slot": "field", "data-orientation": orientation, className:
|
|
45
|
+
return (_jsx("div", Object.assign({ role: "group", "data-slot": "field", "data-orientation": orientation, className: mergeClassNames(fieldVariants({ orientation }), className) }, props)));
|
|
46
46
|
}
|
|
47
47
|
function FieldContent(params) {
|
|
48
48
|
const { className } = params, props = __rest(params, ["className"]);
|
|
49
|
-
return (_jsx("div", Object.assign({ "data-slot": "field-content", className:
|
|
49
|
+
return (_jsx("div", Object.assign({ "data-slot": "field-content", className: mergeClassNames("gap-1 group/field-content flex flex-1 flex-col leading-snug", className) }, props)));
|
|
50
50
|
}
|
|
51
51
|
function FieldLabel(params) {
|
|
52
52
|
const { className } = params, props = __rest(params, ["className"]);
|
|
53
|
-
return (_jsx(Label, Object.assign({ "data-slot": "field-label", className:
|
|
53
|
+
return (_jsx(Label, Object.assign({ "data-slot": "field-label", className: mergeClassNames("has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-3 group/field-label peer/field-label flex w-fit leading-snug", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col", className) }, props)));
|
|
54
54
|
}
|
|
55
55
|
function FieldTitle(params) {
|
|
56
56
|
const { className } = params, props = __rest(params, ["className"]);
|
|
57
|
-
return (_jsx("div", Object.assign({ "data-slot": "field-label", className:
|
|
57
|
+
return (_jsx("div", Object.assign({ "data-slot": "field-label", className: mergeClassNames("gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug", className) }, props)));
|
|
58
58
|
}
|
|
59
59
|
function FieldDescription(params) {
|
|
60
60
|
const { className } = params, props = __rest(params, ["className"]);
|
|
61
|
-
return (_jsx("p", Object.assign({ "data-slot": "field-description", className:
|
|
61
|
+
return (_jsx("p", Object.assign({ "data-slot": "field-description", className: mergeClassNames("text-muted-foreground text-left text-sm [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance", "last:mt-0 nth-last-2:-mt-1", "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4", className) }, props)));
|
|
62
62
|
}
|
|
63
63
|
function FieldSeparator(params) {
|
|
64
64
|
const { children, className } = params, props = __rest(params, ["children", "className"]);
|
|
65
|
-
return (_jsxs("div", Object.assign({ "data-slot": "field-separator", "data-content": !!children, className:
|
|
65
|
+
return (_jsxs("div", Object.assign({ "data-slot": "field-separator", "data-content": !!children, className: mergeClassNames("-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative", className) }, props, { children: [_jsx(Separator, { className: "absolute inset-0 top-1/2" }), children && (_jsx("span", { className: "text-muted-foreground px-2 bg-background relative mx-auto block w-fit", "data-slot": "field-separator-content", children: children }))] })));
|
|
66
66
|
}
|
|
67
67
|
function FieldError(params) {
|
|
68
68
|
const { className, children, errors } = params, props = __rest(params, ["className", "children", "errors"]);
|
|
@@ -85,7 +85,7 @@ function FieldError(params) {
|
|
|
85
85
|
if (!content) {
|
|
86
86
|
return null;
|
|
87
87
|
}
|
|
88
|
-
return (_jsx("div", Object.assign({ role: "alert", "data-slot": "field-error", className:
|
|
88
|
+
return (_jsx("div", Object.assign({ role: "alert", "data-slot": "field-error", className: mergeClassNames("text-destructive text-sm font-normal", className) }, props, { children: content })));
|
|
89
89
|
}
|
|
90
90
|
// 命名空间导出
|
|
91
91
|
const FieldNamespace = Object.assign(Field, {
|
|
@@ -12,13 +12,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
import { cva } from "class-variance-authority";
|
|
15
|
-
import {
|
|
15
|
+
import { mergeClassNames } from "../utils/merge-class-names/index.js";
|
|
16
16
|
import { Button } from "./button.js";
|
|
17
17
|
import { Input } from "./input.js";
|
|
18
18
|
import { Textarea } from "./textarea.js";
|
|
19
19
|
function InputGroup(params) {
|
|
20
20
|
const { className } = params, props = __rest(params, ["className"]);
|
|
21
|
-
return (_jsx("div", Object.assign({ "data-slot": "input-group", role: "group", className:
|
|
21
|
+
return (_jsx("div", Object.assign({ "data-slot": "input-group", role: "group", className: mergeClassNames("border-input dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 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 h-9 rounded-md border shadow-xs transition-[color,box-shadow] has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot][aria-invalid=true]]:ring-[3px] has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto", className) }, props)));
|
|
22
22
|
}
|
|
23
23
|
const inputGroupAddonVariants = cva("text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none", {
|
|
24
24
|
variants: {
|
|
@@ -35,7 +35,7 @@ const inputGroupAddonVariants = cva("text-muted-foreground h-auto gap-2 py-1.5 t
|
|
|
35
35
|
});
|
|
36
36
|
function InputGroupAddon(params) {
|
|
37
37
|
const { className, align = "inline-start" } = params, props = __rest(params, ["className", "align"]);
|
|
38
|
-
return (_jsx("div", Object.assign({ role: "group", "data-slot": "input-group-addon", "data-align": align, className:
|
|
38
|
+
return (_jsx("div", Object.assign({ role: "group", "data-slot": "input-group-addon", "data-align": align, className: mergeClassNames(inputGroupAddonVariants({ align }), className), onClick: (e) => {
|
|
39
39
|
var _a, _b;
|
|
40
40
|
if (e.target.closest("button")) {
|
|
41
41
|
return;
|
|
@@ -58,18 +58,18 @@ const inputGroupButtonVariants = cva("gap-2 text-sm shadow-none flex items-cente
|
|
|
58
58
|
});
|
|
59
59
|
function InputGroupButton(params) {
|
|
60
60
|
const { className, type = "button", variant = "ghost", size = "xs" } = params, props = __rest(params, ["className", "type", "variant", "size"]);
|
|
61
|
-
return (_jsx(Button, Object.assign({ type: type, "data-size": size, variant: variant, className:
|
|
61
|
+
return (_jsx(Button, Object.assign({ type: type, "data-size": size, variant: variant, className: mergeClassNames(inputGroupButtonVariants({ size }), className) }, props)));
|
|
62
62
|
}
|
|
63
63
|
function InputGroupText(params) {
|
|
64
64
|
const { className } = params, props = __rest(params, ["className"]);
|
|
65
|
-
return (_jsx("span", Object.assign({ className:
|
|
65
|
+
return (_jsx("span", Object.assign({ className: mergeClassNames("text-muted-foreground gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 flex items-center [&_svg]:pointer-events-none", className) }, props)));
|
|
66
66
|
}
|
|
67
67
|
function InputGroupInput(params) {
|
|
68
68
|
const { className } = params, props = __rest(params, ["className"]);
|
|
69
|
-
return (_jsx(Input, Object.assign({ "data-slot": "input-group-control", className:
|
|
69
|
+
return (_jsx(Input, Object.assign({ "data-slot": "input-group-control", className: mergeClassNames("rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1", className) }, props)));
|
|
70
70
|
}
|
|
71
71
|
function InputGroupTextarea(params) {
|
|
72
72
|
const { className } = params, props = __rest(params, ["className"]);
|
|
73
|
-
return (_jsx(Textarea, Object.assign({ "data-slot": "input-group-control", className:
|
|
73
|
+
return (_jsx(Textarea, Object.assign({ "data-slot": "input-group-control", className: mergeClassNames("rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1 resize-none", className) }, props)));
|
|
74
74
|
}
|
|
75
75
|
export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
|
|
@@ -11,9 +11,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { forwardRef } from 'react';
|
|
14
|
-
import {
|
|
14
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
15
15
|
export const Input = forwardRef(function Input(_a, ref) {
|
|
16
16
|
var { className, type = 'text' } = _a, props = __rest(_a, ["className", "type"]);
|
|
17
|
-
return (_jsx("input", Object.assign({ ref: ref, type: type, className:
|
|
17
|
+
return (_jsx("input", Object.assign({ ref: ref, type: type, className: mergeClassNames('flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-xs outline-none transition-colors placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', className) }, props)));
|
|
18
18
|
});
|
|
19
19
|
Input.displayName = 'Input';
|