@shapesos/clay 0.13.1 → 0.14.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 (77) hide show
  1. package/dist/ai-elements.cjs +877 -0
  2. package/dist/ai-elements.cjs.map +1 -0
  3. package/dist/ai-elements.d.cts +136 -0
  4. package/dist/ai-elements.d.ts +136 -0
  5. package/dist/ai-elements.js +31 -0
  6. package/dist/ai-elements.js.map +1 -0
  7. package/dist/artifacts.cjs +56 -11
  8. package/dist/artifacts.cjs.map +1 -1
  9. package/dist/artifacts.js +6 -6
  10. package/dist/blocks.cjs +83 -28
  11. package/dist/blocks.cjs.map +1 -1
  12. package/dist/blocks.css +1 -1
  13. package/dist/blocks.js +7 -7
  14. package/dist/button.cjs +27 -17
  15. package/dist/button.cjs.map +1 -1
  16. package/dist/button.js +3 -2
  17. package/dist/chart.js +3 -3
  18. package/dist/chat.cjs +83 -28
  19. package/dist/chat.cjs.map +1 -1
  20. package/dist/chat.js +8 -8
  21. package/dist/{chunk-YSSLTXZG.js → chunk-3THOTQO3.js} +7 -7
  22. package/dist/{chunk-WPQQVKWY.js → chunk-7OYIDM42.js} +2 -2
  23. package/dist/{chunk-EDICS62G.js → chunk-B4U37WIH.js} +9 -11
  24. package/dist/chunk-B4U37WIH.js.map +1 -0
  25. package/dist/chunk-BR5S37SC.js +171 -0
  26. package/dist/chunk-BR5S37SC.js.map +1 -0
  27. package/dist/chunk-CYC2YUKU.js +1 -0
  28. package/dist/chunk-CYC2YUKU.js.map +1 -0
  29. package/dist/chunk-L75JPWGS.js +1 -0
  30. package/dist/chunk-L75JPWGS.js.map +1 -0
  31. package/dist/{chunk-QAK7NM5F.js → chunk-MDAWYZBI.js} +3 -3
  32. package/dist/{chunk-L6DUGB2E.js → chunk-PGR2MDDU.js} +16 -5
  33. package/dist/chunk-PGR2MDDU.js.map +1 -0
  34. package/dist/{chunk-OBOXCBDL.js → chunk-PYDVANWI.js} +58 -13
  35. package/dist/chunk-PYDVANWI.js.map +1 -0
  36. package/dist/{chunk-SV24ONND.js → chunk-UXT2H3FM.js} +28 -18
  37. package/dist/chunk-UXT2H3FM.js.map +1 -0
  38. package/dist/{chunk-DT44KNCV.js → chunk-XFJ6XMJZ.js} +5 -5
  39. package/dist/{chunk-QXGYMDIA.js → chunk-YZB6YXKK.js} +4 -4
  40. package/dist/icon.cjs +56 -11
  41. package/dist/icon.cjs.map +1 -1
  42. package/dist/icon.d.cts +11 -2
  43. package/dist/icon.d.ts +11 -2
  44. package/dist/icon.js +1 -1
  45. package/dist/index.cjs +652 -421
  46. package/dist/index.cjs.map +1 -1
  47. package/dist/index.d.cts +4 -2
  48. package/dist/index.d.ts +4 -2
  49. package/dist/index.js +50 -28
  50. package/dist/keyboard-shortcut.cjs +15 -4
  51. package/dist/keyboard-shortcut.cjs.map +1 -1
  52. package/dist/keyboard-shortcut.d.cts +10 -3
  53. package/dist/keyboard-shortcut.d.ts +10 -3
  54. package/dist/keyboard-shortcut.js +1 -1
  55. package/dist/text-area.cjs +27 -17
  56. package/dist/text-area.cjs.map +1 -1
  57. package/dist/text-area.d.cts +2 -24
  58. package/dist/text-area.d.ts +2 -24
  59. package/dist/text-area.js +3 -2
  60. package/dist/tokens.cjs +27 -17
  61. package/dist/tokens.cjs.map +1 -1
  62. package/dist/tokens.d.cts +6 -5
  63. package/dist/tokens.d.ts +6 -5
  64. package/dist/tokens.js +1 -1
  65. package/dist/types-CMzZsL_J.d.cts +25 -0
  66. package/dist/types-CMzZsL_J.d.ts +25 -0
  67. package/dist/utils.js +3 -3
  68. package/package.json +6 -1
  69. package/dist/chunk-EDICS62G.js.map +0 -1
  70. package/dist/chunk-L6DUGB2E.js.map +0 -1
  71. package/dist/chunk-OBOXCBDL.js.map +0 -1
  72. package/dist/chunk-SV24ONND.js.map +0 -1
  73. /package/dist/{chunk-YSSLTXZG.js.map → chunk-3THOTQO3.js.map} +0 -0
  74. /package/dist/{chunk-WPQQVKWY.js.map → chunk-7OYIDM42.js.map} +0 -0
  75. /package/dist/{chunk-QAK7NM5F.js.map → chunk-MDAWYZBI.js.map} +0 -0
  76. /package/dist/{chunk-DT44KNCV.js.map → chunk-XFJ6XMJZ.js.map} +0 -0
  77. /package/dist/{chunk-QXGYMDIA.js.map → chunk-YZB6YXKK.js.map} +0 -0
@@ -0,0 +1,877 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/components/ai-elements/index.ts
31
+ var ai_elements_exports = {};
32
+ __export(ai_elements_exports, {
33
+ CHAT_STATUS: () => CHAT_STATUS,
34
+ MouseGrid: () => MouseGrid,
35
+ PromptInput: () => PromptInput,
36
+ PromptInputFooter: () => PromptInputFooter,
37
+ PromptInputSubmit: () => PromptInputSubmit,
38
+ PromptInputTextarea: () => PromptInputTextarea,
39
+ PromptInputTools: () => PromptInputTools,
40
+ Suggestion: () => Suggestion,
41
+ Suggestions: () => Suggestions
42
+ });
43
+ module.exports = __toCommonJS(ai_elements_exports);
44
+
45
+ // src/components/ai-elements/prompt-input/prompt-input.tsx
46
+ var import_react4 = require("react");
47
+
48
+ // src/lib/utils.ts
49
+ var import_clsx = require("clsx");
50
+ var import_tailwind_merge = require("tailwind-merge");
51
+ function cn(...inputs) {
52
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
53
+ }
54
+
55
+ // src/components/button/button.tsx
56
+ var import_react2 = require("react");
57
+
58
+ // src/components/icon/icon.tsx
59
+ var import_react = require("react");
60
+
61
+ // src/components/icon/icon-styles.ts
62
+ var import_styled_components = __toESM(require("styled-components"), 1);
63
+ var STROKE_WIDTH_BY_SIZE = {
64
+ 12: 1.4,
65
+ 14: 1.4,
66
+ 16: 1.8,
67
+ 18: 1.8,
68
+ 20: 1.8,
69
+ 24: 1.8
70
+ };
71
+ var DEFAULT_STROKE_WIDTH = 1.8;
72
+ function getStrokeWidth(size) {
73
+ return STROKE_WIDTH_BY_SIZE[size] ?? DEFAULT_STROKE_WIDTH;
74
+ }
75
+ var IconWrapper = import_styled_components.default.span`
76
+ display: inline-flex;
77
+ align-items: center;
78
+ justify-content: center;
79
+ color: ${({ $color }) => $color ?? "currentColor"};
80
+ flex-shrink: 0;
81
+ `;
82
+
83
+ // src/components/icon/icon.tsx
84
+ var import_jsx_runtime = require("react/jsx-runtime");
85
+ var DEFAULT_SIZE = 16;
86
+ var Icon = (0, import_react.forwardRef)(function Icon2({ icon: IconComponent, size = DEFAULT_SIZE, color, className, "aria-label": ariaLabel }, ref) {
87
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
88
+ IconWrapper,
89
+ {
90
+ ref,
91
+ className,
92
+ $color: color,
93
+ "aria-label": ariaLabel,
94
+ role: ariaLabel ? "img" : void 0,
95
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconComponent, { width: size, height: size, strokeWidth: getStrokeWidth(size) })
96
+ }
97
+ );
98
+ });
99
+
100
+ // src/components/button/button-styles.ts
101
+ var import_styled_components2 = __toESM(require("styled-components"), 1);
102
+
103
+ // src/tokens/colors.ts
104
+ var colors = {
105
+ // White
106
+ white: "#FFFFFF",
107
+ "white-alpha-85": "rgba(255, 255, 255, 0.85)",
108
+ "white-alpha-40": "rgba(255, 255, 255, 0.40)",
109
+ // Brown
110
+ "brown-10": "#FAF9F8",
111
+ "brown-20": "#F5F3F0",
112
+ "brown-30": "#EEEBE5",
113
+ "brown-40": "#E6E2DA",
114
+ "brown-50": "#CFCBC4",
115
+ "brown-60": "#A19E99",
116
+ "brown-70": "#73716D",
117
+ "brown-80": "#5C5A57",
118
+ "brown-90": "#2E2D2C",
119
+ "brown-100": "#171716",
120
+ "brown-alpha-12": "rgba(23, 23, 22, 0.12)",
121
+ "brown-alpha-20": "rgba(23, 23, 22, 0.20)",
122
+ "brown-alpha-55": "rgba(23, 23, 22, 0.55)",
123
+ "brown-alpha-70": "rgba(23, 23, 22, 0.70)",
124
+ "brown-alpha-80": "rgba(23, 23, 22, 0.80)",
125
+ "brown-alpha-90": "rgba(23, 23, 22, 0.90)",
126
+ // Fuchsia
127
+ "fuchsia-50": "#FAF5FF",
128
+ "fuchsia-300": "#F0ABFC",
129
+ "fuchsia-500": "#D946EF",
130
+ "fuchsia-600": "#C026D3",
131
+ "fuchsia-800": "#86198F",
132
+ // Pink
133
+ "pink-50": "#FDF2F8",
134
+ "pink-400": "#F472B6",
135
+ "pink-600": "#DB2777",
136
+ "pink-800": "#9D174D",
137
+ // Violet
138
+ "violet-50": "#F5F3FF",
139
+ "violet-400": "#A78BFA",
140
+ "violet-600": "#7C3AED",
141
+ "violet-800": "#5B21B6",
142
+ // Indigo
143
+ "indigo-50": "#EEF2FF",
144
+ "indigo-400": "#818CF8",
145
+ "indigo-500": "#6366F1",
146
+ "indigo-600": "#4F46E5",
147
+ "indigo-800": "#3730A3",
148
+ // Cyan
149
+ "cyan-50": "#E7FEFF",
150
+ "cyan-300": "#67E8F9",
151
+ "cyan-600": "#0891B2",
152
+ "cyan-900": "#164E63",
153
+ // Teal
154
+ "teal-50": "#EBFDF9",
155
+ "teal-300": "#5EEAD4",
156
+ "teal-600": "#0D9488",
157
+ // Rose
158
+ "rose-400": "#FB7185",
159
+ // Purple
160
+ "purple-400": "#C084FC",
161
+ // Blue
162
+ "blue-50": "#EFF6FF",
163
+ "blue-100": "#DBEAFE",
164
+ "blue-300": "#93C5FD",
165
+ "blue-400": "#60A5FA",
166
+ "blue-600": "#2563EB",
167
+ "blue-800": "#1E40AF",
168
+ // Sky
169
+ "sky-300": "#7DD3FC",
170
+ // Green
171
+ "green-50": "#ECF9F0",
172
+ "green-100": "#D4F1D9",
173
+ "green-400": "#3DC269",
174
+ "green-700": "#277C43",
175
+ "green-800": "#1C5930",
176
+ // Orange
177
+ "orange-50": "#FFF7ED",
178
+ "orange-100": "#FFEDD5",
179
+ "orange-200": "#FED7AA",
180
+ "orange-500": "#F97316",
181
+ "orange-600": "#EA580C",
182
+ // Red
183
+ "red-50": "#FEF2F2",
184
+ "red-100": "#FEE2E2",
185
+ "red-200": "#FECACA",
186
+ "red-400": "#F7776C",
187
+ "red-500": "#EF4444",
188
+ "red-600": "#DC2626"
189
+ };
190
+
191
+ // src/tokens/typography.ts
192
+ var fontFamilies = {
193
+ /** Geist — primary UI font for body text, labels, headings, and display. */
194
+ GEIST: "Geist",
195
+ /** Crimson Pro — editorial/serif font, mostly italic. Used for decorative headings and pull quotes. */
196
+ CRIMSON_PRO: "Crimson Pro"
197
+ };
198
+ var typographyTypes = {
199
+ // Geist Label Caption (12px)
200
+ GEIST_LABEL_CAPTION_REGULAR: "GEIST_LABEL_CAPTION_REGULAR",
201
+ GEIST_LABEL_CAPTION_MEDIUM: "GEIST_LABEL_CAPTION_MEDIUM",
202
+ GEIST_LABEL_CAPTION_SEMI_BOLD: "GEIST_LABEL_CAPTION_SEMI_BOLD",
203
+ // Geist Body Extra Small (14px)
204
+ GEIST_BODY_XS_REGULAR: "GEIST_BODY_XS_REGULAR",
205
+ GEIST_BODY_XS_MEDIUM: "GEIST_BODY_XS_MEDIUM",
206
+ GEIST_BODY_XS_BOLD: "GEIST_BODY_XS_BOLD",
207
+ // Geist Body Small (16px)
208
+ GEIST_BODY_S_REGULAR: "GEIST_BODY_S_REGULAR",
209
+ GEIST_BODY_S_MEDIUM: "GEIST_BODY_S_MEDIUM",
210
+ GEIST_BODY_S_SEMI_BOLD: "GEIST_BODY_S_SEMI_BOLD",
211
+ GEIST_BODY_S_BOLD: "GEIST_BODY_S_BOLD",
212
+ // Geist Body Medium (18px)
213
+ GEIST_BODY_M_LIGHT: "GEIST_BODY_M_LIGHT",
214
+ GEIST_BODY_M_REGULAR: "GEIST_BODY_M_REGULAR",
215
+ GEIST_BODY_M_MEDIUM: "GEIST_BODY_M_MEDIUM",
216
+ GEIST_BODY_M_SEMI_BOLD: "GEIST_BODY_M_SEMI_BOLD",
217
+ // Geist Body Large (20px)
218
+ GEIST_BODY_L_REGULAR: "GEIST_BODY_L_REGULAR",
219
+ GEIST_BODY_L_MEDIUM: "GEIST_BODY_L_MEDIUM",
220
+ GEIST_BODY_L_SEMI_BOLD: "GEIST_BODY_L_SEMI_BOLD",
221
+ GEIST_BODY_L_BOLD: "GEIST_BODY_L_BOLD",
222
+ // Geist Heading Small (24px)
223
+ GEIST_HEADING_S_REGULAR: "GEIST_HEADING_S_REGULAR",
224
+ GEIST_HEADING_S_MEDIUM: "GEIST_HEADING_S_MEDIUM",
225
+ GEIST_HEADING_S_BOLD: "GEIST_HEADING_S_BOLD",
226
+ // Geist Heading Medium (28px)
227
+ GEIST_HEADING_M_BOLD: "GEIST_HEADING_M_BOLD",
228
+ // Geist Heading Large (32px)
229
+ GEIST_HEADING_L_REGULAR: "GEIST_HEADING_L_REGULAR",
230
+ GEIST_HEADING_L_MEDIUM: "GEIST_HEADING_L_MEDIUM",
231
+ GEIST_HEADING_L_SEMI_BOLD: "GEIST_HEADING_L_SEMI_BOLD",
232
+ GEIST_HEADING_L_BOLD: "GEIST_HEADING_L_BOLD",
233
+ // Geist Display Large (36px)
234
+ GEIST_DISPLAY_L_MEDIUM: "GEIST_DISPLAY_L_MEDIUM",
235
+ // Crimson Pro Body Small (16px, italic)
236
+ CRIMSON_PRO_BODY_S_LIGHT_ITALIC: "CRIMSON_PRO_BODY_S_LIGHT_ITALIC",
237
+ // Crimson Pro Body Medium (18px, italic)
238
+ CRIMSON_PRO_BODY_M_LIGHT_ITALIC: "CRIMSON_PRO_BODY_M_LIGHT_ITALIC",
239
+ // Crimson Pro Heading Medium (24px, italic)
240
+ CRIMSON_PRO_HEADING_M_MEDIUM_ITALIC: "CRIMSON_PRO_HEADING_M_MEDIUM_ITALIC",
241
+ // Crimson Pro Display Large (40px, upright)
242
+ CRIMSON_PRO_DISPLAY_L_REGULAR: "CRIMSON_PRO_DISPLAY_L_REGULAR",
243
+ // Crimson Pro Display Extra Large (46px, italic)
244
+ CRIMSON_PRO_DISPLAY_XL_REGULAR_ITALIC: "CRIMSON_PRO_DISPLAY_XL_REGULAR_ITALIC"
245
+ };
246
+ var typographyStyles = {
247
+ // Geist Label Caption (12px)
248
+ [typographyTypes.GEIST_LABEL_CAPTION_REGULAR]: {
249
+ fontFamily: fontFamilies.GEIST,
250
+ fontSize: 12,
251
+ fontWeight: 400,
252
+ lineHeight: 16
253
+ },
254
+ [typographyTypes.GEIST_LABEL_CAPTION_MEDIUM]: {
255
+ fontFamily: fontFamilies.GEIST,
256
+ fontSize: 12,
257
+ fontWeight: 500,
258
+ lineHeight: 16
259
+ },
260
+ [typographyTypes.GEIST_LABEL_CAPTION_SEMI_BOLD]: {
261
+ fontFamily: fontFamilies.GEIST,
262
+ fontSize: 12,
263
+ fontWeight: 600,
264
+ lineHeight: 16
265
+ },
266
+ // Geist Body Extra Small (14px)
267
+ [typographyTypes.GEIST_BODY_XS_REGULAR]: {
268
+ fontFamily: fontFamilies.GEIST,
269
+ fontSize: 14,
270
+ fontWeight: 400,
271
+ lineHeight: 20
272
+ },
273
+ [typographyTypes.GEIST_BODY_XS_MEDIUM]: {
274
+ fontFamily: fontFamilies.GEIST,
275
+ fontSize: 14,
276
+ fontWeight: 500,
277
+ lineHeight: 20
278
+ },
279
+ [typographyTypes.GEIST_BODY_XS_BOLD]: {
280
+ fontFamily: fontFamilies.GEIST,
281
+ fontSize: 14,
282
+ fontWeight: 600,
283
+ lineHeight: 20
284
+ },
285
+ // Geist Body Small (16px)
286
+ [typographyTypes.GEIST_BODY_S_REGULAR]: {
287
+ fontFamily: fontFamilies.GEIST,
288
+ fontSize: 16,
289
+ fontWeight: 400,
290
+ lineHeight: 24,
291
+ letterSpacing: -0.08
292
+ },
293
+ [typographyTypes.GEIST_BODY_S_MEDIUM]: {
294
+ fontFamily: fontFamilies.GEIST,
295
+ fontSize: 16,
296
+ fontWeight: 500,
297
+ lineHeight: 24,
298
+ letterSpacing: -0.08
299
+ },
300
+ [typographyTypes.GEIST_BODY_S_SEMI_BOLD]: {
301
+ fontFamily: fontFamilies.GEIST,
302
+ fontSize: 16,
303
+ fontWeight: 600,
304
+ lineHeight: 24,
305
+ letterSpacing: -0.08
306
+ },
307
+ [typographyTypes.GEIST_BODY_S_BOLD]: {
308
+ fontFamily: fontFamilies.GEIST,
309
+ fontSize: 16,
310
+ fontWeight: 700,
311
+ lineHeight: 24,
312
+ letterSpacing: -0.08
313
+ },
314
+ // Geist Body Medium (18px)
315
+ [typographyTypes.GEIST_BODY_M_LIGHT]: {
316
+ fontFamily: fontFamilies.GEIST,
317
+ fontSize: 18,
318
+ fontWeight: 300,
319
+ lineHeight: 28,
320
+ letterSpacing: -0.09
321
+ },
322
+ [typographyTypes.GEIST_BODY_M_REGULAR]: {
323
+ fontFamily: fontFamilies.GEIST,
324
+ fontSize: 18,
325
+ fontWeight: 400,
326
+ lineHeight: 28,
327
+ letterSpacing: -0.09
328
+ },
329
+ [typographyTypes.GEIST_BODY_M_MEDIUM]: {
330
+ fontFamily: fontFamilies.GEIST,
331
+ fontSize: 18,
332
+ fontWeight: 500,
333
+ lineHeight: 28,
334
+ letterSpacing: -0.09
335
+ },
336
+ [typographyTypes.GEIST_BODY_M_SEMI_BOLD]: {
337
+ fontFamily: fontFamilies.GEIST,
338
+ fontSize: 18,
339
+ fontWeight: 600,
340
+ lineHeight: 28,
341
+ letterSpacing: -0.09
342
+ },
343
+ // Geist Body Large (20px)
344
+ [typographyTypes.GEIST_BODY_L_REGULAR]: {
345
+ fontFamily: fontFamilies.GEIST,
346
+ fontSize: 20,
347
+ fontWeight: 400,
348
+ lineHeight: 30,
349
+ letterSpacing: -0.2
350
+ },
351
+ [typographyTypes.GEIST_BODY_L_MEDIUM]: {
352
+ fontFamily: fontFamilies.GEIST,
353
+ fontSize: 20,
354
+ fontWeight: 500,
355
+ lineHeight: 30,
356
+ letterSpacing: -0.2
357
+ },
358
+ [typographyTypes.GEIST_BODY_L_SEMI_BOLD]: {
359
+ fontFamily: fontFamilies.GEIST,
360
+ fontSize: 20,
361
+ fontWeight: 600,
362
+ lineHeight: 30,
363
+ letterSpacing: -0.2
364
+ },
365
+ [typographyTypes.GEIST_BODY_L_BOLD]: {
366
+ fontFamily: fontFamilies.GEIST,
367
+ fontSize: 20,
368
+ fontWeight: 700,
369
+ lineHeight: 30,
370
+ letterSpacing: -0.2
371
+ },
372
+ // Geist Heading Small (24px)
373
+ [typographyTypes.GEIST_HEADING_S_REGULAR]: {
374
+ fontFamily: fontFamilies.GEIST,
375
+ fontSize: 24,
376
+ fontWeight: 400,
377
+ lineHeight: 32,
378
+ letterSpacing: -0.48
379
+ },
380
+ [typographyTypes.GEIST_HEADING_S_MEDIUM]: {
381
+ fontFamily: fontFamilies.GEIST,
382
+ fontSize: 24,
383
+ fontWeight: 500,
384
+ lineHeight: 32,
385
+ letterSpacing: -0.48
386
+ },
387
+ [typographyTypes.GEIST_HEADING_S_BOLD]: {
388
+ fontFamily: fontFamilies.GEIST,
389
+ fontSize: 24,
390
+ fontWeight: 700,
391
+ lineHeight: 32,
392
+ letterSpacing: -0.48
393
+ },
394
+ // Geist Heading Medium (28px)
395
+ [typographyTypes.GEIST_HEADING_M_BOLD]: {
396
+ fontFamily: fontFamilies.GEIST,
397
+ fontSize: 28,
398
+ fontWeight: 700,
399
+ lineHeight: 36,
400
+ letterSpacing: -0.6
401
+ },
402
+ // Geist Heading Large (32px)
403
+ [typographyTypes.GEIST_HEADING_L_REGULAR]: {
404
+ fontFamily: fontFamilies.GEIST,
405
+ fontSize: 32,
406
+ fontWeight: 400,
407
+ lineHeight: 40,
408
+ letterSpacing: -0.64
409
+ },
410
+ [typographyTypes.GEIST_HEADING_L_MEDIUM]: {
411
+ fontFamily: fontFamilies.GEIST,
412
+ fontSize: 32,
413
+ fontWeight: 500,
414
+ lineHeight: 40,
415
+ letterSpacing: -0.64
416
+ },
417
+ [typographyTypes.GEIST_HEADING_L_SEMI_BOLD]: {
418
+ fontFamily: fontFamilies.GEIST,
419
+ fontSize: 32,
420
+ fontWeight: 600,
421
+ lineHeight: 40,
422
+ letterSpacing: -0.64
423
+ },
424
+ [typographyTypes.GEIST_HEADING_L_BOLD]: {
425
+ fontFamily: fontFamilies.GEIST,
426
+ fontSize: 32,
427
+ fontWeight: 700,
428
+ lineHeight: 40,
429
+ letterSpacing: -0.64
430
+ },
431
+ // Geist Display Large (36px)
432
+ [typographyTypes.GEIST_DISPLAY_L_MEDIUM]: {
433
+ fontFamily: fontFamilies.GEIST,
434
+ fontSize: 36,
435
+ fontWeight: 500,
436
+ lineHeight: 44,
437
+ letterSpacing: -0.72
438
+ },
439
+ // Crimson Pro Body Small (16px, italic)
440
+ [typographyTypes.CRIMSON_PRO_BODY_S_LIGHT_ITALIC]: {
441
+ fontFamily: fontFamilies.CRIMSON_PRO,
442
+ fontSize: 16,
443
+ fontWeight: 300,
444
+ lineHeight: 20,
445
+ letterSpacing: -0.32,
446
+ fontStyle: "italic"
447
+ },
448
+ // Crimson Pro Body Medium (18px, italic)
449
+ [typographyTypes.CRIMSON_PRO_BODY_M_LIGHT_ITALIC]: {
450
+ fontFamily: fontFamilies.CRIMSON_PRO,
451
+ fontSize: 18,
452
+ fontWeight: 300,
453
+ lineHeight: 28,
454
+ letterSpacing: 0,
455
+ fontStyle: "italic"
456
+ },
457
+ // Crimson Pro Heading Medium (24px, italic)
458
+ [typographyTypes.CRIMSON_PRO_HEADING_M_MEDIUM_ITALIC]: {
459
+ fontFamily: fontFamilies.CRIMSON_PRO,
460
+ fontSize: 24,
461
+ fontWeight: 400,
462
+ lineHeight: 32,
463
+ letterSpacing: -0.48,
464
+ fontStyle: "italic"
465
+ },
466
+ // Crimson Pro Display Large (40px, upright)
467
+ [typographyTypes.CRIMSON_PRO_DISPLAY_L_REGULAR]: {
468
+ fontFamily: fontFamilies.CRIMSON_PRO,
469
+ fontSize: 40,
470
+ fontWeight: 300,
471
+ lineHeight: 48,
472
+ letterSpacing: -1.6
473
+ },
474
+ // Crimson Pro Display Extra Large (46px, italic)
475
+ [typographyTypes.CRIMSON_PRO_DISPLAY_XL_REGULAR_ITALIC]: {
476
+ fontFamily: fontFamilies.CRIMSON_PRO,
477
+ fontSize: 46,
478
+ fontWeight: 400,
479
+ lineHeight: 54,
480
+ letterSpacing: -1.38,
481
+ fontStyle: "italic"
482
+ }
483
+ };
484
+ function typographyMixin(type) {
485
+ const style = typographyStyles[type];
486
+ return [
487
+ `font-family: "${style.fontFamily}", sans-serif`,
488
+ `font-size: ${style.fontSize}px`,
489
+ `font-weight: ${style.fontWeight}`,
490
+ `line-height: ${style.lineHeight}px`,
491
+ `letter-spacing: ${style.letterSpacing != null ? `${style.letterSpacing}px` : "inherit"}`,
492
+ `font-style: ${style.fontStyle ?? "normal"}`
493
+ ].join(";\n ");
494
+ }
495
+
496
+ // src/components/button/constants.ts
497
+ var BUTTON_VARIANT = {
498
+ SOLID: "solid",
499
+ OUTLINE: "outline",
500
+ GHOST: "ghost"
501
+ };
502
+ var BUTTON_SIZE = {
503
+ XS: "xs",
504
+ S: "s",
505
+ M: "m"
506
+ };
507
+ var BUTTON_INTENT = {
508
+ PRIMARY: "primary",
509
+ ERROR: "error"
510
+ };
511
+ var ICON_POSITION = {
512
+ LEADING: "leading",
513
+ TRAILING: "trailing"
514
+ };
515
+
516
+ // src/components/button/button-styles.ts
517
+ var intentColors = {
518
+ [BUTTON_INTENT.PRIMARY]: {
519
+ base: colors["brown-100"],
520
+ hover: colors["brown-90"],
521
+ disabledBg: colors["brown-20"],
522
+ disabledText: colors["brown-50"],
523
+ subtleHover: colors["brown-20"],
524
+ border: colors["brown-40"],
525
+ disabledBorder: colors["brown-20"]
526
+ },
527
+ [BUTTON_INTENT.ERROR]: {
528
+ base: colors["red-500"],
529
+ hover: colors["red-600"],
530
+ disabledBg: colors["red-100"],
531
+ disabledText: colors["red-200"],
532
+ subtleHover: colors["red-50"],
533
+ border: colors["red-200"],
534
+ disabledBorder: colors["red-100"]
535
+ }
536
+ };
537
+ var sizeValues = {
538
+ [BUTTON_SIZE.XS]: { padding: "6px 10px", borderRadius: "8px", gap: "4px" },
539
+ [BUTTON_SIZE.S]: { padding: "8px 12px", borderRadius: "10px", gap: "6px" },
540
+ [BUTTON_SIZE.M]: { padding: "10px 14px", borderRadius: "10px", gap: "6px" }
541
+ };
542
+ function sizeMixin({ $size }) {
543
+ const s = sizeValues[$size];
544
+ return import_styled_components2.css`
545
+ padding: ${s.padding};
546
+ border-radius: ${s.borderRadius};
547
+ gap: ${s.gap};
548
+ `;
549
+ }
550
+ var variantColorMap = {
551
+ [BUTTON_VARIANT.SOLID]: (c) => ({
552
+ background: c.base,
553
+ color: colors.white,
554
+ border: "none",
555
+ hoverBg: c.hover,
556
+ disabledBg: c.disabledBg,
557
+ disabledColor: c.disabledText
558
+ }),
559
+ [BUTTON_VARIANT.OUTLINE]: (c) => ({
560
+ background: colors.white,
561
+ color: c.base,
562
+ border: `1px solid ${c.border}`,
563
+ hoverBg: c.subtleHover,
564
+ disabledColor: c.disabledText,
565
+ disabledBorder: c.disabledBorder
566
+ }),
567
+ [BUTTON_VARIANT.GHOST]: (c) => ({
568
+ background: "transparent",
569
+ color: c.base,
570
+ border: "none",
571
+ hoverBg: c.subtleHover,
572
+ disabledColor: c.disabledText
573
+ })
574
+ };
575
+ function variantMixin({
576
+ $variant,
577
+ $intent
578
+ }) {
579
+ const v = variantColorMap[$variant](intentColors[$intent]);
580
+ return import_styled_components2.css`
581
+ background: ${v.background};
582
+ color: ${v.color};
583
+ border: ${v.border};
584
+
585
+ &:hover:not(:disabled) {
586
+ background: ${v.hoverBg};
587
+ }
588
+
589
+ &:disabled {
590
+ color: ${v.disabledColor};
591
+ ${v.disabledBg ? `background: ${v.disabledBg};` : ""}
592
+ ${v.disabledBorder ? `border-color: ${v.disabledBorder};` : ""}
593
+ }
594
+ `;
595
+ }
596
+ var StyledButton = import_styled_components2.default.button`
597
+ display: inline-flex;
598
+ align-items: center;
599
+ justify-content: center;
600
+ cursor: pointer;
601
+ ${typographyMixin(typographyTypes.GEIST_BODY_XS_MEDIUM)};
602
+ transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
603
+
604
+ &:disabled {
605
+ cursor: not-allowed;
606
+ }
607
+
608
+ ${sizeMixin}
609
+ ${variantMixin}
610
+ `;
611
+
612
+ // src/components/button/button.tsx
613
+ var import_jsx_runtime2 = require("react/jsx-runtime");
614
+ var Button = (0, import_react2.forwardRef)(function Button2({
615
+ children,
616
+ variant = BUTTON_VARIANT.SOLID,
617
+ intent = BUTTON_INTENT.PRIMARY,
618
+ size = BUTTON_SIZE.M,
619
+ icon,
620
+ iconPosition = ICON_POSITION.LEADING,
621
+ disabled = false,
622
+ onClick,
623
+ className,
624
+ "aria-label": ariaLabel
625
+ }, ref) {
626
+ const iconElement = icon ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon, { icon, size: 16 }) : null;
627
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
628
+ StyledButton,
629
+ {
630
+ ref,
631
+ type: "button",
632
+ $variant: variant,
633
+ $intent: intent,
634
+ $size: size,
635
+ disabled,
636
+ onClick: disabled ? void 0 : onClick,
637
+ className,
638
+ "aria-label": ariaLabel,
639
+ children: [
640
+ iconPosition === ICON_POSITION.LEADING && iconElement,
641
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children }),
642
+ iconPosition === ICON_POSITION.TRAILING && iconElement
643
+ ]
644
+ }
645
+ );
646
+ });
647
+
648
+ // src/components/text-area/text-area.tsx
649
+ var import_react3 = require("react");
650
+
651
+ // src/utils/merge-refs.ts
652
+ function mergeRefs(...refs) {
653
+ return (node) => {
654
+ for (const ref of refs) {
655
+ if (typeof ref === "function") {
656
+ ref(node);
657
+ } else if (ref) {
658
+ ref.current = node;
659
+ }
660
+ }
661
+ };
662
+ }
663
+
664
+ // src/components/text-area/text-area-styles.ts
665
+ var import_styled_components3 = __toESM(require("styled-components"), 1);
666
+ var StyledTextArea = import_styled_components3.default.textarea`
667
+ ${typographyMixin(typographyTypes.GEIST_BODY_S_REGULAR)};
668
+ color: ${colors["brown-100"]};
669
+ border: none;
670
+ outline: none;
671
+ resize: none;
672
+ width: 100%;
673
+ background: transparent;
674
+ vertical-align: bottom;
675
+ max-height: ${({ $maxHeight }) => $maxHeight ? `${$maxHeight}px` : "none"};
676
+ overflow-y: ${({ $maxHeight }) => $maxHeight ? "auto" : "hidden"};
677
+
678
+ &::placeholder {
679
+ color: ${colors["brown-50"]};
680
+ }
681
+
682
+ &:disabled {
683
+ opacity: 0.5;
684
+ cursor: not-allowed;
685
+ }
686
+ `;
687
+
688
+ // src/components/text-area/text-area.tsx
689
+ var import_jsx_runtime3 = require("react/jsx-runtime");
690
+ var TextArea = (0, import_react3.forwardRef)(function TextArea2({ value, onChange, placeholder, maxHeight, rows = 1, autoFocus, onKeyDown, disabled, className }, externalRef) {
691
+ const internalRef = (0, import_react3.useRef)(null);
692
+ (0, import_react3.useLayoutEffect)(() => {
693
+ const el = internalRef.current;
694
+ if (el) {
695
+ el.style.height = "auto";
696
+ el.style.height = `${el.scrollHeight}px`;
697
+ }
698
+ }, [value]);
699
+ const handleChange = (0, import_react3.useCallback)(
700
+ (e) => {
701
+ onChange(e.target.value);
702
+ },
703
+ [onChange]
704
+ );
705
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
706
+ StyledTextArea,
707
+ {
708
+ ref: mergeRefs(internalRef, externalRef),
709
+ value,
710
+ onChange: handleChange,
711
+ placeholder,
712
+ $maxHeight: maxHeight,
713
+ rows,
714
+ autoFocus,
715
+ onKeyDown,
716
+ disabled,
717
+ className
718
+ }
719
+ );
720
+ });
721
+
722
+ // src/components/ai-elements/prompt-input/types.ts
723
+ var CHAT_STATUS = {
724
+ /** Idle / ready to submit. */
725
+ READY: "ready",
726
+ /** The last submission errored — the button shows a retry affordance. */
727
+ ERROR: "error"
728
+ };
729
+
730
+ // src/components/ai-elements/prompt-input/prompt-input.tsx
731
+ var import_jsx_runtime4 = require("react/jsx-runtime");
732
+ var PromptInput = ({ className, onSubmit, disabled, children, ...props }) => {
733
+ const handleSubmit = (0, import_react4.useCallback)(
734
+ (event) => {
735
+ event.preventDefault();
736
+ if (disabled) {
737
+ return;
738
+ }
739
+ const textarea = event.currentTarget.querySelector("textarea");
740
+ const text = textarea?.value ?? "";
741
+ if (!text.trim()) {
742
+ return;
743
+ }
744
+ onSubmit({ text }, event);
745
+ },
746
+ [disabled, onSubmit]
747
+ );
748
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
749
+ "form",
750
+ {
751
+ className: cn(
752
+ "flex w-full flex-col overflow-hidden rounded-xl border bg-background shadow-lg shadow-foreground/5",
753
+ className
754
+ ),
755
+ onSubmit: handleSubmit,
756
+ ...props,
757
+ children
758
+ }
759
+ );
760
+ };
761
+ var PromptInputTextarea = (0, import_react4.forwardRef)(
762
+ function PromptInputTextarea2({ className, onKeyDown, placeholder = "What would you like to know?", ...props }, ref) {
763
+ const handleKeyDown = (0, import_react4.useCallback)(
764
+ (event) => {
765
+ onKeyDown?.(event);
766
+ if (event.defaultPrevented) {
767
+ return;
768
+ }
769
+ if (event.key === "Enter" && !event.shiftKey && !event.nativeEvent.isComposing) {
770
+ event.preventDefault();
771
+ event.currentTarget.form?.requestSubmit();
772
+ }
773
+ },
774
+ [onKeyDown]
775
+ );
776
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: cn("py-3", className), children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TextArea, { ref, className: "px-4", onKeyDown: handleKeyDown, placeholder, ...props }) });
777
+ }
778
+ );
779
+ var PromptInputFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: cn("flex items-center justify-between gap-1 px-4 pb-3", className), ...props });
780
+ var PromptInputTools = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: cn("flex min-w-0 items-center gap-1", className), ...props });
781
+ var PromptInputSubmit = ({
782
+ label = "Submit",
783
+ status = CHAT_STATUS.READY,
784
+ disabled,
785
+ className
786
+ }) => {
787
+ const handleClick = (0, import_react4.useCallback)((event) => {
788
+ event.currentTarget.form?.requestSubmit();
789
+ }, []);
790
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
791
+ Button,
792
+ {
793
+ intent: status === CHAT_STATUS.ERROR ? BUTTON_INTENT.ERROR : BUTTON_INTENT.PRIMARY,
794
+ size: BUTTON_SIZE.XS,
795
+ className,
796
+ disabled,
797
+ onClick: handleClick,
798
+ children: label
799
+ }
800
+ );
801
+ };
802
+
803
+ // src/components/ai-elements/mouse-grid/mouse-grid.tsx
804
+ var import_react5 = require("react");
805
+ var import_jsx_runtime5 = require("react/jsx-runtime");
806
+ function MouseGrid({ glowColor } = {}) {
807
+ const layerRef = (0, import_react5.useRef)(null);
808
+ (0, import_react5.useEffect)(() => {
809
+ let raf = 0;
810
+ let clientX = 0;
811
+ let clientY = 0;
812
+ function flush() {
813
+ raf = 0;
814
+ const layer = layerRef.current;
815
+ if (!layer) {
816
+ return;
817
+ }
818
+ const rect = layer.getBoundingClientRect();
819
+ layer.style.setProperty("--vibe-mx", `${clientX - rect.left}px`);
820
+ layer.style.setProperty("--vibe-my", `${clientY - rect.top}px`);
821
+ }
822
+ function onMove(event) {
823
+ clientX = event.clientX;
824
+ clientY = event.clientY;
825
+ if (raf) {
826
+ return;
827
+ }
828
+ raf = requestAnimationFrame(flush);
829
+ }
830
+ window.addEventListener("mousemove", onMove, { passive: true });
831
+ return () => {
832
+ window.removeEventListener("mousemove", onMove);
833
+ if (raf) {
834
+ cancelAnimationFrame(raf);
835
+ }
836
+ };
837
+ }, []);
838
+ const glowStyle = glowColor ? { "--vibe-glow-color": glowColor } : void 0;
839
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { ref: layerRef, "aria-hidden": "true", className: "vibe-mouse-grid-layer", children: [
840
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "vibe-mouse-grid" }),
841
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "vibe-mouse-glow", style: glowStyle })
842
+ ] });
843
+ }
844
+
845
+ // src/components/ai-elements/suggestion/suggestion.tsx
846
+ var import_react6 = require("react");
847
+ var import_jsx_runtime6 = require("react/jsx-runtime");
848
+ var Suggestions = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: cn("flex flex-wrap items-center justify-center gap-3", className), ...props });
849
+ var Suggestion = ({ suggestion, onClick, className, children, ...props }) => {
850
+ const handleClick = (0, import_react6.useCallback)(() => onClick?.(suggestion), [onClick, suggestion]);
851
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
852
+ "button",
853
+ {
854
+ type: "button",
855
+ onClick: handleClick,
856
+ className: cn(
857
+ "cursor-pointer whitespace-nowrap rounded-full border border-brown-30 bg-white px-4 py-2 text-sm text-brown-100 transition-colors hover:bg-brown-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brown-40",
858
+ className
859
+ ),
860
+ ...props,
861
+ children: children ?? suggestion
862
+ }
863
+ );
864
+ };
865
+ // Annotate the CommonJS export names for ESM import in node:
866
+ 0 && (module.exports = {
867
+ CHAT_STATUS,
868
+ MouseGrid,
869
+ PromptInput,
870
+ PromptInputFooter,
871
+ PromptInputSubmit,
872
+ PromptInputTextarea,
873
+ PromptInputTools,
874
+ Suggestion,
875
+ Suggestions
876
+ });
877
+ //# sourceMappingURL=ai-elements.cjs.map