horizon-design 0.0.23 → 2.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/LICENSE +5 -0
- package/README.md +456 -2416
- package/dist/components/accordion/Accordion.svelte +22 -4
- package/dist/components/accordion/Accordion.svelte.d.ts +14 -1
- package/dist/components/accordion/AccordionItem.svelte +18 -6
- package/dist/components/accordion/AccordionItem.svelte.d.ts +9 -0
- package/dist/components/accordion/index.d.ts +4 -0
- package/dist/components/accordion/index.js +4 -0
- package/dist/components/action-bar/ActionBar.svelte +9 -2
- package/dist/components/action-bar/ActionBar.svelte.d.ts +4 -0
- package/dist/components/action-bar/ActionBarSeparator.svelte +9 -2
- package/dist/components/action-bar/ActionBarSeparator.svelte.d.ts +3 -0
- package/dist/components/action-bar/index.d.ts +4 -0
- package/dist/components/action-bar/index.js +4 -0
- package/dist/components/alert/Alert.svelte +32 -15
- package/dist/components/alert/Alert.svelte.d.ts +11 -0
- package/dist/components/alert/index.d.ts +4 -0
- package/dist/components/alert/index.js +4 -0
- package/dist/components/alert-dialog/AlertDialog.svelte +105 -65
- package/dist/components/alert-dialog/AlertDialog.svelte.d.ts +27 -3
- package/dist/components/alert-dialog/index.d.ts +4 -0
- package/dist/components/alert-dialog/index.js +4 -0
- package/dist/components/angle-slider/AngleSlider.svelte +70 -23
- package/dist/components/angle-slider/AngleSlider.svelte.d.ts +27 -0
- package/dist/components/angle-slider/index.d.ts +4 -0
- package/dist/components/angle-slider/index.js +4 -0
- package/dist/components/announcement/Announcement.svelte +9 -2
- package/dist/components/announcement/Announcement.svelte.d.ts +4 -0
- package/dist/components/announcement/index.d.ts +4 -0
- package/dist/components/announcement/index.js +4 -0
- package/dist/components/aspect-ratio/AspectRatio.svelte +9 -1
- package/dist/components/aspect-ratio/AspectRatio.svelte.d.ts +5 -0
- package/dist/components/aspect-ratio/index.d.ts +4 -0
- package/dist/components/aspect-ratio/index.js +4 -0
- package/dist/components/asset-card/AssetCard.svelte +103 -0
- package/dist/components/asset-card/AssetCard.svelte.d.ts +38 -0
- package/dist/components/asset-card/index.d.ts +5 -0
- package/dist/components/asset-card/index.js +5 -0
- package/dist/components/avatar/Avatar.svelte +48 -14
- package/dist/components/avatar/Avatar.svelte.d.ts +19 -5
- package/dist/components/avatar/index.d.ts +5 -1
- package/dist/components/avatar/index.js +5 -1
- package/dist/components/avatar/tone.d.ts +14 -0
- package/dist/components/avatar/tone.js +17 -0
- package/dist/components/avatar-stack/AvatarStack.svelte +89 -0
- package/dist/components/avatar-stack/AvatarStack.svelte.d.ts +37 -0
- package/dist/components/avatar-stack/index.d.ts +5 -0
- package/dist/components/avatar-stack/index.js +5 -0
- package/dist/components/badge/Badge.svelte +41 -23
- package/dist/components/badge/Badge.svelte.d.ts +14 -6
- package/dist/components/badge/index.d.ts +4 -0
- package/dist/components/badge/index.js +4 -0
- package/dist/components/bottom-navigation/BottomNavigation.svelte +24 -10
- package/dist/components/bottom-navigation/BottomNavigation.svelte.d.ts +13 -0
- package/dist/components/bottom-navigation/index.d.ts +4 -0
- package/dist/components/bottom-navigation/index.js +4 -0
- package/dist/components/breadcrumb/Breadcrumb.svelte +25 -14
- package/dist/components/breadcrumb/Breadcrumb.svelte.d.ts +8 -0
- package/dist/components/breadcrumb/index.d.ts +4 -0
- package/dist/components/breadcrumb/index.js +4 -0
- package/dist/components/button/Button.svelte +40 -76
- package/dist/components/button/Button.svelte.d.ts +27 -9
- package/dist/components/button/button-variants.d.ts +39 -22
- package/dist/components/button/button-variants.js +29 -26
- package/dist/components/button/index.d.ts +6 -1
- package/dist/components/button/index.js +5 -0
- package/dist/components/button-group/ButtonGroup.svelte +10 -1
- package/dist/components/button-group/ButtonGroup.svelte.d.ts +5 -0
- package/dist/components/button-group/index.d.ts +4 -0
- package/dist/components/button-group/index.js +4 -0
- package/dist/components/calendar/Calendar.svelte +49 -162
- package/dist/components/calendar/Calendar.svelte.d.ts +27 -2
- package/dist/components/calendar/CalendarViews.svelte +204 -0
- package/dist/components/calendar/CalendarViews.svelte.d.ts +24 -0
- package/dist/components/calendar/index.d.ts +4 -0
- package/dist/components/calendar/index.js +4 -0
- package/dist/components/calendar/trigger-ids.d.ts +14 -0
- package/dist/components/calendar/trigger-ids.js +7 -0
- package/dist/components/card/Card.svelte +23 -8
- package/dist/components/card/Card.svelte.d.ts +13 -0
- package/dist/components/card/index.d.ts +4 -0
- package/dist/components/card/index.js +4 -0
- package/dist/components/carousel/Carousel.svelte +96 -21
- package/dist/components/carousel/Carousel.svelte.d.ts +27 -2
- package/dist/components/carousel/index.d.ts +4 -0
- package/dist/components/carousel/index.js +4 -0
- package/dist/components/checkbox/Checkbox.svelte +30 -9
- package/dist/components/checkbox/Checkbox.svelte.d.ts +13 -1
- package/dist/components/checkbox/index.d.ts +4 -0
- package/dist/components/checkbox/index.js +4 -0
- package/dist/components/circular-progress/CircularProgress.svelte +38 -38
- package/dist/components/circular-progress/CircularProgress.svelte.d.ts +18 -2
- package/dist/components/circular-progress/index.d.ts +4 -0
- package/dist/components/circular-progress/index.js +4 -0
- package/dist/components/circular-slider/CircularSlider.svelte +69 -70
- package/dist/components/circular-slider/CircularSlider.svelte.d.ts +24 -2
- package/dist/components/circular-slider/index.d.ts +4 -0
- package/dist/components/circular-slider/index.js +4 -0
- package/dist/components/clipboard/Clipboard.svelte +45 -18
- package/dist/components/clipboard/Clipboard.svelte.d.ts +15 -1
- package/dist/components/clipboard/index.d.ts +4 -0
- package/dist/components/clipboard/index.js +4 -0
- package/dist/components/collapsible/Collapsible.svelte +28 -6
- package/dist/components/collapsible/Collapsible.svelte.d.ts +14 -1
- package/dist/components/collapsible/index.d.ts +4 -0
- package/dist/components/collapsible/index.js +4 -0
- package/dist/components/color-picker/ColorPicker.svelte +224 -64
- package/dist/components/color-picker/ColorPicker.svelte.d.ts +56 -1
- package/dist/components/color-picker/formats.d.ts +23 -0
- package/dist/components/color-picker/formats.js +52 -0
- package/dist/components/color-picker/index.d.ts +6 -0
- package/dist/components/color-picker/index.js +5 -0
- package/dist/components/combobox/Combobox.svelte +100 -23
- package/dist/components/combobox/Combobox.svelte.d.ts +36 -2
- package/dist/components/combobox/index.d.ts +4 -0
- package/dist/components/combobox/index.js +4 -0
- package/dist/components/command-palette/CommandPalette.svelte +85 -0
- package/dist/components/command-palette/CommandPalette.svelte.d.ts +30 -0
- package/dist/components/command-palette/PaletteSearch.svelte +137 -0
- package/dist/components/command-palette/PaletteSearch.svelte.d.ts +28 -0
- package/dist/components/command-palette/filter.d.ts +35 -0
- package/dist/components/command-palette/filter.js +62 -0
- package/dist/components/command-palette/index.d.ts +6 -0
- package/dist/components/command-palette/index.js +5 -0
- package/dist/components/context-menu/ContextMenu.svelte +69 -32
- package/dist/components/context-menu/ContextMenu.svelte.d.ts +29 -4
- package/dist/components/context-menu/index.d.ts +4 -0
- package/dist/components/context-menu/index.js +4 -0
- package/dist/components/data-list/DataList.svelte +13 -4
- package/dist/components/data-list/DataList.svelte.d.ts +6 -0
- package/dist/components/data-list/index.d.ts +4 -0
- package/dist/components/data-list/index.js +4 -0
- package/dist/components/date-picker/DatePicker.svelte +108 -145
- package/dist/components/date-picker/DatePicker.svelte.d.ts +39 -3
- package/dist/components/date-picker/index.d.ts +4 -0
- package/dist/components/date-picker/index.js +4 -0
- package/dist/components/dialog/Dialog.svelte +74 -31
- package/dist/components/dialog/Dialog.svelte.d.ts +25 -2
- package/dist/components/dialog/DialogClose.svelte +56 -30
- package/dist/components/dialog/DialogClose.svelte.d.ts +18 -2
- package/dist/components/dialog/context.d.ts +9 -0
- package/dist/components/dialog/context.js +16 -0
- package/dist/components/dialog/index.d.ts +4 -0
- package/dist/components/dialog/index.js +4 -0
- package/dist/components/drawer/Drawer.svelte +73 -30
- package/dist/components/drawer/Drawer.svelte.d.ts +26 -3
- package/dist/components/drawer/DrawerClose.svelte +6 -0
- package/dist/components/drawer/DrawerClose.svelte.d.ts +3 -0
- package/dist/components/drawer/index.d.ts +4 -0
- package/dist/components/drawer/index.js +4 -0
- package/dist/components/editable/Editable.svelte +35 -7
- package/dist/components/editable/Editable.svelte.d.ts +22 -1
- package/dist/components/editable/index.d.ts +4 -0
- package/dist/components/editable/index.js +4 -0
- package/dist/components/faceted-search/FacetedSearch.svelte +182 -0
- package/dist/components/faceted-search/FacetedSearch.svelte.d.ts +71 -0
- package/dist/components/faceted-search/index.d.ts +5 -0
- package/dist/components/faceted-search/index.js +5 -0
- package/dist/components/field/Field.svelte +14 -3
- package/dist/components/field/Field.svelte.d.ts +10 -0
- package/dist/components/field/index.d.ts +4 -0
- package/dist/components/field/index.js +4 -0
- package/dist/components/file-upload/FileUpload.svelte +29 -10
- package/dist/components/file-upload/FileUpload.svelte.d.ts +15 -0
- package/dist/components/file-upload/index.d.ts +4 -0
- package/dist/components/file-upload/index.js +4 -0
- package/dist/components/float/Float.svelte +20 -9
- package/dist/components/float/Float.svelte.d.ts +10 -1
- package/dist/components/float/index.d.ts +4 -0
- package/dist/components/float/index.js +4 -0
- package/dist/components/floating-panel/FloatingPanel.svelte +72 -23
- package/dist/components/floating-panel/FloatingPanel.svelte.d.ts +22 -3
- package/dist/components/floating-panel/index.d.ts +4 -0
- package/dist/components/floating-panel/index.js +4 -0
- package/dist/components/frame/Frame.svelte +21 -10
- package/dist/components/frame/Frame.svelte.d.ts +9 -0
- package/dist/components/frame/index.d.ts +4 -0
- package/dist/components/frame/index.js +4 -0
- package/dist/components/game-card/GameCard.svelte +133 -0
- package/dist/components/game-card/GameCard.svelte.d.ts +40 -0
- package/dist/components/game-card/index.d.ts +5 -0
- package/dist/components/game-card/index.js +5 -0
- package/dist/components/game-hero/GameHero.svelte +71 -0
- package/dist/components/game-hero/GameHero.svelte.d.ts +25 -0
- package/dist/components/game-hero/index.d.ts +5 -0
- package/dist/components/game-hero/index.js +5 -0
- package/dist/components/hint/Hint.svelte +10 -2
- package/dist/components/hint/Hint.svelte.d.ts +7 -0
- package/dist/components/hint/index.d.ts +4 -0
- package/dist/components/hint/index.js +4 -0
- package/dist/components/hover-card/HoverCard.svelte +16 -2
- package/dist/components/hover-card/HoverCard.svelte.d.ts +11 -0
- package/dist/components/hover-card/index.d.ts +4 -0
- package/dist/components/hover-card/index.js +4 -0
- package/dist/components/icon-button/IconButton.svelte +60 -0
- package/dist/components/icon-button/IconButton.svelte.d.ts +31 -0
- package/dist/components/icon-button/index.d.ts +5 -0
- package/dist/components/icon-button/index.js +5 -0
- package/dist/components/image-cropper/ImageCropper.svelte +27 -9
- package/dist/components/image-cropper/ImageCropper.svelte.d.ts +16 -1
- package/dist/components/image-cropper/index.d.ts +4 -0
- package/dist/components/image-cropper/index.js +4 -0
- package/dist/components/input/Input.svelte +49 -16
- package/dist/components/input/Input.svelte.d.ts +18 -1
- package/dist/components/input/index.d.ts +4 -0
- package/dist/components/input/index.js +4 -0
- package/dist/components/input-group/InputAddon.svelte +9 -2
- package/dist/components/input-group/InputAddon.svelte.d.ts +4 -0
- package/dist/components/input-group/InputGroup.svelte +11 -2
- package/dist/components/input-group/InputGroup.svelte.d.ts +7 -0
- package/dist/components/input-group/index.d.ts +4 -0
- package/dist/components/input-group/index.js +4 -0
- package/dist/components/item/Item.svelte +41 -11
- package/dist/components/item/Item.svelte.d.ts +13 -0
- package/dist/components/item/index.d.ts +4 -0
- package/dist/components/item/index.js +4 -0
- package/dist/components/kbd/Kbd.svelte +40 -3
- package/dist/components/kbd/Kbd.svelte.d.ts +18 -0
- package/dist/components/kbd/index.d.ts +4 -0
- package/dist/components/kbd/index.js +4 -0
- package/dist/components/link-overlay/LinkBox.svelte +21 -2
- package/dist/components/link-overlay/LinkBox.svelte.d.ts +7 -0
- package/dist/components/link-overlay/LinkOverlay.svelte +13 -3
- package/dist/components/link-overlay/LinkOverlay.svelte.d.ts +6 -1
- package/dist/components/link-overlay/index.d.ts +4 -0
- package/dist/components/link-overlay/index.js +4 -0
- package/dist/components/listbox/Listbox.svelte +42 -13
- package/dist/components/listbox/Listbox.svelte.d.ts +27 -10
- package/dist/components/listbox/index.d.ts +5 -1
- package/dist/components/listbox/index.js +4 -0
- package/dist/components/marquee/Marquee.svelte +47 -7
- package/dist/components/marquee/Marquee.svelte.d.ts +13 -0
- package/dist/components/marquee/MarqueeItem.svelte +15 -3
- package/dist/components/marquee/MarqueeItem.svelte.d.ts +4 -0
- package/dist/components/marquee/index.d.ts +4 -0
- package/dist/components/marquee/index.js +4 -0
- package/dist/components/menu/Menu.svelte +61 -9
- package/dist/components/menu/Menu.svelte.d.ts +23 -2
- package/dist/components/menu/MenuGroup.svelte +9 -4
- package/dist/components/menu/MenuGroup.svelte.d.ts +4 -1
- package/dist/components/menu/MenuGroupLabel.svelte +9 -2
- package/dist/components/menu/MenuGroupLabel.svelte.d.ts +4 -0
- package/dist/components/menu/MenuItem.svelte +10 -2
- package/dist/components/menu/MenuItem.svelte.d.ts +5 -0
- package/dist/components/menu/MenuSeparator.svelte +8 -2
- package/dist/components/menu/MenuSeparator.svelte.d.ts +3 -0
- package/dist/components/menu/index.d.ts +4 -0
- package/dist/components/menu/index.js +4 -0
- package/dist/components/native-select/NativeSelect.svelte +17 -3
- package/dist/components/native-select/NativeSelect.svelte.d.ts +11 -1
- package/dist/components/native-select/index.d.ts +4 -0
- package/dist/components/native-select/index.js +4 -0
- package/dist/components/notification-center/NotificationCenter.svelte +127 -0
- package/dist/components/notification-center/NotificationCenter.svelte.d.ts +46 -0
- package/dist/components/notification-center/index.d.ts +5 -0
- package/dist/components/notification-center/index.js +5 -0
- package/dist/components/number-input/NumberInput.svelte +78 -16
- package/dist/components/number-input/NumberInput.svelte.d.ts +25 -2
- package/dist/components/number-input/index.d.ts +4 -0
- package/dist/components/number-input/index.js +4 -0
- package/dist/components/pagination/Pagination.svelte +73 -33
- package/dist/components/pagination/Pagination.svelte.d.ts +26 -2
- package/dist/components/pagination/PaginationContext.svelte +4 -0
- package/dist/components/pagination/PaginationContext.svelte.d.ts +1 -0
- package/dist/components/pagination/PaginationEllipsis.svelte +10 -2
- package/dist/components/pagination/PaginationEllipsis.svelte.d.ts +5 -0
- package/dist/components/pagination/PaginationItem.svelte +10 -2
- package/dist/components/pagination/PaginationItem.svelte.d.ts +5 -0
- package/dist/components/pagination/PaginationNextTrigger.svelte +37 -11
- package/dist/components/pagination/PaginationNextTrigger.svelte.d.ts +12 -0
- package/dist/components/pagination/PaginationPrevTrigger.svelte +37 -11
- package/dist/components/pagination/PaginationPrevTrigger.svelte.d.ts +12 -0
- package/dist/components/pagination/index.d.ts +5 -0
- package/dist/components/pagination/index.js +5 -0
- package/dist/components/pin-input/PinInput.svelte +41 -10
- package/dist/components/pin-input/PinInput.svelte.d.ts +18 -2
- package/dist/components/pin-input/index.d.ts +4 -0
- package/dist/components/pin-input/index.js +4 -0
- package/dist/components/player-count/PlayerCount.svelte +62 -0
- package/dist/components/player-count/PlayerCount.svelte.d.ts +24 -0
- package/dist/components/player-count/index.d.ts +5 -0
- package/dist/components/player-count/index.js +5 -0
- package/dist/components/popover/Popover.svelte +72 -16
- package/dist/components/popover/Popover.svelte.d.ts +29 -2
- package/dist/components/popover/PopoverClose.svelte +33 -4
- package/dist/components/popover/PopoverClose.svelte.d.ts +11 -0
- package/dist/components/popover/index.d.ts +4 -0
- package/dist/components/popover/index.js +4 -0
- package/dist/components/progress/Progress.svelte +36 -7
- package/dist/components/progress/Progress.svelte.d.ts +14 -2
- package/dist/components/progress/index.d.ts +4 -0
- package/dist/components/progress/index.js +4 -0
- package/dist/components/prose/Prose.svelte +10 -2
- package/dist/components/prose/Prose.svelte.d.ts +7 -0
- package/dist/components/prose/index.d.ts +4 -0
- package/dist/components/prose/index.js +4 -0
- package/dist/components/qr-code/QrCode.svelte +18 -5
- package/dist/components/qr-code/QrCode.svelte.d.ts +11 -1
- package/dist/components/qr-code/index.d.ts +4 -0
- package/dist/components/qr-code/index.js +4 -0
- package/dist/components/radio-group/RadioGroup.svelte +66 -37
- package/dist/components/radio-group/RadioGroup.svelte.d.ts +18 -1
- package/dist/components/radio-group/index.d.ts +4 -0
- package/dist/components/radio-group/index.js +4 -0
- package/dist/components/rating-group/RatingGroup.svelte +51 -7
- package/dist/components/rating-group/RatingGroup.svelte.d.ts +22 -1
- package/dist/components/rating-group/index.d.ts +4 -0
- package/dist/components/rating-group/index.js +4 -0
- package/dist/components/ring/Ring.svelte +42 -0
- package/dist/components/ring/Ring.svelte.d.ts +16 -0
- package/dist/components/scroll-area/ScrollArea.svelte +40 -32
- package/dist/components/scroll-area/ScrollArea.svelte.d.ts +16 -0
- package/dist/components/scroll-area/index.d.ts +4 -0
- package/dist/components/scroll-area/index.js +4 -0
- package/dist/components/segment-group/SegmentGroup.svelte +56 -17
- package/dist/components/segment-group/SegmentGroup.svelte.d.ts +19 -1
- package/dist/components/segment-group/index.d.ts +4 -0
- package/dist/components/segment-group/index.js +4 -0
- package/dist/components/select/Select.svelte +38 -17
- package/dist/components/select/Select.svelte.d.ts +24 -7
- package/dist/components/select/index.d.ts +4 -0
- package/dist/components/select/index.js +4 -0
- package/dist/components/separator/Separator.svelte +11 -2
- package/dist/components/separator/Separator.svelte.d.ts +8 -0
- package/dist/components/separator/index.d.ts +4 -0
- package/dist/components/separator/index.js +4 -0
- package/dist/components/sheet/Sheet.svelte +103 -23
- package/dist/components/sheet/Sheet.svelte.d.ts +36 -2
- package/dist/components/sheet/index.d.ts +4 -0
- package/dist/components/sheet/index.js +4 -0
- package/dist/components/sidebar/Sidebar.svelte +38 -7
- package/dist/components/sidebar/Sidebar.svelte.d.ts +18 -0
- package/dist/components/sidebar/SidebarItem.svelte +75 -19
- package/dist/components/sidebar/SidebarItem.svelte.d.ts +16 -0
- package/dist/components/sidebar/SidebarSection.svelte +23 -3
- package/dist/components/sidebar/SidebarSection.svelte.d.ts +8 -0
- package/dist/components/sidebar/context.d.ts +9 -0
- package/dist/components/sidebar/context.js +15 -0
- package/dist/components/sidebar/index.d.ts +4 -0
- package/dist/components/sidebar/index.js +4 -0
- package/dist/components/signature-pad/SignaturePad.svelte +38 -12
- package/dist/components/signature-pad/SignaturePad.svelte.d.ts +15 -1
- package/dist/components/signature-pad/index.d.ts +4 -0
- package/dist/components/signature-pad/index.js +4 -0
- package/dist/components/skeleton/Skeleton.svelte +8 -2
- package/dist/components/skeleton/Skeleton.svelte.d.ts +3 -0
- package/dist/components/skeleton/index.d.ts +4 -0
- package/dist/components/skeleton/index.js +4 -0
- package/dist/components/skip-nav/SkipNav.svelte +12 -2
- package/dist/components/skip-nav/SkipNav.svelte.d.ts +5 -0
- package/dist/components/skip-nav/index.d.ts +4 -0
- package/dist/components/skip-nav/index.js +4 -0
- package/dist/components/slider/Slider.svelte +54 -20
- package/dist/components/slider/Slider.svelte.d.ts +16 -1
- package/dist/components/slider/index.d.ts +4 -0
- package/dist/components/slider/index.js +4 -0
- package/dist/components/spinner/Spinner.svelte +17 -5
- package/dist/components/spinner/Spinner.svelte.d.ts +13 -5
- package/dist/components/spinner/index.d.ts +4 -0
- package/dist/components/spinner/index.js +4 -0
- package/dist/components/splitter/Splitter.svelte +21 -14
- package/dist/components/splitter/Splitter.svelte.d.ts +10 -1
- package/dist/components/splitter/SplitterPanel.svelte +9 -1
- package/dist/components/splitter/SplitterPanel.svelte.d.ts +5 -0
- package/dist/components/splitter/SplitterResizeTrigger.svelte +13 -2
- package/dist/components/splitter/SplitterResizeTrigger.svelte.d.ts +6 -0
- package/dist/components/splitter/index.d.ts +4 -0
- package/dist/components/splitter/index.js +4 -0
- package/dist/components/status/Status.svelte +25 -11
- package/dist/components/status/Status.svelte.d.ts +13 -5
- package/dist/components/status/index.d.ts +4 -0
- package/dist/components/status/index.js +4 -0
- package/dist/components/steps/Steps.svelte +31 -14
- package/dist/components/steps/Steps.svelte.d.ts +18 -2
- package/dist/components/steps/index.d.ts +4 -0
- package/dist/components/steps/index.js +4 -0
- package/dist/components/swap/Swap.svelte +16 -3
- package/dist/components/swap/Swap.svelte.d.ts +8 -0
- package/dist/components/swap/index.d.ts +4 -0
- package/dist/components/swap/index.js +4 -0
- package/dist/components/switch/Switch.svelte +48 -52
- package/dist/components/switch/Switch.svelte.d.ts +10 -0
- package/dist/components/switch/index.d.ts +4 -0
- package/dist/components/switch/index.js +4 -0
- package/dist/components/table/Table.svelte +38 -27
- package/dist/components/table/Table.svelte.d.ts +43 -12
- package/dist/components/table/index.d.ts +5 -1
- package/dist/components/table/index.js +4 -0
- package/dist/components/tag-picker/TagPicker.svelte +78 -0
- package/dist/components/tag-picker/TagPicker.svelte.d.ts +32 -0
- package/dist/components/tag-picker/index.d.ts +5 -0
- package/dist/components/tag-picker/index.js +5 -0
- package/dist/components/textarea/Textarea.svelte +19 -2
- package/dist/components/textarea/Textarea.svelte.d.ts +12 -1
- package/dist/components/textarea/index.d.ts +4 -0
- package/dist/components/textarea/index.js +4 -0
- package/dist/components/theme-switch/ThemeSwitch.svelte +96 -105
- package/dist/components/theme-switch/ThemeSwitch.svelte.d.ts +24 -1
- package/dist/components/theme-switch/index.d.ts +5 -1
- package/dist/components/theme-switch/index.js +4 -0
- package/dist/components/thumb-card/ThumbCard.svelte +32 -8
- package/dist/components/thumb-card/ThumbCard.svelte.d.ts +13 -0
- package/dist/components/thumb-card/index.d.ts +4 -0
- package/dist/components/thumb-card/index.js +4 -0
- package/dist/components/timer/Timer.svelte +66 -22
- package/dist/components/timer/Timer.svelte.d.ts +24 -0
- package/dist/components/timer/index.d.ts +5 -1
- package/dist/components/timer/index.js +4 -0
- package/dist/components/toast/Toast.svelte +45 -15
- package/dist/components/toast/Toast.svelte.d.ts +14 -1
- package/dist/components/toast/Toaster.svelte +26 -3
- package/dist/components/toast/Toaster.svelte.d.ts +11 -0
- package/dist/components/toast/index.d.ts +4 -0
- package/dist/components/toast/index.js +4 -0
- package/dist/components/toggle/Toggle.svelte +19 -7
- package/dist/components/toggle/Toggle.svelte.d.ts +13 -1
- package/dist/components/toggle/index.d.ts +4 -0
- package/dist/components/toggle/index.js +4 -0
- package/dist/components/toggle-group/ToggleGroup.svelte +74 -12
- package/dist/components/toggle-group/ToggleGroup.svelte.d.ts +23 -1
- package/dist/components/toggle-group/index.d.ts +4 -0
- package/dist/components/toggle-group/index.js +4 -0
- package/dist/components/toggle-tooltip/ToggleTooltip.svelte +47 -24
- package/dist/components/toggle-tooltip/ToggleTooltip.svelte.d.ts +16 -2
- package/dist/components/toggle-tooltip/index.d.ts +4 -0
- package/dist/components/toggle-tooltip/index.js +4 -0
- package/dist/components/tooltip/Tooltip.svelte +61 -11
- package/dist/components/tooltip/Tooltip.svelte.d.ts +28 -1
- package/dist/components/tooltip/index.d.ts +4 -0
- package/dist/components/tooltip/index.js +4 -0
- package/dist/components/tour/Tour.svelte +61 -33
- package/dist/components/tour/Tour.svelte.d.ts +21 -4
- package/dist/components/tour/index.d.ts +4 -0
- package/dist/components/tour/index.js +4 -0
- package/dist/components/virtual-list/VirtualList.svelte +107 -0
- package/dist/components/virtual-list/VirtualList.svelte.d.ts +55 -0
- package/dist/components/virtual-list/index.d.ts +5 -0
- package/dist/components/virtual-list/index.js +5 -0
- package/dist/components/virtual-list/range.d.ts +24 -0
- package/dist/components/virtual-list/range.js +22 -0
- package/dist/components/virtual-tree/VirtualTree.svelte +304 -0
- package/dist/components/virtual-tree/VirtualTree.svelte.d.ts +104 -0
- package/dist/components/virtual-tree/index.d.ts +8 -0
- package/dist/components/virtual-tree/index.js +7 -0
- package/dist/components/vote-buttons/VoteButtons.svelte +87 -0
- package/dist/components/vote-buttons/VoteButtons.svelte.d.ts +36 -0
- package/dist/components/vote-buttons/index.d.ts +5 -0
- package/dist/components/vote-buttons/index.js +5 -0
- package/dist/editor/drag-preview.d.ts +8 -0
- package/dist/editor/drag-preview.js +28 -0
- package/dist/editor/file-tree/FileTree.svelte +122 -0
- package/dist/editor/file-tree/FileTree.svelte.d.ts +44 -0
- package/dist/{components → editor}/file-tree/index.d.ts +5 -0
- package/dist/editor/file-tree/index.js +7 -0
- package/dist/editor/hierarchy-view/HierarchyView.svelte +438 -0
- package/dist/editor/hierarchy-view/HierarchyView.svelte.d.ts +68 -0
- package/dist/editor/hierarchy-view/index.d.ts +18 -0
- package/dist/editor/hierarchy-view/index.js +5 -0
- package/dist/editor/horizon-layout/HorizonLayout.svelte +62 -0
- package/dist/editor/horizon-layout/HorizonLayout.svelte.d.ts +25 -0
- package/dist/{components → editor}/horizon-layout/horizon-layout.css +141 -64
- package/dist/{components → editor}/horizon-layout/index.d.ts +4 -0
- package/dist/{components → editor}/horizon-layout/index.js +4 -0
- package/dist/editor/index.d.ts +11 -0
- package/dist/editor/index.js +11 -0
- package/dist/editor/inspector-panel/InspectorPanel.svelte +326 -0
- package/dist/editor/inspector-panel/InspectorPanel.svelte.d.ts +57 -0
- package/dist/editor/inspector-panel/index.d.ts +5 -0
- package/dist/editor/inspector-panel/index.js +5 -0
- package/dist/editor/monaco-theme.d.ts +27 -0
- package/dist/editor/monaco-theme.js +104 -0
- package/dist/fonts/HorizonSans-latin-ext.woff2 +0 -0
- package/dist/fonts/HorizonSans-latin.woff2 +0 -0
- package/dist/fonts/OFL-EncodeSans.txt +93 -0
- package/dist/fonts/OFL-Lilex.txt +93 -0
- package/dist/generated/theme.css +295 -0
- package/dist/generated/tokens.d.ts +23 -0
- package/dist/generated/tokens.js +125 -0
- package/dist/horizon-design.css +14 -649
- package/dist/index.d.ts +88 -71
- package/dist/index.js +87 -73
- package/dist/motion/page-transition.d.ts +37 -0
- package/dist/motion/page-transition.js +83 -0
- package/dist/motion/sliding-indicator.d.ts +28 -0
- package/dist/motion/sliding-indicator.js +54 -0
- package/dist/platform.d.ts +21 -0
- package/dist/platform.js +19 -0
- package/dist/styles/base.css +86 -0
- package/dist/styles/fonts.css +70 -0
- package/dist/styles/frosted.css +9 -0
- package/dist/styles/motion.css +78 -0
- package/dist/styles/scale.css +210 -0
- package/dist/theme.svelte.d.ts +29 -8
- package/dist/theme.svelte.js +90 -44
- package/dist/utils.d.ts +12 -0
- package/dist/utils.js +29 -1
- package/package.json +102 -82
- package/dist/components/avatar/AvatarGroup.svelte +0 -18
- package/dist/components/avatar/AvatarGroup.svelte.d.ts +0 -9
- package/dist/components/circular-slider/circular-slider-context.d.ts +0 -9
- package/dist/components/circular-slider/circular-slider-context.js +0 -8
- package/dist/components/file-tree/FileTree.svelte +0 -214
- package/dist/components/file-tree/FileTree.svelte.d.ts +0 -28
- package/dist/components/file-tree/index.js +0 -2
- package/dist/components/hierarchy-view/HierarchyView.svelte +0 -763
- package/dist/components/hierarchy-view/HierarchyView.svelte.d.ts +0 -21
- package/dist/components/hierarchy-view/index.d.ts +0 -8
- package/dist/components/hierarchy-view/index.js +0 -1
- package/dist/components/horizon-layout/HorizonLayout.svelte +0 -78
- package/dist/components/horizon-layout/HorizonLayout.svelte.d.ts +0 -51
- package/dist/components/inspector-panel/InspectorPanel.svelte +0 -321
- package/dist/components/inspector-panel/InspectorPanel.svelte.d.ts +0 -18
- package/dist/components/inspector-panel/index.d.ts +0 -1
- package/dist/components/inspector-panel/index.js +0 -1
- package/dist/components/table/TableBody.svelte +0 -18
- package/dist/components/table/TableBody.svelte.d.ts +0 -9
- package/dist/components/table/TableCell.svelte +0 -25
- package/dist/components/table/TableCell.svelte.d.ts +0 -9
- package/dist/components/table/TableHead.svelte +0 -25
- package/dist/components/table/TableHead.svelte.d.ts +0 -9
- package/dist/components/table/TableHeader.svelte +0 -22
- package/dist/components/table/TableHeader.svelte.d.ts +0 -9
- package/dist/components/table/TableRow.svelte +0 -25
- package/dist/components/table/TableRow.svelte.d.ts +0 -9
- package/dist/components/tabs/Tabs.svelte +0 -111
- package/dist/components/tabs/Tabs.svelte.d.ts +0 -19
- package/dist/components/tabs/index.d.ts +0 -1
- package/dist/components/tabs/index.js +0 -1
- package/dist/fonts/EncodeSans-latin-ext.woff2 +0 -0
- package/dist/fonts/EncodeSans-latin.woff2 +0 -0
- package/dist/monaco-theme.d.ts +0 -12
- package/dist/monaco-theme.js +0 -153
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
The Editor's inspector: a column of collapsible cards (a component each) that can be reordered by
|
|
4
|
+
drag or keyboard.
|
|
5
|
+
|
|
6
|
+
Each card's header is a button that opens and closes it. On a header, the up and down arrows move
|
|
7
|
+
the focus to the card above or below, Home and End to the first and the last, and Shift+up and
|
|
8
|
+
Shift+down move the card itself. With the pointer, a card is dragged by its handle, which assistive
|
|
9
|
+
technologies don't see (the header's Shift+arrows are their way to reorder), and dropped on the
|
|
10
|
+
upper or lower half of another card to go before or after it.
|
|
11
|
+
|
|
12
|
+
With `onRemove`, each card's header ends with a remove button (an icon button whose tooltip and
|
|
13
|
+
accessible name are `removeLabel(card)`), except on cards marked `removable: false`. The panel only
|
|
14
|
+
reports the press: the app removes the card from `cards`. When it does so during `onRemove`, the
|
|
15
|
+
focus, which fell with the card, moves to the header that took its place, or to the one above; an
|
|
16
|
+
app that asks first (a confirmation dialog) gives the focus back itself once it removes the card.
|
|
17
|
+
-->
|
|
18
|
+
<script module lang="ts">
|
|
19
|
+
/** A card of the inspector: one component of the selected object. */
|
|
20
|
+
export type InspectorCard = {
|
|
21
|
+
/** Unique among the cards. */
|
|
22
|
+
id: string;
|
|
23
|
+
/** The card's heading, such as the component's name. */
|
|
24
|
+
title: string;
|
|
25
|
+
/** A short summary shown after the title, such as the component's main value. */
|
|
26
|
+
subtitle?: string;
|
|
27
|
+
/** `false` hides the card's remove button, for a component the object can't lose. */
|
|
28
|
+
removable?: boolean;
|
|
29
|
+
/** The app's own data for the card's body (`content`), such as the component's fields. */
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** The remove buttons: both props or neither, so a button never goes without its name. */
|
|
34
|
+
type RemoveProps =
|
|
35
|
+
| { onRemove?: undefined; removeLabel?: undefined }
|
|
36
|
+
| {
|
|
37
|
+
/** Called with the card whose remove button was pressed. */
|
|
38
|
+
onRemove: (card: InspectorCard) => void;
|
|
39
|
+
/** A card's remove button's name and tooltip, translated, such as "Remove Transform". */
|
|
40
|
+
removeLabel: (card: InspectorCard) => string;
|
|
41
|
+
};
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<script lang="ts">
|
|
45
|
+
import { tick, type Snippet } from 'svelte';
|
|
46
|
+
import type { Attachment } from 'svelte/attachments';
|
|
47
|
+
import {
|
|
48
|
+
draggable,
|
|
49
|
+
dropTargetForElements,
|
|
50
|
+
monitorForElements
|
|
51
|
+
} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
52
|
+
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
53
|
+
import { attachClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge/attach-closest-edge';
|
|
54
|
+
import { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge/extract-closest-edge';
|
|
55
|
+
import type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/types';
|
|
56
|
+
import { reorderWithEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/reorder-with-edge';
|
|
57
|
+
import { cn } from '../../utils.js';
|
|
58
|
+
import MingcuteRightLine from '~icons/mingcute/right-line';
|
|
59
|
+
import MingcuteDotsVerticalLine from '~icons/mingcute/dots-vertical-line';
|
|
60
|
+
import MingcuteDelete2Line from '~icons/mingcute/delete-2-line';
|
|
61
|
+
import IconButton from '../../components/icon-button/IconButton.svelte';
|
|
62
|
+
import { setTextDragPreview } from '../drag-preview';
|
|
63
|
+
|
|
64
|
+
let {
|
|
65
|
+
class: className = '',
|
|
66
|
+
cards = $bindable<InspectorCard[]>([]),
|
|
67
|
+
expandedIds = $bindable<string[]>([]),
|
|
68
|
+
content,
|
|
69
|
+
onCardsChange,
|
|
70
|
+
onExpandedChange,
|
|
71
|
+
onRemove,
|
|
72
|
+
removeLabel
|
|
73
|
+
}: {
|
|
74
|
+
/** Classes added to the column's element. */
|
|
75
|
+
class?: string;
|
|
76
|
+
/** The cards, top to bottom. */
|
|
77
|
+
cards?: InspectorCard[];
|
|
78
|
+
/** The ids of the open cards. */
|
|
79
|
+
expandedIds?: string[];
|
|
80
|
+
/** A card's body, shown while it is open. */
|
|
81
|
+
content?: Snippet<[InspectorCard]>;
|
|
82
|
+
/** Called with the cards in their new order after the user moves one. */
|
|
83
|
+
onCardsChange?: (cards: InspectorCard[]) => void;
|
|
84
|
+
/** Called with the ids of the open cards after the user opens or closes one. */
|
|
85
|
+
onExpandedChange?: (expandedIds: string[]) => void;
|
|
86
|
+
} & RemoveProps = $props();
|
|
87
|
+
|
|
88
|
+
const uid = $props.id();
|
|
89
|
+
/** Tags this panel's drags: its cards take nothing else, and other views ignore them. */
|
|
90
|
+
const dragType = `${uid}-card`;
|
|
91
|
+
|
|
92
|
+
let draggingId = $state<string | null>(null);
|
|
93
|
+
/** Where the dragged card would land: above or below the card under the pointer. */
|
|
94
|
+
let dropTarget = $state.raw<{ id: string; edge: Edge } | null>(null);
|
|
95
|
+
|
|
96
|
+
function headerId(id: string): string {
|
|
97
|
+
return `${uid}-header-${encodeURIComponent(id)}`;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function bodyId(id: string): string {
|
|
101
|
+
return `${uid}-body-${encodeURIComponent(id)}`;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function focusHeader(id: string | undefined) {
|
|
105
|
+
if (id !== undefined) document.getElementById(headerId(id))?.focus();
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** Opens or closes a card; the reported ids leave out those of cards no longer shown. */
|
|
109
|
+
function toggleExpanded(id: string) {
|
|
110
|
+
const shown = expandedIds.filter((v) => cards.some((c) => c.id === v));
|
|
111
|
+
const next = shown.includes(id) ? shown.filter((v) => v !== id) : [...shown, id];
|
|
112
|
+
expandedIds = next;
|
|
113
|
+
onExpandedChange?.(next);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** Whether the keyboard focus is nowhere (on the body), as when the focused button is removed. */
|
|
117
|
+
function isFocusLost(): boolean {
|
|
118
|
+
return document.activeElement === null || document.activeElement === document.body;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Reports the removal; if the app removed the card meanwhile (replacing `cards` or changing it in
|
|
123
|
+
* place), the focus, which fell with the card's remove button, moves to the header that took its
|
|
124
|
+
* place, or to the one above.
|
|
125
|
+
*/
|
|
126
|
+
async function removeCard(card: InspectorCard, index: number) {
|
|
127
|
+
onRemove?.(card);
|
|
128
|
+
await tick();
|
|
129
|
+
const ids = cards.map((c) => c.id);
|
|
130
|
+
if (ids.includes(card.id) || !isFocusLost()) return;
|
|
131
|
+
focusHeader(ids[index] ?? ids[index - 1]);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function setCards(next: InspectorCard[]) {
|
|
135
|
+
cards = next;
|
|
136
|
+
onCardsChange?.(next);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
async function moveCard(index: number, delta: -1 | 1) {
|
|
140
|
+
const to = index + delta;
|
|
141
|
+
if (to < 0 || to >= cards.length) return;
|
|
142
|
+
const next = [...cards];
|
|
143
|
+
[next[index], next[to]] = [next[to], next[index]];
|
|
144
|
+
setCards(next);
|
|
145
|
+
// Reordering moves the header's element, which loses the focus in some browsers.
|
|
146
|
+
await tick();
|
|
147
|
+
focusHeader(next[to].id);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function handleHeaderKeydown(event: KeyboardEvent, index: number) {
|
|
151
|
+
const last = cards.length - 1;
|
|
152
|
+
if (event.shiftKey && (event.key === 'ArrowUp' || event.key === 'ArrowDown')) {
|
|
153
|
+
event.preventDefault();
|
|
154
|
+
void moveCard(index, event.key === 'ArrowUp' ? -1 : 1);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const targets: Record<string, number> = {
|
|
158
|
+
ArrowUp: index > 0 ? index - 1 : last,
|
|
159
|
+
ArrowDown: index < last ? index + 1 : 0,
|
|
160
|
+
Home: 0,
|
|
161
|
+
End: last
|
|
162
|
+
};
|
|
163
|
+
const target = targets[event.key];
|
|
164
|
+
if (target === undefined) return;
|
|
165
|
+
event.preventDefault();
|
|
166
|
+
focusHeader(cards[target]?.id);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function isOwnDrag(data: Record<string | symbol, unknown>): boolean {
|
|
170
|
+
return data.type === dragType;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/** A card's handle drags the card, shown by its title beside the pointer. */
|
|
174
|
+
function handleDrag(card: InspectorCard): Attachment<HTMLElement> {
|
|
175
|
+
return (element) =>
|
|
176
|
+
draggable({
|
|
177
|
+
element,
|
|
178
|
+
getInitialData: () => ({ type: dragType, id: card.id }),
|
|
179
|
+
onGenerateDragPreview: ({ nativeSetDragImage }) =>
|
|
180
|
+
setTextDragPreview(nativeSetDragImage, card.title),
|
|
181
|
+
onDragStart: () => (draggingId = card.id)
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** A card takes the dragged card above or below it, whichever half the pointer is over. */
|
|
186
|
+
function cardDrop(card: InspectorCard): Attachment<HTMLElement> {
|
|
187
|
+
return (element) =>
|
|
188
|
+
dropTargetForElements({
|
|
189
|
+
element,
|
|
190
|
+
canDrop: ({ source }) => isOwnDrag(source.data),
|
|
191
|
+
// The gaps between cards keep the last card hovered, so a drop there still lands.
|
|
192
|
+
getIsSticky: () => true,
|
|
193
|
+
getData: ({ input, element }) =>
|
|
194
|
+
attachClosestEdge({ id: card.id }, { input, element, allowedEdges: ['top', 'bottom'] }),
|
|
195
|
+
onDrag: ({ self, source }) => {
|
|
196
|
+
const edge = extractClosestEdge(self.data);
|
|
197
|
+
const next = edge && source.data.id !== card.id ? { id: card.id, edge } : null;
|
|
198
|
+
if (next?.id !== dropTarget?.id || next?.edge !== dropTarget?.edge) dropTarget = next;
|
|
199
|
+
},
|
|
200
|
+
onDragLeave: () => {
|
|
201
|
+
if (dropTarget?.id === card.id) dropTarget = null;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Makes the panel a drop target of its own cards, so a card stays hovered only across the gaps
|
|
208
|
+
* between cards (stickiness ends where the panel does), and ends every drag of the panel,
|
|
209
|
+
* moving a card dropped on another next to it.
|
|
210
|
+
*/
|
|
211
|
+
function panelDrop(element: HTMLElement) {
|
|
212
|
+
return combine(
|
|
213
|
+
dropTargetForElements({ element, canDrop: ({ source }) => isOwnDrag(source.data) }),
|
|
214
|
+
monitorForElements({
|
|
215
|
+
canMonitor: ({ source }) => isOwnDrag(source.data),
|
|
216
|
+
onDrop: ({ source, location }) => {
|
|
217
|
+
draggingId = null;
|
|
218
|
+
dropTarget = null;
|
|
219
|
+
// The innermost target: a card, or the panel itself, which moves nothing.
|
|
220
|
+
const target = location.current.dropTargets[0]?.data;
|
|
221
|
+
if (typeof target?.id !== 'string') return;
|
|
222
|
+
const startIndex = cards.findIndex((c) => c.id === source.data.id);
|
|
223
|
+
const next = reorderWithEdge({
|
|
224
|
+
list: cards,
|
|
225
|
+
startIndex,
|
|
226
|
+
indexOfTarget: cards.findIndex((c) => c.id === target.id),
|
|
227
|
+
closestEdgeOfTarget: extractClosestEdge(target),
|
|
228
|
+
axis: 'vertical'
|
|
229
|
+
});
|
|
230
|
+
if (next.some((card, i) => card !== cards[i])) setCards(next);
|
|
231
|
+
}
|
|
232
|
+
})
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
</script>
|
|
236
|
+
|
|
237
|
+
<div
|
|
238
|
+
{@attach panelDrop}
|
|
239
|
+
data-slot="inspector-panel"
|
|
240
|
+
class={cn('flex flex-col gap-1 text-sm', className)}
|
|
241
|
+
>
|
|
242
|
+
{#each cards as card, i (card.id)}
|
|
243
|
+
{@const isExpanded = expandedIds.includes(card.id)}
|
|
244
|
+
|
|
245
|
+
<div
|
|
246
|
+
{@attach cardDrop(card)}
|
|
247
|
+
data-slot="inspector-panel-card"
|
|
248
|
+
class={cn(
|
|
249
|
+
'relative flex flex-col rounded-md border border-border transition-opacity duration-150',
|
|
250
|
+
draggingId === card.id && 'opacity-30'
|
|
251
|
+
)}
|
|
252
|
+
>
|
|
253
|
+
{#if dropTarget?.id === card.id}
|
|
254
|
+
<div
|
|
255
|
+
class={[
|
|
256
|
+
'pointer-events-none absolute inset-x-1 h-px rounded-full bg-primary',
|
|
257
|
+
dropTarget.edge === 'top' ? '-top-0.75' : '-bottom-0.75'
|
|
258
|
+
]}
|
|
259
|
+
aria-hidden="true"
|
|
260
|
+
></div>
|
|
261
|
+
{/if}
|
|
262
|
+
<div class="flex items-center rounded-sm pr-2 transition-colors hover:bg-hover/50">
|
|
263
|
+
<button
|
|
264
|
+
type="button"
|
|
265
|
+
id={headerId(card.id)}
|
|
266
|
+
aria-expanded={isExpanded}
|
|
267
|
+
aria-controls={bodyId(card.id)}
|
|
268
|
+
aria-keyshortcuts="Shift+ArrowUp Shift+ArrowDown"
|
|
269
|
+
class="flex min-w-0 flex-1 cursor-default items-center gap-1.5 rounded-sm px-2 py-1.5 text-left"
|
|
270
|
+
onclick={() => toggleExpanded(card.id)}
|
|
271
|
+
onkeydown={(event) => handleHeaderKeydown(event, i)}
|
|
272
|
+
>
|
|
273
|
+
<MingcuteRightLine
|
|
274
|
+
aria-hidden="true"
|
|
275
|
+
class={cn(
|
|
276
|
+
'size-3.5 shrink-0 text-muted transition-transform duration-200',
|
|
277
|
+
isExpanded && 'rotate-90'
|
|
278
|
+
)}
|
|
279
|
+
/>
|
|
280
|
+
<span class="flex-1 truncate leading-none font-medium">{card.title}</span>
|
|
281
|
+
{#if card.subtitle}
|
|
282
|
+
<span class="text-xs text-muted">{card.subtitle}</span>
|
|
283
|
+
{/if}
|
|
284
|
+
</button>
|
|
285
|
+
{#if onRemove && removeLabel && card.removable !== false}
|
|
286
|
+
<IconButton
|
|
287
|
+
label={removeLabel(card)}
|
|
288
|
+
size="xs"
|
|
289
|
+
side="left"
|
|
290
|
+
data-slot="inspector-panel-remove"
|
|
291
|
+
onclick={() => void removeCard(card, i)}
|
|
292
|
+
>
|
|
293
|
+
<MingcuteDelete2Line aria-hidden="true" />
|
|
294
|
+
</IconButton>
|
|
295
|
+
{/if}
|
|
296
|
+
<!-- Pointer only: on the keyboard, Shift+arrows on the header move the card. -->
|
|
297
|
+
<div
|
|
298
|
+
{@attach handleDrag(card)}
|
|
299
|
+
aria-hidden="true"
|
|
300
|
+
data-slot="inspector-panel-handle"
|
|
301
|
+
class="ml-1 flex shrink-0 cursor-grab items-center rounded text-muted transition-colors hover:text-fg active:cursor-grabbing"
|
|
302
|
+
>
|
|
303
|
+
<!-- The icon's two rows of three dots, turned into the usual upright grip. -->
|
|
304
|
+
<MingcuteDotsVerticalLine class="size-4 rotate-90" />
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
307
|
+
|
|
308
|
+
<div
|
|
309
|
+
id={bodyId(card.id)}
|
|
310
|
+
class={cn(
|
|
311
|
+
'grid transition-[grid-template-rows] duration-200 ease-out',
|
|
312
|
+
isExpanded ? 'grid-rows-[1fr]' : 'grid-rows-[0fr]'
|
|
313
|
+
)}
|
|
314
|
+
inert={!isExpanded}
|
|
315
|
+
>
|
|
316
|
+
<div class="overflow-hidden">
|
|
317
|
+
<div class="border-t border-border px-3 py-2.5">
|
|
318
|
+
{#if content}
|
|
319
|
+
{@render content(card)}
|
|
320
|
+
{/if}
|
|
321
|
+
</div>
|
|
322
|
+
</div>
|
|
323
|
+
</div>
|
|
324
|
+
</div>
|
|
325
|
+
{/each}
|
|
326
|
+
</div>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** A card of the inspector: one component of the selected object. */
|
|
2
|
+
export type InspectorCard = {
|
|
3
|
+
/** Unique among the cards. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** The card's heading, such as the component's name. */
|
|
6
|
+
title: string;
|
|
7
|
+
/** A short summary shown after the title, such as the component's main value. */
|
|
8
|
+
subtitle?: string;
|
|
9
|
+
/** `false` hides the card's remove button, for a component the object can't lose. */
|
|
10
|
+
removable?: boolean;
|
|
11
|
+
/** The app's own data for the card's body (`content`), such as the component's fields. */
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
/** The remove buttons: both props or neither, so a button never goes without its name. */
|
|
15
|
+
type RemoveProps = {
|
|
16
|
+
onRemove?: undefined;
|
|
17
|
+
removeLabel?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
/** Called with the card whose remove button was pressed. */
|
|
20
|
+
onRemove: (card: InspectorCard) => void;
|
|
21
|
+
/** A card's remove button's name and tooltip, translated, such as "Remove Transform". */
|
|
22
|
+
removeLabel: (card: InspectorCard) => string;
|
|
23
|
+
};
|
|
24
|
+
import { type Snippet } from 'svelte';
|
|
25
|
+
type $$ComponentProps = {
|
|
26
|
+
/** Classes added to the column's element. */
|
|
27
|
+
class?: string;
|
|
28
|
+
/** The cards, top to bottom. */
|
|
29
|
+
cards?: InspectorCard[];
|
|
30
|
+
/** The ids of the open cards. */
|
|
31
|
+
expandedIds?: string[];
|
|
32
|
+
/** A card's body, shown while it is open. */
|
|
33
|
+
content?: Snippet<[InspectorCard]>;
|
|
34
|
+
/** Called with the cards in their new order after the user moves one. */
|
|
35
|
+
onCardsChange?: (cards: InspectorCard[]) => void;
|
|
36
|
+
/** Called with the ids of the open cards after the user opens or closes one. */
|
|
37
|
+
onExpandedChange?: (expandedIds: string[]) => void;
|
|
38
|
+
} & RemoveProps;
|
|
39
|
+
/**
|
|
40
|
+
* The Editor's inspector: a column of collapsible cards (a component each) that can be reordered by
|
|
41
|
+
* drag or keyboard.
|
|
42
|
+
*
|
|
43
|
+
* Each card's header is a button that opens and closes it. On a header, the up and down arrows move
|
|
44
|
+
* the focus to the card above or below, Home and End to the first and the last, and Shift+up and
|
|
45
|
+
* Shift+down move the card itself. With the pointer, a card is dragged by its handle, which assistive
|
|
46
|
+
* technologies don't see (the header's Shift+arrows are their way to reorder), and dropped on the
|
|
47
|
+
* upper or lower half of another card to go before or after it.
|
|
48
|
+
*
|
|
49
|
+
* With `onRemove`, each card's header ends with a remove button (an icon button whose tooltip and
|
|
50
|
+
* accessible name are `removeLabel(card)`), except on cards marked `removable: false`. The panel only
|
|
51
|
+
* reports the press: the app removes the card from `cards`. When it does so during `onRemove`, the
|
|
52
|
+
* focus, which fell with the card, moves to the header that took its place, or to the one above; an
|
|
53
|
+
* app that asks first (a confirmation dialog) gives the focus back itself once it removes the card.
|
|
54
|
+
*/
|
|
55
|
+
declare const InspectorPanel: import("svelte").Component<$$ComponentProps, {}, "cards" | "expandedIds">;
|
|
56
|
+
type InspectorPanel = ReturnType<typeof InspectorPanel>;
|
|
57
|
+
export default InspectorPanel;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Monaco editor theme of horizon-design, built from the colour tokens' hex values (Monaco
|
|
3
|
+
* takes no CSS variables), so code editors match the rest of the interface in either theme.
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { type Theme } from '../generated/tokens';
|
|
7
|
+
/** Monaco's `IStandaloneThemeData`, without depending on Monaco's types. */
|
|
8
|
+
export interface MonacoThemeData {
|
|
9
|
+
base: 'vs' | 'vs-dark';
|
|
10
|
+
inherit: boolean;
|
|
11
|
+
rules: {
|
|
12
|
+
token: string;
|
|
13
|
+
foreground: string;
|
|
14
|
+
fontStyle?: string;
|
|
15
|
+
}[];
|
|
16
|
+
colors: Record<string, string>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The Monaco theme for a theme of horizon-design. Define it once per theme and switch with the
|
|
20
|
+
* app's resolved theme.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* monaco.editor.defineTheme('horizon-dark', createMonacoTheme('dark'));
|
|
24
|
+
* monaco.editor.defineTheme('horizon-light', createMonacoTheme('light'));
|
|
25
|
+
* monaco.editor.setTheme(`horizon-${theme.resolved}`);
|
|
26
|
+
*/
|
|
27
|
+
export declare function createMonacoTheme(theme: Theme): MonacoThemeData;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Monaco editor theme of horizon-design, built from the colour tokens' hex values (Monaco
|
|
3
|
+
* takes no CSS variables), so code editors match the rest of the interface in either theme.
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { tokenValues } from '../generated/tokens';
|
|
7
|
+
/**
|
|
8
|
+
* The Monaco theme for a theme of horizon-design. Define it once per theme and switch with the
|
|
9
|
+
* app's resolved theme.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* monaco.editor.defineTheme('horizon-dark', createMonacoTheme('dark'));
|
|
13
|
+
* monaco.editor.defineTheme('horizon-light', createMonacoTheme('light'));
|
|
14
|
+
* monaco.editor.setTheme(`horizon-${theme.resolved}`);
|
|
15
|
+
*/
|
|
16
|
+
export function createMonacoTheme(theme) {
|
|
17
|
+
const t = Object.fromEntries(Object.entries(tokenValues[theme]).map(([name, value]) => [name, value.hex]));
|
|
18
|
+
// Monaco's token rules take a hex colour without the leading '#'.
|
|
19
|
+
const rule = (token, color, fontStyle) => ({
|
|
20
|
+
token,
|
|
21
|
+
foreground: color.slice(1),
|
|
22
|
+
...(fontStyle ? { fontStyle } : {})
|
|
23
|
+
});
|
|
24
|
+
// A translucent tint of an opaque token: its hex with an alpha byte appended.
|
|
25
|
+
const tint = (color, alphaByte) => `${color.slice(0, 7)}${alphaByte}`;
|
|
26
|
+
return {
|
|
27
|
+
base: theme === 'dark' ? 'vs-dark' : 'vs',
|
|
28
|
+
inherit: false,
|
|
29
|
+
rules: [
|
|
30
|
+
rule('', t.fg),
|
|
31
|
+
rule('comment', t['code-comment'], 'italic'),
|
|
32
|
+
rule('comment.doc', t['code-comment'], 'italic'),
|
|
33
|
+
rule('string', t['code-string']),
|
|
34
|
+
rule('string.escape', t['code-string']),
|
|
35
|
+
rule('regexp', t['code-string']),
|
|
36
|
+
rule('keyword', t['code-keyword']),
|
|
37
|
+
rule('keyword.control', t['code-keyword']),
|
|
38
|
+
rule('tag', t['code-keyword']),
|
|
39
|
+
rule('number', t['code-number']),
|
|
40
|
+
rule('constant', t['code-number']),
|
|
41
|
+
rule('type', t['code-type']),
|
|
42
|
+
rule('class', t['code-type']),
|
|
43
|
+
rule('function', t['code-function']),
|
|
44
|
+
rule('key', t['code-function']),
|
|
45
|
+
rule('attribute.name', t['code-attribute']),
|
|
46
|
+
rule('attribute.value', t['code-string']),
|
|
47
|
+
rule('variable', t.fg),
|
|
48
|
+
rule('variable.predefined', t['code-attribute']),
|
|
49
|
+
rule('delimiter', t.muted),
|
|
50
|
+
rule('metatag', t.muted)
|
|
51
|
+
],
|
|
52
|
+
colors: {
|
|
53
|
+
'editor.background': t.background,
|
|
54
|
+
'editor.foreground': t.fg,
|
|
55
|
+
'editor.selectionBackground': tint(t.primary, '4d'),
|
|
56
|
+
'editor.inactiveSelectionBackground': t.active,
|
|
57
|
+
'editor.lineHighlightBackground': t['code-line'],
|
|
58
|
+
'editor.lineHighlightBorder': tint(t.background, '00'),
|
|
59
|
+
'editorCursor.foreground': t.primary,
|
|
60
|
+
'editorLineNumber.foreground': t.faint,
|
|
61
|
+
'editorLineNumber.activeForeground': t['fg-2'],
|
|
62
|
+
'editorIndentGuide.background1': t.border,
|
|
63
|
+
'editorIndentGuide.activeBackground1': t['border-strong'],
|
|
64
|
+
'editorBracketMatch.background': t['primary-subtle'],
|
|
65
|
+
'editorBracketMatch.border': t['primary-border'],
|
|
66
|
+
'editorGutter.background': t.background,
|
|
67
|
+
'editorWidget.background': t.raised,
|
|
68
|
+
'editorWidget.foreground': t.fg,
|
|
69
|
+
'editorWidget.border': t['border-strong'],
|
|
70
|
+
'editorSuggestWidget.background': t.raised,
|
|
71
|
+
'editorSuggestWidget.border': t['border-strong'],
|
|
72
|
+
'editorSuggestWidget.foreground': t.fg,
|
|
73
|
+
'editorSuggestWidget.selectedBackground': t['primary-subtle'],
|
|
74
|
+
'editorSuggestWidget.selectedForeground': t.fg,
|
|
75
|
+
'editorSuggestWidget.highlightForeground': t.primary,
|
|
76
|
+
'editorHoverWidget.background': t.raised,
|
|
77
|
+
'editorHoverWidget.border': t['border-strong'],
|
|
78
|
+
'editorHoverWidget.foreground': t.fg,
|
|
79
|
+
'editorError.foreground': t.danger,
|
|
80
|
+
'editorWarning.foreground': t.warning,
|
|
81
|
+
'editorInfo.foreground': t.info,
|
|
82
|
+
'input.background': t.sunken,
|
|
83
|
+
'input.foreground': t.fg,
|
|
84
|
+
'input.border': t.border,
|
|
85
|
+
'input.placeholderForeground': t.muted,
|
|
86
|
+
focusBorder: t.primary,
|
|
87
|
+
'list.hoverBackground': t.hover,
|
|
88
|
+
'list.hoverForeground': t.fg,
|
|
89
|
+
'list.activeSelectionBackground': t['primary-subtle'],
|
|
90
|
+
'list.activeSelectionForeground': t.fg,
|
|
91
|
+
'list.inactiveSelectionBackground': t.active,
|
|
92
|
+
'list.focusBackground': t['primary-subtle'],
|
|
93
|
+
'list.focusForeground': t.fg,
|
|
94
|
+
'list.highlightForeground': t.primary,
|
|
95
|
+
'scrollbarSlider.background': tint(t.faint, '40'),
|
|
96
|
+
'scrollbarSlider.hoverBackground': tint(t.faint, '66'),
|
|
97
|
+
'scrollbarSlider.activeBackground': tint(t.faint, '80'),
|
|
98
|
+
'scrollbar.shadow': tint(t.background, '00'),
|
|
99
|
+
'dropdown.background': t.raised,
|
|
100
|
+
'dropdown.foreground': t.fg,
|
|
101
|
+
'dropdown.border': t['border-strong']
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2020 The Encode Project Authors (https://github.com/thundernixon/Encode-Sans), with Reserved Font Name "Encode Sans”.
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
https://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|