@misoto22/folio 0.0.0 → 0.16.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 (686) hide show
  1. package/AGENTS.md +88 -0
  2. package/CLAUDE.md +1 -0
  3. package/LICENSE +21 -0
  4. package/README.md +208 -2
  5. package/bin/folio-design.mjs +277 -0
  6. package/bin/migrate-legacy.mjs +81 -0
  7. package/dist/agent/Accordion.md +65 -0
  8. package/dist/agent/Actions.md +49 -0
  9. package/dist/agent/Alert.md +65 -0
  10. package/dist/agent/AppShell.md +69 -0
  11. package/dist/agent/ArchitectureFigure.md +72 -0
  12. package/dist/agent/AreaChart.md +94 -0
  13. package/dist/agent/Article.md +65 -0
  14. package/dist/agent/AspectRatio.md +58 -0
  15. package/dist/agent/Avatar.md +53 -0
  16. package/dist/agent/Badge.md +62 -0
  17. package/dist/agent/BarChart.md +93 -0
  18. package/dist/agent/BarList.md +67 -0
  19. package/dist/agent/BigNumber.md +70 -0
  20. package/dist/agent/BoxPlot.md +82 -0
  21. package/dist/agent/Breadcrumb.md +55 -0
  22. package/dist/agent/BulletChart.md +71 -0
  23. package/dist/agent/Button.md +81 -0
  24. package/dist/agent/Calendar.md +77 -0
  25. package/dist/agent/CalendarHeatmap.md +75 -0
  26. package/dist/agent/Card.md +72 -0
  27. package/dist/agent/Checkbox.md +57 -0
  28. package/dist/agent/Code.md +51 -0
  29. package/dist/agent/CodeBlock.md +77 -0
  30. package/dist/agent/Collapsible.md +68 -0
  31. package/dist/agent/Collection.md +169 -0
  32. package/dist/agent/ColorPicker.md +76 -0
  33. package/dist/agent/Combobox.md +77 -0
  34. package/dist/agent/Command.md +122 -0
  35. package/dist/agent/ComposedChart.md +82 -0
  36. package/dist/agent/Contact.md +90 -0
  37. package/dist/agent/Content.md +70 -0
  38. package/dist/agent/ContextMenu.md +93 -0
  39. package/dist/agent/Conversation.md +247 -0
  40. package/dist/agent/DataflowFigure.md +49 -0
  41. package/dist/agent/DatePicker.md +104 -0
  42. package/dist/agent/DescriptionList.md +69 -0
  43. package/dist/agent/Diagram.md +71 -0
  44. package/dist/agent/DiagramCanvas.md +71 -0
  45. package/dist/agent/DiagramExportMenu.md +65 -0
  46. package/dist/agent/DiagramInspector.md +73 -0
  47. package/dist/agent/DiagramLegend.md +56 -0
  48. package/dist/agent/DiagramMinimap.md +69 -0
  49. package/dist/agent/DiagramToolbar.md +70 -0
  50. package/dist/agent/Dialog.md +76 -0
  51. package/dist/agent/DropdownMenu.md +110 -0
  52. package/dist/agent/EmptyState.md +63 -0
  53. package/dist/agent/ErrorState.md +67 -0
  54. package/dist/agent/Evidence.md +165 -0
  55. package/dist/agent/Facet.md +107 -0
  56. package/dist/agent/Field.md +79 -0
  57. package/dist/agent/FigureBand.md +49 -0
  58. package/dist/agent/FloatingIconButton.md +61 -0
  59. package/dist/agent/FunnelChart.md +75 -0
  60. package/dist/agent/Heading.md +65 -0
  61. package/dist/agent/Heatmap.md +78 -0
  62. package/dist/agent/Histogram.md +88 -0
  63. package/dist/agent/Input.md +52 -0
  64. package/dist/agent/Kbd.md +48 -0
  65. package/dist/agent/LifecycleFigure.md +50 -0
  66. package/dist/agent/LineChart.md +85 -0
  67. package/dist/agent/LinkArrow.md +49 -0
  68. package/dist/agent/Markdown.md +69 -0
  69. package/dist/agent/Media.md +261 -0
  70. package/dist/agent/Metric.md +70 -0
  71. package/dist/agent/Metrics.md +114 -0
  72. package/dist/agent/Music.md +86 -0
  73. package/dist/agent/NativeSelect.md +62 -0
  74. package/dist/agent/NavItem.md +56 -0
  75. package/dist/agent/NumberField.md +73 -0
  76. package/dist/agent/PageHeader.md +69 -0
  77. package/dist/agent/Pagination.md +70 -0
  78. package/dist/agent/PieChart.md +80 -0
  79. package/dist/agent/Popover.md +80 -0
  80. package/dist/agent/Portfolio.md +93 -0
  81. package/dist/agent/PortfolioIndex.md +34 -0
  82. package/dist/agent/Progress.md +58 -0
  83. package/dist/agent/RadarChart.md +79 -0
  84. package/dist/agent/RadialChart.md +81 -0
  85. package/dist/agent/RadioGroup.md +66 -0
  86. package/dist/agent/Reading.md +233 -0
  87. package/dist/agent/Recovery.md +72 -0
  88. package/dist/agent/SankeyChart.md +85 -0
  89. package/dist/agent/ScatterChart.md +80 -0
  90. package/dist/agent/ScrollArea.md +62 -0
  91. package/dist/agent/SearchPalette.md +51 -0
  92. package/dist/agent/SearchableMenu.md +69 -0
  93. package/dist/agent/Select.md +102 -0
  94. package/dist/agent/Separator.md +60 -0
  95. package/dist/agent/SequenceFigure.md +51 -0
  96. package/dist/agent/Sheet.md +82 -0
  97. package/dist/agent/Sidebar.md +194 -0
  98. package/dist/agent/SiteNavigation.md +62 -0
  99. package/dist/agent/SiteShell.md +67 -0
  100. package/dist/agent/Skeleton.md +96 -0
  101. package/dist/agent/Slider.md +67 -0
  102. package/dist/agent/Sparkline.md +68 -0
  103. package/dist/agent/Spinner.md +62 -0
  104. package/dist/agent/StatusDot.md +56 -0
  105. package/dist/agent/StatusPill.md +55 -0
  106. package/dist/agent/Steps.md +68 -0
  107. package/dist/agent/Switch.md +50 -0
  108. package/dist/agent/Table.md +111 -0
  109. package/dist/agent/Tabs.md +71 -0
  110. package/dist/agent/Tag.md +67 -0
  111. package/dist/agent/Text.md +66 -0
  112. package/dist/agent/Textarea.md +46 -0
  113. package/dist/agent/Timeline.md +114 -0
  114. package/dist/agent/Timestamp.md +65 -0
  115. package/dist/agent/Toast.md +51 -0
  116. package/dist/agent/ToggleGroup.md +67 -0
  117. package/dist/agent/Toolbar.md +72 -0
  118. package/dist/agent/Tooltip.md +74 -0
  119. package/dist/agent/TreemapChart.md +76 -0
  120. package/dist/agent/WaterfallChart.md +86 -0
  121. package/dist/agent/WorkflowFigure.md +51 -0
  122. package/dist/agent/catalog.json +8006 -0
  123. package/dist/agent/index.md +182 -0
  124. package/dist/article.css +407 -0
  125. package/dist/charts/AreaChart/AreaChart.d.ts +198 -0
  126. package/dist/charts/AreaChart/AreaChart.js +479 -0
  127. package/dist/charts/AreaChart/AreaChart.js.map +1 -0
  128. package/dist/charts/BarChart/BarChart.d.ts +190 -0
  129. package/dist/charts/BarChart/BarChart.js +599 -0
  130. package/dist/charts/BarChart/BarChart.js.map +1 -0
  131. package/dist/charts/BarList/BarList.d.ts +65 -0
  132. package/dist/charts/BarList/BarList.js +79 -0
  133. package/dist/charts/BarList/BarList.js.map +1 -0
  134. package/dist/charts/BigNumber/BigNumber.d.ts +72 -0
  135. package/dist/charts/BigNumber/BigNumber.js +51 -0
  136. package/dist/charts/BigNumber/BigNumber.js.map +1 -0
  137. package/dist/charts/BoxPlot/BoxPlot.d.ts +177 -0
  138. package/dist/charts/BoxPlot/BoxPlot.js +497 -0
  139. package/dist/charts/BoxPlot/BoxPlot.js.map +1 -0
  140. package/dist/charts/BulletChart/BulletChart.d.ts +100 -0
  141. package/dist/charts/BulletChart/BulletChart.js +197 -0
  142. package/dist/charts/BulletChart/BulletChart.js.map +1 -0
  143. package/dist/charts/CalendarHeatmap/CalendarHeatmap.d.ts +106 -0
  144. package/dist/charts/CalendarHeatmap/CalendarHeatmap.js +103 -0
  145. package/dist/charts/CalendarHeatmap/CalendarHeatmap.js.map +1 -0
  146. package/dist/charts/ComposedChart/ComposedChart.d.ts +178 -0
  147. package/dist/charts/ComposedChart/ComposedChart.js +667 -0
  148. package/dist/charts/ComposedChart/ComposedChart.js.map +1 -0
  149. package/dist/charts/Facet/Facet.d.ts +240 -0
  150. package/dist/charts/Facet/Facet.js +133 -0
  151. package/dist/charts/Facet/Facet.js.map +1 -0
  152. package/dist/charts/Facet/panels.d.ts +187 -0
  153. package/dist/charts/Facet/panels.js +203 -0
  154. package/dist/charts/Facet/panels.js.map +1 -0
  155. package/dist/charts/FunnelChart/FunnelChart.d.ts +106 -0
  156. package/dist/charts/FunnelChart/FunnelChart.js +137 -0
  157. package/dist/charts/FunnelChart/FunnelChart.js.map +1 -0
  158. package/dist/charts/Heatmap/Heatmap.d.ts +101 -0
  159. package/dist/charts/Heatmap/Heatmap.js +125 -0
  160. package/dist/charts/Heatmap/Heatmap.js.map +1 -0
  161. package/dist/charts/Histogram/Histogram.d.ts +188 -0
  162. package/dist/charts/Histogram/Histogram.js +382 -0
  163. package/dist/charts/Histogram/Histogram.js.map +1 -0
  164. package/dist/charts/LineChart/LineChart.d.ts +174 -0
  165. package/dist/charts/LineChart/LineChart.js +485 -0
  166. package/dist/charts/LineChart/LineChart.js.map +1 -0
  167. package/dist/charts/PieChart/PieChart.d.ts +140 -0
  168. package/dist/charts/PieChart/PieChart.js +317 -0
  169. package/dist/charts/PieChart/PieChart.js.map +1 -0
  170. package/dist/charts/RadarChart/RadarChart.d.ts +135 -0
  171. package/dist/charts/RadarChart/RadarChart.js +303 -0
  172. package/dist/charts/RadarChart/RadarChart.js.map +1 -0
  173. package/dist/charts/RadialChart/RadialChart.d.ts +142 -0
  174. package/dist/charts/RadialChart/RadialChart.js +279 -0
  175. package/dist/charts/RadialChart/RadialChart.js.map +1 -0
  176. package/dist/charts/SankeyChart/SankeyChart.d.ts +149 -0
  177. package/dist/charts/SankeyChart/SankeyChart.js +509 -0
  178. package/dist/charts/SankeyChart/SankeyChart.js.map +1 -0
  179. package/dist/charts/ScatterChart/ScatterChart.d.ts +149 -0
  180. package/dist/charts/ScatterChart/ScatterChart.js +275 -0
  181. package/dist/charts/ScatterChart/ScatterChart.js.map +1 -0
  182. package/dist/charts/Sparkline/Sparkline.d.ts +53 -0
  183. package/dist/charts/Sparkline/Sparkline.js +95 -0
  184. package/dist/charts/Sparkline/Sparkline.js.map +1 -0
  185. package/dist/charts/TreemapChart/TreemapChart.d.ts +98 -0
  186. package/dist/charts/TreemapChart/TreemapChart.js +127 -0
  187. package/dist/charts/TreemapChart/TreemapChart.js.map +1 -0
  188. package/dist/charts/WaterfallChart/WaterfallChart.d.ts +164 -0
  189. package/dist/charts/WaterfallChart/WaterfallChart.js +321 -0
  190. package/dist/charts/WaterfallChart/WaterfallChart.js.map +1 -0
  191. package/dist/charts/index.d.ts +43 -0
  192. package/dist/charts/index.js +130 -0
  193. package/dist/charts/index.js.map +1 -0
  194. package/dist/charts/lib/annotations.d.ts +103 -0
  195. package/dist/charts/lib/annotations.js +99 -0
  196. package/dist/charts/lib/annotations.js.map +1 -0
  197. package/dist/charts/lib/axis.d.ts +18 -0
  198. package/dist/charts/lib/axis.js +21 -0
  199. package/dist/charts/lib/axis.js.map +1 -0
  200. package/dist/charts/lib/background.d.ts +33 -0
  201. package/dist/charts/lib/background.js +173 -0
  202. package/dist/charts/lib/background.js.map +1 -0
  203. package/dist/charts/lib/brush.d.ts +94 -0
  204. package/dist/charts/lib/brush.js +535 -0
  205. package/dist/charts/lib/brush.js.map +1 -0
  206. package/dist/charts/lib/chart.d.ts +94 -0
  207. package/dist/charts/lib/chart.js +149 -0
  208. package/dist/charts/lib/chart.js.map +1 -0
  209. package/dist/charts/lib/dot.d.ts +29 -0
  210. package/dist/charts/lib/dot.js +78 -0
  211. package/dist/charts/lib/dot.js.map +1 -0
  212. package/dist/charts/lib/empty.d.ts +31 -0
  213. package/dist/charts/lib/empty.js +24 -0
  214. package/dist/charts/lib/empty.js.map +1 -0
  215. package/dist/charts/lib/export.d.ts +94 -0
  216. package/dist/charts/lib/export.js +62 -0
  217. package/dist/charts/lib/export.js.map +1 -0
  218. package/dist/charts/lib/figure.d.ts +81 -0
  219. package/dist/charts/lib/figure.js +62 -0
  220. package/dist/charts/lib/figure.js.map +1 -0
  221. package/dist/charts/lib/format.d.ts +46 -0
  222. package/dist/charts/lib/format.js +56 -0
  223. package/dist/charts/lib/format.js.map +1 -0
  224. package/dist/charts/lib/legend.d.ts +45 -0
  225. package/dist/charts/lib/legend.js +117 -0
  226. package/dist/charts/lib/legend.js.map +1 -0
  227. package/dist/charts/lib/loading.d.ts +48 -0
  228. package/dist/charts/lib/loading.js +105 -0
  229. package/dist/charts/lib/loading.js.map +1 -0
  230. package/dist/charts/lib/paint.d.ts +154 -0
  231. package/dist/charts/lib/paint.js +551 -0
  232. package/dist/charts/lib/paint.js.map +1 -0
  233. package/dist/charts/lib/scale.d.ts +23 -0
  234. package/dist/charts/lib/scale.js +13 -0
  235. package/dist/charts/lib/scale.js.map +1 -0
  236. package/dist/charts/lib/selection.d.ts +20 -0
  237. package/dist/charts/lib/selection.js +18 -0
  238. package/dist/charts/lib/selection.js.map +1 -0
  239. package/dist/charts/lib/sonify-control.d.ts +163 -0
  240. package/dist/charts/lib/sonify-control.js +172 -0
  241. package/dist/charts/lib/sonify-control.js.map +1 -0
  242. package/dist/charts/lib/sonify.d.ts +248 -0
  243. package/dist/charts/lib/sonify.js +262 -0
  244. package/dist/charts/lib/sonify.js.map +1 -0
  245. package/dist/charts/lib/toolbar.d.ts +144 -0
  246. package/dist/charts/lib/toolbar.js +156 -0
  247. package/dist/charts/lib/toolbar.js.map +1 -0
  248. package/dist/charts/lib/tooltip.d.ts +59 -0
  249. package/dist/charts/lib/tooltip.js +135 -0
  250. package/dist/charts/lib/tooltip.js.map +1 -0
  251. package/dist/charts/lib/values.d.ts +56 -0
  252. package/dist/charts/lib/values.js +71 -0
  253. package/dist/charts/lib/values.js.map +1 -0
  254. package/dist/charts/lib/zoom.d.ts +139 -0
  255. package/dist/charts/lib/zoom.js +314 -0
  256. package/dist/charts/lib/zoom.js.map +1 -0
  257. package/dist/components/Accordion/Accordion.d.ts +34 -0
  258. package/dist/components/Accordion/Accordion.js +43 -0
  259. package/dist/components/Accordion/Accordion.js.map +1 -0
  260. package/dist/components/Alert/Alert.d.ts +32 -0
  261. package/dist/components/Alert/Alert.js +49 -0
  262. package/dist/components/Alert/Alert.js.map +1 -0
  263. package/dist/components/AppShell/AppShell.d.ts +58 -0
  264. package/dist/components/AppShell/AppShell.js +126 -0
  265. package/dist/components/AppShell/AppShell.js.map +1 -0
  266. package/dist/components/Article/Article.d.ts +58 -0
  267. package/dist/components/Article/Article.js +34 -0
  268. package/dist/components/Article/Article.js.map +1 -0
  269. package/dist/components/AspectRatio/AspectRatio.d.ts +46 -0
  270. package/dist/components/AspectRatio/AspectRatio.js +33 -0
  271. package/dist/components/AspectRatio/AspectRatio.js.map +1 -0
  272. package/dist/components/Avatar/Avatar.d.ts +38 -0
  273. package/dist/components/Avatar/Avatar.js +44 -0
  274. package/dist/components/Avatar/Avatar.js.map +1 -0
  275. package/dist/components/Badge/Badge.d.ts +30 -0
  276. package/dist/components/Badge/Badge.js +29 -0
  277. package/dist/components/Badge/Badge.js.map +1 -0
  278. package/dist/components/Breadcrumb/Breadcrumb.d.ts +37 -0
  279. package/dist/components/Breadcrumb/Breadcrumb.js +46 -0
  280. package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
  281. package/dist/components/Button/Button.d.ts +70 -0
  282. package/dist/components/Button/Button.js +95 -0
  283. package/dist/components/Button/Button.js.map +1 -0
  284. package/dist/components/Calendar/Calendar.d.ts +54 -0
  285. package/dist/components/Calendar/Calendar.js +369 -0
  286. package/dist/components/Calendar/Calendar.js.map +1 -0
  287. package/dist/components/Card/Card.d.ts +55 -0
  288. package/dist/components/Card/Card.js +64 -0
  289. package/dist/components/Card/Card.js.map +1 -0
  290. package/dist/components/Checkbox/Checkbox.d.ts +26 -0
  291. package/dist/components/Checkbox/Checkbox.js +34 -0
  292. package/dist/components/Checkbox/Checkbox.js.map +1 -0
  293. package/dist/components/Code/Code.d.ts +30 -0
  294. package/dist/components/Code/Code.js +21 -0
  295. package/dist/components/Code/Code.js.map +1 -0
  296. package/dist/components/CodeBlock/CodeBlock.d.ts +145 -0
  297. package/dist/components/CodeBlock/CodeBlock.js +114 -0
  298. package/dist/components/CodeBlock/CodeBlock.js.map +1 -0
  299. package/dist/components/Collapsible/Collapsible.d.ts +45 -0
  300. package/dist/components/Collapsible/Collapsible.js +60 -0
  301. package/dist/components/Collapsible/Collapsible.js.map +1 -0
  302. package/dist/components/ColorPicker/ColorPicker.d.ts +67 -0
  303. package/dist/components/ColorPicker/ColorPicker.js +334 -0
  304. package/dist/components/ColorPicker/ColorPicker.js.map +1 -0
  305. package/dist/components/Combobox/Combobox.d.ts +77 -0
  306. package/dist/components/Combobox/Combobox.js +170 -0
  307. package/dist/components/Combobox/Combobox.js.map +1 -0
  308. package/dist/components/Command/Command.d.ts +125 -0
  309. package/dist/components/Command/Command.js +204 -0
  310. package/dist/components/Command/Command.js.map +1 -0
  311. package/dist/components/ContextMenu/ContextMenu.d.ts +63 -0
  312. package/dist/components/ContextMenu/ContextMenu.js +109 -0
  313. package/dist/components/ContextMenu/ContextMenu.js.map +1 -0
  314. package/dist/components/DatePicker/DatePicker.d.ts +130 -0
  315. package/dist/components/DatePicker/DatePicker.js +257 -0
  316. package/dist/components/DatePicker/DatePicker.js.map +1 -0
  317. package/dist/components/DescriptionList/DescriptionList.d.ts +73 -0
  318. package/dist/components/DescriptionList/DescriptionList.js +35 -0
  319. package/dist/components/DescriptionList/DescriptionList.js.map +1 -0
  320. package/dist/components/Diagram/Diagram.d.ts +86 -0
  321. package/dist/components/Diagram/Diagram.js +211 -0
  322. package/dist/components/Diagram/Diagram.js.map +1 -0
  323. package/dist/components/Dialog/Dialog.d.ts +63 -0
  324. package/dist/components/Dialog/Dialog.js +90 -0
  325. package/dist/components/Dialog/Dialog.js.map +1 -0
  326. package/dist/components/DropdownMenu/DropdownMenu.d.ts +87 -0
  327. package/dist/components/DropdownMenu/DropdownMenu.js +120 -0
  328. package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -0
  329. package/dist/components/EmptyState/EmptyState.d.ts +55 -0
  330. package/dist/components/EmptyState/EmptyState.js +32 -0
  331. package/dist/components/EmptyState/EmptyState.js.map +1 -0
  332. package/dist/components/ErrorState/ErrorState.d.ts +55 -0
  333. package/dist/components/ErrorState/ErrorState.js +41 -0
  334. package/dist/components/ErrorState/ErrorState.js.map +1 -0
  335. package/dist/components/Field/Field.d.ts +111 -0
  336. package/dist/components/Field/Field.js +95 -0
  337. package/dist/components/Field/Field.js.map +1 -0
  338. package/dist/components/Field/field-control.d.ts +31 -0
  339. package/dist/components/Field/field-control.js +12 -0
  340. package/dist/components/Field/field-control.js.map +1 -0
  341. package/dist/components/FigureBand/FigureBand.d.ts +31 -0
  342. package/dist/components/FigureBand/FigureBand.js +51 -0
  343. package/dist/components/FigureBand/FigureBand.js.map +1 -0
  344. package/dist/components/FloatingIconButton/FloatingIconButton.d.ts +29 -0
  345. package/dist/components/FloatingIconButton/FloatingIconButton.js +34 -0
  346. package/dist/components/FloatingIconButton/FloatingIconButton.js.map +1 -0
  347. package/dist/components/Heading/Heading.d.ts +62 -0
  348. package/dist/components/Heading/Heading.js +44 -0
  349. package/dist/components/Heading/Heading.js.map +1 -0
  350. package/dist/components/Input/Input.d.ts +22 -0
  351. package/dist/components/Input/Input.js +21 -0
  352. package/dist/components/Input/Input.js.map +1 -0
  353. package/dist/components/Kbd/Kbd.d.ts +27 -0
  354. package/dist/components/Kbd/Kbd.js +21 -0
  355. package/dist/components/Kbd/Kbd.js.map +1 -0
  356. package/dist/components/LinkArrow/LinkArrow.d.ts +24 -0
  357. package/dist/components/LinkArrow/LinkArrow.js +24 -0
  358. package/dist/components/LinkArrow/LinkArrow.js.map +1 -0
  359. package/dist/components/Markdown/Markdown.d.ts +139 -0
  360. package/dist/components/Markdown/Markdown.js +135 -0
  361. package/dist/components/Markdown/Markdown.js.map +1 -0
  362. package/dist/components/Markdown/inline.d.ts +29 -0
  363. package/dist/components/Markdown/inline.js +74 -0
  364. package/dist/components/Markdown/inline.js.map +1 -0
  365. package/dist/components/Markdown/nodes.d.ts +65 -0
  366. package/dist/components/Markdown/nodes.js +1 -0
  367. package/dist/components/Markdown/nodes.js.map +1 -0
  368. package/dist/components/Markdown/parse.d.ts +24 -0
  369. package/dist/components/Markdown/parse.js +110 -0
  370. package/dist/components/Markdown/parse.js.map +1 -0
  371. package/dist/components/Markdown/slug.d.ts +15 -0
  372. package/dist/components/Markdown/slug.js +7 -0
  373. package/dist/components/Markdown/slug.js.map +1 -0
  374. package/dist/components/Metric/Metric.d.ts +61 -0
  375. package/dist/components/Metric/Metric.js +51 -0
  376. package/dist/components/Metric/Metric.js.map +1 -0
  377. package/dist/components/NativeSelect/NativeSelect.d.ts +33 -0
  378. package/dist/components/NativeSelect/NativeSelect.js +44 -0
  379. package/dist/components/NativeSelect/NativeSelect.js.map +1 -0
  380. package/dist/components/NavItem/NavItem.d.ts +39 -0
  381. package/dist/components/NavItem/NavItem.js +31 -0
  382. package/dist/components/NavItem/NavItem.js.map +1 -0
  383. package/dist/components/NumberField/NumberField.d.ts +69 -0
  384. package/dist/components/NumberField/NumberField.js +162 -0
  385. package/dist/components/NumberField/NumberField.js.map +1 -0
  386. package/dist/components/PageHeader/PageHeader.d.ts +92 -0
  387. package/dist/components/PageHeader/PageHeader.js +37 -0
  388. package/dist/components/PageHeader/PageHeader.js.map +1 -0
  389. package/dist/components/Pagination/Pagination.d.ts +67 -0
  390. package/dist/components/Pagination/Pagination.js +112 -0
  391. package/dist/components/Pagination/Pagination.js.map +1 -0
  392. package/dist/components/Popover/Popover.d.ts +39 -0
  393. package/dist/components/Popover/Popover.js +57 -0
  394. package/dist/components/Popover/Popover.js.map +1 -0
  395. package/dist/components/Progress/Progress.d.ts +43 -0
  396. package/dist/components/Progress/Progress.js +57 -0
  397. package/dist/components/Progress/Progress.js.map +1 -0
  398. package/dist/components/RadioGroup/RadioGroup.d.ts +49 -0
  399. package/dist/components/RadioGroup/RadioGroup.js +53 -0
  400. package/dist/components/RadioGroup/RadioGroup.js.map +1 -0
  401. package/dist/components/ScrollArea/ScrollArea.d.ts +46 -0
  402. package/dist/components/ScrollArea/ScrollArea.js +54 -0
  403. package/dist/components/ScrollArea/ScrollArea.js.map +1 -0
  404. package/dist/components/SearchableMenu/SearchableMenu.d.ts +68 -0
  405. package/dist/components/SearchableMenu/SearchableMenu.js +101 -0
  406. package/dist/components/SearchableMenu/SearchableMenu.js.map +1 -0
  407. package/dist/components/Select/Select.d.ts +87 -0
  408. package/dist/components/Select/Select.js +130 -0
  409. package/dist/components/Select/Select.js.map +1 -0
  410. package/dist/components/Separator/Separator.d.ts +48 -0
  411. package/dist/components/Separator/Separator.js +43 -0
  412. package/dist/components/Separator/Separator.js.map +1 -0
  413. package/dist/components/Sheet/Sheet.d.ts +43 -0
  414. package/dist/components/Sheet/Sheet.js +79 -0
  415. package/dist/components/Sheet/Sheet.js.map +1 -0
  416. package/dist/components/Sidebar/Sidebar.d.ts +357 -0
  417. package/dist/components/Sidebar/Sidebar.js +447 -0
  418. package/dist/components/Sidebar/Sidebar.js.map +1 -0
  419. package/dist/components/Skeleton/Skeleton.d.ts +70 -0
  420. package/dist/components/Skeleton/Skeleton.js +44 -0
  421. package/dist/components/Skeleton/Skeleton.js.map +1 -0
  422. package/dist/components/Slider/Slider.d.ts +74 -0
  423. package/dist/components/Slider/Slider.js +143 -0
  424. package/dist/components/Slider/Slider.js.map +1 -0
  425. package/dist/components/Spinner/Spinner.d.ts +58 -0
  426. package/dist/components/Spinner/Spinner.js +49 -0
  427. package/dist/components/Spinner/Spinner.js.map +1 -0
  428. package/dist/components/StatusDot/StatusDot.d.ts +29 -0
  429. package/dist/components/StatusDot/StatusDot.js +44 -0
  430. package/dist/components/StatusDot/StatusDot.js.map +1 -0
  431. package/dist/components/StatusPill/StatusPill.d.ts +30 -0
  432. package/dist/components/StatusPill/StatusPill.js +37 -0
  433. package/dist/components/StatusPill/StatusPill.js.map +1 -0
  434. package/dist/components/Steps/Steps.d.ts +65 -0
  435. package/dist/components/Steps/Steps.js +25 -0
  436. package/dist/components/Steps/Steps.js.map +1 -0
  437. package/dist/components/Switch/Switch.d.ts +23 -0
  438. package/dist/components/Switch/Switch.js +23 -0
  439. package/dist/components/Switch/Switch.js.map +1 -0
  440. package/dist/components/Table/Table.d.ts +116 -0
  441. package/dist/components/Table/Table.js +137 -0
  442. package/dist/components/Table/Table.js.map +1 -0
  443. package/dist/components/Tabs/Tabs.d.ts +37 -0
  444. package/dist/components/Tabs/Tabs.js +205 -0
  445. package/dist/components/Tabs/Tabs.js.map +1 -0
  446. package/dist/components/Tag/Tag.d.ts +87 -0
  447. package/dist/components/Tag/Tag.js +62 -0
  448. package/dist/components/Tag/Tag.js.map +1 -0
  449. package/dist/components/Text/Text.d.ts +62 -0
  450. package/dist/components/Text/Text.js +30 -0
  451. package/dist/components/Text/Text.js.map +1 -0
  452. package/dist/components/Textarea/Textarea.d.ts +20 -0
  453. package/dist/components/Textarea/Textarea.js +32 -0
  454. package/dist/components/Textarea/Textarea.js.map +1 -0
  455. package/dist/components/Timestamp/Timestamp.d.ts +59 -0
  456. package/dist/components/Timestamp/Timestamp.js +56 -0
  457. package/dist/components/Timestamp/Timestamp.js.map +1 -0
  458. package/dist/components/Toast/Toast.d.ts +32 -0
  459. package/dist/components/Toast/Toast.js +64 -0
  460. package/dist/components/Toast/Toast.js.map +1 -0
  461. package/dist/components/ToggleGroup/ToggleGroup.d.ts +46 -0
  462. package/dist/components/ToggleGroup/ToggleGroup.js +88 -0
  463. package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -0
  464. package/dist/components/Toolbar/Toolbar.d.ts +55 -0
  465. package/dist/components/Toolbar/Toolbar.js +43 -0
  466. package/dist/components/Toolbar/Toolbar.js.map +1 -0
  467. package/dist/components/Tooltip/Tooltip.d.ts +43 -0
  468. package/dist/components/Tooltip/Tooltip.js +40 -0
  469. package/dist/components/Tooltip/Tooltip.js.map +1 -0
  470. package/dist/diagrams/ArchitectureFigure/ArchitectureFigure.d.ts +55 -0
  471. package/dist/diagrams/ArchitectureFigure/ArchitectureFigure.js +175 -0
  472. package/dist/diagrams/ArchitectureFigure/ArchitectureFigure.js.map +1 -0
  473. package/dist/diagrams/DataflowFigure/DataflowFigure.d.ts +28 -0
  474. package/dist/diagrams/DataflowFigure/DataflowFigure.js +148 -0
  475. package/dist/diagrams/DataflowFigure/DataflowFigure.js.map +1 -0
  476. package/dist/diagrams/DiagramCanvas/DiagramCanvas.d.ts +78 -0
  477. package/dist/diagrams/DiagramCanvas/DiagramCanvas.js +229 -0
  478. package/dist/diagrams/DiagramCanvas/DiagramCanvas.js.map +1 -0
  479. package/dist/diagrams/DiagramExportMenu/DiagramExportMenu.d.ts +106 -0
  480. package/dist/diagrams/DiagramExportMenu/DiagramExportMenu.js +123 -0
  481. package/dist/diagrams/DiagramExportMenu/DiagramExportMenu.js.map +1 -0
  482. package/dist/diagrams/DiagramInspector/DiagramInspector.d.ts +70 -0
  483. package/dist/diagrams/DiagramInspector/DiagramInspector.js +94 -0
  484. package/dist/diagrams/DiagramInspector/DiagramInspector.js.map +1 -0
  485. package/dist/diagrams/DiagramLegend/DiagramLegend.d.ts +42 -0
  486. package/dist/diagrams/DiagramLegend/DiagramLegend.js +35 -0
  487. package/dist/diagrams/DiagramLegend/DiagramLegend.js.map +1 -0
  488. package/dist/diagrams/DiagramMinimap/DiagramMinimap.d.ts +77 -0
  489. package/dist/diagrams/DiagramMinimap/DiagramMinimap.js +106 -0
  490. package/dist/diagrams/DiagramMinimap/DiagramMinimap.js.map +1 -0
  491. package/dist/diagrams/DiagramToolbar/DiagramToolbar.d.ts +48 -0
  492. package/dist/diagrams/DiagramToolbar/DiagramToolbar.js +53 -0
  493. package/dist/diagrams/DiagramToolbar/DiagramToolbar.js.map +1 -0
  494. package/dist/diagrams/LifecycleFigure/LifecycleFigure.d.ts +31 -0
  495. package/dist/diagrams/LifecycleFigure/LifecycleFigure.js +234 -0
  496. package/dist/diagrams/LifecycleFigure/LifecycleFigure.js.map +1 -0
  497. package/dist/diagrams/SequenceFigure/SequenceFigure.d.ts +38 -0
  498. package/dist/diagrams/SequenceFigure/SequenceFigure.js +261 -0
  499. package/dist/diagrams/SequenceFigure/SequenceFigure.js.map +1 -0
  500. package/dist/diagrams/WorkflowFigure/WorkflowFigure.d.ts +36 -0
  501. package/dist/diagrams/WorkflowFigure/WorkflowFigure.js +259 -0
  502. package/dist/diagrams/WorkflowFigure/WorkflowFigure.js.map +1 -0
  503. package/dist/diagrams/index.d.ts +17 -0
  504. package/dist/diagrams/index.js +29 -0
  505. package/dist/diagrams/index.js.map +1 -0
  506. package/dist/diagrams/lib/dev.d.ts +61 -0
  507. package/dist/diagrams/lib/dev.js +96 -0
  508. package/dist/diagrams/lib/dev.js.map +1 -0
  509. package/dist/diagrams/lib/frame.d.ts +138 -0
  510. package/dist/diagrams/lib/frame.js +131 -0
  511. package/dist/diagrams/lib/frame.js.map +1 -0
  512. package/dist/diagrams/lib/geometry.d.ts +114 -0
  513. package/dist/diagrams/lib/geometry.js +113 -0
  514. package/dist/diagrams/lib/geometry.js.map +1 -0
  515. package/dist/diagrams/lib/legend.d.ts +32 -0
  516. package/dist/diagrams/lib/legend.js +84 -0
  517. package/dist/diagrams/lib/legend.js.map +1 -0
  518. package/dist/diagrams/lib/marks.d.ts +207 -0
  519. package/dist/diagrams/lib/marks.js +480 -0
  520. package/dist/diagrams/lib/marks.js.map +1 -0
  521. package/dist/diagrams/lib/route.d.ts +106 -0
  522. package/dist/diagrams/lib/route.js +201 -0
  523. package/dist/diagrams/lib/route.js.map +1 -0
  524. package/dist/diagrams/lib/wires.d.ts +59 -0
  525. package/dist/diagrams/lib/wires.js +94 -0
  526. package/dist/diagrams/lib/wires.js.map +1 -0
  527. package/dist/diagrams/spec.d.ts +405 -0
  528. package/dist/diagrams/spec.js +1 -0
  529. package/dist/diagrams/spec.js.map +1 -0
  530. package/dist/fonts/hanken-grotesk-300.woff2 +0 -0
  531. package/dist/fonts/hanken-grotesk-400.woff2 +0 -0
  532. package/dist/fonts/hanken-grotesk-500.woff2 +0 -0
  533. package/dist/fonts/hanken-grotesk-600.woff2 +0 -0
  534. package/dist/fonts/hanken-grotesk-700.woff2 +0 -0
  535. package/dist/fonts/ibm-plex-mono-400.woff2 +0 -0
  536. package/dist/fonts/ibm-plex-mono-500.woff2 +0 -0
  537. package/dist/fonts/ibm-plex-mono-600.woff2 +0 -0
  538. package/dist/fonts/newsreader-300.woff2 +0 -0
  539. package/dist/fonts/newsreader-400.woff2 +0 -0
  540. package/dist/fonts/newsreader-500.woff2 +0 -0
  541. package/dist/fonts/newsreader-600.woff2 +0 -0
  542. package/dist/fonts.css +96 -0
  543. package/dist/index.d.ts +97 -0
  544. package/dist/index.js +80 -0
  545. package/dist/index.js.map +1 -0
  546. package/dist/keyframes.css +300 -0
  547. package/dist/lib/cn.d.ts +21 -0
  548. package/dist/lib/cn.js +9 -0
  549. package/dist/lib/cn.js.map +1 -0
  550. package/dist/lib/color.d.ts +80 -0
  551. package/dist/lib/color.js +189 -0
  552. package/dist/lib/color.js.map +1 -0
  553. package/dist/lib/control.d.ts +32 -0
  554. package/dist/lib/control.js +14 -0
  555. package/dist/lib/control.js.map +1 -0
  556. package/dist/lib/index.d.ts +4 -0
  557. package/dist/lib/index.js +11 -0
  558. package/dist/lib/index.js.map +1 -0
  559. package/dist/lib/numeric.d.ts +35 -0
  560. package/dist/lib/numeric.js +29 -0
  561. package/dist/lib/numeric.js.map +1 -0
  562. package/dist/lib/overlay-container.d.ts +48 -0
  563. package/dist/lib/overlay-container.js +15 -0
  564. package/dist/lib/overlay-container.js.map +1 -0
  565. package/dist/lib/slot-content.d.ts +8 -0
  566. package/dist/lib/slot-content.js +17 -0
  567. package/dist/lib/slot-content.js.map +1 -0
  568. package/dist/lib/step-rail.d.ts +45 -0
  569. package/dist/lib/step-rail.js +47 -0
  570. package/dist/lib/step-rail.js.map +1 -0
  571. package/dist/lib/svg-export.d.ts +138 -0
  572. package/dist/lib/svg-export.js +198 -0
  573. package/dist/lib/svg-export.js.map +1 -0
  574. package/dist/lib/useClipboardCopy.d.ts +30 -0
  575. package/dist/lib/useClipboardCopy.js +37 -0
  576. package/dist/lib/useClipboardCopy.js.map +1 -0
  577. package/dist/lib/useSelectionIndicator.d.ts +29 -0
  578. package/dist/lib/useSelectionIndicator.js +49 -0
  579. package/dist/lib/useSelectionIndicator.js.map +1 -0
  580. package/dist/lib/warn.d.ts +73 -0
  581. package/dist/lib/warn.js +38 -0
  582. package/dist/lib/warn.js.map +1 -0
  583. package/dist/semantic.css +193 -0
  584. package/dist/styles.css +98 -0
  585. package/dist/themes.css +514 -0
  586. package/dist/tokens/brand.d.ts +47 -0
  587. package/dist/tokens/brand.js +38 -0
  588. package/dist/tokens/brand.js.map +1 -0
  589. package/dist/tokens.css +652 -0
  590. package/dist/tokens.d.ts +198 -0
  591. package/dist/tokens.js +1020 -0
  592. package/dist/tokens.json +1019 -0
  593. package/dist/website/Actions/Actions.d.ts +34 -0
  594. package/dist/website/Actions/Actions.js +29 -0
  595. package/dist/website/Actions/Actions.js.map +1 -0
  596. package/dist/website/Collection/Collection.d.ts +128 -0
  597. package/dist/website/Collection/Collection.js +162 -0
  598. package/dist/website/Collection/Collection.js.map +1 -0
  599. package/dist/website/Contact/Contact.d.ts +87 -0
  600. package/dist/website/Contact/Contact.js +94 -0
  601. package/dist/website/Contact/Contact.js.map +1 -0
  602. package/dist/website/Content/CodePanel.d.ts +27 -0
  603. package/dist/website/Content/CodePanel.js +30 -0
  604. package/dist/website/Content/CodePanel.js.map +1 -0
  605. package/dist/website/Content/Content.d.ts +29 -0
  606. package/dist/website/Content/Content.js +38 -0
  607. package/dist/website/Content/Content.js.map +1 -0
  608. package/dist/website/Conversation/Conversation.d.ts +193 -0
  609. package/dist/website/Conversation/Conversation.js +252 -0
  610. package/dist/website/Conversation/Conversation.js.map +1 -0
  611. package/dist/website/Evidence/Evidence.d.ts +116 -0
  612. package/dist/website/Evidence/Evidence.js +142 -0
  613. package/dist/website/Evidence/Evidence.js.map +1 -0
  614. package/dist/website/Media/Media.d.ts +173 -0
  615. package/dist/website/Media/Media.js +225 -0
  616. package/dist/website/Media/Media.js.map +1 -0
  617. package/dist/website/Media/MediaLightbox.d.ts +18 -0
  618. package/dist/website/Media/MediaLightbox.js +38 -0
  619. package/dist/website/Media/MediaLightbox.js.map +1 -0
  620. package/dist/website/Metrics/Metrics.d.ts +74 -0
  621. package/dist/website/Metrics/Metrics.js +96 -0
  622. package/dist/website/Metrics/Metrics.js.map +1 -0
  623. package/dist/website/Music/Music.d.ts +60 -0
  624. package/dist/website/Music/Music.js +80 -0
  625. package/dist/website/Music/Music.js.map +1 -0
  626. package/dist/website/Portfolio/FrameLayout.d.ts +9 -0
  627. package/dist/website/Portfolio/FrameLayout.js +42 -0
  628. package/dist/website/Portfolio/FrameLayout.js.map +1 -0
  629. package/dist/website/Portfolio/Portfolio.d.ts +49 -0
  630. package/dist/website/Portfolio/Portfolio.js +66 -0
  631. package/dist/website/Portfolio/Portfolio.js.map +1 -0
  632. package/dist/website/Portfolio/QuestionCard.d.ts +22 -0
  633. package/dist/website/Portfolio/QuestionCard.js +33 -0
  634. package/dist/website/Portfolio/QuestionCard.js.map +1 -0
  635. package/dist/website/PortfolioIndex/PortfolioIndex.d.ts +21 -0
  636. package/dist/website/PortfolioIndex/PortfolioIndex.js +31 -0
  637. package/dist/website/PortfolioIndex/PortfolioIndex.js.map +1 -0
  638. package/dist/website/Reading/Reading.d.ts +203 -0
  639. package/dist/website/Reading/Reading.js +357 -0
  640. package/dist/website/Reading/Reading.js.map +1 -0
  641. package/dist/website/Recovery/Recovery.d.ts +39 -0
  642. package/dist/website/Recovery/Recovery.js +96 -0
  643. package/dist/website/Recovery/Recovery.js.map +1 -0
  644. package/dist/website/SearchPalette/SearchPalette.d.ts +59 -0
  645. package/dist/website/SearchPalette/SearchPalette.js +120 -0
  646. package/dist/website/SearchPalette/SearchPalette.js.map +1 -0
  647. package/dist/website/SiteNavigation/SiteNavigation.d.ts +46 -0
  648. package/dist/website/SiteNavigation/SiteNavigation.js +101 -0
  649. package/dist/website/SiteNavigation/SiteNavigation.js.map +1 -0
  650. package/dist/website/SiteShell/SiteShell.d.ts +45 -0
  651. package/dist/website/SiteShell/SiteShell.js +46 -0
  652. package/dist/website/SiteShell/SiteShell.js.map +1 -0
  653. package/dist/website/Timeline/Timeline.d.ts +80 -0
  654. package/dist/website/Timeline/Timeline.js +99 -0
  655. package/dist/website/Timeline/Timeline.js.map +1 -0
  656. package/dist/website/index.d.ts +27 -0
  657. package/dist/website/index.js +21 -0
  658. package/dist/website/index.js.map +1 -0
  659. package/dist/website-actions.css +6 -0
  660. package/dist/website-base.css +46 -0
  661. package/dist/website-collection.css +89 -0
  662. package/dist/website-contact.css +29 -0
  663. package/dist/website-content.css +17 -0
  664. package/dist/website-controls.css +91 -0
  665. package/dist/website-conversation.css +115 -0
  666. package/dist/website-evidence.css +56 -0
  667. package/dist/website-media.css +227 -0
  668. package/dist/website-metrics.css +15 -0
  669. package/dist/website-music.css +27 -0
  670. package/dist/website-portfolio.css +94 -0
  671. package/dist/website-reading.css +159 -0
  672. package/dist/website-recovery.css +28 -0
  673. package/dist/website-search.css +26 -0
  674. package/dist/website-shell.css +89 -0
  675. package/dist/website-timeline.css +43 -0
  676. package/dist/website.css +25 -0
  677. package/llms.txt +35 -0
  678. package/package.json +163 -5
  679. package/skills/folio-design/SKILL.md +228 -0
  680. package/skills/folio-design/evals/claims.json +95 -0
  681. package/skills/folio-design/evals/evals.json +84 -0
  682. package/skills/folio-design/rules/a11y.md +167 -0
  683. package/skills/folio-design/rules/composition.md +108 -0
  684. package/skills/folio-design/rules/forms.md +135 -0
  685. package/skills/folio-design/rules/naming.md +155 -0
  686. package/skills/folio-design/rules/tokens.md +133 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["'use client'\n\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'\nimport type { RemixiconComponentType } from '@remixicon/react'\nimport { isValidElement, useId, type ComponentProps, type ReactNode } from 'react'\nimport { cn } from '../../lib/cn'\nimport { useOverlayContainer } from '../../lib/overlay-container'\n\n/**\n * True for a component type — `icon={Settings}` — rather than a rendered element.\n *\n * Everything a `ReactNode` can be is an element, a primitive, an array, another\n * iterable or a promise; a Remix Icon glyph is none of those, it is a plain\n * function component. So both spellings are tellable apart at runtime, which is\n * what lets one prop take either — and it has to, because this prop meant the\n * opposite thing one import away and the wrong spelling failed at render, not\n * at the type.\n */\nfunction isIconComponent(icon: RemixiconComponentType | ReactNode): icon is RemixiconComponentType {\n if (isValidElement(icon)) return false\n if (typeof icon === 'function') return true\n if (typeof icon !== 'object' || icon === null) return false\n return !Array.isArray(icon) && !(Symbol.iterator in icon) && !('then' in icon)\n}\n\n/** The leading glyph, sized by this component when it was handed a component. */\nfunction iconNode(icon: RemixiconComponentType | ReactNode): ReactNode {\n if (icon === undefined || icon === null || icon === false) return null\n if (!isIconComponent(icon)) {\n return (\n <span aria-hidden className=\"grid size-4 shrink-0 place-items-center [&_svg]:size-4\">\n {icon}\n </span>\n )\n }\n const Icon = icon\n return <Icon size={16} className=\"shrink-0\" aria-hidden />\n}\n\n/** Radix DropdownMenu root + trigger, re-exported as typed passthroughs. */\nexport const DropdownMenu = DropdownMenuPrimitive.Root\nexport const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\nexport type DropdownMenuContentProps = ComponentProps<typeof DropdownMenuPrimitive.Content>\n\n/**\n * A menu surface.\n *\n * A menu is a list of ACTIONS. If the items navigate somewhere, they belong in\n * a nav; if they set a value, that is a `Select` or a `RadioGroup` — this\n * package ships no checkbox or radio menu item, and a plain item pretending to\n * be a choice loses the checked state a screen reader needs.\n *\n * @example\n * <DropdownMenu>\n * <DropdownMenuTrigger asChild><Button variant=\"secondary\">Menu</Button></DropdownMenuTrigger>\n * <DropdownMenuContent>\n * <DropdownMenuGroup label=\"Account\">\n * <DropdownMenuItem icon={Settings}>Settings</DropdownMenuItem>\n * </DropdownMenuGroup>\n * <DropdownMenuSeparator />\n * <DropdownMenuItem icon={LogOut}>Sign out</DropdownMenuItem>\n * </DropdownMenuContent>\n * </DropdownMenu>\n */\nexport function DropdownMenuContent({\n className,\n sideOffset = 6,\n children,\n ...rest\n}: DropdownMenuContentProps) {\n const container = useOverlayContainer()\n\n return (\n <DropdownMenuPrimitive.Portal container={container ?? undefined}>\n <DropdownMenuPrimitive.Content\n collisionBoundary={container ?? undefined}\n collisionPadding={8}\n sideOffset={sideOffset}\n data-folio-animated\n data-folio-menu\n className={cn(\n 'z-(--z-dropdown) min-w-44 rounded-(--radius-lg) border border-(--panel-border) bg-(--panel-bg) p-1.5 shadow-(--panel-lift) panel-blur',\n 'data-[state=open]:animate-[folio-pop-in_var(--duration-fast)_var(--ease-out-expo)] data-[state=closed]:animate-[folio-pop-out_var(--duration-fast)_var(--ease)] origin-(--radix-popper-transform-origin)',\n className,\n )}\n {...rest}\n >\n {children}\n </DropdownMenuPrimitive.Content>\n </DropdownMenuPrimitive.Portal>\n )\n}\n\nexport interface DropdownMenuItemProps extends ComponentProps<typeof DropdownMenuPrimitive.Item> {\n /**\n * Optional leading icon, rendered before the label.\n *\n * Either spelling: `icon={Settings}` passes the component and this sizes it,\n * `icon={<Settings size={16} />}` passes the element and this places it. The\n * two used to mean opposite things one import apart — `CommandItem.icon` took\n * the element while this took the component — and the wrong one did not fail\n * a type check into anything actionable, it failed at render.\n */\n icon?: RemixiconComponentType | ReactNode\n /** Paints the row as destructive. Use for delete, revoke, disconnect. */\n destructive?: boolean\n}\n\n/**\n * A menu row.\n *\n * Highlight is driven by Radix's `data-highlighted`, which covers both pointer\n * hover and keyboard focus — styling `:hover` alone leaves the keyboard user\n * unable to see where they are.\n */\nexport function DropdownMenuItem({\n icon,\n destructive = false,\n className,\n children,\n ...rest\n}: DropdownMenuItemProps) {\n return (\n <DropdownMenuPrimitive.Item\n className={cn(\n 'flex cursor-pointer items-center gap-2.5 rounded-(--radius-row) px-2.5 py-2 text-sm outline-none transition-colors duration-(--duration-fast) data-[highlighted]:bg-(--stone) data-[disabled]:pointer-events-none data-[disabled]:opacity-(--disabled-opacity)',\n destructive ? 'text-(--danger)' : 'text-(--ink-2) data-[highlighted]:text-(--ink)',\n className,\n )}\n {...rest}\n >\n {iconNode(icon)}\n {children}\n </DropdownMenuPrimitive.Item>\n )\n}\n\n/** Hairline divider between menu groups. */\nexport function DropdownMenuSeparator({\n className,\n ...rest\n}: ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n className={cn('my-1 h-px bg-(--rule)', className)}\n {...rest}\n />\n )\n}\n\n/**\n * Mono eyebrow heading, on its own.\n *\n * Visual only: Radix renders it as a bare `<div>` with no role, so it segments\n * the menu for a reader who can see it and for nobody else. Reach for\n * `DropdownMenuGroup` when the eyebrow is a HEADING over rows; this is right\n * for a line that heads nothing — the signed-in address at the top of an\n * account menu.\n */\nexport function DropdownMenuLabel({\n className,\n ...rest\n}: ComponentProps<typeof DropdownMenuPrimitive.Label>) {\n return (\n <DropdownMenuPrimitive.Label\n className={cn('px-2.5 py-1.5 eyebrow text-(--ink-3-aa)', className)}\n {...rest}\n />\n )\n}\n\nexport interface DropdownMenuGroupProps\n extends ComponentProps<typeof DropdownMenuPrimitive.Group> {\n /** The eyebrow over the rows, and the group's accessible name. */\n label?: ReactNode\n}\n\n/**\n * A named section of a menu.\n *\n * The eyebrow alone was a picture of a heading. Radix's `MenuLabel` carries no\n * role and no `aria-labelledby` wiring, and `MenuGroup` — which does carry\n * `role=\"group\"` — was not re-exported by this package at all, so a sighted\n * reader saw three labelled sections and a screen-reader user got one\n * undifferentiated list. This renders the group, renders the label inside it,\n * and points the one at the other, which is the whole of the fix and not\n * something a caller should have to remember.\n *\n * @example\n * <DropdownMenuGroup label=\"Account\">\n * <DropdownMenuItem icon={Settings}>Settings</DropdownMenuItem>\n * </DropdownMenuGroup>\n */\nexport function DropdownMenuGroup({ label, children, ...rest }: DropdownMenuGroupProps) {\n const id = useId()\n\n return (\n <DropdownMenuPrimitive.Group\n aria-labelledby={label === undefined ? undefined : id}\n {...rest}\n >\n {label !== undefined && <DropdownMenuLabel id={id}>{label}</DropdownMenuLabel>}\n {children}\n </DropdownMenuPrimitive.Group>\n )\n}\n\nexport default DropdownMenu\n"],"mappings":";AA8BM,cA8FF,YA9FE;AA5BN,YAAY,2BAA2B;AAEvC,SAAS,gBAAgB,aAAkD;AAC3E,SAAS,UAAU;AACnB,SAAS,2BAA2B;AAYpC,SAAS,gBAAgB,MAA0E;AACjG,MAAI,eAAe,IAAI,EAAG,QAAO;AACjC,MAAI,OAAO,SAAS,WAAY,QAAO;AACvC,MAAI,OAAO,SAAS,YAAY,SAAS,KAAM,QAAO;AACtD,SAAO,CAAC,MAAM,QAAQ,IAAI,KAAK,EAAE,OAAO,YAAY,SAAS,EAAE,UAAU;AAC3E;AAGA,SAAS,SAAS,MAAqD;AACrE,MAAI,SAAS,UAAa,SAAS,QAAQ,SAAS,MAAO,QAAO;AAClE,MAAI,CAAC,gBAAgB,IAAI,GAAG;AAC1B,WACE,oBAAC,UAAK,eAAW,MAAC,WAAU,0DACzB,gBACH;AAAA,EAEJ;AACA,QAAM,OAAO;AACb,SAAO,oBAAC,QAAK,MAAM,IAAI,WAAU,YAAW,eAAW,MAAC;AAC1D;AAGO,MAAM,eAAe,sBAAsB;AAC3C,MAAM,sBAAsB,sBAAsB;AAwBlD,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA,GAAG;AACL,GAA6B;AAC3B,QAAM,YAAY,oBAAoB;AAEtC,SACE,oBAAC,sBAAsB,QAAtB,EAA6B,WAAW,aAAa,QACpD;AAAA,IAAC,sBAAsB;AAAA,IAAtB;AAAA,MACC,mBAAmB,aAAa;AAAA,MAChC,kBAAkB;AAAA,MAClB;AAAA,MACA,uBAAmB;AAAA,MACnB,mBAAe;AAAA,MACf,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH,GACF;AAEJ;AAwBO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA0B;AACxB,SACE;AAAA,IAAC,sBAAsB;AAAA,IAAtB;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,cAAc,oBAAoB;AAAA,QAClC;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,iBAAS,IAAI;AAAA,QACb;AAAA;AAAA;AAAA,EACH;AAEJ;AAGO,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA,GAAG;AACL,GAA2D;AACzD,SACE;AAAA,IAAC,sBAAsB;AAAA,IAAtB;AAAA,MACC,WAAW,GAAG,yBAAyB,SAAS;AAAA,MAC/C,GAAG;AAAA;AAAA,EACN;AAEJ;AAWO,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA,GAAG;AACL,GAAuD;AACrD,SACE;AAAA,IAAC,sBAAsB;AAAA,IAAtB;AAAA,MACC,WAAW,GAAG,2CAA2C,SAAS;AAAA,MACjE,GAAG;AAAA;AAAA,EACN;AAEJ;AAwBO,SAAS,kBAAkB,EAAE,OAAO,UAAU,GAAG,KAAK,GAA2B;AACtF,QAAM,KAAK,MAAM;AAEjB,SACE;AAAA,IAAC,sBAAsB;AAAA,IAAtB;AAAA,MACC,mBAAiB,UAAU,SAAY,SAAY;AAAA,MAClD,GAAG;AAAA,MAEH;AAAA,kBAAU,UAAa,oBAAC,qBAAkB,IAAS,iBAAM;AAAA,QACzD;AAAA;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,uBAAQ;","names":[]}
@@ -0,0 +1,55 @@
1
+ import * as react from 'react';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
+ import { RemixiconComponentType } from '@remixicon/react';
4
+ import { HeadingLevel } from '../Heading/Heading.js';
5
+
6
+ interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
7
+ /** Optional Remix Icon glyph, shown muted inside a quiet circle. */
8
+ icon?: RemixiconComponentType;
9
+ title: ReactNode;
10
+ description?: ReactNode;
11
+ /** The one thing to do next. An empty state without an action is a dead end. */
12
+ action?: ReactNode;
13
+ /**
14
+ * The heading level `title` opens, in the document the empty state lands in.
15
+ *
16
+ * Defaults to `2`, which is the placement this component is sized for: it
17
+ * stands in for a whole view inside a page that already has an `h1`, so the
18
+ * level below that one is the level that does not leave a hole in heading
19
+ * navigation. Under a section that already has its own `h2`, pass `3`.
20
+ *
21
+ * The default was `3` and fixed, which was wrong in the ordinary case and
22
+ * impossible to correct — the documentation could name the rule but a caller
23
+ * had no prop to follow it with. `2` is the common case rather than a
24
+ * compromise, and it is optional rather than required because the correct
25
+ * placement has one answer often enough that making every existing call site
26
+ * restate it would buy nothing.
27
+ *
28
+ * The size does not follow the level. `title` renders at `--fs-sub` at every
29
+ * level, because moving a state down the outline is a fact about the document
30
+ * and not a request for smaller type.
31
+ */
32
+ level?: HeadingLevel;
33
+ }
34
+ /**
35
+ * A collection with nothing in it — yet.
36
+ *
37
+ * Distinct from `ErrorState`: nothing went wrong here, so the copy says what to
38
+ * do rather than what failed. The two are different components because the
39
+ * shared temptation — one component with a `variant` — produces error pages
40
+ * that read like empty folders.
41
+ *
42
+ * @example
43
+ * <EmptyState
44
+ * icon={Inbox}
45
+ * title="No projects yet"
46
+ * description="Create your first project to get started."
47
+ * action={<Button>New project</Button>}
48
+ * />
49
+ * @example
50
+ * // Inside a section that already has its own heading.
51
+ * <EmptyState level={3} title="No invoices yet" />
52
+ */
53
+ declare function EmptyState({ icon: Icon, title, description, action, level, className, ...rest }: EmptyStateProps): react.JSX.Element;
54
+
55
+ export { EmptyState, type EmptyStateProps, EmptyState as default };
@@ -0,0 +1,32 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Heading } from "../Heading/Heading.js";
3
+ import { cn } from "../../lib/cn.js";
4
+ function EmptyState({
5
+ icon: Icon,
6
+ title,
7
+ description,
8
+ action,
9
+ level = 2,
10
+ className,
11
+ ...rest
12
+ }) {
13
+ return /* @__PURE__ */ jsxs(
14
+ "div",
15
+ {
16
+ className: cn("flex flex-col items-center px-(--page-pad) py-20 text-center", className),
17
+ ...rest,
18
+ children: [
19
+ Icon && /* @__PURE__ */ jsx("span", { className: "mb-6 flex size-14 items-center justify-center rounded-(--radius-pill) bg-(--stone) text-(--ink-3-aa)", children: /* @__PURE__ */ jsx(Icon, { size: 24, "aria-hidden": true }) }),
20
+ /* @__PURE__ */ jsx(Heading, { level, size: "sub", children: title }),
21
+ description && /* @__PURE__ */ jsx("p", { className: "m-0 mt-2 max-w-sm text-sm leading-relaxed text-(--ink-3-aa)", children: description }),
22
+ action && /* @__PURE__ */ jsx("div", { className: "mt-8", children: action })
23
+ ]
24
+ }
25
+ );
26
+ }
27
+ var EmptyState_default = EmptyState;
28
+ export {
29
+ EmptyState,
30
+ EmptyState_default as default
31
+ };
32
+ //# sourceMappingURL=EmptyState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/EmptyState/EmptyState.tsx"],"sourcesContent":["import type { RemixiconComponentType } from '@remixicon/react'\nimport type { HTMLAttributes, ReactNode } from 'react'\nimport { Heading, type HeadingLevel } from '../Heading/Heading'\nimport { cn } from '../../lib/cn'\n\nexport interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Optional Remix Icon glyph, shown muted inside a quiet circle. */\n icon?: RemixiconComponentType\n title: ReactNode\n description?: ReactNode\n /** The one thing to do next. An empty state without an action is a dead end. */\n action?: ReactNode\n /**\n * The heading level `title` opens, in the document the empty state lands in.\n *\n * Defaults to `2`, which is the placement this component is sized for: it\n * stands in for a whole view inside a page that already has an `h1`, so the\n * level below that one is the level that does not leave a hole in heading\n * navigation. Under a section that already has its own `h2`, pass `3`.\n *\n * The default was `3` and fixed, which was wrong in the ordinary case and\n * impossible to correct — the documentation could name the rule but a caller\n * had no prop to follow it with. `2` is the common case rather than a\n * compromise, and it is optional rather than required because the correct\n * placement has one answer often enough that making every existing call site\n * restate it would buy nothing.\n *\n * The size does not follow the level. `title` renders at `--fs-sub` at every\n * level, because moving a state down the outline is a fact about the document\n * and not a request for smaller type.\n */\n level?: HeadingLevel\n}\n\n/**\n * A collection with nothing in it — yet.\n *\n * Distinct from `ErrorState`: nothing went wrong here, so the copy says what to\n * do rather than what failed. The two are different components because the\n * shared temptation — one component with a `variant` — produces error pages\n * that read like empty folders.\n *\n * @example\n * <EmptyState\n * icon={Inbox}\n * title=\"No projects yet\"\n * description=\"Create your first project to get started.\"\n * action={<Button>New project</Button>}\n * />\n * @example\n * // Inside a section that already has its own heading.\n * <EmptyState level={3} title=\"No invoices yet\" />\n */\nexport function EmptyState({\n icon: Icon,\n title,\n description,\n action,\n level = 2,\n className,\n ...rest\n}: EmptyStateProps) {\n return (\n <div\n className={cn('flex flex-col items-center px-(--page-pad) py-20 text-center', className)}\n {...rest}\n >\n {Icon && (\n <span className=\"mb-6 flex size-14 items-center justify-center rounded-(--radius-pill) bg-(--stone) text-(--ink-3-aa)\">\n <Icon size={24} aria-hidden />\n </span>\n )}\n <Heading level={level} size=\"sub\">\n {title}\n </Heading>\n {description && (\n <p className=\"m-0 mt-2 max-w-sm text-sm leading-relaxed text-(--ink-3-aa)\">{description}</p>\n )}\n {action && <div className=\"mt-8\">{action}</div>}\n </div>\n )\n}\n\nexport default EmptyState\n"],"mappings":"AA+DI,SAMM,KANN;AA7DJ,SAAS,eAAkC;AAC3C,SAAS,UAAU;AAkDZ,SAAS,WAAW;AAAA,EACzB,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,GAAoB;AAClB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,gEAAgE,SAAS;AAAA,MACtF,GAAG;AAAA,MAEH;AAAA,gBACC,oBAAC,UAAK,WAAU,wGACd,8BAAC,QAAK,MAAM,IAAI,eAAW,MAAC,GAC9B;AAAA,QAEF,oBAAC,WAAQ,OAAc,MAAK,OACzB,iBACH;AAAA,QACC,eACC,oBAAC,OAAE,WAAU,+DAA+D,uBAAY;AAAA,QAEzF,UAAU,oBAAC,SAAI,WAAU,QAAQ,kBAAO;AAAA;AAAA;AAAA,EAC3C;AAEJ;AAEA,IAAO,qBAAQ;","names":[]}
@@ -0,0 +1,55 @@
1
+ import * as react from 'react';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
+ import { HeadingLevel } from '../Heading/Heading.js';
4
+
5
+ interface ErrorStateProps extends HTMLAttributes<HTMLElement> {
6
+ /** The status, set large — "404", "500". Decorative; the heading carries the meaning. */
7
+ code: ReactNode;
8
+ heading: ReactNode;
9
+ message: ReactNode;
10
+ /** The way back. Render it with {@link ERROR_ACTION_CLASS}. */
11
+ action: ReactNode;
12
+ /**
13
+ * The heading level `heading` opens, in the document the error state lands in.
14
+ *
15
+ * Defaults to `1`, and that is not a compromise: this component replaces the
16
+ * page rather than sitting inside one — its own ground, its own viewport, its
17
+ * own top clearance — so the page's single `h1` is the one it renders. Kept
18
+ * as the default, existing call sites render exactly the markup they did.
19
+ *
20
+ * The prop exists because the level was previously fixed, and the one piece
21
+ * of advice this component's documentation gives about headings — do not put
22
+ * it inside a shell that already has an `h1` — was advice a caller had no way
23
+ * to take. Now they do: inside a shell that owns the page heading, pass `2`.
24
+ *
25
+ * The size does not follow the level. `heading` renders at `--fs-heading` at
26
+ * every level; a failure demoted in the outline is the same failure.
27
+ */
28
+ level?: HeadingLevel;
29
+ }
30
+ /**
31
+ * The recovery affordance's look, exported so every error page offers the same
32
+ * one rather than each inventing a link style.
33
+ */
34
+ declare const ERROR_ACTION_CLASS = "text-sm text-(--ink) underline decoration-(--rule-2) underline-offset-4 transition-colors duration-(--duration-fast) hover:decoration-(--ink)";
35
+ /**
36
+ * A page that could not be shown.
37
+ *
38
+ * The code is set at the top of the type ladder and marked `aria-hidden` — read
39
+ * aloud, "404" before the sentence explaining it is noise, and the heading
40
+ * immediately after says the same thing in words.
41
+ *
42
+ * @example
43
+ * <ErrorState
44
+ * code="404"
45
+ * heading="Page not found"
46
+ * message="The page you're looking for has moved, or never existed."
47
+ * action={<a href="/" className={ERROR_ACTION_CLASS}>Back home</a>}
48
+ * />
49
+ * @example
50
+ * // Inside a shell that already owns the page's h1.
51
+ * <ErrorState level={2} code="503" heading="Invoices could not be loaded" … />
52
+ */
53
+ declare function ErrorState({ code, heading, message, action, level, className, ...rest }: ErrorStateProps): react.JSX.Element;
54
+
55
+ export { ERROR_ACTION_CLASS, ErrorState, type ErrorStateProps, ErrorState as default };
@@ -0,0 +1,41 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Heading } from "../Heading/Heading.js";
3
+ import { cn } from "../../lib/cn.js";
4
+ const ERROR_ACTION_CLASS = "text-sm text-(--ink) underline decoration-(--rule-2) underline-offset-4 transition-colors duration-(--duration-fast) hover:decoration-(--ink)";
5
+ function ErrorState({
6
+ code,
7
+ heading,
8
+ message,
9
+ action,
10
+ level = 1,
11
+ className,
12
+ ...rest
13
+ }) {
14
+ return /* @__PURE__ */ jsx(
15
+ "section",
16
+ {
17
+ className: cn("flex min-h-svh flex-col justify-center bg-(--paper) pt-24", className),
18
+ ...rest,
19
+ children: /* @__PURE__ */ jsxs("div", { className: "mx-auto w-full max-w-(--w-page) px-(--page-pad)", children: [
20
+ /* @__PURE__ */ jsx(
21
+ "p",
22
+ {
23
+ "aria-hidden": "true",
24
+ className: "m-0 font-heading text-[length:var(--fs-title)] leading-tight text-(--ink)",
25
+ children: code
26
+ }
27
+ ),
28
+ /* @__PURE__ */ jsx(Heading, { level, size: "heading", className: "mb-4 mt-6", children: heading }),
29
+ /* @__PURE__ */ jsx("p", { className: "mb-10 max-w-(--measure-record) text-base leading-relaxed text-(--ink-3-aa)", children: message }),
30
+ action
31
+ ] })
32
+ }
33
+ );
34
+ }
35
+ var ErrorState_default = ErrorState;
36
+ export {
37
+ ERROR_ACTION_CLASS,
38
+ ErrorState,
39
+ ErrorState_default as default
40
+ };
41
+ //# sourceMappingURL=ErrorState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ErrorState/ErrorState.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react'\nimport { Heading, type HeadingLevel } from '../Heading/Heading'\nimport { cn } from '../../lib/cn'\n\nexport interface ErrorStateProps extends HTMLAttributes<HTMLElement> {\n /** The status, set large — \"404\", \"500\". Decorative; the heading carries the meaning. */\n code: ReactNode\n heading: ReactNode\n message: ReactNode\n /** The way back. Render it with {@link ERROR_ACTION_CLASS}. */\n action: ReactNode\n /**\n * The heading level `heading` opens, in the document the error state lands in.\n *\n * Defaults to `1`, and that is not a compromise: this component replaces the\n * page rather than sitting inside one — its own ground, its own viewport, its\n * own top clearance — so the page's single `h1` is the one it renders. Kept\n * as the default, existing call sites render exactly the markup they did.\n *\n * The prop exists because the level was previously fixed, and the one piece\n * of advice this component's documentation gives about headings — do not put\n * it inside a shell that already has an `h1` — was advice a caller had no way\n * to take. Now they do: inside a shell that owns the page heading, pass `2`.\n *\n * The size does not follow the level. `heading` renders at `--fs-heading` at\n * every level; a failure demoted in the outline is the same failure.\n */\n level?: HeadingLevel\n}\n\n/**\n * The recovery affordance's look, exported so every error page offers the same\n * one rather than each inventing a link style.\n */\nexport const ERROR_ACTION_CLASS =\n 'text-sm text-(--ink) underline decoration-(--rule-2) underline-offset-4 transition-colors duration-(--duration-fast) hover:decoration-(--ink)'\n\n/**\n * A page that could not be shown.\n *\n * The code is set at the top of the type ladder and marked `aria-hidden` — read\n * aloud, \"404\" before the sentence explaining it is noise, and the heading\n * immediately after says the same thing in words.\n *\n * @example\n * <ErrorState\n * code=\"404\"\n * heading=\"Page not found\"\n * message=\"The page you're looking for has moved, or never existed.\"\n * action={<a href=\"/\" className={ERROR_ACTION_CLASS}>Back home</a>}\n * />\n * @example\n * // Inside a shell that already owns the page's h1.\n * <ErrorState level={2} code=\"503\" heading=\"Invoices could not be loaded\" … />\n */\nexport function ErrorState({\n code,\n heading,\n message,\n action,\n level = 1,\n className,\n ...rest\n}: ErrorStateProps) {\n return (\n <section\n className={cn('flex min-h-svh flex-col justify-center bg-(--paper) pt-24', className)}\n {...rest}\n >\n <div className=\"mx-auto w-full max-w-(--w-page) px-(--page-pad)\">\n {/* `leading-tight`, not `leading-none`. At the title step this face\n draws about 62px of ink, and a line box of exactly the font size is\n 47 — so the figures overflowed their own box by seven pixels at the\n top and seven at the bottom, pressing up against the eyebrow above\n and eating half the gap to the heading below. The box that says\n nothing is spaced from is the box the ink is actually in. */}\n <p\n aria-hidden=\"true\"\n className=\"m-0 font-heading text-[length:var(--fs-title)] leading-tight text-(--ink)\"\n >\n {code}\n </p>\n <Heading level={level} size=\"heading\" className=\"mb-4 mt-6\">\n {heading}\n </Heading>\n <p className=\"mb-10 max-w-(--measure-record) text-base leading-relaxed text-(--ink-3-aa)\">\n {message}\n </p>\n {action}\n </div>\n </section>\n )\n}\n\nexport default ErrorState\n"],"mappings":"AAqEM,SAOE,KAPF;AApEN,SAAS,eAAkC;AAC3C,SAAS,UAAU;AAgCZ,MAAM,qBACX;AAoBK,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,GAAoB;AAClB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,6DAA6D,SAAS;AAAA,MACnF,GAAG;AAAA,MAEJ,+BAAC,SAAI,WAAU,mDAOb;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,eAAY;AAAA,YACZ,WAAU;AAAA,YAET;AAAA;AAAA,QACH;AAAA,QACA,oBAAC,WAAQ,OAAc,MAAK,WAAU,WAAU,aAC7C,mBACH;AAAA,QACA,oBAAC,OAAE,WAAU,8EACV,mBACH;AAAA,QACC;AAAA,SACH;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,qBAAQ;","names":[]}
@@ -0,0 +1,111 @@
1
+ import * as react from 'react';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
+
4
+ /**
5
+ * Where the control sits relative to its label.
6
+ *
7
+ * `stacked` is the form row: label, control, message, down the page.
8
+ *
9
+ * `row` is the settings row: the label and its `description` in a column at the
10
+ * inline start, the control at the inline end, one rhythm down a settings
11
+ * screen. It is a layout, not a second component — the label wiring, the
12
+ * required marker and the message slot are the same three things either way,
13
+ * and a `SettingRow` beside this would be all three of them written twice.
14
+ */
15
+ type FieldLayout = 'stacked' | 'row';
16
+ interface FieldProps extends HTMLAttributes<HTMLDivElement> {
17
+ /** Visible label text; renders a `--danger` asterisk when `required`. */
18
+ label?: ReactNode;
19
+ /**
20
+ * The control's `id`. Optional: when omitted, the field generates one and
21
+ * puts it on the control child itself, so the label still points at
22
+ * something. Pass it explicitly when the id has to be stable across renders
23
+ * — a form library referencing it by name, say.
24
+ */
25
+ htmlFor?: string;
26
+ /**
27
+ * A second line under the LABEL, explaining what the setting does.
28
+ *
29
+ * Distinct from `hint`, which sits under the control and belongs to the input
30
+ * — "We never share it". This belongs to the thing being switched on, and it
31
+ * is what makes a settings row a settings row. Both reach the control through
32
+ * `aria-describedby`, so a row that has a description and an error announces
33
+ * both.
34
+ */
35
+ description?: ReactNode;
36
+ /** Helper copy shown below the control when there is no `error`. */
37
+ hint?: ReactNode;
38
+ /** Validation message; takes precedence over `hint` when present. */
39
+ error?: ReactNode;
40
+ required?: boolean;
41
+ /** Where the control sits relative to its label. See {@link FieldLayout}. */
42
+ layout?: FieldLayout;
43
+ children: ReactNode;
44
+ }
45
+ /**
46
+ * A labelled form row: label, control, and the one message below it.
47
+ *
48
+ * The visible message is only half of accessible validation — it must also
49
+ * reach the control. This wires `aria-describedby`, `aria-required` and
50
+ * `aria-invalid` onto the single control child so the requirement and the error
51
+ * are announced, not merely drawn (WCAG 1.3.1 / 3.3.1 / 4.1.2).
52
+ *
53
+ * An earlier version derived the message id from `htmlFor`, which meant a
54
+ * caller who left `htmlFor` off got a hint that was rendered and never
55
+ * announced — the failure was invisible in the browser and total for a screen
56
+ * reader. The id is now generated when it is not supplied.
57
+ *
58
+ * `hint` and `error` are one slot, not two stacked messages: when a field is
59
+ * wrong, the thing to read is what is wrong with it. `description` is a
60
+ * different slot again — it explains the SETTING, not the input, and it is what
61
+ * `layout="row"` puts under the label to make a settings row.
62
+ *
63
+ * **How the wiring reaches the control.** `cloneElement` puts the four
64
+ * attributes on the single child, and each control forwards them to whatever
65
+ * element carries the role — which is the child itself for `Input`, `Textarea`,
66
+ * `NativeSelect`, `Checkbox`, `Switch` and any host element written by hand, and
67
+ * a trigger, a group or a thumb further down for `Select`, `Combobox`,
68
+ * `DatePicker`, `Slider`, `RadioGroup` and `ToggleGroup`. The composites used to
69
+ * drop them on the floor, which drew a hint under a control that never announced
70
+ * it; a wrapper that appears to wire things up and does not is worse than one
71
+ * that never claimed to.
72
+ *
73
+ * The label's own id travels separately, through context, because a name is the
74
+ * one thing a prop cannot carry: a trigger whose text is its VALUE is named by
75
+ * the label AND by itself, so `<Field label="Region"><Select/></Field>`
76
+ * announces "Region, Australia" rather than either half.
77
+ *
78
+ * Three things stay out of reach, and each of them is the control's own markup
79
+ * rather than a gap in this wiring. A `<label for>` binds only to a labellable
80
+ * element, so the words do not click through to a `RadioGroup`, a `ToggleGroup`
81
+ * or a `Slider`: the first two are a `role="radiogroup"` named by pointing back
82
+ * at the label instead, exactly as a `<legend>` is, and the third carries
83
+ * `role="slider"` on a thumb below a roleless root. `required` reaches a control
84
+ * as `aria-required`, which `DatePicker`'s plain `<button>` trigger and a
85
+ * multiple-value `ToggleGroup`'s `role="toolbar"` have nowhere to put; there the
86
+ * asterisk is the only marker. And `aria-invalid` reaches `Slider`'s root rather
87
+ * than its thumb, so an errored slider is drawn wrong without being announced
88
+ * wrong.
89
+ *
90
+ * Each composite still takes its own `label` prop — that is what names it
91
+ * standing outside a field, and `Select`, `Combobox` and `DatePicker` warn when
92
+ * it is blank. It is no longer used INSTEAD of this one's.
93
+ *
94
+ * What no wiring can reach, the field says out loud in development rather than
95
+ * failing silently: `FIELD_CONTROL_NOT_LABELLABLE` when the child is a host
96
+ * element a label cannot bind to — the `<div>` wrapper that takes the id and
97
+ * leaves the control inside it with nothing — and `FIELD_CONTROL_NOT_WIRED`
98
+ * when there is no single element to wire at all.
99
+ *
100
+ * @example
101
+ * <Field label="Email" required hint="We never share it."><Input type="email" /></Field>
102
+ * @example
103
+ * <Field label="Name" error="Name is required."><Input /></Field>
104
+ * @example
105
+ * <Field layout="row" label="Email notifications" description="A digest every Monday.">
106
+ * <Switch defaultChecked />
107
+ * </Field>
108
+ */
109
+ declare function Field({ label, htmlFor, description, hint, error, required, layout, children, className, ...rest }: FieldProps): react.JSX.Element;
110
+
111
+ export { Field, type FieldLayout, type FieldProps, Field as default };
@@ -0,0 +1,95 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Label } from "@radix-ui/react-label";
4
+ import { cloneElement, isValidElement, useId } from "react";
5
+ import { cn } from "../../lib/cn.js";
6
+ import { DEV, warn } from "../../lib/warn.js";
7
+ import { FieldControlProvider } from "./field-control.js";
8
+ function Field({
9
+ label,
10
+ htmlFor,
11
+ description,
12
+ hint,
13
+ error,
14
+ required,
15
+ layout = "stacked",
16
+ children,
17
+ className,
18
+ ...rest
19
+ }) {
20
+ const generatedId = useId();
21
+ const controlId = htmlFor ?? generatedId;
22
+ const message = error ?? hint;
23
+ const messageId = message != null ? `${controlId}-${error != null ? "error" : "hint"}` : void 0;
24
+ const descriptionId = description != null ? `${controlId}-description` : void 0;
25
+ const labelId = label != null ? `${controlId}-label` : void 0;
26
+ let control = children;
27
+ if (isValidElement(children)) {
28
+ const child = children;
29
+ control = cloneElement(child, {
30
+ id: child.props.id ?? controlId,
31
+ "aria-describedby": [child.props["aria-describedby"], descriptionId, messageId].filter(Boolean).join(" ") || void 0,
32
+ "aria-required": required || child.props["aria-required"] || void 0,
33
+ "aria-invalid": error != null ? child.props["aria-invalid"] ?? true : child.props["aria-invalid"]
34
+ });
35
+ } else if (DEV) {
36
+ warn({
37
+ code: "FIELD_CONTROL_NOT_WIRED",
38
+ problem: "Field's child is not a single React element, so the label, aria-describedby, aria-required and aria-invalid were not applied to any control.",
39
+ field: "children",
40
+ fix: "Put exactly one control element directly inside Field. For a row of controls, give each its own Field and lay them out around it.",
41
+ component: "Field"
42
+ });
43
+ }
44
+ if (DEV && isValidElement(children) && typeof children.type === "string") {
45
+ const LABELLABLE = ["input", "select", "textarea", "button", "meter", "output", "progress"];
46
+ if (!LABELLABLE.includes(children.type)) {
47
+ warn({
48
+ code: "FIELD_CONTROL_NOT_LABELLABLE",
49
+ problem: `Field's child is a <${children.type}>, which cannot take a label \u2014 so the id, aria-describedby, aria-required and aria-invalid were applied to it rather than to a control.`,
50
+ field: "children",
51
+ fix: "Put the control itself directly inside Field, with no wrapper. For a row of controls, give each its own Field and lay them out around it.",
52
+ component: "Field"
53
+ });
54
+ }
55
+ }
56
+ const wired = /* @__PURE__ */ jsx(FieldControlProvider, { value: { labelId }, children: control });
57
+ const heading = (label != null || description != null) && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
58
+ label != null && /* @__PURE__ */ jsxs(Label, { id: labelId, htmlFor: controlId, className: "text-sm text-(--ink)", children: [
59
+ label,
60
+ required && /* @__PURE__ */ jsxs("span", { className: "text-(--danger)", "aria-hidden": "true", children: [
61
+ " ",
62
+ "*"
63
+ ] })
64
+ ] }),
65
+ description != null && /* @__PURE__ */ jsx("p", { id: descriptionId, className: "m-0 text-xs text-(--ink-3-aa)", children: description })
66
+ ] });
67
+ const note = message != null && /* @__PURE__ */ jsx(
68
+ "p",
69
+ {
70
+ id: messageId,
71
+ className: cn("m-0 text-xs", error != null ? "text-(--danger)" : "text-(--ink-3-aa)"),
72
+ children: message
73
+ }
74
+ );
75
+ if (layout === "row") {
76
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1.5", className), ...rest, children: [
77
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-6", children: [
78
+ /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: heading }),
79
+ /* @__PURE__ */ jsx("div", { className: "shrink-0", children: wired })
80
+ ] }),
81
+ note
82
+ ] });
83
+ }
84
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1.5", className), ...rest, children: [
85
+ heading,
86
+ wired,
87
+ note
88
+ ] });
89
+ }
90
+ var Field_default = Field;
91
+ export {
92
+ Field,
93
+ Field_default as default
94
+ };
95
+ //# sourceMappingURL=Field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Field/Field.tsx"],"sourcesContent":["'use client'\n\nimport { Label } from '@radix-ui/react-label'\nimport { cloneElement, isValidElement, useId } from 'react'\nimport type { HTMLAttributes, ReactElement, ReactNode } from 'react'\nimport { cn } from '../../lib/cn'\nimport { DEV, warn } from '../../lib/warn'\nimport { FieldControlProvider } from './field-control'\n\n/**\n * Where the control sits relative to its label.\n *\n * `stacked` is the form row: label, control, message, down the page.\n *\n * `row` is the settings row: the label and its `description` in a column at the\n * inline start, the control at the inline end, one rhythm down a settings\n * screen. It is a layout, not a second component — the label wiring, the\n * required marker and the message slot are the same three things either way,\n * and a `SettingRow` beside this would be all three of them written twice.\n */\nexport type FieldLayout = 'stacked' | 'row'\n\nexport interface FieldProps extends HTMLAttributes<HTMLDivElement> {\n /** Visible label text; renders a `--danger` asterisk when `required`. */\n label?: ReactNode\n /**\n * The control's `id`. Optional: when omitted, the field generates one and\n * puts it on the control child itself, so the label still points at\n * something. Pass it explicitly when the id has to be stable across renders\n * — a form library referencing it by name, say.\n */\n htmlFor?: string\n /**\n * A second line under the LABEL, explaining what the setting does.\n *\n * Distinct from `hint`, which sits under the control and belongs to the input\n * — \"We never share it\". This belongs to the thing being switched on, and it\n * is what makes a settings row a settings row. Both reach the control through\n * `aria-describedby`, so a row that has a description and an error announces\n * both.\n */\n description?: ReactNode\n /** Helper copy shown below the control when there is no `error`. */\n hint?: ReactNode\n /** Validation message; takes precedence over `hint` when present. */\n error?: ReactNode\n required?: boolean\n /** Where the control sits relative to its label. See {@link FieldLayout}. */\n layout?: FieldLayout\n children: ReactNode\n}\n\ntype WirableControl = ReactElement<{\n id?: string\n 'aria-describedby'?: string\n 'aria-required'?: boolean\n 'aria-invalid'?: boolean | 'true' | 'false'\n}>\n\n/**\n * A labelled form row: label, control, and the one message below it.\n *\n * The visible message is only half of accessible validation — it must also\n * reach the control. This wires `aria-describedby`, `aria-required` and\n * `aria-invalid` onto the single control child so the requirement and the error\n * are announced, not merely drawn (WCAG 1.3.1 / 3.3.1 / 4.1.2).\n *\n * An earlier version derived the message id from `htmlFor`, which meant a\n * caller who left `htmlFor` off got a hint that was rendered and never\n * announced — the failure was invisible in the browser and total for a screen\n * reader. The id is now generated when it is not supplied.\n *\n * `hint` and `error` are one slot, not two stacked messages: when a field is\n * wrong, the thing to read is what is wrong with it. `description` is a\n * different slot again — it explains the SETTING, not the input, and it is what\n * `layout=\"row\"` puts under the label to make a settings row.\n *\n * **How the wiring reaches the control.** `cloneElement` puts the four\n * attributes on the single child, and each control forwards them to whatever\n * element carries the role — which is the child itself for `Input`, `Textarea`,\n * `NativeSelect`, `Checkbox`, `Switch` and any host element written by hand, and\n * a trigger, a group or a thumb further down for `Select`, `Combobox`,\n * `DatePicker`, `Slider`, `RadioGroup` and `ToggleGroup`. The composites used to\n * drop them on the floor, which drew a hint under a control that never announced\n * it; a wrapper that appears to wire things up and does not is worse than one\n * that never claimed to.\n *\n * The label's own id travels separately, through context, because a name is the\n * one thing a prop cannot carry: a trigger whose text is its VALUE is named by\n * the label AND by itself, so `<Field label=\"Region\"><Select/></Field>`\n * announces \"Region, Australia\" rather than either half.\n *\n * Three things stay out of reach, and each of them is the control's own markup\n * rather than a gap in this wiring. A `<label for>` binds only to a labellable\n * element, so the words do not click through to a `RadioGroup`, a `ToggleGroup`\n * or a `Slider`: the first two are a `role=\"radiogroup\"` named by pointing back\n * at the label instead, exactly as a `<legend>` is, and the third carries\n * `role=\"slider\"` on a thumb below a roleless root. `required` reaches a control\n * as `aria-required`, which `DatePicker`'s plain `<button>` trigger and a\n * multiple-value `ToggleGroup`'s `role=\"toolbar\"` have nowhere to put; there the\n * asterisk is the only marker. And `aria-invalid` reaches `Slider`'s root rather\n * than its thumb, so an errored slider is drawn wrong without being announced\n * wrong.\n *\n * Each composite still takes its own `label` prop — that is what names it\n * standing outside a field, and `Select`, `Combobox` and `DatePicker` warn when\n * it is blank. It is no longer used INSTEAD of this one's.\n *\n * What no wiring can reach, the field says out loud in development rather than\n * failing silently: `FIELD_CONTROL_NOT_LABELLABLE` when the child is a host\n * element a label cannot bind to — the `<div>` wrapper that takes the id and\n * leaves the control inside it with nothing — and `FIELD_CONTROL_NOT_WIRED`\n * when there is no single element to wire at all.\n *\n * @example\n * <Field label=\"Email\" required hint=\"We never share it.\"><Input type=\"email\" /></Field>\n * @example\n * <Field label=\"Name\" error=\"Name is required.\"><Input /></Field>\n * @example\n * <Field layout=\"row\" label=\"Email notifications\" description=\"A digest every Monday.\">\n * <Switch defaultChecked />\n * </Field>\n */\nexport function Field({\n label,\n htmlFor,\n description,\n hint,\n error,\n required,\n layout = 'stacked',\n children,\n className,\n ...rest\n}: FieldProps) {\n const generatedId = useId()\n const controlId = htmlFor ?? generatedId\n const message = error ?? hint\n const messageId = message != null ? `${controlId}-${error != null ? 'error' : 'hint'}` : undefined\n const descriptionId = description != null ? `${controlId}-description` : undefined\n const labelId = label != null ? `${controlId}-label` : undefined\n\n let control = children\n if (isValidElement(children)) {\n const child = children as WirableControl\n control = cloneElement(child, {\n id: child.props.id ?? controlId,\n 'aria-describedby':\n [child.props['aria-describedby'], descriptionId, messageId].filter(Boolean).join(' ') ||\n undefined,\n 'aria-required': required || child.props['aria-required'] || undefined,\n 'aria-invalid':\n error != null ? (child.props['aria-invalid'] ?? true) : child.props['aria-invalid'],\n })\n } else if (DEV) {\n warn({\n code: 'FIELD_CONTROL_NOT_WIRED',\n problem:\n \"Field's child is not a single React element, so the label, aria-describedby, aria-required and aria-invalid were not applied to any control.\",\n field: 'children',\n fix: 'Put exactly one control element directly inside Field. For a row of controls, give each its own Field and lay them out around it.',\n component: 'Field',\n })\n }\n\n if (DEV && isValidElement(children) && typeof children.type === 'string') {\n // A wrapper is the failure this exists for, and it is the one that looks\n // most correct: `<Field><div><Input /></div></Field>` renders, and the\n // label points at the DIV. The id, the describedby and the invalid state\n // all land on a box, the control inside gets none of them, and a browser\n // shows nothing wrong.\n //\n // Narrowed to HOST elements because that is the half that can be decided:\n // a lowercase tag either takes a label or it does not. A function component\n // might forward its props to a real control, and warning on those would\n // fire on every correct use of Input, Select and the rest.\n const LABELLABLE = ['input', 'select', 'textarea', 'button', 'meter', 'output', 'progress']\n if (!LABELLABLE.includes(children.type)) {\n warn({\n code: 'FIELD_CONTROL_NOT_LABELLABLE',\n problem: `Field's child is a <${children.type}>, which cannot take a label — so the id, aria-describedby, aria-required and aria-invalid were applied to it rather than to a control.`,\n field: 'children',\n fix: 'Put the control itself directly inside Field, with no wrapper. For a row of controls, give each its own Field and lay them out around it.',\n component: 'Field',\n })\n }\n }\n\n // The label's id, for the controls that have to name themselves from it —\n // everything else the field decided is already on the cloned child.\n const wired = <FieldControlProvider value={{ labelId }}>{control}</FieldControlProvider>\n\n const heading = (label != null || description != null) && (\n <div className=\"flex flex-col gap-1\">\n {label != null && (\n <Label id={labelId} htmlFor={controlId} className=\"text-sm text-(--ink)\">\n {label}\n {required && (\n <span className=\"text-(--danger)\" aria-hidden=\"true\">\n {' '}\n *\n </span>\n )}\n </Label>\n )}\n {description != null && (\n <p id={descriptionId} className=\"m-0 text-xs text-(--ink-3-aa)\">\n {description}\n </p>\n )}\n </div>\n )\n\n const note = message != null && (\n <p\n id={messageId}\n className={cn('m-0 text-xs', error != null ? 'text-(--danger)' : 'text-(--ink-3-aa)')}\n >\n {message}\n </p>\n )\n\n if (layout === 'row') {\n return (\n <div className={cn('flex flex-col gap-1.5', className)} {...rest}>\n {/* `items-start` and not `items-center`: a description of two lines\n would otherwise drag the switch down to the middle of the paragraph,\n and a column of settings rows would have its controls on five\n different lines. */}\n <div className=\"flex items-start justify-between gap-6\">\n <div className=\"min-w-0 flex-1\">{heading}</div>\n <div className=\"shrink-0\">{wired}</div>\n </div>\n {note}\n </div>\n )\n }\n\n return (\n <div className={cn('flex flex-col gap-1.5', className)} {...rest}>\n {heading}\n {wired}\n {note}\n </div>\n )\n}\n\nexport default Field\n"],"mappings":";AA8LgB,cAQJ,YARI;AA5LhB,SAAS,aAAa;AACtB,SAAS,cAAc,gBAAgB,aAAa;AAEpD,SAAS,UAAU;AACnB,SAAS,KAAK,YAAY;AAC1B,SAAS,4BAA4B;AAoH9B,SAAS,MAAM;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAe;AACb,QAAM,cAAc,MAAM;AAC1B,QAAM,YAAY,WAAW;AAC7B,QAAM,UAAU,SAAS;AACzB,QAAM,YAAY,WAAW,OAAO,GAAG,SAAS,IAAI,SAAS,OAAO,UAAU,MAAM,KAAK;AACzF,QAAM,gBAAgB,eAAe,OAAO,GAAG,SAAS,iBAAiB;AACzE,QAAM,UAAU,SAAS,OAAO,GAAG,SAAS,WAAW;AAEvD,MAAI,UAAU;AACd,MAAI,eAAe,QAAQ,GAAG;AAC5B,UAAM,QAAQ;AACd,cAAU,aAAa,OAAO;AAAA,MAC5B,IAAI,MAAM,MAAM,MAAM;AAAA,MACtB,oBACE,CAAC,MAAM,MAAM,kBAAkB,GAAG,eAAe,SAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,KACpF;AAAA,MACF,iBAAiB,YAAY,MAAM,MAAM,eAAe,KAAK;AAAA,MAC7D,gBACE,SAAS,OAAQ,MAAM,MAAM,cAAc,KAAK,OAAQ,MAAM,MAAM,cAAc;AAAA,IACtF,CAAC;AAAA,EACH,WAAW,KAAK;AACd,SAAK;AAAA,MACH,MAAM;AAAA,MACN,SACE;AAAA,MACF,OAAO;AAAA,MACP,KAAK;AAAA,MACL,WAAW;AAAA,IACb,CAAC;AAAA,EACH;AAEA,MAAI,OAAO,eAAe,QAAQ,KAAK,OAAO,SAAS,SAAS,UAAU;AAWxE,UAAM,aAAa,CAAC,SAAS,UAAU,YAAY,UAAU,SAAS,UAAU,UAAU;AAC1F,QAAI,CAAC,WAAW,SAAS,SAAS,IAAI,GAAG;AACvC,WAAK;AAAA,QACH,MAAM;AAAA,QACN,SAAS,uBAAuB,SAAS,IAAI;AAAA,QAC7C,OAAO;AAAA,QACP,KAAK;AAAA,QACL,WAAW;AAAA,MACb,CAAC;AAAA,IACH;AAAA,EACF;AAIA,QAAM,QAAQ,oBAAC,wBAAqB,OAAO,EAAE,QAAQ,GAAI,mBAAQ;AAEjE,QAAM,WAAW,SAAS,QAAQ,eAAe,SAC/C,qBAAC,SAAI,WAAU,uBACZ;AAAA,aAAS,QACR,qBAAC,SAAM,IAAI,SAAS,SAAS,WAAW,WAAU,wBAC/C;AAAA;AAAA,MACA,YACC,qBAAC,UAAK,WAAU,mBAAkB,eAAY,QAC3C;AAAA;AAAA,QAAI;AAAA,SAEP;AAAA,OAEJ;AAAA,IAED,eAAe,QACd,oBAAC,OAAE,IAAI,eAAe,WAAU,iCAC7B,uBACH;AAAA,KAEJ;AAGF,QAAM,OAAO,WAAW,QACtB;AAAA,IAAC;AAAA;AAAA,MACC,IAAI;AAAA,MACJ,WAAW,GAAG,eAAe,SAAS,OAAO,oBAAoB,mBAAmB;AAAA,MAEnF;AAAA;AAAA,EACH;AAGF,MAAI,WAAW,OAAO;AACpB,WACE,qBAAC,SAAI,WAAW,GAAG,yBAAyB,SAAS,GAAI,GAAG,MAK1D;AAAA,2BAAC,SAAI,WAAU,0CACb;AAAA,4BAAC,SAAI,WAAU,kBAAkB,mBAAQ;AAAA,QACzC,oBAAC,SAAI,WAAU,YAAY,iBAAM;AAAA,SACnC;AAAA,MACC;AAAA,OACH;AAAA,EAEJ;AAEA,SACE,qBAAC,SAAI,WAAW,GAAG,yBAAyB,SAAS,GAAI,GAAG,MACzD;AAAA;AAAA,IACA;AAAA,IACA;AAAA,KACH;AAEJ;AAEA,IAAO,gBAAQ;","names":[]}
@@ -0,0 +1,31 @@
1
+ import * as react from 'react';
2
+
3
+ /**
4
+ * The one thing a `Field` cannot hand its control as a prop: where its label is.
5
+ *
6
+ * Everything else the field decides — the id, `aria-describedby`,
7
+ * `aria-required`, `aria-invalid` — travels as props on the cloned child, and a
8
+ * control that swallowed them was simply not forwarding them to the element
9
+ * that carries the role. That is a bug in the control, not a missing channel.
10
+ *
11
+ * A NAME is different. A trigger whose text is its value has to be named by the
12
+ * label AND by itself, which is two ids in one `aria-labelledby`; a group has to
13
+ * point BACK at the label, because `<label for>` does not bind to a
14
+ * `role="radiogroup"`. Neither can be expressed by a value the field computes on
15
+ * its own, so the label's id is published here and the control assembles the
16
+ * rest.
17
+ */
18
+ interface FieldControl {
19
+ /** The label element's id, or undefined when the field has no label. */
20
+ labelId?: string;
21
+ }
22
+ declare const FieldControlProvider: react.Provider<FieldControl | null>;
23
+ /**
24
+ * The enclosing `Field`'s label, if there is one.
25
+ *
26
+ * Null is a supported state, not a failure: every control here works outside a
27
+ * field, and each names itself from its own `label` prop when it must.
28
+ */
29
+ declare function useFieldControl(): FieldControl | null;
30
+
31
+ export { type FieldControl, FieldControlProvider, useFieldControl };
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ import { createContext, useContext } from "react";
3
+ const FieldControlContext = createContext(null);
4
+ const FieldControlProvider = FieldControlContext.Provider;
5
+ function useFieldControl() {
6
+ return useContext(FieldControlContext);
7
+ }
8
+ export {
9
+ FieldControlProvider,
10
+ useFieldControl
11
+ };
12
+ //# sourceMappingURL=field-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Field/field-control.ts"],"sourcesContent":["'use client'\n\nimport { createContext, useContext } from 'react'\n\n/**\n * The one thing a `Field` cannot hand its control as a prop: where its label is.\n *\n * Everything else the field decides — the id, `aria-describedby`,\n * `aria-required`, `aria-invalid` — travels as props on the cloned child, and a\n * control that swallowed them was simply not forwarding them to the element\n * that carries the role. That is a bug in the control, not a missing channel.\n *\n * A NAME is different. A trigger whose text is its value has to be named by the\n * label AND by itself, which is two ids in one `aria-labelledby`; a group has to\n * point BACK at the label, because `<label for>` does not bind to a\n * `role=\"radiogroup\"`. Neither can be expressed by a value the field computes on\n * its own, so the label's id is published here and the control assembles the\n * rest.\n */\nexport interface FieldControl {\n /** The label element's id, or undefined when the field has no label. */\n labelId?: string\n}\n\nconst FieldControlContext = createContext<FieldControl | null>(null)\n\nexport const FieldControlProvider = FieldControlContext.Provider\n\n/**\n * The enclosing `Field`'s label, if there is one.\n *\n * Null is a supported state, not a failure: every control here works outside a\n * field, and each names itself from its own `label` prop when it must.\n */\nexport function useFieldControl(): FieldControl | null {\n return useContext(FieldControlContext)\n}\n"],"mappings":";AAEA,SAAS,eAAe,kBAAkB;AAsB1C,MAAM,sBAAsB,cAAmC,IAAI;AAE5D,MAAM,uBAAuB,oBAAoB;AAQjD,SAAS,kBAAuC;AACrD,SAAO,WAAW,mBAAmB;AACvC;","names":[]}
@@ -0,0 +1,31 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, HTMLAttributes } from 'react';
3
+
4
+ interface Figure {
5
+ /** Stable key; also what a caller keys its own data by. */
6
+ id: string;
7
+ /** The label over the value. */
8
+ label: string;
9
+ /** The value itself, set in the serif at the band's scale. */
10
+ value: ReactNode;
11
+ /** The quiet line under it — a trend, a qualifier, a second fact. */
12
+ note?: ReactNode;
13
+ }
14
+ interface FigureBandProps extends Omit<HTMLAttributes<HTMLDListElement>, 'children'> {
15
+ figures: Figure[];
16
+ /**
17
+ * How large the value is set.
18
+ *
19
+ * `lead` is for a band that is the point of its page — a stats headline,
20
+ * where the numbers ARE the content. `sub` is for a band that supports the
21
+ * page around it, and keeps the ladder honest: a supporting figure must not
22
+ * be set at the same size as the page's own subject.
23
+ */
24
+ scale?: 'lead' | 'sub';
25
+ /** Names the band for assistive tech when it has no visible heading of its own. */
26
+ label?: string;
27
+ }
28
+ /** A framed, responsive group of related facts with semantic term/value pairs. */
29
+ declare function FigureBand({ figures, scale, label, className, ...rest }: FigureBandProps): react.JSX.Element | null;
30
+
31
+ export { type Figure, FigureBand, type FigureBandProps, FigureBand as default };
@@ -0,0 +1,51 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../lib/cn.js";
3
+ const VALUE_SCALE = {
4
+ lead: "text-[clamp(2rem,4cqi,2.75rem)] leading-[1.15] tracking-[-0.02em] tabular-nums",
5
+ sub: "text-[length:var(--fs-sub)] leading-[1.2]"
6
+ };
7
+ function FigureBand({
8
+ figures,
9
+ scale = "lead",
10
+ label,
11
+ className,
12
+ ...rest
13
+ }) {
14
+ if (figures.length === 0) return null;
15
+ const columns = Math.min(4, Math.ceil(figures.length / Math.ceil(figures.length / 4)));
16
+ const columnClass = {
17
+ 1: "@xl:basis-full",
18
+ 2: "@xl:basis-[calc(50%-.5px)]",
19
+ 3: "@xl:basis-[calc(33.333333%-.667px)]",
20
+ 4: "@xl:basis-[calc(25%-.75px)]"
21
+ }[columns];
22
+ return /* @__PURE__ */ jsx("div", { className: "folio-figure-band @container w-full", children: /* @__PURE__ */ jsx(
23
+ "dl",
24
+ {
25
+ "aria-label": label,
26
+ className: cn(
27
+ "m-0 flex w-full flex-wrap gap-px overflow-hidden rounded-[10px] border border-(--rule) bg-(--rule)",
28
+ className
29
+ ),
30
+ ...rest,
31
+ children: figures.map((figure) => /* @__PURE__ */ jsxs(
32
+ "div",
33
+ {
34
+ className: cn("min-w-0 grow basis-[calc(50%-.5px)] bg-(--paper) px-5 py-5 @xl:px-6 @xl:py-6", columnClass),
35
+ children: [
36
+ /* @__PURE__ */ jsx("dt", { className: "mb-2 font-sans text-[13px] font-normal leading-normal text-(--ink-3-aa)", children: figure.label }),
37
+ /* @__PURE__ */ jsx("dd", { className: cn("m-0 font-heading font-normal text-(--ink)", VALUE_SCALE[scale]), children: figure.value }),
38
+ figure.note !== void 0 && figure.note !== null && /* @__PURE__ */ jsx("dd", { className: "m-0 mt-2.5 font-sans text-[13px] font-light leading-[1.5] text-(--ink-3-aa)", children: figure.note })
39
+ ]
40
+ },
41
+ figure.id
42
+ ))
43
+ }
44
+ ) });
45
+ }
46
+ var FigureBand_default = FigureBand;
47
+ export {
48
+ FigureBand,
49
+ FigureBand_default as default
50
+ };
51
+ //# sourceMappingURL=FigureBand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/FigureBand/FigureBand.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react'\nimport { cn } from '../../lib/cn'\n\nexport interface Figure {\n /** Stable key; also what a caller keys its own data by. */\n id: string\n /** The label over the value. */\n label: string\n /** The value itself, set in the serif at the band's scale. */\n value: ReactNode\n /** The quiet line under it — a trend, a qualifier, a second fact. */\n note?: ReactNode\n}\n\nexport interface FigureBandProps extends Omit<HTMLAttributes<HTMLDListElement>, 'children'> {\n figures: Figure[]\n /**\n * How large the value is set.\n *\n * `lead` is for a band that is the point of its page — a stats headline,\n * where the numbers ARE the content. `sub` is for a band that supports the\n * page around it, and keeps the ladder honest: a supporting figure must not\n * be set at the same size as the page's own subject.\n */\n scale?: 'lead' | 'sub'\n /** Names the band for assistive tech when it has no visible heading of its own. */\n label?: string\n}\n\nconst VALUE_SCALE = {\n lead: 'text-[clamp(2rem,4cqi,2.75rem)] leading-[1.15] tracking-[-0.02em] tabular-nums',\n sub: 'text-[length:var(--fs-sub)] leading-[1.2]',\n} as const\n\n/** A framed, responsive group of related facts with semantic term/value pairs. */\nexport function FigureBand({\n figures,\n scale = 'lead',\n label,\n className,\n ...rest\n}: FigureBandProps) {\n if (figures.length === 0) return null\n\n // Balance six metrics into two complete rows instead of a four-plus-two grid.\n const columns = Math.min(4, Math.ceil(figures.length / Math.ceil(figures.length / 4)))\n const columnClass = {\n 1: '@xl:basis-full',\n 2: '@xl:basis-[calc(50%-.5px)]',\n 3: '@xl:basis-[calc(33.333333%-.667px)]',\n 4: '@xl:basis-[calc(25%-.75px)]',\n }[columns]\n\n return (\n <div className=\"folio-figure-band @container w-full\">\n <dl\n aria-label={label}\n className={cn(\n 'm-0 flex w-full flex-wrap gap-px overflow-hidden rounded-[10px] border border-(--rule) bg-(--rule)',\n className,\n )}\n {...rest}\n >\n {figures.map((figure) => (\n <div\n key={figure.id}\n className={cn('min-w-0 grow basis-[calc(50%-.5px)] bg-(--paper) px-5 py-5 @xl:px-6 @xl:py-6', columnClass)}\n >\n <dt className=\"mb-2 font-sans text-[13px] font-normal leading-normal text-(--ink-3-aa)\">{figure.label}</dt>\n <dd className={cn('m-0 font-heading font-normal text-(--ink)', VALUE_SCALE[scale])}>\n {figure.value}\n </dd>\n {figure.note !== undefined && figure.note !== null && (\n <dd className=\"m-0 mt-2.5 font-sans text-[13px] font-light leading-[1.5] text-(--ink-3-aa)\">\n {figure.note}\n </dd>\n )}\n </div>\n ))}\n </dl>\n </div>\n )\n}\n\nexport default FigureBand\n"],"mappings":"AAgEU,SAIE,KAJF;AA/DV,SAAS,UAAU;AA4BnB,MAAM,cAAc;AAAA,EAClB,MAAM;AAAA,EACN,KAAK;AACP;AAGO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAoB;AAClB,MAAI,QAAQ,WAAW,EAAG,QAAO;AAGjC,QAAM,UAAU,KAAK,IAAI,GAAG,KAAK,KAAK,QAAQ,SAAS,KAAK,KAAK,QAAQ,SAAS,CAAC,CAAC,CAAC;AACrF,QAAM,cAAc;AAAA,IAClB,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,EACL,EAAE,OAAO;AAET,SACE,oBAAC,SAAI,WAAU,uCACb;AAAA,IAAC;AAAA;AAAA,MACC,cAAY;AAAA,MACZ,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH,kBAAQ,IAAI,CAAC,WACZ;AAAA,QAAC;AAAA;AAAA,UAEC,WAAW,GAAG,gFAAgF,WAAW;AAAA,UAEzG;AAAA,gCAAC,QAAG,WAAU,2EAA2E,iBAAO,OAAM;AAAA,YACtG,oBAAC,QAAG,WAAW,GAAG,6CAA6C,YAAY,KAAK,CAAC,GAC9E,iBAAO,OACV;AAAA,YACC,OAAO,SAAS,UAAa,OAAO,SAAS,QAC5C,oBAAC,QAAG,WAAU,+EACX,iBAAO,MACV;AAAA;AAAA;AAAA,QAVG,OAAO;AAAA,MAYd,CACD;AAAA;AAAA,EACH,GACF;AAEJ;AAEA,IAAO,qBAAQ;","names":[]}