@seanyeh77/ui 0.43.1 → 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 (885) 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 +6 -3
  12. package/dist/components/Alert/Alert.js +18 -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 +3 -2
  46. package/dist/components/DangerZone/DangerZone.js +3 -2
  47. package/dist/components/DangerZone/DangerZone.js.map +1 -1
  48. package/dist/components/DataTable/DataTable.d.ts +16 -4
  49. package/dist/components/DataTable/DataTable.js +346 -208
  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 +9 -7
  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 +46 -14
  68. package/dist/components/Dialog/Dialog.js.map +1 -1
  69. package/dist/components/Drawer/Drawer.d.ts +18 -5
  70. package/dist/components/Drawer/Drawer.js +87 -24
  71. package/dist/components/Drawer/Drawer.js.map +1 -1
  72. package/dist/components/EmptyState/EmptyState.d.ts +2 -2
  73. package/dist/components/EmptyState/EmptyState.js +3 -2
  74. package/dist/components/EmptyState/EmptyState.js.map +1 -1
  75. package/dist/components/ErrorPage/ErrorPage.d.ts +4 -0
  76. package/dist/components/ErrorPage/ErrorPage.js +2 -1
  77. package/dist/components/ErrorPage/ErrorPage.js.map +1 -1
  78. package/dist/components/EventTimeline/EventTimeline.d.ts +23 -5
  79. package/dist/components/EventTimeline/EventTimeline.js +64 -20
  80. package/dist/components/EventTimeline/EventTimeline.js.map +1 -1
  81. package/dist/components/FileUpload/FileUpload.d.ts +10 -2
  82. package/dist/components/FileUpload/FileUpload.js +5 -2
  83. package/dist/components/FileUpload/FileUpload.js.map +1 -1
  84. package/dist/components/FormGrid/FormGrid.d.ts +3 -1
  85. package/dist/components/FormGrid/FormGrid.js +5 -2
  86. package/dist/components/FormGrid/FormGrid.js.map +1 -1
  87. package/dist/components/Graph/Graph.d.ts +1 -0
  88. package/dist/components/Graph/Graph.js +8 -4
  89. package/dist/components/Graph/Graph.js.map +1 -1
  90. package/dist/components/Grid/Grid.d.ts +11 -4
  91. package/dist/components/Grid/Grid.js +14 -2
  92. package/dist/components/Grid/Grid.js.map +1 -1
  93. package/dist/components/IconButton/IconButton.d.ts +2 -1
  94. package/dist/components/IconButton/IconButton.js +10 -1
  95. package/dist/components/IconButton/IconButton.js.map +1 -1
  96. package/dist/components/InlineCode/InlineCode.d.ts +6 -0
  97. package/dist/components/InlineCode/InlineCode.js +10 -6
  98. package/dist/components/InlineCode/InlineCode.js.map +1 -1
  99. package/dist/components/KpiCard/KpiCard.d.ts +7 -3
  100. package/dist/components/KpiCard/KpiCard.js +40 -25
  101. package/dist/components/KpiCard/KpiCard.js.map +1 -1
  102. package/dist/components/LayerGraph/LayerGraph.d.ts +68 -23
  103. package/dist/components/LayerGraph/LayerGraph.js +178 -97
  104. package/dist/components/LayerGraph/LayerGraph.js.map +1 -1
  105. package/dist/components/LineChart/LineChart.d.ts +10 -3
  106. package/dist/components/LineChart/LineChart.js +55 -23
  107. package/dist/components/LineChart/LineChart.js.map +1 -1
  108. package/dist/components/Link/Link.d.ts +17 -0
  109. package/dist/components/Link/Link.js +47 -0
  110. package/dist/components/Link/Link.js.map +1 -0
  111. package/dist/components/LoadingBar/LoadingBar.d.ts +1 -0
  112. package/dist/components/LoadingBar/LoadingBar.js.map +1 -1
  113. package/dist/components/LoginCard/LoginCard.d.ts +9 -3
  114. package/dist/components/LoginCard/LoginCard.js +99 -78
  115. package/dist/components/LoginCard/LoginCard.js.map +1 -1
  116. package/dist/components/Markdown/Markdown.d.ts +1 -0
  117. package/dist/components/Markdown/Markdown.js +20 -2
  118. package/dist/components/Markdown/Markdown.js.map +1 -1
  119. package/dist/components/Menu/Menu.d.ts +4 -2
  120. package/dist/components/Menu/Menu.js +43 -33
  121. package/dist/components/Menu/Menu.js.map +1 -1
  122. package/dist/components/Meter/Meter.d.ts +4 -0
  123. package/dist/components/Meter/Meter.js.map +1 -1
  124. package/dist/components/MobileTabBar/MobileTabBar.d.ts +3 -0
  125. package/dist/components/MobileTabBar/MobileTabBar.js.map +1 -1
  126. package/dist/components/MultiSelect/MultiSelect.d.ts +7 -6
  127. package/dist/components/MultiSelect/MultiSelect.js +27 -9
  128. package/dist/components/MultiSelect/MultiSelect.js.map +1 -1
  129. package/dist/components/NotificationBell/NotificationBell.d.ts +4 -0
  130. package/dist/components/NotificationBell/NotificationBell.js +4 -3
  131. package/dist/components/NotificationBell/NotificationBell.js.map +1 -1
  132. package/dist/components/PageHeader/PageHeader.d.ts +34 -0
  133. package/dist/components/PageHeader/PageHeader.js +68 -0
  134. package/dist/components/PageHeader/PageHeader.js.map +1 -0
  135. package/dist/components/Popover/Popover.d.ts +11 -4
  136. package/dist/components/Popover/Popover.js +17 -7
  137. package/dist/components/Popover/Popover.js.map +1 -1
  138. package/dist/components/ProgressBar/ProgressBar.d.ts +2 -0
  139. package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
  140. package/dist/components/ProgressRing/ProgressRing.d.ts +1 -0
  141. package/dist/components/ProgressRing/ProgressRing.js.map +1 -1
  142. package/dist/components/ProjectSwitcher/ProjectSwitcher.d.ts +5 -1
  143. package/dist/components/ProjectSwitcher/ProjectSwitcher.js +16 -3
  144. package/dist/components/ProjectSwitcher/ProjectSwitcher.js.map +1 -1
  145. package/dist/components/RadioGroup/RadioGroup.d.ts +22 -5
  146. package/dist/components/RadioGroup/RadioGroup.js +48 -47
  147. package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
  148. package/dist/components/RelativeTime/RelativeTime.d.ts +10 -0
  149. package/dist/components/RelativeTime/RelativeTime.js +44 -0
  150. package/dist/components/RelativeTime/RelativeTime.js.map +1 -0
  151. package/dist/components/SearchField/SearchField.d.ts +2 -0
  152. package/dist/components/SearchField/SearchField.js.map +1 -1
  153. package/dist/components/Section/Section.d.ts +4 -0
  154. package/dist/components/Section/Section.js +8 -22
  155. package/dist/components/Section/Section.js.map +1 -1
  156. package/dist/components/SegmentedControl/SegmentedControl.d.ts +22 -9
  157. package/dist/components/SegmentedControl/SegmentedControl.js +20 -19
  158. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
  159. package/dist/components/Select/Select.d.ts +7 -11
  160. package/dist/components/Select/Select.js +7 -3
  161. package/dist/components/Select/Select.js.map +1 -1
  162. package/dist/components/SettingsLayout/SettingsLayout.d.ts +33 -4
  163. package/dist/components/SettingsLayout/SettingsLayout.js +62 -14
  164. package/dist/components/SettingsLayout/SettingsLayout.js.map +1 -1
  165. package/dist/components/SideNav/SideNav.d.ts +2 -0
  166. package/dist/components/SideNav/SideNav.js +3 -3
  167. package/dist/components/SideNav/SideNav.js.map +1 -1
  168. package/dist/components/SplitPane/SplitPane.d.ts +1 -0
  169. package/dist/components/SplitPane/SplitPane.js.map +1 -1
  170. package/dist/components/StatusBand/StatusBand.d.ts +1 -0
  171. package/dist/components/StatusBand/StatusBand.js.map +1 -1
  172. package/dist/components/Suggestion/Suggestion.d.ts +6 -0
  173. package/dist/components/Suggestion/Suggestion.js.map +1 -1
  174. package/dist/components/Switch/Switch.d.ts +13 -3
  175. package/dist/components/Switch/Switch.js +16 -7
  176. package/dist/components/Switch/Switch.js.map +1 -1
  177. package/dist/components/Tabs/Tabs.d.ts +8 -1
  178. package/dist/components/Tabs/Tabs.js +6 -3
  179. package/dist/components/Tabs/Tabs.js.map +1 -1
  180. package/dist/components/Tag/Tag.d.ts +15 -7
  181. package/dist/components/Tag/Tag.js +22 -10
  182. package/dist/components/Tag/Tag.js.map +1 -1
  183. package/dist/components/Term/Term.d.ts +8 -3
  184. package/dist/components/Term/Term.js +1 -1
  185. package/dist/components/Term/Term.js.map +1 -1
  186. package/dist/components/TextArea/TextArea.d.ts +6 -9
  187. package/dist/components/TextArea/TextArea.js +25 -12
  188. package/dist/components/TextArea/TextArea.js.map +1 -1
  189. package/dist/components/TextField/TextField.d.ts +8 -11
  190. package/dist/components/TextField/TextField.js +9 -7
  191. package/dist/components/TextField/TextField.js.map +1 -1
  192. package/dist/components/ThemePicker/ThemePicker.d.ts +1 -0
  193. package/dist/components/ThemePicker/ThemePicker.js +35 -34
  194. package/dist/components/ThemePicker/ThemePicker.js.map +1 -1
  195. package/dist/components/TimeControl/TimeControl.d.ts +1 -0
  196. package/dist/components/TimeControl/TimeControl.js.map +1 -1
  197. package/dist/components/Toast/Toast.d.ts +56 -3
  198. package/dist/components/Toast/Toast.js +191 -8
  199. package/dist/components/Toast/Toast.js.map +1 -1
  200. package/dist/components/TopBar/TopBar.d.ts +6 -2
  201. package/dist/components/TopBar/TopBar.js +7 -1
  202. package/dist/components/TopBar/TopBar.js.map +1 -1
  203. package/dist/components/Tour/Tour.d.ts +14 -3
  204. package/dist/components/Tour/Tour.js +26 -14
  205. package/dist/components/Tour/Tour.js.map +1 -1
  206. package/dist/components/TreeList/TreeList.d.ts +28 -4
  207. package/dist/components/TreeList/TreeList.js +32 -20
  208. package/dist/components/TreeList/TreeList.js.map +1 -1
  209. package/dist/components/Workbench/Workbench.d.ts +1 -0
  210. package/dist/components/Workbench/Workbench.js +24 -12
  211. package/dist/components/Workbench/Workbench.js.map +1 -1
  212. package/dist/components/ZoneMap/ZoneMap.d.ts +12 -2
  213. package/dist/components/ZoneMap/ZoneMap.js +13 -5
  214. package/dist/components/ZoneMap/ZoneMap.js.map +1 -1
  215. package/dist/components/useFormErrors/useFormErrors.d.ts +20 -0
  216. package/dist/components/useFormErrors/useFormErrors.js +55 -0
  217. package/dist/components/useFormErrors/useFormErrors.js.map +1 -0
  218. package/dist/css/AccentPicker.css +1 -0
  219. package/dist/css/Alert.css +8 -19
  220. package/dist/css/AppShell.css +1 -0
  221. package/dist/css/Badge.css +19 -45
  222. package/dist/css/BarChart.css +21 -3
  223. package/dist/css/Button.css +6 -1
  224. package/dist/css/Card.css +8 -8
  225. package/dist/css/Checkbox.css +20 -0
  226. package/dist/css/CodeView.css +3 -2
  227. package/dist/css/DangerZone.css +5 -3
  228. package/dist/css/DataTable.css +303 -69
  229. package/dist/css/DatePicker.css +1 -0
  230. package/dist/css/DateRangePicker.css +24 -2
  231. package/dist/css/Drawer.css +31 -0
  232. package/dist/css/EmptyState.css +1 -0
  233. package/dist/css/ErrorPage.css +4 -1
  234. package/dist/css/EventTimeline.css +34 -5
  235. package/dist/css/FileUpload.css +1 -0
  236. package/dist/css/FormGrid.css +12 -3
  237. package/dist/css/Graph.css +9 -1
  238. package/dist/css/Grid.css +8 -0
  239. package/dist/css/KpiCard.css +13 -1
  240. package/dist/css/LayerGraph.css +40 -15
  241. package/dist/css/Link.css +23 -0
  242. package/dist/css/LoginCard.css +17 -11
  243. package/dist/css/Markdown.css +31 -2
  244. package/dist/css/Menu.css +0 -2
  245. package/dist/css/Meter.css +16 -0
  246. package/dist/css/MultiSelect.css +1 -0
  247. package/dist/css/NotificationBell.css +1 -0
  248. package/dist/css/PageHeader.css +50 -0
  249. package/dist/css/ProgressBar.css +12 -0
  250. package/dist/css/ProjectSwitcher.css +25 -23
  251. package/dist/css/RelativeTime.css +2 -0
  252. package/dist/css/SegmentedControl.css +38 -10
  253. package/dist/css/Select.css +1 -0
  254. package/dist/css/SettingsLayout.css +29 -8
  255. package/dist/css/SideNav.css +4 -1
  256. package/dist/css/Skeleton.css +22 -1
  257. package/dist/css/Suggestion.css +1 -1
  258. package/dist/css/Switch.css +27 -0
  259. package/dist/css/Tabs.css +8 -7
  260. package/dist/css/Tag.css +19 -12
  261. package/dist/css/Term.css +1 -1
  262. package/dist/css/TextArea.css +1 -0
  263. package/dist/css/TextField.css +1 -0
  264. package/dist/css/Toast.css +101 -4
  265. package/dist/css/TopBar.css +21 -2
  266. package/dist/css/Tour.css +1 -1
  267. package/dist/css/TreeList.css +7 -3
  268. package/dist/css/Workbench.css +13 -1
  269. package/dist/css/ZoneMap.css +0 -1
  270. package/dist/css/base.css +45 -0
  271. package/dist/css/end.css +119 -5
  272. package/dist/deprecated.d.ts +3 -0
  273. package/dist/deprecated.js +13 -0
  274. package/dist/deprecated.js.map +1 -0
  275. package/dist/fonts.css +2 -7543
  276. package/dist/format.d.ts +3 -1
  277. package/dist/format.js +15 -5
  278. package/dist/format.js.map +1 -1
  279. package/dist/generated/themeDefaults.d.ts +8 -0
  280. package/dist/generated/themeDefaults.js +35 -0
  281. package/dist/generated/themeDefaults.js.map +1 -0
  282. package/dist/i18n.d.ts +7 -2
  283. package/dist/i18n.js +65 -10
  284. package/dist/i18n.js.map +1 -1
  285. package/dist/icons/Icon.d.ts +3 -1
  286. package/dist/icons/Icon.js.map +1 -1
  287. package/dist/index.d.ts +23 -14
  288. package/dist/index.js +14 -8
  289. package/dist/internal/Field.d.ts +19 -0
  290. package/dist/internal/Field.js +13 -6
  291. package/dist/internal/Field.js.map +1 -1
  292. package/dist/internal/FloatingPanel.js +2 -1
  293. package/dist/internal/FloatingPanel.js.map +1 -1
  294. package/dist/internal/chart.d.ts +4 -0
  295. package/dist/internal/chart.js +89 -19
  296. package/dist/internal/chart.js.map +1 -1
  297. package/dist/internal/codeSpans.js +20 -0
  298. package/dist/internal/codeSpans.js.map +1 -0
  299. package/dist/internal/dev.js +9 -4
  300. package/dist/internal/dev.js.map +1 -1
  301. package/dist/internal/focus.js +27 -3
  302. package/dist/internal/focus.js.map +1 -1
  303. package/dist/internal/focusMain.js +6 -2
  304. package/dist/internal/focusMain.js.map +1 -1
  305. package/dist/internal/open.d.ts +14 -0
  306. package/dist/internal/open.js +28 -0
  307. package/dist/internal/open.js.map +1 -0
  308. package/dist/internal/roving.js +37 -0
  309. package/dist/internal/roving.js.map +1 -0
  310. package/dist/internal/shell.js +12 -0
  311. package/dist/internal/shell.js.map +1 -0
  312. package/dist/internal/stored.js +89 -0
  313. package/dist/internal/stored.js.map +1 -0
  314. package/dist/internal/tableTools.js +46 -4
  315. package/dist/internal/tableTools.js.map +1 -1
  316. package/dist/internal/util.js +8 -17
  317. package/dist/internal/util.js.map +1 -1
  318. package/dist/locale.d.ts +17 -0
  319. package/dist/locale.js +29 -0
  320. package/dist/locale.js.map +1 -0
  321. package/dist/styles.css +1296 -400
  322. package/dist/theme.d.ts +23 -5
  323. package/dist/theme.js +85 -25
  324. package/dist/theme.js.map +1 -1
  325. package/dist/tokens.css +3 -0
  326. package/docs/AccentPicker.md +3 -1
  327. package/docs/Alert.md +4 -3
  328. package/docs/AppShell.md +11 -10
  329. package/docs/Badge.md +26 -16
  330. package/docs/BarChart.md +7 -4
  331. package/docs/Button.md +4 -5
  332. package/docs/Calendar.md +2 -2
  333. package/docs/Card.md +9 -8
  334. package/docs/Checkbox.md +4 -1
  335. package/docs/CodeView.md +30 -43
  336. package/docs/CommandPalette.md +3 -2
  337. package/docs/ConsoleLayout.md +5 -5
  338. package/docs/DangerZone.md +3 -2
  339. package/docs/DataColors.md +2 -2
  340. package/docs/DataTable.md +29 -141
  341. package/docs/DatePicker.md +1 -0
  342. package/docs/DateRangePicker.md +3 -0
  343. package/docs/DetailList.md +9 -9
  344. package/docs/Dialog.md +8 -4
  345. package/docs/Drawer.md +7 -4
  346. package/docs/ErrorPage.md +1 -1
  347. package/docs/EventTimeline.md +23 -12
  348. package/docs/FileUpload.md +1 -1
  349. package/docs/FormGrid.md +2 -1
  350. package/docs/Format.md +5 -3
  351. package/docs/Graph.md +1 -1
  352. package/docs/Grid.md +5 -1
  353. package/docs/KpiCard.md +6 -4
  354. package/docs/LayerGraph.md +18 -53
  355. package/docs/LineChart.md +5 -3
  356. package/docs/Link.md +22 -0
  357. package/docs/LoginCard.md +7 -3
  358. package/docs/Markdown.md +3 -13
  359. package/docs/Menu.md +2 -0
  360. package/docs/Meter.md +1 -0
  361. package/docs/MultiSelect.md +2 -1
  362. package/docs/NotificationBell.md +1 -0
  363. package/docs/PageHeader.md +34 -0
  364. package/docs/Popover.md +3 -1
  365. package/docs/ProgressBar.md +3 -1
  366. package/docs/ProjectSwitcher.md +14 -14
  367. package/docs/RadioGroup.md +2 -0
  368. package/docs/RelativeTime.md +23 -0
  369. package/docs/Section.md +1 -1
  370. package/docs/SegmentedControl.md +9 -6
  371. package/docs/Select.md +2 -1
  372. package/docs/SettingsLayout.md +19 -4
  373. package/docs/SideNav.md +1 -1
  374. package/docs/Skeleton.md +2 -1
  375. package/docs/Switch.md +3 -1
  376. package/docs/Tabs.md +4 -3
  377. package/docs/Tag.md +9 -7
  378. package/docs/Term.md +3 -3
  379. package/docs/TextArea.md +2 -1
  380. package/docs/TextField.md +5 -3
  381. package/docs/ThemePicker.md +3 -1
  382. package/docs/Toast.md +17 -5
  383. package/docs/TopBar.md +8 -5
  384. package/docs/Tour.md +3 -2
  385. package/docs/TreeList.md +10 -37
  386. package/docs/Workbench.md +1 -48
  387. package/docs/ZoneMap.md +5 -5
  388. package/docs/agents.md +82 -0
  389. package/docs/code.md +2 -2
  390. package/docs/components.json +314 -0
  391. package/docs/data.md +9 -18
  392. package/docs/forms.md +6 -5
  393. package/docs/guidelines.md +39 -31
  394. package/docs/icons.md +9 -0
  395. package/docs/layout.md +16 -20
  396. package/docs/motion.md +31 -56
  397. package/docs/theme.md +15 -18
  398. package/docs/useFormErrors.md +35 -0
  399. package/package.json +8 -7
  400. package/dist/bundle.js.map +0 -1
  401. package/dist/fonts/LICENSE-OFL.txt +0 -93
  402. package/dist/fonts/geist-mono-cyrillic-400-normal.woff2 +0 -0
  403. package/dist/fonts/geist-mono-cyrillic-500-normal.woff2 +0 -0
  404. package/dist/fonts/geist-mono-cyrillic-600-normal.woff2 +0 -0
  405. package/dist/fonts/geist-mono-cyrillic-700-normal.woff2 +0 -0
  406. package/dist/fonts/geist-mono-cyrillic-ext-400-normal.woff2 +0 -0
  407. package/dist/fonts/geist-mono-cyrillic-ext-500-normal.woff2 +0 -0
  408. package/dist/fonts/geist-mono-cyrillic-ext-600-normal.woff2 +0 -0
  409. package/dist/fonts/geist-mono-cyrillic-ext-700-normal.woff2 +0 -0
  410. package/dist/fonts/geist-mono-latin-400-normal.woff2 +0 -0
  411. package/dist/fonts/geist-mono-latin-500-normal.woff2 +0 -0
  412. package/dist/fonts/geist-mono-latin-600-normal.woff2 +0 -0
  413. package/dist/fonts/geist-mono-latin-700-normal.woff2 +0 -0
  414. package/dist/fonts/geist-mono-latin-ext-400-normal.woff2 +0 -0
  415. package/dist/fonts/geist-mono-latin-ext-500-normal.woff2 +0 -0
  416. package/dist/fonts/geist-mono-latin-ext-600-normal.woff2 +0 -0
  417. package/dist/fonts/geist-mono-latin-ext-700-normal.woff2 +0 -0
  418. package/dist/fonts/geist-mono-symbols2-400-normal.woff2 +0 -0
  419. package/dist/fonts/geist-mono-symbols2-500-normal.woff2 +0 -0
  420. package/dist/fonts/geist-mono-symbols2-600-normal.woff2 +0 -0
  421. package/dist/fonts/geist-mono-symbols2-700-normal.woff2 +0 -0
  422. package/dist/fonts/geist-mono-vietnamese-400-normal.woff2 +0 -0
  423. package/dist/fonts/geist-mono-vietnamese-500-normal.woff2 +0 -0
  424. package/dist/fonts/geist-mono-vietnamese-600-normal.woff2 +0 -0
  425. package/dist/fonts/geist-mono-vietnamese-700-normal.woff2 +0 -0
  426. package/dist/fonts/inter-cyrillic-400-normal.woff2 +0 -0
  427. package/dist/fonts/inter-cyrillic-500-normal.woff2 +0 -0
  428. package/dist/fonts/inter-cyrillic-600-normal.woff2 +0 -0
  429. package/dist/fonts/inter-cyrillic-700-normal.woff2 +0 -0
  430. package/dist/fonts/inter-cyrillic-ext-400-normal.woff2 +0 -0
  431. package/dist/fonts/inter-cyrillic-ext-500-normal.woff2 +0 -0
  432. package/dist/fonts/inter-cyrillic-ext-600-normal.woff2 +0 -0
  433. package/dist/fonts/inter-cyrillic-ext-700-normal.woff2 +0 -0
  434. package/dist/fonts/inter-greek-400-normal.woff2 +0 -0
  435. package/dist/fonts/inter-greek-500-normal.woff2 +0 -0
  436. package/dist/fonts/inter-greek-600-normal.woff2 +0 -0
  437. package/dist/fonts/inter-greek-700-normal.woff2 +0 -0
  438. package/dist/fonts/inter-greek-ext-400-normal.woff2 +0 -0
  439. package/dist/fonts/inter-greek-ext-500-normal.woff2 +0 -0
  440. package/dist/fonts/inter-greek-ext-600-normal.woff2 +0 -0
  441. package/dist/fonts/inter-greek-ext-700-normal.woff2 +0 -0
  442. package/dist/fonts/inter-latin-400-normal.woff2 +0 -0
  443. package/dist/fonts/inter-latin-500-normal.woff2 +0 -0
  444. package/dist/fonts/inter-latin-600-normal.woff2 +0 -0
  445. package/dist/fonts/inter-latin-700-normal.woff2 +0 -0
  446. package/dist/fonts/inter-latin-ext-400-normal.woff2 +0 -0
  447. package/dist/fonts/inter-latin-ext-500-normal.woff2 +0 -0
  448. package/dist/fonts/inter-latin-ext-600-normal.woff2 +0 -0
  449. package/dist/fonts/inter-latin-ext-700-normal.woff2 +0 -0
  450. package/dist/fonts/inter-vietnamese-400-normal.woff2 +0 -0
  451. package/dist/fonts/inter-vietnamese-500-normal.woff2 +0 -0
  452. package/dist/fonts/inter-vietnamese-600-normal.woff2 +0 -0
  453. package/dist/fonts/inter-vietnamese-700-normal.woff2 +0 -0
  454. package/dist/fonts/noto-sans-tc-0-400-normal.woff2 +0 -0
  455. package/dist/fonts/noto-sans-tc-0-500-normal.woff2 +0 -0
  456. package/dist/fonts/noto-sans-tc-0-600-normal.woff2 +0 -0
  457. package/dist/fonts/noto-sans-tc-0-700-normal.woff2 +0 -0
  458. package/dist/fonts/noto-sans-tc-1-400-normal.woff2 +0 -0
  459. package/dist/fonts/noto-sans-tc-1-500-normal.woff2 +0 -0
  460. package/dist/fonts/noto-sans-tc-1-600-normal.woff2 +0 -0
  461. package/dist/fonts/noto-sans-tc-1-700-normal.woff2 +0 -0
  462. package/dist/fonts/noto-sans-tc-10-400-normal.woff2 +0 -0
  463. package/dist/fonts/noto-sans-tc-10-500-normal.woff2 +0 -0
  464. package/dist/fonts/noto-sans-tc-10-600-normal.woff2 +0 -0
  465. package/dist/fonts/noto-sans-tc-10-700-normal.woff2 +0 -0
  466. package/dist/fonts/noto-sans-tc-101-400-normal.woff2 +0 -0
  467. package/dist/fonts/noto-sans-tc-101-500-normal.woff2 +0 -0
  468. package/dist/fonts/noto-sans-tc-101-600-normal.woff2 +0 -0
  469. package/dist/fonts/noto-sans-tc-101-700-normal.woff2 +0 -0
  470. package/dist/fonts/noto-sans-tc-102-400-normal.woff2 +0 -0
  471. package/dist/fonts/noto-sans-tc-102-500-normal.woff2 +0 -0
  472. package/dist/fonts/noto-sans-tc-102-600-normal.woff2 +0 -0
  473. package/dist/fonts/noto-sans-tc-102-700-normal.woff2 +0 -0
  474. package/dist/fonts/noto-sans-tc-103-400-normal.woff2 +0 -0
  475. package/dist/fonts/noto-sans-tc-103-500-normal.woff2 +0 -0
  476. package/dist/fonts/noto-sans-tc-103-600-normal.woff2 +0 -0
  477. package/dist/fonts/noto-sans-tc-103-700-normal.woff2 +0 -0
  478. package/dist/fonts/noto-sans-tc-104-400-normal.woff2 +0 -0
  479. package/dist/fonts/noto-sans-tc-104-500-normal.woff2 +0 -0
  480. package/dist/fonts/noto-sans-tc-104-600-normal.woff2 +0 -0
  481. package/dist/fonts/noto-sans-tc-104-700-normal.woff2 +0 -0
  482. package/dist/fonts/noto-sans-tc-105-400-normal.woff2 +0 -0
  483. package/dist/fonts/noto-sans-tc-105-500-normal.woff2 +0 -0
  484. package/dist/fonts/noto-sans-tc-105-600-normal.woff2 +0 -0
  485. package/dist/fonts/noto-sans-tc-105-700-normal.woff2 +0 -0
  486. package/dist/fonts/noto-sans-tc-106-400-normal.woff2 +0 -0
  487. package/dist/fonts/noto-sans-tc-106-500-normal.woff2 +0 -0
  488. package/dist/fonts/noto-sans-tc-106-600-normal.woff2 +0 -0
  489. package/dist/fonts/noto-sans-tc-106-700-normal.woff2 +0 -0
  490. package/dist/fonts/noto-sans-tc-107-400-normal.woff2 +0 -0
  491. package/dist/fonts/noto-sans-tc-107-500-normal.woff2 +0 -0
  492. package/dist/fonts/noto-sans-tc-107-600-normal.woff2 +0 -0
  493. package/dist/fonts/noto-sans-tc-107-700-normal.woff2 +0 -0
  494. package/dist/fonts/noto-sans-tc-108-400-normal.woff2 +0 -0
  495. package/dist/fonts/noto-sans-tc-108-500-normal.woff2 +0 -0
  496. package/dist/fonts/noto-sans-tc-108-600-normal.woff2 +0 -0
  497. package/dist/fonts/noto-sans-tc-108-700-normal.woff2 +0 -0
  498. package/dist/fonts/noto-sans-tc-109-400-normal.woff2 +0 -0
  499. package/dist/fonts/noto-sans-tc-109-500-normal.woff2 +0 -0
  500. package/dist/fonts/noto-sans-tc-109-600-normal.woff2 +0 -0
  501. package/dist/fonts/noto-sans-tc-109-700-normal.woff2 +0 -0
  502. package/dist/fonts/noto-sans-tc-11-400-normal.woff2 +0 -0
  503. package/dist/fonts/noto-sans-tc-11-500-normal.woff2 +0 -0
  504. package/dist/fonts/noto-sans-tc-11-600-normal.woff2 +0 -0
  505. package/dist/fonts/noto-sans-tc-11-700-normal.woff2 +0 -0
  506. package/dist/fonts/noto-sans-tc-110-400-normal.woff2 +0 -0
  507. package/dist/fonts/noto-sans-tc-110-500-normal.woff2 +0 -0
  508. package/dist/fonts/noto-sans-tc-110-600-normal.woff2 +0 -0
  509. package/dist/fonts/noto-sans-tc-110-700-normal.woff2 +0 -0
  510. package/dist/fonts/noto-sans-tc-111-400-normal.woff2 +0 -0
  511. package/dist/fonts/noto-sans-tc-111-500-normal.woff2 +0 -0
  512. package/dist/fonts/noto-sans-tc-111-600-normal.woff2 +0 -0
  513. package/dist/fonts/noto-sans-tc-111-700-normal.woff2 +0 -0
  514. package/dist/fonts/noto-sans-tc-112-400-normal.woff2 +0 -0
  515. package/dist/fonts/noto-sans-tc-112-500-normal.woff2 +0 -0
  516. package/dist/fonts/noto-sans-tc-112-600-normal.woff2 +0 -0
  517. package/dist/fonts/noto-sans-tc-112-700-normal.woff2 +0 -0
  518. package/dist/fonts/noto-sans-tc-113-400-normal.woff2 +0 -0
  519. package/dist/fonts/noto-sans-tc-113-500-normal.woff2 +0 -0
  520. package/dist/fonts/noto-sans-tc-113-600-normal.woff2 +0 -0
  521. package/dist/fonts/noto-sans-tc-113-700-normal.woff2 +0 -0
  522. package/dist/fonts/noto-sans-tc-114-400-normal.woff2 +0 -0
  523. package/dist/fonts/noto-sans-tc-114-500-normal.woff2 +0 -0
  524. package/dist/fonts/noto-sans-tc-114-600-normal.woff2 +0 -0
  525. package/dist/fonts/noto-sans-tc-114-700-normal.woff2 +0 -0
  526. package/dist/fonts/noto-sans-tc-115-400-normal.woff2 +0 -0
  527. package/dist/fonts/noto-sans-tc-115-500-normal.woff2 +0 -0
  528. package/dist/fonts/noto-sans-tc-115-600-normal.woff2 +0 -0
  529. package/dist/fonts/noto-sans-tc-115-700-normal.woff2 +0 -0
  530. package/dist/fonts/noto-sans-tc-116-400-normal.woff2 +0 -0
  531. package/dist/fonts/noto-sans-tc-116-500-normal.woff2 +0 -0
  532. package/dist/fonts/noto-sans-tc-116-600-normal.woff2 +0 -0
  533. package/dist/fonts/noto-sans-tc-116-700-normal.woff2 +0 -0
  534. package/dist/fonts/noto-sans-tc-117-400-normal.woff2 +0 -0
  535. package/dist/fonts/noto-sans-tc-117-500-normal.woff2 +0 -0
  536. package/dist/fonts/noto-sans-tc-117-600-normal.woff2 +0 -0
  537. package/dist/fonts/noto-sans-tc-117-700-normal.woff2 +0 -0
  538. package/dist/fonts/noto-sans-tc-118-400-normal.woff2 +0 -0
  539. package/dist/fonts/noto-sans-tc-118-500-normal.woff2 +0 -0
  540. package/dist/fonts/noto-sans-tc-118-600-normal.woff2 +0 -0
  541. package/dist/fonts/noto-sans-tc-118-700-normal.woff2 +0 -0
  542. package/dist/fonts/noto-sans-tc-119-400-normal.woff2 +0 -0
  543. package/dist/fonts/noto-sans-tc-119-500-normal.woff2 +0 -0
  544. package/dist/fonts/noto-sans-tc-119-600-normal.woff2 +0 -0
  545. package/dist/fonts/noto-sans-tc-119-700-normal.woff2 +0 -0
  546. package/dist/fonts/noto-sans-tc-12-400-normal.woff2 +0 -0
  547. package/dist/fonts/noto-sans-tc-12-500-normal.woff2 +0 -0
  548. package/dist/fonts/noto-sans-tc-12-600-normal.woff2 +0 -0
  549. package/dist/fonts/noto-sans-tc-12-700-normal.woff2 +0 -0
  550. package/dist/fonts/noto-sans-tc-120-400-normal.woff2 +0 -0
  551. package/dist/fonts/noto-sans-tc-120-500-normal.woff2 +0 -0
  552. package/dist/fonts/noto-sans-tc-120-600-normal.woff2 +0 -0
  553. package/dist/fonts/noto-sans-tc-120-700-normal.woff2 +0 -0
  554. package/dist/fonts/noto-sans-tc-121-400-normal.woff2 +0 -0
  555. package/dist/fonts/noto-sans-tc-121-500-normal.woff2 +0 -0
  556. package/dist/fonts/noto-sans-tc-121-600-normal.woff2 +0 -0
  557. package/dist/fonts/noto-sans-tc-121-700-normal.woff2 +0 -0
  558. package/dist/fonts/noto-sans-tc-122-400-normal.woff2 +0 -0
  559. package/dist/fonts/noto-sans-tc-122-500-normal.woff2 +0 -0
  560. package/dist/fonts/noto-sans-tc-122-600-normal.woff2 +0 -0
  561. package/dist/fonts/noto-sans-tc-122-700-normal.woff2 +0 -0
  562. package/dist/fonts/noto-sans-tc-123-400-normal.woff2 +0 -0
  563. package/dist/fonts/noto-sans-tc-123-500-normal.woff2 +0 -0
  564. package/dist/fonts/noto-sans-tc-123-600-normal.woff2 +0 -0
  565. package/dist/fonts/noto-sans-tc-123-700-normal.woff2 +0 -0
  566. package/dist/fonts/noto-sans-tc-2-400-normal.woff2 +0 -0
  567. package/dist/fonts/noto-sans-tc-2-500-normal.woff2 +0 -0
  568. package/dist/fonts/noto-sans-tc-2-600-normal.woff2 +0 -0
  569. package/dist/fonts/noto-sans-tc-2-700-normal.woff2 +0 -0
  570. package/dist/fonts/noto-sans-tc-23-400-normal.woff2 +0 -0
  571. package/dist/fonts/noto-sans-tc-23-500-normal.woff2 +0 -0
  572. package/dist/fonts/noto-sans-tc-23-600-normal.woff2 +0 -0
  573. package/dist/fonts/noto-sans-tc-23-700-normal.woff2 +0 -0
  574. package/dist/fonts/noto-sans-tc-24-400-normal.woff2 +0 -0
  575. package/dist/fonts/noto-sans-tc-24-500-normal.woff2 +0 -0
  576. package/dist/fonts/noto-sans-tc-24-600-normal.woff2 +0 -0
  577. package/dist/fonts/noto-sans-tc-24-700-normal.woff2 +0 -0
  578. package/dist/fonts/noto-sans-tc-25-400-normal.woff2 +0 -0
  579. package/dist/fonts/noto-sans-tc-25-500-normal.woff2 +0 -0
  580. package/dist/fonts/noto-sans-tc-25-600-normal.woff2 +0 -0
  581. package/dist/fonts/noto-sans-tc-25-700-normal.woff2 +0 -0
  582. package/dist/fonts/noto-sans-tc-26-400-normal.woff2 +0 -0
  583. package/dist/fonts/noto-sans-tc-26-500-normal.woff2 +0 -0
  584. package/dist/fonts/noto-sans-tc-26-600-normal.woff2 +0 -0
  585. package/dist/fonts/noto-sans-tc-26-700-normal.woff2 +0 -0
  586. package/dist/fonts/noto-sans-tc-27-400-normal.woff2 +0 -0
  587. package/dist/fonts/noto-sans-tc-27-500-normal.woff2 +0 -0
  588. package/dist/fonts/noto-sans-tc-27-600-normal.woff2 +0 -0
  589. package/dist/fonts/noto-sans-tc-27-700-normal.woff2 +0 -0
  590. package/dist/fonts/noto-sans-tc-28-400-normal.woff2 +0 -0
  591. package/dist/fonts/noto-sans-tc-28-500-normal.woff2 +0 -0
  592. package/dist/fonts/noto-sans-tc-28-600-normal.woff2 +0 -0
  593. package/dist/fonts/noto-sans-tc-28-700-normal.woff2 +0 -0
  594. package/dist/fonts/noto-sans-tc-29-400-normal.woff2 +0 -0
  595. package/dist/fonts/noto-sans-tc-29-500-normal.woff2 +0 -0
  596. package/dist/fonts/noto-sans-tc-29-600-normal.woff2 +0 -0
  597. package/dist/fonts/noto-sans-tc-29-700-normal.woff2 +0 -0
  598. package/dist/fonts/noto-sans-tc-30-400-normal.woff2 +0 -0
  599. package/dist/fonts/noto-sans-tc-30-500-normal.woff2 +0 -0
  600. package/dist/fonts/noto-sans-tc-30-600-normal.woff2 +0 -0
  601. package/dist/fonts/noto-sans-tc-30-700-normal.woff2 +0 -0
  602. package/dist/fonts/noto-sans-tc-31-400-normal.woff2 +0 -0
  603. package/dist/fonts/noto-sans-tc-31-500-normal.woff2 +0 -0
  604. package/dist/fonts/noto-sans-tc-31-600-normal.woff2 +0 -0
  605. package/dist/fonts/noto-sans-tc-31-700-normal.woff2 +0 -0
  606. package/dist/fonts/noto-sans-tc-32-400-normal.woff2 +0 -0
  607. package/dist/fonts/noto-sans-tc-32-500-normal.woff2 +0 -0
  608. package/dist/fonts/noto-sans-tc-32-600-normal.woff2 +0 -0
  609. package/dist/fonts/noto-sans-tc-32-700-normal.woff2 +0 -0
  610. package/dist/fonts/noto-sans-tc-33-400-normal.woff2 +0 -0
  611. package/dist/fonts/noto-sans-tc-33-500-normal.woff2 +0 -0
  612. package/dist/fonts/noto-sans-tc-33-600-normal.woff2 +0 -0
  613. package/dist/fonts/noto-sans-tc-33-700-normal.woff2 +0 -0
  614. package/dist/fonts/noto-sans-tc-34-400-normal.woff2 +0 -0
  615. package/dist/fonts/noto-sans-tc-34-500-normal.woff2 +0 -0
  616. package/dist/fonts/noto-sans-tc-34-600-normal.woff2 +0 -0
  617. package/dist/fonts/noto-sans-tc-34-700-normal.woff2 +0 -0
  618. package/dist/fonts/noto-sans-tc-35-400-normal.woff2 +0 -0
  619. package/dist/fonts/noto-sans-tc-35-500-normal.woff2 +0 -0
  620. package/dist/fonts/noto-sans-tc-35-600-normal.woff2 +0 -0
  621. package/dist/fonts/noto-sans-tc-35-700-normal.woff2 +0 -0
  622. package/dist/fonts/noto-sans-tc-36-400-normal.woff2 +0 -0
  623. package/dist/fonts/noto-sans-tc-36-500-normal.woff2 +0 -0
  624. package/dist/fonts/noto-sans-tc-36-600-normal.woff2 +0 -0
  625. package/dist/fonts/noto-sans-tc-36-700-normal.woff2 +0 -0
  626. package/dist/fonts/noto-sans-tc-37-400-normal.woff2 +0 -0
  627. package/dist/fonts/noto-sans-tc-37-500-normal.woff2 +0 -0
  628. package/dist/fonts/noto-sans-tc-37-600-normal.woff2 +0 -0
  629. package/dist/fonts/noto-sans-tc-37-700-normal.woff2 +0 -0
  630. package/dist/fonts/noto-sans-tc-38-400-normal.woff2 +0 -0
  631. package/dist/fonts/noto-sans-tc-38-500-normal.woff2 +0 -0
  632. package/dist/fonts/noto-sans-tc-38-600-normal.woff2 +0 -0
  633. package/dist/fonts/noto-sans-tc-38-700-normal.woff2 +0 -0
  634. package/dist/fonts/noto-sans-tc-39-400-normal.woff2 +0 -0
  635. package/dist/fonts/noto-sans-tc-39-500-normal.woff2 +0 -0
  636. package/dist/fonts/noto-sans-tc-39-600-normal.woff2 +0 -0
  637. package/dist/fonts/noto-sans-tc-39-700-normal.woff2 +0 -0
  638. package/dist/fonts/noto-sans-tc-4-400-normal.woff2 +0 -0
  639. package/dist/fonts/noto-sans-tc-4-500-normal.woff2 +0 -0
  640. package/dist/fonts/noto-sans-tc-4-600-normal.woff2 +0 -0
  641. package/dist/fonts/noto-sans-tc-4-700-normal.woff2 +0 -0
  642. package/dist/fonts/noto-sans-tc-40-400-normal.woff2 +0 -0
  643. package/dist/fonts/noto-sans-tc-40-500-normal.woff2 +0 -0
  644. package/dist/fonts/noto-sans-tc-40-600-normal.woff2 +0 -0
  645. package/dist/fonts/noto-sans-tc-40-700-normal.woff2 +0 -0
  646. package/dist/fonts/noto-sans-tc-41-400-normal.woff2 +0 -0
  647. package/dist/fonts/noto-sans-tc-41-500-normal.woff2 +0 -0
  648. package/dist/fonts/noto-sans-tc-41-600-normal.woff2 +0 -0
  649. package/dist/fonts/noto-sans-tc-41-700-normal.woff2 +0 -0
  650. package/dist/fonts/noto-sans-tc-42-400-normal.woff2 +0 -0
  651. package/dist/fonts/noto-sans-tc-42-500-normal.woff2 +0 -0
  652. package/dist/fonts/noto-sans-tc-42-600-normal.woff2 +0 -0
  653. package/dist/fonts/noto-sans-tc-42-700-normal.woff2 +0 -0
  654. package/dist/fonts/noto-sans-tc-43-400-normal.woff2 +0 -0
  655. package/dist/fonts/noto-sans-tc-43-500-normal.woff2 +0 -0
  656. package/dist/fonts/noto-sans-tc-43-600-normal.woff2 +0 -0
  657. package/dist/fonts/noto-sans-tc-43-700-normal.woff2 +0 -0
  658. package/dist/fonts/noto-sans-tc-44-400-normal.woff2 +0 -0
  659. package/dist/fonts/noto-sans-tc-44-500-normal.woff2 +0 -0
  660. package/dist/fonts/noto-sans-tc-44-600-normal.woff2 +0 -0
  661. package/dist/fonts/noto-sans-tc-44-700-normal.woff2 +0 -0
  662. package/dist/fonts/noto-sans-tc-45-400-normal.woff2 +0 -0
  663. package/dist/fonts/noto-sans-tc-45-500-normal.woff2 +0 -0
  664. package/dist/fonts/noto-sans-tc-45-600-normal.woff2 +0 -0
  665. package/dist/fonts/noto-sans-tc-45-700-normal.woff2 +0 -0
  666. package/dist/fonts/noto-sans-tc-46-400-normal.woff2 +0 -0
  667. package/dist/fonts/noto-sans-tc-46-500-normal.woff2 +0 -0
  668. package/dist/fonts/noto-sans-tc-46-600-normal.woff2 +0 -0
  669. package/dist/fonts/noto-sans-tc-46-700-normal.woff2 +0 -0
  670. package/dist/fonts/noto-sans-tc-47-400-normal.woff2 +0 -0
  671. package/dist/fonts/noto-sans-tc-47-500-normal.woff2 +0 -0
  672. package/dist/fonts/noto-sans-tc-47-600-normal.woff2 +0 -0
  673. package/dist/fonts/noto-sans-tc-47-700-normal.woff2 +0 -0
  674. package/dist/fonts/noto-sans-tc-48-400-normal.woff2 +0 -0
  675. package/dist/fonts/noto-sans-tc-48-500-normal.woff2 +0 -0
  676. package/dist/fonts/noto-sans-tc-48-600-normal.woff2 +0 -0
  677. package/dist/fonts/noto-sans-tc-48-700-normal.woff2 +0 -0
  678. package/dist/fonts/noto-sans-tc-49-400-normal.woff2 +0 -0
  679. package/dist/fonts/noto-sans-tc-49-500-normal.woff2 +0 -0
  680. package/dist/fonts/noto-sans-tc-49-600-normal.woff2 +0 -0
  681. package/dist/fonts/noto-sans-tc-49-700-normal.woff2 +0 -0
  682. package/dist/fonts/noto-sans-tc-50-400-normal.woff2 +0 -0
  683. package/dist/fonts/noto-sans-tc-50-500-normal.woff2 +0 -0
  684. package/dist/fonts/noto-sans-tc-50-600-normal.woff2 +0 -0
  685. package/dist/fonts/noto-sans-tc-50-700-normal.woff2 +0 -0
  686. package/dist/fonts/noto-sans-tc-51-400-normal.woff2 +0 -0
  687. package/dist/fonts/noto-sans-tc-51-500-normal.woff2 +0 -0
  688. package/dist/fonts/noto-sans-tc-51-600-normal.woff2 +0 -0
  689. package/dist/fonts/noto-sans-tc-51-700-normal.woff2 +0 -0
  690. package/dist/fonts/noto-sans-tc-52-400-normal.woff2 +0 -0
  691. package/dist/fonts/noto-sans-tc-52-500-normal.woff2 +0 -0
  692. package/dist/fonts/noto-sans-tc-52-600-normal.woff2 +0 -0
  693. package/dist/fonts/noto-sans-tc-52-700-normal.woff2 +0 -0
  694. package/dist/fonts/noto-sans-tc-53-400-normal.woff2 +0 -0
  695. package/dist/fonts/noto-sans-tc-53-500-normal.woff2 +0 -0
  696. package/dist/fonts/noto-sans-tc-53-600-normal.woff2 +0 -0
  697. package/dist/fonts/noto-sans-tc-53-700-normal.woff2 +0 -0
  698. package/dist/fonts/noto-sans-tc-54-400-normal.woff2 +0 -0
  699. package/dist/fonts/noto-sans-tc-54-500-normal.woff2 +0 -0
  700. package/dist/fonts/noto-sans-tc-54-600-normal.woff2 +0 -0
  701. package/dist/fonts/noto-sans-tc-54-700-normal.woff2 +0 -0
  702. package/dist/fonts/noto-sans-tc-55-400-normal.woff2 +0 -0
  703. package/dist/fonts/noto-sans-tc-55-500-normal.woff2 +0 -0
  704. package/dist/fonts/noto-sans-tc-55-600-normal.woff2 +0 -0
  705. package/dist/fonts/noto-sans-tc-55-700-normal.woff2 +0 -0
  706. package/dist/fonts/noto-sans-tc-56-400-normal.woff2 +0 -0
  707. package/dist/fonts/noto-sans-tc-56-500-normal.woff2 +0 -0
  708. package/dist/fonts/noto-sans-tc-56-600-normal.woff2 +0 -0
  709. package/dist/fonts/noto-sans-tc-56-700-normal.woff2 +0 -0
  710. package/dist/fonts/noto-sans-tc-57-400-normal.woff2 +0 -0
  711. package/dist/fonts/noto-sans-tc-57-500-normal.woff2 +0 -0
  712. package/dist/fonts/noto-sans-tc-57-600-normal.woff2 +0 -0
  713. package/dist/fonts/noto-sans-tc-57-700-normal.woff2 +0 -0
  714. package/dist/fonts/noto-sans-tc-58-400-normal.woff2 +0 -0
  715. package/dist/fonts/noto-sans-tc-58-500-normal.woff2 +0 -0
  716. package/dist/fonts/noto-sans-tc-58-600-normal.woff2 +0 -0
  717. package/dist/fonts/noto-sans-tc-58-700-normal.woff2 +0 -0
  718. package/dist/fonts/noto-sans-tc-59-400-normal.woff2 +0 -0
  719. package/dist/fonts/noto-sans-tc-59-500-normal.woff2 +0 -0
  720. package/dist/fonts/noto-sans-tc-59-600-normal.woff2 +0 -0
  721. package/dist/fonts/noto-sans-tc-59-700-normal.woff2 +0 -0
  722. package/dist/fonts/noto-sans-tc-60-400-normal.woff2 +0 -0
  723. package/dist/fonts/noto-sans-tc-60-500-normal.woff2 +0 -0
  724. package/dist/fonts/noto-sans-tc-60-600-normal.woff2 +0 -0
  725. package/dist/fonts/noto-sans-tc-60-700-normal.woff2 +0 -0
  726. package/dist/fonts/noto-sans-tc-61-400-normal.woff2 +0 -0
  727. package/dist/fonts/noto-sans-tc-61-500-normal.woff2 +0 -0
  728. package/dist/fonts/noto-sans-tc-61-600-normal.woff2 +0 -0
  729. package/dist/fonts/noto-sans-tc-61-700-normal.woff2 +0 -0
  730. package/dist/fonts/noto-sans-tc-62-400-normal.woff2 +0 -0
  731. package/dist/fonts/noto-sans-tc-62-500-normal.woff2 +0 -0
  732. package/dist/fonts/noto-sans-tc-62-600-normal.woff2 +0 -0
  733. package/dist/fonts/noto-sans-tc-62-700-normal.woff2 +0 -0
  734. package/dist/fonts/noto-sans-tc-63-400-normal.woff2 +0 -0
  735. package/dist/fonts/noto-sans-tc-63-500-normal.woff2 +0 -0
  736. package/dist/fonts/noto-sans-tc-63-600-normal.woff2 +0 -0
  737. package/dist/fonts/noto-sans-tc-63-700-normal.woff2 +0 -0
  738. package/dist/fonts/noto-sans-tc-64-400-normal.woff2 +0 -0
  739. package/dist/fonts/noto-sans-tc-64-500-normal.woff2 +0 -0
  740. package/dist/fonts/noto-sans-tc-64-600-normal.woff2 +0 -0
  741. package/dist/fonts/noto-sans-tc-64-700-normal.woff2 +0 -0
  742. package/dist/fonts/noto-sans-tc-65-400-normal.woff2 +0 -0
  743. package/dist/fonts/noto-sans-tc-65-500-normal.woff2 +0 -0
  744. package/dist/fonts/noto-sans-tc-65-600-normal.woff2 +0 -0
  745. package/dist/fonts/noto-sans-tc-65-700-normal.woff2 +0 -0
  746. package/dist/fonts/noto-sans-tc-66-400-normal.woff2 +0 -0
  747. package/dist/fonts/noto-sans-tc-66-500-normal.woff2 +0 -0
  748. package/dist/fonts/noto-sans-tc-66-600-normal.woff2 +0 -0
  749. package/dist/fonts/noto-sans-tc-66-700-normal.woff2 +0 -0
  750. package/dist/fonts/noto-sans-tc-67-400-normal.woff2 +0 -0
  751. package/dist/fonts/noto-sans-tc-67-500-normal.woff2 +0 -0
  752. package/dist/fonts/noto-sans-tc-67-600-normal.woff2 +0 -0
  753. package/dist/fonts/noto-sans-tc-67-700-normal.woff2 +0 -0
  754. package/dist/fonts/noto-sans-tc-68-400-normal.woff2 +0 -0
  755. package/dist/fonts/noto-sans-tc-68-500-normal.woff2 +0 -0
  756. package/dist/fonts/noto-sans-tc-68-600-normal.woff2 +0 -0
  757. package/dist/fonts/noto-sans-tc-68-700-normal.woff2 +0 -0
  758. package/dist/fonts/noto-sans-tc-69-400-normal.woff2 +0 -0
  759. package/dist/fonts/noto-sans-tc-69-500-normal.woff2 +0 -0
  760. package/dist/fonts/noto-sans-tc-69-600-normal.woff2 +0 -0
  761. package/dist/fonts/noto-sans-tc-69-700-normal.woff2 +0 -0
  762. package/dist/fonts/noto-sans-tc-70-400-normal.woff2 +0 -0
  763. package/dist/fonts/noto-sans-tc-70-500-normal.woff2 +0 -0
  764. package/dist/fonts/noto-sans-tc-70-600-normal.woff2 +0 -0
  765. package/dist/fonts/noto-sans-tc-70-700-normal.woff2 +0 -0
  766. package/dist/fonts/noto-sans-tc-71-400-normal.woff2 +0 -0
  767. package/dist/fonts/noto-sans-tc-71-500-normal.woff2 +0 -0
  768. package/dist/fonts/noto-sans-tc-71-600-normal.woff2 +0 -0
  769. package/dist/fonts/noto-sans-tc-71-700-normal.woff2 +0 -0
  770. package/dist/fonts/noto-sans-tc-72-400-normal.woff2 +0 -0
  771. package/dist/fonts/noto-sans-tc-72-500-normal.woff2 +0 -0
  772. package/dist/fonts/noto-sans-tc-72-600-normal.woff2 +0 -0
  773. package/dist/fonts/noto-sans-tc-72-700-normal.woff2 +0 -0
  774. package/dist/fonts/noto-sans-tc-73-400-normal.woff2 +0 -0
  775. package/dist/fonts/noto-sans-tc-73-500-normal.woff2 +0 -0
  776. package/dist/fonts/noto-sans-tc-73-600-normal.woff2 +0 -0
  777. package/dist/fonts/noto-sans-tc-73-700-normal.woff2 +0 -0
  778. package/dist/fonts/noto-sans-tc-74-400-normal.woff2 +0 -0
  779. package/dist/fonts/noto-sans-tc-74-500-normal.woff2 +0 -0
  780. package/dist/fonts/noto-sans-tc-74-600-normal.woff2 +0 -0
  781. package/dist/fonts/noto-sans-tc-74-700-normal.woff2 +0 -0
  782. package/dist/fonts/noto-sans-tc-75-400-normal.woff2 +0 -0
  783. package/dist/fonts/noto-sans-tc-75-500-normal.woff2 +0 -0
  784. package/dist/fonts/noto-sans-tc-75-600-normal.woff2 +0 -0
  785. package/dist/fonts/noto-sans-tc-75-700-normal.woff2 +0 -0
  786. package/dist/fonts/noto-sans-tc-76-400-normal.woff2 +0 -0
  787. package/dist/fonts/noto-sans-tc-76-500-normal.woff2 +0 -0
  788. package/dist/fonts/noto-sans-tc-76-600-normal.woff2 +0 -0
  789. package/dist/fonts/noto-sans-tc-76-700-normal.woff2 +0 -0
  790. package/dist/fonts/noto-sans-tc-77-400-normal.woff2 +0 -0
  791. package/dist/fonts/noto-sans-tc-77-500-normal.woff2 +0 -0
  792. package/dist/fonts/noto-sans-tc-77-600-normal.woff2 +0 -0
  793. package/dist/fonts/noto-sans-tc-77-700-normal.woff2 +0 -0
  794. package/dist/fonts/noto-sans-tc-78-400-normal.woff2 +0 -0
  795. package/dist/fonts/noto-sans-tc-78-500-normal.woff2 +0 -0
  796. package/dist/fonts/noto-sans-tc-78-600-normal.woff2 +0 -0
  797. package/dist/fonts/noto-sans-tc-78-700-normal.woff2 +0 -0
  798. package/dist/fonts/noto-sans-tc-79-400-normal.woff2 +0 -0
  799. package/dist/fonts/noto-sans-tc-79-500-normal.woff2 +0 -0
  800. package/dist/fonts/noto-sans-tc-79-600-normal.woff2 +0 -0
  801. package/dist/fonts/noto-sans-tc-79-700-normal.woff2 +0 -0
  802. package/dist/fonts/noto-sans-tc-80-400-normal.woff2 +0 -0
  803. package/dist/fonts/noto-sans-tc-80-500-normal.woff2 +0 -0
  804. package/dist/fonts/noto-sans-tc-80-600-normal.woff2 +0 -0
  805. package/dist/fonts/noto-sans-tc-80-700-normal.woff2 +0 -0
  806. package/dist/fonts/noto-sans-tc-81-400-normal.woff2 +0 -0
  807. package/dist/fonts/noto-sans-tc-81-500-normal.woff2 +0 -0
  808. package/dist/fonts/noto-sans-tc-81-600-normal.woff2 +0 -0
  809. package/dist/fonts/noto-sans-tc-81-700-normal.woff2 +0 -0
  810. package/dist/fonts/noto-sans-tc-82-400-normal.woff2 +0 -0
  811. package/dist/fonts/noto-sans-tc-82-500-normal.woff2 +0 -0
  812. package/dist/fonts/noto-sans-tc-82-600-normal.woff2 +0 -0
  813. package/dist/fonts/noto-sans-tc-82-700-normal.woff2 +0 -0
  814. package/dist/fonts/noto-sans-tc-83-400-normal.woff2 +0 -0
  815. package/dist/fonts/noto-sans-tc-83-500-normal.woff2 +0 -0
  816. package/dist/fonts/noto-sans-tc-83-600-normal.woff2 +0 -0
  817. package/dist/fonts/noto-sans-tc-83-700-normal.woff2 +0 -0
  818. package/dist/fonts/noto-sans-tc-84-400-normal.woff2 +0 -0
  819. package/dist/fonts/noto-sans-tc-84-500-normal.woff2 +0 -0
  820. package/dist/fonts/noto-sans-tc-84-600-normal.woff2 +0 -0
  821. package/dist/fonts/noto-sans-tc-84-700-normal.woff2 +0 -0
  822. package/dist/fonts/noto-sans-tc-85-400-normal.woff2 +0 -0
  823. package/dist/fonts/noto-sans-tc-85-500-normal.woff2 +0 -0
  824. package/dist/fonts/noto-sans-tc-85-600-normal.woff2 +0 -0
  825. package/dist/fonts/noto-sans-tc-85-700-normal.woff2 +0 -0
  826. package/dist/fonts/noto-sans-tc-86-400-normal.woff2 +0 -0
  827. package/dist/fonts/noto-sans-tc-86-500-normal.woff2 +0 -0
  828. package/dist/fonts/noto-sans-tc-86-600-normal.woff2 +0 -0
  829. package/dist/fonts/noto-sans-tc-86-700-normal.woff2 +0 -0
  830. package/dist/fonts/noto-sans-tc-87-400-normal.woff2 +0 -0
  831. package/dist/fonts/noto-sans-tc-87-500-normal.woff2 +0 -0
  832. package/dist/fonts/noto-sans-tc-87-600-normal.woff2 +0 -0
  833. package/dist/fonts/noto-sans-tc-87-700-normal.woff2 +0 -0
  834. package/dist/fonts/noto-sans-tc-88-400-normal.woff2 +0 -0
  835. package/dist/fonts/noto-sans-tc-88-500-normal.woff2 +0 -0
  836. package/dist/fonts/noto-sans-tc-88-600-normal.woff2 +0 -0
  837. package/dist/fonts/noto-sans-tc-88-700-normal.woff2 +0 -0
  838. package/dist/fonts/noto-sans-tc-89-400-normal.woff2 +0 -0
  839. package/dist/fonts/noto-sans-tc-89-500-normal.woff2 +0 -0
  840. package/dist/fonts/noto-sans-tc-89-600-normal.woff2 +0 -0
  841. package/dist/fonts/noto-sans-tc-89-700-normal.woff2 +0 -0
  842. package/dist/fonts/noto-sans-tc-90-400-normal.woff2 +0 -0
  843. package/dist/fonts/noto-sans-tc-90-500-normal.woff2 +0 -0
  844. package/dist/fonts/noto-sans-tc-90-600-normal.woff2 +0 -0
  845. package/dist/fonts/noto-sans-tc-90-700-normal.woff2 +0 -0
  846. package/dist/fonts/noto-sans-tc-91-400-normal.woff2 +0 -0
  847. package/dist/fonts/noto-sans-tc-91-500-normal.woff2 +0 -0
  848. package/dist/fonts/noto-sans-tc-91-600-normal.woff2 +0 -0
  849. package/dist/fonts/noto-sans-tc-91-700-normal.woff2 +0 -0
  850. package/dist/fonts/noto-sans-tc-92-400-normal.woff2 +0 -0
  851. package/dist/fonts/noto-sans-tc-92-500-normal.woff2 +0 -0
  852. package/dist/fonts/noto-sans-tc-92-600-normal.woff2 +0 -0
  853. package/dist/fonts/noto-sans-tc-92-700-normal.woff2 +0 -0
  854. package/dist/fonts/noto-sans-tc-93-400-normal.woff2 +0 -0
  855. package/dist/fonts/noto-sans-tc-93-500-normal.woff2 +0 -0
  856. package/dist/fonts/noto-sans-tc-93-600-normal.woff2 +0 -0
  857. package/dist/fonts/noto-sans-tc-93-700-normal.woff2 +0 -0
  858. package/dist/fonts/noto-sans-tc-94-400-normal.woff2 +0 -0
  859. package/dist/fonts/noto-sans-tc-94-500-normal.woff2 +0 -0
  860. package/dist/fonts/noto-sans-tc-94-600-normal.woff2 +0 -0
  861. package/dist/fonts/noto-sans-tc-94-700-normal.woff2 +0 -0
  862. package/dist/fonts/noto-sans-tc-95-400-normal.woff2 +0 -0
  863. package/dist/fonts/noto-sans-tc-95-500-normal.woff2 +0 -0
  864. package/dist/fonts/noto-sans-tc-95-600-normal.woff2 +0 -0
  865. package/dist/fonts/noto-sans-tc-95-700-normal.woff2 +0 -0
  866. package/dist/fonts/noto-sans-tc-96-400-normal.woff2 +0 -0
  867. package/dist/fonts/noto-sans-tc-96-500-normal.woff2 +0 -0
  868. package/dist/fonts/noto-sans-tc-96-600-normal.woff2 +0 -0
  869. package/dist/fonts/noto-sans-tc-96-700-normal.woff2 +0 -0
  870. package/dist/fonts/noto-sans-tc-cyrillic-400-normal.woff2 +0 -0
  871. package/dist/fonts/noto-sans-tc-cyrillic-500-normal.woff2 +0 -0
  872. package/dist/fonts/noto-sans-tc-cyrillic-600-normal.woff2 +0 -0
  873. package/dist/fonts/noto-sans-tc-cyrillic-700-normal.woff2 +0 -0
  874. package/dist/fonts/noto-sans-tc-latin-400-normal.woff2 +0 -0
  875. package/dist/fonts/noto-sans-tc-latin-500-normal.woff2 +0 -0
  876. package/dist/fonts/noto-sans-tc-latin-600-normal.woff2 +0 -0
  877. package/dist/fonts/noto-sans-tc-latin-700-normal.woff2 +0 -0
  878. package/dist/fonts/noto-sans-tc-latin-ext-400-normal.woff2 +0 -0
  879. package/dist/fonts/noto-sans-tc-latin-ext-500-normal.woff2 +0 -0
  880. package/dist/fonts/noto-sans-tc-latin-ext-600-normal.woff2 +0 -0
  881. package/dist/fonts/noto-sans-tc-latin-ext-700-normal.woff2 +0 -0
  882. package/dist/fonts/noto-sans-tc-vietnamese-400-normal.woff2 +0 -0
  883. package/dist/fonts/noto-sans-tc-vietnamese-500-normal.woff2 +0 -0
  884. package/dist/fonts/noto-sans-tc-vietnamese-600-normal.woff2 +0 -0
  885. package/dist/fonts/noto-sans-tc-vietnamese-700-normal.woff2 +0 -0
@@ -5,9 +5,11 @@ import { Tabs } from "../Tabs/Tabs.js";
5
5
  import { format } from "../../format.js";
6
6
  import { tr, unitFor } from "../../i18n.js";
7
7
  import { Icon } from "../../icons/Icon.js";
8
- import { TOUCH_ONLY, copyText, cx, idPart, monoNums, reduced, seenOnly, useMedia, useNarrow } from "../../internal/util.js";
8
+ import { TOUCH_ONLY, copyText, cx, idPart, monoNums, reduced, resizeObserver, seenOnly, useMedia, useNarrow } from "../../internal/util.js";
9
9
  import { Tooltip } from "../Tooltip/Tooltip.js";
10
- import { devWarn } from "../../internal/dev.js";
10
+ import { RelativeTime } from "../RelativeTime/RelativeTime.js";
11
+ import { DEV, devWarn } from "../../internal/dev.js";
12
+ import { useStored } from "../../internal/stored.js";
11
13
  import { CheckMark } from "../../internal/Field.js";
12
14
  import { announce } from "../../announce.js";
13
15
  import { ScrollHint, useScrollHint } from "../../internal/scrollHint.js";
@@ -24,6 +26,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
24
26
  import { createPortal } from "react-dom";
25
27
  // src/components/DataTable/DataTable.tsx
26
28
  includeIcons(caret_right_default, check_default, x_default);
29
+ const SEL = 40;
27
30
  const MOVE = {
28
31
  dur: 320,
29
32
  stagger: 25,
@@ -35,11 +38,22 @@ const ARROWS = {
35
38
  none: "M8 9l4-4 4 4M8 15l4 4 4-4"
36
39
  };
37
40
  const get = (row, key) => row[key];
41
+ const NO_TOGGLED = {};
42
+ const parseObject = (raw) => {
43
+ const v = JSON.parse(raw);
44
+ if (!v || typeof v !== "object") throw new Error("not an object");
45
+ return v;
46
+ };
47
+ const parseToggled = (raw) => parseObject(raw);
48
+ const parseWidths = (raw) => parseObject(raw);
38
49
  const isNum = (c) => c.numeric || c.format === "money" || c.format === "percent" || c.format === "duration";
39
50
  const isShort = (c) => isNum(c) || !!c.unit || isDateCol(c) || c.mobile === "status";
40
51
  const TEXT_HUG_MAX = 280;
41
52
  const HUG_START = 96;
42
- const CELL_PAD = 25;
53
+ const TEXT_HUG_MIN = 128;
54
+ const MAIN_WANT_MAX = 320;
55
+ const LONG_WANT_MAX = 512;
56
+ const TOOL_GAP = 8;
43
57
  const isoOf = (d, dateOnly) => dateOnly ? `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}` : d.toISOString();
44
58
  /** The width of what an element holds (its text and children, not absolutely placed parts such as the column border).
45
59
  * Null where text cannot be measured (jsdom has no Range#getBoundingClientRect): the column keeps its default width. */
@@ -126,6 +140,14 @@ function RowCheck({ v, label, onClick }) {
126
140
  children: /* @__PURE__ */ jsx(CheckMark, { v })
127
141
  });
128
142
  }
143
+ const UNMEASURED = {
144
+ fit: {},
145
+ clipped: null,
146
+ want: {},
147
+ roomy: false,
148
+ actsW: null,
149
+ onerow: false
150
+ };
129
151
  /** The table for records: sort, search, filters, page numbers, selection with a bulk bar, row actions; cards on phones. */
130
152
  function DataTable(p) {
131
153
  const { columns: cols, rows, pageSize = 10, urlSync = true, urlKey, search = {}, selectable = false, stickyFirst: sticky = false } = p;
@@ -164,24 +186,9 @@ function DataTable(p) {
164
186
  const [q, setQ] = React.useState(() => fromUrl().q);
165
187
  const [values, setValues] = React.useState(() => fromUrl().values);
166
188
  const [view, setView] = React.useState(p.views?.[0]?.id ?? null);
167
- const colsKey = p.widthKey ? "ui-dt-cols:" + p.widthKey : null;
168
- const [toggled, setToggledState] = React.useState(() => {
169
- if (!colsKey) return {};
170
- try {
171
- const v = JSON.parse(localStorage.getItem(colsKey) || "null");
172
- return v && typeof v === "object" ? v : {};
173
- } catch {
174
- return {};
175
- }
176
- });
177
- const setToggled = (t) => {
178
- setToggledState(t);
179
- if (!colsKey) return;
180
- try {
181
- if (Object.keys(t).length) localStorage.setItem(colsKey, JSON.stringify(t));
182
- else localStorage.removeItem(colsKey);
183
- } catch {}
184
- };
189
+ const storageKey = p.storageKey ?? p.widthKey;
190
+ const colsKey = storageKey ? "ui-dt-cols:" + storageKey : null;
191
+ const [toggled, setToggled] = useStored(colsKey ?? void 0, parseToggled, NO_TOGGLED, (t) => Object.keys(t).length ? JSON.stringify(t) : null);
185
192
  const [opened, setOpened] = React.useState({});
186
193
  const narrow = useNarrow();
187
194
  const touch = useMedia(TOUCH_ONLY);
@@ -189,24 +196,10 @@ function DataTable(p) {
189
196
  const rootRef = React.useRef(null);
190
197
  const [sel, setSel] = React.useState({});
191
198
  const [sumVal, setSumVal] = React.useState("all");
192
- const [fit, setFit] = React.useState({});
193
- const [widths, setWidthsState] = React.useState(() => {
194
- if (!p.widthKey) return null;
195
- try {
196
- const v = JSON.parse(localStorage.getItem("ui-dt-width:" + p.widthKey) || "null");
197
- return v && typeof v === "object" ? v : null;
198
- } catch {
199
- return null;
200
- }
201
- });
202
- const setWidths = (w) => {
203
- setWidthsState(w);
204
- if (!p.widthKey) return;
205
- try {
206
- if (w) localStorage.setItem("ui-dt-width:" + p.widthKey, JSON.stringify(w));
207
- else localStorage.removeItem("ui-dt-width:" + p.widthKey);
208
- } catch {}
209
- };
199
+ const [measured, setMeasured] = React.useState(UNMEASURED);
200
+ const { fit, clipped, want, roomy, actsW, onerow: onerowState } = measured;
201
+ const wantRef = React.useRef(want);
202
+ const [widths, setWidths] = useStored(storageKey ? "ui-dt-width:" + storageKey : void 0, parseWidths, null);
210
203
  const [zoomed, setZoomed] = React.useState(false);
211
204
  const [zoomWidths, setZoomWidths] = React.useState(null);
212
205
  const zoomRef = React.useRef(null);
@@ -216,6 +209,10 @@ function DataTable(p) {
216
209
  const prev = noSearch ? rootRef.current?.previousElementSibling : null;
217
210
  setHeadSlot(prev instanceof HTMLElement && prev.classList.contains("ui-card-head") && prev.parentElement?.classList.contains("ui-card") ? prev : null);
218
211
  }, [noSearch]);
212
+ React.useEffect(() => {
213
+ const prev = rootRef.current?.previousElementSibling;
214
+ devWarn(prev?.classList.contains("ui-card-head") && !prev.querySelector(".ui-card-title") && prev.querySelector(".ui-card-actions"), "DataTable", "the Card around this table has actions but no title, so its one button takes a row of its own above the table. Pass the page's primary action to DataTable's action instead: it goes at the right end of the toolbar.");
215
+ }, []);
219
216
  const [resetKey, setResetKey] = React.useState(p.resetKey);
220
217
  const resetting = resetKey !== p.resetKey;
221
218
  if (resetting) {
@@ -226,9 +223,14 @@ function DataTable(p) {
226
223
  setSel({});
227
224
  setSumVal("all");
228
225
  setSort(initialSort);
229
- if (!colsKey) setToggledState({});
226
+ if (!colsKey) setToggled({});
230
227
  setOpened({});
231
- setFit({});
228
+ setMeasured((m) => ({
229
+ ...m,
230
+ fit: {},
231
+ want: {},
232
+ clipped: null
233
+ }));
232
234
  }
233
235
  const valuesKey = JSON.stringify(values);
234
236
  const sortKey = JSON.stringify(sort);
@@ -238,25 +240,29 @@ function DataTable(p) {
238
240
  React.useEffect(() => {
239
241
  if (urlSync && filters.length) writeUrl(urlKey, filters, values, q);
240
242
  }, [valuesKey, q]);
241
- devWarn(cols.some((c) => c.format === "percent" && !c.unit), "DataTable", "format: 'percent' sets 1 decimal and shows no % sign; add unit: '%' to that column.");
242
- devWarn(rows.length > 1 && rows.every((r) => get(r, "id") == null) && selectable, "DataTable", "rows have no id, so a selection follows the position, not the row. Add an id to each row.");
243
+ devWarn(p.widthKey !== void 0, "DataTable", "`widthKey` is deprecated: rename it to `storageKey`, as in every other component that remembers a choice. The stored widths and columns carry over.");
244
+ devWarn(() => cols.some((c) => c.format === "percent" && !c.unit), "DataTable", "format: 'percent' sets 1 decimal and shows no % sign; add unit: '%' to that column.");
245
+ devWarn(() => rows.length > 1 && rows.every((r) => get(r, "id") == null) && selectable, "DataTable", "rows have no id, so a selection follows the position, not the row. Add an id to each row.");
246
+ devWarn(() => cols.some((c) => c.format === "datetime"), "DataTable", "format: 'datetime' is the old spelling, kept for now. Write format: 'dateTime', as format.dateTime().");
243
247
  devWarn(!!cols[0]?.hidden, "DataTable", "the first column is always shown, so its hidden: true does nothing. Move the column, or drop hidden.");
244
- devWarn((p.columnMenu === false || cols.length <= 2) && cols.some((c, i) => i > 0 && c.hidden), "DataTable", "a column has hidden: true but there is no 「欄位」 menu (columnMenu is false, or the table has 2 columns or fewer), so nobody can turn it on. Turn the menu on, or leave the column out.");
248
+ devWarn(() => (p.columnMenu === false || cols.length <= 2) && cols.some((c, i) => i > 0 && c.hidden), "DataTable", "a column has hidden: true but there is no 「欄位」 menu (columnMenu is false, or the table has 2 columns or fewer), so nobody can turn it on. Turn the menu on, or leave the column out.");
245
249
  const sumKey = p.summary?.key;
246
- const twiceFilter = sumKey ? filters.find((f) => f.key === sumKey) : void 0;
247
- devWarn(twiceFilter, "DataTable", `the filter 「${twiceFilter?.label}」 filters ${String(sumKey)}, which the summary tabs already filter, so the same condition is in two places. Drop it from filters (or drop summary).`);
248
- const twiceView = sumKey && rows.length ? p.views?.find((v) => {
249
- if (!v.filter) return false;
250
- const kept = rows.filter((r) => v.filter?.(r));
251
- if (!kept.length || kept.length === rows.length) return false;
252
- const val = String(get(kept[0], sumKey));
253
- return kept.every((r) => String(get(r, sumKey)) === val) && rows.filter((r) => String(get(r, sumKey)) === val).length === kept.length;
254
- }) : void 0;
255
- devWarn(twiceView, "DataTable", `the view 「${twiceView?.label}」 keeps exactly the rows of one ${String(sumKey)} value, which a summary tab already picks, so the same condition is in two places. Drop the view (or drop summary).`);
256
- for (const c of cols) {
257
- if (!c.unit && !c.numeric) continue;
258
- const bad = rows.map((r) => get(r, c.key)).find((v) => typeof v === "string" && /\d/.test(v) && (c.unit ? v.includes(c.unit) : !/^\s*-?[\d,]*\.?\d+\s*$/.test(v)));
259
- devWarn(bad !== void 0, "DataTable", `column 「${c.label}」 got the string 「${String(bad)}」. Pass a number${c.unit ? "" : " and the unit in unit"} (e.g. { numeric: true, unit: '${c.unit || "字"}' } with 1234), so it is formatted, right-aligned and sorted as a number.`);
250
+ if (DEV) {
251
+ const twiceFilter = sumKey ? filters.find((f) => f.key === sumKey) : void 0;
252
+ devWarn(twiceFilter, "DataTable", `the filter 「${twiceFilter?.label}」 filters ${String(sumKey)}, which the summary tabs already filter, so the same condition is in two places. Drop it from filters (or drop summary).`);
253
+ const twiceView = sumKey && rows.length ? p.views?.find((v) => {
254
+ if (!v.filter) return false;
255
+ const kept = rows.filter((r) => v.filter?.(r));
256
+ if (!kept.length || kept.length === rows.length) return false;
257
+ const val = String(get(kept[0], sumKey));
258
+ return kept.every((r) => String(get(r, sumKey)) === val) && rows.filter((r) => String(get(r, sumKey)) === val).length === kept.length;
259
+ }) : void 0;
260
+ devWarn(twiceView, "DataTable", `the view 「${twiceView?.label}」 keeps exactly the rows of one ${String(sumKey)} value, which a summary tab already picks, so the same condition is in two places. Drop the view (or drop summary).`);
261
+ for (const c of cols) {
262
+ if (!c.unit && !c.numeric) continue;
263
+ const bad = rows.map((r) => get(r, c.key)).find((v) => typeof v === "string" && /\d/.test(v) && (c.unit ? v.includes(c.unit) : !/^\s*-?[\d,]*\.?\d+\s*$/.test(v)));
264
+ devWarn(bad !== void 0, "DataTable", `column 「${c.label}」 got the string 「${String(bad)}」. Pass a number${c.unit ? "" : " and the unit in unit"} (e.g. { numeric: true, unit: '${c.unit || "items"}' } with 1234), so it is formatted, right-aligned and sorted as a number.`);
265
+ }
260
266
  }
261
267
  const hidden = {};
262
268
  cols.forEach((c, i) => hidden[c.key] = i > 0 && (toggled[c.key] ?? !!c.hidden));
@@ -265,44 +271,68 @@ function DataTable(p) {
265
271
  const bodyRef = React.useRef(null);
266
272
  const rowEls = React.useRef({});
267
273
  const snap = React.useRef(null);
268
- let all = rows.map((r, i) => ({
269
- r,
270
- i
271
- }));
272
- const viewObj = p.views?.find((v) => v.id === view);
273
- if (viewObj?.filter) all = all.filter((x) => viewObj.filter?.(x.r));
274
- const sumAll = all;
275
274
  const summary = p.summary;
276
- if (summary && sumVal !== "all") all = all.filter((x) => String(get(x.r, summary.key)) === sumVal);
277
- const baseCount = all.length;
278
275
  const searching = search !== false && !!q;
279
- const passes = (r, skip) => (!searching || searchHit(r, cols, filters, q, search ? search.keys : void 0)) && filters.every((f) => f.key === skip || matches(f, r, values[f.key]));
280
- let list = all.filter((x) => passes(x.r));
276
+ const searchKeys = search ? search.keys : void 0;
277
+ const searchKeysKey = searchKeys ? searchKeys.join("") : null;
278
+ const passes = (r, skip) => (!searching || searchHit(r, cols, filters, q, searchKeys)) && filters.every((f) => f.key === skip || matches(f, r, values[f.key]));
279
+ const { all, sumAll, list } = React.useMemo(() => {
280
+ let all = rows.map((r, i) => ({
281
+ r,
282
+ i
283
+ }));
284
+ const viewObj = p.views?.find((v) => v.id === view);
285
+ if (viewObj?.filter) all = all.filter((x) => viewObj.filter?.(x.r));
286
+ const sumAll = all;
287
+ if (sumKey && sumVal !== "all") all = all.filter((x) => String(get(x.r, sumKey)) === sumVal);
288
+ const keys = searchKeysKey === null ? void 0 : searchKeysKey.split("");
289
+ const hit = (r) => (!searching || searchHit(r, cols, filters, q, keys)) && filters.every((f) => matches(f, r, values[f.key]));
290
+ let list = all.filter((x) => hit(x.r));
291
+ if (sort.length) {
292
+ const by = sort.map((l) => {
293
+ const col = cols.find((c) => c.key === l.key);
294
+ const val = (r) => {
295
+ if (col?.sortValue) return col.sortValue(r);
296
+ const v = get(r, l.key);
297
+ if (v instanceof Date || col && isDateCol(col)) return asDate(v)?.getTime() ?? -Infinity;
298
+ return v;
299
+ };
300
+ return {
301
+ val,
302
+ d: l.dir === "asc" ? 1 : -1
303
+ };
304
+ });
305
+ list = [...list].sort((a, b) => {
306
+ for (const { val, d } of by) {
307
+ const x = val(a.r);
308
+ const y = val(b.r);
309
+ const c = typeof x === "number" && typeof y === "number" ? x - y : String(x).localeCompare(String(y), "zh-Hant");
310
+ if (c) return c * d;
311
+ }
312
+ return a.i - b.i;
313
+ });
314
+ }
315
+ return {
316
+ all,
317
+ sumAll,
318
+ list
319
+ };
320
+ }, [
321
+ rows,
322
+ cols,
323
+ filters,
324
+ values,
325
+ q,
326
+ searching,
327
+ searchKeysKey,
328
+ sort,
329
+ view,
330
+ p.views,
331
+ sumKey,
332
+ sumVal
333
+ ]);
334
+ const baseCount = all.length;
281
335
  const activeN = filters.filter((f) => isActive(values[f.key])).length;
282
- if (sort.length) {
283
- const by = sort.map((l) => {
284
- const col = cols.find((c) => c.key === l.key);
285
- const val = (r) => {
286
- if (col?.sortValue) return col.sortValue(r);
287
- const v = get(r, l.key);
288
- if (v instanceof Date || col && isDateCol(col)) return asDate(v)?.getTime() ?? -Infinity;
289
- return v;
290
- };
291
- return {
292
- val,
293
- d: l.dir === "asc" ? 1 : -1
294
- };
295
- });
296
- list = [...list].sort((a, b) => {
297
- for (const { val, d } of by) {
298
- const x = val(a.r);
299
- const y = val(b.r);
300
- const c = typeof x === "number" && typeof y === "number" ? x - y : String(x).localeCompare(String(y), "zh-Hant");
301
- if (c) return c * d;
302
- }
303
- return a.i - b.i;
304
- });
305
- }
306
336
  const shownKey = `${q}|${valuesKey}|${sumVal}|${view}`;
307
337
  const firstKey = React.useRef(shownKey);
308
338
  const shownN = list.length;
@@ -315,7 +345,11 @@ function DataTable(p) {
315
345
  const pages = Math.max(1, Math.ceil(list.length / pageSize));
316
346
  const pageNow = Math.min(page, pages - 1);
317
347
  const start = pageNow * pageSize;
318
- const vis = list.slice(start, start + pageSize);
348
+ const vis = React.useMemo(() => list.slice(start, start + pageSize), [
349
+ list,
350
+ start,
351
+ pageSize
352
+ ]);
319
353
  const idOf = (x) => {
320
354
  const id = get(x.r, "id");
321
355
  return id != null ? String(id) : String(x.i);
@@ -397,6 +431,9 @@ function DataTable(p) {
397
431
  const ghost = o.node.cloneNode(true);
398
432
  ghost.removeAttribute("data-rid");
399
433
  ghost.setAttribute("aria-hidden", "true");
434
+ ghost.inert = true;
435
+ for (const el of ghost.querySelectorAll("a[href], button, input, select, textarea, [tabindex]")) el.tabIndex = -1;
436
+ for (const el of [ghost, ...ghost.querySelectorAll("[id]")]) el.removeAttribute("id");
400
437
  ghost.classList.add("ui-dt-ghost");
401
438
  ghost.style.top = o.top + "px";
402
439
  ghost.style.backgroundColor = o.bg;
@@ -483,32 +520,32 @@ function DataTable(p) {
483
520
  setPage(0);
484
521
  };
485
522
  const hasAct = !!p.rowActions;
486
- const actW = p.actionsWidth || 88;
523
+ const onerow = onerowState && !narrow;
487
524
  const hasTitle = shownCols.some((c) => c.mobile === "title");
488
525
  const mobileClass = (c, ci) => {
489
526
  const m = c.mobile || (!hasTitle && ci === 0 ? "title" : null);
490
527
  return m ? "is-m-" + m : null;
491
528
  };
492
529
  const longCols = shownCols.filter((c) => c.long || c.fullText);
493
- const expander = longCols.length > 0 && !narrow;
530
+ const expander = longCols.length > 0 && !narrow && (clipped !== false || longCols.some((c) => c.fullText) || visIds.some((id) => opened[id]));
494
531
  const EXP = 40;
495
532
  const mainKey = (shownCols.find((c) => !isShort(c) && !c.long && c.grow !== 0) ?? shownCols[0])?.key;
496
533
  const grows = (c) => c.grow != null ? c.grow > 0 : c.long || c.key === mainKey;
497
534
  const minOf = (c) => {
498
- if (grows(c)) return Math.max(c.width || (isNum(c) ? 96 : 120), fit[c.key] || 0);
499
- const cap = c.width == null && !isShort(c) ? TEXT_HUG_MAX : Infinity;
500
- return Math.max(c.width || 0, 48, Math.min(fit[c.key] ?? c.width ?? HUG_START, cap));
535
+ if (grows(c)) return Math.max(c.width || (isNum(c) ? 96 : 120), fit[c.key] || 0, roomy ? want[c.key] || 0 : 0);
536
+ const text = c.width == null && !isShort(c);
537
+ const cap = text ? TEXT_HUG_MAX : Infinity;
538
+ return Math.max(c.width || 0, 48, text ? TEXT_HUG_MIN : 0, Math.min(fit[c.key] ?? c.width ?? HUG_START, cap));
501
539
  };
502
540
  const layout = (w) => {
503
541
  const colW = (c) => w ? `${w[c.key] ?? minOf(c)}px` : grows(c) ? `minmax(${minOf(c)}px, ${c.grow || 1}fr)` : `${minOf(c)}px`;
504
542
  return {
505
543
  gridTemplateColumns: [
506
544
  expander ? "40px" : null,
507
- selectable ? "46px" : null,
508
- ...shownCols.map(colW),
509
- hasAct ? actW + "px" : null
545
+ selectable ? "40px" : null,
546
+ ...shownCols.map(colW)
510
547
  ].filter(Boolean).join(" "),
511
- minWidth: (expander ? EXP : 0) + (selectable ? 46 : 0) + shownCols.reduce((a, c) => a + (w ? w[c.key] ?? minOf(c) : minOf(c)), 0) + (hasAct ? actW : 0)
548
+ minWidth: (expander ? EXP : 0) + (selectable ? SEL : 0) + shownCols.reduce((a, c) => a + (w ? w[c.key] ?? minOf(c) : minOf(c)), 0)
512
549
  };
513
550
  };
514
551
  const pageGrid = layout(widths);
@@ -529,6 +566,7 @@ function DataTable(p) {
529
566
  React.useLayoutEffect(() => {
530
567
  const root = rootRef.current;
531
568
  if (!root || narrow) return;
569
+ wantRef.current = {};
532
570
  const measure = () => {
533
571
  const need = {};
534
572
  for (const el of root.querySelectorAll(":scope > .ui-dt-scroller .ui-dt-body .ui-dt-cell[data-col]:not(.is-long):not(.is-hug)")) {
@@ -536,22 +574,82 @@ function DataTable(p) {
536
574
  const key = el.dataset.col;
537
575
  if (over > 1 && key) need[key] = Math.max(need[key] ?? 0, Math.ceil(el.getBoundingClientRect().width + over));
538
576
  }
577
+ const pad = (el) => {
578
+ const st = getComputedStyle(el);
579
+ return (parseFloat(st.paddingLeft) || 0) + (parseFloat(st.paddingRight) || 0) + (parseFloat(st.borderRightWidth) || 0);
580
+ };
539
581
  const hugs = root.querySelectorAll(":scope > .ui-dt-scroller .ui-dt-cell.is-hug[data-col]");
540
- if (hugs.length) {
582
+ const growCells = root.querySelectorAll(":scope > .ui-dt-scroller .ui-dt-cell.is-grow[data-col]");
583
+ const asks = {};
584
+ if (hugs.length || growCells.length) {
541
585
  root.classList.add("is-measuring");
542
586
  for (const el of hugs) {
543
587
  const key = el.dataset.col;
544
588
  const w = contentWidth(el.querySelector(":scope > .ui-dt-stack > .ui-dt-main") ?? el);
545
- if (key && w !== null) need[key] = Math.max(need[key] ?? 0, Math.ceil(w + CELL_PAD));
589
+ if (key && w !== null) need[key] = Math.max(need[key] ?? 0, Math.ceil(w + pad(el)));
590
+ }
591
+ for (const el of growCells) {
592
+ const key = el.dataset.col;
593
+ const long = el.querySelector(".ui-dt-long-text");
594
+ const w = long ? long.getBoundingClientRect().width : contentWidth(el.querySelector(":scope > .ui-dt-stack > .ui-dt-main") ?? el);
595
+ if (!key || w === null || !w) continue;
596
+ const max = el.classList.contains("is-long") ? LONG_WANT_MAX : MAIN_WANT_MAX;
597
+ asks[key] = Math.max(asks[key] ?? 0, Math.min(max, Math.ceil(w + pad(el))));
546
598
  }
547
599
  root.classList.remove("is-measuring");
548
600
  }
549
- setFit((f) => {
550
- const grow = Object.entries(need).filter(([k, w]) => w > (f[k] ?? 0));
551
- return grow.length ? {
552
- ...f,
601
+ const next = {};
602
+ const head = root.querySelector(":scope > .ui-dt-scroller .ui-dt-head");
603
+ const scroll = root.querySelector(":scope > .ui-dt-scroller .ui-dt-scroll");
604
+ if (head && scroll && scroll.clientWidth > 0) {
605
+ const before = wantRef.current;
606
+ const more = Object.entries(asks).filter(([k, w]) => w > (before[k] ?? 0));
607
+ const merged = more.length ? {
608
+ ...before,
609
+ ...Object.fromEntries(more)
610
+ } : before;
611
+ wantRef.current = merged;
612
+ if (more.length) next.want = merged;
613
+ let used = 0;
614
+ for (const el of head.children) {
615
+ if (el.classList.contains("ui-dt-exp")) continue;
616
+ const key = el.dataset.col;
617
+ used += key && el.classList.contains("is-grow") ? Math.max(asks[key] ?? 0, merged[key] ?? 0, 48) : el.getBoundingClientRect().width;
618
+ }
619
+ next.roomy = used <= scroll.clientWidth;
620
+ }
621
+ let aw = 0;
622
+ for (const el of root.querySelectorAll(":scope > .ui-dt-scroller .ui-dt-body .ui-dt-acts")) if (el.childElementCount) aw = Math.max(aw, Math.ceil(el.getBoundingClientRect().width));
623
+ if (root.querySelector(":scope > .ui-dt-scroller .ui-dt-body .ui-dt-acts")) next.actsW = aw;
624
+ const tools = root.querySelector(":scope > .ui-dt-tools.has-summary");
625
+ if (tools && tools.clientWidth > 0) {
626
+ const tabs = tools.querySelector(".ui-dt-summary");
627
+ const actions = tools.querySelector(":scope > .ui-dt-actions");
628
+ let need2 = (tabs?.scrollWidth ?? 0) + (tools.querySelector(":scope > .ui-dt-search") ? 256 : TOOL_GAP);
629
+ const parts = actions ? [...actions.children].filter((e) => getComputedStyle(e).position !== "absolute") : [];
630
+ for (const e of parts) {
631
+ const text = e.querySelector(".ui-dt-sortbtn-text");
632
+ need2 += e.getBoundingClientRect().width + (text ? Math.max(0, text.scrollWidth - text.clientWidth) : 0);
633
+ }
634
+ need2 += Math.max(0, parts.length - 1) * TOOL_GAP;
635
+ next.onerow = need2 <= tools.clientWidth;
636
+ }
637
+ const scroller = root.querySelector(":scope > .ui-dt-scroller .ui-dt-scroll");
638
+ if (scroller && scroller.clientWidth > 0) next.clipped = [...root.querySelectorAll(":scope > .ui-dt-scroller .ui-dt-body .ui-dt-long")].some((el) => el.scrollWidth > el.clientWidth + 1);
639
+ setMeasured((m) => {
640
+ const grow = Object.entries(need).filter(([k, w]) => w > (m.fit[k] ?? 0));
641
+ if (grow.length) next.fit = {
642
+ ...m.fit,
553
643
  ...Object.fromEntries(grow)
554
- } : f;
644
+ };
645
+ const aw2 = next.actsW;
646
+ const actsSame = aw2 == null || m.actsW !== null && Math.abs(m.actsW - aw2) <= 1;
647
+ if (!next.fit && !next.want && (next.roomy === void 0 || next.roomy === m.roomy) && actsSame && (next.onerow === void 0 || next.onerow === m.onerow) && (next.clipped === void 0 || next.clipped === m.clipped)) return m;
648
+ return {
649
+ ...m,
650
+ ...next,
651
+ actsW: actsSame ? m.actsW : next.actsW ?? m.actsW
652
+ };
555
653
  });
556
654
  };
557
655
  let frame = 0;
@@ -567,18 +665,39 @@ function DataTable(p) {
567
665
  const mo = new MutationObserver(later);
568
666
  for (const el of root.querySelectorAll(":scope > .ui-dt-scroller .ui-dt-table, :scope > .ui-dt-scroller .ui-dt-body")) mo.observe(el, { childList: true });
569
667
  document.fonts?.ready.then(later).catch(() => {});
668
+ let lastW = -1;
669
+ const ro = resizeObserver((entries) => {
670
+ const w = Math.round(entries[0]?.contentRect.width ?? 0);
671
+ if (w !== lastW && lastW >= 0) later();
672
+ lastW = w;
673
+ });
674
+ ro?.observe(root);
675
+ const probe = root.querySelector(":scope > .ui-dt-probe");
676
+ let probeSize = "";
677
+ const po = probe ? resizeObserver(() => {
678
+ const r = probe.getBoundingClientRect();
679
+ const size = `${Math.round(r.width)}x${Math.round(r.height)}`;
680
+ if (probeSize && size !== probeSize) later();
681
+ probeSize = size;
682
+ }) : null;
683
+ if (probe) po?.observe(probe);
570
684
  return () => {
571
685
  mo.disconnect();
686
+ ro?.disconnect();
687
+ po?.disconnect();
572
688
  cancelAnimationFrame(frame);
573
689
  measureRef.current = () => {};
574
690
  };
575
691
  }, [narrow, resetKey]);
692
+ React.useLayoutEffect(() => {
693
+ measureRef.current();
694
+ }, [actsW]);
576
695
  const contentKey = `${visIds.join("")}|${shownCols.map((c) => c.key).join(",")}|${list.length}|${q}|${!!p.totals}`;
577
696
  React.useLayoutEffect(() => {
578
697
  measureRef.current();
579
698
  }, [contentKey, rows]);
580
- const stickyStyle = (ci) => ci === 0 && sticky ? { left: (expander ? EXP : 0) + (selectable ? 46 : 0) } : void 0;
581
- const cellClass = (c, ci, ...more) => cx("ui-dt-cell", isNum(c) && "is-num", !grows(c) && "is-hug", ci === 0 && sticky && "is-sticky is-sticky-end", ...more);
699
+ const stickyStyle = (ci) => ci === 0 && sticky ? { left: (expander ? EXP : 0) + (selectable ? SEL : 0) } : void 0;
700
+ const cellClass = (c, ci, ...more) => cx("ui-dt-cell", isNum(c) && "is-num", c.mono && "is-mono", grows(c) ? "is-grow" : "is-hug", ci === 0 && sticky && "is-sticky is-sticky-end", ci === shownCols.length - 1 && "is-lastcol", ...more);
582
701
  const lead = (what) => sticky ? {
583
702
  className: "is-sticky",
584
703
  style: { left: what === "sel" && expander ? EXP : 0 }
@@ -588,44 +707,10 @@ function DataTable(p) {
588
707
  };
589
708
  const headOf = (inZoom) => {
590
709
  const gridStyle = inZoom ? zoomGrid : pageGrid;
591
- const minW = gridStyle.minWidth;
592
710
  const w = inZoom ? zoomWidths : widths;
593
711
  const setW = inZoom ? setZoomWidths : setWidths;
594
712
  const root = () => inZoom ? zoomRef.current : rootRef.current;
595
- return selectable && selIds.length && p.bulkActions ? /* @__PURE__ */ jsxs("div", {
596
- className: "ui-dt-row ui-dt-head ui-dt-bulk",
597
- role: "row",
598
- style: { minWidth: minW },
599
- children: [
600
- /* @__PURE__ */ jsx("div", {
601
- className: "ui-dt-cell",
602
- role: "columnheader",
603
- children: /* @__PURE__ */ jsx(RowCheck, {
604
- v: allOn ? true : "mixed",
605
- label: tr("全選"),
606
- onClick: () => toggle(visIds, !allOn)
607
- })
608
- }),
609
- /* @__PURE__ */ jsx("span", {
610
- className: "ui-dt-bulk-count",
611
- children: tr("已選 {n} 筆", { n: selIds.length })
612
- }),
613
- /* @__PURE__ */ jsx("span", {
614
- className: "ui-dt-bulk-actions",
615
- children: p.bulkActions(selIds, clear)
616
- }),
617
- /* @__PURE__ */ jsx("button", {
618
- type: "button",
619
- className: "ui-dt-bulk-close",
620
- "aria-label": tr("取消選取"),
621
- onClick: clear,
622
- children: /* @__PURE__ */ jsx(Icon, {
623
- name: "x",
624
- size: 14
625
- })
626
- })
627
- ]
628
- }) : /* @__PURE__ */ jsxs("div", {
713
+ return /* @__PURE__ */ jsxs("div", {
629
714
  className: "ui-dt-row ui-dt-head",
630
715
  role: "row",
631
716
  style: gridStyle,
@@ -634,7 +719,10 @@ function DataTable(p) {
634
719
  className: cx("ui-dt-cell ui-dt-exp", lead("exp").className),
635
720
  style: lead("exp").style,
636
721
  role: "columnheader",
637
- "aria-label": tr("詳細")
722
+ children: /* @__PURE__ */ jsx("span", {
723
+ className: "ui-visually-hidden",
724
+ children: tr("展開")
725
+ })
638
726
  }) : null,
639
727
  selectable ? /* @__PURE__ */ jsx("div", {
640
728
  className: cx("ui-dt-cell ui-dt-sel", lead("sel").className),
@@ -696,12 +784,7 @@ function DataTable(p) {
696
784
  onReset: () => setW(null)
697
785
  })]
698
786
  }, c.key);
699
- }),
700
- hasAct ? /* @__PURE__ */ jsx("div", {
701
- className: "ui-dt-cell",
702
- role: "columnheader",
703
- "aria-label": tr("操作")
704
- }) : null
787
+ })
705
788
  ]
706
789
  });
707
790
  };
@@ -719,7 +802,11 @@ function DataTable(p) {
719
802
  else if (isDateCol(c) && asDate(raw)) {
720
803
  const d = asDate(raw);
721
804
  const abs = absDate(r, c);
722
- const t = /* @__PURE__ */ jsx("time", {
805
+ const t = c.format === "relative" ? /* @__PURE__ */ jsx(RelativeTime, {
806
+ className: "ui-dt-time",
807
+ value: d,
808
+ children: (text) => markMatch(text, mark)
809
+ }) : /* @__PURE__ */ jsx("time", {
723
810
  className: "ui-dt-time",
724
811
  dateTime: isoOf(d, c.format === "date"),
725
812
  children: markMatch(cellText(c, raw), mark)
@@ -744,6 +831,10 @@ function DataTable(p) {
744
831
  })
745
832
  ]
746
833
  });
834
+ else if (raw === null || raw === void 0 || raw === "") v = /* @__PURE__ */ jsx("span", {
835
+ className: "ui-dt-none",
836
+ children: cellText(c, raw)
837
+ });
747
838
  else v = markMatch(cellText(c, raw), mark);
748
839
  return v;
749
840
  };
@@ -840,7 +931,7 @@ function DataTable(p) {
840
931
  clearTimeout(copiedTimer.current);
841
932
  copiedTimer.current = setTimeout(() => setCopied(false), 2e3);
842
933
  }, () => p.onCopyError?.());
843
- const slash = search !== false && p.searchShortcut !== false;
934
+ const slash = search !== false && p.toolbar !== false && p.searchShortcut !== false;
844
935
  const [slashOwner, setSlashOwner] = React.useState(false);
845
936
  React.useEffect(() => {
846
937
  const el = rootRef.current;
@@ -892,9 +983,35 @@ function DataTable(p) {
892
983
  },
893
984
  filterButton: () => (inZoom ? zoomRef : rootRef).current?.querySelector(".ui-dt-filterbtn") ?? null
894
985
  });
986
+ const summaryView = summary ? /* @__PURE__ */ jsx(Tabs, {
987
+ className: "ui-dt-summary",
988
+ label: summary.label || tr("依狀態篩選"),
989
+ unit: summary.unit || "筆",
990
+ value: sumVal,
991
+ onChange: (v) => {
992
+ capture("sort");
993
+ setSumVal(v);
994
+ setPage(0);
995
+ },
996
+ items: [{
997
+ id: "all",
998
+ label: tr("全部"),
999
+ count: sumAll.length
1000
+ }, ...summary.items.map((it) => ({
1001
+ id: String(it.value),
1002
+ label: it.label,
1003
+ count: sumAll.filter((x) => String(get(x.r, summary.key)) === String(it.value)).length
1004
+ }))],
1005
+ hideUnit: true
1006
+ }) : null;
1007
+ const showCount = list.length !== baseCount;
895
1008
  const toolsView = (inZoom, inHead = false) => /* @__PURE__ */ jsxs("div", {
896
- className: cx("ui-dt-tools", inHead && "is-inhead"),
1009
+ className: cx("ui-dt-tools", inHead && "is-inhead", summaryView && !inZoom && !inHead && "has-summary", onerow && !inZoom && !inHead && "is-onerow"),
897
1010
  children: [
1011
+ summaryView && !inZoom && !inHead ? /* @__PURE__ */ jsx("div", {
1012
+ className: "ui-dt-sumwrap",
1013
+ children: summaryView
1014
+ }) : null,
898
1015
  search === false && p.caption && !inZoom && !inHead ? /* @__PURE__ */ jsx("div", {
899
1016
  className: "ui-dt-caption",
900
1017
  children: p.caption
@@ -934,7 +1051,7 @@ function DataTable(p) {
934
1051
  setPage(0);
935
1052
  }
936
1053
  }) : null,
937
- /* @__PURE__ */ jsxs("span", {
1054
+ showCount ? /* @__PURE__ */ jsxs("span", {
938
1055
  className: "ui-dt-result",
939
1056
  children: [/* @__PURE__ */ jsx("span", {
940
1057
  "aria-hidden": "true",
@@ -946,7 +1063,7 @@ function DataTable(p) {
946
1063
  className: "ui-visually-hidden",
947
1064
  children: format.fractionLabel(list.length, baseCount, tr("筆"))
948
1065
  })]
949
- }),
1066
+ }) : null,
950
1067
  sortCols.length ? /* @__PURE__ */ jsx(SortButton, {
951
1068
  cols: sortCols,
952
1069
  levels: sort,
@@ -972,6 +1089,10 @@ function DataTable(p) {
972
1089
  onCopy: p.copy !== false ? doCopy : void 0,
973
1090
  onZoom: p.zoom !== false && !inZoom ? () => setZoomed(true) : void 0
974
1091
  }),
1092
+ p.action && !inZoom ? /* @__PURE__ */ jsx("div", {
1093
+ className: "ui-dt-primary",
1094
+ children: p.action
1095
+ }) : null,
975
1096
  copied && !narrow ? /* @__PURE__ */ jsxs("span", {
976
1097
  className: "ui-dt-copied",
977
1098
  "aria-hidden": "true",
@@ -984,6 +1105,31 @@ function DataTable(p) {
984
1105
  })
985
1106
  ]
986
1107
  });
1108
+ const bulkView = selectable && selIds.length && p.bulkActions ? /* @__PURE__ */ jsxs("div", {
1109
+ className: "ui-dt-bulk",
1110
+ role: "toolbar",
1111
+ "aria-label": tr("已選 {n} 筆", { n: selIds.length }),
1112
+ children: [
1113
+ /* @__PURE__ */ jsx("span", {
1114
+ className: "ui-dt-bulk-count",
1115
+ children: monoNums(tr("已選 {n} 筆", { n: "" }), [format.number(selIds.length)])
1116
+ }),
1117
+ /* @__PURE__ */ jsx("span", {
1118
+ className: "ui-dt-bulk-actions",
1119
+ children: p.bulkActions(selIds, clear)
1120
+ }),
1121
+ /* @__PURE__ */ jsx("button", {
1122
+ type: "button",
1123
+ className: "ui-dt-bulk-close",
1124
+ "aria-label": tr("取消選取"),
1125
+ onClick: clear,
1126
+ children: /* @__PURE__ */ jsx(Icon, {
1127
+ name: "x",
1128
+ size: 16
1129
+ })
1130
+ })
1131
+ ]
1132
+ }) : null;
987
1133
  const tableView = (inZoom) => {
988
1134
  const grid = inZoom ? zoomGrid : pageGrid;
989
1135
  const pfx = inZoom ? uid + "z" : uid;
@@ -1016,7 +1162,7 @@ function DataTable(p) {
1016
1162
  },
1017
1163
  role: "row",
1018
1164
  "aria-labelledby": shownCols.length ? `${pfx}-n-${start + i}` : void 0,
1019
- className: cx("ui-dt-row", i % 2 && "is-even", on && "is-selected", selectable && "has-sel", expander && !p.rowHref && "has-exp", p.rowHref && "has-href"),
1165
+ className: cx("ui-dt-row", i % 2 && "is-even", hasAct && "has-acts", on && "is-selected", selectable && "has-sel", expander && !p.rowHref && "has-exp", p.rowHref && "has-href"),
1020
1166
  style: grid,
1021
1167
  onClick: expander || p.rowHref ? (e) => {
1022
1168
  if (!rowClick(e)) return;
@@ -1066,7 +1212,7 @@ function DataTable(p) {
1066
1212
  shownCols.map((c, ci) => /* @__PURE__ */ jsx("div", {
1067
1213
  role: "cell",
1068
1214
  id: ci === 0 ? `${pfx}-n-${start + i}` : void 0,
1069
- "aria-description": [c.fullText?.(x.r), absDate(x.r, c)].filter(Boolean).join(",") || void 0,
1215
+ "aria-description": [c.fullText?.(x.r), absDate(x.r, c)].filter(Boolean).join(tr(",")) || void 0,
1070
1216
  "data-label": c.label,
1071
1217
  "data-col": c.key,
1072
1218
  className: cellClass(c, ci, c.long && "is-long", mobileClass(c, ci)),
@@ -1087,7 +1233,7 @@ function DataTable(p) {
1087
1233
  children: /* @__PURE__ */ jsx("div", {
1088
1234
  role: "cell",
1089
1235
  className: "ui-dt-detail-cell",
1090
- style: { paddingLeft: EXP + (selectable ? 46 : 0) + 12 },
1236
+ style: { paddingLeft: EXP + (selectable ? SEL : 0) + 12 },
1091
1237
  children: longCols.map((c) => /* @__PURE__ */ jsxs("div", {
1092
1238
  className: "ui-dt-detail-item",
1093
1239
  children: [/* @__PURE__ */ jsx("div", {
@@ -1100,12 +1246,17 @@ function DataTable(p) {
1100
1246
  }, c.key))
1101
1247
  })
1102
1248
  }) : null] }, id);
1103
- }) : /* @__PURE__ */ jsxs("div", {
1104
- className: "ui-dt-empty",
1105
- children: [p.emptyText || tr("沒有符合的資料"), q || activeN ? /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, {
1106
- onClick: clearFilters,
1107
- children: tr("清除篩選")
1108
- }) }) : null]
1249
+ }) : /* @__PURE__ */ jsx("div", {
1250
+ className: "ui-dt-emptyrow",
1251
+ role: "row",
1252
+ children: /* @__PURE__ */ jsxs("div", {
1253
+ className: "ui-dt-empty",
1254
+ role: "cell",
1255
+ children: [p.emptyText || tr("沒有符合的資料"), q || activeN ? /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Button, {
1256
+ onClick: clearFilters,
1257
+ children: tr("清除篩選")
1258
+ }) }) : null]
1259
+ })
1109
1260
  })
1110
1261
  }),
1111
1262
  p.totals && list.length ? /* @__PURE__ */ jsxs("div", {
@@ -1114,12 +1265,12 @@ function DataTable(p) {
1114
1265
  style: grid,
1115
1266
  children: [
1116
1267
  expander ? /* @__PURE__ */ jsx("div", {
1117
- className: cx("ui-dt-cell", lead("exp").className),
1268
+ className: cx("ui-dt-cell ui-dt-exp", lead("exp").className),
1118
1269
  style: lead("exp").style,
1119
1270
  role: "cell"
1120
1271
  }) : null,
1121
1272
  selectable ? /* @__PURE__ */ jsx("div", {
1122
- className: cx("ui-dt-cell", lead("sel").className),
1273
+ className: cx("ui-dt-cell ui-dt-sel", lead("sel").className),
1123
1274
  style: lead("sel").style,
1124
1275
  role: "cell"
1125
1276
  }) : null,
@@ -1130,11 +1281,7 @@ function DataTable(p) {
1130
1281
  "data-col": c.key,
1131
1282
  "data-label": ci > 0 && p.totals?.[c.key] ? c.label : void 0,
1132
1283
  children: total(c, ci)
1133
- }, c.key)),
1134
- hasAct ? /* @__PURE__ */ jsx("div", {
1135
- className: "ui-dt-cell",
1136
- role: "cell"
1137
- }) : null
1284
+ }, c.key))
1138
1285
  ]
1139
1286
  }) : null
1140
1287
  ]
@@ -1187,7 +1334,8 @@ function DataTable(p) {
1187
1334
  }) : null });
1188
1335
  return /* @__PURE__ */ jsxs("div", {
1189
1336
  ref: rootRef,
1190
- className: cx("ui-dt", search === false && "is-nosearch", selIds.length && "has-sel", p.className),
1337
+ className: cx("ui-dt", search === false && "is-nosearch", selIds.length && "has-sel", hasAct && "has-acts", p.className),
1338
+ style: hasAct ? { "--dt-acts-w": (p.actionsWidth ?? actsW ?? 72) + "px" } : void 0,
1191
1339
  children: [
1192
1340
  p.caption && search !== false ? /* @__PURE__ */ jsx("div", {
1193
1341
  className: "ui-dt-caption",
@@ -1209,42 +1357,31 @@ function DataTable(p) {
1209
1357
  setView(v.id);
1210
1358
  setPage(0);
1211
1359
  },
1212
- children: [v.label, /* @__PURE__ */ jsxs("span", {
1213
- className: "ui-dt-view-n",
1214
- children: [
1215
- format.number(vn),
1216
- " ",
1217
- /* @__PURE__ */ jsx("span", {
1218
- className: "ui-unit",
1219
- children: unitFor("筆", vn)
1220
- })
1221
- ]
1222
- })]
1360
+ children: [
1361
+ v.label,
1362
+ " ",
1363
+ /* @__PURE__ */ jsxs("span", {
1364
+ className: "ui-dt-view-n",
1365
+ children: [format.number(vn), /* @__PURE__ */ jsxs("span", {
1366
+ className: "ui-visually-hidden",
1367
+ children: [" ", unitFor("筆", vn)]
1368
+ })]
1369
+ })
1370
+ ]
1223
1371
  }, v.id);
1224
1372
  })
1225
1373
  }) : null,
1226
- summary ? /* @__PURE__ */ jsx(Tabs, {
1227
- className: "ui-dt-summary",
1228
- label: summary.label || tr("依狀態篩選"),
1229
- unit: summary.unit || "筆",
1230
- value: sumVal,
1231
- onChange: (v) => {
1232
- capture("sort");
1233
- setSumVal(v);
1234
- setPage(0);
1235
- },
1236
- items: [{
1237
- id: "all",
1238
- label: tr("全部"),
1239
- count: sumAll.length
1240
- }, ...summary.items.map((it) => ({
1241
- id: String(it.value),
1242
- label: it.label,
1243
- count: sumAll.filter((x) => String(get(x.r, summary.key)) === String(it.value)).length
1244
- }))]
1374
+ /* @__PURE__ */ jsx("span", {
1375
+ className: "ui-dt-probe",
1376
+ "aria-hidden": "true"
1377
+ }),
1378
+ summaryView && (headSlot || p.toolbar === false) ? /* @__PURE__ */ jsx("div", {
1379
+ className: "ui-dt-top",
1380
+ children: summaryView
1245
1381
  }) : null,
1246
- headSlot ? createPortal(toolsView(false, true), headSlot) : toolsView(false),
1382
+ p.toolbar === false ? null : headSlot ? createPortal(toolsView(false, true), headSlot) : toolsView(false),
1247
1383
  chipsView(false),
1384
+ bulkView,
1248
1385
  tableView(false),
1249
1386
  /* @__PURE__ */ jsx(ScrollHint, {
1250
1387
  show: overflows,
@@ -1259,8 +1396,9 @@ function DataTable(p) {
1259
1396
  ref: zoomRef,
1260
1397
  className: "ui-dt ui-dt-zoomed",
1261
1398
  children: [
1262
- toolsView(true),
1399
+ p.toolbar === false ? null : toolsView(true),
1263
1400
  chipsView(true),
1401
+ bulkView,
1264
1402
  tableView(true),
1265
1403
  footView
1266
1404
  ]