zabi-components 8.0.0 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1924 -0
- package/README.md +243 -10
- package/THEME.md +149 -332
- package/THEMING.md +1192 -266
- package/dist/atoms/ActionPanel.svelte +15 -5
- package/dist/atoms/Avatar.svelte +104 -0
- package/dist/atoms/Avatar.svelte.d.ts +34 -0
- package/dist/atoms/Badge.svelte +36 -7
- package/dist/atoms/Badge.svelte.d.ts +2 -2
- package/dist/atoms/Button.svelte +177 -27
- package/dist/atoms/Button.svelte.d.ts +30 -2
- package/dist/atoms/Card.svelte +4 -4
- package/dist/atoms/CardHeader.svelte +16 -4
- package/dist/atoms/Checkbox.svelte +48 -21
- package/dist/atoms/Checkbox.svelte.d.ts +4 -2
- package/dist/atoms/CodeBlock.svelte +20 -2
- package/dist/atoms/CodeBlock.svelte.d.ts +4 -0
- package/dist/atoms/ColorPicker.svelte +259 -49
- package/dist/atoms/ColorPicker.svelte.d.ts +3 -0
- package/dist/atoms/Container.svelte +16 -8
- package/dist/atoms/DateField.svelte +107 -0
- package/dist/atoms/DateField.svelte.d.ts +53 -0
- package/dist/atoms/FieldMessages.svelte +69 -0
- package/dist/atoms/FieldMessages.svelte.d.ts +23 -0
- package/dist/atoms/FloatingActionButton.svelte +174 -0
- package/dist/atoms/FloatingActionButton.svelte.d.ts +51 -0
- package/dist/atoms/Heading.svelte +37 -5
- package/dist/atoms/Heading.svelte.d.ts +7 -0
- package/dist/atoms/IconButton.svelte +220 -24
- package/dist/atoms/IconButton.svelte.d.ts +49 -4
- package/dist/atoms/Input.svelte +253 -52
- package/dist/atoms/Input.svelte.d.ts +32 -2
- package/dist/atoms/List.svelte +4 -1
- package/dist/atoms/ListItem.svelte +44 -11
- package/dist/atoms/ListItem.svelte.d.ts +5 -0
- package/dist/atoms/Progress.svelte +27 -8
- package/dist/atoms/Progress.svelte.d.ts +4 -0
- package/dist/atoms/Radio.svelte +19 -3
- package/dist/atoms/Radio.svelte.d.ts +4 -2
- package/dist/atoms/Rating.svelte +494 -0
- package/dist/atoms/Rating.svelte.d.ts +56 -0
- package/dist/atoms/Select.svelte +433 -91
- package/dist/atoms/Select.svelte.d.ts +49 -3
- package/dist/atoms/SelectionControl.svelte +94 -17
- package/dist/atoms/SelectionControl.svelte.d.ts +4 -3
- package/dist/atoms/Skeleton.svelte +1 -1
- package/dist/atoms/Slider.svelte +309 -0
- package/dist/atoms/Slider.svelte.d.ts +40 -0
- package/dist/atoms/Spinner.svelte +57 -0
- package/dist/atoms/Spinner.svelte.d.ts +19 -0
- package/dist/atoms/Table.svelte +151 -6
- package/dist/atoms/Table.svelte.d.ts +15 -3
- package/dist/atoms/TemporalField.svelte +140 -0
- package/dist/atoms/TemporalField.svelte.d.ts +32 -0
- package/dist/atoms/Text.svelte +23 -11
- package/dist/atoms/Text.svelte.d.ts +6 -3
- package/dist/atoms/Textarea.svelte +55 -44
- package/dist/atoms/Textarea.svelte.d.ts +14 -2
- package/dist/atoms/ThemeToggle.svelte +223 -44
- package/dist/atoms/ThemeToggle.svelte.d.ts +26 -3
- package/dist/atoms/TimeField.svelte +108 -0
- package/dist/atoms/TimeField.svelte.d.ts +54 -0
- package/dist/atoms/Toast.svelte +17 -4
- package/dist/atoms/Toast.svelte.d.ts +2 -0
- package/dist/atoms/Toggle.svelte +41 -8
- package/dist/atoms/Toggle.svelte.d.ts +11 -2
- package/dist/atoms/Tooltip.svelte +508 -23
- package/dist/atoms/Tooltip.svelte.d.ts +11 -0
- package/dist/atoms/ZabiStringsProvider.svelte +45 -0
- package/dist/atoms/ZabiStringsProvider.svelte.d.ts +27 -0
- package/dist/atoms/index.d.ts +17 -0
- package/dist/atoms/index.js +12 -0
- package/dist/atoms/selection-control.styles.d.ts +36 -5
- package/dist/atoms/selection-control.styles.js +40 -9
- package/dist/components/atoms/index.d.ts +17 -0
- package/dist/components/atoms/index.d.ts.map +1 -1
- package/dist/components/atoms/selection-control.styles.d.ts +36 -5
- package/dist/components/atoms/selection-control.styles.d.ts.map +1 -1
- package/dist/components/index.d.ts +80 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/molecules/index.d.ts +46 -0
- package/dist/components/molecules/index.d.ts.map +1 -1
- package/dist/components/molecules/toast-store.d.ts +53 -7
- package/dist/components/molecules/toast-store.d.ts.map +1 -1
- package/dist/components/organisms/index.d.ts +5 -0
- package/dist/components/organisms/index.d.ts.map +1 -1
- package/dist/components/types/variants.d.ts +15 -1
- package/dist/components/types/variants.d.ts.map +1 -1
- package/dist/components/util/app-shell.d.ts +28 -0
- package/dist/components/util/app-shell.d.ts.map +1 -0
- package/dist/components/util/avatar.d.ts +36 -0
- package/dist/components/util/avatar.d.ts.map +1 -0
- package/dist/components/util/bottom-sheet.d.ts +30 -0
- package/dist/components/util/bottom-sheet.d.ts.map +1 -0
- package/dist/components/util/bottom-tab-bar.d.ts +35 -0
- package/dist/components/util/bottom-tab-bar.d.ts.map +1 -0
- package/dist/components/util/calendar.d.ts +56 -0
- package/dist/components/util/calendar.d.ts.map +1 -0
- package/dist/components/util/collapsible.d.ts +58 -0
- package/dist/components/util/collapsible.d.ts.map +1 -0
- package/dist/components/util/confirm-dialog.d.ts +12 -0
- package/dist/components/util/confirm-dialog.d.ts.map +1 -0
- package/dist/components/util/date.d.ts +96 -0
- package/dist/components/util/date.d.ts.map +1 -0
- package/dist/components/util/drawer.d.ts +13 -0
- package/dist/components/util/drawer.d.ts.map +1 -0
- package/dist/components/util/dropdown.d.ts +47 -0
- package/dist/components/util/dropdown.d.ts.map +1 -0
- package/dist/components/util/field.d.ts +39 -0
- package/dist/components/util/field.d.ts.map +1 -0
- package/dist/components/util/fit-in-viewport.d.ts +201 -0
- package/dist/components/util/fit-in-viewport.d.ts.map +1 -0
- package/dist/components/util/focus-utils.d.ts +75 -2
- package/dist/components/util/focus-utils.d.ts.map +1 -1
- package/dist/components/util/hydration.d.ts +45 -0
- package/dist/components/util/hydration.d.ts.map +1 -0
- package/dist/components/util/keyboard-inset.d.ts +18 -0
- package/dist/components/util/keyboard-inset.d.ts.map +1 -0
- package/dist/components/util/media-grid.d.ts +51 -0
- package/dist/components/util/media-grid.d.ts.map +1 -0
- package/dist/components/util/media.d.ts +6 -0
- package/dist/components/util/media.d.ts.map +1 -0
- package/dist/components/util/overlay-chrome.d.ts +53 -0
- package/dist/components/util/overlay-chrome.d.ts.map +1 -0
- package/dist/components/util/overlay.d.ts +72 -0
- package/dist/components/util/overlay.d.ts.map +1 -0
- package/dist/components/util/photo.d.ts +215 -0
- package/dist/components/util/photo.d.ts.map +1 -0
- package/dist/components/util/portal.d.ts +23 -0
- package/dist/components/util/portal.d.ts.map +1 -0
- package/dist/components/util/pull-to-refresh.d.ts +27 -0
- package/dist/components/util/pull-to-refresh.d.ts.map +1 -0
- package/dist/components/util/radio-keys.d.ts +25 -0
- package/dist/components/util/radio-keys.d.ts.map +1 -0
- package/dist/components/util/rating.d.ts +23 -0
- package/dist/components/util/rating.d.ts.map +1 -0
- package/dist/components/util/ready-made-strings.d.ts +77 -0
- package/dist/components/util/ready-made-strings.d.ts.map +1 -0
- package/dist/components/util/scroll-padding.d.ts +20 -0
- package/dist/components/util/scroll-padding.d.ts.map +1 -0
- package/dist/components/util/segmented-control.d.ts +16 -0
- package/dist/components/util/segmented-control.d.ts.map +1 -0
- package/dist/components/util/select.d.ts +41 -0
- package/dist/components/util/select.d.ts.map +1 -0
- package/dist/components/util/sheet-drag.d.ts +60 -0
- package/dist/components/util/sheet-drag.d.ts.map +1 -0
- package/dist/components/util/sidebar.d.ts +63 -0
- package/dist/components/util/sidebar.d.ts.map +1 -0
- package/dist/components/util/sortable-list.d.ts +65 -0
- package/dist/components/util/sortable-list.d.ts.map +1 -0
- package/dist/components/util/stepper.d.ts +40 -0
- package/dist/components/util/stepper.d.ts.map +1 -0
- package/dist/components/util/swipeable-list-item.d.ts +36 -0
- package/dist/components/util/swipeable-list-item.d.ts.map +1 -0
- package/dist/components/util/theme-mode.d.ts +80 -0
- package/dist/components/util/theme-mode.d.ts.map +1 -0
- package/dist/components/util/toaster.d.ts +93 -0
- package/dist/components/util/toaster.d.ts.map +1 -0
- package/dist/components/util/tooltip.d.ts +10 -0
- package/dist/components/util/tooltip.d.ts.map +1 -0
- package/dist/components/util/top-navbar.d.ts +11 -0
- package/dist/components/util/top-navbar.d.ts.map +1 -0
- package/dist/components/util/touch-target.d.ts +31 -0
- package/dist/components/util/touch-target.d.ts.map +1 -0
- package/dist/components/util/zabi-strings.d.ts +133 -0
- package/dist/components/util/zabi-strings.d.ts.map +1 -0
- package/dist/create-theme/cli.js +169 -0
- package/dist/create-theme/index.d.ts +176 -0
- package/dist/create-theme/index.js +817 -0
- package/dist/create-theme/lib/ramp-math.js +128 -0
- package/dist/create-theme/lib/resolve.js +141 -0
- package/dist/create-theme/theme-data.js +1116 -0
- package/dist/index.d.ts +80 -2
- package/dist/index.js +57 -2
- package/dist/molecules/Alert.svelte +33 -5
- package/dist/molecules/Alert.svelte.d.ts +2 -0
- package/dist/molecules/AppBar.svelte +415 -0
- package/dist/molecules/AppBar.svelte.d.ts +69 -0
- package/dist/molecules/AvatarGroup.svelte +116 -0
- package/dist/molecules/AvatarGroup.svelte.d.ts +40 -0
- package/dist/molecules/BottomSheet.svelte +540 -0
- package/dist/molecules/BottomSheet.svelte.d.ts +93 -0
- package/dist/molecules/BottomTabBar.svelte +297 -0
- package/dist/molecules/BottomTabBar.svelte.d.ts +64 -0
- package/dist/molecules/Calendar.svelte +597 -0
- package/dist/molecules/Calendar.svelte.d.ts +72 -0
- package/dist/molecules/Collapsible.svelte +243 -0
- package/dist/molecules/Collapsible.svelte.d.ts +44 -0
- package/dist/molecules/CollapsibleGroup.svelte +126 -0
- package/dist/molecules/CollapsibleGroup.svelte.d.ts +14 -0
- package/dist/molecules/ComponentDemo.svelte +16 -4
- package/dist/molecules/ComponentDemo.svelte.d.ts +3 -0
- package/dist/molecules/ConfirmDialog.svelte +253 -0
- package/dist/molecules/ConfirmDialog.svelte.d.ts +55 -0
- package/dist/molecules/ContactForm.svelte +34 -17
- package/dist/molecules/ContactForm.svelte.d.ts +8 -0
- package/dist/molecules/Drawer.svelte +394 -0
- package/dist/molecules/Drawer.svelte.d.ts +55 -0
- package/dist/molecules/Dropdown.svelte +509 -48
- package/dist/molecules/Dropdown.svelte.d.ts +45 -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 +383 -70
- package/dist/molecules/ImageUpload.svelte.d.ts +47 -2
- package/dist/molecules/MediaGrid.svelte +527 -0
- package/dist/molecules/MediaGrid.svelte.d.ts +77 -0
- package/dist/molecules/Modal.svelte +288 -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 +433 -0
- package/dist/molecules/PhotoGrid.svelte.d.ts +62 -0
- package/dist/molecules/PhotoViewer.svelte +1116 -0
- package/dist/molecules/PhotoViewer.svelte.d.ts +56 -0
- package/dist/molecules/PropsTable.svelte +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 +52 -14
- package/dist/molecules/RadioGroup.svelte.d.ts +14 -3
- package/dist/molecules/Section.svelte +1 -1
- package/dist/molecules/SegmentedControl.svelte +323 -0
- package/dist/molecules/SegmentedControl.svelte.d.ts +34 -0
- package/dist/molecules/SidebarBrandHeader.svelte +11 -1
- package/dist/molecules/SidebarBrandHeader.svelte.d.ts +3 -0
- package/dist/molecules/SidebarFooter.svelte +29 -6
- package/dist/molecules/SidebarFooter.svelte.d.ts +3 -0
- package/dist/molecules/SlideUp.svelte +220 -61
- package/dist/molecules/SlideUp.svelte.d.ts +26 -0
- package/dist/molecules/SortableList.svelte +632 -0
- package/dist/molecules/SortableList.svelte.d.ts +69 -0
- package/dist/molecules/Stepper.svelte +548 -0
- package/dist/molecules/Stepper.svelte.d.ts +39 -0
- package/dist/molecules/StickyActionBar.svelte +191 -0
- package/dist/molecules/StickyActionBar.svelte.d.ts +65 -0
- package/dist/molecules/SwipeableListItem.svelte +334 -0
- package/dist/molecules/SwipeableListItem.svelte.d.ts +54 -0
- package/dist/molecules/Tabs.svelte +233 -9
- package/dist/molecules/Tabs.svelte.d.ts +7 -0
- package/dist/molecules/Toaster.svelte +350 -5
- package/dist/molecules/Toaster.svelte.d.ts +95 -2
- package/dist/molecules/ToasterToast.svelte +253 -67
- package/dist/molecules/ToasterToast.svelte.d.ts +9 -0
- package/dist/molecules/UnsavedChangesBar.svelte +212 -0
- package/dist/molecules/UnsavedChangesBar.svelte.d.ts +43 -0
- package/dist/molecules/index.d.ts +46 -0
- package/dist/molecules/index.js +27 -0
- package/dist/molecules/toast-store.d.ts +53 -7
- package/dist/molecules/toast-store.js +21 -0
- package/dist/organisms/AppShell.svelte +196 -0
- package/dist/organisms/AppShell.svelte.d.ts +61 -0
- package/dist/organisms/SidebarAccountPanel.svelte +107 -12
- package/dist/organisms/SidebarAccountPanel.svelte.d.ts +19 -0
- package/dist/organisms/SidebarNavigation.svelte +96 -15
- package/dist/organisms/SidebarNavigation.svelte.d.ts +29 -1
- package/dist/organisms/SidebarPanel.svelte +31 -10
- package/dist/organisms/SidebarShell.svelte +162 -11
- package/dist/organisms/SidebarShell.svelte.d.ts +56 -2
- package/dist/organisms/TopNavbar.svelte +256 -31
- package/dist/organisms/TopNavbar.svelte.d.ts +26 -0
- package/dist/organisms/index.d.ts +5 -0
- package/dist/organisms/index.js +3 -0
- package/dist/types/components.d.ts +4 -0
- package/dist/types/components.d.ts.map +1 -1
- package/dist/types/index.d.ts +605 -25
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/variants.ts +17 -1
- package/dist/util/app-shell.d.ts +27 -0
- package/dist/util/app-shell.js +72 -0
- package/dist/util/avatar.d.ts +35 -0
- package/dist/util/avatar.js +52 -0
- package/dist/util/bottom-sheet.d.ts +29 -0
- package/dist/util/bottom-sheet.js +43 -0
- package/dist/util/bottom-tab-bar.d.ts +34 -0
- package/dist/util/bottom-tab-bar.js +54 -0
- package/dist/util/calendar.d.ts +55 -0
- package/dist/util/calendar.js +74 -0
- package/dist/util/collapsible.d.ts +57 -0
- package/dist/util/collapsible.js +23 -0
- package/dist/util/confirm-dialog.d.ts +11 -0
- package/dist/util/confirm-dialog.js +2 -0
- package/dist/util/date.d.ts +95 -0
- package/dist/util/date.js +237 -0
- package/dist/util/drawer.d.ts +12 -0
- package/dist/util/drawer.js +7 -0
- package/dist/util/dropdown.d.ts +46 -0
- package/dist/util/dropdown.js +21 -0
- package/dist/util/field.d.ts +38 -0
- package/dist/util/field.js +38 -0
- package/dist/util/fit-in-viewport.d.ts +200 -0
- package/dist/util/fit-in-viewport.js +399 -0
- package/dist/util/focus-utils.d.ts +75 -2
- package/dist/util/focus-utils.js +182 -9
- package/dist/util/hydration.d.ts +44 -0
- package/dist/util/hydration.js +58 -0
- package/dist/util/keyboard-inset.d.ts +17 -0
- package/dist/util/keyboard-inset.js +53 -0
- package/dist/util/media-grid.d.ts +50 -0
- package/dist/util/media-grid.js +81 -0
- package/dist/util/media.d.ts +5 -0
- package/dist/util/media.js +10 -0
- package/dist/util/overlay-chrome.d.ts +52 -0
- package/dist/util/overlay-chrome.js +56 -0
- package/dist/util/overlay.d.ts +71 -0
- package/dist/util/overlay.js +240 -0
- package/dist/util/photo.d.ts +214 -0
- package/dist/util/photo.js +206 -0
- package/dist/util/portal.d.ts +22 -0
- package/dist/util/portal.js +50 -0
- package/dist/util/pull-to-refresh.d.ts +26 -0
- package/dist/util/pull-to-refresh.js +30 -0
- package/dist/util/radio-keys.d.ts +24 -0
- package/dist/util/radio-keys.js +49 -0
- package/dist/util/rating.d.ts +22 -0
- package/dist/util/rating.js +26 -0
- package/dist/util/ready-made-strings.d.ts +76 -0
- package/dist/util/ready-made-strings.js +67 -0
- package/dist/util/scroll-padding.d.ts +19 -0
- package/dist/util/scroll-padding.js +44 -0
- package/dist/util/segmented-control.d.ts +15 -0
- package/dist/util/segmented-control.js +1 -0
- package/dist/util/select.d.ts +40 -0
- package/dist/util/select.js +63 -0
- package/dist/util/sheet-drag.d.ts +59 -0
- package/dist/util/sheet-drag.js +241 -0
- package/dist/util/sidebar.d.ts +62 -0
- package/dist/util/sidebar.js +38 -0
- package/dist/util/sortable-list.d.ts +64 -0
- package/dist/util/sortable-list.js +53 -0
- package/dist/util/stepper.d.ts +39 -0
- package/dist/util/stepper.js +38 -0
- package/dist/util/swipeable-list-item.d.ts +35 -0
- package/dist/util/swipeable-list-item.js +32 -0
- package/dist/util/theme-mode.d.ts +79 -0
- package/dist/util/theme-mode.js +121 -0
- package/dist/util/toaster.d.ts +92 -0
- package/dist/util/toaster.js +75 -0
- package/dist/util/tooltip.d.ts +9 -0
- package/dist/util/tooltip.js +18 -0
- package/dist/util/top-navbar.d.ts +10 -0
- package/dist/util/top-navbar.js +5 -0
- package/dist/util/touch-target.d.ts +30 -0
- package/dist/util/touch-target.js +30 -0
- package/dist/util/zabi-strings.d.ts +132 -0
- package/dist/util/zabi-strings.js +105 -0
- package/dist/zabi-components-colors.css +5 -2
- package/dist/zabi-components-theme-dark-only.css +543 -241
- package/dist/zabi-components-theme-dark.css +543 -241
- package/dist/zabi-components-theme-only.css +1584 -367
- package/dist/zabi-components-theme.css +1584 -367
- package/dist/zabi-components.css +3885 -518
- package/docs/lucide-icons.md +40 -17
- package/docs/theme-imports.md +81 -11
- package/package.json +35 -8
package/docs/lucide-icons.md
CHANGED
|
@@ -1,26 +1,49 @@
|
|
|
1
1
|
# Lucide icons used by zabi-components
|
|
2
2
|
|
|
3
|
-
The package depends on `@lucide/svelte`.
|
|
3
|
+
The package depends on `@lucide/svelte`. Every component imports each icon it uses from that icon's own file:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
```ts
|
|
6
|
+
import ChevronDown from "@lucide/svelte/icons/chevron-down";
|
|
7
|
+
```
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|--------|--------------|--------|
|
|
9
|
-
| `CodeBlock` | Per-icon path | `check`, `copy` |
|
|
10
|
-
| `ThemeToggle` | Barrel | `Sun`, `Moon` |
|
|
11
|
-
| `ListItem` | Barrel | `ArrowRight` |
|
|
12
|
-
| `Badge` | Barrel | `Check`, `AlertTriangle`, `X`, `Info` |
|
|
13
|
-
| `ImageUpload` | Barrel | `Image` |
|
|
14
|
-
| `Input` | Barrel | `CheckCircle`, `AlertTriangle`, `AlertCircle` |
|
|
15
|
-
| `Select` | Barrel | `ChevronDown`, `CheckCircle`, `AlertTriangle`, `AlertCircle` |
|
|
16
|
-
| `SidebarPanel` | Barrel | `Search`, `X` |
|
|
17
|
-
| `SidebarAccountPanel` | Barrel | `LogOut`, `Moon`, `Sun`, `User` |
|
|
18
|
-
| `SidebarNavigation` | Barrel | `Command`, `Search` |
|
|
9
|
+
No component imports from the package's barrel (`import { ChevronDown } from "@lucide/svelte"`). The barrel re-exports every icon, about 1,700 Svelte files, and a bundler has to read and compile all of them to find the one that is used: a SvelteKit app with a single `<Button>` from this library transformed 3,800 modules for its client build when the library used the barrel, and 366 now. `npm run check` fails on a barrel import anywhere under `src` (the components, the stories, the docs site and the catalog's code samples), in `docs`, `.storybook` and the README, because the examples are what gets copied; `npm run build:lib` fails on one in `dist` (`scripts/lucide-barrel.js`). The one exception is `src/types/IconPropsCheck.svelte`, the type test that proves an icon from the barrel is still accepted by every icon prop.
|
|
19
10
|
|
|
20
|
-
|
|
11
|
+
## In your app
|
|
12
|
+
|
|
13
|
+
Import icons the same way, one file each. It is the barrel import that is slow, not the number of icons you use.
|
|
14
|
+
|
|
15
|
+
```svelte
|
|
16
|
+
<script lang="ts">
|
|
17
|
+
import { List } from "zabi-components";
|
|
18
|
+
import House from "@lucide/svelte/icons/house";
|
|
19
|
+
import Settings from "@lucide/svelte/icons/settings";
|
|
20
|
+
|
|
21
|
+
const items = [
|
|
22
|
+
{ id: "1", label: "Home", icon: House },
|
|
23
|
+
{ id: "2", label: "Settings", icon: Settings },
|
|
24
|
+
];
|
|
25
|
+
</script>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
A barrel-imported icon still works wherever a prop takes an icon: the two are the same component with the same type (`src/types/IconPropsCheck.svelte` holds that in `npm run check`). It only costs you the build time described above.
|
|
29
|
+
|
|
30
|
+
## Icons re-exported from the package root
|
|
31
|
+
|
|
32
|
+
For convenience the root entry re-exports a few icons: `Sun`, `Moon`, `Monitor`, `Grip`, `GripVertical`, `ChevronUp`, `ChevronDown`, `ChevronRight`, `Zap`, `Briefcase`, `Clipboard` and `Settings`. Each comes from its own file, so `import { Button } from "zabi-components"` does not reach the barrel.
|
|
33
|
+
|
|
34
|
+
## If your app aliases `@lucide/svelte`
|
|
35
|
+
|
|
36
|
+
An alias for `@lucide/svelte` itself no longer covers what the library imports: the components ask for `@lucide/svelte/icons/<name>`. If you replace Lucide with a hand-authored set, alias those paths, for each of these files:
|
|
37
|
+
|
|
38
|
+
`arrow-left`, `arrow-right`, `briefcase`, `check`, `chevron-down`, `chevron-left`, `chevron-right`, `chevron-up`, `circle-alert`, `circle-check-big`, `clipboard`, `command`, `copy`, `external-link`, `grip`, `grip-vertical`, `image`, `image-off`, `info`, `log-out`, `menu`, `monitor`, `moon`, `octagon-alert`, `play`, `plus`, `search`, `settings`, `star`, `sun`, `trash-2`, `triangle-alert`, `user`, `x`, `zap`.
|
|
39
|
+
|
|
40
|
+
Showcase and demo routes under this repo import additional icons, some of them from the barrel; those are not part of the package.
|
|
21
41
|
|
|
22
42
|
## Typings for `@lucide/svelte/icons/*`
|
|
23
43
|
|
|
24
|
-
`@lucide/svelte` 0.544.x ships per-icon `.svelte.d.ts` files with a duplicate `type X = ReturnType<typeof X>` line that makes some TypeScript language services treat them as non-modules.
|
|
44
|
+
`@lucide/svelte` 0.544.x ships per-icon `.svelte.d.ts` files with a duplicate `type X = ReturnType<typeof X>` line that makes some TypeScript language services treat them as non-modules, so an editor may report that an icon has no default export. It affects editor tooling only, not runtime and not a build.
|
|
45
|
+
|
|
46
|
+
The package runs no install scripts in your project, and since 8.1.0 it lists none either: the dev-only `prepare` script is gone, so installing from a tarball no longer makes npm print an `install-scripts` notice.
|
|
25
47
|
|
|
26
|
-
|
|
48
|
+
- In your app: if your editor complains, enable `skipLibCheck` or upgrade `@lucide/svelte`.
|
|
49
|
+
- In this repo: `npm run check` (svelte-check) and `npm run build:lib` pass on a fresh install without any patch. If your editor still shows the error, run `npm run fix:lucide-types` once after installing; it strips the duplicate line from the files in `node_modules` and changes nothing else.
|
package/docs/theme-imports.md
CHANGED
|
@@ -12,8 +12,74 @@ For most Tailwind v4 apps, use:
|
|
|
12
12
|
@import "zabi-components/theme-dark-only";
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
Without Tailwind, import the compiled stylesheet on its own:
|
|
16
|
+
|
|
17
|
+
```css
|
|
18
|
+
@import "zabi-components/css";
|
|
19
|
+
```
|
|
20
|
+
|
|
15
21
|
Use short package exports by default. Legacy deep `dist` imports remain supported for compatibility.
|
|
16
22
|
|
|
23
|
+
## What the theme files contain
|
|
24
|
+
|
|
25
|
+
`theme` and `theme-only` hold three things:
|
|
26
|
+
|
|
27
|
+
1. An `@source` directive for the package's own components. Tailwind CSS v4 does not scan `node_modules`, and this is what makes it generate the classes the components use. You do not need an `@source` line of your own.
|
|
28
|
+
2. The `@theme` block with every token.
|
|
29
|
+
3. The hand-written component rules that Tailwind cannot generate from the tokens: `.focus-ring`, `.text-action-primary`, the action hover, active and disabled states, the semantic colour classes and the `z-*` scale.
|
|
30
|
+
|
|
31
|
+
`theme-dark` and `theme-dark-only` hold the dark overrides, under three selectors:
|
|
32
|
+
|
|
33
|
+
```css
|
|
34
|
+
.dark, [data-theme="dark"] { … }
|
|
35
|
+
@media (prefers-color-scheme: dark) { [data-theme="auto"] { … } }
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Put `class="dark"` or `data-theme="dark"` on `<html>` for dark, `data-theme="auto"` to follow the system, and `data-theme="light"` (or nothing) for light. Following the system is opt-in. See [THEMING.md](../THEMING.md#light-dark-and-auto).
|
|
39
|
+
|
|
40
|
+
The dark files only remap roles. The raw palettes (`--zabi-brand-*`, `--zabi-accent-*`, `--zabi-base-*` and the rest) are declared once, in the light theme, so that an app's override of them on `:root` applies in both modes. Before 8.1.0 the dark files restated those ramps; they no longer do, so a dark file must be imported together with a light one (`theme`, `theme-only`, or `colors`, which has both).
|
|
41
|
+
|
|
42
|
+
## Rebranding
|
|
43
|
+
|
|
44
|
+
Generate one file from your brand colour and import it after the theme files:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npx zabi-theme --brand "#C17B00" --neutral "#78716c" --out src/lib/brand.generated.css
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```css
|
|
51
|
+
/* src/lib/theme.css */
|
|
52
|
+
@import "zabi-components/theme-only";
|
|
53
|
+
@import "zabi-components/theme-dark-only";
|
|
54
|
+
@import "./brand.generated.css"; /* --zabi-brand-*, --zabi-accent-*, --zabi-base-* */
|
|
55
|
+
|
|
56
|
+
:root {
|
|
57
|
+
--font-family-heading: "Your Display Font", var(--font-family-sans);
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
One file covers light and dark. Which tokens an app may set, the generator's
|
|
62
|
+
options and what does not follow an override are in the theming guide,
|
|
63
|
+
[THEMING.md](../THEMING.md). The same function is exported as `createTheme()`
|
|
64
|
+
from `zabi-components/create-theme`.
|
|
65
|
+
|
|
66
|
+
The universal scrollbar rules are in the compiled `css` bundle only. Importing a theme does not restyle the scrollbars in your app; add `.scrollbar-semantic` where you want them.
|
|
67
|
+
|
|
68
|
+
## Tailwind together with the compiled stylesheet
|
|
69
|
+
|
|
70
|
+
`zabi-components/css` is a finished Tailwind build. It carries its own copy of every utility the components use, `w-full`, `px-6` and `mt-10` among them, in the same `utilities` layer your Tailwind build writes to. Two builds cannot be sorted into one order, so the import order decides which copy wins:
|
|
71
|
+
|
|
72
|
+
- **Tailwind first, `css` second.** The package's plain utilities land after your variants. `w-full md:w-1/2` stays full width, and `px-6 md:px-8` keeps the narrow padding, wherever the package ships the plain class too.
|
|
73
|
+
- **`css` first, Tailwind second.** Your plain utilities land after the package's variants. `Modal` declares `items-end md:items-center` and `p-0 md:p-4`; if your app uses `items-end` or `p-0` anywhere, the dialog stays at the bottom edge, without padding, on wide screens. A component's own `p-6 pt-0` loses its `pt-0` the same way.
|
|
74
|
+
|
|
75
|
+
Neither order is right. With Tailwind in the app, import `theme-only` and `theme-dark-only` instead, as above: Tailwind then generates each utility once, in its own order, and both cases resolve. If you started on 8.0.0, where `css` was the only import that worked, switch when you upgrade.
|
|
76
|
+
|
|
77
|
+
The hand-written colour classes (`bg-card`, `text-headline`, `border-border` and the rest) are outside every layer, in `css` and in the theme files alike, so they win over any utility on the same element: `bg-card md:bg-red-500` keeps the card colour. Change the colour by replacing the class, not by adding a variant next to it.
|
|
78
|
+
|
|
79
|
+
## Version 8.0.0 and earlier
|
|
80
|
+
|
|
81
|
+
In 8.0.0 and 7.0.2 the theme files were published without semicolons, without the `@source` directive and without the component rules, so they left components unstyled. Upgrade, or import `zabi-components/css`, which worked in those versions too.
|
|
82
|
+
|
|
17
83
|
## Package export paths
|
|
18
84
|
|
|
19
85
|
Use these subpaths with your bundler or `npm`/`pnpm` resolution:
|
|
@@ -22,10 +88,11 @@ Use these subpaths with your bundler or `npm`/`pnpm` resolution:
|
|
|
22
88
|
|--------|-------------|----------|
|
|
23
89
|
| `zabi-components/theme` | `zabi-components-theme.css` | Tailwind **not** already in the project; ships `@import "tailwindcss"` + `@theme`. |
|
|
24
90
|
| `zabi-components/theme-only` | `zabi-components-theme-only.css` | Tailwind **already** configured; merge only the `@theme` block. |
|
|
25
|
-
| `zabi-components/theme-dark` | `zabi-components-theme-dark.css` |
|
|
26
|
-
| `zabi-components/theme-dark-only` | `zabi-components-theme-dark-only.css` | Tailwind present; **only**
|
|
27
|
-
| `zabi-components/colors` | `zabi-components-colors.css` | **No Tailwind**: `:root` + `.dark` CSS variables only. |
|
|
91
|
+
| `zabi-components/theme-dark` | `zabi-components-theme-dark.css` | Tailwind import + the dark overrides (`.dark`, `[data-theme]`); import after `theme`. |
|
|
92
|
+
| `zabi-components/theme-dark-only` | `zabi-components-theme-dark-only.css` | Tailwind present; **only** the dark overrides (import after light theme). |
|
|
93
|
+
| `zabi-components/colors` | `zabi-components-colors.css` | **No Tailwind**: `:root` + dark (`.dark`, `[data-theme]`) CSS variables only. |
|
|
28
94
|
| `zabi-components/css` | `zabi-components.css` | Full compiled CSS (utilities, components styles, dark). |
|
|
95
|
+
| `zabi-components/create-theme` | `create-theme/index.js` | Not CSS: the `createTheme()` function behind the `zabi-theme` command. |
|
|
29
96
|
|
|
30
97
|
### Legacy export paths (supported, deprecated in docs)
|
|
31
98
|
|
|
@@ -43,7 +110,7 @@ These are still exported for backward compatibility but are not the recommended
|
|
|
43
110
|
## Decision matrix
|
|
44
111
|
|
|
45
112
|
1. **Vanilla CSS or no Tailwind** → `colors` (or full `css` if you need utility classes from the bundle).
|
|
46
|
-
2. **Tailwind v4 app, extend design tokens** → `theme-only` (+ `theme-dark-only` if you use `class="dark"` / dark mode).
|
|
113
|
+
2. **Tailwind v4 app, extend design tokens** → `theme-only` (+ `theme-dark-only` if you use `class="dark"` / `data-theme` / dark mode).
|
|
47
114
|
3. **Minimal setup, one import for light** → `theme`.
|
|
48
115
|
4. **Dark as a second file** → `theme` + `theme-dark`, or `theme-only` + `theme-dark-only`.
|
|
49
116
|
|
|
@@ -85,16 +152,17 @@ These are still exported for backward compatibility but are not the recommended
|
|
|
85
152
|
@import "zabi-components/colors";
|
|
86
153
|
```
|
|
87
154
|
|
|
88
|
-
Toggle `.dark` at the root element to activate dark tokens
|
|
155
|
+
Toggle `.dark` at the root element to activate dark tokens, or use `data-theme`:
|
|
89
156
|
|
|
90
157
|
```html
|
|
91
158
|
<html class="dark">
|
|
159
|
+
<html data-theme="auto">
|
|
92
160
|
```
|
|
93
161
|
|
|
94
162
|
## Maintainer checklist (token changes)
|
|
95
163
|
|
|
96
|
-
1. Edit **`src/app.css`** only (`@theme` for light tokens, `.dark` for overrides).
|
|
97
|
-
2.
|
|
164
|
+
1. Edit **`src/app.css`** only (`@theme` for light tokens, the single `.dark` rule for overrides).
|
|
165
|
+
2. Physical ramps (`--zabi-*`) are declared in `@theme` only. `.dark` must not restate them or hold a hex literal; `validate-theme.js` fails the build if it does.
|
|
98
166
|
3. Run **`npm run build:css`** (or **`npm run build:lib`** before publish).
|
|
99
167
|
4. Confirm **`node scripts/verify-build.js`** passes in CI or locally after builds.
|
|
100
168
|
|
|
@@ -102,11 +170,13 @@ Toggle `.dark` at the root element to activate dark tokens:
|
|
|
102
170
|
|
|
103
171
|
| File | Contents |
|
|
104
172
|
|------|----------|
|
|
105
|
-
| `zabi-components.css` | PostCSS/Tailwind output: utilities + theme +
|
|
173
|
+
| `zabi-components.css` | PostCSS/Tailwind output: utilities + theme + dark. |
|
|
106
174
|
| `zabi-components-theme.css` | `@import tailwind` + `@theme`. |
|
|
107
175
|
| `zabi-components-theme-only.css` | `@theme` only. |
|
|
108
|
-
| `zabi-components-theme-dark.css` | `@import tailwind` +
|
|
109
|
-
| `zabi-components-theme-dark-only.css` |
|
|
110
|
-
| `zabi-components-colors.css` | `:root` +
|
|
176
|
+
| `zabi-components-theme-dark.css` | `@import tailwind` + dark. |
|
|
177
|
+
| `zabi-components-theme-dark-only.css` | dark only. |
|
|
178
|
+
| `zabi-components-colors.css` | `:root` + dark as plain custom properties. |
|
|
179
|
+
|
|
180
|
+
"dark" is the `.dark` rule of `src/app.css`, published as `.dark, [data-theme="dark"]` and again as `[data-theme="auto"]` inside `@media (prefers-color-scheme: dark)`, plus `color-scheme` for the three `data-theme` values.
|
|
111
181
|
|
|
112
182
|
Build logic lives in **`scripts/build-css.js`** (see file header for behavior).
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zabi-components",
|
|
3
|
-
"version": "8.
|
|
4
|
-
"description": "Svelte 5 UI components with TypeScript
|
|
3
|
+
"version": "8.1.0",
|
|
4
|
+
"description": "Svelte 5 UI component library: accessible components with TypeScript types, Tailwind CSS v4 design tokens, light and dark themes, and SSR support for SvelteKit.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -39,6 +39,10 @@
|
|
|
39
39
|
"types": "./dist/routes/lib/variant-utils.d.ts",
|
|
40
40
|
"import": "./dist/routes/lib/variant-utils.js"
|
|
41
41
|
},
|
|
42
|
+
"./create-theme": {
|
|
43
|
+
"types": "./dist/create-theme/index.d.ts",
|
|
44
|
+
"import": "./dist/create-theme/index.js"
|
|
45
|
+
},
|
|
42
46
|
"./dist/zabi-components.css": "./dist/zabi-components.css",
|
|
43
47
|
"./dist/zabi-components-colors.css": "./dist/zabi-components-colors.css",
|
|
44
48
|
"./dist/zabi-components-theme.css": "./dist/zabi-components-theme.css",
|
|
@@ -53,9 +57,16 @@
|
|
|
53
57
|
"./css": "./dist/zabi-components.css",
|
|
54
58
|
"./package.json": "./package.json"
|
|
55
59
|
},
|
|
60
|
+
"bin": {
|
|
61
|
+
"zabi-theme": "./dist/create-theme/cli.js"
|
|
62
|
+
},
|
|
63
|
+
"sideEffects": [
|
|
64
|
+
"**/*.css"
|
|
65
|
+
],
|
|
56
66
|
"files": [
|
|
57
67
|
"dist",
|
|
58
68
|
"README.md",
|
|
69
|
+
"CHANGELOG.md",
|
|
59
70
|
"THEME.md",
|
|
60
71
|
"THEMING.md",
|
|
61
72
|
"docs/theme-imports.md",
|
|
@@ -64,13 +75,24 @@
|
|
|
64
75
|
"keywords": [
|
|
65
76
|
"svelte",
|
|
66
77
|
"svelte5",
|
|
78
|
+
"svelte-5",
|
|
67
79
|
"sveltekit",
|
|
80
|
+
"svelte-components",
|
|
68
81
|
"components",
|
|
82
|
+
"component-library",
|
|
69
83
|
"ui",
|
|
84
|
+
"ui-components",
|
|
85
|
+
"design-system",
|
|
86
|
+
"design-tokens",
|
|
70
87
|
"typescript",
|
|
71
88
|
"tailwind",
|
|
89
|
+
"tailwindcss",
|
|
72
90
|
"runes",
|
|
73
|
-
"ssr"
|
|
91
|
+
"ssr",
|
|
92
|
+
"accessibility",
|
|
93
|
+
"a11y",
|
|
94
|
+
"dark-mode",
|
|
95
|
+
"theming"
|
|
74
96
|
],
|
|
75
97
|
"author": "Zabi Components Team",
|
|
76
98
|
"license": "MIT",
|
|
@@ -84,7 +106,8 @@
|
|
|
84
106
|
"build:components": "svelte-package -o dist --input src/components",
|
|
85
107
|
"build:lib-files": "mkdir -p dist/routes/lib dist/types && cp src/components/types/variants.ts dist/types/ && cp src/components/types/page.types.ts dist/types/ && tsc src/routes/lib/variant-utils.ts --declaration --module esnext --target es2020 --moduleResolution bundler --skipLibCheck --rootDir src --outDir .lib-tmp && cp .lib-tmp/routes/lib/variant-utils.js .lib-tmp/routes/lib/variant-utils.d.ts dist/routes/lib/ && rm -rf .lib-tmp",
|
|
86
108
|
"build:fix-imports": "node scripts/fix-package-imports.js",
|
|
87
|
-
"build:lib": "npm run build:css && npm run build:components && npm run build:lib-files && npm run build:fix-imports && npm run build:types && npm run build:css && node scripts/verify-build.js",
|
|
109
|
+
"build:lib": "npm run build:css && npm run build:components && npm run build:lib-files && npm run build:fix-imports && npm run build:types && npm run build:css && npm run build:create-theme && node scripts/verify-build.js",
|
|
110
|
+
"build:create-theme": "node scripts/build-create-theme.js",
|
|
88
111
|
"sync:tokens": "node scripts/sync-theme-tokens.js && node scripts/generate-ramps.js && node scripts/generate-surfaces.js",
|
|
89
112
|
"build:css": "npm run sync:tokens && node scripts/build-css.js && node scripts/validate-theme.js && npm run check:design",
|
|
90
113
|
"check:tokens": "node scripts/check-token-violations.js",
|
|
@@ -93,19 +116,23 @@
|
|
|
93
116
|
"check": "svelte-check --tsconfig ./tsconfig.json && node scripts/check-component-imports.js && node scripts/check-layout-width.js && npm run check:design",
|
|
94
117
|
"storybook": "storybook dev -p 6006",
|
|
95
118
|
"build-storybook": "storybook build",
|
|
119
|
+
"build:storybook-site": "rm -rf static/storybook && storybook build -o storybook-static --quiet && cp -R storybook-static static/storybook",
|
|
120
|
+
"build:site": "npm run build:storybook-site && vite build",
|
|
121
|
+
"vercel-build": "npm run build:site",
|
|
96
122
|
"test": "vitest run",
|
|
97
123
|
"test:watch": "vitest",
|
|
98
124
|
"test:e2e": "playwright test",
|
|
99
125
|
"test:e2e:smoke": "playwright test --grep @smoke",
|
|
100
126
|
"test:playwright": "npm run test:e2e",
|
|
101
|
-
"test:themes": "node --test tests/theme-output.test.js",
|
|
102
|
-
"
|
|
127
|
+
"test:themes": "node --test --test-concurrency=1 tests/theme-output.test.js tests/create-theme.test.js",
|
|
128
|
+
"fix:lucide-types": "node scripts/fix-lucide-svelte-icon-dts.js",
|
|
103
129
|
"prepublishOnly": "npm run build:lib",
|
|
104
130
|
"publish:npm": "npm publish --access public --registry https://registry.npmjs.org/",
|
|
105
131
|
"check:ramps": "node scripts/check-ramp-lightness.js",
|
|
106
132
|
"check:contrast": "node scripts/check-contrast.js",
|
|
107
133
|
"check:geometry": "node scripts/check-control-geometry.js",
|
|
108
|
-
"check:
|
|
134
|
+
"check:states": "node scripts/check-state-variants.js",
|
|
135
|
+
"check:design": "npm run check:ramps && npm run check:contrast && npm run check:geometry && npm run check:tokens && npm run check:states"
|
|
109
136
|
},
|
|
110
137
|
"devDependencies": {
|
|
111
138
|
"@playwright/test": "^1.63.0",
|
|
@@ -122,7 +149,6 @@
|
|
|
122
149
|
"@tsconfig/svelte": "^5.0.5",
|
|
123
150
|
"@types/node": "^24.5.2",
|
|
124
151
|
"autoprefixer": "^10.4.17",
|
|
125
|
-
"culori": "^4.0.2",
|
|
126
152
|
"jsdom": "^29.0.2",
|
|
127
153
|
"postcss": "^8.4.35",
|
|
128
154
|
"storybook": "^10.2.19",
|
|
@@ -135,6 +161,7 @@
|
|
|
135
161
|
},
|
|
136
162
|
"dependencies": {
|
|
137
163
|
"@lucide/svelte": "^0.544.0",
|
|
164
|
+
"culori": "^4.0.2",
|
|
138
165
|
"tailwind-merge": "^3.7.0"
|
|
139
166
|
},
|
|
140
167
|
"peerDependencies": {
|