@hadoku/themes 0.0.0-stage → 5.12.16
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/LICENSE-lucide +43 -0
- package/README.md +433 -2
- package/THEME_USAGE_GUIDE.md +308 -0
- package/dist/HadokuThemeRoot.d.ts +53 -0
- package/dist/HadokuThemeRoot.js +66 -0
- package/dist/ThemeIcons.d.ts +31 -0
- package/dist/ThemeIcons.js +91 -0
- package/dist/effects.d.ts +25 -0
- package/dist/effects.js +25 -0
- package/dist/icons/Icon.d.ts +36 -0
- package/dist/icons/Icon.js +89 -0
- package/dist/icons/index.d.ts +61 -0
- package/dist/icons/index.js +87 -0
- package/dist/icons/registry.generated.d.ts +158 -0
- package/dist/icons/registry.generated.js +446 -0
- package/dist/index.d.ts +82 -0
- package/dist/index.js +169 -0
- package/dist/metadata.d.ts +35 -0
- package/dist/metadata.js +108 -0
- package/dist/platform/index.d.ts +94 -0
- package/dist/platform/index.js +149 -0
- package/dist/platform/usePlatform.d.ts +29 -0
- package/dist/platform/usePlatform.js +65 -0
- package/dist/prefsApiBase.d.ts +37 -0
- package/dist/prefsApiBase.js +40 -0
- package/dist/theme-types.d.ts +34 -0
- package/dist/theme-types.js +1 -0
- package/dist/themeContext.d.ts +62 -0
- package/dist/themeContext.js +70 -0
- package/dist/themePrefs.d.ts +29 -0
- package/dist/themePrefs.js +48 -0
- package/dist/useRefElement.d.ts +19 -0
- package/dist/useRefElement.js +52 -0
- package/dist/useTheme.d.ts +46 -0
- package/dist/useTheme.js +216 -0
- package/package.json +83 -4
- package/scripts/audit-tokens.mjs +126 -0
- package/scripts/check-contrast.mjs +24 -0
- package/scripts/check-docs.mjs +53 -0
- package/scripts/check-icons.mjs +473 -0
- package/scripts/check-usage.mjs +297 -0
- package/scripts/codemod-icons.mjs +396 -0
- package/scripts/generate-icons.mjs +199 -0
- package/scripts/generate-preview.mjs +374 -0
- package/scripts/generate-tailwind-colors.mjs +109 -0
- package/scripts/lib/color.mjs +184 -0
- package/scripts/lib/contract.d.mts +58 -0
- package/scripts/lib/contract.mjs +348 -0
- package/scripts/lib/derive.mjs +324 -0
- package/scripts/lib/icon-registry.mjs +92 -0
- package/scripts/lib/parse-themes.mjs +19 -0
- package/scripts/lib/tokens.mjs +188 -0
- package/scripts/normalize-tokens.mjs +161 -0
- package/src/advanced.css +218 -0
- package/src/icons/Icon.tsx +151 -0
- package/src/icons/emoji-map.json +202 -0
- package/src/icons/index.ts +151 -0
- package/src/icons/registry.generated.ts +455 -0
- package/src/icons/sources.json +150 -0
- package/src/icons.css +145 -0
- package/src/style.css +1421 -0
- package/src/tailwind-colors.css +88 -0
- package/src/tailwind-integration.css +49 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tailwind v4 colour mapping for @wolffm/themes — GENERATED, DO NOT EDIT.
|
|
3
|
+
*
|
|
4
|
+
* Regenerate with: node themes/scripts/generate-tailwind-colors.mjs
|
|
5
|
+
* Source of truth: themes/src/style.css
|
|
6
|
+
*
|
|
7
|
+
* Mapping every theme token into Tailwind's `--color-*` namespace makes the
|
|
8
|
+
* whole token set available as utilities — `bg-primary`, `text-on-primary`,
|
|
9
|
+
* `bg-success-bg`, `text-on-success-bg`, `border-border`, `bg-bg-card` — with
|
|
10
|
+
* no hand-written `@theme` block in any consumer.
|
|
11
|
+
*
|
|
12
|
+
* USAGE — import order matters:
|
|
13
|
+
*
|
|
14
|
+
* @import "@wolffm/themes/style.css"; // 1. token values (UNLAYERED)
|
|
15
|
+
* @import "tailwindcss"; // 2. Tailwind
|
|
16
|
+
* @import "@wolffm/themes/tailwind-colors.css"; // 3. this mapping
|
|
17
|
+
*
|
|
18
|
+
* WHY style.css MUST STAY UNLAYERED
|
|
19
|
+
* =================================
|
|
20
|
+
* Tailwind emits every `@theme` entry into `@layer theme` as `:root { --x: var(--x) }`
|
|
21
|
+
* — a self-reference that is invalid on its own. It resolves correctly only
|
|
22
|
+
* because style.css declares the same properties OUTSIDE any cascade layer,
|
|
23
|
+
* and unlayered declarations beat layered ones. Importing style.css with
|
|
24
|
+
* `layer(...)` puts both declarations in layers, the self-reference can win,
|
|
25
|
+
* and EVERY colour silently resolves to nothing.
|
|
26
|
+
*
|
|
27
|
+
* So: never `@import "@wolffm/themes/style.css" layer(base)`.
|
|
28
|
+
* `themes/scripts/check-usage.mjs` enforces this.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
@theme {
|
|
32
|
+
/* Primary */
|
|
33
|
+
--color-on-primary: var(--color-on-primary);
|
|
34
|
+
--color-on-primary-bg: var(--color-on-primary-bg);
|
|
35
|
+
--color-primary: var(--color-primary);
|
|
36
|
+
--color-primary-bg: var(--color-primary-bg);
|
|
37
|
+
--color-primary-dark: var(--color-primary-dark);
|
|
38
|
+
--color-primary-hover: var(--color-primary-hover);
|
|
39
|
+
|
|
40
|
+
/* Success */
|
|
41
|
+
--color-on-success: var(--color-on-success);
|
|
42
|
+
--color-on-success-bg: var(--color-on-success-bg);
|
|
43
|
+
--color-success: var(--color-success);
|
|
44
|
+
--color-success-bg: var(--color-success-bg);
|
|
45
|
+
--color-success-dark: var(--color-success-dark);
|
|
46
|
+
--color-success-hover: var(--color-success-hover);
|
|
47
|
+
|
|
48
|
+
/* Warning */
|
|
49
|
+
--color-on-warning: var(--color-on-warning);
|
|
50
|
+
--color-on-warning-bg: var(--color-on-warning-bg);
|
|
51
|
+
--color-warning: var(--color-warning);
|
|
52
|
+
--color-warning-bg: var(--color-warning-bg);
|
|
53
|
+
--color-warning-dark: var(--color-warning-dark);
|
|
54
|
+
--color-warning-hover: var(--color-warning-hover);
|
|
55
|
+
|
|
56
|
+
/* Danger */
|
|
57
|
+
--color-danger: var(--color-danger);
|
|
58
|
+
--color-danger-bg: var(--color-danger-bg);
|
|
59
|
+
--color-danger-dark: var(--color-danger-dark);
|
|
60
|
+
--color-danger-hover: var(--color-danger-hover);
|
|
61
|
+
--color-on-danger: var(--color-on-danger);
|
|
62
|
+
--color-on-danger-bg: var(--color-on-danger-bg);
|
|
63
|
+
|
|
64
|
+
/* Neutral */
|
|
65
|
+
--color-neutral: var(--color-neutral);
|
|
66
|
+
--color-neutral-bg: var(--color-neutral-bg);
|
|
67
|
+
--color-neutral-dark: var(--color-neutral-dark);
|
|
68
|
+
--color-neutral-hover: var(--color-neutral-hover);
|
|
69
|
+
--color-on-neutral: var(--color-on-neutral);
|
|
70
|
+
--color-on-neutral-bg: var(--color-on-neutral-bg);
|
|
71
|
+
|
|
72
|
+
/* Text */
|
|
73
|
+
--color-text: var(--color-text);
|
|
74
|
+
--color-text-muted: var(--color-text-muted);
|
|
75
|
+
--color-text-secondary: var(--color-text-secondary);
|
|
76
|
+
--color-text-tertiary: var(--color-text-tertiary);
|
|
77
|
+
|
|
78
|
+
/* Borders */
|
|
79
|
+
--color-border: var(--color-border);
|
|
80
|
+
--color-border-light: var(--color-border-light);
|
|
81
|
+
|
|
82
|
+
/* Surfaces */
|
|
83
|
+
--color-bg: var(--color-bg);
|
|
84
|
+
--color-bg-alt: var(--color-bg-alt);
|
|
85
|
+
--color-bg-card: var(--color-bg-card);
|
|
86
|
+
--color-bg-hover: var(--color-bg-hover);
|
|
87
|
+
--color-bg-overlay: var(--color-bg-overlay);
|
|
88
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tailwind v4 Integration for @wolffm/themes
|
|
3
|
+
*
|
|
4
|
+
* This file maps the namespaced theme variables (--hdk-*) to Tailwind v4's
|
|
5
|
+
* internal CSS variables, allowing Tailwind utilities to use your theme values.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* 1. Import this file AFTER importing tailwindcss in your main CSS:
|
|
9
|
+
*
|
|
10
|
+
* @import "tailwindcss";
|
|
11
|
+
* @import "@wolffm/themes/tailwind-integration.css";
|
|
12
|
+
* @import "@wolffm/themes/style.css";
|
|
13
|
+
*
|
|
14
|
+
* 2. Now Tailwind utilities will use your theme values:
|
|
15
|
+
* - `rounded-md` uses --hdk-radius
|
|
16
|
+
* - `shadow-sm` uses --hdk-shadow-sm
|
|
17
|
+
* - `text-sm` uses --hdk-text-sm
|
|
18
|
+
*
|
|
19
|
+
* This is OPTIONAL. Your theme variables work independently without this file.
|
|
20
|
+
* Only import this if you want Tailwind utilities to match your theme.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
@theme {
|
|
24
|
+
/* Border Radius - maps to rounded-* utilities */
|
|
25
|
+
--radius-sm: var(--hdk-radius-sm);
|
|
26
|
+
--radius: var(--hdk-radius);
|
|
27
|
+
--radius-lg: var(--hdk-radius-lg);
|
|
28
|
+
|
|
29
|
+
/* Shadows - maps to shadow-* utilities */
|
|
30
|
+
--shadow-sm: var(--hdk-shadow-sm);
|
|
31
|
+
--shadow: var(--hdk-shadow-md);
|
|
32
|
+
--shadow-md: var(--hdk-shadow-md);
|
|
33
|
+
--shadow-lg: var(--hdk-shadow-lg);
|
|
34
|
+
|
|
35
|
+
/* Font Sizes - maps to text-* utilities */
|
|
36
|
+
--text-xs: var(--hdk-text-xs);
|
|
37
|
+
--text-sm: var(--hdk-text-sm);
|
|
38
|
+
--text-base: var(--hdk-text-base);
|
|
39
|
+
--text-lg: var(--hdk-text-lg);
|
|
40
|
+
|
|
41
|
+
/*
|
|
42
|
+
* NOTE: We intentionally do NOT map --spacing-* variables.
|
|
43
|
+
* Tailwind's spacing scale powers both small values (padding, gap)
|
|
44
|
+
* and large values (max-w-md = 28rem). Overriding would break
|
|
45
|
+
* container width utilities.
|
|
46
|
+
*
|
|
47
|
+
* Use var(--hdk-space-*) directly in your CSS for theme spacing.
|
|
48
|
+
*/
|
|
49
|
+
}
|