@arbidocs/blocks 0.5.23 → 0.5.24

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 (83) hide show
  1. package/dist/{WorkspaceTableView-6JVHGDUB.cjs → WorkspaceTableView-GIDGNGBW.cjs} +6 -6
  2. package/dist/{WorkspaceTableView-6JVHGDUB.cjs.map → WorkspaceTableView-GIDGNGBW.cjs.map} +1 -1
  3. package/dist/{WorkspaceTableView-ECPHGWHF.js → WorkspaceTableView-S2PTTVHL.js} +4 -4
  4. package/dist/{WorkspaceTableView-ECPHGWHF.js.map → WorkspaceTableView-S2PTTVHL.js.map} +1 -1
  5. package/dist/{chunk-7DDMF3DZ.cjs → chunk-53T2FY4Z.cjs} +5 -31
  6. package/dist/chunk-53T2FY4Z.cjs.map +1 -0
  7. package/dist/chunk-5ZBXFHZW.js +434 -0
  8. package/dist/chunk-5ZBXFHZW.js.map +1 -0
  9. package/dist/{chunk-O4EQYPLO.cjs → chunk-C2SZQKX2.cjs} +169 -27
  10. package/dist/chunk-C2SZQKX2.cjs.map +1 -0
  11. package/dist/{chunk-RVKVGS72.js → chunk-FDUQQNDT.js} +2 -2
  12. package/dist/{chunk-RVKVGS72.js.map → chunk-FDUQQNDT.js.map} +1 -1
  13. package/dist/{chunk-TTJGCJWX.cjs → chunk-H3XAHVDT.cjs} +42 -2
  14. package/dist/chunk-H3XAHVDT.cjs.map +1 -0
  15. package/dist/{chunk-XL55UDLO.js → chunk-IJJKUTKM.js} +5 -30
  16. package/dist/chunk-IJJKUTKM.js.map +1 -0
  17. package/dist/{chunk-ZX663X3X.cjs → chunk-KNRAKOCO.cjs} +6 -428
  18. package/dist/chunk-KNRAKOCO.cjs.map +1 -0
  19. package/dist/chunk-KUQOHPKP.cjs +443 -0
  20. package/dist/chunk-KUQOHPKP.cjs.map +1 -0
  21. package/dist/{chunk-F2BYURQZ.cjs → chunk-LYF47OXX.cjs} +5 -5
  22. package/dist/{chunk-F2BYURQZ.cjs.map → chunk-LYF47OXX.cjs.map} +1 -1
  23. package/dist/{chunk-PZRTRYPD.js → chunk-MKTEVOC3.js} +44 -5
  24. package/dist/chunk-MKTEVOC3.js.map +1 -0
  25. package/dist/{chunk-6XW3CMU4.js → chunk-N3KNAQ55.js} +144 -4
  26. package/dist/chunk-N3KNAQ55.js.map +1 -0
  27. package/dist/{chunk-FZVAJFRH.cjs → chunk-RHKFCSFC.cjs} +2 -2
  28. package/dist/{chunk-FZVAJFRH.cjs.map → chunk-RHKFCSFC.cjs.map} +1 -1
  29. package/dist/{chunk-NVRJ6WTR.js → chunk-RTAYJUQM.js} +3 -3
  30. package/dist/{chunk-NVRJ6WTR.js.map → chunk-RTAYJUQM.js.map} +1 -1
  31. package/dist/{chunk-SLRVI2YU.js → chunk-X6U6L6BG.js} +29 -4
  32. package/dist/chunk-X6U6L6BG.js.map +1 -0
  33. package/dist/{chunk-SQ5F5BFW.cjs → chunk-XDU3HHUU.cjs} +32 -6
  34. package/dist/chunk-XDU3HHUU.cjs.map +1 -0
  35. package/dist/{chunk-SKVVOEMX.js → chunk-XXUPUXBF.js} +8 -423
  36. package/dist/chunk-XXUPUXBF.js.map +1 -0
  37. package/dist/connect/index.cjs +1039 -565
  38. package/dist/connect/index.cjs.map +1 -1
  39. package/dist/connect/index.js +649 -180
  40. package/dist/connect/index.js.map +1 -1
  41. package/dist/connection/auth/CompactLogin.d.ts +26 -0
  42. package/dist/connection/auth/ConnectedLoginPage.d.ts +9 -1
  43. package/dist/connection/auth/index.d.ts +3 -1
  44. package/dist/connection/auth/sso-popup.d.ts +13 -0
  45. package/dist/connection/auth/sso-sign-in.d.ts +38 -0
  46. package/dist/connection/auth/useLoginActions.d.ts +4 -2
  47. package/dist/connection/projects/ConnectedProjectsPanel.d.ts +9 -1
  48. package/dist/connection/projects/ProjectsListPage.d.ts +40 -0
  49. package/dist/connection/projects/index.d.ts +1 -0
  50. package/dist/connection/settings-page/appearanceSection.d.ts +30 -0
  51. package/dist/connection/settings-page/index.d.ts +1 -0
  52. package/dist/index.cjs +162 -190
  53. package/dist/index.cjs.map +1 -1
  54. package/dist/index.d.ts +2 -0
  55. package/dist/index.js +9 -48
  56. package/dist/index.js.map +1 -1
  57. package/dist/settings/AppearanceSettings.d.ts +1 -2
  58. package/dist/settings/index.cjs +153 -153
  59. package/dist/settings/index.d.ts +2 -1
  60. package/dist/settings/index.js +1 -1
  61. package/dist/site/index.cjs +82 -74
  62. package/dist/site/index.d.ts +2 -0
  63. package/dist/site/index.js +3 -3
  64. package/dist/studio/index.cjs +73 -73
  65. package/dist/studio/index.js +5 -5
  66. package/dist/theme/appearance.d.ts +47 -0
  67. package/dist/theme/fromCss.d.ts +33 -0
  68. package/node_modules/@arbidocs/coedit/package.json +1 -1
  69. package/package.json +5 -5
  70. package/dist/chunk-6XW3CMU4.js.map +0 -1
  71. package/dist/chunk-7DDMF3DZ.cjs.map +0 -1
  72. package/dist/chunk-AMTWY22T.js +0 -11
  73. package/dist/chunk-AMTWY22T.js.map +0 -1
  74. package/dist/chunk-O4EQYPLO.cjs.map +0 -1
  75. package/dist/chunk-PZRTRYPD.js.map +0 -1
  76. package/dist/chunk-SKVVOEMX.js.map +0 -1
  77. package/dist/chunk-SLRVI2YU.js.map +0 -1
  78. package/dist/chunk-SQ5F5BFW.cjs.map +0 -1
  79. package/dist/chunk-TTJGCJWX.cjs.map +0 -1
  80. package/dist/chunk-XL55UDLO.js.map +0 -1
  81. package/dist/chunk-ZU2B2RZK.cjs +0 -13
  82. package/dist/chunk-ZU2B2RZK.cjs.map +0 -1
  83. package/dist/chunk-ZX663X3X.cjs.map +0 -1
@@ -1,142 +1,15 @@
1
1
  "use client";
2
- import { getFontPairing, matchFontPairing, FONT_PAIRINGS } from './chunk-NHZK64TQ.js';
2
+ import { applyThemeVars } from './chunk-5ZBXFHZW.js';
3
+ import { getFontPairing } from './chunk-NHZK64TQ.js';
3
4
  import { initials } from './chunk-5VYJP6XD.js';
4
5
  import { create } from 'zustand';
5
6
  import { persist } from 'zustand/middleware';
6
- import { createContext, useState, useEffect, useContext } from 'react';
7
- import { RotateCcw, ChevronDown, Palette, ImageIcon, ArrowRight, Quote, X, Menu, Check, ArrowUpRight, Save } from 'lucide-react';
8
- import { Input, Card, CardHeader, CardTitle, CardContent, cn, Button, Avatar, AvatarImage, AvatarFallback, AiMarkdown } from '@arbidocs/react/ui';
7
+ import { cn, Button, Card, Avatar, AvatarImage, AvatarFallback, AiMarkdown } from '@arbidocs/react/ui';
9
8
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
9
+ import { createContext, useContext, useState } from 'react';
10
+ import { ImageIcon, ArrowRight, Quote, ChevronDown, X, Menu, Check, ArrowUpRight } from 'lucide-react';
10
11
  import * as TabsPrimitive from '@radix-ui/react-tabs';
11
12
 
12
- // src/theme/tokens.ts
13
- var THEME_STYLE_ID = "arbi-theme-vars";
14
- var TRIPLET_RE = /^-?\d+(?:\.\d+)?\s+-?\d+(?:\.\d+)?%\s+-?\d+(?:\.\d+)?%$/;
15
- function parseRgb(color) {
16
- if (color.startsWith("#")) {
17
- let hex = color.slice(1);
18
- if (hex.length === 3) {
19
- hex = hex.split("").map((ch) => ch + ch).join("");
20
- }
21
- if (hex.length === 6 && /^[0-9a-fA-F]{6}$/.test(hex)) {
22
- return {
23
- r: parseInt(hex.slice(0, 2), 16),
24
- g: parseInt(hex.slice(2, 4), 16),
25
- b: parseInt(hex.slice(4, 6), 16)
26
- };
27
- }
28
- return null;
29
- }
30
- const m = color.match(/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/i);
31
- if (m) return { r: Number(m[1]), g: Number(m[2]), b: Number(m[3]) };
32
- return null;
33
- }
34
- function rgbToHslTriplet(r, g, b) {
35
- const rn = r / 255;
36
- const gn = g / 255;
37
- const bn = b / 255;
38
- const max = Math.max(rn, gn, bn);
39
- const min = Math.min(rn, gn, bn);
40
- const l = (max + min) / 2;
41
- const d = max - min;
42
- let h = 0;
43
- let s = 0;
44
- if (d !== 0) {
45
- s = d / (1 - Math.abs(2 * l - 1));
46
- switch (max) {
47
- case rn:
48
- h = 60 * ((gn - bn) / d % 6);
49
- break;
50
- case gn:
51
- h = 60 * ((bn - rn) / d + 2);
52
- break;
53
- default:
54
- h = 60 * ((rn - gn) / d + 4);
55
- break;
56
- }
57
- }
58
- if (h < 0) h += 360;
59
- return `${Math.round(h)} ${Math.round(s * 100)}% ${Math.round(l * 100)}%`;
60
- }
61
- function toHslTriplet(color) {
62
- const c = color.trim();
63
- if (TRIPLET_RE.test(c)) return c;
64
- const rgb = parseRgb(c);
65
- if (!rgb) return c;
66
- return rgbToHslTriplet(rgb.r, rgb.g, rgb.b);
67
- }
68
- function renderTripletBlock(colors) {
69
- return Object.entries(colors).map(([key, value]) => ` --${key}: ${toHslTriplet(value)};`).join("\n");
70
- }
71
- function emitCssVars(theme, dark) {
72
- if (typeof document === "undefined") return;
73
- const meta = [
74
- ` --font-display: ${theme.fonts.display};`,
75
- ` --font-sans: ${theme.fonts.sans};`,
76
- ` --radius: ${theme.radius}rem;`
77
- ].join("\n");
78
- let css = `:root {
79
- ${renderTripletBlock(theme.colors)}
80
- ${meta}
81
- }`;
82
- if (dark) {
83
- css += `
84
- :root.dark {
85
- ${renderTripletBlock(dark)}
86
- }`;
87
- }
88
- let style = document.getElementById(THEME_STYLE_ID);
89
- if (!style) {
90
- style = document.createElement("style");
91
- style.id = THEME_STYLE_ID;
92
- document.head.appendChild(style);
93
- }
94
- style.textContent = css;
95
- }
96
- function removeCssVars() {
97
- if (typeof document === "undefined") return;
98
- document.getElementById(THEME_STYLE_ID)?.remove();
99
- }
100
- function normalizeOptions(optionsOrRoot) {
101
- if (typeof HTMLElement !== "undefined" && optionsOrRoot instanceof HTMLElement) {
102
- return { root: optionsOrRoot };
103
- }
104
- return optionsOrRoot;
105
- }
106
- function applyThemeVars(theme, optionsOrRoot = {}) {
107
- const { mode = "flat", dark, root = document.documentElement } = normalizeOptions(optionsOrRoot);
108
- if (mode === "cssVars") {
109
- emitCssVars(theme, dark);
110
- return;
111
- }
112
- for (const [key, value] of Object.entries(theme.colors)) {
113
- root.style.setProperty(`--color-${key}`, value);
114
- }
115
- root.style.setProperty("--font-display", theme.fonts.display);
116
- root.style.setProperty("--font-sans", theme.fonts.sans);
117
- root.style.setProperty("--radius", `${theme.radius}rem`);
118
- }
119
- function applyFontVars(fonts, root = document.documentElement) {
120
- root.style.setProperty("--font-display", fonts.display);
121
- root.style.setProperty("--font-sans", fonts.sans);
122
- }
123
- function clearFontVars(root = document.documentElement) {
124
- root.style.removeProperty("--font-display");
125
- root.style.removeProperty("--font-sans");
126
- }
127
- function clearThemeVars(theme, optionsOrRoot = {}) {
128
- const { mode = "flat", root = document.documentElement } = normalizeOptions(optionsOrRoot);
129
- if (mode === "cssVars") {
130
- removeCssVars();
131
- return;
132
- }
133
- for (const key of Object.keys(theme.colors)) {
134
- root.style.removeProperty(`--color-${key}`);
135
- }
136
- root.style.removeProperty("--font-display");
137
- root.style.removeProperty("--font-sans");
138
- root.style.removeProperty("--radius");
139
- }
140
13
  function createThemeStore(config) {
141
14
  const { defaultTheme, presets, storageKey } = config;
142
15
  const useStore = create()(
@@ -184,294 +57,6 @@ function applyStoredTheme(bundle) {
184
57
  const { colors, fonts, radius } = bundle.useStore.getState();
185
58
  applyThemeVars({ colors, fonts, radius }, { mode: bundle.mode, dark: bundle.darkColors });
186
59
  }
187
- function ThemeEditor({
188
- bundle,
189
- variant = "panel",
190
- preview,
191
- onSave,
192
- testIdPrefix = "theme",
193
- defaultOpen = false
194
- }) {
195
- const { useStore, tokens, presets, groupLabels, mode, darkColors } = bundle;
196
- const colors = useStore((s) => s.colors);
197
- const fonts = useStore((s) => s.fonts);
198
- const radius = useStore((s) => s.radius);
199
- const activePresetId = useStore((s) => s.activePresetId);
200
- const setColor = useStore((s) => s.setColor);
201
- const setFont = useStore((s) => s.setFont);
202
- const setFontPairing = useStore((s) => s.setFontPairing);
203
- const setRadius = useStore((s) => s.setRadius);
204
- const applyPreset = useStore((s) => s.applyPreset);
205
- const reset = useStore((s) => s.reset);
206
- const [open, setOpen] = useState(defaultOpen);
207
- const [saving, setSaving] = useState(false);
208
- const [savedVia, setSavedVia] = useState(null);
209
- useEffect(() => {
210
- applyThemeVars({ colors, fonts, radius }, { mode, dark: darkColors });
211
- }, [colors, fonts, radius, mode, darkColors]);
212
- const tid = (suffix) => `${testIdPrefix}-${suffix}`;
213
- const groups = [...new Set(tokens.map((t) => t.group))];
214
- const save = async () => {
215
- if (!onSave) return;
216
- setSaving(true);
217
- try {
218
- const via = await onSave();
219
- setSavedVia(typeof via === "string" ? via : "saved");
220
- } catch {
221
- setSavedVia(null);
222
- } finally {
223
- setSaving(false);
224
- }
225
- };
226
- const Presets = /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
227
- presets.map((p) => /* @__PURE__ */ jsx(
228
- "button",
229
- {
230
- type: "button",
231
- onClick: () => applyPreset(p.id),
232
- className: `rounded-full border px-3 py-1 text-xs font-medium transition-colors ${activePresetId === p.id ? "border-primary bg-primary text-primary-foreground" : "border-border text-foreground hover:border-primary"}`,
233
- "data-testid": tid(`preset-${p.id}`),
234
- children: p.label
235
- },
236
- p.id
237
- )),
238
- /* @__PURE__ */ jsxs(
239
- "button",
240
- {
241
- type: "button",
242
- onClick: reset,
243
- className: "ml-auto inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground",
244
- "data-testid": tid("reset"),
245
- children: [
246
- /* @__PURE__ */ jsx(RotateCcw, { className: "size-3" }),
247
- " Reset"
248
- ]
249
- }
250
- )
251
- ] });
252
- const colorRow = (k, label) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
253
- /* @__PURE__ */ jsx(
254
- "input",
255
- {
256
- type: "color",
257
- value: colors[k] ?? "#000000",
258
- onChange: (e) => setColor(k, e.target.value),
259
- className: "size-9 shrink-0 cursor-pointer rounded-md border border-border bg-transparent",
260
- "aria-label": label,
261
- "data-testid": tid(`color-${k}`)
262
- }
263
- ),
264
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
265
- /* @__PURE__ */ jsx("span", { className: "block text-xs text-muted-foreground", children: label }),
266
- /* @__PURE__ */ jsx(
267
- Input,
268
- {
269
- value: colors[k] ?? "",
270
- onChange: (e) => setColor(k, e.target.value),
271
- "aria-label": `${label} hex value`,
272
- className: "bg-card placeholder:text-muted-foreground focus-visible:border-ring/60 focus-visible:ring-2 focus-visible:ring-ring h-7 font-mono text-xs",
273
- "data-testid": tid(`hex-${k}`)
274
- }
275
- )
276
- ] })
277
- ] }, k);
278
- const activePairing = matchFontPairing(fonts);
279
- const Typography = /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
280
- /* @__PURE__ */ jsxs("div", { children: [
281
- /* @__PURE__ */ jsx("span", { className: "block text-xs text-muted-foreground", children: "Typeface" }),
282
- /* @__PURE__ */ jsxs(
283
- "select",
284
- {
285
- value: activePairing?.id ?? "",
286
- onChange: (e) => setFontPairing(e.target.value),
287
- "aria-label": "Typeface",
288
- className: "mt-1 h-8 w-full rounded-md border border-border bg-card px-2 text-xs text-foreground focus-visible:border-ring/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
289
- "data-testid": tid("font-pairing"),
290
- children: [
291
- !activePairing && /* @__PURE__ */ jsx("option", { value: "", children: "Custom" }),
292
- FONT_PAIRINGS.map((pairing) => /* @__PURE__ */ jsx("option", { value: pairing.id, children: pairing.label }, pairing.id))
293
- ]
294
- }
295
- ),
296
- /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: activePairing?.description ?? "Hand-edited font stacks." })
297
- ] }),
298
- /* @__PURE__ */ jsxs("div", { children: [
299
- /* @__PURE__ */ jsx("span", { className: "block text-xs text-muted-foreground", children: "Display font stack" }),
300
- /* @__PURE__ */ jsx(
301
- Input,
302
- {
303
- value: fonts.display,
304
- onChange: (e) => setFont("display", e.target.value),
305
- "aria-label": "Display font stack",
306
- className: "bg-card placeholder:text-muted-foreground focus-visible:border-ring/60 focus-visible:ring-2 focus-visible:ring-ring mt-1 font-mono text-xs",
307
- "data-testid": tid("font-display")
308
- }
309
- )
310
- ] }),
311
- /* @__PURE__ */ jsxs("div", { children: [
312
- /* @__PURE__ */ jsx("span", { className: "block text-xs text-muted-foreground", children: "Body font stack" }),
313
- /* @__PURE__ */ jsx(
314
- Input,
315
- {
316
- value: fonts.sans,
317
- onChange: (e) => setFont("sans", e.target.value),
318
- "aria-label": "Body font stack",
319
- className: "bg-card placeholder:text-muted-foreground focus-visible:border-ring/60 focus-visible:ring-2 focus-visible:ring-ring mt-1 font-mono text-xs",
320
- "data-testid": tid("font-sans")
321
- }
322
- )
323
- ] }),
324
- /* @__PURE__ */ jsxs("div", { children: [
325
- /* @__PURE__ */ jsxs("span", { className: "block text-xs text-muted-foreground", children: [
326
- "Base radius \u2014 ",
327
- radius,
328
- "rem"
329
- ] }),
330
- /* @__PURE__ */ jsx(
331
- "input",
332
- {
333
- type: "range",
334
- min: 0,
335
- max: 1.5,
336
- step: 0.125,
337
- value: radius,
338
- onChange: (e) => setRadius(Number(e.target.value)),
339
- "aria-label": "Base radius",
340
- className: "mt-2 w-full accent-[color:var(--color-primary)]",
341
- "data-testid": tid("radius")
342
- }
343
- )
344
- ] })
345
- ] });
346
- const Preview = /* @__PURE__ */ jsxs(Card, { variant: "elevated", className: "rounded-lg", "data-testid": tid("preview"), children: [
347
- /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { className: "text-base", children: "Live preview" }) }),
348
- /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3", children: [
349
- /* @__PURE__ */ jsxs("div", { className: "rounded-[var(--radius)] bg-primary p-4 text-primary-foreground", children: [
350
- /* @__PURE__ */ jsx("p", { className: "font-display text-lg font-semibold", children: preview?.title ?? "Preview" }),
351
- preview?.subtitle && /* @__PURE__ */ jsx("p", { className: "text-xs opacity-80", children: preview.subtitle })
352
- ] }),
353
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-6 gap-1.5", children: tokens.map((t) => /* @__PURE__ */ jsx(
354
- "div",
355
- {
356
- title: t.label,
357
- className: "aspect-square rounded-md border border-border",
358
- style: { background: `var(--color-${t.key})` }
359
- },
360
- t.key
361
- )) }),
362
- /* @__PURE__ */ jsxs("div", { className: "rounded-[var(--radius)] border border-border bg-[color:var(--color-ai-accent-soft,var(--color-accent))] p-3", children: [
363
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[color:var(--color-ai-accent,var(--color-primary))]", children: "AI action surface" }),
364
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Themed by the AI-kit accent tokens." })
365
- ] })
366
- ] })
367
- ] });
368
- const SaveBar = onSave && /* @__PURE__ */ jsxs("div", { className: "mt-6 flex items-center gap-3", children: [
369
- /* @__PURE__ */ jsxs(
370
- "button",
371
- {
372
- type: "button",
373
- onClick: () => void save(),
374
- disabled: saving,
375
- className: "inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-2 text-sm font-medium text-primary-foreground hover:opacity-90 disabled:opacity-60",
376
- "data-testid": tid("save"),
377
- children: [
378
- savedVia ? /* @__PURE__ */ jsx(Check, { className: "size-4" }) : /* @__PURE__ */ jsx(Save, { className: "size-4" }),
379
- saving ? "Saving\u2026" : savedVia ? "Saved" : "Save theme"
380
- ]
381
- }
382
- ),
383
- savedVia && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", "data-testid": tid("via"), children: [
384
- "stored via ",
385
- savedVia
386
- ] })
387
- ] });
388
- if (variant === "collapsed") {
389
- const controlsId = `${testIdPrefix}-controls`;
390
- return /* @__PURE__ */ jsxs("div", { className: "space-y-3", "data-testid": testIdPrefix, children: [
391
- Presets,
392
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-8 gap-1.5 @xl:grid-cols-12", "aria-hidden": "true", children: tokens.slice(0, 12).map((t) => /* @__PURE__ */ jsx(
393
- "div",
394
- {
395
- title: t.label,
396
- className: "aspect-square rounded-md border border-border",
397
- style: { background: `var(--color-${t.key})` }
398
- },
399
- t.key
400
- )) }),
401
- /* @__PURE__ */ jsxs(
402
- "button",
403
- {
404
- type: "button",
405
- onClick: () => setOpen((o) => !o),
406
- "aria-expanded": open,
407
- "aria-controls": controlsId,
408
- className: "inline-flex items-center gap-1.5 text-sm font-medium text-foreground hover:text-primary",
409
- "data-testid": tid("customize"),
410
- children: [
411
- /* @__PURE__ */ jsx(ChevronDown, { className: `size-4 transition-transform ${open ? "rotate-180" : ""}` }),
412
- "Customize colours and type"
413
- ]
414
- }
415
- ),
416
- open && /* @__PURE__ */ jsxs(
417
- "div",
418
- {
419
- id: controlsId,
420
- className: "max-h-[28rem] overflow-y-auto rounded-md border border-border bg-card p-4",
421
- "data-testid": tid("controls"),
422
- children: [
423
- /* @__PURE__ */ jsx("p", { className: "mb-2 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground", children: "Colours" }),
424
- /* @__PURE__ */ jsx("div", { className: "grid gap-3 @xl:grid-cols-2", children: tokens.map((t) => colorRow(t.key, t.label)) }),
425
- /* @__PURE__ */ jsx("p", { className: "mt-6 mb-2 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground", children: "Typography & shape" }),
426
- Typography
427
- ]
428
- }
429
- ),
430
- SaveBar
431
- ] });
432
- }
433
- if (variant === "drawer") {
434
- return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col overflow-y-auto bg-card p-5", "data-testid": testIdPrefix, children: [
435
- /* @__PURE__ */ jsx("div", { className: "mb-4 flex items-center justify-between", children: /* @__PURE__ */ jsx("h2", { className: "font-display text-lg font-semibold text-foreground", children: "Theme" }) }),
436
- Presets,
437
- /* @__PURE__ */ jsx("p", { className: "mt-5 mb-2 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground", children: "Colours" }),
438
- /* @__PURE__ */ jsx("div", { className: "space-y-3", children: tokens.map((t) => colorRow(t.key, t.label)) }),
439
- /* @__PURE__ */ jsx("p", { className: "mt-6 mb-2 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground", children: "Typography & shape" }),
440
- Typography,
441
- SaveBar
442
- ] });
443
- }
444
- return /* @__PURE__ */ jsxs("div", { className: "grid gap-6 lg:grid-cols-[1fr_320px]", "data-testid": testIdPrefix, children: [
445
- /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
446
- /* @__PURE__ */ jsxs(Card, { variant: "elevated", className: "rounded-lg", children: [
447
- /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, { className: "flex items-center gap-2 text-base", children: [
448
- /* @__PURE__ */ jsx(Palette, { className: "size-4 text-[color:var(--color-primary)]" }),
449
- " Presets"
450
- ] }) }),
451
- /* @__PURE__ */ jsx(CardContent, { children: Presets })
452
- ] }),
453
- groups.map((group) => /* @__PURE__ */ jsxs(
454
- Card,
455
- {
456
- variant: "elevated",
457
- className: "rounded-lg",
458
- "data-testid": tid(`group-${group}`),
459
- children: [
460
- /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { className: "text-base", children: groupLabels[group] ?? group }) }),
461
- /* @__PURE__ */ jsx(CardContent, { className: "grid gap-3 @xl:grid-cols-2", children: tokens.filter((t) => t.group === group).map((t) => colorRow(t.key, t.label)) })
462
- ]
463
- },
464
- group
465
- )),
466
- /* @__PURE__ */ jsxs(Card, { variant: "elevated", className: "rounded-lg", children: [
467
- /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { className: "text-base", children: "Typography & shape" }) }),
468
- /* @__PURE__ */ jsx(CardContent, { children: Typography })
469
- ] }),
470
- SaveBar
471
- ] }),
472
- /* @__PURE__ */ jsx("div", { className: "lg:sticky lg:top-4 lg:self-start", children: Preview })
473
- ] });
474
- }
475
60
  function SectionHeading({
476
61
  eyebrow,
477
62
  title,
@@ -1605,6 +1190,6 @@ function TestimonialGrid({ items, columns = "3", testId }) {
1605
1190
  )) });
1606
1191
  }
1607
1192
 
1608
- export { ASSET_REF_PREFIX, Accordion, AssetResolverProvider, AvatarBlock, Banner, BlockImage, BlockLink, CTABanner, Columns, ContactForm, Container, EditorialProfileCard, EditorialToneContext, FAQ, FeatureGrid, Footer, Gallery, Hero, ListBlock, LogoCloud, MediaText, Navbar, PricingTable, RichTextBlock, SectionHeading, Spacer, Steps, THEME_STYLE_ID, Tabs, TeamGrid, Testimonial, TestimonialGrid, ThemeEditor, VideoEmbed, applyFontVars, applyStoredTheme, applyThemeVars, asAssetRef, assetRefId, clearFontVars, clearThemeVars, createThemeStore, formatIndex, isAssetRef, toEmbedUrl, toHslTriplet, useAssetRenderer, useAssetResolverActive, useEditorialTone };
1609
- //# sourceMappingURL=chunk-SKVVOEMX.js.map
1610
- //# sourceMappingURL=chunk-SKVVOEMX.js.map
1193
+ export { ASSET_REF_PREFIX, Accordion, AssetResolverProvider, AvatarBlock, Banner, BlockImage, BlockLink, CTABanner, Columns, ContactForm, Container, EditorialProfileCard, EditorialToneContext, FAQ, FeatureGrid, Footer, Gallery, Hero, ListBlock, LogoCloud, MediaText, Navbar, PricingTable, RichTextBlock, SectionHeading, Spacer, Steps, Tabs, TeamGrid, Testimonial, TestimonialGrid, VideoEmbed, applyStoredTheme, asAssetRef, assetRefId, createThemeStore, formatIndex, isAssetRef, toEmbedUrl, useAssetRenderer, useAssetResolverActive, useEditorialTone };
1194
+ //# sourceMappingURL=chunk-XXUPUXBF.js.map
1195
+ //# sourceMappingURL=chunk-XXUPUXBF.js.map