@splendidlabz/svelte 4.0.1 → 4.2.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 +25 -2
- package/components/Breadcrumbs/Breadcrumbs.svelte +10 -10
- package/components/Codepen/Codepen.svelte +11 -14
- package/components/Codepen/index.js +0 -1
- package/components/Disclosure/Disclosure/DisclosureContent.svelte +2 -2
- package/components/Disclosure/Drawer/DrawerCloseButton.svelte +2 -2
- package/{dist/components/Disclosure/DrawerNew/DrawerClose.svelte → components/Disclosure/DrawerNew/DrawerCloseButton.svelte} +8 -4
- package/{dist/components/Disclosure/DrawerNew/Drawer.svelte → components/Disclosure/DrawerNew/DrawerContent.svelte} +10 -8
- package/components/Disclosure/DrawerNew/index.js +8 -3
- package/{dist/components/Disclosure/ModalNew/Modal.svelte → components/Disclosure/ModalNew/ModalContent.svelte} +23 -7
- package/components/Disclosure/ModalNew/index.js +2 -2
- package/{dist/components/Disclosure/PopoverNew/Popover.svelte → components/Disclosure/PopoverNew/PopoverContent.svelte} +1 -1
- package/components/Disclosure/PopoverNew/PopoverTrigger.svelte +16 -6
- package/components/Disclosure/PopoverNew/floating.js +5 -2
- package/components/Disclosure/PopoverNew/index.js +2 -1
- package/components/FancyList/FancyList.svelte +54 -29
- package/components/Form/ButtonGroup.svelte +65 -0
- package/components/Form/Checkbox.svelte +7 -7
- package/components/Form/Combobox/TimepickerOptions.svelte +3 -4
- package/{dist/components/Form/Select.svelte → components/Form/CustomSelect.svelte} +65 -35
- package/components/Form/Form.svelte +37 -22
- package/components/Form/Honeypot.svelte +12 -0
- package/components/Form/Radios.svelte +2 -2
- package/components/Form/Select.svelte +50 -35
- package/components/Form/Textarea.svelte +0 -5
- package/components/Form/index.js +3 -0
- package/components/Link/Link.svelte +15 -0
- package/components/Link/index.js +1 -0
- package/components/PushToLocalStorage.svelte +9 -18
- package/components/SVG/SVG.svelte +49 -0
- package/components/SVG/index.js +2 -0
- package/components/SVG/parser.js +133 -0
- package/components/Status.svelte +8 -1
- package/components/Tabs/Tablist.svelte +2 -0
- package/components/Tabs/Tabpanels.svelte +1 -0
- package/components/Vimeo.svelte +3 -3
- package/components/Youtube.svelte +18 -7
- package/index.js +8 -7
- package/package.json +6 -5
- package/utils/accessibility.js +6 -0
- package/utils/index.js +2 -0
- package/utils/map-store.svelte.js +71 -0
- package/components/Codepen/Codepen.astro +0 -29
- package/components/Disclosure/DrawerNew/Drawer.svelte +0 -43
- package/components/Disclosure/DrawerNew/DrawerClose.svelte +0 -17
- package/components/Disclosure/ModalNew/Modal.svelte +0 -116
- package/components/Form/SelectOld2.svelte +0 -127
- package/dist/actions/breakpoint-observer.d.ts +0 -3
- package/dist/actions/breakpoint-observer.js +0 -71
- package/dist/actions/index.d.ts +0 -5
- package/dist/actions/index.js +0 -5
- package/dist/actions/portal.d.ts +0 -3
- package/dist/actions/portal.js +0 -20
- package/dist/actions/resize-observer.d.ts +0 -7
- package/dist/actions/resize-observer.js +0 -43
- package/dist/actions/scroll-observer.d.ts +0 -8
- package/dist/actions/scroll-observer.js +0 -47
- package/dist/actions/sync.svelte.d.ts +0 -5
- package/dist/actions/sync.svelte.js +0 -21
- package/dist/actions/use-actions.d.ts +0 -4
- package/dist/actions/use-actions.js +0 -27
- package/dist/actions/use-transition.d.ts +0 -4
- package/dist/actions/use-transition.js +0 -32
- package/dist/common.d.ts +0 -17
- package/dist/common.js +0 -21
- package/dist/components/Accordion/Accordion.svelte +0 -111
- package/dist/components/Accordion/Accordion.svelte.d.ts +0 -23
- package/dist/components/Accordion/index.d.ts +0 -2
- package/dist/components/Accordion/index.js +0 -3
- package/dist/components/Breadcrumbs/Breadcrumbs.svelte +0 -92
- package/dist/components/Breadcrumbs/Breadcrumbs.svelte.d.ts +0 -23
- package/dist/components/Breadcrumbs/Crumb.svelte +0 -51
- package/dist/components/Breadcrumbs/Crumb.svelte.d.ts +0 -23
- package/dist/components/Breadcrumbs/CrumbCustom.svelte +0 -18
- package/dist/components/Breadcrumbs/CrumbCustom.svelte.d.ts +0 -23
- package/dist/components/Breadcrumbs/index.d.ts +0 -4
- package/dist/components/Breadcrumbs/index.js +0 -5
- package/dist/components/BrowserFrame/BrowserFrame.svelte +0 -101
- package/dist/components/BrowserFrame/BrowserFrame.svelte.d.ts +0 -23
- package/dist/components/BrowserFrame/BrowserWithTabs.svelte +0 -37
- package/dist/components/BrowserFrame/BrowserWithTabs.svelte.d.ts +0 -41
- package/dist/components/BrowserFrame/index.d.ts +0 -3
- package/dist/components/BrowserFrame/index.js +0 -3
- package/dist/components/CQChecker/CQChecker.astro +0 -20
- package/dist/components/CQChecker/CQChecker.svelte +0 -89
- package/dist/components/CQChecker/CQChecker.svelte.d.ts +0 -35
- package/dist/components/Callout/Callout.svelte +0 -17
- package/dist/components/Callout/Callout.svelte.d.ts +0 -29
- package/dist/components/Callout/index.d.ts +0 -2
- package/dist/components/Callout/index.js +0 -3
- package/dist/components/Codepen/Codepen.astro +0 -29
- package/dist/components/Codepen/Codepen.svelte +0 -24
- package/dist/components/Codepen/Codepen.svelte.d.ts +0 -35
- package/dist/components/Codepen/index.d.ts +0 -2
- package/dist/components/Codepen/index.js +0 -3
- package/dist/components/ContentList/ContentList-old.svelte +0 -117
- package/dist/components/ContentList/ContentList-old.svelte.d.ts +0 -31
- package/dist/components/ContentList/ContentList.svelte +0 -68
- package/dist/components/ContentList/ContentList.svelte.d.ts +0 -45
- package/dist/components/ContentList/index.d.ts +0 -2
- package/dist/components/ContentList/index.js +0 -3
- package/dist/components/Copyright.svelte +0 -19
- package/dist/components/Copyright.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Disclosure/DisclosureCloseButton.svelte +0 -37
- package/dist/components/Disclosure/Disclosure/DisclosureCloseButton.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Disclosure/DisclosureContent.svelte +0 -97
- package/dist/components/Disclosure/Disclosure/DisclosureContent.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Disclosure/DisclosureTrigger.svelte +0 -51
- package/dist/components/Disclosure/Disclosure/DisclosureTrigger.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Disclosure/disclosure-popover.svelte.d.ts +0 -2
- package/dist/components/Disclosure/Disclosure/disclosure-popover.svelte.js +0 -7
- package/dist/components/Disclosure/Disclosure/disclosure.svelte.d.ts +0 -81
- package/dist/components/Disclosure/Disclosure/disclosure.svelte.js +0 -461
- package/dist/components/Disclosure/Disclosure/index.d.ts +0 -3
- package/dist/components/Disclosure/Disclosure/index.js +0 -4
- package/dist/components/Disclosure/DisclosureNew/DisclosureCloseButton.svelte +0 -38
- package/dist/components/Disclosure/DisclosureNew/DisclosureCloseButton.svelte.d.ts +0 -23
- package/dist/components/Disclosure/DisclosureNew/DisclosureContent.svelte +0 -53
- package/dist/components/Disclosure/DisclosureNew/DisclosureContent.svelte.d.ts +0 -23
- package/dist/components/Disclosure/DisclosureNew/DisclosureTrigger.svelte +0 -79
- package/dist/components/Disclosure/DisclosureNew/DisclosureTrigger.svelte.d.ts +0 -23
- package/dist/components/Disclosure/DisclosureNew/disclosures.svelte.d.ts +0 -3
- package/dist/components/Disclosure/DisclosureNew/disclosures.svelte.js +0 -55
- package/dist/components/Disclosure/DisclosureNew/index.d.ts +0 -4
- package/dist/components/Disclosure/DisclosureNew/index.js +0 -5
- package/dist/components/Disclosure/Drawer/Drawer.svelte +0 -31
- package/dist/components/Disclosure/Drawer/Drawer.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Drawer/DrawerCloseButton.svelte +0 -37
- package/dist/components/Disclosure/Drawer/DrawerCloseButton.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Drawer/DrawerContent.svelte +0 -92
- package/dist/components/Disclosure/Drawer/DrawerContent.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Drawer/DrawerNew.svelte +0 -0
- package/dist/components/Disclosure/Drawer/DrawerNew.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Drawer/DrawerTrigger.svelte +0 -11
- package/dist/components/Disclosure/Drawer/DrawerTrigger.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Drawer/drawer.d.ts +0 -35
- package/dist/components/Disclosure/Drawer/drawer.js +0 -44
- package/dist/components/Disclosure/Drawer/index.d.ts +0 -5
- package/dist/components/Disclosure/Drawer/index.js +0 -6
- package/dist/components/Disclosure/DrawerNew/Drawer.svelte.d.ts +0 -23
- package/dist/components/Disclosure/DrawerNew/DrawerClose.svelte.d.ts +0 -23
- package/dist/components/Disclosure/DrawerNew/DrawerTrigger.svelte +0 -15
- package/dist/components/Disclosure/DrawerNew/DrawerTrigger.svelte.d.ts +0 -23
- package/dist/components/Disclosure/DrawerNew/drawer.d.ts +0 -35
- package/dist/components/Disclosure/DrawerNew/drawer.js +0 -44
- package/dist/components/Disclosure/DrawerNew/index.d.ts +0 -4
- package/dist/components/Disclosure/DrawerNew/index.js +0 -5
- package/dist/components/Disclosure/Dropdown/DropdownContent.svelte +0 -15
- package/dist/components/Disclosure/Dropdown/DropdownContent.svelte.d.ts +0 -29
- package/dist/components/Disclosure/Dropdown/DropdownTrigger.svelte +0 -14
- package/dist/components/Disclosure/Dropdown/DropdownTrigger.svelte.d.ts +0 -31
- package/dist/components/Disclosure/Dropdown/dropdown.d.ts +0 -4
- package/dist/components/Disclosure/Dropdown/dropdown.js +0 -4
- package/dist/components/Disclosure/Dropdown/index.d.ts +0 -3
- package/dist/components/Disclosure/Dropdown/index.js +0 -4
- package/dist/components/Disclosure/Modal/Modal.svelte +0 -30
- package/dist/components/Disclosure/Modal/Modal.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Modal/ModalCloseButton.svelte +0 -7
- package/dist/components/Disclosure/Modal/ModalCloseButton.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Modal/ModalContent.svelte +0 -42
- package/dist/components/Disclosure/Modal/ModalContent.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Modal/ModalTrigger.svelte +0 -11
- package/dist/components/Disclosure/Modal/ModalTrigger.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Modal/exit-intent.d.ts +0 -3
- package/dist/components/Disclosure/Modal/exit-intent.js +0 -17
- package/dist/components/Disclosure/Modal/index.d.ts +0 -4
- package/dist/components/Disclosure/Modal/index.js +0 -5
- package/dist/components/Disclosure/Modal/modal.d.ts +0 -4
- package/dist/components/Disclosure/Modal/modal.js +0 -4
- package/dist/components/Disclosure/ModalNew/Modal.svelte.d.ts +0 -23
- package/dist/components/Disclosure/ModalNew/ModalClose.svelte +0 -42
- package/dist/components/Disclosure/ModalNew/ModalClose.svelte.d.ts +0 -23
- package/dist/components/Disclosure/ModalNew/ModalTrigger.svelte +0 -68
- package/dist/components/Disclosure/ModalNew/ModalTrigger.svelte.d.ts +0 -23
- package/dist/components/Disclosure/ModalNew/index.d.ts +0 -4
- package/dist/components/Disclosure/ModalNew/index.js +0 -5
- package/dist/components/Disclosure/Popover/PopoverCloseButton.svelte +0 -29
- package/dist/components/Disclosure/Popover/PopoverCloseButton.svelte.d.ts +0 -35
- package/dist/components/Disclosure/Popover/PopoverContent.svelte +0 -107
- package/dist/components/Disclosure/Popover/PopoverContent.svelte.d.ts +0 -47
- package/dist/components/Disclosure/Popover/PopoverTrigger.svelte +0 -33
- package/dist/components/Disclosure/Popover/PopoverTrigger.svelte.d.ts +0 -41
- package/dist/components/Disclosure/Popover/floating.d.ts +0 -11
- package/dist/components/Disclosure/Popover/floating.js +0 -171
- package/dist/components/Disclosure/Popover/index.d.ts +0 -4
- package/dist/components/Disclosure/Popover/index.js +0 -5
- package/dist/components/Disclosure/Popover/popover.d.ts +0 -16
- package/dist/components/Disclosure/Popover/popover.js +0 -18
- package/dist/components/Disclosure/Popover/references/FollowTheMouse.svelte +0 -45
- package/dist/components/Disclosure/Popover/references/FollowTheMouse.svelte.d.ts +0 -14
- package/dist/components/Disclosure/PopoverNew/Popover.svelte.d.ts +0 -23
- package/dist/components/Disclosure/PopoverNew/PopoverClose.svelte +0 -38
- package/dist/components/Disclosure/PopoverNew/PopoverClose.svelte.d.ts +0 -23
- package/dist/components/Disclosure/PopoverNew/PopoverTrigger.svelte +0 -67
- package/dist/components/Disclosure/PopoverNew/PopoverTrigger.svelte.d.ts +0 -23
- package/dist/components/Disclosure/PopoverNew/floating.d.ts +0 -15
- package/dist/components/Disclosure/PopoverNew/floating.js +0 -329
- package/dist/components/Disclosure/PopoverNew/index.d.ts +0 -4
- package/dist/components/Disclosure/PopoverNew/index.js +0 -5
- package/dist/components/Disclosure/Tooltip/Tooltip.svelte +0 -14
- package/dist/components/Disclosure/Tooltip/Tooltip.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Tooltip/TooltipContent.svelte +0 -7
- package/dist/components/Disclosure/Tooltip/TooltipContent.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Tooltip/TooltipTrigger.svelte +0 -33
- package/dist/components/Disclosure/Tooltip/TooltipTrigger.svelte.d.ts +0 -35
- package/dist/components/Disclosure/Tooltip/index.d.ts +0 -4
- package/dist/components/Disclosure/Tooltip/index.js +0 -5
- package/dist/components/Disclosure/Tooltip/tooltip.d.ts +0 -19
- package/dist/components/Disclosure/Tooltip/tooltip.js +0 -22
- package/dist/components/Disclosure/disclosure-store.d.ts +0 -21
- package/dist/components/Disclosure/disclosure-store.js +0 -48
- package/dist/components/Disclosure/disclosure.d.ts +0 -81
- package/dist/components/Disclosure/disclosure.js +0 -439
- package/dist/components/Disclosure/disclosure.svelte.d.ts +0 -83
- package/dist/components/Disclosure/disclosure.svelte.js +0 -432
- package/dist/components/Disclosure/index.d.ts +0 -3
- package/dist/components/Disclosure/index.js +0 -7
- package/dist/components/Disclosure/shared.d.ts +0 -2
- package/dist/components/Disclosure/shared.js +0 -9
- package/dist/components/Disclosure/state.svelte.d.ts +0 -0
- package/dist/components/Disclosure/state.svelte.js +0 -138
- package/dist/components/FancyList/FancyList.svelte +0 -49
- package/dist/components/FancyList/FancyList.svelte.d.ts +0 -42
- package/dist/components/FancyList/index.d.ts +0 -2
- package/dist/components/FancyList/index.js +0 -3
- package/dist/components/Form/Button.svelte +0 -24
- package/dist/components/Form/Button.svelte.d.ts +0 -35
- package/dist/components/Form/Checkbox.svelte +0 -95
- package/dist/components/Form/Checkbox.svelte.d.ts +0 -23
- package/dist/components/Form/Checkboxes.svelte +0 -66
- package/dist/components/Form/Checkboxes.svelte.d.ts +0 -23
- package/dist/components/Form/Combobox/AutocompleteInput.svelte +0 -63
- package/dist/components/Form/Combobox/AutocompleteInput.svelte.d.ts +0 -31
- package/dist/components/Form/Combobox/AutocompleteOptions.svelte +0 -74
- package/dist/components/Form/Combobox/AutocompleteOptions.svelte.d.ts +0 -35
- package/dist/components/Form/Combobox/TimepickerInput.svelte +0 -81
- package/dist/components/Form/Combobox/TimepickerInput.svelte.d.ts +0 -31
- package/dist/components/Form/Combobox/TimepickerOptions.svelte +0 -100
- package/dist/components/Form/Combobox/TimepickerOptions.svelte.d.ts +0 -27
- package/dist/components/Form/Combobox/autocomplete-matching.d.ts +0 -13
- package/dist/components/Form/Combobox/autocomplete-matching.js +0 -114
- package/dist/components/Form/Combobox/autocomplete.d.ts +0 -38
- package/dist/components/Form/Combobox/autocomplete.js +0 -393
- package/dist/components/Form/Combobox/combobox-store.d.ts +0 -24
- package/dist/components/Form/Combobox/combobox-store.js +0 -65
- package/dist/components/Form/Combobox/combobox.d.ts +0 -46
- package/dist/components/Form/Combobox/combobox.js +0 -360
- package/dist/components/Form/Combobox/index.d.ts +0 -5
- package/dist/components/Form/Combobox/index.js +0 -14
- package/dist/components/Form/Combobox/timepicker.d.ts +0 -22
- package/dist/components/Form/Combobox/timepicker.js +0 -119
- package/dist/components/Form/Form.svelte +0 -54
- package/dist/components/Form/Form.svelte.d.ts +0 -23
- package/dist/components/Form/Hidden.svelte +0 -6
- package/dist/components/Form/Hidden.svelte.d.ts +0 -23
- package/dist/components/Form/HiddenInput.svelte +0 -16
- package/dist/components/Form/HiddenInput.svelte.d.ts +0 -31
- package/dist/components/Form/Radio.svelte +0 -86
- package/dist/components/Form/Radio.svelte.d.ts +0 -23
- package/dist/components/Form/Radios.svelte +0 -68
- package/dist/components/Form/Radios.svelte.d.ts +0 -23
- package/dist/components/Form/Select.svelte.d.ts +0 -23
- package/dist/components/Form/SelectOld2.svelte +0 -127
- package/dist/components/Form/SelectOld2.svelte.d.ts +0 -55
- package/dist/components/Form/Switch.svelte +0 -50
- package/dist/components/Form/Switch.svelte.d.ts +0 -39
- package/dist/components/Form/TextInput.svelte +0 -110
- package/dist/components/Form/TextInput.svelte.d.ts +0 -23
- package/dist/components/Form/Textarea.svelte +0 -126
- package/dist/components/Form/Textarea.svelte.d.ts +0 -23
- package/dist/components/Form/check.svg +0 -3
- package/dist/components/Form/index.d.ts +0 -13
- package/dist/components/Form/index.js +0 -13
- package/dist/components/Highlight/Highlight.svelte +0 -27
- package/dist/components/Highlight/Highlight.svelte.d.ts +0 -31
- package/dist/components/Highlight/_Highlight.scss +0 -19
- package/dist/components/Highlight/index.d.ts +0 -2
- package/dist/components/Highlight/index.js +0 -2
- package/dist/components/Highlight.svelte +0 -46
- package/dist/components/Highlight.svelte.d.ts +0 -27
- package/dist/components/Icon/Icon.svelte +0 -44
- package/dist/components/Icon/Icon.svelte.d.ts +0 -27
- package/dist/components/Icon/IconSnippet.svelte +0 -14
- package/dist/components/Icon/IconSnippet.svelte.d.ts +0 -30
- package/dist/components/Icon/index.d.ts +0 -3
- package/dist/components/Icon/index.js +0 -3
- package/dist/components/Image.svelte +0 -24
- package/dist/components/Image.svelte.d.ts +0 -33
- package/dist/components/InteractiveRegion/InteractiveRegion.svelte +0 -47
- package/dist/components/InteractiveRegion/InteractiveRegion.svelte.d.ts +0 -27
- package/dist/components/InteractiveRegion/index.d.ts +0 -2
- package/dist/components/InteractiveRegion/index.js +0 -3
- package/dist/components/List/Lia.svelte +0 -12
- package/dist/components/List/Lia.svelte.d.ts +0 -37
- package/dist/components/List/NestedListItem.svelte +0 -50
- package/dist/components/List/NestedListItem.svelte.d.ts +0 -27
- package/dist/components/List/index.d.ts +0 -3
- package/dist/components/List/index.js +0 -3
- package/dist/components/Markdown/Markdown.svelte +0 -25
- package/dist/components/Markdown/Markdown.svelte.d.ts +0 -28
- package/dist/components/Markdown/MarkdownSnippet.svelte +0 -27
- package/dist/components/Markdown/MarkdownSnippet.svelte.d.ts +0 -29
- package/dist/components/Masonry/Masonry.svelte +0 -79
- package/dist/components/Masonry/Masonry.svelte.d.ts +0 -29
- package/dist/components/Masonry/index.d.ts +0 -2
- package/dist/components/Masonry/index.js +0 -3
- package/dist/components/PerspectiveHover/PerspectiveHover.svelte +0 -10
- package/dist/components/PerspectiveHover/PerspectiveHover.svelte.d.ts +0 -27
- package/dist/components/PerspectiveHover/perspective-hover.d.ts +0 -3
- package/dist/components/PerspectiveHover/perspective-hover.js +0 -46
- package/dist/components/Populate/ConditionalPopulate.svelte +0 -33
- package/dist/components/Populate/ConditionalPopulate.svelte.d.ts +0 -27
- package/dist/components/Populate/Populate.svelte +0 -45
- package/dist/components/Populate/Populate.svelte.d.ts +0 -24
- package/dist/components/Populate/actions.d.ts +0 -2
- package/dist/components/Populate/actions.js +0 -29
- package/dist/components/Populate/get-value.d.ts +0 -5
- package/dist/components/Populate/get-value.js +0 -17
- package/dist/components/Populate/index.d.ts +0 -3
- package/dist/components/Populate/index.js +0 -4
- package/dist/components/Portal.svelte +0 -30
- package/dist/components/Portal.svelte.d.ts +0 -23
- package/dist/components/PushToLocalStorage.svelte +0 -30
- package/dist/components/PushToLocalStorage.svelte.d.ts +0 -23
- package/dist/components/Resizer/Resizer.svelte +0 -38
- package/dist/components/Resizer/Resizer.svelte.d.ts +0 -23
- package/dist/components/Resizer/index.d.ts +0 -2
- package/dist/components/Resizer/index.js +0 -3
- package/dist/components/Resizer/resizer.d.ts +0 -3
- package/dist/components/Resizer/resizer.js +0 -134
- package/dist/components/Scrambler/Scrambler.svelte +0 -20
- package/dist/components/Scrambler/Scrambler.svelte.d.ts +0 -23
- package/dist/components/Scrambler/index.d.ts +0 -2
- package/dist/components/Scrambler/index.js +0 -3
- package/dist/components/Spotlight/PointerPosition.d.ts +0 -3
- package/dist/components/Spotlight/PointerPosition.js +0 -32
- package/dist/components/Spotlight/Spotlight.svelte +0 -9
- package/dist/components/Spotlight/Spotlight.svelte.d.ts +0 -27
- package/dist/components/Status.svelte +0 -27
- package/dist/components/Status.svelte.d.ts +0 -23
- package/dist/components/Switcheroo/Switcheroo.svelte +0 -70
- package/dist/components/Switcheroo/Switcheroo.svelte.d.ts +0 -34
- package/dist/components/Switcheroo/index.d.ts +0 -2
- package/dist/components/Switcheroo/index.js +0 -3
- package/dist/components/Table/RowGroup.svelte +0 -8
- package/dist/components/Table/RowGroup.svelte.d.ts +0 -27
- package/dist/components/Table/Table.svelte +0 -23
- package/dist/components/Table/Table.svelte.d.ts +0 -33
- package/dist/components/Table/Td.svelte +0 -20
- package/dist/components/Table/Td.svelte.d.ts +0 -35
- package/dist/components/Table/Th.svelte +0 -27
- package/dist/components/Table/Th.svelte.d.ts +0 -35
- package/dist/components/Table/Thead.svelte +0 -8
- package/dist/components/Table/Thead.svelte.d.ts +0 -27
- package/dist/components/Table/Tr.svelte +0 -8
- package/dist/components/Table/Tr.svelte.d.ts +0 -29
- package/dist/components/Table/index.d.ts +0 -6
- package/dist/components/Table/index.js +0 -17
- package/dist/components/Table/table.d.ts +0 -2
- package/dist/components/Table/table.js +0 -35
- package/dist/components/Tabs/Tab.svelte +0 -9
- package/dist/components/Tabs/Tab.svelte.d.ts +0 -23
- package/dist/components/Tabs/Tablist.svelte +0 -79
- package/dist/components/Tabs/Tablist.svelte.d.ts +0 -39
- package/dist/components/Tabs/Tabpanel.svelte +0 -9
- package/dist/components/Tabs/Tabpanel.svelte.d.ts +0 -23
- package/dist/components/Tabs/Tabpanels.svelte +0 -11
- package/dist/components/Tabs/Tabpanels.svelte.d.ts +0 -23
- package/dist/components/Tabs/Tabs.svelte +0 -46
- package/dist/components/Tabs/Tabs.svelte.d.ts +0 -23
- package/dist/components/Tabs/index.d.ts +0 -6
- package/dist/components/Tabs/index.js +0 -7
- package/dist/components/Tabs/tab-store.d.ts +0 -21
- package/dist/components/Tabs/tab-store.js +0 -59
- package/dist/components/Tabs/tabs.d.ts +0 -32
- package/dist/components/Tabs/tabs.js +0 -364
- package/dist/components/Textwall/Repeat.svelte +0 -10
- package/dist/components/Textwall/Repeat.svelte.d.ts +0 -29
- package/dist/components/Textwall/Textwall.svelte +0 -29
- package/dist/components/Textwall/Textwall.svelte.d.ts +0 -37
- package/dist/components/Textwall/index.d.ts +0 -3
- package/dist/components/Textwall/index.js +0 -4
- package/dist/components/Typewriter/Typewriter.svelte +0 -70
- package/dist/components/Typewriter/Typewriter.svelte.d.ts +0 -27
- package/dist/components/Typewriter/index.d.ts +0 -2
- package/dist/components/Typewriter/index.js +0 -3
- package/dist/components/Video.svelte +0 -46
- package/dist/components/Video.svelte.d.ts +0 -33
- package/dist/components/Vimeo.svelte +0 -18
- package/dist/components/Vimeo.svelte.d.ts +0 -29
- package/dist/components/Wrapper.svelte +0 -22
- package/dist/components/Wrapper.svelte.d.ts +0 -33
- package/dist/components/Youtube.svelte +0 -15
- package/dist/components/Youtube.svelte.d.ts +0 -25
- package/dist/components/_Shared/Snippet.svelte +0 -10
- package/dist/components/_Shared/Snippet.svelte.d.ts +0 -27
- package/dist/components/effects/index.d.ts +0 -0
- package/dist/components/effects/index.js +0 -0
- package/dist/index.d.ts +0 -34
- package/dist/index.js +0 -41
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { delay } from '@splendidlabz/utils'
|
|
3
|
-
import { onMount } from 'svelte'
|
|
4
|
-
import Icon from '../../Icon/Icon.svelte'
|
|
5
|
-
let { show = $bindable(false), ref = $bindable(null), ...p } = $props()
|
|
6
|
-
|
|
7
|
-
const {
|
|
8
|
-
componentName = 'PopoverTrigger',
|
|
9
|
-
class: klass = '',
|
|
10
|
-
icon = 'tabler:menu',
|
|
11
|
-
iconClass,
|
|
12
|
-
|
|
13
|
-
// Props
|
|
14
|
-
target,
|
|
15
|
-
actions,
|
|
16
|
-
|
|
17
|
-
// Slots
|
|
18
|
-
children,
|
|
19
|
-
|
|
20
|
-
// Event listeners
|
|
21
|
-
onclick = null,
|
|
22
|
-
ontoggle = null,
|
|
23
|
-
...rest
|
|
24
|
-
} = p
|
|
25
|
-
|
|
26
|
-
let popover = $state(null)
|
|
27
|
-
|
|
28
|
-
if (!target)
|
|
29
|
-
throw new Error(`${componentName} must contain a target property`)
|
|
30
|
-
|
|
31
|
-
onMount(async _ => {
|
|
32
|
-
await delay(0) // Gives time for popover to mount
|
|
33
|
-
if (show) handleClick()
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
// ========================================
|
|
37
|
-
// Event Listeners
|
|
38
|
-
// ========================================
|
|
39
|
-
function handleClick(event) {
|
|
40
|
-
if (!popover) popover = document.querySelector(`#${target}`)
|
|
41
|
-
popover.togglePopover()
|
|
42
|
-
if (onclick) onclick(event)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Allows trigger to know whether the popover is open or closed
|
|
46
|
-
function handleToggle(event) {
|
|
47
|
-
const { newState, oldState } = event.detail
|
|
48
|
-
if (newState === 'open') show = true
|
|
49
|
-
if (oldState === 'closed') show = false
|
|
50
|
-
if (ontoggle) ontoggle(event)
|
|
51
|
-
}
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
<button
|
|
55
|
-
{...rest}
|
|
56
|
-
bind:this={ref}
|
|
57
|
-
class="button {klass}"
|
|
58
|
-
popovertarget={target}
|
|
59
|
-
data-show={show}
|
|
60
|
-
ontoggle={handleToggle}
|
|
61
|
-
>
|
|
62
|
-
{#if children}
|
|
63
|
-
{@render children()}
|
|
64
|
-
{:else if icon}
|
|
65
|
-
<Icon class={iconClass} {icon} />
|
|
66
|
-
{/if}
|
|
67
|
-
</button>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} PopoverTriggerProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} PopoverTriggerEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} PopoverTriggerSlots */
|
|
4
|
-
export default class PopoverTrigger extends SvelteComponentTyped<{
|
|
5
|
-
[x: string]: never;
|
|
6
|
-
}, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {}> {
|
|
9
|
-
}
|
|
10
|
-
export type PopoverTriggerProps = typeof __propDef.props;
|
|
11
|
-
export type PopoverTriggerEvents = typeof __propDef.events;
|
|
12
|
-
export type PopoverTriggerSlots = typeof __propDef.slots;
|
|
13
|
-
import { SvelteComponentTyped } from "svelte";
|
|
14
|
-
declare const __propDef: {
|
|
15
|
-
props: {
|
|
16
|
-
[x: string]: never;
|
|
17
|
-
};
|
|
18
|
-
events: {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {};
|
|
22
|
-
};
|
|
23
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export function initFloating(options: any): {
|
|
2
|
-
update(): void;
|
|
3
|
-
cleanup(): void;
|
|
4
|
-
};
|
|
5
|
-
export namespace FLOATING_OPTS {
|
|
6
|
-
let placement: string;
|
|
7
|
-
let strategy: string;
|
|
8
|
-
let offset: string;
|
|
9
|
-
let arrow: boolean;
|
|
10
|
-
let arrowHeight: number;
|
|
11
|
-
let arrowRadius: string;
|
|
12
|
-
let boxStyle: string;
|
|
13
|
-
let useReferenceBoundaries: boolean;
|
|
14
|
-
}
|
|
15
|
-
export const FLOATING_OPTS_KEYS: string[];
|
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
arrow as arrowFn,
|
|
3
|
-
autoUpdate,
|
|
4
|
-
computePosition,
|
|
5
|
-
flip,
|
|
6
|
-
offset as offsetFn,
|
|
7
|
-
shift,
|
|
8
|
-
} from '@floating-ui/dom'
|
|
9
|
-
import { mix, splitUnit, toRadians } from '@splendidlabz/utils'
|
|
10
|
-
import { getCSSVar, setCSSVar, toPx } from '@splendidlabz/utils/dom'
|
|
11
|
-
|
|
12
|
-
// TODO: Add inline for tooltips
|
|
13
|
-
export const FLOATING_OPTS = {
|
|
14
|
-
placement: 'top',
|
|
15
|
-
strategy: 'absolute',
|
|
16
|
-
offset: '0',
|
|
17
|
-
arrow: false,
|
|
18
|
-
arrowHeight: 0,
|
|
19
|
-
arrowRadius: '5px',
|
|
20
|
-
boxStyle: 'standard', // standard, fancy
|
|
21
|
-
useReferenceBoundaries: false,
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const FLOATING_OPTS_KEYS = Object.keys(FLOATING_OPTS)
|
|
25
|
-
|
|
26
|
-
export function initFloating(options) {
|
|
27
|
-
options = mix(FLOATING_OPTS, options)
|
|
28
|
-
const {
|
|
29
|
-
referenceNode,
|
|
30
|
-
floatingNode,
|
|
31
|
-
boxStyle,
|
|
32
|
-
arrow,
|
|
33
|
-
strategy,
|
|
34
|
-
placement,
|
|
35
|
-
arrowRadius,
|
|
36
|
-
offset: offsetValue,
|
|
37
|
-
} = options
|
|
38
|
-
let _cleanup = null
|
|
39
|
-
|
|
40
|
-
// Determine box style and apply styles as necessary.
|
|
41
|
-
applyBoxStyles(options)
|
|
42
|
-
|
|
43
|
-
// Get necessary values
|
|
44
|
-
const borderWidth = toPx(
|
|
45
|
-
getCSSVar(floatingNode, 'border-width'),
|
|
46
|
-
floatingNode,
|
|
47
|
-
)
|
|
48
|
-
const borderRadius = toPx(
|
|
49
|
-
getCSSVar(floatingNode, 'border-radius'),
|
|
50
|
-
floatingNode,
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
// Create arrow node — used for both styles
|
|
54
|
-
const arrowNode = document.createElement('div')
|
|
55
|
-
const arrowHeight = resolveArrowHeight(options)
|
|
56
|
-
const arrowWidth = getArrowWidth({ ...options, arrowHeight })
|
|
57
|
-
|
|
58
|
-
const arrowProps = {
|
|
59
|
-
arrow,
|
|
60
|
-
arrowNode,
|
|
61
|
-
arrowWidth,
|
|
62
|
-
arrowHeight,
|
|
63
|
-
arrowRadius,
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
applyArrowStyles({ boxStyle, ...arrowProps })
|
|
67
|
-
if (arrow) floatingNode.appendChild(arrowNode)
|
|
68
|
-
|
|
69
|
-
// Calculate offset
|
|
70
|
-
const offset = calculateOffset({
|
|
71
|
-
floatingNode,
|
|
72
|
-
boxStyle,
|
|
73
|
-
arrow,
|
|
74
|
-
borderWidth,
|
|
75
|
-
offsetValue,
|
|
76
|
-
arrowHeight,
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
// Create floating options
|
|
80
|
-
const floatingOpts = {
|
|
81
|
-
strategy,
|
|
82
|
-
placement,
|
|
83
|
-
middleware: [
|
|
84
|
-
offsetFn(offset),
|
|
85
|
-
flip({ fallbackAxisSideDirection: 'start' }),
|
|
86
|
-
shift(),
|
|
87
|
-
arrow && arrowFn({ element: arrowNode }),
|
|
88
|
-
],
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return {
|
|
92
|
-
// Update floating position.
|
|
93
|
-
// Run when mounting.
|
|
94
|
-
update() {
|
|
95
|
-
_cleanup = autoUpdate(referenceNode, floatingNode, _ => {
|
|
96
|
-
computePosition(referenceNode, floatingNode, floatingOpts).then(
|
|
97
|
-
middlewareState => {
|
|
98
|
-
const { x, y } = middlewareState
|
|
99
|
-
|
|
100
|
-
// Position Popover
|
|
101
|
-
Object.assign(floatingNode.style, {
|
|
102
|
-
left: `${x}px`,
|
|
103
|
-
top: `${y}px`,
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
if (!arrow) return
|
|
107
|
-
|
|
108
|
-
// Position arrow
|
|
109
|
-
positionArrow({
|
|
110
|
-
...options,
|
|
111
|
-
...arrowProps,
|
|
112
|
-
borderWidth,
|
|
113
|
-
borderRadius,
|
|
114
|
-
middlewareState,
|
|
115
|
-
})
|
|
116
|
-
},
|
|
117
|
-
)
|
|
118
|
-
})
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
// Cleanup autoupdate.
|
|
122
|
-
// Run when dismounting.
|
|
123
|
-
cleanup() {
|
|
124
|
-
if (_cleanup) _cleanup()
|
|
125
|
-
},
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function applyBoxStyles({
|
|
130
|
-
referenceNode,
|
|
131
|
-
floatingNode,
|
|
132
|
-
strategy,
|
|
133
|
-
boxStyle,
|
|
134
|
-
placement,
|
|
135
|
-
arrow,
|
|
136
|
-
useReferenceBoundaries,
|
|
137
|
-
}) {
|
|
138
|
-
floatingNode.style.position = strategy
|
|
139
|
-
floatingNode.style.overflow = 'visible' // Users can specify max-height on the popover content to enable scrolling.
|
|
140
|
-
|
|
141
|
-
if (useReferenceBoundaries) {
|
|
142
|
-
const { width, height } = referenceNode.getBoundingClientRect()
|
|
143
|
-
|
|
144
|
-
if (['top', 'bottom'].includes(placement)) {
|
|
145
|
-
floatingNode.style.width = `${width}px`
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (['left', 'right'].includes(placement)) {
|
|
149
|
-
floatingNode.style.height = `${height}px`
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (boxStyle === 'fancy') {
|
|
154
|
-
if (!arrow) floatingNode.classList.add('fancy-box')
|
|
155
|
-
else {
|
|
156
|
-
const side = getArrowSide(placement)
|
|
157
|
-
floatingNode.classList.add('fancy-box-arrow', `arrow-${side}`)
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function resolveArrowHeight({ floatingNode, arrow, arrowHeight, boxStyle }) {
|
|
163
|
-
if (!arrow) return 0
|
|
164
|
-
if (boxStyle === 'standard') return toPx(arrowHeight, floatingNode)
|
|
165
|
-
|
|
166
|
-
// Fancy box style
|
|
167
|
-
if (arrowHeight) {
|
|
168
|
-
const h = toPx(arrowHeight, floatingNode)
|
|
169
|
-
setCSSVar(floatingNode, '--h', `${h}px`)
|
|
170
|
-
return h
|
|
171
|
-
} else {
|
|
172
|
-
const h = getCSSVar(floatingNode, '--h')
|
|
173
|
-
return toPx(h, floatingNode)
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function getArrowWidth({ boxStyle, floatingNode, arrowHeight }) {
|
|
178
|
-
// Standard box is a square, so it must use the same value for both width and height
|
|
179
|
-
if (boxStyle === 'standard') return arrowHeight
|
|
180
|
-
|
|
181
|
-
// Fancy box can have different width and height values depending on the angle used. Downside is the arrow will never be rounded.
|
|
182
|
-
|
|
183
|
-
let [angle, unit] = splitUnit(getCSSVar(floatingNode, '--a'))
|
|
184
|
-
if (unit === 'deg') angle = toRadians(angle)
|
|
185
|
-
return Math.tan(angle / 2) * arrowHeight * 2
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
function getArrowSide(placement) {
|
|
189
|
-
const side = {
|
|
190
|
-
top: 'bottom',
|
|
191
|
-
right: 'left',
|
|
192
|
-
bottom: 'top',
|
|
193
|
-
left: 'right',
|
|
194
|
-
}[placement.split('-')[0]]
|
|
195
|
-
return side
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function applyArrowStyles({
|
|
199
|
-
arrowNode,
|
|
200
|
-
arrowWidth,
|
|
201
|
-
arrowHeight,
|
|
202
|
-
arrowRadius,
|
|
203
|
-
boxStyle,
|
|
204
|
-
}) {
|
|
205
|
-
// Need to check which borders and radius to remove
|
|
206
|
-
const styles = {
|
|
207
|
-
width: `${arrowWidth}px`,
|
|
208
|
-
height: `${arrowHeight}px`,
|
|
209
|
-
position: 'absolute',
|
|
210
|
-
borderRadius: '0',
|
|
211
|
-
borderTopRightRadius: arrowRadius,
|
|
212
|
-
borderWidth: 'inherit',
|
|
213
|
-
borderLeftWidth: '0',
|
|
214
|
-
borderBottomWidth: '0',
|
|
215
|
-
background: 'inherit',
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if (boxStyle === 'fancy') {
|
|
219
|
-
Object.assign(styles, { opacity: '0' })
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
Object.assign(arrowNode.style, styles)
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
function calculateOffset({
|
|
226
|
-
floatingNode,
|
|
227
|
-
boxStyle,
|
|
228
|
-
offsetValue,
|
|
229
|
-
borderWidth,
|
|
230
|
-
arrow,
|
|
231
|
-
arrowHeight,
|
|
232
|
-
}) {
|
|
233
|
-
let offset = toPx(offsetValue, floatingNode)
|
|
234
|
-
if (!arrow) return offset
|
|
235
|
-
|
|
236
|
-
if (boxStyle === 'standard') {
|
|
237
|
-
const arrowHypotenuse = Math.sqrt(arrowHeight ** 2 + borderWidth ** 2)
|
|
238
|
-
offset += Math.floor(arrowHypotenuse / 2)
|
|
239
|
-
}
|
|
240
|
-
if (boxStyle === 'fancy') offset += arrowHeight
|
|
241
|
-
return offset
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
function positionArrow({
|
|
245
|
-
floatingNode,
|
|
246
|
-
middlewareState,
|
|
247
|
-
arrowNode,
|
|
248
|
-
arrowWidth,
|
|
249
|
-
arrowHeight,
|
|
250
|
-
borderWidth,
|
|
251
|
-
borderRadius,
|
|
252
|
-
boxStyle,
|
|
253
|
-
}) {
|
|
254
|
-
const { placement } = middlewareState
|
|
255
|
-
const { x, y } = middlewareState.middlewareData.arrow
|
|
256
|
-
const { width, height } = floatingNode.getBoundingClientRect()
|
|
257
|
-
|
|
258
|
-
// Do nothing if popover is not opened yet
|
|
259
|
-
if (!(width || height)) return
|
|
260
|
-
// Do nothing if no arrow data
|
|
261
|
-
if (!(x || y)) return
|
|
262
|
-
|
|
263
|
-
const side = getArrowSide(placement)
|
|
264
|
-
|
|
265
|
-
if (boxStyle === 'standard') {
|
|
266
|
-
// Rotate arrow box
|
|
267
|
-
let rotate = 45
|
|
268
|
-
// prettier-ignore
|
|
269
|
-
switch (side) {
|
|
270
|
-
case 'top': rotate = -45; break;
|
|
271
|
-
case 'right': rotate = 45; break;
|
|
272
|
-
case 'bottom': rotate = 135; break;
|
|
273
|
-
case 'left': rotate = 225; break;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
const adjusted = { x, y }
|
|
277
|
-
const safetySpace = 3
|
|
278
|
-
|
|
279
|
-
if (x || x === 0) {
|
|
280
|
-
const startEdge = borderRadius + safetySpace
|
|
281
|
-
const endEdge = width - borderRadius - arrowWidth - safetySpace
|
|
282
|
-
|
|
283
|
-
if (x <= startEdge) adjusted.x = startEdge
|
|
284
|
-
if (x >= endEdge) adjusted.x = endEdge
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
if (y || y === 0) {
|
|
288
|
-
const startEdge = borderRadius + safetySpace
|
|
289
|
-
const endEdge = height - borderRadius - arrowWidth - safetySpace
|
|
290
|
-
|
|
291
|
-
if (y <= startEdge) adjusted.y = startEdge
|
|
292
|
-
if (y >= endEdge) adjusted.y = endEdge
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
const arrowCrossOffset = Math.ceil((arrowHeight + borderWidth) / 2)
|
|
296
|
-
|
|
297
|
-
// prettier-ignore
|
|
298
|
-
Object.assign(arrowNode.style, {
|
|
299
|
-
left: x ? `${adjusted.x}px` : '',
|
|
300
|
-
top: y ? `${adjusted.y}px` : '',
|
|
301
|
-
[side]: `-${arrowCrossOffset}px`,
|
|
302
|
-
transform: `rotate(${rotate}deg)`,
|
|
303
|
-
})
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
if (boxStyle === 'fancy') {
|
|
307
|
-
if (x) arrowNode.style.left = `${x}px`
|
|
308
|
-
if (y) arrowNode.style.top = `${y}px`
|
|
309
|
-
|
|
310
|
-
let arrowCenter, arrowPosition
|
|
311
|
-
if (x) {
|
|
312
|
-
arrowCenter = x + arrowWidth / 2
|
|
313
|
-
arrowPosition = ((arrowCenter + borderWidth) / width) * 100
|
|
314
|
-
}
|
|
315
|
-
if (y) {
|
|
316
|
-
arrowCenter = y + arrowWidth / 2
|
|
317
|
-
arrowPosition = ((arrowCenter + borderWidth) / height) * 100
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
floatingNode.classList.remove(
|
|
321
|
-
'arrow-top',
|
|
322
|
-
'arrow-right',
|
|
323
|
-
'arrow-bottom',
|
|
324
|
-
'arrow-left',
|
|
325
|
-
)
|
|
326
|
-
floatingNode.classList.add(`arrow-${side}`)
|
|
327
|
-
setCSSVar(floatingNode, '--arrow-position', `${arrowPosition}%`)
|
|
328
|
-
}
|
|
329
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<!-- NOT DONE YET -->
|
|
2
|
-
<!-- https://zoebijl.github.io/apg-tooltip/ -->
|
|
3
|
-
<script>
|
|
4
|
-
import { randomString } from '@splendidlabz/utils/dom'
|
|
5
|
-
import TooltipContent from './TooltipContent.svelte'
|
|
6
|
-
import TooltipTrigger from './TooltipTrigger.svelte'
|
|
7
|
-
|
|
8
|
-
export let content
|
|
9
|
-
|
|
10
|
-
const id = randomString()
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<TooltipTrigger target={id} />
|
|
14
|
-
<TooltipContent {id}>{content}</TooltipContent>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} TooltipProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} TooltipEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} TooltipSlots */
|
|
4
|
-
export default class Tooltip extends SvelteComponentTyped<{
|
|
5
|
-
content: any;
|
|
6
|
-
}, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {}> {
|
|
9
|
-
}
|
|
10
|
-
export type TooltipProps = typeof __propDef.props;
|
|
11
|
-
export type TooltipEvents = typeof __propDef.events;
|
|
12
|
-
export type TooltipSlots = typeof __propDef.slots;
|
|
13
|
-
import { SvelteComponentTyped } from "svelte";
|
|
14
|
-
declare const __propDef: {
|
|
15
|
-
props: {
|
|
16
|
-
content: any;
|
|
17
|
-
};
|
|
18
|
-
events: {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {};
|
|
22
|
-
};
|
|
23
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} TooltipContentProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} TooltipContentEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} TooltipContentSlots */
|
|
4
|
-
export default class TooltipContent extends SvelteComponentTyped<{
|
|
5
|
-
[x: string]: never;
|
|
6
|
-
}, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {}> {
|
|
9
|
-
}
|
|
10
|
-
export type TooltipContentProps = typeof __propDef.props;
|
|
11
|
-
export type TooltipContentEvents = typeof __propDef.events;
|
|
12
|
-
export type TooltipContentSlots = typeof __propDef.slots;
|
|
13
|
-
import { SvelteComponentTyped } from "svelte";
|
|
14
|
-
declare const __propDef: {
|
|
15
|
-
props: {
|
|
16
|
-
[x: string]: never;
|
|
17
|
-
};
|
|
18
|
-
events: {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {};
|
|
22
|
-
};
|
|
23
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<!-- NOT DONE YET -->
|
|
2
|
-
|
|
3
|
-
<script>
|
|
4
|
-
import { disclosures, initDisclosure } from '../disclosure-store.js'
|
|
5
|
-
import { disclosureTrigger } from '../disclosure.js'
|
|
6
|
-
import { defaultTooltipTriggerOpts } from './tooltip.js'
|
|
7
|
-
|
|
8
|
-
// let klass
|
|
9
|
-
// export { klass as class }
|
|
10
|
-
export let elem = 'span'
|
|
11
|
-
export let target = null
|
|
12
|
-
export let show = false
|
|
13
|
-
export let options = {}
|
|
14
|
-
|
|
15
|
-
const opts = {
|
|
16
|
-
...defaultTooltipTriggerOpts,
|
|
17
|
-
...options,
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
initDisclosure(target, opts, { show })
|
|
21
|
-
$: d = $disclosures.find(d => d.id === target)
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<svelte:element
|
|
25
|
-
this={elem}
|
|
26
|
-
inert
|
|
27
|
-
role="tooltip"
|
|
28
|
-
bind:this={d.nodes.triggerNode}
|
|
29
|
-
use:disclosureTrigger
|
|
30
|
-
{...$$restProps}
|
|
31
|
-
>
|
|
32
|
-
<slot />
|
|
33
|
-
</svelte:element>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} TooltipTriggerProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} TooltipTriggerEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} TooltipTriggerSlots */
|
|
4
|
-
export default class TooltipTrigger extends SvelteComponentTyped<{
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
target?: any;
|
|
7
|
-
options?: {};
|
|
8
|
-
show?: boolean;
|
|
9
|
-
elem?: string;
|
|
10
|
-
}, {
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
12
|
-
}, {
|
|
13
|
-
default: {};
|
|
14
|
-
}> {
|
|
15
|
-
}
|
|
16
|
-
export type TooltipTriggerProps = typeof __propDef.props;
|
|
17
|
-
export type TooltipTriggerEvents = typeof __propDef.events;
|
|
18
|
-
export type TooltipTriggerSlots = typeof __propDef.slots;
|
|
19
|
-
import { SvelteComponentTyped } from "svelte";
|
|
20
|
-
declare const __propDef: {
|
|
21
|
-
props: {
|
|
22
|
-
[x: string]: any;
|
|
23
|
-
target?: any;
|
|
24
|
-
options?: {};
|
|
25
|
-
show?: boolean;
|
|
26
|
-
elem?: string;
|
|
27
|
-
};
|
|
28
|
-
events: {
|
|
29
|
-
[evt: string]: CustomEvent<any>;
|
|
30
|
-
};
|
|
31
|
-
slots: {
|
|
32
|
-
default: {};
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export namespace defaultTooltipTriggerOpts {
|
|
2
|
-
let showOnHover: boolean;
|
|
3
|
-
let showOnFocus: boolean;
|
|
4
|
-
}
|
|
5
|
-
export namespace defaultTooltipContentOpts {
|
|
6
|
-
let closeOnOutsideClick: boolean;
|
|
7
|
-
let closeOnEscapeButton: boolean;
|
|
8
|
-
let preventBodyScroll: boolean;
|
|
9
|
-
let trapFocus: boolean;
|
|
10
|
-
let focusTarget: any;
|
|
11
|
-
}
|
|
12
|
-
export namespace defaultTooltipFloatingOpts {
|
|
13
|
-
let placement: string;
|
|
14
|
-
}
|
|
15
|
-
export namespace defaultTransitionOpts {
|
|
16
|
-
let delay: number;
|
|
17
|
-
let duration: number;
|
|
18
|
-
let easing: string;
|
|
19
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export const defaultTooltipTriggerOpts = {
|
|
2
|
-
showOnHover: true,
|
|
3
|
-
showOnFocus: true,
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export const defaultTooltipContentOpts = {
|
|
7
|
-
closeOnOutsideClick: true,
|
|
8
|
-
closeOnEscapeButton: true,
|
|
9
|
-
preventBodyScroll: false,
|
|
10
|
-
trapFocus: false,
|
|
11
|
-
focusTarget: null, // || 'first',
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const defaultTooltipFloatingOpts = {
|
|
15
|
-
placement: 'top',
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const defaultTransitionOpts = {
|
|
19
|
-
delay: 0,
|
|
20
|
-
duration: 250,
|
|
21
|
-
easing: 'cubicOut',
|
|
22
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export function getDisclosures(): any[];
|
|
2
|
-
export function getDisclosure(id: any): any;
|
|
3
|
-
export function addDisclosure({ id, state, nodes, options }: {
|
|
4
|
-
id: any;
|
|
5
|
-
state?: {};
|
|
6
|
-
nodes?: {};
|
|
7
|
-
options?: {};
|
|
8
|
-
}): void;
|
|
9
|
-
export function updateDisclosure({ id, state, options, nodes }: {
|
|
10
|
-
id: any;
|
|
11
|
-
state?: {};
|
|
12
|
-
options?: {};
|
|
13
|
-
nodes?: {};
|
|
14
|
-
}): void;
|
|
15
|
-
export function initDisclosure({ id, options, state, nodes }: {
|
|
16
|
-
id: any;
|
|
17
|
-
options?: {};
|
|
18
|
-
state?: {};
|
|
19
|
-
nodes?: {};
|
|
20
|
-
}): any;
|
|
21
|
-
export const disclosures: import("svelte/store").Writable<any[]>;
|