ab-nextjs-components 0.4.2 → 0.6.0
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/CHANGELOG.md +81 -17
- package/README.md +16 -2
- package/ab-app-bar/index.tsx +5 -5
- package/ab-app-bar/styles.module.css +5 -5
- package/ab-bottom-drawer/index.tsx +3 -3
- package/ab-bottom-drawer/styles.module.css +2 -2
- package/ab-bottom-drawer/use-ab-swipe-down.ts +1 -1
- package/ab-breadcrumbs/index.tsx +1 -1
- package/ab-breadcrumbs/styles.module.css +5 -5
- package/ab-button/index.tsx +1 -1
- package/ab-button/styles.module.css +5 -5
- package/ab-callout/index.tsx +1 -1
- package/ab-callout/styles.module.css +1 -1
- package/ab-carousel/helpers.ts +1 -1
- package/ab-carousel/index.tsx +4 -4
- package/ab-carousel/styles.module.css +2 -2
- package/ab-chip/styles.module.css +1 -1
- package/ab-code-block/focus.tsx +63 -0
- package/ab-code-block/index.tsx +55 -28
- package/ab-code-block/styles.module.css +4 -3
- package/ab-content-tabs/index.tsx +25 -3
- package/ab-demo-box/index.tsx +45 -7
- package/ab-demo-box/styles.module.css +19 -7
- package/ab-demo-code/index.tsx +38 -34
- package/ab-demo-code/styles.module.css +3 -41
- package/ab-doc-pager/index.tsx +1 -1
- package/ab-drawer/gestures.ts +1 -1
- package/ab-drawer/index.tsx +12 -4
- package/ab-drawer/kit.module.css +13 -13
- package/ab-drawer/styles.module.css +2 -2
- package/ab-drawer/use-ab-edge-swipe.ts +2 -2
- package/ab-flow-diagram/helpers.ts +2 -2
- package/ab-flow-diagram/index.tsx +2 -2
- package/ab-flow-diagram/styles.module.css +3 -3
- package/ab-icon/builtin.ts +4 -0
- package/ab-icon/helpers.ts +1 -1
- package/ab-icon/index.tsx +3 -3
- package/ab-icon/registrar.tsx +1 -1
- package/ab-icon-button/index.tsx +1 -1
- package/ab-install-snippet/styles.module.css +1 -1
- package/ab-link/index.tsx +2 -2
- package/ab-link/locale.ts +1 -1
- package/ab-list/styles.module.css +1 -1
- package/ab-locale-switcher/index.tsx +6 -6
- package/ab-locale-switcher/styles.module.css +5 -5
- package/ab-mobile-header/index.tsx +6 -6
- package/ab-nav-drawer/index.tsx +11 -6
- package/ab-navbar/index.tsx +1 -1
- package/ab-navbar/styles.module.css +1 -1
- package/ab-navbar/view.tsx +1 -1
- package/ab-package-card/index.tsx +3 -3
- package/ab-package-card/previews.tsx +1 -1
- package/ab-package-card/styles.module.css +2 -2
- package/ab-playground-scene/i18n.module.css +1 -1
- package/ab-playground-scene/icons.tsx +1 -1
- package/ab-playground-scene/index.tsx +4 -4
- package/ab-playground-scene/labels.ts +3 -3
- package/ab-playground-scene/scenes.tsx +4 -4
- package/ab-playground-scene/styles.module.css +6 -6
- package/ab-playground-scene/upgraded.tsx +3 -3
- package/ab-playground-scene/welcome.tsx +1 -1
- package/ab-preview-code/index.tsx +115 -0
- package/ab-preview-code/stage.tsx +153 -0
- package/ab-preview-code/styles.module.css +43 -0
- package/ab-progress-chips/index.tsx +1 -1
- package/ab-search-drawer/index.tsx +4 -4
- package/ab-search-trigger/index.tsx +5 -5
- package/ab-search-trigger/styles.module.css +3 -3
- package/ab-settings-drawer/index.tsx +2 -2
- package/ab-sidebar/active.ts +105 -0
- package/ab-sidebar/index.tsx +10 -6
- package/ab-sidebar/profile-button.tsx +2 -2
- package/ab-sidebar/styles.module.css +4 -4
- package/ab-sidebar/view.tsx +16 -8
- package/ab-theme-mode/index.tsx +3 -3
- package/ab-theme-toggle/index.tsx +6 -6
- package/ab-theme-toggle/styles.module.css +2 -2
- package/ab-toc/index.tsx +3 -3
- package/ab-toc/promo.tsx +2 -2
- package/ab-toc/styles.module.css +1 -1
- package/ab-toc-drawer/index.tsx +1 -1
- package/ab-version-switcher/index.tsx +2 -2
- package/css/dialog.css +1 -1
- package/index.ts +29 -18
- package/package.json +3 -1
- package/server/ab-button/index.tsx +1 -1
- package/server/ab-icon/index.tsx +2 -2
- package/server/ab-sidebar/index.tsx +3 -2
- package/types/index.d.ts +8 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,22 +1,86 @@
|
|
|
1
|
-
## 0.
|
|
1
|
+
## [0.6.0](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.5.0...v0.6.0) (2026-11-04)
|
|
2
|
+
|
|
3
|
+
* ⚠️ **Breaking: `html` is now `trustedHtml`** on AbCodeBlock, AbDemoCode and AbPreviewCode. The string goes into `dangerouslySetInnerHTML` **without sanitizing**, so pass only HTML you render yourself (e.g. Shiki `codeToHtml`), never user input. Prefer `highlighted` / children. Rename the prop to upgrade.
|
|
4
|
+
* ⚠️ **Breaking (markup): code-block focus moved.** The focusable, named element is now the scroll wrapper (`[data-ab-part="code-block-code"]`, `role="group"`), not the `<pre>`. The old regex that patched `tabindex` / `aria-label` into the `<pre>` HTML (it broke on `>` inside attributes) is removed; it was internal, so no export changes.
|
|
5
|
+
* 🔐 **`warnAbRiskyHtml`:** a dev-only `console.warn` when `trustedHtml` contains `<script`, an `on…=` handler, `javascript:`, `<iframe` or `srcdoc`. Silent in production. It is not a sanitizer.
|
|
6
|
+
* ✨ **AbPreviewCode (server component):** a docs Preview / Code pair. AbContentTabs over an AbDemoBox preview and an AbDemoCode source block; both panels are in the server HTML. Nothing is parsed or evaluated from `code`.
|
|
7
|
+
* 🧰 **Preview toolbar (`AbPreviewStage`, a small client island):** a `role="toolbar"` with one tab stop (←/→/Home/End), a light/dark toggle (`aria-pressed`) for that preview only, a reload button that remounts the preview, and an open-in-new-tab link with `href` (`target="_blank" rel="noopener noreferrer"`). 44px targets; names via `labels.toolbar`, `labels.dark`, `labels.reload`, `labels.open`. New AbPreviewCode props: `toolbar` (default `true`) and `href`. Exported: `AbPreviewStage`, `AbPreviewStageProps`, `AbPreviewStageLabels`.
|
|
8
|
+
* 🧪 **AbDemoBox:** server-safe, with `scheme` (`'inherit' | 'light' | 'dark'`), a scoped `align` and an optional `label` (a named region).
|
|
9
|
+
* 🗄️ **Drawers inside the preview scope:** AbDrawer hosts its layer in the nearest `[data-ab-preview-scope]`, so a drawer demo stays inside its box. The selector is exported as `AB_PREVIEW_SCOPE_SELECTOR`.
|
|
10
|
+
* 💻 **AbDemoCode is built on AbCodeBlock:** escaped `<pre>`, SVG copy button, polite "Copied".
|
|
11
|
+
* 🔣 **Icons:** `refresh` and `open_in_new` (ab-nextjs-icons) join `AB_ICON_BUILTINS`.
|
|
12
|
+
* ⌨️ **One tab stop per code block:** the scroll wrapper is the stop, so arrow keys scroll long lines. A Shiki `<pre tabindex="0">` from children is dropped; inside a `trustedHtml` string it is set to `-1` after hydration (the string is never edited, so before hydration it is still a second stop).
|
|
13
|
+
* 📋 **Copy-button gutter:** the code scroller ends 48px short of the copy button, so long lines never run under it (390px phones too).
|
|
14
|
+
* ♿ **AbContentTabs:** a tabpanel is a tab stop only when it has no focusable content (checked after mount and on changes). The server render keeps `tabIndex 0` on every panel, so hydration matches. `AB_FOCUSABLE_SELECTOR` is exported.
|
|
15
|
+
|
|
16
|
+
## [0.5.0](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.4.2...v0.5.0) (2026-11-04)
|
|
17
|
+
|
|
18
|
+
* ⚠️ **Heads-up (default change, not breaking):** AbSidebar and AbNavDrawer now light only the **deepest** matching item, so `/docs` no longer lights up alongside `/docs/x` on `/docs/x`. A parent still lights on routes that have no listed child (`/docs/y`). Pass `activeMatch="prefix"` for the old look.
|
|
19
|
+
* 🐛 **One active item in AbSidebar and AbNavDrawer:** new `activeMatch?: 'best' | 'prefix' | 'exact'` (default `'best'`) on both, plus a per-item `exact?: boolean` override (`true` = never a parent match, `false` = parent matching allowed under `'exact'`). Query strings, hashes and trailing slashes are ignored. AbNavDrawer also gets `locales`, and both share one helper.
|
|
20
|
+
* ✨ **Exports:** `getAbActiveHrefs`, `matchAbHref`, `normalizeAbHref`, `flattenAbNavItems`, and the types `AbActiveMatch`, `AbActiveMatchable` and `AbActiveMatchOptions`. `isAbSidebarActive` stays, and it now ignores query strings, hashes and trailing slashes too.
|
|
21
|
+
* 📝 **Neutral wording:** comments, test names, the README and this changelog no longer name reviewers. The AbProgressChips demo data uses a neutral step name ("Simmer").
|
|
22
|
+
* ✅ **G59, stacked drawers and Escape (confirmed, regression test added):** with two drawers open, Escape closes only the topmost one, and focus returns to that drawer's trigger. A second Escape closes the next one. This works across scopes (app, main, aside). An Escape an inner widget already handled closes nothing. The shared open-drawer stack in `AbDrawer` already did this, so there is no runtime change.
|
|
23
|
+
|
|
24
|
+
## [0.4.2](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.4.1...v0.4.2) (2026-11-04)
|
|
25
|
+
|
|
26
|
+
* 📌 **Theme pin dropped ([#23](https://github.com/abraham-ukachi/ab-nextjs-components/pull/23)):** the D33 release-age pin for `ab-nextjs-theme@0.3.9` expired, so it's removed. The range stays `^0.3.9`.
|
|
27
|
+
|
|
28
|
+
## [0.4.1](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.4.0...v0.4.1) (2026-11-03)
|
|
29
|
+
|
|
30
|
+
* 🌙 **AbCodeBlock ([#22](https://github.com/abraham-ukachi/ab-nextjs-components/pull/22)):** the dark surface sets `color-scheme: dark`, so scrollbars and form controls match.
|
|
31
|
+
* 📱 **Breadcrumbs at 768px:** the trail gets a real width and is clipped before the search field, so the search field no longer covers it and the Docs crumb stays clear (24px target).
|
|
32
|
+
* ✂️ **Current crumb:** it ellipsizes on its own box ("Insta…") instead of being clipped at both ends.
|
|
33
|
+
* 🔤 **AbCallout:** the callout text size no longer follows global `body, p` font sizes.
|
|
34
|
+
* ⬆️ **Theme:** `ab-nextjs-theme` **^0.3.9**.
|
|
35
|
+
|
|
36
|
+
## [0.4.0](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.3.3...v0.4.0) (2026-11-03)
|
|
37
|
+
|
|
38
|
+
* ✨ **MDX docs components ([#21](https://github.com/abraham-ukachi/ab-nextjs-components/pull/21)):** `AbCallout`, `AbCodeBlock` + `AbCodeBlockCopy`, `AbContentTabs` and `AbDocPager`.
|
|
39
|
+
* 🎯 **Breadcrumbs:** 24px crumb targets.
|
|
40
|
+
* ♿ **Code blocks:** the `pre` is focusable, so keyboard users can scroll it.
|
|
41
|
+
* ⬆️ **Theme:** `ab-nextjs-theme` **^0.3.8**.
|
|
42
|
+
|
|
43
|
+
## [0.3.3](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.3.2...v0.3.3) (2026-11-03)
|
|
44
|
+
|
|
45
|
+
* 📌 **Icons pin dropped ([#20](https://github.com/abraham-ukachi/ab-nextjs-components/pull/20)):** the release-age pin for `ab-nextjs-icons` is removed.
|
|
46
|
+
* 🎯 **AbSearchTrigger:** the small size is 46px.
|
|
47
|
+
|
|
48
|
+
## [0.3.2](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.3.1...v0.3.2) (2026-11-01)
|
|
49
|
+
|
|
50
|
+
* 🎯 **44px tap targets ([#19](https://github.com/abraham-ukachi/ab-nextjs-components/pull/19))** across the touch controls.
|
|
51
|
+
* ♿ **AbTocPromo:** renders as a `div` with a label.
|
|
52
|
+
* 🔍 **AbMobileHeader:** a `search` slot.
|
|
53
|
+
* ✨ **`AB_THEME_MODE_ICONS`:** the theme mode glyphs, with `brightness_auto` for system mode.
|
|
54
|
+
* 🎯 **AbThemeToggle:** `iconShows` target fix.
|
|
55
|
+
* ⬆️ **Icons:** `ab-nextjs-icons` **^0.2.7**.
|
|
56
|
+
|
|
57
|
+
## [0.3.1](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.3.0...v0.3.1) (2026-10-30)
|
|
58
|
+
|
|
59
|
+
* 🧱 **404 gaps ([#18](https://github.com/abraham-ukachi/ab-nextjs-components/pull/18)):** new `AbErrorHero`, plus the other 404 page fixes.
|
|
60
|
+
|
|
61
|
+
## [0.3.0](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.2.3...v0.3.0) (2026-10-30)
|
|
62
|
+
|
|
63
|
+
* 🔥 **Prune ([#17](https://github.com/abraham-ukachi/ab-nextjs-components/pull/17)):** 5 unused components are removed: `AbKeyFeature`, `AbMainHeadline`, `AbPreview`, `AbSwitchBack` and `AbTestHello` (and their server twins). ⚠️ Breaking if you imported them.
|
|
64
|
+
|
|
65
|
+
## [0.2.2](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.2.1...v0.2.2) (2026-10-21)
|
|
2
66
|
|
|
3
67
|
- 🌍 AbPackagePreviewComponents `labels` ({ button, chip, switch }); English defaults unchanged, the 0.2.1 `button` / `chip` props still work
|
|
4
68
|
|
|
5
|
-
## 0.2.1
|
|
69
|
+
## [0.2.1](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.2.0...v0.2.1) (2026-10-21)
|
|
6
70
|
|
|
7
|
-
### Sidebar profile
|
|
71
|
+
### Sidebar profile
|
|
8
72
|
- ✨ AbSidebar `profile` prop (opt-in): a 40px profile button at the bottom left opens AbSettingsDrawer. Signed out it shows the profile glyph; signed in the initials ("AU") on the container colour, or the photo masked to a circle, plus the name when expanded. Rendered on the server and hidden by CSS below 1180px (no flash); the collapsed rail names it with an AbBalloon tooltip. Label via `labels.profile` (default "Profile and settings")
|
|
9
73
|
- ✨ New `AbSidebarProfileButton` (standalone) and `AbProfileAvatar` + `getAbInitials` (client + server)
|
|
10
74
|
- ✨ AbSidebar `footer` slot (bottom left, sticky)
|
|
11
75
|
- ✨ AbBalloon `strategy="fixed"`: the tip is placed in the viewport, so the collapsed sidebar rail (a scroller) can't clip it; rail items + the profile button use it
|
|
12
76
|
- ✨ AbTocPromo: the aside "New" card (mock .toc-card: 12px radius + padding, card colour, 13px title, 11.5px subtitle)
|
|
13
77
|
- ✨ Home preview tiles for AbPackageCard `preview`: `AbPackagePreviewCurve` (ease-out), `AbPackagePreviewCode` (`*kw*` / `~dim` lines), `AbPackagePreviewComponents` (button · switch · pill chip); preview children no longer stretch
|
|
14
|
-
- ✨ `useAbEdgeSwipe({ maxWidth })` + `AB_ASIDE_DRAWER_MAX_WIDTH` (1179): the right drawer swipes on mobile and tablet only
|
|
15
|
-
- 🐛 Drawers: a swipe-opened drawer returns focus to the header / brand logo by default (`AB_DRAWER_RETURN_FOCUS`; AbAppBar's brand gets `data-ab-part="app-bar-brand"`)
|
|
16
|
-
- 🐛 Drawer rows: hover tints only on hover-capable pointers, so the nav drawer opens with no highlighted row
|
|
78
|
+
- ✨ `useAbEdgeSwipe({ maxWidth })` + `AB_ASIDE_DRAWER_MAX_WIDTH` (1179): the right drawer swipes on mobile and tablet only
|
|
79
|
+
- 🐛 Drawers: a swipe-opened drawer returns focus to the header / brand logo by default (`AB_DRAWER_RETURN_FOCUS`; AbAppBar's brand gets `data-ab-part="app-bar-brand"`)
|
|
80
|
+
- 🐛 Drawer rows: hover tints only on hover-capable pointers, so the nav drawer opens with no highlighted row
|
|
17
81
|
- ✨ AbSettingsDrawer: the Account section is back on top (`account`, `onAccount`, `onSignIn`), plus `onHelp` / `onAbout` rows after Language (labels `account`, `signIn`, `help`, `about`)
|
|
18
82
|
|
|
19
|
-
## 0.2.0 (
|
|
83
|
+
## [0.2.0](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.1.14...v0.2.0) (2026-10-21)
|
|
20
84
|
|
|
21
85
|
Includes everything planned for 0.1.15, which is not released separately.
|
|
22
86
|
|
|
@@ -55,16 +119,16 @@ Includes everything planned for 0.1.15, which is not released separately.
|
|
|
55
119
|
|
|
56
120
|
* ⬆️ **Peer + dev range:** `ab-nextjs-theme` **^0.3.5** (was ^0.3.4), for the Home tokens. It has a D33 release-age pin that expires 2026-10-21T20:40:07Z. Components doesn't depend on `ab-nextjs-core`, so no core range changed.
|
|
57
121
|
|
|
58
|
-
* 🎯 **AbThemeToggle icon shows the target (
|
|
59
|
-
* 🌿 **Sage chip AA
|
|
60
|
-
* ♿ **AA fallbacks and the sidebar badge
|
|
61
|
-
* 🏠 **Home fidelity components (spec §5, approved
|
|
122
|
+
* 🎯 **AbThemeToggle icon shows the target (20:57):** `variant="icon"` + `appearance="thumb"` now shows the mode a click switches to (moon in light, sun in dark). New `iconShows?: 'current' | 'target'` (default `target` for thumb, `current` otherwise, so fill is unchanged) and `labels.switchTo` for names like "Switch to dark theme". Segmented toggles are unchanged.
|
|
123
|
+
* 🌿 **Sage chip AA:** the `tone="sage"` fallback text is now #566a58 (theme 0.3.5 value), ≥ 4.5:1 on the unchanged tint. Tested.
|
|
124
|
+
* ♿ **AA fallbacks and the sidebar badge:** `AbBreadcrumbs` and `AbList` now fall back to the AA faint #807062 (was the mock's #9c8c80). On the active `--tint` row, the `badgeVariant="text"` sidebar badge inherits `--accent-text`, because faint on tint is only 3.9:1. Tested.
|
|
125
|
+
* 🏠 **Home fidelity components (spec §5, approved):**
|
|
62
126
|
* `AbList` + `AbListItem` (P13): bordered row lists with a media tile or badge, title, meta and chevron. A row with `href` is a single link.
|
|
63
127
|
* `AbBreadcrumbs` (P2): the tablet main bar crumb.
|
|
64
128
|
* `AbVersionSwitcher` (P9): the sidebar "Docs **v0.2.x** ▾", which opens an AbMenu, with a no-JS `<details>` fallback.
|
|
65
129
|
* `AbBottomDrawer`: the mobile bottom drawer (D40), which `AbLocaleSwitcher` / `AbAppBar` now use for `side="bottom"`. `AbDrawerList` gains `as`.
|
|
66
130
|
* They read the `ab-nextjs-theme` 0.3.5 Home tokens (`--ab-color-card`, `--ab-color-faint`, …), with the light mock values as fallbacks.
|
|
67
|
-
* 🏠 **Home variants on existing components (
|
|
131
|
+
* 🏠 **Home variants on existing components (the P4–P19 items; everything is opt-in, defaults unchanged):**
|
|
68
132
|
* `AbAppBar`: `density="compact"` (height from core's `--ab-header-height`, 13.5px links, brand column `--ab-app-bar-brand-width` 236/270), `divider`, `moreMenu={false}` (P4/P5/P19).
|
|
69
133
|
* `AbSearchTrigger`: `variant="field"` (300×36, one `⌘ K` cap, "coming soon" only in the tooltip and SR text) and `size="sm"` (the 34px mobile pill) (P6).
|
|
70
134
|
* `AbThemeToggle`: `appearance="thumb"` (28px segments, raised thumb, filled active glyph) (P7).
|
|
@@ -77,7 +141,7 @@ Includes everything planned for 0.1.15, which is not released separately.
|
|
|
77
141
|
* `AbIconButton`: `aria-expanded` / `aria-controls` pass through, and a new `iconSize`.
|
|
78
142
|
* `AbVersionSwitcher`: the accessible name is `"{label} {version}"`, so it contains the visible text (WCAG 2.5.3).
|
|
79
143
|
* AbList rows are 59/60px, like the mock.
|
|
80
|
-
* `AbBottomDrawer
|
|
144
|
+
* `AbBottomDrawer`: the sheet takes focus on open, the ✕ is 44px with an 8px hover tint and a `:focus-visible`-only ring, plus 16px + safe-area bottom padding and the 36×4 handle. It reads the theme 0.3.5 scrim, handle and sheet-edge tokens. `AbDrawer` gains `initialFocus`.
|
|
81
145
|
* 🎨 **Home tokens first:** borders, hovers, active rows and focus rings read `--ab-color-border` / `-hover` / `-tint` / `-accent-text` / `-accent` (theme 0.3.5) before the M3 tokens. On theme 0.3.5 the rings turn bronze and active rows turn `--tint`.
|
|
82
146
|
* 🗄️ **AbDrawer + `useAbDrawer` (new, G53, D38).** The drawer is scoped to `app`, `main` or `aside`. It renders into a layer inside that layout box and never scrolls the document. Sides are `top`, `bottom`, `left` and `right`, plus logical `start` and `end`.
|
|
83
147
|
* Accessibility: `role="dialog"`, `aria-modal`, a labelled panel, a focus trap that restores focus to the opener, Escape and scrim close, and the rest of the scope is `inert`.
|
|
@@ -97,10 +161,10 @@ Includes everything planned for 0.1.15, which is not released separately.
|
|
|
97
161
|
* 🃏 **AbCard + AbPackageCard (new, G45)**: one link per card, `ab-motion-interactive` timing, a 2px hover lift on laptop and up with a real pointer, and no lift under reduced motion
|
|
98
162
|
* 📑 **AbToc (new, G46)**: plain `#id` anchors, `aria-current="location"`, and an optional `onNavigate` (for `scrollToAbSection`)
|
|
99
163
|
* 📜 **Panes scrolling (D35/G55):** with core 0.1.6 the page never scrolls, the main pane does. `getAbMainScroller()` / `AB_MAIN_SCROLLER_SELECTOR` (`[data-ab-part="main-content"]`) from `ab-nextjs-components/ab-toc` give the `root` for `useAbScrollSpy` (call it in an effect or handler, never during render; `import { getAbMainScroller } from 'ab-nextjs-components/ab-toc'`, also on the root barrel with `AbToc`) and the `container` for `scrollToAbSection`; a plain `#id` jump scrolls the pane on its own. In panes the AbAppBar is the header row outside the scroller, so it stays put without the document scrolling
|
|
100
|
-
* 🌍 **AbAppBar active link
|
|
101
|
-
* 🧩 **AbPackageCard names wrap at hyphens
|
|
164
|
+
* 🌍 **AbAppBar active link:** without `activeHref` it uses the pathname minus the AbLinkProvider `locales` (or its own `locales` prop), like AbSidebar / AbNavbar, so `/fr/docs` marks Docs
|
|
165
|
+
* 🧩 **AbPackageCard names wrap at hyphens:** a `<wbr>` after each `-` (`toAbPackageNameParts`), so narrow cards show `ab-nextjs-` / `components` on two lines instead of an ellipsis; `overflow-wrap: anywhere` splits a part only when it alone is wider than the card. Checked in WebKit at 1280 (no clipping, no overflow)
|
|
102
166
|
* 🔑 **AbSidebar item `id`:** optional, used as the React key (`id ?? href`) so two items may share an href
|
|
103
|
-
* 🆔 **AbIcon per-instance ids
|
|
167
|
+
* 🆔 **AbIcon per-instance ids:** every render suffixes the SVG ids and `url(#…)` refs with `useId()` (`scopeAbIconIds`), so two filled Homes never share a mask and a hidden twin can't turn the active Home into a solid square
|
|
104
168
|
* 🎈 **AbBalloon a11y**: `role="tooltip"`, `aria-describedby` on the trigger, shows on focus, a 300ms hover delay (`AB_BALLOON_HOVER_DELAY`), Escape dismisses, `popIn` skipped under reduced motion. Without JS, CSS shows it on focus or hover. New `placement` and `delay` props
|
|
105
169
|
* 🚫 **JS-off fallbacks**: AbInstallSnippet hides copy (the command shows the pnpm default). AbLocaleSwitcher with `getHref` renders a `<details>` list of `hreflang` links
|
|
106
170
|
* 📱 **AbAppBar compact phone layout (< 768px):** tighter gaps, a shrinkable brand, an icon-only search pill and `compactActions` (shown instead of `actions`), so nothing overflows at 390px
|
|
@@ -126,7 +190,7 @@ Includes everything planned for 0.1.15, which is not released separately.
|
|
|
126
190
|
|
|
127
191
|
* 🐛 **AbFlowDiagram: nodes no longer cover the header in small boxes.** At 390px wide the Live Playground's top node ("core") sat under the "Live Playground" header. With a header (title, live dot or caption) the root now gets `data-ab-header="true"`, and nodes + wires live in a stage that starts below the header band: `--ab-flow-diagram-inset-top` (default `2.75rem`, tunable). Node `x` / `y` stay 0–100 but now map onto that stage, and the wires share the same box so they still meet the nodes. Without a header the stage is the full card (unchanged)
|
|
128
192
|
* 📏 **AbFlowDiagram nodes scale with the card:** `container-type: inline-size` on the root; node text, padding, radius and the hub glow use clamped `cqi` sizes (13px on a 760px card, 11px at 390px)
|
|
129
|
-
* 🪐 **AbFlowDiagram: side nodes are never clipped** (
|
|
193
|
+
* 🪐 **AbFlowDiagram: side nodes are never clipped** (s04's `--ab-color-bronze` and s07's `reduced motion` were cut off at the card edge in a 390px box). The orbit now scales with the box. Each node is anchored at the same fraction of its own box as its position (`translate(-x%, -y%)` via `--ab-flow-node-x` / `-y`; `x = y = 50` is the old centring), so the outer ring pulls in by exactly the node's width, and the wire end stays inside the pill. Nodes + wires also sit inside a side margin, `--ab-flow-diagram-inset-x` (default `0.5rem`), and an over-long label ellipsises (`max-width: 100%`). Positions are clamped to 0–100 like the wires
|
|
130
194
|
* Tests: header flag, stage insets shared by nodes + wires, 390px geometry, clamped scaling, proportional anchoring + side margin, s04 / s07 orbit geometry at 390 / 760px × 276 / 380px. Checked in WebKit at 390px: "core" top 9px → 53px (header ends at 33px); no node overlaps the header or is clipped at 390 / 760px. After the orbit fix: s04 + s07 have no node clipped (x or y) or over the header at 390 / 760px wide × 276px / 380px / default-ratio heights (before: 5 nodes clipped at 390px, 2 at 760px)
|
|
131
195
|
|
|
132
196
|
## 0.1.10 — 2026-10-14
|
package/README.md
CHANGED
|
@@ -83,6 +83,7 @@ New subpaths for the docs / PWA shell. All links go through **`AbLinkProvider`**
|
|
|
83
83
|
<AbLinkProvider component={Link}>{children}</AbLinkProvider>
|
|
84
84
|
```
|
|
85
85
|
* **`<AbSidebar>` v2 (G40)**: `sections=[{ id, label, items: [{ href, icon, label, badge?, items? }] }]`, `activeHref`, `collapsed` / `defaultCollapsed` / `onCollapsedChange`, `header`, `labels`. The active item gets `aria-current="page"` and a filled icon. Collapsed it becomes a 72px rail with balloon tooltips. The collapse button has `aria-expanded` + `aria-controls` and is hidden when JS is off. The server twin renders the same markup (no toggle). Legacy `links` / `page` still work.
|
|
86
|
+
* 🎯 **Active item (0.5.0):** `activeMatch` picks the rule: `'best'` (default) lights only the deepest matching item, so `/docs` and `/docs/x` never both light on `/docs/x`; `'prefix'` lights every parent too (the pre-0.5.0 look); `'exact'` lights only an equal href. An item's `exact: true` (never a parent) or `exact: false` (parent allowed) overrides it. Query strings, hashes and trailing slashes are ignored. AbNavDrawer takes the same `activeMatch` and `locales`. The helpers `getAbActiveHrefs`, `matchAbHref` and `normalizeAbHref` and the `AbActiveMatch` type are exported.
|
|
86
87
|
* **`<AbNavbar>` v2 (G41)**: `items` of `{ kind: 'link', href, icon, label }` or `{ kind: 'button', id, icon, label, onSelect, expanded?, controls? }`, filled active icon, `aria-current`, safe-area padding.
|
|
87
88
|
* **`<AbAppBar>` (G43)**: `brand`, `search`, `nav=[{ href, label }]`, `activeHref`, `actions`, `leading`, sticky with the theme hairline. Below **1180px** the nav moves into a "More" `AbMenu` (G26). It closes on Escape and outside click. With JS off the nav stays inline.
|
|
88
89
|
* **`<AbSearchTrigger>` + `<AbKbd>` (G44)**: shows ⌘K on Apple and Ctrl K elsewhere, sets `aria-keyshortcuts="Meta+K Control+K"`, calls `onOpen` (button) or falls back to `href` (link). `comingSoon` makes it `aria-disabled`.
|
|
@@ -145,6 +146,18 @@ A drawer belongs to a **region**: the whole app, the main pane or the aside pane
|
|
|
145
146
|
* **`<AbMobileHeader>`** (logo · globe · theme toggle) needs **ab-nextjs-core ≥ 0.2.1** with `<AbAppLayout variant="panes" mobileHeader="main">`. Pass it as `mainHeader`; core hides the app header below 768px and makes the main header the 56px mobile bar.
|
|
146
147
|
* **Edge swipes (`useAbEdgeSwipe`, `AbNavDrawer`/`AbTocDrawer` `swipe`):** a touch starting in the 24px edge zone is read from touch events. A non-passive `touchmove` listener exists only while that touch is down, and it calls `preventDefault` only once the move is sideways, so Android Chrome can't cancel it for a pan. Vertical scrolling from the edge, sideways code blocks and `[data-ab-no-edge-swipe]` keep working. Checked on WebKit and Chromium touch emulation.
|
|
147
148
|
|
|
149
|
+
### Docs Preview / Code (0.6.0) 🧪💻
|
|
150
|
+
|
|
151
|
+
* **`<AbPreviewCode>` (G16, server component)**: a tabbed **Preview / Code** pair for MDX docs. The preview is the real JSX you pass as `children` (package components only). Nothing is parsed or evaluated from `code`: no `eval`, `new Function`, react-live or sandpack. Props: `code` (raw source, always what Copy copies), `trustedHtml` (Shiki `codeToHtml` output, injected **without sanitizing**: trusted HTML you render yourself only, never user input; dev builds warn on `<script`, `on…=`, `javascript:`, `<iframe`, `srcdoc`) or `highlighted` (an already highlighted `<pre>`, **the preferred route**), `language` (default `tsx`), `filename`, `label` (the tablist name, default "Example"), `labels` (`preview`, `code`, `copy`, `copied`), `defaultTab` (`'preview'` or `'code'`), `scheme` (`'inherit'`, `'light'` or `'dark'`), `align`, `toolbar` (default `true`), `href` and `className`. **0.6.0 preview toolbar** (`AbPreviewStage`, a small client island; AbPreviewCode stays a server component): a `role="toolbar"` with one tab stop (←/→/Home/End), a light/dark toggle (`aria-pressed` = dark) that changes only that preview's scheme, a reload button that remounts the preview, and, with `href`, an open-in-new-tab link (`target="_blank" rel="noopener noreferrer"`). Every tool is a 44px target; rename them with `labels.toolbar`, `labels.dark`, `labels.reload`, `labels.open`. Both panels are in the server HTML. The tabs are AbContentTabs (arrows, Home/End, one tab stop).
|
|
152
|
+
* **`<AbDemoBox>` is the preview scope** (now server-safe): `scheme` re-applies the theme's `[data-theme]` tokens with a matching `color-scheme`, `contain: layout paint` + `isolation: isolate` keep fixed and absolute children and z-indexes inside, and its own font, colour and surface stop page prose styles from leaking in (`ab-prose-none`). **AbDrawer layers inside a preview are hosted by the box** for every `scope` (`AB_PREVIEW_SCOPE_SELECTOR`), unless a layout scope sits inside the preview. `label` makes it a named region. No motion.
|
|
153
|
+
* **`<AbDemoCode>`** is built on AbCodeBlock (escaped `<pre>`, focusable and named, SVG copy button, polite "Copied"). **0.6.0:** one tab stop per block: the scroll wrapper is focusable and named, so arrow keys scroll long lines; a Shiki `<pre tabindex="0">` from children is dropped, and inside a `trustedHtml` string it is demoted to `-1` after hydration (the string is never edited, so before hydration it is still a second stop). The scroller ends 48px short of the copy button, so lines never run under it, even at 390px. It also takes `trustedHtml` (not sanitized: trusted HTML only, prefer a highlighted child), a highlighted child, `filename`, `copyLabel` and `copiedLabel`.
|
|
154
|
+
|
|
155
|
+
```mdx
|
|
156
|
+
<AbPreviewCode label="Button example" code={`<AbButton label="Save" />`}>
|
|
157
|
+
<AbButton label="Save" />
|
|
158
|
+
</AbPreviewCode>
|
|
159
|
+
```
|
|
160
|
+
|
|
148
161
|
## Getting Started
|
|
149
162
|
|
|
150
163
|
### Installation
|
|
@@ -208,8 +221,6 @@ A list of all the **client components** and their current status:
|
|
|
208
221
|
| 27 | *`AbText`* | **ab-text/index.tsx** | Done |
|
|
209
222
|
| 28 | *`AbProduct`* | **ab-product/index.tsx** | Done |
|
|
210
223
|
| 29 | *`AbProductItem`* | **ab-product-item/index.tsx** | Done |
|
|
211
|
-
| 30 | *`AbDemoBox`* | **ab-demo-box/index.tsx** | Done |
|
|
212
|
-
| 31 | *`AbDemoCode`* | **ab-demo-code/index.tsx** | Done |
|
|
213
224
|
|
|
214
225
|
## Server Components
|
|
215
226
|
|
|
@@ -229,6 +240,9 @@ A list of all the **server components** and their current status:
|
|
|
229
240
|
| 10 | *`AbSidebar`* | **server/ab-sidebar/index.tsx** | Done |
|
|
230
241
|
| 11 | *`AbNavLink`* | **server/ab-nav-link/index.tsx** | Done |
|
|
231
242
|
| 12 | *`AbText`* | **server/ab-text/index.tsx** | Done |
|
|
243
|
+
| 13 | *`AbDemoBox`* | **ab-demo-box/index.tsx** | Done (server-safe since 0.6.0) |
|
|
244
|
+
| 14 | *`AbDemoCode`* | **ab-demo-code/index.tsx** | Done (server-safe since 0.6.0) |
|
|
245
|
+
| 15 | *`AbPreviewCode`* | **ab-preview-code/index.tsx** | Done (0.6.0) |
|
|
232
246
|
|
|
233
247
|
|
|
234
248
|
## Learn More abElements
|
package/ab-app-bar/index.tsx
CHANGED
|
@@ -78,9 +78,9 @@ export interface AbAppBarProps {
|
|
|
78
78
|
search?: ReactNode; // 🔎 e.g. <AbSearchTrigger />
|
|
79
79
|
nav?: AbAppBarNavItem[]; // 🧭 inline from 1180px, in the "More" menu below
|
|
80
80
|
activeHref?: string; // 🎯 default: the pathname without its locale prefix
|
|
81
|
-
locales?: readonly string[]; // 🌍 0.1.13
|
|
81
|
+
locales?: readonly string[]; // 🌍 0.1.13: stripped from the pathname (default: AbLinkProvider's), so `/fr/docs` marks `/docs`
|
|
82
82
|
actions?: ReactNode; // 🔘 right side (theme toggle, locale switcher, GitHub…)
|
|
83
|
-
compactActions?: ReactNode; // 📱 0.1.13 (
|
|
83
|
+
compactActions?: ReactNode; // 📱 0.1.13 (#3): shown INSTEAD of `actions` below 768px (e.g. only the theme toggle); the rest can live in the More menu or the nav sheet
|
|
84
84
|
leading?: ReactNode; // ☰ optional slot before the brand (e.g. a rail toggle)
|
|
85
85
|
sticky?: boolean; // 📌 default true (hairline under it)
|
|
86
86
|
labels?: { nav?: string; more?: string }; // 🌍
|
|
@@ -94,12 +94,12 @@ export interface AbAppBarProps {
|
|
|
94
94
|
divider?: boolean;
|
|
95
95
|
/** ⋮ 0.1.14 (P19): `false` = no "More" button/menu; below 1180px the nav is simply hidden (default `true`) */
|
|
96
96
|
moreMenu?: boolean;
|
|
97
|
-
/** 🔎 0.1.15
|
|
97
|
+
/** 🔎 0.1.15: below 768px the search shows as a `'pill'` ("Search ⌘K", the Home mock) or an `'icon'`
|
|
98
98
|
* (40px circle, label for screen readers only). Default `'pill'` with `density="compact"`, else `'icon'` (unchanged). */
|
|
99
99
|
compactSearch?: 'pill' | 'icon';
|
|
100
|
-
/** 🔗 0.1.15
|
|
100
|
+
/** 🔗 0.1.15: shown INSTEAD of `search` below 768px (both rendered, CSS picks: no hydration flip), e.g.
|
|
101
101
|
* `<AbSearchTrigger size="sm" label="Search" onOpen={openSearchDrawer} hotkey={false} />`: a button that opens
|
|
102
|
-
* AbSearchDrawer, with no ⌘K cap and no hotkey (
|
|
102
|
+
* AbSearchDrawer, with no ⌘K cap and no hotkey (there is no /docs page; `href` still makes a plain link).
|
|
103
103
|
* In a compact bar it is the mock's 114px pill (`--ab-app-bar-compact-search-width`).
|
|
104
104
|
* ⚠️ Both slots are rendered: a hotkey trigger (with `onOpen`) passed to BOTH `search` and `searchCompact` registers ⌘K
|
|
105
105
|
* twice (one press opens twice). Give only one of them `onOpen`, or pass `hotkey={false}` to the other. */
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
cursor: pointer; /* 👆 */
|
|
92
92
|
}
|
|
93
93
|
.abAppBarMenu { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); min-width: 200px; max-width: calc(100vw - 16px); z-index: 50; } /* 📋 never wider than the screen */
|
|
94
|
-
.abAppBarMenu[hidden] { display: none; } /* 🙈 closed: no layout, no overflow (
|
|
94
|
+
.abAppBarMenu[hidden] { display: none; } /* 🙈 closed: no layout, no overflow (#3) */
|
|
95
95
|
|
|
96
96
|
/* 📱 below 1180px: nav → "More" */
|
|
97
97
|
@media (max-width: 1179px) {
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
.abAppBarMore { display: none; } /* 🙈 */
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
/* 📱 0.1.13 (
|
|
107
|
+
/* 📱 0.1.13 (#3): compact phone layout (< 768px). Tighter gaps, the brand may shrink, the search
|
|
108
108
|
* pill becomes a 40px icon button (its label stays for screen readers), `compactActions` replace the
|
|
109
109
|
* actions. Result: no horizontal overflow at 390px. */
|
|
110
110
|
@media (max-width: 767px) {
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
.abAppBar[data-density='compact'] .abAppBarActions { gap: 0; }
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
/* ===== 🔎 0.1.15 (
|
|
160
|
+
/* ===== 🔎 0.1.15 (fidelity-2 #1): compactSearch="pill" below 768px =====
|
|
161
161
|
* The desktop field becomes the mobile mock's `.mpill`: 34px, pill radius, 13px "Search" + a tight "⌘K" cap.
|
|
162
162
|
* Same element, CSS only (no hydration flip, one hotkey listener). */
|
|
163
163
|
@media (max-width: 767px) {
|
|
@@ -173,11 +173,11 @@
|
|
|
173
173
|
.abAppBar[data-compact-search='pill'] .abAppBarSearch :global(.AbSearchTrigger)[data-variant='field'] :global(.AbKbd) { min-width: 18px; height: 18px; font-size: 10px; } /* 📱 = sm cap */
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
/* ===== 🔗 0.1.15
|
|
176
|
+
/* ===== 🔗 0.1.15: `searchCompact` replaces `search` below 768px (mock .mpill = 114px, here a link) ===== */
|
|
177
177
|
.abAppBarSearch[data-when='compact'] { display: none; } /* 🙈 ≥ 768px */
|
|
178
178
|
@media (max-width: 767px) {
|
|
179
179
|
.abAppBarSearch[data-when='wide'] { display: none; } /* 🙈 */
|
|
180
180
|
.abAppBarSearch[data-when='compact'] { display: block; } /* 👀 */
|
|
181
181
|
.abAppBar[data-compact-search='pill'] .abAppBarSearch[data-when='compact'] > :global(.AbSearchTrigger) { width: var(--ab-app-bar-compact-search-width, 114px); box-sizing: border-box; } /* 📏 mock 114 */
|
|
182
|
-
.abAppBar[data-compact-search='pill'] .abAppBarSearch[data-when='compact'] > :global(.AbSearchTrigger) [data-ab-part^='search-label'] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* ✂️
|
|
182
|
+
.abAppBar[data-compact-search='pill'] .abAppBarSearch[data-when='compact'] > :global(.AbSearchTrigger) [data-ab-part^='search-label'] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* ✂️ review P2: longer translations end in … inside the 114px pill */
|
|
183
183
|
}
|
|
@@ -50,7 +50,7 @@ import clsx from 'clsx';
|
|
|
50
50
|
import AbDrawer, { type AbDrawerProps } from '../ab-drawer';
|
|
51
51
|
// 🎨 styles
|
|
52
52
|
import styles from './styles.module.css';
|
|
53
|
-
// 👇 0.2.3 (
|
|
53
|
+
// 👇 0.2.3 (Welcome 0.2.21): swipe down to close
|
|
54
54
|
import { useAbSwipeDown } from './use-ab-swipe-down';
|
|
55
55
|
|
|
56
56
|
/** ⚙️ props: AbDrawer's, minus `side` (always bottom); scope defaults to the whole app */
|
|
@@ -62,7 +62,7 @@ export interface AbBottomDrawerProps extends Omit<AbDrawerProps, 'side'> {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
* 📱 AbBottomDrawer: the mobile bottom sheet (
|
|
65
|
+
* 📱 AbBottomDrawer: the mobile bottom sheet (the plan: the language picker on mobile, D40). AbDrawer
|
|
66
66
|
* with `side="bottom"`, `scope="app"`, the Home tokens (card surface, hairline top edge, 20px top radius,
|
|
67
67
|
* grab handle, safe-area padding) and at most 560px wide, centred, above 768px.
|
|
68
68
|
*/
|
|
@@ -72,7 +72,7 @@ const AbBottomDrawer = ({ handle = true, scope = 'app', initialFocus = 'panel',
|
|
|
72
72
|
const id = rest.id ?? `ab-bottom-drawer-${auto}`;
|
|
73
73
|
// 👇 0.2.3: swipe down to close (AbDrawer's own snap drag owns the gesture when `snapPoints` is on)
|
|
74
74
|
useAbSwipeDown({ id, onClose: rest.onClose, enabled: rest.open && swipeToClose && !rest.snapPoints });
|
|
75
|
-
// ↩️ 0.2.3
|
|
75
|
+
// ↩️ 0.2.3: focus goes back to the trigger. AbDrawer already returns it to the focused opener; Safari
|
|
76
76
|
// (and taps on iOS) never focus a clicked <button>, so the opener is <body> and AbDrawer fell back to the logo.
|
|
77
77
|
// The fallback selector is now the button that controls this sheet, and an explicit `trigger` ref wins.
|
|
78
78
|
const wasOpen = useRef(rest.open); // 🧠 the previous `open`
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
/* 📱 the sheet: doubled class beats AbDrawer's `.abDrawer[data-side='bottom']` without !important (
|
|
40
|
+
/* 📱 the sheet: doubled class beats AbDrawer's `.abDrawer[data-side='bottom']` without !important (the spec) */
|
|
41
41
|
.abBottomDrawer.abBottomDrawer {
|
|
42
42
|
--ab-bottom-drawer-radius: 20px; /* ⭕ = the gapped pane radius */
|
|
43
43
|
--ab-bottom-drawer-max-width: 560px; /* 📏 tablet+ */
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
width: 36px; height: 4px; margin: 8px auto 0; border-radius: 2px; /* 📏 */
|
|
56
56
|
background: var(--ab-color-handle, rgb(25 18 12 / 0.18)); /* 🎨 dark: rgba(255,248,245,.18) via theme */
|
|
57
57
|
}
|
|
58
|
-
.abBottomDrawer h2 { font-family: var(--ab-font-title, 'Mulish', inherit); font-size: 16px; font-weight: 800; letter-spacing: -0.01em; } /* 🏷️
|
|
58
|
+
.abBottomDrawer h2 { font-family: var(--ab-font-title, 'Mulish', inherit); font-size: 16px; font-weight: 800; letter-spacing: -0.01em; } /* 🏷️ Mulish 16/800 */
|
|
59
59
|
/* ✕ close: 44px hit area, no border, 8px-radius hover tint (the Home icon buttons); ring on keyboard focus only */
|
|
60
60
|
.abBottomDrawer [data-ab-part='drawer-close'] { inline-size: 44px; block-size: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--ab-color-muted, #6b5b50); }
|
|
61
61
|
.abBottomDrawer [data-ab-part='drawer-close']:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); }
|
|
@@ -60,7 +60,7 @@ export function isAbScrolledInside(el: Element | null, sheet: Element): boolean
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
* 👇 useAbSwipeDown — close a bottom sheet with a swipe down (
|
|
63
|
+
* 👇 useAbSwipeDown — close a bottom sheet with a swipe down (Welcome 0.2.21):
|
|
64
64
|
* - 👆 touch events, like useAbEdgeSwipe (Android Chrome fires pointercancel on a native pan, so pointer events
|
|
65
65
|
* would lose the gesture); the passive touchstart only arms it, a NON-passive touchmove is attached just for
|
|
66
66
|
* that press, and preventDefault runs only once the move is ours (down, and mostly vertical)
|
package/ab-breadcrumbs/index.tsx
CHANGED
|
@@ -77,7 +77,7 @@ const AbBreadcrumbs = ({ items, label = 'Breadcrumb', className }: AbBreadcrumbs
|
|
|
77
77
|
return (
|
|
78
78
|
<li key={i} className={styles.abCrumb}>
|
|
79
79
|
{i > 0 && <AbIcon name="chevron_right" size={16} className={styles.abCrumbSep} />}
|
|
80
|
-
{/* ✂️ 0.4.1 (
|
|
80
|
+
{/* ✂️ 0.4.1 (0.2.24, gap 4 v3): the label sits in its own text box, so a squeezed crumb ellipsizes on the
|
|
81
81
|
right ("Installa…") while the inline-flex target box (24px min) stays as it is */}
|
|
82
82
|
{last ? <span className={styles.abCrumbCurrent} aria-current="page"><span className={styles.abCrumbText}>{it.label}</span></span>
|
|
83
83
|
: it.href ? <Link href={it.href} className={styles.abCrumbLink}><span className={styles.abCrumbText}>{it.label}</span></Link>
|
|
@@ -39,17 +39,17 @@
|
|
|
39
39
|
|
|
40
40
|
/* 🎚️ knobs (mock .crumb; theme tokens from ab-nextjs-theme 0.3.5) */
|
|
41
41
|
.abCrumbs {
|
|
42
|
-
--ab-crumbs-color: var(--ab-color-faint, #807062); /* 🖋️ --faint ♿ AA fallback
|
|
42
|
+
--ab-crumbs-color: var(--ab-color-faint, #807062); /* 🖋️ --faint ♿ AA fallback */
|
|
43
43
|
--ab-crumbs-current: var(--ab-color-text, var(--ab-color-on-surface, #211a16)); /* 🖋️ --text */
|
|
44
44
|
--ab-crumbs-hover: var(--ab-color-accent-text, var(--ab-color-bronze-text, #8b6340)); /* 🖱️ --accent-t */
|
|
45
45
|
--ab-crumbs-ring: var(--ab-color-accent, var(--ab-color-bronze, #a67c52)); /* ♿ --accent */
|
|
46
46
|
font-size: 13px; color: var(--ab-crumbs-color); /* 🔤 */
|
|
47
|
-
flex: 1 1 auto; /* ↔️ 0.4.1 (
|
|
47
|
+
flex: 1 1 auto; /* ↔️ 0.4.1 (0.2.24, gap 4): in a header row it takes the space left */
|
|
48
48
|
min-width: var(--ab-crumbs-min-width, 96px); /* 📏 0.4.1 v2: never collapses to 0, so the first crumb always fits */
|
|
49
49
|
flex-shrink: 1; /* 🗜️ a neighbour with a bigger flex-shrink (the search field) gives way first */
|
|
50
50
|
}
|
|
51
51
|
.abCrumbsList { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; min-width: 0; } /* 📐 */
|
|
52
|
-
/* ✂️ 0.4.1 (
|
|
52
|
+
/* ✂️ 0.4.1 (0.2.24, gap 4): at 768px the trail ran under the search field. Now it never paints past its own box:
|
|
53
53
|
it clips (with 4px of room so the focus ring still shows) and each crumb may shrink instead of pushing out. */
|
|
54
54
|
.abCrumbsList { overflow: clip; overflow-clip-margin: 4px; flex-wrap: nowrap; } /* ✂️ */
|
|
55
55
|
.abCrumb { display: inline-flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; } /* 🍞 */
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
.abCrumbSep { width: 16px; height: 16px; flex: none; } /* › */
|
|
61
61
|
.abCrumbCurrent { color: var(--ab-crumbs-current); font-weight: 650; overflow: hidden; text-overflow: ellipsis; } /* 🎯 */
|
|
62
62
|
.abCrumbLink { color: inherit; text-decoration: none; border-radius: 4px; } /* 🔗 */
|
|
63
|
-
/* 👆 0.3.4 (
|
|
63
|
+
/* 👆 0.3.4 (0.2.24 docs): every crumb is at least 24×24 (WCAG 2.5.8 target size), centred in its box */
|
|
64
64
|
.abCrumbLink,
|
|
65
65
|
.abCrumbCurrent {
|
|
66
66
|
display: inline-flex; /* 📐 */
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
.abCrumbLink:hover { color: var(--ab-crumbs-hover); } /* 🖱️ */
|
|
74
74
|
.abCrumbLink:focus-visible { outline: 2px solid var(--ab-crumbs-ring); outline-offset: 2px; } /* ♿ */
|
|
75
75
|
|
|
76
|
-
/* ✂️ 0.4.1 (
|
|
76
|
+
/* ✂️ 0.4.1 (0.2.24, gap 4 v3): the label's own box ellipsizes on the right, anchored at the start */
|
|
77
77
|
.abCrumbText { display: block; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* ✂️ */
|
package/ab-button/index.tsx
CHANGED
|
@@ -95,7 +95,7 @@ export interface AbButtonProps {
|
|
|
95
95
|
badgeTone?: AbButtonBadgeTone; // 🎨 NEW: 'neutral' (default) | 'accent'
|
|
96
96
|
disabledReason?: string; // 💬 NEW: SR-only reason, appended to the name while blocked
|
|
97
97
|
focusableWhenDisabled?: boolean; // ⌨️ NEW: force aria-disabled (true) or native disabled (false)
|
|
98
|
-
// ===== 0.1.13 (
|
|
98
|
+
// ===== 0.1.13 (#7) =====
|
|
99
99
|
// ♿ any aria-* / data-* attribute is passed to the <button>/<a>, e.g. useAbAsideToggle().props
|
|
100
100
|
// (`aria-expanded`, `aria-controls`) or `data-testid`. Our own data-* (type, color, …) still win.
|
|
101
101
|
[aria: `aria-${string}`]: string | number | boolean | undefined;
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
border: 0; /* 🧹 */
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
/* 📏 0.2.3
|
|
154
|
+
/* 📏 0.2.3: AbButton OWNS its box per type (button AND link), with the old theme values, because
|
|
155
155
|
* theme ≥ 0.3.7 keeps its legacy button sizes off `.AbButton`. Every value is a --ab-button-* token:
|
|
156
156
|
* --ab-button-padding contained / text 6px 12px · filled 6px 16px · outlined 8px 16px (all 8px 16px ≥ 460px)
|
|
157
157
|
* --ab-button-font-size 18px (20px ≥ 460px, as the theme did)
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
.abButton[data-type] { padding: var(--ab-button-padding, 8px 16px); font-size: var(--ab-button-font-size, 20px); } /* 📱→🖥️ the theme's ≥ 460px size */
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
/* 🔗 0.1.13 (
|
|
182
|
+
/* 🔗 0.1.13 (#7): link mode colours. The theme paints `button[data-type]` and `a[role="button"][data-type]`,
|
|
183
183
|
* but a real link (no role=button: it navigates) matches neither, so it takes the colours here (box: above). */
|
|
184
184
|
a.abButton[data-type="contained"] {
|
|
185
185
|
background: var(--ab-button-background-color, var(--primary-container-color)); /* 🎨 */
|
|
@@ -226,7 +226,7 @@ a.abButton.abButtonRounded { border-radius: 9999px; } /* 💊 */
|
|
|
226
226
|
.abButton.abButton[data-size="md"] { height: var(--ab-button-height-touch, 44px); }
|
|
227
227
|
.abButton.abButton[data-shape="rounded"][data-size="md"] { font-size: 14.5px; }
|
|
228
228
|
}
|
|
229
|
-
/* 📏 0.2.3
|
|
229
|
+
/* 📏 0.2.3: size="lg" = the v6 Welcome CTA box (welcome-v6/_src/build.py `.btn` + `.lap .f8 .btn`):
|
|
230
230
|
* mobile 52px · 0 24px · 16px/600 · radius 12px · gap 10px → laptop (≥ 1180px, core's laptop breakpoint) 56px · 0 30px · 17px.
|
|
231
231
|
* Triple class (0,4,0) + later than shape="rounded", so it wins over rounded's padding / radius / font. */
|
|
232
232
|
.abButton.abButton.abButton[data-size="lg"] {
|
|
@@ -243,7 +243,7 @@ a.abButton.abButtonRounded { border-radius: 9999px; } /* 💊 */
|
|
|
243
243
|
padding: 0 var(--ab-button-padding-inline-lg-laptop, 30px); font-size: var(--ab-button-font-size-lg-laptop, 17px); /* 💻 */
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
/* 🥉 0.2.3
|
|
246
|
+
/* 🥉 0.2.3: color="bronze" = v6 `.btn.p` (any type / shape). Same values in dark (v6 dark uses the same bronze).
|
|
247
247
|
* Quad class (0,5,0) + later than rounded+filled, so it wins over the rounded primary paint. */
|
|
248
248
|
.abButton.abButton.abButton.abButton[data-color="bronze"] {
|
|
249
249
|
background: var(--ab-button-bronze-background, var(--ab-color-bronze, #a67c52)); /* 🎨 */
|
|
@@ -265,7 +265,7 @@ a.abButton.abButtonRounded { border-radius: 9999px; } /* 💊 */
|
|
|
265
265
|
.abButton.abButton.abButton.abButton[data-color="bronze"]:is(:disabled, [aria-disabled="true"]) {
|
|
266
266
|
opacity: var(--ab-button-disabled-opacity, 0.5); box-shadow: none; cursor: not-allowed; /* 🚫 */
|
|
267
267
|
}
|
|
268
|
-
/* 🃏 0.2.3
|
|
268
|
+
/* 🃏 0.2.3: color="card" = v6 `.btn.s` (Continue with GitHub): 1px --line border on --card, --fg text.
|
|
269
269
|
* Opt-in only: plain outlined buttons are untouched. v6 → theme: --line → --ab-color-line, --card → --ab-color-card,
|
|
270
270
|
* --fg → --ab-color-text. v6 has no hover for .btn.s, so hover = the secondary button's 8% bronze tint over the card. */
|
|
271
271
|
.abButton.abButton.abButton.abButton[data-color="card"] {
|
package/ab-callout/index.tsx
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* SOFTWARE.
|
|
25
25
|
*
|
|
26
26
|
* @project: ab-nextjs-components
|
|
27
|
-
* @name: AbCallout (0.3.4,
|
|
27
|
+
* @name: AbCallout (0.3.4, QA 0.2.24 MDX docs)
|
|
28
28
|
* @file: ab-callout/index.tsx
|
|
29
29
|
* @type: Server component
|
|
30
30
|
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
}
|
|
68
68
|
.abCalloutIcon { flex: none; display: inline-flex; padding-top: 2px; color: var(--ab-callout-icon, var(--ab-callout-accent)); } /* 🔣 */
|
|
69
69
|
.abCalloutBody { flex: 1 1 auto; min-width: 0; } /* 📝 */
|
|
70
|
-
/* 🔠 0.4.1 (
|
|
70
|
+
/* 🔠 0.4.1 (0.2.24, gap 1): theme's base `body, p { font-size: 24px }` hit the title + text <p>s, even outside
|
|
71
71
|
.ab-prose. They inherit the callout's own size + leading instead (theme ≥ 0.3.8 .ab-prose fix covers prose pages). */
|
|
72
72
|
.abCalloutBody :where(p) { font-size: inherit; line-height: inherit; letter-spacing: inherit; word-spacing: inherit; } /* 🔠 */
|
|
73
73
|
.abCalloutTitle { margin: 0 0 4px; font-weight: 700; } /* 🏷️ */
|
package/ab-carousel/helpers.ts
CHANGED
|
@@ -47,7 +47,7 @@ export type AbCarouselDir = 'ltr' | 'rtl'
|
|
|
47
47
|
export type AbCarouselKeyAction = 'next' | 'prev' | 'first' | 'last'
|
|
48
48
|
|
|
49
49
|
// 📣 why the index changed (handy for analytics, URL sync and focus decisions)
|
|
50
|
-
// ⏭️ 'skip' = Welcome Skip → LAST slide (
|
|
50
|
+
// ⏭️ 'skip' = Welcome Skip → LAST slide (§8 Q3); apps move focus to that slide's h1 on it
|
|
51
51
|
export type AbCarouselChangeReason = 'next' | 'prev' | 'dot' | 'key' | 'swipe' | 'skip' | 'api'
|
|
52
52
|
|
|
53
53
|
// 📍 where a slide sits relative to the active one (drives the CSS enter / exit offset)
|
package/ab-carousel/index.tsx
CHANGED
|
@@ -139,7 +139,7 @@ export interface AbCarouselProps {
|
|
|
139
139
|
slideLabel?: (n: number, total: number) => string;
|
|
140
140
|
// 📣 live-region text factory, or false to disable announcements (default "Slide 3 of 9: Title")
|
|
141
141
|
announce?: ((n: number, total: number, title?: string) => string) | false;
|
|
142
|
-
// 📏 0.2.3 (
|
|
142
|
+
// 📏 0.2.3 (Welcome 0.2.21): size the track to the ACTIVE slide (animated, reduced-motion aware)
|
|
143
143
|
// instead of the tallest one (default false: one grid cell, height = tallest, CLS 0)
|
|
144
144
|
autoHeight?: boolean;
|
|
145
145
|
// 🧱 element for the region (default 'section')
|
|
@@ -451,7 +451,7 @@ export function AbCarousel(props: AbCarouselProps) {
|
|
|
451
451
|
// ===== 0.2.3 HEADLESS MODE: <AbCarouselProvider /> + useAbCarouselRegion() + <AbCarouselStatus /> ===== //
|
|
452
452
|
|
|
453
453
|
/**
|
|
454
|
-
* 🧠 AbCarouselProvider — 0.2.3 (
|
|
454
|
+
* 🧠 AbCarouselProvider — 0.2.3 (Welcome 0.2.21): the carousel state WITHOUT an element, so it no longer
|
|
455
455
|
* has to wrap <main>. Put it high enough for every control (header counter, aside dots, main track), then mark
|
|
456
456
|
* ONE element as the region with `useAbCarouselRegion()` and drop <AbCarouselStatus /> inside it:
|
|
457
457
|
*
|
|
@@ -500,14 +500,14 @@ export interface UseAbCarouselKeysOptions {
|
|
|
500
500
|
const AB_CAROUSEL_KEYS_SKIP = '[role="dialog"], [aria-modal="true"], [contenteditable=""], [contenteditable="true"]';
|
|
501
501
|
|
|
502
502
|
/**
|
|
503
|
-
* ⌨️ useAbCarouselKeys — 0.2.3 (
|
|
503
|
+
* ⌨️ useAbCarouselKeys — 0.2.3 (Welcome 0.2.21): the carousel's ←/→ (RTL-aware) on a SCOPE element, not
|
|
504
504
|
* just inside the region. The listener sits on that element only, so keys act only while focus is within it.
|
|
505
505
|
* Call it under <AbCarouselProvider> (or <AbCarousel>):
|
|
506
506
|
*
|
|
507
507
|
* useAbCarouselKeys('main') // ✅ RECOMMENDED: the layout's <main> (core's [data-ab-part="main"], else <main>)
|
|
508
508
|
* useAbCarouselKeys(slidesRef) // 📌 any element you hold a ref to
|
|
509
509
|
* useAbCarouselKeys('document') // ⚠️ OPT-IN only: every key on the page (header, aside…) — a global
|
|
510
|
-
* // hijack;
|
|
510
|
+
* // hijack; the e2e "no global hijack" forbids it on Welcome
|
|
511
511
|
*
|
|
512
512
|
* There is no default: the scope is always explicit.
|
|
513
513
|
*
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
--_accent: var(--ab-carousel-accent, var(--ab-color-accent, var(--ab-primary, #a67c52))); /* 🟤 bronze (0.2.3: theme accent first) */
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
/* 🟤 0.2.3 (
|
|
60
|
+
/* 🟤 0.2.3 (Welcome 0.2.21): headless mode renders parts (dots, Prev / Next, counter) OUTSIDE the region,
|
|
61
61
|
where the region's `--_accent` doesn't exist and the bronze turned grey. Every part now resolves the accent ON ITS
|
|
62
62
|
OWN, with the same chain: --ab-carousel-accent, then the theme accent, then --ab-primary, then bronze. */
|
|
63
63
|
.nav,
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
touch-action: pan-y; /* 👆 vertical scroll stays native; horizontal moves reach useAbSwipe */
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
/* 📏 0.2.3 (
|
|
81
|
+
/* 📏 0.2.3 (Welcome 0.2.21) autoHeight: the track takes the ACTIVE slide's height (set inline from a
|
|
82
82
|
ResizeObserver); slides keep their own height (top-aligned, not stretched to the tallest) and the taller leaving
|
|
83
83
|
slide is clipped. 🎬 The height animation is ab-nextjs-animations' .ab-motion-size (added in JS), timed with the
|
|
84
84
|
carousel tokens; it snaps for prefers-reduced-motion AND for the region's data-ab-reduced-motion (the prop). */
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
.chip[data-shape='rounded'] { border-radius: var(--ab-radius-chip, 6px); } /* 🔷 */
|
|
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
|
-
.chip[data-tone='sage'] { background: rgb(119 141 121 / 0.12); color: var(--ab-color-sage-accent, #566a58); border-color: transparent; } /* 🌿 beta ♿ AA
|
|
98
|
+
.chip[data-tone='sage'] { background: rgb(119 141 121 / 0.12); color: var(--ab-color-sage-accent, #566a58); border-color: transparent; } /* 🌿 beta ♿ AA: fallback = theme 0.3.5 light value */
|
|
99
99
|
|
|
100
100
|
/* ===== ✂️ 404 gaps: long text (overflow="ellipsis" default · "wrap") ===== */
|
|
101
101
|
.chip { max-width: 100%; box-sizing: border-box; } /* 📏 never wider than the parent */
|