@seanyeh77/ui 0.44.0 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (868) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -1
  3. package/dist/bundle.js +20 -20
  4. package/dist/components/AccentPicker/AccentPicker.d.ts +1 -0
  5. package/dist/components/AccentPicker/AccentPicker.js +92 -72
  6. package/dist/components/AccentPicker/AccentPicker.js.map +1 -1
  7. package/dist/components/ActionBar/ActionBar.d.ts +2 -0
  8. package/dist/components/ActionBar/ActionBar.js.map +1 -1
  9. package/dist/components/AiMark/AiMark.d.ts +1 -0
  10. package/dist/components/AiMark/AiMark.js.map +1 -1
  11. package/dist/components/Alert/Alert.d.ts +5 -2
  12. package/dist/components/Alert/Alert.js +17 -14
  13. package/dist/components/Alert/Alert.js.map +1 -1
  14. package/dist/components/AppShell/AppShell.d.ts +10 -4
  15. package/dist/components/AppShell/AppShell.js +30 -19
  16. package/dist/components/AppShell/AppShell.js.map +1 -1
  17. package/dist/components/Badge/Badge.d.ts +24 -7
  18. package/dist/components/Badge/Badge.js +78 -21
  19. package/dist/components/Badge/Badge.js.map +1 -1
  20. package/dist/components/BarChart/BarChart.d.ts +14 -1
  21. package/dist/components/BarChart/BarChart.js +88 -59
  22. package/dist/components/BarChart/BarChart.js.map +1 -1
  23. package/dist/components/Breadcrumb/Breadcrumb.d.ts +1 -0
  24. package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
  25. package/dist/components/Button/Button.d.ts +4 -1
  26. package/dist/components/Button/Button.js +17 -3
  27. package/dist/components/Button/Button.js.map +1 -1
  28. package/dist/components/Calendar/Calendar.d.ts +11 -2
  29. package/dist/components/Calendar/Calendar.js +16 -5
  30. package/dist/components/Calendar/Calendar.js.map +1 -1
  31. package/dist/components/Card/Card.d.ts +1 -0
  32. package/dist/components/Card/Card.js.map +1 -1
  33. package/dist/components/Checkbox/Checkbox.d.ts +24 -8
  34. package/dist/components/Checkbox/Checkbox.js +22 -9
  35. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  36. package/dist/components/CodeView/CodeView.d.ts +3 -0
  37. package/dist/components/CodeView/CodeView.js +6 -6
  38. package/dist/components/CodeView/CodeView.js.map +1 -1
  39. package/dist/components/CommandPalette/CommandPalette.d.ts +16 -4
  40. package/dist/components/CommandPalette/CommandPalette.js +38 -11
  41. package/dist/components/CommandPalette/CommandPalette.js.map +1 -1
  42. package/dist/components/ConsoleLayout/ConsoleLayout.d.ts +2 -3
  43. package/dist/components/ConsoleLayout/ConsoleLayout.js +4 -1
  44. package/dist/components/ConsoleLayout/ConsoleLayout.js.map +1 -1
  45. package/dist/components/DangerZone/DangerZone.d.ts +2 -1
  46. package/dist/components/DangerZone/DangerZone.js +1 -1
  47. package/dist/components/DangerZone/DangerZone.js.map +1 -1
  48. package/dist/components/DataTable/DataTable.d.ts +8 -1
  49. package/dist/components/DataTable/DataTable.js +213 -167
  50. package/dist/components/DataTable/DataTable.js.map +1 -1
  51. package/dist/components/DataTable/SortButton.js +48 -5
  52. package/dist/components/DataTable/SortButton.js.map +1 -1
  53. package/dist/components/DataTable/filters.js +2 -1
  54. package/dist/components/DataTable/filters.js.map +1 -1
  55. package/dist/components/DataTable/parts.js +1 -1
  56. package/dist/components/DataTable/parts.js.map +1 -1
  57. package/dist/components/DataTable/types.d.ts +10 -3
  58. package/dist/components/DatePicker/DatePicker.d.ts +7 -5
  59. package/dist/components/DatePicker/DatePicker.js +16 -6
  60. package/dist/components/DatePicker/DatePicker.js.map +1 -1
  61. package/dist/components/DateRangePicker/DateRangePicker.d.ts +12 -7
  62. package/dist/components/DateRangePicker/DateRangePicker.js +81 -45
  63. package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
  64. package/dist/components/DetailList/DetailList.d.ts +2 -0
  65. package/dist/components/DetailList/DetailList.js.map +1 -1
  66. package/dist/components/Dialog/Dialog.d.ts +56 -20
  67. package/dist/components/Dialog/Dialog.js +45 -14
  68. package/dist/components/Dialog/Dialog.js.map +1 -1
  69. package/dist/components/Drawer/Drawer.d.ts +17 -5
  70. package/dist/components/Drawer/Drawer.js +86 -24
  71. package/dist/components/Drawer/Drawer.js.map +1 -1
  72. package/dist/components/ErrorPage/ErrorPage.d.ts +3 -0
  73. package/dist/components/ErrorPage/ErrorPage.js.map +1 -1
  74. package/dist/components/EventTimeline/EventTimeline.d.ts +22 -4
  75. package/dist/components/EventTimeline/EventTimeline.js +63 -20
  76. package/dist/components/EventTimeline/EventTimeline.js.map +1 -1
  77. package/dist/components/FileUpload/FileUpload.d.ts +9 -1
  78. package/dist/components/FileUpload/FileUpload.js +3 -1
  79. package/dist/components/FileUpload/FileUpload.js.map +1 -1
  80. package/dist/components/FormGrid/FormGrid.d.ts +3 -1
  81. package/dist/components/FormGrid/FormGrid.js +5 -2
  82. package/dist/components/FormGrid/FormGrid.js.map +1 -1
  83. package/dist/components/Graph/Graph.d.ts +1 -0
  84. package/dist/components/Graph/Graph.js +8 -4
  85. package/dist/components/Graph/Graph.js.map +1 -1
  86. package/dist/components/Grid/Grid.d.ts +11 -4
  87. package/dist/components/Grid/Grid.js +14 -2
  88. package/dist/components/Grid/Grid.js.map +1 -1
  89. package/dist/components/IconButton/IconButton.d.ts +2 -1
  90. package/dist/components/IconButton/IconButton.js +10 -1
  91. package/dist/components/IconButton/IconButton.js.map +1 -1
  92. package/dist/components/InlineCode/InlineCode.d.ts +6 -0
  93. package/dist/components/InlineCode/InlineCode.js.map +1 -1
  94. package/dist/components/KpiCard/KpiCard.d.ts +5 -1
  95. package/dist/components/KpiCard/KpiCard.js +35 -21
  96. package/dist/components/KpiCard/KpiCard.js.map +1 -1
  97. package/dist/components/LayerGraph/LayerGraph.d.ts +68 -23
  98. package/dist/components/LayerGraph/LayerGraph.js +159 -88
  99. package/dist/components/LayerGraph/LayerGraph.js.map +1 -1
  100. package/dist/components/LineChart/LineChart.d.ts +10 -3
  101. package/dist/components/LineChart/LineChart.js +55 -23
  102. package/dist/components/LineChart/LineChart.js.map +1 -1
  103. package/dist/components/Link/Link.d.ts +17 -0
  104. package/dist/components/Link/Link.js +47 -0
  105. package/dist/components/Link/Link.js.map +1 -0
  106. package/dist/components/LoadingBar/LoadingBar.d.ts +1 -0
  107. package/dist/components/LoadingBar/LoadingBar.js.map +1 -1
  108. package/dist/components/LoginCard/LoginCard.d.ts +9 -3
  109. package/dist/components/LoginCard/LoginCard.js +99 -78
  110. package/dist/components/LoginCard/LoginCard.js.map +1 -1
  111. package/dist/components/Markdown/Markdown.d.ts +1 -0
  112. package/dist/components/Markdown/Markdown.js +1 -1
  113. package/dist/components/Markdown/Markdown.js.map +1 -1
  114. package/dist/components/Menu/Menu.d.ts +4 -2
  115. package/dist/components/Menu/Menu.js +43 -33
  116. package/dist/components/Menu/Menu.js.map +1 -1
  117. package/dist/components/Meter/Meter.d.ts +4 -0
  118. package/dist/components/Meter/Meter.js.map +1 -1
  119. package/dist/components/MobileTabBar/MobileTabBar.d.ts +3 -0
  120. package/dist/components/MobileTabBar/MobileTabBar.js.map +1 -1
  121. package/dist/components/MultiSelect/MultiSelect.d.ts +7 -6
  122. package/dist/components/MultiSelect/MultiSelect.js +27 -9
  123. package/dist/components/MultiSelect/MultiSelect.js.map +1 -1
  124. package/dist/components/NotificationBell/NotificationBell.d.ts +3 -0
  125. package/dist/components/NotificationBell/NotificationBell.js +2 -2
  126. package/dist/components/NotificationBell/NotificationBell.js.map +1 -1
  127. package/dist/components/PageHeader/PageHeader.d.ts +34 -0
  128. package/dist/components/PageHeader/PageHeader.js +68 -0
  129. package/dist/components/PageHeader/PageHeader.js.map +1 -0
  130. package/dist/components/Popover/Popover.d.ts +11 -4
  131. package/dist/components/Popover/Popover.js +17 -7
  132. package/dist/components/Popover/Popover.js.map +1 -1
  133. package/dist/components/ProgressBar/ProgressBar.d.ts +2 -0
  134. package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
  135. package/dist/components/ProgressRing/ProgressRing.d.ts +1 -0
  136. package/dist/components/ProgressRing/ProgressRing.js.map +1 -1
  137. package/dist/components/ProjectSwitcher/ProjectSwitcher.d.ts +5 -1
  138. package/dist/components/ProjectSwitcher/ProjectSwitcher.js +16 -3
  139. package/dist/components/ProjectSwitcher/ProjectSwitcher.js.map +1 -1
  140. package/dist/components/RadioGroup/RadioGroup.d.ts +22 -5
  141. package/dist/components/RadioGroup/RadioGroup.js +48 -47
  142. package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
  143. package/dist/components/RelativeTime/RelativeTime.d.ts +10 -0
  144. package/dist/components/RelativeTime/RelativeTime.js +44 -0
  145. package/dist/components/RelativeTime/RelativeTime.js.map +1 -0
  146. package/dist/components/SearchField/SearchField.d.ts +2 -0
  147. package/dist/components/SearchField/SearchField.js.map +1 -1
  148. package/dist/components/Section/Section.d.ts +4 -0
  149. package/dist/components/Section/Section.js +8 -22
  150. package/dist/components/Section/Section.js.map +1 -1
  151. package/dist/components/SegmentedControl/SegmentedControl.d.ts +22 -9
  152. package/dist/components/SegmentedControl/SegmentedControl.js +20 -19
  153. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
  154. package/dist/components/Select/Select.d.ts +7 -11
  155. package/dist/components/Select/Select.js +7 -3
  156. package/dist/components/Select/Select.js.map +1 -1
  157. package/dist/components/SettingsLayout/SettingsLayout.d.ts +32 -3
  158. package/dist/components/SettingsLayout/SettingsLayout.js +60 -13
  159. package/dist/components/SettingsLayout/SettingsLayout.js.map +1 -1
  160. package/dist/components/SideNav/SideNav.d.ts +2 -0
  161. package/dist/components/SideNav/SideNav.js +3 -3
  162. package/dist/components/SideNav/SideNav.js.map +1 -1
  163. package/dist/components/SplitPane/SplitPane.d.ts +1 -0
  164. package/dist/components/SplitPane/SplitPane.js.map +1 -1
  165. package/dist/components/StatusBand/StatusBand.d.ts +1 -0
  166. package/dist/components/StatusBand/StatusBand.js.map +1 -1
  167. package/dist/components/Suggestion/Suggestion.d.ts +6 -0
  168. package/dist/components/Suggestion/Suggestion.js.map +1 -1
  169. package/dist/components/Switch/Switch.d.ts +13 -3
  170. package/dist/components/Switch/Switch.js +16 -7
  171. package/dist/components/Switch/Switch.js.map +1 -1
  172. package/dist/components/Tabs/Tabs.d.ts +4 -0
  173. package/dist/components/Tabs/Tabs.js +1 -1
  174. package/dist/components/Tabs/Tabs.js.map +1 -1
  175. package/dist/components/Tag/Tag.d.ts +15 -7
  176. package/dist/components/Tag/Tag.js +22 -10
  177. package/dist/components/Tag/Tag.js.map +1 -1
  178. package/dist/components/Term/Term.d.ts +8 -3
  179. package/dist/components/Term/Term.js +1 -1
  180. package/dist/components/Term/Term.js.map +1 -1
  181. package/dist/components/TextArea/TextArea.d.ts +6 -10
  182. package/dist/components/TextArea/TextArea.js +22 -10
  183. package/dist/components/TextArea/TextArea.js.map +1 -1
  184. package/dist/components/TextField/TextField.d.ts +8 -11
  185. package/dist/components/TextField/TextField.js +9 -7
  186. package/dist/components/TextField/TextField.js.map +1 -1
  187. package/dist/components/ThemePicker/ThemePicker.d.ts +1 -0
  188. package/dist/components/ThemePicker/ThemePicker.js +35 -34
  189. package/dist/components/ThemePicker/ThemePicker.js.map +1 -1
  190. package/dist/components/TimeControl/TimeControl.d.ts +1 -0
  191. package/dist/components/TimeControl/TimeControl.js.map +1 -1
  192. package/dist/components/Toast/Toast.d.ts +55 -2
  193. package/dist/components/Toast/Toast.js +190 -8
  194. package/dist/components/Toast/Toast.js.map +1 -1
  195. package/dist/components/TopBar/TopBar.d.ts +6 -2
  196. package/dist/components/TopBar/TopBar.js +7 -1
  197. package/dist/components/TopBar/TopBar.js.map +1 -1
  198. package/dist/components/Tour/Tour.d.ts +14 -3
  199. package/dist/components/Tour/Tour.js +26 -14
  200. package/dist/components/Tour/Tour.js.map +1 -1
  201. package/dist/components/TreeList/TreeList.d.ts +28 -4
  202. package/dist/components/TreeList/TreeList.js +32 -20
  203. package/dist/components/TreeList/TreeList.js.map +1 -1
  204. package/dist/components/Workbench/Workbench.d.ts +1 -0
  205. package/dist/components/Workbench/Workbench.js +24 -12
  206. package/dist/components/Workbench/Workbench.js.map +1 -1
  207. package/dist/components/ZoneMap/ZoneMap.d.ts +12 -2
  208. package/dist/components/ZoneMap/ZoneMap.js +13 -5
  209. package/dist/components/ZoneMap/ZoneMap.js.map +1 -1
  210. package/dist/components/useFormErrors/useFormErrors.d.ts +20 -0
  211. package/dist/components/useFormErrors/useFormErrors.js +55 -0
  212. package/dist/components/useFormErrors/useFormErrors.js.map +1 -0
  213. package/dist/css/AccentPicker.css +1 -0
  214. package/dist/css/Alert.css +7 -19
  215. package/dist/css/AppShell.css +1 -0
  216. package/dist/css/Badge.css +19 -45
  217. package/dist/css/BarChart.css +21 -3
  218. package/dist/css/Button.css +5 -1
  219. package/dist/css/Card.css +8 -8
  220. package/dist/css/Checkbox.css +19 -0
  221. package/dist/css/CodeView.css +2 -1
  222. package/dist/css/DangerZone.css +4 -3
  223. package/dist/css/DataTable.css +129 -34
  224. package/dist/css/DateRangePicker.css +23 -2
  225. package/dist/css/Drawer.css +30 -0
  226. package/dist/css/ErrorPage.css +3 -1
  227. package/dist/css/EventTimeline.css +33 -5
  228. package/dist/css/FormGrid.css +12 -3
  229. package/dist/css/Graph.css +9 -1
  230. package/dist/css/Grid.css +8 -0
  231. package/dist/css/KpiCard.css +12 -1
  232. package/dist/css/LayerGraph.css +40 -15
  233. package/dist/css/Link.css +23 -0
  234. package/dist/css/LoginCard.css +16 -11
  235. package/dist/css/Markdown.css +2 -1
  236. package/dist/css/Menu.css +0 -2
  237. package/dist/css/Meter.css +16 -0
  238. package/dist/css/PageHeader.css +50 -0
  239. package/dist/css/ProgressBar.css +12 -0
  240. package/dist/css/ProjectSwitcher.css +23 -26
  241. package/dist/css/RelativeTime.css +2 -0
  242. package/dist/css/SegmentedControl.css +38 -10
  243. package/dist/css/SettingsLayout.css +28 -8
  244. package/dist/css/SideNav.css +4 -1
  245. package/dist/css/Skeleton.css +22 -1
  246. package/dist/css/Switch.css +27 -0
  247. package/dist/css/Tabs.css +2 -1
  248. package/dist/css/Tag.css +19 -12
  249. package/dist/css/Toast.css +100 -4
  250. package/dist/css/TopBar.css +21 -2
  251. package/dist/css/TreeList.css +6 -3
  252. package/dist/css/Workbench.css +1 -1
  253. package/dist/css/ZoneMap.css +0 -1
  254. package/dist/css/base.css +45 -0
  255. package/dist/css/end.css +119 -5
  256. package/dist/deprecated.d.ts +3 -0
  257. package/dist/deprecated.js +13 -0
  258. package/dist/deprecated.js.map +1 -0
  259. package/dist/fonts.css +2 -7543
  260. package/dist/format.d.ts +3 -1
  261. package/dist/format.js +12 -4
  262. package/dist/format.js.map +1 -1
  263. package/dist/generated/themeDefaults.d.ts +8 -0
  264. package/dist/generated/themeDefaults.js +35 -0
  265. package/dist/generated/themeDefaults.js.map +1 -0
  266. package/dist/i18n.d.ts +7 -2
  267. package/dist/i18n.js +65 -10
  268. package/dist/i18n.js.map +1 -1
  269. package/dist/icons/Icon.d.ts +3 -1
  270. package/dist/icons/Icon.js.map +1 -1
  271. package/dist/index.d.ts +23 -14
  272. package/dist/index.js +14 -8
  273. package/dist/internal/Field.d.ts +19 -0
  274. package/dist/internal/Field.js +10 -4
  275. package/dist/internal/Field.js.map +1 -1
  276. package/dist/internal/FloatingPanel.js +2 -1
  277. package/dist/internal/FloatingPanel.js.map +1 -1
  278. package/dist/internal/chart.d.ts +4 -0
  279. package/dist/internal/chart.js +89 -19
  280. package/dist/internal/chart.js.map +1 -1
  281. package/dist/internal/dev.js +9 -4
  282. package/dist/internal/dev.js.map +1 -1
  283. package/dist/internal/focus.js +27 -3
  284. package/dist/internal/focus.js.map +1 -1
  285. package/dist/internal/focusMain.js +6 -2
  286. package/dist/internal/focusMain.js.map +1 -1
  287. package/dist/internal/open.d.ts +14 -0
  288. package/dist/internal/open.js +28 -0
  289. package/dist/internal/open.js.map +1 -0
  290. package/dist/internal/roving.js +37 -0
  291. package/dist/internal/roving.js.map +1 -0
  292. package/dist/internal/shell.js +12 -0
  293. package/dist/internal/shell.js.map +1 -0
  294. package/dist/internal/stored.js +89 -0
  295. package/dist/internal/stored.js.map +1 -0
  296. package/dist/internal/tableTools.js +46 -4
  297. package/dist/internal/tableTools.js.map +1 -1
  298. package/dist/internal/util.js +8 -17
  299. package/dist/internal/util.js.map +1 -1
  300. package/dist/locale.d.ts +17 -0
  301. package/dist/locale.js +29 -0
  302. package/dist/locale.js.map +1 -0
  303. package/dist/styles.css +944 -231
  304. package/dist/theme.d.ts +23 -5
  305. package/dist/theme.js +85 -25
  306. package/dist/theme.js.map +1 -1
  307. package/dist/tokens.css +3 -0
  308. package/docs/AccentPicker.md +3 -1
  309. package/docs/Alert.md +4 -4
  310. package/docs/AppShell.md +11 -10
  311. package/docs/Badge.md +26 -16
  312. package/docs/BarChart.md +7 -4
  313. package/docs/Button.md +4 -5
  314. package/docs/Calendar.md +2 -2
  315. package/docs/Card.md +8 -7
  316. package/docs/Checkbox.md +4 -1
  317. package/docs/CodeView.md +30 -43
  318. package/docs/CommandPalette.md +3 -2
  319. package/docs/ConsoleLayout.md +5 -5
  320. package/docs/DangerZone.md +3 -3
  321. package/docs/DataColors.md +2 -2
  322. package/docs/DataTable.md +26 -148
  323. package/docs/DatePicker.md +1 -1
  324. package/docs/DateRangePicker.md +3 -0
  325. package/docs/DetailList.md +9 -9
  326. package/docs/Dialog.md +8 -5
  327. package/docs/Drawer.md +7 -5
  328. package/docs/EmptyState.md +0 -1
  329. package/docs/ErrorPage.md +1 -2
  330. package/docs/EventTimeline.md +23 -13
  331. package/docs/FileUpload.md +1 -2
  332. package/docs/FormGrid.md +2 -1
  333. package/docs/Format.md +4 -2
  334. package/docs/Graph.md +1 -1
  335. package/docs/Grid.md +5 -1
  336. package/docs/KpiCard.md +6 -5
  337. package/docs/LayerGraph.md +18 -53
  338. package/docs/LineChart.md +5 -3
  339. package/docs/Link.md +22 -0
  340. package/docs/LoginCard.md +7 -4
  341. package/docs/Markdown.md +2 -15
  342. package/docs/Menu.md +2 -0
  343. package/docs/Meter.md +1 -0
  344. package/docs/MultiSelect.md +2 -2
  345. package/docs/NotificationBell.md +1 -1
  346. package/docs/PageHeader.md +34 -0
  347. package/docs/Popover.md +3 -1
  348. package/docs/ProgressBar.md +3 -1
  349. package/docs/ProjectSwitcher.md +14 -14
  350. package/docs/RadioGroup.md +2 -0
  351. package/docs/RelativeTime.md +23 -0
  352. package/docs/Section.md +1 -1
  353. package/docs/SegmentedControl.md +9 -6
  354. package/docs/Select.md +2 -2
  355. package/docs/SettingsLayout.md +19 -5
  356. package/docs/SideNav.md +1 -1
  357. package/docs/Skeleton.md +2 -1
  358. package/docs/Switch.md +3 -1
  359. package/docs/Tabs.md +2 -1
  360. package/docs/Tag.md +9 -7
  361. package/docs/Term.md +3 -4
  362. package/docs/TextArea.md +2 -2
  363. package/docs/TextField.md +5 -4
  364. package/docs/ThemePicker.md +3 -1
  365. package/docs/Toast.md +17 -6
  366. package/docs/TopBar.md +8 -5
  367. package/docs/Tour.md +3 -2
  368. package/docs/TreeList.md +10 -37
  369. package/docs/Workbench.md +1 -48
  370. package/docs/ZoneMap.md +5 -5
  371. package/docs/agents.md +82 -0
  372. package/docs/code.md +2 -2
  373. package/docs/components.json +314 -0
  374. package/docs/data.md +9 -19
  375. package/docs/forms.md +6 -5
  376. package/docs/guidelines.md +39 -31
  377. package/docs/icons.md +9 -0
  378. package/docs/layout.md +16 -20
  379. package/docs/motion.md +31 -56
  380. package/docs/theme.md +15 -18
  381. package/docs/useFormErrors.md +35 -0
  382. package/package.json +8 -7
  383. package/dist/bundle.js.map +0 -1
  384. package/dist/fonts/LICENSE-OFL.txt +0 -93
  385. package/dist/fonts/geist-mono-cyrillic-400-normal.woff2 +0 -0
  386. package/dist/fonts/geist-mono-cyrillic-500-normal.woff2 +0 -0
  387. package/dist/fonts/geist-mono-cyrillic-600-normal.woff2 +0 -0
  388. package/dist/fonts/geist-mono-cyrillic-700-normal.woff2 +0 -0
  389. package/dist/fonts/geist-mono-cyrillic-ext-400-normal.woff2 +0 -0
  390. package/dist/fonts/geist-mono-cyrillic-ext-500-normal.woff2 +0 -0
  391. package/dist/fonts/geist-mono-cyrillic-ext-600-normal.woff2 +0 -0
  392. package/dist/fonts/geist-mono-cyrillic-ext-700-normal.woff2 +0 -0
  393. package/dist/fonts/geist-mono-latin-400-normal.woff2 +0 -0
  394. package/dist/fonts/geist-mono-latin-500-normal.woff2 +0 -0
  395. package/dist/fonts/geist-mono-latin-600-normal.woff2 +0 -0
  396. package/dist/fonts/geist-mono-latin-700-normal.woff2 +0 -0
  397. package/dist/fonts/geist-mono-latin-ext-400-normal.woff2 +0 -0
  398. package/dist/fonts/geist-mono-latin-ext-500-normal.woff2 +0 -0
  399. package/dist/fonts/geist-mono-latin-ext-600-normal.woff2 +0 -0
  400. package/dist/fonts/geist-mono-latin-ext-700-normal.woff2 +0 -0
  401. package/dist/fonts/geist-mono-symbols2-400-normal.woff2 +0 -0
  402. package/dist/fonts/geist-mono-symbols2-500-normal.woff2 +0 -0
  403. package/dist/fonts/geist-mono-symbols2-600-normal.woff2 +0 -0
  404. package/dist/fonts/geist-mono-symbols2-700-normal.woff2 +0 -0
  405. package/dist/fonts/geist-mono-vietnamese-400-normal.woff2 +0 -0
  406. package/dist/fonts/geist-mono-vietnamese-500-normal.woff2 +0 -0
  407. package/dist/fonts/geist-mono-vietnamese-600-normal.woff2 +0 -0
  408. package/dist/fonts/geist-mono-vietnamese-700-normal.woff2 +0 -0
  409. package/dist/fonts/inter-cyrillic-400-normal.woff2 +0 -0
  410. package/dist/fonts/inter-cyrillic-500-normal.woff2 +0 -0
  411. package/dist/fonts/inter-cyrillic-600-normal.woff2 +0 -0
  412. package/dist/fonts/inter-cyrillic-700-normal.woff2 +0 -0
  413. package/dist/fonts/inter-cyrillic-ext-400-normal.woff2 +0 -0
  414. package/dist/fonts/inter-cyrillic-ext-500-normal.woff2 +0 -0
  415. package/dist/fonts/inter-cyrillic-ext-600-normal.woff2 +0 -0
  416. package/dist/fonts/inter-cyrillic-ext-700-normal.woff2 +0 -0
  417. package/dist/fonts/inter-greek-400-normal.woff2 +0 -0
  418. package/dist/fonts/inter-greek-500-normal.woff2 +0 -0
  419. package/dist/fonts/inter-greek-600-normal.woff2 +0 -0
  420. package/dist/fonts/inter-greek-700-normal.woff2 +0 -0
  421. package/dist/fonts/inter-greek-ext-400-normal.woff2 +0 -0
  422. package/dist/fonts/inter-greek-ext-500-normal.woff2 +0 -0
  423. package/dist/fonts/inter-greek-ext-600-normal.woff2 +0 -0
  424. package/dist/fonts/inter-greek-ext-700-normal.woff2 +0 -0
  425. package/dist/fonts/inter-latin-400-normal.woff2 +0 -0
  426. package/dist/fonts/inter-latin-500-normal.woff2 +0 -0
  427. package/dist/fonts/inter-latin-600-normal.woff2 +0 -0
  428. package/dist/fonts/inter-latin-700-normal.woff2 +0 -0
  429. package/dist/fonts/inter-latin-ext-400-normal.woff2 +0 -0
  430. package/dist/fonts/inter-latin-ext-500-normal.woff2 +0 -0
  431. package/dist/fonts/inter-latin-ext-600-normal.woff2 +0 -0
  432. package/dist/fonts/inter-latin-ext-700-normal.woff2 +0 -0
  433. package/dist/fonts/inter-vietnamese-400-normal.woff2 +0 -0
  434. package/dist/fonts/inter-vietnamese-500-normal.woff2 +0 -0
  435. package/dist/fonts/inter-vietnamese-600-normal.woff2 +0 -0
  436. package/dist/fonts/inter-vietnamese-700-normal.woff2 +0 -0
  437. package/dist/fonts/noto-sans-tc-0-400-normal.woff2 +0 -0
  438. package/dist/fonts/noto-sans-tc-0-500-normal.woff2 +0 -0
  439. package/dist/fonts/noto-sans-tc-0-600-normal.woff2 +0 -0
  440. package/dist/fonts/noto-sans-tc-0-700-normal.woff2 +0 -0
  441. package/dist/fonts/noto-sans-tc-1-400-normal.woff2 +0 -0
  442. package/dist/fonts/noto-sans-tc-1-500-normal.woff2 +0 -0
  443. package/dist/fonts/noto-sans-tc-1-600-normal.woff2 +0 -0
  444. package/dist/fonts/noto-sans-tc-1-700-normal.woff2 +0 -0
  445. package/dist/fonts/noto-sans-tc-10-400-normal.woff2 +0 -0
  446. package/dist/fonts/noto-sans-tc-10-500-normal.woff2 +0 -0
  447. package/dist/fonts/noto-sans-tc-10-600-normal.woff2 +0 -0
  448. package/dist/fonts/noto-sans-tc-10-700-normal.woff2 +0 -0
  449. package/dist/fonts/noto-sans-tc-101-400-normal.woff2 +0 -0
  450. package/dist/fonts/noto-sans-tc-101-500-normal.woff2 +0 -0
  451. package/dist/fonts/noto-sans-tc-101-600-normal.woff2 +0 -0
  452. package/dist/fonts/noto-sans-tc-101-700-normal.woff2 +0 -0
  453. package/dist/fonts/noto-sans-tc-102-400-normal.woff2 +0 -0
  454. package/dist/fonts/noto-sans-tc-102-500-normal.woff2 +0 -0
  455. package/dist/fonts/noto-sans-tc-102-600-normal.woff2 +0 -0
  456. package/dist/fonts/noto-sans-tc-102-700-normal.woff2 +0 -0
  457. package/dist/fonts/noto-sans-tc-103-400-normal.woff2 +0 -0
  458. package/dist/fonts/noto-sans-tc-103-500-normal.woff2 +0 -0
  459. package/dist/fonts/noto-sans-tc-103-600-normal.woff2 +0 -0
  460. package/dist/fonts/noto-sans-tc-103-700-normal.woff2 +0 -0
  461. package/dist/fonts/noto-sans-tc-104-400-normal.woff2 +0 -0
  462. package/dist/fonts/noto-sans-tc-104-500-normal.woff2 +0 -0
  463. package/dist/fonts/noto-sans-tc-104-600-normal.woff2 +0 -0
  464. package/dist/fonts/noto-sans-tc-104-700-normal.woff2 +0 -0
  465. package/dist/fonts/noto-sans-tc-105-400-normal.woff2 +0 -0
  466. package/dist/fonts/noto-sans-tc-105-500-normal.woff2 +0 -0
  467. package/dist/fonts/noto-sans-tc-105-600-normal.woff2 +0 -0
  468. package/dist/fonts/noto-sans-tc-105-700-normal.woff2 +0 -0
  469. package/dist/fonts/noto-sans-tc-106-400-normal.woff2 +0 -0
  470. package/dist/fonts/noto-sans-tc-106-500-normal.woff2 +0 -0
  471. package/dist/fonts/noto-sans-tc-106-600-normal.woff2 +0 -0
  472. package/dist/fonts/noto-sans-tc-106-700-normal.woff2 +0 -0
  473. package/dist/fonts/noto-sans-tc-107-400-normal.woff2 +0 -0
  474. package/dist/fonts/noto-sans-tc-107-500-normal.woff2 +0 -0
  475. package/dist/fonts/noto-sans-tc-107-600-normal.woff2 +0 -0
  476. package/dist/fonts/noto-sans-tc-107-700-normal.woff2 +0 -0
  477. package/dist/fonts/noto-sans-tc-108-400-normal.woff2 +0 -0
  478. package/dist/fonts/noto-sans-tc-108-500-normal.woff2 +0 -0
  479. package/dist/fonts/noto-sans-tc-108-600-normal.woff2 +0 -0
  480. package/dist/fonts/noto-sans-tc-108-700-normal.woff2 +0 -0
  481. package/dist/fonts/noto-sans-tc-109-400-normal.woff2 +0 -0
  482. package/dist/fonts/noto-sans-tc-109-500-normal.woff2 +0 -0
  483. package/dist/fonts/noto-sans-tc-109-600-normal.woff2 +0 -0
  484. package/dist/fonts/noto-sans-tc-109-700-normal.woff2 +0 -0
  485. package/dist/fonts/noto-sans-tc-11-400-normal.woff2 +0 -0
  486. package/dist/fonts/noto-sans-tc-11-500-normal.woff2 +0 -0
  487. package/dist/fonts/noto-sans-tc-11-600-normal.woff2 +0 -0
  488. package/dist/fonts/noto-sans-tc-11-700-normal.woff2 +0 -0
  489. package/dist/fonts/noto-sans-tc-110-400-normal.woff2 +0 -0
  490. package/dist/fonts/noto-sans-tc-110-500-normal.woff2 +0 -0
  491. package/dist/fonts/noto-sans-tc-110-600-normal.woff2 +0 -0
  492. package/dist/fonts/noto-sans-tc-110-700-normal.woff2 +0 -0
  493. package/dist/fonts/noto-sans-tc-111-400-normal.woff2 +0 -0
  494. package/dist/fonts/noto-sans-tc-111-500-normal.woff2 +0 -0
  495. package/dist/fonts/noto-sans-tc-111-600-normal.woff2 +0 -0
  496. package/dist/fonts/noto-sans-tc-111-700-normal.woff2 +0 -0
  497. package/dist/fonts/noto-sans-tc-112-400-normal.woff2 +0 -0
  498. package/dist/fonts/noto-sans-tc-112-500-normal.woff2 +0 -0
  499. package/dist/fonts/noto-sans-tc-112-600-normal.woff2 +0 -0
  500. package/dist/fonts/noto-sans-tc-112-700-normal.woff2 +0 -0
  501. package/dist/fonts/noto-sans-tc-113-400-normal.woff2 +0 -0
  502. package/dist/fonts/noto-sans-tc-113-500-normal.woff2 +0 -0
  503. package/dist/fonts/noto-sans-tc-113-600-normal.woff2 +0 -0
  504. package/dist/fonts/noto-sans-tc-113-700-normal.woff2 +0 -0
  505. package/dist/fonts/noto-sans-tc-114-400-normal.woff2 +0 -0
  506. package/dist/fonts/noto-sans-tc-114-500-normal.woff2 +0 -0
  507. package/dist/fonts/noto-sans-tc-114-600-normal.woff2 +0 -0
  508. package/dist/fonts/noto-sans-tc-114-700-normal.woff2 +0 -0
  509. package/dist/fonts/noto-sans-tc-115-400-normal.woff2 +0 -0
  510. package/dist/fonts/noto-sans-tc-115-500-normal.woff2 +0 -0
  511. package/dist/fonts/noto-sans-tc-115-600-normal.woff2 +0 -0
  512. package/dist/fonts/noto-sans-tc-115-700-normal.woff2 +0 -0
  513. package/dist/fonts/noto-sans-tc-116-400-normal.woff2 +0 -0
  514. package/dist/fonts/noto-sans-tc-116-500-normal.woff2 +0 -0
  515. package/dist/fonts/noto-sans-tc-116-600-normal.woff2 +0 -0
  516. package/dist/fonts/noto-sans-tc-116-700-normal.woff2 +0 -0
  517. package/dist/fonts/noto-sans-tc-117-400-normal.woff2 +0 -0
  518. package/dist/fonts/noto-sans-tc-117-500-normal.woff2 +0 -0
  519. package/dist/fonts/noto-sans-tc-117-600-normal.woff2 +0 -0
  520. package/dist/fonts/noto-sans-tc-117-700-normal.woff2 +0 -0
  521. package/dist/fonts/noto-sans-tc-118-400-normal.woff2 +0 -0
  522. package/dist/fonts/noto-sans-tc-118-500-normal.woff2 +0 -0
  523. package/dist/fonts/noto-sans-tc-118-600-normal.woff2 +0 -0
  524. package/dist/fonts/noto-sans-tc-118-700-normal.woff2 +0 -0
  525. package/dist/fonts/noto-sans-tc-119-400-normal.woff2 +0 -0
  526. package/dist/fonts/noto-sans-tc-119-500-normal.woff2 +0 -0
  527. package/dist/fonts/noto-sans-tc-119-600-normal.woff2 +0 -0
  528. package/dist/fonts/noto-sans-tc-119-700-normal.woff2 +0 -0
  529. package/dist/fonts/noto-sans-tc-12-400-normal.woff2 +0 -0
  530. package/dist/fonts/noto-sans-tc-12-500-normal.woff2 +0 -0
  531. package/dist/fonts/noto-sans-tc-12-600-normal.woff2 +0 -0
  532. package/dist/fonts/noto-sans-tc-12-700-normal.woff2 +0 -0
  533. package/dist/fonts/noto-sans-tc-120-400-normal.woff2 +0 -0
  534. package/dist/fonts/noto-sans-tc-120-500-normal.woff2 +0 -0
  535. package/dist/fonts/noto-sans-tc-120-600-normal.woff2 +0 -0
  536. package/dist/fonts/noto-sans-tc-120-700-normal.woff2 +0 -0
  537. package/dist/fonts/noto-sans-tc-121-400-normal.woff2 +0 -0
  538. package/dist/fonts/noto-sans-tc-121-500-normal.woff2 +0 -0
  539. package/dist/fonts/noto-sans-tc-121-600-normal.woff2 +0 -0
  540. package/dist/fonts/noto-sans-tc-121-700-normal.woff2 +0 -0
  541. package/dist/fonts/noto-sans-tc-122-400-normal.woff2 +0 -0
  542. package/dist/fonts/noto-sans-tc-122-500-normal.woff2 +0 -0
  543. package/dist/fonts/noto-sans-tc-122-600-normal.woff2 +0 -0
  544. package/dist/fonts/noto-sans-tc-122-700-normal.woff2 +0 -0
  545. package/dist/fonts/noto-sans-tc-123-400-normal.woff2 +0 -0
  546. package/dist/fonts/noto-sans-tc-123-500-normal.woff2 +0 -0
  547. package/dist/fonts/noto-sans-tc-123-600-normal.woff2 +0 -0
  548. package/dist/fonts/noto-sans-tc-123-700-normal.woff2 +0 -0
  549. package/dist/fonts/noto-sans-tc-2-400-normal.woff2 +0 -0
  550. package/dist/fonts/noto-sans-tc-2-500-normal.woff2 +0 -0
  551. package/dist/fonts/noto-sans-tc-2-600-normal.woff2 +0 -0
  552. package/dist/fonts/noto-sans-tc-2-700-normal.woff2 +0 -0
  553. package/dist/fonts/noto-sans-tc-23-400-normal.woff2 +0 -0
  554. package/dist/fonts/noto-sans-tc-23-500-normal.woff2 +0 -0
  555. package/dist/fonts/noto-sans-tc-23-600-normal.woff2 +0 -0
  556. package/dist/fonts/noto-sans-tc-23-700-normal.woff2 +0 -0
  557. package/dist/fonts/noto-sans-tc-24-400-normal.woff2 +0 -0
  558. package/dist/fonts/noto-sans-tc-24-500-normal.woff2 +0 -0
  559. package/dist/fonts/noto-sans-tc-24-600-normal.woff2 +0 -0
  560. package/dist/fonts/noto-sans-tc-24-700-normal.woff2 +0 -0
  561. package/dist/fonts/noto-sans-tc-25-400-normal.woff2 +0 -0
  562. package/dist/fonts/noto-sans-tc-25-500-normal.woff2 +0 -0
  563. package/dist/fonts/noto-sans-tc-25-600-normal.woff2 +0 -0
  564. package/dist/fonts/noto-sans-tc-25-700-normal.woff2 +0 -0
  565. package/dist/fonts/noto-sans-tc-26-400-normal.woff2 +0 -0
  566. package/dist/fonts/noto-sans-tc-26-500-normal.woff2 +0 -0
  567. package/dist/fonts/noto-sans-tc-26-600-normal.woff2 +0 -0
  568. package/dist/fonts/noto-sans-tc-26-700-normal.woff2 +0 -0
  569. package/dist/fonts/noto-sans-tc-27-400-normal.woff2 +0 -0
  570. package/dist/fonts/noto-sans-tc-27-500-normal.woff2 +0 -0
  571. package/dist/fonts/noto-sans-tc-27-600-normal.woff2 +0 -0
  572. package/dist/fonts/noto-sans-tc-27-700-normal.woff2 +0 -0
  573. package/dist/fonts/noto-sans-tc-28-400-normal.woff2 +0 -0
  574. package/dist/fonts/noto-sans-tc-28-500-normal.woff2 +0 -0
  575. package/dist/fonts/noto-sans-tc-28-600-normal.woff2 +0 -0
  576. package/dist/fonts/noto-sans-tc-28-700-normal.woff2 +0 -0
  577. package/dist/fonts/noto-sans-tc-29-400-normal.woff2 +0 -0
  578. package/dist/fonts/noto-sans-tc-29-500-normal.woff2 +0 -0
  579. package/dist/fonts/noto-sans-tc-29-600-normal.woff2 +0 -0
  580. package/dist/fonts/noto-sans-tc-29-700-normal.woff2 +0 -0
  581. package/dist/fonts/noto-sans-tc-30-400-normal.woff2 +0 -0
  582. package/dist/fonts/noto-sans-tc-30-500-normal.woff2 +0 -0
  583. package/dist/fonts/noto-sans-tc-30-600-normal.woff2 +0 -0
  584. package/dist/fonts/noto-sans-tc-30-700-normal.woff2 +0 -0
  585. package/dist/fonts/noto-sans-tc-31-400-normal.woff2 +0 -0
  586. package/dist/fonts/noto-sans-tc-31-500-normal.woff2 +0 -0
  587. package/dist/fonts/noto-sans-tc-31-600-normal.woff2 +0 -0
  588. package/dist/fonts/noto-sans-tc-31-700-normal.woff2 +0 -0
  589. package/dist/fonts/noto-sans-tc-32-400-normal.woff2 +0 -0
  590. package/dist/fonts/noto-sans-tc-32-500-normal.woff2 +0 -0
  591. package/dist/fonts/noto-sans-tc-32-600-normal.woff2 +0 -0
  592. package/dist/fonts/noto-sans-tc-32-700-normal.woff2 +0 -0
  593. package/dist/fonts/noto-sans-tc-33-400-normal.woff2 +0 -0
  594. package/dist/fonts/noto-sans-tc-33-500-normal.woff2 +0 -0
  595. package/dist/fonts/noto-sans-tc-33-600-normal.woff2 +0 -0
  596. package/dist/fonts/noto-sans-tc-33-700-normal.woff2 +0 -0
  597. package/dist/fonts/noto-sans-tc-34-400-normal.woff2 +0 -0
  598. package/dist/fonts/noto-sans-tc-34-500-normal.woff2 +0 -0
  599. package/dist/fonts/noto-sans-tc-34-600-normal.woff2 +0 -0
  600. package/dist/fonts/noto-sans-tc-34-700-normal.woff2 +0 -0
  601. package/dist/fonts/noto-sans-tc-35-400-normal.woff2 +0 -0
  602. package/dist/fonts/noto-sans-tc-35-500-normal.woff2 +0 -0
  603. package/dist/fonts/noto-sans-tc-35-600-normal.woff2 +0 -0
  604. package/dist/fonts/noto-sans-tc-35-700-normal.woff2 +0 -0
  605. package/dist/fonts/noto-sans-tc-36-400-normal.woff2 +0 -0
  606. package/dist/fonts/noto-sans-tc-36-500-normal.woff2 +0 -0
  607. package/dist/fonts/noto-sans-tc-36-600-normal.woff2 +0 -0
  608. package/dist/fonts/noto-sans-tc-36-700-normal.woff2 +0 -0
  609. package/dist/fonts/noto-sans-tc-37-400-normal.woff2 +0 -0
  610. package/dist/fonts/noto-sans-tc-37-500-normal.woff2 +0 -0
  611. package/dist/fonts/noto-sans-tc-37-600-normal.woff2 +0 -0
  612. package/dist/fonts/noto-sans-tc-37-700-normal.woff2 +0 -0
  613. package/dist/fonts/noto-sans-tc-38-400-normal.woff2 +0 -0
  614. package/dist/fonts/noto-sans-tc-38-500-normal.woff2 +0 -0
  615. package/dist/fonts/noto-sans-tc-38-600-normal.woff2 +0 -0
  616. package/dist/fonts/noto-sans-tc-38-700-normal.woff2 +0 -0
  617. package/dist/fonts/noto-sans-tc-39-400-normal.woff2 +0 -0
  618. package/dist/fonts/noto-sans-tc-39-500-normal.woff2 +0 -0
  619. package/dist/fonts/noto-sans-tc-39-600-normal.woff2 +0 -0
  620. package/dist/fonts/noto-sans-tc-39-700-normal.woff2 +0 -0
  621. package/dist/fonts/noto-sans-tc-4-400-normal.woff2 +0 -0
  622. package/dist/fonts/noto-sans-tc-4-500-normal.woff2 +0 -0
  623. package/dist/fonts/noto-sans-tc-4-600-normal.woff2 +0 -0
  624. package/dist/fonts/noto-sans-tc-4-700-normal.woff2 +0 -0
  625. package/dist/fonts/noto-sans-tc-40-400-normal.woff2 +0 -0
  626. package/dist/fonts/noto-sans-tc-40-500-normal.woff2 +0 -0
  627. package/dist/fonts/noto-sans-tc-40-600-normal.woff2 +0 -0
  628. package/dist/fonts/noto-sans-tc-40-700-normal.woff2 +0 -0
  629. package/dist/fonts/noto-sans-tc-41-400-normal.woff2 +0 -0
  630. package/dist/fonts/noto-sans-tc-41-500-normal.woff2 +0 -0
  631. package/dist/fonts/noto-sans-tc-41-600-normal.woff2 +0 -0
  632. package/dist/fonts/noto-sans-tc-41-700-normal.woff2 +0 -0
  633. package/dist/fonts/noto-sans-tc-42-400-normal.woff2 +0 -0
  634. package/dist/fonts/noto-sans-tc-42-500-normal.woff2 +0 -0
  635. package/dist/fonts/noto-sans-tc-42-600-normal.woff2 +0 -0
  636. package/dist/fonts/noto-sans-tc-42-700-normal.woff2 +0 -0
  637. package/dist/fonts/noto-sans-tc-43-400-normal.woff2 +0 -0
  638. package/dist/fonts/noto-sans-tc-43-500-normal.woff2 +0 -0
  639. package/dist/fonts/noto-sans-tc-43-600-normal.woff2 +0 -0
  640. package/dist/fonts/noto-sans-tc-43-700-normal.woff2 +0 -0
  641. package/dist/fonts/noto-sans-tc-44-400-normal.woff2 +0 -0
  642. package/dist/fonts/noto-sans-tc-44-500-normal.woff2 +0 -0
  643. package/dist/fonts/noto-sans-tc-44-600-normal.woff2 +0 -0
  644. package/dist/fonts/noto-sans-tc-44-700-normal.woff2 +0 -0
  645. package/dist/fonts/noto-sans-tc-45-400-normal.woff2 +0 -0
  646. package/dist/fonts/noto-sans-tc-45-500-normal.woff2 +0 -0
  647. package/dist/fonts/noto-sans-tc-45-600-normal.woff2 +0 -0
  648. package/dist/fonts/noto-sans-tc-45-700-normal.woff2 +0 -0
  649. package/dist/fonts/noto-sans-tc-46-400-normal.woff2 +0 -0
  650. package/dist/fonts/noto-sans-tc-46-500-normal.woff2 +0 -0
  651. package/dist/fonts/noto-sans-tc-46-600-normal.woff2 +0 -0
  652. package/dist/fonts/noto-sans-tc-46-700-normal.woff2 +0 -0
  653. package/dist/fonts/noto-sans-tc-47-400-normal.woff2 +0 -0
  654. package/dist/fonts/noto-sans-tc-47-500-normal.woff2 +0 -0
  655. package/dist/fonts/noto-sans-tc-47-600-normal.woff2 +0 -0
  656. package/dist/fonts/noto-sans-tc-47-700-normal.woff2 +0 -0
  657. package/dist/fonts/noto-sans-tc-48-400-normal.woff2 +0 -0
  658. package/dist/fonts/noto-sans-tc-48-500-normal.woff2 +0 -0
  659. package/dist/fonts/noto-sans-tc-48-600-normal.woff2 +0 -0
  660. package/dist/fonts/noto-sans-tc-48-700-normal.woff2 +0 -0
  661. package/dist/fonts/noto-sans-tc-49-400-normal.woff2 +0 -0
  662. package/dist/fonts/noto-sans-tc-49-500-normal.woff2 +0 -0
  663. package/dist/fonts/noto-sans-tc-49-600-normal.woff2 +0 -0
  664. package/dist/fonts/noto-sans-tc-49-700-normal.woff2 +0 -0
  665. package/dist/fonts/noto-sans-tc-50-400-normal.woff2 +0 -0
  666. package/dist/fonts/noto-sans-tc-50-500-normal.woff2 +0 -0
  667. package/dist/fonts/noto-sans-tc-50-600-normal.woff2 +0 -0
  668. package/dist/fonts/noto-sans-tc-50-700-normal.woff2 +0 -0
  669. package/dist/fonts/noto-sans-tc-51-400-normal.woff2 +0 -0
  670. package/dist/fonts/noto-sans-tc-51-500-normal.woff2 +0 -0
  671. package/dist/fonts/noto-sans-tc-51-600-normal.woff2 +0 -0
  672. package/dist/fonts/noto-sans-tc-51-700-normal.woff2 +0 -0
  673. package/dist/fonts/noto-sans-tc-52-400-normal.woff2 +0 -0
  674. package/dist/fonts/noto-sans-tc-52-500-normal.woff2 +0 -0
  675. package/dist/fonts/noto-sans-tc-52-600-normal.woff2 +0 -0
  676. package/dist/fonts/noto-sans-tc-52-700-normal.woff2 +0 -0
  677. package/dist/fonts/noto-sans-tc-53-400-normal.woff2 +0 -0
  678. package/dist/fonts/noto-sans-tc-53-500-normal.woff2 +0 -0
  679. package/dist/fonts/noto-sans-tc-53-600-normal.woff2 +0 -0
  680. package/dist/fonts/noto-sans-tc-53-700-normal.woff2 +0 -0
  681. package/dist/fonts/noto-sans-tc-54-400-normal.woff2 +0 -0
  682. package/dist/fonts/noto-sans-tc-54-500-normal.woff2 +0 -0
  683. package/dist/fonts/noto-sans-tc-54-600-normal.woff2 +0 -0
  684. package/dist/fonts/noto-sans-tc-54-700-normal.woff2 +0 -0
  685. package/dist/fonts/noto-sans-tc-55-400-normal.woff2 +0 -0
  686. package/dist/fonts/noto-sans-tc-55-500-normal.woff2 +0 -0
  687. package/dist/fonts/noto-sans-tc-55-600-normal.woff2 +0 -0
  688. package/dist/fonts/noto-sans-tc-55-700-normal.woff2 +0 -0
  689. package/dist/fonts/noto-sans-tc-56-400-normal.woff2 +0 -0
  690. package/dist/fonts/noto-sans-tc-56-500-normal.woff2 +0 -0
  691. package/dist/fonts/noto-sans-tc-56-600-normal.woff2 +0 -0
  692. package/dist/fonts/noto-sans-tc-56-700-normal.woff2 +0 -0
  693. package/dist/fonts/noto-sans-tc-57-400-normal.woff2 +0 -0
  694. package/dist/fonts/noto-sans-tc-57-500-normal.woff2 +0 -0
  695. package/dist/fonts/noto-sans-tc-57-600-normal.woff2 +0 -0
  696. package/dist/fonts/noto-sans-tc-57-700-normal.woff2 +0 -0
  697. package/dist/fonts/noto-sans-tc-58-400-normal.woff2 +0 -0
  698. package/dist/fonts/noto-sans-tc-58-500-normal.woff2 +0 -0
  699. package/dist/fonts/noto-sans-tc-58-600-normal.woff2 +0 -0
  700. package/dist/fonts/noto-sans-tc-58-700-normal.woff2 +0 -0
  701. package/dist/fonts/noto-sans-tc-59-400-normal.woff2 +0 -0
  702. package/dist/fonts/noto-sans-tc-59-500-normal.woff2 +0 -0
  703. package/dist/fonts/noto-sans-tc-59-600-normal.woff2 +0 -0
  704. package/dist/fonts/noto-sans-tc-59-700-normal.woff2 +0 -0
  705. package/dist/fonts/noto-sans-tc-60-400-normal.woff2 +0 -0
  706. package/dist/fonts/noto-sans-tc-60-500-normal.woff2 +0 -0
  707. package/dist/fonts/noto-sans-tc-60-600-normal.woff2 +0 -0
  708. package/dist/fonts/noto-sans-tc-60-700-normal.woff2 +0 -0
  709. package/dist/fonts/noto-sans-tc-61-400-normal.woff2 +0 -0
  710. package/dist/fonts/noto-sans-tc-61-500-normal.woff2 +0 -0
  711. package/dist/fonts/noto-sans-tc-61-600-normal.woff2 +0 -0
  712. package/dist/fonts/noto-sans-tc-61-700-normal.woff2 +0 -0
  713. package/dist/fonts/noto-sans-tc-62-400-normal.woff2 +0 -0
  714. package/dist/fonts/noto-sans-tc-62-500-normal.woff2 +0 -0
  715. package/dist/fonts/noto-sans-tc-62-600-normal.woff2 +0 -0
  716. package/dist/fonts/noto-sans-tc-62-700-normal.woff2 +0 -0
  717. package/dist/fonts/noto-sans-tc-63-400-normal.woff2 +0 -0
  718. package/dist/fonts/noto-sans-tc-63-500-normal.woff2 +0 -0
  719. package/dist/fonts/noto-sans-tc-63-600-normal.woff2 +0 -0
  720. package/dist/fonts/noto-sans-tc-63-700-normal.woff2 +0 -0
  721. package/dist/fonts/noto-sans-tc-64-400-normal.woff2 +0 -0
  722. package/dist/fonts/noto-sans-tc-64-500-normal.woff2 +0 -0
  723. package/dist/fonts/noto-sans-tc-64-600-normal.woff2 +0 -0
  724. package/dist/fonts/noto-sans-tc-64-700-normal.woff2 +0 -0
  725. package/dist/fonts/noto-sans-tc-65-400-normal.woff2 +0 -0
  726. package/dist/fonts/noto-sans-tc-65-500-normal.woff2 +0 -0
  727. package/dist/fonts/noto-sans-tc-65-600-normal.woff2 +0 -0
  728. package/dist/fonts/noto-sans-tc-65-700-normal.woff2 +0 -0
  729. package/dist/fonts/noto-sans-tc-66-400-normal.woff2 +0 -0
  730. package/dist/fonts/noto-sans-tc-66-500-normal.woff2 +0 -0
  731. package/dist/fonts/noto-sans-tc-66-600-normal.woff2 +0 -0
  732. package/dist/fonts/noto-sans-tc-66-700-normal.woff2 +0 -0
  733. package/dist/fonts/noto-sans-tc-67-400-normal.woff2 +0 -0
  734. package/dist/fonts/noto-sans-tc-67-500-normal.woff2 +0 -0
  735. package/dist/fonts/noto-sans-tc-67-600-normal.woff2 +0 -0
  736. package/dist/fonts/noto-sans-tc-67-700-normal.woff2 +0 -0
  737. package/dist/fonts/noto-sans-tc-68-400-normal.woff2 +0 -0
  738. package/dist/fonts/noto-sans-tc-68-500-normal.woff2 +0 -0
  739. package/dist/fonts/noto-sans-tc-68-600-normal.woff2 +0 -0
  740. package/dist/fonts/noto-sans-tc-68-700-normal.woff2 +0 -0
  741. package/dist/fonts/noto-sans-tc-69-400-normal.woff2 +0 -0
  742. package/dist/fonts/noto-sans-tc-69-500-normal.woff2 +0 -0
  743. package/dist/fonts/noto-sans-tc-69-600-normal.woff2 +0 -0
  744. package/dist/fonts/noto-sans-tc-69-700-normal.woff2 +0 -0
  745. package/dist/fonts/noto-sans-tc-70-400-normal.woff2 +0 -0
  746. package/dist/fonts/noto-sans-tc-70-500-normal.woff2 +0 -0
  747. package/dist/fonts/noto-sans-tc-70-600-normal.woff2 +0 -0
  748. package/dist/fonts/noto-sans-tc-70-700-normal.woff2 +0 -0
  749. package/dist/fonts/noto-sans-tc-71-400-normal.woff2 +0 -0
  750. package/dist/fonts/noto-sans-tc-71-500-normal.woff2 +0 -0
  751. package/dist/fonts/noto-sans-tc-71-600-normal.woff2 +0 -0
  752. package/dist/fonts/noto-sans-tc-71-700-normal.woff2 +0 -0
  753. package/dist/fonts/noto-sans-tc-72-400-normal.woff2 +0 -0
  754. package/dist/fonts/noto-sans-tc-72-500-normal.woff2 +0 -0
  755. package/dist/fonts/noto-sans-tc-72-600-normal.woff2 +0 -0
  756. package/dist/fonts/noto-sans-tc-72-700-normal.woff2 +0 -0
  757. package/dist/fonts/noto-sans-tc-73-400-normal.woff2 +0 -0
  758. package/dist/fonts/noto-sans-tc-73-500-normal.woff2 +0 -0
  759. package/dist/fonts/noto-sans-tc-73-600-normal.woff2 +0 -0
  760. package/dist/fonts/noto-sans-tc-73-700-normal.woff2 +0 -0
  761. package/dist/fonts/noto-sans-tc-74-400-normal.woff2 +0 -0
  762. package/dist/fonts/noto-sans-tc-74-500-normal.woff2 +0 -0
  763. package/dist/fonts/noto-sans-tc-74-600-normal.woff2 +0 -0
  764. package/dist/fonts/noto-sans-tc-74-700-normal.woff2 +0 -0
  765. package/dist/fonts/noto-sans-tc-75-400-normal.woff2 +0 -0
  766. package/dist/fonts/noto-sans-tc-75-500-normal.woff2 +0 -0
  767. package/dist/fonts/noto-sans-tc-75-600-normal.woff2 +0 -0
  768. package/dist/fonts/noto-sans-tc-75-700-normal.woff2 +0 -0
  769. package/dist/fonts/noto-sans-tc-76-400-normal.woff2 +0 -0
  770. package/dist/fonts/noto-sans-tc-76-500-normal.woff2 +0 -0
  771. package/dist/fonts/noto-sans-tc-76-600-normal.woff2 +0 -0
  772. package/dist/fonts/noto-sans-tc-76-700-normal.woff2 +0 -0
  773. package/dist/fonts/noto-sans-tc-77-400-normal.woff2 +0 -0
  774. package/dist/fonts/noto-sans-tc-77-500-normal.woff2 +0 -0
  775. package/dist/fonts/noto-sans-tc-77-600-normal.woff2 +0 -0
  776. package/dist/fonts/noto-sans-tc-77-700-normal.woff2 +0 -0
  777. package/dist/fonts/noto-sans-tc-78-400-normal.woff2 +0 -0
  778. package/dist/fonts/noto-sans-tc-78-500-normal.woff2 +0 -0
  779. package/dist/fonts/noto-sans-tc-78-600-normal.woff2 +0 -0
  780. package/dist/fonts/noto-sans-tc-78-700-normal.woff2 +0 -0
  781. package/dist/fonts/noto-sans-tc-79-400-normal.woff2 +0 -0
  782. package/dist/fonts/noto-sans-tc-79-500-normal.woff2 +0 -0
  783. package/dist/fonts/noto-sans-tc-79-600-normal.woff2 +0 -0
  784. package/dist/fonts/noto-sans-tc-79-700-normal.woff2 +0 -0
  785. package/dist/fonts/noto-sans-tc-80-400-normal.woff2 +0 -0
  786. package/dist/fonts/noto-sans-tc-80-500-normal.woff2 +0 -0
  787. package/dist/fonts/noto-sans-tc-80-600-normal.woff2 +0 -0
  788. package/dist/fonts/noto-sans-tc-80-700-normal.woff2 +0 -0
  789. package/dist/fonts/noto-sans-tc-81-400-normal.woff2 +0 -0
  790. package/dist/fonts/noto-sans-tc-81-500-normal.woff2 +0 -0
  791. package/dist/fonts/noto-sans-tc-81-600-normal.woff2 +0 -0
  792. package/dist/fonts/noto-sans-tc-81-700-normal.woff2 +0 -0
  793. package/dist/fonts/noto-sans-tc-82-400-normal.woff2 +0 -0
  794. package/dist/fonts/noto-sans-tc-82-500-normal.woff2 +0 -0
  795. package/dist/fonts/noto-sans-tc-82-600-normal.woff2 +0 -0
  796. package/dist/fonts/noto-sans-tc-82-700-normal.woff2 +0 -0
  797. package/dist/fonts/noto-sans-tc-83-400-normal.woff2 +0 -0
  798. package/dist/fonts/noto-sans-tc-83-500-normal.woff2 +0 -0
  799. package/dist/fonts/noto-sans-tc-83-600-normal.woff2 +0 -0
  800. package/dist/fonts/noto-sans-tc-83-700-normal.woff2 +0 -0
  801. package/dist/fonts/noto-sans-tc-84-400-normal.woff2 +0 -0
  802. package/dist/fonts/noto-sans-tc-84-500-normal.woff2 +0 -0
  803. package/dist/fonts/noto-sans-tc-84-600-normal.woff2 +0 -0
  804. package/dist/fonts/noto-sans-tc-84-700-normal.woff2 +0 -0
  805. package/dist/fonts/noto-sans-tc-85-400-normal.woff2 +0 -0
  806. package/dist/fonts/noto-sans-tc-85-500-normal.woff2 +0 -0
  807. package/dist/fonts/noto-sans-tc-85-600-normal.woff2 +0 -0
  808. package/dist/fonts/noto-sans-tc-85-700-normal.woff2 +0 -0
  809. package/dist/fonts/noto-sans-tc-86-400-normal.woff2 +0 -0
  810. package/dist/fonts/noto-sans-tc-86-500-normal.woff2 +0 -0
  811. package/dist/fonts/noto-sans-tc-86-600-normal.woff2 +0 -0
  812. package/dist/fonts/noto-sans-tc-86-700-normal.woff2 +0 -0
  813. package/dist/fonts/noto-sans-tc-87-400-normal.woff2 +0 -0
  814. package/dist/fonts/noto-sans-tc-87-500-normal.woff2 +0 -0
  815. package/dist/fonts/noto-sans-tc-87-600-normal.woff2 +0 -0
  816. package/dist/fonts/noto-sans-tc-87-700-normal.woff2 +0 -0
  817. package/dist/fonts/noto-sans-tc-88-400-normal.woff2 +0 -0
  818. package/dist/fonts/noto-sans-tc-88-500-normal.woff2 +0 -0
  819. package/dist/fonts/noto-sans-tc-88-600-normal.woff2 +0 -0
  820. package/dist/fonts/noto-sans-tc-88-700-normal.woff2 +0 -0
  821. package/dist/fonts/noto-sans-tc-89-400-normal.woff2 +0 -0
  822. package/dist/fonts/noto-sans-tc-89-500-normal.woff2 +0 -0
  823. package/dist/fonts/noto-sans-tc-89-600-normal.woff2 +0 -0
  824. package/dist/fonts/noto-sans-tc-89-700-normal.woff2 +0 -0
  825. package/dist/fonts/noto-sans-tc-90-400-normal.woff2 +0 -0
  826. package/dist/fonts/noto-sans-tc-90-500-normal.woff2 +0 -0
  827. package/dist/fonts/noto-sans-tc-90-600-normal.woff2 +0 -0
  828. package/dist/fonts/noto-sans-tc-90-700-normal.woff2 +0 -0
  829. package/dist/fonts/noto-sans-tc-91-400-normal.woff2 +0 -0
  830. package/dist/fonts/noto-sans-tc-91-500-normal.woff2 +0 -0
  831. package/dist/fonts/noto-sans-tc-91-600-normal.woff2 +0 -0
  832. package/dist/fonts/noto-sans-tc-91-700-normal.woff2 +0 -0
  833. package/dist/fonts/noto-sans-tc-92-400-normal.woff2 +0 -0
  834. package/dist/fonts/noto-sans-tc-92-500-normal.woff2 +0 -0
  835. package/dist/fonts/noto-sans-tc-92-600-normal.woff2 +0 -0
  836. package/dist/fonts/noto-sans-tc-92-700-normal.woff2 +0 -0
  837. package/dist/fonts/noto-sans-tc-93-400-normal.woff2 +0 -0
  838. package/dist/fonts/noto-sans-tc-93-500-normal.woff2 +0 -0
  839. package/dist/fonts/noto-sans-tc-93-600-normal.woff2 +0 -0
  840. package/dist/fonts/noto-sans-tc-93-700-normal.woff2 +0 -0
  841. package/dist/fonts/noto-sans-tc-94-400-normal.woff2 +0 -0
  842. package/dist/fonts/noto-sans-tc-94-500-normal.woff2 +0 -0
  843. package/dist/fonts/noto-sans-tc-94-600-normal.woff2 +0 -0
  844. package/dist/fonts/noto-sans-tc-94-700-normal.woff2 +0 -0
  845. package/dist/fonts/noto-sans-tc-95-400-normal.woff2 +0 -0
  846. package/dist/fonts/noto-sans-tc-95-500-normal.woff2 +0 -0
  847. package/dist/fonts/noto-sans-tc-95-600-normal.woff2 +0 -0
  848. package/dist/fonts/noto-sans-tc-95-700-normal.woff2 +0 -0
  849. package/dist/fonts/noto-sans-tc-96-400-normal.woff2 +0 -0
  850. package/dist/fonts/noto-sans-tc-96-500-normal.woff2 +0 -0
  851. package/dist/fonts/noto-sans-tc-96-600-normal.woff2 +0 -0
  852. package/dist/fonts/noto-sans-tc-96-700-normal.woff2 +0 -0
  853. package/dist/fonts/noto-sans-tc-cyrillic-400-normal.woff2 +0 -0
  854. package/dist/fonts/noto-sans-tc-cyrillic-500-normal.woff2 +0 -0
  855. package/dist/fonts/noto-sans-tc-cyrillic-600-normal.woff2 +0 -0
  856. package/dist/fonts/noto-sans-tc-cyrillic-700-normal.woff2 +0 -0
  857. package/dist/fonts/noto-sans-tc-latin-400-normal.woff2 +0 -0
  858. package/dist/fonts/noto-sans-tc-latin-500-normal.woff2 +0 -0
  859. package/dist/fonts/noto-sans-tc-latin-600-normal.woff2 +0 -0
  860. package/dist/fonts/noto-sans-tc-latin-700-normal.woff2 +0 -0
  861. package/dist/fonts/noto-sans-tc-latin-ext-400-normal.woff2 +0 -0
  862. package/dist/fonts/noto-sans-tc-latin-ext-500-normal.woff2 +0 -0
  863. package/dist/fonts/noto-sans-tc-latin-ext-600-normal.woff2 +0 -0
  864. package/dist/fonts/noto-sans-tc-latin-ext-700-normal.woff2 +0 -0
  865. package/dist/fonts/noto-sans-tc-vietnamese-400-normal.woff2 +0 -0
  866. package/dist/fonts/noto-sans-tc-vietnamese-500-normal.woff2 +0 -0
  867. package/dist/fonts/noto-sans-tc-vietnamese-600-normal.woff2 +0 -0
  868. package/dist/fonts/noto-sans-tc-vietnamese-700-normal.woff2 +0 -0
@@ -6,6 +6,7 @@ export interface AccentPickerProps {
6
6
  onChange?: (hex: string) => void;
7
7
  /** Default 「強調色」. */
8
8
  label?: string;
9
+ /** Extra class on the root element. */
9
10
  className?: string;
10
11
  }
11
12
  /** 8 swatches plus a hex field for any color. */
@@ -1,9 +1,13 @@
1
1
  "use client";
2
2
  import { tr } from "../../i18n.js";
3
3
  import { Icon } from "../../icons/Icon.js";
4
- import { browserKey, cx } from "../../internal/util.js";
5
- import { ACCENT_SWATCHES, setAccent, storedAccent } from "../../theme.js";
4
+ import { cx } from "../../internal/util.js";
5
+ import { useStored } from "../../internal/stored.js";
6
+ import { useRovingRadio } from "../../internal/roving.js";
7
+ import { FieldErrorIcon, FieldMessage } from "../../internal/Field.js";
8
+ import { ACCENT_KEY, ACCENT_SWATCHES, defaultAccent, parseAccent, setAccent } from "../../theme.js";
6
9
  import { includeIcons } from "../../icons/store.js";
10
+ import { DEFAULT_ACCENT } from "../../generated/themeDefaults.js";
7
11
  import check_default from "../../icons/ph/check.js";
8
12
  import * as React from "react";
9
13
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -11,87 +15,103 @@ import { jsx, jsxs } from "react/jsx-runtime";
11
15
  includeIcons(check_default);
12
16
  const SWATCHES = ACCENT_SWATCHES;
13
17
  const HEX = /^#[0-9a-fA-F]{6}$/;
18
+ const noSubscribe = () => () => {};
19
+ const serverAccent = () => DEFAULT_ACCENT;
14
20
  /** 8 swatches plus a hex field for any color. */
15
21
  function AccentPicker({ value, onChange, label, className }) {
16
- const [own, setOwn] = React.useState(() => (value || storedAccent()).toLowerCase());
22
+ const [stored] = useStored(ACCENT_KEY, parseAccent, null);
23
+ const fallback = React.useSyncExternalStore(noSubscribe, defaultAccent, serverAccent);
24
+ const [own, setOwn] = React.useState(null);
17
25
  const [hexIn, setHexIn] = React.useState("");
18
- const cur = (value || own).toLowerCase();
26
+ const cur = (value || own || stored || fallback).toLowerCase();
19
27
  const pick = (c) => {
20
28
  setOwn(c);
21
29
  if (onChange) onChange(c);
22
30
  else setAccent(c);
23
31
  };
24
- const bad = !!hexIn && !HEX.test(hexIn);
25
- const refs = React.useRef([]);
32
+ const [checked, setChecked] = React.useState(false);
33
+ const bad = checked && !!hexIn && !HEX.test(hexIn);
34
+ const ids = React.useId();
35
+ const roving = useRovingRadio(SWATCHES.length, (i) => {
36
+ setHexIn("");
37
+ setChecked(false);
38
+ pick(SWATCHES[i][1]);
39
+ });
26
40
  const tabStop = Math.max(0, SWATCHES.findIndex(([, hex]) => hex === cur));
27
41
  return /* @__PURE__ */ jsxs("div", {
28
- className: cx("ui-accentpick", className),
29
- children: [/* @__PURE__ */ jsx("div", {
30
- role: "radiogroup",
31
- "aria-label": label || tr("強調色"),
32
- className: "ui-accentpick-swatches",
33
- children: SWATCHES.map(([name, hex], i) => {
34
- const on = cur === hex;
35
- return /* @__PURE__ */ jsx("button", {
36
- ref: (el) => {
37
- refs.current[i] = el;
38
- },
39
- type: "button",
40
- role: "radio",
41
- "aria-checked": on,
42
- tabIndex: i === tabStop ? 0 : -1,
43
- "aria-label": tr(name),
44
- title: tr(name),
45
- className: cx("ui-swatch", on && "is-on"),
46
- style: {
47
- background: hex,
48
- color: hex
49
- },
50
- onClick: () => {
51
- setHexIn("");
52
- pick(hex);
53
- },
54
- onKeyDown: (e) => {
55
- if (browserKey(e)) return;
56
- const n = SWATCHES.length;
57
- const to = e.key === "ArrowRight" || e.key === "ArrowDown" ? (i + 1) % n : e.key === "ArrowLeft" || e.key === "ArrowUp" ? (i - 1 + n) % n : -1;
58
- if (to < 0) return;
59
- e.preventDefault();
60
- refs.current[to]?.focus();
61
- setHexIn("");
62
- pick(SWATCHES[to][1]);
63
- },
64
- children: on ? /* @__PURE__ */ jsx(Icon, {
65
- name: "check",
66
- size: 14
67
- }) : null
68
- }, hex);
69
- })
70
- }), /* @__PURE__ */ jsxs("div", {
71
- className: "ui-accentpick-hex",
72
- children: [
73
- /* @__PURE__ */ jsx("span", {
74
- className: "ui-accentpick-preview",
75
- style: { background: !bad && hexIn ? hexIn : cur }
76
- }),
77
- /* @__PURE__ */ jsx("input", {
78
- className: cx("ui-input", bad && "is-invalid"),
79
- "aria-label": tr("自訂強調色(色碼)"),
80
- "aria-invalid": bad || void 0,
81
- value: hexIn,
82
- placeholder: cur,
83
- onChange: (e) => {
84
- const x = e.target.value.trim();
85
- setHexIn(x);
86
- if (HEX.test(x)) pick(x.toLowerCase());
87
- }
88
- }),
89
- /* @__PURE__ */ jsx("span", {
90
- className: cx("ui-field-hint", bad && "is-error"),
91
- children: bad ? tr("色碼格式不正確,例如 #2457d6") : tr("輸入 # 加 6 碼")
42
+ className: cx("ui-field", "ui-accentpick", className),
43
+ children: [
44
+ /* @__PURE__ */ jsx("div", {
45
+ id: ids + "-label",
46
+ className: "ui-field-label",
47
+ children: label || tr("強調色")
48
+ }),
49
+ /* @__PURE__ */ jsx("div", {
50
+ role: "radiogroup",
51
+ "aria-labelledby": ids + "-label",
52
+ className: "ui-accentpick-swatches",
53
+ children: SWATCHES.map(([name, hex], i) => {
54
+ const on = cur === hex;
55
+ return /* @__PURE__ */ jsx("button", {
56
+ ref: roving.ref(i),
57
+ type: "button",
58
+ role: "radio",
59
+ "aria-checked": on,
60
+ tabIndex: i === tabStop ? 0 : -1,
61
+ "aria-label": tr(name),
62
+ title: tr(name),
63
+ className: cx("ui-swatch", on && "is-on"),
64
+ style: {
65
+ background: hex,
66
+ color: hex
67
+ },
68
+ onClick: () => {
69
+ setHexIn("");
70
+ pick(hex);
71
+ },
72
+ onKeyDown: roving.onKeyDown(i),
73
+ children: on ? /* @__PURE__ */ jsx(Icon, {
74
+ name: "check",
75
+ size: 14
76
+ }) : null
77
+ }, hex);
92
78
  })
93
- ]
94
- })]
79
+ }),
80
+ /* @__PURE__ */ jsxs("div", {
81
+ className: cx("ui-accentpick-hex", bad && "has-error"),
82
+ children: [/* @__PURE__ */ jsx("span", {
83
+ className: "ui-accentpick-preview",
84
+ style: { background: HEX.test(hexIn) ? hexIn : cur }
85
+ }), /* @__PURE__ */ jsxs("div", {
86
+ className: "ui-field-box",
87
+ children: [/* @__PURE__ */ jsx("input", {
88
+ className: cx("ui-input", bad && "is-invalid"),
89
+ "aria-label": tr("自訂強調色(色碼)"),
90
+ "aria-invalid": bad || void 0,
91
+ "aria-describedby": ids + "-msg",
92
+ value: hexIn,
93
+ placeholder: cur,
94
+ onChange: (e) => {
95
+ const x = e.target.value.trim();
96
+ setHexIn(x);
97
+ if (HEX.test(x)) {
98
+ setChecked(false);
99
+ pick(x.toLowerCase());
100
+ }
101
+ },
102
+ onBlur: () => setChecked(true),
103
+ onKeyDown: (e) => {
104
+ if (e.key === "Enter") setChecked(true);
105
+ }
106
+ }), bad ? /* @__PURE__ */ jsx(FieldErrorIcon, {}) : null]
107
+ })]
108
+ }),
109
+ /* @__PURE__ */ jsx(FieldMessage, {
110
+ id: ids + "-msg",
111
+ error: bad ? tr("色碼格式不正確,請輸入 # 加 6 碼,例如 #2457d6") : void 0,
112
+ hint: tr("輸入 # 加 6 碼")
113
+ })
114
+ ]
95
115
  });
96
116
  }
97
117
  export { AccentPicker };
@@ -1 +1 @@
1
- {"version":3,"file":"AccentPicker.js","names":["phCheck"],"sources":["../../../src/components/AccentPicker/AccentPicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { tr } from '../../i18n';\nimport { Icon } from '../../icons/Icon';\nimport { browserKey, cx } from '../../internal/util';\nimport { ACCENT_SWATCHES, setAccent, storedAccent } from '../../theme';\nimport { includeIcons } from '../../icons/store';\nimport phCheck from '../../icons/ph/check';\n\nincludeIcons(phCheck);\n\nconst SWATCHES = ACCENT_SWATCHES;\nconst HEX = /^#[0-9a-fA-F]{6}$/;\n\nexport interface AccentPickerProps {\n /** Controlled #rrggbb. Without it, the picker reads and sets the stored accent itself. */\n value?: string;\n /** Without it, picking applies the color with setAccent. */\n onChange?: (hex: string) => void;\n /** Default 「強調色」. */\n label?: string;\n className?: string;\n}\n\n/** 8 swatches plus a hex field for any color. */\nexport function AccentPicker({ value, onChange, label, className }: AccentPickerProps) {\n const [own, setOwn] = React.useState(() => (value || storedAccent()).toLowerCase());\n const [hexIn, setHexIn] = React.useState('');\n const cur = (value || own).toLowerCase();\n const pick = (c: string) => {\n setOwn(c);\n if (onChange) onChange(c);\n else setAccent(c);\n };\n const bad = !!hexIn && !HEX.test(hexIn);\n const refs = React.useRef<(HTMLButtonElement | null)[]>([]);\n // One Tab stop in the swatches (the chosen one, or the first for a custom color); arrow keys move and choose.\n const tabStop = Math.max(\n 0,\n SWATCHES.findIndex(([, hex]) => hex === cur),\n );\n return (\n <div className={cx('ui-accentpick', className)}>\n <div role=\"radiogroup\" aria-label={label || tr('強調色')} className=\"ui-accentpick-swatches\">\n {SWATCHES.map(([name, hex], i) => {\n const on = cur === hex;\n return (\n <button\n key={hex}\n ref={(el) => {\n refs.current[i] = el;\n }}\n type=\"button\"\n role=\"radio\"\n aria-checked={on}\n tabIndex={i === tabStop ? 0 : -1}\n aria-label={tr(name)}\n title={tr(name)}\n className={cx('ui-swatch', on && 'is-on')}\n style={{ background: hex, color: hex }}\n onClick={() => {\n setHexIn('');\n pick(hex);\n }}\n onKeyDown={(e) => {\n if (browserKey(e)) return;\n const n = SWATCHES.length;\n const to = e.key === 'ArrowRight' || e.key === 'ArrowDown' ? (i + 1) % n : e.key === 'ArrowLeft' || e.key === 'ArrowUp' ? (i - 1 + n) % n : -1;\n if (to < 0) return;\n e.preventDefault();\n refs.current[to]?.focus();\n setHexIn('');\n pick(SWATCHES[to][1]);\n }}\n >\n {on ? <Icon name=\"check\" size={14} /> : null}\n </button>\n );\n })}\n </div>\n <div className=\"ui-accentpick-hex\">\n <span className=\"ui-accentpick-preview\" style={{ background: !bad && hexIn ? hexIn : cur }} />\n <input\n className={cx('ui-input', bad && 'is-invalid')}\n aria-label={tr('自訂強調色(色碼)')}\n aria-invalid={bad || undefined}\n value={hexIn}\n placeholder={cur}\n onChange={(e) => {\n const x = e.target.value.trim();\n setHexIn(x);\n if (HEX.test(x)) pick(x.toLowerCase());\n }}\n />\n <span className={cx('ui-field-hint', bad && 'is-error')}>{bad ? tr('色碼格式不正確,例如 #2457d6') : tr('輸入 # 加 6 碼')}</span>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAQA,aAAaA,aAAO;AAEpB,MAAM,WAAW;AACjB,MAAM,MAAM;;AAaZ,SAAgB,aAAa,EAAE,OAAO,UAAU,OAAO,aAAgC;CACrF,MAAM,CAAC,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,GAAG,EAAE,MAAM;MACxB,SAAS,EAAE;MACX,KAAK,SAAS,GAAG,CAAC,EAAE;KACtB;KAEC,UAAA,KAAK,oBAAC,MAAD;MAAM,MAAK;MAAQ,MAAM;KAAK,CAAA,IAAI;IAClC,GA5BD,GA4BC;GAEZ,CAAC;EACE,CAAA,GACL,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACE,oBAAC,QAAD;KAAM,WAAU;KAAwB,OAAO,EAAE,YAAY,CAAC,OAAO,QAAQ,QAAQ,IAAI;IAAI,CAAA;IAC7F,oBAAC,SAAD;KACE,WAAW,GAAG,YAAY,OAAO,YAAY;KAC7C,cAAY,GAAG,WAAW;KAC1B,gBAAc,OAAO,KAAA;KACrB,OAAO;KACP,aAAa;KACb,WAAW,MAAM;MACf,MAAM,IAAI,EAAE,OAAO,MAAM,KAAK;MAC9B,SAAS,CAAC;MACV,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,EAAE,YAAY,CAAC;KACvC;IACD,CAAA;IACD,oBAAC,QAAD;KAAM,WAAW,GAAG,iBAAiB,OAAO,UAAU;KAAI,UAAA,MAAM,GAAG,oBAAoB,IAAI,GAAG,YAAY;IAAQ,CAAA;GAC/G;EACF,CAAA,CAAA;;AAET"}
1
+ {"version":3,"file":"AccentPicker.js","names":["phCheck"],"sources":["../../../src/components/AccentPicker/AccentPicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { tr } from '../../i18n';\nimport { Icon } from '../../icons/Icon';\nimport { cx } from '../../internal/util';\nimport { useStored } from '../../internal/stored';\nimport { useRovingRadio } from '../../internal/roving';\nimport { FieldErrorIcon, FieldMessage } from '../../internal/Field';\nimport { ACCENT_KEY, ACCENT_SWATCHES, DEFAULT_ACCENT, defaultAccent, parseAccent, setAccent } from '../../theme';\nimport { includeIcons } from '../../icons/store';\nimport phCheck from '../../icons/ph/check';\n\nincludeIcons(phCheck);\n\nconst SWATCHES = ACCENT_SWATCHES;\nconst HEX = /^#[0-9a-fA-F]{6}$/;\nconst noSubscribe = () => () => {};\nconst serverAccent = () => DEFAULT_ACCENT;\n\nexport interface AccentPickerProps {\n /** Controlled #rrggbb. Without it, the picker reads and sets the stored accent itself. */\n value?: string;\n /** Without it, picking applies the color with setAccent. */\n onChange?: (hex: string) => void;\n /** Default 「強調色」. */\n label?: string;\n /** Extra class on the root element. */\n className?: string;\n}\n\n/** 8 swatches plus a hex field for any color. */\nexport function AccentPicker({ value, onChange, label, className }: AccentPickerProps) {\n // The default accent on the server and the first browser render, then the stored pick (or the preset's accent).\n const [stored] = useStored<string | null>(ACCENT_KEY, parseAccent, null);\n const fallback = React.useSyncExternalStore(noSubscribe, defaultAccent, serverAccent);\n const [own, setOwn] = React.useState<string | null>(null);\n const [hexIn, setHexIn] = React.useState('');\n const cur = (value || own || stored || fallback).toLowerCase();\n const pick = (c: string) => {\n setOwn(c);\n if (onChange) onChange(c);\n else setAccent(c);\n };\n // Checked when the field is left or Enter is pressed, not on every key: 「#2」 is not wrong yet while typing.\n const [checked, setChecked] = React.useState(false);\n const bad = checked && !!hexIn && !HEX.test(hexIn);\n const ids = React.useId();\n const roving = useRovingRadio(SWATCHES.length, (i) => {\n setHexIn('');\n setChecked(false);\n pick(SWATCHES[i][1]);\n });\n // One Tab stop in the swatches (the chosen one, or the first for a custom color); arrow keys move and choose.\n const tabStop = Math.max(\n 0,\n SWATCHES.findIndex(([, hex]) => hex === cur),\n );\n return (\n <div className={cx('ui-field', 'ui-accentpick', className)}>\n {/* A visible label, as every field has. */}\n <div id={ids + '-label'} className=\"ui-field-label\">\n {label || tr('強調色')}\n </div>\n <div role=\"radiogroup\" aria-labelledby={ids + '-label'} className=\"ui-accentpick-swatches\">\n {SWATCHES.map(([name, hex], i) => {\n const on = cur === hex;\n return (\n <button\n key={hex}\n ref={roving.ref(i)}\n type=\"button\"\n role=\"radio\"\n aria-checked={on}\n tabIndex={i === tabStop ? 0 : -1}\n aria-label={tr(name)}\n title={tr(name)}\n className={cx('ui-swatch', on && 'is-on')}\n style={{ background: hex, color: hex }}\n onClick={() => {\n setHexIn('');\n pick(hex);\n }}\n onKeyDown={roving.onKeyDown(i)}\n >\n {on ? <Icon name=\"check\" size={14} /> : null}\n </button>\n );\n })}\n </div>\n <div className={cx('ui-accentpick-hex', bad && 'has-error')}>\n <span className=\"ui-accentpick-preview\" style={{ background: HEX.test(hexIn) ? hexIn : cur }} />\n <div className=\"ui-field-box\">\n <input\n className={cx('ui-input', bad && 'is-invalid')}\n aria-label={tr('自訂強調色(色碼)')}\n aria-invalid={bad || undefined}\n aria-describedby={ids + '-msg'}\n value={hexIn}\n placeholder={cur}\n onChange={(e) => {\n const x = e.target.value.trim();\n setHexIn(x);\n // A right code applies at once and clears an error; a wrong one waits for blur or Enter.\n if (HEX.test(x)) {\n setChecked(false);\n pick(x.toLowerCase());\n }\n }}\n onBlur={() => setChecked(true)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') setChecked(true);\n }}\n />\n {bad ? <FieldErrorIcon /> : null}\n </div>\n </div>\n <FieldMessage id={ids + '-msg'} error={bad ? tr('色碼格式不正確,請輸入 # 加 6 碼,例如 #2457d6') : undefined} hint={tr('輸入 # 加 6 碼')} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAWA,aAAaA,aAAO;AAEpB,MAAM,WAAW;AACjB,MAAM,MAAM;AACZ,MAAM,0BAA0B,CAAC;AACjC,MAAM,qBAAqB;;AAc3B,SAAgB,aAAa,EAAE,OAAO,UAAU,OAAO,aAAgC;CAErF,MAAM,CAAC,UAAU,UAAyB,YAAY,aAAa,IAAI;CACvE,MAAM,WAAW,MAAM,qBAAqB,aAAa,eAAe,YAAY;CACpF,MAAM,CAAC,KAAK,UAAU,MAAM,SAAwB,IAAI;CACxD,MAAM,CAAC,OAAO,YAAY,MAAM,SAAS,EAAE;CAC3C,MAAM,OAAO,SAAS,OAAO,UAAU,SAAA,CAAU,YAAY;CAC7D,MAAM,QAAQ,MAAc;EAC1B,OAAO,CAAC;EACR,I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M,WAAU;KAAwB,OAAO,EAAE,YAAY,IAAI,KAAK,KAAK,IAAI,QAAQ,IAAI;IAAI,CAAA,GAC/F,qBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACE,oBAAC,SAAD;MACE,WAAW,GAAG,YAAY,OAAO,YAAY;MAC7C,cAAY,GAAG,WAAW;MAC1B,gBAAc,OAAO,KAAA;MACrB,oBAAkB,MAAM;MACxB,OAAO;MACP,aAAa;MACb,WAAW,MAAM;OACf,MAAM,IAAI,EAAE,OAAO,MAAM,KAAK;OAC9B,SAAS,CAAC;OAEV,IAAI,IAAI,KAAK,CAAC,GAAG;QACf,WAAW,KAAK;QAChB,KAAK,EAAE,YAAY,CAAC;OACtB;MACF;MACA,cAAc,WAAW,IAAI;MAC7B,YAAY,MAAM;OAChB,IAAI,EAAE,QAAQ,SAAS,WAAW,IAAI;MACxC;KACD,CAAA,GACA,MAAM,oBAAC,gBAAD,CAAiB,CAAA,IAAI,IACzB;IACF,CAAA,CAAA;;GACL,oBAAC,cAAD;IAAc,IAAI,MAAM;IAAQ,OAAO,MAAM,GAAG,gCAAgC,IAAI,KAAA;IAAW,MAAM,GAAG,YAAY;GAAI,CAAA;EACrH;;AAET"}
@@ -19,7 +19,9 @@ export type ActionBarAction = (ActionBase & {
19
19
  primary?: false;
20
20
  });
21
21
  export interface ActionBarProps {
22
+ /** The actions, in order: all buttons in a row; under 600 px only the primary one, the others in a 「更多」 menu. */
22
23
  actions: ActionBarAction[];
24
+ /** Extra class on the root element. */
23
25
  className?: string;
24
26
  }
25
27
  /** A card's actions in a row. Under 600 px the primary one fills the width and the rest go into 「更多」. */
@@ -1 +1 @@
1
- {"version":3,"file":"ActionBar.js","names":[],"sources":["../../../src/components/ActionBar/ActionBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { tr } from '../../i18n';\nimport type { IconSource } from '../../icons/Icon';\nimport { useFocusRescue } from '../../internal/focus';\nimport { cx } from '../../internal/util';\nimport { Button, type DangerConfirm } from '../Button/Button';\nimport { Menu, type MenuItem } from '../Menu/Menu';\n\ninterface ActionBase {\n /** A verb. */\n label: string;\n onClick?: () => void;\n icon?: IconSource;\n disabled?: boolean;\n}\n\nexport type ActionBarAction =\n | (ActionBase & {\n /** The one primary action. Default: the first action. */\n primary?: boolean;\n danger?: false;\n })\n | (ActionBase & {\n /** Red in the 「更多」 menu, confirmed first. */\n danger: true;\n confirm: DangerConfirm;\n primary?: false;\n });\n\nexport interface ActionBarProps {\n actions: ActionBarAction[];\n className?: string;\n}\n\n/** A card's actions in a row. Under 600 px the primary one fills the width and the rest go into 「更多」. */\nexport function ActionBar({ actions, className }: ActionBarProps) {\n // A button that is removed, replaced or disabled after a press hands focus to its neighbour.\n const box = React.useRef<HTMLDivElement>(null);\n useFocusRescue(box);\n const main = actions.find((a) => a.primary) ?? actions.find((a) => !a.danger);\n const others = actions.filter((a) => a !== main);\n const button = (a: ActionBarAction, i: number, wide: boolean) =>\n a.danger ? (\n <Button key={i} variant=\"danger\" confirm={a.confirm} icon={a.icon} onClick={a.onClick} disabled={a.disabled}>\n {a.label}\n </Button>\n ) : (\n <Button\n key={i}\n variant={a === main ? 'primary' : 'secondary'}\n icon={a.icon}\n onClick={a.onClick}\n disabled={a.disabled}\n className={wide ? 'ui-actbar-main' : undefined}\n >\n {a.label}\n </Button>\n );\n const menuItems = others.map((a): MenuItem =>\n a.danger\n ? { label: a.label, icon: a.icon, onSelect: a.onClick, disabled: a.disabled, danger: true, confirm: a.confirm }\n : { label: a.label, icon: a.icon, onSelect: a.onClick, disabled: a.disabled },\n );\n return (\n <div ref={box} className={cx('ui-actbar', className)}>\n <div className=\"ui-actbar-wide\">{(main ? [main, ...others] : others).map((a, i) => button(a, i, false))}</div>\n <div className=\"ui-actbar-narrow\">\n {main ? button(main, 0, true) : null}\n {others.length ? <Menu label={tr('更多操作')} triggerClassName=\"ui-actbar-more\" items={menuItems} /> : null}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAmCA,SAAgB,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GAAY,CAAA,IAAI,IAChG;EACF,CAAA,CAAA;;AAET"}
1
+ {"version":3,"file":"ActionBar.js","names":[],"sources":["../../../src/components/ActionBar/ActionBar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { tr } from '../../i18n';\nimport type { IconSource } from '../../icons/Icon';\nimport { useFocusRescue } from '../../internal/focus';\nimport { cx } from '../../internal/util';\nimport { Button, type DangerConfirm } from '../Button/Button';\nimport { Menu, type MenuItem } from '../Menu/Menu';\n\ninterface ActionBase {\n /** A verb. */\n label: string;\n onClick?: () => void;\n icon?: IconSource;\n disabled?: boolean;\n}\n\nexport type ActionBarAction =\n | (ActionBase & {\n /** The one primary action. Default: the first action. */\n primary?: boolean;\n danger?: false;\n })\n | (ActionBase & {\n /** Red in the 「更多」 menu, confirmed first. */\n danger: true;\n confirm: DangerConfirm;\n primary?: false;\n });\n\nexport interface ActionBarProps {\n /** The actions, in order: all buttons in a row; under 600 px only the primary one, the others in a 「更多」 menu. */\n actions: ActionBarAction[];\n /** Extra class on the root element. */\n className?: string;\n}\n\n/** A card's actions in a row. Under 600 px the primary one fills the width and the rest go into 「更多」. */\nexport function ActionBar({ actions, className }: ActionBarProps) {\n // A button that is removed, replaced or disabled after a press hands focus to its neighbour.\n const box = React.useRef<HTMLDivElement>(null);\n useFocusRescue(box);\n const main = actions.find((a) => a.primary) ?? actions.find((a) => !a.danger);\n const others = actions.filter((a) => a !== main);\n const button = (a: ActionBarAction, i: number, wide: boolean) =>\n a.danger ? (\n <Button key={i} variant=\"danger\" confirm={a.confirm} icon={a.icon} onClick={a.onClick} disabled={a.disabled}>\n {a.label}\n </Button>\n ) : (\n <Button\n key={i}\n variant={a === main ? 'primary' : 'secondary'}\n icon={a.icon}\n onClick={a.onClick}\n disabled={a.disabled}\n className={wide ? 'ui-actbar-main' : undefined}\n >\n {a.label}\n </Button>\n );\n const menuItems = others.map((a): MenuItem =>\n a.danger\n ? { label: a.label, icon: a.icon, onSelect: a.onClick, disabled: a.disabled, danger: true, confirm: a.confirm }\n : { label: a.label, icon: a.icon, onSelect: a.onClick, disabled: a.disabled },\n );\n return (\n <div ref={box} className={cx('ui-actbar', className)}>\n <div className=\"ui-actbar-wide\">{(main ? [main, ...others] : others).map((a, i) => button(a, i, false))}</div>\n <div className=\"ui-actbar-narrow\">\n {main ? button(main, 0, true) : null}\n {others.length ? <Menu label={tr('更多操作')} triggerClassName=\"ui-actbar-more\" items={menuItems} /> : null}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAqCA,SAAgB,UAAU,EAAE,SAAS,aAA6B;CAEhE,MAAM,MAAM,MAAM,OAAuB,IAAI;CAC7C,eAAe,GAAG;CAClB,MAAM,OAAO,QAAQ,MAAM,MAAM,EAAE,OAAO,KAAK,QAAQ,MAAM,MAAM,CAAC,EAAE,MAAM;CAC5E,MAAM,SAAS,QAAQ,QAAQ,MAAM,MAAM,IAAI;CAC/C,MAAM,UAAU,GAAoB,GAAW,SAC7C,EAAE,SACA,oBAAC,QAAD;EAAgB,SAAQ;EAAS,SAAS,EAAE;EAAS,MAAM,EAAE;EAAM,SAAS,EAAE;EAAS,UAAU,EAAE;EAChG,UAAA,EAAE;CACG,GAFK,CAEL,IAER,oBAAC,QAAD;EAEE,SAAS,MAAM,OAAO,YAAY;EAClC,MAAM,EAAE;EACR,SAAS,EAAE;EACX,UAAU,EAAE;EACZ,WAAW,OAAO,mBAAmB,KAAA;EAEpC,UAAA,EAAE;CACG,GARD,CAQC;CAEZ,MAAM,YAAY,OAAO,KAAK,MAC5B,EAAE,SACE;EAAE,OAAO,EAAE;EAAO,MAAM,EAAE;EAAM,UAAU,EAAE;EAAS,UAAU,EAAE;EAAU,QAAQ;EAAM,SAAS,EAAE;CAAQ,IAC5G;EAAE,OAAO,EAAE;EAAO,MAAM,EAAE;EAAM,UAAU,EAAE;EAAS,UAAU,EAAE;CAAS,CAChF;CACA,OACE,qBAAC,OAAD;EAAK,KAAK;EAAK,WAAW,GAAG,aAAa,SAAS;EAAnD,UAAA,CACE,oBAAC,OAAD;GAAK,WAAU;GAAmB,WAAA,OAAO,CAAC,MAAM,GAAG,MAAM,IAAI,OAAA,CAAQ,KAAK,GAAG,MAAM,OAAO,GAAG,GAAG,KAAK,CAAC;EAAO,CAAA,GAC7G,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACG,OAAO,OAAO,MAAM,GAAG,IAAI,IAAI,MAC/B,OAAO,SAAS,oBAAC,MAAD;IAAM,OAAO,GAAG,MAAM;IAAG,kBAAiB;IAAiB,OAAO;GAAY,CAAA,IAAI,IAChG;EACF,CAAA,CAAA;;AAET"}
@@ -3,6 +3,7 @@ export interface AiMarkProps {
3
3
  text?: string;
4
4
  /** What screen readers say, when it should differ from text. Default: text in parentheses, 「(AI 撰寫)」. */
5
5
  label?: string;
6
+ /** Extra class on the root element. */
6
7
  className?: string;
7
8
  }
8
9
  /** A small gray 「AI 撰寫」 at the end of a sentence, paragraph, list item or cell written by AI. Not a link and not a
@@ -1 +1 @@
1
- {"version":3,"file":"AiMark.js","names":[],"sources":["../../../src/components/AiMark/AiMark.tsx"],"sourcesContent":["import { cx } from '../../internal/util';\nimport { tr } from '../../i18n';\n\nexport interface AiMarkProps {\n /** The words shown. Default 「AI 撰寫」; another source mark in the same style, e.g. 「推測」. */\n text?: string;\n /** What screen readers say, when it should differ from text. Default: text in parentheses, 「(AI 撰寫)」. */\n label?: string;\n className?: string;\n}\n\n/** A small gray 「AI 撰寫」 at the end of a sentence, paragraph, list item or cell written by AI. Not a link and not a\n * Tab stop; screen readers hear it in parentheses after the sentence. */\nexport function AiMark({ text, label, className }: AiMarkProps) {\n const words = text ?? tr('AI 撰寫');\n return (\n <>\n <span className={cx('ui-aimark', className)} aria-hidden=\"true\">\n {words}\n </span>\n <span className=\"ui-visually-hidden\">{label ?? tr('({v})', { v: words })}</span>\n </>\n );\n}\n"],"mappings":";;;;;;;AAaA,SAAgB,OAAO,EAAE,MAAM,OAAO,aAA0B;CAC9D,MAAM,QAAQ,QAAQ,GAAG,OAAO;CAChC,OACE,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD;EAAM,WAAW,GAAG,aAAa,SAAS;EAAG,eAAY;EACtD,UAAA;CACG,CAAA,GACN,oBAAC,QAAD;EAAM,WAAU;EAAsB,UAAA,SAAS,GAAG,SAAS,EAAE,GAAG,MAAM,CAAC;CAAQ,CAAA,CAC/E,EAAA,CAAA;AAEN"}
1
+ {"version":3,"file":"AiMark.js","names":[],"sources":["../../../src/components/AiMark/AiMark.tsx"],"sourcesContent":["import { cx } from '../../internal/util';\nimport { tr } from '../../i18n';\n\nexport interface AiMarkProps {\n /** The words shown. Default 「AI 撰寫」; another source mark in the same style, e.g. 「推測」. */\n text?: string;\n /** What screen readers say, when it should differ from text. Default: text in parentheses, 「(AI 撰寫)」. */\n label?: string;\n /** Extra class on the root element. */\n className?: string;\n}\n\n/** A small gray 「AI 撰寫」 at the end of a sentence, paragraph, list item or cell written by AI. Not a link and not a\n * Tab stop; screen readers hear it in parentheses after the sentence. */\nexport function AiMark({ text, label, className }: AiMarkProps) {\n const words = text ?? tr('AI 撰寫');\n return (\n <>\n <span className={cx('ui-aimark', className)} aria-hidden=\"true\">\n {words}\n </span>\n <span className=\"ui-visually-hidden\">{label ?? tr('({v})', { v: words })}</span>\n </>\n );\n}\n"],"mappings":";;;;;;;AAcA,SAAgB,OAAO,EAAE,MAAM,OAAO,aAA0B;CAC9D,MAAM,QAAQ,QAAQ,GAAG,OAAO;CAChC,OACE,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD;EAAM,WAAW,GAAG,aAAa,SAAS;EAAG,eAAY;EACtD,UAAA;CACG,CAAA,GACN,oBAAC,QAAD;EAAM,WAAU;EAAsB,UAAA,SAAS,GAAG,SAAS,EAAE,GAAG,MAAM,CAAC;CAAQ,CAAA,CAC/E,EAAA,CAAA;AAEN"}
@@ -3,15 +3,18 @@ export type AlertTone = 'info' | 'success' | 'warning' | 'danger';
3
3
  export interface AlertProps {
4
4
  /** Default 'info'. danger is announced at once (role alert). */
5
5
  tone?: AlertTone;
6
+ /** One short line, bold. */
6
7
  title?: string;
7
8
  /** The cause and the fix, at most 2 short sentences; in a string, `backticks` are code. */
8
9
  children?: React.ReactNode;
9
- /** A verb, such as 重試. */
10
+ /** A verb, such as 重試: an outline button under the text. */
10
11
  actionLabel?: string;
12
+ /** Runs when the action button is pressed. */
11
13
  onAction?: () => void;
12
14
  /** Adds × for info and success; warning and danger stay until the problem is solved. */
13
15
  onDismiss?: () => void;
16
+ /** Extra class on the root element. */
14
17
  className?: string;
15
18
  }
16
- /** A message inside the page with a colored bar and icon. */
19
+ /** A message inside the page: a card with the tone's icon, a title, a sentence and an optional action under it. */
17
20
  export declare function Alert({ tone, title, children, actionLabel, onAction, onDismiss, className }: AlertProps): React.JSX.Element;
@@ -14,7 +14,7 @@ const ALERT_ICONS = {
14
14
  warning: "M12 4l9 16H3zM12 10v4M12 17v.5",
15
15
  danger: "M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18zM12 8v5M12 16.5v.5"
16
16
  };
17
- /** A message inside the page with a colored bar and icon. */
17
+ /** A message inside the page: a card with the tone's icon, a title, a sentence and an optional action under it. */
18
18
  function Alert({ tone = "info", title, children, actionLabel, onAction, onDismiss, className }) {
19
19
  const t = ALERT_ICONS[tone] ? tone : "info";
20
20
  const canClose = (t === "info" || t === "success") && onDismiss;
@@ -28,20 +28,23 @@ function Alert({ tone = "info", title, children, actionLabel, onAction, onDismis
28
28
  }),
29
29
  /* @__PURE__ */ jsxs("div", {
30
30
  className: "ui-alert-content",
31
- children: [title ? /* @__PURE__ */ jsx("div", {
32
- className: "ui-alert-title",
33
- children: title
34
- }) : null, children ? /* @__PURE__ */ jsx("div", {
35
- className: "ui-alert-body",
36
- children: codeText(children)
37
- }) : null]
31
+ children: [
32
+ title ? /* @__PURE__ */ jsx("div", {
33
+ className: "ui-alert-title",
34
+ children: title
35
+ }) : null,
36
+ children ? /* @__PURE__ */ jsx("div", {
37
+ className: "ui-alert-body",
38
+ children: codeText(children)
39
+ }) : null,
40
+ actionLabel ? /* @__PURE__ */ jsx("button", {
41
+ type: "button",
42
+ className: "ui-btn ui-btn-secondary ui-alert-action",
43
+ onClick: onAction,
44
+ children: actionLabel
45
+ }) : null
46
+ ]
38
47
  }),
39
- actionLabel ? /* @__PURE__ */ jsx("button", {
40
- type: "button",
41
- className: "ui-btn ui-btn-secondary ui-alert-action",
42
- onClick: onAction,
43
- children: actionLabel
44
- }) : null,
45
48
  canClose ? /* @__PURE__ */ jsx("button", {
46
49
  type: "button",
47
50
  className: "ui-alert-close",
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","names":["phX"],"sources":["../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import type * as React from 'react';\nimport { tr } from '../../i18n';\nimport { Icon, type CustomIcon } from '../../icons/Icon';\nimport { cx } from '../../internal/util';\nimport { includeIcons } from '../../icons/store';\nimport phX from '../../icons/ph/x';\nimport { codeText } from '../InlineCode/InlineCode';\n\nincludeIcons(phX);\n\nexport type AlertTone = 'info' | 'success' | 'warning' | 'danger';\n\nconst ALERT_ICONS: Record<AlertTone, CustomIcon> = {\n info: 'M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18zM12 11v5M12 7.5v.5',\n success: 'M5 12.5l4.5 4.5L19 7',\n warning: 'M12 4l9 16H3zM12 10v4M12 17v.5',\n danger: 'M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18zM12 8v5M12 16.5v.5',\n};\n\nexport interface AlertProps {\n /** Default 'info'. danger is announced at once (role alert). */\n tone?: AlertTone;\n title?: string;\n /** The cause and the fix, at most 2 short sentences; in a string, `backticks` are code. */\n children?: React.ReactNode;\n /** A verb, such as 重試. */\n actionLabel?: string;\n onAction?: () => void;\n /** Adds × for info and success; warning and danger stay until the problem is solved. */\n onDismiss?: () => void;\n className?: string;\n}\n\n/** A message inside the page with a colored bar and icon. */\nexport function Alert({ tone = 'info', title, children, actionLabel, onAction, onDismiss, className }: AlertProps) {\n const t = ALERT_ICONS[tone] ? tone : 'info';\n const canClose = (t === 'info' || t === 'success') && onDismiss;\n return (\n <div className={cx('ui-alert', 'ui-alert-' + t, className)} role={t === 'danger' ? 'alert' : 'status'}>\n <Icon d={ALERT_ICONS[t]} className=\"ui-alert-icon\" />\n <div className=\"ui-alert-content\">\n {title ? <div className=\"ui-alert-title\">{title}</div> : null}\n {children ? <div className=\"ui-alert-body\">{codeText(children)}</div> : null}\n </div>\n {actionLabel ? (\n <button type=\"button\" className=\"ui-btn ui-btn-secondary ui-alert-action\" onClick={onAction}>\n {actionLabel}\n </button>\n ) : null}\n {canClose ? (\n <button type=\"button\" className=\"ui-alert-close\" aria-label={tr('關閉提示')} onClick={onDismiss}>\n <Icon name=\"x\" size={16} />\n </button>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAQA,aAAaA,SAAG;AAIhB,MAAM,cAA6C;CACjD,MAAM;CACN,SAAS;CACT,SAAS;CACT,QAAQ;AACV;;AAiBA,SAAgB,MAAM,EAAE,OAAO,QAAQ,OAAO,UAAU,aAAa,UAAU,WAAW,aAAyB;CACjH,MAAM,IAAI,YAAY,QAAQ,OAAO;CACrC,MAAM,YAAY,MAAM,UAAU,MAAM,cAAc;CACtD,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,YAAY,cAAc,GAAG,SAAS;EAAG,MAAM,MAAM,WAAW,UAAU;EAA7F,UAAA;GACE,oBAAC,MAAD;IAAM,GAAG,YAAY;IAAI,WAAU;GAAiB,CAAA;GACpD,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACG,QAAQ,oBAAC,OAAD;KAAK,WAAU;KAAkB,UAAA;IAAW,CAAA,IAAI,MACxD,WAAW,oBAAC,OAAD;KAAK,WAAU;KAAiB,UAAA,SAAS,QAAQ;IAAO,CAAA,IAAI,IACrE;;GACJ,cACC,oBAAC,UAAD;IAAQ,MAAK;IAAS,WAAU;IAA0C,SAAS;IAChF,UAAA;GACK,CAAA,IACN;GACH,WACC,oBAAC,UAAD;IAAQ,MAAK;IAAS,WAAU;IAAiB,cAAY,GAAG,MAAM;IAAG,SAAS;IAChF,UAAA,oBAAC,MAAD;KAAM,MAAK;KAAI,MAAM;IAAK,CAAA;GACpB,CAAA,IACN;EACD;;AAET"}
1
+ {"version":3,"file":"Alert.js","names":["phX"],"sources":["../../../src/components/Alert/Alert.tsx"],"sourcesContent":["import type * as React from 'react';\nimport { tr } from '../../i18n';\nimport { Icon, type CustomIcon } from '../../icons/Icon';\nimport { cx } from '../../internal/util';\nimport { includeIcons } from '../../icons/store';\nimport phX from '../../icons/ph/x';\nimport { codeText } from '../InlineCode/InlineCode';\n\nincludeIcons(phX);\n\nexport type AlertTone = 'info' | 'success' | 'warning' | 'danger';\n\nconst ALERT_ICONS: Record<AlertTone, CustomIcon> = {\n info: 'M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18zM12 11v5M12 7.5v.5',\n success: 'M5 12.5l4.5 4.5L19 7',\n warning: 'M12 4l9 16H3zM12 10v4M12 17v.5',\n danger: 'M12 3a9 9 0 1 0 0 18a9 9 0 1 0 0-18zM12 8v5M12 16.5v.5',\n};\n\nexport interface AlertProps {\n /** Default 'info'. danger is announced at once (role alert). */\n tone?: AlertTone;\n /** One short line, bold. */\n title?: string;\n /** The cause and the fix, at most 2 short sentences; in a string, `backticks` are code. */\n children?: React.ReactNode;\n /** A verb, such as 重試: an outline button under the text. */\n actionLabel?: string;\n /** Runs when the action button is pressed. */\n onAction?: () => void;\n /** Adds × for info and success; warning and danger stay until the problem is solved. */\n onDismiss?: () => void;\n /** Extra class on the root element. */\n className?: string;\n}\n\n/** A message inside the page: a card with the tone's icon, a title, a sentence and an optional action under it. */\nexport function Alert({ tone = 'info', title, children, actionLabel, onAction, onDismiss, className }: AlertProps) {\n const t = ALERT_ICONS[tone] ? tone : 'info';\n const canClose = (t === 'info' || t === 'success') && onDismiss;\n return (\n <div className={cx('ui-alert', 'ui-alert-' + t, className)} role={t === 'danger' ? 'alert' : 'status'}>\n <Icon d={ALERT_ICONS[t]} className=\"ui-alert-icon\" />\n <div className=\"ui-alert-content\">\n {title ? <div className=\"ui-alert-title\">{title}</div> : null}\n {children ? <div className=\"ui-alert-body\">{codeText(children)}</div> : null}\n {/* Under the text, not at the right end: with or without ✕ every action starts at the same place. */}\n {actionLabel ? (\n <button type=\"button\" className=\"ui-btn ui-btn-secondary ui-alert-action\" onClick={onAction}>\n {actionLabel}\n </button>\n ) : null}\n </div>\n {canClose ? (\n <button type=\"button\" className=\"ui-alert-close\" aria-label={tr('關閉提示')} onClick={onDismiss}>\n <Icon name=\"x\" size={16} />\n </button>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAQA,aAAaA,SAAG;AAIhB,MAAM,cAA6C;CACjD,MAAM;CACN,SAAS;CACT,SAAS;CACT,QAAQ;AACV;;AAoBA,SAAgB,MAAM,EAAE,OAAO,QAAQ,OAAO,UAAU,aAAa,UAAU,WAAW,aAAyB;CACjH,MAAM,IAAI,YAAY,QAAQ,OAAO;CACrC,MAAM,YAAY,MAAM,UAAU,MAAM,cAAc;CACtD,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,YAAY,cAAc,GAAG,SAAS;EAAG,MAAM,MAAM,WAAW,UAAU;EAA7F,UAAA;GACE,oBAAC,MAAD;IAAM,GAAG,YAAY;IAAI,WAAU;GAAiB,CAAA;GACpD,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACG,QAAQ,oBAAC,OAAD;MAAK,WAAU;MAAkB,UAAA;KAAW,CAAA,IAAI;KACxD,WAAW,oBAAC,OAAD;MAAK,WAAU;MAAiB,UAAA,SAAS,QAAQ;KAAO,CAAA,IAAI;KAEvE,cACC,oBAAC,UAAD;MAAQ,MAAK;MAAS,WAAU;MAA0C,SAAS;MAChF,UAAA;KACK,CAAA,IACN;IACD;;GACJ,WACC,oBAAC,UAAD;IAAQ,MAAK;IAAS,WAAU;IAAiB,cAAY,GAAG,MAAM;IAAG,SAAS;IAChF,UAAA,oBAAC,MAAD;KAAM,MAAK;KAAI,MAAM;IAAK,CAAA;GACpB,CAAA,IACN;EACD;;AAET"}
@@ -7,13 +7,18 @@ export interface AppShellProps {
7
7
  nav: NavSection[];
8
8
  /** Id of the current page. */
9
9
  value: string;
10
+ /** Called with the id of the nav item the person picks. */
10
11
  onNavigate: (id: string) => void;
11
12
  /** The product at the top of the sidebar: { mark, name, href } (see SideNav's NavBrand). Collapsed it shows the mark
12
13
  * alone, a link named by `name`; open or pinned, the name fades in beside it. Plain text gets its first character as
13
14
  * the mark. */
14
15
  brand?: React.ReactNode | NavBrand;
15
- /** The page title, shown once in the top bar. Do not repeat it as a heading in the page. */
16
+ /** The page title, shown once in the top bar. Leave it out when the page has its own title (PageHeader with
17
+ * `title` on a detail page); never both. */
16
18
  title?: string;
19
+ /** Right after the title in the top bar, e.g. a Tag 「示範資料」 with the info icon. */
20
+ tags?: React.ReactNode;
21
+ /** @deprecated A breadcrumb goes at the top of the content: put `<Breadcrumb items={…} />` first in the page. */
17
22
  breadcrumb?: BreadcrumbItem[];
18
23
  /** Opens search (CommandPalette). */
19
24
  onSearch?: () => void;
@@ -27,10 +32,11 @@ export interface AppShellProps {
27
32
  * pins or unpins it; their choice is kept in the browser. Default false: a 72 px strip of icons that opens to
28
33
  * 240 px over the content while the pointer or the keyboard focus is on it. */
29
34
  defaultPinned?: boolean;
35
+ /** Extra class on the root element. */
30
36
  className?: string;
31
37
  }
32
- /** The dashboard frame: sidebar (240 px, 72 px collapsed) above 1024 px, a drawer from the top bar's menu button from
33
- * 600 to 1024 px, and bottom tabs on phones.
38
+ /** The dashboard frame: sidebar (240 px, 72 px collapsed) from 1024 px, a drawer from the top bar's menu button from
39
+ * 600 to 1023 px, and bottom tabs on phones.
34
40
  * The top bar hides while scrolling down and returns when scrolling up. */
35
- export declare function AppShell({ nav, value, onNavigate, brand, title, breadcrumb, onSearch, actions, children, tabLabels, defaultPinned, className }: AppShellProps): React.JSX.Element;
41
+ export declare function AppShell({ nav, value, onNavigate, brand, title, tags, breadcrumb, onSearch, actions, children, tabLabels, defaultPinned, className }: AppShellProps): React.JSX.Element;
36
42
  export { focusMain };
@@ -3,11 +3,14 @@ import { SideNav } from "../SideNav/SideNav.js";
3
3
  import { TopBar } from "../TopBar/TopBar.js";
4
4
  import { MobileTabBar } from "../MobileTabBar/MobileTabBar.js";
5
5
  import { Drawer } from "../Drawer/Drawer.js";
6
+ import { AutoToaster } from "../Toast/Toast.js";
6
7
  import { tr } from "../../i18n.js";
7
- import { cx, store, useMedia, useNarrow } from "../../internal/util.js";
8
+ import { cx, useMedia, useNarrow } from "../../internal/util.js";
9
+ import { asText, useStored } from "../../internal/stored.js";
8
10
  import { devWarn } from "../../internal/dev.js";
9
11
  import { ensureAnnouncer } from "../../announce.js";
10
- import { focusMain } from "../../internal/focusMain.js";
12
+ import { focusMain, installFocusMain } from "../../internal/focusMain.js";
13
+ import { ShellTitle } from "../../internal/shell.js";
11
14
  import { includeIcons } from "../../icons/store.js";
12
15
  import dots_three_default from "../../icons/ph/dots-three.js";
13
16
  import * as React from "react";
@@ -21,18 +24,18 @@ const OPEN_DELAY = 100;
21
24
  /** Pointer away this long before it hides again (a slip off the edge does not). */
22
25
  const CLOSE_DELAY = 300;
23
26
  const MORE = "\0more";
24
- /** The dashboard frame: sidebar (240 px, 72 px collapsed) above 1024 px, a drawer from the top bar's menu button from
25
- * 600 to 1024 px, and bottom tabs on phones.
27
+ /** The dashboard frame: sidebar (240 px, 72 px collapsed) from 1024 px, a drawer from the top bar's menu button from
28
+ * 600 to 1023 px, and bottom tabs on phones.
26
29
  * The top bar hides while scrolling down and returns when scrolling up. */
27
- function AppShell({ nav, value, onNavigate, brand, title, breadcrumb, onSearch, actions, children, tabLabels, defaultPinned = false, className }) {
30
+ function AppShell({ nav, value, onNavigate, brand, title, tags, breadcrumb, onSearch, actions, children, tabLabels, defaultPinned = false, className }) {
31
+ devWarn(breadcrumb, "AppShell", "`breadcrumb` is deprecated: in the top bar it repeats the page title. Put <Breadcrumb items={…} /> first in the page content instead.");
28
32
  const phone = useNarrow();
29
- const tablet = useMedia("(min-width: 600px) and (max-width: 1024px)");
30
- const [userCollapsed, setUserCollapsed] = React.useState(() => store(COLLAPSE_KEY) === "1");
31
- const [pinned, setPinned] = React.useState(() => {
32
- const v = store(PIN_KEY);
33
- if (v != null) return v === "1";
34
- return store(COLLAPSE_KEY) != null || defaultPinned;
35
- });
33
+ const tablet = useMedia("(min-width: 600px) and (max-width: 1023px)");
34
+ const [storedCollapsed, setStoredCollapsed] = useStored(COLLAPSE_KEY, asText, null);
35
+ const [storedPin, setStoredPin] = useStored(PIN_KEY, asText, null);
36
+ const userCollapsed = storedCollapsed === "1";
37
+ const pinned = storedPin != null ? storedPin === "1" : storedCollapsed != null || defaultPinned;
38
+ React.useEffect(installFocusMain, []);
36
39
  const [open, setOpen] = React.useState(false);
37
40
  const openTimer = React.useRef(void 0);
38
41
  const closeTimer = React.useRef(void 0);
@@ -48,8 +51,7 @@ function AppShell({ nav, value, onNavigate, brand, title, breadcrumb, onSearch,
48
51
  }, []);
49
52
  const collapsed = pinned ? userCollapsed : !open;
50
53
  const togglePin = () => {
51
- store(PIN_KEY, pinned ? "0" : "1");
52
- setPinned(!pinned);
54
+ setStoredPin(pinned ? "0" : "1");
53
55
  setOpen(false);
54
56
  };
55
57
  const top = nav.flatMap((s) => s.items);
@@ -94,6 +96,10 @@ function AppShell({ nav, value, onNavigate, brand, title, breadcrumb, onSearch,
94
96
  React.useEffect(() => {
95
97
  ensureAnnouncer();
96
98
  }, []);
99
+ const shellTitle = React.useMemo(() => ({
100
+ inShell: true,
101
+ title: !!title
102
+ }), [title]);
97
103
  return /* @__PURE__ */ jsxs("div", {
98
104
  className: cx("ui-shell", phone && "is-phone", className),
99
105
  children: [
@@ -115,8 +121,7 @@ function AppShell({ nav, value, onNavigate, brand, title, breadcrumb, onSearch,
115
121
  pinned: true,
116
122
  onPin: togglePin,
117
123
  onToggle: () => {
118
- store(COLLAPSE_KEY, userCollapsed ? "0" : "1");
119
- setUserCollapsed(!userCollapsed);
124
+ setStoredCollapsed(userCollapsed ? "0" : "1");
120
125
  }
121
126
  }) : /* @__PURE__ */ jsx("div", {
122
127
  className: cx("ui-shell-rail", open && "is-open"),
@@ -155,6 +160,7 @@ function AppShell({ nav, value, onNavigate, brand, title, breadcrumb, onSearch,
155
160
  /* @__PURE__ */ jsx(TopBar, {
156
161
  className: cx("ui-shell-top", hidden && "is-hidden"),
157
162
  title,
163
+ tags,
158
164
  breadcrumb,
159
165
  onSearch: onSearch ?? false,
160
166
  onMenu: tablet ? () => setMoreOpen(true) : void 0,
@@ -162,9 +168,13 @@ function AppShell({ nav, value, onNavigate, brand, title, breadcrumb, onSearch,
162
168
  }),
163
169
  /* @__PURE__ */ jsx("main", {
164
170
  ref: main,
171
+ id: "main",
165
172
  className: "ui-shell-main",
166
173
  tabIndex: -1,
167
- children
174
+ children: /* @__PURE__ */ jsx(ShellTitle.Provider, {
175
+ value: shellTitle,
176
+ children
177
+ })
168
178
  }),
169
179
  phone && tabs.length ? /* @__PURE__ */ jsx(MobileTabBar, {
170
180
  items: tabs,
@@ -174,7 +184,7 @@ function AppShell({ nav, value, onNavigate, brand, title, breadcrumb, onSearch,
174
184
  }) : null,
175
185
  phone || tablet ? /* @__PURE__ */ jsx(Drawer, {
176
186
  open: moreOpen,
177
- onClose: () => setMoreOpen(false),
187
+ onOpenChange: setMoreOpen,
178
188
  title: tr("全部頁面"),
179
189
  side: tablet ? "left" : "right",
180
190
  width: tablet ? 300 : void 0,
@@ -187,7 +197,8 @@ function AppShell({ nav, value, onNavigate, brand, title, breadcrumb, onSearch,
187
197
  onNavigate(id);
188
198
  }
189
199
  })
190
- }) : null
200
+ }) : null,
201
+ /* @__PURE__ */ jsx(AutoToaster, {})
191
202
  ]
192
203
  })
193
204
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"AppShell.js","names":["phDotsThree"],"sources":["../../../src/components/AppShell/AppShell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { SideNav, type NavBrand, type NavItem, type NavSection } from '../SideNav/SideNav';\nimport { TopBar } from '../TopBar/TopBar';\nimport { MobileTabBar, type MobileTab } from '../MobileTabBar/MobileTabBar';\nimport { Drawer } from '../Drawer/Drawer';\nimport { tr } from '../../i18n';\nimport type { BreadcrumbItem } from '../Breadcrumb/Breadcrumb';\nimport { cx, store, useMedia, useNarrow } from '../../internal/util';\nimport { devWarn } from '../../internal/dev';\nimport { ensureAnnouncer } from '../../announce';\nimport { focusMain } from '../../internal/focusMain';\nimport { includeIcons } from '../../icons/store';\nimport phDotsThree from '../../icons/ph/dots-three';\n\nincludeIcons(phDotsThree);\n\nexport interface AppShellProps {\n /** Sidebar groups. On phones, top-level items with an icon become bottom tabs; pages they cannot reach go under 「更多」. */\n nav: NavSection[];\n /** Id of the current page. */\n value: string;\n onNavigate: (id: string) => void;\n /** The product at the top of the sidebar: { mark, name, href } (see SideNav's NavBrand). Collapsed it shows the mark\n * alone, a link named by `name`; open or pinned, the name fades in beside it. Plain text gets its first character as\n * the mark. */\n brand?: React.ReactNode | NavBrand;\n /** The page title, shown once in the top bar. Do not repeat it as a heading in the page. */\n title?: string;\n breadcrumb?: BreadcrumbItem[];\n /** Opens search (CommandPalette). */\n onSearch?: () => void;\n /** Right side of the top bar: NotificationBell, ProjectSwitcher, the account menu. */\n actions?: React.ReactNode;\n /** The page: Cards and sections, 32 px apart. */\n children: React.ReactNode;\n /** Labels under the phone tab bar's icons (MobileTabBar labels). Default true. */\n tabLabels?: boolean;\n /** Desktop: whether the sidebar starts pinned (240 px, or 72 px collapsed, beside the content) until the reader\n * pins or unpins it; their choice is kept in the browser. Default false: a 72 px strip of icons that opens to\n * 240 px over the content while the pointer or the keyboard focus is on it. */\n defaultPinned?: boolean;\n className?: string;\n}\n\nconst COLLAPSE_KEY = 'ui-nav-collapsed';\nconst PIN_KEY = 'ui-nav-pinned';\n/** Pointer on the strip this long before it opens (passing over it on the way to the browser's edge does not). */\nconst OPEN_DELAY = 100;\n/** Pointer away this long before it hides again (a slip off the edge does not). */\nconst CLOSE_DELAY = 300;\n\nexport { focusMain };\nconst MORE = '\\u0000more';\n\n/** The dashboard frame: sidebar (240 px, 72 px collapsed) above 1024 px, a drawer from the top bar's menu button from\n * 600 to 1024 px, and bottom tabs on phones.\n * The top bar hides while scrolling down and returns when scrolling up. */\nexport function AppShell({\n nav,\n value,\n onNavigate,\n brand,\n title,\n breadcrumb,\n onSearch,\n actions,\n children,\n tabLabels,\n defaultPinned = false,\n className,\n}: AppShellProps) {\n const phone = useNarrow();\n // 600 to 1024 px (tablets, narrow windows): no sidebar; the top bar's menu button opens the whole nav in a drawer.\n const tablet = useMedia('(min-width: 600px) and (max-width: 1024px)');\n const [userCollapsed, setUserCollapsed] = React.useState(() => store(COLLAPSE_KEY) === '1');\n // Pinned: the sidebar sits beside the content as before (240 px, or 72 px collapsed). Not pinned: a 72 px strip of\n // icons that opens over the content. Someone who already chose collapsed or expanded keeps a pinned sidebar.\n const [pinned, setPinned] = React.useState(() => {\n const v = store(PIN_KEY);\n if (v != null) return v === '1';\n return store(COLLAPSE_KEY) != null || defaultPinned;\n });\n const [open, setOpen] = React.useState(false);\n const openTimer = React.useRef<ReturnType<typeof setTimeout>>(undefined);\n const closeTimer = React.useRef<ReturnType<typeof setTimeout>>(undefined);\n const later = (show: boolean) => {\n clearTimeout(openTimer.current);\n clearTimeout(closeTimer.current);\n if (show) openTimer.current = setTimeout(() => setOpen(true), OPEN_DELAY);\n else closeTimer.current = setTimeout(() => setOpen(false), CLOSE_DELAY);\n };\n React.useEffect(\n () => () => {\n clearTimeout(openTimer.current);\n clearTimeout(closeTimer.current);\n },\n [],\n );\n const collapsed = pinned ? userCollapsed : !open;\n const togglePin = () => {\n store(PIN_KEY, pinned ? '0' : '1');\n setPinned(!pinned);\n setOpen(false);\n };\n const top = nav.flatMap((s) => s.items);\n const parentOf = (id: string) => top.find((it) => it.children?.some((c) => c.id === id));\n // Phones: top-level items with an icon become tabs (a group opens its first page).\n // When some page is not reachable that way, the last tab becomes 「更多」 and opens the whole nav.\n const withIcon = top.filter((it): it is NavItem & { icon: NonNullable<NavItem['icon']> } => !!it.icon);\n const unreachable = top.some((it) => !it.icon || (it.children?.length ?? 0) > 1) || withIcon.length > 5;\n const tabs: MobileTab[] = withIcon.slice(0, unreachable ? 4 : 5).map((it) => ({ id: it.id, label: it.label, icon: it.icon }));\n if (unreachable) tabs.push({ id: MORE, label: tr('更多'), icon: 'dots-three' });\n const [moreOpen, setMoreOpen] = React.useState(false);\n // Widened past the drawer's layouts (to a desktop with the sidebar): closed, so it does not pop up again when the\n // window narrows later.\n if (moreOpen && !phone && !tablet) setMoreOpen(false);\n devWarn(phone && withIcon.length < 2, 'AppShell', 'phones show the top-level nav items as bottom tabs; give at least 2 of them an icon.');\n const current = parentOf(value)?.id ?? value;\n const tabValue = tabs.some((t) => t.id === current) ? current : MORE;\n const onTab = (id: string) => {\n if (id === MORE) return setMoreOpen(true);\n if (id === current) return;\n const item = top.find((it) => it.id === id);\n onNavigate(item?.children?.[0]?.id ?? id);\n };\n\n // Hide the top bar while scrolling down, show it again on the way up.\n const main = React.useRef<HTMLElement>(null);\n const [hidden, setHidden] = React.useState(false);\n React.useEffect(() => {\n const el = main.current;\n if (!el) return;\n let last = el.scrollTop;\n const onScroll = () => {\n const y = el.scrollTop;\n if (Math.abs(y - last) < 8) return;\n setHidden(y > last && y > 64);\n last = y;\n };\n el.addEventListener('scroll', onScroll, { passive: true });\n return () => el.removeEventListener('scroll', onScroll);\n }, []);\n\n React.useEffect(() => {\n ensureAnnouncer();\n }, []);\n return (\n <div className={cx('ui-shell', phone && 'is-phone', className)}>\n {/* First stop for the keyboard: skips the navigation. */}\n <a\n className=\"ui-skip\"\n href=\"#main\"\n onClick={(e) => {\n e.preventDefault();\n focusMain();\n }}\n >\n {tr('跳到主要內容')}\n </a>\n {phone || tablet ? null : pinned ? (\n <SideNav\n sections={nav}\n value={value}\n onChange={onNavigate}\n brand={brand}\n collapsed={collapsed}\n pinned\n onPin={togglePin}\n onToggle={() => {\n store(COLLAPSE_KEY, userCollapsed ? '0' : '1');\n setUserCollapsed(!userCollapsed);\n }}\n />\n ) : (\n // Not pinned: the strip keeps its 72 px in the layout; the sidebar inside opens over the content and closes\n // again when the pointer and the focus have left it, after a page is chosen, or on Esc.\n <div\n className={cx('ui-shell-rail', open && 'is-open')}\n onPointerEnter={(e) => e.pointerType === 'mouse' && later(true)}\n onPointerLeave={(e) => e.pointerType === 'mouse' && later(false)}\n onFocus={(e) => {\n if (!(e.target as Element).matches(':focus-visible')) return;\n clearTimeout(closeTimer.current);\n setOpen(true);\n }}\n onBlur={(e) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node | null)) setOpen(false);\n }}\n onKeyDown={(e) => {\n if (e.key === 'Escape' && open) {\n e.stopPropagation();\n setOpen(false);\n }\n }}\n >\n <SideNav\n sections={nav}\n value={value}\n onChange={(id) => {\n clearTimeout(openTimer.current);\n setOpen(false);\n onNavigate(id);\n }}\n brand={brand}\n collapsed={collapsed}\n onPin={togglePin}\n />\n </div>\n )}\n <div className=\"ui-shell-body\">\n <TopBar\n className={cx('ui-shell-top', hidden && 'is-hidden')}\n title={title}\n breadcrumb={breadcrumb}\n onSearch={onSearch ?? false}\n onMenu={tablet ? () => setMoreOpen(true) : undefined}\n >\n {actions}\n </TopBar>\n <main ref={main} className=\"ui-shell-main\" tabIndex={-1}>\n {children}\n </main>\n {phone && tabs.length ? <MobileTabBar items={tabs} value={tabValue} onChange={onTab} labels={tabLabels} /> : null}\n {phone || tablet ? (\n <Drawer open={moreOpen} onClose={() => setMoreOpen(false)} title={tr('全部頁面')} side={tablet ? 'left' : 'right'} width={tablet ? 300 : undefined}>\n <SideNav\n className=\"ui-shell-allnav\"\n sections={nav}\n value={value}\n onChange={(id) => {\n setMoreOpen(false);\n onNavigate(id);\n }}\n />\n </Drawer>\n ) : null}\n </div>\n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IAAf,UAAA;KACE,oBAAC,QAAD;MACE,WAAW,GAAG,gBAAgB,UAAU,WAAW;MAC5C;MACK;MACZ,UAAU,YAAY;MACtB,QAAQ,eAAe,YAAY,IAAI,IAAI,KAAA;MAE1C,UAAA;KACK,CAAA;KACR,oBAAC,QAAD;MAAM,KAAK;MAAM,WAAU;MAAgB,UAAU;MAClD;KACG,CAAA;KACL,SAAS,KAAK,SAAS,oBAAC,cAAD;MAAc,OAAO;MAAM,OAAO;MAAU,UAAU;MAAO,QAAQ;KAAY,CAAA,IAAI;KAC5G,SAAS,SACR,oBAAC,QAAD;MAAQ,MAAM;MAAU,eAAe,YAAY,KAAK;MAAG,OAAO,GAAG,MAAM;MAAG,MAAM,SAAS,SAAS;MAAS,OAAO,SAAS,MAAM,KAAA;MACnI,UAAA,oBAAC,SAAD;OACE,WAAU;OACV,UAAU;OACH;OACP,WAAW,OAAO;QAChB,YAAY,KAAK;QACjB,WAAW,EAAE;OACf;MACD,CAAA;KACK,CAAA,IACN;IACD;;EACF;;AAET"}
1
+ {"version":3,"file":"AppShell.js","names":["phDotsThree"],"sources":["../../../src/components/AppShell/AppShell.tsx"],"sourcesContent":["import * as React from 'react';\nimport { SideNav, type NavBrand, type NavItem, type NavSection } from '../SideNav/SideNav';\nimport { TopBar } from '../TopBar/TopBar';\nimport { MobileTabBar, type MobileTab } from '../MobileTabBar/MobileTabBar';\nimport { Drawer } from '../Drawer/Drawer';\nimport { AutoToaster } from '../Toast/Toast';\nimport { tr } from '../../i18n';\nimport type { BreadcrumbItem } from '../Breadcrumb/Breadcrumb';\nimport { cx, useMedia, useNarrow } from '../../internal/util';\nimport { asText, useStored } from '../../internal/stored';\nimport { devWarn } from '../../internal/dev';\nimport { ensureAnnouncer } from '../../announce';\nimport { focusMain, installFocusMain } from '../../internal/focusMain';\nimport { ShellTitle } from '../../internal/shell';\nimport { includeIcons } from '../../icons/store';\nimport phDotsThree from '../../icons/ph/dots-three';\n\nincludeIcons(phDotsThree);\n\nexport interface AppShellProps {\n /** Sidebar groups. On phones, top-level items with an icon become bottom tabs; pages they cannot reach go under 「更多」. */\n nav: NavSection[];\n /** Id of the current page. */\n value: string;\n /** Called with the id of the nav item the person picks. */\n onNavigate: (id: string) => void;\n /** The product at the top of the sidebar: { mark, name, href } (see SideNav's NavBrand). Collapsed it shows the mark\n * alone, a link named by `name`; open or pinned, the name fades in beside it. Plain text gets its first character as\n * the mark. */\n brand?: React.ReactNode | NavBrand;\n /** The page title, shown once in the top bar. Leave it out when the page has its own title (PageHeader with\n * `title` on a detail page); never both. */\n title?: string;\n /** Right after the title in the top bar, e.g. a Tag 「示範資料」 with the info icon. */\n tags?: React.ReactNode;\n /** @deprecated A breadcrumb goes at the top of the content: put `<Breadcrumb items={…} />` first in the page. */\n breadcrumb?: BreadcrumbItem[];\n /** Opens search (CommandPalette). */\n onSearch?: () => void;\n /** Right side of the top bar: NotificationBell, ProjectSwitcher, the account menu. */\n actions?: React.ReactNode;\n /** The page: Cards and sections, 32 px apart. */\n children: React.ReactNode;\n /** Labels under the phone tab bar's icons (MobileTabBar labels). Default true. */\n tabLabels?: boolean;\n /** Desktop: whether the sidebar starts pinned (240 px, or 72 px collapsed, beside the content) until the reader\n * pins or unpins it; their choice is kept in the browser. Default false: a 72 px strip of icons that opens to\n * 240 px over the content while the pointer or the keyboard focus is on it. */\n defaultPinned?: boolean;\n /** Extra class on the root element. */\n className?: string;\n}\n\nconst COLLAPSE_KEY = 'ui-nav-collapsed';\nconst PIN_KEY = 'ui-nav-pinned';\n/** Pointer on the strip this long before it opens (passing over it on the way to the browser's edge does not). */\nconst OPEN_DELAY = 100;\n/** Pointer away this long before it hides again (a slip off the edge does not). */\nconst CLOSE_DELAY = 300;\n\nexport { focusMain };\nconst MORE = '\\u0000more';\n\n/** The dashboard frame: sidebar (240 px, 72 px collapsed) from 1024 px, a drawer from the top bar's menu button from\n * 600 to 1023 px, and bottom tabs on phones.\n * The top bar hides while scrolling down and returns when scrolling up. */\nexport function AppShell({\n nav,\n value,\n onNavigate,\n brand,\n title,\n tags,\n breadcrumb,\n onSearch,\n actions,\n children,\n tabLabels,\n defaultPinned = false,\n className,\n}: AppShellProps) {\n devWarn(\n breadcrumb,\n 'AppShell',\n '`breadcrumb` is deprecated: in the top bar it repeats the page title. Put <Breadcrumb items={…} /> first in the page content instead.',\n );\n const phone = useNarrow();\n // 600 to 1023 px (tablets, narrow windows): no sidebar; the top bar's menu button opens the whole nav in a drawer.\n // 1024 px is the navigation's own edge, separate from the page-layout breakpoint bp-desktop (960 px).\n const tablet = useMedia('(min-width: 600px) and (max-width: 1023px)');\n // Stored choices: the same on the server and the first render in the browser (none stored), then the stored ones.\n const [storedCollapsed, setStoredCollapsed] = useStored<string | null>(COLLAPSE_KEY, asText, null);\n const [storedPin, setStoredPin] = useStored<string | null>(PIN_KEY, asText, null);\n const userCollapsed = storedCollapsed === '1';\n // Pinned: the sidebar sits beside the content as before (240 px, or 72 px collapsed). Not pinned: a 72 px strip of\n // icons that opens over the content. Someone who already chose collapsed or expanded keeps a pinned sidebar.\n const pinned = storedPin != null ? storedPin === '1' : storedCollapsed != null || defaultPinned;\n React.useEffect(installFocusMain, []);\n const [open, setOpen] = React.useState(false);\n const openTimer = React.useRef<ReturnType<typeof setTimeout>>(undefined);\n const closeTimer = React.useRef<ReturnType<typeof setTimeout>>(undefined);\n const later = (show: boolean) => {\n clearTimeout(openTimer.current);\n clearTimeout(closeTimer.current);\n if (show) openTimer.current = setTimeout(() => setOpen(true), OPEN_DELAY);\n else closeTimer.current = setTimeout(() => setOpen(false), CLOSE_DELAY);\n };\n React.useEffect(\n () => () => {\n clearTimeout(openTimer.current);\n clearTimeout(closeTimer.current);\n },\n [],\n );\n const collapsed = pinned ? userCollapsed : !open;\n const togglePin = () => {\n setStoredPin(pinned ? '0' : '1');\n setOpen(false);\n };\n const top = nav.flatMap((s) => s.items);\n const parentOf = (id: string) => top.find((it) => it.children?.some((c) => c.id === id));\n // Phones: top-level items with an icon become tabs (a group opens its first page).\n // When some page is not reachable that way, the last tab becomes 「更多」 and opens the whole nav.\n const withIcon = top.filter((it): it is NavItem & { icon: NonNullable<NavItem['icon']> } => !!it.icon);\n const unreachable = top.some((it) => !it.icon || (it.children?.length ?? 0) > 1) || withIcon.length > 5;\n const tabs: MobileTab[] = withIcon.slice(0, unreachable ? 4 : 5).map((it) => ({ id: it.id, label: it.label, icon: it.icon }));\n if (unreachable) tabs.push({ id: MORE, label: tr('更多'), icon: 'dots-three' });\n const [moreOpen, setMoreOpen] = React.useState(false);\n // Widened past the drawer's layouts (to a desktop with the sidebar): closed, so it does not pop up again when the\n // window narrows later.\n if (moreOpen && !phone && !tablet) setMoreOpen(false);\n devWarn(phone && withIcon.length < 2, 'AppShell', 'phones show the top-level nav items as bottom tabs; give at least 2 of them an icon.');\n const current = parentOf(value)?.id ?? value;\n const tabValue = tabs.some((t) => t.id === current) ? current : MORE;\n const onTab = (id: string) => {\n if (id === MORE) return setMoreOpen(true);\n if (id === current) return;\n const item = top.find((it) => it.id === id);\n onNavigate(item?.children?.[0]?.id ?? id);\n };\n\n // Hide the top bar while scrolling down, show it again on the way up.\n const main = React.useRef<HTMLElement>(null);\n const [hidden, setHidden] = React.useState(false);\n React.useEffect(() => {\n const el = main.current;\n if (!el) return;\n let last = el.scrollTop;\n const onScroll = () => {\n const y = el.scrollTop;\n if (Math.abs(y - last) < 8) return;\n setHidden(y > last && y > 64);\n last = y;\n };\n el.addEventListener('scroll', onScroll, { passive: true });\n return () => el.removeEventListener('scroll', onScroll);\n }, []);\n\n React.useEffect(() => {\n ensureAnnouncer();\n }, []);\n const shellTitle = React.useMemo(() => ({ inShell: true, title: !!title }), [title]);\n return (\n <div className={cx('ui-shell', phone && 'is-phone', className)}>\n {/* First stop for the keyboard: skips the navigation. */}\n <a\n className=\"ui-skip\"\n href=\"#main\"\n onClick={(e) => {\n e.preventDefault();\n focusMain();\n }}\n >\n {tr('跳到主要內容')}\n </a>\n {phone || tablet ? null : pinned ? (\n <SideNav\n sections={nav}\n value={value}\n onChange={onNavigate}\n brand={brand}\n collapsed={collapsed}\n pinned\n onPin={togglePin}\n onToggle={() => {\n setStoredCollapsed(userCollapsed ? '0' : '1');\n }}\n />\n ) : (\n // Not pinned: the strip keeps its 72 px in the layout; the sidebar inside opens over the content and closes\n // again when the pointer and the focus have left it, after a page is chosen, or on Esc.\n <div\n className={cx('ui-shell-rail', open && 'is-open')}\n onPointerEnter={(e) => e.pointerType === 'mouse' && later(true)}\n onPointerLeave={(e) => e.pointerType === 'mouse' && later(false)}\n onFocus={(e) => {\n if (!(e.target as Element).matches(':focus-visible')) return;\n clearTimeout(closeTimer.current);\n setOpen(true);\n }}\n onBlur={(e) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node | null)) setOpen(false);\n }}\n onKeyDown={(e) => {\n if (e.key === 'Escape' && open) {\n e.stopPropagation();\n setOpen(false);\n }\n }}\n >\n <SideNav\n sections={nav}\n value={value}\n onChange={(id) => {\n clearTimeout(openTimer.current);\n setOpen(false);\n onNavigate(id);\n }}\n brand={brand}\n collapsed={collapsed}\n onPin={togglePin}\n />\n </div>\n )}\n <div className=\"ui-shell-body\">\n <TopBar\n className={cx('ui-shell-top', hidden && 'is-hidden')}\n title={title}\n tags={tags}\n breadcrumb={breadcrumb}\n onSearch={onSearch ?? false}\n onMenu={tablet ? () => setMoreOpen(true) : undefined}\n >\n {actions}\n </TopBar>\n <main ref={main} id=\"main\" className=\"ui-shell-main\" tabIndex={-1}>\n <ShellTitle.Provider value={shellTitle}>{children}</ShellTitle.Provider>\n </main>\n {phone && tabs.length ? <MobileTabBar items={tabs} value={tabValue} onChange={onTab} labels={tabLabels} /> : null}\n {phone || tablet ? (\n <Drawer open={moreOpen} onOpenChange={setMoreOpen} title={tr('全部頁面')} side={tablet ? 'left' : 'right'} width={tablet ? 300 : undefined}>\n <SideNav\n className=\"ui-shell-allnav\"\n sections={nav}\n value={value}\n onChange={(id) => {\n setMoreOpen(false);\n onNavigate(id);\n }}\n />\n </Drawer>\n ) : null}\n {/* toast() works on every AppShell page without setup; a page's own <Toaster /> takes over. */}\n <AutoToaster />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,aAAaA,kBAAW;AAoCxB,MAAM,eAAe;AACrB,MAAM,UAAU;;AAEhB,MAAM,aAAa;;AAEnB,MAAM,cAAc;AAGpB,MAAM,OAAO;;;;AAKb,SAAgB,SAAS,EACvB,KACA,OACA,YACA,OACA,OACA,MACA,YACA,UACA,SACA,UACA,WACA,gBAAgB,OAChB,aACgB;CAChB,QACE,YACA,YACA,uIACF;CACA,MAAM,QAAQ,UAAU;CAGxB,MAAM,SAAS,SAAS,4CAA4C;CAEpE,MAAM,CAAC,iBAAiB,sBAAsB,UAAyB,cAAc,QAAQ,IAAI;CACjG,MAAM,CAAC,WAAW,gBAAgB,UAAyB,SAAS,QAAQ,IAAI;CAChF,MAAM,gBAAgB,oBAAoB;CAG1C,MAAM,SAAS,aAAa,OAAO,cAAc,MAAM,mBAAmB,QAAQ;CAClF,MAAM,UAAU,kBAAkB,CAAC,CAAC;CACpC,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,KAAK;CAC5C,MAAM,YAAY,MAAM,OAAsC,KAAA,CAAS;CACvE,MAAM,aAAa,MAAM,OAAsC,KAAA,CAAS;CACxE,MAAM,SAAS,SAAkB;EAC/B,aAAa,UAAU,OAAO;EAC9B,aAAa,WAAW,OAAO;EAC/B,IAAI,MAAM,UAAU,UAAU,iBAAiB,QAAQ,IAAI,GAAG,UAAU;OACnE,WAAW,UAAU,iBAAiB,QAAQ,KAAK,GAAG,WAAW;CACxE;CACA,MAAM,sBACQ;EACV,aAAa,UAAU,OAAO;EAC9B,aAAa,WAAW,OAAO;CACjC,GACA,CAAC,CACH;CACA,MAAM,YAAY,SAAS,gBAAgB,CAAC;CAC5C,MAAM,kBAAkB;EACtB,aAAa,SAAS,MAAM,GAAG;EAC/B,QAAQ,KAAK;CACf;CACA,MAAM,MAAM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