UNPKG

storybook-addon-data-theme-switcher

Version:

A Storybook addon to switch the data-theme attribute on the html element

65 lines 5.81 kB
import * as _$storybook_internal_csf0 from "storybook/internal/csf"; //#region src/types/Theme.d.ts interface Theme { dataTheme: string; color?: string; name: string; default?: boolean; } //#endregion //#region src/generated/types.d.ts /** * Auto-generated file. Do not edit manually. */ /** * Names of all available icons. */ type IconName = "AccessibilityAltIcon" | "AccessibilityIcon" | "AccessibilityIgnoredIcon" | "AddIcon" | "AdminIcon" | "AlertAltIcon" | "AlertIcon" | "AlignLeftIcon" | "AlignRightIcon" | "AppleIcon" | "ArrowBottomLeftIcon" | "ArrowBottomRightIcon" | "ArrowDownIcon" | "ArrowLeftIcon" | "ArrowRightIcon" | "ArrowSolidDownIcon" | "ArrowSolidLeftIcon" | "ArrowSolidRightIcon" | "ArrowSolidUpIcon" | "ArrowTopLeftIcon" | "ArrowTopRightIcon" | "ArrowUpIcon" | "AzureDevOpsIcon" | "BackIcon" | "BasketIcon" | "BatchAcceptIcon" | "BatchDenyIcon" | "BeakerIcon" | "BellIcon" | "BitbucketIcon" | "BoldIcon" | "BookIcon" | "BookmarkHollowIcon" | "BookmarkIcon" | "BottomBarIcon" | "BottomBarToggleIcon" | "BoxIcon" | "BranchIcon" | "BrowserIcon" | "BugIcon" | "ButtonIcon" | "CPUIcon" | "CalendarIcon" | "CameraIcon" | "CameraStabilizeIcon" | "CategoryIcon" | "CertificateIcon" | "ChangedIcon" | "ChatIcon" | "CheckIcon" | "ChevronDownIcon" | "ChevronLeftIcon" | "ChevronRightIcon" | "ChevronSmallDownIcon" | "ChevronSmallLeftIcon" | "ChevronSmallRightIcon" | "ChevronSmallUpIcon" | "ChevronUpIcon" | "ChromaticIcon" | "ChromeIcon" | "CircleHollowIcon" | "CircleIcon" | "ClearIcon" | "CloseAltIcon" | "CloseIcon" | "CloudHollowIcon" | "CloudIcon" | "CogIcon" | "CollapseIcon" | "CommandIcon" | "CommentAddIcon" | "CommentIcon" | "CommentsIcon" | "CommitIcon" | "CompassIcon" | "ComponentDrivenIcon" | "ComponentIcon" | "ContrastIcon" | "ContrastIgnoredIcon" | "ControlsIcon" | "CopyIcon" | "CreditIcon" | "CrossIcon" | "DashboardIcon" | "DatabaseIcon" | "DeleteIcon" | "DiamondIcon" | "DirectionIcon" | "DiscordIcon" | "DocChartIcon" | "DocListIcon" | "DocumentIcon" | "DownloadIcon" | "DragIcon" | "EditIcon" | "EditorIcon" | "EllipsisIcon" | "EmailIcon" | "ExpandAltIcon" | "ExpandIcon" | "EyeCloseIcon" | "EyeIcon" | "FaceHappyIcon" | "FaceNeutralIcon" | "FaceSadIcon" | "FacebookIcon" | "FailedIcon" | "FastForwardIcon" | "FigmaIcon" | "FilterIcon" | "FlagIcon" | "FolderIcon" | "FormIcon" | "GDriveIcon" | "GiftIcon" | "GithubIcon" | "GitlabIcon" | "GlobeIcon" | "GoogleIcon" | "GraphBarIcon" | "GraphLineIcon" | "GraphqlIcon" | "GridAltIcon" | "GridIcon" | "GrowIcon" | "HeartHollowIcon" | "HeartIcon" | "HomeIcon" | "HourglassIcon" | "InfoIcon" | "ItalicIcon" | "JumpToIcon" | "KeyIcon" | "LightningIcon" | "LightningOffIcon" | "LinkBrokenIcon" | "LinkIcon" | "LinkedinIcon" | "LinuxIcon" | "ListOrderedIcon" | "ListUnorderedIcon" | "LocationIcon" | "LockIcon" | "MarkdownIcon" | "MarkupIcon" | "MediumIcon" | "MemoryIcon" | "MenuIcon" | "MergeIcon" | "MirrorIcon" | "MobileIcon" | "MoonIcon" | "NutIcon" | "OutboxIcon" | "OutlineIcon" | "PaintBrushAltIcon" | "PaintBrushIcon" | "PaperClipIcon" | "ParagraphIcon" | "PassedIcon" | "PhoneIcon" | "PhotoDragIcon" | "PhotoIcon" | "PhotoStabilizeIcon" | "PinAltIcon" | "PinIcon" | "PlayAllHollowIcon" | "PlayBackIcon" | "PlayHollowIcon" | "PlayIcon" | "PlayNextIcon" | "PlusIcon" | "PointerDefaultIcon" | "PointerHandIcon" | "PowerIcon" | "PrintIcon" | "ProceedIcon" | "ProfileIcon" | "PullRequestIcon" | "QuestionIcon" | "RSSIcon" | "RedirectIcon" | "ReduxIcon" | "RefreshIcon" | "ReplyIcon" | "RepoIcon" | "RequestChangeIcon" | "RewindIcon" | "RulerIcon" | "SaveIcon" | "SearchIcon" | "ShareAltIcon" | "ShareIcon" | "ShieldIcon" | "SideBySideIcon" | "SidebarAltIcon" | "SidebarAltToggleIcon" | "SidebarIcon" | "SidebarToggleIcon" | "SortDownIcon" | "SortUpIcon" | "SpeakerIcon" | "StackedIcon" | "StarHollowIcon" | "StarIcon" | "StatusFailIcon" | "StatusIcon" | "StatusPassIcon" | "StatusWarnIcon" | "StickerIcon" | "StopAltHollowIcon" | "StopAltIcon" | "StopIcon" | "StorybookIcon" | "StructureIcon" | "SubtractIcon" | "SunIcon" | "SupportIcon" | "SweepIcon" | "SwitchAltIcon" | "SyncIcon" | "TabletIcon" | "ThumbsUpIcon" | "TimeIcon" | "TimerIcon" | "TransferIcon" | "TrashIcon" | "TwitterIcon" | "TypeIcon" | "UbuntuIcon" | "UndoIcon" | "UnfoldIcon" | "UnlockIcon" | "UnpinIcon" | "UploadIcon" | "UserAddIcon" | "UserAltIcon" | "UserIcon" | "UsersIcon" | "VSCodeIcon" | "VerifiedIcon" | "VideoIcon" | "WandIcon" | "WatchIcon" | "WindowsIcon" | "WrenchIcon" | "XIcon" | "YoutubeIcon" | "ZoomIcon" | "ZoomOutIcon" | "ZoomResetIcon"; //#endregion //#region src/types/ThemeConfig.d.ts type ToolbarConfig = { /** * The title to display in the toolbar. */ title?: string; /** * The icon to display in the toolbar. */ icon?: IconName; }; interface ThemeConfig$1 { /** * The data theme value to use for the active theme. Retrieved from globalTypes globals["dataTheme"]. */ default?: string; /** * The list of themes to display in the selector. */ list: Theme[]; /** * The data attribute to use. Retrieved from globalTypes globals["dataAttribute"]. */ dataAttribute?: string; /** * Controls whether the user can clear the theme selection. */ clearable?: boolean; /** * The toolbar configuration. */ toolbar?: ToolbarConfig; /** * The function to call when the theme changes. * * @param themeName The name of the theme that was selected. */ onChange?: (themeName: Theme | undefined) => void; } //#endregion //#region src/preset/types.d.ts type ThemeConfig = Partial<Pick<ThemeConfig$1, "list" | "dataAttribute" | "clearable" | "toolbar">>; //#endregion //#region src/preset/index.d.ts declare const _default: () => _$storybook_internal_csf0.PreviewAddon<_$storybook_internal_csf0.AddonTypes>; //#endregion export { ThemeConfig, _default as default };