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
@@ -5,51 +5,162 @@
5
5
  * ~~~~~~~~~~~~
6
6
  * Copyright (c) 2026 Abraham Ukachi. The abElements Project.
7
7
  *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the 'Software'), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
8
26
  * @project: ab-nextjs-components
9
- * @name: AbBalloon - Client (Adapt โ€” title= locked)
27
+ * @name: AbBalloon
10
28
  * @file: ab-balloon/index.tsx
29
+ * @type: Client Component
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ *
32
+ * Example usage:
33
+ * <AbBalloon title="Clear">
34
+ * <button aria-label="Clear">ร—</button>
35
+ * </AbBalloon>
36
+ */
37
+
38
+ /*
39
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
40
+ * MOTTO: We'll always do more ๐Ÿ˜œ!!!
41
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11
42
  */
12
43
 
13
44
  'use client';
14
45
 
15
- import type { ReactElement, ReactNode } from 'react';
46
+ // โš›๏ธ React
47
+ import { cloneElement, isValidElement, useCallback, useEffect, useId, useRef, useState, type FocusEvent, type KeyboardEvent, type ReactElement, type ReactNode } from 'react';
48
+ // ๐Ÿงต classes
16
49
  import clsx from 'clsx';
50
+ // ๐ŸŽฌ the tooltip pops in with the package keyframes (reduced-motion safe in ab-nextjs-animations)
51
+ import 'ab-nextjs-animations/pop-in/styles.css';
52
+ // ๐ŸŽจ styles
17
53
  import styles from './styles.module.css';
18
54
 
55
+ /** โฑ๏ธ hover delay before the balloon shows (focus shows it at once). */
56
+ export const AB_BALLOON_HOVER_DELAY = 300;
57
+
58
+ // โš™๏ธ props
19
59
  export interface AbBalloonProps {
20
- /** Native tooltip text โ€” locked API (`title=`). */
60
+ /** ๐Ÿ’ฌ tooltip text (same prop name as before: `title=`). */
21
61
  title?: string;
22
- className?: string;
23
- hidden?: boolean;
24
- disabled?: boolean;
25
- children: ReactNode;
62
+ /** ๐Ÿงญ side of the trigger (default `top`). */
63
+ placement?: 'top' | 'bottom' | 'start' | 'end';
64
+ /** โฑ๏ธ hover delay in ms (default 300). */
65
+ delay?: number;
66
+ className?: string; // ๐Ÿท๏ธ
67
+ hidden?: boolean; // ๐Ÿ™ˆ render the child alone
68
+ disabled?: boolean; // ๐Ÿšซ no balloon
69
+ children: ReactNode; // ๐ŸŽฏ the trigger (ideally ONE focusable element)
26
70
  }
27
71
 
28
72
  /**
29
- * AbBalloon โ€” Phase 2 Adapt.
30
- * Uses the native `title=` tooltip (locked). Not a port of the LYD hover balloon.
73
+ * ๐ŸŽˆ AbBalloon (0.1.13, accessible) โ€” a real tooltip instead of the native `title=`:
74
+ * - โ™ฟ `role="tooltip"` + `aria-describedby` on the trigger (added to a single element child)
75
+ * - โŒจ๏ธ shows on keyboard focus at once, hides on blur and Escape
76
+ * - ๐Ÿ–ฑ๏ธ shows after a 300ms hover delay, hides on leave
77
+ * - ๐ŸŽฌ `popIn` from ab-nextjs-animations (no motion under prefers-reduced-motion)
78
+ * - ๐Ÿšซ JS off: the balloon shows on `:focus-within` / `:hover` with CSS alone
31
79
  */
32
- const AbBalloon = ({
33
- title,
34
- className,
35
- hidden = false,
36
- disabled = false,
37
- children,
38
- }: AbBalloonProps): ReactElement => {
39
- if (hidden) {
40
- return <>{children}</>;
41
- }
80
+ const AbBalloon = ({ title, placement = 'top', delay = AB_BALLOON_HOVER_DELAY, className, hidden = false, disabled = false, children }: AbBalloonProps): ReactElement => {
81
+ // ๐Ÿ†” tooltip id for aria-describedby
82
+ const id = useId();
83
+ // ๐Ÿ‘๏ธ open state
84
+ const [open, setOpen] = useState(false);
85
+ // โฑ๏ธ hover timer
86
+ const timer = useRef<ReturnType<typeof setTimeout> | null>(null);
87
+ // ๐Ÿงน clear the timer
88
+ const clear = useCallback(() => {
89
+ if (timer.current) clearTimeout(timer.current); // โน๏ธ
90
+ timer.current = null;
91
+ }, []);
92
+ // โ™ฟ reduced motion: no popIn (ab-nextjs-animations/pop-in has no reduced-motion rule)
93
+ const [still, setStill] = useState(false);
94
+ useEffect(() => {
95
+ const mq = window.matchMedia?.('(prefers-reduced-motion: reduce)'); // ๐Ÿ”
96
+ if (!mq) return;
97
+ const sync = () => setStill(mq.matches); // ๐Ÿ”„
98
+ sync();
99
+ mq.addEventListener?.('change', sync); // ๐Ÿ‘‚
100
+ return () => mq.removeEventListener?.('change', sync); // ๐Ÿงน
101
+ }, []);
102
+ // ๐Ÿงน unmount
103
+ useEffect(() => clear, [clear]);
104
+
105
+ // ๐Ÿ™ˆ nothing to show
106
+ if (hidden) return <>{children}</>;
107
+ const active = !disabled && !!title; // โœ…
108
+
109
+ // ๐Ÿ–ฑ๏ธ hover in: wait `delay` ms
110
+ const onPointerEnter = () => {
111
+ if (!active) return;
112
+ clear();
113
+ timer.current = setTimeout(() => setOpen(true), delay); // โฑ๏ธ
114
+ };
115
+ // ๐Ÿ–ฑ๏ธ hover out
116
+ const onPointerLeave = () => {
117
+ clear();
118
+ setOpen(false); // ๐Ÿ‘‹
119
+ };
120
+ // โŒจ๏ธ focus in: show now
121
+ const onFocus = () => {
122
+ if (active) setOpen(true);
123
+ };
124
+ // โŒจ๏ธ focus left the whole balloon
125
+ const onBlur = (e: FocusEvent<HTMLSpanElement>) => {
126
+ if (!e.currentTarget.contains(e.relatedTarget as Node | null)) setOpen(false);
127
+ };
128
+ // โŽ‹ Escape dismisses (WCAG 1.4.13)
129
+ const onKeyDown = (e: KeyboardEvent<HTMLSpanElement>) => {
130
+ if (e.key === 'Escape' && open) {
131
+ clear();
132
+ setOpen(false);
133
+ }
134
+ };
135
+
136
+ // ๐Ÿ”— describe the trigger: a single element child gets aria-describedby
137
+ const trigger = active && isValidElement<{ 'aria-describedby'?: string }>(children)
138
+ ? cloneElement(children, { 'aria-describedby': clsx(children.props['aria-describedby'], id) || undefined })
139
+ : children;
42
140
 
43
141
  return (
44
142
  <span
45
- className={clsx('AbBalloon', styles.abBalloon, className)}
46
- title={disabled ? undefined : title}
47
- data-disabled={disabled ? 'true' : 'false'}
143
+ className={clsx('AbBalloon', styles.abBalloon, className)} // ๐Ÿท๏ธ
144
+ data-disabled={disabled ? 'true' : 'false'} // ๐Ÿšซ
145
+ data-open={open ? 'true' : 'false'} // ๐Ÿ‘๏ธ
146
+ data-placement={placement} // ๐Ÿงญ
147
+ data-ab-part="balloon" // ๐Ÿงฉ
148
+ onPointerEnter={onPointerEnter}
149
+ onPointerLeave={onPointerLeave}
150
+ onFocus={onFocus}
151
+ onBlur={onBlur}
152
+ onKeyDown={onKeyDown}
48
153
  >
49
- {children}
154
+ {trigger}
155
+ {active && (
156
+ <span id={id} role="tooltip" className={clsx(styles.abBalloonTip, open && !still && 'popIn')} data-ab-part="balloon-tip">
157
+ {title}
158
+ </span>
159
+ )}
50
160
  </span>
51
161
  );
52
162
  };
53
163
 
164
+ // ๐Ÿ“ฆ exports
54
165
  export default AbBalloon;
55
166
  export { AbBalloon };
@@ -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) */
@@ -0,0 +1,71 @@
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: AbBottomDrawer (mobile bottom drawer)
28
+ * @file: ab-bottom-drawer/index.tsx
29
+ * @type: Client component
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ *
32
+ * Example usage:
33
+ * 1+|> <AbBottomDrawer {...d.drawerProps} title="Language">โ€ฆ</AbBottomDrawer>
34
+ */
35
+
36
+ /*
37
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
38
+ * MOTTO: We'll always do more ๐Ÿ˜œ!!!
39
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
40
+ */
41
+
42
+
43
+ 'use client';
44
+
45
+ // โš›๏ธ React
46
+ import type { ReactElement } from 'react';
47
+ // ๐Ÿงต classes
48
+ import clsx from 'clsx';
49
+ // ๐Ÿ—„๏ธ built on AbDrawer
50
+ import AbDrawer, { type AbDrawerProps } from '../ab-drawer';
51
+ // ๐ŸŽจ styles
52
+ import styles from './styles.module.css';
53
+
54
+ /** โš™๏ธ props: AbDrawer's, minus `side` (always bottom); scope defaults to the whole app */
55
+ export interface AbBottomDrawerProps extends Omit<AbDrawerProps, 'side'> {
56
+ side?: AbDrawerProps['side']; // ๐Ÿ™ˆ accepted for drop-in use (AbDrawerList `as`), always rendered as bottom
57
+ handle?: boolean; // โž– grab handle at the top (default true; decorative)
58
+ }
59
+
60
+ /**
61
+ * ๐Ÿ“ฑ AbBottomDrawer: the mobile bottom sheet (God's plan: the language picker on mobile, D40). AbDrawer
62
+ * with `side="bottom"`, `scope="app"`, the Home tokens (card surface, hairline top edge, 20px top radius,
63
+ * grab handle, safe-area padding) and at most 560px wide, centred, above 768px.
64
+ */
65
+ const AbBottomDrawer = ({ handle = true, scope = 'app', initialFocus = 'panel', className, ...rest }: AbBottomDrawerProps): ReactElement => (
66
+ <AbDrawer {...rest} scope={scope} initialFocus={initialFocus} side="bottom" className={clsx('AbBottomDrawer', styles.abBottomDrawer, handle && styles.withHandle, className)} />
67
+ );
68
+
69
+ // ๐Ÿ“ฆ exports
70
+ export default AbBottomDrawer;
71
+ export { AbBottomDrawer };
@@ -0,0 +1,66 @@
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: AbBottomDrawer styles
28
+ * @file: ab-bottom-drawer/styles.module.css
29
+ * @type: CSS module
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ */
32
+
33
+ /*
34
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
35
+ * MOTTO: We'll always do more ๐Ÿ˜œ!!!
36
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37
+ */
38
+
39
+
40
+ /* ๐Ÿ“ฑ the sheet: doubled class beats AbDrawer's `.abDrawer[data-side='bottom']` without !important (John's spec) */
41
+ .abBottomDrawer.abBottomDrawer {
42
+ --ab-bottom-drawer-radius: 20px; /* โญ• = the gapped pane radius */
43
+ --ab-bottom-drawer-max-width: 560px; /* ๐Ÿ“ tablet+ */
44
+ background: var(--ab-color-card, #fff); /* ๐ŸŽจ --card */
45
+ color: var(--ab-color-text, #211a16); /* ๐Ÿ–‹๏ธ --text */
46
+ border-top: 1px solid var(--ab-color-sheet-edge, transparent); /* โž– dark: rgba(255,248,245,.08) via theme 0.3.5 */
47
+ border-radius: var(--ab-bottom-drawer-radius) var(--ab-bottom-drawer-radius) 0 0; /* โญ• */
48
+ box-shadow: 0 -8px 28px rgb(25 18 12 / 0.12); /* ๐ŸŒ— */
49
+ padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); /* ๐Ÿ“ฑ 16px + home indicator */
50
+ outline: none; /* ๐ŸŽฏ the sheet takes focus on open: no ring on the sheet itself */
51
+ }
52
+ /* โž– grab handle (decorative): 36ร—4, radius 2 */
53
+ .withHandle.withHandle::before {
54
+ content: ''; display: block; flex: none; /* ๐Ÿงฑ */
55
+ width: 36px; height: 4px; margin: 8px auto 0; border-radius: 2px; /* ๐Ÿ“ */
56
+ background: var(--ab-color-handle, rgb(25 18 12 / 0.18)); /* ๐ŸŽจ dark: rgba(255,248,245,.18) via theme */
57
+ }
58
+ .abBottomDrawer h2 { font-family: var(--ab-font-title, inherit); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; } /* ๐Ÿท๏ธ */
59
+ /* โœ• close: 44px hit area, no border, 8px-radius hover tint (the Home icon buttons); ring on keyboard focus only */
60
+ .abBottomDrawer [data-ab-part='drawer-close'] { inline-size: 44px; block-size: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--ab-color-muted, #6b5b50); }
61
+ .abBottomDrawer [data-ab-part='drawer-close']:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); }
62
+ .abBottomDrawer [data-ab-part='drawer-close']:focus { outline: none; }
63
+ .abBottomDrawer [data-ab-part='drawer-close']:focus-visible { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: 2px; }
64
+ @media (min-width: 768px) {
65
+ .abBottomDrawer.abBottomDrawer { inset-inline: 0; margin-inline: auto; max-width: var(--ab-bottom-drawer-max-width); } /* ๐Ÿ“ centred */
66
+ }
@@ -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';
@@ -0,0 +1,92 @@
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: AbBreadcrumbs (P2)
28
+ * @file: ab-breadcrumbs/index.tsx
29
+ * @type: Server-safe component
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ *
32
+ * Example usage:
33
+ * 1+|> <AbBreadcrumbs items={[{ label: "Docs", href: "/docs" }, { label: "Home" }]} />
34
+ */
35
+
36
+ /*
37
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
38
+ * MOTTO: We'll always do more ๐Ÿ˜œ!!!
39
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
40
+ */
41
+
42
+
43
+ // โš›๏ธ React
44
+ import type { ReactElement, ReactNode } from 'react';
45
+ // ๐Ÿงต classes
46
+ import clsx from 'clsx';
47
+ // ๐Ÿ”— the app's link (AbLinkProvider)
48
+ import Link from '../ab-link';
49
+ // ๐Ÿ”ฃ separators
50
+ import AbIcon from '../ab-icon';
51
+ // ๐ŸŽจ styles
52
+ import styles from './styles.module.css';
53
+
54
+ /** ๐Ÿž one crumb */
55
+ export interface AbBreadcrumbItem {
56
+ label: ReactNode; // ๐Ÿท๏ธ
57
+ href?: string; // ๐Ÿ”— omitted on the last (current) crumb
58
+ }
59
+
60
+ /** โš™๏ธ props */
61
+ export interface AbBreadcrumbsProps {
62
+ items: readonly AbBreadcrumbItem[]; // ๐Ÿž first โ†’ current
63
+ label?: string; // โ™ฟ nav name (default "Breadcrumb")
64
+ className?: string; // ๐Ÿท๏ธ
65
+ }
66
+
67
+ /**
68
+ * ๐Ÿž AbBreadcrumbs (P2): the tablet main bar's "Docs โ€บ **Home**". 13px faint links, the last crumb is the
69
+ * current page (650, text colour, `aria-current="page"`), 16px `chevron_right` separators (hidden from AT).
70
+ * Server-safe: no hooks.
71
+ */
72
+ const AbBreadcrumbs = ({ items, label = 'Breadcrumb', className }: AbBreadcrumbsProps): ReactElement => (
73
+ <nav aria-label={label} className={clsx('AbBreadcrumbs', styles.abCrumbs, className)} data-ab-part="breadcrumbs">
74
+ <ol className={styles.abCrumbsList}>
75
+ {items.map((it, i) => {
76
+ const last = i === items.length - 1; // ๐ŸŽฏ current page
77
+ return (
78
+ <li key={i} className={styles.abCrumb}>
79
+ {i > 0 && <AbIcon name="chevron_right" size={16} className={styles.abCrumbSep} />}
80
+ {last ? <span className={styles.abCrumbCurrent} aria-current="page">{it.label}</span>
81
+ : it.href ? <Link href={it.href} className={styles.abCrumbLink}>{it.label}</Link>
82
+ : <span>{it.label}</span>}
83
+ </li>
84
+ );
85
+ })}
86
+ </ol>
87
+ </nav>
88
+ );
89
+
90
+ // ๐Ÿ“ฆ exports
91
+ export default AbBreadcrumbs;
92
+ export { AbBreadcrumbs };
@@ -0,0 +1,54 @@
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: AbBreadcrumbs styles
28
+ * @file: ab-breadcrumbs/styles.module.css
29
+ * @type: CSS module
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ */
32
+
33
+ /*
34
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
35
+ * MOTTO: We'll always do more ๐Ÿ˜œ!!!
36
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37
+ */
38
+
39
+
40
+ /* ๐ŸŽš๏ธ knobs (mock .crumb; theme tokens from ab-nextjs-theme 0.3.5) */
41
+ .abCrumbs {
42
+ --ab-crumbs-color: var(--ab-color-faint, #807062); /* ๐Ÿ–‹๏ธ --faint โ™ฟ AA fallback (James) */
43
+ --ab-crumbs-current: var(--ab-color-text, var(--ab-color-on-surface, #211a16)); /* ๐Ÿ–‹๏ธ --text */
44
+ --ab-crumbs-hover: var(--ab-color-accent-text, var(--ab-color-bronze-text, #8b6340)); /* ๐Ÿ–ฑ๏ธ --accent-t */
45
+ --ab-crumbs-ring: var(--ab-color-accent, var(--ab-color-bronze, #a67c52)); /* โ™ฟ --accent */
46
+ min-width: 0; font-size: 13px; color: var(--ab-crumbs-color); /* ๐Ÿ”ค */
47
+ }
48
+ .abCrumbsList { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; min-width: 0; } /* ๐Ÿ“ */
49
+ .abCrumb { display: inline-flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; } /* ๐Ÿž */
50
+ .abCrumbSep { width: 16px; height: 16px; flex: none; } /* โ€บ */
51
+ .abCrumbCurrent { color: var(--ab-crumbs-current); font-weight: 650; overflow: hidden; text-overflow: ellipsis; } /* ๐ŸŽฏ */
52
+ .abCrumbLink { color: inherit; text-decoration: none; border-radius: 4px; } /* ๐Ÿ”— */
53
+ .abCrumbLink:hover { color: var(--ab-crumbs-hover); } /* ๐Ÿ–ฑ๏ธ */
54
+ .abCrumbLink:focus-visible { outline: 2px solid var(--ab-crumbs-ring); outline-offset: 2px; } /* โ™ฟ */
@@ -39,7 +39,12 @@
39
39
  // ๐ŸŽจ visual types shared by the client + server twins
40
40
  // ๐Ÿฅ‰ 'filled' (0.1.12): solid bronze, painted by ab-nextjs-theme โ‰ฅ 0.3.3's
41
41
  // `button[data-type="filled"]` rule (fallback in styles.module.css โ†’ .isFilled)
42
- export type AbButtonType = 'contained' | 'filled' | 'outlined' | 'text';
42
+ // โšช 'secondary' (0.1.14, P16): the Home "Browse packages" button: --card bg, 1px --border hairline, --text
43
+ export type AbButtonType = 'contained' | 'filled' | 'outlined' | 'text' | 'secondary';
44
+ // ๐Ÿ”ท 0.1.14 (P16): 'pill' = the legacy 999px look (default) ยท 'rounded' = the Home 10px button
45
+ export type AbButtonShape = 'pill' | 'rounded';
46
+ // ๐Ÿ“ 0.1.14 (P16): 'md' = 40px (44px under 768px, the touch CTA); undefined keeps the legacy sizing
47
+ export type AbButtonSize = 'md';
43
48
  // ๐ŸŽจ colour roles
44
49
  export type AbButtonColor = 'primary' | 'secondary' | 'tertiary' | 'white' | 'black';
45
50
  // ๐Ÿท๏ธ badge tones (G22): neutral grey or bronze accent
@@ -54,11 +54,11 @@ import {
54
54
  getAbButtonSrReason,
55
55
  type AbButtonBadgeTone,
56
56
  type AbButtonColor,
57
- type AbButtonType,
57
+ type AbButtonType, type AbButtonShape, type AbButtonSize,
58
58
  } from './helpers';
59
59
 
60
60
  // ๐Ÿ“ฆ re-export the shared types (pre-G22 import paths keep working)
61
- export type { AbButtonBadgeTone, AbButtonColor, AbButtonType, AbButtonDisabledMode } from './helpers';
61
+ export type { AbButtonBadgeTone, AbButtonColor, AbButtonType, AbButtonDisabledMode, AbButtonShape, AbButtonSize } from './helpers';
62
62
 
63
63
  // โš™๏ธ props
64
64
  export interface AbButtonProps {
@@ -71,6 +71,8 @@ export interface AbButtonProps {
71
71
  style?: CSSProperties; // ๐ŸŽจ
72
72
  iconStyle?: CSSProperties; // ๐ŸŽจ Material icon style
73
73
  rounded?: boolean; // ๐Ÿ’Š
74
+ shape?: AbButtonShape; // ๐Ÿ”ท 0.1.14 (P16): 'rounded' = Home 10px radius (overrides `rounded`)
75
+ size?: AbButtonSize; // ๐Ÿ“ 0.1.14 (P16): 'md' = 40px / 44px on touch widths
74
76
  raised?: boolean; // ๐Ÿ”๏ธ
75
77
  shrinks?: boolean; // ๐Ÿค
76
78
  expands?: boolean; // ๐Ÿ”
@@ -91,6 +93,18 @@ export interface AbButtonProps {
91
93
  badgeTone?: AbButtonBadgeTone; // ๐ŸŽจ NEW: 'neutral' (default) | 'accent'
92
94
  disabledReason?: string; // ๐Ÿ’ฌ NEW: SR-only reason, appended to the name while blocked
93
95
  focusableWhenDisabled?: boolean; // โŒจ๏ธ NEW: force aria-disabled (true) or native disabled (false)
96
+ // ===== 0.1.13 (Joseph #7) =====
97
+ // โ™ฟ any aria-* / data-* attribute is passed to the <button>/<a>, e.g. useAbAsideToggle().props
98
+ // (`aria-expanded`, `aria-controls`) or `data-testid`. Our own data-* (type, color, โ€ฆ) still win.
99
+ [aria: `aria-${string}`]: string | number | boolean | undefined;
100
+ [data: `data-${string}`]: string | number | boolean | undefined;
101
+ }
102
+
103
+ /** ๐Ÿ” pick the aria-* / data-* props to forward (0.1.13) */
104
+ function pickAbButtonPassThrough(props: object): Record<string, unknown> {
105
+ const out: Record<string, unknown> = {}; // ๐Ÿ“ฆ
106
+ for (const [k, v] of Object.entries(props)) if (k.startsWith('aria-') || k.startsWith('data-')) out[k] = v; // โ™ฟ ๐Ÿ—‚๏ธ
107
+ return out;
94
108
  }
95
109
 
96
110
  const AbButton = forwardRef<HTMLButtonElement | HTMLAnchorElement, AbButtonProps>(function AbButton(props, ref) {
@@ -105,6 +119,8 @@ const AbButton = forwardRef<HTMLButtonElement | HTMLAnchorElement, AbButtonProps
105
119
  style, // ๐ŸŽจ
106
120
  iconStyle, // ๐ŸŽจ
107
121
  rounded = true, // ๐Ÿ’Š
122
+ shape, // ๐Ÿ”ท
123
+ size, // ๐Ÿ“
108
124
  raised = false, // ๐Ÿ”๏ธ
109
125
  shrinks = false, // ๐Ÿค
110
126
  expands = false, // ๐Ÿ”
@@ -144,8 +160,9 @@ const AbButton = forwardRef<HTMLButtonElement | HTMLAnchorElement, AbButtonProps
144
160
  mode === 'native' && styles.isDisabled, // ๐Ÿšซ
145
161
  );
146
162
 
147
- // ๐Ÿ—‚๏ธ data attributes for styling/tests
163
+ // ๐Ÿ—‚๏ธ data attributes for styling/tests (forwarded aria-* / data-* first, so ours win)
148
164
  const dataAttrs = {
165
+ ...pickAbButtonPassThrough(props), // โ™ฟ 0.1.13
149
166
  'data-type': type, // ๐ŸŽจ
150
167
  'data-raised': raised ? 'true' : 'false', // ๐Ÿ”๏ธ
151
168
  'data-shrinks': shrinks ? 'true' : 'false', // ๐Ÿค
@@ -154,7 +171,9 @@ const AbButton = forwardRef<HTMLButtonElement | HTMLAnchorElement, AbButtonProps
154
171
  'data-iconpos': iconPosition, // โ†”๏ธ
155
172
  'data-color': color, // ๐ŸŽจ
156
173
  'data-disabled-mode': mode, // ๐Ÿšฆ
157
- } as const;
174
+ 'data-shape': shape, // ๐Ÿ”ท P16 (omitted when undefined)
175
+ 'data-size': size, // ๐Ÿ“ P16
176
+ };
158
177
 
159
178
  // ๐Ÿ”ฃ legacy Material icon (decorative)
160
179
  const legacyIcon = withIcon && icon