ab-nextjs-components 0.1.11 โ†’ 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.
Files changed (122) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +30 -0
  3. package/ab-app-bar/index.tsx +181 -0
  4. package/ab-app-bar/styles.module.css +119 -0
  5. package/ab-avatar/index.tsx +2 -1
  6. package/ab-avatar/styles.module.css +32 -0
  7. package/ab-balloon/index.tsx +134 -23
  8. package/ab-balloon/styles.module.css +84 -7
  9. package/ab-brand/index.tsx +1 -1
  10. package/ab-button/helpers.ts +3 -1
  11. package/ab-button/index.tsx +17 -3
  12. package/ab-button/styles.module.css +42 -0
  13. package/ab-card/index.tsx +89 -0
  14. package/ab-card/styles.module.css +68 -0
  15. package/ab-collapsible/index.tsx +1 -1
  16. package/ab-color/index.tsx +1 -0
  17. package/ab-color/styles.module.css +32 -0
  18. package/ab-demo-box/index.tsx +1 -0
  19. package/ab-demo-box/styles.module.css +32 -0
  20. package/ab-demo-code/index.tsx +1 -0
  21. package/ab-demo-code/styles.module.css +32 -0
  22. package/ab-icon/builtin.ts +15 -1
  23. package/ab-icon/helpers.ts +37 -0
  24. package/ab-icon/index.tsx +14 -8
  25. package/ab-icon/registrar.tsx +68 -0
  26. package/ab-icon-button/index.tsx +8 -3
  27. package/ab-image/index.tsx +1 -0
  28. package/ab-image/styles.module.css +32 -0
  29. package/ab-info/index.tsx +2 -1
  30. package/ab-info/styles.module.css +32 -0
  31. package/ab-input/index.tsx +1 -0
  32. package/ab-input/styles.module.css +1 -0
  33. package/ab-install-snippet/styles.module.css +32 -8
  34. package/ab-kbd/index.tsx +65 -0
  35. package/ab-kbd/styles.module.css +55 -0
  36. package/ab-key-feature/index.tsx +2 -1
  37. package/ab-key-feature/styles.module.css +32 -0
  38. package/ab-like-button/index.tsx +1 -1
  39. package/ab-link/index.tsx +112 -0
  40. package/ab-link/locale.ts +53 -0
  41. package/ab-locale-switcher/index.tsx +17 -0
  42. package/ab-locale-switcher/styles.module.css +11 -0
  43. package/ab-main-headline/index.tsx +1 -0
  44. package/ab-main-headline/styles.module.css +32 -0
  45. package/ab-menu/index.tsx +6 -5
  46. package/ab-menu/styles.module.css +32 -0
  47. package/ab-name/index.tsx +1 -0
  48. package/ab-name/styles.module.css +32 -0
  49. package/ab-navbar/index.tsx +54 -46
  50. package/ab-navbar/styles.module.css +84 -28
  51. package/ab-navbar/view.tsx +163 -0
  52. package/ab-package-card/index.tsx +94 -0
  53. package/ab-package-card/styles.module.css +41 -0
  54. package/ab-page-paginator/index.tsx +1 -0
  55. package/ab-page-paginator/styles.module.css +32 -0
  56. package/ab-page-switcher/index.tsx +1 -0
  57. package/ab-page-switcher/styles.module.css +32 -0
  58. package/ab-preview/index.tsx +1 -0
  59. package/ab-preview/styles.module.css +32 -0
  60. package/ab-price/index.tsx +1 -0
  61. package/ab-price/styles.module.css +32 -0
  62. package/ab-price-tag/index.tsx +1 -0
  63. package/ab-price-tag/styles.module.css +32 -0
  64. package/ab-product/index.tsx +1 -0
  65. package/ab-product/styles.module.css +32 -0
  66. package/ab-product-item/index.tsx +1 -0
  67. package/ab-product-item/styles.module.css +32 -0
  68. package/ab-search-result/index.tsx +1 -0
  69. package/ab-search-result/styles.module.css +32 -0
  70. package/ab-search-trigger/index.tsx +142 -0
  71. package/ab-search-trigger/styles.module.css +70 -0
  72. package/ab-sidebar/index.tsx +88 -49
  73. package/ab-sidebar/styles.module.css +136 -31
  74. package/ab-sidebar/view.tsx +182 -0
  75. package/ab-switch-back/index.tsx +2 -1
  76. package/ab-switch-back/styles.module.css +32 -0
  77. package/ab-tab/index.tsx +2 -1
  78. package/ab-tab/styles.module.css +32 -0
  79. package/ab-tabs/index.tsx +1 -0
  80. package/ab-tabs/styles.module.css +32 -0
  81. package/ab-test-hello/index.tsx +1 -0
  82. package/ab-test-hello/styles.module.css +32 -0
  83. package/ab-text/index.tsx +1 -0
  84. package/ab-text/styles.module.css +32 -0
  85. package/ab-toc/index.tsx +124 -0
  86. package/ab-toc/styles.module.css +54 -0
  87. package/css/chrome-mq.css +32 -0
  88. package/css/doodle.css +32 -0
  89. package/css/logo.css +32 -0
  90. package/css/spinner.css +32 -0
  91. package/css/toast.css +32 -0
  92. package/index.ts +18 -0
  93. package/package.json +27 -10
  94. package/server/ab-avatar/index.tsx +2 -1
  95. package/server/ab-avatar/styles.module.css +32 -0
  96. package/server/ab-badge/index.tsx +1 -0
  97. package/server/ab-badge/styles.module.css +32 -0
  98. package/server/ab-brand/index.tsx +1 -1
  99. package/server/ab-button/index.tsx +1 -1
  100. package/server/ab-button/styles.module.css +11 -0
  101. package/server/ab-icon/index.tsx +13 -8
  102. package/server/ab-key-feature/index.tsx +2 -1
  103. package/server/ab-key-feature/styles.module.css +32 -0
  104. package/server/ab-name/index.tsx +1 -0
  105. package/server/ab-name/styles.module.css +32 -0
  106. package/server/ab-nav-link/index.tsx +2 -1
  107. package/server/ab-nav-link/styles.module.css +32 -0
  108. package/server/ab-navbar/index.tsx +44 -45
  109. package/server/ab-polygon/index.tsx +1 -0
  110. package/server/ab-polygon/styles.module.css +32 -0
  111. package/server/ab-sidebar/index.tsx +44 -49
  112. package/server/ab-switch-back/index.tsx +2 -1
  113. package/server/ab-switch-back/styles.module.css +32 -0
  114. package/server/ab-test-hello/index.tsx +1 -0
  115. package/server/ab-test-hello/styles.module.css +32 -0
  116. package/server/ab-text/index.tsx +1 -0
  117. package/server/ab-text/styles.module.css +32 -0
  118. package/server/index.ts +1 -0
  119. package/styles.css +32 -0
  120. package/types/index.d.ts +35 -0
  121. package/server/ab-navbar/styles.module.css +0 -35
  122. package/server/ab-sidebar/styles.module.css +0 -41
@@ -1,12 +1,89 @@
1
- /* AbBalloon โ€” title= Adapt (no hover chrome; native tooltip only) */
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: AbBalloon - Styles
28
+ * @file: ab-balloon/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
+ /* ๐ŸŽˆ wrapper: positions the tip */
2
40
  .abBalloon {
3
- display: inline-flex;
4
- align-items: center;
5
- justify-content: center;
6
- box-sizing: border-box;
7
- max-width: 100%;
41
+ position: relative; /* ๐Ÿ“ */
42
+ display: inline-flex; /* ๐Ÿ“ */
43
+ align-items: center; /* โ†•๏ธ */
44
+ justify-content: center; /* โ†”๏ธ */
45
+ box-sizing: border-box; /* ๐Ÿ“ฆ */
46
+ max-width: 100%; /* ๐Ÿ“ */
47
+ --pop-in-animation-duration: 160ms; /* ๐ŸŽฌ quick pop (package keyframes) */
8
48
  }
9
49
 
10
50
  .abBalloon[data-disabled='true'] {
11
- pointer-events: none;
51
+ pointer-events: none; /* ๐Ÿšซ */
52
+ }
53
+
54
+ /* ๐Ÿ’ฌ the tip: hidden until open (JS) or focus/hover (no JS, see below) */
55
+ .abBalloonTip {
56
+ position: absolute; /* ๐Ÿ“ */
57
+ z-index: 50; /* โฌ†๏ธ */
58
+ display: none; /* ๐Ÿ™ˆ */
59
+ width: max-content; /* ๐Ÿ“ */
60
+ max-width: 240px; /* ๐Ÿ“ */
61
+ padding: 4px 8px; /* ๐Ÿ“ฆ */
62
+ border-radius: 8px; /* ๐ŸŸข */
63
+ background: var(--ab-color-inverse-surface, rgb(54 47 43)); /* ๐ŸŽจ */
64
+ color: var(--ab-color-inverse-on-surface, rgb(251 238 233)); /* ๐Ÿ–‹๏ธ */
65
+ font: 500 12px/16px var(--ab-font-sans, system-ui, sans-serif); /* ๐Ÿ”ค */
66
+ pointer-events: none; /* ๐Ÿ–ฑ๏ธ never steals hover */
67
+ white-space: normal; /* โ†ฉ๏ธ */
68
+ }
69
+
70
+ /* ๐Ÿ‘๏ธ open */
71
+ .abBalloon[data-open='true'] .abBalloonTip {
72
+ display: block;
73
+ }
74
+
75
+ /* ๐Ÿšซ JS off: plain CSS focus / hover */
76
+ @media (scripting: none) {
77
+ .abBalloon:focus-within .abBalloonTip,
78
+ .abBalloon:hover .abBalloonTip {
79
+ display: block;
80
+ }
12
81
  }
82
+
83
+ /* ๐Ÿงญ placement */
84
+ .abBalloon[data-placement='top'] .abBalloonTip { bottom: calc(100% + 6px); left: 50%; translate: -50% 0; }
85
+ .abBalloon[data-placement='bottom'] .abBalloonTip { top: calc(100% + 6px); left: 50%; translate: -50% 0; }
86
+ .abBalloon[data-placement='start'] .abBalloonTip { inset-inline-end: calc(100% + 6px); top: 50%; translate: 0 -50%; }
87
+ .abBalloon[data-placement='end'] .abBalloonTip { inset-inline-start: calc(100% + 6px); top: 50%; translate: 0 -50%; }
88
+
89
+ /* โ™ฟ reduced motion: the component skips the popIn class (pop-in has no reduced-motion rule of its own) */
@@ -40,7 +40,7 @@
40
40
  'use client';
41
41
 
42
42
  import type { CSSProperties, 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 Image from 'next/image';
45
45
  import clsx from 'clsx';
46
46
  import styles from './styles.module.css';
@@ -37,7 +37,9 @@
37
37
  */
38
38
 
39
39
  // ๐ŸŽจ visual types shared by the client + server twins
40
- export type AbButtonType = 'contained' | 'outlined' | 'text';
40
+ // ๐Ÿฅ‰ 'filled' (0.1.12): solid bronze, painted by ab-nextjs-theme โ‰ฅ 0.3.3's
41
+ // `button[data-type="filled"]` rule (fallback in styles.module.css โ†’ .isFilled)
42
+ export type AbButtonType = 'contained' | 'filled' | 'outlined' | 'text';
41
43
  // ๐ŸŽจ colour roles
42
44
  export type AbButtonColor = 'primary' | 'secondary' | 'tertiary' | 'white' | 'black';
43
45
  // ๐Ÿท๏ธ badge tones (G22): neutral grey or bronze accent
@@ -63,7 +63,7 @@ export type { AbButtonBadgeTone, AbButtonColor, AbButtonType, AbButtonDisabledMo
63
63
  // โš™๏ธ props
64
64
  export interface AbButtonProps {
65
65
  id?: string; // ๐Ÿ†”
66
- type?: AbButtonType; // ๐ŸŽจ contained / outlined / text
66
+ type?: AbButtonType; // ๐ŸŽจ contained / filled ๐Ÿฅ‰ / outlined / text
67
67
  htmlType?: 'button' | 'submit' | 'reset'; // ๐Ÿงพ
68
68
  className?: string; // ๐Ÿท๏ธ
69
69
  spinnerClassName?: string; // โณ spinner class
@@ -91,6 +91,18 @@ export interface AbButtonProps {
91
91
  badgeTone?: AbButtonBadgeTone; // ๐ŸŽจ NEW: 'neutral' (default) | 'accent'
92
92
  disabledReason?: string; // ๐Ÿ’ฌ NEW: SR-only reason, appended to the name while blocked
93
93
  focusableWhenDisabled?: boolean; // โŒจ๏ธ NEW: force aria-disabled (true) or native disabled (false)
94
+ // ===== 0.1.13 (Joseph #7) =====
95
+ // โ™ฟ any aria-* / data-* attribute is passed to the <button>/<a>, e.g. useAbAsideToggle().props
96
+ // (`aria-expanded`, `aria-controls`) or `data-testid`. Our own data-* (type, color, โ€ฆ) still win.
97
+ [aria: `aria-${string}`]: string | number | boolean | undefined;
98
+ [data: `data-${string}`]: string | number | boolean | undefined;
99
+ }
100
+
101
+ /** ๐Ÿ” pick the aria-* / data-* props to forward (0.1.13) */
102
+ function pickAbButtonPassThrough(props: object): Record<string, unknown> {
103
+ const out: Record<string, unknown> = {}; // ๐Ÿ“ฆ
104
+ for (const [k, v] of Object.entries(props)) if (k.startsWith('aria-') || k.startsWith('data-')) out[k] = v; // โ™ฟ ๐Ÿ—‚๏ธ
105
+ return out;
94
106
  }
95
107
 
96
108
  const AbButton = forwardRef<HTMLButtonElement | HTMLAnchorElement, AbButtonProps>(function AbButton(props, ref) {
@@ -140,11 +152,13 @@ const AbButton = forwardRef<HTMLButtonElement | HTMLAnchorElement, AbButtonProps
140
152
  className, // ๐Ÿท๏ธ
141
153
  rounded && styles.abButtonRounded, // ๐Ÿ’Š
142
154
  type === 'contained' && styles.isContained, // ๐ŸŽจ
155
+ type === 'filled' && styles.isFilled, // ๐Ÿฅ‰ solid bronze (theme โ‰ฅ 0.3.3 paints it, this is the fallback)
143
156
  mode === 'native' && styles.isDisabled, // ๐Ÿšซ
144
157
  );
145
158
 
146
- // ๐Ÿ—‚๏ธ data attributes for styling/tests
159
+ // ๐Ÿ—‚๏ธ data attributes for styling/tests (forwarded aria-* / data-* first, so ours win)
147
160
  const dataAttrs = {
161
+ ...pickAbButtonPassThrough(props), // โ™ฟ 0.1.13
148
162
  'data-type': type, // ๐ŸŽจ
149
163
  'data-raised': raised ? 'true' : 'false', // ๐Ÿ”๏ธ
150
164
  'data-shrinks': shrinks ? 'true' : 'false', // ๐Ÿค
@@ -153,7 +167,7 @@ const AbButton = forwardRef<HTMLButtonElement | HTMLAnchorElement, AbButtonProps
153
167
  'data-iconpos': iconPosition, // โ†”๏ธ
154
168
  'data-color': color, // ๐ŸŽจ
155
169
  'data-disabled-mode': mode, // ๐Ÿšฆ
156
- } as const;
170
+ };
157
171
 
158
172
  // ๐Ÿ”ฃ legacy Material icon (decorative)
159
173
  const legacyIcon = withIcon && icon
@@ -62,6 +62,17 @@
62
62
 
63
63
  .isContained {}
64
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
+
65
76
  .isDisabled {
66
77
  pointer-events: none;
67
78
  opacity: 0.6;
@@ -139,3 +150,34 @@
139
150
  white-space: nowrap; /* ๐Ÿšซ */
140
151
  border: 0; /* ๐Ÿงน */
141
152
  }
153
+
154
+ /* ๐Ÿ”— 0.1.13 (Joseph #7): link mode. The theme paints `button[data-type]` and `a[role="button"][data-type]`,
155
+ * but a real link (no role=button: it navigates) matched neither, so it rendered at 20px with no padding.
156
+ * These mirror the theme's box rules for <a>, using the same --ab-button-* overrides. */
157
+ a.abButton[data-type="contained"],
158
+ a.abButton[data-type="text"] {
159
+ padding: var(--ab-button-padding, 6px 12px); /* ๐Ÿ“ฆ */
160
+ border-radius: 8px; /* ๐Ÿ”ฒ */
161
+ font-size: 18px; /* ๐Ÿ”ค */
162
+ line-height: 32px; /* ๐Ÿ“ 40px tall */
163
+ }
164
+ a.abButton[data-type="contained"] {
165
+ background: var(--ab-button-background-color, var(--primary-container-color)); /* ๐ŸŽจ */
166
+ color: var(--ab-button-text-color, var(--on-primary-container-color)); /* ๐Ÿ–‹๏ธ */
167
+ }
168
+ a.abButton[data-type="filled"] {
169
+ background: var(--ab-button-background-color, var(--md-sys-color-primary)); /* ๐Ÿฅ‰ */
170
+ color: var(--ab-button-text-color, var(--md-sys-color-on-primary)); /* ๐Ÿ–‹๏ธ */
171
+ padding: var(--ab-button-padding, 6px 16px); /* ๐Ÿ“ฆ */
172
+ border-radius: var(--ab-button-radius, 999px); /* ๐Ÿ’Š */
173
+ font-size: 18px; /* ๐Ÿ”ค */
174
+ line-height: 32px; /* ๐Ÿ“ */
175
+ }
176
+ a.abButton[data-type="outlined"] {
177
+ border: 2px solid var(--ab-button-outline-color, var(--outline-color)); /* โž– */
178
+ border-radius: 8px; /* ๐Ÿ”ฒ */
179
+ padding: 8px 16px; /* ๐Ÿ“ฆ */
180
+ font-size: 18px; /* ๐Ÿ”ค */
181
+ line-height: 32px; /* ๐Ÿ“ */
182
+ }
183
+ a.abButton.abButtonRounded { border-radius: 9999px; } /* ๐Ÿ’Š */
@@ -0,0 +1,89 @@
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: AbCard (G45)
28
+ * @file: ab-card/index.tsx
29
+ * @type: React Component (server-safe)
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ *
32
+ * Example usage:
33
+ * <AbCard href="/docs/hooks" title="Hooks" description="State, media queries and more." />
34
+ */
35
+
36
+ /*
37
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
38
+ * MOTTO: We'll always do more ๐Ÿ˜œ!!!
39
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
40
+ */
41
+
42
+ // โš›๏ธ React
43
+ import type { ComponentType, ReactElement, ReactNode } from 'react';
44
+ // ๐Ÿงต classes
45
+ import clsx from 'clsx';
46
+ // ๐Ÿ”— G42 link
47
+ import Link from '../ab-link';
48
+ // ๐ŸŽฌ hover colours + transform timing from the package (reduced motion โ†’ no transition)
49
+ import 'ab-nextjs-animations/motion/styles.css';
50
+ // ๐ŸŽจ styles
51
+ import styles from './styles.module.css';
52
+
53
+ /** โš™๏ธ props */
54
+ export interface AbCardProps {
55
+ title: ReactNode; // ๐Ÿท๏ธ also the link text (one link per card)
56
+ href?: string; // ๐Ÿ”— the whole card is clickable via the title link's overlay
57
+ description?: ReactNode; // ๐Ÿ“
58
+ eyebrow?: ReactNode; // ๐Ÿ” small label above the title
59
+ media?: ReactNode; // ๐Ÿ–ผ๏ธ icon / image slot
60
+ footer?: ReactNode; // ๐Ÿ”š meta row (must not contain other links: one link per card)
61
+ headingLevel?: 2 | 3 | 4; // โ™ฟ default 3
62
+ className?: string; // ๐Ÿท๏ธ
63
+ as?: 'article' | 'div' | 'li'; // ๐Ÿงฑ default article
64
+ id?: string; // ๐Ÿ†” 0.1.13: e.g. an in-page anchor target
65
+ }
66
+
67
+ /**
68
+ * ๐Ÿƒ AbCard (G45): ONE link (the title) stretched over the card, so screen readers hear one link, not a
69
+ * nested block of them. Hover lift is 2px, laptop and up only, and none under prefers-reduced-motion.
70
+ */
71
+ const AbCard = ({ title, href, description, eyebrow, media, footer, headingLevel = 3, className, as = 'article', id }: AbCardProps): ReactElement => {
72
+ const H = `h${headingLevel}` as unknown as ComponentType<{ className?: string; children?: ReactNode }>; // โ™ฟ
73
+ const Root = as as unknown as ComponentType<Record<string, unknown>>; // ๐Ÿงฑ
74
+ return (
75
+ <Root id={id} className={clsx('AbCard', styles.abCard, 'ab-motion-interactive', className)} data-ab-part="card" data-linked={href ? 'true' : 'false'}>
76
+ {media && <div className={styles.abCardMedia} aria-hidden="true">{media}</div>}
77
+ {eyebrow && <p className={styles.abCardEyebrow}>{eyebrow}</p>}
78
+ <H className={styles.abCardTitle}>
79
+ {href ? <Link href={href} className={styles.abCardLink}>{title}</Link> : title}
80
+ </H>
81
+ {description && <p className={styles.abCardDescription}>{description}</p>}
82
+ {footer && <div className={styles.abCardFooter}>{footer}</div>}
83
+ </Root>
84
+ );
85
+ };
86
+
87
+ // ๐Ÿ“ฆ exports
88
+ export default AbCard;
89
+ export { AbCard };
@@ -0,0 +1,68 @@
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: AbCard - Styles (G45)
28
+ * @file: ab-card/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
+ /* ๐Ÿƒ card */
40
+ .abCard {
41
+ position: relative; /* ๐Ÿ“ overlay anchor */
42
+ display: flex; /* ๐Ÿ“ */
43
+ flex-direction: column; /* โฌ‡๏ธ */
44
+ gap: 8px; /* โ†•๏ธ */
45
+ padding: 20px; /* ๐Ÿ“ฆ */
46
+ border-radius: var(--ab-pane-radius, 16px); /* ๐ŸŸข theme 0.3.4 */
47
+ background: var(--ab-color-surface-container-low, rgb(0 0 0 / 0.03)); /* ๐ŸŽจ */
48
+ color: var(--ab-color-on-surface, inherit); /* ๐Ÿ–‹๏ธ */
49
+ box-sizing: border-box; /* ๐Ÿ“ฆ */
50
+ }
51
+ .abCardMedia { display: flex; color: var(--ab-color-primary, inherit); } /* ๐Ÿ–ผ๏ธ */
52
+ .abCardEyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.75; } /* ๐Ÿ” */
53
+ .abCardTitle { margin: 0; font-size: 18px; font-weight: 600; line-height: 24px; } /* ๐Ÿท๏ธ */
54
+ .abCardDescription { margin: 0; font-size: 14px; line-height: 20px; color: var(--ab-color-on-surface-variant, inherit); } /* ๐Ÿ“ */
55
+ .abCardFooter { margin-top: auto; display: flex; gap: 8px; align-items: center; font-size: 12px; } /* ๐Ÿ”š */
56
+ /* ๐Ÿ”— single link stretched over the card */
57
+ .abCardLink { color: inherit; text-decoration: none; } /* ๐Ÿ”— */
58
+ .abCardLink::after { content: ''; position: absolute; inset: 0; border-radius: inherit; } /* ๐Ÿงฒ whole card clickable */
59
+ .abCard[data-linked='true']:hover { background: var(--ab-color-surface-container, rgb(0 0 0 / 0.06)); } /* ๐Ÿ–ฑ๏ธ */
60
+ .abCard:focus-within:has(.abCardLink:focus-visible) {
61
+ outline: var(--ab-focus-ring-width, 2px) solid var(--ab-color-primary, #8f4c38); /* โ™ฟ ring on the card */
62
+ outline-offset: var(--ab-focus-ring-offset, 2px); /* โ™ฟ */
63
+ }
64
+ .abCardLink:focus-visible { outline: none; } /* โ™ฟ the card shows the ring */
65
+ /* ๐ŸŽˆ 2px lift: laptop+ with a real pointer, and only when motion is OK (gap-review: no motion when reduced) */
66
+ @media (min-width: 1024px) and (hover: hover) and (prefers-reduced-motion: no-preference) {
67
+ .abCard[data-linked='true']:hover { transform: translateY(-2px); } /* ๐ŸŽˆ */
68
+ }
@@ -41,7 +41,7 @@
41
41
 
42
42
  import type { CSSProperties, ReactElement, ReactNode } from 'react';
43
43
  import { useState } from 'react';
44
- import Link from 'next/link';
44
+ import Link from '../ab-link'; // ๐Ÿ”— G42: injectable via AbLinkProvider (default next/link)
45
45
  import clsx from 'clsx';
46
46
  import styles from './styles.module.css';
47
47
  import { AB_MOTION } from 'ab-nextjs-animations/motion'; // ๐ŸŽฌ transition class names (ab-nextjs-animations >= 0.2.4)
@@ -8,6 +8,7 @@
8
8
  * @project: ab-nextjs-components
9
9
  * @name: AbColor - Client (port of lyd-color)
10
10
  * @file: ab-color/index.tsx
11
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
11
12
  */
12
13
 
13
14
  'use client';
@@ -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-color/styles.module.css
29
+ * @type: CSS Stylesheet
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ */
32
+
1
33
  .abColor {
2
34
  display: inline-flex;
3
35
  flex-direction: column;
@@ -8,6 +8,7 @@
8
8
  * @project: ab-nextjs-components
9
9
  * @name: AbDemoBox - Client (port of lyd-demo-box)
10
10
  * @file: ab-demo-box/index.tsx
11
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
11
12
  */
12
13
 
13
14
  'use client';
@@ -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-demo-box/styles.module.css
29
+ * @type: CSS Stylesheet
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ */
32
+
1
33
  .abDemoBox {
2
34
  position: relative;
3
35
  display: flex;
@@ -8,6 +8,7 @@
8
8
  * @project: ab-nextjs-components
9
9
  * @name: AbDemoCode - Client (port of lyd-demo-code; prism soft-optional)
10
10
  * @file: ab-demo-code/index.tsx
11
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
11
12
  */
12
13
 
13
14
  'use client';
@@ -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-demo-code/styles.module.css
29
+ * @type: CSS Stylesheet
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ */
32
+
1
33
  .abDemoCode {
2
34
  position: relative;
3
35
  border-radius: 0.75rem;
@@ -36,7 +36,7 @@
36
36
  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37
37
  */
38
38
 
39
- // ๐Ÿ”ฃ one module per icon (ab-nextjs-icons โ‰ฅ 0.2.3): bundlers keep only these 8
39
+ // ๐Ÿ”ฃ one module per icon (ab-nextjs-icons โ‰ฅ 0.2.3): bundlers keep only these 15
40
40
  import arrowBack from 'ab-nextjs-icons/ab-icons/icons/arrow_back'; // โฎ๏ธ AbCarouselPrev
41
41
  import arrowForward from 'ab-nextjs-icons/ab-icons/icons/arrow_forward'; // โญ๏ธ AbCarouselNext
42
42
  import lightMode from 'ab-nextjs-icons/ab-icons/icons/light_mode'; // ๐ŸŒž AbThemeToggle
@@ -45,6 +45,13 @@ import computer from 'ab-nextjs-icons/ab-icons/icons/computer'; // ๐Ÿ–ฅ๏ธ AbThe
45
45
  import language from 'ab-nextjs-icons/ab-icons/icons/language'; // ๐ŸŒ AbLocaleSwitcher
46
46
  import contentCopy from 'ab-nextjs-icons/ab-icons/icons/content_copy'; // ๐Ÿ“‹ AbInstallSnippet
47
47
  import check from 'ab-nextjs-icons/ab-icons/icons/check'; // โœ… AbInstallSnippet (copied)
48
+ import chevronLeft from 'ab-nextjs-icons/ab-icons/icons/chevron_left'; // โ—€๏ธ AbSidebar collapse (0.1.13)
49
+ import chevronRight from 'ab-nextjs-icons/ab-icons/icons/chevron_right'; // โ–ถ๏ธ AbSidebar expand (0.1.13)
50
+ import menu from 'ab-nextjs-icons/ab-icons/icons/menu'; // โ˜ฐ AbAppBar (0.1.13)
51
+ import moreVert from 'ab-nextjs-icons/ab-icons/icons/more_vert'; // โ‹ฎ AbAppBar "More" (0.1.13)
52
+ import search from 'ab-nextjs-icons/ab-icons/icons/search'; // ๐Ÿ”Ž AbSearchTrigger (0.1.13)
53
+ import close from 'ab-nextjs-icons/ab-icons/icons/close'; // โœ–๏ธ AbPage aside close (0.1.13)
54
+ import expandMore from 'ab-nextjs-icons/ab-icons/icons/expand_more'; // ๐Ÿ”ฝ AbLocaleSwitcher no-JS list (0.1.13)
48
55
  // ๐Ÿงพ shape
49
56
  import type { AbIconSvgData } from './helpers';
50
57
 
@@ -58,4 +65,11 @@ export const AB_ICON_BUILTINS: Record<string, AbIconSvgData> = {
58
65
  language, // ๐ŸŒ
59
66
  content_copy: contentCopy, // ๐Ÿ“‹
60
67
  check, // โœ…
68
+ chevron_left: chevronLeft, // โ—€๏ธ
69
+ chevron_right: chevronRight, // โ–ถ๏ธ
70
+ menu, // โ˜ฐ
71
+ more_vert: moreVert, // โ‹ฎ
72
+ search, // ๐Ÿ”Ž
73
+ close, // โœ–๏ธ
74
+ expand_more: expandMore, // ๐Ÿ”ฝ
61
75
  };
@@ -100,3 +100,40 @@ export function toAbIconSize(size: number | string | undefined): string {
100
100
  if (size == null) return '24px'; // ๐Ÿงญ default 24
101
101
  return typeof size === 'number' ? `${size}px` : size; // ๐Ÿ“
102
102
  }
103
+
104
+
105
+ // ๐Ÿ”• names we already warned about (one warning per name per page load)
106
+ const warned = new Set<string>()
107
+
108
+ /**
109
+ * โš ๏ธ 0.1.13 (G2): warns once in development when a name isn't an AbIcon (registered, explicit `svg`, or in
110
+ * the map). It falls back to the Material Symbols ligature, which shows the NAME as text once the font is gone.
111
+ * Register it with `registerAbIcons({ name: icon })` from `ab-nextjs-icons/ab-icons/icons/<name>`.
112
+ */
113
+ export function warnAbIconMissing(name: string): void {
114
+ if (typeof process !== 'undefined' && process.env?.NODE_ENV === 'production') return // ๐Ÿคซ silent in prod
115
+ if (warned.has(name)) return // ๐Ÿ”• once
116
+ warned.add(name) // ๐Ÿ“
117
+ console.warn(`[AbIcon] "${name}" is not a registered AbIcon. Register it: registerAbIcons({ ${name} }) from 'ab-nextjs-icons/ab-icons/icons/${name}'. (Falling back to the Material Symbols font ligature.)`) // โš ๏ธ
118
+ }
119
+
120
+ /**
121
+ * ๐Ÿ†” 0.1.13 (Joseph): scopeAbIconIds โ€” suffix every `id` in the markup, plus the `url(#โ€ฆ)` / `href="#โ€ฆ"`
122
+ * refs that point at it, so two filled Homes on one page (bottom bar + sidebar) never share a mask.
123
+ * Same rules as ab-nextjs-icons 0.2.4 `scopeAbIconSvgIds` (copied: importing it is fine, but the client
124
+ * bundle rule above says no icon-package imports here). `AbIcon` calls it with React `useId()`.
125
+ */
126
+ export function scopeAbIconIds(markup: string, scope: string): string {
127
+ const ids = Array.from(markup.matchAll(/\sid="([^"]+)"/g), (m) => m[1]); // ๐Ÿ”Ž declared ids
128
+ if (ids.length === 0) return markup; // ๐Ÿ™… most outlined icons
129
+ const suffix = `-${scope.replace(/[^A-Za-z0-9_-]/g, '') || 'x'}`; // ๐Ÿงผ `:r1:` / `ยซr1ยป` โ†’ `-r1`
130
+ let out = markup;
131
+ for (const id of new Set(ids)) {
132
+ const esc = id.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // ๐Ÿ›ก๏ธ regex-escape
133
+ out = out
134
+ .replace(new RegExp(`(\\sid=")${esc}(")`, 'g'), `$1${id}${suffix}$2`) // ๐Ÿ†”
135
+ .replace(new RegExp(`url\\(#${esc}\\)`, 'g'), `url(#${id}${suffix})`) // ๐ŸŽญ
136
+ .replace(new RegExp(`(href=")#${esc}(")`, 'g'), `$1#${id}${suffix}$2`); // ๐Ÿ”—
137
+ }
138
+ return out; // โœ…
139
+ }