ab-nextjs-components 0.1.13 β 0.2.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 +70 -0
- package/README.md +35 -0
- package/ab-app-bar/index.tsx +53 -13
- package/ab-app-bar/styles.module.css +68 -4
- package/ab-bottom-drawer/index.tsx +71 -0
- package/ab-bottom-drawer/styles.module.css +66 -0
- package/ab-breadcrumbs/index.tsx +92 -0
- package/ab-breadcrumbs/styles.module.css +54 -0
- package/ab-button/helpers.ts +6 -1
- package/ab-button/index.tsx +8 -2
- package/ab-button/styles.module.css +39 -0
- package/ab-card/styles.module.css +1 -1
- package/ab-carousel/styles.module.css +1 -1
- package/ab-chip/index.tsx +16 -4
- package/ab-chip/styles.module.css +12 -1
- package/ab-confirm-drawer/index.tsx +97 -0
- package/ab-confirm-drawer/styles.module.css +41 -0
- package/ab-drawer/gestures.ts +134 -0
- package/ab-drawer/index.tsx +458 -0
- package/ab-drawer/kit.module.css +204 -0
- package/ab-drawer/styles.module.css +166 -0
- package/ab-drawer/use-ab-drawer.ts +89 -0
- package/ab-drawer/use-ab-edge-swipe.ts +155 -0
- package/ab-drawer-list/index.tsx +118 -0
- package/ab-drawer-list/styles.module.css +65 -0
- package/ab-flow-diagram/styles.module.css +2 -2
- package/ab-icon/builtin.ts +4 -0
- package/ab-icon-button/index.tsx +13 -2
- package/ab-icon-button/styles.module.css +1 -1
- package/ab-install-snippet/index.tsx +51 -29
- package/ab-install-snippet/styles.module.css +34 -2
- package/ab-kbd/styles.module.css +1 -1
- package/ab-list/index.tsx +107 -0
- package/ab-list/styles.module.css +82 -0
- package/ab-locale-switcher/index.tsx +103 -10
- package/ab-locale-switcher/styles.module.css +24 -4
- package/ab-mobile-header/index.tsx +100 -0
- package/ab-nav-drawer/index.tsx +158 -0
- package/ab-navbar/index.tsx +1 -1
- package/ab-navbar/styles.module.css +20 -2
- package/ab-navbar/view.tsx +7 -4
- package/ab-package-card/index.tsx +49 -2
- package/ab-package-card/styles.module.css +40 -0
- package/ab-search-drawer/index.tsx +279 -0
- package/ab-search-trigger/index.tsx +22 -2
- package/ab-search-trigger/styles.module.css +30 -1
- package/ab-settings-drawer/index.tsx +160 -0
- package/ab-sidebar/index.tsx +6 -3
- package/ab-sidebar/styles.module.css +53 -5
- package/ab-sidebar/view.tsx +18 -4
- package/ab-theme-toggle/index.tsx +21 -6
- package/ab-theme-toggle/styles.module.css +18 -3
- package/ab-toc/index.tsx +9 -2
- package/ab-toc/styles.module.css +20 -8
- package/ab-toc-drawer/index.tsx +129 -0
- package/ab-version-switcher/index.tsx +143 -0
- package/ab-version-switcher/styles.module.css +76 -0
- package/index.ts +50 -0
- package/package.json +28 -3
- package/server/ab-button/index.tsx +6 -2
- package/server/ab-button/styles.module.css +39 -0
- package/types/index.d.ts +37 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @license MIT
|
|
3
|
+
* ~~~~~~~~~~~~
|
|
4
|
+
* ab-nextjs-components
|
|
5
|
+
* ~~~~~~~~~~~~
|
|
6
|
+
* Copyright (c) 2026 Abraham Ukachi. The abElements Project.
|
|
7
|
+
*
|
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
* of this software and associated documentation files (the 'Software'), to deal
|
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
* furnished to do so, subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
* copies or substantial portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
* SOFTWARE.
|
|
25
|
+
*
|
|
26
|
+
* @project: ab-nextjs-components
|
|
27
|
+
* @name: AbSettingsDrawer
|
|
28
|
+
* @file: ab-settings-drawer/index.tsx
|
|
29
|
+
* @type: Client component
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*
|
|
32
|
+
* Example usage:
|
|
33
|
+
* 1+|> const [open, setOpen] = useState(false)
|
|
34
|
+
* -|> <AbSettingsDrawer open={open} onClose={() => setOpen(false)} theme={mode} onThemeChange={setMode}
|
|
35
|
+
* -|> locales={[{ code: 'en', label: 'English' }, { code: 'fr', label: 'FranΓ§ais' }]} locale="en" onLocaleChange={go} />
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/*
|
|
39
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
40
|
+
* MOTTO: We'll always do more π!!!
|
|
41
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
'use client';
|
|
46
|
+
|
|
47
|
+
// βοΈ React
|
|
48
|
+
import { useRef, type KeyboardEvent, type ReactElement, type ReactNode } from 'react';
|
|
49
|
+
// π§΅ classes
|
|
50
|
+
import clsx from 'clsx';
|
|
51
|
+
// ποΈ the drawer (tiers, snap points, centring)
|
|
52
|
+
import AbDrawer, { type AbSheetSnap } from '../ab-drawer';
|
|
53
|
+
// π£ icons
|
|
54
|
+
import AbIcon from '../ab-icon';
|
|
55
|
+
// π¨ the drawers v2 kit
|
|
56
|
+
import kit from '../ab-drawer/kit.module.css';
|
|
57
|
+
|
|
58
|
+
/** π a theme choice */
|
|
59
|
+
export type AbSettingsTheme = 'light' | 'dark' | 'system';
|
|
60
|
+
/** π a language row */
|
|
61
|
+
export interface AbSettingsLocale { code: string; label: string } // π·οΈ `label` in its own language ("FranΓ§ais")
|
|
62
|
+
|
|
63
|
+
/** π·οΈ every visible / accessible string (English defaults) */
|
|
64
|
+
export interface AbSettingsDrawerLabels {
|
|
65
|
+
title?: string; // "Settings"
|
|
66
|
+
theme?: string; // "Theme"
|
|
67
|
+
language?: string; // "Language"
|
|
68
|
+
light?: string; dark?: string; system?: string; // π
|
|
69
|
+
close?: string; // "Close settings"
|
|
70
|
+
expand?: string; collapse?: string; // β the handle: "Expand settings" / "Collapse settings"
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** βοΈ props */
|
|
74
|
+
export interface AbSettingsDrawerProps {
|
|
75
|
+
open: boolean; // πͺ
|
|
76
|
+
onClose: () => void; // β
|
|
77
|
+
theme: AbSettingsTheme; // π the checked theme
|
|
78
|
+
onThemeChange: (theme: AbSettingsTheme) => void; // π£
|
|
79
|
+
locales: readonly AbSettingsLocale[]; // π
|
|
80
|
+
locale: string; // π― the checked locale code
|
|
81
|
+
onLocaleChange: (code: string) => void; // π£
|
|
82
|
+
labels?: AbSettingsDrawerLabels; // π·οΈ
|
|
83
|
+
themes?: readonly AbSettingsTheme[]; // ποΈ default light, dark, system
|
|
84
|
+
children?: ReactNode; // β extra sections after Language (your own; Accessibility / About are not built in)
|
|
85
|
+
defaultSnap?: AbSheetSnap; // π§² default 'partial' (70%)
|
|
86
|
+
returnFocus?: string; // β©οΈ see AbDrawer
|
|
87
|
+
id?: string; // π
|
|
88
|
+
className?: string; // π·οΈ
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// β the 24px 2px-stroke check (the mock's path)
|
|
92
|
+
const Check = () => <svg className={kit.ck} viewBox="0 0 24 24" width="24" height="24" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" /></svg>;
|
|
93
|
+
// π the glyph per theme
|
|
94
|
+
const THEME_ICON: Record<AbSettingsTheme, string> = { light: 'light_mode', dark: 'dark_mode', system: 'brightness_auto' };
|
|
95
|
+
|
|
96
|
+
/** β¨οΈ radiogroup keys: arrows move AND check (WAI-ARIA radio pattern), Home / End jump */
|
|
97
|
+
function radioKeys<T>(e: KeyboardEvent, items: readonly T[], current: T, pick: (v: T) => void, root: HTMLElement | null) {
|
|
98
|
+
const i = items.indexOf(current); let n = -1;
|
|
99
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowRight') n = (i + 1) % items.length;
|
|
100
|
+
else if (e.key === 'ArrowUp' || e.key === 'ArrowLeft') n = (i - 1 + items.length) % items.length;
|
|
101
|
+
else if (e.key === 'Home') n = 0; else if (e.key === 'End') n = items.length - 1;
|
|
102
|
+
if (n < 0) return;
|
|
103
|
+
e.preventDefault(); pick(items[n]); // β
check it
|
|
104
|
+
root?.querySelectorAll<HTMLElement>('[role="radio"]')[n]?.focus(); // π― and move focus
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* βοΈ AbSettingsDrawer β John's Settings bottom drawer (drawers v2, spec Β§1): the default bottom sheet, holding
|
|
109
|
+
* THEME (a Light / Dark / System segmented radiogroup, 48px) and LANGUAGE (48px radio rows, each label in its
|
|
110
|
+
* own `lang`, the checked one tinted with a check).
|
|
111
|
+
*
|
|
112
|
+
* - π± below 768px: full width, snaps at 70% and full height via the handle (AbDrawer `snapPoints`)
|
|
113
|
+
* - π» 768px and up: centred in the main pane, min(640px, main width), at most 70% tall
|
|
114
|
+
* - βΏ `role="dialog"` labelled by the title; focus goes to the checked language on open (so the globe's
|
|
115
|
+
* "Change language" lands right there) and back to the opener on close; Esc / scrim / β close it
|
|
116
|
+
* - π₯ tier 'sheet': above the left and right drawers. Opening it from the left drawer? Close that one first.
|
|
117
|
+
*/
|
|
118
|
+
const AbSettingsDrawer = ({ open, onClose, theme, onThemeChange, locales, locale, onLocaleChange, labels = {}, themes = ['light', 'dark', 'system'], children, defaultSnap, returnFocus, id, className }: AbSettingsDrawerProps): ReactElement => {
|
|
119
|
+
const seg = useRef<HTMLDivElement>(null); // ποΈ
|
|
120
|
+
const langs = useRef<HTMLDivElement>(null); // π
|
|
121
|
+
const L = { title: 'Settings', theme: 'Theme', language: 'Language', light: 'Light', dark: 'Dark', system: 'System', close: 'Close settings', expand: 'Expand settings', collapse: 'Collapse settings', ...labels }; // π·οΈ
|
|
122
|
+
const base = id ?? 'ab-settings'; // π
|
|
123
|
+
const codes = locales.map((l) => l.code); // π
|
|
124
|
+
return (
|
|
125
|
+
<AbDrawer
|
|
126
|
+
open={open} onClose={onClose} id={id} side="bottom" scope="app" tier="sheet"
|
|
127
|
+
snapPoints centerIn="main" defaultSnap={defaultSnap} handleLabels={{ expand: L.expand, collapse: L.collapse }}
|
|
128
|
+
title={L.title} closeLabel={L.close} closeIcon={<AbIcon name="close" size={24} />}
|
|
129
|
+
initialFocus='[data-ab-part="settings-language"] [aria-checked="true"]' returnFocus={returnFocus}
|
|
130
|
+
className={clsx('AbSettingsDrawer', kit.sheet, className)}
|
|
131
|
+
>
|
|
132
|
+
<p className={kit.lbl} id={`${base}-theme`}>{L.theme}</p>
|
|
133
|
+
<div ref={seg} className={kit.seg} role="radiogroup" aria-labelledby={`${base}-theme`} data-ab-part="settings-theme">
|
|
134
|
+
{themes.map((t) => (
|
|
135
|
+
<button key={t} type="button" role="radio" aria-checked={t === theme} tabIndex={t === theme ? 0 : -1} className={kit.segBtn} data-value={t}
|
|
136
|
+
onClick={() => onThemeChange(t)} onKeyDown={(e) => radioKeys(e, themes, theme, onThemeChange, seg.current)}>
|
|
137
|
+
<AbIcon name={THEME_ICON[t]} size={18} />{L[t]}
|
|
138
|
+
</button>
|
|
139
|
+
))}
|
|
140
|
+
</div>
|
|
141
|
+
<p className={kit.lbl} id={`${base}-language`}>{L.language}</p>
|
|
142
|
+
<div ref={langs} role="radiogroup" aria-labelledby={`${base}-language`} data-ab-part="settings-language">
|
|
143
|
+
{locales.map((l) => {
|
|
144
|
+
const on = l.code === locale; // π―
|
|
145
|
+
return (
|
|
146
|
+
<button key={l.code} type="button" role="radio" aria-checked={on} tabIndex={on ? 0 : -1} lang={l.code} className={kit.row} data-value={l.code}
|
|
147
|
+
onClick={() => onLocaleChange(l.code)} onKeyDown={(e) => radioKeys(e, codes, locale, onLocaleChange, langs.current)}>
|
|
148
|
+
{l.label}{on && <Check />}
|
|
149
|
+
</button>
|
|
150
|
+
);
|
|
151
|
+
})}
|
|
152
|
+
</div>
|
|
153
|
+
{children}
|
|
154
|
+
</AbDrawer>
|
|
155
|
+
);
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// π¦ exports
|
|
159
|
+
export default AbSettingsDrawer;
|
|
160
|
+
export { AbSettingsDrawer };
|
package/ab-sidebar/index.tsx
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* Example usage:
|
|
33
33
|
* <AbSidebar
|
|
34
34
|
* activeHref="/docs/components"
|
|
35
|
-
* sections={[{ id: '
|
|
35
|
+
* sections={[{ id: 'gs', label: 'Getting started', items: [{ href: '/introduction', icon: 'description', label: 'Introduction' }] }]}
|
|
36
36
|
* />
|
|
37
37
|
*/
|
|
38
38
|
|
|
@@ -66,6 +66,7 @@ export interface AbSidebarProps extends AbSidebarBaseProps {
|
|
|
66
66
|
defaultCollapsed?: boolean; // πͺ uncontrolled start
|
|
67
67
|
onCollapsedChange?: (collapsed: boolean) => void; // π
|
|
68
68
|
collapsible?: boolean; // π show the collapse button (default true when sections are given)
|
|
69
|
+
collapseButtonVariant?: 'plain' | 'outlined'; // βͺ 0.1.14 (P9): 'outlined' = 32Γ32 bordered `<<` / `>>` (default 'plain' chevron)
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
/**
|
|
@@ -73,7 +74,8 @@ export interface AbSidebarProps extends AbSidebarBaseProps {
|
|
|
73
74
|
* tooltips, and a collapse button (aria-expanded + aria-controls; hidden when JS is off).
|
|
74
75
|
*/
|
|
75
76
|
const AbSidebar = (props: AbSidebarProps): ReactElement => {
|
|
76
|
-
const { collapsed: controlled, defaultCollapsed = false, onCollapsedChange, collapsible, activeHref, page, labels, id = 'ab-sidebar-list' } = props;
|
|
77
|
+
const { collapsed: controlled, defaultCollapsed = false, onCollapsedChange, collapsible, collapseButtonVariant = 'plain', activeHref, page, labels, id = 'ab-sidebar-list' } = props;
|
|
78
|
+
const outlined = collapseButtonVariant === 'outlined'; // βͺ P9
|
|
77
79
|
// π§ route
|
|
78
80
|
const appLocales = useAbLocales(); // π from AbLinkProvider
|
|
79
81
|
const pathname = stripAbLocalePrefix(usePathname() ?? '', props.locales ?? appLocales); // π§ `/fr/docs` β `/docs`
|
|
@@ -94,12 +96,13 @@ const AbSidebar = (props: AbSidebarProps): ReactElement => {
|
|
|
94
96
|
type="button"
|
|
95
97
|
className={styles.abSidebarToggle} // π hidden under (scripting: none)
|
|
96
98
|
data-ab-part="collapse"
|
|
99
|
+
data-variant={outlined ? 'outlined' : undefined} // βͺ P9
|
|
97
100
|
aria-expanded={!collapsed} // βΏ
|
|
98
101
|
aria-controls={id} // βΏ
|
|
99
102
|
aria-label={toggleLabel} // π·οΈ
|
|
100
103
|
onClick={() => setCollapsed(!collapsed)}
|
|
101
104
|
>
|
|
102
|
-
<AbIcon name={collapsed ? 'chevron_right' : 'chevron_left'} size={20} />
|
|
105
|
+
<AbIcon name={outlined ? (collapsed ? 'keyboard_double_arrow_right' : 'keyboard_double_arrow_left') : collapsed ? 'chevron_right' : 'chevron_left'} size={outlined ? 18 : 20} />
|
|
103
106
|
</button>
|
|
104
107
|
) : undefined;
|
|
105
108
|
|
|
@@ -76,10 +76,10 @@
|
|
|
76
76
|
color: inherit; /* ποΈ */
|
|
77
77
|
cursor: pointer; /* π */
|
|
78
78
|
}
|
|
79
|
-
.abSidebarToggle:hover { background: color-mix(in srgb, currentColor 8%, transparent); } /* π±οΈ */
|
|
79
|
+
.abSidebarToggle:hover { background: var(--ab-color-hover, color-mix(in srgb, currentColor 8%, transparent)); } /* π±οΈ */
|
|
80
80
|
.abSidebarToggle:focus-visible,
|
|
81
81
|
.abSidebarLink:focus-visible {
|
|
82
|
-
outline: var(--ab-focus-ring-width, 2px) solid var(--ab-color-primary, #8f4c38); /* βΏ */
|
|
82
|
+
outline: var(--ab-focus-ring-width, 2px) solid var(--ab-color-accent, var(--ab-color-primary, #8f4c38)); /* βΏ */
|
|
83
83
|
outline-offset: var(--ab-focus-ring-offset, 2px); /* βΏ */
|
|
84
84
|
}
|
|
85
85
|
@media (scripting: none) {
|
|
@@ -125,10 +125,10 @@
|
|
|
125
125
|
}
|
|
126
126
|
.abSidebarLabel { min-width: 0; overflow-wrap: anywhere; } /* π« no overflow, ReactNode-friendly */
|
|
127
127
|
.abSidebarLink[data-depth='1'] { padding-inline-start: 44px; font-size: 14px; } /* π³ */
|
|
128
|
-
.abSidebarLink:hover { background: color-mix(in srgb, currentColor 8%, transparent); } /* π±οΈ */
|
|
128
|
+
.abSidebarLink:hover { background: var(--ab-color-hover, color-mix(in srgb, currentColor 8%, transparent)); } /* π±οΈ */
|
|
129
129
|
.abSidebarLink[data-active='true'] {
|
|
130
|
-
background: var(--ab-color-secondary-container, color-mix(in srgb, #8f4c38 14%, transparent)); /* π― */
|
|
131
|
-
color: var(--ab-color-on-secondary-container, inherit); /* ποΈ */
|
|
130
|
+
background: var(--ab-color-tint, var(--ab-color-secondary-container, color-mix(in srgb, #8f4c38 14%, transparent))); /* π― */
|
|
131
|
+
color: var(--ab-color-accent-text, var(--ab-color-on-secondary-container, inherit)); /* ποΈ */
|
|
132
132
|
font-weight: 600; /* π€ */
|
|
133
133
|
}
|
|
134
134
|
.abSidebarIcon { flex: none; } /* π£ */
|
|
@@ -144,3 +144,51 @@
|
|
|
144
144
|
.abSidebar[data-collapsed='true'] .abSidebarLink { width: 48px; justify-content: center; padding: 0; }
|
|
145
145
|
.abSidebar[data-collapsed='true'] .abSidebarLabel,
|
|
146
146
|
.abSidebar[data-collapsed='true'] .abSidebarBadge { display: none; }
|
|
147
|
+
|
|
148
|
+
/* ===== π 0.1.14 (P8/P9, Home spec Β§4 sidebar) ===== */
|
|
149
|
+
.abSidebar[data-density='compact'] { max-width: none; gap: 0; padding: 0; } /* π the pane sets the width (248 / 260 / 288) */
|
|
150
|
+
.abSidebar[data-density='compact'] .abSidebarHeader { min-height: 0; padding: 12px 10px 6px 16px; } /* π·οΈ version switcher + collapse */
|
|
151
|
+
.abSidebar[data-density='compact'] .abSidebarSections { gap: 1px; padding: 4px 10px 16px; box-sizing: border-box; } /* π¦ mock nav: 1px between every row and label */
|
|
152
|
+
.abSidebar[data-density='compact'] .abSidebarSection { gap: 1px; }
|
|
153
|
+
.abSidebar[data-density='compact'] .abSidebarList { gap: 1px; }
|
|
154
|
+
.abSidebar[data-density='compact'] .abSidebarHeading {
|
|
155
|
+
padding: 14px 10px 6px; font-size: 11px; font-weight: 700; line-height: 15px; letter-spacing: 0.06em; /* π€ 35px label row, like the mock */
|
|
156
|
+
color: var(--ab-color-faint, #807062); opacity: 1; /* π¨ AA faint */
|
|
157
|
+
}
|
|
158
|
+
.abSidebar[data-density='compact'] .abSidebarLink {
|
|
159
|
+
gap: 10px; min-height: 0; height: 32px; padding: 0 10px; box-sizing: border-box; /* π */
|
|
160
|
+
font-family: inherit; font-size: 13.5px; font-weight: 500; line-height: 1.2; letter-spacing: 0; /* π€ Inter body */
|
|
161
|
+
color: var(--ab-color-muted, #6b5b50); /* ποΈ */
|
|
162
|
+
}
|
|
163
|
+
.abSidebar[data-density='compact'] .abSidebarLink[data-size='sm'] { height: 30px; } /* π¦ packages */
|
|
164
|
+
.abSidebar[data-density='compact'] .abSidebarLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; } /* βοΈ one line */
|
|
165
|
+
.abSidebar[data-density='compact'] .abSidebarIcon { color: var(--ab-color-faint, #807062); } /* π£ */
|
|
166
|
+
.abSidebar[data-density='compact'] .abSidebarLink:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } /* π±οΈ */
|
|
167
|
+
.abSidebar[data-active-shape='rounded'] .abSidebarLink { border-radius: var(--ab-radius-row, 8px); } /* π· */
|
|
168
|
+
.abSidebar[data-active-shape='rounded'] .abSidebarLink[data-active='true'] {
|
|
169
|
+
background: var(--ab-color-tint, #f4e7db); color: var(--ab-color-accent-text, #88603d); font-weight: 650; /* π― */
|
|
170
|
+
}
|
|
171
|
+
.abSidebar[data-active-shape='rounded'] .abSidebarLink[data-active='true'] .abSidebarIcon { color: inherit; } /* π£ filled, accent */
|
|
172
|
+
.abSidebar[data-density='compact'] .abSidebarLink:focus-visible,
|
|
173
|
+
.abSidebar[data-density='compact'] .abSidebarToggle:focus-visible { outline-color: var(--ab-color-accent, #a67c52); outline-offset: -2px; } /* βΏ inside the pane */
|
|
174
|
+
.abSidebar[data-badge='text'] .abSidebarBadge {
|
|
175
|
+
padding: 0; border-radius: 0; background: none; line-height: 1; /* π§Ή no chip */
|
|
176
|
+
font: 500 10.5px var(--ab-font-code, 'Roboto Mono', ui-monospace, monospace); color: var(--ab-color-faint, #807062); /* β¨οΈ */
|
|
177
|
+
}
|
|
178
|
+
/* βΏ James: faint on --tint is 3.9:1, so on the active row the text badge takes the row's --accent-text (β₯ 4.5:1 on tint) */
|
|
179
|
+
.abSidebar[data-badge='text'] .abSidebarLink[data-active='true'] .abSidebarBadge { color: inherit; }
|
|
180
|
+
/* βͺ P9: outlined collapse, 32Γ32, radius 8, 1px --border, --card, --muted */
|
|
181
|
+
.abSidebarToggle[data-variant='outlined'] {
|
|
182
|
+
width: 32px; height: 32px; box-sizing: border-box; flex: none; /* π */
|
|
183
|
+
border: 1px solid var(--ab-color-border, rgb(92 64 48 / 0.13)); border-radius: var(--ab-radius-row, 8px); /* π² */
|
|
184
|
+
background: var(--ab-color-card, #fff); color: var(--ab-color-muted, #6b5b50); /* π¨ */
|
|
185
|
+
}
|
|
186
|
+
.abSidebarToggle[data-variant='outlined']:hover { background: linear-gradient(var(--ab-color-hover, rgb(166 124 82 / 0.08)), var(--ab-color-hover, rgb(166 124 82 / 0.08))), var(--ab-color-card, #fff); } /* π±οΈ */
|
|
187
|
+
.abSidebar[data-density='compact'][data-collapsed='true'] .abSidebarHeader { padding: 12px 0 6px; justify-content: center; } /* πͺ rail */
|
|
188
|
+
.abSidebar[data-density='compact'][data-collapsed='true'] .abSidebarSections { padding-inline: 8px; }
|
|
189
|
+
.abSidebar[data-density='compact'][data-collapsed='true'] .abSidebarLink { width: 40px; height: 40px; } /* π */
|
|
190
|
+
|
|
191
|
+
/* π·οΈ 0.1.15 (God 00:08): the tablet logo row, mock 06 `.sb-logo` = 60px, 0 20px, centred, never shrinks.
|
|
192
|
+
* Height follows core's --ab-header-height (60px at tablet) so it lines up with the main bar. */
|
|
193
|
+
.abSidebarLogo { flex: none; display: flex; align-items: center; box-sizing: border-box; height: var(--ab-header-height, 60px); padding: 0 20px; }
|
|
194
|
+
.abSidebar[data-collapsed='true'] .abSidebarLogo { justify-content: center; padding: 0; } /* πͺ rail: centred */
|
package/ab-sidebar/view.tsx
CHANGED
|
@@ -63,6 +63,7 @@ export interface AbSidebarSection {
|
|
|
63
63
|
id: string; // π
|
|
64
64
|
label?: string; // π·οΈ heading (omit for an unlabelled group)
|
|
65
65
|
items: AbSidebarItem[]; // π
|
|
66
|
+
itemSize?: 'md' | 'sm'; // π 0.1.14 (P8): 'sm' = 30px rows + 16px icons (the Home PACKAGES group)
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
/** π°οΈ Legacy (β€ 0.1.12) link shape; still accepted via `links`. */
|
|
@@ -93,6 +94,13 @@ export interface AbSidebarBaseProps {
|
|
|
93
94
|
header?: ReactNode; // π·οΈ top slot (brand, workspace switcherβ¦)
|
|
94
95
|
labels?: AbSidebarLabels; // π
|
|
95
96
|
locales?: readonly string[]; // π 0.1.13: stripped from the pathname (default: AbLinkProvider's)
|
|
97
|
+
// π 0.1.14 (P8, Home spec Β§4 sidebar)
|
|
98
|
+
density?: 'comfortable' | 'compact'; // π 'compact' = 32px rows, 13.5/500, 18px icons, 11px group labels
|
|
99
|
+
activeShape?: 'pill' | 'rounded'; // π· 'rounded' = 8px-radius --tint row (default 'pill')
|
|
100
|
+
badgeVariant?: 'chip' | 'text'; // π·οΈ 'text' = plain mono 10.5 --faint meta (e.g. a version), no chip
|
|
101
|
+
// π·οΈ 0.1.15 (God 00:08): a 60px logo row above `header` (mock 06 `.sb-logo`). With core β₯ 0.2.1 panes it only shows
|
|
102
|
+
// where the app header is hidden (tabletHeader="main" at 768β1179); elsewhere it always shows
|
|
103
|
+
logo?: ReactNode;
|
|
96
104
|
// π°οΈ legacy API (β€ 0.1.12)
|
|
97
105
|
type?: 'customer' | 'admin';
|
|
98
106
|
page?: string;
|
|
@@ -121,13 +129,14 @@ export function AbSidebarView({ props, Icon, active, toggle }: {
|
|
|
121
129
|
active: (href: string, legacyValue?: string) => boolean;
|
|
122
130
|
toggle?: ReactNode;
|
|
123
131
|
}): ReactElement {
|
|
124
|
-
const { className, id = 'ab-sidebar-list', sections, collapsed = false, header, labels, type = 'customer', links, brandHref = '/', brandLabel = 'abElements' } = props;
|
|
132
|
+
const { className, id = 'ab-sidebar-list', sections, collapsed = false, header, labels, type = 'customer', links, brandHref = '/', brandLabel = 'abElements', density = 'comfortable', activeShape = 'pill', badgeVariant = 'chip' } = props;
|
|
133
|
+
const compact = density === 'compact'; // π P8
|
|
125
134
|
const groups = toAbSidebarSections(sections, links); // ποΈ
|
|
126
135
|
// π°οΈ legacy value lookup (page === link.value)
|
|
127
136
|
const valueOf = (href: string) => links?.find((l) => l.href === href)?.value;
|
|
128
137
|
|
|
129
138
|
// π one item (+ children)
|
|
130
|
-
const renderItem = (item: AbSidebarItem, depth: number): ReactElement => {
|
|
139
|
+
const renderItem = (item: AbSidebarItem, depth: number, small = false): ReactElement => {
|
|
131
140
|
const on = active(item.href, valueOf(item.href)); // π―
|
|
132
141
|
const text = item.labelText ?? (typeof item.label === 'string' ? item.label : undefined); // βΏ plain name
|
|
133
142
|
const link = (
|
|
@@ -137,10 +146,11 @@ export function AbSidebarView({ props, Icon, active, toggle }: {
|
|
|
137
146
|
data-ab-part="item"
|
|
138
147
|
data-active={on ? 'true' : 'false'}
|
|
139
148
|
data-depth={depth}
|
|
149
|
+
data-size={small ? 'sm' : undefined} // π P8
|
|
140
150
|
aria-current={on ? 'page' : undefined} // βΏ
|
|
141
151
|
aria-label={collapsed ? text : undefined} // βΏ rail: the label is visually hidden
|
|
142
152
|
>
|
|
143
|
-
{item.icon && <Icon name={item.icon} variant={on ? 'filled' : 'outlined'} size={20} className={styles.abSidebarIcon} />}
|
|
153
|
+
{item.icon && <Icon name={item.icon} variant={on ? 'filled' : 'outlined'} size={compact ? (small ? 16 : 18) : 20} className={styles.abSidebarIcon} />}
|
|
144
154
|
<span className={styles.abSidebarLabel}>{item.label}</span>
|
|
145
155
|
{item.badge != null && <span className={styles.abSidebarBadge} data-ab-part="badge">{item.badge}</span>}
|
|
146
156
|
</Link>
|
|
@@ -162,8 +172,12 @@ export function AbSidebarView({ props, Icon, active, toggle }: {
|
|
|
162
172
|
data-ab-part={collapsed ? 'rail' : 'sidebar'} // π§©
|
|
163
173
|
data-collapsed={collapsed ? 'true' : 'false'} // πͺ
|
|
164
174
|
className={clsx('AbSidebar', styles.abSidebar, className)} // π·οΈ
|
|
175
|
+
data-density={compact ? 'compact' : undefined} // π P8
|
|
176
|
+
data-active-shape={activeShape === 'rounded' ? 'rounded' : undefined} // π· P8
|
|
177
|
+
data-badge={badgeVariant === 'text' ? 'text' : undefined} // π·οΈ P8
|
|
165
178
|
aria-label={labels?.nav ?? 'Sidebar'} // βΏ
|
|
166
179
|
>
|
|
180
|
+
{props.logo != null && <div className={styles.abSidebarLogo} data-ab-part="sidebar-logo">{props.logo}</div> /* π·οΈ 0.1.15 */}
|
|
167
181
|
{/* π·οΈ header slot, or the legacy brand link */}
|
|
168
182
|
<div className={styles.abSidebarHeader}>
|
|
169
183
|
{header ?? (links?.length && !sections?.length ? <Link href={brandHref} className={styles.abSidebarBrand}>{brandLabel}</Link> : null)}
|
|
@@ -173,7 +187,7 @@ export function AbSidebarView({ props, Icon, active, toggle }: {
|
|
|
173
187
|
{groups.map((g) => (
|
|
174
188
|
<section key={g.id} className={styles.abSidebarSection} data-ab-part="section" aria-labelledby={g.label ? `${id}-${g.id}` : undefined}>
|
|
175
189
|
{g.label && <h2 id={`${id}-${g.id}`} className={styles.abSidebarHeading}>{g.label}</h2>}
|
|
176
|
-
<ul className={styles.abSidebarList}>{g.items.map((it) => renderItem(it, 0))}</ul>
|
|
190
|
+
<ul className={styles.abSidebarList}>{g.items.map((it) => renderItem(it, 0, g.itemSize === 'sm'))}</ul>
|
|
177
191
|
</section>
|
|
178
192
|
))}
|
|
179
193
|
</div>
|
|
@@ -64,6 +64,9 @@ export interface AbThemeToggleLabels {
|
|
|
64
64
|
light: string; // π "Light"
|
|
65
65
|
dark: string; // π "Dark"
|
|
66
66
|
system: string; // π₯οΈ "System"
|
|
67
|
+
// π― 0.1.14 (John): action names for the icon button when it shows the target mode,
|
|
68
|
+
// e.g. { dark: 'Switch to dark theme', light: 'Switch to light theme' }. Falls back to "Theme: Dark"
|
|
69
|
+
switchTo?: Partial<Record<AbThemeMode, string>>;
|
|
67
70
|
}
|
|
68
71
|
|
|
69
72
|
// βοΈ props
|
|
@@ -76,6 +79,10 @@ export interface AbThemeToggleProps {
|
|
|
76
79
|
defaultMode?: AbThemeMode; // π± before hydration (default 'light')
|
|
77
80
|
icons?: Partial<Record<AbThemeMode, ReactNode>>; // πΌοΈ override glyphs
|
|
78
81
|
size?: 'sm' | 'md'; // π sm = 32px, md = 40px segments (hit area β₯ 24px either way)
|
|
82
|
+
appearance?: 'fill' | 'thumb'; // π 0.1.14 (P7): 'thumb' = the Home pill (28px segments, raised card thumb, filled active glyph). Default 'fill'
|
|
83
|
+
// π― 0.1.14 (John): icon variant only. 'target' = glyph + name of the mode a click switches TO
|
|
84
|
+
// (moon in light, sun in dark, like the Home mock). Default 'target' with appearance="thumb", else 'current' (unchanged)
|
|
85
|
+
iconShows?: 'current' | 'target';
|
|
79
86
|
className?: string; // π·οΈ
|
|
80
87
|
style?: CSSProperties; // π¨
|
|
81
88
|
}
|
|
@@ -100,7 +107,8 @@ export function getNextAbThemeMode(modes: readonly AbThemeMode[], current: AbThe
|
|
|
100
107
|
|
|
101
108
|
export function AbThemeToggle(props: AbThemeToggleProps) {
|
|
102
109
|
// π§© props
|
|
103
|
-
const { labels, variant = 'segmented', modes = AB_THEME_MODES, value, onChange, defaultMode = 'light', icons, size = 'md', className, style } = props;
|
|
110
|
+
const { labels, variant = 'segmented', modes = AB_THEME_MODES, value, onChange, defaultMode = 'light', icons, size = 'md', appearance = 'fill', iconShows, className, style } = props;
|
|
111
|
+
const thumb = appearance === 'thumb'; // π P7
|
|
104
112
|
// π engine: persists + applies to <html>
|
|
105
113
|
const engine = useAbThemeMode(defaultMode);
|
|
106
114
|
// ποΈ controlled or engine-driven
|
|
@@ -115,11 +123,15 @@ export function AbThemeToggle(props: AbThemeToggleProps) {
|
|
|
115
123
|
};
|
|
116
124
|
|
|
117
125
|
// πΌοΈ glyph for a mode (decorative: the label names it)
|
|
118
|
-
|
|
126
|
+
// P7 thumb: 17px (segments) / 22px (mobile icon), filled while active (spec Β§2 icons)
|
|
127
|
+
const glyph = (mode: AbThemeMode, active = false) =>
|
|
128
|
+
icons?.[mode] ?? <AbIcon name={DEFAULT_ICON_NAMES[mode]} size={thumb ? (variant === 'icon' ? 22 : 17) : 20} variant={thumb && active ? 'filled' : undefined} />;
|
|
119
129
|
|
|
120
130
|
// π single cycling button variant
|
|
121
131
|
if (variant === 'icon') {
|
|
122
132
|
const next = modes[(Math.max(0, modes.indexOf(current)) + 1) % modes.length]; // βοΈ
|
|
133
|
+
const target = (iconShows ?? (thumb ? 'target' : 'current')) === 'target'; // π― John: Home mock shows the target
|
|
134
|
+
const name = target ? (labels.switchTo?.[next] ?? `${labels.group}: ${labels[next]}`) : `${labels.group}: ${labels[current]}`; // βΏ
|
|
123
135
|
return (
|
|
124
136
|
<button
|
|
125
137
|
type="button" // π§Ύ
|
|
@@ -128,11 +140,13 @@ export function AbThemeToggle(props: AbThemeToggleProps) {
|
|
|
128
140
|
data-ab-part="theme-toggle" // ποΈ
|
|
129
141
|
data-mode={current} // ποΈ
|
|
130
142
|
data-size={size} // π
|
|
131
|
-
|
|
132
|
-
|
|
143
|
+
data-appearance={thumb ? 'thumb' : undefined} // π P7
|
|
144
|
+
data-shows={target ? 'target' : 'current'} // π―
|
|
145
|
+
aria-label={name} // βΏ "Switch to dark theme" (target) / "Theme: Dark" (current)
|
|
146
|
+
title={name} // π¬
|
|
133
147
|
onClick={() => select(next)} // π
|
|
134
148
|
>
|
|
135
|
-
<span aria-hidden="true">{glyph(current)}</span>
|
|
149
|
+
<span aria-hidden="true">{glyph(target ? next : current)}</span>
|
|
136
150
|
</button>
|
|
137
151
|
);
|
|
138
152
|
}
|
|
@@ -157,6 +171,7 @@ export function AbThemeToggle(props: AbThemeToggleProps) {
|
|
|
157
171
|
data-ab-part="theme-toggle" // ποΈ
|
|
158
172
|
data-mode={current} // ποΈ
|
|
159
173
|
data-size={size} // π
|
|
174
|
+
data-appearance={thumb ? 'thumb' : undefined} // π P7
|
|
160
175
|
onKeyDown={onKeyDown} // β¨οΈ
|
|
161
176
|
>
|
|
162
177
|
{modes.map((mode, i) => {
|
|
@@ -176,7 +191,7 @@ export function AbThemeToggle(props: AbThemeToggleProps) {
|
|
|
176
191
|
data-mode={mode} // ποΈ
|
|
177
192
|
onClick={() => select(mode)} // π±οΈ
|
|
178
193
|
>
|
|
179
|
-
<span aria-hidden="true">{glyph(mode)}</span>
|
|
194
|
+
<span aria-hidden="true">{glyph(mode, checked)}</span>
|
|
180
195
|
</button>
|
|
181
196
|
);
|
|
182
197
|
})}
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
gap: 2px; /* π§± */
|
|
43
43
|
padding: 3px; /* π§± */
|
|
44
44
|
border-radius: 9999px; /* π */
|
|
45
|
-
border: 1px solid var(--ab-color-outline-variant, rgb(0 0 0 / 0.12)); /* ποΈ */
|
|
45
|
+
border: 1px solid var(--ab-color-border, var(--ab-color-outline-variant, rgb(0 0 0 / 0.12))); /* ποΈ */
|
|
46
46
|
background: var(--ab-color-surface-container, transparent); /* π¨ */
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -76,14 +76,29 @@
|
|
|
76
76
|
/* π±οΈ hover (unselected only) */
|
|
77
77
|
.segment[aria-checked='false']:hover,
|
|
78
78
|
.icon:hover {
|
|
79
|
-
background: color-mix(in srgb, currentColor 10%, transparent); /* π«οΈ */
|
|
79
|
+
background: var(--ab-color-hover, color-mix(in srgb, currentColor 10%, transparent)); /* π«οΈ */
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
/* βΏ visible focus ring (theme token, G18) */
|
|
83
83
|
.segment:focus-visible,
|
|
84
84
|
.icon:focus-visible {
|
|
85
|
-
outline: 2px solid var(--ab-focus-ring, var(--ab-color-primary, #A67C52)); /* π */
|
|
85
|
+
outline: 2px solid var(--ab-color-accent, var(--ab-focus-ring, var(--ab-color-primary, #A67C52))); /* π */
|
|
86
86
|
outline-offset: 2px; /* βοΈ */
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
/* π§ reduced motion: handled by ab-nextjs-animations (.ab-motion-colors) */
|
|
90
|
+
|
|
91
|
+
/* ===== π 0.1.14 (P7, Home spec Β§4): appearance="thumb" ===== */
|
|
92
|
+
.group[data-appearance='thumb'] {
|
|
93
|
+
gap: 2px; padding: 3px; border-radius: var(--ab-radius-pill, 999px); /* π */
|
|
94
|
+
border: 1px solid var(--ab-color-border, rgb(92 64 48 / 0.13)); background: var(--ab-color-card2, #fbf3ec); /* π¨ */
|
|
95
|
+
}
|
|
96
|
+
.group[data-appearance='thumb'] .segment { width: 28px; height: 28px; color: var(--ab-color-faint, #807062); } /* π β₯ 24px target */
|
|
97
|
+
.group[data-appearance='thumb'] .segment[aria-checked='true'] {
|
|
98
|
+
background: var(--ab-color-thumb, #fff); color: var(--ab-color-accent-text, #88603d); /* π dark thumb #3a2b1f (theme) */
|
|
99
|
+
box-shadow: var(--ab-shadow-thumb, 0 1px 3px rgb(33 26 22 / 0.12)); /* β¨ */
|
|
100
|
+
}
|
|
101
|
+
.group[data-appearance='thumb'] .segment[aria-checked='false']:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } /* π±οΈ */
|
|
102
|
+
.group[data-appearance='thumb'] .segment:focus-visible, .icon[data-appearance='thumb']:focus-visible { outline-color: var(--ab-color-accent, #a67c52); } /* βΏ */
|
|
103
|
+
.icon[data-appearance='thumb'] { width: 40px; height: 40px; border-radius: var(--ab-radius-button, 10px); color: var(--ab-color-muted, #6b5b50); } /* π± mobile 40Γ40, 22px glyph */
|
|
104
|
+
.icon[data-appearance='thumb']:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); }
|
package/ab-toc/index.tsx
CHANGED
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
47
|
// βοΈ React
|
|
48
|
-
import type { ReactElement } from 'react';
|
|
48
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
49
49
|
// π§΅ classes
|
|
50
50
|
import clsx from 'clsx';
|
|
51
51
|
// π¨ styles
|
|
@@ -84,6 +84,7 @@ export interface AbTocProps {
|
|
|
84
84
|
onNavigate?: (id: string) => void; // π e.g. scrollToAbSection(id, { container }) (hooks 0.1.7); without it a plain #id jump, which scrolls the nearest scroller (the main pane in core 0.1.6 panes)
|
|
85
85
|
id?: string; // π root id (default "ab-toc"); the title gets `${id}-title`
|
|
86
86
|
className?: string; // π·οΈ
|
|
87
|
+
footer?: ReactNode; // π§© 0.1.14 (P14): below the list after a 1px rule (Edit this page Β· Changelog Β· a promo card); links get the 12.5px Home style
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
/**
|
|
@@ -91,7 +92,7 @@ export interface AbTocProps {
|
|
|
91
92
|
* aria-current="location". Pair with `useAbScrollSpy` from ab-nextjs-hooks 0.1.7 for `activeId`.
|
|
92
93
|
* No hooks here, so it also renders on the server.
|
|
93
94
|
*/
|
|
94
|
-
const AbToc = ({ items, activeId, label, title = label ?? 'On this page', onNavigate, id = 'ab-toc', className }: AbTocProps): ReactElement | null => {
|
|
95
|
+
const AbToc = ({ items, activeId, label, title = label ?? 'On this page', onNavigate, id = 'ab-toc', className, footer }: AbTocProps): ReactElement | null => {
|
|
95
96
|
if (!items.length) return null; // π nothing to list
|
|
96
97
|
const headingId = `${id}-title`; // π
|
|
97
98
|
return (
|
|
@@ -115,6 +116,12 @@ const AbToc = ({ items, activeId, label, title = label ?? 'On this page', onNavi
|
|
|
115
116
|
);
|
|
116
117
|
})}
|
|
117
118
|
</ol>
|
|
119
|
+
{footer != null && (
|
|
120
|
+
<>
|
|
121
|
+
<hr className={styles.abTocSep} />{/* β mock .toc-sep */}
|
|
122
|
+
<div className={styles.abTocFooter} data-ab-part="toc-footer">{footer}</div>
|
|
123
|
+
</>
|
|
124
|
+
)}
|
|
118
125
|
</nav>
|
|
119
126
|
);
|
|
120
127
|
};
|
package/ab-toc/styles.module.css
CHANGED
|
@@ -36,19 +36,31 @@
|
|
|
36
36
|
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
|
-
.
|
|
40
|
-
.
|
|
41
|
-
.
|
|
39
|
+
/* π 0.1.14 (P14 + token move): the Home TOC (spec Β§4), on the theme 0.3.5 tokens, M3 fallbacks kept */
|
|
40
|
+
.abToc { font-size: 13px; } /* π */
|
|
41
|
+
.abTocTitle { margin: 0 0 10px; font-size: 11px; font-weight: 700; line-height: 15px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ab-color-faint, var(--ab-color-on-surface-variant, inherit)); } /* π·οΈ "ON THIS PAGE" */
|
|
42
|
+
.abTocList { list-style: none; margin: 0; padding: 0; border-inline-start: 1px solid var(--ab-color-div, rgb(0 0 0 / 0.12)); } /* β rail */
|
|
42
43
|
.abTocList > li[data-level='3'] { padding-inline-start: 12px; } /* π */
|
|
43
44
|
.abTocList > li[data-level='4'] { padding-inline-start: 24px; } /* π */
|
|
44
45
|
.abTocLink {
|
|
45
46
|
display: block; /* π */
|
|
46
47
|
margin-inline-start: -1px; /* β sit on the rail */
|
|
47
|
-
padding:
|
|
48
|
+
padding: 6px 0 6px 14px; /* π¦ mock */
|
|
49
|
+
line-height: 18px; /* π 30px rows (WebKit-measured against the mock) */
|
|
48
50
|
border-inline-start: 2px solid transparent; /* β */
|
|
49
|
-
color: var(--ab-color-on-surface-variant, inherit); /* ποΈ */
|
|
51
|
+
color: var(--ab-color-muted, var(--ab-color-on-surface-variant, inherit)); /* ποΈ */
|
|
50
52
|
text-decoration: none; /* π« */
|
|
51
53
|
}
|
|
52
|
-
.abTocLink:hover { color: var(--ab-color-on-surface, inherit); } /* π±οΈ */
|
|
53
|
-
.abTocLink[data-active='true'] { border-inline-start-color: var(--ab-color-primary, currentColor); color: var(--ab-color-primary, inherit); font-weight:
|
|
54
|
-
.abTocLink:focus-visible { outline: var(--ab-
|
|
54
|
+
.abTocLink:hover { color: var(--ab-color-text, var(--ab-color-on-surface, inherit)); } /* π±οΈ */
|
|
55
|
+
.abTocLink[data-active='true'] { border-inline-start-color: var(--ab-color-accent, var(--ab-color-primary, currentColor)); color: var(--ab-color-accent-text, var(--ab-color-primary, inherit)); font-weight: 650; } /* π― */
|
|
56
|
+
.abTocLink:focus-visible { outline: 2px solid var(--ab-color-accent, var(--ab-color-primary, #8f4c38)); outline-offset: -2px; } /* βΏ */
|
|
57
|
+
/* π§© P14 footer */
|
|
58
|
+
.abTocSep { height: 1px; margin: 18px 0 12px; border: 0; background: var(--ab-color-div, rgb(0 0 0 / 0.12)); } /* β */
|
|
59
|
+
.abTocFooter > a, .abTocFooter > p > a, .abTocFooter > ul > li > a {
|
|
60
|
+
display: flex; align-items: center; gap: 8px; padding: 5px 0; /* π */
|
|
61
|
+
font-size: 12.5px; line-height: 17px; color: var(--ab-color-muted, inherit); text-decoration: none; /* π€ 27px rows */
|
|
62
|
+
}
|
|
63
|
+
.abTocFooter a:hover { color: var(--ab-color-accent-text, inherit); } /* π±οΈ */
|
|
64
|
+
.abTocFooter a:focus-visible { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: 2px; border-radius: 4px; } /* βΏ */
|
|
65
|
+
.abTocFooter a svg { flex: none; width: 15px; height: 15px; color: var(--ab-color-faint, inherit); } /* π£ GitHub Β· north_east */
|
|
66
|
+
.abTocFooter > ul { list-style: none; margin: 0; padding: 0; }
|