@fpkit/acss 0.5.12 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (398) hide show
  1. package/README.md +89 -0
  2. package/libs/chunk-2NRIP6RB.cjs +17 -0
  3. package/libs/chunk-2NRIP6RB.cjs.map +1 -0
  4. package/libs/chunk-33PNJ4LO.cjs +15 -0
  5. package/libs/chunk-33PNJ4LO.cjs.map +1 -0
  6. package/libs/chunk-4BZKFPEC.cjs +17 -0
  7. package/libs/chunk-4BZKFPEC.cjs.map +1 -0
  8. package/libs/{chunk-O6QZBB6G.js → chunk-5QD3DWFI.js} +5 -5
  9. package/libs/chunk-5QD3DWFI.js.map +1 -0
  10. package/libs/chunk-6SAHIYCZ.js +7 -0
  11. package/libs/chunk-6SAHIYCZ.js.map +1 -0
  12. package/libs/{chunk-KKLTUJFB.cjs → chunk-6WTC4JXH.cjs} +5 -5
  13. package/libs/chunk-6WTC4JXH.cjs.map +1 -0
  14. package/libs/chunk-75QHTLFO.js +7 -0
  15. package/libs/chunk-75QHTLFO.js.map +1 -0
  16. package/libs/{chunk-YWOYVRFT.js → chunk-7XPFW7CB.js} +3 -3
  17. package/libs/chunk-BFK62VX5.js +5 -0
  18. package/libs/chunk-BFK62VX5.js.map +1 -0
  19. package/libs/{chunk-ICCKQ2GC.cjs → chunk-DKTHCQ5P.cjs} +4 -4
  20. package/libs/{chunk-6TE5QEVE.cjs → chunk-E2AJURUW.cjs} +3 -3
  21. package/libs/chunk-E2AJURUW.cjs.map +1 -0
  22. package/libs/chunk-ENTCUJ3A.cjs +13 -0
  23. package/libs/chunk-ENTCUJ3A.cjs.map +1 -0
  24. package/libs/chunk-F5EYMVQM.js +10 -0
  25. package/libs/chunk-F5EYMVQM.js.map +1 -0
  26. package/libs/chunk-FVROL3V5.js +9 -0
  27. package/libs/chunk-FVROL3V5.js.map +1 -0
  28. package/libs/chunk-GT77BX4L.cjs +17 -0
  29. package/libs/chunk-GT77BX4L.cjs.map +1 -0
  30. package/libs/chunk-GUJSMQ3V.cjs +16 -0
  31. package/libs/chunk-GUJSMQ3V.cjs.map +1 -0
  32. package/libs/chunk-HHLNOC5T.js +7 -0
  33. package/libs/chunk-HHLNOC5T.js.map +1 -0
  34. package/libs/chunk-HRRHPLER.js +8 -0
  35. package/libs/chunk-HRRHPLER.js.map +1 -0
  36. package/libs/chunk-IEB64SWY.js +8 -0
  37. package/libs/chunk-IEB64SWY.js.map +1 -0
  38. package/libs/{chunk-LIQJ7ZZR.js → chunk-IQ76HGVP.js} +2 -2
  39. package/libs/chunk-IRLFZ3OL.js +9 -0
  40. package/libs/chunk-IRLFZ3OL.js.map +1 -0
  41. package/libs/chunk-KK47SYZI.js +8 -0
  42. package/libs/chunk-KK47SYZI.js.map +1 -0
  43. package/libs/chunk-O3JIHC5M.cjs +15 -0
  44. package/libs/chunk-O3JIHC5M.cjs.map +1 -0
  45. package/libs/chunk-O5XAJ7BY.cjs +18 -0
  46. package/libs/chunk-O5XAJ7BY.cjs.map +1 -0
  47. package/libs/chunk-OVWLQYMK.js +10 -0
  48. package/libs/chunk-OVWLQYMK.js.map +1 -0
  49. package/libs/chunk-PNWIRCG3.cjs +7 -0
  50. package/libs/chunk-PNWIRCG3.cjs.map +1 -0
  51. package/libs/chunk-QVW6W76L.cjs +18 -0
  52. package/libs/chunk-QVW6W76L.cjs.map +1 -0
  53. package/libs/chunk-T4T6GWYQ.cjs +17 -0
  54. package/libs/chunk-T4T6GWYQ.cjs.map +1 -0
  55. package/libs/chunk-TON2YGMD.cjs +9 -0
  56. package/libs/chunk-TON2YGMD.cjs.map +1 -0
  57. package/libs/chunk-UEPAWMDF.js +8 -0
  58. package/libs/chunk-UEPAWMDF.js.map +1 -0
  59. package/libs/{chunk-LT5KZ2QW.cjs → chunk-US2I5GI7.cjs} +3 -3
  60. package/libs/{chunk-E3XP6BEX.cjs → chunk-W2UIN7EV.cjs} +3 -3
  61. package/libs/chunk-W5TKWBFC.cjs +18 -0
  62. package/libs/chunk-W5TKWBFC.cjs.map +1 -0
  63. package/libs/chunk-WXBFBWYF.cjs +16 -0
  64. package/libs/chunk-WXBFBWYF.cjs.map +1 -0
  65. package/libs/chunk-X3JCTEPD.js +11 -0
  66. package/libs/chunk-X3JCTEPD.js.map +1 -0
  67. package/libs/chunk-X5LGFCWG.js +9 -0
  68. package/libs/chunk-X5LGFCWG.js.map +1 -0
  69. package/libs/{chunk-5M57K4SW.js → chunk-Y2PFDELK.js} +2 -2
  70. package/libs/chunk-ZFJ4U45S.js +10 -0
  71. package/libs/chunk-ZFJ4U45S.js.map +1 -0
  72. package/libs/{component-props-a8a2f97e.d.ts → component-props-67d978a2.d.ts} +4 -4
  73. package/libs/components/alert/alert.css +1 -1
  74. package/libs/components/alert/alert.css.map +1 -1
  75. package/libs/components/alert/alert.min.css +2 -2
  76. package/libs/components/badge/badge.css +1 -1
  77. package/libs/components/badge/badge.css.map +1 -1
  78. package/libs/components/badge/badge.min.css +2 -2
  79. package/libs/components/breadcrumbs/breadcrumb.cjs +9 -5
  80. package/libs/components/breadcrumbs/breadcrumb.d.cts +275 -36
  81. package/libs/components/breadcrumbs/breadcrumb.d.ts +275 -36
  82. package/libs/components/breadcrumbs/breadcrumb.js +3 -3
  83. package/libs/components/button.cjs +6 -4
  84. package/libs/components/button.d.cts +97 -4
  85. package/libs/components/button.d.ts +97 -4
  86. package/libs/components/button.js +4 -2
  87. package/libs/components/buttons/button.css +1 -1
  88. package/libs/components/buttons/button.css.map +1 -1
  89. package/libs/components/buttons/button.min.css +2 -2
  90. package/libs/components/card.cjs +7 -7
  91. package/libs/components/card.d.cts +278 -34
  92. package/libs/components/card.d.ts +278 -34
  93. package/libs/components/card.js +2 -2
  94. package/libs/components/cards/card.css +1 -1
  95. package/libs/components/cards/card.css.map +1 -1
  96. package/libs/components/cards/card.min.css +2 -2
  97. package/libs/components/details/details.css +1 -1
  98. package/libs/components/details/details.css.map +1 -1
  99. package/libs/components/details/details.min.css +2 -2
  100. package/libs/components/dialog/dialog.cjs +9 -7
  101. package/libs/components/dialog/dialog.css +1 -1
  102. package/libs/components/dialog/dialog.css.map +1 -1
  103. package/libs/components/dialog/dialog.d.cts +88 -34
  104. package/libs/components/dialog/dialog.d.ts +88 -34
  105. package/libs/components/dialog/dialog.js +7 -5
  106. package/libs/components/dialog/dialog.min.css +2 -2
  107. package/libs/components/form/fields.cjs +4 -4
  108. package/libs/components/form/fields.d.cts +16 -7
  109. package/libs/components/form/fields.d.ts +16 -7
  110. package/libs/components/form/fields.js +2 -2
  111. package/libs/components/form/inputs.cjs +6 -4
  112. package/libs/components/form/inputs.d.cts +50 -2
  113. package/libs/components/form/inputs.d.ts +50 -2
  114. package/libs/components/form/inputs.js +4 -2
  115. package/libs/components/form/textarea.cjs +5 -4
  116. package/libs/components/form/textarea.d.cts +32 -23
  117. package/libs/components/form/textarea.d.ts +32 -23
  118. package/libs/components/form/textarea.js +3 -2
  119. package/libs/components/heading/heading.cjs +3 -3
  120. package/libs/components/heading/heading.d.cts +3 -14
  121. package/libs/components/heading/heading.d.ts +3 -14
  122. package/libs/components/heading/heading.js +2 -2
  123. package/libs/components/icons/icon.cjs +4 -4
  124. package/libs/components/icons/icon.d.cts +183 -39
  125. package/libs/components/icons/icon.d.ts +183 -39
  126. package/libs/components/icons/icon.js +2 -2
  127. package/libs/components/images/img.css +1 -1
  128. package/libs/components/images/img.css.map +1 -1
  129. package/libs/components/images/img.min.css +2 -2
  130. package/libs/components/link/link.cjs +4 -4
  131. package/libs/components/link/link.css +1 -1
  132. package/libs/components/link/link.css.map +1 -1
  133. package/libs/components/link/link.d.cts +3 -19
  134. package/libs/components/link/link.d.ts +3 -19
  135. package/libs/components/link/link.js +2 -2
  136. package/libs/components/link/link.min.css +2 -2
  137. package/libs/components/list/list.cjs +5 -5
  138. package/libs/components/list/list.css +1 -0
  139. package/libs/components/list/list.css.map +1 -0
  140. package/libs/components/list/list.d.cts +120 -33
  141. package/libs/components/list/list.d.ts +120 -33
  142. package/libs/components/list/list.js +2 -2
  143. package/libs/components/list/list.min.css +3 -0
  144. package/libs/components/modal.cjs +6 -4
  145. package/libs/components/modal.d.cts +8 -8
  146. package/libs/components/modal.d.ts +8 -8
  147. package/libs/components/modal.js +5 -3
  148. package/libs/components/nav/nav.cjs +7 -7
  149. package/libs/components/nav/nav.css +1 -1
  150. package/libs/components/nav/nav.css.map +1 -1
  151. package/libs/components/nav/nav.d.cts +550 -34
  152. package/libs/components/nav/nav.d.ts +550 -34
  153. package/libs/components/nav/nav.js +3 -3
  154. package/libs/components/nav/nav.min.css +2 -2
  155. package/libs/components/popover/popover.d.cts +5 -5
  156. package/libs/components/popover/popover.d.ts +5 -5
  157. package/libs/components/tables/table.cjs +5 -5
  158. package/libs/components/tables/table.d.cts +8 -8
  159. package/libs/components/tables/table.d.ts +8 -8
  160. package/libs/components/tables/table.js +2 -2
  161. package/libs/components/tag/tag.css +1 -1
  162. package/libs/components/tag/tag.css.map +1 -1
  163. package/libs/components/tag/tag.min.css +2 -2
  164. package/libs/components/text/text.cjs +5 -5
  165. package/libs/components/text/text.d.cts +5 -5
  166. package/libs/components/text/text.d.ts +5 -5
  167. package/libs/components/text/text.js +2 -2
  168. package/libs/form.types-d25ebfac.d.ts +233 -0
  169. package/libs/heading-7446cb46.d.ts +250 -0
  170. package/libs/hooks.cjs +12 -0
  171. package/libs/hooks.d.cts +140 -1
  172. package/libs/hooks.d.ts +140 -1
  173. package/libs/hooks.js +4 -0
  174. package/libs/icons.cjs +3 -3
  175. package/libs/icons.d.cts +2 -2
  176. package/libs/icons.d.ts +2 -2
  177. package/libs/icons.js +2 -2
  178. package/libs/index.cjs +117 -94
  179. package/libs/index.cjs.map +1 -1
  180. package/libs/index.css +1 -1
  181. package/libs/index.css.map +1 -1
  182. package/libs/index.d.cts +834 -61
  183. package/libs/index.d.ts +834 -61
  184. package/libs/index.js +36 -22
  185. package/libs/index.js.map +1 -1
  186. package/libs/link-5192f411.d.ts +323 -0
  187. package/libs/list.types-d26de310.d.ts +245 -0
  188. package/libs/ui-d01b50d4.d.ts +289 -0
  189. package/package.json +4 -87
  190. package/src/components/README-UI.mdx +416 -0
  191. package/src/components/alert/ACCESSIBILITY.md +319 -0
  192. package/src/components/alert/README.mdx +475 -19
  193. package/src/components/alert/alert.scss +110 -6
  194. package/src/components/alert/alert.stories.tsx +372 -0
  195. package/src/components/alert/alert.test.tsx +762 -0
  196. package/src/components/alert/alert.tsx +331 -66
  197. package/src/components/alert/views/alert-actions.tsx +13 -0
  198. package/src/components/alert/views/alert-content.tsx +17 -0
  199. package/src/components/alert/views/alert-icon.tsx +53 -0
  200. package/src/components/alert/views/alert-screen-reader-text.tsx +30 -0
  201. package/src/components/alert/views/alert-title.tsx +23 -0
  202. package/src/components/alert/views/alert-view.tsx +158 -0
  203. package/src/components/alert/views/index.ts +12 -0
  204. package/src/components/badge/badge.mdx +186 -49
  205. package/src/components/badge/badge.scss +20 -2
  206. package/src/components/badge/badge.stories.tsx +160 -14
  207. package/src/components/badge/badge.test.tsx +179 -0
  208. package/src/components/badge/badge.tsx +97 -4
  209. package/src/components/breadcrumbs/README.mdx +364 -45
  210. package/src/components/breadcrumbs/__snapshots__/breadcrumb.test.tsx.snap +152 -0
  211. package/src/components/breadcrumbs/breadcrumb.stories.tsx +7 -3
  212. package/src/components/breadcrumbs/breadcrumb.test.tsx +490 -0
  213. package/src/components/breadcrumbs/breadcrumb.tsx +430 -170
  214. package/src/components/buttons/README.mdx +102 -1
  215. package/src/components/buttons/button.scss +34 -31
  216. package/src/components/buttons/button.stories.tsx +141 -0
  217. package/src/components/buttons/button.tsx +82 -52
  218. package/src/components/cards/README.mdx +657 -0
  219. package/src/components/cards/card.scss +22 -0
  220. package/src/components/cards/card.stories.tsx +167 -5
  221. package/src/components/cards/card.test.tsx +360 -20
  222. package/src/components/cards/card.tsx +200 -79
  223. package/src/components/cards/card.types.ts +135 -0
  224. package/src/components/cards/card.utils.ts +79 -0
  225. package/src/components/details/ACCESSIBILITY-REVIEW-LIVE.md +1050 -0
  226. package/src/components/details/ACCESSIBILITY-REVIEW.md +502 -0
  227. package/src/components/details/README.mdx +437 -69
  228. package/src/components/details/details.scss +16 -7
  229. package/src/components/details/details.test.tsx +385 -0
  230. package/src/components/details/details.tsx +101 -69
  231. package/src/components/details/details.types.ts +76 -0
  232. package/src/components/dialog/README.mdx +513 -110
  233. package/src/components/dialog/dialog-a11y-review.md +653 -0
  234. package/src/components/dialog/dialog-modal.tsx +79 -56
  235. package/src/components/dialog/dialog.scss +53 -3
  236. package/src/components/dialog/dialog.stories.tsx +10 -7
  237. package/src/components/dialog/dialog.test.tsx +450 -0
  238. package/src/components/dialog/dialog.tsx +69 -59
  239. package/src/components/dialog/dialog.types.ts +133 -0
  240. package/src/components/dialog/views/dialog-footer.tsx +54 -11
  241. package/src/components/dialog/views/dialog-header.tsx +20 -15
  242. package/src/components/form/README.mdx +725 -43
  243. package/src/components/form/WCAG-REVIEW.md +654 -0
  244. package/src/components/form/fields.tsx +10 -1
  245. package/src/components/form/form.stories.tsx +604 -23
  246. package/src/components/form/form.tsx +204 -63
  247. package/src/components/form/form.types.ts +378 -0
  248. package/src/components/form/input.stories.tsx +71 -3
  249. package/src/components/form/inputs.tsx +159 -67
  250. package/src/components/form/select.tsx +122 -66
  251. package/src/components/form/textarea.tsx +120 -73
  252. package/src/components/fp.tsx +86 -11
  253. package/src/components/heading/heading.stories.tsx +44 -4
  254. package/src/components/heading/heading.tsx +89 -23
  255. package/src/components/icons/README.mdx +332 -0
  256. package/src/components/icons/icon.stories.tsx +74 -1
  257. package/src/components/icons/icon.tsx +89 -1
  258. package/src/components/icons/types.ts +47 -0
  259. package/src/components/images/README.mdx +340 -24
  260. package/src/components/images/img.scss +19 -3
  261. package/src/components/images/img.stories.tsx +424 -15
  262. package/src/components/images/img.test.tsx +354 -25
  263. package/src/components/images/img.tsx +186 -63
  264. package/src/components/images/img.types.ts +211 -0
  265. package/src/components/link/README.mdx +923 -0
  266. package/src/components/link/link.scss +79 -26
  267. package/src/components/link/link.stories.tsx +383 -30
  268. package/src/components/link/link.test.tsx +677 -0
  269. package/src/components/link/link.tsx +163 -57
  270. package/src/components/link/link.types.ts +261 -0
  271. package/src/components/list/README.mdx +764 -0
  272. package/src/components/list/list.scss +285 -0
  273. package/src/components/list/list.stories.tsx +514 -27
  274. package/src/components/list/list.test.tsx +554 -0
  275. package/src/components/list/list.tsx +153 -51
  276. package/src/components/list/list.types.ts +255 -0
  277. package/src/components/nav/ACCESSIBILITY.md +649 -0
  278. package/src/components/nav/README.mdx +782 -0
  279. package/src/components/nav/nav.scss +32 -1
  280. package/src/components/nav/nav.stories.tsx +44 -6
  281. package/src/components/nav/nav.tsx +302 -51
  282. package/src/components/nav/nav.types.ts +308 -0
  283. package/src/components/tag/README.mdx +426 -0
  284. package/src/components/tag/tag.scss +101 -27
  285. package/src/components/tag/tag.stories.tsx +384 -10
  286. package/src/components/tag/tag.test.tsx +210 -0
  287. package/src/components/tag/tag.tsx +106 -9
  288. package/src/components/tag/tag.types.ts +107 -0
  289. package/src/components/title/MIGRATION.md +199 -0
  290. package/src/components/title/README.md +326 -0
  291. package/src/components/title/README.mdx +452 -0
  292. package/src/components/title/title.stories.tsx +393 -0
  293. package/src/components/title/title.test.tsx +251 -0
  294. package/src/components/title/title.tsx +219 -0
  295. package/src/components/ui.stories.tsx +894 -0
  296. package/src/components/ui.test.tsx +559 -0
  297. package/src/components/ui.tsx +274 -18
  298. package/src/components/word-count/README.md +240 -0
  299. package/src/hooks/use-disabled-state.test.tsx +536 -0
  300. package/src/hooks/use-disabled-state.ts +246 -0
  301. package/src/hooks/useDisabledState.md +393 -0
  302. package/src/hooks.ts +7 -0
  303. package/src/index.scss +2 -0
  304. package/src/index.ts +12 -3
  305. package/src/sass/_globals.scss +2 -7
  306. package/src/sass/_properties.scss +1 -0
  307. package/src/styles/alert/alert.css +92 -4
  308. package/src/styles/alert/alert.css.map +1 -1
  309. package/src/styles/badge/badge.css +20 -2
  310. package/src/styles/badge/badge.css.map +1 -1
  311. package/src/styles/buttons/button.css +31 -31
  312. package/src/styles/buttons/button.css.map +1 -1
  313. package/src/styles/cards/card.css +16 -0
  314. package/src/styles/cards/card.css.map +1 -1
  315. package/src/styles/details/details.css +19 -8
  316. package/src/styles/details/details.css.map +1 -1
  317. package/src/styles/dialog/dialog.css +43 -2
  318. package/src/styles/dialog/dialog.css.map +1 -1
  319. package/src/styles/images/img.css +15 -3
  320. package/src/styles/images/img.css.map +1 -1
  321. package/src/styles/index.css +691 -128
  322. package/src/styles/index.css.map +1 -1
  323. package/src/styles/link/link.css +45 -28
  324. package/src/styles/link/link.css.map +1 -1
  325. package/src/styles/list/list.css +214 -0
  326. package/src/styles/list/list.css.map +1 -0
  327. package/src/styles/nav/nav.css +21 -1
  328. package/src/styles/nav/nav.css.map +1 -1
  329. package/src/styles/tag/tag.css +113 -35
  330. package/src/styles/tag/tag.css.map +1 -1
  331. package/src/styles/utilities/_disabled.scss +58 -0
  332. package/src/test/setup.d.ts +9 -0
  333. package/src/test/setup.ts +53 -1
  334. package/src/types/shared.ts +43 -6
  335. package/src/utils/accessibility.ts +109 -0
  336. package/libs/chunk-5ZM4XL44.js +0 -8
  337. package/libs/chunk-5ZM4XL44.js.map +0 -1
  338. package/libs/chunk-6BVXFW7U.cjs +0 -15
  339. package/libs/chunk-6BVXFW7U.cjs.map +0 -1
  340. package/libs/chunk-6TE5QEVE.cjs.map +0 -1
  341. package/libs/chunk-7K76RW2A.cjs +0 -18
  342. package/libs/chunk-7K76RW2A.cjs.map +0 -1
  343. package/libs/chunk-BHRQBJRY.js +0 -8
  344. package/libs/chunk-BHRQBJRY.js.map +0 -1
  345. package/libs/chunk-BIP2NY53.js +0 -8
  346. package/libs/chunk-BIP2NY53.js.map +0 -1
  347. package/libs/chunk-BSPKFLO4.js +0 -8
  348. package/libs/chunk-BSPKFLO4.js.map +0 -1
  349. package/libs/chunk-BV5CLH44.cjs +0 -18
  350. package/libs/chunk-BV5CLH44.cjs.map +0 -1
  351. package/libs/chunk-DKGJHKGW.js +0 -9
  352. package/libs/chunk-DKGJHKGW.js.map +0 -1
  353. package/libs/chunk-DV56L5YX.cjs +0 -18
  354. package/libs/chunk-DV56L5YX.cjs.map +0 -1
  355. package/libs/chunk-ECLD37WN.cjs +0 -16
  356. package/libs/chunk-ECLD37WN.cjs.map +0 -1
  357. package/libs/chunk-EQ67LF46.js +0 -9
  358. package/libs/chunk-EQ67LF46.js.map +0 -1
  359. package/libs/chunk-HYBZBN4G.js +0 -8
  360. package/libs/chunk-HYBZBN4G.js.map +0 -1
  361. package/libs/chunk-IYUN2EW3.cjs +0 -15
  362. package/libs/chunk-IYUN2EW3.cjs.map +0 -1
  363. package/libs/chunk-KKLTUJFB.cjs.map +0 -1
  364. package/libs/chunk-LHVJKDMA.cjs +0 -15
  365. package/libs/chunk-LHVJKDMA.cjs.map +0 -1
  366. package/libs/chunk-LL7HTLMS.cjs +0 -15
  367. package/libs/chunk-LL7HTLMS.cjs.map +0 -1
  368. package/libs/chunk-M5QL5TAE.cjs +0 -14
  369. package/libs/chunk-M5QL5TAE.cjs.map +0 -1
  370. package/libs/chunk-NE6YXTMC.js +0 -7
  371. package/libs/chunk-NE6YXTMC.js.map +0 -1
  372. package/libs/chunk-NHYXGV3L.js +0 -8
  373. package/libs/chunk-NHYXGV3L.js.map +0 -1
  374. package/libs/chunk-O6QZBB6G.js.map +0 -1
  375. package/libs/chunk-P7TTEYCD.js +0 -7
  376. package/libs/chunk-P7TTEYCD.js.map +0 -1
  377. package/libs/chunk-PPOOBUOS.js +0 -8
  378. package/libs/chunk-PPOOBUOS.js.map +0 -1
  379. package/libs/chunk-QCMV4VQZ.js +0 -8
  380. package/libs/chunk-QCMV4VQZ.js.map +0 -1
  381. package/libs/chunk-QVV34QEH.cjs +0 -32
  382. package/libs/chunk-QVV34QEH.cjs.map +0 -1
  383. package/libs/chunk-S7BABR7Z.cjs +0 -13
  384. package/libs/chunk-S7BABR7Z.cjs.map +0 -1
  385. package/libs/chunk-SXVZSWX6.js +0 -11
  386. package/libs/chunk-SXVZSWX6.js.map +0 -1
  387. package/libs/chunk-X3EVB7VS.cjs +0 -15
  388. package/libs/chunk-X3EVB7VS.cjs.map +0 -1
  389. package/libs/inputs-f3a216db.d.ts +0 -45
  390. package/libs/ui-9a6f9f8d.d.ts +0 -24
  391. package/src/components/cards/README.md +0 -80
  392. package/src/components/dialog/hooks/useClickOutside.ts +0 -33
  393. /package/libs/{chunk-YWOYVRFT.js.map → chunk-7XPFW7CB.js.map} +0 -0
  394. /package/libs/{chunk-ICCKQ2GC.cjs.map → chunk-DKTHCQ5P.cjs.map} +0 -0
  395. /package/libs/{chunk-LIQJ7ZZR.js.map → chunk-IQ76HGVP.js.map} +0 -0
  396. /package/libs/{chunk-LT5KZ2QW.cjs.map → chunk-US2I5GI7.cjs.map} +0 -0
  397. /package/libs/{chunk-E3XP6BEX.cjs.map → chunk-W2UIN7EV.cjs.map} +0 -0
  398. /package/libs/{chunk-5M57K4SW.js.map → chunk-Y2PFDELK.js.map} +0 -0
package/libs/index.js CHANGED
@@ -1,28 +1,42 @@
1
- export { a as Breadcrumb } from './chunk-DKGJHKGW.js';
2
- import { b } from './chunk-PPOOBUOS.js';
3
- export { a as Textarea } from './chunk-PPOOBUOS.js';
4
- export { a as Field } from './chunk-BIP2NY53.js';
5
- export { a as Caption, i as TBL, f as Table, c as Tbody, e as Td, b as Thead, d as Tr } from './chunk-5M57K4SW.js';
6
- export { a as Dialog } from './chunk-SXVZSWX6.js';
7
- export { c as Nav, b as NavItem, a as NavList } from './chunk-EQ67LF46.js';
8
- export { b as List } from './chunk-NHYXGV3L.js';
1
+ import { b } from './chunk-IRLFZ3OL.js';
2
+ export { a as Textarea } from './chunk-IRLFZ3OL.js';
3
+ export { a as Field } from './chunk-HRRHPLER.js';
4
+ export { a as Caption, i as TBL, f as Table, c as Tbody, e as Td, b as Thead, d as Tr } from './chunk-Y2PFDELK.js';
5
+ export { a as Dialog } from './chunk-X3JCTEPD.js';
6
+ export { c as Nav, b as NavItem, a as NavList } from './chunk-FVROL3V5.js';
7
+ export { b as List } from './chunk-IEB64SWY.js';
9
8
  export { b as Popover } from './chunk-23ANBDCR.js';
10
- export { a as Text, b as Title } from './chunk-LIQJ7ZZR.js';
11
- import './chunk-HYBZBN4G.js';
9
+ export { a as Text } from './chunk-IQ76HGVP.js';
10
+ export { b as Heading, a as Title } from './chunk-ZFJ4U45S.js';
11
+ export { b as Breadcrumb, a as useBreadcrumbSegments } from './chunk-X5LGFCWG.js';
12
12
  import './chunk-GCGKYLDG.js';
13
- import { b as b$1 } from './chunk-O6QZBB6G.js';
14
- export { a as Icon } from './chunk-O6QZBB6G.js';
15
- export { d as Card, b as CardContent, c as CardFooter, a as CardTitle } from './chunk-BSPKFLO4.js';
16
- export { a as Modal } from './chunk-YWOYVRFT.js';
17
- export { a as Button } from './chunk-QCMV4VQZ.js';
18
- export { a as Input } from './chunk-BHRQBJRY.js';
19
- export { a as Box, a as FP } from './chunk-P7TTEYCD.js';
20
- export { a as Link, b as To } from './chunk-5ZM4XL44.js';
21
- import { a } from './chunk-NE6YXTMC.js';
22
- import l, { useState, useEffect } from 'react';
13
+ import { b as b$1 } from './chunk-5QD3DWFI.js';
14
+ export { a as Icon } from './chunk-5QD3DWFI.js';
15
+ export { d as Card, b as CardContent, c as CardFooter, a as CardTitle } from './chunk-KK47SYZI.js';
16
+ export { a as Modal } from './chunk-7XPFW7CB.js';
17
+ export { a as Button } from './chunk-OVWLQYMK.js';
18
+ export { a as Input } from './chunk-F5EYMVQM.js';
19
+ export { a as Box, a as FP } from './chunk-6SAHIYCZ.js';
20
+ import './chunk-BFK62VX5.js';
21
+ import './chunk-75QHTLFO.js';
22
+ export { a as Link, b as To } from './chunk-UEPAWMDF.js';
23
+ import { a } from './chunk-HHLNOC5T.js';
24
+ import u, { useCallback, useMemo, useState, useEffect } from 'react';
23
25
 
24
- var F=({src:e="//",alt:o,width:t=480,height:n,styles:s,loading:i="lazy",placeholder:c=`https://via.placeholder.com/${t}?text=PLACEHOLDER`,fetchpriority:a$1="low",decoding:m="auto",imgLoaded:x,imgError:S,...y})=>l.createElement(a,{as:"img",src:e,alt:o,width:t,height:n||"auto",loading:i,style:s,onError:h=>{if(S){S?.(h);return}h.currentTarget.src!==c&&(h.currentTarget.src=c);},onLoad:h=>{x?.(h);},fetchPriority:a$1,decoding:m,...y});F.displayName="Img";var z=e=>{let[o,t]=useState([]),[n,s]=useState(e),[i,c]=useState(!1),[a,m]=useState(!1),[x,S]=useState(null);return useEffect(()=>{let d=()=>{let f=window.speechSynthesis.getVoices();t(f);let g=f.find(p=>p.name==="Google US English");if(g)s(g);else {let p=f.find(E=>E.lang.startsWith("en-"));p&&s(p);}};return d(),window.speechSynthesis.onvoiceschanged=d,()=>{window.speechSynthesis.onvoiceschanged=null;}},[]),{speak:(d,f={},g)=>{let p=new SpeechSynthesisUtterance(d);p.lang=f.lang??"en-US",p.pitch=f.pitch??1,p.rate=f.rate??1,p.voice=n??f.voice??null,p.onend=()=>{c(!1),m(!1),g&&g();},"speechSynthesis"in window?(window.speechSynthesis.speak(p),S(p),c(!0),m(!1)):console.error("Speech synthesis not supported");},pause:()=>{i&&!a&&(window.speechSynthesis.pause(),m(!0));},resume:()=>{i&&a&&(window.speechSynthesis.resume(),m(!1));},cancel:()=>{i&&(window.speechSynthesis.cancel(),c(!1),m(!1));},isSpeaking:i,isPaused:a,availableVoices:o,changeVoice:d=>{s(d);},currentVoice:n,getAvailableLanguages:()=>[...new Set(o.map(d=>d.lang))]}};var oe=({children:e,onClick:o})=>l.createElement(a,{as:"button",type:"button",className:"tts-border","data-btn":"sm text pill",onClick:o},e),U=l.memo(oe),N=({label:e,isSpeaking:o,isPaused:t,onSpeak:n,onPause:s,onResume:i,onCancel:c})=>l.createElement(a,{as:"div","data-tts":!0},e&&l.createElement("p",null,e),!o&&l.createElement(U,{"aria-label":"Speak",onClick:n},l.createElement(b$1.PlaySolid,{size:16})),o&&!t&&l.createElement(U,{"aria-label":"Pause",onClick:s},l.createElement(b$1.PauseSolid,{size:16})),t&&l.createElement(U,{"aria-label":"Resume",onClick:i},l.createElement(b$1.ResumeSolid,{size:16})),l.createElement(U,{"aria-label":"Stop",onClick:c},l.createElement(b$1.StopSolid,{size:16})));N.displayName="TextToSpeechControls";N.TTSButton=U;var A=N;var H=({initialText:e="",showTextInput:o=!1,voice:t,pitch:n=1,rate:s=1,language:i,label:c,onEnd:a})=>{let{speak:m,pause:x,resume:S,cancel:y,isSpeaking:P,isPaused:I,getAvailableLanguages:h,availableVoices:C}=z(),[k,d]=useState(e);console.log(h()),useEffect(()=>{d(e);},[e]);let f=()=>{k.trim()!==""&&m(k,{voice:t,pitch:n,rate:s},p);},g=E=>{d(E.target.value);},p=()=>{a&&a();};return l.createElement(l.Fragment,null,o&&l.createElement(b,{value:k,onChange:g}),l.createElement(A,{label:c,isSpeaking:P,isPaused:I,onSpeak:f,onPause:x,onResume:S,onCancel:y}))};H.displayName="TextToSpeechComponent";var T=e=>l.createElement(l.Fragment,null,e),ne=({id:e,children:o,headerBackground:t,styles:n,classes:s,...i})=>l.createElement(a,{as:"header",id:e,styles:n,className:s,...i},t,l.createElement(a,{as:"section"},o)),re=({id:e,children:o,styles:t,classes:n,...s})=>l.createElement(a,{as:"main",id:e,styles:t,...s,className:n},o),ae=({id:e,classes:o,children:t,styles:n={},...s})=>l.createElement(a,{as:"footer",id:e,className:o,styles:n,...s},l.createElement(a,{as:"section"},t||"Copyright \xA9 2022")),pe=({id:e,children:o,styles:t={},classes:n,...s})=>l.createElement(a,{as:"aside",id:e,styles:t,className:n,...s},l.createElement(a,{as:"section"},o)),ie=({id:e,children:o,styles:t,classes:n,...s})=>l.createElement(a,{as:"section",id:e,styles:t,className:n,...s},o),ce=({id:e,children:o,styles:t,classes:n,...s})=>l.createElement(a,{as:"article",id:e,styles:t,className:n,...s},o);T.displayName="Landmarks";T.Header=ne;T.Main=re;T.Footer=ae;T.Aside=pe;T.Section=ie;T.Article=ce;var me=({elm:e="span",role:o="note",children:t,styles:n,...s})=>l.createElement(a,{as:e,role:o,styles:n,...s},t);me.displayName="Tag";var de=({summary:e,icon:o,styles:t,classes:n,ariaLabel:s,name:i,open:c,onPointerDown:a$1,onToggle:m,children:x,ref:S,...y})=>{let P={...t},I=C=>{a$1&&a$1?.(C),a$1&&a$1?.(C);};return l.createElement(a,{as:"details",style:P,className:n,onToggle:C=>{m&&a$1?.(C);},ref:S,open:c,"aria-label":s||"Details dropdown",name:i,...y},l.createElement(a,{as:"summary",onPointerDown:I},o,e),l.createElement(a,{as:"section"},x))};de.displayName="Details";
26
+ var V=({src:e="//",alt:s,width:t=480,height:n,styles:r,loading:i="lazy",placeholder:c,fetchpriority:m="low",decoding:d="auto",srcSet:T,sizes:x,onError:y,onLoad:P,...C})=>{let h=useMemo(()=>{let o=typeof t=="number"?t:480,p=typeof n=="number"?n:Math.round(o*.75),l=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${o} ${p}">
27
+ <defs>
28
+ <linearGradient id="grad-${o}-${p}" x1="0%" y1="0%" x2="100%" y2="100%">
29
+ <stop offset="0%" style="stop-color:#6366f1;stop-opacity:1" />
30
+ <stop offset="50%" style="stop-color:#8b5cf6;stop-opacity:1" />
31
+ <stop offset="100%" style="stop-color:#ec4899;stop-opacity:1" />
32
+ </linearGradient>
33
+ </defs>
34
+ <rect width="${o}" height="${p}" fill="url(#grad-${o}-${p})"/>
35
+ <circle cx="${o*.15}" cy="${p*.2}" r="${Math.min(o,p)*.08}" fill="rgba(255,255,255,0.2)"/>
36
+ <path d="M0,${p*.75} Q${o*.25},${p*.65} ${o*.5},${p*.75} T${o},${p*.75} L${o},${p} L0,${p} Z" fill="rgba(0,0,0,0.15)"/>
37
+ <text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-family="system-ui,-apple-system,sans-serif" font-size="${Math.max(16,Math.min(o,p)*.05)}" font-weight="500" fill="rgba(255,255,255,0.9)">${o}\xD7${p}</text>
38
+ </svg>`;return `data:image/svg+xml,${encodeURIComponent(l)}`},[t,n]),w=c??h;return u.createElement(a,{as:"img",src:e,alt:s,width:t,height:n||"auto",loading:i,style:r,srcSet:T,sizes:x,onError:o=>{y&&y(o),o.defaultPrevented||o.currentTarget.src!==w&&(o.currentTarget.src=w);},onLoad:o=>{P?.(o);},decoding:d,...C,...m&&{fetchpriority:m}})};V.displayName="Img";var M=e=>{let[s,t]=useState([]),[n,r]=useState(e),[i,c]=useState(!1),[m,d]=useState(!1),[T,x]=useState(null);return useEffect(()=>{let f=()=>{let o=window.speechSynthesis.getVoices();t(o);let p=o.find(l=>l.name==="Google US English");if(p)r(p);else {let l=o.find($=>$.lang.startsWith("en-"));l&&r(l);}};return f(),window.speechSynthesis.onvoiceschanged=f,()=>{window.speechSynthesis.onvoiceschanged=null;}},[]),{speak:(f,o={},p)=>{let l=new SpeechSynthesisUtterance(f);l.lang=o.lang??"en-US",l.pitch=o.pitch??1,l.rate=o.rate??1,l.voice=n??o.voice??null,l.onend=()=>{c(!1),d(!1),p&&p();},"speechSynthesis"in window?(window.speechSynthesis.speak(l),x(l),c(!0),d(!1)):console.error("Speech synthesis not supported");},pause:()=>{i&&!m&&(window.speechSynthesis.pause(),d(!0));},resume:()=>{i&&m&&(window.speechSynthesis.resume(),d(!1));},cancel:()=>{i&&(window.speechSynthesis.cancel(),c(!1),d(!1));},isSpeaking:i,isPaused:m,availableVoices:s,changeVoice:f=>{r(f);},currentVoice:n,getAvailableLanguages:()=>[...new Set(s.map(f=>f.lang))]}};var pe=({children:e,onClick:s})=>u.createElement(a,{as:"button",type:"button",className:"tts-border","data-btn":"sm text pill",onClick:s},e),U=u.memo(pe),L=({label:e,isSpeaking:s,isPaused:t,onSpeak:n,onPause:r,onResume:i,onCancel:c})=>u.createElement(a,{as:"div","data-tts":!0},e&&u.createElement("p",null,e),!s&&u.createElement(U,{"aria-label":"Speak",onClick:n},u.createElement(b$1.PlaySolid,{size:16})),s&&!t&&u.createElement(U,{"aria-label":"Pause",onClick:r},u.createElement(b$1.PauseSolid,{size:16})),t&&u.createElement(U,{"aria-label":"Resume",onClick:i},u.createElement(b$1.ResumeSolid,{size:16})),u.createElement(U,{"aria-label":"Stop",onClick:c},u.createElement(b$1.StopSolid,{size:16})));L.displayName="TextToSpeechControls";L.TTSButton=U;var H=L;var z=({initialText:e="",showTextInput:s=!1,voice:t,pitch:n=1,rate:r=1,language:i,label:c,onEnd:m})=>{let{speak:d,pause:T,resume:x,cancel:y,isSpeaking:P,isPaused:C,getAvailableLanguages:h,availableVoices:w}=M(),[I,f]=useState(e);console.log(h()),useEffect(()=>{f(e);},[e]);let o=()=>{I.trim()!==""&&d(I,{voice:t,pitch:n,rate:r},l);},p=$=>{f($.target.value);},l=()=>{m&&m();};return u.createElement(u.Fragment,null,s&&u.createElement(b,{value:I,onChange:p}),u.createElement(H,{label:c,isSpeaking:P,isPaused:C,onSpeak:o,onPause:T,onResume:x,onCancel:y}))};z.displayName="TextToSpeechComponent";var S=e=>u.createElement(u.Fragment,null,e),ce=({id:e,children:s,headerBackground:t,styles:n,classes:r,...i})=>u.createElement(a,{as:"header",id:e,styles:n,className:r,...i},t,u.createElement(a,{as:"section"},s)),me=({id:e,children:s,styles:t,classes:n,...r})=>u.createElement(a,{as:"main",id:e,styles:t,...r,className:n},s),de=({id:e,classes:s,children:t,styles:n={},...r})=>u.createElement(a,{as:"footer",id:e,className:s,styles:n,...r},u.createElement(a,{as:"section"},t||"Copyright \xA9 2022")),fe=({id:e,children:s,styles:t={},classes:n,...r})=>u.createElement(a,{as:"aside",id:e,styles:t,className:n,...r},u.createElement(a,{as:"section"},s)),ue=({id:e,children:s,styles:t,classes:n,...r})=>u.createElement(a,{as:"section",id:e,styles:t,className:n,...r},s),ge=({id:e,children:s,styles:t,classes:n,...r})=>u.createElement(a,{as:"article",id:e,styles:t,className:n,...r},s);S.displayName="Landmarks";S.Header=ce;S.Main=me;S.Footer=de;S.Aside=fe;S.Section=ue;S.Article=ge;var A=({id:e,styles:s,classes:t,children:n,variant:r,...i})=>u.createElement(a,{as:"sup",id:e,styles:s,className:t,"data-badge":r||void 0,role:"status",...i},u.createElement(a,{as:"span"},n));A.displayName="Badge";var xe=({elm:e="span",role:s="note",variant:t,children:n,styles:r,...i})=>u.createElement(a,{as:e,role:s,"data-tag":t||void 0,styles:r,...i},n);xe.displayName="Tag";var ye=u.forwardRef(({summary:e,icon:s,styles:t,classes:n,ariaLabel:r,name:i,open:c,onPointerDown:m,onToggle:d,children:T,...x},y)=>{let P=useCallback(h=>{m?.(h);},[m]),C=useCallback(h=>{d?.(h);},[d]);return u.createElement(a,{as:"details",styles:t,classes:n,onToggle:C,ref:y,open:c,"aria-label":r,name:i,...x},u.createElement(a,{as:"summary",onPointerDown:P},s,e),u.createElement(a,{as:"section"},T))});ye.displayName="Details";
25
39
 
26
- export { ce as Article, pe as Aside, de as Details, ae as Footer, ne as Header, F as Img, T as Landmarks, re as Main, ie as Section, me as Tag, H as TextToSpeech };
40
+ export { ge as Article, fe as Aside, A as Badge, ye as Details, de as Footer, ce as Header, V as Img, S as Landmarks, me as Main, ue as Section, xe as Tag, z as TextToSpeech };
27
41
  //# sourceMappingURL=out.js.map
28
42
  //# sourceMappingURL=index.js.map
package/libs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/images/img.tsx","../src/components/text-to-speech/TextToSpeech.tsx","../src/components/text-to-speech/useTextToSpeech.tsx","../src/components/text-to-speech/views/TextToSpeechControls.tsx","../src/components/layout/landmarks.tsx","../src/components/tag/tag.tsx","../src/components/details/details.tsx"],"names":["React","Img","src","alt","width","height","styles","loading","placeholder","fetchpriority","decoding","imgLoaded","imgError","props","ui_default","e","useState","useEffect","useTextToSpeech","initialVoice","availableVoices","setAvailableVoices","currentVoice","setCurrentVoice","isSpeaking","setIsSpeaking","isPaused","setIsPaused","utterance","setUtterance","updateVoices","voices","googleVoice","voice","englishVoice","text","options","onEnd","TTSButtonComponent","children","onClick","TTSButton","TextToSpeechControls","label","onSpeak","onPause","onResume","onCancel","icon_default","TextToSpeechControls_default","TextToSpeech","initialText","showTextInput","pitch","rate","language","speak","pause","resume","cancel","getAvailableLanguages","setText","handleSpeak","handleEnd","handleChange","textarea_default","Landmarks","Header","id","headerBackground","classes","Main","Footer","Aside","Section","Article","Tag","elm","role","Details","summary","icon","ariaLabel","name","open","onPointerDown","onToggle","ref","defaultStyles","onPointerDownCallback"],"mappings":"s1BACA,OAAOA,MAAW,QAwCX,IAAMC,EAAM,CAAC,CAClB,IAAAC,EAAM,KACN,IAAAC,EACA,MAAAC,EAAQ,IACR,OAAAC,EACA,OAAAC,EACA,QAAAC,EAAU,OACV,YAAAC,EAAc,+BAA+BJ,CAAK,oBAClD,cAAAK,EAAgB,MAChB,SAAAC,EAAW,OACX,UAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAoBIb,EAAA,cAACc,EAAA,CACC,GAAG,MACH,IAAKZ,EACL,IAAKC,EACL,MAAOC,EACP,OAAQC,GAAU,OAClB,QAASE,EACT,MAAOD,EACP,QA1BFS,GACS,CACT,GAAIH,EAAU,CACZA,IAAWG,CAAC,EACZ,MACF,CACIA,EAAE,cAAc,MAAQP,IAC1BO,EAAE,cAAc,IAAMP,EAE1B,EAkBI,OAfFO,GACS,CACTJ,IAAYI,CAAC,CACf,EAaI,cAAeN,EACf,SAAUC,EACT,GAAGG,EACN,EAKJZ,EAAI,YAAc,MC5FlB,OAAOD,GAAS,YAAAgB,GAAuB,aAAAC,OAAiB,QCAxD,OAAS,YAAAD,EAAU,aAAAC,OAAiB,QAwB7B,IAAMC,EAAmBC,GAAwC,CACtE,GAAM,CAACC,EAAiBC,CAAkB,EAAIL,EAE5C,CAAC,CAAC,EACE,CAACM,EAAcC,CAAe,EAAIP,EAEtCG,CAAY,EAER,CAACK,EAAYC,CAAa,EAAIT,EAAkB,EAAK,EACrD,CAACU,EAAUC,CAAW,EAAIX,EAAkB,EAAK,EACjD,CAACY,EAAW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U,KAAOK,GACjBL,EAAU,OAASM,GACnBN,EAAU,MAAQO,GAClBP,EAAU,QAAUQ,GACpBR,EAAU,QAAUS,GCpJpB,OAAO3E,OAAW,QAUX,IAAM4E,GAAM,CAAC,CAClB,IAAAC,EAAM,OACN,KAAAC,EAAO,OACP,SAAAvC,EACA,OAAAjC,EACA,GAAGO,CACL,IAEIb,GAAA,cAACc,EAAA,CAAG,GAAI+D,EAAK,KAAMC,EAAM,OAAQxE,EAAS,GAAGO,GAC1C0B,CACH,EAIJqC,GAAI,YAAc,MCvBlB,OAAO5E,MAAW,QA6BX,IAAM+E,GAAU,CAAC,CACtB,QAAAC,EACA,KAAAC,EACA,OAAA3E,EACA,QAAAgE,EACA,UAAAY,EACA,KAAAC,EACA,KAAAC,EACA,cAAAC,EACA,SAAAC,EACA,SAAA/C,EACA,IAAAgD,EACA,GAAG1E,CACL,IAAoB,CAClB,IAAM2E,EAAqC,CAAE,GAAGlF,CAAO,EAEjDmF,EAAyB1E,GAA8C,CACvEsE,GAAeA,IAAgBtE,CAAC,EAChCsE,GAAeA,IAAgBtE,CAAC,CACtC,EAKA,OACEf,EAAA,cAACc,EAAA,CACC,GAAG,UACH,MAAO0E,EACP,UAAWlB,EACX,SARsBvD,GAA8C,CAClEuE,GAAUD,IAAgBtE,CAAC,CACjC,EAOI,IAAKwE,EACL,KAAMH,EACN,aAAYF,GAAa,mBAEzB,KAAMC,EACL,GAAGtE,GAEJb,EAAA,cAACc,EAAA,CAAG,GAAG,UAAU,cAAe2E,GAC7BR,EACAD,CACH,EACAhF,EAAA,cAACc,EAAA,CAAG,GAAG,WAAWyB,CAAS,CAC7B,CAEJ,EAGAwC,GAAQ,YAAc","sourcesContent":["import UI from '../ui'\nimport React from 'react'\n/*\n * ImageProps interface\n *\n * Extends ComponentProps and defines additional props for the Img component.\n *\n * @property {string} [src] - The image source URL\n * @property {string} alt - Required alt text for image accessibility\n * @property {number} width - Required width of image\n * @property {number} [height] - Optional height of image\n * @property {\"eager\" | \"lazy\"} [loading=\"lazy\"] - Loading behavior\n * @property {string} [placeholder] - Fallback placeholder image\n * @property {\"high\" | \"low\"} [fetchpriority=\"low\"] - Image fetch priority\n * @property {\"sync\" | \"async\" | \"auto\"} [decoding=\"auto\"] - Decode setting\n * @property {function} [imgError] - Error callback\n * @property {function} [imgLoaded] - Loaded callback\n */\nexport type ImageProps = React.ComponentProps<'img'> &\n React.ComponentProps<typeof UI>\n\n/*\n * Img component\n *\n * Renders an <img> element with custom props.\n *\n * @param {string} src - The image source URL.\n * @param {string} alt - The alt text for the image.\n * @param {number} [width=480] - The width of the image.\n * @param {number} [height] - The height of the image.\n * @param {Object} [styles] - Additional CSS styles to apply.\n * @param {boolean} [renderStyles=true] - Whether to render the default styles.\n * @param {\"eager\" | \"lazy\"} [loading=\"lazy\"] - The loading attribute.\n * @param {string} [placeholder] - A placeholder image URL.\n * @param {\"high\" | \"low\"} [fetchpriority=\"low\"] - The fetchpriority attribute.\n * @param {\"sync\" | \"async\" | \"auto\"} [decoding=\"auto\"] - The decoding attribute.\n * @param {function} [imgLoaded] - Callback when image loads successfully.\n * @param {function} [imgError] - Callback when image errors.\n *\n * @returns {JSX.Element} The Img component.\n */\nexport const Img = ({\n src = '//',\n alt,\n width = 480,\n height,\n styles,\n loading = 'lazy',\n placeholder = `https://via.placeholder.com/${width}?text=PLACEHOLDER`,\n fetchpriority = 'low',\n decoding = 'auto',\n imgLoaded,\n imgError,\n ...props\n}: ImageProps) => {\n const handleImgError = (\n e: React.SyntheticEvent<HTMLImageElement, Event>,\n ): void => {\n if (imgError) {\n imgError?.(e)\n return\n }\n if (e.currentTarget.src !== placeholder) {\n e.currentTarget.src = placeholder\n }\n }\n\n const handleImgLoad = (\n e: React.SyntheticEvent<HTMLImageElement, Event>,\n ): void => {\n imgLoaded?.(e)\n }\n\n return (\n <UI\n as=\"img\"\n src={src}\n alt={alt}\n width={width}\n height={height || 'auto'}\n loading={loading}\n style={styles}\n onError={handleImgError}\n onLoad={handleImgLoad}\n fetchPriority={fetchpriority}\n decoding={decoding}\n {...props}\n />\n )\n}\n\nexport default Img\nImg.displayName = 'Img'\n","import React, { useState, ChangeEvent, useEffect } from 'react'\nimport { useTextToSpeech } from './useTextToSpeech'\nimport Textarea from '#components/form/textarea.jsx'\nimport TextToSpeechControls from './views/TextToSpeechControls'\n\n/**\n * Props for the TextToSpeechComponent.\n * @interface TextToSpeechComponentProps\n */\ninterface TextToSpeechComponentProps {\n /** Initial text to be spoken. Defaults to an empty string. */\n initialText?: string\n /** Whether to show the text input field. Defaults to true. */\n showTextInput?: boolean\n /** The voice to be used for speech synthesis. */\n voice?: SpeechSynthesisVoice | undefined\n /** The pitch of the voice. Defaults to 1. */\n pitch?: number\n /** The rate of speech. Defaults to 1. */\n rate?: number\n /** The language to be used for speech synthesis. */\n language?: string\n /** Player label */\n label?: string | React.ReactNode\n /** Callback function to be called when speech ends. */\n onEnd?: () => void\n}\n\n/**\n * A component that converts text to speech using the Web Speech API.\n * @param {TextToSpeechComponentProps} props - The props for the component.\n * @returns {JSX.Element} The rendered TextToSpeechComponent.\n */\nexport const TextToSpeech: React.FC<TextToSpeechComponentProps> = ({\n initialText = '',\n showTextInput = false,\n voice,\n pitch = 1,\n rate = 1,\n language,\n label,\n onEnd,\n}) => {\n const {\n speak,\n pause,\n resume,\n cancel,\n isSpeaking,\n isPaused,\n getAvailableLanguages,\n availableVoices,\n } = useTextToSpeech()\n const [text, setText] = useState<string>(initialText)\n console.log(getAvailableLanguages())\n\n useEffect(() => {\n setText(initialText)\n }, [initialText])\n\n const handleSpeak = (): void => {\n if (text.trim() !== '') {\n speak(text, { voice, pitch, rate }, handleEnd)\n }\n }\n\n const handleChange = (e: ChangeEvent<HTMLTextAreaElement>): void => {\n setText(e.target.value)\n }\n\n const handleEnd = (): void => {\n if (onEnd) {\n onEnd()\n }\n }\n\n return (\n <>\n {showTextInput && <Textarea value={text} onChange={handleChange} />}\n <TextToSpeechControls\n label={label}\n isSpeaking={isSpeaking}\n isPaused={isPaused}\n onSpeak={handleSpeak}\n onPause={pause}\n onResume={resume}\n onCancel={cancel}\n />\n </>\n )\n}\n\nexport default TextToSpeech\nTextToSpeech.displayName = 'TextToSpeechComponent'\n","import { useState, useEffect } from 'react'\n\n/**\n * Options for configuring speech synthesis.\n * @interface SpeechOptions\n */\ninterface SpeechOptions {\n /** The language for speech synthesis (e.g., 'en-US') */\n lang?: string\n\n /** The pitch of the voice (0 to 2) */\n pitch?: number\n /** The speed of the voice (0.1 to 10) */\n rate?: number\n\n /** The voice to use for speech synthesis */\n voice?: SpeechSynthesisVoice\n}\n/**\n * Custom hook to handle text-to-speech functionality.\n *\n * @param {SpeechSynthesisVoice} [initialVoice] - The initial voice to use for speech synthesis.\n * @returns {Object} An object containing methods to control speech synthesis and state variables.\n */\nexport const useTextToSpeech = (initialVoice?: SpeechSynthesisVoice) => {\n const [availableVoices, setAvailableVoices] = useState<\n SpeechSynthesisVoice[]\n >([])\n const [currentVoice, setCurrentVoice] = useState<\n SpeechSynthesisVoice | undefined\n >(initialVoice)\n\n const [isSpeaking, setIsSpeaking] = useState<boolean>(false)\n const [isPaused, setIsPaused] = useState<boolean>(false)\n const [utterance, setUtterance] = useState<SpeechSynthesisUtterance | null>(\n null,\n )\n\n useEffect(() => {\n const updateVoices = () => {\n const voices = window.speechSynthesis.getVoices()\n setAvailableVoices(voices)\n\n // Set default voice to Google US English if available\n const googleVoice = voices.find(\n (voice) => voice.name === 'Google US English',\n )\n if (googleVoice) {\n setCurrentVoice(googleVoice)\n } else {\n // Fallback to the first English voice if Google voice is not available\n const englishVoice = voices.find((voice) =>\n voice.lang.startsWith('en-'),\n )\n if (englishVoice) {\n setCurrentVoice(englishVoice)\n }\n }\n }\n\n updateVoices()\n window.speechSynthesis.onvoiceschanged = updateVoices\n\n return () => {\n window.speechSynthesis.onvoiceschanged = null\n }\n }, [])\n\n /**\n * Gets the list of available languages for speech synthesis.\n * @returns {string[]} An array of available language codes.\n */\n const getAvailableLanguages = () => {\n return [...new Set(availableVoices.map((voice) => voice.lang))]\n }\n\n /**\n * Initiates speech synthesis for the given text.\n *\n * @param {string} text - The text to be spoken.\n * @param {SpeechOptions} [options={}] - Options for speech synthesis.\n * @param {Function} [onEnd] - Callback function to be called when speech ends.\n */\n const speak = (\n text: string,\n options: SpeechOptions = {},\n onEnd?: () => void,\n ) => {\n const utterance = new SpeechSynthesisUtterance(text)\n\n utterance.lang = options.lang ?? 'en-US'\n utterance.pitch = options.pitch ?? 1\n utterance.rate = options.rate ?? 1\n utterance.voice = currentVoice ?? options.voice ?? null\n\n utterance.onend = () => {\n setIsSpeaking(false)\n setIsPaused(false)\n if (onEnd) {\n onEnd()\n }\n }\n\n if ('speechSynthesis' in window) {\n window.speechSynthesis.speak(utterance)\n setUtterance(utterance)\n setIsSpeaking(true)\n setIsPaused(false)\n } else {\n console.error('Speech synthesis not supported')\n // Handle the error appropriately\n }\n }\n\n /**\n * Changes the current voice used for speech synthesis.\n * @param {SpeechSynthesisVoice} voice - The new voice to use.\n */\n const changeVoice = (voice: SpeechSynthesisVoice) => {\n setCurrentVoice(voice)\n }\n\n /**\n * Pauses the ongoing speech synthesis.\n */\n const pause = () => {\n if (isSpeaking && !isPaused) {\n window.speechSynthesis.pause()\n setIsPaused(true)\n }\n }\n\n /**\n * Resumes the paused speech synthesis.\n */\n const resume = () => {\n if (isSpeaking && isPaused) {\n window.speechSynthesis.resume()\n setIsPaused(false)\n }\n }\n\n /**\n * Cancels the ongoing speech synthesis.\n */\n const cancel = () => {\n if (isSpeaking) {\n window.speechSynthesis.cancel()\n setIsSpeaking(false)\n setIsPaused(false)\n }\n }\n\n return {\n /** Initiates speech synthesis for the given text */\n speak,\n /** Pauses the ongoing speech synthesis */\n pause,\n /** Resumes the paused speech synthesis */\n resume,\n /** Cancels the ongoing speech synthesis */\n cancel,\n /** Indicates whether speech synthesis is currently active */\n isSpeaking,\n /** Indicates whether speech synthesis is currently paused */\n isPaused,\n /** Array of available voices for speech synthesis */\n availableVoices,\n /** Changes the current voice used for speech synthesis */\n changeVoice,\n /** The currently selected voice for speech synthesis */\n currentVoice,\n /** Gets the list of available languages for speech synthesis */\n getAvailableLanguages,\n }\n}\n","import React from 'react'\nimport Icon from '#components/icons/icon'\nimport UI from '#components/ui'\nimport { FC } from 'react'\n\n/**\n * Props for the TextToSpeechControls component.\n * @interface TextToSpeechControlsProps\n */\ninterface TextToSpeechControlsProps {\n /** Optional label for the controls */\n label?: string | React.ReactNode\n /** Indicates if the text-to-speech is currently speaking */\n isSpeaking: boolean\n /** Indicates if the text-to-speech is paused */\n isPaused: boolean\n /** Function to start speaking */\n onSpeak: () => void\n /** Function to pause speaking */\n onPause: () => void\n /** Function to resume speaking */\n onResume: () => void\n /** Function to cancel speaking */\n onCancel: () => void\n}\n\n/**\n * TTSButtonComponent props\n * @interface TTSButtonComponentProps\n */\ninterface TTSButtonComponentProps {\n /** The content of the button */\n children: React.ReactNode\n /** Function to call when the button is clicked */\n onClick: () => void\n}\n\n/**\n * TTSButtonComponent is a reusable button component for text-to-speech controls.\n * @param {TTSButtonComponentProps} props - The component props\n * @returns {React.ReactElement} The rendered button\n */\nexport const TTSButtonComponent: React.FC<TTSButtonComponentProps> = ({\n children,\n onClick,\n}) => {\n return (\n <UI\n as=\"button\"\n type=\"button\"\n className=\"tts-border\"\n data-btn=\"sm text pill\"\n onClick={onClick}\n >\n {children}\n </UI>\n )\n}\n\nexport const TTSButton = React.memo(TTSButtonComponent)\n\n/**\n * TextToSpeechControlsComponent interface extends FC<TextToSpeechControlsProps>\n * and includes a TTSButton property.\n * @interface TextToSpeechControlsComponent\n * @extends {FC<TextToSpeechControlsProps>}\n */\ninterface TextToSpeechControlsComponent extends FC<TextToSpeechControlsProps> {\n /** The TTSButton component used within TextToSpeechControls */\n TTSButton: typeof TTSButton\n}\n\n/**\n * TextToSpeechControls component provides a user interface for controlling text-to-speech functionality.\n * @param {TextToSpeechControlsProps} props - The component props\n * @returns {React.ReactElement} The rendered TextToSpeechControls component\n */\nconst TextToSpeechControls: TextToSpeechControlsComponent = ({\n label,\n isSpeaking,\n isPaused,\n onSpeak,\n onPause,\n onResume,\n onCancel,\n}) => {\n const iconSize = 16\n\n return (\n <UI as=\"div\" data-tts>\n {label && <p>{label}</p>}\n {!isSpeaking && (\n <TTSButton aria-label=\"Speak\" onClick={onSpeak}>\n <Icon.PlaySolid size={iconSize} />\n </TTSButton>\n )}\n {isSpeaking && !isPaused && (\n <TTSButton aria-label=\"Pause\" onClick={onPause}>\n <Icon.PauseSolid size={iconSize} />\n </TTSButton>\n )}\n {isPaused && (\n <TTSButton aria-label=\"Resume\" onClick={onResume}>\n <Icon.ResumeSolid size={iconSize} />\n </TTSButton>\n )}\n <TTSButton aria-label=\"Stop\" onClick={onCancel}>\n <Icon.StopSolid size={iconSize} />\n </TTSButton>\n </UI>\n )\n}\n\nTextToSpeechControls.displayName = 'TextToSpeechControls'\nTextToSpeechControls.TTSButton = TTSButton\n\nexport default TextToSpeechControls\n","import UI from '../ui'\nimport React, { ReactNode } from 'react'\n\ntype ComponentProps = React.ComponentProps<typeof UI>\n\n/**\n * Renders children elements without any wrapping component.\n * Can be used as a placeholder when no semantic landmark is needed.\n */\nexport const Landmarks = (children?: React.FC) => <>{children}</>\n\ntype HeaderProps = {\n headerBackground?: ReactNode\n} & ComponentProps\n/**\n * Header component.\n *\n * Renders a header landmark with a section child.\n *\n * @param children - The content to render inside the header.\n * @param styles - Optional styles object.\n * @param props - Other props.\n */\nexport const Header = ({\n id,\n children,\n headerBackground,\n styles,\n classes,\n ...props\n}: HeaderProps) => {\n return (\n <UI as=\"header\" id={id} styles={styles} className={classes} {...props}>\n {headerBackground}\n <UI as=\"section\">{children}</UI>\n </UI>\n )\n}\n\n/**\n * Main component.\n *\n * Renders a main landmark.\n *\n * @param children - The content to render inside the main element.\n * @param styles - Optional styles object.\n * @param props - Other props.\n */\nexport const Main = ({\n id,\n children,\n styles,\n classes,\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"main\" id={id} styles={styles} {...props} className={classes}>\n {children}\n </UI>\n )\n}\n\n/**\n * Footer component that renders a footer element with a section element inside.\n * @param {ReactNode} children - Child elements to render inside the section element.\n * @param styles - CSS styles to apply to the footer element.\n * @param props - Additional props to pass to the footer element.\n * @returns A React component that renders a footer element with a section element inside.\n */\nexport const Footer = ({\n id,\n classes,\n children,\n styles = {},\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"footer\" id={id} className={classes} styles={styles} {...props}>\n <UI as=\"section\">{children || 'Copyright © 2022'}</UI>\n </UI>\n )\n}\n\nexport const Aside = ({\n id,\n children,\n styles = {},\n classes,\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"aside\" id={id} styles={styles} className={classes} {...props}>\n <UI as=\"section\">{children}</UI>\n </UI>\n )\n}\n\n/**\n * Section component that renders a section element.\n *\n * @param children - Child elements to render inside the section.\n * @param styles - CSS styles to apply to the section.\n * @param props - Other props.\n */\nexport const Section = ({\n id,\n children,\n styles,\n classes,\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"section\" id={id} styles={styles} className={classes} {...props}>\n {children}\n </UI>\n )\n}\n\n/**\n * Article component renders an HTML <article> element.\n *\n * @param children - Child elements to render inside the article.\n * @param styles - CSS styles to apply to the article.\n * @param props - Additional props to pass to the article element.\n */\nexport const Article = ({\n id,\n children,\n\n styles,\n classes,\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"article\" id={id} styles={styles} className={classes} {...props}>\n {children}\n </UI>\n )\n}\n\nexport default Landmarks\n\nLandmarks.displayName = 'Landmarks'\nLandmarks.Header = Header\nLandmarks.Main = Main\nLandmarks.Footer = Footer\nLandmarks.Aside = Aside\nLandmarks.Section = Section\nLandmarks.Article = Article\n","import React from 'react'\nimport UI from '#components/ui'\n\nexport type TagProps = {\n /** HTML element to display the badge as span or p */\n elm?: 'span' | 'p'\n /** Aria role for the component - conditional */\n role: 'note' | 'status'\n} & React.ComponentProps<typeof UI>\n\nexport const Tag = ({\n elm = 'span',\n role = 'note',\n children,\n styles,\n ...props\n}: TagProps) => {\n return (\n <UI as={elm} role={role} styles={styles} {...props}>\n {children}\n </UI>\n )\n}\nexport default Tag\nTag.displayName = 'Tag'\n","import UI from \"#components/ui\";\nimport React from \"react\";\n\ntype DetailsProps = {\n /**\n * The summary text shown for the details.\n * Required.\n */\n summary: React.ReactNode;\n\n /**\n * The aria-label element for accessibility.\n */\n ariaLabel: string;\n} & React.ComponentProps<\"details\"> &\n Partial<React.ComponentProps<typeof UI>>;\n\n/**3\n * Details component props interface.\n *\n * @param {React.CSSProperties} [styles] - CSS styles object.\n * @param {string} [classes] - Classnames string.\n * @param {boolean} [open] - Whether the details is open.\n * @param {(e: React.PointerEvent<HTMLDetailsElement>) => void} [onToggle] - onToggle callback.\n * @param {(e: React.PointerEvent<HTMLDetailsElement>) => void} [onPointerDown] - onPointerDown callback.\n * @param {ReactNode} children - The content inside the details.\n * @param {string} [ariaLabel] - aria-label for accessibility.\n * @param {React.Ref<any>} [ref] - Ref object.\n * @param {Object} props - Other props.\n */\nexport const Details = ({\n summary,\n icon,\n styles,\n classes,\n ariaLabel,\n name,\n open,\n onPointerDown,\n onToggle,\n children,\n ref,\n ...props\n}: DetailsProps) => {\n const defaultStyles: React.CSSProperties = { ...styles };\n\n const onPointerDownCallback = (e: React.PointerEvent<HTMLDetailsElement>) => {\n if (onPointerDown) onPointerDown?.(e);\n if (onPointerDown) onPointerDown?.(e);\n };\n\n const onToggleCallback = (e: React.PointerEvent<HTMLDetailsElement>) => {\n if (onToggle) onPointerDown?.(e);\n };\n return (\n <UI\n as=\"details\"\n style={defaultStyles}\n className={classes}\n onToggle={onToggleCallback}\n ref={ref}\n open={open}\n aria-label={ariaLabel || \"Details dropdown\"}\n // aria-roledescription=\"detail accordion\"\n name={name}\n {...props}\n >\n <UI as=\"summary\" onPointerDown={onPointerDownCallback}>\n {icon}\n {summary}\n </UI>\n <UI as=\"section\">{children}</UI>\n </UI>\n );\n};\n\nexport default Details;\nDetails.displayName = \"Details\";\n"]}
1
+ {"version":3,"sources":["../src/components/images/img.tsx","../src/components/text-to-speech/TextToSpeech.tsx","../src/components/text-to-speech/useTextToSpeech.tsx","../src/components/text-to-speech/views/TextToSpeechControls.tsx","../src/components/layout/landmarks.tsx","../src/components/badge/badge.tsx","../src/components/tag/tag.tsx","../src/components/details/details.tsx"],"names":["React","useMemo","Img","src","alt","width","height","styles","loading","placeholder","fetchpriority","decoding","srcSet","sizes","onError","onLoad","props","defaultPlaceholder","w","h","svg","fallbackPlaceholder","ui_default","e","useState","useEffect","useTextToSpeech","initialVoice","availableVoices","setAvailableVoices","currentVoice","setCurrentVoice","isSpeaking","setIsSpeaking","isPaused","setIsPaused","utterance","setUtterance","updateVoices","voices","googleVoice","voice","englishVoice","text","options","onEnd","TTSButtonComponent","children","onClick","TTSButton","TextToSpeechControls","label","onSpeak","onPause","onResume","onCancel","icon_default","TextToSpeechControls_default","TextToSpeech","initialText","showTextInput","pitch","rate","language","speak","pause","resume","cancel","getAvailableLanguages","setText","handleSpeak","handleEnd","handleChange","textarea_default","Landmarks","Header","id","headerBackground","classes","Main","Footer","Aside","Section","Article","Badge","variant","Tag","elm","role","useCallback","Details","summary","icon","ariaLabel","name","open","onPointerDown","onToggle","ref","handlePointerDown","handleToggle"],"mappings":"g6BACA,OAAOA,IAAS,WAAAC,OAAe,QA6GxB,IAAMC,EAAM,CAAC,CAClB,IAAAC,EAAM,KACN,IAAAC,EACA,MAAAC,EAAQ,IACR,OAAAC,EACA,OAAAC,EACA,QAAAC,EAAU,OACV,YAAAC,EACA,cAAAC,EAAgB,MAChB,SAAAC,EAAW,OACX,OAAAC,EACA,MAAAC,EACA,QAAAC,EACA,OAAAC,EACA,GAAGC,CACL,IAAgB,CAad,IAAMC,EAAqBhB,GAAQ,IAAM,CACvC,IAAMiB,EAAI,OAAOb,GAAU,SAAWA,EAAQ,IACxCc,EAAI,OAAOb,GAAW,SAAWA,EAAS,KAAK,MAAMY,EAAI,GAAI,EAG7D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EMI,EAAeX,EAClBlE,GAAgD,CAC/C0E,IAAW1E,CAAC,CACd,EACA,CAAC0E,CAAQ,CACX,EAEA,OACEjG,EAAA,cAACsB,EAAA,CACC,GAAG,UACH,OAAQf,EACR,QAASuE,EACT,SAAUsB,EACV,IAAKF,EACL,KAAMH,EACN,aAAYF,EACZ,KAAMC,EACL,GAAG9E,GAEJhB,EAAA,cAACsB,EAAA,CAAG,GAAG,UAAU,cAAe6E,GAC7BP,EACAD,CACH,EACA3F,EAAA,cAACsB,EAAA,CAAG,GAAG,WAAWyB,CAAS,CAC7B,CAEJ,CACF,EAEA2C,GAAQ,YAAc","sourcesContent":["import UI from \"../ui\";\nimport React, { useMemo } from \"react\";\nimport type { ImgProps } from \"./img.types\";\n\n/**\n * Img - A semantic image component with accessibility and performance best practices.\n *\n * This component wraps the native `<img>` element with enhanced features:\n * - **Responsive images** via optional srcset/sizes\n * - **Lazy loading** by default for performance\n * - **Error handling** with configurable fallback placeholders\n * - **Type safety** with full TypeScript support\n *\n * ## Accessibility Patterns (WCAG 2.1 AA)\n *\n * ### Decorative Images\n * Images that are purely visual decoration should use an empty alt attribute.\n * These images are typically borders, patterns, or visual separators.\n *\n * @example\n * ```tsx\n * // ✅ GOOD: Decorative border image\n * <Img src=\"/decorative-border.png\" alt=\"\" />\n *\n * // ✅ GOOD: Background pattern\n * <Img src=\"/pattern.svg\" alt=\"\" loading=\"eager\" />\n * ```\n *\n * ### Semantic Images\n * Images that convey information must have descriptive alt text that explains\n * the content and purpose of the image.\n *\n * @example\n * ```tsx\n * // ✅ GOOD: Informative image with descriptive alt\n * <Img\n * src=\"/sales-chart.png\"\n * alt=\"Sales chart showing 30% revenue growth in Q4 2024\"\n * />\n *\n * // ✅ GOOD: Product photo with context\n * <Img\n * src=\"/laptop.jpg\"\n * alt=\"Silver MacBook Pro 14-inch on wooden desk\"\n * />\n * ```\n *\n * ## Performance Optimization\n *\n * ### Lazy Loading\n * By default, images use lazy loading to improve page load performance.\n * Only use `loading=\"eager\"` for above-the-fold images.\n *\n * @example\n * ```tsx\n * // ✅ GOOD: Lazy load below-the-fold image\n * <Img src=\"/photo.jpg\" alt=\"Photo\" />\n *\n * // ✅ GOOD: Eager load hero image\n * <Img\n * src=\"/hero.jpg\"\n * alt=\"Hero banner\"\n * loading=\"eager\"\n * fetchpriority=\"high\"\n * />\n * ```\n *\n * ### Responsive Images\n * Use srcset and sizes for responsive images to serve appropriate image sizes\n * based on viewport width, improving performance and bandwidth usage.\n *\n * @example\n * ```tsx\n * // ✅ GOOD: Responsive image with multiple sizes\n * <Img\n * src=\"/photo.jpg\"\n * srcSet=\"/photo-320w.jpg 320w, /photo-640w.jpg 640w, /photo-1024w.jpg 1024w\"\n * sizes=\"(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 800px\"\n * alt=\"Responsive image adapts to viewport\"\n * />\n * ```\n *\n * ## Error Handling\n *\n * @example\n * ```tsx\n * // ✅ GOOD: Custom placeholder on error\n * <Img\n * src=\"/photo.jpg\"\n * placeholder=\"/fallback.png\"\n * alt=\"User profile photo\"\n * />\n *\n * // ✅ GOOD: Custom error handler\n * <Img\n * src=\"/photo.jpg\"\n * onError={(e) => {\n * console.error('Image failed to load')\n * logToAnalytics('image_error', { src: e.currentTarget.src })\n * }}\n * alt=\"Photo\"\n * />\n * ```\n *\n * @param {ImgProps} props - Component props extending native img attributes\n * @returns {React.ReactElement} Image element with enhanced functionality\n *\n * @see {@link ImgProps} for complete prop documentation\n * @see https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html\n */\nexport const Img = ({\n src = \"//\",\n alt,\n width = 480,\n height,\n styles,\n loading = \"lazy\",\n placeholder,\n fetchpriority = \"low\",\n decoding = \"auto\",\n srcSet,\n sizes,\n onError,\n onLoad,\n ...props\n}: ImgProps) => {\n /**\n * Generates a performant, responsive SVG gradient placeholder.\n * Uses data URI to avoid network requests and memoizes based on dimensions.\n * The SVG uses viewBox for perfect scaling at any size.\n *\n * Features:\n * - Zero network requests (works offline)\n * - ~900 bytes vs. 5-10KB external image\n * - Responsive with viewBox\n * - Attractive gradient (indigo → purple → pink)\n * - Dimension text for debugging\n */\n const defaultPlaceholder = useMemo(() => {\n const w = typeof width === \"number\" ? width : 480;\n const h = typeof height === \"number\" ? height : Math.round(w * 0.75);\n\n // Responsive SVG with attractive gradient and dimension text\n const svg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 ${w} ${h}\">\n <defs>\n <linearGradient id=\"grad-${w}-${h}\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\">\n <stop offset=\"0%\" style=\"stop-color:#6366f1;stop-opacity:1\" />\n <stop offset=\"50%\" style=\"stop-color:#8b5cf6;stop-opacity:1\" />\n <stop offset=\"100%\" style=\"stop-color:#ec4899;stop-opacity:1\" />\n </linearGradient>\n </defs>\n <rect width=\"${w}\" height=\"${h}\" fill=\"url(#grad-${w}-${h})\"/>\n <circle cx=\"${w * 0.15}\" cy=\"${h * 0.2}\" r=\"${Math.min(w, h) * 0.08}\" fill=\"rgba(255,255,255,0.2)\"/>\n <path d=\"M0,${h * 0.75} Q${w * 0.25},${h * 0.65} ${w * 0.5},${h * 0.75} T${w},${h * 0.75} L${w},${h} L0,${h} Z\" fill=\"rgba(0,0,0,0.15)\"/>\n <text x=\"50%\" y=\"50%\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"system-ui,-apple-system,sans-serif\" font-size=\"${Math.max(16, Math.min(w, h) * 0.05)}\" font-weight=\"500\" fill=\"rgba(255,255,255,0.9)\">${w}×${h}</text>\n </svg>`;\n\n return `data:image/svg+xml,${encodeURIComponent(svg)}`;\n }, [width, height]);\n\n const fallbackPlaceholder = placeholder ?? defaultPlaceholder;\n\n /**\n * Handles image load errors.\n * Calls custom error handler if provided, then applies fallback placeholder.\n * The custom handler can prevent the default fallback by calling e.preventDefault().\n */\n const handleImgError = (\n e: React.SyntheticEvent<HTMLImageElement, Event>\n ): void => {\n // Call custom error handler first (for logging, analytics, etc.)\n if (onError) {\n onError(e);\n }\n\n // Apply fallback unless preventDefault() was called\n if (!e.defaultPrevented) {\n // Avoid infinite error loop by checking if already showing placeholder\n if (e.currentTarget.src !== fallbackPlaceholder) {\n e.currentTarget.src = fallbackPlaceholder;\n }\n }\n };\n\n /**\n * Handles successful image load.\n * Calls custom load handler if provided.\n */\n const handleImgLoad = (\n e: React.SyntheticEvent<HTMLImageElement, Event>\n ): void => {\n onLoad?.(e);\n };\n\n return (\n <UI\n as=\"img\"\n src={src}\n alt={alt}\n width={width}\n height={height || \"auto\"}\n loading={loading}\n style={styles}\n srcSet={srcSet}\n sizes={sizes}\n onError={handleImgError}\n onLoad={handleImgLoad}\n decoding={decoding}\n {...props}\n {...(fetchpriority && { fetchpriority })}\n />\n );\n};\n\nexport default Img;\nImg.displayName = \"Img\";\n","import React, { useState, ChangeEvent, useEffect } from 'react'\nimport { useTextToSpeech } from './useTextToSpeech'\nimport Textarea from '#components/form/textarea.jsx'\nimport TextToSpeechControls from './views/TextToSpeechControls'\n\n/**\n * Props for the TextToSpeechComponent.\n * @interface TextToSpeechComponentProps\n */\ninterface TextToSpeechComponentProps {\n /** Initial text to be spoken. Defaults to an empty string. */\n initialText?: string\n /** Whether to show the text input field. Defaults to true. */\n showTextInput?: boolean\n /** The voice to be used for speech synthesis. */\n voice?: SpeechSynthesisVoice | undefined\n /** The pitch of the voice. Defaults to 1. */\n pitch?: number\n /** The rate of speech. Defaults to 1. */\n rate?: number\n /** The language to be used for speech synthesis. */\n language?: string\n /** Player label */\n label?: string | React.ReactNode\n /** Callback function to be called when speech ends. */\n onEnd?: () => void\n}\n\n/**\n * A component that converts text to speech using the Web Speech API.\n * @param {TextToSpeechComponentProps} props - The props for the component.\n * @returns {JSX.Element} The rendered TextToSpeechComponent.\n */\nexport const TextToSpeech: React.FC<TextToSpeechComponentProps> = ({\n initialText = '',\n showTextInput = false,\n voice,\n pitch = 1,\n rate = 1,\n language,\n label,\n onEnd,\n}) => {\n const {\n speak,\n pause,\n resume,\n cancel,\n isSpeaking,\n isPaused,\n getAvailableLanguages,\n availableVoices,\n } = useTextToSpeech()\n const [text, setText] = useState<string>(initialText)\n console.log(getAvailableLanguages())\n\n useEffect(() => {\n setText(initialText)\n }, [initialText])\n\n const handleSpeak = (): void => {\n if (text.trim() !== '') {\n speak(text, { voice, pitch, rate }, handleEnd)\n }\n }\n\n const handleChange = (e: ChangeEvent<HTMLTextAreaElement>): void => {\n setText(e.target.value)\n }\n\n const handleEnd = (): void => {\n if (onEnd) {\n onEnd()\n }\n }\n\n return (\n <>\n {showTextInput && <Textarea value={text} onChange={handleChange} />}\n <TextToSpeechControls\n label={label}\n isSpeaking={isSpeaking}\n isPaused={isPaused}\n onSpeak={handleSpeak}\n onPause={pause}\n onResume={resume}\n onCancel={cancel}\n />\n </>\n )\n}\n\nexport default TextToSpeech\nTextToSpeech.displayName = 'TextToSpeechComponent'\n","import { useState, useEffect } from 'react'\n\n/**\n * Options for configuring speech synthesis.\n * @interface SpeechOptions\n */\ninterface SpeechOptions {\n /** The language for speech synthesis (e.g., 'en-US') */\n lang?: string\n\n /** The pitch of the voice (0 to 2) */\n pitch?: number\n /** The speed of the voice (0.1 to 10) */\n rate?: number\n\n /** The voice to use for speech synthesis */\n voice?: SpeechSynthesisVoice\n}\n/**\n * Custom hook to handle text-to-speech functionality.\n *\n * @param {SpeechSynthesisVoice} [initialVoice] - The initial voice to use for speech synthesis.\n * @returns {Object} An object containing methods to control speech synthesis and state variables.\n */\nexport const useTextToSpeech = (initialVoice?: SpeechSynthesisVoice) => {\n const [availableVoices, setAvailableVoices] = useState<\n SpeechSynthesisVoice[]\n >([])\n const [currentVoice, setCurrentVoice] = useState<\n SpeechSynthesisVoice | undefined\n >(initialVoice)\n\n const [isSpeaking, setIsSpeaking] = useState<boolean>(false)\n const [isPaused, setIsPaused] = useState<boolean>(false)\n const [utterance, setUtterance] = useState<SpeechSynthesisUtterance | null>(\n null,\n )\n\n useEffect(() => {\n const updateVoices = () => {\n const voices = window.speechSynthesis.getVoices()\n setAvailableVoices(voices)\n\n // Set default voice to Google US English if available\n const googleVoice = voices.find(\n (voice) => voice.name === 'Google US English',\n )\n if (googleVoice) {\n setCurrentVoice(googleVoice)\n } else {\n // Fallback to the first English voice if Google voice is not available\n const englishVoice = voices.find((voice) =>\n voice.lang.startsWith('en-'),\n )\n if (englishVoice) {\n setCurrentVoice(englishVoice)\n }\n }\n }\n\n updateVoices()\n window.speechSynthesis.onvoiceschanged = updateVoices\n\n return () => {\n window.speechSynthesis.onvoiceschanged = null\n }\n }, [])\n\n /**\n * Gets the list of available languages for speech synthesis.\n * @returns {string[]} An array of available language codes.\n */\n const getAvailableLanguages = () => {\n return [...new Set(availableVoices.map((voice) => voice.lang))]\n }\n\n /**\n * Initiates speech synthesis for the given text.\n *\n * @param {string} text - The text to be spoken.\n * @param {SpeechOptions} [options={}] - Options for speech synthesis.\n * @param {Function} [onEnd] - Callback function to be called when speech ends.\n */\n const speak = (\n text: string,\n options: SpeechOptions = {},\n onEnd?: () => void,\n ) => {\n const utterance = new SpeechSynthesisUtterance(text)\n\n utterance.lang = options.lang ?? 'en-US'\n utterance.pitch = options.pitch ?? 1\n utterance.rate = options.rate ?? 1\n utterance.voice = currentVoice ?? options.voice ?? null\n\n utterance.onend = () => {\n setIsSpeaking(false)\n setIsPaused(false)\n if (onEnd) {\n onEnd()\n }\n }\n\n if ('speechSynthesis' in window) {\n window.speechSynthesis.speak(utterance)\n setUtterance(utterance)\n setIsSpeaking(true)\n setIsPaused(false)\n } else {\n console.error('Speech synthesis not supported')\n // Handle the error appropriately\n }\n }\n\n /**\n * Changes the current voice used for speech synthesis.\n * @param {SpeechSynthesisVoice} voice - The new voice to use.\n */\n const changeVoice = (voice: SpeechSynthesisVoice) => {\n setCurrentVoice(voice)\n }\n\n /**\n * Pauses the ongoing speech synthesis.\n */\n const pause = () => {\n if (isSpeaking && !isPaused) {\n window.speechSynthesis.pause()\n setIsPaused(true)\n }\n }\n\n /**\n * Resumes the paused speech synthesis.\n */\n const resume = () => {\n if (isSpeaking && isPaused) {\n window.speechSynthesis.resume()\n setIsPaused(false)\n }\n }\n\n /**\n * Cancels the ongoing speech synthesis.\n */\n const cancel = () => {\n if (isSpeaking) {\n window.speechSynthesis.cancel()\n setIsSpeaking(false)\n setIsPaused(false)\n }\n }\n\n return {\n /** Initiates speech synthesis for the given text */\n speak,\n /** Pauses the ongoing speech synthesis */\n pause,\n /** Resumes the paused speech synthesis */\n resume,\n /** Cancels the ongoing speech synthesis */\n cancel,\n /** Indicates whether speech synthesis is currently active */\n isSpeaking,\n /** Indicates whether speech synthesis is currently paused */\n isPaused,\n /** Array of available voices for speech synthesis */\n availableVoices,\n /** Changes the current voice used for speech synthesis */\n changeVoice,\n /** The currently selected voice for speech synthesis */\n currentVoice,\n /** Gets the list of available languages for speech synthesis */\n getAvailableLanguages,\n }\n}\n","import React from 'react'\nimport Icon from '#components/icons/icon'\nimport UI from '#components/ui'\nimport { FC } from 'react'\n\n/**\n * Props for the TextToSpeechControls component.\n * @interface TextToSpeechControlsProps\n */\ninterface TextToSpeechControlsProps {\n /** Optional label for the controls */\n label?: string | React.ReactNode\n /** Indicates if the text-to-speech is currently speaking */\n isSpeaking: boolean\n /** Indicates if the text-to-speech is paused */\n isPaused: boolean\n /** Function to start speaking */\n onSpeak: () => void\n /** Function to pause speaking */\n onPause: () => void\n /** Function to resume speaking */\n onResume: () => void\n /** Function to cancel speaking */\n onCancel: () => void\n}\n\n/**\n * TTSButtonComponent props\n * @interface TTSButtonComponentProps\n */\ninterface TTSButtonComponentProps {\n /** The content of the button */\n children: React.ReactNode\n /** Function to call when the button is clicked */\n onClick: () => void\n}\n\n/**\n * TTSButtonComponent is a reusable button component for text-to-speech controls.\n * @param {TTSButtonComponentProps} props - The component props\n * @returns {React.ReactElement} The rendered button\n */\nexport const TTSButtonComponent: React.FC<TTSButtonComponentProps> = ({\n children,\n onClick,\n}) => {\n return (\n <UI\n as=\"button\"\n type=\"button\"\n className=\"tts-border\"\n data-btn=\"sm text pill\"\n onClick={onClick}\n >\n {children}\n </UI>\n )\n}\n\nexport const TTSButton = React.memo(TTSButtonComponent)\n\n/**\n * TextToSpeechControlsComponent interface extends FC<TextToSpeechControlsProps>\n * and includes a TTSButton property.\n * @interface TextToSpeechControlsComponent\n * @extends {FC<TextToSpeechControlsProps>}\n */\ninterface TextToSpeechControlsComponent extends FC<TextToSpeechControlsProps> {\n /** The TTSButton component used within TextToSpeechControls */\n TTSButton: typeof TTSButton\n}\n\n/**\n * TextToSpeechControls component provides a user interface for controlling text-to-speech functionality.\n * @param {TextToSpeechControlsProps} props - The component props\n * @returns {React.ReactElement} The rendered TextToSpeechControls component\n */\nconst TextToSpeechControls: TextToSpeechControlsComponent = ({\n label,\n isSpeaking,\n isPaused,\n onSpeak,\n onPause,\n onResume,\n onCancel,\n}) => {\n const iconSize = 16\n\n return (\n <UI as=\"div\" data-tts>\n {label && <p>{label}</p>}\n {!isSpeaking && (\n <TTSButton aria-label=\"Speak\" onClick={onSpeak}>\n <Icon.PlaySolid size={iconSize} />\n </TTSButton>\n )}\n {isSpeaking && !isPaused && (\n <TTSButton aria-label=\"Pause\" onClick={onPause}>\n <Icon.PauseSolid size={iconSize} />\n </TTSButton>\n )}\n {isPaused && (\n <TTSButton aria-label=\"Resume\" onClick={onResume}>\n <Icon.ResumeSolid size={iconSize} />\n </TTSButton>\n )}\n <TTSButton aria-label=\"Stop\" onClick={onCancel}>\n <Icon.StopSolid size={iconSize} />\n </TTSButton>\n </UI>\n )\n}\n\nTextToSpeechControls.displayName = 'TextToSpeechControls'\nTextToSpeechControls.TTSButton = TTSButton\n\nexport default TextToSpeechControls\n","import UI from '../ui'\nimport React, { ReactNode } from 'react'\n\ntype ComponentProps = React.ComponentProps<typeof UI>\n\n/**\n * Renders children elements without any wrapping component.\n * Can be used as a placeholder when no semantic landmark is needed.\n */\nexport const Landmarks = (children?: React.FC) => <>{children}</>\n\ntype HeaderProps = {\n headerBackground?: ReactNode\n} & ComponentProps\n/**\n * Header component.\n *\n * Renders a header landmark with a section child.\n *\n * @param children - The content to render inside the header.\n * @param styles - Optional styles object.\n * @param props - Other props.\n */\nexport const Header = ({\n id,\n children,\n headerBackground,\n styles,\n classes,\n ...props\n}: HeaderProps) => {\n return (\n <UI as=\"header\" id={id} styles={styles} className={classes} {...props}>\n {headerBackground}\n <UI as=\"section\">{children}</UI>\n </UI>\n )\n}\n\n/**\n * Main component.\n *\n * Renders a main landmark.\n *\n * @param children - The content to render inside the main element.\n * @param styles - Optional styles object.\n * @param props - Other props.\n */\nexport const Main = ({\n id,\n children,\n styles,\n classes,\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"main\" id={id} styles={styles} {...props} className={classes}>\n {children}\n </UI>\n )\n}\n\n/**\n * Footer component that renders a footer element with a section element inside.\n * @param {ReactNode} children - Child elements to render inside the section element.\n * @param styles - CSS styles to apply to the footer element.\n * @param props - Additional props to pass to the footer element.\n * @returns A React component that renders a footer element with a section element inside.\n */\nexport const Footer = ({\n id,\n classes,\n children,\n styles = {},\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"footer\" id={id} className={classes} styles={styles} {...props}>\n <UI as=\"section\">{children || 'Copyright © 2022'}</UI>\n </UI>\n )\n}\n\nexport const Aside = ({\n id,\n children,\n styles = {},\n classes,\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"aside\" id={id} styles={styles} className={classes} {...props}>\n <UI as=\"section\">{children}</UI>\n </UI>\n )\n}\n\n/**\n * Section component that renders a section element.\n *\n * @param children - Child elements to render inside the section.\n * @param styles - CSS styles to apply to the section.\n * @param props - Other props.\n */\nexport const Section = ({\n id,\n children,\n styles,\n classes,\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"section\" id={id} styles={styles} className={classes} {...props}>\n {children}\n </UI>\n )\n}\n\n/**\n * Article component renders an HTML <article> element.\n *\n * @param children - Child elements to render inside the article.\n * @param styles - CSS styles to apply to the article.\n * @param props - Additional props to pass to the article element.\n */\nexport const Article = ({\n id,\n children,\n\n styles,\n classes,\n ...props\n}: ComponentProps) => {\n return (\n <UI as=\"article\" id={id} styles={styles} className={classes} {...props}>\n {children}\n </UI>\n )\n}\n\nexport default Landmarks\n\nLandmarks.displayName = 'Landmarks'\nLandmarks.Header = Header\nLandmarks.Main = Main\nLandmarks.Footer = Footer\nLandmarks.Aside = Aside\nLandmarks.Section = Section\nLandmarks.Article = Article\n","import UI from '#components/ui'\nimport React from 'react'\n\n/**\n * Props for the Badge component\n *\n * @property {React.ReactNode} children - Content to display inside the badge (typically numbers or short text)\n * @property {string} [id] - Optional HTML id attribute for the badge element\n * @property {React.CSSProperties} [styles] - Inline styles to apply to the badge\n * @property {string} [classes] - CSS class names to apply to the badge\n * @property {'rounded'} [variant] - Visual variant of the badge. Use 'rounded' for circular badges (fixed size with ellipsis for overflow)\n * @property {string} [aria-label] - Accessible label for screen readers. Required for icon-only or number-only badges\n * @property {'status' | 'note'} [role] - ARIA role for the badge. Defaults to 'status' for dynamic content\n */\nexport type BadgeProps = {\n /**\n * Content to display inside the badge (typically numbers or short text)\n */\n children?: React.ReactNode\n /**\n * Visual variant of the badge\n * - 'rounded': Circular badge style\n */\n variant?: 'rounded'\n} & React.ComponentProps<typeof UI>\n\n/**\n * Badge - A small label component for displaying status, counts, or notifications\n *\n * The Badge component is used to display supplementary information alongside other content,\n * such as notification counts, status indicators, or labels. It renders as a semantic `<sup>`\n * element with a nested `<span>` required for the component's styling architecture.\n *\n * ## Styling Architecture\n *\n * The Badge uses a nested structure (`<sup><span>content</span></sup>`) which is required\n * for the SCSS styling system. The outer `<sup>` element provides positioning context,\n * while the inner `<span>` receives the visual styling (background, padding, border-radius).\n *\n * ## Rounded Variant Behavior\n *\n * The `rounded` variant creates a perfect circular badge with fixed dimensions (1.5625rem).\n * Content that exceeds the available space will be truncated with an ellipsis (...).\n * **Best practice**: Format large numbers yourself (e.g., pass \"99+\" instead of \"999\").\n *\n * ## Accessibility Considerations\n *\n * - **Semantic HTML**: Uses `<sup>` (superscript) element for proper positioning context\n * - **ARIA Role**: Defaults to `role=\"status\"` for dynamic badges (e.g., unread counts)\n * - **Accessible Names**: For icon-only or number-only badges, provide an `aria-label`\n * to give context (e.g., \"3 unread messages\" instead of just \"3\")\n * - **Live Regions**: The `role=\"status\"` makes badges announce updates to screen readers\n *\n * @param {BadgeProps} props - Component props\n * @returns {React.ReactElement} A Badge component\n *\n * @example\n * // Basic badge with notification count\n * <p>\n * Messages\n * <Badge aria-label=\"3 unread messages\">3</Badge>\n * </p>\n *\n * @example\n * // Rounded badge variant (perfect circle)\n * <p>\n * Notifications\n * <Badge variant=\"rounded\" aria-label=\"99 or more notifications\">99+</Badge>\n * </p>\n *\n * @example\n * // Status badge with custom styling\n * <p>\n * Active Users\n * <Badge styles={{ backgroundColor: 'green', color: 'white' }}>21</Badge>\n * </p>\n *\n * @example\n * // ✅ GOOD: Accessible badge with descriptive label and formatted content\n * <Badge variant=\"rounded\" aria-label=\"12 items in cart\">12</Badge>\n *\n * @example\n * // ✅ GOOD: Large numbers formatted by developer\n * <Badge variant=\"rounded\" aria-label=\"More than 99 notifications\">99+</Badge>\n *\n * @example\n * // ❌ BAD: Number-only badge without context for screen readers\n * <Badge>12</Badge>\n */\nexport const Badge = ({ id, styles, classes, children, variant, ...props }: BadgeProps) => {\n // Build data-badge attribute for variant styling\n const dataBadge = variant ? variant : undefined\n\n return (\n <UI\n as=\"sup\"\n id={id}\n styles={styles}\n className={classes}\n data-badge={dataBadge}\n role=\"status\"\n {...props}\n >\n <UI as=\"span\">{children}</UI>\n </UI>\n )\n}\n\nBadge.displayName = 'Badge'\nexport default Badge\n","import React from 'react'\nimport UI from '#components/ui'\nimport type { TagProps, TagVariant } from './tag.types'\n\n/**\n * Tag - A small inline label component for displaying status, versions, or environment indicators\n *\n * The Tag component is used to highlight supplementary information such as release stages\n * (alpha, beta, stable), environment indicators (production), or version labels. It renders\n * as either a `<span>` (inline) or `<p>` (block) element with semantic ARIA roles.\n *\n * ## Design Philosophy\n *\n * Tags serve as visual and semantic indicators that:\n * - Communicate the state or stage of features, releases, or environments\n * - Provide quick visual scanning through color-coded variants\n * - Maintain accessibility through proper ARIA roles and labels\n *\n * ## Styling Architecture\n *\n * The Tag component uses CSS custom properties (CSS variables) for theming and styling,\n * allowing for easy customization through the `data-tag` attribute. Each variant\n * (alpha, beta, stable, production) applies predefined color schemes defined in SCSS.\n *\n * ## Accessibility Considerations (WCAG 2.1 AA Compliance)\n *\n * - **Semantic Roles**: Uses `role=\"note\"` for static tags or `role=\"status\"` for dynamic content\n * - `role=\"note\"`: Read once by screen readers, suitable for static labels (default)\n * - `role=\"status\"`: Announces updates to screen readers, use for changing status indicators\n * - **Color Independence**: Don't rely solely on color to convey meaning - include text labels\n * - **Text Alternatives**: For icon-only tags, provide `aria-label` for screen reader context\n * - **Contrast Ratios**: All variants meet WCAG AA contrast requirements (4.5:1 for normal text)\n * - **Live Regions**: When using `role=\"status\"`, tag becomes a live region for accessibility\n *\n * ## When to Use Each Role\n *\n * **Use `role=\"note\"` (default) when:**\n * - Displaying static version numbers (e.g., \"v2.1.0\")\n * - Showing fixed environment indicators (e.g., \"Beta Feature\")\n * - Labeling unchanging content categories\n *\n * **Use `role=\"status\"` when:**\n * - Indicating real-time status that may change (e.g., \"Processing\" → \"Complete\")\n * - Displaying live build/deployment states\n * - Showing dynamic feature flags that toggle\n *\n * @param {TagProps} props - Component props\n * @returns {React.ReactElement} A Tag component\n *\n * @example\n * // Basic tag with beta variant (default inline span)\n * <Tag variant=\"beta\">Beta</Tag>\n *\n * @example\n * // Production environment indicator as block element\n * <Tag elm=\"p\" variant=\"production\">Production Environment</Tag>\n *\n * @example\n * // Dynamic status tag with live updates\n * <Tag role=\"status\" variant=\"stable\">\n * {isDeployed ? 'Deployed' : 'Deploying...'}\n * </Tag>\n *\n * @example\n * // Tag with custom styling and accessibility label\n * <Tag\n * variant=\"alpha\"\n * aria-label=\"Alpha version - may contain bugs\"\n * styles={{ fontSize: '0.75rem' }}\n * >\n * Alpha\n * </Tag>\n *\n * @example\n * // ✅ GOOD: Clear text content with variant for visual enhancement\n * <Tag variant=\"stable\">v2.0 Stable</Tag>\n *\n * @example\n * // ✅ GOOD: Dynamic status with proper role\n * <Tag role=\"status\" variant=\"production\">{deploymentStatus}</Tag>\n *\n * @example\n * // ✅ GOOD: Accessible tag with descriptive label\n * <Tag variant=\"beta\" aria-label=\"Beta feature - feedback welcome\">\n * Beta\n * </Tag>\n *\n * @example\n * // ❌ BAD: Relying only on color without text\n * <Tag variant=\"production\" aria-label=\"Production\" />\n *\n * @example\n * // ❌ BAD: Using status role for static content\n * <Tag role=\"status\" variant=\"stable\">v1.0</Tag>\n */\nexport const Tag = ({\n elm = 'span',\n role = 'note',\n variant,\n children,\n styles,\n ...props\n}: TagProps) => {\n // Map variant to data-tag attribute for SCSS styling\n const dataTag = variant ? variant : undefined\n\n return (\n <UI\n as={elm}\n role={role}\n data-tag={dataTag}\n styles={styles}\n {...props}\n >\n {children}\n </UI>\n )\n}\n\nTag.displayName = 'Tag'\nexport default Tag\nexport type { TagProps, TagVariant }\n","import UI from \"#components/ui\";\nimport React, { useCallback } from \"react\";\nimport type { DetailsProps } from \"./details.types\";\n\n/**\n * Details - A progressive disclosure component using native HTML `<details>` element.\n *\n * This component wraps the native `<details>` and `<summary>` elements to provide\n * an accessible, semantic way to show and hide content. It supports accordion behavior\n * through the `name` attribute and includes proper keyboard navigation out of the box.\n *\n * ## Key Features:\n * - **Semantic HTML**: Uses native `<details>` for built-in accessibility\n * - **Keyboard Support**: Space/Enter to toggle, fully accessible by default\n * - **Accordion Mode**: Group multiple details with `name` for exclusive expansion\n * - **Customizable**: Supports icons, custom styles, and event handlers\n *\n * ## Accessibility:\n * - ✅ WCAG 2.1 AA compliant using semantic HTML\n * - ✅ Native keyboard support (Space, Enter)\n * - ✅ Screen reader compatible (announced as \"disclosure\" or \"expandable\")\n * - ✅ Focus indicators automatically applied via CSS\n * - ✅ `aria-expanded` managed automatically by browser\n *\n * @example\n * ```tsx\n * // Basic usage\n * <Details summary=\"Click to expand\">\n * <p>Hidden content here</p>\n * </Details>\n * ```\n *\n * @example\n * ```tsx\n * // With icon and custom styling\n * <Details\n * summary=\"Shipping Information\"\n * icon={<ChevronDownIcon />}\n * classes=\"custom-details\"\n * onToggle={(e) => console.log('Open:', e.currentTarget.open)}\n * >\n * <p>Ships within 2-3 business days</p>\n * </Details>\n * ```\n *\n * @example\n * ```tsx\n * // Accordion mode - only one open at a time\n * <Details name=\"faq\" summary=\"Question 1\">Answer 1</Details>\n * <Details name=\"faq\" summary=\"Question 2\">Answer 2</Details>\n * <Details name=\"faq\" summary=\"Question 3\">Answer 3</Details>\n * ```\n */\nexport const Details = React.forwardRef<HTMLDetailsElement, DetailsProps>(\n (\n {\n summary,\n icon,\n styles,\n classes,\n ariaLabel,\n name,\n open,\n onPointerDown,\n onToggle,\n children,\n ...props\n },\n ref\n ) => {\n // Memoize callbacks to prevent unnecessary re-renders of child components\n const handlePointerDown = useCallback(\n (e: React.PointerEvent<HTMLElement>) => {\n onPointerDown?.(e as React.PointerEvent<HTMLDetailsElement>);\n },\n [onPointerDown]\n );\n\n const handleToggle = useCallback(\n (e: React.SyntheticEvent<HTMLDetailsElement>) => {\n onToggle?.(e);\n },\n [onToggle]\n );\n\n return (\n <UI\n as=\"details\"\n styles={styles}\n classes={classes}\n onToggle={handleToggle}\n ref={ref}\n open={open}\n aria-label={ariaLabel}\n name={name}\n {...props}\n >\n <UI as=\"summary\" onPointerDown={handlePointerDown}>\n {icon}\n {summary}\n </UI>\n <UI as=\"section\">{children}</UI>\n </UI>\n );\n }\n);\n\nDetails.displayName = \"Details\";\n\nexport default Details;\n"]}
@@ -0,0 +1,323 @@
1
+ import React from 'react';
2
+ import { U as UI } from './ui-d01b50d4.js';
3
+
4
+ /**
5
+ * Props for the Link component.
6
+ *
7
+ * The Link component renders accessible anchor elements with enhanced security,
8
+ * styling variants, and WCAG 2.1 AA compliance. It supports both traditional
9
+ * text links and button-styled links for call-to-action scenarios.
10
+ *
11
+ * ## Accessibility Considerations
12
+ *
13
+ * - External links automatically include `rel="noopener noreferrer"` for security
14
+ * - Links should have descriptive text or `aria-label` for screen readers
15
+ * - Focus indicators must meet WCAG 2.4.7 contrast requirements (3:1 minimum)
16
+ * - Button-styled links maintain semantic `<a>` element for proper navigation
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * // Basic link
21
+ * <Link href="/about">About Us</Link>
22
+ *
23
+ * // External link with prefetch
24
+ * <Link href="https://example.com" target="_blank" prefetch>
25
+ * Visit Example
26
+ * </Link>
27
+ *
28
+ * // Button-styled link
29
+ * <Link href="/signup" btnStyle="primary">
30
+ * <b>Sign Up Now</b>
31
+ * </Link>
32
+ * ```
33
+ */
34
+ type LinkProps = {
35
+ /**
36
+ * The URL that the hyperlink points to.
37
+ * Can be relative or absolute, internal or external.
38
+ *
39
+ * @example
40
+ * ```tsx
41
+ * href="/products"
42
+ * href="https://example.com"
43
+ * href="mailto:hello@example.com"
44
+ * href="tel:+1234567890"
45
+ * ```
46
+ */
47
+ href?: string;
48
+ /**
49
+ * Where to display the linked URL.
50
+ *
51
+ * - `_self` (default): Current browsing context
52
+ * - `_blank`: New tab/window (automatically adds security attributes)
53
+ * - `_parent`: Parent browsing context
54
+ * - `_top`: Top-level browsing context
55
+ *
56
+ * Note: When `target="_blank"`, `rel="noopener noreferrer"` is automatically
57
+ * added for security unless explicitly overridden.
58
+ *
59
+ * @example
60
+ * ```tsx
61
+ * target="_blank" // Opens in new tab with security
62
+ * ```
63
+ */
64
+ target?: string;
65
+ /**
66
+ * Relationship between current document and linked URL.
67
+ *
68
+ * Common values:
69
+ * - `noopener`: Prevents window.opener access (security)
70
+ * - `noreferrer`: Prevents referrer header (privacy)
71
+ * - `nofollow`: Hints search engines not to follow (SEO)
72
+ * - `prefetch`: Hints to prefetch the resource (performance)
73
+ *
74
+ * Note: For `target="_blank"`, this component automatically merges
75
+ * `noopener noreferrer` with any user-provided values for security.
76
+ *
77
+ * @example
78
+ * ```tsx
79
+ * rel="nofollow noopener"
80
+ * rel="author"
81
+ * ```
82
+ */
83
+ rel?: string;
84
+ /**
85
+ * Content to display inside the link.
86
+ *
87
+ * For accessibility, ensure link text is descriptive and meaningful.
88
+ * Avoid generic text like "click here" or "read more" without context.
89
+ *
90
+ * @example
91
+ * ```tsx
92
+ * // ✅ Good: Descriptive link text
93
+ * <Link href="/products">View all products</Link>
94
+ *
95
+ * // ❌ Bad: Generic link text without context
96
+ * <Link href="/products">Click here</Link>
97
+ *
98
+ * // ✅ Good: Icon with accessible label
99
+ * <Link href="/home" aria-label="Return to homepage">
100
+ * <HomeIcon aria-hidden="true" />
101
+ * </Link>
102
+ * ```
103
+ */
104
+ children: React.ReactNode;
105
+ /**
106
+ * Inline CSS styles to apply to the link element.
107
+ * Can be used to override CSS custom properties.
108
+ *
109
+ * @example
110
+ * ```tsx
111
+ * styles={{
112
+ * '--link-color': '#ff0000',
113
+ * '--link-decoration': 'underline',
114
+ * }}
115
+ * ```
116
+ */
117
+ styles?: React.CSSProperties;
118
+ /**
119
+ * Hints to the browser to prefetch the linked resource.
120
+ *
121
+ * When `true` and `target="_blank"`, adds `rel="prefetch"` along with
122
+ * security attributes. This can improve perceived performance but should
123
+ * be used judiciously as it consumes bandwidth.
124
+ *
125
+ * Note: Browser support varies. Modern browsers may ignore this hint.
126
+ *
127
+ * @default false
128
+ * @example
129
+ * ```tsx
130
+ * <Link href="/next-page" prefetch>Next Page</Link>
131
+ * ```
132
+ */
133
+ prefetch?: boolean;
134
+ /**
135
+ * Applies button-like styling to the link.
136
+ *
137
+ * When set, the link renders with button styling including padding,
138
+ * borders, and hover effects while maintaining semantic anchor behavior.
139
+ *
140
+ * Common values:
141
+ * - `"btn"`: Standard button styling
142
+ * - `"pill"`: Rounded pill button styling
143
+ *
144
+ * Alternative: Wrap children in `<b>` or `<i>` tags for automatic styling:
145
+ * - `<b>`: Applies button styling
146
+ * - `<i>`: Applies pill styling
147
+ *
148
+ * @example
149
+ * ```tsx
150
+ * // Using btnStyle prop
151
+ * <Link href="/signup" btnStyle="btn">Sign Up</Link>
152
+ *
153
+ * // Using child wrapper (automatic detection)
154
+ * <Link href="/signup"><b>Sign Up</b></Link>
155
+ * <Link href="/signup"><i>Pill Button</i></Link>
156
+ * ```
157
+ */
158
+ btnStyle?: string;
159
+ /**
160
+ * Event handler called when the link is clicked or activated.
161
+ *
162
+ * **Recommended for most use cases**, especially analytics and tracking.
163
+ * This event fires for:
164
+ * - Mouse clicks
165
+ * - Touch/tap interactions
166
+ * - Keyboard activation (Enter key)
167
+ * - Assistive technology activation
168
+ *
169
+ * Use `onClick` when you need to track ALL user activations, including
170
+ * keyboard users. This ensures full accessibility coverage.
171
+ *
172
+ * @param event - The mouse event
173
+ * @example
174
+ * ```tsx
175
+ * // ✅ RECOMMENDED: onClick tracks all activation methods
176
+ * <Link
177
+ * href="/products"
178
+ * onClick={(e) => {
179
+ * trackEvent('link_click', { href: '/products' });
180
+ * }}
181
+ * >
182
+ * Products
183
+ * </Link>
184
+ * ```
185
+ */
186
+ onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
187
+ /**
188
+ * Event handler called when a pointer device button is pressed on the link.
189
+ *
190
+ * Use this for specific pointer interactions like:
191
+ * - Drag-and-drop detection
192
+ * - Touch gesture recognition
193
+ * - Distinguishing input types (mouse vs touch vs pen)
194
+ * - Providing early visual feedback before click completes
195
+ *
196
+ * **⚠️ Accessibility Note**: Unlike `onClick`, this does NOT fire for
197
+ * keyboard activation (Enter key). If you need to track all user interactions
198
+ * including keyboard users, use `onClick` instead.
199
+ *
200
+ * @param event - The pointer event
201
+ * @example
202
+ * ```tsx
203
+ * // Use onPointerDown for pointer-specific interactions
204
+ * <Link
205
+ * href="/products"
206
+ * onPointerDown={(e) => {
207
+ * // Distinguish between mouse (2), touch (5), and pen (3)
208
+ * console.log('Pointer type:', e.pointerType);
209
+ * }}
210
+ * >
211
+ * Products
212
+ * </Link>
213
+ * ```
214
+ *
215
+ * @example
216
+ * ```tsx
217
+ * // ✅ Use both handlers together for comprehensive tracking
218
+ * <Link
219
+ * href="/products"
220
+ * onClick={(e) => trackAllActivations(e)}
221
+ * onPointerDown={(e) => provideFeedback(e)}
222
+ * >
223
+ * Products
224
+ * </Link>
225
+ * ```
226
+ */
227
+ onPointerDown?: (event: React.PointerEvent<HTMLAnchorElement>) => void;
228
+ } & React.ComponentProps<typeof UI> & React.ComponentPropsWithoutRef<"a">;
229
+
230
+ /**
231
+ * Link - A semantic, accessible anchor component with enhanced security and styling.
232
+ *
233
+ * The Link component renders accessible `<a>` elements with automatic security
234
+ * attributes for external links, customizable styling variants, and full WCAG 2.1
235
+ * AA compliance. It supports traditional text links, button-styled links, and
236
+ * programmatic focus management via ref forwarding.
237
+ *
238
+ * ## Features
239
+ *
240
+ * - 🔒 **Automatic Security**: External links get `rel="noopener noreferrer"`
241
+ * - ♿ **WCAG 2.1 AA Compliant**: Accessible focus indicators and semantic HTML
242
+ * - 🎨 **Flexible Styling**: Text links, button links, and pill variants
243
+ * - ⚡ **Performance**: Optional prefetch hints for faster navigation
244
+ * - 🎯 **Ref Forwarding**: Direct DOM access for focus management and scroll
245
+ * - 🧪 **Type-Safe**: Full TypeScript support with comprehensive prop types
246
+ *
247
+ * ## Accessibility
248
+ *
249
+ * - ✅ Semantic `<a>` element for proper keyboard navigation
250
+ * - ✅ Focus indicators meet WCAG 2.4.7 (3:1 contrast ratio)
251
+ * - ✅ Screen readers announce link purpose and destination
252
+ * - ✅ External links include security attributes automatically
253
+ * - ✅ Supports `aria-label` for icon-only or ambiguous links
254
+ * - ✅ Ref forwarding enables skip-link patterns
255
+ *
256
+ * @example
257
+ * // Basic internal link
258
+ * <Link href="/about">About Us</Link>
259
+ *
260
+ * @example
261
+ * // External link with automatic security
262
+ * <Link href="https://example.com" target="_blank">
263
+ * Visit Example
264
+ * </Link>
265
+ *
266
+ * @example
267
+ * // Button-styled call-to-action link
268
+ * <Link href="/signup">
269
+ * <b>Get Started</b>
270
+ * </Link>
271
+ *
272
+ * @example
273
+ * // Icon-only link with accessible label
274
+ * <Link href="/settings" aria-label="Open settings">
275
+ * <SettingsIcon aria-hidden="true" />
276
+ * </Link>
277
+ *
278
+ * @example
279
+ * // Analytics tracking with onClick (includes keyboard users)
280
+ * <Link
281
+ * href="/products"
282
+ * onClick={(e) => trackEvent('link_click', { href: '/products' })}
283
+ * >
284
+ * Browse Products
285
+ * </Link>
286
+ *
287
+ * @example
288
+ * // Skip link with ref forwarding for focus management
289
+ * const mainRef = useRef<HTMLAnchorElement>(null);
290
+ *
291
+ * <Link ref={mainRef} href="#main-content">
292
+ * Skip to main content
293
+ * </Link>
294
+ *
295
+ * @example
296
+ * // Custom styled link with CSS variables
297
+ * <Link
298
+ * href="/products"
299
+ * styles={{
300
+ * '--link-color': '#0066cc',
301
+ * '--link-decoration': 'underline',
302
+ * }}
303
+ * >
304
+ * Browse Products
305
+ * </Link>
306
+ *
307
+ * @example
308
+ * // ✅ GOOD: Descriptive link text
309
+ * <Link href="/docs/installation">
310
+ * Read installation guide
311
+ * </Link>
312
+ *
313
+ * @example
314
+ * // ❌ BAD: Generic link text (poor for screen readers)
315
+ * <Link href="/docs/installation">
316
+ * Click here
317
+ * </Link>
318
+ *
319
+ * @see {@link LinkProps} for complete prop documentation
320
+ */
321
+ declare const Link: React.ForwardRefExoticComponent<Omit<LinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
322
+
323
+ export { Link as L, LinkProps as a };