@ramme-io/ui 4.0.0 → 4.1.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 (65) hide show
  1. package/README.md +158 -7
  2. package/dist/blocks/ai/Actions.js +2 -2
  3. package/dist/blocks/ai/PromptInput.js +6 -6
  4. package/dist/component-registry.js +386 -359
  5. package/dist/components/ai/AIChatThread/AIChatThread.js +81 -73
  6. package/dist/components/ai/ArchitectureReferenceCard/ArchitectureReferenceCard.d.ts +28 -0
  7. package/dist/components/ai/ArchitectureReferenceCard/ArchitectureReferenceCard.js +70 -0
  8. package/dist/components/ai/ArchitectureReferenceCard/index.d.ts +2 -0
  9. package/dist/components/ai/CounterpartyGraphCard/CounterpartyGraphCard.d.ts +30 -0
  10. package/dist/components/ai/CounterpartyGraphCard/CounterpartyGraphCard.js +82 -0
  11. package/dist/components/ai/CounterpartyGraphCard/index.d.ts +2 -0
  12. package/dist/components/ai/DivergenceMetricsCard/DivergenceMetricsCard.d.ts +29 -0
  13. package/dist/components/ai/DivergenceMetricsCard/DivergenceMetricsCard.js +69 -0
  14. package/dist/components/ai/DivergenceMetricsCard/index.d.ts +2 -0
  15. package/dist/components/ai/KeyInjectionOverlay.d.ts +10 -0
  16. package/dist/components/ai/KeyInjectionOverlay.js +11 -11
  17. package/dist/components/auth/AuthLayout.js +4 -4
  18. package/dist/components/data-display/CodeBlock.d.ts +33 -7
  19. package/dist/components/data-display/CodeBlock.js +134 -41
  20. package/dist/components/data-display/Table.js +8 -8
  21. package/dist/components/feedback/EmptyState.js +9 -9
  22. package/dist/components/feedback/ToastProvider.js +4 -4
  23. package/dist/components/forms/Checkbox.js +5 -5
  24. package/dist/components/forms/Radio.js +6 -6
  25. package/dist/components/forms/SegmentedControl.d.ts +1 -1
  26. package/dist/components/forms/SegmentedControl.js +28 -11
  27. package/dist/components/forms/Textarea.js +9 -9
  28. package/dist/components/forms/ToggleSwitch.js +9 -9
  29. package/dist/components/layout/AboutRamme.d.ts +8 -0
  30. package/dist/components/layout/Accordion.js +13 -13
  31. package/dist/components/layout/AppShell.js +7 -7
  32. package/dist/components/layout/DetailDrawer.js +2 -2
  33. package/dist/components/layout/Drawer.js +50 -51
  34. package/dist/components/layout/List.js +9 -9
  35. package/dist/components/layout/Modal.js +5 -5
  36. package/dist/components/layout/PageHeader.js +7 -7
  37. package/dist/components/layout/SectionHeader.js +4 -4
  38. package/dist/components/layout/SettingsContainer.d.ts +12 -0
  39. package/dist/components/layout/SettingsContainer.js +20 -18
  40. package/dist/components/layout/Sidebar.js +1 -1
  41. package/dist/components/layout/UserNav.d.ts +13 -0
  42. package/dist/components/layout/UserNav.js +17 -17
  43. package/dist/components/molecular/ConnectorOverlay.d.ts +12 -0
  44. package/dist/components/navigation/Breadcrumbs.js +8 -8
  45. package/dist/components/navigation/Menu.js +6 -6
  46. package/dist/components/navigation/MobileNav.js +1 -1
  47. package/dist/components/navigation/Pagination.js +46 -41
  48. package/dist/components/navigation/Stepper.js +17 -17
  49. package/dist/components/navigation/Tabs.js +12 -12
  50. package/dist/components/theme/ThemeLab.d.ts +7 -1
  51. package/dist/components/theme/ThemeLab.js +175 -154
  52. package/dist/contexts/ThemeContext.js +111 -82
  53. package/dist/data/mockData.d.ts +0 -3
  54. package/dist/index.css +1 -1
  55. package/dist/index.d.ts +8 -0
  56. package/dist/index.js +203 -185
  57. package/dist/lib/hooks/useBodyScrollLock.d.ts +27 -0
  58. package/dist/lib/hooks/useBodyScrollLock.js +18 -0
  59. package/dist/lib/theme/themeUtils.d.ts +21 -0
  60. package/dist/lib/theme/themeUtils.js +31 -17
  61. package/dist/wizardManifest.js +234 -9
  62. package/package.json +14 -15
  63. package/src/wizardManifest.ts +234 -9
  64. package/tailwind.preset.js +98 -10
  65. package/src/index.css +0 -335
@@ -1,50 +1,60 @@
1
- import { jsx as Q } from "react/jsx-runtime";
2
- import { useState as f, useEffect as G, useCallback as b, useMemo as U, createContext as q, useContext as W } from "react";
3
- const x = [
1
+ import { jsx as W } from "react/jsx-runtime";
2
+ import { useState as y, useEffect as M, useCallback as h, useMemo as X, createContext as Z, useContext as ee } from "react";
3
+ const L = [
4
4
  "light",
5
5
  "dark",
6
6
  "system",
7
7
  "corporate",
8
8
  "midnight",
9
9
  "blueprint"
10
- ], O = {
10
+ ], m = 'ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace', K = {
11
11
  light: {
12
12
  sans: '"Inter", system-ui, sans-serif',
13
13
  serif: "Georgia, serif",
14
- mono: '"Menlo", monospace'
14
+ mono: `"Menlo", ${m}`
15
15
  },
16
16
  dark: {
17
17
  sans: '"Inter", system-ui, sans-serif',
18
18
  serif: "Georgia, serif",
19
- mono: '"Menlo", monospace'
19
+ mono: `"Menlo", ${m}`
20
20
  },
21
21
  system: {
22
22
  sans: '"Inter", system-ui, sans-serif',
23
23
  serif: "Georgia, serif",
24
- mono: '"Menlo", monospace'
24
+ mono: `"Menlo", ${m}`
25
25
  },
26
26
  corporate: {
27
27
  sans: '"Lato", sans-serif',
28
28
  serif: '"Merriweather", serif',
29
- mono: '"Menlo", monospace'
29
+ mono: `"Menlo", ${m}`
30
30
  },
31
31
  midnight: {
32
32
  sans: '"Roboto Mono", monospace',
33
33
  serif: "Georgia, serif",
34
- mono: '"Roboto Mono", monospace'
34
+ mono: `"Roboto Mono", ${m}`
35
35
  },
36
36
  blueprint: {
37
37
  sans: '"Courier New", monospace',
38
38
  serif: "Georgia, serif",
39
- mono: '"Courier New", monospace'
39
+ mono: `"Courier New", ${m}`
40
40
  }
41
- }, H = {
41
+ }, oe = 550, re = 100, V = {
42
42
  name: "TAY Dreamboat",
43
43
  borderRadius: "0.5rem",
44
44
  fonts: {
45
- sans: '"Inter", system-ui, sans-serif',
46
- serif: '"TAY Dreamboat", "Tay", sans-serif',
47
- mono: '"Menlo", monospace'
45
+ // Roboto, not Inter. products/ramme-marketing/index.html preconnects and
46
+ // loads Roboto, tailwind.config.cjs declared it, and both docs pages teach
47
+ // it as the body font — but `body { font-family: var(--app-font-sans) }`
48
+ // meant this line decided, and this line said Inter. The site therefore
49
+ // rendered in Inter while every other signal claimed Roboto.
50
+ // "Roboto Fallback" is the metric-matched face in @ramme-io/ui's index.css;
51
+ // it keeps the swap from reflowing the page.
52
+ sans: '"Roboto", "Roboto Fallback", system-ui, sans-serif',
53
+ // "Tay" used to sit in this stack. Its @font-face pointed at
54
+ // /fonts/Tay.woff2, which does not exist anywhere in the repo — a 404 in
55
+ // the fallback slot of the hero font.
56
+ serif: '"TAY Dreamboat", "TAY Dreamboat Fallback", serif',
57
+ mono: `"Menlo", ${m}`
48
58
  },
49
59
  lightColors: {
50
60
  background: "253 251 247",
@@ -84,29 +94,29 @@ const x = [
84
94
  danger: "239 68 68",
85
95
  dangerForeground: "255 255 255"
86
96
  }
87
- }, J = q(void 0), V = {
88
- [H.name]: H
89
- }, C = ({
90
- children: y,
91
- defaultTheme: i,
97
+ }, J = Z(void 0), q = {
98
+ [V.name]: V
99
+ }, se = ({
100
+ children: S,
101
+ defaultTheme: l,
92
102
  defaultCustomTheme: d,
93
103
  appId: E,
94
104
  instanceConfig: c
95
105
  }) => {
96
- var P, z, _;
97
- const F = (P = c == null ? void 0 : c.fonts) == null ? void 0 : P.sans, $ = (z = c == null ? void 0 : c.fonts) == null ? void 0 : z.serif, M = (_ = c == null ? void 0 : c.fonts) == null ? void 0 : _.mono, t = E ? `ramme:theme:${E}` : "ramme:theme:global", [u, h] = f(() => {
106
+ var O, z, G;
107
+ const F = (O = c == null ? void 0 : c.fonts) == null ? void 0 : O.sans, w = (z = c == null ? void 0 : c.fonts) == null ? void 0 : z.serif, R = (G = c == null ? void 0 : c.fonts) == null ? void 0 : G.mono, t = E ? `ramme:theme:${E}` : "ramme:theme:global", [f, T] = y(() => {
98
108
  if (typeof window < "u") {
99
109
  const o = localStorage.getItem(`${t}:mode`);
100
- return d && !o ? i || "system" : o && x.includes(o) ? o : i || "system";
110
+ return d && !o ? l || "system" : o && L.includes(o) ? o : l || "system";
101
111
  }
102
- return i || "system";
103
- }), [A, R] = f("light"), [m, k] = f("0.5rem"), [S, w] = f("1rem"), [s, g] = f(() => {
112
+ return l || "system";
113
+ }), [x, _] = y("light"), [p, I] = y("0.5rem"), [A, k] = y("1rem"), [a, b] = y(() => {
104
114
  if (typeof window < "u") {
105
115
  const o = localStorage.getItem(`${t}:custom`);
106
116
  if (o)
107
117
  try {
108
118
  const e = JSON.parse(o);
109
- return e != null && e.name && V[e.name] ? V[e.name] : e;
119
+ return e != null && e.name && q[e.name] ? q[e.name] : e;
110
120
  } catch {
111
121
  }
112
122
  if (d && !o)
@@ -114,33 +124,42 @@ const x = [
114
124
  }
115
125
  return d || null;
116
126
  });
117
- G(() => {
127
+ M(() => {
118
128
  if (typeof window < "u") {
119
129
  const o = window.matchMedia("(prefers-color-scheme: dark)");
120
- R(o.matches ? "dark" : "light");
121
- const e = (l) => {
122
- R(l.matches ? "dark" : "light");
130
+ _(o.matches ? "dark" : "light");
131
+ const e = (g) => {
132
+ _(g.matches ? "dark" : "light");
123
133
  };
124
134
  o.addEventListener("change", e);
125
- const v = localStorage.getItem(`${t}:borderRadius`), I = localStorage.getItem(`${t}:fontSize`);
126
- return v && k(v), I && w(I), () => o.removeEventListener("change", e);
135
+ const u = localStorage.getItem(`${t}:borderRadius`), $ = localStorage.getItem(`${t}:fontSize`);
136
+ return u && I(u), $ && k($), () => o.removeEventListener("change", e);
127
137
  }
128
138
  }, [d, t]);
129
- const L = b(() => {
130
- localStorage.removeItem(`${t}:mode`), localStorage.removeItem(`${t}:custom`), localStorage.removeItem(`${t}:borderRadius`), localStorage.removeItem(`${t}:fontSize`), k("0.5rem"), w("1rem"), d ? (h("system"), g(d)) : i ? (h(i), g(null)) : (h("system"), g(null));
131
- }, [i, d, t]), B = b((o) => {
132
- h(o), localStorage.setItem(`${t}:mode`, o), ["light", "dark", "system"].includes(o) || (g(null), localStorage.removeItem(`${t}:custom`));
133
- }, [t]), Y = b((o) => {
134
- g(o), o ? localStorage.setItem(`${t}:custom`, JSON.stringify(o)) : localStorage.removeItem(`${t}:custom`);
135
- }, [t]), D = b((o) => {
136
- k(o), localStorage.setItem(`${t}:borderRadius`, o);
137
- }, [t]), N = b((o) => {
138
- w(o), localStorage.setItem(`${t}:fontSize`, o);
139
+ const B = h(() => {
140
+ localStorage.removeItem(`${t}:mode`), localStorage.removeItem(`${t}:custom`), localStorage.removeItem(`${t}:borderRadius`), localStorage.removeItem(`${t}:fontSize`), I("0.5rem"), k("1rem"), d ? (T("system"), b(d)) : l ? (T(l), b(null)) : (T("system"), b(null));
141
+ }, [l, d, t]), N = h((o) => {
142
+ T(o), localStorage.setItem(`${t}:mode`, o), ["light", "dark", "system"].includes(o) || (b(null), localStorage.removeItem(`${t}:custom`));
143
+ }, [t]), Y = h((o) => {
144
+ b(o), o ? localStorage.setItem(`${t}:custom`, JSON.stringify(o)) : localStorage.removeItem(`${t}:custom`);
145
+ }, [t]), D = h((o) => {
146
+ I(o), localStorage.setItem(`${t}:borderRadius`, o);
147
+ }, [t]), P = h((o) => {
148
+ k(o), localStorage.setItem(`${t}:fontSize`, o);
139
149
  }, [t]);
140
- G(() => {
150
+ M(() => {
151
+ const o = document.documentElement;
152
+ let e;
153
+ const u = requestAnimationFrame(() => {
154
+ e = window.setTimeout(() => o.setAttribute("data-theme-ready", ""), re);
155
+ });
156
+ return () => {
157
+ cancelAnimationFrame(u), e !== void 0 && window.clearTimeout(e), o.removeAttribute("data-theme-ready");
158
+ };
159
+ }, []), M(() => {
141
160
  const o = document.documentElement;
142
- x.forEach((a) => o.classList.remove(a)), o.classList.remove("custom-theme");
143
- const e = (a, n) => o.style.setProperty(a, n), v = (a) => o.style.removeProperty(a), I = [
161
+ L.forEach((s) => o.classList.remove(s)), o.classList.remove("custom-theme");
162
+ const e = (s, n) => o.style.setProperty(s, n), u = (s) => o.style.removeProperty(s), $ = [
144
163
  "system-ui",
145
164
  "Inter",
146
165
  "Georgia",
@@ -157,13 +176,17 @@ const x = [
157
176
  "TAYDreamboat",
158
177
  "TAYBirdie",
159
178
  "TAYKula"
160
- ], l = (a) => {
161
- const n = a.split(",")[0].replace(/['"]*/g, "").trim();
162
- if (I.some((p) => n.toLowerCase().includes(p.toLowerCase()))) return;
163
- const r = `google-font-${n.replace(/\s+/g, "-")}`;
164
- if (!document.getElementById(r)) {
165
- const p = document.createElement("link");
166
- p.id = r, p.rel = "stylesheet", p.href = `https://fonts.googleapis.com/css2?family=${n.replace(/\s+/g, "+")}:wght@400;500;600;700&display=swap`, document.head.appendChild(p);
179
+ ], g = (s) => {
180
+ const n = s.split(",")[0].replace(/['"]*/g, "").trim();
181
+ if ($.some((i) => n.toLowerCase().includes(i.toLowerCase()))) return;
182
+ const r = n.replace(/\s+/g, "+").toLowerCase();
183
+ if (Array.from(
184
+ document.querySelectorAll('link[rel="stylesheet"]')
185
+ ).some((i) => i.href.toLowerCase().includes(`family=${r}`))) return;
186
+ const C = `google-font-${n.replace(/\s+/g, "-")}`;
187
+ if (!document.getElementById(C)) {
188
+ const i = document.createElement("link");
189
+ i.id = C, i.rel = "stylesheet", i.href = `https://fonts.googleapis.com/css2?family=${n.replace(/\s+/g, "+")}:wght@400;500;600;700&display=swap`, document.head.appendChild(i);
167
190
  }
168
191
  }, j = [
169
192
  "--app-primary-color",
@@ -194,49 +217,55 @@ const x = [
194
217
  "--app-border-radius-sm",
195
218
  "--app-border-radius-md",
196
219
  "--app-border-radius-lg"
197
- ], T = u === "system" ? A : u;
198
- if (s) {
220
+ ], v = f === "system" ? x : f;
221
+ if (a) {
199
222
  o.classList.add("custom-theme");
200
- const a = T === "dark" || T === "midnight";
201
- a && o.classList.add("dark");
202
- const n = s.colors, r = a ? s.darkColors || n : s.lightColors || n;
223
+ const s = v === "dark" || v === "midnight";
224
+ s && o.classList.add("dark");
225
+ const n = a.colors, r = s ? a.darkColors || n : a.lightColors || n;
203
226
  if (!r) {
204
- console.error("ThemeEngine: Invalid customTheme payload", s);
227
+ console.error("ThemeEngine: Invalid customTheme payload", a);
205
228
  return;
206
229
  }
207
- e("--app-primary-color", r.primary), e("--app-primary-foreground-color", r.primaryForeground), e("--app-secondary-color", r.secondary), e("--app-secondary-foreground-color", r.secondaryForeground), e("--app-accent-color", r.accent), e("--app-accent-foreground-color", r.accentForeground), e("--app-danger-color", r.danger), e("--app-danger-foreground-color", r.dangerForeground), e("--app-bg-color", r.background), e("--app-card-bg-color", r.card), e("--app-text-color", r.text), e("--app-border-color", r.border), e("--app-muted-bg", r.muted), e("--app-muted-text", r.mutedForeground), e("--app-input-bg-color", r.input), e("--app-input-border-color", r.inputBorder), e("--app-input-focus-ring-color", r.ring), e("--app-table-header-bg", r.muted), e("--app-table-header-text", r.text), e("--app-table-row-hover-bg", r.muted), e("--app-table-grid-line-color", r.border), s.fonts && (l(s.fonts.sans), s.fonts.serif && l(s.fonts.serif), e("--app-font-serif", s.fonts.serif), e("--app-font-sans", s.fonts.sans), e("--app-font-mono", s.fonts.mono)), document.body.style.backgroundColor = `rgb(${r.background})`, document.body.style.color = `rgb(${r.text})`, e("--app-border-radius-md", s.borderRadius), e("--app-border-radius-sm", `calc(${s.borderRadius} - 0.25rem)`), e("--app-border-radius-lg", `calc(${s.borderRadius} + 0.25rem)`);
230
+ e("--app-primary-color", r.primary), e("--app-primary-foreground-color", r.primaryForeground), e("--app-secondary-color", r.secondary), e("--app-secondary-foreground-color", r.secondaryForeground), e("--app-accent-color", r.accent), e("--app-accent-foreground-color", r.accentForeground), e("--app-danger-color", r.danger), e("--app-danger-foreground-color", r.dangerForeground), e("--app-bg-color", r.background), e("--app-card-bg-color", r.card), e("--app-text-color", r.text), e("--app-border-color", r.border), e("--app-muted-bg", r.muted), e("--app-muted-text", r.mutedForeground), e("--app-input-bg-color", r.input), e("--app-input-border-color", r.inputBorder), e("--app-input-focus-ring-color", r.ring), e("--app-table-header-bg", r.muted), e("--app-table-header-text", r.text), e("--app-table-row-hover-bg", r.muted), e("--app-table-grid-line-color", r.border), a.fonts && (g(a.fonts.sans), a.fonts.serif && g(a.fonts.serif), e("--app-font-serif", a.fonts.serif), e("--app-font-sans", a.fonts.sans), e("--app-font-mono", a.fonts.mono)), document.body.style.backgroundColor = `rgb(${r.background})`, document.body.style.color = `rgb(${r.text})`, e("--app-border-radius-md", a.borderRadius), e("--app-border-radius-sm", `calc(${a.borderRadius} - 0.25rem)`), e("--app-border-radius-lg", `calc(${a.borderRadius} + 0.25rem)`);
208
231
  } else {
209
- o.classList.add(T), j.forEach(v);
210
- const a = O[T] || O.light, n = F || a.sans, r = $ || a.serif, p = M || a.mono;
211
- F || l(n), $ || l(r), e("--app-font-sans", n), e("--app-font-serif", r), e("--app-font-mono", p), document.body.style.backgroundColor = "", document.body.style.color = "", e("--app-border-radius-md", m), e("--app-border-radius-sm", `calc(${m} - 0.25rem)`), e("--app-border-radius-lg", `calc(${m} + 0.25rem)`);
232
+ o.classList.add(v), j.forEach(u);
233
+ const s = K[v] || K.light, n = F || s.sans, r = w || s.serif, H = R || s.mono;
234
+ F || g(n), w || g(r), e("--app-font-sans", n), e("--app-font-serif", r), e("--app-font-mono", H), document.body.style.backgroundColor = "", document.body.style.color = "", e("--app-border-radius-md", p), e("--app-border-radius-sm", `calc(${p} - 0.25rem)`), e("--app-border-radius-lg", `calc(${p} + 0.25rem)`);
212
235
  }
213
- e("--app-font-size-base", S);
214
- }, [u, A, s, m, S, F, $, M]);
215
- const K = U(
236
+ if (e("--app-font-size-base", A), !o.hasAttribute("data-theme-ready")) return;
237
+ o.setAttribute("data-theme-morphing", "");
238
+ const Q = window.setTimeout(
239
+ () => o.removeAttribute("data-theme-morphing"),
240
+ oe
241
+ );
242
+ return () => window.clearTimeout(Q);
243
+ }, [f, x, a, p, A, F, w, R]);
244
+ const U = X(
216
245
  () => ({
217
- theme: u,
218
- availableThemes: x,
219
- setTheme: B,
220
- resetTheme: L,
221
- borderRadius: m,
246
+ theme: f,
247
+ availableThemes: L,
248
+ setTheme: N,
249
+ resetTheme: B,
250
+ borderRadius: p,
222
251
  setBorderRadius: D,
223
- fontSize: S,
224
- setFontSize: N,
225
- customTheme: s,
252
+ fontSize: A,
253
+ setFontSize: P,
254
+ customTheme: a,
226
255
  setCustomTheme: Y
227
256
  }),
228
- [u, B, L, m, D, S, N, s, Y]
257
+ [f, N, B, p, D, A, P, a, Y]
229
258
  );
230
- return /* @__PURE__ */ Q(J.Provider, { value: K, children: y });
231
- }, ee = () => {
232
- const y = W(J);
233
- if (y === void 0)
259
+ return /* @__PURE__ */ W(J.Provider, { value: U, children: S });
260
+ }, ne = () => {
261
+ const S = ee(J);
262
+ if (S === void 0)
234
263
  throw new Error("useTheme must be used within a ThemeProvider");
235
- return y;
264
+ return S;
236
265
  };
237
266
  export {
238
- H as TAY_DREAMBOAT_THEME,
239
- C as ThemeProvider,
240
- x as availableThemes,
241
- ee as useTheme
267
+ V as TAY_DREAMBOAT_THEME,
268
+ se as ThemeProvider,
269
+ L as availableThemes,
270
+ ne as useTheme
242
271
  };
@@ -5,9 +5,6 @@
5
5
  * @tags data, mock, example
6
6
  * @category data
7
7
  * @id mock-chart-data
8
- * @id mock-table-data
9
- * @id mock-table-data
10
- * @id mock-table-data
11
8
  */
12
9
  export declare const mockChartData: {
13
10
  name: string;