@seanyeh77/ui 0.40.0 → 0.42.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 (441) hide show
  1. package/README.md +32 -0
  2. package/dist/announce.d.ts +3 -0
  3. package/dist/announce.js +35 -0
  4. package/dist/announce.js.map +1 -0
  5. package/dist/bundle.js +19 -19
  6. package/dist/bundle.js.map +1 -1
  7. package/dist/components/AccentPicker/AccentPicker.d.ts +12 -0
  8. package/dist/components/AccentPicker/AccentPicker.js +96 -0
  9. package/dist/components/AccentPicker/AccentPicker.js.map +1 -0
  10. package/dist/components/ActionBar/ActionBar.d.ts +27 -0
  11. package/dist/components/ActionBar/ActionBar.js +62 -0
  12. package/dist/components/ActionBar/ActionBar.js.map +1 -0
  13. package/dist/components/AiMark/AiMark.d.ts +10 -0
  14. package/dist/components/AiMark/AiMark.js +21 -0
  15. package/dist/components/AiMark/AiMark.js.map +1 -0
  16. package/dist/components/Alert/Alert.d.ts +17 -0
  17. package/dist/components/Alert/Alert.js +56 -0
  18. package/dist/components/Alert/Alert.js.map +1 -0
  19. package/dist/components/AppShell/AppShell.d.ts +36 -0
  20. package/dist/components/AppShell/AppShell.js +195 -0
  21. package/dist/components/AppShell/AppShell.js.map +1 -0
  22. package/dist/components/Badge/Badge.d.ts +12 -0
  23. package/dist/components/Badge/Badge.js +58 -0
  24. package/dist/components/Badge/Badge.js.map +1 -0
  25. package/dist/components/BarChart/BarChart.d.ts +19 -0
  26. package/dist/components/BarChart/BarChart.js +78 -0
  27. package/dist/components/BarChart/BarChart.js.map +1 -0
  28. package/dist/components/Breadcrumb/Breadcrumb.d.ts +11 -0
  29. package/dist/components/Breadcrumb/Breadcrumb.js +29 -0
  30. package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
  31. package/dist/components/Button/Button.d.ts +39 -0
  32. package/dist/components/Button/Button.js +54 -0
  33. package/dist/components/Button/Button.js.map +1 -0
  34. package/dist/components/Calendar/Calendar.d.ts +18 -0
  35. package/dist/components/Calendar/Calendar.js +125 -0
  36. package/dist/components/Calendar/Calendar.js.map +1 -0
  37. package/dist/components/Card/Card.d.ts +14 -0
  38. package/dist/components/Card/Card.js +33 -0
  39. package/dist/components/Card/Card.js.map +1 -0
  40. package/dist/components/Checkbox/Checkbox.d.ts +14 -0
  41. package/dist/components/Checkbox/Checkbox.js +27 -0
  42. package/dist/components/Checkbox/Checkbox.js.map +1 -0
  43. package/dist/components/CodeView/CodeView.d.ts +111 -0
  44. package/dist/components/CodeView/CodeView.js +790 -0
  45. package/dist/components/CodeView/CodeView.js.map +1 -0
  46. package/dist/components/CodeView/tokens.d.ts +5 -0
  47. package/dist/components/CodeView/tokens.js +70 -0
  48. package/dist/components/CodeView/tokens.js.map +1 -0
  49. package/dist/components/CommandPalette/CommandPalette.d.ts +52 -0
  50. package/dist/components/CommandPalette/CommandPalette.js +242 -0
  51. package/dist/components/CommandPalette/CommandPalette.js.map +1 -0
  52. package/dist/components/ConsoleLayout/ConsoleLayout.d.ts +44 -0
  53. package/dist/components/ConsoleLayout/ConsoleLayout.js +119 -0
  54. package/dist/components/ConsoleLayout/ConsoleLayout.js.map +1 -0
  55. package/dist/components/DangerZone/DangerZone.d.ts +16 -0
  56. package/dist/components/DangerZone/DangerZone.js +28 -0
  57. package/dist/components/DangerZone/DangerZone.js.map +1 -0
  58. package/dist/components/DataTable/DataTable.d.ts +99 -0
  59. package/dist/components/DataTable/DataTable.js +1267 -0
  60. package/dist/components/DataTable/DataTable.js.map +1 -0
  61. package/dist/components/DataTable/SortButton.js +222 -0
  62. package/dist/components/DataTable/SortButton.js.map +1 -0
  63. package/dist/components/DataTable/filters.js +147 -0
  64. package/dist/components/DataTable/filters.js.map +1 -0
  65. package/dist/components/DataTable/parts.js +373 -0
  66. package/dist/components/DataTable/parts.js.map +1 -0
  67. package/dist/components/DataTable/types.d.ts +85 -0
  68. package/dist/components/DatePicker/DatePicker.d.ts +15 -0
  69. package/dist/components/DatePicker/DatePicker.js +104 -0
  70. package/dist/components/DatePicker/DatePicker.js.map +1 -0
  71. package/dist/components/DateRangePicker/DateRangePicker.d.ts +11 -0
  72. package/dist/components/DateRangePicker/DateRangePicker.js +88 -0
  73. package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -0
  74. package/dist/components/DetailList/DetailList.d.ts +17 -0
  75. package/dist/components/DetailList/DetailList.js +18 -0
  76. package/dist/components/DetailList/DetailList.js.map +1 -0
  77. package/dist/components/Dialog/Dialog.d.ts +30 -0
  78. package/dist/components/Dialog/Dialog.js +87 -0
  79. package/dist/components/Dialog/Dialog.js.map +1 -0
  80. package/dist/components/Drawer/Drawer.d.ts +20 -0
  81. package/dist/components/Drawer/Drawer.js +64 -0
  82. package/dist/components/Drawer/Drawer.js.map +1 -0
  83. package/dist/components/EmptyState/EmptyState.d.ts +15 -0
  84. package/dist/components/EmptyState/EmptyState.js +34 -0
  85. package/dist/components/EmptyState/EmptyState.js.map +1 -0
  86. package/dist/components/ErrorPage/ErrorPage.d.ts +14 -0
  87. package/dist/components/ErrorPage/ErrorPage.js +47 -0
  88. package/dist/components/ErrorPage/ErrorPage.js.map +1 -0
  89. package/dist/components/EventTimeline/EventTimeline.d.ts +19 -0
  90. package/dist/components/EventTimeline/EventTimeline.js +63 -0
  91. package/dist/components/EventTimeline/EventTimeline.js.map +1 -0
  92. package/dist/components/FileUpload/FileUpload.d.ts +27 -0
  93. package/dist/components/FileUpload/FileUpload.js +121 -0
  94. package/dist/components/FileUpload/FileUpload.js.map +1 -0
  95. package/dist/components/FormGrid/FormGrid.d.ts +7 -0
  96. package/dist/components/FormGrid/FormGrid.js +14 -0
  97. package/dist/components/FormGrid/FormGrid.js.map +1 -0
  98. package/dist/components/Graph/Graph.d.ts +18 -0
  99. package/dist/components/Graph/Graph.js +97 -0
  100. package/dist/components/Graph/Graph.js.map +1 -0
  101. package/dist/components/Grid/Grid.d.ts +16 -0
  102. package/dist/components/Grid/Grid.js +21 -0
  103. package/dist/components/Grid/Grid.js.map +1 -0
  104. package/dist/components/IconButton/IconButton.d.ts +32 -0
  105. package/dist/components/IconButton/IconButton.js +104 -0
  106. package/dist/components/IconButton/IconButton.js.map +1 -0
  107. package/dist/components/InlineCode/InlineCode.d.ts +46 -0
  108. package/dist/components/InlineCode/InlineCode.js +71 -0
  109. package/dist/components/InlineCode/InlineCode.js.map +1 -0
  110. package/dist/components/KpiCard/KpiCard.d.ts +38 -0
  111. package/dist/components/KpiCard/KpiCard.js +116 -0
  112. package/dist/components/KpiCard/KpiCard.js.map +1 -0
  113. package/dist/components/LayerGraph/LayerGraph.d.ts +117 -0
  114. package/dist/components/LayerGraph/LayerGraph.js +1644 -0
  115. package/dist/components/LayerGraph/LayerGraph.js.map +1 -0
  116. package/dist/components/LineChart/LineChart.d.ts +73 -0
  117. package/dist/components/LineChart/LineChart.js +337 -0
  118. package/dist/components/LineChart/LineChart.js.map +1 -0
  119. package/dist/components/LoadingBar/LoadingBar.d.ts +7 -0
  120. package/dist/components/LoadingBar/LoadingBar.js +18 -0
  121. package/dist/components/LoadingBar/LoadingBar.js.map +1 -0
  122. package/dist/components/LoginCard/LoginCard.d.ts +23 -0
  123. package/dist/components/LoginCard/LoginCard.js +113 -0
  124. package/dist/components/LoginCard/LoginCard.js.map +1 -0
  125. package/dist/components/Markdown/Markdown.d.ts +38 -0
  126. package/dist/components/Markdown/Markdown.js +716 -0
  127. package/dist/components/Markdown/Markdown.js.map +1 -0
  128. package/dist/components/Menu/Menu.d.ts +33 -0
  129. package/dist/components/Menu/Menu.js +75 -0
  130. package/dist/components/Menu/Menu.js.map +1 -0
  131. package/dist/components/Meter/Meter.d.ts +20 -0
  132. package/dist/components/Meter/Meter.js +120 -0
  133. package/dist/components/Meter/Meter.js.map +1 -0
  134. package/dist/components/MobileTabBar/MobileTabBar.d.ts +21 -0
  135. package/dist/components/MobileTabBar/MobileTabBar.js +47 -0
  136. package/dist/components/MobileTabBar/MobileTabBar.js.map +1 -0
  137. package/dist/components/MultiSelect/MultiSelect.d.ts +25 -0
  138. package/dist/components/MultiSelect/MultiSelect.js +116 -0
  139. package/dist/components/MultiSelect/MultiSelect.js.map +1 -0
  140. package/dist/components/NotificationBell/NotificationBell.d.ts +20 -0
  141. package/dist/components/NotificationBell/NotificationBell.js +92 -0
  142. package/dist/components/NotificationBell/NotificationBell.js.map +1 -0
  143. package/dist/components/Popover/Popover.d.ts +20 -0
  144. package/dist/components/Popover/Popover.js +48 -0
  145. package/dist/components/Popover/Popover.js.map +1 -0
  146. package/dist/components/ProgressBar/ProgressBar.d.ts +10 -0
  147. package/dist/components/ProgressBar/ProgressBar.js +38 -0
  148. package/dist/components/ProgressBar/ProgressBar.js.map +1 -0
  149. package/dist/components/ProgressRing/ProgressRing.d.ts +11 -0
  150. package/dist/components/ProgressRing/ProgressRing.js +53 -0
  151. package/dist/components/ProgressRing/ProgressRing.js.map +1 -0
  152. package/dist/components/ProjectSwitcher/ProjectSwitcher.d.ts +25 -0
  153. package/dist/components/ProjectSwitcher/ProjectSwitcher.js +97 -0
  154. package/dist/components/ProjectSwitcher/ProjectSwitcher.js.map +1 -0
  155. package/dist/components/RadioGroup/RadioGroup.d.ts +18 -0
  156. package/dist/components/RadioGroup/RadioGroup.js +63 -0
  157. package/dist/components/RadioGroup/RadioGroup.js.map +1 -0
  158. package/dist/components/SearchField/SearchField.d.ts +9 -0
  159. package/dist/components/SearchField/SearchField.js +46 -0
  160. package/dist/components/SearchField/SearchField.js.map +1 -0
  161. package/dist/components/Section/Section.d.ts +50 -0
  162. package/dist/components/Section/Section.js +220 -0
  163. package/dist/components/Section/Section.js.map +1 -0
  164. package/dist/components/SegmentedControl/SegmentedControl.d.ts +23 -0
  165. package/dist/components/SegmentedControl/SegmentedControl.js +86 -0
  166. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -0
  167. package/dist/components/Select/Select.d.ts +31 -0
  168. package/dist/components/Select/Select.js +138 -0
  169. package/dist/components/Select/Select.js.map +1 -0
  170. package/dist/components/SettingsLayout/SettingsLayout.d.ts +27 -0
  171. package/dist/components/SettingsLayout/SettingsLayout.js +69 -0
  172. package/dist/components/SettingsLayout/SettingsLayout.js.map +1 -0
  173. package/dist/components/SideNav/SideNav.d.ts +48 -0
  174. package/dist/components/SideNav/SideNav.js +220 -0
  175. package/dist/components/SideNav/SideNav.js.map +1 -0
  176. package/dist/components/Skeleton/Skeleton.d.ts +8 -0
  177. package/dist/components/Skeleton/Skeleton.js +17 -0
  178. package/dist/components/Skeleton/Skeleton.js.map +1 -0
  179. package/dist/components/SplitPane/SplitPane.d.ts +23 -0
  180. package/dist/components/SplitPane/SplitPane.js +140 -0
  181. package/dist/components/SplitPane/SplitPane.js.map +1 -0
  182. package/dist/components/StatusBand/StatusBand.d.ts +31 -0
  183. package/dist/components/StatusBand/StatusBand.js +43 -0
  184. package/dist/components/StatusBand/StatusBand.js.map +1 -0
  185. package/dist/components/Suggestion/Suggestion.d.ts +22 -0
  186. package/dist/components/Suggestion/Suggestion.js +72 -0
  187. package/dist/components/Suggestion/Suggestion.js.map +1 -0
  188. package/dist/components/Switch/Switch.d.ts +11 -0
  189. package/dist/components/Switch/Switch.js +56 -0
  190. package/dist/components/Switch/Switch.js.map +1 -0
  191. package/dist/components/Tabs/Tabs.d.ts +23 -0
  192. package/dist/components/Tabs/Tabs.js +117 -0
  193. package/dist/components/Tabs/Tabs.js.map +1 -0
  194. package/dist/components/Tag/Tag.d.ts +13 -0
  195. package/dist/components/Tag/Tag.js +22 -0
  196. package/dist/components/Tag/Tag.js.map +1 -0
  197. package/dist/components/Term/Term.d.ts +34 -0
  198. package/dist/components/Term/Term.js +138 -0
  199. package/dist/components/Term/Term.js.map +1 -0
  200. package/dist/components/TextArea/TextArea.d.ts +15 -0
  201. package/dist/components/TextArea/TextArea.js +75 -0
  202. package/dist/components/TextArea/TextArea.js.map +1 -0
  203. package/dist/components/TextField/TextField.d.ts +15 -0
  204. package/dist/components/TextField/TextField.js +43 -0
  205. package/dist/components/TextField/TextField.js.map +1 -0
  206. package/dist/components/ThemePicker/ThemePicker.d.ts +13 -0
  207. package/dist/components/ThemePicker/ThemePicker.js +66 -0
  208. package/dist/components/ThemePicker/ThemePicker.js.map +1 -0
  209. package/dist/components/TimeControl/TimeControl.d.ts +19 -0
  210. package/dist/components/TimeControl/TimeControl.js +47 -0
  211. package/dist/components/TimeControl/TimeControl.js.map +1 -0
  212. package/dist/components/Toast/Toast.d.ts +10 -0
  213. package/dist/components/Toast/Toast.js +27 -0
  214. package/dist/components/Toast/Toast.js.map +1 -0
  215. package/dist/components/Tooltip/Tooltip.d.ts +17 -0
  216. package/dist/components/Tooltip/Tooltip.js +69 -0
  217. package/dist/components/Tooltip/Tooltip.js.map +1 -0
  218. package/dist/components/TopBar/TopBar.d.ts +18 -0
  219. package/dist/components/TopBar/TopBar.js +55 -0
  220. package/dist/components/TopBar/TopBar.js.map +1 -0
  221. package/dist/components/Tour/Tour.d.ts +44 -0
  222. package/dist/components/Tour/Tour.js +440 -0
  223. package/dist/components/Tour/Tour.js.map +1 -0
  224. package/dist/components/TreeList/TreeList.d.ts +90 -0
  225. package/dist/components/TreeList/TreeList.js +588 -0
  226. package/dist/components/TreeList/TreeList.js.map +1 -0
  227. package/dist/components/TreeList/helpers.d.ts +2 -0
  228. package/dist/components/TreeList/helpers.js +104 -0
  229. package/dist/components/TreeList/helpers.js.map +1 -0
  230. package/dist/components/Workbench/Workbench.d.ts +100 -0
  231. package/dist/components/Workbench/Workbench.js +1137 -0
  232. package/dist/components/Workbench/Workbench.js.map +1 -0
  233. package/dist/components/ZoneMap/ZoneMap.d.ts +49 -0
  234. package/dist/components/ZoneMap/ZoneMap.js +89 -0
  235. package/dist/components/ZoneMap/ZoneMap.js.map +1 -0
  236. package/dist/css/AccentPicker.css +49 -0
  237. package/dist/css/ActionBar.css +36 -0
  238. package/dist/css/AiMark.css +14 -0
  239. package/dist/css/Alert.css +80 -0
  240. package/dist/css/AppShell.css +81 -0
  241. package/dist/css/Badge.css +68 -0
  242. package/dist/css/BarChart.css +66 -0
  243. package/dist/css/Breadcrumb.css +33 -0
  244. package/dist/css/Button.css +190 -0
  245. package/dist/css/Calendar.css +96 -0
  246. package/dist/css/Card.css +70 -0
  247. package/dist/css/Checkbox.css +38 -0
  248. package/dist/css/CodeView.css +302 -0
  249. package/dist/css/CommandPalette.css +232 -0
  250. package/dist/css/ConsoleLayout.css +131 -0
  251. package/dist/css/DangerZone.css +32 -0
  252. package/dist/css/DataTable.css +1195 -0
  253. package/dist/css/DatePicker.css +38 -0
  254. package/dist/css/DateRangePicker.css +70 -0
  255. package/dist/css/DetailList.css +69 -0
  256. package/dist/css/Dialog.css +3 -0
  257. package/dist/css/Drawer.css +90 -0
  258. package/dist/css/EmptyState.css +61 -0
  259. package/dist/css/ErrorPage.css +40 -0
  260. package/dist/css/EventTimeline.css +43 -0
  261. package/dist/css/FileUpload.css +92 -0
  262. package/dist/css/FormGrid.css +17 -0
  263. package/dist/css/Graph.css +99 -0
  264. package/dist/css/Grid.css +48 -0
  265. package/dist/css/IconButton.css +149 -0
  266. package/dist/css/InlineCode.css +92 -0
  267. package/dist/css/KpiCard.css +121 -0
  268. package/dist/css/LayerGraph.css +575 -0
  269. package/dist/css/LineChart.css +3 -0
  270. package/dist/css/LoadingBar.css +45 -0
  271. package/dist/css/LoginCard.css +65 -0
  272. package/dist/css/Markdown.css +266 -0
  273. package/dist/css/Menu.css +88 -0
  274. package/dist/css/Meter.css +110 -0
  275. package/dist/css/MobileTabBar.css +63 -0
  276. package/dist/css/MultiSelect.css +78 -0
  277. package/dist/css/NotificationBell.css +129 -0
  278. package/dist/css/Popover.css +57 -0
  279. package/dist/css/ProgressBar.css +42 -0
  280. package/dist/css/ProgressRing.css +19 -0
  281. package/dist/css/ProjectSwitcher.css +153 -0
  282. package/dist/css/RadioGroup.css +52 -0
  283. package/dist/css/SearchField.css +79 -0
  284. package/dist/css/Section.css +115 -0
  285. package/dist/css/SegmentedControl.css +67 -0
  286. package/dist/css/Select.css +136 -0
  287. package/dist/css/SettingsLayout.css +110 -0
  288. package/dist/css/SideNav.css +281 -0
  289. package/dist/css/Skeleton.css +19 -0
  290. package/dist/css/SplitPane.css +108 -0
  291. package/dist/css/StatusBand.css +23 -0
  292. package/dist/css/Suggestion.css +82 -0
  293. package/dist/css/Switch.css +46 -0
  294. package/dist/css/Tabs.css +91 -0
  295. package/dist/css/Tag.css +36 -0
  296. package/dist/css/Term.css +160 -0
  297. package/dist/css/TextArea.css +22 -0
  298. package/dist/css/TextField.css +2 -0
  299. package/dist/css/ThemePicker.css +70 -0
  300. package/dist/css/TimeControl.css +33 -0
  301. package/dist/css/Toast.css +47 -0
  302. package/dist/css/Tooltip.css +58 -0
  303. package/dist/css/TopBar.css +86 -0
  304. package/dist/css/Tour.css +90 -0
  305. package/dist/css/TreeList.css +532 -0
  306. package/dist/css/Workbench.css +652 -0
  307. package/dist/css/ZoneMap.css +203 -0
  308. package/dist/css/base.css +556 -0
  309. package/dist/css/end.css +273 -0
  310. package/dist/format-entry.d.ts +3 -0
  311. package/dist/format-entry.js +3 -0
  312. package/dist/format.d.ts +68 -2
  313. package/dist/format.js +237 -1
  314. package/dist/format.js.map +1 -0
  315. package/dist/i18n.d.ts +11 -0
  316. package/dist/{format-entry-C7iBqN3J.js → i18n.js} +10 -225
  317. package/dist/i18n.js.map +1 -0
  318. package/dist/icons/Icon.d.ts +23 -0
  319. package/dist/icons/Icon.js +90 -0
  320. package/dist/icons/Icon.js.map +1 -0
  321. package/dist/icons/data.d.ts +150 -0
  322. package/dist/icons/data.js +256 -0
  323. package/dist/icons/data.js.map +1 -0
  324. package/dist/index.d.ts +84 -2258
  325. package/dist/index.js +79 -12715
  326. package/dist/internal/Field.js +71 -0
  327. package/dist/internal/Field.js.map +1 -0
  328. package/dist/internal/FloatingPanel.js +41 -0
  329. package/dist/internal/FloatingPanel.js.map +1 -0
  330. package/dist/internal/chart.js +131 -0
  331. package/dist/internal/chart.js.map +1 -0
  332. package/dist/internal/dev.js +21 -0
  333. package/dist/internal/dev.js.map +1 -0
  334. package/dist/internal/focus.js +94 -0
  335. package/dist/internal/focus.js.map +1 -0
  336. package/dist/internal/focusMain.d.ts +4 -0
  337. package/dist/internal/focusMain.js +22 -0
  338. package/dist/internal/focusMain.js.map +1 -0
  339. package/dist/internal/scrollHint.js +75 -0
  340. package/dist/internal/scrollHint.js.map +1 -0
  341. package/dist/internal/tableTools.js +109 -0
  342. package/dist/internal/tableTools.js.map +1 -0
  343. package/dist/internal/terms.d.ts +18 -0
  344. package/dist/internal/terms.js +64 -0
  345. package/dist/internal/terms.js.map +1 -0
  346. package/dist/internal/util.js +107 -0
  347. package/dist/internal/util.js.map +1 -0
  348. package/dist/motion.d.ts +5 -0
  349. package/dist/motion.js +29 -0
  350. package/dist/motion.js.map +1 -0
  351. package/dist/styles.css +4419 -4195
  352. package/dist/theme.d.ts +20 -0
  353. package/dist/theme.js +210 -0
  354. package/dist/theme.js.map +1 -0
  355. package/dist/tokens.css +78 -19
  356. package/docs/AccentPicker.md +17 -2
  357. package/docs/ActionBar.md +6 -4
  358. package/docs/AiMark.md +12 -6
  359. package/docs/Alert.md +17 -5
  360. package/docs/AppShell.md +20 -11
  361. package/docs/Badge.md +20 -9
  362. package/docs/BarChart.md +21 -3
  363. package/docs/Breadcrumb.md +9 -4
  364. package/docs/Button.md +18 -8
  365. package/docs/Calendar.md +10 -5
  366. package/docs/Card.md +17 -9
  367. package/docs/Checkbox.md +15 -4
  368. package/docs/CodeView.md +16 -13
  369. package/docs/CommandPalette.md +18 -10
  370. package/docs/ConsoleLayout.md +24 -2
  371. package/docs/DangerZone.md +9 -3
  372. package/docs/DataColors.md +11 -4
  373. package/docs/DataTable.md +77 -28
  374. package/docs/DatePicker.md +16 -2
  375. package/docs/DateRangePicker.md +13 -1
  376. package/docs/DetailList.md +17 -12
  377. package/docs/Dialog.md +11 -6
  378. package/docs/Drawer.md +13 -7
  379. package/docs/EmptyState.md +13 -1
  380. package/docs/ErrorPage.md +6 -0
  381. package/docs/EventTimeline.md +11 -5
  382. package/docs/FileUpload.md +21 -5
  383. package/docs/FormGrid.md +11 -2
  384. package/docs/Format.md +19 -1
  385. package/docs/Graph.md +17 -2
  386. package/docs/Grid.md +13 -4
  387. package/docs/IconButton.md +16 -13
  388. package/docs/InlineCode.md +18 -8
  389. package/docs/KpiCard.md +21 -7
  390. package/docs/LayerGraph.md +36 -23
  391. package/docs/LineChart.md +22 -1
  392. package/docs/LoadingBar.md +7 -1
  393. package/docs/LoginCard.md +19 -3
  394. package/docs/Markdown.md +18 -2
  395. package/docs/Menu.md +13 -7
  396. package/docs/Meter.md +12 -5
  397. package/docs/MobileTabBar.md +18 -2
  398. package/docs/MultiSelect.md +13 -3
  399. package/docs/NotificationBell.md +13 -3
  400. package/docs/Popover.md +12 -2
  401. package/docs/ProgressBar.md +8 -2
  402. package/docs/ProgressRing.md +8 -2
  403. package/docs/ProjectSwitcher.md +15 -9
  404. package/docs/RadioGroup.md +21 -3
  405. package/docs/SearchField.md +8 -2
  406. package/docs/Section.md +16 -4
  407. package/docs/SegmentedControl.md +21 -19
  408. package/docs/Select.md +16 -1
  409. package/docs/SettingsLayout.md +19 -4
  410. package/docs/SideNav.md +20 -2
  411. package/docs/Skeleton.md +7 -1
  412. package/docs/SplitPane.md +7 -1
  413. package/docs/StatusBand.md +12 -6
  414. package/docs/Suggestion.md +12 -5
  415. package/docs/Switch.md +15 -2
  416. package/docs/Tabs.md +25 -6
  417. package/docs/Tag.md +16 -12
  418. package/docs/Term.md +18 -1
  419. package/docs/TextArea.md +12 -1
  420. package/docs/TextField.md +15 -5
  421. package/docs/ThemePicker.md +16 -4
  422. package/docs/TimeControl.md +10 -5
  423. package/docs/Toast.md +13 -3
  424. package/docs/Tooltip.md +17 -5
  425. package/docs/TopBar.md +16 -3
  426. package/docs/Tour.md +25 -1
  427. package/docs/TreeList.md +16 -9
  428. package/docs/Workbench.md +12 -6
  429. package/docs/ZoneMap.md +17 -10
  430. package/docs/code.md +28 -0
  431. package/docs/data.md +45 -0
  432. package/docs/forms.md +29 -0
  433. package/docs/guidelines.md +65 -315
  434. package/docs/layout.md +24 -4
  435. package/docs/monitoring.md +30 -0
  436. package/docs/motion.md +1 -1
  437. package/docs/theme.md +153 -0
  438. package/package.json +6 -5
  439. package/dist/format-entry-BJI8MU2K.d.ts +0 -75
  440. package/dist/format-entry-C7iBqN3J.js.map +0 -1
  441. package/dist/index.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip.js","names":["Tooltip","Base"],"sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Tooltip as Base } from '@base-ui/react/tooltip';\n\nexport interface TooltipProps {\n /** Short text, also announced as the trigger's description. Never the only place important information lives. */\n label: string;\n /** Preferred side; flips when there is no room. 'right' for controls at a sidebar's edge. Default 'top'. */\n side?: 'top' | 'bottom' | 'right';\n /** One focusable element that accepts a ref (a button, IconButton, Button, a link). */\n children: React.ReactElement;\n /** false: the label only repeats the trigger's own name (an IconButton's aria-label), so it is not added as its description. Default true. */\n describe?: boolean;\n /** Long text (a cut-off table cell): wraps at 360 px in regular weight instead of one bold line. */\n wrap?: boolean;\n /** Turns it off without unmounting the trigger, e.g. while a cell's text still fits. */\n disabled?: boolean;\n}\n\n// The Tooltips open right now: opening one closes the others, so moving fast (Tab through a table) never stacks them.\nconst openNow = new Set<() => void>();\n\n/** Dark label above the element (below when there is no room), with an arrow. Appears at once on hover and focus. */\nexport function Tooltip({ label, side = 'top', describe = true, wrap = false, disabled = false, children }: TooltipProps) {\n // Base UI tooltips are visual only; a hidden copy gives screen readers the description.\n const id = React.useId();\n const [open, setOpen] = React.useState(false);\n const close = React.useCallback(() => setOpen(false), []);\n const shown = open && !disabled;\n // A tap elsewhere or any scroll closes it: on a touch screen the trigger keeps focus after a tap, so focus alone\n // would leave the Tooltip over the next row.\n React.useEffect(() => {\n if (!shown) return;\n const away = (e: Event) => {\n const t = e.target;\n if (!(t instanceof Element) || !t.closest(`[data-ui-tip=\"${id}\"]`)) close();\n };\n document.addEventListener('pointerdown', away, true);\n document.addEventListener('scroll', close, true);\n return () => {\n document.removeEventListener('pointerdown', away, true);\n document.removeEventListener('scroll', close, true);\n };\n }, [shown, close, id]);\n React.useEffect(() => {\n if (!shown) return;\n for (const other of openNow) if (other !== close) other();\n openNow.add(close);\n return () => {\n openNow.delete(close);\n };\n }, [shown, close]);\n return (\n <Base.Root disabled={disabled} open={shown} onOpenChange={setOpen}>\n <Base.Trigger delay={0} render={children} aria-describedby={describe && !disabled ? id : undefined} onBlur={close} data-ui-tip={id} />\n {describe && !disabled ? (\n <span id={id} hidden>\n {label}\n </span>\n ) : null}\n <Base.Portal>\n <Base.Positioner side={side} sideOffset={8} className=\"ui-tooltip-positioner\">\n <Base.Popup className={wrap ? 'ui-tooltip is-wrap' : 'ui-tooltip'}>\n {label}\n <Base.Arrow className=\"ui-tooltip-arrow\" />\n </Base.Popup>\n </Base.Positioner>\n </Base.Portal>\n </Base.Root>\n );\n}\n"],"mappings":";;;;;AAmBA,MAAM,0BAAU,IAAI,IAAgB;;AAGpC,SAAgBA,UAAQ,EAAE,OAAO,OAAO,OAAO,WAAW,MAAM,OAAO,OAAO,WAAW,OAAO,YAA0B;CAExH,MAAM,KAAK,MAAM,MAAM;CACvB,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,KAAK;CAC5C,MAAM,QAAQ,MAAM,kBAAkB,QAAQ,KAAK,GAAG,CAAC,CAAC;CACxD,MAAM,QAAQ,QAAQ,CAAC;CAGvB,MAAM,gBAAgB;EACpB,IAAI,CAAC,OAAO;EACZ,MAAM,QAAQ,MAAa;GACzB,MAAM,IAAI,EAAE;GACZ,IAAI,EAAE,aAAa,YAAY,CAAC,EAAE,QAAQ,iBAAiB,GAAG,GAAG,GAAG,MAAM;EAC5E;EACA,SAAS,iBAAiB,eAAe,MAAM,IAAI;EACnD,SAAS,iBAAiB,UAAU,OAAO,IAAI;EAC/C,aAAa;GACX,SAAS,oBAAoB,eAAe,MAAM,IAAI;GACtD,SAAS,oBAAoB,UAAU,OAAO,IAAI;EACpD;CACF,GAAG;EAAC;EAAO;EAAO;CAAE,CAAC;CACrB,MAAM,gBAAgB;EACpB,IAAI,CAAC,OAAO;EACZ,KAAK,MAAM,SAAS,SAAS,IAAI,UAAU,OAAO,MAAM;EACxD,QAAQ,IAAI,KAAK;EACjB,aAAa;GACX,QAAQ,OAAO,KAAK;EACtB;CACF,GAAG,CAAC,OAAO,KAAK,CAAC;CACjB,OACE,qBAACC,QAAK,MAAN;EAAqB;EAAU,MAAM;EAAO,cAAc;EAA1D,UAAA;GACE,oBAACA,QAAK,SAAN;IAAc,OAAO;IAAG,QAAQ;IAAU,oBAAkB,YAAY,CAAC,WAAW,KAAK,KAAA;IAAW,QAAQ;IAAO,eAAa;GAAK,CAAA;GACpI,YAAY,CAAC,WACZ,oBAAC,QAAD;IAAU;IAAI,QAAA;IACX,UAAA;GACG,CAAA,IACJ;GACJ,oBAACA,QAAK,QAAN,EAAA,UACE,oBAACA,QAAK,YAAN;IAAuB;IAAM,YAAY;IAAG,WAAU;IACpD,UAAA,qBAACA,QAAK,OAAN;KAAY,WAAW,OAAO,uBAAuB;KAArD,UAAA,CACG,OACD,oBAACA,QAAK,OAAN,EAAY,WAAU,mBAAoB,CAAA,CAChC;;GACG,CAAA,EACN,CAAA;EACJ;;AAEf"}
@@ -0,0 +1,18 @@
1
+ import { BreadcrumbItem } from "../Breadcrumb/Breadcrumb.js";
2
+ import * as React from "react";
3
+ export interface TopBarProps {
4
+ /** The page title, shown once: either here or as the page's own heading. */
5
+ title?: string;
6
+ breadcrumb?: BreadcrumbItem[];
7
+ /** Opens search (CommandPalette). false hides the search entry. */
8
+ onSearch?: (() => void) | false;
9
+ /** Default 「搜尋」. */
10
+ searchLabel?: string;
11
+ /** Right side: NotificationBell, ProjectSwitcher, the account menu. */
12
+ children?: React.ReactNode;
13
+ /** A menu button at the left that opens the navigation (AppShell from 600 to 1024 px). */
14
+ onMenu?: () => void;
15
+ className?: string;
16
+ }
17
+ /** The bar at the top of a dashboard page: title or breadcrumb on the left, search and tools on the right. */
18
+ export declare function TopBar({ title, breadcrumb, onSearch, searchLabel, children, onMenu, className }: TopBarProps): React.JSX.Element;
@@ -0,0 +1,55 @@
1
+ "use client";
2
+ import { tr } from "../../i18n.js";
3
+ import { Icon } from "../../icons/Icon.js";
4
+ import { IS_MAC, SHORTCUT, TOUCH_ONLY, cx, useMedia } from "../../internal/util.js";
5
+ import { Breadcrumb } from "../Breadcrumb/Breadcrumb.js";
6
+ import { IconButton } from "../IconButton/IconButton.js";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ // src/components/TopBar/TopBar.tsx
9
+ /** The bar at the top of a dashboard page: title or breadcrumb on the left, search and tools on the right. */
10
+ function TopBar({ title, breadcrumb, onSearch, searchLabel, children, onMenu, className }) {
11
+ const touch = useMedia(TOUCH_ONLY);
12
+ return /* @__PURE__ */ jsxs("header", {
13
+ className: cx("ui-topbar", className),
14
+ children: [
15
+ onMenu ? /* @__PURE__ */ jsx(IconButton, {
16
+ className: "ui-topbar-menu",
17
+ icon: "list-bullets",
18
+ label: tr("開啟導覽"),
19
+ onClick: onMenu
20
+ }) : null,
21
+ title ? /* @__PURE__ */ jsx("h1", {
22
+ className: "ui-topbar-title",
23
+ children: title
24
+ }) : null,
25
+ breadcrumb ? /* @__PURE__ */ jsx(Breadcrumb, { items: breadcrumb }) : null,
26
+ /* @__PURE__ */ jsxs("div", {
27
+ className: "ui-topbar-end",
28
+ children: [onSearch !== false ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("button", {
29
+ type: "button",
30
+ className: "ui-search",
31
+ "data-tour": "search",
32
+ onClick: onSearch,
33
+ "aria-keyshortcuts": IS_MAC ? "Meta+K" : "Control+K",
34
+ children: [
35
+ /* @__PURE__ */ jsx(Icon, {
36
+ name: "magnifying-glass",
37
+ size: 16
38
+ }),
39
+ /* @__PURE__ */ jsx("span", { children: searchLabel || tr("搜尋") }),
40
+ touch ? null : /* @__PURE__ */ jsx("kbd", { children: SHORTCUT })
41
+ ]
42
+ }), /* @__PURE__ */ jsx(IconButton, {
43
+ className: "ui-search-icon",
44
+ "data-tour": "search",
45
+ icon: "magnifying-glass",
46
+ label: touch ? tr("搜尋") : tr("搜尋({k})", { k: SHORTCUT }),
47
+ onClick: onSearch
48
+ })] }) : null, children]
49
+ })
50
+ ]
51
+ });
52
+ }
53
+ export { TopBar };
54
+
55
+ //# sourceMappingURL=TopBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TopBar.js","names":[],"sources":["../../../src/components/TopBar/TopBar.tsx"],"sourcesContent":["import type * as React from 'react';\nimport { tr } from '../../i18n';\nimport { Icon } from '../../icons/Icon';\nimport { IS_MAC, SHORTCUT, TOUCH_ONLY, cx, useMedia } from '../../internal/util';\nimport { Breadcrumb, type BreadcrumbItem } from '../Breadcrumb/Breadcrumb';\nimport { IconButton } from '../IconButton/IconButton';\n\nexport interface TopBarProps {\n /** The page title, shown once: either here or as the page's own heading. */\n title?: string;\n breadcrumb?: BreadcrumbItem[];\n /** Opens search (CommandPalette). false hides the search entry. */\n onSearch?: (() => void) | false;\n /** Default 「搜尋」. */\n searchLabel?: string;\n /** Right side: NotificationBell, ProjectSwitcher, the account menu. */\n children?: React.ReactNode;\n /** A menu button at the left that opens the navigation (AppShell from 600 to 1024 px). */\n onMenu?: () => void;\n className?: string;\n}\n\n/** The bar at the top of a dashboard page: title or breadcrumb on the left, search and tools on the right. */\nexport function TopBar({ title, breadcrumb, onSearch, searchLabel, children, onMenu, className }: TopBarProps) {\n const touch = useMedia(TOUCH_ONLY);\n return (\n <header className={cx('ui-topbar', className)}>\n {onMenu ? <IconButton className=\"ui-topbar-menu\" icon=\"list-bullets\" label={tr('開啟導覽')} onClick={onMenu} /> : null}\n {title ? <h1 className=\"ui-topbar-title\">{title}</h1> : null}\n {breadcrumb ? <Breadcrumb items={breadcrumb} /> : null}\n <div className=\"ui-topbar-end\">\n {onSearch !== false ? (\n <>\n <button type=\"button\" className=\"ui-search\" data-tour=\"search\" onClick={onSearch} aria-keyshortcuts={IS_MAC ? 'Meta+K' : 'Control+K'}>\n <Icon name=\"magnifying-glass\" size={16} />\n <span>{searchLabel || tr('搜尋')}</span>\n {/* No keyboard on a touch screen: no shortcut to show. */}\n {touch ? null : <kbd>{SHORTCUT}</kbd>}\n </button>\n <IconButton\n className=\"ui-search-icon\"\n data-tour=\"search\"\n icon=\"magnifying-glass\"\n label={touch ? tr('搜尋') : tr('搜尋({k})', { k: SHORTCUT })}\n onClick={onSearch}\n />\n </>\n ) : null}\n {children}\n </div>\n </header>\n );\n}\n"],"mappings":";;;;;;;;;AAuBA,SAAgB,OAAO,EAAE,OAAO,YAAY,UAAU,aAAa,UAAU,QAAQ,aAA0B;CAC7G,MAAM,QAAQ,SAAS,UAAU;CACjC,OACE,qBAAC,UAAD;EAAQ,WAAW,GAAG,aAAa,SAAS;EAA5C,UAAA;GACG,SAAS,oBAAC,YAAD;IAAY,WAAU;IAAiB,MAAK;IAAe,OAAO,GAAG,MAAM;IAAG,SAAS;GAAS,CAAA,IAAI;GAC7G,QAAQ,oBAAC,MAAD;IAAI,WAAU;IAAmB,UAAA;GAAU,CAAA,IAAI;GACvD,aAAa,oBAAC,YAAD,EAAY,OAAO,WAAa,CAAA,IAAI;GAClD,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACG,aAAa,QACZ,qBAAA,UAAA,EAAA,UAAA,CACE,qBAAC,UAAD;KAAQ,MAAK;KAAS,WAAU;KAAY,aAAU;KAAS,SAAS;KAAU,qBAAmB,SAAS,WAAW;KAAzH,UAAA;MACE,oBAAC,MAAD;OAAM,MAAK;OAAmB,MAAM;MAAK,CAAA;MACzC,oBAAC,QAAD,EAAA,UAAO,eAAe,GAAG,IAAI,EAAQ,CAAA;MAEpC,QAAQ,OAAO,oBAAC,OAAD,EAAA,UAAM,SAAc,CAAA;KAC9B;IACR,CAAA,GAAA,oBAAC,YAAD;KACE,WAAU;KACV,aAAU;KACV,MAAK;KACL,OAAO,QAAQ,GAAG,IAAI,IAAI,GAAG,WAAW,EAAE,GAAG,SAAS,CAAC;KACvD,SAAS;IACV,CAAA,CACD,EAAA,CAAA,IACA,MACH,QACE;;EACC;;AAEZ"}
@@ -0,0 +1,44 @@
1
+ import { IconButtonHint } from "../IconButton/IconButton.js";
2
+ import * as React from "react";
3
+ export interface TourStep {
4
+ /** A data-tour name ('search' matches [data-tour="search"]), a CSS selector (first visible match), a ref or an element.
5
+ * Leave it out for a step in the middle of the screen. */
6
+ target?: string | React.RefObject<Element | null> | Element;
7
+ /** Names the part: 「搜尋」. */
8
+ title: string;
9
+ /** What it does, 1 short sentence; `backticks` are code. */
10
+ text: string;
11
+ /** Default 'bottom'. The card goes below, above, right or left of the target, the first side where it fits in the
12
+ * window and covers neither the target nor `keepVisible` ('top' tries above first). With no such side the page
13
+ * scrolls to make room; failing that, the side that covers the least of the target. */
14
+ side?: 'bottom' | 'top';
15
+ /** Space around the highlighted part in px. Default 6. */
16
+ padding?: number;
17
+ /** Parts the card must not cover either, e.g. the table the step talks about under a highlighted summary: same forms
18
+ * as target. The card then goes to the next side that leaves them visible. */
19
+ keepVisible?: TourStep['target'] | TourStep['target'][];
20
+ }
21
+ export interface TourProps {
22
+ open: boolean;
23
+ steps: TourStep[];
24
+ onClose?: (reason: 'done' | 'skip') => void;
25
+ /** 「略過」 and Esc end the tour early. Default true. */
26
+ skippable?: boolean;
27
+ /** Controlled step index. */
28
+ step?: number;
29
+ onStepChange?: (index: number) => void;
30
+ }
31
+ /** Opens the tour once per browser: { open, start, close, seen, hint }. Pass close to Tour's onClose; start() shows
32
+ * it again. hint(text) gives IconButton's `hint` for the button that starts the tour: a page that uses it shows the dot
33
+ * and the bubble instead of opening the tour by itself. 「開始」 starts the tour; × and finishing it hide the hint for
34
+ * good (the same record as seen). */
35
+ export declare function useTour(key: string): {
36
+ open: boolean;
37
+ start: () => void;
38
+ close: () => void;
39
+ seen: boolean;
40
+ /** IconButton's `hint` for the button that starts this tour, or undefined once seen or while the tour is open. */
41
+ hint: (text: string, action?: string) => IconButtonHint | undefined;
42
+ };
43
+ /** The first-use walkthrough: the page goes dark except the part being introduced, with a card beside it. */
44
+ export declare function Tour({ open, steps, onClose, skippable, step: controlled, onStepChange }: TourProps): React.JSX.Element | null;
@@ -0,0 +1,440 @@
1
+ "use client";
2
+ import { useReturnFocus } from "../../internal/focus.js";
3
+ import { CodeText } from "../InlineCode/InlineCode.js";
4
+ import { Button } from "../Button/Button.js";
5
+ import { tr } from "../../i18n.js";
6
+ import { announce } from "../../announce.js";
7
+ import { cx, seenOnly, store } from "../../internal/util.js";
8
+ import { devWarn } from "../../internal/dev.js";
9
+ import * as React from "react";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { Popover } from "@base-ui/react/popover";
12
+ // src/components/Tour/Tour.tsx
13
+ const TOUR_KEY = "ui-tour:";
14
+ /** Opens the tour once per browser: { open, start, close, seen, hint }. Pass close to Tour's onClose; start() shows
15
+ * it again. hint(text) gives IconButton's `hint` for the button that starts the tour: a page that uses it shows the dot
16
+ * and the bubble instead of opening the tour by itself. 「開始」 starts the tour; × and finishing it hide the hint for
17
+ * good (the same record as seen). */
18
+ function useTour(key) {
19
+ const [seen, setSeen] = React.useState(() => !!store(TOUR_KEY + key));
20
+ const [open, setOpen] = React.useState(false);
21
+ const hinted = React.useRef(false);
22
+ React.useLayoutEffect(() => {
23
+ if (!store(TOUR_KEY + key) && !hinted.current) setOpen(true);
24
+ }, [key]);
25
+ const remember = () => {
26
+ store(TOUR_KEY + key, "1");
27
+ setSeen(true);
28
+ };
29
+ return {
30
+ open,
31
+ start: () => setOpen(true),
32
+ close: () => {
33
+ remember();
34
+ setOpen(false);
35
+ },
36
+ seen,
37
+ /** IconButton's `hint` for the button that starts this tour, or undefined once seen or while the tour is open. */
38
+ hint: (text, action) => {
39
+ hinted.current = true;
40
+ if (seen || open) return void 0;
41
+ return {
42
+ text,
43
+ action,
44
+ onAction: () => setOpen(true),
45
+ onDismiss: remember
46
+ };
47
+ }
48
+ };
49
+ }
50
+ function findTarget(t) {
51
+ if (!t) return null;
52
+ if (typeof t === "string") {
53
+ const sel = /^[\w-]+$/.test(t) && !/^(html|body|main|nav|header|footer|section|aside)$/.test(t) ? `[data-tour="${t}"]` : t;
54
+ return Array.from(document.querySelectorAll(sel)).find((e) => e.getClientRects().length > 0) ?? null;
55
+ }
56
+ return t instanceof Element ? t : t.current;
57
+ }
58
+ const GAP = 12;
59
+ /** The space kept between the card and the window edges: the --space-3 token. */
60
+ function edge() {
61
+ return parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--space-3")) || 12;
62
+ }
63
+ const narrowNow = () => typeof window !== "undefined" && window.innerWidth < 600;
64
+ /** The part of the window between a phone's fixed top bar and bottom tab bar (when the target is not one of them):
65
+ * the card stays inside it and never covers either bar. The whole window elsewhere. */
66
+ function bounds(target) {
67
+ const vh = typeof window === "undefined" ? 0 : window.innerHeight;
68
+ if (!narrowNow()) return {
69
+ top: 0,
70
+ bottom: vh
71
+ };
72
+ let top = 0;
73
+ let bottom = vh;
74
+ const head = document.querySelector(".ui-shell-top");
75
+ const bar = document.querySelector(".ui-tabbar");
76
+ if (head && !(target && head.contains(target))) {
77
+ const r = head.getBoundingClientRect();
78
+ if (r.height && r.bottom > 0 && r.bottom < vh / 2) top = r.bottom;
79
+ }
80
+ if (bar && !(target && bar.contains(target))) {
81
+ const r = bar.getBoundingClientRect();
82
+ if (r.height && r.top > vh / 2 && r.top < vh) bottom = r.top;
83
+ }
84
+ return {
85
+ top,
86
+ bottom
87
+ };
88
+ }
89
+ const area = (a, b) => Math.max(0, Math.min(a.left + a.width, b.left + b.width) - Math.max(a.left, b.left)) * Math.max(0, Math.min(a.top + a.height, b.top + b.height) - Math.max(a.top, b.top));
90
+ /** Where the card goes for a highlighted box. Below, above, right, left (above first with side 'top'): the first
91
+ * where the card fits inside the window and covers neither the target nor the parts the step keeps visible. When
92
+ * none does (after the tour scrolled to make room, see makeRoom), the one that covers the least of the target, then
93
+ * of those parts. Returns the card's box: it is placed at that box's top-left corner. */
94
+ function placeCard(rect, cardH, prefer, area_, cardW = 320, keep = []) {
95
+ const margin = typeof document === "undefined" ? 12 : edge();
96
+ const vw = typeof window === "undefined" ? 0 : window.innerWidth;
97
+ const vh = area_?.bottom ?? (typeof window === "undefined" ? 0 : window.innerHeight);
98
+ const vt = area_?.top ?? 0;
99
+ if (!rect) return {
100
+ mode: "center",
101
+ box: {
102
+ left: (vw - cardW) / 2,
103
+ top: Math.max(vt + margin, (vt + vh) / 2 - cardH / 2),
104
+ width: cardW,
105
+ height: cardH
106
+ },
107
+ fits: true
108
+ };
109
+ const clampX = (x) => Math.max(margin, Math.min(vw - margin - cardW, x));
110
+ const clampY = (y) => Math.max(vt + margin, Math.min(vh - margin - cardH, y));
111
+ const midX = rect.left + rect.width / 2 - cardW / 2;
112
+ const midY = rect.top + rect.height / 2 - cardH / 2;
113
+ const at = {
114
+ bottom: {
115
+ left: midX,
116
+ top: rect.top + rect.height + GAP
117
+ },
118
+ top: {
119
+ left: midX,
120
+ top: rect.top - GAP - cardH
121
+ },
122
+ right: {
123
+ left: rect.left + rect.width + GAP,
124
+ top: midY
125
+ },
126
+ left: {
127
+ left: rect.left - GAP - cardW,
128
+ top: midY
129
+ }
130
+ };
131
+ const options = (prefer === "top" ? [
132
+ "top",
133
+ "bottom",
134
+ "right",
135
+ "left"
136
+ ] : [
137
+ "bottom",
138
+ "top",
139
+ "right",
140
+ "left"
141
+ ]).map((side) => {
142
+ const want = at[side];
143
+ const box = {
144
+ left: clampX(want.left),
145
+ top: clampY(want.top),
146
+ width: cardW,
147
+ height: cardH
148
+ };
149
+ const inside = side === "bottom" || side === "top" ? box.top === want.top : box.left === want.left;
150
+ const onTarget = area(box, rect);
151
+ const onKept = keep.reduce((n, k) => n + area(box, k), 0);
152
+ return {
153
+ mode: side,
154
+ box,
155
+ fits: inside && !onTarget && !onKept,
156
+ onTarget,
157
+ onKept
158
+ };
159
+ });
160
+ const best = options.find((o) => o.fits) ?? [...options].sort((x, y) => x.onTarget - y.onTarget || x.onKept - y.onKept)[0];
161
+ return {
162
+ mode: best.mode,
163
+ box: best.box,
164
+ fits: best.fits
165
+ };
166
+ }
167
+ /** The first-use walkthrough: the page goes dark except the part being introduced, with a card beside it. */
168
+ function Tour({ open, steps, onClose, skippable = true, step: controlled, onStepChange }) {
169
+ const [inner, setInner] = React.useState(0);
170
+ const i = Math.max(0, Math.min(steps.length - 1, controlled ?? inner));
171
+ const step = steps[i];
172
+ const [rect, setRect] = React.useState(null);
173
+ const [kept, setKept] = React.useState([]);
174
+ const next = React.useRef(null);
175
+ const [cardH, setCardH] = React.useState(0);
176
+ const [cardW, setCardW] = React.useState(320);
177
+ const [wasOpen, setWasOpen] = React.useState(open);
178
+ if (open !== wasOpen) {
179
+ setWasOpen(open);
180
+ if (open && controlled == null) setInner(0);
181
+ }
182
+ const go = (n) => {
183
+ onStepChange?.(n);
184
+ if (controlled == null) setInner(n);
185
+ };
186
+ const end = (why) => onClose?.(why);
187
+ useReturnFocus(open);
188
+ const shownStep = React.useRef(-1);
189
+ React.useEffect(() => {
190
+ if (!open || !step) {
191
+ shownStep.current = -1;
192
+ return;
193
+ }
194
+ if (shownStep.current !== -1 && shownStep.current !== i) announce(tr("第 {a} 步,共 {b} 步", {
195
+ a: i + 1,
196
+ b: steps.length
197
+ }) + tr("。") + step.title + tr("。") + step.text.replace(/`/g, ""));
198
+ shownStep.current = i;
199
+ }, [
200
+ open,
201
+ i,
202
+ step,
203
+ steps.length
204
+ ]);
205
+ const cardEl = React.useRef(null);
206
+ const tabbables = () => Array.from(cardEl.current?.querySelectorAll("button:not(:disabled), a[href], input:not(:disabled), [tabindex]:not([tabindex=\"-1\"])") ?? []).filter((e) => e.getClientRects().length > 0);
207
+ const onTab = (e) => {
208
+ if (e.key !== "Tab" || e.altKey || e.ctrlKey || e.metaKey) return;
209
+ const list = tabbables();
210
+ if (!list.length) return;
211
+ e.preventDefault();
212
+ const at = list.indexOf(document.activeElement);
213
+ list[at < 0 ? 0 : (at + (e.shiftKey ? -1 : 1) + list.length) % list.length].focus();
214
+ };
215
+ React.useEffect(() => {
216
+ if (!open) return;
217
+ const back = (e) => {
218
+ const box = cardEl.current;
219
+ if (!box || !(e.target instanceof Node) || box.contains(e.target)) return;
220
+ (next.current ?? tabbables()[0])?.focus();
221
+ };
222
+ document.addEventListener("focusin", back);
223
+ return () => document.removeEventListener("focusin", back);
224
+ }, [open]);
225
+ const target = step?.target;
226
+ const pad = step?.padding ?? 6;
227
+ const keepList = step?.keepVisible == null ? [] : Array.isArray(step.keepVisible) ? step.keepVisible : [step.keepVisible];
228
+ const keepKey = keepList.map((k) => typeof k === "string" ? k : "#").join("|");
229
+ const keepRef = React.useRef(keepList);
230
+ React.useLayoutEffect(() => {
231
+ keepRef.current = keepList;
232
+ });
233
+ const hasStep = !!step;
234
+ React.useEffect(() => {
235
+ if (!open || !hasStep) return;
236
+ let el = findTarget(target);
237
+ const tall = (el?.getBoundingClientRect().height ?? 0) > window.innerHeight;
238
+ devWarn(el && el.getBoundingClientRect().height > window.innerHeight * .7, "Tour", `第 ${i + 1} 步的目標「${target}」比視窗的 70% 高,說明卡只能蓋住它的一部分。請把 data-tour 放在較小的元素上,例如要說明的那張卡片或那一列,而不是整頁。`);
239
+ if (el instanceof HTMLElement && narrowNow()) {
240
+ const keep = el.style.scrollMarginTop;
241
+ el.style.scrollMarginTop = bounds(el).top + edge() + pad + "px";
242
+ el.scrollIntoView?.({
243
+ block: "start",
244
+ behavior: "auto"
245
+ });
246
+ el.style.scrollMarginTop = keep;
247
+ } else el?.scrollIntoView?.({
248
+ block: tall ? "start" : "center",
249
+ behavior: "auto"
250
+ });
251
+ let raf = 0;
252
+ let last = "";
253
+ const tick = () => {
254
+ if (!el?.isConnected) el = findTarget(target);
255
+ const r = el?.getBoundingClientRect();
256
+ let v = null;
257
+ if (r && r.width) {
258
+ const l = Math.max(3, r.left - pad);
259
+ const t = Math.max(3, r.top - pad);
260
+ v = {
261
+ left: l,
262
+ top: t,
263
+ width: Math.max(0, Math.min(window.innerWidth - 3, r.right + pad) - l),
264
+ height: Math.max(0, Math.min(window.innerHeight - 3, r.bottom + pad) - t)
265
+ };
266
+ }
267
+ const ks = [];
268
+ for (const kt of keepRef.current) {
269
+ const kr = findTarget(kt)?.getBoundingClientRect();
270
+ if (kr && kr.width) ks.push({
271
+ left: kr.left,
272
+ top: kr.top,
273
+ width: kr.width,
274
+ height: kr.height
275
+ });
276
+ }
277
+ const k = JSON.stringify([v, ks]);
278
+ if (k !== last) {
279
+ last = k;
280
+ setRect(v);
281
+ setKept(ks);
282
+ }
283
+ raf = requestAnimationFrame(tick);
284
+ };
285
+ tick();
286
+ return () => cancelAnimationFrame(raf);
287
+ }, [
288
+ open,
289
+ hasStep,
290
+ i,
291
+ target,
292
+ pad,
293
+ keepKey
294
+ ]);
295
+ const observer = React.useRef(null);
296
+ const card = React.useCallback((el) => {
297
+ cardEl.current = el;
298
+ observer.current?.disconnect();
299
+ observer.current = null;
300
+ if (!el) return;
301
+ const measure = () => {
302
+ setCardH(el.offsetHeight);
303
+ setCardW(el.offsetWidth);
304
+ };
305
+ measure();
306
+ observer.current = new ResizeObserver(measure);
307
+ observer.current.observe(el);
308
+ }, []);
309
+ const measured = cardH > 0;
310
+ React.useEffect(() => {
311
+ if (!open || !hasStep || !measured) return;
312
+ const el = findTarget(target);
313
+ if (!(el instanceof HTMLElement)) return;
314
+ const ar = bounds(el);
315
+ const m = edge();
316
+ const r = el.getBoundingClientRect();
317
+ const top = r.top - pad;
318
+ const bottom = r.bottom + pad;
319
+ if (placeCard({
320
+ left: r.left - pad,
321
+ top,
322
+ width: r.width + 2 * pad,
323
+ height: bottom - top
324
+ }, cardH, step?.side ?? "bottom", ar, cardW, kept).fits) return;
325
+ const want = bottom - top + GAP + cardH + 2 * m <= ar.bottom - ar.top ? ar.top + m + pad : ar.top + m + cardH + GAP + pad;
326
+ let box = el.parentElement;
327
+ while (box && !(/(auto|scroll)/.test(getComputedStyle(box).overflowY) && box.scrollHeight > box.clientHeight)) box = box.parentElement;
328
+ const dy = r.top - want;
329
+ if (box) box.scrollBy({
330
+ top: dy,
331
+ behavior: "auto"
332
+ });
333
+ else window.scrollBy({
334
+ top: dy,
335
+ behavior: "auto"
336
+ });
337
+ }, [
338
+ open,
339
+ hasStep,
340
+ i,
341
+ target,
342
+ pad,
343
+ measured,
344
+ cardH
345
+ ]);
346
+ const room = open && step ? bounds(findTarget(step.target)) : void 0;
347
+ const place = placeCard(rect, cardH, step?.side ?? "bottom", room, cardW, kept);
348
+ const ax = place.box.left;
349
+ const ay = place.box.top;
350
+ const anchor = React.useMemo(() => ({ getBoundingClientRect: () => new DOMRect(ax, ay, 0, 0) }), [ax, ay]);
351
+ if (!open || !step) return null;
352
+ const lastStep = i === steps.length - 1;
353
+ return /* @__PURE__ */ jsx(Popover.Root, {
354
+ open: true,
355
+ modal: true,
356
+ onOpenChange: (_, details) => {
357
+ if (details.reason === "escape-key" && skippable) end("skip");
358
+ },
359
+ children: /* @__PURE__ */ jsxs(Popover.Portal, { children: [/* @__PURE__ */ jsxs("div", {
360
+ className: "ui-tour-layer",
361
+ children: [/* @__PURE__ */ jsx("div", { className: cx("ui-tour-block", !rect && "is-dim") }), rect ? /* @__PURE__ */ jsx("div", {
362
+ className: "ui-tour-spot",
363
+ "aria-hidden": "true",
364
+ style: rect
365
+ }) : null]
366
+ }), /* @__PURE__ */ jsx(Popover.Positioner, {
367
+ className: "ui-float ui-tour-float",
368
+ anchor,
369
+ side: "bottom",
370
+ align: "start",
371
+ sideOffset: 0,
372
+ collisionAvoidance: {
373
+ side: "none",
374
+ align: "none",
375
+ fallbackAxisSide: "none"
376
+ },
377
+ children: /* @__PURE__ */ jsxs(Popover.Popup, {
378
+ ref: card,
379
+ className: "ui-tour-card",
380
+ "data-placement": place.mode,
381
+ initialFocus: next,
382
+ onKeyDown: onTab,
383
+ children: [/* @__PURE__ */ jsxs("div", {
384
+ className: "ui-tour-body",
385
+ children: [
386
+ /* @__PURE__ */ jsxs("div", {
387
+ className: "ui-tour-count",
388
+ children: [/* @__PURE__ */ jsx("span", {
389
+ "aria-hidden": "true",
390
+ children: seenOnly(tr("{n} / {total}", {
391
+ n: "",
392
+ total: ""
393
+ }), [String(i + 1), String(steps.length)])
394
+ }), /* @__PURE__ */ jsx("span", {
395
+ className: "ui-visually-hidden",
396
+ children: tr("第 {a} 步,共 {b} 步", {
397
+ a: i + 1,
398
+ b: steps.length
399
+ })
400
+ })]
401
+ }),
402
+ /* @__PURE__ */ jsx(Popover.Title, {
403
+ className: "ui-tour-title",
404
+ children: step.title
405
+ }),
406
+ /* @__PURE__ */ jsx(CodeText, {
407
+ as: "div",
408
+ className: "ui-tour-text",
409
+ text: step.text
410
+ })
411
+ ]
412
+ }), /* @__PURE__ */ jsxs("div", {
413
+ className: "ui-tour-actions",
414
+ children: [
415
+ skippable && !lastStep ? /* @__PURE__ */ jsx("button", {
416
+ type: "button",
417
+ className: "ui-link-btn is-muted",
418
+ onClick: () => end("skip"),
419
+ children: tr("略過")
420
+ }) : null,
421
+ /* @__PURE__ */ jsx("span", { className: "ui-tour-gap" }),
422
+ i > 0 ? /* @__PURE__ */ jsx(Button, {
423
+ onClick: () => go(i - 1),
424
+ children: tr("上一步")
425
+ }) : null,
426
+ /* @__PURE__ */ jsx(Button, {
427
+ ref: next,
428
+ variant: "primary",
429
+ onClick: () => lastStep ? end("done") : go(i + 1),
430
+ children: lastStep ? tr("完成") : tr("下一步")
431
+ })
432
+ ]
433
+ })]
434
+ }, i)
435
+ })] })
436
+ });
437
+ }
438
+ export { Tour, useTour };
439
+
440
+ //# sourceMappingURL=Tour.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tour.js","names":[],"sources":["../../../src/components/Tour/Tour.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useReturnFocus } from '../../internal/focus';\nimport { Popover } from '@base-ui/react/popover';\nimport { CodeText } from '../InlineCode/InlineCode';\nimport { Button } from '../Button/Button';\nimport { tr } from '../../i18n';\nimport { announce } from '../../announce';\nimport { cx, seenOnly, store } from '../../internal/util';\nimport { devWarn } from '../../internal/dev';\nimport type { IconButtonHint } from '../IconButton/IconButton';\n\nexport interface TourStep {\n /** A data-tour name ('search' matches [data-tour=\"search\"]), a CSS selector (first visible match), a ref or an element.\n * Leave it out for a step in the middle of the screen. */\n target?: string | React.RefObject<Element | null> | Element;\n /** Names the part: 「搜尋」. */\n title: string;\n /** What it does, 1 short sentence; `backticks` are code. */\n text: string;\n /** Default 'bottom'. The card goes below, above, right or left of the target, the first side where it fits in the\n * window and covers neither the target nor `keepVisible` ('top' tries above first). With no such side the page\n * scrolls to make room; failing that, the side that covers the least of the target. */\n side?: 'bottom' | 'top';\n /** Space around the highlighted part in px. Default 6. */\n padding?: number;\n /** Parts the card must not cover either, e.g. the table the step talks about under a highlighted summary: same forms\n * as target. The card then goes to the next side that leaves them visible. */\n keepVisible?: TourStep['target'] | TourStep['target'][];\n}\n\nexport interface TourProps {\n open: boolean;\n steps: TourStep[];\n onClose?: (reason: 'done' | 'skip') => void;\n /** 「略過」 and Esc end the tour early. Default true. */\n skippable?: boolean;\n /** Controlled step index. */\n step?: number;\n onStepChange?: (index: number) => void;\n}\n\nconst TOUR_KEY = 'ui-tour:';\n\n/** Opens the tour once per browser: { open, start, close, seen, hint }. Pass close to Tour's onClose; start() shows\n * it again. hint(text) gives IconButton's `hint` for the button that starts the tour: a page that uses it shows the dot\n * and the bubble instead of opening the tour by itself. 「開始」 starts the tour; × and finishing it hide the hint for\n * good (the same record as seen). */\nexport function useTour(key: string) {\n const [seen, setSeen] = React.useState(() => !!store(TOUR_KEY + key));\n const [open, setOpen] = React.useState(false);\n // hint() is called while the page renders; the tour opens by itself after that render only when it was not.\n const hinted = React.useRef(false);\n React.useLayoutEffect(() => {\n // Known only after the page rendered: whether it uses hint().\n if (!store(TOUR_KEY + key) && !hinted.current) setOpen(true);\n }, [key]);\n const remember = () => {\n store(TOUR_KEY + key, '1');\n setSeen(true);\n };\n return {\n open,\n start: () => setOpen(true),\n close: () => {\n remember();\n setOpen(false);\n },\n seen,\n /** IconButton's `hint` for the button that starts this tour, or undefined once seen or while the tour is open. */\n hint: (text: string, action?: string): IconButtonHint | undefined => {\n hinted.current = true;\n if (seen || open) return undefined;\n return { text, action, onAction: () => setOpen(true), onDismiss: remember };\n },\n };\n}\n\nfunction findTarget(t: TourStep['target']): Element | null {\n if (!t) return null;\n if (typeof t === 'string') {\n const sel = /^[\\w-]+$/.test(t) && !/^(html|body|main|nav|header|footer|section|aside)$/.test(t) ? `[data-tour=\"${t}\"]` : t;\n return Array.from(document.querySelectorAll(sel)).find((e) => e.getClientRects().length > 0) ?? null;\n }\n return t instanceof Element ? t : t.current;\n}\n\ninterface Box {\n left: number;\n top: number;\n width: number;\n height: number;\n}\n\nconst GAP = 12;\n\n/** The space kept between the card and the window edges: the --space-3 token. */\nfunction edge() {\n return parseFloat(getComputedStyle(document.documentElement).getPropertyValue('--space-3')) || 12;\n}\n\nconst narrowNow = () => typeof window !== 'undefined' && window.innerWidth < 600;\n\n/** The part of the window between a phone's fixed top bar and bottom tab bar (when the target is not one of them):\n * the card stays inside it and never covers either bar. The whole window elsewhere. */\nfunction bounds(target: Element | null): { top: number; bottom: number } {\n const vh = typeof window === 'undefined' ? 0 : window.innerHeight;\n if (!narrowNow()) return { top: 0, bottom: vh };\n let top = 0;\n let bottom = vh;\n const head = document.querySelector('.ui-shell-top');\n const bar = document.querySelector('.ui-tabbar');\n if (head && !(target && head.contains(target))) {\n const r = head.getBoundingClientRect();\n if (r.height && r.bottom > 0 && r.bottom < vh / 2) top = r.bottom;\n }\n if (bar && !(target && bar.contains(target))) {\n const r = bar.getBoundingClientRect();\n if (r.height && r.top > vh / 2 && r.top < vh) bottom = r.top;\n }\n return { top, bottom };\n}\n\ntype Side = 'bottom' | 'top' | 'right' | 'left';\nconst area = (a: Box, b: Box) =>\n Math.max(0, Math.min(a.left + a.width, b.left + b.width) - Math.max(a.left, b.left)) *\n Math.max(0, Math.min(a.top + a.height, b.top + b.height) - Math.max(a.top, b.top));\n\n/** Where the card goes for a highlighted box. Below, above, right, left (above first with side 'top'): the first\n * where the card fits inside the window and covers neither the target nor the parts the step keeps visible. When\n * none does (after the tour scrolled to make room, see makeRoom), the one that covers the least of the target, then\n * of those parts. Returns the card's box: it is placed at that box's top-left corner. */\nfunction placeCard(rect: Box | null, cardH: number, prefer: 'bottom' | 'top', area_?: { top: number; bottom: number }, cardW = 320, keep: Box[] = []) {\n const margin = typeof document === 'undefined' ? 12 : edge();\n const vw = typeof window === 'undefined' ? 0 : window.innerWidth;\n const vh = area_?.bottom ?? (typeof window === 'undefined' ? 0 : window.innerHeight);\n const vt = area_?.top ?? 0;\n if (!rect) {\n // No target: centered in the window.\n const box = { left: (vw - cardW) / 2, top: Math.max(vt + margin, (vt + vh) / 2 - cardH / 2), width: cardW, height: cardH };\n return { mode: 'center', box, fits: true };\n }\n const clampX = (x: number) => Math.max(margin, Math.min(vw - margin - cardW, x));\n const clampY = (y: number) => Math.max(vt + margin, Math.min(vh - margin - cardH, y));\n const midX = rect.left + rect.width / 2 - cardW / 2;\n const midY = rect.top + rect.height / 2 - cardH / 2;\n const at: Record<Side, { left: number; top: number }> = {\n bottom: { left: midX, top: rect.top + rect.height + GAP },\n top: { left: midX, top: rect.top - GAP - cardH },\n right: { left: rect.left + rect.width + GAP, top: midY },\n left: { left: rect.left - GAP - cardW, top: midY },\n };\n const order: Side[] = prefer === 'top' ? ['top', 'bottom', 'right', 'left'] : ['bottom', 'top', 'right', 'left'];\n const options = order.map((side) => {\n const want = at[side];\n // Along the target's edge the card may shift to stay inside the window; away from it, it must not.\n const box = { left: clampX(want.left), top: clampY(want.top), width: cardW, height: cardH };\n const inside = side === 'bottom' || side === 'top' ? box.top === want.top : box.left === want.left;\n const onTarget = area(box, rect);\n const onKept = keep.reduce((n, k) => n + area(box, k), 0);\n return { mode: side, box, fits: inside && !onTarget && !onKept, onTarget, onKept };\n });\n const best = options.find((o) => o.fits) ?? [...options].sort((x, y) => x.onTarget - y.onTarget || x.onKept - y.onKept)[0];\n return { mode: best.mode, box: best.box, fits: best.fits };\n}\n\n/** The first-use walkthrough: the page goes dark except the part being introduced, with a card beside it. */\nexport function Tour({ open, steps, onClose, skippable = true, step: controlled, onStepChange }: TourProps) {\n const [inner, setInner] = React.useState(0);\n const i = Math.max(0, Math.min(steps.length - 1, controlled ?? inner));\n const step = steps[i];\n const [rect, setRect] = React.useState<Box | null>(null);\n const [kept, setKept] = React.useState<Box[]>([]);\n const next = React.useRef<HTMLButtonElement>(null);\n const [cardH, setCardH] = React.useState(0);\n const [cardW, setCardW] = React.useState(320);\n const [wasOpen, setWasOpen] = React.useState(open);\n if (open !== wasOpen) {\n setWasOpen(open);\n if (open && controlled == null) setInner(0);\n }\n const go = (n: number) => {\n onStepChange?.(n);\n if (controlled == null) setInner(n);\n };\n const end = (why: 'done' | 'skip') => onClose?.(why);\n useReturnFocus(open);\n // A new step after 下一步 or 上一步: its count, title and text are read (focus stays on the button, which does not read\n // them). The first step is read as the dialog opens.\n const shownStep = React.useRef(-1);\n React.useEffect(() => {\n if (!open || !step) {\n shownStep.current = -1;\n return;\n }\n if (shownStep.current !== -1 && shownStep.current !== i)\n announce(tr('第 {a} 步,共 {b} 步', { a: i + 1, b: steps.length }) + tr('。') + step.title + tr('。') + step.text.replace(/`/g, ''));\n shownStep.current = i;\n }, [open, i, step, steps.length]);\n const cardEl = React.useRef<HTMLDivElement | null>(null);\n // Tab and Shift+Tab go round the card's buttons only. Base UI's popover leaves focus guards around the card (no\n // name) that let Tab reach the page; focus that gets out anyway (a click on the dimmed page) comes back to 下一步.\n const tabbables = () =>\n Array.from(\n cardEl.current?.querySelectorAll<HTMLElement>('button:not(:disabled), a[href], input:not(:disabled), [tabindex]:not([tabindex=\"-1\"])') ?? [],\n ).filter((e) => e.getClientRects().length > 0);\n const onTab = (e: React.KeyboardEvent) => {\n if (e.key !== 'Tab' || e.altKey || e.ctrlKey || e.metaKey) return;\n const list = tabbables();\n if (!list.length) return;\n e.preventDefault();\n const at = list.indexOf(document.activeElement as HTMLElement);\n const to = at < 0 ? 0 : (at + (e.shiftKey ? -1 : 1) + list.length) % list.length;\n list[to].focus();\n };\n React.useEffect(() => {\n if (!open) return;\n const back = (e: FocusEvent) => {\n const box = cardEl.current;\n if (!box || !(e.target instanceof Node) || box.contains(e.target)) return;\n (next.current ?? tabbables()[0])?.focus();\n };\n document.addEventListener('focusin', back);\n return () => document.removeEventListener('focusin', back);\n }, [open]);\n\n // Follow the target while it moves (scrolling, layout changes).\n // Depends on the step's fields, not the object: inline steps arrays are new on every render.\n const target = step?.target;\n const pad = step?.padding ?? 6;\n // keepVisible as one stable value for the effect below (an inline array is new on every render).\n const keepList = step?.keepVisible == null ? [] : Array.isArray(step.keepVisible) ? step.keepVisible : [step.keepVisible];\n const keepKey = keepList.map((k) => (typeof k === 'string' ? k : '#')).join('|');\n const keepRef = React.useRef(keepList);\n React.useLayoutEffect(() => {\n keepRef.current = keepList;\n });\n const hasStep = !!step;\n React.useEffect(() => {\n if (!open || !hasStep) return;\n // A selector is looked up again until it appears (the target may render later), then kept.\n let el = findTarget(target);\n // Bring the target into view first; one taller than the window shows from its top. On a phone the target goes\n // to the top, just under the top bar, so the card fits below it instead of covering it. The jump is instant: the\n // modal's scroll lock stops a smooth scroll halfway; the spotlight's own transition shows the move.\n const tall = (el?.getBoundingClientRect().height ?? 0) > window.innerHeight;\n // A target as tall as the window leaves no room beside it: the card has to cover part of it.\n devWarn(\n el && el.getBoundingClientRect().height > window.innerHeight * 0.7,\n 'Tour',\n `第 ${i + 1} 步的目標「${target}」比視窗的 70% 高,說明卡只能蓋住它的一部分。請把 data-tour 放在較小的元素上,例如要說明的那張卡片或那一列,而不是整頁。`,\n );\n if (el instanceof HTMLElement && narrowNow()) {\n const keep = el.style.scrollMarginTop;\n el.style.scrollMarginTop = bounds(el).top + edge() + pad + 'px';\n el.scrollIntoView?.({ block: 'start', behavior: 'auto' });\n el.style.scrollMarginTop = keep;\n } else el?.scrollIntoView?.({ block: tall ? 'start' : 'center', behavior: 'auto' });\n let raf = 0;\n let last = '';\n const tick = () => {\n if (!el?.isConnected) el = findTarget(target);\n const r = el?.getBoundingClientRect();\n let v: Box | null = null;\n if (r && r.width) {\n const l = Math.max(3, r.left - pad);\n const t = Math.max(3, r.top - pad);\n v = {\n left: l,\n top: t,\n width: Math.max(0, Math.min(window.innerWidth - 3, r.right + pad) - l),\n height: Math.max(0, Math.min(window.innerHeight - 3, r.bottom + pad) - t),\n };\n }\n const ks: Box[] = [];\n for (const kt of keepRef.current) {\n const kr = findTarget(kt)?.getBoundingClientRect();\n if (kr && kr.width) ks.push({ left: kr.left, top: kr.top, width: kr.width, height: kr.height });\n }\n const k = JSON.stringify([v, ks]);\n if (k !== last) {\n last = k;\n setRect(v);\n setKept(ks);\n }\n raf = requestAnimationFrame(tick);\n };\n tick();\n return () => cancelAnimationFrame(raf);\n }, [open, hasStep, i, target, pad, keepKey]);\n\n // The card's height decides where it fits. The popup mounts after the first render (in a portal), so it is measured\n // through a callback ref when it appears, and again on every resize.\n const observer = React.useRef<ResizeObserver | null>(null);\n const card = React.useCallback((el: HTMLDivElement | null) => {\n cardEl.current = el;\n observer.current?.disconnect();\n observer.current = null;\n if (!el) return;\n const measure = () => {\n setCardH(el.offsetHeight);\n setCardW(el.offsetWidth);\n };\n measure();\n observer.current = new ResizeObserver(measure);\n observer.current.observe(el);\n }, []);\n\n // Make room for the card (per step, again when its height changes: its width, and so its height, depends on where it\n // goes): with no room above or below the target, the page\n // scrolls so the target's top sits just under the window's top when the target and the card fit together, card\n // below; when they do not (a target taller than the window), so the card fits above the target. The card then\n // covers no part of the target.\n const measured = cardH > 0;\n React.useEffect(() => {\n if (!open || !hasStep || !measured) return;\n const el = findTarget(target);\n if (!(el instanceof HTMLElement)) return;\n const ar = bounds(el);\n const m = edge();\n const r = el.getBoundingClientRect();\n const top = r.top - pad;\n const bottom = r.bottom + pad;\n // A side already fits: nothing to do.\n const spot = { left: r.left - pad, top, width: r.width + 2 * pad, height: bottom - top };\n if (placeCard(spot, cardH, step?.side ?? 'bottom', ar, cardW, kept).fits) return;\n const together = bottom - top + GAP + cardH + 2 * m <= ar.bottom - ar.top;\n const want = together ? ar.top + m + pad : ar.top + m + cardH + GAP + pad;\n // The nearest box that scrolls (AppShell's main), else the window, moves by exactly the difference.\n let box: HTMLElement | null = el.parentElement;\n while (box && !(/(auto|scroll)/.test(getComputedStyle(box).overflowY) && box.scrollHeight > box.clientHeight)) box = box.parentElement;\n const dy = r.top - want;\n if (box) box.scrollBy({ top: dy, behavior: 'auto' });\n else window.scrollBy({ top: dy, behavior: 'auto' });\n // eslint-disable-next-line react-hooks/exhaustive-deps -- kept moves with every scroll; the room is made once per step\n }, [open, hasStep, i, target, pad, measured, cardH]);\n\n const room = open && step ? bounds(findTarget(step.target)) : undefined;\n const place = placeCard(rect, cardH, step?.side ?? 'bottom', room, cardW, kept);\n // The card's top-left corner: a point the popup hangs from (side bottom, aligned at its start).\n const ax = place.box.left;\n const ay = place.box.top;\n const anchor = React.useMemo(() => ({ getBoundingClientRect: () => new DOMRect(ax, ay, 0, 0) }), [ax, ay]);\n if (!open || !step) return null;\n const lastStep = i === steps.length - 1;\n return (\n <Popover.Root\n open\n modal\n onOpenChange={(_, details) => {\n if (details.reason === 'escape-key' && skippable) end('skip');\n }}\n >\n <Popover.Portal>\n <div className=\"ui-tour-layer\">\n <div className={cx('ui-tour-block', !rect && 'is-dim')} />\n {rect ? <div className=\"ui-tour-spot\" aria-hidden=\"true\" style={rect} /> : null}\n </div>\n <Popover.Positioner\n className=\"ui-float ui-tour-float\"\n anchor={anchor}\n side=\"bottom\"\n align=\"start\"\n sideOffset={0}\n // Where the card goes is worked out above (placeCard), already inside the window.\n collisionAvoidance={{ side: 'none', align: 'none', fallbackAxisSide: 'none' }}\n >\n <Popover.Popup ref={card} key={i} className=\"ui-tour-card\" data-placement={place.mode} initialFocus={next} onKeyDown={onTab}>\n {/* Taller than the window (phones): this part scrolls, the buttons stay at the bottom. */}\n <div className=\"ui-tour-body\">\n <div className=\"ui-tour-count\">\n {/* Shown 「1 / 5」, drawn by CSS; read and copied as 「第 1 步,共 5 步」, not 「1 斜線 5」. */}\n <span aria-hidden=\"true\">{seenOnly(tr('{n} / {total}', { n: '\\u0001', total: '\\u0002' }), [String(i + 1), String(steps.length)])}</span>\n <span className=\"ui-visually-hidden\">{tr('第 {a} 步,共 {b} 步', { a: i + 1, b: steps.length })}</span>\n </div>\n <Popover.Title className=\"ui-tour-title\">{step.title}</Popover.Title>\n <CodeText as=\"div\" className=\"ui-tour-text\" text={step.text} />\n </div>\n <div className=\"ui-tour-actions\">\n {skippable && !lastStep ? (\n <button type=\"button\" className=\"ui-link-btn is-muted\" onClick={() => end('skip')}>\n {tr('略過')}\n </button>\n ) : null}\n <span className=\"ui-tour-gap\" />\n {i > 0 ? <Button onClick={() => go(i - 1)}>{tr('上一步')}</Button> : null}\n <Button ref={next} variant=\"primary\" onClick={() => (lastStep ? end('done') : go(i + 1))}>\n {lastStep ? tr('完成') : tr('下一步')}\n </Button>\n </div>\n </Popover.Popup>\n </Popover.Positioner>\n </Popover.Portal>\n </Popover.Root>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAyCA,MAAM,WAAW;;;;;AAMjB,SAAgB,QAAQ,KAAa;CACnC,MAAM,CAAC,MAAM,WAAW,MAAM,eAAe,CAAC,CAAC,MAAM,WAAW,GAAG,CAAC;CACpE,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,KAAK;CAE5C,MAAM,SAAS,MAAM,OAAO,KAAK;CACjC,MAAM,sBAAsB;EAE1B,IAAI,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,SAAS,QAAQ,IAAI;CAC7D,GAAG,CAAC,GAAG,CAAC;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