@q9labsai/chalk-ui 4.0.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.
Files changed (67) hide show
  1. package/LICENSE +21 -0
  2. package/dist/assets.d.ts +2 -0
  3. package/dist/assets.d.ts.map +1 -0
  4. package/dist/assets.js +2 -0
  5. package/dist/badge.d.ts +14 -0
  6. package/dist/badge.d.ts.map +1 -0
  7. package/dist/badge.js +73 -0
  8. package/dist/button.d.ts +9 -0
  9. package/dist/button.d.ts.map +1 -0
  10. package/dist/button.js +49 -0
  11. package/dist/card.d.ts +12 -0
  12. package/dist/card.d.ts.map +1 -0
  13. package/dist/card.js +63 -0
  14. package/dist/icon-button.d.ts +9 -0
  15. package/dist/icon-button.d.ts.map +1 -0
  16. package/dist/icon-button.js +37 -0
  17. package/dist/index.d.ts +19 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +897 -0
  20. package/dist/input.d.ts +12 -0
  21. package/dist/input.d.ts.map +1 -0
  22. package/dist/input.js +44 -0
  23. package/dist/lib/theme.d.ts +8 -0
  24. package/dist/lib/theme.d.ts.map +1 -0
  25. package/dist/lib/utils.d.ts +3 -0
  26. package/dist/lib/utils.d.ts.map +1 -0
  27. package/dist/lib/utils.js +9 -0
  28. package/dist/logos/chalk-icon.svg +34 -0
  29. package/dist/logos/chalk-logo-on-dark.svg +35 -0
  30. package/dist/logos/chalk-logo.svg +45 -0
  31. package/dist/progress-bar.d.ts +13 -0
  32. package/dist/progress-bar.d.ts.map +1 -0
  33. package/dist/progress-bar.js +35 -0
  34. package/dist/reactions.d.ts +33 -0
  35. package/dist/reactions.d.ts.map +1 -0
  36. package/dist/reactions.js +179 -0
  37. package/dist/select.d.ts +26 -0
  38. package/dist/select.d.ts.map +1 -0
  39. package/dist/select.js +49 -0
  40. package/dist/skeleton.d.ts +11 -0
  41. package/dist/skeleton.d.ts.map +1 -0
  42. package/dist/skeleton.js +25 -0
  43. package/dist/spinner.d.ts +9 -0
  44. package/dist/spinner.d.ts.map +1 -0
  45. package/dist/spinner.js +26 -0
  46. package/dist/status-badge.d.ts +9 -0
  47. package/dist/status-badge.d.ts.map +1 -0
  48. package/dist/status-badge.js +18 -0
  49. package/dist/styles.css +1461 -0
  50. package/dist/test-utils.d.ts +3 -0
  51. package/dist/test-utils.d.ts.map +1 -0
  52. package/dist/textarea.d.ts +10 -0
  53. package/dist/textarea.d.ts.map +1 -0
  54. package/dist/textarea.js +52 -0
  55. package/dist/toast.d.ts +45 -0
  56. package/dist/toast.d.ts.map +1 -0
  57. package/dist/toast.js +131 -0
  58. package/dist/toggle-group.d.ts +11 -0
  59. package/dist/toggle-group.d.ts.map +1 -0
  60. package/dist/toggle-group.js +101 -0
  61. package/dist/toggle.d.ts +20 -0
  62. package/dist/toggle.d.ts.map +1 -0
  63. package/dist/toggle.js +48 -0
  64. package/dist/tooltip.d.ts +15 -0
  65. package/dist/tooltip.d.ts.map +1 -0
  66. package/dist/tooltip.js +101 -0
  67. package/package.json +199 -0
package/dist/index.js ADDED
@@ -0,0 +1,897 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
+
19
+ // src/index.ts
20
+ var index_exports = {};
21
+ __export(index_exports, {
22
+ Badge: () => Badge,
23
+ Button: () => Button,
24
+ CELEBRATION_EMOJIS: () => CELEBRATION_EMOJIS,
25
+ Card: () => Card,
26
+ CardAction: () => CardAction,
27
+ CardContent: () => CardContent,
28
+ CardDescription: () => CardDescription,
29
+ CardFooter: () => CardFooter,
30
+ CardHeader: () => CardHeader,
31
+ CardTitle: () => CardTitle,
32
+ DEFAULT_QUICK_REACTIONS: () => DEFAULT_QUICK_REACTIONS,
33
+ EMOJI_CATEGORIES: () => EMOJI_CATEGORIES,
34
+ EMOJI_KEYWORDS: () => EMOJI_KEYWORDS,
35
+ IconButton: () => IconButton,
36
+ Input: () => Input,
37
+ ProgressBar: () => ProgressBar,
38
+ Select: () => Select,
39
+ Skeleton: () => Skeleton,
40
+ Spinner: () => Spinner,
41
+ StatusBadge: () => StatusBadge,
42
+ Textarea: () => Textarea,
43
+ Toast: () => Toast,
44
+ ToastAction: () => ToastAction,
45
+ ToastClose: () => ToastClose,
46
+ ToastContent: () => ToastContent,
47
+ ToastDescription: () => ToastDescription,
48
+ ToastProvider: () => ToastProvider,
49
+ ToastRoot: () => ToastRoot,
50
+ ToastTitle: () => ToastTitle,
51
+ ToastViewport: () => ToastViewport,
52
+ Toggle: () => Toggle,
53
+ ToggleGroup: () => ToggleGroup,
54
+ ToggleGroupItem: () => ToggleGroupItem,
55
+ Tooltip: () => Tooltip,
56
+ TooltipContent: () => TooltipContent,
57
+ TooltipProvider: () => TooltipProvider,
58
+ TooltipTrigger: () => TooltipTrigger,
59
+ badgeVariants: () => badgeVariants,
60
+ buttonVariants: () => buttonVariants,
61
+ cn: () => cn,
62
+ toast: () => toast,
63
+ toastManager: () => toastManager,
64
+ toggleVariants: () => toggleVariants,
65
+ useToast: () => useToast
66
+ });
67
+
68
+ // src/assets.ts
69
+ var assets_exports = {};
70
+ __reExport(assets_exports, chalk_assets_star);
71
+ import * as chalk_assets_star from "@q9labsai/chalk-assets";
72
+
73
+ // src/index.ts
74
+ __reExport(index_exports, assets_exports);
75
+
76
+ // src/badge.tsx
77
+ import { mergeProps } from "@base-ui/react/merge-props";
78
+ import { useRender } from "@base-ui/react/use-render";
79
+ import { cva } from "class-variance-authority";
80
+
81
+ // src/lib/utils.ts
82
+ import { clsx } from "clsx";
83
+ import { twMerge } from "tailwind-merge";
84
+ function cn(...inputs) {
85
+ return twMerge(clsx(inputs));
86
+ }
87
+
88
+ // src/badge.tsx
89
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
90
+ var badgeVariants = cva(
91
+ "h-5 gap-1 rounded-full border border-transparent px-2 py-0.5 text-xs font-medium transition-colors has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive overflow-hidden group/badge",
92
+ {
93
+ variants: {
94
+ variant: {
95
+ default: "bg-accent text-accent-foreground [a]:hover:bg-accent/80",
96
+ secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
97
+ destructive: "bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",
98
+ outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
99
+ ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
100
+ link: "text-primary underline-offset-4 hover:underline"
101
+ }
102
+ },
103
+ defaultVariants: {
104
+ variant: "default"
105
+ }
106
+ }
107
+ );
108
+ function getBadgeContent(count, max, dot) {
109
+ if (dot) return null;
110
+ if (count !== void 0 && count > max) return `${max}+`;
111
+ return count;
112
+ }
113
+ function CountBadge({ className, variant, dot, content }) {
114
+ return /* @__PURE__ */ jsx("span", { className: cn(badgeVariants({ className, variant }), dot ? "h-2 w-2 p-0" : "min-w-5 px-2", "absolute -top-1 -right-1 translate-x-1/2 -translate-y-1/2 z-10"), children: content });
115
+ }
116
+ function Badge({ className, variant = "default", render, count, max = 99, dot = false, showZero = false, children, ...props }) {
117
+ const hasCount = count !== void 0 || dot;
118
+ const renderedPlain = useRender({
119
+ defaultTagName: "span",
120
+ props: mergeProps(
121
+ {
122
+ className: cn(badgeVariants({ className, variant }))
123
+ },
124
+ { ...props, children }
125
+ ),
126
+ render,
127
+ state: {
128
+ slot: "badge",
129
+ variant
130
+ }
131
+ });
132
+ if (!hasCount) {
133
+ return renderedPlain;
134
+ }
135
+ if (!showZero && count === 0 && !dot) return /* @__PURE__ */ jsx(Fragment, { children });
136
+ const content = getBadgeContent(count, max, dot);
137
+ if (children) {
138
+ return /* @__PURE__ */ jsxs("span", { className: "relative inline-flex overflow-visible", ...props, children: [
139
+ children,
140
+ /* @__PURE__ */ jsx(CountBadge, { className, variant, dot, content })
141
+ ] });
142
+ }
143
+ return /* @__PURE__ */ jsx("span", { className: cn(badgeVariants({ className, variant }), dot ? "h-2 w-2 p-0" : "min-w-5 px-2"), ...props, children: content });
144
+ }
145
+
146
+ // src/button.tsx
147
+ import { Button as ButtonPrimitive } from "@base-ui/react/button";
148
+ import { cva as cva2 } from "class-variance-authority";
149
+ import { jsx as jsx2 } from "react/jsx-runtime";
150
+ var buttonVariants = cva2(
151
+ "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-colors disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",
152
+ {
153
+ variants: {
154
+ variant: {
155
+ default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
156
+ outline: "border-border bg-background hover:bg-accent hover:text-accent-foreground",
157
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
158
+ ghost: "hover:bg-accent hover:text-accent-foreground",
159
+ destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",
160
+ link: "text-primary underline-offset-4 hover:underline"
161
+ },
162
+ size: {
163
+ default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
164
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
165
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
166
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
167
+ icon: "size-8",
168
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
169
+ "icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
170
+ "icon-lg": "size-9"
171
+ }
172
+ },
173
+ defaultVariants: {
174
+ variant: "default",
175
+ size: "default"
176
+ }
177
+ }
178
+ );
179
+ function Button({ className, variant = "default", size = "default", ...props }) {
180
+ return /* @__PURE__ */ jsx2(ButtonPrimitive, { "data-slot": "button", className: cn(buttonVariants({ variant, size, className })), ...props });
181
+ }
182
+
183
+ // src/card.tsx
184
+ import "react";
185
+ import { jsx as jsx3 } from "react/jsx-runtime";
186
+ function Card({ className, size = "default", ...props }) {
187
+ return /* @__PURE__ */ jsx3(
188
+ "div",
189
+ {
190
+ "data-slot": "card",
191
+ "data-size": size,
192
+ className: cn(
193
+ "border-border bg-card text-card-foreground gap-4 overflow-hidden rounded-xl border py-4 text-sm has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col",
194
+ className
195
+ ),
196
+ ...props
197
+ }
198
+ );
199
+ }
200
+ function CardHeader({ className, ...props }) {
201
+ return /* @__PURE__ */ jsx3(
202
+ "div",
203
+ {
204
+ "data-slot": "card-header",
205
+ className: cn(
206
+ "gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",
207
+ className
208
+ ),
209
+ ...props
210
+ }
211
+ );
212
+ }
213
+ function CardTitle({ className, ...props }) {
214
+ return /* @__PURE__ */ jsx3("div", { "data-slot": "card-title", className: cn("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm", className), ...props });
215
+ }
216
+ function CardDescription({ className, ...props }) {
217
+ return /* @__PURE__ */ jsx3("div", { "data-slot": "card-description", className: cn("text-muted-foreground text-sm", className), ...props });
218
+ }
219
+ function CardAction({ className, ...props }) {
220
+ return /* @__PURE__ */ jsx3("div", { "data-slot": "card-action", className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className), ...props });
221
+ }
222
+ function CardContent({ className, ...props }) {
223
+ return /* @__PURE__ */ jsx3("div", { "data-slot": "card-content", className: cn("px-4 group-data-[size=sm]/card:px-3", className), ...props });
224
+ }
225
+ function CardFooter({ className, ...props }) {
226
+ return /* @__PURE__ */ jsx3("div", { "data-slot": "card-footer", className: cn("bg-muted/50 rounded-b-xl border-t p-4 group-data-[size=sm]/card:p-3 flex items-center", className), ...props });
227
+ }
228
+
229
+ // src/input.tsx
230
+ import "react";
231
+ import { Input as InputPrimitive } from "@base-ui/react/input";
232
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
233
+ function getInputClassName(className, size, fullWidth, icon, iconPosition, error) {
234
+ return cn(
235
+ "border-input bg-background focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-muted h-8 rounded-lg border px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] md:text-sm file:text-foreground placeholder:text-muted-foreground min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
236
+ fullWidth ? "w-full" : "w-auto",
237
+ size === "sm" && "h-7 text-sm",
238
+ size === "lg" && "h-10 text-lg",
239
+ icon && iconPosition === "left" && "pl-9",
240
+ icon && iconPosition === "right" && "pr-9",
241
+ error && "border-destructive",
242
+ className
243
+ );
244
+ }
245
+ function Input({ className, type, label, error, icon, iconPosition = "left", size = "md", fullWidth = true, id, ...props }) {
246
+ const inputId = id ?? (label ? `chalk-input-${String(label).toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : void 0);
247
+ if (!label && !error && !icon && size === "md" && id === void 0) {
248
+ return /* @__PURE__ */ jsx4(InputPrimitive, { type, "data-slot": "input", className: getInputClassName(className, size, fullWidth, icon, iconPosition, error), ...props });
249
+ }
250
+ const input = /* @__PURE__ */ jsxs2("div", { className: "relative", children: [
251
+ icon && iconPosition === "left" ? /* @__PURE__ */ jsx4("span", { className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: icon }) : null,
252
+ /* @__PURE__ */ jsx4(InputPrimitive, { id: inputId, type, "data-slot": "input", className: getInputClassName(className, size, fullWidth, icon, iconPosition, error), "aria-invalid": Boolean(error), ...props }),
253
+ icon && iconPosition === "right" ? /* @__PURE__ */ jsx4("span", { className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: icon }) : null
254
+ ] });
255
+ return /* @__PURE__ */ jsxs2("label", { className: cn("flex flex-col gap-1.5", fullWidth && "w-full"), htmlFor: inputId, children: [
256
+ label ? /* @__PURE__ */ jsx4("span", { className: "text-sm font-medium text-muted-foreground", children: label }) : null,
257
+ input,
258
+ error ? /* @__PURE__ */ jsx4("span", { className: "text-sm text-destructive", children: error }) : null
259
+ ] });
260
+ }
261
+
262
+ // src/select.tsx
263
+ import * as React3 from "react";
264
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
265
+ var Select = React3.forwardRef(function Select2({ options, value, onChange, label, error, size = "md", fullWidth = false, placeholder = "Select\u2026", disabled = false, className, id }, ref) {
266
+ const generatedId = React3.useId();
267
+ const selectId = id ?? generatedId;
268
+ const selectedOption = options.find((option) => option.value === value);
269
+ return /* @__PURE__ */ jsxs3("label", { className: cn("flex flex-col gap-1", fullWidth && "w-full"), htmlFor: selectId, children: [
270
+ label ? /* @__PURE__ */ jsx5("span", { className: "text-sm font-medium text-muted-foreground", children: label }) : null,
271
+ /* @__PURE__ */ jsxs3(
272
+ "select",
273
+ {
274
+ ref,
275
+ id: selectId,
276
+ value: value ?? "",
277
+ disabled,
278
+ onChange: (event) => onChange?.({ target: { value: event.target.value } }),
279
+ "aria-invalid": Boolean(error),
280
+ className: cn(
281
+ "border-input bg-background focus-visible:border-ring focus-visible:ring-ring/50 disabled:bg-muted h-8 min-w-0 rounded-lg border px-2.5 py-1 text-sm outline-none transition-colors focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
282
+ size === "sm" && "h-7 text-xs",
283
+ size === "lg" && "h-10 text-base",
284
+ fullWidth && "w-full",
285
+ !selectedOption && "text-muted-foreground",
286
+ error && "border-destructive",
287
+ className
288
+ ),
289
+ children: [
290
+ /* @__PURE__ */ jsx5("option", { value: "", disabled: options.length > 0, children: placeholder }),
291
+ options.map((option) => /* @__PURE__ */ jsx5("option", { value: option.value, disabled: option.disabled, children: option.label }, option.value))
292
+ ]
293
+ }
294
+ ),
295
+ error ? /* @__PURE__ */ jsx5("span", { className: "text-sm text-destructive", children: error }) : null
296
+ ] });
297
+ });
298
+ Select.displayName = "Select";
299
+
300
+ // src/textarea.tsx
301
+ import * as React4 from "react";
302
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
303
+ var Textarea = React4.forwardRef(function Textarea2({ label, error, showCount = false, resize = "vertical", maxLength, value, className, id, ...props }, ref) {
304
+ const generatedId = React4.useId();
305
+ const textareaId = id ?? generatedId;
306
+ const currentLength = typeof value === "string" ? value.length : 0;
307
+ return /* @__PURE__ */ jsxs4("label", { className: "flex w-full flex-col gap-1.5", htmlFor: textareaId, children: [
308
+ label ? /* @__PURE__ */ jsx6("span", { className: "text-sm font-medium text-muted-foreground", children: label }) : null,
309
+ /* @__PURE__ */ jsx6(
310
+ "textarea",
311
+ {
312
+ ref,
313
+ id: textareaId,
314
+ value,
315
+ maxLength,
316
+ "aria-invalid": Boolean(error),
317
+ className: cn(
318
+ "border-input bg-background focus-visible:border-ring focus-visible:ring-ring/50 disabled:bg-muted flex min-h-20 w-full rounded-lg border px-3 py-2 text-sm outline-none transition-colors focus-visible:ring-[3px] disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
319
+ resize === "none" && "resize-none",
320
+ resize === "vertical" && "resize-y",
321
+ resize === "horizontal" && "resize-x",
322
+ resize === "both" && "resize",
323
+ error && "border-destructive",
324
+ className
325
+ ),
326
+ ...props
327
+ }
328
+ ),
329
+ error || showCount && maxLength ? /* @__PURE__ */ jsxs4("span", { className: cn("flex justify-between text-xs text-muted-foreground", error && "text-destructive"), children: [
330
+ /* @__PURE__ */ jsx6("span", { children: error }),
331
+ showCount && maxLength ? /* @__PURE__ */ jsxs4("span", { children: [
332
+ currentLength,
333
+ " / ",
334
+ maxLength
335
+ ] }) : null
336
+ ] }) : null
337
+ ] });
338
+ });
339
+ Textarea.displayName = "Textarea";
340
+
341
+ // src/spinner.tsx
342
+ import "react";
343
+ import { jsx as jsx7 } from "react/jsx-runtime";
344
+ function Spinner({ size = "md", color, className }) {
345
+ return /* @__PURE__ */ jsx7(
346
+ "span",
347
+ {
348
+ className: cn("inline-block animate-spin rounded-full border-2 border-current border-t-transparent text-primary", size === "sm" && "h-4 w-4", size === "md" && "h-6 w-6", size === "lg" && "h-8 w-8", size === "xl" && "h-12 w-12", className),
349
+ style: color ? { color } : void 0,
350
+ role: "status",
351
+ "aria-label": "Loading"
352
+ }
353
+ );
354
+ }
355
+
356
+ // src/skeleton.tsx
357
+ import "react";
358
+ import { jsx as jsx8 } from "react/jsx-runtime";
359
+ function Skeleton({ width, height, variant = "text", animation = "pulse", className }) {
360
+ return /* @__PURE__ */ jsx8(
361
+ "div",
362
+ {
363
+ className: cn("bg-muted", variant === "text" && "rounded-sm", variant === "circular" && "rounded-full", variant === "rounded" && "rounded-md", animation === "pulse" && "animate-pulse", animation === "wave" && "animate-pulse", className),
364
+ style: { width: width ?? (variant === "text" ? "100%" : void 0), height: height ?? (variant === "text" ? "1em" : void 0) },
365
+ "aria-hidden": "true"
366
+ }
367
+ );
368
+ }
369
+
370
+ // src/icon-button.tsx
371
+ import * as React7 from "react";
372
+ import { jsx as jsx9 } from "react/jsx-runtime";
373
+ var IconButton = React7.forwardRef(function IconButton2({ icon, size = "md", variant = "default", className, type = "button", ...props }, ref) {
374
+ return /* @__PURE__ */ jsx9(
375
+ "button",
376
+ {
377
+ ref,
378
+ type,
379
+ className: cn(
380
+ "inline-flex items-center justify-center rounded-md transition-colors",
381
+ size === "sm" && "h-8 w-8 p-1.5",
382
+ size === "md" && "h-10 w-10 p-2",
383
+ size === "lg" && "h-12 w-12 p-3",
384
+ variant === "default" && "bg-muted text-foreground hover:bg-accent",
385
+ variant === "ghost" && "bg-transparent text-muted-foreground hover:bg-muted hover:text-foreground",
386
+ variant === "outline" && "border border-border bg-transparent text-foreground hover:bg-muted",
387
+ className
388
+ ),
389
+ ...props,
390
+ children: icon
391
+ }
392
+ );
393
+ });
394
+ IconButton.displayName = "IconButton";
395
+
396
+ // src/progress-bar.tsx
397
+ import "react";
398
+ import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
399
+ function ProgressBar({ value, max = 100, showLabel = false, variant = "default", size = "md", animated = false, className }) {
400
+ const percentage = Math.min(100, Math.max(0, value / max * 100));
401
+ return /* @__PURE__ */ jsxs5("div", { className: cn("w-full", className), children: [
402
+ showLabel ? /* @__PURE__ */ jsx10("div", { className: "mb-1 flex justify-between text-xs text-muted-foreground", children: /* @__PURE__ */ jsxs5("span", { children: [
403
+ Math.round(percentage),
404
+ "%"
405
+ ] }) }) : null,
406
+ /* @__PURE__ */ jsx10("div", { className: cn("w-full overflow-hidden rounded-full bg-muted", size === "sm" && "h-1", size === "md" && "h-2", size === "lg" && "h-4"), children: /* @__PURE__ */ jsx10(
407
+ "div",
408
+ {
409
+ role: "progressbar",
410
+ "aria-valuenow": value,
411
+ "aria-valuemin": 0,
412
+ "aria-valuemax": max,
413
+ className: cn("h-full rounded-full bg-primary transition-all", variant === "success" && "bg-green-500", variant === "warning" && "bg-yellow-500", variant === "danger" && "bg-destructive", animated && "animate-pulse"),
414
+ style: { width: `${percentage}%` }
415
+ }
416
+ ) })
417
+ ] });
418
+ }
419
+
420
+ // src/reactions.ts
421
+ var DEFAULT_QUICK_REACTIONS = ["\u{1F44D}", "\u2764\uFE0F", "\u{1F602}", "\u{1F62E}", "\u{1F622}", "\u{1F389}"];
422
+ var CELEBRATION_EMOJIS = ["\u{1F389}", "\u{1F38A}", "\u{1F973}", "\u{1F388}", "\u{1F3C6}", "\u{1F947}", "\u2B50", "\u{1F31F}", "\u2728", "\u{1F4AB}", "\u{1F525}", "\u{1F4A5}", "\u{1F4AF}", "\u{1F386}", "\u{1F387}"];
423
+ var EMOJI_CATEGORIES = {
424
+ smileys: {
425
+ label: "\u{1F600}",
426
+ name: "Smileys",
427
+ emojis: ["\u{1F600}", "\u{1F603}", "\u{1F604}", "\u{1F601}", "\u{1F605}", "\u{1F602}", "\u{1F923}", "\u{1F60A}", "\u{1F607}", "\u{1F642}", "\u{1F609}", "\u{1F60C}", "\u{1F60D}", "\u{1F970}", "\u{1F618}", "\u{1F60B}", "\u{1F61B}", "\u{1F92A}", "\u{1F928}", "\u{1F9D0}", "\u{1F913}", "\u{1F60E}", "\u{1F973}", "\u{1F60F}", "\u{1F612}", "\u{1F644}", "\u{1F62C}", "\u{1F62E}", "\u{1F62F}", "\u{1F632}", "\u{1F633}", "\u{1F97A}", "\u{1F622}", "\u{1F62D}", "\u{1F624}", "\u{1F620}", "\u{1F92F}", "\u{1F631}", "\u{1F976}", "\u{1F975}"]
428
+ },
429
+ gestures: {
430
+ label: "\u{1F44B}",
431
+ name: "Gestures",
432
+ emojis: ["\u{1F44B}", "\u{1F91A}", "\u{1F590}\uFE0F", "\u270B", "\u{1F596}", "\u{1F44C}", "\u{1F90C}", "\u{1F90F}", "\u270C\uFE0F", "\u{1F91E}", "\u{1F91F}", "\u{1F918}", "\u{1F919}", "\u{1F448}", "\u{1F449}", "\u{1F446}", "\u{1F447}", "\u261D\uFE0F", "\u{1F44D}", "\u{1F44E}", "\u270A", "\u{1F44A}", "\u{1F91B}", "\u{1F91C}", "\u{1F44F}", "\u{1F64C}", "\u{1F450}", "\u{1F932}", "\u{1F91D}", "\u{1F64F}", "\u{1F4AA}", "\u{1F9BE}"]
433
+ },
434
+ hearts: {
435
+ label: "\u2764\uFE0F",
436
+ name: "Hearts",
437
+ emojis: ["\u2764\uFE0F", "\u{1F9E1}", "\u{1F49B}", "\u{1F49A}", "\u{1F499}", "\u{1F49C}", "\u{1F5A4}", "\u{1F90D}", "\u{1F90E}", "\u{1F494}", "\u2764\uFE0F\u200D\u{1F525}", "\u2764\uFE0F\u200D\u{1FA79}", "\u{1F495}", "\u{1F49E}", "\u{1F493}", "\u{1F497}", "\u{1F496}", "\u{1F498}", "\u{1F49D}", "\u{1F49F}", "\u2665\uFE0F", "\u{1F60D}", "\u{1F970}", "\u{1F618}", "\u{1F63B}"]
438
+ },
439
+ celebration: {
440
+ label: "\u{1F389}",
441
+ name: "Celebration",
442
+ emojis: ["\u{1F389}", "\u{1F38A}", "\u{1F973}", "\u{1F388}", "\u{1F381}", "\u{1F380}", "\u{1F3C6}", "\u{1F947}", "\u{1F3C5}", "\u2B50", "\u{1F31F}", "\u2728", "\u{1F4AB}", "\u{1F525}", "\u{1F4A5}", "\u{1F4AF}", "\u{1F64C}", "\u{1F44F}", "\u{1F929}", "\u{1F942}", "\u{1F37E}", "\u{1F386}", "\u{1F387}", "\u{1FA85}", "\u{1F3AF}"]
443
+ },
444
+ objects: {
445
+ label: "\u{1F4A1}",
446
+ name: "Objects",
447
+ emojis: ["\u{1F4A1}", "\u{1F4CC}", "\u{1F4CD}", "\u{1F514}", "\u{1F515}", "\u{1F4E2}", "\u{1F4E3}", "\u{1F4AC}", "\u{1F4AD}", "\u{1F5EF}\uFE0F", "\u2705", "\u274C", "\u2753", "\u2757", "\u{1F4A4}", "\u{1F4A2}", "\u{1F4A6}", "\u{1F4A8}", "\u{1F550}", "\u23F0", "\u{1F4C5}", "\u{1F4C6}", "\u{1F512}", "\u{1F513}", "\u{1F511}"]
448
+ }
449
+ };
450
+ var EMOJI_KEYWORDS = {
451
+ "\u{1F600}": "grinning smile happy face",
452
+ "\u{1F603}": "smiley happy face big eyes",
453
+ "\u{1F604}": "smile happy face",
454
+ "\u{1F601}": "grin teeth face",
455
+ "\u{1F605}": "sweat smile face",
456
+ "\u{1F602}": "cry tears joy laugh face",
457
+ "\u{1F923}": "rofl laughing face",
458
+ "\u{1F60A}": "blush happy face",
459
+ "\u{1F607}": "innocent angel face",
460
+ "\u{1F642}": "slightly smiling happy face",
461
+ "\u{1F609}": "wink face",
462
+ "\u{1F60C}": "relieved face",
463
+ "\u{1F60D}": "heart eyes love face",
464
+ "\u{1F970}": "hearts love face",
465
+ "\u{1F618}": "kissing heart face",
466
+ "\u{1F60B}": "yum tongue face",
467
+ "\u{1F61B}": "stuck out tongue face",
468
+ "\u{1F92A}": "zany crazy face",
469
+ "\u{1F928}": "raised eyebrow face",
470
+ "\u{1F9D0}": "monocle inspecting face",
471
+ "\u{1F913}": "nerd glasses face",
472
+ "\u{1F60E}": "sunglasses cool face",
473
+ "\u{1F973}": "partying face",
474
+ "\u{1F60F}": "smirk sly face",
475
+ "\u{1F612}": "unamused face",
476
+ "\u{1F644}": "roll eyes face",
477
+ "\u{1F62C}": "grimacing teeth face",
478
+ "\u{1F62E}": "open mouth surprise face",
479
+ "\u{1F62F}": "hushed surprise face",
480
+ "\u{1F632}": "astonished surprise face",
481
+ "\u{1F633}": "flushed embarrassed face",
482
+ "\u{1F97A}": "pleading puppy eyes face",
483
+ "\u{1F622}": "cry sad face",
484
+ "\u{1F62D}": "sob crying face",
485
+ "\u{1F624}": "triumph steam face",
486
+ "\u{1F620}": "angry mad face",
487
+ "\u{1F92F}": "exploding head mind blown",
488
+ "\u{1F631}": "scream scared face",
489
+ "\u{1F976}": "cold freezing face",
490
+ "\u{1F975}": "hot sweating face",
491
+ "\u{1F44B}": "wave hello hand",
492
+ "\u{1F91A}": "raised back hand",
493
+ "\u{1F590}\uFE0F": "raised hand fingers splayed",
494
+ "\u270B": "raised hand stop",
495
+ "\u{1F596}": "vulcan salute star trek",
496
+ "\u{1F44C}": "ok perfect hand",
497
+ "\u{1F90C}": "pinched fingers italian",
498
+ "\u{1F90F}": "pinching small hand",
499
+ "\u270C\uFE0F": "peace victory hand",
500
+ "\u{1F91E}": "crossed fingers luck",
501
+ "\u{1F91F}": "love you hand",
502
+ "\u{1F918}": "horns rock on hand",
503
+ "\u{1F919}": "call me shaka hand",
504
+ "\u{1F448}": "point left hand",
505
+ "\u{1F449}": "point right hand",
506
+ "\u{1F446}": "point up hand",
507
+ "\u{1F447}": "point down hand",
508
+ "\u261D\uFE0F": "point up index",
509
+ "\u{1F44D}": "thumbs up yes cool",
510
+ "\u{1F44E}": "thumbs down no",
511
+ "\u270A": "fist power",
512
+ "\u{1F44A}": "fist bump punch",
513
+ "\u{1F91B}": "left-facing fist",
514
+ "\u{1F91C}": "right-facing fist",
515
+ "\u{1F44F}": "clap applause hand",
516
+ "\u{1F64C}": "raise hands celebrate",
517
+ "\u{1F450}": "open hands",
518
+ "\u{1F932}": "palms up together",
519
+ "\u{1F91D}": "handshake agree",
520
+ "\u{1F64F}": "pray please thank you",
521
+ "\u{1F4AA}": "muscle flex strong",
522
+ "\u{1F9BE}": "mechanical arm robot",
523
+ "\u2764\uFE0F": "red heart love",
524
+ "\u{1F9E1}": "orange heart love",
525
+ "\u{1F49B}": "yellow heart love",
526
+ "\u{1F49A}": "green heart love",
527
+ "\u{1F499}": "blue heart love",
528
+ "\u{1F49C}": "purple heart love",
529
+ "\u{1F5A4}": "black heart love",
530
+ "\u{1F90D}": "white heart love",
531
+ "\u{1F90E}": "brown heart love",
532
+ "\u{1F494}": "broken heart sad",
533
+ "\u2764\uFE0F\u200D\u{1F525}": "heart on fire",
534
+ "\u2764\uFE0F\u200D\u{1FA79}": "mending heart heal",
535
+ "\u{1F495}": "two hearts love",
536
+ "\u{1F49E}": "revolving hearts love",
537
+ "\u{1F493}": "beating heart love",
538
+ "\u{1F497}": "growing heart love",
539
+ "\u{1F496}": "sparkling heart love",
540
+ "\u{1F498}": "heart with arrow love",
541
+ "\u{1F49D}": "heart with ribbon gift",
542
+ "\u{1F49F}": "heart decoration love",
543
+ "\u2665\uFE0F": "heart suit card",
544
+ "\u{1F63B}": "heart eyes cat love",
545
+ "\u{1F389}": "party popper celebrate",
546
+ "\u{1F38A}": "confetti ball celebrate",
547
+ "\u{1F388}": "balloon party celebrate",
548
+ "\u{1F381}": "gift present box",
549
+ "\u{1F380}": "ribbon bow pink",
550
+ "\u{1F3C6}": "trophy win first",
551
+ "\u{1F947}": "1st place medal gold",
552
+ "\u{1F3C5}": "sports medal win",
553
+ "\u2B50": "star yellow shine",
554
+ "\u{1F31F}": "glowing star shine",
555
+ "\u2728": "sparkles magic shine",
556
+ "\u{1F4AB}": "dizzy shooting star",
557
+ "\u{1F525}": "fire hot lit flame",
558
+ "\u{1F4A5}": "collision explosion boom",
559
+ "\u{1F4AF}": "hundred percent perfect",
560
+ "\u{1F929}": "star struck eyes",
561
+ "\u{1F942}": "clinking glasses cheers",
562
+ "\u{1F37E}": "champagne bottle pop",
563
+ "\u{1F386}": "fireworks celebrate night",
564
+ "\u{1F387}": "sparkler firework celebrate",
565
+ "\u{1FA85}": "pinata party celebrate",
566
+ "\u{1F3AF}": "bullseye target hit",
567
+ "\u{1F4A1}": "light bulb idea smart",
568
+ "\u{1F4CC}": "pushpin location pin",
569
+ "\u{1F4CD}": "round pushpin location",
570
+ "\u{1F514}": "bell notification alarm",
571
+ "\u{1F515}": "bell with slash silent",
572
+ "\u{1F4E2}": "loudspeaker announce",
573
+ "\u{1F4E3}": "megaphone cheer announce",
574
+ "\u{1F4AC}": "speech balloon chat",
575
+ "\u{1F4AD}": "thought balloon think",
576
+ "\u{1F5EF}\uFE0F": "anger right balloon mad",
577
+ "\u2705": "check mark button yes",
578
+ "\u274C": "cross mark no wrong",
579
+ "\u2753": "question mark ask",
580
+ "\u2757": "exclamation mark alert",
581
+ "\u{1F4A4}": "zzz sleep tired",
582
+ "\u{1F4A2}": "anger symbol mad",
583
+ "\u{1F4A6}": "sweat drops water",
584
+ "\u{1F4A8}": "dashing away wind speed",
585
+ "\u{1F550}": "one oclock time clock",
586
+ "\u23F0": "alarm clock time",
587
+ "\u{1F4C5}": "calendar date",
588
+ "\u{1F4C6}": "tear-off calendar date",
589
+ "\u{1F512}": "locked lock secure",
590
+ "\u{1F513}": "unlocked lock open",
591
+ "\u{1F511}": "key lock secure"
592
+ };
593
+
594
+ // src/status-badge.tsx
595
+ import * as React9 from "react";
596
+ import { jsx as jsx11 } from "react/jsx-runtime";
597
+ var StatusBadge = React9.forwardRef(function StatusBadge2({ children, className, label, status = "neutral", ...props }, ref) {
598
+ return /* @__PURE__ */ jsx11("span", { ref, "data-slot": "status-badge", "data-status": status, className: cn("chalk-ui-status-badge", className), ...props, children: label ?? children ?? status });
599
+ });
600
+
601
+ // src/toast.tsx
602
+ import * as React10 from "react";
603
+ import { Toast as ToastPrimitive } from "@base-ui/react/toast";
604
+
605
+ // src/lib/theme.ts
606
+ var THEME_ATTRIBUTE_NAMES = ["data-chalk-theme", "data-theme"];
607
+ var THEME_CLASS_NAMES = ["dark", "light"];
608
+ var SYSTEM_DARK_QUERY = "(prefers-color-scheme: dark)";
609
+ var normalizeTheme = (value) => {
610
+ if (value === "dark" || value === "light") {
611
+ return value;
612
+ }
613
+ return null;
614
+ };
615
+ var resolveThemeFromElement = (element) => {
616
+ if (!element) return null;
617
+ const attributeTheme = THEME_ATTRIBUTE_NAMES.map((attributeName) => normalizeTheme(element.getAttribute(attributeName))).find((theme) => theme !== null);
618
+ const classTheme = THEME_CLASS_NAMES.find((theme) => element.classList.contains(theme));
619
+ return attributeTheme ?? classTheme ?? null;
620
+ };
621
+ var resolveSystemTheme = () => {
622
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") return null;
623
+ return window.matchMedia(SYSTEM_DARK_QUERY).matches ? "dark" : "light";
624
+ };
625
+ var resolveExplicitThemeFromDocument = () => {
626
+ if (typeof document === "undefined") return null;
627
+ return resolveThemeFromElement(document.documentElement) ?? resolveThemeFromElement(document.body);
628
+ };
629
+ var resolveFallbackTheme = ({ defaultTheme, allowSystem }) => {
630
+ if (!allowSystem) return defaultTheme;
631
+ return resolveSystemTheme() ?? defaultTheme;
632
+ };
633
+ var resolveThemeFromDocument = ({ defaultTheme = "light", allowSystem = true } = {}) => {
634
+ const explicitTheme = resolveExplicitThemeFromDocument();
635
+ return explicitTheme ?? resolveFallbackTheme({ defaultTheme, allowSystem });
636
+ };
637
+ var resolvePortalThemeFromDocument = ({ defaultTheme = "light", allowSystem = true } = {}) => {
638
+ if (typeof document === "undefined") return defaultTheme;
639
+ const portalTheme = normalizeTheme(document.querySelector("[data-chalk-theme]")?.getAttribute("data-chalk-theme"));
640
+ if (portalTheme) return portalTheme;
641
+ return resolveThemeFromDocument({ defaultTheme, allowSystem });
642
+ };
643
+
644
+ // src/toast.tsx
645
+ import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
646
+ var sharedToastManager = ToastPrimitive.createToastManager();
647
+ var toastManager = sharedToastManager;
648
+ var toast = Object.assign((options) => sharedToastManager.add(options), {
649
+ danger: (options) => sharedToastManager.add({ ...options, type: "danger" }),
650
+ dismiss: (id) => sharedToastManager.close(id),
651
+ error: (options) => sharedToastManager.add({ ...options, type: "error" }),
652
+ info: (options) => sharedToastManager.add({ ...options, type: "info" }),
653
+ success: (options) => sharedToastManager.add({ ...options, type: "success" }),
654
+ warning: (options) => sharedToastManager.add({ ...options, type: "warning" })
655
+ });
656
+ function ToastProvider({ toastManager: manager = sharedToastManager, ...props }) {
657
+ return /* @__PURE__ */ jsx12(ToastPrimitive.Provider, { toastManager: manager, ...props });
658
+ }
659
+ var ToastRoot = React10.forwardRef(function ToastRoot2({ className, toast: toastObject, ...props }, ref) {
660
+ return /* @__PURE__ */ jsx12(ToastPrimitive.Root, { ref, "data-slot": "toast", "data-type": toastObject.type ?? "neutral", toast: toastObject, className: cn("chalk-ui-toast", className), ...props });
661
+ });
662
+ var ToastContent = React10.forwardRef(function ToastContent2({ className, ...props }, ref) {
663
+ return /* @__PURE__ */ jsx12(ToastPrimitive.Content, { ref, "data-slot": "toast-content", className: cn("chalk-ui-toast-content", className), ...props });
664
+ });
665
+ var ToastTitle = React10.forwardRef(function ToastTitle2({ className, ...props }, ref) {
666
+ return /* @__PURE__ */ jsx12(ToastPrimitive.Title, { ref, "data-slot": "toast-title", className: cn("chalk-ui-toast-title", className), ...props });
667
+ });
668
+ var ToastDescription = React10.forwardRef(function ToastDescription2({ className, ...props }, ref) {
669
+ return /* @__PURE__ */ jsx12(ToastPrimitive.Description, { ref, "data-slot": "toast-description", className: cn("chalk-ui-toast-description", className), ...props });
670
+ });
671
+ var ToastClose = React10.forwardRef(function ToastClose2({ "aria-label": ariaLabel = "Dismiss notification", children = "\xD7", className, ...props }, ref) {
672
+ return /* @__PURE__ */ jsx12(ToastPrimitive.Close, { ref, "aria-label": ariaLabel, "data-slot": "toast-close", className: cn("chalk-ui-toast-close chalk-ui-focusable", className), ...props, children });
673
+ });
674
+ var ToastAction = React10.forwardRef(function ToastAction2({ className, ...props }, ref) {
675
+ return /* @__PURE__ */ jsx12(ToastPrimitive.Action, { ref, "data-slot": "toast-action", className: cn("chalk-ui-focusable", className), ...props });
676
+ });
677
+ function ToastViewport({ className, children, ...props }) {
678
+ const { toasts } = ToastPrimitive.useToastManager();
679
+ const portalTheme = resolvePortalThemeFromDocument();
680
+ return /* @__PURE__ */ jsxs6(ToastPrimitive.Viewport, { "data-chalk": true, "data-chalk-theme": portalTheme, "data-slot": "toast-viewport", className: cn("chalk-ui-root chalk-ui-toast-viewport", className), ...props, children: [
681
+ children,
682
+ toasts.map((toastObject) => {
683
+ const actionProps = toastObject.actionProps;
684
+ const { children: actionLabel, ...restActionProps } = actionProps ?? {};
685
+ return /* @__PURE__ */ jsxs6(ToastPrimitive.Root, { "data-slot": "toast", "data-type": toastObject.type ?? "neutral", toast: toastObject, className: "chalk-ui-toast", children: [
686
+ /* @__PURE__ */ jsxs6(ToastPrimitive.Content, { "data-slot": "toast-content", className: "chalk-ui-toast-content", children: [
687
+ toastObject.title ? /* @__PURE__ */ jsx12(ToastPrimitive.Title, { "data-slot": "toast-title", className: "chalk-ui-toast-title", children: toastObject.title }) : null,
688
+ toastObject.description ? /* @__PURE__ */ jsx12(ToastPrimitive.Description, { "data-slot": "toast-description", className: "chalk-ui-toast-description", children: toastObject.description }) : null,
689
+ actionProps ? /* @__PURE__ */ jsx12(ToastPrimitive.Action, { "data-slot": "toast-action", className: "chalk-ui-focusable", ...restActionProps, children: actionLabel ?? "Action" }) : null
690
+ ] }),
691
+ /* @__PURE__ */ jsx12(ToastPrimitive.Close, { "aria-label": "Dismiss notification", "data-slot": "toast-close", className: "chalk-ui-toast-close chalk-ui-focusable", children: "\xD7" })
692
+ ] }, toastObject.id);
693
+ })
694
+ ] });
695
+ }
696
+ function useToast() {
697
+ return ToastPrimitive.useToastManager();
698
+ }
699
+ var Toast = Object.assign(ToastRoot, {
700
+ Action: ToastAction,
701
+ Close: ToastClose,
702
+ Content: ToastContent,
703
+ Description: ToastDescription,
704
+ Provider: ToastProvider,
705
+ Root: ToastRoot,
706
+ Title: ToastTitle,
707
+ Viewport: ToastViewport
708
+ });
709
+
710
+ // src/toggle.tsx
711
+ import * as React11 from "react";
712
+ import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
713
+ import { cva as cva3 } from "class-variance-authority";
714
+ import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
715
+ var toggleVariants = cva3(
716
+ "hover:text-foreground aria-pressed:bg-accent focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[state=on]:bg-accent data-[state=on]:text-accent-foreground gap-1 rounded-lg text-sm font-medium transition-colors [&_svg:not([class*='size-'])]:size-4 group/toggle hover:bg-accent inline-flex items-center justify-center whitespace-nowrap outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
717
+ {
718
+ variants: {
719
+ variant: {
720
+ default: "bg-transparent",
721
+ outline: "border-input hover:bg-accent border bg-transparent"
722
+ },
723
+ size: {
724
+ default: "h-8 min-w-8 px-2",
725
+ sm: "h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-1.5 text-[0.8rem]",
726
+ lg: "h-9 min-w-9 px-2.5"
727
+ }
728
+ },
729
+ defaultVariants: {
730
+ variant: "default",
731
+ size: "default"
732
+ }
733
+ }
734
+ );
735
+ function Toggle({ className, variant = "default", size = "default", checked, enabled, onChange, label, ariaLabel, ariaLabelledby, pressed, onPressedChange, id, ...props }) {
736
+ const resolvedPressed = checked ?? enabled ?? pressed;
737
+ const generatedId = React11.useId();
738
+ const toggleId = id ?? (label ? `chalk-toggle-${generatedId.replace(/:/g, "")}` : void 0);
739
+ const toggle = /* @__PURE__ */ jsx13(TogglePrimitive, { id: toggleId, "data-slot": "toggle", className: cn(toggleVariants({ variant, size, className })), pressed: resolvedPressed, onPressedChange: onPressedChange ?? onChange, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ...props });
740
+ return label ? /* @__PURE__ */ jsxs7("span", { className: "inline-flex items-center gap-2", children: [
741
+ toggle,
742
+ /* @__PURE__ */ jsx13("label", { htmlFor: toggleId, children: label })
743
+ ] }) : toggle;
744
+ }
745
+
746
+ // src/toggle-group.tsx
747
+ import * as React12 from "react";
748
+ import { Toggle as TogglePrimitive2 } from "@base-ui/react/toggle";
749
+ import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group";
750
+ import "class-variance-authority";
751
+ import { jsx as jsx14 } from "react/jsx-runtime";
752
+ var ToggleGroupContext = React12.createContext({
753
+ size: "default",
754
+ variant: "default",
755
+ spacing: 0,
756
+ orientation: "horizontal"
757
+ });
758
+ function ToggleGroup({
759
+ className,
760
+ variant,
761
+ size,
762
+ spacing = 0,
763
+ orientation = "horizontal",
764
+ children,
765
+ ...props
766
+ }) {
767
+ return /* @__PURE__ */ jsx14(
768
+ ToggleGroupPrimitive,
769
+ {
770
+ "data-slot": "toggle-group",
771
+ "data-variant": variant,
772
+ "data-size": size,
773
+ "data-spacing": spacing,
774
+ "data-orientation": orientation,
775
+ style: { "--gap": spacing },
776
+ className: cn("rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch", className),
777
+ ...props,
778
+ children: /* @__PURE__ */ jsx14(ToggleGroupContext.Provider, { value: { variant, size, spacing, orientation }, children })
779
+ }
780
+ );
781
+ }
782
+ function ToggleGroupItem({ className, children, variant = "default", size = "default", ...props }) {
783
+ const context = React12.useContext(ToggleGroupContext);
784
+ const resolvedVariant = context.variant || variant;
785
+ const resolvedSize = context.size || size;
786
+ return /* @__PURE__ */ jsx14(
787
+ TogglePrimitive2,
788
+ {
789
+ "data-slot": "toggle-group-item",
790
+ "data-variant": resolvedVariant,
791
+ "data-size": resolvedSize,
792
+ "data-spacing": context.spacing,
793
+ className: cn(
794
+ "group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg shrink-0 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",
795
+ toggleVariants({
796
+ variant: resolvedVariant,
797
+ size: resolvedSize
798
+ }),
799
+ className
800
+ ),
801
+ ...props,
802
+ children
803
+ }
804
+ );
805
+ }
806
+
807
+ // src/tooltip.tsx
808
+ import "react";
809
+ import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
810
+ import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
811
+ function TooltipProvider({ delay = 0, ...props }) {
812
+ return /* @__PURE__ */ jsx15(TooltipPrimitive.Provider, { "data-slot": "tooltip-provider", delay, ...props });
813
+ }
814
+ function Tooltip({ content, children, position = "top", delay = 200, className, ...props }) {
815
+ if (content !== void 0) {
816
+ return /* @__PURE__ */ jsx15(TooltipProvider, { delay, children: /* @__PURE__ */ jsxs8(TooltipPrimitive.Root, { children: [
817
+ /* @__PURE__ */ jsx15(
818
+ TooltipPrimitive.Trigger,
819
+ {
820
+ render: (triggerProps) => /* @__PURE__ */ jsx15("span", { ...triggerProps, className: "inline-flex", children })
821
+ }
822
+ ),
823
+ /* @__PURE__ */ jsx15(TooltipContent, { className, side: position, children: content })
824
+ ] }) });
825
+ }
826
+ return /* @__PURE__ */ jsx15(TooltipProvider, { children: /* @__PURE__ */ jsx15(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
827
+ }
828
+ function TooltipTrigger({ ...props }) {
829
+ return /* @__PURE__ */ jsx15(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
830
+ }
831
+ function TooltipContent({ className, side = "top", sideOffset = 4, align = "center", alignOffset = 0, children, ...props }) {
832
+ const portalTheme = resolvePortalThemeFromDocument();
833
+ return /* @__PURE__ */ jsx15(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx15(TooltipPrimitive.Positioner, { align, alignOffset, side, sideOffset, className: "z-[9999]", children: /* @__PURE__ */ jsxs8(
834
+ TooltipPrimitive.Popup,
835
+ {
836
+ "data-chalk": true,
837
+ "data-chalk-theme": portalTheme,
838
+ "data-slot": "tooltip-content",
839
+ className: cn(
840
+ "chalk-root",
841
+ "data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-lg px-3 py-1.5 text-xs data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 bg-foreground text-background shadow-[var(--chalk-shadow-sm)] z-50 w-fit max-w-xs origin-(--transform-origin)",
842
+ className
843
+ ),
844
+ ...props,
845
+ children: [
846
+ children,
847
+ /* @__PURE__ */ jsx15(TooltipPrimitive.Arrow, { className: "size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 bg-foreground fill-foreground z-50 data-[side=bottom]:top-1 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" })
848
+ ]
849
+ }
850
+ ) }) });
851
+ }
852
+ export {
853
+ Badge,
854
+ Button,
855
+ CELEBRATION_EMOJIS,
856
+ Card,
857
+ CardAction,
858
+ CardContent,
859
+ CardDescription,
860
+ CardFooter,
861
+ CardHeader,
862
+ CardTitle,
863
+ DEFAULT_QUICK_REACTIONS,
864
+ EMOJI_CATEGORIES,
865
+ EMOJI_KEYWORDS,
866
+ IconButton,
867
+ Input,
868
+ ProgressBar,
869
+ Select,
870
+ Skeleton,
871
+ Spinner,
872
+ StatusBadge,
873
+ Textarea,
874
+ Toast,
875
+ ToastAction,
876
+ ToastClose,
877
+ ToastContent,
878
+ ToastDescription,
879
+ ToastProvider,
880
+ ToastRoot,
881
+ ToastTitle,
882
+ ToastViewport,
883
+ Toggle,
884
+ ToggleGroup,
885
+ ToggleGroupItem,
886
+ Tooltip,
887
+ TooltipContent,
888
+ TooltipProvider,
889
+ TooltipTrigger,
890
+ badgeVariants,
891
+ buttonVariants,
892
+ cn,
893
+ toast,
894
+ toastManager,
895
+ toggleVariants,
896
+ useToast
897
+ };