@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,30 @@
1
+ import * as react from 'react';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
+
4
+ interface CodeProps extends HTMLAttributes<HTMLElement> {
5
+ children: ReactNode;
6
+ }
7
+ /**
8
+ * A function name, a flag, a filename — inside a sentence.
9
+ *
10
+ * Renders a `<code>`, which is the element that means this. A `<span>` in a
11
+ * mono face looks identical and tells a screen reader nothing, and "pass
12
+ * dash dash force" is not what the sentence said.
13
+ *
14
+ * Sized in `em` rather than in pixels, so the chip tracks whatever type it sits
15
+ * beside — the same rule `Kbd` follows, and for the same reason: fixed at one
16
+ * value, the identical token came out three different sizes on one page
17
+ * depending on whether it landed in body copy, a caption or a table cell.
18
+ *
19
+ * The block form is `CodeBlock`. This one is inline by construction: it draws
20
+ * no plate, keeps no whitespace, and a multi-line string handed to it collapses
21
+ * into one run.
22
+ *
23
+ * @example
24
+ * Pass <Code>--force</Code> to overwrite the existing file.
25
+ * @example
26
+ * The helper lives in <Code>src/lib/cn.ts</Code>.
27
+ */
28
+ declare function Code({ children, className, ...rest }: CodeProps): react.JSX.Element;
29
+
30
+ export { Code, type CodeProps, Code as default };
@@ -0,0 +1,21 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../lib/cn.js";
3
+ function Code({ children, className, ...rest }) {
4
+ return /* @__PURE__ */ jsx(
5
+ "code",
6
+ {
7
+ className: cn(
8
+ "rounded-(--radius-sm) bg-(--stone) px-[0.4em] py-[0.15em] font-mono text-[0.85em] text-(--ink)",
9
+ className
10
+ ),
11
+ ...rest,
12
+ children
13
+ }
14
+ );
15
+ }
16
+ var Code_default = Code;
17
+ export {
18
+ Code,
19
+ Code_default as default
20
+ };
21
+ //# sourceMappingURL=Code.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Code/Code.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react'\nimport { cn } from '../../lib/cn'\n\nexport interface CodeProps extends HTMLAttributes<HTMLElement> {\n children: ReactNode\n}\n\n/**\n * A function name, a flag, a filename — inside a sentence.\n *\n * Renders a `<code>`, which is the element that means this. A `<span>` in a\n * mono face looks identical and tells a screen reader nothing, and \"pass\n * dash dash force\" is not what the sentence said.\n *\n * Sized in `em` rather than in pixels, so the chip tracks whatever type it sits\n * beside — the same rule `Kbd` follows, and for the same reason: fixed at one\n * value, the identical token came out three different sizes on one page\n * depending on whether it landed in body copy, a caption or a table cell.\n *\n * The block form is `CodeBlock`. This one is inline by construction: it draws\n * no plate, keeps no whitespace, and a multi-line string handed to it collapses\n * into one run.\n *\n * @example\n * Pass <Code>--force</Code> to overwrite the existing file.\n * @example\n * The helper lives in <Code>src/lib/cn.ts</Code>.\n */\nexport function Code({ children, className, ...rest }: CodeProps) {\n return (\n <code\n className={cn(\n 'rounded-(--radius-sm) bg-(--stone) px-[0.4em] py-[0.15em] font-mono text-[0.85em] text-(--ink)',\n className,\n )}\n {...rest}\n >\n {children}\n </code>\n )\n}\n\nexport default Code\n"],"mappings":"AA8BI;AA7BJ,SAAS,UAAU;AA2BZ,SAAS,KAAK,EAAE,UAAU,WAAW,GAAG,KAAK,GAAc;AAChE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,eAAQ;","names":[]}
@@ -0,0 +1,145 @@
1
+ import * as react from 'react';
2
+
3
+ interface CommonProps {
4
+ /**
5
+ * The snippet, verbatim.
6
+ *
7
+ * Required even when `html` is supplied, and that is the point: this is what
8
+ * the copy button puts on the clipboard. A block that copies its own rendered
9
+ * markup hands the reader a wall of `<span>`s, and one that copies
10
+ * `textContent` scraped back out of the DOM is a single non-breaking space
11
+ * away from pasting something that does not run.
12
+ */
13
+ code: string;
14
+ /** A filename or a caption, printed at the start of the strip. */
15
+ title?: string;
16
+ /**
17
+ * The language, printed at the end of the strip.
18
+ *
19
+ * Optional, and the omission is visible rather than silent: a block with no
20
+ * language gets no label instead of claiming a wrong one. A code block that
21
+ * does not say what it is written in makes the reader infer it from the
22
+ * syntax, which is the one thing they came to the block to learn.
23
+ */
24
+ lang?: string;
25
+ /**
26
+ * Caps the block's height and scrolls past it.
27
+ *
28
+ * A number is pixels; a string is any CSS length (`'24rem'`, `'50vh'`). The
29
+ * body scrolls in both axes and is focusable, so what is past the fold stays
30
+ * reachable with a keyboard rather than merely present in the DOM.
31
+ */
32
+ maxHeight?: number | string;
33
+ /** Drops the copy button, for a block nobody is meant to run. */
34
+ copyable?: boolean;
35
+ /** Accessible copy action, supplied by the host locale. */
36
+ copyLabel?: string;
37
+ /** Accessible confirmation after copying. */
38
+ copiedLabel?: string;
39
+ /**
40
+ * Names the scrollable body for a screen reader. Defaults to `title`, and to
41
+ * "Code" when there is not one.
42
+ */
43
+ label?: string;
44
+ className?: string;
45
+ }
46
+ /**
47
+ * The two forms, and why they are two.
48
+ *
49
+ * `html` is pre-highlighted markup for the SAME snippet. The package does not
50
+ * highlight, and will not: a highlighter is a few hundred kilobytes of grammar
51
+ * and a build-time job. The documentation site runs Shiki inside its generator
52
+ * and hands the result here, which is the shape that half exists for. Without
53
+ * `html` the block renders `code` as text, which is what a template, a README
54
+ * or an agent's answer has and all it needs.
55
+ *
56
+ * `lineNumbers` and `highlightLines` belong to the plain form only, and that is
57
+ * enforced in the TYPE rather than left to a note. They are a per-LINE
58
+ * structure, and `html` is one opaque string this component is not going to
59
+ * start parsing. Typed apart, passing both is a compile error at the call site;
60
+ * typed together it is a prop that renders nothing and says nothing.
61
+ *
62
+ * The plain form is written first because the emitted prop table reads the
63
+ * first arm of a union: this way `lineNumbers` documents as `boolean` rather
64
+ * than as the `never` the other arm gives it.
65
+ */
66
+ type WithPlainSource = CommonProps & {
67
+ /**
68
+ * Absent on this form; `string` on the other.
69
+ *
70
+ * Pass pre-highlighted markup — Shiki's output, run at build time over this
71
+ * same `code` — and the block renders that instead of the plain text. Doing
72
+ * so takes `lineNumbers` and `highlightLines` away with it.
73
+ */
74
+ html?: undefined;
75
+ /** Numbers every line, counting from one. */
76
+ lineNumbers?: boolean;
77
+ /**
78
+ * Lines to band, counting from one. A number past the end of the snippet is
79
+ * ignored rather than throwing — the usual cause is a snippet that got
80
+ * shorter while the annotation did not.
81
+ */
82
+ highlightLines?: number[];
83
+ };
84
+ type WithHighlightedHtml = CommonProps & {
85
+ html: string;
86
+ /** Not available alongside `html`, which the component does not parse. */
87
+ lineNumbers?: never;
88
+ /** Not available alongside `html`, which the component does not parse. */
89
+ highlightLines?: never;
90
+ };
91
+ type CodeBlockProps = WithPlainSource | WithHighlightedHtml;
92
+ /**
93
+ * A multi-line snippet, on a plate, with a way to take it away.
94
+ *
95
+ * A labelled block has a strip for its title, language and copy button.
96
+ * Without a label, copying sits beside the code in the same row. It is deliberately
97
+ * not a hover affordance: a control that appears on hover does not exist on a
98
+ * touch screen, which is where a reader is most likely to want the snippet and
99
+ * least able to select it by hand.
100
+ *
101
+ * Line numbers live INSIDE their own line's row rather than in a parallel gutter
102
+ * column. Two columns sharing a line-height align right up until one of them
103
+ * wraps, ships a different font, or scrolls on its own; a number that is a child
104
+ * of the line it numbers cannot come apart from it. The cost is that a number
105
+ * scrolls away with its line: it is inside the scrolling box, not in a gutter
106
+ * beside it. A gutter that stayed put would be a second column to keep in sync,
107
+ * which is the failure this avoids.
108
+ *
109
+ * The body is a focusable, named `role="group"`, and both halves of that are
110
+ * load-bearing. Focusable, because a scrollable box whose contents are not
111
+ * themselves focusable is unreachable by keyboard — there is nothing to Tab to
112
+ * and therefore no way to press an arrow key at it, so the right-hand half of a
113
+ * long line does not exist for anyone not using a mouse. Named, because a tab
114
+ * stop that announces nothing lands the reader in an anonymous box and leaves
115
+ * them to work out what they have arrived in.
116
+ *
117
+ * `group` rather than `region`, and that is the deliberate half. A region is a
118
+ * LANDMARK — one of the handful of major sections a reader navigates a whole
119
+ * page by — and a snippet is not one of those. Three fenced blocks in one
120
+ * article would put three landmarks called "Code" into that map, which is
121
+ * exactly the noise the `landmark-unique` rule exists to catch, and it would
122
+ * push the page's real landmarks down a list nobody can now skim. `group`
123
+ * carries the same accessible name to the same reader on the way in, and
124
+ * carries it nowhere else.
125
+ *
126
+ * For a function name inside a sentence, reach for `Code`.
127
+ *
128
+ * @example
129
+ * <CodeBlock code="pnpm add @misoto22/folio" lang="bash" />
130
+ * @example
131
+ * <CodeBlock
132
+ * title="cn.ts"
133
+ * lang="ts"
134
+ * lineNumbers
135
+ * highlightLines={[2]}
136
+ * maxHeight="24rem"
137
+ * code={source}
138
+ * />
139
+ * @example
140
+ * // Highlighted at build time by the site's own Shiki pass.
141
+ * <CodeBlock code={source} html={highlighted} lang="tsx" />
142
+ */
143
+ declare function CodeBlock({ code, html, title, lang, maxHeight, copyable, copyLabel, copiedLabel, label, className, lineNumbers, highlightLines, }: CodeBlockProps): react.JSX.Element;
144
+
145
+ export { CodeBlock, type CodeBlockProps, CodeBlock as default };
@@ -0,0 +1,114 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { RiCheckLine, RiFileCopyLine } from "@remixicon/react";
4
+ import { cn } from "../../lib/cn.js";
5
+ import { useClipboardCopy } from "../../lib/useClipboardCopy.js";
6
+ import { Button } from "../Button/Button.js";
7
+ const LANGUAGE_LABEL = {
8
+ bash: "Shell",
9
+ css: "CSS",
10
+ html: "HTML",
11
+ js: "JavaScript",
12
+ json: "JSON",
13
+ jsx: "JSX",
14
+ md: "Markdown",
15
+ sh: "Shell",
16
+ ts: "TypeScript",
17
+ tsx: "TSX"
18
+ };
19
+ const HIGHLIGHTED = "[&_pre]:m-0 [&_pre]:min-w-max [&_pre]:bg-transparent [&_pre]:p-0 [&_pre]:font-mono [&_pre]:text-[13px] [&_pre]:leading-[1.7] [&_code]:bg-transparent";
20
+ function CodeBlock({
21
+ code,
22
+ html,
23
+ title,
24
+ lang,
25
+ maxHeight,
26
+ copyable = true,
27
+ copyLabel = "Copy the snippet",
28
+ copiedLabel = "Copied",
29
+ label,
30
+ className,
31
+ lineNumbers = false,
32
+ highlightLines
33
+ }) {
34
+ const { copied, copy } = useClipboardCopy("CodeBlock");
35
+ const languageLabel = lang ? LANGUAGE_LABEL[lang] ?? lang.toUpperCase() : void 0;
36
+ const banded = new Set(highlightLines ?? []);
37
+ return /* @__PURE__ */ jsxs(
38
+ "div",
39
+ {
40
+ className: cn(
41
+ // `min-w-0` is what lets the body below actually scroll: a grid or flex
42
+ // item defaults to `min-width: auto`, so without it the block grows to
43
+ // the min-content width of its longest line — an unbroken install
44
+ // command — and pushes the whole page sideways on a phone.
45
+ "min-w-0 overflow-hidden rounded-(--radius-md) border border-(--rule) bg-(--paper-2)",
46
+ title || languageLabel ? "flex flex-col" : "grid grid-cols-[minmax(0,1fr)_auto] items-center",
47
+ className
48
+ ),
49
+ children: [
50
+ title || languageLabel || copyable ? /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-3", title || languageLabel ? "border-b border-(--rule) py-1.5 ps-4 pe-1.5" : "col-start-2 row-start-1 p-1.5"), children: [
51
+ title ? /* @__PURE__ */ jsx("span", { className: "mono-meta truncate text-(--ink-2)", children: title }) : null,
52
+ languageLabel ? /* @__PURE__ */ jsx("span", { className: "mono-meta shrink-0 text-(--ink-3-aa)", children: languageLabel }) : null,
53
+ copyable ? /* @__PURE__ */ jsx(
54
+ Button,
55
+ {
56
+ iconOnly: true,
57
+ size: "sm",
58
+ variant: "ghost",
59
+ onClick: () => void copy(code),
60
+ "aria-label": copied ? copiedLabel : copyLabel,
61
+ className: "ms-auto shrink-0 pointer-coarse:min-h-11 pointer-coarse:min-w-11",
62
+ children: copied ? /* @__PURE__ */ jsx(RiCheckLine, { size: 14, "aria-hidden": true }) : /* @__PURE__ */ jsx(RiFileCopyLine, { size: 14, "aria-hidden": true })
63
+ }
64
+ ) : null
65
+ ] }) : null,
66
+ /* @__PURE__ */ jsx(
67
+ "div",
68
+ {
69
+ tabIndex: 0,
70
+ role: "group",
71
+ "aria-label": label ?? title ?? "Code",
72
+ style: maxHeight === void 0 ? void 0 : { maxHeight },
73
+ className: cn("overflow-auto px-4 py-3.5 scroll-slim", !title && !languageLabel && "col-start-1 row-start-1"),
74
+ children: html === void 0 ? /* @__PURE__ */ jsx("pre", { className: "m-0 min-w-max bg-transparent p-0 font-mono text-[13px] leading-[1.7]", children: /* @__PURE__ */ jsx("code", { className: "block", children: code.split("\n").map((line, index) => /* @__PURE__ */ jsxs(
75
+ "span",
76
+ {
77
+ "data-line": index + 1,
78
+ "data-highlighted": banded.has(index + 1) ? "" : void 0,
79
+ className: cn(
80
+ "block min-h-[1.7em] border-s-2 border-transparent ps-2",
81
+ banded.has(index + 1) && "border-(--accent) bg-(--stone)"
82
+ ),
83
+ children: [
84
+ lineNumbers ? /* @__PURE__ */ jsx(
85
+ "span",
86
+ {
87
+ "aria-hidden": true,
88
+ className: "inline-block w-8 shrink-0 select-none pe-3 text-end tabular-nums text-(--ink-3-aa)",
89
+ children: index + 1
90
+ }
91
+ ) : null,
92
+ line
93
+ ]
94
+ },
95
+ index
96
+ )) }) }) : (
97
+ // Trusted markup only: the output of the caller's own highlighter, run
98
+ // over the caller's own `code`. It is not a place to put anything a
99
+ // reader wrote — hand that to `code` and let the block render it as
100
+ // text, which it cannot mis-execute.
101
+ /* @__PURE__ */ jsx("div", { className: HIGHLIGHTED, dangerouslySetInnerHTML: { __html: html } })
102
+ )
103
+ }
104
+ )
105
+ ]
106
+ }
107
+ );
108
+ }
109
+ var CodeBlock_default = CodeBlock;
110
+ export {
111
+ CodeBlock,
112
+ CodeBlock_default as default
113
+ };
114
+ //# sourceMappingURL=CodeBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/CodeBlock/CodeBlock.tsx"],"sourcesContent":["'use client'\n\nimport { RiCheckLine, RiFileCopyLine } from '@remixicon/react'\nimport { cn } from '../../lib/cn'\nimport { useClipboardCopy } from '../../lib/useClipboardCopy'\nimport { Button } from '../Button/Button'\n\n/**\n * What a language id is CALLED, for the handful where the id is not a label.\n *\n * Shiki's ids are identifiers, not words: `tsx` and `bash` read fine in upper\n * case, `md` and `ts` do not, and nobody reads `sh` as \"shell\". Anything absent\n * falls through to the id upper-cased, which is right far more often than it is\n * wrong — and a wrong label here is a label, not a crash.\n */\nconst LANGUAGE_LABEL: Record<string, string> = {\n bash: 'Shell',\n css: 'CSS',\n html: 'HTML',\n js: 'JavaScript',\n json: 'JSON',\n jsx: 'JSX',\n md: 'Markdown',\n sh: 'Shell',\n ts: 'TypeScript',\n tsx: 'TSX',\n}\n\ninterface CommonProps {\n /**\n * The snippet, verbatim.\n *\n * Required even when `html` is supplied, and that is the point: this is what\n * the copy button puts on the clipboard. A block that copies its own rendered\n * markup hands the reader a wall of `<span>`s, and one that copies\n * `textContent` scraped back out of the DOM is a single non-breaking space\n * away from pasting something that does not run.\n */\n code: string\n /** A filename or a caption, printed at the start of the strip. */\n title?: string\n /**\n * The language, printed at the end of the strip.\n *\n * Optional, and the omission is visible rather than silent: a block with no\n * language gets no label instead of claiming a wrong one. A code block that\n * does not say what it is written in makes the reader infer it from the\n * syntax, which is the one thing they came to the block to learn.\n */\n lang?: string\n /**\n * Caps the block's height and scrolls past it.\n *\n * A number is pixels; a string is any CSS length (`'24rem'`, `'50vh'`). The\n * body scrolls in both axes and is focusable, so what is past the fold stays\n * reachable with a keyboard rather than merely present in the DOM.\n */\n maxHeight?: number | string\n /** Drops the copy button, for a block nobody is meant to run. */\n copyable?: boolean\n /** Accessible copy action, supplied by the host locale. */\n copyLabel?: string\n /** Accessible confirmation after copying. */\n copiedLabel?: string\n /**\n * Names the scrollable body for a screen reader. Defaults to `title`, and to\n * \"Code\" when there is not one.\n */\n label?: string\n className?: string\n}\n\n/**\n * The two forms, and why they are two.\n *\n * `html` is pre-highlighted markup for the SAME snippet. The package does not\n * highlight, and will not: a highlighter is a few hundred kilobytes of grammar\n * and a build-time job. The documentation site runs Shiki inside its generator\n * and hands the result here, which is the shape that half exists for. Without\n * `html` the block renders `code` as text, which is what a template, a README\n * or an agent's answer has and all it needs.\n *\n * `lineNumbers` and `highlightLines` belong to the plain form only, and that is\n * enforced in the TYPE rather than left to a note. They are a per-LINE\n * structure, and `html` is one opaque string this component is not going to\n * start parsing. Typed apart, passing both is a compile error at the call site;\n * typed together it is a prop that renders nothing and says nothing.\n *\n * The plain form is written first because the emitted prop table reads the\n * first arm of a union: this way `lineNumbers` documents as `boolean` rather\n * than as the `never` the other arm gives it.\n */\ntype WithPlainSource = CommonProps & {\n /**\n * Absent on this form; `string` on the other.\n *\n * Pass pre-highlighted markup — Shiki's output, run at build time over this\n * same `code` — and the block renders that instead of the plain text. Doing\n * so takes `lineNumbers` and `highlightLines` away with it.\n */\n html?: undefined\n /** Numbers every line, counting from one. */\n lineNumbers?: boolean\n /**\n * Lines to band, counting from one. A number past the end of the snippet is\n * ignored rather than throwing — the usual cause is a snippet that got\n * shorter while the annotation did not.\n */\n highlightLines?: number[]\n}\n\ntype WithHighlightedHtml = CommonProps & {\n html: string\n /** Not available alongside `html`, which the component does not parse. */\n lineNumbers?: never\n /** Not available alongside `html`, which the component does not parse. */\n highlightLines?: never\n}\n\nexport type CodeBlockProps = WithPlainSource | WithHighlightedHtml\n\n/**\n * The caller's `<pre>`, normalised to ours.\n *\n * Shiki emits a `<pre>` of its own with a background and padding baked in, so\n * the highlighted path would otherwise draw a second plate a shade off the one\n * it is sitting on, at a size that does not match the plain path.\n */\nconst HIGHLIGHTED =\n '[&_pre]:m-0 [&_pre]:min-w-max [&_pre]:bg-transparent [&_pre]:p-0 [&_pre]:font-mono [&_pre]:text-[13px] [&_pre]:leading-[1.7] [&_code]:bg-transparent'\n\n/**\n * A multi-line snippet, on a plate, with a way to take it away.\n *\n * A labelled block has a strip for its title, language and copy button.\n * Without a label, copying sits beside the code in the same row. It is deliberately\n * not a hover affordance: a control that appears on hover does not exist on a\n * touch screen, which is where a reader is most likely to want the snippet and\n * least able to select it by hand.\n *\n * Line numbers live INSIDE their own line's row rather than in a parallel gutter\n * column. Two columns sharing a line-height align right up until one of them\n * wraps, ships a different font, or scrolls on its own; a number that is a child\n * of the line it numbers cannot come apart from it. The cost is that a number\n * scrolls away with its line: it is inside the scrolling box, not in a gutter\n * beside it. A gutter that stayed put would be a second column to keep in sync,\n * which is the failure this avoids.\n *\n * The body is a focusable, named `role=\"group\"`, and both halves of that are\n * load-bearing. Focusable, because a scrollable box whose contents are not\n * themselves focusable is unreachable by keyboard — there is nothing to Tab to\n * and therefore no way to press an arrow key at it, so the right-hand half of a\n * long line does not exist for anyone not using a mouse. Named, because a tab\n * stop that announces nothing lands the reader in an anonymous box and leaves\n * them to work out what they have arrived in.\n *\n * `group` rather than `region`, and that is the deliberate half. A region is a\n * LANDMARK — one of the handful of major sections a reader navigates a whole\n * page by — and a snippet is not one of those. Three fenced blocks in one\n * article would put three landmarks called \"Code\" into that map, which is\n * exactly the noise the `landmark-unique` rule exists to catch, and it would\n * push the page's real landmarks down a list nobody can now skim. `group`\n * carries the same accessible name to the same reader on the way in, and\n * carries it nowhere else.\n *\n * For a function name inside a sentence, reach for `Code`.\n *\n * @example\n * <CodeBlock code=\"pnpm add @misoto22/folio\" lang=\"bash\" />\n * @example\n * <CodeBlock\n * title=\"cn.ts\"\n * lang=\"ts\"\n * lineNumbers\n * highlightLines={[2]}\n * maxHeight=\"24rem\"\n * code={source}\n * />\n * @example\n * // Highlighted at build time by the site's own Shiki pass.\n * <CodeBlock code={source} html={highlighted} lang=\"tsx\" />\n */\nexport function CodeBlock({\n code,\n html,\n title,\n lang,\n maxHeight,\n copyable = true,\n copyLabel = 'Copy the snippet',\n copiedLabel = 'Copied',\n label,\n className,\n lineNumbers = false,\n highlightLines,\n}: CodeBlockProps) {\n // Shared with the website ClipboardButton, including what a refused write does.\n const { copied, copy } = useClipboardCopy('CodeBlock')\n\n const languageLabel = lang ? (LANGUAGE_LABEL[lang] ?? lang.toUpperCase()) : undefined\n const banded = new Set(highlightLines ?? [])\n\n return (\n <div\n className={cn(\n // `min-w-0` is what lets the body below actually scroll: a grid or flex\n // item defaults to `min-width: auto`, so without it the block grows to\n // the min-content width of its longest line — an unbroken install\n // command — and pushes the whole page sideways on a phone.\n 'min-w-0 overflow-hidden rounded-(--radius-md) border border-(--rule) bg-(--paper-2)',\n title || languageLabel ? 'flex flex-col' : 'grid grid-cols-[minmax(0,1fr)_auto] items-center',\n className,\n )}\n >\n {title || languageLabel || copyable ? (\n <div className={cn('flex items-center gap-3', title || languageLabel ? 'border-b border-(--rule) py-1.5 ps-4 pe-1.5' : 'col-start-2 row-start-1 p-1.5')}>\n {title ? <span className=\"mono-meta truncate text-(--ink-2)\">{title}</span> : null}\n {languageLabel ? (\n <span className=\"mono-meta shrink-0 text-(--ink-3-aa)\">{languageLabel}</span>\n ) : null}\n {copyable ? (\n <Button\n iconOnly\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => void copy(code)}\n aria-label={copied ? copiedLabel : copyLabel}\n // `sm` is 36px, under the 44px a finger needs. The bump is gated\n // on a coarse pointer so a mouse-driven page keeps the compact\n // strip (WCAG 2.5.5).\n className=\"ms-auto shrink-0 pointer-coarse:min-h-11 pointer-coarse:min-w-11\"\n >\n {copied ? (\n <RiCheckLine size={14} aria-hidden />\n ) : (\n <RiFileCopyLine size={14} aria-hidden />\n )}\n </Button>\n ) : null}\n </div>\n ) : null}\n\n <div\n tabIndex={0}\n // A named group, not a landmark: see the note above the component.\n role=\"group\"\n aria-label={label ?? title ?? 'Code'}\n style={maxHeight === undefined ? undefined : { maxHeight }}\n className={cn('overflow-auto px-4 py-3.5 scroll-slim', !title && !languageLabel && 'col-start-1 row-start-1')}\n >\n {html === undefined ? (\n <pre className=\"m-0 min-w-max bg-transparent p-0 font-mono text-[13px] leading-[1.7]\">\n <code className=\"block\">\n {code.split('\\n').map((line, index) => (\n <span\n key={index}\n data-line={index + 1}\n data-highlighted={banded.has(index + 1) ? '' : undefined}\n // The transparent border is carried by EVERY row, banded or\n // not. On the banded ones alone it would shift them two pixels\n // along the inline axis — which is the exact misalignment a\n // highlight is there to help the reader see past.\n //\n // `min-h` is what keeps a blank line a line: an empty block\n // has no line box and would otherwise collapse to nothing,\n // taking every number below it out of step with its code.\n className={cn(\n 'block min-h-[1.7em] border-s-2 border-transparent ps-2',\n banded.has(index + 1) && 'border-(--accent) bg-(--stone)',\n )}\n >\n {lineNumbers ? (\n <span\n aria-hidden\n className=\"inline-block w-8 shrink-0 select-none pe-3 text-end tabular-nums text-(--ink-3-aa)\"\n >\n {index + 1}\n </span>\n ) : null}\n {line}\n </span>\n ))}\n </code>\n </pre>\n ) : (\n // Trusted markup only: the output of the caller's own highlighter, run\n // over the caller's own `code`. It is not a place to put anything a\n // reader wrote — hand that to `code` and let the block render it as\n // text, which it cannot mis-execute.\n <div className={HIGHLIGHTED} dangerouslySetInnerHTML={{ __html: html }} />\n )}\n </div>\n </div>\n )\n}\n\nexport default CodeBlock\n"],"mappings":";AAuNQ,SACW,KADX;AArNR,SAAS,aAAa,sBAAsB;AAC5C,SAAS,UAAU;AACnB,SAAS,wBAAwB;AACjC,SAAS,cAAc;AAUvB,MAAM,iBAAyC;AAAA,EAC7C,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,KAAK;AAAA,EACL,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,KAAK;AACP;AAsGA,MAAM,cACJ;AAqDK,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AACF,GAAmB;AAEjB,QAAM,EAAE,QAAQ,KAAK,IAAI,iBAAiB,WAAW;AAErD,QAAM,gBAAgB,OAAQ,eAAe,IAAI,KAAK,KAAK,YAAY,IAAK;AAC5E,QAAM,SAAS,IAAI,IAAI,kBAAkB,CAAC,CAAC;AAE3C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA,QAKT;AAAA,QACA,SAAS,gBAAgB,kBAAkB;AAAA,QAC3C;AAAA,MACF;AAAA,MAEC;AAAA,iBAAS,iBAAiB,WACzB,qBAAC,SAAI,WAAW,GAAG,2BAA2B,SAAS,gBAAgB,gDAAgD,+BAA+B,GACnJ;AAAA,kBAAQ,oBAAC,UAAK,WAAU,qCAAqC,iBAAM,IAAU;AAAA,UAC7E,gBACC,oBAAC,UAAK,WAAU,wCAAwC,yBAAc,IACpE;AAAA,UACH,WACC;AAAA,YAAC;AAAA;AAAA,cACC,UAAQ;AAAA,cACR,MAAK;AAAA,cACL,SAAQ;AAAA,cACR,SAAS,MAAM,KAAK,KAAK,IAAI;AAAA,cAC7B,cAAY,SAAS,cAAc;AAAA,cAInC,WAAU;AAAA,cAET,mBACC,oBAAC,eAAY,MAAM,IAAI,eAAW,MAAC,IAEnC,oBAAC,kBAAe,MAAM,IAAI,eAAW,MAAC;AAAA;AAAA,UAE1C,IACE;AAAA,WACN,IACE;AAAA,QAEJ;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YAEV,MAAK;AAAA,YACL,cAAY,SAAS,SAAS;AAAA,YAC9B,OAAO,cAAc,SAAY,SAAY,EAAE,UAAU;AAAA,YACzD,WAAW,GAAG,yCAAyC,CAAC,SAAS,CAAC,iBAAiB,yBAAyB;AAAA,YAE3G,mBAAS,SACR,oBAAC,SAAI,WAAU,wEACb,8BAAC,UAAK,WAAU,SACb,eAAK,MAAM,IAAI,EAAE,IAAI,CAAC,MAAM,UAC3B;AAAA,cAAC;AAAA;AAAA,gBAEC,aAAW,QAAQ;AAAA,gBACnB,oBAAkB,OAAO,IAAI,QAAQ,CAAC,IAAI,KAAK;AAAA,gBAS/C,WAAW;AAAA,kBACT;AAAA,kBACA,OAAO,IAAI,QAAQ,CAAC,KAAK;AAAA,gBAC3B;AAAA,gBAEC;AAAA,gCACC;AAAA,oBAAC;AAAA;AAAA,sBACC,eAAW;AAAA,sBACX,WAAU;AAAA,sBAET,kBAAQ;AAAA;AAAA,kBACX,IACE;AAAA,kBACH;AAAA;AAAA;AAAA,cAxBI;AAAA,YAyBP,CACD,GACH,GACF;AAAA;AAAA;AAAA;AAAA;AAAA,cAMA,oBAAC,SAAI,WAAW,aAAa,yBAAyB,EAAE,QAAQ,KAAK,GAAG;AAAA;AAAA;AAAA,QAE5E;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,oBAAQ;","names":[]}
@@ -0,0 +1,45 @@
1
+ import * as react from 'react';
2
+ import { ComponentProps, ReactNode } from 'react';
3
+ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
4
+
5
+ /** Radix Collapsible root, as a typed passthrough. */
6
+ declare const Collapsible: react.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & react.RefAttributes<HTMLDivElement>>;
7
+ /**
8
+ * The trigger and the panel, unstyled, for a disclosure that needs its own
9
+ * layout — a sidebar group whose header carries a count and a chevron on
10
+ * opposite sides, say. `CollapsibleSection` is the composed version and is what
11
+ * most call sites want; these two exist so the ones that do not have to reach
12
+ * for Radix directly and re-derive the keyboard and `aria-expanded` wiring.
13
+ *
14
+ * The panel animates on `--radix-collapsible-content-height`, which Radix
15
+ * measures — so it opens to its real height rather than to a guessed
16
+ * `max-height`, which is what makes a long group and a short one take the same
17
+ * time instead of the long one appearing to stall.
18
+ */
19
+ declare const CollapsibleTrigger: react.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & react.RefAttributes<HTMLButtonElement>>;
20
+ declare function CollapsibleContent({ className, ...props }: ComponentProps<typeof CollapsiblePrimitive.Content>): react.JSX.Element;
21
+ interface CollapsibleSectionProps extends Omit<ComponentProps<typeof CollapsiblePrimitive.Root>, 'children' | 'title'> {
22
+ /** What the trigger says. */
23
+ title: ReactNode;
24
+ children: ReactNode;
25
+ }
26
+ /**
27
+ * One thing that opens, on its own.
28
+ *
29
+ * The difference from `Accordion` is arithmetic: an accordion is a SET, and a
30
+ * set can coordinate — opening one closes another. A collapsible is one
31
+ * disclosure with nothing to coordinate with. Reaching for an accordion of one
32
+ * gets you a component managing a value you never read.
33
+ *
34
+ * The marker here is a chevron rather than the accordion's plus, and
35
+ * deliberately: this reveals more of the same thing, where an accordion row
36
+ * opens a distinct answer.
37
+ *
38
+ * @example
39
+ * <CollapsibleSection title="Advanced settings">
40
+ * <Field label="Retries"><Input type="number" /></Field>
41
+ * </CollapsibleSection>
42
+ */
43
+ declare function CollapsibleSection({ title, children, className, ...props }: CollapsibleSectionProps): react.JSX.Element;
44
+
45
+ export { Collapsible, CollapsibleContent, CollapsibleSection, type CollapsibleSectionProps, CollapsibleTrigger, Collapsible as default };
@@ -0,0 +1,60 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
4
+ import { RiArrowDownSLine } from "@remixicon/react";
5
+ import { cn } from "../../lib/cn.js";
6
+ const Collapsible = CollapsiblePrimitive.Root;
7
+ const CollapsibleTrigger = CollapsiblePrimitive.Trigger;
8
+ function CollapsibleContent({
9
+ className,
10
+ ...props
11
+ }) {
12
+ return /* @__PURE__ */ jsx(
13
+ CollapsiblePrimitive.Content,
14
+ {
15
+ "data-folio-animated": true,
16
+ className: cn(
17
+ "overflow-hidden data-[state=closed]:animate-[folio-collapsible-up_var(--duration-base)_var(--ease)] data-[state=open]:animate-[folio-collapsible-down_var(--duration-base)_var(--ease)]",
18
+ className
19
+ ),
20
+ ...props
21
+ }
22
+ );
23
+ }
24
+ function CollapsibleSection({
25
+ title,
26
+ children,
27
+ className,
28
+ ...props
29
+ }) {
30
+ return /* @__PURE__ */ jsxs(CollapsiblePrimitive.Root, { className: cn("w-full", className), ...props, children: [
31
+ /* @__PURE__ */ jsxs(CollapsiblePrimitive.Trigger, { className: "group flex w-full items-center justify-between gap-4 py-3 text-start text-sm text-(--ink) transition-colors duration-(--duration-fast) hover:text-(--ink-2)", children: [
32
+ title,
33
+ /* @__PURE__ */ jsx(
34
+ RiArrowDownSLine,
35
+ {
36
+ size: 16,
37
+ "aria-hidden": true,
38
+ className: "shrink-0 text-(--ink-3-aa) transition-transform duration-(--duration-base) ease-(--ease-out-expo) group-data-[state=open]:rotate-180"
39
+ }
40
+ )
41
+ ] }),
42
+ /* @__PURE__ */ jsx(
43
+ CollapsiblePrimitive.Content,
44
+ {
45
+ "data-folio-animated": true,
46
+ className: "overflow-hidden text-sm leading-relaxed text-(--ink-2) data-[state=closed]:animate-[folio-collapsible-up_var(--duration-base)_var(--ease)] data-[state=open]:animate-[folio-collapsible-down_var(--duration-base)_var(--ease)]",
47
+ children: /* @__PURE__ */ jsx("div", { className: "pb-3", children })
48
+ }
49
+ )
50
+ ] });
51
+ }
52
+ var Collapsible_default = Collapsible;
53
+ export {
54
+ Collapsible,
55
+ CollapsibleContent,
56
+ CollapsibleSection,
57
+ CollapsibleTrigger,
58
+ Collapsible_default as default
59
+ };
60
+ //# sourceMappingURL=Collapsible.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Collapsible/Collapsible.tsx"],"sourcesContent":["'use client'\n\nimport * as CollapsiblePrimitive from '@radix-ui/react-collapsible'\nimport { RiArrowDownSLine } from '@remixicon/react'\nimport type { ComponentProps, ReactNode } from 'react'\nimport { cn } from '../../lib/cn'\n\n/** Radix Collapsible root, as a typed passthrough. */\nexport const Collapsible = CollapsiblePrimitive.Root\n\n/**\n * The trigger and the panel, unstyled, for a disclosure that needs its own\n * layout — a sidebar group whose header carries a count and a chevron on\n * opposite sides, say. `CollapsibleSection` is the composed version and is what\n * most call sites want; these two exist so the ones that do not have to reach\n * for Radix directly and re-derive the keyboard and `aria-expanded` wiring.\n *\n * The panel animates on `--radix-collapsible-content-height`, which Radix\n * measures — so it opens to its real height rather than to a guessed\n * `max-height`, which is what makes a long group and a short one take the same\n * time instead of the long one appearing to stall.\n */\nexport const CollapsibleTrigger = CollapsiblePrimitive.Trigger\n\nexport function CollapsibleContent({\n className,\n ...props\n}: ComponentProps<typeof CollapsiblePrimitive.Content>) {\n return (\n <CollapsiblePrimitive.Content\n data-folio-animated\n className={cn(\n 'overflow-hidden data-[state=closed]:animate-[folio-collapsible-up_var(--duration-base)_var(--ease)] data-[state=open]:animate-[folio-collapsible-down_var(--duration-base)_var(--ease)]',\n className,\n )}\n {...props}\n />\n )\n}\n\nexport interface CollapsibleSectionProps\n extends Omit<ComponentProps<typeof CollapsiblePrimitive.Root>, 'children' | 'title'> {\n /** What the trigger says. */\n title: ReactNode\n children: ReactNode\n}\n\n/**\n * One thing that opens, on its own.\n *\n * The difference from `Accordion` is arithmetic: an accordion is a SET, and a\n * set can coordinate — opening one closes another. A collapsible is one\n * disclosure with nothing to coordinate with. Reaching for an accordion of one\n * gets you a component managing a value you never read.\n *\n * The marker here is a chevron rather than the accordion's plus, and\n * deliberately: this reveals more of the same thing, where an accordion row\n * opens a distinct answer.\n *\n * @example\n * <CollapsibleSection title=\"Advanced settings\">\n * <Field label=\"Retries\"><Input type=\"number\" /></Field>\n * </CollapsibleSection>\n */\nexport function CollapsibleSection({\n title,\n children,\n className,\n ...props\n}: CollapsibleSectionProps) {\n return (\n <CollapsiblePrimitive.Root className={cn('w-full', className)} {...props}>\n <CollapsiblePrimitive.Trigger className=\"group flex w-full items-center justify-between gap-4 py-3 text-start text-sm text-(--ink) transition-colors duration-(--duration-fast) hover:text-(--ink-2)\">\n {title}\n <RiArrowDownSLine\n size={16}\n aria-hidden\n className=\"shrink-0 text-(--ink-3-aa) transition-transform duration-(--duration-base) ease-(--ease-out-expo) group-data-[state=open]:rotate-180\"\n />\n </CollapsiblePrimitive.Trigger>\n <CollapsiblePrimitive.Content\n data-folio-animated\n className=\"overflow-hidden text-sm leading-relaxed text-(--ink-2) data-[state=closed]:animate-[folio-collapsible-up_var(--duration-base)_var(--ease)] data-[state=open]:animate-[folio-collapsible-down_var(--duration-base)_var(--ease)]\"\n >\n <div className=\"pb-3\">{children}</div>\n </CollapsiblePrimitive.Content>\n </CollapsiblePrimitive.Root>\n )\n}\n\nexport default Collapsible\n"],"mappings":";AA6BI,cA2CE,YA3CF;AA3BJ,YAAY,0BAA0B;AACtC,SAAS,wBAAwB;AAEjC,SAAS,UAAU;AAGZ,MAAM,cAAc,qBAAqB;AAczC,MAAM,qBAAqB,qBAAqB;AAEhD,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA,GAAG;AACL,GAAwD;AACtD,SACE;AAAA,IAAC,qBAAqB;AAAA,IAArB;AAAA,MACC,uBAAmB;AAAA,MACnB,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AA0BO,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA4B;AAC1B,SACE,qBAAC,qBAAqB,MAArB,EAA0B,WAAW,GAAG,UAAU,SAAS,GAAI,GAAG,OACjE;AAAA,yBAAC,qBAAqB,SAArB,EAA6B,WAAU,+JACrC;AAAA;AAAA,MACD;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,eAAW;AAAA,UACX,WAAU;AAAA;AAAA,MACZ;AAAA,OACF;AAAA,IACA;AAAA,MAAC,qBAAqB;AAAA,MAArB;AAAA,QACC,uBAAmB;AAAA,QACnB,WAAU;AAAA,QAEV,8BAAC,SAAI,WAAU,QAAQ,UAAS;AAAA;AAAA,IAClC;AAAA,KACF;AAEJ;AAEA,IAAO,sBAAQ;","names":[]}
@@ -0,0 +1,67 @@
1
+ import * as react from 'react';
2
+
3
+ interface ColorPickerProps {
4
+ /**
5
+ * Names the control. Required — the trigger shows a colour, and a colour is
6
+ * not a name.
7
+ *
8
+ * Announced together with the value, the way `Select`'s is: a reader hears
9
+ * "Brand colour, #a78bfa". Inside a `Field` with a label, that label is used
10
+ * and this one is not repeated.
11
+ */
12
+ label: string;
13
+ /** The colour, as any absolute CSS colour string. */
14
+ value?: string;
15
+ defaultValue?: string;
16
+ /**
17
+ * Fires with a CSS colour string in whichever notation the panel is set to —
18
+ * so the notation a caller passes in is the notation they get back until
19
+ * somebody changes it in the panel.
20
+ */
21
+ onValueChange?: (value: string) => void;
22
+ disabled?: boolean;
23
+ /** Paints the resting border with `--danger` and reflects `aria-invalid`. */
24
+ invalid?: boolean;
25
+ className?: string;
26
+ /** The TRIGGER's id — the element a label points at. A `Field` sets it. */
27
+ id?: string;
28
+ /** Ids of the copy describing the control. A `Field` sets it from hint, error and description. */
29
+ 'aria-describedby'?: string;
30
+ /** The spelling a form library sets; read together with `invalid`. */
31
+ 'aria-invalid'?: boolean | 'true' | 'false';
32
+ /** Announced on the trigger. A `Field` sets it from `required`. */
33
+ 'aria-required'?: boolean;
34
+ }
35
+ /**
36
+ * A colour, chosen or typed.
37
+ *
38
+ * The panel works in OKLCH, and that is the reason to reach for this rather
39
+ * than `<input type="color">`. In HSV — which is what the native picker and
40
+ * most libraries use — dragging along a row of constant "lightness" walks
41
+ * through colours the eye reads as getting darker, so a reader tuning a palette
42
+ * is fighting the instrument. OKLCH's lightness is the one a person sees, so
43
+ * two colours at the same height on the plane genuinely match, and the hue
44
+ * strip stays at the lightness already chosen instead of showing a rainbow that
45
+ * belongs to some other colour.
46
+ *
47
+ * The plane is normalised to the gamut ROW BY ROW: its right edge is the most
48
+ * chroma that exists at that lightness and hue, so the whole surface is
49
+ * reachable rather than a lens of colour inside a field of clipped duplicates.
50
+ *
51
+ * **What it accepts.** Hex, `rgb()`, `hsl()`, `oklch()` and
52
+ * `color(display-p3 …)`, in both syntaxes. Named colours are not accepted:
53
+ * resolving them needs a table of every CSS name or a live DOM, and a box that
54
+ * takes "rebeccapurple" but not "papayawhip" is worse than one that takes
55
+ * neither.
56
+ *
57
+ * **Keyboard.** The plane is a group of two real sliders — chroma across,
58
+ * lightness up — so the arrows move it and a screen reader announces where it
59
+ * is. That is the part a 2D canvas usually leaves out, and leaving it out makes
60
+ * the control unusable rather than merely awkward.
61
+ *
62
+ * @example
63
+ * <Field label="Brand colour"><ColorPicker label="Brand colour" defaultValue="#a78bfa" /></Field>
64
+ */
65
+ declare function ColorPicker({ label, value: controlled, defaultValue, onValueChange, disabled, invalid, className, id, 'aria-describedby': describedBy, 'aria-invalid': ariaInvalid, 'aria-required': ariaRequired, }: ColorPickerProps): react.JSX.Element;
66
+
67
+ export { ColorPicker, type ColorPickerProps, ColorPicker as default };