@tenerife.music/ui 1.0.8 → 1.0.13
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 +12 -8
- package/dist/{tokens/colors.d.ts → colors-CVA7_16U.d.cts} +21 -19
- package/dist/colors-CVA7_16U.d.ts +289 -0
- package/dist/index-BgXvioll.d.cts +6845 -0
- package/dist/index-Bv4wWj9I.d.ts +6845 -0
- package/dist/index.cjs +16385 -2
- package/dist/index.d.cts +4020 -0
- package/dist/index.d.ts +4020 -39
- package/dist/index.mjs +14502 -6425
- package/dist/preset.cjs +1264 -2
- package/dist/preset.d.cts +21 -0
- package/dist/preset.d.ts +3 -1
- package/dist/preset.mjs +1165 -95
- package/dist/styles.cjs +2 -2
- package/dist/styles.css +87 -1
- package/dist/styles.d.cts +2 -0
- package/dist/styles.d.ts +2 -0
- package/dist/styles.mjs +1 -1
- package/dist/theme/index.cjs +2634 -2
- package/dist/theme/index.d.cts +453 -0
- package/dist/theme/index.d.ts +453 -8
- package/dist/theme/index.mjs +1601 -576
- package/dist/tokens/index.cjs +6203 -5
- package/dist/tokens/index.d.cts +2 -0
- package/dist/tokens/index.d.ts +2 -9
- package/dist/tokens/index.mjs +2601 -155
- package/package.json +10 -9
- package/dist/animation/index.d.ts +0 -8
- package/dist/animation/presets.d.ts +0 -301
- package/dist/animation/tas.d.ts +0 -24
- package/dist/animation/types.d.ts +0 -67
- package/dist/animation/useInView.d.ts +0 -36
- package/dist/animation/utils.d.ts +0 -6
- package/dist/brand-C5R2semX.js +0 -45
- package/dist/brand-DQb18Frh.cjs +0 -2
- package/dist/components/SectionBuilder.d.ts +0 -36
- package/dist/components/SectionBuilder.presets.d.ts +0 -228
- package/dist/components/SectionBuilder.types.d.ts +0 -326
- package/dist/components/admin/Dashboard.d.ts +0 -8
- package/dist/components/admin/UserManagement.d.ts +0 -8
- package/dist/components/auth/LoginForm.d.ts +0 -11
- package/dist/components/auth/ProfileCard.d.ts +0 -9
- package/dist/components/auth/RegisterForm.d.ts +0 -13
- package/dist/components/cards/ArtistCard/ArtistCard.d.ts +0 -22
- package/dist/components/cards/ArtistCard/ArtistCard.types.d.ts +0 -46
- package/dist/components/cards/ArtistCard/ArtistCard.variants.d.ts +0 -83
- package/dist/components/cards/ArtistCard/index.d.ts +0 -8
- package/dist/components/cards/CardBase/CardBase.d.ts +0 -45
- package/dist/components/cards/CardBase/CardBase.types.d.ts +0 -70
- package/dist/components/cards/CardBase/CardBase.variants.d.ts +0 -38
- package/dist/components/cards/CardBase/index.d.ts +0 -8
- package/dist/components/cards/CategoryCard/CategoryCard.d.ts +0 -18
- package/dist/components/cards/CategoryCard/CategoryCard.types.d.ts +0 -38
- package/dist/components/cards/CategoryCard/CategoryCard.variants.d.ts +0 -21
- package/dist/components/cards/CategoryCard/index.d.ts +0 -7
- package/dist/components/cards/EventCard/EventCard.d.ts +0 -19
- package/dist/components/cards/EventCard/EventCard.types.d.ts +0 -47
- package/dist/components/cards/EventCard/EventCard.variants.d.ts +0 -70
- package/dist/components/cards/EventCard/index.d.ts +0 -7
- package/dist/components/cards/PromoCard/PromoCard.d.ts +0 -20
- package/dist/components/cards/PromoCard/PromoCard.types.d.ts +0 -42
- package/dist/components/cards/PromoCard/PromoCard.variants.d.ts +0 -35
- package/dist/components/cards/PromoCard/index.d.ts +0 -7
- package/dist/components/cards/TicketCard/TicketCard.d.ts +0 -19
- package/dist/components/cards/TicketCard/TicketCard.types.d.ts +0 -55
- package/dist/components/cards/TicketCard/TicketCard.variants.d.ts +0 -71
- package/dist/components/cards/TicketCard/index.d.ts +0 -7
- package/dist/components/cards/VenueCard/VenueCard.d.ts +0 -21
- package/dist/components/cards/VenueCard/VenueCard.types.d.ts +0 -46
- package/dist/components/cards/VenueCard/VenueCard.variants.d.ts +0 -60
- package/dist/components/cards/VenueCard/index.d.ts +0 -8
- package/dist/components/cards/index.d.ts +0 -19
- package/dist/components/checkbox/Checkbox.d.ts +0 -22
- package/dist/components/checkbox/Checkbox.types.d.ts +0 -68
- package/dist/components/checkbox/checkbox-variants.d.ts +0 -13
- package/dist/components/checkbox/index.d.ts +0 -3
- package/dist/components/containers/Card.d.ts +0 -75
- package/dist/components/containers/Section.d.ts +0 -31
- package/dist/components/containers/Surface.d.ts +0 -28
- package/dist/components/containers/index.d.ts +0 -9
- package/dist/components/controls/LanguageSelector.d.ts +0 -17
- package/dist/components/data/List.d.ts +0 -12
- package/dist/components/data/Table.d.ts +0 -14
- package/dist/components/data/Timeline.d.ts +0 -13
- package/dist/components/data/data-list/DataList.d.ts +0 -29
- package/dist/components/data/data-list/DataList.types.d.ts +0 -43
- package/dist/components/data/data-list/DataListItem.d.ts +0 -20
- package/dist/components/data/data-list/DataListLabel.d.ts +0 -19
- package/dist/components/data/data-list/DataListValue.d.ts +0 -18
- package/dist/components/data/data-list/index.d.ts +0 -10
- package/dist/components/data/empty-state/EmptyState.d.ts +0 -31
- package/dist/components/data/empty-state/EmptyState.types.d.ts +0 -51
- package/dist/components/data/empty-state/EmptyStateAction.d.ts +0 -17
- package/dist/components/data/empty-state/EmptyStateDescription.d.ts +0 -17
- package/dist/components/data/empty-state/EmptyStateIcon.d.ts +0 -22
- package/dist/components/data/empty-state/EmptyStateTitle.d.ts +0 -17
- package/dist/components/data/empty-state/index.d.ts +0 -10
- package/dist/components/data/index.d.ts +0 -9
- package/dist/components/data/skeleton/Skeleton.d.ts +0 -24
- package/dist/components/data/skeleton/Skeleton.types.d.ts +0 -12
- package/dist/components/data/skeleton/index.d.ts +0 -6
- package/dist/components/data/table/Table.d.ts +0 -33
- package/dist/components/data/table/Table.types.d.ts +0 -264
- package/dist/components/data/table/TableBody.d.ts +0 -13
- package/dist/components/data/table/TableCell.d.ts +0 -13
- package/dist/components/data/table/TableEmpty.d.ts +0 -13
- package/dist/components/data/table/TableExpandableContent.d.ts +0 -14
- package/dist/components/data/table/TableHead.d.ts +0 -13
- package/dist/components/data/table/TableHeader.d.ts +0 -13
- package/dist/components/data/table/TableLoadingState.d.ts +0 -13
- package/dist/components/data/table/TableRow.d.ts +0 -13
- package/dist/components/data/table/TableSortIcon.d.ts +0 -14
- package/dist/components/data/table/index.d.ts +0 -17
- package/dist/components/drawer/Drawer.d.ts +0 -41
- package/dist/components/drawer/Drawer.types.d.ts +0 -75
- package/dist/components/drawer/drawer-variants.d.ts +0 -17
- package/dist/components/drawer/index.d.ts +0 -8
- package/dist/components/dropdown/Dropdown.d.ts +0 -38
- package/dist/components/dropdown/Dropdown.types.d.ts +0 -82
- package/dist/components/dropdown/dropdown-variants.d.ts +0 -33
- package/dist/components/feedback/ConsentBanner.d.ts +0 -8
- package/dist/components/feedback/Progress.d.ts +0 -8
- package/dist/components/feedback/Skeleton.d.ts +0 -6
- package/dist/components/filters/DateRangePicker.d.ts +0 -21
- package/dist/components/filters/FilterBar.d.ts +0 -55
- package/dist/components/filters/FilterSelect.d.ts +0 -23
- package/dist/components/filters/PriceRangeSlider.d.ts +0 -27
- package/dist/components/filters/SearchFilters.d.ts +0 -32
- package/dist/components/filters/SearchInput.d.ts +0 -16
- package/dist/components/filters/types.d.ts +0 -48
- package/dist/components/icon/Icon.d.ts +0 -32
- package/dist/components/icon/Icon.types.d.ts +0 -7
- package/dist/components/icon/index.d.ts +0 -4
- package/dist/components/icons/TrendingIcon.d.ts +0 -6
- package/dist/components/image/Image.d.ts +0 -48
- package/dist/components/input/Input.d.ts +0 -20
- package/dist/components/input/Input.types.d.ts +0 -38
- package/dist/components/input/index.d.ts +0 -3
- package/dist/components/input/input-variants.d.ts +0 -14
- package/dist/components/input/legacy/input.d.ts +0 -11
- package/dist/components/layout/Box.d.ts +0 -111
- package/dist/components/layout/Column.d.ts +0 -6
- package/dist/components/layout/Container.d.ts +0 -31
- package/dist/components/layout/Flex.d.ts +0 -50
- package/dist/components/layout/Footer.d.ts +0 -9
- package/dist/components/layout/Grid.d.ts +0 -60
- package/dist/components/layout/ModeHero.d.ts +0 -10
- package/dist/components/layout/Navbar.d.ts +0 -9
- package/dist/components/layout/Row.d.ts +0 -28
- package/dist/components/layout/Section.d.ts +0 -10
- package/dist/components/layout/Stack.d.ts +0 -38
- package/dist/components/layout/Surface.d.ts +0 -21
- package/dist/components/layout/index.d.ts +0 -22
- package/dist/components/layout/layout.types.d.ts +0 -107
- package/dist/components/menus/DropdownMenu.d.ts +0 -27
- package/dist/components/menus/NavigationMenu.d.ts +0 -12
- package/dist/components/menus/Tabs.d.ts +0 -7
- package/dist/components/menus/context-menu/ContextMenuContent.d.ts +0 -22
- package/dist/components/menus/context-menu/ContextMenuGroup.d.ts +0 -14
- package/dist/components/menus/context-menu/ContextMenuItem.d.ts +0 -14
- package/dist/components/menus/context-menu/ContextMenuLabel.d.ts +0 -14
- package/dist/components/menus/context-menu/ContextMenuRoot.d.ts +0 -47
- package/dist/components/menus/context-menu/ContextMenuSeparator.d.ts +0 -14
- package/dist/components/menus/context-menu/ContextMenuTrigger.d.ts +0 -16
- package/dist/components/menus/context-menu/index.d.ts +0 -12
- package/dist/components/menus/dropdown/DropdownMenuCheckItem.d.ts +0 -18
- package/dist/components/menus/dropdown/DropdownMenuContent.d.ts +0 -15
- package/dist/components/menus/dropdown/DropdownMenuGroup.d.ts +0 -12
- package/dist/components/menus/dropdown/DropdownMenuItem.d.ts +0 -30
- package/dist/components/menus/dropdown/DropdownMenuLabel.d.ts +0 -17
- package/dist/components/menus/dropdown/DropdownMenuRadioGroup.d.ts +0 -24
- package/dist/components/menus/dropdown/DropdownMenuRadioItem.d.ts +0 -18
- package/dist/components/menus/dropdown/DropdownMenuRoot.d.ts +0 -33
- package/dist/components/menus/dropdown/DropdownMenuSeparator.d.ts +0 -13
- package/dist/components/menus/dropdown/DropdownMenuSub.d.ts +0 -10
- package/dist/components/menus/dropdown/DropdownMenuSubContent.d.ts +0 -13
- package/dist/components/menus/dropdown/DropdownMenuSubTrigger.d.ts +0 -13
- package/dist/components/menus/dropdown/DropdownMenuTrigger.d.ts +0 -14
- package/dist/components/menus/dropdown/index.d.ts +0 -18
- package/dist/components/menus/hover-card/HoverCardContent.d.ts +0 -14
- package/dist/components/menus/hover-card/HoverCardRoot.d.ts +0 -20
- package/dist/components/menus/hover-card/HoverCardTrigger.d.ts +0 -13
- package/dist/components/menus/hover-card/index.d.ts +0 -8
- package/dist/components/menus/index.d.ts +0 -9
- package/dist/components/menus/popover/PopoverArrow.d.ts +0 -17
- package/dist/components/menus/popover/PopoverContent.d.ts +0 -24
- package/dist/components/menus/popover/PopoverRoot.d.ts +0 -43
- package/dist/components/menus/popover/PopoverTrigger.d.ts +0 -17
- package/dist/components/menus/popover/index.d.ts +0 -9
- package/dist/components/modal/Modal.d.ts +0 -70
- package/dist/components/modal/modal-variants.d.ts +0 -26
- package/dist/components/modals/ConfirmDialog.d.ts +0 -27
- package/dist/components/modals/CustomDialog.d.ts +0 -10
- package/dist/components/modals/Modal.d.ts +0 -19
- package/dist/components/modals/ModalProvider.d.ts +0 -16
- package/dist/components/modals/SimpleModal.d.ts +0 -11
- package/dist/components/navigation/Breadcrumbs.d.ts +0 -12
- package/dist/components/navigation/Pagination.d.ts +0 -10
- package/dist/components/navigation/breadcrumbs/Breadcrumbs.d.ts +0 -52
- package/dist/components/navigation/breadcrumbs/index.d.ts +0 -5
- package/dist/components/navigation/index.d.ts +0 -10
- package/dist/components/navigation/pagination/Pagination.d.ts +0 -60
- package/dist/components/navigation/pagination/index.d.ts +0 -5
- package/dist/components/navigation/segmented-control/SegmentedControl.d.ts +0 -43
- package/dist/components/navigation/segmented-control/index.d.ts +0 -5
- package/dist/components/navigation/stepper/Stepper.d.ts +0 -129
- package/dist/components/navigation/stepper/index.d.ts +0 -5
- package/dist/components/navigation/tabs/Tabs.d.ts +0 -73
- package/dist/components/navigation/tabs/index.d.ts +0 -5
- package/dist/components/notifications/NotificationCenter.DismissAll.d.ts +0 -21
- package/dist/components/notifications/NotificationCenter.GroupHeader.d.ts +0 -23
- package/dist/components/notifications/NotificationCenter.Item.d.ts +0 -24
- package/dist/components/notifications/NotificationCenter.List.d.ts +0 -22
- package/dist/components/notifications/NotificationCenter.Panel.d.ts +0 -32
- package/dist/components/notifications/NotificationCenter.Provider.d.ts +0 -31
- package/dist/components/notifications/NotificationCenter.Trigger.d.ts +0 -15
- package/dist/components/notifications/NotificationCenter.d.ts +0 -27
- package/dist/components/notifications/NotificationCenter.types.d.ts +0 -89
- package/dist/components/notifications/index.d.ts +0 -23
- package/dist/components/notifications/useNotificationCenter.d.ts +0 -47
- package/dist/components/overlays/Backdrop.d.ts +0 -24
- package/dist/components/overlays/Dialog.d.ts +0 -66
- package/dist/components/overlays/Modal.d.ts +0 -60
- package/dist/components/overlays/OverlayPortal.d.ts +0 -22
- package/dist/components/overlays/Popover.d.ts +0 -30
- package/dist/components/overlays/Portal.d.ts +0 -29
- package/dist/components/overlays/Toast.d.ts +0 -36
- package/dist/components/overlays/ToastProvider.d.ts +0 -58
- package/dist/components/overlays/ToastViewport.d.ts +0 -27
- package/dist/components/overlays/Tooltip.d.ts +0 -28
- package/dist/components/overlays/index.d.ts +0 -13
- package/dist/components/overlays/utils/FocusLock.d.ts +0 -30
- package/dist/components/overlays/utils/ScrollLock.d.ts +0 -11
- package/dist/components/overlays/utils/positioning.d.ts +0 -68
- package/dist/components/primitives/Badge.d.ts +0 -9
- package/dist/components/primitives/Button.d.ts +0 -1
- package/dist/components/primitives/Card.d.ts +0 -1
- package/dist/components/primitives/Divider.d.ts +0 -7
- package/dist/components/primitives/Input.d.ts +0 -4
- package/dist/components/primitives/Label.d.ts +0 -1
- package/dist/components/primitives/Link.d.ts +0 -13
- package/dist/components/primitives/ThemeSwitch.d.ts +0 -9
- package/dist/components/radio/Radio.d.ts +0 -23
- package/dist/components/radio/Radio.types.d.ts +0 -63
- package/dist/components/radio/RadioGroup.d.ts +0 -20
- package/dist/components/radio/RadioGroup.types.d.ts +0 -61
- package/dist/components/radio/index.d.ts +0 -5
- package/dist/components/radio/radio-variants.d.ts +0 -13
- package/dist/components/search/SearchBar.d.ts +0 -10
- package/dist/components/sections/ArticlesSection.d.ts +0 -25
- package/dist/components/sections/CTASection.d.ts +0 -37
- package/dist/components/sections/FeatureSection.d.ts +0 -33
- package/dist/components/sections/HeroSection.d.ts +0 -27
- package/dist/components/sections/TrendingSection.d.ts +0 -28
- package/dist/components/select/Select.d.ts +0 -38
- package/dist/components/select/Select.types.d.ts +0 -107
- package/dist/components/select/index.d.ts +0 -5
- package/dist/components/select/legacy/select.d.ts +0 -11
- package/dist/components/select/select-variants.d.ts +0 -32
- package/dist/components/skeletons/EventCardSkeleton.d.ts +0 -6
- package/dist/components/skeletons/VenueCardSkeleton.d.ts +0 -6
- package/dist/components/switch/Switch.d.ts +0 -24
- package/dist/components/switch/Switch.types.d.ts +0 -53
- package/dist/components/switch/index.d.ts +0 -3
- package/dist/components/switch/switch-variants.d.ts +0 -34
- package/dist/components/textarea/Textarea.d.ts +0 -21
- package/dist/components/textarea/Textarea.types.d.ts +0 -40
- package/dist/components/textarea/index.d.ts +0 -3
- package/dist/components/textarea/legacy/textarea.d.ts +0 -11
- package/dist/components/textarea/textarea-variants.d.ts +0 -14
- package/dist/components/toasts/Toast.d.ts +0 -12
- package/dist/components/toasts/ToastProvider.d.ts +0 -26
- package/dist/components/ui/alert.d.ts +0 -9
- package/dist/components/ui/body.d.ts +0 -12
- package/dist/components/ui/button.d.ts +0 -13
- package/dist/components/ui/caption.d.ts +0 -11
- package/dist/components/ui/card.d.ts +0 -8
- package/dist/components/ui/code.d.ts +0 -11
- package/dist/components/ui/dialog.d.ts +0 -19
- package/dist/components/ui/display.d.ts +0 -12
- package/dist/components/ui/field.d.ts +0 -45
- package/dist/components/ui/heading.d.ts +0 -12
- package/dist/components/ui/label.d.ts +0 -12
- package/dist/components/ui/lead.d.ts +0 -11
- package/dist/components/ui/text.d.ts +0 -18
- package/dist/components/ui/toast.d.ts +0 -15
- package/dist/components/ui/toaster.d.ts +0 -1
- package/dist/components/ui/tooltip.d.ts +0 -7
- package/dist/dark-Cvoy1uFT.js +0 -30
- package/dist/dark-OOhiqt1q.cjs +0 -2
- package/dist/default-BKgH1D9-.js +0 -8
- package/dist/default-Ddg7Haf2.cjs +0 -2
- package/dist/hooks/use-toast.d.ts +0 -44
- package/dist/hooks/useDebounce.d.ts +0 -19
- package/dist/hooks/useModal.d.ts +0 -19
- package/dist/hooks/useToast.d.ts +0 -26
- package/dist/icons/IconArrowRight.d.ts +0 -6
- package/dist/icons/IconCalendar.d.ts +0 -6
- package/dist/icons/IconCheck.d.ts +0 -6
- package/dist/icons/IconChevronDown.d.ts +0 -6
- package/dist/icons/IconChevronRight.d.ts +0 -6
- package/dist/icons/IconClose.d.ts +0 -6
- package/dist/icons/IconError.d.ts +0 -6
- package/dist/icons/IconInfo.d.ts +0 -6
- package/dist/icons/IconLocation.d.ts +0 -6
- package/dist/icons/IconMenu.d.ts +0 -6
- package/dist/icons/IconSearch.d.ts +0 -6
- package/dist/icons/IconSuccess.d.ts +0 -6
- package/dist/icons/IconWarning.d.ts +0 -6
- package/dist/icons/icon.types.d.ts +0 -25
- package/dist/icons/index.d.ts +0 -34
- package/dist/lib/a11y.d.ts +0 -15
- package/dist/lib/responsive-props.d.ts +0 -63
- package/dist/lib/utils.d.ts +0 -8
- package/dist/motion-CzQhSEqk.js +0 -738
- package/dist/motion-DJx1TbXJ.cjs +0 -2
- package/dist/theme/ThemeProvider.d.ts +0 -55
- package/dist/theme/applyMode.d.ts +0 -42
- package/dist/theme/colors.d.ts +0 -6
- package/dist/theme/loader.d.ts +0 -63
- package/dist/theme/motion/gestures.d.ts +0 -76
- package/dist/theme/motion/useReducedMotion.d.ts +0 -11
- package/dist/theme/motion.d.ts +0 -127
- package/dist/theme/registry.d.ts +0 -70
- package/dist/theme/schema.d.ts +0 -124
- package/dist/theme/spacing.d.ts +0 -34
- package/dist/theme/typography.d.ts +0 -45
- package/dist/themes/brand.d.ts +0 -6
- package/dist/themes/brand_engine.d.ts +0 -108
- package/dist/themes/dark.d.ts +0 -6
- package/dist/themes/default.d.ts +0 -6
- package/dist/themes/index.d.ts +0 -24
- package/dist/themes/minimal.d.ts +0 -6
- package/dist/themes/neon.d.ts +0 -6
- package/dist/themes/types.d.ts +0 -278
- package/dist/tokens/components/alert.d.ts +0 -74
- package/dist/tokens/components/button.d.ts +0 -130
- package/dist/tokens/components/card.d.ts +0 -91
- package/dist/tokens/components/checkbox.d.ts +0 -161
- package/dist/tokens/components/data.d.ts +0 -227
- package/dist/tokens/components/domain.d.ts +0 -379
- package/dist/tokens/components/dropdown.d.ts +0 -146
- package/dist/tokens/components/icon.d.ts +0 -57
- package/dist/tokens/components/index.d.ts +0 -31
- package/dist/tokens/components/input.d.ts +0 -284
- package/dist/tokens/components/menu.d.ts +0 -114
- package/dist/tokens/components/motion.d.ts +0 -103
- package/dist/tokens/components/navigation.d.ts +0 -181
- package/dist/tokens/components/notifications.d.ts +0 -159
- package/dist/tokens/components/overlay.d.ts +0 -227
- package/dist/tokens/components/popover.d.ts +0 -84
- package/dist/tokens/components/radio.d.ts +0 -149
- package/dist/tokens/components/section.d.ts +0 -41
- package/dist/tokens/components/surface.d.ts +0 -94
- package/dist/tokens/components/switch.d.ts +0 -208
- package/dist/tokens/components/text.d.ts +0 -68
- package/dist/tokens/components/toast.d.ts +0 -146
- package/dist/tokens/components/tooltip.d.ts +0 -52
- package/dist/tokens/css-variables.d.ts +0 -251
- package/dist/tokens/motion/v2.d.ts +0 -342
- package/dist/tokens/motion.d.ts +0 -485
- package/dist/tokens/opacity.d.ts +0 -22
- package/dist/tokens/radius.d.ts +0 -161
- package/dist/tokens/shadows.d.ts +0 -230
- package/dist/tokens/spacing.d.ts +0 -238
- package/dist/tokens/theme.d.ts +0 -119
- package/dist/tokens/typography.d.ts +0 -460
- package/dist/typography-C-Nb4y0o.cjs +0 -2
- package/dist/typography-DHym9KAP.js +0 -1196
package/dist/theme/index.cjs
CHANGED
|
@@ -1,2 +1,2634 @@
|
|
|
1
|
-
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../motion-DJx1TbXJ.cjs"),ge=require("react/jsx-runtime"),p=require("react"),fe={id:"minimal",name:"Minimal",description:"Clean, minimal brand theme with muted colors, light typography, and compact spacing",namespace:"minimal",version:"1.0.0",author:"Tenerife UI",themes:[{id:"minimal-day",name:"Minimal Day",description:"Light minimal theme with grayscale colors and subtle accents",mode:"day",overrides:{name:"minimal-day",description:"Light minimal theme for day mode",primaryColors:{400:"0 0% 60%",500:"0 0% 50%",600:"0 0% 40%",700:"0 0% 30%"},accentColors:{400:"210 20% 70%",500:"210 20% 60%",600:"210 20% 50%",700:"210 20% 40%"},secondaryColors:{400:"0 0% 70%",500:"0 0% 65%",600:"0 0% 55%",700:"0 0% 45%"},baseColorsDay:{primary:"0 0% 50%",primaryForeground:"0 0% 100%",secondary:"0 0% 96%",secondaryForeground:"0 0% 20%",accent:"210 20% 60%",accentForeground:"0 0% 100%"},semanticColorsDay:{success:"140 30% 45%",info:"210 30% 50%",warning:"40 30% 50%",error:"0 40% 55%"},typography:{fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},fontSize:{xs:["clamp(0.6875rem, 0.65rem + 0.125vw, 0.75rem)",{lineHeight:"1rem",letterSpacing:"0.05em"}],sm:["clamp(0.8125rem, 0.75rem + 0.25vw, 0.875rem)",{lineHeight:"1.25rem",letterSpacing:"0.025em"}],base:["clamp(0.9375rem, 0.875rem + 0.25vw, 1rem)",{lineHeight:"1.5rem",letterSpacing:"0em"}],lg:["clamp(1.0625rem, 0.95rem + 0.5vw, 1.125rem)",{lineHeight:"1.75rem",letterSpacing:"-0.025em"}],xl:["clamp(1.1875rem, 1rem + 0.75vw, 1.375rem)",{lineHeight:"1.75rem",letterSpacing:"-0.025em"}]}},spacing:{semanticSpacing:{xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"0.75rem",xl:"1rem","2xl":"1.5rem"}},shadows:{elevationShadows:{xs:"0 1px 1px 0 rgb(0 0 0 / 0.03)",sm:"0 1px 2px 0 rgb(0 0 0 / 0.05), 0 1px 1px -1px rgb(0 0 0 / 0.05)",md:"0 2px 4px -1px rgb(0 0 0 / 0.05), 0 1px 2px -2px rgb(0 0 0 / 0.05)",lg:"0 4px 8px -2px rgb(0 0 0 / 0.05), 0 2px 4px -3px rgb(0 0 0 / 0.05)",xl:"0 8px 12px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05)"},glowEffects:{"glow-primary":"0 0 8px 0 hsl(0 0% 50% / 0.2)","glow-primary-subtle":"0 0 4px 0 hsl(0 0% 50% / 0.15)","glow-primary-medium":"0 0 8px 0 hsl(0 0% 50% / 0.25)","glow-primary-strong":"0 0 12px 0 hsl(0 0% 50% / 0.3)"}},radius:{borderRadius:{xs:"0.0625rem",sm:"0.125rem",md:"0.1875rem",lg:"0.25rem",xl:"0.375rem","2xl":"0.5rem"},componentRadius:{button:{sm:"0.125rem",md:"0.1875rem",lg:"0.25rem"},card:{sm:"0.1875rem",md:"0.25rem",lg:"0.375rem",xl:"0.5rem"},input:{sm:"0.125rem",md:"0.1875rem",lg:"0.25rem"},badge:{sm:"0.0625rem",md:"0.125rem",lg:"0.1875rem"}}}}},{id:"minimal-night",name:"Minimal Night",description:"Dark minimal theme with muted grayscale colors",mode:"night",overrides:{name:"minimal-night",description:"Dark minimal theme for night mode",primaryColors:{400:"0 0% 65%",500:"0 0% 55%",600:"0 0% 45%",700:"0 0% 35%"},accentColors:{400:"210 20% 75%",500:"210 20% 65%",600:"210 20% 55%",700:"210 20% 45%"},secondaryColors:{400:"0 0% 75%",500:"0 0% 70%",600:"0 0% 60%",700:"0 0% 50%"},baseColorsNight:{background:"240 10% 8%",foreground:"0 0% 95%",card:"240 10% 10%",cardForeground:"0 0% 95%"},surfaceColorsNight:{base:"240 10% 8%",elevated1:"240 10% 10%",elevated2:"240 10% 12%",elevated3:"240 10% 14%"},semanticColorsNight:{success:"140 30% 50%",info:"210 30% 55%",warning:"40 30% 55%",error:"0 40% 60%"},typography:{fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},fontSize:{xs:["clamp(0.6875rem, 0.65rem + 0.125vw, 0.75rem)",{lineHeight:"1rem",letterSpacing:"0.05em"}],sm:["clamp(0.8125rem, 0.75rem + 0.25vw, 0.875rem)",{lineHeight:"1.25rem",letterSpacing:"0.025em"}],base:["clamp(0.9375rem, 0.875rem + 0.25vw, 1rem)",{lineHeight:"1.5rem",letterSpacing:"0em"}],lg:["clamp(1.0625rem, 0.95rem + 0.5vw, 1.125rem)",{lineHeight:"1.75rem",letterSpacing:"-0.025em"}],xl:["clamp(1.1875rem, 1rem + 0.75vw, 1.375rem)",{lineHeight:"1.75rem",letterSpacing:"-0.025em"}]}},spacing:{semanticSpacing:{xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"0.75rem",xl:"1rem","2xl":"1.5rem"}},shadows:{elevationShadows:{xs:"0 1px 2px 0 rgb(0 0 0 / 0.15)",sm:"0 1px 3px 0 rgb(0 0 0 / 0.2), 0 1px 2px -1px rgb(0 0 0 / 0.2)",md:"0 2px 5px -1px rgb(0 0 0 / 0.2), 0 1px 3px -2px rgb(0 0 0 / 0.2)",lg:"0 4px 10px -2px rgb(0 0 0 / 0.2), 0 2px 5px -3px rgb(0 0 0 / 0.2)",xl:"0 8px 15px -3px rgb(0 0 0 / 0.2), 0 4px 8px -4px rgb(0 0 0 / 0.2)"},glowEffects:{"glow-primary":"0 0 8px 0 hsl(0 0% 55% / 0.25)","glow-primary-subtle":"0 0 4px 0 hsl(0 0% 55% / 0.2)","glow-primary-medium":"0 0 8px 0 hsl(0 0% 55% / 0.3)","glow-primary-strong":"0 0 12px 0 hsl(0 0% 55% / 0.35)"}},radius:{borderRadius:{xs:"0.0625rem",sm:"0.125rem",md:"0.1875rem",lg:"0.25rem",xl:"0.375rem","2xl":"0.5rem"},componentRadius:{button:{sm:"0.125rem",md:"0.1875rem",lg:"0.25rem"},card:{sm:"0.1875rem",md:"0.25rem",lg:"0.375rem",xl:"0.5rem"},input:{sm:"0.125rem",md:"0.1875rem",lg:"0.25rem"},badge:{sm:"0.0625rem",md:"0.125rem",lg:"0.1875rem"}}}}}]},he={id:"neon",name:"Neon",description:"Vibrant brand theme with high-saturation neon colors, bold typography, and enhanced visual effects",namespace:"neon",version:"1.0.0",author:"Tenerife UI",themes:[{id:"neon-day",name:"Neon Day",description:"Bright neon theme for day mode with vibrant cyan, magenta, and yellow accents",mode:"day",overrides:{name:"neon-day",description:"Bright neon theme for day mode",primaryColors:{400:"180 100% 50%",500:"180 100% 45%",600:"180 95% 40%",700:"180 90% 35%"},accentColors:{400:"320 100% 60%",500:"320 100% 55%",600:"320 95% 50%",700:"320 90% 45%"},secondaryColors:{400:"60 100% 60%",500:"60 100% 55%",600:"60 95% 50%",700:"60 90% 45%"},baseColorsDay:{primary:"180 100% 45%",primaryForeground:"0 0% 100%",accent:"320 100% 55%",accentForeground:"0 0% 100%"},semanticColorsDay:{success:"145 80% 45%",info:"180 100% 45%",warning:"60 100% 55%",error:"0 100% 60%"},typography:{fontWeight:{normal:"500",medium:"600",semibold:"700",bold:"800"},fontSize:{xs:["clamp(0.875rem, 0.8rem + 0.25vw, 1rem)",{lineHeight:"1.25rem",letterSpacing:"0.025em"}],sm:["clamp(1rem, 0.95rem + 0.25vw, 1.125rem)",{lineHeight:"1.5rem",letterSpacing:"0em"}],base:["clamp(1.125rem, 1rem + 0.5vw, 1.25rem)",{lineHeight:"1.75rem",letterSpacing:"-0.025em"}],lg:["clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem)",{lineHeight:"1.75rem",letterSpacing:"-0.025em"}],xl:["clamp(1.5rem, 1.25rem + 1.25vw, 2rem)",{lineHeight:"2rem",letterSpacing:"-0.05em"}]}},spacing:{semanticSpacing:{xs:"0.5rem",sm:"1rem",md:"1.5rem",lg:"2rem",xl:"3rem","2xl":"4rem"}},shadows:{elevationShadows:{xs:"0 2px 4px 0 rgb(0 0 0 / 0.1)",sm:"0 2px 6px 0 rgb(0 0 0 / 0.15), 0 2px 4px -1px rgb(0 0 0 / 0.15)",md:"0 6px 10px -1px rgb(0 0 0 / 0.15), 0 4px 6px -2px rgb(0 0 0 / 0.15)",lg:"0 12px 20px -3px rgb(0 0 0 / 0.15), 0 6px 10px -4px rgb(0 0 0 / 0.15)",xl:"0 24px 32px -5px rgb(0 0 0 / 0.15), 0 10px 14px -6px rgb(0 0 0 / 0.15)"},glowEffects:{"glow-primary":"0 0 30px 0 hsl(180 100% 45% / 0.7), 0 0 60px 0 hsl(180 100% 45% / 0.4)","glow-primary-subtle":"0 0 12px 0 hsl(180 100% 45% / 0.5)","glow-primary-medium":"0 0 24px 0 hsl(180 100% 45% / 0.7)","glow-primary-strong":"0 0 36px 0 hsl(180 100% 45% / 0.8)","glow-accent":"0 0 30px 0 hsl(320 100% 55% / 0.7), 0 0 60px 0 hsl(320 100% 55% / 0.4)","glow-accent-subtle":"0 0 12px 0 hsl(320 100% 55% / 0.5)","glow-accent-medium":"0 0 24px 0 hsl(320 100% 55% / 0.7)","glow-accent-strong":"0 0 36px 0 hsl(320 100% 55% / 0.8)"}},radius:{borderRadius:{sm:"0.375rem",md:"0.5rem",lg:"0.75rem",xl:"1rem","2xl":"1.5rem","3xl":"2rem"},componentRadius:{button:{sm:"0.5rem",md:"0.75rem",lg:"1rem"},card:{sm:"0.75rem",md:"1rem",lg:"1.25rem",xl:"1.5rem"},input:{sm:"0.5rem",md:"0.75rem",lg:"1rem"},badge:{sm:"0.375rem",md:"0.5rem",lg:"0.75rem"}}}}},{id:"neon-night",name:"Neon Night",description:"Dark neon theme for night mode with glowing neon accents on dark backgrounds",mode:"night",overrides:{name:"neon-night",description:"Dark neon theme for night mode",primaryColors:{400:"180 100% 55%",500:"180 100% 50%",600:"180 95% 45%",700:"180 90% 40%"},accentColors:{400:"320 100% 65%",500:"320 100% 60%",600:"320 95% 55%",700:"320 90% 50%"},secondaryColors:{400:"60 100% 65%",500:"60 100% 60%",600:"60 95% 55%",700:"60 90% 50%"},baseColorsNight:{background:"240 10% 5%",foreground:"0 0% 98%",card:"240 10% 6%",cardForeground:"0 0% 98%"},surfaceColorsNight:{base:"240 10% 5%",elevated1:"240 10% 7%",elevated2:"240 10% 9%",elevated3:"240 10% 11%"},semanticColorsNight:{success:"145 75% 50%",info:"180 100% 50%",warning:"60 100% 60%",error:"0 100% 65%"},typography:{fontWeight:{normal:"500",medium:"600",semibold:"700",bold:"800"},fontSize:{xs:["clamp(0.875rem, 0.8rem + 0.25vw, 1rem)",{lineHeight:"1.25rem",letterSpacing:"0.025em"}],sm:["clamp(1rem, 0.95rem + 0.25vw, 1.125rem)",{lineHeight:"1.5rem",letterSpacing:"0em"}],base:["clamp(1.125rem, 1rem + 0.5vw, 1.25rem)",{lineHeight:"1.75rem",letterSpacing:"-0.025em"}],lg:["clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem)",{lineHeight:"1.75rem",letterSpacing:"-0.025em"}],xl:["clamp(1.5rem, 1.25rem + 1.25vw, 2rem)",{lineHeight:"2rem",letterSpacing:"-0.05em"}]}},spacing:{semanticSpacing:{xs:"0.5rem",sm:"1rem",md:"1.5rem",lg:"2rem",xl:"3rem","2xl":"4rem"}},shadows:{elevationShadows:{xs:"0 2px 4px 0 rgb(0 0 0 / 0.2)",sm:"0 2px 6px 0 rgb(0 0 0 / 0.25), 0 2px 4px -1px rgb(0 0 0 / 0.25)",md:"0 6px 10px -1px rgb(0 0 0 / 0.25), 0 4px 6px -2px rgb(0 0 0 / 0.25)",lg:"0 12px 20px -3px rgb(0 0 0 / 0.25), 0 6px 10px -4px rgb(0 0 0 / 0.25)",xl:"0 24px 32px -5px rgb(0 0 0 / 0.25), 0 10px 14px -6px rgb(0 0 0 / 0.25)"},glowEffects:{"glow-primary":"0 0 40px 0 hsl(180 100% 50% / 0.8), 0 0 80px 0 hsl(180 100% 50% / 0.5)","glow-primary-subtle":"0 0 16px 0 hsl(180 100% 50% / 0.6)","glow-primary-medium":"0 0 32px 0 hsl(180 100% 50% / 0.8)","glow-primary-strong":"0 0 48px 0 hsl(180 100% 50% / 0.9)","glow-accent":"0 0 40px 0 hsl(320 100% 60% / 0.8), 0 0 80px 0 hsl(320 100% 60% / 0.5)","glow-accent-subtle":"0 0 16px 0 hsl(320 100% 60% / 0.6)","glow-accent-medium":"0 0 32px 0 hsl(320 100% 60% / 0.8)","glow-accent-strong":"0 0 48px 0 hsl(320 100% 60% / 0.9)"}},radius:{borderRadius:{sm:"0.375rem",md:"0.5rem",lg:"0.75rem",xl:"1rem","2xl":"1.5rem","3xl":"2rem"},componentRadius:{button:{sm:"0.5rem",md:"0.75rem",lg:"1rem"},card:{sm:"0.75rem",md:"1rem",lg:"1.25rem",xl:"1.5rem"},input:{sm:"0.5rem",md:"0.75rem",lg:"1rem"},badge:{sm:"0.375rem",md:"0.5rem",lg:"0.75rem"}}}}}]},S=new Map;let N=null,q=null;const R=new Map;function re(r){const e=[],s=[];if(!r||typeof r!="object")return{valid:!1,errors:["Brand must be an object"],warnings:[]};const t=r,n=["id","name","namespace"];for(const o of n)(!(o in t)||!t[o])&&e.push(`Missing required field: ${o}`);if(t.id&&typeof t.id=="string"&&(/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(t.id)||e.push(`Invalid brand ID format: "${t.id}". Must be kebab-case (e.g., "neon-brand")`)),t.namespace&&typeof t.namespace=="string"&&(/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(t.namespace)||e.push(`Invalid namespace format: "${t.namespace}". Must be kebab-case (e.g., "neon")`)),t.themes)if(!Array.isArray(t.themes))e.push("Brand themes must be an array");else{const o=t.themes;o.length===0&&s.push("Brand has no themes defined"),o.forEach((m,i)=>{if(!m||typeof m!="object"){e.push(`Theme at index ${i} must be an object`);return}const a=m;(!a.id||typeof a.id!="string")&&e.push(`Theme at index ${i} is missing required field: id`),(!a.name||typeof a.name!="string")&&e.push(`Theme at index ${i} is missing required field: name`),(!a.mode||!["day","night"].includes(a.mode))&&e.push(`Theme at index ${i} must have mode set to "day" or "night"`),(!a.overrides||typeof a.overrides!="object")&&e.push(`Theme at index ${i} is missing required field: overrides`)})}else e.push("Brand must have at least one theme");if(t.version&&typeof t.version=="string"&&(/^\d+\.\d+\.\d+$/.test(t.version)||s.push(`Invalid version format: "${t.version}". Should be semver (e.g., "1.0.0")`)),t.themes&&Array.isArray(t.themes)){const o=t.themes.map(i=>i==null?void 0:i.id),m=new Set(o);o.length!==m.size&&e.push("Brand contains duplicate theme IDs")}return{valid:e.length===0,errors:e,warnings:s}}function K(r,e){const s=re(r);if(!s.valid)throw new Error(`Invalid brand "${r.id}": ${s.errors.join(", ")}`);s.warnings.length>0&&console.warn(`Brand "${r.id}" validation warnings:`,s.warnings.join(", "));const t=S.get(r.id);if(t&&t.brand.namespace===r.namespace)return;if(S.has(r.id))throw new Error(`Brand "${r.id}" is already registered`);const n=Array.from(S.values()).find(o=>o.brand.namespace===r.namespace);if(n)throw new Error(`Brand namespace "${r.namespace}" is already used by brand "${n.brand.id}"`);S.set(r.id,{brand:r,enabled:(e==null?void 0:e.enabled)!==!1,loader:e==null?void 0:e.loader})}async function te(r){if(R.has(r))return R.get(r);const e=S.get(r);if(!e)throw new Error(`Brand "${r}" not found in registry`);if(e.enabled===!1)throw new Error(`Brand "${r}" is disabled`);if(e.loader)try{const t=(await e.loader()).default,n=re(t);if(!n.valid)throw new Error(`Invalid loaded brand "${r}": ${n.errors.join(", ")}`);return R.set(r,t),t}catch(s){throw new Error(`Failed to load brand "${r}": ${s instanceof Error?s.message:String(s)}`)}return R.set(r,e.brand),e.brand}function oe(){return N}function O(r){N=r,q=(r==null?void 0:r.namespace)||null}function be(){N=null,q=null}function xe(r,e){return r.themes.find(s=>s.mode===e)}function ne(r,e){if(typeof document>"u")return;const s=xe(r,e);if(!s){console.warn(`Brand "${r.id}" has no theme for mode "${e}"`);return}const t=document.documentElement,{namespace:n}=r,{overrides:o}=s;o.primaryColors&&Object.entries(o.primaryColors).forEach(([i,a])=>{t.style.setProperty(`--brand-${n}-primary-${i}`,a)}),o.accentColors&&Object.entries(o.accentColors).forEach(([i,a])=>{t.style.setProperty(`--brand-${n}-accent-${i}`,a)}),o.secondaryColors&&Object.entries(o.secondaryColors).forEach(([i,a])=>{t.style.setProperty(`--brand-${n}-secondary-${i}`,a)});const m=e==="day"?o.baseColorsDay:o.baseColorsNight;if(m&&Object.entries(m).forEach(([i,a])=>{t.style.setProperty(`--brand-${n}-${i}`,a)}),o.typography&&(o.typography.fontFamily&&Object.entries(o.typography.fontFamily).forEach(([i,a])=>{t.style.setProperty(`--brand-${n}-font-${i}`,Array.isArray(a)?a.join(", "):a)}),o.typography.fontSize&&Object.entries(o.typography.fontSize).forEach(([i,a])=>{const c=typeof a=="string"?a:a[0];t.style.setProperty(`--brand-${n}-font-size-${i}`,c)}),o.typography.fontWeight&&Object.entries(o.typography.fontWeight).forEach(([i,a])=>{t.style.setProperty(`--brand-${n}-font-weight-${i}`,a)}),o.typography.lineHeight&&Object.entries(o.typography.lineHeight).forEach(([i,a])=>{t.style.setProperty(`--brand-${n}-line-height-${i}`,a)}),o.typography.letterSpacing&&Object.entries(o.typography.letterSpacing).forEach(([i,a])=>{t.style.setProperty(`--brand-${n}-letter-spacing-${i}`,a)})),o.spacing&&(o.spacing.semanticSpacing&&Object.entries(o.spacing.semanticSpacing).forEach(([i,a])=>{t.style.setProperty(`--brand-${n}-spacing-${i}`,a)}),o.spacing.layoutSpacing)){const i=o.spacing.layoutSpacing;i.section&&Object.entries(i.section).forEach(([a,c])=>{typeof c=="string"&&t.style.setProperty(`--brand-${n}-layout-section-${a}`,c)}),i.container&&Object.entries(i.container).forEach(([a,c])=>{typeof c=="string"&&t.style.setProperty(`--brand-${n}-layout-container-${a}`,c)}),i.grid&&Object.entries(i.grid).forEach(([a,c])=>{typeof c=="string"&&t.style.setProperty(`--brand-${n}-layout-grid-${a}`,c)}),i.stack&&Object.entries(i.stack).forEach(([a,c])=>{typeof c=="string"&&t.style.setProperty(`--brand-${n}-layout-stack-${a}`,c)}),i.component&&Object.entries(i.component).forEach(([a,c])=>{typeof c=="string"&&t.style.setProperty(`--brand-${n}-layout-component-${a}`,c)})}if(o.shadows&&(o.shadows.elevationShadows&&Object.entries(o.shadows.elevationShadows).forEach(([i,a])=>{t.style.setProperty(`--brand-${n}-shadow-${i}`,a)}),o.shadows.primaryColoredShadows&&Object.entries(o.shadows.primaryColoredShadows).forEach(([i,a])=>{t.style.setProperty(`--brand-${n}-shadow-primary-${i}`,a)}),o.shadows.accentColoredShadows&&Object.entries(o.shadows.accentColoredShadows).forEach(([i,a])=>{t.style.setProperty(`--brand-${n}-shadow-accent-${i}`,a)}),o.shadows.glowEffects&&Object.entries(o.shadows.glowEffects).forEach(([i,a])=>{t.style.setProperty(`--brand-${n}-glow-${i}`,a)}),o.shadows.focusRings&&Object.entries(o.shadows.focusRings).forEach(([i,a])=>{t.style.setProperty(`--brand-${n}-focus-ring-${i}`,a)})),o.radius&&(o.radius.borderRadius&&Object.entries(o.radius.borderRadius).forEach(([i,a])=>{t.style.setProperty(`--brand-${n}-radius-${i}`,a)}),o.radius.componentRadius)){const{componentRadius:i}=o.radius;i.button&&Object.entries(i.button).forEach(([a,c])=>{t.style.setProperty(`--brand-${n}-radius-button-${a}`,c)}),i.card&&Object.entries(i.card).forEach(([a,c])=>{t.style.setProperty(`--brand-${n}-radius-card-${a}`,c)}),i.input&&Object.entries(i.input).forEach(([a,c])=>{t.style.setProperty(`--brand-${n}-radius-input-${a}`,c)})}O(r),t.setAttribute("data-brand",r.id),t.setAttribute("data-brand-namespace",n)}function se(r){if(typeof document>"u")return;const e=document.documentElement,{style:s}=e,t=[];for(let n=0;n<s.length;n++){const o=s.item(n);o&&o.startsWith(`--brand-${r}-`)&&t.push(o)}t.forEach(n=>{s.removeProperty(n)}),e.removeAttribute("data-brand"),e.removeAttribute("data-brand-namespace"),q===r&&be()}const we={default:()=>Promise.resolve().then(()=>require("../default-Ddg7Haf2.cjs")).then(r=>r.defaultTheme),dark:()=>Promise.resolve().then(()=>require("../dark-OOhiqt1q.cjs")).then(r=>r.darkTheme),brand:()=>Promise.resolve().then(()=>require("../brand-DQb18Frh.cjs")).then(r=>r.brandTheme)};async function ve(r){const e=we[r];if(!e)throw new Error(`Theme "${r}" not found`);return await e()}const ae="data-mode",L="data-theme-name",ie="data-theme",ee="dark";function le(r="day",e="tm_mode",s=!0){if(typeof window>"u")return r;const t=document.documentElement,n=t.getAttribute(ae);if(n==="day"||n==="night")return n;const o=t.getAttribute(ie);if(o==="day"||o==="night")return o;try{const m=localStorage.getItem(e);if(m==="day"||m==="night")return m;const i=localStorage.getItem("theme");if(i==="dark")return"night";if(i==="light")return"day"}catch{}return s&&typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches?"night":"day":r}let B=null;async function ce(r){if(r==="default")return B=null,null;try{const e=await ve(r);return B=e,e}catch(e){return console.warn(`Failed to load theme "${r}":`,e),B=null,null}}function M(r,e){return e?{...r,...e}:r}function v(r,e){return e?{...r,...e}:r}function me(r){const e=B,s=M(f.primaryColors,e==null?void 0:e.primaryColors),t=M(f.accentColors,e==null?void 0:e.accentColors),n=M(f.secondaryColors,e==null?void 0:e.secondaryColors),o={day:v(f.baseColors.day,e==null?void 0:e.baseColorsDay),night:v(f.baseColors.night,e==null?void 0:e.baseColorsNight)},m={day:v(f.surfaceColors.day,e==null?void 0:e.surfaceColorsDay),night:v(f.surfaceColors.night,e==null?void 0:e.surfaceColorsNight)},i={day:v(f.semanticColors.day,e==null?void 0:e.semanticColorsDay),night:v(f.semanticColors.night,e==null?void 0:e.semanticColorsNight)},a={day:v(f.textColors.day,e==null?void 0:e.textColorsDay),night:v(f.textColors.night,e==null?void 0:e.textColorsNight)},c={day:f.chartColors.day,night:f.chartColors.night};return{primaryColors:s,accentColors:t,secondaryColors:n,baseColors:o,surfaceColors:m,semanticColors:i,textColors:a,chartColors:c}}function Pe(r){if(typeof document>"u")return;const e=document.documentElement,s=me(),{primaryColors:t,accentColors:n,secondaryColors:o,baseColors:m,surfaceColors:i,semanticColors:a,textColors:c,chartColors:x}=s,d=m[r];e.style.setProperty("--background",d.background),e.style.setProperty("--foreground",d.foreground),e.style.setProperty("--card",d.card),e.style.setProperty("--card-foreground",d.cardForeground),e.style.setProperty("--popover",d.popover),e.style.setProperty("--popover-foreground",d.popoverForeground),e.style.setProperty("--border",d.border),e.style.setProperty("--input",d.input),e.style.setProperty("--ring",d.ring);const b=i[r];e.style.setProperty("--surface-base",b.base),e.style.setProperty("--surface-elevated1",b.elevated1),e.style.setProperty("--surface-elevated2",b.elevated2),e.style.setProperty("--surface-elevated3",b.elevated3),e.style.setProperty("--surface-overlay",b.overlay),e.style.setProperty("--surface-glass",b.glass);const u=a[r];e.style.setProperty("--semantic-success",u.success),e.style.setProperty("--semantic-success-foreground",u.successForeground),e.style.setProperty("--semantic-error",u.error),e.style.setProperty("--semantic-error-foreground",u.errorForeground),e.style.setProperty("--semantic-warning",u.warning),e.style.setProperty("--semantic-warning-foreground",u.warningForeground),e.style.setProperty("--semantic-info",u.info),e.style.setProperty("--semantic-info-foreground",u.infoForeground);const w=c[r];e.style.setProperty("--text-primary",w.primary),e.style.setProperty("--text-secondary",w.secondary),e.style.setProperty("--text-tertiary",w.tertiary),e.style.setProperty("--text-muted",w.muted),e.style.setProperty("--text-inverse",w.inverse);const h=x[r];e.style.setProperty("--chart-1",h.chart1),e.style.setProperty("--chart-2",h.chart2),e.style.setProperty("--chart-3",h.chart3),e.style.setProperty("--chart-4",h.chart4),e.style.setProperty("--chart-5",h.chart5),e.style.setProperty("--primary-50",t[50]),e.style.setProperty("--primary-100",t[100]),e.style.setProperty("--primary-200",t[200]),e.style.setProperty("--primary-300",t[300]),e.style.setProperty("--primary-400",t[400]),e.style.setProperty("--primary-500",t[500]),e.style.setProperty("--primary-600",t[600]),e.style.setProperty("--primary-700",t[700]),e.style.setProperty("--primary-800",t[800]),e.style.setProperty("--primary-900",t[900]),e.style.setProperty("--primary-950",t[950]),e.style.setProperty("--accent-50",n[50]),e.style.setProperty("--accent-100",n[100]),e.style.setProperty("--accent-200",n[200]),e.style.setProperty("--accent-300",n[300]),e.style.setProperty("--accent-400",n[400]),e.style.setProperty("--accent-500",n[500]),e.style.setProperty("--accent-600",n[600]),e.style.setProperty("--accent-700",n[700]),e.style.setProperty("--accent-800",n[800]),e.style.setProperty("--accent-900",n[900]),e.style.setProperty("--accent-950",n[950]),e.style.setProperty("--secondary-50",o[50]),e.style.setProperty("--secondary-100",o[100]),e.style.setProperty("--secondary-200",o[200]),e.style.setProperty("--secondary-300",o[300]),e.style.setProperty("--secondary-400",o[400]),e.style.setProperty("--secondary-500",o[500]),e.style.setProperty("--secondary-600",o[600]),e.style.setProperty("--secondary-700",o[700]),e.style.setProperty("--secondary-800",o[800]),e.style.setProperty("--secondary-900",o[900]),e.style.setProperty("--secondary-950",o[950]),r==="day"?(e.style.setProperty("--tm-primary",o[500]),e.style.setProperty("--tm-primary-foreground","0 0% 100%"),e.style.setProperty("--tm-secondary","0 0% 95.7%"),e.style.setProperty("--tm-secondary-foreground","0 0% 6.7%"),e.style.setProperty("--tm-accent","0 0% 89.8%"),e.style.setProperty("--tm-accent-foreground","0 0% 6.7%")):(e.style.setProperty("--tm-primary",n[600]),e.style.setProperty("--tm-primary-foreground","0 0% 100%"),e.style.setProperty("--tm-secondary","240 10% 7%"),e.style.setProperty("--tm-secondary-foreground","0 0% 89.8%"),e.style.setProperty("--tm-accent","240 10% 10%"),e.style.setProperty("--tm-accent-foreground","0 0% 89.8%")),e.style.setProperty("--muted",d.card),e.style.setProperty("--muted-foreground",d.cardForeground),e.style.setProperty("--destructive",u.error),e.style.setProperty("--destructive-foreground",u.errorForeground),Object.entries(f.motionCSSVariables).forEach(([k,j])=>{e.style.setProperty(k,j)})}async function P(r,e="default",s=null){if(typeof document>"u")return;await ce(e);const t=oe();if(t&&(!s||t.id!==s)&&se(t.namespace),s)try{const c=await te(s);ne(c,r)}catch(c){console.warn(`Failed to apply brand "${s}":`,c)}const{documentElement:n,body:o}=document;n.setAttribute(ae,r),n.setAttribute(ie,r),n.setAttribute(L,e),r==="night"?n.classList.add(ee):n.classList.remove(ee),Pe(r);const m=me(),{background:i,foreground:a}=m.baseColors[r];o&&(o.dataset.mode=r,o.dataset.theme=e,s?o.dataset.brand=s:o.removeAttribute("data-brand"),o.style.backgroundColor=`hsl(${i})`,o.style.color=`hsl(${a})`)}async function Ce(r){if(typeof document<"u"){const e=document.documentElement,s=e.getAttribute(L)||"default",t=e.getAttribute("data-brand")||null;await P(r,s,t)}else await P(r,"default",null)}function F(r="default",e="tm_theme"){if(typeof window>"u")return r;const t=document.documentElement.getAttribute(L);if(t==="default"||t==="dark"||t==="brand")return t;try{const n=localStorage.getItem(e);if(n==="default"||n==="dark"||n==="brand")return n}catch{}return r}function I(r,e="tm_mode"){if(!(typeof window>"u"))try{localStorage.setItem(e,r),localStorage.setItem("theme",r==="night"?"dark":"light")}catch{}}function H(r,e="tm_theme"){if(!(typeof window>"u"))try{localStorage.setItem(e,r)}catch{}}function _(r=null,e="tm_brand"){if(typeof window>"u")return r;const t=document.documentElement.getAttribute("data-brand");if(t)return t;try{const n=localStorage.getItem(e);if(n)return n}catch{}return r}function z(r,e="tm_brand"){if(!(typeof window>"u"))try{r?localStorage.setItem(e,r):localStorage.removeItem(e)}catch{}}const E=new Map;function A(r){E.set(r.metadata.id,r)}function $e(r){var e;return(e=E.get(r))==null?void 0:e.metadata}function U(){return Array.from(E.values()).filter(r=>r.enabled!==!1).map(r=>r.metadata)}function Te(r){return U().filter(e=>e.category===r)}function $(r){return E.has(r)}async function de(r){const e=E.get(r);if(!e)throw new Error(`Theme "${r}" not found in registry`);if(e.enabled===!1)throw new Error(`Theme "${r}" is disabled`);try{return(await e.loader()).default}catch(s){throw new Error(`Failed to load theme "${r}": ${s instanceof Error?s.message:String(s)}`)}}function pe(){A({metadata:{id:"default",name:"Default",description:"Default Tenerife UI theme with standard color palette",category:"default",version:"1.0.0"},loader:async()=>({default:{...(await Promise.resolve().then(()=>require("../default-Ddg7Haf2.cjs"))).defaultTheme,id:"default",name:"Default"}}),enabled:!0}),A({metadata:{id:"dark",name:"Dark",description:"Enhanced dark theme with deeper surfaces and higher contrast",category:"default",version:"1.0.0"},loader:async()=>({default:{...(await Promise.resolve().then(()=>require("../dark-OOhiqt1q.cjs"))).darkTheme,id:"dark",name:"Dark"}}),enabled:!0}),A({metadata:{id:"brand",name:"Brand",description:"Brand-specific theme with custom color palette",category:"brand",version:"1.0.0"},loader:async()=>({default:{...(await Promise.resolve().then(()=>require("../brand-DQb18Frh.cjs"))).brandTheme,id:"brand",name:"Brand"}}),enabled:!0})}pe();const Ee=["id","name"];function W(r){const e=[],s=[];if(!r||typeof r!="object")return{valid:!1,errors:["Theme must be an object"],warnings:[]};const t=r;for(const o of Ee)(!(o in t)||!t[o])&&e.push(`Missing required field: ${o}`);if(t.id&&typeof t.id=="string"&&(/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(t.id)||e.push(`Invalid theme ID format: "${t.id}". Must be kebab-case (e.g., "ocean-blue")`)),t.name&&typeof t.name!="string"&&e.push("Theme name must be a string"),t.category){const o=["default","brand","seasonal","custom"];o.includes(t.category)||e.push(`Invalid category: "${t.category}". Must be one of: ${o.join(", ")}`)}const n=["primaryColors","accentColors","secondaryColors"];for(const o of n)if(t[o]){const m=t[o],i=["50","100","200","300","400","500","600","700","800","900","950"];for(const a of Object.keys(m))i.includes(a)||s.push(`Invalid color scale key in ${o}: ${a}. Valid keys: ${i.join(", ")}`),typeof m[a]!="string"&&e.push(`Color value in ${o}.${a} must be a string (HSL format)`)}return t.version&&typeof t.version=="string"&&(/^\d+\.\d+\.\d+$/.test(t.version)||s.push(`Invalid version format: "${t.version}". Should be semver (e.g., "1.0.0")`)),{valid:e.length===0,errors:e,warnings:s}}function Se(r){return W(r).valid}function ke(r,e){return{id:r,name:e,description:`Custom theme: ${e}`,category:"custom",version:"1.0.0"}}const je={fallbackThemeId:"default",validate:!0,throwOnError:!1};async function T(r,e={}){const s={...je,...e},t=[];if(!$(r)){if(s.throwOnError)throw new Error(`Theme "${r}" not found`);if(s.fallbackThemeId&&$(s.fallbackThemeId))return t.push(`Theme "${r}" not found, using fallback "${s.fallbackThemeId}"`),T(s.fallbackThemeId,{...s,throwOnError:!1});throw new Error(`Theme "${r}" not found and no fallback available`)}try{const n=await de(r);if(s.validate){const o=W(n);if(!o.valid){if(s.throwOnError)throw new Error(`Theme "${r}" validation failed: ${o.errors.join(", ")}`);if(s.fallbackThemeId&&$(s.fallbackThemeId))return t.push(`Theme "${r}" validation failed: ${o.errors.join(", ")}. Using fallback "${s.fallbackThemeId}"`),T(s.fallbackThemeId,{...s,throwOnError:!1});throw new Error(`Theme "${r}" validation failed: ${o.errors.join(", ")}`)}t.push(...o.warnings)}return{theme:n,usedFallback:!1,warnings:t}}catch(n){if(s.throwOnError)throw n;if(s.fallbackThemeId&&$(s.fallbackThemeId)&&s.fallbackThemeId!==r)return t.push(`Failed to load theme "${r}": ${n instanceof Error?n.message:String(n)}. Using fallback "${s.fallbackThemeId}"`),T(s.fallbackThemeId,{...s,throwOnError:!1});throw n}}async function Re(r){const e=r.map(s=>T(s,{validate:!1,throwOnError:!1}).catch(()=>{}));await Promise.all(e)}function Be(){return U().map(r=>r.id)}async function Ae(r){if(!$(r))return!1;try{return await T(r,{validate:!1,throwOnError:!0}),!0}catch{return!1}}const De={none:"0",xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"2.5rem","3xl":"3rem","4xl":"4rem","5xl":"5rem"},Me={none:"0px",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},Oe={none:"none",sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",base:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)"},ue=p.createContext(void 0);function Fe(r){if(r!==void 0)return r;if(typeof window>"u")return!1;try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function Ie({children:r,defaultMode:e="day",defaultTheme:s="default",defaultBrand:t=null,storageKey:n="tm_mode",themeStorageKey:o="tm_theme",brandStorageKey:m="tm_brand",attribute:i="data-mode",enableSystem:a=!0,reduceMotion:c,enableAnimations:x=!0}){p.useEffect(()=>{try{K(he)}catch(l){console.warn("Failed to register neon brand:",l)}try{K(fe)}catch(l){console.warn("Failed to register minimal brand:",l)}},[]);const[d,b]=p.useState(()=>{if(typeof window>"u")return e;const y=document.documentElement.getAttribute(i);if(y==="day"||y==="night")return y;try{const g=localStorage.getItem(n);if(g==="day"||g==="night")return g}catch{}return a&&typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches?"night":"day":e}),[u,w]=p.useState(()=>typeof window>"u"?s:F(s,o)),[h,k]=p.useState(()=>typeof window>"u"?t:_(t,m)),[j,D]=p.useState(()=>Fe(c)),[V,Q]=p.useState(()=>x),C=p.useCallback(l=>{b(l),P(l,u,h),I(l,n)},[u,h,n]),G=p.useCallback(async l=>{w(l),await P(d,l,h),H(l,o)},[d,h,o]),J=p.useCallback(async l=>{const y=oe();if(y&&se(y.namespace),k(l),z(l,m),l)try{const g=await te(l);ne(g,d)}catch(g){console.error(`Failed to load brand "${l}":`,g),O(null)}else O(null);await P(d,u,l)},[d,u,m]),X=p.useCallback(()=>{C(d==="night"?"day":"night")},[d,C]),Y=p.useCallback(l=>{D(l);try{localStorage.setItem("tm_reduce_motion",l?"true":"false")}catch{}},[]),Z=p.useCallback(l=>{Q(l);try{localStorage.setItem("tm_enable_animations",l?"true":"false")}catch{}},[]);p.useEffect(()=>{if(c!==void 0)return;const l=window.matchMedia("(prefers-reduced-motion: reduce)"),y=g=>{D(g.matches)};return l.addEventListener("change",y),()=>l.removeEventListener("change",y)},[c]),p.useEffect(()=>{if(c===void 0)try{const l=localStorage.getItem("tm_reduce_motion");(l==="true"||l==="false")&&D(l==="true")}catch{}if(x===void 0)try{const l=localStorage.getItem("tm_enable_animations");(l==="true"||l==="false")&&Q(l==="true")}catch{}},[c,x]),p.useEffect(()=>{const l=le(e,n,a),y=F(s,o),g=_(t,m);b(l),w(y),k(g),P(l,y,g),I(l,n),H(y,o),z(g,m)},[e,s,t,n,o,m,a]),p.useEffect(()=>{if(!a)return;const l=window.matchMedia("(prefers-color-scheme: dark)"),y=g=>{try{localStorage.getItem(n)||C(g.matches?"night":"day")}catch{}};return l.addEventListener("change",y),()=>l.removeEventListener("change",y)},[a,n,C]),p.useEffect(()=>{P(d,u,h)},[d,u,h]);const ye=p.useMemo(()=>({mode:d,theme:u,brand:h,reduceMotion:c!==void 0?c:j,enableAnimations:x!==void 0?x:V,setMode:C,setTheme:G,setBrand:J,toggleMode:X,setReduceMotion:Y,setEnableAnimations:Z}),[d,u,h,j,V,c,x,C,G,J,X,Y,Z]);return ge.jsx(ue.Provider,{value:ye,children:r})}function He(){const r=p.useContext(ue);if(r===void 0)throw new Error("useTheme must be used within a ThemeProvider");return r}const _e={sans:["ui-sans-serif","system-ui","-apple-system","Segoe UI","Roboto","Ubuntu","Cantarell","Noto Sans","Helvetica Neue","Arial","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"].join(", "),serif:["ui-serif","Georgia","Cambria","Times New Roman","Times","serif"].join(", "),mono:["ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas","Liberation Mono","Courier New","monospace"].join(", ")},ze={xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem"},Ne={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},qe={none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},Le={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"};exports.cssVariableColorTokens=f.cssVariableColorTokens;exports.tailwindThemeColors=f.tailwindThemeColors;exports.ThemeProvider=Ie;exports.applyDocumentMode=Ce;exports.applyDocumentTheme=P;exports.borderRadius=Me;exports.canLoadTheme=Ae;exports.createMinimalThemeSchema=ke;exports.fontFamilies=_e;exports.fontSizes=ze;exports.fontWeights=Ne;exports.getAllThemes=U;exports.getAvailableThemeIds=Be;exports.getInitialBrand=_;exports.getInitialMode=le;exports.getInitialTheme=F;exports.getThemeMetadata=$e;exports.getThemesByCategory=Te;exports.initializeDefaultThemes=pe;exports.isThemeSchema=Se;exports.letterSpacings=Le;exports.lineHeights=qe;exports.loadTheme=de;exports.loadThemeOverride=ce;exports.loadThemeSafe=T;exports.persistBrand=z;exports.persistMode=I;exports.persistTheme=H;exports.preloadThemes=Re;exports.registerTheme=A;exports.shadows=Oe;exports.spacing=De;exports.themeExists=$;exports.themeRegistry=E;exports.useTheme=He;exports.validateThemeSchema=W;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
12
|
+
var __esm = (fn, res) => function __init() {
|
|
13
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
14
|
+
};
|
|
15
|
+
var __export = (target, all) => {
|
|
16
|
+
for (var name in all)
|
|
17
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// src/themes/brand.ts
|
|
21
|
+
var brand_exports = {};
|
|
22
|
+
__export(brand_exports, {
|
|
23
|
+
brandTheme: () => brandTheme
|
|
24
|
+
});
|
|
25
|
+
var brandTheme;
|
|
26
|
+
var init_brand = __esm({
|
|
27
|
+
"src/themes/brand.ts"() {
|
|
28
|
+
brandTheme = {
|
|
29
|
+
name: "brand",
|
|
30
|
+
description: "Brand-specific theme with custom color palette",
|
|
31
|
+
// Override primary colors - warmer blue tones for brand
|
|
32
|
+
primaryColors: {
|
|
33
|
+
500: "210 75% 45%",
|
|
34
|
+
// Brighter, warmer blue
|
|
35
|
+
600: "210 70% 40%",
|
|
36
|
+
700: "210 65% 35%"
|
|
37
|
+
},
|
|
38
|
+
// Override accent colors - vibrant purple-pink gradient
|
|
39
|
+
accentColors: {
|
|
40
|
+
400: "285 75% 65%",
|
|
41
|
+
// Softer purple
|
|
42
|
+
500: "285 80% 60%",
|
|
43
|
+
// Vibrant purple-pink
|
|
44
|
+
600: "285 75% 55%"
|
|
45
|
+
},
|
|
46
|
+
// Override secondary colors - teal accent for brand
|
|
47
|
+
secondaryColors: {
|
|
48
|
+
400: "170 85% 50%",
|
|
49
|
+
// Brighter teal
|
|
50
|
+
500: "170 90% 45%",
|
|
51
|
+
// Vibrant teal (#00d9b8)
|
|
52
|
+
600: "170 85% 40%"
|
|
53
|
+
},
|
|
54
|
+
// Override semantic colors for day mode - brand-aligned colors
|
|
55
|
+
semanticColorsDay: {
|
|
56
|
+
success: "145 75% 40%",
|
|
57
|
+
// Brand-aligned green
|
|
58
|
+
info: "210 75% 50%"
|
|
59
|
+
// Brand primary blue
|
|
60
|
+
},
|
|
61
|
+
// Override semantic colors for night mode
|
|
62
|
+
semanticColorsNight: {
|
|
63
|
+
success: "145 70% 48%",
|
|
64
|
+
// Brighter brand green
|
|
65
|
+
info: "210 75% 55%"
|
|
66
|
+
// Brighter brand blue
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// src/themes/dark.ts
|
|
73
|
+
var dark_exports = {};
|
|
74
|
+
__export(dark_exports, {
|
|
75
|
+
darkTheme: () => darkTheme
|
|
76
|
+
});
|
|
77
|
+
var darkTheme;
|
|
78
|
+
var init_dark = __esm({
|
|
79
|
+
"src/themes/dark.ts"() {
|
|
80
|
+
darkTheme = {
|
|
81
|
+
name: "dark",
|
|
82
|
+
description: "Enhanced dark theme with deeper surfaces and higher contrast",
|
|
83
|
+
// Override surface colors for night mode - darker backgrounds
|
|
84
|
+
surfaceColorsNight: {
|
|
85
|
+
base: "240 10% 2%",
|
|
86
|
+
// Even darker base (#050508)
|
|
87
|
+
elevated1: "240 10% 3%",
|
|
88
|
+
// #08080a
|
|
89
|
+
elevated2: "240 10% 4%",
|
|
90
|
+
// #0a0a0c
|
|
91
|
+
elevated3: "240 10% 5%",
|
|
92
|
+
// #0c0c0e
|
|
93
|
+
overlay: "0 0% 0% / 0.85",
|
|
94
|
+
// Darker overlay for better contrast
|
|
95
|
+
glass: "240 10% 5% / 0.95"
|
|
96
|
+
// More opaque glass effect
|
|
97
|
+
},
|
|
98
|
+
// Override base colors for night mode - deeper backgrounds
|
|
99
|
+
baseColorsNight: {
|
|
100
|
+
background: "240 10% 2%",
|
|
101
|
+
// Match surface base
|
|
102
|
+
card: "240 10% 2%",
|
|
103
|
+
popover: "240 10% 3%"
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// src/themes/default.ts
|
|
110
|
+
var default_exports = {};
|
|
111
|
+
__export(default_exports, {
|
|
112
|
+
defaultTheme: () => defaultTheme
|
|
113
|
+
});
|
|
114
|
+
var defaultTheme;
|
|
115
|
+
var init_default = __esm({
|
|
116
|
+
"src/themes/default.ts"() {
|
|
117
|
+
defaultTheme = {
|
|
118
|
+
name: "default",
|
|
119
|
+
description: "Default Tenerife UI theme with standard color palette"
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// src/themes/minimal.ts
|
|
125
|
+
var minimalBrand = {
|
|
126
|
+
id: "minimal",
|
|
127
|
+
name: "Minimal",
|
|
128
|
+
description: "Clean, minimal brand theme with muted colors, light typography, and compact spacing",
|
|
129
|
+
namespace: "minimal",
|
|
130
|
+
version: "1.0.0",
|
|
131
|
+
author: "Tenerife UI",
|
|
132
|
+
themes: [
|
|
133
|
+
{
|
|
134
|
+
id: "minimal-day",
|
|
135
|
+
name: "Minimal Day",
|
|
136
|
+
description: "Light minimal theme with grayscale colors and subtle accents",
|
|
137
|
+
mode: "day",
|
|
138
|
+
overrides: {
|
|
139
|
+
name: "minimal-day",
|
|
140
|
+
description: "Light minimal theme for day mode",
|
|
141
|
+
// Muted, low-saturation color overrides
|
|
142
|
+
primaryColors: {
|
|
143
|
+
400: "0 0% 60%",
|
|
144
|
+
// Muted gray
|
|
145
|
+
500: "0 0% 50%",
|
|
146
|
+
// Neutral gray (#808080)
|
|
147
|
+
600: "0 0% 40%",
|
|
148
|
+
700: "0 0% 30%"
|
|
149
|
+
},
|
|
150
|
+
accentColors: {
|
|
151
|
+
400: "210 20% 70%",
|
|
152
|
+
// Muted blue-gray
|
|
153
|
+
500: "210 20% 60%",
|
|
154
|
+
// Subtle blue-gray
|
|
155
|
+
600: "210 20% 50%",
|
|
156
|
+
700: "210 20% 40%"
|
|
157
|
+
},
|
|
158
|
+
secondaryColors: {
|
|
159
|
+
400: "0 0% 70%",
|
|
160
|
+
// Light gray
|
|
161
|
+
500: "0 0% 65%",
|
|
162
|
+
// Neutral light gray
|
|
163
|
+
600: "0 0% 55%",
|
|
164
|
+
700: "0 0% 45%"
|
|
165
|
+
},
|
|
166
|
+
// Muted base colors for day mode
|
|
167
|
+
baseColorsDay: {
|
|
168
|
+
primary: "0 0% 50%",
|
|
169
|
+
// Neutral gray
|
|
170
|
+
primaryForeground: "0 0% 100%",
|
|
171
|
+
secondary: "0 0% 96%",
|
|
172
|
+
// Very light gray
|
|
173
|
+
secondaryForeground: "0 0% 20%",
|
|
174
|
+
accent: "210 20% 60%",
|
|
175
|
+
// Subtle blue-gray
|
|
176
|
+
accentForeground: "0 0% 100%"
|
|
177
|
+
},
|
|
178
|
+
// Subtle semantic colors
|
|
179
|
+
semanticColorsDay: {
|
|
180
|
+
success: "140 30% 45%",
|
|
181
|
+
// Muted green
|
|
182
|
+
info: "210 30% 50%",
|
|
183
|
+
// Muted blue
|
|
184
|
+
warning: "40 30% 50%",
|
|
185
|
+
// Muted orange
|
|
186
|
+
error: "0 40% 55%"
|
|
187
|
+
// Muted red
|
|
188
|
+
},
|
|
189
|
+
// Typography overrides - lighter and smaller
|
|
190
|
+
typography: {
|
|
191
|
+
fontWeight: {
|
|
192
|
+
normal: "400",
|
|
193
|
+
// Normal weight
|
|
194
|
+
medium: "500",
|
|
195
|
+
semibold: "600",
|
|
196
|
+
// Lighter than default
|
|
197
|
+
bold: "700"
|
|
198
|
+
// Standard bold
|
|
199
|
+
},
|
|
200
|
+
fontSize: {
|
|
201
|
+
xs: [
|
|
202
|
+
"clamp(0.6875rem, 0.65rem + 0.125vw, 0.75rem)",
|
|
203
|
+
{ lineHeight: "1rem", letterSpacing: "0.05em" }
|
|
204
|
+
],
|
|
205
|
+
// Smaller
|
|
206
|
+
sm: [
|
|
207
|
+
"clamp(0.8125rem, 0.75rem + 0.25vw, 0.875rem)",
|
|
208
|
+
{ lineHeight: "1.25rem", letterSpacing: "0.025em" }
|
|
209
|
+
],
|
|
210
|
+
// Smaller
|
|
211
|
+
base: [
|
|
212
|
+
"clamp(0.9375rem, 0.875rem + 0.25vw, 1rem)",
|
|
213
|
+
{ lineHeight: "1.5rem", letterSpacing: "0em" }
|
|
214
|
+
],
|
|
215
|
+
// Smaller
|
|
216
|
+
lg: [
|
|
217
|
+
"clamp(1.0625rem, 0.95rem + 0.5vw, 1.125rem)",
|
|
218
|
+
{ lineHeight: "1.75rem", letterSpacing: "-0.025em" }
|
|
219
|
+
],
|
|
220
|
+
// Smaller
|
|
221
|
+
xl: [
|
|
222
|
+
"clamp(1.1875rem, 1rem + 0.75vw, 1.375rem)",
|
|
223
|
+
{ lineHeight: "1.75rem", letterSpacing: "-0.025em" }
|
|
224
|
+
]
|
|
225
|
+
// Smaller
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
// Spacing overrides - compact spacing for tight layout
|
|
229
|
+
spacing: {
|
|
230
|
+
semanticSpacing: {
|
|
231
|
+
xs: "0.125rem",
|
|
232
|
+
// 2px (was 4px)
|
|
233
|
+
sm: "0.25rem",
|
|
234
|
+
// 4px (was 8px)
|
|
235
|
+
md: "0.5rem",
|
|
236
|
+
// 8px (was 16px)
|
|
237
|
+
lg: "0.75rem",
|
|
238
|
+
// 12px (was 24px)
|
|
239
|
+
xl: "1rem",
|
|
240
|
+
// 16px (was 32px)
|
|
241
|
+
"2xl": "1.5rem"
|
|
242
|
+
// 24px (was 48px)
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
// Shadow overrides - subtle and minimal
|
|
246
|
+
shadows: {
|
|
247
|
+
elevationShadows: {
|
|
248
|
+
xs: "0 1px 1px 0 rgb(0 0 0 / 0.03)",
|
|
249
|
+
sm: "0 1px 2px 0 rgb(0 0 0 / 0.05), 0 1px 1px -1px rgb(0 0 0 / 0.05)",
|
|
250
|
+
md: "0 2px 4px -1px rgb(0 0 0 / 0.05), 0 1px 2px -2px rgb(0 0 0 / 0.05)",
|
|
251
|
+
lg: "0 4px 8px -2px rgb(0 0 0 / 0.05), 0 2px 4px -3px rgb(0 0 0 / 0.05)",
|
|
252
|
+
xl: "0 8px 12px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05)"
|
|
253
|
+
},
|
|
254
|
+
glowEffects: {
|
|
255
|
+
"glow-primary": "0 0 8px 0 hsl(0 0% 50% / 0.2)",
|
|
256
|
+
"glow-primary-subtle": "0 0 4px 0 hsl(0 0% 50% / 0.15)",
|
|
257
|
+
"glow-primary-medium": "0 0 8px 0 hsl(0 0% 50% / 0.25)",
|
|
258
|
+
"glow-primary-strong": "0 0 12px 0 hsl(0 0% 50% / 0.3)"
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
// Radius overrides - smaller, sharper corners
|
|
262
|
+
radius: {
|
|
263
|
+
borderRadius: {
|
|
264
|
+
xs: "0.0625rem",
|
|
265
|
+
// 1px
|
|
266
|
+
sm: "0.125rem",
|
|
267
|
+
// 2px (was 4px)
|
|
268
|
+
md: "0.1875rem",
|
|
269
|
+
// 3px (was 6px)
|
|
270
|
+
lg: "0.25rem",
|
|
271
|
+
// 4px (was 8px)
|
|
272
|
+
xl: "0.375rem",
|
|
273
|
+
// 6px (was 12px)
|
|
274
|
+
"2xl": "0.5rem"
|
|
275
|
+
// 8px (was 16px)
|
|
276
|
+
},
|
|
277
|
+
componentRadius: {
|
|
278
|
+
button: {
|
|
279
|
+
sm: "0.125rem",
|
|
280
|
+
// 2px
|
|
281
|
+
md: "0.1875rem",
|
|
282
|
+
// 3px
|
|
283
|
+
lg: "0.25rem"
|
|
284
|
+
// 4px
|
|
285
|
+
},
|
|
286
|
+
card: {
|
|
287
|
+
sm: "0.1875rem",
|
|
288
|
+
// 3px
|
|
289
|
+
md: "0.25rem",
|
|
290
|
+
// 4px
|
|
291
|
+
lg: "0.375rem",
|
|
292
|
+
// 6px
|
|
293
|
+
xl: "0.5rem"
|
|
294
|
+
// 8px
|
|
295
|
+
},
|
|
296
|
+
input: {
|
|
297
|
+
sm: "0.125rem",
|
|
298
|
+
// 2px
|
|
299
|
+
md: "0.1875rem",
|
|
300
|
+
// 3px
|
|
301
|
+
lg: "0.25rem"
|
|
302
|
+
// 4px
|
|
303
|
+
},
|
|
304
|
+
badge: {
|
|
305
|
+
sm: "0.0625rem",
|
|
306
|
+
// 1px
|
|
307
|
+
md: "0.125rem",
|
|
308
|
+
// 2px
|
|
309
|
+
lg: "0.1875rem"
|
|
310
|
+
// 3px
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
id: "minimal-night",
|
|
318
|
+
name: "Minimal Night",
|
|
319
|
+
description: "Dark minimal theme with muted grayscale colors",
|
|
320
|
+
mode: "night",
|
|
321
|
+
overrides: {
|
|
322
|
+
name: "minimal-night",
|
|
323
|
+
description: "Dark minimal theme for night mode",
|
|
324
|
+
// Muted colors for night mode (slightly lighter than day for contrast)
|
|
325
|
+
primaryColors: {
|
|
326
|
+
400: "0 0% 65%",
|
|
327
|
+
// Lighter gray for night
|
|
328
|
+
500: "0 0% 55%",
|
|
329
|
+
// Neutral gray
|
|
330
|
+
600: "0 0% 45%",
|
|
331
|
+
700: "0 0% 35%"
|
|
332
|
+
},
|
|
333
|
+
accentColors: {
|
|
334
|
+
400: "210 20% 75%",
|
|
335
|
+
// Lighter blue-gray
|
|
336
|
+
500: "210 20% 65%",
|
|
337
|
+
// Subtle blue-gray
|
|
338
|
+
600: "210 20% 55%",
|
|
339
|
+
700: "210 20% 45%"
|
|
340
|
+
},
|
|
341
|
+
secondaryColors: {
|
|
342
|
+
400: "0 0% 75%",
|
|
343
|
+
// Light gray
|
|
344
|
+
500: "0 0% 70%",
|
|
345
|
+
// Neutral light gray
|
|
346
|
+
600: "0 0% 60%",
|
|
347
|
+
700: "0 0% 50%"
|
|
348
|
+
},
|
|
349
|
+
// Darker base colors for night mode
|
|
350
|
+
baseColorsNight: {
|
|
351
|
+
background: "240 10% 8%",
|
|
352
|
+
// Dark gray background
|
|
353
|
+
foreground: "0 0% 95%",
|
|
354
|
+
card: "240 10% 10%",
|
|
355
|
+
cardForeground: "0 0% 95%"
|
|
356
|
+
},
|
|
357
|
+
surfaceColorsNight: {
|
|
358
|
+
base: "240 10% 8%",
|
|
359
|
+
elevated1: "240 10% 10%",
|
|
360
|
+
elevated2: "240 10% 12%",
|
|
361
|
+
elevated3: "240 10% 14%"
|
|
362
|
+
},
|
|
363
|
+
// Subtle semantic colors for night
|
|
364
|
+
semanticColorsNight: {
|
|
365
|
+
success: "140 30% 50%",
|
|
366
|
+
// Muted green
|
|
367
|
+
info: "210 30% 55%",
|
|
368
|
+
// Muted blue
|
|
369
|
+
warning: "40 30% 55%",
|
|
370
|
+
// Muted orange
|
|
371
|
+
error: "0 40% 60%"
|
|
372
|
+
// Muted red
|
|
373
|
+
},
|
|
374
|
+
// Typography overrides - same as day
|
|
375
|
+
typography: {
|
|
376
|
+
fontWeight: {
|
|
377
|
+
normal: "400",
|
|
378
|
+
medium: "500",
|
|
379
|
+
semibold: "600",
|
|
380
|
+
bold: "700"
|
|
381
|
+
},
|
|
382
|
+
fontSize: {
|
|
383
|
+
xs: [
|
|
384
|
+
"clamp(0.6875rem, 0.65rem + 0.125vw, 0.75rem)",
|
|
385
|
+
{ lineHeight: "1rem", letterSpacing: "0.05em" }
|
|
386
|
+
],
|
|
387
|
+
sm: [
|
|
388
|
+
"clamp(0.8125rem, 0.75rem + 0.25vw, 0.875rem)",
|
|
389
|
+
{ lineHeight: "1.25rem", letterSpacing: "0.025em" }
|
|
390
|
+
],
|
|
391
|
+
base: [
|
|
392
|
+
"clamp(0.9375rem, 0.875rem + 0.25vw, 1rem)",
|
|
393
|
+
{ lineHeight: "1.5rem", letterSpacing: "0em" }
|
|
394
|
+
],
|
|
395
|
+
lg: [
|
|
396
|
+
"clamp(1.0625rem, 0.95rem + 0.5vw, 1.125rem)",
|
|
397
|
+
{ lineHeight: "1.75rem", letterSpacing: "-0.025em" }
|
|
398
|
+
],
|
|
399
|
+
xl: [
|
|
400
|
+
"clamp(1.1875rem, 1rem + 0.75vw, 1.375rem)",
|
|
401
|
+
{ lineHeight: "1.75rem", letterSpacing: "-0.025em" }
|
|
402
|
+
]
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
// Spacing overrides - same as day
|
|
406
|
+
spacing: {
|
|
407
|
+
semanticSpacing: {
|
|
408
|
+
xs: "0.125rem",
|
|
409
|
+
sm: "0.25rem",
|
|
410
|
+
md: "0.5rem",
|
|
411
|
+
lg: "0.75rem",
|
|
412
|
+
xl: "1rem",
|
|
413
|
+
"2xl": "1.5rem"
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
// Shadow overrides - subtle for night
|
|
417
|
+
shadows: {
|
|
418
|
+
elevationShadows: {
|
|
419
|
+
xs: "0 1px 2px 0 rgb(0 0 0 / 0.15)",
|
|
420
|
+
sm: "0 1px 3px 0 rgb(0 0 0 / 0.2), 0 1px 2px -1px rgb(0 0 0 / 0.2)",
|
|
421
|
+
md: "0 2px 5px -1px rgb(0 0 0 / 0.2), 0 1px 3px -2px rgb(0 0 0 / 0.2)",
|
|
422
|
+
lg: "0 4px 10px -2px rgb(0 0 0 / 0.2), 0 2px 5px -3px rgb(0 0 0 / 0.2)",
|
|
423
|
+
xl: "0 8px 15px -3px rgb(0 0 0 / 0.2), 0 4px 8px -4px rgb(0 0 0 / 0.2)"
|
|
424
|
+
},
|
|
425
|
+
glowEffects: {
|
|
426
|
+
"glow-primary": "0 0 8px 0 hsl(0 0% 55% / 0.25)",
|
|
427
|
+
"glow-primary-subtle": "0 0 4px 0 hsl(0 0% 55% / 0.2)",
|
|
428
|
+
"glow-primary-medium": "0 0 8px 0 hsl(0 0% 55% / 0.3)",
|
|
429
|
+
"glow-primary-strong": "0 0 12px 0 hsl(0 0% 55% / 0.35)"
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
// Radius overrides - same as day
|
|
433
|
+
radius: {
|
|
434
|
+
borderRadius: {
|
|
435
|
+
xs: "0.0625rem",
|
|
436
|
+
sm: "0.125rem",
|
|
437
|
+
md: "0.1875rem",
|
|
438
|
+
lg: "0.25rem",
|
|
439
|
+
xl: "0.375rem",
|
|
440
|
+
"2xl": "0.5rem"
|
|
441
|
+
},
|
|
442
|
+
componentRadius: {
|
|
443
|
+
button: {
|
|
444
|
+
sm: "0.125rem",
|
|
445
|
+
md: "0.1875rem",
|
|
446
|
+
lg: "0.25rem"
|
|
447
|
+
},
|
|
448
|
+
card: {
|
|
449
|
+
sm: "0.1875rem",
|
|
450
|
+
md: "0.25rem",
|
|
451
|
+
lg: "0.375rem",
|
|
452
|
+
xl: "0.5rem"
|
|
453
|
+
},
|
|
454
|
+
input: {
|
|
455
|
+
sm: "0.125rem",
|
|
456
|
+
md: "0.1875rem",
|
|
457
|
+
lg: "0.25rem"
|
|
458
|
+
},
|
|
459
|
+
badge: {
|
|
460
|
+
sm: "0.0625rem",
|
|
461
|
+
md: "0.125rem",
|
|
462
|
+
lg: "0.1875rem"
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
]
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
// src/themes/neon.ts
|
|
472
|
+
var neonBrand = {
|
|
473
|
+
id: "neon",
|
|
474
|
+
name: "Neon",
|
|
475
|
+
description: "Vibrant brand theme with high-saturation neon colors, bold typography, and enhanced visual effects",
|
|
476
|
+
namespace: "neon",
|
|
477
|
+
version: "1.0.0",
|
|
478
|
+
author: "Tenerife UI",
|
|
479
|
+
themes: [
|
|
480
|
+
{
|
|
481
|
+
id: "neon-day",
|
|
482
|
+
name: "Neon Day",
|
|
483
|
+
description: "Bright neon theme for day mode with vibrant cyan, magenta, and yellow accents",
|
|
484
|
+
mode: "day",
|
|
485
|
+
overrides: {
|
|
486
|
+
name: "neon-day",
|
|
487
|
+
description: "Bright neon theme for day mode",
|
|
488
|
+
// Vibrant neon color overrides
|
|
489
|
+
primaryColors: {
|
|
490
|
+
400: "180 100% 50%",
|
|
491
|
+
// Bright cyan
|
|
492
|
+
500: "180 100% 45%",
|
|
493
|
+
// Vibrant cyan (#00e6ff)
|
|
494
|
+
600: "180 95% 40%",
|
|
495
|
+
700: "180 90% 35%"
|
|
496
|
+
},
|
|
497
|
+
accentColors: {
|
|
498
|
+
400: "320 100% 60%",
|
|
499
|
+
// Bright magenta
|
|
500
|
+
500: "320 100% 55%",
|
|
501
|
+
// Vibrant magenta (#ff00cc)
|
|
502
|
+
600: "320 95% 50%",
|
|
503
|
+
700: "320 90% 45%"
|
|
504
|
+
},
|
|
505
|
+
secondaryColors: {
|
|
506
|
+
400: "60 100% 60%",
|
|
507
|
+
// Bright yellow
|
|
508
|
+
500: "60 100% 55%",
|
|
509
|
+
// Vibrant yellow (#ffff00)
|
|
510
|
+
600: "60 95% 50%",
|
|
511
|
+
700: "60 90% 45%"
|
|
512
|
+
},
|
|
513
|
+
// Enhanced base colors for day mode
|
|
514
|
+
baseColorsDay: {
|
|
515
|
+
primary: "180 100% 45%",
|
|
516
|
+
// Neon cyan
|
|
517
|
+
primaryForeground: "0 0% 100%",
|
|
518
|
+
accent: "320 100% 55%",
|
|
519
|
+
// Neon magenta
|
|
520
|
+
accentForeground: "0 0% 100%"
|
|
521
|
+
},
|
|
522
|
+
// Semantic colors with neon accents
|
|
523
|
+
semanticColorsDay: {
|
|
524
|
+
success: "145 80% 45%",
|
|
525
|
+
// Neon green
|
|
526
|
+
info: "180 100% 45%",
|
|
527
|
+
// Neon cyan
|
|
528
|
+
warning: "60 100% 55%",
|
|
529
|
+
// Neon yellow
|
|
530
|
+
error: "0 100% 60%"
|
|
531
|
+
// Bright red
|
|
532
|
+
},
|
|
533
|
+
// Typography overrides - bolder and larger
|
|
534
|
+
typography: {
|
|
535
|
+
fontWeight: {
|
|
536
|
+
normal: "500",
|
|
537
|
+
// Heavier than default (400)
|
|
538
|
+
medium: "600",
|
|
539
|
+
// Heavier
|
|
540
|
+
semibold: "700",
|
|
541
|
+
// Bold
|
|
542
|
+
bold: "800"
|
|
543
|
+
// Extra bold
|
|
544
|
+
},
|
|
545
|
+
fontSize: {
|
|
546
|
+
xs: [
|
|
547
|
+
"clamp(0.875rem, 0.8rem + 0.25vw, 1rem)",
|
|
548
|
+
{ lineHeight: "1.25rem", letterSpacing: "0.025em" }
|
|
549
|
+
],
|
|
550
|
+
// Larger than default
|
|
551
|
+
sm: [
|
|
552
|
+
"clamp(1rem, 0.95rem + 0.25vw, 1.125rem)",
|
|
553
|
+
{ lineHeight: "1.5rem", letterSpacing: "0em" }
|
|
554
|
+
],
|
|
555
|
+
// Larger
|
|
556
|
+
base: [
|
|
557
|
+
"clamp(1.125rem, 1rem + 0.5vw, 1.25rem)",
|
|
558
|
+
{ lineHeight: "1.75rem", letterSpacing: "-0.025em" }
|
|
559
|
+
],
|
|
560
|
+
// Larger
|
|
561
|
+
lg: [
|
|
562
|
+
"clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem)",
|
|
563
|
+
{ lineHeight: "1.75rem", letterSpacing: "-0.025em" }
|
|
564
|
+
],
|
|
565
|
+
// Larger
|
|
566
|
+
xl: [
|
|
567
|
+
"clamp(1.5rem, 1.25rem + 1.25vw, 2rem)",
|
|
568
|
+
{ lineHeight: "2rem", letterSpacing: "-0.05em" }
|
|
569
|
+
]
|
|
570
|
+
// Larger
|
|
571
|
+
}
|
|
572
|
+
},
|
|
573
|
+
// Spacing overrides - larger spacing for breathing room
|
|
574
|
+
spacing: {
|
|
575
|
+
semanticSpacing: {
|
|
576
|
+
xs: "0.5rem",
|
|
577
|
+
// 8px (was 4px)
|
|
578
|
+
sm: "1rem",
|
|
579
|
+
// 16px (was 8px)
|
|
580
|
+
md: "1.5rem",
|
|
581
|
+
// 24px (was 16px)
|
|
582
|
+
lg: "2rem",
|
|
583
|
+
// 32px (was 24px)
|
|
584
|
+
xl: "3rem",
|
|
585
|
+
// 48px (was 32px)
|
|
586
|
+
"2xl": "4rem"
|
|
587
|
+
// 64px (was 48px)
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
// Shadow overrides - stronger and more prominent
|
|
591
|
+
shadows: {
|
|
592
|
+
elevationShadows: {
|
|
593
|
+
xs: "0 2px 4px 0 rgb(0 0 0 / 0.1)",
|
|
594
|
+
sm: "0 2px 6px 0 rgb(0 0 0 / 0.15), 0 2px 4px -1px rgb(0 0 0 / 0.15)",
|
|
595
|
+
md: "0 6px 10px -1px rgb(0 0 0 / 0.15), 0 4px 6px -2px rgb(0 0 0 / 0.15)",
|
|
596
|
+
lg: "0 12px 20px -3px rgb(0 0 0 / 0.15), 0 6px 10px -4px rgb(0 0 0 / 0.15)",
|
|
597
|
+
xl: "0 24px 32px -5px rgb(0 0 0 / 0.15), 0 10px 14px -6px rgb(0 0 0 / 0.15)"
|
|
598
|
+
},
|
|
599
|
+
glowEffects: {
|
|
600
|
+
"glow-primary": "0 0 30px 0 hsl(180 100% 45% / 0.7), 0 0 60px 0 hsl(180 100% 45% / 0.4)",
|
|
601
|
+
"glow-primary-subtle": "0 0 12px 0 hsl(180 100% 45% / 0.5)",
|
|
602
|
+
"glow-primary-medium": "0 0 24px 0 hsl(180 100% 45% / 0.7)",
|
|
603
|
+
"glow-primary-strong": "0 0 36px 0 hsl(180 100% 45% / 0.8)",
|
|
604
|
+
"glow-accent": "0 0 30px 0 hsl(320 100% 55% / 0.7), 0 0 60px 0 hsl(320 100% 55% / 0.4)",
|
|
605
|
+
"glow-accent-subtle": "0 0 12px 0 hsl(320 100% 55% / 0.5)",
|
|
606
|
+
"glow-accent-medium": "0 0 24px 0 hsl(320 100% 55% / 0.7)",
|
|
607
|
+
"glow-accent-strong": "0 0 36px 0 hsl(320 100% 55% / 0.8)"
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
// Radius overrides - more rounded corners
|
|
611
|
+
radius: {
|
|
612
|
+
borderRadius: {
|
|
613
|
+
sm: "0.375rem",
|
|
614
|
+
// 6px (was 4px)
|
|
615
|
+
md: "0.5rem",
|
|
616
|
+
// 8px (was 6px)
|
|
617
|
+
lg: "0.75rem",
|
|
618
|
+
// 12px (was 8px)
|
|
619
|
+
xl: "1rem",
|
|
620
|
+
// 16px (was 12px)
|
|
621
|
+
"2xl": "1.5rem",
|
|
622
|
+
// 24px (was 16px)
|
|
623
|
+
"3xl": "2rem"
|
|
624
|
+
// 32px (was 24px)
|
|
625
|
+
},
|
|
626
|
+
componentRadius: {
|
|
627
|
+
button: {
|
|
628
|
+
sm: "0.5rem",
|
|
629
|
+
// 8px
|
|
630
|
+
md: "0.75rem",
|
|
631
|
+
// 12px
|
|
632
|
+
lg: "1rem"
|
|
633
|
+
// 16px
|
|
634
|
+
},
|
|
635
|
+
card: {
|
|
636
|
+
sm: "0.75rem",
|
|
637
|
+
// 12px
|
|
638
|
+
md: "1rem",
|
|
639
|
+
// 16px
|
|
640
|
+
lg: "1.25rem",
|
|
641
|
+
// 20px
|
|
642
|
+
xl: "1.5rem"
|
|
643
|
+
// 24px
|
|
644
|
+
},
|
|
645
|
+
input: {
|
|
646
|
+
sm: "0.5rem",
|
|
647
|
+
// 8px
|
|
648
|
+
md: "0.75rem",
|
|
649
|
+
// 12px
|
|
650
|
+
lg: "1rem"
|
|
651
|
+
// 16px
|
|
652
|
+
},
|
|
653
|
+
badge: {
|
|
654
|
+
sm: "0.375rem",
|
|
655
|
+
// 6px
|
|
656
|
+
md: "0.5rem",
|
|
657
|
+
// 8px
|
|
658
|
+
lg: "0.75rem"
|
|
659
|
+
// 12px
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
id: "neon-night",
|
|
667
|
+
name: "Neon Night",
|
|
668
|
+
description: "Dark neon theme for night mode with glowing neon accents on dark backgrounds",
|
|
669
|
+
mode: "night",
|
|
670
|
+
overrides: {
|
|
671
|
+
name: "neon-night",
|
|
672
|
+
description: "Dark neon theme for night mode",
|
|
673
|
+
// Vibrant neon color overrides (same as day but with different base)
|
|
674
|
+
primaryColors: {
|
|
675
|
+
400: "180 100% 55%",
|
|
676
|
+
// Brighter cyan for night
|
|
677
|
+
500: "180 100% 50%",
|
|
678
|
+
// Vibrant cyan
|
|
679
|
+
600: "180 95% 45%",
|
|
680
|
+
700: "180 90% 40%"
|
|
681
|
+
},
|
|
682
|
+
accentColors: {
|
|
683
|
+
400: "320 100% 65%",
|
|
684
|
+
// Brighter magenta for night
|
|
685
|
+
500: "320 100% 60%",
|
|
686
|
+
// Vibrant magenta
|
|
687
|
+
600: "320 95% 55%",
|
|
688
|
+
700: "320 90% 50%"
|
|
689
|
+
},
|
|
690
|
+
secondaryColors: {
|
|
691
|
+
400: "60 100% 65%",
|
|
692
|
+
// Brighter yellow for night
|
|
693
|
+
500: "60 100% 60%",
|
|
694
|
+
// Vibrant yellow
|
|
695
|
+
600: "60 95% 55%",
|
|
696
|
+
700: "60 90% 50%"
|
|
697
|
+
},
|
|
698
|
+
// Darker base colors for night mode
|
|
699
|
+
baseColorsNight: {
|
|
700
|
+
background: "240 10% 5%",
|
|
701
|
+
// Very dark background
|
|
702
|
+
foreground: "0 0% 98%",
|
|
703
|
+
card: "240 10% 6%",
|
|
704
|
+
cardForeground: "0 0% 98%"
|
|
705
|
+
},
|
|
706
|
+
surfaceColorsNight: {
|
|
707
|
+
base: "240 10% 5%",
|
|
708
|
+
// Very dark
|
|
709
|
+
elevated1: "240 10% 7%",
|
|
710
|
+
elevated2: "240 10% 9%",
|
|
711
|
+
elevated3: "240 10% 11%"
|
|
712
|
+
},
|
|
713
|
+
// Semantic colors with neon accents for night
|
|
714
|
+
semanticColorsNight: {
|
|
715
|
+
success: "145 75% 50%",
|
|
716
|
+
// Neon green
|
|
717
|
+
info: "180 100% 50%",
|
|
718
|
+
// Neon cyan
|
|
719
|
+
warning: "60 100% 60%",
|
|
720
|
+
// Neon yellow
|
|
721
|
+
error: "0 100% 65%"
|
|
722
|
+
// Bright red
|
|
723
|
+
},
|
|
724
|
+
// Typography overrides - same as day
|
|
725
|
+
typography: {
|
|
726
|
+
fontWeight: {
|
|
727
|
+
normal: "500",
|
|
728
|
+
medium: "600",
|
|
729
|
+
semibold: "700",
|
|
730
|
+
bold: "800"
|
|
731
|
+
},
|
|
732
|
+
fontSize: {
|
|
733
|
+
xs: [
|
|
734
|
+
"clamp(0.875rem, 0.8rem + 0.25vw, 1rem)",
|
|
735
|
+
{ lineHeight: "1.25rem", letterSpacing: "0.025em" }
|
|
736
|
+
],
|
|
737
|
+
sm: [
|
|
738
|
+
"clamp(1rem, 0.95rem + 0.25vw, 1.125rem)",
|
|
739
|
+
{ lineHeight: "1.5rem", letterSpacing: "0em" }
|
|
740
|
+
],
|
|
741
|
+
base: [
|
|
742
|
+
"clamp(1.125rem, 1rem + 0.5vw, 1.25rem)",
|
|
743
|
+
{ lineHeight: "1.75rem", letterSpacing: "-0.025em" }
|
|
744
|
+
],
|
|
745
|
+
lg: [
|
|
746
|
+
"clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem)",
|
|
747
|
+
{ lineHeight: "1.75rem", letterSpacing: "-0.025em" }
|
|
748
|
+
],
|
|
749
|
+
xl: [
|
|
750
|
+
"clamp(1.5rem, 1.25rem + 1.25vw, 2rem)",
|
|
751
|
+
{ lineHeight: "2rem", letterSpacing: "-0.05em" }
|
|
752
|
+
]
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
// Spacing overrides - same as day
|
|
756
|
+
spacing: {
|
|
757
|
+
semanticSpacing: {
|
|
758
|
+
xs: "0.5rem",
|
|
759
|
+
sm: "1rem",
|
|
760
|
+
md: "1.5rem",
|
|
761
|
+
lg: "2rem",
|
|
762
|
+
xl: "3rem",
|
|
763
|
+
"2xl": "4rem"
|
|
764
|
+
}
|
|
765
|
+
},
|
|
766
|
+
// Shadow overrides - even stronger glow for night
|
|
767
|
+
shadows: {
|
|
768
|
+
elevationShadows: {
|
|
769
|
+
xs: "0 2px 4px 0 rgb(0 0 0 / 0.2)",
|
|
770
|
+
sm: "0 2px 6px 0 rgb(0 0 0 / 0.25), 0 2px 4px -1px rgb(0 0 0 / 0.25)",
|
|
771
|
+
md: "0 6px 10px -1px rgb(0 0 0 / 0.25), 0 4px 6px -2px rgb(0 0 0 / 0.25)",
|
|
772
|
+
lg: "0 12px 20px -3px rgb(0 0 0 / 0.25), 0 6px 10px -4px rgb(0 0 0 / 0.25)",
|
|
773
|
+
xl: "0 24px 32px -5px rgb(0 0 0 / 0.25), 0 10px 14px -6px rgb(0 0 0 / 0.25)"
|
|
774
|
+
},
|
|
775
|
+
glowEffects: {
|
|
776
|
+
"glow-primary": "0 0 40px 0 hsl(180 100% 50% / 0.8), 0 0 80px 0 hsl(180 100% 50% / 0.5)",
|
|
777
|
+
"glow-primary-subtle": "0 0 16px 0 hsl(180 100% 50% / 0.6)",
|
|
778
|
+
"glow-primary-medium": "0 0 32px 0 hsl(180 100% 50% / 0.8)",
|
|
779
|
+
"glow-primary-strong": "0 0 48px 0 hsl(180 100% 50% / 0.9)",
|
|
780
|
+
"glow-accent": "0 0 40px 0 hsl(320 100% 60% / 0.8), 0 0 80px 0 hsl(320 100% 60% / 0.5)",
|
|
781
|
+
"glow-accent-subtle": "0 0 16px 0 hsl(320 100% 60% / 0.6)",
|
|
782
|
+
"glow-accent-medium": "0 0 32px 0 hsl(320 100% 60% / 0.8)",
|
|
783
|
+
"glow-accent-strong": "0 0 48px 0 hsl(320 100% 60% / 0.9)"
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
// Radius overrides - same as day
|
|
787
|
+
radius: {
|
|
788
|
+
borderRadius: {
|
|
789
|
+
sm: "0.375rem",
|
|
790
|
+
md: "0.5rem",
|
|
791
|
+
lg: "0.75rem",
|
|
792
|
+
xl: "1rem",
|
|
793
|
+
"2xl": "1.5rem",
|
|
794
|
+
"3xl": "2rem"
|
|
795
|
+
},
|
|
796
|
+
componentRadius: {
|
|
797
|
+
button: {
|
|
798
|
+
sm: "0.5rem",
|
|
799
|
+
md: "0.75rem",
|
|
800
|
+
lg: "1rem"
|
|
801
|
+
},
|
|
802
|
+
card: {
|
|
803
|
+
sm: "0.75rem",
|
|
804
|
+
md: "1rem",
|
|
805
|
+
lg: "1.25rem",
|
|
806
|
+
xl: "1.5rem"
|
|
807
|
+
},
|
|
808
|
+
input: {
|
|
809
|
+
sm: "0.5rem",
|
|
810
|
+
md: "0.75rem",
|
|
811
|
+
lg: "1rem"
|
|
812
|
+
},
|
|
813
|
+
badge: {
|
|
814
|
+
sm: "0.375rem",
|
|
815
|
+
md: "0.5rem",
|
|
816
|
+
lg: "0.75rem"
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
]
|
|
823
|
+
};
|
|
824
|
+
|
|
825
|
+
// src/themes/brand_engine.ts
|
|
826
|
+
var brandRegistry = /* @__PURE__ */ new Map();
|
|
827
|
+
var activeBrand = null;
|
|
828
|
+
var activeNamespace = null;
|
|
829
|
+
var brandCache = /* @__PURE__ */ new Map();
|
|
830
|
+
function validateBrand(brand) {
|
|
831
|
+
const errors = [];
|
|
832
|
+
const warnings = [];
|
|
833
|
+
if (!brand || typeof brand !== "object") {
|
|
834
|
+
return {
|
|
835
|
+
valid: false,
|
|
836
|
+
errors: ["Brand must be an object"],
|
|
837
|
+
warnings: []
|
|
838
|
+
};
|
|
839
|
+
}
|
|
840
|
+
const brandObj = brand;
|
|
841
|
+
const requiredFields = ["id", "name", "namespace"];
|
|
842
|
+
for (const field of requiredFields) {
|
|
843
|
+
if (!(field in brandObj) || !brandObj[field]) {
|
|
844
|
+
errors.push(`Missing required field: ${field}`);
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
if (brandObj.id && typeof brandObj.id === "string") {
|
|
848
|
+
const idRegex = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
849
|
+
if (!idRegex.test(brandObj.id)) {
|
|
850
|
+
errors.push(
|
|
851
|
+
`Invalid brand ID format: "${brandObj.id}". Must be kebab-case (e.g., "neon-brand")`
|
|
852
|
+
);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
if (brandObj.namespace && typeof brandObj.namespace === "string") {
|
|
856
|
+
const namespaceRegex = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
857
|
+
if (!namespaceRegex.test(brandObj.namespace)) {
|
|
858
|
+
errors.push(
|
|
859
|
+
`Invalid namespace format: "${brandObj.namespace}". Must be kebab-case (e.g., "neon")`
|
|
860
|
+
);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
if (brandObj.themes) {
|
|
864
|
+
if (!Array.isArray(brandObj.themes)) {
|
|
865
|
+
errors.push("Brand themes must be an array");
|
|
866
|
+
} else {
|
|
867
|
+
const themes2 = brandObj.themes;
|
|
868
|
+
if (themes2.length === 0) {
|
|
869
|
+
warnings.push("Brand has no themes defined");
|
|
870
|
+
}
|
|
871
|
+
themes2.forEach((theme, index) => {
|
|
872
|
+
if (!theme || typeof theme !== "object") {
|
|
873
|
+
errors.push(`Theme at index ${index} must be an object`);
|
|
874
|
+
return;
|
|
875
|
+
}
|
|
876
|
+
const themeObj = theme;
|
|
877
|
+
if (!themeObj.id || typeof themeObj.id !== "string") {
|
|
878
|
+
errors.push(`Theme at index ${index} is missing required field: id`);
|
|
879
|
+
}
|
|
880
|
+
if (!themeObj.name || typeof themeObj.name !== "string") {
|
|
881
|
+
errors.push(`Theme at index ${index} is missing required field: name`);
|
|
882
|
+
}
|
|
883
|
+
if (!themeObj.mode || !["day", "night"].includes(themeObj.mode)) {
|
|
884
|
+
errors.push(`Theme at index ${index} must have mode set to "day" or "night"`);
|
|
885
|
+
}
|
|
886
|
+
if (!themeObj.overrides || typeof themeObj.overrides !== "object") {
|
|
887
|
+
errors.push(`Theme at index ${index} is missing required field: overrides`);
|
|
888
|
+
}
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
} else {
|
|
892
|
+
errors.push("Brand must have at least one theme");
|
|
893
|
+
}
|
|
894
|
+
if (brandObj.version && typeof brandObj.version === "string") {
|
|
895
|
+
const semverRegex = /^\d+\.\d+\.\d+$/;
|
|
896
|
+
if (!semverRegex.test(brandObj.version)) {
|
|
897
|
+
warnings.push(
|
|
898
|
+
`Invalid version format: "${brandObj.version}". Should be semver (e.g., "1.0.0")`
|
|
899
|
+
);
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
if (brandObj.themes && Array.isArray(brandObj.themes)) {
|
|
903
|
+
const themeIds = brandObj.themes.map(
|
|
904
|
+
(theme) => theme?.id
|
|
905
|
+
);
|
|
906
|
+
const uniqueIds = new Set(themeIds);
|
|
907
|
+
if (themeIds.length !== uniqueIds.size) {
|
|
908
|
+
errors.push("Brand contains duplicate theme IDs");
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
return {
|
|
912
|
+
valid: errors.length === 0,
|
|
913
|
+
errors,
|
|
914
|
+
warnings
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
function registerBrand(brand, options) {
|
|
918
|
+
const validation = validateBrand(brand);
|
|
919
|
+
if (!validation.valid) {
|
|
920
|
+
throw new Error(`Invalid brand "${brand.id}": ${validation.errors.join(", ")}`);
|
|
921
|
+
}
|
|
922
|
+
if (validation.warnings.length > 0) {
|
|
923
|
+
console.warn(`Brand "${brand.id}" validation warnings:`, validation.warnings.join(", "));
|
|
924
|
+
}
|
|
925
|
+
const existingEntry = brandRegistry.get(brand.id);
|
|
926
|
+
if (existingEntry && existingEntry.brand.namespace === brand.namespace) {
|
|
927
|
+
return;
|
|
928
|
+
}
|
|
929
|
+
if (brandRegistry.has(brand.id)) {
|
|
930
|
+
throw new Error(`Brand "${brand.id}" is already registered`);
|
|
931
|
+
}
|
|
932
|
+
const existingBrand = Array.from(brandRegistry.values()).find(
|
|
933
|
+
(entry) => entry.brand.namespace === brand.namespace
|
|
934
|
+
);
|
|
935
|
+
if (existingBrand) {
|
|
936
|
+
throw new Error(
|
|
937
|
+
`Brand namespace "${brand.namespace}" is already used by brand "${existingBrand.brand.id}"`
|
|
938
|
+
);
|
|
939
|
+
}
|
|
940
|
+
brandRegistry.set(brand.id, {
|
|
941
|
+
brand,
|
|
942
|
+
enabled: options?.enabled !== false,
|
|
943
|
+
loader: options?.loader
|
|
944
|
+
});
|
|
945
|
+
}
|
|
946
|
+
async function loadBrand(brandId) {
|
|
947
|
+
if (brandCache.has(brandId)) {
|
|
948
|
+
return brandCache.get(brandId);
|
|
949
|
+
}
|
|
950
|
+
const entry = brandRegistry.get(brandId);
|
|
951
|
+
if (!entry) {
|
|
952
|
+
throw new Error(`Brand "${brandId}" not found in registry`);
|
|
953
|
+
}
|
|
954
|
+
if (entry.enabled === false) {
|
|
955
|
+
throw new Error(`Brand "${brandId}" is disabled`);
|
|
956
|
+
}
|
|
957
|
+
if (entry.loader) {
|
|
958
|
+
try {
|
|
959
|
+
const module = await entry.loader();
|
|
960
|
+
const loadedBrand = module.default;
|
|
961
|
+
const validation = validateBrand(loadedBrand);
|
|
962
|
+
if (!validation.valid) {
|
|
963
|
+
throw new Error(`Invalid loaded brand "${brandId}": ${validation.errors.join(", ")}`);
|
|
964
|
+
}
|
|
965
|
+
brandCache.set(brandId, loadedBrand);
|
|
966
|
+
return loadedBrand;
|
|
967
|
+
} catch (error) {
|
|
968
|
+
throw new Error(
|
|
969
|
+
`Failed to load brand "${brandId}": ${error instanceof Error ? error.message : String(error)}`
|
|
970
|
+
);
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
brandCache.set(brandId, entry.brand);
|
|
974
|
+
return entry.brand;
|
|
975
|
+
}
|
|
976
|
+
function getActiveBrand() {
|
|
977
|
+
return activeBrand;
|
|
978
|
+
}
|
|
979
|
+
function setActiveBrand(brand) {
|
|
980
|
+
activeBrand = brand;
|
|
981
|
+
activeNamespace = brand?.namespace || null;
|
|
982
|
+
}
|
|
983
|
+
function clearActiveBrand() {
|
|
984
|
+
activeBrand = null;
|
|
985
|
+
activeNamespace = null;
|
|
986
|
+
}
|
|
987
|
+
function getBrandTheme(brand, mode) {
|
|
988
|
+
return brand.themes.find((theme) => theme.mode === mode);
|
|
989
|
+
}
|
|
990
|
+
function applyBrandOverrides(brand, mode) {
|
|
991
|
+
if (typeof document === "undefined") return;
|
|
992
|
+
const theme = getBrandTheme(brand, mode);
|
|
993
|
+
if (!theme) {
|
|
994
|
+
console.warn(`Brand "${brand.id}" has no theme for mode "${mode}"`);
|
|
995
|
+
return;
|
|
996
|
+
}
|
|
997
|
+
const root = document.documentElement;
|
|
998
|
+
const { namespace } = brand;
|
|
999
|
+
const { overrides } = theme;
|
|
1000
|
+
if (overrides.primaryColors) {
|
|
1001
|
+
Object.entries(overrides.primaryColors).forEach(([key, value]) => {
|
|
1002
|
+
root.style.setProperty(`--brand-${namespace}-primary-${key}`, value);
|
|
1003
|
+
});
|
|
1004
|
+
}
|
|
1005
|
+
if (overrides.accentColors) {
|
|
1006
|
+
Object.entries(overrides.accentColors).forEach(([key, value]) => {
|
|
1007
|
+
root.style.setProperty(`--brand-${namespace}-accent-${key}`, value);
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
1010
|
+
if (overrides.secondaryColors) {
|
|
1011
|
+
Object.entries(overrides.secondaryColors).forEach(([key, value]) => {
|
|
1012
|
+
root.style.setProperty(`--brand-${namespace}-secondary-${key}`, value);
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
1015
|
+
const modeColors = mode === "day" ? overrides.baseColorsDay : overrides.baseColorsNight;
|
|
1016
|
+
if (modeColors) {
|
|
1017
|
+
Object.entries(modeColors).forEach(([key, value]) => {
|
|
1018
|
+
root.style.setProperty(`--brand-${namespace}-${key}`, value);
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
if (overrides.typography) {
|
|
1022
|
+
if (overrides.typography.fontFamily) {
|
|
1023
|
+
Object.entries(overrides.typography.fontFamily).forEach(([key, value]) => {
|
|
1024
|
+
root.style.setProperty(
|
|
1025
|
+
`--brand-${namespace}-font-${key}`,
|
|
1026
|
+
Array.isArray(value) ? value.join(", ") : value
|
|
1027
|
+
);
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
if (overrides.typography.fontSize) {
|
|
1031
|
+
Object.entries(overrides.typography.fontSize).forEach(([key, value]) => {
|
|
1032
|
+
const fontSizeValue = typeof value === "string" ? value : value[0];
|
|
1033
|
+
root.style.setProperty(`--brand-${namespace}-font-size-${key}`, fontSizeValue);
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
if (overrides.typography.fontWeight) {
|
|
1037
|
+
Object.entries(overrides.typography.fontWeight).forEach(([key, value]) => {
|
|
1038
|
+
root.style.setProperty(`--brand-${namespace}-font-weight-${key}`, value);
|
|
1039
|
+
});
|
|
1040
|
+
}
|
|
1041
|
+
if (overrides.typography.lineHeight) {
|
|
1042
|
+
Object.entries(overrides.typography.lineHeight).forEach(([key, value]) => {
|
|
1043
|
+
root.style.setProperty(`--brand-${namespace}-line-height-${key}`, value);
|
|
1044
|
+
});
|
|
1045
|
+
}
|
|
1046
|
+
if (overrides.typography.letterSpacing) {
|
|
1047
|
+
Object.entries(overrides.typography.letterSpacing).forEach(([key, value]) => {
|
|
1048
|
+
root.style.setProperty(`--brand-${namespace}-letter-spacing-${key}`, value);
|
|
1049
|
+
});
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
if (overrides.spacing) {
|
|
1053
|
+
if (overrides.spacing.semanticSpacing) {
|
|
1054
|
+
Object.entries(overrides.spacing.semanticSpacing).forEach(([key, value]) => {
|
|
1055
|
+
root.style.setProperty(`--brand-${namespace}-spacing-${key}`, value);
|
|
1056
|
+
});
|
|
1057
|
+
}
|
|
1058
|
+
if (overrides.spacing.layoutSpacing) {
|
|
1059
|
+
const layout = overrides.spacing.layoutSpacing;
|
|
1060
|
+
if (layout.section) {
|
|
1061
|
+
Object.entries(layout.section).forEach(([key, value]) => {
|
|
1062
|
+
if (typeof value === "string") {
|
|
1063
|
+
root.style.setProperty(`--brand-${namespace}-layout-section-${key}`, value);
|
|
1064
|
+
}
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1067
|
+
if (layout.container) {
|
|
1068
|
+
Object.entries(layout.container).forEach(([key, value]) => {
|
|
1069
|
+
if (typeof value === "string") {
|
|
1070
|
+
root.style.setProperty(`--brand-${namespace}-layout-container-${key}`, value);
|
|
1071
|
+
}
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
if (layout.grid) {
|
|
1075
|
+
Object.entries(layout.grid).forEach(([key, value]) => {
|
|
1076
|
+
if (typeof value === "string") {
|
|
1077
|
+
root.style.setProperty(`--brand-${namespace}-layout-grid-${key}`, value);
|
|
1078
|
+
}
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
if (layout.stack) {
|
|
1082
|
+
Object.entries(layout.stack).forEach(([key, value]) => {
|
|
1083
|
+
if (typeof value === "string") {
|
|
1084
|
+
root.style.setProperty(`--brand-${namespace}-layout-stack-${key}`, value);
|
|
1085
|
+
}
|
|
1086
|
+
});
|
|
1087
|
+
}
|
|
1088
|
+
if (layout.component) {
|
|
1089
|
+
Object.entries(layout.component).forEach(([key, value]) => {
|
|
1090
|
+
if (typeof value === "string") {
|
|
1091
|
+
root.style.setProperty(`--brand-${namespace}-layout-component-${key}`, value);
|
|
1092
|
+
}
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
if (overrides.shadows) {
|
|
1098
|
+
if (overrides.shadows.elevationShadows) {
|
|
1099
|
+
Object.entries(overrides.shadows.elevationShadows).forEach(([key, value]) => {
|
|
1100
|
+
root.style.setProperty(`--brand-${namespace}-shadow-${key}`, value);
|
|
1101
|
+
});
|
|
1102
|
+
}
|
|
1103
|
+
if (overrides.shadows.primaryColoredShadows) {
|
|
1104
|
+
Object.entries(overrides.shadows.primaryColoredShadows).forEach(([key, value]) => {
|
|
1105
|
+
root.style.setProperty(`--brand-${namespace}-shadow-primary-${key}`, value);
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
if (overrides.shadows.accentColoredShadows) {
|
|
1109
|
+
Object.entries(overrides.shadows.accentColoredShadows).forEach(([key, value]) => {
|
|
1110
|
+
root.style.setProperty(`--brand-${namespace}-shadow-accent-${key}`, value);
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
1113
|
+
if (overrides.shadows.glowEffects) {
|
|
1114
|
+
Object.entries(overrides.shadows.glowEffects).forEach(([key, value]) => {
|
|
1115
|
+
root.style.setProperty(`--brand-${namespace}-glow-${key}`, value);
|
|
1116
|
+
});
|
|
1117
|
+
}
|
|
1118
|
+
if (overrides.shadows.focusRings) {
|
|
1119
|
+
Object.entries(overrides.shadows.focusRings).forEach(([key, value]) => {
|
|
1120
|
+
root.style.setProperty(`--brand-${namespace}-focus-ring-${key}`, value);
|
|
1121
|
+
});
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
if (overrides.radius) {
|
|
1125
|
+
if (overrides.radius.borderRadius) {
|
|
1126
|
+
Object.entries(overrides.radius.borderRadius).forEach(([key, value]) => {
|
|
1127
|
+
root.style.setProperty(`--brand-${namespace}-radius-${key}`, value);
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1130
|
+
if (overrides.radius.componentRadius) {
|
|
1131
|
+
const { componentRadius } = overrides.radius;
|
|
1132
|
+
if (componentRadius.button) {
|
|
1133
|
+
Object.entries(componentRadius.button).forEach(([key, value]) => {
|
|
1134
|
+
root.style.setProperty(`--brand-${namespace}-radius-button-${key}`, value);
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
if (componentRadius.card) {
|
|
1138
|
+
Object.entries(componentRadius.card).forEach(([key, value]) => {
|
|
1139
|
+
root.style.setProperty(`--brand-${namespace}-radius-card-${key}`, value);
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
if (componentRadius.input) {
|
|
1143
|
+
Object.entries(componentRadius.input).forEach(([key, value]) => {
|
|
1144
|
+
root.style.setProperty(`--brand-${namespace}-radius-input-${key}`, value);
|
|
1145
|
+
});
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
setActiveBrand(brand);
|
|
1150
|
+
root.setAttribute("data-brand", brand.id);
|
|
1151
|
+
root.setAttribute("data-brand-namespace", namespace);
|
|
1152
|
+
}
|
|
1153
|
+
function removeBrandOverrides(namespace) {
|
|
1154
|
+
if (typeof document === "undefined") return;
|
|
1155
|
+
const root = document.documentElement;
|
|
1156
|
+
const { style } = root;
|
|
1157
|
+
const propsToRemove = [];
|
|
1158
|
+
for (let i = 0; i < style.length; i++) {
|
|
1159
|
+
const prop = style.item(i);
|
|
1160
|
+
if (prop && prop.startsWith(`--brand-${namespace}-`)) {
|
|
1161
|
+
propsToRemove.push(prop);
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
propsToRemove.forEach((prop) => {
|
|
1165
|
+
style.removeProperty(prop);
|
|
1166
|
+
});
|
|
1167
|
+
root.removeAttribute("data-brand");
|
|
1168
|
+
root.removeAttribute("data-brand-namespace");
|
|
1169
|
+
if (activeNamespace === namespace) {
|
|
1170
|
+
clearActiveBrand();
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
// src/themes/index.ts
|
|
1175
|
+
var themes = {
|
|
1176
|
+
default: () => Promise.resolve().then(() => (init_default(), default_exports)).then((m) => m.defaultTheme),
|
|
1177
|
+
dark: () => Promise.resolve().then(() => (init_dark(), dark_exports)).then((m) => m.darkTheme),
|
|
1178
|
+
brand: () => Promise.resolve().then(() => (init_brand(), brand_exports)).then((m) => m.brandTheme)
|
|
1179
|
+
};
|
|
1180
|
+
async function getTheme(name) {
|
|
1181
|
+
const themeLoader = themes[name];
|
|
1182
|
+
if (!themeLoader) {
|
|
1183
|
+
throw new Error(`Theme "${name}" not found`);
|
|
1184
|
+
}
|
|
1185
|
+
return await themeLoader();
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
// src/tokens/colors.ts
|
|
1189
|
+
var primaryColors = {
|
|
1190
|
+
50: "210 40% 98%",
|
|
1191
|
+
// Lightest blue
|
|
1192
|
+
100: "210 40% 96%",
|
|
1193
|
+
200: "217 32.6% 17.5%",
|
|
1194
|
+
300: "216 28% 26%",
|
|
1195
|
+
400: "215 25% 27%",
|
|
1196
|
+
500: "215 20% 35%",
|
|
1197
|
+
// Base primary
|
|
1198
|
+
600: "215 16% 47%",
|
|
1199
|
+
700: "216 12% 54%",
|
|
1200
|
+
800: "217 10% 62%",
|
|
1201
|
+
900: "222 47.4% 11.2%",
|
|
1202
|
+
950: "222 84% 4.9%"
|
|
1203
|
+
// Darkest blue
|
|
1204
|
+
};
|
|
1205
|
+
var accentColors = {
|
|
1206
|
+
50: "280 100% 98%",
|
|
1207
|
+
100: "280 65% 96%",
|
|
1208
|
+
200: "280 60% 85%",
|
|
1209
|
+
300: "280 55% 75%",
|
|
1210
|
+
400: "280 50% 65%",
|
|
1211
|
+
500: "280 70% 67%",
|
|
1212
|
+
// Base accent (night mode primary)
|
|
1213
|
+
600: "259 65% 58%",
|
|
1214
|
+
700: "259 60% 50%",
|
|
1215
|
+
800: "259 55% 45%",
|
|
1216
|
+
900: "259 50% 40%",
|
|
1217
|
+
950: "259 45% 30%"
|
|
1218
|
+
};
|
|
1219
|
+
var secondaryColors = {
|
|
1220
|
+
50: "173 100% 98%",
|
|
1221
|
+
100: "173 100% 95%",
|
|
1222
|
+
200: "173 100% 85%",
|
|
1223
|
+
300: "173 100% 70%",
|
|
1224
|
+
400: "173 100% 55%",
|
|
1225
|
+
500: "173 100% 37%",
|
|
1226
|
+
// Base secondary (Tenerife #00bfa6)
|
|
1227
|
+
600: "173 100% 32%",
|
|
1228
|
+
700: "173 95% 27%",
|
|
1229
|
+
800: "173 90% 22%",
|
|
1230
|
+
900: "173 85% 17%",
|
|
1231
|
+
950: "173 80% 12%"
|
|
1232
|
+
};
|
|
1233
|
+
var surfaceColors = {
|
|
1234
|
+
day: {
|
|
1235
|
+
base: "0 0% 100%",
|
|
1236
|
+
// White background
|
|
1237
|
+
elevated1: "0 0% 98%",
|
|
1238
|
+
// Slightly elevated
|
|
1239
|
+
elevated2: "0 0% 96%",
|
|
1240
|
+
// More elevated
|
|
1241
|
+
elevated3: "0 0% 94%",
|
|
1242
|
+
// Most elevated
|
|
1243
|
+
overlay: "0 0% 0% / 0.5",
|
|
1244
|
+
// Overlay backdrop
|
|
1245
|
+
glass: "0 0% 100% / 0.8"
|
|
1246
|
+
// Glass effect
|
|
1247
|
+
},
|
|
1248
|
+
night: {
|
|
1249
|
+
base: "240 10% 3.9%",
|
|
1250
|
+
// Dark background (#0b0b10)
|
|
1251
|
+
elevated1: "240 10% 5.1%",
|
|
1252
|
+
// #0e1016
|
|
1253
|
+
elevated2: "240 10% 6.3%",
|
|
1254
|
+
// Slightly lighter
|
|
1255
|
+
elevated3: "240 10% 7.5%",
|
|
1256
|
+
// Even lighter
|
|
1257
|
+
overlay: "0 0% 0% / 0.7",
|
|
1258
|
+
// Darker overlay
|
|
1259
|
+
glass: "240 10% 10% / 0.9"
|
|
1260
|
+
// Dark glass effect
|
|
1261
|
+
}
|
|
1262
|
+
};
|
|
1263
|
+
var semanticColors = {
|
|
1264
|
+
day: {
|
|
1265
|
+
success: "142 70% 28%",
|
|
1266
|
+
// Darker green for better contrast
|
|
1267
|
+
successForeground: "0 0% 100%",
|
|
1268
|
+
error: "0 80% 40%",
|
|
1269
|
+
// Richer red for contrast
|
|
1270
|
+
errorForeground: "0 0% 100%",
|
|
1271
|
+
warning: "38 92% 50%",
|
|
1272
|
+
// Orange
|
|
1273
|
+
warningForeground: "0 0% 9%",
|
|
1274
|
+
info: "199 89% 48%",
|
|
1275
|
+
// Blue
|
|
1276
|
+
infoForeground: "0 0% 100%"
|
|
1277
|
+
},
|
|
1278
|
+
night: {
|
|
1279
|
+
success: "142 70% 45%",
|
|
1280
|
+
successForeground: "0 0% 100%",
|
|
1281
|
+
error: "0 62.8% 30.6%",
|
|
1282
|
+
// Darker red
|
|
1283
|
+
errorForeground: "0 0% 98%",
|
|
1284
|
+
warning: "38 92% 33%",
|
|
1285
|
+
// Darker orange for WCAG AA contrast with white text
|
|
1286
|
+
warningForeground: "0 0% 100%",
|
|
1287
|
+
// Light foreground for dark theme readability
|
|
1288
|
+
info: "199 89% 35%",
|
|
1289
|
+
// Darker blue for WCAG AA contrast with white text
|
|
1290
|
+
infoForeground: "0 0% 100%"
|
|
1291
|
+
// Light foreground for dark theme readability
|
|
1292
|
+
}
|
|
1293
|
+
};
|
|
1294
|
+
var chartColors = {
|
|
1295
|
+
day: {
|
|
1296
|
+
chart1: "12 76% 61%",
|
|
1297
|
+
// Orange-red
|
|
1298
|
+
chart2: "173 58% 39%",
|
|
1299
|
+
// Teal-cyan
|
|
1300
|
+
chart3: "197 37% 24%",
|
|
1301
|
+
// Dark blue
|
|
1302
|
+
chart4: "43 74% 66%",
|
|
1303
|
+
// Yellow
|
|
1304
|
+
chart5: "27 87% 67%"
|
|
1305
|
+
// Orange
|
|
1306
|
+
},
|
|
1307
|
+
night: {
|
|
1308
|
+
chart1: "220 70% 50%",
|
|
1309
|
+
// Blue
|
|
1310
|
+
chart2: "160 60% 45%",
|
|
1311
|
+
// Teal
|
|
1312
|
+
chart3: "30 80% 55%",
|
|
1313
|
+
// Orange
|
|
1314
|
+
chart4: "280 65% 60%",
|
|
1315
|
+
// Purple
|
|
1316
|
+
chart5: "340 75% 55%"
|
|
1317
|
+
// Pink
|
|
1318
|
+
}
|
|
1319
|
+
};
|
|
1320
|
+
var textColors = {
|
|
1321
|
+
day: {
|
|
1322
|
+
primary: "0 0% 9%",
|
|
1323
|
+
// Almost black
|
|
1324
|
+
secondary: "0 0% 45%",
|
|
1325
|
+
// Medium gray
|
|
1326
|
+
tertiary: "0 0% 65%",
|
|
1327
|
+
// Light gray
|
|
1328
|
+
muted: "0 0% 38%",
|
|
1329
|
+
// Muted gray with stronger contrast
|
|
1330
|
+
inverse: "0 0% 100%"
|
|
1331
|
+
// White (for dark backgrounds)
|
|
1332
|
+
},
|
|
1333
|
+
night: {
|
|
1334
|
+
primary: "0 0% 89.8%",
|
|
1335
|
+
// Light gray (#e5e7eb)
|
|
1336
|
+
secondary: "240 5% 64.9%",
|
|
1337
|
+
// Medium gray
|
|
1338
|
+
tertiary: "240 5% 50%",
|
|
1339
|
+
// Darker gray
|
|
1340
|
+
muted: "240 5% 64.9%",
|
|
1341
|
+
// Muted gray
|
|
1342
|
+
inverse: "0 0% 9%"
|
|
1343
|
+
// Almost black (for light backgrounds)
|
|
1344
|
+
}
|
|
1345
|
+
};
|
|
1346
|
+
var baseColors = {
|
|
1347
|
+
day: {
|
|
1348
|
+
background: "0 0% 100%",
|
|
1349
|
+
foreground: "0 0% 9%",
|
|
1350
|
+
card: "0 0% 100%",
|
|
1351
|
+
cardForeground: "0 0% 9%",
|
|
1352
|
+
popover: "0 0% 100%",
|
|
1353
|
+
popoverForeground: "0 0% 9%",
|
|
1354
|
+
border: "0 0% 89.8%",
|
|
1355
|
+
input: "0 0% 89.8%",
|
|
1356
|
+
ring: "0 0% 3.9%"
|
|
1357
|
+
},
|
|
1358
|
+
night: {
|
|
1359
|
+
background: "240 10% 3.9%",
|
|
1360
|
+
// #0b0b10
|
|
1361
|
+
foreground: "0 0% 89.8%",
|
|
1362
|
+
// #e5e7eb
|
|
1363
|
+
card: "240 10% 3.9%",
|
|
1364
|
+
cardForeground: "0 0% 89.8%",
|
|
1365
|
+
popover: "240 10% 5.1%",
|
|
1366
|
+
// #0e1016
|
|
1367
|
+
popoverForeground: "0 0% 89.8%",
|
|
1368
|
+
border: "240 3.7% 15.9%",
|
|
1369
|
+
input: "240 3.7% 15.9%",
|
|
1370
|
+
ring: "240 4.9% 83.9%"
|
|
1371
|
+
}
|
|
1372
|
+
};
|
|
1373
|
+
var cssVariableColorTokens = {
|
|
1374
|
+
day: {
|
|
1375
|
+
...baseColors.day,
|
|
1376
|
+
primary: "hsl(var(--tm-primary))",
|
|
1377
|
+
primaryForeground: "hsl(var(--tm-primary-foreground))",
|
|
1378
|
+
secondary: "hsl(var(--tm-secondary))",
|
|
1379
|
+
secondaryForeground: "hsl(var(--tm-secondary-foreground))",
|
|
1380
|
+
muted: "hsl(var(--muted))",
|
|
1381
|
+
mutedForeground: "hsl(var(--muted-foreground))",
|
|
1382
|
+
accent: "hsl(var(--tm-accent))",
|
|
1383
|
+
accentForeground: "hsl(var(--tm-accent-foreground))",
|
|
1384
|
+
destructive: `hsl(${semanticColors.day.error})`,
|
|
1385
|
+
destructiveForeground: semanticColors.day.errorForeground,
|
|
1386
|
+
chart1: `hsl(${chartColors.day.chart1})`,
|
|
1387
|
+
chart2: `hsl(${chartColors.day.chart2})`,
|
|
1388
|
+
chart3: `hsl(${chartColors.day.chart3})`,
|
|
1389
|
+
chart4: `hsl(${chartColors.day.chart4})`,
|
|
1390
|
+
chart5: `hsl(${chartColors.day.chart5})`
|
|
1391
|
+
},
|
|
1392
|
+
night: {
|
|
1393
|
+
...baseColors.night,
|
|
1394
|
+
primary: "hsl(var(--tm-primary))",
|
|
1395
|
+
primaryForeground: "hsl(var(--tm-primary-foreground))",
|
|
1396
|
+
secondary: "hsl(var(--tm-secondary))",
|
|
1397
|
+
secondaryForeground: "hsl(var(--tm-secondary-foreground))",
|
|
1398
|
+
muted: "hsl(var(--muted))",
|
|
1399
|
+
mutedForeground: "hsl(var(--muted-foreground))",
|
|
1400
|
+
accent: "hsl(var(--tm-accent))",
|
|
1401
|
+
accentForeground: "hsl(var(--tm-accent-foreground))",
|
|
1402
|
+
destructive: `hsl(${semanticColors.night.error})`,
|
|
1403
|
+
destructiveForeground: semanticColors.night.errorForeground,
|
|
1404
|
+
chart1: `hsl(${chartColors.night.chart1})`,
|
|
1405
|
+
chart2: `hsl(${chartColors.night.chart2})`,
|
|
1406
|
+
chart3: `hsl(${chartColors.night.chart3})`,
|
|
1407
|
+
chart4: `hsl(${chartColors.night.chart4})`,
|
|
1408
|
+
chart5: `hsl(${chartColors.night.chart5})`
|
|
1409
|
+
}
|
|
1410
|
+
};
|
|
1411
|
+
({
|
|
1412
|
+
// Primary scale
|
|
1413
|
+
"--primary-50": primaryColors[50],
|
|
1414
|
+
"--primary-100": primaryColors[100],
|
|
1415
|
+
"--primary-200": primaryColors[200],
|
|
1416
|
+
"--primary-300": primaryColors[300],
|
|
1417
|
+
"--primary-400": primaryColors[400],
|
|
1418
|
+
"--primary-500": primaryColors[500],
|
|
1419
|
+
"--primary-600": primaryColors[600],
|
|
1420
|
+
"--primary-700": primaryColors[700],
|
|
1421
|
+
"--primary-800": primaryColors[800],
|
|
1422
|
+
"--primary-900": primaryColors[900],
|
|
1423
|
+
"--primary-950": primaryColors[950],
|
|
1424
|
+
// Accent scale
|
|
1425
|
+
"--accent-50": accentColors[50],
|
|
1426
|
+
"--accent-100": accentColors[100],
|
|
1427
|
+
"--accent-200": accentColors[200],
|
|
1428
|
+
"--accent-300": accentColors[300],
|
|
1429
|
+
"--accent-400": accentColors[400],
|
|
1430
|
+
"--accent-500": accentColors[500],
|
|
1431
|
+
"--accent-600": accentColors[600],
|
|
1432
|
+
"--accent-700": accentColors[700],
|
|
1433
|
+
"--accent-800": accentColors[800],
|
|
1434
|
+
"--accent-900": accentColors[900],
|
|
1435
|
+
"--accent-950": accentColors[950],
|
|
1436
|
+
// Secondary scale
|
|
1437
|
+
"--secondary-50": secondaryColors[50],
|
|
1438
|
+
"--secondary-100": secondaryColors[100],
|
|
1439
|
+
"--secondary-200": secondaryColors[200],
|
|
1440
|
+
"--secondary-300": secondaryColors[300],
|
|
1441
|
+
"--secondary-400": secondaryColors[400],
|
|
1442
|
+
"--secondary-500": secondaryColors[500],
|
|
1443
|
+
"--secondary-600": secondaryColors[600],
|
|
1444
|
+
"--secondary-700": secondaryColors[700],
|
|
1445
|
+
"--secondary-800": secondaryColors[800],
|
|
1446
|
+
"--secondary-900": secondaryColors[900],
|
|
1447
|
+
"--secondary-950": secondaryColors[950]
|
|
1448
|
+
// Surface colors (mode-dependent, set dynamically by theme system)
|
|
1449
|
+
// Note: These are set via updateCSSVariablesFromTokens() in applyMode.ts
|
|
1450
|
+
// Semantic colors (mode-dependent, set dynamically by theme system)
|
|
1451
|
+
// Note: These are set via updateCSSVariablesFromTokens() in applyMode.ts
|
|
1452
|
+
// Text colors (mode-dependent, set dynamically by theme system)
|
|
1453
|
+
// Note: These are set via updateCSSVariablesFromTokens() in applyMode.ts
|
|
1454
|
+
// Chart colors (mode-dependent, set dynamically by theme system)
|
|
1455
|
+
// Note: These are set via updateCSSVariablesFromTokens() in applyMode.ts
|
|
1456
|
+
});
|
|
1457
|
+
var tailwindThemeColors = {
|
|
1458
|
+
// Base colors
|
|
1459
|
+
background: "hsl(var(--background))",
|
|
1460
|
+
foreground: "hsl(var(--foreground))",
|
|
1461
|
+
// Card colors
|
|
1462
|
+
card: {
|
|
1463
|
+
DEFAULT: "hsl(var(--card))",
|
|
1464
|
+
foreground: "hsl(var(--card-foreground))"
|
|
1465
|
+
},
|
|
1466
|
+
// Popover colors
|
|
1467
|
+
popover: {
|
|
1468
|
+
DEFAULT: "hsl(var(--popover))",
|
|
1469
|
+
foreground: "hsl(var(--popover-foreground))"
|
|
1470
|
+
},
|
|
1471
|
+
// Primary colors (using CSS variables)
|
|
1472
|
+
primary: {
|
|
1473
|
+
DEFAULT: "hsl(var(--tm-primary))",
|
|
1474
|
+
foreground: "hsl(var(--tm-primary-foreground))",
|
|
1475
|
+
50: `hsl(var(--primary-50))`,
|
|
1476
|
+
100: `hsl(var(--primary-100))`,
|
|
1477
|
+
200: `hsl(var(--primary-200))`,
|
|
1478
|
+
300: `hsl(var(--primary-300))`,
|
|
1479
|
+
400: `hsl(var(--primary-400))`,
|
|
1480
|
+
500: `hsl(var(--primary-500))`,
|
|
1481
|
+
600: `hsl(var(--primary-600))`,
|
|
1482
|
+
700: `hsl(var(--primary-700))`,
|
|
1483
|
+
800: `hsl(var(--primary-800))`,
|
|
1484
|
+
900: `hsl(var(--primary-900))`,
|
|
1485
|
+
950: `hsl(var(--primary-950))`
|
|
1486
|
+
},
|
|
1487
|
+
// Secondary colors
|
|
1488
|
+
secondary: {
|
|
1489
|
+
DEFAULT: "hsl(var(--tm-secondary))",
|
|
1490
|
+
foreground: "hsl(var(--tm-secondary-foreground))",
|
|
1491
|
+
50: `hsl(var(--secondary-50))`,
|
|
1492
|
+
100: `hsl(var(--secondary-100))`,
|
|
1493
|
+
200: `hsl(var(--secondary-200))`,
|
|
1494
|
+
300: `hsl(var(--secondary-300))`,
|
|
1495
|
+
400: `hsl(var(--secondary-400))`,
|
|
1496
|
+
500: `hsl(var(--secondary-500))`,
|
|
1497
|
+
600: `hsl(var(--secondary-600))`,
|
|
1498
|
+
700: `hsl(var(--secondary-700))`,
|
|
1499
|
+
800: `hsl(var(--secondary-800))`,
|
|
1500
|
+
900: `hsl(var(--secondary-900))`,
|
|
1501
|
+
950: `hsl(var(--secondary-950))`
|
|
1502
|
+
},
|
|
1503
|
+
// Accent colors
|
|
1504
|
+
accent: {
|
|
1505
|
+
DEFAULT: "hsl(var(--tm-accent))",
|
|
1506
|
+
foreground: "hsl(var(--tm-accent-foreground))",
|
|
1507
|
+
50: `hsl(var(--accent-50))`,
|
|
1508
|
+
100: `hsl(var(--accent-100))`,
|
|
1509
|
+
200: `hsl(var(--accent-200))`,
|
|
1510
|
+
300: `hsl(var(--accent-300))`,
|
|
1511
|
+
400: `hsl(var(--accent-400))`,
|
|
1512
|
+
500: `hsl(var(--accent-500))`,
|
|
1513
|
+
600: `hsl(var(--accent-600))`,
|
|
1514
|
+
700: `hsl(var(--accent-700))`,
|
|
1515
|
+
800: `hsl(var(--accent-800))`,
|
|
1516
|
+
900: `hsl(var(--accent-900))`,
|
|
1517
|
+
950: `hsl(var(--accent-950))`
|
|
1518
|
+
},
|
|
1519
|
+
// Muted colors
|
|
1520
|
+
muted: {
|
|
1521
|
+
DEFAULT: "hsl(var(--muted))",
|
|
1522
|
+
foreground: "hsl(var(--muted-foreground))"
|
|
1523
|
+
},
|
|
1524
|
+
// Destructive colors (semantic error)
|
|
1525
|
+
destructive: {
|
|
1526
|
+
DEFAULT: "hsl(var(--destructive))",
|
|
1527
|
+
foreground: "hsl(var(--destructive-foreground))"
|
|
1528
|
+
},
|
|
1529
|
+
// Semantic colors
|
|
1530
|
+
success: {
|
|
1531
|
+
DEFAULT: `hsl(var(--semantic-success))`,
|
|
1532
|
+
foreground: `hsl(var(--semantic-success-foreground))`
|
|
1533
|
+
},
|
|
1534
|
+
error: {
|
|
1535
|
+
DEFAULT: `hsl(var(--semantic-error))`,
|
|
1536
|
+
foreground: `hsl(var(--semantic-error-foreground))`
|
|
1537
|
+
},
|
|
1538
|
+
warning: {
|
|
1539
|
+
DEFAULT: `hsl(var(--semantic-warning))`,
|
|
1540
|
+
foreground: `hsl(var(--semantic-warning-foreground))`
|
|
1541
|
+
},
|
|
1542
|
+
info: {
|
|
1543
|
+
DEFAULT: `hsl(var(--semantic-info))`,
|
|
1544
|
+
foreground: `hsl(var(--semantic-info-foreground))`
|
|
1545
|
+
},
|
|
1546
|
+
// Surface colors
|
|
1547
|
+
surface: {
|
|
1548
|
+
base: `hsl(var(--surface-base))`,
|
|
1549
|
+
elevated1: `hsl(var(--surface-elevated1))`,
|
|
1550
|
+
elevated2: `hsl(var(--surface-elevated2))`,
|
|
1551
|
+
elevated3: `hsl(var(--surface-elevated3))`,
|
|
1552
|
+
overlay: `hsl(var(--surface-overlay))`,
|
|
1553
|
+
glass: `hsl(var(--surface-glass))`
|
|
1554
|
+
},
|
|
1555
|
+
// Text colors
|
|
1556
|
+
text: {
|
|
1557
|
+
primary: `hsl(var(--text-primary))`,
|
|
1558
|
+
secondary: `hsl(var(--text-secondary))`,
|
|
1559
|
+
tertiary: `hsl(var(--text-tertiary))`,
|
|
1560
|
+
muted: `hsl(var(--text-muted))`,
|
|
1561
|
+
destructive: `hsl(var(--destructive))`,
|
|
1562
|
+
accent: `hsl(var(--tm-accent))`,
|
|
1563
|
+
inverse: `hsl(var(--text-inverse))`
|
|
1564
|
+
},
|
|
1565
|
+
// Border and input
|
|
1566
|
+
border: "hsl(var(--border))",
|
|
1567
|
+
input: "hsl(var(--input))",
|
|
1568
|
+
ring: "hsl(var(--ring))",
|
|
1569
|
+
// Chart colors (using CSS variables)
|
|
1570
|
+
chart: {
|
|
1571
|
+
1: `hsl(var(--chart-1))`,
|
|
1572
|
+
2: `hsl(var(--chart-2))`,
|
|
1573
|
+
3: `hsl(var(--chart-3))`,
|
|
1574
|
+
4: `hsl(var(--chart-4))`,
|
|
1575
|
+
5: `hsl(var(--chart-5))`
|
|
1576
|
+
}
|
|
1577
|
+
};
|
|
1578
|
+
|
|
1579
|
+
// src/tokens/motion.ts
|
|
1580
|
+
var durations = {
|
|
1581
|
+
instant: "0ms",
|
|
1582
|
+
fast: "150ms",
|
|
1583
|
+
// 1.5 × base (quick interactions)
|
|
1584
|
+
normal: "300ms",
|
|
1585
|
+
// 3 × base (default)
|
|
1586
|
+
slow: "500ms",
|
|
1587
|
+
// 5 × base (emphasized)
|
|
1588
|
+
slower: "700ms",
|
|
1589
|
+
// 7 × base (very emphasized)
|
|
1590
|
+
slowest: "1000ms",
|
|
1591
|
+
// 10 × base (maximum emphasis)
|
|
1592
|
+
// Additional granular durations
|
|
1593
|
+
"75": "75ms",
|
|
1594
|
+
// Ultra-fast
|
|
1595
|
+
"100": "100ms",
|
|
1596
|
+
// Base unit
|
|
1597
|
+
"200": "200ms",
|
|
1598
|
+
// Fast-normal
|
|
1599
|
+
"250": "250ms",
|
|
1600
|
+
// Between fast and normal
|
|
1601
|
+
"400": "400ms",
|
|
1602
|
+
// Between normal and slow
|
|
1603
|
+
"600": "600ms",
|
|
1604
|
+
// Between slow and slower
|
|
1605
|
+
"800": "800ms"
|
|
1606
|
+
// Between slower and slowest
|
|
1607
|
+
};
|
|
1608
|
+
var easings = {
|
|
1609
|
+
// Linear (no easing)
|
|
1610
|
+
linear: "linear",
|
|
1611
|
+
// Ease-in (accelerate) - cubic-bezier
|
|
1612
|
+
"ease-in": "cubic-bezier(0.4, 0, 1, 1)",
|
|
1613
|
+
// Ease-out (decelerate) - recommended for most UI - cubic-bezier
|
|
1614
|
+
"ease-out": "cubic-bezier(0, 0, 0.2, 1)",
|
|
1615
|
+
// Ease-in-out (accelerate and decelerate)
|
|
1616
|
+
"ease-in-out": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
1617
|
+
// Advanced easing functions
|
|
1618
|
+
bounce: "cubic-bezier(0.68, -0.55, 0.265, 1.55)",
|
|
1619
|
+
elastic: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
|
|
1620
|
+
// Material Design easing
|
|
1621
|
+
"ease-out-cubic": "cubic-bezier(0.215, 0.61, 0.355, 1)",
|
|
1622
|
+
"ease-in-cubic": "cubic-bezier(0.55, 0.055, 0.675, 0.19)",
|
|
1623
|
+
"ease-in-out-cubic": "cubic-bezier(0.645, 0.045, 0.355, 1)"
|
|
1624
|
+
};
|
|
1625
|
+
var transitions = {
|
|
1626
|
+
// Fast transitions (quick interactions)
|
|
1627
|
+
fast: `${durations.fast} ${easings["ease-out"]}`,
|
|
1628
|
+
"fast-in": `${durations.fast} ${easings["ease-in"]}`,
|
|
1629
|
+
"fast-out": `${durations.fast} ${easings["ease-out"]}`,
|
|
1630
|
+
"fast-in-out": `${durations.fast} ${easings["ease-in-out"]}`,
|
|
1631
|
+
// Normal transitions (default)
|
|
1632
|
+
normal: `${durations.normal} ${easings["ease-in-out"]}`,
|
|
1633
|
+
"normal-in": `${durations.normal} ${easings["ease-in"]}`,
|
|
1634
|
+
"normal-out": `${durations.normal} ${easings["ease-out"]}`,
|
|
1635
|
+
"normal-in-out": `${durations.normal} ${easings["ease-in-out"]}`,
|
|
1636
|
+
// Slow transitions (emphasized)
|
|
1637
|
+
slow: `${durations.slow} ${easings["ease-in-out"]}`,
|
|
1638
|
+
"slow-in": `${durations.slow} ${easings["ease-in"]}`,
|
|
1639
|
+
"slow-out": `${durations.slow} ${easings["ease-out"]}`,
|
|
1640
|
+
"slow-in-out": `${durations.slow} ${easings["ease-in-out"]}`,
|
|
1641
|
+
// Special transitions
|
|
1642
|
+
bounce: `${durations.normal} ${easings.bounce}`,
|
|
1643
|
+
elastic: `${durations.slow} ${easings.elastic}`,
|
|
1644
|
+
// Default (normal)
|
|
1645
|
+
DEFAULT: `${durations.normal} ${easings["ease-in-out"]}`
|
|
1646
|
+
};
|
|
1647
|
+
var motionCSSVariables = {
|
|
1648
|
+
// Durations
|
|
1649
|
+
"--duration-instant": durations.instant,
|
|
1650
|
+
"--duration-fast": durations.fast,
|
|
1651
|
+
"--duration-normal": durations.normal,
|
|
1652
|
+
"--duration-slow": durations.slow,
|
|
1653
|
+
"--duration-slower": durations.slower,
|
|
1654
|
+
"--duration-slowest": durations.slowest,
|
|
1655
|
+
// Additional granular durations
|
|
1656
|
+
"--duration-75": durations["75"],
|
|
1657
|
+
"--duration-100": durations["100"],
|
|
1658
|
+
"--duration-200": durations["200"],
|
|
1659
|
+
"--duration-250": durations["250"],
|
|
1660
|
+
"--duration-400": durations["400"],
|
|
1661
|
+
"--duration-600": durations["600"],
|
|
1662
|
+
"--duration-800": durations["800"],
|
|
1663
|
+
// Easings
|
|
1664
|
+
"--ease-linear": easings.linear,
|
|
1665
|
+
"--ease-in": easings["ease-in"],
|
|
1666
|
+
"--ease-out": easings["ease-out"],
|
|
1667
|
+
"--ease-in-out": easings["ease-in-out"],
|
|
1668
|
+
"--ease-bounce": easings.bounce,
|
|
1669
|
+
"--ease-elastic": easings.elastic,
|
|
1670
|
+
"--ease-out-cubic": easings["ease-out-cubic"],
|
|
1671
|
+
"--ease-in-cubic": easings["ease-in-cubic"],
|
|
1672
|
+
"--ease-in-out-cubic": easings["ease-in-out-cubic"],
|
|
1673
|
+
// Transitions
|
|
1674
|
+
"--transition-fast": transitions.fast,
|
|
1675
|
+
"--transition-normal": transitions.normal,
|
|
1676
|
+
"--transition-slow": transitions.slow,
|
|
1677
|
+
"--transition-default": transitions.DEFAULT,
|
|
1678
|
+
"--transition-fast-in": transitions["fast-in"],
|
|
1679
|
+
"--transition-fast-out": transitions["fast-out"],
|
|
1680
|
+
"--transition-fast-in-out": transitions["fast-in-out"],
|
|
1681
|
+
"--transition-normal-in": transitions["normal-in"],
|
|
1682
|
+
"--transition-normal-out": transitions["normal-out"],
|
|
1683
|
+
"--transition-normal-in-out": transitions["normal-in-out"],
|
|
1684
|
+
"--transition-slow-in": transitions["slow-in"],
|
|
1685
|
+
"--transition-slow-out": transitions["slow-out"],
|
|
1686
|
+
"--transition-slow-in-out": transitions["slow-in-out"],
|
|
1687
|
+
"--transition-bounce": transitions.bounce,
|
|
1688
|
+
"--transition-elastic": transitions.elastic
|
|
1689
|
+
};
|
|
1690
|
+
|
|
1691
|
+
// src/theme/applyMode.ts
|
|
1692
|
+
var MODE_ATTRIBUTE = "data-mode";
|
|
1693
|
+
var THEME_ATTRIBUTE = "data-theme-name";
|
|
1694
|
+
var MODE_THEME_ATTRIBUTE = "data-theme";
|
|
1695
|
+
var DARK_CLASS = "dark";
|
|
1696
|
+
function getInitialMode(defaultMode = "day", storageKey = "tm_mode", enableSystem = true) {
|
|
1697
|
+
if (typeof window === "undefined") return defaultMode;
|
|
1698
|
+
const root = document.documentElement;
|
|
1699
|
+
const attr = root.getAttribute(MODE_ATTRIBUTE);
|
|
1700
|
+
if (attr === "day" || attr === "night") {
|
|
1701
|
+
return attr;
|
|
1702
|
+
}
|
|
1703
|
+
const themeAttr = root.getAttribute(MODE_THEME_ATTRIBUTE);
|
|
1704
|
+
if (themeAttr === "day" || themeAttr === "night") {
|
|
1705
|
+
return themeAttr;
|
|
1706
|
+
}
|
|
1707
|
+
try {
|
|
1708
|
+
const stored = localStorage.getItem(storageKey);
|
|
1709
|
+
if (stored === "day" || stored === "night") {
|
|
1710
|
+
return stored;
|
|
1711
|
+
}
|
|
1712
|
+
const legacy = localStorage.getItem("theme");
|
|
1713
|
+
if (legacy === "dark") return "night";
|
|
1714
|
+
if (legacy === "light") return "day";
|
|
1715
|
+
} catch {
|
|
1716
|
+
}
|
|
1717
|
+
if (enableSystem && typeof window !== "undefined") {
|
|
1718
|
+
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
1719
|
+
return prefersDark ? "night" : "day";
|
|
1720
|
+
}
|
|
1721
|
+
return defaultMode;
|
|
1722
|
+
}
|
|
1723
|
+
var currentThemeOverride = null;
|
|
1724
|
+
async function loadThemeOverride(themeName) {
|
|
1725
|
+
if (themeName === "default") {
|
|
1726
|
+
currentThemeOverride = null;
|
|
1727
|
+
return null;
|
|
1728
|
+
}
|
|
1729
|
+
try {
|
|
1730
|
+
const theme = await getTheme(themeName);
|
|
1731
|
+
currentThemeOverride = theme;
|
|
1732
|
+
return theme;
|
|
1733
|
+
} catch (error) {
|
|
1734
|
+
console.warn(`Failed to load theme "${themeName}":`, error);
|
|
1735
|
+
currentThemeOverride = null;
|
|
1736
|
+
return null;
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
function mergeColorScale(base, override) {
|
|
1740
|
+
if (!override) return base;
|
|
1741
|
+
return { ...base, ...override };
|
|
1742
|
+
}
|
|
1743
|
+
function mergeObject(base, override) {
|
|
1744
|
+
if (!override) return base;
|
|
1745
|
+
return { ...base, ...override };
|
|
1746
|
+
}
|
|
1747
|
+
function getMergedTokens(_mode) {
|
|
1748
|
+
const override = currentThemeOverride;
|
|
1749
|
+
const primaryColors2 = mergeColorScale(primaryColors, override?.primaryColors);
|
|
1750
|
+
const accentColors2 = mergeColorScale(accentColors, override?.accentColors);
|
|
1751
|
+
const secondaryColors2 = mergeColorScale(secondaryColors, override?.secondaryColors);
|
|
1752
|
+
const baseColors2 = {
|
|
1753
|
+
day: mergeObject(baseColors.day, override?.baseColorsDay),
|
|
1754
|
+
night: mergeObject(baseColors.night, override?.baseColorsNight)
|
|
1755
|
+
};
|
|
1756
|
+
const surfaceColors2 = {
|
|
1757
|
+
day: mergeObject(surfaceColors.day, override?.surfaceColorsDay),
|
|
1758
|
+
night: mergeObject(surfaceColors.night, override?.surfaceColorsNight)
|
|
1759
|
+
};
|
|
1760
|
+
const semanticColors2 = {
|
|
1761
|
+
day: mergeObject(semanticColors.day, override?.semanticColorsDay),
|
|
1762
|
+
night: mergeObject(semanticColors.night, override?.semanticColorsNight)
|
|
1763
|
+
};
|
|
1764
|
+
const textColors2 = {
|
|
1765
|
+
day: mergeObject(textColors.day, override?.textColorsDay),
|
|
1766
|
+
night: mergeObject(textColors.night, override?.textColorsNight)
|
|
1767
|
+
};
|
|
1768
|
+
const chartColors2 = {
|
|
1769
|
+
day: chartColors.day,
|
|
1770
|
+
night: chartColors.night
|
|
1771
|
+
};
|
|
1772
|
+
return {
|
|
1773
|
+
primaryColors: primaryColors2,
|
|
1774
|
+
accentColors: accentColors2,
|
|
1775
|
+
secondaryColors: secondaryColors2,
|
|
1776
|
+
baseColors: baseColors2,
|
|
1777
|
+
surfaceColors: surfaceColors2,
|
|
1778
|
+
semanticColors: semanticColors2,
|
|
1779
|
+
textColors: textColors2,
|
|
1780
|
+
chartColors: chartColors2
|
|
1781
|
+
};
|
|
1782
|
+
}
|
|
1783
|
+
function updateCSSVariablesFromTokens(mode) {
|
|
1784
|
+
if (typeof document === "undefined") return;
|
|
1785
|
+
const root = document.documentElement;
|
|
1786
|
+
const tokens = getMergedTokens();
|
|
1787
|
+
const {
|
|
1788
|
+
primaryColors: primaryColors2,
|
|
1789
|
+
accentColors: accentColors2,
|
|
1790
|
+
secondaryColors: secondaryColors2,
|
|
1791
|
+
baseColors: baseColors2,
|
|
1792
|
+
surfaceColors: surfaceColors2,
|
|
1793
|
+
semanticColors: semanticColors2,
|
|
1794
|
+
textColors: textColors2,
|
|
1795
|
+
chartColors: chartColors2
|
|
1796
|
+
} = tokens;
|
|
1797
|
+
const base = baseColors2[mode];
|
|
1798
|
+
root.style.setProperty("--background", base.background);
|
|
1799
|
+
root.style.setProperty("--foreground", base.foreground);
|
|
1800
|
+
root.style.setProperty("--card", base.card);
|
|
1801
|
+
root.style.setProperty("--card-foreground", base.cardForeground);
|
|
1802
|
+
root.style.setProperty("--popover", base.popover);
|
|
1803
|
+
root.style.setProperty("--popover-foreground", base.popoverForeground);
|
|
1804
|
+
root.style.setProperty("--border", base.border);
|
|
1805
|
+
root.style.setProperty("--input", base.input);
|
|
1806
|
+
root.style.setProperty("--ring", base.ring);
|
|
1807
|
+
const surface = surfaceColors2[mode];
|
|
1808
|
+
root.style.setProperty("--surface-base", surface.base);
|
|
1809
|
+
root.style.setProperty("--surface-elevated1", surface.elevated1);
|
|
1810
|
+
root.style.setProperty("--surface-elevated2", surface.elevated2);
|
|
1811
|
+
root.style.setProperty("--surface-elevated3", surface.elevated3);
|
|
1812
|
+
root.style.setProperty("--surface-overlay", surface.overlay);
|
|
1813
|
+
root.style.setProperty("--surface-glass", surface.glass);
|
|
1814
|
+
const semantic = semanticColors2[mode];
|
|
1815
|
+
root.style.setProperty("--semantic-success", semantic.success);
|
|
1816
|
+
root.style.setProperty("--semantic-success-foreground", semantic.successForeground);
|
|
1817
|
+
root.style.setProperty("--semantic-error", semantic.error);
|
|
1818
|
+
root.style.setProperty("--semantic-error-foreground", semantic.errorForeground);
|
|
1819
|
+
root.style.setProperty("--semantic-warning", semantic.warning);
|
|
1820
|
+
root.style.setProperty("--semantic-warning-foreground", semantic.warningForeground);
|
|
1821
|
+
root.style.setProperty("--semantic-info", semantic.info);
|
|
1822
|
+
root.style.setProperty("--semantic-info-foreground", semantic.infoForeground);
|
|
1823
|
+
const text = textColors2[mode];
|
|
1824
|
+
root.style.setProperty("--text-primary", text.primary);
|
|
1825
|
+
root.style.setProperty("--text-secondary", text.secondary);
|
|
1826
|
+
root.style.setProperty("--text-tertiary", text.tertiary);
|
|
1827
|
+
root.style.setProperty("--text-muted", text.muted);
|
|
1828
|
+
root.style.setProperty("--text-inverse", text.inverse);
|
|
1829
|
+
const chart = chartColors2[mode];
|
|
1830
|
+
root.style.setProperty("--chart-1", chart.chart1);
|
|
1831
|
+
root.style.setProperty("--chart-2", chart.chart2);
|
|
1832
|
+
root.style.setProperty("--chart-3", chart.chart3);
|
|
1833
|
+
root.style.setProperty("--chart-4", chart.chart4);
|
|
1834
|
+
root.style.setProperty("--chart-5", chart.chart5);
|
|
1835
|
+
root.style.setProperty("--primary-50", primaryColors2[50]);
|
|
1836
|
+
root.style.setProperty("--primary-100", primaryColors2[100]);
|
|
1837
|
+
root.style.setProperty("--primary-200", primaryColors2[200]);
|
|
1838
|
+
root.style.setProperty("--primary-300", primaryColors2[300]);
|
|
1839
|
+
root.style.setProperty("--primary-400", primaryColors2[400]);
|
|
1840
|
+
root.style.setProperty("--primary-500", primaryColors2[500]);
|
|
1841
|
+
root.style.setProperty("--primary-600", primaryColors2[600]);
|
|
1842
|
+
root.style.setProperty("--primary-700", primaryColors2[700]);
|
|
1843
|
+
root.style.setProperty("--primary-800", primaryColors2[800]);
|
|
1844
|
+
root.style.setProperty("--primary-900", primaryColors2[900]);
|
|
1845
|
+
root.style.setProperty("--primary-950", primaryColors2[950]);
|
|
1846
|
+
root.style.setProperty("--accent-50", accentColors2[50]);
|
|
1847
|
+
root.style.setProperty("--accent-100", accentColors2[100]);
|
|
1848
|
+
root.style.setProperty("--accent-200", accentColors2[200]);
|
|
1849
|
+
root.style.setProperty("--accent-300", accentColors2[300]);
|
|
1850
|
+
root.style.setProperty("--accent-400", accentColors2[400]);
|
|
1851
|
+
root.style.setProperty("--accent-500", accentColors2[500]);
|
|
1852
|
+
root.style.setProperty("--accent-600", accentColors2[600]);
|
|
1853
|
+
root.style.setProperty("--accent-700", accentColors2[700]);
|
|
1854
|
+
root.style.setProperty("--accent-800", accentColors2[800]);
|
|
1855
|
+
root.style.setProperty("--accent-900", accentColors2[900]);
|
|
1856
|
+
root.style.setProperty("--accent-950", accentColors2[950]);
|
|
1857
|
+
root.style.setProperty("--secondary-50", secondaryColors2[50]);
|
|
1858
|
+
root.style.setProperty("--secondary-100", secondaryColors2[100]);
|
|
1859
|
+
root.style.setProperty("--secondary-200", secondaryColors2[200]);
|
|
1860
|
+
root.style.setProperty("--secondary-300", secondaryColors2[300]);
|
|
1861
|
+
root.style.setProperty("--secondary-400", secondaryColors2[400]);
|
|
1862
|
+
root.style.setProperty("--secondary-500", secondaryColors2[500]);
|
|
1863
|
+
root.style.setProperty("--secondary-600", secondaryColors2[600]);
|
|
1864
|
+
root.style.setProperty("--secondary-700", secondaryColors2[700]);
|
|
1865
|
+
root.style.setProperty("--secondary-800", secondaryColors2[800]);
|
|
1866
|
+
root.style.setProperty("--secondary-900", secondaryColors2[900]);
|
|
1867
|
+
root.style.setProperty("--secondary-950", secondaryColors2[950]);
|
|
1868
|
+
if (mode === "day") {
|
|
1869
|
+
root.style.setProperty("--tm-primary", secondaryColors2[500]);
|
|
1870
|
+
root.style.setProperty("--tm-primary-foreground", "0 0% 100%");
|
|
1871
|
+
root.style.setProperty("--tm-secondary", "0 0% 95.7%");
|
|
1872
|
+
root.style.setProperty("--tm-secondary-foreground", "0 0% 6.7%");
|
|
1873
|
+
root.style.setProperty("--tm-accent", "0 0% 89.8%");
|
|
1874
|
+
root.style.setProperty("--tm-accent-foreground", "0 0% 6.7%");
|
|
1875
|
+
} else {
|
|
1876
|
+
root.style.setProperty("--tm-primary", accentColors2[600]);
|
|
1877
|
+
root.style.setProperty("--tm-primary-foreground", "0 0% 100%");
|
|
1878
|
+
root.style.setProperty("--tm-secondary", "240 10% 7%");
|
|
1879
|
+
root.style.setProperty("--tm-secondary-foreground", "0 0% 89.8%");
|
|
1880
|
+
root.style.setProperty("--tm-accent", "240 10% 10%");
|
|
1881
|
+
root.style.setProperty("--tm-accent-foreground", "0 0% 89.8%");
|
|
1882
|
+
}
|
|
1883
|
+
root.style.setProperty("--muted", base.card);
|
|
1884
|
+
root.style.setProperty("--muted-foreground", base.cardForeground);
|
|
1885
|
+
root.style.setProperty("--destructive", semantic.error);
|
|
1886
|
+
root.style.setProperty("--destructive-foreground", semantic.errorForeground);
|
|
1887
|
+
Object.entries(motionCSSVariables).forEach(([key, value]) => {
|
|
1888
|
+
root.style.setProperty(key, value);
|
|
1889
|
+
});
|
|
1890
|
+
}
|
|
1891
|
+
async function applyDocumentTheme(mode, themeName = "default", brandId = null) {
|
|
1892
|
+
if (typeof document === "undefined") return;
|
|
1893
|
+
await loadThemeOverride(themeName);
|
|
1894
|
+
const currentBrand = getActiveBrand();
|
|
1895
|
+
if (currentBrand && (!brandId || currentBrand.id !== brandId)) {
|
|
1896
|
+
removeBrandOverrides(currentBrand.namespace);
|
|
1897
|
+
}
|
|
1898
|
+
if (brandId) {
|
|
1899
|
+
try {
|
|
1900
|
+
const brand = await loadBrand(brandId);
|
|
1901
|
+
applyBrandOverrides(brand, mode);
|
|
1902
|
+
} catch (error) {
|
|
1903
|
+
console.warn(`Failed to apply brand "${brandId}":`, error);
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
const { documentElement: root, body } = document;
|
|
1907
|
+
root.setAttribute(MODE_ATTRIBUTE, mode);
|
|
1908
|
+
root.setAttribute(MODE_THEME_ATTRIBUTE, mode);
|
|
1909
|
+
root.setAttribute(THEME_ATTRIBUTE, themeName);
|
|
1910
|
+
if (mode === "night") {
|
|
1911
|
+
root.classList.add(DARK_CLASS);
|
|
1912
|
+
} else {
|
|
1913
|
+
root.classList.remove(DARK_CLASS);
|
|
1914
|
+
}
|
|
1915
|
+
updateCSSVariablesFromTokens(mode);
|
|
1916
|
+
const tokens = getMergedTokens();
|
|
1917
|
+
const { background, foreground } = tokens.baseColors[mode];
|
|
1918
|
+
if (body) {
|
|
1919
|
+
body.dataset.mode = mode;
|
|
1920
|
+
body.dataset.theme = themeName;
|
|
1921
|
+
if (brandId) {
|
|
1922
|
+
body.dataset.brand = brandId;
|
|
1923
|
+
} else {
|
|
1924
|
+
body.removeAttribute("data-brand");
|
|
1925
|
+
}
|
|
1926
|
+
body.style.backgroundColor = `hsl(${background})`;
|
|
1927
|
+
body.style.color = `hsl(${foreground})`;
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
function getInitialTheme(defaultTheme2 = "default", storageKey = "tm_theme") {
|
|
1931
|
+
if (typeof window === "undefined") return defaultTheme2;
|
|
1932
|
+
const root = document.documentElement;
|
|
1933
|
+
const attr = root.getAttribute(THEME_ATTRIBUTE);
|
|
1934
|
+
if (attr === "default" || attr === "dark" || attr === "brand") {
|
|
1935
|
+
return attr;
|
|
1936
|
+
}
|
|
1937
|
+
try {
|
|
1938
|
+
const stored = localStorage.getItem(storageKey);
|
|
1939
|
+
if (stored === "default" || stored === "dark" || stored === "brand") {
|
|
1940
|
+
return stored;
|
|
1941
|
+
}
|
|
1942
|
+
} catch {
|
|
1943
|
+
}
|
|
1944
|
+
return defaultTheme2;
|
|
1945
|
+
}
|
|
1946
|
+
function persistMode(mode, storageKey = "tm_mode") {
|
|
1947
|
+
if (typeof window === "undefined") return;
|
|
1948
|
+
try {
|
|
1949
|
+
localStorage.setItem(storageKey, mode);
|
|
1950
|
+
localStorage.setItem("theme", mode === "night" ? "dark" : "light");
|
|
1951
|
+
} catch {
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
function persistTheme(theme, storageKey = "tm_theme") {
|
|
1955
|
+
if (typeof window === "undefined") return;
|
|
1956
|
+
try {
|
|
1957
|
+
localStorage.setItem(storageKey, theme);
|
|
1958
|
+
} catch {
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
function getInitialBrand(defaultBrand = null, storageKey = "tm_brand") {
|
|
1962
|
+
if (typeof window === "undefined") return defaultBrand;
|
|
1963
|
+
const root = document.documentElement;
|
|
1964
|
+
const attr = root.getAttribute("data-brand");
|
|
1965
|
+
if (attr) {
|
|
1966
|
+
return attr;
|
|
1967
|
+
}
|
|
1968
|
+
try {
|
|
1969
|
+
const stored = localStorage.getItem(storageKey);
|
|
1970
|
+
if (stored) {
|
|
1971
|
+
return stored;
|
|
1972
|
+
}
|
|
1973
|
+
} catch {
|
|
1974
|
+
}
|
|
1975
|
+
return defaultBrand;
|
|
1976
|
+
}
|
|
1977
|
+
function persistBrand(brandId, storageKey = "tm_brand") {
|
|
1978
|
+
if (typeof window === "undefined") return;
|
|
1979
|
+
try {
|
|
1980
|
+
if (brandId) {
|
|
1981
|
+
localStorage.setItem(storageKey, brandId);
|
|
1982
|
+
} else {
|
|
1983
|
+
localStorage.removeItem(storageKey);
|
|
1984
|
+
}
|
|
1985
|
+
} catch {
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
// src/theme/registry.ts
|
|
1990
|
+
var themeRegistry = /* @__PURE__ */ new Map();
|
|
1991
|
+
function registerTheme(entry) {
|
|
1992
|
+
themeRegistry.set(entry.metadata.id, entry);
|
|
1993
|
+
}
|
|
1994
|
+
function getThemeMetadata(id) {
|
|
1995
|
+
return themeRegistry.get(id)?.metadata;
|
|
1996
|
+
}
|
|
1997
|
+
function getAllThemes() {
|
|
1998
|
+
return Array.from(themeRegistry.values()).filter((entry) => entry.enabled !== false).map((entry) => entry.metadata);
|
|
1999
|
+
}
|
|
2000
|
+
function getThemesByCategory(category) {
|
|
2001
|
+
return getAllThemes().filter((theme) => theme.category === category);
|
|
2002
|
+
}
|
|
2003
|
+
function themeExists(id) {
|
|
2004
|
+
return themeRegistry.has(id);
|
|
2005
|
+
}
|
|
2006
|
+
async function loadTheme(id) {
|
|
2007
|
+
const entry = themeRegistry.get(id);
|
|
2008
|
+
if (!entry) {
|
|
2009
|
+
throw new Error(`Theme "${id}" not found in registry`);
|
|
2010
|
+
}
|
|
2011
|
+
if (entry.enabled === false) {
|
|
2012
|
+
throw new Error(`Theme "${id}" is disabled`);
|
|
2013
|
+
}
|
|
2014
|
+
try {
|
|
2015
|
+
const module = await entry.loader();
|
|
2016
|
+
return module.default;
|
|
2017
|
+
} catch (error) {
|
|
2018
|
+
throw new Error(
|
|
2019
|
+
`Failed to load theme "${id}": ${error instanceof Error ? error.message : String(error)}`
|
|
2020
|
+
);
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
function initializeDefaultThemes() {
|
|
2024
|
+
registerTheme({
|
|
2025
|
+
metadata: {
|
|
2026
|
+
id: "default",
|
|
2027
|
+
name: "Default",
|
|
2028
|
+
description: "Default Tenerife UI theme with standard color palette",
|
|
2029
|
+
category: "default",
|
|
2030
|
+
version: "1.0.0"
|
|
2031
|
+
},
|
|
2032
|
+
loader: async () => {
|
|
2033
|
+
const m = await Promise.resolve().then(() => (init_default(), default_exports));
|
|
2034
|
+
return { default: { ...m.defaultTheme, id: "default", name: "Default" } };
|
|
2035
|
+
},
|
|
2036
|
+
enabled: true
|
|
2037
|
+
});
|
|
2038
|
+
registerTheme({
|
|
2039
|
+
metadata: {
|
|
2040
|
+
id: "dark",
|
|
2041
|
+
name: "Dark",
|
|
2042
|
+
description: "Enhanced dark theme with deeper surfaces and higher contrast",
|
|
2043
|
+
category: "default",
|
|
2044
|
+
version: "1.0.0"
|
|
2045
|
+
},
|
|
2046
|
+
loader: async () => {
|
|
2047
|
+
const m = await Promise.resolve().then(() => (init_dark(), dark_exports));
|
|
2048
|
+
return { default: { ...m.darkTheme, id: "dark", name: "Dark" } };
|
|
2049
|
+
},
|
|
2050
|
+
enabled: true
|
|
2051
|
+
});
|
|
2052
|
+
registerTheme({
|
|
2053
|
+
metadata: {
|
|
2054
|
+
id: "brand",
|
|
2055
|
+
name: "Brand",
|
|
2056
|
+
description: "Brand-specific theme with custom color palette",
|
|
2057
|
+
category: "brand",
|
|
2058
|
+
version: "1.0.0"
|
|
2059
|
+
},
|
|
2060
|
+
loader: async () => {
|
|
2061
|
+
const m = await Promise.resolve().then(() => (init_brand(), brand_exports));
|
|
2062
|
+
return { default: { ...m.brandTheme, id: "brand", name: "Brand" } };
|
|
2063
|
+
},
|
|
2064
|
+
enabled: true
|
|
2065
|
+
});
|
|
2066
|
+
}
|
|
2067
|
+
initializeDefaultThemes();
|
|
2068
|
+
|
|
2069
|
+
// src/theme/schema.ts
|
|
2070
|
+
var REQUIRED_FIELDS = ["id", "name"];
|
|
2071
|
+
function validateThemeSchema(theme) {
|
|
2072
|
+
const errors = [];
|
|
2073
|
+
const warnings = [];
|
|
2074
|
+
if (!theme || typeof theme !== "object") {
|
|
2075
|
+
return {
|
|
2076
|
+
valid: false,
|
|
2077
|
+
errors: ["Theme must be an object"],
|
|
2078
|
+
warnings: []
|
|
2079
|
+
};
|
|
2080
|
+
}
|
|
2081
|
+
const themeObj = theme;
|
|
2082
|
+
for (const field of REQUIRED_FIELDS) {
|
|
2083
|
+
if (!(field in themeObj) || !themeObj[field]) {
|
|
2084
|
+
errors.push(`Missing required field: ${field}`);
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
if (themeObj.id && typeof themeObj.id === "string") {
|
|
2088
|
+
const idRegex = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
2089
|
+
if (!idRegex.test(themeObj.id)) {
|
|
2090
|
+
errors.push(
|
|
2091
|
+
`Invalid theme ID format: "${themeObj.id}". Must be kebab-case (e.g., "ocean-blue")`
|
|
2092
|
+
);
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
if (themeObj.name && typeof themeObj.name !== "string") {
|
|
2096
|
+
errors.push("Theme name must be a string");
|
|
2097
|
+
}
|
|
2098
|
+
if (themeObj.category) {
|
|
2099
|
+
const validCategories = ["default", "brand", "seasonal", "custom"];
|
|
2100
|
+
if (!validCategories.includes(themeObj.category)) {
|
|
2101
|
+
errors.push(
|
|
2102
|
+
`Invalid category: "${themeObj.category}". Must be one of: ${validCategories.join(", ")}`
|
|
2103
|
+
);
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
const colorScaleFields = ["primaryColors", "accentColors", "secondaryColors"];
|
|
2107
|
+
for (const field of colorScaleFields) {
|
|
2108
|
+
if (themeObj[field]) {
|
|
2109
|
+
const scale = themeObj[field];
|
|
2110
|
+
const validKeys = [
|
|
2111
|
+
"50",
|
|
2112
|
+
"100",
|
|
2113
|
+
"200",
|
|
2114
|
+
"300",
|
|
2115
|
+
"400",
|
|
2116
|
+
"500",
|
|
2117
|
+
"600",
|
|
2118
|
+
"700",
|
|
2119
|
+
"800",
|
|
2120
|
+
"900",
|
|
2121
|
+
"950"
|
|
2122
|
+
];
|
|
2123
|
+
for (const key of Object.keys(scale)) {
|
|
2124
|
+
if (!validKeys.includes(key)) {
|
|
2125
|
+
warnings.push(
|
|
2126
|
+
`Invalid color scale key in ${field}: ${key}. Valid keys: ${validKeys.join(", ")}`
|
|
2127
|
+
);
|
|
2128
|
+
}
|
|
2129
|
+
if (typeof scale[key] !== "string") {
|
|
2130
|
+
errors.push(`Color value in ${field}.${key} must be a string (HSL format)`);
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
if (themeObj.version && typeof themeObj.version === "string") {
|
|
2136
|
+
const semverRegex = /^\d+\.\d+\.\d+$/;
|
|
2137
|
+
if (!semverRegex.test(themeObj.version)) {
|
|
2138
|
+
warnings.push(
|
|
2139
|
+
`Invalid version format: "${themeObj.version}". Should be semver (e.g., "1.0.0")`
|
|
2140
|
+
);
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
return {
|
|
2144
|
+
valid: errors.length === 0,
|
|
2145
|
+
errors,
|
|
2146
|
+
warnings
|
|
2147
|
+
};
|
|
2148
|
+
}
|
|
2149
|
+
function isThemeSchema(obj) {
|
|
2150
|
+
const validation = validateThemeSchema(obj);
|
|
2151
|
+
return validation.valid;
|
|
2152
|
+
}
|
|
2153
|
+
function createMinimalThemeSchema(id, name) {
|
|
2154
|
+
return {
|
|
2155
|
+
id,
|
|
2156
|
+
name,
|
|
2157
|
+
description: `Custom theme: ${name}`,
|
|
2158
|
+
category: "custom",
|
|
2159
|
+
version: "1.0.0"
|
|
2160
|
+
};
|
|
2161
|
+
}
|
|
2162
|
+
|
|
2163
|
+
// src/theme/loader.ts
|
|
2164
|
+
var DEFAULT_OPTIONS = {
|
|
2165
|
+
fallbackThemeId: "default",
|
|
2166
|
+
validate: true,
|
|
2167
|
+
throwOnError: false
|
|
2168
|
+
};
|
|
2169
|
+
async function loadThemeSafe(themeId, options = {}) {
|
|
2170
|
+
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
2171
|
+
const warnings = [];
|
|
2172
|
+
if (!themeExists(themeId)) {
|
|
2173
|
+
if (opts.throwOnError) {
|
|
2174
|
+
throw new Error(`Theme "${themeId}" not found`);
|
|
2175
|
+
}
|
|
2176
|
+
if (opts.fallbackThemeId && themeExists(opts.fallbackThemeId)) {
|
|
2177
|
+
warnings.push(`Theme "${themeId}" not found, using fallback "${opts.fallbackThemeId}"`);
|
|
2178
|
+
return loadThemeSafe(opts.fallbackThemeId, { ...opts, throwOnError: false });
|
|
2179
|
+
}
|
|
2180
|
+
throw new Error(`Theme "${themeId}" not found and no fallback available`);
|
|
2181
|
+
}
|
|
2182
|
+
try {
|
|
2183
|
+
const theme = await loadTheme(themeId);
|
|
2184
|
+
if (opts.validate) {
|
|
2185
|
+
const validation = validateThemeSchema(theme);
|
|
2186
|
+
if (!validation.valid) {
|
|
2187
|
+
if (opts.throwOnError) {
|
|
2188
|
+
throw new Error(`Theme "${themeId}" validation failed: ${validation.errors.join(", ")}`);
|
|
2189
|
+
}
|
|
2190
|
+
if (opts.fallbackThemeId && themeExists(opts.fallbackThemeId)) {
|
|
2191
|
+
warnings.push(
|
|
2192
|
+
`Theme "${themeId}" validation failed: ${validation.errors.join(", ")}. Using fallback "${opts.fallbackThemeId}"`
|
|
2193
|
+
);
|
|
2194
|
+
return loadThemeSafe(opts.fallbackThemeId, { ...opts, throwOnError: false });
|
|
2195
|
+
}
|
|
2196
|
+
throw new Error(`Theme "${themeId}" validation failed: ${validation.errors.join(", ")}`);
|
|
2197
|
+
}
|
|
2198
|
+
warnings.push(...validation.warnings);
|
|
2199
|
+
}
|
|
2200
|
+
return {
|
|
2201
|
+
theme,
|
|
2202
|
+
usedFallback: false,
|
|
2203
|
+
warnings
|
|
2204
|
+
};
|
|
2205
|
+
} catch (error) {
|
|
2206
|
+
if (opts.throwOnError) {
|
|
2207
|
+
throw error;
|
|
2208
|
+
}
|
|
2209
|
+
if (opts.fallbackThemeId && themeExists(opts.fallbackThemeId) && opts.fallbackThemeId !== themeId) {
|
|
2210
|
+
warnings.push(
|
|
2211
|
+
`Failed to load theme "${themeId}": ${error instanceof Error ? error.message : String(error)}. Using fallback "${opts.fallbackThemeId}"`
|
|
2212
|
+
);
|
|
2213
|
+
return loadThemeSafe(opts.fallbackThemeId, { ...opts, throwOnError: false });
|
|
2214
|
+
}
|
|
2215
|
+
throw error;
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
async function preloadThemes(themeIds) {
|
|
2219
|
+
const loadPromises = themeIds.map(
|
|
2220
|
+
(id) => loadThemeSafe(id, { validate: false, throwOnError: false }).catch(() => {
|
|
2221
|
+
})
|
|
2222
|
+
);
|
|
2223
|
+
await Promise.all(loadPromises);
|
|
2224
|
+
}
|
|
2225
|
+
function getAvailableThemeIds() {
|
|
2226
|
+
return getAllThemes().map((theme) => theme.id);
|
|
2227
|
+
}
|
|
2228
|
+
async function canLoadTheme(themeId) {
|
|
2229
|
+
if (!themeExists(themeId)) {
|
|
2230
|
+
return false;
|
|
2231
|
+
}
|
|
2232
|
+
try {
|
|
2233
|
+
await loadThemeSafe(themeId, { validate: false, throwOnError: true });
|
|
2234
|
+
return true;
|
|
2235
|
+
} catch {
|
|
2236
|
+
return false;
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2240
|
+
// src/theme/spacing.ts
|
|
2241
|
+
var spacing = {
|
|
2242
|
+
none: "0",
|
|
2243
|
+
xs: "0.25rem",
|
|
2244
|
+
// 4px
|
|
2245
|
+
sm: "0.5rem",
|
|
2246
|
+
// 8px
|
|
2247
|
+
md: "1rem",
|
|
2248
|
+
// 16px
|
|
2249
|
+
lg: "1.5rem",
|
|
2250
|
+
// 24px
|
|
2251
|
+
xl: "2rem",
|
|
2252
|
+
// 32px
|
|
2253
|
+
"2xl": "2.5rem",
|
|
2254
|
+
// 40px
|
|
2255
|
+
"3xl": "3rem",
|
|
2256
|
+
// 48px
|
|
2257
|
+
"4xl": "4rem",
|
|
2258
|
+
// 64px
|
|
2259
|
+
"5xl": "5rem"
|
|
2260
|
+
// 80px
|
|
2261
|
+
};
|
|
2262
|
+
var borderRadius = {
|
|
2263
|
+
none: "0px",
|
|
2264
|
+
sm: "0.125rem",
|
|
2265
|
+
// 2px
|
|
2266
|
+
base: "0.25rem",
|
|
2267
|
+
// 4px
|
|
2268
|
+
md: "0.375rem",
|
|
2269
|
+
// 6px
|
|
2270
|
+
lg: "0.5rem",
|
|
2271
|
+
// 8px
|
|
2272
|
+
xl: "0.75rem",
|
|
2273
|
+
// 12px
|
|
2274
|
+
"2xl": "1rem",
|
|
2275
|
+
// 16px
|
|
2276
|
+
"3xl": "1.5rem",
|
|
2277
|
+
// 24px
|
|
2278
|
+
full: "9999px"
|
|
2279
|
+
};
|
|
2280
|
+
var shadows = {
|
|
2281
|
+
none: "none",
|
|
2282
|
+
sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
2283
|
+
base: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
2284
|
+
md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
2285
|
+
lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
2286
|
+
xl: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
|
|
2287
|
+
"2xl": "0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
2288
|
+
inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)"
|
|
2289
|
+
};
|
|
2290
|
+
var ThemeContext = React__default.default.createContext(void 0);
|
|
2291
|
+
function getInitialReduceMotion(override) {
|
|
2292
|
+
if (override !== void 0) return override;
|
|
2293
|
+
if (typeof window === "undefined") return false;
|
|
2294
|
+
try {
|
|
2295
|
+
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2296
|
+
} catch {
|
|
2297
|
+
return false;
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
function ThemeProvider({
|
|
2301
|
+
children,
|
|
2302
|
+
defaultMode = "day",
|
|
2303
|
+
defaultTheme: defaultTheme2 = "default",
|
|
2304
|
+
defaultBrand = null,
|
|
2305
|
+
storageKey = "tm_mode",
|
|
2306
|
+
themeStorageKey = "tm_theme",
|
|
2307
|
+
brandStorageKey = "tm_brand",
|
|
2308
|
+
attribute = "data-mode",
|
|
2309
|
+
enableSystem = true,
|
|
2310
|
+
reduceMotion: reduceMotionOverride,
|
|
2311
|
+
enableAnimations: enableAnimationsOverride = true
|
|
2312
|
+
}) {
|
|
2313
|
+
React__default.default.useEffect(() => {
|
|
2314
|
+
try {
|
|
2315
|
+
registerBrand(neonBrand);
|
|
2316
|
+
} catch (error) {
|
|
2317
|
+
console.warn("Failed to register neon brand:", error);
|
|
2318
|
+
}
|
|
2319
|
+
try {
|
|
2320
|
+
registerBrand(minimalBrand);
|
|
2321
|
+
} catch (error) {
|
|
2322
|
+
console.warn("Failed to register minimal brand:", error);
|
|
2323
|
+
}
|
|
2324
|
+
}, []);
|
|
2325
|
+
const [mode, setModeState] = React__default.default.useState(() => {
|
|
2326
|
+
if (typeof window === "undefined") return defaultMode;
|
|
2327
|
+
const root = document.documentElement;
|
|
2328
|
+
const existingMode = root.getAttribute(attribute);
|
|
2329
|
+
if (existingMode === "day" || existingMode === "night") {
|
|
2330
|
+
return existingMode;
|
|
2331
|
+
}
|
|
2332
|
+
try {
|
|
2333
|
+
const stored = localStorage.getItem(storageKey);
|
|
2334
|
+
if (stored === "day" || stored === "night") {
|
|
2335
|
+
return stored;
|
|
2336
|
+
}
|
|
2337
|
+
} catch {
|
|
2338
|
+
}
|
|
2339
|
+
if (enableSystem && typeof window !== "undefined") {
|
|
2340
|
+
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
2341
|
+
return prefersDark ? "night" : "day";
|
|
2342
|
+
}
|
|
2343
|
+
return defaultMode;
|
|
2344
|
+
});
|
|
2345
|
+
const [theme, setThemeState] = React__default.default.useState(() => {
|
|
2346
|
+
if (typeof window === "undefined") return defaultTheme2;
|
|
2347
|
+
return getInitialTheme(defaultTheme2, themeStorageKey);
|
|
2348
|
+
});
|
|
2349
|
+
const [brand, setBrandState] = React__default.default.useState(() => {
|
|
2350
|
+
if (typeof window === "undefined") return defaultBrand;
|
|
2351
|
+
return getInitialBrand(defaultBrand, brandStorageKey);
|
|
2352
|
+
});
|
|
2353
|
+
const [reduceMotion, setReduceMotionState] = React__default.default.useState(() => {
|
|
2354
|
+
return getInitialReduceMotion(reduceMotionOverride);
|
|
2355
|
+
});
|
|
2356
|
+
const [enableAnimations, setEnableAnimationsState] = React__default.default.useState(() => {
|
|
2357
|
+
return enableAnimationsOverride;
|
|
2358
|
+
});
|
|
2359
|
+
const setMode = React__default.default.useCallback(
|
|
2360
|
+
(newMode) => {
|
|
2361
|
+
setModeState(newMode);
|
|
2362
|
+
applyDocumentTheme(newMode, theme, brand);
|
|
2363
|
+
persistMode(newMode, storageKey);
|
|
2364
|
+
},
|
|
2365
|
+
[theme, brand, storageKey]
|
|
2366
|
+
);
|
|
2367
|
+
const setTheme = React__default.default.useCallback(
|
|
2368
|
+
async (newTheme) => {
|
|
2369
|
+
setThemeState(newTheme);
|
|
2370
|
+
await applyDocumentTheme(mode, newTheme, brand);
|
|
2371
|
+
persistTheme(newTheme, themeStorageKey);
|
|
2372
|
+
},
|
|
2373
|
+
[mode, brand, themeStorageKey]
|
|
2374
|
+
);
|
|
2375
|
+
const setBrand = React__default.default.useCallback(
|
|
2376
|
+
async (brandId) => {
|
|
2377
|
+
const currentBrand = getActiveBrand();
|
|
2378
|
+
if (currentBrand) {
|
|
2379
|
+
removeBrandOverrides(currentBrand.namespace);
|
|
2380
|
+
}
|
|
2381
|
+
setBrandState(brandId);
|
|
2382
|
+
persistBrand(brandId, brandStorageKey);
|
|
2383
|
+
if (brandId) {
|
|
2384
|
+
try {
|
|
2385
|
+
const loadedBrand = await loadBrand(brandId);
|
|
2386
|
+
applyBrandOverrides(loadedBrand, mode);
|
|
2387
|
+
} catch (error) {
|
|
2388
|
+
console.error(`Failed to load brand "${brandId}":`, error);
|
|
2389
|
+
setActiveBrand(null);
|
|
2390
|
+
}
|
|
2391
|
+
} else {
|
|
2392
|
+
setActiveBrand(null);
|
|
2393
|
+
}
|
|
2394
|
+
await applyDocumentTheme(mode, theme, brandId);
|
|
2395
|
+
},
|
|
2396
|
+
[mode, theme, brandStorageKey]
|
|
2397
|
+
);
|
|
2398
|
+
const toggleMode = React__default.default.useCallback(() => {
|
|
2399
|
+
setMode(mode === "night" ? "day" : "night");
|
|
2400
|
+
}, [mode, setMode]);
|
|
2401
|
+
const setReduceMotion = React__default.default.useCallback((reduce) => {
|
|
2402
|
+
setReduceMotionState(reduce);
|
|
2403
|
+
try {
|
|
2404
|
+
localStorage.setItem("tm_reduce_motion", reduce ? "true" : "false");
|
|
2405
|
+
} catch {
|
|
2406
|
+
}
|
|
2407
|
+
}, []);
|
|
2408
|
+
const setEnableAnimations = React__default.default.useCallback((enable) => {
|
|
2409
|
+
setEnableAnimationsState(enable);
|
|
2410
|
+
try {
|
|
2411
|
+
localStorage.setItem("tm_enable_animations", enable ? "true" : "false");
|
|
2412
|
+
} catch {
|
|
2413
|
+
}
|
|
2414
|
+
}, []);
|
|
2415
|
+
React__default.default.useEffect(() => {
|
|
2416
|
+
if (reduceMotionOverride !== void 0) return;
|
|
2417
|
+
const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
2418
|
+
const handleChange = (e) => {
|
|
2419
|
+
setReduceMotionState(e.matches);
|
|
2420
|
+
};
|
|
2421
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
2422
|
+
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
2423
|
+
}, [reduceMotionOverride]);
|
|
2424
|
+
React__default.default.useEffect(() => {
|
|
2425
|
+
if (reduceMotionOverride === void 0) {
|
|
2426
|
+
try {
|
|
2427
|
+
const storedReduceMotion = localStorage.getItem("tm_reduce_motion");
|
|
2428
|
+
if (storedReduceMotion === "true" || storedReduceMotion === "false") {
|
|
2429
|
+
setReduceMotionState(storedReduceMotion === "true");
|
|
2430
|
+
}
|
|
2431
|
+
} catch {
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
if (enableAnimationsOverride === void 0) {
|
|
2435
|
+
try {
|
|
2436
|
+
const storedEnableAnimations = localStorage.getItem("tm_enable_animations");
|
|
2437
|
+
if (storedEnableAnimations === "true" || storedEnableAnimations === "false") {
|
|
2438
|
+
setEnableAnimationsState(storedEnableAnimations === "true");
|
|
2439
|
+
}
|
|
2440
|
+
} catch {
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
}, [reduceMotionOverride, enableAnimationsOverride]);
|
|
2444
|
+
React__default.default.useEffect(() => {
|
|
2445
|
+
const initialMode = getInitialMode(defaultMode, storageKey, enableSystem);
|
|
2446
|
+
const initialTheme = getInitialTheme(defaultTheme2, themeStorageKey);
|
|
2447
|
+
const initialBrand = getInitialBrand(defaultBrand, brandStorageKey);
|
|
2448
|
+
setModeState(initialMode);
|
|
2449
|
+
setThemeState(initialTheme);
|
|
2450
|
+
setBrandState(initialBrand);
|
|
2451
|
+
applyDocumentTheme(initialMode, initialTheme, initialBrand);
|
|
2452
|
+
persistMode(initialMode, storageKey);
|
|
2453
|
+
persistTheme(initialTheme, themeStorageKey);
|
|
2454
|
+
persistBrand(initialBrand, brandStorageKey);
|
|
2455
|
+
}, [
|
|
2456
|
+
defaultMode,
|
|
2457
|
+
defaultTheme2,
|
|
2458
|
+
defaultBrand,
|
|
2459
|
+
storageKey,
|
|
2460
|
+
themeStorageKey,
|
|
2461
|
+
brandStorageKey,
|
|
2462
|
+
enableSystem
|
|
2463
|
+
]);
|
|
2464
|
+
React__default.default.useEffect(() => {
|
|
2465
|
+
if (!enableSystem) return;
|
|
2466
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2467
|
+
const handleChange = (e) => {
|
|
2468
|
+
try {
|
|
2469
|
+
const stored = localStorage.getItem(storageKey);
|
|
2470
|
+
if (!stored) {
|
|
2471
|
+
setMode(e.matches ? "night" : "day");
|
|
2472
|
+
}
|
|
2473
|
+
} catch {
|
|
2474
|
+
}
|
|
2475
|
+
};
|
|
2476
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
2477
|
+
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
2478
|
+
}, [enableSystem, storageKey, setMode]);
|
|
2479
|
+
React__default.default.useEffect(() => {
|
|
2480
|
+
applyDocumentTheme(mode, theme, brand);
|
|
2481
|
+
}, [mode, theme, brand]);
|
|
2482
|
+
const value = React__default.default.useMemo(
|
|
2483
|
+
() => ({
|
|
2484
|
+
mode,
|
|
2485
|
+
theme,
|
|
2486
|
+
brand,
|
|
2487
|
+
reduceMotion: reduceMotionOverride !== void 0 ? reduceMotionOverride : reduceMotion,
|
|
2488
|
+
enableAnimations: enableAnimationsOverride !== void 0 ? enableAnimationsOverride : enableAnimations,
|
|
2489
|
+
setMode,
|
|
2490
|
+
setTheme,
|
|
2491
|
+
setBrand,
|
|
2492
|
+
toggleMode,
|
|
2493
|
+
setReduceMotion,
|
|
2494
|
+
setEnableAnimations
|
|
2495
|
+
}),
|
|
2496
|
+
[
|
|
2497
|
+
mode,
|
|
2498
|
+
theme,
|
|
2499
|
+
brand,
|
|
2500
|
+
reduceMotion,
|
|
2501
|
+
enableAnimations,
|
|
2502
|
+
reduceMotionOverride,
|
|
2503
|
+
enableAnimationsOverride,
|
|
2504
|
+
setMode,
|
|
2505
|
+
setTheme,
|
|
2506
|
+
setBrand,
|
|
2507
|
+
toggleMode,
|
|
2508
|
+
setReduceMotion,
|
|
2509
|
+
setEnableAnimations
|
|
2510
|
+
]
|
|
2511
|
+
);
|
|
2512
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value, children });
|
|
2513
|
+
}
|
|
2514
|
+
function useTheme() {
|
|
2515
|
+
const context = React__default.default.useContext(ThemeContext);
|
|
2516
|
+
if (context === void 0) {
|
|
2517
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
2518
|
+
}
|
|
2519
|
+
return context;
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
// src/theme/typography.ts
|
|
2523
|
+
var fontFamilies = {
|
|
2524
|
+
sans: [
|
|
2525
|
+
"ui-sans-serif",
|
|
2526
|
+
"system-ui",
|
|
2527
|
+
"-apple-system",
|
|
2528
|
+
"Segoe UI",
|
|
2529
|
+
"Roboto",
|
|
2530
|
+
"Ubuntu",
|
|
2531
|
+
"Cantarell",
|
|
2532
|
+
"Noto Sans",
|
|
2533
|
+
"Helvetica Neue",
|
|
2534
|
+
"Arial",
|
|
2535
|
+
"Apple Color Emoji",
|
|
2536
|
+
"Segoe UI Emoji",
|
|
2537
|
+
"Segoe UI Symbol",
|
|
2538
|
+
"Noto Color Emoji"
|
|
2539
|
+
].join(", "),
|
|
2540
|
+
serif: ["ui-serif", "Georgia", "Cambria", "Times New Roman", "Times", "serif"].join(", "),
|
|
2541
|
+
mono: [
|
|
2542
|
+
"ui-monospace",
|
|
2543
|
+
"SFMono-Regular",
|
|
2544
|
+
"Menlo",
|
|
2545
|
+
"Monaco",
|
|
2546
|
+
"Consolas",
|
|
2547
|
+
"Liberation Mono",
|
|
2548
|
+
"Courier New",
|
|
2549
|
+
"monospace"
|
|
2550
|
+
].join(", ")
|
|
2551
|
+
};
|
|
2552
|
+
var fontSizes = {
|
|
2553
|
+
xs: "0.75rem",
|
|
2554
|
+
// 12px
|
|
2555
|
+
sm: "0.875rem",
|
|
2556
|
+
// 14px
|
|
2557
|
+
base: "1rem",
|
|
2558
|
+
// 16px
|
|
2559
|
+
lg: "1.125rem",
|
|
2560
|
+
// 18px
|
|
2561
|
+
xl: "1.25rem",
|
|
2562
|
+
// 20px
|
|
2563
|
+
"2xl": "1.5rem",
|
|
2564
|
+
// 24px
|
|
2565
|
+
"3xl": "1.875rem",
|
|
2566
|
+
// 30px
|
|
2567
|
+
"4xl": "2.25rem",
|
|
2568
|
+
// 36px
|
|
2569
|
+
"5xl": "3rem",
|
|
2570
|
+
// 48px
|
|
2571
|
+
"6xl": "3.75rem"
|
|
2572
|
+
// 60px
|
|
2573
|
+
};
|
|
2574
|
+
var fontWeights = {
|
|
2575
|
+
thin: "100",
|
|
2576
|
+
extralight: "200",
|
|
2577
|
+
light: "300",
|
|
2578
|
+
normal: "400",
|
|
2579
|
+
medium: "500",
|
|
2580
|
+
semibold: "600",
|
|
2581
|
+
bold: "700",
|
|
2582
|
+
extrabold: "800",
|
|
2583
|
+
black: "900"
|
|
2584
|
+
};
|
|
2585
|
+
var lineHeights = {
|
|
2586
|
+
none: "1",
|
|
2587
|
+
tight: "1.25",
|
|
2588
|
+
snug: "1.375",
|
|
2589
|
+
normal: "1.5",
|
|
2590
|
+
relaxed: "1.625",
|
|
2591
|
+
loose: "2"
|
|
2592
|
+
};
|
|
2593
|
+
var letterSpacings = {
|
|
2594
|
+
tighter: "-0.05em",
|
|
2595
|
+
tight: "-0.025em",
|
|
2596
|
+
normal: "0em",
|
|
2597
|
+
wide: "0.025em",
|
|
2598
|
+
wider: "0.05em",
|
|
2599
|
+
widest: "0.1em"
|
|
2600
|
+
};
|
|
2601
|
+
|
|
2602
|
+
exports.ThemeProvider = ThemeProvider;
|
|
2603
|
+
exports.borderRadius = borderRadius;
|
|
2604
|
+
exports.canLoadTheme = canLoadTheme;
|
|
2605
|
+
exports.createMinimalThemeSchema = createMinimalThemeSchema;
|
|
2606
|
+
exports.cssVariableColorTokens = cssVariableColorTokens;
|
|
2607
|
+
exports.fontFamilies = fontFamilies;
|
|
2608
|
+
exports.fontSizes = fontSizes;
|
|
2609
|
+
exports.fontWeights = fontWeights;
|
|
2610
|
+
exports.getAllThemes = getAllThemes;
|
|
2611
|
+
exports.getAvailableThemeIds = getAvailableThemeIds;
|
|
2612
|
+
exports.getInitialBrand = getInitialBrand;
|
|
2613
|
+
exports.getInitialMode = getInitialMode;
|
|
2614
|
+
exports.getInitialTheme = getInitialTheme;
|
|
2615
|
+
exports.getThemeMetadata = getThemeMetadata;
|
|
2616
|
+
exports.getThemesByCategory = getThemesByCategory;
|
|
2617
|
+
exports.initializeDefaultThemes = initializeDefaultThemes;
|
|
2618
|
+
exports.isThemeSchema = isThemeSchema;
|
|
2619
|
+
exports.letterSpacings = letterSpacings;
|
|
2620
|
+
exports.lineHeights = lineHeights;
|
|
2621
|
+
exports.loadTheme = loadTheme;
|
|
2622
|
+
exports.loadThemeSafe = loadThemeSafe;
|
|
2623
|
+
exports.persistBrand = persistBrand;
|
|
2624
|
+
exports.persistMode = persistMode;
|
|
2625
|
+
exports.persistTheme = persistTheme;
|
|
2626
|
+
exports.preloadThemes = preloadThemes;
|
|
2627
|
+
exports.registerTheme = registerTheme;
|
|
2628
|
+
exports.shadows = shadows;
|
|
2629
|
+
exports.spacing = spacing;
|
|
2630
|
+
exports.tailwindThemeColors = tailwindThemeColors;
|
|
2631
|
+
exports.themeExists = themeExists;
|
|
2632
|
+
exports.themeRegistry = themeRegistry;
|
|
2633
|
+
exports.useTheme = useTheme;
|
|
2634
|
+
exports.validateThemeSchema = validateThemeSchema;
|