@ramme-io/ui 4.0.1 → 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.
- package/README.md +158 -7
- package/dist/blocks/ai/Actions.js +2 -2
- package/dist/blocks/ai/PromptInput.js +6 -6
- package/dist/component-registry.js +386 -359
- package/dist/components/ai/AIChatThread/AIChatThread.js +81 -73
- package/dist/components/ai/ArchitectureReferenceCard/ArchitectureReferenceCard.d.ts +28 -0
- package/dist/components/ai/ArchitectureReferenceCard/ArchitectureReferenceCard.js +70 -0
- package/dist/components/ai/ArchitectureReferenceCard/index.d.ts +2 -0
- package/dist/components/ai/CounterpartyGraphCard/CounterpartyGraphCard.d.ts +30 -0
- package/dist/components/ai/CounterpartyGraphCard/CounterpartyGraphCard.js +82 -0
- package/dist/components/ai/CounterpartyGraphCard/index.d.ts +2 -0
- package/dist/components/ai/DivergenceMetricsCard/DivergenceMetricsCard.d.ts +29 -0
- package/dist/components/ai/DivergenceMetricsCard/DivergenceMetricsCard.js +69 -0
- package/dist/components/ai/DivergenceMetricsCard/index.d.ts +2 -0
- package/dist/components/ai/KeyInjectionOverlay.d.ts +10 -0
- package/dist/components/ai/KeyInjectionOverlay.js +11 -11
- package/dist/components/auth/AuthLayout.js +4 -4
- package/dist/components/data-display/CodeBlock.d.ts +33 -7
- package/dist/components/data-display/CodeBlock.js +134 -41
- package/dist/components/data-display/Table.js +8 -8
- package/dist/components/feedback/EmptyState.js +9 -9
- package/dist/components/feedback/ToastProvider.js +4 -4
- package/dist/components/forms/Checkbox.js +5 -5
- package/dist/components/forms/Radio.js +6 -6
- package/dist/components/forms/SegmentedControl.d.ts +1 -1
- package/dist/components/forms/SegmentedControl.js +28 -11
- package/dist/components/forms/Textarea.js +9 -9
- package/dist/components/forms/ToggleSwitch.js +9 -9
- package/dist/components/layout/AboutRamme.d.ts +8 -0
- package/dist/components/layout/Accordion.js +13 -13
- package/dist/components/layout/AppShell.js +7 -7
- package/dist/components/layout/DetailDrawer.js +2 -2
- package/dist/components/layout/Drawer.js +50 -51
- package/dist/components/layout/List.js +9 -9
- package/dist/components/layout/Modal.js +5 -5
- package/dist/components/layout/PageHeader.js +7 -7
- package/dist/components/layout/SectionHeader.js +4 -4
- package/dist/components/layout/SettingsContainer.d.ts +12 -0
- package/dist/components/layout/SettingsContainer.js +20 -18
- package/dist/components/layout/Sidebar.js +1 -1
- package/dist/components/layout/UserNav.d.ts +13 -0
- package/dist/components/layout/UserNav.js +17 -17
- package/dist/components/molecular/ConnectorOverlay.d.ts +12 -0
- package/dist/components/navigation/Breadcrumbs.js +8 -8
- package/dist/components/navigation/Menu.js +6 -6
- package/dist/components/navigation/MobileNav.js +1 -1
- package/dist/components/navigation/Pagination.js +46 -41
- package/dist/components/navigation/Stepper.js +17 -17
- package/dist/components/navigation/Tabs.js +12 -12
- package/dist/components/theme/ThemeLab.d.ts +7 -1
- package/dist/components/theme/ThemeLab.js +175 -154
- package/dist/contexts/ThemeContext.js +111 -82
- package/dist/data/mockData.d.ts +0 -3
- package/dist/index.css +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +203 -185
- package/dist/lib/hooks/useBodyScrollLock.d.ts +27 -0
- package/dist/lib/hooks/useBodyScrollLock.js +18 -0
- package/dist/lib/theme/themeUtils.d.ts +21 -0
- package/dist/lib/theme/themeUtils.js +31 -17
- package/dist/wizardManifest.js +234 -9
- package/package.json +2 -3
- package/src/wizardManifest.ts +234 -9
- package/tailwind.preset.js +98 -10
|
@@ -1,50 +1,60 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
const
|
|
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
|
-
],
|
|
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:
|
|
14
|
+
mono: `"Menlo", ${m}`
|
|
15
15
|
},
|
|
16
16
|
dark: {
|
|
17
17
|
sans: '"Inter", system-ui, sans-serif',
|
|
18
18
|
serif: "Georgia, serif",
|
|
19
|
-
mono:
|
|
19
|
+
mono: `"Menlo", ${m}`
|
|
20
20
|
},
|
|
21
21
|
system: {
|
|
22
22
|
sans: '"Inter", system-ui, sans-serif',
|
|
23
23
|
serif: "Georgia, serif",
|
|
24
|
-
mono:
|
|
24
|
+
mono: `"Menlo", ${m}`
|
|
25
25
|
},
|
|
26
26
|
corporate: {
|
|
27
27
|
sans: '"Lato", sans-serif',
|
|
28
28
|
serif: '"Merriweather", serif',
|
|
29
|
-
mono:
|
|
29
|
+
mono: `"Menlo", ${m}`
|
|
30
30
|
},
|
|
31
31
|
midnight: {
|
|
32
32
|
sans: '"Roboto Mono", monospace',
|
|
33
33
|
serif: "Georgia, serif",
|
|
34
|
-
mono:
|
|
34
|
+
mono: `"Roboto Mono", ${m}`
|
|
35
35
|
},
|
|
36
36
|
blueprint: {
|
|
37
37
|
sans: '"Courier New", monospace',
|
|
38
38
|
serif: "Georgia, serif",
|
|
39
|
-
mono:
|
|
39
|
+
mono: `"Courier New", ${m}`
|
|
40
40
|
}
|
|
41
|
-
},
|
|
41
|
+
}, oe = 550, re = 100, V = {
|
|
42
42
|
name: "TAY Dreamboat",
|
|
43
43
|
borderRadius: "0.5rem",
|
|
44
44
|
fonts: {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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 =
|
|
88
|
-
[
|
|
89
|
-
},
|
|
90
|
-
children:
|
|
91
|
-
defaultTheme:
|
|
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
|
|
97
|
-
const 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 ?
|
|
110
|
+
return d && !o ? l || "system" : o && L.includes(o) ? o : l || "system";
|
|
101
111
|
}
|
|
102
|
-
return
|
|
103
|
-
}), [
|
|
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 &&
|
|
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
|
-
|
|
127
|
+
M(() => {
|
|
118
128
|
if (typeof window < "u") {
|
|
119
129
|
const o = window.matchMedia("(prefers-color-scheme: dark)");
|
|
120
|
-
|
|
121
|
-
const e = (
|
|
122
|
-
|
|
130
|
+
_(o.matches ? "dark" : "light");
|
|
131
|
+
const e = (g) => {
|
|
132
|
+
_(g.matches ? "dark" : "light");
|
|
123
133
|
};
|
|
124
134
|
o.addEventListener("change", e);
|
|
125
|
-
const
|
|
126
|
-
return
|
|
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
|
|
130
|
-
localStorage.removeItem(`${t}:mode`), localStorage.removeItem(`${t}:custom`), localStorage.removeItem(`${t}:borderRadius`), localStorage.removeItem(`${t}:fontSize`),
|
|
131
|
-
}, [
|
|
132
|
-
|
|
133
|
-
}, [t]), Y =
|
|
134
|
-
|
|
135
|
-
}, [t]), D =
|
|
136
|
-
|
|
137
|
-
}, [t]),
|
|
138
|
-
|
|
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
|
-
|
|
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
|
-
|
|
143
|
-
const e = (
|
|
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
|
-
],
|
|
161
|
-
const n =
|
|
162
|
-
if (
|
|
163
|
-
const r =
|
|
164
|
-
if (
|
|
165
|
-
|
|
166
|
-
|
|
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
|
-
],
|
|
198
|
-
if (
|
|
220
|
+
], v = f === "system" ? x : f;
|
|
221
|
+
if (a) {
|
|
199
222
|
o.classList.add("custom-theme");
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
const 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",
|
|
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),
|
|
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(
|
|
210
|
-
const
|
|
211
|
-
F ||
|
|
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",
|
|
214
|
-
|
|
215
|
-
|
|
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:
|
|
218
|
-
availableThemes:
|
|
219
|
-
setTheme:
|
|
220
|
-
resetTheme:
|
|
221
|
-
borderRadius:
|
|
246
|
+
theme: f,
|
|
247
|
+
availableThemes: L,
|
|
248
|
+
setTheme: N,
|
|
249
|
+
resetTheme: B,
|
|
250
|
+
borderRadius: p,
|
|
222
251
|
setBorderRadius: D,
|
|
223
|
-
fontSize:
|
|
224
|
-
setFontSize:
|
|
225
|
-
customTheme:
|
|
252
|
+
fontSize: A,
|
|
253
|
+
setFontSize: P,
|
|
254
|
+
customTheme: a,
|
|
226
255
|
setCustomTheme: Y
|
|
227
256
|
}),
|
|
228
|
-
[
|
|
257
|
+
[f, N, B, p, D, A, P, a, Y]
|
|
229
258
|
);
|
|
230
|
-
return /* @__PURE__ */
|
|
231
|
-
},
|
|
232
|
-
const
|
|
233
|
-
if (
|
|
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
|
|
264
|
+
return S;
|
|
236
265
|
};
|
|
237
266
|
export {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
267
|
+
V as TAY_DREAMBOAT_THEME,
|
|
268
|
+
se as ThemeProvider,
|
|
269
|
+
L as availableThemes,
|
|
270
|
+
ne as useTheme
|
|
242
271
|
};
|