@finsweet/webflow-apps-utils 1.0.1
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/README.md +45 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/router/Link.svelte +166 -0
- package/dist/router/Link.svelte.d.ts +26 -0
- package/dist/router/README.md +397 -0
- package/dist/router/Route.svelte +82 -0
- package/dist/router/Route.svelte.d.ts +24 -0
- package/dist/router/Router.svelte +71 -0
- package/dist/router/Router.svelte.d.ts +20 -0
- package/dist/router/hooks.svelte.d.ts +77 -0
- package/dist/router/hooks.svelte.js +148 -0
- package/dist/router/index.svelte.d.ts +107 -0
- package/dist/router/index.svelte.js +400 -0
- package/dist/stores/breakpoints.d.ts +10 -0
- package/dist/stores/breakpoints.js +2 -0
- package/dist/stores/componentInjectErrors.d.ts +1 -0
- package/dist/stores/componentInjectErrors.js +2 -0
- package/dist/stores/forms.d.ts +110 -0
- package/dist/stores/forms.js +307 -0
- package/dist/stores/globalStore.d.ts +10 -0
- package/dist/stores/globalStore.js +10 -0
- package/dist/stores/index.d.ts +7 -0
- package/dist/stores/index.js +7 -0
- package/dist/stores/router.d.ts +4 -0
- package/dist/stores/router.js +5 -0
- package/dist/stores/showConfirmActionModal.d.ts +1 -0
- package/dist/stores/showConfirmActionModal.js +2 -0
- package/dist/stores/siteInfo.d.ts +13 -0
- package/dist/stores/siteInfo.js +2 -0
- package/dist/types/auth.d.ts +40 -0
- package/dist/types/auth.js +1 -0
- package/dist/types/customCode.d.ts +16 -0
- package/dist/types/customCode.js +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +5 -0
- package/dist/types/license.d.ts +5 -0
- package/dist/types/license.js +1 -0
- package/dist/types/webflow.d.ts +125 -0
- package/dist/types/webflow.js +1 -0
- package/dist/types/window.d.ts +14 -0
- package/dist/types/window.js +1 -0
- package/dist/ui/components/ButtonGroup.svelte +106 -0
- package/dist/ui/components/ButtonGroup.svelte.d.ts +28 -0
- package/dist/ui/components/Checkbox.svelte +94 -0
- package/dist/ui/components/Checkbox.svelte.d.ts +36 -0
- package/dist/ui/components/Copy.svelte +329 -0
- package/dist/ui/components/Copy.svelte.d.ts +35 -0
- package/dist/ui/components/CustomModal.svelte +192 -0
- package/dist/ui/components/CustomModal.svelte.d.ts +45 -0
- package/dist/ui/components/DisableInEditMode.svelte +66 -0
- package/dist/ui/components/DisableInEditMode.svelte.d.ts +33 -0
- package/dist/ui/components/Divider.svelte +31 -0
- package/dist/ui/components/Divider.svelte.d.ts +31 -0
- package/dist/ui/components/Header.svelte +30 -0
- package/dist/ui/components/Header.svelte.d.ts +20 -0
- package/dist/ui/components/Iframe.svelte +89 -0
- package/dist/ui/components/Iframe.svelte.d.ts +40 -0
- package/dist/ui/components/ImageUpload.svelte +213 -0
- package/dist/ui/components/ImageUpload.svelte.d.ts +42 -0
- package/dist/ui/components/InjectComponent.svelte +297 -0
- package/dist/ui/components/InjectComponent.svelte.d.ts +27 -0
- package/dist/ui/components/Loader.svelte +68 -0
- package/dist/ui/components/Loader.svelte.d.ts +24 -0
- package/dist/ui/components/LoadingScreen.svelte +71 -0
- package/dist/ui/components/LoadingScreen.svelte.d.ts +26 -0
- package/dist/ui/components/Modal.svelte +139 -0
- package/dist/ui/components/Modal.svelte.d.ts +42 -0
- package/dist/ui/components/Navbar.svelte +132 -0
- package/dist/ui/components/Navbar.svelte.d.ts +29 -0
- package/dist/ui/components/NoSettingsNeeded.svelte +31 -0
- package/dist/ui/components/NoSettingsNeeded.svelte.d.ts +18 -0
- package/dist/ui/components/Notification.svelte +193 -0
- package/dist/ui/components/Notification.svelte.d.ts +64 -0
- package/dist/ui/components/PlusMinusButton.svelte +91 -0
- package/dist/ui/components/PlusMinusButton.svelte.d.ts +22 -0
- package/dist/ui/components/PreviewBar.svelte +40 -0
- package/dist/ui/components/PreviewBar.svelte.d.ts +20 -0
- package/dist/ui/components/ScrollableContent.svelte +18 -0
- package/dist/ui/components/ScrollableContent.svelte.d.ts +31 -0
- package/dist/ui/components/Section.svelte +97 -0
- package/dist/ui/components/Section.svelte.d.ts +50 -0
- package/dist/ui/components/SelectBodyOrDivBlock.svelte +26 -0
- package/dist/ui/components/SelectBodyOrDivBlock.svelte.d.ts +26 -0
- package/dist/ui/components/Spacer.svelte +9 -0
- package/dist/ui/components/Spacer.svelte.d.ts +22 -0
- package/dist/ui/components/SpinnerPlusMinus.svelte +75 -0
- package/dist/ui/components/SpinnerPlusMinus.svelte.d.ts +23 -0
- package/dist/ui/components/SpinnerUpDown.svelte +194 -0
- package/dist/ui/components/SpinnerUpDown.svelte.d.ts +31 -0
- package/dist/ui/components/Tabs.svelte +71 -0
- package/dist/ui/components/Tabs.svelte.d.ts +26 -0
- package/dist/ui/components/ToggleItem.svelte +29 -0
- package/dist/ui/components/ToggleItem.svelte.d.ts +28 -0
- package/dist/ui/components/ToggleList.svelte +57 -0
- package/dist/ui/components/ToggleList.svelte.d.ts +39 -0
- package/dist/ui/components/breakpoints/BreakpointItem.svelte +84 -0
- package/dist/ui/components/breakpoints/BreakpointItem.svelte.d.ts +37 -0
- package/dist/ui/components/breakpoints/breakpointOptions.d.ts +12 -0
- package/dist/ui/components/breakpoints/breakpointOptions.js +38 -0
- package/dist/ui/components/breakpoints/index.d.ts +3 -0
- package/dist/ui/components/breakpoints/index.js +3 -0
- package/dist/ui/components/button/Button.stories.svelte +275 -0
- package/dist/ui/components/button/Button.stories.svelte.d.ts +27 -0
- package/dist/ui/components/button/Button.svelte +389 -0
- package/dist/ui/components/button/Button.svelte.d.ts +84 -0
- package/dist/ui/components/button/index.d.ts +2 -0
- package/dist/ui/components/button/index.js +1 -0
- package/dist/ui/components/button/types.d.ts +23 -0
- package/dist/ui/components/button/types.js +1 -0
- package/dist/ui/components/buttons/FooterButton.svelte +277 -0
- package/dist/ui/components/buttons/FooterButton.svelte.d.ts +10 -0
- package/dist/ui/components/buttons/index.d.ts +5 -0
- package/dist/ui/components/buttons/index.js +5 -0
- package/dist/ui/components/buttons/types.d.ts +28 -0
- package/dist/ui/components/buttons/types.js +1 -0
- package/dist/ui/components/clickable/Clickable.stories.svelte +213 -0
- package/dist/ui/components/clickable/Clickable.stories.svelte.d.ts +27 -0
- package/dist/ui/components/clickable/Clickable.svelte +93 -0
- package/dist/ui/components/clickable/Clickable.svelte.d.ts +4 -0
- package/dist/ui/components/clickable/index.d.ts +2 -0
- package/dist/ui/components/clickable/index.js +1 -0
- package/dist/ui/components/clickable/types.d.ts +17 -0
- package/dist/ui/components/clickable/types.js +1 -0
- package/dist/ui/components/index.d.ts +46 -0
- package/dist/ui/components/index.js +46 -0
- package/dist/ui/components/input/Input.stories.d.ts +109 -0
- package/dist/ui/components/input/Input.stories.js +337 -0
- package/dist/ui/components/input/Input.svelte +422 -0
- package/dist/ui/components/input/Input.svelte.d.ts +4 -0
- package/dist/ui/components/input/index.d.ts +2 -0
- package/dist/ui/components/input/index.js +1 -0
- package/dist/ui/components/input/types.d.ts +109 -0
- package/dist/ui/components/input/types.js +1 -0
- package/dist/ui/components/layout/ExampleLayout.svelte +538 -0
- package/dist/ui/components/layout/ExampleLayout.svelte.d.ts +3 -0
- package/dist/ui/components/layout/Layout.stories.svelte +24 -0
- package/dist/ui/components/layout/Layout.stories.svelte.d.ts +18 -0
- package/dist/ui/components/layout/Layout.svelte +551 -0
- package/dist/ui/components/layout/Layout.svelte.d.ts +30 -0
- package/dist/ui/components/layout/common/EditModeMessage.svelte +59 -0
- package/dist/ui/components/layout/common/EditModeMessage.svelte.d.ts +3 -0
- package/dist/ui/components/layout/common/index.d.ts +1 -0
- package/dist/ui/components/layout/common/index.js +1 -0
- package/dist/ui/components/layout/index.d.ts +3 -0
- package/dist/ui/components/layout/index.js +2 -0
- package/dist/ui/components/layout/types.d.ts +59 -0
- package/dist/ui/components/layout/types.js +1 -0
- package/dist/ui/components/select/Select.stories.d.ts +94 -0
- package/dist/ui/components/select/Select.stories.js +396 -0
- package/dist/ui/components/select/Select.svelte +705 -0
- package/dist/ui/components/select/Select.svelte.d.ts +11 -0
- package/dist/ui/components/select/index.d.ts +2 -0
- package/dist/ui/components/select/index.js +1 -0
- package/dist/ui/components/select/types.d.ts +94 -0
- package/dist/ui/components/select/types.js +1 -0
- package/dist/ui/components/switch/Switch.stories.d.ts +58 -0
- package/dist/ui/components/switch/Switch.stories.js +198 -0
- package/dist/ui/components/switch/Switch.svelte +220 -0
- package/dist/ui/components/switch/Switch.svelte.d.ts +4 -0
- package/dist/ui/components/switch/index.d.ts +2 -0
- package/dist/ui/components/switch/index.js +1 -0
- package/dist/ui/components/switch/types.d.ts +47 -0
- package/dist/ui/components/switch/types.js +1 -0
- package/dist/ui/components/text/README.md +73 -0
- package/dist/ui/components/text/Text.stories.svelte +203 -0
- package/dist/ui/components/text/Text.stories.svelte.d.ts +27 -0
- package/dist/ui/components/text/Text.svelte +778 -0
- package/dist/ui/components/text/Text.svelte.d.ts +8 -0
- package/dist/ui/components/text/index.d.ts +3 -0
- package/dist/ui/components/text/index.js +2 -0
- package/dist/ui/components/text/types.d.ts +46 -0
- package/dist/ui/components/text/types.js +1 -0
- package/dist/ui/components/tooltip/Tooltip.stories.svelte +128 -0
- package/dist/ui/components/tooltip/Tooltip.stories.svelte.d.ts +27 -0
- package/dist/ui/components/tooltip/Tooltip.svelte +463 -0
- package/dist/ui/components/tooltip/Tooltip.svelte.d.ts +7 -0
- package/dist/ui/components/tooltip/index.d.ts +2 -0
- package/dist/ui/components/tooltip/index.js +1 -0
- package/dist/ui/components/tooltip/types.d.ts +114 -0
- package/dist/ui/components/tooltip/types.js +1 -0
- package/dist/ui/icons/AccordionDownArrow.svelte +8 -0
- package/dist/ui/icons/AccordionDownArrow.svelte.d.ts +26 -0
- package/dist/ui/icons/AccordionUpArrow.svelte +8 -0
- package/dist/ui/icons/AccordionUpArrow.svelte.d.ts +26 -0
- package/dist/ui/icons/AccountIcon.svelte +14 -0
- package/dist/ui/icons/AccountIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ArrowIcon.svelte +6 -0
- package/dist/ui/icons/ArrowIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/BackIcon.svelte +8 -0
- package/dist/ui/icons/BackIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/BodyIcon.svelte +8 -0
- package/dist/ui/icons/BodyIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/BookmarkIcon.svelte +13 -0
- package/dist/ui/icons/BookmarkIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/BoxAddIcon.svelte +8 -0
- package/dist/ui/icons/BoxAddIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/BrushIcon.svelte +10 -0
- package/dist/ui/icons/BrushIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/BuilderEditIcon.svelte +12 -0
- package/dist/ui/icons/BuilderEditIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/BuilderIcon.svelte +14 -0
- package/dist/ui/icons/BuilderIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CMSIcon.svelte +8 -0
- package/dist/ui/icons/CMSIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CheckCircleIcon.svelte +8 -0
- package/dist/ui/icons/CheckCircleIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CheckCircleOutlinedIcon.svelte +15 -0
- package/dist/ui/icons/CheckCircleOutlinedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CheckIcon.svelte +9 -0
- package/dist/ui/icons/CheckIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CheckboxCheckedIcon.svelte +15 -0
- package/dist/ui/icons/CheckboxCheckedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ChevronIcon.svelte +8 -0
- package/dist/ui/icons/ChevronIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ChevronRightIcon.svelte +8 -0
- package/dist/ui/icons/ChevronRightIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CircleIcon.svelte +3 -0
- package/dist/ui/icons/CircleIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CloseCircleIcon.svelte +6 -0
- package/dist/ui/icons/CloseCircleIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CloseIcon.svelte +8 -0
- package/dist/ui/icons/CloseIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CodeIcon.svelte +8 -0
- package/dist/ui/icons/CodeIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ComponentsIcon.svelte +7 -0
- package/dist/ui/icons/ComponentsIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CookieIcon.svelte +15 -0
- package/dist/ui/icons/CookieIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CopyIcon.svelte +19 -0
- package/dist/ui/icons/CopyIcon.svelte.d.ts +20 -0
- package/dist/ui/icons/CrossIcon.svelte +4 -0
- package/dist/ui/icons/CrossIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/DOMElement.svelte +19 -0
- package/dist/ui/icons/DOMElement.svelte.d.ts +28 -0
- package/dist/ui/icons/DeleteIcon.svelte +8 -0
- package/dist/ui/icons/DeleteIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/DeleteOutlinedIcon.svelte +8 -0
- package/dist/ui/icons/DeleteOutlinedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/Desktop.svelte +19 -0
- package/dist/ui/icons/Desktop.svelte.d.ts +21 -0
- package/dist/ui/icons/DesktopWithStar.svelte +21 -0
- package/dist/ui/icons/DesktopWithStar.svelte.d.ts +21 -0
- package/dist/ui/icons/DivBlock.svelte +14 -0
- package/dist/ui/icons/DivBlock.svelte.d.ts +28 -0
- package/dist/ui/icons/EditIcon.svelte +15 -0
- package/dist/ui/icons/EditIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ExpertIcon.svelte +16 -0
- package/dist/ui/icons/ExpertIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/EyeCancelIcon.svelte +12 -0
- package/dist/ui/icons/EyeCancelIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/EyeIcon.svelte +12 -0
- package/dist/ui/icons/EyeIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FavouriteIcon.svelte +6 -0
- package/dist/ui/icons/FavouriteIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FileUploadIcon.svelte +18 -0
- package/dist/ui/icons/FileUploadIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FilterIcon.svelte +8 -0
- package/dist/ui/icons/FilterIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FinsweetLibraryIcon.svelte +21 -0
- package/dist/ui/icons/FinsweetLibraryIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FinsweetLogoIcon.svelte +20 -0
- package/dist/ui/icons/FinsweetLogoIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FolderIcon.svelte +6 -0
- package/dist/ui/icons/FolderIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FolderOutlinedIcon.svelte +8 -0
- package/dist/ui/icons/FolderOutlinedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FolderPlusIcon.svelte +10 -0
- package/dist/ui/icons/FolderPlusIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FreeComponentIcon.svelte +8 -0
- package/dist/ui/icons/FreeComponentIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/GlobeIcon.svelte +14 -0
- package/dist/ui/icons/GlobeIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/HandPointUpIcon.svelte +9 -0
- package/dist/ui/icons/HandPointUpIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/HeartIcon.svelte +8 -0
- package/dist/ui/icons/HeartIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/HeartIconOutlined.svelte +8 -0
- package/dist/ui/icons/HeartIconOutlined.svelte.d.ts +26 -0
- package/dist/ui/icons/HelpAltIcon.svelte +23 -0
- package/dist/ui/icons/HelpAltIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/HelpIcon.svelte +16 -0
- package/dist/ui/icons/HelpIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/HomeIcon.svelte +8 -0
- package/dist/ui/icons/HomeIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/InfoIcon.svelte +14 -0
- package/dist/ui/icons/InfoIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ListIcon.svelte +18 -0
- package/dist/ui/icons/ListIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/LockIcon.svelte +13 -0
- package/dist/ui/icons/LockIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/MessageIcon.svelte +10 -0
- package/dist/ui/icons/MessageIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/MobileLandscape.svelte +20 -0
- package/dist/ui/icons/MobileLandscape.svelte.d.ts +21 -0
- package/dist/ui/icons/MobilePortrait.svelte +20 -0
- package/dist/ui/icons/MobilePortrait.svelte.d.ts +21 -0
- package/dist/ui/icons/NavigatorIcon.svelte +8 -0
- package/dist/ui/icons/NavigatorIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/OpenBookIcon.svelte +8 -0
- package/dist/ui/icons/OpenBookIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PageDraftIcon.svelte +8 -0
- package/dist/ui/icons/PageDraftIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PageIcon.svelte +9 -0
- package/dist/ui/icons/PageIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PageLockedIcon.svelte +8 -0
- package/dist/ui/icons/PageLockedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PageOutlinedIcon.svelte +8 -0
- package/dist/ui/icons/PageOutlinedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PageSectionIcon.svelte +10 -0
- package/dist/ui/icons/PageSectionIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/Pencil.svelte +12 -0
- package/dist/ui/icons/Pencil.svelte.d.ts +20 -0
- package/dist/ui/icons/PencilOutlinedIcon.svelte +15 -0
- package/dist/ui/icons/PencilOutlinedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PinIcon.svelte +8 -0
- package/dist/ui/icons/PinIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PlayIcon.svelte +8 -0
- package/dist/ui/icons/PlayIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PlusIcon.svelte +8 -0
- package/dist/ui/icons/PlusIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PreviewEyeIcon.svelte +12 -0
- package/dist/ui/icons/PreviewEyeIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ProfileIcon.svelte +12 -0
- package/dist/ui/icons/ProfileIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PublishCancelIcon.svelte +8 -0
- package/dist/ui/icons/PublishCancelIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PublishIcon.svelte +12 -0
- package/dist/ui/icons/PublishIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/RefreshIcon.svelte +10 -0
- package/dist/ui/icons/RefreshIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/RepairIcon.svelte +10 -0
- package/dist/ui/icons/RepairIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/SaveIcon.svelte +14 -0
- package/dist/ui/icons/SaveIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/SearchIcon.svelte +8 -0
- package/dist/ui/icons/SearchIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/SelectIcon.svelte +7 -0
- package/dist/ui/icons/SelectIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/SettingsIcon.svelte +8 -0
- package/dist/ui/icons/SettingsIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/SidebarToggleIcon.svelte +28 -0
- package/dist/ui/icons/SidebarToggleIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/SliderAppIcon.svelte +14 -0
- package/dist/ui/icons/SliderAppIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/SquareCheckIcon.svelte +3 -0
- package/dist/ui/icons/SquareCheckIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/StarIcon.svelte +6 -0
- package/dist/ui/icons/StarIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/StarOutlinedIcon.svelte +6 -0
- package/dist/ui/icons/StarOutlinedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/StaticContentIcon.svelte +8 -0
- package/dist/ui/icons/StaticContentIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/SubtractIcon.svelte +9 -0
- package/dist/ui/icons/SubtractIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/TabNewIcon.svelte +6 -0
- package/dist/ui/icons/TabNewIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/TableAppIcon.svelte +19 -0
- package/dist/ui/icons/TableAppIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/Tablet.svelte +20 -0
- package/dist/ui/icons/Tablet.svelte.d.ts +21 -0
- package/dist/ui/icons/TabletPreview.svelte +20 -0
- package/dist/ui/icons/TabletPreview.svelte.d.ts +21 -0
- package/dist/ui/icons/TabsIcon.svelte +17 -0
- package/dist/ui/icons/TabsIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ThreeDotsIcon.svelte +14 -0
- package/dist/ui/icons/ThreeDotsIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/TimesIcon.svelte +4 -0
- package/dist/ui/icons/TimesIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ToolTipInfoCircleIcon.svelte +11 -0
- package/dist/ui/icons/ToolTipInfoCircleIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/TooltipInfoCircleFilled.svelte +13 -0
- package/dist/ui/icons/TooltipInfoCircleFilled.svelte.d.ts +26 -0
- package/dist/ui/icons/TooltipInfoSquaredIcon.svelte +16 -0
- package/dist/ui/icons/TooltipInfoSquaredIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/TriangleDownIcon.svelte +7 -0
- package/dist/ui/icons/TriangleDownIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/TriangleDownIconToggle.svelte +21 -0
- package/dist/ui/icons/TriangleDownIconToggle.svelte.d.ts +20 -0
- package/dist/ui/icons/UndoIcon.svelte +6 -0
- package/dist/ui/icons/UndoIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/UploadFileIcon.svelte +10 -0
- package/dist/ui/icons/UploadFileIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/WarningCircleIcon.svelte +7 -0
- package/dist/ui/icons/WarningCircleIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/WarningCircleOutlineIcon.svelte +14 -0
- package/dist/ui/icons/WarningCircleOutlineIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/WarningTriangleIcon.svelte +6 -0
- package/dist/ui/icons/WarningTriangleIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/WarningTriangleOutlineIcon.svelte +14 -0
- package/dist/ui/icons/WarningTriangleOutlineIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/WebflowComponentIcon.svelte +14 -0
- package/dist/ui/icons/WebflowComponentIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/WebflowComponentOutlinedIcon.svelte +10 -0
- package/dist/ui/icons/WebflowComponentOutlinedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/WebflowInsightsIcon.svelte +6 -0
- package/dist/ui/icons/WebflowInsightsIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/WizedLogoIcon.svelte +39 -0
- package/dist/ui/icons/WizedLogoIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/XL.svelte +19 -0
- package/dist/ui/icons/XL.svelte.d.ts +21 -0
- package/dist/ui/icons/XXL.svelte +19 -0
- package/dist/ui/icons/XXL.svelte.d.ts +21 -0
- package/dist/ui/icons/XXXL.svelte +19 -0
- package/dist/ui/icons/XXXL.svelte.d.ts +21 -0
- package/dist/ui/icons/apps/FsConsentIcon.svelte +22 -0
- package/dist/ui/icons/apps/FsConsentIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsCursorIcon.svelte +12 -0
- package/dist/ui/icons/apps/FsCursorIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsExampleIcon.svelte +10 -0
- package/dist/ui/icons/apps/FsExampleIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsInstagramFeedIcon.svelte +27 -0
- package/dist/ui/icons/apps/FsInstagramFeedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsMarqueeIcon.svelte +13 -0
- package/dist/ui/icons/apps/FsMarqueeIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsNumberCountIcon.svelte +46 -0
- package/dist/ui/icons/apps/FsNumberCountIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsSliderIcon.svelte +13 -0
- package/dist/ui/icons/apps/FsSliderIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsTablesIcon.svelte +19 -0
- package/dist/ui/icons/apps/FsTablesIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsTabsIcon.svelte +24 -0
- package/dist/ui/icons/apps/FsTabsIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsTooltipIcon.svelte +12 -0
- package/dist/ui/icons/apps/FsTooltipIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsYouTubeFeedIcon.svelte +43 -0
- package/dist/ui/icons/apps/FsYouTubeFeedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/index.d.ts +15 -0
- package/dist/ui/icons/apps/index.js +15 -0
- package/dist/ui/icons/index.d.ts +120 -0
- package/dist/ui/icons/index.js +120 -0
- package/dist/ui/index.css +494 -0
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +2 -0
- package/dist/utils/api/checkIfAppModeIsDesign.d.ts +5 -0
- package/dist/utils/api/checkIfAppModeIsDesign.js +20 -0
- package/dist/utils/api/clipboard/handlePaste.d.ts +46 -0
- package/dist/utils/api/clipboard/handlePaste.js +53 -0
- package/dist/utils/api/clipboard/index.d.ts +1 -0
- package/dist/utils/api/clipboard/index.js +1 -0
- package/dist/utils/api/copyPaste/index.d.ts +18 -0
- package/dist/utils/api/copyPaste/index.js +1 -0
- package/dist/utils/api/getAllAssets.d.ts +12 -0
- package/dist/utils/api/getAllAssets.js +21 -0
- package/dist/utils/api/getFinsweetComponentsEnvironment.d.ts +9 -0
- package/dist/utils/api/getFinsweetComponentsEnvironment.js +70 -0
- package/dist/utils/api/index.d.ts +6 -0
- package/dist/utils/api/index.js +6 -0
- package/dist/utils/api/insertWithXSCP.d.ts +5 -0
- package/dist/utils/api/insertWithXSCP.js +13 -0
- package/dist/utils/auth/crossWindowLogin.d.ts +2 -0
- package/dist/utils/auth/crossWindowLogin.js +49 -0
- package/dist/utils/auth/index.d.ts +61 -0
- package/dist/utils/auth/index.js +196 -0
- package/dist/utils/browser-storage/index.d.ts +2 -0
- package/dist/utils/browser-storage/index.js +2 -0
- package/dist/utils/browser-storage/localStorage.d.ts +24 -0
- package/dist/utils/browser-storage/localStorage.js +56 -0
- package/dist/utils/browser-storage/sessionStorage.d.ts +24 -0
- package/dist/utils/browser-storage/sessionStorage.js +56 -0
- package/dist/utils/constants.d.ts +61 -0
- package/dist/utils/constants.js +73 -0
- package/dist/utils/custom-code/api.d.ts +17 -0
- package/dist/utils/custom-code/api.js +41 -0
- package/dist/utils/custom-code/index.d.ts +1 -0
- package/dist/utils/custom-code/index.js +1 -0
- package/dist/utils/helpers/cleanupTooltipMessage.d.ts +5 -0
- package/dist/utils/helpers/cleanupTooltipMessage.js +25 -0
- package/dist/utils/helpers/goto.d.ts +7 -0
- package/dist/utils/helpers/goto.js +35 -0
- package/dist/utils/helpers/index.d.ts +5 -0
- package/dist/utils/helpers/index.js +5 -0
- package/dist/utils/helpers/noop.d.ts +4 -0
- package/dist/utils/helpers/noop.js +7 -0
- package/dist/utils/helpers/numbers.d.ts +27 -0
- package/dist/utils/helpers/numbers.js +61 -0
- package/dist/utils/helpers/objectsToModuleExports.d.ts +9 -0
- package/dist/utils/helpers/objectsToModuleExports.js +13 -0
- package/dist/utils/helpers/trimText.d.ts +15 -0
- package/dist/utils/helpers/trimText.js +33 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/logger/index.d.ts +19 -0
- package/dist/utils/logger/index.js +41 -0
- package/dist/utils/webflow-canvas/attributes/getAllWebflowElementAttributes.d.ts +6 -0
- package/dist/utils/webflow-canvas/attributes/getAllWebflowElementAttributes.js +19 -0
- package/dist/utils/webflow-canvas/attributes/getInstanceNamesFromObject.d.ts +8 -0
- package/dist/utils/webflow-canvas/attributes/getInstanceNamesFromObject.js +21 -0
- package/dist/utils/webflow-canvas/attributes/getWebflowElementAttribute.d.ts +7 -0
- package/dist/utils/webflow-canvas/attributes/getWebflowElementAttribute.js +25 -0
- package/dist/utils/webflow-canvas/attributes/getWebflowElementTextContent.d.ts +6 -0
- package/dist/utils/webflow-canvas/attributes/getWebflowElementTextContent.js +26 -0
- package/dist/utils/webflow-canvas/attributes/index.d.ts +7 -0
- package/dist/utils/webflow-canvas/attributes/index.js +7 -0
- package/dist/utils/webflow-canvas/attributes/removeWebflowElementAttribute.d.ts +7 -0
- package/dist/utils/webflow-canvas/attributes/removeWebflowElementAttribute.js +37 -0
- package/dist/utils/webflow-canvas/attributes/setStyles.d.ts +10 -0
- package/dist/utils/webflow-canvas/attributes/setStyles.js +36 -0
- package/dist/utils/webflow-canvas/attributes/setWebflowElementAttribute.d.ts +11 -0
- package/dist/utils/webflow-canvas/attributes/setWebflowElementAttribute.js +61 -0
- package/dist/utils/webflow-canvas/findInstanceElement.d.ts +32 -0
- package/dist/utils/webflow-canvas/findInstanceElement.js +144 -0
- package/dist/utils/webflow-canvas/getAllPages.d.ts +29 -0
- package/dist/utils/webflow-canvas/getAllPages.js +93 -0
- package/dist/utils/webflow-canvas/getSiteStagingUrl.d.ts +7 -0
- package/dist/utils/webflow-canvas/getSiteStagingUrl.js +14 -0
- package/dist/utils/webflow-canvas/index.d.ts +3 -0
- package/dist/utils/webflow-canvas/index.js +3 -0
- package/package.json +107 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { Placement } from '@floating-ui/dom';
|
|
2
|
+
import type { Component, Snippet } from 'svelte';
|
|
3
|
+
export type SelectValue = string & {
|
|
4
|
+
readonly brand: unique symbol;
|
|
5
|
+
};
|
|
6
|
+
export type SelectClassName = string & {
|
|
7
|
+
readonly brand: unique symbol;
|
|
8
|
+
};
|
|
9
|
+
export interface SelectOption {
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
labelIcon?: Component;
|
|
14
|
+
descriptionTitle?: string;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface SelectChangeEvent {
|
|
19
|
+
value: string | null;
|
|
20
|
+
}
|
|
21
|
+
export type SelectChangeHandler = (event: SelectChangeEvent) => void;
|
|
22
|
+
export interface SelectProps {
|
|
23
|
+
id?: string;
|
|
24
|
+
defaultText?: string;
|
|
25
|
+
label?: string;
|
|
26
|
+
dialog?: boolean;
|
|
27
|
+
hide?: boolean;
|
|
28
|
+
enableSearch?: boolean;
|
|
29
|
+
tooltipMessage?: string;
|
|
30
|
+
ref?: string;
|
|
31
|
+
width?: string;
|
|
32
|
+
tooltipWidth?: string;
|
|
33
|
+
dropdownWidth?: string;
|
|
34
|
+
dropdownHeight?: string;
|
|
35
|
+
options: SelectOption[];
|
|
36
|
+
selected?: string | null;
|
|
37
|
+
preventNoSelection?: boolean;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
placement?: Placement;
|
|
40
|
+
className?: string;
|
|
41
|
+
onchange?: SelectChangeHandler;
|
|
42
|
+
children?: Snippet;
|
|
43
|
+
}
|
|
44
|
+
export interface SelectState {
|
|
45
|
+
isOpen: boolean;
|
|
46
|
+
isFocused: boolean;
|
|
47
|
+
isHovered: boolean;
|
|
48
|
+
hasError: boolean;
|
|
49
|
+
showConfirmDialog: boolean;
|
|
50
|
+
selectedLabel: string;
|
|
51
|
+
lastHoveredItem: HTMLElement | null;
|
|
52
|
+
activeElement: HTMLElement | null;
|
|
53
|
+
}
|
|
54
|
+
export interface DropdownInstance {
|
|
55
|
+
toggle: HTMLElement;
|
|
56
|
+
tooltip: HTMLElement;
|
|
57
|
+
cleanup: () => void;
|
|
58
|
+
}
|
|
59
|
+
export interface DropdownConfig {
|
|
60
|
+
placement: Placement;
|
|
61
|
+
width: string;
|
|
62
|
+
height: string;
|
|
63
|
+
enableSearch: boolean;
|
|
64
|
+
preventNoSelection: boolean;
|
|
65
|
+
}
|
|
66
|
+
export interface SelectStyles {
|
|
67
|
+
borderRadius?: string;
|
|
68
|
+
background?: string;
|
|
69
|
+
boxShadow?: string;
|
|
70
|
+
border?: string;
|
|
71
|
+
opacity?: string;
|
|
72
|
+
}
|
|
73
|
+
export type NavigationKey = 'ArrowDown' | 'ArrowUp' | 'Enter' | 'Escape';
|
|
74
|
+
export interface KeyboardNavigationEvent {
|
|
75
|
+
key: NavigationKey;
|
|
76
|
+
currentIndex: number;
|
|
77
|
+
items: HTMLElement[];
|
|
78
|
+
}
|
|
79
|
+
export interface SearchConfig {
|
|
80
|
+
enabled: boolean;
|
|
81
|
+
debounceMs: number;
|
|
82
|
+
placeholder: string;
|
|
83
|
+
}
|
|
84
|
+
export type FilterFunction = (options: SelectOption[], searchTerm: string) => SelectOption[];
|
|
85
|
+
export interface SelectElementRefs {
|
|
86
|
+
confirmDialogElement?: HTMLElement;
|
|
87
|
+
dropdownWrapper?: HTMLElement;
|
|
88
|
+
target?: HTMLDivElement;
|
|
89
|
+
dropdownItems?: HTMLDivElement;
|
|
90
|
+
}
|
|
91
|
+
export interface SelectInstanceManager {
|
|
92
|
+
result: DropdownInstance[];
|
|
93
|
+
destroy(): void;
|
|
94
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/sveltekit';
|
|
2
|
+
import type { SwitchProps } from './types';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import("svelte").Component<SwitchProps, {}, "checked">;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
tags: string[];
|
|
15
|
+
argTypes: {
|
|
16
|
+
checked: {
|
|
17
|
+
control: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
disabled: {
|
|
21
|
+
control: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
id: {
|
|
25
|
+
control: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
ariaLabel: {
|
|
29
|
+
control: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
class: {
|
|
33
|
+
control: string;
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
required: {
|
|
37
|
+
control: string;
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
name: {
|
|
41
|
+
control: string;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export default meta;
|
|
47
|
+
type Story = StoryObj<typeof meta>;
|
|
48
|
+
export declare const Default: Story;
|
|
49
|
+
export declare const Checked: Story;
|
|
50
|
+
export declare const Disabled: Story;
|
|
51
|
+
export declare const DisabledChecked: Story;
|
|
52
|
+
export declare const WithAriaLabel: Story;
|
|
53
|
+
export declare const Required: Story;
|
|
54
|
+
export declare const InteractiveExample: Story;
|
|
55
|
+
export declare const InForm: Story;
|
|
56
|
+
export declare const TwoWayBinding: Story;
|
|
57
|
+
export declare const AccessibilityTest: Story;
|
|
58
|
+
export declare const KeyboardNavigationDemo: Story;
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import Switch from './Switch.svelte';
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Ui/Switch',
|
|
4
|
+
component: Switch,
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: 'centered',
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: 'A modern Svelte 5 toggle switch component for binary choices. Features two-way binding, keyboard navigation, and comprehensive accessibility support.'
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
tags: ['autodocs'],
|
|
14
|
+
argTypes: {
|
|
15
|
+
checked: {
|
|
16
|
+
control: 'boolean',
|
|
17
|
+
description: 'Whether the switch is in the on/checked state'
|
|
18
|
+
},
|
|
19
|
+
disabled: {
|
|
20
|
+
control: 'boolean',
|
|
21
|
+
description: 'Whether the switch is disabled'
|
|
22
|
+
},
|
|
23
|
+
id: {
|
|
24
|
+
control: 'text',
|
|
25
|
+
description: 'Unique identifier for the switch'
|
|
26
|
+
},
|
|
27
|
+
ariaLabel: {
|
|
28
|
+
control: 'text',
|
|
29
|
+
description: 'Accessible label for screen readers'
|
|
30
|
+
},
|
|
31
|
+
class: {
|
|
32
|
+
control: 'text',
|
|
33
|
+
description: 'Additional CSS classes'
|
|
34
|
+
},
|
|
35
|
+
required: {
|
|
36
|
+
control: 'boolean',
|
|
37
|
+
description: 'Whether the switch is required in forms'
|
|
38
|
+
},
|
|
39
|
+
name: {
|
|
40
|
+
control: 'text',
|
|
41
|
+
description: 'Name attribute for form submission'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
export default meta;
|
|
46
|
+
// Basic states
|
|
47
|
+
export const Default = {
|
|
48
|
+
args: {
|
|
49
|
+
checked: false
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
export const Checked = {
|
|
53
|
+
args: {
|
|
54
|
+
checked: true
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
export const Disabled = {
|
|
58
|
+
args: {
|
|
59
|
+
checked: false,
|
|
60
|
+
disabled: true
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
export const DisabledChecked = {
|
|
64
|
+
args: {
|
|
65
|
+
checked: true,
|
|
66
|
+
disabled: true
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
// With labels and accessibility
|
|
70
|
+
export const WithAriaLabel = {
|
|
71
|
+
args: {
|
|
72
|
+
checked: false,
|
|
73
|
+
ariaLabel: 'Enable notifications'
|
|
74
|
+
},
|
|
75
|
+
parameters: {
|
|
76
|
+
docs: {
|
|
77
|
+
description: {
|
|
78
|
+
story: 'Switch with an accessible label for screen readers.'
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
export const Required = {
|
|
84
|
+
args: {
|
|
85
|
+
checked: false,
|
|
86
|
+
required: true,
|
|
87
|
+
ariaLabel: 'Accept terms and conditions (required)'
|
|
88
|
+
},
|
|
89
|
+
parameters: {
|
|
90
|
+
docs: {
|
|
91
|
+
description: {
|
|
92
|
+
story: 'Switch that is required in form contexts.'
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
// Interactive examples
|
|
98
|
+
export const InteractiveExample = {
|
|
99
|
+
render: (args) => ({
|
|
100
|
+
Component: Switch,
|
|
101
|
+
props: {
|
|
102
|
+
...args,
|
|
103
|
+
onchange: (event) => {
|
|
104
|
+
console.log('Switch toggled:', event);
|
|
105
|
+
alert(`Switch is now ${event.checked ? 'ON' : 'OFF'}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}),
|
|
109
|
+
args: {
|
|
110
|
+
checked: false,
|
|
111
|
+
ariaLabel: 'Click to see change event'
|
|
112
|
+
},
|
|
113
|
+
parameters: {
|
|
114
|
+
docs: {
|
|
115
|
+
description: {
|
|
116
|
+
story: 'Interactive switch that demonstrates the modern onchange event handler.'
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
// Form integration
|
|
122
|
+
export const InForm = {
|
|
123
|
+
render: (args) => ({
|
|
124
|
+
Component: Switch,
|
|
125
|
+
props: {
|
|
126
|
+
...args,
|
|
127
|
+
name: 'user-preferences',
|
|
128
|
+
id: 'notifications-toggle'
|
|
129
|
+
}
|
|
130
|
+
}),
|
|
131
|
+
args: {
|
|
132
|
+
checked: false,
|
|
133
|
+
ariaLabel: 'Enable email notifications',
|
|
134
|
+
required: true
|
|
135
|
+
},
|
|
136
|
+
parameters: {
|
|
137
|
+
docs: {
|
|
138
|
+
description: {
|
|
139
|
+
story: 'Switch configured for use in forms with proper name and id attributes.'
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
// Two-way binding example
|
|
145
|
+
export const TwoWayBinding = {
|
|
146
|
+
render: () => ({
|
|
147
|
+
Component: () => `
|
|
148
|
+
<script>
|
|
149
|
+
import Switch from './Switch.svelte';
|
|
150
|
+
let isEnabled = $state(false);
|
|
151
|
+
</script>
|
|
152
|
+
|
|
153
|
+
<div style="display: flex; flex-direction: column; gap: 16px; align-items: flex-start;">
|
|
154
|
+
<Switch bind:checked={isEnabled} ariaLabel="Toggle feature" />
|
|
155
|
+
<p>Feature is currently: <strong>{isEnabled ? 'ENABLED' : 'DISABLED'}</strong></p>
|
|
156
|
+
<button onclick={() => isEnabled = !isEnabled}>
|
|
157
|
+
{isEnabled ? 'Disable' : 'Enable'} via button
|
|
158
|
+
</button>
|
|
159
|
+
</div>
|
|
160
|
+
`
|
|
161
|
+
}),
|
|
162
|
+
parameters: {
|
|
163
|
+
docs: {
|
|
164
|
+
description: {
|
|
165
|
+
story: 'Demonstrates two-way binding with bind:checked directive.'
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
// Accessibility testing
|
|
171
|
+
export const AccessibilityTest = {
|
|
172
|
+
args: {
|
|
173
|
+
checked: false,
|
|
174
|
+
ariaLabel: 'Accessibility test switch',
|
|
175
|
+
id: 'a11y-test-switch'
|
|
176
|
+
},
|
|
177
|
+
parameters: {
|
|
178
|
+
docs: {
|
|
179
|
+
description: {
|
|
180
|
+
story: 'Switch configured for accessibility testing with proper ARIA attributes.'
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
// Keyboard navigation demo
|
|
186
|
+
export const KeyboardNavigationDemo = {
|
|
187
|
+
args: {
|
|
188
|
+
checked: false,
|
|
189
|
+
ariaLabel: 'Use Tab to focus, Space or Enter to toggle'
|
|
190
|
+
},
|
|
191
|
+
parameters: {
|
|
192
|
+
docs: {
|
|
193
|
+
description: {
|
|
194
|
+
story: 'Demonstrates keyboard navigation. Use Tab to focus, then Space or Enter to toggle.'
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { SwitchChangeEvent, SwitchProps } from './types';
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
checked = $bindable(false),
|
|
6
|
+
disabled = false,
|
|
7
|
+
id = '',
|
|
8
|
+
ariaLabel,
|
|
9
|
+
class: className = '',
|
|
10
|
+
required = false,
|
|
11
|
+
name,
|
|
12
|
+
onchange
|
|
13
|
+
}: SwitchProps = $props();
|
|
14
|
+
|
|
15
|
+
// Generate unique ID if not provided
|
|
16
|
+
let switchId = $derived(id || `switch-${Math.random().toString(36).substr(2, 9)}`);
|
|
17
|
+
|
|
18
|
+
// State for tracking focus
|
|
19
|
+
let isFocused = $state(false);
|
|
20
|
+
|
|
21
|
+
// Computed values
|
|
22
|
+
let isDisabled = $derived(disabled);
|
|
23
|
+
let isChecked = $derived(checked);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Handles input events on the toggle checkbox
|
|
27
|
+
*/
|
|
28
|
+
const handleInput = (event: Event): void => {
|
|
29
|
+
if (isDisabled) return;
|
|
30
|
+
|
|
31
|
+
const target = event.target as HTMLInputElement;
|
|
32
|
+
const newChecked = target.checked;
|
|
33
|
+
|
|
34
|
+
// Update bindable prop
|
|
35
|
+
checked = newChecked;
|
|
36
|
+
|
|
37
|
+
// Create event object
|
|
38
|
+
const changeEvent: SwitchChangeEvent = {
|
|
39
|
+
checked: newChecked,
|
|
40
|
+
id: switchId
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// Call event handler
|
|
44
|
+
onchange?.(changeEvent);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Handle focus events
|
|
49
|
+
*/
|
|
50
|
+
const handleFocus = (): void => {
|
|
51
|
+
if (isDisabled) return;
|
|
52
|
+
isFocused = true;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Handle blur events
|
|
57
|
+
*/
|
|
58
|
+
const handleBlur = (): void => {
|
|
59
|
+
isFocused = false;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Handle keyboard navigation
|
|
64
|
+
*/
|
|
65
|
+
const handleKeydown = (event: KeyboardEvent): void => {
|
|
66
|
+
if (isDisabled) return;
|
|
67
|
+
|
|
68
|
+
// Space or Enter toggles the switch
|
|
69
|
+
if (event.key === ' ' || event.key === 'Enter') {
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
const newChecked = !checked;
|
|
72
|
+
checked = newChecked;
|
|
73
|
+
|
|
74
|
+
const changeEvent: SwitchChangeEvent = {
|
|
75
|
+
checked: newChecked,
|
|
76
|
+
id: switchId
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
onchange?.(changeEvent);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// Computed classes for styling
|
|
84
|
+
let labelClasses = $derived.by(() => {
|
|
85
|
+
const classes = ['switch'];
|
|
86
|
+
if (isDisabled) classes.push('switch--disabled');
|
|
87
|
+
if (isFocused) classes.push('switch--focused');
|
|
88
|
+
if (className) classes.push(className);
|
|
89
|
+
return classes.join(' ');
|
|
90
|
+
});
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<label class={labelClasses} for={switchId}>
|
|
94
|
+
<input
|
|
95
|
+
class="switch__input"
|
|
96
|
+
type="checkbox"
|
|
97
|
+
id={switchId}
|
|
98
|
+
name={name || switchId}
|
|
99
|
+
bind:checked
|
|
100
|
+
disabled={isDisabled}
|
|
101
|
+
{required}
|
|
102
|
+
aria-label={ariaLabel}
|
|
103
|
+
aria-checked={isChecked}
|
|
104
|
+
role="switch"
|
|
105
|
+
tabindex={isDisabled ? -1 : 0}
|
|
106
|
+
onfocus={handleFocus}
|
|
107
|
+
onblur={handleBlur}
|
|
108
|
+
oninput={handleInput}
|
|
109
|
+
onkeydown={handleKeydown}
|
|
110
|
+
/>
|
|
111
|
+
<div class="switch__track">
|
|
112
|
+
<div class="switch__handle"></div>
|
|
113
|
+
</div>
|
|
114
|
+
</label>
|
|
115
|
+
|
|
116
|
+
<style>
|
|
117
|
+
/* Reset */
|
|
118
|
+
*,
|
|
119
|
+
*:before,
|
|
120
|
+
*:after {
|
|
121
|
+
box-sizing: border-box;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* Switch container */
|
|
125
|
+
.switch {
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
display: inline-flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
position: relative;
|
|
130
|
+
user-select: none;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.switch--disabled {
|
|
134
|
+
cursor: not-allowed;
|
|
135
|
+
opacity: 0.4;
|
|
136
|
+
pointer-events: none;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* Hidden checkbox input */
|
|
140
|
+
.switch__input {
|
|
141
|
+
position: absolute;
|
|
142
|
+
width: 1px;
|
|
143
|
+
height: 1px;
|
|
144
|
+
padding: 0;
|
|
145
|
+
margin: -1px;
|
|
146
|
+
overflow: hidden;
|
|
147
|
+
clip: rect(0, 0, 0, 0);
|
|
148
|
+
white-space: nowrap;
|
|
149
|
+
border: 0;
|
|
150
|
+
opacity: 0;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* Track (background) */
|
|
154
|
+
.switch__track {
|
|
155
|
+
display: inline-block;
|
|
156
|
+
background-color: var(--background3, #383838);
|
|
157
|
+
border: 1px solid var(--border3, #525252);
|
|
158
|
+
border-radius: 9px;
|
|
159
|
+
width: 27px;
|
|
160
|
+
height: 18px;
|
|
161
|
+
position: relative;
|
|
162
|
+
vertical-align: middle;
|
|
163
|
+
transition:
|
|
164
|
+
background-color 0.2s ease,
|
|
165
|
+
border-color 0.2s ease;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* Handle (the moving circle) */
|
|
169
|
+
.switch__handle {
|
|
170
|
+
display: block;
|
|
171
|
+
background-color: var(--actionPrimaryText, #ffffff);
|
|
172
|
+
border-radius: 50%;
|
|
173
|
+
width: 14px;
|
|
174
|
+
height: 14px;
|
|
175
|
+
position: absolute;
|
|
176
|
+
top: 1px;
|
|
177
|
+
left: 1px;
|
|
178
|
+
transition: transform 0.2s ease;
|
|
179
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* Checked state */
|
|
183
|
+
.switch__input:checked + .switch__track {
|
|
184
|
+
background-color: var(--actionPrimaryBackground, #006acc);
|
|
185
|
+
border-color: var(--actionPrimaryBackground, #006acc);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.switch__input:checked + .switch__track .switch__handle {
|
|
189
|
+
transform: translateX(10px);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/* Hover states */
|
|
193
|
+
.switch:hover:not(.switch--disabled) .switch__track {
|
|
194
|
+
border-color: var(--border2, #6b6b6b);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.switch:hover:not(.switch--disabled) .switch__input:checked + .switch__track {
|
|
198
|
+
background-color: var(--actionPrimaryBackgroundHover, #187cd9);
|
|
199
|
+
border-color: var(--actionPrimaryBackgroundHover, #187cd9);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* High contrast mode support */
|
|
203
|
+
@media (prefers-contrast: high) {
|
|
204
|
+
.switch__track {
|
|
205
|
+
border-width: 2px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.switch__handle {
|
|
209
|
+
border: 1px solid var(--text1, #d9d9d9);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* Reduced motion support */
|
|
214
|
+
@media (prefers-reduced-motion: reduce) {
|
|
215
|
+
.switch__track,
|
|
216
|
+
.switch__handle {
|
|
217
|
+
transition: none;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Switch } from './Switch.svelte';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface SwitchChangeEvent {
|
|
2
|
+
checked: boolean;
|
|
3
|
+
id?: string;
|
|
4
|
+
}
|
|
5
|
+
export type SwitchChangeHandler = (event: SwitchChangeEvent) => void;
|
|
6
|
+
export interface SwitchProps {
|
|
7
|
+
checked?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
id?: string;
|
|
10
|
+
ariaLabel?: string;
|
|
11
|
+
class?: string;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
name?: string;
|
|
14
|
+
onchange?: SwitchChangeHandler;
|
|
15
|
+
}
|
|
16
|
+
export interface SwitchState {
|
|
17
|
+
checked: boolean;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
focused: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface SwitchAccessibilityConfig {
|
|
22
|
+
ariaLabel?: string;
|
|
23
|
+
ariaLabelledBy?: string;
|
|
24
|
+
ariaDescribedBy?: string;
|
|
25
|
+
role?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface SwitchAnimationConfig {
|
|
28
|
+
duration: number;
|
|
29
|
+
easing: string;
|
|
30
|
+
enabled: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface SwitchThemeConfig {
|
|
33
|
+
size: 'sm' | 'md' | 'lg';
|
|
34
|
+
variant: 'default' | 'success' | 'warning' | 'danger';
|
|
35
|
+
customColors?: {
|
|
36
|
+
background?: string;
|
|
37
|
+
checkedBackground?: string;
|
|
38
|
+
border?: string;
|
|
39
|
+
checkedBorder?: string;
|
|
40
|
+
handle?: string;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface SwitchEvents {
|
|
44
|
+
change: SwitchChangeEvent;
|
|
45
|
+
focus: FocusEvent;
|
|
46
|
+
blur: FocusEvent;
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Text Component
|
|
2
|
+
|
|
3
|
+
A versatile and modern text component built with Svelte 5 that provides comprehensive styling options, tooltip support, and interactive popup functionality that matches the original popup design.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- ✅ **Modern Svelte 5**: Built with the latest Svelte 5 runes system (`$state`, `$derived`, `$props`)
|
|
8
|
+
- ✅ **Flexible Styling**: Font size, weight, color, alignment, and more
|
|
9
|
+
- ✅ **Tooltip Integration**: Full tooltip support with customizable options
|
|
10
|
+
- ✅ **Original Popup Design**: Interactive popup system matching the exact original popup styling
|
|
11
|
+
- ✅ **Accessibility**: Full keyboard navigation and ARIA support
|
|
12
|
+
- ✅ **Loading States**: Built-in loading spinner support
|
|
13
|
+
- ✅ **Icon Support**: Display icons alongside text
|
|
14
|
+
- ✅ **Raw HTML**: Render HTML content when needed
|
|
15
|
+
- ✅ **TypeScript**: Full type safety with comprehensive interfaces
|
|
16
|
+
|
|
17
|
+
## Action Popups
|
|
18
|
+
|
|
19
|
+
The popup system uses the exact same design and layout as the original popup component:
|
|
20
|
+
|
|
21
|
+
```svelte
|
|
22
|
+
<!-- Default popup (matches original exactly) -->
|
|
23
|
+
<Text label="Remove item" popup={{}} on:popupAction={handleRemove} />
|
|
24
|
+
|
|
25
|
+
<!-- Custom popup -->
|
|
26
|
+
<Text
|
|
27
|
+
label="Delete item"
|
|
28
|
+
popup={{
|
|
29
|
+
title: 'Delete Item',
|
|
30
|
+
subtitle: 'Alt + click',
|
|
31
|
+
description: 'This action cannot be undone.',
|
|
32
|
+
icon: DeleteIcon,
|
|
33
|
+
active: true
|
|
34
|
+
}}
|
|
35
|
+
on:popupAction={handleDelete}
|
|
36
|
+
/>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Popup Styling Features
|
|
40
|
+
|
|
41
|
+
The popup matches the original design with:
|
|
42
|
+
|
|
43
|
+
- **Grid Layout**: 3-column grid layout for icon, title, and subtitle
|
|
44
|
+
- **Exact Dimensions**: 200px width, minimum 80px height
|
|
45
|
+
- **Original Colors**: `#353535` background, `#363636` borders
|
|
46
|
+
- **Typography**: Same font sizes, weights, and colors
|
|
47
|
+
- **Hover Effects**: Original hover styling with `var(--hoverColor)`
|
|
48
|
+
- **Spacing**: Exact padding and gap values (8px, 12px)
|
|
49
|
+
|
|
50
|
+
### Default Popup Configuration
|
|
51
|
+
|
|
52
|
+
When you provide an empty `popup={}` object, you get these defaults:
|
|
53
|
+
|
|
54
|
+
- **Title**: "Remove" (matches original)
|
|
55
|
+
- **Subtitle**: "Alt + click"
|
|
56
|
+
- **Description**: "This action will remove the current selection."
|
|
57
|
+
- **Icon**: DeleteIcon (matches original default)
|
|
58
|
+
|
|
59
|
+
## Storybook Examples
|
|
60
|
+
|
|
61
|
+
View the popup examples in Storybook:
|
|
62
|
+
|
|
63
|
+
- **Default Popup**: Shows exact original styling
|
|
64
|
+
- **Original Popup Style**: Minimal configuration matching original
|
|
65
|
+
- **Custom Popup**: Demonstrates customization options
|
|
66
|
+
- **Active Popup**: Shows active state styling
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm run storybook
|
|
70
|
+
# Navigate to UI/Text to see all popup examples
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The popup component now provides pixel-perfect matching with the original popup design while maintaining the modern Svelte 5 architecture and flexible configuration options.
|