ab-nextjs-components 0.4.2 โ 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/ab-drawer/kit.module.css
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
/* ๐งฐ drawers v2 (
|
|
40
|
+
/* ๐งฐ drawers v2 (the frames): the shared look of AbSettingsDrawer, AbNavDrawer, AbTocDrawer and
|
|
41
41
|
AbSearchDrawer. Values are the mock's (drawer.css), read through the theme tokens where theme 0.3.5+ has them.
|
|
42
42
|
Doubled classes beat AbDrawer's own rules without !important. */
|
|
43
43
|
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
.titleSm [data-ab-part='drawer-header'] > :first-child { font-size: 20px; }
|
|
84
84
|
/* โ close: 44px, 8px radius, --muted, 24px glyph */
|
|
85
85
|
.sheet [data-ab-part='drawer-close'] { inline-size: 44px; block-size: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--ab-color-muted, #6b5b50); }
|
|
86
|
-
@media (hover: hover) { .sheet [data-ab-part='drawer-close']:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } } /* ๐ฑ๏ธ 0.2.1
|
|
86
|
+
@media (hover: hover) { .sheet [data-ab-part='drawer-close']:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } } /* ๐ฑ๏ธ 0.2.1: no sticky tap-hover on touch */
|
|
87
87
|
.sheet [data-ab-part='drawer-close']:focus { outline: none; }
|
|
88
88
|
.sheet [data-ab-part='drawer-close']:focus-visible { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: 2px; }
|
|
89
89
|
/* ๐ body: 16px sides */
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
text-align: start; text-decoration: none; cursor: pointer; /* ๐ฑ๏ธ */
|
|
100
100
|
}
|
|
101
101
|
.row > svg, .row > .ic { flex: none; inline-size: 24px; block-size: 24px; color: var(--ab-color-muted, #6b5b50); }
|
|
102
|
-
@media (hover: hover) { .row:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } } /* ๐ฑ๏ธ 0.2.1
|
|
102
|
+
@media (hover: hover) { .row:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } } /* ๐ฑ๏ธ 0.2.1: no sticky tap-hover on touch */
|
|
103
103
|
.row:focus { outline: none; }
|
|
104
104
|
.row:focus-visible { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: -2px; }
|
|
105
105
|
.row[aria-checked='true'], .row[aria-current='page'] { background: var(--ab-dr-on); box-shadow: var(--ab-dr-on-ring); color: var(--ab-color-accent-text, #8b6340); font-weight: 700; } /* ๐ฏ */
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
|
|
119
119
|
/* โฌ
๏ธ the nav drawer: logo header, the version chip, a scrolling nav (44px rows, 15px) with a 72px fade, a pinned footer */
|
|
120
120
|
.logoRow { display: flex; align-items: center; min-inline-size: 0; }
|
|
121
|
-
.logoRow a { display: flex; align-items: center; color: inherit; min-block-size: 44px; } /* ๐ 0.3.2 (
|
|
121
|
+
.logoRow a { display: flex; align-items: center; color: inherit; min-block-size: 44px; } /* ๐ 0.3.2 (0.2.23 gaps): the logo link is a 44px-tall tap target (was 25px); the glyph keeps its size */
|
|
122
122
|
.ver { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; block-size: 32px; padding: 0 8px 0 10px; margin: 0 0 8px 8px; box-sizing: border-box; border-radius: 8px; border: 1px solid var(--ab-color-border, rgb(92 64 48 / 0.13)); background: var(--ab-dr-card); color: var(--ab-color-muted, #6b5b50); font: 500 13px/1 var(--ab-font-body, 'Inter', inherit); }
|
|
123
123
|
.ver b { font-family: var(--ab-font-mono, 'Roboto Mono', monospace); color: var(--ab-color-accent-text, #8b6340); font-weight: 600; }
|
|
124
124
|
.ver > svg { inline-size: 18px; block-size: 18px; }
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
.list { list-style: none; margin: 0; padding: 0; }
|
|
130
130
|
.nv { box-sizing: border-box; display: flex; align-items: center; gap: 12px; block-size: 44px; padding: 0 12px; border-radius: 8px; color: var(--ab-color-text, #211a16); font: 500 15px/1.2 var(--ab-font-body, 'Inter', inherit); text-decoration: none; }
|
|
131
131
|
.nv > svg { flex: none; inline-size: 22px; block-size: 22px; color: var(--ab-color-muted, #6b5b50); }
|
|
132
|
-
@media (hover: hover) { .nv:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } } /* ๐ฑ๏ธ 0.2.1
|
|
132
|
+
@media (hover: hover) { .nv:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } } /* ๐ฑ๏ธ 0.2.1: no sticky tap-hover on touch */
|
|
133
133
|
.nv:focus { outline: none; }
|
|
134
134
|
.nv:focus-visible { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: -2px; }
|
|
135
135
|
.nv[aria-current='page'] { background: var(--ab-dr-on); box-shadow: var(--ab-dr-on-ring); color: var(--ab-color-accent-text, #8b6340); font-weight: 700; }
|
|
@@ -157,11 +157,11 @@
|
|
|
157
157
|
.input::-webkit-search-cancel-button { display: none; }
|
|
158
158
|
.iconSm { flex: none; inline-size: 40px; block-size: 40px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--ab-color-muted, #6b5b50); cursor: pointer; padding: 0; }
|
|
159
159
|
.iconSm > svg { inline-size: 20px; block-size: 20px; }
|
|
160
|
-
@media (hover: hover) { .iconSm:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } } /* ๐ฑ๏ธ 0.2.1
|
|
160
|
+
@media (hover: hover) { .iconSm:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } } /* ๐ฑ๏ธ 0.2.1: no sticky tap-hover on touch */
|
|
161
161
|
.iconSm:focus-visible { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: -2px; }
|
|
162
162
|
.results { flex: 1 1 auto; min-block-size: 0; overflow: hidden auto; overscroll-behavior: contain; }
|
|
163
163
|
.recent { gap: 12px; padding-inline-end: 0; font-size: 15px; cursor: default; }
|
|
164
|
-
@media (hover: hover) { .recent:hover { background: transparent; } } /* ๐ฑ๏ธ 0.2.1
|
|
164
|
+
@media (hover: hover) { .recent:hover { background: transparent; } } /* ๐ฑ๏ธ 0.2.1: no sticky tap-hover on touch */
|
|
165
165
|
.recentGo { flex: 1 1 auto; min-inline-size: 0; border: 0; background: none; padding: 0; text-align: start; color: inherit; font: inherit; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
166
166
|
.recentGo:focus-visible { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: 2px; }
|
|
167
167
|
.grp2 { display: flex; align-items: baseline; gap: 8px; padding: 12px 16px 4px; margin: 0; }
|
|
@@ -169,8 +169,8 @@
|
|
|
169
169
|
.grp2 > code { font: 400 12px/16px var(--ab-font-mono, 'Roboto Mono', monospace); color: var(--ab-color-muted, #6b5b50); }
|
|
170
170
|
.sr { box-sizing: border-box; display: flex; align-items: center; gap: 12px; min-block-size: 56px; padding: 4px 12px; border-radius: 8px; color: inherit; text-decoration: none; }
|
|
171
171
|
.sr[aria-selected='true'] { background: var(--ab-dr-on); box-shadow: var(--ab-dr-on-ring); }
|
|
172
|
-
@media (hover: hover) { .sr:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } } /* ๐ฑ๏ธ 0.2.1
|
|
173
|
-
@media (hover: hover) { .sr[aria-selected='true']:hover { background: var(--ab-dr-on); } } /* ๐ฑ๏ธ 0.2.1
|
|
172
|
+
@media (hover: hover) { .sr:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } } /* ๐ฑ๏ธ 0.2.1: no sticky tap-hover on touch */
|
|
173
|
+
@media (hover: hover) { .sr[aria-selected='true']:hover { background: var(--ab-dr-on); } } /* ๐ฑ๏ธ 0.2.1: no sticky tap-hover on touch */
|
|
174
174
|
.pkgIc { flex: none; inline-size: 32px; block-size: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--ab-dr-card2); color: var(--ab-color-accent-text, #8b6340); }
|
|
175
175
|
.pkgIc > svg { inline-size: 20px; block-size: 20px; }
|
|
176
176
|
.srText { flex: 1 1 auto; min-inline-size: 0; }
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
/* ๐ฑ the mobile main header: 56px row, logo left, 44px globe + theme buttons right */
|
|
189
189
|
.mh { box-sizing: border-box; display: flex; align-items: center; block-size: 100%; min-block-size: 56px; padding: 0 4px 0 16px; gap: 0; background: transparent; }
|
|
190
190
|
.mh > .logoRow { flex: 1 1 auto; }
|
|
191
|
-
/* โ 0.2.3 (
|
|
191
|
+
/* โ 0.2.3 (Welcome 0.2.21): with a `row`, the header is a column: the 56px bar, then the extra row */
|
|
192
192
|
.mhStack { flex-direction: column; align-items: stretch; padding: 0; block-size: auto; } /* ๐งฑ */
|
|
193
193
|
.mhBar { box-sizing: border-box; display: flex; align-items: center; min-block-size: 56px; padding: 0 4px 0 16px; } /* ๐ the same bar */
|
|
194
194
|
.mhBar > .logoRow { flex: 1 1 auto; } /* โ๏ธ */
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
buttons keep their hit area and the end inset stays 4px so the last one lines up with the 44px grid */
|
|
198
198
|
/* ๐งฉ 0.2.3 no-JS language list: <details> around the globe; the list drops below it, end-aligned */
|
|
199
199
|
.langDetails { position: relative; flex: none; } /* ๐ anchor */
|
|
200
|
-
/* ๐ 0.3.2
|
|
200
|
+
/* ๐ 0.3.2: AbMobileHeader `search` slot, before the theme button; never shrinks, 4px from its neighbours */
|
|
201
201
|
.mhSearch { flex: none; display: inline-flex; align-items: center; margin-inline: 4px; } /* ๐ */
|
|
202
202
|
.langDetails > summary { list-style: none; } /* ๐ no disclosure triangle */
|
|
203
203
|
.langDetails > summary::-webkit-details-marker { display: none; } /* ๐ Safari */
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
.langList a { display: flex; align-items: center; min-block-size: 44px; padding: 0 12px; border-radius: 8px; color: var(--ab-color-text, #211a16); text-decoration: none; } /* ๐ 44px targets */
|
|
206
206
|
.langList a[aria-current='true'] { font-weight: 700; color: var(--ab-color-accent, #a67c52); } /* โ
*/
|
|
207
207
|
.langList a:focus-visible { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: -2px; } /* โฟ */
|
|
208
|
-
/* ๐ฑ 0.2.3 barAt (
|
|
208
|
+
/* ๐ฑ 0.2.3 barAt (Welcome 0.2.21): from 768px up the app header carries logo ยท globe ยท theme, so the bar would
|
|
209
209
|
repeat it. 'mobile' hides the bar there; 'auto' does so only inside core's mainHeaderAt="all" layout (the only
|
|
210
210
|
place the main header shows at that width next to the app header). The row stays. Pure CSS: no-JS + SSR safe. */
|
|
211
211
|
@media (min-width: 768px) {
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
.mhCompact > .mhBar { min-block-size: 48px; padding-inline-start: 18px; } /* ๐ with a row */
|
|
220
220
|
.ibtn { flex: none; inline-size: 44px; block-size: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--ab-color-text, #211a16); cursor: pointer; padding: 0; }
|
|
221
221
|
.ibtn > svg { inline-size: 24px; block-size: 24px; }
|
|
222
|
-
@media (hover: hover) { .ibtn:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } } /* ๐ฑ๏ธ 0.2.1
|
|
222
|
+
@media (hover: hover) { .ibtn:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } } /* ๐ฑ๏ธ 0.2.1: no sticky tap-hover on touch */
|
|
223
223
|
.ibtn:focus { outline: none; }
|
|
224
224
|
.ibtn:focus-visible { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: -2px; }
|
|
225
225
|
.verRow { display: flex; flex: none; } /* ๐ท๏ธ keeps the chip its own size */
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
.abDrawerScrim {
|
|
60
60
|
position: absolute; /* ๐ */
|
|
61
61
|
inset: 0; /* ๐ */
|
|
62
|
-
background: var(--ab-scrim-color, rgb(25 18 12 / 0.4)); /* ๐ซ๏ธ theme 0.3.5: 40% light / 60% dark
|
|
62
|
+
background: var(--ab-scrim-color, rgb(25 18 12 / 0.4)); /* ๐ซ๏ธ theme 0.3.5: 40% light / 60% dark */
|
|
63
63
|
opacity: 0; /* ๐ซฅ */
|
|
64
64
|
--ab-motion-duration: var(--ab-drawer-duration, 240ms); /* ๐๏ธ fade = .ab-motion-colors (ab-nextjs-animations) */
|
|
65
65
|
}
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
|
|
115
115
|
/* โฟ reduced motion: no slide, no fade (handled by ab-nextjs-animations .ab-motion-*) */
|
|
116
116
|
|
|
117
|
-
/* ===== ๐ 0.2.0 drawers v2 (
|
|
117
|
+
/* ===== ๐ 0.2.0 drawers v2 (the frames) ===== */
|
|
118
118
|
/* ๐ฅ stacking tiers (spec z-order): right drawer < left drawer < bottom sheet. The layers are siblings in the host,
|
|
119
119
|
so the tier sits on the layer (z 60 / 61 / 62 keeps all three above the panes and bars, like before) */
|
|
120
120
|
.abDrawerLayer:has(> .abDrawerFrame[data-tier='nav']) { z-index: 61; } /* โฌ
๏ธ the left drawer is in front of the right one */
|
|
@@ -52,7 +52,7 @@ export interface UseAbEdgeSwipeOptions {
|
|
|
52
52
|
enabled?: boolean; // ๐๏ธ e.g. false while that drawer is open, or when the page has no aside (default true)
|
|
53
53
|
width?: number; // ๐ the drawer width the 30% rule uses (default 320)
|
|
54
54
|
pointerTypes?: readonly string[]; // ๐๏ธ default touch + pen (a mouse never edge-swipes)
|
|
55
|
-
// ๐ 0.2.1
|
|
55
|
+
// ๐ 0.2.1: only swipe while the viewport is at most this wide, e.g. AB_ASIDE_DRAWER_MAX_WIDTH (1179) for
|
|
56
56
|
// the right drawer: mobile AND tablet hide the aside and open it as the right drawer; from 1180px it's a column
|
|
57
57
|
maxWidth?: number;
|
|
58
58
|
}
|
|
@@ -112,7 +112,7 @@ export function useAbEdgeSwipe({ edge, onOpen, enabled = true, width = 320, poin
|
|
|
112
112
|
const cur = d; d = null;
|
|
113
113
|
if (!cur || cur.axis !== 1) return;
|
|
114
114
|
if (resolveAbSideRelease({ distance: (x - cur.x) * sign, velocity: cur.v.velocity() * sign, width })) {
|
|
115
|
-
(document.activeElement as HTMLElement | null)?.blur?.(); // โฉ๏ธ 0.2.1
|
|
115
|
+
(document.activeElement as HTMLElement | null)?.blur?.(); // โฉ๏ธ 0.2.1: a swipe has no opener, so the drawer returns focus to the logo, not a stale element
|
|
116
116
|
latest.current(); // โ
|
|
117
117
|
}
|
|
118
118
|
};
|
|
@@ -59,7 +59,7 @@ export interface AbFlowNode {
|
|
|
59
59
|
captionAt?: 'start' | 'beside-centre';
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
// ๐ผ๏ธ 0.2.3: a fixed design frame (
|
|
62
|
+
// ๐ผ๏ธ 0.2.3: a fixed design frame (the v6 scene = 760ร600 with a 56px header); scales to the card width
|
|
63
63
|
export interface AbFlowFrame {
|
|
64
64
|
w: number; // โ๏ธ px
|
|
65
65
|
h: number; // โ๏ธ px
|
|
@@ -103,7 +103,7 @@ const H = (n: Rect): number => n.h ?? 0; // โ๏ธ
|
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
105
|
* @name routeAbFlowWires
|
|
106
|
-
* @description ใฐ๏ธ 0.2.3:
|
|
106
|
+
* @description ใฐ๏ธ 0.2.3: the v6 `route(nodes, hub)` (scenes.py), ported 1:1. Nodes above the hub wire down into
|
|
107
107
|
* its top edge, nodes below wire up into its bottom edge (anchors spread evenly along the edge, sorted by x), side
|
|
108
108
|
* nodes wire into the left / right edge. Orthogonal elbows (one horizontal run at mid-height / mid-width).
|
|
109
109
|
* Every wire starts at the node and ends at the hub, so pulses travel node โ hub.
|
|
@@ -62,7 +62,7 @@ export interface AbFlowDiagramProps {
|
|
|
62
62
|
nodes: readonly AbFlowNode[]; // ๐ต nodes in 0โ100 coordinates
|
|
63
63
|
edges?: readonly AbFlowEdge[] | 'auto'; // ใฐ๏ธ wires between node ids; `'auto'` (default with `frame`) = v6 route() every node โ the hub
|
|
64
64
|
/** ๐ผ๏ธ 0.2.3 (Welcome v6): a fixed design frame, e.g. `{ w: 760, h: 600, header: 56 }`. Node x/y/w/h are then frame px
|
|
65
|
-
* (
|
|
65
|
+
* (the rects 1:1) and the whole stage scales with the card width. */
|
|
66
66
|
frame?: AbFlowFrame;
|
|
67
67
|
/** ใฐ๏ธ 0.2.3: extra wires as frame-px polylines (v6 `extras`), drawn with rounded corners. */
|
|
68
68
|
wires?: readonly (readonly AbFlowPoint[])[];
|
|
@@ -174,7 +174,7 @@ export function AbFlowDiagram(props: AbFlowDiagramProps): ReactElement {
|
|
|
174
174
|
type FrameProps = AbFlowDiagramProps & { frame: AbFlowFrame };
|
|
175
175
|
|
|
176
176
|
/** ๐ผ๏ธ 0.2.3 (Welcome v6): the pixel-frame scene. A fixed wรh stage (v6 px), scaled to the card width by CSS
|
|
177
|
-
* (`100cqw / w`) and the AbFlowFrameScale island; wires auto-route node โ hub like
|
|
177
|
+
* (`100cqw / w`) and the AbFlowFrameScale island; wires auto-route node โ hub like the route(). */
|
|
178
178
|
function AbFlowFrameDiagram(props: FrameProps): ReactElement {
|
|
179
179
|
// ๐งฉ props
|
|
180
180
|
const { nodes, edges = 'auto', frame, wires = [], alt, title, caption, live = false, active = true, loops = 'infinite', variant = 'full', posterAt = 0.45, duration = 2400, className, style, children, dotted = true, logo, anchors = true, reducedMotion = 'auto' } = props;
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
aspect-ratio: 760 / 600; /* ๐ mock card */
|
|
45
45
|
border-radius: 1.25rem; /* ๐ฒ */
|
|
46
46
|
border: 1px solid var(--ab-color-border, var(--ab-color-outline-variant, rgb(0 0 0 / 0.12))); /* ๐๏ธ */
|
|
47
|
-
background: var(--ab-flow-card, var(--ab-color-card, var(--ab-color-surface-container, transparent))); /* ๐ 0.2.3 (
|
|
47
|
+
background: var(--ab-flow-card, var(--ab-color-card, var(--ab-color-surface-container, transparent))); /* ๐ 0.2.3 (Welcome v5): the theme card (#fff ยท #fffcfa โฅ1920 ยท #241a12 dark); `--ab-flow-card` overrides it (e.g. the Welcome card) */
|
|
48
48
|
--ab-flow-dot: var(--ab-dot-color, rgb(107 79 53 / 0.16)); /* ๐ค v6 grid (theme โฅ 0.3.7, else the mock value) */
|
|
49
49
|
overflow: hidden; /* โ๏ธ */
|
|
50
50
|
color: var(--ab-color-on-surface, currentColor); /* ๐จ */
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
/* ๐ง reduced motion: handled by ab-nextjs-animations (wires drawn, pulses frozen at --ab-wire-poster) */
|
|
160
160
|
|
|
161
161
|
/* ===================================================================================================== */
|
|
162
|
-
/* ๐ค 0.2.3 dotted surface (Welcome v6 `.dots`): theme โฅ 0.3.7 --ab-dot-*, else
|
|
162
|
+
/* ๐ค 0.2.3 dotted surface (Welcome v6 `.dots`): theme โฅ 0.3.7 --ab-dot-*, else the values (light + dark) */
|
|
163
163
|
:global(:is(.dark, [data-theme="dark"])) .root { --ab-flow-dot: var(--ab-dot-color, rgb(245 235 225 / 0.1)); } /* ๐ */
|
|
164
164
|
.root[data-ab-dotted='true']:not([data-ab-frame='true'])::before {
|
|
165
165
|
content: "";
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
.logo :is(img, svg) { height: 100%; width: auto; } /* ๐
ฐ๏ธ */
|
|
175
175
|
|
|
176
176
|
/* ===================================================================================================== */
|
|
177
|
-
/* ๐ผ๏ธ 0.2.3 frame mode (Welcome v6): a fixed wรh px stage (
|
|
177
|
+
/* ๐ผ๏ธ 0.2.3 frame mode (Welcome v6): a fixed wรh px stage (the rects 1:1), scaled to the card width. */
|
|
178
178
|
.framed {
|
|
179
179
|
aspect-ratio: var(--ab-flow-ratio); /* ๐ e.g. 760 / 600 */
|
|
180
180
|
flex: none; min-width: 0; /* ๐ a flex column (e.g. the aside scroller) must not squash the ratio */
|
package/ab-icon/helpers.ts
CHANGED
|
@@ -118,7 +118,7 @@ export function warnAbIconMissing(name: string): void {
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
/**
|
|
121
|
-
* ๐ 0.1.13
|
|
121
|
+
* ๐ 0.1.13: scopeAbIconIds โ suffix every `id` in the markup, plus the `url(#โฆ)` / `href="#โฆ"`
|
|
122
122
|
* refs that point at it, so two filled Homes on one page (bottom bar + sidebar) never share a mask.
|
|
123
123
|
* Same rules as ab-nextjs-icons 0.2.4 `scopeAbIconSvgIds` (copied: importing it is fine, but the client
|
|
124
124
|
* bundle rule above says no icon-package imports here). `AbIcon` calls it with React `useId()`.
|
package/ab-icon/index.tsx
CHANGED
|
@@ -56,7 +56,7 @@ import styles from './styles.module.css';
|
|
|
56
56
|
// ๐ฆ helpers for consumers (registerAbIcons, types)
|
|
57
57
|
export * from './helpers';
|
|
58
58
|
export { AB_ICON_BUILTINS } from './builtin';
|
|
59
|
-
export { AbIconRegistrar, type AbIconRegistrarProps } from './registrar'; // ๐๏ธ server-safe registration (
|
|
59
|
+
export { AbIconRegistrar, type AbIconRegistrarProps } from './registrar'; // ๐๏ธ server-safe registration (#11)
|
|
60
60
|
|
|
61
61
|
// ๐๏ธ register built-ins at module scope (same on server render + hydration โ no mismatch)
|
|
62
62
|
registerAbIcons(AB_ICON_BUILTINS);
|
|
@@ -79,7 +79,7 @@ export interface AbIconProps {
|
|
|
79
79
|
const AbIcon = ({ name, variant, filled = false, weight, size, label, title, svg, className, style }: AbIconProps): ReactElement => {
|
|
80
80
|
// ๐ resolve markup without the full map
|
|
81
81
|
const markup = pickAbIconMarkup(svg ?? getRegisteredAbIcon(name), variant ?? (filled ? 'filled' : 'outlined'));
|
|
82
|
-
// ๐ one id per rendered instance (
|
|
82
|
+
// ๐ one id per rendered instance (a hidden twin's mask broke the active Home)
|
|
83
83
|
const uid = useId();
|
|
84
84
|
// ๐๏ธ legacy `filled` โ variant
|
|
85
85
|
const v: AbIconVariant = variant ?? (filled ? 'filled' : 'outlined');
|
|
@@ -106,7 +106,7 @@ const AbIcon = ({ name, variant, filled = false, weight, size, label, title, svg
|
|
|
106
106
|
);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
// ๐ฐ๏ธ 0.1.13 (
|
|
109
|
+
// ๐ฐ๏ธ 0.1.13 (review): NON-breaking fallback for unregistered names. A patch must not blank icons,
|
|
110
110
|
// so an unknown name still renders the pre-G2 Material Symbols ligature (needs the app's font), and
|
|
111
111
|
// warns once in development so the missing registration gets fixed before the app drops the font.
|
|
112
112
|
warnAbIconMissing(name);
|
package/ab-icon/registrar.tsx
CHANGED
|
@@ -51,7 +51,7 @@ export interface AbIconRegistrarProps {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
* ๐๏ธ AbIconRegistrar (0.1.13,
|
|
54
|
+
* ๐๏ธ AbIconRegistrar (0.1.13, QA #11): the SERVER-SAFE way to register icons.
|
|
55
55
|
* `registerAbIcons` is client-only state, so a Server Component (e.g. app/[locale]/layout.tsx) can't call it.
|
|
56
56
|
* Render this once, ABOVE the icons, and pass the svg data as a prop (it is serializable):
|
|
57
57
|
* import home from 'ab-nextjs-icons/ab-icons/icons/home';
|
package/ab-icon-button/index.tsx
CHANGED
|
@@ -49,7 +49,7 @@ import { forwardRef } from 'react';
|
|
|
49
49
|
import clsx from 'clsx';
|
|
50
50
|
// ๐จ package-shipped CSS module
|
|
51
51
|
import styles from './styles.module.css';
|
|
52
|
-
// ๐ฃ 0.1.13 (G2,
|
|
52
|
+
// ๐ฃ 0.1.13 (G2, QA #6): the glyph is an AbIcon SVG, not the Material Symbols font
|
|
53
53
|
import AbIcon from '../ab-icon';
|
|
54
54
|
import { AB_MOTION } from 'ab-nextjs-animations/motion'; // ๐ฌ transition class names (ab-nextjs-animations >= 0.2.4)
|
|
55
55
|
import 'ab-nextjs-animations/motion/styles.css'; // ๐จ .ab-motion-*
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
align-items: center; /* โ๏ธ */
|
|
95
95
|
gap: 0.5rem; /* ๐งฑ */
|
|
96
96
|
min-width: 0; /* ๐ซ overflow */
|
|
97
|
-
/* ๐ป 0.1.13 (
|
|
97
|
+
/* ๐ป 0.1.13 (#13): the command sits on the theme 0.3.4 code surface (dark in both themes) */
|
|
98
98
|
padding: 0.375rem 0.375rem 0.375rem 0.75rem; /* ๐งฑ */
|
|
99
99
|
border-radius: 0.625rem; /* ๐ฒ */
|
|
100
100
|
background: var(--ab-color-code-surface, rgb(35 28 23)); /* ๐ป */
|
package/ab-link/index.tsx
CHANGED
|
@@ -57,7 +57,7 @@ export type AbLinkProps = ComponentProps<typeof NextLink>;
|
|
|
57
57
|
|
|
58
58
|
// ๐ง context: null = use next/link
|
|
59
59
|
const AbLinkContext = createContext<AbLinkComponent | null>(null);
|
|
60
|
-
// ๐ 0.1.13 (
|
|
60
|
+
// ๐ 0.1.13 (#10): the app's locale codes, so active states can ignore the `/fr` prefix
|
|
61
61
|
const AbLocalesContext = createContext<readonly string[]>([]);
|
|
62
62
|
|
|
63
63
|
|
|
@@ -66,7 +66,7 @@ export function useAbLocales(): readonly string[] {
|
|
|
66
66
|
return useContext(AbLocalesContext); // ๐
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
/** ๐งฉ 0.1.13 (
|
|
69
|
+
/** ๐งฉ 0.1.13 (#9): the STRUCTURAL shape a provided link needs: an `href` (any type, e.g. next-intl's
|
|
70
70
|
* `string | { pathname, query }`) and children. next/link, next-intl's Link, ab-nextjs-i18n's Link all fit. */
|
|
71
71
|
export interface AbLinkLikeProps {
|
|
72
72
|
href?: unknown; // ๐
|
package/ab-link/locale.ts
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
|
-
// ๐ 0.1.13 (
|
|
42
|
+
// ๐ 0.1.13 (#10): no 'use client', so server twins can import it too
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* ๐ stripAbLocalePrefix โ `/fr/docs/core` โ `/docs/core` when `fr` is one of `locales`; `/fr` โ `/`.
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
--ab-list-ring: var(--ab-color-accent, #a67c52); /* โฟ --accent */
|
|
49
49
|
--ab-list-text: var(--ab-color-text, #211a16); /* ๐๏ธ */
|
|
50
50
|
--ab-list-muted: var(--ab-color-muted, #6b5b50); /* ๐๏ธ */
|
|
51
|
-
--ab-list-faint: var(--ab-color-faint, #807062); /* ๐๏ธ --faint โฟ AA fallback
|
|
51
|
+
--ab-list-faint: var(--ab-color-faint, #807062); /* ๐๏ธ --faint โฟ AA fallback */
|
|
52
52
|
--ab-list-tile: var(--ab-color-card2, #fbf3ec); /* ๐ผ๏ธ --card2 */
|
|
53
53
|
--ab-list-accent-text: var(--ab-color-accent-text, #8b6340); /* ๐๏ธ --accent-t */
|
|
54
54
|
--ab-list-tint: var(--ab-color-tint, #f4e7db); /* ๐จ --tint */
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* 1+|> const { switchLocale } = useAbLocaleSwitch() // ๐ from ab-nextjs-i18n/navigation
|
|
34
34
|
* -|> <AbLocaleSwitcher label={t('language')} current={locale} locales={[{ code: 'en', label: 'English' }, { code: 'fr', label: 'Franรงais' }]} onSelect={switchLocale} />
|
|
35
35
|
*
|
|
36
|
-
* ๐งฉ 0.1.15 inline, inside the mobile app drawer
|
|
36
|
+
* ๐งฉ 0.1.15 inline, inside the mobile app drawer:
|
|
37
37
|
* 2+|> // a) mixed drawer: nav + theme first, LANGUAGE last under a 1px rule
|
|
38
38
|
* -|> <AbBottomDrawer open={open} onClose={close} title={t('menu')}>
|
|
39
39
|
* -|> <AbDrawerList โฆ />{themeRow}
|
|
@@ -94,15 +94,15 @@ export interface AbLocaleSwitcherProps {
|
|
|
94
94
|
className?: string; // ๐ท๏ธ
|
|
95
95
|
style?: CSSProperties; // ๐จ
|
|
96
96
|
/** ๐๏ธ 0.1.14 (G56, D40): `menu` (default) = popover menu; `drawer` = AbDrawerList; `auto` = drawer below 768px, menu above.
|
|
97
|
-
* ๐งฉ 0.1.15
|
|
97
|
+
* ๐งฉ 0.1.15: `inline` = no trigger; a labelled list of rows rendered in place, e.g. inside the app drawer on mobile */
|
|
98
98
|
presentation?: AbPresentation | 'inline';
|
|
99
|
-
/** ๐ท๏ธ 0.1.15
|
|
99
|
+
/** ๐ท๏ธ 0.1.15: inline only. Show the small uppercase group label (default true). Set false when the language
|
|
100
100
|
* list is the drawer's only content and the drawer title already says "Language" (the label stays the group's name) */
|
|
101
101
|
showLabel?: boolean;
|
|
102
|
-
/** โฟ 0.1.15
|
|
102
|
+
/** โฟ 0.1.15: inline only. The group's accessible name. Default: `label` (e.g. "Language"), so a visible
|
|
103
103
|
* label and the name always agree; set it when the drawer needs a fuller name (e.g. "Choose a language") */
|
|
104
104
|
ariaLabel?: string;
|
|
105
|
-
/** โ 0.1.15
|
|
105
|
+
/** โ 0.1.15: inline only. A 1px --div rule above the block, for when it follows nav / theme items (default false) */
|
|
106
106
|
divider?: boolean;
|
|
107
107
|
drawerScope?: AbDrawerScope; // ๐บ๏ธ default 'app'
|
|
108
108
|
drawerSide?: 'top' | 'bottom' | 'start' | 'end'; // ๐งญ default 'bottom'
|
|
@@ -123,7 +123,7 @@ export function getAbTypeaheadIndex(labels: readonly string[], from: number, cha
|
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* ๐งฉ 0.1.15: the inline list (no trigger, no popover), e.g. inside the mobile app drawer.
|
|
126
|
-
* Its own component
|
|
126
|
+
* Its own component: AbLocaleSwitcher picks this OR the popover by type, so switching `presentation`
|
|
127
127
|
* at runtime remounts instead of changing the hook order. Links mark the active row with aria-current, buttons aria-pressed.
|
|
128
128
|
*/
|
|
129
129
|
export function AbLocaleSwitcherInline(props: AbLocaleSwitcherProps) {
|
|
@@ -137,14 +137,14 @@
|
|
|
137
137
|
.noJs { display: block; } /* ๐๏ธ */
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
/* ===== ๐งฉ 0.1.15
|
|
140
|
+
/* ===== ๐งฉ 0.1.15: presentation="inline", the language list inside the mobile app drawer =====
|
|
141
141
|
* Rows match AbDrawerList / the Home drawer: 48px, 12px padding, radius 8, --tint + --accent-text + 650 when active. */
|
|
142
142
|
.inline { display: grid; gap: 4px; } /* ๐ */
|
|
143
143
|
.inlineLabel { padding: 14px 12px 6px; font-size: 11px; font-weight: 700; line-height: 15px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ab-color-faint, #807062); } /* ๐ท๏ธ = sidebar group label */
|
|
144
|
-
.inlineList { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; } /* ๐
|
|
144
|
+
.inlineList { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; } /* ๐ 8px between rows */
|
|
145
145
|
.inlineList > li { display: block; margin: 0; padding: 0; line-height: 0; } /* ๐งน no inherited li spacing / line box: the row is the box */
|
|
146
146
|
.inlineItem {
|
|
147
|
-
display: flex; align-items: center; gap: 12px; box-sizing: border-box; inline-size: 100%; block-size: 48px; min-block-size: 44px; /* ๐
|
|
147
|
+
display: flex; align-items: center; gap: 12px; box-sizing: border-box; inline-size: 100%; block-size: 48px; min-block-size: 44px; /* ๐ exactly 48px (โฅ 44px hit area) */
|
|
148
148
|
padding: 8px 12px; border: 0; border-radius: var(--ab-radius-row, 8px); background: none; /* ๐งน */
|
|
149
149
|
font: inherit; font-size: 16px; line-height: 20px; text-align: start; color: var(--ab-color-text, #211a16); text-decoration: none; cursor: pointer; /* ๐ค */
|
|
150
150
|
}
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
.inlineItem[data-active='true'] { background: var(--ab-color-tint, #f4e7db); color: var(--ab-color-accent-text, #88603d); font-weight: 650; } /* ๐ฏ */
|
|
153
153
|
.inlineItem:focus-visible { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: -2px; } /* โฟ */
|
|
154
154
|
.inlineText { flex: 1 1 auto; min-width: 0; } /* ๐ท๏ธ */
|
|
155
|
-
.inlineCheck { flex: none; display: inline-flex; inline-size: 18px; block-size: 18px; color: var(--ab-locale-check-color, var(--ab-color-btn, #8b6340)); } /* โ
|
|
155
|
+
.inlineCheck { flex: none; display: inline-flex; inline-size: 18px; block-size: 18px; color: var(--ab-locale-check-color, var(--ab-color-btn, #8b6340)); } /* โ bronze 2px stroke, 18px (P2: the --ab-color-btn token) */
|
|
156
156
|
:global(.dark) .inlineCheck, :global([data-theme='dark']) .inlineCheck { color: var(--ab-locale-check-color, var(--ab-color-accent, #c29a6f)); } /* ๐ the warm accent */
|
|
157
|
-
/* โ 0.1.15
|
|
157
|
+
/* โ 0.1.15: language goes LAST in a drawer with nav / theme items, under a 1px --div rule */
|
|
158
158
|
.inline[data-divider='true'] { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--ab-color-div, rgb(92 64 48 / 0.11)); }
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* 1+|> <AbAppLayout variant="panes" mobileHeader="main" content={<AbMainLayout
|
|
34
34
|
* -|> mainHeader={<AbMobileHeader logo={<a href="/" id="home-logo">โฆ</a>} onLanguage={openLanguage}
|
|
35
35
|
* -|> theme={mode} onThemeChange={setMode} />} โฆ />} />
|
|
36
|
-
* 0.2.3 (
|
|
36
|
+
* 0.2.3 (Welcome 0.2.21): a counter row under the bar + the 3-state theme cycle
|
|
37
37
|
* 2+|> <AbMobileHeader logo={logo} themeMode={mode} onThemeModeChange={setMode}
|
|
38
38
|
* -|> row={<AbCarouselCounter />} />
|
|
39
39
|
*
|
|
@@ -86,8 +86,8 @@ export interface AbMobileHeaderProps {
|
|
|
86
86
|
onLanguage?: () => void; // ๐ the globe: open the Settings sheet with the language list in view
|
|
87
87
|
theme?: 'light' | 'dark'; // ๐ the resolved theme now
|
|
88
88
|
onThemeChange?: (next: 'light' | 'dark') => void; // ๐ the toggle (it shows the mode it switches TO: a moon in light)
|
|
89
|
-
actions?: ReactNode; // โ more 44px buttons after the two (none in
|
|
90
|
-
// ๐ 0.3.2 (
|
|
89
|
+
actions?: ReactNode; // โ more 44px buttons after the two (none in the frame)
|
|
90
|
+
// ๐ 0.3.2 (0.2.23 gaps): a search pill (e.g. <AbSearchTrigger size="sm" />) placed after the globe and
|
|
91
91
|
// BEFORE the theme button
|
|
92
92
|
search?: ReactNode;
|
|
93
93
|
labels?: { language?: string; toDark?: string; toLight?: string; toSystem?: string; header?: string }; // ๐ "Change language", "Switch to dark theme", "Switch to light theme", (0.2.3) "Use the system theme", "Main header"
|
|
@@ -112,9 +112,9 @@ export interface AbMobileHeaderProps {
|
|
|
112
112
|
// is set, the summary opens the sheet instead (aria-controls / aria-expanded kept). Wins over `languageHref`
|
|
113
113
|
languages?: readonly AbMobileHeaderLanguage[];
|
|
114
114
|
// ๐ 0.2.3: 'compact' = a 48px bar with 18px start inset (the Welcome v6 mock: 48 + the counter row = 96px).
|
|
115
|
-
// Default 'default' (56px,
|
|
115
|
+
// Default 'default' (56px, the drawers v2 frame)
|
|
116
116
|
size?: 'default' | 'compact';
|
|
117
|
-
// ๐ฑ 0.2.3 (
|
|
117
|
+
// ๐ฑ 0.2.3 (Welcome 0.2.21): where the bar (logo ยท globe ยท theme) shows, from CSS only (no JS, SSR-safe):
|
|
118
118
|
// 'auto' (default) = hidden from 768px up ONLY inside a core mainHeaderAt="all" layout (there the app header
|
|
119
119
|
// already has the logo, so just the `row` stays), else everywhere; 'all' = always; 'mobile' = below 768px only
|
|
120
120
|
barAt?: 'auto' | 'all' | 'mobile';
|
|
@@ -122,7 +122,7 @@ export interface AbMobileHeaderProps {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
|
-
* ๐ฑ AbMobileHeader โ
|
|
125
|
+
* ๐ฑ AbMobileHeader โ the mobile main header (drawers v2): logo left; a globe ("Change language",
|
|
126
126
|
* `aria-haspopup="dialog"`) and a theme toggle right, each 44ร44. No search (the bottom nav has a Search tab) and
|
|
127
127
|
* no menu button (the left drawer opens with an edge swipe). Put it in AbMainLayout's `mainHeader` with core
|
|
128
128
|
* โฅ 0.2.1 `mobileHeader="main"`: the 56px row, its divider and the hidden app header come from core.
|
package/ab-nav-drawer/index.tsx
CHANGED
|
@@ -55,8 +55,8 @@ import AbDrawer from '../ab-drawer';
|
|
|
55
55
|
import AbIcon from '../ab-icon';
|
|
56
56
|
// ๐ the app's link (AbLinkProvider: next/link, or a locale-aware one)
|
|
57
57
|
import Link from '../ab-link';
|
|
58
|
-
// ๐ฏ the same active rule as the laptop sidebar
|
|
59
|
-
import {
|
|
58
|
+
// ๐ฏ the same active rule as the laptop sidebar (0.5.0: shared helper, deepest match by default)
|
|
59
|
+
import { getAbActiveHrefs, normalizeAbHref, type AbActiveMatch } from '../ab-sidebar/active';
|
|
60
60
|
// ๐จ the drawers v2 kit
|
|
61
61
|
import kit from '../ab-drawer/kit.module.css';
|
|
62
62
|
|
|
@@ -66,6 +66,7 @@ export interface AbNavDrawerItem {
|
|
|
66
66
|
label: string; // ๐ท๏ธ
|
|
67
67
|
icon?: string; // ๐ฃ an AbIcons name
|
|
68
68
|
meta?: string; // ๐ท๏ธ trailing mono text, e.g. a version
|
|
69
|
+
exact?: boolean; // ๐ฏ 0.5.0: true = active on its own href only; false = allow parent matching under activeMatch="exact"
|
|
69
70
|
}
|
|
70
71
|
/** ๐๏ธ one group: an optional uppercase label (a heading for its list) + rows */
|
|
71
72
|
export interface AbNavDrawerSection { id: string; label?: string; items: readonly AbNavDrawerItem[] }
|
|
@@ -78,7 +79,9 @@ export interface AbNavDrawerProps {
|
|
|
78
79
|
version?: ReactNode; // ๐ท๏ธ a string = the mono version chip ("v0.2.x โ"); or your own picker node
|
|
79
80
|
onVersionClick?: () => void; // ๐ฝ the chip as a button (e.g. open a version menu)
|
|
80
81
|
sections: readonly AbNavDrawerSection[]; // ๐๏ธ same content as the laptop sidebar
|
|
81
|
-
activeHref?: string; // ๐ฏ
|
|
82
|
+
activeHref?: string; // ๐ฏ the current route (query, hash and a trailing slash are ignored; "/" only matches itself)
|
|
83
|
+
activeMatch?: AbActiveMatch; // ๐ฏ 0.5.0: 'best' (default, deepest match only), 'prefix' (every parent too) or 'exact'
|
|
84
|
+
locales?: readonly string[]; // ๐ 0.5.0: stripped from `activeHref` first (`/fr/docs` โ `/docs`)
|
|
82
85
|
footer?: readonly AbNavDrawerItem[]; // ๐ pinned 48px rows (e.g. Changelog)
|
|
83
86
|
onSettings?: () => void; // โ๏ธ adds a "Settings โบ" row; close this drawer, then open the Settings sheet
|
|
84
87
|
onNavigate?: (href: string) => void; // ๐ after a link is chosen (the drawer closes either way)
|
|
@@ -89,7 +92,7 @@ export interface AbNavDrawerProps {
|
|
|
89
92
|
}
|
|
90
93
|
|
|
91
94
|
/**
|
|
92
|
-
* โฌ
๏ธ AbNavDrawer โ
|
|
95
|
+
* โฌ
๏ธ AbNavDrawer โ the left drawer (drawers v2 ยง2): the mobile sidebar.
|
|
93
96
|
*
|
|
94
97
|
* - ๐ 320px, full height, 0 16 16 0 radius; header = logo + 44px โ; the version chip; a scrolling nav
|
|
95
98
|
* (44px rows, uppercase group headings, a 72px fade); a pinned footer of 48px rows
|
|
@@ -99,11 +102,13 @@ export interface AbNavDrawerProps {
|
|
|
99
102
|
* group label is a heading that labels its list
|
|
100
103
|
* - ๐ฅ tier 'nav': in front of the right drawer, under the bottom sheet
|
|
101
104
|
*/
|
|
102
|
-
const AbNavDrawer = ({ open, onClose, logo, version, onVersionClick, sections, activeHref, footer = [], onSettings, onNavigate, labels = {}, returnFocus, id = 'ab-nav-drawer', className }: AbNavDrawerProps): ReactElement => {
|
|
105
|
+
const AbNavDrawer = ({ open, onClose, logo, version, onVersionClick, sections, activeHref, activeMatch, locales, footer = [], onSettings, onNavigate, labels = {}, returnFocus, id = 'ab-nav-drawer', className }: AbNavDrawerProps): ReactElement => {
|
|
103
106
|
const L = { title: 'Site navigation', close: 'Close navigation', settings: 'Settings', version: 'Version', ...labels }; // ๐
|
|
104
107
|
const choose = (href: string) => (e: MouseEvent) => { if (e.defaultPrevented) return; onNavigate?.(href); onClose(); }; // ๐ then close
|
|
108
|
+
// ๐ฅ 0.5.0: resolve the active href once, across sections + footer, so a parent never lights with its child
|
|
109
|
+
const activeSet = getAbActiveHrefs([...sections.flatMap((s) => s.items), ...footer], activeHref, { match: activeMatch, locales });
|
|
105
110
|
const row = (it: AbNavDrawerItem, cls: string) => {
|
|
106
|
-
const on =
|
|
111
|
+
const on = activeSet.has(normalizeAbHref(it.href)); // ๐ฏ
|
|
107
112
|
return (
|
|
108
113
|
<Link href={it.href} className={cls} aria-current={on ? 'page' : undefined} onClick={choose(it.href)}>
|
|
109
114
|
{it.icon && <AbIcon name={it.icon} filled={on} size={cls === kit.row ? 24 : 22} />}
|
package/ab-navbar/index.tsx
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
import type { ReactElement } from 'react';
|
|
49
49
|
// ๐งญ route fallback
|
|
50
50
|
import { usePathname } from 'next/navigation';
|
|
51
|
-
// ๐ 0.1.13 (
|
|
51
|
+
// ๐ 0.1.13 (#10): locale-stripped pathname
|
|
52
52
|
import { stripAbLocalePrefix, useAbLocales } from '../ab-link';
|
|
53
53
|
// ๐ฃ client AbIcon
|
|
54
54
|
import AbIcon from '../ab-icon';
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
align-items: center; /* โ๏ธ */
|
|
60
60
|
gap: 4px; /* โ๏ธ */
|
|
61
61
|
min-width: 64px; /* ๐ */
|
|
62
|
-
min-height: 44px; /* ๐ 0.3.2 (
|
|
62
|
+
min-height: 44px; /* ๐ 0.3.2 (0.2.23 gaps): a 44px tap target (WCAG 2.5.5), was ~42px with indicator="none" */
|
|
63
63
|
justify-content: center; /* ๐ฏ 0.3.2: the pill + label stay centred in the taller target */
|
|
64
64
|
box-sizing: border-box; /* ๐ฆ 0.3.2: the 44px counts the padding */
|
|
65
65
|
border: 0; /* ๐ซ (buttons) */
|
package/ab-navbar/view.tsx
CHANGED
|
@@ -62,7 +62,7 @@ export interface AbNavbarButtonItem {
|
|
|
62
62
|
onSelect?: () => void; // ๐
|
|
63
63
|
expanded?: boolean; // โฟ aria-expanded for sheet toggles
|
|
64
64
|
controls?: string; // โฟ aria-controls
|
|
65
|
-
disabled?: boolean; // ๐ซ 0.1.13 (
|
|
65
|
+
disabled?: boolean; // ๐ซ 0.1.13 (#8, D24/D25): focusable, announced, inert (aria-disabled)
|
|
66
66
|
comingSoon?: boolean | string; // ๐ง 0.1.13: inert + a "Coming soon" tag (string = your translated label)
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -64,7 +64,7 @@ export interface AbPackageCardProps {
|
|
|
64
64
|
description?: ReactNode; // ๐
|
|
65
65
|
version?: string; // ๐ท๏ธ e.g. "0.1.7"
|
|
66
66
|
icon?: ReactNode; // ๐ฃ e.g. <AbIcon name="webhook" />
|
|
67
|
-
media?: ReactNode; // ๐ผ๏ธ 0.1.13 (
|
|
67
|
+
media?: ReactNode; // ๐ผ๏ธ 0.1.13 (#14): any media (logo, image); wins over `icon`
|
|
68
68
|
id?: string; // ๐ 0.1.13: anchor target
|
|
69
69
|
badge?: ReactNode; // ๐ด e.g. "New"
|
|
70
70
|
tags?: string[]; // ๐ท๏ธ e.g. ['client', 'server']
|
|
@@ -78,7 +78,7 @@ export interface AbPackageCardProps {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
|
-
* ๐งฉ 0.1.13
|
|
81
|
+
* ๐งฉ 0.1.13: `ab-nextjs-components` โ `ab-` `nextjs-` `components` with a `<wbr>` after each
|
|
82
82
|
* hyphen, so a narrow card wraps at a hyphen (never mid-word) instead of cutting the name off.
|
|
83
83
|
*/
|
|
84
84
|
export function toAbPackageNameParts(name: string): ReactNode[] {
|
|
@@ -139,5 +139,5 @@ const AbPackageCardLegacy = ({ name, href, description, version, icon, media, id
|
|
|
139
139
|
// ๐ฆ exports
|
|
140
140
|
export default AbPackageCard;
|
|
141
141
|
export { AbPackageCard };
|
|
142
|
-
// ๐ผ๏ธ 0.2.1
|
|
142
|
+
// ๐ผ๏ธ 0.2.1: the Home preview tiles (mock .pv-anim / .pv-code / .pv-comp)
|
|
143
143
|
export { AbPackagePreviewCurve, AbPackagePreviewCode, AbPackagePreviewComponents, type AbPackagePreviewComponentsLabels, type AbPackagePreviewComponentsProps } from './previews';
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* SOFTWARE.
|
|
25
25
|
*
|
|
26
26
|
* @project: ab-nextjs-components
|
|
27
|
-
* @name: AbPackageCard Home previews (0.2.1,
|
|
27
|
+
* @name: AbPackageCard Home previews (0.2.1, approved, mock .pv-*)
|
|
28
28
|
* @file: ab-package-card/previews.tsx
|
|
29
29
|
* @type: React Component (no hooks: client + server)
|
|
30
30
|
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
|
-
.abPackageCardName { font-family: var(--ab-font-code, var(--ab-font-mono, ui-monospace, monospace)); font-size: 16px; overflow-wrap: anywhere; word-break: normal; hyphens: none; display: block; min-width: 0; max-width: 100%; } /* ๐ฆ 0.1.13
|
|
39
|
+
.abPackageCardName { font-family: var(--ab-font-code, var(--ab-font-mono, ui-monospace, monospace)); font-size: 16px; overflow-wrap: anywhere; word-break: normal; hyphens: none; display: block; min-width: 0; max-width: 100%; } /* ๐ฆ 0.1.13: wraps at the <wbr> after a hyphen first (ab-nextjs-/components); `anywhere` only splits a part that alone is wider than a very narrow card (animations at ~70px), so it never overflows */
|
|
40
40
|
.abPackageCardVersion { font-family: var(--ab-font-code, var(--ab-font-mono, ui-monospace, monospace)); opacity: 0.8; } /* ๐ท๏ธ */
|
|
41
41
|
.abPackageCardTag { padding: 0 8px; border-radius: 999px; line-height: 20px; background: var(--ab-color-surface-container-high, rgb(0 0 0 / 0.06)); } /* ๐ท๏ธ */
|
|
42
42
|
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
}
|
|
81
81
|
@media (prefers-reduced-motion: reduce) { .home:hover { transform: none; } } /* โฟ no lift */
|
|
82
82
|
|
|
83
|
-
/* ===== ๐ผ๏ธ 0.2.1
|
|
83
|
+
/* ===== ๐ผ๏ธ 0.2.1: Home preview tiles, the mock `.pv-*` (theme tokens, fallbacks = the mock) ===== */
|
|
84
84
|
.homePreview > * { flex: none; } /* ๐ซ no child stretches; the tile centres them both ways */
|
|
85
85
|
/* ใฐ๏ธ Animations */
|
|
86
86
|
.pvAnim { position: relative; display: block; box-sizing: border-box; width: 100%; height: 100%; padding: 6px 10px; } /* ๐ */
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
39
|
/* ===== AB PLAYGROUND SCENE ยท I18N (illustration 8) ===== */
|
|
40
|
-
/* ๐ฌ 0.2.3
|
|
40
|
+
/* ๐ฌ 0.2.3: NO motion here any more. The EN โ FR โ ES โ RU cycle (keyframes, ease-out-cubic rise,
|
|
41
41
|
instant chip jumps, the [data-ab-still] frame, pause + reduced motion) ships from ab-nextjs-animations โฅ 0.2.5
|
|
42
42
|
(`ab-nextjs-animations/locale-cycle`). This module only lays the pieces out. */
|
|
43
43
|
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
// โ๏ธ types
|
|
40
40
|
import type { ReactElement } from 'react';
|
|
41
41
|
|
|
42
|
-
// ๐ผ๏ธ
|
|
42
|
+
// ๐ผ๏ธ the tiny line icons (welcome-v6 scenes.py `MS` + v5 common.py package icons), decorative only
|
|
43
43
|
const MS: Record<string, ReactElement> = {
|
|
44
44
|
home: <path d="M4 11 12 4l8 7v9h-5v-6H9v6H4z" />,
|
|
45
45
|
search: <><circle cx="11" cy="11" r="6" /><path d="m20 20-4.5-4.5" /></>,
|