@seanyeh77/ui 0.41.0 → 0.43.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 (677) hide show
  1. package/README.md +32 -0
  2. package/dist/announce.d.ts +3 -0
  3. package/dist/announce.js +35 -0
  4. package/dist/announce.js.map +1 -0
  5. package/dist/bundle.js +24 -24
  6. package/dist/bundle.js.map +1 -1
  7. package/dist/components/AccentPicker/AccentPicker.d.ts +12 -0
  8. package/dist/components/AccentPicker/AccentPicker.js +99 -0
  9. package/dist/components/AccentPicker/AccentPicker.js.map +1 -0
  10. package/dist/components/ActionBar/ActionBar.d.ts +27 -0
  11. package/dist/components/ActionBar/ActionBar.js +62 -0
  12. package/dist/components/ActionBar/ActionBar.js.map +1 -0
  13. package/dist/components/AiMark/AiMark.d.ts +10 -0
  14. package/dist/components/AiMark/AiMark.js +21 -0
  15. package/dist/components/AiMark/AiMark.js.map +1 -0
  16. package/dist/components/Alert/Alert.d.ts +17 -0
  17. package/dist/components/Alert/Alert.js +59 -0
  18. package/dist/components/Alert/Alert.js.map +1 -0
  19. package/dist/components/AppShell/AppShell.d.ts +36 -0
  20. package/dist/components/AppShell/AppShell.js +198 -0
  21. package/dist/components/AppShell/AppShell.js.map +1 -0
  22. package/dist/components/Badge/Badge.d.ts +12 -0
  23. package/dist/components/Badge/Badge.js +58 -0
  24. package/dist/components/Badge/Badge.js.map +1 -0
  25. package/dist/components/BarChart/BarChart.d.ts +19 -0
  26. package/dist/components/BarChart/BarChart.js +78 -0
  27. package/dist/components/BarChart/BarChart.js.map +1 -0
  28. package/dist/components/Breadcrumb/Breadcrumb.d.ts +11 -0
  29. package/dist/components/Breadcrumb/Breadcrumb.js +29 -0
  30. package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
  31. package/dist/components/Button/Button.d.ts +39 -0
  32. package/dist/components/Button/Button.js +55 -0
  33. package/dist/components/Button/Button.js.map +1 -0
  34. package/dist/components/Calendar/Calendar.d.ts +18 -0
  35. package/dist/components/Calendar/Calendar.js +129 -0
  36. package/dist/components/Calendar/Calendar.js.map +1 -0
  37. package/dist/components/Card/Card.d.ts +14 -0
  38. package/dist/components/Card/Card.js +33 -0
  39. package/dist/components/Card/Card.js.map +1 -0
  40. package/dist/components/Checkbox/Checkbox.d.ts +14 -0
  41. package/dist/components/Checkbox/Checkbox.js +27 -0
  42. package/dist/components/Checkbox/Checkbox.js.map +1 -0
  43. package/dist/components/CodeView/CodeView.d.ts +111 -0
  44. package/dist/components/CodeView/CodeView.js +794 -0
  45. package/dist/components/CodeView/CodeView.js.map +1 -0
  46. package/dist/components/CodeView/tokens.d.ts +5 -0
  47. package/dist/components/CodeView/tokens.js +70 -0
  48. package/dist/components/CodeView/tokens.js.map +1 -0
  49. package/dist/components/CommandPalette/CommandPalette.d.ts +52 -0
  50. package/dist/components/CommandPalette/CommandPalette.js +250 -0
  51. package/dist/components/CommandPalette/CommandPalette.js.map +1 -0
  52. package/dist/components/ConsoleLayout/ConsoleLayout.d.ts +44 -0
  53. package/dist/components/ConsoleLayout/ConsoleLayout.js +123 -0
  54. package/dist/components/ConsoleLayout/ConsoleLayout.js.map +1 -0
  55. package/dist/components/DangerZone/DangerZone.d.ts +16 -0
  56. package/dist/components/DangerZone/DangerZone.js +28 -0
  57. package/dist/components/DangerZone/DangerZone.js.map +1 -0
  58. package/dist/components/DataTable/DataTable.d.ts +99 -0
  59. package/dist/components/DataTable/DataTable.js +1272 -0
  60. package/dist/components/DataTable/DataTable.js.map +1 -0
  61. package/dist/components/DataTable/SortButton.js +228 -0
  62. package/dist/components/DataTable/SortButton.js.map +1 -0
  63. package/dist/components/DataTable/filters.js +147 -0
  64. package/dist/components/DataTable/filters.js.map +1 -0
  65. package/dist/components/DataTable/parts.js +383 -0
  66. package/dist/components/DataTable/parts.js.map +1 -0
  67. package/dist/components/DataTable/types.d.ts +85 -0
  68. package/dist/components/DatePicker/DatePicker.d.ts +15 -0
  69. package/dist/components/DatePicker/DatePicker.js +107 -0
  70. package/dist/components/DatePicker/DatePicker.js.map +1 -0
  71. package/dist/components/DateRangePicker/DateRangePicker.d.ts +11 -0
  72. package/dist/components/DateRangePicker/DateRangePicker.js +91 -0
  73. package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -0
  74. package/dist/components/DetailList/DetailList.d.ts +17 -0
  75. package/dist/components/DetailList/DetailList.js +18 -0
  76. package/dist/components/DetailList/DetailList.js.map +1 -0
  77. package/dist/components/Dialog/Dialog.d.ts +30 -0
  78. package/dist/components/Dialog/Dialog.js +90 -0
  79. package/dist/components/Dialog/Dialog.js.map +1 -0
  80. package/dist/components/Drawer/Drawer.d.ts +20 -0
  81. package/dist/components/Drawer/Drawer.js +67 -0
  82. package/dist/components/Drawer/Drawer.js.map +1 -0
  83. package/dist/components/EmptyState/EmptyState.d.ts +15 -0
  84. package/dist/components/EmptyState/EmptyState.js +34 -0
  85. package/dist/components/EmptyState/EmptyState.js.map +1 -0
  86. package/dist/components/ErrorPage/ErrorPage.d.ts +14 -0
  87. package/dist/components/ErrorPage/ErrorPage.js +47 -0
  88. package/dist/components/ErrorPage/ErrorPage.js.map +1 -0
  89. package/dist/components/EventTimeline/EventTimeline.d.ts +19 -0
  90. package/dist/components/EventTimeline/EventTimeline.js +69 -0
  91. package/dist/components/EventTimeline/EventTimeline.js.map +1 -0
  92. package/dist/components/FileUpload/FileUpload.d.ts +27 -0
  93. package/dist/components/FileUpload/FileUpload.js +126 -0
  94. package/dist/components/FileUpload/FileUpload.js.map +1 -0
  95. package/dist/components/FormGrid/FormGrid.d.ts +7 -0
  96. package/dist/components/FormGrid/FormGrid.js +14 -0
  97. package/dist/components/FormGrid/FormGrid.js.map +1 -0
  98. package/dist/components/Graph/Graph.d.ts +18 -0
  99. package/dist/components/Graph/Graph.js +97 -0
  100. package/dist/components/Graph/Graph.js.map +1 -0
  101. package/dist/components/Grid/Grid.d.ts +16 -0
  102. package/dist/components/Grid/Grid.js +21 -0
  103. package/dist/components/Grid/Grid.js.map +1 -0
  104. package/dist/components/IconButton/IconButton.d.ts +32 -0
  105. package/dist/components/IconButton/IconButton.js +107 -0
  106. package/dist/components/IconButton/IconButton.js.map +1 -0
  107. package/dist/components/InlineCode/InlineCode.d.ts +46 -0
  108. package/dist/components/InlineCode/InlineCode.js +71 -0
  109. package/dist/components/InlineCode/InlineCode.js.map +1 -0
  110. package/dist/components/KpiCard/KpiCard.d.ts +38 -0
  111. package/dist/components/KpiCard/KpiCard.js +116 -0
  112. package/dist/components/KpiCard/KpiCard.js.map +1 -0
  113. package/dist/components/LayerGraph/LayerGraph.d.ts +117 -0
  114. package/dist/components/LayerGraph/LayerGraph.js +1648 -0
  115. package/dist/components/LayerGraph/LayerGraph.js.map +1 -0
  116. package/dist/components/LineChart/LineChart.d.ts +73 -0
  117. package/dist/components/LineChart/LineChart.js +337 -0
  118. package/dist/components/LineChart/LineChart.js.map +1 -0
  119. package/dist/components/LoadingBar/LoadingBar.d.ts +7 -0
  120. package/dist/components/LoadingBar/LoadingBar.js +18 -0
  121. package/dist/components/LoadingBar/LoadingBar.js.map +1 -0
  122. package/dist/components/LoginCard/LoginCard.d.ts +23 -0
  123. package/dist/components/LoginCard/LoginCard.js +117 -0
  124. package/dist/components/LoginCard/LoginCard.js.map +1 -0
  125. package/dist/components/Markdown/Markdown.d.ts +38 -0
  126. package/dist/components/Markdown/Markdown.js +719 -0
  127. package/dist/components/Markdown/Markdown.js.map +1 -0
  128. package/dist/components/Menu/Menu.d.ts +33 -0
  129. package/dist/components/Menu/Menu.js +78 -0
  130. package/dist/components/Menu/Menu.js.map +1 -0
  131. package/dist/components/Meter/Meter.d.ts +20 -0
  132. package/dist/components/Meter/Meter.js +120 -0
  133. package/dist/components/Meter/Meter.js.map +1 -0
  134. package/dist/components/MobileTabBar/MobileTabBar.d.ts +21 -0
  135. package/dist/components/MobileTabBar/MobileTabBar.js +47 -0
  136. package/dist/components/MobileTabBar/MobileTabBar.js.map +1 -0
  137. package/dist/components/MultiSelect/MultiSelect.d.ts +25 -0
  138. package/dist/components/MultiSelect/MultiSelect.js +119 -0
  139. package/dist/components/MultiSelect/MultiSelect.js.map +1 -0
  140. package/dist/components/NotificationBell/NotificationBell.d.ts +20 -0
  141. package/dist/components/NotificationBell/NotificationBell.js +95 -0
  142. package/dist/components/NotificationBell/NotificationBell.js.map +1 -0
  143. package/dist/components/Popover/Popover.d.ts +20 -0
  144. package/dist/components/Popover/Popover.js +48 -0
  145. package/dist/components/Popover/Popover.js.map +1 -0
  146. package/dist/components/ProgressBar/ProgressBar.d.ts +10 -0
  147. package/dist/components/ProgressBar/ProgressBar.js +38 -0
  148. package/dist/components/ProgressBar/ProgressBar.js.map +1 -0
  149. package/dist/components/ProgressRing/ProgressRing.d.ts +11 -0
  150. package/dist/components/ProgressRing/ProgressRing.js +53 -0
  151. package/dist/components/ProgressRing/ProgressRing.js.map +1 -0
  152. package/dist/components/ProjectSwitcher/ProjectSwitcher.d.ts +25 -0
  153. package/dist/components/ProjectSwitcher/ProjectSwitcher.js +100 -0
  154. package/dist/components/ProjectSwitcher/ProjectSwitcher.js.map +1 -0
  155. package/dist/components/RadioGroup/RadioGroup.d.ts +18 -0
  156. package/dist/components/RadioGroup/RadioGroup.js +63 -0
  157. package/dist/components/RadioGroup/RadioGroup.js.map +1 -0
  158. package/dist/components/SearchField/SearchField.d.ts +9 -0
  159. package/dist/components/SearchField/SearchField.js +50 -0
  160. package/dist/components/SearchField/SearchField.js.map +1 -0
  161. package/dist/components/Section/Section.d.ts +50 -0
  162. package/dist/components/Section/Section.js +225 -0
  163. package/dist/components/Section/Section.js.map +1 -0
  164. package/dist/components/SegmentedControl/SegmentedControl.d.ts +23 -0
  165. package/dist/components/SegmentedControl/SegmentedControl.js +86 -0
  166. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -0
  167. package/dist/components/Select/Select.d.ts +31 -0
  168. package/dist/components/Select/Select.js +143 -0
  169. package/dist/components/Select/Select.js.map +1 -0
  170. package/dist/components/SettingsLayout/SettingsLayout.d.ts +27 -0
  171. package/dist/components/SettingsLayout/SettingsLayout.js +69 -0
  172. package/dist/components/SettingsLayout/SettingsLayout.js.map +1 -0
  173. package/dist/components/SideNav/SideNav.d.ts +48 -0
  174. package/dist/components/SideNav/SideNav.js +225 -0
  175. package/dist/components/SideNav/SideNav.js.map +1 -0
  176. package/dist/components/Skeleton/Skeleton.d.ts +8 -0
  177. package/dist/components/Skeleton/Skeleton.js +17 -0
  178. package/dist/components/Skeleton/Skeleton.js.map +1 -0
  179. package/dist/components/SplitPane/SplitPane.d.ts +23 -0
  180. package/dist/components/SplitPane/SplitPane.js +140 -0
  181. package/dist/components/SplitPane/SplitPane.js.map +1 -0
  182. package/dist/components/StatusBand/StatusBand.d.ts +31 -0
  183. package/dist/components/StatusBand/StatusBand.js +43 -0
  184. package/dist/components/StatusBand/StatusBand.js.map +1 -0
  185. package/dist/components/Suggestion/Suggestion.d.ts +22 -0
  186. package/dist/components/Suggestion/Suggestion.js +75 -0
  187. package/dist/components/Suggestion/Suggestion.js.map +1 -0
  188. package/dist/components/Switch/Switch.d.ts +11 -0
  189. package/dist/components/Switch/Switch.js +56 -0
  190. package/dist/components/Switch/Switch.js.map +1 -0
  191. package/dist/components/Tabs/Tabs.d.ts +23 -0
  192. package/dist/components/Tabs/Tabs.js +117 -0
  193. package/dist/components/Tabs/Tabs.js.map +1 -0
  194. package/dist/components/Tag/Tag.d.ts +13 -0
  195. package/dist/components/Tag/Tag.js +26 -0
  196. package/dist/components/Tag/Tag.js.map +1 -0
  197. package/dist/components/Term/Term.d.ts +34 -0
  198. package/dist/components/Term/Term.js +143 -0
  199. package/dist/components/Term/Term.js.map +1 -0
  200. package/dist/components/TextArea/TextArea.d.ts +15 -0
  201. package/dist/components/TextArea/TextArea.js +75 -0
  202. package/dist/components/TextArea/TextArea.js.map +1 -0
  203. package/dist/components/TextField/TextField.d.ts +15 -0
  204. package/dist/components/TextField/TextField.js +43 -0
  205. package/dist/components/TextField/TextField.js.map +1 -0
  206. package/dist/components/ThemePicker/ThemePicker.d.ts +13 -0
  207. package/dist/components/ThemePicker/ThemePicker.js +66 -0
  208. package/dist/components/ThemePicker/ThemePicker.js.map +1 -0
  209. package/dist/components/TimeControl/TimeControl.d.ts +19 -0
  210. package/dist/components/TimeControl/TimeControl.js +47 -0
  211. package/dist/components/TimeControl/TimeControl.js.map +1 -0
  212. package/dist/components/Toast/Toast.d.ts +10 -0
  213. package/dist/components/Toast/Toast.js +30 -0
  214. package/dist/components/Toast/Toast.js.map +1 -0
  215. package/dist/components/Tooltip/Tooltip.d.ts +17 -0
  216. package/dist/components/Tooltip/Tooltip.js +69 -0
  217. package/dist/components/Tooltip/Tooltip.js.map +1 -0
  218. package/dist/components/TopBar/TopBar.d.ts +18 -0
  219. package/dist/components/TopBar/TopBar.js +59 -0
  220. package/dist/components/TopBar/TopBar.js.map +1 -0
  221. package/dist/components/Tour/Tour.d.ts +44 -0
  222. package/dist/components/Tour/Tour.js +440 -0
  223. package/dist/components/Tour/Tour.js.map +1 -0
  224. package/dist/components/TreeList/TreeList.d.ts +90 -0
  225. package/dist/components/TreeList/TreeList.js +594 -0
  226. package/dist/components/TreeList/TreeList.js.map +1 -0
  227. package/dist/components/TreeList/helpers.d.ts +2 -0
  228. package/dist/components/TreeList/helpers.js +104 -0
  229. package/dist/components/TreeList/helpers.js.map +1 -0
  230. package/dist/components/Workbench/Workbench.d.ts +100 -0
  231. package/dist/components/Workbench/Workbench.js +1142 -0
  232. package/dist/components/Workbench/Workbench.js.map +1 -0
  233. package/dist/components/ZoneMap/ZoneMap.d.ts +49 -0
  234. package/dist/components/ZoneMap/ZoneMap.js +89 -0
  235. package/dist/components/ZoneMap/ZoneMap.js.map +1 -0
  236. package/dist/css/AccentPicker.css +49 -0
  237. package/dist/css/ActionBar.css +36 -0
  238. package/dist/css/AiMark.css +14 -0
  239. package/dist/css/Alert.css +80 -0
  240. package/dist/css/AppShell.css +81 -0
  241. package/dist/css/Badge.css +68 -0
  242. package/dist/css/BarChart.css +66 -0
  243. package/dist/css/Breadcrumb.css +33 -0
  244. package/dist/css/Button.css +190 -0
  245. package/dist/css/Calendar.css +96 -0
  246. package/dist/css/Card.css +70 -0
  247. package/dist/css/Checkbox.css +38 -0
  248. package/dist/css/CodeView.css +302 -0
  249. package/dist/css/CommandPalette.css +232 -0
  250. package/dist/css/ConsoleLayout.css +131 -0
  251. package/dist/css/DangerZone.css +32 -0
  252. package/dist/css/DataTable.css +1195 -0
  253. package/dist/css/DatePicker.css +38 -0
  254. package/dist/css/DateRangePicker.css +70 -0
  255. package/dist/css/DetailList.css +69 -0
  256. package/dist/css/Dialog.css +3 -0
  257. package/dist/css/Drawer.css +90 -0
  258. package/dist/css/EmptyState.css +61 -0
  259. package/dist/css/ErrorPage.css +40 -0
  260. package/dist/css/EventTimeline.css +43 -0
  261. package/dist/css/FileUpload.css +92 -0
  262. package/dist/css/FormGrid.css +17 -0
  263. package/dist/css/Graph.css +99 -0
  264. package/dist/css/Grid.css +48 -0
  265. package/dist/css/IconButton.css +149 -0
  266. package/dist/css/InlineCode.css +92 -0
  267. package/dist/css/KpiCard.css +121 -0
  268. package/dist/css/LayerGraph.css +575 -0
  269. package/dist/css/LineChart.css +3 -0
  270. package/dist/css/LoadingBar.css +45 -0
  271. package/dist/css/LoginCard.css +65 -0
  272. package/dist/css/Markdown.css +266 -0
  273. package/dist/css/Menu.css +88 -0
  274. package/dist/css/Meter.css +110 -0
  275. package/dist/css/MobileTabBar.css +63 -0
  276. package/dist/css/MultiSelect.css +78 -0
  277. package/dist/css/NotificationBell.css +129 -0
  278. package/dist/css/Popover.css +57 -0
  279. package/dist/css/ProgressBar.css +42 -0
  280. package/dist/css/ProgressRing.css +19 -0
  281. package/dist/css/ProjectSwitcher.css +153 -0
  282. package/dist/css/RadioGroup.css +52 -0
  283. package/dist/css/SearchField.css +79 -0
  284. package/dist/css/Section.css +115 -0
  285. package/dist/css/SegmentedControl.css +67 -0
  286. package/dist/css/Select.css +136 -0
  287. package/dist/css/SettingsLayout.css +110 -0
  288. package/dist/css/SideNav.css +281 -0
  289. package/dist/css/Skeleton.css +19 -0
  290. package/dist/css/SplitPane.css +108 -0
  291. package/dist/css/StatusBand.css +23 -0
  292. package/dist/css/Suggestion.css +82 -0
  293. package/dist/css/Switch.css +46 -0
  294. package/dist/css/Tabs.css +91 -0
  295. package/dist/css/Tag.css +36 -0
  296. package/dist/css/Term.css +160 -0
  297. package/dist/css/TextArea.css +22 -0
  298. package/dist/css/TextField.css +2 -0
  299. package/dist/css/ThemePicker.css +70 -0
  300. package/dist/css/TimeControl.css +33 -0
  301. package/dist/css/Toast.css +47 -0
  302. package/dist/css/Tooltip.css +58 -0
  303. package/dist/css/TopBar.css +86 -0
  304. package/dist/css/Tour.css +90 -0
  305. package/dist/css/TreeList.css +532 -0
  306. package/dist/css/Workbench.css +652 -0
  307. package/dist/css/ZoneMap.css +203 -0
  308. package/dist/css/base.css +556 -0
  309. package/dist/css/end.css +273 -0
  310. package/dist/format-entry.d.ts +3 -0
  311. package/dist/format-entry.js +3 -0
  312. package/dist/format.d.ts +68 -2
  313. package/dist/format.js +237 -1
  314. package/dist/format.js.map +1 -0
  315. package/dist/i18n.d.ts +11 -0
  316. package/dist/{format-entry-CyChe8bk.js → i18n.js} +2 -235
  317. package/dist/i18n.js.map +1 -0
  318. package/dist/icons/Icon.d.ts +24 -0
  319. package/dist/icons/Icon.js +66 -0
  320. package/dist/icons/Icon.js.map +1 -0
  321. package/dist/icons/Spinner.js +18 -0
  322. package/dist/icons/Spinner.js.map +1 -0
  323. package/dist/icons/all.js +212 -0
  324. package/dist/icons/all.js.map +1 -0
  325. package/dist/icons/map.d.ts +3 -0
  326. package/dist/icons/map.js +31 -0
  327. package/dist/icons/map.js.map +1 -0
  328. package/dist/icons/names.d.ts +253 -0
  329. package/dist/icons/names.js +153 -0
  330. package/dist/icons/names.js.map +1 -0
  331. package/dist/icons/ph/archive.d.ts +10 -0
  332. package/dist/icons/ph/archive.js +11 -0
  333. package/dist/icons/ph/archive.js.map +1 -0
  334. package/dist/icons/ph/arrow-down.d.ts +10 -0
  335. package/dist/icons/ph/arrow-down.js +11 -0
  336. package/dist/icons/ph/arrow-down.js.map +1 -0
  337. package/dist/icons/ph/arrow-left.d.ts +10 -0
  338. package/dist/icons/ph/arrow-left.js +11 -0
  339. package/dist/icons/ph/arrow-left.js.map +1 -0
  340. package/dist/icons/ph/arrow-right.d.ts +10 -0
  341. package/dist/icons/ph/arrow-right.js +11 -0
  342. package/dist/icons/ph/arrow-right.js.map +1 -0
  343. package/dist/icons/ph/arrow-square-out.d.ts +10 -0
  344. package/dist/icons/ph/arrow-square-out.js +11 -0
  345. package/dist/icons/ph/arrow-square-out.js.map +1 -0
  346. package/dist/icons/ph/arrow-u-up-left.d.ts +10 -0
  347. package/dist/icons/ph/arrow-u-up-left.js +11 -0
  348. package/dist/icons/ph/arrow-u-up-left.js.map +1 -0
  349. package/dist/icons/ph/arrow-u-up-right.d.ts +10 -0
  350. package/dist/icons/ph/arrow-u-up-right.js +11 -0
  351. package/dist/icons/ph/arrow-u-up-right.js.map +1 -0
  352. package/dist/icons/ph/arrow-up.d.ts +10 -0
  353. package/dist/icons/ph/arrow-up.js +11 -0
  354. package/dist/icons/ph/arrow-up.js.map +1 -0
  355. package/dist/icons/ph/arrows-clockwise.d.ts +10 -0
  356. package/dist/icons/ph/arrows-clockwise.js +11 -0
  357. package/dist/icons/ph/arrows-clockwise.js.map +1 -0
  358. package/dist/icons/ph/arrows-in-line-vertical.d.ts +10 -0
  359. package/dist/icons/ph/arrows-in-line-vertical.js +11 -0
  360. package/dist/icons/ph/arrows-in-line-vertical.js.map +1 -0
  361. package/dist/icons/ph/arrows-left-right.d.ts +10 -0
  362. package/dist/icons/ph/arrows-left-right.js +11 -0
  363. package/dist/icons/ph/arrows-left-right.js.map +1 -0
  364. package/dist/icons/ph/arrows-out-line-vertical.d.ts +10 -0
  365. package/dist/icons/ph/arrows-out-line-vertical.js +11 -0
  366. package/dist/icons/ph/arrows-out-line-vertical.js.map +1 -0
  367. package/dist/icons/ph/bell.d.ts +10 -0
  368. package/dist/icons/ph/bell.js +11 -0
  369. package/dist/icons/ph/bell.js.map +1 -0
  370. package/dist/icons/ph/brackets-curly.d.ts +10 -0
  371. package/dist/icons/ph/brackets-curly.js +11 -0
  372. package/dist/icons/ph/brackets-curly.js.map +1 -0
  373. package/dist/icons/ph/calendar-blank.d.ts +10 -0
  374. package/dist/icons/ph/calendar-blank.js +11 -0
  375. package/dist/icons/ph/calendar-blank.js.map +1 -0
  376. package/dist/icons/ph/caret-down.d.ts +10 -0
  377. package/dist/icons/ph/caret-down.js +11 -0
  378. package/dist/icons/ph/caret-down.js.map +1 -0
  379. package/dist/icons/ph/caret-left.d.ts +10 -0
  380. package/dist/icons/ph/caret-left.js +11 -0
  381. package/dist/icons/ph/caret-left.js.map +1 -0
  382. package/dist/icons/ph/caret-right.d.ts +10 -0
  383. package/dist/icons/ph/caret-right.js +11 -0
  384. package/dist/icons/ph/caret-right.js.map +1 -0
  385. package/dist/icons/ph/caret-up.d.ts +10 -0
  386. package/dist/icons/ph/caret-up.js +11 -0
  387. package/dist/icons/ph/caret-up.js.map +1 -0
  388. package/dist/icons/ph/chart-bar.d.ts +10 -0
  389. package/dist/icons/ph/chart-bar.js +11 -0
  390. package/dist/icons/ph/chart-bar.js.map +1 -0
  391. package/dist/icons/ph/chart-line.d.ts +10 -0
  392. package/dist/icons/ph/chart-line.js +11 -0
  393. package/dist/icons/ph/chart-line.js.map +1 -0
  394. package/dist/icons/ph/chart-pie.d.ts +10 -0
  395. package/dist/icons/ph/chart-pie.js +11 -0
  396. package/dist/icons/ph/chart-pie.js.map +1 -0
  397. package/dist/icons/ph/chat-centered.d.ts +10 -0
  398. package/dist/icons/ph/chat-centered.js +11 -0
  399. package/dist/icons/ph/chat-centered.js.map +1 -0
  400. package/dist/icons/ph/check-circle.d.ts +10 -0
  401. package/dist/icons/ph/check-circle.js +11 -0
  402. package/dist/icons/ph/check-circle.js.map +1 -0
  403. package/dist/icons/ph/check-square.d.ts +10 -0
  404. package/dist/icons/ph/check-square.js +11 -0
  405. package/dist/icons/ph/check-square.js.map +1 -0
  406. package/dist/icons/ph/check.d.ts +10 -0
  407. package/dist/icons/ph/check.js +11 -0
  408. package/dist/icons/ph/check.js.map +1 -0
  409. package/dist/icons/ph/circle-notch.d.ts +10 -0
  410. package/dist/icons/ph/circle-notch.js +11 -0
  411. package/dist/icons/ph/circle-notch.js.map +1 -0
  412. package/dist/icons/ph/clock.d.ts +10 -0
  413. package/dist/icons/ph/clock.js +11 -0
  414. package/dist/icons/ph/clock.js.map +1 -0
  415. package/dist/icons/ph/cloud.d.ts +10 -0
  416. package/dist/icons/ph/cloud.js +11 -0
  417. package/dist/icons/ph/cloud.js.map +1 -0
  418. package/dist/icons/ph/columns.d.ts +10 -0
  419. package/dist/icons/ph/columns.js +11 -0
  420. package/dist/icons/ph/columns.js.map +1 -0
  421. package/dist/icons/ph/command.d.ts +10 -0
  422. package/dist/icons/ph/command.js +11 -0
  423. package/dist/icons/ph/command.js.map +1 -0
  424. package/dist/icons/ph/copy.d.ts +10 -0
  425. package/dist/icons/ph/copy.js +11 -0
  426. package/dist/icons/ph/copy.js.map +1 -0
  427. package/dist/icons/ph/corners-in.d.ts +10 -0
  428. package/dist/icons/ph/corners-in.js +11 -0
  429. package/dist/icons/ph/corners-in.js.map +1 -0
  430. package/dist/icons/ph/corners-out.d.ts +10 -0
  431. package/dist/icons/ph/corners-out.js +11 -0
  432. package/dist/icons/ph/corners-out.js.map +1 -0
  433. package/dist/icons/ph/cpu.d.ts +10 -0
  434. package/dist/icons/ph/cpu.js +11 -0
  435. package/dist/icons/ph/cpu.js.map +1 -0
  436. package/dist/icons/ph/database.d.ts +10 -0
  437. package/dist/icons/ph/database.js +11 -0
  438. package/dist/icons/ph/database.js.map +1 -0
  439. package/dist/icons/ph/dots-six-vertical.d.ts +10 -0
  440. package/dist/icons/ph/dots-six-vertical.js +11 -0
  441. package/dist/icons/ph/dots-six-vertical.js.map +1 -0
  442. package/dist/icons/ph/dots-three-vertical.d.ts +10 -0
  443. package/dist/icons/ph/dots-three-vertical.js +11 -0
  444. package/dist/icons/ph/dots-three-vertical.js.map +1 -0
  445. package/dist/icons/ph/dots-three.d.ts +10 -0
  446. package/dist/icons/ph/dots-three.js +11 -0
  447. package/dist/icons/ph/dots-three.js.map +1 -0
  448. package/dist/icons/ph/download-simple.d.ts +10 -0
  449. package/dist/icons/ph/download-simple.js +11 -0
  450. package/dist/icons/ph/download-simple.js.map +1 -0
  451. package/dist/icons/ph/envelope-simple.d.ts +10 -0
  452. package/dist/icons/ph/envelope-simple.js +11 -0
  453. package/dist/icons/ph/envelope-simple.js.map +1 -0
  454. package/dist/icons/ph/eye-slash.d.ts +10 -0
  455. package/dist/icons/ph/eye-slash.js +11 -0
  456. package/dist/icons/ph/eye-slash.js.map +1 -0
  457. package/dist/icons/ph/eye.d.ts +10 -0
  458. package/dist/icons/ph/eye.js +11 -0
  459. package/dist/icons/ph/eye.js.map +1 -0
  460. package/dist/icons/ph/file-code.d.ts +10 -0
  461. package/dist/icons/ph/file-code.js +11 -0
  462. package/dist/icons/ph/file-code.js.map +1 -0
  463. package/dist/icons/ph/file-text.d.ts +10 -0
  464. package/dist/icons/ph/file-text.js +11 -0
  465. package/dist/icons/ph/file-text.js.map +1 -0
  466. package/dist/icons/ph/file.d.ts +10 -0
  467. package/dist/icons/ph/file.js +11 -0
  468. package/dist/icons/ph/file.js.map +1 -0
  469. package/dist/icons/ph/floppy-disk.d.ts +10 -0
  470. package/dist/icons/ph/floppy-disk.js +11 -0
  471. package/dist/icons/ph/floppy-disk.js.map +1 -0
  472. package/dist/icons/ph/folder-open.d.ts +10 -0
  473. package/dist/icons/ph/folder-open.js +11 -0
  474. package/dist/icons/ph/folder-open.js.map +1 -0
  475. package/dist/icons/ph/folder.d.ts +10 -0
  476. package/dist/icons/ph/folder.js +11 -0
  477. package/dist/icons/ph/folder.js.map +1 -0
  478. package/dist/icons/ph/function.d.ts +10 -0
  479. package/dist/icons/ph/function.js +11 -0
  480. package/dist/icons/ph/function.js.map +1 -0
  481. package/dist/icons/ph/funnel.d.ts +10 -0
  482. package/dist/icons/ph/funnel.js +11 -0
  483. package/dist/icons/ph/funnel.js.map +1 -0
  484. package/dist/icons/ph/gauge.d.ts +10 -0
  485. package/dist/icons/ph/gauge.js +11 -0
  486. package/dist/icons/ph/gauge.js.map +1 -0
  487. package/dist/icons/ph/gear.d.ts +10 -0
  488. package/dist/icons/ph/gear.js +11 -0
  489. package/dist/icons/ph/gear.js.map +1 -0
  490. package/dist/icons/ph/globe.d.ts +10 -0
  491. package/dist/icons/ph/globe.js +11 -0
  492. package/dist/icons/ph/globe.js.map +1 -0
  493. package/dist/icons/ph/hard-drives.d.ts +10 -0
  494. package/dist/icons/ph/hard-drives.js +11 -0
  495. package/dist/icons/ph/hard-drives.js.map +1 -0
  496. package/dist/icons/ph/hash.d.ts +10 -0
  497. package/dist/icons/ph/hash.js +11 -0
  498. package/dist/icons/ph/hash.js.map +1 -0
  499. package/dist/icons/ph/heart.d.ts +10 -0
  500. package/dist/icons/ph/heart.js +11 -0
  501. package/dist/icons/ph/heart.js.map +1 -0
  502. package/dist/icons/ph/house.d.ts +10 -0
  503. package/dist/icons/ph/house.js +11 -0
  504. package/dist/icons/ph/house.js.map +1 -0
  505. package/dist/icons/ph/image.d.ts +10 -0
  506. package/dist/icons/ph/image.js +11 -0
  507. package/dist/icons/ph/image.js.map +1 -0
  508. package/dist/icons/ph/info.d.ts +10 -0
  509. package/dist/icons/ph/info.js +11 -0
  510. package/dist/icons/ph/info.js.map +1 -0
  511. package/dist/icons/ph/key.d.ts +10 -0
  512. package/dist/icons/ph/key.js +11 -0
  513. package/dist/icons/ph/key.js.map +1 -0
  514. package/dist/icons/ph/keyboard.d.ts +10 -0
  515. package/dist/icons/ph/keyboard.js +11 -0
  516. package/dist/icons/ph/keyboard.js.map +1 -0
  517. package/dist/icons/ph/layout.d.ts +10 -0
  518. package/dist/icons/ph/layout.js +11 -0
  519. package/dist/icons/ph/layout.js.map +1 -0
  520. package/dist/icons/ph/link.d.ts +10 -0
  521. package/dist/icons/ph/link.js +11 -0
  522. package/dist/icons/ph/link.js.map +1 -0
  523. package/dist/icons/ph/list-bullets.d.ts +10 -0
  524. package/dist/icons/ph/list-bullets.js +11 -0
  525. package/dist/icons/ph/list-bullets.js.map +1 -0
  526. package/dist/icons/ph/list.d.ts +10 -0
  527. package/dist/icons/ph/list.js +11 -0
  528. package/dist/icons/ph/list.js.map +1 -0
  529. package/dist/icons/ph/lock.d.ts +10 -0
  530. package/dist/icons/ph/lock.js +11 -0
  531. package/dist/icons/ph/lock.js.map +1 -0
  532. package/dist/icons/ph/magnifying-glass.d.ts +10 -0
  533. package/dist/icons/ph/magnifying-glass.js +11 -0
  534. package/dist/icons/ph/magnifying-glass.js.map +1 -0
  535. package/dist/icons/ph/minus.d.ts +10 -0
  536. package/dist/icons/ph/minus.js +11 -0
  537. package/dist/icons/ph/minus.js.map +1 -0
  538. package/dist/icons/ph/monitor.d.ts +10 -0
  539. package/dist/icons/ph/monitor.js +11 -0
  540. package/dist/icons/ph/monitor.js.map +1 -0
  541. package/dist/icons/ph/moon.d.ts +10 -0
  542. package/dist/icons/ph/moon.js +11 -0
  543. package/dist/icons/ph/moon.js.map +1 -0
  544. package/dist/icons/ph/paper-plane-tilt.d.ts +10 -0
  545. package/dist/icons/ph/paper-plane-tilt.js +11 -0
  546. package/dist/icons/ph/paper-plane-tilt.js.map +1 -0
  547. package/dist/icons/ph/pencil-simple.d.ts +10 -0
  548. package/dist/icons/ph/pencil-simple.js +11 -0
  549. package/dist/icons/ph/pencil-simple.js.map +1 -0
  550. package/dist/icons/ph/plus.d.ts +10 -0
  551. package/dist/icons/ph/plus.js +11 -0
  552. package/dist/icons/ph/plus.js.map +1 -0
  553. package/dist/icons/ph/printer.d.ts +10 -0
  554. package/dist/icons/ph/printer.js +11 -0
  555. package/dist/icons/ph/printer.js.map +1 -0
  556. package/dist/icons/ph/pulse.d.ts +10 -0
  557. package/dist/icons/ph/pulse.js +11 -0
  558. package/dist/icons/ph/pulse.js.map +1 -0
  559. package/dist/icons/ph/push-pin.d.ts +10 -0
  560. package/dist/icons/ph/push-pin.js +11 -0
  561. package/dist/icons/ph/push-pin.js.map +1 -0
  562. package/dist/icons/ph/question.d.ts +10 -0
  563. package/dist/icons/ph/question.js +11 -0
  564. package/dist/icons/ph/question.js.map +1 -0
  565. package/dist/icons/ph/share-network.d.ts +10 -0
  566. package/dist/icons/ph/share-network.js +11 -0
  567. package/dist/icons/ph/share-network.js.map +1 -0
  568. package/dist/icons/ph/shield.d.ts +10 -0
  569. package/dist/icons/ph/shield.js +11 -0
  570. package/dist/icons/ph/shield.js.map +1 -0
  571. package/dist/icons/ph/sidebar-simple.d.ts +10 -0
  572. package/dist/icons/ph/sidebar-simple.js +11 -0
  573. package/dist/icons/ph/sidebar-simple.js.map +1 -0
  574. package/dist/icons/ph/sign-in.d.ts +10 -0
  575. package/dist/icons/ph/sign-in.js +11 -0
  576. package/dist/icons/ph/sign-in.js.map +1 -0
  577. package/dist/icons/ph/sign-out.d.ts +10 -0
  578. package/dist/icons/ph/sign-out.js +11 -0
  579. package/dist/icons/ph/sign-out.js.map +1 -0
  580. package/dist/icons/ph/sliders-horizontal.d.ts +10 -0
  581. package/dist/icons/ph/sliders-horizontal.js +11 -0
  582. package/dist/icons/ph/sliders-horizontal.js.map +1 -0
  583. package/dist/icons/ph/sort-ascending.d.ts +10 -0
  584. package/dist/icons/ph/sort-ascending.js +11 -0
  585. package/dist/icons/ph/sort-ascending.js.map +1 -0
  586. package/dist/icons/ph/sparkle.d.ts +10 -0
  587. package/dist/icons/ph/sparkle.js +11 -0
  588. package/dist/icons/ph/sparkle.js.map +1 -0
  589. package/dist/icons/ph/square.d.ts +10 -0
  590. package/dist/icons/ph/square.js +11 -0
  591. package/dist/icons/ph/square.js.map +1 -0
  592. package/dist/icons/ph/squares-four.d.ts +10 -0
  593. package/dist/icons/ph/squares-four.js +11 -0
  594. package/dist/icons/ph/squares-four.js.map +1 -0
  595. package/dist/icons/ph/stack.d.ts +10 -0
  596. package/dist/icons/ph/stack.js +11 -0
  597. package/dist/icons/ph/stack.js.map +1 -0
  598. package/dist/icons/ph/star.d.ts +10 -0
  599. package/dist/icons/ph/star.js +11 -0
  600. package/dist/icons/ph/star.js.map +1 -0
  601. package/dist/icons/ph/sun.d.ts +10 -0
  602. package/dist/icons/ph/sun.js +11 -0
  603. package/dist/icons/ph/sun.js.map +1 -0
  604. package/dist/icons/ph/tag.d.ts +10 -0
  605. package/dist/icons/ph/tag.js +11 -0
  606. package/dist/icons/ph/tag.js.map +1 -0
  607. package/dist/icons/ph/terminal-window.d.ts +10 -0
  608. package/dist/icons/ph/terminal-window.js +11 -0
  609. package/dist/icons/ph/terminal-window.js.map +1 -0
  610. package/dist/icons/ph/trash.d.ts +10 -0
  611. package/dist/icons/ph/trash.js +11 -0
  612. package/dist/icons/ph/trash.js.map +1 -0
  613. package/dist/icons/ph/trend-up.d.ts +10 -0
  614. package/dist/icons/ph/trend-up.js +11 -0
  615. package/dist/icons/ph/trend-up.js.map +1 -0
  616. package/dist/icons/ph/upload-simple.d.ts +10 -0
  617. package/dist/icons/ph/upload-simple.js +11 -0
  618. package/dist/icons/ph/upload-simple.js.map +1 -0
  619. package/dist/icons/ph/user.d.ts +10 -0
  620. package/dist/icons/ph/user.js +11 -0
  621. package/dist/icons/ph/user.js.map +1 -0
  622. package/dist/icons/ph/users.d.ts +10 -0
  623. package/dist/icons/ph/users.js +11 -0
  624. package/dist/icons/ph/users.js.map +1 -0
  625. package/dist/icons/ph/warning-circle.d.ts +10 -0
  626. package/dist/icons/ph/warning-circle.js +11 -0
  627. package/dist/icons/ph/warning-circle.js.map +1 -0
  628. package/dist/icons/ph/warning.d.ts +10 -0
  629. package/dist/icons/ph/warning.js +11 -0
  630. package/dist/icons/ph/warning.js.map +1 -0
  631. package/dist/icons/ph/x-circle.d.ts +10 -0
  632. package/dist/icons/ph/x-circle.js +11 -0
  633. package/dist/icons/ph/x-circle.js.map +1 -0
  634. package/dist/icons/ph/x.d.ts +10 -0
  635. package/dist/icons/ph/x.js +11 -0
  636. package/dist/icons/ph/x.js.map +1 -0
  637. package/dist/icons/store.d.ts +6 -0
  638. package/dist/icons/store.js +77 -0
  639. package/dist/icons/store.js.map +1 -0
  640. package/dist/index.d.ts +86 -2293
  641. package/dist/index.js +82 -13349
  642. package/dist/internal/Field.js +74 -0
  643. package/dist/internal/Field.js.map +1 -0
  644. package/dist/internal/FloatingPanel.js +41 -0
  645. package/dist/internal/FloatingPanel.js.map +1 -0
  646. package/dist/internal/chart.js +131 -0
  647. package/dist/internal/chart.js.map +1 -0
  648. package/dist/internal/dev.js +21 -0
  649. package/dist/internal/dev.js.map +1 -0
  650. package/dist/internal/focus.js +94 -0
  651. package/dist/internal/focus.js.map +1 -0
  652. package/dist/internal/focusMain.d.ts +4 -0
  653. package/dist/internal/focusMain.js +22 -0
  654. package/dist/internal/focusMain.js.map +1 -0
  655. package/dist/internal/scrollHint.js +78 -0
  656. package/dist/internal/scrollHint.js.map +1 -0
  657. package/dist/internal/tableTools.js +114 -0
  658. package/dist/internal/tableTools.js.map +1 -0
  659. package/dist/internal/terms.d.ts +18 -0
  660. package/dist/internal/terms.js +64 -0
  661. package/dist/internal/terms.js.map +1 -0
  662. package/dist/internal/util.js +107 -0
  663. package/dist/internal/util.js.map +1 -0
  664. package/dist/motion.d.ts +5 -0
  665. package/dist/motion.js +29 -0
  666. package/dist/motion.js.map +1 -0
  667. package/dist/styles.css +4280 -4265
  668. package/dist/theme.d.ts +20 -0
  669. package/dist/theme.js +210 -0
  670. package/dist/theme.js.map +1 -0
  671. package/dist/tokens.css +4 -0
  672. package/docs/guidelines.md +1 -0
  673. package/docs/theme.md +51 -0
  674. package/package.json +5 -4
  675. package/dist/format-entry-CgMBtkni.d.ts +0 -79
  676. package/dist/format-entry-CyChe8bk.js.map +0 -1
  677. package/dist/index.js.map +0 -1
@@ -0,0 +1,20 @@
1
+ export type ThemeSetting = 'auto' | 'light' | 'dark';
2
+ /** Switches the theme on <html data-theme> and remembers it. */
3
+ export declare function setTheme(t: ThemeSetting): void;
4
+ /** Derives every accent token from one color (自訂強調色的換算 in docs/theme.md).
5
+ * Returns false for anything but #rrggbb. quiet: apply without storing. */
6
+ export declare function setAccent(hex: string, quiet?: boolean): boolean;
7
+ /** Applies the stored theme and accent; call once when the page starts. */
8
+ export declare function initTheme(): void;
9
+ /** The text color for something drawn on a fill (a heat-scale zone, a status band): the near-black ink of the light
10
+ * theme (#171512) or white, whichever contrasts more with the fill. `fill` is a color (#hex, rgb()) or a token name
11
+ * such as 'heat-6', read from el (default: the root) so it follows the theme. Every step of heat-*, diverge-* and
12
+ * chart-* reaches 4.5:1 with its pick. Unreadable colors give the near-black ink. */
13
+ export declare function textOn(fill: string, el?: Element): '#171512' | '#ffffff';
14
+ /** The heat-scale token for a value: min (or below) is heat-1, max (or above) is heat-7, evenly in between. */
15
+ export declare function heatToken(value: number, min: number, max: number): `heat-${1 | 2 | 3 | 4 | 5 | 6 | 7}`;
16
+ /** The diverging-scale token for a difference: within ±zero it is diverge-zero; from ±strong on, the -strong step. */
17
+ export declare function divergeToken(diff: number, limits: {
18
+ zero: number;
19
+ strong: number;
20
+ }): 'diverge-neg-strong' | 'diverge-neg' | 'diverge-zero' | 'diverge-pos' | 'diverge-pos-strong';
package/dist/theme.js ADDED
@@ -0,0 +1,210 @@
1
+ "use client";
2
+ import { ensureAnnouncer } from "./announce.js";
3
+ import { reduced, store } from "./internal/util.js";
4
+ // src/theme.ts
5
+ const THEME_KEY = "ui-theme";
6
+ const ACCENT_KEY = "ui-accent";
7
+ const DEFAULT_ACCENT = "#2457d6";
8
+ const isSetting = (v) => v === "auto" || v === "light" || v === "dark";
9
+ /** The stored theme setting, 'auto' when there is none. */
10
+ function storedTheme() {
11
+ const v = store(THEME_KEY);
12
+ return isSetting(v) ? v : "auto";
13
+ }
14
+ function resolveTheme(t) {
15
+ if (t !== "auto") return t;
16
+ return typeof window.matchMedia === "function" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
17
+ }
18
+ let fadeTimer;
19
+ /** Switches the theme on <html data-theme> and remembers it. */
20
+ function setTheme(t) {
21
+ const root = document.documentElement;
22
+ if (!reduced()) {
23
+ root.classList.add("ui-theme-fade");
24
+ clearTimeout(fadeTimer);
25
+ fadeTimer = setTimeout(() => root.classList.remove("ui-theme-fade"), 320);
26
+ }
27
+ root.setAttribute("data-theme", resolveTheme(t));
28
+ root.setAttribute("data-theme-setting", t);
29
+ store(THEME_KEY, t);
30
+ setAccent(storedAccent(), true);
31
+ }
32
+ /** Swatches whose color changed so they read as text on every ground: a stored old value moves to the new one. */
33
+ const RENAMED_SWATCHES = {
34
+ "#8a4fd6": "#864ad1",
35
+ "#c2407a": "#ba3873",
36
+ "#cd3a2f": "#c53228",
37
+ "#b85a0e": "#ab5101",
38
+ "#1a844a": "#077b42",
39
+ "#0e827d": "#027874"
40
+ };
41
+ /** The stored accent, with an old swatch value moved to its current one (and stored again). */
42
+ function storedAccent() {
43
+ const v = store(ACCENT_KEY);
44
+ if (!v) return DEFAULT_ACCENT;
45
+ const now = RENAMED_SWATCHES[v.toLowerCase()];
46
+ if (now) store(ACCENT_KEY, now);
47
+ return now ?? v;
48
+ }
49
+ const hexRgb = (x) => [
50
+ 1,
51
+ 3,
52
+ 5
53
+ ].map((i) => parseInt(x.slice(i, i + 2), 16));
54
+ /** A CSS color as #rrggbb: #rgb, #rgba, #rrggbb, #rrggbbaa (alpha dropped), rgb() and rgba() with commas or spaces.
55
+ * null for anything else (a name, a var(), an empty value). Bundlers shorten #ffffff to #fff in tokens.css, so the
56
+ * short form must read the same. */
57
+ function toHex(c) {
58
+ const v = c.trim().toLowerCase();
59
+ const short = /^#([0-9a-f])([0-9a-f])([0-9a-f])[0-9a-f]?$/.exec(v);
60
+ if (short) return "#" + short[1] + short[1] + short[2] + short[2] + short[3] + short[3];
61
+ const long = /^#([0-9a-f]{6})(?:[0-9a-f]{2})?$/.exec(v);
62
+ if (long) return "#" + long[1];
63
+ const fn = /^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/.exec(v);
64
+ if (fn) {
65
+ const n = fn.slice(1, 4).map(Number);
66
+ if (n.every((x) => x >= 0 && x <= 255)) return "#" + n.map((x) => Math.round(x).toString(16).padStart(2, "0")).join("");
67
+ }
68
+ return null;
69
+ }
70
+ function mixHex(a, b, t) {
71
+ const p = hexRgb(a);
72
+ const q = hexRgb(b);
73
+ return "#" + p.map((v, i) => Math.round(v + (q[i] - v) * t).toString(16).padStart(2, "0")).join("");
74
+ }
75
+ function lum(x) {
76
+ const w = [
77
+ .2126,
78
+ .7152,
79
+ .0722
80
+ ];
81
+ return hexRgb(x).map((v) => {
82
+ v /= 255;
83
+ return v <= .03928 ? v / 12.92 : ((v + .055) / 1.055) ** 2.4;
84
+ }).reduce((s, v, i) => s + v * w[i], 0);
85
+ }
86
+ function contrast(a, b) {
87
+ const x = lum(a);
88
+ const y = lum(b);
89
+ return (Math.max(x, y) + .05) / (Math.min(x, y) + .05);
90
+ }
91
+ /** The accent's text color (accent-text, and the focus outline): the accent itself when it reads (4.5:1) on bg,
92
+ * surface and every extra ground passed (setAccent passes surface-sub, surface-chrome and accent-soft); else, in
93
+ * light, the accent mixed with black 4 % at a time, in dark with white 5 % at a time, until it reads on all of them. */
94
+ function accentText(hex, dark, bg, surface, ...grounds) {
95
+ const all = [
96
+ bg,
97
+ surface,
98
+ ...grounds
99
+ ].map(toHex);
100
+ if (all.some((g) => !g)) return hex;
101
+ const reads = (c) => all.every((g) => contrast(c, g) >= 4.5);
102
+ const toward = dark ? "#ffffff" : "#000000";
103
+ const step = dark ? .05 : .04;
104
+ let text = hex;
105
+ for (let k = 1; k * step <= 1 && !reads(text); k++) text = mixHex(hex, toward, k * step);
106
+ return text;
107
+ }
108
+ const INK = "#171512";
109
+ /** The text on an accent fill (on-accent): white or the near-black ink (#171512), whichever contrasts more. */
110
+ function onFill(fill) {
111
+ return contrast("#ffffff", fill) >= contrast(INK, fill) ? "#ffffff" : INK;
112
+ }
113
+ /** The accent's fill color (accent: buttons, switches, progress, selected marks): the accent itself when it reaches
114
+ * 3:1 on bg, surface and every extra ground passed (setAccent passes surface-sub, surface-chrome and accent-soft) and
115
+ * its on-accent text reaches 4.5:1 on it; else, in light, the accent mixed with black 4 % at a time, in dark with
116
+ * white 5 % at a time, until both hold. The preset swatches pass in light as they are. */
117
+ function accentFill(hex, dark, bg, surface, ...grounds) {
118
+ const all = [
119
+ bg,
120
+ surface,
121
+ ...grounds
122
+ ].map(toHex);
123
+ if (all.some((g) => !g)) return hex;
124
+ const ok = (c) => all.every((g) => contrast(c, g) >= 3) && contrast(onFill(c), c) >= 4.5;
125
+ const toward = dark ? "#ffffff" : "#000000";
126
+ const step = dark ? .05 : .04;
127
+ let fill = hex;
128
+ for (let k = 1; k * step <= 1 && !ok(fill); k++) fill = mixHex(hex, toward, k * step);
129
+ return fill;
130
+ }
131
+ /** The preset swatches of AccentPicker. In light (and the teaching preset) each one reads as text by itself (4.5:1 on
132
+ * bg, surface, surface-sub, surface-chrome and its own accent-soft), so accentText returns it unchanged; white text
133
+ * reads on it (4.5:1). In dark, accentText lightens it. Checked in tokens-contrast.test.tsx. */
134
+ const ACCENT_SWATCHES = [
135
+ ["藍", "#2457d6"],
136
+ ["靛", "#5b4fd6"],
137
+ ["紫", "#864ad1"],
138
+ ["桃紅", "#ba3873"],
139
+ ["紅", "#c53228"],
140
+ ["橘", "#ab5101"],
141
+ ["綠", "#077b42"],
142
+ ["青", "#027874"]
143
+ ];
144
+ /** Derives every accent token from one color (自訂強調色的換算 in docs/theme.md).
145
+ * Returns false for anything but #rrggbb. quiet: apply without storing. */
146
+ function setAccent(hex, quiet = false) {
147
+ if (!/^#[0-9a-fA-F]{6}$/.test(hex)) return false;
148
+ hex = hex.toLowerCase();
149
+ const root = document.documentElement;
150
+ const dark = root.getAttribute("data-theme") === "dark";
151
+ const cs = getComputedStyle(root);
152
+ const surface = toHex(cs.getPropertyValue("--surface")) ?? (dark ? "#393530" : "#ffffff");
153
+ const bg = toHex(cs.getPropertyValue("--bg")) ?? (dark ? "#2f2a25" : "#fcfbfb");
154
+ const sub = toHex(cs.getPropertyValue("--surface-sub")) ?? (dark ? "#443f3b" : "#f6f5f4");
155
+ const chrome = toHex(cs.getPropertyValue("--surface-chrome")) ?? (dark ? "#3d3834" : "#ffffff");
156
+ const soft = dark ? mixHex(surface, hex, .22) : mixHex("#ffffff", hex, .12);
157
+ const text = accentText(hex, dark, bg, surface, sub, chrome, soft);
158
+ const fill = accentFill(hex, dark, bg, surface, sub, chrome, soft);
159
+ const away = dark ? "#ffffff" : "#000000";
160
+ const vars = {
161
+ "--accent": fill,
162
+ "--accent-hover": mixHex(fill, away, .12),
163
+ "--accent-press": mixHex(fill, away, .22),
164
+ "--accent-soft": soft,
165
+ "--accent-text": text,
166
+ "--on-accent": onFill(fill),
167
+ "--focus": text,
168
+ "--focus-ring": text
169
+ };
170
+ for (const [k, v] of Object.entries(vars)) root.style.setProperty(k, v);
171
+ if (!quiet) store(ACCENT_KEY, hex);
172
+ return true;
173
+ }
174
+ let following = false;
175
+ /** Applies the stored theme and accent; call once when the page starts. */
176
+ function initTheme() {
177
+ setTheme(storedTheme());
178
+ ensureAnnouncer();
179
+ if (following || typeof window.matchMedia !== "function") return;
180
+ following = true;
181
+ window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
182
+ if (storedTheme() === "auto") setTheme("auto");
183
+ });
184
+ }
185
+ /** The text color for something drawn on a fill (a heat-scale zone, a status band): the near-black ink of the light
186
+ * theme (#171512) or white, whichever contrasts more with the fill. `fill` is a color (#hex, rgb()) or a token name
187
+ * such as 'heat-6', read from el (default: the root) so it follows the theme. Every step of heat-*, diverge-* and
188
+ * chart-* reaches 4.5:1 with its pick. Unreadable colors give the near-black ink. */
189
+ function textOn(fill, el) {
190
+ let c = fill.trim();
191
+ if (/^[a-z][a-z0-9-]*$/.test(c) && typeof document !== "undefined") c = getComputedStyle(el ?? document.documentElement).getPropertyValue("--" + c);
192
+ const hex = toHex(c);
193
+ if (!hex) return "#171512";
194
+ return contrast(hex, "#171512") >= contrast(hex, "#ffffff") ? "#171512" : "#ffffff";
195
+ }
196
+ /** The heat-scale token for a value: min (or below) is heat-1, max (or above) is heat-7, evenly in between. */
197
+ function heatToken(value, min, max) {
198
+ const t = max > min ? (value - min) / (max - min) : 0;
199
+ return `heat-${Math.min(7, Math.max(1, Math.round(t * 6) + 1))}`;
200
+ }
201
+ /** The diverging-scale token for a difference: within ±zero it is diverge-zero; from ±strong on, the -strong step. */
202
+ function divergeToken(diff, limits) {
203
+ const a = Math.abs(diff);
204
+ if (a <= limits.zero) return "diverge-zero";
205
+ const strong = a >= limits.strong;
206
+ return diff < 0 ? strong ? "diverge-neg-strong" : "diverge-neg" : strong ? "diverge-pos-strong" : "diverge-pos";
207
+ }
208
+ export { ACCENT_KEY, ACCENT_SWATCHES, DEFAULT_ACCENT, accentFill, accentText, divergeToken, heatToken, initTheme, onFill, setAccent, setTheme, storedAccent, storedTheme, textOn, toHex };
209
+
210
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","names":[],"sources":["../src/theme.ts"],"sourcesContent":["import { ensureAnnouncer } from './announce';\nimport { reduced, store } from './internal/util';\n\n/* Theme and accent color. 'auto' follows prefers-color-scheme; colors cross-fade for 300 ms on a change.\n The choice is kept in localStorage, so initTheme() on the next visit restores it. */\n\nexport type ThemeSetting = 'auto' | 'light' | 'dark';\n\nconst THEME_KEY = 'ui-theme';\nexport const ACCENT_KEY = 'ui-accent';\nexport const DEFAULT_ACCENT = '#2457d6';\n\nconst isSetting = (v: string | null): v is ThemeSetting => v === 'auto' || v === 'light' || v === 'dark';\n\n/** The stored theme setting, 'auto' when there is none. */\nexport function storedTheme(): ThemeSetting {\n const v = store(THEME_KEY);\n return isSetting(v) ? v : 'auto';\n}\n\nfunction resolveTheme(t: ThemeSetting): 'light' | 'dark' {\n if (t !== 'auto') return t;\n return typeof window.matchMedia === 'function' && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n}\n\nlet fadeTimer: ReturnType<typeof setTimeout> | undefined;\n\n/** Switches the theme on <html data-theme> and remembers it. */\nexport function setTheme(t: ThemeSetting): void {\n const root = document.documentElement;\n if (!reduced()) {\n root.classList.add('ui-theme-fade');\n clearTimeout(fadeTimer);\n fadeTimer = setTimeout(() => root.classList.remove('ui-theme-fade'), 320);\n }\n root.setAttribute('data-theme', resolveTheme(t));\n root.setAttribute('data-theme-setting', t);\n store(THEME_KEY, t);\n // The accent's text and soft colors depend on the theme.\n setAccent(storedAccent(), true);\n}\n\n/** Swatches whose color changed so they read as text on every ground: a stored old value moves to the new one. */\nconst RENAMED_SWATCHES: Record<string, string> = {\n '#8a4fd6': '#864ad1',\n '#c2407a': '#ba3873',\n '#cd3a2f': '#c53228',\n '#b85a0e': '#ab5101',\n '#1a844a': '#077b42',\n '#0e827d': '#027874',\n};\n\n/** The stored accent, with an old swatch value moved to its current one (and stored again). */\nexport function storedAccent(): string {\n const v = store(ACCENT_KEY);\n if (!v) return DEFAULT_ACCENT;\n const now = RENAMED_SWATCHES[v.toLowerCase()];\n if (now) store(ACCENT_KEY, now);\n return now ?? v;\n}\n\nconst hexRgb = (x: string): number[] => [1, 3, 5].map((i) => parseInt(x.slice(i, i + 2), 16));\n\n/** A CSS color as #rrggbb: #rgb, #rgba, #rrggbb, #rrggbbaa (alpha dropped), rgb() and rgba() with commas or spaces.\n * null for anything else (a name, a var(), an empty value). Bundlers shorten #ffffff to #fff in tokens.css, so the\n * short form must read the same. */\nexport function toHex(c: string): string | null {\n const v = c.trim().toLowerCase();\n const short = /^#([0-9a-f])([0-9a-f])([0-9a-f])[0-9a-f]?$/.exec(v);\n if (short) return '#' + short[1] + short[1] + short[2] + short[2] + short[3] + short[3];\n const long = /^#([0-9a-f]{6})(?:[0-9a-f]{2})?$/.exec(v);\n if (long) return '#' + long[1];\n const fn = /^rgba?\\(\\s*([\\d.]+)[\\s,]+([\\d.]+)[\\s,]+([\\d.]+)(?:\\s*[,/]\\s*[\\d.]+%?)?\\s*\\)$/.exec(v);\n if (fn) {\n const n = fn.slice(1, 4).map(Number);\n if (n.every((x) => x >= 0 && x <= 255)) return '#' + n.map((x) => Math.round(x).toString(16).padStart(2, '0')).join('');\n }\n return null;\n}\n\nfunction mixHex(a: string, b: string, t: number): string {\n const p = hexRgb(a);\n const q = hexRgb(b);\n return (\n '#' +\n p\n .map((v, i) =>\n Math.round(v + (q[i] - v) * t)\n .toString(16)\n .padStart(2, '0'),\n )\n .join('')\n );\n}\n\nfunction lum(x: string): number {\n const w = [0.2126, 0.7152, 0.0722];\n return hexRgb(x)\n .map((v) => {\n v /= 255;\n return v <= 0.03928 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;\n })\n .reduce((s, v, i) => s + v * w[i], 0);\n}\n\nfunction contrast(a: string, b: string): number {\n const x = lum(a);\n const y = lum(b);\n return (Math.max(x, y) + 0.05) / (Math.min(x, y) + 0.05);\n}\n\n/** The accent's text color (accent-text, and the focus outline): the accent itself when it reads (4.5:1) on bg,\n * surface and every extra ground passed (setAccent passes surface-sub, surface-chrome and accent-soft); else, in\n * light, the accent mixed with black 4 % at a time, in dark with white 5 % at a time, until it reads on all of them. */\nexport function accentText(hex: string, dark: boolean, bg: string, surface: string, ...grounds: string[]): string {\n const all = [bg, surface, ...grounds].map(toHex);\n // A background that cannot be read: keep the accent itself rather than mixing it toward black or white blindly.\n if (all.some((g) => !g)) return hex;\n const reads = (c: string) => all.every((g) => contrast(c, g as string) >= 4.5);\n const toward = dark ? '#ffffff' : '#000000';\n const step = dark ? 0.05 : 0.04;\n let text = hex;\n for (let k = 1; k * step <= 1 && !reads(text); k++) text = mixHex(hex, toward, k * step);\n return text;\n}\n\nconst INK = '#171512';\n\n/** The text on an accent fill (on-accent): white or the near-black ink (#171512), whichever contrasts more. */\nexport function onFill(fill: string): '#ffffff' | '#171512' {\n return contrast('#ffffff', fill) >= contrast(INK, fill) ? '#ffffff' : INK;\n}\n\n/** The accent's fill color (accent: buttons, switches, progress, selected marks): the accent itself when it reaches\n * 3:1 on bg, surface and every extra ground passed (setAccent passes surface-sub, surface-chrome and accent-soft) and\n * its on-accent text reaches 4.5:1 on it; else, in light, the accent mixed with black 4 % at a time, in dark with\n * white 5 % at a time, until both hold. The preset swatches pass in light as they are. */\nexport function accentFill(hex: string, dark: boolean, bg: string, surface: string, ...grounds: string[]): string {\n const all = [bg, surface, ...grounds].map(toHex);\n if (all.some((g) => !g)) return hex;\n const ok = (c: string) => all.every((g) => contrast(c, g as string) >= 3) && contrast(onFill(c), c) >= 4.5;\n const toward = dark ? '#ffffff' : '#000000';\n const step = dark ? 0.05 : 0.04;\n let fill = hex;\n for (let k = 1; k * step <= 1 && !ok(fill); k++) fill = mixHex(hex, toward, k * step);\n return fill;\n}\n\n/** The preset swatches of AccentPicker. In light (and the teaching preset) each one reads as text by itself (4.5:1 on\n * bg, surface, surface-sub, surface-chrome and its own accent-soft), so accentText returns it unchanged; white text\n * reads on it (4.5:1). In dark, accentText lightens it. Checked in tokens-contrast.test.tsx. */\nexport const ACCENT_SWATCHES: readonly (readonly [name: string, hex: string])[] = [\n ['藍', '#2457d6'],\n ['靛', '#5b4fd6'],\n ['紫', '#864ad1'],\n ['桃紅', '#ba3873'],\n ['紅', '#c53228'],\n ['橘', '#ab5101'],\n ['綠', '#077b42'],\n ['青', '#027874'],\n];\n\n/** Derives every accent token from one color (自訂強調色的換算 in docs/theme.md).\n * Returns false for anything but #rrggbb. quiet: apply without storing. */\nexport function setAccent(hex: string, quiet = false): boolean {\n if (!/^#[0-9a-fA-F]{6}$/.test(hex)) return false;\n hex = hex.toLowerCase();\n const root = document.documentElement;\n const dark = root.getAttribute('data-theme') === 'dark';\n const cs = getComputedStyle(root);\n // Read the theme's colors as #rrggbb (bundlers may have shortened #ffffff to #fff); the theme's defaults when unset.\n const surface = toHex(cs.getPropertyValue('--surface')) ?? (dark ? '#393530' : '#ffffff');\n const bg = toHex(cs.getPropertyValue('--bg')) ?? (dark ? '#2f2a25' : '#fcfbfb');\n const sub = toHex(cs.getPropertyValue('--surface-sub')) ?? (dark ? '#443f3b' : '#f6f5f4');\n const chrome = toHex(cs.getPropertyValue('--surface-chrome')) ?? (dark ? '#3d3834' : '#ffffff');\n const soft = dark ? mixHex(surface, hex, 0.22) : mixHex('#ffffff', hex, 0.12);\n // Text in the accent also sits on zebra rows, code blocks, the top bar and its own soft fill (a selected row).\n const text = accentText(hex, dark, bg, surface, sub, chrome, soft);\n // The fill reaches 3:1 on the same grounds (a checked box in a selected row); hover and press go away from the page:\n // darker in light, lighter in dark, so they keep 3:1 and their text.\n const fill = accentFill(hex, dark, bg, surface, sub, chrome, soft);\n const away = dark ? '#ffffff' : '#000000';\n const vars: Record<string, string> = {\n '--accent': fill,\n '--accent-hover': mixHex(fill, away, 0.12),\n '--accent-press': mixHex(fill, away, 0.22),\n '--accent-soft': soft,\n '--accent-text': text,\n '--on-accent': onFill(fill),\n // One focus style everywhere: a 2 px outline in the accent's text color, 3:1 or more on every ground.\n '--focus': text,\n // Old name of --focus, kept for pages written before it.\n '--focus-ring': text,\n };\n for (const [k, v] of Object.entries(vars)) root.style.setProperty(k, v);\n if (!quiet) store(ACCENT_KEY, hex);\n return true;\n}\n\nlet following = false;\n\n/** Applies the stored theme and accent; call once when the page starts. */\nexport function initTheme(): void {\n setTheme(storedTheme());\n ensureAnnouncer();\n if (following || typeof window.matchMedia !== 'function') return;\n following = true;\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {\n if (storedTheme() === 'auto') setTheme('auto');\n });\n}\n\n/** The text color for something drawn on a fill (a heat-scale zone, a status band): the near-black ink of the light\n * theme (#171512) or white, whichever contrasts more with the fill. `fill` is a color (#hex, rgb()) or a token name\n * such as 'heat-6', read from el (default: the root) so it follows the theme. Every step of heat-*, diverge-* and\n * chart-* reaches 4.5:1 with its pick. Unreadable colors give the near-black ink. */\nexport function textOn(fill: string, el?: Element): '#171512' | '#ffffff' {\n let c = fill.trim();\n if (/^[a-z][a-z0-9-]*$/.test(c) && typeof document !== 'undefined') c = getComputedStyle(el ?? document.documentElement).getPropertyValue('--' + c);\n const hex = toHex(c);\n if (!hex) return '#171512';\n return contrast(hex, '#171512') >= contrast(hex, '#ffffff') ? '#171512' : '#ffffff';\n}\n\n/** The heat-scale token for a value: min (or below) is heat-1, max (or above) is heat-7, evenly in between. */\nexport function heatToken(value: number, min: number, max: number): `heat-${1 | 2 | 3 | 4 | 5 | 6 | 7}` {\n const t = max > min ? (value - min) / (max - min) : 0;\n const step = Math.min(7, Math.max(1, Math.round(t * 6) + 1)) as 1 | 2 | 3 | 4 | 5 | 6 | 7;\n return `heat-${step}`;\n}\n\n/** The diverging-scale token for a difference: within ±zero it is diverge-zero; from ±strong on, the -strong step. */\nexport function divergeToken(\n diff: number,\n limits: { zero: number; strong: number },\n): 'diverge-neg-strong' | 'diverge-neg' | 'diverge-zero' | 'diverge-pos' | 'diverge-pos-strong' {\n const a = Math.abs(diff);\n if (a <= limits.zero) return 'diverge-zero';\n const strong = a >= limits.strong;\n return diff < 0 ? (strong ? 'diverge-neg-strong' : 'diverge-neg') : strong ? 'diverge-pos-strong' : 'diverge-pos';\n}\n"],"mappings":";;;;AAQA,MAAM,YAAY;AAClB,MAAa,aAAa;AAC1B,MAAa,iBAAiB;AAE9B,MAAM,aAAa,MAAwC,MAAM,UAAU,MAAM,WAAW,MAAM;;AAGlG,SAAgB,cAA4B;CAC1C,MAAM,IAAI,MAAM,SAAS;CACzB,OAAO,UAAU,CAAC,IAAI,IAAI;AAC5B;AAEA,SAAS,aAAa,GAAmC;CACvD,IAAI,MAAM,QAAQ,OAAO;CACzB,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AC,KAAK,OAAO,aAAa,aAAa,IAAI,iBAAiB,MAAM,SAAS,eAAe,CAAC,CAAC,iBAAiB,OAAO,CAAC;CAClJ,MAAM,MAAM,MAAM,CAAC;CACnB,IAAI,CAAC,KAAK,OAAO;CACjB,OAAO,SAAS,KAAK,SAAS,KAAK,SAAS,KAAK,SAAS,IAAI,YAAY;AAC5E;;AAGA,SAAgB,UAAU,OAAe,KAAa,KAAkD;CACtG,MAAM,IAAI,MAAM,OAAO,QAAQ,QAAQ,MAAM,OAAO;CAEpD,OAAO,QADM,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,MAAM,IAAI,CAAC,IAAI,CAAC,CACxC;AACpB;;AAGA,SAAgB,aACd,MACA,QAC8F;CAC9F,MAAM,IAAI,KAAK,IAAI,IAAI;CACvB,IAAI,KAAK,OAAO,MAAM,OAAO;CAC7B,MAAM,SAAS,KAAK,OAAO;CAC3B,OAAO,OAAO,IAAK,SAAS,uBAAuB,gBAAiB,SAAS,uBAAuB;AACtG"}
package/dist/tokens.css CHANGED
@@ -1,4 +1,7 @@
1
1
  /* Generated from tokens.json by scripts/build.ts. Do not edit by hand. */
2
+ @layer theme, base, ui, components, utilities;
3
+ @layer ui.tokens, ui.components;
4
+ @layer ui.tokens {
2
5
  :root {
3
6
  --bg: #fcfbfb;
4
7
  --surface: #ffffff;
@@ -228,3 +231,4 @@
228
231
  --shadow-card: none;
229
232
  --shadow-card-hover: none;
230
233
  }
234
+ }
@@ -18,6 +18,7 @@
18
18
  - 強調色預設 `#2457d6`,使用者可以自訂;中量使用:主要按鈕、連結、圖示、標籤與選取狀態。
19
19
  - 卡片用陰影分層。卡片裡不放卡片:區塊用 `Card`,卡片裡再分區用 `surface-sub` 底色或分隔線。
20
20
  - 自己的 CSS 只用 token(`var(--surface)`、`var(--space-4)`;Tailwind 用 `bg-surface`、`text-ink-muted`),不用 Tailwind 內建的顏色、圓角和陰影。強調色的文字讀 `accent-text`,不讀 `accent`。
21
+ - 設計系統的 CSS 在 layer `ui` 裡,頁面不加 layer 的 CSS 一定蓋過元件,不必提高 specificity 或加 `!important`;Tailwind 的順序寫法見 [theme.md](theme.md)。
21
22
  - 密度緊密,區塊間距 `space-8` 32 px;圓角 `radius-xs` 4 px(行內程式碼、鍵帽、分段控制)、`radius-sm` 6 px、`radius-md` 10 px、`radius-lg` 14 px。
22
23
 
23
24
  ## 字體與圖示
package/docs/theme.md CHANGED
@@ -48,6 +48,55 @@
48
48
  - 非文字:`line-strong`、狀態記號(`*-text`、`ink-muted`)在上述底色與表格的列上達 3:1;`success`、`warning`、`danger` 的實色在 `accent-soft` 以外的底色與表格的列上達 3:1;`chart-1` 到 `chart-4` 在 `bg`、`surface`、`surface-sub`、`surface-chrome` 上達 3:1。
49
49
  - 選中分頁的白底加框不在這個測試裡。
50
50
 
51
+ ## CSS 層與覆寫元件樣式
52
+
53
+ 設計系統的 CSS 全部在 cascade layer `ui` 裡:`tokens.css` 在 `ui.tokens`,`styles.css` 在 `ui.components`。頁面自己的 CSS 不放進 layer 就一定贏,不必比 specificity,也不必加 `!important`:
54
+
55
+ ```css
56
+ /* 頁面的 CSS,不加 @layer:蓋過元件的 .ui-btn-primary */
57
+ .save-btn {
58
+ background: var(--success);
59
+ }
60
+ :root {
61
+ --accent: #0e827d; /* 也蓋過 tokens.css,不論檔案先後、不論 data-theme */
62
+ }
63
+ ```
64
+
65
+ - Tailwind v4:在主要 CSS 檔的最前面、`@import 'tailwindcss'` 之前寫一行順序,utility class 就能蓋過元件,Tailwind 的 preflight(`base`)不會蓋掉元件:
66
+
67
+ ```css
68
+ @layer theme, base, ui, components, utilities;
69
+ @import 'tailwindcss';
70
+ @import '@seanyeh77/tokens/tailwind.css';
71
+ ```
72
+
73
+ 沒寫這一行、又先載入 Tailwind 時,`ui` 排在 `utilities` 之後:元件蓋過 utility class,和沒有 layer 時一樣。`tokens.css` 和 `styles.css` 開頭也宣告同一個順序,所以先載入設計系統時不寫也一樣。
74
+ - 頁面自己的 CSS 放在 layer 裡時,那個 layer 要排在 `ui` 之後才會贏;排在前面(例如先宣告的 `@layer reset`)的規則會輸給元件。
75
+ - 全域的重設 CSS 也一樣會贏:reset、normalize、CMS 或專案範本附的 CSS(例如 `* { margin: 0; padding: 0; border: 0 }`、`button { background: none }`)沒放進 layer 時,會洗掉每個元件的間距、邊框和背景。這類規則放進 `@layer base { … }`(或其他排在 `ui` 之前的 layer);Vite 等範本產生的 `index.css`、`App.css` 直接刪掉。`ui check` 會列出沒有 layer、用元素或 `*` 選擇器、又蓋過元件宣告的規則。
76
+ - 元件 CSS 裡的 `!important` 在 layer 中比沒有 layer 的 `!important` 優先:要蓋過這些宣告,改用沒有 `!important` 的頁面規則蓋過元件的其他規則,或在 `ui` 之前的 layer 寫 `!important`。
77
+
78
+ ### 只載入用到的元件的 CSS
79
+
80
+ `styles.css`(約 200 KB,gzip 後約 39 KB;bundler 壓縮後約 148 KB、gzip 約 25 KB)是預設的載法。很在意大小的專案可以改用 `@seanyeh77/ui/css/` 裡的分檔:寫一個 CSS 入口檔,依序 `@import` `base.css`、用到的每個元件的檔案、`end.css`,JavaScript 只 import 這一個檔。
81
+
82
+ ```css
83
+ /* src/ui.css */
84
+ @import '@seanyeh77/ui/css/base.css'; /* 最前面:共用的基礎、表單欄位、圖表、動畫 */
85
+ @import '@seanyeh77/ui/css/Button.css'; /* 用到的元件,一個一行 */
86
+ @import '@seanyeh77/ui/css/DataTable.css';
87
+ @import '@seanyeh77/ui/css/end.css'; /* 最後面:觸控目標、焦點外框、浮動層等蓋在元件上的規則 */
88
+ ```
89
+
90
+ ```ts
91
+ import '@seanyeh77/ui/fonts.css';
92
+ import '@seanyeh77/ui/tokens.css';
93
+ import './ui.css';
94
+ ```
95
+
96
+ - 每個元件的檔案用 `@import` 帶入它畫出或借用樣式的其他元件的檔案(例如 `DataTable.css` 帶入 `Button.css`),排在自己前面,所以只列頁面直接用到的元件就夠了。沒有自己樣式的元件(`TextField`、`LineChart`)也有檔案,只帶入它們用到的元件。
97
+ - 同一個檔被帶入兩次時,bundler 展開 `@import` 的方式決定留哪一份:postcss-import(Vite 預設)留第一份,esbuild 和瀏覽器直接載入時以最後一份為準。所以元件之間的先後不保證和 `styles.css` 完全相同;要完全相同就用 `styles.css`。
98
+ - 不要用好幾個 `<link>` 或在瀏覽器裡直接載入這些檔:不經 bundler 時,重複的檔以最後一次出現的位置為準。沒有 build step 的頁面用 `styles.css`。
99
+
51
100
  ## 焦點
52
101
 
53
102
  所有控制項的鍵盤焦點用同一種樣式:2 px 實線外框,顏色 `focus`,離控制項 2 px(`outline: 2px solid var(--focus); outline-offset: 2px`)。`focus` 等於 `accent-text`,在每種底色上都至少 4.5:1。貼齊會裁切內容的容器時(可以捲動的分頁列、表格、清單、程式碼區、選單項目),外框改畫在內側 2 px(`outline-offset: -2px`),不會被切掉。DataTable 格子裡的任何可聚焦元素(程式碼連結、按鈕、勾選框)都畫在內側;截斷的長文字裡的連結取得鍵盤焦點時,整段文字展開,連結和外框都看得到。CommandPalette 的搜尋列在輸入框有焦點時,整列畫內側外框。有錯誤的欄位也用同一種外框,紅框不變。拖曳分隔線(SplitPane、Workbench)在焦點時變成 3 px 的 `accent` 線。
@@ -67,6 +116,8 @@
67
116
  - 圖示組:Phosphor(MIT 授權,可商用),平常用 Regular 線條版;選中時換成同一個圖示的實心版(Fill)並用強調色,例如側邊欄和手機底部分頁列的選中項目。
68
117
  - 線寬:Phosphor 的線寬固定,不另外調整;自訂的 24 × 24 線條圖示用 2 px(`icon-stroke`)。
69
118
  - 用法:`h(UI.Icon, { name: 'house' })`,加 `filled: true` 用實心版;名稱照 Phosphor,常用的 80 個已內建,`icons` 列出全部名稱(也接受 Lucide 的名稱,例如 `trash-2`)。元件的 `icon` 屬性接受同樣的名稱,或自訂圖示的 24 px path。
119
+ - 載入:每個圖示是一個獨立的模組,有 build 的專案只打包頁面用到的圖示,用法不變。元件固定會顯示的圖示(下拉箭頭、關閉的 x、勾號等)跟著元件一起打包,第一次畫面就有,server render 也有。用 `name` 或 `icon` 指定的其他圖示在第一次顯示時才載入:載入前是同樣大小的空白方框(版面不會跳動),載入後同一個圖示之後都立即顯示。server render 時這些圖示是空白方框,hydrate 後再補上。
120
+ - 首屏的圖示想在第一次畫面就出現時,render 前先 `await preloadIcons(['house', 'gear'])`;不呼叫也能用,只是晚一個網路來回。import `icons` 的頁面會帶入全部圖示,所以只在真的需要全部名稱時才 import。`bundle.js` 內含全部圖示,一律立即顯示。
70
121
 
71
122
  ## 外觀設定
72
123
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seanyeh77/ui",
3
- "version": "0.41.0",
3
+ "version": "0.43.0",
4
4
  "description": "SeanYeh's design system: typed React components on Base UI, styled with design tokens.",
5
5
  "license": "MIT",
6
6
  "author": "Hsiu-An Yeh",
@@ -20,10 +20,11 @@
20
20
  "default": "./dist/index.js"
21
21
  },
22
22
  "./format": {
23
- "types": "./dist/format.d.ts",
24
- "default": "./dist/format.js"
23
+ "types": "./dist/format-entry.d.ts",
24
+ "default": "./dist/format-entry.js"
25
25
  },
26
26
  "./styles.css": "./dist/styles.css",
27
+ "./css/*": "./dist/css/*",
27
28
  "./tokens.css": "./dist/tokens.css",
28
29
  "./fonts.css": "./dist/fonts.css",
29
30
  "./bundle.js": "./dist/bundle.js",
@@ -49,7 +50,7 @@
49
50
  "react-dom": "^19.3.1",
50
51
  "tsdown": "^0.23.7",
51
52
  "vitest": "^5.1.0",
52
- "@seanyeh77/tokens": "^0.41.0"
53
+ "@seanyeh77/tokens": "^0.43.0"
53
54
  },
54
55
  "dependencies": {
55
56
  "@base-ui/react": "^1.9.0"
@@ -1,79 +0,0 @@
1
- type Decimals = number | 'money' | 'percent' | 'size' | 'count';
2
- declare function locale(): string;
3
- /** zh-TW: 2026/11/04(三). Other locales: their short date with weekday. */
4
- declare function date(d: Date | null | undefined, o?: {
5
- weekday?: boolean;
6
- long?: boolean;
7
- }): string;
8
- /** zh-TW: 24-hour 15:57. Other locales: their own clock. */
9
- declare function time(d: Date | null | undefined): string;
10
- declare function dateTime(d: Date | null | undefined, o?: {
11
- weekday?: boolean;
12
- }): string;
13
- /** Within 7 days: 「2 小時前」、「昨天」. Older: full date and time. Pass now to test. */
14
- declare function relative(d: Date | null | undefined, now?: Date): string;
15
- declare function month(d: Date): string;
16
- /** Week starts on Sunday for zh-TW; other locales use Intl's week info when the browser has it. */
17
- declare function firstDay(): number;
18
- /** Narrow weekday names, starting from firstDay(). */
19
- declare function weekdays(): string[];
20
- /** Decimals by unit: money 0, percent 1, size 1, count 0; pass a number to force it. */
21
- declare function number(v: number, dec?: Decimals): string;
22
- declare function percent(v: number, dec?: number): string;
23
- /** Only KPI cards abbreviate: 1,284 萬 in zh-TW (萬、億), 12.8M in English.
24
- * like: format v with the unit and decimals that `like` gets, so a counting KPI keeps its width. */
25
- declare function compact(v: number, like?: number): string;
26
- /** zh-TW with TWD: NT$ 1,280, negatives -NT$ 1,280. Other locales and currencies: Intl's own symbol and order. */
27
- declare function money(v: number, o?: {
28
- currency?: string;
29
- compact?: boolean;
30
- like?: number;
31
- }): string;
32
- /** Bytes to 「186 KB」「54.9 MB」「1.2 GB」. */
33
- declare function fileSize(b: number | null | undefined): string;
34
- /** Seconds as a clock-style length: under 1 h 「46:42」「1:30」 (minutes not zero-padded), 1 h or more 「1:54:49」.
35
- * Rounded to the second. Negative, NaN or missing: 「—」. */
36
- declare function duration(seconds: number | null | undefined): string;
37
- /** Shortens a path: keeps the first segment and the last two, 「src/…/hooks/ops.c:58」. */
38
- declare function path(p: string | null | undefined, o?: {
39
- head?: number;
40
- tail?: number;
41
- }): string;
42
- /** A part of a whole, as shown: 「1 / 1 個」「6 / 6 筆」, or 「1 / 5」 without a unit. Give screen readers
43
- * `fractionLabel` with it: they read the slash as 「斜線」. */
44
- declare function fraction(n: number, total: number, unit?: string): string;
45
- /** The same fraction as read aloud: 「1 個中的 1 個」「6 筆中的 6 筆」, or 「5 中的 1」 without a unit (English:
46
- * 「1 of 1」). For `aria-label`, or for visually hidden text beside the shown fraction. */
47
- declare function fractionLabel(n: number, total: number, unit?: string): string;
48
- /** Every date, number, amount, size and path shown in the UI goes through these. */
49
- declare const format: {
50
- locale: typeof locale;
51
- date: typeof date;
52
- time: typeof time;
53
- dateTime: typeof dateTime;
54
- relative: typeof relative;
55
- month: typeof month;
56
- weekdays: typeof weekdays;
57
- firstDay: typeof firstDay;
58
- number: typeof number;
59
- percent: typeof percent;
60
- compact: typeof compact;
61
- money: typeof money;
62
- fileSize: typeof fileSize;
63
- duration: typeof duration;
64
- path: typeof path;
65
- fraction: typeof fraction;
66
- fractionLabel: typeof fractionLabel;
67
- };
68
- /** Translates a built-in zh-TW string into the current locale; {name} placeholders take vars. */
69
- declare function tr(key: string, vars?: Record<string, string | number>): string;
70
- /** A count's unit: a function gets the count (for plurals, 「1 row」「2 rows」); a string goes through tr(), and for 1
71
- * the message 「1 <unit>」 is used when the locale has one (「1 筆」 → 「1 row」), without the number. */
72
- type CountUnit = string | ((n: number) => string);
73
- /** Switches the interface language and, optionally, the currency used by format.money. */
74
- declare function setLocale(locale: string, opts?: {
75
- currency?: string;
76
- }): void;
77
- /** Adds or overrides translations for a locale. Keys are the zh-TW strings. */
78
- declare function addMessages(locale: string, dict: Record<string, string>): void;
79
- export { Decimals as a, tr as i, addMessages as n, format as o, setLocale as r, CountUnit as t };
@@ -1 +0,0 @@
1
- {"version":3,"file":"format-entry-CyChe8bk.js","names":[],"sources":["../src/i18n.ts","../src/format.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","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 return d ? `${date(d, o)} ${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":";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,WAAW;EACX,0BAA0B;EAC1B,MAAM;EACN,IAAI;EACJ,MAAM;EACN,QAAQ;EACR,IA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