ab-nextjs-components 0.1.12 โ 0.1.14
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 +64 -0
- package/README.md +52 -0
- package/ab-app-bar/index.tsx +210 -0
- package/ab-app-bar/styles.module.css +158 -0
- package/ab-avatar/index.tsx +2 -1
- package/ab-avatar/styles.module.css +32 -0
- package/ab-balloon/index.tsx +134 -23
- package/ab-balloon/styles.module.css +84 -7
- package/ab-bottom-drawer/index.tsx +71 -0
- package/ab-bottom-drawer/styles.module.css +66 -0
- package/ab-brand/index.tsx +1 -1
- 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 +23 -4
- package/ab-button/styles.module.css +70 -0
- package/ab-card/index.tsx +89 -0
- package/ab-card/styles.module.css +68 -0
- 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-collapsible/index.tsx +1 -1
- package/ab-color/index.tsx +1 -0
- package/ab-color/styles.module.css +32 -0
- package/ab-confirm-drawer/index.tsx +97 -0
- package/ab-confirm-drawer/styles.module.css +41 -0
- package/ab-demo-box/index.tsx +1 -0
- package/ab-demo-box/styles.module.css +32 -0
- package/ab-demo-code/index.tsx +1 -0
- package/ab-demo-code/styles.module.css +32 -0
- package/ab-drawer/index.tsx +307 -0
- package/ab-drawer/styles.module.css +127 -0
- package/ab-drawer/use-ab-drawer.ts +89 -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 +19 -1
- package/ab-icon/helpers.ts +37 -0
- package/ab-icon/index.tsx +14 -8
- package/ab-icon/registrar.tsx +68 -0
- package/ab-icon-button/index.tsx +19 -3
- package/ab-icon-button/styles.module.css +1 -1
- package/ab-image/index.tsx +1 -0
- package/ab-image/styles.module.css +32 -0
- package/ab-info/index.tsx +2 -1
- package/ab-info/styles.module.css +32 -0
- package/ab-input/index.tsx +1 -0
- package/ab-input/styles.module.css +1 -0
- package/ab-install-snippet/index.tsx +51 -29
- package/ab-install-snippet/styles.module.css +50 -4
- package/ab-kbd/index.tsx +65 -0
- package/ab-kbd/styles.module.css +55 -0
- package/ab-key-feature/index.tsx +2 -1
- package/ab-key-feature/styles.module.css +32 -0
- package/ab-like-button/index.tsx +1 -1
- package/ab-link/index.tsx +112 -0
- package/ab-link/locale.ts +53 -0
- package/ab-list/index.tsx +107 -0
- package/ab-list/styles.module.css +82 -0
- package/ab-locale-switcher/index.tsx +59 -10
- package/ab-locale-switcher/styles.module.css +15 -4
- package/ab-main-headline/index.tsx +1 -0
- package/ab-main-headline/styles.module.css +32 -0
- package/ab-menu/index.tsx +6 -5
- package/ab-menu/styles.module.css +32 -0
- package/ab-name/index.tsx +1 -0
- package/ab-name/styles.module.css +32 -0
- package/ab-navbar/index.tsx +54 -46
- package/ab-navbar/styles.module.css +102 -28
- package/ab-navbar/view.tsx +166 -0
- package/ab-package-card/index.tsx +141 -0
- package/ab-package-card/styles.module.css +81 -0
- package/ab-page-paginator/index.tsx +1 -0
- package/ab-page-paginator/styles.module.css +32 -0
- package/ab-page-switcher/index.tsx +1 -0
- package/ab-page-switcher/styles.module.css +32 -0
- package/ab-preview/index.tsx +1 -0
- package/ab-preview/styles.module.css +32 -0
- package/ab-price/index.tsx +1 -0
- package/ab-price/styles.module.css +32 -0
- package/ab-price-tag/index.tsx +1 -0
- package/ab-price-tag/styles.module.css +32 -0
- package/ab-product/index.tsx +1 -0
- package/ab-product/styles.module.css +32 -0
- package/ab-product-item/index.tsx +1 -0
- package/ab-product-item/styles.module.css +32 -0
- package/ab-search-result/index.tsx +1 -0
- package/ab-search-result/styles.module.css +32 -0
- package/ab-search-trigger/index.tsx +157 -0
- package/ab-search-trigger/styles.module.css +96 -0
- package/ab-sidebar/index.tsx +91 -49
- package/ab-sidebar/styles.module.css +179 -31
- package/ab-sidebar/view.tsx +192 -0
- package/ab-switch-back/index.tsx +2 -1
- package/ab-switch-back/styles.module.css +32 -0
- package/ab-tab/index.tsx +2 -1
- package/ab-tab/styles.module.css +32 -0
- package/ab-tabs/index.tsx +1 -0
- package/ab-tabs/styles.module.css +32 -0
- package/ab-test-hello/index.tsx +1 -0
- package/ab-test-hello/styles.module.css +32 -0
- package/ab-text/index.tsx +1 -0
- package/ab-text/styles.module.css +32 -0
- package/ab-theme-toggle/index.tsx +21 -6
- package/ab-theme-toggle/styles.module.css +18 -3
- package/ab-toc/index.tsx +131 -0
- package/ab-toc/styles.module.css +66 -0
- package/ab-version-switcher/index.tsx +143 -0
- package/ab-version-switcher/styles.module.css +76 -0
- package/css/chrome-mq.css +32 -0
- package/css/doodle.css +32 -0
- package/css/logo.css +32 -0
- package/css/spinner.css +32 -0
- package/css/toast.css +32 -0
- package/index.ts +45 -0
- package/package.json +42 -10
- package/server/ab-avatar/index.tsx +2 -1
- package/server/ab-avatar/styles.module.css +32 -0
- package/server/ab-badge/index.tsx +1 -0
- package/server/ab-badge/styles.module.css +32 -0
- package/server/ab-brand/index.tsx +1 -1
- package/server/ab-button/index.tsx +6 -2
- package/server/ab-button/styles.module.css +39 -0
- package/server/ab-icon/index.tsx +13 -8
- package/server/ab-key-feature/index.tsx +2 -1
- package/server/ab-key-feature/styles.module.css +32 -0
- package/server/ab-name/index.tsx +1 -0
- package/server/ab-name/styles.module.css +32 -0
- package/server/ab-nav-link/index.tsx +2 -1
- package/server/ab-nav-link/styles.module.css +32 -0
- package/server/ab-navbar/index.tsx +44 -45
- package/server/ab-polygon/index.tsx +1 -0
- package/server/ab-polygon/styles.module.css +32 -0
- package/server/ab-sidebar/index.tsx +44 -49
- package/server/ab-switch-back/index.tsx +2 -1
- package/server/ab-switch-back/styles.module.css +32 -0
- package/server/ab-test-hello/index.tsx +1 -0
- package/server/ab-test-hello/styles.module.css +32 -0
- package/server/ab-text/index.tsx +1 -0
- package/server/ab-text/styles.module.css +32 -0
- package/server/index.ts +1 -0
- package/styles.css +32 -0
- package/types/index.d.ts +54 -0
- package/server/ab-navbar/styles.module.css +0 -35
- package/server/ab-sidebar/styles.module.css +0 -41
|
@@ -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
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
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: AbToc (G46)
|
|
28
|
+
* @file: ab-toc/index.tsx
|
|
29
|
+
* @type: React Component (server-safe)
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*
|
|
32
|
+
* Example usage:
|
|
33
|
+
* // ๐ core 0.1.6 panes: the page never scrolls, the main pane does (G55), so spy on and scroll IT
|
|
34
|
+
* const { mainScrollElement } = useAbPage(); // โ
state from core, safe in render
|
|
35
|
+
* // without core: resolve the DOM node in an EFFECT, never during render (SSR + hydration safe)
|
|
36
|
+
* // const [main, setMain] = useState<HTMLElement | null>(null); useEffect(() => setMain(getAbMainScroller()), []);
|
|
37
|
+
* const activeId = useAbScrollSpy(items.map((i) => i.id), { root: mainScrollElement });
|
|
38
|
+
* <AbToc items={items} activeId={activeId} onNavigate={(id) => scrollToAbSection(id, { container: mainScrollElement })} />
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/*
|
|
42
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
43
|
+
* MOTTO: We'll always do more ๐!!!
|
|
44
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
// โ๏ธ React
|
|
48
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
49
|
+
// ๐งต classes
|
|
50
|
+
import clsx from 'clsx';
|
|
51
|
+
// ๐จ styles
|
|
52
|
+
import styles from './styles.module.css';
|
|
53
|
+
|
|
54
|
+
/** ๐ 0.1.13 (D35/G55): core 0.1.6 marks the panes main scroller with this attribute (components doesn't depend on core). */
|
|
55
|
+
export const AB_MAIN_SCROLLER_SELECTOR = '[data-ab-part="main-content"]';
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* ๐ getAbMainScroller โ the element that scrolls the page content: the core panes main pane when present,
|
|
59
|
+
* else `null` (= the window). Pass `from` (e.g. the heading) to pick the pane that contains it.
|
|
60
|
+
* Use it as `useAbScrollSpy({ root })` / `scrollToAbSection(id, { container })`.
|
|
61
|
+
*
|
|
62
|
+
* โ ๏ธ Call it only in an effect or an event handler, **never during render**: it reads the DOM, so a render
|
|
63
|
+
* call returns `null` on the server and the element on the client (hydration mismatch). (James nit)
|
|
64
|
+
*/
|
|
65
|
+
export function getAbMainScroller(from?: Element | null): HTMLElement | null {
|
|
66
|
+
if (typeof document === 'undefined') return null; // ๐ฅ๏ธ SSR
|
|
67
|
+
const own = from?.closest<HTMLElement>(AB_MAIN_SCROLLER_SELECTOR); // ๐ฏ the pane holding `from`
|
|
68
|
+
return own ?? document.querySelector<HTMLElement>(AB_MAIN_SCROLLER_SELECTOR); // ๐ first main pane, or null
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** ๐ one heading */
|
|
72
|
+
export interface AbTocItem {
|
|
73
|
+
id: string; // ๐ the heading id (link target)
|
|
74
|
+
label: string; // ๐ท๏ธ
|
|
75
|
+
level?: 2 | 3 | 4; // ๐ indent (default 2)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** โ๏ธ props */
|
|
79
|
+
export interface AbTocProps {
|
|
80
|
+
items: AbTocItem[]; // ๐
|
|
81
|
+
activeId?: string | null; // ๐ฏ e.g. from useAbScrollSpy (hooks 0.1.7)
|
|
82
|
+
title?: string; // ๐ท๏ธ default "On this page"
|
|
83
|
+
label?: string; // ๐ท๏ธ 0.1.13 (Joseph #16): alias of `title`; `title` wins when both are set
|
|
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
|
+
id?: string; // ๐ root id (default "ab-toc"); the title gets `${id}-title`
|
|
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
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* ๐ AbToc (G46): "On this page" list of plain `#id` links (works without JS), the current one marked with
|
|
92
|
+
* aria-current="location". Pair with `useAbScrollSpy` from ab-nextjs-hooks 0.1.7 for `activeId`.
|
|
93
|
+
* No hooks here, so it also renders on the server.
|
|
94
|
+
*/
|
|
95
|
+
const AbToc = ({ items, activeId, label, title = label ?? 'On this page', onNavigate, id = 'ab-toc', className, footer }: AbTocProps): ReactElement | null => {
|
|
96
|
+
if (!items.length) return null; // ๐ nothing to list
|
|
97
|
+
const headingId = `${id}-title`; // ๐
|
|
98
|
+
return (
|
|
99
|
+
<nav id={id} className={clsx('AbToc', styles.abToc, className)} data-ab-part="toc" aria-labelledby={headingId}>
|
|
100
|
+
<p id={headingId} className={styles.abTocTitle}>{title}</p>
|
|
101
|
+
<ol className={styles.abTocList}>
|
|
102
|
+
{items.map((it) => {
|
|
103
|
+
const on = it.id === activeId; // ๐ฏ
|
|
104
|
+
return (
|
|
105
|
+
<li key={it.id} data-level={it.level ?? 2}>
|
|
106
|
+
<a
|
|
107
|
+
href={`#${it.id}`} // ๐ JS-off friendly
|
|
108
|
+
className={styles.abTocLink}
|
|
109
|
+
data-active={on ? 'true' : 'false'}
|
|
110
|
+
aria-current={on ? 'location' : undefined} // โฟ
|
|
111
|
+
onClick={onNavigate ? (e) => { e.preventDefault(); onNavigate(it.id); } : undefined}
|
|
112
|
+
>
|
|
113
|
+
{it.label}
|
|
114
|
+
</a>
|
|
115
|
+
</li>
|
|
116
|
+
);
|
|
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
|
+
)}
|
|
125
|
+
</nav>
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// ๐ฆ exports
|
|
130
|
+
export default AbToc;
|
|
131
|
+
export { AbToc };
|
|
@@ -0,0 +1,66 @@
|
|
|
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: AbToc - Styles (G46)
|
|
28
|
+
* @file: ab-toc/styles.module.css
|
|
29
|
+
* @type: CSS Module
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
35
|
+
* MOTTO: We'll always do more ๐!!!
|
|
36
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/* ๐ 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 */
|
|
43
|
+
.abTocList > li[data-level='3'] { padding-inline-start: 12px; } /* ๐ */
|
|
44
|
+
.abTocList > li[data-level='4'] { padding-inline-start: 24px; } /* ๐ */
|
|
45
|
+
.abTocLink {
|
|
46
|
+
display: block; /* ๐ */
|
|
47
|
+
margin-inline-start: -1px; /* โ sit on the rail */
|
|
48
|
+
padding: 6px 0 6px 14px; /* ๐ฆ mock */
|
|
49
|
+
line-height: 18px; /* ๐ 30px rows (WebKit-measured against the mock) */
|
|
50
|
+
border-inline-start: 2px solid transparent; /* โ */
|
|
51
|
+
color: var(--ab-color-muted, var(--ab-color-on-surface-variant, inherit)); /* ๐๏ธ */
|
|
52
|
+
text-decoration: none; /* ๐ซ */
|
|
53
|
+
}
|
|
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; }
|
|
@@ -0,0 +1,143 @@
|
|
|
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: AbVersionSwitcher (P9)
|
|
28
|
+
* @file: ab-version-switcher/index.tsx
|
|
29
|
+
* @type: Client component
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*
|
|
32
|
+
* Example usage:
|
|
33
|
+
* 1+|> <AbVersionSwitcher label="Docs" version="v0.2.x" versions={[{ value: "v0.2.x", href: "/docs" }, { value: "v0.1.x", href: "/v0.1/docs" }]} />
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/*
|
|
37
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
38
|
+
* MOTTO: We'll always do more ๐!!!
|
|
39
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
'use client';
|
|
44
|
+
|
|
45
|
+
// โ๏ธ React
|
|
46
|
+
import { useEffect, useId, useRef, useState, type ReactElement } from 'react';
|
|
47
|
+
// ๐งต classes
|
|
48
|
+
import clsx from 'clsx';
|
|
49
|
+
// ๐ฃ icons
|
|
50
|
+
import AbIcon from '../ab-icon';
|
|
51
|
+
// ๐ the menu it opens (spec ยง5: "opens AbMenu")
|
|
52
|
+
import AbMenu from '../ab-menu';
|
|
53
|
+
// ๐จ styles
|
|
54
|
+
import styles from './styles.module.css';
|
|
55
|
+
|
|
56
|
+
/** ๐ท๏ธ one version */
|
|
57
|
+
export interface AbVersionOption {
|
|
58
|
+
value: string; // ๐ e.g. 'v0.2.x'
|
|
59
|
+
label?: string; // ๐ท๏ธ menu text (default: value)
|
|
60
|
+
href?: string; // ๐ real navigation (works without JS via the <details> fallback)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** โ๏ธ props */
|
|
64
|
+
export interface AbVersionSwitcherProps {
|
|
65
|
+
label?: string; // ๐ท๏ธ default "Docs"
|
|
66
|
+
version: string; // โ
current version (shown bold), e.g. 'v0.2.x'
|
|
67
|
+
versions?: readonly AbVersionOption[]; // ๐ the choices (none / one = a static label, no menu)
|
|
68
|
+
onSelect?: (value: string) => void; // ๐ฃ button items
|
|
69
|
+
menuLabel?: string; // โฟ accessible name of the trigger (default "{label} {version}": contains the visible text, WCAG 2.5.3)
|
|
70
|
+
className?: string; // ๐ท๏ธ
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* ๐ท๏ธ AbVersionSwitcher (P9): the sidebar's "Docs **v0.2.x** โพ" control. 28px, 8px radius, hairline border,
|
|
75
|
+
* card background, 16px `expand_more`; opens an AbMenu below it (Escape / outside click close, focus returns).
|
|
76
|
+
* JS off: with `href`s it's a native `<details>` list of links.
|
|
77
|
+
*/
|
|
78
|
+
const AbVersionSwitcher = ({ label = 'Docs', version, versions = [], onSelect, menuLabel, className }: AbVersionSwitcherProps): ReactElement => {
|
|
79
|
+
const [open, setOpen] = useState(false); // ๐ช
|
|
80
|
+
const menuId = `ab-version-menu-${useId().replace(/:/g, '')}`; // ๐
|
|
81
|
+
const wrap = useRef<HTMLDivElement>(null); // ๐
|
|
82
|
+
const btn = useRef<HTMLButtonElement>(null); // ๐
|
|
83
|
+
const name = menuLabel ?? `${label} ${version}`; // โฟ WCAG 2.5.3 label-in-name (James)
|
|
84
|
+
const hasMenu = versions.length > 1; // ๐
|
|
85
|
+
|
|
86
|
+
// โ Escape + outside click close it
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (!open) return;
|
|
89
|
+
const onKey = (e: KeyboardEvent) => { if (e.key === 'Escape') { setOpen(false); btn.current?.focus(); } }; // โ + โฉ๏ธ
|
|
90
|
+
const onDown = (e: PointerEvent) => { if (!wrap.current?.contains(e.target as Node)) setOpen(false); }; // ๐
|
|
91
|
+
document.addEventListener('keydown', onKey);
|
|
92
|
+
document.addEventListener('pointerdown', onDown);
|
|
93
|
+
return () => { document.removeEventListener('keydown', onKey); document.removeEventListener('pointerdown', onDown); };
|
|
94
|
+
}, [open]);
|
|
95
|
+
|
|
96
|
+
// ๐งฑ the visible face (same for button, static label and no-JS summary)
|
|
97
|
+
const face = (
|
|
98
|
+
<>
|
|
99
|
+
<span>{label}</span> <b className={styles.abVersionValue}>{version}</b>
|
|
100
|
+
{hasMenu && <AbIcon name="expand_more" size={16} className={styles.abVersionIcon} />}
|
|
101
|
+
</>
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
if (!hasMenu) return <span className={clsx('AbVersionSwitcher', styles.abVersion, className)} data-ab-part="version-switcher">{face}</span>; // ๐ท๏ธ static
|
|
105
|
+
|
|
106
|
+
const linksOnly = versions.every((v) => v.href); // ๐ can it work without JS?
|
|
107
|
+
return (
|
|
108
|
+
<div ref={wrap} className={clsx('AbVersionSwitcher', styles.abVersionRoot, className)} data-ab-part="version-switcher">
|
|
109
|
+
<button
|
|
110
|
+
ref={btn}
|
|
111
|
+
type="button"
|
|
112
|
+
className={clsx(styles.abVersion, linksOnly && styles.abVersionJs)}
|
|
113
|
+
aria-label={name}
|
|
114
|
+
aria-haspopup="menu"
|
|
115
|
+
aria-expanded={open}
|
|
116
|
+
aria-controls={menuId}
|
|
117
|
+
onClick={() => setOpen((o) => !o)}
|
|
118
|
+
>
|
|
119
|
+
{face}
|
|
120
|
+
</button>
|
|
121
|
+
<AbMenu
|
|
122
|
+
id={menuId}
|
|
123
|
+
hidden={!open}
|
|
124
|
+
isActive={open}
|
|
125
|
+
className={styles.abVersionMenu}
|
|
126
|
+
items={versions.map((v) => ({ id: v.value, label: v.label ?? v.value, href: v.href, selected: v.value === version, onClick: () => { onSelect?.(v.value); setOpen(false); } }))}
|
|
127
|
+
/>
|
|
128
|
+
{/* ๐ซ JS off: a native <details> of links (CSS shows it only under scripting: none) */}
|
|
129
|
+
{linksOnly && (
|
|
130
|
+
<details className={styles.abVersionNoJs} data-ab-part="version-switcher-nojs">
|
|
131
|
+
<summary className={styles.abVersion} aria-label={name}>{face}</summary>
|
|
132
|
+
<ul className={styles.abVersionNoJsList}>
|
|
133
|
+
{versions.map((v) => <li key={v.value}><a href={v.href} aria-current={v.value === version ? 'page' : undefined}>{v.label ?? v.value}</a></li>)}
|
|
134
|
+
</ul>
|
|
135
|
+
</details>
|
|
136
|
+
)}
|
|
137
|
+
</div>
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// ๐ฆ exports
|
|
142
|
+
export default AbVersionSwitcher;
|
|
143
|
+
export { AbVersionSwitcher };
|
|
@@ -0,0 +1,76 @@
|
|
|
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: AbVersionSwitcher styles
|
|
28
|
+
* @file: ab-version-switcher/styles.module.css
|
|
29
|
+
* @type: CSS module
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
35
|
+
* MOTTO: We'll always do more ๐!!!
|
|
36
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
/* ๐๏ธ knobs (defaults = the approved mock, mapped onto today's theme tokens) */
|
|
41
|
+
.abVersion, .abVersionRoot {
|
|
42
|
+
--ab-version-height: 28px; /* ๐ */
|
|
43
|
+
--ab-version-radius: 8px; /* โญ */
|
|
44
|
+
--ab-version-background: var(--ab-color-card, var(--md-sys-color-surface-container-lowest, #fff)); /* ๐จ --card */
|
|
45
|
+
--ab-version-border: var(--ab-color-border, var(--ab-color-outline-variant, rgb(92 64 48 / 0.13))); /* โ --border */
|
|
46
|
+
--ab-version-color: var(--ab-color-muted, var(--ab-color-on-surface-variant, #6b5b50)); /* ๐๏ธ --muted */
|
|
47
|
+
--ab-version-strong: var(--ab-color-text, var(--ab-color-on-surface, #211a16)); /* ๐๏ธ --text */
|
|
48
|
+
--ab-version-hover: var(--ab-color-hover, color-mix(in srgb, var(--ab-color-bronze, #a67c52) 8%, transparent)); /* ๐ฑ๏ธ --hover */
|
|
49
|
+
--ab-version-ring: var(--ab-color-accent, var(--ab-color-bronze, #a67c52)); /* โฟ --accent */
|
|
50
|
+
}
|
|
51
|
+
.abVersionRoot { position: relative; display: inline-block; } /* ๐ menu anchor */
|
|
52
|
+
.abVersion {
|
|
53
|
+
display: inline-flex; align-items: center; gap: 4px; /* ๐ */
|
|
54
|
+
box-sizing: border-box; height: var(--ab-version-height); padding: 0 6px 0 10px; /* ๐ฆ */
|
|
55
|
+
border: 1px solid var(--ab-version-border); border-radius: var(--ab-version-radius); /* โ */
|
|
56
|
+
background: var(--ab-version-background); color: var(--ab-version-color); /* ๐จ */
|
|
57
|
+
font: inherit; font-size: 12px; line-height: 1; white-space: nowrap; /* ๐ค */
|
|
58
|
+
cursor: pointer; list-style: none; /* ๐ฑ๏ธ (summary: no marker) */
|
|
59
|
+
}
|
|
60
|
+
.abVersion::-webkit-details-marker { display: none; } /* ๐งน */
|
|
61
|
+
span.abVersion { cursor: default; } /* ๐ท๏ธ static */
|
|
62
|
+
.abVersion:hover { background: linear-gradient(var(--ab-version-hover), var(--ab-version-hover)), var(--ab-version-background); } /* ๐ฑ๏ธ */
|
|
63
|
+
.abVersion:focus-visible { outline: 2px solid var(--ab-version-ring); outline-offset: 2px; } /* โฟ */
|
|
64
|
+
.abVersionValue { color: var(--ab-version-strong); font-weight: 650; } /* ๐ช */
|
|
65
|
+
.abVersionIcon { width: 16px; height: 16px; } /* โพ */
|
|
66
|
+
.abVersionMenu[hidden] { display: none; } /* ๐ AbMenu's own display would beat [hidden] */
|
|
67
|
+
.abVersionMenu { position: absolute; inset-block-start: calc(100% + 4px); inset-inline-start: 0; z-index: 20; min-width: 160px; } /* ๐ */
|
|
68
|
+
|
|
69
|
+
/* ๐ซ no-JS: the details list replaces the button */
|
|
70
|
+
.abVersionNoJs { display: none; }
|
|
71
|
+
.abVersionNoJsList { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--ab-version-border); border-radius: 8px; background: var(--ab-version-background); font-size: 13px; }
|
|
72
|
+
.abVersionNoJsList a { display: block; padding: 6px 8px; color: inherit; text-decoration: none; }
|
|
73
|
+
@media (scripting: none) {
|
|
74
|
+
.abVersionJs, .abVersionMenu { display: none; }
|
|
75
|
+
.abVersionNoJs { display: block; }
|
|
76
|
+
}
|
package/css/chrome-mq.css
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
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: chrome-mq.css
|
|
28
|
+
* @file: css/chrome-mq.css
|
|
29
|
+
* @type: CSS Stylesheet
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*/
|
|
32
|
+
|
|
1
33
|
/*
|
|
2
34
|
* ab-nextjs-components โ chrome styles moved out of ab-nextjs-theme
|
|
3
35
|
* Copyright (c) 2026 Abraham Ukachi. MIT.
|
package/css/doodle.css
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
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: doodle.css
|
|
28
|
+
* @file: css/doodle.css
|
|
29
|
+
* @type: CSS Stylesheet
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*/
|
|
32
|
+
|
|
1
33
|
/*
|
|
2
34
|
* ab-nextjs-components โ chrome styles moved out of ab-nextjs-theme
|
|
3
35
|
* Copyright (c) 2026 Abraham Ukachi. MIT.
|
package/css/logo.css
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
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: logo.css
|
|
28
|
+
* @file: css/logo.css
|
|
29
|
+
* @type: CSS Stylesheet
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*/
|
|
32
|
+
|
|
1
33
|
/*
|
|
2
34
|
* ab-nextjs-components โ chrome styles moved out of ab-nextjs-theme
|
|
3
35
|
* Copyright (c) 2026 Abraham Ukachi. MIT.
|