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,65 @@
1
+ /*
2
+ * @license MIT
3
+ * ~~~~~~~~~~~~
4
+ * ab-nextjs-components
5
+ * ~~~~~~~~~~~~
6
+ * Copyright (c) 2026 Abraham Ukachi. The abElements Project.
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the 'Software'), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * @project: ab-nextjs-components
27
+ * @name: AbDrawerList styles
28
+ * @file: ab-drawer-list/styles.module.css
29
+ * @type: CSS module
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ */
32
+
33
+ /*
34
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
35
+ * MOTTO: We'll always do more ๐Ÿ˜œ!!!
36
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37
+ */
38
+
39
+
40
+ .abDrawerList { list-style: none; margin: 0 -12px; padding: 0; display: grid; gap: 2px; } /* ๐Ÿ“‹ */
41
+ .abDrawerListItem {
42
+ display: flex; /* ๐Ÿ“ icon ยท text ยท check */
43
+ align-items: center; /* โ†•๏ธ */
44
+ gap: 12px; /* โ†”๏ธ */
45
+ inline-size: 100%; /* โ†”๏ธ */
46
+ min-block-size: 48px; /* ๐Ÿ‘† touch target */
47
+ padding: 8px 12px; /* ๐Ÿ“ฆ */
48
+ border: 0; /* ๐Ÿงน */
49
+ border-radius: 8px; /* ๐Ÿ”ฒ = the Home nav rows */
50
+ background: transparent; /* ๐ŸŽจ */
51
+ color: inherit; /* ๐Ÿ–‹๏ธ */
52
+ font: inherit; /* ๐Ÿ”ค */
53
+ text-align: start; /* โฌ…๏ธ */
54
+ text-decoration: none; /* ๐Ÿšซ */
55
+ cursor: pointer; /* ๐Ÿ–ฑ๏ธ */
56
+ box-sizing: border-box; /* ๐Ÿ“ฆ */
57
+ }
58
+ .abDrawerListItem:hover { background: var(--ab-color-hover, rgb(166 124 82 / 0.08)); } /* ๐Ÿ–ฑ๏ธ --hover */
59
+ .abDrawerListItem[data-active='true'] { background: var(--ab-color-tint, #f4e7db); color: var(--ab-color-accent-text, #8b6340); font-weight: 650; } /* ๐ŸŽฏ = the Home active nav (--tint, --accent-t, 650) */
60
+ .abDrawerListItem:focus-visible { outline: 2px solid var(--ab-color-accent, #a67c52); outline-offset: -2px; } /* โ™ฟ --accent */
61
+ .abDrawerListItem:disabled { opacity: 0.5; cursor: not-allowed; } /* ๐Ÿšซ */
62
+ .abDrawerListIcon { flex: none; display: inline-flex; } /* ๐Ÿ”ฃ */
63
+ .abDrawerListText { flex: 1 1 auto; min-width: 0; display: grid; } /* ๐Ÿท๏ธ */
64
+ .abDrawerListDescription { font-size: 0.875rem; opacity: 0.75; } /* ๐Ÿ“ */
65
+ .abDrawerListCheck { flex: none; inline-size: 1.25em; text-align: center; } /* โœ“ */
@@ -43,7 +43,7 @@
43
43
  width: 100%; /* โ†”๏ธ */
44
44
  aspect-ratio: 760 / 600; /* ๐Ÿ“ mock card */
45
45
  border-radius: 1.25rem; /* ๐Ÿ”ฒ */
46
- border: 1px solid var(--ab-color-outline-variant, rgb(0 0 0 / 0.12)); /* ๐Ÿ–Š๏ธ */
46
+ border: 1px solid var(--ab-color-border, var(--ab-color-outline-variant, rgb(0 0 0 / 0.12))); /* ๐Ÿ–Š๏ธ */
47
47
  background: var(--ab-color-surface-container, transparent); /* ๐ŸŽจ */
48
48
  overflow: hidden; /* โœ‚๏ธ */
49
49
  color: var(--ab-color-on-surface, currentColor); /* ๐ŸŽจ */
@@ -127,7 +127,7 @@
127
127
  /* ๐Ÿ“ scales with the card (cqi = 1% of its width): 760px card โ†’ 13px text, 390px โ†’ 11px; clamped both ways */
128
128
  padding: clamp(0.25rem, 0.8cqi, 0.375rem) clamp(0.4375rem, 1.4cqi, 0.625rem); /* ๐Ÿงฑ */
129
129
  border-radius: clamp(0.5rem, 1.4cqi, 0.625rem); /* ๐Ÿ”ฒ */
130
- border: 1px solid var(--ab-color-outline-variant, rgb(0 0 0 / 0.12)); /* ๐Ÿ–Š๏ธ */
130
+ border: 1px solid var(--ab-color-border, var(--ab-color-outline-variant, rgb(0 0 0 / 0.12))); /* ๐Ÿ–Š๏ธ */
131
131
  background: var(--ab-color-surface, #fff); /* ๐ŸŽจ */
132
132
  font-size: clamp(0.6875rem, 1.75cqi, 0.8125rem); /* ๐Ÿ”ก */
133
133
  white-space: nowrap; /* ๐Ÿšซ wrap */
@@ -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,15 @@ 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)
55
+ import doubleLeft from 'ab-nextjs-icons/ab-icons/icons/keyboard_double_arrow_left'; // โช AbSidebar outlined collapse (0.1.14, P9)
56
+ import doubleRight from 'ab-nextjs-icons/ab-icons/icons/keyboard_double_arrow_right'; // โฉ AbSidebar outlined expand (0.1.14, P9)
48
57
  // ๐Ÿงพ shape
49
58
  import type { AbIconSvgData } from './helpers';
50
59
 
@@ -58,4 +67,13 @@ export const AB_ICON_BUILTINS: Record<string, AbIconSvgData> = {
58
67
  language, // ๐ŸŒ
59
68
  content_copy: contentCopy, // ๐Ÿ“‹
60
69
  check, // โœ…
70
+ chevron_left: chevronLeft, // โ—€๏ธ
71
+ chevron_right: chevronRight, // โ–ถ๏ธ
72
+ menu, // โ˜ฐ
73
+ more_vert: moreVert, // โ‹ฎ
74
+ search, // ๐Ÿ”Ž
75
+ close, // โœ–๏ธ
76
+ expand_more: expandMore, // ๐Ÿ”ฝ
77
+ keyboard_double_arrow_left: doubleLeft, // โช
78
+ keyboard_double_arrow_right: doubleRight, // โฉ
61
79
  };
@@ -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
+ }
package/ab-icon/index.tsx CHANGED
@@ -43,11 +43,11 @@
43
43
  'use client';
44
44
 
45
45
  // โš›๏ธ types
46
- import type { CSSProperties, ReactElement } from 'react';
46
+ import { useId, type CSSProperties, type ReactElement } from 'react';
47
47
  // ๐Ÿงต classes
48
48
  import clsx from 'clsx';
49
49
  // ๐Ÿงฎ shared helpers (NO icon map import: client bundles stay small)
50
- import { getAbIconStroke, getRegisteredAbIcon, pickAbIconMarkup, registerAbIcons, toAbIconSize, type AbIconSvgData, type AbIconVariant, type AbIconWeight } from './helpers';
50
+ import { scopeAbIconIds, warnAbIconMissing, getAbIconStroke, getRegisteredAbIcon, pickAbIconMarkup, registerAbIcons, toAbIconSize, type AbIconSvgData, type AbIconVariant, type AbIconWeight } from './helpers';
51
51
  // ๐Ÿ—‚๏ธ the 8 glyphs components draw themselves (per-icon modules, not the map)
52
52
  import { AB_ICON_BUILTINS } from './builtin';
53
53
  // ๐ŸŽจ styles
@@ -56,13 +56,14 @@ import styles from './styles.module.css';
56
56
  // ๐Ÿ“ฆ helpers for consumers (registerAbIcons, types)
57
57
  export * from './helpers';
58
58
  export { AB_ICON_BUILTINS } from './builtin';
59
+ export { AbIconRegistrar, type AbIconRegistrarProps } from './registrar'; // ๐Ÿ—‚๏ธ server-safe registration (Joseph #11)
59
60
 
60
61
  // ๐Ÿ—‚๏ธ register built-ins at module scope (same on server render + hydration โ†’ no mismatch)
61
62
  registerAbIcons(AB_ICON_BUILTINS);
62
63
 
63
64
  // โš™๏ธ props
64
65
  export interface AbIconProps {
65
- name: string; // ๐Ÿ—‚๏ธ AbIcons name (snake_case); Material ligature fallback if unknown
66
+ name: string; // ๐Ÿ—‚๏ธ AbIcons name (snake_case); AbIcons name (registered / svg / map); unknown = Material ligature fallback + dev warning
66
67
  variant?: AbIconVariant; // ๐ŸŽš๏ธ outlined (default) | filled
67
68
  filled?: boolean; // ๐Ÿ•ฐ๏ธ legacy alias for variant="filled"
68
69
  weight?: AbIconWeight | number; // ๐Ÿ“ 100โ€“700 (outlined), default 200
@@ -74,10 +75,12 @@ export interface AbIconProps {
74
75
  style?: CSSProperties; // ๐ŸŽจ
75
76
  }
76
77
 
77
- /** ๐Ÿ”ฃ AbIcons SVG icon (client): `svg` prop โ†’ registry โ†’ Material ligature fallback. */
78
+ /** ๐Ÿ”ฃ AbIcons SVG icon (client): `svg` prop โ†’ registry โ†’ Material ligature fallback + dev warning. */
78
79
  const AbIcon = ({ name, variant, filled = false, weight, size, label, title, svg, className, style }: AbIconProps): ReactElement => {
79
80
  // ๐Ÿ” resolve markup without the full map
80
81
  const markup = pickAbIconMarkup(svg ?? getRegisteredAbIcon(name), variant ?? (filled ? 'filled' : 'outlined'));
82
+ // ๐Ÿ†” one id per rendered instance (Joseph: a hidden twin's mask broke the active Home)
83
+ const uid = useId();
81
84
  // ๐ŸŽš๏ธ legacy `filled` โ†’ variant
82
85
  const v: AbIconVariant = variant ?? (filled ? 'filled' : 'outlined');
83
86
  // ๐Ÿท๏ธ accessible name: `label` (new) or `title` (legacy)
@@ -98,18 +101,21 @@ const AbIcon = ({ name, variant, filled = false, weight, size, label, title, svg
98
101
  title={title} // ๐Ÿ’ฌ legacy tooltip only
99
102
  {...a11y} // โ™ฟ
100
103
  // ๐Ÿ”’ trusted, package-generated static markup (never user input)
101
- dangerouslySetInnerHTML={{ __html: markup }}
104
+ dangerouslySetInnerHTML={{ __html: scopeAbIconIds(markup, uid) }}
102
105
  />
103
106
  );
104
107
  }
105
108
 
106
- // ๐Ÿ•ฐ๏ธ fallback: Material Symbols ligature (pre-G2 behaviour) for names not in AbIcons
109
+ // ๐Ÿ•ฐ๏ธ 0.1.13 (James review): NON-breaking fallback for unregistered names. A patch must not blank icons,
110
+ // so an unknown name still renders the pre-G2 Material Symbols ligature (needs the app's font), and
111
+ // warns once in development so the missing registration gets fixed before the app drops the font.
112
+ warnAbIconMissing(name);
107
113
  return (
108
114
  <span
109
- className={clsx('material-symbols-rounded', 'icon', styles.abIconFont, className)} // ๐Ÿท๏ธ
115
+ className={clsx('AbIcon', 'material-symbols-rounded', 'icon', styles.abIconFont, className)} // ๐Ÿท๏ธ legacy font class
110
116
  style={{ ...style, fontSize: toAbIconSize(size) }} // ๐Ÿ“
111
- data-filled={v === 'filled' ? 'true' : 'false'} // ๐ŸŽš๏ธ
112
117
  data-icon={name} // ๐Ÿ—‚๏ธ
118
+ data-filled={v === 'filled' ? 'true' : 'false'} // ๐ŸŽš๏ธ
113
119
  data-ab-icon-fallback="font" // ๐Ÿ”Ž easy to audit
114
120
  title={title} // ๐Ÿ’ฌ
115
121
  {...a11y} // โ™ฟ
@@ -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: AbIconRegistrar (0.1.13)
28
+ * @file: ab-icon/registrar.tsx
29
+ * @type: Client Component โ€” server-safe icon registration
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ *
32
+ * Example usage:
33
+ * 1+|> import home from 'ab-nextjs-icons/ab-icons/icons/home'
34
+ * -|> <AbIconRegistrar icons={{ home }} /> // ๐Ÿ—‚๏ธ in a Server Component layout
35
+ */
36
+
37
+ /*
38
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
39
+ * MOTTO: We'll always do more ๐Ÿ˜œ!!!
40
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
41
+ */
42
+
43
+ 'use client';
44
+
45
+ // ๐Ÿ—‚๏ธ the shared client registry
46
+ import { registerAbIcons, type AbIconSvgData } from './helpers';
47
+
48
+ /** โš™๏ธ props: the icons to register (plain strings, so a Server Component can pass them) */
49
+ export interface AbIconRegistrarProps {
50
+ icons: Record<string, AbIconSvgData>; // ๐Ÿ—‚๏ธ e.g. { home, home_filled } from ab-nextjs-icons/ab-icons/icons/*
51
+ }
52
+
53
+ /**
54
+ * ๐Ÿ—‚๏ธ AbIconRegistrar (0.1.13, Joseph #11): the SERVER-SAFE way to register icons.
55
+ * `registerAbIcons` is client-only state, so a Server Component (e.g. app/[locale]/layout.tsx) can't call it.
56
+ * Render this once, ABOVE the icons, and pass the svg data as a prop (it is serializable):
57
+ * import home from 'ab-nextjs-icons/ab-icons/icons/home';
58
+ * <AbIconRegistrar icons={{ home }} />
59
+ * It registers DURING render (idempotent: same name โ†’ same markup), so the server render and hydration see
60
+ * the same set: no mismatch, no effect delay. It renders nothing.
61
+ */
62
+ export function AbIconRegistrar({ icons }: AbIconRegistrarProps): null {
63
+ registerAbIcons(icons); // โž• every render (cheap Map.set, same values)
64
+ return null; // ๐Ÿซฅ
65
+ }
66
+
67
+ // ๐Ÿ“ฆ exports
68
+ export default AbIconRegistrar;
@@ -49,6 +49,8 @@ import { forwardRef } from 'react';
49
49
  import clsx from 'clsx';
50
50
  // ๐ŸŽจ package-shipped CSS module
51
51
  import styles from './styles.module.css';
52
+ // ๐Ÿ”ฃ 0.1.13 (G2, Joseph #6): the glyph is an AbIcon SVG, not the Material Symbols font
53
+ import AbIcon from '../ab-icon';
52
54
  import { AB_MOTION } from 'ab-nextjs-animations/motion'; // ๐ŸŽฌ transition class names (ab-nextjs-animations >= 0.2.4)
53
55
  import 'ab-nextjs-animations/motion/styles.css'; // ๐ŸŽจ .ab-motion-*
54
56
 
@@ -60,8 +62,10 @@ export interface AbIconButtonProps {
60
62
  style?: CSSProperties;
61
63
  // ๐Ÿ™ˆ hide the whole button
62
64
  hidden?: boolean;
63
- // ๐Ÿ”ฃ Material Symbols ligature name (AbIcons-backed AbIcon arrives with G2)
65
+ // ๐Ÿ”ฃ AbIcons name (rendered with AbIcon; unregistered names fall back to the font ligature)
64
66
  icon: string;
67
+ // โฌ› 0.1.13: filled variant (default: filled while `active`)
68
+ iconFilled?: boolean;
65
69
  // ๐Ÿšซ disabled (button: native `disabled`; link: `aria-disabled` + no href)
66
70
  disabled?: boolean;
67
71
  // ๐Ÿ” grow a little on hover
@@ -86,6 +90,12 @@ export interface AbIconButtonProps {
86
90
  title?: string;
87
91
  // ๐Ÿงพ button type
88
92
  type?: 'button' | 'submit' | 'reset';
93
+ // โ™ฟ 0.1.14: disclosure state for menus / drawers / the TOC toggle (button variant)
94
+ 'aria-expanded'?: boolean;
95
+ // โ™ฟ 0.1.14: id of the element this button opens
96
+ 'aria-controls'?: string;
97
+ // ๐Ÿ“ 0.1.14: glyph size in px (default: AbIcon's 24), e.g. 16 for the terminal copy button
98
+ iconSize?: number;
89
99
  }
90
100
 
91
101
  const AbIconButton = forwardRef<HTMLButtonElement, AbIconButtonProps>(function AbIconButton(props, ref) {
@@ -107,6 +117,10 @@ const AbIconButton = forwardRef<HTMLButtonElement, AbIconButtonProps>(function A
107
117
  label, // โ™ฟ
108
118
  title, // ๐Ÿ’ฌ
109
119
  type = 'button', // ๐Ÿงพ
120
+ iconFilled, // โฌ›
121
+ 'aria-expanded': ariaExpanded, // โ™ฟ 0.1.14
122
+ 'aria-controls': ariaControls, // โ™ฟ 0.1.14
123
+ iconSize, // ๐Ÿ“ 0.1.14
110
124
  } = props;
111
125
 
112
126
  // โ™ฟ G6: one accessible name for both variants, ON the interactive element (not the wrapper span)
@@ -115,8 +129,8 @@ const AbIconButton = forwardRef<HTMLButtonElement, AbIconButtonProps>(function A
115
129
  const tooltip = title ?? label;
116
130
  // ๐Ÿท๏ธ classes
117
131
  const classNames = clsx('AbIconButton', 'icon-button', styles.abIconButton, AB_MOTION.interactive, expands && AB_MOTION.lift, shrinks && AB_MOTION.press, className); // ๐ŸŽฌ hover lift / press from ab-nextjs-animations
118
- // ๐Ÿ”ฃ the glyph is decoration: the ligature text ("arrow_back") must never be read aloud
119
- const glyph = <span className={clsx('material-symbols-rounded', 'icon')} aria-hidden="true">{icon}</span>;
132
+ // ๐Ÿ”ฃ the glyph is decoration (the button carries the name): AbIcon without a label is aria-hidden
133
+ const glyph = <AbIcon name={icon} variant={(iconFilled ?? active) ? 'filled' : 'outlined'} className="icon" size={iconSize} />;
120
134
 
121
135
  // ๐Ÿ”— link variant
122
136
  if (href && !isLoading) {
@@ -153,6 +167,8 @@ const AbIconButton = forwardRef<HTMLButtonElement, AbIconButtonProps>(function A
153
167
  aria-label={name} // โ™ฟ accessible name
154
168
  title={tooltip} // ๐Ÿ’ฌ tooltip on the button itself
155
169
  aria-busy={isLoading || undefined} // โณ announce loading
170
+ aria-expanded={ariaExpanded} // โ™ฟ open / closed (omitted when undefined)
171
+ aria-controls={ariaControls} // โ™ฟ what it opens
156
172
  data-active={String(active)} // โœ…
157
173
  data-naked={String(naked)} // ๐Ÿซฅ
158
174
  data-expands={String(expands)} // ๐Ÿ”
@@ -63,7 +63,7 @@
63
63
  }
64
64
 
65
65
  .abIconButton:hover {
66
- background-color: color-mix(in srgb, currentColor 10%, transparent);
66
+ background-color: var(--ab-color-hover, color-mix(in srgb, currentColor 10%, transparent));
67
67
  }
68
68
 
69
69
  .abIconButton[data-naked='true']:hover {
@@ -8,6 +8,7 @@
8
8
  * @project: ab-nextjs-components
9
9
  * @name: AbImage - Client (Adapt of lyd-image โ€” Dexie/offline stripped)
10
10
  * @file: ab-image/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-image/styles.module.css
29
+ * @type: CSS Stylesheet
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ */
32
+
1
33
  .abImage {
2
34
  position: relative;
3
35
  display: flex;
package/ab-info/index.tsx CHANGED
@@ -8,12 +8,13 @@
8
8
  * @project: ab-nextjs-components
9
9
  * @name: AbInfo - Client (port of lyd-info)
10
10
  * @file: ab-info/index.tsx
11
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
11
12
  */
12
13
 
13
14
  'use client';
14
15
 
15
16
  import type { ReactElement } from 'react';
16
- import Link from 'next/link';
17
+ import Link from '../ab-link'; // ๐Ÿ”— G42: injectable via AbLinkProvider (default next/link)
17
18
  import clsx from 'clsx';
18
19
  import styles from './styles.module.css';
19
20
 
@@ -1,3 +1,35 @@
1
+ /*
2
+ * @license MIT
3
+ * ~~~~~~~~~~~~
4
+ * ab-nextjs-components
5
+ * ~~~~~~~~~~~~
6
+ * Copyright (c) 2026 Abraham Ukachi. The abElements Project.
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the 'Software'), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all
16
+ * copies or substantial portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ * SOFTWARE.
25
+ *
26
+ * @project: ab-nextjs-components
27
+ * @name: styles.module.css
28
+ * @file: ab-info/styles.module.css
29
+ * @type: CSS Stylesheet
30
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
31
+ */
32
+
1
33
  .abInfo {
2
34
  position: relative;
3
35
  display: flex;
@@ -8,6 +8,7 @@
8
8
  * @project: ab-nextjs-components
9
9
  * @name: AbInput - Client (port of lyd-input)
10
10
  * @file: ab-input/index.tsx
11
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
11
12
  */
12
13
 
13
14
  'use client';
@@ -5,6 +5,7 @@
5
5
  * ~~~~~~~~~~~~
6
6
  * Copyright (c) 2026 Abraham Ukachi. The abElements Project.
7
7
  * Plain CSS modules โ€” no Tailwind Tailwind apply (Turbopack-safe).
8
+ * @authors: Abraham Ukachi <abrahamukachi@gmail.com>
8
9
  */
9
10
 
10
11
 
@@ -76,6 +76,7 @@ export interface AbInstallSnippetProps {
76
76
  dev?: boolean; // ๐Ÿ› ๏ธ dev dependency flag
77
77
  className?: string; // ๐Ÿท๏ธ
78
78
  style?: CSSProperties; // ๐ŸŽจ
79
+ variant?: 'card' | 'terminal'; // ๐Ÿ’ป 0.1.14 (P12): 'terminal' = the Home dark block (underline tabs, copy in the tab row, no clipping). Default 'card'
79
80
  }
80
81
 
81
82
  // ๐Ÿง  state source: persisted (shared across instances) or local
@@ -96,7 +97,7 @@ function LocalSnippet(props: AbInstallSnippetProps) {
96
97
  }
97
98
 
98
99
  /** ๐Ÿ–ผ๏ธ the actual UI */
99
- function SnippetView({ pkg, labels, managers = AB_PACKAGE_MANAGERS, dev = false, className, style, state }: AbInstallSnippetProps & { state: PmState }) {
100
+ function SnippetView({ pkg, labels, managers = AB_PACKAGE_MANAGERS, dev = false, className, style, state, variant = 'card' }: AbInstallSnippetProps & { state: PmState }) {
100
101
  const [pm, setPm] = state; // ๐ŸŽš๏ธ
101
102
  const current = managers.includes(pm) ? pm : managers[0]; // ๐Ÿงฏ stored pm not offered here
102
103
  const command = getAbInstallCommand(current, pkg, dev); // ๐Ÿงพ
@@ -122,38 +123,59 @@ function SnippetView({ pkg, labels, managers = AB_PACKAGE_MANAGERS, dev = false,
122
123
  tabs.current[j]?.focus(); // ๐ŸŽฏ
123
124
  };
124
125
 
126
+ const terminal = variant === 'terminal'; // ๐Ÿ’ป P12
127
+ // ๐Ÿ“‹ the copy button (card: in the command row ยท terminal: at the end of the tab row, always visible)
128
+ const copyButton = (
129
+ <AbIconButton
130
+ icon={copied ? 'check' : 'content_copy'} // ๐Ÿ“‹ / โœ…
131
+ label={labels.copy} // โ™ฟ name stays "Copy command"
132
+ naked // ๐Ÿซฅ
133
+ iconSize={terminal ? 16 : undefined} // ๐Ÿ“ P12: 16px in the terminal tab row
134
+ className={styles.copy} // ๐ŸŽจ
135
+ onClick={() => { void copy(command); }} // ๐Ÿ“‹
136
+ />
137
+ );
138
+ // ๐Ÿ–๏ธ terminal: "$ pnpm add <pkg>" with the package highlighted (the text stays one copyable string)
139
+ const at = command.lastIndexOf(pkg); // ๐Ÿ“
140
+ const highlighted = at >= 0 ? <>{command.slice(0, at)}<span className={styles.termPkg}>{pkg}</span>{command.slice(at + pkg.length)}</> : command;
141
+
142
+ // ๐Ÿ—‚๏ธ manager tabs
143
+ const tablist = (
144
+ <div role="tablist" aria-label={labels.group} className={styles.tabs} onKeyDown={onKeyDown}>
145
+ {managers.map((m, i) => (
146
+ <button
147
+ key={m} // ๐Ÿ”‘
148
+ ref={(el) => { tabs.current[i] = el; }} // ๐Ÿ“
149
+ id={`${base}-tab-${m}`} // ๐Ÿ†”
150
+ type="button" // ๐Ÿงพ
151
+ role="tab" // โ™ฟ
152
+ aria-selected={m === current} // โœ…
153
+ aria-controls={`${base}-panel`} // ๐Ÿ”—
154
+ tabIndex={m === current ? 0 : -1} // โŒจ๏ธ roving
155
+ className={styles.tab} // ๐ŸŽจ
156
+ onClick={() => setPm(m)} // ๐Ÿ–ฑ๏ธ
157
+ >
158
+ {m}
159
+ </button>
160
+ ))}
161
+ </div>
162
+ );
163
+
125
164
  return (
126
- <div className={clsx('AbInstallSnippet', styles.root, className)} style={style} data-ab-part="install-snippet" data-ab-swipe-ignore="">
127
- {/* ๐Ÿ—‚๏ธ manager tabs */}
128
- <div role="tablist" aria-label={labels.group} className={styles.tabs} onKeyDown={onKeyDown}>
129
- {managers.map((m, i) => (
130
- <button
131
- key={m} // ๐Ÿ”‘
132
- ref={(el) => { tabs.current[i] = el; }} // ๐Ÿ“
133
- id={`${base}-tab-${m}`} // ๐Ÿ†”
134
- type="button" // ๐Ÿงพ
135
- role="tab" // โ™ฟ
136
- aria-selected={m === current} // โœ…
137
- aria-controls={`${base}-panel`} // ๐Ÿ”—
138
- tabIndex={m === current ? 0 : -1} // โŒจ๏ธ roving
139
- className={styles.tab} // ๐ŸŽจ
140
- onClick={() => setPm(m)} // ๐Ÿ–ฑ๏ธ
141
- >
142
- {m}
143
- </button>
144
- ))}
145
- </div>
165
+ <div className={clsx('AbInstallSnippet', styles.root, terminal && styles.terminal, className)} style={style} data-ab-part="install-snippet" data-variant={terminal ? 'terminal' : undefined} data-ab-swipe-ignore="">
166
+ {/* ๐Ÿ—‚๏ธ manager tabs (๐Ÿ’ป terminal: tabs + copy share one row; the copy button stays OUTSIDE the tablist) */}
167
+ {terminal ? (
168
+ <div className={styles.termHead}>
169
+ {tablist}
170
+ <span className={styles.termGrow} aria-hidden="true" />
171
+ {copyButton}
172
+ </div>
173
+ ) : tablist}
146
174
  {/* ๐Ÿงพ command panel */}
147
175
  <div id={`${base}-panel`} role="tabpanel" aria-labelledby={`${base}-tab-${current}`} className={styles.panel}>
148
176
  <span className={styles.prompt} aria-hidden="true">$</span>{/* ๐Ÿ’ฒ decorative prompt */}
149
- <code className={styles.code}>{command}</code>
150
- <AbIconButton
151
- icon={copied ? 'check' : 'content_copy'} // ๐Ÿ“‹ / โœ…
152
- label={labels.copy} // โ™ฟ name stays "Copy command"
153
- naked // ๐Ÿซฅ
154
- className={styles.copy} // ๐ŸŽจ
155
- onClick={() => { void copy(command); }} // ๐Ÿ“‹
156
- />
177
+ <code className={styles.code}>{terminal ? highlighted : command}</code>
178
+ {!terminal && copyButton}
157
179
  </div>
158
180
  {/* ๐Ÿ“ฃ own polite live region */}
159
181
  <span className={styles.srOnly} aria-live="polite" role="status">{copied ? labels.copied : ''}</span>