@seanyeh77/ui 0.44.0 → 0.45.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 (868) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -1
  3. package/dist/bundle.js +20 -20
  4. package/dist/components/AccentPicker/AccentPicker.d.ts +1 -0
  5. package/dist/components/AccentPicker/AccentPicker.js +92 -72
  6. package/dist/components/AccentPicker/AccentPicker.js.map +1 -1
  7. package/dist/components/ActionBar/ActionBar.d.ts +2 -0
  8. package/dist/components/ActionBar/ActionBar.js.map +1 -1
  9. package/dist/components/AiMark/AiMark.d.ts +1 -0
  10. package/dist/components/AiMark/AiMark.js.map +1 -1
  11. package/dist/components/Alert/Alert.d.ts +5 -2
  12. package/dist/components/Alert/Alert.js +17 -14
  13. package/dist/components/Alert/Alert.js.map +1 -1
  14. package/dist/components/AppShell/AppShell.d.ts +10 -4
  15. package/dist/components/AppShell/AppShell.js +30 -19
  16. package/dist/components/AppShell/AppShell.js.map +1 -1
  17. package/dist/components/Badge/Badge.d.ts +24 -7
  18. package/dist/components/Badge/Badge.js +78 -21
  19. package/dist/components/Badge/Badge.js.map +1 -1
  20. package/dist/components/BarChart/BarChart.d.ts +14 -1
  21. package/dist/components/BarChart/BarChart.js +88 -59
  22. package/dist/components/BarChart/BarChart.js.map +1 -1
  23. package/dist/components/Breadcrumb/Breadcrumb.d.ts +1 -0
  24. package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
  25. package/dist/components/Button/Button.d.ts +4 -1
  26. package/dist/components/Button/Button.js +17 -3
  27. package/dist/components/Button/Button.js.map +1 -1
  28. package/dist/components/Calendar/Calendar.d.ts +11 -2
  29. package/dist/components/Calendar/Calendar.js +16 -5
  30. package/dist/components/Calendar/Calendar.js.map +1 -1
  31. package/dist/components/Card/Card.d.ts +1 -0
  32. package/dist/components/Card/Card.js.map +1 -1
  33. package/dist/components/Checkbox/Checkbox.d.ts +24 -8
  34. package/dist/components/Checkbox/Checkbox.js +22 -9
  35. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  36. package/dist/components/CodeView/CodeView.d.ts +3 -0
  37. package/dist/components/CodeView/CodeView.js +6 -6
  38. package/dist/components/CodeView/CodeView.js.map +1 -1
  39. package/dist/components/CommandPalette/CommandPalette.d.ts +16 -4
  40. package/dist/components/CommandPalette/CommandPalette.js +38 -11
  41. package/dist/components/CommandPalette/CommandPalette.js.map +1 -1
  42. package/dist/components/ConsoleLayout/ConsoleLayout.d.ts +2 -3
  43. package/dist/components/ConsoleLayout/ConsoleLayout.js +4 -1
  44. package/dist/components/ConsoleLayout/ConsoleLayout.js.map +1 -1
  45. package/dist/components/DangerZone/DangerZone.d.ts +2 -1
  46. package/dist/components/DangerZone/DangerZone.js +1 -1
  47. package/dist/components/DangerZone/DangerZone.js.map +1 -1
  48. package/dist/components/DataTable/DataTable.d.ts +8 -1
  49. package/dist/components/DataTable/DataTable.js +213 -167
  50. package/dist/components/DataTable/DataTable.js.map +1 -1
  51. package/dist/components/DataTable/SortButton.js +48 -5
  52. package/dist/components/DataTable/SortButton.js.map +1 -1
  53. package/dist/components/DataTable/filters.js +2 -1
  54. package/dist/components/DataTable/filters.js.map +1 -1
  55. package/dist/components/DataTable/parts.js +1 -1
  56. package/dist/components/DataTable/parts.js.map +1 -1
  57. package/dist/components/DataTable/types.d.ts +10 -3
  58. package/dist/components/DatePicker/DatePicker.d.ts +7 -5
  59. package/dist/components/DatePicker/DatePicker.js +16 -6
  60. package/dist/components/DatePicker/DatePicker.js.map +1 -1
  61. package/dist/components/DateRangePicker/DateRangePicker.d.ts +12 -7
  62. package/dist/components/DateRangePicker/DateRangePicker.js +81 -45
  63. package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
  64. package/dist/components/DetailList/DetailList.d.ts +2 -0
  65. package/dist/components/DetailList/DetailList.js.map +1 -1
  66. package/dist/components/Dialog/Dialog.d.ts +56 -20
  67. package/dist/components/Dialog/Dialog.js +45 -14
  68. package/dist/components/Dialog/Dialog.js.map +1 -1
  69. package/dist/components/Drawer/Drawer.d.ts +17 -5
  70. package/dist/components/Drawer/Drawer.js +86 -24
  71. package/dist/components/Drawer/Drawer.js.map +1 -1
  72. package/dist/components/ErrorPage/ErrorPage.d.ts +3 -0
  73. package/dist/components/ErrorPage/ErrorPage.js.map +1 -1
  74. package/dist/components/EventTimeline/EventTimeline.d.ts +22 -4
  75. package/dist/components/EventTimeline/EventTimeline.js +63 -20
  76. package/dist/components/EventTimeline/EventTimeline.js.map +1 -1
  77. package/dist/components/FileUpload/FileUpload.d.ts +9 -1
  78. package/dist/components/FileUpload/FileUpload.js +3 -1
  79. package/dist/components/FileUpload/FileUpload.js.map +1 -1
  80. package/dist/components/FormGrid/FormGrid.d.ts +3 -1
  81. package/dist/components/FormGrid/FormGrid.js +5 -2
  82. package/dist/components/FormGrid/FormGrid.js.map +1 -1
  83. package/dist/components/Graph/Graph.d.ts +1 -0
  84. package/dist/components/Graph/Graph.js +8 -4
  85. package/dist/components/Graph/Graph.js.map +1 -1
  86. package/dist/components/Grid/Grid.d.ts +11 -4
  87. package/dist/components/Grid/Grid.js +14 -2
  88. package/dist/components/Grid/Grid.js.map +1 -1
  89. package/dist/components/IconButton/IconButton.d.ts +2 -1
  90. package/dist/components/IconButton/IconButton.js +10 -1
  91. package/dist/components/IconButton/IconButton.js.map +1 -1
  92. package/dist/components/InlineCode/InlineCode.d.ts +6 -0
  93. package/dist/components/InlineCode/InlineCode.js.map +1 -1
  94. package/dist/components/KpiCard/KpiCard.d.ts +5 -1
  95. package/dist/components/KpiCard/KpiCard.js +35 -21
  96. package/dist/components/KpiCard/KpiCard.js.map +1 -1
  97. package/dist/components/LayerGraph/LayerGraph.d.ts +68 -23
  98. package/dist/components/LayerGraph/LayerGraph.js +159 -88
  99. package/dist/components/LayerGraph/LayerGraph.js.map +1 -1
  100. package/dist/components/LineChart/LineChart.d.ts +10 -3
  101. package/dist/components/LineChart/LineChart.js +55 -23
  102. package/dist/components/LineChart/LineChart.js.map +1 -1
  103. package/dist/components/Link/Link.d.ts +17 -0
  104. package/dist/components/Link/Link.js +47 -0
  105. package/dist/components/Link/Link.js.map +1 -0
  106. package/dist/components/LoadingBar/LoadingBar.d.ts +1 -0
  107. package/dist/components/LoadingBar/LoadingBar.js.map +1 -1
  108. package/dist/components/LoginCard/LoginCard.d.ts +9 -3
  109. package/dist/components/LoginCard/LoginCard.js +99 -78
  110. package/dist/components/LoginCard/LoginCard.js.map +1 -1
  111. package/dist/components/Markdown/Markdown.d.ts +1 -0
  112. package/dist/components/Markdown/Markdown.js +1 -1
  113. package/dist/components/Markdown/Markdown.js.map +1 -1
  114. package/dist/components/Menu/Menu.d.ts +4 -2
  115. package/dist/components/Menu/Menu.js +43 -33
  116. package/dist/components/Menu/Menu.js.map +1 -1
  117. package/dist/components/Meter/Meter.d.ts +4 -0
  118. package/dist/components/Meter/Meter.js.map +1 -1
  119. package/dist/components/MobileTabBar/MobileTabBar.d.ts +3 -0
  120. package/dist/components/MobileTabBar/MobileTabBar.js.map +1 -1
  121. package/dist/components/MultiSelect/MultiSelect.d.ts +7 -6
  122. package/dist/components/MultiSelect/MultiSelect.js +27 -9
  123. package/dist/components/MultiSelect/MultiSelect.js.map +1 -1
  124. package/dist/components/NotificationBell/NotificationBell.d.ts +3 -0
  125. package/dist/components/NotificationBell/NotificationBell.js +2 -2
  126. package/dist/components/NotificationBell/NotificationBell.js.map +1 -1
  127. package/dist/components/PageHeader/PageHeader.d.ts +34 -0
  128. package/dist/components/PageHeader/PageHeader.js +68 -0
  129. package/dist/components/PageHeader/PageHeader.js.map +1 -0
  130. package/dist/components/Popover/Popover.d.ts +11 -4
  131. package/dist/components/Popover/Popover.js +17 -7
  132. package/dist/components/Popover/Popover.js.map +1 -1
  133. package/dist/components/ProgressBar/ProgressBar.d.ts +2 -0
  134. package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
  135. package/dist/components/ProgressRing/ProgressRing.d.ts +1 -0
  136. package/dist/components/ProgressRing/ProgressRing.js.map +1 -1
  137. package/dist/components/ProjectSwitcher/ProjectSwitcher.d.ts +5 -1
  138. package/dist/components/ProjectSwitcher/ProjectSwitcher.js +16 -3
  139. package/dist/components/ProjectSwitcher/ProjectSwitcher.js.map +1 -1
  140. package/dist/components/RadioGroup/RadioGroup.d.ts +22 -5
  141. package/dist/components/RadioGroup/RadioGroup.js +48 -47
  142. package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
  143. package/dist/components/RelativeTime/RelativeTime.d.ts +10 -0
  144. package/dist/components/RelativeTime/RelativeTime.js +44 -0
  145. package/dist/components/RelativeTime/RelativeTime.js.map +1 -0
  146. package/dist/components/SearchField/SearchField.d.ts +2 -0
  147. package/dist/components/SearchField/SearchField.js.map +1 -1
  148. package/dist/components/Section/Section.d.ts +4 -0
  149. package/dist/components/Section/Section.js +8 -22
  150. package/dist/components/Section/Section.js.map +1 -1
  151. package/dist/components/SegmentedControl/SegmentedControl.d.ts +22 -9
  152. package/dist/components/SegmentedControl/SegmentedControl.js +20 -19
  153. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
  154. package/dist/components/Select/Select.d.ts +7 -11
  155. package/dist/components/Select/Select.js +7 -3
  156. package/dist/components/Select/Select.js.map +1 -1
  157. package/dist/components/SettingsLayout/SettingsLayout.d.ts +32 -3
  158. package/dist/components/SettingsLayout/SettingsLayout.js +60 -13
  159. package/dist/components/SettingsLayout/SettingsLayout.js.map +1 -1
  160. package/dist/components/SideNav/SideNav.d.ts +2 -0
  161. package/dist/components/SideNav/SideNav.js +3 -3
  162. package/dist/components/SideNav/SideNav.js.map +1 -1
  163. package/dist/components/SplitPane/SplitPane.d.ts +1 -0
  164. package/dist/components/SplitPane/SplitPane.js.map +1 -1
  165. package/dist/components/StatusBand/StatusBand.d.ts +1 -0
  166. package/dist/components/StatusBand/StatusBand.js.map +1 -1
  167. package/dist/components/Suggestion/Suggestion.d.ts +6 -0
  168. package/dist/components/Suggestion/Suggestion.js.map +1 -1
  169. package/dist/components/Switch/Switch.d.ts +13 -3
  170. package/dist/components/Switch/Switch.js +16 -7
  171. package/dist/components/Switch/Switch.js.map +1 -1
  172. package/dist/components/Tabs/Tabs.d.ts +4 -0
  173. package/dist/components/Tabs/Tabs.js +1 -1
  174. package/dist/components/Tabs/Tabs.js.map +1 -1
  175. package/dist/components/Tag/Tag.d.ts +15 -7
  176. package/dist/components/Tag/Tag.js +22 -10
  177. package/dist/components/Tag/Tag.js.map +1 -1
  178. package/dist/components/Term/Term.d.ts +8 -3
  179. package/dist/components/Term/Term.js +1 -1
  180. package/dist/components/Term/Term.js.map +1 -1
  181. package/dist/components/TextArea/TextArea.d.ts +6 -10
  182. package/dist/components/TextArea/TextArea.js +22 -10
  183. package/dist/components/TextArea/TextArea.js.map +1 -1
  184. package/dist/components/TextField/TextField.d.ts +8 -11
  185. package/dist/components/TextField/TextField.js +9 -7
  186. package/dist/components/TextField/TextField.js.map +1 -1
  187. package/dist/components/ThemePicker/ThemePicker.d.ts +1 -0
  188. package/dist/components/ThemePicker/ThemePicker.js +35 -34
  189. package/dist/components/ThemePicker/ThemePicker.js.map +1 -1
  190. package/dist/components/TimeControl/TimeControl.d.ts +1 -0
  191. package/dist/components/TimeControl/TimeControl.js.map +1 -1
  192. package/dist/components/Toast/Toast.d.ts +55 -2
  193. package/dist/components/Toast/Toast.js +190 -8
  194. package/dist/components/Toast/Toast.js.map +1 -1
  195. package/dist/components/TopBar/TopBar.d.ts +6 -2
  196. package/dist/components/TopBar/TopBar.js +7 -1
  197. package/dist/components/TopBar/TopBar.js.map +1 -1
  198. package/dist/components/Tour/Tour.d.ts +14 -3
  199. package/dist/components/Tour/Tour.js +26 -14
  200. package/dist/components/Tour/Tour.js.map +1 -1
  201. package/dist/components/TreeList/TreeList.d.ts +28 -4
  202. package/dist/components/TreeList/TreeList.js +32 -20
  203. package/dist/components/TreeList/TreeList.js.map +1 -1
  204. package/dist/components/Workbench/Workbench.d.ts +1 -0
  205. package/dist/components/Workbench/Workbench.js +24 -12
  206. package/dist/components/Workbench/Workbench.js.map +1 -1
  207. package/dist/components/ZoneMap/ZoneMap.d.ts +12 -2
  208. package/dist/components/ZoneMap/ZoneMap.js +13 -5
  209. package/dist/components/ZoneMap/ZoneMap.js.map +1 -1
  210. package/dist/components/useFormErrors/useFormErrors.d.ts +20 -0
  211. package/dist/components/useFormErrors/useFormErrors.js +55 -0
  212. package/dist/components/useFormErrors/useFormErrors.js.map +1 -0
  213. package/dist/css/AccentPicker.css +1 -0
  214. package/dist/css/Alert.css +7 -19
  215. package/dist/css/AppShell.css +1 -0
  216. package/dist/css/Badge.css +19 -45
  217. package/dist/css/BarChart.css +21 -3
  218. package/dist/css/Button.css +5 -1
  219. package/dist/css/Card.css +8 -8
  220. package/dist/css/Checkbox.css +19 -0
  221. package/dist/css/CodeView.css +2 -1
  222. package/dist/css/DangerZone.css +4 -3
  223. package/dist/css/DataTable.css +129 -34
  224. package/dist/css/DateRangePicker.css +23 -2
  225. package/dist/css/Drawer.css +30 -0
  226. package/dist/css/ErrorPage.css +3 -1
  227. package/dist/css/EventTimeline.css +33 -5
  228. package/dist/css/FormGrid.css +12 -3
  229. package/dist/css/Graph.css +9 -1
  230. package/dist/css/Grid.css +8 -0
  231. package/dist/css/KpiCard.css +12 -1
  232. package/dist/css/LayerGraph.css +40 -15
  233. package/dist/css/Link.css +23 -0
  234. package/dist/css/LoginCard.css +16 -11
  235. package/dist/css/Markdown.css +2 -1
  236. package/dist/css/Menu.css +0 -2
  237. package/dist/css/Meter.css +16 -0
  238. package/dist/css/PageHeader.css +50 -0
  239. package/dist/css/ProgressBar.css +12 -0
  240. package/dist/css/ProjectSwitcher.css +23 -26
  241. package/dist/css/RelativeTime.css +2 -0
  242. package/dist/css/SegmentedControl.css +38 -10
  243. package/dist/css/SettingsLayout.css +28 -8
  244. package/dist/css/SideNav.css +4 -1
  245. package/dist/css/Skeleton.css +22 -1
  246. package/dist/css/Switch.css +27 -0
  247. package/dist/css/Tabs.css +2 -1
  248. package/dist/css/Tag.css +19 -12
  249. package/dist/css/Toast.css +100 -4
  250. package/dist/css/TopBar.css +21 -2
  251. package/dist/css/TreeList.css +6 -3
  252. package/dist/css/Workbench.css +1 -1
  253. package/dist/css/ZoneMap.css +0 -1
  254. package/dist/css/base.css +45 -0
  255. package/dist/css/end.css +119 -5
  256. package/dist/deprecated.d.ts +3 -0
  257. package/dist/deprecated.js +13 -0
  258. package/dist/deprecated.js.map +1 -0
  259. package/dist/fonts.css +2 -7543
  260. package/dist/format.d.ts +3 -1
  261. package/dist/format.js +12 -4
  262. package/dist/format.js.map +1 -1
  263. package/dist/generated/themeDefaults.d.ts +8 -0
  264. package/dist/generated/themeDefaults.js +35 -0
  265. package/dist/generated/themeDefaults.js.map +1 -0
  266. package/dist/i18n.d.ts +7 -2
  267. package/dist/i18n.js +65 -10
  268. package/dist/i18n.js.map +1 -1
  269. package/dist/icons/Icon.d.ts +3 -1
  270. package/dist/icons/Icon.js.map +1 -1
  271. package/dist/index.d.ts +23 -14
  272. package/dist/index.js +14 -8
  273. package/dist/internal/Field.d.ts +19 -0
  274. package/dist/internal/Field.js +10 -4
  275. package/dist/internal/Field.js.map +1 -1
  276. package/dist/internal/FloatingPanel.js +2 -1
  277. package/dist/internal/FloatingPanel.js.map +1 -1
  278. package/dist/internal/chart.d.ts +4 -0
  279. package/dist/internal/chart.js +89 -19
  280. package/dist/internal/chart.js.map +1 -1
  281. package/dist/internal/dev.js +9 -4
  282. package/dist/internal/dev.js.map +1 -1
  283. package/dist/internal/focus.js +27 -3
  284. package/dist/internal/focus.js.map +1 -1
  285. package/dist/internal/focusMain.js +6 -2
  286. package/dist/internal/focusMain.js.map +1 -1
  287. package/dist/internal/open.d.ts +14 -0
  288. package/dist/internal/open.js +28 -0
  289. package/dist/internal/open.js.map +1 -0
  290. package/dist/internal/roving.js +37 -0
  291. package/dist/internal/roving.js.map +1 -0
  292. package/dist/internal/shell.js +12 -0
  293. package/dist/internal/shell.js.map +1 -0
  294. package/dist/internal/stored.js +89 -0
  295. package/dist/internal/stored.js.map +1 -0
  296. package/dist/internal/tableTools.js +46 -4
  297. package/dist/internal/tableTools.js.map +1 -1
  298. package/dist/internal/util.js +8 -17
  299. package/dist/internal/util.js.map +1 -1
  300. package/dist/locale.d.ts +17 -0
  301. package/dist/locale.js +29 -0
  302. package/dist/locale.js.map +1 -0
  303. package/dist/styles.css +944 -231
  304. package/dist/theme.d.ts +23 -5
  305. package/dist/theme.js +85 -25
  306. package/dist/theme.js.map +1 -1
  307. package/dist/tokens.css +3 -0
  308. package/docs/AccentPicker.md +3 -1
  309. package/docs/Alert.md +4 -4
  310. package/docs/AppShell.md +11 -10
  311. package/docs/Badge.md +26 -16
  312. package/docs/BarChart.md +7 -4
  313. package/docs/Button.md +4 -5
  314. package/docs/Calendar.md +2 -2
  315. package/docs/Card.md +8 -7
  316. package/docs/Checkbox.md +4 -1
  317. package/docs/CodeView.md +30 -43
  318. package/docs/CommandPalette.md +3 -2
  319. package/docs/ConsoleLayout.md +5 -5
  320. package/docs/DangerZone.md +3 -3
  321. package/docs/DataColors.md +2 -2
  322. package/docs/DataTable.md +26 -148
  323. package/docs/DatePicker.md +1 -1
  324. package/docs/DateRangePicker.md +3 -0
  325. package/docs/DetailList.md +9 -9
  326. package/docs/Dialog.md +8 -5
  327. package/docs/Drawer.md +7 -5
  328. package/docs/EmptyState.md +0 -1
  329. package/docs/ErrorPage.md +1 -2
  330. package/docs/EventTimeline.md +23 -13
  331. package/docs/FileUpload.md +1 -2
  332. package/docs/FormGrid.md +2 -1
  333. package/docs/Format.md +4 -2
  334. package/docs/Graph.md +1 -1
  335. package/docs/Grid.md +5 -1
  336. package/docs/KpiCard.md +6 -5
  337. package/docs/LayerGraph.md +18 -53
  338. package/docs/LineChart.md +5 -3
  339. package/docs/Link.md +22 -0
  340. package/docs/LoginCard.md +7 -4
  341. package/docs/Markdown.md +2 -15
  342. package/docs/Menu.md +2 -0
  343. package/docs/Meter.md +1 -0
  344. package/docs/MultiSelect.md +2 -2
  345. package/docs/NotificationBell.md +1 -1
  346. package/docs/PageHeader.md +34 -0
  347. package/docs/Popover.md +3 -1
  348. package/docs/ProgressBar.md +3 -1
  349. package/docs/ProjectSwitcher.md +14 -14
  350. package/docs/RadioGroup.md +2 -0
  351. package/docs/RelativeTime.md +23 -0
  352. package/docs/Section.md +1 -1
  353. package/docs/SegmentedControl.md +9 -6
  354. package/docs/Select.md +2 -2
  355. package/docs/SettingsLayout.md +19 -5
  356. package/docs/SideNav.md +1 -1
  357. package/docs/Skeleton.md +2 -1
  358. package/docs/Switch.md +3 -1
  359. package/docs/Tabs.md +2 -1
  360. package/docs/Tag.md +9 -7
  361. package/docs/Term.md +3 -4
  362. package/docs/TextArea.md +2 -2
  363. package/docs/TextField.md +5 -4
  364. package/docs/ThemePicker.md +3 -1
  365. package/docs/Toast.md +17 -6
  366. package/docs/TopBar.md +8 -5
  367. package/docs/Tour.md +3 -2
  368. package/docs/TreeList.md +10 -37
  369. package/docs/Workbench.md +1 -48
  370. package/docs/ZoneMap.md +5 -5
  371. package/docs/agents.md +82 -0
  372. package/docs/code.md +2 -2
  373. package/docs/components.json +314 -0
  374. package/docs/data.md +9 -19
  375. package/docs/forms.md +6 -5
  376. package/docs/guidelines.md +39 -31
  377. package/docs/icons.md +9 -0
  378. package/docs/layout.md +16 -20
  379. package/docs/motion.md +31 -56
  380. package/docs/theme.md +15 -18
  381. package/docs/useFormErrors.md +35 -0
  382. package/package.json +8 -7
  383. package/dist/bundle.js.map +0 -1
  384. package/dist/fonts/LICENSE-OFL.txt +0 -93
  385. package/dist/fonts/geist-mono-cyrillic-400-normal.woff2 +0 -0
  386. package/dist/fonts/geist-mono-cyrillic-500-normal.woff2 +0 -0
  387. package/dist/fonts/geist-mono-cyrillic-600-normal.woff2 +0 -0
  388. package/dist/fonts/geist-mono-cyrillic-700-normal.woff2 +0 -0
  389. package/dist/fonts/geist-mono-cyrillic-ext-400-normal.woff2 +0 -0
  390. package/dist/fonts/geist-mono-cyrillic-ext-500-normal.woff2 +0 -0
  391. package/dist/fonts/geist-mono-cyrillic-ext-600-normal.woff2 +0 -0
  392. package/dist/fonts/geist-mono-cyrillic-ext-700-normal.woff2 +0 -0
  393. package/dist/fonts/geist-mono-latin-400-normal.woff2 +0 -0
  394. package/dist/fonts/geist-mono-latin-500-normal.woff2 +0 -0
  395. package/dist/fonts/geist-mono-latin-600-normal.woff2 +0 -0
  396. package/dist/fonts/geist-mono-latin-700-normal.woff2 +0 -0
  397. package/dist/fonts/geist-mono-latin-ext-400-normal.woff2 +0 -0
  398. package/dist/fonts/geist-mono-latin-ext-500-normal.woff2 +0 -0
  399. package/dist/fonts/geist-mono-latin-ext-600-normal.woff2 +0 -0
  400. package/dist/fonts/geist-mono-latin-ext-700-normal.woff2 +0 -0
  401. package/dist/fonts/geist-mono-symbols2-400-normal.woff2 +0 -0
  402. package/dist/fonts/geist-mono-symbols2-500-normal.woff2 +0 -0
  403. package/dist/fonts/geist-mono-symbols2-600-normal.woff2 +0 -0
  404. package/dist/fonts/geist-mono-symbols2-700-normal.woff2 +0 -0
  405. package/dist/fonts/geist-mono-vietnamese-400-normal.woff2 +0 -0
  406. package/dist/fonts/geist-mono-vietnamese-500-normal.woff2 +0 -0
  407. package/dist/fonts/geist-mono-vietnamese-600-normal.woff2 +0 -0
  408. package/dist/fonts/geist-mono-vietnamese-700-normal.woff2 +0 -0
  409. package/dist/fonts/inter-cyrillic-400-normal.woff2 +0 -0
  410. package/dist/fonts/inter-cyrillic-500-normal.woff2 +0 -0
  411. package/dist/fonts/inter-cyrillic-600-normal.woff2 +0 -0
  412. package/dist/fonts/inter-cyrillic-700-normal.woff2 +0 -0
  413. package/dist/fonts/inter-cyrillic-ext-400-normal.woff2 +0 -0
  414. package/dist/fonts/inter-cyrillic-ext-500-normal.woff2 +0 -0
  415. package/dist/fonts/inter-cyrillic-ext-600-normal.woff2 +0 -0
  416. package/dist/fonts/inter-cyrillic-ext-700-normal.woff2 +0 -0
  417. package/dist/fonts/inter-greek-400-normal.woff2 +0 -0
  418. package/dist/fonts/inter-greek-500-normal.woff2 +0 -0
  419. package/dist/fonts/inter-greek-600-normal.woff2 +0 -0
  420. package/dist/fonts/inter-greek-700-normal.woff2 +0 -0
  421. package/dist/fonts/inter-greek-ext-400-normal.woff2 +0 -0
  422. package/dist/fonts/inter-greek-ext-500-normal.woff2 +0 -0
  423. package/dist/fonts/inter-greek-ext-600-normal.woff2 +0 -0
  424. package/dist/fonts/inter-greek-ext-700-normal.woff2 +0 -0
  425. package/dist/fonts/inter-latin-400-normal.woff2 +0 -0
  426. package/dist/fonts/inter-latin-500-normal.woff2 +0 -0
  427. package/dist/fonts/inter-latin-600-normal.woff2 +0 -0
  428. package/dist/fonts/inter-latin-700-normal.woff2 +0 -0
  429. package/dist/fonts/inter-latin-ext-400-normal.woff2 +0 -0
  430. package/dist/fonts/inter-latin-ext-500-normal.woff2 +0 -0
  431. package/dist/fonts/inter-latin-ext-600-normal.woff2 +0 -0
  432. package/dist/fonts/inter-latin-ext-700-normal.woff2 +0 -0
  433. package/dist/fonts/inter-vietnamese-400-normal.woff2 +0 -0
  434. package/dist/fonts/inter-vietnamese-500-normal.woff2 +0 -0
  435. package/dist/fonts/inter-vietnamese-600-normal.woff2 +0 -0
  436. package/dist/fonts/inter-vietnamese-700-normal.woff2 +0 -0
  437. package/dist/fonts/noto-sans-tc-0-400-normal.woff2 +0 -0
  438. package/dist/fonts/noto-sans-tc-0-500-normal.woff2 +0 -0
  439. package/dist/fonts/noto-sans-tc-0-600-normal.woff2 +0 -0
  440. package/dist/fonts/noto-sans-tc-0-700-normal.woff2 +0 -0
  441. package/dist/fonts/noto-sans-tc-1-400-normal.woff2 +0 -0
  442. package/dist/fonts/noto-sans-tc-1-500-normal.woff2 +0 -0
  443. package/dist/fonts/noto-sans-tc-1-600-normal.woff2 +0 -0
  444. package/dist/fonts/noto-sans-tc-1-700-normal.woff2 +0 -0
  445. package/dist/fonts/noto-sans-tc-10-400-normal.woff2 +0 -0
  446. package/dist/fonts/noto-sans-tc-10-500-normal.woff2 +0 -0
  447. package/dist/fonts/noto-sans-tc-10-600-normal.woff2 +0 -0
  448. package/dist/fonts/noto-sans-tc-10-700-normal.woff2 +0 -0
  449. package/dist/fonts/noto-sans-tc-101-400-normal.woff2 +0 -0
  450. package/dist/fonts/noto-sans-tc-101-500-normal.woff2 +0 -0
  451. package/dist/fonts/noto-sans-tc-101-600-normal.woff2 +0 -0
  452. package/dist/fonts/noto-sans-tc-101-700-normal.woff2 +0 -0
  453. package/dist/fonts/noto-sans-tc-102-400-normal.woff2 +0 -0
  454. package/dist/fonts/noto-sans-tc-102-500-normal.woff2 +0 -0
  455. package/dist/fonts/noto-sans-tc-102-600-normal.woff2 +0 -0
  456. package/dist/fonts/noto-sans-tc-102-700-normal.woff2 +0 -0
  457. package/dist/fonts/noto-sans-tc-103-400-normal.woff2 +0 -0
  458. package/dist/fonts/noto-sans-tc-103-500-normal.woff2 +0 -0
  459. package/dist/fonts/noto-sans-tc-103-600-normal.woff2 +0 -0
  460. package/dist/fonts/noto-sans-tc-103-700-normal.woff2 +0 -0
  461. package/dist/fonts/noto-sans-tc-104-400-normal.woff2 +0 -0
  462. package/dist/fonts/noto-sans-tc-104-500-normal.woff2 +0 -0
  463. package/dist/fonts/noto-sans-tc-104-600-normal.woff2 +0 -0
  464. package/dist/fonts/noto-sans-tc-104-700-normal.woff2 +0 -0
  465. package/dist/fonts/noto-sans-tc-105-400-normal.woff2 +0 -0
  466. package/dist/fonts/noto-sans-tc-105-500-normal.woff2 +0 -0
  467. package/dist/fonts/noto-sans-tc-105-600-normal.woff2 +0 -0
  468. package/dist/fonts/noto-sans-tc-105-700-normal.woff2 +0 -0
  469. package/dist/fonts/noto-sans-tc-106-400-normal.woff2 +0 -0
  470. package/dist/fonts/noto-sans-tc-106-500-normal.woff2 +0 -0
  471. package/dist/fonts/noto-sans-tc-106-600-normal.woff2 +0 -0
  472. package/dist/fonts/noto-sans-tc-106-700-normal.woff2 +0 -0
  473. package/dist/fonts/noto-sans-tc-107-400-normal.woff2 +0 -0
  474. package/dist/fonts/noto-sans-tc-107-500-normal.woff2 +0 -0
  475. package/dist/fonts/noto-sans-tc-107-600-normal.woff2 +0 -0
  476. package/dist/fonts/noto-sans-tc-107-700-normal.woff2 +0 -0
  477. package/dist/fonts/noto-sans-tc-108-400-normal.woff2 +0 -0
  478. package/dist/fonts/noto-sans-tc-108-500-normal.woff2 +0 -0
  479. package/dist/fonts/noto-sans-tc-108-600-normal.woff2 +0 -0
  480. package/dist/fonts/noto-sans-tc-108-700-normal.woff2 +0 -0
  481. package/dist/fonts/noto-sans-tc-109-400-normal.woff2 +0 -0
  482. package/dist/fonts/noto-sans-tc-109-500-normal.woff2 +0 -0
  483. package/dist/fonts/noto-sans-tc-109-600-normal.woff2 +0 -0
  484. package/dist/fonts/noto-sans-tc-109-700-normal.woff2 +0 -0
  485. package/dist/fonts/noto-sans-tc-11-400-normal.woff2 +0 -0
  486. package/dist/fonts/noto-sans-tc-11-500-normal.woff2 +0 -0
  487. package/dist/fonts/noto-sans-tc-11-600-normal.woff2 +0 -0
  488. package/dist/fonts/noto-sans-tc-11-700-normal.woff2 +0 -0
  489. package/dist/fonts/noto-sans-tc-110-400-normal.woff2 +0 -0
  490. package/dist/fonts/noto-sans-tc-110-500-normal.woff2 +0 -0
  491. package/dist/fonts/noto-sans-tc-110-600-normal.woff2 +0 -0
  492. package/dist/fonts/noto-sans-tc-110-700-normal.woff2 +0 -0
  493. package/dist/fonts/noto-sans-tc-111-400-normal.woff2 +0 -0
  494. package/dist/fonts/noto-sans-tc-111-500-normal.woff2 +0 -0
  495. package/dist/fonts/noto-sans-tc-111-600-normal.woff2 +0 -0
  496. package/dist/fonts/noto-sans-tc-111-700-normal.woff2 +0 -0
  497. package/dist/fonts/noto-sans-tc-112-400-normal.woff2 +0 -0
  498. package/dist/fonts/noto-sans-tc-112-500-normal.woff2 +0 -0
  499. package/dist/fonts/noto-sans-tc-112-600-normal.woff2 +0 -0
  500. package/dist/fonts/noto-sans-tc-112-700-normal.woff2 +0 -0
  501. package/dist/fonts/noto-sans-tc-113-400-normal.woff2 +0 -0
  502. package/dist/fonts/noto-sans-tc-113-500-normal.woff2 +0 -0
  503. package/dist/fonts/noto-sans-tc-113-600-normal.woff2 +0 -0
  504. package/dist/fonts/noto-sans-tc-113-700-normal.woff2 +0 -0
  505. package/dist/fonts/noto-sans-tc-114-400-normal.woff2 +0 -0
  506. package/dist/fonts/noto-sans-tc-114-500-normal.woff2 +0 -0
  507. package/dist/fonts/noto-sans-tc-114-600-normal.woff2 +0 -0
  508. package/dist/fonts/noto-sans-tc-114-700-normal.woff2 +0 -0
  509. package/dist/fonts/noto-sans-tc-115-400-normal.woff2 +0 -0
  510. package/dist/fonts/noto-sans-tc-115-500-normal.woff2 +0 -0
  511. package/dist/fonts/noto-sans-tc-115-600-normal.woff2 +0 -0
  512. package/dist/fonts/noto-sans-tc-115-700-normal.woff2 +0 -0
  513. package/dist/fonts/noto-sans-tc-116-400-normal.woff2 +0 -0
  514. package/dist/fonts/noto-sans-tc-116-500-normal.woff2 +0 -0
  515. package/dist/fonts/noto-sans-tc-116-600-normal.woff2 +0 -0
  516. package/dist/fonts/noto-sans-tc-116-700-normal.woff2 +0 -0
  517. package/dist/fonts/noto-sans-tc-117-400-normal.woff2 +0 -0
  518. package/dist/fonts/noto-sans-tc-117-500-normal.woff2 +0 -0
  519. package/dist/fonts/noto-sans-tc-117-600-normal.woff2 +0 -0
  520. package/dist/fonts/noto-sans-tc-117-700-normal.woff2 +0 -0
  521. package/dist/fonts/noto-sans-tc-118-400-normal.woff2 +0 -0
  522. package/dist/fonts/noto-sans-tc-118-500-normal.woff2 +0 -0
  523. package/dist/fonts/noto-sans-tc-118-600-normal.woff2 +0 -0
  524. package/dist/fonts/noto-sans-tc-118-700-normal.woff2 +0 -0
  525. package/dist/fonts/noto-sans-tc-119-400-normal.woff2 +0 -0
  526. package/dist/fonts/noto-sans-tc-119-500-normal.woff2 +0 -0
  527. package/dist/fonts/noto-sans-tc-119-600-normal.woff2 +0 -0
  528. package/dist/fonts/noto-sans-tc-119-700-normal.woff2 +0 -0
  529. package/dist/fonts/noto-sans-tc-12-400-normal.woff2 +0 -0
  530. package/dist/fonts/noto-sans-tc-12-500-normal.woff2 +0 -0
  531. package/dist/fonts/noto-sans-tc-12-600-normal.woff2 +0 -0
  532. package/dist/fonts/noto-sans-tc-12-700-normal.woff2 +0 -0
  533. package/dist/fonts/noto-sans-tc-120-400-normal.woff2 +0 -0
  534. package/dist/fonts/noto-sans-tc-120-500-normal.woff2 +0 -0
  535. package/dist/fonts/noto-sans-tc-120-600-normal.woff2 +0 -0
  536. package/dist/fonts/noto-sans-tc-120-700-normal.woff2 +0 -0
  537. package/dist/fonts/noto-sans-tc-121-400-normal.woff2 +0 -0
  538. package/dist/fonts/noto-sans-tc-121-500-normal.woff2 +0 -0
  539. package/dist/fonts/noto-sans-tc-121-600-normal.woff2 +0 -0
  540. package/dist/fonts/noto-sans-tc-121-700-normal.woff2 +0 -0
  541. package/dist/fonts/noto-sans-tc-122-400-normal.woff2 +0 -0
  542. package/dist/fonts/noto-sans-tc-122-500-normal.woff2 +0 -0
  543. package/dist/fonts/noto-sans-tc-122-600-normal.woff2 +0 -0
  544. package/dist/fonts/noto-sans-tc-122-700-normal.woff2 +0 -0
  545. package/dist/fonts/noto-sans-tc-123-400-normal.woff2 +0 -0
  546. package/dist/fonts/noto-sans-tc-123-500-normal.woff2 +0 -0
  547. package/dist/fonts/noto-sans-tc-123-600-normal.woff2 +0 -0
  548. package/dist/fonts/noto-sans-tc-123-700-normal.woff2 +0 -0
  549. package/dist/fonts/noto-sans-tc-2-400-normal.woff2 +0 -0
  550. package/dist/fonts/noto-sans-tc-2-500-normal.woff2 +0 -0
  551. package/dist/fonts/noto-sans-tc-2-600-normal.woff2 +0 -0
  552. package/dist/fonts/noto-sans-tc-2-700-normal.woff2 +0 -0
  553. package/dist/fonts/noto-sans-tc-23-400-normal.woff2 +0 -0
  554. package/dist/fonts/noto-sans-tc-23-500-normal.woff2 +0 -0
  555. package/dist/fonts/noto-sans-tc-23-600-normal.woff2 +0 -0
  556. package/dist/fonts/noto-sans-tc-23-700-normal.woff2 +0 -0
  557. package/dist/fonts/noto-sans-tc-24-400-normal.woff2 +0 -0
  558. package/dist/fonts/noto-sans-tc-24-500-normal.woff2 +0 -0
  559. package/dist/fonts/noto-sans-tc-24-600-normal.woff2 +0 -0
  560. package/dist/fonts/noto-sans-tc-24-700-normal.woff2 +0 -0
  561. package/dist/fonts/noto-sans-tc-25-400-normal.woff2 +0 -0
  562. package/dist/fonts/noto-sans-tc-25-500-normal.woff2 +0 -0
  563. package/dist/fonts/noto-sans-tc-25-600-normal.woff2 +0 -0
  564. package/dist/fonts/noto-sans-tc-25-700-normal.woff2 +0 -0
  565. package/dist/fonts/noto-sans-tc-26-400-normal.woff2 +0 -0
  566. package/dist/fonts/noto-sans-tc-26-500-normal.woff2 +0 -0
  567. package/dist/fonts/noto-sans-tc-26-600-normal.woff2 +0 -0
  568. package/dist/fonts/noto-sans-tc-26-700-normal.woff2 +0 -0
  569. package/dist/fonts/noto-sans-tc-27-400-normal.woff2 +0 -0
  570. package/dist/fonts/noto-sans-tc-27-500-normal.woff2 +0 -0
  571. package/dist/fonts/noto-sans-tc-27-600-normal.woff2 +0 -0
  572. package/dist/fonts/noto-sans-tc-27-700-normal.woff2 +0 -0
  573. package/dist/fonts/noto-sans-tc-28-400-normal.woff2 +0 -0
  574. package/dist/fonts/noto-sans-tc-28-500-normal.woff2 +0 -0
  575. package/dist/fonts/noto-sans-tc-28-600-normal.woff2 +0 -0
  576. package/dist/fonts/noto-sans-tc-28-700-normal.woff2 +0 -0
  577. package/dist/fonts/noto-sans-tc-29-400-normal.woff2 +0 -0
  578. package/dist/fonts/noto-sans-tc-29-500-normal.woff2 +0 -0
  579. package/dist/fonts/noto-sans-tc-29-600-normal.woff2 +0 -0
  580. package/dist/fonts/noto-sans-tc-29-700-normal.woff2 +0 -0
  581. package/dist/fonts/noto-sans-tc-30-400-normal.woff2 +0 -0
  582. package/dist/fonts/noto-sans-tc-30-500-normal.woff2 +0 -0
  583. package/dist/fonts/noto-sans-tc-30-600-normal.woff2 +0 -0
  584. package/dist/fonts/noto-sans-tc-30-700-normal.woff2 +0 -0
  585. package/dist/fonts/noto-sans-tc-31-400-normal.woff2 +0 -0
  586. package/dist/fonts/noto-sans-tc-31-500-normal.woff2 +0 -0
  587. package/dist/fonts/noto-sans-tc-31-600-normal.woff2 +0 -0
  588. package/dist/fonts/noto-sans-tc-31-700-normal.woff2 +0 -0
  589. package/dist/fonts/noto-sans-tc-32-400-normal.woff2 +0 -0
  590. package/dist/fonts/noto-sans-tc-32-500-normal.woff2 +0 -0
  591. package/dist/fonts/noto-sans-tc-32-600-normal.woff2 +0 -0
  592. package/dist/fonts/noto-sans-tc-32-700-normal.woff2 +0 -0
  593. package/dist/fonts/noto-sans-tc-33-400-normal.woff2 +0 -0
  594. package/dist/fonts/noto-sans-tc-33-500-normal.woff2 +0 -0
  595. package/dist/fonts/noto-sans-tc-33-600-normal.woff2 +0 -0
  596. package/dist/fonts/noto-sans-tc-33-700-normal.woff2 +0 -0
  597. package/dist/fonts/noto-sans-tc-34-400-normal.woff2 +0 -0
  598. package/dist/fonts/noto-sans-tc-34-500-normal.woff2 +0 -0
  599. package/dist/fonts/noto-sans-tc-34-600-normal.woff2 +0 -0
  600. package/dist/fonts/noto-sans-tc-34-700-normal.woff2 +0 -0
  601. package/dist/fonts/noto-sans-tc-35-400-normal.woff2 +0 -0
  602. package/dist/fonts/noto-sans-tc-35-500-normal.woff2 +0 -0
  603. package/dist/fonts/noto-sans-tc-35-600-normal.woff2 +0 -0
  604. package/dist/fonts/noto-sans-tc-35-700-normal.woff2 +0 -0
  605. package/dist/fonts/noto-sans-tc-36-400-normal.woff2 +0 -0
  606. package/dist/fonts/noto-sans-tc-36-500-normal.woff2 +0 -0
  607. package/dist/fonts/noto-sans-tc-36-600-normal.woff2 +0 -0
  608. package/dist/fonts/noto-sans-tc-36-700-normal.woff2 +0 -0
  609. package/dist/fonts/noto-sans-tc-37-400-normal.woff2 +0 -0
  610. package/dist/fonts/noto-sans-tc-37-500-normal.woff2 +0 -0
  611. package/dist/fonts/noto-sans-tc-37-600-normal.woff2 +0 -0
  612. package/dist/fonts/noto-sans-tc-37-700-normal.woff2 +0 -0
  613. package/dist/fonts/noto-sans-tc-38-400-normal.woff2 +0 -0
  614. package/dist/fonts/noto-sans-tc-38-500-normal.woff2 +0 -0
  615. package/dist/fonts/noto-sans-tc-38-600-normal.woff2 +0 -0
  616. package/dist/fonts/noto-sans-tc-38-700-normal.woff2 +0 -0
  617. package/dist/fonts/noto-sans-tc-39-400-normal.woff2 +0 -0
  618. package/dist/fonts/noto-sans-tc-39-500-normal.woff2 +0 -0
  619. package/dist/fonts/noto-sans-tc-39-600-normal.woff2 +0 -0
  620. package/dist/fonts/noto-sans-tc-39-700-normal.woff2 +0 -0
  621. package/dist/fonts/noto-sans-tc-4-400-normal.woff2 +0 -0
  622. package/dist/fonts/noto-sans-tc-4-500-normal.woff2 +0 -0
  623. package/dist/fonts/noto-sans-tc-4-600-normal.woff2 +0 -0
  624. package/dist/fonts/noto-sans-tc-4-700-normal.woff2 +0 -0
  625. package/dist/fonts/noto-sans-tc-40-400-normal.woff2 +0 -0
  626. package/dist/fonts/noto-sans-tc-40-500-normal.woff2 +0 -0
  627. package/dist/fonts/noto-sans-tc-40-600-normal.woff2 +0 -0
  628. package/dist/fonts/noto-sans-tc-40-700-normal.woff2 +0 -0
  629. package/dist/fonts/noto-sans-tc-41-400-normal.woff2 +0 -0
  630. package/dist/fonts/noto-sans-tc-41-500-normal.woff2 +0 -0
  631. package/dist/fonts/noto-sans-tc-41-600-normal.woff2 +0 -0
  632. package/dist/fonts/noto-sans-tc-41-700-normal.woff2 +0 -0
  633. package/dist/fonts/noto-sans-tc-42-400-normal.woff2 +0 -0
  634. package/dist/fonts/noto-sans-tc-42-500-normal.woff2 +0 -0
  635. package/dist/fonts/noto-sans-tc-42-600-normal.woff2 +0 -0
  636. package/dist/fonts/noto-sans-tc-42-700-normal.woff2 +0 -0
  637. package/dist/fonts/noto-sans-tc-43-400-normal.woff2 +0 -0
  638. package/dist/fonts/noto-sans-tc-43-500-normal.woff2 +0 -0
  639. package/dist/fonts/noto-sans-tc-43-600-normal.woff2 +0 -0
  640. package/dist/fonts/noto-sans-tc-43-700-normal.woff2 +0 -0
  641. package/dist/fonts/noto-sans-tc-44-400-normal.woff2 +0 -0
  642. package/dist/fonts/noto-sans-tc-44-500-normal.woff2 +0 -0
  643. package/dist/fonts/noto-sans-tc-44-600-normal.woff2 +0 -0
  644. package/dist/fonts/noto-sans-tc-44-700-normal.woff2 +0 -0
  645. package/dist/fonts/noto-sans-tc-45-400-normal.woff2 +0 -0
  646. package/dist/fonts/noto-sans-tc-45-500-normal.woff2 +0 -0
  647. package/dist/fonts/noto-sans-tc-45-600-normal.woff2 +0 -0
  648. package/dist/fonts/noto-sans-tc-45-700-normal.woff2 +0 -0
  649. package/dist/fonts/noto-sans-tc-46-400-normal.woff2 +0 -0
  650. package/dist/fonts/noto-sans-tc-46-500-normal.woff2 +0 -0
  651. package/dist/fonts/noto-sans-tc-46-600-normal.woff2 +0 -0
  652. package/dist/fonts/noto-sans-tc-46-700-normal.woff2 +0 -0
  653. package/dist/fonts/noto-sans-tc-47-400-normal.woff2 +0 -0
  654. package/dist/fonts/noto-sans-tc-47-500-normal.woff2 +0 -0
  655. package/dist/fonts/noto-sans-tc-47-600-normal.woff2 +0 -0
  656. package/dist/fonts/noto-sans-tc-47-700-normal.woff2 +0 -0
  657. package/dist/fonts/noto-sans-tc-48-400-normal.woff2 +0 -0
  658. package/dist/fonts/noto-sans-tc-48-500-normal.woff2 +0 -0
  659. package/dist/fonts/noto-sans-tc-48-600-normal.woff2 +0 -0
  660. package/dist/fonts/noto-sans-tc-48-700-normal.woff2 +0 -0
  661. package/dist/fonts/noto-sans-tc-49-400-normal.woff2 +0 -0
  662. package/dist/fonts/noto-sans-tc-49-500-normal.woff2 +0 -0
  663. package/dist/fonts/noto-sans-tc-49-600-normal.woff2 +0 -0
  664. package/dist/fonts/noto-sans-tc-49-700-normal.woff2 +0 -0
  665. package/dist/fonts/noto-sans-tc-50-400-normal.woff2 +0 -0
  666. package/dist/fonts/noto-sans-tc-50-500-normal.woff2 +0 -0
  667. package/dist/fonts/noto-sans-tc-50-600-normal.woff2 +0 -0
  668. package/dist/fonts/noto-sans-tc-50-700-normal.woff2 +0 -0
  669. package/dist/fonts/noto-sans-tc-51-400-normal.woff2 +0 -0
  670. package/dist/fonts/noto-sans-tc-51-500-normal.woff2 +0 -0
  671. package/dist/fonts/noto-sans-tc-51-600-normal.woff2 +0 -0
  672. package/dist/fonts/noto-sans-tc-51-700-normal.woff2 +0 -0
  673. package/dist/fonts/noto-sans-tc-52-400-normal.woff2 +0 -0
  674. package/dist/fonts/noto-sans-tc-52-500-normal.woff2 +0 -0
  675. package/dist/fonts/noto-sans-tc-52-600-normal.woff2 +0 -0
  676. package/dist/fonts/noto-sans-tc-52-700-normal.woff2 +0 -0
  677. package/dist/fonts/noto-sans-tc-53-400-normal.woff2 +0 -0
  678. package/dist/fonts/noto-sans-tc-53-500-normal.woff2 +0 -0
  679. package/dist/fonts/noto-sans-tc-53-600-normal.woff2 +0 -0
  680. package/dist/fonts/noto-sans-tc-53-700-normal.woff2 +0 -0
  681. package/dist/fonts/noto-sans-tc-54-400-normal.woff2 +0 -0
  682. package/dist/fonts/noto-sans-tc-54-500-normal.woff2 +0 -0
  683. package/dist/fonts/noto-sans-tc-54-600-normal.woff2 +0 -0
  684. package/dist/fonts/noto-sans-tc-54-700-normal.woff2 +0 -0
  685. package/dist/fonts/noto-sans-tc-55-400-normal.woff2 +0 -0
  686. package/dist/fonts/noto-sans-tc-55-500-normal.woff2 +0 -0
  687. package/dist/fonts/noto-sans-tc-55-600-normal.woff2 +0 -0
  688. package/dist/fonts/noto-sans-tc-55-700-normal.woff2 +0 -0
  689. package/dist/fonts/noto-sans-tc-56-400-normal.woff2 +0 -0
  690. package/dist/fonts/noto-sans-tc-56-500-normal.woff2 +0 -0
  691. package/dist/fonts/noto-sans-tc-56-600-normal.woff2 +0 -0
  692. package/dist/fonts/noto-sans-tc-56-700-normal.woff2 +0 -0
  693. package/dist/fonts/noto-sans-tc-57-400-normal.woff2 +0 -0
  694. package/dist/fonts/noto-sans-tc-57-500-normal.woff2 +0 -0
  695. package/dist/fonts/noto-sans-tc-57-600-normal.woff2 +0 -0
  696. package/dist/fonts/noto-sans-tc-57-700-normal.woff2 +0 -0
  697. package/dist/fonts/noto-sans-tc-58-400-normal.woff2 +0 -0
  698. package/dist/fonts/noto-sans-tc-58-500-normal.woff2 +0 -0
  699. package/dist/fonts/noto-sans-tc-58-600-normal.woff2 +0 -0
  700. package/dist/fonts/noto-sans-tc-58-700-normal.woff2 +0 -0
  701. package/dist/fonts/noto-sans-tc-59-400-normal.woff2 +0 -0
  702. package/dist/fonts/noto-sans-tc-59-500-normal.woff2 +0 -0
  703. package/dist/fonts/noto-sans-tc-59-600-normal.woff2 +0 -0
  704. package/dist/fonts/noto-sans-tc-59-700-normal.woff2 +0 -0
  705. package/dist/fonts/noto-sans-tc-60-400-normal.woff2 +0 -0
  706. package/dist/fonts/noto-sans-tc-60-500-normal.woff2 +0 -0
  707. package/dist/fonts/noto-sans-tc-60-600-normal.woff2 +0 -0
  708. package/dist/fonts/noto-sans-tc-60-700-normal.woff2 +0 -0
  709. package/dist/fonts/noto-sans-tc-61-400-normal.woff2 +0 -0
  710. package/dist/fonts/noto-sans-tc-61-500-normal.woff2 +0 -0
  711. package/dist/fonts/noto-sans-tc-61-600-normal.woff2 +0 -0
  712. package/dist/fonts/noto-sans-tc-61-700-normal.woff2 +0 -0
  713. package/dist/fonts/noto-sans-tc-62-400-normal.woff2 +0 -0
  714. package/dist/fonts/noto-sans-tc-62-500-normal.woff2 +0 -0
  715. package/dist/fonts/noto-sans-tc-62-600-normal.woff2 +0 -0
  716. package/dist/fonts/noto-sans-tc-62-700-normal.woff2 +0 -0
  717. package/dist/fonts/noto-sans-tc-63-400-normal.woff2 +0 -0
  718. package/dist/fonts/noto-sans-tc-63-500-normal.woff2 +0 -0
  719. package/dist/fonts/noto-sans-tc-63-600-normal.woff2 +0 -0
  720. package/dist/fonts/noto-sans-tc-63-700-normal.woff2 +0 -0
  721. package/dist/fonts/noto-sans-tc-64-400-normal.woff2 +0 -0
  722. package/dist/fonts/noto-sans-tc-64-500-normal.woff2 +0 -0
  723. package/dist/fonts/noto-sans-tc-64-600-normal.woff2 +0 -0
  724. package/dist/fonts/noto-sans-tc-64-700-normal.woff2 +0 -0
  725. package/dist/fonts/noto-sans-tc-65-400-normal.woff2 +0 -0
  726. package/dist/fonts/noto-sans-tc-65-500-normal.woff2 +0 -0
  727. package/dist/fonts/noto-sans-tc-65-600-normal.woff2 +0 -0
  728. package/dist/fonts/noto-sans-tc-65-700-normal.woff2 +0 -0
  729. package/dist/fonts/noto-sans-tc-66-400-normal.woff2 +0 -0
  730. package/dist/fonts/noto-sans-tc-66-500-normal.woff2 +0 -0
  731. package/dist/fonts/noto-sans-tc-66-600-normal.woff2 +0 -0
  732. package/dist/fonts/noto-sans-tc-66-700-normal.woff2 +0 -0
  733. package/dist/fonts/noto-sans-tc-67-400-normal.woff2 +0 -0
  734. package/dist/fonts/noto-sans-tc-67-500-normal.woff2 +0 -0
  735. package/dist/fonts/noto-sans-tc-67-600-normal.woff2 +0 -0
  736. package/dist/fonts/noto-sans-tc-67-700-normal.woff2 +0 -0
  737. package/dist/fonts/noto-sans-tc-68-400-normal.woff2 +0 -0
  738. package/dist/fonts/noto-sans-tc-68-500-normal.woff2 +0 -0
  739. package/dist/fonts/noto-sans-tc-68-600-normal.woff2 +0 -0
  740. package/dist/fonts/noto-sans-tc-68-700-normal.woff2 +0 -0
  741. package/dist/fonts/noto-sans-tc-69-400-normal.woff2 +0 -0
  742. package/dist/fonts/noto-sans-tc-69-500-normal.woff2 +0 -0
  743. package/dist/fonts/noto-sans-tc-69-600-normal.woff2 +0 -0
  744. package/dist/fonts/noto-sans-tc-69-700-normal.woff2 +0 -0
  745. package/dist/fonts/noto-sans-tc-70-400-normal.woff2 +0 -0
  746. package/dist/fonts/noto-sans-tc-70-500-normal.woff2 +0 -0
  747. package/dist/fonts/noto-sans-tc-70-600-normal.woff2 +0 -0
  748. package/dist/fonts/noto-sans-tc-70-700-normal.woff2 +0 -0
  749. package/dist/fonts/noto-sans-tc-71-400-normal.woff2 +0 -0
  750. package/dist/fonts/noto-sans-tc-71-500-normal.woff2 +0 -0
  751. package/dist/fonts/noto-sans-tc-71-600-normal.woff2 +0 -0
  752. package/dist/fonts/noto-sans-tc-71-700-normal.woff2 +0 -0
  753. package/dist/fonts/noto-sans-tc-72-400-normal.woff2 +0 -0
  754. package/dist/fonts/noto-sans-tc-72-500-normal.woff2 +0 -0
  755. package/dist/fonts/noto-sans-tc-72-600-normal.woff2 +0 -0
  756. package/dist/fonts/noto-sans-tc-72-700-normal.woff2 +0 -0
  757. package/dist/fonts/noto-sans-tc-73-400-normal.woff2 +0 -0
  758. package/dist/fonts/noto-sans-tc-73-500-normal.woff2 +0 -0
  759. package/dist/fonts/noto-sans-tc-73-600-normal.woff2 +0 -0
  760. package/dist/fonts/noto-sans-tc-73-700-normal.woff2 +0 -0
  761. package/dist/fonts/noto-sans-tc-74-400-normal.woff2 +0 -0
  762. package/dist/fonts/noto-sans-tc-74-500-normal.woff2 +0 -0
  763. package/dist/fonts/noto-sans-tc-74-600-normal.woff2 +0 -0
  764. package/dist/fonts/noto-sans-tc-74-700-normal.woff2 +0 -0
  765. package/dist/fonts/noto-sans-tc-75-400-normal.woff2 +0 -0
  766. package/dist/fonts/noto-sans-tc-75-500-normal.woff2 +0 -0
  767. package/dist/fonts/noto-sans-tc-75-600-normal.woff2 +0 -0
  768. package/dist/fonts/noto-sans-tc-75-700-normal.woff2 +0 -0
  769. package/dist/fonts/noto-sans-tc-76-400-normal.woff2 +0 -0
  770. package/dist/fonts/noto-sans-tc-76-500-normal.woff2 +0 -0
  771. package/dist/fonts/noto-sans-tc-76-600-normal.woff2 +0 -0
  772. package/dist/fonts/noto-sans-tc-76-700-normal.woff2 +0 -0
  773. package/dist/fonts/noto-sans-tc-77-400-normal.woff2 +0 -0
  774. package/dist/fonts/noto-sans-tc-77-500-normal.woff2 +0 -0
  775. package/dist/fonts/noto-sans-tc-77-600-normal.woff2 +0 -0
  776. package/dist/fonts/noto-sans-tc-77-700-normal.woff2 +0 -0
  777. package/dist/fonts/noto-sans-tc-78-400-normal.woff2 +0 -0
  778. package/dist/fonts/noto-sans-tc-78-500-normal.woff2 +0 -0
  779. package/dist/fonts/noto-sans-tc-78-600-normal.woff2 +0 -0
  780. package/dist/fonts/noto-sans-tc-78-700-normal.woff2 +0 -0
  781. package/dist/fonts/noto-sans-tc-79-400-normal.woff2 +0 -0
  782. package/dist/fonts/noto-sans-tc-79-500-normal.woff2 +0 -0
  783. package/dist/fonts/noto-sans-tc-79-600-normal.woff2 +0 -0
  784. package/dist/fonts/noto-sans-tc-79-700-normal.woff2 +0 -0
  785. package/dist/fonts/noto-sans-tc-80-400-normal.woff2 +0 -0
  786. package/dist/fonts/noto-sans-tc-80-500-normal.woff2 +0 -0
  787. package/dist/fonts/noto-sans-tc-80-600-normal.woff2 +0 -0
  788. package/dist/fonts/noto-sans-tc-80-700-normal.woff2 +0 -0
  789. package/dist/fonts/noto-sans-tc-81-400-normal.woff2 +0 -0
  790. package/dist/fonts/noto-sans-tc-81-500-normal.woff2 +0 -0
  791. package/dist/fonts/noto-sans-tc-81-600-normal.woff2 +0 -0
  792. package/dist/fonts/noto-sans-tc-81-700-normal.woff2 +0 -0
  793. package/dist/fonts/noto-sans-tc-82-400-normal.woff2 +0 -0
  794. package/dist/fonts/noto-sans-tc-82-500-normal.woff2 +0 -0
  795. package/dist/fonts/noto-sans-tc-82-600-normal.woff2 +0 -0
  796. package/dist/fonts/noto-sans-tc-82-700-normal.woff2 +0 -0
  797. package/dist/fonts/noto-sans-tc-83-400-normal.woff2 +0 -0
  798. package/dist/fonts/noto-sans-tc-83-500-normal.woff2 +0 -0
  799. package/dist/fonts/noto-sans-tc-83-600-normal.woff2 +0 -0
  800. package/dist/fonts/noto-sans-tc-83-700-normal.woff2 +0 -0
  801. package/dist/fonts/noto-sans-tc-84-400-normal.woff2 +0 -0
  802. package/dist/fonts/noto-sans-tc-84-500-normal.woff2 +0 -0
  803. package/dist/fonts/noto-sans-tc-84-600-normal.woff2 +0 -0
  804. package/dist/fonts/noto-sans-tc-84-700-normal.woff2 +0 -0
  805. package/dist/fonts/noto-sans-tc-85-400-normal.woff2 +0 -0
  806. package/dist/fonts/noto-sans-tc-85-500-normal.woff2 +0 -0
  807. package/dist/fonts/noto-sans-tc-85-600-normal.woff2 +0 -0
  808. package/dist/fonts/noto-sans-tc-85-700-normal.woff2 +0 -0
  809. package/dist/fonts/noto-sans-tc-86-400-normal.woff2 +0 -0
  810. package/dist/fonts/noto-sans-tc-86-500-normal.woff2 +0 -0
  811. package/dist/fonts/noto-sans-tc-86-600-normal.woff2 +0 -0
  812. package/dist/fonts/noto-sans-tc-86-700-normal.woff2 +0 -0
  813. package/dist/fonts/noto-sans-tc-87-400-normal.woff2 +0 -0
  814. package/dist/fonts/noto-sans-tc-87-500-normal.woff2 +0 -0
  815. package/dist/fonts/noto-sans-tc-87-600-normal.woff2 +0 -0
  816. package/dist/fonts/noto-sans-tc-87-700-normal.woff2 +0 -0
  817. package/dist/fonts/noto-sans-tc-88-400-normal.woff2 +0 -0
  818. package/dist/fonts/noto-sans-tc-88-500-normal.woff2 +0 -0
  819. package/dist/fonts/noto-sans-tc-88-600-normal.woff2 +0 -0
  820. package/dist/fonts/noto-sans-tc-88-700-normal.woff2 +0 -0
  821. package/dist/fonts/noto-sans-tc-89-400-normal.woff2 +0 -0
  822. package/dist/fonts/noto-sans-tc-89-500-normal.woff2 +0 -0
  823. package/dist/fonts/noto-sans-tc-89-600-normal.woff2 +0 -0
  824. package/dist/fonts/noto-sans-tc-89-700-normal.woff2 +0 -0
  825. package/dist/fonts/noto-sans-tc-90-400-normal.woff2 +0 -0
  826. package/dist/fonts/noto-sans-tc-90-500-normal.woff2 +0 -0
  827. package/dist/fonts/noto-sans-tc-90-600-normal.woff2 +0 -0
  828. package/dist/fonts/noto-sans-tc-90-700-normal.woff2 +0 -0
  829. package/dist/fonts/noto-sans-tc-91-400-normal.woff2 +0 -0
  830. package/dist/fonts/noto-sans-tc-91-500-normal.woff2 +0 -0
  831. package/dist/fonts/noto-sans-tc-91-600-normal.woff2 +0 -0
  832. package/dist/fonts/noto-sans-tc-91-700-normal.woff2 +0 -0
  833. package/dist/fonts/noto-sans-tc-92-400-normal.woff2 +0 -0
  834. package/dist/fonts/noto-sans-tc-92-500-normal.woff2 +0 -0
  835. package/dist/fonts/noto-sans-tc-92-600-normal.woff2 +0 -0
  836. package/dist/fonts/noto-sans-tc-92-700-normal.woff2 +0 -0
  837. package/dist/fonts/noto-sans-tc-93-400-normal.woff2 +0 -0
  838. package/dist/fonts/noto-sans-tc-93-500-normal.woff2 +0 -0
  839. package/dist/fonts/noto-sans-tc-93-600-normal.woff2 +0 -0
  840. package/dist/fonts/noto-sans-tc-93-700-normal.woff2 +0 -0
  841. package/dist/fonts/noto-sans-tc-94-400-normal.woff2 +0 -0
  842. package/dist/fonts/noto-sans-tc-94-500-normal.woff2 +0 -0
  843. package/dist/fonts/noto-sans-tc-94-600-normal.woff2 +0 -0
  844. package/dist/fonts/noto-sans-tc-94-700-normal.woff2 +0 -0
  845. package/dist/fonts/noto-sans-tc-95-400-normal.woff2 +0 -0
  846. package/dist/fonts/noto-sans-tc-95-500-normal.woff2 +0 -0
  847. package/dist/fonts/noto-sans-tc-95-600-normal.woff2 +0 -0
  848. package/dist/fonts/noto-sans-tc-95-700-normal.woff2 +0 -0
  849. package/dist/fonts/noto-sans-tc-96-400-normal.woff2 +0 -0
  850. package/dist/fonts/noto-sans-tc-96-500-normal.woff2 +0 -0
  851. package/dist/fonts/noto-sans-tc-96-600-normal.woff2 +0 -0
  852. package/dist/fonts/noto-sans-tc-96-700-normal.woff2 +0 -0
  853. package/dist/fonts/noto-sans-tc-cyrillic-400-normal.woff2 +0 -0
  854. package/dist/fonts/noto-sans-tc-cyrillic-500-normal.woff2 +0 -0
  855. package/dist/fonts/noto-sans-tc-cyrillic-600-normal.woff2 +0 -0
  856. package/dist/fonts/noto-sans-tc-cyrillic-700-normal.woff2 +0 -0
  857. package/dist/fonts/noto-sans-tc-latin-400-normal.woff2 +0 -0
  858. package/dist/fonts/noto-sans-tc-latin-500-normal.woff2 +0 -0
  859. package/dist/fonts/noto-sans-tc-latin-600-normal.woff2 +0 -0
  860. package/dist/fonts/noto-sans-tc-latin-700-normal.woff2 +0 -0
  861. package/dist/fonts/noto-sans-tc-latin-ext-400-normal.woff2 +0 -0
  862. package/dist/fonts/noto-sans-tc-latin-ext-500-normal.woff2 +0 -0
  863. package/dist/fonts/noto-sans-tc-latin-ext-600-normal.woff2 +0 -0
  864. package/dist/fonts/noto-sans-tc-latin-ext-700-normal.woff2 +0 -0
  865. package/dist/fonts/noto-sans-tc-vietnamese-400-normal.woff2 +0 -0
  866. package/dist/fonts/noto-sans-tc-vietnamese-500-normal.woff2 +0 -0
  867. package/dist/fonts/noto-sans-tc-vietnamese-600-normal.woff2 +0 -0
  868. package/dist/fonts/noto-sans-tc-vietnamese-700-normal.woff2 +0 -0
package/dist/format.d.ts CHANGED
@@ -10,7 +10,9 @@ declare function time(d: Date | null | undefined): string;
10
10
  declare function dateTime(d: Date | null | undefined, o?: {
11
11
  weekday?: boolean;
12
12
  }): string;
13
- /** Within 7 days: 「2 小時前」、「昨天」. Older: full date and time. Pass now to test. */
13
+ /** Under 1 hour: 「現在」 or 「5 分鐘前」. The same calendar day: 「2 小時前」. An earlier day: by calendar days, 「昨天」
14
+ * for any time yesterday (also 30 minutes before midnight seen after it, once an hour has passed), 「3 天前」 up to 6
15
+ * days. 7 calendar days or more, or in the future: the full date and time. Pass now to test. */
14
16
  declare function relative(d: Date | null | undefined, now?: Date): string;
15
17
  declare function month(d: Date): string;
16
18
  /** Week starts on Sunday for zh-TW; other locales use Intl's week info when the browser has it. */
package/dist/format.js CHANGED
@@ -45,16 +45,24 @@ function dateTime(d, o) {
45
45
  const day = date(d, o);
46
46
  return isZhTW() && day.endsWith(")") ? day + time(d) : `${day} ${time(d)}`;
47
47
  }
48
- /** Within 7 days: 「2 小時前」、「昨天」. Older: full date and time. Pass now to test. */
48
+ /** Whole local calendar days from d to now: 1 for any time yesterday, whatever the hour. */
49
+ function dayDiff(d, now) {
50
+ const day = (x) => Date.UTC(x.getFullYear(), x.getMonth(), x.getDate());
51
+ return Math.round((day(now) - day(d)) / 864e5);
52
+ }
53
+ /** Under 1 hour: 「現在」 or 「5 分鐘前」. The same calendar day: 「2 小時前」. An earlier day: by calendar days, 「昨天」
54
+ * for any time yesterday (also 30 minutes before midnight seen after it, once an hour has passed), 「3 天前」 up to 6
55
+ * days. 7 calendar days or more, or in the future: the full date and time. Pass now to test. */
49
56
  function relative(d, now = /* @__PURE__ */ new Date()) {
50
57
  if (!d) return "";
51
58
  const s = (now.getTime() - d.getTime()) / 1e3;
52
- if (s < 0 || s >= 604800) return dateTime(d);
59
+ const days = dayDiff(d, now);
60
+ if (s < 0 || days >= 7) return dateTime(d);
53
61
  const rt = new Intl.RelativeTimeFormat(I18N.locale, { numeric: "auto" });
54
62
  if (s < 60) return rt.format(0, "second");
55
63
  if (s < 3600) return rt.format(-Math.floor(s / 60), "minute");
56
- if (s < 86400) return rt.format(-Math.floor(s / 3600), "hour");
57
- return rt.format(-Math.floor(s / 86400), "day");
64
+ if (days === 0) return rt.format(-Math.floor(s / 3600), "hour");
65
+ return rt.format(-days, "day");
58
66
  }
59
67
  function month(d) {
60
68
  return new Intl.DateTimeFormat(I18N.locale, {
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","names":[],"sources":["../src/format.ts"],"sourcesContent":["import { I18N, isZhTW, tr } from './i18n';\n\n/* Dates and numbers for the current locale (setLocale). zh-TW follows the design system's rules\n (2026/11/04(三), 24-hour clock, NT$ 1,280, 萬 and 億 in KPI cards); other locales use Intl's conventions. */\n\nexport type Decimals = number | 'money' | 'percent' | 'size' | 'count';\n\nconst DECIMALS = { money: 0, percent: 1, size: 1, count: 0 } as const;\n\nconst pad2 = (n: number): string => String(n).padStart(2, '0');\n\nfunction locale(): string {\n return I18N.locale;\n}\n\n/** zh-TW: 2026/11/04(三). Other locales: their short date with weekday. */\nfunction date(d: Date | null | undefined, o: { weekday?: boolean; long?: boolean } = {}): string {\n if (!d) return '';\n const wd = o.weekday !== false;\n if (o.long) return new Intl.DateTimeFormat(I18N.locale, { year: 'numeric', month: 'long', day: 'numeric', weekday: wd ? 'long' : undefined }).format(d);\n if (isZhTW()) return fmtDate(d) + (wd ? `(${new Intl.DateTimeFormat('zh-TW', { weekday: 'narrow' }).format(d)})` : '');\n return new Intl.DateTimeFormat(I18N.locale, { year: 'numeric', month: '2-digit', day: '2-digit', weekday: wd ? 'short' : undefined }).format(d);\n}\n\n/** zh-TW: 24-hour 15:57. Other locales: their own clock. */\nfunction time(d: Date | null | undefined): string {\n if (!d) return '';\n return new Intl.DateTimeFormat(\n I18N.locale,\n isZhTW() ? { hour: '2-digit', minute: '2-digit', hourCycle: 'h23' } : { hour: 'numeric', minute: '2-digit' },\n ).format(d);\n}\n\nfunction dateTime(d: Date | null | undefined, o?: { weekday?: boolean }): string {\n if (!d) return '';\n // zh-TW: the full-width 「)」 already leaves half a character of room, so no space after it: 2026/11/04(三)13:00.\n const day = date(d, o);\n return isZhTW() && day.endsWith(')') ? day + time(d) : `${day} ${time(d)}`;\n}\n\n/** Within 7 days: 「2 小時前」、「昨天」. Older: full date and time. Pass now to test. */\nfunction relative(d: Date | null | undefined, now: Date = new Date()): string {\n if (!d) return '';\n const s = (now.getTime() - d.getTime()) / 1000;\n if (s < 0 || s >= 604800) return dateTime(d);\n const rt = new Intl.RelativeTimeFormat(I18N.locale, { numeric: 'auto' });\n if (s < 60) return rt.format(0, 'second');\n if (s < 3600) return rt.format(-Math.floor(s / 60), 'minute');\n if (s < 86400) return rt.format(-Math.floor(s / 3600), 'hour');\n return rt.format(-Math.floor(s / 86400), 'day');\n}\n\nfunction month(d: Date): string {\n return new Intl.DateTimeFormat(I18N.locale, { year: 'numeric', month: 'long' }).format(d);\n}\n\n/** Week starts on Sunday for zh-TW; other locales use Intl's week info when the browser has it. */\nfunction firstDay(): number {\n if (isZhTW()) return 0;\n try {\n const l = new Intl.Locale(I18N.locale) as Intl.Locale & { getWeekInfo?: () => { firstDay: number }; weekInfo?: { firstDay: number } };\n const w = l.getWeekInfo ? l.getWeekInfo() : l.weekInfo;\n if (w?.firstDay) return w.firstDay % 7;\n } catch {\n /* older browsers have no week info */\n }\n return 0;\n}\n\n/** Narrow weekday names, starting from firstDay(). */\nfunction weekdays(): string[] {\n const fd = firstDay();\n const f = new Intl.DateTimeFormat(I18N.locale, { weekday: 'narrow' });\n // 2026/11/01 is a Sunday.\n return Array.from({ length: 7 }, (_, i) => f.format(new Date(2026, 10, 1 + ((fd + i) % 7))));\n}\n\n/** Decimals by unit: money 0, percent 1, size 1, count 0; pass a number to force it. */\nfunction number(v: number, dec?: Decimals): string {\n const dd = typeof dec === 'number' ? dec : dec ? DECIMALS[dec] : 0;\n return new Intl.NumberFormat(I18N.locale, { minimumFractionDigits: dd, maximumFractionDigits: dd }).format(v);\n}\n\nfunction percent(v: number, dec = 1): string {\n return new Intl.NumberFormat(I18N.locale, { style: 'percent', minimumFractionDigits: dec, maximumFractionDigits: dec }).format(v / 100);\n}\n\n/** Only KPI cards abbreviate: 1,284 萬 in zh-TW (萬、億), 12.8M in English.\n * like: format v with the unit and decimals that `like` gets, so a counting KPI keeps its width. */\nfunction compact(v: number, like?: number): string {\n const ref = like ?? v;\n if (Math.abs(ref) < 1e4) return number(v);\n if (/^zh/i.test(I18N.locale)) {\n const a = Math.abs(ref);\n // 99,999,999 rounds to 10,000.0 萬: write it as 1 億.\n const [unit, div, maxDec] = Math.round(a / 1e3) >= 1e5 ? (['億', 1e8, 2] as const) : (['萬', 1e4, 1] as const);\n const finalStr = new Intl.NumberFormat(I18N.locale, { maximumFractionDigits: maxDec }).format(a / div);\n const sign = v < 0 ? '-' : '';\n if (like === undefined) return `${sign}${finalStr} ${unit}`;\n const digits = (finalStr.split('.')[1] || '').length;\n return `${sign}${new Intl.NumberFormat(I18N.locale, { minimumFractionDigits: digits, maximumFractionDigits: digits }).format(Math.abs(v) / div)} ${unit}`;\n }\n const nf = new Intl.NumberFormat(I18N.locale, { notation: 'compact', maximumFractionDigits: 1 });\n if (like === undefined) return nf.format(v);\n const parts = nf.formatToParts(ref);\n let num = '';\n let dec = '';\n for (const pt of parts) {\n if (pt.type === 'integer') num += pt.value;\n if (pt.type === 'fraction') {\n num += '.' + pt.value;\n dec = pt.value;\n }\n }\n const mant = parseFloat(num) || 1;\n const scale = 10 ** Math.round(Math.log10(Math.abs(ref) / mant));\n const inner = new Intl.NumberFormat(I18N.locale, { minimumFractionDigits: dec.length, maximumFractionDigits: dec.length }).format(Math.abs(v) / scale);\n let done = false;\n const body = parts\n .map((pt) => {\n if (pt.type === 'integer' || pt.type === 'group' || pt.type === 'decimal' || pt.type === 'fraction') {\n if (done) return '';\n done = true;\n return inner;\n }\n return pt.value;\n })\n .join('');\n return (v < 0 && ref >= 0 ? '-' : '') + body;\n}\n\n/** zh-TW with TWD: NT$ 1,280, negatives -NT$ 1,280. Other locales and currencies: Intl's own symbol and order. */\nfunction money(v: number, o: { currency?: string; compact?: boolean; like?: number } = {}): string {\n const cur = o.currency || I18N.currency;\n const body = o.compact ? compact(Math.abs(v), o.like !== undefined ? Math.abs(o.like) : undefined) : number(Math.abs(v), 'money');\n if (isZhTW() && cur === 'TWD') return `${v < 0 ? '-' : ''}NT$ ${body}`;\n if (o.compact) return `${v < 0 ? '-' : ''}${body} ${cur}`;\n return new Intl.NumberFormat(I18N.locale, {\n style: 'currency',\n currency: cur,\n // narrowSymbol writes TWD as a bare 「$」, which reads as dollars: keep 「NT$」 (docs: 英文介面顯示 NT$486,000).\n currencyDisplay: cur === 'TWD' ? 'symbol' : 'narrowSymbol',\n minimumFractionDigits: 0,\n maximumFractionDigits: cur === 'TWD' || cur === 'JPY' ? 0 : 2,\n }).format(v);\n}\n\n/** Bytes to 「186 KB」「54.9 MB」「1.2 GB」. */\nexport function fileSize(b: number | null | undefined): string {\n if (b == null || Number.isNaN(b)) return '';\n // An empty file is 0 KB; anything else at least 1 KB.\n // Compare after rounding: 1,048,500 bytes rounds to 1,024 KB, so it is written 「1.0 MB」.\n if (Math.round(b / 1024) < 1024) return number(b === 0 ? 0 : Math.max(1, Math.round(b / 1024))) + ' KB';\n if (Math.round((b / 1048576) * 10) < 10240) return number(b / 1048576, 1) + ' MB';\n return number(b / 1073741824, 1) + ' GB';\n}\n\n/** Seconds as a clock-style length: under 1 h 「46:42」「1:30」 (minutes not zero-padded), 1 h or more 「1:54:49」.\n * Rounded to the second. Negative, NaN or missing: 「—」. */\nfunction duration(seconds: number | null | undefined): string {\n if (seconds == null || Number.isNaN(seconds) || seconds < 0 || !Number.isFinite(seconds)) return '—';\n const t = Math.round(seconds);\n const h = Math.floor(t / 3600);\n const m = Math.floor((t % 3600) / 60);\n const s = t % 60;\n return h ? `${h}:${pad2(m)}:${pad2(s)}` : `${m}:${pad2(s)}`;\n}\n\n/** Shortens a path: keeps the first segment and the last two, 「src/…/hooks/ops.c:58」. */\nfunction path(p: string | null | undefined, o: { head?: number; tail?: number } = {}): string {\n const head = o.head ?? 1;\n const tail = o.tail ?? 2;\n const parts = String(p ?? '').split('/');\n return parts.length > head + tail ? `${parts.slice(0, head).join('/')}/…/${parts.slice(-tail).join('/')}` : String(p ?? '');\n}\n\n/** A part of a whole, as shown: 「1 / 1 個」「6 / 6 筆」, or 「1 / 5」 without a unit. Give screen readers\n * `fractionLabel` with it: they read the slash as 「斜線」. */\nfunction fraction(n: number, total: number, unit?: string): string {\n return tr(unit ? '{n} / {total} {unit}' : '{n} / {total}', { n: number(n), total: number(total), unit: unit ?? '' });\n}\n\n/** The same fraction as read aloud: 「1 個中的 1 個」「6 筆中的 6 筆」, or 「5 中的 1」 without a unit (English:\n * 「1 of 1」). For `aria-label`, or for visually hidden text beside the shown fraction. */\nfunction fractionLabel(n: number, total: number, unit?: string): string {\n return tr(unit ? '{total} {unit}中的 {n} {unit}' : '{total} 中的 {n}', { n: number(n), total: number(total), unit: unit ?? '' });\n}\n\n/** Every date, number, amount, size and path shown in the UI goes through these. */\nexport const format = {\n locale,\n date,\n time,\n dateTime,\n relative,\n month,\n weekdays,\n firstDay,\n number,\n percent,\n compact,\n money,\n fileSize,\n duration,\n path,\n fraction,\n fractionLabel,\n};\n\n/* Calendar helpers (local dates, no time). */\nexport const fmtDate = (d: Date | null | undefined): string => (d ? `${d.getFullYear()}/${pad2(d.getMonth() + 1)}/${pad2(d.getDate())}` : '');\n\nexport function parseDate(s: string | null | undefined): Date | null {\n const m = /^(\\d{4})\\/(\\d{1,2})\\/(\\d{1,2})$/.exec(s || '');\n if (!m) return null;\n const d = new Date(+m[1], +m[2] - 1, +m[3]);\n return d.getMonth() === +m[2] - 1 ? d : null;\n}\n\nexport const sameDay = (a: Date | null | undefined, b: Date | null | undefined): boolean =>\n !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();\n\nexport const dayAdd = (d: Date, n: number): Date => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);\n"],"mappings":";;AAOA,MAAM,WAAW;CAAE,OAAO;CAAG,SAAS;CAAG,MAAM;CAAG,OAAO;AAAE;AAE3D,MAAM,QAAQ,MAAsB,OAAO,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG;AAE7D,SAAS,SAAiB;CACxB,OAAO,KAAK;AACd;;AAGA,SAAS,KAAK,G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,cAAc,GAAW,OAAe,MAAuB;CACtE,OAAO,GAAG,OAAO,gCAAgC,kBAAkB;EAAE,GAAG,OAAO,CAAC;EAAG,OAAO,OAAO,KAAK;EAAG,MAAM,QAAQ;CAAG,CAAC;AAC7H;;AAGA,MAAa,SAAS;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,MAAa,WAAW,MAAwC,IAAI,GAAG,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,SAAS,IAAI,CAAC,EAAE,GAAG,KAAK,EAAE,QAAQ,CAAC,MAAM;AAE1I,SAAgB,UAAU,GAA2C;CACnE,MAAM,IAAI,kCAAkC,KAAK,KAAK,EAAE;CACxD,IAAI,CAAC,GAAG,OAAO;CACf,MAAM,IAAI,IAAI,KAAK,CAAC,EAAE,IAAI,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE;CAC1C,OAAO,EAAE,SAAS,MAAM,CAAC,EAAE,KAAK,IAAI,IAAI;AAC1C;AAEA,MAAa,WAAW,GAA4B,MAClD,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,YAAY,MAAM,EAAE,YAAY,KAAK,EAAE,SAAS,MAAM,EAAE,SAAS,KAAK,EAAE,QAAQ,MAAM,EAAE,QAAQ;AAElH,MAAa,UAAU,GAAS,MAAoB,IAAI,KAAK,EAAE,YAAY,GAAG,EAAE,SAAS,GAAG,EAAE,QAAQ,IAAI,CAAC"}
1
+ {"version":3,"file":"format.js","names":[],"sources":["../src/format.ts"],"sourcesContent":["import { I18N, isZhTW, tr } from './i18n';\n\n/* Dates and numbers for the current locale (setLocale). zh-TW follows the design system's rules\n (2026/11/04(三), 24-hour clock, NT$ 1,280, 萬 and 億 in KPI cards); other locales use Intl's conventions. */\n\nexport type Decimals = number | 'money' | 'percent' | 'size' | 'count';\n\nconst DECIMALS = { money: 0, percent: 1, size: 1, count: 0 } as const;\n\nconst pad2 = (n: number): string => String(n).padStart(2, '0');\n\nfunction locale(): string {\n return I18N.locale;\n}\n\n/** zh-TW: 2026/11/04(三). Other locales: their short date with weekday. */\nfunction date(d: Date | null | undefined, o: { weekday?: boolean; long?: boolean } = {}): string {\n if (!d) return '';\n const wd = o.weekday !== false;\n if (o.long) return new Intl.DateTimeFormat(I18N.locale, { year: 'numeric', month: 'long', day: 'numeric', weekday: wd ? 'long' : undefined }).format(d);\n if (isZhTW()) return fmtDate(d) + (wd ? `(${new Intl.DateTimeFormat('zh-TW', { weekday: 'narrow' }).format(d)})` : '');\n return new Intl.DateTimeFormat(I18N.locale, { year: 'numeric', month: '2-digit', day: '2-digit', weekday: wd ? 'short' : undefined }).format(d);\n}\n\n/** zh-TW: 24-hour 15:57. Other locales: their own clock. */\nfunction time(d: Date | null | undefined): string {\n if (!d) return '';\n return new Intl.DateTimeFormat(\n I18N.locale,\n isZhTW() ? { hour: '2-digit', minute: '2-digit', hourCycle: 'h23' } : { hour: 'numeric', minute: '2-digit' },\n ).format(d);\n}\n\nfunction dateTime(d: Date | null | undefined, o?: { weekday?: boolean }): string {\n if (!d) return '';\n // zh-TW: the full-width 「)」 already leaves half a character of room, so no space after it: 2026/11/04(三)13:00.\n const day = date(d, o);\n return isZhTW() && day.endsWith(')') ? day + time(d) : `${day} ${time(d)}`;\n}\n\n/** Whole local calendar days from d to now: 1 for any time yesterday, whatever the hour. */\nfunction dayDiff(d: Date, now: Date): number {\n // Through UTC dates of the local day, so a 23-hour or 25-hour day (daylight saving) still counts as one.\n const day = (x: Date) => Date.UTC(x.getFullYear(), x.getMonth(), x.getDate());\n return Math.round((day(now) - day(d)) / 86400000);\n}\n\n/** Under 1 hour: 「現在」 or 「5 分鐘前」. The same calendar day: 「2 小時前」. An earlier day: by calendar days, 「昨天」\n * for any time yesterday (also 30 minutes before midnight seen after it, once an hour has passed), 「3 天前」 up to 6\n * days. 7 calendar days or more, or in the future: the full date and time. Pass now to test. */\nfunction relative(d: Date | null | undefined, now: Date = new Date()): string {\n if (!d) return '';\n const s = (now.getTime() - d.getTime()) / 1000;\n const days = dayDiff(d, now);\n if (s < 0 || days >= 7) return dateTime(d);\n const rt = new Intl.RelativeTimeFormat(I18N.locale, { numeric: 'auto' });\n if (s < 60) return rt.format(0, 'second');\n if (s < 3600) return rt.format(-Math.floor(s / 60), 'minute');\n if (days === 0) return rt.format(-Math.floor(s / 3600), 'hour');\n return rt.format(-days, 'day');\n}\n\nfunction month(d: Date): string {\n return new Intl.DateTimeFormat(I18N.locale, { year: 'numeric', month: 'long' }).format(d);\n}\n\n/** Week starts on Sunday for zh-TW; other locales use Intl's week info when the browser has it. */\nfunction firstDay(): number {\n if (isZhTW()) return 0;\n try {\n const l = new Intl.Locale(I18N.locale) as Intl.Locale & { getWeekInfo?: () => { firstDay: number }; weekInfo?: { firstDay: number } };\n const w = l.getWeekInfo ? l.getWeekInfo() : l.weekInfo;\n if (w?.firstDay) return w.firstDay % 7;\n } catch {\n /* older browsers have no week info */\n }\n return 0;\n}\n\n/** Narrow weekday names, starting from firstDay(). */\nfunction weekdays(): string[] {\n const fd = firstDay();\n const f = new Intl.DateTimeFormat(I18N.locale, { weekday: 'narrow' });\n // 2026/11/01 is a Sunday.\n return Array.from({ length: 7 }, (_, i) => f.format(new Date(2026, 10, 1 + ((fd + i) % 7))));\n}\n\n/** Decimals by unit: money 0, percent 1, size 1, count 0; pass a number to force it. */\nfunction number(v: number, dec?: Decimals): string {\n const dd = typeof dec === 'number' ? dec : dec ? DECIMALS[dec] : 0;\n return new Intl.NumberFormat(I18N.locale, { minimumFractionDigits: dd, maximumFractionDigits: dd }).format(v);\n}\n\nfunction percent(v: number, dec = 1): string {\n return new Intl.NumberFormat(I18N.locale, { style: 'percent', minimumFractionDigits: dec, maximumFractionDigits: dec }).format(v / 100);\n}\n\n/** Only KPI cards abbreviate: 1,284 萬 in zh-TW (萬、億), 12.8M in English.\n * like: format v with the unit and decimals that `like` gets, so a counting KPI keeps its width. */\nfunction compact(v: number, like?: number): string {\n const ref = like ?? v;\n if (Math.abs(ref) < 1e4) return number(v);\n if (/^zh/i.test(I18N.locale)) {\n const a = Math.abs(ref);\n // 99,999,999 rounds to 10,000.0 萬: write it as 1 億.\n const [unit, div, maxDec] = Math.round(a / 1e3) >= 1e5 ? (['億', 1e8, 2] as const) : (['萬', 1e4, 1] as const);\n const finalStr = new Intl.NumberFormat(I18N.locale, { maximumFractionDigits: maxDec }).format(a / div);\n const sign = v < 0 ? '-' : '';\n if (like === undefined) return `${sign}${finalStr} ${unit}`;\n const digits = (finalStr.split('.')[1] || '').length;\n return `${sign}${new Intl.NumberFormat(I18N.locale, { minimumFractionDigits: digits, maximumFractionDigits: digits }).format(Math.abs(v) / div)} ${unit}`;\n }\n const nf = new Intl.NumberFormat(I18N.locale, { notation: 'compact', maximumFractionDigits: 1 });\n if (like === undefined) return nf.format(v);\n const parts = nf.formatToParts(ref);\n let num = '';\n let dec = '';\n for (const pt of parts) {\n if (pt.type === 'integer') num += pt.value;\n if (pt.type === 'fraction') {\n num += '.' + pt.value;\n dec = pt.value;\n }\n }\n const mant = parseFloat(num) || 1;\n const scale = 10 ** Math.round(Math.log10(Math.abs(ref) / mant));\n const inner = new Intl.NumberFormat(I18N.locale, { minimumFractionDigits: dec.length, maximumFractionDigits: dec.length }).format(Math.abs(v) / scale);\n let done = false;\n const body = parts\n .map((pt) => {\n if (pt.type === 'integer' || pt.type === 'group' || pt.type === 'decimal' || pt.type === 'fraction') {\n if (done) return '';\n done = true;\n return inner;\n }\n return pt.value;\n })\n .join('');\n return (v < 0 && ref >= 0 ? '-' : '') + body;\n}\n\n/** zh-TW with TWD: NT$ 1,280, negatives -NT$ 1,280. Other locales and currencies: Intl's own symbol and order. */\nfunction money(v: number, o: { currency?: string; compact?: boolean; like?: number } = {}): string {\n const cur = o.currency || I18N.currency;\n const body = o.compact ? compact(Math.abs(v), o.like !== undefined ? Math.abs(o.like) : undefined) : number(Math.abs(v), 'money');\n if (isZhTW() && cur === 'TWD') return `${v < 0 ? '-' : ''}NT$ ${body}`;\n if (o.compact) return `${v < 0 ? '-' : ''}${body} ${cur}`;\n return new Intl.NumberFormat(I18N.locale, {\n style: 'currency',\n currency: cur,\n // narrowSymbol writes TWD as a bare 「$」, which reads as dollars: keep 「NT$」 (docs: 英文介面顯示 NT$486,000).\n currencyDisplay: cur === 'TWD' ? 'symbol' : 'narrowSymbol',\n minimumFractionDigits: 0,\n maximumFractionDigits: cur === 'TWD' || cur === 'JPY' ? 0 : 2,\n }).format(v);\n}\n\n/** Bytes to 「186 KB」「54.9 MB」「1.2 GB」. */\nexport function fileSize(b: number | null | undefined): string {\n if (b == null || Number.isNaN(b)) return '';\n // An empty file is 0 KB; anything else at least 1 KB.\n // Compare after rounding: 1,048,500 bytes rounds to 1,024 KB, so it is written 「1.0 MB」.\n if (Math.round(b / 1024) < 1024) return number(b === 0 ? 0 : Math.max(1, Math.round(b / 1024))) + ' KB';\n if (Math.round((b / 1048576) * 10) < 10240) return number(b / 1048576, 1) + ' MB';\n return number(b / 1073741824, 1) + ' GB';\n}\n\n/** Seconds as a clock-style length: under 1 h 「46:42」「1:30」 (minutes not zero-padded), 1 h or more 「1:54:49」.\n * Rounded to the second. Negative, NaN or missing: 「—」. */\nfunction duration(seconds: number | null | undefined): string {\n if (seconds == null || Number.isNaN(seconds) || seconds < 0 || !Number.isFinite(seconds)) return '—';\n const t = Math.round(seconds);\n const h = Math.floor(t / 3600);\n const m = Math.floor((t % 3600) / 60);\n const s = t % 60;\n return h ? `${h}:${pad2(m)}:${pad2(s)}` : `${m}:${pad2(s)}`;\n}\n\n/** Shortens a path: keeps the first segment and the last two, 「src/…/hooks/ops.c:58」. */\nfunction path(p: string | null | undefined, o: { head?: number; tail?: number } = {}): string {\n const head = o.head ?? 1;\n const tail = o.tail ?? 2;\n const parts = String(p ?? '').split('/');\n return parts.length > head + tail ? `${parts.slice(0, head).join('/')}/…/${parts.slice(-tail).join('/')}` : String(p ?? '');\n}\n\n/** A part of a whole, as shown: 「1 / 1 個」「6 / 6 筆」, or 「1 / 5」 without a unit. Give screen readers\n * `fractionLabel` with it: they read the slash as 「斜線」. */\nfunction fraction(n: number, total: number, unit?: string): string {\n return tr(unit ? '{n} / {total} {unit}' : '{n} / {total}', { n: number(n), total: number(total), unit: unit ?? '' });\n}\n\n/** The same fraction as read aloud: 「1 個中的 1 個」「6 筆中的 6 筆」, or 「5 中的 1」 without a unit (English:\n * 「1 of 1」). For `aria-label`, or for visually hidden text beside the shown fraction. */\nfunction fractionLabel(n: number, total: number, unit?: string): string {\n return tr(unit ? '{total} {unit}中的 {n} {unit}' : '{total} 中的 {n}', { n: number(n), total: number(total), unit: unit ?? '' });\n}\n\n/** Every date, number, amount, size and path shown in the UI goes through these. */\nexport const format = {\n locale,\n date,\n time,\n dateTime,\n relative,\n month,\n weekdays,\n firstDay,\n number,\n percent,\n compact,\n money,\n fileSize,\n duration,\n path,\n fraction,\n fractionLabel,\n};\n\n/* Calendar helpers (local dates, no time). */\nexport const fmtDate = (d: Date | null | undefined): string => (d ? `${d.getFullYear()}/${pad2(d.getMonth() + 1)}/${pad2(d.getDate())}` : '');\n\nexport function parseDate(s: string | null | undefined): Date | null {\n const m = /^(\\d{4})\\/(\\d{1,2})\\/(\\d{1,2})$/.exec(s || '');\n if (!m) return null;\n const d = new Date(+m[1], +m[2] - 1, +m[3]);\n return d.getMonth() === +m[2] - 1 ? d : null;\n}\n\nexport const sameDay = (a: Date | null | undefined, b: Date | null | undefined): boolean =>\n !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();\n\nexport const dayAdd = (d: Date, n: number): Date => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);\n"],"mappings":";;AAOA,MAAM,WAAW;CAAE,OAAO;CAAG,SAAS;CAAG,MAAM;CAAG,OAAO;AAAE;AAE3D,MAAM,QAAQ,MAAsB,OAAO,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG;AAE7D,SAAS,SAAiB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.json: their color scheme and accent. */
2
+ export declare const PRESETS: {
3
+ readonly teaching: {
4
+ readonly scheme: 'light';
5
+ readonly accent: '#027874';
6
+ };
7
+ };
8
+ export type ThemePreset = keyof typeof PRESETS;
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ // src/generated/themeDefaults.ts
3
+ /** The default accent (the light theme's accent token). */
4
+ const DEFAULT_ACCENT = "#2457d6";
5
+ /** Light and dark values of the grounds setAccent checks contrast on, used when tokens.css is not loaded. */
6
+ const GROUNDS = {
7
+ bg: {
8
+ light: "#fcfbfb",
9
+ dark: "#2f2a25"
10
+ },
11
+ surface: {
12
+ light: "#ffffff",
13
+ dark: "#393530"
14
+ },
15
+ "surface-sub": {
16
+ light: "#f6f5f4",
17
+ dark: "#443f3b"
18
+ },
19
+ "surface-chrome": {
20
+ light: "#ffffff",
21
+ dark: "#3d3834"
22
+ },
23
+ ink: {
24
+ light: "#171512",
25
+ dark: "#f6f5f4"
26
+ }
27
+ };
28
+ /** The presets of tokens.json: their color scheme and accent. */
29
+ const PRESETS = { teaching: {
30
+ scheme: "light",
31
+ accent: "#027874"
32
+ } };
33
+ export { DEFAULT_ACCENT, GROUNDS, PRESETS };
34
+
35
+ //# sourceMappingURL=themeDefaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeDefaults.js","names":[],"sources":["../../src/generated/themeDefaults.ts"],"sourcesContent":["/* Generated from packages/tokens/tokens.json by scripts/theme-defaults.ts. Do not edit by hand. */\n\n/** The default accent (the light theme's accent token). */\nexport const DEFAULT_ACCENT = '#2457d6';\n\n/** Light and dark values of the grounds setAccent checks contrast on, used when tokens.css is not loaded. */\nexport const GROUNDS = {\n bg: {\n light: '#fcfbfb',\n dark: '#2f2a25',\n },\n surface: {\n light: '#ffffff',\n dark: '#393530',\n },\n 'surface-sub': {\n light: '#f6f5f4',\n dark: '#443f3b',\n },\n 'surface-chrome': {\n light: '#ffffff',\n dark: '#3d3834',\n },\n ink: {\n light: '#171512',\n dark: '#f6f5f4',\n },\n} as const;\n\n/** The presets of tokens.json: their color scheme and accent. */\nexport const PRESETS = {\n teaching: {\n scheme: 'light',\n accent: '#027874',\n },\n} as const;\n\nexport type ThemePreset = keyof typeof PRESETS;\n"],"mappings":";;;AAGA,MAAa,iBAAiB;;AAG9B,MAAa,UAAU;CACrB,IAAI;EACF,OAAO;EACP,MAAM;CACR;CACA,SAAS;EACP,OAAO;EACP,MAAM;CACR;CACA,eAAe;EACb,OAAO;EACP,MAAM;CACR;CACA,kBAAkB;EAChB,OAAO;EACP,MAAM;CACR;CACA,KAAK;EACH,OAAO;EACP,MAAM;CACR;AACF;;AAGA,MAAa,UAAU,EACrB,UAAU;CACR,QAAQ;CACR,QAAQ;AACV,EACF"}
package/dist/i18n.d.ts CHANGED
@@ -1,9 +1,14 @@
1
- /** Translates a built-in zh-TW string into the current locale; {name} placeholders take vars. */
1
+ /** Translates a built-in zh-TW string into the current locale; {name} placeholders take vars. A key may start with a
2
+ * context and 「::」 ('快選::上個月'): only the text after it is shown in zh-TW. */
2
3
  export declare function tr(key: string, vars?: Record<string, string | number>): string;
3
4
  /** A count's unit: a function gets the count (for plurals, 「1 row」「2 rows」); a string goes through tr(), and for 1
4
5
  * the message 「1 <unit>」 is used when the locale has one (「1 筆」 → 「1 row」), without the number. */
5
6
  export type CountUnit = string | ((n: number) => string);
6
- /** Switches the interface language and, optionally, the currency used by format.money. */
7
+ /** Calls f after every change of locale or currency (setLocale) and of messages (addMessages); returns the unsubscribe.
8
+ * useLocale() is built on it. */
9
+ export declare function subscribeLocale(f: () => void): () => void;
10
+ /** Switches the interface language and, optionally, the currency used by format.money. Components that read the
11
+ * locale with useLocale() (and their children) render again. */
7
12
  export declare function setLocale(locale: string, opts?: {
8
13
  currency?: string;
9
14
  }): void;
package/dist/i18n.js CHANGED
@@ -4,7 +4,6 @@ const I18N = {
4
4
  currency: "TWD",
5
5
  messages: { en: {
6
6
  "Email 或帳號": "Email or username",
7
- "{label}:{a} 到 {b}": "{label}: {a} to {b}",
8
7
  "{n} 個百分點": "{n} pts",
9
8
  上一頁: "Previous page",
10
9
  上個月: "Previous month",
@@ -104,6 +103,21 @@ const I18N = {
104
103
  已還原原本的順序: "Back to the original order",
105
104
  "{name},第 {n} 排序,{dir}": "{name}, sort level {n}, {dir}",
106
105
  "「{name}」第 {n} 排序;按 Alt+↑ ↓ 調整順序": "{name}, sort level {n}. Alt+Up or Down moves it",
106
+ "「{name}」第 {n} 排序": "{name}, sort level {n}",
107
+ "拖曳,或按 Alt+↑ ↓ 調整順序": "Drag, or press Alt+Up or Alt+Down to reorder",
108
+ "上移「{name}」": "Move {name} up",
109
+ "下移「{name}」": "Move {name} down",
110
+ "拖曳或按 ← → 調整;按一下依序加寬,按 Enter 還原": "Drag or press Left and Right to resize; click to widen step by step, Enter to reset",
111
+ "「{name}」欄寬 {n} px": "{name} column width {n} px",
112
+ "已還原「{name}」欄寬": "{name} column width reset",
113
+ ",改善": ", better",
114
+ ",變差": ", worse",
115
+ 長條圖: "Bar chart",
116
+ 折線圖: "Line chart",
117
+ 時間點: "Time",
118
+ 數值: "Value",
119
+ "數值({unit})": "Value ({unit})",
120
+ "{name}({unit})": "{name} ({unit})",
107
121
  "「{name}」的方向": "Direction of {name}",
108
122
  "移除「{name}」排序": "Remove the sort by {name}",
109
123
  "照資料原本的順序。": "In the original order.",
@@ -152,7 +166,7 @@ const I18N = {
152
166
  表格: "Table",
153
167
  "{n} px": "{n} px",
154
168
  "主要區域 {a} px,面板 {b} px": "Main area {a} px, panel {b} px",
155
- "repo 外": "outside the repo",
169
+ 外部: "External",
156
170
  詳細: "Details",
157
171
  "展開 {name}": "Expand {name}",
158
172
  "收合 {name}": "Collapse {name}",
@@ -175,6 +189,10 @@ const I18N = {
175
189
  "第 {a}–{b} 筆,共 {n} 筆": "{a}–{b} of {n}",
176
190
  繼續編輯: "Keep editing",
177
191
  "自訂強調色(色碼)": "Custom accent color (hex)",
192
+ "已達 {n} 字上限": "Reached the {n}-character limit",
193
+ "另外 {n} 個:{list}": "{n} more: {list}",
194
+ 關閉通知: "Close notification",
195
+ "色碼格式不正確,請輸入 # 加 6 碼,例如 #2457d6": "Not a color code. Type # and 6 digits, e.g. #2457d6",
178
196
  "色碼格式不正確,例如 #2457d6": "Invalid hex, e.g. #2457d6",
179
197
  設定分類: "Settings sections",
180
198
  請輸入密碼: "Enter your password",
@@ -186,6 +204,8 @@ const I18N = {
186
204
  "輸入 # 加 6 碼": "Enter # and 6 digits",
187
205
  通知: "Notifications",
188
206
  "通知,{n} 則未讀": "Notifications, {n} unread",
207
+ 通知中心: "Notifications",
208
+ "通知中心,{n} 則未讀": "Notifications, {n} unread",
189
209
  "選取第 {n} 筆": "Select row {n}",
190
210
  選擇日期: "Choose date",
191
211
  選擇期間: "Choose period",
@@ -246,6 +266,10 @@ const I18N = {
246
266
  審核中: "In review",
247
267
  完成: "Done",
248
268
  失敗: "Failed",
269
+ 已關閉: "Closed",
270
+ 在線: "Online",
271
+ "(在新分頁開啟)": " (opens in a new tab)",
272
+ "{lang} 程式碼": "{lang} code",
249
273
  檢視: "Views",
250
274
  "{n} / {total} 筆": "{n} / {total}",
251
275
  "{n} / {total} {unit}": "{n} / {total} {unit}",
@@ -273,7 +297,8 @@ const I18N = {
273
297
  全部收合: "Collapse all",
274
298
  這裡還沒有檔案: "No files here yet",
275
299
  顯示全部: "Show all",
276
- 收合: "Show less",
300
+ 收合: "Collapse",
301
+ "清單::收合": "Show less",
277
302
  依狀態篩選: "Filter by status",
278
303
  展開: "Expand",
279
304
  沒有項目: "Nothing here",
@@ -289,8 +314,16 @@ const I18N = {
289
314
  共用項目: "Shared",
290
315
  次數越多線越粗: "Thicker lines mean more often",
291
316
  架構圖: "Architecture",
292
- "{n} 次": "{n} calls",
293
- "1 次": "1 call",
317
+ "{n} 次": "{n} uses",
318
+ "1 次": "1 use",
319
+ "使用 {n} 次": "Used {n} times",
320
+ 編號的線: "Numbered lines",
321
+ "複製成 Markdown": "Copy as Markdown",
322
+ "快選::上個月": "Last month",
323
+ 頁面: "Page",
324
+ 設定: "Setting",
325
+ 指令: "Command",
326
+ 檔案: "File",
294
327
  原始碼: "Source",
295
328
  "顯示全部 {n} 行": "Show all {n} lines",
296
329
  "只顯示第 {n} 行前後": "Show only around line {n}",
@@ -326,9 +359,13 @@ const I18N = {
326
359
  function msgsFor(loc) {
327
360
  return I18N.messages[loc] || I18N.messages[loc.split("-")[0]] || null;
328
361
  }
329
- /** Translates a built-in zh-TW string into the current locale; {name} placeholders take vars. */
362
+ /** Translates a built-in zh-TW string into the current locale; {name} placeholders take vars. A key may start with a
363
+ * context and 「::」 ('快選::上個月'): only the text after it is shown in zh-TW. */
330
364
  function tr(key, vars) {
331
- const out = (isZhTW() ? null : msgsFor(I18N.locale))?.[key] ?? key;
365
+ const m = isZhTW() ? null : msgsFor(I18N.locale);
366
+ const at = key.indexOf("::");
367
+ const text = at >= 0 ? key.slice(at + 2) : key;
368
+ const out = m?.[key] ?? (at >= 0 ? m?.[text] : void 0) ?? text;
332
369
  return vars ? out.replace(/\{(\w+)\}/g, (a, k) => vars[k] !== void 0 ? String(vars[k]) : a) : out;
333
370
  }
334
371
  function unitFor(unit, n) {
@@ -340,11 +377,28 @@ function unitFor(unit, n) {
340
377
  }
341
378
  return tr(unit);
342
379
  }
343
- /** Switches the interface language and, optionally, the currency used by format.money. */
380
+ const localeListeners = /* @__PURE__ */ new Set();
381
+ /** Calls f after every change of locale or currency (setLocale) and of messages (addMessages); returns the unsubscribe.
382
+ * useLocale() is built on it. */
383
+ function subscribeLocale(f) {
384
+ localeListeners.add(f);
385
+ return () => {
386
+ localeListeners.delete(f);
387
+ };
388
+ }
389
+ /** Switches the interface language and, optionally, the currency used by format.money. Components that read the
390
+ * locale with useLocale() (and their children) render again. */
344
391
  function setLocale(locale, opts) {
345
- I18N.locale = locale || "zh-TW";
392
+ const next = locale || "zh-TW";
393
+ const changed = next !== I18N.locale || !!opts?.currency && opts.currency !== I18N.currency;
394
+ I18N.locale = next;
346
395
  if (opts?.currency) I18N.currency = opts.currency;
347
396
  if (typeof document !== "undefined") document.documentElement.setAttribute("lang", I18N.locale);
397
+ if (changed) emitLocale();
398
+ }
399
+ /** Tells the subscribers that the locale changed (LocaleProvider, after it set the locale while rendering). */
400
+ function emitLocale() {
401
+ localeListeners.forEach((f) => f());
348
402
  }
349
403
  /** Adds or overrides translations for a locale. Keys are the zh-TW strings. */
350
404
  function addMessages(locale, dict) {
@@ -352,8 +406,9 @@ function addMessages(locale, dict) {
352
406
  ...I18N.messages[locale],
353
407
  ...dict
354
408
  };
409
+ emitLocale();
355
410
  }
356
411
  const isZhTW = () => /^zh-(TW|Hant)/i.test(I18N.locale);
357
- export { I18N, addMessages, isZhTW, setLocale, tr, unitFor };
412
+ export { I18N, addMessages, emitLocale, isZhTW, setLocale, subscribeLocale, tr, unitFor };
358
413
 
359
414
  //# sourceMappingURL=i18n.js.map
package/dist/i18n.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.js","names":[],"sources":["../src/i18n.ts"],"sourcesContent":["/* ---------- i18n and formats ----------\n Every built-in string is the zh-TW text passed through tr(); other languages come from UI.addMessages().\n Dates and numbers go through UI.format, which uses Intl for the current locale. The zh-TW rules are the\n ones the design system chose; other locales use their own conventions from Intl. */\ninterface I18nState {\n locale: string;\n currency: string;\n messages: Record<string, Record<string, string>>;\n}\n\nexport const I18N: I18nState = {\n locale: 'zh-TW',\n currency: 'TWD',\n messages: {\n en: {\n 'Email 或帳號': 'Email or username',\n '{label}:{a} 到 {b}': '{label}: {a} to {b}',\n '{n} 個百分點': '{n} pts',\n 上一頁: 'Previous page',\n 上個月: 'Previous month',\n '上傳失敗,請再試一次。': 'Upload failed. Try again.',\n 下一頁: 'Next page',\n 下個月: 'Next month',\n 主要導覽: 'Main navigation',\n 主題: 'Theme',\n 今天: 'Today',\n 全選: 'Select all',\n 全部: 'All',\n 全部標為已讀: 'Mark all as read',\n '共 {n} 筆': '{n} items',\n 分頁: 'Pagination',\n 刪除: 'Delete',\n 危險操作: 'Danger zone',\n 取消選取: 'Clear selection',\n '可以直接輸入,例如 2026/11/14': 'Type a date, e.g. 2026/11/14',\n 回上一頁: 'Go back',\n 回首頁: 'Go home',\n '完成 ✓': 'Done ✓',\n 密碼: 'Password',\n 展開側邊欄: 'Expand sidebar',\n '已選 {n} 筆': '{n} selected',\n 帳號: 'Username',\n 強調色: 'Accent color',\n 忘記密碼: 'Forgot password',\n 找不到符合的選項: 'No matching options',\n '拖放檔案,或 ': 'Drop files here, or ',\n 搜尋: 'Search',\n 操作: 'Actions',\n 收合側邊欄: 'Collapse sidebar',\n 釘選側邊欄: 'Pin sidebar',\n 取消釘選: 'Unpin sidebar',\n 放棄: 'Discard',\n '放棄未儲存的變更?': 'Discard unsaved changes?',\n '{label}?': '{label}?',\n '{name} 上傳進度': 'Upload progress of {name}',\n 左右方向鍵查看每一項的數值: 'Use ← and → to read each value',\n 左右方向鍵查看每一個時間點的數值: 'Use ← and → to read each point',\n 左右方向鍵移動播放頭: 'Use ← and → to move the playhead',\n 現在: 'Now',\n 預測: 'Forecast',\n 回到現在: 'Back to now',\n 回放: 'Replay',\n 停止回放: 'Stop replay',\n 全螢幕: 'Full screen',\n 離開全螢幕: 'Exit full screen',\n 側欄: 'Side panel',\n 更多表格操作: 'More table actions',\n 還原預設: 'Restore defaults',\n 已還原預設的欄位與欄寬: 'Columns and widths restored to defaults',\n 套用的篩選: 'Applied filters',\n '移除篩選:{name}': 'Remove filter: {name}',\n '篩選,已套用 {n} 個條件': 'Filter, {n} conditions applied',\n '{name}:{value}': '{name}: {value}',\n 時間控制: 'Time control',\n 沒有事件: 'No events',\n 人工: 'Manual',\n 切換: 'Switch',\n 告警: 'Alert',\n '{v}({t})': '{v} ({t})',\n 這段時間沒有資料: 'No data for this period',\n 沒有資料: 'No data',\n 差: 'Difference',\n 正常: 'Normal',\n '⚠ 注意': '⚠ Watch',\n '⚠ 超過上限': '⚠ Over limit',\n '注意 {v}': 'Watch {v}',\n '上限 {v}': 'Limit {v}',\n '新增「{q}」': 'Add “{q}”',\n '日期格式不正確,請寫成 2026/11/14': 'Invalid date. Use 2026/11/14.',\n 更多操作: 'More actions',\n 更多: 'More',\n 左右滑動: 'Scroll sideways',\n 跳到主要內容: 'Skip to main content',\n 說明: 'Explain',\n 開啟導覽: 'Open navigation',\n 顯示方式: 'View',\n 顯示線上文字: 'Show line labels',\n 線上文字: 'Line labels',\n 圖: 'Diagram',\n 清單: 'List',\n 項目: 'Items',\n 關係: 'Relations',\n 已展開: 'Expanded',\n 已收合: 'Collapsed',\n '已展開,{n} 個子項目': 'Expanded, {n} items',\n '顯示 {n} 筆': 'Showing {n} rows',\n 排序: 'Sort',\n '排序:{list}': 'Sort: {list}',\n 由小到大: 'ascending',\n 由大到小: 'descending',\n '依 {list} 排序': 'Sorted by {list}',\n ',再依 ': ', then by ',\n '、': ', ',\n 已還原原本的順序: 'Back to the original order',\n '{name},第 {n} 排序,{dir}': '{name}, sort level {n}, {dir}',\n '「{name}」第 {n} 排序;按 Alt+↑ ↓ 調整順序': '{name}, sort level {n}. Alt+Up or Down moves it',\n '「{name}」的方向': 'Direction of {name}',\n '移除「{name}」排序': 'Remove the sort by {name}',\n '照資料原本的順序。': 'In the original order.',\n '再依…': 'Then by…',\n '排序依據…': 'Sort by…',\n 再依哪一欄: 'Then by which column',\n 依哪一欄排序: 'Sort by which column',\n '最多 {n} 層排序。': 'Up to {n} sort levels.',\n '找到 {n} 筆結果': '{n} results',\n '第 {a} 步,共 {b} 步': 'Step {a} of {b}',\n '說明 {name}': 'Explain {name}',\n 程式碼: 'Code',\n '第 {n} 行': 'Line {n}',\n '第 {n} 層': 'Level {n}',\n 第一行: 'First line',\n 最後一行: 'Last line',\n '上 20 行': '20 lines up',\n '下 20 行': '20 lines down',\n 上一段: 'Previous section',\n 下一段: 'Next section',\n '上一行/下一行': 'Previous / next line',\n '上一個/下一個連結': 'Previous / next link',\n '上一個/下一個名詞': 'Previous / next term',\n '上一個/下一個連結或名詞': 'Previous / next link or term',\n 回到這一行: 'Back to the line',\n 開啟: 'Open',\n '{name},第 {n} 行': '{name}, line {n}',\n '顯示 {n} 筆,另有 {m} 筆,請輸入更長的字': 'Showing {n}, {m} more: type more to narrow it down',\n '縮排 {n} 格': 'indented {n} spaces',\n '縮排 {n} 個 tab': 'indented {n} tabs',\n '縮排 {a} 個 tab、{b} 格': 'indented {a} tabs and {b} spaces',\n 向右捲動: 'Scroll right',\n 筆: 'rows',\n '1 筆': '1 row',\n // Separators: full-width in Chinese, ASCII and a space in English.\n ',': ', ',\n ':': ': ',\n '。': '. ',\n '來自 {from},{label}': 'From {from}, {label}',\n '{from} 到 {to},{what}': '{from} to {to}, {what}',\n 到: 'to',\n '{label}({inferred})': '{label} ({inferred})',\n 調整面板寬度: 'Resize the panel',\n 調整架構圖高度: 'Resize the diagram height',\n '調整「{name}」欄寬': 'Resize the column {name}',\n 放大表格: 'Enlarge the table',\n 表格: 'Table',\n '{n} px': '{n} px',\n '主要區域 {a} px,面板 {b} px': 'Main area {a} px, panel {b} px',\n 'repo 外': 'outside the repo',\n 詳細: 'Details',\n '展開 {name}': 'Expand {name}',\n '收合 {name}': 'Collapse {name}',\n 字: 'characters',\n 'C 語言': 'C',\n 程式語言: 'Language',\n 全部頁面: 'All pages',\n '最近 30 天': 'Last 30 days',\n '最近 7 天': 'Last 7 days',\n 期間: 'Period',\n 未讀: 'Unread',\n 本月: 'This month',\n 沒有符合的資料: 'No matching data',\n 沒有通知: 'No notifications',\n 清除: 'Clear',\n 清除搜尋: 'Clear search',\n 登入: 'Sign in',\n 發生錯誤: 'Something went wrong',\n '移除 {name}': 'Remove {name}',\n '第 {a}–{b} 筆,共 {n} 筆': '{a}–{b} of {n}',\n 繼續編輯: 'Keep editing',\n '自訂強調色(色碼)': 'Custom accent color (hex)',\n '色碼格式不正確,例如 #2457d6': 'Invalid hex, e.g. #2457d6',\n 設定分類: 'Settings sections',\n 請輸入密碼: 'Enter your password',\n 請輸入帳號: 'Enter your username',\n 請選擇: 'Select',\n 路徑: 'Breadcrumb',\n 較上週: 'vs last week',\n 載入中: 'Loading',\n '輸入 # 加 6 碼': 'Enter # and 6 digits',\n 通知: 'Notifications',\n '通知,{n} 則未讀': 'Notifications, {n} unread',\n '選取第 {n} 筆': 'Select row {n}',\n 選擇日期: 'Choose date',\n 選擇期間: 'Choose period',\n 選擇檔案: 'choose files',\n 重試: 'Retry',\n 開啟日曆: 'Open calendar',\n 關閉: 'Close',\n '關閉後,剛才的修改不會保留。': 'If you close now, your changes will be lost.',\n 關閉提示: 'Dismiss',\n 鍵盤操作: 'Keyboard',\n 顯示或關閉這份說明: 'Show or hide this list',\n 檔案總管: 'Explorer',\n 右側欄: 'Side bar',\n 下方面板: 'Panel',\n 有新內容: 'New content',\n '更多分頁({n} 個)': 'More tabs ({n})',\n '更多 {n}': '{n} more',\n 位置不變: 'Same place',\n 放開以排在這裡: 'Drop to place it here',\n '放開以移到{region}': 'Drop to move to the {region}',\n '把目前分頁移到{region}': 'Move this tab to the {region}',\n '收合{region}': 'Hide the {region}',\n '關閉{region}': 'Close the {region}',\n '{region}寬度': '{region} width',\n '{region}高度': '{region} height',\n 面板高度: 'Panel height',\n 面板分頁: 'Panel tabs',\n 目前分頁往左移: 'Move this tab left',\n 目前分頁往右移: 'Move this tab right',\n 收起面板: 'Hide the panel',\n 編輯器: 'Editor',\n 開始: 'Start',\n 'AI 說明': 'AI note',\n 'AI 撰寫': 'AI-written',\n '({v})': ' ({v})',\n 隱藏密碼: 'Hide password',\n 顯示密碼: 'Show password',\n '(今天)': ' (today)',\n 伺服器暫時無法回應: 'The server is not responding',\n 找不到這個頁面: 'Page not found',\n 沒有權限查看這個頁面: 'You do not have access to this page',\n '網址可能打錯了,或這個頁面已經移除。': 'The address may be wrong, or the page has been removed.',\n '這個問題已經記錄下來,請稍後重新整理再試。': 'The problem has been logged. Refresh the page later.',\n '請向管理員申請權限,或切換成有權限的帳號。': 'Ask an admin for access, or switch to an account that has it.',\n 自動: 'Auto',\n 淺色: 'Light',\n 深色: 'Dark',\n 藍: 'Blue',\n 靛: 'Indigo',\n 紫: 'Purple',\n 桃紅: 'Pink',\n 紅: 'Red',\n 橘: 'Orange',\n 綠: 'Green',\n 青: 'Teal',\n 草稿: 'Draft',\n 進行中: 'In progress',\n 審核中: 'In review',\n 完成: 'Done',\n 失敗: 'Failed',\n 檢視: 'Views',\n '{n} / {total} 筆': '{n} / {total}',\n '{n} / {total} {unit}': '{n} / {total} {unit}',\n '{n} / {total}': '{n} / {total}',\n '{total} {unit}中的 {n} {unit}': '{n} of {total} {unit}',\n '{total} 中的 {n}': '{n} of {total}',\n 欄位: 'Columns',\n 顯示的欄位: 'Visible columns',\n 清除篩選: 'Clear filters',\n 清除全部: 'Clear all',\n 篩選: 'Filter',\n 最低: 'Min',\n 最高: 'Max',\n '合計 {n} 筆': 'Total: {n}',\n 平均: 'Avg',\n '選取 {name}': 'Select {name}',\n '{n} 個新': '{n} new',\n '{n} 個檔案': '{n} files',\n '下載 {name}': 'Download {name}',\n '已選 {n} 個檔案': '{n} files selected',\n '共 {size}': '{size} total',\n 清除選取: 'Clear selection',\n 下載: 'Download',\n 全部展開: 'Expand all',\n 全部收合: 'Collapse all',\n 這裡還沒有檔案: 'No files here yet',\n 顯示全部: 'Show all',\n 收合: 'Show less',\n 依狀態篩選: 'Filter by status',\n 展開: 'Expand',\n 沒有項目: 'Nothing here',\n 即時: 'Live',\n 已過期: 'Stale',\n 離線: 'Offline',\n 切換專案: 'Switch project',\n '切換專案,目前是 {name}': 'Switch project, now {name}',\n 推測: 'Inferred',\n '{n} 個項目': '{n} items',\n '1 個項目': '1 item',\n '{a} 個項目使用,共 {b} 次': 'Used {b} times by {a} items',\n 共用項目: 'Shared',\n 次數越多線越粗: 'Thicker lines mean more often',\n 架構圖: 'Architecture',\n '{n} 次': '{n} calls',\n '1 次': '1 call',\n 原始碼: 'Source',\n '顯示全部 {n} 行': 'Show all {n} lines',\n '只顯示第 {n} 行前後': 'Show only around line {n}',\n '無法載入 {name} 的子項目': 'Could not load the children of {name}',\n '找不到符合「{q}」的結果': 'No results for “{q}”',\n 輸入名稱開始搜尋: 'Type a name to search',\n 搜尋中: 'Searching',\n 搜尋結果: 'Search results',\n 最近開啟: 'Recently opened',\n 選擇: 'Select',\n 打開: 'Open',\n 取消: 'Cancel',\n 略過: 'Skip',\n 上一步: 'Back',\n 下一步: 'Next',\n 建議修正: 'Suggested fix',\n 複製修正: 'Copy fix',\n 已複製: 'Copied',\n 複製程式碼: 'Copy code',\n '原本:': 'Before: ',\n '改成:': 'After: ',\n 關閉說明: 'Close explanation',\n ',有說明': ', has an explanation',\n '(說明)': ' (explain)',\n '搜尋({k})': 'Search ({k})',\n 確定的關係: 'Confirmed',\n 推測的關係: 'Inferred',\n 專案宣告的關係: 'Declared by the project',\n 宣告: 'Declared',\n 外部項目: 'External',\n },\n },\n};\n\nfunction msgsFor(loc: string): Record<string, string> | null {\n return I18N.messages[loc] || I18N.messages[loc.split('-')[0]] || null;\n}\n\n/** Translates a built-in zh-TW string into the current locale; {name} placeholders take vars. */\nexport function tr(key: string, vars?: Record<string, string | number>): string {\n // zh-TW (and zh-Hant) is the source text; other Chinese locales (zh-CN) use the messages an app adds for them.\n const m = isZhTW() ? null : msgsFor(I18N.locale);\n const out = m?.[key] ?? key;\n return vars ? out.replace(/\\{(\\w+)\\}/g, (a, k: string) => (vars[k] !== undefined ? String(vars[k]) : a)) : out;\n}\n\n/** A count's unit: a function gets the count (for plurals, 「1 row」「2 rows」); a string goes through tr(), and for 1\n * the message 「1 <unit>」 is used when the locale has one (「1 筆」 → 「1 row」), without the number. */\nexport type CountUnit = string | ((n: number) => string);\nexport function unitFor(unit: CountUnit | undefined, n: number): string {\n if (!unit) return '';\n if (typeof unit === 'function') return unit(n);\n if (n === 1) {\n const one = tr('1 ' + unit);\n if (one !== '1 ' + unit) return one.replace(/^1\\s*/, '');\n }\n return tr(unit);\n}\n\n/** Switches the interface language and, optionally, the currency used by format.money. */\nexport function setLocale(locale: string, opts?: { currency?: string }): void {\n I18N.locale = locale || 'zh-TW';\n if (opts?.currency) I18N.currency = opts.currency;\n if (typeof document !== 'undefined') document.documentElement.setAttribute('lang', I18N.locale);\n}\n\n/** Adds or overrides translations for a locale. Keys are the zh-TW strings. */\nexport function addMessages(locale: string, dict: Record<string, string>): void {\n I18N.messages[locale] = { ...I18N.messages[locale], ...dict };\n}\n\nexport const isZhTW = (): boolean => /^zh-(TW|Hant)/i.test(I18N.locale);\n"],"mappings":";AAUA,MAAa,OAAkB;CAC7B,QAAQ;CACR,UAAU;CACV,UAAU,EACR,IAAI;EACF,aAAa;EACb,qBAAqB;EACrB,YAAY;EACZ,KAAK;EACL,KAAK;EACL,eAAe;EACf,KAAK;EACL,KAAK;EACL,MAAM;EACN,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,QAAQ;EACR,WAAW;EACX,IAAI;EACJ,IAAI;EACJ,MAAM;EACN,MAAM;EACN,wBAAwB;EACxB,MAAM;EACN,KAAK;EACL,QAAQ;EACR,IAAI;EACJ,OAAO;EACP,YAAY;EACZ,IAAI;EACJ,KAAK;EACL,MAAM;EACN,UAAU;EACV,WAAW;EACX,IAAI;EACJ,IAAI;EACJ,OAAO;EACP,OAAO;EACP,MAAM;EACN,IAAI;EACJ,aAAa;EACb,YAAY;EACZ,eAAe;EACf,eAAe;EACf,kBAAkB;EAClB,YAAY;EACZ,IAAI;EACJ,IAAI;EACJ,MAAM;EACN,IAAI;EACJ,MAAM;EACN,KAAK;EACL,OAAO;EACP,IAAI;EACJ,QAAQ;EACR,MAAM;EACN,aAAa;EACb,OAAO;EACP,eAAe;EACf,kBAAkB;EAClB,kBAAkB;EAClB,MAAM;EACN,MAAM;EACN,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,YAAY;EACZ,UAAU;EACV,MAAM;EACN,GAAG;EACH,IAAI;EACJ,QAAQ;EACR,UAAU;EACV,UAAU;EACV,UAAU;EACV,W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9E,KAAK,SAAS,UAAU;EAAE,GAAG,KAAK,SAAS;EAAS,GAAG;CAAK;AAC9D;AAEA,MAAa,eAAwB,iBAAiB,KAAK,KAAK,MAAM"}
1
+ {"version":3,"file":"i18n.js","names":[],"sources":["../src/i18n.ts"],"sourcesContent":["/* ---------- i18n and formats ----------\n Every built-in string is the zh-TW text passed through tr(); other languages come from UI.addMessages().\n Dates and numbers go through UI.format, which uses Intl for the current locale. The zh-TW rules are the\n ones the design system chose; other locales use their own conventions from Intl. */\ninterface I18nState {\n locale: string;\n currency: string;\n messages: Record<string, Record<string, string>>;\n}\n\nexport const I18N: I18nState = {\n locale: 'zh-TW',\n currency: 'TWD',\n messages: {\n en: {\n 'Email 或帳號': 'Email or username',\n '{n} 個百分點': '{n} pts',\n 上一頁: 'Previous page',\n 上個月: 'Previous month',\n '上傳失敗,請再試一次。': 'Upload failed. Try again.',\n 下一頁: 'Next page',\n 下個月: 'Next month',\n 主要導覽: 'Main navigation',\n 主題: 'Theme',\n 今天: 'Today',\n 全選: 'Select all',\n 全部: 'All',\n 全部標為已讀: 'Mark all as read',\n '共 {n} 筆': '{n} items',\n 分頁: 'Pagination',\n 刪除: 'Delete',\n 危險操作: 'Danger zone',\n 取消選取: 'Clear selection',\n '可以直接輸入,例如 2026/11/14': 'Type a date, e.g. 2026/11/14',\n 回上一頁: 'Go back',\n 回首頁: 'Go home',\n '完成 ✓': 'Done ✓',\n 密碼: 'Password',\n 展開側邊欄: 'Expand sidebar',\n '已選 {n} 筆': '{n} selected',\n 帳號: 'Username',\n 強調色: 'Accent color',\n 忘記密碼: 'Forgot password',\n 找不到符合的選項: 'No matching options',\n '拖放檔案,或 ': 'Drop files here, or ',\n 搜尋: 'Search',\n 操作: 'Actions',\n 收合側邊欄: 'Collapse sidebar',\n 釘選側邊欄: 'Pin sidebar',\n 取消釘選: 'Unpin sidebar',\n 放棄: 'Discard',\n '放棄未儲存的變更?': 'Discard unsaved changes?',\n '{label}?': '{label}?',\n '{name} 上傳進度': 'Upload progress of {name}',\n 左右方向鍵查看每一項的數值: 'Use ← and → to read each value',\n 左右方向鍵查看每一個時間點的數值: 'Use ← and → to read each point',\n 左右方向鍵移動播放頭: 'Use ← and → to move the playhead',\n 現在: 'Now',\n 預測: 'Forecast',\n 回到現在: 'Back to now',\n 回放: 'Replay',\n 停止回放: 'Stop replay',\n 全螢幕: 'Full screen',\n 離開全螢幕: 'Exit full screen',\n 側欄: 'Side panel',\n 更多表格操作: 'More table actions',\n 還原預設: 'Restore defaults',\n 已還原預設的欄位與欄寬: 'Columns and widths restored to defaults',\n 套用的篩選: 'Applied filters',\n '移除篩選:{name}': 'Remove filter: {name}',\n '篩選,已套用 {n} 個條件': 'Filter, {n} conditions applied',\n '{name}:{value}': '{name}: {value}',\n 時間控制: 'Time control',\n 沒有事件: 'No events',\n 人工: 'Manual',\n 切換: 'Switch',\n 告警: 'Alert',\n '{v}({t})': '{v} ({t})',\n 這段時間沒有資料: 'No data for this period',\n 沒有資料: 'No data',\n 差: 'Difference',\n 正常: 'Normal',\n '⚠ 注意': '⚠ Watch',\n '⚠ 超過上限': '⚠ Over limit',\n '注意 {v}': 'Watch {v}',\n '上限 {v}': 'Limit {v}',\n '新增「{q}」': 'Add “{q}”',\n '日期格式不正確,請寫成 2026/11/14': 'Invalid date. Use 2026/11/14.',\n 更多操作: 'More actions',\n 更多: 'More',\n 左右滑動: 'Scroll sideways',\n 跳到主要內容: 'Skip to main content',\n 說明: 'Explain',\n 開啟導覽: 'Open navigation',\n 顯示方式: 'View',\n 顯示線上文字: 'Show line labels',\n 線上文字: 'Line labels',\n 圖: 'Diagram',\n 清單: 'List',\n 項目: 'Items',\n 關係: 'Relations',\n 已展開: 'Expanded',\n 已收合: 'Collapsed',\n '已展開,{n} 個子項目': 'Expanded, {n} items',\n '顯示 {n} 筆': 'Showing {n} rows',\n 排序: 'Sort',\n '排序:{list}': 'Sort: {list}',\n 由小到大: 'ascending',\n 由大到小: 'descending',\n '依 {list} 排序': 'Sorted by {list}',\n ',再依 ': ', then by ',\n '、': ', ',\n 已還原原本的順序: 'Back to the original order',\n '{name},第 {n} 排序,{dir}': '{name}, sort level {n}, {dir}',\n '「{name}」第 {n} 排序;按 Alt+↑ ↓ 調整順序': '{name}, sort level {n}. Alt+Up or Down moves it',\n '「{name}」第 {n} 排序': '{name}, sort level {n}',\n '拖曳,或按 Alt+↑ ↓ 調整順序': 'Drag, or press Alt+Up or Alt+Down to reorder',\n '上移「{name}」': 'Move {name} up',\n '下移「{name}」': 'Move {name} down',\n '拖曳或按 ← → 調整;按一下依序加寬,按 Enter 還原': 'Drag or press Left and Right to resize; click to widen step by step, Enter to reset',\n '「{name}」欄寬 {n} px': '{name} column width {n} px',\n '已還原「{name}」欄寬': '{name} column width reset',\n ',改善': ', better',\n ',變差': ', worse',\n 長條圖: 'Bar chart',\n 折線圖: 'Line chart',\n 時間點: 'Time',\n 數值: 'Value',\n '數值({unit})': 'Value ({unit})',\n '{name}({unit})': '{name} ({unit})',\n '「{name}」的方向': 'Direction of {name}',\n '移除「{name}」排序': 'Remove the sort by {name}',\n '照資料原本的順序。': 'In the original order.',\n '再依…': 'Then by…',\n '排序依據…': 'Sort by…',\n 再依哪一欄: 'Then by which column',\n 依哪一欄排序: 'Sort by which column',\n '最多 {n} 層排序。': 'Up to {n} sort levels.',\n '找到 {n} 筆結果': '{n} results',\n '第 {a} 步,共 {b} 步': 'Step {a} of {b}',\n '說明 {name}': 'Explain {name}',\n 程式碼: 'Code',\n '第 {n} 行': 'Line {n}',\n '第 {n} 層': 'Level {n}',\n 第一行: 'First line',\n 最後一行: 'Last line',\n '上 20 行': '20 lines up',\n '下 20 行': '20 lines down',\n 上一段: 'Previous section',\n 下一段: 'Next section',\n '上一行/下一行': 'Previous / next line',\n '上一個/下一個連結': 'Previous / next link',\n '上一個/下一個名詞': 'Previous / next term',\n '上一個/下一個連結或名詞': 'Previous / next link or term',\n 回到這一行: 'Back to the line',\n 開啟: 'Open',\n '{name},第 {n} 行': '{name}, line {n}',\n '顯示 {n} 筆,另有 {m} 筆,請輸入更長的字': 'Showing {n}, {m} more: type more to narrow it down',\n '縮排 {n} 格': 'indented {n} spaces',\n '縮排 {n} 個 tab': 'indented {n} tabs',\n '縮排 {a} 個 tab、{b} 格': 'indented {a} tabs and {b} spaces',\n 向右捲動: 'Scroll right',\n 筆: 'rows',\n '1 筆': '1 row',\n // Separators: full-width in Chinese, ASCII and a space in English.\n ',': ', ',\n ':': ': ',\n '。': '. ',\n '來自 {from},{label}': 'From {from}, {label}',\n '{from} 到 {to},{what}': '{from} to {to}, {what}',\n 到: 'to',\n '{label}({inferred})': '{label} ({inferred})',\n 調整面板寬度: 'Resize the panel',\n 調整架構圖高度: 'Resize the diagram height',\n '調整「{name}」欄寬': 'Resize the column {name}',\n 放大表格: 'Enlarge the table',\n 表格: 'Table',\n '{n} px': '{n} px',\n '主要區域 {a} px,面板 {b} px': 'Main area {a} px, panel {b} px',\n 外部: 'External',\n 詳細: 'Details',\n '展開 {name}': 'Expand {name}',\n '收合 {name}': 'Collapse {name}',\n 字: 'characters',\n 'C 語言': 'C',\n 程式語言: 'Language',\n 全部頁面: 'All pages',\n '最近 30 天': 'Last 30 days',\n '最近 7 天': 'Last 7 days',\n 期間: 'Period',\n 未讀: 'Unread',\n 本月: 'This month',\n 沒有符合的資料: 'No matching data',\n 沒有通知: 'No notifications',\n 清除: 'Clear',\n 清除搜尋: 'Clear search',\n 登入: 'Sign in',\n 發生錯誤: 'Something went wrong',\n '移除 {name}': 'Remove {name}',\n '第 {a}–{b} 筆,共 {n} 筆': '{a}–{b} of {n}',\n 繼續編輯: 'Keep editing',\n '自訂強調色(色碼)': 'Custom accent color (hex)',\n '已達 {n} 字上限': 'Reached the {n}-character limit',\n '另外 {n} 個:{list}': '{n} more: {list}',\n 關閉通知: 'Close notification',\n '色碼格式不正確,請輸入 # 加 6 碼,例如 #2457d6': 'Not a color code. Type # and 6 digits, e.g. #2457d6',\n '色碼格式不正確,例如 #2457d6': 'Invalid hex, e.g. #2457d6',\n 設定分類: 'Settings sections',\n 請輸入密碼: 'Enter your password',\n 請輸入帳號: 'Enter your username',\n 請選擇: 'Select',\n 路徑: 'Breadcrumb',\n 較上週: 'vs last week',\n 載入中: 'Loading',\n '輸入 # 加 6 碼': 'Enter # and 6 digits',\n 通知: 'Notifications',\n '通知,{n} 則未讀': 'Notifications, {n} unread',\n 通知中心: 'Notifications',\n '通知中心,{n} 則未讀': 'Notifications, {n} unread',\n '選取第 {n} 筆': 'Select row {n}',\n 選擇日期: 'Choose date',\n 選擇期間: 'Choose period',\n 選擇檔案: 'choose files',\n 重試: 'Retry',\n 開啟日曆: 'Open calendar',\n 關閉: 'Close',\n '關閉後,剛才的修改不會保留。': 'If you close now, your changes will be lost.',\n 關閉提示: 'Dismiss',\n 鍵盤操作: 'Keyboard',\n 顯示或關閉這份說明: 'Show or hide this list',\n 檔案總管: 'Explorer',\n 右側欄: 'Side bar',\n 下方面板: 'Panel',\n 有新內容: 'New content',\n '更多分頁({n} 個)': 'More tabs ({n})',\n '更多 {n}': '{n} more',\n 位置不變: 'Same place',\n 放開以排在這裡: 'Drop to place it here',\n '放開以移到{region}': 'Drop to move to the {region}',\n '把目前分頁移到{region}': 'Move this tab to the {region}',\n '收合{region}': 'Hide the {region}',\n '關閉{region}': 'Close the {region}',\n '{region}寬度': '{region} width',\n '{region}高度': '{region} height',\n 面板高度: 'Panel height',\n 面板分頁: 'Panel tabs',\n 目前分頁往左移: 'Move this tab left',\n 目前分頁往右移: 'Move this tab right',\n 收起面板: 'Hide the panel',\n 編輯器: 'Editor',\n 開始: 'Start',\n 'AI 說明': 'AI note',\n 'AI 撰寫': 'AI-written',\n '({v})': ' ({v})',\n 隱藏密碼: 'Hide password',\n 顯示密碼: 'Show password',\n '(今天)': ' (today)',\n 伺服器暫時無法回應: 'The server is not responding',\n 找不到這個頁面: 'Page not found',\n 沒有權限查看這個頁面: 'You do not have access to this page',\n '網址可能打錯了,或這個頁面已經移除。': 'The address may be wrong, or the page has been removed.',\n '這個問題已經記錄下來,請稍後重新整理再試。': 'The problem has been logged. Refresh the page later.',\n '請向管理員申請權限,或切換成有權限的帳號。': 'Ask an admin for access, or switch to an account that has it.',\n 自動: 'Auto',\n 淺色: 'Light',\n 深色: 'Dark',\n 藍: 'Blue',\n 靛: 'Indigo',\n 紫: 'Purple',\n 桃紅: 'Pink',\n 紅: 'Red',\n 橘: 'Orange',\n 綠: 'Green',\n 青: 'Teal',\n 草稿: 'Draft',\n 進行中: 'In progress',\n 審核中: 'In review',\n 完成: 'Done',\n 失敗: 'Failed',\n 已關閉: 'Closed',\n 在線: 'Online',\n '(在新分頁開啟)': ' (opens in a new tab)',\n '{lang} 程式碼': '{lang} code',\n 檢視: 'Views',\n '{n} / {total} 筆': '{n} / {total}',\n '{n} / {total} {unit}': '{n} / {total} {unit}',\n '{n} / {total}': '{n} / {total}',\n '{total} {unit}中的 {n} {unit}': '{n} of {total} {unit}',\n '{total} 中的 {n}': '{n} of {total}',\n 欄位: 'Columns',\n 顯示的欄位: 'Visible columns',\n 清除篩選: 'Clear filters',\n 清除全部: 'Clear all',\n 篩選: 'Filter',\n 最低: 'Min',\n 最高: 'Max',\n '合計 {n} 筆': 'Total: {n}',\n 平均: 'Avg',\n '選取 {name}': 'Select {name}',\n '{n} 個新': '{n} new',\n '{n} 個檔案': '{n} files',\n '下載 {name}': 'Download {name}',\n '已選 {n} 個檔案': '{n} files selected',\n '共 {size}': '{size} total',\n 清除選取: 'Clear selection',\n 下載: 'Download',\n 全部展開: 'Expand all',\n 全部收合: 'Collapse all',\n 這裡還沒有檔案: 'No files here yet',\n 顯示全部: 'Show all',\n 收合: 'Collapse',\n '清單::收合': 'Show less',\n 依狀態篩選: 'Filter by status',\n 展開: 'Expand',\n 沒有項目: 'Nothing here',\n 即時: 'Live',\n 已過期: 'Stale',\n 離線: 'Offline',\n 切換專案: 'Switch project',\n '切換專案,目前是 {name}': 'Switch project, now {name}',\n 推測: 'Inferred',\n '{n} 個項目': '{n} items',\n '1 個項目': '1 item',\n '{a} 個項目使用,共 {b} 次': 'Used {b} times by {a} items',\n 共用項目: 'Shared',\n 次數越多線越粗: 'Thicker lines mean more often',\n 架構圖: 'Architecture',\n '{n} 次': '{n} uses',\n '1 次': '1 use',\n '使用 {n} 次': 'Used {n} times',\n 編號的線: 'Numbered lines',\n '複製成 Markdown': 'Copy as Markdown',\n '快選::上個月': 'Last month',\n 頁面: 'Page',\n 設定: 'Setting',\n 指令: 'Command',\n 檔案: 'File',\n 原始碼: 'Source',\n '顯示全部 {n} 行': 'Show all {n} lines',\n '只顯示第 {n} 行前後': 'Show only around line {n}',\n '無法載入 {name} 的子項目': 'Could not load the children of {name}',\n '找不到符合「{q}」的結果': 'No results for “{q}”',\n 輸入名稱開始搜尋: 'Type a name to search',\n 搜尋中: 'Searching',\n 搜尋結果: 'Search results',\n 最近開啟: 'Recently opened',\n 選擇: 'Select',\n 打開: 'Open',\n 取消: 'Cancel',\n 略過: 'Skip',\n 上一步: 'Back',\n 下一步: 'Next',\n 建議修正: 'Suggested fix',\n 複製修正: 'Copy fix',\n 已複製: 'Copied',\n 複製程式碼: 'Copy code',\n '原本:': 'Before: ',\n '改成:': 'After: ',\n 關閉說明: 'Close explanation',\n ',有說明': ', has an explanation',\n '(說明)': ' (explain)',\n '搜尋({k})': 'Search ({k})',\n 確定的關係: 'Confirmed',\n 推測的關係: 'Inferred',\n 專案宣告的關係: 'Declared by the project',\n 宣告: 'Declared',\n 外部項目: 'External',\n },\n },\n};\n\nfunction msgsFor(loc: string): Record<string, string> | null {\n return I18N.messages[loc] || I18N.messages[loc.split('-')[0]] || null;\n}\n\n/** Translates a built-in zh-TW string into the current locale; {name} placeholders take vars. A key may start with a\n * context and 「::」 ('快選::上個月'): only the text after it is shown in zh-TW. */\nexport function tr(key: string, vars?: Record<string, string | number>): string {\n // zh-TW (and zh-Hant) is the source text; other Chinese locales (zh-CN) use the messages an app adds for them.\n const m = isZhTW() ? null : msgsFor(I18N.locale);\n // A context before 「::」 tells apart one word with two meanings ('快選::上個月' is Last month, '上個月' Previous\n // month); zh-TW shows the text after it, and a locale without the context key uses the plain one.\n const at = key.indexOf('::');\n const text = at >= 0 ? key.slice(at + 2) : key;\n const out = m?.[key] ?? (at >= 0 ? m?.[text] : undefined) ?? text;\n return vars ? out.replace(/\\{(\\w+)\\}/g, (a, k: string) => (vars[k] !== undefined ? String(vars[k]) : a)) : out;\n}\n\n/** A count's unit: a function gets the count (for plurals, 「1 row」「2 rows」); a string goes through tr(), and for 1\n * the message 「1 <unit>」 is used when the locale has one (「1 筆」 → 「1 row」), without the number. */\nexport type CountUnit = string | ((n: number) => string);\nexport function unitFor(unit: CountUnit | undefined, n: number): string {\n if (!unit) return '';\n if (typeof unit === 'function') return unit(n);\n if (n === 1) {\n const one = tr('1 ' + unit);\n if (one !== '1 ' + unit) return one.replace(/^1\\s*/, '');\n }\n return tr(unit);\n}\n\nconst localeListeners = new Set<() => void>();\n\n/** Calls f after every change of locale or currency (setLocale) and of messages (addMessages); returns the unsubscribe.\n * useLocale() is built on it. */\nexport function subscribeLocale(f: () => void): () => void {\n localeListeners.add(f);\n return () => {\n localeListeners.delete(f);\n };\n}\n\n/** Switches the interface language and, optionally, the currency used by format.money. Components that read the\n * locale with useLocale() (and their children) render again. */\nexport function setLocale(locale: string, opts?: { currency?: string }): void {\n const next = locale || 'zh-TW';\n const changed = next !== I18N.locale || (!!opts?.currency && opts.currency !== I18N.currency);\n I18N.locale = next;\n if (opts?.currency) I18N.currency = opts.currency;\n if (typeof document !== 'undefined') document.documentElement.setAttribute('lang', I18N.locale);\n if (changed) emitLocale();\n}\n\n/** Tells the subscribers that the locale changed (LocaleProvider, after it set the locale while rendering). */\nexport function emitLocale(): void {\n localeListeners.forEach((f) => f());\n}\n\n/** Adds or overrides translations for a locale. Keys are the zh-TW strings. */\nexport function addMessages(locale: string, dict: Record<string, string>): void {\n I18N.messages[locale] = { ...I18N.messages[locale], ...dict };\n emitLocale();\n}\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AAM,OAAO,IAAI,QAAQ,SAAS,EAAE;CACzD;CACA,OAAO,GAAG,IAAI;AAChB;AAEA,MAAM,kCAAkB,IAAI,IAAgB;;;AAI5C,SAAgB,gBAAgB,GAA2B;CACzD,gBAAgB,IAAI,CAAC;CACrB,aAAa;EACX,gBAAgB,OAAO,CAAC;CAC1B;AACF;;;AAIA,SAAgB,UAAU,QAAgB,MAAoC;CAC5E,MAAM,OAAO,UAAU;CACvB,MAAM,UAAU,SAAS,KAAK,UAAW,CAAC,CAAC,MAAM,YAAY,KAAK,aAAa,KAAK;CACpF,KAAK,SAAS;CACd,IAAI,MAAM,UAAU,KAAK,WAAW,KAAK;CACzC,IAAI,OAAO,aAAa,aAAa,SAAS,gBAAgB,aAAa,QAAQ,KAAK,MAAM;CAC9F,IAAI,SAAS,WAAW;AAC1B;;AAGA,SAAgB,aAAmB;CACjC,gBAAgB,SAAS,MAAM,EAAE,CAAC;AACpC;;AAGA,SAAgB,YAAY,QAAgB,MAAoC;CAC9E,KAAK,SAAS,UAAU;EAAE,GAAG,KAAK,SAAS;EAAS,GAAG;CAAK;CAC5D,WAAW;AACb;AAEA,MAAa,eAAwB,iBAAiB,KAAK,KAAK,MAAM"}
@@ -6,7 +6,8 @@ export type IconSource = IconName | CustomIcon;
6
6
  export interface IconProps {
7
7
  /** Built-in Phosphor name, e.g. 'house', 'trash' (Lucide names work as aliases). */
8
8
  name?: IconName;
9
- /** A custom icon when it is not built in: 24 px path data, or SVG markup. */
9
+ /** A custom icon when it is not built in: 24 px path data, or SVG markup, which is inserted as HTML: never pass a
10
+ * string that came from a user or outside data. */
10
11
  d?: CustomIcon;
11
12
  /** Default 20. */
12
13
  size?: number;
@@ -14,6 +15,7 @@ export interface IconProps {
14
15
  strokeWidth?: number;
15
16
  /** The Fill version, for a selected item. */
16
17
  filled?: boolean;
18
+ /** Extra class on the root element. */
17
19
  className?: string;
18
20
  }
19
21
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.js","names":[],"sources":["../../src/icons/Icon.tsx"],"sourcesContent":["import { useSyncExternalStore } from 'react';\nimport { cx } from '../internal/util';\nimport { devWarn } from '../internal/dev';\nimport type { IconName, PhosphorName } from './names';\nimport { fixedGlyph, isIconName, loadIcon, nameOfMarkup, phosphorName, readyGlyph, subscribeIcons } from './store';\n\nexport type { IconName } from './names';\n\n/** Path data for a custom 24 x 24 stroke icon ('M4 12h16'), or SVG markup on a 256 x 256 viewBox. */\nexport type CustomIcon = `M${string}` | `m${string}` | `<${string}`;\n/** What an `icon` prop takes: a built-in name (checked by TypeScript) or a custom icon. */\nexport type IconSource = IconName | CustomIcon;\n\n/** The Phosphor name behind a name, an alias or the markup of a built-in icon. */\nfunction iconKey(source: string | undefined): PhosphorName | undefined {\n if (!source) return undefined;\n if (isIconName(source)) return phosphorName(source);\n return nameOfMarkup(source);\n}\n\nexport interface IconProps {\n /** Built-in Phosphor name, e.g. 'house', 'trash' (Lucide names work as aliases). */\n name?: IconName;\n /** A custom icon when it is not built in: 24 px path data, or SVG markup. */\n d?: CustomIcon;\n /** Default 20. */\n size?: number;\n /** Stroke width of a custom path icon. Default 2. */\n strokeWidth?: number;\n /** The Fill version, for a selected item. */\n filled?: boolean;\n className?: string;\n}\n\n/**\n * Phosphor icon, 20 px, inherits the text color. Decorative: label the control that holds it. A name the page has not\n * shown before loads its module first and is an empty box of the same size until then (on the server too).\n */\nexport function Icon({ name, d, size = 20, strokeWidth = 2, filled, className }: IconProps) {\n const key = iconKey(name ?? d);\n const glyph = useSyncExternalStore(\n subscribeIcons,\n () => readyGlyph(key),\n () => fixedGlyph(key),\n );\n if (name !== undefined && !isIconName(name))\n devWarn(true, 'Icon', `\"${String(name)}\" is not a built-in icon name; use a Phosphor name (see \\`icons\\`) or pass a custom icon as \\`d\\`.`);\n // Starts loading in the browser on the first render; the store tells every Icon with this name when it arrives.\n if (key && !glyph && typeof document !== 'undefined')\n loadIcon(key).catch((err: unknown) => devWarn(true, 'Icon', `could not load the icon \"${key}\" (${String(err)}); it shows as an empty box.`));\n const base = { className: cx('ui-icon', className), width: size, height: size, 'aria-hidden': true } as const;\n if (key || name !== undefined)\n return <svg {...base} viewBox=\"0 0 256 256\" fill=\"currentColor\" dangerouslySetInnerHTML={glyph ? { __html: filled ? glyph.f : glyph.r } : undefined} />;\n if (d?.startsWith('<')) return <svg {...base} viewBox=\"0 0 256 256\" fill=\"currentColor\" dangerouslySetInnerHTML={{ __html: d }} />;\n return (\n <svg {...base} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={strokeWidth} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d={d} />\n </svg>\n );\n}\n\n/** Renders an `icon` prop value: a name or a custom icon. */\nexport function IconOf({ icon, ...rest }: Omit<IconProps, 'name' | 'd'> & { icon: IconSource }) {\n return isIconName(icon) ? <Icon name={icon} {...rest} /> : <Icon d={icon} {...rest} />;\n}\n\n/** The check mark of Checkbox and selected options, 24 px path. */\nexport const CHECK: CustomIcon = 'M4 12.5l5 5L20 6.5';\n"],"mappings":";;;;;;;;AAcA,SAAS,QAAQ,QAAsD;CACrE,IAAI,CAAC,QAAQ,OAAO,KAAA;CACpB,IAAI,WAAW,MAAM,GAAG,OAAO,aAAa,MAAM;CAClD,OAAO,aAAa,MAAM;AAC5B;;;;;AAoBA,SAAgB,KAAK,EAAE,MAAM,GAAG,OAAO,IAAI,cAAc,GAAG,QAAQ,aAAwB;CAC1F,MAAM,MAAM,QAAQ,QAAQ,CAAC;CAC7B,MAAM,QAAQ,qBACZ,sBACM,WAAW,GAAG,SACd,WAAW,GAAG,CACtB;CACA,IAAI,SAAS,KAAA,KAAa,CAAC,WAAW,IAAI,GACxC,QAAQ,MAAM,QAAQ,IAAI,OAAO,IAAI,EAAE,mGAAmG;CAE5I,IAAI,OAAO,CAAC,SAAS,OAAO,aAAa,aACvC,SAAS,GAAG,CAAC,CAAC,OAAO,QAAiB,QAAQ,MAAM,QAAQ,4BAA4B,IAAI,KAAK,OAAO,GAAG,EAAE,6BAA6B,CAAC;CAC7I,MAAM,OAAO;EAAE,WAAW,GAAG,WAAW,SAAS;EAAG,OAAO;EAAM,QAAQ;EAAM,eAAe;CAAK;CACnG,IAAI,OAAO,SAAS,KAAA,GAClB,OAAO,oBAAC,OAAD;EAAK,GAAI;EAAM,SAAQ;EAAc,MAAK;EAAe,yBAAyB,QAAQ,EAAE,QAAQ,SAAS,MAAM,IAAI,MAAM,EAAE,IAAI,KAAA;CAAY,CAAA;CACxJ,IAAI,GAAG,WAAW,GAAG,GAAG,OAAO,oBAAC,OAAD;EAAK,GAAI;EAAM,SAAQ;EAAc,MAAK;EAAe,yBAAyB,EAAE,QAAQ,EAAE;CAAI,CAAA;CACjI,OACE,oBAAC,OAAD;EAAK,GAAI;EAAM,SAAQ;EAAY,MAAK;EAAO,QAAO;EAA4B;EAAa,eAAc;EAAQ,gBAAe;EAClI,UAAA,oBAAC,QAAD,EAAS,EAAI,CAAA;CACV,CAAA;AAET;;AAGA,SAAgB,OAAO,EAAE,MAAM,GAAG,QAA8D;CAC9F,OAAO,WAAW,IAAI,IAAI,oBAAC,MAAD;EAAM,MAAM;EAAM,GAAI;CAAO,CAAA,IAAI,oBAAC,MAAD;EAAM,GAAG;EAAM,GAAI;CAAO,CAAA;AACvF;;AAGA,MAAa,QAAoB"}
1
+ {"version":3,"file":"Icon.js","names":[],"sources":["../../src/icons/Icon.tsx"],"sourcesContent":["import { useSyncExternalStore } from 'react';\nimport { cx } from '../internal/util';\nimport { devWarn } from '../internal/dev';\nimport type { IconName, PhosphorName } from './names';\nimport { fixedGlyph, isIconName, loadIcon, nameOfMarkup, phosphorName, readyGlyph, subscribeIcons } from './store';\n\nexport type { IconName } from './names';\n\n/** Path data for a custom 24 x 24 stroke icon ('M4 12h16'), or SVG markup on a 256 x 256 viewBox. */\nexport type CustomIcon = `M${string}` | `m${string}` | `<${string}`;\n/** What an `icon` prop takes: a built-in name (checked by TypeScript) or a custom icon. */\nexport type IconSource = IconName | CustomIcon;\n\n/** The Phosphor name behind a name, an alias or the markup of a built-in icon. */\nfunction iconKey(source: string | undefined): PhosphorName | undefined {\n if (!source) return undefined;\n if (isIconName(source)) return phosphorName(source);\n return nameOfMarkup(source);\n}\n\nexport interface IconProps {\n /** Built-in Phosphor name, e.g. 'house', 'trash' (Lucide names work as aliases). */\n name?: IconName;\n /** A custom icon when it is not built in: 24 px path data, or SVG markup, which is inserted as HTML: never pass a\n * string that came from a user or outside data. */\n d?: CustomIcon;\n /** Default 20. */\n size?: number;\n /** Stroke width of a custom path icon. Default 2. */\n strokeWidth?: number;\n /** The Fill version, for a selected item. */\n filled?: boolean;\n /** Extra class on the root element. */\n className?: string;\n}\n\n/**\n * Phosphor icon, 20 px, inherits the text color. Decorative: label the control that holds it. A name the page has not\n * shown before loads its module first and is an empty box of the same size until then (on the server too).\n */\nexport function Icon({ name, d, size = 20, strokeWidth = 2, filled, className }: IconProps) {\n const key = iconKey(name ?? d);\n const glyph = useSyncExternalStore(\n subscribeIcons,\n () => readyGlyph(key),\n () => fixedGlyph(key),\n );\n if (name !== undefined && !isIconName(name))\n devWarn(true, 'Icon', `\"${String(name)}\" is not a built-in icon name; use a Phosphor name (see \\`icons\\`) or pass a custom icon as \\`d\\`.`);\n // Starts loading in the browser on the first render; the store tells every Icon with this name when it arrives.\n if (key && !glyph && typeof document !== 'undefined')\n loadIcon(key).catch((err: unknown) => devWarn(true, 'Icon', `could not load the icon \"${key}\" (${String(err)}); it shows as an empty box.`));\n const base = { className: cx('ui-icon', className), width: size, height: size, 'aria-hidden': true } as const;\n if (key || name !== undefined)\n return <svg {...base} viewBox=\"0 0 256 256\" fill=\"currentColor\" dangerouslySetInnerHTML={glyph ? { __html: filled ? glyph.f : glyph.r } : undefined} />;\n if (d?.startsWith('<')) return <svg {...base} viewBox=\"0 0 256 256\" fill=\"currentColor\" dangerouslySetInnerHTML={{ __html: d }} />;\n return (\n <svg {...base} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth={strokeWidth} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path d={d} />\n </svg>\n );\n}\n\n/** Renders an `icon` prop value: a name or a custom icon. */\nexport function IconOf({ icon, ...rest }: Omit<IconProps, 'name' | 'd'> & { icon: IconSource }) {\n return isIconName(icon) ? <Icon name={icon} {...rest} /> : <Icon d={icon} {...rest} />;\n}\n\n/** The check mark of Checkbox and selected options, 24 px path. */\nexport const CHECK: CustomIcon = 'M4 12.5l5 5L20 6.5';\n"],"mappings":";;;;;;;;AAcA,SAAS,QAAQ,QAAsD;CACrE,IAAI,CAAC,QAAQ,OAAO,KAAA;CACpB,IAAI,WAAW,MAAM,GAAG,OAAO,aAAa,MAAM;CAClD,OAAO,aAAa,MAAM;AAC5B;;;;;AAsBA,SAAgB,KAAK,EAAE,MAAM,GAAG,OAAO,IAAI,cAAc,GAAG,QAAQ,aAAwB;CAC1F,MAAM,MAAM,QAAQ,QAAQ,CAAC;CAC7B,MAAM,QAAQ,qBACZ,sBACM,WAAW,GAAG,SACd,WAAW,GAAG,CACtB;CACA,IAAI,SAAS,KAAA,KAAa,CAAC,WAAW,IAAI,GACxC,QAAQ,MAAM,QAAQ,IAAI,OAAO,IAAI,EAAE,mGAAmG;CAE5I,IAAI,OAAO,CAAC,SAAS,OAAO,aAAa,aACvC,SAAS,GAAG,CAAC,CAAC,OAAO,QAAiB,QAAQ,MAAM,QAAQ,4BAA4B,IAAI,KAAK,OAAO,GAAG,EAAE,6BAA6B,CAAC;CAC7I,MAAM,OAAO;EAAE,WAAW,GAAG,WAAW,SAAS;EAAG,OAAO;EAAM,QAAQ;EAAM,eAAe;CAAK;CACnG,IAAI,OAAO,SAAS,KAAA,GAClB,OAAO,oBAAC,OAAD;EAAK,GAAI;EAAM,SAAQ;EAAc,MAAK;EAAe,yBAAyB,QAAQ,EAAE,QAAQ,SAAS,MAAM,IAAI,MAAM,EAAE,IAAI,KAAA;CAAY,CAAA;CACxJ,IAAI,GAAG,WAAW,GAAG,G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