@kolkrabbi/kol-framework 0.5.1 → 0.5.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-framework",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
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",
@@ -5,9 +5,9 @@ import { useTheme } from './theme.js'
5
5
  * Theme toggle — horizontal icon-swap button.
6
6
  *
7
7
  * Variants:
8
- * icon — minimal 32×32 icon-only button (no container chrome). For
9
- * top-bar / nav-bar use where the toggle sits inline with other
10
- * icon buttons.
8
+ * icon — icon-only button on the DS button ladder: `size` 'sm'|'md'|'lg'
9
+ * → 14/16/18px glyph, box + hover from the ghost .kol-btn chrome,
10
+ * so the toggle sizes exactly like sibling icon buttons in a bar.
11
11
  * hop — full-width labeled Button-primary-styled sidenav row
12
12
  * (bg-fg-04, on-primary text). For sidenav rows where it pairs
13
13
  * with other Button-primary "hop" entries.
@@ -22,7 +22,7 @@ import { useTheme } from './theme.js'
22
22
  * horizontally — the split-circle glyph makes the slide itself read as
23
23
  * the flip (same-icon slide, per design).
24
24
  */
25
- export default function ThemeToggle({ variant = 'icon', className = '' }) {
25
+ export default function ThemeToggle({ variant = 'icon', size = 'md', className = '' }) {
26
26
  const { isDark, toggle } = useTheme()
27
27
 
28
28
  const next = isDark ? 'light' : 'dark'
@@ -69,17 +69,20 @@ export default function ThemeToggle({ variant = 'icon', className = '' }) {
69
69
  )
70
70
  }
71
71
 
72
- // variant === 'icon' (default) — 36×36 button / 20px glyph, the DS reference
73
- // (user-verified 2026-07-15; was 32/18, which consumers shimmed via CSS)
72
+ // variant === 'icon' (default) — geometry from the DS button ladder
73
+ // (sm 14 / md 16 / lg 18 glyph), chrome = ghost icon-only .kol-btn.
74
+ // Overrules the 2026-07-15 "36×36/20 reference" one-off (user ruling
75
+ // 2026-07-28: the button ladder is the reference, bar icons included).
76
+ const glyph = size === 'sm' ? 14 : size === 'lg' ? 18 : 16
74
77
  return (
75
78
  <button
76
79
  type="button"
77
80
  onClick={handleToggle}
78
81
  aria-label={`Switch to ${next} mode`}
79
82
  title={`Switch to ${next} mode`}
80
- className={`inline-flex items-center justify-center w-9 h-9 p-0 bg-transparent border-0 cursor-pointer text-emphasis hover:opacity-80 transition-opacity duration-300 ${className}`.trim()}
83
+ className={`kol-btn kol-btn-ghost kol-btn-${size} kol-btn-icon ${className}`.trim()}
81
84
  >
82
- {iconSwap(20)}
85
+ {iconSwap(glyph)}
83
86
  </button>
84
87
  )
85
88
  }