@fpkit/acss 3.1.0 → 3.2.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 (239) hide show
  1. package/libs/{chunk-2NRIP6RB.cjs → chunk-2C3YLBWP.cjs} +3 -3
  2. package/libs/{chunk-NWJDAHP6.cjs → chunk-2GJHKWEK.cjs} +3 -3
  3. package/libs/{chunk-FVROL3V5.js → chunk-2JCDEC32.js} +3 -3
  4. package/libs/{chunk-IRLFZ3OL.js → chunk-3XJC4XUG.js} +2 -2
  5. package/libs/{chunk-23ANBDCR.js → chunk-4I5MF54P.js} +3 -3
  6. package/libs/chunk-4I5MF54P.js.map +1 -0
  7. package/libs/chunk-5CJPTDK3.cjs +31 -0
  8. package/libs/chunk-5CJPTDK3.cjs.map +1 -0
  9. package/libs/{chunk-E4OSROCA.cjs → chunk-5QSNJQVH.cjs} +3 -3
  10. package/libs/{chunk-O3JIHC5M.cjs → chunk-6BUJZ4DJ.cjs} +3 -3
  11. package/libs/{chunk-WXBFBWYF.cjs → chunk-AFINOD2L.cjs} +3 -3
  12. package/libs/{chunk-HRRHPLER.js → chunk-AWZLSWDO.js} +2 -2
  13. package/libs/chunk-DDSXKOUB.js +7 -0
  14. package/libs/chunk-DDSXKOUB.js.map +1 -0
  15. package/libs/{chunk-CWRNJA4P.js → chunk-DIJBIOFE.js} +3 -3
  16. package/libs/chunk-EJ6KYBFE.cjs +13 -0
  17. package/libs/chunk-EJ6KYBFE.cjs.map +1 -0
  18. package/libs/{chunk-GUJSMQ3V.cjs → chunk-EKJYOCLY.cjs} +3 -3
  19. package/libs/{chunk-X5RKCLDC.cjs → chunk-F64GE6RG.cjs} +4 -4
  20. package/libs/chunk-FMIM3332.js +8 -0
  21. package/libs/chunk-FMIM3332.js.map +1 -0
  22. package/libs/{chunk-5RAWNUVD.js → chunk-IBUTNPTQ.js} +2 -2
  23. package/libs/chunk-IWP4VJEP.cjs +18 -0
  24. package/libs/chunk-IWP4VJEP.cjs.map +1 -0
  25. package/libs/{chunk-ZFJ4U45S.js → chunk-KDMX3FAW.js} +2 -2
  26. package/libs/{chunk-DYFAUAB7.cjs → chunk-LXODKKA3.cjs} +4 -4
  27. package/libs/chunk-M7JLT62Q.js +9 -0
  28. package/libs/chunk-M7JLT62Q.js.map +1 -0
  29. package/libs/{chunk-IQ76HGVP.js → chunk-MBWI67UT.js} +2 -2
  30. package/libs/{chunk-O5XAJ7BY.cjs → chunk-NCGVF2QS.cjs} +4 -4
  31. package/libs/{chunk-W2UIN7EV.cjs → chunk-NPWHQVYB.cjs} +3 -3
  32. package/libs/{chunk-G55UJ53G.cjs → chunk-NZVSXRTB.cjs} +3 -3
  33. package/libs/chunk-NZVSXRTB.cjs.map +1 -0
  34. package/libs/{chunk-43TK2ICH.js → chunk-PMWL5XZ4.js} +3 -3
  35. package/libs/{chunk-KVKQLRJG.js → chunk-TF3GQKOY.js} +2 -2
  36. package/libs/chunk-TNEJXNZA.cjs +22 -0
  37. package/libs/chunk-TNEJXNZA.cjs.map +1 -0
  38. package/libs/{chunk-IEB64SWY.js → chunk-U5VA34SU.js} +2 -2
  39. package/libs/chunk-UGMP72J2.js +8 -0
  40. package/libs/chunk-UGMP72J2.js.map +1 -0
  41. package/libs/{chunk-MGPWZRBX.cjs → chunk-URBGDUFN.cjs} +6 -6
  42. package/libs/{chunk-QKHPHMG2.js → chunk-ZF6Y7W57.js} +5 -5
  43. package/libs/component-props-50e69975.d.ts +66 -0
  44. package/libs/components/box/box.css +1 -0
  45. package/libs/components/box/box.css.map +1 -0
  46. package/libs/components/box/box.min.css +3 -0
  47. package/libs/components/breadcrumbs/breadcrumb.cjs +6 -6
  48. package/libs/components/breadcrumbs/breadcrumb.js +3 -3
  49. package/libs/components/button.cjs +4 -4
  50. package/libs/components/button.d.cts +10 -3
  51. package/libs/components/button.d.ts +10 -3
  52. package/libs/components/button.js +2 -2
  53. package/libs/components/card.cjs +7 -7
  54. package/libs/components/card.d.cts +13 -85
  55. package/libs/components/card.d.ts +13 -85
  56. package/libs/components/card.js +2 -2
  57. package/libs/components/cards/card.css +1 -1
  58. package/libs/components/cards/card.css.map +1 -1
  59. package/libs/components/cards/card.min.css +2 -2
  60. package/libs/components/cluster/cluster.css +1 -0
  61. package/libs/components/cluster/cluster.css.map +1 -0
  62. package/libs/components/cluster/cluster.min.css +3 -0
  63. package/libs/components/dialog/dialog.cjs +7 -7
  64. package/libs/components/dialog/dialog.js +5 -5
  65. package/libs/components/form/fields.cjs +4 -4
  66. package/libs/components/form/fields.js +2 -2
  67. package/libs/components/form/textarea.cjs +4 -4
  68. package/libs/components/form/textarea.js +2 -2
  69. package/libs/components/grid/grid.css +1 -0
  70. package/libs/components/grid/grid.css.map +1 -0
  71. package/libs/components/grid/grid.min.css +3 -0
  72. package/libs/components/heading/heading.cjs +3 -3
  73. package/libs/components/heading/heading.js +2 -2
  74. package/libs/components/icons/icon.cjs +4 -4
  75. package/libs/components/icons/icon.d.cts +2 -2
  76. package/libs/components/icons/icon.d.ts +2 -2
  77. package/libs/components/icons/icon.js +2 -2
  78. package/libs/components/link/link.cjs +6 -6
  79. package/libs/components/link/link.js +2 -2
  80. package/libs/components/list/list.cjs +5 -5
  81. package/libs/components/list/list.js +2 -2
  82. package/libs/components/modal.cjs +4 -4
  83. package/libs/components/modal.d.cts +1 -1
  84. package/libs/components/modal.d.ts +1 -1
  85. package/libs/components/modal.js +3 -3
  86. package/libs/components/nav/nav.cjs +7 -7
  87. package/libs/components/nav/nav.js +3 -3
  88. package/libs/components/popover/popover.cjs +4 -4
  89. package/libs/components/popover/popover.d.cts +1 -1
  90. package/libs/components/popover/popover.d.ts +1 -1
  91. package/libs/components/popover/popover.js +1 -1
  92. package/libs/components/stack/stack.css +1 -0
  93. package/libs/components/stack/stack.css.map +1 -0
  94. package/libs/components/stack/stack.min.css +3 -0
  95. package/libs/components/tables/table.cjs +4 -4
  96. package/libs/components/tables/table.d.cts +2 -2
  97. package/libs/components/tables/table.d.ts +2 -2
  98. package/libs/components/tables/table.js +1 -1
  99. package/libs/components/text/text.cjs +5 -5
  100. package/libs/components/text/text.js +2 -2
  101. package/libs/hooks.cjs +4 -4
  102. package/libs/hooks.js +3 -3
  103. package/libs/{icons-287fce3a.d.ts → icons-df8e744f.d.ts} +1 -1
  104. package/libs/icons.cjs +3 -3
  105. package/libs/icons.d.cts +2 -2
  106. package/libs/icons.d.ts +2 -2
  107. package/libs/icons.js +2 -2
  108. package/libs/index.cjs +74 -73
  109. package/libs/index.cjs.map +1 -1
  110. package/libs/index.css +1 -1
  111. package/libs/index.css.map +1 -1
  112. package/libs/index.d.cts +925 -6
  113. package/libs/index.d.ts +925 -6
  114. package/libs/index.js +30 -30
  115. package/libs/index.js.map +1 -1
  116. package/package.json +2 -2
  117. package/src/App.tsx +1 -3
  118. package/src/components/alert/STYLES.mdx +790 -0
  119. package/src/components/badge/STYLES.mdx +610 -0
  120. package/src/components/box/README.mdx +401 -0
  121. package/src/components/box/STYLES.mdx +360 -0
  122. package/src/components/box/box.scss +245 -0
  123. package/src/components/box/box.stories.tsx +395 -0
  124. package/src/components/box/box.test.tsx +425 -0
  125. package/src/components/box/box.tsx +170 -0
  126. package/src/components/box/box.types.ts +166 -0
  127. package/src/components/breadcrumbs/STYLES.mdx +99 -0
  128. package/src/components/breadcrumbs/bc-item.tsx +0 -1
  129. package/src/components/buttons/STYLES.mdx +766 -0
  130. package/src/components/cards/STYLES.mdx +835 -0
  131. package/src/components/cards/card.scss +29 -21
  132. package/src/components/cards/card.tsx +13 -3
  133. package/src/components/cards/card.types.ts +13 -0
  134. package/src/components/cluster/README.mdx +595 -0
  135. package/src/components/cluster/STYLES.mdx +626 -0
  136. package/src/components/cluster/cluster.scss +86 -0
  137. package/src/components/cluster/cluster.stories.tsx +385 -0
  138. package/src/components/cluster/cluster.test.tsx +655 -0
  139. package/src/components/cluster/cluster.tsx +94 -0
  140. package/src/components/cluster/cluster.types.ts +75 -0
  141. package/src/components/details/STYLES.mdx +445 -0
  142. package/src/components/dialog/STYLES.mdx +888 -0
  143. package/src/components/flexbox/STYLES.mdx +857 -0
  144. package/src/components/flexbox/flex.stories.tsx +842 -141
  145. package/src/components/flexbox/flex.types.ts +25 -6
  146. package/src/components/form/STYLES.mdx +821 -0
  147. package/src/components/grid/README.mdx +709 -0
  148. package/src/components/grid/STYLES.mdx +785 -0
  149. package/src/components/grid/grid.scss +287 -0
  150. package/src/components/grid/grid.stories.tsx +486 -0
  151. package/src/components/grid/grid.test.tsx +981 -0
  152. package/src/components/grid/grid.tsx +222 -0
  153. package/src/components/grid/grid.types.ts +344 -0
  154. package/src/components/icons/STYLES.mdx +56 -0
  155. package/src/components/icons/components/arrow-right.tsx +0 -5
  156. package/src/components/images/STYLES.mdx +75 -0
  157. package/src/components/kit.tsx +8 -4
  158. package/src/components/layout/STYLES.mdx +556 -0
  159. package/src/components/link/STYLES.mdx +75 -0
  160. package/src/components/list/STYLES.mdx +631 -0
  161. package/src/components/nav/STYLES.mdx +460 -0
  162. package/src/components/popover/popover.tsx +1 -1
  163. package/src/components/progress/STYLES.mdx +64 -0
  164. package/src/components/stack/README.mdx +400 -0
  165. package/src/components/stack/STYLES.mdx +414 -0
  166. package/src/components/stack/stack.scss +109 -0
  167. package/src/components/stack/stack.stories.tsx +559 -0
  168. package/src/components/stack/stack.test.tsx +426 -0
  169. package/src/components/stack/stack.tsx +141 -0
  170. package/src/components/stack/stack.types.ts +133 -0
  171. package/src/components/tables/table-elements.tsx +1 -1
  172. package/src/components/tables/table.tsx +2 -2
  173. package/src/components/tag/STYLES.mdx +105 -0
  174. package/src/components/text-to-speech/STYLES.mdx +80 -0
  175. package/src/components/text-to-speech/TextToSpeech.tsx +0 -4
  176. package/src/components/text-to-speech/useTextToSpeech.tsx +2 -6
  177. package/src/components/ui.tsx +3 -3
  178. package/src/decorators/instructions.tsx +22 -18
  179. package/src/hooks/popover/popover.tsx +1 -1
  180. package/src/index.scss +5 -1
  181. package/src/index.ts +305 -12
  182. package/src/sass/GLOBALS-STYLES.md +631 -0
  183. package/src/sass/_globals.scss +45 -24
  184. package/src/styles/box/box.css +220 -0
  185. package/src/styles/box/box.css.map +1 -0
  186. package/src/styles/cards/card.css +22 -17
  187. package/src/styles/cards/card.css.map +1 -1
  188. package/src/styles/cluster/cluster.css +71 -0
  189. package/src/styles/cluster/cluster.css.map +1 -0
  190. package/src/styles/grid/grid.css +238 -0
  191. package/src/styles/grid/grid.css.map +1 -0
  192. package/src/styles/index.css +667 -49
  193. package/src/styles/index.css.map +1 -1
  194. package/src/styles/stack/stack.css +86 -0
  195. package/src/styles/stack/stack.css.map +1 -0
  196. package/src/types/component-props.ts +42 -13
  197. package/src/types/layout-primitives.ts +48 -0
  198. package/src/types/shared.ts +10 -26
  199. package/libs/chunk-23ANBDCR.js.map +0 -1
  200. package/libs/chunk-5QD3DWFI.js +0 -9
  201. package/libs/chunk-5QD3DWFI.js.map +0 -1
  202. package/libs/chunk-6WTC4JXH.cjs +0 -31
  203. package/libs/chunk-6WTC4JXH.cjs.map +0 -1
  204. package/libs/chunk-ENTCUJ3A.cjs +0 -13
  205. package/libs/chunk-ENTCUJ3A.cjs.map +0 -1
  206. package/libs/chunk-G55UJ53G.cjs.map +0 -1
  207. package/libs/chunk-HHLNOC5T.js +0 -7
  208. package/libs/chunk-HHLNOC5T.js.map +0 -1
  209. package/libs/chunk-KK47SYZI.js +0 -8
  210. package/libs/chunk-KK47SYZI.js.map +0 -1
  211. package/libs/chunk-US2I5GI7.cjs +0 -22
  212. package/libs/chunk-US2I5GI7.cjs.map +0 -1
  213. package/libs/chunk-W5TKWBFC.cjs +0 -18
  214. package/libs/chunk-W5TKWBFC.cjs.map +0 -1
  215. package/libs/chunk-Y2PFDELK.js +0 -8
  216. package/libs/chunk-Y2PFDELK.js.map +0 -1
  217. package/libs/component-props-67d978a2.d.ts +0 -38
  218. /package/libs/{chunk-2NRIP6RB.cjs.map → chunk-2C3YLBWP.cjs.map} +0 -0
  219. /package/libs/{chunk-NWJDAHP6.cjs.map → chunk-2GJHKWEK.cjs.map} +0 -0
  220. /package/libs/{chunk-FVROL3V5.js.map → chunk-2JCDEC32.js.map} +0 -0
  221. /package/libs/{chunk-IRLFZ3OL.js.map → chunk-3XJC4XUG.js.map} +0 -0
  222. /package/libs/{chunk-E4OSROCA.cjs.map → chunk-5QSNJQVH.cjs.map} +0 -0
  223. /package/libs/{chunk-O3JIHC5M.cjs.map → chunk-6BUJZ4DJ.cjs.map} +0 -0
  224. /package/libs/{chunk-WXBFBWYF.cjs.map → chunk-AFINOD2L.cjs.map} +0 -0
  225. /package/libs/{chunk-HRRHPLER.js.map → chunk-AWZLSWDO.js.map} +0 -0
  226. /package/libs/{chunk-CWRNJA4P.js.map → chunk-DIJBIOFE.js.map} +0 -0
  227. /package/libs/{chunk-GUJSMQ3V.cjs.map → chunk-EKJYOCLY.cjs.map} +0 -0
  228. /package/libs/{chunk-X5RKCLDC.cjs.map → chunk-F64GE6RG.cjs.map} +0 -0
  229. /package/libs/{chunk-5RAWNUVD.js.map → chunk-IBUTNPTQ.js.map} +0 -0
  230. /package/libs/{chunk-ZFJ4U45S.js.map → chunk-KDMX3FAW.js.map} +0 -0
  231. /package/libs/{chunk-DYFAUAB7.cjs.map → chunk-LXODKKA3.cjs.map} +0 -0
  232. /package/libs/{chunk-IQ76HGVP.js.map → chunk-MBWI67UT.js.map} +0 -0
  233. /package/libs/{chunk-O5XAJ7BY.cjs.map → chunk-NCGVF2QS.cjs.map} +0 -0
  234. /package/libs/{chunk-W2UIN7EV.cjs.map → chunk-NPWHQVYB.cjs.map} +0 -0
  235. /package/libs/{chunk-43TK2ICH.js.map → chunk-PMWL5XZ4.js.map} +0 -0
  236. /package/libs/{chunk-KVKQLRJG.js.map → chunk-TF3GQKOY.js.map} +0 -0
  237. /package/libs/{chunk-IEB64SWY.js.map → chunk-U5VA34SU.js.map} +0 -0
  238. /package/libs/{chunk-MGPWZRBX.cjs.map → chunk-URBGDUFN.cjs.map} +0 -0
  239. /package/libs/{chunk-QKHPHMG2.js.map → chunk-ZF6Y7W57.js.map} +0 -0
package/src/index.ts CHANGED
@@ -1,6 +1,28 @@
1
1
  /**
2
2
  * @fileoverview Main entry point for @fpkit/acss component library
3
- * @description Exports all components, types, and utilities
3
+ * @module @fpkit/acss
4
+ *
5
+ * @description
6
+ * A lightweight React UI component library with 25+ accessible components.
7
+ * Uses CSS custom properties for reactive styling and emphasizes semantic HTML.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * import { Button, Card, Alert } from '@fpkit/acss';
12
+ * import '@fpkit/acss/styles';
13
+ *
14
+ * function App() {
15
+ * return (
16
+ * <Card>
17
+ * <Alert variant="info">Welcome!</Alert>
18
+ * <Button variant="primary">Get Started</Button>
19
+ * </Card>
20
+ * );
21
+ * }
22
+ * ```
23
+ *
24
+ * @see {@link https://www.npmjs.com/package/@fpkit/acss} NPM Package
25
+ * @packageDocumentation
4
26
  */
5
27
 
6
28
  // import { TextToSpeech } from "./components/text-to-speech/TextToSpeech";
@@ -8,7 +30,28 @@
8
30
  // export { Textarea } from './components/form/textarea';
9
31
  // export { ModalDialog as Dialog } from "./components/modal/dialog";
10
32
 
11
- // Core UI components
33
+ /**
34
+ * Core UI Components
35
+ *
36
+ * Essential interactive components for building user interfaces.
37
+ * Includes buttons, cards, alerts, modals, forms, and more.
38
+ *
39
+ * All components support:
40
+ * - CSS custom properties for theming
41
+ * - WCAG 2.1 Level AA accessibility
42
+ * - Keyboard navigation
43
+ * - Screen reader support
44
+ *
45
+ * @example
46
+ * ```tsx
47
+ * import { Button, Card, Alert, Modal } from '@fpkit/acss';
48
+ *
49
+ * <Card>
50
+ * <Alert variant="success">Operation completed</Alert>
51
+ * <Button onClick={handleClick}>Continue</Button>
52
+ * </Card>
53
+ * ```
54
+ */
12
55
  export { Button, type ButtonProps } from "./components/buttons/button";
13
56
  export {
14
57
  Card,
@@ -25,15 +68,60 @@ export { Img } from "./components/images/img";
25
68
  export type { ImgProps } from "./components/images/img.types";
26
69
  export { default as Link } from "./components/link/link";
27
70
  export type { LinkProps } from "./components/link/link.types";
28
- export { default as List, type ListProps, type ListItemProps } from "./components/list/list";
71
+ export {
72
+ default as List,
73
+ type ListProps,
74
+ type ListItemProps,
75
+ } from "./components/list/list";
29
76
  export { Modal, type ModalProps } from "./components/modal/modal";
30
77
  export { Popover, type PopoverProps } from "./components/popover/popover";
31
78
  export { RenderTable as TBL, type TableProps } from "./components/tables/table";
32
79
  export { Dialog } from "./components/dialog/dialog";
33
80
  export { TextToSpeech } from "./components/text-to-speech/TextToSpeech";
34
81
 
35
- // Layout components
82
+ /**
83
+ * Layout Components
84
+ *
85
+ * Semantic HTML5 landmark elements and layout primitives for page structure.
86
+ *
87
+ * Components include:
88
+ * - **Landmarks**: Header, Main, Footer, Aside (semantic page regions)
89
+ * - **Box**: General-purpose container with spacing/sizing controls
90
+ * - **Stack**: Simplified vertical/horizontal layouts with gap spacing
91
+ * - **Cluster**: Wrapping flex layout for inline groups (tags, buttons)
92
+ * - **Flex**: Flexbox container with responsive utilities and type-safe props
93
+ *
94
+ * Landmarks provide proper ARIA roles and improve screen reader navigation.
95
+ * Layout primitives offer polymorphic, type-safe APIs for flexible layouts with
96
+ * unified spacing scales and CSS custom properties for theming.
97
+ *
98
+ * @example
99
+ * ```tsx
100
+ * import { Header, Main, Footer, Box, Flex } from '@fpkit/acss';
101
+ *
102
+ * <Header>
103
+ * <Flex justify="space-between" align="center">
104
+ * <Logo />
105
+ * <Nav />
106
+ * </Flex>
107
+ * </Header>
108
+ * <Main>
109
+ * <Box padding="lg" maxWidth="container" style={{ marginInline: 'auto' }}>
110
+ * <Article />
111
+ * </Box>
112
+ * </Main>
113
+ * <Footer />
114
+ * ```
115
+ *
116
+ * @see {@link ./components/layout/landmarks} Landmark Components
117
+ * @see {@link ./components/box/box} Box Component
118
+ * @see {@link ./components/flexbox/flex} Flex Component
119
+ */
36
120
  export * from "./components/layout/landmarks";
121
+ export { Box, type BoxProps } from "./components/box/box";
122
+ export { Stack, type StackProps } from "./components/stack/stack";
123
+ export { Cluster, type ClusterProps } from "./components/cluster/cluster";
124
+ export { default as Grid, GridItem, type GridProps, type GridItemProps } from "./components/grid/grid";
37
125
  export { default as Flex } from "./components/flexbox/flex";
38
126
  export type {
39
127
  FlexProps,
@@ -52,10 +140,56 @@ export type {
52
140
  ResponsiveFlexProps,
53
141
  } from "./components/flexbox/flex.types";
54
142
 
55
- // Navigation components
143
+ /**
144
+ * Navigation Components
145
+ *
146
+ * Accessible navigation elements for site and page navigation.
147
+ *
148
+ * Components support:
149
+ * - Semantic `<nav>` elements with proper ARIA
150
+ * - Keyboard navigation (Tab, Arrow keys)
151
+ * - Screen reader announcements
152
+ * - Active/current state management
153
+ *
154
+ * @example
155
+ * ```tsx
156
+ * import { Nav } from '@fpkit/acss';
157
+ *
158
+ * <Nav aria-label="Primary navigation">
159
+ * <Nav.Link href="/" active>Home</Nav.Link>
160
+ * <Nav.Link href="/about">About</Nav.Link>
161
+ * <Nav.Link href="/contact">Contact</Nav.Link>
162
+ * </Nav>
163
+ * ```
164
+ *
165
+ * @see {@link ./components/nav/nav} Navigation Component
166
+ */
56
167
  export * from "./components/nav/nav";
57
168
 
58
- // Typography components
169
+ /**
170
+ * Typography Components
171
+ *
172
+ * Text formatting and display components for content hierarchy.
173
+ *
174
+ * Includes:
175
+ * - **Text**: Polymorphic text component with variants
176
+ * - **Title**: Semantic heading component (h1-h6)
177
+ * - Responsive font sizing with CSS custom properties
178
+ *
179
+ * All typography uses rem units for accessibility and respects user preferences.
180
+ *
181
+ * @example
182
+ * ```tsx
183
+ * import { Text, Title } from '@fpkit/acss';
184
+ *
185
+ * <Title level={1}>Page Heading</Title>
186
+ * <Text variant="lead">Introduction paragraph with emphasis.</Text>
187
+ * <Text variant="body">Regular body text content.</Text>
188
+ * ```
189
+ *
190
+ * @see {@link ./components/text/text} Text Component
191
+ * @see {@link ./components/title/title} Title Component
192
+ */
59
193
  export * from "./components/text/text";
60
194
 
61
195
  // Title component (primary export)
@@ -69,24 +203,183 @@ export {
69
203
  /** @deprecated Use Title component instead. Will be removed in v3.0.0 */
70
204
  export { default as Heading } from "./components/heading/heading";
71
205
 
72
- // Form components
206
+ /**
207
+ * Form Components
208
+ *
209
+ * Accessible form controls with built-in validation and error handling.
210
+ *
211
+ * Components include:
212
+ * - **Field**: Form field wrapper with label and error message
213
+ * - **Input**: Text input with variants (text, email, password, etc.)
214
+ * - **Textarea**: Multi-line text input
215
+ *
216
+ * All form components support:
217
+ * - ARIA labeling and descriptions
218
+ * - Error state management
219
+ * - Disabled state with `aria-disabled`
220
+ * - Required field indicators
221
+ * - Keyboard navigation
222
+ *
223
+ * @example
224
+ * ```tsx
225
+ * import { Field, Input, Textarea } from '@fpkit/acss';
226
+ *
227
+ * <Field
228
+ * label="Email address"
229
+ * required
230
+ * error={errors.email}
231
+ * >
232
+ * <Input
233
+ * type="email"
234
+ * id="email"
235
+ * placeholder="you@example.com"
236
+ * />
237
+ * </Field>
238
+ *
239
+ * <Field label="Comments">
240
+ * <Textarea rows={4} />
241
+ * </Field>
242
+ * ```
243
+ *
244
+ * @see {@link ./components/form/fields} Field Component
245
+ * @see {@link ./components/form/inputs} Input Component
246
+ * @see {@link ./components/form/textarea} Textarea Component
247
+ */
73
248
  export * from "./components/form/textarea";
74
249
 
75
- // UI elements
250
+ /**
251
+ * UI Elements
252
+ *
253
+ * Additional user interface components for content display and organization.
254
+ *
255
+ * Components include:
256
+ * - **Badge**: Small status indicators and labels
257
+ * - **Tag**: Removable labels for categorization
258
+ * - **Table Elements**: Thead, Tbody, Tr, Td, Caption (table structure)
259
+ * - **Details**: Collapsible disclosure widget with summary
260
+ * - **Breadcrumb**: Navigation trail showing current location
261
+ *
262
+ * @example
263
+ * ```tsx
264
+ * import { Badge, Tag, Details, Breadcrumb } from '@fpkit/acss';
265
+ *
266
+ * <Badge variant="success">Active</Badge>
267
+ * <Tag onRemove={handleRemove}>JavaScript</Tag>
268
+ *
269
+ * <Details summary="View details">
270
+ * <p>Additional content here</p>
271
+ * </Details>
272
+ *
273
+ * <Breadcrumb>
274
+ * <Breadcrumb.Item>Home</Breadcrumb.Item>
275
+ * <Breadcrumb.Item>Products</Breadcrumb.Item>
276
+ * <Breadcrumb.Item current>Item</Breadcrumb.Item>
277
+ * </Breadcrumb>
278
+ * ```
279
+ *
280
+ * @see {@link ./components/badge/badge} Badge Component
281
+ * @see {@link ./components/tag/tag} Tag Component
282
+ * @see {@link ./components/tables/table-elements} Table Elements
283
+ * @see {@link ./components/details/details} Details Component
284
+ * @see {@link ./components/breadcrumbs/breadcrumb} Breadcrumb Component
285
+ */
76
286
  export { Badge, type BadgeProps } from "./components/badge/badge";
77
287
  export * from "./components/tag/tag";
78
288
  export * from "./components/tables/table-elements";
79
289
  export * from "./components/details/details";
80
290
  export * from "./components/breadcrumbs/breadcrumb";
81
291
 
82
- // Default exports for backward compatibility
292
+ /**
293
+ * Default Exports (Backward Compatibility)
294
+ *
295
+ * Legacy default exports maintained for backward compatibility with older code.
296
+ *
297
+ * **Components:**
298
+ * - `To`: Alias for Link component (use `Link` instead)
299
+ * - `FP`: Deprecated polymorphic component (use `UI` or `Box` instead)
300
+ * - `Box`: Alias for UI component
301
+ * - `UI`: Primary polymorphic component for custom elements
302
+ *
303
+ * @deprecated These exports are maintained for backward compatibility only.
304
+ * New code should use the named exports (Link, UI) instead.
305
+ *
306
+ * @example
307
+ * ```tsx
308
+ * // ❌ Old (deprecated but still works)
309
+ * import { To, FP } from '@fpkit/acss';
310
+ * <To href="/page">Link</To>
311
+ * <FP as="section">Content</FP>
312
+ *
313
+ * // ✅ New (recommended)
314
+ * import { Link, UI } from '@fpkit/acss';
315
+ * <Link href="/page">Link</Link>
316
+ * <UI as="section">Content</UI>
317
+ * ```
318
+ */
83
319
  export { default as To } from "./components/link/link";
84
320
  export { default as FP } from "./components/fp";
85
- export { default as Box } from "./components/fp";
86
321
  export { default as UI } from "./components/ui";
87
322
 
88
- // Core UI utility components
323
+ /**
324
+ * Core UI Utility Components
325
+ *
326
+ * Polymorphic component utilities for building custom elements with type safety.
327
+ *
328
+ * The UI component provides:
329
+ * - Type-safe `as` prop for rendering any element
330
+ * - Automatic prop inference based on element type
331
+ * - Support for refs with proper typing
332
+ * - CSS custom property styling
333
+ *
334
+ * @example
335
+ * ```tsx
336
+ * import { UI } from '@fpkit/acss';
337
+ *
338
+ * // Renders as button with button props
339
+ * <UI as="button" onClick={handleClick} disabled>
340
+ * Click me
341
+ * </UI>
342
+ *
343
+ * // Renders as anchor with anchor props
344
+ * <UI as="a" href="/page" target="_blank">
345
+ * Link
346
+ * </UI>
347
+ *
348
+ * // Renders as section with custom styles
349
+ * <UI as="section" styles={{ '--bg': 'lightblue' }}>
350
+ * Content
351
+ * </UI>
352
+ * ```
353
+ *
354
+ * @see {@link ./components/ui} UI Component Documentation
355
+ */
89
356
  export * from "./components/ui";
90
357
 
91
- // Types
358
+ /**
359
+ * TypeScript Type Definitions
360
+ *
361
+ * Shared type definitions used across components.
362
+ *
363
+ * **Key Types:**
364
+ * - `ComponentProps`: Base props interface for all fpkit components
365
+ * - Includes: children, renderStyles, id, styles, classes, dataStyle
366
+ * - Generic parameter for future extensibility
367
+ * - Does NOT include ref (use forwardRef explicitly)
368
+ *
369
+ * @example
370
+ * ```tsx
371
+ * import type { ComponentProps } from '@fpkit/acss';
372
+ *
373
+ * interface MyComponentProps extends ComponentProps {
374
+ * variant: 'primary' | 'secondary';
375
+ * onAction?: () => void;
376
+ * }
377
+ *
378
+ * export function MyComponent({ variant, ...props }: MyComponentProps) {
379
+ * return <div {...props} data-variant={variant} />;
380
+ * }
381
+ * ```
382
+ *
383
+ * @see {@link ./types/component-props} ComponentProps Interface
384
+ */
92
385
  export type { ComponentProps } from "./types";