zabi-components 8.0.0 → 9.0.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 (456) hide show
  1. package/CHANGELOG.md +2935 -0
  2. package/README.md +243 -10
  3. package/THEME.md +162 -332
  4. package/THEMING.md +1419 -259
  5. package/dist/atoms/ActionPanel.svelte +15 -5
  6. package/dist/atoms/Avatar.svelte +120 -0
  7. package/dist/atoms/Avatar.svelte.d.ts +46 -0
  8. package/dist/atoms/Badge.svelte +71 -13
  9. package/dist/atoms/Badge.svelte.d.ts +8 -2
  10. package/dist/atoms/Block.svelte +74 -0
  11. package/dist/atoms/Block.svelte.d.ts +29 -0
  12. package/dist/atoms/Button.svelte +217 -30
  13. package/dist/atoms/Button.svelte.d.ts +33 -4
  14. package/dist/atoms/Card.svelte +182 -26
  15. package/dist/atoms/Card.svelte.d.ts +55 -3
  16. package/dist/atoms/CardHeader.svelte +16 -4
  17. package/dist/atoms/Checkbox.svelte +81 -21
  18. package/dist/atoms/Checkbox.svelte.d.ts +31 -2
  19. package/dist/atoms/Chip.svelte +351 -0
  20. package/dist/atoms/Chip.svelte.d.ts +57 -0
  21. package/dist/atoms/CodeBlock.svelte +20 -2
  22. package/dist/atoms/CodeBlock.svelte.d.ts +4 -0
  23. package/dist/atoms/CodeField.svelte +385 -0
  24. package/dist/atoms/CodeField.svelte.d.ts +61 -0
  25. package/dist/atoms/ColorPicker.svelte +260 -49
  26. package/dist/atoms/ColorPicker.svelte.d.ts +3 -0
  27. package/dist/atoms/Container.svelte +16 -8
  28. package/dist/atoms/DateField.svelte +145 -0
  29. package/dist/atoms/DateField.svelte.d.ts +81 -0
  30. package/dist/atoms/FieldMessages.svelte +69 -0
  31. package/dist/atoms/FieldMessages.svelte.d.ts +23 -0
  32. package/dist/atoms/FloatingActionButton.svelte +176 -0
  33. package/dist/atoms/FloatingActionButton.svelte.d.ts +51 -0
  34. package/dist/atoms/Heading.svelte +63 -5
  35. package/dist/atoms/Heading.svelte.d.ts +14 -0
  36. package/dist/atoms/IconButton.svelte +294 -26
  37. package/dist/atoms/IconButton.svelte.d.ts +62 -4
  38. package/dist/atoms/Input.svelte +259 -53
  39. package/dist/atoms/Input.svelte.d.ts +33 -2
  40. package/dist/atoms/List.svelte +5 -1
  41. package/dist/atoms/ListItem.svelte +70 -13
  42. package/dist/atoms/ListItem.svelte.d.ts +11 -0
  43. package/dist/atoms/PickerField.svelte +239 -0
  44. package/dist/atoms/PickerField.svelte.d.ts +67 -0
  45. package/dist/atoms/Progress.svelte +99 -19
  46. package/dist/atoms/Progress.svelte.d.ts +15 -1
  47. package/dist/atoms/Radio.svelte +51 -3
  48. package/dist/atoms/Radio.svelte.d.ts +30 -2
  49. package/dist/atoms/Rating.svelte +620 -0
  50. package/dist/atoms/Rating.svelte.d.ts +77 -0
  51. package/dist/atoms/Select.svelte +438 -98
  52. package/dist/atoms/Select.svelte.d.ts +61 -3
  53. package/dist/atoms/SelectionControl.svelte +193 -23
  54. package/dist/atoms/SelectionControl.svelte.d.ts +29 -3
  55. package/dist/atoms/Skeleton.svelte +114 -18
  56. package/dist/atoms/Skeleton.svelte.d.ts +30 -3
  57. package/dist/atoms/SkeletonGroup.svelte +43 -0
  58. package/dist/atoms/SkeletonGroup.svelte.d.ts +20 -0
  59. package/dist/atoms/Slider.svelte +344 -0
  60. package/dist/atoms/Slider.svelte.d.ts +40 -0
  61. package/dist/atoms/Sparkline.svelte +109 -0
  62. package/dist/atoms/Sparkline.svelte.d.ts +27 -0
  63. package/dist/atoms/SpeechBubble.svelte +187 -0
  64. package/dist/atoms/SpeechBubble.svelte.d.ts +33 -0
  65. package/dist/atoms/Spinner.svelte +57 -0
  66. package/dist/atoms/Spinner.svelte.d.ts +19 -0
  67. package/dist/atoms/Stat.svelte +72 -0
  68. package/dist/atoms/Stat.svelte.d.ts +19 -0
  69. package/dist/atoms/Table.svelte +151 -6
  70. package/dist/atoms/Table.svelte.d.ts +15 -3
  71. package/dist/atoms/TemporalField.svelte +472 -0
  72. package/dist/atoms/TemporalField.svelte.d.ts +48 -0
  73. package/dist/atoms/Text.svelte +23 -11
  74. package/dist/atoms/Text.svelte.d.ts +6 -3
  75. package/dist/atoms/Textarea.svelte +150 -44
  76. package/dist/atoms/Textarea.svelte.d.ts +35 -2
  77. package/dist/atoms/ThemeToggle.svelte +223 -44
  78. package/dist/atoms/ThemeToggle.svelte.d.ts +26 -3
  79. package/dist/atoms/TimeColumn.svelte +150 -0
  80. package/dist/atoms/TimeColumn.svelte.d.ts +25 -0
  81. package/dist/atoms/TimeField.svelte +151 -0
  82. package/dist/atoms/TimeField.svelte.d.ts +85 -0
  83. package/dist/atoms/Toast.svelte +22 -8
  84. package/dist/atoms/Toast.svelte.d.ts +2 -0
  85. package/dist/atoms/Toggle.svelte +98 -14
  86. package/dist/atoms/Toggle.svelte.d.ts +26 -2
  87. package/dist/atoms/Tooltip.svelte +528 -24
  88. package/dist/atoms/Tooltip.svelte.d.ts +18 -0
  89. package/dist/atoms/ZabiStringsProvider.svelte +45 -0
  90. package/dist/atoms/ZabiStringsProvider.svelte.d.ts +27 -0
  91. package/dist/atoms/index.d.ts +38 -0
  92. package/dist/atoms/index.js +29 -0
  93. package/dist/atoms/selection-control.styles.d.ts +47 -5
  94. package/dist/atoms/selection-control.styles.js +52 -10
  95. package/dist/components/atoms/index.d.ts +38 -0
  96. package/dist/components/atoms/index.d.ts.map +1 -1
  97. package/dist/components/atoms/selection-control.styles.d.ts +47 -5
  98. package/dist/components/atoms/selection-control.styles.d.ts.map +1 -1
  99. package/dist/components/index.d.ts +104 -2
  100. package/dist/components/index.d.ts.map +1 -1
  101. package/dist/components/map.d.ts +11 -0
  102. package/dist/components/map.d.ts.map +1 -0
  103. package/dist/components/molecules/index.d.ts +51 -0
  104. package/dist/components/molecules/index.d.ts.map +1 -1
  105. package/dist/components/molecules/toast-store.d.ts +83 -7
  106. package/dist/components/molecules/toast-store.d.ts.map +1 -1
  107. package/dist/components/organisms/index.d.ts +10 -0
  108. package/dist/components/organisms/index.d.ts.map +1 -1
  109. package/dist/components/types/variants.d.ts +24 -1
  110. package/dist/components/types/variants.d.ts.map +1 -1
  111. package/dist/components/util/app-shell.d.ts +79 -0
  112. package/dist/components/util/app-shell.d.ts.map +1 -0
  113. package/dist/components/util/avatar.d.ts +39 -0
  114. package/dist/components/util/avatar.d.ts.map +1 -0
  115. package/dist/components/util/bottom-sheet.d.ts +30 -0
  116. package/dist/components/util/bottom-sheet.d.ts.map +1 -0
  117. package/dist/components/util/bottom-tab-bar.d.ts +41 -0
  118. package/dist/components/util/bottom-tab-bar.d.ts.map +1 -0
  119. package/dist/components/util/calendar.d.ts +56 -0
  120. package/dist/components/util/calendar.d.ts.map +1 -0
  121. package/dist/components/util/chart.d.ts +140 -0
  122. package/dist/components/util/chart.d.ts.map +1 -0
  123. package/dist/components/util/chip.d.ts +66 -0
  124. package/dist/components/util/chip.d.ts.map +1 -0
  125. package/dist/components/util/cn.d.ts.map +1 -1
  126. package/dist/components/util/code-field.d.ts +63 -0
  127. package/dist/components/util/code-field.d.ts.map +1 -0
  128. package/dist/components/util/collapsible.d.ts +64 -0
  129. package/dist/components/util/collapsible.d.ts.map +1 -0
  130. package/dist/components/util/confirm-dialog.d.ts +12 -0
  131. package/dist/components/util/confirm-dialog.d.ts.map +1 -0
  132. package/dist/components/util/date.d.ts +96 -0
  133. package/dist/components/util/date.d.ts.map +1 -0
  134. package/dist/components/util/display-voice.d.ts +10 -0
  135. package/dist/components/util/display-voice.d.ts.map +1 -0
  136. package/dist/components/util/drawer.d.ts +13 -0
  137. package/dist/components/util/drawer.d.ts.map +1 -0
  138. package/dist/components/util/dropdown.d.ts +47 -0
  139. package/dist/components/util/dropdown.d.ts.map +1 -0
  140. package/dist/components/util/field-control.d.ts +30 -0
  141. package/dist/components/util/field-control.d.ts.map +1 -0
  142. package/dist/components/util/field.d.ts +45 -0
  143. package/dist/components/util/field.d.ts.map +1 -0
  144. package/dist/components/util/fit-in-viewport.d.ts +201 -0
  145. package/dist/components/util/fit-in-viewport.d.ts.map +1 -0
  146. package/dist/components/util/focus-utils.d.ts +77 -2
  147. package/dist/components/util/focus-utils.d.ts.map +1 -1
  148. package/dist/components/util/hydration.d.ts +45 -0
  149. package/dist/components/util/hydration.d.ts.map +1 -0
  150. package/dist/components/util/keyboard-inset.d.ts +18 -0
  151. package/dist/components/util/keyboard-inset.d.ts.map +1 -0
  152. package/dist/components/util/map-view.d.ts +144 -0
  153. package/dist/components/util/map-view.d.ts.map +1 -0
  154. package/dist/components/util/media-grid.d.ts +51 -0
  155. package/dist/components/util/media-grid.d.ts.map +1 -0
  156. package/dist/components/util/media.d.ts +6 -0
  157. package/dist/components/util/media.d.ts.map +1 -0
  158. package/dist/components/util/overlay-chrome.d.ts +53 -0
  159. package/dist/components/util/overlay-chrome.d.ts.map +1 -0
  160. package/dist/components/util/overlay.d.ts +72 -0
  161. package/dist/components/util/overlay.d.ts.map +1 -0
  162. package/dist/components/util/photo.d.ts +234 -0
  163. package/dist/components/util/photo.d.ts.map +1 -0
  164. package/dist/components/util/portal.d.ts +23 -0
  165. package/dist/components/util/portal.d.ts.map +1 -0
  166. package/dist/components/util/progress.d.ts +19 -0
  167. package/dist/components/util/progress.d.ts.map +1 -0
  168. package/dist/components/util/pull-to-refresh.d.ts +27 -0
  169. package/dist/components/util/pull-to-refresh.d.ts.map +1 -0
  170. package/dist/components/util/radio-keys.d.ts +25 -0
  171. package/dist/components/util/radio-keys.d.ts.map +1 -0
  172. package/dist/components/util/rating.d.ts +23 -0
  173. package/dist/components/util/rating.d.ts.map +1 -0
  174. package/dist/components/util/ready-made-strings.d.ts +77 -0
  175. package/dist/components/util/ready-made-strings.d.ts.map +1 -0
  176. package/dist/components/util/scroll-edge.d.ts +33 -0
  177. package/dist/components/util/scroll-edge.d.ts.map +1 -0
  178. package/dist/components/util/scroll-padding.d.ts +20 -0
  179. package/dist/components/util/scroll-padding.d.ts.map +1 -0
  180. package/dist/components/util/segmented-control.d.ts +16 -0
  181. package/dist/components/util/segmented-control.d.ts.map +1 -0
  182. package/dist/components/util/select.d.ts +41 -0
  183. package/dist/components/util/select.d.ts.map +1 -0
  184. package/dist/components/util/sheet-drag.d.ts +84 -0
  185. package/dist/components/util/sheet-drag.d.ts.map +1 -0
  186. package/dist/components/util/sidebar.d.ts +63 -0
  187. package/dist/components/util/sidebar.d.ts.map +1 -0
  188. package/dist/components/util/skeleton.d.ts +15 -0
  189. package/dist/components/util/skeleton.d.ts.map +1 -0
  190. package/dist/components/util/sliding-indicator.d.ts +25 -0
  191. package/dist/components/util/sliding-indicator.d.ts.map +1 -0
  192. package/dist/components/util/sortable-list.d.ts +65 -0
  193. package/dist/components/util/sortable-list.d.ts.map +1 -0
  194. package/dist/components/util/stepper.d.ts +40 -0
  195. package/dist/components/util/stepper.d.ts.map +1 -0
  196. package/dist/components/util/swipeable-list-item.d.ts +36 -0
  197. package/dist/components/util/swipeable-list-item.d.ts.map +1 -0
  198. package/dist/components/util/temporal-field.d.ts +89 -0
  199. package/dist/components/util/temporal-field.d.ts.map +1 -0
  200. package/dist/components/util/theme-mode.d.ts +80 -0
  201. package/dist/components/util/theme-mode.d.ts.map +1 -0
  202. package/dist/components/util/toaster.d.ts +133 -0
  203. package/dist/components/util/toaster.d.ts.map +1 -0
  204. package/dist/components/util/tone-surface.d.ts +34 -0
  205. package/dist/components/util/tone-surface.d.ts.map +1 -0
  206. package/dist/components/util/tooltip.d.ts +10 -0
  207. package/dist/components/util/tooltip.d.ts.map +1 -0
  208. package/dist/components/util/top-navbar.d.ts +35 -0
  209. package/dist/components/util/top-navbar.d.ts.map +1 -0
  210. package/dist/components/util/touch-target.d.ts +31 -0
  211. package/dist/components/util/touch-target.d.ts.map +1 -0
  212. package/dist/components/util/zabi-strings.d.ts +142 -0
  213. package/dist/components/util/zabi-strings.d.ts.map +1 -0
  214. package/dist/create-theme/cli.js +173 -0
  215. package/dist/create-theme/index.d.ts +190 -0
  216. package/dist/create-theme/index.js +1034 -0
  217. package/dist/create-theme/lib/ramp-math.js +128 -0
  218. package/dist/create-theme/lib/resolve.js +238 -0
  219. package/dist/create-theme/theme-data.js +2644 -0
  220. package/dist/index.d.ts +104 -2
  221. package/dist/index.js +75 -2
  222. package/dist/map.d.ts +10 -0
  223. package/dist/map.js +9 -0
  224. package/dist/molecules/Alert.svelte +63 -16
  225. package/dist/molecules/Alert.svelte.d.ts +14 -1
  226. package/dist/molecules/AppBar.svelte +674 -0
  227. package/dist/molecules/AppBar.svelte.d.ts +131 -0
  228. package/dist/molecules/AvatarGroup.svelte +116 -0
  229. package/dist/molecules/AvatarGroup.svelte.d.ts +40 -0
  230. package/dist/molecules/BarChart.svelte +381 -0
  231. package/dist/molecules/BarChart.svelte.d.ts +45 -0
  232. package/dist/molecules/BottomSheet.svelte +608 -0
  233. package/dist/molecules/BottomSheet.svelte.d.ts +109 -0
  234. package/dist/molecules/BottomTabBar.svelte +403 -0
  235. package/dist/molecules/BottomTabBar.svelte.d.ts +98 -0
  236. package/dist/molecules/Calendar.svelte +597 -0
  237. package/dist/molecules/Calendar.svelte.d.ts +72 -0
  238. package/dist/molecules/ChipGroup.svelte +325 -0
  239. package/dist/molecules/ChipGroup.svelte.d.ts +41 -0
  240. package/dist/molecules/Collapsible.svelte +347 -0
  241. package/dist/molecules/Collapsible.svelte.d.ts +61 -0
  242. package/dist/molecules/CollapsibleGroup.svelte +136 -0
  243. package/dist/molecules/CollapsibleGroup.svelte.d.ts +14 -0
  244. package/dist/molecules/ComponentDemo.svelte +16 -4
  245. package/dist/molecules/ComponentDemo.svelte.d.ts +3 -0
  246. package/dist/molecules/ConfirmDialog.svelte +257 -0
  247. package/dist/molecules/ConfirmDialog.svelte.d.ts +58 -0
  248. package/dist/molecules/ContactForm.svelte +34 -17
  249. package/dist/molecules/ContactForm.svelte.d.ts +8 -0
  250. package/dist/molecules/Drawer.svelte +415 -0
  251. package/dist/molecules/Drawer.svelte.d.ts +55 -0
  252. package/dist/molecules/Dropdown.svelte +517 -48
  253. package/dist/molecules/Dropdown.svelte.d.ts +47 -6
  254. package/dist/molecules/DropdownItem.svelte +122 -0
  255. package/dist/molecules/DropdownItem.svelte.d.ts +28 -0
  256. package/dist/molecules/EmptyState.svelte +55 -10
  257. package/dist/molecules/EmptyState.svelte.d.ts +8 -0
  258. package/dist/molecules/FormField.svelte +9 -1
  259. package/dist/molecules/FormField.svelte.d.ts +2 -0
  260. package/dist/molecules/Header.svelte +1 -1
  261. package/dist/molecules/ImageUpload.svelte +492 -69
  262. package/dist/molecules/ImageUpload.svelte.d.ts +82 -2
  263. package/dist/molecules/LineChart.svelte +459 -0
  264. package/dist/molecules/LineChart.svelte.d.ts +53 -0
  265. package/dist/molecules/MapView.svelte +565 -0
  266. package/dist/molecules/MapView.svelte.d.ts +88 -0
  267. package/dist/molecules/MediaGrid.svelte +527 -0
  268. package/dist/molecules/MediaGrid.svelte.d.ts +77 -0
  269. package/dist/molecules/Modal.svelte +293 -72
  270. package/dist/molecules/Modal.svelte.d.ts +51 -2
  271. package/dist/molecules/NavigationMenuContent.svelte +58 -1
  272. package/dist/molecules/NavigationMenuItem.svelte +0 -1
  273. package/dist/molecules/NavigationMenuLink.svelte +1 -1
  274. package/dist/molecules/NavigationMenuList.svelte +10 -3
  275. package/dist/molecules/NavigationMenuTrigger.svelte +2 -2
  276. package/dist/molecules/Page.svelte +32 -2
  277. package/dist/molecules/Page.svelte.d.ts +11 -0
  278. package/dist/molecules/PhotoGrid.svelte +523 -0
  279. package/dist/molecules/PhotoGrid.svelte.d.ts +73 -0
  280. package/dist/molecules/PhotoViewer.svelte +1213 -0
  281. package/dist/molecules/PhotoViewer.svelte.d.ts +74 -0
  282. package/dist/molecules/PieChart.svelte +421 -0
  283. package/dist/molecules/PieChart.svelte.d.ts +51 -0
  284. package/dist/molecules/PropsTable.svelte +22 -10
  285. package/dist/molecules/PropsTable.svelte.d.ts +3 -0
  286. package/dist/molecules/PullToRefresh.svelte +263 -0
  287. package/dist/molecules/PullToRefresh.svelte.d.ts +52 -0
  288. package/dist/molecules/RadioGroup.svelte +72 -18
  289. package/dist/molecules/RadioGroup.svelte.d.ts +19 -3
  290. package/dist/molecules/Section.svelte +1 -1
  291. package/dist/molecules/SegmentedControl.svelte +456 -0
  292. package/dist/molecules/SegmentedControl.svelte.d.ts +40 -0
  293. package/dist/molecules/SidebarBrandHeader.svelte +11 -1
  294. package/dist/molecules/SidebarBrandHeader.svelte.d.ts +3 -0
  295. package/dist/molecules/SidebarFooter.svelte +30 -7
  296. package/dist/molecules/SidebarFooter.svelte.d.ts +3 -0
  297. package/dist/molecules/SidebarNavSection.svelte +1 -1
  298. package/dist/molecules/SlideUp.svelte +220 -61
  299. package/dist/molecules/SlideUp.svelte.d.ts +26 -0
  300. package/dist/molecules/SortableList.svelte +633 -0
  301. package/dist/molecules/SortableList.svelte.d.ts +69 -0
  302. package/dist/molecules/Stepper.svelte +562 -0
  303. package/dist/molecules/Stepper.svelte.d.ts +39 -0
  304. package/dist/molecules/StickyActionBar.svelte +250 -0
  305. package/dist/molecules/StickyActionBar.svelte.d.ts +78 -0
  306. package/dist/molecules/SwipeableListItem.svelte +334 -0
  307. package/dist/molecules/SwipeableListItem.svelte.d.ts +54 -0
  308. package/dist/molecules/Tabs.svelte +310 -9
  309. package/dist/molecules/Tabs.svelte.d.ts +7 -0
  310. package/dist/molecules/Toaster.svelte +514 -5
  311. package/dist/molecules/Toaster.svelte.d.ts +153 -2
  312. package/dist/molecules/ToasterToast.svelte +495 -77
  313. package/dist/molecules/ToasterToast.svelte.d.ts +15 -0
  314. package/dist/molecules/UnsavedChangesBar.svelte +223 -0
  315. package/dist/molecules/UnsavedChangesBar.svelte.d.ts +43 -0
  316. package/dist/molecules/index.d.ts +51 -0
  317. package/dist/molecules/index.js +31 -0
  318. package/dist/molecules/toast-store.d.ts +83 -7
  319. package/dist/molecules/toast-store.js +25 -1
  320. package/dist/organisms/AppNavigation.svelte +440 -0
  321. package/dist/organisms/AppNavigation.svelte.d.ts +72 -0
  322. package/dist/organisms/AppShell.svelte +696 -0
  323. package/dist/organisms/AppShell.svelte.d.ts +157 -0
  324. package/dist/organisms/AppShellHeaderPart.svelte +163 -0
  325. package/dist/organisms/AppShellHeaderPart.svelte.d.ts +57 -0
  326. package/dist/organisms/SidebarAccountPanel.svelte +107 -12
  327. package/dist/organisms/SidebarAccountPanel.svelte.d.ts +19 -0
  328. package/dist/organisms/SidebarNavigation.svelte +111 -43
  329. package/dist/organisms/SidebarNavigation.svelte.d.ts +29 -1
  330. package/dist/organisms/SidebarPanel.svelte +34 -17
  331. package/dist/organisms/SidebarPanel.svelte.d.ts +1 -0
  332. package/dist/organisms/SidebarShell.svelte +164 -14
  333. package/dist/organisms/SidebarShell.svelte.d.ts +56 -2
  334. package/dist/organisms/TopNavbar.svelte +353 -39
  335. package/dist/organisms/TopNavbar.svelte.d.ts +47 -0
  336. package/dist/organisms/TopNavbarSheetContent.svelte +145 -0
  337. package/dist/organisms/TopNavbarSheetContent.svelte.d.ts +24 -0
  338. package/dist/organisms/index.d.ts +10 -0
  339. package/dist/organisms/index.js +7 -0
  340. package/dist/types/components.d.ts +21 -1
  341. package/dist/types/components.d.ts.map +1 -1
  342. package/dist/types/index.d.ts +1093 -26
  343. package/dist/types/index.d.ts.map +1 -1
  344. package/dist/types/variants.ts +28 -1
  345. package/dist/util/app-shell.d.ts +78 -0
  346. package/dist/util/app-shell.js +97 -0
  347. package/dist/util/avatar.d.ts +38 -0
  348. package/dist/util/avatar.js +52 -0
  349. package/dist/util/bottom-sheet.d.ts +29 -0
  350. package/dist/util/bottom-sheet.js +43 -0
  351. package/dist/util/bottom-tab-bar.d.ts +40 -0
  352. package/dist/util/bottom-tab-bar.js +54 -0
  353. package/dist/util/calendar.d.ts +55 -0
  354. package/dist/util/calendar.js +74 -0
  355. package/dist/util/chart.d.ts +139 -0
  356. package/dist/util/chart.js +305 -0
  357. package/dist/util/chip.d.ts +65 -0
  358. package/dist/util/chip.js +58 -0
  359. package/dist/util/cn.js +28 -2
  360. package/dist/util/code-field.d.ts +62 -0
  361. package/dist/util/code-field.js +112 -0
  362. package/dist/util/collapsible.d.ts +63 -0
  363. package/dist/util/collapsible.js +23 -0
  364. package/dist/util/confirm-dialog.d.ts +11 -0
  365. package/dist/util/confirm-dialog.js +2 -0
  366. package/dist/util/date.d.ts +95 -0
  367. package/dist/util/date.js +237 -0
  368. package/dist/util/display-voice.d.ts +9 -0
  369. package/dist/util/display-voice.js +9 -0
  370. package/dist/util/drawer.d.ts +12 -0
  371. package/dist/util/drawer.js +7 -0
  372. package/dist/util/dropdown.d.ts +46 -0
  373. package/dist/util/dropdown.js +21 -0
  374. package/dist/util/field-control.d.ts +29 -0
  375. package/dist/util/field-control.js +32 -0
  376. package/dist/util/field.d.ts +44 -0
  377. package/dist/util/field.js +38 -0
  378. package/dist/util/fit-in-viewport.d.ts +200 -0
  379. package/dist/util/fit-in-viewport.js +399 -0
  380. package/dist/util/focus-utils.d.ts +77 -2
  381. package/dist/util/focus-utils.js +186 -9
  382. package/dist/util/hydration.d.ts +44 -0
  383. package/dist/util/hydration.js +58 -0
  384. package/dist/util/keyboard-inset.d.ts +17 -0
  385. package/dist/util/keyboard-inset.js +53 -0
  386. package/dist/util/map-view.d.ts +143 -0
  387. package/dist/util/map-view.js +121 -0
  388. package/dist/util/media-grid.d.ts +50 -0
  389. package/dist/util/media-grid.js +81 -0
  390. package/dist/util/media.d.ts +5 -0
  391. package/dist/util/media.js +10 -0
  392. package/dist/util/overlay-chrome.d.ts +52 -0
  393. package/dist/util/overlay-chrome.js +56 -0
  394. package/dist/util/overlay.d.ts +71 -0
  395. package/dist/util/overlay.js +240 -0
  396. package/dist/util/photo.d.ts +233 -0
  397. package/dist/util/photo.js +209 -0
  398. package/dist/util/portal.d.ts +22 -0
  399. package/dist/util/portal.js +50 -0
  400. package/dist/util/progress.d.ts +18 -0
  401. package/dist/util/progress.js +17 -0
  402. package/dist/util/pull-to-refresh.d.ts +26 -0
  403. package/dist/util/pull-to-refresh.js +30 -0
  404. package/dist/util/radio-keys.d.ts +24 -0
  405. package/dist/util/radio-keys.js +49 -0
  406. package/dist/util/rating.d.ts +22 -0
  407. package/dist/util/rating.js +26 -0
  408. package/dist/util/ready-made-strings.d.ts +76 -0
  409. package/dist/util/ready-made-strings.js +67 -0
  410. package/dist/util/scroll-edge.d.ts +32 -0
  411. package/dist/util/scroll-edge.js +87 -0
  412. package/dist/util/scroll-padding.d.ts +19 -0
  413. package/dist/util/scroll-padding.js +44 -0
  414. package/dist/util/segmented-control.d.ts +15 -0
  415. package/dist/util/segmented-control.js +1 -0
  416. package/dist/util/select.d.ts +40 -0
  417. package/dist/util/select.js +63 -0
  418. package/dist/util/sheet-drag.d.ts +83 -0
  419. package/dist/util/sheet-drag.js +311 -0
  420. package/dist/util/sidebar.d.ts +62 -0
  421. package/dist/util/sidebar.js +38 -0
  422. package/dist/util/skeleton.d.ts +14 -0
  423. package/dist/util/skeleton.js +22 -0
  424. package/dist/util/sliding-indicator.d.ts +24 -0
  425. package/dist/util/sliding-indicator.js +44 -0
  426. package/dist/util/sortable-list.d.ts +64 -0
  427. package/dist/util/sortable-list.js +53 -0
  428. package/dist/util/stepper.d.ts +39 -0
  429. package/dist/util/stepper.js +38 -0
  430. package/dist/util/swipeable-list-item.d.ts +35 -0
  431. package/dist/util/swipeable-list-item.js +32 -0
  432. package/dist/util/temporal-field.d.ts +88 -0
  433. package/dist/util/temporal-field.js +136 -0
  434. package/dist/util/theme-mode.d.ts +79 -0
  435. package/dist/util/theme-mode.js +121 -0
  436. package/dist/util/toaster.d.ts +132 -0
  437. package/dist/util/toaster.js +130 -0
  438. package/dist/util/tone-surface.d.ts +33 -0
  439. package/dist/util/tone-surface.js +35 -0
  440. package/dist/util/tooltip.d.ts +9 -0
  441. package/dist/util/tooltip.js +18 -0
  442. package/dist/util/top-navbar.d.ts +34 -0
  443. package/dist/util/top-navbar.js +28 -0
  444. package/dist/util/touch-target.d.ts +30 -0
  445. package/dist/util/touch-target.js +30 -0
  446. package/dist/util/zabi-strings.d.ts +141 -0
  447. package/dist/util/zabi-strings.js +105 -0
  448. package/dist/zabi-components-colors.css +11 -2
  449. package/dist/zabi-components-theme-dark-only.css +870 -258
  450. package/dist/zabi-components-theme-dark.css +870 -258
  451. package/dist/zabi-components-theme-only.css +2419 -368
  452. package/dist/zabi-components-theme.css +2419 -368
  453. package/dist/zabi-components.css +6032 -711
  454. package/docs/lucide-icons.md +40 -17
  455. package/docs/theme-imports.md +81 -11
  456. package/package.json +45 -8
@@ -0,0 +1,19 @@
1
+ /** Types and pure helpers for `Progress`. Kept out of the component so they can be tested without a DOM. */
2
+ /** Every built-in string. Pass a partial object to `strings` to translate. */
3
+ export interface ProgressStrings {
4
+ /**
5
+ * The count of a segmented bar, as its accessible value and as the
6
+ * read-out beside the label: "4 of 19". `value` is the number of filled
7
+ * segments.
8
+ */
9
+ valueText: (value: number, max: number) => string;
10
+ }
11
+ export declare const PROGRESS_STRINGS: ProgressStrings;
12
+ /** The fewest and the most segments a segmented bar is drawn with. */
13
+ export declare const SEGMENTS_MIN = 2;
14
+ export declare const SEGMENTS_MAX = 24;
15
+ /** Whether `max` can be drawn as separate segments: a whole number from 2 to 24. */
16
+ export declare function canSegment(max: number): boolean;
17
+ /** Filled segments: `value` rounded down, held within 0..max; 0 for something that is not a number. */
18
+ export declare function filledSegments(value: number, max: number): number;
19
+ //# sourceMappingURL=progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/components/util/progress.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAE5G,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC5B;;;;OAIG;IACH,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CACrD;AAED,eAAO,MAAM,gBAAgB,EAAE,eAE9B,CAAC;AAEF,sEAAsE;AACtE,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B,oFAAoF;AACpF,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE/C;AAED,uGAAuG;AACvG,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGjE"}
@@ -0,0 +1,27 @@
1
+ /** Public types and pure helpers for `PullToRefresh`. */
2
+ /** The words a `PullToRefresh` says by itself. */
3
+ export interface PullToRefreshStrings {
4
+ /** Shown while the list is being pulled, short of the threshold. */
5
+ pull: string;
6
+ /** Shown once letting go would refresh. */
7
+ release: string;
8
+ /** Shown, and announced, while the refresh runs. */
9
+ refreshing: string;
10
+ /** Announced when it has finished. */
11
+ done: string;
12
+ /** The button that refreshes without the gesture. */
13
+ refresh: string;
14
+ }
15
+ export declare const DEFAULT_PULL_TO_REFRESH_STRINGS: PullToRefreshStrings;
16
+ /**
17
+ * How far the indicator has come out for a finger that has travelled
18
+ * `distance` px: half as far, so the list feels held, and never more than one
19
+ * and a half times the threshold.
20
+ */
21
+ export declare function pullDistance(distance: number, threshold: number): number;
22
+ /**
23
+ * What scrolls the element: its nearest ancestor that scrolls on the block
24
+ * axis, or the page.
25
+ */
26
+ export declare function scrollContainerOf(element: HTMLElement): HTMLElement;
27
+ //# sourceMappingURL=pull-to-refresh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pull-to-refresh.d.ts","sourceRoot":"","sources":["../../../src/components/util/pull-to-refresh.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,kDAAkD;AAClD,MAAM,WAAW,oBAAoB;IACjC,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,+BAA+B,EAAE,oBAM7C,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAExE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,WAAW,CAOnE"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Where a key moves the selection in a radio group laid out in a row, as
3
+ * Rating and SegmentedControl are. Kept out of the components so it can be
4
+ * tested without a DOM.
5
+ *
6
+ * It is the native radio contract: Right and Down go to the next option, Left
7
+ * and Up to the previous one, both wrap, and Left and Right swap in a
8
+ * right-to-left layout.
9
+ *
10
+ * `current` is the option that has focus, which is not always the selected
11
+ * one: a screen reader's cursor can put focus on any radio, and the keys then
12
+ * move from where the user is. It is -1 when focus is on none of them: the
13
+ * next option is then the first, and the previous one the last.
14
+ *
15
+ * `hasSelection` is false while the group is empty. A forward key then selects
16
+ * the focused option itself instead of stepping over it, so Right on an empty
17
+ * rating gives one star, not two.
18
+ *
19
+ * Returns -1 for a key that is not a navigation key, or when there is nothing
20
+ * to move to.
21
+ */
22
+ export declare function radioKeyIndex(key: string, current: number, count: number, rtl?: boolean, hasSelection?: boolean): number;
23
+ /** Whether `node` is laid out right to left. */
24
+ export declare function isRtl(node: Element): boolean;
25
+ //# sourceMappingURL=radio-keys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio-keys.d.ts","sourceRoot":"","sources":["../../../src/components/util/radio-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,aAAa,CACzB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,GAAG,UAAQ,EACX,YAAY,UAAO,GACpB,MAAM,CAeR;AAED,gDAAgD;AAChD,wBAAgB,KAAK,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAE5C"}
@@ -0,0 +1,23 @@
1
+ /** Types and pure helpers for `Rating`. Kept out of the component so they can be tested without a DOM. */
2
+ /** Every built-in string. Pass a partial object to `strings` to translate. */
3
+ export interface RatingStrings {
4
+ /**
5
+ * Accessible name of one star ("4 of 5 stars"), and of a read-only
6
+ * rating as a whole ("3.5 of 5 stars"). `value` is already formatted.
7
+ */
8
+ starLabel: (value: string, max: number) => string;
9
+ /** Accessible name of the clear button that `clearable` adds. */
10
+ clearLabel: string;
11
+ /** Shown, and read, for a read-only rating without a value. */
12
+ noRating: string;
13
+ }
14
+ export declare const RATING_STRINGS: RatingStrings;
15
+ /** Number of stars: a whole number, at least one. */
16
+ export declare function starCount(max: number): number;
17
+ /** `value` held within 0..max; `null` for no rating or a value that is not a number. */
18
+ export declare function clampRating(value: number | null | undefined, max: number): number | null;
19
+ /** How much of star `star` (counted from 1) is filled, 0 to 1. */
20
+ export declare function starFill(value: number | null, star: number): number;
21
+ /** The value with at most one decimal: 4, 3.5, 3.7. */
22
+ export declare function defaultRatingFormat(value: number): string;
23
+ //# sourceMappingURL=rating.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rating.d.ts","sourceRoot":"","sources":["../../../src/components/util/rating.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAE1G,8EAA8E;AAC9E,MAAM,WAAW,aAAa;IAC1B;;;OAGG;IACH,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,EAAE,aAI5B,CAAC;AAEF,qDAAqD;AACrD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED,wFAAwF;AACxF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGxF;AAED,kEAAkE;AAClE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAGnE;AAED,uDAAuD;AACvD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * The words of the components that come with text of their own: the colour
3
+ * picker, the ready-made contact form, and the two the docs site is built
4
+ * from. Each takes its own as `strings`; what is left out stays as it is here.
5
+ */
6
+ /** `ColorPicker`. */
7
+ export interface ColorPickerStrings {
8
+ /** Accessible name of the field the hex value is typed in. */
9
+ hexInput: string;
10
+ /** Accessible name of the swatch button that opens the picker. */
11
+ open: string;
12
+ /** Accessible name of the picker that opens. */
13
+ picker: string;
14
+ /** Accessible name of the hue slider in it. */
15
+ hue: string;
16
+ /** Accessible name of the colour map: the two sliders below, on one surface. */
17
+ area: string;
18
+ /** Accessible name of the map's slider that goes across. */
19
+ saturation: string;
20
+ /** Accessible name of the map's slider that goes up and down. */
21
+ lightness: string;
22
+ /** The message under the field while what is typed is not a hex colour. */
23
+ invalidHex: string;
24
+ }
25
+ export declare const DEFAULT_COLOR_PICKER_STRINGS: ColorPickerStrings;
26
+ /** `ContactForm`: every label, placeholder and message of the form. */
27
+ export interface ContactFormStrings {
28
+ heading: string;
29
+ nameLabel: string;
30
+ namePlaceholder: string;
31
+ emailLabel: string;
32
+ emailPlaceholder: string;
33
+ messageLabel: string;
34
+ messagePlaceholder: string;
35
+ subscribeLabel: string;
36
+ submit: string;
37
+ /** Under a field left empty or filled in wrongly. */
38
+ nameRequired: string;
39
+ emailRequired: string;
40
+ emailInvalid: string;
41
+ messageRequired: string;
42
+ /** The box above the fields when the form could not be sent: its three lines. */
43
+ errorTitle: string;
44
+ errorMessage: string;
45
+ errorRecovery: string;
46
+ }
47
+ export declare const DEFAULT_CONTACT_FORM_STRINGS: ContactFormStrings;
48
+ /** `PropsTable`. The caption is the `caption` prop. */
49
+ export interface PropsTableStrings {
50
+ name: string;
51
+ type: string;
52
+ required: string;
53
+ default: string;
54
+ description: string;
55
+ yes: string;
56
+ no: string;
57
+ /** Shown instead of the table when there are no props. */
58
+ empty: string;
59
+ }
60
+ export declare const DEFAULT_PROPS_TABLE_STRINGS: PropsTableStrings;
61
+ /** `ComponentDemo`. */
62
+ export interface ComponentDemoStrings {
63
+ /** The two tabs, and what the switch between them is called. */
64
+ preview: string;
65
+ code: string;
66
+ showPreview: string;
67
+ showCode: string;
68
+ }
69
+ export declare const DEFAULT_COMPONENT_DEMO_STRINGS: ComponentDemoStrings;
70
+ /**
71
+ * Lays `strings` layers over a component's defaults, later layers winning. A
72
+ * key whose value is `undefined` is skipped, so `strings={{ close: t.close }}`
73
+ * with `t.close` missing keeps the default instead of blanking it. `null` and
74
+ * the empty string are kept: those are choices.
75
+ */
76
+ export declare function mergeStrings<T extends object>(defaults: T, ...layers: Array<Partial<T> | null | undefined>): T;
77
+ //# sourceMappingURL=ready-made-strings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ready-made-strings.d.ts","sourceRoot":"","sources":["../../../src/components/util/ready-made-strings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qBAAqB;AACrB,MAAM,WAAW,kBAAkB;IAC/B,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,4DAA4D;IAC5D,UAAU,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,4BAA4B,EAAE,kBAS1C,CAAC;AAEF,uEAAuE;AACvE,MAAM,WAAW,kBAAkB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,4BAA4B,EAAE,kBAiB1C,CAAC;AAEF,uDAAuD;AACvD,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,2BAA2B,EAAE,iBASzC,CAAC;AAEF,uBAAuB;AACvB,MAAM,WAAW,oBAAoB;IACjC,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,8BAA8B,EAAE,oBAK5C,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,EACzC,QAAQ,EAAE,CAAC,EACX,GAAG,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,GAChD,CAAC,CASH"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Whether content is under a bar (D123): the one thing a bar needs to know to
3
+ * choose between flush with the page and glass.
4
+ *
5
+ * Pure DOM, no Svelte. `AppShell` uses it on its scroller and shares the
6
+ * result with the bars inside it; a bar on its own uses it on its nearest
7
+ * scroll parent, or on the window.
8
+ */
9
+ /** `scrollEdge` on a bar: follow the scroll position, or force the glass on or off. */
10
+ export type ScrollEdgeMode = "auto" | "always" | "never";
11
+ export interface ScrollEdge {
12
+ /** Scrolled away from the start: content is under a bar at the top. */
13
+ top: boolean;
14
+ /** Not at the end: content is under a bar at the bottom. */
15
+ bottom: boolean;
16
+ }
17
+ /** The edges for a scroll position, clamped against rubber-banding past either end. */
18
+ export declare function measureScrollEdge(position: number, scrollable: number, topThreshold?: number): ScrollEdge;
19
+ /** The value a bar writes as `data-scrolled-under`: the mode, or what the scroll position says. */
20
+ export declare function resolveScrolledUnder(mode: ScrollEdgeMode | undefined, auto: boolean): boolean;
21
+ /**
22
+ * Reports `{ top, bottom }` for `container` (null for the window): once on
23
+ * start, then whenever either changes. It listens to `scroll` (passive) and,
24
+ * where `ResizeObserver` exists, to the size of the container and of what is
25
+ * in it, since content that grows or shrinks moves the end. Returns the
26
+ * cleanup. Call it in the browser.
27
+ *
28
+ * `topThreshold` (px, default 0) is how far it has to scroll before `top` is
29
+ * true: a bar with a large title is only over content once the large row has
30
+ * gone under it. Call it again to change it.
31
+ */
32
+ export declare function watchScrollEdge(container: HTMLElement | null, onChange: (edge: ScrollEdge) => void, topThreshold?: number): () => void;
33
+ //# sourceMappingURL=scroll-edge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll-edge.d.ts","sourceRoot":"","sources":["../../../src/components/util/scroll-edge.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,uFAAuF;AACvF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzD,MAAM,WAAW,UAAU;IACvB,uEAAuE;IACvE,GAAG,EAAE,OAAO,CAAC;IACb,4DAA4D;IAC5D,MAAM,EAAE,OAAO,CAAC;CACnB;AAKD,uFAAuF;AACvF,wBAAgB,iBAAiB,CAC7B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,YAAY,SAAI,GACjB,UAAU,CAIZ;AAED,mGAAmG;AACnG,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAI7F;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC3B,SAAS,EAAE,WAAW,GAAG,IAAI,EAC7B,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,EACpC,YAAY,SAAI,GACjB,MAAM,IAAI,CAkDZ"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `scroll-padding-bottom` on a scrolling box, shared between the things that
3
+ * lie over its bottom edge.
4
+ *
5
+ * Each of them saves what was there and puts it back when it leaves. Done one
6
+ * by one that goes wrong as soon as two overlap in time: the second saves the
7
+ * first one's value as "what was there", and if the first leaves first, the
8
+ * second later restores a value nobody owns any more. Here the box's own
9
+ * value is saved once, the largest request is what is set, and the box gets
10
+ * its own value back when the last request is released.
11
+ */
12
+ /**
13
+ * Asks for room at the bottom of `container`. `set` gives or changes the
14
+ * amount in px; `release` withdraws the request. Call it in the browser.
15
+ */
16
+ export declare function reserveScrollPaddingBottom(container: HTMLElement): {
17
+ set: (px: number) => void;
18
+ release: () => void;
19
+ };
20
+ //# sourceMappingURL=scroll-padding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll-padding.d.ts","sourceRoot":"","sources":["../../../src/components/util/scroll-padding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAcH;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,WAAW,GAAG;IAChE,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB,CAuBA"}
@@ -0,0 +1,16 @@
1
+ import type { Component } from "svelte";
2
+ /** An icon component, as `@lucide/svelte` icons are. */
3
+ export type SegmentedControlIcon = Component<{
4
+ size?: number;
5
+ class?: string;
6
+ }>;
7
+ /** One entry of SegmentedControl's `options`. */
8
+ export interface SegmentedControlOption {
9
+ value: string;
10
+ label: string;
11
+ /** Rendered before the label. Decorative: the label names the segment. */
12
+ icon?: SegmentedControlIcon;
13
+ /** A disabled segment cannot be chosen, and the arrow keys skip it. */
14
+ disabled?: boolean;
15
+ }
16
+ //# sourceMappingURL=segmented-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segmented-control.d.ts","sourceRoot":"","sources":["../../../src/components/util/segmented-control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,wDAAwD;AACxD,MAAM,MAAM,oBAAoB,GAAG,SAAS,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEhF,iDAAiD;AACjD,MAAM,WAAW,sBAAsB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,uEAAuE;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Every word a `Select` says by itself, shown or only read out. An app in
3
+ * another language passes its own through `strings`; what it leaves out stays
4
+ * as it is here. The older props for six of them (`placeholder`,
5
+ * `searchPlaceholder`, `noResultsText`, `loadingText`, `emptyStateTitle`,
6
+ * `emptyStateDescription`) still work, and win over `strings`.
7
+ */
8
+ export interface SelectStrings {
9
+ /** Shown in the field while nothing is chosen, and the first, empty option of the native select. */
10
+ placeholder: string;
11
+ /** Placeholder and accessible name of the search field above the options. */
12
+ searchPlaceholder: string;
13
+ /** Shown in the list when the search matches nothing. */
14
+ noResults: string;
15
+ /** Shown in the field and in the list while `isLoading`. */
16
+ loading: string;
17
+ /** Heading of the box shown in the list when there are no options at all. */
18
+ emptyTitle: string;
19
+ /** The line under that heading. */
20
+ emptyDescription: string;
21
+ /** Accessible name of the list of options. */
22
+ listLabel: string;
23
+ /** Accessible name of the close button of the sheet the list opens in on a phone. */
24
+ closeLabel: string;
25
+ /** Accessible name of that sheet's grip while its button takes the sheet up to full height. */
26
+ expandLabel: string;
27
+ /** The same, while it takes the sheet back down. */
28
+ collapseLabel: string;
29
+ }
30
+ export declare const DEFAULT_SELECT_STRINGS: SelectStrings;
31
+ /** How a Select shows its options. See the `presentation` prop. */
32
+ export type SelectPresentation = "auto" | "popover" | "sheet" | "native";
33
+ /** Marks the native `<select>` a Select renders, so a choice made in it before the page hydrates can be found. */
34
+ export declare const NATIVE_SELECT_ATTRIBUTE = "data-zabi-select";
35
+ /**
36
+ * What the visitor (or the browser, restoring a form) chose in `element`
37
+ * before its component mounted; `undefined` when it still has the value the
38
+ * server rendered, and for an element this module never saw.
39
+ */
40
+ export declare function choiceBeforeMount(element: Element): string | undefined;
41
+ //# sourceMappingURL=select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/components/util/select.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC1B,oGAAoG;IACpG,WAAW,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,iBAAiB,EAAE,MAAM,CAAC;IAC1B,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,gBAAgB,EAAE,MAAM,CAAC;IACzB,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,UAAU,EAAE,MAAM,CAAC;IACnB,+FAA+F;IAC/F,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,sBAAsB,EAAE,aAWpC,CAAC;AAEF,mEAAmE;AACnE,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEzE,kHAAkH;AAClH,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAgD1D;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAGtE"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * Dragging a bottom sheet with a finger or a pointer. Shared by `BottomSheet`
3
+ * and `SlideUp`, so the two cannot disagree on what a swipe is.
4
+ *
5
+ * It only reports the gesture: how far the pointer has travelled since the
6
+ * drag began and how fast it was going at the end. What that means (move the
7
+ * panel, snap, close) is the caller's.
8
+ */
9
+ export interface SheetDragCallbacks {
10
+ /** Asked when a gesture could begin. Return false to leave it alone. */
11
+ canStart?: () => boolean;
12
+ onStart?: () => void;
13
+ /** `distance` in px since the drag began; positive is down. */
14
+ onMove: (distance: number) => void;
15
+ /** `velocity` in px per ms over the last moments of the drag; positive is down. */
16
+ onEnd: (distance: number, velocity: number, event: Event) => void;
17
+ /** The browser took the gesture back (a call came in, the pointer was lost). */
18
+ onCancel?: () => void;
19
+ }
20
+ export interface SheetDragTargets {
21
+ /**
22
+ * The grip and the area around it. A drag that starts here moves the
23
+ * sheet in either direction. Give it `touch-action: none`.
24
+ */
25
+ handleZone: HTMLElement;
26
+ /**
27
+ * The scrolling content. A touch that starts here scrolls it; only a
28
+ * downward swipe that begins with the content at its top moves the sheet,
29
+ * and not one that begins on a box inside it that scrolls itself or on
30
+ * something that handles its own gesture: marked `data-sheet-no-drag`,
31
+ * a range input, or with a `touch-action` that gives up vertical
32
+ * panning (`contentTakesTouch`). A swipe that begins sideways stays
33
+ * sideways and never moves the sheet.
34
+ */
35
+ scroller?: HTMLElement | null;
36
+ }
37
+ /** Movement under this many px is a press, not a drag. */
38
+ export declare const DRAG_SLOP = 6;
39
+ /**
40
+ * Movement, on either axis, after which a touch in the content has an axis:
41
+ * more across than down is sideways (a carousel, a row that scrolls, a
42
+ * swipeable item), and stays so until the finger lifts.
43
+ */
44
+ export declare const AXIS_SLOP = 8;
45
+ /**
46
+ * Whether a touch that begins on `target` belongs to the content and not to the
47
+ * sheet: it started on something that is dragged itself (`OWN_DRAG`), or it
48
+ * has, between it and the sheet's `scroller`, a box that scrolls on the y axis
49
+ * or one whose `touch-action` leaves vertical panning to the page's own code
50
+ * (`ownsVerticalGesture`: a map, a canvas, a drawing pad, a slider).
51
+ * A box that can scroll keeps the gesture whether it is at its top or not: a
52
+ * drag that sometimes scrolls a list and sometimes closes the sheet cannot be
53
+ * predicted, and the list does not hand over what it cannot use
54
+ * (`overscroll-contain`). The scroller itself is not asked here; it is the
55
+ * sheet's own content, and hands a pull down at its top to the sheet.
56
+ */
57
+ export declare function contentTakesTouch(target: EventTarget | null, scroller: HTMLElement): boolean;
58
+ /**
59
+ * When a pointer or touch event happened: its own `timeStamp`, which is when
60
+ * the finger moved. The time the handler runs is later by however busy the
61
+ * page is, and unevenly so, which made a flick on a janky frame (or a loaded
62
+ * machine) measure slower than it was and spring back. An event without a
63
+ * usable stamp gets the clock.
64
+ */
65
+ export declare function timeOf(event: Event): number;
66
+ /**
67
+ * How fast a pointer was moving over the last moments of a gesture, on one
68
+ * axis. Also used by `PhotoViewer`, for both axes.
69
+ */
70
+ export declare function createVelocityTracker(): {
71
+ reset(y: number, time: number): void;
72
+ add(y: number, time: number): void;
73
+ velocity(): number;
74
+ };
75
+ /**
76
+ * Listens for drags on a sheet. Call it when the sheet is open, in the
77
+ * browser, and call the returned function when it closes.
78
+ */
79
+ export declare function attachSheetDrag({ handleZone, scroller }: SheetDragTargets, callbacks: SheetDragCallbacks): () => void;
80
+ /** A flick: faster than this, in px per ms, and the direction decides, not the distance. */
81
+ export declare const FLICK_VELOCITY = 0.5;
82
+ /** True where the user has asked for less motion, or where that cannot be asked. */
83
+ export declare function prefersReducedMotion(): boolean;
84
+ //# sourceMappingURL=sheet-drag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheet-drag.d.ts","sourceRoot":"","sources":["../../../src/components/util/sheet-drag.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,kBAAkB;IAC/B,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,+DAA+D;IAC/D,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,mFAAmF;IACnF,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAClE,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC7B;;;OAGG;IACH,UAAU,EAAE,WAAW,CAAC;IACxB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CACjC;AAED,0DAA0D;AAC1D,eAAO,MAAM,SAAS,IAAI,CAAC;AAE3B;;;;GAIG;AACH,eAAO,MAAM,SAAS,IAAI,CAAC;AA2B3B;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,EAAE,QAAQ,EAAE,WAAW,GAAG,OAAO,CAY5F;AAKD;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAG3C;AAKD;;;GAGG;AACH,wBAAgB,qBAAqB;aAIpB,MAAM,QAAQ,MAAM;WAGtB,MAAM,QAAQ,MAAM;gBAIf,MAAM;EAYzB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC3B,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,gBAAgB,EAC1C,SAAS,EAAE,kBAAkB,GAC9B,MAAM,IAAI,CAsLZ;AAED,4FAA4F;AAC5F,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,oFAAoF;AACpF,wBAAgB,oBAAoB,IAAI,OAAO,CAM9C"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * The words the sidebar components say by themselves. Each takes its own as
3
+ * `strings`; `SidebarNavigation` takes them all and hands the footer and the
4
+ * brand header theirs.
5
+ */
6
+ /** `SidebarBrandHeader`. */
7
+ export interface SidebarBrandHeaderStrings {
8
+ /** The logo's alt text when neither `logoAlt` nor `brandName` is given. */
9
+ brandAlt: string;
10
+ }
11
+ export declare const DEFAULT_SIDEBAR_BRAND_HEADER_STRINGS: SidebarBrandHeaderStrings;
12
+ /** `SidebarFooter`. */
13
+ export interface SidebarFooterStrings {
14
+ /** Accessible name of the footer. */
15
+ accountAndSettings: string;
16
+ /** Accessible name of the profile button in a collapsed rail. */
17
+ openAccountPanel: string;
18
+ /** The same button in an expanded sidebar, with the profile's name. */
19
+ openAccountPanelFor: (name: string) => string;
20
+ }
21
+ export declare const DEFAULT_SIDEBAR_FOOTER_STRINGS: SidebarFooterStrings;
22
+ /** `SidebarAccountPanel`. */
23
+ export interface SidebarAccountPanelStrings {
24
+ /** Accessible name of the panel. */
25
+ panelLabel: string;
26
+ /** The panel's heading. */
27
+ title: string;
28
+ /** Accessible name of the close button. */
29
+ closeLabel: string;
30
+ /** Accessible name of the list of rows. */
31
+ listLabel: string;
32
+ /** The first row, above the profile's name. */
33
+ account: string;
34
+ /** The row that switches the theme. */
35
+ theme: string;
36
+ /** That row's second line, in each mode. */
37
+ lightMode: string;
38
+ darkMode: string;
39
+ /** With `themeModes="three"`: the mode that follows the system. */
40
+ systemMode: string;
41
+ /** The badge on that row, in each mode. */
42
+ light: string;
43
+ dark: string;
44
+ system: string;
45
+ /** The second line of the log-out row. Its first line is `logoutLabel`. */
46
+ signOut: string;
47
+ }
48
+ export declare const DEFAULT_SIDEBAR_ACCOUNT_PANEL_STRINGS: SidebarAccountPanelStrings;
49
+ /** `SidebarNavigation`: its own words, and those of the footer and the brand header in it. */
50
+ export interface SidebarNavigationStrings extends SidebarFooterStrings, SidebarBrandHeaderStrings {
51
+ /** Accessible name of the main list of links, when it has no section heading. */
52
+ primaryNavigation: string;
53
+ /** Accessible name of the second list of links. */
54
+ secondaryNavigation: string;
55
+ /** Accessible name of a list under a section heading, from the heading. */
56
+ sectionNavigation: (section: string) => string;
57
+ /** Shown when a search matches no link: the heading. */
58
+ noMatchesTitle: string;
59
+ /** And the line under it, with what was searched for. */
60
+ noMatchesDescription: (term: string) => string;
61
+ }
62
+ export declare const DEFAULT_SIDEBAR_NAVIGATION_STRINGS: SidebarNavigationStrings;
63
+ //# sourceMappingURL=sidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/util/sidebar.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,4BAA4B;AAC5B,MAAM,WAAW,yBAAyB;IACtC,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,oCAAoC,EAAE,yBAElD,CAAC;AAEF,uBAAuB;AACvB,MAAM,WAAW,oBAAoB;IACjC,qCAAqC;IACrC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iEAAiE;IACjE,gBAAgB,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CACjD;AAED,eAAO,MAAM,8BAA8B,EAAE,oBAI5C,CAAC;AAEF,6BAA6B;AAC7B,MAAM,WAAW,0BAA0B;IACvC,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,qCAAqC,EAAE,0BAenD,CAAC;AAEF,8FAA8F;AAC9F,MAAM,WAAW,wBAAyB,SAAQ,oBAAoB,EAAE,yBAAyB;IAC7F,iFAAiF;IACjF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mDAAmD;IACnD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,2EAA2E;IAC3E,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,wDAAwD;IACxD,cAAc,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CAClD;AAED,eAAO,MAAM,kCAAkC,EAAE,wBAQhD,CAAC"}
@@ -0,0 +1,15 @@
1
+ /** Every built-in string. Pass a partial object to `strings` to translate. */
2
+ export interface SkeletonStrings {
3
+ /** The name of the loading status, for a lone `Skeleton` and for a `SkeletonGroup`. */
4
+ label: string;
5
+ }
6
+ export declare const DEFAULT_SKELETON_STRINGS: SkeletonStrings;
7
+ /** The fewest and the most lines a text `Skeleton` draws with `lines`. */
8
+ export declare const SKELETON_LINES_MAX = 20;
9
+ /** `lines` as a whole number from 1 to 20, or 0 for "not a paragraph" (unset, below 1, not a number). */
10
+ export declare function skeletonLineCount(lines: number | undefined): number;
11
+ /** For `SkeletonGroup`: marks everything below it as pieces of one status. Call while the component initialises. */
12
+ export declare function provideSkeletonGroup(): void;
13
+ /** For `Skeleton`: whether it sits under a `SkeletonGroup`. Call while the component initialises. */
14
+ export declare function inSkeletonGroup(): boolean;
15
+ //# sourceMappingURL=skeleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/util/skeleton.ts"],"names":[],"mappings":"AAGA,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC5B,uFAAuF;IACvF,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,wBAAwB,EAAE,eAEtC,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,yGAAyG;AACzG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGnE;AAID,oHAAoH;AACpH,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED,qGAAqG;AACrG,wBAAgB,eAAe,IAAI,OAAO,CAEzC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Measuring for the sliding indicator of Tabs and SegmentedControl. The
3
+ * component paints its selected item itself until a box has been measured, so
4
+ * a server render, a page that has not hydrated and an engine that cannot
5
+ * measure all keep the static look.
6
+ */
7
+ export interface IndicatorBox {
8
+ x: number;
9
+ y: number;
10
+ width: number;
11
+ height: number;
12
+ }
13
+ /**
14
+ * The `item`'s box in the coordinates an absolutely positioned child of
15
+ * `container` uses: from the container's padding box, plus what the container
16
+ * has scrolled (so an indicator inside a scrolling list stays on its item).
17
+ * Measured as physical boxes, so a right-to-left layout needs nothing extra.
18
+ * Null where nothing can be measured (no layout, or the item is not shown).
19
+ */
20
+ export declare function measureIndicator(container: HTMLElement, item: HTMLElement): IndicatorBox | null;
21
+ /** Calls `onChange` when any of the `targets` changes size; a no-op without ResizeObserver. */
22
+ export declare function observeSizes(targets: Array<Element | null | undefined>, onChange: () => void): () => void;
23
+ /** Runs `callback` after the next frame; the timer stands in where there are no frames. */
24
+ export declare function afterFrame(callback: () => void): () => void;
25
+ //# sourceMappingURL=sliding-indicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sliding-indicator.d.ts","sourceRoot":"","sources":["../../../src/components/util/sliding-indicator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,YAAY;IACzB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,GAAG,YAAY,GAAG,IAAI,CAU/F;AAED,+FAA+F;AAC/F,wBAAgB,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAKzG;AAED,2FAA2F;AAC3F,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAO3D"}
@@ -0,0 +1,65 @@
1
+ /** Types and pure helpers for `SortableList`. Kept out of the component so they can be tested without a DOM. */
2
+ import type { Snippet } from "svelte";
3
+ /** Payload of `onreorder`: which item moved, and between which zero-based indexes. */
4
+ export interface SortableListReorderDetail<T> {
5
+ item: T;
6
+ from: number;
7
+ to: number;
8
+ /** The list in its new order (the same array `bind:items` receives). */
9
+ items: T[];
10
+ }
11
+ /** What a live-region message is built from. `position` is one-based. */
12
+ export interface SortableListAnnouncement {
13
+ label: string;
14
+ position: number;
15
+ total: number;
16
+ }
17
+ /** Second argument of the `item` snippet. */
18
+ export interface SortableListRow {
19
+ /** Zero-based index in the current order. */
20
+ index: number;
21
+ /** True while this row is being dragged with a pointer. */
22
+ dragging: boolean;
23
+ /** True when the list or this item is disabled. */
24
+ disabled: boolean;
25
+ /** The drag handle. Render it yourself when `controls="manual"`. */
26
+ handle: Snippet;
27
+ /** The move up / move down buttons. Render them yourself when `controls="manual"`. */
28
+ moveButtons: Snippet;
29
+ }
30
+ /** Every built-in string. Pass a partial object to `strings` to translate. */
31
+ export interface SortableListStrings {
32
+ /** Accessible name of the drag handle. */
33
+ handleLabel: (label: string) => string;
34
+ /** How to use the handle; referenced by every handle through `aria-describedby`. */
35
+ handleDescription: string;
36
+ moveUp: (label: string) => string;
37
+ moveDown: (label: string) => string;
38
+ /** Announced after every move. */
39
+ moved: (detail: SortableListAnnouncement) => string;
40
+ /** Announced when Escape (or a cancelled pointer) abandons a drag. */
41
+ cancelled: (detail: SortableListAnnouncement) => string;
42
+ /** Announced when Arrow Up or Home is pressed on the first item. */
43
+ atStart: (detail: SortableListAnnouncement) => string;
44
+ /** Announced when Arrow Down or End is pressed on the last item. */
45
+ atEnd: (detail: SortableListAnnouncement) => string;
46
+ }
47
+ export declare const SORTABLE_LIST_STRINGS: SortableListStrings;
48
+ /** A copy of `items` with the entry at `from` moved to `to`. Out-of-range indexes are clamped. */
49
+ export declare function moveItem<T>(items: readonly T[], from: number, to: number): T[];
50
+ /** Top edge and height of a row, measured once when a drag starts. */
51
+ export interface SortableSlot {
52
+ top: number;
53
+ height: number;
54
+ }
55
+ /**
56
+ * Index the dragged row would land on, given how far it has travelled.
57
+ *
58
+ * A row below counts as passed once the dragged row's bottom edge crosses its
59
+ * centre, and a row above once the top edge does. Both are read from the
60
+ * positions measured at drag start, so the answer depends on the pointer
61
+ * alone: rows sliding out of the way cannot feed back into it and make the
62
+ * target flicker, which is what happens when the live positions are compared.
63
+ */
64
+ export declare function dropIndex(slots: readonly SortableSlot[], from: number, offset: number): number;
65
+ //# sourceMappingURL=sortable-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sortable-list.d.ts","sourceRoot":"","sources":["../../../src/components/util/sortable-list.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAEhH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,sFAAsF;AACtF,MAAM,WAAW,yBAAyB,CAAC,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,wEAAwE;IACxE,KAAK,EAAE,CAAC,EAAE,CAAC;CACd;AAED,yEAAyE;AACzE,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,6CAA6C;AAC7C,MAAM,WAAW,eAAe;IAC5B,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,QAAQ,EAAE,OAAO,CAAC;IAClB,mDAAmD;IACnD,QAAQ,EAAE,OAAO,CAAC;IAClB,oEAAoE;IACpE,MAAM,EAAE,OAAO,CAAC;IAChB,sFAAsF;IACtF,WAAW,EAAE,OAAO,CAAC;CACxB;AAED,8EAA8E;AAC9E,MAAM,WAAW,mBAAmB;IAChC,0CAA0C;IAC1C,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,oFAAoF;IACpF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAClC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,kCAAkC;IAClC,KAAK,EAAE,CAAC,MAAM,EAAE,wBAAwB,KAAK,MAAM,CAAC;IACpD,sEAAsE;IACtE,SAAS,EAAE,CAAC,MAAM,EAAE,wBAAwB,KAAK,MAAM,CAAC;IACxD,oEAAoE;IACpE,OAAO,EAAE,CAAC,MAAM,EAAE,wBAAwB,KAAK,MAAM,CAAC;IACtD,oEAAoE;IACpE,KAAK,EAAE,CAAC,MAAM,EAAE,wBAAwB,KAAK,MAAM,CAAC;CACvD;AAED,eAAO,MAAM,qBAAqB,EAAE,mBAcnC,CAAC;AAEF,kGAAkG;AAClG,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,EAAE,CAO9E;AAED,sEAAsE;AACtE,MAAM,WAAW,YAAY;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CACrB,KAAK,EAAE,SAAS,YAAY,EAAE,EAC9B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACf,MAAM,CAeR"}