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,129 @@
|
|
|
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: AbTocDrawer
|
|
28
|
+
* @file: ab-toc-drawer/index.tsx
|
|
29
|
+
* @type: Client component
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*
|
|
32
|
+
* Example usage:
|
|
33
|
+
* 1+|> useAbEdgeSwipe({ edge: 'right', onOpen: () => setToc(true), enabled: hasAside && !toc })
|
|
34
|
+
* -|> <AbTocDrawer open={toc} onClose={() => setToc(false)} items={outline} activeId={spy}
|
|
35
|
+
* -|> onNavigate={(id) => scrollToAbSection(id)} links={[{ href: editUrl, label: 'Edit this page', icon: 'github' }]} />
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/*
|
|
39
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
40
|
+
* MOTTO: We'll always do more ๐!!!
|
|
41
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
'use client';
|
|
46
|
+
|
|
47
|
+
// โ๏ธ React
|
|
48
|
+
import type { MouseEvent, ReactElement } from 'react';
|
|
49
|
+
// ๐งต classes
|
|
50
|
+
import clsx from 'clsx';
|
|
51
|
+
// ๐๏ธ the drawer
|
|
52
|
+
import AbDrawer from '../ab-drawer';
|
|
53
|
+
// ๐ฃ icons
|
|
54
|
+
import AbIcon from '../ab-icon';
|
|
55
|
+
// ๐ the app's link
|
|
56
|
+
import Link from '../ab-link';
|
|
57
|
+
// ๐ the outline item type (shared with AbToc)
|
|
58
|
+
import type { AbTocItem } from '../ab-toc';
|
|
59
|
+
// ๐จ the drawers v2 kit
|
|
60
|
+
import kit from '../ab-drawer/kit.module.css';
|
|
61
|
+
|
|
62
|
+
/** ๐ a row under the outline (Edit this page, Changelog) */
|
|
63
|
+
export interface AbTocDrawerLink { href: string; label: string; icon?: string; external?: boolean }
|
|
64
|
+
|
|
65
|
+
/** โ๏ธ props */
|
|
66
|
+
export interface AbTocDrawerProps {
|
|
67
|
+
open: boolean; // ๐ช
|
|
68
|
+
onClose: () => void; // โ scrim, Esc, โ, a left-to-right swipe, or choosing a heading
|
|
69
|
+
items: readonly AbTocItem[]; // ๐ the page outline (level 2 / 3 / 4)
|
|
70
|
+
activeId?: string | null; // ๐ฏ e.g. from useAbScrollSpy (hooks 0.1.7)
|
|
71
|
+
onNavigate?: (id: string) => void; // ๐ scroll there (e.g. scrollToAbSection); without it a plain #id jump. The drawer closes after
|
|
72
|
+
links?: readonly AbTocDrawerLink[]; // ๐ below a divider
|
|
73
|
+
labels?: { title?: string; close?: string }; // ๐ "On this page", "Close outline"
|
|
74
|
+
returnFocus?: string; // โฉ๏ธ after a swipe-open
|
|
75
|
+
id?: string; // ๐
|
|
76
|
+
className?: string; // ๐ท๏ธ
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* โก๏ธ AbTocDrawer โ John's right drawer (drawers v2 ยง3): the page aside ("On this page") on mobile.
|
|
81
|
+
*
|
|
82
|
+
* - ๐งญ Only for routes whose layout has an aside: render it (and enable the right edge swipe) there, nowhere else
|
|
83
|
+
* - ๐ 296px, 16 0 0 16 radius, title Mulish 800 20px; 44px outline rows on a 2px rail, level 3 indented 16px,
|
|
84
|
+
* the active one bronze with `aria-current="location"`; then a divider and the links
|
|
85
|
+
* - ๐ค opens with `useAbEdgeSwipe({ edge: 'right' })` or an "On this page" chip; closes with a left-to-right swipe
|
|
86
|
+
* - ๐ฅ tier 'aside': one level below the left drawer
|
|
87
|
+
*/
|
|
88
|
+
const AbTocDrawer = ({ open, onClose, items, activeId, onNavigate, links = [], labels = {}, returnFocus, id = 'ab-toc-drawer', className }: AbTocDrawerProps): ReactElement => {
|
|
89
|
+
const L = { title: 'On this page', close: 'Close outline', ...labels }; // ๐
|
|
90
|
+
const go = (target: string) => (e: MouseEvent) => {
|
|
91
|
+
if (onNavigate) { e.preventDefault(); onNavigate(target); } // ๐ the app scrolls
|
|
92
|
+
onClose(); // ๐ช then close
|
|
93
|
+
};
|
|
94
|
+
return (
|
|
95
|
+
<AbDrawer
|
|
96
|
+
open={open} onClose={onClose} id={id} side="right" scope="app" tier="aside" swipe size="296px"
|
|
97
|
+
title={L.title} closeLabel={L.close} closeIcon={<AbIcon name="close" size={24} />}
|
|
98
|
+
initialFocus="panel" returnFocus={returnFocus} // ๐ฏ the sheet itself (WebKit drew a focus ring on the active row; Tab then enters)
|
|
99
|
+
className={clsx('AbTocDrawer', kit.sheet, kit.titleSm, className)}
|
|
100
|
+
>
|
|
101
|
+
<nav aria-labelledby={`${id}-title`} data-ab-part="toc-drawer-nav">
|
|
102
|
+
<ol className={kit.toc}>
|
|
103
|
+
{items.map((it) => {
|
|
104
|
+
const on = it.id === activeId; // ๐ฏ
|
|
105
|
+
return (
|
|
106
|
+
<li key={it.id}>
|
|
107
|
+
<a href={`#${it.id}`} className={kit.tocLink} data-level={it.level ?? 2} aria-current={on ? 'location' : undefined} onClick={go(it.id)}>{it.label}</a>
|
|
108
|
+
</li>
|
|
109
|
+
);
|
|
110
|
+
})}
|
|
111
|
+
</ol>
|
|
112
|
+
</nav>
|
|
113
|
+
{links.length > 0 && (
|
|
114
|
+
<>
|
|
115
|
+
<hr className={clsx(kit.hr, kit.tocHr)} />
|
|
116
|
+
{links.map((l) => (
|
|
117
|
+
<Link key={l.href} href={l.href} className={clsx(kit.row, kit.tocRow)} {...(l.external ? { target: '_blank', rel: 'noreferrer' } : {})} onClick={onClose}>
|
|
118
|
+
{l.icon && <AbIcon name={l.icon} size={24} />}<span>{l.label}</span>
|
|
119
|
+
</Link>
|
|
120
|
+
))}
|
|
121
|
+
</>
|
|
122
|
+
)}
|
|
123
|
+
</AbDrawer>
|
|
124
|
+
);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
// ๐ฆ exports
|
|
128
|
+
export default AbTocDrawer;
|
|
129
|
+
export { AbTocDrawer };
|
|
@@ -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 version="v0.2.x" versions={[{ value: "v0.2.x", href: "/" }, { value: "v0.1.x", href: "/v0.1" }]} />
|
|
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; // ๐ท๏ธ text before the version; default none (0.2.0, God 01:27: the app IS the docs, so no "Docs" prefix)
|
|
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 = '', 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 ? `${label} ${version}` : `Version ${version}`); // โฟ WCAG 2.5.3 label-in-name (James); no label โ "Version v0.2.x" (James P2, still contains the visible text)
|
|
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
|
+
{label && <><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/index.ts
CHANGED
|
@@ -130,6 +130,19 @@ const supportedComponents: Array<ComponentCatalogEntry> = [
|
|
|
130
130
|
{ name: 'AbPackageCard', file: 'ab-package-card/index.tsx', kind: 'server', status: 'Done' },
|
|
131
131
|
// ๐ 0.1.13 docs shell (AbToc) โ server-safe, no hooks
|
|
132
132
|
{ name: 'AbToc', file: 'ab-toc/index.tsx', kind: 'server', status: 'Done' },
|
|
133
|
+
// ๐ 0.1.14 (G53): AbDrawer + presets
|
|
134
|
+
{ name: 'AbDrawer', file: 'ab-drawer/index.tsx', kind: 'client', status: 'Done' },
|
|
135
|
+
{ name: 'AbDrawerList', file: 'ab-drawer-list/index.tsx', kind: 'client', status: 'Done' },
|
|
136
|
+
{ name: 'AbConfirmDrawer', file: 'ab-confirm-drawer/index.tsx', kind: 'client', status: 'Done' },
|
|
137
|
+
{ name: 'AbBottomDrawer', file: 'ab-bottom-drawer/index.tsx', kind: 'client', status: 'Done' },
|
|
138
|
+
{ name: 'AbMobileHeader', file: 'ab-mobile-header/index.tsx', kind: 'client', status: 'Done' }, // ๐ 0.2.0 drawers v2
|
|
139
|
+
{ name: 'AbSearchDrawer', file: 'ab-search-drawer/index.tsx', kind: 'client', status: 'Done' }, // ๐ 0.2.0 drawers v2
|
|
140
|
+
{ name: 'AbTocDrawer', file: 'ab-toc-drawer/index.tsx', kind: 'client', status: 'Done' }, // ๐ 0.2.0 drawers v2
|
|
141
|
+
{ name: 'AbNavDrawer', file: 'ab-nav-drawer/index.tsx', kind: 'client', status: 'Done' }, // ๐ 0.2.0 drawers v2
|
|
142
|
+
{ name: 'AbSettingsDrawer', file: 'ab-settings-drawer/index.tsx', kind: 'client', status: 'Done' }, // ๐ 0.2.0 drawers v2
|
|
143
|
+
{ name: 'AbVersionSwitcher', file: 'ab-version-switcher/index.tsx', kind: 'client', status: 'Done' },
|
|
144
|
+
{ name: 'AbBreadcrumbs', file: 'ab-breadcrumbs/index.tsx', kind: 'server', status: 'Done' },
|
|
145
|
+
{ name: 'AbList', file: 'ab-list/index.tsx', kind: 'server', status: 'Done' },
|
|
133
146
|
]
|
|
134
147
|
|
|
135
148
|
const abComponents = { supportedComponents }
|
|
@@ -169,6 +182,43 @@ export { default as AbSidebar } from './ab-sidebar/index.tsx'
|
|
|
169
182
|
// ๐ 0.1.13 (Joseph): AbToc + the panes main-scroller helpers (also at `ab-nextjs-components/ab-toc`)
|
|
170
183
|
export { default as AbToc, getAbMainScroller, AB_MAIN_SCROLLER_SELECTOR } from './ab-toc/index.tsx'
|
|
171
184
|
export type { AbTocItem, AbTocProps } from './ab-toc/index.tsx'
|
|
185
|
+
// ๐๏ธ 0.1.14 (G53): AbDrawer + useAbDrawer (also at `ab-nextjs-components/ab-drawer`)
|
|
186
|
+
export { default as AbDrawer, useAbDrawer, getAbDrawerHost, AB_DRAWER_DURATION } from './ab-drawer/index.tsx'
|
|
187
|
+
// ๐ค 0.2.0 drawers v2: edge swipes + the swipe / snap rules
|
|
188
|
+
export { useAbEdgeSwipe, AB_SWIPE, resolveAbSheetRelease, resolveAbSideRelease } from './ab-drawer/index.tsx'
|
|
189
|
+
export type { AbDrawerTier, AbSheetSnap, UseAbEdgeSwipeOptions } from './ab-drawer/index.tsx'
|
|
190
|
+
export type { AbDrawerProps, AbDrawerSide, AbDrawerScope, UseAbDrawer } from './ab-drawer/index.tsx'
|
|
191
|
+
export { default as AbDrawerList } from './ab-drawer-list/index.tsx'
|
|
192
|
+
export type { AbDrawerListItem, AbDrawerListProps } from './ab-drawer-list/index.tsx'
|
|
193
|
+
export { default as AbConfirmDrawer } from './ab-confirm-drawer/index.tsx'
|
|
194
|
+
export type { AbConfirmDrawerProps } from './ab-confirm-drawer/index.tsx'
|
|
195
|
+
// ๐ฑ 0.1.14 (D40): AbBottomDrawer, the mobile bottom drawer
|
|
196
|
+
export { default as AbBottomDrawer } from './ab-bottom-drawer/index.tsx'
|
|
197
|
+
export type { AbBottomDrawerProps } from './ab-bottom-drawer/index.tsx'
|
|
198
|
+
// ๐ 0.2.0 drawers v2: AbMobileHeader
|
|
199
|
+
export { default as AbMobileHeader } from './ab-mobile-header/index.tsx'
|
|
200
|
+
export type { AbMobileHeaderProps } from './ab-mobile-header/index.tsx'
|
|
201
|
+
// ๐ 0.2.0 drawers v2: AbSearchDrawer
|
|
202
|
+
export { default as AbSearchDrawer, addAbSearchRecent, highlightAbSearch, AB_SEARCH_RECENT_KEY } from './ab-search-drawer/index.tsx'
|
|
203
|
+
export type { AbSearchDrawerProps, AbSearchDrawerItem, AbSearchDrawerGroup, AbSearchDrawerLabels } from './ab-search-drawer/index.tsx'
|
|
204
|
+
// ๐ 0.2.0 drawers v2: AbTocDrawer
|
|
205
|
+
export { default as AbTocDrawer } from './ab-toc-drawer/index.tsx'
|
|
206
|
+
export type { AbTocDrawerProps, AbTocDrawerLink } from './ab-toc-drawer/index.tsx'
|
|
207
|
+
// ๐ 0.2.0 drawers v2: AbNavDrawer
|
|
208
|
+
export { default as AbNavDrawer } from './ab-nav-drawer/index.tsx'
|
|
209
|
+
export type { AbNavDrawerProps, AbNavDrawerItem, AbNavDrawerSection } from './ab-nav-drawer/index.tsx'
|
|
210
|
+
// ๐ 0.2.0 drawers v2: AbSettingsDrawer
|
|
211
|
+
export { default as AbSettingsDrawer } from './ab-settings-drawer/index.tsx'
|
|
212
|
+
export type { AbSettingsDrawerProps, AbSettingsDrawerLabels, AbSettingsLocale, AbSettingsTheme } from './ab-settings-drawer/index.tsx'
|
|
213
|
+
// ๐ท๏ธ 0.1.14 (P9): AbVersionSwitcher
|
|
214
|
+
export { default as AbVersionSwitcher } from './ab-version-switcher/index.tsx'
|
|
215
|
+
export type { AbVersionOption, AbVersionSwitcherProps } from './ab-version-switcher/index.tsx'
|
|
216
|
+
// ๐ 0.1.14 (P2): AbBreadcrumbs
|
|
217
|
+
export { default as AbBreadcrumbs } from './ab-breadcrumbs/index.tsx'
|
|
218
|
+
export type { AbBreadcrumbItem, AbBreadcrumbsProps } from './ab-breadcrumbs/index.tsx'
|
|
219
|
+
// ๐ 0.1.14 (P13): AbList + AbListItem
|
|
220
|
+
export { default as AbList, AbListItem } from './ab-list/index.tsx'
|
|
221
|
+
export type { AbListProps, AbListItemProps } from './ab-list/index.tsx'
|
|
172
222
|
export { default as AbText } from './ab-text/index.tsx'
|
|
173
223
|
export { default as AbTestHello } from './ab-test-hello/index.tsx'
|
|
174
224
|
export { default as AbKeyFeature } from './ab-key-feature/index.tsx'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ab-nextjs-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "๐ A lightweight collection of server & client React components created by Abraham Ukachi, and optimized for Next.js applications ๐.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"ab-nextjs-animations": "^0.2.4",
|
|
44
44
|
"ab-nextjs-hooks": "^0.1.7",
|
|
45
45
|
"ab-nextjs-icons": "^0.2.4",
|
|
46
|
-
"ab-nextjs-theme": "^0.3.
|
|
46
|
+
"ab-nextjs-theme": "^0.3.6",
|
|
47
47
|
"clsx": "^2",
|
|
48
48
|
"next": "^16.3.4",
|
|
49
49
|
"react": "^19",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"ab-nextjs-animations": "^0.2.4",
|
|
57
57
|
"ab-nextjs-hooks": "^0.1.7",
|
|
58
58
|
"ab-nextjs-icons": "^0.2.4",
|
|
59
|
-
"ab-nextjs-theme": "^0.3.
|
|
59
|
+
"ab-nextjs-theme": "^0.3.6",
|
|
60
60
|
"clsx": "^2.1.1",
|
|
61
61
|
"esbuild": "^0.28.2",
|
|
62
62
|
"eslint": "^9.39.0",
|
|
@@ -114,6 +114,18 @@
|
|
|
114
114
|
"ab-splash",
|
|
115
115
|
"ab-linear-progress",
|
|
116
116
|
"ab-carousel",
|
|
117
|
+
"ab-drawer",
|
|
118
|
+
"ab-drawer-list",
|
|
119
|
+
"ab-confirm-drawer",
|
|
120
|
+
"ab-bottom-drawer",
|
|
121
|
+
"ab-mobile-header",
|
|
122
|
+
"ab-search-drawer",
|
|
123
|
+
"ab-toc-drawer",
|
|
124
|
+
"ab-nav-drawer",
|
|
125
|
+
"ab-settings-drawer",
|
|
126
|
+
"ab-version-switcher",
|
|
127
|
+
"ab-breadcrumbs",
|
|
128
|
+
"ab-list",
|
|
117
129
|
"ab-flow-diagram",
|
|
118
130
|
"ab-locale-switcher",
|
|
119
131
|
"ab-install-snippet",
|
|
@@ -153,6 +165,19 @@
|
|
|
153
165
|
"./ab-locale-switcher": "./ab-locale-switcher/index.tsx",
|
|
154
166
|
"./ab-flow-diagram": "./ab-flow-diagram/index.tsx",
|
|
155
167
|
"./ab-flow-diagram/helpers": "./ab-flow-diagram/helpers.ts",
|
|
168
|
+
"./ab-drawer": "./ab-drawer/index.tsx",
|
|
169
|
+
"./ab-drawer/use-ab-drawer": "./ab-drawer/use-ab-drawer.ts",
|
|
170
|
+
"./ab-drawer-list": "./ab-drawer-list/index.tsx",
|
|
171
|
+
"./ab-confirm-drawer": "./ab-confirm-drawer/index.tsx",
|
|
172
|
+
"./ab-bottom-drawer": "./ab-bottom-drawer/index.tsx",
|
|
173
|
+
"./ab-mobile-header": "./ab-mobile-header/index.tsx",
|
|
174
|
+
"./ab-search-drawer": "./ab-search-drawer/index.tsx",
|
|
175
|
+
"./ab-toc-drawer": "./ab-toc-drawer/index.tsx",
|
|
176
|
+
"./ab-nav-drawer": "./ab-nav-drawer/index.tsx",
|
|
177
|
+
"./ab-settings-drawer": "./ab-settings-drawer/index.tsx",
|
|
178
|
+
"./ab-version-switcher": "./ab-version-switcher/index.tsx",
|
|
179
|
+
"./ab-breadcrumbs": "./ab-breadcrumbs/index.tsx",
|
|
180
|
+
"./ab-list": "./ab-list/index.tsx",
|
|
156
181
|
"./ab-splash/gate": "./ab-splash/gate.ts",
|
|
157
182
|
"./ab-splash/csp": {
|
|
158
183
|
"types": "./ab-splash/csp.d.ts",
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
getAbButtonSrReason,
|
|
49
49
|
type AbButtonBadgeTone,
|
|
50
50
|
type AbButtonColor,
|
|
51
|
-
type AbButtonType,
|
|
51
|
+
type AbButtonType, type AbButtonShape, type AbButtonSize,
|
|
52
52
|
} from '../../ab-button/helpers';
|
|
53
53
|
|
|
54
54
|
// ๐ฆ shared types
|
|
@@ -63,6 +63,8 @@ export interface AbButtonProps {
|
|
|
63
63
|
hidden?: boolean; // ๐
|
|
64
64
|
style?: CSSProperties; // ๐จ
|
|
65
65
|
rounded?: boolean; // ๐
|
|
66
|
+
shape?: AbButtonShape; // ๐ท 0.1.14 (P16)
|
|
67
|
+
size?: AbButtonSize; // ๐ 0.1.14 (P16)
|
|
66
68
|
raised?: boolean; // ๐๏ธ
|
|
67
69
|
shrinks?: boolean; // ๐ค
|
|
68
70
|
expands?: boolean; // ๐
|
|
@@ -84,7 +86,7 @@ export interface AbButtonProps {
|
|
|
84
86
|
|
|
85
87
|
/** ๐ฅ๏ธ Server AbButton: no onClick. Use href for links or htmlType for form submit. No-JS safe. */
|
|
86
88
|
const AbButton = ({
|
|
87
|
-
id, type = 'contained', htmlType = 'button', className, hidden = false, style, rounded = true, raised = false,
|
|
89
|
+
id, type = 'contained', htmlType = 'button', className, hidden = false, style, rounded = true, shape, size, raised = false,
|
|
88
90
|
shrinks = false, expands = false, withIcon = false, disabled = false, iconPosition = 'left', label, icon,
|
|
89
91
|
color = 'primary', href, children, startIcon, endIcon, badge, badgeTone = 'neutral', disabledReason, focusableWhenDisabled,
|
|
90
92
|
}: AbButtonProps): ReactElement => {
|
|
@@ -106,6 +108,8 @@ const AbButton = ({
|
|
|
106
108
|
'data-iconpos': iconPosition, // โ๏ธ
|
|
107
109
|
'data-color': color, // ๐จ
|
|
108
110
|
'data-disabled-mode': mode, // ๐ฆ
|
|
111
|
+
'data-shape': shape, // ๐ท P16
|
|
112
|
+
'data-size': size, // ๐ P16
|
|
109
113
|
} as const;
|
|
110
114
|
|
|
111
115
|
// ๐ฃ legacy icon (decorative)
|
|
@@ -150,3 +150,42 @@
|
|
|
150
150
|
white-space: nowrap; /* ๐ซ */
|
|
151
151
|
border: 0; /* ๐งน */
|
|
152
152
|
}
|
|
153
|
+
|
|
154
|
+
/* ===== ๐ท 0.1.14 (P16, Home fidelity spec ยง4 CTAs): shape="rounded" ยท size="md" ยท type="secondary" =====
|
|
155
|
+
* Doubled class (0,3,0+) beats the theme's `button[data-type="filled"]` (0,1,1) and its :hover (0,3,1 โ we use 0,5,0). */
|
|
156
|
+
.abButton.abButton[data-shape="rounded"] {
|
|
157
|
+
gap: 6px; /* ๐งฑ icon โ label */
|
|
158
|
+
border-radius: var(--ab-radius-button, 10px); /* ๐ท */
|
|
159
|
+
padding: 0 var(--ab-button-padding-inline, 16px); /* ๐ฆ */
|
|
160
|
+
font-size: 14px; font-weight: 650; line-height: 1; white-space: nowrap; /* ๐ค */
|
|
161
|
+
overflow: visible; /* ๐ the primary shadow must show */
|
|
162
|
+
}
|
|
163
|
+
.abButton.abButton[data-size="md"] { height: var(--ab-button-height, 40px); box-sizing: border-box; } /* ๐ */
|
|
164
|
+
.abButton.abButton[data-shape="rounded"] .abButtonSlot { width: 18px; height: 18px; } /* ๐ผ๏ธ 18px icons */
|
|
165
|
+
.abButton.abButton[data-shape="rounded"] .abButtonSlot svg { width: 100%; height: 100%; }
|
|
166
|
+
/* ๐ฅ primary (filled) */
|
|
167
|
+
.abButton.abButton[data-shape="rounded"][data-type="filled"] {
|
|
168
|
+
background: var(--ab-color-btn, #8b6340); color: var(--ab-color-btn-text, #fff); /* ๐จ AA (theme 0.3.5) */
|
|
169
|
+
border: 0; box-shadow: var(--ab-shadow-button, 0 1px 0 rgb(255 255 255 / 0.2) inset, 0 4px 12px rgb(139 99 64 / 0.25)); /* โจ */
|
|
170
|
+
}
|
|
171
|
+
.abButton.abButton[data-shape="rounded"][data-type="filled"]:not(:disabled, [aria-disabled="true"]):hover {
|
|
172
|
+
background: color-mix(in srgb, var(--ab-color-btn, #8b6340) 90%, #000); /* ๐ฑ๏ธ */
|
|
173
|
+
}
|
|
174
|
+
/* โช secondary */
|
|
175
|
+
.abButton.abButton[data-type="secondary"] {
|
|
176
|
+
border: 1px solid var(--ab-color-border, rgb(92 64 48 / 0.13)); background: var(--ab-color-card, #fff); color: var(--ab-color-text, #211a16); /* ๐จ */
|
|
177
|
+
box-sizing: border-box;
|
|
178
|
+
}
|
|
179
|
+
.abButton.abButton[data-type="secondary"]:not(:disabled, [aria-disabled="true"]):hover {
|
|
180
|
+
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); /* ๐ฑ๏ธ tint over the card */
|
|
181
|
+
}
|
|
182
|
+
.abButton.abButton[data-shape="rounded"]:not(:disabled, [aria-disabled="true"]):active { transform: translateY(1px); } /* ๐ */
|
|
183
|
+
.abButton.abButton[data-shape="rounded"]:focus-visible { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: 2px; } /* โฟ */
|
|
184
|
+
/* ๐ฑ touch widths: 44px, 14.5px (mock .M .btn; the app sets flex: 1) */
|
|
185
|
+
@media (max-width: 767px) {
|
|
186
|
+
.abButton.abButton[data-size="md"] { height: var(--ab-button-height-touch, 44px); }
|
|
187
|
+
.abButton.abButton[data-shape="rounded"][data-size="md"] { font-size: 14.5px; }
|
|
188
|
+
}
|
|
189
|
+
@media (prefers-reduced-motion: reduce) {
|
|
190
|
+
.abButton.abButton[data-shape="rounded"]:active { transform: none; } /* โฟ no nudge */
|
|
191
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -78,6 +78,43 @@ export { default as AbSidebar } from '../ab-sidebar/index.tsx';
|
|
|
78
78
|
// ๐ 0.1.13 (Joseph): AbToc + the panes main-scroller helpers (also at `ab-nextjs-components/ab-toc`)
|
|
79
79
|
export { default as AbToc, getAbMainScroller, AB_MAIN_SCROLLER_SELECTOR } from '../ab-toc/index.tsx';
|
|
80
80
|
export type { AbTocItem, AbTocProps } from '../ab-toc/index.tsx';
|
|
81
|
+
// ๐๏ธ 0.1.14 (G53): AbDrawer + useAbDrawer (also at `ab-nextjs-components/ab-drawer`)
|
|
82
|
+
export { default as AbDrawer, useAbDrawer, getAbDrawerHost, AB_DRAWER_DURATION } from '../ab-drawer/index.tsx';
|
|
83
|
+
// ๐ค 0.2.0 drawers v2: edge swipes + the swipe / snap rules
|
|
84
|
+
export { useAbEdgeSwipe, AB_SWIPE, resolveAbSheetRelease, resolveAbSideRelease } from '../ab-drawer/index.tsx';
|
|
85
|
+
export type { AbDrawerTier, AbSheetSnap, UseAbEdgeSwipeOptions } from '../ab-drawer/index.tsx';
|
|
86
|
+
export type { AbDrawerProps, AbDrawerSide, AbDrawerScope, UseAbDrawer } from '../ab-drawer/index.tsx';
|
|
87
|
+
export { default as AbDrawerList } from '../ab-drawer-list/index.tsx';
|
|
88
|
+
export type { AbDrawerListItem, AbDrawerListProps } from '../ab-drawer-list/index.tsx';
|
|
89
|
+
export { default as AbConfirmDrawer } from '../ab-confirm-drawer/index.tsx';
|
|
90
|
+
export type { AbConfirmDrawerProps } from '../ab-confirm-drawer/index.tsx';
|
|
91
|
+
// ๐ฑ 0.1.14 (D40): AbBottomDrawer, the mobile bottom drawer
|
|
92
|
+
export { default as AbBottomDrawer } from '../ab-bottom-drawer/index.tsx';
|
|
93
|
+
export type { AbBottomDrawerProps } from '../ab-bottom-drawer/index.tsx';
|
|
94
|
+
// ๐ 0.2.0 drawers v2: AbMobileHeader
|
|
95
|
+
export { default as AbMobileHeader } from '../ab-mobile-header/index.tsx';
|
|
96
|
+
export type { AbMobileHeaderProps } from '../ab-mobile-header/index.tsx';
|
|
97
|
+
// ๐ 0.2.0 drawers v2: AbSearchDrawer
|
|
98
|
+
export { default as AbSearchDrawer, addAbSearchRecent, highlightAbSearch, AB_SEARCH_RECENT_KEY } from '../ab-search-drawer/index.tsx';
|
|
99
|
+
export type { AbSearchDrawerProps, AbSearchDrawerItem, AbSearchDrawerGroup, AbSearchDrawerLabels } from '../ab-search-drawer/index.tsx';
|
|
100
|
+
// ๐ 0.2.0 drawers v2: AbTocDrawer
|
|
101
|
+
export { default as AbTocDrawer } from '../ab-toc-drawer/index.tsx';
|
|
102
|
+
export type { AbTocDrawerProps, AbTocDrawerLink } from '../ab-toc-drawer/index.tsx';
|
|
103
|
+
// ๐ 0.2.0 drawers v2: AbNavDrawer
|
|
104
|
+
export { default as AbNavDrawer } from '../ab-nav-drawer/index.tsx';
|
|
105
|
+
export type { AbNavDrawerProps, AbNavDrawerItem, AbNavDrawerSection } from '../ab-nav-drawer/index.tsx';
|
|
106
|
+
// ๐ 0.2.0 drawers v2: AbSettingsDrawer
|
|
107
|
+
export { default as AbSettingsDrawer } from '../ab-settings-drawer/index.tsx';
|
|
108
|
+
export type { AbSettingsDrawerProps, AbSettingsDrawerLabels, AbSettingsLocale, AbSettingsTheme } from '../ab-settings-drawer/index.tsx';
|
|
109
|
+
// ๐ท๏ธ 0.1.14 (P9): AbVersionSwitcher
|
|
110
|
+
export { default as AbVersionSwitcher } from '../ab-version-switcher/index.tsx';
|
|
111
|
+
export type { AbVersionOption, AbVersionSwitcherProps } from '../ab-version-switcher/index.tsx';
|
|
112
|
+
// ๐ 0.1.14 (P2): AbBreadcrumbs
|
|
113
|
+
export { default as AbBreadcrumbs } from '../ab-breadcrumbs/index.tsx';
|
|
114
|
+
export type { AbBreadcrumbItem, AbBreadcrumbsProps } from '../ab-breadcrumbs/index.tsx';
|
|
115
|
+
// ๐ 0.1.14 (P13): AbList + AbListItem
|
|
116
|
+
export { default as AbList, AbListItem } from '../ab-list/index.tsx';
|
|
117
|
+
export type { AbListProps, AbListItemProps } from '../ab-list/index.tsx';
|
|
81
118
|
export { default as AbText } from '../ab-text/index.tsx';
|
|
82
119
|
export { default as AbTestHello } from '../ab-test-hello/index.tsx';
|
|
83
120
|
export { default as AbKeyFeature } from '../ab-key-feature/index.tsx';
|