@lt-three/love3 0.0.0 → 0.1.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 (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 +17 -0
  13. package/dist/native/analytics/multi-line-chart.js +215 -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 +13 -0
  43. package/dist/native/atom/separator.js +17 -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 +23 -0
  83. package/dist/native/form/form.js +45 -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 +49 -0
  139. package/dist/native/lib/confirm.js +70 -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 +17 -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 +12 -0
  151. package/dist/native/lib/network.js +21 -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 +46 -0
  155. package/dist/native/lib/snackbar.js +60 -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 +40 -0
  237. package/dist/web/atom/segmented-control.js +43 -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 +22 -0
  251. package/dist/web/atom/text-area.js +26 -0
  252. package/dist/web/atom/text-field.d.ts +17 -0
  253. package/dist/web/atom/text-field.js +21 -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 +33 -0
  361. package/dist/web/layout/titled-modal.js +59 -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,45 @@
1
+ import { AnyFieldApi } from "@tanstack/react-form";
2
+ import React from "react";
3
+ //#region src/shared/form.d.ts
4
+ export declare const fieldContext: React.Context<AnyFieldApi>, formContext: React.Context<import("@tanstack/react-form").AnyFormApi>, useFormContext: () => import("@tanstack/react-form").ReactFormExtendedApi<Record<string, never>, any, any, any, any, any, any, any, any, any, any, any>, useFieldContext: <TData>() => import("@tanstack/react-form").FieldApi<any, string, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
5
+ /**
6
+ * フィールドの中なら field を、外なら null を返す(`useFieldContext` は外だと投げる)。
7
+ * 戻り値は null を含む型にしてある。呼び出し側が `?.` を忘れると tsc が落ちる。
8
+ */
9
+ export declare function useOptionalFieldContext(): AnyFieldApi | null;
10
+ /**
11
+ * フィールド型の入力(`form/*`)が共通で受ける props。値は field context(TanStack Form)が持つので、
12
+ * `value` / `onValueChange` は受けない(受けて黙って無視する形にしない)。
13
+ */
14
+ export type FieldInputProps = {
15
+ label?: React.ReactNode;
16
+ required?: boolean;
17
+ placeholder?: string;
18
+ description?: string;
19
+ className?: string;
20
+ wrapperClassName?: string;
21
+ disabled?: boolean;
22
+ helpText?: React.ReactNode;
23
+ debounce?: number;
24
+ /** テスト用の data-testid。実際の input 要素にそのまま付与される。 */
25
+ "data-testid"?: string;
26
+ };
27
+ /**
28
+ * `FieldInputProps` に、制御モード(`value` / `onValueChange` を渡すと field context を使わない)を足したもの。
29
+ * 制御モードを実装している入力(`form/checkbox` `form/switch`)だけが使う。
30
+ */
31
+ export type BaseInputProps<T> = FieldInputProps & ({
32
+ value: T;
33
+ onValueChange: (value: T) => void;
34
+ } | {
35
+ value?: never;
36
+ onValueChange?: never;
37
+ });
38
+ type UseFieldValueProps<T> = {
39
+ emptyValue?: T;
40
+ debounce?: number;
41
+ onChange?: (prevValue: T, newValue: T) => void;
42
+ };
43
+ export declare const useFieldValue: <T>(props?: UseFieldValueProps<T>) => readonly [T, React.Dispatch<React.SetStateAction<T>>, import("@tanstack/react-form").FieldApi<any, string, T, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>];
44
+ //#endregion
45
+ export {};
@@ -0,0 +1,46 @@
1
+ import { createFormHookContexts, useStore } from "@tanstack/react-form";
2
+ import { useDebouncedCallback } from "@tanstack/react-pacer";
3
+ import { isEqual } from "es-toolkit/compat";
4
+ import { useContext, useState } from "react";
5
+
6
+ //#region src/shared/form.ts
7
+ const { fieldContext, formContext, useFormContext, useFieldContext } = createFormHookContexts();
8
+ /**
9
+ * フィールドの中なら field を、外なら null を返す(`useFieldContext` は外だと投げる)。
10
+ * 戻り値は null を含む型にしてある。呼び出し側が `?.` を忘れると tsc が落ちる。
11
+ */
12
+ function useOptionalFieldContext() {
13
+ return useContext(fieldContext);
14
+ }
15
+ function isUpdater(action) {
16
+ return typeof action === "function";
17
+ }
18
+ const useFieldValue = (props) => {
19
+ const field = useFieldContext();
20
+ const formValue = useStore(field.store, (state) => state.value == null && props?.emptyValue != null ? props.emptyValue : state.value);
21
+ const setDebouncedValue = useDebouncedCallback((value) => {
22
+ field.handleChange((current) => {
23
+ if (!isEqual(current, value)) props?.onChange?.(current, value);
24
+ return value;
25
+ });
26
+ }, { wait: props?.debounce ?? 0 });
27
+ const [instantValue, setInstantValue] = useState(formValue);
28
+ const [syncedFormValue, setSyncedFormValue] = useState(formValue);
29
+ if (!Object.is(syncedFormValue, formValue)) {
30
+ setSyncedFormValue(formValue);
31
+ setInstantValue(formValue);
32
+ }
33
+ const setValue = (action) => {
34
+ const resolved = isUpdater(action) ? action(instantValue) : action;
35
+ setInstantValue(resolved);
36
+ setDebouncedValue(resolved);
37
+ };
38
+ return [
39
+ instantValue,
40
+ setValue,
41
+ field
42
+ ];
43
+ };
44
+
45
+ //#endregion
46
+ export { fieldContext, formContext, useFieldContext, useFieldValue, useFormContext, useOptionalFieldContext };
@@ -0,0 +1,3 @@
1
+ import { ChartCommonProps, ColoredValueSharedProps, LineChartSharedProps, LinePoint, LineSeries, MetricCardSharedProps, MultiLineChartSharedProps } from "./analytics.js";
2
+ import { BUTTON_SIZES, BUTTON_VARIANTS, ButtonSize, ButtonVariant } from "./button.js";
3
+ export { BUTTON_SIZES, BUTTON_VARIANTS, type ButtonSize, type ButtonVariant, type ChartCommonProps, type ColoredValueSharedProps, type LineChartSharedProps, type LinePoint, type LineSeries, type MetricCardSharedProps, type MultiLineChartSharedProps };
@@ -0,0 +1,3 @@
1
+ import { BUTTON_SIZES, BUTTON_VARIANTS } from "./button.js";
2
+
3
+ export { BUTTON_SIZES, BUTTON_VARIANTS };
@@ -0,0 +1,30 @@
1
+ //#region src/tokens/contrast-pairs.d.ts
2
+ export type ContrastKind = "text" | "ui";
3
+ /** 検査する前景 / 背景の組。`text` は本文の 4.5:1、`ui` は大きい文字と UI 部品・図形の 3:1。 */
4
+ export declare const CONTRAST_PAIRS: ReadonlyArray<{
5
+ kind: ContrastKind;
6
+ fg: string;
7
+ bg: string;
8
+ }>;
9
+ /**
10
+ * 基準を満たさないと分かっていて、理由があって許している組。キーは `<モード>:<前景>/<背景>`。
11
+ *
12
+ * **ここに足すときは理由を書く。** 例外の組は「まだ基準を下回っている」ことも検査する
13
+ * (満たすようになったら、例外から外すよう落ちる。一覧が実態から離れないようにする)。
14
+ * 無効(disabled)の `ink-300` は WCAG が対象外にしているので、そもそも組に入れていない。
15
+ */
16
+ export declare const KNOWN_CONTRAST_EXCEPTIONS: Readonly<Record<string, string>>;
17
+ /**
18
+ * 淡い塗り(`bg-state-error/5` など、state の色を `alpha` だけ面に混ぜた塗り)の上の、同じ state の文字(12px の本文の 4.5:1)。
19
+ * 半透明の合成値は `CONTRAST_PAIRS`(トークン同士の組)に入らないので、面の色に塗りを合成してから比を計算する(contrast.test.ts)。
20
+ * `usedIn` のファイルが `tintClass` を使っていることもテストが見る(alpha を変えるときは、ここと部品を一緒に直す)。
21
+ */
22
+ export declare const TINTED_STATE_PAIRS: ReadonlyArray<{
23
+ token: string;
24
+ alpha: number;
25
+ tintClass: string;
26
+ usedIn: readonly string[];
27
+ }>;
28
+ /** 淡い塗りを置く面(背景の 4 階層と wash)。 */
29
+ export declare const TINT_SURFACES: readonly ["frame", "paper", "raised", "overlay", "wash"];
30
+ //#endregion
@@ -0,0 +1,404 @@
1
+ //#region src/tokens/contrast-pairs.ts
2
+ /** 検査する前景 / 背景の組。`text` は本文の 4.5:1、`ui` は大きい文字と UI 部品・図形の 3:1。 */
3
+ const CONTRAST_PAIRS = [
4
+ {
5
+ kind: "text",
6
+ fg: "foreground",
7
+ bg: "background"
8
+ },
9
+ {
10
+ kind: "text",
11
+ fg: "card-foreground",
12
+ bg: "card"
13
+ },
14
+ {
15
+ kind: "text",
16
+ fg: "popover-foreground",
17
+ bg: "popover"
18
+ },
19
+ {
20
+ kind: "text",
21
+ fg: "primary-foreground",
22
+ bg: "primary"
23
+ },
24
+ {
25
+ kind: "text",
26
+ fg: "secondary-foreground",
27
+ bg: "secondary"
28
+ },
29
+ {
30
+ kind: "text",
31
+ fg: "accent-foreground",
32
+ bg: "accent"
33
+ },
34
+ {
35
+ kind: "text",
36
+ fg: "destructive-foreground",
37
+ bg: "destructive"
38
+ },
39
+ {
40
+ kind: "text",
41
+ fg: "sidebar-foreground",
42
+ bg: "sidebar"
43
+ },
44
+ {
45
+ kind: "text",
46
+ fg: "sidebar-primary-foreground",
47
+ bg: "sidebar-primary"
48
+ },
49
+ {
50
+ kind: "text",
51
+ fg: "sidebar-accent-foreground",
52
+ bg: "sidebar-accent"
53
+ },
54
+ {
55
+ kind: "text",
56
+ fg: "action-foreground",
57
+ bg: "action"
58
+ },
59
+ {
60
+ kind: "text",
61
+ fg: "action-foreground",
62
+ bg: "action-hover"
63
+ },
64
+ {
65
+ kind: "text",
66
+ fg: "destructive-solid-foreground",
67
+ bg: "destructive-solid"
68
+ },
69
+ {
70
+ kind: "text",
71
+ fg: "ink-900",
72
+ bg: "frame"
73
+ },
74
+ {
75
+ kind: "text",
76
+ fg: "ink-900",
77
+ bg: "paper"
78
+ },
79
+ {
80
+ kind: "text",
81
+ fg: "ink-900",
82
+ bg: "raised"
83
+ },
84
+ {
85
+ kind: "text",
86
+ fg: "ink-900",
87
+ bg: "overlay"
88
+ },
89
+ {
90
+ kind: "text",
91
+ fg: "ink-900",
92
+ bg: "wash"
93
+ },
94
+ {
95
+ kind: "text",
96
+ fg: "ink-700",
97
+ bg: "frame"
98
+ },
99
+ {
100
+ kind: "text",
101
+ fg: "ink-700",
102
+ bg: "paper"
103
+ },
104
+ {
105
+ kind: "text",
106
+ fg: "ink-700",
107
+ bg: "raised"
108
+ },
109
+ {
110
+ kind: "text",
111
+ fg: "ink-700",
112
+ bg: "overlay"
113
+ },
114
+ {
115
+ kind: "text",
116
+ fg: "ink-700",
117
+ bg: "wash"
118
+ },
119
+ {
120
+ kind: "text",
121
+ fg: "muted-foreground",
122
+ bg: "frame"
123
+ },
124
+ {
125
+ kind: "text",
126
+ fg: "muted-foreground",
127
+ bg: "background"
128
+ },
129
+ {
130
+ kind: "text",
131
+ fg: "muted-foreground",
132
+ bg: "raised"
133
+ },
134
+ {
135
+ kind: "text",
136
+ fg: "muted-foreground",
137
+ bg: "overlay"
138
+ },
139
+ {
140
+ kind: "text",
141
+ fg: "muted-foreground",
142
+ bg: "muted"
143
+ },
144
+ {
145
+ kind: "text",
146
+ fg: "action-ink",
147
+ bg: "frame"
148
+ },
149
+ {
150
+ kind: "text",
151
+ fg: "action-ink",
152
+ bg: "paper"
153
+ },
154
+ {
155
+ kind: "text",
156
+ fg: "action-ink",
157
+ bg: "raised"
158
+ },
159
+ {
160
+ kind: "text",
161
+ fg: "action-ink",
162
+ bg: "overlay"
163
+ },
164
+ {
165
+ kind: "text",
166
+ fg: "action-ink",
167
+ bg: "wash"
168
+ },
169
+ {
170
+ kind: "text",
171
+ fg: "state-success",
172
+ bg: "frame"
173
+ },
174
+ {
175
+ kind: "text",
176
+ fg: "state-success",
177
+ bg: "paper"
178
+ },
179
+ {
180
+ kind: "text",
181
+ fg: "state-success",
182
+ bg: "raised"
183
+ },
184
+ {
185
+ kind: "text",
186
+ fg: "state-success",
187
+ bg: "overlay"
188
+ },
189
+ {
190
+ kind: "text",
191
+ fg: "state-success",
192
+ bg: "wash"
193
+ },
194
+ {
195
+ kind: "text",
196
+ fg: "state-error",
197
+ bg: "frame"
198
+ },
199
+ {
200
+ kind: "text",
201
+ fg: "state-error",
202
+ bg: "paper"
203
+ },
204
+ {
205
+ kind: "text",
206
+ fg: "state-error",
207
+ bg: "raised"
208
+ },
209
+ {
210
+ kind: "text",
211
+ fg: "state-error",
212
+ bg: "overlay"
213
+ },
214
+ {
215
+ kind: "text",
216
+ fg: "state-error",
217
+ bg: "wash"
218
+ },
219
+ {
220
+ kind: "text",
221
+ fg: "state-warning",
222
+ bg: "frame"
223
+ },
224
+ {
225
+ kind: "text",
226
+ fg: "state-warning",
227
+ bg: "paper"
228
+ },
229
+ {
230
+ kind: "text",
231
+ fg: "state-warning",
232
+ bg: "raised"
233
+ },
234
+ {
235
+ kind: "text",
236
+ fg: "state-warning",
237
+ bg: "overlay"
238
+ },
239
+ {
240
+ kind: "text",
241
+ fg: "state-warning",
242
+ bg: "wash"
243
+ },
244
+ {
245
+ kind: "text",
246
+ fg: "lt-three-foreground",
247
+ bg: "lt-three"
248
+ },
249
+ {
250
+ kind: "ui",
251
+ fg: "ring",
252
+ bg: "frame"
253
+ },
254
+ {
255
+ kind: "ui",
256
+ fg: "ring",
257
+ bg: "background"
258
+ },
259
+ {
260
+ kind: "ui",
261
+ fg: "ring",
262
+ bg: "raised"
263
+ },
264
+ {
265
+ kind: "ui",
266
+ fg: "ring",
267
+ bg: "overlay"
268
+ },
269
+ {
270
+ kind: "ui",
271
+ fg: "ring",
272
+ bg: "wash"
273
+ },
274
+ {
275
+ kind: "ui",
276
+ fg: "line-control",
277
+ bg: "frame"
278
+ },
279
+ {
280
+ kind: "ui",
281
+ fg: "line-control",
282
+ bg: "background"
283
+ },
284
+ {
285
+ kind: "ui",
286
+ fg: "line-control",
287
+ bg: "raised"
288
+ },
289
+ {
290
+ kind: "ui",
291
+ fg: "line-control",
292
+ bg: "overlay"
293
+ },
294
+ {
295
+ kind: "ui",
296
+ fg: "line-control",
297
+ bg: "wash"
298
+ },
299
+ {
300
+ kind: "ui",
301
+ fg: "action",
302
+ bg: "frame"
303
+ },
304
+ {
305
+ kind: "ui",
306
+ fg: "action",
307
+ bg: "paper"
308
+ },
309
+ {
310
+ kind: "ui",
311
+ fg: "action",
312
+ bg: "raised"
313
+ },
314
+ {
315
+ kind: "ui",
316
+ fg: "action",
317
+ bg: "overlay"
318
+ },
319
+ {
320
+ kind: "ui",
321
+ fg: "action",
322
+ bg: "wash"
323
+ },
324
+ {
325
+ kind: "ui",
326
+ fg: "border",
327
+ bg: "background"
328
+ },
329
+ {
330
+ kind: "ui",
331
+ fg: "input",
332
+ bg: "background"
333
+ },
334
+ {
335
+ kind: "ui",
336
+ fg: "lt-three",
337
+ bg: "paper"
338
+ },
339
+ {
340
+ kind: "ui",
341
+ fg: "chart-1",
342
+ bg: "paper"
343
+ },
344
+ {
345
+ kind: "ui",
346
+ fg: "chart-2",
347
+ bg: "paper"
348
+ },
349
+ {
350
+ kind: "ui",
351
+ fg: "chart-3",
352
+ bg: "paper"
353
+ },
354
+ {
355
+ kind: "ui",
356
+ fg: "chart-4",
357
+ bg: "paper"
358
+ },
359
+ {
360
+ kind: "ui",
361
+ fg: "chart-5",
362
+ bg: "paper"
363
+ }
364
+ ];
365
+ /**
366
+ * 基準を満たさないと分かっていて、理由があって許している組。キーは `<モード>:<前景>/<背景>`。
367
+ *
368
+ * **ここに足すときは理由を書く。** 例外の組は「まだ基準を下回っている」ことも検査する
369
+ * (満たすようになったら、例外から外すよう落ちる。一覧が実態から離れないようにする)。
370
+ * 無効(disabled)の `ink-300` は WCAG が対象外にしているので、そもそも組に入れていない。
371
+ */
372
+ const KNOWN_CONTRAST_EXCEPTIONS = {
373
+ "light:border/background": "1px の極薄の枠(#e6e7eb)は面の区切りで、情報は文字と余白・面の明るさの差が持つ。カードや区切り線の輪郭は 3:1 に届かない(1.23:1)。Linear 流の「枠は極めて薄く」を意図した値",
374
+ "dark:border/background": "同上(ダークは 1.24:1)",
375
+ "light:input/background": "**テキスト入力(Input・Textarea・Select のトリガー)の枠だけ**の例外。枠(line-strong #d5d7dd)は 3:1 に届かない(1.4:1)が、入力欄はラベル・プレースホルダ・フォーカス時のインディゴの枠(4.7:1)でも識別できる。Checkbox・Radio・Switch の枠は、文字を持たず形だけで識別されるので例外にせず line-control(3:1 以上)にした",
376
+ "dark:input/background": "同上(ダークは 1.54:1)",
377
+ "light:lt-three/paper": "ブランドのピンク(#ff5c76)は塗りとして使い、必ず黒文字を載せる(7.04:1)。紙の上の単独の図形としては 2.98:1 で 3:1 にわずかに届かない"
378
+ };
379
+ /**
380
+ * 淡い塗り(`bg-state-error/5` など、state の色を `alpha` だけ面に混ぜた塗り)の上の、同じ state の文字(12px の本文の 4.5:1)。
381
+ * 半透明の合成値は `CONTRAST_PAIRS`(トークン同士の組)に入らないので、面の色に塗りを合成してから比を計算する(contrast.test.ts)。
382
+ * `usedIn` のファイルが `tintClass` を使っていることもテストが見る(alpha を変えるときは、ここと部品を一緒に直す)。
383
+ */
384
+ const TINTED_STATE_PAIRS = [{
385
+ token: "state-error",
386
+ alpha: .05,
387
+ tintClass: "bg-state-error/5",
388
+ usedIn: [
389
+ "../web/base/badge.tsx",
390
+ "../web/base/alert.tsx",
391
+ "../native/atom/badge.tsx"
392
+ ]
393
+ }];
394
+ /** 淡い塗りを置く面(背景の 4 階層と wash)。 */
395
+ const TINT_SURFACES = [
396
+ "frame",
397
+ "paper",
398
+ "raised",
399
+ "overlay",
400
+ "wash"
401
+ ];
402
+
403
+ //#endregion
404
+ export { CONTRAST_PAIRS, KNOWN_CONTRAST_EXCEPTIONS, TINTED_STATE_PAIRS, TINT_SURFACES };
@@ -0,0 +1,6 @@
1
+ import { TokenName, TokenValues, tokenNames, tokens } from "./tokens.gen.js";
2
+ //#region src/tokens/index.d.ts
3
+ /** CSS 変数の参照(`var(--ink-500)`)。実値が要るときは `tokens.light[name]` / `tokens.dark[name]`。 */
4
+ export declare function cssVar(name: TokenName): string;
5
+ //#endregion
6
+ export { type TokenName, type TokenValues, tokenNames, tokens };
@@ -0,0 +1,10 @@
1
+ import { tokenNames, tokens } from "./tokens.gen.js";
2
+
3
+ //#region src/tokens/index.ts
4
+ /** CSS 変数の参照(`var(--ink-500)`)。実値が要るときは `tokens.light[name]` / `tokens.dark[name]`。 */
5
+ function cssVar(name) {
6
+ return `var(--${name})`;
7
+ }
8
+
9
+ //#endregion
10
+ export { cssVar, tokenNames, tokens };