ab-nextjs-components 0.2.2 โ†’ 0.3.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.
Files changed (47) hide show
  1. package/README.md +4 -12
  2. package/ab-bottom-drawer/index.tsx +35 -4
  3. package/ab-bottom-drawer/use-ab-swipe-down.ts +125 -0
  4. package/ab-button/helpers.ts +2 -2
  5. package/ab-button/index.tsx +1 -1
  6. package/ab-button/styles.module.css +86 -20
  7. package/ab-carousel/index.tsx +202 -31
  8. package/ab-carousel/styles.module.css +22 -1
  9. package/ab-drawer/kit.module.css +27 -0
  10. package/ab-flow-diagram/frame-scale.tsx +65 -0
  11. package/ab-flow-diagram/helpers.ts +89 -3
  12. package/ab-flow-diagram/index.tsx +116 -3
  13. package/ab-flow-diagram/styles.module.css +112 -1
  14. package/ab-mobile-header/index.tsx +151 -12
  15. package/ab-playground-scene/i18n.module.css +54 -0
  16. package/ab-playground-scene/i18n.tsx +141 -0
  17. package/ab-playground-scene/icons.tsx +96 -0
  18. package/ab-playground-scene/index.tsx +138 -0
  19. package/ab-playground-scene/labels.ts +103 -0
  20. package/ab-playground-scene/scenes.tsx +103 -0
  21. package/ab-playground-scene/styles.module.css +148 -0
  22. package/ab-playground-scene/upgraded.tsx +315 -0
  23. package/ab-playground-scene/welcome.tsx +120 -0
  24. package/ab-theme-mode/index.tsx +82 -0
  25. package/ab-theme-toggle/index.tsx +22 -3
  26. package/index.ts +11 -14
  27. package/package.json +9 -18
  28. package/server/ab-button/index.tsx +3 -2
  29. package/server/index.ts +0 -3
  30. package/types/index.d.ts +8 -6
  31. package/ab-key-feature/index.tsx +0 -61
  32. package/ab-key-feature/styles.module.css +0 -79
  33. package/ab-main-headline/index.tsx +0 -58
  34. package/ab-main-headline/styles.module.css +0 -56
  35. package/ab-preview/index.tsx +0 -79
  36. package/ab-preview/styles.module.css +0 -58
  37. package/ab-switch-back/index.tsx +0 -73
  38. package/ab-switch-back/styles.module.css +0 -77
  39. package/ab-test-hello/index.tsx +0 -38
  40. package/ab-test-hello/styles.module.css +0 -57
  41. package/server/ab-button/styles.module.css +0 -191
  42. package/server/ab-key-feature/index.tsx +0 -60
  43. package/server/ab-key-feature/styles.module.css +0 -79
  44. package/server/ab-switch-back/index.tsx +0 -72
  45. package/server/ab-switch-back/styles.module.css +0 -77
  46. package/server/ab-test-hello/index.tsx +0 -36
  47. package/server/ab-test-hello/styles.module.css +0 -54
@@ -1,79 +0,0 @@
1
- /*
2
- * @license MIT
3
- * ~~~~~~~~~~~~
4
- * ab-nextjs-components
5
- * ~~~~~~~~~~~~
6
- * Copyright (c) 2026 Abraham Ukachi. The abElements Project.
7
- *
8
- * @project: ab-nextjs-components
9
- * @name: AbPreview - Client (Adapt of lyd-preview; db/providers stripped)
10
- * @file: ab-preview/index.tsx
11
- * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
12
- */
13
-
14
- 'use client';
15
-
16
- import type { ReactElement } from 'react';
17
- import Image from 'next/image';
18
- import clsx from 'clsx';
19
- import styles from './styles.module.css';
20
-
21
- export type AbPreviewItem = {
22
- id: string | number;
23
- src: string;
24
- alt?: string;
25
- href?: string;
26
- };
27
-
28
- export interface AbPreviewProps {
29
- className?: string;
30
- hidden?: boolean;
31
- items?: AbPreviewItem[];
32
- emptyLabel?: string;
33
- }
34
-
35
- const AbPreview = ({
36
- className,
37
- hidden = false,
38
- items = [],
39
- emptyLabel = 'No previews',
40
- }: AbPreviewProps): ReactElement => {
41
- if (!items.length) {
42
- return (
43
- <div hidden={hidden} className={clsx('AbPreview', styles.abPreview, className)}>
44
- <div className={styles.abPreviewEmpty}>{emptyLabel}</div>
45
- </div>
46
- );
47
- }
48
-
49
- return (
50
- <div hidden={hidden} className={clsx('AbPreview', styles.abPreview, className)}>
51
- {items.map((item) => {
52
- const inner = (
53
- <Image
54
- className={styles.abPreviewImg}
55
- src={item.src}
56
- alt={item.alt ?? ''}
57
- width={160}
58
- height={160}
59
- unoptimized
60
- />
61
- );
62
- return (
63
- <div key={item.id} className={styles.abPreviewItem}>
64
- {item.href ? (
65
- <a href={item.href} style={{ display: 'contents' }}>
66
- {inner}
67
- </a>
68
- ) : (
69
- inner
70
- )}
71
- </div>
72
- );
73
- })}
74
- </div>
75
- );
76
- };
77
-
78
- export default AbPreview;
79
- export { AbPreview };
@@ -1,58 +0,0 @@
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-preview/styles.module.css
29
- * @type: CSS Stylesheet
30
- * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
- */
32
-
33
- .abPreview {
34
- display: grid;
35
- grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
36
- gap: 0.75rem;
37
- }
38
- .abPreviewItem {
39
- position: relative;
40
- aspect-ratio: 1;
41
- border-radius: 0.85rem;
42
- overflow: hidden;
43
- background: color-mix(in srgb, var(--ab-surface-container, #f3edf7) 100%, transparent);
44
- display: flex;
45
- align-items: center;
46
- justify-content: center;
47
- }
48
- .abPreviewImg {
49
- object-fit: cover;
50
- width: 100%;
51
- height: 100%;
52
- }
53
- .abPreviewEmpty {
54
- font-size: 0.75rem;
55
- opacity: 0.6;
56
- text-align: center;
57
- padding: 0.5rem;
58
- }
@@ -1,73 +0,0 @@
1
- /*
2
- * @license MIT
3
- * ~~~~~~~~~~~~
4
- * ab-nextjs-components
5
- * ~~~~~~~~~~~~
6
- * Copyright (c) 2026 Abraham Ukachi. The abElements Project.
7
- *
8
- * @project: ab-nextjs-components
9
- * @name: AbSwitchBack - Client (port of lyd-switch-back)
10
- * @file: ab-switch-back/index.tsx
11
- * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
12
- */
13
-
14
- 'use client';
15
-
16
- import type { ReactElement, ReactNode } from 'react';
17
- import Link from '../ab-link'; // ๐Ÿ”— G42: injectable via AbLinkProvider (default next/link)
18
- import Image from 'next/image';
19
- import clsx from 'clsx';
20
- import styles from './styles.module.css';
21
-
22
- export interface AbSwitchBackProps {
23
- className?: string;
24
- hidden?: boolean;
25
- switched?: boolean;
26
- image: string;
27
- imageAlt: string;
28
- title?: ReactNode;
29
- description?: ReactNode;
30
- cta1Label: string;
31
- cta1Link: string;
32
- cta2Label: string;
33
- cta2Link: string;
34
- }
35
-
36
- const AbSwitchBack = ({
37
- className,
38
- hidden = false,
39
- switched = false,
40
- image,
41
- imageAlt,
42
- title,
43
- description,
44
- cta1Label,
45
- cta1Link,
46
- cta2Label,
47
- cta2Link,
48
- }: AbSwitchBackProps): ReactElement => {
49
- return (
50
- <section
51
- hidden={hidden}
52
- data-switched={switched ? 'true' : 'false'}
53
- className={clsx('AbSwitchBack', styles.abSwitchBack, className)}
54
- >
55
- <div className={styles.abSwitchBackMedia}>
56
- <Image className={styles.abSwitchBackImage} src={image} alt={imageAlt} width={800} height={600} unoptimized />
57
- </div>
58
- <div className={styles.abSwitchBackCopy}>
59
- {title ? <h2 className={styles.abSwitchBackTitle}>{title}</h2> : null}
60
- {description ? <div className={styles.abSwitchBackDesc}>{description}</div> : null}
61
- <div className={styles.abSwitchBackActions}>
62
- <Link href={cta1Link} className={styles.abSwitchBackCta}>{cta1Label}</Link>
63
- <Link href={cta2Link} className={clsx(styles.abSwitchBackCta, styles.abSwitchBackCtaSecondary)}>
64
- {cta2Label}
65
- </Link>
66
- </div>
67
- </div>
68
- </section>
69
- );
70
- };
71
-
72
- export default AbSwitchBack;
73
- export { AbSwitchBack };
@@ -1,77 +0,0 @@
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-switch-back/styles.module.css
29
- * @type: CSS Stylesheet
30
- * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
- */
32
-
33
- .abSwitchBack {
34
- display: grid;
35
- grid-template-columns: 1fr;
36
- gap: 1.25rem;
37
- align-items: center;
38
- }
39
- @media (min-width: 768px) {
40
- .abSwitchBack {
41
- grid-template-columns: 1fr 1fr;
42
- }
43
- .abSwitchBack[data-switched='true'] .abSwitchBackMedia { order: 2; }
44
- .abSwitchBack[data-switched='true'] .abSwitchBackCopy { order: 1; }
45
- }
46
- .abSwitchBackMedia {
47
- position: relative;
48
- width: 100%;
49
- aspect-ratio: 4 / 3;
50
- border-radius: 1rem;
51
- overflow: hidden;
52
- background: #ddd;
53
- }
54
- .abSwitchBackImage {
55
- object-fit: cover;
56
- width: 100%;
57
- height: 100%;
58
- }
59
- .abSwitchBackCopy { display: flex; flex-direction: column; gap: 0.75rem; }
60
- .abSwitchBackTitle { margin: 0; font-size: 1.5rem; font-weight: 700; }
61
- .abSwitchBackDesc { margin: 0; opacity: 0.8; }
62
- .abSwitchBackActions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
63
- .abSwitchBackCta {
64
- display: inline-flex;
65
- align-items: center;
66
- padding: 0.5rem 1rem;
67
- border-radius: 9999px;
68
- text-decoration: none;
69
- font-weight: 600;
70
- background: var(--ab-primary, #6750a4);
71
- color: #fff;
72
- }
73
- .abSwitchBackCtaSecondary {
74
- background: transparent;
75
- color: var(--ab-primary, #6750a4);
76
- border: 1px solid color-mix(in srgb, var(--ab-primary, #6750a4) 40%, transparent);
77
- }
@@ -1,38 +0,0 @@
1
- /*
2
- * @license MIT
3
- * ~~~~~~~~~~~~
4
- * ab-nextjs-components
5
- * ~~~~~~~~~~~~
6
- * Copyright (c) 2026 Abraham Ukachi. The abElements Project.
7
- *
8
- * @project: ab-nextjs-components
9
- * @name: AbTestHello - Client (port of lyd-test-hello)
10
- * @file: ab-test-hello/index.tsx
11
- * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
12
- */
13
-
14
- 'use client';
15
-
16
- import type { ReactElement } from 'react';
17
- import clsx from 'clsx';
18
- import styles from './styles.module.css';
19
-
20
- export interface AbTestHelloProps {
21
- name: string;
22
- src?: string;
23
- className?: string;
24
- }
25
-
26
- const AbTestHello = ({ name, src, className }: AbTestHelloProps): ReactElement => {
27
- return (
28
- <div id="abTestHello" className={clsx('AbTestHello', styles.abTestHello, className)}>
29
- <h2 className={styles.abTestHelloTitle}>
30
- Hello from <span className={styles.abTestHelloName}>{name}</span>
31
- </h2>
32
- {src ? <span className={styles.abTestHelloSrc}>{src}</span> : null}
33
- </div>
34
- );
35
- };
36
-
37
- export default AbTestHello;
38
- export { AbTestHello };
@@ -1,57 +0,0 @@
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-test-hello/styles.module.css
29
- * @type: CSS Stylesheet
30
- * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
- */
32
-
33
- .abTestHello {
34
- display: flex;
35
- flex-direction: column;
36
- align-items: flex-start;
37
- text-align: left;
38
- padding: 1.5rem;
39
- }
40
- .abTestHelloTitle {
41
- margin: 0;
42
- padding: 0.75rem 0 0.25rem;
43
- font-size: 1rem;
44
- }
45
- .abTestHelloName {
46
- font-family: ui-serif, Georgia, serif;
47
- font-weight: 700;
48
- color: var(--ab-primary, #6750a4);
49
- }
50
- .abTestHelloSrc {
51
- font-family: ui-monospace, monospace;
52
- font-size: 0.875rem;
53
- opacity: 0.5;
54
- }
55
- .abTestHelloSrc:hover {
56
- opacity: 0.9;
57
- }
@@ -1,191 +0,0 @@
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-button/styles.module.css
29
- * @type: CSS
30
- * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
- */
32
-
33
- /*
34
- * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
35
- * MOTTO: We'll always do more ๐Ÿ˜œ!!!
36
- * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37
- */
38
-
39
-
40
- .abButton {
41
- position: relative;
42
- display: inline-flex;
43
- align-items: center;
44
- justify-content: center;
45
- gap: 0.5rem;
46
- width: fit-content;
47
- height: fit-content;
48
- margin: 0;
49
- overflow: hidden;
50
- font-size: 1rem;
51
- line-height: 1.25;
52
- text-decoration: none;
53
- cursor: pointer;
54
- border: none;
55
- background: transparent;
56
- color: inherit;
57
- }
58
-
59
- .abButtonRounded {
60
- border-radius: 9999px;
61
- }
62
-
63
- .isContained {}
64
-
65
- /* ๐Ÿฅ‰ Filled (0.1.12): solid bronze fallback for apps on ab-nextjs-theme < 0.3.3.
66
- * Theme โ‰ฅ 0.3.3 ships `button[data-type="filled"]` (higher specificity), which
67
- * adds the hover / focus / disabled state layers on top of this ๐ŸŽจ */
68
- .isFilled {
69
- --material-icon-color: var(--ab-button-text-color, var(--md-sys-color-on-primary, #fff)); /* ๐ŸŽจ icon = label */
70
-
71
- background: var(--ab-button-background-color, var(--md-sys-color-primary, rgb(133 83 24)));
72
- color: var(--ab-button-text-color, var(--md-sys-color-on-primary, #fff));
73
- font-weight: bold;
74
- }
75
-
76
- .isDisabled {
77
- pointer-events: none;
78
- opacity: 0.6;
79
- }
80
-
81
- .abButtonIcon {
82
- font-size: 1.25rem;
83
- line-height: 1;
84
- }
85
-
86
- .abButtonSpinnerSlot {
87
- position: absolute;
88
- inset: 0;
89
- z-index: 10;
90
- display: flex;
91
- align-items: center;
92
- justify-content: center;
93
- }
94
-
95
- .abButtonSpinner {
96
- /* themed via --ab-button-spinner-color when present */
97
- }
98
-
99
- .hidden { display: none !important; }
100
- .invisible { visibility: hidden; }
101
-
102
- /* ===== G22: start/end icons, badge, aria-disabled ===== */
103
-
104
- /* ๐Ÿ–ผ๏ธ icon slots (any ReactNode, e.g. <AbIcon name="github" />) */
105
- .abButtonSlot {
106
- display: inline-flex; /* ๐Ÿ“ align with label */
107
- flex: none; /* ๐Ÿšซ never squash */
108
- width: 1.25em; /* ๐Ÿ“ icon box */
109
- height: 1.25em; /* ๐Ÿ“ */
110
- align-items: center; /* โ†•๏ธ */
111
- justify-content: center; /* โ†”๏ธ */
112
- }
113
-
114
- /* ๐Ÿท๏ธ "Coming soon" style badge inside the button */
115
- .abButtonBadge {
116
- display: inline-flex; /* ๐Ÿ“ */
117
- align-items: center; /* โ†•๏ธ */
118
- padding: 0.125rem 0.5rem; /* ๐Ÿงฑ */
119
- border-radius: 9999px; /* ๐Ÿ’Š */
120
- font-size: 0.75rem; /* ๐Ÿ”ก small */
121
- font-weight: 600; /* ๐Ÿ’ช */
122
- line-height: 1.2; /* ๐Ÿ“ */
123
- white-space: nowrap; /* ๐Ÿšซ no wrap */
124
- /* โšช neutral tone (default) */
125
- color: var(--ab-color-on-surface-variant, currentColor);
126
- background: var(--ab-color-surface-variant, rgb(0 0 0 / 0.06));
127
- }
128
-
129
- /* ๐Ÿฅ‰ accent tone: small text โ†’ the AA bronze text token (theme 0.3.1) */
130
- .abButtonBadge[data-tone="accent"] {
131
- color: var(--ab-color-bronze-text, #8A6440); /* โ™ฟ 5.02:1 on #fff8f3 */
132
- background: color-mix(in srgb, var(--ab-color-bronze, #A67C52) 14%, transparent); /* ๐ŸŽจ soft wash */
133
- }
134
-
135
- /* ๐Ÿšฆ aria-disabled: looks disabled, stays focusable (no pointer-events:none so tooltips/focus still work) */
136
- .abButton[aria-disabled="true"] {
137
- cursor: not-allowed; /* ๐Ÿšซ */
138
- opacity: 0.6; /* ๐ŸŒซ๏ธ */
139
- }
140
-
141
- /* ๐Ÿ™ˆ visually hidden, still announced */
142
- .srOnly {
143
- position: absolute; /* ๐Ÿ“Œ */
144
- width: 1px; /* ๐Ÿ“ */
145
- height: 1px; /* ๐Ÿ“ */
146
- padding: 0; /* ๐Ÿงน */
147
- margin: -1px; /* ๐Ÿงน */
148
- overflow: hidden; /* โœ‚๏ธ */
149
- clip: rect(0 0 0 0); /* โœ‚๏ธ */
150
- white-space: nowrap; /* ๐Ÿšซ */
151
- border: 0; /* ๐Ÿงน */
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
- }
@@ -1,60 +0,0 @@
1
- /*
2
- * @license MIT
3
- * ~~~~~~~~~~~~
4
- * ab-nextjs-components
5
- * ~~~~~~~~~~~~
6
- * Copyright (c) 2026 Abraham Ukachi. The abElements Project.
7
- *
8
- * @project: ab-nextjs-components
9
- * @name: AbKeyFeature - Server (port of lyd-key-feature)
10
- * @file: server/ab-key-feature/index.tsx
11
- * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
12
- */
13
-
14
-
15
- import type { ReactElement } from 'react';
16
- import Link from '../../ab-link'; // ๐Ÿ”— G42: injectable via AbLinkProvider (default next/link)
17
- import clsx from 'clsx';
18
- import styles from './styles.module.css';
19
-
20
- export interface AbKeyFeatureProps {
21
- className?: string;
22
- hidden?: boolean;
23
- icon: string;
24
- name: string;
25
- title: string;
26
- description?: string;
27
- linkHidden?: boolean;
28
- linkLabel?: string;
29
- link?: string;
30
- watermark?: string;
31
- }
32
-
33
- const AbKeyFeature = ({
34
- className,
35
- hidden = false,
36
- icon,
37
- name,
38
- title,
39
- description,
40
- linkHidden = false,
41
- linkLabel = 'Learn more',
42
- link,
43
- watermark,
44
- }: AbKeyFeatureProps): ReactElement => {
45
- return (
46
- <article hidden={hidden} className={clsx('AbKeyFeature', styles.abKeyFeature, className)}>
47
- <span className={clsx('material-symbols-rounded', styles.abKeyFeatureIcon)} aria-hidden>{icon}</span>
48
- <span className={styles.abKeyFeatureName}>{name}</span>
49
- <h3 className={styles.abKeyFeatureTitle}>{title}</h3>
50
- {description ? <p className={styles.abKeyFeatureDesc}>{description}</p> : null}
51
- {!linkHidden && link ? (
52
- <Link href={link} className={styles.abKeyFeatureLink}>{linkLabel}</Link>
53
- ) : null}
54
- {watermark ? <span className={styles.abKeyFeatureWatermark} aria-hidden>{watermark}</span> : null}
55
- </article>
56
- );
57
- };
58
-
59
- export default AbKeyFeature;
60
- export { AbKeyFeature };