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,40 @@
|
|
|
1
|
+
/** Types and pure helpers for `Stepper`. Kept out of the component so they can be tested without a DOM. */
|
|
2
|
+
/** One step: a label, and optionally a line under it. A plain string is a step with only a label. */
|
|
3
|
+
export interface StepperStep {
|
|
4
|
+
label: string;
|
|
5
|
+
/** A short line under the label in the full layout, and under the current step's name in the compact one. */
|
|
6
|
+
description?: string;
|
|
7
|
+
}
|
|
8
|
+
/** A step as the `steps` prop takes it. */
|
|
9
|
+
export type StepperItem = string | StepperStep;
|
|
10
|
+
/** Where a step is in the flow. */
|
|
11
|
+
export type StepperStepState = "completed" | "current" | "upcoming";
|
|
12
|
+
export type StepperLayout = "auto" | "full" | "compact";
|
|
13
|
+
/**
|
|
14
|
+
* Every built-in string. Pass a partial object to `strings` to translate.
|
|
15
|
+
* `step` is counted from 1 in all of them.
|
|
16
|
+
*/
|
|
17
|
+
export interface StepperStrings {
|
|
18
|
+
/** The visible start of the compact line: "Step 2 of 3". */
|
|
19
|
+
position: (step: number, total: number) => string;
|
|
20
|
+
/**
|
|
21
|
+
* What a screen reader reads for a step, and the name of its button when
|
|
22
|
+
* the step is one: "Step 1 of 3: Details, completed".
|
|
23
|
+
*/
|
|
24
|
+
stepLabel: (step: number, total: number, label: string, state: StepperStepState) => string;
|
|
25
|
+
/** Read out, politely, when the current step changes: "Step 2 of 3: Ratings". */
|
|
26
|
+
announcement: (step: number, total: number, label: string) => string;
|
|
27
|
+
}
|
|
28
|
+
export declare const STEPPER_STRINGS: StepperStrings;
|
|
29
|
+
/** Strings and objects alike, as objects. */
|
|
30
|
+
export declare function normalizeSteps(steps: readonly StepperItem[] | null | undefined): StepperStep[];
|
|
31
|
+
/**
|
|
32
|
+
* The index of the step that is shown as current: `current` as a whole number
|
|
33
|
+
* held within the steps. Below the first step it is the first, past the last
|
|
34
|
+
* it is the last, and something that is not a number is the first. `-1` when
|
|
35
|
+
* there are no steps.
|
|
36
|
+
*/
|
|
37
|
+
export declare function clampStep(current: number | null | undefined, total: number): number;
|
|
38
|
+
/** The state of the step at `index` when the step at `current` is the current one. */
|
|
39
|
+
export declare function stepState(index: number, current: number): StepperStepState;
|
|
40
|
+
//# sourceMappingURL=stepper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepper.d.ts","sourceRoot":"","sources":["../../../src/components/util/stepper.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAE3G,qGAAqG;AACrG,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,6GAA6G;IAC7G,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,2CAA2C;AAC3C,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,WAAW,CAAC;AAE/C,mCAAmC;AACnC,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,CAAC;AAEpE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAExD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC3B,4DAA4D;IAC5D,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD;;;OAGG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,KAAK,MAAM,CAAC;IAC3F,iFAAiF;IACjF,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACxE;AAQD,eAAO,MAAM,eAAe,EAAE,cAK7B,CAAC;AAEF,6CAA6C;AAC7C,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,WAAW,EAAE,CAE9F;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAMnF;AAED,sFAAsF;AACtF,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAG1E"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Component } from "svelte";
|
|
2
|
+
/** Public types and shared state for `SwipeableListItem`. */
|
|
3
|
+
/** One action behind a row, such as Delete. */
|
|
4
|
+
export interface SwipeableListItemAction {
|
|
5
|
+
id: string;
|
|
6
|
+
/** The button's text, and its accessible name. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Drawn above the label. */
|
|
9
|
+
icon?: Component<{
|
|
10
|
+
size?: number;
|
|
11
|
+
class?: string;
|
|
12
|
+
}>;
|
|
13
|
+
/** `danger` for an action that destroys something. */
|
|
14
|
+
tone?: "default" | "danger";
|
|
15
|
+
/** Runs when the button is pressed. The row closes afterwards. */
|
|
16
|
+
onselect: () => void;
|
|
17
|
+
}
|
|
18
|
+
/** The words a `SwipeableListItem` says by itself. */
|
|
19
|
+
export interface SwipeableListItemStrings {
|
|
20
|
+
/** Accessible name of the button that opens the row's actions, and of the group they are in. */
|
|
21
|
+
actions: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const DEFAULT_SWIPEABLE_LIST_ITEM_STRINGS: SwipeableListItemStrings;
|
|
24
|
+
/**
|
|
25
|
+
* Says that a row has opened: every other open row in the same list closes.
|
|
26
|
+
* Returns what to call when this row closes or goes away.
|
|
27
|
+
*/
|
|
28
|
+
export declare function registerOpenRow(root: HTMLElement, close: () => void): () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Where a swipe ends: open or closed. A flick decides by its direction,
|
|
31
|
+
* whatever the distance; otherwise the row goes to whichever is nearer.
|
|
32
|
+
* `revealed` and `width` are px of the actions; `velocity` is px per ms,
|
|
33
|
+
* positive towards revealing.
|
|
34
|
+
*/
|
|
35
|
+
export declare function settleSwipe(revealed: number, width: number, velocity: number, flick: number): boolean;
|
|
36
|
+
//# sourceMappingURL=swipeable-list-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swipeable-list-item.d.ts","sourceRoot":"","sources":["../../../src/components/util/swipeable-list-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,6DAA6D;AAE7D,+CAA+C;AAC/C,MAAM,WAAW,uBAAuB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,IAAI,CAAC,EAAE,SAAS,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpD,sDAAsD;IACtD,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,kEAAkE;IAClE,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,sDAAsD;AACtD,MAAM,WAAW,wBAAwB;IACrC,gGAAgG;IAChG,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,mCAAmC,EAAE,wBAEjD,CAAC;AAaF;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAQhF;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAGrG"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What DateField and TimeField share once they are given a `locale`: the
|
|
3
|
+
* words, and the pure parts of the time picker (which hours and minutes
|
|
4
|
+
* there are, which are outside `min` and `max`).
|
|
5
|
+
*/
|
|
6
|
+
/** The words DateField says when it has a `locale`. Replace any of them to translate. */
|
|
7
|
+
export interface DateFieldStrings {
|
|
8
|
+
/** The sheet's action that empties the field. Shown while the field has a value and is not `required`. */
|
|
9
|
+
clear: string;
|
|
10
|
+
/** The sheet's name when the field has no label. */
|
|
11
|
+
chooseDate: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const DATE_FIELD_STRINGS: DateFieldStrings;
|
|
14
|
+
/** The words TimeField says when it has a `locale`. Replace any of them to translate. */
|
|
15
|
+
export interface TimeFieldStrings {
|
|
16
|
+
/** The sheet's action that empties the field. Shown while the field has a value and is not `required`. */
|
|
17
|
+
clear: string;
|
|
18
|
+
/** The sheet's action that sets the chosen time and closes it. */
|
|
19
|
+
done: string;
|
|
20
|
+
/** Accessible name of the column of hours. */
|
|
21
|
+
hours: string;
|
|
22
|
+
/** Accessible name of the column of minutes. */
|
|
23
|
+
minutes: string;
|
|
24
|
+
/** The sheet's words beside Done for the time Done will set: "Chosen time 18:00". */
|
|
25
|
+
chosenTime: string;
|
|
26
|
+
/** The sheet's name when the field has no label. */
|
|
27
|
+
chooseTime: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const TIME_FIELD_STRINGS: TimeFieldStrings;
|
|
30
|
+
/** Whether a `locale` was given: a tag, or a list with at least one. */
|
|
31
|
+
export declare function hasLocale(locale: string | string[] | undefined | null): boolean;
|
|
32
|
+
/** The minutes between choices when the app says nothing: five. */
|
|
33
|
+
export declare const DEFAULT_MINUTE_STEP = 5;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the library's time picker can serve this `step`. It has hours and
|
|
36
|
+
* minutes only, so a step in seconds (under 60) or `"any"` is left to the
|
|
37
|
+
* platform's own picker.
|
|
38
|
+
*/
|
|
39
|
+
export declare function stepFitsLibraryPicker(step: number | "any" | undefined): boolean;
|
|
40
|
+
/** `step` (in seconds) as whole minutes between choices; five without one. */
|
|
41
|
+
export declare function minuteStep(step: number | "any" | undefined): number;
|
|
42
|
+
/** `"19:30"` (or `"19:30:15"`) as [19, 30]; null for anything else. */
|
|
43
|
+
export declare function parseHourMinute(value: string | null | undefined): [number, number] | null;
|
|
44
|
+
/**
|
|
45
|
+
* The time an empty field's columns stand at: `openAt`, else `now` (an
|
|
46
|
+
* hour and a minute), kept within `min` and `max` and on the minute step.
|
|
47
|
+
* Only a place to scroll to; nothing is chosen. Two-digit strings, as the
|
|
48
|
+
* columns' option values.
|
|
49
|
+
*/
|
|
50
|
+
export declare function openingTime(options: {
|
|
51
|
+
openAt?: string;
|
|
52
|
+
now: [number, number];
|
|
53
|
+
stepMinutes: number;
|
|
54
|
+
min?: string;
|
|
55
|
+
max?: string;
|
|
56
|
+
}): [string, string];
|
|
57
|
+
/**
|
|
58
|
+
* Whether a time is within `min` and `max`, either of which may be missing.
|
|
59
|
+
* Like the native input, a `min` later than `max` is a range over midnight:
|
|
60
|
+
* 22:00 to 06:00 allows 23:30 and 05:00.
|
|
61
|
+
*/
|
|
62
|
+
export declare function timeInRange(hour: number, minute: number, min?: string, max?: string): boolean;
|
|
63
|
+
export interface TimeChoice {
|
|
64
|
+
/** Two digits: `"07"`. */
|
|
65
|
+
value: string;
|
|
66
|
+
label: string;
|
|
67
|
+
disabled: boolean;
|
|
68
|
+
}
|
|
69
|
+
/** The hour as the locale writes it: "19" in Swedish, "7 PM" in American English. */
|
|
70
|
+
export declare function hourLabel(hour: number, locale: string | string[] | undefined): string;
|
|
71
|
+
/** The minute as two digits, in the locale's own numerals. */
|
|
72
|
+
export declare function minuteLabel(minute: number, locale: string | string[] | undefined): string;
|
|
73
|
+
/** The 24 hours. An hour is disabled when no time in it is within `min` and `max`. */
|
|
74
|
+
export declare function hourChoices(locale: string | string[] | undefined, min?: string, max?: string): TimeChoice[];
|
|
75
|
+
/**
|
|
76
|
+
* The minutes of one hour: every `stepMinutes`, plus the minute of `current`
|
|
77
|
+
* when it is not on the step, so a value such as 19:07 can be kept. A minute
|
|
78
|
+
* is disabled when the time is outside `min` and `max`; with no hour chosen
|
|
79
|
+
* none is.
|
|
80
|
+
*/
|
|
81
|
+
export declare function minuteChoices(options: {
|
|
82
|
+
locale: string | string[] | undefined;
|
|
83
|
+
stepMinutes: number;
|
|
84
|
+
hour: string;
|
|
85
|
+
current?: string;
|
|
86
|
+
min?: string;
|
|
87
|
+
max?: string;
|
|
88
|
+
}): TimeChoice[];
|
|
89
|
+
//# sourceMappingURL=temporal-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"temporal-field.d.ts","sourceRoot":"","sources":["../../../src/components/util/temporal-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,yFAAyF;AACzF,MAAM,WAAW,gBAAgB;IAC7B,0GAA0G;IAC1G,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,kBAAkB,EAAE,gBAGhC,CAAC;AAEF,yFAAyF;AACzF,MAAM,WAAW,gBAAgB;IAC7B,0GAA0G;IAC1G,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,UAAU,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,kBAAkB,EAAE,gBAOhC,CAAC;AAEF,wEAAwE;AACxE,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAE/E;AAED,mEAAmE;AACnE,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,CAG/E;AAED,8EAA8E;AAC9E,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,CAGnE;AAID,uEAAuE;AACvE,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAMzF;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAgBnB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAU7F;AAED,MAAM,WAAW,UAAU;IACvB,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,qFAAqF;AACrF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,CAErF;AAED,8DAA8D;AAC9D,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,CAMzF;AAED,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,UAAU,EAAE,CAM3G;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE;IACnC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,UAAU,EAAE,CAcf"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The page's theme mode, read and written in one place.
|
|
3
|
+
*
|
|
4
|
+
* The theme is switched on `<html>`: `data-theme="auto" | "light" | "dark"`,
|
|
5
|
+
* or the older `dark` class (THEMING.md, "Light, dark and auto"). ThemeToggle
|
|
6
|
+
* uses these helpers, and so can an app that renders a control of its own, a
|
|
7
|
+
* SegmentedControl with three options for instance: both then read and write
|
|
8
|
+
* the same attribute, and ThemeToggle follows whatever the other one sets.
|
|
9
|
+
*
|
|
10
|
+
* Everything here is safe to call on the server: without a document the
|
|
11
|
+
* readers return the default and the writers do nothing.
|
|
12
|
+
*/
|
|
13
|
+
/** `"auto"` follows the system; the other two are a choice. */
|
|
14
|
+
export type ThemeMode = "auto" | "light" | "dark";
|
|
15
|
+
/** The modes in the order a three-way ThemeToggle steps through them. */
|
|
16
|
+
export declare const THEME_MODES: readonly ThemeMode[];
|
|
17
|
+
/** Where the choice is kept in `localStorage` unless a key is given. The key ThemeToggle has always used. */
|
|
18
|
+
export declare const DEFAULT_THEME_STORAGE_KEY = "theme";
|
|
19
|
+
/** The texts ThemeToggle builds its accessible name from. Pass any of them as `labels`. */
|
|
20
|
+
export interface ThemeToggleLabels {
|
|
21
|
+
/** What `"auto"` is called, with three modes. Default `"system"`. */
|
|
22
|
+
auto: string;
|
|
23
|
+
/** Default `"light"`. */
|
|
24
|
+
light: string;
|
|
25
|
+
/** Default `"dark"`. */
|
|
26
|
+
dark: string;
|
|
27
|
+
/**
|
|
28
|
+
* The name with three modes, from the current mode's word and the next
|
|
29
|
+
* one's. Default: "Theme: system. Switch to light".
|
|
30
|
+
*/
|
|
31
|
+
describe: (current: string, next: string) => string;
|
|
32
|
+
/**
|
|
33
|
+
* The name with two modes. It does not change: the button is a switch, and
|
|
34
|
+
* `aria-pressed` says whether dark is on. Default "Dark mode".
|
|
35
|
+
*/
|
|
36
|
+
darkMode: string;
|
|
37
|
+
/** The name before the button mounts, when the mode is not known yet. Default "Theme toggle". */
|
|
38
|
+
beforeMount: string;
|
|
39
|
+
}
|
|
40
|
+
export declare function isThemeMode(value: unknown): value is ThemeMode;
|
|
41
|
+
/**
|
|
42
|
+
* The mode the page is in. `data-theme` says it outright; a page without the
|
|
43
|
+
* attribute is dark with the `dark` class and light without it (such a page
|
|
44
|
+
* does not follow the system, so it is never `"auto"`).
|
|
45
|
+
*/
|
|
46
|
+
export declare function getThemeMode(): ThemeMode;
|
|
47
|
+
/** Whether the page is dark right now: by the class, by `data-theme="dark"`, or by `auto` on a dark system. */
|
|
48
|
+
export declare function isThemeDark(): boolean;
|
|
49
|
+
export interface SetThemeModeOptions {
|
|
50
|
+
/**
|
|
51
|
+
* Where to keep the choice in `localStorage`. Default `"theme"`; `null`
|
|
52
|
+
* keeps nothing (an app that stores the choice in its own backend).
|
|
53
|
+
*/
|
|
54
|
+
storageKey?: string | null;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Puts the page in `mode` by writing `data-theme` on `<html>`, and remembers
|
|
58
|
+
* it. A leftover `dark` class and an inline `color-scheme` are removed: either
|
|
59
|
+
* would hold the page dark, or its native controls, under another mode. The
|
|
60
|
+
* theme sets `color-scheme` for each value of the attribute.
|
|
61
|
+
*/
|
|
62
|
+
export declare function setThemeMode(mode: ThemeMode, options?: SetThemeModeOptions): void;
|
|
63
|
+
/** The stored choice, or `null` when there is none, it is not a mode, or `storageKey` is `null`. */
|
|
64
|
+
export declare function getStoredThemeMode(storageKey?: string | null): ThemeMode | null;
|
|
65
|
+
/** Remembers `mode` under `storageKey` (default `"theme"`); `null` keeps nothing. */
|
|
66
|
+
export declare function storeThemeMode(mode: ThemeMode, storageKey?: string | null): void;
|
|
67
|
+
/**
|
|
68
|
+
* A script for `<head>` that applies the stored mode before the first paint,
|
|
69
|
+
* so a returning visitor does not see the other theme flash by. Returns the
|
|
70
|
+
* source as a string; it has no dependencies and can be inlined as it is.
|
|
71
|
+
*
|
|
72
|
+
* It writes to whichever mechanism the page uses, as ThemeToggle does:
|
|
73
|
+
* `data-theme` when `<html>` already has the attribute or the stored mode is
|
|
74
|
+
* `"auto"`, and the `dark` class otherwise. With nothing stored it does
|
|
75
|
+
* nothing, and the markup's own `data-theme` (or its absence) stands.
|
|
76
|
+
*
|
|
77
|
+
* The key is written into the script as a JSON string, so any key is safe.
|
|
78
|
+
*/
|
|
79
|
+
export declare function themeInitScript(storageKey?: string): string;
|
|
80
|
+
//# sourceMappingURL=theme-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-mode.d.ts","sourceRoot":"","sources":["../../../src/components/util/theme-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,+DAA+D;AAC/D,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAElD,yEAAyE;AACzE,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EAA8B,CAAC;AAE3E,6GAA6G;AAC7G,eAAO,MAAM,yBAAyB,UAAU,CAAC;AAEjD,2FAA2F;AAC3F,MAAM,WAAW,iBAAiB;IAC9B,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACpD;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,iGAAiG;IACjG,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE9D;AAeD;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAMxC;AAED,+GAA+G;AAC/G,wBAAgB,WAAW,IAAI,OAAO,CAUrC;AAED,MAAM,WAAW,mBAAmB;IAChC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,GAAE,mBAAwB,GAAG,IAAI,CAQrF;AAED,oGAAoG;AACpG,wBAAgB,kBAAkB,CAAC,UAAU,GAAE,MAAM,GAAG,IAAgC,GAAG,SAAS,GAAG,IAAI,CAQ1G;AAED,qFAAqF;AACrF,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,GAAE,MAAM,GAAG,IAAgC,GAAG,IAAI,CAO3G;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,UAAU,GAAE,MAAkC,GAAG,MAAM,CAWtF"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every word a `Toaster` says by itself. An app in another language passes
|
|
3
|
+
* its own through `strings`; what it leaves out stays as it is here.
|
|
4
|
+
*/
|
|
5
|
+
export interface ToasterStrings {
|
|
6
|
+
/** Accessible name of the region the toasts are in. */
|
|
7
|
+
regionLabel: string;
|
|
8
|
+
/**
|
|
9
|
+
* What a toast says when it was pushed with neither a `title` nor a
|
|
10
|
+
* `message`, by type. A toast with a message shows the message.
|
|
11
|
+
*/
|
|
12
|
+
successTitle: string;
|
|
13
|
+
errorTitle: string;
|
|
14
|
+
warningTitle: string;
|
|
15
|
+
infoTitle: string;
|
|
16
|
+
/** The time a toast has left, while its timer runs. */
|
|
17
|
+
closesIn: (seconds: number) => string;
|
|
18
|
+
/** The same, while a pointer, a finger or focus holds the timer. */
|
|
19
|
+
pausedClosesIn: (seconds: number) => string;
|
|
20
|
+
/** The button that stops the timer; shown with `showCountdown`. */
|
|
21
|
+
stop: string;
|
|
22
|
+
/** The button under a toast's opened details, which closes them again. */
|
|
23
|
+
okay: string;
|
|
24
|
+
/** Accessible name of the button that opens a toast's details. */
|
|
25
|
+
expand: string;
|
|
26
|
+
/** The same button, once they are open. */
|
|
27
|
+
collapse: string;
|
|
28
|
+
/** Accessible name of the button that dismisses a toast. */
|
|
29
|
+
dismiss: string;
|
|
30
|
+
/**
|
|
31
|
+
* Read after a toast's text when it has an action, so a screen reader
|
|
32
|
+
* user hears that there is one. `label` is the action's own.
|
|
33
|
+
*/
|
|
34
|
+
actionAvailable: (label: string) => string;
|
|
35
|
+
}
|
|
36
|
+
export declare const DEFAULT_TOASTER_STRINGS: ToasterStrings;
|
|
37
|
+
/**
|
|
38
|
+
* The three lengths a toast can be given by name, in milliseconds.
|
|
39
|
+
*
|
|
40
|
+
* `short` (3 s) is for a few words that need no reading time ("Saved").
|
|
41
|
+
* Anything a person has to read is `medium` (7 s) or `long` (14 s). What
|
|
42
|
+
* they have to act on, and an error, should stay: `"persistent"`.
|
|
43
|
+
*/
|
|
44
|
+
export declare const TOAST_DURATIONS: {
|
|
45
|
+
readonly short: 3000;
|
|
46
|
+
readonly medium: 7000;
|
|
47
|
+
readonly long: 14000;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* How long a toast stays: one of the named lengths, `"persistent"` (until it
|
|
51
|
+
* is dismissed), or a number of milliseconds, where `0` is persistent too.
|
|
52
|
+
*/
|
|
53
|
+
export type ToastDuration = keyof typeof TOAST_DURATIONS | "persistent" | number;
|
|
54
|
+
/**
|
|
55
|
+
* A toast with more visible text than this (title and message together) gets
|
|
56
|
+
* `long` when the app gave it no duration.
|
|
57
|
+
*/
|
|
58
|
+
export declare const TOAST_LONG_TEXT_LENGTH = 120;
|
|
59
|
+
/**
|
|
60
|
+
* And one with more than this stays until it is dismissed: `long` was
|
|
61
|
+
* measured as too short to read it in, and nothing longer has a name.
|
|
62
|
+
*/
|
|
63
|
+
export declare const TOAST_PERSISTENT_TEXT_LENGTH = 240;
|
|
64
|
+
/**
|
|
65
|
+
* How long a toast stays, in milliseconds; `0` is until it is dismissed.
|
|
66
|
+
*
|
|
67
|
+
* What the app said for the toast wins, whatever the toast is. When it said
|
|
68
|
+
* nothing: an error stays, and so does a toast with an action, since the user
|
|
69
|
+
* has to be able to reach the button. So does a text longer than
|
|
70
|
+
* `TOAST_PERSISTENT_TEXT_LENGTH`, whatever the Toaster's default. Everything
|
|
71
|
+
* else gets the Toaster's `defaultDuration`, or `medium` without one; a text
|
|
72
|
+
* longer than `TOAST_LONG_TEXT_LENGTH` gets `long`, unless the default is
|
|
73
|
+
* longer still.
|
|
74
|
+
*/
|
|
75
|
+
export declare function resolveToastDuration(toast: {
|
|
76
|
+
duration?: ToastDuration;
|
|
77
|
+
type: string;
|
|
78
|
+
hasAction: boolean;
|
|
79
|
+
textLength: number;
|
|
80
|
+
}, defaultDuration?: ToastDuration): number;
|
|
81
|
+
/**
|
|
82
|
+
* The least a toast has left when a finger that held it lifts, in seconds.
|
|
83
|
+
* As long as `short`: holding a short toast starts it again, in effect.
|
|
84
|
+
*/
|
|
85
|
+
export declare const TOAST_SECONDS_AFTER_HOLD = 3;
|
|
86
|
+
/** What `onpausechange` of a `Toaster` is called with. */
|
|
87
|
+
export interface ToastPauseChange {
|
|
88
|
+
/** The id of the toast, as `pushToast` returned it. */
|
|
89
|
+
id: string;
|
|
90
|
+
/** True while a pointer is over the toast, a finger is on it, or focus is inside it. */
|
|
91
|
+
paused: boolean;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* How a `Toaster` presents its toasts. `"stack"` is the stack in the corner
|
|
95
|
+
* (and across the width on a phone); `"snackbar"` is the compact form for a
|
|
96
|
+
* phone, one at a time, docked above whatever is at the bottom; `"auto"` is
|
|
97
|
+
* the snackbar below 640px and the stack from there up.
|
|
98
|
+
*/
|
|
99
|
+
export type ToasterMode = "stack" | "snackbar" | "auto";
|
|
100
|
+
/** The words of a toast on screen: its first line, and the line under it if there is one. */
|
|
101
|
+
export declare function toastTexts(toast: {
|
|
102
|
+
title?: string;
|
|
103
|
+
message: string;
|
|
104
|
+
type: string;
|
|
105
|
+
}, strings: Pick<ToasterStrings, "successTitle" | "errorTitle" | "warningTitle" | "infoTitle">): {
|
|
106
|
+
title: string;
|
|
107
|
+
message: string;
|
|
108
|
+
headerTitle: string;
|
|
109
|
+
secondLine: string;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* True when the toast has to stay until a person has dealt with it, which
|
|
113
|
+
* makes it the one a `max` never drops: an error, one with an action, one
|
|
114
|
+
* with no end (`"persistent"`, or text too long to read in `long`).
|
|
115
|
+
*/
|
|
116
|
+
export declare function toastStays(toast: {
|
|
117
|
+
title?: string;
|
|
118
|
+
message: string;
|
|
119
|
+
type: string;
|
|
120
|
+
duration?: ToastDuration;
|
|
121
|
+
action?: unknown;
|
|
122
|
+
}, defaultDuration?: ToastDuration): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Ids of toasts that a `max` is dropping to make room for a newer one. Such a
|
|
125
|
+
* toast leaves at once, without the exit motion: a newer toast is coming in
|
|
126
|
+
* where it is, and the two would otherwise lie on each other for a moment.
|
|
127
|
+
*/
|
|
128
|
+
export declare const toastsReplaced: Set<string>;
|
|
129
|
+
/** The Material standard curve (`--ease-standard`), as an easing function for a script-driven slide. */
|
|
130
|
+
export declare function easeStandard(t: number): number;
|
|
131
|
+
/** A toast dragged further than this share of its width is dismissed, flick or not. */
|
|
132
|
+
export declare const TOAST_SWIPE_DISMISS_FRACTION = 0.4;
|
|
133
|
+
//# sourceMappingURL=toaster.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toaster.d.ts","sourceRoot":"","sources":["../../../src/components/util/toaster.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC3B,uDAAuD;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IACtC,oEAAoE;IACpE,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC9C;AAED,eAAO,MAAM,uBAAuB,EAAE,cAcrC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe;;;;CAAsD,CAAC;AAEnF;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,eAAe,GAAG,YAAY,GAAG,MAAM,CAAC;AAEjF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAchD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAChC,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,EACzF,eAAe,CAAC,EAAE,aAAa,GAChC,MAAM,CAQR;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,0DAA0D;AAC1D,MAAM,WAAW,gBAAgB;IAC7B,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,wFAAwF;IACxF,MAAM,EAAE,OAAO,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;AAExD,6FAA6F;AAC7F,wBAAgB,UAAU,CACtB,KAAK,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACxD,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,cAAc,GAAG,YAAY,GAAG,cAAc,GAAG,WAAW,CAAC,GAC5F;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAmB7E;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACtB,KAAK,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,aAAa,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,EACpG,eAAe,CAAC,EAAE,aAAa,GAChC,OAAO,CAUT;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,aAAoB,CAAC;AAEhD,wGAAwG;AACxG,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAY9C;AAED,uFAAuF;AACvF,eAAO,MAAM,4BAA4B,MAAM,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { SurfaceTone } from "../types/variants.js";
|
|
2
|
+
export type ToneSurfaceOptions = {
|
|
3
|
+
tone?: SurfaceTone;
|
|
4
|
+
/** Any CSS colour for a fill the app chooses, such as `var(--group-colour)`. Wins over `tone`. */
|
|
5
|
+
fill?: string;
|
|
6
|
+
/** The label colour on `fill`, any CSS colour. Without it the label is the block's own text colour. */
|
|
7
|
+
onFill?: string;
|
|
8
|
+
};
|
|
9
|
+
export type ToneSurface = {
|
|
10
|
+
/** Utility classes for the fill and its on-colour scope; empty for `neutral`. */
|
|
11
|
+
classes: string;
|
|
12
|
+
/** Inline style for a custom fill, or undefined. */
|
|
13
|
+
style: string | undefined;
|
|
14
|
+
/** True when the surface is filled by tone or by `fill`, so the fill is its edge. */
|
|
15
|
+
filled: boolean;
|
|
16
|
+
/** True when the fill is the brand, the accent or a custom colour (the on-colour scope applies). */
|
|
17
|
+
scoped: boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The classes and the inline style for a filled surface, shared by Card and Block.
|
|
21
|
+
*
|
|
22
|
+
* - `neutral` (the default): nothing, the component paints what it always did.
|
|
23
|
+
* - `tint`: the brand tint as a content surface. Text, links and rings are
|
|
24
|
+
* guarded on it, so it needs no on-colour scope.
|
|
25
|
+
* - `brand` / `accent`: the fill and its `on-brand` / `on-accent` scope.
|
|
26
|
+
* - `fill`: the app's own colour. Wins over `tone`. The scope is `on-fill`,
|
|
27
|
+
* with `onFill` as the label colour.
|
|
28
|
+
*
|
|
29
|
+
* The library cannot check the contrast of a `fill` and `onFill` pair: it is
|
|
30
|
+
* a colour the app picks at run time, so the app must hold the label to 4.5:1
|
|
31
|
+
* on the fill (3:1 for edges and focus rings).
|
|
32
|
+
*/
|
|
33
|
+
export declare function toneSurface({ tone, fill, onFill }: ToneSurfaceOptions): ToneSurface;
|
|
34
|
+
//# sourceMappingURL=tone-surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tone-surface.d.ts","sourceRoot":"","sources":["../../../src/components/util/tone-surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,kGAAkG;IAClG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uGAAuG;IACvG,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACtB,iFAAiF;IACjF,OAAO,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,qFAAqF;IACrF,MAAM,EAAE,OAAO,CAAC;IAChB,oGAAoG;IACpG,MAAM,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,EAAE,IAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,kBAAkB,GAAG,WAAW,CAmB/F"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One tooltip at a time. A tooltip that opens closes the one that was open: a
|
|
3
|
+
* mouse resting on one trigger while Tab moves focus to another would
|
|
4
|
+
* otherwise show both, one of them stale.
|
|
5
|
+
*/
|
|
6
|
+
/** Called by a tooltip as it opens, with what closes it. Closes any other. */
|
|
7
|
+
export declare function claimOpenTooltip(close: () => void): void;
|
|
8
|
+
/** Called by a tooltip as it closes or goes. */
|
|
9
|
+
export declare function releaseOpenTooltip(close: () => void): void;
|
|
10
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/util/tooltip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI,CAGxD;AAED,gDAAgD;AAChD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,IAAI,GAAG,IAAI,CAE1D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** The words `TopNavbar` says by itself. Pass any of them as `strings`. */
|
|
2
|
+
export interface TopNavbarStrings {
|
|
3
|
+
/** Accessible name of the phone menu's button while the menu is closed. */
|
|
4
|
+
openMenu: string;
|
|
5
|
+
/** The same button, while the inline menu is open (the sheet's own button closes it). */
|
|
6
|
+
closeMenu: string;
|
|
7
|
+
/** The phone menu's sheet: its heading and its accessible name, and the name of the links' `nav` when the bar has no `ariaLabel`. */
|
|
8
|
+
menuTitle?: string;
|
|
9
|
+
/** The heading over the theme choice in the phone menu's sheet. */
|
|
10
|
+
themeHeading?: string;
|
|
11
|
+
/** Read after the label of a link that opens in a new tab. */
|
|
12
|
+
opensInNewTab: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Every word, including the optional ones: `menuTitle` and `themeHeading` are
|
|
16
|
+
* optional in `TopNavbarStrings` so that code written before they existed, with
|
|
17
|
+
* a complete object, still type-checks.
|
|
18
|
+
*/
|
|
19
|
+
export declare const DEFAULT_TOP_NAVBAR_STRINGS: Required<TopNavbarStrings>;
|
|
20
|
+
/**
|
|
21
|
+
* Where a piece of the bar's `actions` is drawn: in the `bar`, or in the
|
|
22
|
+
* `menu` sheet that opens below `collapseAt`, where it has the full width.
|
|
23
|
+
*/
|
|
24
|
+
export type TopNavbarPlace = "bar" | "menu";
|
|
25
|
+
/** Called by the sheet's content: everything rendered inside it reads `"menu"`. */
|
|
26
|
+
export declare function markTopNavbarPlace(place: TopNavbarPlace): void;
|
|
27
|
+
/**
|
|
28
|
+
* Where the component calling this is drawn. Call it while the component
|
|
29
|
+
* initialises. A control in a TopNavbar's `actions` snippet can then draw
|
|
30
|
+
* itself large in the sheet and compact in the bar, with no argument to the
|
|
31
|
+
* snippet: `{#snippet actions()}<MyPicker />{/snippet}` keeps working. Outside
|
|
32
|
+
* a TopNavbar, in the bar and in `menu="inline"` it is `"bar"`.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getTopNavbarPlace(): TopNavbarPlace;
|
|
35
|
+
//# sourceMappingURL=top-navbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"top-navbar.d.ts","sourceRoot":"","sources":["../../../src/components/util/top-navbar.ts"],"names":[],"mappings":"AAEA,2EAA2E;AAC3E,MAAM,WAAW,gBAAgB;IAC7B,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;IACjB,yFAAyF;IACzF,SAAS,EAAE,MAAM,CAAC;IAClB,qIAAqI;IACrI,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,aAAa,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,gBAAgB,CAMjE,CAAC;AAIF;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,MAAM,CAAC;AAE5C,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAE9D;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,CAElD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Touch targets: 44 by 44px on a coarse pointer, nothing changed on a fine one.
|
|
3
|
+
*
|
|
4
|
+
* There are two ways to get there, and which one a control takes depends on
|
|
5
|
+
* what stands beside it.
|
|
6
|
+
*
|
|
7
|
+
* 1. The control itself grows: `pointer-coarse:min-h-11` (and `min-w-11` for a
|
|
8
|
+
* square one), written where the size is. Button, IconButton, Input and
|
|
9
|
+
* Select do this at `sm` and `md`, so a row of them still lines up; so does
|
|
10
|
+
* any control that has a neighbour close by (the handle and the move
|
|
11
|
+
* buttons of a SortableList row). `scripts/check-control-geometry.js` holds
|
|
12
|
+
* the shared controls to it.
|
|
13
|
+
*
|
|
14
|
+
* 2. The control keeps its size and an invisible layer around it takes the
|
|
15
|
+
* touch: `TOUCH_HIT_AREA` below. Only for a control that stands alone, with
|
|
16
|
+
* nothing pressable within about 10px: a close button in the corner of an
|
|
17
|
+
* Alert or in the header of a Modal, the switch of a Toggle. The layer
|
|
18
|
+
* reaches past the visible box, so beside another control it would cover
|
|
19
|
+
* that control's edge and a tap there would fire the wrong one. An `xs`
|
|
20
|
+
* IconButton had such a layer and lost it for that reason. A Toggle is
|
|
21
|
+
* stacked in settings lists, so its row is 44px tall on a coarse pointer:
|
|
22
|
+
* the layer of one switch then never reaches the switch above or below.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* An invisible hit area of at least 44 by 44px, centred on the element, on a
|
|
26
|
+
* coarse pointer only. The element must be positioned (`relative`, `absolute`
|
|
27
|
+
* or `fixed`; `pointer-coarse:relative` where it was not positioned before, so
|
|
28
|
+
* a fine pointer sees no change) and must not clip its overflow.
|
|
29
|
+
*/
|
|
30
|
+
export declare const TOUCH_HIT_AREA = "pointer-coarse:before:absolute pointer-coarse:before:top-1/2 pointer-coarse:before:left-1/2 pointer-coarse:before:size-full pointer-coarse:before:min-h-11 pointer-coarse:before:min-w-11 pointer-coarse:before:-translate-x-1/2 pointer-coarse:before:-translate-y-1/2 pointer-coarse:before:content-['']";
|
|
31
|
+
//# sourceMappingURL=touch-target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"touch-target.d.ts","sourceRoot":"","sources":["../../../src/components/util/touch-target.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,cAAc,+SACqR,CAAC"}
|