@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.
- 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 +14 -15
- package/src/wizardManifest.ts +234 -9
- package/tailwind.preset.js +98 -10
- package/src/index.css +0 -335
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as w, useEffect as j, useCallback as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { Card as
|
|
6
|
-
import { loadGoogleFont as x, applyThemeToDom as m, hexToRgbTriplet as
|
|
7
|
-
import { AestheticProfileGrid as
|
|
8
|
-
import { ThemeSynthesizer as
|
|
9
|
-
import { FineTuningControls as
|
|
10
|
-
import { PaletteSwatch as
|
|
11
|
-
import { paletteToRgbVars as g, generateRandom as
|
|
12
|
-
function
|
|
1
|
+
import { jsxs as s, jsx as e, Fragment as ue } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w, useEffect as j, useCallback as c } from "react";
|
|
3
|
+
import { Button as D } from "../ui/Button.js";
|
|
4
|
+
import { Icon as n } from "../ui/Icon.js";
|
|
5
|
+
import { Card as E } from "../layout/Card.js";
|
|
6
|
+
import { loadGoogleFont as x, applyThemeToDom as m, hexToRgbTriplet as fe, tokensToVars as W } from "../../lib/theme/themeUtils.js";
|
|
7
|
+
import { AestheticProfileGrid as be } from "./AestheticProfileGrid.js";
|
|
8
|
+
import { ThemeSynthesizer as he } from "./ThemeSynthesizer.js";
|
|
9
|
+
import { FineTuningControls as xe } from "./FineTuningControls.js";
|
|
10
|
+
import { PaletteSwatch as ge } from "./ThemeLivePreview.js";
|
|
11
|
+
import { paletteToRgbVars as g, generateRandom as ye, generateFromProfile as Ne, hslToCssString as i } from "../../lib/theme/ThemeGenerator.logic.js";
|
|
12
|
+
function _(p) {
|
|
13
13
|
const d = p.split(" ").map(Number);
|
|
14
14
|
return d.length !== 3 || d.some(isNaN) ? "#000000" : "#" + d.map((y) => y.toString(16).padStart(2, "0")).join("");
|
|
15
15
|
}
|
|
16
|
-
const
|
|
16
|
+
const ke = {
|
|
17
17
|
system: "light",
|
|
18
18
|
light: "dark",
|
|
19
19
|
dark: "system"
|
|
20
|
-
},
|
|
20
|
+
}, M = {
|
|
21
21
|
light: { icon: "sun", label: "Light" },
|
|
22
22
|
dark: { icon: "moon", label: "Dark" },
|
|
23
23
|
system: { icon: "monitor", label: "System" }
|
|
@@ -27,67 +27,68 @@ const Ne = {
|
|
|
27
27
|
{ key: "success", label: "Success", description: "Confirmation states and positive indicators" },
|
|
28
28
|
{ key: "warning", label: "Warning", description: "Caution states and alert indicators" },
|
|
29
29
|
{ key: "destructive", label: "Destructive", description: "Error states and danger actions" }
|
|
30
|
-
],
|
|
30
|
+
], He = ({
|
|
31
31
|
activeTokens: p,
|
|
32
32
|
savedTokens: d,
|
|
33
33
|
onTokensChange: y,
|
|
34
|
-
onSave:
|
|
35
|
-
onRevert:
|
|
34
|
+
onSave: A,
|
|
35
|
+
onRevert: Y,
|
|
36
|
+
onResetToDefault: P,
|
|
36
37
|
profiles: U,
|
|
37
|
-
profileIcons:
|
|
38
|
-
activeProfileId:
|
|
39
|
-
onProfileClick:
|
|
40
|
-
prompt:
|
|
41
|
-
isGenerating:
|
|
42
|
-
onPromptChange:
|
|
43
|
-
onGenerate:
|
|
44
|
-
onRandomize:
|
|
45
|
-
generateError:
|
|
46
|
-
aiProviderLabel:
|
|
47
|
-
generatedTheme:
|
|
38
|
+
profileIcons: q,
|
|
39
|
+
activeProfileId: J,
|
|
40
|
+
onProfileClick: R,
|
|
41
|
+
prompt: K,
|
|
42
|
+
isGenerating: Q,
|
|
43
|
+
onPromptChange: X,
|
|
44
|
+
onGenerate: Z,
|
|
45
|
+
onRandomize: F,
|
|
46
|
+
generateError: T,
|
|
47
|
+
aiProviderLabel: ee,
|
|
48
|
+
generatedTheme: a,
|
|
48
49
|
headingFont: u,
|
|
49
|
-
setHeadingFont:
|
|
50
|
+
setHeadingFont: H,
|
|
50
51
|
bodyFont: f,
|
|
51
|
-
setBodyFont:
|
|
52
|
-
borderRadius:
|
|
53
|
-
setBorderRadius:
|
|
54
|
-
baseFontSize:
|
|
55
|
-
setBaseFontSize:
|
|
52
|
+
setBodyFont: L,
|
|
53
|
+
borderRadius: re,
|
|
54
|
+
setBorderRadius: $,
|
|
55
|
+
baseFontSize: se,
|
|
56
|
+
setBaseFontSize: B,
|
|
56
57
|
themeMode: N,
|
|
57
|
-
onThemeModeChange:
|
|
58
|
+
onThemeModeChange: k
|
|
58
59
|
}) => {
|
|
59
|
-
const [l,
|
|
60
|
+
const [l, G] = w(p), [C, I] = w("manual"), [o, O] = w(N ?? "system"), [S, ae] = w(!1);
|
|
60
61
|
j(() => {
|
|
61
|
-
|
|
62
|
+
G(p);
|
|
62
63
|
}, [p]), j(() => {
|
|
63
|
-
N !== void 0 &&
|
|
64
|
+
N !== void 0 && O(N);
|
|
64
65
|
}, [N]), j(() => {
|
|
65
|
-
if (!
|
|
66
|
+
if (!a) return;
|
|
66
67
|
const r = o === "dark" || o === "system" && typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
67
|
-
x(
|
|
68
|
-
...g(r ?
|
|
69
|
-
"--app-border-radius-md":
|
|
70
|
-
"--app-font-size-base":
|
|
68
|
+
x(a.fonts.heading, a.fonts.body), m({
|
|
69
|
+
...g(r ? a.dark : a.light),
|
|
70
|
+
"--app-border-radius-md": a.borderRadius,
|
|
71
|
+
"--app-font-size-base": a.baseFontSize
|
|
71
72
|
});
|
|
72
|
-
}, [
|
|
73
|
-
const
|
|
74
|
-
const b =
|
|
75
|
-
|
|
76
|
-
}, [l, y]),
|
|
77
|
-
const r =
|
|
78
|
-
|
|
73
|
+
}, [a, o]);
|
|
74
|
+
const te = c((r, t) => {
|
|
75
|
+
const b = fe(t), h = { ...l, [r]: b };
|
|
76
|
+
G(h), m(W(h)), y(h);
|
|
77
|
+
}, [l, y]), oe = c(() => {
|
|
78
|
+
const r = ke[o];
|
|
79
|
+
O(r);
|
|
79
80
|
const t = r === "dark" || r === "system" && typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
80
|
-
document.documentElement.classList.toggle("dark", t),
|
|
81
|
-
}, [o,
|
|
82
|
-
const r =
|
|
81
|
+
document.documentElement.classList.toggle("dark", t), a && m(g(t ? a.dark : a.light)), k == null || k(r);
|
|
82
|
+
}, [o, k, a]), ie = c(() => {
|
|
83
|
+
const r = ye(), t = o === "dark" || o === "system" && typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
83
84
|
x(r.fonts.heading, r.fonts.body), m({
|
|
84
85
|
...g(t ? r.dark : r.light),
|
|
85
86
|
"--app-border-radius-md": r.borderRadius,
|
|
86
87
|
"--app-font-size-base": r.baseFontSize
|
|
87
|
-
}),
|
|
88
|
-
}, [
|
|
89
|
-
|
|
90
|
-
const t =
|
|
88
|
+
}), F(r);
|
|
89
|
+
}, [F, o]), le = c((r) => {
|
|
90
|
+
R(r);
|
|
91
|
+
const t = Ne(r);
|
|
91
92
|
if (t) {
|
|
92
93
|
const b = o === "dark" || o === "system" && typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
93
94
|
x(t.fonts.heading, t.fonts.body), m({
|
|
@@ -96,33 +97,33 @@ const Ne = {
|
|
|
96
97
|
"--app-font-size-base": t.baseFontSize
|
|
97
98
|
});
|
|
98
99
|
}
|
|
99
|
-
}, [
|
|
100
|
-
|
|
101
|
-
}, [
|
|
102
|
-
|
|
103
|
-
}, [
|
|
104
|
-
|
|
100
|
+
}, [R, o]), de = c((r) => {
|
|
101
|
+
H(r), x(r, f);
|
|
102
|
+
}, [H, f]), ne = c((r) => {
|
|
103
|
+
L(r), x(u, r);
|
|
104
|
+
}, [L, u]), ce = c((r) => {
|
|
105
|
+
$(r), m({
|
|
105
106
|
"--app-border-radius-md": r,
|
|
106
107
|
"--app-border-radius-sm": `calc(${r} - 0.125rem)`,
|
|
107
108
|
"--app-border-radius-lg": `calc(${r} + 0.25rem)`
|
|
108
109
|
});
|
|
109
|
-
}, [
|
|
110
|
-
|
|
111
|
-
}, [
|
|
112
|
-
return /* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
/* @__PURE__ */ e(
|
|
110
|
+
}, [$]), me = c((r) => {
|
|
111
|
+
B(r), m({ "--app-font-size-base": r });
|
|
112
|
+
}, [B]), z = l.primary === d.primary && l.neutral === d.neutral && l.success === d.success && l.warning === d.warning && l.destructive === d.destructive && l.radius === d.radius, pe = o === "dark" || o === "system" && typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").matches, v = a ? pe ? a.dark : a.light : null, V = Object.entries(v ? g(v) : W(l));
|
|
113
|
+
return /* @__PURE__ */ s("div", { className: "space-y-6", children: [
|
|
114
|
+
/* @__PURE__ */ s("div", { className: "flex items-start justify-between gap-4", children: [
|
|
115
|
+
/* @__PURE__ */ s("div", { children: [
|
|
116
|
+
/* @__PURE__ */ s("h2", { className: "text-lg font-bold flex items-center gap-2", children: [
|
|
117
|
+
/* @__PURE__ */ e(n, { name: "palette", size: 16, className: "text-primary" }),
|
|
117
118
|
"Theme Lab"
|
|
118
119
|
] }),
|
|
119
120
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground mt-1", children: "Design your brand palette and apply it live across the app." })
|
|
120
121
|
] }),
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ s("div", { className: "flex rounded-lg border border-border overflow-hidden shrink-0", children: [
|
|
122
123
|
/* @__PURE__ */ e(
|
|
123
124
|
"button",
|
|
124
125
|
{
|
|
125
|
-
onClick: () =>
|
|
126
|
+
onClick: () => I("manual"),
|
|
126
127
|
className: [
|
|
127
128
|
"px-4 py-2 text-xs font-semibold transition-colors",
|
|
128
129
|
C === "manual" ? "bg-primary text-primary-foreground" : "bg-card text-muted-foreground hover:text-foreground"
|
|
@@ -130,16 +131,16 @@ const Ne = {
|
|
|
130
131
|
children: "Manual"
|
|
131
132
|
}
|
|
132
133
|
),
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ s(
|
|
134
135
|
"button",
|
|
135
136
|
{
|
|
136
|
-
onClick: () =>
|
|
137
|
+
onClick: () => I("ai"),
|
|
137
138
|
className: [
|
|
138
139
|
"px-4 py-2 text-xs font-semibold transition-colors flex items-center gap-1.5",
|
|
139
140
|
C === "ai" ? "bg-primary text-primary-foreground" : "bg-card text-muted-foreground hover:text-foreground"
|
|
140
141
|
].join(" "),
|
|
141
142
|
children: [
|
|
142
|
-
/* @__PURE__ */ e(
|
|
143
|
+
/* @__PURE__ */ e(n, { name: "sparkles", size: 12 }),
|
|
143
144
|
"AI"
|
|
144
145
|
]
|
|
145
146
|
}
|
|
@@ -147,87 +148,87 @@ const Ne = {
|
|
|
147
148
|
] })
|
|
148
149
|
] }),
|
|
149
150
|
C === "manual" ? /* @__PURE__ */ e(
|
|
150
|
-
|
|
151
|
+
be,
|
|
151
152
|
{
|
|
152
153
|
profiles: U,
|
|
153
|
-
profileIcons:
|
|
154
|
-
activeProfileId:
|
|
155
|
-
onProfileClick:
|
|
154
|
+
profileIcons: q,
|
|
155
|
+
activeProfileId: J,
|
|
156
|
+
onProfileClick: le
|
|
156
157
|
}
|
|
157
158
|
) : /* @__PURE__ */ e(
|
|
158
|
-
|
|
159
|
+
he,
|
|
159
160
|
{
|
|
160
|
-
prompt:
|
|
161
|
-
isGenerating:
|
|
162
|
-
onPromptChange:
|
|
163
|
-
onGenerate:
|
|
164
|
-
onRandomize:
|
|
165
|
-
errorMessage:
|
|
166
|
-
aiProviderLabel:
|
|
161
|
+
prompt: K,
|
|
162
|
+
isGenerating: Q,
|
|
163
|
+
onPromptChange: X,
|
|
164
|
+
onGenerate: Z,
|
|
165
|
+
onRandomize: ie,
|
|
166
|
+
errorMessage: T,
|
|
167
|
+
aiProviderLabel: ee
|
|
167
168
|
}
|
|
168
169
|
),
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */ e("div", { className: "col-span-12 @lg:col-span-8 space-y-4", children:
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
/* @__PURE__ */ e("div", { className: "flex items-center justify-end", children: /* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ s("div", { className: "grid grid-cols-12 gap-6", children: [
|
|
171
|
+
/* @__PURE__ */ e("div", { className: "col-span-12 @lg:col-span-8 space-y-4", children: a && v ? /* @__PURE__ */ s(ue, { children: [
|
|
172
|
+
/* @__PURE__ */ s(E, { className: "p-5 space-y-4", children: [
|
|
173
|
+
/* @__PURE__ */ e("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ s(
|
|
173
174
|
"button",
|
|
174
175
|
{
|
|
175
|
-
onClick:
|
|
176
|
+
onClick: oe,
|
|
176
177
|
className: "flex items-center gap-1.5 px-3 py-1.5 rounded-full border border-border text-xs font-semibold transition-colors hover:border-primary/50",
|
|
177
178
|
children: [
|
|
178
|
-
/* @__PURE__ */ e(
|
|
179
|
-
|
|
179
|
+
/* @__PURE__ */ e(n, { name: M[o].icon, size: 12, className: "text-primary" }),
|
|
180
|
+
M[o].label
|
|
180
181
|
]
|
|
181
182
|
}
|
|
182
183
|
) }),
|
|
183
|
-
/* @__PURE__ */ e(
|
|
184
|
+
/* @__PURE__ */ e(ge, { palette: v, label: M[o].label })
|
|
184
185
|
] }),
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ s("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
|
|
187
|
+
/* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
187
188
|
/* @__PURE__ */ e("p", { className: "text-[10px] font-bold uppercase tracking-widest opacity-50", children: "Light Preview" }),
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */ s(
|
|
189
190
|
"div",
|
|
190
191
|
{
|
|
191
192
|
className: "p-4 rounded-xl border shadow-sm transition-all duration-500",
|
|
192
193
|
style: {
|
|
193
|
-
backgroundColor: i(
|
|
194
|
-
color: i(
|
|
195
|
-
borderColor: i(
|
|
194
|
+
backgroundColor: i(a.light.background),
|
|
195
|
+
color: i(a.light.foreground),
|
|
196
|
+
borderColor: i(a.light.border)
|
|
196
197
|
},
|
|
197
198
|
children: [
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
/* @__PURE__ */ e("div", { className: "h-4 w-4 rounded-full", style: { backgroundColor: i(
|
|
199
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-2 mb-3", children: [
|
|
200
|
+
/* @__PURE__ */ e("div", { className: "h-4 w-4 rounded-full", style: { backgroundColor: i(a.light.primary) } }),
|
|
200
201
|
/* @__PURE__ */ e("span", { className: "text-sm font-bold", style: { fontFamily: `'${u}', serif` }, children: "Primary Heading" })
|
|
201
202
|
] }),
|
|
202
|
-
/* @__PURE__ */ e("div", { className: "p-3 rounded-md mb-2 text-xs", style: { backgroundColor: i(
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
/* @__PURE__ */ e("div", { className: "h-6 flex-1 rounded", style: { backgroundColor: i(
|
|
205
|
-
/* @__PURE__ */ e("div", { className: "h-6 w-16 rounded flex items-center justify-center text-[10px] font-bold", style: { backgroundColor: i(
|
|
203
|
+
/* @__PURE__ */ e("div", { className: "p-3 rounded-md mb-2 text-xs", style: { backgroundColor: i(a.light.card), borderColor: i(a.light.border), borderWidth: 1, fontFamily: `'${f}', sans-serif` }, children: "Card text body content preview" }),
|
|
204
|
+
/* @__PURE__ */ s("div", { className: "flex gap-2", children: [
|
|
205
|
+
/* @__PURE__ */ e("div", { className: "h-6 flex-1 rounded", style: { backgroundColor: i(a.light.muted) } }),
|
|
206
|
+
/* @__PURE__ */ e("div", { className: "h-6 w-16 rounded flex items-center justify-center text-[10px] font-bold", style: { backgroundColor: i(a.light.accent), color: a.light.accent.l > 55 ? "#000" : "#fff" }, children: "BTN" })
|
|
206
207
|
] })
|
|
207
208
|
]
|
|
208
209
|
}
|
|
209
210
|
)
|
|
210
211
|
] }),
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
212
213
|
/* @__PURE__ */ e("p", { className: "text-[10px] font-bold uppercase tracking-widest opacity-50", children: "Dark Preview" }),
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ s(
|
|
214
215
|
"div",
|
|
215
216
|
{
|
|
216
217
|
className: "p-4 rounded-xl border shadow-sm transition-all duration-500",
|
|
217
218
|
style: {
|
|
218
|
-
backgroundColor: i(
|
|
219
|
-
color: i(
|
|
220
|
-
borderColor: i(
|
|
219
|
+
backgroundColor: i(a.dark.background),
|
|
220
|
+
color: i(a.dark.foreground),
|
|
221
|
+
borderColor: i(a.dark.border)
|
|
221
222
|
},
|
|
222
223
|
children: [
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
/* @__PURE__ */ e("div", { className: "h-4 w-4 rounded-full", style: { backgroundColor: i(
|
|
224
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-2 mb-3", children: [
|
|
225
|
+
/* @__PURE__ */ e("div", { className: "h-4 w-4 rounded-full", style: { backgroundColor: i(a.dark.primary) } }),
|
|
225
226
|
/* @__PURE__ */ e("span", { className: "text-sm font-bold", style: { fontFamily: `'${u}', serif` }, children: "Primary Heading" })
|
|
226
227
|
] }),
|
|
227
|
-
/* @__PURE__ */ e("div", { className: "p-3 rounded-md mb-2 text-xs", style: { backgroundColor: i(
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
/* @__PURE__ */ e("div", { className: "h-6 flex-1 rounded", style: { backgroundColor: i(
|
|
230
|
-
/* @__PURE__ */ e("div", { className: "h-6 w-16 rounded flex items-center justify-center text-[10px] font-bold", style: { backgroundColor: i(
|
|
228
|
+
/* @__PURE__ */ e("div", { className: "p-3 rounded-md mb-2 text-xs", style: { backgroundColor: i(a.dark.card), borderColor: i(a.dark.border), borderWidth: 1, fontFamily: `'${f}', sans-serif` }, children: "Card text body content preview" }),
|
|
229
|
+
/* @__PURE__ */ s("div", { className: "flex gap-2", children: [
|
|
230
|
+
/* @__PURE__ */ e("div", { className: "h-6 flex-1 rounded", style: { backgroundColor: i(a.dark.muted) } }),
|
|
231
|
+
/* @__PURE__ */ e("div", { className: "h-6 w-16 rounded flex items-center justify-center text-[10px] font-bold", style: { backgroundColor: i(a.dark.accent), color: a.dark.accent.l > 55 ? "#000" : "#fff" }, children: "BTN" })
|
|
231
232
|
] })
|
|
232
233
|
]
|
|
233
234
|
}
|
|
@@ -236,16 +237,16 @@ const Ne = {
|
|
|
236
237
|
] })
|
|
237
238
|
] }) : (
|
|
238
239
|
/* ── Fallback: current active theme as colour pickers ── */
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
-
/* @__PURE__ */
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
/* @__PURE__ */ e(
|
|
240
|
+
/* @__PURE__ */ s(E, { className: "p-5 space-y-4", children: [
|
|
241
|
+
/* @__PURE__ */ s("div", { children: [
|
|
242
|
+
/* @__PURE__ */ s("h3", { className: "text-sm font-semibold flex items-center gap-2", children: [
|
|
243
|
+
/* @__PURE__ */ e(n, { name: "palette", size: 14, className: "text-primary" }),
|
|
243
244
|
"Current Theme Palette"
|
|
244
245
|
] }),
|
|
245
246
|
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground mt-1", children: "Your active CSS variable colours. Click any swatch to customise." })
|
|
246
247
|
] }),
|
|
247
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children: ve.map(({ key: r, label: t, description: b }) => /* @__PURE__ */
|
|
248
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: ve.map(({ key: r, label: t, description: b }) => /* @__PURE__ */ s("div", { className: "flex items-center gap-4", children: [
|
|
249
|
+
/* @__PURE__ */ s("label", { className: "relative cursor-pointer group", title: t, children: [
|
|
249
250
|
/* @__PURE__ */ e(
|
|
250
251
|
"div",
|
|
251
252
|
{
|
|
@@ -258,75 +259,95 @@ const Ne = {
|
|
|
258
259
|
{
|
|
259
260
|
type: "color",
|
|
260
261
|
className: "absolute inset-0 opacity-0 w-full h-full cursor-pointer",
|
|
261
|
-
value:
|
|
262
|
-
onChange: (h) =>
|
|
262
|
+
value: _(l[r]),
|
|
263
|
+
onChange: (h) => te(r, h.target.value)
|
|
263
264
|
}
|
|
264
265
|
)
|
|
265
266
|
] }),
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ s("div", { className: "flex-1 min-w-0", children: [
|
|
267
268
|
/* @__PURE__ */ e("div", { className: "text-sm font-medium", children: t }),
|
|
268
269
|
/* @__PURE__ */ e("div", { className: "text-xs text-muted-foreground truncate", children: b })
|
|
269
270
|
] }),
|
|
270
|
-
/* @__PURE__ */ e("code", { className: "text-[10px] font-mono text-muted-foreground bg-muted px-2 py-1 rounded tabular-nums shrink-0", children:
|
|
271
|
+
/* @__PURE__ */ e("code", { className: "text-[10px] font-mono text-muted-foreground bg-muted px-2 py-1 rounded tabular-nums shrink-0", children: _(l[r]).toUpperCase() })
|
|
271
272
|
] }, r)) })
|
|
272
273
|
] })
|
|
273
274
|
) }),
|
|
274
275
|
/* @__PURE__ */ e("div", { className: "col-span-12 @lg:col-span-4", children: /* @__PURE__ */ e(
|
|
275
|
-
|
|
276
|
+
xe,
|
|
276
277
|
{
|
|
277
278
|
headingFont: u,
|
|
278
|
-
setHeadingFont:
|
|
279
|
+
setHeadingFont: de,
|
|
279
280
|
bodyFont: f,
|
|
280
|
-
setBodyFont:
|
|
281
|
-
borderRadius:
|
|
282
|
-
setBorderRadius:
|
|
283
|
-
baseFontSize:
|
|
284
|
-
setBaseFontSize:
|
|
281
|
+
setBodyFont: ne,
|
|
282
|
+
borderRadius: re,
|
|
283
|
+
setBorderRadius: ce,
|
|
284
|
+
baseFontSize: se,
|
|
285
|
+
setBaseFontSize: me,
|
|
285
286
|
vertical: !0
|
|
286
287
|
}
|
|
287
288
|
) })
|
|
288
289
|
] }),
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ s(E, { className: "p-0 overflow-hidden border-2 border-primary/10", children: [
|
|
291
|
+
/* @__PURE__ */ s(
|
|
291
292
|
"button",
|
|
292
293
|
{
|
|
293
|
-
onClick: () =>
|
|
294
|
+
onClick: () => ae(!S),
|
|
294
295
|
className: "w-full flex items-center justify-between p-4 bg-muted/30 border-b border-border hover:bg-muted/50 transition-colors",
|
|
295
296
|
children: [
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
-
/* @__PURE__ */ e(
|
|
297
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
298
|
+
/* @__PURE__ */ e(n, { name: "code", size: 14, className: "text-primary" }),
|
|
298
299
|
/* @__PURE__ */ e("span", { className: "text-xs font-bold uppercase tracking-widest", children: "CSS Variables" }),
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ s("span", { className: "text-[10px] text-muted-foreground", children: [
|
|
300
301
|
"(",
|
|
301
|
-
|
|
302
|
+
V.length,
|
|
302
303
|
" vars)"
|
|
303
304
|
] })
|
|
304
305
|
] }),
|
|
305
|
-
/* @__PURE__ */ e(
|
|
306
|
+
/* @__PURE__ */ e(n, { name: S ? "chevron-up" : "chevron-down", size: 14, className: "text-muted-foreground" })
|
|
306
307
|
]
|
|
307
308
|
}
|
|
308
309
|
),
|
|
309
|
-
S && /* @__PURE__ */ e("div", { className: "p-4 bg-black/5 font-mono text-[11px] max-h-[240px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 @md:grid-cols-2 gap-x-8 gap-y-1", children:
|
|
310
|
+
S && /* @__PURE__ */ e("div", { className: "p-4 bg-black/5 font-mono text-[11px] max-h-[240px] overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-1 @md:grid-cols-2 gap-x-8 gap-y-1", children: V.map(([r, t]) => /* @__PURE__ */ s("div", { className: "flex justify-between py-1 border-b border-black/5 last:border-0 group", children: [
|
|
310
311
|
/* @__PURE__ */ e("span", { className: "text-primary/70 group-hover:text-primary transition-colors", children: r }),
|
|
311
312
|
/* @__PURE__ */ e("span", { className: "font-bold opacity-80", children: String(t) })
|
|
312
313
|
] }, r)) }) })
|
|
313
314
|
] }),
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-3 p-4 bg-muted/30 rounded-xl border border-border", children: [
|
|
316
|
+
/* @__PURE__ */ s("div", { className: "flex-1 min-w-[12rem]", children: [
|
|
316
317
|
/* @__PURE__ */ e("p", { className: "text-xs font-semibold", children: "Master Theme Controls" }),
|
|
317
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground mt-0.5", children: z ? "Theme matches saved master." : "Unsaved changes — save to lock in your palette." })
|
|
318
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground mt-0.5", children: z ? "Theme matches saved master." : "Unsaved changes — save to lock in your palette." }),
|
|
319
|
+
/* @__PURE__ */ e("p", { className: "text-2xs text-muted-foreground/70 mt-1", children: "Saved in this browser only. It does not change the deployed app." })
|
|
318
320
|
] }),
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
-
|
|
321
|
-
|
|
321
|
+
P && /* @__PURE__ */ s(
|
|
322
|
+
D,
|
|
323
|
+
{
|
|
324
|
+
variant: "ghost",
|
|
325
|
+
size: "sm",
|
|
326
|
+
className: "shrink-0",
|
|
327
|
+
onClick: () => {
|
|
328
|
+
(typeof window > "u" || window.confirm(
|
|
329
|
+
`Reset to the theme this app shipped with?
|
|
330
|
+
|
|
331
|
+
Your saved palette will be discarded.`
|
|
332
|
+
)) && P();
|
|
333
|
+
},
|
|
334
|
+
children: [
|
|
335
|
+
/* @__PURE__ */ e(n, { name: "undo-2", size: 13, className: "mr-1.5" }),
|
|
336
|
+
"Reset to app default"
|
|
337
|
+
]
|
|
338
|
+
}
|
|
339
|
+
),
|
|
340
|
+
/* @__PURE__ */ s(D, { variant: "outline", size: "sm", onClick: Y, disabled: z, className: "shrink-0", children: [
|
|
341
|
+
/* @__PURE__ */ e(n, { name: "rotate-ccw", size: 13, className: "mr-1.5" }),
|
|
342
|
+
"Discard changes"
|
|
322
343
|
] }),
|
|
323
|
-
/* @__PURE__ */
|
|
324
|
-
/* @__PURE__ */ e(
|
|
344
|
+
/* @__PURE__ */ s(D, { size: "sm", onClick: A, disabled: z, className: "shrink-0", children: [
|
|
345
|
+
/* @__PURE__ */ e(n, { name: "save", size: 13, className: "mr-1.5" }),
|
|
325
346
|
"Save Master Theme"
|
|
326
347
|
] })
|
|
327
348
|
] })
|
|
328
349
|
] });
|
|
329
350
|
};
|
|
330
351
|
export {
|
|
331
|
-
|
|
352
|
+
He as ThemeLab
|
|
332
353
|
};
|