@salesmind-ai/design-system 0.2.1 → 0.3.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/dist/AppearancePanel-UT57J69V.d.cts +51 -0
- package/dist/AppearancePanel-UT57J69V.d.ts +51 -0
- package/dist/AppearanceProvider-C36a8-eb.d.cts +45 -0
- package/dist/AppearanceProvider-C36a8-eb.d.ts +45 -0
- package/dist/Breadcrumb-RX-B_gDV.d.cts +44 -0
- package/dist/Breadcrumb-RX-B_gDV.d.ts +44 -0
- package/dist/ExportMenu-A2TLFiVv.d.cts +311 -0
- package/dist/ExportMenu-C8qck5AT.d.ts +311 -0
- package/dist/SectionShell-BfBw5q0Y.d.cts +18 -0
- package/dist/SectionShell-BfBw5q0Y.d.ts +18 -0
- package/dist/Select-BdZmK0Lt.d.cts +66 -0
- package/dist/Select-BdZmK0Lt.d.ts +66 -0
- package/dist/admin/index.cjs +2941 -0
- package/dist/admin/index.cjs.map +1 -0
- package/dist/admin/index.css +4145 -0
- package/dist/admin/index.css.map +1 -0
- package/dist/admin/index.d.cts +491 -0
- package/dist/admin/index.d.ts +491 -0
- package/dist/admin/index.js +2918 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/{audit-CiyPkxk1.d.cts → audit-BS2fn7M4.d.ts} +2 -51
- package/dist/{audit-CiyPkxk1.d.ts → audit-DwCmg32J.d.cts} +2 -51
- package/dist/blog/index.cjs +1074 -0
- package/dist/blog/index.cjs.map +1 -0
- package/dist/blog/index.css +1422 -0
- package/dist/blog/index.css.map +1 -0
- package/dist/blog/index.d.cts +233 -0
- package/dist/blog/index.d.ts +233 -0
- package/dist/blog/index.js +1056 -0
- package/dist/blog/index.js.map +1 -0
- package/dist/chart-types-BGVVO-zl.d.cts +208 -0
- package/dist/chart-types-BGVVO-zl.d.ts +208 -0
- package/dist/charts/index.cjs +2698 -0
- package/dist/charts/index.cjs.map +1 -0
- package/dist/charts/index.css +1167 -0
- package/dist/charts/index.css.map +1 -0
- package/dist/charts/index.d.cts +453 -0
- package/dist/charts/index.d.ts +453 -0
- package/dist/charts/index.js +2682 -0
- package/dist/charts/index.js.map +1 -0
- package/dist/core/index.cjs +526 -395
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.css +294 -0
- package/dist/core/index.css.map +1 -1
- package/dist/core/index.d.cts +7 -982
- package/dist/core/index.d.ts +7 -982
- package/dist/core/index.js +476 -351
- package/dist/core/index.js.map +1 -1
- package/dist/i18n/index.cjs +585 -0
- package/dist/i18n/index.cjs.map +1 -0
- package/dist/i18n/index.d.cts +855 -0
- package/dist/i18n/index.d.ts +855 -0
- package/dist/i18n/index.js +547 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/index.d.cts +22 -1290
- package/dist/index.d.ts +22 -1290
- package/dist/marketing/index.cjs +2144 -3023
- package/dist/marketing/index.cjs.map +1 -1
- package/dist/marketing/index.css +3729 -4824
- package/dist/marketing/index.css.map +1 -1
- package/dist/marketing/index.d.cts +1351 -4
- package/dist/marketing/index.d.ts +1351 -4
- package/dist/marketing/index.js +2190 -3054
- package/dist/marketing/index.js.map +1 -1
- package/dist/motion/index.cjs +1230 -0
- package/dist/motion/index.cjs.map +1 -0
- package/dist/motion/index.css +699 -0
- package/dist/motion/index.css.map +1 -0
- package/dist/motion/index.d.cts +68 -0
- package/dist/motion/index.d.ts +68 -0
- package/dist/motion/index.js +1218 -0
- package/dist/motion/index.js.map +1 -0
- package/dist/nav/index.cjs +1533 -0
- package/dist/nav/index.cjs.map +1 -0
- package/dist/nav/index.css +1984 -0
- package/dist/nav/index.css.map +1 -0
- package/dist/nav/index.d.cts +279 -0
- package/dist/nav/index.d.ts +279 -0
- package/dist/nav/index.js +1501 -0
- package/dist/nav/index.js.map +1 -0
- package/dist/report/index.cjs +26 -1649
- package/dist/report/index.cjs.map +1 -1
- package/dist/report/index.css +0 -963
- package/dist/report/index.css.map +1 -1
- package/dist/report/index.d.cts +4 -2
- package/dist/report/index.d.ts +4 -2
- package/dist/report/index.js +27 -1640
- package/dist/report/index.js.map +1 -1
- package/dist/sections/index.cjs +385 -0
- package/dist/sections/index.cjs.map +1 -0
- package/dist/sections/index.css +818 -0
- package/dist/sections/index.css.map +1 -0
- package/dist/sections/index.d.cts +69 -0
- package/dist/sections/index.d.ts +69 -0
- package/dist/sections/index.js +374 -0
- package/dist/sections/index.js.map +1 -0
- package/dist/social-proof/index.cjs +1254 -0
- package/dist/social-proof/index.cjs.map +1 -0
- package/dist/social-proof/index.css +1416 -0
- package/dist/social-proof/index.css.map +1 -0
- package/dist/social-proof/index.d.cts +258 -0
- package/dist/social-proof/index.d.ts +258 -0
- package/dist/social-proof/index.js +1237 -0
- package/dist/social-proof/index.js.map +1 -0
- package/dist/theme/index.cjs +573 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/index.css +464 -0
- package/dist/theme/index.css.map +1 -0
- package/dist/theme/index.d.cts +48 -0
- package/dist/theme/index.d.ts +48 -0
- package/dist/theme/index.js +558 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/types-DAlgDGzw.d.cts +52 -0
- package/dist/types-DAlgDGzw.d.ts +52 -0
- package/dist/web/index.d.cts +3 -2
- package/dist/web/index.d.ts +3 -2
- package/package.json +68 -9
- package/dist/ExportMenu-hEe5MhLq.d.cts +0 -1027
- package/dist/ExportMenu-hEe5MhLq.d.ts +0 -1027
- package/dist/index-B64suAAc.d.cts +0 -1498
- package/dist/index-B64suAAc.d.ts +0 -1498
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export { A as AppearanceContextValue, a as AppearanceProvider, b as AppearanceProviderProps, c as AppearanceSettings, B as Brand, D as Density, N as NavPlacement, R as Radius, T as Theme, h as hexToRgb, i as initializeAppearance, p as prefersReducedMotion, u as useAppearance } from '../AppearanceProvider-C36a8-eb.js';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
export { A as AppearancePanel, a as AppearancePanelLabels, b as AppearancePanelProps } from '../AppearancePanel-UT57J69V.js';
|
|
4
|
+
import 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
interface VoidBackgroundProps {
|
|
7
|
+
/** Show the engineered grid overlay */
|
|
8
|
+
showGrid?: boolean;
|
|
9
|
+
/** Show the film grain texture */
|
|
10
|
+
showGrain?: boolean;
|
|
11
|
+
/** Custom class name */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Child content rendered above the void */
|
|
14
|
+
children?: React__default.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* VoidBackground — The Void Signature Design System Level 0 Environment
|
|
18
|
+
*
|
|
19
|
+
* A four-layer atmospheric background system:
|
|
20
|
+
* 1. Base Color — Deep purple-black (#08040a)
|
|
21
|
+
* 2. Light Orbs — Radial gradients with mix-blend-mode: screen
|
|
22
|
+
* 3. Engineered Grid — 80×80px with radial fade mask
|
|
23
|
+
* 4. Film Grain — Static SVG noise for texture
|
|
24
|
+
*
|
|
25
|
+
* The Void is not decoration — it is the lighting engine for the UI.
|
|
26
|
+
*/
|
|
27
|
+
declare const VoidBackground: React__default.ForwardRefExoticComponent<VoidBackgroundProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
|
|
29
|
+
interface ThemeSelectorProps {
|
|
30
|
+
className?: string;
|
|
31
|
+
style?: React__default.CSSProperties;
|
|
32
|
+
}
|
|
33
|
+
declare const ThemeSelector: React__default.FC<ThemeSelectorProps>;
|
|
34
|
+
|
|
35
|
+
interface ColorPickerProps {
|
|
36
|
+
/** Additional CSS class name. */
|
|
37
|
+
className?: string;
|
|
38
|
+
/** Inline styles. */
|
|
39
|
+
style?: React__default.CSSProperties;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Compact brand/accent color picker.
|
|
43
|
+
* Renders preset brand swatches and an optional custom color input.
|
|
44
|
+
* Consumes the `useAppearance()` context for state.
|
|
45
|
+
*/
|
|
46
|
+
declare const ColorPicker: React__default.ForwardRefExoticComponent<ColorPickerProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
47
|
+
|
|
48
|
+
export { ColorPicker, type ColorPickerProps, ThemeSelector, type ThemeSelectorProps, VoidBackground, type VoidBackgroundProps };
|
|
@@ -0,0 +1,558 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React2, { createContext, useId, useContext, useState, useEffect, useCallback } from 'react';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { Sun, Moon } from 'lucide-react';
|
|
5
|
+
import clsx2 from 'clsx';
|
|
6
|
+
|
|
7
|
+
// src/theme/AppearanceProvider.tsx
|
|
8
|
+
var STORAGE_KEY = "void-appearance-settings";
|
|
9
|
+
var DEFAULT_SETTINGS = {
|
|
10
|
+
theme: "dark",
|
|
11
|
+
brand: "default",
|
|
12
|
+
navPlacement: "left",
|
|
13
|
+
density: "comfortable",
|
|
14
|
+
radius: "playful",
|
|
15
|
+
customColor: "#f97316"
|
|
16
|
+
// Default orange as fallback
|
|
17
|
+
};
|
|
18
|
+
function hexToRgb(hex) {
|
|
19
|
+
const cleanHex = hex.replace(/^#/, "");
|
|
20
|
+
const r = parseInt(cleanHex.substring(0, 2), 16);
|
|
21
|
+
const g = parseInt(cleanHex.substring(2, 4), 16);
|
|
22
|
+
const b = parseInt(cleanHex.substring(4, 6), 16);
|
|
23
|
+
if (isNaN(r) || isNaN(g) || isNaN(b)) {
|
|
24
|
+
return "249, 115, 22";
|
|
25
|
+
}
|
|
26
|
+
return `${r}, ${g}, ${b}`;
|
|
27
|
+
}
|
|
28
|
+
function generateSecondaryColor(hex) {
|
|
29
|
+
const cleanHex = hex.replace(/^#/, "");
|
|
30
|
+
const r = parseInt(cleanHex.substring(0, 2), 16);
|
|
31
|
+
const g = parseInt(cleanHex.substring(2, 4), 16);
|
|
32
|
+
const b = parseInt(cleanHex.substring(4, 6), 16);
|
|
33
|
+
if (isNaN(r) || isNaN(g) || isNaN(b)) {
|
|
34
|
+
return "255, 208, 0";
|
|
35
|
+
}
|
|
36
|
+
const secondary = {
|
|
37
|
+
r: Math.min(255, g + 50),
|
|
38
|
+
g: Math.min(255, b + 100),
|
|
39
|
+
b: Math.min(255, r)
|
|
40
|
+
};
|
|
41
|
+
return `${secondary.r}, ${secondary.g}, ${secondary.b}`;
|
|
42
|
+
}
|
|
43
|
+
function loadSettings() {
|
|
44
|
+
if (typeof window === "undefined") return DEFAULT_SETTINGS;
|
|
45
|
+
try {
|
|
46
|
+
const stored = localStorage.getItem(STORAGE_KEY);
|
|
47
|
+
if (stored) {
|
|
48
|
+
const parsed = JSON.parse(stored);
|
|
49
|
+
return {
|
|
50
|
+
theme: parsed.theme || DEFAULT_SETTINGS.theme,
|
|
51
|
+
brand: parsed.brand || DEFAULT_SETTINGS.brand,
|
|
52
|
+
navPlacement: parsed.navPlacement || DEFAULT_SETTINGS.navPlacement,
|
|
53
|
+
density: parsed.density || DEFAULT_SETTINGS.density,
|
|
54
|
+
radius: parsed.radius || DEFAULT_SETTINGS.radius,
|
|
55
|
+
customColor: parsed.customColor || DEFAULT_SETTINGS.customColor
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
} catch {
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
...DEFAULT_SETTINGS,
|
|
62
|
+
theme: "dark"
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function saveSettings(settings) {
|
|
66
|
+
if (typeof window === "undefined") return;
|
|
67
|
+
try {
|
|
68
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify(settings));
|
|
69
|
+
} catch {
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function applySettings(settings) {
|
|
73
|
+
if (typeof document === "undefined") return;
|
|
74
|
+
const root = document.documentElement;
|
|
75
|
+
root.setAttribute("data-theme", settings.theme);
|
|
76
|
+
root.setAttribute("data-brand", settings.brand);
|
|
77
|
+
root.setAttribute("data-nav", settings.navPlacement);
|
|
78
|
+
root.setAttribute("data-density", settings.density);
|
|
79
|
+
root.setAttribute("data-radius", settings.radius);
|
|
80
|
+
if (settings.brand === "custom") {
|
|
81
|
+
const primaryRgb = hexToRgb(settings.customColor);
|
|
82
|
+
const secondaryRgb = generateSecondaryColor(settings.customColor);
|
|
83
|
+
root.style.setProperty("--custom-accent-rgb", primaryRgb);
|
|
84
|
+
root.style.setProperty("--custom-accent2-rgb", secondaryRgb);
|
|
85
|
+
} else {
|
|
86
|
+
root.style.removeProperty("--custom-accent-rgb");
|
|
87
|
+
root.style.removeProperty("--custom-accent2-rgb");
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function prefersReducedMotion() {
|
|
91
|
+
if (typeof window === "undefined") return false;
|
|
92
|
+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
93
|
+
}
|
|
94
|
+
var AppearanceContext = createContext(null);
|
|
95
|
+
function AppearanceProvider({
|
|
96
|
+
initialSettings,
|
|
97
|
+
disablePersistence = false,
|
|
98
|
+
children
|
|
99
|
+
}) {
|
|
100
|
+
const [settings, setSettings] = useState(() => ({
|
|
101
|
+
...DEFAULT_SETTINGS,
|
|
102
|
+
...initialSettings
|
|
103
|
+
}));
|
|
104
|
+
const [hydrated, setHydrated] = useState(false);
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
if (!disablePersistence) {
|
|
107
|
+
const loaded = loadSettings();
|
|
108
|
+
setSettings({
|
|
109
|
+
...loaded,
|
|
110
|
+
// initialSettings still take priority over localStorage
|
|
111
|
+
...initialSettings
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
setHydrated(true);
|
|
115
|
+
}, []);
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
applySettings(settings);
|
|
118
|
+
if (!disablePersistence && hydrated) {
|
|
119
|
+
saveSettings(settings);
|
|
120
|
+
}
|
|
121
|
+
}, [settings, disablePersistence, hydrated]);
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
if (typeof window === "undefined") return;
|
|
124
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: light)");
|
|
125
|
+
const handleChange = (e) => {
|
|
126
|
+
setSettings((prev) => {
|
|
127
|
+
if (prev.theme === "light-contrast" || prev.theme === "dark-contrast") {
|
|
128
|
+
return prev;
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
...prev,
|
|
132
|
+
theme: e.matches ? "light" : "dark"
|
|
133
|
+
};
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
137
|
+
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
138
|
+
}, []);
|
|
139
|
+
useEffect(() => {
|
|
140
|
+
if (typeof window === "undefined") return;
|
|
141
|
+
const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
142
|
+
const handleChange = () => {
|
|
143
|
+
applySettings(settings);
|
|
144
|
+
};
|
|
145
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
146
|
+
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
147
|
+
}, [settings]);
|
|
148
|
+
const setTheme = useCallback((theme) => {
|
|
149
|
+
setSettings((prev) => ({ ...prev, theme }));
|
|
150
|
+
}, []);
|
|
151
|
+
const setBrand = useCallback((brand) => {
|
|
152
|
+
setSettings((prev) => ({ ...prev, brand }));
|
|
153
|
+
}, []);
|
|
154
|
+
const setNavPlacement = useCallback((navPlacement) => {
|
|
155
|
+
setSettings((prev) => ({ ...prev, navPlacement }));
|
|
156
|
+
}, []);
|
|
157
|
+
const setDensity = useCallback((density) => {
|
|
158
|
+
setSettings((prev) => ({ ...prev, density }));
|
|
159
|
+
}, []);
|
|
160
|
+
const setRadius = useCallback((radius) => {
|
|
161
|
+
setSettings((prev) => ({ ...prev, radius }));
|
|
162
|
+
}, []);
|
|
163
|
+
const setCustomColor = useCallback((customColor) => {
|
|
164
|
+
setSettings((prev) => ({ ...prev, customColor, brand: "custom" }));
|
|
165
|
+
}, []);
|
|
166
|
+
const setAppearance = useCallback((partial) => {
|
|
167
|
+
setSettings((prev) => ({ ...prev, ...partial }));
|
|
168
|
+
}, []);
|
|
169
|
+
const resetToDefaults = useCallback(() => {
|
|
170
|
+
setSettings(DEFAULT_SETTINGS);
|
|
171
|
+
}, []);
|
|
172
|
+
const contextValue = {
|
|
173
|
+
...settings,
|
|
174
|
+
setTheme,
|
|
175
|
+
setBrand,
|
|
176
|
+
setNavPlacement,
|
|
177
|
+
setDensity,
|
|
178
|
+
setRadius,
|
|
179
|
+
setCustomColor,
|
|
180
|
+
setAppearance,
|
|
181
|
+
resetToDefaults
|
|
182
|
+
};
|
|
183
|
+
return /* @__PURE__ */ jsx(AppearanceContext.Provider, { value: contextValue, children });
|
|
184
|
+
}
|
|
185
|
+
function useAppearance() {
|
|
186
|
+
const context = useContext(AppearanceContext);
|
|
187
|
+
if (!context) {
|
|
188
|
+
throw new Error("useAppearance must be used within an AppearanceProvider");
|
|
189
|
+
}
|
|
190
|
+
return context;
|
|
191
|
+
}
|
|
192
|
+
function initializeAppearance(settings) {
|
|
193
|
+
const loaded = loadSettings();
|
|
194
|
+
const merged = { ...loaded, ...settings };
|
|
195
|
+
applySettings(merged);
|
|
196
|
+
}
|
|
197
|
+
var ThemeSelector = ({ className, style }) => {
|
|
198
|
+
const { theme, setTheme } = useAppearance();
|
|
199
|
+
const handleThemeChange = (newTheme) => {
|
|
200
|
+
setTheme(newTheme);
|
|
201
|
+
};
|
|
202
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx2("ds-theme-selector", className), style, role: "group", "aria-label": "Theme Selector", children: [
|
|
203
|
+
/* @__PURE__ */ jsxs(
|
|
204
|
+
"button",
|
|
205
|
+
{
|
|
206
|
+
type: "button",
|
|
207
|
+
className: clsx2("ds-theme-selector__btn", { "ds-theme-selector__btn--active": theme === "light" }),
|
|
208
|
+
onClick: () => handleThemeChange("light"),
|
|
209
|
+
"aria-pressed": theme === "light",
|
|
210
|
+
children: [
|
|
211
|
+
/* @__PURE__ */ jsx(Sun, { className: "ds-theme-selector__icon" }),
|
|
212
|
+
/* @__PURE__ */ jsx("span", { className: "ds-theme-selector__label", children: "Light" })
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
),
|
|
216
|
+
/* @__PURE__ */ jsxs(
|
|
217
|
+
"button",
|
|
218
|
+
{
|
|
219
|
+
type: "button",
|
|
220
|
+
className: clsx2("ds-theme-selector__btn", { "ds-theme-selector__btn--active": theme === "light-contrast" }),
|
|
221
|
+
onClick: () => handleThemeChange("light-contrast"),
|
|
222
|
+
"aria-pressed": theme === "light-contrast",
|
|
223
|
+
children: [
|
|
224
|
+
/* @__PURE__ */ jsx(Sun, { className: "ds-theme-selector__icon" }),
|
|
225
|
+
/* @__PURE__ */ jsx("span", { className: "ds-theme-selector__label", children: "Light HC" })
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
),
|
|
229
|
+
/* @__PURE__ */ jsxs(
|
|
230
|
+
"button",
|
|
231
|
+
{
|
|
232
|
+
type: "button",
|
|
233
|
+
className: clsx2("ds-theme-selector__btn", { "ds-theme-selector__btn--active": theme === "dark" }),
|
|
234
|
+
onClick: () => handleThemeChange("dark"),
|
|
235
|
+
"aria-pressed": theme === "dark",
|
|
236
|
+
children: [
|
|
237
|
+
/* @__PURE__ */ jsx(Moon, { className: "ds-theme-selector__icon" }),
|
|
238
|
+
/* @__PURE__ */ jsx("span", { className: "ds-theme-selector__label", children: "Dark" })
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
),
|
|
242
|
+
/* @__PURE__ */ jsxs(
|
|
243
|
+
"button",
|
|
244
|
+
{
|
|
245
|
+
type: "button",
|
|
246
|
+
className: clsx2("ds-theme-selector__btn", { "ds-theme-selector__btn--active": theme === "dark-contrast" }),
|
|
247
|
+
onClick: () => handleThemeChange("dark-contrast"),
|
|
248
|
+
"aria-pressed": theme === "dark-contrast",
|
|
249
|
+
children: [
|
|
250
|
+
/* @__PURE__ */ jsx(Moon, { className: "ds-theme-selector__icon" }),
|
|
251
|
+
/* @__PURE__ */ jsx("span", { className: "ds-theme-selector__label", children: "Dark HC" })
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
)
|
|
255
|
+
] });
|
|
256
|
+
};
|
|
257
|
+
ThemeSelector.displayName = "ThemeSelector";
|
|
258
|
+
var AppearancePanel = React2.forwardRef(
|
|
259
|
+
({ className, labels: l }, ref) => {
|
|
260
|
+
const {
|
|
261
|
+
theme,
|
|
262
|
+
brand,
|
|
263
|
+
navPlacement,
|
|
264
|
+
density,
|
|
265
|
+
radius,
|
|
266
|
+
customColor,
|
|
267
|
+
setTheme,
|
|
268
|
+
setBrand,
|
|
269
|
+
setNavPlacement,
|
|
270
|
+
setDensity,
|
|
271
|
+
setRadius,
|
|
272
|
+
setCustomColor,
|
|
273
|
+
resetToDefaults
|
|
274
|
+
} = useAppearance();
|
|
275
|
+
const colorPickerId = useId();
|
|
276
|
+
const themeOptions = [
|
|
277
|
+
{ value: "light", label: l?.themeLight ?? "Light" },
|
|
278
|
+
{ value: "light-contrast", label: l?.themeLightContrast ?? "Light (High Contrast)" },
|
|
279
|
+
{ value: "dark", label: l?.themeDark ?? "Dark" },
|
|
280
|
+
{ value: "dark-contrast", label: l?.themeDarkContrast ?? "Dark (High Contrast)" }
|
|
281
|
+
];
|
|
282
|
+
const brandOptions = [
|
|
283
|
+
{ value: "default", label: l?.brandDefault ?? "Default", description: l?.brandDefaultDescription ?? "Warm Intelligence" },
|
|
284
|
+
{ value: "salesmind", label: l?.brandSalesmind ?? "SalesMind", description: l?.brandSalesmindDescription ?? "Pink-red + Gold" },
|
|
285
|
+
{ value: "custom", label: l?.brandCustom ?? "Custom", description: l?.brandCustomDescription ?? "Your color" }
|
|
286
|
+
];
|
|
287
|
+
const navOptions = [
|
|
288
|
+
{ value: "left", label: l?.navLeft ?? "Left Sidebar" },
|
|
289
|
+
{ value: "right", label: l?.navRight ?? "Right Sidebar" },
|
|
290
|
+
{ value: "bottom", label: l?.navBottom ?? "Bottom Tabs" }
|
|
291
|
+
];
|
|
292
|
+
const densityOptions = [
|
|
293
|
+
{ value: "comfortable", label: l?.densityComfortable ?? "Comfortable", description: l?.densityComfortableDescription ?? "Generous spacing" },
|
|
294
|
+
{ value: "compact", label: l?.densityCompact ?? "Compact", description: l?.densityCompactDescription ?? "Higher density" }
|
|
295
|
+
];
|
|
296
|
+
const radiusOptions = [
|
|
297
|
+
{ value: "playful", label: l?.radiusPlayful ?? "Playful", description: l?.radiusPlayfulDescription ?? "Rounded corners" },
|
|
298
|
+
{ value: "sharp", label: l?.radiusSharp ?? "Sharp", description: l?.radiusSharpDescription ?? "Technical feel" }
|
|
299
|
+
];
|
|
300
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: clsx2("ds-appearance-panel", className), children: [
|
|
301
|
+
/* @__PURE__ */ jsx("h3", { className: "ds-appearance-panel__title", children: l?.title ?? "Appearance Settings" }),
|
|
302
|
+
/* @__PURE__ */ jsxs("fieldset", { className: "ds-appearance-panel__section", children: [
|
|
303
|
+
/* @__PURE__ */ jsx("legend", { className: "ds-appearance-panel__legend", children: l?.themeHeading ?? "Theme" }),
|
|
304
|
+
/* @__PURE__ */ jsx("div", { className: "ds-appearance-panel__options", children: themeOptions.map((option) => /* @__PURE__ */ jsxs(
|
|
305
|
+
"label",
|
|
306
|
+
{
|
|
307
|
+
className: clsx2(
|
|
308
|
+
"ds-appearance-panel__option",
|
|
309
|
+
theme === option.value && "ds-appearance-panel__option--active"
|
|
310
|
+
),
|
|
311
|
+
children: [
|
|
312
|
+
/* @__PURE__ */ jsx(
|
|
313
|
+
"input",
|
|
314
|
+
{
|
|
315
|
+
type: "radio",
|
|
316
|
+
name: "theme",
|
|
317
|
+
value: option.value,
|
|
318
|
+
checked: theme === option.value,
|
|
319
|
+
onChange: () => setTheme(option.value),
|
|
320
|
+
className: "ds-appearance-panel__radio"
|
|
321
|
+
}
|
|
322
|
+
),
|
|
323
|
+
/* @__PURE__ */ jsx("span", { className: "ds-appearance-panel__option-label", children: option.label })
|
|
324
|
+
]
|
|
325
|
+
},
|
|
326
|
+
option.value
|
|
327
|
+
)) })
|
|
328
|
+
] }),
|
|
329
|
+
/* @__PURE__ */ jsxs("fieldset", { className: "ds-appearance-panel__section", children: [
|
|
330
|
+
/* @__PURE__ */ jsx("legend", { className: "ds-appearance-panel__legend", children: l?.brandHeading ?? "Brand" }),
|
|
331
|
+
/* @__PURE__ */ jsx("div", { className: "ds-appearance-panel__options", children: brandOptions.map((option) => /* @__PURE__ */ jsxs(
|
|
332
|
+
"label",
|
|
333
|
+
{
|
|
334
|
+
className: clsx2(
|
|
335
|
+
"ds-appearance-panel__option",
|
|
336
|
+
brand === option.value && "ds-appearance-panel__option--active"
|
|
337
|
+
),
|
|
338
|
+
children: [
|
|
339
|
+
/* @__PURE__ */ jsx(
|
|
340
|
+
"input",
|
|
341
|
+
{
|
|
342
|
+
type: "radio",
|
|
343
|
+
name: "brand",
|
|
344
|
+
value: option.value,
|
|
345
|
+
checked: brand === option.value,
|
|
346
|
+
onChange: () => setBrand(option.value),
|
|
347
|
+
className: "ds-appearance-panel__radio"
|
|
348
|
+
}
|
|
349
|
+
),
|
|
350
|
+
/* @__PURE__ */ jsxs("span", { className: "ds-appearance-panel__option-content", children: [
|
|
351
|
+
/* @__PURE__ */ jsx("span", { className: "ds-appearance-panel__option-label", children: option.label }),
|
|
352
|
+
/* @__PURE__ */ jsx("span", { className: "ds-appearance-panel__option-description", children: option.description })
|
|
353
|
+
] })
|
|
354
|
+
]
|
|
355
|
+
},
|
|
356
|
+
option.value
|
|
357
|
+
)) }),
|
|
358
|
+
brand === "custom" && /* @__PURE__ */ jsxs("div", { className: "ds-appearance-panel__color-picker", children: [
|
|
359
|
+
/* @__PURE__ */ jsx("label", { htmlFor: colorPickerId, className: "ds-appearance-panel__color-label", children: l?.accentColorLabel ?? "Accent Color" }),
|
|
360
|
+
/* @__PURE__ */ jsxs("div", { className: "ds-appearance-panel__color-input-wrapper", children: [
|
|
361
|
+
/* @__PURE__ */ jsx(
|
|
362
|
+
"input",
|
|
363
|
+
{
|
|
364
|
+
type: "color",
|
|
365
|
+
id: colorPickerId,
|
|
366
|
+
value: customColor,
|
|
367
|
+
onChange: (e) => setCustomColor(e.target.value),
|
|
368
|
+
className: "ds-appearance-panel__color-input"
|
|
369
|
+
}
|
|
370
|
+
),
|
|
371
|
+
/* @__PURE__ */ jsx("span", { className: "ds-appearance-panel__color-value", children: customColor.toUpperCase() })
|
|
372
|
+
] })
|
|
373
|
+
] })
|
|
374
|
+
] }),
|
|
375
|
+
/* @__PURE__ */ jsxs("fieldset", { className: "ds-appearance-panel__section", children: [
|
|
376
|
+
/* @__PURE__ */ jsx("legend", { className: "ds-appearance-panel__legend", children: l?.densityHeading ?? "Density" }),
|
|
377
|
+
/* @__PURE__ */ jsx("div", { className: "ds-appearance-panel__options ds-appearance-panel__options--row", children: densityOptions.map((option) => /* @__PURE__ */ jsxs(
|
|
378
|
+
"label",
|
|
379
|
+
{
|
|
380
|
+
className: clsx2(
|
|
381
|
+
"ds-appearance-panel__option",
|
|
382
|
+
"ds-appearance-panel__option--toggle",
|
|
383
|
+
density === option.value && "ds-appearance-panel__option--active"
|
|
384
|
+
),
|
|
385
|
+
children: [
|
|
386
|
+
/* @__PURE__ */ jsx(
|
|
387
|
+
"input",
|
|
388
|
+
{
|
|
389
|
+
type: "radio",
|
|
390
|
+
name: "density",
|
|
391
|
+
value: option.value,
|
|
392
|
+
checked: density === option.value,
|
|
393
|
+
onChange: () => setDensity(option.value),
|
|
394
|
+
className: "ds-appearance-panel__radio"
|
|
395
|
+
}
|
|
396
|
+
),
|
|
397
|
+
/* @__PURE__ */ jsxs("span", { className: "ds-appearance-panel__option-content", children: [
|
|
398
|
+
/* @__PURE__ */ jsx("span", { className: "ds-appearance-panel__option-label", children: option.label }),
|
|
399
|
+
/* @__PURE__ */ jsx("span", { className: "ds-appearance-panel__option-description", children: option.description })
|
|
400
|
+
] })
|
|
401
|
+
]
|
|
402
|
+
},
|
|
403
|
+
option.value
|
|
404
|
+
)) })
|
|
405
|
+
] }),
|
|
406
|
+
/* @__PURE__ */ jsxs("fieldset", { className: "ds-appearance-panel__section", children: [
|
|
407
|
+
/* @__PURE__ */ jsx("legend", { className: "ds-appearance-panel__legend", children: l?.geometryHeading ?? "Geometry" }),
|
|
408
|
+
/* @__PURE__ */ jsx("div", { className: "ds-appearance-panel__options ds-appearance-panel__options--row", children: radiusOptions.map((option) => /* @__PURE__ */ jsxs(
|
|
409
|
+
"label",
|
|
410
|
+
{
|
|
411
|
+
className: clsx2(
|
|
412
|
+
"ds-appearance-panel__option",
|
|
413
|
+
"ds-appearance-panel__option--toggle",
|
|
414
|
+
radius === option.value && "ds-appearance-panel__option--active"
|
|
415
|
+
),
|
|
416
|
+
children: [
|
|
417
|
+
/* @__PURE__ */ jsx(
|
|
418
|
+
"input",
|
|
419
|
+
{
|
|
420
|
+
type: "radio",
|
|
421
|
+
name: "radius",
|
|
422
|
+
value: option.value,
|
|
423
|
+
checked: radius === option.value,
|
|
424
|
+
onChange: () => setRadius(option.value),
|
|
425
|
+
className: "ds-appearance-panel__radio"
|
|
426
|
+
}
|
|
427
|
+
),
|
|
428
|
+
/* @__PURE__ */ jsxs("span", { className: "ds-appearance-panel__option-content", children: [
|
|
429
|
+
/* @__PURE__ */ jsx("span", { className: "ds-appearance-panel__option-label", children: option.label }),
|
|
430
|
+
/* @__PURE__ */ jsx("span", { className: "ds-appearance-panel__option-description", children: option.description })
|
|
431
|
+
] })
|
|
432
|
+
]
|
|
433
|
+
},
|
|
434
|
+
option.value
|
|
435
|
+
)) })
|
|
436
|
+
] }),
|
|
437
|
+
/* @__PURE__ */ jsxs("fieldset", { className: "ds-appearance-panel__section", children: [
|
|
438
|
+
/* @__PURE__ */ jsx("legend", { className: "ds-appearance-panel__legend", children: l?.navHeading ?? "Navigation Layout" }),
|
|
439
|
+
/* @__PURE__ */ jsx("div", { className: "ds-appearance-panel__options", children: navOptions.map((option) => /* @__PURE__ */ jsxs(
|
|
440
|
+
"label",
|
|
441
|
+
{
|
|
442
|
+
className: clsx2(
|
|
443
|
+
"ds-appearance-panel__option",
|
|
444
|
+
navPlacement === option.value && "ds-appearance-panel__option--active"
|
|
445
|
+
),
|
|
446
|
+
children: [
|
|
447
|
+
/* @__PURE__ */ jsx(
|
|
448
|
+
"input",
|
|
449
|
+
{
|
|
450
|
+
type: "radio",
|
|
451
|
+
name: "nav",
|
|
452
|
+
value: option.value,
|
|
453
|
+
checked: navPlacement === option.value,
|
|
454
|
+
onChange: () => setNavPlacement(option.value),
|
|
455
|
+
className: "ds-appearance-panel__radio"
|
|
456
|
+
}
|
|
457
|
+
),
|
|
458
|
+
/* @__PURE__ */ jsx("span", { className: "ds-appearance-panel__option-label", children: option.label })
|
|
459
|
+
]
|
|
460
|
+
},
|
|
461
|
+
option.value
|
|
462
|
+
)) })
|
|
463
|
+
] }),
|
|
464
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: resetToDefaults, className: "ds-appearance-panel__reset", children: l?.resetLabel ?? "Reset to Defaults" })
|
|
465
|
+
] });
|
|
466
|
+
}
|
|
467
|
+
);
|
|
468
|
+
AppearancePanel.displayName = "AppearancePanel";
|
|
469
|
+
var BRAND_PRESETS = [
|
|
470
|
+
{ value: "default", label: "Warm Intelligence", color: "#f97316" },
|
|
471
|
+
{ value: "salesmind", label: "SalesMind", color: "#ff005a" }
|
|
472
|
+
];
|
|
473
|
+
var ColorPicker = React2.forwardRef(
|
|
474
|
+
({ className, style }, ref) => {
|
|
475
|
+
const { brand, setBrand, customColor, setCustomColor } = useAppearance();
|
|
476
|
+
return /* @__PURE__ */ jsxs(
|
|
477
|
+
"div",
|
|
478
|
+
{
|
|
479
|
+
ref,
|
|
480
|
+
className: clsx2("ds-color-picker", className),
|
|
481
|
+
style,
|
|
482
|
+
role: "group",
|
|
483
|
+
"aria-label": "Brand Color",
|
|
484
|
+
children: [
|
|
485
|
+
BRAND_PRESETS.map(({ value, label, color }) => /* @__PURE__ */ jsx(
|
|
486
|
+
"button",
|
|
487
|
+
{
|
|
488
|
+
type: "button",
|
|
489
|
+
className: clsx2("ds-color-picker__swatch", {
|
|
490
|
+
"ds-color-picker__swatch--active": brand === value
|
|
491
|
+
}),
|
|
492
|
+
onClick: () => setBrand(value),
|
|
493
|
+
"aria-label": `Switch to ${label} color scheme`,
|
|
494
|
+
"aria-pressed": brand === value,
|
|
495
|
+
title: label,
|
|
496
|
+
children: /* @__PURE__ */ jsx(
|
|
497
|
+
"span",
|
|
498
|
+
{
|
|
499
|
+
className: "ds-color-picker__dot",
|
|
500
|
+
style: { "--swatch-color": color }
|
|
501
|
+
}
|
|
502
|
+
)
|
|
503
|
+
},
|
|
504
|
+
value
|
|
505
|
+
)),
|
|
506
|
+
/* @__PURE__ */ jsxs(
|
|
507
|
+
"label",
|
|
508
|
+
{
|
|
509
|
+
className: clsx2("ds-color-picker__swatch", "ds-color-picker__swatch--custom", {
|
|
510
|
+
"ds-color-picker__swatch--active": brand === "custom"
|
|
511
|
+
}),
|
|
512
|
+
title: `Custom: ${customColor}`,
|
|
513
|
+
children: [
|
|
514
|
+
/* @__PURE__ */ jsx(
|
|
515
|
+
"span",
|
|
516
|
+
{
|
|
517
|
+
className: "ds-color-picker__dot",
|
|
518
|
+
style: { "--swatch-color": customColor }
|
|
519
|
+
}
|
|
520
|
+
),
|
|
521
|
+
/* @__PURE__ */ jsx(
|
|
522
|
+
"input",
|
|
523
|
+
{
|
|
524
|
+
type: "color",
|
|
525
|
+
value: customColor,
|
|
526
|
+
onChange: (e) => setCustomColor(e.target.value),
|
|
527
|
+
className: "ds-color-picker__native-input",
|
|
528
|
+
"aria-label": "Pick a custom accent color"
|
|
529
|
+
}
|
|
530
|
+
)
|
|
531
|
+
]
|
|
532
|
+
}
|
|
533
|
+
)
|
|
534
|
+
]
|
|
535
|
+
}
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
);
|
|
539
|
+
ColorPicker.displayName = "ColorPicker";
|
|
540
|
+
var VoidBackground = React2.forwardRef(
|
|
541
|
+
({ showGrid = true, showGrain = true, className, children }, ref) => {
|
|
542
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: clsx2("void", className), children: [
|
|
543
|
+
/* @__PURE__ */ jsx("div", { className: "void__base", "aria-hidden": "true" }),
|
|
544
|
+
/* @__PURE__ */ jsxs("div", { className: "void__orbs", "aria-hidden": "true", children: [
|
|
545
|
+
/* @__PURE__ */ jsx("div", { className: "void__orb void__orb--warm" }),
|
|
546
|
+
/* @__PURE__ */ jsx("div", { className: "void__orb void__orb--purple" })
|
|
547
|
+
] }),
|
|
548
|
+
showGrid && /* @__PURE__ */ jsx("div", { className: "void__grid", "aria-hidden": "true" }),
|
|
549
|
+
showGrain && /* @__PURE__ */ jsx("div", { className: "void__grain", "aria-hidden": "true" }),
|
|
550
|
+
children && /* @__PURE__ */ jsx("div", { className: "void__content", children })
|
|
551
|
+
] });
|
|
552
|
+
}
|
|
553
|
+
);
|
|
554
|
+
VoidBackground.displayName = "VoidBackground";
|
|
555
|
+
|
|
556
|
+
export { AppearancePanel, AppearanceProvider, ColorPicker, ThemeSelector, VoidBackground, hexToRgb, initializeAppearance, prefersReducedMotion, useAppearance };
|
|
557
|
+
//# sourceMappingURL=out.js.map
|
|
558
|
+
//# sourceMappingURL=index.js.map
|