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,9 @@
1
+ /**
2
+ * The display voice: the weight and tracking of a figure or a display line.
3
+ * Both are read from custom properties that are declared nowhere, so any
4
+ * ancestor can set them (`--zabi-display-weight: 400` for a light serif) and
5
+ * the defaults are what the display face looked like before. The `number:`
6
+ * hint is what makes Tailwind read the weight as a weight and not a family.
7
+ * Heading `variant="display"` and Stat share this string.
8
+ */
9
+ export const displayVoice = "font-[number:var(--zabi-display-weight,700)] tracking-[var(--zabi-display-tracking,-0.02em)]";
@@ -0,0 +1,12 @@
1
+ /** Public types and pure helpers for `Drawer`. */
2
+ /**
3
+ * The edge the drawer is anchored to. `left` and `right` are physical and stay
4
+ * put in a right-to-left page; `start` and `end` follow the writing direction.
5
+ */
6
+ export type DrawerSide = "left" | "right" | "start" | "end";
7
+ /** Panel width on wide screens. On a phone the panel is never wider than the screen. */
8
+ export type DrawerSize = "sm" | "md" | "lg";
9
+ /** What the user did to close the drawer. The same values Modal reports. */
10
+ export type DrawerCloseReason = "escape" | "backdrop" | "close-button";
11
+ /** The physical edge a side resolves to, given the writing direction. */
12
+ export declare function resolveDrawerEdge(side: DrawerSide, rtl: boolean): "left" | "right";
@@ -0,0 +1,7 @@
1
+ /** Public types and pure helpers for `Drawer`. */
2
+ /** The physical edge a side resolves to, given the writing direction. */
3
+ export function resolveDrawerEdge(side, rtl) {
4
+ if (side === "left" || side === "right")
5
+ return side;
6
+ return (side === "start") !== rtl ? "left" : "right";
7
+ }
@@ -0,0 +1,46 @@
1
+ import type { Component } from "svelte";
2
+ /** An icon component, as `@lucide/svelte` icons are. */
3
+ export type DropdownItemIcon = Component<{
4
+ size?: number;
5
+ class?: string;
6
+ }>;
7
+ export type DropdownItemTone = "default" | "danger";
8
+ /** One entry of Dropdown's `options`. */
9
+ export interface DropdownOption {
10
+ value: string | number;
11
+ label: string;
12
+ /**
13
+ * A disabled item stays focusable, so the arrow keys still reach it and a
14
+ * screen reader can read why it is unavailable; it cannot be chosen.
15
+ */
16
+ disabled?: boolean;
17
+ /** Rendered before the label, at 16px. Decorative: the label names the item. */
18
+ icon?: DropdownItemIcon;
19
+ /** `danger` for a destructive action such as Delete. */
20
+ tone?: DropdownItemTone;
21
+ /** Second line under the label, e.g. why the item is disabled. */
22
+ description?: string;
23
+ }
24
+ /**
25
+ * How a Dropdown's menu is shown: `popover` under its trigger, `sheet` in a
26
+ * BottomSheet, or `auto`: a sheet on a phone, the pop-over everywhere else.
27
+ */
28
+ export type DropdownPresentation = "auto" | "popover" | "sheet";
29
+ /**
30
+ * A phone, for `auto`: a touch screen (`pointer: coarse`) narrower than the
31
+ * `sm` breakpoint. A tablet has the room for a pop-over under its trigger,
32
+ * and a narrow window with a mouse has the precision for one.
33
+ */
34
+ export declare const SHEET_MEDIA_QUERY = "(pointer: coarse) and (max-width: 639.98px)";
35
+ /**
36
+ * Whether a menu asked for as `presentation` opens in a sheet right now.
37
+ * Read when the menu opens, in the browser: on the server it is never a sheet,
38
+ * so what is rendered before anyone touches the control is the same everywhere.
39
+ */
40
+ export declare function opensAsSheet(presentation: DropdownPresentation): boolean;
41
+ /** What a Dropdown tells the items inside it. */
42
+ export interface DropdownContext {
43
+ /** `option` inside a listbox, `menuitem` inside a menu. */
44
+ readonly itemRole: "menuitem" | "option";
45
+ }
46
+ export declare const DROPDOWN_CONTEXT_KEY: unique symbol;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * A phone, for `auto`: a touch screen (`pointer: coarse`) narrower than the
3
+ * `sm` breakpoint. A tablet has the room for a pop-over under its trigger,
4
+ * and a narrow window with a mouse has the precision for one.
5
+ */
6
+ export const SHEET_MEDIA_QUERY = "(pointer: coarse) and (max-width: 639.98px)";
7
+ /**
8
+ * Whether a menu asked for as `presentation` opens in a sheet right now.
9
+ * Read when the menu opens, in the browser: on the server it is never a sheet,
10
+ * so what is rendered before anyone touches the control is the same everywhere.
11
+ */
12
+ export function opensAsSheet(presentation) {
13
+ if (presentation === "sheet")
14
+ return true;
15
+ if (presentation !== "auto")
16
+ return false;
17
+ return (typeof window !== "undefined" &&
18
+ typeof window.matchMedia === "function" &&
19
+ window.matchMedia(SHEET_MEDIA_QUERY).matches);
20
+ }
21
+ export const DROPDOWN_CONTEXT_KEY = Symbol("dropdown");
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The look of a field-shaped control's box: Select's trigger and native select
3
+ * and PickerField draw it from here, so a picker beside a Select is the same
4
+ * box. Kept in one place so they cannot drift.
5
+ */
6
+ export type FieldControlSize = "sm" | "md" | "lg";
7
+ export interface FieldControlSizeClasses {
8
+ /** The trigger's box: a minimum height, so a label that wraps makes it taller. */
9
+ box: string;
10
+ /** The text size: 16px below `sm`, as Input. */
11
+ text: string;
12
+ /** The same box for a native `<select>`, which is always one line. */
13
+ native: string;
14
+ /** Where the trailing chevron sits. */
15
+ chevron: string;
16
+ }
17
+ /**
18
+ * Same fixed height scale as Button, IconButton and Input (32 / 40 / 48), and
19
+ * the same 16px text below `sm`. One line is exactly 32, 40 or 48px: the
20
+ * padding leaves room for the line and the border inside it, and is a step
21
+ * smaller below `sm`, where the text is 16px on a 24px line.
22
+ */
23
+ export declare function fieldControlSize(size: FieldControlSize): FieldControlSizeClasses;
24
+ /** The edge colour for a status: the field's own, or the status colour. */
25
+ export declare function fieldControlEdge(variant: string): string;
26
+ /** The field's surface, edge and states. */
27
+ export declare const FIELD_CONTROL_SURFACE = "focus-ring w-full min-w-0 cursor-pointer rounded-control border bg-input text-body transition-colors duration-(--duration-base) hover:bg-input-hover active:bg-input-active focus-visible:bg-input-focus focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:bg-input-disabled disabled:text-action-disabled-text";
28
+ /** What the trigger adds to the surface: one row, text and chevron apart. */
29
+ export declare const FIELD_CONTROL_TRIGGER = "focus-ring w-full min-w-0 cursor-pointer rounded-control border bg-input text-body transition-colors duration-(--duration-base) hover:bg-input-hover active:bg-input-active focus-visible:bg-input-focus focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:bg-input-disabled disabled:text-action-disabled-text flex items-center justify-between gap-2";
@@ -0,0 +1,32 @@
1
+ /**
2
+ * The look of a field-shaped control's box: Select's trigger and native select
3
+ * and PickerField draw it from here, so a picker beside a Select is the same
4
+ * box. Kept in one place so they cannot drift.
5
+ */
6
+ /**
7
+ * Same fixed height scale as Button, IconButton and Input (32 / 40 / 48), and
8
+ * the same 16px text below `sm`. One line is exactly 32, 40 or 48px: the
9
+ * padding leaves room for the line and the border inside it, and is a step
10
+ * smaller below `sm`, where the text is 16px on a 24px line.
11
+ */
12
+ export function fieldControlSize(size) {
13
+ if (size === "sm")
14
+ return { box: "min-h-8 px-3 py-1 max-sm:py-0 pointer-coarse:min-h-11", text: "text-sm max-sm:text-base", native: "h-8 ps-3 pe-9 pointer-coarse:h-11", chevron: "end-3" };
15
+ if (size === "lg")
16
+ return { box: "min-h-12 px-4 py-2", text: "text-base", native: "h-12 ps-4 pe-10", chevron: "end-4" };
17
+ return { box: "min-h-10 px-3 py-2 max-sm:py-1 pointer-coarse:min-h-11", text: "text-sm max-sm:text-base", native: "h-10 ps-3 pe-9 pointer-coarse:h-11", chevron: "end-3" };
18
+ }
19
+ /** The edge colour for a status: the field's own, or the status colour. */
20
+ export function fieldControlEdge(variant) {
21
+ return variant === "success"
22
+ ? "border-success focus-visible:border-success"
23
+ : variant === "warning"
24
+ ? "border-warning focus-visible:border-warning"
25
+ : variant === "error"
26
+ ? "border-error focus-visible:border-error"
27
+ : "border-input-border enabled:hover:border-input-border-hover";
28
+ }
29
+ /** The field's surface, edge and states. */
30
+ export const FIELD_CONTROL_SURFACE = "focus-ring w-full min-w-0 cursor-pointer rounded-control border bg-input text-body transition-colors duration-(--duration-base) hover:bg-input-hover active:bg-input-active focus-visible:bg-input-focus focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:bg-input-disabled disabled:text-action-disabled-text";
31
+ /** What the trigger adds to the surface: one row, text and chevron apart. */
32
+ export const FIELD_CONTROL_TRIGGER = `${FIELD_CONTROL_SURFACE} flex items-center justify-between gap-2`;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * What Input, Textarea and Select share about the text under a field, and
3
+ * DateField and TimeField through Input. Kept in one place so the four cannot
4
+ * drift: which message shows, in which variant, and what the control is
5
+ * described by.
6
+ */
7
+ import type { SemanticVariant } from "../types/variants.js";
8
+ export interface FieldMessageInput {
9
+ variant?: SemanticVariant;
10
+ message?: string;
11
+ hint?: string;
12
+ error?: string;
13
+ }
14
+ export interface FieldMessageState {
15
+ /** The variant the control is drawn in: `error` whenever there is an error. */
16
+ variant: SemanticVariant;
17
+ /** The text of the status message: the error, or else `message`. */
18
+ message: string;
19
+ /** Whether the status message is rendered. A `message` without a variant is not. */
20
+ showMessage: boolean;
21
+ /** Whether the hint is rendered. */
22
+ showHint: boolean;
23
+ }
24
+ /**
25
+ * `error` wins over `variant` and `message`: it sets the error variant and is
26
+ * the message. Without it, `message` shows in a `success`, `warning` or
27
+ * `error` variant, as it always has, and not in `default`: text for a field
28
+ * that is neither is a `hint`.
29
+ */
30
+ export declare function fieldMessageState({ variant, message, hint, error, }: FieldMessageInput): FieldMessageState;
31
+ export declare const fieldHintId: (fieldId: string) => string;
32
+ export declare const fieldMessageId: (fieldId: string) => string;
33
+ /**
34
+ * The ids a control is described by: the caller's own (a FormField around the
35
+ * field, say), then the hint, then the status message. Only ids of elements
36
+ * that are rendered; `undefined` when there are none, so no empty attribute.
37
+ */
38
+ export declare function fieldDescribedBy(fieldId: string, state: Pick<FieldMessageState, "showMessage" | "showHint">, own?: string | null): string | undefined;
39
+ /** What Textarea's `countText` is given: the characters typed, the limit, and how many are left. */
40
+ export interface TextareaCount {
41
+ length: number;
42
+ max: number;
43
+ remaining: number;
44
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * What Input, Textarea and Select share about the text under a field, and
3
+ * DateField and TimeField through Input. Kept in one place so the four cannot
4
+ * drift: which message shows, in which variant, and what the control is
5
+ * described by.
6
+ */
7
+ /**
8
+ * `error` wins over `variant` and `message`: it sets the error variant and is
9
+ * the message. Without it, `message` shows in a `success`, `warning` or
10
+ * `error` variant, as it always has, and not in `default`: text for a field
11
+ * that is neither is a `hint`.
12
+ */
13
+ export function fieldMessageState({ variant = "default", message = "", hint = "", error = "", }) {
14
+ const resolvedVariant = error ? "error" : variant;
15
+ const resolvedMessage = error || message;
16
+ return {
17
+ variant: resolvedVariant,
18
+ message: resolvedMessage,
19
+ showMessage: !!resolvedMessage && resolvedVariant !== "default",
20
+ showHint: !!hint,
21
+ };
22
+ }
23
+ export const fieldHintId = (fieldId) => `${fieldId}-hint`;
24
+ export const fieldMessageId = (fieldId) => `${fieldId}-message`;
25
+ /**
26
+ * The ids a control is described by: the caller's own (a FormField around the
27
+ * field, say), then the hint, then the status message. Only ids of elements
28
+ * that are rendered; `undefined` when there are none, so no empty attribute.
29
+ */
30
+ export function fieldDescribedBy(fieldId, state, own) {
31
+ return ([
32
+ own,
33
+ state.showHint ? fieldHintId(fieldId) : "",
34
+ state.showMessage ? fieldMessageId(fieldId) : "",
35
+ ]
36
+ .filter(Boolean)
37
+ .join(" ") || undefined);
38
+ }
@@ -0,0 +1,200 @@
1
+ /**
2
+ * Keeps a floating box (a menu, a panel, a tooltip) where it can be seen.
3
+ *
4
+ * One module for everything that opens next to a trigger. Two layers:
5
+ *
6
+ * - `pickSide` and `shiftIntoViewport` are the two decisions every such box
7
+ * needs: which side of its trigger it opens on, and how far it has to move
8
+ * along that side to stay on screen. Tooltip uses them as they are.
9
+ * - `fitPanel` builds on them for a panel that hangs from one edge of its
10
+ * anchor (Dropdown, Select's list, NavigationMenuContent): it also narrows
11
+ * and shortens a panel too large for the screen. `measurePlacement` reads
12
+ * the layout for it, and `watchViewport` re-runs it while the panel is open.
13
+ *
14
+ * The arithmetic is pure, so it can be tested without a layout.
15
+ *
16
+ * The screen is not the only thing that cuts a panel off. Inside a box that
17
+ * scrolls (a Modal's body, a list with its own scrollbar) the box clips it
18
+ * first. `measurePlacement` takes the nearest such box into account: it
19
+ * decides which side the panel opens on, and when the panel fits on neither
20
+ * side it says where to put the panel with `position: fixed`, which a
21
+ * scrolling ancestor does not clip.
22
+ */
23
+ export type PanelBlock = "bottom" | "top";
24
+ export type PanelInline = "start" | "end";
25
+ export interface PanelBox {
26
+ left: number;
27
+ right: number;
28
+ top: number;
29
+ bottom: number;
30
+ }
31
+ export interface FitPanelInput {
32
+ /** The box the panel is positioned against, in viewport coordinates. */
33
+ anchor: PanelBox;
34
+ /** The panel's natural size, measured with no limit on it. */
35
+ panel: {
36
+ width: number;
37
+ height: number;
38
+ };
39
+ viewport: {
40
+ width: number;
41
+ height: number;
42
+ };
43
+ /** The side asked for. It is kept whenever the panel fits there. */
44
+ block: PanelBlock;
45
+ inline: PanelInline;
46
+ /** Right-to-left layout: `start` is then the right edge. */
47
+ rtl?: boolean;
48
+ /** Room kept between the panel and every edge of the viewport. */
49
+ margin?: number;
50
+ /** Distance between the anchor and the panel. */
51
+ gap?: number;
52
+ /** False keeps the panel on the `block` side asked for, whatever fits. */
53
+ flipBlock?: boolean;
54
+ /** False keeps it on the `inline` edge asked for and slides it back inside instead. */
55
+ flipInline?: boolean;
56
+ /**
57
+ * The inside of the nearest ancestor that clips, in viewport coordinates.
58
+ * It decides which side the panel opens on and how far it slides; it
59
+ * never limits the panel's size, which only the viewport does.
60
+ */
61
+ clip?: PanelBox | null;
62
+ }
63
+ export interface PanelFit {
64
+ block: PanelBlock;
65
+ inline: PanelInline;
66
+ /**
67
+ * Distance to put between the anchor's `inline` edge and the panel's, for
68
+ * `inset-inline-start` or `inset-inline-end`. 0 when the panel fits as it
69
+ * is; otherwise what slides it back inside.
70
+ */
71
+ inlineOffset: number;
72
+ /** A limit to set, or null when the panel fits without one. */
73
+ maxWidth: number | null;
74
+ maxHeight: number | null;
75
+ /** Where the panel's box ends up, in viewport coordinates, and how wide it is there. */
76
+ left: number;
77
+ top: number;
78
+ width: number;
79
+ /** False when part of the panel is outside `clip` (or the viewport) even so. */
80
+ visible: boolean;
81
+ }
82
+ export type FloatingSide = "top" | "bottom" | "left" | "right";
83
+ /**
84
+ * The side a floating box of `size` opens on: the preferred one when it fits
85
+ * there, the opposite one when only that fits, and otherwise whichever of the
86
+ * two has more room.
87
+ *
88
+ * `gap` is the distance between trigger and box; `margin` is how close to the
89
+ * viewport edge the box may come. `clip` is the inside of an ancestor that
90
+ * cuts the box off, when there is one: the box then has to fit in what both
91
+ * leave.
92
+ */
93
+ export declare function pickSide(preferred: FloatingSide, trigger: PanelBox, size: {
94
+ width: number;
95
+ height: number;
96
+ }, viewport: {
97
+ width: number;
98
+ height: number;
99
+ }, { gap, margin, clip, }?: {
100
+ gap?: number;
101
+ margin?: number;
102
+ clip?: PanelBox | null;
103
+ }): FloatingSide;
104
+ /**
105
+ * How far `box` has to move, in px, to lie inside the viewport with `margin`
106
+ * to spare. Zero on an axis where it already does. A box larger than the
107
+ * viewport is aligned to the start edge (top, left), where its text begins.
108
+ */
109
+ export declare function shiftIntoViewport(box: PanelBox, viewport: {
110
+ width: number;
111
+ height: number;
112
+ }, margin?: number): {
113
+ x: number;
114
+ y: number;
115
+ };
116
+ export interface ViewportPoint {
117
+ x: number;
118
+ y: number;
119
+ }
120
+ /**
121
+ * True when `point` lies in the triangle `a`, `b`, `c`, edges included. For
122
+ * the path a pointer takes from a trigger to its floating box: as long as it
123
+ * stays in the triangle between where it left and the near edge of the box,
124
+ * it is on its way there.
125
+ */
126
+ export declare function insideTriangle(point: ViewportPoint, a: ViewportPoint, b: ViewportPoint, c: ViewportPoint): boolean;
127
+ /** Where the panel fits, starting from the side asked for. */
128
+ export declare function fitPanel(input: FitPanelInput): PanelFit;
129
+ /** A fit that changes nothing: the panel where the CSS puts it, with no limits. */
130
+ export declare function unfitted(block: PanelBlock, inline: PanelInline): PanelFit;
131
+ export interface MeasureOptions {
132
+ margin?: number;
133
+ gap?: number;
134
+ flipBlock?: boolean;
135
+ flipInline?: boolean;
136
+ /** Overrides the anchor's own direction; `false` for a panel placed with `left`, not `inset-inline-start`. */
137
+ rtl?: boolean;
138
+ clip?: PanelBox | null;
139
+ }
140
+ /**
141
+ * Measures `panel` against `anchor` and returns its fit. Any limit already on
142
+ * the panel is lifted for the measurement, so the answer does not depend on
143
+ * the previous one. Call it before paint (from an effect) and apply the result.
144
+ */
145
+ export declare function measureFit(anchor: Element, panel: HTMLElement, preferred: {
146
+ block: PanelBlock;
147
+ inline: PanelInline;
148
+ }, options?: MeasureOptions): PanelFit;
149
+ /**
150
+ * The nearest ancestor of `element` that clips what reaches outside it (any
151
+ * `overflow` but `visible`), with the box it clips to: its inside, without
152
+ * borders or scrollbars, in viewport coordinates. Null when only the viewport
153
+ * clips.
154
+ */
155
+ export declare function clippingAncestor(element: Element): {
156
+ element: HTMLElement;
157
+ box: PanelBox;
158
+ } | null;
159
+ export interface PanelPlacement extends PanelFit {
160
+ /**
161
+ * Set when the panel has to leave a clipping ancestor to be seen: the
162
+ * `top`, `left` and `width` to give it with `position: fixed`. Null when
163
+ * it stays where the CSS puts it.
164
+ *
165
+ * The width is the one the panel has where the CSS puts it. A fixed box
166
+ * is sized against the viewport instead of the anchor, so without it the
167
+ * panel would change width as it leaves the box.
168
+ */
169
+ fixed: {
170
+ left: number;
171
+ top: number;
172
+ width: number;
173
+ } | null;
174
+ }
175
+ /**
176
+ * The fit of `panel`, with the nearest clipping ancestor of `anchor` taken
177
+ * into account.
178
+ *
179
+ * - The panel fits inside that ancestor on the side asked for: nothing changes.
180
+ * - It fits on the other side: it opens there.
181
+ * - It fits on neither: it is placed against the viewport with `fixed`, on the
182
+ * side the viewport has room for, and reaches out of the ancestor. Only
183
+ * while some of the anchor can be seen in the ancestor: scrolled out of it,
184
+ * the anchor takes the panel with it.
185
+ * - It cannot be: something between the panel and that ancestor is the
186
+ * containing block of fixed descendants (a `transform`, a `filter`). It then
187
+ * opens on the side of the ancestor with more room, and is cut where that
188
+ * ends. That is the limit of what a panel can do without leaving its place
189
+ * in the DOM, and it stays there so that the keyboard, focus and a dialog's
190
+ * focus trap treat it as part of what opened it.
191
+ */
192
+ export declare function measurePlacement(anchor: Element, panel: HTMLElement, preferred: {
193
+ block: PanelBlock;
194
+ inline: PanelInline;
195
+ }, options?: MeasureOptions): PanelPlacement;
196
+ /**
197
+ * Calls `update` when the viewport changes size or anything outside `panel`
198
+ * scrolls, at most once a frame. Returns the function that stops it.
199
+ */
200
+ export declare function watchViewport(update: () => void, panel?: Element | null): () => void;