velloo 0.0.0 → 0.2.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/BUN-LICENSE.md +91 -0
- package/LICENSE +202 -0
- package/NOTICE +9 -0
- package/README.md +288 -2
- package/THIRD-PARTY-NOTICES.md +467 -0
- package/assets/elsewhere-alps-9fqhv029.jpg +0 -0
- package/assets/elsewhere-bali-vp60g115.jpg +0 -0
- package/assets/elsewhere-forest-xgn23zrj.jpg +0 -0
- package/assets/elsewhere-japan-qs7qkbr2.jpg +0 -0
- package/assets/elsewhere-kyoto-map-n2bvkrya.svg +1 -0
- package/assets/elsewhere-kyoto-qemtn6nk.jpg +0 -0
- package/assets/elsewhere-room-g1gaw7cs.jpg +0 -0
- package/canvas/apple-touch-icon.png +0 -0
- package/canvas/assets/index-BCvDZiBo.css +2 -0
- package/canvas/assets/index-ClaBqcaS.js +28 -0
- package/canvas/assets/lucide-all-iIF-pmzN.js +1 -0
- package/canvas/assets/radix-C3HaOB-d.js +41 -0
- package/canvas/assets/react-D0Ec-185.js +9 -0
- package/canvas/assets/rolldown-runtime-hePW80VL.js +1 -0
- package/canvas/assets/vendor-CKmQ-Zst.js +53 -0
- package/canvas/favicon.ico +0 -0
- package/canvas/favicon.svg +12 -0
- package/canvas/fonts/OFL-1.1.txt +93 -0
- package/canvas/fonts/poppins-700.woff2 +0 -0
- package/canvas/icon-192.png +0 -0
- package/canvas/icon-512.png +0 -0
- package/canvas/index.html +22 -0
- package/canvas/site.webmanifest +11 -0
- package/chunk-08sv3k41.js +4 -0
- package/chunk-0fe83yzt.js +2 -0
- package/chunk-0t68szgr.js +3 -0
- package/chunk-1h55s5he.js +2 -0
- package/chunk-2c7jbx46.js +2 -0
- package/chunk-2smsg2ct.js +7 -0
- package/chunk-308ynsxd.js +2 -0
- package/chunk-3e8vez4d.js +1229 -0
- package/chunk-40xgcth8.js +63 -0
- package/chunk-4dn75m6t.js +3 -0
- package/chunk-4fj5tahv.js +3 -0
- package/chunk-6nqghjda.js +3 -0
- package/chunk-6tx68d90.js +3 -0
- package/chunk-6w6ch4ce.js +2 -0
- package/chunk-735ezz23.js +86 -0
- package/chunk-7eq7nx37.js +7 -0
- package/chunk-7eyb8yrf.js +6 -0
- package/chunk-80fjfyha.js +86 -0
- package/chunk-80r93t2e.js +4 -0
- package/chunk-94vx1yb0.js +3 -0
- package/chunk-9vg3yafz.js +3 -0
- package/chunk-a84n72m2.js +4 -0
- package/chunk-ampmdzz4.js +10 -0
- package/chunk-avns4dbf.js +2 -0
- package/chunk-ayrb3qnm.js +3 -0
- package/chunk-bwnvcncx.js +3 -0
- package/chunk-ccszg02q.js +5 -0
- package/chunk-cvn689d5.js +3 -0
- package/chunk-cxe6jjwj.js +3 -0
- package/chunk-dg6z4vdd.js +3 -0
- package/chunk-dgwjpbp9.js +3 -0
- package/chunk-dy41n60j.js +52 -0
- package/chunk-ek71z2fv.js +226 -0
- package/chunk-er1fxb7d.js +2 -0
- package/chunk-eyr8hrzf.js +2 -0
- package/chunk-fjbzk4sw.js +3 -0
- package/chunk-fsbsksga.js +3 -0
- package/chunk-h6gchare.js +3 -0
- package/chunk-hcb68zt7.js +85 -0
- package/chunk-hggap8fq.js +3 -0
- package/chunk-j11fyeqh.js +2 -0
- package/chunk-jb21jkp1.js +8 -0
- package/chunk-jfx9xjmr.js +18 -0
- package/chunk-jr0ss0mm.js +303 -0
- package/chunk-jrsknzjt.js +3 -0
- package/chunk-jv0xggh0.js +2 -0
- package/chunk-k17gfwq3.js +2 -0
- package/chunk-mh2pr7cq.js +5 -0
- package/chunk-mnapdp1y.js +2 -0
- package/chunk-mzhdrawd.js +3 -0
- package/chunk-n9gs6yx9.js +2 -0
- package/chunk-ngnymg2q.js +3 -0
- package/chunk-nwx5700b.js +3 -0
- package/chunk-pjtg3wnm.js +4 -0
- package/chunk-pp86v6m6.js +3 -0
- package/chunk-r22epxz2.js +3 -0
- package/chunk-rgasy862.js +5 -0
- package/chunk-rpwpeph5.js +3 -0
- package/chunk-s23gtejf.js +3 -0
- package/chunk-sjgqnykd.js +6 -0
- package/chunk-sn3x2m0m.js +6 -0
- package/chunk-t448rrfr.js +2 -0
- package/chunk-tdsk5wxa.js +451 -0
- package/chunk-v40fn08f.js +442 -0
- package/chunk-vbk1qhdz.js +3 -0
- package/chunk-vdkrbzh1.js +2 -0
- package/chunk-vgmr98cv.js +40 -0
- package/chunk-vsv8z729.js +6 -0
- package/chunk-x4f4k9pp.js +26 -0
- package/chunk-xt5ayg7g.js +4 -0
- package/chunk-ydhwv29b.js +244 -0
- package/chunk-zb6hc1y0.js +2 -0
- package/cli.js +3 -0
- package/launcher.cjs +97 -0
- package/package.json +58 -5
- package/pkgs/helpers/src/box.tsx +21 -0
- package/pkgs/helpers/src/cn.ts +32 -0
- package/pkgs/helpers/src/descriptors.ts +270 -0
- package/pkgs/helpers/src/divider.tsx +123 -0
- package/pkgs/helpers/src/gradient.tsx +90 -0
- package/pkgs/helpers/src/heading.tsx +20 -0
- package/pkgs/helpers/src/icon-data.ts +8009 -0
- package/pkgs/helpers/src/icon.tsx +53 -0
- package/pkgs/helpers/src/image.tsx +111 -0
- package/pkgs/helpers/src/index.ts +29 -0
- package/pkgs/helpers/src/layer.tsx +61 -0
- package/pkgs/helpers/src/lowering.ts +53 -0
- package/pkgs/helpers/src/paths.ts +47 -0
- package/pkgs/helpers/src/placeholder.tsx +88 -0
- package/pkgs/helpers/src/prose.tsx +42 -0
- package/pkgs/helpers/src/registry.ts +41 -0
- package/pkgs/helpers/src/svg.tsx +62 -0
- package/pkgs/helpers/src/text.tsx +16 -0
- package/pkgs/provider-antd/src/index.ts +78 -0
- package/pkgs/provider-antd/src/intro.ts +14 -0
- package/pkgs/provider-antd/src/manifest.ts +439 -0
- package/pkgs/provider-antd/src/overlays.ts +176 -0
- package/pkgs/provider-antd/src/registry.ts +104 -0
- package/pkgs/provider-antd/src/render-pass.ts +43 -0
- package/pkgs/provider-antd/src/tailwind-entry.css +21 -0
- package/pkgs/provider-antd/src/theme.ts +132 -0
- package/pkgs/provider-antd/src/version.ts +8 -0
- package/pkgs/provider-chakra/src/index.ts +80 -0
- package/pkgs/provider-chakra/src/intro.ts +14 -0
- package/pkgs/provider-chakra/src/manifest.ts +421 -0
- package/pkgs/provider-chakra/src/overlays.ts +246 -0
- package/pkgs/provider-chakra/src/registry.ts +227 -0
- package/pkgs/provider-chakra/src/render-pass.ts +55 -0
- package/pkgs/provider-chakra/src/tailwind-entry.css +21 -0
- package/pkgs/provider-chakra/src/theme.ts +180 -0
- package/pkgs/provider-chakra/src/version.ts +8 -0
- package/pkgs/provider-mui/src/index.ts +117 -0
- package/pkgs/provider-mui/src/intro.ts +12 -0
- package/pkgs/provider-mui/src/manifest.ts +263 -0
- package/pkgs/provider-mui/src/overlays.ts +124 -0
- package/pkgs/provider-mui/src/registry.ts +120 -0
- package/pkgs/provider-mui/src/render-pass.ts +36 -0
- package/pkgs/provider-mui/src/tailwind-entry.css +21 -0
- package/pkgs/provider-mui/src/theme.ts +129 -0
- package/pkgs/provider-mui/src/version.ts +8 -0
- package/pkgs/provider-none/src/components-inline.tsx +204 -0
- package/pkgs/provider-none/src/components.tsx +155 -0
- package/pkgs/provider-none/src/index.ts +57 -0
- package/pkgs/provider-none/src/intro.ts +18 -0
- package/pkgs/provider-none/src/manifest.ts +163 -0
- package/pkgs/provider-none/src/registry-inline.ts +36 -0
- package/pkgs/provider-none/src/registry.ts +39 -0
- package/pkgs/provider-none/src/tailwind-entry.css +57 -0
- package/pkgs/provider-none/src/version.ts +10 -0
- package/pkgs/schema/src/annotation.ts +120 -0
- package/pkgs/schema/src/asset.ts +66 -0
- package/pkgs/schema/src/board.ts +71 -0
- package/pkgs/schema/src/comment.ts +107 -0
- package/pkgs/schema/src/config.ts +185 -0
- package/pkgs/schema/src/css-sanitize.ts +56 -0
- package/pkgs/schema/src/extension.ts +105 -0
- package/pkgs/schema/src/fonts.ts +690 -0
- package/pkgs/schema/src/frame.ts +40 -0
- package/pkgs/schema/src/icon-name.ts +21 -0
- package/pkgs/schema/src/ids.ts +14 -0
- package/pkgs/schema/src/index.ts +169 -0
- package/pkgs/schema/src/migrate.ts +297 -0
- package/pkgs/schema/src/node.ts +229 -0
- package/pkgs/schema/src/paths.ts +28 -0
- package/pkgs/schema/src/repo.ts +134 -0
- package/pkgs/schema/src/screen.ts +30 -0
- package/pkgs/schema/src/snippet-resolve.ts +193 -0
- package/pkgs/schema/src/snippet.ts +104 -0
- package/pkgs/schema/src/svg-sanitize.ts +487 -0
- package/pkgs/schema/src/theme.ts +218 -0
- package/pkgs/schema/src/typeset.ts +693 -0
- package/pkgs/schema/src/validate-ids.ts +46 -0
- package/pkgs/schema/src/viewport.ts +8 -0
- package/pkgs/shadcn-snapshot/dist/manifest.json +8109 -0
- package/pkgs/shadcn-snapshot/src/components/canvas-portal.tsx +55 -0
- package/pkgs/shadcn-snapshot/src/components/ui/accordion.tsx +122 -0
- package/pkgs/shadcn-snapshot/src/components/ui/alert-dialog.tsx +164 -0
- package/pkgs/shadcn-snapshot/src/components/ui/alert.tsx +74 -0
- package/pkgs/shadcn-snapshot/src/components/ui/aspect-ratio.tsx +13 -0
- package/pkgs/shadcn-snapshot/src/components/ui/attachment.tsx +197 -0
- package/pkgs/shadcn-snapshot/src/components/ui/avatar.tsx +100 -0
- package/pkgs/shadcn-snapshot/src/components/ui/badge.tsx +50 -0
- package/pkgs/shadcn-snapshot/src/components/ui/breadcrumb.tsx +109 -0
- package/pkgs/shadcn-snapshot/src/components/ui/bubble.tsx +130 -0
- package/pkgs/shadcn-snapshot/src/components/ui/button-group.tsx +82 -0
- package/pkgs/shadcn-snapshot/src/components/ui/button.tsx +72 -0
- package/pkgs/shadcn-snapshot/src/components/ui/calendar.tsx +229 -0
- package/pkgs/shadcn-snapshot/src/components/ui/card.tsx +92 -0
- package/pkgs/shadcn-snapshot/src/components/ui/carousel.tsx +235 -0
- package/pkgs/shadcn-snapshot/src/components/ui/chart-option.ts +250 -0
- package/pkgs/shadcn-snapshot/src/components/ui/chart.tsx +177 -0
- package/pkgs/shadcn-snapshot/src/components/ui/checkbox.tsx +41 -0
- package/pkgs/shadcn-snapshot/src/components/ui/collapsible.tsx +32 -0
- package/pkgs/shadcn-snapshot/src/components/ui/combobox.tsx +196 -0
- package/pkgs/shadcn-snapshot/src/components/ui/context-menu.tsx +227 -0
- package/pkgs/shadcn-snapshot/src/components/ui/dialog.tsx +131 -0
- package/pkgs/shadcn-snapshot/src/components/ui/direction.tsx +24 -0
- package/pkgs/shadcn-snapshot/src/components/ui/drawer.tsx +112 -0
- package/pkgs/shadcn-snapshot/src/components/ui/dropdown-menu.tsx +205 -0
- package/pkgs/shadcn-snapshot/src/components/ui/empty.tsx +98 -0
- package/pkgs/shadcn-snapshot/src/components/ui/field.tsx +228 -0
- package/pkgs/shadcn-snapshot/src/components/ui/hover-card.tsx +51 -0
- package/pkgs/shadcn-snapshot/src/components/ui/input-group.tsx +148 -0
- package/pkgs/shadcn-snapshot/src/components/ui/input.tsx +43 -0
- package/pkgs/shadcn-snapshot/src/components/ui/item.tsx +187 -0
- package/pkgs/shadcn-snapshot/src/components/ui/kbd.tsx +30 -0
- package/pkgs/shadcn-snapshot/src/components/ui/label.tsx +25 -0
- package/pkgs/shadcn-snapshot/src/components/ui/marker.tsx +71 -0
- package/pkgs/shadcn-snapshot/src/components/ui/menubar.tsx +243 -0
- package/pkgs/shadcn-snapshot/src/components/ui/message.tsx +89 -0
- package/pkgs/shadcn-snapshot/src/components/ui/native-select.tsx +60 -0
- package/pkgs/shadcn-snapshot/src/components/ui/navigation-menu.tsx +165 -0
- package/pkgs/shadcn-snapshot/src/components/ui/pagination.tsx +117 -0
- package/pkgs/shadcn-snapshot/src/components/ui/popover.tsx +66 -0
- package/pkgs/shadcn-snapshot/src/components/ui/progress.tsx +35 -0
- package/pkgs/shadcn-snapshot/src/components/ui/radio-group.tsx +48 -0
- package/pkgs/shadcn-snapshot/src/components/ui/scroll-area.tsx +59 -0
- package/pkgs/shadcn-snapshot/src/components/ui/select.tsx +180 -0
- package/pkgs/shadcn-snapshot/src/components/ui/separator.tsx +32 -0
- package/pkgs/shadcn-snapshot/src/components/ui/sheet.tsx +107 -0
- package/pkgs/shadcn-snapshot/src/components/ui/skeleton.tsx +17 -0
- package/pkgs/shadcn-snapshot/src/components/ui/slider.tsx +68 -0
- package/pkgs/shadcn-snapshot/src/components/ui/sonner.tsx +91 -0
- package/pkgs/shadcn-snapshot/src/components/ui/spinner.tsx +21 -0
- package/pkgs/shadcn-snapshot/src/components/ui/switch.tsx +41 -0
- package/pkgs/shadcn-snapshot/src/components/ui/table.tsx +93 -0
- package/pkgs/shadcn-snapshot/src/components/ui/tabs.tsx +84 -0
- package/pkgs/shadcn-snapshot/src/components/ui/textarea.tsx +24 -0
- package/pkgs/shadcn-snapshot/src/components/ui/toggle-group.tsx +94 -0
- package/pkgs/shadcn-snapshot/src/components/ui/toggle.tsx +50 -0
- package/pkgs/shadcn-snapshot/src/components/ui/tooltip.tsx +47 -0
- package/pkgs/shadcn-snapshot/src/examples.ts +36 -0
- package/pkgs/shadcn-snapshot/src/groups.ts +87 -0
- package/pkgs/shadcn-snapshot/src/index.ts +43 -0
- package/pkgs/shadcn-snapshot/src/lib/utils.ts +4 -0
- package/pkgs/shadcn-snapshot/src/manifest.ts +12 -0
- package/pkgs/shadcn-snapshot/src/notes.ts +97 -0
- package/pkgs/shadcn-snapshot/src/paths.ts +47 -0
- package/pkgs/shadcn-snapshot/src/registry-files.ts +293 -0
- package/pkgs/shadcn-snapshot/src/registry.ts +631 -0
- package/pkgs/shadcn-snapshot/src/shadcn-tailwind.css +632 -0
- package/pkgs/shadcn-snapshot/src/tailwind-entry.css +159 -0
- package/pkgs/shadcn-snapshot/src/version.ts +8 -0
- package/plugins/claude/velloo/.claude-plugin/plugin.json +6 -0
- package/plugins/claude/velloo/agents/velloo-design-reviewer.md +33 -0
- package/plugins/claude/velloo/agents/velloo-designer.md +39 -0
- package/plugins/claude/velloo/commands/design.md +11 -0
- package/plugins/claude/velloo/commands/implement.md +10 -0
- package/plugins/claude/velloo/commands/review.md +8 -0
- package/plugins/gemini/GEMINI.md +31 -0
- package/plugins/gemini/commands/velloo/design.toml +10 -0
- package/plugins/gemini/commands/velloo/implement.toml +9 -0
- package/plugins/gemini/gemini-extension.json +9 -0
- package/skills/velloo-brand/SKILL.md +124 -0
- package/skills/velloo-design/SKILL.md +144 -0
- package/skills/velloo-design-system/SKILL.md +90 -0
- package/skills/velloo-implement/SKILL.md +101 -0
- package/skills/velloo-logo/SKILL.md +93 -0
- package/skills/velloo-setup/SKILL.md +156 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
// Vendored from shadcn-ui (https://ui.shadcn.com/docs/components/radix/item).
|
|
2
|
+
// Snapshot version: see packages/shadcn-snapshot/package.json#snapshotVersion.
|
|
3
|
+
// Regenerate with `bun run vendor` — do not hand-edit unless you are adding a
|
|
4
|
+
// canvas adaptation, in which case add the id to vendor.ts's ADAPTED set.
|
|
5
|
+
|
|
6
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
7
|
+
import { Slot } from "radix-ui";
|
|
8
|
+
import type * as React from "react";
|
|
9
|
+
|
|
10
|
+
import { cn } from "../../lib/utils.ts";
|
|
11
|
+
import { Separator } from "./separator.tsx";
|
|
12
|
+
|
|
13
|
+
function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
14
|
+
return (
|
|
15
|
+
<div
|
|
16
|
+
role="list"
|
|
17
|
+
data-slot="item-group"
|
|
18
|
+
className={cn(
|
|
19
|
+
"group/item-group flex w-full flex-col gap-4 has-data-[size=sm]:gap-2.5 has-data-[size=xs]:gap-2",
|
|
20
|
+
className,
|
|
21
|
+
)}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function ItemSeparator({ className, ...props }: React.ComponentProps<typeof Separator>) {
|
|
28
|
+
return (
|
|
29
|
+
<Separator
|
|
30
|
+
data-slot="item-separator"
|
|
31
|
+
orientation="horizontal"
|
|
32
|
+
className={cn("my-2", className)}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const itemVariants = cva(
|
|
39
|
+
"group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted",
|
|
40
|
+
{
|
|
41
|
+
variants: {
|
|
42
|
+
variant: {
|
|
43
|
+
default: "border-transparent",
|
|
44
|
+
outline: "border-border",
|
|
45
|
+
muted: "border-transparent bg-muted/50",
|
|
46
|
+
},
|
|
47
|
+
size: {
|
|
48
|
+
default: "gap-2.5 px-3 py-2.5",
|
|
49
|
+
sm: "gap-2.5 px-3 py-2.5",
|
|
50
|
+
xs: "gap-2 px-2.5 py-2 in-data-[slot=dropdown-menu-content]:p-0",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
defaultVariants: {
|
|
54
|
+
variant: "default",
|
|
55
|
+
size: "default",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
function Item({
|
|
61
|
+
className,
|
|
62
|
+
variant = "default",
|
|
63
|
+
size = "default",
|
|
64
|
+
asChild = false,
|
|
65
|
+
...props
|
|
66
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof itemVariants> & { asChild?: boolean }) {
|
|
67
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
68
|
+
return (
|
|
69
|
+
<Comp
|
|
70
|
+
data-slot="item"
|
|
71
|
+
data-variant={variant}
|
|
72
|
+
data-size={size}
|
|
73
|
+
className={cn(itemVariants({ variant, size, className }))}
|
|
74
|
+
{...props}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const itemMediaVariants = cva(
|
|
80
|
+
"flex shrink-0 items-center justify-center gap-2 group-has-data-[slot=item-description]/item:translate-y-0.5 group-has-data-[slot=item-description]/item:self-start [&_svg]:pointer-events-none",
|
|
81
|
+
{
|
|
82
|
+
variants: {
|
|
83
|
+
variant: {
|
|
84
|
+
default: "bg-transparent",
|
|
85
|
+
icon: "[&_svg:not([class*='size-'])]:size-4",
|
|
86
|
+
image:
|
|
87
|
+
"size-10 overflow-hidden rounded-sm group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 [&_img]:size-full [&_img]:object-cover",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
defaultVariants: {
|
|
91
|
+
variant: "default",
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
function ItemMedia({
|
|
97
|
+
className,
|
|
98
|
+
variant = "default",
|
|
99
|
+
...props
|
|
100
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>) {
|
|
101
|
+
return (
|
|
102
|
+
<div
|
|
103
|
+
data-slot="item-media"
|
|
104
|
+
data-variant={variant}
|
|
105
|
+
className={cn(itemMediaVariants({ variant, className }))}
|
|
106
|
+
{...props}
|
|
107
|
+
/>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function ItemContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
112
|
+
return (
|
|
113
|
+
<div
|
|
114
|
+
data-slot="item-content"
|
|
115
|
+
className={cn(
|
|
116
|
+
"flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none",
|
|
117
|
+
className,
|
|
118
|
+
)}
|
|
119
|
+
{...props}
|
|
120
|
+
/>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function ItemTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
125
|
+
return (
|
|
126
|
+
<div
|
|
127
|
+
data-slot="item-title"
|
|
128
|
+
className={cn(
|
|
129
|
+
"line-clamp-1 flex w-fit items-center gap-2 text-sm leading-snug font-medium underline-offset-4",
|
|
130
|
+
className,
|
|
131
|
+
)}
|
|
132
|
+
{...props}
|
|
133
|
+
/>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function ItemDescription({ className, ...props }: React.ComponentProps<"p">) {
|
|
138
|
+
return (
|
|
139
|
+
<p
|
|
140
|
+
data-slot="item-description"
|
|
141
|
+
className={cn(
|
|
142
|
+
"line-clamp-2 text-left text-sm leading-normal font-normal text-muted-foreground group-data-[size=xs]/item:text-xs [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
|
|
143
|
+
className,
|
|
144
|
+
)}
|
|
145
|
+
{...props}
|
|
146
|
+
/>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function ItemActions({ className, ...props }: React.ComponentProps<"div">) {
|
|
151
|
+
return (
|
|
152
|
+
<div data-slot="item-actions" className={cn("flex items-center gap-2", className)} {...props} />
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function ItemHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
157
|
+
return (
|
|
158
|
+
<div
|
|
159
|
+
data-slot="item-header"
|
|
160
|
+
className={cn("flex basis-full items-center justify-between gap-2", className)}
|
|
161
|
+
{...props}
|
|
162
|
+
/>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function ItemFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
167
|
+
return (
|
|
168
|
+
<div
|
|
169
|
+
data-slot="item-footer"
|
|
170
|
+
className={cn("flex basis-full items-center justify-between gap-2", className)}
|
|
171
|
+
{...props}
|
|
172
|
+
/>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export {
|
|
177
|
+
Item,
|
|
178
|
+
ItemActions,
|
|
179
|
+
ItemContent,
|
|
180
|
+
ItemDescription,
|
|
181
|
+
ItemFooter,
|
|
182
|
+
ItemGroup,
|
|
183
|
+
ItemHeader,
|
|
184
|
+
ItemMedia,
|
|
185
|
+
ItemSeparator,
|
|
186
|
+
ItemTitle,
|
|
187
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Vendored from shadcn-ui (https://ui.shadcn.com/docs/components/radix/kbd).
|
|
2
|
+
// Snapshot version: see packages/shadcn-snapshot/package.json#snapshotVersion.
|
|
3
|
+
// Regenerate with `bun run vendor` — do not hand-edit unless you are adding a
|
|
4
|
+
// canvas adaptation, in which case add the id to vendor.ts's ADAPTED set.
|
|
5
|
+
import { cn } from "../../lib/utils.ts";
|
|
6
|
+
|
|
7
|
+
function Kbd({ className, ...props }: React.ComponentProps<"kbd">) {
|
|
8
|
+
return (
|
|
9
|
+
<kbd
|
|
10
|
+
data-slot="kbd"
|
|
11
|
+
className={cn(
|
|
12
|
+
"pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3",
|
|
13
|
+
className,
|
|
14
|
+
)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function KbdGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
21
|
+
return (
|
|
22
|
+
<kbd
|
|
23
|
+
data-slot="kbd-group"
|
|
24
|
+
className={cn("inline-flex items-center gap-1", className)}
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { Kbd, KbdGroup };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Vendored from shadcn-ui (https://ui.shadcn.com/docs/components/radix/label).
|
|
2
|
+
// Snapshot version: see packages/shadcn-snapshot/package.json#snapshotVersion.
|
|
3
|
+
// Regenerate with `bun run vendor` — do not hand-edit unless you are adding a
|
|
4
|
+
// canvas adaptation, in which case add the id to vendor.ts's ADAPTED set.
|
|
5
|
+
"use client";
|
|
6
|
+
|
|
7
|
+
import { Label as LabelPrimitive } from "radix-ui";
|
|
8
|
+
import type * as React from "react";
|
|
9
|
+
|
|
10
|
+
import { cn } from "../../lib/utils.ts";
|
|
11
|
+
|
|
12
|
+
function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
13
|
+
return (
|
|
14
|
+
<LabelPrimitive.Root
|
|
15
|
+
data-slot="label"
|
|
16
|
+
className={cn(
|
|
17
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
18
|
+
className,
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { Label };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Vendored from shadcn-ui (https://ui.shadcn.com/docs/components/radix/marker).
|
|
2
|
+
// Snapshot version: see packages/shadcn-snapshot/package.json#snapshotVersion.
|
|
3
|
+
// Regenerate with `bun run vendor` — do not hand-edit unless you are adding a
|
|
4
|
+
// canvas adaptation, in which case add the id to vendor.ts's ADAPTED set.
|
|
5
|
+
|
|
6
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
7
|
+
import { Slot } from "radix-ui";
|
|
8
|
+
import type * as React from "react";
|
|
9
|
+
|
|
10
|
+
import { cn } from "../../lib/utils.ts";
|
|
11
|
+
|
|
12
|
+
const markerVariants = cva(
|
|
13
|
+
"group/marker relative flex min-h-4 w-full items-center gap-2 text-left text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground",
|
|
14
|
+
{
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
default: "",
|
|
18
|
+
separator:
|
|
19
|
+
"before:mr-1 before:h-px before:min-w-0 before:flex-1 before:bg-border after:ml-1 after:h-px after:min-w-0 after:flex-1 after:bg-border",
|
|
20
|
+
border: "border-b border-border pb-2",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
function Marker({
|
|
27
|
+
className,
|
|
28
|
+
variant = "default",
|
|
29
|
+
asChild = false,
|
|
30
|
+
...props
|
|
31
|
+
}: React.ComponentProps<"div"> &
|
|
32
|
+
VariantProps<typeof markerVariants> & {
|
|
33
|
+
asChild?: boolean;
|
|
34
|
+
}) {
|
|
35
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Comp
|
|
39
|
+
data-slot="marker"
|
|
40
|
+
data-variant={variant}
|
|
41
|
+
className={cn(markerVariants({ variant, className }))}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function MarkerIcon({ className, ...props }: React.ComponentProps<"span">) {
|
|
48
|
+
return (
|
|
49
|
+
<span
|
|
50
|
+
data-slot="marker-icon"
|
|
51
|
+
aria-hidden="true"
|
|
52
|
+
className={cn("size-4 shrink-0 [&_svg:not([class*='size-'])]:size-4", className)}
|
|
53
|
+
{...props}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function MarkerContent({ className, ...props }: React.ComponentProps<"span">) {
|
|
59
|
+
return (
|
|
60
|
+
<span
|
|
61
|
+
data-slot="marker-content"
|
|
62
|
+
className={cn(
|
|
63
|
+
"min-w-0 wrap-break-word group-data-[variant=separator]/marker:flex-none group-data-[variant=separator]/marker:text-center *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
|
|
64
|
+
className,
|
|
65
|
+
)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { Marker, MarkerContent, MarkerIcon, markerVariants };
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
// Vendored from shadcn-ui (https://ui.shadcn.com/docs/components/radix/menubar).
|
|
2
|
+
// Snapshot version: see packages/shadcn-snapshot/package.json#snapshotVersion.
|
|
3
|
+
// Canvas-safe: see ../canvas-portal.tsx. The bar itself renders fine, but a
|
|
4
|
+
// menu's popup portals to the body and only mounts while that menu is open, so
|
|
5
|
+
// a static render would show the triggers and nothing else. Everything from
|
|
6
|
+
// Content inward is a plain element — Radix's menu parts read a context
|
|
7
|
+
// Portal/Content sets up, so they can't render standalone, and the popup has to
|
|
8
|
+
// be inline for the design surface to see it. Classes track upstream except for
|
|
9
|
+
// the ones that depend on Radix's runtime positioning vars (`--radix-menubar-*`)
|
|
10
|
+
// or animate on open, which would leave screenshots catching a mid-transition
|
|
11
|
+
// frame.
|
|
12
|
+
"use client";
|
|
13
|
+
|
|
14
|
+
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
15
|
+
import { Menubar as MenubarPrimitive } from "radix-ui";
|
|
16
|
+
import type * as React from "react";
|
|
17
|
+
import { cn } from "../../lib/utils.ts";
|
|
18
|
+
import { inlineOpenAttrs } from "../canvas-portal.tsx";
|
|
19
|
+
|
|
20
|
+
const POPUP =
|
|
21
|
+
"cn-menu-target cn-menu-translucent z-50 overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground ring-1 ring-foreground/10";
|
|
22
|
+
|
|
23
|
+
const ITEM =
|
|
24
|
+
"relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";
|
|
25
|
+
|
|
26
|
+
const CHECKABLE_ITEM =
|
|
27
|
+
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-1.5 pl-7 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0";
|
|
28
|
+
|
|
29
|
+
const INDICATOR =
|
|
30
|
+
"pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4";
|
|
31
|
+
|
|
32
|
+
export function Menubar({
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Root>) {
|
|
36
|
+
return (
|
|
37
|
+
<MenubarPrimitive.Root
|
|
38
|
+
data-slot="menubar"
|
|
39
|
+
className={cn("flex h-8 items-center gap-0.5 rounded-lg border p-[3px]", className)}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The one menu shell that needs no design-mode pin: Radix tracks the open menu
|
|
47
|
+
* as a value on the bar rather than a flag here, and Content renders inline
|
|
48
|
+
* anyway.
|
|
49
|
+
*/
|
|
50
|
+
export function MenubarMenu({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
|
|
51
|
+
return <MenubarPrimitive.Menu data-slot="menubar-menu" {...props} />;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function MenubarGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
55
|
+
return <div data-slot="menubar-group" className={className} {...props} />;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Upstream's Portal, neutralized: children render where they sit. */
|
|
59
|
+
export function MenubarPortal({ children }: React.ComponentProps<"div">) {
|
|
60
|
+
return <>{children}</>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function MenubarRadioGroup({ ...props }: React.ComponentProps<"div">) {
|
|
64
|
+
return <div data-slot="menubar-radio-group" {...props} />;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function MenubarTrigger({
|
|
68
|
+
className,
|
|
69
|
+
...props
|
|
70
|
+
}: React.ComponentProps<typeof MenubarPrimitive.Trigger>) {
|
|
71
|
+
return (
|
|
72
|
+
<MenubarPrimitive.Trigger
|
|
73
|
+
data-slot="menubar-trigger"
|
|
74
|
+
className={cn(
|
|
75
|
+
"flex items-center rounded-sm px-1.5 py-[2px] text-sm font-medium outline-hidden select-none hover:bg-muted aria-expanded:bg-muted",
|
|
76
|
+
className,
|
|
77
|
+
)}
|
|
78
|
+
{...props}
|
|
79
|
+
/>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function MenubarContent({
|
|
84
|
+
className,
|
|
85
|
+
sideOffset: _sideOffset,
|
|
86
|
+
align: _align,
|
|
87
|
+
alignOffset: _alignOffset,
|
|
88
|
+
collisionPadding: _collisionPadding,
|
|
89
|
+
...props
|
|
90
|
+
}: React.ComponentProps<"div"> & {
|
|
91
|
+
sideOffset?: number;
|
|
92
|
+
align?: string;
|
|
93
|
+
alignOffset?: number;
|
|
94
|
+
collisionPadding?: number;
|
|
95
|
+
}) {
|
|
96
|
+
return (
|
|
97
|
+
<div
|
|
98
|
+
data-slot="menubar-content"
|
|
99
|
+
{...inlineOpenAttrs()}
|
|
100
|
+
className={cn(POPUP, "min-w-36 shadow-md", className)}
|
|
101
|
+
{...props}
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function MenubarItem({
|
|
107
|
+
className,
|
|
108
|
+
inset,
|
|
109
|
+
variant = "default",
|
|
110
|
+
...props
|
|
111
|
+
}: React.ComponentProps<"div"> & { inset?: boolean; variant?: "default" | "destructive" }) {
|
|
112
|
+
return (
|
|
113
|
+
<div
|
|
114
|
+
data-slot="menubar-item"
|
|
115
|
+
data-inset={inset}
|
|
116
|
+
data-variant={variant}
|
|
117
|
+
className={cn(
|
|
118
|
+
"group/menubar-item",
|
|
119
|
+
ITEM,
|
|
120
|
+
"not-data-[variant=destructive]:focus:**:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:*:[svg]:text-destructive!",
|
|
121
|
+
className,
|
|
122
|
+
)}
|
|
123
|
+
{...props}
|
|
124
|
+
/>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function MenubarCheckboxItem({
|
|
129
|
+
className,
|
|
130
|
+
children,
|
|
131
|
+
checked,
|
|
132
|
+
inset,
|
|
133
|
+
...props
|
|
134
|
+
}: React.ComponentProps<"div"> & { checked?: boolean; inset?: boolean }) {
|
|
135
|
+
return (
|
|
136
|
+
<div
|
|
137
|
+
data-slot="menubar-checkbox-item"
|
|
138
|
+
data-inset={inset}
|
|
139
|
+
data-state={checked ? "checked" : "unchecked"}
|
|
140
|
+
className={cn(CHECKABLE_ITEM, className)}
|
|
141
|
+
{...props}
|
|
142
|
+
>
|
|
143
|
+
<span className={INDICATOR}>{checked ? <CheckIcon /> : null}</span>
|
|
144
|
+
{children}
|
|
145
|
+
</div>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export function MenubarRadioItem({
|
|
150
|
+
className,
|
|
151
|
+
children,
|
|
152
|
+
checked,
|
|
153
|
+
inset,
|
|
154
|
+
...props
|
|
155
|
+
}: React.ComponentProps<"div"> & { checked?: boolean; inset?: boolean }) {
|
|
156
|
+
return (
|
|
157
|
+
<div
|
|
158
|
+
data-slot="menubar-radio-item"
|
|
159
|
+
data-inset={inset}
|
|
160
|
+
data-state={checked ? "checked" : "unchecked"}
|
|
161
|
+
className={cn(
|
|
162
|
+
CHECKABLE_ITEM,
|
|
163
|
+
"data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4",
|
|
164
|
+
className,
|
|
165
|
+
)}
|
|
166
|
+
{...props}
|
|
167
|
+
>
|
|
168
|
+
<span className={INDICATOR}>{checked ? <CheckIcon /> : null}</span>
|
|
169
|
+
{children}
|
|
170
|
+
</div>
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function MenubarLabel({
|
|
175
|
+
className,
|
|
176
|
+
inset,
|
|
177
|
+
...props
|
|
178
|
+
}: React.ComponentProps<"div"> & { inset?: boolean }) {
|
|
179
|
+
return (
|
|
180
|
+
<div
|
|
181
|
+
data-slot="menubar-label"
|
|
182
|
+
data-inset={inset}
|
|
183
|
+
className={cn("px-1.5 py-1 text-sm font-medium data-inset:pl-7", className)}
|
|
184
|
+
{...props}
|
|
185
|
+
/>
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export function MenubarSeparator({ className, ...props }: React.ComponentProps<"div">) {
|
|
190
|
+
return (
|
|
191
|
+
<div
|
|
192
|
+
data-slot="menubar-separator"
|
|
193
|
+
className={cn("-mx-1 my-1 h-px bg-border", className)}
|
|
194
|
+
{...props}
|
|
195
|
+
/>
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export function MenubarShortcut({ className, ...props }: React.ComponentProps<"span">) {
|
|
200
|
+
return (
|
|
201
|
+
<span
|
|
202
|
+
data-slot="menubar-shortcut"
|
|
203
|
+
className={cn(
|
|
204
|
+
"ml-auto text-xs tracking-widest text-muted-foreground group-focus/menubar-item:text-accent-foreground",
|
|
205
|
+
className,
|
|
206
|
+
)}
|
|
207
|
+
{...props}
|
|
208
|
+
/>
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export function MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
|
|
213
|
+
return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export function MenubarSubTrigger({
|
|
217
|
+
className,
|
|
218
|
+
inset,
|
|
219
|
+
children,
|
|
220
|
+
...props
|
|
221
|
+
}: React.ComponentProps<"div"> & { inset?: boolean }) {
|
|
222
|
+
return (
|
|
223
|
+
<div
|
|
224
|
+
data-slot="menubar-sub-trigger"
|
|
225
|
+
data-inset={inset}
|
|
226
|
+
className={cn(ITEM, "data-open:bg-accent data-open:text-accent-foreground", className)}
|
|
227
|
+
{...props}
|
|
228
|
+
>
|
|
229
|
+
{children}
|
|
230
|
+
<ChevronRightIcon className="cn-rtl-flip ml-auto size-4" />
|
|
231
|
+
</div>
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export function MenubarSubContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
236
|
+
return (
|
|
237
|
+
<div
|
|
238
|
+
data-slot="menubar-sub-content"
|
|
239
|
+
className={cn(POPUP, "min-w-32 shadow-lg", className)}
|
|
240
|
+
{...props}
|
|
241
|
+
/>
|
|
242
|
+
);
|
|
243
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Vendored from shadcn-ui (https://ui.shadcn.com/docs/components/radix/message).
|
|
2
|
+
// Snapshot version: see packages/shadcn-snapshot/package.json#snapshotVersion.
|
|
3
|
+
// Regenerate with `bun run vendor` — do not hand-edit unless you are adding a
|
|
4
|
+
// canvas adaptation, in which case add the id to vendor.ts's ADAPTED set.
|
|
5
|
+
import type * as React from "react";
|
|
6
|
+
|
|
7
|
+
import { cn } from "../../lib/utils.ts";
|
|
8
|
+
|
|
9
|
+
function MessageGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
10
|
+
return (
|
|
11
|
+
<div
|
|
12
|
+
data-slot="message-group"
|
|
13
|
+
className={cn("flex min-w-0 flex-col gap-2", className)}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function Message({
|
|
20
|
+
className,
|
|
21
|
+
align = "start",
|
|
22
|
+
...props
|
|
23
|
+
}: React.ComponentProps<"div"> & { align?: "start" | "end" }) {
|
|
24
|
+
return (
|
|
25
|
+
<div
|
|
26
|
+
data-slot="message"
|
|
27
|
+
data-align={align}
|
|
28
|
+
className={cn(
|
|
29
|
+
"group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse",
|
|
30
|
+
className,
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function MessageAvatar({ className, ...props }: React.ComponentProps<"div">) {
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
data-slot="message-avatar"
|
|
41
|
+
className={cn(
|
|
42
|
+
"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",
|
|
43
|
+
className,
|
|
44
|
+
)}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function MessageContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
51
|
+
return (
|
|
52
|
+
<div
|
|
53
|
+
data-slot="message-content"
|
|
54
|
+
className={cn(
|
|
55
|
+
"flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end",
|
|
56
|
+
className,
|
|
57
|
+
)}
|
|
58
|
+
{...props}
|
|
59
|
+
/>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function MessageHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
64
|
+
return (
|
|
65
|
+
<div
|
|
66
|
+
data-slot="message-header"
|
|
67
|
+
className={cn(
|
|
68
|
+
"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",
|
|
69
|
+
className,
|
|
70
|
+
)}
|
|
71
|
+
{...props}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function MessageFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
77
|
+
return (
|
|
78
|
+
<div
|
|
79
|
+
data-slot="message-footer"
|
|
80
|
+
className={cn(
|
|
81
|
+
"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",
|
|
82
|
+
className,
|
|
83
|
+
)}
|
|
84
|
+
{...props}
|
|
85
|
+
/>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader };
|