@pihanga2/shadcn 0.2.21 → 0.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/cards/attachment/attachment.component.d.ts +4 -0
- package/cards/attachment/attachment.component.js +46 -0
- package/cards/attachment/attachment.component.js.map +1 -0
- package/cards/attachment/attachment.types.d.ts +95 -0
- package/cards/attachment/attachment.types.js +7 -0
- package/cards/attachment/attachment.types.js.map +1 -0
- package/cards/attachment/attachmentGroup.component.d.ts +4 -0
- package/cards/attachment/attachmentGroup.component.js +21 -0
- package/cards/attachment/attachmentGroup.component.js.map +1 -0
- package/cards/attachment/index.d.ts +1 -0
- package/cards/attachment/index.js +16 -0
- package/cards/attachment/index.js.map +1 -0
- package/cards/bubble/bubble.component.d.ts +4 -0
- package/cards/bubble/bubble.component.js +67 -0
- package/cards/bubble/bubble.component.js.map +1 -0
- package/cards/bubble/bubble.types.d.ts +106 -0
- package/cards/bubble/bubble.types.js +7 -0
- package/cards/bubble/bubble.types.js.map +1 -0
- package/cards/bubble/bubbleGroup.component.d.ts +4 -0
- package/cards/bubble/bubbleGroup.component.js +21 -0
- package/cards/bubble/bubbleGroup.component.js.map +1 -0
- package/cards/bubble/index.d.ts +1 -0
- package/cards/bubble/index.js +16 -0
- package/cards/bubble/index.js.map +1 -0
- package/cards/dataTable/dataTable.component.js +191 -124
- package/cards/dataTable/dataTable.component.js.map +1 -1
- package/cards/dataTable/dataTable.types.d.ts +50 -0
- package/cards/dataTable/dataTable.types.js +6 -3
- package/cards/dataTable/dataTable.types.js.map +1 -1
- package/cards/dataTable/index.js +6 -6
- package/cards/dropDownMenu/dropdown-menu.ui.js +41 -41
- package/cards/input/input.component.js +4 -4
- package/cards/jsonViewer/jsonViewer.component.js +1 -2
- package/cards/jsonViewer/jsonViewer.component.js.map +1 -1
- package/cards/message/index.d.ts +1 -0
- package/cards/message/index.js +15 -0
- package/cards/message/index.js.map +1 -0
- package/cards/message/message.component.d.ts +4 -0
- package/cards/message/message.component.js +47 -0
- package/cards/message/message.component.js.map +1 -0
- package/cards/message/message.types.d.ts +56 -0
- package/cards/message/message.types.js +7 -0
- package/cards/message/message.types.js.map +1 -0
- package/cards/message/messageGroup.component.d.ts +4 -0
- package/cards/message/messageGroup.component.js +21 -0
- package/cards/message/messageGroup.component.js.map +1 -0
- package/cards/swimlane/index.d.ts +2 -0
- package/cards/swimlane/index.js +14 -0
- package/cards/swimlane/index.js.map +1 -0
- package/cards/swimlane/swimlane.component.d.ts +4 -0
- package/cards/swimlane/swimlane.component.js +520 -0
- package/cards/swimlane/swimlane.component.js.map +1 -0
- package/cards/swimlane/swimlane.css +1 -0
- package/cards/swimlane/swimlane.demo.d.ts +12 -0
- package/cards/swimlane/swimlane.model.d.ts +41 -0
- package/cards/swimlane/swimlane.model.js +203 -0
- package/cards/swimlane/swimlane.model.js.map +1 -0
- package/cards/swimlane/swimlane.model.test.d.ts +1 -0
- package/cards/swimlane/swimlane.types.d.ts +271 -0
- package/cards/swimlane/swimlane.types.js +7 -0
- package/cards/swimlane/swimlane.types.js.map +1 -0
- package/cards.schema.json +6874 -0
- package/components/ui/attachment.js +102 -0
- package/components/ui/attachment.js.map +1 -0
- package/components/ui/badge.js +7 -7
- package/components/ui/bubble.js +73 -0
- package/components/ui/bubble.js.map +1 -0
- package/components/ui/button.js +11 -11
- package/components/ui/drawer.js +24 -24
- package/components/ui/empty.js +12 -12
- package/components/ui/field.js +16 -16
- package/components/ui/message.js +51 -0
- package/components/ui/message.js.map +1 -0
- package/components/ui/toggle-group.js +1 -1
- package/components/ui/toggle.js +1 -1
- package/package.json +23 -2
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { Button as t } from "./button.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { cva as n } from "class-variance-authority";
|
|
5
|
+
import { Slot as r } from "radix-ui";
|
|
6
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/ui/attachment.tsx
|
|
8
|
+
var a = n("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed", { variants: {
|
|
9
|
+
size: {
|
|
10
|
+
default: "gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",
|
|
11
|
+
sm: "gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",
|
|
12
|
+
xs: "gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"
|
|
13
|
+
},
|
|
14
|
+
orientation: {
|
|
15
|
+
horizontal: "min-w-40 items-center",
|
|
16
|
+
vertical: "w-24 flex-col has-data-[slot=attachment-content]:w-30"
|
|
17
|
+
}
|
|
18
|
+
} });
|
|
19
|
+
function o({ className: t, state: n = "done", size: r = "default", orientation: o = "horizontal", ...s }) {
|
|
20
|
+
return /* @__PURE__ */ i("div", {
|
|
21
|
+
"data-slot": "attachment",
|
|
22
|
+
"data-state": n,
|
|
23
|
+
"data-size": r,
|
|
24
|
+
"data-orientation": o,
|
|
25
|
+
className: e(a({
|
|
26
|
+
size: r,
|
|
27
|
+
orientation: o
|
|
28
|
+
}), t),
|
|
29
|
+
...s
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
var s = n("relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5", {
|
|
33
|
+
variants: { variant: {
|
|
34
|
+
icon: "",
|
|
35
|
+
image: "opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover"
|
|
36
|
+
} },
|
|
37
|
+
defaultVariants: { variant: "icon" }
|
|
38
|
+
});
|
|
39
|
+
function c({ className: t, variant: n = "icon", ...r }) {
|
|
40
|
+
return /* @__PURE__ */ i("div", {
|
|
41
|
+
"data-slot": "attachment-media",
|
|
42
|
+
"data-variant": n,
|
|
43
|
+
className: e(s({ variant: n }), t),
|
|
44
|
+
...r
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function l({ className: t, ...n }) {
|
|
48
|
+
return /* @__PURE__ */ i("div", {
|
|
49
|
+
"data-slot": "attachment-content",
|
|
50
|
+
className: e("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1", t),
|
|
51
|
+
...n
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function u({ className: t, ...n }) {
|
|
55
|
+
return /* @__PURE__ */ i("span", {
|
|
56
|
+
"data-slot": "attachment-title",
|
|
57
|
+
className: e("block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:animate-pulse group-data-[state=uploading]/attachment:animate-pulse", t),
|
|
58
|
+
...n
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function d({ className: t, ...n }) {
|
|
62
|
+
return /* @__PURE__ */ i("span", {
|
|
63
|
+
"data-slot": "attachment-description",
|
|
64
|
+
className: e("mt-0.5 block min-w-0 max-w-full truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80", t),
|
|
65
|
+
...n
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function f({ className: t, ...n }) {
|
|
69
|
+
return /* @__PURE__ */ i("div", {
|
|
70
|
+
"data-slot": "attachment-actions",
|
|
71
|
+
className: e("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1", t),
|
|
72
|
+
...n
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function p({ className: n, variant: r, size: a = "icon-xs", ...o }) {
|
|
76
|
+
return /* @__PURE__ */ i(t, {
|
|
77
|
+
"data-slot": "attachment-action",
|
|
78
|
+
variant: r ?? "ghost",
|
|
79
|
+
size: a,
|
|
80
|
+
className: e(n),
|
|
81
|
+
...o
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function m({ className: t, asChild: n = !1, type: a, ...o }) {
|
|
85
|
+
return /* @__PURE__ */ i(n ? r.Root : "button", {
|
|
86
|
+
"data-slot": "attachment-trigger",
|
|
87
|
+
type: n ? void 0 : a ?? "button",
|
|
88
|
+
className: e("absolute inset-0 z-10 outline-none", t),
|
|
89
|
+
...o
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function h({ className: t, ...n }) {
|
|
93
|
+
return /* @__PURE__ */ i("div", {
|
|
94
|
+
"data-slot": "attachment-group",
|
|
95
|
+
className: e("flex min-w-0 snap-x snap-mandatory scroll-px-1 gap-3 overflow-x-auto overscroll-x-contain py-1 [scrollbar-width:none] *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start [&::-webkit-scrollbar]:hidden", t),
|
|
96
|
+
...n
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
export { o as Attachment, p as AttachmentAction, f as AttachmentActions, l as AttachmentContent, d as AttachmentDescription, h as AttachmentGroup, c as AttachmentMedia, u as AttachmentTitle, m as AttachmentTrigger };
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=attachment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment.js","names":[],"sources":["../../../src/components/ui/attachment.tsx"],"sourcesContent":["import * as React from \"react\";\nimport {cva, type VariantProps} from \"class-variance-authority\";\nimport {Slot} from \"radix-ui\";\n\nimport {cn} from \"@/lib/utils\";\nimport {Button} from \"@/components/ui/button\";\n\nconst attachmentVariants = cva(\n \"group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed\",\n {\n variants: {\n size: {\n default:\n \"gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2\",\n sm: \"gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5\",\n xs: \"gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1\",\n },\n orientation: {\n horizontal: \"min-w-40 items-center\",\n vertical: \"w-24 flex-col has-data-[slot=attachment-content]:w-30\",\n },\n },\n },\n);\n\nfunction Attachment({\n className,\n state = \"done\",\n size = \"default\",\n orientation = \"horizontal\",\n ...props\n}: React.ComponentProps<\"div\"> &\n VariantProps<typeof attachmentVariants> & {\n state?: \"idle\" | \"uploading\" | \"processing\" | \"error\" | \"done\";\n }) {\n return (\n <div\n data-slot=\"attachment\"\n data-state={state}\n data-size={size}\n data-orientation={orientation}\n className={cn(attachmentVariants({size, orientation}), className)}\n {...props}\n />\n );\n}\n\nconst attachmentMediaVariants = cva(\n \"relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5\",\n {\n variants: {\n variant: {\n icon: \"\",\n image:\n \"opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover\",\n },\n },\n defaultVariants: {\n variant: \"icon\",\n },\n },\n);\n\nfunction AttachmentMedia({\n className,\n variant = \"icon\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof attachmentMediaVariants>) {\n return (\n <div\n data-slot=\"attachment-media\"\n data-variant={variant}\n className={cn(attachmentMediaVariants({variant}), className)}\n {...props}\n />\n );\n}\n\nfunction AttachmentContent({className, ...props}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"attachment-content\"\n className={cn(\n \"max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AttachmentTitle({className, ...props}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"attachment-title\"\n className={cn(\n \"block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:animate-pulse group-data-[state=uploading]/attachment:animate-pulse\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AttachmentDescription({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"attachment-description\"\n className={cn(\n \"mt-0.5 block min-w-0 max-w-full truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AttachmentActions({className, ...props}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"attachment-actions\"\n className={cn(\n \"relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AttachmentAction({\n className,\n variant,\n size = \"icon-xs\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n return (\n <Button\n data-slot=\"attachment-action\"\n variant={variant ?? \"ghost\"}\n size={size}\n className={cn(className)}\n {...props}\n />\n );\n}\n\nfunction AttachmentTrigger({\n className,\n asChild = false,\n type,\n ...props\n}: React.ComponentProps<\"button\"> & {\n asChild?: boolean;\n}) {\n const Comp = asChild ? Slot.Root : \"button\";\n\n return (\n <Comp\n data-slot=\"attachment-trigger\"\n type={asChild ? undefined : (type ?? \"button\")}\n className={cn(\"absolute inset-0 z-10 outline-none\", className)}\n {...props}\n />\n );\n}\n\nfunction AttachmentGroup({className, ...props}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"attachment-group\"\n className={cn(\n \"flex min-w-0 snap-x snap-mandatory scroll-px-1 gap-3 overflow-x-auto overscroll-x-contain py-1 [scrollbar-width:none] *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start [&::-webkit-scrollbar]:hidden\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n Attachment,\n AttachmentGroup,\n AttachmentMedia,\n AttachmentContent,\n AttachmentTitle,\n AttachmentDescription,\n AttachmentActions,\n AttachmentAction,\n AttachmentTrigger,\n};\n"],"mappings":";;;;;;;AAOA,IAAM,IAAqB,EACzB,ySACA,EACE,UAAU;CACR,MAAM;EACJ,SACE;EACF,IAAI;EACJ,IAAI;CACN;CACA,aAAa;EACX,YAAY;EACZ,UAAU;CACZ;AACF,EACF,CACF;AAEA,SAAS,EAAW,EAClB,cACA,WAAQ,QACR,UAAO,WACP,iBAAc,cACd,GAAG,KAIA;CACH,OACE,kBAAC,OAAD;EACE,aAAU;EACV,cAAY;EACZ,aAAW;EACX,oBAAkB;EAClB,WAAW,EAAG,EAAmB;GAAC;GAAM;EAAW,CAAC,GAAG,CAAS;EAChE,GAAI;CACL,CAAA;AAEL;AAEA,IAAM,IAA0B,EAC9B,ymBACA;CACE,UAAU,EACR,SAAS;EACP,MAAM;EACN,OACE;CACJ,EACF;CACA,iBAAiB,EACf,SAAS,OACX;AACF,CACF;AAEA,SAAS,EAAgB,EACvB,cACA,aAAU,QACV,GAAG,KAC0E;CAC7E,OACE,kBAAC,OAAD;EACE,aAAU;EACV,gBAAc;EACd,WAAW,EAAG,EAAwB,EAAC,WAAO,CAAC,GAAG,CAAS;EAC3D,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAkB,EAAC,cAAW,GAAG,KAAqC;CAC7E,OACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAW,EACT,6FACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAgB,EAAC,cAAW,GAAG,KAAsC;CAC5E,OACE,kBAAC,QAAD;EACE,aAAU;EACV,WAAW,EACT,8JACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAsB,EAC7B,cACA,GAAG,KAC4B;CAC/B,OACE,kBAAC,QAAD;EACE,aAAU;EACV,WAAW,EACT,kIACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAkB,EAAC,cAAW,GAAG,KAAqC;CAC7E,OACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAW,EACT,6PACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAiB,EACxB,cACA,YACA,UAAO,WACP,GAAG,KACmC;CACtC,OACE,kBAAC,GAAD;EACE,aAAU;EACV,SAAS,KAAW;EACd;EACN,WAAW,EAAG,CAAS;EACvB,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAkB,EACzB,cACA,aAAU,IACV,SACA,GAAG,KAGF;CAGD,OACE,kBAHW,IAAU,EAAK,OAAO,UAGjC;EACE,aAAU;EACV,MAAM,IAAU,KAAA,IAAa,KAAQ;EACrC,WAAW,EAAG,sCAAsC,CAAS;EAC7D,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAgB,EAAC,cAAW,GAAG,KAAqC;CAC3E,OACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAW,EACT,8NACA,CACF;EACA,GAAI;CACL,CAAA;AAEL"}
|
package/components/ui/badge.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { cn as e } from "../lib/utils.js";
|
|
2
2
|
import "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { cva as t } from "class-variance-authority";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
import { Slot as r } from "@radix-ui/react-slot";
|
|
6
6
|
//#region src/components/ui/badge.tsx
|
|
7
|
-
var i =
|
|
7
|
+
var i = t("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", {
|
|
8
8
|
variants: { variant: {
|
|
9
9
|
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
10
10
|
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
@@ -13,10 +13,10 @@ var i = r("inline-flex items-center justify-center rounded-full border px-2 py-0
|
|
|
13
13
|
} },
|
|
14
14
|
defaultVariants: { variant: "default" }
|
|
15
15
|
});
|
|
16
|
-
function a({ className:
|
|
17
|
-
return /* @__PURE__ */
|
|
16
|
+
function a({ className: t, variant: a, asChild: o = !1, ...s }) {
|
|
17
|
+
return /* @__PURE__ */ n(o ? r : "span", {
|
|
18
18
|
"data-slot": "badge",
|
|
19
|
-
className: e(i({ variant: a }),
|
|
19
|
+
className: e(i({ variant: a }), t),
|
|
20
20
|
...s
|
|
21
21
|
});
|
|
22
22
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { cva as t } from "class-variance-authority";
|
|
4
|
+
import { Slot as n } from "radix-ui";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/ui/bubble.tsx
|
|
7
|
+
function i({ className: t, ...n }) {
|
|
8
|
+
return /* @__PURE__ */ r("div", {
|
|
9
|
+
"data-slot": "bubble-group",
|
|
10
|
+
className: e("flex min-w-0 flex-col gap-2", t),
|
|
11
|
+
...n
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
var a = t("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full", {
|
|
15
|
+
variants: { variant: {
|
|
16
|
+
default: "*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",
|
|
17
|
+
secondary: "*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",
|
|
18
|
+
muted: "*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",
|
|
19
|
+
tinted: "*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",
|
|
20
|
+
outline: "*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",
|
|
21
|
+
ghost: "border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",
|
|
22
|
+
destructive: "*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"
|
|
23
|
+
} },
|
|
24
|
+
defaultVariants: { variant: "default" }
|
|
25
|
+
});
|
|
26
|
+
function o({ variant: t = "default", align: n = "start", className: i, ...o }) {
|
|
27
|
+
return /* @__PURE__ */ r("div", {
|
|
28
|
+
"data-slot": "bubble",
|
|
29
|
+
"data-variant": t,
|
|
30
|
+
"data-align": n,
|
|
31
|
+
className: e(a({ variant: t }), i),
|
|
32
|
+
...o
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function s({ asChild: t = !1, className: i, ...a }) {
|
|
36
|
+
return /* @__PURE__ */ r(t ? n.Root : "div", {
|
|
37
|
+
"data-slot": "bubble-content",
|
|
38
|
+
className: e("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50", i),
|
|
39
|
+
...a
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
var c = t("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0", {
|
|
43
|
+
variants: {
|
|
44
|
+
side: {
|
|
45
|
+
top: "top-0 -translate-y-3/4",
|
|
46
|
+
bottom: "bottom-0 translate-y-3/4"
|
|
47
|
+
},
|
|
48
|
+
align: {
|
|
49
|
+
start: "left-3",
|
|
50
|
+
end: "right-3"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
defaultVariants: {
|
|
54
|
+
side: "bottom",
|
|
55
|
+
align: "end"
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
function l({ side: t = "bottom", align: n = "end", className: i, ...a }) {
|
|
59
|
+
return /* @__PURE__ */ r("div", {
|
|
60
|
+
"data-slot": "bubble-reactions",
|
|
61
|
+
"data-align": n,
|
|
62
|
+
"data-side": t,
|
|
63
|
+
className: e(c({
|
|
64
|
+
side: t,
|
|
65
|
+
align: n
|
|
66
|
+
}), i),
|
|
67
|
+
...a
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
export { o as Bubble, s as BubbleContent, i as BubbleGroup, l as BubbleReactions };
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=bubble.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bubble.js","names":[],"sources":["../../../src/components/ui/bubble.tsx"],"sourcesContent":["import * as React from \"react\";\nimport {cva, type VariantProps} from \"class-variance-authority\";\nimport {Slot} from \"radix-ui\";\n\nimport {cn} from \"@/lib/utils\";\n\nfunction BubbleGroup({className, ...props}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"bubble-group\"\n className={cn(\"flex min-w-0 flex-col gap-2\", className)}\n {...props}\n />\n );\n}\n\nconst bubbleVariants = cva(\n \"group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full\",\n {\n variants: {\n variant: {\n default:\n \"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80\",\n secondary:\n \"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]\",\n muted:\n \"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]\",\n tinted:\n \"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]\",\n outline:\n \"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30\",\n ghost:\n \"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50\",\n destructive:\n \"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nfunction Bubble({\n variant = \"default\",\n align = \"start\",\n className,\n ...props\n}: React.ComponentProps<\"div\"> &\n VariantProps<typeof bubbleVariants> & {\n align?: \"start\" | \"end\";\n }) {\n return (\n <div\n data-slot=\"bubble\"\n data-variant={variant}\n data-align={align}\n className={cn(bubbleVariants({variant}), className)}\n {...props}\n />\n );\n}\n\nfunction BubbleContent({\n asChild = false,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n asChild?: boolean;\n}) {\n const Comp = asChild ? Slot.Root : \"div\";\n\n return (\n <Comp\n data-slot=\"bubble-content\"\n className={cn(\n \"w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50\",\n className,\n )}\n {...props}\n />\n );\n}\n\nconst bubbleReactionsVariants = cva(\n \"absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0\",\n {\n variants: {\n side: {\n top: \"top-0 -translate-y-3/4\",\n bottom: \"bottom-0 translate-y-3/4\",\n },\n align: {\n start: \"left-3\",\n end: \"right-3\",\n },\n },\n defaultVariants: {\n side: \"bottom\",\n align: \"end\",\n },\n },\n);\n\nfunction BubbleReactions({\n side = \"bottom\",\n align = \"end\",\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n align?: \"start\" | \"end\";\n side?: \"top\" | \"bottom\";\n}) {\n return (\n <div\n data-slot=\"bubble-reactions\"\n data-align={align}\n data-side={side}\n className={cn(bubbleReactionsVariants({side, align}), className)}\n {...props}\n />\n );\n}\n\nexport {BubbleGroup, Bubble, BubbleContent, BubbleReactions};\n"],"mappings":";;;;;;AAMA,SAAS,EAAY,EAAC,cAAW,GAAG,KAAqC;CACvE,OACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAW,EAAG,+BAA+B,CAAS;EACtD,GAAI;CACL,CAAA;AAEL;AAEA,IAAM,IAAiB,EACrB,yKACA;CACE,UAAU,EACR,SAAS;EACP,SACE;EACF,WACE;EACF,OACE;EACF,QACE;EACF,SACE;EACF,OACE;EACF,aACE;CACJ,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CACF;AAEA,SAAS,EAAO,EACd,aAAU,WACV,WAAQ,SACR,cACA,GAAG,KAIA;CACH,OACE,kBAAC,OAAD;EACE,aAAU;EACV,gBAAc;EACd,cAAY;EACZ,WAAW,EAAG,EAAe,EAAC,WAAO,CAAC,GAAG,CAAS;EAClD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAc,EACrB,aAAU,IACV,cACA,GAAG,KAGF;CAGD,OACE,kBAHW,IAAU,EAAK,OAAO,OAGjC;EACE,aAAU;EACV,WAAW,EACT,6VACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAM,IAA0B,EAC9B,qJACA;CACE,UAAU;EACR,MAAM;GACJ,KAAK;GACL,QAAQ;EACV;EACA,OAAO;GACL,OAAO;GACP,KAAK;EACP;CACF;CACA,iBAAiB;EACf,MAAM;EACN,OAAO;CACT;AACF,CACF;AAEA,SAAS,EAAgB,EACvB,UAAO,UACP,WAAQ,OACR,cACA,GAAG,KAIF;CACD,OACE,kBAAC,OAAD;EACE,aAAU;EACV,cAAY;EACZ,aAAW;EACX,WAAW,EAAG,EAAwB;GAAC;GAAM;EAAK,CAAC,GAAG,CAAS;EAC/D,GAAI;CACL,CAAA;AAEL"}
|
package/components/ui/button.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/utils.js";
|
|
2
2
|
import "react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { cva as t } from "class-variance-authority";
|
|
4
|
+
import { Slot as n } from "radix-ui";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/ui/button.tsx
|
|
7
|
-
var i =
|
|
7
|
+
var i = t("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
10
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
@@ -48,8 +48,8 @@ var i = r("inline-flex shrink-0 items-center justify-center gap-2 rounded-md tex
|
|
|
48
48
|
size: "default"
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
-
function a({ className:
|
|
52
|
-
return /* @__PURE__ */
|
|
51
|
+
function a({ className: t, variant: a = "default", size: o = "default", asChild: s = !1, label: c, active: l, focused: u, isMenu: d, truncate: f, loading: p, isPending: m, loadingClassName: h, ...g }) {
|
|
52
|
+
return /* @__PURE__ */ r(s ? n.Root : "button", {
|
|
53
53
|
"data-slot": "button",
|
|
54
54
|
"data-variant": a,
|
|
55
55
|
"data-size": o,
|
|
@@ -62,15 +62,15 @@ function a({ className: r, variant: a = "default", size: o = "default", asChild:
|
|
|
62
62
|
className: e(i({
|
|
63
63
|
variant: a,
|
|
64
64
|
size: o,
|
|
65
|
-
className:
|
|
65
|
+
className: t
|
|
66
66
|
}), f && "truncate"),
|
|
67
67
|
...g
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
function o({ className: t, variant:
|
|
71
|
-
return /* @__PURE__ */
|
|
70
|
+
function o({ className: t, variant: n = "default", size: a = "default", href: o, target: s, label: c, active: l, focused: u, isMenu: d, truncate: f, loading: p, isPending: m, loadingClassName: h, onClick: g, children: _, ...v }) {
|
|
71
|
+
return /* @__PURE__ */ r("a", {
|
|
72
72
|
"data-slot": "button",
|
|
73
|
-
"data-variant":
|
|
73
|
+
"data-variant": n,
|
|
74
74
|
"data-size": a,
|
|
75
75
|
href: o,
|
|
76
76
|
target: s,
|
|
@@ -81,7 +81,7 @@ function o({ className: t, variant: r = "default", size: a = "default", href: o,
|
|
|
81
81
|
"data-loading": p || void 0,
|
|
82
82
|
"data-pending": m || void 0,
|
|
83
83
|
className: e(i({
|
|
84
|
-
variant:
|
|
84
|
+
variant: n,
|
|
85
85
|
size: a,
|
|
86
86
|
className: t
|
|
87
87
|
}), f && "truncate"),
|
package/components/ui/drawer.js
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import { Drawer as t } from "../../node_modules/vaul/dist/index.js";
|
|
3
2
|
import "react";
|
|
4
|
-
import { jsx as
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
import { Drawer as r } from "vaul";
|
|
5
5
|
//#region src/components/ui/drawer.tsx
|
|
6
6
|
function i({ ...e }) {
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ t(r.Root, {
|
|
8
8
|
"data-slot": "drawer",
|
|
9
9
|
...e
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
function a({ ...e }) {
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ t(r.Trigger, {
|
|
14
14
|
"data-slot": "drawer-trigger",
|
|
15
15
|
...e
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
function o({ ...e }) {
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ t(r.Portal, {
|
|
20
20
|
"data-slot": "drawer-portal",
|
|
21
21
|
...e
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
function s({ ...e }) {
|
|
25
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ t(r.Close, {
|
|
26
26
|
"data-slot": "drawer-close",
|
|
27
27
|
...e
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
function c({ className:
|
|
31
|
-
return /* @__PURE__ */
|
|
30
|
+
function c({ className: n, ...i }) {
|
|
31
|
+
return /* @__PURE__ */ t(r.Overlay, {
|
|
32
32
|
"data-slot": "drawer-overlay",
|
|
33
|
-
className: e("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
33
|
+
className: e("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", n),
|
|
34
34
|
...i
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
function l({ className: i, children: a, ...s }) {
|
|
38
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ n(o, {
|
|
39
39
|
"data-slot": "drawer-portal",
|
|
40
|
-
children: [/* @__PURE__ */
|
|
40
|
+
children: [/* @__PURE__ */ t(c, {}), /* @__PURE__ */ n(r.Content, {
|
|
41
41
|
"data-slot": "drawer-content",
|
|
42
42
|
className: e("group/drawer-content fixed z-50 flex h-auto flex-col bg-background", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm", i),
|
|
43
43
|
...s,
|
|
44
|
-
children: [/* @__PURE__ */
|
|
44
|
+
children: [/* @__PURE__ */ t("div", { className: "mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), a]
|
|
45
45
|
})]
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
function u({ className:
|
|
49
|
-
return /* @__PURE__ */
|
|
48
|
+
function u({ className: n, ...r }) {
|
|
49
|
+
return /* @__PURE__ */ t("div", {
|
|
50
50
|
"data-slot": "drawer-header",
|
|
51
|
-
className: e("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",
|
|
51
|
+
className: e("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left", n),
|
|
52
52
|
...r
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
function d({ className:
|
|
56
|
-
return /* @__PURE__ */
|
|
55
|
+
function d({ className: n, ...r }) {
|
|
56
|
+
return /* @__PURE__ */ t("div", {
|
|
57
57
|
"data-slot": "drawer-footer",
|
|
58
|
-
className: e("mt-auto flex flex-col gap-2 p-4",
|
|
58
|
+
className: e("mt-auto flex flex-col gap-2 p-4", n),
|
|
59
59
|
...r
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
function f({ className:
|
|
63
|
-
return /* @__PURE__ */
|
|
62
|
+
function f({ className: n, ...i }) {
|
|
63
|
+
return /* @__PURE__ */ t(r.Title, {
|
|
64
64
|
"data-slot": "drawer-title",
|
|
65
|
-
className: e("font-semibold text-foreground",
|
|
65
|
+
className: e("font-semibold text-foreground", n),
|
|
66
66
|
...i
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
function p({ className:
|
|
70
|
-
return /* @__PURE__ */
|
|
69
|
+
function p({ className: n, ...i }) {
|
|
70
|
+
return /* @__PURE__ */ t(r.Description, {
|
|
71
71
|
"data-slot": "drawer-description",
|
|
72
|
-
className: e("text-sm text-muted-foreground",
|
|
72
|
+
className: e("text-sm text-muted-foreground", n),
|
|
73
73
|
...i
|
|
74
74
|
});
|
|
75
75
|
}
|
package/components/ui/empty.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/utils.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { cva as t } from "class-variance-authority";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/ui/empty.tsx
|
|
5
|
-
function r({ className:
|
|
6
|
-
return /* @__PURE__ */
|
|
5
|
+
function r({ className: t, ...r }) {
|
|
6
|
+
return /* @__PURE__ */ n("div", {
|
|
7
7
|
"data-slot": "empty",
|
|
8
|
-
className: e("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance rounded-lg border-dashed p-6 text-center md:p-12",
|
|
8
|
+
className: e("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance rounded-lg border-dashed p-6 text-center md:p-12", t),
|
|
9
9
|
...r
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
|
-
var i =
|
|
12
|
+
var i = t("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
13
13
|
variants: { variant: {
|
|
14
14
|
default: "bg-transparent",
|
|
15
15
|
icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"
|
|
16
16
|
} },
|
|
17
17
|
defaultVariants: { variant: "default" }
|
|
18
18
|
});
|
|
19
|
-
function a({ className:
|
|
20
|
-
return /* @__PURE__ */
|
|
19
|
+
function a({ className: t, variant: r = "default", ...a }) {
|
|
20
|
+
return /* @__PURE__ */ n("div", {
|
|
21
21
|
"data-slot": "empty-icon",
|
|
22
22
|
"data-variant": r,
|
|
23
23
|
className: e(i({
|
|
24
24
|
variant: r,
|
|
25
|
-
className:
|
|
25
|
+
className: t
|
|
26
26
|
})),
|
|
27
27
|
...a
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
function o({ className:
|
|
31
|
-
return /* @__PURE__ */
|
|
30
|
+
function o({ className: t, ...r }) {
|
|
31
|
+
return /* @__PURE__ */ n("div", {
|
|
32
32
|
"data-slot": "empty-content",
|
|
33
|
-
className: e("flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm",
|
|
33
|
+
className: e("flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm", t),
|
|
34
34
|
...r
|
|
35
35
|
});
|
|
36
36
|
}
|
package/components/ui/field.js
CHANGED
|
@@ -2,10 +2,10 @@ import { cn as e } from "../../lib/utils.js";
|
|
|
2
2
|
import { Label as t } from "./label.js";
|
|
3
3
|
import "./separator.js";
|
|
4
4
|
import { useMemo as n } from "react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { cva as r } from "class-variance-authority";
|
|
6
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/ui/field.tsx
|
|
8
|
-
var a =
|
|
8
|
+
var a = r("group/field flex w-full gap-3 data-[invalid=true]:text-destructive", {
|
|
9
9
|
variants: { orientation: {
|
|
10
10
|
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
11
11
|
horizontal: [
|
|
@@ -21,40 +21,40 @@ var a = i("group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
|
|
|
21
21
|
} },
|
|
22
22
|
defaultVariants: { orientation: "vertical" }
|
|
23
23
|
});
|
|
24
|
-
function o({ className: t, orientation: n = "vertical", ...
|
|
25
|
-
return /* @__PURE__ */
|
|
24
|
+
function o({ className: t, orientation: n = "vertical", ...r }) {
|
|
25
|
+
return /* @__PURE__ */ i("div", {
|
|
26
26
|
role: "group",
|
|
27
27
|
"data-slot": "field",
|
|
28
28
|
"data-orientation": n,
|
|
29
29
|
className: e(a({ orientation: n }), t),
|
|
30
|
-
...
|
|
30
|
+
...r
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
function s({ className: n, ...
|
|
34
|
-
return /* @__PURE__ */
|
|
33
|
+
function s({ className: n, ...r }) {
|
|
34
|
+
return /* @__PURE__ */ i(t, {
|
|
35
35
|
"data-slot": "field-label",
|
|
36
36
|
className: e("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4", "has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10", n),
|
|
37
|
-
...
|
|
37
|
+
...r
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
function c({ className: t, ...n }) {
|
|
41
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ i("p", {
|
|
42
42
|
"data-slot": "field-description",
|
|
43
43
|
className: e("text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance", "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", t),
|
|
44
44
|
...n
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
function l({ className: t, children:
|
|
47
|
+
function l({ className: t, children: r, errors: a, ...o }) {
|
|
48
48
|
let s = n(() => {
|
|
49
|
-
if (
|
|
49
|
+
if (r) return r;
|
|
50
50
|
if (!a?.length) return null;
|
|
51
51
|
let e = [...new Map(a.map((e) => [e?.message, e])).values()];
|
|
52
|
-
return e?.length == 1 ? e[0]?.message : /* @__PURE__ */
|
|
52
|
+
return e?.length == 1 ? e[0]?.message : /* @__PURE__ */ i("ul", {
|
|
53
53
|
className: "ml-4 flex list-disc flex-col gap-1",
|
|
54
|
-
children: e.map((e, t) => e?.message && /* @__PURE__ */
|
|
54
|
+
children: e.map((e, t) => e?.message && /* @__PURE__ */ i("li", { children: e.message }, t))
|
|
55
55
|
});
|
|
56
|
-
}, [
|
|
57
|
-
return s ? /* @__PURE__ */
|
|
56
|
+
}, [r, a]);
|
|
57
|
+
return s ? /* @__PURE__ */ i("div", {
|
|
58
58
|
role: "alert",
|
|
59
59
|
"data-slot": "field-error",
|
|
60
60
|
className: e("text-sm font-normal text-destructive", t),
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ui/message.tsx
|
|
5
|
+
function n({ className: n, ...r }) {
|
|
6
|
+
return /* @__PURE__ */ t("div", {
|
|
7
|
+
"data-slot": "message-group",
|
|
8
|
+
className: e("flex min-w-0 flex-col gap-2", n),
|
|
9
|
+
...r
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function r({ className: n, align: r = "start", ...i }) {
|
|
13
|
+
return /* @__PURE__ */ t("div", {
|
|
14
|
+
"data-slot": "message",
|
|
15
|
+
"data-align": r,
|
|
16
|
+
className: e("group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse", n),
|
|
17
|
+
...i
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function i({ className: n, ...r }) {
|
|
21
|
+
return /* @__PURE__ */ t("div", {
|
|
22
|
+
"data-slot": "message-avatar",
|
|
23
|
+
className: e("flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-data-[slot=message-footer]/message:-translate-y-8", n),
|
|
24
|
+
...r
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function a({ className: n, ...r }) {
|
|
28
|
+
return /* @__PURE__ */ t("div", {
|
|
29
|
+
"data-slot": "message-content",
|
|
30
|
+
className: e("flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end", n),
|
|
31
|
+
...r
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function o({ className: n, ...r }) {
|
|
35
|
+
return /* @__PURE__ */ t("div", {
|
|
36
|
+
"data-slot": "message-header",
|
|
37
|
+
className: e("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0", n),
|
|
38
|
+
...r
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function s({ className: n, ...r }) {
|
|
42
|
+
return /* @__PURE__ */ t("div", {
|
|
43
|
+
"data-slot": "message-footer",
|
|
44
|
+
className: e("flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 group-data-[align=end]/message:justify-end", n),
|
|
45
|
+
...r
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { r as Message, i as MessageAvatar, a as MessageContent, s as MessageFooter, n as MessageGroup, o as MessageHeader };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.js","names":[],"sources":["../../../src/components/ui/message.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport {cn} from \"@/lib/utils\";\n\nfunction MessageGroup({className, ...props}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"message-group\"\n className={cn(\"flex min-w-0 flex-col gap-2\", className)}\n {...props}\n />\n );\n}\n\nfunction Message({\n className,\n align = \"start\",\n ...props\n}: React.ComponentProps<\"div\"> & {align?: \"start\" | \"end\"}) {\n return (\n <div\n data-slot=\"message\"\n data-align={align}\n className={cn(\n \"group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction MessageAvatar({className, ...props}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"message-avatar\"\n className={cn(\n \"flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-data-[slot=message-footer]/message:-translate-y-8\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction MessageContent({className, ...props}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"message-content\"\n className={cn(\n \"flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction MessageHeader({className, ...props}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"message-header\"\n className={cn(\n \"flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction MessageFooter({className, ...props}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"message-footer\"\n className={cn(\n \"flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 group-data-[align=end]/message:justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {MessageGroup, Message, MessageAvatar, MessageContent, MessageFooter, MessageHeader};\n"],"mappings":";;;;AAIA,SAAS,EAAa,EAAC,cAAW,GAAG,KAAqC;CACxE,OACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAW,EAAG,+BAA+B,CAAS;EACtD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAQ,EACf,cACA,WAAQ,SACR,GAAG,KACuD;CAC1D,OACE,kBAAC,OAAD;EACE,aAAU;EACV,cAAY;EACZ,WAAW,EACT,8FACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAc,EAAC,cAAW,GAAG,KAAqC;CACzE,OACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAW,EACT,sKACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAe,EAAC,cAAW,GAAG,KAAqC;CAC1E,OACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAW,EACT,4GACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAc,EAAC,cAAW,GAAG,KAAqC;CACzE,OACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAW,EACT,mIACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAc,EAAC,cAAW,GAAG,KAAqC;CACzE,OACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAW,EACT,8KACA,CACF;EACA,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
3
|
import { toggleVariants as t } from "./toggle.js";
|
|
4
4
|
import * as n from "react";
|
|
5
|
+
import "class-variance-authority";
|
|
5
6
|
import { ToggleGroup as r } from "radix-ui";
|
|
6
7
|
import { jsx as i } from "react/jsx-runtime";
|
|
7
|
-
import "class-variance-authority";
|
|
8
8
|
//#region src/components/ui/toggle-group.tsx
|
|
9
9
|
var a = n.createContext({
|
|
10
10
|
size: "default",
|
package/components/ui/toggle.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "../../lib/utils.js";
|
|
2
2
|
import "react";
|
|
3
|
+
import { cva as e } from "class-variance-authority";
|
|
3
4
|
import "radix-ui";
|
|
4
5
|
import "react/jsx-runtime";
|
|
5
|
-
import { cva as e } from "class-variance-authority";
|
|
6
6
|
//#region src/components/ui/toggle.tsx
|
|
7
7
|
var t = e("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
8
8
|
variants: {
|