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,39 @@
|
|
|
1
|
+
/** Types and pure helpers for `Avatar` and `AvatarGroup`. Kept out of the components so they can be tested without a DOM. */
|
|
2
|
+
/** Diameter of the circle: 24, 32 and 48px. */
|
|
3
|
+
export type AvatarSize = "sm" | "md" | "lg";
|
|
4
|
+
import type { Snippet } from "svelte";
|
|
5
|
+
/** One person in an `AvatarGroup`. */
|
|
6
|
+
export interface AvatarPerson {
|
|
7
|
+
name: string;
|
|
8
|
+
/** Address of the picture. Without it, or when it fails to load, the initials show. */
|
|
9
|
+
src?: string;
|
|
10
|
+
/** The picture drawn in the circle, instead of `src` and the initials: an inline SVG. See `Avatar` `children`. */
|
|
11
|
+
picture?: Snippet;
|
|
12
|
+
}
|
|
13
|
+
/** Every built-in string of `AvatarGroup`. Pass a partial object to `strings` to translate. */
|
|
14
|
+
export interface AvatarGroupStrings {
|
|
15
|
+
/**
|
|
16
|
+
* Accessible name of the "+3" at the end: how many people are not shown,
|
|
17
|
+
* and their names, for an app that wants to read them out.
|
|
18
|
+
*/
|
|
19
|
+
more: (count: number, names: string[]) => string;
|
|
20
|
+
}
|
|
21
|
+
export declare const DEFAULT_AVATAR_GROUP_STRINGS: AvatarGroupStrings;
|
|
22
|
+
/**
|
|
23
|
+
* The initials shown for `name`: the first letter of its first word and of
|
|
24
|
+
* its last, upper-cased for `locale`; one letter for a name of one word; `""`
|
|
25
|
+
* for a name with no words, which is drawn as an icon and never as "?".
|
|
26
|
+
*/
|
|
27
|
+
export declare function initialsOf(name: string | null | undefined, locale?: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* How an `AvatarGroup` of `total` people splits at `max`: how many are
|
|
30
|
+
* shown, and how many stand behind the "+N".
|
|
31
|
+
*
|
|
32
|
+
* `max` below 1 is 1. One person too many is shown and not counted: a "+1"
|
|
33
|
+
* takes the room of the person it hides.
|
|
34
|
+
*/
|
|
35
|
+
export declare function splitGroup(total: number, max: number): {
|
|
36
|
+
shown: number;
|
|
37
|
+
hidden: number;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/components/util/avatar.ts"],"names":[],"mappings":"AAAA,6HAA6H;AAE7H,+CAA+C;AAC/C,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,sCAAsC;AACtC,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,uFAAuF;IACvF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kHAAkH;IAClH,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,+FAA+F;AAC/F,MAAM,WAAW,kBAAkB;IAC/B;;;OAGG;IACH,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC;CACpD;AAED,eAAO,MAAM,4BAA4B,EAAE,kBAE1C,CAAC;AAuBF;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAMnF;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAIxF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Public types and pure helpers for `BottomSheet`. */
|
|
2
|
+
/** A height the sheet rests at: half the screen, or all of it below the status bar. */
|
|
3
|
+
export type BottomSheetSnap = "half" | "full";
|
|
4
|
+
/** What the user did to close the sheet. `swipe` is a drag or flick downwards. */
|
|
5
|
+
export type BottomSheetCloseReason = "escape" | "backdrop" | "close-button" | "swipe";
|
|
6
|
+
/** The snap points in use, lowest first, without repeats or unknown values. */
|
|
7
|
+
export declare function normaliseSnapPoints(points: readonly BottomSheetSnap[] | undefined): BottomSheetSnap[];
|
|
8
|
+
/**
|
|
9
|
+
* Where the grip's button takes the sheet: up a step, and from the top back
|
|
10
|
+
* down. Null when there is only one snap point, so nowhere to go.
|
|
11
|
+
*/
|
|
12
|
+
export declare function nextSnap(points: readonly BottomSheetSnap[], current: BottomSheetSnap): BottomSheetSnap | null;
|
|
13
|
+
/**
|
|
14
|
+
* Where a released sheet settles. `heights` are the px heights of the snap
|
|
15
|
+
* points, lowest first; `height` is how much of the sheet shows at release.
|
|
16
|
+
* A flick goes one step in its direction from where the drag began; a slow
|
|
17
|
+
* release goes to whatever is nearest, with "closed" at height 0.
|
|
18
|
+
*
|
|
19
|
+
* Returns the index into `heights`, or -1 for closed.
|
|
20
|
+
*/
|
|
21
|
+
export declare function settleSnap(options: {
|
|
22
|
+
heights: readonly number[];
|
|
23
|
+
startIndex: number;
|
|
24
|
+
height: number;
|
|
25
|
+
/** px per ms, positive is down. */
|
|
26
|
+
velocity: number;
|
|
27
|
+
flick: number;
|
|
28
|
+
canClose: boolean;
|
|
29
|
+
}): number;
|
|
30
|
+
//# sourceMappingURL=bottom-sheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bottom-sheet.d.ts","sourceRoot":"","sources":["../../../src/components/util/bottom-sheet.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,uFAAuF;AACvF,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9C,kFAAkF;AAClF,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,UAAU,GAAG,cAAc,GAAG,OAAO,CAAC;AAItF,+EAA+E;AAC/E,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,GAAG,SAAS,GAAG,eAAe,EAAE,CAGrG;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CACpB,MAAM,EAAE,SAAS,eAAe,EAAE,EAClC,OAAO,EAAE,eAAe,GACzB,eAAe,GAAG,IAAI,CAIxB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE;IAChC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACrB,GAAG,MAAM,CAgBT"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** Public types and pure helpers for `BottomTabBar`. */
|
|
2
|
+
import type { Component } from "svelte";
|
|
3
|
+
/** An icon component, as `@lucide/svelte` icons are. */
|
|
4
|
+
export type BottomTabBarIcon = Component<{
|
|
5
|
+
size?: number;
|
|
6
|
+
class?: string;
|
|
7
|
+
strokeWidth?: number;
|
|
8
|
+
}>;
|
|
9
|
+
/** One destination in the bar. */
|
|
10
|
+
export interface BottomTabBarItem {
|
|
11
|
+
/** Where the tab goes. Also its identity: `active` is compared with it. */
|
|
12
|
+
href: string;
|
|
13
|
+
/** Shown under the icon. Keep it to one short word. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Rendered above the label, at 24px. Decorative: the label names the tab. */
|
|
16
|
+
icon: BottomTabBarIcon;
|
|
17
|
+
/**
|
|
18
|
+
* Drawn instead of `icon` on the active tab, typically the filled form.
|
|
19
|
+
* Left out, `icon` is drawn with a heavier stroke (2.5) when active.
|
|
20
|
+
*/
|
|
21
|
+
activeIcon?: BottomTabBarIcon;
|
|
22
|
+
/** A count shown on the icon. Nothing is shown for 0 or when it is left out. */
|
|
23
|
+
badge?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Whether `current` is the tab's page or a page under it. The same rule as
|
|
27
|
+
* `TopNavbar`: a prefix match on whole path segments, except that `/` and
|
|
28
|
+
* absolute URLs only match exactly.
|
|
29
|
+
*/
|
|
30
|
+
export declare function tabMatchesPath(href: string, current: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The href of the one active tab, or undefined when none matches. When
|
|
33
|
+
* several match (`/quiz` and `/quiz/live` on `/quiz/live/3`), the most
|
|
34
|
+
* specific wins, so there is never more than one current page.
|
|
35
|
+
*/
|
|
36
|
+
export declare function activeTabHref(items: readonly BottomTabBarItem[], current: string | undefined): string | undefined;
|
|
37
|
+
/** How a badge is read out after the tab's label: "Notifications, 3 new". */
|
|
38
|
+
export declare function defaultBadgeLabel(count: number): string;
|
|
39
|
+
/** The number as shown on the badge: `99+` above the cap. */
|
|
40
|
+
export declare function badgeText(count: number, max: number): string;
|
|
41
|
+
//# sourceMappingURL=bottom-tab-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bottom-tab-bar.d.ts","sourceRoot":"","sources":["../../../src/components/util/bottom-tab-bar.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,wDAAwD;AACxD,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAElG,kCAAkC;AAClC,MAAM,WAAW,gBAAgB;IAC7B,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,IAAI,EAAE,gBAAgB,CAAC;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAQD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAUrE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CACzB,KAAK,EAAE,SAAS,gBAAgB,EAAE,EAClC,OAAO,EAAE,MAAM,GAAG,SAAS,GAC5B,MAAM,GAAG,SAAS,CASpB;AAED,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,6DAA6D;AAC7D,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5D"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** Public types and pure helpers for `Calendar`. */
|
|
2
|
+
/** The colour of an event's dot. `default` is the primary action colour. */
|
|
3
|
+
export type CalendarTone = "default" | "success" | "warning" | "danger" | "accent";
|
|
4
|
+
/** Something that happens on a day. */
|
|
5
|
+
export interface CalendarEvent {
|
|
6
|
+
/** The day, as `YYYY-MM-DD`. */
|
|
7
|
+
date: string;
|
|
8
|
+
/** What it is. Not shown in the grid; read out with the day. */
|
|
9
|
+
label: string;
|
|
10
|
+
tone?: CalendarTone;
|
|
11
|
+
}
|
|
12
|
+
/** The words the calendar says. Replace any of them to translate. */
|
|
13
|
+
export interface CalendarStrings {
|
|
14
|
+
/** Accessible name of the button that goes a month back. */
|
|
15
|
+
previousMonth: string;
|
|
16
|
+
/** Accessible name of the button that goes a month forward. */
|
|
17
|
+
nextMonth: string;
|
|
18
|
+
/** Added to the name of today's date. */
|
|
19
|
+
today: string;
|
|
20
|
+
/** Added to the name of the selected date. */
|
|
21
|
+
selected: string;
|
|
22
|
+
/** Added to the name of a date that cannot be selected. */
|
|
23
|
+
unavailable: string;
|
|
24
|
+
/** The events part of a day's name. Called only for a day that has events. */
|
|
25
|
+
events: (events: CalendarEvent[]) => string;
|
|
26
|
+
}
|
|
27
|
+
export declare const DEFAULT_CALENDAR_STRINGS: CalendarStrings;
|
|
28
|
+
/** How many dots a day shows at most. The name of the day still counts every event. */
|
|
29
|
+
export declare const MAX_EVENT_DOTS = 3;
|
|
30
|
+
/**
|
|
31
|
+
* The accessible name of a day: the full date, then what is true of it, then
|
|
32
|
+
* its events. "Tuesday 6 October 2026, today, selected, 2 events: Quiz at The
|
|
33
|
+
* Crown, Music quiz".
|
|
34
|
+
*/
|
|
35
|
+
export declare function calendarDayName(fullDate: string, state: {
|
|
36
|
+
today: boolean;
|
|
37
|
+
selected: boolean;
|
|
38
|
+
disabled: boolean;
|
|
39
|
+
events: CalendarEvent[];
|
|
40
|
+
}, strings: CalendarStrings): string;
|
|
41
|
+
/**
|
|
42
|
+
* Where a key takes focus from `date`, by the date-grid pattern: the arrows by
|
|
43
|
+
* a day and a week, Home and End to the ends of the week, Page Up and Page
|
|
44
|
+
* Down by a month, and by a year with Shift. Left and Right swap in a
|
|
45
|
+
* right-to-left layout, where the next day is on the left.
|
|
46
|
+
*
|
|
47
|
+
* Returns null for a key that does not move, or a move past year 1 or 9999.
|
|
48
|
+
*/
|
|
49
|
+
export declare function calendarKeyTarget(key: string, date: string, options?: {
|
|
50
|
+
shift?: boolean;
|
|
51
|
+
rtl?: boolean;
|
|
52
|
+
weekStartsOn?: number;
|
|
53
|
+
}): string | null;
|
|
54
|
+
/** The events of each day, in the order given. */
|
|
55
|
+
export declare function groupEventsByDate(events: readonly CalendarEvent[]): Map<string, CalendarEvent[]>;
|
|
56
|
+
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/components/util/calendar.ts"],"names":[],"mappings":"AAAA,oDAAoD;AAIpD,4EAA4E;AAC5E,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnF,uCAAuC;AACvC,MAAM,WAAW,aAAa;IAC1B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,qEAAqE;AACrE,MAAM,WAAW,eAAe;IAC5B,4DAA4D;IAC5D,aAAa,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,MAAM,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,MAAM,CAAC;CAC/C;AAED,eAAO,MAAM,wBAAwB,EAAE,eAUtC,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC;;;;GAIG;AACH,wBAAgB,eAAe,CAC3B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,aAAa,EAAE,CAAA;CAAE,EACxF,OAAO,EAAE,eAAe,GACzB,MAAM,CAOR;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC7B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAO,GACxE,MAAM,GAAG,IAAI,CAsBf;AAED,kDAAkD;AAClD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,CAQhG"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the four charts share: the series colours, a number formatter, a
|
|
3
|
+
* linear scale with round ticks, and the few path builders. Plain arithmetic
|
|
4
|
+
* that writes SVG; there is no chart library under it.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* `glass` on a chart: the library's thick material (the one a Tooltip and a
|
|
8
|
+
* sheet are made of, the level that carries description and caption text),
|
|
9
|
+
* the container corner and room inside it. `on-surface` gives the text its
|
|
10
|
+
* theme colours back when the chart stands in a brand or accent block. Every
|
|
11
|
+
* fallback of the material (reduced transparency, more contrast, forced
|
|
12
|
+
* colours, no backdrop-filter, data-materials="opaque") comes with the class.
|
|
13
|
+
*/
|
|
14
|
+
export declare const CHART_GLASS = "material-thick on-surface rounded-container p-4";
|
|
15
|
+
/** A theme colour by name. */
|
|
16
|
+
export type ChartColorName = "primary" | "accent" | "success" | "warning" | "error" | "info" | "neutral";
|
|
17
|
+
/** A theme colour by name, or any CSS colour (`"#c2410c"`, `"var(--color-brand-800)"`). */
|
|
18
|
+
export type ChartColor = ChartColorName | (string & {});
|
|
19
|
+
/** A number as text: the two built in, or the app's own function. */
|
|
20
|
+
export type ChartFormat = "number" | "percent" | ((value: number) => string);
|
|
21
|
+
/** One value of a `BarChart` or a `PieChart`. */
|
|
22
|
+
export interface ChartDatum {
|
|
23
|
+
label: string;
|
|
24
|
+
value: number;
|
|
25
|
+
/** Without it, the series colour of its place in the list. */
|
|
26
|
+
color?: ChartColor;
|
|
27
|
+
}
|
|
28
|
+
/** One line of a `LineChart`. */
|
|
29
|
+
export interface ChartSeries {
|
|
30
|
+
name: string;
|
|
31
|
+
/** One value per x label; `null` leaves a gap in the line. */
|
|
32
|
+
points: Array<number | null>;
|
|
33
|
+
/** Without it, the series colour of its place in the list. */
|
|
34
|
+
color?: ChartColor;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The six series colours, in order. Each is a custom property an app may set
|
|
38
|
+
* on the chart or on anything around it (read with a fallback, declared
|
|
39
|
+
* nowhere), and falls back to a step of the theme's own ramps, so it follows
|
|
40
|
+
* light and dark and the app's brand.
|
|
41
|
+
*
|
|
42
|
+
* They are the colours the rest of the library is made of: the action blue
|
|
43
|
+
* a `Progress` fills with, the accent, a deep step of each, and the neutral
|
|
44
|
+
* grey. Two hues and a grey, told apart by lightness as much as by hue,
|
|
45
|
+
* which is what a reader who does not see red and green needs. None is a
|
|
46
|
+
* status colour. The sixth is the one colour from outside those ramps (the
|
|
47
|
+
* brand turned toward red), for the rare chart with six series.
|
|
48
|
+
*/
|
|
49
|
+
export declare const CHART_SERIES_COLORS: readonly string[];
|
|
50
|
+
/** The CSS colour of a series: its own if it names one, else the one of its place (they repeat after six). */
|
|
51
|
+
export declare function chartColor(color: ChartColor | undefined, index: number): string;
|
|
52
|
+
/**
|
|
53
|
+
* The colours of a whole chart, for when named colours and places mix.
|
|
54
|
+
* A series with a `color` gets it. One without keeps the series colour of
|
|
55
|
+
* its place, unless a named colour in the same chart sits next to that one
|
|
56
|
+
* (`success` beside the deep accent, `neutral` beside the grey): then it moves on
|
|
57
|
+
* to the next series colour that is free.
|
|
58
|
+
*/
|
|
59
|
+
export declare function chartColors(colors: Array<ChartColor | undefined>): string[];
|
|
60
|
+
/**
|
|
61
|
+
* `"number"` is the locale's plain number. `"percent"` reads the value as
|
|
62
|
+
* already a percentage (72 is "72 %", not 7,200 %). Without a `locale` the
|
|
63
|
+
* runtime's is used, which on a server may not be the reader's: pass one.
|
|
64
|
+
*/
|
|
65
|
+
export declare function chartFormatter(format: ChartFormat | undefined, locale?: string): (value: number) => string;
|
|
66
|
+
/** A share of the whole (0 to 1) as a whole percentage. */
|
|
67
|
+
export declare function shareFormatter(locale?: string): (share: number) => string;
|
|
68
|
+
/** 1, 2 or 5 times a power of ten: the one nearest to `target` intervals. */
|
|
69
|
+
export declare function niceStep(range: number, target?: number): number;
|
|
70
|
+
export interface ChartScale {
|
|
71
|
+
min: number;
|
|
72
|
+
max: number;
|
|
73
|
+
ticks: number[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The value axis. A `min` or `max` that is given is kept exactly; one that is
|
|
77
|
+
* not is rounded outward to a tick. `zero` keeps zero on the axis (bars).
|
|
78
|
+
*/
|
|
79
|
+
export declare function chartScale(values: Array<number | null | undefined>, options?: {
|
|
80
|
+
min?: number;
|
|
81
|
+
max?: number;
|
|
82
|
+
zero?: boolean;
|
|
83
|
+
}): ChartScale;
|
|
84
|
+
/** Every how-manyth x label fits: 1 is all of them. */
|
|
85
|
+
export declare function labelEvery(labels: string[], available: number, charWidth?: number): number;
|
|
86
|
+
/** A line through the points, broken where one is missing. */
|
|
87
|
+
export declare function linePath(points: Array<{
|
|
88
|
+
x: number;
|
|
89
|
+
y: number;
|
|
90
|
+
} | null>): string;
|
|
91
|
+
/** An upright bar from `from` to `to` (y), rounded at the `to` end and square where it stands on the zero line. */
|
|
92
|
+
export declare function barPath(x: number, width: number, from: number, to: number, radius: number): string;
|
|
93
|
+
export declare const CHART_MARKERS: readonly ["circle", "square", "diamond", "triangle"];
|
|
94
|
+
export type ChartMarker = (typeof CHART_MARKERS)[number];
|
|
95
|
+
/** The marker of a series, so two lines differ by more than colour (they repeat after four). */
|
|
96
|
+
export declare function chartMarker(index: number): ChartMarker;
|
|
97
|
+
/** A marker centred on a point, as a path. */
|
|
98
|
+
export declare function markerPath(shape: ChartMarker, x: number, y: number, r: number): string;
|
|
99
|
+
export interface PieSlice {
|
|
100
|
+
index: number;
|
|
101
|
+
label: string;
|
|
102
|
+
value: number;
|
|
103
|
+
/** 0 to 1. */
|
|
104
|
+
share: number;
|
|
105
|
+
/** Radians, clockwise from twelve o'clock. */
|
|
106
|
+
start: number;
|
|
107
|
+
end: number;
|
|
108
|
+
}
|
|
109
|
+
/** The slices in the order given. A value that is not a positive number takes no room. */
|
|
110
|
+
export declare function pieSlices(data: ChartDatum[]): PieSlice[];
|
|
111
|
+
/** A slice of a pie, or of a ring when `inner` is above zero. */
|
|
112
|
+
export declare function slicePath(cx: number, cy: number, outer: number, inner: number, start: number, end: number): string;
|
|
113
|
+
/** How much larger than 16px the reader's text is: chart text is set in rem, and the room for it follows. */
|
|
114
|
+
export declare function chartTextScale(): number;
|
|
115
|
+
/**
|
|
116
|
+
* Reports the width of the widest `text` inside the node, as drawn, now and
|
|
117
|
+
* whenever what it is given changes. The value axis takes its room from
|
|
118
|
+
* this, not from a count of characters. Where text cannot be measured
|
|
119
|
+
* nothing is reported and the estimate stands.
|
|
120
|
+
*/
|
|
121
|
+
export declare function widestText(node: SVGElement, options: {
|
|
122
|
+
onwidth: (width: number) => void;
|
|
123
|
+
key?: unknown;
|
|
124
|
+
}): {
|
|
125
|
+
update(next: {
|
|
126
|
+
onwidth: (width: number) => void;
|
|
127
|
+
key?: unknown;
|
|
128
|
+
}): void;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Reports the element's width now and whenever it changes: the charts are
|
|
132
|
+
* drawn at the width of their container, in real pixels, so text is never
|
|
133
|
+
* scaled. Where there is no `ResizeObserver` the width is read once.
|
|
134
|
+
*/
|
|
135
|
+
export declare function measureWidth(node: HTMLElement, onwidth: (width: number) => void): {
|
|
136
|
+
destroy?: undefined;
|
|
137
|
+
} | {
|
|
138
|
+
destroy: () => void;
|
|
139
|
+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Y,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;;;;EAM/E"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chip and ChipGroup: what they share, and the arithmetic of the one-row
|
|
3
|
+
* layout.
|
|
4
|
+
*
|
|
5
|
+
* The scroll logic is pure, so it can be tested with made-up metrics: jsdom
|
|
6
|
+
* has no layout. The component reads the real ones and passes them in.
|
|
7
|
+
*/
|
|
8
|
+
export type ChipGroupType = "radio" | "checkbox";
|
|
9
|
+
export type ChipGroupLayout = "wrap" | "row";
|
|
10
|
+
export type ChipGroupEdge = "fade" | "none";
|
|
11
|
+
/** What a ChipGroup hands to the chips (and groups) inside it. */
|
|
12
|
+
export interface ChipGroupContext {
|
|
13
|
+
/** Without a type the group is layout only. */
|
|
14
|
+
readonly type: ChipGroupType | undefined;
|
|
15
|
+
readonly name: string | undefined;
|
|
16
|
+
readonly layout: ChipGroupLayout;
|
|
17
|
+
readonly disabled: boolean;
|
|
18
|
+
/** Whether the chip with this value is selected, by the group's `value`. */
|
|
19
|
+
isSelected(value: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The chip with this value was checked or unchecked. `report` is true for
|
|
22
|
+
* a person's change (the group's `onchange` hears it) and false for one
|
|
23
|
+
* taken in by a binding on hydration, which is reported once afterwards.
|
|
24
|
+
*/
|
|
25
|
+
change(value: string, checked: boolean, report: boolean): void;
|
|
26
|
+
/** The value a radio group holds, for `bind:group`. */
|
|
27
|
+
readonly radioValue: string | undefined;
|
|
28
|
+
/** A form reset emptied a radio group. */
|
|
29
|
+
restore(): void;
|
|
30
|
+
}
|
|
31
|
+
export declare const CHIP_GROUP_CONTEXT_KEY: unique symbol;
|
|
32
|
+
/** The gap between chips, and the margin that keeps a revealed chip off the edge. */
|
|
33
|
+
export declare const CHIP_GAP = 8;
|
|
34
|
+
/** The next value of a checkbox group when `value` is checked or unchecked. Order is kept. */
|
|
35
|
+
export declare function toggleValue(current: readonly string[] | undefined, value: string, checked: boolean): string[];
|
|
36
|
+
export interface RowMetrics {
|
|
37
|
+
/** `scrollLeft`: 0 at the start, negative towards the end in a right-to-left row. */
|
|
38
|
+
scrollLeft: number;
|
|
39
|
+
scrollWidth: number;
|
|
40
|
+
clientWidth: number;
|
|
41
|
+
rtl: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface RowOverflow {
|
|
44
|
+
/** More chips are hidden before the first visible one. */
|
|
45
|
+
start: boolean;
|
|
46
|
+
/** More chips are hidden after the last visible one. */
|
|
47
|
+
end: boolean;
|
|
48
|
+
}
|
|
49
|
+
/** Which sides of the row have chips out of view. Start and end follow the direction. */
|
|
50
|
+
export declare function measureRowOverflow(metrics: RowMetrics): RowOverflow;
|
|
51
|
+
export interface Span {
|
|
52
|
+
left: number;
|
|
53
|
+
right: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The `scrollLeft` that brings `item` fully into `box` with `margin` to spare,
|
|
57
|
+
* or the current one if it is in view already. Both spans are in the same
|
|
58
|
+
* coordinates (the viewport's). The result stays inside what the row can
|
|
59
|
+
* scroll. An item wider than the box is lined up with its start edge.
|
|
60
|
+
*/
|
|
61
|
+
export declare function scrollLeftToReveal(metrics: RowMetrics, box: Span, item: Span, margin?: number): number;
|
|
62
|
+
/** The first chosen chip in a row: a link, a toggle button or a checked input. */
|
|
63
|
+
export declare const SELECTED_CHIP_SELECTOR = "[aria-current]:not([aria-current=\"false\"]), [aria-pressed=\"true\"], input:checked";
|
|
64
|
+
/** The element to bring into view for a selected chip: the label around an input, else the element. */
|
|
65
|
+
export declare function chipBox(selected: Element): Element;
|
|
66
|
+
//# sourceMappingURL=chip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip.d.ts","sourceRoot":"","sources":["../../../src/components/util/chip.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,aAAa,GAAG,O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AAKD,yFAAyF;AACzF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,UAAU,GAAG,WAAW,CAOnE;AAED,MAAM,WAAW,IAAI;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAC9B,OAAO,EAAE,UAAU,EACnB,GAAG,EAAE,IAAI,EACT,IAAI,EAAE,IAAI,EACV,MAAM,GAAE,MAAiB,GAC1B,MAAM,CAaR;AAED,kFAAkF;AAClF,eAAO,MAAM,sBAAsB,yFAAqF,CAAC;AAEzH,uGAAuG;AACvG,wBAAgB,OAAO,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAElD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../../src/components/util/cn.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../../src/components/util/cn.ts"],"names":[],"mappings":"AAsEA;;;;;GAKG;AACH,wBAAgB,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,GAAG,MAAM,CAE5E"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** Types and pure helpers for `CodeField`. Kept out of the component so they can be tested without a DOM. */
|
|
2
|
+
/** `numeric`: digits only, the numeric keyboard. `alphanumeric`: digits and letters. */
|
|
3
|
+
export type CodeFieldMode = "numeric" | "alphanumeric";
|
|
4
|
+
/** Every built-in string. Pass a partial object to `strings` to translate. */
|
|
5
|
+
export interface CodeFieldStrings {
|
|
6
|
+
/** The field's name when no `label` is given. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Read after the name, so a screen reader user knows how long the code is ("6 digits"). */
|
|
9
|
+
description: (length: number, mode: CodeFieldMode) => string;
|
|
10
|
+
}
|
|
11
|
+
export declare const DEFAULT_CODE_FIELD_STRINGS: CodeFieldStrings;
|
|
12
|
+
/** The fewest and the most places a code field draws. */
|
|
13
|
+
export declare const CODE_FIELD_LENGTH_MAX = 12;
|
|
14
|
+
/** `length` as a whole number from 1 to 12; 6 for anything that is not a number. */
|
|
15
|
+
export declare function codeLength(length: number | undefined): number;
|
|
16
|
+
/** Whether one character belongs in a code of this mode. */
|
|
17
|
+
export declare function isCodeChar(char: string, mode: CodeFieldMode): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* What is left of `text` once everything that does not belong is dropped
|
|
20
|
+
* (spaces, dashes, letters in a numeric code), cut to `length`. "123 456" and
|
|
21
|
+
* "123-456" are "123456".
|
|
22
|
+
*/
|
|
23
|
+
export declare function sanitiseCode(text: string, mode: CodeFieldMode, length: number): string;
|
|
24
|
+
/** The characters kept of `text` before position `caret`: where the caret goes after `text` is cleaned. */
|
|
25
|
+
export declare function caretAfterSanitise(text: string, caret: number, mode: CodeFieldMode, length: number): number;
|
|
26
|
+
/** `value` with the place at `index` replaced by `char`. */
|
|
27
|
+
export declare function replaceAt(value: string, index: number, char: string): string;
|
|
28
|
+
/** The text with `pasted` where the selection from `start` to `end` is. A whole code replaces what was there. */
|
|
29
|
+
export declare function pasteInto(value: string, start: number, end: number, pasted: string, mode: CodeFieldMode, length: number): string;
|
|
30
|
+
/** The place the caret is in, for the focus mark: the next empty place, or the last when the code is whole. */
|
|
31
|
+
export declare function activePlace(caret: number, length: number): number;
|
|
32
|
+
/** The sizes of the boxes: the field's `size`. `md` is the size the field has always had. */
|
|
33
|
+
export type CodeFieldSize = "sm" | "md" | "lg";
|
|
34
|
+
/**
|
|
35
|
+
* Per size: the box height, the digit class, the widest a box grows (rem) and
|
|
36
|
+
* the least it is (`minEm`, in ems of its own digit, so a digit is never wider than its
|
|
37
|
+
* box at any text size). `sm` stays 44px tall, the least for a touch target.
|
|
38
|
+
*/
|
|
39
|
+
export declare const CODE_FIELD_SIZES: Record<CodeFieldSize, {
|
|
40
|
+
box: string;
|
|
41
|
+
text: string;
|
|
42
|
+
digitRem: number;
|
|
43
|
+
maxRem: number;
|
|
44
|
+
minEm: number;
|
|
45
|
+
}>;
|
|
46
|
+
/** The gap between boxes in a group, and the wider gap between groups (rem). */
|
|
47
|
+
export declare const CODE_FIELD_GAP_REM = 0.5;
|
|
48
|
+
export declare const CODE_FIELD_GROUP_GAP_REM = 1;
|
|
49
|
+
/**
|
|
50
|
+
* `groups` as the sizes of the groups the boxes are drawn in. A number is the
|
|
51
|
+
* size of each group (4 for 8 places is 4 and 4, 3 for 8 is 3, 3 and 2); a list
|
|
52
|
+
* gives each group's size and the places left over form a last group. One
|
|
53
|
+
* group, or anything unusable, means no grouping: an empty list.
|
|
54
|
+
*/
|
|
55
|
+
export declare function codeGroups(groups: number | number[] | undefined, length: number): number[];
|
|
56
|
+
/** The index of the box nearest to a point, by its rectangle; -1 when there are none. */
|
|
57
|
+
export declare function nearestBox(rects: {
|
|
58
|
+
left: number;
|
|
59
|
+
right: number;
|
|
60
|
+
top?: number;
|
|
61
|
+
bottom?: number;
|
|
62
|
+
}[], x: number, y: number): number;
|
|
63
|
+
//# sourceMappingURL=code-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-field.d.ts","sourceRoot":"","sources":["../../../src/components/util/code-field.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAE7G,wFAAwF;AACxF,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,cAAc,CAAC;AAEvD,8EAA8E;AAC9E,MAAM,WAAW,gBAAgB;IAC7B,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,4FAA4F;IAC5F,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,KAAK,MAAM,CAAC;CAChE;AAED,eAAO,MAAM,0BAA0B,EAAE,gBAGxC,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,oFAAoF;AACpF,wBAAgB,U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AM,CAAC;AACtC,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAsB1F;AAED,yFAAyF;AACzF,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAahI"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** Types and pure helpers for `Collapsible` and `CollapsibleGroup`. Kept out of the components so they can be tested without a DOM. */
|
|
2
|
+
/** Heading element the default trigger is wrapped in. */
|
|
3
|
+
export type CollapsibleHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
4
|
+
/**
|
|
5
|
+
* First argument of the `trigger` snippet. Spread it on your own `<button>`:
|
|
6
|
+
* it carries the whole wiring, so the button needs nothing else to work.
|
|
7
|
+
*/
|
|
8
|
+
export type CollapsibleTriggerProps = {
|
|
9
|
+
id: string;
|
|
10
|
+
/** Keeps a trigger inside a `<form>` from submitting it. */
|
|
11
|
+
type: "button";
|
|
12
|
+
"aria-expanded": boolean;
|
|
13
|
+
"aria-controls": string;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
onclick: (event: MouseEvent) => void;
|
|
16
|
+
/** How a `CollapsibleGroup` finds its header buttons for the arrow keys. */
|
|
17
|
+
"data-collapsible-trigger": "";
|
|
18
|
+
};
|
|
19
|
+
/** Second argument of the `trigger` snippet. */
|
|
20
|
+
export interface CollapsibleTriggerState {
|
|
21
|
+
open: boolean;
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** What a `Collapsible` hands its group. */
|
|
25
|
+
export interface CollapsibleGroupMember {
|
|
26
|
+
triggerId: string;
|
|
27
|
+
isOpen: () => boolean;
|
|
28
|
+
/** A disabled member keeps its state: the group neither closes it nor counts it. */
|
|
29
|
+
isDisabled: () => boolean;
|
|
30
|
+
close: () => void;
|
|
31
|
+
}
|
|
32
|
+
/** What a member gets back when it joins a group. */
|
|
33
|
+
export interface CollapsibleGroupRegistration {
|
|
34
|
+
/** Removes the member again. */
|
|
35
|
+
unregister: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* True when the member asked to start open in a single-open group that
|
|
38
|
+
* already has an open panel. The member then renders closed from the
|
|
39
|
+
* start, on the server too, instead of opening and being closed again.
|
|
40
|
+
*/
|
|
41
|
+
startClosed: boolean;
|
|
42
|
+
}
|
|
43
|
+
/** What a `CollapsibleGroup` offers the Collapsibles inside it, through context. */
|
|
44
|
+
export interface CollapsibleGroupContext {
|
|
45
|
+
/** False when opening one panel closes the others. */
|
|
46
|
+
readonly multiple: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Shared `name` for the `<details>` of the default triggers when the group
|
|
49
|
+
* is single-open, so the browser keeps them exclusive without scripts.
|
|
50
|
+
* `undefined` when `multiple`.
|
|
51
|
+
*/
|
|
52
|
+
readonly exclusiveName: string | undefined;
|
|
53
|
+
register: (member: CollapsibleGroupMember) => CollapsibleGroupRegistration;
|
|
54
|
+
/** Called whenever a member is open, however it got there. */
|
|
55
|
+
opened: (member: CollapsibleGroupMember) => void;
|
|
56
|
+
}
|
|
57
|
+
/** Context key shared by the two components. */
|
|
58
|
+
export declare const COLLAPSIBLE_GROUP: unique symbol;
|
|
59
|
+
/**
|
|
60
|
+
* Index of the header button an accordion key moves focus to, or `null` when
|
|
61
|
+
* the key is not one of them. Arrow keys wrap, as they do in Tabs and Dropdown.
|
|
62
|
+
*/
|
|
63
|
+
export declare function nextTriggerIndex(key: string, current: number, count: number): number | null;
|
|
64
|
+
//# sourceMappingURL=collapsible.d.ts.map
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AE,sBAAsB,KAAK,4BAA4B,CAAC;IAC3E,8DAA8D;IAC9D,MAAM,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;CACpD;AAED,gDAAgD;AAChD,eAAO,MAAM,iBAAiB,eAAmC,CAAC;AAElE;;;GAGG;AACH,wBAAgB,gBAAgB,CAC5B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACd,MAAM,GAAG,IAAI,CAcf"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Public types for `ConfirmDialog`. */
|
|
2
|
+
/** Sets the confirm button's style and the icon beside the message. */
|
|
3
|
+
export type ConfirmDialogVariant = "danger" | "warning" | "info";
|
|
4
|
+
/** How the user backed out: the cancel button, or one of Modal's own ways to close. */
|
|
5
|
+
export type ConfirmDialogCancelReason = "cancel-button" | "escape" | "backdrop" | "close-button";
|
|
6
|
+
/**
|
|
7
|
+
* What `onconfirm` may return. `false`, returned or resolved, keeps the dialog
|
|
8
|
+
* open; anything else closes it. A promise puts the dialog in its loading
|
|
9
|
+
* state until it settles.
|
|
10
|
+
*/
|
|
11
|
+
export type ConfirmDialogResult = void | boolean | Promise<void | boolean>;
|
|
12
|
+
//# sourceMappingURL=confirm-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/util/confirm-dialog.ts"],"names":[],"mappings":"AAAA,wCAAwC;AAExC,uEAAuE;AACvE,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAEjE,uFAAuF;AACvF,MAAM,MAAM,yBAAyB,GAC/B,eAAe,GACf,QAAQ,GACR,UAAU,GACV,cAAc,CAAC;AAErB;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC"}
|