ab-nextjs-components 0.1.12 → 0.1.13
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 +29 -0
- package/README.md +22 -0
- package/ab-app-bar/index.tsx +181 -0
- package/ab-app-bar/styles.module.css +119 -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-brand/index.tsx +1 -1
- package/ab-button/index.tsx +15 -2
- package/ab-button/styles.module.css +31 -0
- package/ab-card/index.tsx +89 -0
- package/ab-card/styles.module.css +68 -0
- package/ab-collapsible/index.tsx +1 -1
- package/ab-color/index.tsx +1 -0
- package/ab-color/styles.module.css +32 -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-icon/builtin.ts +15 -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 +8 -3
- 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/styles.module.css +16 -2
- 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-locale-switcher/index.tsx +17 -0
- package/ab-locale-switcher/styles.module.css +11 -0
- 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 +84 -28
- package/ab-navbar/view.tsx +163 -0
- package/ab-package-card/index.tsx +94 -0
- package/ab-package-card/styles.module.css +41 -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 +142 -0
- package/ab-search-trigger/styles.module.css +70 -0
- package/ab-sidebar/index.tsx +88 -49
- package/ab-sidebar/styles.module.css +136 -31
- package/ab-sidebar/view.tsx +182 -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-toc/index.tsx +124 -0
- package/ab-toc/styles.module.css +54 -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 +18 -0
- package/package.json +27 -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-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 +35 -0
- package/server/ab-navbar/styles.module.css +0 -35
- package/server/ab-sidebar/styles.module.css +0 -41
|
@@ -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: styles.module.css
|
|
28
|
+
* @file: server/ab-badge/styles.module.css
|
|
29
|
+
* @type: CSS Stylesheet
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*/
|
|
32
|
+
|
|
1
33
|
/* AbBadge — server, plain CSS */
|
|
2
34
|
.abBadge {
|
|
3
35
|
position: absolute;
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
import type { CSSProperties, ReactElement } from 'react';
|
|
41
|
-
import Link from 'next/link
|
|
41
|
+
import Link from '../../ab-link'; // 🔗 G42: injectable via AbLinkProvider (default next/link)
|
|
42
42
|
import Image from 'next/image';
|
|
43
43
|
import clsx from 'clsx';
|
|
44
44
|
import styles from './styles.module.css';
|
package/server/ab-icon/index.tsx
CHANGED
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
39
|
// ⚛️ types
|
|
40
|
-
import type
|
|
40
|
+
import { useId, type CSSProperties, type ReactElement } from 'react';
|
|
41
41
|
// 🧵 classes
|
|
42
42
|
import clsx from 'clsx';
|
|
43
43
|
// 🗺️ full icon map: fine here, server components ship no JS to the browser
|
|
44
44
|
import { getAbIconSvg } from 'ab-nextjs-icons/ab-icons';
|
|
45
45
|
// 🧮 shared helpers (same rules as the client twin)
|
|
46
|
-
import { getAbIconStroke, getRegisteredAbIcon, pickAbIconMarkup, toAbIconSize, type AbIconSvgData, type AbIconVariant, type AbIconWeight } from '../../ab-icon/helpers';
|
|
46
|
+
import { scopeAbIconIds, warnAbIconMissing, getAbIconStroke, getRegisteredAbIcon, pickAbIconMarkup, toAbIconSize, type AbIconSvgData, type AbIconVariant, type AbIconWeight } from '../../ab-icon/helpers';
|
|
47
47
|
// 🎨 styles (server copy)
|
|
48
48
|
import styles from './styles.module.css';
|
|
49
49
|
|
|
50
50
|
// ⚙️ props
|
|
51
51
|
export interface AbIconProps {
|
|
52
|
-
name: string; // 🗂️ AbIcons name (snake_case); Material ligature fallback
|
|
52
|
+
name: string; // 🗂️ AbIcons name (snake_case); AbIcons name (registered / svg / map); unknown = Material ligature fallback + dev warning
|
|
53
53
|
variant?: AbIconVariant; // 🎚️ outlined (default) | filled
|
|
54
54
|
filled?: boolean; // 🕰️ legacy alias for variant="filled"
|
|
55
55
|
weight?: AbIconWeight | number; // 📏 100–700 (outlined), default 200
|
|
@@ -61,12 +61,14 @@ export interface AbIconProps {
|
|
|
61
61
|
style?: CSSProperties; // 🎨
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
/** 🔣 AbIcons SVG icon (server / RSC): `svg` prop → registry → full AbIcons map → Material ligature. */
|
|
64
|
+
/** 🔣 AbIcons SVG icon (server / RSC): `svg` prop → registry → full AbIcons map → Material ligature fallback + dev warning. */
|
|
65
65
|
const AbIcon = ({ name, variant, filled = false, weight, size, label, title, svg, className, style }: AbIconProps): ReactElement => {
|
|
66
66
|
// 🎚️ variant for lookup
|
|
67
67
|
const want: AbIconVariant = variant ?? (filled ? 'filled' : 'outlined');
|
|
68
68
|
// 🔍 explicit → registered → whole map (weight is applied by CSS, so ask for the raw markup)
|
|
69
69
|
const markup = pickAbIconMarkup(svg ?? getRegisteredAbIcon(name), want) ?? getAbIconSvg(name, want);
|
|
70
|
+
// 🆔 one id per rendered instance (Joseph: a hidden twin's mask broke the active Home)
|
|
71
|
+
const uid = useId();
|
|
70
72
|
// 🎚️ legacy `filled` → variant
|
|
71
73
|
const v: AbIconVariant = variant ?? (filled ? 'filled' : 'outlined');
|
|
72
74
|
// 🏷️ accessible name: `label` (new) or `title` (legacy)
|
|
@@ -87,18 +89,21 @@ const AbIcon = ({ name, variant, filled = false, weight, size, label, title, svg
|
|
|
87
89
|
title={title} // 💬 legacy tooltip only
|
|
88
90
|
{...a11y} // ♿
|
|
89
91
|
// 🔒 trusted, package-generated static markup (never user input)
|
|
90
|
-
dangerouslySetInnerHTML={{ __html: markup }}
|
|
92
|
+
dangerouslySetInnerHTML={{ __html: scopeAbIconIds(markup, uid) }}
|
|
91
93
|
/>
|
|
92
94
|
);
|
|
93
95
|
}
|
|
94
96
|
|
|
95
|
-
// 🕰️
|
|
97
|
+
// 🕰️ 0.1.13 (James review): NON-breaking fallback for unregistered names. A patch must not blank icons,
|
|
98
|
+
// so an unknown name still renders the pre-G2 Material Symbols ligature (needs the app's font), and
|
|
99
|
+
// warns once in development so the missing registration gets fixed before the app drops the font.
|
|
100
|
+
warnAbIconMissing(name);
|
|
96
101
|
return (
|
|
97
102
|
<span
|
|
98
|
-
className={clsx('material-symbols-rounded', 'icon', styles.abIconFont, className)} // 🏷️
|
|
103
|
+
className={clsx('AbIcon', 'material-symbols-rounded', 'icon', styles.abIconFont, className)} // 🏷️ legacy font class
|
|
99
104
|
style={{ ...style, fontSize: toAbIconSize(size) }} // 📏
|
|
100
|
-
data-filled={v === 'filled' ? 'true' : 'false'} // 🎚️
|
|
101
105
|
data-icon={name} // 🗂️
|
|
106
|
+
data-filled={v === 'filled' ? 'true' : 'false'} // 🎚️
|
|
102
107
|
data-ab-icon-fallback="font" // 🔎 easy to audit
|
|
103
108
|
title={title} // 💬
|
|
104
109
|
{...a11y} // ♿
|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
* @project: ab-nextjs-components
|
|
9
9
|
* @name: AbKeyFeature - Server (port of lyd-key-feature)
|
|
10
10
|
* @file: server/ab-key-feature/index.tsx
|
|
11
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
import type { ReactElement } from 'react';
|
|
15
|
-
import Link from 'next/link
|
|
16
|
+
import Link from '../../ab-link'; // 🔗 G42: injectable via AbLinkProvider (default next/link)
|
|
16
17
|
import clsx from 'clsx';
|
|
17
18
|
import styles from './styles.module.css';
|
|
18
19
|
|
|
@@ -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: styles.module.css
|
|
28
|
+
* @file: server/ab-key-feature/styles.module.css
|
|
29
|
+
* @type: CSS Stylesheet
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*/
|
|
32
|
+
|
|
1
33
|
.abKeyFeature {
|
|
2
34
|
display: flex;
|
|
3
35
|
flex-direction: column;
|
package/server/ab-name/index.tsx
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: styles.module.css
|
|
28
|
+
* @file: server/ab-name/styles.module.css
|
|
29
|
+
* @type: CSS Stylesheet
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*/
|
|
32
|
+
|
|
1
33
|
.abName {
|
|
2
34
|
display: inline-flex;
|
|
3
35
|
align-items: baseline;
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
* @project: ab-nextjs-components
|
|
9
9
|
* @name: AbNavLink - Server (port of lyd-nav-link)
|
|
10
10
|
* @file: server/ab-nav-link/index.tsx
|
|
11
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
import type { ReactElement } from 'react';
|
|
14
|
-
import Link from 'next/link
|
|
15
|
+
import Link from '../../ab-link'; // 🔗 G42: injectable via AbLinkProvider (default next/link)
|
|
15
16
|
import clsx from 'clsx';
|
|
16
17
|
import styles from './styles.module.css';
|
|
17
18
|
|
|
@@ -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: styles.module.css
|
|
28
|
+
* @file: server/ab-nav-link/styles.module.css
|
|
29
|
+
* @type: CSS Stylesheet
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*/
|
|
32
|
+
|
|
1
33
|
.abNavLink {
|
|
2
34
|
display: inline-flex;
|
|
3
35
|
align-items: center;
|
|
@@ -5,60 +5,59 @@
|
|
|
5
5
|
* ~~~~~~~~~~~~
|
|
6
6
|
* Copyright (c) 2026 Abraham Ukachi. The abElements Project.
|
|
7
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
|
+
*
|
|
8
26
|
* @project: ab-nextjs-components
|
|
9
|
-
* @name: AbNavbar - Server (
|
|
27
|
+
* @name: AbNavbar - Server (G41)
|
|
10
28
|
* @file: server/ab-navbar/index.tsx
|
|
29
|
+
* @type: Server Component
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
11
31
|
*/
|
|
12
32
|
|
|
33
|
+
/*
|
|
34
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
35
|
+
* MOTTO: We'll always do more 😜!!!
|
|
36
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
// ⚛️ React
|
|
13
40
|
import type { ReactElement } from 'react';
|
|
14
|
-
|
|
15
|
-
import
|
|
16
|
-
|
|
41
|
+
// 🔣 server AbIcon
|
|
42
|
+
import AbIcon from '../ab-icon';
|
|
43
|
+
// 🖼️ shared view
|
|
44
|
+
import { AbNavbarView, isAbNavbarActive, type AbNavbarBaseProps, type AbNavbarLinkItem } from '../../ab-navbar/view';
|
|
45
|
+
// 🌍 0.1.13: strip `/fr` from activeHref when `locales` is given (pure helper, server-safe)
|
|
46
|
+
import { stripAbLocalePrefix } from '../../ab-link/locale';
|
|
17
47
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
icon: string;
|
|
21
|
-
value: string;
|
|
22
|
-
label: string;
|
|
23
|
-
};
|
|
48
|
+
// 📦 shared types
|
|
49
|
+
export type { AbNavbarLinkItem, AbNavbarLink } from '../../ab-navbar/view';
|
|
24
50
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
type?: 'customer' | 'admin';
|
|
28
|
-
page?: string;
|
|
29
|
-
links?: AbNavbarLink[];
|
|
30
|
-
}
|
|
51
|
+
/** ⚙️ Server props: link items only (buttons need a client `onSelect`). */
|
|
52
|
+
export type AbNavbarProps = AbNavbarBaseProps<AbNavbarLinkItem>;
|
|
31
53
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
page,
|
|
36
|
-
|
|
37
|
-
}: AbNavbarProps): ReactElement => {
|
|
38
|
-
return (
|
|
39
|
-
<nav data-type={type} data-ab-part="bottomBar" className={clsx('AbNavbar', styles.abNavbar, className)} aria-label="Primary">
|
|
40
|
-
<ul className={styles.abNavbarList}>
|
|
41
|
-
{links.map((link) => {
|
|
42
|
-
const active = page === link.value;
|
|
43
|
-
return (
|
|
44
|
-
<li key={link.value}>
|
|
45
|
-
<Link
|
|
46
|
-
href={link.href}
|
|
47
|
-
data-active={active ? 'true' : 'false'}
|
|
48
|
-
className={styles.abNavbarLink}
|
|
49
|
-
>
|
|
50
|
-
<span className={clsx('material-symbols-rounded', styles.abNavbarIcon)} aria-hidden>
|
|
51
|
-
{link.icon}
|
|
52
|
-
</span>
|
|
53
|
-
<span>{link.label}</span>
|
|
54
|
-
</Link>
|
|
55
|
-
</li>
|
|
56
|
-
);
|
|
57
|
-
})}
|
|
58
|
-
</ul>
|
|
59
|
-
</nav>
|
|
60
|
-
);
|
|
54
|
+
/** 📱 AbNavbar (server, G41): same markup as the client twin; active from `activeHref` / legacy `page`. */
|
|
55
|
+
const AbNavbar = (props: AbNavbarProps): ReactElement => {
|
|
56
|
+
const { page, activeHref } = props;
|
|
57
|
+
const active = (href: string, value?: string) => (page ? page === value : isAbNavbarActive(href, activeHref && stripAbLocalePrefix(activeHref, props.locales))); // 🎯
|
|
58
|
+
return <AbNavbarView props={props} Icon={AbIcon} active={active} />;
|
|
61
59
|
};
|
|
62
60
|
|
|
61
|
+
// 📦 exports
|
|
63
62
|
export default AbNavbar;
|
|
64
63
|
export { AbNavbar };
|
|
@@ -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: styles.module.css
|
|
28
|
+
* @file: server/ab-polygon/styles.module.css
|
|
29
|
+
* @type: CSS Stylesheet
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*/
|
|
32
|
+
|
|
1
33
|
.abPolygon {
|
|
2
34
|
display: block;
|
|
3
35
|
line-height: 0;
|
|
@@ -5,64 +5,59 @@
|
|
|
5
5
|
* ~~~~~~~~~~~~
|
|
6
6
|
* Copyright (c) 2026 Abraham Ukachi. The abElements Project.
|
|
7
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
|
+
*
|
|
8
26
|
* @project: ab-nextjs-components
|
|
9
|
-
* @name: AbSidebar - Server (
|
|
27
|
+
* @name: AbSidebar - Server (G40)
|
|
10
28
|
* @file: server/ab-sidebar/index.tsx
|
|
29
|
+
* @type: Server Component
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
11
31
|
*/
|
|
12
32
|
|
|
33
|
+
/*
|
|
34
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
35
|
+
* MOTTO: We'll always do more 😜!!!
|
|
36
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
// ⚛️ React
|
|
13
40
|
import type { ReactElement } from 'react';
|
|
14
|
-
|
|
15
|
-
import
|
|
16
|
-
|
|
41
|
+
// 🔣 server AbIcon (full AbIcons map; no JS shipped)
|
|
42
|
+
import AbIcon from '../ab-icon';
|
|
43
|
+
// 🖼️ shared view (same markup as the client twin)
|
|
44
|
+
import { AbSidebarView, isAbSidebarActive, type AbSidebarBaseProps } from '../../ab-sidebar/view';
|
|
45
|
+
// 🌍 0.1.13: strip `/fr` from activeHref when `locales` is given (pure helper, server-safe)
|
|
46
|
+
import { stripAbLocalePrefix } from '../../ab-link/locale';
|
|
17
47
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
icon: string;
|
|
21
|
-
value: string;
|
|
22
|
-
label: string;
|
|
23
|
-
};
|
|
48
|
+
// 📦 shared types
|
|
49
|
+
export type { AbSidebarItem, AbSidebarSection, AbSidebarLink, AbSidebarLabels } from '../../ab-sidebar/view';
|
|
24
50
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
type?: 'customer' | 'admin';
|
|
28
|
-
page?: string;
|
|
29
|
-
links?: AbSidebarLink[];
|
|
30
|
-
brandHref?: string;
|
|
31
|
-
brandLabel?: string;
|
|
32
|
-
}
|
|
51
|
+
/** ⚙️ Server props: no collapse button (needs JS); pass `collapsed` for a static rail. */
|
|
52
|
+
export type AbSidebarProps = AbSidebarBaseProps;
|
|
33
53
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
page,
|
|
38
|
-
|
|
39
|
-
brandHref = '/',
|
|
40
|
-
brandLabel = 'abElements',
|
|
41
|
-
}: AbSidebarProps): ReactElement => {
|
|
42
|
-
return (
|
|
43
|
-
<nav data-type={type} data-ab-part="sidebar" className={clsx('AbSidebar', styles.abSidebar, className)} aria-label="Sidebar">
|
|
44
|
-
<Link href={brandHref} className={styles.abSidebarBrand}>
|
|
45
|
-
<span className="material-symbols-rounded" aria-hidden>apps</span>
|
|
46
|
-
<span>{brandLabel}</span>
|
|
47
|
-
</Link>
|
|
48
|
-
<ul className={styles.abSidebarList}>
|
|
49
|
-
{links.map((link) => {
|
|
50
|
-
const active = page === link.value;
|
|
51
|
-
return (
|
|
52
|
-
<li key={link.value}>
|
|
53
|
-
<Link href={link.href} data-active={active ? 'true' : 'false'} className={styles.abSidebarLink}>
|
|
54
|
-
<span className={clsx('material-symbols-rounded', styles.abSidebarIcon)} aria-hidden>
|
|
55
|
-
{link.icon}
|
|
56
|
-
</span>
|
|
57
|
-
<span>{link.label}</span>
|
|
58
|
-
</Link>
|
|
59
|
-
</li>
|
|
60
|
-
);
|
|
61
|
-
})}
|
|
62
|
-
</ul>
|
|
63
|
-
</nav>
|
|
64
|
-
);
|
|
54
|
+
/** 🧭 AbSidebar (server, G40): same markup as the client twin; active state from `activeHref` / legacy `page`. */
|
|
55
|
+
const AbSidebar = (props: AbSidebarProps): ReactElement => {
|
|
56
|
+
const { page, activeHref } = props;
|
|
57
|
+
const active = (href: string, value?: string) => (page ? page === value : isAbSidebarActive(href, activeHref && stripAbLocalePrefix(activeHref, props.locales))); // 🎯
|
|
58
|
+
return <AbSidebarView props={props} Icon={AbIcon} active={active} />;
|
|
65
59
|
};
|
|
66
60
|
|
|
61
|
+
// 📦 exports
|
|
67
62
|
export default AbSidebar;
|
|
68
63
|
export { AbSidebar };
|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
* @project: ab-nextjs-components
|
|
9
9
|
* @name: AbSwitchBack - Server (port of lyd-switch-back)
|
|
10
10
|
* @file: server/ab-switch-back/index.tsx
|
|
11
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
import type { ReactElement, ReactNode } from 'react';
|
|
15
|
-
import Link from 'next/link
|
|
16
|
+
import Link from '../../ab-link'; // 🔗 G42: injectable via AbLinkProvider (default next/link)
|
|
16
17
|
import Image from 'next/image';
|
|
17
18
|
import clsx from 'clsx';
|
|
18
19
|
import styles from './styles.module.css';
|
|
@@ -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: styles.module.css
|
|
28
|
+
* @file: server/ab-switch-back/styles.module.css
|
|
29
|
+
* @type: CSS Stylesheet
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*/
|
|
32
|
+
|
|
1
33
|
.abSwitchBack {
|
|
2
34
|
display: grid;
|
|
3
35
|
grid-template-columns: 1fr;
|
|
@@ -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: styles.module.css
|
|
28
|
+
* @file: server/ab-test-hello/styles.module.css
|
|
29
|
+
* @type: CSS Stylesheet
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*/
|
|
32
|
+
|
|
1
33
|
.abTestHello {
|
|
2
34
|
display: flex;
|
|
3
35
|
flex-direction: column;
|
package/server/ab-text/index.tsx
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: styles.module.css
|
|
28
|
+
* @file: server/ab-text/styles.module.css
|
|
29
|
+
* @type: CSS Stylesheet
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*/
|
|
32
|
+
|
|
1
33
|
.abText {
|
|
2
34
|
display: inline;
|
|
3
35
|
}
|