ab-nextjs-components 0.3.0 โ†’ 0.3.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/README.md CHANGED
@@ -96,6 +96,20 @@ New subpaths for the docs / PWA shell. All links go through **`AbLinkProvider`**
96
96
  registerAbIcons({ code })
97
97
  ```
98
98
 
99
+ ### 404 gaps (unreleased) ๐Ÿšง
100
+
101
+ * **`<AbErrorHero>`** (`ab-nextjs-components/ab-error-hero`, also in the barrel): the 404 / error hero from the 404 mocks. A big gradient `code` (default `"404"`) over a faded dot grid, a tilted `badge` tile (default `<AbIcon name="link_off" />`, needs ab-nextjs-icons ^0.2.6 and `registerAbIcons({ link_off })`; pass `badge={null}` to hide it), the `title` (h1, the code is read once), `message`, an optional `hint` row and an `actions` slot. Server-safe, no motion.
102
+ ```tsx
103
+ <AbErrorHero badge={<AbIcon name="link_off" />} title="Page not found" message="This page moved or never existed."
104
+ hint={<AbChip mono>/docs/packages/button</AbChip>}
105
+ actions={<><AbSearchTrigger size="lg" onOpen={open} /><AbButton type="filled" label="Back to home" href="/" /></>} />
106
+ ```
107
+ * **`<AbButton href>`** now renders through `AbLinkProvider`'s link (client and server twins), so links get the locale prefix.
108
+ * **`<AbCard>`**: `iconTile` (a leading icon in a tinted square), `arrow` (a decorative trailing arrow) and `boldTitle`.
109
+ * **`<AbSearchTrigger size="lg">`**: the 44px, up-to-440px search field of the 404 page.
110
+ * **`<AbToc variant="links">`**: a plain link list ("Popular pages"); items take `href`, `description` and `icon`, and links go through `AbLinkProvider`.
111
+ * **`<AbChip overflow>`**: `'ellipsis'` (default, adds the full text as `title`) or `'wrap'`.
112
+
99
113
  ### Home fidelity (0.1.14, unreleased) ๐Ÿ 
100
114
 
101
115
  These match the approved Home mocks (`home-fidelity-spec.md` ยง4/ยง5). Colours come from the `ab-nextjs-theme` โ‰ฅ 0.3.5 Home tokens, with the light mock values as fallbacks. Each component also has its own `--ab-list-*` / `--ab-crumbs-*` / `--ab-version-*` / `--ab-bottom-drawer-*` knobs.
@@ -43,7 +43,9 @@
43
43
 
44
44
  // โš›๏ธ React types + forwardRef
45
45
  import type { CSSProperties, KeyboardEvent, MouseEvent, ReactNode, Ref } from 'react';
46
- import { forwardRef } from 'react';
46
+ import { createElement, forwardRef } from 'react';
47
+ // ๐Ÿ”Œ 404 gaps: the link in effect (AbLinkProvider's, e.g. the i18n Link, or next/link) โ†’ locale prefix โœ…
48
+ import { useAbLink } from '../ab-link';
47
49
  // ๐Ÿงต class joiner
48
50
  import clsx from 'clsx';
49
51
  // ๐ŸŽจ styles
@@ -148,6 +150,8 @@ const AbButton = forwardRef<HTMLButtonElement | HTMLAnchorElement, AbButtonProps
148
150
  const srReason = getAbButtonSrReason({ disabled, isLoading, disabledReason });
149
151
  // ๐Ÿšซ any kind of blocked?
150
152
  const blocked = mode !== 'none';
153
+ // ๐Ÿ”Œ 404 gaps: link mode goes through AbLinkProvider (hooks run unconditionally, rules-of-hooks โœ…)
154
+ const Link = useAbLink();
151
155
 
152
156
  // ๐Ÿท๏ธ classes: pointer-events:none only for native mode (aria mode must stay focusable/hoverable)
153
157
  const classNames = clsx(
@@ -230,9 +234,12 @@ const AbButton = forwardRef<HTMLButtonElement | HTMLAnchorElement, AbButtonProps
230
234
  }
231
235
  // โœ… live link (no role=button: it navigates, so it is a link)
232
236
  return (
233
- <a ref={ref as Ref<HTMLAnchorElement>} id={id} href={href} className={classNames} style={style} hidden={hidden} onClick={guardClick} {...dataAttrs}>
234
- {content}
235
- </a>
237
+ // ๐Ÿ”Œ 404 gaps: the provided Link (locale-aware) instead of a bare <a>, so `/docs` โ†’ `/fr/docs` ๐ŸŒ
238
+ createElement(
239
+ Link, // ๐Ÿ”— AbLinkProvider's component (default next/link)
240
+ { ref: ref as Ref<HTMLAnchorElement>, id, href, className: classNames, style, hidden, onClick: guardClick, ...dataAttrs }, // ๐Ÿงพ same attrs as before
241
+ content, // ๐Ÿงฑ label, icons, badge
242
+ )
236
243
  );
237
244
  }
238
245
 
package/ab-card/index.tsx CHANGED
@@ -45,6 +45,8 @@ import type { ComponentType, ReactElement, ReactNode } from 'react';
45
45
  import clsx from 'clsx';
46
46
  // ๐Ÿ”— G42 link
47
47
  import Link from '../ab-link';
48
+ // ๐Ÿ”ฃ 404 gaps: the trailing arrow glyph
49
+ import AbIcon from '../ab-icon';
48
50
  // ๐ŸŽฌ hover colours + transform timing from the package (reduced motion โ†’ no transition)
49
51
  import 'ab-nextjs-animations/motion/styles.css';
50
52
  // ๐ŸŽจ styles
@@ -62,20 +64,26 @@ export interface AbCardProps {
62
64
  className?: string; // ๐Ÿท๏ธ
63
65
  as?: 'article' | 'div' | 'li'; // ๐Ÿงฑ default article
64
66
  id?: string; // ๐Ÿ†” 0.1.13: e.g. an in-page anchor target
67
+ // ===== 404 gaps (additive) =====
68
+ iconTile?: ReactNode; // ๐ŸŸซ NEW: a leading icon in a tinted square (e.g. <AbIcon name="rocket_launch" />)
69
+ arrow?: boolean; // โžก๏ธ NEW: a decorative trailing arrow, top-right (the 404 "Suggested" cards)
70
+ boldTitle?: boolean; // ๐Ÿ…ฑ๏ธ NEW: a bolder (700) title
65
71
  }
66
72
 
67
73
  /**
68
74
  * ๐Ÿƒ AbCard (G45): ONE link (the title) stretched over the card, so screen readers hear one link, not a
69
75
  * nested block of them. Hover lift is 2px, laptop and up only, and none under prefers-reduced-motion.
70
76
  */
71
- const AbCard = ({ title, href, description, eyebrow, media, footer, headingLevel = 3, className, as = 'article', id }: AbCardProps): ReactElement => {
77
+ const AbCard = ({ title, href, description, eyebrow, media, footer, headingLevel = 3, className, as = 'article', id, iconTile, arrow = false, boldTitle = false }: AbCardProps): ReactElement => {
72
78
  const H = `h${headingLevel}` as unknown as ComponentType<{ className?: string; children?: ReactNode }>; // โ™ฟ
73
79
  const Root = as as unknown as ComponentType<Record<string, unknown>>; // ๐Ÿงฑ
74
80
  return (
75
- <Root id={id} className={clsx('AbCard', styles.abCard, 'ab-motion-interactive', className)} data-ab-part="card" data-linked={href ? 'true' : 'false'}>
81
+ <Root id={id} className={clsx('AbCard', styles.abCard, 'ab-motion-interactive', className)} data-ab-part="card" data-linked={href ? 'true' : 'false'} data-arrow={arrow ? 'true' : undefined /* โžก๏ธ room for the arrow */}>
82
+ {iconTile && <span className={styles.abCardIconTile} data-ab-part="icon-tile" aria-hidden="true">{iconTile}</span> /* ๐ŸŸซ decorative tile */}
83
+ {arrow && <AbIcon name="arrow_forward" size={17} className={styles.abCardArrow} /> /* โžก๏ธ decorative (AbIcon is aria-hidden) */}
76
84
  {media && <div className={styles.abCardMedia} aria-hidden="true">{media}</div>}
77
85
  {eyebrow && <p className={styles.abCardEyebrow}>{eyebrow}</p>}
78
- <H className={styles.abCardTitle}>
86
+ <H className={clsx(styles.abCardTitle, boldTitle && styles.abCardTitleBold /* ๐Ÿ…ฑ๏ธ */)}>
79
87
  {href ? <Link href={href} className={styles.abCardLink}>{title}</Link> : title}
80
88
  </H>
81
89
  {description && <p className={styles.abCardDescription}>{description}</p>}
@@ -66,3 +66,23 @@
66
66
  @media (min-width: 1024px) and (hover: hover) and (prefers-reduced-motion: no-preference) {
67
67
  .abCard[data-linked='true']:hover { transform: translateY(-2px); } /* ๐ŸŽˆ */
68
68
  }
69
+
70
+ /* ===== 404 gaps (additive) ===== */
71
+ /* ๐ŸŸซ leading icon tile: icon in a tinted square (mock .pkg-ic) */
72
+ .abCardIconTile {
73
+ display: inline-flex; /* ๐Ÿ“ */
74
+ align-items: center; /* โ†•๏ธ */
75
+ justify-content: center; /* โ†”๏ธ */
76
+ width: 34px; /* ๐Ÿ“ */
77
+ height: 34px; /* ๐Ÿ“ */
78
+ border-radius: 9px; /* ๐Ÿ”ท */
79
+ background: var(--ab-color-tint, rgb(166 124 82 / 0.14)); /* ๐ŸŽจ tint (mock .pkg-ic) */
80
+ color: var(--ab-color-accent-text, var(--ab-color-primary, inherit)); /* ๐Ÿ–‹๏ธ accent glyph */
81
+ flex: none; /* ๐Ÿšซ no shrink */
82
+ }
83
+ /* โžก๏ธ trailing arrow, top-right (mock .sg-go) */
84
+ .abCardArrow { position: absolute; top: 14px; right: 12px; color: var(--ab-color-on-surface-variant, inherit); opacity: 0.7; } /* โžก๏ธ */
85
+ .abCard[data-arrow='true'] .abCardTitle, .abCard[data-arrow='true'] .abCardDescription { padding-right: 22px; } /* ๐Ÿงฑ keep text off the arrow */
86
+ /* ๐Ÿ…ฑ๏ธ bold title */
87
+ .abCardTitleBold { font-weight: 700; } /* ๐Ÿ…ฑ๏ธ */
88
+
package/ab-chip/index.tsx CHANGED
@@ -63,11 +63,16 @@ export interface AbChipProps {
63
63
  shape?: 'pill' | 'rounded'; // ๐Ÿ”ท 0.1.14: 'rounded' = 6px radius (default pill)
64
64
  mono?: boolean; // โŒจ๏ธ 0.1.14: Roboto Mono 11/600 (versions, package names)
65
65
  tone?: AbChipTone; // ๐ŸŽจ 0.1.14 (default 'neutral' = the legacy outline chip)
66
+ // ===== 404 gaps: long text =====
67
+ overflow?: 'ellipsis' | 'wrap'; // โœ‚๏ธ NEW: 'ellipsis' (default) clips to the parent width with "โ€ฆ"; 'wrap' breaks onto lines
68
+ title?: string; // ๐Ÿ’ฌ NEW: tooltip; defaults to the text itself when `children` is a string (so clipped text stays readable)
66
69
  }
67
70
 
68
71
  /** ๐Ÿท๏ธ Static chip: plain text, never interactive (use AbButton for actions). */
69
- export function AbChip({ children, dot, icon, as: Tag = 'span', className, style, size = 'md', shape = 'pill', mono = false, tone = 'neutral' }: AbChipProps): ReactElement {
72
+ export function AbChip({ children, dot, icon, as: Tag = 'span', className, style, size = 'md', shape = 'pill', mono = false, tone = 'neutral', overflow = 'ellipsis', title }: AbChipProps): ReactElement {
70
73
  const dotTone = dot === true ? 'bronze' : dot || undefined; // ๐ŸŽจ resolve dot colour
74
+ // ๐Ÿ’ฌ 404 gaps: full text as a tooltip while ellipsing (only when we know it: a plain string/number child)
75
+ const tip = title ?? (overflow === 'ellipsis' && (typeof children === 'string' || typeof children === 'number') ? String(children) : undefined);
71
76
  return (
72
77
  <Tag
73
78
  className={clsx('AbChip', styles.chip, mono && styles.mono, className)} style={style} data-ab-part="chip"
@@ -75,10 +80,12 @@ export function AbChip({ children, dot, icon, as: Tag = 'span', className, style
75
80
  data-shape={shape === 'rounded' ? 'rounded' : undefined} // ๐Ÿ”ท
76
81
  data-tone={tone === 'neutral' ? undefined : tone} // ๐ŸŽจ
77
82
  data-mono={mono ? 'true' : undefined} // โŒจ๏ธ
83
+ data-overflow={overflow} // โœ‚๏ธ 404 gaps: ellipsis | wrap
84
+ title={tip} // ๐Ÿ’ฌ 404 gaps: the full text on hover
78
85
  >
79
86
  {dotTone ? <span className={styles.dot} data-tone={dotTone} aria-hidden="true" /> : null /* ๐ŸŸข decorative */}
80
87
  {icon ? <span className={styles.icon} aria-hidden="true">{icon}</span> : null /* ๐Ÿ–ผ๏ธ decorative */}
81
- <span>{children}</span>
88
+ <span className={styles.text}>{children}</span>{/* โœ‚๏ธ 404 gaps: the part that ellipses / wraps */}
82
89
  </Tag>
83
90
  );
84
91
  }
@@ -96,3 +96,12 @@
96
96
  .chip[data-mono='true'] { font-family: var(--ab-font-code, 'Roboto Mono', ui-monospace, monospace); } /* โŒจ๏ธ */
97
97
  .chip[data-tone='accent'] { background: var(--ab-color-tint, #f4e7db); color: var(--ab-color-accent-text, #88603d); border-color: transparent; } /* ๐Ÿฅ‰ */
98
98
  .chip[data-tone='sage'] { background: rgb(119 141 121 / 0.12); color: var(--ab-color-sage-accent, #566a58); border-color: transparent; } /* ๐ŸŒฟ beta โ™ฟ AA (John): fallback = theme 0.3.5 light value */
99
+
100
+ /* ===== โœ‚๏ธ 404 gaps: long text (overflow="ellipsis" default ยท "wrap") ===== */
101
+ .chip { max-width: 100%; box-sizing: border-box; } /* ๐Ÿ“ never wider than the parent */
102
+ .text { min-width: 0; } /* ๐Ÿ“ lets the flex child shrink */
103
+ .chip[data-overflow='ellipsis'] .text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* โœ‚๏ธ "โ€ฆ" */
104
+ .chip[data-overflow='wrap'] { white-space: normal; } /* โ†ฉ๏ธ */
105
+ .chip[data-overflow='wrap'] .text { overflow-wrap: anywhere; } /* โ†ฉ๏ธ long paths like /docs/packages/button break too */
106
+ .chip[data-overflow='wrap'][data-size='sm'] { height: auto; min-height: var(--ab-chip-height, 20px); padding-block: 3px; line-height: 1.3; } /* ๐Ÿ“ grow with lines */
107
+
@@ -118,7 +118,7 @@
118
118
 
119
119
  /* โฌ…๏ธ the nav drawer: logo header, the version chip, a scrolling nav (44px rows, 15px) with a 72px fade, a pinned footer */
120
120
  .logoRow { display: flex; align-items: center; min-inline-size: 0; }
121
- .logoRow a { display: flex; align-items: center; color: inherit; }
121
+ .logoRow a { display: flex; align-items: center; color: inherit; min-block-size: 44px; } /* ๐Ÿ‘† 0.3.2 (God, 0.2.23 gaps): the logo link is a 44px-tall tap target (was 25px); the glyph keeps its size */
122
122
  .ver { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; block-size: 32px; padding: 0 8px 0 10px; margin: 0 0 8px 8px; box-sizing: border-box; border-radius: 8px; border: 1px solid var(--ab-color-border, rgb(92 64 48 / 0.13)); background: var(--ab-dr-card); color: var(--ab-color-muted, #6b5b50); font: 500 13px/1 var(--ab-font-body, 'Inter', inherit); }
123
123
  .ver b { font-family: var(--ab-font-mono, 'Roboto Mono', monospace); color: var(--ab-color-accent-text, #8b6340); font-weight: 600; }
124
124
  .ver > svg { inline-size: 18px; block-size: 18px; }
@@ -197,6 +197,8 @@
197
197
  buttons keep their hit area and the end inset stays 4px so the last one lines up with the 44px grid */
198
198
  /* ๐Ÿงฉ 0.2.3 no-JS language list: <details> around the globe; the list drops below it, end-aligned */
199
199
  .langDetails { position: relative; flex: none; } /* ๐Ÿ“Œ anchor */
200
+ /* ๐Ÿ”Ž 0.3.2 (Joseph): AbMobileHeader `search` slot, before the theme button; never shrinks, 4px from its neighbours */
201
+ .mhSearch { flex: none; display: inline-flex; align-items: center; margin-inline: 4px; } /* ๐Ÿ“ */
200
202
  .langDetails > summary { list-style: none; } /* ๐Ÿ™ˆ no disclosure triangle */
201
203
  .langDetails > summary::-webkit-details-marker { display: none; } /* ๐Ÿ™ˆ Safari */
202
204
  .langList { position: absolute; inset-inline-end: 0; inset-block-start: 100%; z-index: 30; margin: 4px 0 0; padding: 6px; min-inline-size: 180px; list-style: none; background: var(--ab-color-card, #fff); border: 1px solid var(--ab-color-border, rgb(92 64 48 / 0.13)); border-radius: 12px; box-shadow: 0 8px 24px rgb(25 18 12 / 0.12); } /* ๐Ÿ“‹ */
@@ -0,0 +1,99 @@
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: AbErrorHero - Server-safe (404 gaps)
28
+ * @file: ab-error-hero/index.tsx
29
+ * @type: Component (server-safe, no hooks) โ€” the 404 / error hero: big code + badge tile, title, message, hint, actions
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ *
32
+ * Example usage:
33
+ * 1+|> <AbErrorHero code="404" badge={<AbIcon name="link_off" />} title="Page not found" message="This page moved or never existed." actions={<AbButton label="Back to home" href="/" />} />
34
+ */
35
+
36
+ /*
37
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
38
+ * MOTTO: We'll always do more ๐Ÿ˜œ!!!
39
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
40
+ */
41
+
42
+ // โš›๏ธ React types
43
+ import type { ComponentType, ReactElement, ReactNode } from 'react';
44
+ // ๐Ÿงต classes
45
+ import clsx from 'clsx';
46
+ // ๐Ÿ”ฃ the default badge glyph (link_off, ab-nextjs-icons ^0.2.6, as in the mock)
47
+ import AbIcon from '../ab-icon';
48
+ // ๐ŸŽจ styles (static only: NO motion here, all motion lives in ab-nextjs-animations)
49
+ import styles from './styles.module.css';
50
+
51
+ /** โš™๏ธ props */
52
+ export interface AbErrorHeroProps {
53
+ code?: ReactNode; // ๐Ÿ”ข the big number / word, e.g. "404" (default), "500", "Oops"
54
+ badge?: ReactNode; // ๐ŸŸซ a small tilted tile pinned to the code, default <AbIcon name="link_off" /> (the mock); pass null to hide (decorative)
55
+ title: ReactNode; // ๐Ÿท๏ธ the h1, e.g. "Page not found"
56
+ message?: ReactNode; // ๐Ÿ“ the lede under the title
57
+ hint?: ReactNode; // ๐Ÿ’ก an optional row under the message, e.g. the bad path + "Did you mean โ€ฆ" (an AbChip)
58
+ actions?: ReactNode; // ๐Ÿ”˜ the actions slot: search trigger, buttons, โ€ฆ (rendered as-is, in order)
59
+ children?: ReactNode; // ๐Ÿงฉ anything below the actions (e.g. "Suggested" cards)
60
+ headingLevel?: 1 | 2; // โ™ฟ default 1 (it IS the page title on a 404); 2 when nested in a page
61
+ grid?: boolean; // โ ฟ the dotted backdrop behind the code (default true)
62
+ id?: string; // ๐Ÿ†” root id
63
+ className?: string; // ๐Ÿท๏ธ
64
+ }
65
+
66
+ /**
67
+ * ๐Ÿšง AbErrorHero: the hero of a 404 / error page (mock ai-mocks/404): a huge gradient code ("404") over a
68
+ * faded dot grid, a tilted badge tile (e.g. link_off), a title, a message, an optional hint and an actions slot.
69
+ * The code is decorative (aria-hidden) and announced once via a visually hidden prefix on the title.
70
+ * No hooks, no state, no motion: renders on the server.
71
+ */
72
+ const AbErrorHero = ({ code = '404', badge = <AbIcon name="link_off" /> /* ๐Ÿ”—๐Ÿšซ mock default */, title, message, hint, actions, children, headingLevel = 1, grid = true, id, className }: AbErrorHeroProps): ReactElement => {
73
+ const H = `h${headingLevel}` as unknown as ComponentType<{ className?: string; children?: ReactNode }>; // โ™ฟ h1 / h2
74
+ return (
75
+ <section id={id} className={clsx('AbErrorHero', styles.abErrorHero, className)} data-ab-part="error-hero">
76
+ {/* ๐ŸŽจ the art: dot grid + big code + badge tile (all decorative) */}
77
+ <div className={styles.abErrorHeroArt} aria-hidden="true">
78
+ {grid && <span className={styles.abErrorHeroGrid} data-ab-part="error-grid" /> /* โ ฟ faded dots */}
79
+ <span className={styles.abErrorHeroCode} data-ab-part="error-code">
80
+ {code /* ๐Ÿ”ข gradient text */}
81
+ {badge != null && <span className={styles.abErrorHeroBadge} data-ab-part="error-badge">{badge}</span> /* ๐ŸŸซ tilted tile */}
82
+ </span>
83
+ </div>
84
+ {/* ๐Ÿท๏ธ title: the code is read once here (visually hidden), then the words */}
85
+ <H className={styles.abErrorHeroTitle}>
86
+ {typeof code === 'string' || typeof code === 'number' ? <span className={styles.abErrorHeroSrOnly}>{code}: </span> : null /* ๐Ÿ—ฃ๏ธ "404: Page not found" */}
87
+ {title}
88
+ </H>
89
+ {message != null && <p className={styles.abErrorHeroMessage}>{message}</p> /* ๐Ÿ“ lede */}
90
+ {hint != null && <div className={styles.abErrorHeroHint} data-ab-part="error-hint">{hint}</div> /* ๐Ÿ’ก */}
91
+ {actions != null && <div className={styles.abErrorHeroActions} data-ab-part="error-actions">{actions}</div> /* ๐Ÿ”˜ */}
92
+ {children /* ๐Ÿงฉ */}
93
+ </section>
94
+ );
95
+ };
96
+
97
+ // ๐Ÿ“ฆ exports
98
+ export default AbErrorHero;
99
+ export { AbErrorHero };
@@ -0,0 +1,86 @@
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: AbErrorHero - Styles (404 gaps)
28
+ * @file: ab-error-hero/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
+ /* ๐Ÿšง hero column (mock .e404) โ€” static layout only, no transitions/animations (motion = ab-nextjs-animations) */
40
+ .abErrorHero { display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%; } /* ๐Ÿ“ */
41
+ /* ๐ŸŽจ the art box (mock .e-art: 520ร—190, mobile 100%ร—132) */
42
+ .abErrorHeroArt { position: relative; width: min(520px, 100%); height: 190px; display: flex; align-items: center; justify-content: center; } /* ๐Ÿ“ฆ */
43
+ /* โ ฟ dot grid, faded at the edges (mock .e-grid) */
44
+ .abErrorHeroGrid {
45
+ position: absolute; inset: -10px -40px; pointer-events: none; /* ๐Ÿ“ behind the code */
46
+ background-image: radial-gradient(circle, color-mix(in srgb, var(--ab-color-accent, #a67c52) 32%, transparent) 1.1px, transparent 1.4px); /* โ ฟ */
47
+ background-size: 18px 18px; /* ๐Ÿ“ grid step */
48
+ mask-image: radial-gradient(ellipse at center, #000 18%, transparent 68%); /* ๐ŸŒซ๏ธ fade out */
49
+ }
50
+ /* ๐Ÿ”ข the big gradient code (mock .e-num) */
51
+ .abErrorHeroCode {
52
+ position: relative; display: inline-flex; /* ๐Ÿ“ badge anchor */
53
+ font-size: 176px; line-height: 1; font-weight: 820; letter-spacing: -0.06em; /* ๐Ÿ”ค */
54
+ font-family: var(--ab-font-sans, Geist, ui-sans-serif, system-ui, sans-serif); /* ๐Ÿ”ค */
55
+ background: linear-gradient(180deg, var(--ab-color-error-code-top, #b88c60) 0%, var(--ab-color-accent, #a67c52) 55%, var(--ab-color-error-code-bottom, #8b6340) 100%); /* ๐Ÿฅ‰ bronze */
56
+ background-clip: text; color: transparent; /* ๐Ÿ–Œ๏ธ gradient text */
57
+ }
58
+ /* ๐ŸŸซ tilted badge tile (mock .e-badge: 46px, radius 14, rotate 8deg โ€” a static pose, not motion) */
59
+ .abErrorHeroBadge {
60
+ position: absolute; right: 8%; top: 12%; /* ๐Ÿ“ on the last digit */
61
+ width: 46px; height: 46px; border-radius: 14px; box-sizing: border-box; /* ๐Ÿ“ */
62
+ display: flex; align-items: center; justify-content: center; /* ๐Ÿ“ */
63
+ background: var(--ab-color-card, #fff); border: 1px solid var(--ab-color-border, rgb(92 64 48 / 0.13)); /* ๐ŸŽจ */
64
+ color: var(--ab-color-accent-text, #88603d); box-shadow: 0 8px 22px rgb(92 64 48 / 0.16); /* ๐ŸŽจ ๐ŸŒ— */
65
+ transform: rotate(8deg); /* ๐Ÿ“ static tilt */
66
+ }
67
+ .abErrorHeroBadge svg { width: 24px; height: 24px; } /* ๐Ÿ”ฃ */
68
+ /* ๐Ÿท๏ธ title ยท ๐Ÿ“ message (mock h1 34px / lede 15.5px) */
69
+ .abErrorHeroTitle { margin: 10px 0 0; font-size: 34px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.15; color: var(--ab-color-text, inherit); } /* ๐Ÿท๏ธ */
70
+ .abErrorHeroMessage { margin: 10px 0 0; max-width: 460px; font-size: 15.5px; line-height: 1.55; color: var(--ab-color-muted, inherit); } /* ๐Ÿ“ */
71
+ .abErrorHeroHint { margin-top: 14px; max-width: 100%; display: flex; justify-content: center; } /* ๐Ÿ’ก */
72
+ /* ๐Ÿ”˜ actions: search on its own row, buttons side by side (mock .e-search + .e-ctas) */
73
+ .abErrorHeroActions { margin-top: 22px; width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 10px; } /* ๐Ÿ”˜ */
74
+ .abErrorHeroActions > .AbSearchTrigger, .abErrorHeroActions > [data-ab-part='search-trigger'] { flex-basis: 100%; max-width: 440px; margin-inline: calc((100% - min(440px, 100%)) / 2); } /* ๐Ÿ” full row */
75
+ /* ๐Ÿ™ˆ visually hidden */
76
+ .abErrorHeroSrOnly { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; } /* ๐Ÿ™ˆ */
77
+ /* ๐Ÿ“ฑ mobile (mock .M: code 120px, art 132px, badge 38px) */
78
+ @media (max-width: 767px) {
79
+ .abErrorHeroArt { height: 132px; } /* ๐Ÿ“ */
80
+ .abErrorHeroCode { font-size: 120px; } /* ๐Ÿ”ข */
81
+ .abErrorHeroBadge { width: 38px; height: 38px; border-radius: 12px; } /* ๐ŸŸซ */
82
+ .abErrorHeroBadge svg { width: 20px; height: 20px; } /* ๐Ÿ”ฃ */
83
+ .abErrorHeroTitle { margin-top: 4px; font-size: 27px; } /* ๐Ÿท๏ธ */
84
+ .abErrorHeroMessage { margin-top: 6px; font-size: 14.5px; } /* ๐Ÿ“ */
85
+ .abErrorHeroActions { margin-top: 16px; } /* ๐Ÿ”˜ */
86
+ }
@@ -42,6 +42,7 @@ import arrowForward from 'ab-nextjs-icons/ab-icons/icons/arrow_forward'; // โญ
42
42
  import lightMode from 'ab-nextjs-icons/ab-icons/icons/light_mode'; // ๐ŸŒž AbThemeToggle
43
43
  import darkMode from 'ab-nextjs-icons/ab-icons/icons/dark_mode'; // ๐ŸŒ™ AbThemeToggle
44
44
  import computer from 'ab-nextjs-icons/ab-icons/icons/computer'; // ๐Ÿ–ฅ๏ธ AbThemeToggle (system)
45
+ import brightnessAuto from 'ab-nextjs-icons/ab-icons/icons/brightness_auto'; // ๐ŸŒ—๐Ÿ…ฐ๏ธ 0.3.2: system theme (AbThemeToggle, AbMobileHeader, AbSettingsDrawer; icons โ‰ฅ 0.2.7)
45
46
  import language from 'ab-nextjs-icons/ab-icons/icons/language'; // ๐ŸŒ AbLocaleSwitcher
46
47
  import contentCopy from 'ab-nextjs-icons/ab-icons/icons/content_copy'; // ๐Ÿ“‹ AbInstallSnippet
47
48
  import check from 'ab-nextjs-icons/ab-icons/icons/check'; // โœ… AbInstallSnippet (copied)
@@ -63,7 +64,8 @@ export const AB_ICON_BUILTINS: Record<string, AbIconSvgData> = {
63
64
  arrow_forward: arrowForward, // โญ๏ธ
64
65
  light_mode: lightMode, // ๐ŸŒž
65
66
  dark_mode: darkMode, // ๐ŸŒ™
66
- computer, // ๐Ÿ–ฅ๏ธ
67
+ computer, // ๐Ÿ–ฅ๏ธ (kept for apps that still ask for it)
68
+ brightness_auto: brightnessAuto, // ๐ŸŒ—๐Ÿ…ฐ๏ธ 0.3.2: the system theme glyph
67
69
  language, // ๐ŸŒ
68
70
  content_copy: contentCopy, // ๐Ÿ“‹
69
71
  check, // โœ…
@@ -59,14 +59,14 @@ import AbIcon from '../ab-icon';
59
59
  // ๐ŸŽจ the drawers v2 kit
60
60
  import kit from '../ab-drawer/kit.module.css';
61
61
  // ๐ŸŒ— 0.2.3: the shared theme state (AbThemeModeProvider)
62
- import { useAbThemeModeContext } from '../ab-theme-mode';
62
+ import { useAbThemeModeContext, AB_THEME_MODE_ICONS, AB_THEME_ICON_BUTTON_GLYPH } from '../ab-theme-mode';
63
63
 
64
64
  /** ๐ŸŒ— 0.2.3: the three theme modes (same names as ab-nextjs-hooks' AbThemeMode) */
65
65
  export type AbMobileHeaderThemeMode = 'light' | 'dark' | 'system';
66
66
  /** ๐Ÿ” 0.2.3: the 3-state cycle order */
67
67
  export const AB_MOBILE_HEADER_THEME_CYCLE: readonly AbMobileHeaderThemeMode[] = ['light', 'dark', 'system'];
68
- // ๐Ÿ”ฃ the glyph of each mode
69
- const THEME_ICON: Record<AbMobileHeaderThemeMode, string> = { light: 'light_mode', dark: 'dark_mode', system: 'computer' };
68
+ // ๐Ÿ”ฃ the glyph of each mode: 0.3.2 the shared map, the same one AbThemeToggle uses
69
+ const THEME_ICON: Readonly<Record<AbMobileHeaderThemeMode, string>> = AB_THEME_MODE_ICONS;
70
70
 
71
71
  /** ๐ŸŒ 0.2.3: one entry of the no-JS language list */
72
72
  export interface AbMobileHeaderLanguage {
@@ -87,6 +87,9 @@ export interface AbMobileHeaderProps {
87
87
  theme?: 'light' | 'dark'; // ๐ŸŒ— the resolved theme now
88
88
  onThemeChange?: (next: 'light' | 'dark') => void; // ๐ŸŒ— the toggle (it shows the mode it switches TO: a moon in light)
89
89
  actions?: ReactNode; // โž• more 44px buttons after the two (none in John's frame)
90
+ // ๐Ÿ”Ž 0.3.2 (Joseph, 0.2.23 gaps): a search pill (e.g. <AbSearchTrigger size="sm" />) placed after the globe and
91
+ // BEFORE the theme button
92
+ search?: ReactNode;
90
93
  labels?: { language?: string; toDark?: string; toLight?: string; toSystem?: string; header?: string }; // ๐ŸŒ "Change language", "Switch to dark theme", "Switch to light theme", (0.2.3) "Use the system theme", "Main header"
91
94
  languageExpanded?: boolean; // โ™ฟ aria-expanded on the globe while its sheet is open
92
95
  // ๐ŸŒ— 0.2.3: the 3-state theme (light โ†’ dark โ†’ system โ†’ light). When `onThemeModeChange` is set it replaces the
@@ -124,7 +127,7 @@ export interface AbMobileHeaderProps {
124
127
  * no menu button (the left drawer opens with an edge swipe). Put it in AbMainLayout's `mainHeader` with core
125
128
  * โ‰ฅ 0.2.1 `mobileHeader="main"`: the 56px row, its divider and the hidden app header come from core.
126
129
  */
127
- const AbMobileHeader = ({ logo, onLanguage, theme = 'light', onThemeChange, themeMode = 'system', onThemeModeChange, actions, row, labels = {}, languageExpanded, languageControls, languageRef, languageHref, languages, size = 'default', barAt = 'auto', className }: AbMobileHeaderProps): ReactElement => {
130
+ const AbMobileHeader = ({ logo, onLanguage, theme = 'light', onThemeChange, themeMode = 'system', onThemeModeChange, actions, search, row, labels = {}, languageExpanded, languageControls, languageRef, languageHref, languages, size = 'default', barAt = 'auto', className }: AbMobileHeaderProps): ReactElement => {
128
131
  const L = { language: 'Change language', toDark: 'Switch to dark theme', toLight: 'Switch to light theme', toSystem: 'Use the system theme', header: 'Main header', ...labels }; // ๐ŸŒ
129
132
  const name: Record<AbMobileHeaderThemeMode, string> = { light: L.toLight, dark: L.toDark, system: L.toSystem }; // โ™ฟ "switch TO" names
130
133
  // ๐ŸŒ— 0.2.3: under an AbThemeModeProvider with no theme props, the button is the 3-state cycle on the SHARED state
@@ -141,7 +144,7 @@ const AbMobileHeader = ({ logo, onLanguage, theme = 'light', onThemeChange, them
141
144
  ? AB_MOBILE_HEADER_THEME_CYCLE[(Math.max(0, AB_MOBILE_HEADER_THEME_CYCLE.indexOf(mode3)) + 1) % AB_MOBILE_HEADER_THEME_CYCLE.length] // ๐Ÿ”
142
145
  : theme === 'dark' ? 'light' : 'dark'; // ๐ŸŒ— the target
143
146
  const showTheme = three || !!onThemeChange; // ๐Ÿ‘€
144
- // ๐Ÿงฑ the 56px bar: logo ยท globe ยท theme ยท actions
147
+ // ๐Ÿงฑ the 56px bar: logo ยท globe ยท (0.3.2) search ยท theme ยท actions
145
148
  const bar = (
146
149
  <>
147
150
  <span className={kit.logoRow}>{logo}</span>
@@ -199,6 +202,10 @@ const AbMobileHeader = ({ logo, onLanguage, theme = 'light', onThemeChange, them
199
202
  <AbIcon name="language" size={24} />
200
203
  </button>
201
204
  )}
205
+ {search != null && (
206
+ // ๐Ÿ”Ž 0.3.2: the search pill slot, right before the theme button
207
+ <span className={kit.mhSearch} data-ab-part="mobile-header-search">{search}</span>
208
+ )}
202
209
  {showTheme && (
203
210
  <button
204
211
  type="button"
@@ -208,7 +215,7 @@ const AbMobileHeader = ({ logo, onLanguage, theme = 'light', onThemeChange, them
208
215
  data-ab-part="mobile-header-theme"
209
216
  data-theme-mode={three ? mode3 : undefined} // ๐Ÿงช 0.2.3: the current mode (3-state only)
210
217
  >
211
- <AbIcon name={THEME_ICON[next]} size={24} />
218
+ <AbIcon name={THEME_ICON[next]} size={AB_THEME_ICON_BUTTON_GLYPH} />
212
219
  </button>
213
220
  )}
214
221
  {actions}
@@ -59,6 +59,9 @@
59
59
  align-items: center; /* โ†”๏ธ */
60
60
  gap: 4px; /* โ†•๏ธ */
61
61
  min-width: 64px; /* ๐Ÿ‘† */
62
+ min-height: 44px; /* ๐Ÿ‘† 0.3.2 (God, 0.2.23 gaps): a 44px tap target (WCAG 2.5.5), was ~42px with indicator="none" */
63
+ justify-content: center; /* ๐ŸŽฏ 0.3.2: the pill + label stay centred in the taller target */
64
+ box-sizing: border-box; /* ๐Ÿ“ฆ 0.3.2: the 44px counts the padding */
62
65
  border: 0; /* ๐Ÿšซ (buttons) */
63
66
  background: none; /* ๐Ÿšซ */
64
67
  font: inherit; /* ๐Ÿ”ค */
@@ -67,7 +67,8 @@ export interface AbSearchTriggerProps {
67
67
  /** ๐Ÿ“ฑ 0.1.15 (God 00:08): a shorter label (e.g. "Search") that a compact AbAppBar shows below 768px instead of `label`
68
68
  * (CSS picks; only one is ever displayed, so the accessible name stays single). Home field only. */
69
69
  compactLabel?: string;
70
- size?: 'md' | 'sm'; // ๐Ÿ“ฑ 0.1.14 (P6): 'sm' = the mobile 34px "Search โŒ˜K" pill (label + key cap stay visible)
70
+ size?: 'md' | 'sm' | 'lg'; // ๐Ÿ“ฑ 0.1.14 (P6): 'sm' = the mobile 34px "Search โŒ˜K" pill (label + key cap stay visible)
71
+ // ๐Ÿ” 404 gaps: 'lg' = the 404 page's big 44px field (440px wide, full width on mobile; Home field look)
71
72
  className?: string; // ๐Ÿท๏ธ
72
73
  }
73
74
 
@@ -107,13 +108,13 @@ const AbSearchTrigger = ({ label = 'Search', onOpen, href, hotkey, shortcut, com
107
108
  }, [listen, onOpen]);
108
109
 
109
110
  // ๐Ÿ  P6: the Home looks (field / sm pill) show ONE key cap ("โŒ˜ K" / "โŒ˜K") and keep "coming soon" out of the field
110
- const home = variant === 'field' || size === 'sm';
111
+ const home = variant === 'field' || size === 'sm' || size === 'lg'; // ๐Ÿ” 404 gaps: lg is a (bigger) Home field
111
112
  // โŒจ๏ธ mock: "โŒ˜ K" (field) ยท "โŒ˜K" (sm). The gap is its own span so a compact app bar can drop it (0.1.15)
112
113
  const keyCap = <>{apple ? 'โŒ˜' : 'Ctrl'}{size === 'sm' ? null : <span data-ab-part="key-gap"> </span>}K</>;
113
114
  // ๐Ÿงฉ inner content
114
115
  const inner = home ? (
115
116
  <>
116
- <AbIcon name="search" size={size === 'sm' ? 17 : 18} className={styles.abSearchTriggerIcon} />
117
+ <AbIcon name="search" size={size === 'sm' ? 17 : size === 'lg' ? 20 : 18 /* ๐Ÿ” lg: 20px glyph (mock) */} className={styles.abSearchTriggerIcon} />
117
118
  <span className={styles.abSearchTriggerLabel} data-ab-part="search-label">{label}</span>
118
119
  {compactLabel != null && <span className={clsx(styles.abSearchTriggerLabel, styles.abSearchTriggerShort)} data-ab-part="search-label-compact">{compactLabel}</span> /* ๐Ÿ“ฑ 0.1.15 */}
119
120
  {/* ๐Ÿšง coming soon: tooltip + announced, never painted inside the field (spec ยง4) */}
@@ -135,7 +136,7 @@ const AbSearchTrigger = ({ label = 'Search', onOpen, href, hotkey, shortcut, com
135
136
  'aria-keyshortcuts': listen ? 'Meta+K Control+K' : undefined, // โ™ฟ only announced when bound (James #3)
136
137
  'data-compact': compact ? 'true' : undefined, // ๐Ÿ“ฑ
137
138
  'data-variant': variant === 'field' ? 'field' : undefined, // ๐Ÿ”Ž P6
138
- 'data-size': size === 'sm' ? 'sm' : undefined, // ๐Ÿ“ฑ P6
139
+ 'data-size': size === 'sm' || size === 'lg' ? size : undefined, // ๐Ÿ“ฑ P6 ยท ๐Ÿ” 404 gaps: lg
139
140
  title: home && comingSoon ? comingSoonLabel : undefined, // ๐Ÿ’ฌ P6: "coming soon" lives in the tooltip
140
141
  };
141
142
 
@@ -78,11 +78,15 @@
78
78
  font-size: 13.5px; line-height: 1; box-shadow: var(--ab-shadow-card, 0 1px 2px rgb(33 26 22 / 0.05)); /* ๐Ÿ”ค ๐ŸŒ— */
79
79
  }
80
80
  .abSearchTrigger[data-size='sm'] {
81
- flex: none; width: auto; max-width: none; height: 34px; /* ๐Ÿ“ */
81
+ flex: none; width: auto; max-width: none; height: 34px; /* ๐Ÿ“ the pill still LOOKS 34px (mock) */
82
+ position: relative; /* ๐Ÿ“Œ 0.3.2: anchors the invisible hit area below */
82
83
  gap: 6px; padding: 0 6px 0 10px; /* ๐Ÿ“ฆ */
83
84
  border: 1px solid var(--ab-color-border, rgb(92 64 48 / 0.13)); border-radius: var(--ab-radius-pill, 999px); /* ๐Ÿ’Š */
84
85
  background: var(--ab-color-card, #fff); color: var(--ab-color-faint, #807062); font-size: 13px; line-height: 1; /* ๐ŸŽจ ๐Ÿ”ค */
85
86
  }
87
+ /* ๐Ÿ‘† 0.3.2 (God, 0.2.23 gaps): an invisible 44px-tall hit area around the 34px pill (5px above + below), so the
88
+ tap target is โ‰ฅ 44px (WCAG 2.5.5) without changing the look */
89
+ .abSearchTrigger[data-size='sm']::after { content: ''; position: absolute; inset: -5px 0; } /* ๐Ÿซฅ hit area */
86
90
  .abSearchTrigger[data-variant='field']:hover, .abSearchTrigger[data-size='sm']:hover { border-color: color-mix(in srgb, var(--ab-color-accent, #a67c52) 40%, transparent); } /* ๐Ÿ–ฑ๏ธ */
87
91
  .abSearchTrigger[data-variant='field']:focus-visible, .abSearchTrigger[data-size='sm']:focus-visible { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: 2px; } /* โ™ฟ */
88
92
  /* โŒจ๏ธ the single key cap (mock `kbd`): 20px, radius 5, 2px bottom border, 11/600 --muted */
@@ -97,3 +101,18 @@
97
101
 
98
102
  /* ๐Ÿ“ฑ 0.1.15: the short label is hidden unless a compact AbAppBar (< 768px) swaps it in */
99
103
  .abSearchTriggerShort { display: none; }
104
+
105
+ /* ===== ๐Ÿ” 404 gaps: size="lg" (mock .e-search: 440ร—44, radius 12, 14.5px) ===== */
106
+ .abSearchTrigger[data-size='lg'] {
107
+ display: inline-flex; align-items: center; gap: 8px; /* ๐Ÿ“ */
108
+ width: min(440px, 100%); height: 44px; padding: 0 8px 0 14px; /* ๐Ÿ“ full width on narrow screens */
109
+ border: 1px solid var(--ab-color-border, #e8dcd2); border-radius: 12px; /* ๐Ÿ”ท */
110
+ background: var(--ab-color-card, #fff); color: var(--ab-color-faint, #807062); /* ๐ŸŽจ */
111
+ font-size: 14.5px; line-height: 1; box-shadow: var(--ab-shadow-card, 0 1px 2px rgb(33 26 22 / 0.05)); /* ๐Ÿ”ค ๐ŸŒ— */
112
+ text-decoration: none; box-sizing: border-box; /* ๐Ÿ”— ๐Ÿ“ฆ */
113
+ }
114
+ .abSearchTrigger[data-size='lg']:hover { border-color: color-mix(in srgb, var(--ab-color-accent, #a67c52) 40%, transparent); } /* ๐Ÿ–ฑ๏ธ */
115
+ .abSearchTrigger[data-size='lg']:focus-visible { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: 2px; } /* โ™ฟ */
116
+ .abSearchTrigger[data-size='lg'] .abSearchTriggerCap { margin-left: auto; } /* โŒจ๏ธ key cap pinned right */
117
+ .abSearchTrigger[data-size='lg'][aria-disabled='true'] { opacity: 1; } /* ๐Ÿšง same look while coming soon */
118
+
@@ -79,4 +79,12 @@ export function useAbThemeModeContext(): AbThemeModeContextValue | null {
79
79
  }
80
80
 
81
81
  // ๐Ÿ“ฆ exports
82
+ /**
83
+ * ๐Ÿ”ฃ 0.3.2 (Joseph, 0.2.23 gaps): the ONE glyph per theme mode, shared by AbMobileHeader's theme button and
84
+ * AbThemeToggle, so the two never drift apart (AbIcons names)
85
+ */
86
+ export const AB_THEME_MODE_ICONS: Readonly<Record<AbThemeMode, string>> = { light: 'light_mode', dark: 'dark_mode', system: 'brightness_auto' }; // ๐ŸŒž ๐ŸŒ™ ๐ŸŒ—๐Ÿ…ฐ๏ธ (0.3.2, God: brightness_auto everywhere, was 'computer')
87
+ /** ๐Ÿ“ 0.3.2: the glyph size of a single theme icon button (AbMobileHeader + AbThemeToggle variant="icon") */
88
+ export const AB_THEME_ICON_BUTTON_GLYPH = 24; // ๐Ÿ“ px
89
+
82
90
  export default AbThemeModeProvider;
@@ -53,7 +53,7 @@ import AbIcon from '../ab-icon';
53
53
  // ๐ŸŽจ styles
54
54
  import styles from './styles.module.css';
55
55
  // ๐ŸŒ— 0.2.3: the shared theme state (AbThemeModeProvider), when there is one
56
- import { useAbThemeModeContext, type AbThemeModeContextValue } from '../ab-theme-mode';
56
+ import { useAbThemeModeContext, AB_THEME_MODE_ICONS, AB_THEME_ICON_BUTTON_GLYPH, type AbThemeModeContextValue } from '../ab-theme-mode';
57
57
  import { AB_MOTION } from 'ab-nextjs-animations/motion'; // ๐ŸŽฌ transition class names (ab-nextjs-animations >= 0.2.4)
58
58
  import 'ab-nextjs-animations/motion/styles.css'; // ๐ŸŽจ .ab-motion-*
59
59
 
@@ -83,14 +83,15 @@ export interface AbThemeToggleProps {
83
83
  size?: 'sm' | 'md'; // ๐Ÿ“ sm = 32px, md = 40px segments (hit area โ‰ฅ 24px either way)
84
84
  appearance?: 'fill' | 'thumb'; // ๐ŸŒ— 0.1.14 (P7): 'thumb' = the Home pill (28px segments, raised card thumb, filled active glyph). Default 'fill'
85
85
  // ๐ŸŽฏ 0.1.14 (John): icon variant only. 'target' = glyph + name of the mode a click switches TO
86
- // (moon in light, sun in dark, like the Home mock). Default 'target' with appearance="thumb", else 'current' (unchanged)
86
+ // (moon in light, sun in dark, like the Home mock). 0.3.2 (God): default 'target' for every appearance (was 'current' for fill)
87
87
  iconShows?: 'current' | 'target';
88
88
  className?: string; // ๐Ÿท๏ธ
89
89
  style?: CSSProperties; // ๐ŸŽจ
90
90
  }
91
91
 
92
92
  // ๐Ÿ”ฃ default glyphs (AbIcons names)
93
- const DEFAULT_ICON_NAMES: Record<AbThemeMode, string> = { light: 'light_mode', dark: 'dark_mode', system: 'computer' };
93
+ // ๐Ÿ”— 0.3.2 (Joseph): the shared map, so the glyphs match AbMobileHeader's theme button
94
+ const DEFAULT_ICON_NAMES: Readonly<Record<AbThemeMode, string>> = AB_THEME_MODE_ICONS;
94
95
 
95
96
  /**
96
97
  * @name getNextAbThemeMode
@@ -142,14 +143,16 @@ function AbThemeToggleView(props: AbThemeToggleProps & { engine: Pick<AbThemeMod
142
143
  };
143
144
 
144
145
  // ๐Ÿ–ผ๏ธ glyph for a mode (decorative: the label names it)
145
- // P7 thumb: 17px (segments) / 22px (mobile icon), filled while active (spec ยง2 icons)
146
+ // P7 thumb: 17px segments, filled while active (spec ยง2 icons)
147
+ // 0.3.2 (Joseph): variant="icon" uses the header's 24px glyph (was 22 thumb / 20), so it matches AbMobileHeader
148
+ const glyphSize = variant === 'icon' ? AB_THEME_ICON_BUTTON_GLYPH : thumb ? 17 : 20; // ๐Ÿ“
146
149
  const glyph = (mode: AbThemeMode, active = false) =>
147
- icons?.[mode] ?? <AbIcon name={DEFAULT_ICON_NAMES[mode]} size={thumb ? (variant === 'icon' ? 22 : 17) : 20} variant={thumb && active ? 'filled' : undefined} />;
150
+ icons?.[mode] ?? <AbIcon name={DEFAULT_ICON_NAMES[mode]} size={glyphSize} variant={thumb && active ? 'filled' : undefined} />;
148
151
 
149
152
  // ๐Ÿ”˜ single cycling button variant
150
153
  if (variant === 'icon') {
151
154
  const next = modes[(Math.max(0, modes.indexOf(current)) + 1) % modes.length]; // โญ๏ธ
152
- const target = (iconShows ?? (thumb ? 'target' : 'current')) === 'target'; // ๐ŸŽฏ John: Home mock shows the target
155
+ const target = (iconShows ?? 'target') === 'target'; // ๐ŸŽฏ 0.3.2 (God): always the target by default, like AbMobileHeader (was 'current' for fill)
153
156
  const name = target ? (labels.switchTo?.[next] ?? `${labels.group}: ${labels[next]}`) : `${labels.group}: ${labels[current]}`; // โ™ฟ
154
157
  return (
155
158
  <button
@@ -61,12 +61,36 @@
61
61
  cursor: pointer; /* ๐Ÿ‘† */
62
62
  --ab-motion-duration: var(--ab-motion-duration-short, 160ms); /* ๐ŸŽž๏ธ colour fade = .ab-motion-colors (ab-nextjs-animations) */
63
63
  }
64
+ /* ๐Ÿ‘† 0.3.2 (God, 0.2.23 gaps): the single icon button is a 44px tap target (was 40px), the same 44ร—44 as
65
+ AbMobileHeader's theme button; the segments keep 40/32px (radios inside one pill) */
66
+ .icon {
67
+ width: 44px; /* ๐Ÿ“ */
68
+ height: 44px; /* ๐Ÿ“ */
69
+ }
64
70
  [data-size='sm'] .segment,
65
71
  .icon[data-size='sm'] {
66
72
  width: 32px; /* ๐Ÿ“ */
67
73
  height: 32px; /* ๐Ÿ“ */
68
74
  }
69
75
 
76
+ /* ๐Ÿ‘† 0.3.2 (God): every radio segment and the sm icon button get an invisible 44ร—44 hit area centred on them, so
77
+ the 40/32/28px visuals stay while the tap target is โ‰ฅ 44px (WCAG 2.5.5). Neighbouring areas overlap by a few px;
78
+ the later segment wins there, which is fine for adjacent radios */
79
+ .segment,
80
+ .icon {
81
+ position: relative; /* ๐Ÿ“Œ anchors the hit area */
82
+ }
83
+ .segment::after,
84
+ .icon[data-size='sm']::after {
85
+ content: ''; /* ๐Ÿซฅ invisible */
86
+ position: absolute; /* ๐Ÿ“Œ */
87
+ left: 50%; /* โ†”๏ธ centred */
88
+ top: 50%; /* โ†•๏ธ centred */
89
+ width: 44px; /* ๐Ÿ‘† */
90
+ height: 44px; /* ๐Ÿ‘† */
91
+ transform: translate(-50%, -50%); /* ๐ŸŽฏ */
92
+ }
93
+
70
94
  /* โœ… selected */
71
95
  .segment[aria-checked='true'] {
72
96
  color: var(--ab-color-on-primary, #fff); /* ๐ŸŽจ */
@@ -100,5 +124,5 @@
100
124
  }
101
125
  .group[data-appearance='thumb'] .segment[aria-checked='false']:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } /* ๐Ÿ–ฑ๏ธ */
102
126
  .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 */
127
+ .icon[data-appearance='thumb'] { width: 44px; height: 44px; border-radius: var(--ab-radius-button, 10px); color: var(--ab-color-muted, #6b5b50); } /* ๐Ÿ“ฑ 0.3.2: 44ร—44 (was 40), 24px glyph like the header */
104
128
  .icon[data-appearance='thumb']:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); }
package/ab-toc/index.tsx CHANGED
@@ -48,6 +48,8 @@
48
48
  import type { ReactElement, ReactNode } from 'react';
49
49
  // ๐Ÿงต classes
50
50
  import clsx from 'clsx';
51
+ // ๐Ÿ”— 404 gaps: provider-aware link for the `links` variant (locale prefix via AbLinkProvider)
52
+ import AbLink from '../ab-link';
51
53
  // ๐ŸŽจ styles
52
54
  import styles from './styles.module.css';
53
55
 
@@ -73,6 +75,10 @@ export interface AbTocItem {
73
75
  id: string; // ๐Ÿ†” the heading id (link target)
74
76
  label: string; // ๐Ÿท๏ธ
75
77
  level?: 2 | 3 | 4; // ๐Ÿ“ indent (default 2)
78
+ // ===== 404 gaps: variant="links" =====
79
+ href?: string; // ๐Ÿ”— NEW: a page link (links variant); falls back to `#id`
80
+ description?: ReactNode; // ๐Ÿ“ NEW: a small second line, e.g. "Getting started" (links variant)
81
+ icon?: ReactNode; // ๐Ÿ”ฃ NEW: a leading icon (links variant, decorative)
76
82
  }
77
83
 
78
84
  /** โš™๏ธ props */
@@ -84,6 +90,7 @@ export interface AbTocProps {
84
90
  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
91
  id?: string; // ๐Ÿ†” root id (default "ab-toc"); the title gets `${id}-title`
86
92
  className?: string; // ๐Ÿท๏ธ
93
+ variant?: 'toc' | 'links'; // ๐Ÿ”— 404 gaps: 'links' = a plain link list (e.g. "Popular pages"), no rail, no scroll spy (default 'toc')
87
94
  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
88
95
  }
89
96
 
@@ -92,12 +99,32 @@ export interface AbTocProps {
92
99
  * aria-current="location". Pair with `useAbScrollSpy` from ab-nextjs-hooks 0.1.7 for `activeId`.
93
100
  * No hooks here, so it also renders on the server.
94
101
  */
95
- const AbToc = ({ items, activeId, label, title = label ?? 'On this page', onNavigate, id = 'ab-toc', className, footer }: AbTocProps): ReactElement | null => {
102
+ const AbToc = ({ items, activeId, label, title = label ?? 'On this page', onNavigate, id = 'ab-toc', className, footer, variant = 'toc' }: AbTocProps): ReactElement | null => {
96
103
  if (!items.length) return null; // ๐Ÿ™ˆ nothing to list
97
104
  const headingId = `${id}-title`; // ๐Ÿ†”
98
105
  return (
99
- <nav id={id} className={clsx('AbToc', styles.abToc, className)} data-ab-part="toc" aria-labelledby={headingId}>
106
+ <nav id={id} className={clsx('AbToc', styles.abToc, className)} data-ab-part="toc" data-variant={variant === 'links' ? 'links' : undefined /* ๐Ÿ”— 404 gaps */} aria-labelledby={headingId}>
100
107
  <p id={headingId} className={styles.abTocTitle}>{title}</p>
108
+ {variant === 'links' ? (
109
+ // ๐Ÿ”— 404 gaps: plain link list (mock .pops / .pop): icon ยท bold label ยท small description
110
+ <ul className={styles.abTocLinks}>
111
+ {items.map((it) => (
112
+ <li key={it.id}>
113
+ <AbLink
114
+ href={it.href ?? `#${it.id}`} // ๐Ÿ”— page link (provider adds the locale) or in-page anchor
115
+ className={styles.abTocLinksItem} // ๐ŸŽจ
116
+ aria-current={it.id === activeId ? 'page' : undefined} // โ™ฟ the current page, if any
117
+ >
118
+ {it.icon != null && <span className={styles.abTocLinksIcon} aria-hidden="true">{it.icon}</span> /* ๐Ÿ”ฃ decorative */}
119
+ <span className={styles.abTocLinksText}>
120
+ <b className={styles.abTocLinksLabel}>{it.label}</b>{/* ๐Ÿท๏ธ */}
121
+ {it.description != null && <small className={styles.abTocLinksDesc}>{it.description}</small> /* ๐Ÿ“ */}
122
+ </span>
123
+ </AbLink>
124
+ </li>
125
+ ))}
126
+ </ul>
127
+ ) : (
101
128
  <ol className={styles.abTocList}>
102
129
  {items.map((it) => {
103
130
  const on = it.id === activeId; // ๐ŸŽฏ
@@ -116,6 +143,7 @@ const AbToc = ({ items, activeId, label, title = label ?? 'On this page', onNavi
116
143
  );
117
144
  })}
118
145
  </ol>
146
+ )}
119
147
  {footer != null && (
120
148
  <>
121
149
  <hr className={styles.abTocSep} />{/* โž– mock .toc-sep */}
package/ab-toc/promo.tsx CHANGED
@@ -54,6 +54,9 @@ export interface AbTocPromoProps {
54
54
  children?: ReactNode; // ๐Ÿ“ the 11.5px muted subtitle (a `<code>` inside is 10.5px)
55
55
  badge?: ReactNode; // ๐Ÿ†• the small chip (default "New"; `null` = none)
56
56
  href?: string; // ๐Ÿ”— makes the title a link (the whole card clicks)
57
+ // โ™ฟ 0.3.2 (God, 0.2.23 gaps): the card sits INSIDE the page aside, so by default its root is a plain <div> (no
58
+ // unnamed nested <aside> landmark). With `label` it becomes a NAMED <aside aria-label={label}> instead
59
+ label?: string;
57
60
  className?: string; // ๐Ÿท๏ธ
58
61
  }
59
62
 
@@ -61,13 +64,20 @@ export interface AbTocPromoProps {
61
64
  * ๐Ÿ†• AbTocPromo โ€” the aside's "New" card (mock `.toc-card`): a rounded (12px), evenly padded (12px) container on
62
65
  * the card colour with a 1px border; a small "New" chip, a smaller title and a relatively smaller subtitle.
63
66
  */
64
- const AbTocPromo = ({ title, children, badge = 'New', href, className }: AbTocPromoProps): ReactElement => (
65
- <aside className={clsx('AbTocPromo', styles.abTocPromo, className)} data-ab-part="toc-promo">
66
- {badge != null && <span className={styles.abTocPromoChip}>{badge}</span> /* ๐Ÿ†• */}
67
- <b className={styles.abTocPromoTitle}>{href ? <Link href={href} className={styles.abTocPromoLink}>{title}</Link> : title}</b> {/* ๐Ÿท๏ธ */}
68
- {children != null && <small className={styles.abTocPromoText}>{children}</small> /* ๐Ÿ“ */}
69
- </aside>
70
- );
67
+ const AbTocPromo = ({ title, children, badge = 'New', href, label, className }: AbTocPromoProps): ReactElement => {
68
+ const Root = label ? 'aside' : 'div'; // โ™ฟ 0.3.2: a landmark only when it has a name
69
+ return (
70
+ <Root
71
+ className={clsx('AbTocPromo', styles.abTocPromo, className)} // ๐ŸŽจ
72
+ aria-label={label || undefined} // ๐Ÿท๏ธ 0.3.2: names the <aside> (absent on the <div>)
73
+ data-ab-part="toc-promo" // ๐Ÿ—‚๏ธ
74
+ >
75
+ {badge != null && <span className={styles.abTocPromoChip}>{badge}</span> /* ๐Ÿ†• */}
76
+ <b className={styles.abTocPromoTitle}>{href ? <Link href={href} className={styles.abTocPromoLink}>{title}</Link> : title}</b> {/* ๐Ÿท๏ธ */}
77
+ {children != null && <small className={styles.abTocPromoText}>{children}</small> /* ๐Ÿ“ */}
78
+ </Root>
79
+ );
80
+ };
71
81
 
72
82
  // ๐Ÿ“ฆ exports
73
83
  export default AbTocPromo;
@@ -80,3 +80,19 @@
80
80
  .abTocPromoLink { color: inherit; text-decoration: none; } /* ๐Ÿ”— */
81
81
  .abTocPromoLink::after { content: ''; position: absolute; inset: 0; border-radius: inherit; } /* ๐Ÿ–ฑ๏ธ whole card */
82
82
  .abTocPromo:has(.abTocPromoLink:focus-visible) { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: 2px; } /* โ™ฟ */
83
+
84
+ /* ๐Ÿ”— 404 gaps: variant="links" (mock .pops / .pop), a plain link list without the rail */
85
+ .abTocLinks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; } /* ๐Ÿ“‹ */
86
+ .abTocLinksItem {
87
+ display: flex; align-items: center; gap: 10px; /* ๐Ÿ“ icon ยท text */
88
+ margin: 0 -8px; padding: 7px 8px; border-radius: 9px; /* ๐Ÿ“ฆ mock */
89
+ color: var(--ab-color-text, var(--ab-color-on-surface, inherit)); text-decoration: none; /* ๐Ÿ–‹๏ธ */
90
+ }
91
+ .abTocLinksItem:hover, .abTocLinksItem[aria-current='page'] { background: var(--ab-color-tint, rgb(166 124 82 / 0.1)); } /* ๐Ÿ–ฑ๏ธ ๐ŸŽฏ */
92
+ .abTocLinksItem:focus-visible { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: -2px; } /* โ™ฟ */
93
+ .abTocLinksIcon { display: inline-flex; flex: none; color: var(--ab-color-accent-text, var(--ab-color-primary, inherit)); } /* ๐Ÿ”ฃ */
94
+ .abTocLinksIcon svg { width: 17px; height: 17px; } /* ๐Ÿ“ */
95
+ .abTocLinksText { min-width: 0; } /* ๐Ÿ“ */
96
+ .abTocLinksLabel { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; } /* ๐Ÿท๏ธ */
97
+ .abTocLinksDesc { display: block; margin-top: 1px; font-size: 11.5px; color: var(--ab-color-faint, var(--ab-color-on-surface-variant, inherit)); } /* ๐Ÿ“ */
98
+
package/index.ts CHANGED
@@ -125,6 +125,8 @@ const supportedComponents: Array<ComponentCatalogEntry> = [
125
125
  // ๐Ÿ†• 0.1.13 docs shell (AbToc) โ€” server-safe, no hooks
126
126
  { name: 'AbToc', file: 'ab-toc/index.tsx', kind: 'server', status: 'Done' },
127
127
  { name: 'AbTocPromo', file: 'ab-toc/promo.tsx', kind: 'server', status: 'Done' }, // ๐Ÿ†• 0.2.1 the aside "New" card
128
+ // ๐Ÿšง 404 gaps: AbErrorHero (big code + badge tile, title, message, actions) โ€” server-safe, no hooks
129
+ { name: 'AbErrorHero', file: 'ab-error-hero/index.tsx', kind: 'server', status: 'Done' },
128
130
  // ๐Ÿ†• 0.1.14 (G53): AbDrawer + presets
129
131
  { name: 'AbDrawer', file: 'ab-drawer/index.tsx', kind: 'client', status: 'Done' },
130
132
  { name: 'AbDrawerList', file: 'ab-drawer-list/index.tsx', kind: 'client', status: 'Done' },
@@ -186,6 +188,9 @@ export { default as AbToc, getAbMainScroller, AB_MAIN_SCROLLER_SELECTOR } from '
186
188
  export { default as AbTocPromo } from './ab-toc/promo.tsx'
187
189
  export type { AbTocPromoProps } from './ab-toc/promo.tsx'
188
190
  export type { AbTocItem, AbTocProps } from './ab-toc/index.tsx'
191
+ // ๐Ÿšง 404 gaps: the 404 / error hero (also at `ab-nextjs-components/ab-error-hero`)
192
+ export { default as AbErrorHero } from './ab-error-hero/index.tsx'
193
+ export type { AbErrorHeroProps } from './ab-error-hero/index.tsx'
189
194
  // ๐Ÿ—„๏ธ 0.1.14 (G53): AbDrawer + useAbDrawer (also at `ab-nextjs-components/ab-drawer`)
190
195
  export { default as AbDrawer, useAbDrawer, getAbDrawerHost, AB_DRAWER_DURATION, AB_DRAWER_RETURN_FOCUS } from './ab-drawer/index.tsx'
191
196
  // ๐Ÿค 0.2.0 drawers v2: edge swipes + the swipe / snap rules
@@ -207,7 +212,7 @@ export { default as AbMobileHeader } from './ab-mobile-header/index.tsx'
207
212
  export type { AbMobileHeaderProps, AbMobileHeaderThemeMode, AbMobileHeaderLanguage } from './ab-mobile-header/index.tsx'
208
213
  export { AB_MOBILE_HEADER_THEME_CYCLE } from './ab-mobile-header/index.tsx' // ๐ŸŒ— 0.2.3
209
214
  // ๐ŸŒ— 0.2.3 (Joseph, Welcome 0.2.21): one shared theme mode for every toggle
210
- export { AbThemeModeProvider, useAbThemeModeContext } from './ab-theme-mode/index.tsx'
215
+ export { AbThemeModeProvider, useAbThemeModeContext, AB_THEME_MODE_ICONS, AB_THEME_ICON_BUTTON_GLYPH } from './ab-theme-mode/index.tsx' // ๐Ÿ”ฃ 0.3.2: + the shared theme glyphs
211
216
  export type { AbThemeModeProviderProps, AbThemeModeContextValue } from './ab-theme-mode/index.tsx'
212
217
  // ๐Ÿ†• 0.2.0 drawers v2: AbSearchDrawer
213
218
  export { default as AbSearchDrawer, addAbSearchRecent, highlightAbSearch, AB_SEARCH_RECENT_KEY } from './ab-search-drawer/index.tsx'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ab-nextjs-components",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "๐Ÿš€ A lightweight collection of server & client React components created by Abraham Ukachi, and optimized for Next.js applications ๐Ÿ˜Ž.",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -42,7 +42,7 @@
42
42
  "peerDependencies": {
43
43
  "ab-nextjs-animations": "^0.2.5",
44
44
  "ab-nextjs-hooks": "^0.1.7",
45
- "ab-nextjs-icons": "^0.2.4",
45
+ "ab-nextjs-icons": "^0.2.7",
46
46
  "ab-nextjs-theme": "^0.3.7",
47
47
  "clsx": "^2",
48
48
  "next": "^16.3.4",
@@ -55,7 +55,7 @@
55
55
  "@types/react": "^19",
56
56
  "ab-nextjs-animations": "^0.2.5",
57
57
  "ab-nextjs-hooks": "^0.1.7",
58
- "ab-nextjs-icons": "^0.2.4",
58
+ "ab-nextjs-icons": "^0.2.7",
59
59
  "ab-nextjs-theme": "^0.3.7",
60
60
  "clsx": "^2.1.1",
61
61
  "esbuild": "^0.28.2",
@@ -140,7 +140,8 @@
140
140
  "ab-app-bar",
141
141
  "ab-card",
142
142
  "ab-package-card",
143
- "ab-toc"
143
+ "ab-toc",
144
+ "ab-error-hero"
144
145
  ],
145
146
  "exports": {
146
147
  ".": {
@@ -238,6 +239,7 @@
238
239
  "./ab-card": "./ab-card/index.tsx",
239
240
  "./ab-package-card": "./ab-package-card/index.tsx",
240
241
  "./ab-toc": "./ab-toc/index.tsx",
242
+ "./ab-error-hero": "./ab-error-hero/index.tsx",
241
243
  "./ab-sidebar/view": "./ab-sidebar/view.tsx",
242
244
  "./ab-navbar/view": "./ab-navbar/view.tsx"
243
245
  },
@@ -40,6 +40,8 @@
40
40
  import type { CSSProperties, ReactElement, ReactNode } from 'react';
41
41
  // ๐Ÿงต class joiner
42
42
  import clsx from 'clsx';
43
+ // ๐Ÿ”— 404 gaps: the provider-aware link (client component, fine to render from a server twin)
44
+ import AbLink from '../../ab-link';
43
45
  // ๐ŸŽจ styles (server copy)
44
46
  // ๐Ÿงฌ 0.2.3 (Joseph 03:41): ONE source for the button box โ€” the client module's CSS (no server copy to drift)
45
47
  import styles from '../../ab-button/styles.module.css';
@@ -141,7 +143,8 @@ const AbButton = ({
141
143
  return <span id={id} role="link" aria-disabled="true" tabIndex={mode === 'aria' ? 0 : -1} className={classNames} style={style} hidden={hidden} {...dataAttrs}>{content}</span>;
142
144
  }
143
145
  // โœ… a link is a link (no role=button)
144
- return <a id={id} href={href} className={classNames} style={style} hidden={hidden} {...dataAttrs}>{content}</a>;
146
+ // ๐Ÿ”Œ 404 gaps: AbLink (a client leaf) reads AbLinkProvider from the client tree โ†’ locale prefix ๐ŸŒ
147
+ return <AbLink id={id} href={href} className={classNames} style={style} hidden={hidden} {...dataAttrs}>{content}</AbLink>;
145
148
  }
146
149
 
147
150
  // ๐Ÿ”˜ button: aria mode is type="button" so a disabled CTA can never submit, even without JS
package/types/index.d.ts CHANGED
@@ -81,6 +81,9 @@ export { default as AbToc, getAbMainScroller, AB_MAIN_SCROLLER_SELECTOR } from '
81
81
  export { default as AbTocPromo } from '../ab-toc/promo.tsx';
82
82
  export type { AbTocPromoProps } from '../ab-toc/promo.tsx';
83
83
  export type { AbTocItem, AbTocProps } from '../ab-toc/index.tsx';
84
+ // ๐Ÿšง 404 gaps: AbErrorHero
85
+ export { default as AbErrorHero } from '../ab-error-hero/index.tsx';
86
+ export type { AbErrorHeroProps } from '../ab-error-hero/index.tsx';
84
87
  // ๐Ÿ—„๏ธ 0.1.14 (G53): AbDrawer + useAbDrawer (also at `ab-nextjs-components/ab-drawer`)
85
88
  export { default as AbDrawer, useAbDrawer, getAbDrawerHost, AB_DRAWER_DURATION, AB_DRAWER_RETURN_FOCUS } from '../ab-drawer/index.tsx';
86
89
  // ๐Ÿค 0.2.0 drawers v2: edge swipes + the swipe / snap rules
@@ -102,7 +105,7 @@ export { default as AbMobileHeader } from '../ab-mobile-header/index.tsx';
102
105
  export type { AbMobileHeaderProps, AbMobileHeaderThemeMode, AbMobileHeaderLanguage } from '../ab-mobile-header/index.tsx';
103
106
  export { AB_MOBILE_HEADER_THEME_CYCLE } from '../ab-mobile-header/index.tsx'; // ๐ŸŒ— 0.2.3
104
107
  // ๐ŸŒ— 0.2.3 (Joseph, Welcome 0.2.21): one shared theme mode for every toggle
105
- export { AbThemeModeProvider, useAbThemeModeContext } from '../ab-theme-mode/index.tsx';
108
+ export { AbThemeModeProvider, useAbThemeModeContext, AB_THEME_MODE_ICONS, AB_THEME_ICON_BUTTON_GLYPH } from '../ab-theme-mode/index.tsx';
106
109
  export type { AbThemeModeProviderProps, AbThemeModeContextValue } from '../ab-theme-mode/index.tsx';
107
110
  // ๐Ÿ†• 0.2.0 drawers v2: AbSearchDrawer
108
111
  export { default as AbSearchDrawer, addAbSearchRecent, highlightAbSearch, AB_SEARCH_RECENT_KEY } from '../ab-search-drawer/index.tsx';