matrix-design-system 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +95 -0
- package/dist/atoms/animation/motion-div/index.d.mts +2 -0
- package/dist/atoms/animation/motion-div/motion-div.d.mts +7 -0
- package/dist/atoms/animation/motion-div/motion-div.mjs +37 -0
- package/dist/atoms/animation/motion-div/use-motion-div-store.mjs +17 -0
- package/dist/atoms/buttons/button/button.d.mts +8 -0
- package/dist/atoms/buttons/button/button.mjs +12 -0
- package/dist/atoms/buttons/button/index.d.mts +2 -0
- package/dist/atoms/buttons/switch/index.d.mts +2 -0
- package/dist/atoms/buttons/switch/switch.d.mts +10 -0
- package/dist/atoms/buttons/switch/switch.mjs +40 -0
- package/dist/atoms/buttons/switch/use-switch-store.mjs +7 -0
- package/dist/atoms/call-to-actions/call-to-action-external-with-tracking/call-to-action-external-with-tracking.d.mts +13 -0
- package/dist/atoms/call-to-actions/call-to-action-external-with-tracking/call-to-action-external-with-tracking.mjs +30 -0
- package/dist/atoms/call-to-actions/call-to-action-external-with-tracking/index.d.mts +2 -0
- package/dist/atoms/call-to-actions/call-to-action-internal-with-tracking/call-to-action-internal-with-tracking.d.mts +14 -0
- package/dist/atoms/call-to-actions/call-to-action-internal-with-tracking/call-to-action-internal-with-tracking.mjs +29 -0
- package/dist/atoms/call-to-actions/call-to-action-internal-with-tracking/index.d.mts +2 -0
- package/dist/atoms/chip/chip.d.mts +10 -0
- package/dist/atoms/chip/chip.mjs +10 -0
- package/dist/atoms/chip/index.d.mts +2 -0
- package/dist/atoms/effects/glassmorphism-background/glassmorphism-background.d.mts +8 -0
- package/dist/atoms/effects/glassmorphism-background/glassmorphism-background.mjs +33 -0
- package/dist/atoms/effects/glassmorphism-background/index.d.mts +2 -0
- package/dist/atoms/effects/glassmorphism-background/use-glassmorphism-background-store.mjs +17 -0
- package/dist/atoms/effects/image-glow/image-glow.d.mts +12 -0
- package/dist/atoms/effects/image-glow/image-glow.mjs +20 -0
- package/dist/atoms/effects/image-glow/index.d.mts +2 -0
- package/dist/atoms/effects/image-shimmer-placeholder/image-shimmer-placeholder.d.mts +6 -0
- package/dist/atoms/effects/image-shimmer-placeholder/image-shimmer-placeholder.mjs +22 -0
- package/dist/atoms/effects/image-shimmer-placeholder/index.d.mts +2 -0
- package/dist/atoms/effects/matrix-rain/matrix-rain/index.d.mts +2 -0
- package/dist/atoms/effects/matrix-rain/matrix-rain/matrix-2d-canvas/debounce.mjs +12 -0
- package/dist/atoms/effects/matrix-rain/matrix-rain/matrix-2d-canvas/matrix-2d-canvas.mjs +25 -0
- package/dist/atoms/effects/matrix-rain/matrix-rain/matrix-2d-canvas/use-matrix-2d-canvas-store.mjs +186 -0
- package/dist/atoms/effects/matrix-rain/matrix-rain/matrix-rain.d.mts +5 -0
- package/dist/atoms/effects/matrix-rain/matrix-rain/matrix-rain.mjs +68 -0
- package/dist/atoms/effects/matrix-rain/matrix-rain/use-matrix-rain-activity.mjs +40 -0
- package/dist/atoms/effects/matrix-rain/matrix-rain/use-matrix-rain-store.mjs +69 -0
- package/dist/atoms/effects/overlay/index.d.mts +2 -0
- package/dist/atoms/effects/overlay/overlay.d.mts +11 -0
- package/dist/atoms/effects/overlay/overlay.mjs +61 -0
- package/dist/atoms/effects/overlay/use-overlay-store.mjs +8 -0
- package/dist/atoms/effects/pills/index.d.mts +2 -0
- package/dist/atoms/effects/pills/pills.d.mts +10 -0
- package/dist/atoms/effects/pills/pills.mjs +121 -0
- package/dist/atoms/effects/pills/use-pills-store.mjs +17 -0
- package/dist/atoms/effects/plain-image/index.d.mts +2 -0
- package/dist/atoms/effects/plain-image/plain-image.d.mts +45 -0
- package/dist/atoms/effects/plain-image/plain-image.mjs +140 -0
- package/dist/atoms/effects/plain-image/use-plain-image-store.mjs +62 -0
- package/dist/atoms/icons/chat-icon/chat-icon.d.mts +4 -0
- package/dist/atoms/icons/chat-icon/chat-icon.mjs +13 -0
- package/dist/atoms/icons/copy-icon/copy-icon.d.mts +6 -0
- package/dist/atoms/icons/copy-icon/copy-icon.mjs +17 -0
- package/dist/atoms/icons/rounded-icon/index.d.mts +2 -0
- package/dist/atoms/icons/rounded-icon/rounded-icon.d.mts +8 -0
- package/dist/atoms/icons/rounded-icon/rounded-icon.mjs +8 -0
- package/dist/atoms/links/anchor-link/anchor-link.d.mts +31 -0
- package/dist/atoms/links/anchor-link/anchor-link.mjs +14 -0
- package/dist/atoms/links/anchor-link/index.d.mts +2 -0
- package/dist/atoms/links/external-link/external-link.d.mts +13 -0
- package/dist/atoms/links/external-link/external-link.mjs +29 -0
- package/dist/atoms/links/external-link/index.d.mts +2 -0
- package/dist/atoms/links/internal-link/index.d.mts +2 -0
- package/dist/atoms/links/internal-link/internal-link.d.mts +15 -0
- package/dist/atoms/links/internal-link/internal-link.mjs +12 -0
- package/dist/atoms/loader/loader/index.d.mts +2 -0
- package/dist/atoms/loader/loader/loader.d.mts +10 -0
- package/dist/atoms/loader/loader/loader.mjs +62 -0
- package/dist/atoms/typography/input-field/index.d.mts +2 -0
- package/dist/atoms/typography/input-field/input-field.d.mts +9 -0
- package/dist/atoms/typography/input-field/input-field.mjs +8 -0
- package/dist/atoms/typography/label/index.d.mts +2 -0
- package/dist/atoms/typography/label/label.d.mts +9 -0
- package/dist/atoms/typography/label/label.mjs +11 -0
- package/dist/atoms/typography/markdown/markdown-plugins.mjs +16 -0
- package/dist/atoms/typography/markdown/markdown.d.mts +7 -0
- package/dist/atoms/typography/markdown/markdown.mjs +23 -0
- package/dist/atoms/typography/markdown/use-markdown-store.mjs +24 -0
- package/dist/atoms/typography/terminal-blocks/index.d.mts +2 -0
- package/dist/atoms/typography/terminal-blocks/terminal-blocks.d.mts +13 -0
- package/dist/atoms/typography/terminal-blocks/terminal-blocks.mjs +42 -0
- package/dist/atoms/typography/textarea/index.d.mts +2 -0
- package/dist/atoms/typography/textarea/textarea.d.mts +9 -0
- package/dist/atoms/typography/textarea/textarea.mjs +8 -0
- package/dist/chart.d.mts +7 -0
- package/dist/chart.mjs +4 -0
- package/dist/command-palette.d.mts +6 -0
- package/dist/command-palette.mjs +5 -0
- package/dist/hooks/use-clipboard-available.d.mts +4 -0
- package/dist/hooks/use-clipboard-available.mjs +10 -0
- package/dist/hooks/use-device-capabilities.d.mts +10 -0
- package/dist/hooks/use-device-capabilities.mjs +30 -0
- package/dist/hooks/use-glassmorphism.d.mts +10 -0
- package/dist/hooks/use-glassmorphism.mjs +9 -0
- package/dist/hooks/use-in-view-list.d.mts +7 -0
- package/dist/hooks/use-in-view-list.mjs +63 -0
- package/dist/hooks/use-in-view.d.mts +9 -0
- package/dist/hooks/use-in-view.mjs +68 -0
- package/dist/hooks/use-is-ios.d.mts +4 -0
- package/dist/hooks/use-is-ios.mjs +7 -0
- package/dist/hooks/use-lock-body-scroll.d.mts +4 -0
- package/dist/hooks/use-lock-body-scroll.mjs +40 -0
- package/dist/hooks/use-matrix-settings-store.d.mts +5 -0
- package/dist/hooks/use-matrix-settings-store.mjs +15 -0
- package/dist/hooks/use-motion-store.d.mts +13 -0
- package/dist/hooks/use-motion-store.mjs +29 -0
- package/dist/hooks/use-os-modifier-key.d.mts +5 -0
- package/dist/hooks/use-os-modifier-key.mjs +15 -0
- package/dist/hooks/use-reading-progress.d.mts +8 -0
- package/dist/hooks/use-reading-progress.mjs +49 -0
- package/dist/hooks/use-reduced-motions.d.mts +4 -0
- package/dist/hooks/use-reduced-motions.mjs +10 -0
- package/dist/hooks/use-scroll-direction.d.mts +8 -0
- package/dist/hooks/use-scroll-direction.mjs +43 -0
- package/dist/hooks/use-typewriter.d.mts +15 -0
- package/dist/hooks/use-typewriter.mjs +89 -0
- package/dist/hooks/use-webgpu-supported.d.mts +4 -0
- package/dist/hooks/use-webgpu-supported.mjs +16 -0
- package/dist/index.d.mts +153 -0
- package/dist/index.mjs +88 -0
- package/dist/markdown.d.mts +2 -0
- package/dist/markdown.mjs +2 -0
- package/dist/molecules/accordion/accordion/accordion.d.mts +12 -0
- package/dist/molecules/accordion/accordion/accordion.mjs +130 -0
- package/dist/molecules/accordion/accordion/index.d.mts +2 -0
- package/dist/molecules/accordion/accordion/use-accordion-store.mjs +55 -0
- package/dist/molecules/breadcrumbs/breadcrumb/breadcrumb.d.mts +21 -0
- package/dist/molecules/breadcrumbs/breadcrumb/breadcrumb.mjs +186 -0
- package/dist/molecules/breadcrumbs/breadcrumb/index.d.mts +2 -0
- package/dist/molecules/breadcrumbs/breadcrumb/use-breadcrumb-store.mjs +29 -0
- package/dist/molecules/buttons/pagination-navigation/index.d.mts +2 -0
- package/dist/molecules/buttons/pagination-navigation/pagination-navigation.d.mts +11 -0
- package/dist/molecules/buttons/pagination-navigation/pagination-navigation.mjs +17 -0
- package/dist/molecules/buttons/pills-buttons/index.d.mts +2 -0
- package/dist/molecules/buttons/pills-buttons/pills-buttons.d.mts +10 -0
- package/dist/molecules/buttons/pills-buttons/pills-buttons.mjs +55 -0
- package/dist/molecules/buttons/segmented-control/segmented-control.d.mts +13 -0
- package/dist/molecules/buttons/segmented-control/segmented-control.mjs +46 -0
- package/dist/molecules/buttons/segmented-control/use-segmented-control-store.mjs +8 -0
- package/dist/molecules/buttons/social-contact/index.d.mts +2 -0
- package/dist/molecules/buttons/social-contact/social-contact.d.mts +10 -0
- package/dist/molecules/buttons/social-contact/social-contact.mjs +13 -0
- package/dist/molecules/buttons/tag/index.d.mts +2 -0
- package/dist/molecules/buttons/tag/tag.d.mts +17 -0
- package/dist/molecules/buttons/tag/tag.mjs +20 -0
- package/dist/molecules/buttons/terminal-button/index.d.mts +2 -0
- package/dist/molecules/buttons/terminal-button/terminal-button.d.mts +15 -0
- package/dist/molecules/buttons/terminal-button/terminal-button.mjs +38 -0
- package/dist/molecules/chart/chart-panel/chart-panel.d.mts +9 -0
- package/dist/molecules/chart/chart-panel/chart-panel.mjs +12 -0
- package/dist/molecules/chart/chart-panel/index.d.mts +2 -0
- package/dist/molecules/chart/chart-tooltip/chart-tooltip.d.mts +8 -0
- package/dist/molecules/chart/chart-tooltip/chart-tooltip.mjs +18 -0
- package/dist/molecules/chart/chart-tooltip/index.d.mts +2 -0
- package/dist/molecules/chart/donut-chart/donut-chart.d.mts +15 -0
- package/dist/molecules/chart/donut-chart/donut-chart.mjs +142 -0
- package/dist/molecules/chart/donut-chart/index.d.mts +2 -0
- package/dist/molecules/containers/content-container/content-container.d.mts +5 -0
- package/dist/molecules/containers/content-container/content-container.mjs +8 -0
- package/dist/molecules/containers/content-container/index.d.mts +2 -0
- package/dist/molecules/controls/control-slider/control-slider.d.mts +14 -0
- package/dist/molecules/controls/control-slider/control-slider.mjs +76 -0
- package/dist/molecules/controls/control-slider/index.d.mts +2 -0
- package/dist/molecules/controls/control-slider/use-control-slider-store.mjs +10 -0
- package/dist/molecules/effects/matrix-background/index.d.mts +2 -0
- package/dist/molecules/effects/matrix-background/matrix-background.d.mts +8 -0
- package/dist/molecules/effects/matrix-background/matrix-background.mjs +15 -0
- package/dist/molecules/effects/matrix-header-background/index.d.mts +2 -0
- package/dist/molecules/effects/matrix-header-background/matrix-header-background.d.mts +8 -0
- package/dist/molecules/effects/matrix-header-background/matrix-header-background.mjs +14 -0
- package/dist/molecules/effects/matrix-terminal/index.d.mts +2 -0
- package/dist/molecules/effects/matrix-terminal/matrix-terminal.d.mts +15 -0
- package/dist/molecules/effects/matrix-terminal/matrix-terminal.mjs +101 -0
- package/dist/molecules/effects/matrix-terminal/use-matrix-terminal-store.mjs +59 -0
- package/dist/molecules/form/filter-input/filter-input.d.mts +10 -0
- package/dist/molecules/form/filter-input/filter-input.mjs +35 -0
- package/dist/molecules/form/filter-input/index.d.mts +2 -0
- package/dist/molecules/form/form-error-summary/form-error-summary.d.mts +10 -0
- package/dist/molecules/form/form-error-summary/form-error-summary.mjs +71 -0
- package/dist/molecules/form/form-error-summary/index.d.mts +2 -0
- package/dist/molecules/form/form-field/form-field.d.mts +10 -0
- package/dist/molecules/form/form-field/form-field.mjs +60 -0
- package/dist/molecules/form/form-field/index.d.mts +2 -0
- package/dist/molecules/form/form-success-message/form-success-message.d.mts +8 -0
- package/dist/molecules/form/form-success-message/form-success-message.mjs +21 -0
- package/dist/molecules/form/form-success-message/index.d.mts +2 -0
- package/dist/molecules/form/form-textarea/form-textarea.d.mts +10 -0
- package/dist/molecules/form/form-textarea/form-textarea.mjs +60 -0
- package/dist/molecules/form/form-textarea/index.d.mts +2 -0
- package/dist/molecules/lightbox-image/index.d.mts +2 -0
- package/dist/molecules/lightbox-image/lightbox-image.d.mts +6 -0
- package/dist/molecules/lightbox-image/lightbox-image.mjs +49 -0
- package/dist/molecules/lightbox-image/use-lightbox-image-store.mjs +29 -0
- package/dist/molecules/links/pills-links/index.d.mts +2 -0
- package/dist/molecules/links/pills-links/pills-links.d.mts +13 -0
- package/dist/molecules/links/pills-links/pills-links.mjs +60 -0
- package/dist/molecules/menu/close/close.d.mts +8 -0
- package/dist/molecules/menu/close/close.mjs +9 -0
- package/dist/molecules/menu/close/index.d.mts +2 -0
- package/dist/molecules/menu/dropdown-menu/dropdown-menu.d.mts +25 -0
- package/dist/molecules/menu/dropdown-menu/dropdown-menu.mjs +143 -0
- package/dist/molecules/menu/dropdown-menu/index.d.mts +2 -0
- package/dist/molecules/menu/dropdown-menu/use-dropdown-menu-store.mjs +108 -0
- package/dist/molecules/menu/hamburger-menu/hamburger-menu.d.mts +8 -0
- package/dist/molecules/menu/hamburger-menu/hamburger-menu.mjs +9 -0
- package/dist/molecules/menu/hamburger-menu/index.d.mts +2 -0
- package/dist/molecules/menu/menu-item/index.d.mts +2 -0
- package/dist/molecules/menu/menu-item/menu-item.d.mts +16 -0
- package/dist/molecules/menu/menu-item/menu-item.mjs +65 -0
- package/dist/molecules/menu/menu-item/use-menu-item-store.mjs +10 -0
- package/dist/molecules/stat-card/index.d.mts +2 -0
- package/dist/molecules/stat-card/stat-card.d.mts +10 -0
- package/dist/molecules/stat-card/stat-card.mjs +21 -0
- package/dist/molecules/terminal-list-item/index.d.mts +2 -0
- package/dist/molecules/terminal-list-item/terminal-list-item.d.mts +9 -0
- package/dist/molecules/terminal-list-item/terminal-list-item.mjs +13 -0
- package/dist/molecules/terminal-progress-bar/index.d.mts +2 -0
- package/dist/molecules/terminal-progress-bar/terminal-progress-bar.d.mts +11 -0
- package/dist/molecules/terminal-progress-bar/terminal-progress-bar.mjs +20 -0
- package/dist/molecules/typography/page-title/index.d.mts +2 -0
- package/dist/molecules/typography/page-title/page-title.d.mts +5 -0
- package/dist/molecules/typography/page-title/page-title.mjs +8 -0
- package/dist/molecules/typography/paragraph-title-with-icon/index.d.mts +2 -0
- package/dist/molecules/typography/paragraph-title-with-icon/paragraph-title-with-icon.d.mts +8 -0
- package/dist/molecules/typography/paragraph-title-with-icon/paragraph-title-with-icon.mjs +13 -0
- package/dist/molecules/typography/section-heading/index.d.mts +2 -0
- package/dist/molecules/typography/section-heading/section-heading.d.mts +9 -0
- package/dist/molecules/typography/section-heading/section-heading.mjs +17 -0
- package/dist/molecules/video/self-hosted-video/index.d.mts +2 -0
- package/dist/molecules/video/self-hosted-video/self-hosted-video.d.mts +17 -0
- package/dist/molecules/video/self-hosted-video/self-hosted-video.mjs +39 -0
- package/dist/molecules/video/youtube/index.d.mts +2 -0
- package/dist/molecules/video/youtube/youtube.d.mts +9 -0
- package/dist/molecules/video/youtube/youtube.mjs +12 -0
- package/dist/organism/command-palette/command-palette/command-palette.d.mts +12 -0
- package/dist/organism/command-palette/command-palette/command-palette.mjs +148 -0
- package/dist/organism/command-palette/command-palette/index.d.mts +2 -0
- package/dist/organism/command-palette/command-palette/use-command-palette-store.mjs +121 -0
- package/dist/organism/command-palette/command-palette-group/command-palette-group.d.mts +9 -0
- package/dist/organism/command-palette/command-palette-group/command-palette-group.mjs +24 -0
- package/dist/organism/command-palette/command-palette-group/index.d.mts +2 -0
- package/dist/organism/command-palette/command-palette-item/command-palette-item.d.mts +11 -0
- package/dist/organism/command-palette/command-palette-item/command-palette-item.mjs +29 -0
- package/dist/organism/command-palette/command-palette-item/index.d.mts +2 -0
- package/dist/organism/command-palette/command-palette-item/use-command-palette-item-store.mjs +30 -0
- package/dist/organism/command-palette/index.d.mts +9 -0
- package/dist/organism/command-palette/toggle-motion-item/index.d.mts +2 -0
- package/dist/organism/command-palette/toggle-motion-item/toggle-motion-item.d.mts +8 -0
- package/dist/organism/command-palette/toggle-motion-item/toggle-motion-item.mjs +63 -0
- package/dist/organism/command-palette/toggle-motion-item/use-toggle-motion-item-store.mjs +45 -0
- package/dist/organism/cookie-consent-banner/cookie-consent-banner.d.mts +9 -0
- package/dist/organism/cookie-consent-banner/cookie-consent-banner.mjs +71 -0
- package/dist/organism/cookie-consent-banner/use-cookie-consent-banner-store.mjs +10 -0
- package/dist/organism/footer/footer.d.mts +26 -0
- package/dist/organism/footer/footer.mjs +193 -0
- package/dist/organism/footer/index.d.mts +3 -0
- package/dist/organism/footer/use-footer-store.d.mts +22 -0
- package/dist/organism/footer/use-footer-store.mjs +57 -0
- package/dist/organism/header/brand-header/brand-header.d.mts +14 -0
- package/dist/organism/header/brand-header/brand-header.mjs +132 -0
- package/dist/organism/header/brand-header/index.d.mts +2 -0
- package/dist/organism/image-carousel/fullscreen-modal/fullscreen-modal.mjs +148 -0
- package/dist/organism/image-carousel/fullscreen-modal/use-fullscreen-modal-store.mjs +129 -0
- package/dist/organism/image-carousel/image-carousel.d.mts +14 -0
- package/dist/organism/image-carousel/image-carousel.mjs +225 -0
- package/dist/organism/image-carousel/index.d.mts +2 -0
- package/dist/organism/image-carousel/navigation-buttons/navigation-buttons.mjs +22 -0
- package/dist/organism/image-carousel/navigation-buttons/use-navigation-buttons-store.mjs +18 -0
- package/dist/organism/image-carousel/page-indicators/page-indicator-button/page-indicator-button.mjs +14 -0
- package/dist/organism/image-carousel/page-indicators/page-indicator-button/use-page-indicator-button-store.mjs +11 -0
- package/dist/organism/image-carousel/page-indicators/page-indicators.mjs +20 -0
- package/dist/organism/image-carousel/use-image-carousel-store.mjs +88 -0
- package/dist/organism/lightbox/index.d.mts +2 -0
- package/dist/organism/lightbox/lightbox.d.mts +5 -0
- package/dist/organism/lightbox/lightbox.mjs +100 -0
- package/dist/organism/lightbox/use-lightbox-store.mjs +120 -0
- package/dist/organism/loading-bar/loading-bar.d.mts +7 -0
- package/dist/organism/loading-bar/loading-bar.mjs +48 -0
- package/dist/organism/loading-bar/use-loading-bar-store.mjs +52 -0
- package/dist/organism/menu/index.d.mts +3 -0
- package/dist/organism/menu/menu.d.mts +33 -0
- package/dist/organism/menu/menu.mjs +396 -0
- package/dist/organism/menu/use-menu-store.d.mts +22 -0
- package/dist/organism/menu/use-menu-store.mjs +265 -0
- package/dist/organism/profile-hero/index.d.mts +2 -0
- package/dist/organism/profile-hero/profile-hero.d.mts +15 -0
- package/dist/organism/profile-hero/profile-hero.mjs +72 -0
- package/dist/organism/profile-photo/index.d.mts +2 -0
- package/dist/organism/profile-photo/profile-photo.d.mts +12 -0
- package/dist/organism/profile-photo/profile-photo.mjs +17 -0
- package/dist/organism/reading-content-progress-bar/index.d.mts +2 -0
- package/dist/organism/reading-content-progress-bar/reading-content-progress-bar.d.mts +8 -0
- package/dist/organism/reading-content-progress-bar/reading-content-progress-bar.mjs +76 -0
- package/dist/organism/reading-content-progress-bar/use-reading-content-progress-bar-store.mjs +29 -0
- package/dist/organism/social-contacts/index.d.mts +2 -0
- package/dist/organism/social-contacts/social-contacts.d.mts +29 -0
- package/dist/organism/social-contacts/social-contacts.mjs +78 -0
- package/dist/state/command-palette/command-palette-context.d.mts +9 -0
- package/dist/state/command-palette/command-palette-context.mjs +10 -0
- package/dist/state/command-palette/command-palette-events.d.mts +11 -0
- package/dist/state/command-palette/command-palette-events.mjs +15 -0
- package/dist/state/command-palette/command-palette-trigger.d.mts +8 -0
- package/dist/state/lightbox/lightbox-events.d.mts +9 -0
- package/dist/state/lightbox/lightbox-events.mjs +7 -0
- package/dist/state/matrix-rain/matrix-settings.d.mts +37 -0
- package/dist/state/matrix-rain/matrix-settings.mjs +122 -0
- package/dist/state/motion/motion.d.mts +6 -0
- package/dist/state/motion/motion.mjs +17 -0
- package/package.json +160 -0
- package/src/styles/base.css +130 -0
- package/src/styles/components.css +57 -0
- package/src/styles/index.css +23 -0
- package/src/styles/pills.css +85 -0
- package/src/styles/theme.css +254 -0
package/dist/atoms/effects/matrix-rain/matrix-rain/matrix-2d-canvas/use-matrix-2d-canvas-store.mjs
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { debounce } from "./debounce.mjs";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
//#region src/atoms/effects/matrix-rain/matrix-rain/matrix-2d-canvas/use-matrix-2d-canvas-store.ts
|
|
6
|
+
const matrix = "ハミヒーウシナモニサワツオリアホテマケメエカキムユラセネスタヌヘ012345789Z:.=*+-<>".split("");
|
|
7
|
+
const colors = [
|
|
8
|
+
{
|
|
9
|
+
threshold: .05,
|
|
10
|
+
color: "#00FF41"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
threshold: .15,
|
|
14
|
+
color: "#39FF14"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
threshold: .4,
|
|
18
|
+
color: "#00CC33"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
threshold: .7,
|
|
22
|
+
color: "#003D10"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
threshold: .9,
|
|
26
|
+
color: "#003D10"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
threshold: Number.MAX_SAFE_INTEGER,
|
|
30
|
+
color: "#002200"
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
const backgroundColor = `#00110010`;
|
|
34
|
+
const FRAME_RATE = 20;
|
|
35
|
+
const setCanvasSize = (canvas, context) => {
|
|
36
|
+
const rect = canvas.getBoundingClientRect();
|
|
37
|
+
const dpr = window.devicePixelRatio || 1;
|
|
38
|
+
canvas.width = rect.width * dpr;
|
|
39
|
+
canvas.height = rect.height * dpr;
|
|
40
|
+
context?.scale(dpr, dpr);
|
|
41
|
+
};
|
|
42
|
+
const initializeDrops = (canvas, fontSize) => {
|
|
43
|
+
const columns = Math.floor(canvas.width / window.devicePixelRatio / fontSize);
|
|
44
|
+
const drops = [];
|
|
45
|
+
for (let x = 0; x < columns; x++) drops[x] = Math.floor(Math.random() * (canvas.height / window.devicePixelRatio) / fontSize);
|
|
46
|
+
return drops;
|
|
47
|
+
};
|
|
48
|
+
const initialize = (canvas, context, fontSize) => {
|
|
49
|
+
setCanvasSize(canvas, context);
|
|
50
|
+
return {
|
|
51
|
+
drops: initializeDrops(canvas, fontSize),
|
|
52
|
+
height: canvas.height / window.devicePixelRatio,
|
|
53
|
+
width: canvas.width / window.devicePixelRatio,
|
|
54
|
+
lastFrameTimestamp: performance.now(),
|
|
55
|
+
timeDistanceBetweenFrames: 1e3 / FRAME_RATE,
|
|
56
|
+
font: `${fontSize}px 'Courier Prime', monospace`,
|
|
57
|
+
animationFrameId: 0
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
const useMatrix2dCanvasStore = (fontSize, density, paused) => {
|
|
61
|
+
const $ = c(11);
|
|
62
|
+
const [canvasEl, setCanvasEl] = useState(null);
|
|
63
|
+
const lastWidth = useRef(0);
|
|
64
|
+
const rafRef = useRef(0);
|
|
65
|
+
const startRef = useRef(_temp);
|
|
66
|
+
const stopRef = useRef(_temp2);
|
|
67
|
+
const pausedRef = useRef(paused);
|
|
68
|
+
let t0;
|
|
69
|
+
let t1;
|
|
70
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
71
|
+
t0 = () => {
|
|
72
|
+
lastWidth.current = window.innerWidth;
|
|
73
|
+
};
|
|
74
|
+
t1 = [];
|
|
75
|
+
$[0] = t0;
|
|
76
|
+
$[1] = t1;
|
|
77
|
+
} else {
|
|
78
|
+
t0 = $[0];
|
|
79
|
+
t1 = $[1];
|
|
80
|
+
}
|
|
81
|
+
useEffect(t0, t1);
|
|
82
|
+
let t2;
|
|
83
|
+
let t3;
|
|
84
|
+
if ($[2] !== canvasEl || $[3] !== density || $[4] !== fontSize) {
|
|
85
|
+
t2 = () => {
|
|
86
|
+
const canvas = canvasEl;
|
|
87
|
+
if (!canvas) return;
|
|
88
|
+
const context = canvas.getContext("2d");
|
|
89
|
+
if (!context) return;
|
|
90
|
+
let matrixRainDrawContext = initialize(canvas, context, fontSize);
|
|
91
|
+
const drawFrame = () => {
|
|
92
|
+
context.font = matrixRainDrawContext.font;
|
|
93
|
+
context.fillStyle = backgroundColor;
|
|
94
|
+
context.fillRect(0, 0, matrixRainDrawContext.width, matrixRainDrawContext.height);
|
|
95
|
+
for (let i = 0; i < matrixRainDrawContext.drops.length; i++) {
|
|
96
|
+
const text = matrix[Math.floor(Math.random() * matrix.length)];
|
|
97
|
+
const color = colors.find(_temp3).color;
|
|
98
|
+
context.fillStyle = color;
|
|
99
|
+
const x = i * fontSize;
|
|
100
|
+
const y = matrixRainDrawContext.drops[i] * fontSize;
|
|
101
|
+
context.fillText(text, x, y);
|
|
102
|
+
if (y > matrixRainDrawContext.height && Math.random() > density) matrixRainDrawContext.drops[i] = 0;
|
|
103
|
+
matrixRainDrawContext.drops[i] = matrixRainDrawContext.drops[i] + 1;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
const frame = (now) => {
|
|
107
|
+
if (now - matrixRainDrawContext.lastFrameTimestamp < matrixRainDrawContext.timeDistanceBetweenFrames) {
|
|
108
|
+
rafRef.current = requestAnimationFrame(frame);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
drawFrame();
|
|
112
|
+
matrixRainDrawContext.lastFrameTimestamp = now;
|
|
113
|
+
rafRef.current = requestAnimationFrame(frame);
|
|
114
|
+
};
|
|
115
|
+
const start = () => {
|
|
116
|
+
cancelAnimationFrame(rafRef.current);
|
|
117
|
+
rafRef.current = requestAnimationFrame(frame);
|
|
118
|
+
};
|
|
119
|
+
const stop = () => {
|
|
120
|
+
cancelAnimationFrame(rafRef.current);
|
|
121
|
+
};
|
|
122
|
+
startRef.current = start;
|
|
123
|
+
stopRef.current = stop;
|
|
124
|
+
const resize = debounce(() => {
|
|
125
|
+
if (window.innerWidth !== lastWidth.current) {
|
|
126
|
+
lastWidth.current = window.innerWidth;
|
|
127
|
+
matrixRainDrawContext = initialize(canvas, context, fontSize);
|
|
128
|
+
for (let i_0 = 0; i_0 < FRAME_RATE; i_0++) drawFrame();
|
|
129
|
+
if (!pausedRef.current) start();
|
|
130
|
+
}
|
|
131
|
+
}, 300);
|
|
132
|
+
for (let i_1 = 0; i_1 < FRAME_RATE; i_1++) drawFrame();
|
|
133
|
+
if (!pausedRef.current) start();
|
|
134
|
+
window.addEventListener("resize", resize);
|
|
135
|
+
return () => {
|
|
136
|
+
cancelAnimationFrame(rafRef.current);
|
|
137
|
+
window.removeEventListener("resize", resize);
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
t3 = [
|
|
141
|
+
canvasEl,
|
|
142
|
+
fontSize,
|
|
143
|
+
density
|
|
144
|
+
];
|
|
145
|
+
$[2] = canvasEl;
|
|
146
|
+
$[3] = density;
|
|
147
|
+
$[4] = fontSize;
|
|
148
|
+
$[5] = t2;
|
|
149
|
+
$[6] = t3;
|
|
150
|
+
} else {
|
|
151
|
+
t2 = $[5];
|
|
152
|
+
t3 = $[6];
|
|
153
|
+
}
|
|
154
|
+
useEffect(t2, t3);
|
|
155
|
+
let t4;
|
|
156
|
+
let t5;
|
|
157
|
+
if ($[7] !== paused) {
|
|
158
|
+
t4 = () => {
|
|
159
|
+
pausedRef.current = paused;
|
|
160
|
+
if (paused) stopRef.current();
|
|
161
|
+
else startRef.current();
|
|
162
|
+
};
|
|
163
|
+
t5 = [paused];
|
|
164
|
+
$[7] = paused;
|
|
165
|
+
$[8] = t4;
|
|
166
|
+
$[9] = t5;
|
|
167
|
+
} else {
|
|
168
|
+
t4 = $[8];
|
|
169
|
+
t5 = $[9];
|
|
170
|
+
}
|
|
171
|
+
useEffect(t4, t5);
|
|
172
|
+
let t6;
|
|
173
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
174
|
+
t6 = { effects: { setCanvasEl } };
|
|
175
|
+
$[10] = t6;
|
|
176
|
+
} else t6 = $[10];
|
|
177
|
+
return t6;
|
|
178
|
+
};
|
|
179
|
+
function _temp() {}
|
|
180
|
+
function _temp2() {}
|
|
181
|
+
function _temp3(t0) {
|
|
182
|
+
const { threshold } = t0;
|
|
183
|
+
return Math.random() < threshold;
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
export { useMatrix2dCanvasStore };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Matrix2DCanvas } from "./matrix-2d-canvas/matrix-2d-canvas.mjs";
|
|
3
|
+
import { useMatrixRainStore } from "./use-matrix-rain-store.mjs";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { memo } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { MatrixRainWebGPU } from "matrix-rain-webgpu";
|
|
8
|
+
//#region src/atoms/effects/matrix-rain/matrix-rain/matrix-rain.tsx
|
|
9
|
+
const backgroundColor = `#00110010`;
|
|
10
|
+
const MatrixRainRenderer = () => {
|
|
11
|
+
const $ = c(16);
|
|
12
|
+
const { state, effects } = useMatrixRainStore();
|
|
13
|
+
const { paused, webGpuSupported, webGpuFailed, settings, rain, bloom, crt } = state;
|
|
14
|
+
const { setContainerEl, onWebGpuError } = effects;
|
|
15
|
+
const showWebGpu = webGpuSupported === true && !webGpuFailed;
|
|
16
|
+
const showFallback = webGpuSupported === false || webGpuFailed;
|
|
17
|
+
let t0;
|
|
18
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
19
|
+
t0 = { backgroundColor };
|
|
20
|
+
$[0] = t0;
|
|
21
|
+
} else t0 = $[0];
|
|
22
|
+
let t1;
|
|
23
|
+
if ($[1] !== bloom || $[2] !== crt || $[3] !== onWebGpuError || $[4] !== paused || $[5] !== rain || $[6] !== showWebGpu) {
|
|
24
|
+
t1 = showWebGpu && /* @__PURE__ */ jsx(MatrixRainWebGPU, {
|
|
25
|
+
paused,
|
|
26
|
+
rain,
|
|
27
|
+
bloom,
|
|
28
|
+
crt,
|
|
29
|
+
onError: onWebGpuError
|
|
30
|
+
});
|
|
31
|
+
$[1] = bloom;
|
|
32
|
+
$[2] = crt;
|
|
33
|
+
$[3] = onWebGpuError;
|
|
34
|
+
$[4] = paused;
|
|
35
|
+
$[5] = rain;
|
|
36
|
+
$[6] = showWebGpu;
|
|
37
|
+
$[7] = t1;
|
|
38
|
+
} else t1 = $[7];
|
|
39
|
+
let t2;
|
|
40
|
+
if ($[8] !== paused || $[9] !== settings || $[10] !== showFallback) {
|
|
41
|
+
t2 = showFallback && /* @__PURE__ */ jsx(Matrix2DCanvas, {
|
|
42
|
+
fontSize: settings.rain.fontSize,
|
|
43
|
+
density: settings.rain.density,
|
|
44
|
+
paused
|
|
45
|
+
});
|
|
46
|
+
$[8] = paused;
|
|
47
|
+
$[9] = settings;
|
|
48
|
+
$[10] = showFallback;
|
|
49
|
+
$[11] = t2;
|
|
50
|
+
} else t2 = $[11];
|
|
51
|
+
let t3;
|
|
52
|
+
if ($[12] !== setContainerEl || $[13] !== t1 || $[14] !== t2) {
|
|
53
|
+
t3 = /* @__PURE__ */ jsxs("div", {
|
|
54
|
+
ref: setContainerEl,
|
|
55
|
+
className: "pointer-events-none absolute top-0 left-0 h-full w-full",
|
|
56
|
+
style: t0,
|
|
57
|
+
children: [t1, t2]
|
|
58
|
+
});
|
|
59
|
+
$[12] = setContainerEl;
|
|
60
|
+
$[13] = t1;
|
|
61
|
+
$[14] = t2;
|
|
62
|
+
$[15] = t3;
|
|
63
|
+
} else t3 = $[15];
|
|
64
|
+
return t3;
|
|
65
|
+
};
|
|
66
|
+
const MatrixRain = memo(MatrixRainRenderer);
|
|
67
|
+
//#endregion
|
|
68
|
+
export { MatrixRain };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useReducedMotions } from "../../../../hooks/use-reduced-motions.mjs";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
//#region src/atoms/effects/matrix-rain/matrix-rain/use-matrix-rain-activity.ts
|
|
6
|
+
function useMatrixRainActivity(element) {
|
|
7
|
+
const $ = c(3);
|
|
8
|
+
const reducedMotion = useReducedMotions();
|
|
9
|
+
const [onScreen, setOnScreen] = useState(true);
|
|
10
|
+
let t0;
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] !== element) {
|
|
13
|
+
t0 = () => {
|
|
14
|
+
if (!element) return;
|
|
15
|
+
const observer = new window.IntersectionObserver((t2) => {
|
|
16
|
+
const [entry] = t2;
|
|
17
|
+
setOnScreen(entry.isIntersecting || entry.intersectionRect.height > 0);
|
|
18
|
+
}, {
|
|
19
|
+
root: null,
|
|
20
|
+
rootMargin: "-50px 0px -50px 0px",
|
|
21
|
+
threshold: 0
|
|
22
|
+
});
|
|
23
|
+
observer.observe(element);
|
|
24
|
+
return () => {
|
|
25
|
+
observer.disconnect();
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
t1 = [element];
|
|
29
|
+
$[0] = element;
|
|
30
|
+
$[1] = t0;
|
|
31
|
+
$[2] = t1;
|
|
32
|
+
} else {
|
|
33
|
+
t0 = $[1];
|
|
34
|
+
t1 = $[2];
|
|
35
|
+
}
|
|
36
|
+
useEffect(t0, t1);
|
|
37
|
+
return reducedMotion || !onScreen;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { useMatrixRainActivity };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMatrixRainActivity } from "./use-matrix-rain-activity.mjs";
|
|
3
|
+
import { useWebGpuSupported } from "../../../../hooks/use-webgpu-supported.mjs";
|
|
4
|
+
import { settingsToProps } from "../../../../state/matrix-rain/matrix-settings.mjs";
|
|
5
|
+
import { useMatrixSettingsStore } from "../../../../hooks/use-matrix-settings-store.mjs";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
//#region src/atoms/effects/matrix-rain/matrix-rain/use-matrix-rain-store.ts
|
|
9
|
+
const useMatrixRainStore = () => {
|
|
10
|
+
const $ = c(14);
|
|
11
|
+
const [containerEl, setContainerEl] = useState(null);
|
|
12
|
+
const [webGpuFailed, setWebGpuFailed] = useState(false);
|
|
13
|
+
const webGpuSupported = useWebGpuSupported();
|
|
14
|
+
const settings = useMatrixSettingsStore();
|
|
15
|
+
let t0;
|
|
16
|
+
if ($[0] !== settings) {
|
|
17
|
+
t0 = settingsToProps(settings);
|
|
18
|
+
$[0] = settings;
|
|
19
|
+
$[1] = t0;
|
|
20
|
+
} else t0 = $[1];
|
|
21
|
+
const { rain, bloom, crt } = t0;
|
|
22
|
+
const paused = useMatrixRainActivity(containerEl);
|
|
23
|
+
let t1;
|
|
24
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
25
|
+
t1 = () => setWebGpuFailed(true);
|
|
26
|
+
$[2] = t1;
|
|
27
|
+
} else t1 = $[2];
|
|
28
|
+
const onWebGpuError = t1;
|
|
29
|
+
let t2;
|
|
30
|
+
if ($[3] !== bloom || $[4] !== crt || $[5] !== paused || $[6] !== rain || $[7] !== settings || $[8] !== webGpuFailed || $[9] !== webGpuSupported) {
|
|
31
|
+
t2 = {
|
|
32
|
+
paused,
|
|
33
|
+
webGpuSupported,
|
|
34
|
+
webGpuFailed,
|
|
35
|
+
settings,
|
|
36
|
+
rain,
|
|
37
|
+
bloom,
|
|
38
|
+
crt
|
|
39
|
+
};
|
|
40
|
+
$[3] = bloom;
|
|
41
|
+
$[4] = crt;
|
|
42
|
+
$[5] = paused;
|
|
43
|
+
$[6] = rain;
|
|
44
|
+
$[7] = settings;
|
|
45
|
+
$[8] = webGpuFailed;
|
|
46
|
+
$[9] = webGpuSupported;
|
|
47
|
+
$[10] = t2;
|
|
48
|
+
} else t2 = $[10];
|
|
49
|
+
let t3;
|
|
50
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
51
|
+
t3 = {
|
|
52
|
+
setContainerEl,
|
|
53
|
+
onWebGpuError
|
|
54
|
+
};
|
|
55
|
+
$[11] = t3;
|
|
56
|
+
} else t3 = $[11];
|
|
57
|
+
let t4;
|
|
58
|
+
if ($[12] !== t2) {
|
|
59
|
+
t4 = {
|
|
60
|
+
state: t2,
|
|
61
|
+
effects: t3
|
|
62
|
+
};
|
|
63
|
+
$[12] = t2;
|
|
64
|
+
$[13] = t4;
|
|
65
|
+
} else t4 = $[13];
|
|
66
|
+
return t4;
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
export { useMatrixRainStore };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
//#region src/atoms/effects/overlay/overlay.d.ts
|
|
3
|
+
interface OverlayProps {
|
|
4
|
+
delay: number;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const Overlay: FC<OverlayProps>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Overlay, OverlayProps };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useOverlayStore } from "./use-overlay-store.mjs";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { motion } from "framer-motion";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
//#region src/atoms/effects/overlay/overlay.tsx
|
|
7
|
+
const Overlay = (t0) => {
|
|
8
|
+
const $ = c(10);
|
|
9
|
+
const { onClick, delay: t1, children, className: t2 } = t0;
|
|
10
|
+
const delay = t1 === void 0 ? 0 : t1;
|
|
11
|
+
const className = t2 === void 0 ? "" : t2;
|
|
12
|
+
useOverlayStore();
|
|
13
|
+
const t3 = `fixed top-0 left-0 w-full h-full bg-black-alpha-75 backdrop-blur-sm z-40 ${className}`;
|
|
14
|
+
let t4;
|
|
15
|
+
let t5;
|
|
16
|
+
let t6;
|
|
17
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
18
|
+
t4 = { opacity: 0 };
|
|
19
|
+
t5 = { opacity: 1 };
|
|
20
|
+
t6 = { opacity: 0 };
|
|
21
|
+
$[0] = t4;
|
|
22
|
+
$[1] = t5;
|
|
23
|
+
$[2] = t6;
|
|
24
|
+
} else {
|
|
25
|
+
t4 = $[0];
|
|
26
|
+
t5 = $[1];
|
|
27
|
+
t6 = $[2];
|
|
28
|
+
}
|
|
29
|
+
let t7;
|
|
30
|
+
if ($[3] !== delay) {
|
|
31
|
+
t7 = {
|
|
32
|
+
type: "spring",
|
|
33
|
+
stiffness: 400,
|
|
34
|
+
damping: 30,
|
|
35
|
+
duration: .25,
|
|
36
|
+
delay
|
|
37
|
+
};
|
|
38
|
+
$[3] = delay;
|
|
39
|
+
$[4] = t7;
|
|
40
|
+
} else t7 = $[4];
|
|
41
|
+
let t8;
|
|
42
|
+
if ($[5] !== children || $[6] !== onClick || $[7] !== t3 || $[8] !== t7) {
|
|
43
|
+
t8 = /* @__PURE__ */ jsx(motion.div, {
|
|
44
|
+
className: t3,
|
|
45
|
+
onClick,
|
|
46
|
+
initial: t4,
|
|
47
|
+
animate: t5,
|
|
48
|
+
exit: t6,
|
|
49
|
+
transition: t7,
|
|
50
|
+
children
|
|
51
|
+
});
|
|
52
|
+
$[5] = children;
|
|
53
|
+
$[6] = onClick;
|
|
54
|
+
$[7] = t3;
|
|
55
|
+
$[8] = t7;
|
|
56
|
+
$[9] = t8;
|
|
57
|
+
} else t8 = $[9];
|
|
58
|
+
return t8;
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
export { Overlay };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from "react";
|
|
2
|
+
//#region src/atoms/effects/pills/pills.d.ts
|
|
3
|
+
declare const RedPillNoReflection: FC<PropsWithChildren<{
|
|
4
|
+
pillBodyClassName?: string;
|
|
5
|
+
pillLabelClassName?: string;
|
|
6
|
+
}>>;
|
|
7
|
+
declare const RedPill: FC<PropsWithChildren>;
|
|
8
|
+
declare const BluePill: FC<PropsWithChildren>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { BluePill, RedPill, RedPillNoReflection };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { usePillsStore } from "./use-pills-store.mjs";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/atoms/effects/pills/pills.tsx
|
|
6
|
+
const PillsRoot = (t0) => {
|
|
7
|
+
const $ = c(16);
|
|
8
|
+
const { variant, children, pillBodyClassName, pillLabelClassName } = t0;
|
|
9
|
+
const { state } = usePillsStore();
|
|
10
|
+
const { shouldReduceMotion } = state;
|
|
11
|
+
if (variant === "red-no-reflection") {
|
|
12
|
+
const t1 = `pill pill-red ${shouldReduceMotion ? "pill-red-glass-lite" : "pill-red-glass"} pill-no-reflection ${pillBodyClassName}`;
|
|
13
|
+
const t2 = `pill-label ${pillLabelClassName}`;
|
|
14
|
+
let t3;
|
|
15
|
+
if ($[0] !== children || $[1] !== t2) {
|
|
16
|
+
t3 = /* @__PURE__ */ jsx("span", {
|
|
17
|
+
className: t2,
|
|
18
|
+
children
|
|
19
|
+
});
|
|
20
|
+
$[0] = children;
|
|
21
|
+
$[1] = t2;
|
|
22
|
+
$[2] = t3;
|
|
23
|
+
} else t3 = $[2];
|
|
24
|
+
let t4;
|
|
25
|
+
if ($[3] !== t1 || $[4] !== t3) {
|
|
26
|
+
t4 = /* @__PURE__ */ jsx("div", {
|
|
27
|
+
className: t1,
|
|
28
|
+
children: t3
|
|
29
|
+
});
|
|
30
|
+
$[3] = t1;
|
|
31
|
+
$[4] = t3;
|
|
32
|
+
$[5] = t4;
|
|
33
|
+
} else t4 = $[5];
|
|
34
|
+
return t4;
|
|
35
|
+
}
|
|
36
|
+
if (variant === "red") {
|
|
37
|
+
const t1 = `pill pill-red ${shouldReduceMotion ? "pill-red-glass-lite" : "pill-red-glass"}`;
|
|
38
|
+
let t2;
|
|
39
|
+
if ($[6] !== children) {
|
|
40
|
+
t2 = /* @__PURE__ */ jsx("span", {
|
|
41
|
+
className: "pill-label",
|
|
42
|
+
children
|
|
43
|
+
});
|
|
44
|
+
$[6] = children;
|
|
45
|
+
$[7] = t2;
|
|
46
|
+
} else t2 = $[7];
|
|
47
|
+
let t3;
|
|
48
|
+
if ($[8] !== t1 || $[9] !== t2) {
|
|
49
|
+
t3 = /* @__PURE__ */ jsx("div", {
|
|
50
|
+
className: t1,
|
|
51
|
+
children: t2
|
|
52
|
+
});
|
|
53
|
+
$[8] = t1;
|
|
54
|
+
$[9] = t2;
|
|
55
|
+
$[10] = t3;
|
|
56
|
+
} else t3 = $[10];
|
|
57
|
+
return t3;
|
|
58
|
+
}
|
|
59
|
+
const t1 = `pill pill-blue ${shouldReduceMotion ? "pill-blue-glass-lite" : "pill-blue-glass"}`;
|
|
60
|
+
let t2;
|
|
61
|
+
if ($[11] !== children) {
|
|
62
|
+
t2 = /* @__PURE__ */ jsx("span", {
|
|
63
|
+
className: "pill-label",
|
|
64
|
+
children
|
|
65
|
+
});
|
|
66
|
+
$[11] = children;
|
|
67
|
+
$[12] = t2;
|
|
68
|
+
} else t2 = $[12];
|
|
69
|
+
let t3;
|
|
70
|
+
if ($[13] !== t1 || $[14] !== t2) {
|
|
71
|
+
t3 = /* @__PURE__ */ jsx("div", {
|
|
72
|
+
className: t1,
|
|
73
|
+
children: t2
|
|
74
|
+
});
|
|
75
|
+
$[13] = t1;
|
|
76
|
+
$[14] = t2;
|
|
77
|
+
$[15] = t3;
|
|
78
|
+
} else t3 = $[15];
|
|
79
|
+
return t3;
|
|
80
|
+
};
|
|
81
|
+
const RedPillNoReflection = (props) => {
|
|
82
|
+
const $ = c(2);
|
|
83
|
+
let t0;
|
|
84
|
+
if ($[0] !== props) {
|
|
85
|
+
t0 = /* @__PURE__ */ jsx(PillsRoot, {
|
|
86
|
+
variant: "red-no-reflection",
|
|
87
|
+
...props
|
|
88
|
+
});
|
|
89
|
+
$[0] = props;
|
|
90
|
+
$[1] = t0;
|
|
91
|
+
} else t0 = $[1];
|
|
92
|
+
return t0;
|
|
93
|
+
};
|
|
94
|
+
const RedPill = (props) => {
|
|
95
|
+
const $ = c(2);
|
|
96
|
+
let t0;
|
|
97
|
+
if ($[0] !== props) {
|
|
98
|
+
t0 = /* @__PURE__ */ jsx(PillsRoot, {
|
|
99
|
+
variant: "red",
|
|
100
|
+
...props
|
|
101
|
+
});
|
|
102
|
+
$[0] = props;
|
|
103
|
+
$[1] = t0;
|
|
104
|
+
} else t0 = $[1];
|
|
105
|
+
return t0;
|
|
106
|
+
};
|
|
107
|
+
const BluePill = (props) => {
|
|
108
|
+
const $ = c(2);
|
|
109
|
+
let t0;
|
|
110
|
+
if ($[0] !== props) {
|
|
111
|
+
t0 = /* @__PURE__ */ jsx(PillsRoot, {
|
|
112
|
+
variant: "blue",
|
|
113
|
+
...props
|
|
114
|
+
});
|
|
115
|
+
$[0] = props;
|
|
116
|
+
$[1] = t0;
|
|
117
|
+
} else t0 = $[1];
|
|
118
|
+
return t0;
|
|
119
|
+
};
|
|
120
|
+
//#endregion
|
|
121
|
+
export { BluePill, RedPill, RedPillNoReflection };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useReducedMotions } from "../../../hooks/use-reduced-motions.mjs";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
//#region src/atoms/effects/pills/use-pills-store.ts
|
|
5
|
+
const usePillsStore = () => {
|
|
6
|
+
const $ = c(2);
|
|
7
|
+
const shouldReduceMotion = useReducedMotions();
|
|
8
|
+
let t0;
|
|
9
|
+
if ($[0] !== shouldReduceMotion) {
|
|
10
|
+
t0 = { state: { shouldReduceMotion } };
|
|
11
|
+
$[0] = shouldReduceMotion;
|
|
12
|
+
$[1] = t0;
|
|
13
|
+
} else t0 = $[1];
|
|
14
|
+
return t0;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { usePillsStore };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { CSSProperties, FC, ImgHTMLAttributes, ReactEventHandler } from "react";
|
|
2
|
+
//#region src/atoms/effects/plain-image/plain-image.d.ts
|
|
3
|
+
type ImagePlaceholder = "blur" | "empty" | `data:image/${string}`;
|
|
4
|
+
/**
|
|
5
|
+
* A plain URL, or the object shape every bundler's static image import produces (Next, Vite and
|
|
6
|
+
* webpack all emit at least `src`). Accepting both keeps the design system usable with or without a
|
|
7
|
+
* build step that understands image imports.
|
|
8
|
+
*/
|
|
9
|
+
type ImageSource = string | {
|
|
10
|
+
src: string;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
blurDataURL?: string;
|
|
14
|
+
};
|
|
15
|
+
interface ImageComponentProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, "src" | "alt" | "placeholder" | "width" | "height" | "loading"> {
|
|
16
|
+
src: ImageSource;
|
|
17
|
+
alt: string;
|
|
18
|
+
width?: number | `${number}`;
|
|
19
|
+
height?: number | `${number}`;
|
|
20
|
+
/** Absolutely fill the nearest positioned ancestor, as `next/image` does. */
|
|
21
|
+
fill?: boolean;
|
|
22
|
+
sizes?: string;
|
|
23
|
+
priority?: boolean;
|
|
24
|
+
quality?: number;
|
|
25
|
+
loading?: "eager" | "lazy";
|
|
26
|
+
placeholder?: ImagePlaceholder;
|
|
27
|
+
blurDataURL?: string;
|
|
28
|
+
className?: string;
|
|
29
|
+
style?: CSSProperties;
|
|
30
|
+
onClick?: ReactEventHandler<HTMLImageElement>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* What the design system needs from an image renderer. Consumers inject an optimising implementation
|
|
34
|
+
* (`next/image`, and so on); without one, components fall back to {@link PlainImage}.
|
|
35
|
+
*/
|
|
36
|
+
type ImageComponent = FC<ImageComponentProps>;
|
|
37
|
+
/**
|
|
38
|
+
* The framework-free default: a real `<img>`. It reproduces the `next/image` behaviours design-system
|
|
39
|
+
* layouts depend on — `fill` positioning, a placeholder painted behind the image until it loads, and
|
|
40
|
+
* lazy loading unless the caller marks the image as priority. Optimisation-only props are
|
|
41
|
+
* destructured away instead of spread onto the DOM, where React would warn about them.
|
|
42
|
+
*/
|
|
43
|
+
declare const PlainImage: ImageComponent;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { ImageComponent, ImageComponentProps, ImagePlaceholder, ImageSource, PlainImage };
|