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
@@ -0,0 +1,107 @@
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: AbList + AbListItem (P13)
28
+ * @file: ab-list/index.tsx
29
+ * @type: Server-safe component
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ *
32
+ * Example usage:
33
+ * 1+|> <AbList><AbListItem href="/guides/install" media={<AbIcon name="rocket_launch" />} title="Install AbElements" meta="Getting started" trailing="chevron" /></AbList>
34
+ */
35
+
36
+ /*
37
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
38
+ * MOTTO: We'll always do more ๐Ÿ˜œ!!!
39
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
40
+ */
41
+
42
+
43
+ // โš›๏ธ React
44
+ import type { ReactElement, ReactNode } from 'react';
45
+ // ๐Ÿงต classes
46
+ import clsx from 'clsx';
47
+ // ๐Ÿ”— the app's link
48
+ import Link from '../ab-link';
49
+ // ๐Ÿ”ฃ the default chevron
50
+ import AbIcon from '../ab-icon';
51
+ // ๐ŸŽจ styles
52
+ import styles from './styles.module.css';
53
+
54
+ /** โš™๏ธ AbList props */
55
+ export interface AbListProps {
56
+ children: ReactNode; // ๐Ÿ“‹ AbListItem rows
57
+ label?: string; // โ™ฟ optional list name
58
+ className?: string; // ๐Ÿท๏ธ
59
+ }
60
+
61
+ /** โš™๏ธ AbListItem props */
62
+ export interface AbListItemProps {
63
+ title: ReactNode; // ๐Ÿ’ช 13.5/600, one line with ellipsis
64
+ meta?: ReactNode; // ๐Ÿงพ 12px faint subline (`<code>` inside = 11px mono muted)
65
+ media?: ReactNode; // ๐Ÿ–ผ๏ธ an icon: shown in a 30px tile (card2 bg, accent-text, 18px)
66
+ badge?: ReactNode; // ๐Ÿท๏ธ a leading 64ร—22 badge instead of media ("New", "Improved")
67
+ badgeTone?: 'primary' | 'tonal'; // ๐ŸŽจ primary = button colours ("New"), tonal = tint ("Improved", default)
68
+ trailing?: 'chevron' | ReactNode; // โžก๏ธ 'chevron' = 18px faint chevron_right
69
+ href?: string; // ๐Ÿ”— the whole row becomes one link
70
+ className?: string; // ๐Ÿท๏ธ
71
+ }
72
+
73
+ /**
74
+ * ๐Ÿ“‹ AbList (P13): one bordered card of rows (Guides, What's new). Radius 14, hairline border, card bg,
75
+ * soft shadow, rows divided by `--div`. Server-safe.
76
+ */
77
+ const AbList = ({ children, label, className }: AbListProps): ReactElement => (
78
+ <ul className={clsx('AbList', styles.abList, className)} aria-label={label} data-ab-part="list">{children}</ul>
79
+ );
80
+
81
+ /**
82
+ * ๐Ÿ“„ AbListItem: `media | badge` ยท title + meta ยท `trailing`. A row with `href` is a single link (hover
83
+ * `--hover`, focus-visible inset 2px accent ring). Rows are at least 44px tall (touch target).
84
+ */
85
+ const AbListItem = ({ title, meta, media, badge, badgeTone = 'tonal', trailing, href, className }: AbListItemProps): ReactElement => {
86
+ const body = (
87
+ <>
88
+ {badge != null ? <span className={styles.abListBadge} data-tone={badgeTone}>{badge}</span>
89
+ : media != null ? <span className={styles.abListMedia} aria-hidden="true">{media}</span> : null}
90
+ <span className={styles.abListText}>
91
+ <span className={styles.abListTitle}>{title}</span>
92
+ {meta != null && <span className={styles.abListMeta}>{meta}</span>}
93
+ </span>
94
+ {trailing === 'chevron' ? <AbIcon name="chevron_right" size={18} className={styles.abListChevron} />
95
+ : trailing != null ? <span className={styles.abListTrailing}>{trailing}</span> : null}
96
+ </>
97
+ );
98
+ return (
99
+ <li className={clsx('AbListItem', styles.abListItem, className)} data-ab-part="list-item">
100
+ {href ? <Link href={href} className={styles.abListRow} data-link="true">{body}</Link> : <div className={styles.abListRow}>{body}</div>}
101
+ </li>
102
+ );
103
+ };
104
+
105
+ // ๐Ÿ“ฆ exports
106
+ export default AbList;
107
+ export { AbList, AbListItem };
@@ -0,0 +1,82 @@
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: AbList styles
28
+ * @file: ab-list/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: mock .list / .li-ic / .badge, on the ab-nextjs-theme 0.3.5 home tokens */
41
+ .abList {
42
+ --ab-list-radius: 14px; /* โญ• */
43
+ --ab-list-background: var(--ab-color-card, #fff); /* ๐ŸŽจ --card */
44
+ --ab-list-border: var(--ab-color-border, rgb(92 64 48 / 0.13)); /* โž– --border */
45
+ --ab-list-divider: var(--ab-color-div, rgb(92 64 48 / 0.11)); /* โž– --div */
46
+ --ab-list-shadow: var(--ab-shadow-card, 0 1px 2px rgb(33 26 22 / 0.05)); /* ๐ŸŒ— --shadow */
47
+ --ab-list-hover: var(--ab-color-hover, rgb(166 124 82 / 0.08)); /* ๐Ÿ–ฑ๏ธ --hover */
48
+ --ab-list-ring: var(--ab-color-accent, #a67c52); /* โ™ฟ --accent */
49
+ --ab-list-text: var(--ab-color-text, #211a16); /* ๐Ÿ–‹๏ธ */
50
+ --ab-list-muted: var(--ab-color-muted, #6b5b50); /* ๐Ÿ–‹๏ธ */
51
+ --ab-list-faint: var(--ab-color-faint, #807062); /* ๐Ÿ–‹๏ธ --faint โ™ฟ AA fallback (James) */
52
+ --ab-list-tile: var(--ab-color-card2, #fbf3ec); /* ๐Ÿ–ผ๏ธ --card2 */
53
+ --ab-list-accent-text: var(--ab-color-accent-text, #8b6340); /* ๐Ÿ–‹๏ธ --accent-t */
54
+ --ab-list-tint: var(--ab-color-tint, #f4e7db); /* ๐ŸŽจ --tint */
55
+ --ab-list-btn: var(--ab-color-btn, #a67c52); /* ๐ŸŽจ --btn */
56
+ --ab-list-btn-text: var(--ab-color-btn-text, #fff); /* ๐ŸŽจ --btn-t */
57
+ margin: 0; padding: 0; list-style: none; /* ๐Ÿงน */
58
+ border: 1px solid var(--ab-list-border); border-radius: var(--ab-list-radius); /* โž– */
59
+ background: var(--ab-list-background); box-shadow: var(--ab-list-shadow); overflow: hidden; /* ๐ŸŽจ */
60
+ color: var(--ab-list-text); /* ๐Ÿ–‹๏ธ */
61
+ }
62
+ .abListItem { border-top: 1px solid var(--ab-list-divider); } /* โž– */
63
+ .abListItem:first-child { border-top: 0; } /* ๐Ÿงน */
64
+ .abListRow {
65
+ display: flex; align-items: center; gap: 12px; /* ๐Ÿ“ */
66
+ min-height: 44px; box-sizing: border-box; padding: 11px 14px; /* ๐Ÿ“ฆ touch target */
67
+ color: inherit; text-decoration: none; /* ๐Ÿ”— */
68
+ }
69
+ a.abListRow:hover { background: var(--ab-list-hover); } /* ๐Ÿ–ฑ๏ธ */
70
+ a.abListRow:focus-visible { outline: 2px solid var(--ab-list-ring); outline-offset: -2px; } /* โ™ฟ inset ring */
71
+ .abListItem:first-child a.abListRow:focus-visible { border-radius: calc(var(--ab-list-radius) - 1px) calc(var(--ab-list-radius) - 1px) 0 0; } /* โญ• */
72
+ .abListItem:last-child a.abListRow:focus-visible { border-radius: 0 0 calc(var(--ab-list-radius) - 1px) calc(var(--ab-list-radius) - 1px); } /* โญ• */
73
+ .abListMedia { flex: none; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--ab-list-tile); color: var(--ab-list-accent-text); } /* ๐Ÿ–ผ๏ธ */
74
+ .abListMedia > *, .abListMedia svg { width: 18px; height: 18px; } /* ๐Ÿ”ฃ 18px icon (an AbIcon, or a raw <svg> at any depth) */
75
+ .abListBadge { flex: none; display: flex; align-items: center; justify-content: center; width: 64px; height: 22px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--ab-list-tint); color: var(--ab-list-accent-text); } /* ๐Ÿท๏ธ Improved */
76
+ .abListBadge[data-tone='primary'] { background: var(--ab-list-btn); color: var(--ab-list-btn-text); } /* ๐Ÿท๏ธ New */
77
+ .abListText { flex: 1; min-width: 0; } /* ๐Ÿ“ */
78
+ .abListTitle { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* ๐Ÿ’ช */
79
+ .abListMeta { display: block; margin-top: 2px; font-size: 12px; line-height: 1.42; color: var(--ab-list-faint); } /* ๐Ÿงพ 1.42 (~17px): rows are 59px (first) / 60px (with the divider), like the mock */
80
+ .abListMeta code { font-family: var(--ab-font-code, var(--ab-font-mono, ui-monospace, monospace)); font-size: 11px; color: var(--ab-list-muted); } /* ๐Ÿงพ mono pkg */
81
+ .abListChevron { flex: none; width: 18px; height: 18px; color: var(--ab-list-faint); } /* โžก๏ธ */
82
+ .abListTrailing { flex: none; color: var(--ab-list-faint); } /* โžก๏ธ */
@@ -49,6 +49,10 @@ import { useCallback, useEffect, useId, useRef, useState } from 'react';
49
49
  import clsx from 'clsx';
50
50
  // ๐Ÿ”ฃ globe glyph
51
51
  import AbIcon from '../ab-icon';
52
+ // ๐Ÿ—„๏ธ 0.1.14 (G56): drawer presentation
53
+ import AbDrawerList from '../ab-drawer-list';
54
+ import AbBottomDrawer from '../ab-bottom-drawer';
55
+ import type { AbDrawerScope } from '../ab-drawer';
52
56
  // ๐ŸŽจ styles
53
57
  import styles from './styles.module.css';
54
58
 
@@ -59,6 +63,12 @@ export interface AbLocaleOption {
59
63
  }
60
64
 
61
65
  // โš™๏ธ props
66
+ /** ๐Ÿ—„๏ธ how a picker opens (G56): popover menu, drawer, or drawer on mobile only */
67
+ export type AbPresentation = 'menu' | 'drawer' | 'auto';
68
+ /** ๐Ÿ“ฑ resolve `auto` at open time (no hydration flip: the server always renders the closed trigger) */
69
+ export const resolveAbPresentation = (p: AbPresentation = 'menu'): 'menu' | 'drawer' =>
70
+ p === 'auto' ? (typeof window !== 'undefined' && window.matchMedia?.('(max-width: 767.98px)').matches ? 'drawer' : 'menu') : p;
71
+
62
72
  export interface AbLocaleSwitcherProps {
63
73
  locales: readonly AbLocaleOption[]; // ๐ŸŒ choices
64
74
  current: string; // โœ… active locale code
@@ -70,6 +80,10 @@ export interface AbLocaleSwitcherProps {
70
80
  icon?: ReactNode; // ๐Ÿ–ผ๏ธ override the globe
71
81
  className?: string; // ๐Ÿท๏ธ
72
82
  style?: CSSProperties; // ๐ŸŽจ
83
+ /** ๐Ÿ—„๏ธ 0.1.14 (G56, D40): `menu` (default) = popover menu; `drawer` = AbDrawerList; `auto` = drawer below 768px, menu above */
84
+ presentation?: AbPresentation;
85
+ drawerScope?: AbDrawerScope; // ๐Ÿ—บ๏ธ default 'app'
86
+ drawerSide?: 'top' | 'bottom' | 'start' | 'end'; // ๐Ÿงญ default 'bottom'
73
87
  }
74
88
 
75
89
  /**
@@ -87,7 +101,9 @@ export function getAbTypeaheadIndex(labels: readonly string[], from: number, cha
87
101
 
88
102
  export function AbLocaleSwitcher(props: AbLocaleSwitcherProps) {
89
103
  // ๐Ÿงฉ props
90
- const { locales, current, label, onSelect, getHref, variant = 'icon', align = 'end', icon, className, style } = props;
104
+ const { locales, current, label, onSelect, getHref, variant = 'icon', align = 'end', icon, className, style, presentation = 'menu', drawerScope = 'app', drawerSide = 'bottom' } = props;
105
+ // ๐Ÿ—„๏ธ how this open happens (decided on click)
106
+ const [mode, setMode] = useState<'menu' | 'drawer'>(presentation === 'drawer' ? 'drawer' : 'menu');
91
107
  // ๐Ÿšช open?
92
108
  const [open, setOpen] = useState(false);
93
109
  // ๐Ÿ†” ids
@@ -110,22 +126,22 @@ export function AbLocaleSwitcher(props: AbLocaleSwitcherProps) {
110
126
 
111
127
  // ๐ŸŽฏ on open, focus the checked item (after paint)
112
128
  useEffect(() => {
113
- if (!open) return; // ๐Ÿ’ค
129
+ if (!open || mode !== 'menu') return; // ๐Ÿ’ค (the drawer manages its own focus)
114
130
  const id = requestAnimationFrame(() => focusItem(activeIndex)); // โญ๏ธ
115
131
  return () => cancelAnimationFrame(id); // ๐Ÿงน
116
- }, [open, activeIndex]);
132
+ }, [open, mode, activeIndex]);
117
133
 
118
134
  // ๐Ÿ–ฑ๏ธ click outside closes (no focus steal)
119
135
  useEffect(() => {
120
- if (!open) return; // ๐Ÿ’ค
136
+ if (!open || mode !== 'menu') return; // ๐Ÿ’ค (the drawer portals outside rootRef: it has its own scrim)
121
137
  const onDown = (e: PointerEvent) => { if (!rootRef.current?.contains(e.target as Node)) close(false); }; // ๐Ÿšช
122
138
  document.addEventListener('pointerdown', onDown); // ๐Ÿ‘‚
123
139
  return () => document.removeEventListener('pointerdown', onDown); // ๐Ÿงน
124
- }, [open, close]);
140
+ }, [open, mode, close]);
125
141
 
126
142
  // โŒจ๏ธ trigger: ArrowDown/Up/Enter/Space open the menu
127
143
  const onTriggerKey = (e: KeyboardEvent<HTMLButtonElement>) => {
128
- if (e.key === 'ArrowDown' || e.key === 'ArrowUp') { e.preventDefault(); setOpen(true); } // โฌ‡๏ธ
144
+ if (e.key === 'ArrowDown' || e.key === 'ArrowUp') { e.preventDefault(); setMode(resolveAbPresentation(presentation)); setOpen(true); } // โฌ‡๏ธ
129
145
  };
130
146
 
131
147
  // โŒจ๏ธ menu keys
@@ -158,12 +174,12 @@ export function AbLocaleSwitcher(props: AbLocaleSwitcherProps) {
158
174
  id={`${base}-trigger`} // ๐Ÿ†”
159
175
  type="button" // ๐Ÿงพ
160
176
  className={clsx(styles.trigger, variant === 'menu' && styles.withText)} // ๐ŸŽจ
161
- aria-haspopup="menu" // โ™ฟ
177
+ aria-haspopup={mode === 'drawer' ? 'dialog' : 'menu'} // โ™ฟ
162
178
  aria-expanded={open} // โ™ฟ
163
- aria-controls={`${base}-menu`} // ๐Ÿ”—
179
+ aria-controls={mode === 'drawer' ? `${base}-drawer` : `${base}-menu`} // ๐Ÿ”—
164
180
  aria-label={variant === 'icon' ? `${label}: ${active?.label ?? current}` : undefined} // ๐Ÿท๏ธ "Language: Franรงais"
165
181
  title={label} // ๐Ÿ’ฌ
166
- onClick={() => setOpen((o) => !o)} // ๐Ÿ–ฑ๏ธ
182
+ onClick={() => { if (!open) setMode(resolveAbPresentation(presentation)); setOpen((o) => !o); }} // ๐Ÿ–ฑ๏ธ (`auto` picks menu / drawer now)
167
183
  onKeyDown={onTriggerKey} // โŒจ๏ธ
168
184
  >
169
185
  <span aria-hidden="true">{icon ?? <AbIcon name="language" size={20} />}</span>
@@ -174,7 +190,7 @@ export function AbLocaleSwitcher(props: AbLocaleSwitcherProps) {
174
190
  id={`${base}-menu`} // ๐Ÿ†”
175
191
  role="menu" // โ™ฟ
176
192
  aria-labelledby={`${base}-trigger`} // ๐Ÿ”—
177
- hidden={!open} // ๐Ÿ™ˆ
193
+ hidden={!open || mode !== 'menu'} // ๐Ÿ™ˆ
178
194
  className={styles.menu} // ๐ŸŽจ
179
195
  onKeyDown={onMenuKey} // โŒจ๏ธ
180
196
  >
@@ -205,6 +221,22 @@ export function AbLocaleSwitcher(props: AbLocaleSwitcherProps) {
205
221
  );
206
222
  })}
207
223
  </ul>
224
+ {/* ๐Ÿ—„๏ธ 0.1.14 (G56): drawer presentation. No in-flow fallback here: the <details> below already is one */}
225
+ {presentation !== 'menu' ? (
226
+ <AbDrawerList
227
+ id={`${base}-drawer`}
228
+ open={open && mode === 'drawer'}
229
+ onClose={() => setOpen(false)} // ๐Ÿšช the drawer puts focus back on the trigger
230
+ scope={drawerScope}
231
+ side={drawerSide}
232
+ as={drawerSide === 'bottom' ? AbBottomDrawer : undefined} // ๐Ÿ“ฑ the mobile bottom drawer look
233
+ title={label}
234
+ noJsFallback={false}
235
+ value={current}
236
+ items={locales.map((l) => ({ value: l.code, label: l.label, lang: l.code, href: getHref?.(l.code) }))}
237
+ onSelect={(code) => onSelect?.(code)}
238
+ />
239
+ ) : null}
208
240
  {/* ๐Ÿšซ JS off (0.1.13, gap-review): a native <details> list of hreflang links replaces the menu.
209
241
  Only rendered with getHref (a callback can't run without JS). CSS shows it under (scripting: none). */}
210
242
  {getHref ? (
@@ -63,11 +63,11 @@
63
63
  }
64
64
  .trigger:hover,
65
65
  .trigger[aria-expanded='true'] {
66
- background: color-mix(in srgb, currentColor 10%, transparent); /* ๐ŸŒซ๏ธ */
66
+ background: var(--ab-color-hover, color-mix(in srgb, currentColor 10%, transparent)); /* ๐ŸŒซ๏ธ */
67
67
  }
68
68
  .trigger:focus-visible,
69
69
  .item:focus-visible {
70
- outline: 2px solid var(--ab-focus-ring, var(--ab-color-primary, #A67C52)); /* ๐Ÿ’ */
70
+ outline: 2px solid var(--ab-color-accent, var(--ab-focus-ring, var(--ab-color-primary, #A67C52))); /* ๐Ÿ’ */
71
71
  outline-offset: 2px; /* โ†”๏ธ */
72
72
  }
73
73
  @media (pointer: coarse) {
@@ -85,7 +85,7 @@
85
85
  padding: 0.25rem; /* ๐Ÿงฑ */
86
86
  list-style: none; /* ๐Ÿงน */
87
87
  border-radius: 0.75rem; /* ๐Ÿ”ฒ */
88
- border: 1px solid var(--ab-color-outline-variant, rgb(0 0 0 / 0.12)); /* ๐Ÿ–Š๏ธ */
88
+ border: 1px solid var(--ab-color-border, var(--ab-color-outline-variant, rgb(0 0 0 / 0.12))); /* ๐Ÿ–Š๏ธ */
89
89
  background: var(--ab-color-surface, #fff); /* ๐ŸŽจ */
90
90
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12); /* ๐ŸŒซ๏ธ */
91
91
  }
@@ -116,7 +116,7 @@
116
116
  }
117
117
  .item:hover,
118
118
  .item:focus-visible {
119
- background: color-mix(in srgb, currentColor 8%, transparent); /* ๐ŸŒซ๏ธ */
119
+ background: var(--ab-color-hover, color-mix(in srgb, currentColor 8%, transparent)); /* ๐ŸŒซ๏ธ */
120
120
  }
121
121
  .item[aria-checked='true'] {
122
122
  font-weight: 600; /* ๐Ÿ’ช */
@@ -77,10 +77,10 @@
77
77
  .abNavbarLink[data-active='true'],
78
78
  .abNavbarLink[aria-expanded='true'] { color: var(--ab-color-on-surface, inherit); } /* ๐ŸŽฏ */
79
79
  .abNavbarLink[data-active='true'] .abNavbarPill,
80
- .abNavbarLink[aria-expanded='true'] .abNavbarPill { background: var(--ab-color-secondary-container, rgb(0 0 0 / 0.08)); } /* ๐ŸŽฏ */
80
+ .abNavbarLink[aria-expanded='true'] .abNavbarPill { background: var(--ab-color-tint, var(--ab-color-secondary-container, rgb(0 0 0 / 0.08))); } /* ๐ŸŽฏ */
81
81
  .abNavbarLink[data-active='true'] .abNavbarLabel { font-weight: 700; } /* ๐Ÿ”ค */
82
82
  .abNavbarLink:focus-visible {
83
- outline: var(--ab-focus-ring-width, 2px) solid var(--ab-color-primary, #8f4c38); /* โ™ฟ */
83
+ outline: var(--ab-focus-ring-width, 2px) solid var(--ab-color-accent, var(--ab-color-primary, #8f4c38)); /* โ™ฟ */
84
84
  outline-offset: var(--ab-focus-ring-offset, 2px); /* โ™ฟ */
85
85
  border-radius: 12px; /* ๐ŸŸข */
86
86
  }
@@ -89,3 +89,21 @@
89
89
  .abNavbarLink[aria-disabled='true'] { cursor: default; opacity: 0.6; } /* ๐Ÿšซ */
90
90
  .abNavbarSoon { font-size: 10px; line-height: 12px; opacity: 0.85; } /* ๐Ÿšง tag under the label */
91
91
  .abNavbarSrOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* ๐Ÿ•ถ๏ธ */
92
+
93
+ /* ===== ๐Ÿ“ฑ 0.1.14 (P18, Home spec ยง4 bottom nav): indicator="none" ยท blur ===== */
94
+ .abNavbar[data-indicator='none'] { padding-top: 8px; padding-bottom: env(safe-area-inset-bottom, 0px); min-height: calc(50px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; } /* ๐Ÿ“ 84px with the iPhone home indicator */
95
+ .abNavbar[data-indicator='none'] .abNavbarList { justify-content: space-around; }
96
+ .abNavbar[data-indicator='none'] .abNavbarList > li { flex: 0 1 80px; } /* โ†”๏ธ 4 ร— 80px */
97
+ .abNavbar[data-indicator='none'] .abNavbarLink { width: 80px; min-width: 0; gap: 3px; color: var(--ab-color-faint, inherit); } /* ๐Ÿ”— */
98
+ .abNavbar[data-indicator='none'] .abNavbarLink .abNavbarPill { width: auto; height: auto; background: none; } /* ๐Ÿšซ pill (0,4,0 beats the active pill rules) */
99
+ .abNavbar[data-indicator='none'] .abNavbarLabel { font-size: 11.5px; font-weight: 550; line-height: 1.2; } /* ๐Ÿ”ค */
100
+ .abNavbar[data-indicator='none'] .abNavbarLink[data-active='true'],
101
+ .abNavbar[data-indicator='none'] .abNavbarLink[aria-expanded='true'] { color: var(--ab-color-accent-text, inherit); } /* ๐ŸŽฏ */
102
+ .abNavbar[data-indicator='none'] .abNavbarLink[data-active='true'] .abNavbarLabel { font-weight: 700; }
103
+ .abNavbar[data-indicator='none'] .abNavbarLink:focus-visible { outline-color: var(--ab-color-accent, #a67c52); }
104
+ .abNavbar[data-blur='true'] {
105
+ background: color-mix(in srgb, var(--ab-color-bg, #fff8f5) 92%, transparent); /* ๐ŸŒซ๏ธ */
106
+ -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); /* ๐ŸงŠ */
107
+ border-top: 1px solid var(--ab-color-div, rgb(92 64 48 / 0.11)); /* โž– */
108
+ }
109
+ :global(.dark) .abNavbar[data-blur='true'], :global([data-theme='dark']) .abNavbar[data-blur='true'] { background: #1f170f; } /* ๐ŸŒ™ mock: solid warm */
@@ -87,6 +87,8 @@ export interface AbNavbarBaseProps<I extends AbNavbarItem = AbNavbarItem> {
87
87
  activeHref?: string; // ๐ŸŽฏ
88
88
  locales?: readonly string[]; // ๐ŸŒ 0.1.13: stripped from the pathname (default: AbLinkProvider's)
89
89
  label?: string; // โ™ฟ nav aria-label (default "Primary")
90
+ indicator?: 'pill' | 'none'; // ๐ŸŽฏ 0.1.14 (P18): 'none' = no active pill; 25px icons, accent text (the Home bottom nav). Default 'pill'
91
+ blur?: boolean; // ๐ŸŒซ๏ธ 0.1.14 (P18): translucent --bg + 12px backdrop blur + --div top hairline
90
92
  // ๐Ÿ•ฐ๏ธ legacy
91
93
  type?: 'customer' | 'admin';
92
94
  page?: string;
@@ -106,13 +108,14 @@ export function AbNavbarView({ props, Icon, active }: {
106
108
  Icon: AbNavbarIconComponent;
107
109
  active: (href: string, legacyValue?: string) => boolean;
108
110
  }): ReactElement {
109
- const { className, items, links, label = 'Primary', type = 'customer' } = props;
111
+ const { className, items, links, label = 'Primary', type = 'customer', indicator = 'pill', blur = false } = props;
112
+ const iconSize = indicator === 'none' ? 25 : 24; // ๐Ÿ”ฃ P18
110
113
  // ๐Ÿ•ฐ๏ธ legacy links โ†’ link items
111
114
  const list: AbNavbarItem[] = items?.length ? items : (links ?? []).map(({ href, icon, label: l }) => ({ kind: 'link', href, icon, label: l }));
112
115
  const valueOf = (href: string) => links?.find((l) => l.href === href)?.value;
113
116
 
114
117
  return (
115
- <nav data-type={type} data-ab-part="bottomBar" className={clsx('AbNavbar', styles.abNavbar, className)} aria-label={label}>
118
+ <nav data-type={type} data-ab-part="bottomBar" className={clsx('AbNavbar', styles.abNavbar, className)} aria-label={label} data-indicator={indicator === 'none' ? 'none' : undefined} data-blur={blur ? 'true' : undefined}>
116
119
  <ul className={styles.abNavbarList}>
117
120
  {list.map((item) => {
118
121
  if (item.kind === 'button') {
@@ -132,7 +135,7 @@ export function AbNavbarView({ props, Icon, active }: {
132
135
  data-coming-soon={item.comingSoon ? 'true' : undefined} // ๐Ÿšง
133
136
  onClick={inert ? undefined : item.onSelect}
134
137
  >
135
- <span className={styles.abNavbarPill}><Icon name={item.icon} variant={item.expanded ? 'filled' : 'outlined'} size={24} /></span>
138
+ <span className={styles.abNavbarPill}><Icon name={item.icon} variant={item.expanded ? 'filled' : 'outlined'} size={iconSize} /></span>
136
139
  <span className={styles.abNavbarLabel}>{item.label}</span>
137
140
  {soon && <span className={styles.abNavbarSoon} data-ab-part="badge"><span className={styles.abNavbarSrOnly}>, </span>{soon}</span>}
138
141
  </button>
@@ -151,7 +154,7 @@ export function AbNavbarView({ props, Icon, active }: {
151
154
  data-active={on ? 'true' : 'false'}
152
155
  aria-current={on ? 'page' : undefined} // โ™ฟ
153
156
  >
154
- <span className={styles.abNavbarPill}><Icon name={item.icon} variant={on ? 'filled' : 'outlined'} size={24} /></span>
157
+ <span className={styles.abNavbarPill}><Icon name={item.icon} variant={on ? 'filled' : 'outlined'} size={iconSize} /></span>
155
158
  <span className={styles.abNavbarLabel}>{item.label}</span>
156
159
  </Link>
157
160
  </li>
@@ -40,9 +40,20 @@
40
40
  */
41
41
 
42
42
  // โš›๏ธ React
43
- import type { ReactElement, ReactNode } from 'react';
43
+ import type { CSSProperties, ReactElement, ReactNode } from 'react';
44
+ // ๐Ÿงต classes
45
+ import clsx from 'clsx';
44
46
  // ๐Ÿƒ base card
45
47
  import AbCard from '../ab-card';
48
+ // ๐Ÿ”— G42 link
49
+ import Link from '../ab-link';
50
+ // ๐Ÿท๏ธ footer chips (0.1.14)
51
+ import AbChip from '../ab-chip';
52
+ // ๐Ÿ”ฃ trailing arrow
53
+ import AbIcon from '../ab-icon';
54
+ // ๐ŸŽฌ motion classes (ab-nextjs-animations โ‰ฅ 0.2.4)
55
+ import { AB_MOTION } from 'ab-nextjs-animations/motion';
56
+ import 'ab-nextjs-animations/motion/styles.css';
46
57
  // ๐ŸŽจ styles
47
58
  import styles from './styles.module.css';
48
59
 
@@ -59,6 +70,11 @@ export interface AbPackageCardProps {
59
70
  tags?: string[]; // ๐Ÿท๏ธ e.g. ['client', 'server']
60
71
  headingLevel?: 2 | 3 | 4; // โ™ฟ
61
72
  className?: string; // ๐Ÿท๏ธ
73
+ // ๐Ÿ  0.1.14 (P10, Home spec ยง4 package card). Passing `preview` or `title` switches to the Home layout:
74
+ // 56px preview tile ยท 30px icon tile + display title + mono name ยท clamped description ยท chips + โ†’
75
+ preview?: ReactNode; // ๐Ÿ–ผ๏ธ decorative preview tile content (Aa Aa Aa, swatches, a curveโ€ฆ), aria-hidden
76
+ title?: ReactNode; // ๐Ÿท๏ธ display name (e.g. "Fonts"); `name` becomes the mono subtitle
77
+ descriptionLines?: number; // โœ‚๏ธ clamp the description (Home: 2)
62
78
  }
63
79
 
64
80
  /**
@@ -70,7 +86,38 @@ export function toAbPackageNameParts(name: string): ReactNode[] {
70
86
  }
71
87
 
72
88
  /** ๐Ÿ“ฆ AbPackageCard (G45): a package tile on AbCard (one link, 2px lift on laptop+, none when reduced). */
73
- const AbPackageCard = ({ name, href, description, version, icon, media, id, badge, tags, headingLevel, className }: AbPackageCardProps): ReactElement => (
89
+ const AbPackageCard = (props: AbPackageCardProps): ReactElement => (props.preview != null || props.title != null ? <AbPackageCardHome {...props} /> : <AbPackageCardLegacy {...props} />);
90
+
91
+ /** ๐Ÿ  0.1.14 (P10): the Home layout. One link (the title, stretched over the card), focus ring on the card. */
92
+ function AbPackageCardHome({ name, href, description, version, icon, media, id, badge, tags, headingLevel = 3, className, preview, title, descriptionLines }: AbPackageCardProps): ReactElement {
93
+ const H = `h${headingLevel}` as 'h2' | 'h3' | 'h4'; // โ™ฟ
94
+ const clamp = descriptionLines ? ({ '--ab-package-card-lines': descriptionLines } as CSSProperties) : undefined; // โœ‚๏ธ
95
+ return (
96
+ <article id={id} className={clsx('AbPackageCard', styles.home, AB_MOTION.interactive, className)} data-ab-part="package-card" data-variant="home">
97
+ {preview != null && <div className={styles.homePreview} aria-hidden="true">{preview}</div> /* ๐Ÿ–ผ๏ธ decorative */}
98
+ <div className={styles.homeHead}>
99
+ {(media ?? icon) != null && <span className={styles.homeIcon} aria-hidden="true">{media ?? icon}</span>}
100
+ <div className={styles.homeTitles}>
101
+ <H className={styles.homeTitle}><Link href={href} className={styles.homeLink}>{title ?? name}</Link></H>
102
+ {title != null && <code className={styles.homeName}>{name}</code> /* โŒจ๏ธ the npm name */}
103
+ </div>
104
+ {badge != null && <span className={styles.homeBadge}>{badge}</span>}
105
+ </div>
106
+ {description != null && <p className={styles.homeDesc} data-clamp={descriptionLines ? 'true' : undefined} style={clamp}>{description}</p>}
107
+ {(version || tags?.length) ? (
108
+ <div className={styles.homeFoot}>
109
+ {version && <AbChip size="sm" shape="rounded" mono tone="accent">v{version}</AbChip>}
110
+ {tags?.map((t) => <AbChip key={t} size="sm" shape="rounded" mono tone="sage" className={styles.homeTag}>{t}</AbChip>)}
111
+ <span className={styles.homeGrow} />
112
+ <AbIcon name="arrow_forward" size={16} className={styles.homeGo} />
113
+ </div>
114
+ ) : null}
115
+ </article>
116
+ );
117
+ }
118
+
119
+ /** ๐Ÿ•ฐ๏ธ โ‰ค 0.1.13 layout on AbCard. */
120
+ const AbPackageCardLegacy = ({ name, href, description, version, icon, media, id, badge, tags, headingLevel, className }: AbPackageCardProps): ReactElement => (
74
121
  <AbCard
75
122
  id={id}
76
123
  className={className}
@@ -39,3 +39,43 @@
39
39
  .abPackageCardName { font-family: var(--ab-font-code, var(--ab-font-mono, ui-monospace, monospace)); font-size: 16px; overflow-wrap: anywhere; word-break: normal; hyphens: none; display: block; min-width: 0; max-width: 100%; } /* ๐Ÿ“ฆ 0.1.13 (Joseph): wraps at the <wbr> after a hyphen first (ab-nextjs-/components); `anywhere` only splits a part that alone is wider than a very narrow card (animations at ~70px), so it never overflows */
40
40
  .abPackageCardVersion { font-family: var(--ab-font-code, var(--ab-font-mono, ui-monospace, monospace)); opacity: 0.8; } /* ๐Ÿท๏ธ */
41
41
  .abPackageCardTag { padding: 0 8px; border-radius: 999px; line-height: 20px; background: var(--ab-color-surface-container-high, rgb(0 0 0 / 0.06)); } /* ๐Ÿท๏ธ */
42
+
43
+ /* ===== ๐Ÿ  0.1.14 (P10, Home spec ยง4 package card) ===== */
44
+ .home {
45
+ position: relative; display: flex; flex-direction: column; min-width: 0; box-sizing: border-box; /* ๐Ÿ“ */
46
+ padding: 10px 10px 12px; border: 1px solid var(--ab-color-border, rgb(92 64 48 / 0.13)); border-radius: var(--ab-radius-card, 14px); /* ๐Ÿ”ฒ */
47
+ background: var(--ab-color-card, #fff); color: var(--ab-color-text, #211a16); box-shadow: var(--ab-shadow-card, 0 1px 2px rgb(33 26 22 / 0.05)); /* ๐ŸŽจ */
48
+ /* ๐ŸŽž๏ธ the fade + lift timing comes from ab-nextjs-animations (.ab-motion-interactive on the element) */
49
+ }
50
+ .home:hover { border-color: color-mix(in srgb, var(--ab-color-accent, #a67c52) 40%, transparent); transform: translateY(-1px); } /* ๐Ÿ–ฑ๏ธ */
51
+ .home:has(.homeLink:focus-visible) { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: 2px; } /* โ™ฟ ring on the card */
52
+ .homeLink { color: inherit; text-decoration: none; outline: none; } /* ๐Ÿ”— */
53
+ .homeLink::after { content: ''; position: absolute; inset: 0; border-radius: inherit; } /* ๐Ÿ–ฑ๏ธ the whole card clicks */
54
+ .homePreview {
55
+ height: 56px; border-radius: var(--ab-radius-tile, 9px); background: var(--ab-color-card2, #fbf3ec); /* ๐Ÿ–ผ๏ธ */
56
+ display: flex; align-items: center; justify-content: center; gap: 10px; overflow: hidden; color: var(--ab-color-accent-text, #88603d);
57
+ }
58
+ .homeHead { display: flex; align-items: center; gap: 9px; margin-top: 11px; padding: 0 2px; min-width: 0; } /* ๐Ÿ“ */
59
+ .homeIcon {
60
+ flex: none; width: 30px; height: 30px; border-radius: var(--ab-radius-row, 8px); /* ๐Ÿ”ฒ */
61
+ background: var(--ab-color-tint, #f4e7db); color: var(--ab-color-accent-text, #88603d); display: flex; align-items: center; justify-content: center;
62
+ }
63
+ .homeIcon svg { width: 18px; height: 18px; } /* ๐Ÿ”ฃ */
64
+ .homeTitles { min-width: 0; } /* โœ‚๏ธ */
65
+ .homeTitle { margin: 0; font-family: var(--ab-font-title, inherit); font-size: 14px; font-weight: 800; line-height: 1.2; letter-spacing: -0.005em; } /* ๐Ÿท๏ธ Mulish */
66
+ .homeName { display: block; margin-top: 1px; font: 400 11px/1.3 var(--ab-font-code, ui-monospace, monospace); color: var(--ab-color-faint, #807062); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* โŒจ๏ธ */
67
+ .homeBadge { margin-inline-start: auto; flex: none; } /* ๐Ÿ”ด */
68
+ .homeDesc { margin: 8px 0 0; padding: 0 2px; font-size: 12.5px; line-height: 1.45; color: var(--ab-color-muted, #6b5b50); min-height: 36px; } /* ๐Ÿ“ */
69
+ .homeDesc[data-clamp='true'] { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--ab-package-card-lines, 2); line-clamp: var(--ab-package-card-lines, 2); overflow: hidden; } /* โœ‚๏ธ */
70
+ .homeFoot { display: flex; align-items: center; margin-top: 10px; padding: 0 2px; } /* ๐Ÿท๏ธ */
71
+ .homeTag { margin-inline-start: 6px; } /* ๐ŸŒฟ */
72
+ .homeGrow { flex: 1; } /* โ†”๏ธ */
73
+ .homeGo { width: 16px; height: 16px; color: var(--ab-color-faint, #807062); } /* โ†’ */
74
+ @media (max-width: 767px) {
75
+ .home { padding: 8px 8px 10px; border-radius: 13px; } /* ๐Ÿ“ฑ */
76
+ .homePreview { height: 44px; }
77
+ .homeHead { margin-top: 9px; }
78
+ .homeDesc { margin-top: 6px; font-size: 12px; }
79
+ .homeFoot { margin-top: 8px; }
80
+ }
81
+ @media (prefers-reduced-motion: reduce) { .home:hover { transform: none; } } /* โ™ฟ no lift */
@@ -63,6 +63,8 @@ export interface AbSearchTriggerProps {
63
63
  compact?: boolean; // ๐Ÿ“ฑ icon-only pill (the label stays for screen readers), e.g. the mobile app bar
64
64
  comingSoon?: boolean; // ๐Ÿšง visible but inert: aria-disabled, no hotkey
65
65
  comingSoonLabel?: string; // ๐Ÿท๏ธ default "Coming soon"
66
+ variant?: 'pill' | 'field'; // ๐Ÿ”Ž 0.1.14 (P6): 'field' = the Home 300ร—36 bordered field (default 'pill', the legacy look)
67
+ size?: 'md' | 'sm'; // ๐Ÿ“ฑ 0.1.14 (P6): 'sm' = the mobile 34px "Search โŒ˜K" pill (label + key cap stay visible)
66
68
  className?: string; // ๐Ÿท๏ธ
67
69
  }
68
70
 
@@ -80,7 +82,7 @@ export function isAbApplePlatform(nav?: { platform?: string; userAgent?: string;
80
82
  * announces `aria-keyshortcuts="Meta+K Control+K"`, and falls back to a link when there's no `onOpen`.
81
83
  * Note: the hotkey is a local listener; G48 `useAbHotkey` is deliberately not in hooks 0.1.7.
82
84
  */
83
- const AbSearchTrigger = ({ label = 'Search', onOpen, href, hotkey, shortcut, compact = false, comingSoon = false, comingSoonLabel = 'Coming soon', className }: AbSearchTriggerProps): ReactElement => {
85
+ const AbSearchTrigger = ({ label = 'Search', onOpen, href, hotkey, shortcut, compact = false, comingSoon = false, comingSoonLabel = 'Coming soon', variant = 'pill', size = 'md', className }: AbSearchTriggerProps): ReactElement => {
84
86
  // ๐ŸŽ SSR renders "Ctrl"; hydration then reads the platform (useSyncExternalStore: no mismatch, no effect)
85
87
  const apple = useSyncExternalStore(
86
88
  noopSubscribe, // ๐Ÿ”• the platform never changes
@@ -101,8 +103,18 @@ const AbSearchTrigger = ({ label = 'Search', onOpen, href, hotkey, shortcut, com
101
103
  return () => window.removeEventListener('keydown', onKey); // ๐Ÿงน
102
104
  }, [listen, onOpen]);
103
105
 
106
+ // ๐Ÿ  P6: the Home looks (field / sm pill) show ONE key cap ("โŒ˜ K" / "โŒ˜K") and keep "coming soon" out of the field
107
+ const home = variant === 'field' || size === 'sm';
108
+ const keyCap = (apple ? 'โŒ˜' : 'Ctrl') + (size === 'sm' ? '' : ' ') + 'K'; // โŒจ๏ธ mock: "โŒ˜ K" (field) ยท "โŒ˜K" (sm)
104
109
  // ๐Ÿงฉ inner content
105
- const inner = (
110
+ const inner = home ? (
111
+ <>
112
+ <AbIcon name="search" size={size === 'sm' ? 17 : 18} className={styles.abSearchTriggerIcon} />
113
+ <span className={styles.abSearchTriggerLabel}>{label}</span>
114
+ {/* ๐Ÿšง coming soon: tooltip + announced, never painted inside the field (spec ยง4) */}
115
+ {comingSoon ? <span className={styles.abSearchTriggerSrOnly}>, {comingSoonLabel}</span> : listen && <AbKbd className={styles.abSearchTriggerCap}>{keyCap}</AbKbd>}
116
+ </>
117
+ ) : (
106
118
  <>
107
119
  <AbIcon name="search" size={20} className={styles.abSearchTriggerIcon} />
108
120
  <span className={clsx(styles.abSearchTriggerLabel, compact && styles.abSearchTriggerSrOnly)}>{label}</span>
@@ -117,6 +129,9 @@ const AbSearchTrigger = ({ label = 'Search', onOpen, href, hotkey, shortcut, com
117
129
  'data-ab-part': 'search-trigger', // ๐Ÿงฉ
118
130
  'aria-keyshortcuts': listen ? 'Meta+K Control+K' : undefined, // โ™ฟ only announced when bound (James #3)
119
131
  'data-compact': compact ? 'true' : undefined, // ๐Ÿ“ฑ
132
+ 'data-variant': variant === 'field' ? 'field' : undefined, // ๐Ÿ”Ž P6
133
+ 'data-size': size === 'sm' ? 'sm' : undefined, // ๐Ÿ“ฑ P6
134
+ title: home && comingSoon ? comingSoonLabel : undefined, // ๐Ÿ’ฌ P6: "coming soon" lives in the tooltip
120
135
  };
121
136
 
122
137
  // ๐Ÿšง coming soon: focusable, announced, inert
@@ -56,7 +56,7 @@
56
56
  box-sizing: border-box; /* ๐Ÿ“ฆ */
57
57
  }
58
58
  .abSearchTrigger:focus-visible {
59
- outline: var(--ab-focus-ring-width, 2px) solid var(--ab-color-primary, #8f4c38); /* โ™ฟ */
59
+ outline: var(--ab-focus-ring-width, 2px) solid var(--ab-color-accent, var(--ab-color-primary, #8f4c38)); /* โ™ฟ */
60
60
  outline-offset: var(--ab-focus-ring-offset, 2px); /* โ™ฟ */
61
61
  }
62
62
  .abSearchTrigger[aria-disabled='true'] { cursor: default; opacity: 0.72; } /* ๐Ÿšง */
@@ -68,3 +68,29 @@
68
68
  .abSearchTrigger[data-compact='true'] { flex: none; width: 40px; min-width: 40px; padding: 0; justify-content: center; } /* ๐Ÿ”˜ */
69
69
  /* ๐Ÿ•ถ๏ธ visually hidden, still read by screen readers */
70
70
  .abSearchTriggerSrOnly { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; flex: none; }
71
+
72
+ /* ===== ๐Ÿ  0.1.14 (P6, Home spec ยง4): variant="field" (300ร—36) ยท size="sm" (mobile 34px pill) ===== */
73
+ .abSearchTrigger[data-variant='field'] {
74
+ width: var(--ab-search-trigger-width, 300px); max-width: 100%; height: 36px; /* ๐Ÿ“ desktop 360 / tablet 260 via the var */
75
+ gap: 8px; padding: 0 6px 0 10px; /* ๐Ÿ“ฆ */
76
+ border: 1px solid var(--ab-color-border, rgb(92 64 48 / 0.13)); border-radius: var(--ab-radius-button, 10px); /* ๐Ÿ”ฒ */
77
+ background: var(--ab-color-card, #fff); color: var(--ab-color-faint, #807062); /* ๐ŸŽจ */
78
+ font-size: 13.5px; line-height: 1; box-shadow: var(--ab-shadow-card, 0 1px 2px rgb(33 26 22 / 0.05)); /* ๐Ÿ”ค ๐ŸŒ— */
79
+ }
80
+ .abSearchTrigger[data-size='sm'] {
81
+ flex: none; width: auto; max-width: none; height: 34px; /* ๐Ÿ“ */
82
+ gap: 6px; padding: 0 6px 0 10px; /* ๐Ÿ“ฆ */
83
+ border: 1px solid var(--ab-color-border, rgb(92 64 48 / 0.13)); border-radius: var(--ab-radius-pill, 999px); /* ๐Ÿ’Š */
84
+ background: var(--ab-color-card, #fff); color: var(--ab-color-faint, #807062); font-size: 13px; line-height: 1; /* ๐ŸŽจ ๐Ÿ”ค */
85
+ }
86
+ .abSearchTrigger[data-variant='field']:hover, .abSearchTrigger[data-size='sm']:hover { border-color: color-mix(in srgb, var(--ab-color-accent, #a67c52) 40%, transparent); } /* ๐Ÿ–ฑ๏ธ */
87
+ .abSearchTrigger[data-variant='field']:focus-visible, .abSearchTrigger[data-size='sm']:focus-visible { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: 2px; } /* โ™ฟ */
88
+ /* โŒจ๏ธ the single key cap (mock `kbd`): 20px, radius 5, 2px bottom border, 11/600 --muted */
89
+ .abSearchTriggerCap.abSearchTriggerCap {
90
+ flex: none; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; /* ๐Ÿ“ */
91
+ min-width: 20px; height: 20px; padding: 0 5px; margin-left: 2px; /* ๐Ÿ“ */
92
+ border: 1px solid var(--ab-color-border, rgb(92 64 48 / 0.13)); border-bottom-width: 2px; border-radius: var(--ab-radius-kbd, 5px); /* ๐Ÿ”ฒ */
93
+ background: var(--ab-color-kbd, #fff); color: var(--ab-color-muted, #6b5b50); font: 600 11px/1 var(--ab-font-body, inherit); /* ๐Ÿ”ค Inter: fine for โŒ˜ (spec ยง2) */
94
+ }
95
+ .abSearchTrigger[data-size='sm'] .abSearchTriggerCap { min-width: 18px; height: 18px; font-size: 10px; } /* ๐Ÿ“ฑ */
96
+ .abSearchTrigger[data-variant='field'][aria-disabled='true'], .abSearchTrigger[data-size='sm'][aria-disabled='true'] { opacity: 1; } /* ๐Ÿšง the Home field looks the same while search is coming soon (the tooltip says so) */