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.
- package/CHANGELOG.md +2935 -0
- package/README.md +243 -10
- package/THEME.md +162 -332
- package/THEMING.md +1419 -259
- package/dist/atoms/ActionPanel.svelte +15 -5
- package/dist/atoms/Avatar.svelte +120 -0
- package/dist/atoms/Avatar.svelte.d.ts +46 -0
- package/dist/atoms/Badge.svelte +71 -13
- package/dist/atoms/Badge.svelte.d.ts +8 -2
- package/dist/atoms/Block.svelte +74 -0
- package/dist/atoms/Block.svelte.d.ts +29 -0
- package/dist/atoms/Button.svelte +217 -30
- package/dist/atoms/Button.svelte.d.ts +33 -4
- package/dist/atoms/Card.svelte +182 -26
- package/dist/atoms/Card.svelte.d.ts +55 -3
- package/dist/atoms/CardHeader.svelte +16 -4
- package/dist/atoms/Checkbox.svelte +81 -21
- package/dist/atoms/Checkbox.svelte.d.ts +31 -2
- package/dist/atoms/Chip.svelte +351 -0
- package/dist/atoms/Chip.svelte.d.ts +57 -0
- package/dist/atoms/CodeBlock.svelte +20 -2
- package/dist/atoms/CodeBlock.svelte.d.ts +4 -0
- package/dist/atoms/CodeField.svelte +385 -0
- package/dist/atoms/CodeField.svelte.d.ts +61 -0
- package/dist/atoms/ColorPicker.svelte +260 -49
- package/dist/atoms/ColorPicker.svelte.d.ts +3 -0
- package/dist/atoms/Container.svelte +16 -8
- package/dist/atoms/DateField.svelte +145 -0
- package/dist/atoms/DateField.svelte.d.ts +81 -0
- package/dist/atoms/FieldMessages.svelte +69 -0
- package/dist/atoms/FieldMessages.svelte.d.ts +23 -0
- package/dist/atoms/FloatingActionButton.svelte +176 -0
- package/dist/atoms/FloatingActionButton.svelte.d.ts +51 -0
- package/dist/atoms/Heading.svelte +63 -5
- package/dist/atoms/Heading.svelte.d.ts +14 -0
- package/dist/atoms/IconButton.svelte +294 -26
- package/dist/atoms/IconButton.svelte.d.ts +62 -4
- package/dist/atoms/Input.svelte +259 -53
- package/dist/atoms/Input.svelte.d.ts +33 -2
- package/dist/atoms/List.svelte +5 -1
- package/dist/atoms/ListItem.svelte +70 -13
- package/dist/atoms/ListItem.svelte.d.ts +11 -0
- package/dist/atoms/PickerField.svelte +239 -0
- package/dist/atoms/PickerField.svelte.d.ts +67 -0
- package/dist/atoms/Progress.svelte +99 -19
- package/dist/atoms/Progress.svelte.d.ts +15 -1
- package/dist/atoms/Radio.svelte +51 -3
- package/dist/atoms/Radio.svelte.d.ts +30 -2
- package/dist/atoms/Rating.svelte +620 -0
- package/dist/atoms/Rating.svelte.d.ts +77 -0
- package/dist/atoms/Select.svelte +438 -98
- package/dist/atoms/Select.svelte.d.ts +61 -3
- package/dist/atoms/SelectionControl.svelte +193 -23
- package/dist/atoms/SelectionControl.svelte.d.ts +29 -3
- package/dist/atoms/Skeleton.svelte +114 -18
- package/dist/atoms/Skeleton.svelte.d.ts +30 -3
- package/dist/atoms/SkeletonGroup.svelte +43 -0
- package/dist/atoms/SkeletonGroup.svelte.d.ts +20 -0
- package/dist/atoms/Slider.svelte +344 -0
- package/dist/atoms/Slider.svelte.d.ts +40 -0
- package/dist/atoms/Sparkline.svelte +109 -0
- package/dist/atoms/Sparkline.svelte.d.ts +27 -0
- package/dist/atoms/SpeechBubble.svelte +187 -0
- package/dist/atoms/SpeechBubble.svelte.d.ts +33 -0
- package/dist/atoms/Spinner.svelte +57 -0
- package/dist/atoms/Spinner.svelte.d.ts +19 -0
- package/dist/atoms/Stat.svelte +72 -0
- package/dist/atoms/Stat.svelte.d.ts +19 -0
- package/dist/atoms/Table.svelte +151 -6
- package/dist/atoms/Table.svelte.d.ts +15 -3
- package/dist/atoms/TemporalField.svelte +472 -0
- package/dist/atoms/TemporalField.svelte.d.ts +48 -0
- package/dist/atoms/Text.svelte +23 -11
- package/dist/atoms/Text.svelte.d.ts +6 -3
- package/dist/atoms/Textarea.svelte +150 -44
- package/dist/atoms/Textarea.svelte.d.ts +35 -2
- package/dist/atoms/ThemeToggle.svelte +223 -44
- package/dist/atoms/ThemeToggle.svelte.d.ts +26 -3
- package/dist/atoms/TimeColumn.svelte +150 -0
- package/dist/atoms/TimeColumn.svelte.d.ts +25 -0
- package/dist/atoms/TimeField.svelte +151 -0
- package/dist/atoms/TimeField.svelte.d.ts +85 -0
- package/dist/atoms/Toast.svelte +22 -8
- package/dist/atoms/Toast.svelte.d.ts +2 -0
- package/dist/atoms/Toggle.svelte +98 -14
- package/dist/atoms/Toggle.svelte.d.ts +26 -2
- package/dist/atoms/Tooltip.svelte +528 -24
- package/dist/atoms/Tooltip.svelte.d.ts +18 -0
- package/dist/atoms/ZabiStringsProvider.svelte +45 -0
- package/dist/atoms/ZabiStringsProvider.svelte.d.ts +27 -0
- package/dist/atoms/index.d.ts +38 -0
- package/dist/atoms/index.js +29 -0
- package/dist/atoms/selection-control.styles.d.ts +47 -5
- package/dist/atoms/selection-control.styles.js +52 -10
- package/dist/components/atoms/index.d.ts +38 -0
- package/dist/components/atoms/index.d.ts.map +1 -1
- package/dist/components/atoms/selection-control.styles.d.ts +47 -5
- package/dist/components/atoms/selection-control.styles.d.ts.map +1 -1
- package/dist/components/index.d.ts +104 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/map.d.ts +11 -0
- package/dist/components/map.d.ts.map +1 -0
- package/dist/components/molecules/index.d.ts +51 -0
- package/dist/components/molecules/index.d.ts.map +1 -1
- package/dist/components/molecules/toast-store.d.ts +83 -7
- package/dist/components/molecules/toast-store.d.ts.map +1 -1
- package/dist/components/organisms/index.d.ts +10 -0
- package/dist/components/organisms/index.d.ts.map +1 -1
- package/dist/components/types/variants.d.ts +24 -1
- package/dist/components/types/variants.d.ts.map +1 -1
- package/dist/components/util/app-shell.d.ts +79 -0
- package/dist/components/util/app-shell.d.ts.map +1 -0
- package/dist/components/util/avatar.d.ts +39 -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 +41 -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/chart.d.ts +140 -0
- package/dist/components/util/chart.d.ts.map +1 -0
- package/dist/components/util/chip.d.ts +66 -0
- package/dist/components/util/chip.d.ts.map +1 -0
- package/dist/components/util/cn.d.ts.map +1 -1
- package/dist/components/util/code-field.d.ts +63 -0
- package/dist/components/util/code-field.d.ts.map +1 -0
- package/dist/components/util/collapsible.d.ts +64 -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/display-voice.d.ts +10 -0
- package/dist/components/util/display-voice.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-control.d.ts +30 -0
- package/dist/components/util/field-control.d.ts.map +1 -0
- package/dist/components/util/field.d.ts +45 -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 +77 -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/map-view.d.ts +144 -0
- package/dist/components/util/map-view.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 +234 -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/progress.d.ts +19 -0
- package/dist/components/util/progress.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-edge.d.ts +33 -0
- package/dist/components/util/scroll-edge.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 +84 -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/skeleton.d.ts +15 -0
- package/dist/components/util/skeleton.d.ts.map +1 -0
- package/dist/components/util/sliding-indicator.d.ts +25 -0
- package/dist/components/util/sliding-indicator.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/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/temporal-field.d.ts +89 -0
- package/dist/components/util/temporal-field.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 +133 -0
- package/dist/components/util/toaster.d.ts.map +1 -0
- package/dist/components/util/tone-surface.d.ts +34 -0
- package/dist/components/util/tone-surface.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 +35 -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 +142 -0
- package/dist/components/util/zabi-strings.d.ts.map +1 -0
- package/dist/create-theme/cli.js +173 -0
- package/dist/create-theme/index.d.ts +190 -0
- package/dist/create-theme/index.js +1034 -0
- package/dist/create-theme/lib/ramp-math.js +128 -0
- package/dist/create-theme/lib/resolve.js +238 -0
- package/dist/create-theme/theme-data.js +2644 -0
- package/dist/index.d.ts +104 -2
- package/dist/index.js +75 -2
- package/dist/map.d.ts +10 -0
- package/dist/map.js +9 -0
- package/dist/molecules/Alert.svelte +63 -16
- package/dist/molecules/Alert.svelte.d.ts +14 -1
- package/dist/molecules/AppBar.svelte +674 -0
- package/dist/molecules/AppBar.svelte.d.ts +131 -0
- package/dist/molecules/AvatarGroup.svelte +116 -0
- package/dist/molecules/AvatarGroup.svelte.d.ts +40 -0
- package/dist/molecules/BarChart.svelte +381 -0
- package/dist/molecules/BarChart.svelte.d.ts +45 -0
- package/dist/molecules/BottomSheet.svelte +608 -0
- package/dist/molecules/BottomSheet.svelte.d.ts +109 -0
- package/dist/molecules/BottomTabBar.svelte +403 -0
- package/dist/molecules/BottomTabBar.svelte.d.ts +98 -0
- package/dist/molecules/Calendar.svelte +597 -0
- package/dist/molecules/Calendar.svelte.d.ts +72 -0
- package/dist/molecules/ChipGroup.svelte +325 -0
- package/dist/molecules/ChipGroup.svelte.d.ts +41 -0
- package/dist/molecules/Collapsible.svelte +347 -0
- package/dist/molecules/Collapsible.svelte.d.ts +61 -0
- package/dist/molecules/CollapsibleGroup.svelte +136 -0
- package/dist/molecules/CollapsibleGroup.svelte.d.ts +14 -0
- package/dist/molecules/ComponentDemo.svelte +16 -4
- package/dist/molecules/ComponentDemo.svelte.d.ts +3 -0
- package/dist/molecules/ConfirmDialog.svelte +257 -0
- package/dist/molecules/ConfirmDialog.svelte.d.ts +58 -0
- package/dist/molecules/ContactForm.svelte +34 -17
- package/dist/molecules/ContactForm.svelte.d.ts +8 -0
- package/dist/molecules/Drawer.svelte +415 -0
- package/dist/molecules/Drawer.svelte.d.ts +55 -0
- package/dist/molecules/Dropdown.svelte +517 -48
- package/dist/molecules/Dropdown.svelte.d.ts +47 -6
- package/dist/molecules/DropdownItem.svelte +122 -0
- package/dist/molecules/DropdownItem.svelte.d.ts +28 -0
- package/dist/molecules/EmptyState.svelte +55 -10
- package/dist/molecules/EmptyState.svelte.d.ts +8 -0
- package/dist/molecules/FormField.svelte +9 -1
- package/dist/molecules/FormField.svelte.d.ts +2 -0
- package/dist/molecules/Header.svelte +1 -1
- package/dist/molecules/ImageUpload.svelte +492 -69
- package/dist/molecules/ImageUpload.svelte.d.ts +82 -2
- package/dist/molecules/LineChart.svelte +459 -0
- package/dist/molecules/LineChart.svelte.d.ts +53 -0
- package/dist/molecules/MapView.svelte +565 -0
- package/dist/molecules/MapView.svelte.d.ts +88 -0
- package/dist/molecules/MediaGrid.svelte +527 -0
- package/dist/molecules/MediaGrid.svelte.d.ts +77 -0
- package/dist/molecules/Modal.svelte +293 -72
- package/dist/molecules/Modal.svelte.d.ts +51 -2
- package/dist/molecules/NavigationMenuContent.svelte +58 -1
- package/dist/molecules/NavigationMenuItem.svelte +0 -1
- package/dist/molecules/NavigationMenuLink.svelte +1 -1
- package/dist/molecules/NavigationMenuList.svelte +10 -3
- package/dist/molecules/NavigationMenuTrigger.svelte +2 -2
- package/dist/molecules/Page.svelte +32 -2
- package/dist/molecules/Page.svelte.d.ts +11 -0
- package/dist/molecules/PhotoGrid.svelte +523 -0
- package/dist/molecules/PhotoGrid.svelte.d.ts +73 -0
- package/dist/molecules/PhotoViewer.svelte +1213 -0
- package/dist/molecules/PhotoViewer.svelte.d.ts +74 -0
- package/dist/molecules/PieChart.svelte +421 -0
- package/dist/molecules/PieChart.svelte.d.ts +51 -0
- package/dist/molecules/PropsTable.svelte +22 -10
- package/dist/molecules/PropsTable.svelte.d.ts +3 -0
- package/dist/molecules/PullToRefresh.svelte +263 -0
- package/dist/molecules/PullToRefresh.svelte.d.ts +52 -0
- package/dist/molecules/RadioGroup.svelte +72 -18
- package/dist/molecules/RadioGroup.svelte.d.ts +19 -3
- package/dist/molecules/Section.svelte +1 -1
- package/dist/molecules/SegmentedControl.svelte +456 -0
- package/dist/molecules/SegmentedControl.svelte.d.ts +40 -0
- package/dist/molecules/SidebarBrandHeader.svelte +11 -1
- package/dist/molecules/SidebarBrandHeader.svelte.d.ts +3 -0
- package/dist/molecules/SidebarFooter.svelte +30 -7
- package/dist/molecules/SidebarFooter.svelte.d.ts +3 -0
- package/dist/molecules/SidebarNavSection.svelte +1 -1
- package/dist/molecules/SlideUp.svelte +220 -61
- package/dist/molecules/SlideUp.svelte.d.ts +26 -0
- package/dist/molecules/SortableList.svelte +633 -0
- package/dist/molecules/SortableList.svelte.d.ts +69 -0
- package/dist/molecules/Stepper.svelte +562 -0
- package/dist/molecules/Stepper.svelte.d.ts +39 -0
- package/dist/molecules/StickyActionBar.svelte +250 -0
- package/dist/molecules/StickyActionBar.svelte.d.ts +78 -0
- package/dist/molecules/SwipeableListItem.svelte +334 -0
- package/dist/molecules/SwipeableListItem.svelte.d.ts +54 -0
- package/dist/molecules/Tabs.svelte +310 -9
- package/dist/molecules/Tabs.svelte.d.ts +7 -0
- package/dist/molecules/Toaster.svelte +514 -5
- package/dist/molecules/Toaster.svelte.d.ts +153 -2
- package/dist/molecules/ToasterToast.svelte +495 -77
- package/dist/molecules/ToasterToast.svelte.d.ts +15 -0
- package/dist/molecules/UnsavedChangesBar.svelte +223 -0
- package/dist/molecules/UnsavedChangesBar.svelte.d.ts +43 -0
- package/dist/molecules/index.d.ts +51 -0
- package/dist/molecules/index.js +31 -0
- package/dist/molecules/toast-store.d.ts +83 -7
- package/dist/molecules/toast-store.js +25 -1
- package/dist/organisms/AppNavigation.svelte +440 -0
- package/dist/organisms/AppNavigation.svelte.d.ts +72 -0
- package/dist/organisms/AppShell.svelte +696 -0
- package/dist/organisms/AppShell.svelte.d.ts +157 -0
- package/dist/organisms/AppShellHeaderPart.svelte +163 -0
- package/dist/organisms/AppShellHeaderPart.svelte.d.ts +57 -0
- package/dist/organisms/SidebarAccountPanel.svelte +107 -12
- package/dist/organisms/SidebarAccountPanel.svelte.d.ts +19 -0
- package/dist/organisms/SidebarNavigation.svelte +111 -43
- package/dist/organisms/SidebarNavigation.svelte.d.ts +29 -1
- package/dist/organisms/SidebarPanel.svelte +34 -17
- package/dist/organisms/SidebarPanel.svelte.d.ts +1 -0
- package/dist/organisms/SidebarShell.svelte +164 -14
- package/dist/organisms/SidebarShell.svelte.d.ts +56 -2
- package/dist/organisms/TopNavbar.svelte +353 -39
- package/dist/organisms/TopNavbar.svelte.d.ts +47 -0
- package/dist/organisms/TopNavbarSheetContent.svelte +145 -0
- package/dist/organisms/TopNavbarSheetContent.svelte.d.ts +24 -0
- package/dist/organisms/index.d.ts +10 -0
- package/dist/organisms/index.js +7 -0
- package/dist/types/components.d.ts +21 -1
- package/dist/types/components.d.ts.map +1 -1
- package/dist/types/index.d.ts +1093 -26
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/variants.ts +28 -1
- package/dist/util/app-shell.d.ts +78 -0
- package/dist/util/app-shell.js +97 -0
- package/dist/util/avatar.d.ts +38 -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 +40 -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/chart.d.ts +139 -0
- package/dist/util/chart.js +305 -0
- package/dist/util/chip.d.ts +65 -0
- package/dist/util/chip.js +58 -0
- package/dist/util/cn.js +28 -2
- package/dist/util/code-field.d.ts +62 -0
- package/dist/util/code-field.js +112 -0
- package/dist/util/collapsible.d.ts +63 -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/display-voice.d.ts +9 -0
- package/dist/util/display-voice.js +9 -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-control.d.ts +29 -0
- package/dist/util/field-control.js +32 -0
- package/dist/util/field.d.ts +44 -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 +77 -2
- package/dist/util/focus-utils.js +186 -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/map-view.d.ts +143 -0
- package/dist/util/map-view.js +121 -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 +233 -0
- package/dist/util/photo.js +209 -0
- package/dist/util/portal.d.ts +22 -0
- package/dist/util/portal.js +50 -0
- package/dist/util/progress.d.ts +18 -0
- package/dist/util/progress.js +17 -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-edge.d.ts +32 -0
- package/dist/util/scroll-edge.js +87 -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 +83 -0
- package/dist/util/sheet-drag.js +311 -0
- package/dist/util/sidebar.d.ts +62 -0
- package/dist/util/sidebar.js +38 -0
- package/dist/util/skeleton.d.ts +14 -0
- package/dist/util/skeleton.js +22 -0
- package/dist/util/sliding-indicator.d.ts +24 -0
- package/dist/util/sliding-indicator.js +44 -0
- package/dist/util/sortable-list.d.ts +64 -0
- package/dist/util/sortable-list.js +53 -0
- 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/temporal-field.d.ts +88 -0
- package/dist/util/temporal-field.js +136 -0
- package/dist/util/theme-mode.d.ts +79 -0
- package/dist/util/theme-mode.js +121 -0
- package/dist/util/toaster.d.ts +132 -0
- package/dist/util/toaster.js +130 -0
- package/dist/util/tone-surface.d.ts +33 -0
- package/dist/util/tone-surface.js +35 -0
- package/dist/util/tooltip.d.ts +9 -0
- package/dist/util/tooltip.js +18 -0
- package/dist/util/top-navbar.d.ts +34 -0
- package/dist/util/top-navbar.js +28 -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 +141 -0
- package/dist/util/zabi-strings.js +105 -0
- package/dist/zabi-components-colors.css +11 -2
- package/dist/zabi-components-theme-dark-only.css +870 -258
- package/dist/zabi-components-theme-dark.css +870 -258
- package/dist/zabi-components-theme-only.css +2419 -368
- package/dist/zabi-components-theme.css +2419 -368
- package/dist/zabi-components.css +6032 -711
- package/docs/lucide-icons.md +40 -17
- package/docs/theme-imports.md +81 -11
- package/package.json +45 -8
package/README.md
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
# Zabi Components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/zabi-components)
|
|
4
|
+
[](./LICENSE)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
A Svelte 5 UI component library with TypeScript types, Tailwind CSS v4 design tokens, light and dark themes, and server-side rendering support.
|
|
7
|
+
|
|
8
|
+
Live examples and docs: **[zabi-components.vercel.app](https://zabi-components.vercel.app/)**
|
|
9
|
+
|
|
10
|
+
Requires **Svelte ≥ 5.43.8**. Components are written with runes and take DOM-style props (`onclick` / `oninput`, …).
|
|
6
11
|
|
|
7
12
|
---
|
|
8
13
|
|
|
@@ -16,6 +21,14 @@ npm install zabi-components
|
|
|
16
21
|
|
|
17
22
|
Ensure `svelte@^5.43.8` is installed — SvelteKit apps usually already match; add `@sveltejs/kit@^2` only for Kit. The package is Svelte-only (the unmaintained `zabi-components/react` export was removed in 8.0.0).
|
|
18
23
|
|
|
24
|
+
**Icons.** The library uses [`@lucide/svelte`](https://lucide.dev) for its own icons and re-exports only the dozen it needs. For your own tab, navigation and action icons, install it in your app at the range the library depends on, so both use one copy:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install @lucide/svelte@"^0.544.0"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Import each icon from its own file, `import House from "@lucide/svelte/icons/house"`, not from the package's barrel, which makes a bundler compile every icon. See [docs/lucide-icons.md](./docs/lucide-icons.md).
|
|
31
|
+
|
|
19
32
|
**2. Global CSS** (e.g. SvelteKit `src/app.css` — adjust for your bundler entry)
|
|
20
33
|
|
|
21
34
|
```css
|
|
@@ -24,7 +37,9 @@ Ensure `svelte@^5.43.8` is installed — SvelteKit apps usually already match; a
|
|
|
24
37
|
@import "zabi-components/theme-dark-only";
|
|
25
38
|
```
|
|
26
39
|
|
|
27
|
-
No Tailwind? See [docs/theme-imports.md](./docs/theme-imports.md)
|
|
40
|
+
No Tailwind? Import the compiled stylesheet instead: `@import "zabi-components/css";`. See [docs/theme-imports.md](./docs/theme-imports.md).
|
|
41
|
+
|
|
42
|
+
> **On 8.0.0 or earlier?** The theme files in those versions leave components unstyled. Upgrade to the latest release, or import `zabi-components/css`.
|
|
28
43
|
|
|
29
44
|
**3. Use a component** (`+page.svelte` or any Svelte 5 component)
|
|
30
45
|
|
|
@@ -41,7 +56,24 @@ No Tailwind? See [docs/theme-imports.md](./docs/theme-imports.md) (`colors` or f
|
|
|
41
56
|
</div>
|
|
42
57
|
```
|
|
43
58
|
|
|
44
|
-
Without the theme CSS,
|
|
59
|
+
Without the theme CSS, components render unstyled — always import it.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## What is included
|
|
64
|
+
|
|
65
|
+
- **Components in three layers.** Atoms (buttons, inputs, date and time fields, checkboxes, sliders, ratings, badges, tooltips), molecules (form fields, segmented controls, calendars, dropdowns, tabs, modals, drawers, bottom sheets, confirm dialogs, collapsible sections, sortable lists, alerts, toasts) and organisms (a top navigation bar, a sidebar and an app shell).
|
|
66
|
+
- **Made for phones too.** `AppShell`, `AppBar` and `BottomTabBar` lay out an app screen; `BottomSheet`, `StickyActionBar` and `FloatingActionButton` put actions within reach of a thumb; `SegmentedControl`, `Rating`, `DateField`, `TimeField` and `Calendar` are sized for touch. On a touch screen controls grow to 44px targets, and the phone components keep clear of the notch and the home indicator. Each one has a page with a live example and its props at [zabi-components.vercel.app/components](https://zabi-components.vercel.app/components).
|
|
67
|
+
- **Svelte 5 only.** Runes, snippets and DOM-style event props. There is no Svelte 4 or React build.
|
|
68
|
+
- **TypeScript.** Props are typed, and the shared unions are exported from `zabi-components/types`.
|
|
69
|
+
- **Theming by tokens.** Colours, surfaces, radius and shadows are Tailwind CSS v4 design tokens, so a rebrand is one generated file of token overrides rather than a change to each component: `npx zabi-theme --brand "#C17B00" --out src/lib/brand.generated.css`. The [theming guide](./THEMING.md) lists the tokens an app may set; the same guide is on the docs site at [/theming](https://zabi-components.vercel.app/theming), with a brand switcher.
|
|
70
|
+
- **Light and dark themes.** Every colour token has a dark value; put `data-theme="dark"` or the `dark` class on the `html` element to switch, or `data-theme="auto"` to follow the system.
|
|
71
|
+
- **Server-side rendering.** Components render on the server in SvelteKit, and browser-only APIs are guarded.
|
|
72
|
+
- **Accessibility work already done.** Labels, hints and errors are connected to their control. RadioGroup and Dropdown handle the arrow keys. Modal, Drawer and SlideUp keep focus inside while open and return it to the trigger. Focus rings are visible by default, in forced-colours mode too.
|
|
73
|
+
- **Your classes win.** `class` is merged last through tailwind-merge, so a utility you pass replaces the component's own.
|
|
74
|
+
- **MIT licensed.**
|
|
75
|
+
|
|
76
|
+
The rest of this file is reference: import paths, the two component styles, tokens, constraints and common pitfalls.
|
|
45
77
|
|
|
46
78
|
---
|
|
47
79
|
|
|
@@ -53,6 +85,7 @@ Without the theme CSS, token classes (`bg-input`, `text-body`, …) look unstyle
|
|
|
53
85
|
| **Category** `zabi-components/atoms`, `/molecules`, `/organisms` | Larger bundles where you want imports to mirror structure, or you only pull one layer in a given file. |
|
|
54
86
|
| **Types** `zabi-components/types` | Shared prop unions / enums in your app code. |
|
|
55
87
|
| **Helpers** `zabi-components`, `zabi-components/lib/ssr-safe`, `lib/variant-utils` | Utilities the package publishes — not app internals. |
|
|
88
|
+
| **Dates** `import { formatDate, formatTime } from "zabi-components"` | The value of a DateField or TimeField (`2026-10-06`, `19:00`) as text in a named language: `formatDate("2026-10-06", "sv")` is "6 okt. 2026". Never shifted by a time zone. |
|
|
56
89
|
|
|
57
90
|
Stick to **documented package subpaths** from `package.json` `exports`. Do not reach into `node_modules/zabi-components/dist/...` by hand.
|
|
58
91
|
|
|
@@ -133,10 +166,11 @@ Components use **DOM-style props** (`onclick`, `oninput`), not legacy `on:click`
|
|
|
133
166
|
```svelte
|
|
134
167
|
<script lang="ts">
|
|
135
168
|
import { List } from "zabi-components"; // or …/atoms
|
|
136
|
-
|
|
169
|
+
// One file per icon: the `@lucide/svelte` barrel makes a bundler compile every icon.
|
|
170
|
+
import House from "@lucide/svelte/icons/house";
|
|
137
171
|
|
|
138
172
|
const items = [
|
|
139
|
-
{ id: "1", label: "Home", icon:
|
|
173
|
+
{ id: "1", label: "Home", icon: House },
|
|
140
174
|
{ id: "2", label: "Settings", href: "/settings" },
|
|
141
175
|
];
|
|
142
176
|
</script>
|
|
@@ -183,6 +217,7 @@ Components use **DOM-style props** (`onclick`, `oninput`), not legacy `on:click`
|
|
|
183
217
|
| Token / class | Role |
|
|
184
218
|
|---------------|------|
|
|
185
219
|
| `bg-surface-base` · `raised` · `elevated` · `overlay` | The four surface levels. Anything floating above content uses `overlay`. In dark mode each level is the one below it with more light on it — shadows don't read on a dark page. |
|
|
220
|
+
| `bg-surface-inset` | A recessed area on a card: a well, a stat strip, a code sample. Darker than the card in both themes. |
|
|
186
221
|
| `surface-1` / `surface-2` | Compatibility aliases for `raised` / `elevated`. Prefer the named levels in new code. |
|
|
187
222
|
| `shadow-sm` / `shadow-lg` | Elevation is **two steps**: raised, and floating. `shadow-none` is the explicit absence of one. `shadow-md`, `shadow-xl` and a bare `shadow` fail the build. |
|
|
188
223
|
| `rounded-control` · `container` · `overlay` · `pill` | Radius is chosen by **role**, never by size. A large button is a bigger box with the same corner as a small one. |
|
|
@@ -215,7 +250,7 @@ import Button from "some-path/node_modules/zabi-components/dist/atoms/Button.sve
|
|
|
215
250
|
|
|
216
251
|
**Consumers — styling**
|
|
217
252
|
|
|
218
|
-
Load theme CSS (Quick start). Unstyled components usually mean missing `@import "zabi-components/theme-only"` (and dark overrides if you use `.dark`).
|
|
253
|
+
Load theme CSS (Quick start). Unstyled components usually mean a missing `@import "zabi-components/theme-only"` (and dark overrides if you use `.dark`), or version 8.0.0 or earlier.
|
|
219
254
|
|
|
220
255
|
`class` is the public prop on every component and is merged **last**, through
|
|
221
256
|
[tailwind-merge](https://github.com/dcastil/tailwind-merge), so your utility
|
|
@@ -236,7 +271,7 @@ import { analytics } from "../../routes/lib/analytics";
|
|
|
236
271
|
// ✅ Shared helpers live next to components
|
|
237
272
|
import { generateId } from "../util/ssr-safe.js";
|
|
238
273
|
|
|
239
|
-
// ❌ Packaging: escaping `dist/` layout (
|
|
274
|
+
// ❌ Packaging: escaping `dist/` layout (`npm run check` fails)
|
|
240
275
|
import type { Foo } from "../../types/variants";
|
|
241
276
|
|
|
242
277
|
// ✅ Depth matches publish layout
|
|
@@ -245,6 +280,200 @@ import type { Foo } from "../types/variants.js";
|
|
|
245
280
|
|
|
246
281
|
---
|
|
247
282
|
|
|
283
|
+
## Phones: safe areas
|
|
284
|
+
|
|
285
|
+
Components that touch the edge of a phone screen keep clear of the notch and
|
|
286
|
+
the home indicator by reading `env(safe-area-inset-*)`: `AppShell`, `AppBar`,
|
|
287
|
+
`BottomTabBar`, `BottomSheet`, `StickyActionBar`, `FloatingActionButton`,
|
|
288
|
+
`Toaster`, a `Modal` with `fullScreen`, and `Page`. A browser reports those
|
|
289
|
+
insets as zero until the page asks to be drawn under them, so add
|
|
290
|
+
`viewport-fit=cover` to the viewport meta tag of the app:
|
|
291
|
+
|
|
292
|
+
```html
|
|
293
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
`Page` pads its left, right and bottom by the insets; inside an `AppShell` it
|
|
297
|
+
adds nothing, because the shell has already done it, and `safeArea={false}`
|
|
298
|
+
turns it off where your own layout does. `Toaster` sits above an `AppShell`'s
|
|
299
|
+
tab bar by itself; for a bar of your own that is fixed to the bottom, give it
|
|
300
|
+
that bar's height through its bottom-offset custom property (see the Toaster
|
|
301
|
+
page of the docs). Full heights use `dvh`, so the browser's own bars do not
|
|
302
|
+
cut content off.
|
|
303
|
+
|
|
304
|
+
A `Tooltip` opens on a tap as well as on hover and focus, and stays until it is
|
|
305
|
+
dismissed. Do not put information the user needs in one.
|
|
306
|
+
|
|
307
|
+
## Texts and other languages
|
|
308
|
+
|
|
309
|
+
Every word a component says by itself, shown or only read out, can be
|
|
310
|
+
replaced. The defaults are English.
|
|
311
|
+
|
|
312
|
+
### Once, for the whole app
|
|
313
|
+
|
|
314
|
+
Put a `ZabiStringsProvider` around the app with its words, and every component
|
|
315
|
+
inside says those instead of English, without a prop on any of them:
|
|
316
|
+
|
|
317
|
+
```svelte
|
|
318
|
+
<!-- src/routes/+layout.svelte -->
|
|
319
|
+
<script lang="ts">
|
|
320
|
+
import { ZabiStringsProvider, type ZabiStrings } from "zabi-components";
|
|
321
|
+
|
|
322
|
+
let { children } = $props();
|
|
323
|
+
|
|
324
|
+
const sv: ZabiStrings = {
|
|
325
|
+
// Words that many components' single-text props default to.
|
|
326
|
+
common: {
|
|
327
|
+
close: "Stäng",
|
|
328
|
+
back: "Tillbaka",
|
|
329
|
+
expand: "Visa mer",
|
|
330
|
+
collapse: "Visa mindre",
|
|
331
|
+
required: "(obligatoriskt)",
|
|
332
|
+
showPassword: "Visa lösenordet",
|
|
333
|
+
search: "Sök…",
|
|
334
|
+
confirm: "Bekräfta",
|
|
335
|
+
cancel: "Avbryt",
|
|
336
|
+
},
|
|
337
|
+
// One entry per component that has a `strings` object: the same keys.
|
|
338
|
+
select: {
|
|
339
|
+
placeholder: "Välj ett alternativ",
|
|
340
|
+
searchPlaceholder: "Sök",
|
|
341
|
+
noResults: "Inga träffar",
|
|
342
|
+
loading: "Hämtar alternativ…",
|
|
343
|
+
emptyTitle: "Inga alternativ",
|
|
344
|
+
emptyDescription: "Lägg till ett alternativ för att kunna välja.",
|
|
345
|
+
listLabel: "Alternativ",
|
|
346
|
+
},
|
|
347
|
+
stepper: {
|
|
348
|
+
position: (step, total) => `Steg ${step} av ${total}`,
|
|
349
|
+
stepLabel: (step, total, label, state) =>
|
|
350
|
+
`Steg ${step} av ${total}: ${label}, ${{ completed: "klart", current: "pågår", upcoming: "kommer" }[state]}`,
|
|
351
|
+
announcement: (step, total, label) => `Steg ${step} av ${total}: ${label}`,
|
|
352
|
+
},
|
|
353
|
+
calendar: {
|
|
354
|
+
previousMonth: "Föregående månad",
|
|
355
|
+
nextMonth: "Nästa månad",
|
|
356
|
+
today: "i dag",
|
|
357
|
+
selected: "vald",
|
|
358
|
+
unavailable: "inte valbar",
|
|
359
|
+
},
|
|
360
|
+
};
|
|
361
|
+
</script>
|
|
362
|
+
|
|
363
|
+
<ZabiStringsProvider strings={sv}>
|
|
364
|
+
{@render children()}
|
|
365
|
+
<!-- Inside the provider: the toaster reads the words of the provider it is mounted under. -->
|
|
366
|
+
<Toaster />
|
|
367
|
+
</ZabiStringsProvider>
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
Mount the `Toaster` inside the provider. It is mounted once, at the root, and
|
|
371
|
+
a toaster placed beside the provider instead of in it says its own words in
|
|
372
|
+
English.
|
|
373
|
+
|
|
374
|
+
What a component says is decided in this order, the later winning:
|
|
375
|
+
|
|
376
|
+
1. its built-in English;
|
|
377
|
+
2. the provider's entry for it (`select`, `stepper`, …), or `common` for a
|
|
378
|
+
single-text prop such as `closeLabel`;
|
|
379
|
+
3. the `strings` object passed to that one component;
|
|
380
|
+
4. a single-text prop passed to it.
|
|
381
|
+
|
|
382
|
+
So a provider changes nothing for a component that already has its texts set,
|
|
383
|
+
and outside a provider everything is as it was. The entries are `alert`,
|
|
384
|
+
`avatarGroup`, `calendar`, `codeBlock`, `colorPicker`, `componentDemo`,
|
|
385
|
+
`contactForm`, `imageUpload`, `mediaGrid`, `photoGrid`, `photoViewer`,
|
|
386
|
+
`propsTable`, `pullToRefresh`, `rating`, `select`, `sidebarAccountPanel`,
|
|
387
|
+
`sidebarBrandHeader`, `sidebarFooter`, `sidebarNavigation`, `sortableList`,
|
|
388
|
+
`stepper`, `swipeableListItem`, `themeToggle`, `toast`, `toaster`, `topNavbar`
|
|
389
|
+
and `unsavedChangesBar`; the type is `ZabiStrings`, and `ZabiCommonStrings`
|
|
390
|
+
lists the common words. For Alert, CodeBlock, ImageUpload, Toast and
|
|
391
|
+
UnsavedChangesBar the entry's keys are the names of their text props
|
|
392
|
+
(`alert: { closeLabel }`, `codeBlock: { copyLabel, copiedLabel }`). Leave out what the app does not
|
|
393
|
+
use: there is nothing to translate for a component it never renders.
|
|
394
|
+
|
|
395
|
+
The provider is Svelte context. On a server it belongs to the request being
|
|
396
|
+
rendered, so two languages can be served at once; a provider inside another
|
|
397
|
+
replaces only the words it gives, for its part of the page; and a dialog or
|
|
398
|
+
sheet drawn in `<body>` still reads the provider it was written under. It adds
|
|
399
|
+
no element to the page. `getZabiStrings()` gives app code the same words: call
|
|
400
|
+
it while a component initialises and read `.current` where they are used.
|
|
401
|
+
|
|
402
|
+
The library ships no translations. The object is the app's.
|
|
403
|
+
|
|
404
|
+
What is not behind the provider is the names of landmarks and regions, which
|
|
405
|
+
say what a part of the app is and so are the app's to give: `ariaLabel` and
|
|
406
|
+
`label` props such as SidebarNavigation's "Sidebar navigation", a
|
|
407
|
+
PhotoViewer's, a Stepper's or a BottomTabBar's. Set those on the component.
|
|
408
|
+
|
|
409
|
+
### On one component
|
|
410
|
+
|
|
411
|
+
A component with one or two such texts has a prop for each; one with several
|
|
412
|
+
takes a `strings` object, and whatever you leave out of it keeps its default.
|
|
413
|
+
A `strings` key and an older prop for the same text: the prop wins.
|
|
414
|
+
|
|
415
|
+
| Component | Prop that carries its texts |
|
|
416
|
+
|-----------|-----------------------------|
|
|
417
|
+
| Alert | `closeLabel` |
|
|
418
|
+
| AppBar | `backLabel` |
|
|
419
|
+
| BottomSheet | `closeLabel`, `expandLabel`, `collapseLabel` |
|
|
420
|
+
| BottomTabBar | `label`, `badgeLabel` |
|
|
421
|
+
| Calendar | `strings` |
|
|
422
|
+
| CodeBlock | `copyLabel`, `copiedLabel` |
|
|
423
|
+
| ColorPicker | `strings` |
|
|
424
|
+
| ComponentDemo | `strings` |
|
|
425
|
+
| ConfirmDialog | `confirmLabel`, `cancelLabel`, `loadingLabel` |
|
|
426
|
+
| ContactForm | `strings` (the whole form is ready-made English: pass them all, or build your own from Form and FormField) |
|
|
427
|
+
| Drawer, Modal, SlideUp | `closeLabel` |
|
|
428
|
+
| Dropdown | `ariaLabel`; in a sheet also `sheetTitle`, `sheetCloseLabel`, `sheetExpandLabel`, `sheetCollapseLabel` |
|
|
429
|
+
| FormField | `requiredLabel` |
|
|
430
|
+
| ImageUpload | `placeholder`, `browseText`, `changeText`, `removeText`, `selectedText`, `removedText`, `errorTitle` |
|
|
431
|
+
| List | `ariaLabel` |
|
|
432
|
+
| AvatarGroup, PullToRefresh, SwipeableListItem | `strings` (and `label` on AvatarGroup) |
|
|
433
|
+
| MediaGrid, PhotoGrid, PhotoViewer, SortableList, Stepper, Rating | `strings` (and `label` on PhotoViewer and Stepper) |
|
|
434
|
+
| NavigationMenu | `ariaLabel` |
|
|
435
|
+
| PropsTable | `caption`, `strings` |
|
|
436
|
+
| Select | `strings` (every text, the name of the option list included); the older `placeholder`, `searchPlaceholder`, `noResultsText`, `loadingText`, `emptyStateTitle`, `emptyStateDescription` still work and win over it |
|
|
437
|
+
| SidebarAccountPanel | `strings`, `logoutLabel` |
|
|
438
|
+
| SidebarBrandHeader | `logoAlt`, `strings` |
|
|
439
|
+
| SidebarFooter | `strings` |
|
|
440
|
+
| SidebarNavigation | `strings` (its own, the footer's and the brand header's), `ariaLabel`, `searchPlaceholder`, `logoutLabel`, `emptyStateTitle`, `emptyStateDescription`, `emptyStateActionLabel` |
|
|
441
|
+
| SidebarPanel | `ariaLabel`, `title`, `subtitle`, `searchPlaceholder`, `emptyStateTitle`, `emptyStateDescription`, `selectLabel`, `closeLabel` |
|
|
442
|
+
| SidebarShell | `ariaLabel` |
|
|
443
|
+
| Skeleton | `aria-label` |
|
|
444
|
+
| ThemeToggle | `labels` |
|
|
445
|
+
| Toast | `closeLabel` |
|
|
446
|
+
| Toaster | `strings`, `aria-label` |
|
|
447
|
+
| Toggle | `label`, or `aria-label` / `aria-labelledby` (without any of them it is called "Toggle") |
|
|
448
|
+
| TopNavbar | `strings` (`openMenu`, `closeMenu`, `menuTitle`, `themeHeading`, `opensInNewTab`), `ariaLabel`, `themeLabels` |
|
|
449
|
+
| UnsavedChangesBar | `message`, `label`, `saveLabel`, `discardLabel` |
|
|
450
|
+
|
|
451
|
+
The name of the list in a SidebarShell is its `label` prop. One text is the
|
|
452
|
+
browser's, not the library's: when a `required` Select is sent empty, the
|
|
453
|
+
message under it is the browser's own validation message, in the browser's
|
|
454
|
+
language; pass `error` to say it yourself.
|
|
455
|
+
|
|
456
|
+
A toast shows what it was pushed with, so its text is yours already. The
|
|
457
|
+
toaster's own words are the names of its buttons and of its region, and the
|
|
458
|
+
sentence about the time a toast has left:
|
|
459
|
+
|
|
460
|
+
```svelte
|
|
461
|
+
<Toaster
|
|
462
|
+
strings={{
|
|
463
|
+
regionLabel: "Aviseringar",
|
|
464
|
+
dismiss: "Stäng aviseringen",
|
|
465
|
+
expand: "Visa mer",
|
|
466
|
+
collapse: "Visa mindre",
|
|
467
|
+
okay: "Okej",
|
|
468
|
+
closesIn: (seconds) => `Stängs om ${seconds} sekunder.`,
|
|
469
|
+
pausedClosesIn: (seconds) => `Pausad. Stängs om ${seconds} sekunder.`,
|
|
470
|
+
actionAvailable: (label) => `${label} finns.`,
|
|
471
|
+
}}
|
|
472
|
+
/>
|
|
473
|
+
|
|
474
|
+
pushToast({ message: "Utkastet är sparat.", type: "success" });
|
|
475
|
+
```
|
|
476
|
+
|
|
248
477
|
## Common pitfalls
|
|
249
478
|
|
|
250
479
|
| Issue | What goes wrong | Fix |
|
|
@@ -274,13 +503,17 @@ import type { Foo } from "../types/variants.js";
|
|
|
274
503
|
| Unit / component | `npm run test` | Vitest + Testing Library — logic and regressions |
|
|
275
504
|
| Interaction | `npm run test:e2e` | Playwright — overlays, focus, keyboard flows |
|
|
276
505
|
| Types & structure | `npm run check` | `svelte-check`, import-path and layout-width rules, plus `check:design` |
|
|
277
|
-
| Design system | `npm run check:design` | Ramp lightness, WCAG AA on every rendered pair, interaction fills that
|
|
506
|
+
| Design system | `npm run check:design` | Ramp lightness, WCAG AA on every rendered pair, the focus ring at 3:1, interaction fills and hover tints that read on their surface, control geometry, token violations (raw palette classes, off-scale shadows, half-step spacing), and state variants that cannot win |
|
|
507
|
+
| Theme output | `npm run test:themes` | Built CSS is reproducible and matches the frozen hashes |
|
|
508
|
+
|
|
509
|
+
There is no CI: every gate runs locally, and releases are published by hand. See
|
|
510
|
+
[RELEASING.md](https://github.com/sabnor/zabi-components/blob/main/RELEASING.md) in the repository for the order to run them in.
|
|
278
511
|
|
|
279
512
|
---
|
|
280
513
|
|
|
281
514
|
## More documentation
|
|
282
515
|
|
|
283
|
-
[THEME.md](./THEME.md) · [THEMING.md](./THEMING.md) · [docs/theme-imports.md](./docs/theme-imports.md) · [CHANGELOG.md](./CHANGELOG.md)
|
|
516
|
+
[THEME.md](./THEME.md) · [THEMING.md](./THEMING.md) · [docs/theme-imports.md](./docs/theme-imports.md) · [docs/lucide-icons.md](./docs/lucide-icons.md) · [CHANGELOG.md](./CHANGELOG.md) · [RELEASING.md](https://github.com/sabnor/zabi-components/blob/main/RELEASING.md) (in the repository; it is not part of the package)
|
|
284
517
|
|
|
285
518
|
## License
|
|
286
519
|
|