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.
Files changed (145) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +52 -0
  3. package/ab-app-bar/index.tsx +210 -0
  4. package/ab-app-bar/styles.module.css +158 -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-bottom-drawer/index.tsx +71 -0
  10. package/ab-bottom-drawer/styles.module.css +66 -0
  11. package/ab-brand/index.tsx +1 -1
  12. package/ab-breadcrumbs/index.tsx +92 -0
  13. package/ab-breadcrumbs/styles.module.css +54 -0
  14. package/ab-button/helpers.ts +6 -1
  15. package/ab-button/index.tsx +23 -4
  16. package/ab-button/styles.module.css +70 -0
  17. package/ab-card/index.tsx +89 -0
  18. package/ab-card/styles.module.css +68 -0
  19. package/ab-carousel/styles.module.css +1 -1
  20. package/ab-chip/index.tsx +16 -4
  21. package/ab-chip/styles.module.css +12 -1
  22. package/ab-collapsible/index.tsx +1 -1
  23. package/ab-color/index.tsx +1 -0
  24. package/ab-color/styles.module.css +32 -0
  25. package/ab-confirm-drawer/index.tsx +97 -0
  26. package/ab-confirm-drawer/styles.module.css +41 -0
  27. package/ab-demo-box/index.tsx +1 -0
  28. package/ab-demo-box/styles.module.css +32 -0
  29. package/ab-demo-code/index.tsx +1 -0
  30. package/ab-demo-code/styles.module.css +32 -0
  31. package/ab-drawer/index.tsx +307 -0
  32. package/ab-drawer/styles.module.css +127 -0
  33. package/ab-drawer/use-ab-drawer.ts +89 -0
  34. package/ab-drawer-list/index.tsx +118 -0
  35. package/ab-drawer-list/styles.module.css +65 -0
  36. package/ab-flow-diagram/styles.module.css +2 -2
  37. package/ab-icon/builtin.ts +19 -1
  38. package/ab-icon/helpers.ts +37 -0
  39. package/ab-icon/index.tsx +14 -8
  40. package/ab-icon/registrar.tsx +68 -0
  41. package/ab-icon-button/index.tsx +19 -3
  42. package/ab-icon-button/styles.module.css +1 -1
  43. package/ab-image/index.tsx +1 -0
  44. package/ab-image/styles.module.css +32 -0
  45. package/ab-info/index.tsx +2 -1
  46. package/ab-info/styles.module.css +32 -0
  47. package/ab-input/index.tsx +1 -0
  48. package/ab-input/styles.module.css +1 -0
  49. package/ab-install-snippet/index.tsx +51 -29
  50. package/ab-install-snippet/styles.module.css +50 -4
  51. package/ab-kbd/index.tsx +65 -0
  52. package/ab-kbd/styles.module.css +55 -0
  53. package/ab-key-feature/index.tsx +2 -1
  54. package/ab-key-feature/styles.module.css +32 -0
  55. package/ab-like-button/index.tsx +1 -1
  56. package/ab-link/index.tsx +112 -0
  57. package/ab-link/locale.ts +53 -0
  58. package/ab-list/index.tsx +107 -0
  59. package/ab-list/styles.module.css +82 -0
  60. package/ab-locale-switcher/index.tsx +59 -10
  61. package/ab-locale-switcher/styles.module.css +15 -4
  62. package/ab-main-headline/index.tsx +1 -0
  63. package/ab-main-headline/styles.module.css +32 -0
  64. package/ab-menu/index.tsx +6 -5
  65. package/ab-menu/styles.module.css +32 -0
  66. package/ab-name/index.tsx +1 -0
  67. package/ab-name/styles.module.css +32 -0
  68. package/ab-navbar/index.tsx +54 -46
  69. package/ab-navbar/styles.module.css +102 -28
  70. package/ab-navbar/view.tsx +166 -0
  71. package/ab-package-card/index.tsx +141 -0
  72. package/ab-package-card/styles.module.css +81 -0
  73. package/ab-page-paginator/index.tsx +1 -0
  74. package/ab-page-paginator/styles.module.css +32 -0
  75. package/ab-page-switcher/index.tsx +1 -0
  76. package/ab-page-switcher/styles.module.css +32 -0
  77. package/ab-preview/index.tsx +1 -0
  78. package/ab-preview/styles.module.css +32 -0
  79. package/ab-price/index.tsx +1 -0
  80. package/ab-price/styles.module.css +32 -0
  81. package/ab-price-tag/index.tsx +1 -0
  82. package/ab-price-tag/styles.module.css +32 -0
  83. package/ab-product/index.tsx +1 -0
  84. package/ab-product/styles.module.css +32 -0
  85. package/ab-product-item/index.tsx +1 -0
  86. package/ab-product-item/styles.module.css +32 -0
  87. package/ab-search-result/index.tsx +1 -0
  88. package/ab-search-result/styles.module.css +32 -0
  89. package/ab-search-trigger/index.tsx +157 -0
  90. package/ab-search-trigger/styles.module.css +96 -0
  91. package/ab-sidebar/index.tsx +91 -49
  92. package/ab-sidebar/styles.module.css +179 -31
  93. package/ab-sidebar/view.tsx +192 -0
  94. package/ab-switch-back/index.tsx +2 -1
  95. package/ab-switch-back/styles.module.css +32 -0
  96. package/ab-tab/index.tsx +2 -1
  97. package/ab-tab/styles.module.css +32 -0
  98. package/ab-tabs/index.tsx +1 -0
  99. package/ab-tabs/styles.module.css +32 -0
  100. package/ab-test-hello/index.tsx +1 -0
  101. package/ab-test-hello/styles.module.css +32 -0
  102. package/ab-text/index.tsx +1 -0
  103. package/ab-text/styles.module.css +32 -0
  104. package/ab-theme-toggle/index.tsx +21 -6
  105. package/ab-theme-toggle/styles.module.css +18 -3
  106. package/ab-toc/index.tsx +131 -0
  107. package/ab-toc/styles.module.css +66 -0
  108. package/ab-version-switcher/index.tsx +143 -0
  109. package/ab-version-switcher/styles.module.css +76 -0
  110. package/css/chrome-mq.css +32 -0
  111. package/css/doodle.css +32 -0
  112. package/css/logo.css +32 -0
  113. package/css/spinner.css +32 -0
  114. package/css/toast.css +32 -0
  115. package/index.ts +45 -0
  116. package/package.json +42 -10
  117. package/server/ab-avatar/index.tsx +2 -1
  118. package/server/ab-avatar/styles.module.css +32 -0
  119. package/server/ab-badge/index.tsx +1 -0
  120. package/server/ab-badge/styles.module.css +32 -0
  121. package/server/ab-brand/index.tsx +1 -1
  122. package/server/ab-button/index.tsx +6 -2
  123. package/server/ab-button/styles.module.css +39 -0
  124. package/server/ab-icon/index.tsx +13 -8
  125. package/server/ab-key-feature/index.tsx +2 -1
  126. package/server/ab-key-feature/styles.module.css +32 -0
  127. package/server/ab-name/index.tsx +1 -0
  128. package/server/ab-name/styles.module.css +32 -0
  129. package/server/ab-nav-link/index.tsx +2 -1
  130. package/server/ab-nav-link/styles.module.css +32 -0
  131. package/server/ab-navbar/index.tsx +44 -45
  132. package/server/ab-polygon/index.tsx +1 -0
  133. package/server/ab-polygon/styles.module.css +32 -0
  134. package/server/ab-sidebar/index.tsx +44 -49
  135. package/server/ab-switch-back/index.tsx +2 -1
  136. package/server/ab-switch-back/styles.module.css +32 -0
  137. package/server/ab-test-hello/index.tsx +1 -0
  138. package/server/ab-test-hello/styles.module.css +32 -0
  139. package/server/ab-text/index.tsx +1 -0
  140. package/server/ab-text/styles.module.css +32 -0
  141. package/server/index.ts +1 -0
  142. package/styles.css +32 -0
  143. package/types/index.d.ts +54 -0
  144. package/server/ab-navbar/styles.module.css +0 -35
  145. package/server/ab-sidebar/styles.module.css +0 -41
@@ -0,0 +1,166 @@
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: AbNavbar - Shared view (client + server)
28
+ * @file: ab-navbar/view.tsx
29
+ * @type: React Component (no hooks)
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ */
32
+
33
+ /*
34
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
35
+ * MOTTO: We'll always do more 😜!!!
36
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37
+ */
38
+
39
+ // ⚛️ React
40
+ import type { ComponentType, ReactElement } from 'react';
41
+ // 🧵 classes
42
+ import clsx from 'clsx';
43
+ // 🔗 G42: injectable link
44
+ import Link from '../ab-link';
45
+ // 🎨 styles
46
+ import styles from './styles.module.css';
47
+
48
+ /** 🔗 A destination (G41). */
49
+ export interface AbNavbarLinkItem {
50
+ kind: 'link'; // 🏷️
51
+ href: string; // 🔗
52
+ icon: string; // 🔣 AbIcons name: outlined, filled when active
53
+ label: string; // 🏷️
54
+ }
55
+
56
+ /** 🔘 An action, e.g. "Menu" opening a sheet (client only: needs `onSelect`). */
57
+ export interface AbNavbarButtonItem {
58
+ kind: 'button'; // 🏷️
59
+ id: string; // 🆔
60
+ icon: string; // 🔣
61
+ label: string; // 🏷️
62
+ onSelect?: () => void; // 🔔
63
+ expanded?: boolean; // ♿ aria-expanded for sheet toggles
64
+ controls?: string; // ♿ aria-controls
65
+ disabled?: boolean; // 🚫 0.1.13 (Joseph #8, D24/D25): focusable, announced, inert (aria-disabled)
66
+ comingSoon?: boolean | string; // 🚧 0.1.13: inert + a "Coming soon" tag (string = your translated label)
67
+ }
68
+
69
+ /** 🧩 Either kind. */
70
+ export type AbNavbarItem = AbNavbarLinkItem | AbNavbarButtonItem;
71
+
72
+ /** 🕰️ Legacy (≤ 0.1.12) link shape; still accepted via `links`. */
73
+ export type AbNavbarLink = {
74
+ href: string;
75
+ icon: string;
76
+ value: string;
77
+ label: string;
78
+ };
79
+
80
+ /** 🔣 What the view needs from an icon component. */
81
+ export type AbNavbarIconComponent = ComponentType<{ name: string; variant?: 'outlined' | 'filled'; size?: number; className?: string }>;
82
+
83
+ /** ⚙️ Props shared by both twins. */
84
+ export interface AbNavbarBaseProps<I extends AbNavbarItem = AbNavbarItem> {
85
+ className?: string; // 🏷️
86
+ items?: I[]; // 🧩 G41
87
+ activeHref?: string; // 🎯
88
+ locales?: readonly string[]; // 🌍 0.1.13: stripped from the pathname (default: AbLinkProvider's)
89
+ label?: string; // ♿ nav aria-label (default "Primary")
90
+ indicator?: 'pill' | 'none'; // 🎯 0.1.14 (P18): 'none' = no active pill; 25px icons, accent text (the Home bottom nav). Default 'pill'
91
+ blur?: boolean; // 🌫️ 0.1.14 (P18): translucent --bg + 12px backdrop blur + --div top hairline
92
+ // 🕰️ legacy
93
+ type?: 'customer' | 'admin';
94
+ page?: string;
95
+ links?: AbNavbarLink[];
96
+ }
97
+
98
+ /** 🎯 exact match or a parent prefix ("/" only matches itself). */
99
+ export function isAbNavbarActive(href: string, activeHref?: string): boolean {
100
+ if (!activeHref) return false;
101
+ if (href === activeHref) return true;
102
+ return href !== '/' && activeHref.startsWith(`${href.replace(/\/$/, '')}/`);
103
+ }
104
+
105
+ /** 🖼️ Render-only bottom bar used by both twins. */
106
+ export function AbNavbarView({ props, Icon, active }: {
107
+ props: AbNavbarBaseProps;
108
+ Icon: AbNavbarIconComponent;
109
+ active: (href: string, legacyValue?: string) => boolean;
110
+ }): ReactElement {
111
+ const { className, items, links, label = 'Primary', type = 'customer', indicator = 'pill', blur = false } = props;
112
+ const iconSize = indicator === 'none' ? 25 : 24; // 🔣 P18
113
+ // 🕰️ legacy links → link items
114
+ const list: AbNavbarItem[] = items?.length ? items : (links ?? []).map(({ href, icon, label: l }) => ({ kind: 'link', href, icon, label: l }));
115
+ const valueOf = (href: string) => links?.find((l) => l.href === href)?.value;
116
+
117
+ return (
118
+ <nav data-type={type} data-ab-part="bottomBar" className={clsx('AbNavbar', styles.abNavbar, className)} aria-label={label} data-indicator={indicator === 'none' ? 'none' : undefined} data-blur={blur ? 'true' : undefined}>
119
+ <ul className={styles.abNavbarList}>
120
+ {list.map((item) => {
121
+ if (item.kind === 'button') {
122
+ // 🔘 action (🚫 disabled / 🚧 coming soon: stays focusable for the tag, never fires)
123
+ const inert = !!item.disabled || !!item.comingSoon;
124
+ const soon = item.comingSoon ? (typeof item.comingSoon === 'string' ? item.comingSoon : 'Coming soon') : undefined;
125
+ return (
126
+ <li key={item.id}>
127
+ <button
128
+ type="button"
129
+ className={styles.abNavbarLink}
130
+ data-ab-part="item"
131
+ data-kind="button"
132
+ aria-expanded={item.expanded} // ♿
133
+ aria-controls={item.controls} // ♿
134
+ aria-disabled={inert || undefined} // 🚫
135
+ data-coming-soon={item.comingSoon ? 'true' : undefined} // 🚧
136
+ onClick={inert ? undefined : item.onSelect}
137
+ >
138
+ <span className={styles.abNavbarPill}><Icon name={item.icon} variant={item.expanded ? 'filled' : 'outlined'} size={iconSize} /></span>
139
+ <span className={styles.abNavbarLabel}>{item.label}</span>
140
+ {soon && <span className={styles.abNavbarSoon} data-ab-part="badge"><span className={styles.abNavbarSrOnly}>, </span>{soon}</span>}
141
+ </button>
142
+ </li>
143
+ );
144
+ }
145
+ // 🔗 destination
146
+ const on = active(item.href, valueOf(item.href)); // 🎯
147
+ return (
148
+ <li key={item.href}>
149
+ <Link
150
+ href={item.href}
151
+ className={styles.abNavbarLink}
152
+ data-ab-part="item"
153
+ data-kind="link"
154
+ data-active={on ? 'true' : 'false'}
155
+ aria-current={on ? 'page' : undefined} // ♿
156
+ >
157
+ <span className={styles.abNavbarPill}><Icon name={item.icon} variant={on ? 'filled' : 'outlined'} size={iconSize} /></span>
158
+ <span className={styles.abNavbarLabel}>{item.label}</span>
159
+ </Link>
160
+ </li>
161
+ );
162
+ })}
163
+ </ul>
164
+ </nav>
165
+ );
166
+ }
@@ -0,0 +1,141 @@
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: AbPackageCard (G45)
28
+ * @file: ab-package-card/index.tsx
29
+ * @type: React Component (server-safe)
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ *
32
+ * Example usage:
33
+ * <AbPackageCard name="ab-nextjs-hooks" href="/docs/hooks" version="0.1.7" description="React hooks." />
34
+ */
35
+
36
+ /*
37
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
38
+ * MOTTO: We'll always do more 😜!!!
39
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
40
+ */
41
+
42
+ // ⚛️ React
43
+ import type { CSSProperties, ReactElement, ReactNode } from 'react';
44
+ // 🧵 classes
45
+ import clsx from 'clsx';
46
+ // 🃏 base card
47
+ import AbCard from '../ab-card';
48
+ // 🔗 G42 link
49
+ import Link from '../ab-link';
50
+ // 🏷️ footer chips (0.1.14)
51
+ import AbChip from '../ab-chip';
52
+ // 🔣 trailing arrow
53
+ import AbIcon from '../ab-icon';
54
+ // 🎬 motion classes (ab-nextjs-animations ≥ 0.2.4)
55
+ import { AB_MOTION } from 'ab-nextjs-animations/motion';
56
+ import 'ab-nextjs-animations/motion/styles.css';
57
+ // 🎨 styles
58
+ import styles from './styles.module.css';
59
+
60
+ /** ⚙️ props */
61
+ export interface AbPackageCardProps {
62
+ name: string; // 📦 e.g. "ab-nextjs-hooks"
63
+ href: string; // 🔗 docs page (the card's one link)
64
+ description?: ReactNode; // 📝
65
+ version?: string; // 🏷️ e.g. "0.1.7"
66
+ icon?: ReactNode; // 🔣 e.g. <AbIcon name="webhook" />
67
+ media?: ReactNode; // 🖼️ 0.1.13 (Joseph #14): any media (logo, image); wins over `icon`
68
+ id?: string; // 🆔 0.1.13: anchor target
69
+ badge?: ReactNode; // 🔴 e.g. "New"
70
+ tags?: string[]; // 🏷️ e.g. ['client', 'server']
71
+ headingLevel?: 2 | 3 | 4; // ♿
72
+ className?: string; // 🏷️
73
+ // 🏠 0.1.14 (P10, Home spec §4 package card). Passing `preview` or `title` switches to the Home layout:
74
+ // 56px preview tile · 30px icon tile + display title + mono name · clamped description · chips + →
75
+ preview?: ReactNode; // 🖼️ decorative preview tile content (Aa Aa Aa, swatches, a curve…), aria-hidden
76
+ title?: ReactNode; // 🏷️ display name (e.g. "Fonts"); `name` becomes the mono subtitle
77
+ descriptionLines?: number; // ✂️ clamp the description (Home: 2)
78
+ }
79
+
80
+ /**
81
+ * 🧩 0.1.13 (Joseph): `ab-nextjs-components` → `ab-` `nextjs-` `components` with a `<wbr>` after each
82
+ * hyphen, so a narrow card wraps at a hyphen (never mid-word) instead of cutting the name off.
83
+ */
84
+ export function toAbPackageNameParts(name: string): ReactNode[] {
85
+ return name.split(/(?<=-)/).flatMap((part, i) => (i ? [<wbr key={`w${i}`} />, part] : [part])); // ✂️ after each "-"
86
+ }
87
+
88
+ /** 📦 AbPackageCard (G45): a package tile on AbCard (one link, 2px lift on laptop+, none when reduced). */
89
+ const AbPackageCard = (props: AbPackageCardProps): ReactElement => (props.preview != null || props.title != null ? <AbPackageCardHome {...props} /> : <AbPackageCardLegacy {...props} />);
90
+
91
+ /** 🏠 0.1.14 (P10): the Home layout. One link (the title, stretched over the card), focus ring on the card. */
92
+ function AbPackageCardHome({ name, href, description, version, icon, media, id, badge, tags, headingLevel = 3, className, preview, title, descriptionLines }: AbPackageCardProps): ReactElement {
93
+ const H = `h${headingLevel}` as 'h2' | 'h3' | 'h4'; // ♿
94
+ const clamp = descriptionLines ? ({ '--ab-package-card-lines': descriptionLines } as CSSProperties) : undefined; // ✂️
95
+ return (
96
+ <article id={id} className={clsx('AbPackageCard', styles.home, AB_MOTION.interactive, className)} data-ab-part="package-card" data-variant="home">
97
+ {preview != null && <div className={styles.homePreview} aria-hidden="true">{preview}</div> /* 🖼️ decorative */}
98
+ <div className={styles.homeHead}>
99
+ {(media ?? icon) != null && <span className={styles.homeIcon} aria-hidden="true">{media ?? icon}</span>}
100
+ <div className={styles.homeTitles}>
101
+ <H className={styles.homeTitle}><Link href={href} className={styles.homeLink}>{title ?? name}</Link></H>
102
+ {title != null && <code className={styles.homeName}>{name}</code> /* ⌨️ the npm name */}
103
+ </div>
104
+ {badge != null && <span className={styles.homeBadge}>{badge}</span>}
105
+ </div>
106
+ {description != null && <p className={styles.homeDesc} data-clamp={descriptionLines ? 'true' : undefined} style={clamp}>{description}</p>}
107
+ {(version || tags?.length) ? (
108
+ <div className={styles.homeFoot}>
109
+ {version && <AbChip size="sm" shape="rounded" mono tone="accent">v{version}</AbChip>}
110
+ {tags?.map((t) => <AbChip key={t} size="sm" shape="rounded" mono tone="sage" className={styles.homeTag}>{t}</AbChip>)}
111
+ <span className={styles.homeGrow} />
112
+ <AbIcon name="arrow_forward" size={16} className={styles.homeGo} />
113
+ </div>
114
+ ) : null}
115
+ </article>
116
+ );
117
+ }
118
+
119
+ /** 🕰️ ≤ 0.1.13 layout on AbCard. */
120
+ const AbPackageCardLegacy = ({ name, href, description, version, icon, media, id, badge, tags, headingLevel, className }: AbPackageCardProps): ReactElement => (
121
+ <AbCard
122
+ id={id}
123
+ className={className}
124
+ href={href}
125
+ headingLevel={headingLevel}
126
+ media={media ?? icon}
127
+ title={<span className={styles.abPackageCardName} title={name}>{toAbPackageNameParts(name)}</span>}
128
+ eyebrow={badge}
129
+ description={description}
130
+ footer={(version || tags?.length) ? (
131
+ <>
132
+ {version && <code className={styles.abPackageCardVersion}>v{version}</code>}
133
+ {tags?.map((t) => <span key={t} className={styles.abPackageCardTag}>{t}</span>)}
134
+ </>
135
+ ) : undefined}
136
+ />
137
+ );
138
+
139
+ // 📦 exports
140
+ export default AbPackageCard;
141
+ export { AbPackageCard };
@@ -0,0 +1,81 @@
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: AbPackageCard - Styles (G45)
28
+ * @file: ab-package-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
+ .abPackageCardName { font-family: var(--ab-font-code, var(--ab-font-mono, ui-monospace, monospace)); font-size: 16px; overflow-wrap: anywhere; word-break: normal; hyphens: none; display: block; min-width: 0; max-width: 100%; } /* 📦 0.1.13 (Joseph): wraps at the <wbr> after a hyphen first (ab-nextjs-/components); `anywhere` only splits a part that alone is wider than a very narrow card (animations at ~70px), so it never overflows */
40
+ .abPackageCardVersion { font-family: var(--ab-font-code, var(--ab-font-mono, ui-monospace, monospace)); opacity: 0.8; } /* 🏷️ */
41
+ .abPackageCardTag { padding: 0 8px; border-radius: 999px; line-height: 20px; background: var(--ab-color-surface-container-high, rgb(0 0 0 / 0.06)); } /* 🏷️ */
42
+
43
+ /* ===== 🏠 0.1.14 (P10, Home spec §4 package card) ===== */
44
+ .home {
45
+ position: relative; display: flex; flex-direction: column; min-width: 0; box-sizing: border-box; /* 📐 */
46
+ padding: 10px 10px 12px; border: 1px solid var(--ab-color-border, rgb(92 64 48 / 0.13)); border-radius: var(--ab-radius-card, 14px); /* 🔲 */
47
+ background: var(--ab-color-card, #fff); color: var(--ab-color-text, #211a16); box-shadow: var(--ab-shadow-card, 0 1px 2px rgb(33 26 22 / 0.05)); /* 🎨 */
48
+ /* 🎞️ the fade + lift timing comes from ab-nextjs-animations (.ab-motion-interactive on the element) */
49
+ }
50
+ .home:hover { border-color: color-mix(in srgb, var(--ab-color-accent, #a67c52) 40%, transparent); transform: translateY(-1px); } /* 🖱️ */
51
+ .home:has(.homeLink:focus-visible) { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: 2px; } /* ♿ ring on the card */
52
+ .homeLink { color: inherit; text-decoration: none; outline: none; } /* 🔗 */
53
+ .homeLink::after { content: ''; position: absolute; inset: 0; border-radius: inherit; } /* 🖱️ the whole card clicks */
54
+ .homePreview {
55
+ height: 56px; border-radius: var(--ab-radius-tile, 9px); background: var(--ab-color-card2, #fbf3ec); /* 🖼️ */
56
+ display: flex; align-items: center; justify-content: center; gap: 10px; overflow: hidden; color: var(--ab-color-accent-text, #88603d);
57
+ }
58
+ .homeHead { display: flex; align-items: center; gap: 9px; margin-top: 11px; padding: 0 2px; min-width: 0; } /* 📐 */
59
+ .homeIcon {
60
+ flex: none; width: 30px; height: 30px; border-radius: var(--ab-radius-row, 8px); /* 🔲 */
61
+ background: var(--ab-color-tint, #f4e7db); color: var(--ab-color-accent-text, #88603d); display: flex; align-items: center; justify-content: center;
62
+ }
63
+ .homeIcon svg { width: 18px; height: 18px; } /* 🔣 */
64
+ .homeTitles { min-width: 0; } /* ✂️ */
65
+ .homeTitle { margin: 0; font-family: var(--ab-font-title, inherit); font-size: 14px; font-weight: 800; line-height: 1.2; letter-spacing: -0.005em; } /* 🏷️ Mulish */
66
+ .homeName { display: block; margin-top: 1px; font: 400 11px/1.3 var(--ab-font-code, ui-monospace, monospace); color: var(--ab-color-faint, #807062); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* ⌨️ */
67
+ .homeBadge { margin-inline-start: auto; flex: none; } /* 🔴 */
68
+ .homeDesc { margin: 8px 0 0; padding: 0 2px; font-size: 12.5px; line-height: 1.45; color: var(--ab-color-muted, #6b5b50); min-height: 36px; } /* 📝 */
69
+ .homeDesc[data-clamp='true'] { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--ab-package-card-lines, 2); line-clamp: var(--ab-package-card-lines, 2); overflow: hidden; } /* ✂️ */
70
+ .homeFoot { display: flex; align-items: center; margin-top: 10px; padding: 0 2px; } /* 🏷️ */
71
+ .homeTag { margin-inline-start: 6px; } /* 🌿 */
72
+ .homeGrow { flex: 1; } /* ↔️ */
73
+ .homeGo { width: 16px; height: 16px; color: var(--ab-color-faint, #807062); } /* → */
74
+ @media (max-width: 767px) {
75
+ .home { padding: 8px 8px 10px; border-radius: 13px; } /* 📱 */
76
+ .homePreview { height: 44px; }
77
+ .homeHead { margin-top: 9px; }
78
+ .homeDesc { margin-top: 6px; font-size: 12px; }
79
+ .homeFoot { margin-top: 8px; }
80
+ }
81
+ @media (prefers-reduced-motion: reduce) { .home:hover { transform: none; } } /* ♿ no lift */
@@ -8,6 +8,7 @@
8
8
  * @project: ab-nextjs-components
9
9
  * @name: AbPagePaginator - Client (port of lyd-page-paginator)
10
10
  * @file: ab-page-paginator/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-page-paginator/styles.module.css
29
+ * @type: CSS Stylesheet
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ */
32
+
1
33
  .abPagePaginator {
2
34
  display: flex;
3
35
  width: fit-content;
@@ -8,6 +8,7 @@
8
8
  * @project: ab-nextjs-components
9
9
  * @name: AbPageSwitcher - Client (port of lyd-page-switcher)
10
10
  * @file: ab-page-switcher/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-page-switcher/styles.module.css
29
+ * @type: CSS Stylesheet
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ */
32
+
1
33
  .abPageSwitcher {
2
34
  display: inline-flex;
3
35
  align-items: center;
@@ -8,6 +8,7 @@
8
8
  * @project: ab-nextjs-components
9
9
  * @name: AbPreview - Client (Adapt of lyd-preview; db/providers stripped)
10
10
  * @file: ab-preview/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-preview/styles.module.css
29
+ * @type: CSS Stylesheet
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ */
32
+
1
33
  .abPreview {
2
34
  display: grid;
3
35
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
@@ -8,6 +8,7 @@
8
8
  * @project: ab-nextjs-components
9
9
  * @name: AbPrice - Client (port of lyd-price)
10
10
  * @file: ab-price/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-price/styles.module.css
29
+ * @type: CSS Stylesheet
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ */
32
+
1
33
  .abPrice {
2
34
  display: inline-flex;
3
35
  flex-direction: column;
@@ -8,6 +8,7 @@
8
8
  * @project: ab-nextjs-components
9
9
  * @name: AbPriceTag - Client (port of lyd-price-tag)
10
10
  * @file: ab-price-tag/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-price-tag/styles.module.css
29
+ * @type: CSS Stylesheet
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ */
32
+
1
33
  .abPriceTag {
2
34
  display: flex;
3
35
  flex-direction: row;
@@ -8,6 +8,7 @@
8
8
  * @project: ab-nextjs-components
9
9
  * @name: AbProduct - Client (Adapt of lyd-product; db/hooks stripped)
10
10
  * @file: ab-product/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-product/styles.module.css
29
+ * @type: CSS Stylesheet
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ */
32
+
1
33
  .abProduct {
2
34
  display: flex;
3
35
  flex-direction: column;