colorsbymax 0.2.2 → 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/CHANGELOG.md +24 -0
- package/README.md +107 -9
- package/dist/{ThemeSwitcher-L1GXY55E.js → ThemeSwitcher-CFtLm7PM.js} +846 -203
- package/dist/auto.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -2
- package/types/index.d.ts +13 -0
package/dist/auto.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { o as ThemeProvider, t as ThemeSwitcher } from "./ThemeSwitcher-CFtLm7PM.js";
|
|
2
2
|
import { createElement } from "react";
|
|
3
3
|
import { createRoot } from "react-dom/client";
|
|
4
4
|
//#region src/auto.js
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as PAIRINGS, C as TOKEN_KEYS, D as MIN_CONTRAST_NON_TEXT, E as MIN_CONTRAST_LARGE_TEXT, F as contrastRatio, I as normalizeHex, M as checkTheme, N as fixAll, O as MIN_CONTRAST_TEXT, P as suggestFix, S as TOKEN_GROUPS, T as deriveAppTokens, _ as darkTokens, a as
|
|
1
|
+
import { A as PAIRINGS, C as TOKEN_KEYS, D as MIN_CONTRAST_NON_TEXT, E as MIN_CONTRAST_LARGE_TEXT, F as contrastRatio, I as normalizeHex, M as checkTheme, N as fixAll, O as MIN_CONTRAST_TEXT, P as suggestFix, S as TOKEN_GROUPS, T as deriveAppTokens, _ as darkTokens, a as themeFromPalette, b as BASE_TOKENS, c as useTheme, d as DEFAULT_SETTINGS, f as collectColors, g as themeFromRoles, h as suggestThemes, i as rolesFromPalette, j as checkRamp, k as MIN_RAMP_STEP_DELTA_E, l as DEFAULT_STORAGE_KEY, m as inferRoles, n as coloursFromFile, o as ThemeProvider, p as detectSiteName, r as dominantColours, s as applyTokens, t as ThemeSwitcher, u as prePaintScript, v as isDarkTheme, w as completeTokens, x as PRESETS, y as toDark } from "./ThemeSwitcher-CFtLm7PM.js";
|
|
2
2
|
export { BASE_TOKENS, DEFAULT_SETTINGS, DEFAULT_STORAGE_KEY, MIN_CONTRAST_LARGE_TEXT, MIN_CONTRAST_NON_TEXT, MIN_CONTRAST_TEXT, MIN_RAMP_STEP_DELTA_E, PAIRINGS, PRESETS, TOKEN_GROUPS, TOKEN_KEYS, ThemeProvider, ThemeSwitcher, applyTokens, checkRamp, checkTheme, collectColors, coloursFromFile, completeTokens, contrastRatio, darkTokens, deriveAppTokens, detectSiteName, dominantColours, fixAll, inferRoles, isDarkTheme, normalizeHex, prePaintScript, rolesFromPalette, suggestFix, suggestThemes, themeFromPalette, themeFromRoles, toDark, useTheme };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "colorsbymax",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "A live theme switcher for any website: site themes, 700+ palettes, for light/dark modes and WCAG contrast checks.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"tailwind"
|
|
17
17
|
],
|
|
18
18
|
"author": "Max Muyalwa (mrmaxdesigns)",
|
|
19
|
-
"homepage": "https://
|
|
19
|
+
"homepage": "https://mrmaxdesigns.com/colorsbymax",
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
22
22
|
"url": "git+https://github.com/MaxMuyalwa/colorsbymax.git"
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"typecheck": "tsc -p types && node scripts/check-types.mjs",
|
|
80
80
|
"prepublishOnly": "npm run build && npm run typecheck",
|
|
81
81
|
"build:demo": "vite build",
|
|
82
|
+
"build:site": "vite build --mode site",
|
|
82
83
|
"build:mcp": "vite build --config mcp/vite.config.js",
|
|
83
84
|
"css": "node scripts/build-css.mjs",
|
|
84
85
|
"icons": "node scripts/build-icons.mjs",
|
package/types/index.d.ts
CHANGED
|
@@ -85,6 +85,11 @@ export interface ColorsByMaxConfig {
|
|
|
85
85
|
* keeps it out of production once the colours are chosen, while it still shows in development.
|
|
86
86
|
*/
|
|
87
87
|
hidden?: boolean
|
|
88
|
+
/**
|
|
89
|
+
* Bring the colour button in with a short pop and a burst of the theme's colours, a moment after
|
|
90
|
+
* the page loads (default true). With reduced motion it fades in instead.
|
|
91
|
+
*/
|
|
92
|
+
intro?: boolean
|
|
88
93
|
}
|
|
89
94
|
|
|
90
95
|
export interface ThemeProviderProps {
|
|
@@ -121,6 +126,14 @@ export interface ThemeApi {
|
|
|
121
126
|
position: 'bottom-right' | 'bottom-left' | 'top-left' | 'top-right'
|
|
122
127
|
/** True when the config hides the switcher; the theme still applies. */
|
|
123
128
|
hidden: boolean
|
|
129
|
+
/** Whether the colour button makes an entrance when it first appears. */
|
|
130
|
+
intro: boolean
|
|
131
|
+
/** The mode in effect: every theme shows its light or dark version. */
|
|
132
|
+
mode: 'light' | 'dark'
|
|
133
|
+
/** The visitor's choice; 'system' follows the device. */
|
|
134
|
+
modeSetting: 'light' | 'dark' | 'system'
|
|
135
|
+
/** Sets the mode, for the whole site, and remembers it. */
|
|
136
|
+
setMode(mode: 'light' | 'dark' | 'system'): void
|
|
124
137
|
/** True when colorsbymax is swapping the page's own colours (the site isn't using the variables). */
|
|
125
138
|
recolouring: boolean
|
|
126
139
|
/** Turns re-colouring of the site's logo on or off. */
|