@pihanga2/shadcn 0.2.20 → 0.2.22
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/AGENT.using-cards.md +2 -2
- package/README.md +4 -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/button/button.component.js +56 -54
- package/cards/button/button.component.js.map +1 -1
- package/cards/button/button.types.d.ts +24 -0
- package/cards/button/button.types.js.map +1 -1
- package/cards/checkbox/checkbox.types.d.ts +2 -7
- package/cards/checkbox/checkbox.types.js.map +1 -1
- 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/field/field.component.js +1 -1
- package/cards/field/field.component.js.map +1 -1
- package/cards/form/form.component.js +57 -32
- package/cards/form/form.component.js.map +1 -1
- package/cards/form/form.context.d.ts +11 -0
- package/cards/form/form.context.js +1 -0
- package/cards/form/form.context.js.map +1 -1
- package/cards/form/form.types.d.ts +75 -0
- package/cards/form/form.types.js +6 -2
- package/cards/form/form.types.js.map +1 -1
- package/cards/form/index.js +5 -5
- package/cards/input/index.js +6 -6
- package/cards/input/input.component.js +38 -32
- package/cards/input/input.component.js.map +1 -1
- package/cards/input/input.types.d.ts +14 -7
- package/cards/input/input.types.js +2 -2
- package/cards/input/input.types.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/pageWithNavbarMeta/index.js +35 -25
- package/cards/pageWithNavbarMeta/index.js.map +1 -1
- package/cards/pageWithNavbarMeta/pageWithNavbarMeta.types.d.ts +1 -4
- package/cards/select/select.types.d.ts +2 -7
- package/cards/select/select.types.js.map +1 -1
- package/cards/switch/switch.types.d.ts +2 -7
- package/cards/switch/switch.types.js.map +1 -1
- package/cards/textArea/textArea.component.js +1 -1
- package/cards/textArea/textArea.component.js.map +1 -1
- package/cards/textArea/textArea.types.d.ts +15 -11
- package/cards/textArea/textArea.types.js.map +1 -1
- package/cards/textField/textField.component.js +13 -9
- package/cards/textField/textField.component.js.map +1 -1
- package/cards/textField/textField.types.d.ts +12 -7
- package/cards/textField/textField.types.js.map +1 -1
- package/cards/toggleGroup/toggleGroup.types.d.ts +2 -7
- package/cards/toggleGroup/toggleGroup.types.js.map +1 -1
- 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/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 +17 -2
|
@@ -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/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: {
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pihanga2/shadcn",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.22",
|
|
4
4
|
"description": "Pihanga core card components built on shadcn/ui and Radix UI — the npm distribution of pihanga-shadcn.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
|
+
"./cards/attachment": {
|
|
8
|
+
"import": "./cards/attachment/index.js",
|
|
9
|
+
"types": "./cards/attachment/index.d.ts"
|
|
10
|
+
},
|
|
7
11
|
"./cards/avatar": {
|
|
8
12
|
"import": "./cards/avatar/index.js",
|
|
9
13
|
"types": "./cards/avatar/index.d.ts"
|
|
@@ -16,6 +20,10 @@
|
|
|
16
20
|
"import": "./cards/box/index.js",
|
|
17
21
|
"types": "./cards/box/index.d.ts"
|
|
18
22
|
},
|
|
23
|
+
"./cards/bubble": {
|
|
24
|
+
"import": "./cards/bubble/index.js",
|
|
25
|
+
"types": "./cards/bubble/index.d.ts"
|
|
26
|
+
},
|
|
19
27
|
"./cards/button": {
|
|
20
28
|
"import": "./cards/button/index.js",
|
|
21
29
|
"types": "./cards/button/index.d.ts"
|
|
@@ -108,6 +116,10 @@
|
|
|
108
116
|
"import": "./cards/menu/index.js",
|
|
109
117
|
"types": "./cards/menu/index.d.ts"
|
|
110
118
|
},
|
|
119
|
+
"./cards/message": {
|
|
120
|
+
"import": "./cards/message/index.js",
|
|
121
|
+
"types": "./cards/message/index.d.ts"
|
|
122
|
+
},
|
|
111
123
|
"./cards/modeToggle": {
|
|
112
124
|
"import": "./cards/modeToggle/index.js",
|
|
113
125
|
"types": "./cards/modeToggle/index.d.ts"
|
|
@@ -226,9 +238,11 @@
|
|
|
226
238
|
}
|
|
227
239
|
},
|
|
228
240
|
"sideEffects": [
|
|
241
|
+
"./cards/attachment/index.js",
|
|
229
242
|
"./cards/avatar/index.js",
|
|
230
243
|
"./cards/badge/index.js",
|
|
231
244
|
"./cards/box/index.js",
|
|
245
|
+
"./cards/bubble/index.js",
|
|
232
246
|
"./cards/button/index.js",
|
|
233
247
|
"./cards/checkbox/index.js",
|
|
234
248
|
"./cards/collapsibleCard/index.js",
|
|
@@ -252,6 +266,7 @@
|
|
|
252
266
|
"./cards/loadingOverlay/index.js",
|
|
253
267
|
"./cards/loadingSkeleton/index.js",
|
|
254
268
|
"./cards/menu/index.js",
|
|
269
|
+
"./cards/message/index.js",
|
|
255
270
|
"./cards/modeToggle/index.js",
|
|
256
271
|
"./cards/navbarSearch/index.js",
|
|
257
272
|
"./cards/observable/index.js",
|
|
@@ -295,7 +310,7 @@
|
|
|
295
310
|
"peerDependencies": {
|
|
296
311
|
"react": "^19.1.0",
|
|
297
312
|
"react-dom": "^19.1.0",
|
|
298
|
-
"@pihanga2/core": "0.3.
|
|
313
|
+
"@pihanga2/core": "^0.3.40",
|
|
299
314
|
"@pihanga2/cards": "*"
|
|
300
315
|
},
|
|
301
316
|
"dependencies": {
|