@kolkrabbi/kol-framework 0.10.0 → 0.10.1
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/package.json +2 -2
- package/src/ThemeToggle.jsx +20 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-framework",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "KOL app shell — sidenav, layout, theme toggle, footer, heroes + brand color layer. SideNav takes nav data as props so the tree stays app-local.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"app-shell"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@kolkrabbi/kol-component": "0.
|
|
30
|
+
"@kolkrabbi/kol-component": "0.15.0",
|
|
31
31
|
"@kolkrabbi/kol-icons": "0.8.11"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
package/src/ThemeToggle.jsx
CHANGED
|
@@ -45,6 +45,17 @@ import { useTheme } from './theme.js'
|
|
|
45
45
|
* hop → button + fill subtle + fullWidth (old: chrome pinned md)
|
|
46
46
|
* hop-bare → flush + fullWidth (old: 6/24 padding kept)
|
|
47
47
|
*
|
|
48
|
+
* NO INTERACTIVE STATES, ANY VARIANT (user ruling 2026-07-30): *"REMOVE ALL
|
|
49
|
+
* STATES, no fucking hover… no variant at all should have an interactive state
|
|
50
|
+
* — it's just a click 1-2, and it's themed."* It emitted `.kol-btn` +
|
|
51
|
+
* `.kol-btn-nav`/`.kol-btn-primary`, which dragged the button state machine
|
|
52
|
+
* along (base transition + focus ring, per-variant :hover wash, [aria-current]
|
|
53
|
+
* shift). Those three were the only state sources; it now emits
|
|
54
|
+
* `.kol-theme-toggle{,-none,-subtle,-flush}` instead, which declare the same
|
|
55
|
+
* resting appearance and have no state rules to inherit. The SIZE classes
|
|
56
|
+
* (`kol-btn-{sm,md,lg}`, `kol-btn-icon`) are pure padding/geometry and stay.
|
|
57
|
+
* The glyph roll stays too — that animates a state CHANGE, it is not a state.
|
|
58
|
+
*
|
|
48
59
|
* Theme state lives in useTheme (./theme.js); this component is only the
|
|
49
60
|
* glyph-roll UI on top of it.
|
|
50
61
|
*/
|
|
@@ -138,7 +149,7 @@ export default function ThemeToggle({
|
|
|
138
149
|
/* ── DEPRECATED aliases — old chrome verbatim (0.6.x) ── */
|
|
139
150
|
if (variant === 'icon') {
|
|
140
151
|
return (
|
|
141
|
-
<button {...shared} className={`kol-
|
|
152
|
+
<button {...shared} className={`kol-theme-toggle kol-theme-toggle-none kol-btn-${size} kol-btn-icon ${className}`.trim()}>
|
|
142
153
|
{iconSwap(glyphSolo)}
|
|
143
154
|
</button>
|
|
144
155
|
)
|
|
@@ -146,8 +157,8 @@ export default function ThemeToggle({
|
|
|
146
157
|
if (variant === 'hop' || variant === 'hop-bare') {
|
|
147
158
|
const bare = variant === 'hop-bare'
|
|
148
159
|
const chromeCls = bare
|
|
149
|
-
? 'w-full inline-flex items-center justify-start gap-2 py-1.5 px-6 kol-mono-14 bg-transparent text-emphasis
|
|
150
|
-
: 'kol-
|
|
160
|
+
? 'w-full inline-flex items-center justify-start gap-2 py-1.5 px-6 kol-mono-14 bg-transparent text-emphasis'
|
|
161
|
+
: 'kol-theme-toggle kol-theme-toggle-subtle kol-btn-md kol-mono-14 w-full justify-start gap-2'
|
|
151
162
|
return (
|
|
152
163
|
<button {...shared} className={`${chromeCls} ${className}`.trim()}>
|
|
153
164
|
<span className="inline-flex items-center justify-center shrink-0" aria-hidden="true">
|
|
@@ -165,7 +176,7 @@ export default function ThemeToggle({
|
|
|
165
176
|
|
|
166
177
|
if (variant === 'flush') {
|
|
167
178
|
const glyph = label ? glyphWithText : glyphSolo
|
|
168
|
-
const cls = `
|
|
179
|
+
const cls = `kol-theme-toggle kol-theme-toggle-flush gap-2 ${mono} ${width} ${className}`
|
|
169
180
|
return (
|
|
170
181
|
<button {...shared} className={cls.replace(/\s+/g, ' ').trim()}>
|
|
171
182
|
{!iconRight && iconSwap(glyph)}
|
|
@@ -176,19 +187,19 @@ export default function ThemeToggle({
|
|
|
176
187
|
}
|
|
177
188
|
|
|
178
189
|
/* variant === 'button' (default) — the padded rung. fill is the one bg
|
|
179
|
-
* element: subtle = the grey fill
|
|
180
|
-
*
|
|
181
|
-
const fillCls = fill === 'none' ? 'kol-
|
|
190
|
+
* element: subtle = the grey fill, none = the invisible container. Geometry
|
|
191
|
+
* identical; no hover wash on either — see the no-states note below. */
|
|
192
|
+
const fillCls = fill === 'none' ? 'kol-theme-toggle-none' : 'kol-theme-toggle-subtle'
|
|
182
193
|
if (!label) {
|
|
183
194
|
// icon-only pins the square box per rung — geometry condition, not a variant
|
|
184
195
|
return (
|
|
185
|
-
<button {...shared} className={`kol-
|
|
196
|
+
<button {...shared} className={`kol-theme-toggle ${fillCls} kol-btn-${size} kol-btn-icon ${width} ${className}`.replace(/\s+/g, ' ').trim()}>
|
|
186
197
|
{iconSwap(glyphSolo)}
|
|
187
198
|
</button>
|
|
188
199
|
)
|
|
189
200
|
}
|
|
190
201
|
return (
|
|
191
|
-
<button {...shared} className={`kol-
|
|
202
|
+
<button {...shared} className={`kol-theme-toggle ${fillCls} kol-btn-${size} ${mono} gap-2 ${width} ${className}`.replace(/\s+/g, ' ').trim()}>
|
|
192
203
|
{!iconRight && iconSwap(glyphWithText)}
|
|
193
204
|
<span className={fullWidth ? 'flex-1 min-w-0 text-left' : ''}>{MODE_LABEL[shown]}</span>
|
|
194
205
|
{iconRight && iconSwap(glyphWithText)}
|