lynote-ui 0.0.11 → 0.0.12

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.
Files changed (82) hide show
  1. package/dist/attachment/index.d.ts +24 -0
  2. package/dist/attachment/index.js +118 -0
  3. package/dist/attachment/index.js.map +1 -0
  4. package/dist/attachment/index.mjs +107 -0
  5. package/dist/attachment/index.mjs.map +1 -0
  6. package/dist/bubble/index.d.ts +17 -0
  7. package/dist/bubble/index.js +81 -0
  8. package/dist/bubble/index.js.map +1 -0
  9. package/dist/bubble/index.mjs +75 -0
  10. package/dist/bubble/index.mjs.map +1 -0
  11. package/dist/button/index.d.ts +4 -2
  12. package/dist/button/index.js +32 -7
  13. package/dist/button/index.js.map +1 -1
  14. package/dist/button/index.mjs +32 -7
  15. package/dist/button/index.mjs.map +1 -1
  16. package/dist/calendar/index.js +1 -1
  17. package/dist/calendar/index.js.map +1 -1
  18. package/dist/calendar/index.mjs +1 -1
  19. package/dist/calendar/index.mjs.map +1 -1
  20. package/dist/carousel/index.d.ts +2 -2
  21. package/dist/carousel/index.js +4 -2
  22. package/dist/carousel/index.js.map +1 -1
  23. package/dist/carousel/index.mjs +4 -2
  24. package/dist/carousel/index.mjs.map +1 -1
  25. package/dist/combobox/index.js +6 -3
  26. package/dist/combobox/index.js.map +1 -1
  27. package/dist/combobox/index.mjs +6 -3
  28. package/dist/combobox/index.mjs.map +1 -1
  29. package/dist/dialog/index.js +2 -1
  30. package/dist/dialog/index.js.map +1 -1
  31. package/dist/dialog/index.mjs +2 -1
  32. package/dist/dialog/index.mjs.map +1 -1
  33. package/dist/index.d.ts +5 -0
  34. package/dist/index.js +40 -2
  35. package/dist/index.mjs +8 -3
  36. package/dist/input-group/index.d.ts +3 -2
  37. package/dist/input-group/index.js +22 -8
  38. package/dist/input-group/index.js.map +1 -1
  39. package/dist/input-group/index.mjs +22 -8
  40. package/dist/input-group/index.mjs.map +1 -1
  41. package/dist/marker/index.d.ts +11 -0
  42. package/dist/marker/index.js +51 -0
  43. package/dist/marker/index.js.map +1 -0
  44. package/dist/marker/index.mjs +45 -0
  45. package/dist/marker/index.mjs.map +1 -0
  46. package/dist/message/index.d.ts +10 -0
  47. package/dist/message/index.js +59 -0
  48. package/dist/message/index.js.map +1 -0
  49. package/dist/message/index.mjs +51 -0
  50. package/dist/message/index.mjs.map +1 -0
  51. package/dist/message-scroller/index.d.ts +10 -0
  52. package/dist/message-scroller/index.js +74 -0
  53. package/dist/message-scroller/index.js.map +1 -0
  54. package/dist/message-scroller/index.mjs +63 -0
  55. package/dist/message-scroller/index.mjs.map +1 -0
  56. package/dist/pagination/index.d.ts +2 -2
  57. package/dist/pagination/index.js +4 -1
  58. package/dist/pagination/index.js.map +1 -1
  59. package/dist/pagination/index.mjs +4 -1
  60. package/dist/pagination/index.mjs.map +1 -1
  61. package/dist/sheet/index.js +2 -1
  62. package/dist/sheet/index.js.map +1 -1
  63. package/dist/sheet/index.mjs +2 -1
  64. package/dist/sheet/index.mjs.map +1 -1
  65. package/dist/sidebar/index.js +1 -1
  66. package/dist/sidebar/index.mjs +1 -1
  67. package/dist/{sidebar-BO_ns2qp.mjs → sidebar-CA70yQe2.mjs} +3 -2
  68. package/dist/sidebar-CA70yQe2.mjs.map +1 -0
  69. package/dist/{sidebar-KSjzFqo5.js → sidebar-CU5Hn9h7.js} +3 -2
  70. package/dist/sidebar-CU5Hn9h7.js.map +1 -0
  71. package/dist/style.css +697 -5
  72. package/dist/table/index.js +1 -1
  73. package/dist/table/index.mjs +1 -1
  74. package/dist/{table-BA2BijtZ.mjs → table-D3oTrmZn.mjs} +11 -6
  75. package/dist/table-D3oTrmZn.mjs.map +1 -0
  76. package/dist/{table-FocfdaF7.js → table-qqE4Wtic.js} +11 -6
  77. package/dist/table-qqE4Wtic.js.map +1 -0
  78. package/package.json +27 -1
  79. package/dist/sidebar-BO_ns2qp.mjs.map +0 -1
  80. package/dist/sidebar-KSjzFqo5.js.map +0 -1
  81. package/dist/table-BA2BijtZ.mjs.map +0 -1
  82. package/dist/table-FocfdaF7.js.map +0 -1
@@ -0,0 +1,24 @@
1
+ import { useRender } from '@base-ui/react/use-render';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ import { Button } from '../button';
4
+ import { ClassProp } from 'class-variance-authority/types';
5
+ import * as React from "react";
6
+ declare const attachmentVariants: (props?: ({
7
+ size?: "default" | "xs" | "sm" | null | undefined;
8
+ orientation?: "horizontal" | "vertical" | null | undefined;
9
+ } & ClassProp) | undefined) => string;
10
+ declare function Attachment({ className, state, size, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof attachmentVariants> & {
11
+ state?: "idle" | "uploading" | "processing" | "error" | "done";
12
+ }): import("react/jsx-runtime").JSX.Element;
13
+ declare const attachmentMediaVariants: (props?: ({
14
+ variant?: "image" | "icon" | null | undefined;
15
+ } & ClassProp) | undefined) => string;
16
+ declare function AttachmentMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof attachmentMediaVariants>): import("react/jsx-runtime").JSX.Element;
17
+ declare function AttachmentContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
18
+ declare function AttachmentTitle({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
19
+ declare function AttachmentDescription({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
20
+ declare function AttachmentActions({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
21
+ declare function AttachmentAction({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
22
+ declare function AttachmentTrigger({ className, render, type, ...props }: useRender.ComponentProps<"button">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
23
+ declare function AttachmentGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
24
+ export { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger, };
@@ -0,0 +1,118 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_chunk = require("../chunk-8l464Juk.js");
3
+ const require_utils = require("../utils-DrngEK1K.js");
4
+ const require_button = require("../button/index.js");
5
+ let class_variance_authority = require("class-variance-authority");
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ let react = require("react");
8
+ react = require_chunk.__toESM(react);
9
+ let _base_ui_react_merge_props = require("@base-ui/react/merge-props");
10
+ let _base_ui_react_use_render = require("@base-ui/react/use-render");
11
+ //#region src/attachment/index.tsx
12
+ var attachmentVariants = (0, class_variance_authority.cva)("group/attachment bg-card text-card-foreground focus-within:ring-ring/30 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 relative flex w-fit min-w-0 max-w-full shrink-0 flex-wrap rounded-2xl border transition-colors focus-within:ring-1 data-[state=idle]:border-dashed", { variants: {
13
+ size: {
14
+ default: "has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2 gap-2 text-sm",
15
+ sm: "has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5 gap-2.5 text-xs",
16
+ xs: "has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1 gap-1.5 rounded-xl text-xs"
17
+ },
18
+ orientation: {
19
+ horizontal: "min-w-40 items-center",
20
+ vertical: "has-data-[slot=attachment-content]:w-30 w-24 flex-col"
21
+ }
22
+ } });
23
+ function Attachment({ className, state = "done", size = "default", orientation = "horizontal", ...props }) {
24
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
25
+ "data-slot": "attachment",
26
+ "data-state": state,
27
+ "data-size": size,
28
+ "data-orientation": orientation,
29
+ className: require_utils.cn(attachmentVariants({
30
+ size,
31
+ orientation
32
+ }), className),
33
+ ...props
34
+ });
35
+ }
36
+ var attachmentMediaVariants = (0, class_variance_authority.cva)("bg-muted text-foreground group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg 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 [&_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 [&_svg]:pointer-events-none", {
37
+ variants: { variant: {
38
+ icon: "",
39
+ image: "*:[img]:aspect-square *:[img]:w-full *:[img]:object-cover opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100"
40
+ } },
41
+ defaultVariants: { variant: "icon" }
42
+ });
43
+ function AttachmentMedia({ className, variant = "icon", ...props }) {
44
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
45
+ "data-slot": "attachment-media",
46
+ "data-variant": variant,
47
+ className: require_utils.cn(attachmentMediaVariants({ variant }), className),
48
+ ...props
49
+ });
50
+ }
51
+ function AttachmentContent({ className, ...props }) {
52
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
53
+ "data-slot": "attachment-content",
54
+ className: require_utils.cn("min-w-0 max-w-full flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1", className),
55
+ ...props
56
+ });
57
+ }
58
+ function AttachmentTitle({ className, ...props }) {
59
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
60
+ "data-slot": "attachment-title",
61
+ className: require_utils.cn("group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer block min-w-0 max-w-full truncate font-medium", className),
62
+ ...props
63
+ });
64
+ }
65
+ function AttachmentDescription({ className, ...props }) {
66
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
67
+ "data-slot": "attachment-description",
68
+ className: require_utils.cn("text-muted-foreground group-data-[state=error]/attachment:text-destructive/80 mt-0.5 block min-w-0 truncate text-xs", "max-w-full", className),
69
+ ...props
70
+ });
71
+ }
72
+ function AttachmentActions({ className, ...props }) {
73
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
74
+ "data-slot": "attachment-actions",
75
+ className: require_utils.cn("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:gap-1", className),
76
+ ...props
77
+ });
78
+ }
79
+ function AttachmentAction({ className, variant, size = "xs", ...props }) {
80
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_button.Button, {
81
+ "data-slot": "attachment-action",
82
+ variant: variant ?? "ghost",
83
+ size,
84
+ icon: true,
85
+ className: require_utils.cn(className),
86
+ ...props
87
+ });
88
+ }
89
+ function AttachmentTrigger({ className, render, type, ...props }) {
90
+ return (0, _base_ui_react_use_render.useRender)({
91
+ defaultTagName: "button",
92
+ props: (0, _base_ui_react_merge_props.mergeProps)({
93
+ type: render ? type : type ?? "button",
94
+ className: require_utils.cn("absolute inset-0 z-10 outline-none", className)
95
+ }, props),
96
+ render,
97
+ state: { slot: "attachment-trigger" }
98
+ });
99
+ }
100
+ function AttachmentGroup({ className, ...props }) {
101
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
102
+ "data-slot": "attachment-group",
103
+ className: require_utils.cn("scroll-fade-x scrollbar-none flex min-w-0 snap-x snap-mandatory scroll-px-1 gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start", className),
104
+ ...props
105
+ });
106
+ }
107
+ //#endregion
108
+ exports.Attachment = Attachment;
109
+ exports.AttachmentAction = AttachmentAction;
110
+ exports.AttachmentActions = AttachmentActions;
111
+ exports.AttachmentContent = AttachmentContent;
112
+ exports.AttachmentDescription = AttachmentDescription;
113
+ exports.AttachmentGroup = AttachmentGroup;
114
+ exports.AttachmentMedia = AttachmentMedia;
115
+ exports.AttachmentTitle = AttachmentTitle;
116
+ exports.AttachmentTrigger = AttachmentTrigger;
117
+
118
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/attachment/index.tsx"],"sourcesContent":["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 * as React from \"react\";\nimport { cn } from \"../../lib\";\nimport { Button } from \"../button\";\n\nconst attachmentVariants = cva(\n \"group/attachment bg-card text-card-foreground focus-within:ring-ring/30 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 relative flex w-fit min-w-0 max-w-full shrink-0 flex-wrap rounded-2xl border transition-colors focus-within:ring-1 data-[state=idle]:border-dashed\",\n {\n variants: {\n size: {\n default:\n \"has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2 gap-2 text-sm\",\n sm: \"has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5 gap-2.5 text-xs\",\n xs: \"has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1 gap-1.5 rounded-xl text-xs\",\n },\n orientation: {\n horizontal: \"min-w-40 items-center\",\n vertical: \"has-data-[slot=attachment-content]:w-30 w-24 flex-col\",\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 \"bg-muted text-foreground group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg 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 [&_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 [&_svg]:pointer-events-none\",\n {\n variants: {\n variant: {\n icon: \"\",\n image:\n \"*:[img]:aspect-square *:[img]:w-full *:[img]:object-cover opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100\",\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({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"attachment-content\"\n className={cn(\n \"min-w-0 max-w-full flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AttachmentTitle({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"attachment-title\"\n className={cn(\n \"group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer block min-w-0 max-w-full truncate font-medium\",\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 \"text-muted-foreground group-data-[state=error]/attachment:text-destructive/80 mt-0.5 block min-w-0 truncate text-xs\",\n \"max-w-full\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AttachmentActions({\n className,\n ...props\n}: 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:right-3 group-data-[orientation=vertical]/attachment:top-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 = \"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 icon\n className={cn(className)}\n {...props}\n />\n );\n}\n\nfunction AttachmentTrigger({\n className,\n render,\n type,\n ...props\n}: useRender.ComponentProps<\"button\">) {\n return useRender({\n defaultTagName: \"button\",\n props: mergeProps<\"button\">(\n {\n type: render ? type : (type ?? \"button\"),\n className: cn(\"absolute inset-0 z-10 outline-none\", className),\n },\n props,\n ),\n render,\n state: {\n slot: \"attachment-trigger\",\n },\n });\n}\n\nfunction AttachmentGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"attachment-group\"\n className={cn(\n \"scroll-fade-x scrollbar-none flex min-w-0 snap-x snap-mandatory scroll-px-1 gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n Attachment,\n AttachmentAction,\n AttachmentActions,\n AttachmentContent,\n AttachmentDescription,\n AttachmentGroup,\n AttachmentMedia,\n AttachmentTitle,\n AttachmentTrigger,\n};\n"],"mappings":";;;;;;;;;;;AAOA,IAAM,sBAAA,GAAA,yBAAA,KACJ,0SACA,EACE,UAAU;CACR,MAAM;EACJ,SACE;EACF,IAAI;EACJ,IAAI;EACL;CACD,aAAa;EACX,YAAY;EACZ,UAAU;EACX;CACF,EACF,CACF;AAED,SAAS,WAAW,EAClB,WACA,QAAQ,QACR,OAAO,WACP,cAAc,cACd,GAAG,SAIA;AACH,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,cAAY;EACZ,aAAW;EACX,oBAAkB;EAClB,WAAW,cAAA,GAAG,mBAAmB;GAAE;GAAM;GAAa,CAAC,EAAE,UAAU;EACnE,GAAI;EACJ,CAAA;;AAIN,IAAM,2BAAA,GAAA,yBAAA,KACJ,orBACA;CACE,UAAU,EACR,SAAS;EACP,MAAM;EACN,OACE;EACH,EACF;CACD,iBAAiB,EACf,SAAS,QACV;CACF,CACF;AAED,SAAS,gBAAgB,EACvB,WACA,UAAU,QACV,GAAG,SAC0E;AAC7E,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,gBAAc;EACd,WAAW,cAAA,GAAG,wBAAwB,EAAE,SAAS,CAAC,EAAE,UAAU;EAC9D,GAAI;EACJ,CAAA;;AAIN,SAAS,kBAAkB,EACzB,WACA,GAAG,SAC2B;AAC9B,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAW,cAAA,GACT,6FACA,UACD;EACD,GAAI;EACJ,CAAA;;AAIN,SAAS,gBAAgB,EACvB,WACA,GAAG,SAC4B;AAC/B,QACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;EACE,aAAU;EACV,WAAW,cAAA,GACT,kJACA,UACD;EACD,GAAI;EACJ,CAAA;;AAIN,SAAS,sBAAsB,EAC7B,WACA,GAAG,SAC4B;AAC/B,QACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;EACE,aAAU;EACV,WAAW,cAAA,GACT,uHACA,cACA,UACD;EACD,GAAI;EACJ,CAAA;;AAIN,SAAS,kBAAkB,EACzB,WACA,GAAG,SAC2B;AAC9B,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAW,cAAA,GACT,6PACA,UACD;EACD,GAAI;EACJ,CAAA;;AAIN,SAAS,iBAAiB,EACxB,WACA,SACA,OAAO,MACP,GAAG,SACmC;AACtC,QACE,iBAAA,GAAA,kBAAA,KAAC,eAAA,QAAD;EACE,aAAU;EACV,SAAS,WAAW;EACd;EACN,MAAA;EACA,WAAW,cAAA,GAAG,UAAU;EACxB,GAAI;EACJ,CAAA;;AAIN,SAAS,kBAAkB,EACzB,WACA,QACA,MACA,GAAG,SACkC;AACrC,SAAA,GAAA,0BAAA,WAAiB;EACf,gBAAgB;EAChB,QAAA,GAAA,2BAAA,YACE;GACE,MAAM,SAAS,OAAQ,QAAQ;GAC/B,WAAW,cAAA,GAAG,sCAAsC,UAAU;GAC/D,EACD,MACD;EACD;EACA,OAAO,EACL,MAAM,sBACP;EACF,CAAC;;AAGJ,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAsC;AAC7E,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAW,cAAA,GACT,sMACA,UACD;EACD,GAAI;EACJ,CAAA"}
@@ -0,0 +1,107 @@
1
+ import { t as cn } from "../utils-Bg4z4cXr.mjs";
2
+ import { Button } from "../button/index.mjs";
3
+ import { cva } from "class-variance-authority";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import "react";
6
+ import { mergeProps } from "@base-ui/react/merge-props";
7
+ import { useRender } from "@base-ui/react/use-render";
8
+ //#region src/attachment/index.tsx
9
+ var attachmentVariants = cva("group/attachment bg-card text-card-foreground focus-within:ring-ring/30 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 relative flex w-fit min-w-0 max-w-full shrink-0 flex-wrap rounded-2xl border transition-colors focus-within:ring-1 data-[state=idle]:border-dashed", { variants: {
10
+ size: {
11
+ default: "has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2 gap-2 text-sm",
12
+ sm: "has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5 gap-2.5 text-xs",
13
+ xs: "has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1 gap-1.5 rounded-xl text-xs"
14
+ },
15
+ orientation: {
16
+ horizontal: "min-w-40 items-center",
17
+ vertical: "has-data-[slot=attachment-content]:w-30 w-24 flex-col"
18
+ }
19
+ } });
20
+ function Attachment({ className, state = "done", size = "default", orientation = "horizontal", ...props }) {
21
+ return /* @__PURE__ */ jsx("div", {
22
+ "data-slot": "attachment",
23
+ "data-state": state,
24
+ "data-size": size,
25
+ "data-orientation": orientation,
26
+ className: cn(attachmentVariants({
27
+ size,
28
+ orientation
29
+ }), className),
30
+ ...props
31
+ });
32
+ }
33
+ var attachmentMediaVariants = cva("bg-muted text-foreground group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg 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 [&_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 [&_svg]:pointer-events-none", {
34
+ variants: { variant: {
35
+ icon: "",
36
+ image: "*:[img]:aspect-square *:[img]:w-full *:[img]:object-cover opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100"
37
+ } },
38
+ defaultVariants: { variant: "icon" }
39
+ });
40
+ function AttachmentMedia({ className, variant = "icon", ...props }) {
41
+ return /* @__PURE__ */ jsx("div", {
42
+ "data-slot": "attachment-media",
43
+ "data-variant": variant,
44
+ className: cn(attachmentMediaVariants({ variant }), className),
45
+ ...props
46
+ });
47
+ }
48
+ function AttachmentContent({ className, ...props }) {
49
+ return /* @__PURE__ */ jsx("div", {
50
+ "data-slot": "attachment-content",
51
+ className: cn("min-w-0 max-w-full flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1", className),
52
+ ...props
53
+ });
54
+ }
55
+ function AttachmentTitle({ className, ...props }) {
56
+ return /* @__PURE__ */ jsx("span", {
57
+ "data-slot": "attachment-title",
58
+ className: cn("group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer block min-w-0 max-w-full truncate font-medium", className),
59
+ ...props
60
+ });
61
+ }
62
+ function AttachmentDescription({ className, ...props }) {
63
+ return /* @__PURE__ */ jsx("span", {
64
+ "data-slot": "attachment-description",
65
+ className: cn("text-muted-foreground group-data-[state=error]/attachment:text-destructive/80 mt-0.5 block min-w-0 truncate text-xs", "max-w-full", className),
66
+ ...props
67
+ });
68
+ }
69
+ function AttachmentActions({ className, ...props }) {
70
+ return /* @__PURE__ */ jsx("div", {
71
+ "data-slot": "attachment-actions",
72
+ className: cn("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:gap-1", className),
73
+ ...props
74
+ });
75
+ }
76
+ function AttachmentAction({ className, variant, size = "xs", ...props }) {
77
+ return /* @__PURE__ */ jsx(Button, {
78
+ "data-slot": "attachment-action",
79
+ variant: variant ?? "ghost",
80
+ size,
81
+ icon: true,
82
+ className: cn(className),
83
+ ...props
84
+ });
85
+ }
86
+ function AttachmentTrigger({ className, render, type, ...props }) {
87
+ return useRender({
88
+ defaultTagName: "button",
89
+ props: mergeProps({
90
+ type: render ? type : type ?? "button",
91
+ className: cn("absolute inset-0 z-10 outline-none", className)
92
+ }, props),
93
+ render,
94
+ state: { slot: "attachment-trigger" }
95
+ });
96
+ }
97
+ function AttachmentGroup({ className, ...props }) {
98
+ return /* @__PURE__ */ jsx("div", {
99
+ "data-slot": "attachment-group",
100
+ className: cn("scroll-fade-x scrollbar-none flex min-w-0 snap-x snap-mandatory scroll-px-1 gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start", className),
101
+ ...props
102
+ });
103
+ }
104
+ //#endregion
105
+ export { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger };
106
+
107
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/attachment/index.tsx"],"sourcesContent":["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 * as React from \"react\";\nimport { cn } from \"../../lib\";\nimport { Button } from \"../button\";\n\nconst attachmentVariants = cva(\n \"group/attachment bg-card text-card-foreground focus-within:ring-ring/30 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 relative flex w-fit min-w-0 max-w-full shrink-0 flex-wrap rounded-2xl border transition-colors focus-within:ring-1 data-[state=idle]:border-dashed\",\n {\n variants: {\n size: {\n default:\n \"has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2 gap-2 text-sm\",\n sm: \"has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5 gap-2.5 text-xs\",\n xs: \"has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1 gap-1.5 rounded-xl text-xs\",\n },\n orientation: {\n horizontal: \"min-w-40 items-center\",\n vertical: \"has-data-[slot=attachment-content]:w-30 w-24 flex-col\",\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 \"bg-muted text-foreground group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg 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 [&_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 [&_svg]:pointer-events-none\",\n {\n variants: {\n variant: {\n icon: \"\",\n image:\n \"*:[img]:aspect-square *:[img]:w-full *:[img]:object-cover opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100\",\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({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"attachment-content\"\n className={cn(\n \"min-w-0 max-w-full flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AttachmentTitle({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"attachment-title\"\n className={cn(\n \"group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer block min-w-0 max-w-full truncate font-medium\",\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 \"text-muted-foreground group-data-[state=error]/attachment:text-destructive/80 mt-0.5 block min-w-0 truncate text-xs\",\n \"max-w-full\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AttachmentActions({\n className,\n ...props\n}: 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:right-3 group-data-[orientation=vertical]/attachment:top-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 = \"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 icon\n className={cn(className)}\n {...props}\n />\n );\n}\n\nfunction AttachmentTrigger({\n className,\n render,\n type,\n ...props\n}: useRender.ComponentProps<\"button\">) {\n return useRender({\n defaultTagName: \"button\",\n props: mergeProps<\"button\">(\n {\n type: render ? type : (type ?? \"button\"),\n className: cn(\"absolute inset-0 z-10 outline-none\", className),\n },\n props,\n ),\n render,\n state: {\n slot: \"attachment-trigger\",\n },\n });\n}\n\nfunction AttachmentGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"attachment-group\"\n className={cn(\n \"scroll-fade-x scrollbar-none flex min-w-0 snap-x snap-mandatory scroll-px-1 gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n Attachment,\n AttachmentAction,\n AttachmentActions,\n AttachmentContent,\n AttachmentDescription,\n AttachmentGroup,\n AttachmentMedia,\n AttachmentTitle,\n AttachmentTrigger,\n};\n"],"mappings":";;;;;;;;AAOA,IAAM,qBAAqB,IACzB,0SACA,EACE,UAAU;CACR,MAAM;EACJ,SACE;EACF,IAAI;EACJ,IAAI;EACL;CACD,aAAa;EACX,YAAY;EACZ,UAAU;EACX;CACF,EACF,CACF;AAED,SAAS,WAAW,EAClB,WACA,QAAQ,QACR,OAAO,WACP,cAAc,cACd,GAAG,SAIA;AACH,QACE,oBAAC,OAAD;EACE,aAAU;EACV,cAAY;EACZ,aAAW;EACX,oBAAkB;EAClB,WAAW,GAAG,mBAAmB;GAAE;GAAM;GAAa,CAAC,EAAE,UAAU;EACnE,GAAI;EACJ,CAAA;;AAIN,IAAM,0BAA0B,IAC9B,orBACA;CACE,UAAU,EACR,SAAS;EACP,MAAM;EACN,OACE;EACH,EACF;CACD,iBAAiB,EACf,SAAS,QACV;CACF,CACF;AAED,SAAS,gBAAgB,EACvB,WACA,UAAU,QACV,GAAG,SAC0E;AAC7E,QACE,oBAAC,OAAD;EACE,aAAU;EACV,gBAAc;EACd,WAAW,GAAG,wBAAwB,EAAE,SAAS,CAAC,EAAE,UAAU;EAC9D,GAAI;EACJ,CAAA;;AAIN,SAAS,kBAAkB,EACzB,WACA,GAAG,SAC2B;AAC9B,QACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,6FACA,UACD;EACD,GAAI;EACJ,CAAA;;AAIN,SAAS,gBAAgB,EACvB,WACA,GAAG,SAC4B;AAC/B,QACE,oBAAC,QAAD;EACE,aAAU;EACV,WAAW,GACT,kJACA,UACD;EACD,GAAI;EACJ,CAAA;;AAIN,SAAS,sBAAsB,EAC7B,WACA,GAAG,SAC4B;AAC/B,QACE,oBAAC,QAAD;EACE,aAAU;EACV,WAAW,GACT,uHACA,cACA,UACD;EACD,GAAI;EACJ,CAAA;;AAIN,SAAS,kBAAkB,EACzB,WACA,GAAG,SAC2B;AAC9B,QACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,6PACA,UACD;EACD,GAAI;EACJ,CAAA;;AAIN,SAAS,iBAAiB,EACxB,WACA,SACA,OAAO,MACP,GAAG,SACmC;AACtC,QACE,oBAAC,QAAD;EACE,aAAU;EACV,SAAS,WAAW;EACd;EACN,MAAA;EACA,WAAW,GAAG,UAAU;EACxB,GAAI;EACJ,CAAA;;AAIN,SAAS,kBAAkB,EACzB,WACA,QACA,MACA,GAAG,SACkC;AACrC,QAAO,UAAU;EACf,gBAAgB;EAChB,OAAO,WACL;GACE,MAAM,SAAS,OAAQ,QAAQ;GAC/B,WAAW,GAAG,sCAAsC,UAAU;GAC/D,EACD,MACD;EACD;EACA,OAAO,EACL,MAAM,sBACP;EACF,CAAC;;AAGJ,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAsC;AAC7E,QACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,sMACA,UACD;EACD,GAAI;EACJ,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { useRender } from '@base-ui/react/use-render';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ import { ClassProp } from 'class-variance-authority/types';
4
+ import * as React from "react";
5
+ declare function BubbleGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
6
+ declare const bubbleVariants: (props?: ({
7
+ variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "muted" | "tinted" | null | undefined;
8
+ } & ClassProp) | undefined) => string;
9
+ declare function Bubble({ variant, align, className, ...props }: React.ComponentProps<"div"> & VariantProps<typeof bubbleVariants> & {
10
+ align?: "start" | "end";
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ declare function BubbleContent({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
13
+ declare function BubbleReactions({ side, align, className, ...props }: React.ComponentProps<"div"> & {
14
+ align?: "start" | "end";
15
+ side?: "top" | "bottom";
16
+ }): import("react/jsx-runtime").JSX.Element;
17
+ export { Bubble, BubbleContent, BubbleGroup, BubbleReactions };
@@ -0,0 +1,81 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_chunk = require("../chunk-8l464Juk.js");
3
+ const require_utils = require("../utils-DrngEK1K.js");
4
+ let class_variance_authority = require("class-variance-authority");
5
+ let react_jsx_runtime = require("react/jsx-runtime");
6
+ let react = require("react");
7
+ react = require_chunk.__toESM(react);
8
+ let _base_ui_react_merge_props = require("@base-ui/react/merge-props");
9
+ let _base_ui_react_use_render = require("@base-ui/react/use-render");
10
+ //#region src/bubble/index.tsx
11
+ function BubbleGroup({ className, ...props }) {
12
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
13
+ "data-slot": "bubble-group",
14
+ className: require_utils.cn("flex min-w-0 flex-col gap-2", className),
15
+ ...props
16
+ });
17
+ }
18
+ var bubbleVariants = (0, class_variance_authority.cva)("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", {
19
+ variants: { variant: {
20
+ 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",
21
+ 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%)]",
22
+ 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%)]",
23
+ tinted: "*:data-[slot=bubble-content]:text-foreground *:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] 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)]",
24
+ 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",
25
+ ghost: "[&>[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 border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0",
26
+ 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"
27
+ } },
28
+ defaultVariants: { variant: "default" }
29
+ });
30
+ function Bubble({ variant = "default", align = "start", className, ...props }) {
31
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
32
+ "data-slot": "bubble",
33
+ "data-variant": variant,
34
+ "data-align": align,
35
+ className: require_utils.cn(bubbleVariants({ variant }), className),
36
+ ...props
37
+ });
38
+ }
39
+ function BubbleContent({ className, render, ...props }) {
40
+ return (0, _base_ui_react_use_render.useRender)({
41
+ defaultTagName: "div",
42
+ props: (0, _base_ui_react_merge_props.mergeProps)({ className: require_utils.cn("w-fit max-w-full min-w-0 overflow-hidden rounded-3xl border border-transparent px-3 py-2.5 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/30", className) }, props),
43
+ render,
44
+ state: { slot: "bubble-content" }
45
+ });
46
+ }
47
+ var bubbleReactionsVariants = (0, class_variance_authority.cva)("bg-muted ring-3 ring-card absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full px-1.5 py-0.5 text-sm has-[button]:p-0", {
48
+ variants: {
49
+ side: {
50
+ top: "top-0 -translate-y-3/4",
51
+ bottom: "bottom-0 translate-y-3/4"
52
+ },
53
+ align: {
54
+ start: "left-3",
55
+ end: "right-3"
56
+ }
57
+ },
58
+ defaultVariants: {
59
+ side: "bottom",
60
+ align: "end"
61
+ }
62
+ });
63
+ function BubbleReactions({ side = "bottom", align = "end", className, ...props }) {
64
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
65
+ "data-slot": "bubble-reactions",
66
+ "data-align": align,
67
+ "data-side": side,
68
+ className: require_utils.cn(bubbleReactionsVariants({
69
+ side,
70
+ align
71
+ }), className),
72
+ ...props
73
+ });
74
+ }
75
+ //#endregion
76
+ exports.Bubble = Bubble;
77
+ exports.BubbleContent = BubbleContent;
78
+ exports.BubbleGroup = BubbleGroup;
79
+ exports.BubbleReactions = BubbleReactions;
80
+
81
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/bubble/index.tsx"],"sourcesContent":["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 * as React from \"react\";\nimport { cn } from \"../../lib\";\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 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 {\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]:text-foreground *:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] 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 \"[&>[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 border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0\",\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 className,\n render,\n ...props\n}: useRender.ComponentProps<\"div\">) {\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(\n {\n className: cn(\n \"w-fit max-w-full min-w-0 overflow-hidden rounded-3xl border border-transparent px-3 py-2.5 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/30\",\n className,\n ),\n },\n props,\n ),\n render,\n state: {\n slot: \"bubble-content\",\n },\n });\n}\n\nconst bubbleReactionsVariants = cva(\n \"bg-muted ring-3 ring-card absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full px-1.5 py-0.5 text-sm 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 { Bubble, BubbleContent, BubbleGroup, BubbleReactions };\n"],"mappings":";;;;;;;;;;AAMA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;AACzE,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,WAAW,cAAA,GAAG,+BAA+B,UAAU;EACvD,GAAI;EACJ,CAAA;;AAIN,IAAM,kBAAA,GAAA,yBAAA,KACJ,yKACA;CACE,UAAU,EACR,SAAS;EACP,SACE;EACF,WACE;EACF,OACE;EACF,QACE;EACF,SACE;EACF,OACE;EACF,aACE;EACH,EACF;CACD,iBAAiB,EACf,SAAS,WACV;CACF,CACF;AAED,SAAS,OAAO,EACd,UAAU,WACV,QAAQ,SACR,WACA,GAAG,SAIA;AACH,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,gBAAc;EACd,cAAY;EACZ,WAAW,cAAA,GAAG,eAAe,EAAE,SAAS,CAAC,EAAE,UAAU;EACrD,GAAI;EACJ,CAAA;;AAIN,SAAS,cAAc,EACrB,WACA,QACA,GAAG,SAC+B;AAClC,SAAA,GAAA,0BAAA,WAAiB;EACf,gBAAgB;EAChB,QAAA,GAAA,2BAAA,YACE,EACE,WAAW,cAAA,GACT,gWACA,UACD,EACF,EACD,MACD;EACD;EACA,OAAO,EACL,MAAM,kBACP;EACF,CAAC;;AAGJ,IAAM,2BAAA,GAAA,yBAAA,KACJ,qJACA;CACE,UAAU;EACR,MAAM;GACJ,KAAK;GACL,QAAQ;GACT;EACD,OAAO;GACL,OAAO;GACP,KAAK;GACN;EACF;CACD,iBAAiB;EACf,MAAM;EACN,OAAO;EACR;CACF,CACF;AAED,SAAS,gBAAgB,EACvB,OAAO,UACP,QAAQ,OACR,WACA,GAAG,SAIF;AACD,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,aAAU;EACV,cAAY;EACZ,aAAW;EACX,WAAW,cAAA,GAAG,wBAAwB;GAAE;GAAM;GAAO,CAAC,EAAE,UAAU;EAClE,GAAI;EACJ,CAAA"}
@@ -0,0 +1,75 @@
1
+ import { t as cn } from "../utils-Bg4z4cXr.mjs";
2
+ import { cva } from "class-variance-authority";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import "react";
5
+ import { mergeProps } from "@base-ui/react/merge-props";
6
+ import { useRender } from "@base-ui/react/use-render";
7
+ //#region src/bubble/index.tsx
8
+ function BubbleGroup({ className, ...props }) {
9
+ return /* @__PURE__ */ jsx("div", {
10
+ "data-slot": "bubble-group",
11
+ className: cn("flex min-w-0 flex-col gap-2", className),
12
+ ...props
13
+ });
14
+ }
15
+ var bubbleVariants = cva("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", {
16
+ variants: { variant: {
17
+ 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",
18
+ 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%)]",
19
+ 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%)]",
20
+ tinted: "*:data-[slot=bubble-content]:text-foreground *:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] 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)]",
21
+ 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",
22
+ ghost: "[&>[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 border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0",
23
+ 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"
24
+ } },
25
+ defaultVariants: { variant: "default" }
26
+ });
27
+ function Bubble({ variant = "default", align = "start", className, ...props }) {
28
+ return /* @__PURE__ */ jsx("div", {
29
+ "data-slot": "bubble",
30
+ "data-variant": variant,
31
+ "data-align": align,
32
+ className: cn(bubbleVariants({ variant }), className),
33
+ ...props
34
+ });
35
+ }
36
+ function BubbleContent({ className, render, ...props }) {
37
+ return useRender({
38
+ defaultTagName: "div",
39
+ props: mergeProps({ className: cn("w-fit max-w-full min-w-0 overflow-hidden rounded-3xl border border-transparent px-3 py-2.5 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/30", className) }, props),
40
+ render,
41
+ state: { slot: "bubble-content" }
42
+ });
43
+ }
44
+ var bubbleReactionsVariants = cva("bg-muted ring-3 ring-card absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full px-1.5 py-0.5 text-sm has-[button]:p-0", {
45
+ variants: {
46
+ side: {
47
+ top: "top-0 -translate-y-3/4",
48
+ bottom: "bottom-0 translate-y-3/4"
49
+ },
50
+ align: {
51
+ start: "left-3",
52
+ end: "right-3"
53
+ }
54
+ },
55
+ defaultVariants: {
56
+ side: "bottom",
57
+ align: "end"
58
+ }
59
+ });
60
+ function BubbleReactions({ side = "bottom", align = "end", className, ...props }) {
61
+ return /* @__PURE__ */ jsx("div", {
62
+ "data-slot": "bubble-reactions",
63
+ "data-align": align,
64
+ "data-side": side,
65
+ className: cn(bubbleReactionsVariants({
66
+ side,
67
+ align
68
+ }), className),
69
+ ...props
70
+ });
71
+ }
72
+ //#endregion
73
+ export { Bubble, BubbleContent, BubbleGroup, BubbleReactions };
74
+
75
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/bubble/index.tsx"],"sourcesContent":["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 * as React from \"react\";\nimport { cn } from \"../../lib\";\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 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 {\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]:text-foreground *:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] 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 \"[&>[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 border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0\",\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 className,\n render,\n ...props\n}: useRender.ComponentProps<\"div\">) {\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(\n {\n className: cn(\n \"w-fit max-w-full min-w-0 overflow-hidden rounded-3xl border border-transparent px-3 py-2.5 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/30\",\n className,\n ),\n },\n props,\n ),\n render,\n state: {\n slot: \"bubble-content\",\n },\n });\n}\n\nconst bubbleReactionsVariants = cva(\n \"bg-muted ring-3 ring-card absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full px-1.5 py-0.5 text-sm 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 { Bubble, BubbleContent, BubbleGroup, BubbleReactions };\n"],"mappings":";;;;;;;AAMA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;AACzE,QACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,+BAA+B,UAAU;EACvD,GAAI;EACJ,CAAA;;AAIN,IAAM,iBAAiB,IACrB,yKACA;CACE,UAAU,EACR,SAAS;EACP,SACE;EACF,WACE;EACF,OACE;EACF,QACE;EACF,SACE;EACF,OACE;EACF,aACE;EACH,EACF;CACD,iBAAiB,EACf,SAAS,WACV;CACF,CACF;AAED,SAAS,OAAO,EACd,UAAU,WACV,QAAQ,SACR,WACA,GAAG,SAIA;AACH,QACE,oBAAC,OAAD;EACE,aAAU;EACV,gBAAc;EACd,cAAY;EACZ,WAAW,GAAG,eAAe,EAAE,SAAS,CAAC,EAAE,UAAU;EACrD,GAAI;EACJ,CAAA;;AAIN,SAAS,cAAc,EACrB,WACA,QACA,GAAG,SAC+B;AAClC,QAAO,UAAU;EACf,gBAAgB;EAChB,OAAO,WACL,EACE,WAAW,GACT,gWACA,UACD,EACF,EACD,MACD;EACD;EACA,OAAO,EACL,MAAM,kBACP;EACF,CAAC;;AAGJ,IAAM,0BAA0B,IAC9B,qJACA;CACE,UAAU;EACR,MAAM;GACJ,KAAK;GACL,QAAQ;GACT;EACD,OAAO;GACL,OAAO;GACP,KAAK;GACN;EACF;CACD,iBAAiB;EACf,MAAM;EACN,OAAO;EACR;CACF,CACF;AAED,SAAS,gBAAgB,EACvB,OAAO,UACP,QAAQ,OACR,WACA,GAAG,SAIF;AACD,QACE,oBAAC,OAAD;EACE,aAAU;EACV,cAAY;EACZ,aAAW;EACX,WAAW,GAAG,wBAAwB;GAAE;GAAM;GAAO,CAAC,EAAE,UAAU;EAClE,GAAI;EACJ,CAAA"}
@@ -3,7 +3,9 @@ import { VariantProps } from 'class-variance-authority';
3
3
  import { ClassProp } from 'class-variance-authority/types';
4
4
  declare const buttonVariants: (props?: ({
5
5
  variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
6
- size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
6
+ size?: "default" | "xs" | "sm" | "lg" | null | undefined;
7
+ icon?: boolean | null | undefined;
8
+ radius?: "none" | "full" | null | undefined;
7
9
  } & ClassProp) | undefined) => string;
8
- declare function Button({ className, variant, size, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>): import("react/jsx-runtime").JSX.Element;
10
+ declare function Button({ className, variant, size, icon, radius, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>): import("react/jsx-runtime").JSX.Element;
9
11
  export { Button, buttonVariants };
@@ -19,25 +19,50 @@ var buttonVariants = (0, class_variance_authority.cva)("group/button focus-visib
19
19
  size: {
20
20
  default: "has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 h-8 gap-1.5 px-2.5",
21
21
  xs: "in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs [&_svg:not([class*='size-'])]:size-3",
22
- sm: "in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] [&_svg:not([class*='size-'])]:size-3.5",
23
- lg: "has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 h-9 gap-1.5 px-2.5",
24
- icon: "size-8",
25
- "icon-xs": "in-data-[slot=button-group]:rounded-lg size-6 rounded-[min(var(--radius-md),10px)] [&_svg:not([class*='size-'])]:size-3",
26
- "icon-sm": "in-data-[slot=button-group]:rounded-lg size-7 rounded-[min(var(--radius-md),12px)]",
27
- "icon-lg": "size-9"
22
+ sm: "in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem]",
23
+ lg: "has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 h-9 gap-1.5 px-2.5"
24
+ },
25
+ icon: { true: "p-0" },
26
+ radius: {
27
+ none: "!rounded-none",
28
+ full: "!rounded-full"
28
29
  }
29
30
  },
31
+ compoundVariants: [
32
+ {
33
+ icon: true,
34
+ size: "default",
35
+ className: "size-8"
36
+ },
37
+ {
38
+ icon: true,
39
+ size: "xs",
40
+ className: "size-6"
41
+ },
42
+ {
43
+ icon: true,
44
+ size: "sm",
45
+ className: "size-7"
46
+ },
47
+ {
48
+ icon: true,
49
+ size: "lg",
50
+ className: "size-9"
51
+ }
52
+ ],
30
53
  defaultVariants: {
31
54
  variant: "default",
32
55
  size: "default"
33
56
  }
34
57
  });
35
- function Button({ className, variant = "default", size = "default", ...props }) {
58
+ function Button({ className, variant = "default", size = "default", icon, radius, ...props }) {
36
59
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_button.Button, {
37
60
  "data-slot": "button",
38
61
  className: require_utils.cn(buttonVariants({
39
62
  variant,
40
63
  size,
64
+ icon,
65
+ radius,
41
66
  className
42
67
  })),
43
68
  ...props
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/button/index.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button as ButtonPrimitive } from \"@base-ui/react/button\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../lib\";\n\nconst buttonVariants = cva(\n \"group/button focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 inline-flex shrink-0 select-none items-center justify-center whitespace-nowrap rounded-lg border border-transparent bg-clip-padding text-sm font-medium outline-none transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n outline:\n \"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n ghost:\n \"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50\",\n destructive:\n \"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default:\n \"has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 h-8 gap-1.5 px-2.5\",\n xs: \"in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs [&_svg:not([class*='size-'])]:size-3\",\n sm: \"in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] [&_svg:not([class*='size-'])]:size-3.5\",\n lg: \"has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 h-9 gap-1.5 px-2.5\",\n icon: \"size-8\",\n \"icon-xs\":\n \"in-data-[slot=button-group]:rounded-lg size-6 rounded-[min(var(--radius-md),10px)] [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\":\n \"in-data-[slot=button-group]:rounded-lg size-7 rounded-[min(var(--radius-md),12px)]\",\n \"icon-lg\": \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nfunction Button({\n className,\n variant = \"default\",\n size = \"default\",\n ...props\n}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {\n return (\n <ButtonPrimitive\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Button, buttonVariants };\n"],"mappings":";;;;;;;;AAOA,IAAM,kBAAA,GAAA,yBAAA,KACJ,8lBACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,SACE;GACF,WACE;GACF,OACE;GACF,aACE;GACF,MAAM;GACP;EACD,MAAM;GACJ,SACE;GACF,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,MAAM;GACN,WACE;GACF,WACE;GACF,WAAW;GACZ;EACF;CACD,iBAAiB;EACf,SAAS;EACT,MAAM;EACP;CACF,CACF;AAED,SAAS,OAAO,EACd,WACA,UAAU,WACV,OAAO,WACP,GAAG,SAC2D;AAC9D,QACE,iBAAA,GAAA,kBAAA,KAAC,sBAAA,QAAD;EACE,aAAU;EACV,WAAW,cAAA,GAAG,eAAe;GAAE;GAAS;GAAM;GAAW,CAAC,CAAC;EAC3D,GAAI;EACJ,CAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/button/index.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button as ButtonPrimitive } from \"@base-ui/react/button\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../lib\";\n\nconst buttonVariants = cva(\n \"group/button focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 inline-flex shrink-0 select-none items-center justify-center whitespace-nowrap rounded-lg border border-transparent bg-clip-padding text-sm font-medium outline-none transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n outline:\n \"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n ghost:\n \"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50\",\n destructive:\n \"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default:\n \"has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 h-8 gap-1.5 px-2.5\",\n xs: \"in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs [&_svg:not([class*='size-'])]:size-3\",\n sm: \"in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem]\",\n lg: \"has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 h-9 gap-1.5 px-2.5\",\n },\n icon: {\n true: \"p-0\",\n },\n radius: {\n none: \"!rounded-none\",\n full: \"!rounded-full\",\n },\n },\n compoundVariants: [\n { icon: true, size: \"default\", className: \"size-8\" },\n { icon: true, size: \"xs\", className: \"size-6\" },\n { icon: true, size: \"sm\", className: \"size-7\" },\n { icon: true, size: \"lg\", className: \"size-9\" },\n ],\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nfunction Button({\n className,\n variant = \"default\",\n size = \"default\",\n icon,\n radius,\n ...props\n}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {\n return (\n <ButtonPrimitive\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, icon, radius, className }))}\n {...props}\n />\n );\n}\n\nexport { Button, buttonVariants };\n"],"mappings":";;;;;;;;AAOA,IAAM,kBAAA,GAAA,yBAAA,KACJ,8lBACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,SACE;GACF,WACE;GACF,OACE;GACF,aACE;GACF,MAAM;GACP;EACD,MAAM;GACJ,SACE;GACF,IAAI;GACJ,IAAI;GACJ,IAAI;GACL;EACD,MAAM,EACJ,MAAM,OACP;EACD,QAAQ;GACN,MAAM;GACN,MAAM;GACP;EACF;CACD,kBAAkB;EAChB;GAAE,MAAM;GAAM,MAAM;GAAW,WAAW;GAAU;EACpD;GAAE,MAAM;GAAM,MAAM;GAAM,WAAW;GAAU;EAC/C;GAAE,MAAM;GAAM,MAAM;GAAM,WAAW;GAAU;EAC/C;GAAE,MAAM;GAAM,MAAM;GAAM,WAAW;GAAU;EAChD;CACD,iBAAiB;EACf,SAAS;EACT,MAAM;EACP;CACF,CACF;AAED,SAAS,OAAO,EACd,WACA,UAAU,WACV,OAAO,WACP,MACA,QACA,GAAG,SAC2D;AAC9D,QACE,iBAAA,GAAA,kBAAA,KAAC,sBAAA,QAAD;EACE,aAAU;EACV,WAAW,cAAA,GAAG,eAAe;GAAE;GAAS;GAAM;GAAM;GAAQ;GAAW,CAAC,CAAC;EACzE,GAAI;EACJ,CAAA"}