@lt-three/love3 0.0.0 → 0.1.1

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 (377) hide show
  1. package/README.md +85 -1
  2. package/dist/native/analytics/animation.d.ts +4 -0
  3. package/dist/native/analytics/animation.js +6 -0
  4. package/dist/native/analytics/chart.types.d.ts +25 -0
  5. package/dist/native/analytics/chart.types.js +0 -0
  6. package/dist/native/analytics/line-chart.d.ts +4 -0
  7. package/dist/native/analytics/line-chart.ios.d.ts +4 -0
  8. package/dist/native/analytics/line-chart.ios.js +24 -0
  9. package/dist/native/analytics/line-chart.js +33 -0
  10. package/dist/native/analytics/metric-card.d.ts +10 -0
  11. package/dist/native/analytics/metric-card.js +29 -0
  12. package/dist/native/analytics/multi-line-chart.d.ts +18 -0
  13. package/dist/native/analytics/multi-line-chart.js +216 -0
  14. package/dist/native/analytics/pie-chart.d.ts +15 -0
  15. package/dist/native/analytics/pie-chart.ios.d.ts +4 -0
  16. package/dist/native/analytics/pie-chart.ios.js +24 -0
  17. package/dist/native/analytics/pie-chart.js +92 -0
  18. package/dist/native/analytics/single-number.d.ts +19 -0
  19. package/dist/native/analytics/single-number.js +101 -0
  20. package/dist/native/atom/avatar.d.ts +21 -0
  21. package/dist/native/atom/avatar.js +46 -0
  22. package/dist/native/atom/badge.d.ts +28 -0
  23. package/dist/native/atom/badge.js +51 -0
  24. package/dist/native/atom/button.d.ts +46 -0
  25. package/dist/native/atom/button.js +109 -0
  26. package/dist/native/atom/checkbox.d.ts +21 -0
  27. package/dist/native/atom/checkbox.js +47 -0
  28. package/dist/native/atom/colored-value.d.ts +12 -0
  29. package/dist/native/atom/colored-value.js +24 -0
  30. package/dist/native/atom/image.d.ts +21 -0
  31. package/dist/native/atom/image.js +72 -0
  32. package/dist/native/atom/label.d.ts +18 -0
  33. package/dist/native/atom/label.js +33 -0
  34. package/dist/native/atom/link.d.ts +18 -0
  35. package/dist/native/atom/link.js +25 -0
  36. package/dist/native/atom/readout.d.ts +22 -0
  37. package/dist/native/atom/readout.js +39 -0
  38. package/dist/native/atom/search-input.d.ts +12 -0
  39. package/dist/native/atom/search-input.js +36 -0
  40. package/dist/native/atom/select.d.ts +54 -0
  41. package/dist/native/atom/select.js +200 -0
  42. package/dist/native/atom/separator.d.ts +12 -0
  43. package/dist/native/atom/separator.js +16 -0
  44. package/dist/native/atom/skeleton.d.ts +12 -0
  45. package/dist/native/atom/skeleton.js +39 -0
  46. package/dist/native/atom/slider.d.ts +32 -0
  47. package/dist/native/atom/slider.js +75 -0
  48. package/dist/native/atom/spinner.d.ts +15 -0
  49. package/dist/native/atom/spinner.js +25 -0
  50. package/dist/native/atom/switch.d.ts +18 -0
  51. package/dist/native/atom/switch.js +52 -0
  52. package/dist/native/atom/symbol.d.ts +16 -0
  53. package/dist/native/atom/symbol.js +38 -0
  54. package/dist/native/atom/symbol.types.d.ts +25 -0
  55. package/dist/native/atom/symbol.types.js +49 -0
  56. package/dist/native/atom/text-field.d.ts +49 -0
  57. package/dist/native/atom/text-field.js +56 -0
  58. package/dist/native/atom/text.d.ts +2 -0
  59. package/dist/native/atom/text.js +3 -0
  60. package/dist/native/atom/theme-toggle.d.ts +21 -0
  61. package/dist/native/atom/theme-toggle.js +36 -0
  62. package/dist/native/atom/timezone-select.d.ts +16 -0
  63. package/dist/native/atom/timezone-select.js +28 -0
  64. package/dist/native/atom/typography.d.ts +13 -0
  65. package/dist/native/atom/typography.js +28 -0
  66. package/dist/native/base/button.d.ts +61 -0
  67. package/dist/native/base/button.js +92 -0
  68. package/dist/native/base/form.d.ts +72 -0
  69. package/dist/native/base/form.js +113 -0
  70. package/dist/native/base/glass-card.d.ts +15 -0
  71. package/dist/native/base/glass-card.js +38 -0
  72. package/dist/native/base/input.d.ts +29 -0
  73. package/dist/native/base/input.js +27 -0
  74. package/dist/native/base/sheet.d.ts +71 -0
  75. package/dist/native/base/sheet.js +187 -0
  76. package/dist/native/base/text.d.ts +14 -0
  77. package/dist/native/base/text.js +53 -0
  78. package/dist/native/form/checkbox.d.ts +13 -0
  79. package/dist/native/form/checkbox.js +55 -0
  80. package/dist/native/form/date-picker.d.ts +23 -0
  81. package/dist/native/form/date-picker.js +119 -0
  82. package/dist/native/form/form.d.ts +22 -0
  83. package/dist/native/form/form.js +44 -0
  84. package/dist/native/form/radio-group.d.ts +23 -0
  85. package/dist/native/form/radio-group.js +88 -0
  86. package/dist/native/form/select.d.ts +13 -0
  87. package/dist/native/form/select.js +45 -0
  88. package/dist/native/form/slider.d.ts +14 -0
  89. package/dist/native/form/slider.js +42 -0
  90. package/dist/native/form/switch.d.ts +9 -0
  91. package/dist/native/form/switch.js +59 -0
  92. package/dist/native/form/text-area.d.ts +11 -0
  93. package/dist/native/form/text-area.js +50 -0
  94. package/dist/native/form/text-input.d.ts +18 -0
  95. package/dist/native/form/text-input.js +90 -0
  96. package/dist/native/index.d.ts +1 -0
  97. package/dist/native/index.js +0 -0
  98. package/dist/native/layout/accordion.d.ts +25 -0
  99. package/dist/native/layout/accordion.js +54 -0
  100. package/dist/native/layout/card.d.ts +47 -0
  101. package/dist/native/layout/card.js +57 -0
  102. package/dist/native/layout/description.d.ts +16 -0
  103. package/dist/native/layout/description.js +32 -0
  104. package/dist/native/layout/error.d.ts +21 -0
  105. package/dist/native/layout/error.js +44 -0
  106. package/dist/native/layout/information.d.ts +25 -0
  107. package/dist/native/layout/information.js +35 -0
  108. package/dist/native/layout/locked.d.ts +38 -0
  109. package/dist/native/layout/locked.js +94 -0
  110. package/dist/native/layout/modal.d.ts +25 -0
  111. package/dist/native/layout/modal.js +93 -0
  112. package/dist/native/layout/not-found.d.ts +17 -0
  113. package/dist/native/layout/not-found.js +30 -0
  114. package/dist/native/layout/page-frame.d.ts +23 -0
  115. package/dist/native/layout/page-frame.js +46 -0
  116. package/dist/native/layout/panel.d.ts +18 -0
  117. package/dist/native/layout/panel.js +23 -0
  118. package/dist/native/layout/reorderable-list.d.ts +42 -0
  119. package/dist/native/layout/reorderable-list.js +52 -0
  120. package/dist/native/layout/sheet.d.ts +30 -0
  121. package/dist/native/layout/sheet.js +46 -0
  122. package/dist/native/layout/simple-dialog.d.ts +16 -0
  123. package/dist/native/layout/simple-dialog.js +20 -0
  124. package/dist/native/layout/simple-table.d.ts +50 -0
  125. package/dist/native/layout/simple-table.js +75 -0
  126. package/dist/native/layout/tab-bar.d.ts +33 -0
  127. package/dist/native/layout/tab-bar.js +48 -0
  128. package/dist/native/layout/tabs.d.ts +28 -0
  129. package/dist/native/layout/tabs.js +54 -0
  130. package/dist/native/layout/tuning-panel.d.ts +24 -0
  131. package/dist/native/layout/tuning-panel.js +246 -0
  132. package/dist/native/lib/autocomplete.d.ts +7 -0
  133. package/dist/native/lib/autocomplete.js +34 -0
  134. package/dist/native/lib/breakpoints.d.ts +14 -0
  135. package/dist/native/lib/breakpoints.js +17 -0
  136. package/dist/native/lib/chart-palette.d.ts +8 -0
  137. package/dist/native/lib/chart-palette.js +20 -0
  138. package/dist/native/lib/confirm.d.ts +48 -0
  139. package/dist/native/lib/confirm.js +69 -0
  140. package/dist/native/lib/control.d.ts +24 -0
  141. package/dist/native/lib/control.js +0 -0
  142. package/dist/native/lib/external-store.d.ts +16 -0
  143. package/dist/native/lib/external-store.js +30 -0
  144. package/dist/native/lib/keyboard.d.ts +15 -0
  145. package/dist/native/lib/keyboard.js +24 -0
  146. package/dist/native/lib/labels.d.ts +15 -0
  147. package/dist/native/lib/labels.js +17 -0
  148. package/dist/native/lib/loading.d.ts +10 -0
  149. package/dist/native/lib/loading.js +15 -0
  150. package/dist/native/lib/network.d.ts +11 -0
  151. package/dist/native/lib/network.js +20 -0
  152. package/dist/native/lib/scheme.d.ts +18 -0
  153. package/dist/native/lib/scheme.js +22 -0
  154. package/dist/native/lib/snackbar.d.ts +45 -0
  155. package/dist/native/lib/snackbar.js +59 -0
  156. package/dist/native/lib/theme.d.ts +34 -0
  157. package/dist/native/lib/theme.js +53 -0
  158. package/dist/native/lib/timezone.d.ts +26 -0
  159. package/dist/native/lib/timezone.js +95 -0
  160. package/dist/native/lib/token-color.d.ts +5 -0
  161. package/dist/native/lib/token-color.js +13 -0
  162. package/dist/native/lib/token-color.web.d.ts +4 -0
  163. package/dist/native/lib/token-color.web.js +7 -0
  164. package/dist/native/lib/tuning-context.d.ts +9 -0
  165. package/dist/native/lib/tuning-context.js +7 -0
  166. package/dist/native/lib/tuning.d.ts +24 -0
  167. package/dist/native/lib/tuning.js +42 -0
  168. package/dist/native/lib/typography.d.ts +10 -0
  169. package/dist/native/lib/typography.js +11 -0
  170. package/dist/native/lib/utils.d.ts +11 -0
  171. package/dist/native/lib/utils.js +21 -0
  172. package/dist/native/once/confirm.d.ts +7 -0
  173. package/dist/native/once/confirm.js +60 -0
  174. package/dist/native/once/error-boundary.d.ts +28 -0
  175. package/dist/native/once/error-boundary.js +55 -0
  176. package/dist/native/once/loading-lock.d.ts +8 -0
  177. package/dist/native/once/loading-lock.js +28 -0
  178. package/dist/native/once/offline-banner.d.ts +15 -0
  179. package/dist/native/once/offline-banner.js +35 -0
  180. package/dist/native/once/snackbar.d.ts +17 -0
  181. package/dist/native/once/snackbar.js +106 -0
  182. package/dist/native/styles.css +46 -0
  183. package/dist/shared/analytics.d.ts +71 -0
  184. package/dist/shared/analytics.js +0 -0
  185. package/dist/shared/button.d.ts +7 -0
  186. package/dist/shared/button.js +23 -0
  187. package/dist/shared/form.d.ts +45 -0
  188. package/dist/shared/form.js +46 -0
  189. package/dist/shared/index.d.ts +3 -0
  190. package/dist/shared/index.js +3 -0
  191. package/dist/tokens/contrast-pairs.d.ts +30 -0
  192. package/dist/tokens/contrast-pairs.js +404 -0
  193. package/dist/tokens/index.d.ts +6 -0
  194. package/dist/tokens/index.js +10 -0
  195. package/dist/tokens/styles.gen.css +250 -0
  196. package/dist/tokens/tokens.gen.d.ts +141 -0
  197. package/dist/tokens/tokens.gen.js +206 -0
  198. package/dist/tuning/catalog.d.ts +27 -0
  199. package/dist/tuning/catalog.gen.d.ts +4 -0
  200. package/dist/tuning/catalog.gen.js +397 -0
  201. package/dist/tuning/catalog.js +128 -0
  202. package/dist/tuning/color.d.ts +20 -0
  203. package/dist/tuning/color.js +80 -0
  204. package/dist/tuning/css.d.ts +35 -0
  205. package/dist/tuning/css.js +147 -0
  206. package/dist/tuning/index.d.ts +8 -0
  207. package/dist/tuning/index.js +9 -0
  208. package/dist/tuning/model.d.ts +33 -0
  209. package/dist/tuning/model.js +154 -0
  210. package/dist/tuning/native.d.ts +35 -0
  211. package/dist/tuning/native.js +80 -0
  212. package/dist/tuning/schema.d.ts +69 -0
  213. package/dist/tuning/schema.js +247 -0
  214. package/dist/tuning/types.d.ts +75 -0
  215. package/dist/tuning/types.js +39 -0
  216. package/dist/web/analytics/line-chart.d.ts +20 -0
  217. package/dist/web/analytics/line-chart.js +28 -0
  218. package/dist/web/analytics/metric-card.d.ts +18 -0
  219. package/dist/web/analytics/metric-card.js +40 -0
  220. package/dist/web/analytics/multi-line-chart.d.ts +39 -0
  221. package/dist/web/analytics/multi-line-chart.js +345 -0
  222. package/dist/web/atom/avatar.d.ts +11 -0
  223. package/dist/web/atom/avatar.js +24 -0
  224. package/dist/web/atom/badge.d.ts +2 -0
  225. package/dist/web/atom/badge.js +3 -0
  226. package/dist/web/atom/button.d.ts +23 -0
  227. package/dist/web/atom/button.js +35 -0
  228. package/dist/web/atom/checkbox.d.ts +19 -0
  229. package/dist/web/atom/checkbox.js +33 -0
  230. package/dist/web/atom/colored-value.d.ts +13 -0
  231. package/dist/web/atom/colored-value.js +24 -0
  232. package/dist/web/atom/help.d.ts +10 -0
  233. package/dist/web/atom/help.js +18 -0
  234. package/dist/web/atom/label.d.ts +2 -0
  235. package/dist/web/atom/label.js +3 -0
  236. package/dist/web/atom/segmented-control.d.ts +39 -0
  237. package/dist/web/atom/segmented-control.js +42 -0
  238. package/dist/web/atom/select.d.ts +43 -0
  239. package/dist/web/atom/select.js +93 -0
  240. package/dist/web/atom/separator.d.ts +2 -0
  241. package/dist/web/atom/separator.js +3 -0
  242. package/dist/web/atom/skeleton.d.ts +2 -0
  243. package/dist/web/atom/skeleton.js +3 -0
  244. package/dist/web/atom/slider.d.ts +33 -0
  245. package/dist/web/atom/slider.js +70 -0
  246. package/dist/web/atom/spinner.d.ts +8 -0
  247. package/dist/web/atom/spinner.js +14 -0
  248. package/dist/web/atom/switch.d.ts +11 -0
  249. package/dist/web/atom/switch.js +10 -0
  250. package/dist/web/atom/text-area.d.ts +23 -0
  251. package/dist/web/atom/text-area.js +27 -0
  252. package/dist/web/atom/text-field.d.ts +18 -0
  253. package/dist/web/atom/text-field.js +22 -0
  254. package/dist/web/atom/toggle-chip.d.ts +22 -0
  255. package/dist/web/atom/toggle-chip.js +28 -0
  256. package/dist/web/atom/tooltip.d.ts +23 -0
  257. package/dist/web/atom/tooltip.js +26 -0
  258. package/dist/web/atom/typography.d.ts +6 -0
  259. package/dist/web/atom/typography.js +23 -0
  260. package/dist/web/base/accordion.d.ts +9 -0
  261. package/dist/web/base/accordion.js +44 -0
  262. package/dist/web/base/alert.d.ts +11 -0
  263. package/dist/web/base/alert.js +37 -0
  264. package/dist/web/base/avatar.d.ts +8 -0
  265. package/dist/web/base/avatar.js +29 -0
  266. package/dist/web/base/badge.d.ts +12 -0
  267. package/dist/web/base/badge.js +26 -0
  268. package/dist/web/base/breadcrumb.d.ts +16 -0
  269. package/dist/web/base/breadcrumb.js +72 -0
  270. package/dist/web/base/button.d.ts +12 -0
  271. package/dist/web/base/button.js +47 -0
  272. package/dist/web/base/card.d.ts +19 -0
  273. package/dist/web/base/card.js +74 -0
  274. package/dist/web/base/checkbox.d.ts +6 -0
  275. package/dist/web/base/checkbox.js +21 -0
  276. package/dist/web/base/dialog.d.ts +20 -0
  277. package/dist/web/base/dialog.js +92 -0
  278. package/dist/web/base/dropdown-menu.d.ts +29 -0
  279. package/dist/web/base/dropdown-menu.js +125 -0
  280. package/dist/web/base/field.d.ts +27 -0
  281. package/dist/web/base/field.js +118 -0
  282. package/dist/web/base/form.d.ts +38 -0
  283. package/dist/web/base/form.js +110 -0
  284. package/dist/web/base/input.d.ts +9 -0
  285. package/dist/web/base/input.js +23 -0
  286. package/dist/web/base/label.d.ts +6 -0
  287. package/dist/web/base/label.js +15 -0
  288. package/dist/web/base/pagination.d.ts +34 -0
  289. package/dist/web/base/pagination.js +90 -0
  290. package/dist/web/base/popover.d.ts +11 -0
  291. package/dist/web/base/popover.js +37 -0
  292. package/dist/web/base/radio-group.d.ts +7 -0
  293. package/dist/web/base/radio-group.js +27 -0
  294. package/dist/web/base/scroll-area.d.ts +10 -0
  295. package/dist/web/base/scroll-area.js +41 -0
  296. package/dist/web/base/select.d.ts +17 -0
  297. package/dist/web/base/select.js +96 -0
  298. package/dist/web/base/separator.d.ts +6 -0
  299. package/dist/web/base/separator.js +17 -0
  300. package/dist/web/base/sheet.d.ts +19 -0
  301. package/dist/web/base/sheet.js +88 -0
  302. package/dist/web/base/skeleton.d.ts +5 -0
  303. package/dist/web/base/skeleton.js +14 -0
  304. package/dist/web/base/slider.d.ts +9 -0
  305. package/dist/web/base/slider.js +39 -0
  306. package/dist/web/base/sonner.d.ts +9 -0
  307. package/dist/web/base/sonner.js +25 -0
  308. package/dist/web/base/spinner.d.ts +5 -0
  309. package/dist/web/base/spinner.js +17 -0
  310. package/dist/web/base/switch.d.ts +6 -0
  311. package/dist/web/base/switch.js +19 -0
  312. package/dist/web/base/table.d.ts +14 -0
  313. package/dist/web/base/table.js +68 -0
  314. package/dist/web/base/tabs.d.ts +9 -0
  315. package/dist/web/base/tabs.js +36 -0
  316. package/dist/web/base/textarea.d.ts +9 -0
  317. package/dist/web/base/textarea.js +23 -0
  318. package/dist/web/base/tooltip.d.ts +9 -0
  319. package/dist/web/base/tooltip.js +36 -0
  320. package/dist/web/form/checkbox.d.ts +35 -0
  321. package/dist/web/form/checkbox.js +91 -0
  322. package/dist/web/form/radio-group.d.ts +24 -0
  323. package/dist/web/form/radio-group.js +75 -0
  324. package/dist/web/form/select.d.ts +16 -0
  325. package/dist/web/form/select.js +44 -0
  326. package/dist/web/form/slider.d.ts +19 -0
  327. package/dist/web/form/slider.js +51 -0
  328. package/dist/web/form/switch.d.ts +11 -0
  329. package/dist/web/form/switch.js +50 -0
  330. package/dist/web/form/text-area.d.ts +10 -0
  331. package/dist/web/form/text-area.js +31 -0
  332. package/dist/web/form/text-input.d.ts +10 -0
  333. package/dist/web/form/text-input.js +42 -0
  334. package/dist/web/index.d.ts +1 -0
  335. package/dist/web/index.js +0 -0
  336. package/dist/web/layout/accordion.d.ts +26 -0
  337. package/dist/web/layout/accordion.js +29 -0
  338. package/dist/web/layout/alert-modal.d.ts +41 -0
  339. package/dist/web/layout/alert-modal.js +71 -0
  340. package/dist/web/layout/card.d.ts +17 -0
  341. package/dist/web/layout/card.js +35 -0
  342. package/dist/web/layout/description.d.ts +12 -0
  343. package/dist/web/layout/description.js +20 -0
  344. package/dist/web/layout/information.d.ts +36 -0
  345. package/dist/web/layout/information.js +53 -0
  346. package/dist/web/layout/modal.d.ts +16 -0
  347. package/dist/web/layout/modal.js +37 -0
  348. package/dist/web/layout/page-frame.d.ts +37 -0
  349. package/dist/web/layout/page-frame.js +79 -0
  350. package/dist/web/layout/scroll-area.d.ts +10 -0
  351. package/dist/web/layout/scroll-area.js +13 -0
  352. package/dist/web/layout/sheet.d.ts +32 -0
  353. package/dist/web/layout/sheet.js +68 -0
  354. package/dist/web/layout/simple-dialog.d.ts +11 -0
  355. package/dist/web/layout/simple-dialog.js +24 -0
  356. package/dist/web/layout/simple-table.d.ts +49 -0
  357. package/dist/web/layout/simple-table.js +58 -0
  358. package/dist/web/layout/tabs.d.ts +26 -0
  359. package/dist/web/layout/tabs.js +42 -0
  360. package/dist/web/layout/titled-modal.d.ts +32 -0
  361. package/dist/web/layout/titled-modal.js +58 -0
  362. package/dist/web/lib/css-vars.d.ts +14 -0
  363. package/dist/web/lib/css-vars.js +18 -0
  364. package/dist/web/lib/dialog.d.ts +13 -0
  365. package/dist/web/lib/dialog.js +0 -0
  366. package/dist/web/lib/form.d.ts +2 -0
  367. package/dist/web/lib/form.js +3 -0
  368. package/dist/web/lib/labels.d.ts +27 -0
  369. package/dist/web/lib/labels.js +29 -0
  370. package/dist/web/lib/modal-open-focus.d.ts +17 -0
  371. package/dist/web/lib/modal-open-focus.js +44 -0
  372. package/dist/web/lib/restore-focus.d.ts +12 -0
  373. package/dist/web/lib/restore-focus.js +32 -0
  374. package/dist/web/lib/utils.d.ts +4 -0
  375. package/dist/web/lib/utils.js +10 -0
  376. package/dist/web/styles.css +162 -0
  377. package/package.json +203 -4
@@ -0,0 +1,247 @@
1
+ import { findColor } from "./catalog.js";
2
+ import { parseTokenColor } from "./color.js";
3
+ import { BODY_SIZE_MAX, BODY_SIZE_MIN, FONT_KEYS, MODES, RADIUS_MAX, RADIUS_ROLES, emptyTuning } from "./types.js";
4
+ import { normalize } from "./model.js";
5
+ import { z } from "zod";
6
+
7
+ //#region src/tuning/schema.ts
8
+ /** The name and version of the export and save format. Bump `VERSION` when the shape changes. */
9
+ const FORMAT = "love3-tuning";
10
+ const VERSION = 1;
11
+ /** The key of the storage location (localStorage). */
12
+ const STORAGE_KEY = "love3-preview:tuning";
13
+ const colorMap = z.record(z.string(), z.string());
14
+ const radiusPx = z.number().min(0, { error: "角丸は 0 以上です" }).max(64, { error: `角丸は ${64}px 以下です` });
15
+ const fontValue = z.string();
16
+ /**
17
+ * The skeleton of the format. **Unknown fields are rejected** (`strictObject`). Checks that depend on the design system, such as token names and color contents, are added by `parseTuning`.
18
+ * Every field can be omitted (write only the difference from the defaults).
19
+ */
20
+ const envelope = z.strictObject({
21
+ format: z.literal(FORMAT, { error: (issue) => `format は "${FORMAT}" にしてください(実際: ${show(issue.input)})` }),
22
+ version: z.literal(1, { error: (issue) => `version は ${1} だけに対応しています(実際: ${show(issue.input)})` }),
23
+ tokens: z.strictObject({
24
+ light: colorMap.optional(),
25
+ dark: colorMap.optional()
26
+ }).optional(),
27
+ radius: z.strictObject({
28
+ control: radiusPx.optional(),
29
+ surface: radiusPx.optional()
30
+ }).optional(),
31
+ semantic: z.record(z.string(), z.string()).optional(),
32
+ font: z.strictObject({
33
+ geist: fontValue.optional(),
34
+ geistMono: fontValue.optional(),
35
+ jp: fontValue.optional(),
36
+ bodySize: z.number().min(8, { error: `本文サイズは ${8}px 以上です` }).max(32, { error: `本文サイズは ${32}px 以下です` }).optional()
37
+ }).optional(),
38
+ shadow: z.enum([
39
+ "default",
40
+ "none",
41
+ "preset"
42
+ ], { error: (issue) => `shadow は "default"・"none"・"preset" のどれかです(実際: ${show(issue.input)})` }).optional()
43
+ });
44
+ function show(value) {
45
+ return typeof value === "string" ? `"${value}"` : JSON.stringify(value) ?? String(value);
46
+ }
47
+ /** The upper limit of the size of an imported JSON (bytes), for both pasting and files. */
48
+ const MAX_IMPORT_BYTES = 262144;
49
+ /** The upper limit of the number of entries in one table (`tokens.light` / `tokens.dark` / `semantic`). There are fewer than 50 names that can be tuned. */
50
+ const MAX_ENTRIES = 200;
51
+ /** Lists rejection reasons up to this many (the rest become "N more"). */
52
+ const MAX_REASONS = 20;
53
+ const BYTE_ENCODER = new TextEncoder();
54
+ /** Whether the text being imported exceeds the limit (`MAX_IMPORT_BYTES`). */
55
+ function tooLarge(text) {
56
+ return text.length > 262144 || BYTE_ENCODER.encode(text).length > 262144;
57
+ }
58
+ const TOO_LARGE_REASON = `大きすぎます(${MAX_IMPORT_BYTES / 1024} KB まで)`;
59
+ /**
60
+ * An **allowlist** for typeface values (CSS font-family). Only comma-separated lists of the following parts pass:
61
+ * - Names with closed quotes (`"Geist Variable"` / `'Yu Gothic'`). `\`, `;`, `{`, `}`, `<`, `>`, and newlines are not allowed inside
62
+ * - Bare names (letters, digits, `-`, `_`, and spaces; non-ASCII is allowed too; `sans-serif`, `ui-monospace`, and so on)
63
+ * - `var(--font-…)` references (the default form such as `--font-mono: var(--font-geist-mono)`)
64
+ *
65
+ * **Brackets outside quotes (`(` `)` `[` `]`) and unclosed quotes are rejected.** If they were let through, a `;` or `}` would be swallowed by the bracket or quote,
66
+ * and the following declarations or the whole `.dark {}` block would disappear (reproduced with `Arial(`). Returns the reason (undefined if safe).
67
+ */
68
+ function unreadable(value, index) {
69
+ return `書体の「${value.slice(index, index + 12).trim()}」から先を読めません。使えるのは、閉じたクォート付きの名前・素の名前(英数字・-・_・空白)・カンマ・var(--font-…) だけです(括弧 ( ) [ ] ; や閉じていない引用符は使えません)`;
70
+ }
71
+ function fontProblem(value) {
72
+ if (value.trim() === "") return "書体が空です。既定に戻すときは、その項目を空にするか「既定へ」を押してください";
73
+ if (value.length > 400) return "書体が長すぎます(400 文字まで)";
74
+ if (/url\s*\(|@import|expression\s*\(/i.test(value)) return "書体に url()・@import は使えません";
75
+ const part = /\s*(?:"[^"\\\n\r;{}<>]*"|'[^'\\\n\r;{}<>]*'|var\(\s*--font-[a-z0-9-]+\s*\)|[\p{L}\p{N}_ -]+)\s*/uy;
76
+ let index = 0;
77
+ for (;;) {
78
+ part.lastIndex = index;
79
+ const match = part.exec(value);
80
+ if (match === null || match[0].trim() === "") return unreadable(value, index);
81
+ index = part.lastIndex;
82
+ if (index >= value.length) return void 0;
83
+ if (value[index] !== ",") return unreadable(value, index);
84
+ index += 1;
85
+ if (index >= value.length) return "書体の最後がカンマで終わっています";
86
+ }
87
+ }
88
+ /**
89
+ * Reads and validates an exported JSON (a string). **If anything is invalid, the whole input is rejected (no partial application).**
90
+ * The rejection reasons are all the problems found, in Japanese, each with the location of the item.
91
+ *
92
+ * What is rejected: unreadable JSON, a wrong `format` / `version`, unknown fields, unknown token names (`--name`),
93
+ * invalid colors, a dark specification for a token common to light and dark (brand colors), unknown semantic tokens, unselectable reference targets,
94
+ * out-of-range radius and body size, and typefaces that cannot be injected. On success, it returns the form with items equal to the defaults dropped (`normalize`).
95
+ */
96
+ function parseTuning(text, catalog) {
97
+ if (tooLarge(text)) return {
98
+ ok: false,
99
+ reasons: [TOO_LARGE_REASON]
100
+ };
101
+ let json;
102
+ try {
103
+ json = JSON.parse(text);
104
+ } catch (error) {
105
+ return {
106
+ ok: false,
107
+ reasons: [`JSON として読めません(${error instanceof Error ? error.message : String(error)})`]
108
+ };
109
+ }
110
+ const result = envelope.safeParse(json);
111
+ if (!result.success) {
112
+ const reasons = result.error.issues.map((issue) => describe(issue.path, describeIssue(issue)));
113
+ return {
114
+ ok: false,
115
+ reasons: reasons.length > 20 ? [...reasons.slice(0, 20), `ほか ${reasons.length - 20} 件`] : reasons
116
+ };
117
+ }
118
+ const data = result.data;
119
+ const reasons = [];
120
+ const tuning = emptyTuning();
121
+ for (const [where, table, message] of [
122
+ [
123
+ ["tokens", "light"],
124
+ rawTable(json, ["tokens", "light"]),
125
+ "未知のトークン名です(--__proto__)"
126
+ ],
127
+ [
128
+ ["tokens", "dark"],
129
+ rawTable(json, ["tokens", "dark"]),
130
+ "未知のトークン名です(--__proto__)"
131
+ ],
132
+ [
133
+ ["semantic"],
134
+ rawTable(json, ["semantic"]),
135
+ "未知のセマンティックトークンです(--__proto__)"
136
+ ]
137
+ ]) if (table !== void 0 && Object.hasOwn(table, "__proto__")) reasons.push(describe([...where, "__proto__"], message));
138
+ for (const mode of MODES) {
139
+ const entries = Object.entries(data.tokens?.[mode] ?? {});
140
+ if (entries.length > 200) {
141
+ reasons.push(describe(["tokens", mode], `項目が多すぎます(${entries.length} 個。${200} 個まで)`));
142
+ continue;
143
+ }
144
+ for (const [name, value] of entries) {
145
+ const where = [
146
+ "tokens",
147
+ mode,
148
+ name
149
+ ];
150
+ const color = findColor(catalog, name);
151
+ if (color === void 0) reasons.push(describe(where, `未知のトークン名です(--${name})。調整できる色は ${catalog.colors.map((c) => c.name).join("・")}`));
152
+ else if (mode === "dark" && !color.hasDark) reasons.push(describe(where, `--${name} はライト・ダーク共通です。light に書いてください`));
153
+ else {
154
+ const parsed = parseTokenColor(value, { alpha: color.alpha });
155
+ if (parsed.ok) tuning.tokens[mode][name] = parsed.value;
156
+ else reasons.push(describe(where, parsed.reason));
157
+ }
158
+ }
159
+ }
160
+ const semanticEntries = Object.entries(data.semantic ?? {});
161
+ if (semanticEntries.length > 200) {
162
+ reasons.push(describe(["semantic"], `項目が多すぎます(${semanticEntries.length} 個。${200} 個まで)`));
163
+ semanticEntries.length = 0;
164
+ }
165
+ for (const [name, ref] of semanticEntries) {
166
+ const where = ["semantic", name];
167
+ if (!Object.hasOwn(catalog.semantic, name)) reasons.push(describe(where, `未知のセマンティックトークンです(--${name})`));
168
+ else if (!catalog.refOptions.includes(ref)) reasons.push(describe(where, `参照先「${ref}」は選べません。選べるのは ${catalog.refOptions.join("・")}`));
169
+ else tuning.semantic[name] = ref;
170
+ }
171
+ for (const role of RADIUS_ROLES) {
172
+ const px = data.radius?.[role];
173
+ if (px !== void 0) tuning.radius[role] = px;
174
+ }
175
+ for (const key of FONT_KEYS) {
176
+ const value = data.font?.[key];
177
+ if (value === void 0) continue;
178
+ const problem = fontProblem(value);
179
+ if (problem === void 0) tuning.font[key] = value;
180
+ else reasons.push(describe(["font", key], problem));
181
+ }
182
+ if (data.font?.bodySize !== void 0) tuning.font.bodySize = data.font.bodySize;
183
+ tuning.shadow = data.shadow ?? "default";
184
+ if (reasons.length > 20) return {
185
+ ok: false,
186
+ reasons: [...reasons.slice(0, 20), `ほか ${reasons.length - 20} 件`]
187
+ };
188
+ if (reasons.length > 0) return {
189
+ ok: false,
190
+ reasons
191
+ };
192
+ return {
193
+ ok: true,
194
+ tuning: normalize(tuning, catalog)
195
+ };
196
+ }
197
+ /** The object for export containing only the difference (empty sections are omitted). */
198
+ function toExportObject(tuning, catalog) {
199
+ const n = normalize(tuning, catalog);
200
+ const out = {
201
+ format: FORMAT,
202
+ version: 1
203
+ };
204
+ if (Object.keys(n.tokens.light).length > 0 || Object.keys(n.tokens.dark).length > 0) out.tokens = {
205
+ ...Object.keys(n.tokens.light).length > 0 ? { light: n.tokens.light } : {},
206
+ ...Object.keys(n.tokens.dark).length > 0 ? { dark: n.tokens.dark } : {}
207
+ };
208
+ if (Object.keys(n.radius).length > 0) out.radius = n.radius;
209
+ if (Object.keys(n.semantic).length > 0) out.semantic = n.semantic;
210
+ if (Object.keys(n.font).length > 0) out.font = n.font;
211
+ if (n.shadow !== "default") out.shadow = n.shadow;
212
+ return out;
213
+ }
214
+ /** The JSON for export and saving (only the difference from the defaults; pretty-printed). */
215
+ function toJson(tuning, catalog) {
216
+ return JSON.stringify(toExportObject(tuning, catalog), null, 2);
217
+ }
218
+ /** The table (object) at a given path in the parsed JSON. undefined if absent. */
219
+ function rawTable(json, path) {
220
+ let current = json;
221
+ for (const key of path) {
222
+ if (typeof current !== "object" || current === null || !Object.hasOwn(current, key)) return void 0;
223
+ current = Reflect.get(current, key);
224
+ }
225
+ return typeof current === "object" && current !== null ? current : void 0;
226
+ }
227
+ function describe(path, message) {
228
+ return path.length === 0 ? message : `${path.map(String).join(".")}: ${message}`;
229
+ }
230
+ function describeIssue(issue) {
231
+ switch (issue.code) {
232
+ case "unrecognized_keys": return `知らない項目があります(${issue.keys.join("・")})`;
233
+ case "invalid_type": return issue.path.length === 0 ? "最上位が JSON のオブジェクトではありません" : `型が違います(期待: ${expectedType(issue.expected)})`;
234
+ default: return issue.message;
235
+ }
236
+ }
237
+ function expectedType(expected) {
238
+ return {
239
+ string: "文字",
240
+ number: "数",
241
+ object: "オブジェクト",
242
+ boolean: "真偽値"
243
+ }[expected] ?? expected;
244
+ }
245
+
246
+ //#endregion
247
+ export { FORMAT, MAX_ENTRIES, MAX_IMPORT_BYTES, MAX_REASONS, STORAGE_KEY, TOO_LARGE_REASON, VERSION, fontProblem, parseTuning, toExportObject, toJson, tooLarge };
@@ -0,0 +1,75 @@
1
+ //#region src/tuning/types.d.ts
2
+ /** Light and dark. */
3
+ export type Mode = "light" | "dark";
4
+ export declare const MODES: readonly Mode[];
5
+ /**
6
+ * Radius roles (`--radius-control` / `--radius-surface`; components use `rounded-control` / `rounded-surface`).
7
+ * - `control`: small interactive elements (Button, inputs, the Select trigger, Checkbox, Badge, menu items, and so on)
8
+ * - `surface`: surfaces and containers (Card, Dialog, Sheet, Popover, Alert, Tooltip, menu containers, and so on)
9
+ */
10
+ export declare const RADIUS_ROLES: readonly ["control", "surface"];
11
+ export type RadiusRole = (typeof RADIUS_ROLES)[number];
12
+ /** The upper limit of the radius (px). Both the slider and numeric input stop here. */
13
+ export declare const RADIUS_MAX = 64;
14
+ /** Typeface keys (`--font-geist` / `--font-geist-mono` / `--font-jp`). */
15
+ export declare const FONT_KEYS: readonly ["geist", "geistMono", "jp"];
16
+ export type FontKey = (typeof FONT_KEYS)[number];
17
+ export declare const FONT_TOKEN: Readonly<Record<FontKey, string>>;
18
+ /** The range of the body size (px). */
19
+ export declare const BODY_SIZE_MIN = 8;
20
+ export declare const BODY_SIZE_MAX = 32;
21
+ /**
22
+ * Shadow presets. `default` is the love3 default (soft shadows using `--shadow-color`). `none` removes all shadows.
23
+ * `preset` swaps in Tailwind's default shadows.
24
+ */
25
+ export type ShadowPreset = "default" | "none" | "preset";
26
+ /**
27
+ * The content of a tuning. It holds **only the difference from the defaults** (empty = the defaults as they are). The same shape as the canonical form for saving and exporting.
28
+ *
29
+ * - `tokens`: overrides of color tokens, per light and dark. Brand colors (`lt-three*`) are common to both, so they are held only in `light`
30
+ * - `radius`: the radius (px) per role. `control` (small interactive elements) and `surface` (surfaces and containers). Falls back to the default (`TuningCatalog.radius`) when absent
31
+ * - `semantic`: what the semantic tokens (`background` and so on) refer to (names of ramp, state, and brand tokens)
32
+ * - `font`: the typeface (a CSS font-family value) and the body size (px)
33
+ * - `shadow`: the shadow preset (the default is `default` = the love3 soft shadows)
34
+ */
35
+ export interface Tuning {
36
+ tokens: Record<Mode, Record<string, string>>;
37
+ radius: Partial<Record<RadiusRole, number>>;
38
+ semantic: Record<string, string>;
39
+ font: Partial<Record<FontKey, string>> & {
40
+ bodySize?: number;
41
+ };
42
+ shadow: ShadowPreset;
43
+ }
44
+ export declare function emptyTuning(): Tuning;
45
+ /** The groups of color tokens. */
46
+ export type ColorGroup = "ramp" | "action" | "brand" | "state" | "chart";
47
+ export interface ColorToken {
48
+ name: string;
49
+ group: ColorGroup;
50
+ /** Whether it can have a separate value in dark. Brand colors are common to both, so they do not. */
51
+ hasDark: boolean;
52
+ /** Whether translucency is allowed (scrim). Everything else is an opaque `#rrggbb` only. */
53
+ alpha: boolean;
54
+ }
55
+ /**
56
+ * What can be tuned, and the defaults. Built from the design system (`buildCatalog`). The logic looks only at this shape, so it does not depend on the design system and can be tested in Node.
57
+ */
58
+ export interface TuningCatalog {
59
+ /** The default actual values (with `var()` resolved; the love3 `tokens`). */
60
+ defaults: Readonly<Record<Mode, Readonly<Record<string, string>>>>;
61
+ /** The color tokens (raw ramp, primary action, brand, state, chart), in definition order. */
62
+ colors: readonly ColorToken[];
63
+ /** Semantic token name → default reference (`background` → `paper`), in definition order. */
64
+ semantic: Readonly<Record<string, string>>;
65
+ /** The names that can be chosen as the target of a semantic reference (opaque color tokens). */
66
+ refOptions: readonly string[];
67
+ /** The default radius (px) per role. Read from the CSS `@theme` (`--radius-control` / `--radius-surface`). */
68
+ radius: Readonly<Record<RadiusRole, number>>;
69
+ /** The default body size (px) and line height (px). */
70
+ body: {
71
+ size: number;
72
+ lineHeight: number;
73
+ };
74
+ }
75
+ //#endregion
@@ -0,0 +1,39 @@
1
+ //#region src/tuning/types.ts
2
+ const MODES = ["light", "dark"];
3
+ /**
4
+ * Radius roles (`--radius-control` / `--radius-surface`; components use `rounded-control` / `rounded-surface`).
5
+ * - `control`: small interactive elements (Button, inputs, the Select trigger, Checkbox, Badge, menu items, and so on)
6
+ * - `surface`: surfaces and containers (Card, Dialog, Sheet, Popover, Alert, Tooltip, menu containers, and so on)
7
+ */
8
+ const RADIUS_ROLES = ["control", "surface"];
9
+ /** The upper limit of the radius (px). Both the slider and numeric input stop here. */
10
+ const RADIUS_MAX = 64;
11
+ /** Typeface keys (`--font-geist` / `--font-geist-mono` / `--font-jp`). */
12
+ const FONT_KEYS = [
13
+ "geist",
14
+ "geistMono",
15
+ "jp"
16
+ ];
17
+ const FONT_TOKEN = {
18
+ geist: "font-geist",
19
+ geistMono: "font-geist-mono",
20
+ jp: "font-jp"
21
+ };
22
+ /** The range of the body size (px). */
23
+ const BODY_SIZE_MIN = 8;
24
+ const BODY_SIZE_MAX = 32;
25
+ function emptyTuning() {
26
+ return {
27
+ tokens: {
28
+ light: {},
29
+ dark: {}
30
+ },
31
+ radius: {},
32
+ semantic: {},
33
+ font: {},
34
+ shadow: "default"
35
+ };
36
+ }
37
+
38
+ //#endregion
39
+ export { BODY_SIZE_MAX, BODY_SIZE_MIN, FONT_KEYS, FONT_TOKEN, MODES, RADIUS_MAX, RADIUS_ROLES, emptyTuning };
@@ -0,0 +1,20 @@
1
+ import { ChartCommonProps, LineChartSharedProps } from "../../shared/analytics.js";
2
+ import { CSSProperties } from "react";
3
+ //#region src/web/analytics/line-chart.d.ts
4
+ export type LineChartProps = ChartCommonProps & LineChartSharedProps & {
5
+ /** Style passed to the outer element (corresponds to native's `style: ViewStyle`). */
6
+ style?: CSSProperties;
7
+ className?: string;
8
+ /** Formatting of the y-axis ticks and the tooltip values (a web addition. Native's `LineChart` is formatted by the OS chart). */
9
+ formatValue?: (value: number) => string;
10
+ /** Text shown when there is no data (a web addition). */
11
+ emptyText?: string;
12
+ };
13
+ /**
14
+ * A single-series line chart. Same API as native's `analytics/line-chart` (`shared/analytics.ts`). **Pass `data` and `formatValue` with stable references** (same as `MultiLineChart`).
15
+ * Inside it is a `MultiLineChart` with one series (no legend). To overlay several series, use `MultiLineChart`.
16
+ *
17
+ * Native's `LineChart` is iOS SwiftUI Charts, and shows `fallbackText` on anything other than iOS. Web always draws, so it has no `fallbackText`.
18
+ */
19
+ export declare function LineChart({ data, color, ...rest }: LineChartProps): import("react").JSX.Element;
20
+ //#endregion
@@ -0,0 +1,28 @@
1
+ import { LINE_CHART_SINGLE_SERIES_LABEL } from "../lib/labels.js";
2
+ import { MultiLineChart } from "./multi-line-chart.js";
3
+ import { useMemo } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+
6
+ //#region src/web/analytics/line-chart.tsx
7
+ /**
8
+ * A single-series line chart. Same API as native's `analytics/line-chart` (`shared/analytics.ts`). **Pass `data` and `formatValue` with stable references** (same as `MultiLineChart`).
9
+ * Inside it is a `MultiLineChart` with one series (no legend). To overlay several series, use `MultiLineChart`.
10
+ *
11
+ * Native's `LineChart` is iOS SwiftUI Charts, and shows `fallbackText` on anything other than iOS. Web always draws, so it has no `fallbackText`.
12
+ */
13
+ function LineChart({ data, color = "var(--chart-1)", ...rest }) {
14
+ const series = useMemo(() => [{
15
+ key: "line",
16
+ label: "値",
17
+ points: data,
18
+ color
19
+ }], [data, color]);
20
+ return /* @__PURE__ */ jsx(MultiLineChart, {
21
+ legend: false,
22
+ series,
23
+ ...rest
24
+ });
25
+ }
26
+
27
+ //#endregion
28
+ export { LineChart };
@@ -0,0 +1,18 @@
1
+ import { MetricCardSharedProps } from "../../shared/analytics.js";
2
+ import { ReactNode } from "react";
3
+ //#region src/web/analytics/metric-card.d.ts
4
+ export type MetricCardProps = Omit<MetricCardSharedProps, "label"> & {
5
+ /** Name of the metric. Besides a string you can pass an element, such as a heading with a help trigger (native takes a string). */
6
+ label: ReactNode;
7
+ };
8
+ /**
9
+ * A single metric on a surface (label + a large monospaced number + supporting text). Same API as native's `analytics/metric-card` (`shared/analytics.ts`).
10
+ * A raised surface + a thin 1px border + the surface corner radius, with no shadow.
11
+ *
12
+ * Inside it is a `<dl>` (the label is a dt; the value and the supporting text are dd), and it stands on its own (a grid parent can be a `<div>`).
13
+ * The value stays on one line and is truncated when it does not fit (it does not wrap).
14
+ *
15
+ * When `trend` is positive the value is coloured `state-success`; when negative, `state-error`. **Meaning is not conveyed by colour alone**, so put the sign in `value`.
16
+ */
17
+ export declare function MetricCard({ label, value, subValue, trend, className }: MetricCardProps): import("react").JSX.Element;
18
+ //#endregion
@@ -0,0 +1,40 @@
1
+ import { cn } from "../lib/utils.js";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+
4
+ //#region src/web/analytics/metric-card.tsx
5
+ /**
6
+ * A single metric on a surface (label + a large monospaced number + supporting text). Same API as native's `analytics/metric-card` (`shared/analytics.ts`).
7
+ * A raised surface + a thin 1px border + the surface corner radius, with no shadow.
8
+ *
9
+ * Inside it is a `<dl>` (the label is a dt; the value and the supporting text are dd), and it stands on its own (a grid parent can be a `<div>`).
10
+ * The value stays on one line and is truncated when it does not fit (it does not wrap).
11
+ *
12
+ * When `trend` is positive the value is coloured `state-success`; when negative, `state-error`. **Meaning is not conveyed by colour alone**, so put the sign in `value`.
13
+ */
14
+ function MetricCard({ label, value, subValue, trend, className }) {
15
+ const tone = trend === void 0 || trend === 0 ? void 0 : trend > 0 ? "up" : "down";
16
+ return /* @__PURE__ */ jsxs("dl", {
17
+ "data-slot": "metric-card",
18
+ className: cn("bg-card border-border rounded-surface flex min-w-0 flex-col gap-1 border p-4", className),
19
+ children: [
20
+ /* @__PURE__ */ jsx("dt", {
21
+ className: "text-muted-foreground flex items-center gap-1 text-xs font-medium tracking-[0.06em] uppercase",
22
+ children: label
23
+ }),
24
+ /* @__PURE__ */ jsx("dd", {
25
+ "data-slot": "metric-card-value",
26
+ "data-trend": tone,
27
+ title: value,
28
+ className: cn("min-w-0 truncate font-mono text-xl font-bold tabular-nums sm:text-2xl", tone === "up" && "text-state-success", tone === "down" && "text-state-error"),
29
+ children: value
30
+ }),
31
+ subValue ? /* @__PURE__ */ jsx("dd", {
32
+ className: "text-muted-foreground min-w-0 truncate font-mono text-xs tabular-nums",
33
+ children: subValue
34
+ }) : null
35
+ ]
36
+ });
37
+ }
38
+
39
+ //#endregion
40
+ export { MetricCard };
@@ -0,0 +1,39 @@
1
+ import { ChartCommonProps, MultiLineChartSharedProps } from "../../shared/analytics.js";
2
+ import { CSSProperties } from "react";
3
+ //#region src/web/analytics/multi-line-chart.d.ts
4
+ export type MultiLineChartProps = ChartCommonProps & MultiLineChartSharedProps & {
5
+ /** Style passed to the outer element (corresponds to native's `style: ViewStyle`). */
6
+ style?: CSSProperties;
7
+ className?: string;
8
+ /** Whether to show the legend (shown by default. Native's `MultiLineChart` shows it even for a single series). */
9
+ legend?: boolean;
10
+ /**
11
+ * Whether to show the hidden table for screen readers (series, label, value) (shown by default).
12
+ * The name of the figure (`accessibilityLabel`) alone cannot convey the exact values, so the same values are also held in an HTML table.
13
+ * Values go through the same formatting as `formatValue`. **When a series has more than 60 points, 60 are sampled at even intervals so the DOM does not grow**,
14
+ * and a sentence before the table says so (if you need the exact value of every point, provide your own table or a CSV).
15
+ */
16
+ table?: boolean;
17
+ };
18
+ /**
19
+ * A multi-series line chart. Same API as native's `analytics/multi-line-chart` (`shared/analytics.ts`).
20
+ * It is drawn with `@tanstack/charts` (SVG). Grid lines are thin 1px lines, the colours are `--chart-1` to `--chart-5`, and the tooltip is an overlay surface + a shadow.
21
+ *
22
+ * - **Non-numeric points are dropped**: points whose `y` (or `t`) is not finite (NaN, Infinity) are removed before building
23
+ * (they are not in the table for screen readers either, and the number removed is noted with the table). If everything is removed, `emptyText`
24
+ * - When every series has `t`, **the horizontal position is decided by time**. If even one lacks it, each series is placed at even intervals in its own order
25
+ * (that is fine for a single series; when overlaying series with different steps, provide `t`). A series with a single point is drawn as a dot
26
+ * - There are at most three x-axis ticks, at the first, middle and last positions (a number that does not overlap when there are few points). **The label comes from the nearest point of the first series**
27
+ * (when placing by time, a time that exists only in the second or later series does not become a label). It is placed at the point's position
28
+ * - There are three y-axis ticks, top, middle and bottom. So the line does not collapse even when all points have the same value, it is moved up and down only when the range is zero
29
+ * - The default of `formatValue` has **a number of digits that depends on the data's range** (ticks can be told apart even for values from 0 to 1). Ticks, the tooltip and the table for screen readers
30
+ * go through the same formatting. When you pass one, **keep the function reference stable** (a new function every time rebuilds the chart on every render and closes the tooltip).
31
+ * The same goes for `series` (pass a reference the parent does not recreate)
32
+ * - On hover and focus, the tooltip shows the value of each series' point at that position (arrow keys also move it by keyboard), with the series name and colour.
33
+ * **Outside the range where a series has points (up to half the point spacing at the ends), no row is shown for that series** (so a far-away point's value does not look like the value at that position).
34
+ * When the point's label differs from the title, it is added to the row
35
+ * - Reading: the figure is `role="img"` named by `accessibilityLabel` (a summary). The exact values are also held in a hidden table (`table`)
36
+ * - **Series are not told apart by colour alone**: the legend has the series names, and secondary series can be dashed
37
+ */
38
+ export declare function MultiLineChart({ series, height, formatValue, emptyText, accessibilityLabel, style, className, legend, table }: MultiLineChartProps): import("react").JSX.Element;
39
+ //#endregion