@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,130 @@
1
+ import * as react from 'react';
2
+ import { ComponentProps } from 'react';
3
+ import { DateRange } from 'react-day-picker';
4
+ export { DateRange } from 'react-day-picker';
5
+ import { Calendar } from '../Calendar/Calendar.js';
6
+
7
+ /** A named shortcut in the rail beside the calendar. */
8
+ interface DatePreset<T> {
9
+ label: string;
10
+ /** Computed when clicked, not when rendered — "today" must mean today. */
11
+ value: () => T;
12
+ }
13
+ /**
14
+ * The shortcuts a range picker is asked for on nearly every screen it appears
15
+ * on, so they ship rather than being rebuilt per dashboard.
16
+ *
17
+ * Computed on click: a preset list built at render time freezes "today" at
18
+ * whenever the page loaded, which is wrong for anything left open overnight.
19
+ */
20
+ declare const RANGE_PRESETS: DatePreset<DateRange>[];
21
+ /** The single-date equivalent. */
22
+ declare const DATE_PRESETS: DatePreset<Date>[];
23
+ interface DatePickerProps {
24
+ value?: Date;
25
+ defaultValue?: Date;
26
+ onValueChange?: (value: Date | undefined) => void;
27
+ /**
28
+ * Names the control. Required — the trigger's text is a value, not a label.
29
+ *
30
+ * Announced together with the printed date rather than instead of it, so
31
+ * `format` reaches a screen reader as well as the screen. Inside a `Field`
32
+ * with a label, that label names the trigger and this one is not repeated.
33
+ */
34
+ label: string;
35
+ placeholder?: string;
36
+ disabled?: boolean;
37
+ /**
38
+ * Days the reader may not choose.
39
+ *
40
+ * Reaches the calendar AND the shortcut rail: a preset landing on a blocked
41
+ * day is drawn unavailable and refuses the click, rather than committing a
42
+ * value the grid beside it would not accept.
43
+ */
44
+ disabledDates?: ComponentProps<typeof Calendar>['disabled'];
45
+ /** How the chosen date is printed on the trigger. */
46
+ format?: (date: Date) => string;
47
+ /**
48
+ * Shortcuts shown beside the grid. Pass `true` for the built-in set, an array
49
+ * for your own, or leave it off for none.
50
+ */
51
+ presets?: boolean | DatePreset<Date>[];
52
+ className?: string;
53
+ /** The TRIGGER's id — the element a label points at. A `Field` sets it. */
54
+ id?: string;
55
+ /** Ids of the copy describing the control. A `Field` sets it from hint, error and description. */
56
+ 'aria-describedby'?: string;
57
+ /** Announced on the trigger. A `Field` sets it from `error`. */
58
+ 'aria-invalid'?: boolean | 'true' | 'false';
59
+ }
60
+ /**
61
+ * A date, chosen from a calendar.
62
+ *
63
+ * A trigger and a `Calendar` in a `Popover` — not a new component so much as
64
+ * the composition people otherwise assemble slightly differently on every
65
+ * screen.
66
+ *
67
+ * It is deliberately NOT a text input with a calendar attached. A typed date
68
+ * needs parsing, and parsing needs a format, and a format is a locale argument
69
+ * nobody wins. When typing genuinely matters — a birth date, a long way back —
70
+ * the calendar's month and year are dropdowns, which is the same journey
71
+ * without the ambiguity.
72
+ *
73
+ * @example
74
+ * <Field label="Publish on"><DatePicker label="Publish on" /></Field>
75
+ */
76
+ declare function DatePicker({ value, defaultValue, onValueChange, label, placeholder, disabled, disabledDates, format, presets, className, id, 'aria-describedby': describedBy, 'aria-invalid': ariaInvalid, }: DatePickerProps): react.JSX.Element;
77
+ interface DateRangePickerProps {
78
+ value?: DateRange;
79
+ defaultValue?: DateRange;
80
+ onValueChange?: (value: DateRange | undefined) => void;
81
+ /** Names the control. Announced together with the printed range, not instead of it. */
82
+ label: string;
83
+ placeholder?: string;
84
+ disabled?: boolean;
85
+ /**
86
+ * Days the reader may not choose.
87
+ *
88
+ * Reaches the shortcut rail as well as the grid, at the ENDS of each preset
89
+ * range — a shortcut whose interior straddles a blocked day is still offered,
90
+ * the way the grid still lets a reader drag a range across one.
91
+ */
92
+ disabledDates?: ComponentProps<typeof Calendar>['disabled'];
93
+ /** How many months are shown side by side. Falls back to one under `sm`. */
94
+ months?: number;
95
+ format?: (date: Date) => string;
96
+ /**
97
+ * Shortcuts shown beside the grid — Last 30 days and its neighbours. `true`
98
+ * for the built-in set, an array for your own.
99
+ *
100
+ * On by default here and off on the single picker, because "last 30 days" is
101
+ * most of what a range picker is ever asked for, while a single date is
102
+ * usually a specific one.
103
+ */
104
+ presets?: boolean | DatePreset<DateRange>[];
105
+ className?: string;
106
+ /** The TRIGGER's id — the element a label points at. A `Field` sets it. */
107
+ id?: string;
108
+ /** Ids of the copy describing the control. A `Field` sets it from hint, error and description. */
109
+ 'aria-describedby'?: string;
110
+ /** Announced on the trigger. A `Field` sets it from `error`. */
111
+ 'aria-invalid'?: boolean | 'true' | 'false';
112
+ }
113
+ /**
114
+ * A span of dates — a stay, a reporting period, a filter.
115
+ *
116
+ * Two months side by side, because a range that crosses a month boundary is the
117
+ * common case, and paging back and forth to see both ends is what makes a range
118
+ * picker tiring. They stack under `sm`, where two would not fit — the calendar's
119
+ * own `months` class already carries that, so there is nothing to override.
120
+ *
121
+ * The panel stays open until both ends are chosen: a range is not a value until
122
+ * it has a second date, and closing on the first one would mean re-opening to
123
+ * finish.
124
+ *
125
+ * @example
126
+ * <DateRangePicker label="Reporting period" />
127
+ */
128
+ declare function DateRangePicker({ value, defaultValue, onValueChange, label, placeholder, disabled, disabledDates, months, format, presets, className, id, 'aria-describedby': describedBy, 'aria-invalid': ariaInvalid, }: DateRangePickerProps): react.JSX.Element;
129
+
130
+ export { DATE_PRESETS, DatePicker, type DatePickerProps, type DatePreset, DateRangePicker, type DateRangePickerProps, RANGE_PRESETS, DatePicker as default };
@@ -0,0 +1,257 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { RiCalendarLine } from "@remixicon/react";
4
+ import { useId, useRef, useState } from "react";
5
+ import { dateMatchModifiers } from "react-day-picker";
6
+ import { cn } from "../../lib/cn.js";
7
+ import { Calendar } from "../Calendar/Calendar.js";
8
+ import { useFieldControl } from "../Field/field-control.js";
9
+ import { Popover, PopoverContent, PopoverTrigger } from "../Popover/Popover.js";
10
+ const daysAgo = (n) => {
11
+ const to = /* @__PURE__ */ new Date();
12
+ const from = /* @__PURE__ */ new Date();
13
+ from.setDate(from.getDate() - (n - 1));
14
+ return { from, to };
15
+ };
16
+ const RANGE_PRESETS = [
17
+ { label: "Last 7 days", value: () => daysAgo(7) },
18
+ { label: "Last 30 days", value: () => daysAgo(30) },
19
+ { label: "Last 90 days", value: () => daysAgo(90) },
20
+ { label: "Last 12 months", value: () => daysAgo(365) },
21
+ {
22
+ label: "Month to date",
23
+ value: () => {
24
+ const to = /* @__PURE__ */ new Date();
25
+ return { from: new Date(to.getFullYear(), to.getMonth(), 1), to };
26
+ }
27
+ },
28
+ {
29
+ label: "Year to date",
30
+ value: () => {
31
+ const to = /* @__PURE__ */ new Date();
32
+ return { from: new Date(to.getFullYear(), 0, 1), to };
33
+ }
34
+ }
35
+ ];
36
+ const DATE_PRESETS = [
37
+ { label: "Today", value: () => /* @__PURE__ */ new Date() },
38
+ {
39
+ label: "Tomorrow",
40
+ value: () => {
41
+ const date = /* @__PURE__ */ new Date();
42
+ date.setDate(date.getDate() + 1);
43
+ return date;
44
+ }
45
+ },
46
+ {
47
+ label: "In a week",
48
+ value: () => {
49
+ const date = /* @__PURE__ */ new Date();
50
+ date.setDate(date.getDate() + 7);
51
+ return date;
52
+ }
53
+ },
54
+ {
55
+ label: "In a month",
56
+ value: () => {
57
+ const date = /* @__PURE__ */ new Date();
58
+ date.setMonth(date.getMonth() + 1);
59
+ return date;
60
+ }
61
+ }
62
+ ];
63
+ function PresetRail({
64
+ presets,
65
+ onPick,
66
+ label,
67
+ blocked
68
+ }) {
69
+ return /* @__PURE__ */ jsx(
70
+ "div",
71
+ {
72
+ role: "group",
73
+ "aria-label": label,
74
+ className: "flex shrink-0 flex-col gap-0.5 border-b border-(--rule) p-2 sm:border-b-0 sm:border-e max-sm:flex-row max-sm:flex-wrap",
75
+ children: presets.map((preset) => /* @__PURE__ */ jsx(
76
+ "button",
77
+ {
78
+ type: "button",
79
+ disabled: blocked?.(preset.value()) ?? false,
80
+ onClick: () => {
81
+ const next = preset.value();
82
+ if (blocked?.(next)) return;
83
+ onPick(next);
84
+ },
85
+ className: "rounded-(--radius-sm) px-2.5 py-1.5 text-start text-[13px] text-(--ink-2) transition-colors duration-(--duration-fast) hover:bg-(--stone) hover:text-(--ink) disabled:opacity-(--disabled-opacity) disabled:pointer-events-none",
86
+ children: preset.label
87
+ },
88
+ preset.label
89
+ ))
90
+ }
91
+ );
92
+ }
93
+ const TRIGGER = "flex w-full items-center justify-between gap-2 rounded-(--radius) border border-(--rule-2) bg-(--paper) px-(--field-px) py-(--field-py) text-start text-sm transition-colors duration-(--duration-fast) hover:border-(--rule-hard) disabled:opacity-(--disabled-opacity) disabled:pointer-events-none";
94
+ const formatDate = (date) => new Intl.DateTimeFormat(void 0, { dateStyle: "medium" }).format(date);
95
+ function DatePicker({
96
+ value,
97
+ defaultValue,
98
+ onValueChange,
99
+ label,
100
+ placeholder = "Pick a date",
101
+ disabled = false,
102
+ disabledDates,
103
+ format = formatDate,
104
+ presets,
105
+ className,
106
+ id,
107
+ "aria-describedby": describedBy,
108
+ "aria-invalid": ariaInvalid
109
+ }) {
110
+ const rail = presets === true ? DATE_PRESETS : presets || void 0;
111
+ const [open, setOpen] = useState(false);
112
+ const [uncontrolled, setUncontrolled] = useState(defaultValue);
113
+ const current = value ?? uncontrolled;
114
+ const field = useFieldControl();
115
+ const generated = useId();
116
+ const triggerId = id ?? generated;
117
+ const valueId = `${triggerId}-value`;
118
+ const nameId = field?.labelId ?? `${triggerId}-name`;
119
+ const choose = (next) => {
120
+ if (value === void 0) setUncontrolled(next);
121
+ onValueChange?.(next);
122
+ if (next) setOpen(false);
123
+ };
124
+ const refuses = (date) => disabledDates !== void 0 && dateMatchModifiers(date, disabledDates);
125
+ return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
126
+ /* @__PURE__ */ jsxs(
127
+ PopoverTrigger,
128
+ {
129
+ id: triggerId,
130
+ "aria-labelledby": `${nameId} ${valueId}`,
131
+ "aria-describedby": describedBy,
132
+ "aria-invalid": ariaInvalid || void 0,
133
+ disabled,
134
+ className: cn(TRIGGER, current ? "text-(--ink)" : "text-(--ink-3-aa)", className),
135
+ children: [
136
+ field?.labelId == null && /* @__PURE__ */ jsx("span", { id: nameId, className: "sr-only", children: label }),
137
+ /* @__PURE__ */ jsx("span", { id: valueId, className: "truncate", children: current ? format(current) : placeholder }),
138
+ /* @__PURE__ */ jsx(RiCalendarLine, { size: 14, "aria-hidden": true, className: "shrink-0 text-(--ink-3-aa)" })
139
+ ]
140
+ }
141
+ ),
142
+ /* @__PURE__ */ jsx(PopoverContent, { label, align: "start", className: "w-auto overflow-hidden p-0", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row", children: [
143
+ rail && /* @__PURE__ */ jsx(
144
+ PresetRail,
145
+ {
146
+ presets: rail,
147
+ onPick: choose,
148
+ label: `${label} shortcuts`,
149
+ blocked: refuses
150
+ }
151
+ ),
152
+ /* @__PURE__ */ jsx(
153
+ Calendar,
154
+ {
155
+ mode: "single",
156
+ selected: current,
157
+ onSelect: choose,
158
+ disabled: disabledDates,
159
+ autoFocus: true
160
+ }
161
+ )
162
+ ] }) })
163
+ ] });
164
+ }
165
+ function DateRangePicker({
166
+ value,
167
+ defaultValue,
168
+ onValueChange,
169
+ label,
170
+ placeholder = "Pick a range",
171
+ disabled = false,
172
+ disabledDates,
173
+ months = 2,
174
+ format = formatDate,
175
+ presets = true,
176
+ className,
177
+ id,
178
+ "aria-describedby": describedBy,
179
+ "aria-invalid": ariaInvalid
180
+ }) {
181
+ const rail = presets === true ? RANGE_PRESETS : presets || void 0;
182
+ const [open, setOpen] = useState(false);
183
+ const [uncontrolled, setUncontrolled] = useState(defaultValue);
184
+ const current = value ?? uncontrolled;
185
+ const field = useFieldControl();
186
+ const generated = useId();
187
+ const triggerId = id ?? generated;
188
+ const valueId = `${triggerId}-value`;
189
+ const nameId = field?.labelId ?? `${triggerId}-name`;
190
+ const refuses = (range) => disabledDates !== void 0 && [range.from, range.to].some((date) => date != null && dateMatchModifiers(date, disabledDates));
191
+ const clicks = useRef(0);
192
+ const choose = (next) => {
193
+ clicks.current += 1;
194
+ if (value === void 0) setUncontrolled(next);
195
+ onValueChange?.(next);
196
+ if (clicks.current >= 2 && next?.from && next.to) setOpen(false);
197
+ };
198
+ const setPanel = (next) => {
199
+ if (next) clicks.current = 0;
200
+ setOpen(next);
201
+ };
202
+ const complete = current?.from && current.to && current.from.getTime() !== current.to.getTime();
203
+ const printed = current?.from ? complete ? `${format(current.from)} \u2013 ${format(current.to)}` : `${format(current.from)} \u2013 \u2026` : placeholder;
204
+ return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setPanel, children: [
205
+ /* @__PURE__ */ jsxs(
206
+ PopoverTrigger,
207
+ {
208
+ id: triggerId,
209
+ "aria-labelledby": `${nameId} ${valueId}`,
210
+ "aria-describedby": describedBy,
211
+ "aria-invalid": ariaInvalid || void 0,
212
+ disabled,
213
+ className: cn(TRIGGER, current?.from ? "text-(--ink)" : "text-(--ink-3-aa)", className),
214
+ children: [
215
+ field?.labelId == null && /* @__PURE__ */ jsx("span", { id: nameId, className: "sr-only", children: label }),
216
+ /* @__PURE__ */ jsx("span", { id: valueId, className: "truncate", children: printed }),
217
+ /* @__PURE__ */ jsx(RiCalendarLine, { size: 14, "aria-hidden": true, className: "shrink-0 text-(--ink-3-aa)" })
218
+ ]
219
+ }
220
+ ),
221
+ /* @__PURE__ */ jsx(PopoverContent, { label, align: "start", className: "w-auto overflow-hidden p-0", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row", children: [
222
+ rail && /* @__PURE__ */ jsx(
223
+ PresetRail,
224
+ {
225
+ presets: rail,
226
+ onPick: (next) => {
227
+ if (value === void 0) setUncontrolled(next);
228
+ onValueChange?.(next);
229
+ setOpen(false);
230
+ },
231
+ label: `${label} shortcuts`,
232
+ blocked: refuses
233
+ }
234
+ ),
235
+ /* @__PURE__ */ jsx(
236
+ Calendar,
237
+ {
238
+ mode: "range",
239
+ selected: current,
240
+ onSelect: choose,
241
+ disabled: disabledDates,
242
+ numberOfMonths: months,
243
+ autoFocus: true
244
+ }
245
+ )
246
+ ] }) })
247
+ ] });
248
+ }
249
+ var DatePicker_default = DatePicker;
250
+ export {
251
+ DATE_PRESETS,
252
+ DatePicker,
253
+ DateRangePicker,
254
+ RANGE_PRESETS,
255
+ DatePicker_default as default
256
+ };
257
+ //# sourceMappingURL=DatePicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/DatePicker/DatePicker.tsx"],"sourcesContent":["'use client'\n\nimport { RiCalendarLine } from '@remixicon/react'\nimport { useId, useRef, useState, type ComponentProps } from 'react'\nimport { dateMatchModifiers, type DateRange } from 'react-day-picker'\nimport { cn } from '../../lib/cn'\nimport { Calendar } from '../Calendar/Calendar'\nimport { useFieldControl } from '../Field/field-control'\nimport { Popover, PopoverContent, PopoverTrigger } from '../Popover/Popover'\n\nexport type { DateRange }\n\n/** A named shortcut in the rail beside the calendar. */\nexport interface DatePreset<T> {\n label: string\n /** Computed when clicked, not when rendered — \"today\" must mean today. */\n value: () => T\n}\n\n/** `n` days back from today, inclusive of today. */\nconst daysAgo = (n: number): DateRange => {\n const to = new Date()\n const from = new Date()\n from.setDate(from.getDate() - (n - 1))\n return { from, to }\n}\n\n/**\n * The shortcuts a range picker is asked for on nearly every screen it appears\n * on, so they ship rather than being rebuilt per dashboard.\n *\n * Computed on click: a preset list built at render time freezes \"today\" at\n * whenever the page loaded, which is wrong for anything left open overnight.\n */\nexport const RANGE_PRESETS: DatePreset<DateRange>[] = [\n { label: 'Last 7 days', value: () => daysAgo(7) },\n { label: 'Last 30 days', value: () => daysAgo(30) },\n { label: 'Last 90 days', value: () => daysAgo(90) },\n { label: 'Last 12 months', value: () => daysAgo(365) },\n {\n label: 'Month to date',\n value: () => {\n const to = new Date()\n return { from: new Date(to.getFullYear(), to.getMonth(), 1), to }\n },\n },\n {\n label: 'Year to date',\n value: () => {\n const to = new Date()\n return { from: new Date(to.getFullYear(), 0, 1), to }\n },\n },\n]\n\n/** The single-date equivalent. */\nexport const DATE_PRESETS: DatePreset<Date>[] = [\n { label: 'Today', value: () => new Date() },\n {\n label: 'Tomorrow',\n value: () => {\n const date = new Date()\n date.setDate(date.getDate() + 1)\n return date\n },\n },\n {\n label: 'In a week',\n value: () => {\n const date = new Date()\n date.setDate(date.getDate() + 7)\n return date\n },\n },\n {\n label: 'In a month',\n value: () => {\n const date = new Date()\n date.setMonth(date.getMonth() + 1)\n return date\n },\n },\n]\n\n/**\n * The rail of shortcuts.\n *\n * A `<nav>`-less list of plain buttons rather than a menu: they set the same\n * value the grid beside them sets, so they are part of one control and should\n * Tab in the same pass rather than opening something.\n *\n * Setting the same value means being refused for the same reasons: a shortcut\n * that commits a date the grid beside it will not accept hands the caller back\n * a value the control itself calls invalid. `blocked` is asked at render, so the\n * button is visibly unavailable rather than silently inert, and again on click,\n * because the value is computed then — \"today\" has to mean today.\n */\nfunction PresetRail<T>({\n presets,\n onPick,\n label,\n blocked,\n}: {\n presets: DatePreset<T>[]\n onPick: (value: T) => void\n label: string\n blocked?: (value: T) => boolean\n}) {\n return (\n <div\n role=\"group\"\n aria-label={label}\n className=\"flex shrink-0 flex-col gap-0.5 border-b border-(--rule) p-2 sm:border-b-0 sm:border-e max-sm:flex-row max-sm:flex-wrap\"\n >\n {presets.map((preset) => (\n <button\n key={preset.label}\n type=\"button\"\n disabled={blocked?.(preset.value()) ?? false}\n onClick={() => {\n const next = preset.value()\n if (blocked?.(next)) return\n onPick(next)\n }}\n className=\"rounded-(--radius-sm) px-2.5 py-1.5 text-start text-[13px] text-(--ink-2) transition-colors duration-(--duration-fast) hover:bg-(--stone) hover:text-(--ink) disabled:opacity-(--disabled-opacity) disabled:pointer-events-none\"\n >\n {preset.label}\n </button>\n ))}\n </div>\n )\n}\n\nconst TRIGGER =\n 'flex w-full items-center justify-between gap-2 rounded-(--radius) border border-(--rule-2) bg-(--paper) px-(--field-px) py-(--field-py) text-start text-sm transition-colors duration-(--duration-fast) hover:border-(--rule-hard) disabled:opacity-(--disabled-opacity) disabled:pointer-events-none'\n\n/**\n * The visitor's own locale, not a fixed `dd/mm/yyyy`.\n *\n * `03/04` is March the fourth in one country and the third of April in the\n * next, and there is no format that is unambiguous to everyone. `Intl` already\n * knows which one this reader expects.\n */\nconst formatDate = (date: Date) =>\n new Intl.DateTimeFormat(undefined, { dateStyle: 'medium' }).format(date)\n\nexport interface DatePickerProps {\n value?: Date\n defaultValue?: Date\n onValueChange?: (value: Date | undefined) => void\n /**\n * Names the control. Required — the trigger's text is a value, not a label.\n *\n * Announced together with the printed date rather than instead of it, so\n * `format` reaches a screen reader as well as the screen. Inside a `Field`\n * with a label, that label names the trigger and this one is not repeated.\n */\n label: string\n placeholder?: string\n disabled?: boolean\n /**\n * Days the reader may not choose.\n *\n * Reaches the calendar AND the shortcut rail: a preset landing on a blocked\n * day is drawn unavailable and refuses the click, rather than committing a\n * value the grid beside it would not accept.\n */\n disabledDates?: ComponentProps<typeof Calendar>['disabled']\n /** How the chosen date is printed on the trigger. */\n format?: (date: Date) => string\n /**\n * Shortcuts shown beside the grid. Pass `true` for the built-in set, an array\n * for your own, or leave it off for none.\n */\n presets?: boolean | DatePreset<Date>[]\n className?: string\n /** The TRIGGER's id — the element a label points at. A `Field` sets it. */\n id?: string\n /** Ids of the copy describing the control. A `Field` sets it from hint, error and description. */\n 'aria-describedby'?: string\n /** Announced on the trigger. A `Field` sets it from `error`. */\n 'aria-invalid'?: boolean | 'true' | 'false'\n}\n\n/**\n * A date, chosen from a calendar.\n *\n * A trigger and a `Calendar` in a `Popover` — not a new component so much as\n * the composition people otherwise assemble slightly differently on every\n * screen.\n *\n * It is deliberately NOT a text input with a calendar attached. A typed date\n * needs parsing, and parsing needs a format, and a format is a locale argument\n * nobody wins. When typing genuinely matters — a birth date, a long way back —\n * the calendar's month and year are dropdowns, which is the same journey\n * without the ambiguity.\n *\n * @example\n * <Field label=\"Publish on\"><DatePicker label=\"Publish on\" /></Field>\n */\nexport function DatePicker({\n value,\n defaultValue,\n onValueChange,\n label,\n placeholder = 'Pick a date',\n disabled = false,\n disabledDates,\n format = formatDate,\n presets,\n className,\n id,\n 'aria-describedby': describedBy,\n 'aria-invalid': ariaInvalid,\n}: DatePickerProps) {\n const rail = presets === true ? DATE_PRESETS : presets || undefined\n const [open, setOpen] = useState(false)\n const [uncontrolled, setUncontrolled] = useState<Date | undefined>(defaultValue)\n const current = value ?? uncontrolled\n\n const field = useFieldControl()\n const generated = useId()\n const triggerId = id ?? generated\n const valueId = `${triggerId}-value`\n const nameId = field?.labelId ?? `${triggerId}-name`\n\n const choose = (next: Date | undefined) => {\n if (value === undefined) setUncontrolled(next)\n onValueChange?.(next)\n if (next) setOpen(false)\n }\n\n const refuses = (date: Date) =>\n disabledDates !== undefined && dateMatchModifiers(date, disabledDates)\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n id={triggerId}\n // The label and the printed date, in that order. `aria-label` outranked\n // the trigger's own text, so `format` reached the screen and nothing\n // else — the chosen date was invisible to a screen reader.\n aria-labelledby={`${nameId} ${valueId}`}\n aria-describedby={describedBy}\n aria-invalid={ariaInvalid || undefined}\n disabled={disabled}\n className={cn(TRIGGER, current ? 'text-(--ink)' : 'text-(--ink-3-aa)', className)}\n >\n {field?.labelId == null && (\n <span id={nameId} className=\"sr-only\">\n {label}\n </span>\n )}\n <span id={valueId} className=\"truncate\">\n {current ? format(current) : placeholder}\n </span>\n <RiCalendarLine size={14} aria-hidden className=\"shrink-0 text-(--ink-3-aa)\" />\n </PopoverTrigger>\n <PopoverContent label={label} align=\"start\" className=\"w-auto overflow-hidden p-0\">\n <div className=\"flex flex-col sm:flex-row\">\n {rail && (\n <PresetRail\n presets={rail}\n onPick={choose}\n label={`${label} shortcuts`}\n blocked={refuses}\n />\n )}\n <Calendar\n mode=\"single\"\n selected={current}\n onSelect={choose}\n disabled={disabledDates}\n autoFocus\n />\n </div>\n </PopoverContent>\n </Popover>\n )\n}\n\nexport interface DateRangePickerProps {\n value?: DateRange\n defaultValue?: DateRange\n onValueChange?: (value: DateRange | undefined) => void\n /** Names the control. Announced together with the printed range, not instead of it. */\n label: string\n placeholder?: string\n disabled?: boolean\n /**\n * Days the reader may not choose.\n *\n * Reaches the shortcut rail as well as the grid, at the ENDS of each preset\n * range — a shortcut whose interior straddles a blocked day is still offered,\n * the way the grid still lets a reader drag a range across one.\n */\n disabledDates?: ComponentProps<typeof Calendar>['disabled']\n /** How many months are shown side by side. Falls back to one under `sm`. */\n months?: number\n format?: (date: Date) => string\n /**\n * Shortcuts shown beside the grid — Last 30 days and its neighbours. `true`\n * for the built-in set, an array for your own.\n *\n * On by default here and off on the single picker, because \"last 30 days\" is\n * most of what a range picker is ever asked for, while a single date is\n * usually a specific one.\n */\n presets?: boolean | DatePreset<DateRange>[]\n className?: string\n /** The TRIGGER's id — the element a label points at. A `Field` sets it. */\n id?: string\n /** Ids of the copy describing the control. A `Field` sets it from hint, error and description. */\n 'aria-describedby'?: string\n /** Announced on the trigger. A `Field` sets it from `error`. */\n 'aria-invalid'?: boolean | 'true' | 'false'\n}\n\n/**\n * A span of dates — a stay, a reporting period, a filter.\n *\n * Two months side by side, because a range that crosses a month boundary is the\n * common case, and paging back and forth to see both ends is what makes a range\n * picker tiring. They stack under `sm`, where two would not fit — the calendar's\n * own `months` class already carries that, so there is nothing to override.\n *\n * The panel stays open until both ends are chosen: a range is not a value until\n * it has a second date, and closing on the first one would mean re-opening to\n * finish.\n *\n * @example\n * <DateRangePicker label=\"Reporting period\" />\n */\nexport function DateRangePicker({\n value,\n defaultValue,\n onValueChange,\n label,\n placeholder = 'Pick a range',\n disabled = false,\n disabledDates,\n months = 2,\n format = formatDate,\n presets = true,\n className,\n id,\n 'aria-describedby': describedBy,\n 'aria-invalid': ariaInvalid,\n}: DateRangePickerProps) {\n const rail = presets === true ? RANGE_PRESETS : presets || undefined\n const [open, setOpen] = useState(false)\n const [uncontrolled, setUncontrolled] = useState<DateRange | undefined>(defaultValue)\n const current = value ?? uncontrolled\n\n const field = useFieldControl()\n const generated = useId()\n const triggerId = id ?? generated\n const valueId = `${triggerId}-value`\n const nameId = field?.labelId ?? `${triggerId}-name`\n\n const refuses = (range: DateRange) =>\n disabledDates !== undefined &&\n [range.from, range.to].some((date) => date != null && dateMatchModifiers(date, disabledDates))\n\n /**\n * How many days have been clicked since the panel opened.\n *\n * Counted, rather than inferred from the range being \"complete\", because the\n * first click returns `{ from: day, to: day }` — a complete range by any\n * reading of the value. Closing on that meant every attempt at a range\n * produced a one-day one and shut the panel, which is the opposite of what a\n * range picker is for.\n */\n const clicks = useRef(0)\n\n const choose = (next: DateRange | undefined) => {\n clicks.current += 1\n if (value === undefined) setUncontrolled(next)\n onValueChange?.(next)\n if (clicks.current >= 2 && next?.from && next.to) setOpen(false)\n }\n\n const setPanel = (next: boolean) => {\n if (next) clicks.current = 0\n setOpen(next)\n }\n\n const complete = current?.from && current.to && current.from.getTime() !== current.to.getTime()\n const printed = current?.from\n ? complete\n ? `${format(current.from)} – ${format(current.to!)}`\n : `${format(current.from)} – …`\n : placeholder\n\n return (\n <Popover open={open} onOpenChange={setPanel}>\n <PopoverTrigger\n id={triggerId}\n // The label and the printed range together — see DatePicker above.\n aria-labelledby={`${nameId} ${valueId}`}\n aria-describedby={describedBy}\n aria-invalid={ariaInvalid || undefined}\n disabled={disabled}\n className={cn(TRIGGER, current?.from ? 'text-(--ink)' : 'text-(--ink-3-aa)', className)}\n >\n {field?.labelId == null && (\n <span id={nameId} className=\"sr-only\">\n {label}\n </span>\n )}\n <span id={valueId} className=\"truncate\">\n {printed}\n </span>\n <RiCalendarLine size={14} aria-hidden className=\"shrink-0 text-(--ink-3-aa)\" />\n </PopoverTrigger>\n <PopoverContent label={label} align=\"start\" className=\"w-auto overflow-hidden p-0\">\n <div className=\"flex flex-col sm:flex-row\">\n {rail && (\n <PresetRail\n presets={rail}\n onPick={(next) => {\n // A preset is a complete range in one gesture, so the panel\n // closes — unlike a first click on the grid, which is half an\n // answer.\n if (value === undefined) setUncontrolled(next)\n onValueChange?.(next)\n setOpen(false)\n }}\n label={`${label} shortcuts`}\n blocked={refuses}\n />\n )}\n <Calendar\n mode=\"range\"\n selected={current}\n onSelect={choose}\n disabled={disabledDates}\n numberOfMonths={months}\n autoFocus\n />\n </div>\n </PopoverContent>\n </Popover>\n )\n}\n\nexport default DatePicker\n"],"mappings":"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","names":[]}
@@ -0,0 +1,73 @@
1
+ import * as react from 'react';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
+
4
+ interface DescriptionListItem {
5
+ /**
6
+ * A stable key. Optional: the index is used when it is absent, which is
7
+ * correct for the fixed field list a record page renders and wrong for a list
8
+ * whose rows are added, removed or reordered — pass it there.
9
+ */
10
+ id?: string;
11
+ /** The label. Rendered as a `<dt>`. */
12
+ term: ReactNode;
13
+ /** The value. Rendered as a `<dd>`, so it can be a `Badge` or a link. */
14
+ description: ReactNode;
15
+ }
16
+ /**
17
+ * Where the value sits relative to its label.
18
+ *
19
+ * `row` is the record-page shape: label in a fixed column at the inline start,
20
+ * value beside it, so a reader scans the labels down one edge. It collapses to
21
+ * one column under the `sm` breakpoint, because a 12rem label column on a phone
22
+ * leaves the value about eight characters wide.
23
+ *
24
+ * `stacked` puts the value under its label at every width — the right answer
25
+ * inside a card or a sidebar that is narrow by design rather than by viewport.
26
+ */
27
+ type DescriptionListLayout = 'row' | 'stacked';
28
+ interface DescriptionListProps extends HTMLAttributes<HTMLDListElement> {
29
+ /** The pairs, in the order they should read. An empty array renders nothing. */
30
+ items: DescriptionListItem[];
31
+ /** How the value sits relative to its label. See {@link DescriptionListLayout}. */
32
+ layout?: DescriptionListLayout;
33
+ /**
34
+ * Draws a hairline under every pair but the last. Off for a list inside a
35
+ * card that already has an edge, on for a list that is the page's structure.
36
+ */
37
+ divided?: boolean;
38
+ }
39
+ /**
40
+ * A record's fields: label, value, label, value.
41
+ *
42
+ * The single most repeated shape in any detail page, and the one most often
43
+ * hand-built out of a `<div>` grid — which loses the only thing the markup was
44
+ * carrying. A `<dl>` tells a screen reader that "Owner" names the thing beside
45
+ * it; a grid of divs tells it there are two columns of unrelated text, and the
46
+ * reader has to infer the pairing from reading order alone.
47
+ *
48
+ * Reach for `Table` instead when there are several records. This is one record
49
+ * seen from the front; a table is many records seen from above.
50
+ *
51
+ * Each pair is wrapped in a `<div>` — which the HTML specification allows
52
+ * inside a `<dl>` precisely so a pair can be laid out as a unit — so the
53
+ * hairline runs the full width of the row rather than stopping in the column
54
+ * gap.
55
+ *
56
+ * An empty `items` renders `null` rather than an empty bordered box. A record
57
+ * with no fields is a state the page above should be handling with an
58
+ * `EmptyState`, and a hairline around nothing looks like a component that
59
+ * failed to load.
60
+ *
61
+ * @example
62
+ * <DescriptionList
63
+ * items={[
64
+ * { term: 'Owner', description: 'Henry Chen' },
65
+ * { term: 'Status', description: <Badge tone="success">Deployed</Badge> },
66
+ * ]}
67
+ * />
68
+ * @example
69
+ * <DescriptionList layout="stacked" divided={false} items={fields} />
70
+ */
71
+ declare function DescriptionList({ items, layout, divided, className, ...rest }: DescriptionListProps): react.JSX.Element | null;
72
+
73
+ export { DescriptionList, type DescriptionListItem, type DescriptionListLayout, type DescriptionListProps, DescriptionList as default };
@@ -0,0 +1,35 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../../lib/cn.js";
3
+ const LAYOUT = {
4
+ row: "grid gap-x-6 gap-y-1 sm:grid-cols-[minmax(0,12rem)_minmax(0,1fr)]",
5
+ stacked: "grid gap-y-1"
6
+ };
7
+ function DescriptionList({
8
+ items,
9
+ layout = "row",
10
+ divided = true,
11
+ className,
12
+ ...rest
13
+ }) {
14
+ if (items.length === 0) return null;
15
+ return /* @__PURE__ */ jsx("dl", { className: cn("m-0", !divided && "flex flex-col gap-3", className), ...rest, children: items.map((item, index) => /* @__PURE__ */ jsxs(
16
+ "div",
17
+ {
18
+ className: cn(
19
+ LAYOUT[layout],
20
+ divided && "border-b border-(--rule) py-3 first:pt-0 last:border-b-0 last:pb-0"
21
+ ),
22
+ children: [
23
+ /* @__PURE__ */ jsx("dt", { className: "text-sm text-(--ink-3-aa)", children: item.term }),
24
+ /* @__PURE__ */ jsx("dd", { className: "m-0 text-sm text-(--ink-2)", children: item.description })
25
+ ]
26
+ },
27
+ item.id ?? index
28
+ )) });
29
+ }
30
+ var DescriptionList_default = DescriptionList;
31
+ export {
32
+ DescriptionList,
33
+ DescriptionList_default as default
34
+ };
35
+ //# sourceMappingURL=DescriptionList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/DescriptionList/DescriptionList.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react'\nimport { cn } from '../../lib/cn'\n\nexport interface DescriptionListItem {\n /**\n * A stable key. Optional: the index is used when it is absent, which is\n * correct for the fixed field list a record page renders and wrong for a list\n * whose rows are added, removed or reordered — pass it there.\n */\n id?: string\n /** The label. Rendered as a `<dt>`. */\n term: ReactNode\n /** The value. Rendered as a `<dd>`, so it can be a `Badge` or a link. */\n description: ReactNode\n}\n\n/**\n * Where the value sits relative to its label.\n *\n * `row` is the record-page shape: label in a fixed column at the inline start,\n * value beside it, so a reader scans the labels down one edge. It collapses to\n * one column under the `sm` breakpoint, because a 12rem label column on a phone\n * leaves the value about eight characters wide.\n *\n * `stacked` puts the value under its label at every width — the right answer\n * inside a card or a sidebar that is narrow by design rather than by viewport.\n */\nexport type DescriptionListLayout = 'row' | 'stacked'\n\nexport interface DescriptionListProps extends HTMLAttributes<HTMLDListElement> {\n /** The pairs, in the order they should read. An empty array renders nothing. */\n items: DescriptionListItem[]\n /** How the value sits relative to its label. See {@link DescriptionListLayout}. */\n layout?: DescriptionListLayout\n /**\n * Draws a hairline under every pair but the last. Off for a list inside a\n * card that already has an edge, on for a list that is the page's structure.\n */\n divided?: boolean\n}\n\nconst LAYOUT: Record<DescriptionListLayout, string> = {\n row: 'grid gap-x-6 gap-y-1 sm:grid-cols-[minmax(0,12rem)_minmax(0,1fr)]',\n stacked: 'grid gap-y-1',\n}\n\n/**\n * A record's fields: label, value, label, value.\n *\n * The single most repeated shape in any detail page, and the one most often\n * hand-built out of a `<div>` grid — which loses the only thing the markup was\n * carrying. A `<dl>` tells a screen reader that \"Owner\" names the thing beside\n * it; a grid of divs tells it there are two columns of unrelated text, and the\n * reader has to infer the pairing from reading order alone.\n *\n * Reach for `Table` instead when there are several records. This is one record\n * seen from the front; a table is many records seen from above.\n *\n * Each pair is wrapped in a `<div>` — which the HTML specification allows\n * inside a `<dl>` precisely so a pair can be laid out as a unit — so the\n * hairline runs the full width of the row rather than stopping in the column\n * gap.\n *\n * An empty `items` renders `null` rather than an empty bordered box. A record\n * with no fields is a state the page above should be handling with an\n * `EmptyState`, and a hairline around nothing looks like a component that\n * failed to load.\n *\n * @example\n * <DescriptionList\n * items={[\n * { term: 'Owner', description: 'Henry Chen' },\n * { term: 'Status', description: <Badge tone=\"success\">Deployed</Badge> },\n * ]}\n * />\n * @example\n * <DescriptionList layout=\"stacked\" divided={false} items={fields} />\n */\nexport function DescriptionList({\n items,\n layout = 'row',\n divided = true,\n className,\n ...rest\n}: DescriptionListProps) {\n if (items.length === 0) return null\n\n return (\n <dl className={cn('m-0', !divided && 'flex flex-col gap-3', className)} {...rest}>\n {items.map((item, index) => (\n <div\n key={item.id ?? index}\n className={cn(\n LAYOUT[layout],\n divided && 'border-b border-(--rule) py-3 first:pt-0 last:border-b-0 last:pb-0',\n )}\n >\n <dt className=\"text-sm text-(--ink-3-aa)\">{item.term}</dt>\n <dd className=\"m-0 text-sm text-(--ink-2)\">{item.description}</dd>\n </div>\n ))}\n </dl>\n )\n}\n\nexport default DescriptionList\n"],"mappings":"AA0FQ,SAOE,KAPF;AAzFR,SAAS,UAAU;AAwCnB,MAAM,SAAgD;AAAA,EACpD,KAAK;AAAA,EACL,SAAS;AACX;AAkCO,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA,SAAS;AAAA,EACT,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACL,GAAyB;AACvB,MAAI,MAAM,WAAW,EAAG,QAAO;AAE/B,SACE,oBAAC,QAAG,WAAW,GAAG,OAAO,CAAC,WAAW,uBAAuB,SAAS,GAAI,GAAG,MACzE,gBAAM,IAAI,CAAC,MAAM,UAChB;AAAA,IAAC;AAAA;AAAA,MAEC,WAAW;AAAA,QACT,OAAO,MAAM;AAAA,QACb,WAAW;AAAA,MACb;AAAA,MAEA;AAAA,4BAAC,QAAG,WAAU,6BAA6B,eAAK,MAAK;AAAA,QACrD,oBAAC,QAAG,WAAU,8BAA8B,eAAK,aAAY;AAAA;AAAA;AAAA,IAPxD,KAAK,MAAM;AAAA,EAQlB,CACD,GACH;AAEJ;AAEA,IAAO,0BAAQ;","names":[]}
@@ -0,0 +1,86 @@
1
+ import * as react from 'react';
2
+
3
+ interface DiagramNode {
4
+ /** Only needed when an edge names this node. */
5
+ id?: string;
6
+ /** The node's name, set in the interface face. */
7
+ label: string;
8
+ /** What it is — one short line, a step back. */
9
+ note?: string;
10
+ /** The one node the diagram is about. At most one or two per diagram. */
11
+ accent?: boolean;
12
+ /** How this node's children are laid out. Defaults to a row. */
13
+ direction?: 'row' | 'column';
14
+ children?: DiagramNode[];
15
+ /** A line printed under the frame, outside it — what the box means. */
16
+ footnote?: string;
17
+ }
18
+ interface DiagramEdge {
19
+ from: string;
20
+ to: string;
21
+ label?: string;
22
+ }
23
+ interface DiagramSpec {
24
+ /** How the top-level nodes are laid out. Defaults to a row. */
25
+ direction?: 'row' | 'column';
26
+ nodes: DiagramNode[];
27
+ /**
28
+ * Arrows between adjacent siblings, by id and in the order the rank runs.
29
+ * Each edge is spent the first time a pair matches it, at whatever depth
30
+ * that pair sits — and an edge that matches nothing says so in development
31
+ * rather than drawing nothing and reporting nothing.
32
+ */
33
+ edges?: DiagramEdge[];
34
+ /** The figure's caption. */
35
+ caption?: string;
36
+ /** Names the figure for assistive tech when the caption does not. */
37
+ label?: string;
38
+ }
39
+ interface DiagramProps {
40
+ spec: DiagramSpec;
41
+ className?: string;
42
+ }
43
+ /**
44
+ * A flow or architecture diagram, drawn out of the system's own parts.
45
+ *
46
+ * The alternative it replaces is a fenced block of box-drawing characters —
47
+ * `┌──────┬──────┐` — which is a picture rendered in a font chosen for code. It
48
+ * inherits the code block's frame and scrollbar, so a diagram reads as terminal
49
+ * output; it cannot wrap, so on a phone it either overflows or is scaled to
50
+ * nothing; the box edges are text, so a screen reader reads the rules out loud;
51
+ * and none of it responds to the theme.
52
+ *
53
+ * The other alternative is a diagramming library, which is several hundred
54
+ * kilobytes of layout engine, renders after hydration, and draws in its own
55
+ * palette. This is neither: hairline frames on the radius scale, mono labels,
56
+ * the muted step for anything supporting — so a diagram belongs to the page it
57
+ * sits on. It server-renders, because it is markup.
58
+ *
59
+ * NESTING IS CONTAINMENT, which is what most architecture diagrams actually
60
+ * describe: this is inside that, and these two sit beside each other. Edges are
61
+ * for the sequence between siblings, not for arbitrary wiring — a diagram that
62
+ * needs arbitrary wiring is a diagram that wants a drawing, and this will not
63
+ * pretend otherwise.
64
+ *
65
+ * It takes a spec rather than markup, so a fenced ```diagram block in an
66
+ * article and a hand-written figure on a page are one renderer and one look —
67
+ * and a wrong diagram is corrected by editing data.
68
+ *
69
+ * @example
70
+ * <Diagram
71
+ * spec={{
72
+ * caption: 'One request, end to end.',
73
+ * edges: [{ from: 'edge', to: 'app', label: 'HTTPS' }],
74
+ * nodes: [
75
+ * { id: 'edge', label: 'Edge', note: 'CDN' },
76
+ * { id: 'app', label: 'Application', children: [
77
+ * { label: 'Router', accent: true },
78
+ * { label: 'Handlers' },
79
+ * ] },
80
+ * ],
81
+ * }}
82
+ * />
83
+ */
84
+ declare function Diagram({ spec, className }: DiagramProps): react.JSX.Element;
85
+
86
+ export { Diagram, type DiagramEdge, type DiagramNode, type DiagramProps, type DiagramSpec, Diagram as default };