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/THEME.md
CHANGED
|
@@ -1,370 +1,252 @@
|
|
|
1
1
|
# Zabi Components Theme Guide
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
How to load the Zabi Components theme in an app that uses Tailwind CSS v4, and
|
|
4
|
+
how to use its tokens in your own CSS.
|
|
5
|
+
|
|
6
|
+
To give the library your own brand, read [THEMING.md](./THEMING.md). It lists
|
|
7
|
+
the tokens an app may set and documents the `zabi-theme` generator. This file
|
|
8
|
+
does not repeat it.
|
|
4
9
|
|
|
5
10
|
## Table of Contents
|
|
6
11
|
|
|
7
12
|
- [Quick Start](#quick-start)
|
|
8
13
|
- [Theme Files](#theme-files)
|
|
9
|
-
- [Import Options](#import-options)
|
|
10
|
-
- [Theme Extension](#theme-extension)
|
|
11
14
|
- [Dark Mode](#dark-mode)
|
|
12
|
-
- [
|
|
13
|
-
- [
|
|
15
|
+
- [Using the Tokens](#using-the-tokens)
|
|
16
|
+
- [Your Brand](#your-brand)
|
|
17
|
+
- [Adding Your Own Tokens](#adding-your-own-tokens)
|
|
14
18
|
- [Common Pitfalls](#common-pitfalls)
|
|
19
|
+
- [Troubleshooting](#troubleshooting)
|
|
15
20
|
|
|
16
21
|
## Quick Start
|
|
17
22
|
|
|
18
|
-
###
|
|
19
|
-
|
|
20
|
-
If you don't have Tailwind CSS set up yet:
|
|
23
|
+
### With Tailwind in the app
|
|
21
24
|
|
|
22
25
|
```css
|
|
23
26
|
/* app.css */
|
|
24
|
-
@import
|
|
25
|
-
@import
|
|
27
|
+
@import "tailwindcss";
|
|
28
|
+
@import "zabi-components/theme-only";
|
|
29
|
+
@import "zabi-components/theme-dark-only";
|
|
26
30
|
```
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
That is everything. The theme file tells Tailwind to scan the package's
|
|
33
|
+
components, so the classes they use are generated by your build; there is no
|
|
34
|
+
second stylesheet to import.
|
|
29
35
|
|
|
30
|
-
|
|
36
|
+
### Without Tailwind in the app
|
|
31
37
|
|
|
32
38
|
```css
|
|
33
39
|
/* app.css */
|
|
34
|
-
@import "
|
|
35
|
-
@import 'zabi-components/theme-only';
|
|
36
|
-
@import 'zabi-components/dist/zabi-components.css';
|
|
40
|
+
@import "zabi-components/css";
|
|
37
41
|
```
|
|
38
42
|
|
|
39
|
-
|
|
43
|
+
The compiled stylesheet holds the utilities the components use, in light and
|
|
44
|
+
dark.
|
|
45
|
+
|
|
46
|
+
### Standalone theme files
|
|
47
|
+
|
|
48
|
+
`zabi-components/theme` and `zabi-components/theme-dark` are the same two theme
|
|
49
|
+
files with `@import "tailwindcss"` at the top, for a stylesheet that does not
|
|
50
|
+
import Tailwind itself. They still go through Tailwind's build.
|
|
40
51
|
|
|
41
52
|
```css
|
|
42
53
|
/* app.css */
|
|
43
|
-
@import "
|
|
44
|
-
@import
|
|
45
|
-
@import 'zabi-components/theme-dark-only';
|
|
46
|
-
@import 'zabi-components/dist/zabi-components.css';
|
|
54
|
+
@import "zabi-components/theme";
|
|
55
|
+
@import "zabi-components/theme-dark";
|
|
47
56
|
```
|
|
48
57
|
|
|
49
58
|
## Theme Files
|
|
50
59
|
|
|
51
|
-
Zabi Components provides multiple theme file variants:
|
|
52
|
-
|
|
53
60
|
| File | Description | Use Case |
|
|
54
61
|
|------|-------------|----------|
|
|
55
|
-
| `zabi-components/theme` |
|
|
56
|
-
| `zabi-components/theme-only` |
|
|
57
|
-
| `zabi-components/theme
|
|
58
|
-
| `zabi-components/theme-dark-only`
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
You can also import using direct paths:
|
|
63
|
-
|
|
64
|
-
```css
|
|
65
|
-
@import 'zabi-components/dist/zabi-components-theme.css';
|
|
66
|
-
@import 'zabi-components/dist/zabi-components-theme-only.css';
|
|
67
|
-
@import 'zabi-components/dist/zabi-components-theme-dark.css';
|
|
68
|
-
@import 'zabi-components/dist/zabi-components-theme-dark-only.css';
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Import Options
|
|
72
|
-
|
|
73
|
-
### Option 1: Standalone (No Existing Tailwind)
|
|
74
|
-
|
|
75
|
-
Best for new projects or projects without Tailwind:
|
|
76
|
-
|
|
77
|
-
```css
|
|
78
|
-
@import 'zabi-components/theme';
|
|
79
|
-
@import 'zabi-components/theme-dark'; /* Optional: for dark mode */
|
|
80
|
-
@import 'zabi-components/dist/zabi-components.css';
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
**Pros:**
|
|
84
|
-
- Simple setup
|
|
85
|
-
- No Tailwind configuration needed
|
|
86
|
-
- Everything included
|
|
87
|
-
|
|
88
|
-
**Cons:**
|
|
89
|
-
- Less control over Tailwind configuration
|
|
90
|
-
- Slightly larger bundle if you need custom Tailwind config
|
|
91
|
-
|
|
92
|
-
### Option 2: With Existing Tailwind
|
|
93
|
-
|
|
94
|
-
Best for projects already using Tailwind CSS:
|
|
95
|
-
|
|
96
|
-
```css
|
|
97
|
-
@import "tailwindcss";
|
|
98
|
-
@import 'zabi-components/theme-only';
|
|
99
|
-
@import 'zabi-components/theme-dark-only'; /* Optional: for dark mode */
|
|
100
|
-
@import 'zabi-components/dist/zabi-components.css';
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
**Pros:**
|
|
104
|
-
- Full control over Tailwind configuration
|
|
105
|
-
- Can customize Tailwind before importing theme
|
|
106
|
-
- Smaller bundle (no duplicate Tailwind import)
|
|
62
|
+
| `zabi-components/theme-only` | Every token, light values. No Tailwind import. | Apps that import Tailwind themselves |
|
|
63
|
+
| `zabi-components/theme-dark-only` | Dark role remaps. No Tailwind import. Needs the light theme. | The same apps, for dark mode |
|
|
64
|
+
| `zabi-components/theme` | `theme-only` with `@import "tailwindcss"` | A stylesheet without its own Tailwind import |
|
|
65
|
+
| `zabi-components/theme-dark` | `theme-dark-only` with `@import "tailwindcss"`. Needs the light theme. | The same, for dark mode |
|
|
66
|
+
| `zabi-components/css` | The compiled stylesheet | Apps without Tailwind |
|
|
67
|
+
| `zabi-components/colors` | The tokens as plain custom properties, light and dark | Apps that want only the variables |
|
|
107
68
|
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
- Must import Tailwind first
|
|
111
|
-
|
|
112
|
-
## Theme Extension
|
|
113
|
-
|
|
114
|
-
You can extend the Zabi theme with your own customizations using additional `@theme` blocks:
|
|
115
|
-
|
|
116
|
-
```css
|
|
117
|
-
@import "tailwindcss";
|
|
118
|
-
@import 'zabi-components/theme-only';
|
|
119
|
-
|
|
120
|
-
/* Your custom theme extensions */
|
|
121
|
-
@theme {
|
|
122
|
-
/* Custom font families */
|
|
123
|
-
--font-family-title: 'Your Font', sans-serif;
|
|
124
|
-
--font-family-body: 'Another Font', sans-serif;
|
|
125
|
-
|
|
126
|
-
/* Custom colors */
|
|
127
|
-
--color-custom-primary: #ff0000;
|
|
128
|
-
--color-custom-secondary: #00ff00;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
@import 'zabi-components/dist/zabi-components.css';
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### Important: Import Order
|
|
135
|
-
|
|
136
|
-
The import order is critical:
|
|
137
|
-
|
|
138
|
-
1. **First:** `@import "tailwindcss"` (if using theme-only)
|
|
139
|
-
2. **Second:** `@import 'zabi-components/theme-only'` (or theme)
|
|
140
|
-
3. **Third:** Your custom `@theme` block (extends zabi theme)
|
|
141
|
-
4. **Fourth:** `@import 'zabi-components/dist/zabi-components.css'` (uses the theme)
|
|
142
|
-
|
|
143
|
-
This order ensures:
|
|
144
|
-
- Tailwind is available for `theme()` function calls
|
|
145
|
-
- Zabi theme is defined first
|
|
146
|
-
- Your extensions override zabi defaults
|
|
147
|
-
- Components can use all theme values
|
|
69
|
+
The full matrix, the legacy `dist/` paths and what each file contains are in
|
|
70
|
+
[docs/theme-imports.md](./docs/theme-imports.md).
|
|
148
71
|
|
|
149
72
|
## Dark Mode
|
|
150
73
|
|
|
151
|
-
|
|
74
|
+
Import the dark theme file after the light one. It only remaps roles; the raw
|
|
75
|
+
palettes (`--zabi-brand-*`, `--zabi-accent-*`, `--zabi-base-*` and the other
|
|
76
|
+
ramps) are declared once, in the light theme, so the dark file does nothing on
|
|
77
|
+
its own.
|
|
152
78
|
|
|
153
|
-
|
|
79
|
+
Dark is switched on the `<html>` element, by an attribute or by a class:
|
|
154
80
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
The dark theme file uses `@media (prefers-color-scheme: dark)` to automatically switch based on system preference.
|
|
81
|
+
| On `<html>` | Result |
|
|
82
|
+
|---|---|
|
|
83
|
+
| nothing | light, also on a dark system |
|
|
84
|
+
| `data-theme="light"` | light |
|
|
85
|
+
| `data-theme="dark"` | dark |
|
|
86
|
+
| `data-theme="auto"` | follows the system (`prefers-color-scheme`) |
|
|
87
|
+
| `class="dark"` | dark, the same as `data-theme="dark"` |
|
|
163
88
|
|
|
164
|
-
|
|
89
|
+
Following the system is opt-in:
|
|
165
90
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
// Toggle dark mode
|
|
170
|
-
document.documentElement.classList.toggle('dark');
|
|
91
|
+
```html
|
|
92
|
+
<!-- Follow the phone's setting, with no script -->
|
|
93
|
+
<html data-theme="auto">
|
|
171
94
|
```
|
|
172
95
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
### Custom Dark Mode Colors
|
|
176
|
-
|
|
177
|
-
You can override dark mode colors in your custom theme:
|
|
178
|
-
|
|
179
|
-
```css
|
|
180
|
-
@import "tailwindcss";
|
|
181
|
-
@import 'zabi-components/theme-only';
|
|
182
|
-
@import 'zabi-components/theme-dark-only';
|
|
183
|
-
|
|
184
|
-
@theme {
|
|
185
|
-
/* Your light mode customizations */
|
|
186
|
-
--color-custom: #ff0000;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/* Custom dark mode overrides */
|
|
190
|
-
.dark {
|
|
191
|
-
--color-custom: #ff6666; /* Lighter red for dark mode */
|
|
192
|
-
}
|
|
96
|
+
To switch from a script:
|
|
193
97
|
|
|
194
|
-
|
|
98
|
+
```javascript
|
|
99
|
+
document.documentElement.dataset.theme = "dark"; // "light" | "auto"
|
|
100
|
+
// or
|
|
101
|
+
document.documentElement.classList.toggle("dark");
|
|
195
102
|
```
|
|
196
103
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
Zabi Components uses a semantic color system with the following color scales:
|
|
200
|
-
|
|
201
|
-
### Color Scales
|
|
202
|
-
|
|
203
|
-
- **Brand** - Primary brand colors (blue palette)
|
|
204
|
-
- **Citron** - Energetic/yellow colors
|
|
205
|
-
- **Pine** - Success/green colors
|
|
206
|
-
- **Iris** - Info/purple colors
|
|
104
|
+
The details (`color-scheme`, why the attribute goes on `<html>` only, what
|
|
105
|
+
`ThemeToggle` reads) are in [THEMING.md](./THEMING.md#light-dark-and-auto).
|
|
207
106
|
|
|
208
|
-
|
|
107
|
+
## Using the Tokens
|
|
209
108
|
|
|
210
|
-
|
|
109
|
+
Components paint with **roles**: tokens that say what a colour is for and are
|
|
110
|
+
already the right value in each mode. Use the same roles in your own CSS.
|
|
211
111
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
- `--color-
|
|
215
|
-
- `--color-
|
|
216
|
-
- `--color-body` -
|
|
217
|
-
- `--color-description` - Secondary/description text
|
|
218
|
-
- `--color-caption` - Captions and labels
|
|
112
|
+
- `--color-surface-base` / `-raised` / `-elevated` / `-overlay` - Surface levels: page, cards, nested cards, floating panels
|
|
113
|
+
- `--color-material-thin`, `-regular`, `-thick` (`material-thin|regular|thick` classes) - Frosted fills for what floats over content; see THEMING.md, Materials. `data-materials="opaque"` on the root or an ancestor turns them into opaque surfaces
|
|
114
|
+
- `--color-surface-chrome` - The fill of bars and sidebars; the page colour (flush). `--color-bar`, `--color-bar-border`, `--color-bar-brand`, `--color-tabbar-active` (`bg-bar-brand`, `bg-tabbar-active`, `border-bar` classes) - A bar's fill at rest, the hairline shown once content scrolls under it, the on-brand AppBar fill, the active tab pill. `material-bar` (with `data-scrolled-under`) paints a bar; `material-layer-regular` / `material-layer-thick` put a material on a layer. See THEMING.md, Materials
|
|
115
|
+
- `--color-surface-inset` - A recessed area on a card (a well); see THEMING.md, Surface elevation levels
|
|
116
|
+
- `--color-headline`, `--color-body`, `--color-description`, `--color-caption` - Text
|
|
219
117
|
- `--color-border` - Borders and dividers
|
|
220
|
-
- `--color-
|
|
221
|
-
- `--
|
|
222
|
-
- `--color-
|
|
223
|
-
- `--color-
|
|
224
|
-
- `--color-
|
|
225
|
-
- `--color-
|
|
226
|
-
- `--color-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
118
|
+
- `--color-action-primary`, `-hover`, `-active` - Primary actions. The brand step 600, 700 and 800 in light and in dark (the fill keeps its hue; the label is white in both). `createTheme({ darkPrimary: 'mirror' })` restores the 8.1 pale dark fills. Danger follows the same rule
|
|
119
|
+
- `--font-family-display` (`font-display`) - A second face for `Heading variant="display"`; follows `--font-family-heading` until set
|
|
120
|
+
- `--color-on-brand` - Text on a primary fill (`--color-action-primary-text` follows it)
|
|
121
|
+
- `--color-action-tonal`, `-hover`, `-active`, `-text` (`bg-action-tonal`, `text-action-tonal`) - A brand tint with a brand label, for a quieter action beside a primary or a chosen answer. Label held to 4.5:1 on all three fills
|
|
122
|
+
- `--color-chip`, `-hover`, `-active`, `-text` (`bg-chip`, `hover:bg-chip-hover`, `active:bg-chip-active`, `text-chip-text`) - A Chip at rest: a quiet neutral fill seen on the page and a card without an edge (1.2:1 or more), its label held to 4.5:1 on all three fills
|
|
123
|
+
- `--color-chip-selected`, `-hover`, `-active`, `-text` (`bg-chip-selected`, `bg-chip-selected-hover`, `bg-chip-selected-active`, `text-chip-selected-text`) - A selected Chip: the tonal role by default, as tokens of its own, so an app that themes tonal gets matching chips
|
|
124
|
+
- `--color-card-flat`, `-hover`, `-active` (`bg-card-flat`, `hover:bg-card-flat-hover`, `active:bg-card-flat-active`) - The fill of `Card variant="flat"`: the card in light (unchanged); in dark a translucent step of the neutral ramp (base-50 at 7%, hover 11%, pressed 15%), so flat cards nested in each other or in another card each read a step lighter. `overrides: { dark: { '--color-card-flat': 'var(--color-card)' } }` restores the opaque fill
|
|
125
|
+
- `--color-card-tint` (`bg-card-tint`) - The brand tint as a surface for content (Card `tone="tint"`): brand-100 in light, the brand at 8% over the card in dark. Text, link, ring, field edge and outline edge are held on it
|
|
126
|
+
- `--color-action-outline-border`, `-hover` (`border-action-outline`) - The edge of an outline button: the field edge, 3:1 on the page and the card
|
|
127
|
+
- `--color-toggle-track`, `-hover`, `-active`, `-track-border` (`bg-toggle-track`, `ring-toggle-track`) - The off switch: a light tint with an edge that holds 3:1 (`--color-control-track*` stays the Slider's)
|
|
128
|
+
- `--zabi-button-radius`, `--zabi-button-font-weight` (`rounded-button`, `font-button`) - Button corner and label weight, set on any ancestor; they default to `--radius-control` and 500
|
|
129
|
+
- `--color-accent`, `-hover`, `-active`, `-subtle`, `-border`, `-text` - The second brand colour
|
|
130
|
+
- `--color-on-accent` - Text on a solid accent fill
|
|
131
|
+
- `--color-link`, `--color-focus-ring` - Links and the focus ring
|
|
132
|
+
- `--color-focus-ring-muted` - The neutral ring of ghost and link controls (`.focus-ring--muted`)
|
|
133
|
+
- `--color-focus-ring-danger` - The ring of a destructive control (`.focus-ring--danger`); `--color-error` by default
|
|
134
|
+
- `--color-control-border` (`border-control-border`) - The edge of a control that has nothing else to be seen by, such as the outline of an empty Rating star. `--color-border-strong` is a decorative edge, and is only 3.08:1 on the dark elevated and overlay surfaces
|
|
135
|
+
- `--color-input`, `-hover`, `-focus`, `-active` (`bg-input`, `hover:bg-input-hover`, `focus-visible:bg-input-focus`, `active:bg-input-active`) - The field fill. Light: the white raised surface, unchanged. Dark: a translucent step of the neutral ramp (base-50 at 7%, hover 10%, focus 7%, pressed 15%), so a field is a well 1.20:1 to 1.23:1 lighter than the page, a card or the overlay it sits on (guarded at 1.15:1), and the 3:1 edge (`--color-input-border`) stays. `--color-input-solid`, `-hover`, `-focus`, `-active` are the opaque fills a field takes inside a colour block (`.on-brand`, `.on-accent`, `.on-fill`). `overrides: { dark: { '--color-input': 'var(--color-surface-inset)', '--color-input-hover': 'var(--color-base-200)', '--color-input-focus': 'var(--color-base-150)', '--color-input-active': 'color-mix(in srgb, var(--zabi-base-50) 10%, var(--color-surface-inset))', '--color-input-placeholder': 'var(--color-base-600)' } }` restores the 9.0.0-alpha.4 opaque field
|
|
136
|
+
- `--color-input-border` (`border-input-border`) - The edge of a form field (Input, Textarea, Select, DateField, TimeField). Held to 3:1 on the page and the card in both themes (WCAG 1.4.11), and on the field fill in light and over the page in dark (the lifted dark fill is 2.79:1 under it on a card and 2.50:1 on the overlay; the edge's other side, the surface, is 3.40 and 3.08); `--color-input-border-hover` is one step darker in light
|
|
137
|
+
- `--color-progress-track-border` (`border-progress-track-border`) - The edge of the Progress track: the field edge by default (3:1 on the page and the card); `transparent` for a track that reaches 3:1 itself (`createTheme` writes that when it overrides the track)
|
|
138
|
+
- `--color-progress-fill`, `--color-progress-track` (`bg-progress-fill`, `bg-progress-track`) - The fill and the track of Progress. The fill is `--color-action-primary` and the track `--color-input` (a darker well, `--color-base-75`, in dark), so the bar follows a pinned primary action. Held to 3:1 (fill on track) in both themes
|
|
139
|
+
- `--color-success`, `--color-warning`, `--color-error`, `--color-info` - States, each with `-subtle`, `-border` and `-text`. In dark the tint and edge are the hue thinned (16% / 36%) into the card surface, not a deep saturated step
|
|
140
|
+
|
|
141
|
+
The full list is in [THEMING.md](./THEMING.md#roles-read-them-do-not-set-them).
|
|
142
|
+
|
|
143
|
+
### In CSS
|
|
231
144
|
|
|
232
145
|
```css
|
|
233
146
|
.my-element {
|
|
234
|
-
background-color: var(--color-primary);
|
|
235
|
-
color: var(--color-
|
|
147
|
+
background-color: var(--color-action-primary);
|
|
148
|
+
color: var(--color-on-brand);
|
|
236
149
|
}
|
|
237
150
|
```
|
|
238
151
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
Zabi Components provides utility classes:
|
|
152
|
+
### In Tailwind classes
|
|
242
153
|
|
|
243
154
|
```html
|
|
244
|
-
<div class="bg-
|
|
245
|
-
|
|
155
|
+
<div class="bg-card text-headline border border-border">
|
|
156
|
+
A card surface with headline text
|
|
246
157
|
</div>
|
|
247
158
|
```
|
|
248
159
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
```css
|
|
252
|
-
.custom-class {
|
|
253
|
-
color: theme(colors.brand.600);
|
|
254
|
-
background: theme(colors.surface.elevated);
|
|
255
|
-
}
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
## Customization Examples
|
|
259
|
-
|
|
260
|
-
### Example 1: Custom Brand Colors
|
|
261
|
-
|
|
262
|
-
```css
|
|
263
|
-
@import "tailwindcss";
|
|
264
|
-
@import 'zabi-components/theme-only';
|
|
160
|
+
## Your Brand
|
|
265
161
|
|
|
162
|
+
Generate one file from your brand colour and import it after the theme. It
|
|
163
|
+
covers light and dark.
|
|
266
164
|
|
|
267
|
-
|
|
165
|
+
```bash
|
|
166
|
+
npx zabi-theme --brand "#C17B00" --neutral "#78716c" --out src/lib/brand.generated.css
|
|
268
167
|
```
|
|
269
168
|
|
|
270
|
-
### Example 2: Custom Fonts
|
|
271
|
-
|
|
272
169
|
```css
|
|
273
170
|
@import "tailwindcss";
|
|
274
|
-
@import
|
|
171
|
+
@import "zabi-components/theme-only";
|
|
172
|
+
@import "zabi-components/theme-dark-only";
|
|
173
|
+
@import "./lib/brand.generated.css";
|
|
275
174
|
|
|
276
|
-
|
|
277
|
-
--font-family-
|
|
278
|
-
--font-family-body: 'Inter', 'Helvetica', sans-serif;
|
|
279
|
-
--font-family-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
|
|
175
|
+
:root {
|
|
176
|
+
--font-family-heading: "Your Display Font", var(--font-family-sans);
|
|
280
177
|
}
|
|
281
|
-
|
|
282
|
-
@import 'zabi-components/dist/zabi-components.css';
|
|
283
178
|
```
|
|
284
179
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
```css
|
|
288
|
-
@import "tailwindcss";
|
|
289
|
-
@import 'zabi-components/theme-only';
|
|
290
|
-
|
|
291
|
-
@theme {
|
|
292
|
-
/* Custom primary color */
|
|
293
|
-
--color-primary: theme(colors.purple.600);
|
|
294
|
-
--color-primary-weak: theme(colors.purple.700);
|
|
295
|
-
--color-primary-medium: theme(colors.purple.800);
|
|
296
|
-
--color-primary-strong: theme(colors.purple.900);
|
|
297
|
-
}
|
|
180
|
+
Which tokens an app may set, what the generator checks and what does not
|
|
181
|
+
follow an override: [THEMING.md](./THEMING.md).
|
|
298
182
|
|
|
299
|
-
|
|
300
|
-
```
|
|
183
|
+
## Adding Your Own Tokens
|
|
301
184
|
|
|
302
|
-
|
|
185
|
+
A token of your own goes in a `@theme` block after the theme import. Tailwind
|
|
186
|
+
then generates utilities for it (`bg-quiz-gold` here), next to the library's.
|
|
303
187
|
|
|
304
188
|
```css
|
|
305
189
|
@import "tailwindcss";
|
|
306
|
-
@import
|
|
190
|
+
@import "zabi-components/theme-only";
|
|
307
191
|
|
|
308
|
-
/* Default theme */
|
|
309
192
|
@theme {
|
|
310
|
-
--color-
|
|
193
|
+
--color-quiz-gold: #d4a017;
|
|
311
194
|
}
|
|
312
|
-
|
|
313
|
-
/* Custom variant */
|
|
314
|
-
.variant-custom {
|
|
315
|
-
--color-primary: theme(colors.purple.600);
|
|
316
|
-
--color-secondary: theme(colors.pink.600);
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
@import 'zabi-components/dist/zabi-components.css';
|
|
320
195
|
```
|
|
321
196
|
|
|
197
|
+
Use a name the library does not use. The library's own tokens are set on
|
|
198
|
+
`:root`, as THEMING.md describes, not redeclared in `@theme`.
|
|
199
|
+
|
|
322
200
|
## Common Pitfalls
|
|
323
201
|
|
|
324
|
-
### Pitfall 1:
|
|
202
|
+
### Pitfall 1: Importing the compiled stylesheet as well
|
|
325
203
|
|
|
326
204
|
**Wrong:**
|
|
327
205
|
```css
|
|
328
|
-
@import
|
|
329
|
-
@import
|
|
206
|
+
@import "tailwindcss";
|
|
207
|
+
@import "zabi-components/theme-only";
|
|
208
|
+
@import "zabi-components/css"; /* a second, finished Tailwind build */
|
|
330
209
|
```
|
|
331
210
|
|
|
332
211
|
**Correct:**
|
|
333
212
|
```css
|
|
334
213
|
@import "tailwindcss";
|
|
335
|
-
@import
|
|
336
|
-
@import 'zabi-components/dist/zabi-components.css';
|
|
214
|
+
@import "zabi-components/theme-only";
|
|
337
215
|
```
|
|
338
216
|
|
|
217
|
+
Two Tailwind builds cannot be sorted into one order, so responsive variants
|
|
218
|
+
lose to plain utilities from the other build. See
|
|
219
|
+
[docs/theme-imports.md](./docs/theme-imports.md), "Tailwind together with the
|
|
220
|
+
compiled stylesheet".
|
|
221
|
+
|
|
339
222
|
### Pitfall 2: Double Tailwind Import
|
|
340
223
|
|
|
341
224
|
**Wrong:**
|
|
342
225
|
```css
|
|
343
226
|
@import "tailwindcss";
|
|
344
|
-
@import
|
|
227
|
+
@import "zabi-components/theme"; /* This also imports Tailwind! */
|
|
345
228
|
```
|
|
346
229
|
|
|
347
230
|
**Correct:**
|
|
348
231
|
```css
|
|
349
232
|
@import "tailwindcss";
|
|
350
|
-
@import
|
|
233
|
+
@import "zabi-components/theme-only"; /* Use theme-only */
|
|
351
234
|
```
|
|
352
235
|
|
|
353
|
-
### Pitfall 3:
|
|
236
|
+
### Pitfall 3: Overrides Before the Theme
|
|
354
237
|
|
|
355
238
|
**Wrong:**
|
|
356
239
|
```css
|
|
357
|
-
@import
|
|
358
|
-
@import
|
|
359
|
-
@theme
|
|
240
|
+
@import "./lib/brand.generated.css"; /* the dark theme below wins where both set a token */
|
|
241
|
+
@import "zabi-components/theme-only";
|
|
242
|
+
@import "zabi-components/theme-dark-only";
|
|
360
243
|
```
|
|
361
244
|
|
|
362
245
|
**Correct:**
|
|
363
246
|
```css
|
|
364
|
-
@import "
|
|
365
|
-
@import
|
|
366
|
-
@
|
|
367
|
-
@import 'zabi-components/dist/zabi-components.css';
|
|
247
|
+
@import "zabi-components/theme-only";
|
|
248
|
+
@import "zabi-components/theme-dark-only";
|
|
249
|
+
@import "./lib/brand.generated.css";
|
|
368
250
|
```
|
|
369
251
|
|
|
370
252
|
### Pitfall 4: Missing Dark Mode Import
|
|
@@ -373,101 +255,49 @@ If you want dark mode support, you must import the dark theme file:
|
|
|
373
255
|
|
|
374
256
|
```css
|
|
375
257
|
@import "tailwindcss";
|
|
376
|
-
@import
|
|
377
|
-
@import
|
|
378
|
-
@import 'zabi-components/dist/zabi-components.css';
|
|
258
|
+
@import "zabi-components/theme-only";
|
|
259
|
+
@import "zabi-components/theme-dark-only"; /* Don't forget this! */
|
|
379
260
|
```
|
|
380
261
|
|
|
381
|
-
### Pitfall 5:
|
|
262
|
+
### Pitfall 5: `theme()` for a Colour
|
|
382
263
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
--color-custom: theme(colors.brand.600); /* Works */
|
|
387
|
-
--color-other: theme(colors.custom.500); /* Fails - custom not defined yet */
|
|
388
|
-
}
|
|
389
|
-
```
|
|
264
|
+
Tailwind's `theme()` function is replaced at build time with the token's light
|
|
265
|
+
definition, so `theme(colors.brand.600)` is the light step in dark mode too.
|
|
266
|
+
Use the variable, which is resolved in the browser:
|
|
390
267
|
|
|
391
|
-
**Correct:**
|
|
392
268
|
```css
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
--color-custom-500: #ff0000;
|
|
397
|
-
--color-other: var(--color-custom-500); /* Use var() for custom colors */
|
|
269
|
+
.custom-class {
|
|
270
|
+
color: var(--color-brand-600);
|
|
271
|
+
background: var(--color-surface-elevated);
|
|
398
272
|
}
|
|
399
273
|
```
|
|
400
274
|
|
|
401
275
|
## Troubleshooting
|
|
402
276
|
|
|
403
|
-
###
|
|
277
|
+
### Components Look Unstyled
|
|
404
278
|
|
|
405
|
-
1. Check
|
|
406
|
-
2.
|
|
407
|
-
3.
|
|
408
|
-
4. Check browser console for CSS errors
|
|
279
|
+
1. Check that the theme is imported, after Tailwind
|
|
280
|
+
2. Check the package version: the theme files in 8.0.0 and earlier left components unstyled
|
|
281
|
+
3. Check the browser console for CSS errors
|
|
409
282
|
|
|
410
283
|
### Dark Mode Not Working
|
|
411
284
|
|
|
412
285
|
1. Ensure dark theme file is imported
|
|
413
|
-
2. Check that
|
|
414
|
-
3.
|
|
415
|
-
4. Check that dark
|
|
416
|
-
|
|
417
|
-
### Colors Not Updating
|
|
418
|
-
|
|
419
|
-
1. Clear browser cache
|
|
420
|
-
2. Restart dev server
|
|
421
|
-
3. Check for CSS specificity issues
|
|
422
|
-
4. Verify theme extension is after zabi theme import
|
|
423
|
-
|
|
424
|
-
## Advanced Usage
|
|
286
|
+
2. Check that `class="dark"` or `data-theme="dark"` is on `<html>`, not on an element inside it
|
|
287
|
+
3. To follow the system, set `data-theme="auto"`; nothing follows it by default
|
|
288
|
+
4. Check that the light theme is imported too: the dark file only remaps its tokens
|
|
425
289
|
|
|
426
|
-
###
|
|
290
|
+
### Brand Colours Not Updating
|
|
427
291
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
// Switch to light mode
|
|
433
|
-
document.documentElement.classList.remove('dark');
|
|
434
|
-
|
|
435
|
-
// Toggle
|
|
436
|
-
document.documentElement.classList.toggle('dark');
|
|
437
|
-
```
|
|
438
|
-
|
|
439
|
-
### Theme with Svelte
|
|
440
|
-
|
|
441
|
-
```svelte
|
|
442
|
-
<script>
|
|
443
|
-
import { onMount } from 'svelte';
|
|
444
|
-
|
|
445
|
-
let isDark = $state(false);
|
|
446
|
-
|
|
447
|
-
onMount(() => {
|
|
448
|
-
// Check system preference
|
|
449
|
-
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
450
|
-
isDark = prefersDark;
|
|
451
|
-
updateTheme();
|
|
452
|
-
});
|
|
453
|
-
|
|
454
|
-
function updateTheme() {
|
|
455
|
-
if (isDark) {
|
|
456
|
-
document.documentElement.classList.add('dark');
|
|
457
|
-
} else {
|
|
458
|
-
document.documentElement.classList.remove('dark');
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
</script>
|
|
462
|
-
|
|
463
|
-
<button on:click={() => { isDark = !isDark; updateTheme(); }}>
|
|
464
|
-
Toggle Theme
|
|
465
|
-
</button>
|
|
466
|
-
```
|
|
292
|
+
1. Check that the brand file is imported after both theme files
|
|
293
|
+
2. Check that the overrides are on `:root`, not on an element inside the page
|
|
294
|
+
3. Check that it sets `--zabi-brand-*`, not `--color-brand-*`
|
|
295
|
+
4. Restart the dev server
|
|
467
296
|
|
|
468
297
|
## Additional Resources
|
|
469
298
|
|
|
299
|
+
- [THEMING.md](./THEMING.md): the theming guide and token API
|
|
300
|
+
- [docs/theme-imports.md](./docs/theme-imports.md): every CSS export
|
|
470
301
|
- [Tailwind CSS v4 Documentation](https://tailwindcss.com/docs)
|
|
471
302
|
- [CSS Custom Properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties)
|
|
472
|
-
- [Zabi Components GitHub](https://github.com/
|
|
473
|
-
|
|
303
|
+
- [Zabi Components on GitHub](https://github.com/sabnor/zabi-components)
|