ab-nextjs-components 0.4.1 → 0.5.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 +66 -17
- package/README.md +1 -0
- 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/index.tsx +2 -2
- package/ab-code-block/styles.module.css +1 -1
- package/ab-content-tabs/index.tsx +1 -1
- package/ab-doc-pager/index.tsx +1 -1
- package/ab-drawer/gestures.ts +1 -1
- package/ab-drawer/index.tsx +3 -3
- 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/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-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 +17 -14
- package/package.json +1 -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 +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,22 +1,71 @@
|
|
|
1
|
-
## 0.2.
|
|
1
|
+
## [0.5.0](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.4.2...v0.5.0) (2026-11-04)
|
|
2
|
+
|
|
3
|
+
* ⚠️ **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.
|
|
4
|
+
* 🐛 **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.
|
|
5
|
+
* ✨ **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.
|
|
6
|
+
* 📝 **Neutral wording:** comments, test names, the README and this changelog no longer name reviewers. The AbProgressChips demo step "Cook" is now "Simmer".
|
|
7
|
+
* ✅ **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.
|
|
8
|
+
|
|
9
|
+
## [0.4.2](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.4.1...v0.4.2) (2026-11-04)
|
|
10
|
+
|
|
11
|
+
* 📌 **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`.
|
|
12
|
+
|
|
13
|
+
## [0.4.1](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.4.0...v0.4.1) (2026-11-03)
|
|
14
|
+
|
|
15
|
+
* 🌙 **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.
|
|
16
|
+
* 📱 **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).
|
|
17
|
+
* ✂️ **Current crumb:** it ellipsizes on its own box ("Insta…") instead of being clipped at both ends.
|
|
18
|
+
* 🔤 **AbCallout:** the callout text size no longer follows global `body, p` font sizes.
|
|
19
|
+
* ⬆️ **Theme:** `ab-nextjs-theme` **^0.3.9**.
|
|
20
|
+
|
|
21
|
+
## [0.4.0](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.3.3...v0.4.0) (2026-11-03)
|
|
22
|
+
|
|
23
|
+
* ✨ **MDX docs components ([#21](https://github.com/abraham-ukachi/ab-nextjs-components/pull/21)):** `AbCallout`, `AbCodeBlock` + `AbCodeBlockCopy`, `AbContentTabs` and `AbDocPager`.
|
|
24
|
+
* 🎯 **Breadcrumbs:** 24px crumb targets.
|
|
25
|
+
* ♿ **Code blocks:** the `pre` is focusable, so keyboard users can scroll it.
|
|
26
|
+
* ⬆️ **Theme:** `ab-nextjs-theme` **^0.3.8**.
|
|
27
|
+
|
|
28
|
+
## [0.3.3](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.3.2...v0.3.3) (2026-11-03)
|
|
29
|
+
|
|
30
|
+
* 📌 **Icons pin dropped ([#20](https://github.com/abraham-ukachi/ab-nextjs-components/pull/20)):** the release-age pin for `ab-nextjs-icons` is removed.
|
|
31
|
+
* 🎯 **AbSearchTrigger:** the small size is 46px.
|
|
32
|
+
|
|
33
|
+
## [0.3.2](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.3.1...v0.3.2) (2026-11-01)
|
|
34
|
+
|
|
35
|
+
* 🎯 **44px tap targets ([#19](https://github.com/abraham-ukachi/ab-nextjs-components/pull/19))** across the touch controls.
|
|
36
|
+
* ♿ **AbTocPromo:** renders as a `div` with a label.
|
|
37
|
+
* 🔍 **AbMobileHeader:** a `search` slot.
|
|
38
|
+
* ✨ **`AB_THEME_MODE_ICONS`:** the theme mode glyphs, with `brightness_auto` for system mode.
|
|
39
|
+
* 🎯 **AbThemeToggle:** `iconShows` target fix.
|
|
40
|
+
* ⬆️ **Icons:** `ab-nextjs-icons` **^0.2.7**.
|
|
41
|
+
|
|
42
|
+
## [0.3.1](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.3.0...v0.3.1) (2026-10-30)
|
|
43
|
+
|
|
44
|
+
* 🧱 **404 gaps ([#18](https://github.com/abraham-ukachi/ab-nextjs-components/pull/18)):** new `AbErrorHero`, plus the other 404 page fixes.
|
|
45
|
+
|
|
46
|
+
## [0.3.0](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.2.3...v0.3.0) (2026-10-30)
|
|
47
|
+
|
|
48
|
+
* 🔥 **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.
|
|
49
|
+
|
|
50
|
+
## [0.2.2](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.2.1...v0.2.2) (2026-10-21)
|
|
2
51
|
|
|
3
52
|
- 🌍 AbPackagePreviewComponents `labels` ({ button, chip, switch }); English defaults unchanged, the 0.2.1 `button` / `chip` props still work
|
|
4
53
|
|
|
5
|
-
## 0.2.1
|
|
54
|
+
## [0.2.1](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.2.0...v0.2.1) (2026-10-21)
|
|
6
55
|
|
|
7
|
-
### Sidebar profile
|
|
56
|
+
### Sidebar profile
|
|
8
57
|
- ✨ 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
58
|
- ✨ New `AbSidebarProfileButton` (standalone) and `AbProfileAvatar` + `getAbInitials` (client + server)
|
|
10
59
|
- ✨ AbSidebar `footer` slot (bottom left, sticky)
|
|
11
60
|
- ✨ 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
61
|
- ✨ AbTocPromo: the aside "New" card (mock .toc-card: 12px radius + padding, card colour, 13px title, 11.5px subtitle)
|
|
13
62
|
- ✨ 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
|
|
63
|
+
- ✨ `useAbEdgeSwipe({ maxWidth })` + `AB_ASIDE_DRAWER_MAX_WIDTH` (1179): the right drawer swipes on mobile and tablet only
|
|
64
|
+
- 🐛 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"`)
|
|
65
|
+
- 🐛 Drawer rows: hover tints only on hover-capable pointers, so the nav drawer opens with no highlighted row
|
|
17
66
|
- ✨ AbSettingsDrawer: the Account section is back on top (`account`, `onAccount`, `onSignIn`), plus `onHelp` / `onAbout` rows after Language (labels `account`, `signIn`, `help`, `about`)
|
|
18
67
|
|
|
19
|
-
## 0.2.0 (
|
|
68
|
+
## [0.2.0](https://github.com/abraham-ukachi/ab-nextjs-components/compare/v0.1.14...v0.2.0) (2026-10-21)
|
|
20
69
|
|
|
21
70
|
Includes everything planned for 0.1.15, which is not released separately.
|
|
22
71
|
|
|
@@ -55,16 +104,16 @@ Includes everything planned for 0.1.15, which is not released separately.
|
|
|
55
104
|
|
|
56
105
|
* ⬆️ **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
106
|
|
|
58
|
-
* 🎯 **AbThemeToggle icon shows the target (
|
|
59
|
-
* 🌿 **Sage chip AA
|
|
60
|
-
* ♿ **AA fallbacks and the sidebar badge
|
|
61
|
-
* 🏠 **Home fidelity components (spec §5, approved
|
|
107
|
+
* 🎯 **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.
|
|
108
|
+
* 🌿 **Sage chip AA:** the `tone="sage"` fallback text is now #566a58 (theme 0.3.5 value), ≥ 4.5:1 on the unchanged tint. Tested.
|
|
109
|
+
* ♿ **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.
|
|
110
|
+
* 🏠 **Home fidelity components (spec §5, approved):**
|
|
62
111
|
* `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
112
|
* `AbBreadcrumbs` (P2): the tablet main bar crumb.
|
|
64
113
|
* `AbVersionSwitcher` (P9): the sidebar "Docs **v0.2.x** ▾", which opens an AbMenu, with a no-JS `<details>` fallback.
|
|
65
114
|
* `AbBottomDrawer`: the mobile bottom drawer (D40), which `AbLocaleSwitcher` / `AbAppBar` now use for `side="bottom"`. `AbDrawerList` gains `as`.
|
|
66
115
|
* 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 (
|
|
116
|
+
* 🏠 **Home variants on existing components (the P4–P19 items; everything is opt-in, defaults unchanged):**
|
|
68
117
|
* `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
118
|
* `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
119
|
* `AbThemeToggle`: `appearance="thumb"` (28px segments, raised thumb, filled active glyph) (P7).
|
|
@@ -77,7 +126,7 @@ Includes everything planned for 0.1.15, which is not released separately.
|
|
|
77
126
|
* `AbIconButton`: `aria-expanded` / `aria-controls` pass through, and a new `iconSize`.
|
|
78
127
|
* `AbVersionSwitcher`: the accessible name is `"{label} {version}"`, so it contains the visible text (WCAG 2.5.3).
|
|
79
128
|
* AbList rows are 59/60px, like the mock.
|
|
80
|
-
* `AbBottomDrawer
|
|
129
|
+
* `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
130
|
* 🎨 **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
131
|
* 🗄️ **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
132
|
* 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 +146,10 @@ Includes everything planned for 0.1.15, which is not released separately.
|
|
|
97
146
|
* 🃏 **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
147
|
* 📑 **AbToc (new, G46)**: plain `#id` anchors, `aria-current="location"`, and an optional `onNavigate` (for `scrollToAbSection`)
|
|
99
148
|
* 📜 **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
|
|
149
|
+
* 🌍 **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
|
|
150
|
+
* 🧩 **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
151
|
* 🔑 **AbSidebar item `id`:** optional, used as the React key (`id ?? href`) so two items may share an href
|
|
103
|
-
* 🆔 **AbIcon per-instance ids
|
|
152
|
+
* 🆔 **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
153
|
* 🎈 **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
154
|
* 🚫 **JS-off fallbacks**: AbInstallSnippet hides copy (the command shows the pnpm default). AbLocaleSwitcher with `getHref` renders a `<details>` list of `hreflang` links
|
|
106
155
|
* 📱 **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 +175,7 @@ Includes everything planned for 0.1.15, which is not released separately.
|
|
|
126
175
|
|
|
127
176
|
* 🐛 **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
177
|
* 📏 **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** (
|
|
178
|
+
* 🪐 **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
179
|
* 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
180
|
|
|
132
181
|
## 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`.
|
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 */
|
package/ab-code-block/index.tsx
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* SOFTWARE.
|
|
25
25
|
*
|
|
26
26
|
* @project: ab-nextjs-components
|
|
27
|
-
* @name: AbCodeBlock (0.3.4,
|
|
27
|
+
* @name: AbCodeBlock (0.3.4, QA 0.2.24 MDX docs)
|
|
28
28
|
* @file: ab-code-block/index.tsx
|
|
29
29
|
* @type: Server component (no hooks; the copy button is a client island)
|
|
30
30
|
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
@@ -53,7 +53,7 @@ import styles from './styles.module.css';
|
|
|
53
53
|
const escAttr = (v: string) => v.replace(/&/g, '&').replace(/"/g, '"').replace(/</g, '<'); // 🧹
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
* ⌨️ 0.4.0
|
|
56
|
+
* ⌨️ 0.4.0: a plain <pre> gets tabIndex 0 (keyboard users can scroll long lines with the arrow keys) and a name.
|
|
57
57
|
* Shiki's <pre tabindex="0"> keeps its own tabindex (never doubled); an existing aria-label is never replaced.
|
|
58
58
|
*/
|
|
59
59
|
function withAbFocusablePre(children: ReactNode, name?: string): ReactNode {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
border-radius: var(--ab-radius-code, 12px); /* 🟢 */
|
|
45
45
|
background: var(--ab-color-code-surface, #231a14); /* 🎨 */
|
|
46
46
|
color: var(--ab-color-on-code-surface, #f4ece5); /* 🖋️ */
|
|
47
|
-
color-scheme: dark; /* 🌑 0.4.1 (
|
|
47
|
+
color-scheme: dark; /* 🌑 0.4.1 (0.2.24, gap 3): scrollbars, selection + the copy button match the dark surface in every page scheme */
|
|
48
48
|
}
|
|
49
49
|
/* 🏷️ header: title · filename · language badge */
|
|
50
50
|
.abCodeBlockHead { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px 0 16px; border-bottom: 1px solid rgb(255 255 255 / 0.08); font: 500 12.5px/1.2 var(--ab-font-body, system-ui, sans-serif); } /* 📐 */
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* SOFTWARE.
|
|
25
25
|
*
|
|
26
26
|
* @project: ab-nextjs-components
|
|
27
|
-
* @name: AbContentTabs + AbContentTab (0.3.4,
|
|
27
|
+
* @name: AbContentTabs + AbContentTab (0.3.4, QA 0.2.24 MDX docs)
|
|
28
28
|
* @file: ab-content-tabs/index.tsx
|
|
29
29
|
* @type: Client component
|
|
30
30
|
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
package/ab-doc-pager/index.tsx
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* SOFTWARE.
|
|
25
25
|
*
|
|
26
26
|
* @project: ab-nextjs-components
|
|
27
|
-
* @name: AbDocPager (0.3.4,
|
|
27
|
+
* @name: AbDocPager (0.3.4, QA 0.2.24 MDX docs)
|
|
28
28
|
* @file: ab-doc-pager/index.tsx
|
|
29
29
|
* @type: Server-safe component (links via AbLinkProvider)
|
|
30
30
|
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
package/ab-drawer/gestures.ts
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
|
-
// 🤏 drawers v2 (
|
|
39
|
+
// 🤏 drawers v2 (01:22): the thresholds and decisions behind every drawer swipe, as pure functions,
|
|
40
40
|
// so the rules are unit-tested without a DOM and the components only feed them numbers.
|
|
41
41
|
|
|
42
42
|
/** 🎚️ the spec numbers (drawer-spec.md "Gestures" + "Edge zones") */
|
package/ab-drawer/index.tsx
CHANGED
|
@@ -90,7 +90,7 @@ export interface AbDrawerProps {
|
|
|
90
90
|
closeLabel?: string; // 🌍 default "Close"
|
|
91
91
|
noJsFallback?: boolean; // 🧩 D41: without JS, render the content in flow (default `true`)
|
|
92
92
|
initialFocus?: 'first' | 'panel' | (string & {}); // 🎯 on open: the first control (default), the panel itself, or (0.2.0) a CSS selector inside the panel, e.g. `[role=radio][aria-checked=true]`
|
|
93
|
-
// 🆕 0.2.0 drawers v2 (
|
|
93
|
+
// 🆕 0.2.0 drawers v2 (01:22): all opt-in, the defaults keep the old drawer
|
|
94
94
|
tier?: AbDrawerTier; // 🥞 stacking tier: 'aside' (z 60) < 'nav' (61) < 'sheet' (62)
|
|
95
95
|
swipe?: boolean; // 🤏 side drawers: swipe the sheet back toward its edge to close (30% of the width or ≥ 0.5px/ms)
|
|
96
96
|
snapPoints?: boolean; // 🧲 bottom only, below 768px: snaps at 70% (S1) and full height (S2) with a handle; gestures per the spec
|
|
@@ -146,7 +146,7 @@ const isTopDrawer = (token: symbol): boolean => openStack[openStack.length - 1]
|
|
|
146
146
|
|
|
147
147
|
// ♿ reduced-motion check, read once per open / close on purpose: it only picks the unmount delay for THAT
|
|
148
148
|
// toggle (the slide itself is CSS, which follows the media query live), so a listener would buy nothing
|
|
149
|
-
/** ↩️ 0.2.1
|
|
149
|
+
/** ↩️ 0.2.1: where focus goes after a drawer that had no focusable opener closes (an edge swipe): the
|
|
150
150
|
* mobile header's logo link, else AbAppBar's brand link, else AbSidebar's logo row link. `returnFocus` overrides it. */
|
|
151
151
|
export const AB_DRAWER_RETURN_FOCUS = '[data-ab-part="mobile-header"] a[href], [data-ab-part="app-bar-brand"] a[href], [data-ab-part="sidebar-logo"] a[href]';
|
|
152
152
|
const reducedMotion = (): boolean => typeof window !== 'undefined' && typeof window.matchMedia === 'function' && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
@@ -237,7 +237,7 @@ const AbDrawer = (props: AbDrawerProps): ReactElement => {
|
|
|
237
237
|
const had = opener.current as HTMLElement | null; // ↩️
|
|
238
238
|
const usable = had && had !== document.body && had.isConnected ? had : null; // 🤏 a swipe has no opener
|
|
239
239
|
// ↩️ 0.2.0 fallback: the first VISIBLE match (an app often renders the logo twice, one hidden per breakpoint)
|
|
240
|
-
const pool = Array.from(document.querySelectorAll<HTMLElement>(returnFocus ?? AB_DRAWER_RETURN_FOCUS)).filter((el) => !node.contains(el)); // 🏷️ 0.2.1
|
|
240
|
+
const pool = Array.from(document.querySelectorAll<HTMLElement>(returnFocus ?? AB_DRAWER_RETURN_FOCUS)).filter((el) => !node.contains(el)); // 🏷️ 0.2.1: default = the header / brand logo
|
|
241
241
|
const back = usable ?? pool.find((el) => el.getClientRects().length > 0) ?? pool[0] ?? null; // 👀 the visible one, else the first
|
|
242
242
|
// ⏭️ a microtask later: the inert cleanup below runs after this one, and an inert opener can't take focus
|
|
243
243
|
queueMicrotask(() => { if (back && back.isConnected && typeof back.focus === 'function') back.focus({ preventScroll: true }); });
|