{"name":"bubble","dependencies":["@base-ui/react","class-variance-authority"],"files":[{"path":"bubble.tsx","content":"import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"cn\";\nimport type * as React from \"react\";\n\nfunction BubbleGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"bubble-group\"\n\t\t\tclassName={cn(\"flex min-w-0 flex-col gap-2\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nconst bubbleVariants = cva(\n\t\"group/bubble relative flex w-fit min-w-0 max-w-[80%] flex-col gap-1 data-[variant=ghost]:max-w-full data-[align=end]:self-end group-data-[align=end]/message:self-end\",\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault:\n\t\t\t\t\t\"*: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\t\t\t\tsecondary:\n\t\t\t\t\t\"*: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\t\t\t\tmuted:\n\t\t\t\t\t\"*: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\t\t\t\tsoft: \"*:data-[slot=bubble-content]:bg-primary-soft *:data-[slot=bubble-content]:text-primary-soft-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary-soft/80\",\n\t\t\t\toutline:\n\t\t\t\t\t\"*: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\t\t\t\tghost:\n\t\t\t\t\t\"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\t\t\t\tdestructive:\n\t\t\t\t\t\"*: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\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t},\n\t},\n);\n\nfunction Bubble({\n\tvariant = \"default\",\n\talign = \"start\",\n\tclassName,\n\t...props\n}: React.ComponentProps<\"div\"> &\n\tVariantProps<typeof bubbleVariants> & {\n\t\talign?: \"start\" | \"end\";\n\t}) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"bubble\"\n\t\t\tdata-variant={variant}\n\t\t\tdata-align={align}\n\t\t\tclassName={cn(bubbleVariants({ variant }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction BubbleContent({\n\tclassName,\n\trender,\n\t...props\n}: useRender.ComponentProps<\"div\">) {\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\tprops: mergeProps<\"div\">(\n\t\t\t{\n\t\t\t\tclassName: cn(\n\t\t\t\t\t\"wrap-break-word [button,a]:focus-visible:focus-ring w-fit min-w-0 max-w-full overflow-hidden rounded-3xl border border-transparent px-3.5 py-2.5 text-sm leading-relaxed group-data-[align=end]/bubble:self-end [button,a]:outline-none [button,a]:transition-[color,background-color,border-color,box-shadow] [button,a]:focus-visible:border-ring [button]:text-start\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t},\n\t\t\tprops,\n\t\t),\n\t\trender,\n\t\tstate: {\n\t\t\tslot: \"bubble-content\",\n\t\t},\n\t});\n}\n\nconst bubbleReactionsVariants = cva(\n\t\"absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-3xl bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0\",\n\t{\n\t\tvariants: {\n\t\t\tside: {\n\t\t\t\ttop: \"top-0 -translate-y-3/4\",\n\t\t\t\tbottom: \"bottom-0 translate-y-3/4\",\n\t\t\t},\n\t\t\talign: {\n\t\t\t\tstart: \"start-3\",\n\t\t\t\tend: \"end-3\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tside: \"bottom\",\n\t\t\talign: \"end\",\n\t\t},\n\t},\n);\n\nfunction BubbleReactions({\n\tside = \"bottom\",\n\talign = \"end\",\n\tclassName,\n\t...props\n}: React.ComponentProps<\"div\"> & {\n\talign?: \"start\" | \"end\";\n\tside?: \"top\" | \"bottom\";\n}) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"bubble-reactions\"\n\t\t\tdata-align={align}\n\t\t\tdata-side={side}\n\t\t\tclassName={cn(bubbleReactionsVariants({ side, align }), className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Bubble, BubbleContent, BubbleGroup, BubbleReactions };\n","type":"registry:ui"}],"cssVars":{"theme":{"--color-primary-soft":"var(--primary-soft)","--color-primary-soft-foreground":"var(--primary-soft-foreground)"},"light":{"--primary-soft":"color-mix(in oklab, var(--primary) 15%, transparent)","--primary-soft-foreground":"color-mix(in oklab, var(--primary) 70%, var(--foreground) 30%)"},"dark":{"--primary-soft":"color-mix(in oklab, var(--primary) 12%, transparent)","--primary-soft-foreground":"color-mix(in oklab, var(--primary) 80%, var(--foreground) 30%)"}},"css":{"@utility focus-ring":{"@apply ring-2 ring-ring ring-offset-2 ring-offset-background outline-none":{}}},"type":"registry:ui"}