@taicode/common-web 3.2.0 → 3.4.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.d.ts +7 -6
- package/output/components/badge.d.ts.map +1 -1
- package/output/components/badge.js +21 -13
- package/output/components/button.d.ts +8 -8
- package/output/components/button.d.ts.map +1 -1
- package/output/components/button.js +26 -22
- package/output/components/calendar.d.ts +13 -0
- package/output/components/calendar.d.ts.map +1 -0
- package/output/components/calendar.js +57 -0
- package/output/components/card.d.ts +12 -7
- package/output/components/card.d.ts.map +1 -1
- package/output/components/card.js +26 -21
- package/output/components/chart.d.ts +56 -0
- package/output/components/chart.d.ts.map +1 -0
- package/output/components/chart.js +127 -0
- package/output/components/checkbox.js +2 -2
- package/output/components/command.js +10 -10
- package/output/components/dialog.js +7 -7
- package/output/components/drawer.d.ts +14 -0
- package/output/components/drawer.d.ts.map +1 -0
- package/output/components/drawer.js +56 -0
- package/output/components/dropdown-menu.js +10 -10
- package/output/components/field.js +11 -11
- package/output/components/index.d.ts +6 -0
- package/output/components/index.d.ts.map +1 -1
- package/output/components/index.js +6 -0
- package/output/components/input-group.d.ts +1 -1
- package/output/components/input-group.js +7 -7
- package/output/components/input.d.ts +3 -2
- package/output/components/input.d.ts.map +1 -1
- package/output/components/input.js +7 -7
- package/output/components/item.d.ts +1 -1
- 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.d.ts +4 -5
- package/output/components/separator.d.ts.map +1 -1
- package/output/components/separator.js +8 -7
- package/output/components/sheet.js +7 -7
- package/output/components/sidebar.d.ts +78 -0
- package/output/components/sidebar.d.ts.map +1 -0
- package/output/components/sidebar.js +233 -0
- package/output/components/skeleton.d.ts +2 -2
- package/output/components/skeleton.d.ts.map +1 -1
- package/output/components/skeleton.js +5 -4
- 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/toggle-group.d.ts +12 -0
- package/output/components/toggle-group.d.ts.map +1 -0
- package/output/components/toggle-group.js +38 -0
- package/output/components/toggle.d.ts +10 -0
- package/output/components/toggle.d.ts.map +1 -0
- package/output/components/toggle.js +38 -0
- 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/layout/empty/index.d.ts +20 -0
- package/output/layout/empty/index.d.ts.map +1 -0
- package/output/layout/empty/index.js +14 -0
- package/output/layout/index.d.ts +4 -0
- package/output/layout/index.d.ts.map +1 -1
- package/output/layout/index.js +4 -0
- package/output/layout/list-actions/index.d.ts +23 -0
- package/output/layout/list-actions/index.d.ts.map +1 -0
- package/output/layout/list-actions/index.js +15 -0
- package/output/layout/page-back-button/index.d.ts +8 -0
- package/output/layout/page-back-button/index.d.ts.map +1 -0
- package/output/layout/page-back-button/index.js +7 -0
- package/output/layout/pagination/index.d.ts +34 -0
- package/output/layout/pagination/index.d.ts.map +1 -0
- package/output/layout/pagination/index.js +75 -0
- 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 +5 -46
- 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, };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
type BadgeParams = {
|
|
4
|
+
asChild?: boolean;
|
|
5
|
+
};
|
|
3
6
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "destructive" | "
|
|
7
|
+
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | "success" | "warning" | null | undefined;
|
|
5
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
export declare const Badge: import("react").ForwardRefExoticComponent<BadgeProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
-
export {};
|
|
9
|
+
declare function Badge(params: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & BadgeParams): React.JSX.Element;
|
|
10
|
+
export { Badge, badgeVariants };
|
|
10
11
|
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../source/components/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../source/components/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKjE,KAAK,WAAW,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAExC,QAAA,MAAM,aAAa;;8EAmBlB,CAAA;AAED,iBAAS,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG,WAAW,qBAYrG;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -10,22 +10,30 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
13
|
+
import * as React from 'react';
|
|
14
14
|
import { cva } from 'class-variance-authority';
|
|
15
|
-
import {
|
|
16
|
-
|
|
15
|
+
import { Slot } from 'radix-ui';
|
|
16
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
17
|
+
const badgeVariants = cva("h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>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 overflow-hidden group/badge", {
|
|
17
18
|
variants: {
|
|
18
19
|
variant: {
|
|
19
|
-
default: '
|
|
20
|
-
secondary: '
|
|
21
|
-
destructive: '
|
|
22
|
-
|
|
20
|
+
default: 'bg-primary text-primary-foreground [a]:hover:bg-primary/80',
|
|
21
|
+
secondary: 'bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80',
|
|
22
|
+
destructive: 'bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20',
|
|
23
|
+
success: 'border-green-600 bg-green-50 text-green-600 [a]:hover:bg-green-100 focus-visible:ring-green-600/20 dark:border-green-400 dark:bg-green-950 dark:text-green-400 dark:[a]:hover:bg-green-900',
|
|
24
|
+
warning: 'border-orange-600 bg-orange-50 text-orange-600 [a]:hover:bg-orange-100 focus-visible:ring-orange-600/20 dark:border-orange-400 dark:bg-orange-950 dark:text-orange-400 dark:[a]:hover:bg-orange-900',
|
|
25
|
+
outline: 'border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground',
|
|
26
|
+
ghost: 'hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50',
|
|
27
|
+
link: 'text-primary underline-offset-4 hover:underline',
|
|
23
28
|
},
|
|
24
29
|
},
|
|
25
|
-
defaultVariants: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var { className, variant } = _a, props = __rest(_a, ["className", "variant"]);
|
|
29
|
-
return _jsx("div", Object.assign({ ref: ref, className: cn(badgeVariants({ variant }), className) }, props));
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
variant: 'default',
|
|
32
|
+
},
|
|
30
33
|
});
|
|
31
|
-
Badge
|
|
34
|
+
function Badge(params) {
|
|
35
|
+
const { className, variant = 'default', asChild = false } = params, props = __rest(params, ["className", "variant", "asChild"]);
|
|
36
|
+
const Comp = asChild ? Slot.Root : 'span';
|
|
37
|
+
return (_jsx(Comp, Object.assign({ "data-slot": "badge", "data-variant": variant, className: mergeClassNames(badgeVariants({ variant }), className) }, props)));
|
|
38
|
+
}
|
|
39
|
+
export { Badge, badgeVariants };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
type ButtonParams = {
|
|
4
|
+
asChild?: boolean;
|
|
5
|
+
};
|
|
3
6
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "
|
|
5
|
-
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-
|
|
7
|
+
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
|
|
8
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
11
|
-
export { buttonVariants };
|
|
10
|
+
declare function Button(params: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & ButtonParams): React.JSX.Element;
|
|
11
|
+
export { Button, buttonVariants };
|
|
12
12
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../source/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../source/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,KAAK,YAAY,GAAG;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,QAAA,MAAM,cAAc;;;8EA4BnB,CAAA;AAED,iBAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG,YAAY,qBAa1G;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -10,35 +10,39 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
14
|
-
import { Slot } from '
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { Slot } from 'radix-ui';
|
|
15
15
|
import { cva } from 'class-variance-authority';
|
|
16
|
-
import {
|
|
17
|
-
const buttonVariants = cva(
|
|
16
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
17
|
+
const buttonVariants = cva("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none", {
|
|
18
18
|
variants: {
|
|
19
19
|
variant: {
|
|
20
|
-
default: 'bg-primary text-primary-foreground hover:bg-primary/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
default: 'bg-primary text-primary-foreground hover:bg-primary/80',
|
|
21
|
+
outline: 'border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground shadow-xs',
|
|
22
|
+
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
|
|
23
|
+
ghost: 'hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground',
|
|
24
|
+
destructive: 'bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30',
|
|
25
25
|
link: 'text-primary underline-offset-4 hover:underline',
|
|
26
26
|
},
|
|
27
27
|
size: {
|
|
28
|
-
default: 'h-9 px-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
default: 'h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
|
|
29
|
+
xs: 'h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*="size-"])]:size-3',
|
|
30
|
+
sm: 'h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5',
|
|
31
|
+
lg: 'h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3',
|
|
31
32
|
icon: 'size-9',
|
|
32
|
-
'icon-
|
|
33
|
-
'icon-
|
|
33
|
+
'icon-xs': 'size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*="size-"])]:size-3',
|
|
34
|
+
'icon-sm': 'size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md',
|
|
35
|
+
'icon-lg': 'size-10',
|
|
34
36
|
},
|
|
35
37
|
},
|
|
36
|
-
defaultVariants: {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const Component = asChild ? Slot : 'button';
|
|
41
|
-
return _jsx(Component, Object.assign({ ref: ref, className: cn(buttonVariants({ variant, size, className })) }, props));
|
|
38
|
+
defaultVariants: {
|
|
39
|
+
variant: 'default',
|
|
40
|
+
size: 'default',
|
|
41
|
+
},
|
|
42
42
|
});
|
|
43
|
-
Button
|
|
44
|
-
|
|
43
|
+
function Button(params) {
|
|
44
|
+
const { className, variant = 'default', size = 'default', asChild = false } = params, props = __rest(params, ["className", "variant", "size", "asChild"]);
|
|
45
|
+
const Comp = asChild ? Slot.Root : 'button';
|
|
46
|
+
return (_jsx(Comp, Object.assign({ "data-slot": "button", "data-variant": variant, "data-size": size, className: mergeClassNames(buttonVariants({ variant, size, className })) }, props)));
|
|
47
|
+
}
|
|
48
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DayPicker, type DayButton, type Locale } from 'react-day-picker';
|
|
3
|
+
import { Button } from './button.js';
|
|
4
|
+
type CalendarDayButtonParams = {
|
|
5
|
+
locale?: Partial<Locale>;
|
|
6
|
+
};
|
|
7
|
+
type CalendarParams = {
|
|
8
|
+
buttonVariant?: React.ComponentProps<typeof Button>['variant'];
|
|
9
|
+
};
|
|
10
|
+
declare function Calendar(params: React.ComponentProps<typeof DayPicker> & CalendarParams): React.JSX.Element;
|
|
11
|
+
declare function CalendarDayButton(params: React.ComponentProps<typeof DayButton> & CalendarDayButtonParams): React.JSX.Element;
|
|
12
|
+
export { Calendar, CalendarDayButton };
|
|
13
|
+
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../source/components/calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,SAAS,EAAwB,KAAK,SAAS,EAAE,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAG/F,OAAO,EAAE,MAAM,EAAkB,MAAM,aAAa,CAAA;AAGpD,KAAK,uBAAuB,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;CAAE,CAAA;AAE3D,KAAK,cAAc,GAAG;IACpB,aAAa,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAA;CAC/D,CAAA;AAED,iBAAS,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG,cAAc,qBA2GhF;AAED,iBAAS,iBAAiB,CACxB,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG,uBAAuB,qBA4BzE;AAED,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useRef, useEffect } from 'react';
|
|
15
|
+
import { DayPicker, getDefaultClassNames } from 'react-day-picker';
|
|
16
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
17
|
+
import { Button, buttonVariants } from './button.js';
|
|
18
|
+
import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon } from 'lucide-react';
|
|
19
|
+
function Calendar(params) {
|
|
20
|
+
const { className, classNames, showOutsideDays = true, captionLayout = 'label', buttonVariant = 'ghost', locale, formatters, components } = params, props = __rest(params, ["className", "classNames", "showOutsideDays", "captionLayout", "buttonVariant", "locale", "formatters", "components"]);
|
|
21
|
+
const defaultClassNames = getDefaultClassNames();
|
|
22
|
+
return (_jsx(DayPicker, Object.assign({ showOutsideDays: showOutsideDays, className: mergeClassNames('p-3 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(8)] bg-background group/calendar [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent', String.raw `rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw `rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className), captionLayout: captionLayout, locale: locale, formatters: Object.assign({ formatMonthDropdown: (date) => date.toLocaleString(locale === null || locale === void 0 ? void 0 : locale.code, { month: 'short' }) }, formatters), classNames: Object.assign({ root: mergeClassNames('w-fit', defaultClassNames.root), months: mergeClassNames('flex gap-4 flex-col md:flex-row relative', defaultClassNames.months), month: mergeClassNames('flex flex-col w-full gap-4', defaultClassNames.month), nav: mergeClassNames('flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between', defaultClassNames.nav), button_previous: mergeClassNames(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_previous), button_next: mergeClassNames(buttonVariants({ variant: buttonVariant }), 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none', defaultClassNames.button_next), month_caption: mergeClassNames('flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)', defaultClassNames.month_caption), dropdowns: mergeClassNames('w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5', defaultClassNames.dropdowns), dropdown_root: mergeClassNames('relative rounded-(--cell-radius)', defaultClassNames.dropdown_root), dropdown: mergeClassNames('absolute bg-popover inset-0 opacity-0', defaultClassNames.dropdown), caption_label: mergeClassNames('select-none font-medium', captionLayout === 'label'
|
|
23
|
+
? 'text-sm'
|
|
24
|
+
: 'rounded-(--cell-radius) flex items-center gap-1 text-sm [&>svg]:text-muted-foreground [&>svg]:size-3.5', defaultClassNames.caption_label), table: 'w-full border-collapse', weekdays: mergeClassNames('flex', defaultClassNames.weekdays), weekday: mergeClassNames('text-muted-foreground rounded-(--cell-radius) flex-1 font-normal text-[0.8rem] select-none', defaultClassNames.weekday), week: mergeClassNames('flex w-full mt-2', defaultClassNames.week), week_number_header: mergeClassNames('select-none w-(--cell-size)', defaultClassNames.week_number_header), week_number: mergeClassNames('text-[0.8rem] select-none text-muted-foreground', defaultClassNames.week_number), day: mergeClassNames('relative w-full rounded-(--cell-radius) h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius) group/day aspect-square select-none', props.showWeekNumber
|
|
25
|
+
? '[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)'
|
|
26
|
+
: '[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)', defaultClassNames.day), range_start: mergeClassNames('rounded-l-(--cell-radius) bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:right-0 -z-0 isolate', defaultClassNames.range_start), range_middle: mergeClassNames('rounded-none', defaultClassNames.range_middle), range_end: mergeClassNames('rounded-r-(--cell-radius) bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:left-0 -z-0 isolate', defaultClassNames.range_end), today: mergeClassNames('bg-muted text-foreground rounded-(--cell-radius) data-[selected=true]:rounded-none', defaultClassNames.today), outside: mergeClassNames('text-muted-foreground aria-selected:text-muted-foreground', defaultClassNames.outside), disabled: mergeClassNames('text-muted-foreground opacity-50', defaultClassNames.disabled), hidden: mergeClassNames('invisible', defaultClassNames.hidden) }, classNames), components: Object.assign({ Root: (_a) => {
|
|
27
|
+
var { className, rootRef } = _a, props = __rest(_a, ["className", "rootRef"]);
|
|
28
|
+
return _jsx("div", Object.assign({ "data-slot": "calendar", ref: rootRef, className: mergeClassNames(className) }, props));
|
|
29
|
+
}, Chevron: (_a) => {
|
|
30
|
+
var { className, orientation } = _a, props = __rest(_a, ["className", "orientation"]);
|
|
31
|
+
if (orientation === 'left') {
|
|
32
|
+
return _jsx(ChevronLeftIcon, Object.assign({ className: mergeClassNames('size-4', className) }, props));
|
|
33
|
+
}
|
|
34
|
+
if (orientation === 'right') {
|
|
35
|
+
return _jsx(ChevronRightIcon, Object.assign({ className: mergeClassNames('size-4', className) }, props));
|
|
36
|
+
}
|
|
37
|
+
return _jsx(ChevronDownIcon, Object.assign({ className: mergeClassNames('size-4', className) }, props));
|
|
38
|
+
}, DayButton: (_a) => {
|
|
39
|
+
var props = __rest(_a, []);
|
|
40
|
+
return _jsx(CalendarDayButton, Object.assign({ locale: locale }, props));
|
|
41
|
+
}, WeekNumber: (_a) => {
|
|
42
|
+
var { children } = _a, props = __rest(_a, ["children"]);
|
|
43
|
+
return (_jsx("td", Object.assign({}, props, { children: _jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: children }) })));
|
|
44
|
+
} }, components) }, props)));
|
|
45
|
+
}
|
|
46
|
+
function CalendarDayButton(params) {
|
|
47
|
+
const { className, day, modifiers, locale } = params, props = __rest(params, ["className", "day", "modifiers", "locale"]);
|
|
48
|
+
const defaultClassNames = getDefaultClassNames();
|
|
49
|
+
const ref = useRef(null);
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
var _a;
|
|
52
|
+
if (modifiers.focused)
|
|
53
|
+
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
54
|
+
}, [modifiers.focused]);
|
|
55
|
+
return (_jsx(Button, Object.assign({ ref: ref, variant: "ghost", size: "icon", "data-day": day.date.toLocaleDateString(locale === null || locale === void 0 ? void 0 : locale.code), "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, className: mergeClassNames('data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-foreground relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) [&>span]:text-xs [&>span]:opacity-70', defaultClassNames.day, className) }, props)));
|
|
56
|
+
}
|
|
57
|
+
export { Calendar, CalendarDayButton };
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type CardParams = {
|
|
3
|
+
size?: 'default' | 'sm';
|
|
4
|
+
};
|
|
5
|
+
declare function Card(params: React.ComponentProps<'div'> & CardParams): React.JSX.Element;
|
|
6
|
+
declare function CardHeader(params: React.ComponentProps<'div'>): React.JSX.Element;
|
|
7
|
+
declare function CardTitle(params: React.ComponentProps<'div'>): React.JSX.Element;
|
|
8
|
+
declare function CardDescription(params: React.ComponentProps<'div'>): React.JSX.Element;
|
|
9
|
+
declare function CardAction(params: React.ComponentProps<'div'>): React.JSX.Element;
|
|
10
|
+
declare function CardContent(params: React.ComponentProps<'div'>): React.JSX.Element;
|
|
11
|
+
declare function CardFooter(params: React.ComponentProps<'div'>): React.JSX.Element;
|
|
12
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardAction, CardContent };
|
|
8
13
|
//# sourceMappingURL=card.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../source/components/card.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../source/components/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,KAAK,UAAU,GAAG;IAAE,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;CAAE,CAAA;AAE7C,iBAAS,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,UAAU,qBAa7D;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAYtD;AAED,iBAAS,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBASrD;AAED,iBAAS,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAG3D;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAStD;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAGvD;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAStD;AAED,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -10,29 +10,34 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return _jsx("div", Object.assign({
|
|
18
|
-
});
|
|
19
|
-
export function CardHeader(_a) {
|
|
20
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
21
|
-
return _jsx("div", Object.assign({ className: cn('flex flex-col space-y-1.5 p-6', className) }, props));
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { mergeClassNames } from '../utils/merge-class-names/index.js';
|
|
15
|
+
function Card(params) {
|
|
16
|
+
const { className, size = 'default' } = params, props = __rest(params, ["className", "size"]);
|
|
17
|
+
return (_jsx("div", Object.assign({ "data-slot": "card", "data-size": size, className: mergeClassNames('ring-foreground/10 bg-card text-card-foreground gap-6 overflow-hidden rounded-xl py-6 text-sm shadow-xs ring-1 has-[>img:first-child]:pt-0 data-[size=sm]:gap-4 data-[size=sm]:py-4 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col', className) }, props)));
|
|
22
18
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return _jsx("
|
|
19
|
+
function CardHeader(params) {
|
|
20
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
21
|
+
return (_jsx("div", Object.assign({ "data-slot": "card-header", className: mergeClassNames('gap-1 rounded-t-xl px-6 group-data-[size=sm]/card:px-4 [.border-b]:pb-6 group-data-[size=sm]/card:[.border-b]:pb-4 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]', className) }, props)));
|
|
26
22
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return _jsx("
|
|
23
|
+
function CardTitle(params) {
|
|
24
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
25
|
+
return (_jsx("div", Object.assign({ "data-slot": "card-title", className: mergeClassNames('text-base leading-normal font-medium group-data-[size=sm]/card:text-sm', className) }, props)));
|
|
30
26
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return _jsx("div", Object.assign({ className:
|
|
27
|
+
function CardDescription(params) {
|
|
28
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
29
|
+
return _jsx("div", Object.assign({ "data-slot": "card-description", className: mergeClassNames('text-muted-foreground text-sm', className) }, props));
|
|
34
30
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return _jsx("div", Object.assign({ className:
|
|
31
|
+
function CardAction(params) {
|
|
32
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
33
|
+
return (_jsx("div", Object.assign({ "data-slot": "card-action", className: mergeClassNames('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className) }, props)));
|
|
38
34
|
}
|
|
35
|
+
function CardContent(params) {
|
|
36
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
37
|
+
return _jsx("div", Object.assign({ "data-slot": "card-content", className: mergeClassNames('px-6 group-data-[size=sm]/card:px-4', className) }, props));
|
|
38
|
+
}
|
|
39
|
+
function CardFooter(params) {
|
|
40
|
+
const { className } = params, props = __rest(params, ["className"]);
|
|
41
|
+
return (_jsx("div", Object.assign({ "data-slot": "card-footer", className: mergeClassNames('px-6 pb-6 group-data-[size=sm]/card:pb-4 flex items-center [.border-t]:pt-6 group-data-[size=sm]/card:[.border-t]:pt-4', className) }, props)));
|
|
42
|
+
}
|
|
43
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardAction, CardContent };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RechartsPrimitive from 'recharts';
|
|
3
|
+
type ChartContainerParams = {
|
|
4
|
+
config: ChartConfig;
|
|
5
|
+
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];
|
|
6
|
+
};
|
|
7
|
+
type ChartLegendContentParams = {
|
|
8
|
+
className?: string;
|
|
9
|
+
hideIcon?: boolean;
|
|
10
|
+
payload?: any[];
|
|
11
|
+
verticalAlign?: 'top' | 'bottom';
|
|
12
|
+
nameKey?: string;
|
|
13
|
+
};
|
|
14
|
+
type ChartTooltipContentParams = {
|
|
15
|
+
active?: boolean;
|
|
16
|
+
payload?: any[];
|
|
17
|
+
className?: string;
|
|
18
|
+
indicator?: 'line' | 'dot' | 'dashed';
|
|
19
|
+
hideLabel?: boolean;
|
|
20
|
+
hideIndicator?: boolean;
|
|
21
|
+
label?: string | number;
|
|
22
|
+
labelFormatter?: (value: any, payload: any[]) => React.ReactNode;
|
|
23
|
+
labelClassName?: string;
|
|
24
|
+
formatter?: (value: any, name: string, item: any, index: number, payload: any) => React.ReactNode;
|
|
25
|
+
color?: string;
|
|
26
|
+
nameKey?: string;
|
|
27
|
+
labelKey?: string;
|
|
28
|
+
};
|
|
29
|
+
type ChartStyleParams = {
|
|
30
|
+
id: string;
|
|
31
|
+
config: ChartConfig;
|
|
32
|
+
};
|
|
33
|
+
declare const THEMES: {
|
|
34
|
+
readonly light: "";
|
|
35
|
+
readonly dark: ".dark";
|
|
36
|
+
};
|
|
37
|
+
export type ChartConfig = {
|
|
38
|
+
[k in string]: {
|
|
39
|
+
label?: React.ReactNode;
|
|
40
|
+
icon?: React.ComponentType;
|
|
41
|
+
} & ({
|
|
42
|
+
color?: string;
|
|
43
|
+
theme?: never;
|
|
44
|
+
} | {
|
|
45
|
+
color?: never;
|
|
46
|
+
theme: Record<keyof typeof THEMES, string>;
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
declare function ChartContainer(params: React.ComponentProps<'div'> & ChartContainerParams): React.JSX.Element;
|
|
50
|
+
declare const ChartStyle: ({ id, config }: ChartStyleParams) => React.JSX.Element | null;
|
|
51
|
+
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
52
|
+
declare function ChartTooltipContent(params: ChartTooltipContentParams & React.ComponentProps<'div'>): React.JSX.Element | null;
|
|
53
|
+
declare const ChartLegend: typeof RechartsPrimitive.Legend;
|
|
54
|
+
declare function ChartLegendContent(params: ChartLegendContentParams & React.ComponentProps<'div'>): React.JSX.Element | null;
|
|
55
|
+
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle };
|
|
56
|
+
//# sourceMappingURL=chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../source/components/chart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,iBAAiB,MAAM,UAAU,CAAA;AAI7C,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,WAAW,CAAA;IACnB,QAAQ,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,mBAAmB,CAAC,CAAC,UAAU,CAAC,CAAA;CACzF,CAAA;AAED,KAAK,wBAAwB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,GAAG,EAAE,CAAA;IACf,aAAa,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;IAChC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,GAAG,EAAE,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAA;IACrC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,KAAK,CAAC,SAAS,CAAA;IAChE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,KAAK,CAAC,SAAS,CAAA;IACjG,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,KAAK,gBAAgB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,CAAA;AAG3D,QAAA,MAAM,MAAM;;;CAAwC,CAAA;AAEpD,MAAM,MAAM,WAAW,GAAG;KACvB,CAAC,IAAI,MAAM,GAAG;QACb,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;QACvB,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;KAC3B,GAAG,CACA;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,KAAK,CAAA;KAAE,GACjC;QAAE,KAAK,CAAC,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,OAAO,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,CAChE;CACF,CAAA;AAkBD,iBAAS,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,oBAAoB,qBAqBjF;AAED,QAAA,MAAM,UAAU,GAAI,gBAAgB,gBAAgB,6BA2BnD,CAAA;AAED,QAAA,MAAM,YAAY,kCAA4B,CAAA;AAE9C,iBAAS,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,4BA4G3F;AAED,QAAA,MAAM,WAAW,iCAA2B,CAAA;AAE5C,iBAAS,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,4BAkCzF;AAqBD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,kBAAkB,EAAE,UAAU,EAAE,CAAA"}
|