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
@@ -1,22 +1,69 @@
1
1
  export * from './events.js';
2
2
  export * from './variants.js';
3
3
  export * from './page.types.js';
4
- import type { Component } from 'svelte';
4
+ import type { Component, Snippet } from 'svelte';
5
+ import type { HTMLAnchorAttributes, HTMLAttributes, HTMLButtonAttributes, HTMLInputAttributes, HTMLTextareaAttributes, SVGAttributes } from 'svelte/elements';
6
+ import type { BottomTabBarItem } from '../components/util/bottom-tab-bar.js';
7
+ import type { AppShellNavigationContext, AppShellNavigationMode } from '../components/util/app-shell.js';
8
+ import type { CalendarEvent, CalendarStrings } from '../components/util/calendar.js';
9
+ import type { Photo, PhotoGridSelectDetail, PhotoGridStrings, PhotoKey, PhotoViewerAction, PhotoViewerCloseReason, PhotoViewerStrings } from '../components/util/photo.js';
10
+ import type { BottomSheetCloseReason, BottomSheetSnap } from '../components/util/bottom-sheet.js';
11
+ import type { BadgeVariant, ButtonSize, ButtonVariant, CardVariant, OnFillTone, SurfaceTone, ExtendedSemanticVariant, SemanticVariant, SizeVariant } from './variants.js';
12
+ import type { AvatarGroupStrings, AvatarPerson, AvatarSize } from '../components/util/avatar.js';
13
+ import type { ChartColor, ChartDatum, ChartFormat, ChartSeries } from '../components/util/chart.js';
14
+ import type { ProgressStrings } from '../components/util/progress.js';
15
+ import type { SkeletonStrings } from '../components/util/skeleton.js';
16
+ import type { CodeFieldMode, CodeFieldStrings } from '../components/util/code-field.js';
17
+ import type { RatingStrings } from '../components/util/rating.js';
18
+ import type { StepperItem, StepperLayout, StepperStrings } from '../components/util/stepper.js';
19
+ import type { SegmentedControlOption } from '../components/util/segmented-control.js';
5
20
  export type ZabiComponent<T extends Record<string, any> = Record<string, any>, E extends Record<string, any> = Record<string, any>> = Component<T, E>;
6
- export interface ButtonProps {
7
- variant?: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'info' | 'ghost' | 'link' | 'neutral';
8
- size?: 'sm' | 'md' | 'lg';
21
+ export interface ButtonProps extends Omit<HTMLButtonAttributes, 'class'> {
22
+ /**
23
+ * `success`, `warning`, `info` and `neutral` are deprecated: Button never
24
+ * styled them, and they render as `primary`.
25
+ */
26
+ variant?: ButtonVariant | 'success' | 'warning' | 'info' | 'neutral';
27
+ size?: ButtonSize;
9
28
  disabled?: boolean;
10
29
  loading?: boolean;
11
30
  type?: 'button' | 'submit' | 'reset';
12
- className?: string;
31
+ /**
32
+ * Where the link goes. Makes this an `<a>` that looks the same. While
33
+ * `disabled` or `loading` it has no `href` and is `aria-disabled`.
34
+ */
35
+ href?: string;
36
+ /** With `href`: where the link opens. */
37
+ target?: HTMLAnchorAttributes['target'];
38
+ /** With `href`: the link's relationship, such as `noopener`. */
39
+ rel?: HTMLAnchorAttributes['rel'];
40
+ /** With `href`: download the address instead of opening it. */
41
+ download?: HTMLAnchorAttributes['download'];
42
+ hreflang?: HTMLAnchorAttributes['hreflang'];
43
+ referrerpolicy?: HTMLAnchorAttributes['referrerpolicy'];
44
+ ping?: HTMLAnchorAttributes['ping'];
13
45
  text?: string;
46
+ /** Stretch to the width of the container. */
47
+ fullWidth?: boolean;
48
+ /** @deprecated use `fullWidth`. */
49
+ isFullWidth?: boolean;
50
+ class?: string;
51
+ children?: Snippet;
52
+ /** @deprecated never accepted by the component; use `class`. */
53
+ className?: string;
54
+ /** @deprecated never accepted by the component; render the icon in `children`. */
14
55
  iconLeft?: string | any;
56
+ /** @deprecated never accepted by the component; render the icon in `children`. */
15
57
  iconRight?: string | any;
58
+ /** @deprecated never accepted by the component; use `aria-label`. */
16
59
  ariaLabel?: string;
60
+ /** @deprecated never accepted by the component; use `aria-describedby`. */
17
61
  ariaDescribedBy?: string;
62
+ /** @deprecated never accepted by the component; use `aria-expanded`. */
18
63
  ariaExpanded?: boolean;
64
+ /** @deprecated never accepted by the component; use `aria-controls`. */
19
65
  ariaControls?: string;
66
+ /** @deprecated never accepted by the component; use `aria-pressed`. */
20
67
  ariaPressed?: boolean;
21
68
  }
22
69
  export interface ButtonEvents {
@@ -25,24 +72,106 @@ export interface ButtonEvents {
25
72
  event: MouseEvent;
26
73
  };
27
74
  }
28
- export interface HeadingProps {
75
+ export interface HeadingProps extends Omit<HTMLAttributes<HTMLHeadingElement>, 'class'> {
29
76
  level?: 1 | 2 | 3 | 4 | 5 | 6;
77
+ /** Visual size, when it should differ from the semantic level. */
78
+ size?: 1 | 2 | 3 | 4 | 5 | 6;
79
+ /** Heading text. Ignored when `children` is provided. */
80
+ text?: string;
81
+ /** Text colour: `headline` by default; `inherit`, `on-brand` or `on-accent` on a filled block. */
82
+ tone?: 'headline' | OnFillTone;
83
+ /** `heading` (default) or `display`: the second face and larger steps. */
84
+ variant?: 'heading' | 'display';
85
+ class?: string;
86
+ children?: Snippet;
87
+ /** @deprecated never accepted by the component; use `class`. */
30
88
  className?: string;
31
89
  }
32
- export interface CardProps {
33
- variant?: 'default' | 'elevated' | 'outlined' | 'flat';
34
- size?: 'sm' | 'md' | 'lg';
90
+ export interface BlockProps extends Omit<HTMLAttributes<HTMLElement>, 'class'> {
91
+ /** `neutral` (the card surface), `tint`, `brand` or `accent`. */
92
+ tone?: SurfaceTone;
93
+ /** A fill the app chooses, any CSS colour. Wins over `tone`; the app checks the contrast of the pair. */
94
+ fill?: string;
95
+ /** The label colour on `fill`. */
96
+ onFill?: string;
97
+ /** Inner space: `none`, `sm`, `md` (default) or `lg`. */
98
+ padding?: 'none' | 'sm' | 'md' | 'lg';
99
+ /** The element, `div` by default. */
100
+ as?: 'div' | 'section' | 'header' | 'footer' | 'article' | 'aside';
101
+ /** A Block does not break out of a padded parent: put it outside, or pass a negative inline margin (`-mx-4`). */
102
+ class?: string;
103
+ children?: Snippet;
104
+ }
105
+ export interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class'> {
106
+ variant?: CardVariant;
107
+ /** `neutral` (default), `tint`, `brand` or `accent`; brand and accent re-point text, links and controls inside. */
108
+ tone?: SurfaceTone;
109
+ /** A fill the app chooses, any CSS colour. Wins over `tone`; the app checks the contrast of the pair. */
110
+ fill?: string;
111
+ /** The label colour on `fill`. */
112
+ onFill?: string;
113
+ /** The card is an `<a>`. A link card must not contain other interactive elements. */
114
+ href?: string;
115
+ target?: HTMLAnchorAttributes['target'];
116
+ rel?: string;
117
+ /** The card is a `<button>` (ignored with `href`): `submit` posts the form around it. Like a link card it must not contain other interactive elements. */
118
+ type?: 'submit' | 'button' | 'reset';
119
+ /** With `type`: the name the button submits under. */
120
+ name?: string;
121
+ /** With `type`: what the button submits. */
122
+ value?: string;
123
+ /** With `type`: the id of the form it belongs to. */
124
+ form?: string;
125
+ /** With `type`: the card cannot be pressed. */
126
+ disabled?: boolean;
127
+ /** With `type`: the action is on its way (`aria-busy`, `aria-disabled`); the press is swallowed and the card stays a Tab stop. */
128
+ loading?: boolean;
129
+ size?: SizeVariant;
35
130
  fullWidth?: boolean;
131
+ class?: string;
132
+ /** @deprecated use `class`. */
36
133
  className?: string;
37
134
  onclick?: (event: MouseEvent) => void | Promise<void>;
38
135
  /** Required when card is interactive (has onclick) for accessibility */
39
136
  ariaLabel?: string;
137
+ children?: Snippet;
40
138
  }
41
- export interface InputProps {
139
+ export interface InputProps extends Omit<HTMLInputAttributes, 'class' | 'size' | 'value' | 'type' | 'id' | 'name' | 'placeholder' | 'required' | 'disabled' | 'oninput' | 'onblur' | 'aria-label' | 'aria-describedby'> {
140
+ /** Omit to auto-generate. */
141
+ id?: string;
42
142
  type?: string;
43
143
  value?: string;
144
+ name?: string;
145
+ label?: string;
146
+ /** True when a FormField supplies the visible label. */
147
+ hideLabel?: boolean;
44
148
  placeholder?: string;
149
+ required?: boolean;
45
150
  disabled?: boolean;
151
+ loading?: boolean;
152
+ size?: SizeVariant;
153
+ variant?: SemanticVariant;
154
+ /** Status text under the field. Shown with a `success`, `warning` or `error` variant; for neutral help, use `hint`. */
155
+ message?: string;
156
+ /** Help text under the field, read out with it. */
157
+ hint?: string;
158
+ /** An error under the field. It marks the field invalid and is announced; it wins over `variant` and `message`. */
159
+ error?: string;
160
+ /** Ids of other elements that describe the field. The hint and the message are added after them. */
161
+ 'aria-describedby'?: string | null;
162
+ /** Drawn inside the field, before the text. */
163
+ leading?: Snippet;
164
+ /** Drawn inside the field, after the text. */
165
+ trailing?: Snippet;
166
+ /** With `type="password"`: a button that shows the password as text, and hides it again. On by default; `false` leaves it out. */
167
+ revealable?: boolean;
168
+ /** Accessible name of that button, the same in both states. */
169
+ revealLabel?: string;
170
+ oninput?: (event: Event) => void;
171
+ onblur?: (event: Event) => void;
172
+ 'aria-label'?: string;
173
+ class?: string;
174
+ /** @deprecated never accepted by the component; use `class`. */
46
175
  className?: string;
47
176
  }
48
177
  export interface InputEvents {
@@ -61,9 +190,36 @@ export interface InputEvents {
61
190
  event: FocusEvent;
62
191
  };
63
192
  }
64
- export interface CheckboxProps {
193
+ export interface CheckboxProps extends Omit<HTMLInputAttributes, 'class' | 'id' | 'name' | 'value' | 'disabled' | 'checked' | 'type' | 'onchange'> {
194
+ id?: string;
195
+ name?: string;
196
+ value?: string;
65
197
  checked?: boolean;
198
+ defaultChecked?: boolean;
66
199
  disabled?: boolean;
200
+ loading?: boolean;
201
+ label?: string;
202
+ /**
203
+ * Drawn inside the one label, between the box and the label text. A
204
+ * leading image should have an empty alt: the label names the row.
205
+ */
206
+ leading?: Snippet;
207
+ /** A line under the label, inside it, tied to the box with `aria-describedby`; not part of the name. */
208
+ description?: string;
209
+ /** Where the box sits in the row: `end` puts it last, at the far edge. */
210
+ controlPosition?: 'start' | 'end';
211
+ variant?: SemanticVariant;
212
+ /** Status text under the control. Shown with a `success`, `warning` or `error` variant; for neutral help, use `hint`. */
213
+ message?: string;
214
+ /** Help text under the control, read out with it. */
215
+ hint?: string;
216
+ /** An error under the control: an alert, tied to the input; a checkbox also gets `aria-invalid`. It wins over `variant` and `message`. */
217
+ error?: string;
218
+ onchange?: (event: Event) => void;
219
+ /** Same as `onchange`; both are called. */
220
+ onChange?: (event: Event) => void;
221
+ class?: string;
222
+ /** @deprecated never accepted by the component; use `class`. */
67
223
  className?: string;
68
224
  }
69
225
  export interface CheckboxEvents {
@@ -72,31 +228,147 @@ export interface CheckboxEvents {
72
228
  event: Event;
73
229
  };
74
230
  }
75
- export interface SelectProps {
76
- options: Array<{
77
- value: string;
231
+ export interface SelectProps extends Omit<HTMLButtonAttributes, 'class' | 'value' | 'name' | 'disabled' | 'type' | 'onchange' | 'onclick' | 'aria-describedby' | 'children'> {
232
+ /** Id of the trigger. Omit to auto-generate. */
233
+ id?: string;
234
+ options?: Array<{
235
+ value: string | number;
78
236
  label: string;
237
+ disabled?: boolean;
238
+ lang?: string;
79
239
  }>;
80
- value?: string;
240
+ value?: string | number | undefined;
81
241
  searchable?: boolean;
82
242
  searchPlaceholder?: string;
83
243
  maxMenuHeight?: string;
84
244
  menuWidth?: string;
245
+ /** `auto` (the default): a BottomSheet on a phone, under the field elsewhere. */
246
+ presentation?: "auto" | "popover" | "sheet" | "native";
247
+ /** In a sheet, a short list (up to six options) without a search field gets a sheet as tall as the list. Default `true`; `false` keeps the half-height sheet. */
248
+ sheetFit?: boolean;
249
+ /** The component's own texts; see `SelectStrings`. The single-text props win over it. */
250
+ strings?: Partial<import("../components/util/select.js").SelectStrings>;
85
251
  noResultsText?: string;
252
+ isLoading?: boolean;
253
+ loadingText?: string;
254
+ emptyStateTitle?: string;
255
+ emptyStateDescription?: string;
256
+ emptyStateActionLabel?: string;
257
+ onEmptyStateAction?: () => void;
258
+ placeholder?: string;
259
+ label?: string;
260
+ /** When set, a hidden input submits the selected value with native forms. */
261
+ name?: string;
262
+ required?: boolean;
86
263
  disabled?: boolean;
264
+ size?: SizeVariant;
265
+ variant?: 'default' | 'success' | 'warning' | 'error';
266
+ /** Status text under the field. Shown with a `success`, `warning` or `error` variant; for neutral help, use `hint`. */
267
+ message?: string;
268
+ /** Help text under the field, read out with it. */
269
+ hint?: string;
270
+ /** An error under the field. It marks the field invalid and is announced; it wins over `variant` and `message`. */
271
+ error?: string;
272
+ /** Ids of other elements that describe the field. The hint and the message are added after them. */
273
+ 'aria-describedby'?: string | null;
274
+ onchange?: (event: Event) => void;
275
+ class?: string;
276
+ /** @deprecated never accepted by the component; use `class`. */
87
277
  className?: string;
88
278
  }
279
+ export interface PickerFieldProps extends Omit<HTMLButtonAttributes, 'class' | 'value' | 'name' | 'disabled' | 'type' | 'onclick' | 'aria-describedby' | 'aria-haspopup' | 'aria-expanded' | 'aria-controls' | 'children'> {
280
+ /** Id of the control. Omit to auto-generate. */
281
+ id?: string;
282
+ /** The label above the field. It is part of the control's name. */
283
+ label?: string;
284
+ /** The text of what is chosen. It is display text; `formValue` is what a form sends. */
285
+ value?: string;
286
+ /** Shown in the placeholder colour while there is no `value`. */
287
+ placeholder?: string;
288
+ /** An icon or an avatar before the text. */
289
+ leading?: Snippet;
290
+ /** Replaces the chevron at the end: a calendar or a clock, say. It is decoration, so it should be `aria-hidden`. */
291
+ trailing?: Snippet;
292
+ /** Replaces the value text, for rich content. The control is still named by `value`, so give that too. */
293
+ children?: Snippet;
294
+ size?: 'sm' | 'md' | 'lg';
295
+ disabled?: boolean;
296
+ /** Status text under the field. Shown with a `success`, `warning` or `error` variant; for neutral help, use `hint`. */
297
+ message?: string;
298
+ variant?: 'default' | 'success' | 'warning' | 'error';
299
+ /** Help text under the field, read out with it. */
300
+ hint?: string;
301
+ /** An error under the field, announced. A button cannot take `aria-invalid`, so the error is the error edge colour and the described-by message; it wins over `variant` and `message`. */
302
+ error?: string;
303
+ /** What the control opens: `aria-haspopup`. Default `"dialog"`. Not put on a link. */
304
+ haspopup?: 'dialog' | 'listbox' | 'menu' | 'true';
305
+ /** Whether what it opens is open now: `aria-expanded`, and the chevron turns. Leave it out and neither is set. Not put on a link. */
306
+ expanded?: boolean;
307
+ /** Id of what it opens: `aria-controls`. */
308
+ controls?: string;
309
+ /** Makes the control a link to this address, which works without scripts: a page that does the picking. With scripts, `onclick` may call `preventDefault()` and open a sheet instead. */
310
+ href?: string;
311
+ /** With `href`: where the link opens. */
312
+ target?: HTMLAnchorAttributes['target'];
313
+ /** With `href`: the link's relationship, such as `noopener`. */
314
+ rel?: HTMLAnchorAttributes['rel'];
315
+ /** The name a hidden input submits `formValue` under. Without it there is no hidden input. */
316
+ name?: string;
317
+ /** What the form submits for the choice, such as an id. */
318
+ formValue?: string;
319
+ /** The inner `<button>` (or `<a>`). Bindable: the app focuses it when its sheet closes, so a keyboard user is back where they were. */
320
+ element?: HTMLButtonElement | HTMLAnchorElement | null;
321
+ /** Ids of other elements that describe the field. The hint and the message are added after them. */
322
+ 'aria-describedby'?: string | null;
323
+ onclick?: (event: MouseEvent) => void;
324
+ class?: string;
325
+ }
89
326
  export interface SelectEvents {
90
327
  change: {
91
328
  value: string;
92
329
  event: Event;
93
330
  };
94
331
  }
95
- export interface TextareaProps {
332
+ export interface TextareaProps extends Omit<HTMLTextareaAttributes, 'class' | 'value' | 'id' | 'name' | 'placeholder' | 'required' | 'disabled' | 'rows' | 'oninput' | 'aria-describedby'> {
333
+ id?: string;
96
334
  value?: string;
335
+ name?: string;
336
+ label?: string;
337
+ hideLabel?: boolean;
97
338
  placeholder?: string;
339
+ required?: boolean;
98
340
  rows?: number;
341
+ /** The resize grip: `auto` (default) is vertical with a mouse and none on a touch screen. */
342
+ resize?: 'auto' | 'none' | 'vertical';
343
+ /** The field grows with its content, from `rows` up to `maxRows`. */
344
+ autogrow?: boolean;
345
+ /** The tallest an `autogrow` field gets, in rows. */
346
+ maxRows?: number;
99
347
  disabled?: boolean;
348
+ loading?: boolean;
349
+ size?: SizeVariant;
350
+ variant?: SemanticVariant;
351
+ /** Status text under the field. Shown with a `success`, `warning` or `error` variant; for neutral help, use `hint`. */
352
+ message?: string;
353
+ /** Help text under the field, read out with it. */
354
+ hint?: string;
355
+ /** An error under the field. It marks the field invalid and is announced; it wins over `variant` and `message`. */
356
+ error?: string;
357
+ /** A character count under the field. It needs `maxlength`, and is part of the field's description. */
358
+ count?: boolean;
359
+ /** The count is shown from this many characters on. `0` (default): always. */
360
+ countFrom?: number;
361
+ /** The words of the count. Default: "12 / 2000". */
362
+ countText?: (count: {
363
+ length: number;
364
+ max: number;
365
+ remaining: number;
366
+ }) => string;
367
+ /** Ids of other elements that describe the field. The hint and the message are added after them. */
368
+ 'aria-describedby'?: string | null;
369
+ oninput?: (event: Event) => void;
370
+ class?: string;
371
+ /** @deprecated never accepted by the component; use `class`. */
100
372
  className?: string;
101
373
  }
102
374
  export interface TextareaEvents {
@@ -109,38 +381,221 @@ export interface TextareaEvents {
109
381
  event: Event;
110
382
  };
111
383
  }
112
- export interface ModalProps {
113
- open?: boolean;
384
+ export interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'title' | 'role' | 'onclick' | 'onkeydown' | 'onclose' | 'children'> {
385
+ /** Open state. Bindable. */
386
+ isOpen?: boolean;
114
387
  title?: string;
388
+ description?: string;
389
+ size?: 'sm' | 'md' | 'lg';
390
+ role?: 'dialog' | 'alertdialog';
391
+ showClose?: boolean;
392
+ closeLabel?: string;
393
+ /** CSS selector, inside the panel, of the control that takes focus on open. */
394
+ initialFocus?: string;
395
+ /** Render the overlay in `document.body`. */
396
+ portal?: boolean;
397
+ /** When false, Escape, a backdrop click and the close button do not close the modal. */
398
+ dismissible?: boolean;
399
+ /** Fills the screen: `true` at every width, `'mobile'` below 768px only. */
400
+ fullScreen?: boolean | 'mobile';
401
+ onclose?: (detail: {
402
+ reason: 'escape' | 'backdrop' | 'close-button';
403
+ }) => void;
404
+ /** @deprecated for close reporting: use `onclose`. Still called on close. */
405
+ onclick?: (event: Event) => void;
406
+ onkeydown?: (event: Event) => void;
407
+ 'data-testid'?: string;
408
+ class?: string;
409
+ children?: Snippet;
410
+ footer?: Snippet;
411
+ /** @deprecated never accepted by the component; use `isOpen`. */
412
+ open?: boolean;
413
+ /** @deprecated never accepted by the component; use `class`. */
115
414
  className?: string;
116
415
  }
117
416
  export interface ModalEvents {
118
417
  }
119
418
  export interface AlertProps {
120
- type?: 'success' | 'error' | 'warning' | 'info';
121
- message: string;
419
+ variant?: ExtendedSemanticVariant | 'brand';
420
+ title?: string;
421
+ message?: string;
422
+ closable?: boolean;
423
+ /** Accessible name of the dismiss button a `closable` alert has. */
424
+ closeLabel?: string;
425
+ /** Visible state. Bindable. */
426
+ open?: boolean;
427
+ /** Shrink to content instead of filling the container. */
428
+ inline?: boolean;
429
+ /** Draws the tinted edge (default `true`). `false` keeps the 1px and makes it transparent; `--zabi-alert-border-width: 0px` on any ancestor removes it for every alert under it. */
430
+ bordered?: boolean;
431
+ onclick?: (event: Event) => void;
432
+ class?: string;
433
+ /** @deprecated use `class`. */
122
434
  className?: string;
435
+ children?: Snippet;
436
+ /** @deprecated never accepted by the component; use `variant`. */
437
+ type?: 'success' | 'error' | 'warning' | 'info';
123
438
  }
124
- export interface BadgeProps {
125
- variant?: 'default' | 'success' | 'warning' | 'error' | 'info';
439
+ export interface StatProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class'> {
440
+ /** The figure, shown as given. */
441
+ value: string | number;
442
+ label?: string;
443
+ /** Drawn after the value, smaller, on the same baseline. */
444
+ unit?: string;
445
+ size?: 'sm' | 'md' | 'lg';
446
+ align?: 'start' | 'center' | 'end';
447
+ labelPosition?: 'below' | 'above';
448
+ class?: string;
449
+ /** Replaces `value` for a figure that needs markup. */
450
+ children?: Snippet;
451
+ }
452
+ export interface SpeechBubbleProps extends Omit<HTMLAttributes<HTMLElement>, 'class'> {
453
+ /** The caption that names the quotation; a `figcaption`. A snippet for the app's own text style. */
454
+ label?: string | Snippet;
455
+ /** Keeps the caption for assistive technology and takes it off the screen. */
456
+ labelHidden?: boolean;
457
+ /** The side the tail is on; follows the text direction. */
458
+ side?: 'end' | 'start';
459
+ /** `ink` (default) or `paper`; `--zabi-bubble-fill` and `--zabi-bubble-text` win over both. */
460
+ tone?: 'ink' | 'paper';
461
+ /** A drawing on the top corner of the tail's side, hidden from assistive technology. */
462
+ decoration?: Snippet;
463
+ class?: string;
464
+ /** The quoted text. */
465
+ children?: Snippet;
466
+ }
467
+ export interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'class'> {
468
+ variant?: BadgeVariant;
469
+ size?: SizeVariant;
470
+ emphasis?: 'subtle' | 'solid';
471
+ /** Draws the family's edge on a subtle badge. Default `false`. */
472
+ bordered?: boolean;
473
+ /** Label text. Ignored when `children` is provided. */
126
474
  text?: string;
475
+ showIcon?: boolean;
476
+ class?: string;
477
+ children?: Snippet;
478
+ /** @deprecated never accepted by the component; use `class`. */
127
479
  className?: string;
128
480
  }
481
+ export interface ChipProps extends Omit<HTMLButtonAttributes, 'class' | 'type' | 'value' | 'onchange' | 'children'> {
482
+ /** Makes the chip a link to this address, which works without scripts. */
483
+ href?: string;
484
+ target?: HTMLAnchorAttributes['target'];
485
+ rel?: HTMLAnchorAttributes['rel'];
486
+ download?: HTMLAnchorAttributes['download'];
487
+ hreflang?: HTMLAnchorAttributes['hreflang'];
488
+ /** With `href`: what `aria-current` says while `selected`. Default `"true"`. */
489
+ current?: 'page' | 'true' | 'step' | 'location' | 'date' | 'time';
490
+ /** `checkbox` or `radio`: a real input under the chip. `submit` or `button`: a button that does not toggle (`selected` is drawn and said with `aria-pressed`, the app decides it). Without it (and without `href`) the chip is a toggle button. */
491
+ type?: 'checkbox' | 'radio' | 'submit' | 'button';
492
+ name?: string;
493
+ value?: string;
494
+ /** The chip is chosen. Bindable. */
495
+ selected?: boolean;
496
+ required?: boolean;
497
+ form?: string;
498
+ /** 28, 32 or 40px tall. Default `md`. */
499
+ size?: 'sm' | 'md' | 'lg';
500
+ /** An icon or an avatar before the label. */
501
+ leading?: Snippet;
502
+ /** A check icon before the label while selected. On for a checkbox and a toggle button, off for a link and a radio. */
503
+ checkmark?: boolean;
504
+ /** A button chip (`submit`, `button` or the toggle) while its action is on its way: `aria-busy` and `aria-disabled`, a spinner, the press swallowed, width and focus kept. Ignored by a link and by `checkbox` / `radio`. */
505
+ loading?: boolean;
506
+ /** Called with the new `selected` when a person changes it. */
507
+ onchange?: (selected: boolean) => void;
508
+ class?: string;
509
+ children?: Snippet;
510
+ }
511
+ export interface ChipGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'onchange' | 'children'> {
512
+ class?: string;
513
+ /** `wrap` (default) or `row`: one line that scrolls sideways. */
514
+ layout?: 'wrap' | 'row';
515
+ /** The group's accessible name. Not shown unless `showLabel`. */
516
+ label?: string;
517
+ showLabel?: boolean;
518
+ /** `radio` or `checkbox`: the chips are inputs sharing this group's `name` and `value`. */
519
+ type?: 'radio' | 'checkbox';
520
+ name?: string;
521
+ /** Bindable: a string (or `undefined`) for `radio`, an array of strings for `checkbox`. */
522
+ value?: string | string[] | undefined;
523
+ disabled?: boolean;
524
+ /** With `layout="row"`: `fade` (default) or `none`. */
525
+ edge?: 'fade' | 'none';
526
+ /** With `layout="row"`: bring the chosen chip into view on load. Default `true`. */
527
+ scrollSelectedIntoView?: boolean;
528
+ onchange?: (value: string | string[] | undefined) => void;
529
+ children?: Snippet;
530
+ }
129
531
  export interface ProgressProps {
130
532
  value?: number;
131
533
  max?: number;
534
+ /** Bar height: 4, 8, 12 and 16px. */
535
+ size?: 'sm' | 'md' | 'lg' | 'xl';
536
+ /** Draws `max` separate segments (a whole number from 2 to 24), `value` of them filled; any other `max` draws the continuous bar. */
537
+ segmented?: boolean;
538
+ /** Overrides for the built-in strings. */
539
+ strings?: Partial<ProgressStrings>;
540
+ label?: string;
541
+ /** Names the progressbar when there is no visible `label`. */
542
+ 'aria-label'?: string;
543
+ /** Points the progressbar at another element's id for its name. */
544
+ 'aria-labelledby'?: string;
545
+ class?: string;
546
+ /** @deprecated never accepted by the component; use `class`. */
132
547
  className?: string;
133
548
  }
134
- export interface SkeletonProps {
549
+ export interface SkeletonProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'role' | 'aria-busy' | 'aria-hidden'> {
135
550
  variant?: 'text' | 'circle' | 'block';
136
551
  width?: string | number;
137
552
  height?: string | number;
138
553
  class?: string;
139
554
  'aria-label'?: string;
555
+ /** Overrides for the built-in strings. */
556
+ strings?: Partial<SkeletonStrings>;
557
+ /** No role, no label, hidden from assistive tech. */
558
+ decorative?: boolean;
559
+ /** "on-color" is for a brand, accent or fill block. */
560
+ tone?: 'neutral' | 'on-color';
561
+ /** Text variant only: this many lines (1 to 20), the last one shorter. */
562
+ lines?: number;
563
+ }
564
+ export interface SkeletonGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'role' | 'aria-busy'> {
565
+ 'aria-label'?: string;
566
+ strings?: Partial<SkeletonStrings>;
567
+ class?: string;
568
+ children?: Snippet;
140
569
  }
141
- export interface ToggleProps {
570
+ export interface ToggleProps extends Omit<HTMLButtonAttributes, 'class' | 'id' | 'name' | 'value' | 'disabled' | 'type' | 'role' | 'onclick' | 'onchange' | 'children'> {
571
+ /** Omit to auto-generate. */
572
+ id?: string;
573
+ /** When set, a hidden input submits `value` with native forms while checked. */
574
+ name?: string;
575
+ value?: string;
142
576
  checked?: boolean;
143
577
  disabled?: boolean;
578
+ loading?: boolean;
579
+ label?: string;
580
+ /**
581
+ * Drawn inside the one label, between the switch and the label text. A
582
+ * leading image should have an empty alt: the label names the row.
583
+ */
584
+ leading?: Snippet;
585
+ /** A line under the label, inside it, tied to the switch with `aria-describedby`; not part of the name. */
586
+ description?: string;
587
+ /** Ids of other elements that describe the switch. The description is added after them. */
588
+ 'aria-describedby'?: string | null;
589
+ /** The switch's accessible name when there is no visible `label`. */
590
+ 'aria-label'?: string;
591
+ /** The id of an element of the page that names the switch. */
592
+ 'aria-labelledby'?: string;
593
+ onclick?: (event: MouseEvent) => void;
594
+ onchange?: (event: {
595
+ checked: boolean;
596
+ }) => void;
597
+ class?: string;
598
+ /** @deprecated never accepted by the component; use `class`. */
144
599
  className?: string;
145
600
  }
146
601
  export interface ToggleEvents {
@@ -149,23 +604,635 @@ export interface ToggleEvents {
149
604
  event: Event;
150
605
  };
151
606
  }
152
- export interface TooltipProps {
153
- content: string;
607
+ export interface TooltipProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class'> {
608
+ content?: string;
609
+ placement?: 'top' | 'bottom' | 'left' | 'right';
610
+ delay?: number;
611
+ disabled?: boolean;
612
+ /** Lay the trigger out as a full-width block. */
613
+ block?: boolean;
614
+ /** Position the bubble against the viewport, so a scrolling ancestor cannot clip it. */
615
+ fixed?: boolean;
616
+ /** Milliseconds a tooltip opened by a tap stays; `0` keeps it until it is dismissed. */
617
+ touchDuration?: number;
618
+ /** `material` (default): thick glass with body text and no arrow. `inverted`: the 8.1 dark bubble with an arrow. */
619
+ tone?: 'material' | 'inverted';
620
+ class?: string;
621
+ children?: Snippet;
622
+ /** @deprecated never accepted by the component; use `placement`. */
154
623
  position?: 'top' | 'bottom' | 'left' | 'right';
624
+ /** @deprecated never accepted by the component; use `class`. */
155
625
  className?: string;
156
626
  }
627
+ export interface BottomTabBarProps extends Omit<HTMLAttributes<HTMLElement>, 'class'> {
628
+ /** Three to five destinations. */
629
+ items: BottomTabBarItem[];
630
+ /** The href of the active tab, or the path of the current page. Defaults to the current page. */
631
+ active?: string;
632
+ /** The tab just pressed, while its page is on its way: it takes the mark, `aria-current` stays on `active`. */
633
+ pending?: string;
634
+ /** Accessible name of the navigation landmark. */
635
+ label?: string;
636
+ /** What a badge adds to the tab's accessible name, after the label and a comma. */
637
+ badgeLabel?: (count: number, item: BottomTabBarItem) => string;
638
+ /** Counts above this show as `99+`. */
639
+ badgeMax?: number;
640
+ /** Defaults to `fixed`, or to `static` inside an `AppShell`. */
641
+ position?: 'fixed' | 'static';
642
+ /** When the bar shows the glass and the hairline: `auto` follows the scroll position, `always`, `never`. Default `auto`. */
643
+ scrollEdge?: 'auto' | 'always' | 'never';
644
+ /** Draws the bar as a rounded glass capsule inset from the screen edges. Default false. */
645
+ floating?: boolean;
646
+ class?: string;
647
+ }
648
+ export interface AppBarProps extends Omit<HTMLAttributes<HTMLElement>, 'class' | 'title'> {
649
+ /** The name of the screen, as a heading. */
650
+ title?: string;
651
+ headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
652
+ /** Shows the back control as a link to this address. */
653
+ backHref?: string;
654
+ /** Called when the back control is activated; on its own it makes the control a button. */
655
+ onback?: (event: MouseEvent) => void;
656
+ /** Accessible name of the back control. */
657
+ backLabel?: string;
658
+ /**
659
+ * Hides the bar while the page scrolls down and brings it back when it scrolls up.
660
+ * Keyboard focus inside the bar holds it and brings it back; focus left by a tap does not.
661
+ */
662
+ collapseOnScroll?: boolean;
663
+ /** How many lines the title may take before it is cut. Default 1. */
664
+ titleLines?: 1 | 2;
665
+ /** Before the title, after the back control. The bar's row is on a fixed pixel scale (`--spacing: 4px`), so the bar's own controls do not grow with the text size. Size what you place here on the same scale (Tailwind numeric classes such as `size-9`, or `calc(var(--spacing) * 9)`), not in rem, or it grows at 200% text while the bar's controls do not. */
666
+ leading?: Snippet;
667
+ /** After the title. At most two icon buttons. The bar's row is on a fixed pixel scale (`--spacing: 4px`), so the bar's own controls do not grow with the text size. Size what you place here on the same scale (Tailwind numeric classes such as `size-9`, or `calc(var(--spacing) * 9)`), not in rem, or it grows at 200% text while the bar's controls do not. */
668
+ actions?: Snippet;
669
+ /** When the bar shows the glass and the hairline: `auto` follows the scroll position, `always`, `never`. Default `auto`. */
670
+ scrollEdge?: 'auto' | 'always' | 'never';
671
+ /** Draws the title large on a second row that scrolls away; the bar then shows it small. */
672
+ largeTitle?: boolean;
673
+ /** The bar's fill: the page colour, none at rest, the brand colour with on-brand content, or none with the colours of the block it sits in (`inherit`). Default `default`. */
674
+ tone?: 'default' | 'transparent' | 'brand' | 'inherit';
675
+ /** `sticky` (default), or `static` for a bar in the flow of the page. */
676
+ position?: 'sticky' | 'static';
677
+ class?: string;
678
+ }
679
+ export interface AppShellProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'style'> {
680
+ /** The top bar, an `AppBar`. */
681
+ header?: Snippet;
682
+ /** The scrolling content, rendered in the element `contentElement` names. */
683
+ children?: Snippet;
684
+ /** The element around the content. Use `div` for a shell inside another `<main>`. */
685
+ contentElement?: 'main' | 'div';
686
+ /** The bottom bar, a `BottomTabBar`. */
687
+ footer?: Snippet;
688
+ /** Paints the shell with the page colour and the brand wash, and lets it show through the header. */
689
+ canvas?: boolean;
690
+ /** One navigation, drawn as tabs, a rail or a sidebar; `AppNavigation` is the ready-made content. */
691
+ navigation?: Snippet<[AppShellNavigationContext]>;
692
+ /** Where the `navigation` goes. `auto` (default): tabs below 48rem, a rail from 48rem, a sidebar from 64rem. */
693
+ navigationPlacement?: AppShellNavigationMode;
694
+ /** Without a `header`, no top safe-area padding on the content: it starts at the top of the screen and handles the safe area itself. */
695
+ flushTop?: boolean;
696
+ class?: string;
697
+ /** Added after the two custom properties the shell sets. */
698
+ style?: string;
699
+ }
700
+ export interface AppShellHeaderPartProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class'> {
701
+ /** The part's content: an `AppBar`, a search field, filter chips, tabs. */
702
+ children?: Snippet;
703
+ /** Stays at the top under the parts that stick above it (default), or scrolls away with the content. */
704
+ sticky?: boolean;
705
+ class?: string;
706
+ }
707
+ export interface AppNavigationProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class'> {
708
+ /** The destinations, as for `BottomTabBar`. */
709
+ items: BottomTabBarItem[];
710
+ /** The href of the active destination, or the path of the current page. Defaults to the current page. */
711
+ active?: string;
712
+ /** Accessible name of the navigation landmark. */
713
+ label?: string;
714
+ /** What a count adds to the link's accessible name, after the label and a comma. */
715
+ badgeLabel?: (count: number, item: BottomTabBarItem) => string;
716
+ /** Counts above this show as `99+`. */
717
+ badgeMax?: number;
718
+ /** Draws the tab bar form as a floating capsule of glass. */
719
+ floating?: boolean;
720
+ /** Above the list in the rail and the sidebar. */
721
+ header?: Snippet<[{
722
+ placement: 'rail' | 'sidebar';
723
+ }]>;
724
+ /** Below the list in the rail and the sidebar. */
725
+ footer?: Snippet<[{
726
+ placement: 'rail' | 'sidebar';
727
+ }]>;
728
+ class?: string;
729
+ }
730
+ export interface CodeFieldProps extends Omit<HTMLInputAttributes, 'class' | 'size' | 'value' | 'type' | 'id' | 'name' | 'required' | 'disabled' | 'readonly' | 'maxlength' | 'oninput' | 'onblur' | 'aria-label' | 'aria-describedby'> {
731
+ id?: string;
732
+ /** The code typed so far. Bindable. */
733
+ value?: string;
734
+ /** The name the code is posted under, with or without scripts. */
735
+ name?: string;
736
+ class?: string;
737
+ /** Places in the code, a whole number from 1 to 12. Default 6. */
738
+ length?: number;
739
+ /** `numeric` (default): digits only. `alphanumeric` also takes letters. */
740
+ mode?: CodeFieldMode;
741
+ /** Box size: `sm` (44px tall), `md` (default) or `lg`. */
742
+ size?: SizeVariant;
743
+ /** Draws the boxes in groups with a wider gap: a number is each group's size (`4` makes 4 and 4 of 8), a list gives each group's size. Only the drawing changes; the row wraps between groups when it cannot fit. */
744
+ groups?: number | number[];
745
+ /** Names the field. Defaults to the provider's `codeField.label`, then "Verification code". */
746
+ label?: string;
747
+ /** Keeps the label for assistive technology and takes it off the screen. */
748
+ labelHidden?: boolean;
749
+ required?: boolean;
750
+ disabled?: boolean;
751
+ readonly?: boolean;
752
+ variant?: SemanticVariant;
753
+ /** Status text under the field; shown with a `success`, `warning` or `error` variant. */
754
+ message?: string;
755
+ /** Help text under the field, read out with it. */
756
+ hint?: string;
757
+ /** An error under the field: marks it invalid and is announced; wins over `variant` and `message`. */
758
+ error?: string;
759
+ /** Called with the code when the last place is filled. It does not submit anything. */
760
+ oncomplete?: (value: string) => void;
761
+ /** Overrides for the built-in strings: label, description. */
762
+ strings?: Partial<CodeFieldStrings>;
763
+ oninput?: (event: Event) => void;
764
+ onblur?: (event: Event) => void;
765
+ 'aria-label'?: string;
766
+ 'aria-describedby'?: string | null;
767
+ }
768
+ export interface RatingProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'onchange' | 'aria-label' | 'aria-labelledby'> {
769
+ class?: string;
770
+ /** Stars given, or `null` for no rating. Bindable. */
771
+ value?: number | null;
772
+ max?: number;
773
+ /** Names the rating. Shown above the stars unless `hideLabel`. */
774
+ label?: string;
775
+ hideLabel?: boolean;
776
+ 'aria-label'?: string;
777
+ 'aria-labelledby'?: string;
778
+ /** `xl` is 40px stars; `display` is a display-size compact score (`xl` as a row of stars). */
779
+ size?: 'sm' | 'md' | 'lg' | 'xl' | 'display';
780
+ /** Colour of a filled star: the primary action colour, or the app's accent. */
781
+ tone?: 'primary' | 'accent';
782
+ /** Shows a score: one image with one name, and stars can be partly filled. */
783
+ readonly?: boolean;
784
+ /** Adds a clear button; pressing the selected star again never clears. */
785
+ clearable?: boolean;
786
+ disabled?: boolean;
787
+ name?: string;
788
+ /** A read-only score: one star and the number; implies `readonly`. */
789
+ compact?: boolean;
790
+ /** An empty star: a hollow `outline` (default) or a `soft` fill. */
791
+ empty?: 'outline' | 'soft';
792
+ /** On by default when `readonly`. */
793
+ showValue?: boolean;
794
+ formatValue?: (value: number) => string;
795
+ strings?: Partial<RatingStrings>;
796
+ onchange?: (value: number | null) => void;
797
+ }
798
+ export interface SegmentedControlProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'onchange' | 'aria-label' | 'aria-labelledby'> {
799
+ class?: string;
800
+ /** Two to four choices. */
801
+ options: SegmentedControlOption[];
802
+ /** Selected value. Bindable. */
803
+ value?: string | undefined;
804
+ /** Accessible name of the group. Not shown. */
805
+ label?: string;
806
+ 'aria-label'?: string;
807
+ 'aria-labelledby'?: string;
808
+ size?: SizeVariant;
809
+ /** Equal-width segments that fill the row. */
810
+ fullWidth?: boolean;
811
+ name?: string;
812
+ /** Look of the selected segment: a card-coloured thumb (`neutral`, default) or the solid primary fill. */
813
+ tone?: 'neutral' | 'primary';
814
+ disabled?: boolean;
815
+ onchange?: (value: string) => void;
816
+ }
817
+ export interface FloatingActionButtonProps extends Omit<HTMLAttributes<HTMLElement>, 'class'> {
818
+ /** What the button does. Its accessible name, and its text when `extended`. */
819
+ label: string;
820
+ /** An icon component, as `@lucide/svelte` icons are. A plus sign by default. */
821
+ icon?: Component<{
822
+ size?: number;
823
+ class?: string;
824
+ }>;
825
+ /** Shows the label as text beside the icon. */
826
+ extended?: boolean;
827
+ /** Makes it a link to this address. Without it, it is a button. */
828
+ href?: string;
829
+ /** The bottom corner it sits in. `bottom-end` follows the writing direction. */
830
+ position?: 'bottom-end' | 'bottom-start' | 'bottom-center';
831
+ class?: string;
832
+ }
833
+ export interface StickyActionBarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'style'> {
834
+ /** Accessible name. With it the bar is a group. */
835
+ label?: string;
836
+ /** When the bar shows the glass and the hairline: `auto` follows the scroll position, `always`, `never`. Default `auto`. */
837
+ scrollEdge?: 'auto' | 'always' | 'never';
838
+ class?: string;
839
+ /** Added after the offset and margin the bar sets while the keyboard is up. */
840
+ style?: string;
841
+ /** The main action, and at most one or two beside it. */
842
+ children?: Snippet;
843
+ }
844
+ export interface BottomSheetProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'title' | 'onclose' | 'onkeydown'> {
845
+ isOpen?: boolean;
846
+ /** Heading of the sheet, and its accessible name. */
847
+ title: string;
848
+ description?: string;
849
+ /** The heights the sheet can rest at. */
850
+ snapPoints?: BottomSheetSnap[];
851
+ /** The snap point the sheet is at. Bindable. */
852
+ snap?: BottomSheetSnap;
853
+ /** As tall as the content, up to half the screen; one resting height, the grip only drags. */
854
+ fit?: boolean;
855
+ /** With `fit`: the tallest the sheet grows before its content scrolls. */
856
+ fitMax?: 'half' | 'full';
857
+ /** Render the overlay in `document.body`; `false` renders in place. */
858
+ portal?: boolean;
859
+ /** When false, Escape, the backdrop, the close button and a swipe down do not close it. */
860
+ dismissible?: boolean;
861
+ /** Fired when the sheet closes itself, with what the user did. */
862
+ onclose?: (detail: {
863
+ reason: BottomSheetCloseReason;
864
+ }) => void;
865
+ /** Hears every keydown in the sheet, after the sheet has handled Escape. */
866
+ onkeydown?: (event: KeyboardEvent) => void;
867
+ /** Accessible name of the close button. */
868
+ closeLabel?: string;
869
+ /** Accessible name of the grip while its button takes the sheet up a step. */
870
+ expandLabel?: string;
871
+ /** Accessible name of the grip while its button takes the sheet down a step. */
872
+ collapseLabel?: string;
873
+ /** CSS selector of the control that takes focus when the sheet opens. */
874
+ initialFocus?: string;
875
+ class?: string;
876
+ children?: Snippet;
877
+ /** Pinned to the bottom of the panel, below the scrolling content. */
878
+ footer?: Snippet;
879
+ }
880
+ export interface DateFieldProps extends Omit<HTMLInputAttributes, 'class' | 'type' | 'value' | 'size' | 'min' | 'max' | 'step' | 'required' | 'disabled' | 'readonly' | 'id' | 'name'> {
881
+ /** Omit to auto-generate; pair with FormField's `id` when used inside FormField. */
882
+ id?: string;
883
+ /** The date as `YYYY-MM-DD`, or `""` while empty. Supports `bind:value`. */
884
+ value?: string;
885
+ /** Name the value is submitted under in a form. */
886
+ name?: string;
887
+ label?: string;
888
+ /** True when FormField supplies the visible `<label>`. */
889
+ hideLabel?: boolean;
890
+ /** Help text under the field, read out with it. */
891
+ hint?: string;
892
+ /** An error under the field. It marks the field invalid and is announced. */
893
+ error?: string;
894
+ /** Earliest value that can be picked, in the format of `value`. */
895
+ min?: string;
896
+ /** Latest value that can be picked, in the format of `value`. */
897
+ max?: string;
898
+ /** Steps between dates that can be picked, in days. */
899
+ step?: number | 'any';
900
+ required?: boolean;
901
+ disabled?: boolean;
902
+ /** Shows the value without letting it be changed; it is still submitted. */
903
+ readonly?: boolean;
904
+ /** Height, on the scale Input and Button use. At least 44px on a touch screen. */
905
+ size?: SizeVariant;
906
+ /** Extra classes for the `<input>`. */
907
+ class?: string;
908
+ /** Language of the field, as a BCP 47 tag or a list of them. With it the field shows the value in that language and opens the library's own picker; without it, the native input. */
909
+ locale?: string | string[];
910
+ /** With `locale`: how the value is shown, as options of `Intl.DateTimeFormat`. */
911
+ format?: Intl.DateTimeFormatOptions;
912
+ /** With `locale`: shown in the placeholder colour while the field is empty. */
913
+ placeholder?: string;
914
+ /** With `locale`: `library` (default) opens the library's picker in a sheet; `native` opens the platform's. */
915
+ picker?: 'library' | 'native';
916
+ /** With `locale`: the words the field says; replace any of them to translate. */
917
+ strings?: Partial<{
918
+ clear: string;
919
+ chooseDate: string;
920
+ }>;
921
+ }
922
+ export interface TimeFieldProps extends Omit<HTMLInputAttributes, 'class' | 'type' | 'value' | 'size' | 'min' | 'max' | 'step' | 'required' | 'disabled' | 'readonly' | 'id' | 'name'> {
923
+ /** Omit to auto-generate; pair with FormField's `id` when used inside FormField. */
924
+ id?: string;
925
+ /** The time as 24-hour `HH:mm`, or `""` while empty. Supports `bind:value`. */
926
+ value?: string;
927
+ /** Name the value is submitted under in a form. */
928
+ name?: string;
929
+ label?: string;
930
+ /** True when FormField supplies the visible `<label>`. */
931
+ hideLabel?: boolean;
932
+ /** Help text under the field, read out with it. */
933
+ hint?: string;
934
+ /** An error under the field. It marks the field invalid and is announced. */
935
+ error?: string;
936
+ /** Earliest value that can be picked, in the format of `value`. */
937
+ min?: string;
938
+ /** Latest value that can be picked, in the format of `value`. */
939
+ max?: string;
940
+ /** Steps between times that can be picked, in seconds. */
941
+ step?: number | 'any';
942
+ required?: boolean;
943
+ disabled?: boolean;
944
+ /** Shows the value without letting it be changed; it is still submitted. */
945
+ readonly?: boolean;
946
+ /** Height, on the scale Input and Button use. At least 44px on a touch screen. */
947
+ size?: SizeVariant;
948
+ /** Extra classes for the `<input>`. */
949
+ class?: string;
950
+ /** Language of the field, as a BCP 47 tag or a list of them. With it the field shows the value in that language and opens the library's own picker; without it, the native input. */
951
+ locale?: string | string[];
952
+ /** With `locale`: how the value is shown, as options of `Intl.DateTimeFormat`. */
953
+ format?: Intl.DateTimeFormatOptions;
954
+ /** With `locale`: shown in the placeholder colour while the field is empty. */
955
+ placeholder?: string;
956
+ /** With `locale`: `library` (default) opens the library's picker in a sheet; `native` opens the platform's. */
957
+ picker?: 'library' | 'native';
958
+ /** With `locale`: the words the field says; replace any of them to translate. */
959
+ strings?: Partial<{
960
+ clear: string;
961
+ done: string;
962
+ hours: string;
963
+ minutes: string;
964
+ chosenTime: string;
965
+ chooseTime: string;
966
+ }>;
967
+ /** With `locale`, while the field is empty: the time the columns stand at when the sheet opens, as `HH:mm`. Not chosen; `value` stays empty. Left out: now, on the step. */
968
+ openAt?: string;
969
+ }
970
+ export interface CalendarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'onselect'> {
971
+ /** The month shown, as `YYYY-MM`. Supports `bind:month`. */
972
+ month?: string;
973
+ /** The selected day, as `YYYY-MM-DD`, or null. Supports `bind:selected`. */
974
+ selected?: string | null;
975
+ /** What happens on which day. A day shows a dot per event, three at most. */
976
+ events?: CalendarEvent[];
977
+ /** First day of the week: 0 for Sunday to 6 for Saturday. */
978
+ weekStartsOn?: number;
979
+ /**
980
+ * Language of the month and day names, as a BCP 47 tag. It does not translate the
981
+ * words the component adds ("today", "selected", ...): pass those in `strings` too.
982
+ */
983
+ locale?: string;
984
+ /** Earliest day that can be selected, as `YYYY-MM-DD`. */
985
+ min?: string;
986
+ /** Latest day that can be selected, as `YYYY-MM-DD`. */
987
+ max?: string;
988
+ /** Return true for a day that cannot be selected. */
989
+ isDateDisabled?: (date: string) => boolean;
990
+ /** The words the calendar says; replace any of them to translate. */
991
+ strings?: Partial<CalendarStrings>;
992
+ /** Called with the day when the user selects another one. */
993
+ onselect?: (date: string) => void;
994
+ /** Called with the month when the user moves to another one. */
995
+ onmonthchange?: (month: string) => void;
996
+ /** Extra classes for the host element. */
997
+ class?: string;
998
+ }
999
+ export interface PhotoGridProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'aria-label' | 'aria-labelledby' | 'onselect'> {
1000
+ photos: Photo[];
1001
+ /** How many columns. Left out, it follows the width of the grid: 3, 4 from 480px, 5 from 768px. */
1002
+ columns?: number;
1003
+ /** Shows no more than this many photos; the last tile then says how many more there are. */
1004
+ max?: number;
1005
+ /** Called with the photo's place in `photos` when one is opened. */
1006
+ onopen?: (index: number) => void;
1007
+ /** Makes a press select: `single` for one photo, `multiple` for any number. */
1008
+ selectable?: 'single' | 'multiple';
1009
+ /** Key of the selected photo, or `null`. Supports `bind:selected`. */
1010
+ selected?: PhotoKey | null;
1011
+ /** Keys of the selected photos. Supports `bind:selectedKeys`. */
1012
+ selectedKeys?: PhotoKey[];
1013
+ /** Called when a photo is selected or, in `multiple`, its selection is cleared. */
1014
+ onselect?: (detail: PhotoGridSelectDetail) => void;
1015
+ /** Puts an "Add photo" tile first and is called when it is pressed. */
1016
+ onadd?: () => void;
1017
+ /** Called once when a thumbnail cannot be loaded, so the page can answer with a new address. */
1018
+ onloaderror?: (photo: Photo, index: number) => void;
1019
+ /** Puts a "Try again" button on each photo whose `status` is `error` and is called when it is pressed. */
1020
+ onretry?: (photo: Photo, index: number) => void;
1021
+ /** Overrides for the built-in strings. */
1022
+ strings?: Partial<PhotoGridStrings>;
1023
+ /** Extra classes for the host element. */
1024
+ class?: string;
1025
+ 'aria-label'?: string;
1026
+ 'aria-labelledby'?: string;
1027
+ }
1028
+ export interface PhotoViewerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'onclose' | 'aria-label'> {
1029
+ photos: Photo[];
1030
+ /** Place in `photos` of the photo that is showing. Supports `bind:index`. */
1031
+ index?: number;
1032
+ isOpen?: boolean;
1033
+ /** Things to do with the photo that is showing. */
1034
+ actions?: PhotoViewerAction[];
1035
+ /** Render the overlay in `document.body`; `false` renders in place. */
1036
+ portal?: boolean;
1037
+ /** Fired when the viewer closes itself, with what the user did. */
1038
+ onclose?: (detail: {
1039
+ reason: PhotoViewerCloseReason;
1040
+ }) => void;
1041
+ /** Called once when a full image cannot be loaded, so the page can answer with a new address. */
1042
+ onloaderror?: (photo: Photo, index: number) => void;
1043
+ /** Called when "Try again" is pressed, before the image is asked for again; a returned promise is waited for. */
1044
+ onretry?: (photo: Photo, index: number) => void | Promise<void>;
1045
+ /** Accessible name of the dialog. */
1046
+ label?: string;
1047
+ /** Overrides for the built-in strings. */
1048
+ strings?: Partial<PhotoViewerStrings>;
1049
+ /** Extra classes for the dialog panel. */
1050
+ class?: string;
1051
+ }
1052
+ export interface StepperProps extends Omit<HTMLAttributes<HTMLElement>, 'class'> {
1053
+ class?: string;
1054
+ /** The steps, in order: labels, or objects with a label and a description. */
1055
+ steps: StepperItem[];
1056
+ /**
1057
+ * Index of the current step, counted from 0. Bindable. A value outside
1058
+ * the steps is shown as the nearest step; the bound value is left as given.
1059
+ */
1060
+ current?: number;
1061
+ /** Size of the markers and the text. */
1062
+ size?: SizeVariant;
1063
+ /** `auto` is compact while the Stepper itself is narrower than 30rem. */
1064
+ layout?: StepperLayout;
1065
+ /** Makes the completed steps buttons that go back to that step. */
1066
+ interactive?: boolean;
1067
+ /** Accessible name of the navigation landmark. */
1068
+ label?: string;
1069
+ /** Overrides for the built-in strings. */
1070
+ strings?: Partial<StepperStrings>;
1071
+ /** Called with the index of the step a press went back to. Only with `interactive`. */
1072
+ onstepchange?: (index: number) => void;
1073
+ }
1074
+ export interface AvatarProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'class' | 'role' | 'aria-label'> {
1075
+ /** The person's name: the accessible name, and where the initials come from. */
1076
+ name: string;
1077
+ /** Address of the picture. Without it, or when it fails to load, the initials show. */
1078
+ src?: string;
1079
+ /** Diameter: 24, 32 and 48px. */
1080
+ size?: AvatarSize;
1081
+ /** Accessible name, when it should differ from `name`. `alt=""` makes the avatar decorative. */
1082
+ alt?: string;
1083
+ /** Language the initials are upper-cased in. The page's own by default. */
1084
+ locale?: string;
1085
+ /** The picture drawn inside the circle (an inline SVG), in place of `src` and the initials. */
1086
+ children?: Snippet;
1087
+ class?: string;
1088
+ }
1089
+ export interface AvatarGroupProps extends Omit<HTMLAttributes<HTMLUListElement>, 'class' | 'aria-label'> {
1090
+ /** The people, in the order they are shown. */
1091
+ people: AvatarPerson[];
1092
+ /** How many are shown before the rest become "+N". */
1093
+ max?: number;
1094
+ /** Diameter of each avatar: 24, 32 and 48px. */
1095
+ size?: AvatarSize;
1096
+ /** Accessible name of the list. */
1097
+ label?: string;
1098
+ /** Overrides for the built-in strings. */
1099
+ strings?: Partial<AvatarGroupStrings>;
1100
+ /** The language the initials are worked out in; passed to each Avatar. */
1101
+ locale?: string;
1102
+ class?: string;
1103
+ }
1104
+ export interface LineChartProps extends Omit<HTMLAttributes<HTMLElement>, 'class'> {
1105
+ /** The lines: a `name` and one value per x label (`null` leaves a gap). */
1106
+ series: ChartSeries[];
1107
+ /** The labels along the x axis, one per point. */
1108
+ xLabels?: string[];
1109
+ /** The bottom of the y axis. Without it, the lowest value rounded down to a tick. */
1110
+ yMin?: number;
1111
+ /** The top of the y axis. Without it, the highest value rounded up to a tick. */
1112
+ yMax?: number;
1113
+ /** `number` (default), `percent` (72 is "72 %"), or a function. */
1114
+ yFormat?: ChartFormat;
1115
+ /** Height of the drawing in px. */
1116
+ height?: number;
1117
+ /** The caption, and what the chart is called. */
1118
+ label: string;
1119
+ labelHidden?: boolean;
1120
+ /** The key under the plot. Without it, shown when there is more than one series. */
1121
+ legend?: boolean;
1122
+ /** A marker on every point, a different shape per series. */
1123
+ markers?: boolean;
1124
+ /** Shows the data table under the chart. */
1125
+ showTable?: boolean;
1126
+ /** The heading of the table's first column. */
1127
+ xTitle?: string;
1128
+ locale?: string;
1129
+ class?: string;
1130
+ /** Stands the chart on a panel of the thick material (frosted glass). Off by default. */
1131
+ glass?: boolean;
1132
+ }
1133
+ export interface BarChartProps extends Omit<HTMLAttributes<HTMLElement>, 'class'> {
1134
+ /** The bars, in order. */
1135
+ data: ChartDatum[];
1136
+ /** The colour of the bars. Without it, the first series colour. */
1137
+ color?: ChartColor;
1138
+ /** The top of the value axis. */
1139
+ yMax?: number;
1140
+ /** `number` (default), `percent` (72 is "72 %"), or a function. */
1141
+ yFormat?: ChartFormat;
1142
+ /** Height of the drawing in px. */
1143
+ height?: number;
1144
+ /** The caption, and what the chart is called. */
1145
+ label: string;
1146
+ labelHidden?: boolean;
1147
+ /** Writes each value over its bar. */
1148
+ showValues?: boolean;
1149
+ /** Shows the data table under the chart. */
1150
+ showTable?: boolean;
1151
+ categoryTitle?: string;
1152
+ valueTitle?: string;
1153
+ locale?: string;
1154
+ class?: string;
1155
+ /** Stands the chart on a panel of the thick material (frosted glass). Off by default. */
1156
+ glass?: boolean;
1157
+ }
1158
+ export interface PieChartProps extends Omit<HTMLAttributes<HTMLElement>, 'class'> {
1159
+ /** The slices, in order, clockwise from twelve o'clock. */
1160
+ data: ChartDatum[];
1161
+ /** A ring, not a full disc. */
1162
+ donut?: boolean;
1163
+ /** `number` (default), `percent` (72 is "72 %"), or a function. */
1164
+ format?: ChartFormat;
1165
+ /** The widest the drawing gets, in px. */
1166
+ size?: number;
1167
+ /** The caption, and what the chart is called. */
1168
+ label: string;
1169
+ labelHidden?: boolean;
1170
+ /** The key beside the drawing: each slice's label, value and share. */
1171
+ legend?: boolean;
1172
+ /** Shows the data table under the chart. */
1173
+ showTable?: boolean;
1174
+ categoryTitle?: string;
1175
+ valueTitle?: string;
1176
+ shareTitle?: string;
1177
+ locale?: string;
1178
+ class?: string;
1179
+ /** What stands in the middle of the ring (`donut`): the total, or the one share that matters. */
1180
+ center?: Snippet;
1181
+ /** Stands the chart on a panel of the thick material (frosted glass). Off by default. */
1182
+ glass?: boolean;
1183
+ }
1184
+ export interface SparklineProps extends Omit<SVGAttributes<SVGSVGElement>, 'class' | 'points' | 'min' | 'max' | 'color'> {
1185
+ /** The values, in order. `null` leaves a gap. */
1186
+ points: Array<number | null>;
1187
+ /** What the image is called. Without it the line is decoration. */
1188
+ label?: string;
1189
+ /** A theme colour by name or any CSS colour. */
1190
+ color?: ChartColor;
1191
+ min?: number;
1192
+ max?: number;
1193
+ class?: string;
1194
+ }
157
1195
  export type Button = ZabiComponent<ButtonProps, ButtonEvents>;
158
1196
  export type Heading = ZabiComponent<HeadingProps>;
1197
+ export type Block = ZabiComponent<BlockProps>;
159
1198
  export type Card = ZabiComponent<CardProps>;
160
1199
  export type Input = ZabiComponent<InputProps, InputEvents>;
161
1200
  export type Checkbox = ZabiComponent<CheckboxProps, CheckboxEvents>;
162
1201
  export type Select = ZabiComponent<SelectProps, SelectEvents>;
1202
+ export type PickerField = ZabiComponent<PickerFieldProps>;
163
1203
  export type Textarea = ZabiComponent<TextareaProps, TextareaEvents>;
164
1204
  export type Modal = ZabiComponent<ModalProps, ModalEvents>;
165
1205
  export type Alert = ZabiComponent<AlertProps>;
166
1206
  export type Badge = ZabiComponent<BadgeProps>;
1207
+ export type Stat = ZabiComponent<StatProps>;
1208
+ export type SpeechBubble = ZabiComponent<SpeechBubbleProps>;
1209
+ export type Chip = ZabiComponent<ChipProps>;
1210
+ export type ChipGroup = ZabiComponent<ChipGroupProps>;
167
1211
  export type Progress = ZabiComponent<ProgressProps>;
168
1212
  export type Skeleton = ZabiComponent<SkeletonProps>;
1213
+ export type SkeletonGroup = ZabiComponent<SkeletonGroupProps>;
169
1214
  export type Toggle = ZabiComponent<ToggleProps, ToggleEvents>;
170
1215
  export type Tooltip = ZabiComponent<TooltipProps>;
1216
+ export type BottomTabBar = ZabiComponent<BottomTabBarProps>;
1217
+ export type AppBar = ZabiComponent<AppBarProps>;
1218
+ export type AppShell = ZabiComponent<AppShellProps>;
1219
+ export type AppNavigation = ZabiComponent<AppNavigationProps>;
1220
+ export type Rating = ZabiComponent<RatingProps>;
1221
+ export type CodeField = ZabiComponent<CodeFieldProps>;
1222
+ export type SegmentedControl = ZabiComponent<SegmentedControlProps>;
1223
+ export type FloatingActionButton = ZabiComponent<FloatingActionButtonProps>;
1224
+ export type StickyActionBar = ZabiComponent<StickyActionBarProps>;
1225
+ export type BottomSheet = ZabiComponent<BottomSheetProps>;
1226
+ export type DateField = ZabiComponent<DateFieldProps>;
1227
+ export type TimeField = ZabiComponent<TimeFieldProps>;
1228
+ export type Calendar = ZabiComponent<CalendarProps>;
1229
+ export type PhotoGrid = ZabiComponent<PhotoGridProps>;
1230
+ export type PhotoViewer = ZabiComponent<PhotoViewerProps>;
1231
+ export type Avatar = ZabiComponent<AvatarProps>;
1232
+ export type AvatarGroup = ZabiComponent<AvatarGroupProps>;
1233
+ export type LineChart = ZabiComponent<LineChartProps>;
1234
+ export type BarChart = ZabiComponent<BarChartProps>;
1235
+ export type PieChart = ZabiComponent<PieChartProps>;
1236
+ export type Sparkline = ZabiComponent<SparklineProps>;
1237
+ export type Stepper = ZabiComponent<StepperProps>;
171
1238
  //# sourceMappingURL=index.d.ts.map