@razzusharma/accent-theme 1.0.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/LICENSE +21 -0
- package/README.md +201 -0
- package/dist/index.d.mts +83 -0
- package/dist/index.d.ts +83 -0
- package/dist/index.js +463 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +419 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +45 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
AccentColorPicker: () => AccentColorPicker,
|
|
34
|
+
AccentColorSwatch: () => AccentColorSwatch,
|
|
35
|
+
AccentThemeProvider: () => AccentThemeProvider,
|
|
36
|
+
adjustHSL: () => adjustHSL,
|
|
37
|
+
applyCSSVariables: () => applyCSSVariables,
|
|
38
|
+
createGradient: () => createGradient,
|
|
39
|
+
createShadow: () => createShadow,
|
|
40
|
+
defaultAccentColors: () => defaultAccentColors,
|
|
41
|
+
generateCSSVariables: () => generateCSSVariables,
|
|
42
|
+
getContrastColor: () => getContrastColor,
|
|
43
|
+
isClient: () => isClient,
|
|
44
|
+
storage: () => storage,
|
|
45
|
+
useAccentColor: () => useAccentColor,
|
|
46
|
+
useAccentTheme: () => useAccentTheme
|
|
47
|
+
});
|
|
48
|
+
module.exports = __toCommonJS(index_exports);
|
|
49
|
+
|
|
50
|
+
// src/AccentThemeProvider.tsx
|
|
51
|
+
var React = __toESM(require("react"));
|
|
52
|
+
var import_react = require("react");
|
|
53
|
+
|
|
54
|
+
// src/colors.ts
|
|
55
|
+
var defaultAccentColors = {
|
|
56
|
+
teal: {
|
|
57
|
+
name: "Teal",
|
|
58
|
+
primary: "174 72% 35%",
|
|
59
|
+
primaryForeground: "210 40% 98%",
|
|
60
|
+
light: "174 72% 45%",
|
|
61
|
+
dark: "174 72% 25%",
|
|
62
|
+
gradient: "from-teal-500 to-emerald-500"
|
|
63
|
+
},
|
|
64
|
+
blue: {
|
|
65
|
+
name: "Ocean Blue",
|
|
66
|
+
primary: "217 91% 45%",
|
|
67
|
+
primaryForeground: "210 40% 98%",
|
|
68
|
+
light: "217 91% 55%",
|
|
69
|
+
dark: "217 91% 35%",
|
|
70
|
+
gradient: "from-blue-500 to-cyan-500"
|
|
71
|
+
},
|
|
72
|
+
purple: {
|
|
73
|
+
name: "Royal Purple",
|
|
74
|
+
primary: "270 60% 45%",
|
|
75
|
+
primaryForeground: "210 40% 98%",
|
|
76
|
+
light: "270 60% 55%",
|
|
77
|
+
dark: "270 60% 35%",
|
|
78
|
+
gradient: "from-purple-500 to-pink-500"
|
|
79
|
+
},
|
|
80
|
+
rose: {
|
|
81
|
+
name: "Rose Pink",
|
|
82
|
+
primary: "350 80% 50%",
|
|
83
|
+
primaryForeground: "210 40% 98%",
|
|
84
|
+
light: "350 80% 60%",
|
|
85
|
+
dark: "350 80% 40%",
|
|
86
|
+
gradient: "from-rose-500 to-pink-500"
|
|
87
|
+
},
|
|
88
|
+
amber: {
|
|
89
|
+
name: "Sunset Amber",
|
|
90
|
+
primary: "35 95% 45%",
|
|
91
|
+
primaryForeground: "210 40% 98%",
|
|
92
|
+
light: "35 95% 55%",
|
|
93
|
+
dark: "35 95% 35%",
|
|
94
|
+
gradient: "from-amber-500 to-orange-500"
|
|
95
|
+
},
|
|
96
|
+
emerald: {
|
|
97
|
+
name: "Forest Emerald",
|
|
98
|
+
primary: "150 65% 35%",
|
|
99
|
+
primaryForeground: "210 40% 98%",
|
|
100
|
+
light: "150 65% 45%",
|
|
101
|
+
dark: "150 65% 25%",
|
|
102
|
+
gradient: "from-emerald-500 to-green-500"
|
|
103
|
+
},
|
|
104
|
+
indigo: {
|
|
105
|
+
name: "Deep Indigo",
|
|
106
|
+
primary: "240 60% 50%",
|
|
107
|
+
primaryForeground: "210 40% 98%",
|
|
108
|
+
light: "240 60% 60%",
|
|
109
|
+
dark: "240 60% 40%",
|
|
110
|
+
gradient: "from-indigo-500 to-purple-500"
|
|
111
|
+
},
|
|
112
|
+
cyan: {
|
|
113
|
+
name: "Electric Cyan",
|
|
114
|
+
primary: "190 90% 45%",
|
|
115
|
+
primaryForeground: "210 40% 98%",
|
|
116
|
+
light: "190 90% 55%",
|
|
117
|
+
dark: "190 90% 35%",
|
|
118
|
+
gradient: "from-cyan-500 to-blue-500"
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
function mergeColors(defaultColors, customColors) {
|
|
122
|
+
if (!customColors) return defaultColors;
|
|
123
|
+
return { ...defaultColors, ...customColors };
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// src/AccentThemeProvider.tsx
|
|
127
|
+
var defaultContext = {
|
|
128
|
+
accentColor: "teal",
|
|
129
|
+
setAccentColor: () => {
|
|
130
|
+
},
|
|
131
|
+
accentConfig: defaultAccentColors.teal,
|
|
132
|
+
mounted: false
|
|
133
|
+
};
|
|
134
|
+
var AccentThemeContext = (0, import_react.createContext)(defaultContext);
|
|
135
|
+
function AccentThemeProvider({
|
|
136
|
+
children,
|
|
137
|
+
defaultColor = "teal",
|
|
138
|
+
customColors,
|
|
139
|
+
storageKey = "accent-color",
|
|
140
|
+
cssVariablePrefix = ""
|
|
141
|
+
}) {
|
|
142
|
+
const colors = mergeColors(defaultAccentColors, customColors);
|
|
143
|
+
const [accentColor, setAccentColorState] = (0, import_react.useState)(defaultColor);
|
|
144
|
+
const [mounted, setMounted] = (0, import_react.useState)(false);
|
|
145
|
+
const getVarName = (name) => {
|
|
146
|
+
return cssVariablePrefix ? `${cssVariablePrefix}-${name}` : name;
|
|
147
|
+
};
|
|
148
|
+
(0, import_react.useEffect)(() => {
|
|
149
|
+
setMounted(true);
|
|
150
|
+
const stored = localStorage.getItem(storageKey);
|
|
151
|
+
if (stored && colors[stored]) {
|
|
152
|
+
setAccentColorState(stored);
|
|
153
|
+
}
|
|
154
|
+
}, [storageKey, colors]);
|
|
155
|
+
(0, import_react.useEffect)(() => {
|
|
156
|
+
if (!mounted) return;
|
|
157
|
+
const root = document.documentElement;
|
|
158
|
+
const config = colors[accentColor];
|
|
159
|
+
if (!config) return;
|
|
160
|
+
root.style.setProperty(`--${getVarName("primary")}`, config.primary);
|
|
161
|
+
root.style.setProperty(`--${getVarName("primary-foreground")}`, config.primaryForeground);
|
|
162
|
+
root.style.setProperty(`--${getVarName("ring")}`, config.light);
|
|
163
|
+
root.style.setProperty(`--${getVarName("accent")}`, config.light);
|
|
164
|
+
localStorage.setItem(storageKey, accentColor);
|
|
165
|
+
root.setAttribute(`data-${getVarName("accent")}`, accentColor);
|
|
166
|
+
}, [accentColor, mounted, colors, cssVariablePrefix, getVarName]);
|
|
167
|
+
const setAccentColor = (0, import_react.useCallback)((color) => {
|
|
168
|
+
if (colors[color]) {
|
|
169
|
+
setAccentColorState(color);
|
|
170
|
+
} else {
|
|
171
|
+
console.warn(`[AccentTheme] Color "${color}" not found in available colors`);
|
|
172
|
+
}
|
|
173
|
+
}, [colors]);
|
|
174
|
+
const value = {
|
|
175
|
+
accentColor,
|
|
176
|
+
setAccentColor,
|
|
177
|
+
accentConfig: colors[accentColor] || colors[defaultColor],
|
|
178
|
+
mounted
|
|
179
|
+
};
|
|
180
|
+
return React.createElement(
|
|
181
|
+
AccentThemeContext.Provider,
|
|
182
|
+
{ value },
|
|
183
|
+
children
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
function useAccentTheme() {
|
|
187
|
+
return (0, import_react.useContext)(AccentThemeContext);
|
|
188
|
+
}
|
|
189
|
+
function useAccentColor() {
|
|
190
|
+
const { accentConfig, mounted } = useAccentTheme();
|
|
191
|
+
return {
|
|
192
|
+
primary: `hsl(${accentConfig.primary})`,
|
|
193
|
+
primaryForeground: `hsl(${accentConfig.primaryForeground})`,
|
|
194
|
+
light: `hsl(${accentConfig.light})`,
|
|
195
|
+
dark: `hsl(${accentConfig.dark})`,
|
|
196
|
+
gradient: accentConfig.gradient,
|
|
197
|
+
mounted
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// src/AccentColorPicker.tsx
|
|
202
|
+
var React2 = __toESM(require("react"));
|
|
203
|
+
var import_react2 = require("react");
|
|
204
|
+
function AccentColorPicker({
|
|
205
|
+
size = "md",
|
|
206
|
+
variant = "dropdown",
|
|
207
|
+
columns = 4,
|
|
208
|
+
className = "",
|
|
209
|
+
onChange
|
|
210
|
+
}) {
|
|
211
|
+
const { accentColor, setAccentColor, mounted } = useAccentTheme();
|
|
212
|
+
const { primary } = useAccentColor();
|
|
213
|
+
const [isOpen, setIsOpen] = (0, import_react2.useState)(false);
|
|
214
|
+
const handleColorChange = (color) => {
|
|
215
|
+
setAccentColor(color);
|
|
216
|
+
onChange?.(color);
|
|
217
|
+
if (variant === "dropdown") {
|
|
218
|
+
setIsOpen(false);
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
const sizeClasses = {
|
|
222
|
+
sm: "w-6 h-6",
|
|
223
|
+
md: "w-8 h-8",
|
|
224
|
+
lg: "w-10 h-10"
|
|
225
|
+
};
|
|
226
|
+
const selectedSizeClasses = {
|
|
227
|
+
sm: "w-7 h-7",
|
|
228
|
+
md: "w-9 h-9",
|
|
229
|
+
lg: "w-11 h-11"
|
|
230
|
+
};
|
|
231
|
+
if (!mounted) {
|
|
232
|
+
return React2.createElement("div", {
|
|
233
|
+
className: `animate-pulse bg-gray-200 rounded-full ${sizeClasses[size]}`
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
if (variant === "inline") {
|
|
237
|
+
return React2.createElement("div", {
|
|
238
|
+
className: `grid gap-2 ${className}`,
|
|
239
|
+
style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }
|
|
240
|
+
}, Object.entries(defaultAccentColors).map(([color, config]) => {
|
|
241
|
+
const isSelected = accentColor === color;
|
|
242
|
+
return React2.createElement("button", {
|
|
243
|
+
key: color,
|
|
244
|
+
onClick: () => handleColorChange(color),
|
|
245
|
+
className: `
|
|
246
|
+
relative rounded-full transition-all duration-200
|
|
247
|
+
hover:scale-110 focus:outline-none focus:ring-2 focus:ring-offset-2
|
|
248
|
+
${isSelected ? `ring-2 ring-offset-2 scale-110 ${selectedSizeClasses[size]}` : sizeClasses[size]}
|
|
249
|
+
`,
|
|
250
|
+
style: {
|
|
251
|
+
background: `hsl(${config.primary})`,
|
|
252
|
+
["--tw-ring-color"]: `hsl(${config.light})`
|
|
253
|
+
},
|
|
254
|
+
title: config.name,
|
|
255
|
+
"aria-label": `Select ${config.name} theme`,
|
|
256
|
+
"aria-pressed": isSelected
|
|
257
|
+
}, isSelected && React2.createElement("svg", {
|
|
258
|
+
className: "absolute inset-0 w-full h-full p-1.5 text-white",
|
|
259
|
+
viewBox: "0 0 20 20",
|
|
260
|
+
fill: "currentColor"
|
|
261
|
+
}, React2.createElement("path", {
|
|
262
|
+
fillRule: "evenodd",
|
|
263
|
+
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
264
|
+
clipRule: "evenodd"
|
|
265
|
+
})));
|
|
266
|
+
}));
|
|
267
|
+
}
|
|
268
|
+
return React2.createElement(
|
|
269
|
+
"div",
|
|
270
|
+
{ className: `relative ${className}` },
|
|
271
|
+
React2.createElement("button", {
|
|
272
|
+
onClick: () => setIsOpen(!isOpen),
|
|
273
|
+
className: "flex items-center gap-2 px-3 py-2 rounded-lg bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",
|
|
274
|
+
"aria-expanded": isOpen,
|
|
275
|
+
"aria-haspopup": "listbox"
|
|
276
|
+
}, [
|
|
277
|
+
React2.createElement("div", {
|
|
278
|
+
key: "swatch",
|
|
279
|
+
className: "w-5 h-5 rounded-full",
|
|
280
|
+
style: { background: primary }
|
|
281
|
+
}),
|
|
282
|
+
React2.createElement("span", {
|
|
283
|
+
key: "label",
|
|
284
|
+
className: "text-sm font-medium text-gray-700 dark:text-gray-300"
|
|
285
|
+
}, "Theme"),
|
|
286
|
+
React2.createElement("svg", {
|
|
287
|
+
key: "chevron",
|
|
288
|
+
className: `w-4 h-4 text-gray-500 transition-transform ${isOpen ? "rotate-180" : ""}`,
|
|
289
|
+
fill: "none",
|
|
290
|
+
viewBox: "0 0 24 24",
|
|
291
|
+
stroke: "currentColor"
|
|
292
|
+
}, React2.createElement("path", {
|
|
293
|
+
strokeLinecap: "round",
|
|
294
|
+
strokeLinejoin: "round",
|
|
295
|
+
strokeWidth: 2,
|
|
296
|
+
d: "M19 9l-7 7-7-7"
|
|
297
|
+
}))
|
|
298
|
+
]),
|
|
299
|
+
isOpen && React2.createElement(React2.Fragment, {}, [
|
|
300
|
+
React2.createElement("div", {
|
|
301
|
+
key: "backdrop",
|
|
302
|
+
className: "fixed inset-0 z-40",
|
|
303
|
+
onClick: () => setIsOpen(false)
|
|
304
|
+
}),
|
|
305
|
+
React2.createElement("div", {
|
|
306
|
+
key: "dropdown",
|
|
307
|
+
className: "absolute right-0 mt-2 p-3 bg-white dark:bg-gray-800 rounded-xl shadow-xl border border-gray-200 dark:border-gray-700 z-50 min-w-[200px]",
|
|
308
|
+
role: "listbox"
|
|
309
|
+
}, [
|
|
310
|
+
React2.createElement("div", {
|
|
311
|
+
key: "grid",
|
|
312
|
+
className: "grid grid-cols-4 gap-2"
|
|
313
|
+
}, Object.entries(defaultAccentColors).map(([color, config]) => {
|
|
314
|
+
const isSelected = accentColor === color;
|
|
315
|
+
return React2.createElement("button", {
|
|
316
|
+
key: color,
|
|
317
|
+
onClick: () => handleColorChange(color),
|
|
318
|
+
className: `
|
|
319
|
+
relative w-10 h-10 rounded-lg transition-all duration-200
|
|
320
|
+
hover:scale-110 focus:outline-none focus:ring-2 focus:ring-offset-2
|
|
321
|
+
${isSelected ? "ring-2 ring-offset-2 scale-105" : ""}
|
|
322
|
+
`,
|
|
323
|
+
style: {
|
|
324
|
+
background: `hsl(${config.primary})`,
|
|
325
|
+
["--tw-ring-color"]: `hsl(${config.light})`
|
|
326
|
+
},
|
|
327
|
+
title: config.name,
|
|
328
|
+
role: "option",
|
|
329
|
+
"aria-selected": isSelected
|
|
330
|
+
}, isSelected && React2.createElement("svg", {
|
|
331
|
+
className: "absolute inset-0 w-full h-full p-2 text-white",
|
|
332
|
+
viewBox: "0 0 20 20",
|
|
333
|
+
fill: "currentColor"
|
|
334
|
+
}, React2.createElement("path", {
|
|
335
|
+
fillRule: "evenodd",
|
|
336
|
+
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
337
|
+
clipRule: "evenodd"
|
|
338
|
+
})));
|
|
339
|
+
})),
|
|
340
|
+
React2.createElement("div", {
|
|
341
|
+
key: "footer",
|
|
342
|
+
className: "mt-3 pt-3 border-t border-gray-100 dark:border-gray-700"
|
|
343
|
+
}, React2.createElement("p", {
|
|
344
|
+
className: "text-xs text-gray-500 dark:text-gray-400 text-center"
|
|
345
|
+
}, `Current: ${defaultAccentColors[accentColor]?.name || accentColor}`))
|
|
346
|
+
])
|
|
347
|
+
])
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
function AccentColorSwatch({
|
|
351
|
+
color,
|
|
352
|
+
isSelected,
|
|
353
|
+
onClick,
|
|
354
|
+
size = "md"
|
|
355
|
+
}) {
|
|
356
|
+
const config = defaultAccentColors[color];
|
|
357
|
+
if (!config) return null;
|
|
358
|
+
const sizeClasses = {
|
|
359
|
+
sm: "w-6 h-6",
|
|
360
|
+
md: "w-8 h-8",
|
|
361
|
+
lg: "w-10 h-10"
|
|
362
|
+
};
|
|
363
|
+
return React2.createElement("button", {
|
|
364
|
+
onClick,
|
|
365
|
+
className: `
|
|
366
|
+
relative rounded-full transition-all duration-200
|
|
367
|
+
hover:scale-110 focus:outline-none focus:ring-2 focus:ring-offset-2
|
|
368
|
+
${sizeClasses[size]}
|
|
369
|
+
${isSelected ? "ring-2 ring-offset-2 scale-110" : ""}
|
|
370
|
+
`,
|
|
371
|
+
style: {
|
|
372
|
+
background: `hsl(${config.primary})`,
|
|
373
|
+
["--tw-ring-color"]: `hsl(${config.light})`
|
|
374
|
+
},
|
|
375
|
+
title: config.name
|
|
376
|
+
}, isSelected && React2.createElement("svg", {
|
|
377
|
+
className: "absolute inset-0 w-full h-full p-1.5 text-white",
|
|
378
|
+
viewBox: "0 0 20 20",
|
|
379
|
+
fill: "currentColor"
|
|
380
|
+
}, React2.createElement("path", {
|
|
381
|
+
fillRule: "evenodd",
|
|
382
|
+
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
383
|
+
clipRule: "evenodd"
|
|
384
|
+
})));
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// src/utils.ts
|
|
388
|
+
function generateCSSVariables(config, prefix = "") {
|
|
389
|
+
const p = prefix ? `${prefix}-` : "";
|
|
390
|
+
return {
|
|
391
|
+
[`--${p}primary`]: config.primary,
|
|
392
|
+
[`--${p}primary-foreground`]: config.primaryForeground,
|
|
393
|
+
[`--${p}accent`]: config.light,
|
|
394
|
+
[`--${p}ring`]: config.light
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
function applyCSSVariables(element, variables) {
|
|
398
|
+
Object.entries(variables).forEach(([key, value]) => {
|
|
399
|
+
element.style.setProperty(key, value);
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
function createGradient(config, direction = "to right") {
|
|
403
|
+
return `linear-gradient(${direction}, hsl(${config.light}), hsl(${config.primary}))`;
|
|
404
|
+
}
|
|
405
|
+
function createShadow(config, intensity = 0.3, blur = 20) {
|
|
406
|
+
return `0 4px ${blur}px hsl(${config.primary} / ${intensity})`;
|
|
407
|
+
}
|
|
408
|
+
function adjustHSL(hsl, adjustments) {
|
|
409
|
+
const [h, s, l] = hsl.split(" ").map((v) => parseFloat(v));
|
|
410
|
+
const newH = h + (adjustments.hue || 0);
|
|
411
|
+
const newS = Math.max(0, Math.min(100, s + (adjustments.saturation || 0)));
|
|
412
|
+
const newL = Math.max(0, Math.min(100, l + (adjustments.lightness || 0)));
|
|
413
|
+
return `${newH} ${newS}% ${newL}%`;
|
|
414
|
+
}
|
|
415
|
+
function getContrastColor(hsl, threshold = 50) {
|
|
416
|
+
const [, , l] = hsl.split(" ").map((v) => parseFloat(v));
|
|
417
|
+
return l > threshold ? "black" : "white";
|
|
418
|
+
}
|
|
419
|
+
function isClient() {
|
|
420
|
+
return typeof window !== "undefined";
|
|
421
|
+
}
|
|
422
|
+
var storage = {
|
|
423
|
+
get: (key, defaultValue) => {
|
|
424
|
+
if (!isClient()) return defaultValue;
|
|
425
|
+
try {
|
|
426
|
+
return localStorage.getItem(key) || defaultValue;
|
|
427
|
+
} catch {
|
|
428
|
+
return defaultValue;
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
set: (key, value) => {
|
|
432
|
+
if (!isClient()) return;
|
|
433
|
+
try {
|
|
434
|
+
localStorage.setItem(key, value);
|
|
435
|
+
} catch {
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
remove: (key) => {
|
|
439
|
+
if (!isClient()) return;
|
|
440
|
+
try {
|
|
441
|
+
localStorage.removeItem(key);
|
|
442
|
+
} catch {
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
};
|
|
446
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
447
|
+
0 && (module.exports = {
|
|
448
|
+
AccentColorPicker,
|
|
449
|
+
AccentColorSwatch,
|
|
450
|
+
AccentThemeProvider,
|
|
451
|
+
adjustHSL,
|
|
452
|
+
applyCSSVariables,
|
|
453
|
+
createGradient,
|
|
454
|
+
createShadow,
|
|
455
|
+
defaultAccentColors,
|
|
456
|
+
generateCSSVariables,
|
|
457
|
+
getContrastColor,
|
|
458
|
+
isClient,
|
|
459
|
+
storage,
|
|
460
|
+
useAccentColor,
|
|
461
|
+
useAccentTheme
|
|
462
|
+
});
|
|
463
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/AccentThemeProvider.tsx","../src/colors.ts","../src/AccentColorPicker.tsx","../src/utils.ts"],"sourcesContent":["// Main exports\nexport { AccentThemeProvider, useAccentTheme, useAccentColor } from './AccentThemeProvider';\nexport { AccentColorPicker, AccentColorSwatch } from './AccentColorPicker';\nexport { defaultAccentColors } from './colors';\n\n// Types\nexport type {\n AccentColor,\n AccentColorConfig,\n AccentThemeContextType,\n AccentThemeProviderProps,\n} from './types';\n\n// Utilities\nexport {\n generateCSSVariables,\n applyCSSVariables,\n createGradient,\n createShadow,\n adjustHSL,\n getContrastColor,\n isClient,\n storage,\n} from './utils';\n","\"use client\";\n\nimport * as React from \"react\";\nimport { \n createContext, \n useContext, \n useEffect, \n useState, \n useCallback\n} from \"react\";\nimport type { \n AccentColor, \n AccentThemeContextType, \n AccentThemeProviderProps \n} from \"./types\";\nimport { defaultAccentColors, mergeColors } from \"./colors\";\n\nconst defaultContext: AccentThemeContextType = {\n accentColor: \"teal\",\n setAccentColor: () => {},\n accentConfig: defaultAccentColors.teal,\n mounted: false,\n};\n\nconst AccentThemeContext = createContext<AccentThemeContextType>(defaultContext);\n\nexport function AccentThemeProvider({ \n children, \n defaultColor = \"teal\",\n customColors,\n storageKey = \"accent-color\",\n cssVariablePrefix = \"\"\n}: AccentThemeProviderProps) {\n const colors = mergeColors(defaultAccentColors, customColors);\n \n const [accentColor, setAccentColorState] = useState<AccentColor>(defaultColor);\n const [mounted, setMounted] = useState(false);\n\n // Get CSS variable names\n const getVarName = (name: string) => {\n return cssVariablePrefix ? `${cssVariablePrefix}-${name}` : name;\n };\n\n useEffect(() => {\n setMounted(true);\n // Check local storage\n const stored = localStorage.getItem(storageKey) as AccentColor;\n if (stored && colors[stored]) {\n setAccentColorState(stored);\n }\n }, [storageKey, colors]);\n\n useEffect(() => {\n if (!mounted) return;\n \n const root = document.documentElement;\n const config = colors[accentColor];\n \n if (!config) return;\n \n // Update CSS variables\n root.style.setProperty(`--${getVarName('primary')}`, config.primary);\n root.style.setProperty(`--${getVarName('primary-foreground')}`, config.primaryForeground);\n root.style.setProperty(`--${getVarName('ring')}`, config.light);\n root.style.setProperty(`--${getVarName('accent')}`, config.light);\n \n // Store preference\n localStorage.setItem(storageKey, accentColor);\n \n // Add data attribute for Tailwind selectors\n root.setAttribute(`data-${getVarName('accent')}`, accentColor);\n }, [accentColor, mounted, colors, cssVariablePrefix, getVarName]);\n\n const setAccentColor = useCallback((color: AccentColor) => {\n if (colors[color]) {\n setAccentColorState(color);\n } else {\n console.warn(`[AccentTheme] Color \"${color}\" not found in available colors`);\n }\n }, [colors]);\n\n const value: AccentThemeContextType = {\n accentColor,\n setAccentColor,\n accentConfig: colors[accentColor] || colors[defaultColor],\n mounted,\n };\n\n return React.createElement(\n AccentThemeContext.Provider,\n { value },\n children\n );\n}\n\nexport function useAccentTheme() {\n return useContext(AccentThemeContext);\n}\n\n// Utility hook for getting color values\nexport function useAccentColor() {\n const { accentConfig, mounted } = useAccentTheme();\n \n return {\n primary: `hsl(${accentConfig.primary})`,\n primaryForeground: `hsl(${accentConfig.primaryForeground})`,\n light: `hsl(${accentConfig.light})`,\n dark: `hsl(${accentConfig.dark})`,\n gradient: accentConfig.gradient,\n mounted,\n };\n}\n","import { AccentColor, AccentColorConfig } from './types';\n\nexport const defaultAccentColors: Record<AccentColor, AccentColorConfig> = {\n teal: {\n name: \"Teal\",\n primary: \"174 72% 35%\",\n primaryForeground: \"210 40% 98%\",\n light: \"174 72% 45%\",\n dark: \"174 72% 25%\",\n gradient: \"from-teal-500 to-emerald-500\",\n },\n blue: {\n name: \"Ocean Blue\",\n primary: \"217 91% 45%\",\n primaryForeground: \"210 40% 98%\",\n light: \"217 91% 55%\",\n dark: \"217 91% 35%\",\n gradient: \"from-blue-500 to-cyan-500\",\n },\n purple: {\n name: \"Royal Purple\",\n primary: \"270 60% 45%\",\n primaryForeground: \"210 40% 98%\",\n light: \"270 60% 55%\",\n dark: \"270 60% 35%\",\n gradient: \"from-purple-500 to-pink-500\",\n },\n rose: {\n name: \"Rose Pink\",\n primary: \"350 80% 50%\",\n primaryForeground: \"210 40% 98%\",\n light: \"350 80% 60%\",\n dark: \"350 80% 40%\",\n gradient: \"from-rose-500 to-pink-500\",\n },\n amber: {\n name: \"Sunset Amber\",\n primary: \"35 95% 45%\",\n primaryForeground: \"210 40% 98%\",\n light: \"35 95% 55%\",\n dark: \"35 95% 35%\",\n gradient: \"from-amber-500 to-orange-500\",\n },\n emerald: {\n name: \"Forest Emerald\",\n primary: \"150 65% 35%\",\n primaryForeground: \"210 40% 98%\",\n light: \"150 65% 45%\",\n dark: \"150 65% 25%\",\n gradient: \"from-emerald-500 to-green-500\",\n },\n indigo: {\n name: \"Deep Indigo\",\n primary: \"240 60% 50%\",\n primaryForeground: \"210 40% 98%\",\n light: \"240 60% 60%\",\n dark: \"240 60% 40%\",\n gradient: \"from-indigo-500 to-purple-500\",\n },\n cyan: {\n name: \"Electric Cyan\",\n primary: \"190 90% 45%\",\n primaryForeground: \"210 40% 98%\",\n light: \"190 90% 55%\",\n dark: \"190 90% 35%\",\n gradient: \"from-cyan-500 to-blue-500\",\n },\n};\n\nexport function mergeColors(\n defaultColors: Record<string, AccentColorConfig>,\n customColors?: Record<string, AccentColorConfig>\n): Record<string, AccentColorConfig> {\n if (!customColors) return defaultColors;\n return { ...defaultColors, ...customColors };\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { useState } from \"react\";\nimport { useAccentTheme, useAccentColor } from \"./AccentThemeProvider\";\nimport { defaultAccentColors } from \"./colors\";\nimport { AccentColor } from \"./types\";\n\ninterface AccentColorPickerProps {\n /** Size of the color swatches */\n size?: \"sm\" | \"md\" | \"lg\";\n /** Show as a dropdown or inline grid */\n variant?: \"dropdown\" | \"inline\";\n /** Number of columns for inline variant */\n columns?: number;\n /** Custom className */\n className?: string;\n /** Callback when color changes */\n onChange?: (color: AccentColor) => void;\n}\n\nexport function AccentColorPicker({\n size = \"md\",\n variant = \"dropdown\",\n columns = 4,\n className = \"\",\n onChange,\n}: AccentColorPickerProps) {\n const { accentColor, setAccentColor, mounted } = useAccentTheme();\n const { primary } = useAccentColor();\n const [isOpen, setIsOpen] = useState(false);\n\n const handleColorChange = (color: AccentColor) => {\n setAccentColor(color);\n onChange?.(color);\n if (variant === \"dropdown\") {\n setIsOpen(false);\n }\n };\n\n const sizeClasses = {\n sm: \"w-6 h-6\",\n md: \"w-8 h-8\",\n lg: \"w-10 h-10\",\n };\n\n const selectedSizeClasses = {\n sm: \"w-7 h-7\",\n md: \"w-9 h-9\",\n lg: \"w-11 h-11\",\n };\n\n if (!mounted) {\n return React.createElement(\"div\", {\n className: `animate-pulse bg-gray-200 rounded-full ${sizeClasses[size]}`\n });\n }\n\n // Inline variant - show all colors\n if (variant === \"inline\") {\n return React.createElement(\"div\", {\n className: `grid gap-2 ${className}`,\n style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }\n }, Object.entries(defaultAccentColors).map(([color, config]) => {\n const isSelected = accentColor === color;\n return React.createElement(\"button\", {\n key: color,\n onClick: () => handleColorChange(color),\n className: `\n relative rounded-full transition-all duration-200\n hover:scale-110 focus:outline-none focus:ring-2 focus:ring-offset-2\n ${isSelected ? `ring-2 ring-offset-2 scale-110 ${selectedSizeClasses[size]}` : sizeClasses[size]}\n `,\n style: {\n background: `hsl(${config.primary})`,\n ['--tw-ring-color' as string]: `hsl(${config.light})`,\n },\n title: config.name,\n 'aria-label': `Select ${config.name} theme`,\n 'aria-pressed': isSelected,\n }, isSelected && React.createElement(\"svg\", {\n className: \"absolute inset-0 w-full h-full p-1.5 text-white\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\"\n }, React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\",\n clipRule: \"evenodd\"\n })));\n }));\n }\n\n // Dropdown variant\n return React.createElement(\"div\", { className: `relative ${className}` },\n React.createElement(\"button\", {\n onClick: () => setIsOpen(!isOpen),\n className: \"flex items-center gap-2 px-3 py-2 rounded-lg bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors\",\n 'aria-expanded': isOpen,\n 'aria-haspopup': \"listbox\"\n }, [\n React.createElement(\"div\", {\n key: \"swatch\",\n className: \"w-5 h-5 rounded-full\",\n style: { background: primary }\n }),\n React.createElement(\"span\", {\n key: \"label\",\n className: \"text-sm font-medium text-gray-700 dark:text-gray-300\"\n }, \"Theme\"),\n React.createElement(\"svg\", {\n key: \"chevron\",\n className: `w-4 h-4 text-gray-500 transition-transform ${isOpen ? \"rotate-180\" : \"\"}`,\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n stroke: \"currentColor\"\n }, React.createElement(\"path\", {\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: 2,\n d: \"M19 9l-7 7-7-7\"\n }))\n ]),\n isOpen && React.createElement(React.Fragment, {}, [\n React.createElement(\"div\", {\n key: \"backdrop\",\n className: \"fixed inset-0 z-40\",\n onClick: () => setIsOpen(false)\n }),\n React.createElement(\"div\", {\n key: \"dropdown\",\n className: \"absolute right-0 mt-2 p-3 bg-white dark:bg-gray-800 rounded-xl shadow-xl border border-gray-200 dark:border-gray-700 z-50 min-w-[200px]\",\n role: \"listbox\"\n }, [\n React.createElement(\"div\", {\n key: \"grid\",\n className: \"grid grid-cols-4 gap-2\"\n }, Object.entries(defaultAccentColors).map(([color, config]) => {\n const isSelected = accentColor === color;\n return React.createElement(\"button\", {\n key: color,\n onClick: () => handleColorChange(color),\n className: `\n relative w-10 h-10 rounded-lg transition-all duration-200\n hover:scale-110 focus:outline-none focus:ring-2 focus:ring-offset-2\n ${isSelected ? \"ring-2 ring-offset-2 scale-105\" : \"\"}\n `,\n style: {\n background: `hsl(${config.primary})`,\n ['--tw-ring-color' as string]: `hsl(${config.light})`,\n },\n title: config.name,\n role: \"option\",\n 'aria-selected': isSelected\n }, isSelected && React.createElement(\"svg\", {\n className: \"absolute inset-0 w-full h-full p-2 text-white\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\"\n }, React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\",\n clipRule: \"evenodd\"\n })));\n })),\n React.createElement(\"div\", {\n key: \"footer\",\n className: \"mt-3 pt-3 border-t border-gray-100 dark:border-gray-700\"\n }, React.createElement(\"p\", {\n className: \"text-xs text-gray-500 dark:text-gray-400 text-center\"\n }, `Current: ${defaultAccentColors[accentColor]?.name || accentColor}`))\n ])\n ])\n );\n}\n\n// Simple swatch component\ninterface AccentColorSwatchProps {\n color: AccentColor;\n isSelected?: boolean;\n onClick?: () => void;\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nexport function AccentColorSwatch({ \n color, \n isSelected, \n onClick,\n size = \"md\"\n}: AccentColorSwatchProps) {\n const config = defaultAccentColors[color];\n if (!config) return null;\n\n const sizeClasses = {\n sm: \"w-6 h-6\",\n md: \"w-8 h-8\",\n lg: \"w-10 h-10\",\n };\n\n return React.createElement(\"button\", {\n onClick,\n className: `\n relative rounded-full transition-all duration-200\n hover:scale-110 focus:outline-none focus:ring-2 focus:ring-offset-2\n ${sizeClasses[size]}\n ${isSelected ? \"ring-2 ring-offset-2 scale-110\" : \"\"}\n `,\n style: {\n background: `hsl(${config.primary})`,\n ['--tw-ring-color' as string]: `hsl(${config.light})`,\n },\n title: config.name\n }, isSelected && React.createElement(\"svg\", {\n className: \"absolute inset-0 w-full h-full p-1.5 text-white\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\"\n }, React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\",\n clipRule: \"evenodd\"\n })));\n}\n","import { AccentColorConfig } from './types';\n\n/**\n * Generate CSS custom properties for an accent color\n */\nexport function generateCSSVariables(\n config: AccentColorConfig,\n prefix: string = \"\"\n): Record<string, string> {\n const p = prefix ? `${prefix}-` : \"\";\n return {\n [`--${p}primary`]: config.primary,\n [`--${p}primary-foreground`]: config.primaryForeground,\n [`--${p}accent`]: config.light,\n [`--${p}ring`]: config.light,\n };\n}\n\n/**\n * Apply CSS variables to an element\n */\nexport function applyCSSVariables(\n element: HTMLElement,\n variables: Record<string, string>\n): void {\n Object.entries(variables).forEach(([key, value]) => {\n element.style.setProperty(key, value);\n });\n}\n\n/**\n * Create a gradient string from accent color config\n */\nexport function createGradient(\n config: AccentColorConfig,\n direction: string = \"to right\"\n): string {\n return `linear-gradient(${direction}, hsl(${config.light}), hsl(${config.primary}))`;\n}\n\n/**\n * Create a shadow with the accent color\n */\nexport function createShadow(\n config: AccentColorConfig,\n intensity: number = 0.3,\n blur: number = 20\n): string {\n return `0 4px ${blur}px hsl(${config.primary} / ${intensity})`;\n}\n\n/**\n * Lighten or darken an HSL color\n */\nexport function adjustHSL(\n hsl: string,\n adjustments: {\n hue?: number;\n saturation?: number;\n lightness?: number;\n }\n): string {\n const [h, s, l] = hsl.split(\" \").map((v) => parseFloat(v));\n const newH = h + (adjustments.hue || 0);\n const newS = Math.max(0, Math.min(100, s + (adjustments.saturation || 0)));\n const newL = Math.max(0, Math.min(100, l + (adjustments.lightness || 0)));\n return `${newH} ${newS}% ${newL}%`;\n}\n\n/**\n * Get contrasting text color (black or white) for a background\n */\nexport function getContrastColor(\n hsl: string,\n threshold: number = 50\n): \"black\" | \"white\" {\n const [, , l] = hsl.split(\" \").map((v) => parseFloat(v));\n return l > threshold ? \"black\" : \"white\";\n}\n\n/**\n * Check if code is running on client side\n */\nexport function isClient(): boolean {\n return typeof window !== \"undefined\";\n}\n\n/**\n * Local storage wrapper with error handling\n */\nexport const storage = {\n get: (key: string, defaultValue?: string): string | undefined => {\n if (!isClient()) return defaultValue;\n try {\n return localStorage.getItem(key) || defaultValue;\n } catch {\n return defaultValue;\n }\n },\n set: (key: string, value: string): void => {\n if (!isClient()) return;\n try {\n localStorage.setItem(key, value);\n } catch {\n // Ignore storage errors\n }\n },\n remove: (key: string): void => {\n if (!isClient()) return;\n try {\n localStorage.removeItem(key);\n } catch {\n // Ignore storage errors\n }\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,YAAuB;AACvB,mBAMO;;;ACPA,IAAM,sBAA8D;AAAA,EACzE,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,mBAAmB;AAAA,IACnB,OAAO;AAAA,IACP,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,mBAAmB;AAAA,IACnB,OAAO;AAAA,IACP,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,mBAAmB;AAAA,IACnB,OAAO;AAAA,IACP,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,mBAAmB;AAAA,IACnB,OAAO;AAAA,IACP,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,mBAAmB;AAAA,IACnB,OAAO;AAAA,IACP,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA,SAAS;AAAA,IACP,MAAM;AAAA,IACN,SAAS;AAAA,IACT,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