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
|
@@ -42,9 +42,12 @@
|
|
|
42
42
|
gap: 0.5rem; /* ๐งฑ */
|
|
43
43
|
padding: 0.75rem; /* ๐งฑ */
|
|
44
44
|
border-radius: 0.875rem; /* ๐ฒ */
|
|
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
|
max-width: 100%; /* ๐ */
|
|
48
|
+
min-width: 0; /* ๐ซ overflow in narrow columns (0.1.13) */
|
|
49
|
+
box-sizing: border-box; /* ๐ฆ the 1px border stays inside 100% */
|
|
50
|
+
grid-template-columns: minmax(0, 1fr); /* ๐ซ the nowrap command can't widen the card */
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
/* ๐๏ธ tabs row */
|
|
@@ -81,7 +84,7 @@
|
|
|
81
84
|
font-weight: 600; /* ๐ช */
|
|
82
85
|
}
|
|
83
86
|
.tab:focus-visible {
|
|
84
|
-
outline: 2px solid var(--ab-focus-ring, var(--ab-color-primary, #A67C52)); /* ๐ */
|
|
87
|
+
outline: 2px solid var(--ab-color-accent, var(--ab-focus-ring, var(--ab-color-primary, #A67C52))); /* ๐ */
|
|
85
88
|
outline-offset: 2px; /* โ๏ธ */
|
|
86
89
|
}
|
|
87
90
|
|
|
@@ -91,20 +94,26 @@
|
|
|
91
94
|
align-items: center; /* โ๏ธ */
|
|
92
95
|
gap: 0.5rem; /* ๐งฑ */
|
|
93
96
|
min-width: 0; /* ๐ซ overflow */
|
|
97
|
+
/* ๐ป 0.1.13 (Joseph #13): the command sits on the theme 0.3.4 code surface (dark in both themes) */
|
|
98
|
+
padding: 0.375rem 0.375rem 0.375rem 0.75rem; /* ๐งฑ */
|
|
99
|
+
border-radius: 0.625rem; /* ๐ฒ */
|
|
100
|
+
background: var(--ab-color-code-surface, rgb(35 28 23)); /* ๐ป */
|
|
101
|
+
color: var(--ab-color-on-code-surface, rgb(240 223 215)); /* ๐๏ธ โฅ 4.5:1 */
|
|
94
102
|
}
|
|
95
103
|
.prompt {
|
|
96
104
|
opacity: 0.5; /* ๐ซ๏ธ */
|
|
97
|
-
font-family: var(--ab-font-mono, ui-monospace, monospace); /*
|
|
105
|
+
font-family: var(--ab-font-code, var(--ab-font-mono, ui-monospace, monospace)); /* โจ๏ธ code font (Roboto Mono via theme 0.3.4) */
|
|
98
106
|
}
|
|
99
107
|
.code {
|
|
100
108
|
flex: 1; /* โ๏ธ */
|
|
101
109
|
overflow-x: auto; /* ๐ long commands scroll */
|
|
102
110
|
white-space: nowrap; /* ๐ซ wrap */
|
|
103
|
-
font-family: var(--ab-font-mono, ui-monospace, monospace); /*
|
|
111
|
+
font-family: var(--ab-font-code, var(--ab-font-mono, ui-monospace, monospace)); /* โจ๏ธ code font (Roboto Mono via theme 0.3.4) */
|
|
104
112
|
font-size: 0.875rem; /* ๐ก */
|
|
105
113
|
}
|
|
106
114
|
.copy {
|
|
107
115
|
flex: none; /* ๐ซ squash */
|
|
116
|
+
color: inherit; /* ๐๏ธ on-code-surface */
|
|
108
117
|
}
|
|
109
118
|
|
|
110
119
|
/* ๐ visually hidden */
|
|
@@ -112,3 +121,40 @@
|
|
|
112
121
|
position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; /* ๐ */
|
|
113
122
|
overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; /* โ๏ธ */
|
|
114
123
|
}
|
|
124
|
+
|
|
125
|
+
/* ๐ซ JS off (0.1.13, gap-review): the command shows the pnpm default; copying needs JS, so hide the button */
|
|
126
|
+
@media (scripting: none) {
|
|
127
|
+
.copy { display: none; } /* ๐ */
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* ===== ๐ป 0.1.14 (P12, Home spec ยง4 install block): variant="terminal" (dark in both themes) ===== */
|
|
131
|
+
.root.terminal {
|
|
132
|
+
display: block; gap: 0; padding: 0; overflow: hidden; /* ๐งน no outer card */
|
|
133
|
+
border: 1px solid rgb(255 232 210 / 0.06); border-radius: var(--ab-radius-code, 12px); /* ๐ฒ */
|
|
134
|
+
background: var(--ab-color-code, #231a14); color: var(--ab-color-code-text, #ede0d4); /* ๐ป dark: #110b07 / #e8dacc */
|
|
135
|
+
box-shadow: 0 10px 30px rgb(33 26 22 / 0.14); /* ๐ */
|
|
136
|
+
}
|
|
137
|
+
.termHead {
|
|
138
|
+
display: flex; align-items: center; padding: 6px 8px 0 10px; /* ๐ฆ tabs ยท grow ยท copy */
|
|
139
|
+
border-bottom: 1px solid rgb(255 232 210 / 0.08); /* โ */
|
|
140
|
+
}
|
|
141
|
+
.terminal .tabs { gap: 2px; } /* ๐๏ธ */
|
|
142
|
+
.terminal .tab, .terminal .tab:hover {
|
|
143
|
+
min-height: 0; padding: 6px 8px 8px; border-radius: 0; background: none; /* ๐งน no pills */
|
|
144
|
+
font-size: 12px; font-weight: 600; line-height: 17px; color: rgb(237 224 212 / 0.55); /* ๐ค */
|
|
145
|
+
}
|
|
146
|
+
.terminal .tab:hover { color: rgb(237 224 212 / 0.8); } /* ๐ฑ๏ธ */
|
|
147
|
+
.terminal .tab[aria-selected='true'], .terminal .tab[aria-selected='true']:hover {
|
|
148
|
+
background: none; color: #e7c8a5; box-shadow: inset 0 -2px 0 #c29a6f; /* โ
underline */
|
|
149
|
+
}
|
|
150
|
+
.terminal .tab:focus-visible { outline-color: #c29a6f; outline-offset: -2px; } /* โฟ inside the block */
|
|
151
|
+
.termGrow { flex: 1; } /* โ๏ธ */
|
|
152
|
+
.terminal .copy.copy { margin: 0; padding: 4px 4px 6px; border-radius: 6px; color: rgb(237 224 212 / 0.7); } /* ๐ always visible; mock .cp 4/4/6 โ a 26px (โฅ 24px) target */
|
|
153
|
+
.terminal .panel { display: block; padding: 14px 16px 16px; border-radius: 0; background: none; color: inherit; overflow-x: auto; } /* ๐ scrolls, never clips */
|
|
154
|
+
.terminal .prompt { opacity: 1; color: #8e7a69; margin-inline-end: 0.6em; font-size: 13.5px; } /* ๐ฒ */
|
|
155
|
+
.terminal .code { display: inline; overflow: visible; font-size: 13.5px; line-height: 1.4; white-space: pre; } /* โจ๏ธ Roboto Mono 13.5/1.4 */
|
|
156
|
+
.termPkg { color: #e7c8a5; } /* ๐ฆ */
|
|
157
|
+
@media (max-width: 767px) {
|
|
158
|
+
.terminal .panel { padding: 12px 14px 13px; } /* ๐ฑ */
|
|
159
|
+
.terminal .prompt, .terminal .code { font-size: 13px; }
|
|
160
|
+
}
|
package/ab-kbd/index.tsx
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
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: AbKbd (G44)
|
|
28
|
+
* @file: ab-kbd/index.tsx
|
|
29
|
+
* @type: React Component (server-safe)
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*
|
|
32
|
+
* Example usage:
|
|
33
|
+
* <AbKbd keys={['โ', 'K']} />
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/*
|
|
37
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
38
|
+
* MOTTO: We'll always do more ๐!!!
|
|
39
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
// โ๏ธ React
|
|
43
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
44
|
+
// ๐งต classes
|
|
45
|
+
import clsx from 'clsx';
|
|
46
|
+
// ๐จ styles
|
|
47
|
+
import styles from './styles.module.css';
|
|
48
|
+
|
|
49
|
+
/** โ๏ธ props */
|
|
50
|
+
export interface AbKbdProps {
|
|
51
|
+
keys?: string[]; // โจ๏ธ e.g. ['โ', 'K'] โ one <kbd> per key, nested in an outer <kbd>
|
|
52
|
+
children?: ReactNode; // โ๏ธ or plain content
|
|
53
|
+
className?: string; // ๐ท๏ธ
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** โจ๏ธ AbKbd: a keyboard hint (`<kbd>`), no hooks, so it renders on the server too. */
|
|
57
|
+
const AbKbd = ({ keys, children, className }: AbKbdProps): ReactElement => (
|
|
58
|
+
<kbd className={clsx('AbKbd', styles.abKbd, className)} data-ab-part="kbd">
|
|
59
|
+
{keys ? keys.map((k, i) => <kbd key={`${k}-${i}`} className={styles.abKbdKey}>{k}</kbd>) : children}
|
|
60
|
+
</kbd>
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// ๐ฆ exports
|
|
64
|
+
export default AbKbd;
|
|
65
|
+
export { AbKbd };
|
|
@@ -0,0 +1,55 @@
|
|
|
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: AbKbd - Styles (G44)
|
|
28
|
+
* @file: ab-kbd/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
|
+
/* โจ๏ธ outer hint */
|
|
40
|
+
.abKbd {
|
|
41
|
+
display: inline-flex; /* ๐ */
|
|
42
|
+
gap: 2px; /* โ๏ธ */
|
|
43
|
+
font: 500 12px/1 var(--ab-font-code, var(--ab-font-mono, ui-monospace, monospace)); /* ๐ค theme 0.3.4 code font */
|
|
44
|
+
color: var(--ab-color-on-surface-variant, inherit); /* ๐๏ธ */
|
|
45
|
+
}
|
|
46
|
+
/* ๐ one key */
|
|
47
|
+
.abKbdKey {
|
|
48
|
+
min-width: 20px; /* ๐ */
|
|
49
|
+
padding: 3px 5px; /* ๐ฆ */
|
|
50
|
+
border: 1px solid var(--ab-color-border, var(--ab-color-outline-variant, rgb(0 0 0 / 0.15))); /* ๐ผ๏ธ */
|
|
51
|
+
border-radius: 6px; /* ๐ข */
|
|
52
|
+
box-sizing: border-box; /* ๐ฆ */
|
|
53
|
+
text-align: center; /* โ๏ธ */
|
|
54
|
+
font: inherit; /* ๐ค */
|
|
55
|
+
}
|
package/ab-key-feature/index.tsx
CHANGED
|
@@ -8,12 +8,13 @@
|
|
|
8
8
|
* @project: ab-nextjs-components
|
|
9
9
|
* @name: AbKeyFeature - Client (port of lyd-key-feature)
|
|
10
10
|
* @file: ab-key-feature/index.tsx
|
|
11
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
14
|
'use client';
|
|
14
15
|
|
|
15
16
|
import type { ReactElement } from 'react';
|
|
16
|
-
import Link from 'next/link
|
|
17
|
+
import Link from '../ab-link'; // ๐ G42: injectable via AbLinkProvider (default next/link)
|
|
17
18
|
import clsx from 'clsx';
|
|
18
19
|
import styles from './styles.module.css';
|
|
19
20
|
|
|
@@ -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: 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/ab-like-button/index.tsx
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
'use client';
|
|
41
41
|
|
|
42
42
|
import type { CSSProperties, MouseEvent, ReactElement } from 'react';
|
|
43
|
-
import Link from 'next/link
|
|
43
|
+
import Link from '../ab-link'; // ๐ G42: injectable via AbLinkProvider (default next/link)
|
|
44
44
|
import clsx from 'clsx';
|
|
45
45
|
import styles from './styles.module.css';
|
|
46
46
|
import { AB_MOTION } from 'ab-nextjs-animations/motion'; // ๐ฌ transition class names (ab-nextjs-animations >= 0.2.4)
|
|
@@ -0,0 +1,112 @@
|
|
|
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: AbLink + AbLinkProvider (G42)
|
|
28
|
+
* @file: ab-link/index.tsx
|
|
29
|
+
* @type: Component (client) โ injectable link
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*
|
|
32
|
+
* Example usage:
|
|
33
|
+
* 1+|> import { Link } from 'ab-nextjs-i18n/navigation'
|
|
34
|
+
* -|> <AbLinkProvider component={Link}><AbSidebar sections={โฆ} /></AbLinkProvider>
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
39
|
+
* MOTTO: We'll always do more ๐!!!
|
|
40
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
'use client';
|
|
44
|
+
|
|
45
|
+
// โ๏ธ React
|
|
46
|
+
import { createContext, createElement, useContext, type ComponentProps, type ComponentType, type ReactElement, type ReactNode } from 'react';
|
|
47
|
+
// ๐ pure, server-safe locale helper (0.1.13)
|
|
48
|
+
import { stripAbLocalePrefix } from './locale';
|
|
49
|
+
export { stripAbLocalePrefix };
|
|
50
|
+
// ๐ the default link (the ONLY next/link import in the package, see __tests__/ab-link.test.tsx)
|
|
51
|
+
import NextLink from 'next/link';
|
|
52
|
+
|
|
53
|
+
/** ๐ Any Link-like component: takes next/link's props (`href`, `prefetch`, `replace`, โฆ). */
|
|
54
|
+
export type AbLinkComponent = ComponentType<ComponentProps<typeof NextLink>>;
|
|
55
|
+
/** ๐๏ธ AbLink props = next/link props. */
|
|
56
|
+
export type AbLinkProps = ComponentProps<typeof NextLink>;
|
|
57
|
+
|
|
58
|
+
// ๐ง context: null = use next/link
|
|
59
|
+
const AbLinkContext = createContext<AbLinkComponent | null>(null);
|
|
60
|
+
// ๐ 0.1.13 (Joseph #10): the app's locale codes, so active states can ignore the `/fr` prefix
|
|
61
|
+
const AbLocalesContext = createContext<readonly string[]>([]);
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
/** ๐ช useAbLocales โ the locale codes given to the nearest {@link AbLinkProvider} (default none). */
|
|
65
|
+
export function useAbLocales(): readonly string[] {
|
|
66
|
+
return useContext(AbLocalesContext); // ๐
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** ๐งฉ 0.1.13 (Joseph #9): the STRUCTURAL shape a provided link needs: an `href` (any type, e.g. next-intl's
|
|
70
|
+
* `string | { pathname, query }`) and children. next/link, next-intl's Link, ab-nextjs-i18n's Link all fit. */
|
|
71
|
+
export interface AbLinkLikeProps {
|
|
72
|
+
href?: unknown; // ๐
|
|
73
|
+
children?: ReactNode; // ๐ง
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** โ๏ธ Props of {@link AbLinkProvider}: generic over the link's own props, so no cast is needed. */
|
|
77
|
+
export interface AbLinkProviderProps<P extends AbLinkLikeProps = ComponentProps<typeof NextLink>> {
|
|
78
|
+
/** ๐ the link every Ab component renders, e.g. ab-nextjs-i18n's locale-aware `Link`. */
|
|
79
|
+
component: ComponentType<P>;
|
|
80
|
+
/** ๐ 0.1.13: locale codes (e.g. `routing.locales`), stripped from the pathname for active states. */
|
|
81
|
+
locales?: readonly string[];
|
|
82
|
+
children?: ReactNode;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* ๐ AbLinkProvider โ swaps the link used by every Ab component (sidebar, navbar, menu, tab, app bar, cards, โฆ).
|
|
87
|
+
* Wrap the app (or one layout) once:
|
|
88
|
+
* <AbLinkProvider component={Link}>โฆ</AbLinkProvider> // Link from 'ab-nextjs-i18n/navigation'
|
|
89
|
+
*/
|
|
90
|
+
export function AbLinkProvider<P extends AbLinkLikeProps>({ component, locales, children }: AbLinkProviderProps<P>): ReactElement {
|
|
91
|
+
// ๐ง Ab components always pass next/link-compatible props (href string, className, aria-*, onClick, โฆ)
|
|
92
|
+
const link = <AbLinkContext.Provider value={component as unknown as AbLinkComponent}>{children}</AbLinkContext.Provider>;
|
|
93
|
+
return locales ? <AbLocalesContext.Provider value={locales}>{link}</AbLocalesContext.Provider> : link; // ๐
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** ๐ช useAbLink โ the link component in effect (the provider's, or next/link). */
|
|
97
|
+
export function useAbLink(): AbLinkComponent {
|
|
98
|
+
return useContext(AbLinkContext) ?? (NextLink as AbLinkComponent); // ๐
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* ๐ AbLink โ renders the provided link component (default next/link). Server twins can render it too:
|
|
103
|
+
* it's a client component, so it reads the provider from the client tree above it.
|
|
104
|
+
*/
|
|
105
|
+
export function AbLink(props: AbLinkProps): ReactElement {
|
|
106
|
+
// ๐ the context value is a stable component reference (not created during render), so createElement
|
|
107
|
+
// keeps the react-hooks/static-components rule happy without changing behaviour
|
|
108
|
+
return createElement(useAbLink(), props); // โก๏ธ same props, same ref (React 19 ref-as-prop)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// ๐ฆ exports
|
|
112
|
+
export default AbLink;
|
|
@@ -0,0 +1,53 @@
|
|
|
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: stripAbLocalePrefix (0.1.13)
|
|
28
|
+
* @file: ab-link/locale.ts
|
|
29
|
+
* @type: Server-safe helper
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*
|
|
32
|
+
* Example usage:
|
|
33
|
+
* 1+|> stripAbLocalePrefix('/fr/docs', ['en', 'fr']) // โ '/docs'
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/*
|
|
37
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
38
|
+
* MOTTO: We'll always do more ๐!!!
|
|
39
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
// ๐ 0.1.13 (Joseph #10): no 'use client', so server twins can import it too
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* ๐ stripAbLocalePrefix โ `/fr/docs/core` โ `/docs/core` when `fr` is one of `locales`; `/fr` โ `/`.
|
|
46
|
+
* Only exact locale segments are removed (`/fresh` stays), so it is safe for any path.
|
|
47
|
+
*/
|
|
48
|
+
export function stripAbLocalePrefix(pathname: string, locales: readonly string[] = []): string {
|
|
49
|
+
const seg = /^\/([^/?#]+)/.exec(pathname)?.[1]; // ๐ first segment
|
|
50
|
+
if (!seg || !locales.some((l) => l.toLowerCase() === seg.toLowerCase())) return pathname; // ๐
not a locale
|
|
51
|
+
const rest = pathname.slice(seg.length + 1); // โ๏ธ
|
|
52
|
+
return rest === '' || rest[0] !== '/' ? `/${rest.replace(/^\/?/, '')}` : rest; // ๐งญ keep a leading slash
|
|
53
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
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: AbList + AbListItem (P13)
|
|
28
|
+
* @file: ab-list/index.tsx
|
|
29
|
+
* @type: Server-safe component
|
|
30
|
+
* @authors: Abraham Ukachi <abrahamukachi@gmail.com>
|
|
31
|
+
*
|
|
32
|
+
* Example usage:
|
|
33
|
+
* 1+|> <AbList><AbListItem href="/guides/install" media={<AbIcon name="rocket_launch" />} title="Install AbElements" meta="Getting started" trailing="chevron" /></AbList>
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/*
|
|
37
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
38
|
+
* MOTTO: We'll always do more ๐!!!
|
|
39
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
// โ๏ธ React
|
|
44
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
45
|
+
// ๐งต classes
|
|
46
|
+
import clsx from 'clsx';
|
|
47
|
+
// ๐ the app's link
|
|
48
|
+
import Link from '../ab-link';
|
|
49
|
+
// ๐ฃ the default chevron
|
|
50
|
+
import AbIcon from '../ab-icon';
|
|
51
|
+
// ๐จ styles
|
|
52
|
+
import styles from './styles.module.css';
|
|
53
|
+
|
|
54
|
+
/** โ๏ธ AbList props */
|
|
55
|
+
export interface AbListProps {
|
|
56
|
+
children: ReactNode; // ๐ AbListItem rows
|
|
57
|
+
label?: string; // โฟ optional list name
|
|
58
|
+
className?: string; // ๐ท๏ธ
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** โ๏ธ AbListItem props */
|
|
62
|
+
export interface AbListItemProps {
|
|
63
|
+
title: ReactNode; // ๐ช 13.5/600, one line with ellipsis
|
|
64
|
+
meta?: ReactNode; // ๐งพ 12px faint subline (`<code>` inside = 11px mono muted)
|
|
65
|
+
media?: ReactNode; // ๐ผ๏ธ an icon: shown in a 30px tile (card2 bg, accent-text, 18px)
|
|
66
|
+
badge?: ReactNode; // ๐ท๏ธ a leading 64ร22 badge instead of media ("New", "Improved")
|
|
67
|
+
badgeTone?: 'primary' | 'tonal'; // ๐จ primary = button colours ("New"), tonal = tint ("Improved", default)
|
|
68
|
+
trailing?: 'chevron' | ReactNode; // โก๏ธ 'chevron' = 18px faint chevron_right
|
|
69
|
+
href?: string; // ๐ the whole row becomes one link
|
|
70
|
+
className?: string; // ๐ท๏ธ
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* ๐ AbList (P13): one bordered card of rows (Guides, What's new). Radius 14, hairline border, card bg,
|
|
75
|
+
* soft shadow, rows divided by `--div`. Server-safe.
|
|
76
|
+
*/
|
|
77
|
+
const AbList = ({ children, label, className }: AbListProps): ReactElement => (
|
|
78
|
+
<ul className={clsx('AbList', styles.abList, className)} aria-label={label} data-ab-part="list">{children}</ul>
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* ๐ AbListItem: `media | badge` ยท title + meta ยท `trailing`. A row with `href` is a single link (hover
|
|
83
|
+
* `--hover`, focus-visible inset 2px accent ring). Rows are at least 44px tall (touch target).
|
|
84
|
+
*/
|
|
85
|
+
const AbListItem = ({ title, meta, media, badge, badgeTone = 'tonal', trailing, href, className }: AbListItemProps): ReactElement => {
|
|
86
|
+
const body = (
|
|
87
|
+
<>
|
|
88
|
+
{badge != null ? <span className={styles.abListBadge} data-tone={badgeTone}>{badge}</span>
|
|
89
|
+
: media != null ? <span className={styles.abListMedia} aria-hidden="true">{media}</span> : null}
|
|
90
|
+
<span className={styles.abListText}>
|
|
91
|
+
<span className={styles.abListTitle}>{title}</span>
|
|
92
|
+
{meta != null && <span className={styles.abListMeta}>{meta}</span>}
|
|
93
|
+
</span>
|
|
94
|
+
{trailing === 'chevron' ? <AbIcon name="chevron_right" size={18} className={styles.abListChevron} />
|
|
95
|
+
: trailing != null ? <span className={styles.abListTrailing}>{trailing}</span> : null}
|
|
96
|
+
</>
|
|
97
|
+
);
|
|
98
|
+
return (
|
|
99
|
+
<li className={clsx('AbListItem', styles.abListItem, className)} data-ab-part="list-item">
|
|
100
|
+
{href ? <Link href={href} className={styles.abListRow} data-link="true">{body}</Link> : <div className={styles.abListRow}>{body}</div>}
|
|
101
|
+
</li>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// ๐ฆ exports
|
|
106
|
+
export default AbList;
|
|
107
|
+
export { AbList, AbListItem };
|
|
@@ -0,0 +1,82 @@
|
|
|
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: AbList styles
|
|
28
|
+
* @file: ab-list/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: mock .list / .li-ic / .badge, on the ab-nextjs-theme 0.3.5 home tokens */
|
|
41
|
+
.abList {
|
|
42
|
+
--ab-list-radius: 14px; /* โญ */
|
|
43
|
+
--ab-list-background: var(--ab-color-card, #fff); /* ๐จ --card */
|
|
44
|
+
--ab-list-border: var(--ab-color-border, rgb(92 64 48 / 0.13)); /* โ --border */
|
|
45
|
+
--ab-list-divider: var(--ab-color-div, rgb(92 64 48 / 0.11)); /* โ --div */
|
|
46
|
+
--ab-list-shadow: var(--ab-shadow-card, 0 1px 2px rgb(33 26 22 / 0.05)); /* ๐ --shadow */
|
|
47
|
+
--ab-list-hover: var(--ab-color-hover, rgb(166 124 82 / 0.08)); /* ๐ฑ๏ธ --hover */
|
|
48
|
+
--ab-list-ring: var(--ab-color-accent, #a67c52); /* โฟ --accent */
|
|
49
|
+
--ab-list-text: var(--ab-color-text, #211a16); /* ๐๏ธ */
|
|
50
|
+
--ab-list-muted: var(--ab-color-muted, #6b5b50); /* ๐๏ธ */
|
|
51
|
+
--ab-list-faint: var(--ab-color-faint, #807062); /* ๐๏ธ --faint โฟ AA fallback (James) */
|
|
52
|
+
--ab-list-tile: var(--ab-color-card2, #fbf3ec); /* ๐ผ๏ธ --card2 */
|
|
53
|
+
--ab-list-accent-text: var(--ab-color-accent-text, #8b6340); /* ๐๏ธ --accent-t */
|
|
54
|
+
--ab-list-tint: var(--ab-color-tint, #f4e7db); /* ๐จ --tint */
|
|
55
|
+
--ab-list-btn: var(--ab-color-btn, #a67c52); /* ๐จ --btn */
|
|
56
|
+
--ab-list-btn-text: var(--ab-color-btn-text, #fff); /* ๐จ --btn-t */
|
|
57
|
+
margin: 0; padding: 0; list-style: none; /* ๐งน */
|
|
58
|
+
border: 1px solid var(--ab-list-border); border-radius: var(--ab-list-radius); /* โ */
|
|
59
|
+
background: var(--ab-list-background); box-shadow: var(--ab-list-shadow); overflow: hidden; /* ๐จ */
|
|
60
|
+
color: var(--ab-list-text); /* ๐๏ธ */
|
|
61
|
+
}
|
|
62
|
+
.abListItem { border-top: 1px solid var(--ab-list-divider); } /* โ */
|
|
63
|
+
.abListItem:first-child { border-top: 0; } /* ๐งน */
|
|
64
|
+
.abListRow {
|
|
65
|
+
display: flex; align-items: center; gap: 12px; /* ๐ */
|
|
66
|
+
min-height: 44px; box-sizing: border-box; padding: 11px 14px; /* ๐ฆ touch target */
|
|
67
|
+
color: inherit; text-decoration: none; /* ๐ */
|
|
68
|
+
}
|
|
69
|
+
a.abListRow:hover { background: var(--ab-list-hover); } /* ๐ฑ๏ธ */
|
|
70
|
+
a.abListRow:focus-visible { outline: 2px solid var(--ab-list-ring); outline-offset: -2px; } /* โฟ inset ring */
|
|
71
|
+
.abListItem:first-child a.abListRow:focus-visible { border-radius: calc(var(--ab-list-radius) - 1px) calc(var(--ab-list-radius) - 1px) 0 0; } /* โญ */
|
|
72
|
+
.abListItem:last-child a.abListRow:focus-visible { border-radius: 0 0 calc(var(--ab-list-radius) - 1px) calc(var(--ab-list-radius) - 1px); } /* โญ */
|
|
73
|
+
.abListMedia { flex: none; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--ab-list-tile); color: var(--ab-list-accent-text); } /* ๐ผ๏ธ */
|
|
74
|
+
.abListMedia > *, .abListMedia svg { width: 18px; height: 18px; } /* ๐ฃ 18px icon (an AbIcon, or a raw <svg> at any depth) */
|
|
75
|
+
.abListBadge { flex: none; display: flex; align-items: center; justify-content: center; width: 64px; height: 22px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--ab-list-tint); color: var(--ab-list-accent-text); } /* ๐ท๏ธ Improved */
|
|
76
|
+
.abListBadge[data-tone='primary'] { background: var(--ab-list-btn); color: var(--ab-list-btn-text); } /* ๐ท๏ธ New */
|
|
77
|
+
.abListText { flex: 1; min-width: 0; } /* ๐ */
|
|
78
|
+
.abListTitle { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* ๐ช */
|
|
79
|
+
.abListMeta { display: block; margin-top: 2px; font-size: 12px; line-height: 1.42; color: var(--ab-list-faint); } /* ๐งพ 1.42 (~17px): rows are 59px (first) / 60px (with the divider), like the mock */
|
|
80
|
+
.abListMeta code { font-family: var(--ab-font-code, var(--ab-font-mono, ui-monospace, monospace)); font-size: 11px; color: var(--ab-list-muted); } /* ๐งพ mono pkg */
|
|
81
|
+
.abListChevron { flex: none; width: 18px; height: 18px; color: var(--ab-list-faint); } /* โก๏ธ */
|
|
82
|
+
.abListTrailing { flex: none; color: var(--ab-list-faint); } /* โก๏ธ */
|