@fpkit/acss 0.5.12 → 0.5.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/README.md +89 -0
  2. package/libs/{chunk-DV56L5YX.cjs → chunk-2LTJ7HHX.cjs} +4 -4
  3. package/libs/{chunk-EQ67LF46.js → chunk-2Y7W75TT.js} +3 -3
  4. package/libs/{chunk-KKLTUJFB.cjs → chunk-3MKLDCKQ.cjs} +5 -5
  5. package/libs/chunk-3MKLDCKQ.cjs.map +1 -0
  6. package/libs/{chunk-X3EVB7VS.cjs → chunk-5S4ORA4C.cjs} +3 -3
  7. package/libs/{chunk-O6QZBB6G.js → chunk-772NRB75.js} +5 -5
  8. package/libs/chunk-772NRB75.js.map +1 -0
  9. package/libs/{chunk-6BVXFW7U.cjs → chunk-AHDJGCG5.cjs} +3 -3
  10. package/libs/{chunk-E3XP6BEX.cjs → chunk-B7F5FS6D.cjs} +3 -3
  11. package/libs/chunk-D4YLRWAO.cjs +18 -0
  12. package/libs/chunk-D4YLRWAO.cjs.map +1 -0
  13. package/libs/chunk-ETFLFC2S.js +10 -0
  14. package/libs/chunk-ETFLFC2S.js.map +1 -0
  15. package/libs/chunk-GZ4QFPRY.js +9 -0
  16. package/libs/chunk-GZ4QFPRY.js.map +1 -0
  17. package/libs/{chunk-LHVJKDMA.cjs → chunk-J32EZPYD.cjs} +3 -3
  18. package/libs/chunk-JJ43O4Y5.js +8 -0
  19. package/libs/chunk-JJ43O4Y5.js.map +1 -0
  20. package/libs/chunk-KUKIVRC2.js +7 -0
  21. package/libs/chunk-KUKIVRC2.js.map +1 -0
  22. package/libs/chunk-L75OQKEI.cjs +13 -0
  23. package/libs/chunk-L75OQKEI.cjs.map +1 -0
  24. package/libs/{chunk-LL7HTLMS.cjs → chunk-M5RRNTVX.cjs} +3 -3
  25. package/libs/{chunk-LIQJ7ZZR.js → chunk-NGTJDDFO.js} +2 -2
  26. package/libs/chunk-OK5QEIMD.cjs +17 -0
  27. package/libs/chunk-OK5QEIMD.cjs.map +1 -0
  28. package/libs/chunk-P2DC76ZZ.cjs +18 -0
  29. package/libs/chunk-P2DC76ZZ.cjs.map +1 -0
  30. package/libs/chunk-PQ2K3BM6.cjs +17 -0
  31. package/libs/chunk-PQ2K3BM6.cjs.map +1 -0
  32. package/libs/{chunk-QCMV4VQZ.js → chunk-QLZWHAMK.js} +2 -2
  33. package/libs/{chunk-BIP2NY53.js → chunk-RIVUMPOG.js} +2 -2
  34. package/libs/{chunk-ICCKQ2GC.cjs → chunk-ROZI23GS.cjs} +4 -4
  35. package/libs/{chunk-NHYXGV3L.js → chunk-SMYRLO3E.js} +2 -2
  36. package/libs/{chunk-5ZM4XL44.js → chunk-TYRCEX2L.js} +2 -2
  37. package/libs/chunk-VUH3FXGJ.js +11 -0
  38. package/libs/chunk-VUH3FXGJ.js.map +1 -0
  39. package/libs/{chunk-PPOOBUOS.js → chunk-XBA562WW.js} +2 -2
  40. package/libs/{chunk-QVV34QEH.cjs → chunk-XTQKWY7W.cjs} +3 -3
  41. package/libs/{chunk-YWOYVRFT.js → chunk-ZANSFMTD.js} +3 -3
  42. package/libs/components/alert/alert.css +1 -1
  43. package/libs/components/alert/alert.css.map +1 -1
  44. package/libs/components/alert/alert.min.css +2 -2
  45. package/libs/components/badge/badge.css +1 -1
  46. package/libs/components/badge/badge.css.map +1 -1
  47. package/libs/components/badge/badge.min.css +2 -2
  48. package/libs/components/breadcrumbs/breadcrumb.cjs +9 -5
  49. package/libs/components/breadcrumbs/breadcrumb.d.cts +271 -32
  50. package/libs/components/breadcrumbs/breadcrumb.d.ts +271 -32
  51. package/libs/components/breadcrumbs/breadcrumb.js +3 -3
  52. package/libs/components/button.cjs +4 -4
  53. package/libs/components/button.d.cts +2 -2
  54. package/libs/components/button.d.ts +2 -2
  55. package/libs/components/button.js +2 -2
  56. package/libs/components/buttons/button.css +1 -1
  57. package/libs/components/buttons/button.css.map +1 -1
  58. package/libs/components/buttons/button.min.css +2 -2
  59. package/libs/components/card.cjs +7 -7
  60. package/libs/components/card.d.cts +277 -33
  61. package/libs/components/card.d.ts +277 -33
  62. package/libs/components/card.js +2 -2
  63. package/libs/components/cards/card.css +1 -1
  64. package/libs/components/cards/card.css.map +1 -1
  65. package/libs/components/cards/card.min.css +2 -2
  66. package/libs/components/details/details.css +1 -1
  67. package/libs/components/details/details.css.map +1 -1
  68. package/libs/components/details/details.min.css +2 -2
  69. package/libs/components/dialog/dialog.cjs +7 -7
  70. package/libs/components/dialog/dialog.css +1 -1
  71. package/libs/components/dialog/dialog.css.map +1 -1
  72. package/libs/components/dialog/dialog.d.cts +88 -34
  73. package/libs/components/dialog/dialog.d.ts +88 -34
  74. package/libs/components/dialog/dialog.js +5 -5
  75. package/libs/components/dialog/dialog.min.css +2 -2
  76. package/libs/components/form/fields.cjs +4 -4
  77. package/libs/components/form/fields.d.cts +2 -2
  78. package/libs/components/form/fields.d.ts +2 -2
  79. package/libs/components/form/fields.js +2 -2
  80. package/libs/components/form/textarea.cjs +4 -4
  81. package/libs/components/form/textarea.d.cts +2 -2
  82. package/libs/components/form/textarea.d.ts +2 -2
  83. package/libs/components/form/textarea.js +2 -2
  84. package/libs/components/heading/heading.cjs +3 -3
  85. package/libs/components/heading/heading.d.cts +3 -14
  86. package/libs/components/heading/heading.d.ts +3 -14
  87. package/libs/components/heading/heading.js +2 -2
  88. package/libs/components/icons/icon.cjs +4 -4
  89. package/libs/components/icons/icon.d.cts +148 -4
  90. package/libs/components/icons/icon.d.ts +148 -4
  91. package/libs/components/icons/icon.js +2 -2
  92. package/libs/components/images/img.css +1 -1
  93. package/libs/components/images/img.css.map +1 -1
  94. package/libs/components/images/img.min.css +2 -2
  95. package/libs/components/link/link.cjs +4 -4
  96. package/libs/components/link/link.d.cts +2 -2
  97. package/libs/components/link/link.d.ts +2 -2
  98. package/libs/components/link/link.js +2 -2
  99. package/libs/components/list/list.cjs +5 -5
  100. package/libs/components/list/list.d.cts +3 -3
  101. package/libs/components/list/list.d.ts +3 -3
  102. package/libs/components/list/list.js +2 -2
  103. package/libs/components/modal.cjs +4 -4
  104. package/libs/components/modal.js +3 -3
  105. package/libs/components/nav/nav.cjs +7 -7
  106. package/libs/components/nav/nav.d.cts +2 -2
  107. package/libs/components/nav/nav.d.ts +2 -2
  108. package/libs/components/nav/nav.js +3 -3
  109. package/libs/components/text/text.cjs +5 -5
  110. package/libs/components/text/text.d.cts +2 -2
  111. package/libs/components/text/text.d.ts +2 -2
  112. package/libs/components/text/text.js +2 -2
  113. package/libs/heading-3648c538.d.ts +250 -0
  114. package/libs/hooks.cjs +7 -0
  115. package/libs/hooks.d.cts +5 -0
  116. package/libs/hooks.d.ts +5 -0
  117. package/libs/hooks.js +3 -0
  118. package/libs/icons.cjs +3 -3
  119. package/libs/icons.d.cts +1 -1
  120. package/libs/icons.d.ts +1 -1
  121. package/libs/icons.js +2 -2
  122. package/libs/index.cjs +112 -91
  123. package/libs/index.cjs.map +1 -1
  124. package/libs/index.css +1 -1
  125. package/libs/index.css.map +1 -1
  126. package/libs/index.d.cts +515 -31
  127. package/libs/index.d.ts +515 -31
  128. package/libs/index.js +31 -19
  129. package/libs/index.js.map +1 -1
  130. package/libs/ui-645f95b5.d.ts +285 -0
  131. package/package.json +2 -83
  132. package/src/components/README-UI.mdx +416 -0
  133. package/src/components/alert/ACCESSIBILITY.md +319 -0
  134. package/src/components/alert/README.mdx +475 -19
  135. package/src/components/alert/alert.scss +113 -6
  136. package/src/components/alert/alert.stories.tsx +372 -0
  137. package/src/components/alert/alert.test.tsx +762 -0
  138. package/src/components/alert/alert.tsx +331 -66
  139. package/src/components/alert/views/alert-actions.tsx +13 -0
  140. package/src/components/alert/views/alert-content.tsx +17 -0
  141. package/src/components/alert/views/alert-icon.tsx +53 -0
  142. package/src/components/alert/views/alert-screen-reader-text.tsx +30 -0
  143. package/src/components/alert/views/alert-title.tsx +23 -0
  144. package/src/components/alert/views/alert-view.tsx +158 -0
  145. package/src/components/alert/views/index.ts +12 -0
  146. package/src/components/badge/badge.mdx +186 -49
  147. package/src/components/badge/badge.scss +20 -2
  148. package/src/components/badge/badge.stories.tsx +160 -14
  149. package/src/components/badge/badge.test.tsx +179 -0
  150. package/src/components/badge/badge.tsx +97 -4
  151. package/src/components/breadcrumbs/README.mdx +364 -45
  152. package/src/components/breadcrumbs/__snapshots__/breadcrumb.test.tsx.snap +152 -0
  153. package/src/components/breadcrumbs/breadcrumb.stories.tsx +7 -3
  154. package/src/components/breadcrumbs/breadcrumb.test.tsx +490 -0
  155. package/src/components/breadcrumbs/breadcrumb.tsx +427 -170
  156. package/src/components/buttons/button.scss +34 -31
  157. package/src/components/buttons/button.stories.tsx +35 -0
  158. package/src/components/cards/README.mdx +657 -0
  159. package/src/components/cards/card.scss +22 -0
  160. package/src/components/cards/card.stories.tsx +167 -5
  161. package/src/components/cards/card.test.tsx +360 -20
  162. package/src/components/cards/card.tsx +200 -79
  163. package/src/components/cards/card.types.ts +135 -0
  164. package/src/components/cards/card.utils.ts +79 -0
  165. package/src/components/details/ACCESSIBILITY-REVIEW-LIVE.md +1050 -0
  166. package/src/components/details/ACCESSIBILITY-REVIEW.md +502 -0
  167. package/src/components/details/README.mdx +437 -69
  168. package/src/components/details/details.scss +16 -7
  169. package/src/components/details/details.test.tsx +385 -0
  170. package/src/components/details/details.tsx +101 -69
  171. package/src/components/details/details.types.ts +76 -0
  172. package/src/components/dialog/README.mdx +513 -110
  173. package/src/components/dialog/dialog-modal.tsx +79 -56
  174. package/src/components/dialog/dialog.scss +53 -3
  175. package/src/components/dialog/dialog.stories.tsx +10 -7
  176. package/src/components/dialog/dialog.test.tsx +450 -0
  177. package/src/components/dialog/dialog.tsx +69 -59
  178. package/src/components/dialog/dialog.types.ts +133 -0
  179. package/src/components/dialog/views/dialog-footer.tsx +54 -11
  180. package/src/components/dialog/views/dialog-header.tsx +20 -15
  181. package/src/components/heading/heading.stories.tsx +44 -4
  182. package/src/components/heading/heading.tsx +89 -23
  183. package/src/components/icons/README.mdx +332 -0
  184. package/src/components/icons/icon.stories.tsx +74 -1
  185. package/src/components/icons/icon.tsx +89 -1
  186. package/src/components/icons/types.ts +47 -0
  187. package/src/components/images/README.mdx +340 -24
  188. package/src/components/images/img.scss +19 -3
  189. package/src/components/images/img.stories.tsx +424 -15
  190. package/src/components/images/img.test.tsx +354 -25
  191. package/src/components/images/img.tsx +186 -63
  192. package/src/components/images/img.types.ts +211 -0
  193. package/src/components/title/MIGRATION.md +199 -0
  194. package/src/components/title/README.md +326 -0
  195. package/src/components/title/README.mdx +452 -0
  196. package/src/components/title/title.stories.tsx +393 -0
  197. package/src/components/title/title.test.tsx +251 -0
  198. package/src/components/title/title.tsx +219 -0
  199. package/src/components/ui.stories.tsx +894 -0
  200. package/src/components/ui.test.tsx +559 -0
  201. package/src/components/ui.tsx +266 -15
  202. package/src/components/word-count/README.md +240 -0
  203. package/src/hooks.ts +1 -0
  204. package/src/index.ts +10 -2
  205. package/src/sass/_properties.scss +1 -0
  206. package/src/styles/alert/alert.css +94 -4
  207. package/src/styles/alert/alert.css.map +1 -1
  208. package/src/styles/badge/badge.css +20 -2
  209. package/src/styles/badge/badge.css.map +1 -1
  210. package/src/styles/buttons/button.css +31 -31
  211. package/src/styles/buttons/button.css.map +1 -1
  212. package/src/styles/cards/card.css +16 -0
  213. package/src/styles/cards/card.css.map +1 -1
  214. package/src/styles/details/details.css +19 -8
  215. package/src/styles/details/details.css.map +1 -1
  216. package/src/styles/dialog/dialog.css +43 -2
  217. package/src/styles/dialog/dialog.css.map +1 -1
  218. package/src/styles/images/img.css +15 -3
  219. package/src/styles/images/img.css.map +1 -1
  220. package/src/styles/index.css +240 -51
  221. package/src/styles/index.css.map +1 -1
  222. package/src/test/setup.d.ts +9 -0
  223. package/src/test/setup.ts +53 -1
  224. package/libs/chunk-6TE5QEVE.cjs +0 -13
  225. package/libs/chunk-6TE5QEVE.cjs.map +0 -1
  226. package/libs/chunk-7K76RW2A.cjs +0 -18
  227. package/libs/chunk-7K76RW2A.cjs.map +0 -1
  228. package/libs/chunk-BSPKFLO4.js +0 -8
  229. package/libs/chunk-BSPKFLO4.js.map +0 -1
  230. package/libs/chunk-BV5CLH44.cjs +0 -18
  231. package/libs/chunk-BV5CLH44.cjs.map +0 -1
  232. package/libs/chunk-DKGJHKGW.js +0 -9
  233. package/libs/chunk-DKGJHKGW.js.map +0 -1
  234. package/libs/chunk-ECLD37WN.cjs +0 -16
  235. package/libs/chunk-ECLD37WN.cjs.map +0 -1
  236. package/libs/chunk-HYBZBN4G.js +0 -8
  237. package/libs/chunk-HYBZBN4G.js.map +0 -1
  238. package/libs/chunk-KKLTUJFB.cjs.map +0 -1
  239. package/libs/chunk-M5QL5TAE.cjs +0 -14
  240. package/libs/chunk-M5QL5TAE.cjs.map +0 -1
  241. package/libs/chunk-NE6YXTMC.js +0 -7
  242. package/libs/chunk-NE6YXTMC.js.map +0 -1
  243. package/libs/chunk-O6QZBB6G.js.map +0 -1
  244. package/libs/chunk-SXVZSWX6.js +0 -11
  245. package/libs/chunk-SXVZSWX6.js.map +0 -1
  246. package/libs/ui-9a6f9f8d.d.ts +0 -24
  247. package/src/components/cards/README.md +0 -80
  248. package/src/components/dialog/hooks/useClickOutside.ts +0 -33
  249. /package/libs/{chunk-DV56L5YX.cjs.map → chunk-2LTJ7HHX.cjs.map} +0 -0
  250. /package/libs/{chunk-EQ67LF46.js.map → chunk-2Y7W75TT.js.map} +0 -0
  251. /package/libs/{chunk-X3EVB7VS.cjs.map → chunk-5S4ORA4C.cjs.map} +0 -0
  252. /package/libs/{chunk-6BVXFW7U.cjs.map → chunk-AHDJGCG5.cjs.map} +0 -0
  253. /package/libs/{chunk-E3XP6BEX.cjs.map → chunk-B7F5FS6D.cjs.map} +0 -0
  254. /package/libs/{chunk-LHVJKDMA.cjs.map → chunk-J32EZPYD.cjs.map} +0 -0
  255. /package/libs/{chunk-LL7HTLMS.cjs.map → chunk-M5RRNTVX.cjs.map} +0 -0
  256. /package/libs/{chunk-LIQJ7ZZR.js.map → chunk-NGTJDDFO.js.map} +0 -0
  257. /package/libs/{chunk-QCMV4VQZ.js.map → chunk-QLZWHAMK.js.map} +0 -0
  258. /package/libs/{chunk-BIP2NY53.js.map → chunk-RIVUMPOG.js.map} +0 -0
  259. /package/libs/{chunk-ICCKQ2GC.cjs.map → chunk-ROZI23GS.cjs.map} +0 -0
  260. /package/libs/{chunk-NHYXGV3L.js.map → chunk-SMYRLO3E.js.map} +0 -0
  261. /package/libs/{chunk-5ZM4XL44.js.map → chunk-TYRCEX2L.js.map} +0 -0
  262. /package/libs/{chunk-PPOOBUOS.js.map → chunk-XBA562WW.js.map} +0 -0
  263. /package/libs/{chunk-QVV34QEH.cjs.map → chunk-XTQKWY7W.cjs.map} +0 -0
  264. /package/libs/{chunk-YWOYVRFT.js.map → chunk-ZANSFMTD.js.map} +0 -0
package/libs/index.d.cts CHANGED
@@ -3,7 +3,6 @@ export { Card, Content as CardContent, Footer as CardFooter, CardProps, Title as
3
3
  export { default as Field, FieldProps } from './components/form/fields.cjs';
4
4
  export { F as Box, F as FP, I as Input, a as InputProps } from './inputs-f3a216db.js';
5
5
  export { default as Icon, IconProps } from './components/icons/icon.cjs';
6
- import { F as FP } from './ui-9a6f9f8d.js';
7
6
  import React__default, { ReactNode } from 'react';
8
7
  export { default as Link, LinkProps, default as To } from './components/link/link.cjs';
9
8
  export { default as List, ListItemProps } from './components/list/list.cjs';
@@ -11,16 +10,319 @@ export { Modal, ModalProps } from './components/modal.cjs';
11
10
  export { default as Popover, PopoverProps } from './components/popover/popover.cjs';
12
11
  export { RenderTable as TBL, TableProps } from './components/tables/table.cjs';
13
12
  export { Dialog } from './components/dialog/dialog.cjs';
13
+ import { U as UI } from './ui-645f95b5.js';
14
14
  export { default as Nav, NavItem, NavItemProps, NavList, NavListProps, NavProps } from './components/nav/nav.cjs';
15
- export { default as Text, TextProps, Title } from './components/text/text.cjs';
16
- export { TitleProps } from './components/heading/heading.cjs';
15
+ export { default as Text, TextProps } from './components/text/text.cjs';
16
+ export { b as Heading, H as HeadingLevel, T as Title, a as TitleProps } from './heading-3648c538.js';
17
17
  export { default as Textarea, TextareaProps } from './components/form/textarea.cjs';
18
18
  import { C as ComponentProps$1 } from './component-props-a8a2f97e.js';
19
- export { default as Breadcrumb } from './components/breadcrumbs/breadcrumb.cjs';
19
+ export { default as Breadcrumb, BreadcrumbProps, CustomRoute, useBreadcrumbSegments } from './components/breadcrumbs/breadcrumb.cjs';
20
20
 
21
- type ImageProps = React__default.ComponentProps<'img'> & React__default.ComponentProps<typeof FP>;
21
+ /**
22
+ * Props for the Img component.
23
+ *
24
+ * Extends native HTML img element attributes with additional functionality
25
+ * for responsive images, loading states, and error handling.
26
+ *
27
+ * ## Accessibility Guidelines (WCAG 2.1 AA)
28
+ *
29
+ * **Decorative Images:**
30
+ * Images that are purely visual decoration should have an empty alt attribute.
31
+ *
32
+ * @example
33
+ * ```tsx
34
+ * // ✅ Decorative image (border, background pattern, visual separator)
35
+ * <Img src="/decorative-border.png" alt="" />
36
+ * ```
37
+ *
38
+ * **Semantic Images:**
39
+ * Images that convey information or meaning must have descriptive alt text.
40
+ *
41
+ * @example
42
+ * ```tsx
43
+ * // ✅ Semantic image (charts, diagrams, photos with meaning)
44
+ * <Img
45
+ * src="/sales-chart.png"
46
+ * alt="Sales chart showing 30% growth in Q4 2024"
47
+ * />
48
+ * ```
49
+ *
50
+ * **Responsive Images:**
51
+ * Use srcset and sizes for responsive images to optimize performance.
52
+ *
53
+ * @example
54
+ * ```tsx
55
+ * // ✅ Responsive image with srcset
56
+ * <Img
57
+ * src="/photo.jpg"
58
+ * srcSet="/photo-320w.jpg 320w, /photo-640w.jpg 640w, /photo-1024w.jpg 1024w"
59
+ * sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw"
60
+ * alt="Team photo from annual conference"
61
+ * />
62
+ * ```
63
+ *
64
+ * @see https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html
65
+ */
66
+ interface ImgProps extends Omit<React__default.ImgHTMLAttributes<HTMLImageElement>, 'placeholder'> {
67
+ /**
68
+ * The image source URL.
69
+ * @default '//'
70
+ */
71
+ src?: string;
72
+ /**
73
+ * Alternative text for the image.
74
+ * - **Empty string (`""`)** for decorative images
75
+ * - **Descriptive text** for semantic images that convey meaning
76
+ *
77
+ * @example
78
+ * ```tsx
79
+ * // Decorative
80
+ * <Img src="/border.png" alt="" />
81
+ *
82
+ * // Semantic
83
+ * <Img src="/logo.png" alt="Company logo" />
84
+ * ```
85
+ */
86
+ alt?: string;
87
+ /**
88
+ * Width of the image in pixels.
89
+ * @default 480
90
+ */
91
+ width?: number | string;
92
+ /**
93
+ * Height of the image in pixels.
94
+ * When not provided, defaults to 'auto'.
95
+ */
96
+ height?: number | string;
97
+ /**
98
+ * Inline styles to apply to the image.
99
+ */
100
+ styles?: React__default.CSSProperties;
101
+ /**
102
+ * Loading behavior for the image.
103
+ * - `"lazy"` (default): Defers loading until near viewport
104
+ * - `"eager"`: Loads immediately
105
+ *
106
+ * @default "lazy"
107
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#loading
108
+ */
109
+ loading?: 'eager' | 'lazy';
110
+ /**
111
+ * Fallback placeholder image URL to display on error.
112
+ * If not provided and image fails to load, a default placeholder is used.
113
+ *
114
+ * @example
115
+ * ```tsx
116
+ * <Img
117
+ * src="/photo.jpg"
118
+ * placeholder="/fallback.png"
119
+ * alt="User profile photo"
120
+ * />
121
+ * ```
122
+ */
123
+ placeholder?: string;
124
+ /**
125
+ * Hint for the browser to prioritize image fetching.
126
+ * - `"high"`: High priority (above-the-fold images)
127
+ * - `"low"` (default): Low priority
128
+ * - `"auto"`: Browser decides
129
+ *
130
+ * @default "low"
131
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#fetchpriority
132
+ */
133
+ fetchpriority?: 'high' | 'low' | 'auto';
134
+ /**
135
+ * Decoding hint for the browser.
136
+ * - `"async"`: Decode asynchronously (don't block rendering)
137
+ * - `"sync"`: Decode synchronously
138
+ * - `"auto"` (default): Browser decides
139
+ *
140
+ * @default "auto"
141
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#decoding
142
+ */
143
+ decoding?: 'sync' | 'async' | 'auto';
144
+ /**
145
+ * Responsive image sources with width descriptors.
146
+ * Allows browser to choose appropriate image based on viewport.
147
+ *
148
+ * @example
149
+ * ```tsx
150
+ * <Img
151
+ * src="/photo.jpg"
152
+ * srcSet="/photo-320w.jpg 320w, /photo-640w.jpg 640w"
153
+ * sizes="(max-width: 640px) 100vw, 640px"
154
+ * alt="Responsive image"
155
+ * />
156
+ * ```
157
+ *
158
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#srcset
159
+ */
160
+ srcSet?: string;
161
+ /**
162
+ * Media conditions for responsive image sizing.
163
+ * Works with srcSet to determine which image to load.
164
+ *
165
+ * @example
166
+ * ```tsx
167
+ * sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 800px"
168
+ * ```
169
+ *
170
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#sizes
171
+ */
172
+ sizes?: string;
173
+ /**
174
+ * Callback fired when the image fails to load.
175
+ * The default SVG placeholder is still applied after calling this handler.
176
+ * Call `event.preventDefault()` to prevent the default fallback behavior.
177
+ *
178
+ * @param event - The error event
179
+ *
180
+ * @example
181
+ * ```tsx
182
+ * // Log error and show default placeholder
183
+ * <Img
184
+ * src="/photo.jpg"
185
+ * onError={(e) => console.error('Image failed to load', e)}
186
+ * alt="Photo"
187
+ * />
188
+ *
189
+ * // Prevent default and use custom fallback
190
+ * <Img
191
+ * src="/photo.jpg"
192
+ * onError={(e) => {
193
+ * e.preventDefault()
194
+ * e.currentTarget.src = '/custom-fallback.jpg'
195
+ * }}
196
+ * alt="Photo"
197
+ * />
198
+ * ```
199
+ */
200
+ onError?: (event: React__default.SyntheticEvent<HTMLImageElement, Event>) => void;
201
+ /**
202
+ * Callback fired when the image successfully loads.
203
+ *
204
+ * @param event - The load event
205
+ *
206
+ * @example
207
+ * ```tsx
208
+ * <Img
209
+ * src="/photo.jpg"
210
+ * onLoad={(e) => console.log('Image loaded successfully')}
211
+ * alt="Photo"
212
+ * />
213
+ * ```
214
+ */
215
+ onLoad?: (event: React__default.SyntheticEvent<HTMLImageElement, Event>) => void;
216
+ }
217
+
218
+ /**
219
+ * Img - A semantic image component with accessibility and performance best practices.
220
+ *
221
+ * This component wraps the native `<img>` element with enhanced features:
222
+ * - **Responsive images** via optional srcset/sizes
223
+ * - **Lazy loading** by default for performance
224
+ * - **Error handling** with configurable fallback placeholders
225
+ * - **Type safety** with full TypeScript support
226
+ *
227
+ * ## Accessibility Patterns (WCAG 2.1 AA)
228
+ *
229
+ * ### Decorative Images
230
+ * Images that are purely visual decoration should use an empty alt attribute.
231
+ * These images are typically borders, patterns, or visual separators.
232
+ *
233
+ * @example
234
+ * ```tsx
235
+ * // ✅ GOOD: Decorative border image
236
+ * <Img src="/decorative-border.png" alt="" />
237
+ *
238
+ * // ✅ GOOD: Background pattern
239
+ * <Img src="/pattern.svg" alt="" loading="eager" />
240
+ * ```
241
+ *
242
+ * ### Semantic Images
243
+ * Images that convey information must have descriptive alt text that explains
244
+ * the content and purpose of the image.
245
+ *
246
+ * @example
247
+ * ```tsx
248
+ * // ✅ GOOD: Informative image with descriptive alt
249
+ * <Img
250
+ * src="/sales-chart.png"
251
+ * alt="Sales chart showing 30% revenue growth in Q4 2024"
252
+ * />
253
+ *
254
+ * // ✅ GOOD: Product photo with context
255
+ * <Img
256
+ * src="/laptop.jpg"
257
+ * alt="Silver MacBook Pro 14-inch on wooden desk"
258
+ * />
259
+ * ```
260
+ *
261
+ * ## Performance Optimization
262
+ *
263
+ * ### Lazy Loading
264
+ * By default, images use lazy loading to improve page load performance.
265
+ * Only use `loading="eager"` for above-the-fold images.
266
+ *
267
+ * @example
268
+ * ```tsx
269
+ * // ✅ GOOD: Lazy load below-the-fold image
270
+ * <Img src="/photo.jpg" alt="Photo" />
271
+ *
272
+ * // ✅ GOOD: Eager load hero image
273
+ * <Img
274
+ * src="/hero.jpg"
275
+ * alt="Hero banner"
276
+ * loading="eager"
277
+ * fetchpriority="high"
278
+ * />
279
+ * ```
280
+ *
281
+ * ### Responsive Images
282
+ * Use srcset and sizes for responsive images to serve appropriate image sizes
283
+ * based on viewport width, improving performance and bandwidth usage.
284
+ *
285
+ * @example
286
+ * ```tsx
287
+ * // ✅ GOOD: Responsive image with multiple sizes
288
+ * <Img
289
+ * src="/photo.jpg"
290
+ * srcSet="/photo-320w.jpg 320w, /photo-640w.jpg 640w, /photo-1024w.jpg 1024w"
291
+ * sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 800px"
292
+ * alt="Responsive image adapts to viewport"
293
+ * />
294
+ * ```
295
+ *
296
+ * ## Error Handling
297
+ *
298
+ * @example
299
+ * ```tsx
300
+ * // ✅ GOOD: Custom placeholder on error
301
+ * <Img
302
+ * src="/photo.jpg"
303
+ * placeholder="/fallback.png"
304
+ * alt="User profile photo"
305
+ * />
306
+ *
307
+ * // ✅ GOOD: Custom error handler
308
+ * <Img
309
+ * src="/photo.jpg"
310
+ * onError={(e) => {
311
+ * console.error('Image failed to load')
312
+ * logToAnalytics('image_error', { src: e.currentTarget.src })
313
+ * }}
314
+ * alt="Photo"
315
+ * />
316
+ * ```
317
+ *
318
+ * @param {ImgProps} props - Component props extending native img attributes
319
+ * @returns {React.ReactElement} Image element with enhanced functionality
320
+ *
321
+ * @see {@link ImgProps} for complete prop documentation
322
+ * @see https://www.w3.org/WAI/WCAG21/Understanding/non-text-content.html
323
+ */
22
324
  declare const Img: {
23
- ({ src, alt, width, height, styles, loading, placeholder, fetchpriority, decoding, imgLoaded, imgError, ...props }: ImageProps): React__default.JSX.Element;
325
+ ({ src, alt, width, height, styles, loading, placeholder, fetchpriority, decoding, srcSet, sizes, onError, onLoad, ...props }: ImgProps): React__default.JSX.Element;
24
326
  displayName: string;
25
327
  };
26
328
 
@@ -53,7 +355,7 @@ interface TextToSpeechComponentProps {
53
355
  */
54
356
  declare const TextToSpeech: React__default.FC<TextToSpeechComponentProps>;
55
357
 
56
- type ComponentProps = React__default.ComponentProps<typeof FP>;
358
+ type ComponentProps = React__default.ComponentProps<typeof UI>;
57
359
  /**
58
360
  * Renders children elements without any wrapping component.
59
361
  * Can be used as a placeholder when no semantic landmark is needed.
@@ -117,12 +419,102 @@ declare const Section: ({ id, children, styles, classes, ...props }: ComponentPr
117
419
  */
118
420
  declare const Article: ({ id, children, styles, classes, ...props }: ComponentProps) => React__default.JSX.Element;
119
421
 
422
+ /**
423
+ * Props for the Badge component
424
+ *
425
+ * @property {React.ReactNode} children - Content to display inside the badge (typically numbers or short text)
426
+ * @property {string} [id] - Optional HTML id attribute for the badge element
427
+ * @property {React.CSSProperties} [styles] - Inline styles to apply to the badge
428
+ * @property {string} [classes] - CSS class names to apply to the badge
429
+ * @property {'rounded'} [variant] - Visual variant of the badge. Use 'rounded' for circular badges (fixed size with ellipsis for overflow)
430
+ * @property {string} [aria-label] - Accessible label for screen readers. Required for icon-only or number-only badges
431
+ * @property {'status' | 'note'} [role] - ARIA role for the badge. Defaults to 'status' for dynamic content
432
+ */
433
+ type BadgeProps = {
434
+ /**
435
+ * Content to display inside the badge (typically numbers or short text)
436
+ */
437
+ children?: React__default.ReactNode;
438
+ /**
439
+ * Visual variant of the badge
440
+ * - 'rounded': Circular badge style
441
+ */
442
+ variant?: 'rounded';
443
+ } & React__default.ComponentProps<typeof UI>;
444
+ /**
445
+ * Badge - A small label component for displaying status, counts, or notifications
446
+ *
447
+ * The Badge component is used to display supplementary information alongside other content,
448
+ * such as notification counts, status indicators, or labels. It renders as a semantic `<sup>`
449
+ * element with a nested `<span>` required for the component's styling architecture.
450
+ *
451
+ * ## Styling Architecture
452
+ *
453
+ * The Badge uses a nested structure (`<sup><span>content</span></sup>`) which is required
454
+ * for the SCSS styling system. The outer `<sup>` element provides positioning context,
455
+ * while the inner `<span>` receives the visual styling (background, padding, border-radius).
456
+ *
457
+ * ## Rounded Variant Behavior
458
+ *
459
+ * The `rounded` variant creates a perfect circular badge with fixed dimensions (1.5625rem).
460
+ * Content that exceeds the available space will be truncated with an ellipsis (...).
461
+ * **Best practice**: Format large numbers yourself (e.g., pass "99+" instead of "999").
462
+ *
463
+ * ## Accessibility Considerations
464
+ *
465
+ * - **Semantic HTML**: Uses `<sup>` (superscript) element for proper positioning context
466
+ * - **ARIA Role**: Defaults to `role="status"` for dynamic badges (e.g., unread counts)
467
+ * - **Accessible Names**: For icon-only or number-only badges, provide an `aria-label`
468
+ * to give context (e.g., "3 unread messages" instead of just "3")
469
+ * - **Live Regions**: The `role="status"` makes badges announce updates to screen readers
470
+ *
471
+ * @param {BadgeProps} props - Component props
472
+ * @returns {React.ReactElement} A Badge component
473
+ *
474
+ * @example
475
+ * // Basic badge with notification count
476
+ * <p>
477
+ * Messages
478
+ * <Badge aria-label="3 unread messages">3</Badge>
479
+ * </p>
480
+ *
481
+ * @example
482
+ * // Rounded badge variant (perfect circle)
483
+ * <p>
484
+ * Notifications
485
+ * <Badge variant="rounded" aria-label="99 or more notifications">99+</Badge>
486
+ * </p>
487
+ *
488
+ * @example
489
+ * // Status badge with custom styling
490
+ * <p>
491
+ * Active Users
492
+ * <Badge styles={{ backgroundColor: 'green', color: 'white' }}>21</Badge>
493
+ * </p>
494
+ *
495
+ * @example
496
+ * // ✅ GOOD: Accessible badge with descriptive label and formatted content
497
+ * <Badge variant="rounded" aria-label="12 items in cart">12</Badge>
498
+ *
499
+ * @example
500
+ * // ✅ GOOD: Large numbers formatted by developer
501
+ * <Badge variant="rounded" aria-label="More than 99 notifications">99+</Badge>
502
+ *
503
+ * @example
504
+ * // ❌ BAD: Number-only badge without context for screen readers
505
+ * <Badge>12</Badge>
506
+ */
507
+ declare const Badge: {
508
+ ({ id, styles, classes, children, variant, ...props }: BadgeProps): React__default.JSX.Element;
509
+ displayName: string;
510
+ };
511
+
120
512
  type TagProps = {
121
513
  /** HTML element to display the badge as span or p */
122
514
  elm?: 'span' | 'p';
123
515
  /** Aria role for the component - conditional */
124
516
  role: 'note' | 'status';
125
- } & React__default.ComponentProps<typeof FP>;
517
+ } & React__default.ComponentProps<typeof UI>;
126
518
  declare const Tag: {
127
519
  ({ elm, role, children, styles, ...props }: TagProps): React__default.JSX.Element;
128
520
  displayName: string;
@@ -153,33 +545,125 @@ declare const Table: {
153
545
  displayName: string;
154
546
  };
155
547
 
548
+ /**
549
+ * Props for the Details component.
550
+ *
551
+ * Combines native HTML details element props with custom styling and interaction handlers.
552
+ * The Details component uses the native `<details>` element for progressive disclosure,
553
+ * providing built-in keyboard support and semantic HTML.
554
+ *
555
+ * @example
556
+ * ```tsx
557
+ * <Details
558
+ * summary="Click to expand"
559
+ * icon={<ChevronIcon />}
560
+ * onToggle={(e) => console.log('Toggled:', e.currentTarget.open)}
561
+ * >
562
+ * <p>Hidden content revealed when opened</p>
563
+ * </Details>
564
+ * ```
565
+ */
156
566
  type DetailsProps = {
157
567
  /**
158
- * The summary text shown for the details.
159
- * Required.
568
+ * The summary text or element shown in the clickable header.
569
+ * This is always visible and acts as the toggle control.
570
+ *
571
+ * @required
572
+ * @example
573
+ * ```tsx
574
+ * summary="Shipping Information"
575
+ * // or
576
+ * summary={<><Icon /> Shipping Information</>}
577
+ * ```
160
578
  */
161
579
  summary: React__default.ReactNode;
162
580
  /**
163
- * The aria-label element for accessibility.
164
- */
165
- ariaLabel: string;
166
- } & React__default.ComponentProps<"details"> & Partial<React__default.ComponentProps<typeof FP>>;
167
- /**3
168
- * Details component props interface.
169
- *
170
- * @param {React.CSSProperties} [styles] - CSS styles object.
171
- * @param {string} [classes] - Classnames string.
172
- * @param {boolean} [open] - Whether the details is open.
173
- * @param {(e: React.PointerEvent<HTMLDetailsElement>) => void} [onToggle] - onToggle callback.
174
- * @param {(e: React.PointerEvent<HTMLDetailsElement>) => void} [onPointerDown] - onPointerDown callback.
175
- * @param {ReactNode} children - The content inside the details.
176
- * @param {string} [ariaLabel] - aria-label for accessibility.
177
- * @param {React.Ref<any>} [ref] - Ref object.
178
- * @param {Object} props - Other props.
581
+ * Optional icon displayed before the summary text.
582
+ * Commonly used for chevron/arrow indicators.
583
+ *
584
+ * @example
585
+ * ```tsx
586
+ * icon={<ChevronDownIcon />}
587
+ * ```
588
+ */
589
+ icon?: React__default.ReactNode;
590
+ /**
591
+ * Accessible label for screen readers.
592
+ * If not provided, the native `<details>` semantic will be used.
593
+ *
594
+ * Note: Native `<details>` elements are already semantic and announced properly
595
+ * by screen readers. Only provide this if you need to override the default behavior.
596
+ *
597
+ * @optional
598
+ * @example
599
+ * ```tsx
600
+ * ariaLabel="Product details section"
601
+ * ```
602
+ */
603
+ ariaLabel?: string;
604
+ /**
605
+ * Groups multiple details elements into an accordion where only one can be open.
606
+ * Multiple details elements with the same `name` will behave as a mutually exclusive group.
607
+ *
608
+ * @optional
609
+ * @example
610
+ * ```tsx
611
+ * <Details name="faq-accordion" summary="Question 1">...</Details>
612
+ * <Details name="faq-accordion" summary="Question 2">...</Details>
613
+ * ```
614
+ */
615
+ name?: string;
616
+ } & React__default.ComponentProps<"details"> & Partial<React__default.ComponentProps<typeof UI>>;
617
+
618
+ /**
619
+ * Details - A progressive disclosure component using native HTML `<details>` element.
620
+ *
621
+ * This component wraps the native `<details>` and `<summary>` elements to provide
622
+ * an accessible, semantic way to show and hide content. It supports accordion behavior
623
+ * through the `name` attribute and includes proper keyboard navigation out of the box.
624
+ *
625
+ * ## Key Features:
626
+ * - **Semantic HTML**: Uses native `<details>` for built-in accessibility
627
+ * - **Keyboard Support**: Space/Enter to toggle, fully accessible by default
628
+ * - **Accordion Mode**: Group multiple details with `name` for exclusive expansion
629
+ * - **Customizable**: Supports icons, custom styles, and event handlers
630
+ *
631
+ * ## Accessibility:
632
+ * - ✅ WCAG 2.1 AA compliant using semantic HTML
633
+ * - ✅ Native keyboard support (Space, Enter)
634
+ * - ✅ Screen reader compatible (announced as "disclosure" or "expandable")
635
+ * - ✅ Focus indicators automatically applied via CSS
636
+ * - ✅ `aria-expanded` managed automatically by browser
637
+ *
638
+ * @example
639
+ * ```tsx
640
+ * // Basic usage
641
+ * <Details summary="Click to expand">
642
+ * <p>Hidden content here</p>
643
+ * </Details>
644
+ * ```
645
+ *
646
+ * @example
647
+ * ```tsx
648
+ * // With icon and custom styling
649
+ * <Details
650
+ * summary="Shipping Information"
651
+ * icon={<ChevronDownIcon />}
652
+ * classes="custom-details"
653
+ * onToggle={(e) => console.log('Open:', e.currentTarget.open)}
654
+ * >
655
+ * <p>Ships within 2-3 business days</p>
656
+ * </Details>
657
+ * ```
658
+ *
659
+ * @example
660
+ * ```tsx
661
+ * // Accordion mode - only one open at a time
662
+ * <Details name="faq" summary="Question 1">Answer 1</Details>
663
+ * <Details name="faq" summary="Question 2">Answer 2</Details>
664
+ * <Details name="faq" summary="Question 3">Answer 3</Details>
665
+ * ```
179
666
  */
180
- declare const Details: {
181
- ({ summary, icon, styles, classes, ariaLabel, name, open, onPointerDown, onToggle, children, ref, ...props }: DetailsProps): React__default.JSX.Element;
182
- displayName: string;
183
- };
667
+ declare const Details: React__default.ForwardRefExoticComponent<Omit<DetailsProps, "ref"> & React__default.RefAttributes<HTMLDetailsElement>>;
184
668
 
185
- export { Article, Aside, Caption, ComponentProps$1 as ComponentProps, Details, Footer, Header, ImageProps, Img, Landmarks, Main, Section, Table, Tag, TagProps, Tbody, Td, TextToSpeech, Thead, Tr };
669
+ export { Article, Aside, Badge, BadgeProps, Caption, ComponentProps$1 as ComponentProps, Details, Footer, Header, Img, ImgProps, Landmarks, Main, Section, Table, Tag, TagProps, Tbody, Td, TextToSpeech, Thead, Tr };