@lt-three/love3 0.1.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 (271) hide show
  1. package/README.md +40 -40
  2. package/dist/native/analytics/animation.d.ts +1 -1
  3. package/dist/native/analytics/animation.js +1 -1
  4. package/dist/native/analytics/chart.types.d.ts +3 -3
  5. package/dist/native/analytics/metric-card.d.ts +3 -3
  6. package/dist/native/analytics/metric-card.js +3 -3
  7. package/dist/native/analytics/multi-line-chart.d.ts +9 -8
  8. package/dist/native/analytics/multi-line-chart.js +14 -13
  9. package/dist/native/analytics/pie-chart.d.ts +7 -7
  10. package/dist/native/analytics/pie-chart.js +8 -8
  11. package/dist/native/analytics/single-number.d.ts +4 -4
  12. package/dist/native/analytics/single-number.js +2 -2
  13. package/dist/native/atom/avatar.d.ts +6 -6
  14. package/dist/native/atom/avatar.js +2 -2
  15. package/dist/native/atom/badge.d.ts +5 -5
  16. package/dist/native/atom/button.d.ts +12 -12
  17. package/dist/native/atom/button.js +8 -8
  18. package/dist/native/atom/checkbox.d.ts +4 -4
  19. package/dist/native/atom/checkbox.js +2 -2
  20. package/dist/native/atom/colored-value.d.ts +4 -4
  21. package/dist/native/atom/colored-value.js +4 -4
  22. package/dist/native/atom/image.d.ts +7 -7
  23. package/dist/native/atom/image.js +2 -2
  24. package/dist/native/atom/label.d.ts +5 -5
  25. package/dist/native/atom/label.js +2 -2
  26. package/dist/native/atom/link.d.ts +5 -5
  27. package/dist/native/atom/link.js +5 -5
  28. package/dist/native/atom/readout.d.ts +7 -7
  29. package/dist/native/atom/readout.js +3 -3
  30. package/dist/native/atom/search-input.d.ts +2 -2
  31. package/dist/native/atom/search-input.js +2 -2
  32. package/dist/native/atom/select.d.ts +14 -14
  33. package/dist/native/atom/select.js +8 -8
  34. package/dist/native/atom/separator.d.ts +2 -3
  35. package/dist/native/atom/separator.js +2 -3
  36. package/dist/native/atom/skeleton.d.ts +3 -3
  37. package/dist/native/atom/skeleton.js +3 -3
  38. package/dist/native/atom/slider.d.ts +6 -6
  39. package/dist/native/atom/slider.js +3 -3
  40. package/dist/native/atom/spinner.d.ts +4 -4
  41. package/dist/native/atom/spinner.js +2 -2
  42. package/dist/native/atom/switch.d.ts +4 -4
  43. package/dist/native/atom/switch.js +3 -3
  44. package/dist/native/atom/symbol.d.ts +7 -7
  45. package/dist/native/atom/symbol.js +7 -7
  46. package/dist/native/atom/symbol.types.d.ts +8 -8
  47. package/dist/native/atom/symbol.types.js +7 -7
  48. package/dist/native/atom/text-field.d.ts +15 -15
  49. package/dist/native/atom/text-field.js +5 -5
  50. package/dist/native/atom/theme-toggle.d.ts +7 -7
  51. package/dist/native/atom/theme-toggle.js +4 -4
  52. package/dist/native/atom/timezone-select.d.ts +5 -5
  53. package/dist/native/atom/timezone-select.js +4 -4
  54. package/dist/native/atom/typography.d.ts +2 -2
  55. package/dist/native/atom/typography.js +2 -2
  56. package/dist/native/base/button.d.ts +13 -13
  57. package/dist/native/base/button.js +4 -4
  58. package/dist/native/base/form.d.ts +15 -15
  59. package/dist/native/base/form.js +11 -11
  60. package/dist/native/base/glass-card.d.ts +3 -3
  61. package/dist/native/base/glass-card.js +3 -3
  62. package/dist/native/base/input.d.ts +8 -8
  63. package/dist/native/base/input.js +7 -7
  64. package/dist/native/base/sheet.d.ts +27 -27
  65. package/dist/native/base/sheet.js +15 -15
  66. package/dist/native/form/checkbox.d.ts +3 -3
  67. package/dist/native/form/checkbox.js +2 -2
  68. package/dist/native/form/date-picker.d.ts +9 -9
  69. package/dist/native/form/date-picker.js +9 -9
  70. package/dist/native/form/form.d.ts +5 -6
  71. package/dist/native/form/form.js +4 -5
  72. package/dist/native/form/radio-group.d.ts +5 -5
  73. package/dist/native/form/radio-group.js +4 -4
  74. package/dist/native/form/select.d.ts +2 -2
  75. package/dist/native/form/select.js +2 -2
  76. package/dist/native/form/slider.d.ts +2 -2
  77. package/dist/native/form/slider.js +2 -2
  78. package/dist/native/form/switch.d.ts +2 -2
  79. package/dist/native/form/switch.js +2 -2
  80. package/dist/native/form/text-area.d.ts +2 -2
  81. package/dist/native/form/text-area.js +1 -1
  82. package/dist/native/form/text-input.d.ts +5 -5
  83. package/dist/native/form/text-input.js +8 -8
  84. package/dist/native/layout/accordion.d.ts +5 -5
  85. package/dist/native/layout/accordion.js +2 -2
  86. package/dist/native/layout/card.d.ts +8 -8
  87. package/dist/native/layout/card.js +3 -3
  88. package/dist/native/layout/description.d.ts +2 -2
  89. package/dist/native/layout/description.js +2 -2
  90. package/dist/native/layout/error.d.ts +5 -5
  91. package/dist/native/layout/error.js +2 -2
  92. package/dist/native/layout/information.d.ts +4 -4
  93. package/dist/native/layout/information.js +3 -3
  94. package/dist/native/layout/locked.d.ts +15 -15
  95. package/dist/native/layout/locked.js +7 -7
  96. package/dist/native/layout/modal.d.ts +8 -8
  97. package/dist/native/layout/modal.js +5 -5
  98. package/dist/native/layout/not-found.d.ts +4 -4
  99. package/dist/native/layout/not-found.js +3 -3
  100. package/dist/native/layout/page-frame.d.ts +8 -8
  101. package/dist/native/layout/page-frame.js +3 -3
  102. package/dist/native/layout/panel.d.ts +5 -5
  103. package/dist/native/layout/panel.js +5 -5
  104. package/dist/native/layout/reorderable-list.d.ts +14 -14
  105. package/dist/native/layout/reorderable-list.js +10 -10
  106. package/dist/native/layout/sheet.d.ts +10 -10
  107. package/dist/native/layout/sheet.js +4 -4
  108. package/dist/native/layout/simple-dialog.d.ts +3 -3
  109. package/dist/native/layout/simple-dialog.js +2 -2
  110. package/dist/native/layout/simple-table.d.ts +18 -18
  111. package/dist/native/layout/simple-table.js +1 -1
  112. package/dist/native/layout/tab-bar.d.ts +10 -10
  113. package/dist/native/layout/tab-bar.js +4 -4
  114. package/dist/native/layout/tabs.d.ts +6 -6
  115. package/dist/native/layout/tabs.js +4 -4
  116. package/dist/native/layout/tuning-panel.d.ts +10 -10
  117. package/dist/native/layout/tuning-panel.js +15 -15
  118. package/dist/native/lib/autocomplete.d.ts +1 -1
  119. package/dist/native/lib/autocomplete.js +1 -1
  120. package/dist/native/lib/breakpoints.d.ts +3 -3
  121. package/dist/native/lib/breakpoints.js +3 -3
  122. package/dist/native/lib/chart-palette.d.ts +2 -2
  123. package/dist/native/lib/chart-palette.js +2 -2
  124. package/dist/native/lib/confirm.d.ts +15 -16
  125. package/dist/native/lib/confirm.js +9 -10
  126. package/dist/native/lib/control.d.ts +9 -9
  127. package/dist/native/lib/external-store.d.ts +4 -5
  128. package/dist/native/lib/keyboard.d.ts +7 -7
  129. package/dist/native/lib/keyboard.js +7 -7
  130. package/dist/native/lib/labels.d.ts +6 -6
  131. package/dist/native/lib/labels.js +6 -6
  132. package/dist/native/lib/loading.d.ts +3 -3
  133. package/dist/native/lib/loading.js +3 -3
  134. package/dist/native/lib/network.d.ts +5 -6
  135. package/dist/native/lib/network.js +5 -6
  136. package/dist/native/lib/scheme.d.ts +7 -7
  137. package/dist/native/lib/scheme.js +3 -3
  138. package/dist/native/lib/snackbar.d.ts +12 -13
  139. package/dist/native/lib/snackbar.js +7 -8
  140. package/dist/native/lib/theme.d.ts +15 -15
  141. package/dist/native/lib/theme.js +15 -15
  142. package/dist/native/lib/timezone.d.ts +13 -13
  143. package/dist/native/lib/timezone.js +13 -13
  144. package/dist/native/lib/token-color.d.ts +1 -1
  145. package/dist/native/lib/token-color.js +1 -1
  146. package/dist/native/lib/tuning-context.d.ts +2 -2
  147. package/dist/native/lib/tuning.d.ts +10 -10
  148. package/dist/native/lib/tuning.js +8 -8
  149. package/dist/native/lib/typography.d.ts +3 -3
  150. package/dist/native/lib/typography.js +3 -3
  151. package/dist/native/lib/utils.d.ts +3 -3
  152. package/dist/native/lib/utils.js +3 -3
  153. package/dist/native/once/confirm.d.ts +2 -2
  154. package/dist/native/once/confirm.js +2 -2
  155. package/dist/native/once/error-boundary.d.ts +3 -3
  156. package/dist/native/once/error-boundary.js +2 -2
  157. package/dist/native/once/loading-lock.d.ts +3 -3
  158. package/dist/native/once/loading-lock.js +3 -3
  159. package/dist/native/once/offline-banner.d.ts +6 -6
  160. package/dist/native/once/offline-banner.js +5 -5
  161. package/dist/native/once/snackbar.d.ts +7 -7
  162. package/dist/native/once/snackbar.js +5 -5
  163. package/dist/native/styles.css +21 -21
  164. package/dist/shared/analytics.d.ts +23 -23
  165. package/dist/shared/button.d.ts +1 -1
  166. package/dist/shared/form.d.ts +7 -7
  167. package/dist/shared/form.js +2 -2
  168. package/dist/tokens/contrast-pairs.d.ts +9 -9
  169. package/dist/tokens/contrast-pairs.js +10 -10
  170. package/dist/tokens/index.d.ts +1 -1
  171. package/dist/tokens/index.js +1 -1
  172. package/dist/tokens/styles.gen.css +87 -87
  173. package/dist/tokens/tokens.gen.d.ts +2 -2
  174. package/dist/tokens/tokens.gen.js +2 -2
  175. package/dist/tuning/catalog.d.ts +8 -8
  176. package/dist/tuning/catalog.js +9 -9
  177. package/dist/tuning/color.d.ts +4 -4
  178. package/dist/tuning/color.js +5 -5
  179. package/dist/tuning/css.d.ts +13 -13
  180. package/dist/tuning/css.js +17 -17
  181. package/dist/tuning/model.d.ts +11 -11
  182. package/dist/tuning/model.js +11 -11
  183. package/dist/tuning/native.d.ts +18 -18
  184. package/dist/tuning/native.js +18 -18
  185. package/dist/tuning/schema.d.ts +15 -15
  186. package/dist/tuning/schema.js +22 -22
  187. package/dist/tuning/types.d.ts +25 -25
  188. package/dist/tuning/types.js +6 -6
  189. package/dist/web/analytics/line-chart.d.ts +6 -6
  190. package/dist/web/analytics/line-chart.js +3 -3
  191. package/dist/web/analytics/metric-card.d.ts +6 -6
  192. package/dist/web/analytics/metric-card.js +5 -5
  193. package/dist/web/analytics/multi-line-chart.d.ts +23 -23
  194. package/dist/web/analytics/multi-line-chart.js +33 -33
  195. package/dist/web/atom/avatar.d.ts +1 -1
  196. package/dist/web/atom/checkbox.d.ts +6 -6
  197. package/dist/web/atom/checkbox.js +2 -2
  198. package/dist/web/atom/colored-value.d.ts +4 -4
  199. package/dist/web/atom/colored-value.js +4 -4
  200. package/dist/web/atom/help.d.ts +1 -1
  201. package/dist/web/atom/segmented-control.d.ts +13 -14
  202. package/dist/web/atom/segmented-control.js +6 -7
  203. package/dist/web/atom/select.d.ts +7 -7
  204. package/dist/web/atom/select.js +5 -5
  205. package/dist/web/atom/slider.d.ts +3 -3
  206. package/dist/web/atom/slider.js +2 -2
  207. package/dist/web/atom/switch.d.ts +3 -3
  208. package/dist/web/atom/text-area.d.ts +9 -8
  209. package/dist/web/atom/text-area.js +9 -8
  210. package/dist/web/atom/text-field.d.ts +5 -4
  211. package/dist/web/atom/text-field.js +5 -4
  212. package/dist/web/atom/toggle-chip.d.ts +6 -6
  213. package/dist/web/atom/toggle-chip.js +4 -4
  214. package/dist/web/atom/tooltip.d.ts +6 -6
  215. package/dist/web/atom/tooltip.js +2 -2
  216. package/dist/web/base/accordion.js +1 -1
  217. package/dist/web/base/breadcrumb.d.ts +1 -1
  218. package/dist/web/base/breadcrumb.js +1 -1
  219. package/dist/web/base/card.d.ts +3 -3
  220. package/dist/web/base/card.js +2 -2
  221. package/dist/web/base/dialog.d.ts +1 -1
  222. package/dist/web/base/dialog.js +1 -1
  223. package/dist/web/base/form.d.ts +7 -7
  224. package/dist/web/base/form.js +5 -5
  225. package/dist/web/base/pagination.d.ts +5 -5
  226. package/dist/web/base/pagination.js +1 -1
  227. package/dist/web/base/sheet.d.ts +1 -1
  228. package/dist/web/base/sheet.js +1 -1
  229. package/dist/web/base/slider.d.ts +1 -1
  230. package/dist/web/base/sonner.d.ts +2 -2
  231. package/dist/web/base/sonner.js +2 -2
  232. package/dist/web/base/spinner.js +1 -1
  233. package/dist/web/form/checkbox.d.ts +8 -8
  234. package/dist/web/form/checkbox.js +3 -3
  235. package/dist/web/form/radio-group.js +3 -3
  236. package/dist/web/form/select.js +1 -1
  237. package/dist/web/form/slider.d.ts +3 -3
  238. package/dist/web/form/slider.js +3 -3
  239. package/dist/web/form/switch.d.ts +3 -3
  240. package/dist/web/form/switch.js +4 -4
  241. package/dist/web/form/text-area.js +1 -1
  242. package/dist/web/form/text-input.d.ts +1 -1
  243. package/dist/web/form/text-input.js +1 -1
  244. package/dist/web/layout/accordion.d.ts +5 -5
  245. package/dist/web/layout/accordion.js +2 -2
  246. package/dist/web/layout/alert-modal.d.ts +11 -11
  247. package/dist/web/layout/alert-modal.js +7 -7
  248. package/dist/web/layout/card.d.ts +1 -1
  249. package/dist/web/layout/information.d.ts +9 -9
  250. package/dist/web/layout/information.js +7 -7
  251. package/dist/web/layout/modal.d.ts +1 -1
  252. package/dist/web/layout/page-frame.d.ts +14 -14
  253. package/dist/web/layout/page-frame.js +7 -7
  254. package/dist/web/layout/scroll-area.d.ts +1 -1
  255. package/dist/web/layout/sheet.d.ts +4 -4
  256. package/dist/web/layout/simple-table.d.ts +18 -18
  257. package/dist/web/layout/simple-table.js +2 -2
  258. package/dist/web/layout/tabs.d.ts +4 -4
  259. package/dist/web/layout/titled-modal.d.ts +10 -11
  260. package/dist/web/layout/titled-modal.js +7 -8
  261. package/dist/web/lib/css-vars.d.ts +6 -6
  262. package/dist/web/lib/css-vars.js +5 -5
  263. package/dist/web/lib/dialog.d.ts +4 -4
  264. package/dist/web/lib/labels.d.ts +8 -8
  265. package/dist/web/lib/labels.js +8 -8
  266. package/dist/web/lib/modal-open-focus.d.ts +7 -7
  267. package/dist/web/lib/modal-open-focus.js +9 -9
  268. package/dist/web/lib/restore-focus.d.ts +4 -4
  269. package/dist/web/lib/restore-focus.js +4 -4
  270. package/dist/web/styles.css +33 -33
  271. package/package.json +2 -2
@@ -2,38 +2,38 @@ import { ChartCommonProps, MultiLineChartSharedProps } from "../../shared/analyt
2
2
  import { CSSProperties } from "react";
3
3
  //#region src/web/analytics/multi-line-chart.d.ts
4
4
  export type MultiLineChartProps = ChartCommonProps & MultiLineChartSharedProps & {
5
- /** 外側の要素に渡す style(native の `style: ViewStyle` に当たる)。 */
5
+ /** Style passed to the outer element (corresponds to native's `style: ViewStyle`). */
6
6
  style?: CSSProperties;
7
7
  className?: string;
8
- /** 凡例を出すか(既定は出す。native の `MultiLineChart` は系列が 1 本でも出す)。 */
8
+ /** Whether to show the legend (shown by default. Native's `MultiLineChart` shows it even for a single series). */
9
9
  legend?: boolean;
10
10
  /**
11
- * 読み上げ用の隠した表(系列・見出し・値)を出すか(既定は出す)。
12
- * 図形の名前(`accessibilityLabel`)だけでは正確な値が読めないので、同じ値を HTML の表でも持つ。
13
- * 値は `formatValue` と同じ整形を通す。**1 系列が 60 点を超えるときは、DOM が膨らまないよう等間隔に 60 点へ抜き出し**、
14
- * その旨を表の前に一文で添える(全点の正確な値が要るなら、使う側の表や CSV で出す)。
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
15
  */
16
16
  table?: boolean;
17
17
  };
18
18
  /**
19
- * 複数系列の折れ線。native の `analytics/multi-line-chart` と同じ API(`shared/analytics.ts`)。
20
- * 描画は `@tanstack/charts`(SVG)。目盛りの罫線は 1px の細い線で、色は `--chart-1〜5`・ツールチップは overlay 面 + 影。
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
21
  *
22
- * - **数でない点は除く**: `y`(と `t`)が有限でない点(NaN・Infinity)は、組む前に取り除く(読み上げ用の表にも出さず、
23
- * 除いた件数を表に添える)。全部除かれたら `emptyText`
24
- * - 全系列が `t` を持つなら **時間で横位置を決める**。持たないものが 1 つでもあれば、系列ごとに並び順で等間隔に置く
25
- * (単一系列ならそれでよい。刻みの違う系列を重ねるなら `t` を入れる)。1 点だけの系列は点(dot)で描く
26
- * - 横軸の目盛りは先頭・中・末の位置の 3 つまで(点が少なければ重ならない数)。**見出しは、先頭の系列の最も近い点のもの**
27
- * (時間で置くとき、2 本目以降の系列にしかない時刻は、見出しにならない)。点の位置に置く
28
- * - 縦軸の目盛りは上・中・下の 3 本。全点が同じ値でも線が潰れないよう、幅ゼロのときだけ上下に逃がす
29
- * - `formatValue` の既定は、**データの幅に応じた桁数**(0〜1 の値でも目盛りが区別できる)。目盛り・ツールチップ・読み上げの表が
30
- * 同じ整形を通る。渡すときは **関数の参照を安定させる**(毎回新しい関数だと、描画のたびにチャートを組み直し、ツールチップが閉じる)。
31
- * `series` も同じ(親が作り直さない参照を渡す)
32
- * - ホバー・フォーカスで、その位置の各系列の点の値をツールチップに出す(キーボードでも矢印で移れる)。系列名と色を添える。
33
- * **系列の点がある範囲(端は点の間隔の半分まで)の外では、その系列の行を出さない**(遠い点の値を、その位置の値のように見せない)。
34
- * 点の見出しがタイトルと違うときは、行に添える
35
- * - 読み上げ: 図形は `role="img"` で、`accessibilityLabel`(要約)が名前。正確な値は隠した表でも持つ(`table`)
36
- * - **色だけで系列を見分けさせない**: 凡例に系列名があり、副系列は破線にできる
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
37
  */
38
38
  export declare function MultiLineChart({ series, height, formatValue, emptyText, accessibilityLabel, style, className, legend, table }: MultiLineChartProps): import("react").JSX.Element;
39
39
  //#endregion
@@ -1,6 +1,6 @@
1
+ import { cn } from "../lib/utils.js";
1
2
  import { LINE_CHART_DEFAULT_LABEL, LINE_CHART_EMPTY_TEXT, LINE_CHART_TABLE_POINT_LABEL, LINE_CHART_TABLE_SERIES_LABEL, LINE_CHART_TABLE_VALUE_LABEL, lineChartTableDropped, lineChartTableThinned } from "../lib/labels.js";
2
3
  import { cssVars } from "../lib/css-vars.js";
3
- import { cn } from "../lib/utils.js";
4
4
  import { useMemo } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { defineChart, dot, lineY } from "@tanstack/charts";
@@ -10,7 +10,7 @@ import { tooltip } from "@tanstack/charts/tooltip";
10
10
 
11
11
  //#region src/web/analytics/multi-line-chart.tsx
12
12
  const DEFAULT_HEIGHT = 220;
13
- /** 読み上げ用の表に出す、1 系列あたりの行数の上限。 */
13
+ /** The maximum number of rows per series in the table for screen readers. */
14
14
  const MAX_TABLE_ROWS_PER_SERIES = 60;
15
15
  const THEME = {
16
16
  foreground: "var(--foreground)",
@@ -25,21 +25,21 @@ const THEME = {
25
25
  "var(--chart-5)"
26
26
  ]
27
27
  };
28
- /** 罫線は 1px の細い線(`--line`)。ライブラリの既定の不透明度 0.11 は掛けず、トークンの色のまま出す。 */
28
+ /** Grid lines are thin 1px lines (`--line`). The library's default opacity of 0.11 is not applied, and the token colour is used as is. */
29
29
  const GRID_LINE = {
30
30
  stroke: "var(--line)",
31
31
  strokeOpacity: 1,
32
32
  strokeWidth: 1
33
33
  };
34
- /** 軸の基線は罫線より 1 段濃い(`--line-strong`)。 */
34
+ /** The axis baseline is one step darker than the grid lines (`--line-strong`). */
35
35
  const AXIS_LINE = {
36
36
  stroke: "var(--line-strong)",
37
37
  strokeOpacity: 1,
38
38
  strokeWidth: 1
39
39
  };
40
- /** 目盛りの文字を薄めない(既定は 0.68)。 */
40
+ /** Do not fade tick label text (the default is 0.68). */
41
41
  const TICK_LABELS = { opacity: 1 };
42
- /** キーボードで図形(`svg tabindex=0`)に入ったときのフォーカスは、他の部品と同じ不透明の ring(低アルファは使わない。余白 2px)。 */
42
+ /** Focus when entering the figure (`svg tabindex=0`) by keyboard is the same opaque ring as other components (no low alpha; 2px offset). */
43
43
  const FOCUS_RING = "[&_svg:focus-visible]:rounded-control [&_svg:focus-visible]:ring-2 [&_svg:focus-visible]:ring-ring [&_svg:focus-visible]:ring-offset-2 [&_svg:focus-visible]:ring-offset-background [&_svg:focus-visible]:outline-none";
44
44
  const TOOLTIP_VARS = cssVars({
45
45
  "--ts-chart-tooltip-background": "var(--overlay)",
@@ -51,24 +51,24 @@ const TOOLTIP_VARS = cssVars({
51
51
  "--ts-chart-tooltip-font": "400 12px/16px var(--font-sans)"
52
52
  });
53
53
  /**
54
- * 複数系列の折れ線。native の `analytics/multi-line-chart` と同じ API(`shared/analytics.ts`)。
55
- * 描画は `@tanstack/charts`(SVG)。目盛りの罫線は 1px の細い線で、色は `--chart-1〜5`・ツールチップは overlay 面 + 影。
54
+ * A multi-series line chart. Same API as native's `analytics/multi-line-chart` (`shared/analytics.ts`).
55
+ * 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.
56
56
  *
57
- * - **数でない点は除く**: `y`(と `t`)が有限でない点(NaN・Infinity)は、組む前に取り除く(読み上げ用の表にも出さず、
58
- * 除いた件数を表に添える)。全部除かれたら `emptyText`
59
- * - 全系列が `t` を持つなら **時間で横位置を決める**。持たないものが 1 つでもあれば、系列ごとに並び順で等間隔に置く
60
- * (単一系列ならそれでよい。刻みの違う系列を重ねるなら `t` を入れる)。1 点だけの系列は点(dot)で描く
61
- * - 横軸の目盛りは先頭・中・末の位置の 3 つまで(点が少なければ重ならない数)。**見出しは、先頭の系列の最も近い点のもの**
62
- * (時間で置くとき、2 本目以降の系列にしかない時刻は、見出しにならない)。点の位置に置く
63
- * - 縦軸の目盛りは上・中・下の 3 本。全点が同じ値でも線が潰れないよう、幅ゼロのときだけ上下に逃がす
64
- * - `formatValue` の既定は、**データの幅に応じた桁数**(0〜1 の値でも目盛りが区別できる)。目盛り・ツールチップ・読み上げの表が
65
- * 同じ整形を通る。渡すときは **関数の参照を安定させる**(毎回新しい関数だと、描画のたびにチャートを組み直し、ツールチップが閉じる)。
66
- * `series` も同じ(親が作り直さない参照を渡す)
67
- * - ホバー・フォーカスで、その位置の各系列の点の値をツールチップに出す(キーボードでも矢印で移れる)。系列名と色を添える。
68
- * **系列の点がある範囲(端は点の間隔の半分まで)の外では、その系列の行を出さない**(遠い点の値を、その位置の値のように見せない)。
69
- * 点の見出しがタイトルと違うときは、行に添える
70
- * - 読み上げ: 図形は `role="img"` で、`accessibilityLabel`(要約)が名前。正確な値は隠した表でも持つ(`table`)
71
- * - **色だけで系列を見分けさせない**: 凡例に系列名があり、副系列は破線にできる
57
+ * - **Non-numeric points are dropped**: points whose `y` (or `t`) is not finite (NaN, Infinity) are removed before building
58
+ * (they are not in the table for screen readers either, and the number removed is noted with the table). If everything is removed, `emptyText`
59
+ * - 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
60
+ * (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
61
+ * - 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**
62
+ * (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
63
+ * - 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
64
+ * - 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
65
+ * 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).
66
+ * The same goes for `series` (pass a reference the parent does not recreate)
67
+ * - 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.
68
+ * **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).
69
+ * When the point's label differs from the title, it is added to the row
70
+ * - Reading: the figure is `role="img"` named by `accessibilityLabel` (a summary). The exact values are also held in a hidden table (`table`)
71
+ * - **Series are not told apart by colour alone**: the legend has the series names, and secondary series can be dashed
72
72
  */
73
73
  function MultiLineChart({ series, height = DEFAULT_HEIGHT, formatValue, emptyText = LINE_CHART_EMPTY_TEXT, accessibilityLabel, style, className, legend = true, table = true }) {
74
74
  const label = accessibilityLabel ?? defaultLabel(series);
@@ -119,19 +119,19 @@ function MultiLineChart({ series, height = DEFAULT_HEIGHT, formatValue, emptyTex
119
119
  ]
120
120
  });
121
121
  }
122
- /** 要約が無いときの名前。系列の名前を並べる。 */
122
+ /** The name when there is no summary. It lists the series names. */
123
123
  function defaultLabel(series) {
124
124
  const names = series.map((entry) => entry.label).filter((name) => name !== "");
125
125
  return names.length === 0 ? LINE_CHART_DEFAULT_LABEL : `${names.join("・")}の${LINE_CHART_DEFAULT_LABEL}`;
126
126
  }
127
- /** 等間隔に最大 `limit` 件へ抜き出す(先頭と末尾は必ず残す)。 */
127
+ /** Samples at even intervals down to at most `limit` items (the first and the last are always kept). */
128
128
  function thin(items, limit) {
129
129
  if (items.length <= limit) return [...items];
130
130
  const picked = /* @__PURE__ */ new Set();
131
131
  for (let i = 0; i < limit; i += 1) picked.add(Math.round(i * (items.length - 1) / (limit - 1)));
132
132
  return [...picked].sort((a, b) => a - b).flatMap((index) => items[index] === void 0 ? [] : [items[index]]);
133
133
  }
134
- /** 読み上げ用に隠した表。画面には出さない(sr-only)。値は図形の目盛りと同じ整形を通す。 */
134
+ /** The table hidden for screen readers. It is not shown on screen (sr-only). Values go through the same formatting as the figure's ticks. */
135
135
  function DataTable({ caption, model }) {
136
136
  const total = model.series.reduce((sum, entry) => sum + entry.points.length, 0);
137
137
  const shownSeries = model.series.map((entry) => ({
@@ -173,7 +173,7 @@ function DataTable({ caption, model }) {
173
173
  ]
174
174
  });
175
175
  }
176
- /** `y`(と `t`)が有限の点だけを描く。NaN・Infinity は、スケールを壊すので組む前に除く。 */
176
+ /** Draws only points whose `y` (and `t`) are finite. NaN and Infinity break the scale, so they are dropped before building. */
177
177
  function isUsable(point) {
178
178
  return Number.isFinite(point.y) && (point.t === void 0 || Number.isFinite(point.t));
179
179
  }
@@ -194,18 +194,18 @@ function buildModel(series, formatValue) {
194
194
  format: built.format
195
195
  };
196
196
  }
197
- /** 位置にいちばん近い点。 */
197
+ /** The point nearest to a position. */
198
198
  function nearestRow(entry, position) {
199
199
  let best;
200
200
  for (const row of entry) if (best === void 0 || Math.abs(row.x - position) < Math.abs(best.x - position)) best = row;
201
201
  return best;
202
202
  }
203
- /** 全系列が `t` を持つなら時間で置く。 */
203
+ /** When every series has `t`, place by time. */
204
204
  function isTimed(series) {
205
205
  const times = series.flatMap((entry) => entry.points.map((point) => point.t));
206
206
  return times.length > 0 && times.every((time) => time !== void 0);
207
207
  }
208
- /** 点の横位置(時間があれば時間、無ければ系列の中の並びを 0〜1 に)。 */
208
+ /** The horizontal position of a point (by time when there is time, otherwise its order within the series, mapped to 0 to 1). */
209
209
  function positionOf(timed, index, count, point) {
210
210
  if (timed && point.t !== void 0) return point.t;
211
211
  return count === 1 ? .5 : index / (count - 1);
@@ -220,15 +220,15 @@ function extent(values) {
220
220
  return [min, max];
221
221
  }
222
222
  /**
223
- * 既定の整形。目盛りの間隔(上・中・下の 3 本なので幅の半分)が見分けられる桁数に、もう 1 桁足す(0〜6 桁)。
224
- * 0〜1 の値は 2 桁、100 以上の幅なら整数。ツールチップ・読み上げの表も同じ整形にする。
223
+ * The default formatting. It takes the number of digits that lets the tick spacing (half the range, since there are three ticks, top, middle and bottom) be told apart, and adds one more digit (0 to 6 digits).
224
+ * Values from 0 to 1 get 2 digits, and a range of 100 or more gives integers. The tooltip and the table for screen readers use the same formatting.
225
225
  */
226
226
  function autoFormat(low, high) {
227
227
  const step = (high - low) / 2;
228
228
  const digits = step > 0 && Number.isFinite(step) ? Math.min(6, Math.max(0, Math.ceil(-Math.log10(step)) + 1)) : 0;
229
229
  return (value) => (value === 0 ? 0 : value).toFixed(digits);
230
230
  }
231
- /** 点の範囲の外側にどこまで寄せて、その系列の行を出すか(点の間隔の半分。1 点だけなら横軸の幅の 2%)。 */
231
+ /** How far outside a series' point range its row is still shown (half the point spacing; for a single point, 2% of the x-axis width). */
232
232
  function reachOf(entry, domainWidth) {
233
233
  if (entry.length < 2) return domainWidth * .02;
234
234
  const [min, max] = extent(entry.map((row) => row.x));
@@ -2,7 +2,7 @@ import React from "react";
2
2
  //#region src/web/atom/avatar.d.ts
3
3
  export type AvatarProps = {
4
4
  src?: string;
5
- /** 画像の代替テキスト。既定は空(飾り。隣に名前が出ている前提)。名前の無い単独の顔なら、人の名前を渡す */
5
+ /** Alt text for the image. Empty by default (decorative; assumes the name is shown next to it). For a standalone face with no name, pass the person's name */
6
6
  alt?: string;
7
7
  fallback?: React.ReactNode;
8
8
  className?: string;
@@ -2,18 +2,18 @@ import { Checkbox as Checkbox$1 } from "../base/checkbox.js";
2
2
  import { ComponentProps, ReactNode } from "react";
3
3
  //#region src/web/atom/checkbox.d.ts
4
4
  export type CheckboxProps = Omit<ComponentProps<typeof Checkbox$1>, "checked" | "onCheckedChange"> & {
5
- /** チェック状態 (制御モード) */
5
+ /** Checked state (controlled mode) */
6
6
  checked: boolean;
7
- /** 値変更時に呼ばれる */
7
+ /** Called when the value changes */
8
8
  onCheckedChange: (checked: boolean) => void;
9
- /** チェックボックスの右に表示するラベル */
9
+ /** Label shown to the right of the checkbox */
10
10
  label?: ReactNode;
11
- /** ラッパーの追加クラス */
11
+ /** Extra class for the wrapper */
12
12
  wrapperClassName?: string;
13
13
  };
14
14
  /**
15
- * フォーム文脈に依存しない簡易 Checkbox。
16
- * `label` を渡すと右側にクリック可能なラベルが付く。
15
+ * A simple Checkbox that does not depend on a form context.
16
+ * Passing `label` adds a clickable label on the right.
17
17
  */
18
18
  export declare function Checkbox({ checked, onCheckedChange, label, wrapperClassName, id, ...rest }: CheckboxProps): import("react").JSX.Element;
19
19
  //#endregion
@@ -6,8 +6,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
6
6
 
7
7
  //#region src/web/atom/checkbox.tsx
8
8
  /**
9
- * フォーム文脈に依存しない簡易 Checkbox。
10
- * `label` を渡すと右側にクリック可能なラベルが付く。
9
+ * A simple Checkbox that does not depend on a form context.
10
+ * Passing `label` adds a clickable label on the right.
11
11
  */
12
12
  function Checkbox({ checked, onCheckedChange, label, wrapperClassName, id, ...rest }) {
13
13
  const generated = useId();
@@ -3,11 +3,11 @@ import { ReactNode } from "react";
3
3
  //#region src/web/atom/colored-value.d.ts
4
4
  export type ColoredValueProps<TValue> = ColoredValueSharedProps<TValue>;
5
5
  /**
6
- * 符号で色が変わる数値。native の `atom/colored-value` と同じ API(`shared/analytics.ts`)。
7
- * 既定色は Tailwind の固定パレットでなく、トークンの `state-success` / `state-error`(ライト・ダークとも 4.5:1 以上)。
8
- * 数値なので等幅(タブラー)で描く。
6
+ * A number whose colour changes with its sign. Same API as native's `atom/colored-value` (`shared/analytics.ts`).
7
+ * The default colours are the tokens `state-success` / `state-error` (4.5:1 or more in light and dark), not a fixed Tailwind palette.
8
+ * It is a number, so it is drawn monospaced (tabular).
9
9
  *
10
- * **色だけで伝えない。** 増減は `format` で符号(`+` / `−`)を値に含める(色が見えない人にも増減が伝わる)。
10
+ * **Do not convey meaning by colour alone.** `format` puts the sign (`+` / `−`) into the value, so the direction is clear even to people who cannot see the colour.
11
11
  */
12
12
  export declare function ColoredValue<TValue>({ value, format, isPositive, isNegative, positiveColor, negativeColor, className }: ColoredValueProps<TValue>): ReactNode;
13
13
  //#endregion
@@ -3,11 +3,11 @@ import { jsx } from "react/jsx-runtime";
3
3
 
4
4
  //#region src/web/atom/colored-value.tsx
5
5
  /**
6
- * 符号で色が変わる数値。native の `atom/colored-value` と同じ API(`shared/analytics.ts`)。
7
- * 既定色は Tailwind の固定パレットでなく、トークンの `state-success` / `state-error`(ライト・ダークとも 4.5:1 以上)。
8
- * 数値なので等幅(タブラー)で描く。
6
+ * A number whose colour changes with its sign. Same API as native's `atom/colored-value` (`shared/analytics.ts`).
7
+ * The default colours are the tokens `state-success` / `state-error` (4.5:1 or more in light and dark), not a fixed Tailwind palette.
8
+ * It is a number, so it is drawn monospaced (tabular).
9
9
  *
10
- * **色だけで伝えない。** 増減は `format` で符号(`+` / `−`)を値に含める(色が見えない人にも増減が伝わる)。
10
+ * **Do not convey meaning by colour alone.** `format` puts the sign (`+` / `−`) into the value, so the direction is clear even to people who cannot see the colour.
11
11
  */
12
12
  function ColoredValue({ value, format, isPositive, isNegative, positiveColor = "text-state-success", negativeColor = "text-state-error", className }) {
13
13
  const formatted = format ? format(value) : String(value);
@@ -2,7 +2,7 @@ import React from "react";
2
2
  //#region src/web/atom/help.d.ts
3
3
  type Props = {
4
4
  children: React.ReactNode;
5
- /** トリガーの読み上げ名(アイコンだけの表示なので、名前はここで付ける) */
5
+ /** Accessible name of the trigger (it is shown as an icon only, so the name is given here) */
6
6
  label?: string;
7
7
  };
8
8
  export declare function Help({ children, label }: Props): React.JSX.Element;
@@ -4,7 +4,7 @@ export type SegmentedOption<T extends string | number> = {
4
4
  value: T;
5
5
  label: ReactNode;
6
6
  disabled?: boolean;
7
- /** DEV-E2E: e2e から個々のセグメントを特定するための ID */
7
+ /** DEV-E2E: ID used by e2e to identify individual segments */
8
8
  testId?: string;
9
9
  };
10
10
  export type SegmentedControlProps<T extends string | number> = {
@@ -12,29 +12,28 @@ export type SegmentedControlProps<T extends string | number> = {
12
12
  onValueChange: (value: T) => void;
13
13
  options: SegmentedOption<T>[];
14
14
  /**
15
- * - `joined`(既定)… 1 本の枠を共有し、間に 1px の仕切りが入る
16
- * - `separate` … 各セグメントが独立した枠を持つ
17
- * - `underline` … 枠を持たず、選択中だけ下線が付くタブ
18
- * - `solid` … 各セグメントが 1px の枠を持ち、隣と枠を重ねて並ぶ。選択中はインディゴ塗り
15
+ * - `joined` (default) ... share a single border, with a 1px divider between segments
16
+ * - `separate` ... each segment has its own independent border
17
+ * - `underline` ... no border; tabs where only the selected one gets an underline
18
+ * - `solid` ... each segment has a 1px border and the borders overlap with neighbours. The selected one is filled with indigo
19
19
  */
20
20
  variant?: "joined" | "separate" | "underline" | "solid";
21
- /** `md` は本文サイズ(16/26・pad 9/16)。 */
21
+ /** `md` is the body size (16/26, pad 9/16). */
22
22
  size?: "xs" | "sm" | "md";
23
- /** セグメントを横幅いっぱいに等分する */
23
+ /** Divide the full width equally among the segments */
24
24
  fill?: boolean;
25
25
  className?: string;
26
26
  "aria-label"?: string;
27
27
  };
28
28
  /**
29
- * 排他選択の横並び(タブ・モード選択・間隔選択・絞り込みの種別)。
29
+ * Horizontal exclusive selection (tabs, mode picker, interval picker, filter kinds).
30
30
  *
31
- * 選択中はインディゴ(action)塗り + 白文字になる(角丸は control の段)。
32
- * `role="radiogroup"` を張り、各セグメントに `aria-checked` を付けるので、
33
- * 使用側が aria を組み立てる必要はない。
31
+ * The selected segment gets the indigo (action) fill with white text (corner radius is the control step).
32
+ * It sets `role="radiogroup"` and `aria-checked` on each segment, so callers
33
+ * do not have to assemble aria themselves.
34
34
  *
35
- * アプリ側で `.map` して `<button>` に三項の className を当てる形が
36
- * 18 箇所書かれていた。仕切り線・選択時の見た目の切り替え・キーボード操作の扱いが
37
- * 少しずつ違っていたため、1 つにまとめている。
35
+ * Hand-rolled versions (`.map` over `<button>` with a ternary className) tend to drift in
36
+ * dividers, selected-state styling and keyboard handling, so they are consolidated here.
38
37
  */
39
38
  export declare function SegmentedControl<T extends string | number>({ value, onValueChange, options, variant, size, fill, className, "aria-label": ariaLabel }: SegmentedControlProps<T>): import("react").JSX.Element;
40
39
  //#endregion
@@ -8,15 +8,14 @@ const SIZE = {
8
8
  md: "px-4 py-[9px] text-base leading-[26px]"
9
9
  };
10
10
  /**
11
- * 排他選択の横並び(タブ・モード選択・間隔選択・絞り込みの種別)。
11
+ * Horizontal exclusive selection (tabs, mode picker, interval picker, filter kinds).
12
12
  *
13
- * 選択中はインディゴ(action)塗り + 白文字になる(角丸は control の段)。
14
- * `role="radiogroup"` を張り、各セグメントに `aria-checked` を付けるので、
15
- * 使用側が aria を組み立てる必要はない。
13
+ * The selected segment gets the indigo (action) fill with white text (corner radius is the control step).
14
+ * It sets `role="radiogroup"` and `aria-checked` on each segment, so callers
15
+ * do not have to assemble aria themselves.
16
16
  *
17
- * アプリ側で `.map` して `<button>` に三項の className を当てる形が
18
- * 18 箇所書かれていた。仕切り線・選択時の見た目の切り替え・キーボード操作の扱いが
19
- * 少しずつ違っていたため、1 つにまとめている。
17
+ * Hand-rolled versions (`.map` over `<button>` with a ternary className) tend to drift in
18
+ * dividers, selected-state styling and keyboard handling, so they are consolidated here.
20
19
  */
21
20
  function SegmentedControl({ value, onValueChange, options, variant = "joined", size = "sm", fill, className, "aria-label": ariaLabel }) {
22
21
  return /* @__PURE__ */ jsx("div", {
@@ -4,7 +4,7 @@ import { ComponentProps, ReactNode } from "react";
4
4
  export type SelectOption = {
5
5
  value: string;
6
6
  label: ReactNode;
7
- /** テキスト検索用(label が ReactNode の場合に指定) */
7
+ /** For text search (specify when label is a ReactNode) */
8
8
  textValue?: string;
9
9
  };
10
10
  export type SelectOptionGroup = {
@@ -24,19 +24,19 @@ export type SelectProps = {
24
24
  wrapperClassName?: string;
25
25
  disabled?: boolean;
26
26
  size?: "xs" | "sm" | "default";
27
- /** open 状態の制御 (インライン編集など) */
27
+ /** Controls the open state (inline editing, etc.) */
28
28
  open?: boolean;
29
29
  onOpenChange?: (open: boolean) => void;
30
- /** Trigger 直接の DOM プロパティ (autoFocus・onBlur 等) */
30
+ /** DOM props passed straight to the Trigger (autoFocus, onBlur, etc.) */
31
31
  triggerProps?: ComponentProps<typeof SelectTrigger>;
32
- /** form 側でエラーを差し込むためのスロット */
32
+ /** Slot for the form side to insert an error */
33
33
  errorSlot?: ReactNode;
34
34
  invalid?: boolean;
35
- /** DEV-E2E: e2e からトリガーボタンを特定するための ID */
35
+ /** DEV-E2E: ID used by e2e to identify the trigger button */
36
36
  "data-testid"?: string;
37
- /** トリガーの DOM id。外側の `<label htmlFor>` と対応付けるときに使う。 */
37
+ /** DOM id of the trigger. Use it to pair with an outer `<label htmlFor>`. */
38
38
  id?: string;
39
- /** 可視ラベルが無いときのアクセシブル名。`label` を渡す場合は不要。 */
39
+ /** Accessible name when there is no visible label. Not needed when `label` is passed. */
40
40
  "aria-label"?: string;
41
41
  };
42
42
  export declare function Select({ value, onValueChange, options, placeholder, label, required, description, helpText, className, wrapperClassName, disabled, size, open, onOpenChange, triggerProps, errorSlot, invalid, id, "aria-label": ariaLabel, "data-testid": testId }: SelectProps): import("react").JSX.Element;
@@ -7,12 +7,12 @@ import { jsx, jsxs } from "react/jsx-runtime";
7
7
  //#region src/web/atom/select.tsx
8
8
  const EMPTY_SENTINEL = "__atom_select_empty__";
9
9
  /**
10
- * `""` を「選択肢としての空」ではなく「まだ選んでいない」として扱ってよいか。
10
+ * Whether `""` may be treated as "not selected yet" rather than "an empty choice".
11
11
  *
12
- * センチネルに置き換えると Radix は**値が選ばれている**と解釈するため、
13
- * `<SelectValue placeholder>` が一切描画されない(選択肢に無い値なので中身も空になり、
14
- * トリガーが**無言で空のボタン**になる)。空の選択肢を持たないときは、
15
- * placeholder を自分で描いて「未選択」と分かる形にする。
12
+ * When it is replaced by the sentinel, Radix interprets it as **a value is selected**, so
13
+ * `<SelectValue placeholder>` is not rendered at all (the value is not among the options, so the
14
+ * content is empty too, and the trigger becomes a **silently empty button**). When there is no
15
+ * empty option, draw the placeholder yourself so that it reads as "not selected".
16
16
  */
17
17
  function hasEmptyOption(options) {
18
18
  return options.some((o) => isOptionGroup(o) ? o.options.some((x) => x.value === "") : o.value === "");
@@ -14,7 +14,7 @@ type CommonProps = {
14
14
  min?: number;
15
15
  max: number;
16
16
  step?: number;
17
- /** 値の右側に表示する整形済み文字列。指定が無ければ生の数値(範囲時は ` / ` 区切り)を表示 */
17
+ /** Formatted string shown to the right of the value. If not given, the raw number is shown (a range is separated by ` / `) */
18
18
  formattedValue?: ReactNode;
19
19
  } & Omit<ComponentProps<typeof Slider$1>, "value" | "onValueChange" | "defaultValue" | "min" | "max" | "step" | "disabled" | "className">;
20
20
  export type SliderProps = ({
@@ -25,8 +25,8 @@ export type SliderProps = ({
25
25
  onValueChange: (value: number[]) => void;
26
26
  } & CommonProps);
27
27
  /**
28
- * 制御専用の Slider。単一値 (`number`) と範囲 (`number[]`) の両方を許容する。
29
- * Radix Slider は内部的に `number[]` で扱うため、`number` 入力時はランタイムで配列化する。
28
+ * A controlled-only Slider. Accepts both a single value (`number`) and a range (`number[]`).
29
+ * Radix Slider handles `number[]` internally, so a `number` input is turned into an array at runtime.
30
30
  */
31
31
  export declare function Slider(props: SliderProps): import("react").JSX.Element;
32
32
  //#endregion
@@ -9,8 +9,8 @@ function isRange(props) {
9
9
  return Array.isArray(props.value);
10
10
  }
11
11
  /**
12
- * 制御専用の Slider。単一値 (`number`) と範囲 (`number[]`) の両方を許容する。
13
- * Radix Slider は内部的に `number[]` で扱うため、`number` 入力時はランタイムで配列化する。
12
+ * A controlled-only Slider. Accepts both a single value (`number`) and a range (`number[]`).
13
+ * Radix Slider handles `number[]` internally, so a `number` input is turned into an array at runtime.
14
14
  */
15
15
  function Slider(props) {
16
16
  const { label, required, description, helpText, className, wrapperClassName, errorSlot, invalid, "aria-invalid": ariaInvalid, min, max, step, disabled, formattedValue, value, onValueChange: _onValueChange, ...rest } = props;
@@ -2,9 +2,9 @@ import { Switch as Switch$1 } from "../base/switch.js";
2
2
  import { ComponentProps } from "react";
3
3
  //#region src/web/atom/switch.d.ts
4
4
  /**
5
- * フォーム外で使える制御モードの Switch。
6
- * `form/switch.tsx` は TanStack Form の field context に依存するため、
7
- * 単独の ON/OFF トグルにはこちらを使う。
5
+ * A controlled Switch that works outside a form.
6
+ * `form/switch.tsx` depends on TanStack Form's field context,
7
+ * so use this one for a standalone ON/OFF toggle.
8
8
  */
9
9
  export type SwitchProps = ComponentProps<typeof Switch$1>;
10
10
  export declare function Switch(props: SwitchProps): import("react").JSX.Element;
@@ -7,16 +7,17 @@ export type TextAreaProps = Omit<ComponentProps<"textarea">, "value" | "onChange
7
7
  onValueChange: (value: string) => void;
8
8
  };
9
9
  /**
10
- * 素の複数行入力。TanStack Form を使わない画面(設定・小さな編集欄・読み取り専用の
11
- * 書き出し)から直接使う。`base/textarea` はアプリから直接 import しない決まりなので、
12
- * その入口を担う。`atom/text-field` の複数行版。
10
+ * A plain multi-line input. Use it directly from screens that do not use TanStack Form
11
+ * (settings, small edit fields, read-only output). Apps are expected not to import
12
+ * `base/textarea` directly, so this is the entry point for it. A multi-line version
13
+ * of `atom/text-field`.
13
14
  *
14
- * variant は `atom/text-field` と揃えてある:
15
- * default … 1px の枠を持つ欄
16
- * `<3` … 既存の行に添える下線だけの欄
17
- * block … 枠を持たず本文に見える欄(常時編集できる行)
15
+ * The variants match `atom/text-field`:
16
+ * default ... a field with a 1px border
17
+ * `<3` ... an underline-only field that attaches to an existing row
18
+ * block ... a field with no border that reads as body text (an always-editable row)
18
19
  *
19
- * フォーム統合が要るときは `form/text-area`(同じ `base/textarea` を内側で使っている)。
20
+ * When you need form integration, use `form/text-area` (it uses the same `base/textarea` inside).
20
21
  */
21
22
  export declare function TextArea({ value, onValueChange, ...props }: TextAreaProps): import("react").JSX.Element;
22
23
  //#endregion
@@ -3,16 +3,17 @@ import { jsx } from "react/jsx-runtime";
3
3
 
4
4
  //#region src/web/atom/text-area.tsx
5
5
  /**
6
- * 素の複数行入力。TanStack Form を使わない画面(設定・小さな編集欄・読み取り専用の
7
- * 書き出し)から直接使う。`base/textarea` はアプリから直接 import しない決まりなので、
8
- * その入口を担う。`atom/text-field` の複数行版。
6
+ * A plain multi-line input. Use it directly from screens that do not use TanStack Form
7
+ * (settings, small edit fields, read-only output). Apps are expected not to import
8
+ * `base/textarea` directly, so this is the entry point for it. A multi-line version
9
+ * of `atom/text-field`.
9
10
  *
10
- * variant は `atom/text-field` と揃えてある:
11
- * default … 1px の枠を持つ欄
12
- * `<3` … 既存の行に添える下線だけの欄
13
- * block … 枠を持たず本文に見える欄(常時編集できる行)
11
+ * The variants match `atom/text-field`:
12
+ * default ... a field with a 1px border
13
+ * `<3` ... an underline-only field that attaches to an existing row
14
+ * block ... a field with no border that reads as body text (an always-editable row)
14
15
  *
15
- * フォーム統合が要るときは `form/text-area`(同じ `base/textarea` を内側で使っている)。
16
+ * When you need form integration, use `form/text-area` (it uses the same `base/textarea` inside).
16
17
  */
17
18
  function TextArea({ value, onValueChange, ...props }) {
18
19
  return /* @__PURE__ */ jsx(Textarea, {
@@ -7,11 +7,12 @@ export type TextFieldProps = Omit<ComponentProps<"input">, "value" | "onChange">
7
7
  onValueChange: (value: string) => void;
8
8
  };
9
9
  /**
10
- * 素のテキスト入力。TanStack Form を使わない画面(設定・検索条件・小さな編集欄)から
11
- * 直接使う。`base/input` はアプリから直接 import しない決まりなので、その入口を担う。
10
+ * A plain text input. Use it directly from screens that do not use TanStack Form
11
+ * (settings, search filters, small edit fields). Apps are expected not to import
12
+ * `base/input` directly, so this is the entry point for it.
12
13
  *
13
- * フォーム統合が要るときは `form/text-input`(同じ `base/input` を内側で使っている)。
14
- * native の `atom/text-field` と対になる。
14
+ * When you need form integration, use `form/text-input` (it uses the same `base/input` inside).
15
+ * It pairs with native's `atom/text-field`.
15
16
  */
16
17
  export declare function TextField({ value, onValueChange, ...props }: TextFieldProps): import("react").JSX.Element;
17
18
  //#endregion
@@ -3,11 +3,12 @@ import { jsx } from "react/jsx-runtime";
3
3
 
4
4
  //#region src/web/atom/text-field.tsx
5
5
  /**
6
- * 素のテキスト入力。TanStack Form を使わない画面(設定・検索条件・小さな編集欄)から
7
- * 直接使う。`base/input` はアプリから直接 import しない決まりなので、その入口を担う。
6
+ * A plain text input. Use it directly from screens that do not use TanStack Form
7
+ * (settings, search filters, small edit fields). Apps are expected not to import
8
+ * `base/input` directly, so this is the entry point for it.
8
9
  *
9
- * フォーム統合が要るときは `form/text-input`(同じ `base/input` を内側で使っている)。
10
- * native の `atom/text-field` と対になる。
10
+ * When you need form integration, use `form/text-input` (it uses the same `base/input` inside).
11
+ * It pairs with native's `atom/text-field`.
11
12
  */
12
13
  function TextField({ value, onValueChange, ...props }) {
13
14
  return /* @__PURE__ */ jsx(Input, {