ab-nextjs-components 0.1.13 โ†’ 0.1.14

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.
Files changed (53) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +30 -0
  3. package/ab-app-bar/index.tsx +39 -10
  4. package/ab-app-bar/styles.module.css +43 -4
  5. package/ab-bottom-drawer/index.tsx +71 -0
  6. package/ab-bottom-drawer/styles.module.css +66 -0
  7. package/ab-breadcrumbs/index.tsx +92 -0
  8. package/ab-breadcrumbs/styles.module.css +54 -0
  9. package/ab-button/helpers.ts +6 -1
  10. package/ab-button/index.tsx +8 -2
  11. package/ab-button/styles.module.css +39 -0
  12. package/ab-card/styles.module.css +1 -1
  13. package/ab-carousel/styles.module.css +1 -1
  14. package/ab-chip/index.tsx +16 -4
  15. package/ab-chip/styles.module.css +12 -1
  16. package/ab-confirm-drawer/index.tsx +97 -0
  17. package/ab-confirm-drawer/styles.module.css +41 -0
  18. package/ab-drawer/index.tsx +307 -0
  19. package/ab-drawer/styles.module.css +127 -0
  20. package/ab-drawer/use-ab-drawer.ts +89 -0
  21. package/ab-drawer-list/index.tsx +118 -0
  22. package/ab-drawer-list/styles.module.css +65 -0
  23. package/ab-flow-diagram/styles.module.css +2 -2
  24. package/ab-icon/builtin.ts +4 -0
  25. package/ab-icon-button/index.tsx +12 -1
  26. package/ab-icon-button/styles.module.css +1 -1
  27. package/ab-install-snippet/index.tsx +51 -29
  28. package/ab-install-snippet/styles.module.css +34 -2
  29. package/ab-kbd/styles.module.css +1 -1
  30. package/ab-list/index.tsx +107 -0
  31. package/ab-list/styles.module.css +82 -0
  32. package/ab-locale-switcher/index.tsx +42 -10
  33. package/ab-locale-switcher/styles.module.css +4 -4
  34. package/ab-navbar/styles.module.css +20 -2
  35. package/ab-navbar/view.tsx +7 -4
  36. package/ab-package-card/index.tsx +49 -2
  37. package/ab-package-card/styles.module.css +40 -0
  38. package/ab-search-trigger/index.tsx +17 -2
  39. package/ab-search-trigger/styles.module.css +27 -1
  40. package/ab-sidebar/index.tsx +5 -2
  41. package/ab-sidebar/styles.module.css +48 -5
  42. package/ab-sidebar/view.tsx +14 -4
  43. package/ab-theme-toggle/index.tsx +21 -6
  44. package/ab-theme-toggle/styles.module.css +18 -3
  45. package/ab-toc/index.tsx +9 -2
  46. package/ab-toc/styles.module.css +20 -8
  47. package/ab-version-switcher/index.tsx +143 -0
  48. package/ab-version-switcher/styles.module.css +76 -0
  49. package/index.ts +27 -0
  50. package/package.json +18 -3
  51. package/server/ab-button/index.tsx +6 -2
  52. package/server/ab-button/styles.module.css +39 -0
  53. package/types/index.d.ts +19 -0
@@ -66,6 +66,7 @@ export interface AbSidebarProps extends AbSidebarBaseProps {
66
66
  defaultCollapsed?: boolean; // ๐Ÿšช uncontrolled start
67
67
  onCollapsedChange?: (collapsed: boolean) => void; // ๐Ÿ””
68
68
  collapsible?: boolean; // ๐Ÿ”˜ show the collapse button (default true when sections are given)
69
+ collapseButtonVariant?: 'plain' | 'outlined'; // โช 0.1.14 (P9): 'outlined' = 32ร—32 bordered `<<` / `>>` (default 'plain' chevron)
69
70
  }
70
71
 
71
72
  /**
@@ -73,7 +74,8 @@ export interface AbSidebarProps extends AbSidebarBaseProps {
73
74
  * tooltips, and a collapse button (aria-expanded + aria-controls; hidden when JS is off).
74
75
  */
75
76
  const AbSidebar = (props: AbSidebarProps): ReactElement => {
76
- const { collapsed: controlled, defaultCollapsed = false, onCollapsedChange, collapsible, activeHref, page, labels, id = 'ab-sidebar-list' } = props;
77
+ const { collapsed: controlled, defaultCollapsed = false, onCollapsedChange, collapsible, collapseButtonVariant = 'plain', activeHref, page, labels, id = 'ab-sidebar-list' } = props;
78
+ const outlined = collapseButtonVariant === 'outlined'; // โช P9
77
79
  // ๐Ÿงญ route
78
80
  const appLocales = useAbLocales(); // ๐ŸŒ from AbLinkProvider
79
81
  const pathname = stripAbLocalePrefix(usePathname() ?? '', props.locales ?? appLocales); // ๐Ÿงญ `/fr/docs` โ†’ `/docs`
@@ -94,12 +96,13 @@ const AbSidebar = (props: AbSidebarProps): ReactElement => {
94
96
  type="button"
95
97
  className={styles.abSidebarToggle} // ๐Ÿ™ˆ hidden under (scripting: none)
96
98
  data-ab-part="collapse"
99
+ data-variant={outlined ? 'outlined' : undefined} // โช P9
97
100
  aria-expanded={!collapsed} // โ™ฟ
98
101
  aria-controls={id} // โ™ฟ
99
102
  aria-label={toggleLabel} // ๐Ÿท๏ธ
100
103
  onClick={() => setCollapsed(!collapsed)}
101
104
  >
102
- <AbIcon name={collapsed ? 'chevron_right' : 'chevron_left'} size={20} />
105
+ <AbIcon name={outlined ? (collapsed ? 'keyboard_double_arrow_right' : 'keyboard_double_arrow_left') : collapsed ? 'chevron_right' : 'chevron_left'} size={outlined ? 18 : 20} />
103
106
  </button>
104
107
  ) : undefined;
105
108
 
@@ -76,10 +76,10 @@
76
76
  color: inherit; /* ๐Ÿ–‹๏ธ */
77
77
  cursor: pointer; /* ๐Ÿ‘† */
78
78
  }
79
- .abSidebarToggle:hover { background: color-mix(in srgb, currentColor 8%, transparent); } /* ๐Ÿ–ฑ๏ธ */
79
+ .abSidebarToggle:hover { background: var(--ab-color-hover, color-mix(in srgb, currentColor 8%, transparent)); } /* ๐Ÿ–ฑ๏ธ */
80
80
  .abSidebarToggle:focus-visible,
81
81
  .abSidebarLink:focus-visible {
82
- outline: var(--ab-focus-ring-width, 2px) solid var(--ab-color-primary, #8f4c38); /* โ™ฟ */
82
+ outline: var(--ab-focus-ring-width, 2px) solid var(--ab-color-accent, var(--ab-color-primary, #8f4c38)); /* โ™ฟ */
83
83
  outline-offset: var(--ab-focus-ring-offset, 2px); /* โ™ฟ */
84
84
  }
85
85
  @media (scripting: none) {
@@ -125,10 +125,10 @@
125
125
  }
126
126
  .abSidebarLabel { min-width: 0; overflow-wrap: anywhere; } /* ๐Ÿšซ no overflow, ReactNode-friendly */
127
127
  .abSidebarLink[data-depth='1'] { padding-inline-start: 44px; font-size: 14px; } /* ๐ŸŒณ */
128
- .abSidebarLink:hover { background: color-mix(in srgb, currentColor 8%, transparent); } /* ๐Ÿ–ฑ๏ธ */
128
+ .abSidebarLink:hover { background: var(--ab-color-hover, color-mix(in srgb, currentColor 8%, transparent)); } /* ๐Ÿ–ฑ๏ธ */
129
129
  .abSidebarLink[data-active='true'] {
130
- background: var(--ab-color-secondary-container, color-mix(in srgb, #8f4c38 14%, transparent)); /* ๐ŸŽฏ */
131
- color: var(--ab-color-on-secondary-container, inherit); /* ๐Ÿ–‹๏ธ */
130
+ background: var(--ab-color-tint, var(--ab-color-secondary-container, color-mix(in srgb, #8f4c38 14%, transparent))); /* ๐ŸŽฏ */
131
+ color: var(--ab-color-accent-text, var(--ab-color-on-secondary-container, inherit)); /* ๐Ÿ–‹๏ธ */
132
132
  font-weight: 600; /* ๐Ÿ”ค */
133
133
  }
134
134
  .abSidebarIcon { flex: none; } /* ๐Ÿ”ฃ */
@@ -144,3 +144,46 @@
144
144
  .abSidebar[data-collapsed='true'] .abSidebarLink { width: 48px; justify-content: center; padding: 0; }
145
145
  .abSidebar[data-collapsed='true'] .abSidebarLabel,
146
146
  .abSidebar[data-collapsed='true'] .abSidebarBadge { display: none; }
147
+
148
+ /* ===== ๐Ÿ  0.1.14 (P8/P9, Home spec ยง4 sidebar) ===== */
149
+ .abSidebar[data-density='compact'] { max-width: none; gap: 0; padding: 0; } /* ๐Ÿ“ the pane sets the width (248 / 260 / 288) */
150
+ .abSidebar[data-density='compact'] .abSidebarHeader { min-height: 0; padding: 12px 10px 6px 16px; } /* ๐Ÿท๏ธ version switcher + collapse */
151
+ .abSidebar[data-density='compact'] .abSidebarSections { gap: 1px; padding: 4px 10px 16px; box-sizing: border-box; } /* ๐Ÿ“ฆ mock nav: 1px between every row and label */
152
+ .abSidebar[data-density='compact'] .abSidebarSection { gap: 1px; }
153
+ .abSidebar[data-density='compact'] .abSidebarList { gap: 1px; }
154
+ .abSidebar[data-density='compact'] .abSidebarHeading {
155
+ padding: 14px 10px 6px; font-size: 11px; font-weight: 700; line-height: 15px; letter-spacing: 0.06em; /* ๐Ÿ”ค 35px label row, like the mock */
156
+ color: var(--ab-color-faint, #807062); opacity: 1; /* ๐ŸŽจ AA faint */
157
+ }
158
+ .abSidebar[data-density='compact'] .abSidebarLink {
159
+ gap: 10px; min-height: 0; height: 32px; padding: 0 10px; box-sizing: border-box; /* ๐Ÿ“ */
160
+ font-family: inherit; font-size: 13.5px; font-weight: 500; line-height: 1.2; letter-spacing: 0; /* ๐Ÿ”ค Inter body */
161
+ color: var(--ab-color-muted, #6b5b50); /* ๐Ÿ–‹๏ธ */
162
+ }
163
+ .abSidebar[data-density='compact'] .abSidebarLink[data-size='sm'] { height: 30px; } /* ๐Ÿ“ฆ packages */
164
+ .abSidebar[data-density='compact'] .abSidebarLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; } /* โœ‚๏ธ one line */
165
+ .abSidebar[data-density='compact'] .abSidebarIcon { color: var(--ab-color-faint, #807062); } /* ๐Ÿ”ฃ */
166
+ .abSidebar[data-density='compact'] .abSidebarLink:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } /* ๐Ÿ–ฑ๏ธ */
167
+ .abSidebar[data-active-shape='rounded'] .abSidebarLink { border-radius: var(--ab-radius-row, 8px); } /* ๐Ÿ”ท */
168
+ .abSidebar[data-active-shape='rounded'] .abSidebarLink[data-active='true'] {
169
+ background: var(--ab-color-tint, #f4e7db); color: var(--ab-color-accent-text, #88603d); font-weight: 650; /* ๐ŸŽฏ */
170
+ }
171
+ .abSidebar[data-active-shape='rounded'] .abSidebarLink[data-active='true'] .abSidebarIcon { color: inherit; } /* ๐Ÿ”ฃ filled, accent */
172
+ .abSidebar[data-density='compact'] .abSidebarLink:focus-visible,
173
+ .abSidebar[data-density='compact'] .abSidebarToggle:focus-visible { outline-color: var(--ab-color-accent, #a67c52); outline-offset: -2px; } /* โ™ฟ inside the pane */
174
+ .abSidebar[data-badge='text'] .abSidebarBadge {
175
+ padding: 0; border-radius: 0; background: none; line-height: 1; /* ๐Ÿงน no chip */
176
+ font: 500 10.5px var(--ab-font-code, 'Roboto Mono', ui-monospace, monospace); color: var(--ab-color-faint, #807062); /* โŒจ๏ธ */
177
+ }
178
+ /* โ™ฟ James: faint on --tint is 3.9:1, so on the active row the text badge takes the row's --accent-text (โ‰ฅ 4.5:1 on tint) */
179
+ .abSidebar[data-badge='text'] .abSidebarLink[data-active='true'] .abSidebarBadge { color: inherit; }
180
+ /* โช P9: outlined collapse, 32ร—32, radius 8, 1px --border, --card, --muted */
181
+ .abSidebarToggle[data-variant='outlined'] {
182
+ width: 32px; height: 32px; box-sizing: border-box; flex: none; /* ๐Ÿ“ */
183
+ border: 1px solid var(--ab-color-border, rgb(92 64 48 / 0.13)); border-radius: var(--ab-radius-row, 8px); /* ๐Ÿ”ฒ */
184
+ background: var(--ab-color-card, #fff); color: var(--ab-color-muted, #6b5b50); /* ๐ŸŽจ */
185
+ }
186
+ .abSidebarToggle[data-variant='outlined']:hover { background: linear-gradient(var(--ab-color-hover, rgb(166 124 82 / 0.08)), var(--ab-color-hover, rgb(166 124 82 / 0.08))), var(--ab-color-card, #fff); } /* ๐Ÿ–ฑ๏ธ */
187
+ .abSidebar[data-density='compact'][data-collapsed='true'] .abSidebarHeader { padding: 12px 0 6px; justify-content: center; } /* ๐Ÿšช rail */
188
+ .abSidebar[data-density='compact'][data-collapsed='true'] .abSidebarSections { padding-inline: 8px; }
189
+ .abSidebar[data-density='compact'][data-collapsed='true'] .abSidebarLink { width: 40px; height: 40px; } /* ๐Ÿ‘† */
@@ -63,6 +63,7 @@ export interface AbSidebarSection {
63
63
  id: string; // ๐Ÿ†”
64
64
  label?: string; // ๐Ÿท๏ธ heading (omit for an unlabelled group)
65
65
  items: AbSidebarItem[]; // ๐Ÿ”—
66
+ itemSize?: 'md' | 'sm'; // ๐Ÿ“ 0.1.14 (P8): 'sm' = 30px rows + 16px icons (the Home PACKAGES group)
66
67
  }
67
68
 
68
69
  /** ๐Ÿ•ฐ๏ธ Legacy (โ‰ค 0.1.12) link shape; still accepted via `links`. */
@@ -93,6 +94,10 @@ export interface AbSidebarBaseProps {
93
94
  header?: ReactNode; // ๐Ÿท๏ธ top slot (brand, workspace switcherโ€ฆ)
94
95
  labels?: AbSidebarLabels; // ๐ŸŒ
95
96
  locales?: readonly string[]; // ๐ŸŒ 0.1.13: stripped from the pathname (default: AbLinkProvider's)
97
+ // ๐Ÿ  0.1.14 (P8, Home spec ยง4 sidebar)
98
+ density?: 'comfortable' | 'compact'; // ๐Ÿ“ 'compact' = 32px rows, 13.5/500, 18px icons, 11px group labels
99
+ activeShape?: 'pill' | 'rounded'; // ๐Ÿ”ท 'rounded' = 8px-radius --tint row (default 'pill')
100
+ badgeVariant?: 'chip' | 'text'; // ๐Ÿท๏ธ 'text' = plain mono 10.5 --faint meta (e.g. a version), no chip
96
101
  // ๐Ÿ•ฐ๏ธ legacy API (โ‰ค 0.1.12)
97
102
  type?: 'customer' | 'admin';
98
103
  page?: string;
@@ -121,13 +126,14 @@ export function AbSidebarView({ props, Icon, active, toggle }: {
121
126
  active: (href: string, legacyValue?: string) => boolean;
122
127
  toggle?: ReactNode;
123
128
  }): ReactElement {
124
- const { className, id = 'ab-sidebar-list', sections, collapsed = false, header, labels, type = 'customer', links, brandHref = '/', brandLabel = 'abElements' } = props;
129
+ const { className, id = 'ab-sidebar-list', sections, collapsed = false, header, labels, type = 'customer', links, brandHref = '/', brandLabel = 'abElements', density = 'comfortable', activeShape = 'pill', badgeVariant = 'chip' } = props;
130
+ const compact = density === 'compact'; // ๐Ÿ“ P8
125
131
  const groups = toAbSidebarSections(sections, links); // ๐Ÿ—‚๏ธ
126
132
  // ๐Ÿ•ฐ๏ธ legacy value lookup (page === link.value)
127
133
  const valueOf = (href: string) => links?.find((l) => l.href === href)?.value;
128
134
 
129
135
  // ๐Ÿ”— one item (+ children)
130
- const renderItem = (item: AbSidebarItem, depth: number): ReactElement => {
136
+ const renderItem = (item: AbSidebarItem, depth: number, small = false): ReactElement => {
131
137
  const on = active(item.href, valueOf(item.href)); // ๐ŸŽฏ
132
138
  const text = item.labelText ?? (typeof item.label === 'string' ? item.label : undefined); // โ™ฟ plain name
133
139
  const link = (
@@ -137,10 +143,11 @@ export function AbSidebarView({ props, Icon, active, toggle }: {
137
143
  data-ab-part="item"
138
144
  data-active={on ? 'true' : 'false'}
139
145
  data-depth={depth}
146
+ data-size={small ? 'sm' : undefined} // ๐Ÿ“ P8
140
147
  aria-current={on ? 'page' : undefined} // โ™ฟ
141
148
  aria-label={collapsed ? text : undefined} // โ™ฟ rail: the label is visually hidden
142
149
  >
143
- {item.icon && <Icon name={item.icon} variant={on ? 'filled' : 'outlined'} size={20} className={styles.abSidebarIcon} />}
150
+ {item.icon && <Icon name={item.icon} variant={on ? 'filled' : 'outlined'} size={compact ? (small ? 16 : 18) : 20} className={styles.abSidebarIcon} />}
144
151
  <span className={styles.abSidebarLabel}>{item.label}</span>
145
152
  {item.badge != null && <span className={styles.abSidebarBadge} data-ab-part="badge">{item.badge}</span>}
146
153
  </Link>
@@ -162,6 +169,9 @@ export function AbSidebarView({ props, Icon, active, toggle }: {
162
169
  data-ab-part={collapsed ? 'rail' : 'sidebar'} // ๐Ÿงฉ
163
170
  data-collapsed={collapsed ? 'true' : 'false'} // ๐Ÿšช
164
171
  className={clsx('AbSidebar', styles.abSidebar, className)} // ๐Ÿท๏ธ
172
+ data-density={compact ? 'compact' : undefined} // ๐Ÿ“ P8
173
+ data-active-shape={activeShape === 'rounded' ? 'rounded' : undefined} // ๐Ÿ”ท P8
174
+ data-badge={badgeVariant === 'text' ? 'text' : undefined} // ๐Ÿท๏ธ P8
165
175
  aria-label={labels?.nav ?? 'Sidebar'} // โ™ฟ
166
176
  >
167
177
  {/* ๐Ÿท๏ธ header slot, or the legacy brand link */}
@@ -173,7 +183,7 @@ export function AbSidebarView({ props, Icon, active, toggle }: {
173
183
  {groups.map((g) => (
174
184
  <section key={g.id} className={styles.abSidebarSection} data-ab-part="section" aria-labelledby={g.label ? `${id}-${g.id}` : undefined}>
175
185
  {g.label && <h2 id={`${id}-${g.id}`} className={styles.abSidebarHeading}>{g.label}</h2>}
176
- <ul className={styles.abSidebarList}>{g.items.map((it) => renderItem(it, 0))}</ul>
186
+ <ul className={styles.abSidebarList}>{g.items.map((it) => renderItem(it, 0, g.itemSize === 'sm'))}</ul>
177
187
  </section>
178
188
  ))}
179
189
  </div>
@@ -64,6 +64,9 @@ export interface AbThemeToggleLabels {
64
64
  light: string; // ๐ŸŒž "Light"
65
65
  dark: string; // ๐ŸŒ™ "Dark"
66
66
  system: string; // ๐Ÿ–ฅ๏ธ "System"
67
+ // ๐ŸŽฏ 0.1.14 (John): action names for the icon button when it shows the target mode,
68
+ // e.g. { dark: 'Switch to dark theme', light: 'Switch to light theme' }. Falls back to "Theme: Dark"
69
+ switchTo?: Partial<Record<AbThemeMode, string>>;
67
70
  }
68
71
 
69
72
  // โš™๏ธ props
@@ -76,6 +79,10 @@ export interface AbThemeToggleProps {
76
79
  defaultMode?: AbThemeMode; // ๐ŸŒฑ before hydration (default 'light')
77
80
  icons?: Partial<Record<AbThemeMode, ReactNode>>; // ๐Ÿ–ผ๏ธ override glyphs
78
81
  size?: 'sm' | 'md'; // ๐Ÿ“ sm = 32px, md = 40px segments (hit area โ‰ฅ 24px either way)
82
+ appearance?: 'fill' | 'thumb'; // ๐ŸŒ— 0.1.14 (P7): 'thumb' = the Home pill (28px segments, raised card thumb, filled active glyph). Default 'fill'
83
+ // ๐ŸŽฏ 0.1.14 (John): icon variant only. 'target' = glyph + name of the mode a click switches TO
84
+ // (moon in light, sun in dark, like the Home mock). Default 'target' with appearance="thumb", else 'current' (unchanged)
85
+ iconShows?: 'current' | 'target';
79
86
  className?: string; // ๐Ÿท๏ธ
80
87
  style?: CSSProperties; // ๐ŸŽจ
81
88
  }
@@ -100,7 +107,8 @@ export function getNextAbThemeMode(modes: readonly AbThemeMode[], current: AbThe
100
107
 
101
108
  export function AbThemeToggle(props: AbThemeToggleProps) {
102
109
  // ๐Ÿงฉ props
103
- const { labels, variant = 'segmented', modes = AB_THEME_MODES, value, onChange, defaultMode = 'light', icons, size = 'md', className, style } = props;
110
+ const { labels, variant = 'segmented', modes = AB_THEME_MODES, value, onChange, defaultMode = 'light', icons, size = 'md', appearance = 'fill', iconShows, className, style } = props;
111
+ const thumb = appearance === 'thumb'; // ๐ŸŒ— P7
104
112
  // ๐ŸŒ— engine: persists + applies to <html>
105
113
  const engine = useAbThemeMode(defaultMode);
106
114
  // ๐ŸŽ›๏ธ controlled or engine-driven
@@ -115,11 +123,15 @@ export function AbThemeToggle(props: AbThemeToggleProps) {
115
123
  };
116
124
 
117
125
  // ๐Ÿ–ผ๏ธ glyph for a mode (decorative: the label names it)
118
- const glyph = (mode: AbThemeMode) => icons?.[mode] ?? <AbIcon name={DEFAULT_ICON_NAMES[mode]} size={20} />;
126
+ // P7 thumb: 17px (segments) / 22px (mobile icon), filled while active (spec ยง2 icons)
127
+ const glyph = (mode: AbThemeMode, active = false) =>
128
+ icons?.[mode] ?? <AbIcon name={DEFAULT_ICON_NAMES[mode]} size={thumb ? (variant === 'icon' ? 22 : 17) : 20} variant={thumb && active ? 'filled' : undefined} />;
119
129
 
120
130
  // ๐Ÿ”˜ single cycling button variant
121
131
  if (variant === 'icon') {
122
132
  const next = modes[(Math.max(0, modes.indexOf(current)) + 1) % modes.length]; // โญ๏ธ
133
+ const target = (iconShows ?? (thumb ? 'target' : 'current')) === 'target'; // ๐ŸŽฏ John: Home mock shows the target
134
+ const name = target ? (labels.switchTo?.[next] ?? `${labels.group}: ${labels[next]}`) : `${labels.group}: ${labels[current]}`; // โ™ฟ
123
135
  return (
124
136
  <button
125
137
  type="button" // ๐Ÿงพ
@@ -128,11 +140,13 @@ export function AbThemeToggle(props: AbThemeToggleProps) {
128
140
  data-ab-part="theme-toggle" // ๐Ÿ—‚๏ธ
129
141
  data-mode={current} // ๐ŸŽš๏ธ
130
142
  data-size={size} // ๐Ÿ“
131
- aria-label={`${labels.group}: ${labels[current]}`} // โ™ฟ "Theme: Dark"
132
- title={`${labels.group}: ${labels[current]}`} // ๐Ÿ’ฌ
143
+ data-appearance={thumb ? 'thumb' : undefined} // ๐ŸŒ— P7
144
+ data-shows={target ? 'target' : 'current'} // ๐ŸŽฏ
145
+ aria-label={name} // โ™ฟ "Switch to dark theme" (target) / "Theme: Dark" (current)
146
+ title={name} // ๐Ÿ’ฌ
133
147
  onClick={() => select(next)} // ๐Ÿ”
134
148
  >
135
- <span aria-hidden="true">{glyph(current)}</span>
149
+ <span aria-hidden="true">{glyph(target ? next : current)}</span>
136
150
  </button>
137
151
  );
138
152
  }
@@ -157,6 +171,7 @@ export function AbThemeToggle(props: AbThemeToggleProps) {
157
171
  data-ab-part="theme-toggle" // ๐Ÿ—‚๏ธ
158
172
  data-mode={current} // ๐ŸŽš๏ธ
159
173
  data-size={size} // ๐Ÿ“
174
+ data-appearance={thumb ? 'thumb' : undefined} // ๐ŸŒ— P7
160
175
  onKeyDown={onKeyDown} // โŒจ๏ธ
161
176
  >
162
177
  {modes.map((mode, i) => {
@@ -176,7 +191,7 @@ export function AbThemeToggle(props: AbThemeToggleProps) {
176
191
  data-mode={mode} // ๐ŸŽš๏ธ
177
192
  onClick={() => select(mode)} // ๐Ÿ–ฑ๏ธ
178
193
  >
179
- <span aria-hidden="true">{glyph(mode)}</span>
194
+ <span aria-hidden="true">{glyph(mode, checked)}</span>
180
195
  </button>
181
196
  );
182
197
  })}
@@ -42,7 +42,7 @@
42
42
  gap: 2px; /* ๐Ÿงฑ */
43
43
  padding: 3px; /* ๐Ÿงฑ */
44
44
  border-radius: 9999px; /* ๐Ÿ’Š */
45
- border: 1px solid var(--ab-color-outline-variant, rgb(0 0 0 / 0.12)); /* ๐Ÿ–Š๏ธ */
45
+ border: 1px solid var(--ab-color-border, var(--ab-color-outline-variant, rgb(0 0 0 / 0.12))); /* ๐Ÿ–Š๏ธ */
46
46
  background: var(--ab-color-surface-container, transparent); /* ๐ŸŽจ */
47
47
  }
48
48
 
@@ -76,14 +76,29 @@
76
76
  /* ๐Ÿ–ฑ๏ธ hover (unselected only) */
77
77
  .segment[aria-checked='false']:hover,
78
78
  .icon:hover {
79
- background: color-mix(in srgb, currentColor 10%, transparent); /* ๐ŸŒซ๏ธ */
79
+ background: var(--ab-color-hover, color-mix(in srgb, currentColor 10%, transparent)); /* ๐ŸŒซ๏ธ */
80
80
  }
81
81
 
82
82
  /* โ™ฟ visible focus ring (theme token, G18) */
83
83
  .segment:focus-visible,
84
84
  .icon:focus-visible {
85
- outline: 2px solid var(--ab-focus-ring, var(--ab-color-primary, #A67C52)); /* ๐Ÿ’ */
85
+ outline: 2px solid var(--ab-color-accent, var(--ab-focus-ring, var(--ab-color-primary, #A67C52))); /* ๐Ÿ’ */
86
86
  outline-offset: 2px; /* โ†”๏ธ */
87
87
  }
88
88
 
89
89
  /* ๐Ÿง˜ reduced motion: handled by ab-nextjs-animations (.ab-motion-colors) */
90
+
91
+ /* ===== ๐ŸŒ— 0.1.14 (P7, Home spec ยง4): appearance="thumb" ===== */
92
+ .group[data-appearance='thumb'] {
93
+ gap: 2px; padding: 3px; border-radius: var(--ab-radius-pill, 999px); /* ๐Ÿ’Š */
94
+ border: 1px solid var(--ab-color-border, rgb(92 64 48 / 0.13)); background: var(--ab-color-card2, #fbf3ec); /* ๐ŸŽจ */
95
+ }
96
+ .group[data-appearance='thumb'] .segment { width: 28px; height: 28px; color: var(--ab-color-faint, #807062); } /* ๐Ÿ“ โ‰ฅ 24px target */
97
+ .group[data-appearance='thumb'] .segment[aria-checked='true'] {
98
+ background: var(--ab-color-thumb, #fff); color: var(--ab-color-accent-text, #88603d); /* ๐ŸŒ— dark thumb #3a2b1f (theme) */
99
+ box-shadow: var(--ab-shadow-thumb, 0 1px 3px rgb(33 26 22 / 0.12)); /* โœจ */
100
+ }
101
+ .group[data-appearance='thumb'] .segment[aria-checked='false']:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } /* ๐Ÿ–ฑ๏ธ */
102
+ .group[data-appearance='thumb'] .segment:focus-visible, .icon[data-appearance='thumb']:focus-visible { outline-color: var(--ab-color-accent, #a67c52); } /* โ™ฟ */
103
+ .icon[data-appearance='thumb'] { width: 40px; height: 40px; border-radius: var(--ab-radius-button, 10px); color: var(--ab-color-muted, #6b5b50); } /* ๐Ÿ“ฑ mobile 40ร—40, 22px glyph */
104
+ .icon[data-appearance='thumb']:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); }
package/ab-toc/index.tsx CHANGED
@@ -45,7 +45,7 @@
45
45
  */
46
46
 
47
47
  // โš›๏ธ React
48
- import type { ReactElement } from 'react';
48
+ import type { ReactElement, ReactNode } from 'react';
49
49
  // ๐Ÿงต classes
50
50
  import clsx from 'clsx';
51
51
  // ๐ŸŽจ styles
@@ -84,6 +84,7 @@ export interface AbTocProps {
84
84
  onNavigate?: (id: string) => void; // ๐Ÿ”” e.g. scrollToAbSection(id, { container }) (hooks 0.1.7); without it a plain #id jump, which scrolls the nearest scroller (the main pane in core 0.1.6 panes)
85
85
  id?: string; // ๐Ÿ†” root id (default "ab-toc"); the title gets `${id}-title`
86
86
  className?: string; // ๐Ÿท๏ธ
87
+ footer?: ReactNode; // ๐Ÿงฉ 0.1.14 (P14): below the list after a 1px rule (Edit this page ยท Changelog ยท a promo card); links get the 12.5px Home style
87
88
  }
88
89
 
89
90
  /**
@@ -91,7 +92,7 @@ export interface AbTocProps {
91
92
  * aria-current="location". Pair with `useAbScrollSpy` from ab-nextjs-hooks 0.1.7 for `activeId`.
92
93
  * No hooks here, so it also renders on the server.
93
94
  */
94
- const AbToc = ({ items, activeId, label, title = label ?? 'On this page', onNavigate, id = 'ab-toc', className }: AbTocProps): ReactElement | null => {
95
+ const AbToc = ({ items, activeId, label, title = label ?? 'On this page', onNavigate, id = 'ab-toc', className, footer }: AbTocProps): ReactElement | null => {
95
96
  if (!items.length) return null; // ๐Ÿ™ˆ nothing to list
96
97
  const headingId = `${id}-title`; // ๐Ÿ†”
97
98
  return (
@@ -115,6 +116,12 @@ const AbToc = ({ items, activeId, label, title = label ?? 'On this page', onNavi
115
116
  );
116
117
  })}
117
118
  </ol>
119
+ {footer != null && (
120
+ <>
121
+ <hr className={styles.abTocSep} />{/* โž– mock .toc-sep */}
122
+ <div className={styles.abTocFooter} data-ab-part="toc-footer">{footer}</div>
123
+ </>
124
+ )}
118
125
  </nav>
119
126
  );
120
127
  };
@@ -36,19 +36,31 @@
36
36
  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37
37
  */
38
38
 
39
- .abToc { font-size: 14px; } /* ๐Ÿ“‘ */
40
- .abTocTitle { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.75; } /* ๐Ÿท๏ธ */
41
- .abTocList { list-style: none; margin: 0; padding: 0; border-inline-start: var(--ab-divider-hairline, 1px solid rgb(0 0 0 / 0.12)); } /* โž– */
39
+ /* ๐Ÿ“‘ 0.1.14 (P14 + token move): the Home TOC (spec ยง4), on the theme 0.3.5 tokens, M3 fallbacks kept */
40
+ .abToc { font-size: 13px; } /* ๐Ÿ“‘ */
41
+ .abTocTitle { margin: 0 0 10px; font-size: 11px; font-weight: 700; line-height: 15px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ab-color-faint, var(--ab-color-on-surface-variant, inherit)); } /* ๐Ÿท๏ธ "ON THIS PAGE" */
42
+ .abTocList { list-style: none; margin: 0; padding: 0; border-inline-start: 1px solid var(--ab-color-div, rgb(0 0 0 / 0.12)); } /* โž– rail */
42
43
  .abTocList > li[data-level='3'] { padding-inline-start: 12px; } /* ๐Ÿ“ */
43
44
  .abTocList > li[data-level='4'] { padding-inline-start: 24px; } /* ๐Ÿ“ */
44
45
  .abTocLink {
45
46
  display: block; /* ๐Ÿ“ */
46
47
  margin-inline-start: -1px; /* โž– sit on the rail */
47
- padding: 4px 12px; /* ๐Ÿ“ฆ */
48
+ padding: 6px 0 6px 14px; /* ๐Ÿ“ฆ mock */
49
+ line-height: 18px; /* ๐Ÿ“ 30px rows (WebKit-measured against the mock) */
48
50
  border-inline-start: 2px solid transparent; /* โž– */
49
- color: var(--ab-color-on-surface-variant, inherit); /* ๐Ÿ–‹๏ธ */
51
+ color: var(--ab-color-muted, var(--ab-color-on-surface-variant, inherit)); /* ๐Ÿ–‹๏ธ */
50
52
  text-decoration: none; /* ๐Ÿšซ */
51
53
  }
52
- .abTocLink:hover { color: var(--ab-color-on-surface, inherit); } /* ๐Ÿ–ฑ๏ธ */
53
- .abTocLink[data-active='true'] { border-inline-start-color: var(--ab-color-primary, currentColor); color: var(--ab-color-primary, inherit); font-weight: 600; } /* ๐ŸŽฏ */
54
- .abTocLink:focus-visible { outline: var(--ab-focus-ring-width, 2px) solid var(--ab-color-primary, #8f4c38); outline-offset: var(--ab-focus-ring-offset, 2px); } /* โ™ฟ */
54
+ .abTocLink:hover { color: var(--ab-color-text, var(--ab-color-on-surface, inherit)); } /* ๐Ÿ–ฑ๏ธ */
55
+ .abTocLink[data-active='true'] { border-inline-start-color: var(--ab-color-accent, var(--ab-color-primary, currentColor)); color: var(--ab-color-accent-text, var(--ab-color-primary, inherit)); font-weight: 650; } /* ๐ŸŽฏ */
56
+ .abTocLink:focus-visible { outline: 2px solid var(--ab-color-accent, var(--ab-color-primary, #8f4c38)); outline-offset: -2px; } /* โ™ฟ */
57
+ /* ๐Ÿงฉ P14 footer */
58
+ .abTocSep { height: 1px; margin: 18px 0 12px; border: 0; background: var(--ab-color-div, rgb(0 0 0 / 0.12)); } /* โž– */
59
+ .abTocFooter > a, .abTocFooter > p > a, .abTocFooter > ul > li > a {
60
+ display: flex; align-items: center; gap: 8px; padding: 5px 0; /* ๐Ÿ“ */
61
+ font-size: 12.5px; line-height: 17px; color: var(--ab-color-muted, inherit); text-decoration: none; /* ๐Ÿ”ค 27px rows */
62
+ }
63
+ .abTocFooter a:hover { color: var(--ab-color-accent-text, inherit); } /* ๐Ÿ–ฑ๏ธ */
64
+ .abTocFooter a:focus-visible { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: 2px; border-radius: 4px; } /* โ™ฟ */
65
+ .abTocFooter a svg { flex: none; width: 15px; height: 15px; color: var(--ab-color-faint, inherit); } /* ๐Ÿ”ฃ GitHub ยท north_east */
66
+ .abTocFooter > ul { list-style: none; margin: 0; padding: 0; }
@@ -0,0 +1,143 @@
1
+ /*
2
+ * @license MIT
3
+ * ~~~~~~~~~~~~
4
+ * ab-nextjs-components
5
+ * ~~~~~~~~~~~~
6
+ * Copyright (c) 2026 Abraham Ukachi. The abElements Project.
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the 'Software'), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * @project: ab-nextjs-components
27
+ * @name: AbVersionSwitcher (P9)
28
+ * @file: ab-version-switcher/index.tsx
29
+ * @type: Client component
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ *
32
+ * Example usage:
33
+ * 1+|> <AbVersionSwitcher label="Docs" version="v0.2.x" versions={[{ value: "v0.2.x", href: "/docs" }, { value: "v0.1.x", href: "/v0.1/docs" }]} />
34
+ */
35
+
36
+ /*
37
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
38
+ * MOTTO: We'll always do more ๐Ÿ˜œ!!!
39
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
40
+ */
41
+
42
+
43
+ 'use client';
44
+
45
+ // โš›๏ธ React
46
+ import { useEffect, useId, useRef, useState, type ReactElement } from 'react';
47
+ // ๐Ÿงต classes
48
+ import clsx from 'clsx';
49
+ // ๐Ÿ”ฃ icons
50
+ import AbIcon from '../ab-icon';
51
+ // ๐Ÿ“‹ the menu it opens (spec ยง5: "opens AbMenu")
52
+ import AbMenu from '../ab-menu';
53
+ // ๐ŸŽจ styles
54
+ import styles from './styles.module.css';
55
+
56
+ /** ๐Ÿท๏ธ one version */
57
+ export interface AbVersionOption {
58
+ value: string; // ๐Ÿ†” e.g. 'v0.2.x'
59
+ label?: string; // ๐Ÿท๏ธ menu text (default: value)
60
+ href?: string; // ๐Ÿ”— real navigation (works without JS via the <details> fallback)
61
+ }
62
+
63
+ /** โš™๏ธ props */
64
+ export interface AbVersionSwitcherProps {
65
+ label?: string; // ๐Ÿท๏ธ default "Docs"
66
+ version: string; // โœ… current version (shown bold), e.g. 'v0.2.x'
67
+ versions?: readonly AbVersionOption[]; // ๐Ÿ“‹ the choices (none / one = a static label, no menu)
68
+ onSelect?: (value: string) => void; // ๐Ÿ“ฃ button items
69
+ menuLabel?: string; // โ™ฟ accessible name of the trigger (default "{label} {version}": contains the visible text, WCAG 2.5.3)
70
+ className?: string; // ๐Ÿท๏ธ
71
+ }
72
+
73
+ /**
74
+ * ๐Ÿท๏ธ AbVersionSwitcher (P9): the sidebar's "Docs **v0.2.x** โ–พ" control. 28px, 8px radius, hairline border,
75
+ * card background, 16px `expand_more`; opens an AbMenu below it (Escape / outside click close, focus returns).
76
+ * JS off: with `href`s it's a native `<details>` list of links.
77
+ */
78
+ const AbVersionSwitcher = ({ label = 'Docs', version, versions = [], onSelect, menuLabel, className }: AbVersionSwitcherProps): ReactElement => {
79
+ const [open, setOpen] = useState(false); // ๐Ÿšช
80
+ const menuId = `ab-version-menu-${useId().replace(/:/g, '')}`; // ๐Ÿ†”
81
+ const wrap = useRef<HTMLDivElement>(null); // ๐Ÿ“
82
+ const btn = useRef<HTMLButtonElement>(null); // ๐Ÿ“
83
+ const name = menuLabel ?? `${label} ${version}`; // โ™ฟ WCAG 2.5.3 label-in-name (James)
84
+ const hasMenu = versions.length > 1; // ๐Ÿ“‹
85
+
86
+ // โŽ‹ Escape + outside click close it
87
+ useEffect(() => {
88
+ if (!open) return;
89
+ const onKey = (e: KeyboardEvent) => { if (e.key === 'Escape') { setOpen(false); btn.current?.focus(); } }; // โŽ‹ + โ†ฉ๏ธ
90
+ const onDown = (e: PointerEvent) => { if (!wrap.current?.contains(e.target as Node)) setOpen(false); }; // ๐Ÿ‘‹
91
+ document.addEventListener('keydown', onKey);
92
+ document.addEventListener('pointerdown', onDown);
93
+ return () => { document.removeEventListener('keydown', onKey); document.removeEventListener('pointerdown', onDown); };
94
+ }, [open]);
95
+
96
+ // ๐Ÿงฑ the visible face (same for button, static label and no-JS summary)
97
+ const face = (
98
+ <>
99
+ <span>{label}</span> <b className={styles.abVersionValue}>{version}</b>
100
+ {hasMenu && <AbIcon name="expand_more" size={16} className={styles.abVersionIcon} />}
101
+ </>
102
+ );
103
+
104
+ if (!hasMenu) return <span className={clsx('AbVersionSwitcher', styles.abVersion, className)} data-ab-part="version-switcher">{face}</span>; // ๐Ÿท๏ธ static
105
+
106
+ const linksOnly = versions.every((v) => v.href); // ๐Ÿ”— can it work without JS?
107
+ return (
108
+ <div ref={wrap} className={clsx('AbVersionSwitcher', styles.abVersionRoot, className)} data-ab-part="version-switcher">
109
+ <button
110
+ ref={btn}
111
+ type="button"
112
+ className={clsx(styles.abVersion, linksOnly && styles.abVersionJs)}
113
+ aria-label={name}
114
+ aria-haspopup="menu"
115
+ aria-expanded={open}
116
+ aria-controls={menuId}
117
+ onClick={() => setOpen((o) => !o)}
118
+ >
119
+ {face}
120
+ </button>
121
+ <AbMenu
122
+ id={menuId}
123
+ hidden={!open}
124
+ isActive={open}
125
+ className={styles.abVersionMenu}
126
+ items={versions.map((v) => ({ id: v.value, label: v.label ?? v.value, href: v.href, selected: v.value === version, onClick: () => { onSelect?.(v.value); setOpen(false); } }))}
127
+ />
128
+ {/* ๐Ÿšซ JS off: a native <details> of links (CSS shows it only under scripting: none) */}
129
+ {linksOnly && (
130
+ <details className={styles.abVersionNoJs} data-ab-part="version-switcher-nojs">
131
+ <summary className={styles.abVersion} aria-label={name}>{face}</summary>
132
+ <ul className={styles.abVersionNoJsList}>
133
+ {versions.map((v) => <li key={v.value}><a href={v.href} aria-current={v.value === version ? 'page' : undefined}>{v.label ?? v.value}</a></li>)}
134
+ </ul>
135
+ </details>
136
+ )}
137
+ </div>
138
+ );
139
+ };
140
+
141
+ // ๐Ÿ“ฆ exports
142
+ export default AbVersionSwitcher;
143
+ export { AbVersionSwitcher };
@@ -0,0 +1,76 @@
1
+ /*
2
+ * @license MIT
3
+ * ~~~~~~~~~~~~
4
+ * ab-nextjs-components
5
+ * ~~~~~~~~~~~~
6
+ * Copyright (c) 2026 Abraham Ukachi. The abElements Project.
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the 'Software'), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * @project: ab-nextjs-components
27
+ * @name: AbVersionSwitcher styles
28
+ * @file: ab-version-switcher/styles.module.css
29
+ * @type: CSS module
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ */
32
+
33
+ /*
34
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
35
+ * MOTTO: We'll always do more ๐Ÿ˜œ!!!
36
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37
+ */
38
+
39
+
40
+ /* ๐ŸŽš๏ธ knobs (defaults = the approved mock, mapped onto today's theme tokens) */
41
+ .abVersion, .abVersionRoot {
42
+ --ab-version-height: 28px; /* ๐Ÿ“ */
43
+ --ab-version-radius: 8px; /* โญ• */
44
+ --ab-version-background: var(--ab-color-card, var(--md-sys-color-surface-container-lowest, #fff)); /* ๐ŸŽจ --card */
45
+ --ab-version-border: var(--ab-color-border, var(--ab-color-outline-variant, rgb(92 64 48 / 0.13))); /* โž– --border */
46
+ --ab-version-color: var(--ab-color-muted, var(--ab-color-on-surface-variant, #6b5b50)); /* ๐Ÿ–‹๏ธ --muted */
47
+ --ab-version-strong: var(--ab-color-text, var(--ab-color-on-surface, #211a16)); /* ๐Ÿ–‹๏ธ --text */
48
+ --ab-version-hover: var(--ab-color-hover, color-mix(in srgb, var(--ab-color-bronze, #a67c52) 8%, transparent)); /* ๐Ÿ–ฑ๏ธ --hover */
49
+ --ab-version-ring: var(--ab-color-accent, var(--ab-color-bronze, #a67c52)); /* โ™ฟ --accent */
50
+ }
51
+ .abVersionRoot { position: relative; display: inline-block; } /* ๐Ÿ“ menu anchor */
52
+ .abVersion {
53
+ display: inline-flex; align-items: center; gap: 4px; /* ๐Ÿ“ */
54
+ box-sizing: border-box; height: var(--ab-version-height); padding: 0 6px 0 10px; /* ๐Ÿ“ฆ */
55
+ border: 1px solid var(--ab-version-border); border-radius: var(--ab-version-radius); /* โž– */
56
+ background: var(--ab-version-background); color: var(--ab-version-color); /* ๐ŸŽจ */
57
+ font: inherit; font-size: 12px; line-height: 1; white-space: nowrap; /* ๐Ÿ”ค */
58
+ cursor: pointer; list-style: none; /* ๐Ÿ–ฑ๏ธ (summary: no marker) */
59
+ }
60
+ .abVersion::-webkit-details-marker { display: none; } /* ๐Ÿงน */
61
+ span.abVersion { cursor: default; } /* ๐Ÿท๏ธ static */
62
+ .abVersion:hover { background: linear-gradient(var(--ab-version-hover), var(--ab-version-hover)), var(--ab-version-background); } /* ๐Ÿ–ฑ๏ธ */
63
+ .abVersion:focus-visible { outline: 2px solid var(--ab-version-ring); outline-offset: 2px; } /* โ™ฟ */
64
+ .abVersionValue { color: var(--ab-version-strong); font-weight: 650; } /* ๐Ÿ’ช */
65
+ .abVersionIcon { width: 16px; height: 16px; } /* โ–พ */
66
+ .abVersionMenu[hidden] { display: none; } /* ๐Ÿ™ˆ AbMenu's own display would beat [hidden] */
67
+ .abVersionMenu { position: absolute; inset-block-start: calc(100% + 4px); inset-inline-start: 0; z-index: 20; min-width: 160px; } /* ๐Ÿ“‹ */
68
+
69
+ /* ๐Ÿšซ no-JS: the details list replaces the button */
70
+ .abVersionNoJs { display: none; }
71
+ .abVersionNoJsList { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--ab-version-border); border-radius: 8px; background: var(--ab-version-background); font-size: 13px; }
72
+ .abVersionNoJsList a { display: block; padding: 6px 8px; color: inherit; text-decoration: none; }
73
+ @media (scripting: none) {
74
+ .abVersionJs, .abVersionMenu { display: none; }
75
+ .abVersionNoJs { display: block; }
76
+ }