@endfield-ui/react 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE.md +4 -3
- package/README.md +32 -5
- package/dist/components/accordion/Accordion.d.ts +46 -0
- package/dist/components/accordion/Accordion.js +2 -0
- package/dist/components/accordion/index.d.ts +3 -0
- package/dist/components/alert/Alert.d.ts +28 -0
- package/dist/components/alert/Alert.js +2 -0
- package/dist/components/alert/index.d.ts +3 -0
- package/dist/components/avatar/Avatar.d.ts +24 -0
- package/dist/components/avatar/Avatar.js +2 -0
- package/dist/components/avatar/AvatarSwitcher.d.ts +46 -0
- package/dist/components/avatar/AvatarSwitcher.js +2 -0
- package/dist/components/avatar/index.d.ts +4 -0
- package/dist/components/back-to-top/BackToTop.d.ts +21 -0
- package/dist/components/back-to-top/BackToTop.js +2 -0
- package/dist/components/back-to-top/index.d.ts +3 -0
- package/dist/components/badge/Badge.d.ts +20 -0
- package/dist/components/badge/Badge.js +2 -0
- package/dist/components/badge/index.d.ts +3 -0
- package/dist/components/bracket-title/BracketTitle.d.ts +17 -0
- package/dist/components/bracket-title/BracketTitle.js +2 -0
- package/dist/components/bracket-title/index.d.ts +3 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +26 -0
- package/dist/components/breadcrumb/Breadcrumb.js +2 -0
- package/dist/components/breadcrumb/index.d.ts +3 -0
- package/dist/components/button/Button.d.ts +50 -0
- package/dist/components/button/Button.js +2 -0
- package/dist/components/button/ButtonGroup.d.ts +21 -0
- package/dist/components/button/ButtonGroup.js +2 -0
- package/dist/components/button/index.d.ts +4 -0
- package/dist/components/calendar/Calendar.d.ts +57 -0
- package/dist/components/calendar/Calendar.js +2 -0
- package/dist/components/calendar/index.d.ts +3 -0
- package/dist/components/carousel/Carousel.d.ts +38 -0
- package/dist/components/carousel/Carousel.js +2 -0
- package/dist/components/carousel/index.d.ts +3 -0
- package/dist/components/carousel/snap-track.js +2 -0
- package/dist/components/checkbox/Checkbox.d.ts +18 -0
- package/dist/components/checkbox/Checkbox.js +2 -0
- package/dist/components/checkbox/choice-style.js +2 -0
- package/dist/components/checkbox/index.d.ts +3 -0
- package/dist/components/chip/FilterChip.d.ts +18 -0
- package/dist/components/chip/FilterChip.js +2 -0
- package/dist/components/chip/ResourceChip.d.ts +16 -0
- package/dist/components/chip/ResourceChip.js +2 -0
- package/dist/components/chip/capsule-style.d.ts +4 -0
- package/dist/components/chip/capsule-style.js +2 -0
- package/dist/components/chip/index.d.ts +4 -0
- package/dist/components/combobox/Combobox.d.ts +105 -0
- package/dist/components/combobox/Combobox.js +2 -0
- package/dist/components/combobox/index.d.ts +3 -0
- package/dist/components/completion-banner/CompletionBanner.d.ts +26 -0
- package/dist/components/completion-banner/CompletionBanner.js +2 -0
- package/dist/components/completion-banner/index.d.ts +3 -0
- package/dist/components/context-menu/ContextMenu.d.ts +30 -0
- package/dist/components/context-menu/ContextMenu.js +2 -0
- package/dist/components/context-menu/index.d.ts +3 -0
- package/dist/components/corner-brackets/CornerBrackets.d.ts +20 -0
- package/dist/components/corner-brackets/CornerBrackets.js +2 -0
- package/dist/components/corner-brackets/index.d.ts +3 -0
- package/dist/components/countdown/Countdown.d.ts +26 -0
- package/dist/components/countdown/Countdown.js +2 -0
- package/dist/components/countdown/index.d.ts +3 -0
- package/dist/components/dash-indicator/DashIndicator.d.ts +15 -0
- package/dist/components/dash-indicator/DashIndicator.js +2 -0
- package/dist/components/dash-indicator/index.d.ts +3 -0
- package/dist/components/data-row/DataRow.d.ts +58 -0
- package/dist/components/data-row/DataRow.js +2 -0
- package/dist/components/data-row/index.d.ts +3 -0
- package/dist/components/date-picker/DateField.js +2 -0
- package/dist/components/date-picker/DatePicker.d.ts +56 -0
- package/dist/components/date-picker/DatePicker.js +2 -0
- package/dist/components/date-picker/DateRangePicker.d.ts +57 -0
- package/dist/components/date-picker/DateRangePicker.js +2 -0
- package/dist/components/date-picker/index.d.ts +4 -0
- package/dist/components/dialog/Dialog.d.ts +55 -0
- package/dist/components/dialog/Dialog.js +2 -0
- package/dist/components/dialog/index.d.ts +3 -0
- package/dist/components/dialog/initial-focus.js +2 -0
- package/dist/components/dialog/overlay-style.js +2 -0
- package/dist/components/drawer/Drawer.d.ts +48 -0
- package/dist/components/drawer/Drawer.js +2 -0
- package/dist/components/drawer/index.d.ts +3 -0
- package/dist/components/dropdown-menu/DropdownMenu.d.ts +115 -0
- package/dist/components/dropdown-menu/DropdownMenu.js +2 -0
- package/dist/components/dropdown-menu/MenuCheck.js +2 -0
- package/dist/components/dropdown-menu/index.d.ts +3 -0
- package/dist/components/dropdown-menu/menu-style.d.ts +4 -0
- package/dist/components/dropdown-menu/menu-style.js +2 -0
- package/dist/components/empty-state/EmptyState.d.ts +22 -0
- package/dist/components/empty-state/EmptyState.js +2 -0
- package/dist/components/empty-state/index.d.ts +3 -0
- package/dist/components/field/Field.d.ts +58 -0
- package/dist/components/field/Field.js +2 -0
- package/dist/components/field/index.d.ts +3 -0
- package/dist/components/file-upload/FileItem.d.ts +50 -0
- package/dist/components/file-upload/FileItem.js +2 -0
- package/dist/components/file-upload/FileUpload.d.ts +82 -0
- package/dist/components/file-upload/FileUpload.js +2 -0
- package/dist/components/file-upload/index.d.ts +4 -0
- package/dist/components/flyout-bar/FlyoutBar.d.ts +46 -0
- package/dist/components/flyout-bar/FlyoutBar.js +2 -0
- package/dist/components/flyout-bar/index.d.ts +3 -0
- package/dist/components/ghost-text/GhostText.d.ts +21 -0
- package/dist/components/ghost-text/GhostText.js +2 -0
- package/dist/components/ghost-text/index.d.ts +3 -0
- package/dist/components/hatch/Hatch.d.ts +18 -0
- package/dist/components/hatch/Hatch.js +2 -0
- package/dist/components/hatch/index.d.ts +3 -0
- package/dist/components/hazard-stripe/HazardStripe.d.ts +15 -0
- package/dist/components/hazard-stripe/HazardStripe.js +2 -0
- package/dist/components/hazard-stripe/index.d.ts +3 -0
- package/dist/components/hover-card/HoverCard.d.ts +35 -0
- package/dist/components/hover-card/HoverCard.js +2 -0
- package/dist/components/hover-card/index.d.ts +3 -0
- package/dist/components/icon-button/IconButton.d.ts +21 -0
- package/dist/components/icon-button/IconButton.js +2 -0
- package/dist/components/icon-button/index.d.ts +3 -0
- package/dist/components/image-viewer/ImageViewer.d.ts +48 -0
- package/dist/components/image-viewer/ImageViewer.js +2 -0
- package/dist/components/image-viewer/index.d.ts +3 -0
- package/dist/components/input/Input.d.ts +27 -0
- package/dist/components/input/Input.js +2 -0
- package/dist/components/input/control-box.d.ts +5 -0
- package/dist/components/input/control-box.js +2 -0
- package/dist/components/input/index.d.ts +3 -0
- package/dist/components/input/value-chip.js +2 -0
- package/dist/components/item-slot/ItemGrid.d.ts +12 -0
- package/dist/components/item-slot/ItemGrid.js +2 -0
- package/dist/components/item-slot/ItemSlot.d.ts +54 -0
- package/dist/components/item-slot/ItemSlot.js +2 -0
- package/dist/components/item-slot/index.d.ts +4 -0
- package/dist/components/kbd/Kbd.d.ts +15 -0
- package/dist/components/kbd/Kbd.js +2 -0
- package/dist/components/kbd/index.d.ts +3 -0
- package/dist/components/link-element/LinkElement.d.ts +6 -0
- package/dist/components/link-element/LinkElement.js +2 -0
- package/dist/components/list/List.d.ts +46 -0
- package/dist/components/list/List.js +2 -0
- package/dist/components/list/band-style.js +2 -0
- package/dist/components/list/index.d.ts +3 -0
- package/dist/components/loader/Loader.d.ts +23 -0
- package/dist/components/loader/Loader.js +2 -0
- package/dist/components/loader/index.d.ts +3 -0
- package/dist/components/marquee/Marquee.d.ts +22 -0
- package/dist/components/marquee/Marquee.js +2 -0
- package/dist/components/marquee/index.d.ts +3 -0
- package/dist/components/media-card/MediaCard.d.ts +36 -0
- package/dist/components/media-card/MediaCard.js +2 -0
- package/dist/components/media-card/index.d.ts +3 -0
- package/dist/components/nav-action/NavAction.d.ts +34 -0
- package/dist/components/nav-action/NavAction.js +2 -0
- package/dist/components/nav-action/index.d.ts +3 -0
- package/dist/components/nav-menu/NavMenu.d.ts +57 -0
- package/dist/components/nav-menu/NavMenu.js +2 -0
- package/dist/components/nav-menu/index.d.ts +3 -0
- package/dist/components/navigator/Navigator.d.ts +27 -0
- package/dist/components/navigator/Navigator.js +2 -0
- package/dist/components/navigator/index.d.ts +3 -0
- package/dist/components/otp-input/OtpInput.d.ts +52 -0
- package/dist/components/otp-input/OtpInput.js +2 -0
- package/dist/components/otp-input/index.d.ts +3 -0
- package/dist/components/page-header/PageHeader.d.ts +56 -0
- package/dist/components/page-header/PageHeader.js +2 -0
- package/dist/components/page-header/index.d.ts +3 -0
- package/dist/components/pagination/Pagination.d.ts +29 -0
- package/dist/components/pagination/Pagination.js +2 -0
- package/dist/components/pagination/index.d.ts +3 -0
- package/dist/components/panel/Panel.d.ts +36 -0
- package/dist/components/panel/Panel.js +2 -0
- package/dist/components/panel/index.d.ts +3 -0
- package/dist/components/play-button/PlayButton.d.ts +20 -0
- package/dist/components/play-button/PlayButton.js +2 -0
- package/dist/components/play-button/index.d.ts +3 -0
- package/dist/components/popover/Popover.d.ts +36 -0
- package/dist/components/popover/Popover.js +2 -0
- package/dist/components/popover/index.d.ts +3 -0
- package/dist/components/popover/panel-style.js +2 -0
- package/dist/components/progress/Progress.d.ts +27 -0
- package/dist/components/progress/Progress.js +2 -0
- package/dist/components/progress/ProgressRing.d.ts +23 -0
- package/dist/components/progress/ProgressRing.js +2 -0
- package/dist/components/progress/index.d.ts +4 -0
- package/dist/components/radio/Radio.d.ts +33 -0
- package/dist/components/radio/Radio.js +2 -0
- package/dist/components/radio/index.d.ts +3 -0
- package/dist/components/rec-indicator/RecIndicator.d.ts +16 -0
- package/dist/components/rec-indicator/RecIndicator.js +2 -0
- package/dist/components/rec-indicator/index.d.ts +3 -0
- package/dist/components/registration-strip/RegistrationStrip.d.ts +16 -0
- package/dist/components/registration-strip/RegistrationStrip.js +2 -0
- package/dist/components/registration-strip/index.d.ts +3 -0
- package/dist/components/rolling-number/RollingNumber.d.ts +25 -0
- package/dist/components/rolling-number/RollingNumber.js +2 -0
- package/dist/components/rolling-number/index.d.ts +3 -0
- package/dist/components/schedule/Schedule.d.ts +78 -0
- package/dist/components/schedule/Schedule.js +2 -0
- package/dist/components/schedule/index.d.ts +3 -0
- package/dist/components/scroll-area/ScrollArea.d.ts +26 -0
- package/dist/components/scroll-area/ScrollArea.js +2 -0
- package/dist/components/scroll-area/index.d.ts +3 -0
- package/dist/components/scroll-hint/ScrollHint.d.ts +23 -0
- package/dist/components/scroll-hint/ScrollHint.js +2 -0
- package/dist/components/scroll-hint/index.d.ts +3 -0
- package/dist/components/section-title/SectionTitle.d.ts +33 -0
- package/dist/components/section-title/SectionTitle.js +2 -0
- package/dist/components/section-title/index.d.ts +3 -0
- package/dist/components/segmented-control/SegmentedControl.d.ts +49 -0
- package/dist/components/segmented-control/SegmentedControl.js +2 -0
- package/dist/components/segmented-control/index.d.ts +3 -0
- package/dist/components/select/Select.d.ts +95 -0
- package/dist/components/select/Select.js +2 -0
- package/dist/components/select/index.d.ts +3 -0
- package/dist/components/side-rail/SideRail.d.ts +62 -0
- package/dist/components/side-rail/SideRail.js +2 -0
- package/dist/components/side-rail/SideRailSub.d.ts +47 -0
- package/dist/components/side-rail/SideRailSub.js +2 -0
- package/dist/components/side-rail/index.d.ts +4 -0
- package/dist/components/skeleton/Skeleton.d.ts +22 -0
- package/dist/components/skeleton/Skeleton.js +2 -0
- package/dist/components/skeleton/index.d.ts +3 -0
- package/dist/components/slider/Slider.d.ts +63 -0
- package/dist/components/slider/Slider.js +2 -0
- package/dist/components/slider/index.d.ts +3 -0
- package/dist/components/sparkline/Sparkline.d.ts +32 -0
- package/dist/components/sparkline/Sparkline.js +2 -0
- package/dist/components/sparkline/index.d.ts +3 -0
- package/dist/components/spinner/Spinner.d.ts +19 -0
- package/dist/components/spinner/Spinner.js +2 -0
- package/dist/components/spinner/index.d.ts +3 -0
- package/dist/components/splash-screen/SplashScreen.d.ts +43 -0
- package/dist/components/splash-screen/SplashScreen.js +2 -0
- package/dist/components/splash-screen/index.d.ts +3 -0
- package/dist/components/stat/Stat.d.ts +22 -0
- package/dist/components/stat/Stat.js +2 -0
- package/dist/components/stat/index.d.ts +3 -0
- package/dist/components/stepper/Stepper.d.ts +29 -0
- package/dist/components/stepper/Stepper.js +2 -0
- package/dist/components/stepper/index.d.ts +3 -0
- package/dist/components/steps/Steps.d.ts +55 -0
- package/dist/components/steps/Steps.js +2 -0
- package/dist/components/steps/index.d.ts +3 -0
- package/dist/components/switch/Switch.d.ts +28 -0
- package/dist/components/switch/Switch.js +2 -0
- package/dist/components/switch/index.d.ts +3 -0
- package/dist/components/table/Table.d.ts +96 -0
- package/dist/components/table/Table.js +2 -0
- package/dist/components/table/index.d.ts +3 -0
- package/dist/components/tabs/Tabs.d.ts +39 -0
- package/dist/components/tabs/Tabs.js +2 -0
- package/dist/components/tabs/index.d.ts +3 -0
- package/dist/components/tag/Tag.d.ts +25 -0
- package/dist/components/tag/Tag.js +2 -0
- package/dist/components/tag/TagPair.d.ts +16 -0
- package/dist/components/tag/TagPair.js +2 -0
- package/dist/components/tag/index.d.ts +4 -0
- package/dist/components/tag-input/TagInput.d.ts +66 -0
- package/dist/components/tag-input/TagInput.js +3 -0
- package/dist/components/tag-input/index.d.ts +3 -0
- package/dist/components/term/Term.d.ts +19 -0
- package/dist/components/term/Term.js +2 -0
- package/dist/components/term/index.d.ts +3 -0
- package/dist/components/textarea/Textarea.d.ts +17 -0
- package/dist/components/textarea/Textarea.js +2 -0
- package/dist/components/textarea/index.d.ts +3 -0
- package/dist/components/texture/Texture.d.ts +19 -0
- package/dist/components/texture/Texture.js +2 -0
- package/dist/components/texture/index.d.ts +3 -0
- package/dist/components/tick-ring/TickRing.d.ts +22 -0
- package/dist/components/tick-ring/TickRing.js +2 -0
- package/dist/components/tick-ring/index.d.ts +3 -0
- package/dist/components/timeline/Timeline.d.ts +22 -0
- package/dist/components/timeline/Timeline.js +2 -0
- package/dist/components/timeline/index.d.ts +3 -0
- package/dist/components/toast/Toast.d.ts +45 -0
- package/dist/components/toast/Toast.js +2 -0
- package/dist/components/toast/index.d.ts +3 -0
- package/dist/components/toc/Toc.d.ts +46 -0
- package/dist/components/toc/Toc.js +2 -0
- package/dist/components/toc/index.d.ts +3 -0
- package/dist/components/toolbar/Toolbar.d.ts +97 -0
- package/dist/components/toolbar/Toolbar.js +2 -0
- package/dist/components/toolbar/index.d.ts +3 -0
- package/dist/components/tooltip/Tooltip.d.ts +47 -0
- package/dist/components/tooltip/Tooltip.js +2 -0
- package/dist/components/tooltip/index.d.ts +3 -0
- package/dist/components/top-bar/TopBar.d.ts +21 -0
- package/dist/components/top-bar/TopBar.js +2 -0
- package/dist/components/top-bar/index.d.ts +3 -0
- package/dist/components/viewfinder/Viewfinder.d.ts +35 -0
- package/dist/components/viewfinder/Viewfinder.js +2 -0
- package/dist/components/viewfinder/index.d.ts +3 -0
- package/dist/game/animated-dialog/AnimatedDialog.d.ts +53 -0
- package/dist/game/animated-dialog/AnimatedDialog.js +2 -0
- package/dist/game/animated-dialog/index.d.ts +3 -0
- package/dist/game/assets/splash_bg.jpg +0 -0
- package/dist/game/assets/splash_bg_portrait.jpg +0 -0
- package/dist/game/assets/splash_deco.svg +4 -0
- package/dist/game/assets/splash_logo.svg +1 -0
- package/dist/game/assets/splash_triangles.svg +4 -0
- package/dist/game/banner-alert/AlertIcons.js +2 -0
- package/dist/game/banner-alert/AlertModal.js +2 -0
- package/dist/game/banner-alert/BannerAlert.d.ts +6 -0
- package/dist/game/banner-alert/BannerAlert.js +2 -0
- package/dist/game/banner-alert/index.d.ts +3 -0
- package/dist/game/banner-alert/types.d.ts +48 -0
- package/dist/game/banner-alert/types.js +2 -0
- package/dist/game/banner-alert/useAlertActions.js +2 -0
- package/dist/game/banner-alert/useAlertGlitch.js +2 -0
- package/dist/game/full-width-alert/FullWidthAlert.d.ts +7 -0
- package/dist/game/full-width-alert/FullWidthAlert.js +2 -0
- package/dist/game/full-width-alert/index.d.ts +3 -0
- package/dist/game/item-card/ItemCard.d.ts +48 -0
- package/dist/game/item-card/ItemCard.js +2 -0
- package/dist/game/item-card/index.d.ts +3 -0
- package/dist/game/item-hover-card/ItemHoverCard.d.ts +31 -0
- package/dist/game/item-hover-card/ItemHoverCard.js +2 -0
- package/dist/game/item-hover-card/events.js +2 -0
- package/dist/game/item-hover-card/index.d.ts +3 -0
- package/dist/game/item-icon/ItemIcon.d.ts +5 -0
- package/dist/game/item-icon/ItemIcon.js +2 -0
- package/dist/game/item-icon/helpers.d.ts +22 -0
- package/dist/game/item-icon/helpers.js +2 -0
- package/dist/game/item-icon/index.d.ts +5 -0
- package/dist/game/item-icon/types.d.ts +32 -0
- package/dist/game/item-tooltip-card/ItemTooltipCard.d.ts +6 -0
- package/dist/game/item-tooltip-card/ItemTooltipCard.js +2 -0
- package/dist/game/item-tooltip-card/icons.js +2 -0
- package/dist/game/item-tooltip-card/index.d.ts +4 -0
- package/dist/game/item-tooltip-card/types.d.ts +40 -0
- package/dist/game/lib/core.d.ts +8 -0
- package/dist/game/lib/first-focusable.js +2 -0
- package/dist/game/resource-provenance.json +70 -1
- package/dist/game/rounded-button/RoundedButton.d.ts +22 -0
- package/dist/game/rounded-button/RoundedButton.js +2 -0
- package/dist/game/rounded-button/RoundedIconButton.d.ts +10 -0
- package/dist/game/rounded-button/RoundedIconButton.js +2 -0
- package/dist/game/rounded-button/index.d.ts +4 -0
- package/dist/game/rounded-select/RoundedSelect.d.ts +43 -0
- package/dist/game/rounded-select/RoundedSelect.js +2 -0
- package/dist/game/rounded-select/index.d.ts +3 -0
- package/dist/game/rounded-switch/RoundedSwitch.d.ts +16 -0
- package/dist/game/rounded-switch/RoundedSwitch.js +2 -0
- package/dist/game/rounded-switch/index.d.ts +3 -0
- package/dist/game/rounded-toggle/RoundedToggle.d.ts +23 -0
- package/dist/game/rounded-toggle/RoundedToggle.js +2 -0
- package/dist/game/rounded-toggle/index.d.ts +3 -0
- package/dist/game/rounded-toggle/keyboard.js +2 -0
- package/dist/game/rounded-toggle/spring-highlight.js +2 -0
- package/dist/game/splash-screen/EndfieldSplashScreen.d.ts +14 -0
- package/dist/game/splash-screen/EndfieldSplashScreen.js +2 -0
- package/dist/game/splash-screen/index.d.ts +3 -0
- package/dist/game/styles.css +1 -1
- package/dist/game.d.ts +29 -371
- package/dist/game.js +1 -2041
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/useAddedKeys.js +2 -0
- package/dist/hooks/useControllableState.d.ts +12 -0
- package/dist/hooks/useControllableState.js +2 -0
- package/dist/hooks/useFlip.js +2 -0
- package/dist/hooks/useInView.d.ts +15 -0
- package/dist/hooks/useInView.js +2 -0
- package/dist/hooks/useIndicator.js +2 -0
- package/dist/hooks/useLingering.js +2 -0
- package/dist/hooks/useOverflowing.js +2 -0
- package/dist/hooks/usePortalScope.d.ts +26 -0
- package/dist/hooks/usePortalScope.js +2 -0
- package/dist/hooks/usePresence.js +2 -0
- package/dist/hooks/useReducedMotion.d.ts +10 -0
- package/dist/hooks/useReducedMotion.js +2 -0
- package/dist/hooks/useScrollPosition.js +2 -0
- package/dist/hooks/useTheme.d.ts +21 -0
- package/dist/hooks/useTheme.js +2 -0
- package/dist/icons/ArrowCorner.d.ts +9 -0
- package/dist/icons/ArrowCorner.js +2 -0
- package/dist/icons/ArrowLeft.d.ts +8 -0
- package/dist/icons/ArrowLeft.js +2 -0
- package/dist/icons/ArrowRight.d.ts +8 -0
- package/dist/icons/ArrowRight.js +2 -0
- package/dist/icons/CalendarIcon.d.ts +12 -0
- package/dist/icons/CalendarIcon.js +2 -0
- package/dist/icons/Check.d.ts +9 -0
- package/dist/icons/Check.js +2 -0
- package/dist/icons/ChevronDown.d.ts +8 -0
- package/dist/icons/ChevronDown.js +2 -0
- package/dist/icons/ChevronLeft.d.ts +8 -0
- package/dist/icons/ChevronLeft.js +2 -0
- package/dist/icons/ChevronRight.d.ts +8 -0
- package/dist/icons/ChevronRight.js +2 -0
- package/dist/icons/Close.d.ts +8 -0
- package/dist/icons/Close.js +2 -0
- package/dist/icons/Crosshair.d.ts +9 -0
- package/dist/icons/Crosshair.js +2 -0
- package/dist/icons/Lock.d.ts +8 -0
- package/dist/icons/Lock.js +2 -0
- package/dist/icons/Menu.d.ts +9 -0
- package/dist/icons/Menu.js +2 -0
- package/dist/icons/Minus.d.ts +9 -0
- package/dist/icons/Minus.js +2 -0
- package/dist/icons/Plus.d.ts +8 -0
- package/dist/icons/Plus.js +2 -0
- package/dist/icons/StatusDanger.d.ts +9 -0
- package/dist/icons/StatusDanger.js +2 -0
- package/dist/icons/StatusInfo.d.ts +9 -0
- package/dist/icons/StatusInfo.js +2 -0
- package/dist/icons/StatusSuccess.d.ts +9 -0
- package/dist/icons/StatusSuccess.js +2 -0
- package/dist/icons/StatusWarning.d.ts +9 -0
- package/dist/icons/StatusWarning.js +2 -0
- package/dist/icons/TriangleRight.d.ts +9 -0
- package/dist/icons/TriangleRight.js +2 -0
- package/dist/icons/Upload.d.ts +9 -0
- package/dist/icons/Upload.js +2 -0
- package/dist/icons/createIcon.d.ts +16 -0
- package/dist/icons/createIcon.js +2 -0
- package/dist/icons/index.d.ts +23 -0
- package/dist/index.d.ts +209 -3505
- package/dist/index.js +1 -9625
- package/dist/lib/cn.d.ts +5 -0
- package/dist/lib/cn.js +2 -0
- package/dist/lib/create-lazy-context.js +2 -0
- package/dist/lib/date.js +2 -0
- package/dist/lib/decor.js +2 -0
- package/dist/lib/defined.js +2 -0
- package/dist/lib/file.js +2 -0
- package/dist/lib/focus-ring.js +2 -0
- package/dist/lib/inline-style.js +2 -0
- package/dist/lib/merge-refs.js +2 -0
- package/dist/lib/motion.js +2 -0
- package/dist/styles.css +1 -1
- package/package.json +17 -11
- package/src/components/accordion/Accordion.tsx +13 -5
- package/src/components/alert/Alert.tsx +1 -1
- package/src/components/avatar/AvatarSwitcher.tsx +7 -5
- package/src/components/carousel/Carousel.tsx +6 -5
- package/src/components/context-menu/ContextMenu.tsx +5 -2
- package/src/components/data-row/DataRow.tsx +10 -4
- package/src/components/date-picker/DateField.tsx +1 -3
- package/src/components/dropdown-menu/DropdownMenu.tsx +7 -4
- package/src/components/dropdown-menu/menu-style.ts +9 -3
- package/src/components/field/Field.tsx +10 -6
- package/src/components/file-upload/FileUpload.tsx +5 -2
- package/src/components/flyout-bar/FlyoutBar.tsx +1 -1
- package/src/components/image-viewer/ImageViewer.tsx +6 -5
- package/src/components/input/control-box.ts +30 -10
- package/src/components/list/List.tsx +7 -5
- package/src/components/nav-action/NavAction.tsx +4 -3
- package/src/components/nav-menu/NavMenu.tsx +13 -7
- package/src/components/otp-input/OtpInput.tsx +35 -43
- package/src/components/radio/Radio.tsx +7 -5
- package/src/components/schedule/Schedule.tsx +7 -5
- package/src/components/segmented-control/SegmentedControl.tsx +9 -7
- package/src/components/select/Select.tsx +11 -11
- package/src/components/side-rail/SideRail.tsx +15 -9
- package/src/components/side-rail/SideRailSub.tsx +12 -7
- package/src/components/splash-screen/SplashScreen.tsx +340 -0
- package/src/components/splash-screen/index.ts +1 -0
- package/src/components/steps/Steps.tsx +7 -5
- package/src/components/table/Table.tsx +23 -17
- package/src/components/tabs/Tabs.tsx +7 -5
- package/src/components/tag-input/TagInput.tsx +5 -2
- package/src/components/toast/Toast.tsx +12 -8
- package/src/components/toc/Toc.tsx +5 -4
- package/src/components/toolbar/Toolbar.tsx +7 -6
- package/src/components/tooltip/Tooltip.tsx +7 -4
- package/src/components/top-bar/TopBar.tsx +7 -2
- package/src/icons/ArrowCorner.tsx +1 -1
- package/src/icons/ArrowLeft.tsx +1 -1
- package/src/icons/ArrowRight.tsx +1 -1
- package/src/icons/CalendarIcon.tsx +1 -1
- package/src/icons/Check.tsx +4 -1
- package/src/icons/ChevronDown.tsx +4 -1
- package/src/icons/ChevronLeft.tsx +1 -1
- package/src/icons/ChevronRight.tsx +1 -1
- package/src/icons/Close.tsx +4 -1
- package/src/icons/Crosshair.tsx +1 -1
- package/src/icons/Lock.tsx +1 -1
- package/src/icons/Menu.tsx +4 -1
- package/src/icons/Minus.tsx +1 -1
- package/src/icons/Plus.tsx +4 -1
- package/src/icons/StatusDanger.tsx +1 -1
- package/src/icons/StatusInfo.tsx +1 -1
- package/src/icons/StatusSuccess.tsx +1 -1
- package/src/icons/StatusWarning.tsx +1 -1
- package/src/icons/TriangleRight.tsx +1 -1
- package/src/icons/Upload.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/lib/cn.ts +1 -1
- package/src/lib/create-lazy-context.ts +6 -0
- package/src/styles/theme.css +33 -0
- package/src/styles/utilities.css +8 -0
- package/src/components/README.md +0 -190
- package/src/hooks/README.md +0 -20
- package/src/icons/README.md +0 -31
- package/src/lib/README.md +0 -19
- package/src/styles/README.md +0 -74
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
|
|
2
|
+
import { AlertModalProps } from "../banner-alert/types.js";
|
|
3
|
+
//#region src/game/full-width-alert/FullWidthAlert.d.ts
|
|
4
|
+
export type FullWidthAlertProps = Omit<AlertModalProps, "width">;
|
|
5
|
+
/** 横贯视口的确认面板,底部按钮突出于面板下沿。 */
|
|
6
|
+
export declare function FullWidthAlert({ hideCancel, cancelText, confirmText, showIcon, height, classNames, children, ...props }: FullWidthAlertProps): import("react").JSX.Element;
|
|
7
|
+
//#endregion
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{cn as e}from"../../lib/cn.js";import{RoundedButton as t}from"../rounded-button/RoundedButton.js";import{AlertCloseIcon as n,AlertTickIcon as r}from"../banner-alert/AlertIcons.js";import{alertSlotClass as i}from"../banner-alert/types.js";import{AlertModal as a}from"../banner-alert/AlertModal.js";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";import{ScrollArea as l}from"@base-ui/react/scroll-area";function u({hideCancel:u=!1,cancelText:d=`取消`,confirmText:f=`确认`,showIcon:p=!0,height:m=`auto`,classNames:h,children:g,..._}){return/* @__PURE__ */ s(a,{..._,hideCancel:u,height:m,classNames:h,popupClassName:`ef-full-width-alert`,backdropClassName:`ef-full-width-alert-backdrop`,viewportClassName:`ef-full-width-alert-viewport`,children:({open:a,busy:m,cancelRef:_,confirmRef:v,cancel:y,confirm:b})=>/* @__PURE__ */ c(o,{children:[/* @__PURE__ */ c(`div`,{"aria-hidden":`true`,className:`ef-full-width-alert-decoration`,children:[/* @__PURE__ */ s(`span`,{className:`ef-full-width-alert-logo`}),/* @__PURE__ */ s(`span`,{className:`ef-full-width-alert-color-bar`}),/* @__PURE__ */ c(`div`,{className:`ef-full-width-alert-banner`,children:[/* @__PURE__ */ s(`span`,{className:`ef-full-width-alert-banner-left`}),/* @__PURE__ */ s(`span`,{className:`ef-full-width-alert-banner-right`})]})]}),/* @__PURE__ */ s(`div`,{className:e(`ef-full-width-alert-content`,i(h?.content,a)),children:/* @__PURE__ */ c(l.Root,{className:`ef-full-width-alert-scroll-area`,children:[/* @__PURE__ */ s(l.Viewport,{className:`ef-full-width-alert-viewport-content`,style:{overflowX:`hidden`},render:(e,t)=>/* @__PURE__ */ s(`div`,{...e,role:t.hasOverflowY?`region`:`presentation`,"aria-label":t.hasOverflowY?`内容`:void 0,tabIndex:t.hasOverflowY?0:-1}),children:/* @__PURE__ */ s(l.Content,{className:`ef-full-width-alert-body`,children:g})}),/* @__PURE__ */ s(l.Scrollbar,{orientation:`vertical`,className:`ef-full-width-alert-scrollbar`,children:/* @__PURE__ */ s(l.Thumb,{className:`ef-full-width-alert-thumb`})})]})}),/* @__PURE__ */ c(`div`,{className:`ef-full-width-alert-actions`,children:[!u&&/* @__PURE__ */ c(`div`,{className:`ef-full-width-alert-action`,children:[/* @__PURE__ */ s(`span`,{"aria-hidden":`true`,className:`ef-full-width-alert-action-backing`}),/* @__PURE__ */ s(t,{ref:_,variant:`default`,text:d,showIcon:p,disabled:m,onClick:y,icon:/* @__PURE__ */ s(n,{}),className:`ef-full-width-alert-button`})]}),/* @__PURE__ */ c(`div`,{className:`ef-full-width-alert-action`,children:[/* @__PURE__ */ s(`span`,{"aria-hidden":`true`,className:`ef-full-width-alert-action-backing`}),/* @__PURE__ */ s(t,{ref:v,variant:`primary`,text:f,showIcon:p,loading:m,disabled:m,onClick:b,icon:/* @__PURE__ */ s(r,{}),className:`ef-full-width-alert-button`})]})]})]})})}export{u as FullWidthAlert};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
import { ItemIconImageRenderer, ItemIconLayers } from "../item-icon/types.js";
|
|
3
|
+
import "../item-icon/index.js";
|
|
4
|
+
import { CSSProperties, ReactNode } from "react";
|
|
5
|
+
//#region src/game/item-card/ItemCard.d.ts
|
|
6
|
+
export type ItemCardKind = "weapon" | "item" | "enemy" | "";
|
|
7
|
+
export type ItemCardVariant = "banner" | "inventory";
|
|
8
|
+
export type ItemCardSelectionAction = {
|
|
9
|
+
onSelect: () => void;
|
|
10
|
+
ariaLabel?: string;
|
|
11
|
+
selected?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
disabledReason?: string;
|
|
14
|
+
};
|
|
15
|
+
export type ItemCardLinkProps = {
|
|
16
|
+
href: string;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
className: string;
|
|
19
|
+
"aria-label": string;
|
|
20
|
+
"data-item-tooltip-id"?: string;
|
|
21
|
+
};
|
|
22
|
+
export type ItemCardLinkRenderer = (props: ItemCardLinkProps) => ReactNode;
|
|
23
|
+
export type ItemCardProps = {
|
|
24
|
+
kind: ItemCardKind;
|
|
25
|
+
name: string;
|
|
26
|
+
imageUrl: string;
|
|
27
|
+
rarity: number;
|
|
28
|
+
itemId?: string;
|
|
29
|
+
/** 实际链接地址;组件不转换 Wiki 文章标题。 */
|
|
30
|
+
href?: string;
|
|
31
|
+
variant?: ItemCardVariant;
|
|
32
|
+
count?: number;
|
|
33
|
+
showName?: boolean;
|
|
34
|
+
className?: string;
|
|
35
|
+
style?: CSSProperties;
|
|
36
|
+
icon?: ItemIconLayers;
|
|
37
|
+
action?: ItemCardSelectionAction;
|
|
38
|
+
badges?: ReactNode;
|
|
39
|
+
ariaLabel?: string;
|
|
40
|
+
fallback?: ReactNode;
|
|
41
|
+
renderImage?: ItemIconImageRenderer;
|
|
42
|
+
renderLink?: ItemCardLinkRenderer;
|
|
43
|
+
renderName?: (name: string) => ReactNode;
|
|
44
|
+
renderCount?: (count: number) => ReactNode;
|
|
45
|
+
};
|
|
46
|
+
/** Wiki 物品卡片:名称横条或库存数量横条,共用完整图层图标。 */
|
|
47
|
+
export declare const ItemCard: import("react").MemoExoticComponent<({ kind, name, imageUrl, rarity, itemId, href, variant, count, showName, className, style, icon, action, badges, ariaLabel, fallback, renderImage, renderLink, renderName, renderCount }: ItemCardProps) => string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined>;
|
|
48
|
+
//#endregion
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{cn as e}from"../../lib/cn.js";import{EMPTY_ITEM_ICON_LAYERS as t}from"../item-icon/helpers.js";import{ItemIcon as n}from"../item-icon/ItemIcon.js";import{memo as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";const o={weapon:`武器`,item:`物品`,enemy:`敌人`};function s(e){return e===`weapon`||e===`item`||e===`enemy`}function c(e){return Math.min(Math.max(Math.trunc(e),1),6)}function l(e){let t=0;for(let n of e)t+=(n.codePointAt(0)??0)<11904?.5:1;return t>0?`clamp(9px, calc(100cqw / ${t}), 14px)`:void 0}const u=/* @__PURE__ */ r(function({kind:r,name:u,imageUrl:d,rarity:f,itemId:p,href:m,variant:h=`banner`,count:g=0,showName:_=!0,className:v,style:y,icon:b,action:x,badges:S,ariaLabel:C,fallback:w,renderImage:T,renderLink:E,renderName:D,renderCount:O}){if(!s(r))return null;let k=Number.isFinite(f)&&f>0&&(b?.iconShowRarity??!0),A=h===`inventory`,j={...t,...b,iconUrl:d},M=C||u||o[r],N=D?D(u):u||`—`,P=/* @__PURE__ */ a(`div`,{className:`ef-item-card-tile`,children:[/* @__PURE__ */ i(`span`,{"aria-hidden":`true`,className:`ef-item-card-background`}),/* @__PURE__ */ i(`div`,{className:`ef-item-card-art`,children:/* @__PURE__ */ i(n,{layers:j,alt:u,className:`ef-item-card-icon`,renderImage:T,fallback:w===void 0?/* @__PURE__ */ i(`span`,{className:`ef-item-card-fallback`,children:`NO IMAGE`}):w})}),S?/* @__PURE__ */ i(`div`,{className:`ef-item-card-badges`,children:S}):null,/* @__PURE__ */ a(`div`,{className:`ef-item-card-strip`,children:[/* @__PURE__ */ i(`span`,{"aria-hidden":`true`,className:`ef-item-card-edge`}),/* @__PURE__ */ i(`div`,{className:`ef-item-card-strip-content`,children:A?/* @__PURE__ */ i(`span`,{className:`ef-item-card-count`,children:O?O(g):g>0?g:`\xA0`}):/* @__PURE__ */ i(`span`,{className:`ef-item-card-name`,style:{fontSize:l(u)},title:u,children:_?N:`\xA0`})})]})]}),F=/* @__PURE__ */ a(`div`,{className:e(`ef-item-card`,v),style:y,"data-kind":r,"data-variant":h,"data-rarity":k?c(f):void 0,"data-item-tooltip-id":!x&&!m&&r===`item`?p:void 0,children:[P,A&&_&&/* @__PURE__ */ i(`span`,{className:`ef-item-card-caption`,title:u,children:N})]});if(x)return/* @__PURE__ */ a(`button`,{type:`button`,onClick:x.onSelect,disabled:x.disabled,"aria-pressed":x.selected,"aria-label":[x.ariaLabel||M,x.disabledReason].filter(Boolean).join(` · `),className:`ef-item-card-action`,"data-selected":x.selected?``:void 0,children:[F,x.disabledReason&&/* @__PURE__ */ i(`span`,{className:`ef-item-card-disabled-reason`,children:x.disabledReason})]});if(m){let e={href:m,children:F,className:`ef-item-card-link`,"aria-label":M,"data-item-tooltip-id":r===`item`?p:void 0};return E?E(e):/* @__PURE__ */ i(`a`,{...e})}return F});export{u as ItemCard};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
|
|
2
|
+
import { ItemCard, ItemCardKind, ItemCardLinkProps, ItemCardLinkRenderer, ItemCardProps, ItemCardSelectionAction, ItemCardVariant } from "./ItemCard.js";
|
|
3
|
+
export { ItemCard, type ItemCardKind, type ItemCardLinkProps, type ItemCardLinkRenderer, type ItemCardProps, type ItemCardSelectionAction, type ItemCardVariant };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
import { ItemTooltipCardProps, ItemTooltipItem } from "../item-tooltip-card/types.js";
|
|
3
|
+
import "../item-tooltip-card/index.js";
|
|
4
|
+
import { CSSProperties, HTMLAttributes, ReactNode, RefObject } from "react";
|
|
5
|
+
//#region src/game/item-hover-card/ItemHoverCard.d.ts
|
|
6
|
+
export type ItemHoverCardLayerProps = {
|
|
7
|
+
/** 由使用方的本地数据或缓存解析;组件不发请求。 */
|
|
8
|
+
resolveItem: (itemId: string, host: HTMLElement) => ItemTooltipItem | null | undefined;
|
|
9
|
+
root?: HTMLElement | Document;
|
|
10
|
+
rootRef?: RefObject<HTMLElement | null>;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** 默认只在 768px 以上、支持精细指针悬停的设备启用。 */
|
|
13
|
+
disableOnMobile?: boolean;
|
|
14
|
+
openDelay?: number;
|
|
15
|
+
closeDelay?: number;
|
|
16
|
+
gap?: number;
|
|
17
|
+
width?: CSSProperties["width"];
|
|
18
|
+
className?: string;
|
|
19
|
+
style?: CSSProperties;
|
|
20
|
+
cardProps?: Omit<ItemTooltipCardProps, "item">;
|
|
21
|
+
onOpenChange?: (open: boolean, itemId: string | null) => void;
|
|
22
|
+
};
|
|
23
|
+
/** 一个监听层为网格内所有 data-item-tooltip-id 提供物品预览。 */
|
|
24
|
+
export declare function ItemHoverCardLayer({ resolveItem, root, rootRef, disabled, disableOnMobile, openDelay, closeDelay, gap, width, className, style, cardProps, onOpenChange }: ItemHoverCardLayerProps): import("react").JSX.Element | null;
|
|
25
|
+
export type ItemHoverCardProps = Omit<ItemHoverCardLayerProps, "resolveItem" | "root" | "rootRef"> & {
|
|
26
|
+
item: ItemTooltipItem;
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
triggerProps?: Omit<HTMLAttributes<HTMLSpanElement>, "children">;
|
|
29
|
+
};
|
|
30
|
+
export declare function ItemHoverCard({ item, children, triggerProps, ...layerProps }: ItemHoverCardProps): import("react").JSX.Element;
|
|
31
|
+
//#endregion
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{cn as e}from"../../lib/cn.js";import{usePortalScope as t}from"../../hooks/usePortalScope.js";import{ItemTooltipCard as n}from"../item-tooltip-card/ItemTooltipCard.js";import{bindItemHoverEvents as r}from"./events.js";import{useCallback as i,useEffect as a,useId as o,useLayoutEffect as s,useRef as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{Popover as f}from"@base-ui/react/popover";import{flushSync as p}from"react-dom";function m({resolveItem:e,root:t,rootRef:n,disabled:o=!1,disableOnMobile:d=!0,openDelay:f=180,closeDelay:p=160,gap:m=8,width:g=320,className:_,style:v,cardProps:y,onOpenChange:b}){let[x,S]=l(null),C=c(null),w=c(null),T=c(null),E=c(e),D=c({root:t,rootRef:n}),O=c(b);s(()=>{E.current=e,D.current={root:t,rootRef:n},O.current=b});let k=i(()=>w.current?.close(),[]);a(()=>{let e=o?null:n?.current??t??document,i=T.current,a=e?e.ownerDocument??e:null,s=n?n.current:t??e;if(x&&!s?.contains(x.host)&&w.current?.close(),i&&i.root===a&&i.disableOnMobile===d&&i.openDelay===f&&i.closeDelay===p||(i?.dispose(),T.current=null,!e))return;let c=(e.ownerDocument??e).defaultView.matchMedia(`(min-width: 768px) and (hover: hover) and (pointer: fine)`),l=()=>{w.current?.close(),w.current?.dispose(),w.current=null,(!d||c.matches)&&(w.current=r({root:e,rootOf:()=>{let e=D.current;return e.rootRef?e.rootRef.current:e.root??a},anchorOf:e=>{let t=e.dataset.itemTooltipId;return t&&E.current(t,e)?{host:e,itemId:t}:null},openDelay:f,closeDelay:p},S,()=>C.current))};l(),c.addEventListener(`change`,l),T.current={root:a,disableOnMobile:d,openDelay:f,closeDelay:p,dispose:()=>{c.removeEventListener(`change`,l),w.current?.close(),w.current?.dispose(),w.current=null}}}),a(()=>()=>{T.current?.dispose(),T.current=null},[]);let A=x?.host.dataset.itemTooltipId,j=!o&&x&&A?e(A,x.host):null,M=j?A??null:null;return a(()=>{O.current?.(!!M,M)},[M]),!x||!j?null:/* @__PURE__ */ u(h,{anchor:x,item:j,panelRef:C,close:k,dismiss:e=>w.current?.dismiss(e),gap:m,width:g,className:_,style:v,cardProps:y})}function h({anchor:r,item:i,panelRef:c,close:l,dismiss:d,gap:m,width:h,className:g,style:_,cardProps:v}){let y=o(),{anchorRef:b,portalRef:x}=t();return s(()=>{let e=r.host.ownerDocument,t=[`aria-controls`,`aria-expanded`,`aria-haspopup`],n=null,i=[],a=()=>{n&&t.forEach((e,t)=>{let r=i[t];r==null?n?.removeAttribute(e):n?.setAttribute(e,r)})},o=()=>{let o=r.host.contains(e.activeElement)?e.activeElement:r.host;o!==n&&(a(),n=o,i=t.map(e=>n.getAttribute(e)),n.setAttribute(`aria-controls`,y),n.setAttribute(`aria-expanded`,`true`),n.setAttribute(`aria-haspopup`,`dialog`))};o();let s=e=>{if(e.defaultPrevented)return;let t=c.current?.querySelector(`a[href],button:not(:disabled),[tabindex='0']`);e.key===`Tab`&&!t?p(l):e.key===`ArrowDown`&&t&&(e.preventDefault(),t.focus({preventScroll:!0}))};return r.host.addEventListener(`keydown`,s),r.host.addEventListener(`focusin`,o),()=>{r.host.removeEventListener(`keydown`,s),r.host.removeEventListener(`focusin`,o),a()}},[r.host,l,y,c]),a(()=>{let e=typeof IntersectionObserver>`u`?null:new IntersectionObserver(e=>{e.some(e=>!e.isIntersecting)&&l()});return e?.observe(r.host),()=>e?.disconnect()},[r.host,l]),/* @__PURE__ */ u(f.Root,{open:!0,onOpenChange:(e,t)=>{e||(t.reason===`focus-out`?t.cancel():d(t.reason===`escape-key`))},children:/* @__PURE__ */ u(f.Portal,{ref:e=>{b(r.host),x(e)},container:r.host.closest(`dialog,[role='dialog'],[role='alertdialog']`)??void 0,children:/* @__PURE__ */ u(f.Positioner,{anchor:r.host,positionMethod:`fixed`,side:`right`,align:`start`,sideOffset:m,collisionBoundary:[],collisionPadding:8,collisionAvoidance:{side:`flip`,align:`shift`},className:`ef-item-hover-positioner`,style:{width:h,..._},children:/* @__PURE__ */ u(f.Popup,{ref:c,id:y,"aria-label":i.name,initialFocus:!1,finalFocus:!1,"data-item-tooltip-panel":``,className:e(`ef-item-hover-panel`,g),children:/* @__PURE__ */ u(n,{...v,item:i})})})})})}function g({item:t,children:n,triggerProps:r,...i}){let a=c(null),s=o();return/* @__PURE__ */ d(`span`,{...r,className:e(`ef-item-hover-trigger`,r?.className),ref:a,"data-item-tooltip-id":s,children:[n,/* @__PURE__ */ u(m,{...i,rootRef:a,resolveItem:()=>t})]})}export{g as ItemHoverCard,m as ItemHoverCardLayer};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function e(e,t,n){let r=e.root.ownerDocument??e.root,i=r.defaultView,a=null,o=null,s=null,c=null,l,u,d=!1,f,p=null,m=()=>{i.clearTimeout(l),i.clearTimeout(u),l=u=void 0},h=()=>{m(),a=null,f=void 0,p=null,d=!1,M(),t(null)},g=e=>e instanceof Node&&!!n()?.contains(e),_=e=>g(e)||e instanceof Node&&!!a?.contains(e),v=t=>{if(!(t instanceof Element)||g(t)||t.closest(`[inert], [aria-disabled='true'], :disabled`))return null;let n=t.closest(`[data-item-tooltip-id]`),r=e.rootOf?e.rootOf():e.root;return!n||!r?.contains(n)||n.closest(`[inert], [aria-disabled='true'], :disabled`)?null:e.anchorOf(n)?n:null},y=(n,r,s)=>{n!==o&&(o=null,i.clearTimeout(u),u=void 0,n===a&&d?(p=s,f!==n.dataset.itemTooltipId&&(f=n.dataset.itemTooltipId,t(e.anchorOf(n)))):n===a&&l!==void 0&&r>0||(m(),a=n,f=n.dataset.itemTooltipId,p=s,d=!1,j(),t(null),l=i.setTimeout(()=>{l=void 0;let r=n.isConnected&&v(s)===n?e.anchorOf(n):null;if(a===n){if(!r)return h();d=!0,f=n.dataset.itemTooltipId,t(r)}},Math.max(0,r))))},b=()=>{_(c)||_(r.activeElement)?(i.clearTimeout(u),u=void 0):(m(),u=i.setTimeout(h,Math.max(0,e.closeDelay)))},x=(e,t)=>{e instanceof Node&&o?.contains(e)&&!(t instanceof Node&&o.contains(t))&&(o=null)},S=t=>{if(t.pointerType===`touch`)return;if(c=t.target,g(t.target))return m();let n=v(t.target);n&&y(n,e.openDelay,t.target)},C=e=>{e.pointerType!==`touch`&&(c=e.relatedTarget,x(e.target,e.relatedTarget),a&&_(e.target)&&!_(e.relatedTarget)&&b())},w=e=>{if(g(e.target))return m();let t=v(e.target);t&&(s=e.target instanceof HTMLElement?e.target:t,y(t,0,e.target))},T=e=>{x(e.target,e.relatedTarget),a&&_(e.target)&&!_(e.relatedTarget)&&b()},E=e=>{a&&!g(e.target)&&h()},D=(e=!1)=>{let t=e=>!(!e?.isConnected||e.closest(`[hidden],[inert],[aria-disabled='true'],:disabled`)),n=e&&g(r.activeElement)&&a?s&&t(s)&&a.contains(s)?s:Array.from(a.querySelectorAll(`a[href],button:not(:disabled),[tabindex='0']`)).find(t)??(t(a)&&a.matches(`a[href],button,[tabindex]`)?a:null)??(t(a.closest(`[role='dialog']`))?a.closest(`[role='dialog']`):null):null;o=a,h(),n?.isConnected&&n.focus({preventScroll:!0})},O=[[`pointerover`,S],[`pointerout`,C],[`focusin`,w],[`focusout`,T]];for(let[e,t]of O)r.addEventListener(e,t);let k=new MutationObserver(()=>{if(a){if(v(p)!==a||!a.isConnected)return D(!0);if(d&&f!==a.dataset.itemTooltipId){f=a.dataset.itemTooltipId;let n=e.anchorOf(a);n?t(n):D(!0)}}}),A=!1;function j(){A||(A=!0,k.observe(r,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-tooltip-id`,`disabled`,`inert`,`aria-disabled`]}),i.addEventListener(`scroll`,E,!0),i.addEventListener(`resize`,h))}function M(){A&&(A=!1,k.disconnect(),i.removeEventListener(`scroll`,E,!0),i.removeEventListener(`resize`,h))}return{close:h,dismiss:D,dispose(){m(),M();for(let[e,t]of O)r.removeEventListener(e,t)}}}export{e as bindItemHoverEvents};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{cn as e}from"../../lib/cn.js";import{coerceItemIconTrans as t,itemIconTransformStyle as n}from"./helpers.js";import{Fragment as r,useState as i}from"react";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";function c({src:e,alt:t,className:n,style:r,loading:s=`lazy`,fallback:c=null}){let[l,u]=i(!1);return!e.trim()||l?/* @__PURE__ */ o(a,{children:c}):/* @__PURE__ */ o(`img`,{src:e,alt:t,className:n,style:r,loading:s,decoding:`async`,draggable:!1,onError:()=>u(!0)})}function l({layers:i,alt:a,className:l,style:u,fallback:d=null,loading:f,renderImage:p}){let m=t(i.iconTrans),h=!!i.iconOverlayUrl,g=m===`formula`?n(`formula`):m===`bigGem`&&!h?n(`bigGem`):void 0,_=m===`bigGem`?n(`bigGem`):void 0,v=(e,t)=>/* @__PURE__ */ o(r,{children:p?p(t):/* @__PURE__ */ o(c,{...t})},`${e}:${t.src}`);return/* @__PURE__ */ s(`span`,{className:e(`ef-composite-item-icon`,l),style:u,children:[i.iconBgUrl&&v(`background`,{src:i.iconBgUrl,alt:``,className:`ef-composite-item-icon__layer`,loading:f}),v(`art`,{src:i.iconUrl,alt:a,className:`ef-composite-item-icon__layer ef-composite-item-icon__art`,style:g,loading:f,fallback:d}),h&&v(`overlay`,{src:i.iconOverlayUrl??``,alt:``,className:`ef-composite-item-icon__layer ef-composite-item-icon__overlay`,style:_,loading:f}),i.iconContentUrl&&v(`content`,{src:i.iconContentUrl,alt:``,className:`ef-composite-item-icon__layer`,style:{transform:`scale(${80/180})`,transformOrigin:`50% 50%`},loading:f}),i.iconMarkUrl&&v(`mark`,{src:i.iconMarkUrl,alt:``,className:`ef-composite-item-icon__layer`,loading:f})]})}export{l as ItemIcon};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
import { ItemIconLayers, ItemIconTrans } from "./types.js";
|
|
3
|
+
import { CSSProperties } from "react";
|
|
4
|
+
//#region src/game/item-icon/helpers.d.ts
|
|
5
|
+
export declare const EMPTY_ITEM_ICON_LAYERS: Readonly<Required<ItemIconLayers>>;
|
|
6
|
+
export declare const ITEM_ICON_TRANSFORMS: {
|
|
7
|
+
readonly formula: {
|
|
8
|
+
readonly scale: 0.72;
|
|
9
|
+
readonly pivotX: 1;
|
|
10
|
+
readonly pivotY: 0.5;
|
|
11
|
+
};
|
|
12
|
+
readonly bigGem: {
|
|
13
|
+
readonly scale: 1;
|
|
14
|
+
readonly offsetX: 3;
|
|
15
|
+
readonly offsetY: 4;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type ItemIconTransformKey = keyof typeof ITEM_ICON_TRANSFORMS;
|
|
19
|
+
export declare function itemIconTransformStyle(key: ItemIconTransformKey): CSSProperties;
|
|
20
|
+
export declare function coerceItemIconTrans(value: unknown): ItemIconTrans;
|
|
21
|
+
export declare function pickItemIconLayers(source: object | null | undefined, prefix?: string): Required<ItemIconLayers>;
|
|
22
|
+
//#endregion
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const e={iconUrl:``,iconBgUrl:``,iconMarkUrl:``,iconOverlayUrl:``,iconContentUrl:``,iconTrans:``,iconShowRarity:!0},t={formula:{scale:.72,pivotX:1,pivotY:.5},bigGem:{scale:1,offsetX:3,offsetY:4}};function n(e){let n=(t,n)=>`var(--ef-game-iicon-${e}-${t}, ${n})`;if(e===`formula`){let e=t.formula;return{transform:`scale(${n(`scale`,e.scale)})`,transformOrigin:`calc(${n(`pivot-x`,e.pivotX)} * 100%) calc((1 - ${n(`pivot-y`,e.pivotY)}) * 100%)`}}let r=t.bigGem;return{transform:`translate(calc(${n(`offset-x`,r.offsetX)} * 1%), calc(${n(`offset-y`,r.offsetY)} * -1%)) scale(${n(`scale`,r.scale)})`,transformOrigin:`50% 50%`}}function r(e){return e===`formula`||e===`bigGem`?e:``}function i(e,t=`icon`){let n=e??{},i=e=>t===`icon`?e:`${t}${e.slice(0,1).toUpperCase()}${e.slice(1)}`,a=e=>{let t=n[i(e)];return typeof t==`string`?t:``},o=n[i(`iconShowRarity`)];return{iconUrl:a(`iconUrl`),iconBgUrl:a(`iconBgUrl`),iconMarkUrl:a(`iconMarkUrl`),iconOverlayUrl:a(`iconOverlayUrl`),iconContentUrl:a(`iconContentUrl`),iconTrans:r(n[i(`iconTrans`)]),iconShowRarity:typeof o!=`boolean`||o}}export{e as EMPTY_ITEM_ICON_LAYERS,t as ITEM_ICON_TRANSFORMS,r as coerceItemIconTrans,n as itemIconTransformStyle,i as pickItemIconLayers};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
import { ItemIconImageProps, ItemIconImageRenderer, ItemIconLayers, ItemIconProps, ItemIconTrans } from "./types.js";
|
|
3
|
+
import { ItemIcon } from "./ItemIcon.js";
|
|
4
|
+
import { EMPTY_ITEM_ICON_LAYERS, ITEM_ICON_TRANSFORMS, ItemIconTransformKey, coerceItemIconTrans, itemIconTransformStyle, pickItemIconLayers } from "./helpers.js";
|
|
5
|
+
export { EMPTY_ITEM_ICON_LAYERS, ITEM_ICON_TRANSFORMS, ItemIcon, type ItemIconImageProps, type ItemIconImageRenderer, type ItemIconLayers, type ItemIconProps, type ItemIconTrans, type ItemIconTransformKey, coerceItemIconTrans, itemIconTransformStyle, pickItemIconLayers };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import { CSSProperties, ReactNode } from "react";
|
|
3
|
+
//#region src/game/item-icon/types.d.ts
|
|
4
|
+
export type ItemIconTrans = "" | "formula" | "bigGem";
|
|
5
|
+
export interface ItemIconLayers {
|
|
6
|
+
iconUrl: string;
|
|
7
|
+
iconBgUrl?: string;
|
|
8
|
+
iconMarkUrl?: string;
|
|
9
|
+
iconOverlayUrl?: string;
|
|
10
|
+
iconContentUrl?: string;
|
|
11
|
+
iconTrans?: ItemIconTrans;
|
|
12
|
+
iconShowRarity?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface ItemIconImageProps {
|
|
15
|
+
src: string;
|
|
16
|
+
alt: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
style?: CSSProperties;
|
|
19
|
+
fallback?: ReactNode;
|
|
20
|
+
loading?: "lazy" | "eager";
|
|
21
|
+
}
|
|
22
|
+
export type ItemIconImageRenderer = (props: ItemIconImageProps) => ReactNode;
|
|
23
|
+
export interface ItemIconProps {
|
|
24
|
+
layers: ItemIconLayers;
|
|
25
|
+
alt: string;
|
|
26
|
+
className?: string;
|
|
27
|
+
style?: CSSProperties;
|
|
28
|
+
fallback?: ReactNode;
|
|
29
|
+
loading?: "lazy" | "eager";
|
|
30
|
+
renderImage?: ItemIconImageRenderer;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
|
|
2
|
+
import { ItemTooltipCardProps } from "./types.js";
|
|
3
|
+
//#region src/game/item-tooltip-card/ItemTooltipCard.d.ts
|
|
4
|
+
/** 固定灰色游戏皮肤的物品详情;文章路由与富文本由使用方接入。 */
|
|
5
|
+
export declare function ItemTooltipCard({ item, className, style, fontFamily, obtainLabel, renderText, renderImage, renderLink }: ItemTooltipCardProps): import("react").JSX.Element;
|
|
6
|
+
//#endregion
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{cn as e}from"../../lib/cn.js";import{pickItemIconLayers as t}from"../item-icon/helpers.js";import{ItemIcon as n}from"../item-icon/ItemIcon.js";import{ObtainFallbackIcon as r,ObtainLinkIcon as i}from"./icons.js";import{Fragment as a,jsx as o,jsxs as s}from"react/jsx-runtime";const c=e=>e,l=e=>/* @__PURE__ */ o(`a`,{...e});function u({item:u,className:d,style:f,fontFamily:p,obtainLabel:m=`获取途径`,renderText:h=c,renderImage:g,renderLink:_=l}){let v=Number.isFinite(u.rarity)?Math.min(6,Math.max(1,Math.trunc(u.rarity))):1,y=u.obtainWays??[];return/* @__PURE__ */ s(`article`,{className:e(`ef-item-tooltip-card`,d),style:{fontFamily:p,...f},"data-rarity":v,children:[/* @__PURE__ */ s(`header`,{className:`ef-item-tooltip-card__header`,children:[/* @__PURE__ */ o(`span`,{"aria-hidden":`true`,className:`ef-item-tooltip-card__header-texture`}),/* @__PURE__ */ o(`h2`,{children:u.name}),u.href&&_({href:u.href,className:`ef-item-tooltip-card__detail-link`,"aria-label":u.name,children:/* @__PURE__ */ o(`span`,{"aria-hidden":`true`,className:`ef-item-tooltip-card__detail-link-icon`})})]}),/* @__PURE__ */ s(`div`,{className:`ef-item-tooltip-card__body`,children:[/* @__PURE__ */ o(`span`,{"aria-hidden":`true`,className:`ef-item-tooltip-card__detail-texture`}),/* @__PURE__ */ s(`div`,{className:`ef-item-tooltip-card__hero`,children:[/* @__PURE__ */ o(`p`,{className:`ef-item-tooltip-card__category`,children:u.category}),/* @__PURE__ */ o(`span`,{"aria-hidden":`true`,className:`ef-item-tooltip-card__marker`}),/* @__PURE__ */ o(`span`,{"aria-hidden":`true`,className:`ef-item-tooltip-card__barcode`}),/* @__PURE__ */ o(n,{layers:{...t(u),iconBgUrl:``,iconMarkUrl:``},alt:u.name,loading:`eager`,className:`ef-item-tooltip-card__icon`,renderImage:g})]}),/* @__PURE__ */ o(`span`,{"aria-hidden":`true`,className:`ef-item-tooltip-card__color-strip`}),(u.usage||u.description)&&/* @__PURE__ */ s(`div`,{className:`ef-item-tooltip-card__text`,children:[u.usage&&/* @__PURE__ */ o(`p`,{children:h(u.usage)}),u.description&&/* @__PURE__ */ o(`p`,{className:`ef-item-tooltip-card__description`,children:h(u.description)})]})]}),(y.length>0||u.noObtainWayHint)&&/* @__PURE__ */ s(`section`,{"aria-label":m,children:[/* @__PURE__ */ o(`h3`,{className:`ef-item-tooltip-card__obtain-title`,children:m}),/* @__PURE__ */ o(`ul`,{className:`ef-item-tooltip-card__obtain-list`,children:y.map((e,t)=>{let c=/* @__PURE__ */ s(a,{children:[/* @__PURE__ */ o(n,{layers:{iconUrl:e.iconUrl??``},alt:``,loading:`eager`,className:`ef-item-tooltip-card__obtain-icon`,renderImage:g,fallback:/* @__PURE__ */ o(r,{})}),/* @__PURE__ */ o(`span`,{className:`ef-item-tooltip-card__obtain-name`,children:h(e.name)}),e.href&&/* @__PURE__ */ o(i,{})]});return/* @__PURE__ */ o(`li`,{children:e.href?_({href:e.href,className:`ef-item-tooltip-card__obtain-row`,children:c}):/* @__PURE__ */ o(`div`,{className:`ef-item-tooltip-card__obtain-row`,children:c})},`${e.id??t}-${t}`)})}),u.noObtainWayHint&&/* @__PURE__ */ o(`p`,{className:`ef-item-tooltip-card__obtain-hint`,children:h(u.noObtainWayHint)})]})]})}export{u as ItemTooltipCard};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";function n(){return/* @__PURE__ */ t(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[/* @__PURE__ */ e(`path`,{d:`M12 22V12M20.27 18.27 22 20`}),/* @__PURE__ */ e(`path`,{d:`M21 10.498V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l.98-.559`}),/* @__PURE__ */ e(`path`,{d:`M3.29 7 12 12l8.71-5M7.5 4.27l8.997 5.148`}),/* @__PURE__ */ e(`circle`,{cx:`18.5`,cy:`16.5`,r:`2.5`})]})}function r(){return/* @__PURE__ */ e(`svg`,{"aria-hidden":`true`,className:`ef-item-tooltip-card__chevrons`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,children:/* @__PURE__ */ e(`path`,{d:`m6 17 5-5-5-5m7 10 5-5-5-5`})})}export{n as ObtainFallbackIcon,r as ObtainLinkIcon};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
|
|
2
|
+
import { ItemTooltipCardProps, ItemTooltipItem, ItemTooltipLinkProps, ItemTooltipLinkRenderer, ItemTooltipObtainWay } from "./types.js";
|
|
3
|
+
import { ItemTooltipCard } from "./ItemTooltipCard.js";
|
|
4
|
+
export { ItemTooltipCard, type ItemTooltipCardProps, type ItemTooltipItem, type ItemTooltipLinkProps, type ItemTooltipLinkRenderer, type ItemTooltipObtainWay };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
import { ItemIconImageRenderer, ItemIconLayers } from "../item-icon/types.js";
|
|
3
|
+
import "../item-icon/index.js";
|
|
4
|
+
import { CSSProperties, ReactNode } from "react";
|
|
5
|
+
//#region src/game/item-tooltip-card/types.d.ts
|
|
6
|
+
export type ItemTooltipObtainWay = {
|
|
7
|
+
id?: string;
|
|
8
|
+
name: string;
|
|
9
|
+
iconUrl?: string;
|
|
10
|
+
href?: string;
|
|
11
|
+
};
|
|
12
|
+
export type ItemTooltipItem = ItemIconLayers & {
|
|
13
|
+
name: string;
|
|
14
|
+
rarity: number;
|
|
15
|
+
category?: string;
|
|
16
|
+
usage?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
/** 实际 URL,由使用方转换自己的文章或路由地址。 */
|
|
19
|
+
href?: string;
|
|
20
|
+
obtainWays?: readonly ItemTooltipObtainWay[];
|
|
21
|
+
noObtainWayHint?: string;
|
|
22
|
+
};
|
|
23
|
+
export type ItemTooltipLinkProps = {
|
|
24
|
+
href: string;
|
|
25
|
+
className: string;
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
"aria-label"?: string;
|
|
28
|
+
};
|
|
29
|
+
export type ItemTooltipLinkRenderer = (props: ItemTooltipLinkProps) => ReactNode;
|
|
30
|
+
export type ItemTooltipCardProps = {
|
|
31
|
+
item: ItemTooltipItem;
|
|
32
|
+
className?: string;
|
|
33
|
+
style?: CSSProperties;
|
|
34
|
+
fontFamily?: string;
|
|
35
|
+
obtainLabel?: string;
|
|
36
|
+
renderText?: (text: string) => ReactNode;
|
|
37
|
+
renderImage?: ItemIconImageRenderer;
|
|
38
|
+
renderLink?: ItemTooltipLinkRenderer;
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
import { useFieldContext, useFieldControl } from "../../components/field/Field.js";
|
|
3
|
+
import { SplashScreen, SplashScreenProps } from "../../components/splash-screen/SplashScreen.js";
|
|
4
|
+
import { useControllableState } from "../../hooks/useControllableState.js";
|
|
5
|
+
import { usePortalScope } from "../../hooks/usePortalScope.js";
|
|
6
|
+
import { useReducedMotion } from "../../hooks/useReducedMotion.js";
|
|
7
|
+
import { cn } from "../../lib/cn.js";
|
|
8
|
+
export type { SplashScreenProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const e=[`a[href]`,`button:not([disabled])`,`input:not([disabled]):not([type="hidden"])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function t(t){return()=>t.current?.querySelector(e)??!0}export{t as firstFocusableIn};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"note": "Game
|
|
2
|
+
"note": "Game 实机风格这一类带的全部图片。它们取自游戏与官方素材:开屏页的五张直接取自官网,其余的经下面两个社区仓库转来。都没有取得授权,上游也没有标许可;权利归鹰角网络及其权利人,本仓库的 MIT 许可不覆盖它们。风险与处理见 docs/design/game/README.md。path 相对 packages/ui/src/game;shipped 为 true 的被样式引用、随 npm 包发在 dist/game/assets,为 false 的只有预览站的示例在用。来源地址的后缀是 .png 的几张实际编码是 WebP,迁入时只复制字节,没有转换或重新编码;从社区仓库来的那些没有另外下载。",
|
|
3
3
|
"sources": {
|
|
4
|
+
"endfield.hypergryph.com": {
|
|
5
|
+
"retrieved": "2026-10-14",
|
|
6
|
+
"note": "开屏页(EndfieldSplashScreen)的五张图直接取自官网首页的加载页,不经社区仓库:四张是它的样式引用的文件,按地址取下来原样存;标志是页面里内联的 SVG。其中标志是游戏的注册商标"
|
|
7
|
+
},
|
|
4
8
|
"ArkEndfield/EndfieldMap": {
|
|
5
9
|
"revision": "75fd60a82ca7c91305cb2e7dadc33fd5047c7ac2",
|
|
6
10
|
"note": "圆形按钮纹理与确认提示的四张图直接取自这里;物品与详情卡的图是它保存的 EndfieldWiki 资源副本"
|
|
@@ -379,6 +383,71 @@
|
|
|
379
383
|
"sha256": "478e03ef19b647366fb782918a0c4faf61e7e7875b35305fde3ee4e20c1b3f34",
|
|
380
384
|
"copiedFrom": "ArkEndfield/EndfieldMap/packages/web-components/src/assets/item-tooltip",
|
|
381
385
|
"sourceFile": "EndfieldWiki/apps/web/public/deco/item-tooltip/bg_tips_a_2.png"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"path": "splash-screen/assets/splash_bg.jpg",
|
|
389
|
+
"usedBy": ["EndfieldSplashScreen"],
|
|
390
|
+
"role": "splash-backdrop-landscape",
|
|
391
|
+
"shipped": true,
|
|
392
|
+
"format": "JPEG",
|
|
393
|
+
"width": 2560,
|
|
394
|
+
"height": 1440,
|
|
395
|
+
"bytes": 331663,
|
|
396
|
+
"sha256": "28c36eca5da88a1c7d223f2801c3aa999f2251b7b36b438070204aca2594e6f5",
|
|
397
|
+
"copiedFrom": "endfield.hypergryph.com",
|
|
398
|
+
"sourceUrl": "https://web.hycdn.cn/endfield/official-v4/_next/static/media/bg.9e174372.jpg"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"path": "splash-screen/assets/splash_bg_portrait.jpg",
|
|
402
|
+
"usedBy": ["EndfieldSplashScreen"],
|
|
403
|
+
"role": "splash-backdrop-portrait",
|
|
404
|
+
"shipped": true,
|
|
405
|
+
"format": "JPEG",
|
|
406
|
+
"width": 1080,
|
|
407
|
+
"height": 1920,
|
|
408
|
+
"bytes": 162169,
|
|
409
|
+
"sha256": "03a7dcd5eb647c2fd8fc2e66c86e946153de23eba3fac2c5e48dafff8b9d5d62",
|
|
410
|
+
"copiedFrom": "endfield.hypergryph.com",
|
|
411
|
+
"sourceUrl": "https://web.hycdn.cn/endfield/official-v4/_next/static/media/bg_m.529c4e62.jpg"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"path": "splash-screen/assets/splash_logo.svg",
|
|
415
|
+
"usedBy": ["EndfieldSplashScreen"],
|
|
416
|
+
"role": "splash-logo",
|
|
417
|
+
"shipped": true,
|
|
418
|
+
"format": "SVG",
|
|
419
|
+
"width": 214,
|
|
420
|
+
"height": 233,
|
|
421
|
+
"bytes": 5362,
|
|
422
|
+
"sha256": "297fe6f4bd4c0bfe942589eca68dde3bfad818ef611dbccdc7b0f192f9d8946e",
|
|
423
|
+
"copiedFrom": "endfield.hypergryph.com",
|
|
424
|
+
"sourceNote": "官网首页加载页里内联的游戏标志(简体中文站),存的是那个 svg 元素的 outerHTML,一个字节没改"
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
"path": "splash-screen/assets/splash_deco.svg",
|
|
428
|
+
"usedBy": ["EndfieldSplashScreen"],
|
|
429
|
+
"role": "splash-micro-decor",
|
|
430
|
+
"shipped": true,
|
|
431
|
+
"format": "SVG",
|
|
432
|
+
"width": 141,
|
|
433
|
+
"height": 64,
|
|
434
|
+
"bytes": 7845,
|
|
435
|
+
"sha256": "1c62cf003581db0e38604a778ef3f1e422c5e63c0a6693b18a5c7d38309eae6e",
|
|
436
|
+
"copiedFrom": "endfield.hypergryph.com",
|
|
437
|
+
"sourceUrl": "https://web.hycdn.cn/endfield/official-v4/_next/static/media/deco.dbe18bea.svg"
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"path": "splash-screen/assets/splash_triangles.svg",
|
|
441
|
+
"usedBy": ["EndfieldSplashScreen"],
|
|
442
|
+
"role": "splash-triangle-mark",
|
|
443
|
+
"shipped": true,
|
|
444
|
+
"format": "SVG",
|
|
445
|
+
"width": 23,
|
|
446
|
+
"height": 21,
|
|
447
|
+
"bytes": 261,
|
|
448
|
+
"sha256": "c903dc264b1b0d17ea582b8e578e643818f4aa61126f12b95482a9b43b549e83",
|
|
449
|
+
"copiedFrom": "endfield.hypergryph.com",
|
|
450
|
+
"sourceUrl": "https://web.hycdn.cn/endfield/official-v4/_next/static/media/triangles.bcbd794a.svg"
|
|
382
451
|
}
|
|
383
452
|
]
|
|
384
453
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
//#region src/game/rounded-button/RoundedButton.d.ts
|
|
4
|
+
export type RoundedButtonVariant = "primary" | "default";
|
|
5
|
+
type RoundedButtonSlotClass = string | ((isPrimary: boolean) => string);
|
|
6
|
+
export type RoundedButtonProps = ComponentProps<"button"> & {
|
|
7
|
+
variant?: RoundedButtonVariant;
|
|
8
|
+
text?: string;
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
showIcon?: boolean;
|
|
11
|
+
iconPosition?: "left" | "right";
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
classNames?: {
|
|
14
|
+
button?: RoundedButtonSlotClass;
|
|
15
|
+
text?: RoundedButtonSlotClass;
|
|
16
|
+
icon?: RoundedButtonSlotClass;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
/** 原灰色圆角按钮;悬停闪动由浏览器动画执行。 */
|
|
20
|
+
export declare function RoundedButton({ variant, type, text, children, icon, showIcon, iconPosition, loading, disabled, className, classNames, onClick, onPointerEnter, onPointerLeave, ...props }: RoundedButtonProps): import("react").JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{cn as e}from"../../lib/cn.js";import{useReducedMotion as t}from"../../hooks/useReducedMotion.js";import{useEffect as n,useRef as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";const o={primary:{enter:[`#2a272877`,`#2a2728b5`,`#2a272877`,`#2a2728b5`],leave:[`#2a2728b5`,`#2a2728`,`#2a2728b5`,`#2a2728`],enterBorder:[`#81807f`,`#81807f`,`#81807f`,`#81807f`],leaveBorder:[`#81807f`,`#81807f`,`#81807f`,`#81807f`]},default:{enter:[`#ececec77`,`#e8e8e8b5`,`#ececec77`,`#e8e8e8b5`],leave:[`#e8e8e8b5`,`#f2f1ef`,`#e8e8e8b5`,`#f2f1ef`],enterBorder:[`#a5a5a5`,`#a5a5a5`,`#a5a5a5`,`#a5a5a5`],leaveBorder:[`#a5a5a5`,`#a0a2a3`,`#a5a5a5`,`#a0a2a3`]}};function s({variant:s=`primary`,type:c=`button`,text:l=``,children:u,icon:d,showIcon:f=!0,iconPosition:p=`right`,loading:m=!1,disabled:h=!1,className:g,classNames:_,onClick:v,onPointerEnter:y,onPointerLeave:b,...x}){let S=t(),C=r(null),w=s===`primary`,T=e=>typeof e==`function`?e(w):e;n(()=>((h||m||S)&&C.current?.cancel(),()=>C.current?.cancel()),[h,m,S,s]);let E=(e,t)=>{let n=e.currentTarget;if(h||m||S||e.defaultPrevented||e.pointerType!==`mouse`||typeof window.matchMedia!=`function`||!window.matchMedia(`(hover: hover) and (pointer: fine)`).matches||typeof n.animate!=`function`)return;C.current?.cancel();let r=o[s],i=t?r.enter:r.leave,a=t?r.enterBorder:r.leaveBorder;C.current=n.animate(i.map((e,t)=>({backgroundColor:e,boxShadow:`0 0 0 0.1em ${e}, 0 0 0 0.1em ${a[t]} inset`})),{duration:200,easing:`ease-out`})},D=f&&/* @__PURE__ */ i(`span`,{"aria-hidden":`true`,className:e(`ef-rounded-button-icon`,T(_?.icon)),children:m?/* @__PURE__ */ i(`span`,{className:`ef-rounded-button-spinner`}):d});return/* @__PURE__ */ a(`button`,{...x,type:c,disabled:h,"aria-busy":m||x[`aria-busy`]||void 0,"aria-disabled":m||x[`aria-disabled`]||void 0,"data-variant":s,"data-icon-position":p,"data-loading":m?``:void 0,className:e(`ef-rounded-button`,g,T(_?.button)),onClick:e=>{h||m?e.preventDefault():v?.(e)},onPointerEnter:e=>{y?.(e),E(e,!0)},onPointerLeave:e=>{b?.(e),E(e,!1)},children:[p===`left`&&D,/* @__PURE__ */ i(`span`,{className:e(`ef-rounded-button-text`,T(_?.text)),children:u??l}),p===`right`&&D]})}export{s as RoundedButton};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
//#region src/game/rounded-button/RoundedIconButton.d.ts
|
|
4
|
+
export type RoundedIconButtonProps = ComponentProps<"button"> & {
|
|
5
|
+
"aria-label": string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/** 24px 圆形图标按钮;纹理与双边线只作装饰。 */
|
|
9
|
+
export declare function RoundedIconButton({ type, disabled, children, className, ...props }: RoundedIconButtonProps): import("react").JSX.Element;
|
|
10
|
+
//#endregion
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{cn as e}from"../../lib/cn.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";function r({type:r=`button`,disabled:i=!1,children:a,className:o,...s}){return/* @__PURE__ */ n(`button`,{...s,type:r,disabled:i,className:e(`ef-rounded-icon-button`,o),children:[/* @__PURE__ */ t(`span`,{"aria-hidden":`true`,className:`ef-rounded-icon-button-texture`}),/* @__PURE__ */ t(`span`,{"aria-hidden":`true`,className:`ef-rounded-icon-button-border`}),/* @__PURE__ */ t(`span`,{"aria-hidden":`true`,className:`ef-rounded-icon-button-content`,children:a})]})}export{r as RoundedIconButton};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
|
|
2
|
+
import { RoundedButton, RoundedButtonProps, RoundedButtonVariant } from "./RoundedButton.js";
|
|
3
|
+
import { RoundedIconButton, RoundedIconButtonProps } from "./RoundedIconButton.js";
|
|
4
|
+
export { RoundedButton, type RoundedButtonProps, type RoundedButtonVariant, RoundedIconButton, type RoundedIconButtonProps };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
import { ReactNode, Ref } from "react";
|
|
3
|
+
//#region src/game/rounded-select/RoundedSelect.d.ts
|
|
4
|
+
export type RoundedSelectOption<T extends string = string> = {
|
|
5
|
+
value: T;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
hidden?: boolean;
|
|
9
|
+
left?: ReactNode | ((selected: boolean) => ReactNode);
|
|
10
|
+
right?: ReactNode | ((selected: boolean) => ReactNode);
|
|
11
|
+
/** 自定义标签的键盘文字匹配名称。 */
|
|
12
|
+
textValue?: string;
|
|
13
|
+
};
|
|
14
|
+
export type RoundedSelectProps<T extends string = string> = {
|
|
15
|
+
options: readonly RoundedSelectOption<T>[];
|
|
16
|
+
value?: T | null;
|
|
17
|
+
defaultValue?: T | null;
|
|
18
|
+
onValueChange?: (value: T) => void;
|
|
19
|
+
placeholder?: ReactNode;
|
|
20
|
+
name?: string;
|
|
21
|
+
form?: string;
|
|
22
|
+
required?: boolean;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
invalid?: boolean;
|
|
25
|
+
open?: boolean;
|
|
26
|
+
defaultOpen?: boolean;
|
|
27
|
+
onOpenChange?: (open: boolean) => void;
|
|
28
|
+
id?: string;
|
|
29
|
+
"aria-label"?: string;
|
|
30
|
+
"aria-describedby"?: string;
|
|
31
|
+
className?: string;
|
|
32
|
+
classNames?: {
|
|
33
|
+
container?: string;
|
|
34
|
+
trigger?: string;
|
|
35
|
+
option?: string;
|
|
36
|
+
optionContainer?: string;
|
|
37
|
+
optionScrollArea?: string;
|
|
38
|
+
};
|
|
39
|
+
ref?: Ref<HTMLButtonElement>;
|
|
40
|
+
};
|
|
41
|
+
/** 圆角触发器与半覆盖面板;隐藏项不进入列表,禁用项不能选择。 */
|
|
42
|
+
export declare function RoundedSelect<T extends string = string>({ options, value, defaultValue, onValueChange, placeholder, name, form, required: requiredProp, disabled: disabledProp, invalid: invalidProp, open, defaultOpen, onOpenChange, id: idProp, "aria-label": ariaLabel, "aria-describedby": describedByProp, className, classNames, ref }: RoundedSelectProps<T>): import("react").JSX.Element;
|
|
43
|
+
//#endregion
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{cn as e}from"../../lib/cn.js";import{useControllableState as t}from"../../hooks/useControllableState.js";import{usePortalScope as n}from"../../hooks/usePortalScope.js";import{useFieldControl as r}from"../../components/field/Field.js";import{useRef as i,useState as a}from"react";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";import{ScrollArea as l}from"@base-ui/react/scroll-area";import{Select as u}from"@base-ui/react/select";function d({options:o,value:d,defaultValue:m,onValueChange:h,placeholder:g,name:_,form:v,required:y,disabled:b,invalid:x,open:S,defaultOpen:C=!1,onOpenChange:w,id:T,"aria-label":E,"aria-describedby":D,className:O,classNames:k,ref:A}){let{id:j,disabled:M,required:N,invalid:P,...F}=r({id:T,disabled:b,required:y,invalid:x,"aria-describedby":D}),[I,L]=t({value:S,defaultValue:C}),[R,z]=t({value:d,defaultValue:m??null,onChange:e=>{e!==null&&h?.(e)}});M&&I&&S===void 0&&L(!1);let B=I&&!M,[V,H]=a(!1),[U,W]=a(!1),G=i(null),{anchorRef:K,portalRef:q}=n();return/* @__PURE__ */ c(u.Root,{items:o,value:R,onValueChange:z,name:_,form:v,required:N,disabled:M,modal:!1,open:B,onOpenChange:e=>{L(e),e!==I&&w?.(e)},children:[/* @__PURE__ */ s(`div`,{ref:e=>{G.current=e,K(e)},className:e(`ef-rounded-select`,O,k?.container),"data-invalid":P?``:void 0,children:/* @__PURE__ */ s(u.Trigger,{ref:A,id:j,"aria-label":E,"aria-invalid":P||void 0,"aria-describedby":F[`aria-describedby`],className:e(`ef-rounded-select-trigger`,k?.trigger),onPointerEnter:e=>H(e.pointerType!==`touch`),onPointerLeave:()=>{H(!1),W(!1)},onPointerDown:e=>W(e.button===0),onPointerUp:()=>W(!1),onPointerCancel:()=>W(!1),children:/* @__PURE__ */ s(f,{placeholder:g})})}),/* @__PURE__ */ s(u.Portal,{ref:q,children:/* @__PURE__ */ c(u.Positioner,{anchor:G,alignItemWithTrigger:!1,side:`bottom`,align:`start`,sideOffset:-16,className:`ef-rounded-select-positioner`,children:[/* @__PURE__ */ s(`div`,{"aria-hidden":`true`,className:e(`ef-rounded-select-trigger ef-rounded-select-mirror`,k?.trigger),"data-invalid":P?``:void 0,"data-hovered":V?``:void 0,"data-pressed":U?``:void 0,children:/* @__PURE__ */ s(f,{placeholder:g})}),/* @__PURE__ */ s(u.Popup,{className:e(`ef-rounded-select-popup`,k?.optionContainer),children:/* @__PURE__ */ c(l.Root,{className:e(`ef-rounded-select-scroll-area`,k?.optionScrollArea),children:[/* @__PURE__ */ s(l.Viewport,{className:`ef-rounded-select-viewport`,style:{overflowX:`hidden`},render:/* @__PURE__ */ s(u.List,{role:`listbox`}),children:/* @__PURE__ */ s(l.Content,{children:o.filter(e=>!e.hidden).map(t=>/* @__PURE__ */ s(u.Item,{value:t.value,label:t.textValue,disabled:M||t.disabled,className:e(`ef-rounded-select-option`,k?.option),render:(e,n)=>{let r=typeof t.left==`function`?t.left(n.selected):t.left,i=typeof t.right==`function`?t.right(n.selected):t.right;return/* @__PURE__ */ c(`div`,{...e,children:[r!=null&&/* @__PURE__ */ s(`span`,{className:`ef-rounded-select-left`,children:r}),/* @__PURE__ */ s(u.ItemText,{className:`ef-rounded-select-option-label`,children:t.label}),i!=null&&/* @__PURE__ */ s(`span`,{className:`ef-rounded-select-right`,children:i}),/* @__PURE__ */ s(p,{})]})}},t.value))})}),/* @__PURE__ */ s(l.Scrollbar,{orientation:`vertical`,className:`ef-rounded-select-scrollbar`,children:/* @__PURE__ */ s(l.Thumb,{className:`ef-rounded-select-thumb`})})]})})]})})]})}function f({placeholder:e}){return/* @__PURE__ */ c(o,{children:[/* @__PURE__ */ s(u.Value,{placeholder:e,className:`ef-rounded-select-value`}),/* @__PURE__ */ s(u.Icon,{className:`ef-rounded-select-chevron`,children:/* @__PURE__ */ s(`svg`,{"aria-hidden":`true`,viewBox:`0 0 1024 1024`,width:`0.6em`,height:`0.6em`,fill:`currentColor`,children:/* @__PURE__ */ s(`path`,{d:`M957.056 338.624C951.84 327.296 940.512 320 928 320H96c-12.512 0-23.84 7.296-29.088 18.624-5.216 11.36-3.328 24.704 4.768 34.208l416 485.344c6.08 7.104 14.944 11.2 24.288 11.2s18.208-4.096 24.288-11.2l416-485.344c8.096-9.472 9.952-22.88 4.768-34.208Z`})})})]})}function p(){return/* @__PURE__ */ s(`span`,{className:`ef-rounded-select-check`,children:/* @__PURE__ */ s(u.ItemIndicator,{children:/* @__PURE__ */ s(`svg`,{"aria-hidden":`true`,width:`0.85em`,height:`0.85em`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,children:/* @__PURE__ */ s(`polyline`,{points:`20 6 9 17 4 12`})})})})}export{d as RoundedSelect};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
//#region src/game/rounded-switch/RoundedSwitch.d.ts
|
|
4
|
+
export type RoundedSwitchProps = Omit<ComponentProps<"div">, "defaultChecked" | "defaultValue" | "onChange" | "children"> & {
|
|
5
|
+
checked?: boolean;
|
|
6
|
+
defaultChecked?: boolean;
|
|
7
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
8
|
+
onText?: ReactNode;
|
|
9
|
+
offText?: ReactNode;
|
|
10
|
+
name?: string;
|
|
11
|
+
form?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
required?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare function RoundedSwitch({ checked, defaultChecked, onCheckedChange, onText, offText, name, form, disabled: disabledProp, required: requiredProp, className, onKeyDown, ...props }: RoundedSwitchProps): import("react").JSX.Element;
|
|
16
|
+
//#endregion
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{cn as e}from"../../lib/cn.js";import{useControllableState as t}from"../../hooks/useControllableState.js";import{useFieldContext as n}from"../../components/field/Field.js";import{roundedGroupBoundary as r}from"../rounded-toggle/keyboard.js";import{useSpringHighlight as i}from"../rounded-toggle/spring-highlight.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{Radio as s}from"@base-ui/react/radio";import{RadioGroup as c}from"@base-ui/react/radio-group";function l({checked:l,defaultChecked:u=!1,onCheckedChange:d,onText:f=`ON`,offText:p=`OFF`,name:m,form:h,disabled:g,required:_,className:v,onKeyDown:y,...b}){let x=n(),S=g??x?.disabled??!1,C=_??x?.required??!1,[w,T]=t({value:l,defaultValue:u,onChange:d}),E=w?`translateX(0%)`:`translateX(calc(100% - 1em))`,D=i(E);return/* @__PURE__ */ o(c,{...b,"aria-labelledby":b[`aria-labelledby`]??(x&&!x.group?x.labelId:void 0),"aria-describedby":b[`aria-describedby`]??x?.describedBy,"aria-invalid":x?.invalid||void 0,value:w,name:m,form:h,disabled:S,required:C,className:e(`ef-rounded-switch`,v),onValueChange:e=>{S||T(e)},onKeyDown:e=>{y?.(e),r(e)},children:[/* @__PURE__ */ a(`div`,{ref:D,"aria-hidden":`true`,className:`ef-rounded-switch__highlight`,style:{transform:E}}),/* @__PURE__ */ a(s.Root,{value:!0,nativeButton:!0,render:/* @__PURE__ */ a(`button`,{type:`button`}),"data-rounded-option":``,className:`ef-rounded-switch__option`,children:/* @__PURE__ */ a(`span`,{children:f})}),/* @__PURE__ */ a(s.Root,{value:!1,nativeButton:!0,render:/* @__PURE__ */ a(`button`,{type:`button`}),"data-rounded-option":``,className:`ef-rounded-switch__option`,children:/* @__PURE__ */ a(`span`,{children:p})})]})}export{l as RoundedSwitch};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
//#region src/game/rounded-toggle/RoundedToggle.d.ts
|
|
4
|
+
export type RoundedToggleOption = {
|
|
5
|
+
value: string;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
"aria-label"?: string;
|
|
10
|
+
};
|
|
11
|
+
export type RoundedToggleProps = Omit<ComponentProps<"div">, "defaultValue" | "onChange" | "children"> & {
|
|
12
|
+
options: readonly RoundedToggleOption[];
|
|
13
|
+
value?: string;
|
|
14
|
+
defaultValue?: string;
|
|
15
|
+
onValueChange?: (value: string) => void;
|
|
16
|
+
label?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
form?: string;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare function RoundedToggle({ options, value, defaultValue, onValueChange, label, name, form, required: requiredProp, disabled: disabledProp, className, onKeyDown, "aria-label": ariaLabel, ...props }: RoundedToggleProps): import("react").JSX.Element;
|
|
23
|
+
//#endregion
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{cn as e}from"../../lib/cn.js";import{useControllableState as t}from"../../hooks/useControllableState.js";import{useFieldContext as n}from"../../components/field/Field.js";import{roundedGroupBoundary as r}from"./keyboard.js";import{useSpringHighlight as i}from"./spring-highlight.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{Radio as s}from"@base-ui/react/radio";import{RadioGroup as c}from"@base-ui/react/radio-group";function l({options:l,value:u,defaultValue:d,onValueChange:f,label:p,name:m,form:h,required:g,disabled:_,className:v,onKeyDown:y,"aria-label":b,...x}){let S=n(),C=_??S?.disabled??!1,w=g??S?.required??!1,[T,E]=t({value:u,defaultValue:d,onChange:e=>{e!==void 0&&f?.(e)}}),D=l.findIndex(e=>e.value===T),O=D>=0?`translateX(${D*100}%)`:null,k=i(O);return/* @__PURE__ */ o(c,{...x,"aria-label":b??p,"aria-labelledby":x[`aria-labelledby`]??(S&&!S.group?S.labelId:void 0),"aria-describedby":x[`aria-describedby`]??S?.describedBy,"aria-invalid":S?.invalid||void 0,value:D>=0?T:null,name:m,form:h,disabled:C,required:w,className:e(`ef-rounded-toggle`,v),onValueChange:e=>{!C&&e!==null&&l.some(t=>t.value===e&&!t.disabled)&&E(e)},onKeyDown:e=>{y?.(e),r(e)},children:[/* @__PURE__ */ a(`div`,{ref:k,"aria-hidden":`true`,hidden:D<0,className:`ef-rounded-toggle__highlight`,style:l.length>0?{width:`${100/l.length}%`,transform:O??void 0}:void 0}),l.map(e=>/* @__PURE__ */ o(s.Root,{value:e.value,disabled:e.disabled,"aria-label":e[`aria-label`],nativeButton:!0,render:/* @__PURE__ */ a(`button`,{type:`button`}),"data-rounded-option":``,className:`ef-rounded-toggle__option`,children:[e.icon&&/* @__PURE__ */ a(`span`,{"aria-hidden":`true`,className:`ef-rounded-toggle__icon`,children:e.icon}),/* @__PURE__ */ a(`span`,{className:`ef-rounded-toggle__label`,children:e.label})]},e.value))]})}export{l as RoundedToggle};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function e(e){if(e.defaultPrevented||e.key!==`Home`&&e.key!==`End`)return;let t=e.currentTarget.querySelectorAll(`[data-rounded-option]:not([disabled]):not([aria-disabled="true"])`),n=e.key===`Home`?t[0]:t[t.length-1];n&&(e.preventDefault(),n.focus(),n.click())}export{e as roundedGroupBoundary};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{useLayoutEffect as e,useRef as t}from"react";function n(e){let t=Math.max(0,e)/1e3,n=Math.sqrt(75);return 1-Math.exp(-15*t)*(Math.cos(n*t)+15/n*Math.sin(n*t))}const r=/* @__PURE__ */ Array.from({length:66},(e,t)=>({offset:t/65,time:t/65*650}));function i(e,t,r,i){let a=e/1e3,o=Math.sqrt(75);return t+(r-t)*n(e)+i*Math.exp(-15*a)*Math.sin(o*a)/o}function a(e,t,n,r){let i=e/1e3,a=Math.sqrt(75);return Math.exp(-15*i)*(r*Math.cos(a*i)+(300*(n-t)-15*r)/a*Math.sin(a*i))}function o(e){if(e===`none`)return 0;let t=e.match(/^matrix\((.+)\)$/)?.[1]?.split(`,`);return t?Number.parseFloat(t[4]??`0`):0}function s(n){let s=t(null),c=t(null),l=t(null),u=t({start:0,end:0,velocity:0});return e(()=>{let e=s.current;if(!e)return;let t=c.current;if(c.current=n,!n){l.current?.cancel(),l.current=null;return}let d=(l.current||(e.style.transform=t??n),getComputedStyle(e).transform),f=l.current,p=f?.playState===`running`&&typeof f.currentTime==`number`?a(f.currentTime,u.current.start,u.current.end,u.current.velocity):0;l.current?.cancel(),l.current=null,e.style.transform=n;let m=window.matchMedia?.(`(prefers-reduced-motion: reduce)`);if(!t||m?.matches||typeof e.animate!=`function`)return;let h=o(d),g=o(getComputedStyle(e).transform);if(Math.abs(g-h)<.01&&Math.abs(p)<.01)return;u.current={start:h,end:g,velocity:p};let _=e.animate(r.map(({offset:e,time:t})=>({offset:e,transform:`translateX(${e===1?g:i(t,h,g,p)}px)`})),{duration:650,easing:`linear`});l.current=_,_.onfinish=()=>{l.current===_&&(l.current=null)}},[n]),e(()=>{let e=s.current;if(!e)return;let t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`),n=()=>{l.current?.cancel(),l.current=null},r=()=>{t?.matches&&n()};t?.addEventListener(`change`,r);let i=typeof ResizeObserver<`u`?new ResizeObserver(n):null;return i?.observe(e),()=>{i?.disconnect(),t?.removeEventListener(`change`,r),n()}},[]),s}export{n as roundedSpringProgress,s as useSpringHighlight};
|