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
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How much of the bottom of the page the on-screen keyboard covers.
|
|
3
|
+
*
|
|
4
|
+
* Browsers disagree on what a keyboard does. Some shrink the layout viewport,
|
|
5
|
+
* and everything pinned to the bottom moves up by itself. Others (iOS Safari,
|
|
6
|
+
* and Chrome on Android by default) leave the layout alone and only shrink
|
|
7
|
+
* the *visual* viewport, so a bar pinned to the bottom ends up behind the
|
|
8
|
+
* keyboard. The difference between the two viewports is the part to lift a
|
|
9
|
+
* bar by; where the layout has already shrunk, it is 0.
|
|
10
|
+
*/
|
|
11
|
+
/** The covered height in px, or 0 where it cannot be told (the server, an old browser). */
|
|
12
|
+
export declare function readKeyboardInset(): number;
|
|
13
|
+
/**
|
|
14
|
+
* Calls `onChange` with the inset now, and again whenever it changes. Call it
|
|
15
|
+
* in the browser; the returned function stops it.
|
|
16
|
+
*/
|
|
17
|
+
export declare function watchKeyboardInset(onChange: (inset: number) => void): () => void;
|
|
18
|
+
//# sourceMappingURL=keyboard-inset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard-inset.d.ts","sourceRoot":"","sources":["../../../src/components/util/keyboard-inset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,2FAA2F;AAC3F,wBAAgB,iBAAiB,IAAI,MAAM,CAU1C;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,IAAI,CAoBhF"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public types and pure helpers for `MapView`.
|
|
3
|
+
*
|
|
4
|
+
* Which markers become one count marker is worked out here, on pixels, so it
|
|
5
|
+
* can be tested without a browser or the map library. Nothing in this file
|
|
6
|
+
* imports MapLibre: `mapViewSupported()` can be asked before the library is
|
|
7
|
+
* loaded, and the library's own types stay out of the package's.
|
|
8
|
+
*/
|
|
9
|
+
export type MapPointKey = string | number;
|
|
10
|
+
/** A place on the map. */
|
|
11
|
+
export interface MapLngLat {
|
|
12
|
+
lng: number;
|
|
13
|
+
lat: number;
|
|
14
|
+
}
|
|
15
|
+
/** One marker. */
|
|
16
|
+
export interface MapPoint extends MapLngLat {
|
|
17
|
+
/** Stable identity. */
|
|
18
|
+
id: MapPointKey;
|
|
19
|
+
/** The marker's accessible name, written by the app. */
|
|
20
|
+
label: string;
|
|
21
|
+
/** Drawn filled, with a check mark; left out or false, round and outlined. */
|
|
22
|
+
checked?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** Room kept clear at the edges of the map, in px: a sheet over its lower part is a `bottom`. */
|
|
25
|
+
export interface MapInset {
|
|
26
|
+
top?: number;
|
|
27
|
+
right?: number;
|
|
28
|
+
bottom?: number;
|
|
29
|
+
left?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Where the map stands:
|
|
33
|
+
* - `loading`: the library or the first style is on its way;
|
|
34
|
+
* - `ready`: the map has drawn;
|
|
35
|
+
* - `library-error`: the map library could not be loaded or started (no WebGL, a failed chunk);
|
|
36
|
+
* - `tiles-error`: the style could not be fetched, or tiles failed and none has arrived (offline).
|
|
37
|
+
*/
|
|
38
|
+
export type MapViewStatus = "loading" | "ready" | "library-error" | "tiles-error";
|
|
39
|
+
/** Payload of MapView's `onmove`: where the map is after a move has ended. */
|
|
40
|
+
export interface MapViewPosition {
|
|
41
|
+
center: MapLngLat;
|
|
42
|
+
zoom: number;
|
|
43
|
+
}
|
|
44
|
+
/** Every built-in string of MapView. Pass a partial object to `strings` to translate. */
|
|
45
|
+
export interface MapViewStrings {
|
|
46
|
+
/** Accessible name of the map. */
|
|
47
|
+
label: string;
|
|
48
|
+
/** Accessible name of a marker that stands for several points. */
|
|
49
|
+
cluster: (count: number) => string;
|
|
50
|
+
/** Accessible name of the dot at the viewer's own position. */
|
|
51
|
+
viewer: string;
|
|
52
|
+
}
|
|
53
|
+
export declare const MAP_VIEW_STRINGS: MapViewStrings;
|
|
54
|
+
/** A marker's tap area, in px. It does not grow with the text size. */
|
|
55
|
+
export declare const MAP_MARKER_TAP = 44;
|
|
56
|
+
/** The closest the opening fit zooms in, so one marker does not fill the screen: street level. */
|
|
57
|
+
export declare const MAP_FIT_MAX_ZOOM = 16;
|
|
58
|
+
/**
|
|
59
|
+
* Whether this browser can draw the map: it has WebGL. Safe on the server
|
|
60
|
+
* (false) and cheap: it does not load the map library.
|
|
61
|
+
*/
|
|
62
|
+
export declare function mapViewSupported(): boolean;
|
|
63
|
+
export interface MapPixel {
|
|
64
|
+
x: number;
|
|
65
|
+
y: number;
|
|
66
|
+
}
|
|
67
|
+
/** What is drawn: one point, or several under one count marker. */
|
|
68
|
+
export interface MapMarker<T> {
|
|
69
|
+
/** The key of its first point in the list: the marker keeps its element, and the focus, while others join or leave it. */
|
|
70
|
+
key: MapPointKey;
|
|
71
|
+
/** Its points, in the order of the list. */
|
|
72
|
+
points: T[];
|
|
73
|
+
/** Place in the list of its first point: the marker's place in the tab order. */
|
|
74
|
+
order: number;
|
|
75
|
+
/** Where it is drawn: the middle of its points. */
|
|
76
|
+
x: number;
|
|
77
|
+
y: number;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Groups points whose tap areas overlap into one marker, and goes on until no
|
|
81
|
+
* two markers overlap: a count marker sits in the middle of its points, which
|
|
82
|
+
* may bring it over a neighbour. Markers come back in the order of the list,
|
|
83
|
+
* each at the place of its first point.
|
|
84
|
+
*
|
|
85
|
+
* `pixels[i]` is where `points[i]` is on the screen. The result depends only
|
|
86
|
+
* on how far apart the points are, so a pan changes nothing and a pinch splits
|
|
87
|
+
* markers as they stop overlapping.
|
|
88
|
+
*/
|
|
89
|
+
export declare function clusterMarkers<T extends {
|
|
90
|
+
id: MapPointKey;
|
|
91
|
+
}>(points: readonly T[], pixels: readonly MapPixel[], tap?: number): MapMarker<T>[];
|
|
92
|
+
/** The corners of the box around `points`, or null with none. */
|
|
93
|
+
export declare function boundsOf(points: readonly MapLngLat[]): [[number, number], [number, number]] | null;
|
|
94
|
+
/** Changes when a point is added, taken away or moved, and not when only its name or its check does. */
|
|
95
|
+
export declare function pointsSignature(points: readonly MapPoint[]): string;
|
|
96
|
+
/**
|
|
97
|
+
* How far from the middle of the map the middle of the area inside `inset`
|
|
98
|
+
* is, in px: where a point is put so that it is in view above a sheet.
|
|
99
|
+
*/
|
|
100
|
+
export declare function insetOffset(inset: MapInset | undefined): MapPixel;
|
|
101
|
+
/** The words of an attribution the style carries as HTML, as plain text. */
|
|
102
|
+
export declare function attributionText(html: string): string;
|
|
103
|
+
/**
|
|
104
|
+
* The part of MapLibre GL JS that MapView uses, written out here so that the
|
|
105
|
+
* package's types do not need the library's.
|
|
106
|
+
*/
|
|
107
|
+
export interface MapLibreMapLike {
|
|
108
|
+
on(type: string, listener: (event: any) => void): unknown;
|
|
109
|
+
off(type: string, listener: (event: any) => void): unknown;
|
|
110
|
+
remove(): void;
|
|
111
|
+
resize(): unknown;
|
|
112
|
+
jumpTo(options: {
|
|
113
|
+
center?: [number, number] | MapLngLat;
|
|
114
|
+
zoom?: number;
|
|
115
|
+
}): unknown;
|
|
116
|
+
cameraForBounds(bounds: [[number, number], [number, number]], options?: {
|
|
117
|
+
padding?: number;
|
|
118
|
+
maxZoom?: number;
|
|
119
|
+
}): {
|
|
120
|
+
center?: unknown;
|
|
121
|
+
zoom?: number;
|
|
122
|
+
} | undefined;
|
|
123
|
+
project(lngLat: [number, number]): MapPixel;
|
|
124
|
+
unproject(point: [number, number]): MapLngLat;
|
|
125
|
+
getCenter(): MapLngLat;
|
|
126
|
+
getZoom(): number;
|
|
127
|
+
setStyle(style: string | object): unknown;
|
|
128
|
+
getStyle(): {
|
|
129
|
+
sources?: Record<string, {
|
|
130
|
+
attribution?: string;
|
|
131
|
+
}>;
|
|
132
|
+
} | undefined;
|
|
133
|
+
getSource?(id: string): {
|
|
134
|
+
attribution?: string;
|
|
135
|
+
} | undefined;
|
|
136
|
+
getCanvas(): HTMLCanvasElement;
|
|
137
|
+
touchZoomRotate?: {
|
|
138
|
+
disableRotation(): void;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
export interface MapLibreLike {
|
|
142
|
+
Map: new (options: Record<string, unknown>) => MapLibreMapLike;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=map-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-view.d.ts","sourceRoot":"","sources":["../../../src/components/util/map-view.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1C,0BAA0B;AAC1B,MAAM,WAAW,SAAS;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACf;AAED,kBAAkB;AAClB,MAAM,WAAW,QAAS,SAAQ,SAAS;IACvC,uBAAuB;IACvB,EAAE,EAAE,WAAW,CAAC;IAChB,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,iGAAiG;AACjG,MAAM,WAAW,QAAQ;IACrB,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AE,GACjD;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IACnD,OAAO,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC;IAC5C,SAAS,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAC9C,SAAS,IAAI,SAAS,CAAC;IACvB,OAAO,IAAI,MAAM,CAAC;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAC1C,QAAQ,IAAI;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,WAAW,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,GAAG,SAAS,CAAC;IAC/E,SAAS,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IAC7D,SAAS,IAAI,iBAAiB,CAAC;IAC/B,eAAe,CAAC,EAAE;QAAE,eAAe,IAAI,IAAI,CAAA;KAAE,CAAC;CACjD;AAED,MAAM,WAAW,YAAY;IACzB,GAAG,EAAE,KAAK,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,eAAe,CAAC;CAClE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** Types and pure helpers for `MediaGrid`. Kept out of the component so they can be tested without a DOM. */
|
|
2
|
+
export type MediaGridKey = string | number;
|
|
3
|
+
export type MediaGridItemType = "image" | "video";
|
|
4
|
+
/** Payload of `onselect`. */
|
|
5
|
+
export interface MediaGridSelectDetail<T> {
|
|
6
|
+
item: T;
|
|
7
|
+
/** False when the activation cleared the item's selection. */
|
|
8
|
+
selected: boolean;
|
|
9
|
+
/** Every selected key after the change: one or none unless `multiple`. */
|
|
10
|
+
keys: MediaGridKey[];
|
|
11
|
+
}
|
|
12
|
+
/** Every built-in string. Pass a partial object to `strings` to translate. */
|
|
13
|
+
export interface MediaGridStrings {
|
|
14
|
+
/** Accessible name of an item's delete button. */
|
|
15
|
+
deleteLabel: (label: string) => string;
|
|
16
|
+
/** Accessible name of a video item; an image is named by its label alone. */
|
|
17
|
+
videoLabel: (label: string) => string;
|
|
18
|
+
/** Announced, and never shown, while `loading` is set. */
|
|
19
|
+
loading: string;
|
|
20
|
+
emptyTitle: string;
|
|
21
|
+
emptyDescription: string;
|
|
22
|
+
/**
|
|
23
|
+
* How to get around by keyboard. Read once when focus enters the grid,
|
|
24
|
+
* and shown below it while it has keyboard focus. Keep it to one short
|
|
25
|
+
* sentence.
|
|
26
|
+
*/
|
|
27
|
+
keyboardHint: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const MEDIA_GRID_STRINGS: MediaGridStrings;
|
|
30
|
+
export { isVideoUrl } from "./media.js";
|
|
31
|
+
/**
|
|
32
|
+
* Columns in the rendered grid, read from the top edge of each tile in DOM
|
|
33
|
+
* order: the first row ends where the top edge changes. The layout is CSS
|
|
34
|
+
* `auto-fill`, so only the browser knows the answer.
|
|
35
|
+
*/
|
|
36
|
+
export declare function columnCount(tops: readonly number[]): number;
|
|
37
|
+
export type MediaGridMove = "left" | "right" | "up" | "down" | "rowStart" | "rowEnd" | "first" | "last";
|
|
38
|
+
/**
|
|
39
|
+
* Index a navigation key lands on. Nothing wraps. Moving down from the row
|
|
40
|
+
* above a short last row lands on the last item, so the last row can always
|
|
41
|
+
* be reached from any column.
|
|
42
|
+
*/
|
|
43
|
+
export declare function moveIndex(index: number, move: MediaGridMove, columns: number, total: number): number;
|
|
44
|
+
/**
|
|
45
|
+
* The move a key asks for in a grid of tiles, or undefined for a key that is
|
|
46
|
+
* not a navigation key. Left and Right follow what is on screen, which is
|
|
47
|
+
* mirrored in a right-to-left layout; Ctrl with Home or End goes to the first
|
|
48
|
+
* or last tile. Shared by `MediaGrid` and `PhotoGrid`.
|
|
49
|
+
*/
|
|
50
|
+
export declare function moveForKey(event: Pick<KeyboardEvent, "key" | "ctrlKey">, rtl: boolean): MediaGridMove | undefined;
|
|
51
|
+
//# sourceMappingURL=media-grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-grid.d.ts","sourceRoot":"","sources":["../../../src/components/util/media-grid.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAE7G,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3C,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,OAAO,CAAC;AAElD,6BAA6B;AAC7B,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACpC,IAAI,EAAE,CAAC,CAAC;IACR,8DAA8D;IAC9D,QAAQ,EAAE,OAAO,CAAC;IAClB,0EAA0E;IAC1E,IAAI,EAAE,YAAY,EAAE,CAAC;CACxB;AAED,8EAA8E;AAC9E,MAAM,WAAW,gBAAgB;IAC7B,kDAAkD;IAClD,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,6EAA6E;IAC7E,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACtC,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,kBAAkB,EAAE,gBAOhC,CAAC;AAGF,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAK3D;AAED,MAAM,MAAM,aAAa,GACnB,MAAM,GACN,OAAO,GACP,IAAI,GACJ,MAAM,GACN,UAAU,GACV,QAAQ,GACR,OAAO,GACP,MAAM,CAAC;AAEb;;;;GAIG;AACH,wBAAgB,SAAS,CACrB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACd,MAAM,CAyBR;AASD;;;;;GAKG;AACH,wBAAgB,UAAU,CACtB,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,SAAS,CAAC,EAC7C,GAAG,EAAE,OAAO,GACb,aAAa,GAAG,SAAS,CAQ3B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** How the library tells a video from an image by its address. Shared by `ImageUpload` and `MediaGrid`. */
|
|
2
|
+
/** True for a path or file name with a video extension, before any query or hash. */
|
|
3
|
+
export declare function isVideoPath(path: string): boolean;
|
|
4
|
+
/** True for a video data URL, or a URL whose path has a video extension. */
|
|
5
|
+
export declare function isVideoUrl(url: string): boolean;
|
|
6
|
+
//# sourceMappingURL=media.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../src/components/util/media.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAI3G,qFAAqF;AACrF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEjD;AAED,4EAA4E;AAC5E,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE/C"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chrome of an overlay at large text: the header of a BottomSheet, Drawer,
|
|
3
|
+
* Modal or SlideUp, and the padding of its footer.
|
|
4
|
+
*
|
|
5
|
+
* Tailwind's spacing is in rem, so at `html { font-size: 200% }` the gutters,
|
|
6
|
+
* the gap above the title, the title and the close button all doubled. On a
|
|
7
|
+
* phone that left a third of a half-height sheet to what the sheet was opened
|
|
8
|
+
* for. This is navigation chrome, as the app bar is (see AppBar): it says
|
|
9
|
+
* where you are and how to leave, and it is not what the user enlarged the
|
|
10
|
+
* text to read. So it is laid out in px, and its title grows to 1.3 times its
|
|
11
|
+
* size and stops. The content, and whatever the app puts in the footer, scale
|
|
12
|
+
* in full. docs/ACCESSIBILITY.md has the reasoning against WCAG 1.4.4.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* On the header box: the spacing scale in px for everything inside it, so
|
|
16
|
+
* `px-6`, `gap-4`, `size-8` and the 44px of `TOUCH_HIT_AREA` are the sizes
|
|
17
|
+
* they are at 100% text. Only for a box that holds chrome alone: an app's
|
|
18
|
+
* Button inside it would stop growing too, which is why a footer spells its
|
|
19
|
+
* padding out in px instead.
|
|
20
|
+
*/
|
|
21
|
+
export declare const OVERLAY_CHROME = "[--spacing:4px]";
|
|
22
|
+
/**
|
|
23
|
+
* How a title wraps: onto as many lines as it needs, between words, and a
|
|
24
|
+
* word wider than the whole line is cut rather than left sticking out.
|
|
25
|
+
*/
|
|
26
|
+
export declare const OVERLAY_TITLE_WRAP = "[overflow-wrap:break-word]";
|
|
27
|
+
/**
|
|
28
|
+
* On the title while the text is enlarged (`textIsEnlarged`): a word that does
|
|
29
|
+
* not fit at the end of a line is hyphenated by the rules of the page's
|
|
30
|
+
* `lang`, where the browser has them, before it is cut.
|
|
31
|
+
*
|
|
32
|
+
* Not at the default text size, and not narrowed with `hyphenate-limit-chars`:
|
|
33
|
+
* `hyphens: auto` hyphenates at the end of every line, not only where a word
|
|
34
|
+
* is too wide, and what a browser offers as a hyphenation point is the
|
|
35
|
+
* platform's ("sett-ings", "histor-y" in Chromium on macOS). A title that
|
|
36
|
+
* wraps between words today would get those. A limit, where it is supported
|
|
37
|
+
* at all (not in Safari), turns a hyphenated break of a shorter word into a
|
|
38
|
+
* plain cut.
|
|
39
|
+
*/
|
|
40
|
+
export declare const OVERLAY_TITLE_HYPHENS = "hyphens-auto";
|
|
41
|
+
/**
|
|
42
|
+
* Whether the reader has enlarged the text: the root font size is above the
|
|
43
|
+
* 16px every browser starts from. Read when an overlay opens. False on the
|
|
44
|
+
* server and until then, which is the layout at the default size.
|
|
45
|
+
*/
|
|
46
|
+
export declare function textIsEnlarged(): boolean;
|
|
47
|
+
/** A title of 20px (`text-xl`): up to 26px, on the same 1.4 line. */
|
|
48
|
+
export declare const OVERLAY_TITLE_XL = "text-[length:min(1.25rem,26px)] leading-[1.4]";
|
|
49
|
+
/** A title of 24px (`text-2xl`): up to 31.2px, on the same 4/3 line. */
|
|
50
|
+
export declare const OVERLAY_TITLE_2XL = "text-[length:min(1.5rem,31.2px)] leading-[calc(4/3)]";
|
|
51
|
+
/** The "×" of a close button: a control, so the size it is at 100%. */
|
|
52
|
+
export declare const OVERLAY_CLOSE_GLYPH = "text-[24px] leading-[32px]";
|
|
53
|
+
//# sourceMappingURL=overlay-chrome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay-chrome.d.ts","sourceRoot":"","sources":["../../../src/components/util/overlay-chrome.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,+BAA+B,CAAC;AAE/D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,iBAAiB,CAAC;AAEpD;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAGxC;AAED,qEAAqE;AACrE,eAAO,MAAM,gBAAgB,kDAAkD,CAAC;AAEhF,wEAAwE;AACxE,eAAO,MAAM,iBAAiB,yDAAyD,CAAC;AAExF,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What Modal, SlideUp and Drawer share beyond `focus-utils.ts`: the scroll
|
|
3
|
+
* lock on `<body>` and the Tab cycle inside the panel. One copy, so the
|
|
4
|
+
* overlays cannot drift apart and keep working when nested in any order.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Stops the page behind an overlay from scrolling. Ref-counted on `<body>`
|
|
8
|
+
* (`data-zabi-scroll-lock`), so nested overlays share one lock and the page
|
|
9
|
+
* scrolls again only when the last one has released it.
|
|
10
|
+
*
|
|
11
|
+
* Call it when the overlay opens, in the browser, and call the returned
|
|
12
|
+
* function when it closes.
|
|
13
|
+
*/
|
|
14
|
+
export declare function lockBodyScroll(): () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Keeps Tab inside `container`: call it from the panel's `keydown` handler.
|
|
17
|
+
* Focusables are re-queried on every Tab, so content added while the overlay
|
|
18
|
+
* is open stays inside the cycle. A Tab that comes from a dialog nested in the
|
|
19
|
+
* container is left to that dialog. The toasts on screen are in the cycle too,
|
|
20
|
+
* after the container's own controls: see `getToastFocusables`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function trapTabKey(container: HTMLElement | undefined, event: KeyboardEvent): void;
|
|
23
|
+
/**
|
|
24
|
+
* Watches a scrolling box in an overlay and reports whether it has to be a
|
|
25
|
+
* Tab stop itself: true when its content is taller than it and holds nothing
|
|
26
|
+
* that can take focus, so the keyboard would otherwise have no way to scroll
|
|
27
|
+
* it. The answer changes with the viewport and with the content, so it is
|
|
28
|
+
* reported again whenever either does.
|
|
29
|
+
*
|
|
30
|
+
* Call it when the overlay opens, in the browser; the returned function stops it.
|
|
31
|
+
*/
|
|
32
|
+
export declare function watchScrollerNeedsFocus(box: HTMLElement, onChange: (needsFocus: boolean) => void): () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Keeps an overlay on the part of the screen the on-screen keyboard leaves.
|
|
35
|
+
*
|
|
36
|
+
* Where the keyboard covers the page instead of shrinking it (iOS Safari,
|
|
37
|
+
* Chrome on Android), a panel at the bottom of a `fixed inset-0` root ends up
|
|
38
|
+
* behind it, footer and all. This moves the root's bottom edge up to the top
|
|
39
|
+
* of the keyboard (and its top edge down, if the browser has panned the
|
|
40
|
+
* screen), so everything laid out against the root follows: a sheet's height,
|
|
41
|
+
* a pinned footer, a drawer's end. `data-keyboard-open` is set on the root
|
|
42
|
+
* meanwhile. The field that has focus is scrolled back into view once the
|
|
43
|
+
* root has its new size. Where the page shrinks by itself, nothing is done.
|
|
44
|
+
*
|
|
45
|
+
* The root is usually the backdrop as well: while it is moved, its dimming is
|
|
46
|
+
* carried on past its edges, so the page does not show undimmed where the
|
|
47
|
+
* keyboard was while that slides away.
|
|
48
|
+
*
|
|
49
|
+
* `root` is the overlay's outermost, fixed element. Call it when the overlay
|
|
50
|
+
* opens, in the browser; the returned function stops it and puts the root back.
|
|
51
|
+
*/
|
|
52
|
+
export declare function followKeyboard(root: HTMLElement): () => void;
|
|
53
|
+
/**
|
|
54
|
+
* Says that `footer` is pinned to the bottom of an open overlay, so what is
|
|
55
|
+
* drawn over the overlays (the toast stack) can stay off it. Call it when the
|
|
56
|
+
* footer is rendered, in the browser; the returned function withdraws it.
|
|
57
|
+
*/
|
|
58
|
+
export declare function registerOverlayFooter(footer: HTMLElement): () => void;
|
|
59
|
+
/**
|
|
60
|
+
* Says that `header` is the top of an open overlay and holds its close
|
|
61
|
+
* button, so the toast stack starts below it and never lies over the one
|
|
62
|
+
* control that always closes the overlay. Call it when the header is
|
|
63
|
+
* rendered, in the browser; the returned function withdraws it.
|
|
64
|
+
*/
|
|
65
|
+
export declare function registerOverlayHeader(header: HTMLElement): () => void;
|
|
66
|
+
/** The footer of the overlay on top, if it has one. */
|
|
67
|
+
export declare function topOverlayFooter(): HTMLElement | null;
|
|
68
|
+
/** The header of the overlay on top, if it has one. */
|
|
69
|
+
export declare function topOverlayHeader(): HTMLElement | null;
|
|
70
|
+
/** Calls `listener` whenever a registered header or footer appears, goes, moves or changes size. */
|
|
71
|
+
export declare function watchOverlayFooters(listener: () => void): () => void;
|
|
72
|
+
//# sourceMappingURL=overlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../src/components/util/overlay.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;;;;;;GAOG;AACH,wBAAgB,cAAc,IAAI,MAAM,IAAI,CAkB3C;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,WAAW,GAAG,SAAS,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI,CAMzF;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACnC,GAAG,EAAE,WAAW,EAChB,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,GACxC,MAAM,IAAI,CAaZ;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,IAAI,CAuD5D;AAyDD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,IAAI,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,IAAI,CAErE;AAWD,uDAAuD;AACvD,wBAAgB,gBAAgB,IAAI,WAAW,GAAG,IAAI,CAGrD;AAED,uDAAuD;AACvD,wBAAgB,gBAAgB,IAAI,WAAW,GAAG,IAAI,CAGrD;AAED,oGAAoG;AACpG,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAKpE"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public types and pure helpers for `PhotoGrid` and `PhotoViewer`.
|
|
3
|
+
*
|
|
4
|
+
* Everything a gesture means is worked out here, on numbers: where a pinch
|
|
5
|
+
* leaves the photo, how far it may be panned, whether a swipe turns the page.
|
|
6
|
+
* The components only feed pointers in and apply the result, so the
|
|
7
|
+
* arithmetic can be tested without a browser.
|
|
8
|
+
*/
|
|
9
|
+
import type { Component } from "svelte";
|
|
10
|
+
export type PhotoKey = string | number;
|
|
11
|
+
/** One photo. `PhotoGrid` and `PhotoViewer` take the same array. */
|
|
12
|
+
export interface Photo {
|
|
13
|
+
/** Stable identity, when the same `src` may appear twice or may change. Without it, `src` is the identity. */
|
|
14
|
+
id?: PhotoKey;
|
|
15
|
+
/** The full image, shown in the viewer. */
|
|
16
|
+
src: string;
|
|
17
|
+
/** A small version for the grid, and for the viewer while the full image loads. Without it, `src`. */
|
|
18
|
+
thumbSrc?: string;
|
|
19
|
+
/** What the photo shows, for those who cannot see it. */
|
|
20
|
+
alt: string;
|
|
21
|
+
/** Width of the full image in px. With `height` it reserves the photo's box before it has loaded. */
|
|
22
|
+
width: number;
|
|
23
|
+
/** Height of the full image in px. */
|
|
24
|
+
height: number;
|
|
25
|
+
/** Shown under the photo in the viewer. */
|
|
26
|
+
caption?: string;
|
|
27
|
+
/**
|
|
28
|
+
* A second, quieter line under the caption in the viewer: who took the
|
|
29
|
+
* photo, when. It is never folded away with a long caption.
|
|
30
|
+
*/
|
|
31
|
+
credit?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Where a photo that is being added stands, drawn on its tile in the grid:
|
|
34
|
+
* `uploading` (on its way) or `error` (it did not arrive). Left out: saved.
|
|
35
|
+
*/
|
|
36
|
+
status?: PhotoStatus;
|
|
37
|
+
/** How far an `uploading` photo has come, from 0 to 1. Without it the tile shows a spinner. */
|
|
38
|
+
progress?: number;
|
|
39
|
+
}
|
|
40
|
+
export type PhotoStatus = "uploading" | "error";
|
|
41
|
+
export declare function photoKey(photo: Photo): PhotoKey;
|
|
42
|
+
/** Payload of PhotoGrid's `onselect`. */
|
|
43
|
+
export interface PhotoGridSelectDetail {
|
|
44
|
+
photo: Photo;
|
|
45
|
+
index: number;
|
|
46
|
+
/** False when the press cleared the photo's selection (only in `multiple`). */
|
|
47
|
+
selected: boolean;
|
|
48
|
+
/** Every selected key after the change: one or none in `single`. */
|
|
49
|
+
keys: PhotoKey[];
|
|
50
|
+
}
|
|
51
|
+
/** Every built-in string of PhotoGrid. Pass a partial object to `strings` to translate. */
|
|
52
|
+
export interface PhotoGridStrings {
|
|
53
|
+
/** Visible label and name of the tile that adds a photo. */
|
|
54
|
+
addPhoto: string;
|
|
55
|
+
/** Name of a photo that has no `alt`. */
|
|
56
|
+
photoName: (position: number, total: number) => string;
|
|
57
|
+
/** Name of the last tile when it stands for the photos not shown. */
|
|
58
|
+
morePhotos: (count: number) => string;
|
|
59
|
+
/** Name of the button that opens a photo, in a grid where a press selects. */
|
|
60
|
+
openPhoto: (name: string) => string;
|
|
61
|
+
/** How to get around by keyboard. Read once when focus enters the grid, and shown while it has keyboard focus. */
|
|
62
|
+
keyboardHint: string;
|
|
63
|
+
/** Added to the name of a photo whose `status` is `uploading`. */
|
|
64
|
+
uploading: string;
|
|
65
|
+
/** Added to the name of a photo whose `status` is `error`. */
|
|
66
|
+
uploadFailed: string;
|
|
67
|
+
/** Name of the button on a failed photo that tries again. */
|
|
68
|
+
retryUpload: (name: string) => string;
|
|
69
|
+
}
|
|
70
|
+
export declare const PHOTO_GRID_STRINGS: PhotoGridStrings;
|
|
71
|
+
/** What the user did to close the viewer. `swipe` is a swipe down on the photo. */
|
|
72
|
+
export type PhotoViewerCloseReason = "escape" | "close-button" | "swipe";
|
|
73
|
+
/** Something to do with the photo that is showing: share it, delete it. */
|
|
74
|
+
export interface PhotoViewerAction {
|
|
75
|
+
id: string;
|
|
76
|
+
label: string;
|
|
77
|
+
/** An icon component, as `@lucide/svelte` icons are. */
|
|
78
|
+
icon?: Component<{
|
|
79
|
+
size?: number;
|
|
80
|
+
class?: string;
|
|
81
|
+
}>;
|
|
82
|
+
/** `danger` for a destructive action such as Delete. */
|
|
83
|
+
tone?: "danger";
|
|
84
|
+
disabled?: boolean;
|
|
85
|
+
onclick: (photo: Photo, index: number) => void;
|
|
86
|
+
}
|
|
87
|
+
/** Every built-in string of PhotoViewer. Pass a partial object to `strings` to translate. */
|
|
88
|
+
export interface PhotoViewerStrings {
|
|
89
|
+
close: string;
|
|
90
|
+
previous: string;
|
|
91
|
+
next: string;
|
|
92
|
+
/** The counter that is shown: "3 / 12". */
|
|
93
|
+
counter: (position: number, total: number) => string;
|
|
94
|
+
/** The same for a screen reader, read out after the photo's `alt`: "3 of 12". */
|
|
95
|
+
position: (position: number, total: number) => string;
|
|
96
|
+
/** Announced, with a spinner, when a photo takes a while to load. */
|
|
97
|
+
loading: string;
|
|
98
|
+
/** Shown when a photo cannot be loaded. */
|
|
99
|
+
loadError: string;
|
|
100
|
+
retry: string;
|
|
101
|
+
/** Name of the menu that holds the actions that do not fit in the bar. */
|
|
102
|
+
moreActions: string;
|
|
103
|
+
/** The button that shows all of a long caption, and the one that folds it again. */
|
|
104
|
+
showMore: string;
|
|
105
|
+
showLess: string;
|
|
106
|
+
/** Name of a photo that has no `alt`. */
|
|
107
|
+
photoName: (position: number, total: number) => string;
|
|
108
|
+
}
|
|
109
|
+
export declare const PHOTO_VIEWER_STRINGS: PhotoViewerStrings;
|
|
110
|
+
/** How many actions the viewer's bar shows before the rest go into a menu. */
|
|
111
|
+
export declare const MAX_BAR_ACTIONS = 3;
|
|
112
|
+
/** The actions shown in the bar, and those that go into the menu. */
|
|
113
|
+
export declare function splitActions<T>(actions: readonly T[], max?: number): {
|
|
114
|
+
bar: T[];
|
|
115
|
+
menu: T[];
|
|
116
|
+
};
|
|
117
|
+
/** An index held inside a list of `count` photos; -1 for an empty list. */
|
|
118
|
+
export declare function clampIndex(index: number, count: number): number;
|
|
119
|
+
/** What the grid shows of `total` photos under `max`, and how many the last tile stands for. */
|
|
120
|
+
export declare function visibleCount(total: number, max: number | undefined): {
|
|
121
|
+
shown: number;
|
|
122
|
+
hidden: number;
|
|
123
|
+
};
|
|
124
|
+
export interface Size {
|
|
125
|
+
width: number;
|
|
126
|
+
height: number;
|
|
127
|
+
}
|
|
128
|
+
export interface Point {
|
|
129
|
+
x: number;
|
|
130
|
+
y: number;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Where the photo is. `scale` 1 is the photo fitted to the screen. `x` and
|
|
134
|
+
* `y` are how far its centre is from the centre of the screen, in px.
|
|
135
|
+
*/
|
|
136
|
+
export interface PhotoTransform {
|
|
137
|
+
scale: number;
|
|
138
|
+
x: number;
|
|
139
|
+
y: number;
|
|
140
|
+
}
|
|
141
|
+
export declare const REST: PhotoTransform;
|
|
142
|
+
export declare const MIN_SCALE = 1;
|
|
143
|
+
export declare const MAX_SCALE = 4;
|
|
144
|
+
/** What a double tap zooms to. */
|
|
145
|
+
export declare const DOUBLE_TAP_SCALE = 2.5;
|
|
146
|
+
export declare const isZoomed: (transform: PhotoTransform) => boolean;
|
|
147
|
+
/** The largest size a photo of `photo` px takes inside `view` without being cropped. */
|
|
148
|
+
export declare function fitSize(photo: Size, view: Size): Size;
|
|
149
|
+
/**
|
|
150
|
+
* The transform with its pan held to the photo's edges: an edge of the photo
|
|
151
|
+
* never comes further in than the edge of the screen, and a side that is
|
|
152
|
+
* narrower than the screen stays centred. `fit` is the photo's size at scale 1.
|
|
153
|
+
*/
|
|
154
|
+
export declare function clampPan(transform: PhotoTransform, fit: Size, view: Size): PhotoTransform;
|
|
155
|
+
/**
|
|
156
|
+
* Zooms to `scale` so that the point of the photo under `point` stays under
|
|
157
|
+
* it. `point` is measured from the centre of the screen.
|
|
158
|
+
*/
|
|
159
|
+
export declare function zoomAbout(transform: PhotoTransform, scale: number, point: Point, fit: Size, view: Size): PhotoTransform;
|
|
160
|
+
/** Two fingers on the glass: the point between them, and how far apart they are. */
|
|
161
|
+
export interface PinchSample {
|
|
162
|
+
centre: Point;
|
|
163
|
+
distance: number;
|
|
164
|
+
}
|
|
165
|
+
export declare function pinchSample(first: Point, second: Point): PinchSample;
|
|
166
|
+
/**
|
|
167
|
+
* Where a pinch has taken the photo: scaled by how much the fingers have
|
|
168
|
+
* spread, about the point that was between them when it began, and moved with
|
|
169
|
+
* that point. Points are measured from the centre of the screen.
|
|
170
|
+
*/
|
|
171
|
+
export declare function pinchTransform(start: PhotoTransform, from: PinchSample, now: PinchSample, fit: Size, view: Size): PhotoTransform;
|
|
172
|
+
/** A pinch let go a hair above the fitted size is the fitted size. */
|
|
173
|
+
export declare function settleZoom(transform: PhotoTransform, fit: Size, view: Size): PhotoTransform;
|
|
174
|
+
/** A double tap: in to 2.5 times about the tap from the fitted photo, and back to fitted from any zoom. */
|
|
175
|
+
export declare function doubleTapTransform(transform: PhotoTransform, point: Point, fit: Size, view: Size): PhotoTransform;
|
|
176
|
+
/** The photo moved by `delta` px, held to its edges. */
|
|
177
|
+
export declare function panBy(transform: PhotoTransform, delta: Point, fit: Size, view: Size): PhotoTransform;
|
|
178
|
+
/** One step of the keyboard or the wheel: in or out by half again, about the centre. */
|
|
179
|
+
export declare const ZOOM_STEP = 1.5;
|
|
180
|
+
/** Movement under this many px is a press, not a drag. */
|
|
181
|
+
export declare const TAP_SLOP = 8;
|
|
182
|
+
/** A press shorter than this is a tap, and two taps closer together than this are a double tap. */
|
|
183
|
+
export declare const TAP_MS = 300;
|
|
184
|
+
/** Two taps further apart than this are two taps. */
|
|
185
|
+
export declare const DOUBLE_TAP_RADIUS = 32;
|
|
186
|
+
export declare function isDoubleTap(previous: {
|
|
187
|
+
time: number;
|
|
188
|
+
point: Point;
|
|
189
|
+
} | null, now: {
|
|
190
|
+
time: number;
|
|
191
|
+
point: Point;
|
|
192
|
+
}): boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Which way a drag on the fitted photo is going, once it has gone far enough
|
|
195
|
+
* to tell: `x` turns the page, `down` closes, and null is not yet known. A
|
|
196
|
+
* drag upwards is neither, and stays null.
|
|
197
|
+
*/
|
|
198
|
+
export declare function dragAxis(delta: Point, slop?: number): "x" | "down" | null;
|
|
199
|
+
/** Part of the screen's width a slow swipe has to cross to turn the page. */
|
|
200
|
+
export declare const TURN_DISTANCE = 0.25;
|
|
201
|
+
/** Part of the screen's height a slow swipe down has to cross to close. */
|
|
202
|
+
export declare const CLOSE_DISTANCE = 0.2;
|
|
203
|
+
/**
|
|
204
|
+
* What a horizontal swipe does when the finger lifts. A flick decides by its
|
|
205
|
+
* direction; a slow one by how far it went. Swiping left shows the next
|
|
206
|
+
* photo, and the previous one in a right-to-left layout. At either end there
|
|
207
|
+
* is nothing to turn to.
|
|
208
|
+
*/
|
|
209
|
+
export declare function swipeTurn(options: {
|
|
210
|
+
/** px moved; negative is to the left. */
|
|
211
|
+
distance: number;
|
|
212
|
+
/** px per ms at release; negative is to the left. */
|
|
213
|
+
velocity: number;
|
|
214
|
+
width: number;
|
|
215
|
+
index: number;
|
|
216
|
+
count: number;
|
|
217
|
+
rtl?: boolean;
|
|
218
|
+
flick: number;
|
|
219
|
+
}): -1 | 0 | 1;
|
|
220
|
+
/** Whether a swipe down closes the viewer when the finger lifts. */
|
|
221
|
+
export declare function swipeCloses(options: {
|
|
222
|
+
/** px moved down. */
|
|
223
|
+
distance: number;
|
|
224
|
+
/** px per ms at release; positive is down. */
|
|
225
|
+
velocity: number;
|
|
226
|
+
height: number;
|
|
227
|
+
flick: number;
|
|
228
|
+
}): boolean;
|
|
229
|
+
/**
|
|
230
|
+
* How far a drag past the first or last photo moves it: a third of the
|
|
231
|
+
* finger's travel, so it gives but does not come away.
|
|
232
|
+
*/
|
|
233
|
+
export declare function resist(distance: number): number;
|
|
234
|
+
//# sourceMappingURL=photo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"photo.d.ts","sourceRoot":"","sources":["../../../src/components/util/photo.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvC,oEAAoE;AACpE,MAAM,WAAW,KAAK;IAClB,8GAA8G;IAC9G,EAAE,CAAC,EAAE,QAAQ,CAAC;IACd,2CAA2C;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,sGAAsG;IACtG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,GAAG,EAAE,MAAM,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AW,CACvB,QAAQ,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,GAAG,IAAI,EAC/C,GAAG,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,GACpC,OAAO,CAMT;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,SAAW,GAAG,GAAG,GAAG,MAAM,GAAG,IAAI,CAM3E;AAED,6EAA6E;AAC7E,eAAO,MAAM,aAAa,OAAO,CAAC;AAClC,2EAA2E;AAC3E,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE;IAC/B,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAUb;AAED,oEAAoE;AACpE,wBAAgB,WAAW,CAAC,OAAO,EAAE;IACjC,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAIV;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE/C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Action } from "svelte/action";
|
|
2
|
+
/**
|
|
3
|
+
* Where to render the node: `true` for `document.body`, an element, or a
|
|
4
|
+
* selector. `false` leaves the node where the template put it.
|
|
5
|
+
*/
|
|
6
|
+
export type PortalTarget = boolean | HTMLElement | string;
|
|
7
|
+
/**
|
|
8
|
+
* Moves an overlay out of its ancestors so none of them can trap it: a
|
|
9
|
+
* `transform`, `filter` or `contain` ancestor becomes the containing block of a
|
|
10
|
+
* `position: fixed` child, and an `overflow: hidden` one then clips it.
|
|
11
|
+
*
|
|
12
|
+
* SSR-safe by construction: actions never run on the server, so the markup is
|
|
13
|
+
* rendered in place and moved on mount. The node is removed on destroy, and
|
|
14
|
+
* Svelte's own teardown of a node that has already gone is a no-op.
|
|
15
|
+
*
|
|
16
|
+
* Put it on the single root element of an `{#if}` block. The theme is a `.dark`
|
|
17
|
+
* class on an ancestor, so a node portalled to `body` keeps it only when the
|
|
18
|
+
* class sits on `<html>` or `<body>`.
|
|
19
|
+
*
|
|
20
|
+
* Usage: `<div use:portal>` or `<div use:portal={enabled}>`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const portal: Action<HTMLElement, PortalTarget | undefined>;
|
|
23
|
+
//# sourceMappingURL=portal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../src/components/util/portal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,CAAC;AAW1D;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,YAAY,GAAG,SAAS,CA8BhE,CAAC"}
|