zabi-components 7.0.2 → 8.1.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.
- package/CHANGELOG.md +1924 -0
- package/README.md +287 -11
- package/THEME.md +149 -332
- package/THEMING.md +1329 -163
- package/dist/atoms/ActionPanel.svelte +24 -9
- package/dist/atoms/ActionPanel.svelte.d.ts +2 -0
- package/dist/atoms/Avatar.svelte +104 -0
- package/dist/atoms/Avatar.svelte.d.ts +34 -0
- package/dist/atoms/Badge.svelte +124 -58
- package/dist/atoms/Badge.svelte.d.ts +17 -5
- package/dist/atoms/Button.svelte +212 -62
- package/dist/atoms/Button.svelte.d.ts +33 -2
- package/dist/atoms/Card.svelte +31 -28
- package/dist/atoms/Card.svelte.d.ts +5 -2
- package/dist/atoms/CardContent.svelte +10 -2
- package/dist/atoms/CardContent.svelte.d.ts +2 -0
- package/dist/atoms/CardFooter.svelte +10 -2
- package/dist/atoms/CardFooter.svelte.d.ts +2 -0
- package/dist/atoms/CardHeader.svelte +26 -6
- package/dist/atoms/CardHeader.svelte.d.ts +2 -0
- package/dist/atoms/Checkbox.svelte +52 -21
- package/dist/atoms/Checkbox.svelte.d.ts +6 -2
- package/dist/atoms/CodeBlock.svelte +35 -9
- package/dist/atoms/CodeBlock.svelte.d.ts +13 -3
- package/dist/atoms/ColorPicker.svelte +272 -52
- package/dist/atoms/ColorPicker.svelte.d.ts +6 -1
- package/dist/atoms/Container.svelte +17 -10
- package/dist/atoms/DateField.svelte +107 -0
- package/dist/atoms/DateField.svelte.d.ts +53 -0
- package/dist/atoms/Divider.svelte +4 -4
- package/dist/atoms/FeatureCard.svelte +4 -3
- package/dist/atoms/FieldMessages.svelte +69 -0
- package/dist/atoms/FieldMessages.svelte.d.ts +23 -0
- package/dist/atoms/FloatingActionButton.svelte +174 -0
- package/dist/atoms/FloatingActionButton.svelte.d.ts +51 -0
- package/dist/atoms/Heading.svelte +93 -32
- package/dist/atoms/Heading.svelte.d.ts +24 -4
- package/dist/atoms/IconButton.svelte +242 -53
- package/dist/atoms/IconButton.svelte.d.ts +49 -4
- package/dist/atoms/Input.svelte +267 -74
- package/dist/atoms/Input.svelte.d.ts +32 -2
- package/dist/atoms/List.svelte +13 -2
- package/dist/atoms/List.svelte.d.ts +2 -0
- package/dist/atoms/ListItem.svelte +44 -11
- package/dist/atoms/ListItem.svelte.d.ts +5 -0
- package/dist/atoms/ListItemLeading.svelte +4 -2
- package/dist/atoms/ListItemLeading.svelte.d.ts +1 -1
- package/dist/atoms/OptimizedImage.svelte +11 -2
- package/dist/atoms/OptimizedImage.svelte.d.ts +2 -0
- package/dist/atoms/Progress.svelte +31 -9
- package/dist/atoms/Progress.svelte.d.ts +6 -0
- package/dist/atoms/Radio.svelte +23 -3
- package/dist/atoms/Radio.svelte.d.ts +6 -2
- package/dist/atoms/Rating.svelte +494 -0
- package/dist/atoms/Rating.svelte.d.ts +56 -0
- package/dist/atoms/Select.svelte +475 -135
- package/dist/atoms/Select.svelte.d.ts +52 -2
- package/dist/atoms/SelectionControl.svelte +99 -18
- package/dist/atoms/SelectionControl.svelte.d.ts +6 -3
- package/dist/atoms/Skeleton.svelte +5 -3
- package/dist/atoms/Slider.svelte +309 -0
- package/dist/atoms/Slider.svelte.d.ts +40 -0
- package/dist/atoms/Spinner.svelte +57 -0
- package/dist/atoms/Spinner.svelte.d.ts +19 -0
- package/dist/atoms/Table.svelte +152 -6
- package/dist/atoms/Table.svelte.d.ts +15 -3
- package/dist/atoms/TemporalField.svelte +140 -0
- package/dist/atoms/TemporalField.svelte.d.ts +32 -0
- package/dist/atoms/Text.svelte +56 -15
- package/dist/atoms/Text.svelte.d.ts +13 -4
- package/dist/atoms/Textarea.svelte +57 -45
- package/dist/atoms/Textarea.svelte.d.ts +14 -2
- package/dist/atoms/ThemeToggle.svelte +238 -56
- package/dist/atoms/ThemeToggle.svelte.d.ts +28 -3
- package/dist/atoms/TimeField.svelte +108 -0
- package/dist/atoms/TimeField.svelte.d.ts +54 -0
- package/dist/atoms/Toast.svelte +25 -10
- package/dist/atoms/Toast.svelte.d.ts +2 -0
- package/dist/atoms/Toggle.svelte +60 -19
- package/dist/atoms/Toggle.svelte.d.ts +18 -2
- package/dist/atoms/Tooltip.svelte +583 -40
- package/dist/atoms/Tooltip.svelte.d.ts +26 -0
- package/dist/atoms/ZabiStringsProvider.svelte +45 -0
- package/dist/atoms/ZabiStringsProvider.svelte.d.ts +27 -0
- package/dist/atoms/index.d.ts +17 -0
- package/dist/atoms/index.js +12 -0
- package/dist/atoms/selection-control.styles.d.ts +36 -5
- package/dist/atoms/selection-control.styles.js +40 -9
- package/dist/components/atoms/index.d.ts +17 -0
- package/dist/components/atoms/index.d.ts.map +1 -1
- package/dist/components/atoms/selection-control.styles.d.ts +36 -5
- package/dist/components/atoms/selection-control.styles.d.ts.map +1 -1
- package/dist/components/index.d.ts +83 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/molecules/index.d.ts +46 -0
- package/dist/components/molecules/index.d.ts.map +1 -1
- package/dist/components/molecules/toast-store.d.ts +53 -7
- package/dist/components/molecules/toast-store.d.ts.map +1 -1
- package/dist/components/organisms/index.d.ts +6 -0
- package/dist/components/organisms/index.d.ts.map +1 -1
- package/dist/components/types/variants.d.ts +15 -1
- package/dist/components/types/variants.d.ts.map +1 -1
- package/dist/components/util/app-shell.d.ts +28 -0
- package/dist/components/util/app-shell.d.ts.map +1 -0
- package/dist/components/util/avatar.d.ts +36 -0
- package/dist/components/util/avatar.d.ts.map +1 -0
- package/dist/components/util/bottom-sheet.d.ts +30 -0
- package/dist/components/util/bottom-sheet.d.ts.map +1 -0
- package/dist/components/util/bottom-tab-bar.d.ts +35 -0
- package/dist/components/util/bottom-tab-bar.d.ts.map +1 -0
- package/dist/components/util/calendar.d.ts +56 -0
- package/dist/components/util/calendar.d.ts.map +1 -0
- package/dist/components/util/cn.d.ts +8 -0
- package/dist/components/util/cn.d.ts.map +1 -0
- package/dist/components/util/collapsible.d.ts +58 -0
- package/dist/components/util/collapsible.d.ts.map +1 -0
- package/dist/components/util/confirm-dialog.d.ts +12 -0
- package/dist/components/util/confirm-dialog.d.ts.map +1 -0
- package/dist/components/util/date.d.ts +96 -0
- package/dist/components/util/date.d.ts.map +1 -0
- package/dist/components/util/drawer.d.ts +13 -0
- package/dist/components/util/drawer.d.ts.map +1 -0
- package/dist/components/util/dropdown.d.ts +47 -0
- package/dist/components/util/dropdown.d.ts.map +1 -0
- package/dist/components/util/field.d.ts +39 -0
- package/dist/components/util/field.d.ts.map +1 -0
- package/dist/components/util/fit-in-viewport.d.ts +201 -0
- package/dist/components/util/fit-in-viewport.d.ts.map +1 -0
- package/dist/components/util/focus-utils.d.ts +75 -2
- package/dist/components/util/focus-utils.d.ts.map +1 -1
- package/dist/components/util/hydration.d.ts +45 -0
- package/dist/components/util/hydration.d.ts.map +1 -0
- package/dist/components/util/keyboard-inset.d.ts +18 -0
- package/dist/components/util/keyboard-inset.d.ts.map +1 -0
- package/dist/components/util/media-grid.d.ts +51 -0
- package/dist/components/util/media-grid.d.ts.map +1 -0
- package/dist/components/util/media.d.ts +6 -0
- package/dist/components/util/media.d.ts.map +1 -0
- package/dist/components/util/overlay-chrome.d.ts +53 -0
- package/dist/components/util/overlay-chrome.d.ts.map +1 -0
- package/dist/components/util/overlay.d.ts +72 -0
- package/dist/components/util/overlay.d.ts.map +1 -0
- package/dist/components/util/photo.d.ts +215 -0
- package/dist/components/util/photo.d.ts.map +1 -0
- package/dist/components/util/portal.d.ts +23 -0
- package/dist/components/util/portal.d.ts.map +1 -0
- package/dist/components/util/pull-to-refresh.d.ts +27 -0
- package/dist/components/util/pull-to-refresh.d.ts.map +1 -0
- package/dist/components/util/radio-keys.d.ts +25 -0
- package/dist/components/util/radio-keys.d.ts.map +1 -0
- package/dist/components/util/rating.d.ts +23 -0
- package/dist/components/util/rating.d.ts.map +1 -0
- package/dist/components/util/ready-made-strings.d.ts +77 -0
- package/dist/components/util/ready-made-strings.d.ts.map +1 -0
- package/dist/components/util/scroll-padding.d.ts +20 -0
- package/dist/components/util/scroll-padding.d.ts.map +1 -0
- package/dist/components/util/segmented-control.d.ts +16 -0
- package/dist/components/util/segmented-control.d.ts.map +1 -0
- package/dist/components/util/select.d.ts +41 -0
- package/dist/components/util/select.d.ts.map +1 -0
- package/dist/components/util/sheet-drag.d.ts +60 -0
- package/dist/components/util/sheet-drag.d.ts.map +1 -0
- package/dist/components/util/sidebar.d.ts +63 -0
- package/dist/components/util/sidebar.d.ts.map +1 -0
- package/dist/components/util/sortable-list.d.ts +65 -0
- package/dist/components/util/sortable-list.d.ts.map +1 -0
- package/dist/components/util/ssr-safe.d.ts +4 -4
- package/dist/components/util/ssr-safe.d.ts.map +1 -1
- package/dist/components/util/stepper.d.ts +40 -0
- package/dist/components/util/stepper.d.ts.map +1 -0
- package/dist/components/util/swipeable-list-item.d.ts +36 -0
- package/dist/components/util/swipeable-list-item.d.ts.map +1 -0
- package/dist/components/util/theme-mode.d.ts +80 -0
- package/dist/components/util/theme-mode.d.ts.map +1 -0
- package/dist/components/util/toaster.d.ts +93 -0
- package/dist/components/util/toaster.d.ts.map +1 -0
- package/dist/components/util/tooltip.d.ts +10 -0
- package/dist/components/util/tooltip.d.ts.map +1 -0
- package/dist/components/util/top-navbar.d.ts +11 -0
- package/dist/components/util/top-navbar.d.ts.map +1 -0
- package/dist/components/util/touch-target.d.ts +31 -0
- package/dist/components/util/touch-target.d.ts.map +1 -0
- package/dist/components/util/zabi-strings.d.ts +133 -0
- package/dist/components/util/zabi-strings.d.ts.map +1 -0
- package/dist/create-theme/cli.js +169 -0
- package/dist/create-theme/index.d.ts +176 -0
- package/dist/create-theme/index.js +817 -0
- package/dist/create-theme/lib/ramp-math.js +128 -0
- package/dist/create-theme/lib/resolve.js +141 -0
- package/dist/create-theme/theme-data.js +1116 -0
- package/dist/index.d.ts +83 -3
- package/dist/index.js +60 -8
- package/dist/molecules/Alert.svelte +73 -66
- package/dist/molecules/Alert.svelte.d.ts +9 -1
- package/dist/molecules/AppBar.svelte +415 -0
- package/dist/molecules/AppBar.svelte.d.ts +69 -0
- package/dist/molecules/AvatarGroup.svelte +116 -0
- package/dist/molecules/AvatarGroup.svelte.d.ts +40 -0
- package/dist/molecules/BottomSheet.svelte +540 -0
- package/dist/molecules/BottomSheet.svelte.d.ts +93 -0
- package/dist/molecules/BottomTabBar.svelte +297 -0
- package/dist/molecules/BottomTabBar.svelte.d.ts +64 -0
- package/dist/molecules/Calendar.svelte +597 -0
- package/dist/molecules/Calendar.svelte.d.ts +72 -0
- package/dist/molecules/Collapsible.svelte +243 -0
- package/dist/molecules/Collapsible.svelte.d.ts +44 -0
- package/dist/molecules/CollapsibleGroup.svelte +126 -0
- package/dist/molecules/CollapsibleGroup.svelte.d.ts +14 -0
- package/dist/molecules/ComponentDemo.svelte +25 -5
- package/dist/molecules/ComponentDemo.svelte.d.ts +5 -0
- package/dist/molecules/ConfirmDialog.svelte +253 -0
- package/dist/molecules/ConfirmDialog.svelte.d.ts +55 -0
- package/dist/molecules/ContactForm.svelte +46 -19
- package/dist/molecules/ContactForm.svelte.d.ts +10 -0
- package/dist/molecules/Drawer.svelte +394 -0
- package/dist/molecules/Drawer.svelte.d.ts +55 -0
- package/dist/molecules/Dropdown.svelte +540 -50
- package/dist/molecules/Dropdown.svelte.d.ts +49 -6
- package/dist/molecules/DropdownItem.svelte +122 -0
- package/dist/molecules/DropdownItem.svelte.d.ts +28 -0
- package/dist/molecules/EmptyState.svelte +56 -10
- package/dist/molecules/EmptyState.svelte.d.ts +8 -0
- package/dist/molecules/Form.svelte +25 -14
- package/dist/molecules/Form.svelte.d.ts +13 -5
- package/dist/molecules/FormField.svelte +11 -2
- package/dist/molecules/FormField.svelte.d.ts +2 -0
- package/dist/molecules/Header.svelte +13 -3
- package/dist/molecules/Header.svelte.d.ts +2 -0
- package/dist/molecules/ImageUpload.svelte +422 -70
- package/dist/molecules/ImageUpload.svelte.d.ts +61 -5
- package/dist/molecules/MediaGrid.svelte +527 -0
- package/dist/molecules/MediaGrid.svelte.d.ts +77 -0
- package/dist/molecules/Modal.svelte +340 -45
- package/dist/molecules/Modal.svelte.d.ts +59 -7
- package/dist/molecules/NavigationMenu.svelte +15 -3
- package/dist/molecules/NavigationMenu.svelte.d.ts +4 -0
- package/dist/molecules/NavigationMenuContent.svelte +91 -36
- package/dist/molecules/NavigationMenuContent.svelte.d.ts +2 -0
- package/dist/molecules/NavigationMenuItem.svelte +10 -3
- package/dist/molecules/NavigationMenuItem.svelte.d.ts +2 -0
- package/dist/molecules/NavigationMenuLink.svelte +10 -2
- package/dist/molecules/NavigationMenuLink.svelte.d.ts +2 -0
- package/dist/molecules/NavigationMenuList.svelte +19 -4
- package/dist/molecules/NavigationMenuList.svelte.d.ts +2 -0
- package/dist/molecules/NavigationMenuTrigger.svelte +16 -3
- package/dist/molecules/NavigationMenuTrigger.svelte.d.ts +2 -0
- package/dist/molecules/Page.svelte +38 -2
- package/dist/molecules/Page.svelte.d.ts +13 -0
- package/dist/molecules/PhotoGrid.svelte +433 -0
- package/dist/molecules/PhotoGrid.svelte.d.ts +62 -0
- package/dist/molecules/PhotoViewer.svelte +1116 -0
- package/dist/molecules/PhotoViewer.svelte.d.ts +56 -0
- package/dist/molecules/PropsTable.svelte +26 -11
- package/dist/molecules/PropsTable.svelte.d.ts +5 -0
- package/dist/molecules/PullToRefresh.svelte +263 -0
- package/dist/molecules/PullToRefresh.svelte.d.ts +52 -0
- package/dist/molecules/RadioGroup.svelte +57 -15
- package/dist/molecules/RadioGroup.svelte.d.ts +16 -3
- package/dist/molecules/Section.svelte +13 -5
- package/dist/molecules/Section.svelte.d.ts +3 -1
- package/dist/molecules/SegmentedControl.svelte +323 -0
- package/dist/molecules/SegmentedControl.svelte.d.ts +34 -0
- package/dist/molecules/SidebarBrandHeader.svelte +24 -5
- package/dist/molecules/SidebarBrandHeader.svelte.d.ts +5 -0
- package/dist/molecules/SidebarFooter.svelte +39 -8
- package/dist/molecules/SidebarFooter.svelte.d.ts +5 -0
- package/dist/molecules/SidebarNavSection.svelte +12 -4
- package/dist/molecules/SidebarNavSection.svelte.d.ts +2 -0
- package/dist/molecules/SlideUp.svelte +253 -30
- package/dist/molecules/SlideUp.svelte.d.ts +31 -4
- package/dist/molecules/SortableList.svelte +632 -0
- package/dist/molecules/SortableList.svelte.d.ts +69 -0
- package/dist/molecules/Stepper.svelte +548 -0
- package/dist/molecules/Stepper.svelte.d.ts +39 -0
- package/dist/molecules/StickyActionBar.svelte +191 -0
- package/dist/molecules/StickyActionBar.svelte.d.ts +65 -0
- package/dist/molecules/SwipeableListItem.svelte +334 -0
- package/dist/molecules/SwipeableListItem.svelte.d.ts +54 -0
- package/dist/molecules/Tabs.svelte +254 -24
- package/dist/molecules/Tabs.svelte.d.ts +15 -4
- package/dist/molecules/Toaster.svelte +352 -6
- package/dist/molecules/Toaster.svelte.d.ts +95 -2
- package/dist/molecules/ToasterToast.svelte +279 -62
- package/dist/molecules/ToasterToast.svelte.d.ts +11 -0
- package/dist/molecules/UnsavedChangesBar.svelte +212 -0
- package/dist/molecules/UnsavedChangesBar.svelte.d.ts +43 -0
- package/dist/molecules/index.d.ts +46 -0
- package/dist/molecules/index.js +27 -0
- package/dist/molecules/toast-store.d.ts +53 -7
- package/dist/molecules/toast-store.js +21 -0
- package/dist/organisms/AppShell.svelte +196 -0
- package/dist/organisms/AppShell.svelte.d.ts +61 -0
- package/dist/organisms/SidebarAccountPanel.svelte +111 -12
- package/dist/organisms/SidebarAccountPanel.svelte.d.ts +21 -0
- package/dist/organisms/SidebarNavigation.svelte +193 -69
- package/dist/organisms/SidebarNavigation.svelte.d.ts +31 -1
- package/dist/organisms/SidebarPanel.svelte +45 -16
- package/dist/organisms/SidebarPanel.svelte.d.ts +2 -0
- package/dist/organisms/SidebarShell.svelte +263 -0
- package/dist/organisms/SidebarShell.svelte.d.ts +106 -0
- package/dist/organisms/TopNavbar.svelte +329 -33
- package/dist/organisms/TopNavbar.svelte.d.ts +28 -0
- package/dist/organisms/index.d.ts +6 -0
- package/dist/organisms/index.js +4 -0
- package/dist/routes/lib/variant-utils.d.ts +26 -0
- package/dist/routes/lib/{variant-utils.ts → variant-utils.js} +15 -46
- package/dist/types/components.d.ts +4 -0
- package/dist/types/components.d.ts.map +1 -1
- package/dist/types/events.js +1 -0
- package/dist/types/index.d.ts +605 -25
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -0
- package/dist/types/variants.ts +17 -1
- package/dist/util/app-shell.d.ts +27 -0
- package/dist/util/app-shell.js +72 -0
- package/dist/util/avatar.d.ts +35 -0
- package/dist/util/avatar.js +52 -0
- package/dist/util/bottom-sheet.d.ts +29 -0
- package/dist/util/bottom-sheet.js +43 -0
- package/dist/util/bottom-tab-bar.d.ts +34 -0
- package/dist/util/bottom-tab-bar.js +54 -0
- package/dist/util/calendar.d.ts +55 -0
- package/dist/util/calendar.js +74 -0
- package/dist/util/cn.d.ts +7 -0
- package/dist/util/cn.js +48 -0
- package/dist/util/collapsible.d.ts +57 -0
- package/dist/util/collapsible.js +23 -0
- package/dist/util/confirm-dialog.d.ts +11 -0
- package/dist/util/confirm-dialog.js +2 -0
- package/dist/util/date.d.ts +95 -0
- package/dist/util/date.js +237 -0
- package/dist/util/drawer.d.ts +12 -0
- package/dist/util/drawer.js +7 -0
- package/dist/util/dropdown.d.ts +46 -0
- package/dist/util/dropdown.js +21 -0
- package/dist/util/field.d.ts +38 -0
- package/dist/util/field.js +38 -0
- package/dist/util/fit-in-viewport.d.ts +200 -0
- package/dist/util/fit-in-viewport.js +399 -0
- package/dist/util/focus-utils.d.ts +75 -2
- package/dist/util/focus-utils.js +182 -9
- package/dist/util/hydration.d.ts +44 -0
- package/dist/util/hydration.js +58 -0
- package/dist/util/keyboard-inset.d.ts +17 -0
- package/dist/util/keyboard-inset.js +53 -0
- package/dist/util/media-grid.d.ts +50 -0
- package/dist/util/media-grid.js +81 -0
- package/dist/util/media.d.ts +5 -0
- package/dist/util/media.js +10 -0
- package/dist/util/overlay-chrome.d.ts +52 -0
- package/dist/util/overlay-chrome.js +56 -0
- package/dist/util/overlay.d.ts +71 -0
- package/dist/util/overlay.js +240 -0
- package/dist/util/photo.d.ts +214 -0
- package/dist/util/photo.js +206 -0
- package/dist/util/portal.d.ts +22 -0
- package/dist/util/portal.js +50 -0
- package/dist/util/pull-to-refresh.d.ts +26 -0
- package/dist/util/pull-to-refresh.js +30 -0
- package/dist/util/radio-keys.d.ts +24 -0
- package/dist/util/radio-keys.js +49 -0
- package/dist/util/rating.d.ts +22 -0
- package/dist/util/rating.js +26 -0
- package/dist/util/ready-made-strings.d.ts +76 -0
- package/dist/util/ready-made-strings.js +67 -0
- package/dist/util/scroll-padding.d.ts +19 -0
- package/dist/util/scroll-padding.js +44 -0
- package/dist/util/segmented-control.d.ts +15 -0
- package/dist/util/segmented-control.js +1 -0
- package/dist/util/select.d.ts +40 -0
- package/dist/util/select.js +63 -0
- package/dist/util/sheet-drag.d.ts +59 -0
- package/dist/util/sheet-drag.js +241 -0
- package/dist/util/sidebar.d.ts +62 -0
- package/dist/util/sidebar.js +38 -0
- package/dist/util/sortable-list.d.ts +64 -0
- package/dist/util/sortable-list.js +53 -0
- package/dist/util/ssr-safe.d.ts +4 -4
- package/dist/util/stepper.d.ts +39 -0
- package/dist/util/stepper.js +38 -0
- package/dist/util/swipeable-list-item.d.ts +35 -0
- package/dist/util/swipeable-list-item.js +32 -0
- package/dist/util/theme-mode.d.ts +79 -0
- package/dist/util/theme-mode.js +121 -0
- package/dist/util/toaster.d.ts +92 -0
- package/dist/util/toaster.js +75 -0
- package/dist/util/tooltip.d.ts +9 -0
- package/dist/util/tooltip.js +18 -0
- package/dist/util/top-navbar.d.ts +10 -0
- package/dist/util/top-navbar.js +5 -0
- package/dist/util/touch-target.d.ts +30 -0
- package/dist/util/touch-target.js +30 -0
- package/dist/util/zabi-strings.d.ts +132 -0
- package/dist/util/zabi-strings.js +105 -0
- package/dist/zabi-components-colors.css +5 -2
- package/dist/zabi-components-theme-dark-only.css +574 -225
- package/dist/zabi-components-theme-dark.css +574 -225
- package/dist/zabi-components-theme-only.css +1680 -317
- package/dist/zabi-components-theme.css +1680 -317
- package/dist/zabi-components.css +4473 -1158
- package/docs/lucide-icons.md +41 -16
- package/docs/theme-imports.md +81 -11
- package/package.json +51 -29
- package/dist/lib/layout-width-tokens.d.ts +0 -17
- package/dist/lib/layout-width-tokens.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/Button.d.ts +0 -3
- package/dist/lib/showcase/component-docs/Button.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/Input.d.ts +0 -3
- package/dist/lib/showcase/component-docs/Input.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/List.d.ts +0 -3
- package/dist/lib/showcase/component-docs/List.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/Modal.d.ts +0 -3
- package/dist/lib/showcase/component-docs/Modal.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/Radio.d.ts +0 -3
- package/dist/lib/showcase/component-docs/Radio.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/SidebarNavigation.d.ts +0 -3
- package/dist/lib/showcase/component-docs/SidebarNavigation.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/Skeleton.d.ts +0 -3
- package/dist/lib/showcase/component-docs/Skeleton.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/_shared.d.ts +0 -12
- package/dist/lib/showcase/component-docs/_shared.d.ts.map +0 -1
- package/dist/lib/showcase/component-docs/index.d.ts +0 -4
- package/dist/lib/showcase/component-docs/index.d.ts.map +0 -1
- package/dist/lib/showcase/components-catalog.d.ts +0 -3
- package/dist/lib/showcase/components-catalog.d.ts.map +0 -1
- package/dist/lib/showcase/components-showcase-constants.d.ts +0 -89
- package/dist/lib/showcase/components-showcase-constants.d.ts.map +0 -1
- package/dist/lib/showcase/docs-sidebar-helpers.d.ts +0 -15
- package/dist/lib/showcase/docs-sidebar-helpers.d.ts.map +0 -1
- package/dist/routes/lib/focus-utils.d.ts +0 -12
- package/dist/routes/lib/focus-utils.ts +0 -110
- package/dist/routes/lib/ssr-safe.ts +0 -58
- package/scripts/fix-lucide-svelte-icon-dts.js +0 -35
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import Badge from "../atoms/Badge.svelte";
|
|
4
|
+
import { isDevBuild, isInsideAppShell } from "../util/app-shell.js";
|
|
5
|
+
import {
|
|
6
|
+
activeTabHref,
|
|
7
|
+
badgeText,
|
|
8
|
+
defaultBadgeLabel,
|
|
9
|
+
type BottomTabBarItem,
|
|
10
|
+
} from "../util/bottom-tab-bar.js";
|
|
11
|
+
import { cn } from "../util/cn.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The navigation bar at the bottom of a phone screen: three to five
|
|
15
|
+
* destinations, each an icon over a short label, within reach of a thumb.
|
|
16
|
+
*
|
|
17
|
+
* The tabs are links. Pressing the active one is an ordinary navigation to
|
|
18
|
+
* the page you are on; nothing is ever deselected.
|
|
19
|
+
*
|
|
20
|
+
* On its own the bar is fixed over the page and reserves no room. Give the
|
|
21
|
+
* page `padding-bottom` and `scroll-padding-bottom` of the bar's height
|
|
22
|
+
* (`calc(65px + env(safe-area-inset-bottom))`), or the end of the
|
|
23
|
+
* content, and a focused control there, sits under it. `AppShell` does
|
|
24
|
+
* this for you.
|
|
25
|
+
*
|
|
26
|
+
* The bar is one row, 65px tall, at every width and text size. It is
|
|
27
|
+
* chrome: when the reader enlarges text, the room belongs to the page.
|
|
28
|
+
* So its sizes are in px; a label is one line, grows with the text only
|
|
29
|
+
* up to 1.3 times its size and no further than its tab has room for, and
|
|
30
|
+
* is cut with an ellipsis, never inside a word, when it still does not
|
|
31
|
+
* fit. Where a tab is narrower than 52px (five tabs below 260px) the bar
|
|
32
|
+
* shows icons only. The link is always named by its full label.
|
|
33
|
+
*
|
|
34
|
+
* ```svelte
|
|
35
|
+
* <BottomTabBar
|
|
36
|
+
* items={[
|
|
37
|
+
* { href: "/", label: "Home", icon: House },
|
|
38
|
+
* { href: "/quiz", label: "Quiz", icon: Trophy },
|
|
39
|
+
* { href: "/inbox", label: "Inbox", icon: Bell, badge: 3 },
|
|
40
|
+
* ]}
|
|
41
|
+
* active={page.url.pathname}
|
|
42
|
+
* />
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
type Props = Omit<HTMLAttributes<HTMLElement>, "class"> & {
|
|
46
|
+
/** Three to five destinations. */
|
|
47
|
+
items: BottomTabBarItem[];
|
|
48
|
+
/**
|
|
49
|
+
* The href of the active tab, or the path of the current page: the tab
|
|
50
|
+
* for that page or the closest one above it is marked. Left out, the
|
|
51
|
+
* bar reads the address of the page once it runs in the browser. In
|
|
52
|
+
* SvelteKit pass `page.url.pathname`, so the server marks it too.
|
|
53
|
+
*/
|
|
54
|
+
active?: string;
|
|
55
|
+
/** Accessible name of the navigation landmark. */
|
|
56
|
+
label?: string;
|
|
57
|
+
/**
|
|
58
|
+
* What a badge adds to the tab's accessible name, after the label and
|
|
59
|
+
* a comma. Replace it to translate or to say what is being counted.
|
|
60
|
+
*/
|
|
61
|
+
badgeLabel?: (count: number, item: BottomTabBarItem) => string;
|
|
62
|
+
/** Counts above this show as `99+`. The accessible name keeps the real count. */
|
|
63
|
+
badgeMax?: number;
|
|
64
|
+
/**
|
|
65
|
+
* `fixed` pins the bar to the bottom of the screen; `static` leaves it
|
|
66
|
+
* where it is in the page. Defaults to `fixed`, or to `static` inside
|
|
67
|
+
* an `AppShell`, which places the bar itself.
|
|
68
|
+
*/
|
|
69
|
+
position?: "fixed" | "static";
|
|
70
|
+
class?: string;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
let {
|
|
74
|
+
items,
|
|
75
|
+
active,
|
|
76
|
+
label = "Main",
|
|
77
|
+
badgeLabel = defaultBadgeLabel,
|
|
78
|
+
badgeMax = 99,
|
|
79
|
+
position,
|
|
80
|
+
class: className = "",
|
|
81
|
+
...restProps
|
|
82
|
+
}: Props = $props();
|
|
83
|
+
|
|
84
|
+
const inShell = isInsideAppShell();
|
|
85
|
+
const resolvedPosition = $derived(position ?? (inShell ? "static" : "fixed"));
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The page's own path, used while `active` is not given. Empty on the
|
|
89
|
+
* server and until the bar has mounted: nothing here may read `location`
|
|
90
|
+
* while rendering.
|
|
91
|
+
*/
|
|
92
|
+
let locationPath = $state("");
|
|
93
|
+
|
|
94
|
+
$effect(() => {
|
|
95
|
+
if (active !== undefined) return;
|
|
96
|
+
const read = () => {
|
|
97
|
+
locationPath = window.location.pathname;
|
|
98
|
+
};
|
|
99
|
+
read();
|
|
100
|
+
// Back and forward, and every other same-document navigation where the
|
|
101
|
+
// browser reports them. A router that only calls `history.pushState`
|
|
102
|
+
// is not seen by a browser without the Navigation API: pass `active`.
|
|
103
|
+
window.addEventListener("popstate", read);
|
|
104
|
+
const navigation = (window as { navigation?: EventTarget }).navigation;
|
|
105
|
+
navigation?.addEventListener("currententrychange", read);
|
|
106
|
+
return () => {
|
|
107
|
+
window.removeEventListener("popstate", read);
|
|
108
|
+
navigation?.removeEventListener("currententrychange", read);
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const activeHref = $derived(activeTabHref(items, active ?? locationPath));
|
|
113
|
+
|
|
114
|
+
$effect(() => {
|
|
115
|
+
if (!isDevBuild()) return;
|
|
116
|
+
if (items.length < 3 || items.length > 5) {
|
|
117
|
+
console.warn(
|
|
118
|
+
`[zabi-components] BottomTabBar is made for 3 to 5 items and got ${items.length}. ` +
|
|
119
|
+
"With fewer, use links in the page; with more, move the rest into a menu.",
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* The colours are chosen here, not with an `aria-[current=page]:` variant:
|
|
126
|
+
* the hand-written colour classes sit outside Tailwind's cascade layer and
|
|
127
|
+
* would beat it (see TopNavbar).
|
|
128
|
+
*/
|
|
129
|
+
function linkClasses(isActive: boolean): string {
|
|
130
|
+
// Every size is in px (the nav sets `--spacing: 4px`): in rem they
|
|
131
|
+
// doubled with the text size, and the bar was 177px tall at 200%.
|
|
132
|
+
//
|
|
133
|
+
// Radius: the active pill (32px high, so 16px at its ends) sits 4px
|
|
134
|
+
// inside this box on every side, so the box takes that radius plus
|
|
135
|
+
// the 4px. No gap between pill and label: 32px and a 16px line in a
|
|
136
|
+
// 56px box leave the same 4px above and below as at the sides.
|
|
137
|
+
const base =
|
|
138
|
+
"focus-ring focus-ring--nav flex min-h-14 w-full min-w-0 flex-col items-center justify-center gap-0 rounded-[20px] px-[4px] text-center no-underline transition-colors duration-150 motion-reduce:transition-none";
|
|
139
|
+
return isActive
|
|
140
|
+
? cn(base, "font-semibold text-nav-menu-item-active")
|
|
141
|
+
: cn(
|
|
142
|
+
base,
|
|
143
|
+
"font-medium text-nav-menu-item hover:bg-nav-menu-hover hover:text-nav-menu-item-hover active:bg-surface-active",
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
</script>
|
|
147
|
+
|
|
148
|
+
<nav
|
|
149
|
+
aria-label={label}
|
|
150
|
+
data-position={resolvedPosition}
|
|
151
|
+
class={cn(
|
|
152
|
+
"tabbar border-t border-border-weak bg-surface-elevated [--spacing:4px]",
|
|
153
|
+
// Clear of the home indicator, and of the rounded corners in landscape.
|
|
154
|
+
"pb-[env(safe-area-inset-bottom)] pl-[env(safe-area-inset-left)] pr-[env(safe-area-inset-right)]",
|
|
155
|
+
resolvedPosition === "fixed" && "fixed inset-x-0 bottom-0 z-sticky",
|
|
156
|
+
className,
|
|
157
|
+
)}
|
|
158
|
+
style:--tabbar-count={items.length}
|
|
159
|
+
{...restProps}
|
|
160
|
+
>
|
|
161
|
+
<!-- 8px between the tabs and at the sides while every tab can be 52px
|
|
162
|
+
wide; less as the bar narrows, down to none, so the tabs keep the width a
|
|
163
|
+
label needs for as long as there is any. See the style block. -->
|
|
164
|
+
<ul class="tabbar-list m-0 flex list-none items-stretch py-1">
|
|
165
|
+
{#each items as item (item.href)}
|
|
166
|
+
{@const isActive = item.href === activeHref}
|
|
167
|
+
{@const Icon = item.icon}
|
|
168
|
+
{@const count = item.badge ?? 0}
|
|
169
|
+
<li class="tabbar-tab flex">
|
|
170
|
+
<!-- The name is spelled out when there is a count: built from
|
|
171
|
+
the content, a browser reads "Inbox , 3 new" or leaves the
|
|
172
|
+
count out, depending on how it treats the hidden text. It
|
|
173
|
+
starts with the visible label, so voice control still finds it. -->
|
|
174
|
+
<a
|
|
175
|
+
href={item.href}
|
|
176
|
+
class={linkClasses(isActive)}
|
|
177
|
+
aria-current={isActive ? "page" : undefined}
|
|
178
|
+
aria-label={count > 0 ? `${item.label}, ${badgeLabel(count, item)}` : undefined}
|
|
179
|
+
>
|
|
180
|
+
<!-- The pill is the active mark. Its fill is within a shade of
|
|
181
|
+
the bar (1.24:1 in light, 1.07:1 in dark), so by itself it
|
|
182
|
+
marks nothing for an eye that needs contrast: the 2px
|
|
183
|
+
outline inside it, in the action colour, is what reaches
|
|
184
|
+
3:1 against the bar in both themes, with the labels and
|
|
185
|
+
in the icon-only bar alike. The icon takes the same
|
|
186
|
+
colour. In forced-colors mode the fill is dropped and the
|
|
187
|
+
outline is drawn in a system colour, so the active tab
|
|
188
|
+
keeps a shape there too. Decorative with all it holds:
|
|
189
|
+
the label names the tab. -->
|
|
190
|
+
<span
|
|
191
|
+
aria-hidden="true"
|
|
192
|
+
class={cn(
|
|
193
|
+
"flex h-8 w-[min(56px,100%)] shrink-0 items-center justify-center rounded-pill transition-colors duration-150 motion-reduce:transition-none",
|
|
194
|
+
isActive &&
|
|
195
|
+
"bg-nav-menu-active text-(color:--color-action-primary) outline-2 -outline-offset-2 outline-(color:--color-action-primary)",
|
|
196
|
+
)}
|
|
197
|
+
>
|
|
198
|
+
<!-- The badge is placed against the icon's own 24px
|
|
199
|
+
box, in px: from its upper end corner outwards. It
|
|
200
|
+
covers that corner by 8px and no more, whatever the
|
|
201
|
+
text size and however narrow the pill is. -->
|
|
202
|
+
<span class="relative flex size-6 shrink-0 items-center justify-center">
|
|
203
|
+
<Icon size={24} class="shrink-0" />
|
|
204
|
+
{#if count > 0}
|
|
205
|
+
<Badge
|
|
206
|
+
size="sm"
|
|
207
|
+
emphasis="solid"
|
|
208
|
+
class="tabbar-badge absolute start-4 bottom-4 h-[18px] min-h-[18px] min-w-[18px] px-[5px] py-0 text-[11px] leading-[18px] whitespace-nowrap"
|
|
209
|
+
>
|
|
210
|
+
{badgeText(count, badgeMax)}
|
|
211
|
+
</Badge>
|
|
212
|
+
{/if}
|
|
213
|
+
</span>
|
|
214
|
+
</span>
|
|
215
|
+
<span class="tabbar-label">
|
|
216
|
+
{item.label}
|
|
217
|
+
</span>
|
|
218
|
+
</a>
|
|
219
|
+
</li>
|
|
220
|
+
{/each}
|
|
221
|
+
</ul>
|
|
222
|
+
</nav>
|
|
223
|
+
|
|
224
|
+
<style>
|
|
225
|
+
/*
|
|
226
|
+
* The bar measures itself: the tabs and the gaps are sized from its own
|
|
227
|
+
* width and the number of tabs, not from the screen, so a bar in a narrow
|
|
228
|
+
* column behaves like one on a narrow phone.
|
|
229
|
+
*/
|
|
230
|
+
.tabbar {
|
|
231
|
+
container: tabbar / inline-size;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/*
|
|
235
|
+
* The room between the tabs and at the two sides is whatever is left
|
|
236
|
+
* when every tab is 52px wide, shared out, and never more than 8px. So
|
|
237
|
+
* the bar gives up its gaps before it gives up label room: five tabs are
|
|
238
|
+
* 8px apart from 308px up (a 320px phone included), closer below that,
|
|
239
|
+
* and touch at 260px.
|
|
240
|
+
*/
|
|
241
|
+
.tabbar-list {
|
|
242
|
+
--tabbar-gap: clamp(
|
|
243
|
+
0px,
|
|
244
|
+
calc((100cqi - var(--tabbar-count) * 52px) / (var(--tabbar-count) + 1)),
|
|
245
|
+
8px
|
|
246
|
+
);
|
|
247
|
+
gap: var(--tabbar-gap);
|
|
248
|
+
padding-inline: var(--tabbar-gap);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/*
|
|
252
|
+
* A tab is at least 44px wide for as long as that many fit the bar. When
|
|
253
|
+
* they do not (five tabs below 220px), they share the bar edge to edge:
|
|
254
|
+
* narrower than a full target, but never on top of each other, and the
|
|
255
|
+
* bar never scrolls sideways. Each tab is a container too, so its label
|
|
256
|
+
* can follow its width.
|
|
257
|
+
*/
|
|
258
|
+
.tabbar-tab {
|
|
259
|
+
flex: 1 1 0;
|
|
260
|
+
min-width: min(44px, calc(100cqi / var(--tabbar-count)));
|
|
261
|
+
container: tabbar-tab / inline-size;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/*
|
|
265
|
+
* One line. 0.75rem, so it follows the reader's text size, but never
|
|
266
|
+
* above 1.3 times its 12px, nor above what a nine-letter word needs to
|
|
267
|
+
* fit the tab (18.5% of its width), and never below 11px. A label longer
|
|
268
|
+
* than that is cut with an ellipsis, between letters but with the mark
|
|
269
|
+
* that says so; it is not broken over lines.
|
|
270
|
+
*/
|
|
271
|
+
.tabbar-label {
|
|
272
|
+
display: block;
|
|
273
|
+
width: 100%;
|
|
274
|
+
min-width: 0;
|
|
275
|
+
overflow: hidden;
|
|
276
|
+
text-overflow: ellipsis;
|
|
277
|
+
white-space: nowrap;
|
|
278
|
+
font-size: clamp(11px, 0.75rem, min(15.6px, 18.5cqi));
|
|
279
|
+
line-height: 16px;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/*
|
|
283
|
+
* Narrower than 52px, a tab has no room for a word: icons only, for every
|
|
284
|
+
* tab, the active one too, so the row reads as one thing. The label stays
|
|
285
|
+
* in the page for the link's name; it is only not drawn.
|
|
286
|
+
*/
|
|
287
|
+
@container tabbar-tab (max-width: 51.9px) {
|
|
288
|
+
.tabbar-label {
|
|
289
|
+
position: absolute;
|
|
290
|
+
width: 1px;
|
|
291
|
+
height: 1px;
|
|
292
|
+
overflow: hidden;
|
|
293
|
+
clip-path: inset(50%);
|
|
294
|
+
white-space: nowrap;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
</style>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
+
import { type BottomTabBarItem } from "../util/bottom-tab-bar.js";
|
|
3
|
+
/**
|
|
4
|
+
* The navigation bar at the bottom of a phone screen: three to five
|
|
5
|
+
* destinations, each an icon over a short label, within reach of a thumb.
|
|
6
|
+
*
|
|
7
|
+
* The tabs are links. Pressing the active one is an ordinary navigation to
|
|
8
|
+
* the page you are on; nothing is ever deselected.
|
|
9
|
+
*
|
|
10
|
+
* On its own the bar is fixed over the page and reserves no room. Give the
|
|
11
|
+
* page `padding-bottom` and `scroll-padding-bottom` of the bar's height
|
|
12
|
+
* (`calc(65px + env(safe-area-inset-bottom))`), or the end of the
|
|
13
|
+
* content, and a focused control there, sits under it. `AppShell` does
|
|
14
|
+
* this for you.
|
|
15
|
+
*
|
|
16
|
+
* The bar is one row, 65px tall, at every width and text size. It is
|
|
17
|
+
* chrome: when the reader enlarges text, the room belongs to the page.
|
|
18
|
+
* So its sizes are in px; a label is one line, grows with the text only
|
|
19
|
+
* up to 1.3 times its size and no further than its tab has room for, and
|
|
20
|
+
* is cut with an ellipsis, never inside a word, when it still does not
|
|
21
|
+
* fit. Where a tab is narrower than 52px (five tabs below 260px) the bar
|
|
22
|
+
* shows icons only. The link is always named by its full label.
|
|
23
|
+
*
|
|
24
|
+
* ```svelte
|
|
25
|
+
* <BottomTabBar
|
|
26
|
+
* items={[
|
|
27
|
+
* { href: "/", label: "Home", icon: House },
|
|
28
|
+
* { href: "/quiz", label: "Quiz", icon: Trophy },
|
|
29
|
+
* { href: "/inbox", label: "Inbox", icon: Bell, badge: 3 },
|
|
30
|
+
* ]}
|
|
31
|
+
* active={page.url.pathname}
|
|
32
|
+
* />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
type Props = Omit<HTMLAttributes<HTMLElement>, "class"> & {
|
|
36
|
+
/** Three to five destinations. */
|
|
37
|
+
items: BottomTabBarItem[];
|
|
38
|
+
/**
|
|
39
|
+
* The href of the active tab, or the path of the current page: the tab
|
|
40
|
+
* for that page or the closest one above it is marked. Left out, the
|
|
41
|
+
* bar reads the address of the page once it runs in the browser. In
|
|
42
|
+
* SvelteKit pass `page.url.pathname`, so the server marks it too.
|
|
43
|
+
*/
|
|
44
|
+
active?: string;
|
|
45
|
+
/** Accessible name of the navigation landmark. */
|
|
46
|
+
label?: string;
|
|
47
|
+
/**
|
|
48
|
+
* What a badge adds to the tab's accessible name, after the label and
|
|
49
|
+
* a comma. Replace it to translate or to say what is being counted.
|
|
50
|
+
*/
|
|
51
|
+
badgeLabel?: (count: number, item: BottomTabBarItem) => string;
|
|
52
|
+
/** Counts above this show as `99+`. The accessible name keeps the real count. */
|
|
53
|
+
badgeMax?: number;
|
|
54
|
+
/**
|
|
55
|
+
* `fixed` pins the bar to the bottom of the screen; `static` leaves it
|
|
56
|
+
* where it is in the page. Defaults to `fixed`, or to `static` inside
|
|
57
|
+
* an `AppShell`, which places the bar itself.
|
|
58
|
+
*/
|
|
59
|
+
position?: "fixed" | "static";
|
|
60
|
+
class?: string;
|
|
61
|
+
};
|
|
62
|
+
declare const BottomTabBar: import("svelte").Component<Props, {}, "">;
|
|
63
|
+
type BottomTabBar = ReturnType<typeof BottomTabBar>;
|
|
64
|
+
export default BottomTabBar;
|