@kolkrabbi/kol-framework 0.10.2 → 0.10.3
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 +1 -1
- package/src/ThemeToggle.jsx +15 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-framework",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
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",
|
package/src/ThemeToggle.jsx
CHANGED
|
@@ -43,7 +43,8 @@ import { useTheme } from './theme.js'
|
|
|
43
43
|
* no consumer shifts a pixel; migrate at your own pace:
|
|
44
44
|
* icon → button + fill none + label off
|
|
45
45
|
* hop → button + fill subtle + fullWidth (old: chrome pinned md)
|
|
46
|
-
* hop-bare → flush + fullWidth
|
|
46
|
+
* hop-bare → flush + fullWidth. Horizontal pad stays 24px (sidenav gutter);
|
|
47
|
+
* vertical pad, type and glyph honour `size` since 2026-07-30.
|
|
47
48
|
*
|
|
48
49
|
* Theme state lives in useTheme (./theme.js); this component is only the
|
|
49
50
|
* glyph-roll UI on top of it.
|
|
@@ -145,13 +146,24 @@ export default function ThemeToggle({
|
|
|
145
146
|
}
|
|
146
147
|
if (variant === 'hop' || variant === 'hop-bare') {
|
|
147
148
|
const bare = variant === 'hop-bare'
|
|
149
|
+
/* hop-bare HONOURS `size` (user ruling 2026-07-30). It used to hardcode
|
|
150
|
+
* kol-mono-14 while its glyph still tracked `size`, so size="lg" produced a
|
|
151
|
+
* 24px glyph beside 14px text — and it took the SOLO glyph ladder despite
|
|
152
|
+
* carrying a label, against the glyph law in this docstring.
|
|
153
|
+
*
|
|
154
|
+
* One container across all three rungs: same bare full-width row, only the
|
|
155
|
+
* vertical pad, the type and the glyph move (4/6/8 · 12/14/16 · 14/16/18).
|
|
156
|
+
* The 24px horizontal gutter is FIXED at every size — it aligns the row with
|
|
157
|
+
* the sidenav's own pl-6, which is the whole reason this alias exists.
|
|
158
|
+
* `hop` stays pinned to md: its docstring promises old chrome verbatim. */
|
|
159
|
+
const barePadY = size === 'sm' ? 'py-1' : size === 'lg' ? 'py-2' : 'py-1.5'
|
|
148
160
|
const chromeCls = bare
|
|
149
|
-
?
|
|
161
|
+
? `w-full inline-flex items-center justify-start gap-2 ${barePadY} px-6 ${mono} bg-transparent text-emphasis`
|
|
150
162
|
: 'kol-theme-toggle kol-theme-toggle-subtle kol-btn-md kol-mono-14 w-full justify-start gap-2'
|
|
151
163
|
return (
|
|
152
164
|
<button {...shared} className={`${chromeCls} ${className}`.trim()}>
|
|
153
165
|
<span className="inline-flex items-center justify-center shrink-0" aria-hidden="true">
|
|
154
|
-
{iconSwap(glyphSolo)}
|
|
166
|
+
{iconSwap(bare ? glyphWithText : glyphSolo)}
|
|
155
167
|
</span>
|
|
156
168
|
<span className="kol-sidenav-hop-label flex-1 min-w-0 text-left">
|
|
157
169
|
{MODE_LABEL[shown]}
|