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
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { usePlainImageStore } from "./use-plain-image-store.mjs";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/atoms/effects/plain-image/plain-image.tsx
|
|
6
|
+
/**
|
|
7
|
+
* `next/image`'s `fill` positions the image to cover its ancestor but sets no `object-fit`, leaving
|
|
8
|
+
* that to the caller's class. Setting one here as an inline style would silently beat that class.
|
|
9
|
+
*/
|
|
10
|
+
const fillStyle = {
|
|
11
|
+
position: "absolute",
|
|
12
|
+
height: "100%",
|
|
13
|
+
width: "100%",
|
|
14
|
+
inset: 0
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Resolves what to paint behind a loading image. `next/image` treats a `data:` placeholder as the
|
|
18
|
+
* image to show directly, and `"blur"` as an instruction to use `blurDataURL`.
|
|
19
|
+
*/
|
|
20
|
+
const placeholderSource = (placeholder, blurDataURL) => {
|
|
21
|
+
if (!placeholder || placeholder === "empty") return;
|
|
22
|
+
return placeholder === "blur" ? blurDataURL : placeholder;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The framework-free default: a real `<img>`. It reproduces the `next/image` behaviours design-system
|
|
26
|
+
* layouts depend on — `fill` positioning, a placeholder painted behind the image until it loads, and
|
|
27
|
+
* lazy loading unless the caller marks the image as priority. Optimisation-only props are
|
|
28
|
+
* destructured away instead of spread onto the DOM, where React would warn about them.
|
|
29
|
+
*/
|
|
30
|
+
const PlainImage = (t0) => {
|
|
31
|
+
const $ = c(30);
|
|
32
|
+
let alt;
|
|
33
|
+
let blurDataURL;
|
|
34
|
+
let fill;
|
|
35
|
+
let loading;
|
|
36
|
+
let onLoad;
|
|
37
|
+
let placeholder;
|
|
38
|
+
let priority;
|
|
39
|
+
let rest;
|
|
40
|
+
let src;
|
|
41
|
+
let style;
|
|
42
|
+
if ($[0] !== t0) {
|
|
43
|
+
const { src: t1, alt: t2, fill: t3, placeholder: t4, blurDataURL: t5, style: t6, loading: t7, priority: t8, onLoad: t9, quality: _quality, ...t10 } = t0;
|
|
44
|
+
src = t1;
|
|
45
|
+
alt = t2;
|
|
46
|
+
fill = t3;
|
|
47
|
+
placeholder = t4;
|
|
48
|
+
blurDataURL = t5;
|
|
49
|
+
style = t6;
|
|
50
|
+
loading = t7;
|
|
51
|
+
priority = t8;
|
|
52
|
+
onLoad = t9;
|
|
53
|
+
rest = t10;
|
|
54
|
+
$[0] = t0;
|
|
55
|
+
$[1] = alt;
|
|
56
|
+
$[2] = blurDataURL;
|
|
57
|
+
$[3] = fill;
|
|
58
|
+
$[4] = loading;
|
|
59
|
+
$[5] = onLoad;
|
|
60
|
+
$[6] = placeholder;
|
|
61
|
+
$[7] = priority;
|
|
62
|
+
$[8] = rest;
|
|
63
|
+
$[9] = src;
|
|
64
|
+
$[10] = style;
|
|
65
|
+
} else {
|
|
66
|
+
alt = $[1];
|
|
67
|
+
blurDataURL = $[2];
|
|
68
|
+
fill = $[3];
|
|
69
|
+
loading = $[4];
|
|
70
|
+
onLoad = $[5];
|
|
71
|
+
placeholder = $[6];
|
|
72
|
+
priority = $[7];
|
|
73
|
+
rest = $[8];
|
|
74
|
+
src = $[9];
|
|
75
|
+
style = $[10];
|
|
76
|
+
}
|
|
77
|
+
const { state, effects } = usePlainImageStore(onLoad);
|
|
78
|
+
const { loaded } = state;
|
|
79
|
+
const { setImage, handleLoad } = effects;
|
|
80
|
+
const resolvedSrc = typeof src === "string" ? src : src.src;
|
|
81
|
+
let t1;
|
|
82
|
+
if ($[11] !== blurDataURL || $[12] !== loaded || $[13] !== placeholder) {
|
|
83
|
+
t1 = loaded ? void 0 : placeholderSource(placeholder, blurDataURL);
|
|
84
|
+
$[11] = blurDataURL;
|
|
85
|
+
$[12] = loaded;
|
|
86
|
+
$[13] = placeholder;
|
|
87
|
+
$[14] = t1;
|
|
88
|
+
} else t1 = $[14];
|
|
89
|
+
const background = t1;
|
|
90
|
+
const t2 = loading ?? (priority ? "eager" : "lazy");
|
|
91
|
+
const t3 = priority ? "high" : void 0;
|
|
92
|
+
const t4 = fill ? fillStyle : void 0;
|
|
93
|
+
let t5;
|
|
94
|
+
if ($[15] !== background) {
|
|
95
|
+
t5 = background ? {
|
|
96
|
+
backgroundImage: `url(${background})`,
|
|
97
|
+
backgroundSize: "cover",
|
|
98
|
+
backgroundPosition: "center"
|
|
99
|
+
} : void 0;
|
|
100
|
+
$[15] = background;
|
|
101
|
+
$[16] = t5;
|
|
102
|
+
} else t5 = $[16];
|
|
103
|
+
let t6;
|
|
104
|
+
if ($[17] !== style || $[18] !== t4 || $[19] !== t5) {
|
|
105
|
+
t6 = {
|
|
106
|
+
...t4,
|
|
107
|
+
...t5,
|
|
108
|
+
...style
|
|
109
|
+
};
|
|
110
|
+
$[17] = style;
|
|
111
|
+
$[18] = t4;
|
|
112
|
+
$[19] = t5;
|
|
113
|
+
$[20] = t6;
|
|
114
|
+
} else t6 = $[20];
|
|
115
|
+
let t7;
|
|
116
|
+
if ($[21] !== alt || $[22] !== handleLoad || $[23] !== resolvedSrc || $[24] !== rest || $[25] !== setImage || $[26] !== t2 || $[27] !== t3 || $[28] !== t6) {
|
|
117
|
+
t7 = /* @__PURE__ */ jsx("img", {
|
|
118
|
+
ref: setImage,
|
|
119
|
+
src: resolvedSrc,
|
|
120
|
+
alt,
|
|
121
|
+
loading: t2,
|
|
122
|
+
fetchPriority: t3,
|
|
123
|
+
onLoad: handleLoad,
|
|
124
|
+
style: t6,
|
|
125
|
+
...rest
|
|
126
|
+
});
|
|
127
|
+
$[21] = alt;
|
|
128
|
+
$[22] = handleLoad;
|
|
129
|
+
$[23] = resolvedSrc;
|
|
130
|
+
$[24] = rest;
|
|
131
|
+
$[25] = setImage;
|
|
132
|
+
$[26] = t2;
|
|
133
|
+
$[27] = t3;
|
|
134
|
+
$[28] = t6;
|
|
135
|
+
$[29] = t7;
|
|
136
|
+
} else t7 = $[29];
|
|
137
|
+
return t7;
|
|
138
|
+
};
|
|
139
|
+
//#endregion
|
|
140
|
+
export { PlainImage };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
//#region src/atoms/effects/plain-image/use-plain-image-store.ts
|
|
5
|
+
/**
|
|
6
|
+
* Tracks whether the image has painted, so the placeholder behind it can be dropped once it has —
|
|
7
|
+
* `next/image` does the same.
|
|
8
|
+
*
|
|
9
|
+
* The `complete` check in the ref callback matters for server-rendered markup: an image the browser
|
|
10
|
+
* already has cached can finish loading before React attaches its handlers, and the `load` event
|
|
11
|
+
* would then never reach us, leaving the placeholder showing through a transparent PNG forever.
|
|
12
|
+
*/
|
|
13
|
+
const usePlainImageStore = (onLoad) => {
|
|
14
|
+
const $ = c(10);
|
|
15
|
+
const [loaded, setLoaded] = useState(false);
|
|
16
|
+
let t0;
|
|
17
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
18
|
+
t0 = (image) => {
|
|
19
|
+
if (image?.complete) setLoaded(true);
|
|
20
|
+
};
|
|
21
|
+
$[0] = t0;
|
|
22
|
+
} else t0 = $[0];
|
|
23
|
+
const setImage = t0;
|
|
24
|
+
let t1;
|
|
25
|
+
if ($[1] !== onLoad) {
|
|
26
|
+
t1 = (event) => {
|
|
27
|
+
setLoaded(true);
|
|
28
|
+
onLoad?.(event);
|
|
29
|
+
};
|
|
30
|
+
$[1] = onLoad;
|
|
31
|
+
$[2] = t1;
|
|
32
|
+
} else t1 = $[2];
|
|
33
|
+
const handleLoad = t1;
|
|
34
|
+
let t2;
|
|
35
|
+
if ($[3] !== loaded) {
|
|
36
|
+
t2 = { loaded };
|
|
37
|
+
$[3] = loaded;
|
|
38
|
+
$[4] = t2;
|
|
39
|
+
} else t2 = $[4];
|
|
40
|
+
let t3;
|
|
41
|
+
if ($[5] !== handleLoad) {
|
|
42
|
+
t3 = {
|
|
43
|
+
setImage,
|
|
44
|
+
handleLoad
|
|
45
|
+
};
|
|
46
|
+
$[5] = handleLoad;
|
|
47
|
+
$[6] = t3;
|
|
48
|
+
} else t3 = $[6];
|
|
49
|
+
let t4;
|
|
50
|
+
if ($[7] !== t2 || $[8] !== t3) {
|
|
51
|
+
t4 = {
|
|
52
|
+
state: t2,
|
|
53
|
+
effects: t3
|
|
54
|
+
};
|
|
55
|
+
$[7] = t2;
|
|
56
|
+
$[8] = t3;
|
|
57
|
+
$[9] = t4;
|
|
58
|
+
} else t4 = $[9];
|
|
59
|
+
return t4;
|
|
60
|
+
};
|
|
61
|
+
//#endregion
|
|
62
|
+
export { usePlainImageStore };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RoundedIcon } from "../rounded-icon/rounded-icon.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { BiChat } from "react-icons/bi";
|
|
4
|
+
//#region src/atoms/icons/chat-icon/chat-icon.tsx
|
|
5
|
+
const ChatIcon = () => /* @__PURE__ */ jsx(RoundedIcon, {
|
|
6
|
+
className: "animate-pulse flex items-center justify-center text-text-above-primary",
|
|
7
|
+
children: /* @__PURE__ */ jsx(BiChat, {
|
|
8
|
+
className: "size-5 md:size-7",
|
|
9
|
+
"aria-hidden": "true"
|
|
10
|
+
})
|
|
11
|
+
});
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ChatIcon };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/atoms/icons/copy-icon/copy-icon.d.ts
|
|
2
|
+
declare const CopyIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const CopiedIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const CopyErrorIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { CopiedIcon, CopyErrorIcon, CopyIcon };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { MdCheck, MdContentCopy, MdErrorOutline } from "react-icons/md";
|
|
3
|
+
//#region src/atoms/icons/copy-icon/copy-icon.tsx
|
|
4
|
+
const CopyIcon = () => /* @__PURE__ */ jsx(MdContentCopy, {
|
|
5
|
+
className: "size-4",
|
|
6
|
+
title: "Copy code"
|
|
7
|
+
});
|
|
8
|
+
const CopiedIcon = () => /* @__PURE__ */ jsx(MdCheck, {
|
|
9
|
+
className: "size-4",
|
|
10
|
+
title: "Copied!"
|
|
11
|
+
});
|
|
12
|
+
const CopyErrorIcon = () => /* @__PURE__ */ jsx(MdErrorOutline, {
|
|
13
|
+
className: "size-4",
|
|
14
|
+
title: "Copy failed"
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
export { CopiedIcon, CopyErrorIcon, CopyIcon };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from "react";
|
|
2
|
+
//#region src/atoms/icons/rounded-icon/rounded-icon.d.ts
|
|
3
|
+
interface RoundedIconProps extends PropsWithChildren {
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const RoundedIcon: FC<RoundedIconProps>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { RoundedIcon };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
//#region src/atoms/icons/rounded-icon/rounded-icon.tsx
|
|
3
|
+
const RoundedIcon = ({ children, className }) => /* @__PURE__ */ jsx("div", {
|
|
4
|
+
className: `bg-accent flex h-[40px] w-[40px] cursor-pointer items-center justify-center rounded-full transition-all duration-300 hover:scale-125 md:h-[50px] md:w-[50px] ${className}`,
|
|
5
|
+
children
|
|
6
|
+
});
|
|
7
|
+
//#endregion
|
|
8
|
+
export { RoundedIcon };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes, FC, ReactNode } from "react";
|
|
2
|
+
//#region src/atoms/links/anchor-link/anchor-link.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* How a link decides when to prefetch its destination. This is a hint the design system passes to
|
|
5
|
+
* whatever link implementation the consumer injects — a router that cannot prefetch ignores it.
|
|
6
|
+
*
|
|
7
|
+
* - `"viewport"`: prefetch once the link scrolls into the viewport.
|
|
8
|
+
* - `"hover"`: prefetch only once the pointer or focus reaches the link. Reserved for link-dense
|
|
9
|
+
* surfaces (archives, tag listings) where prefetching everything visible is disproportionate to
|
|
10
|
+
* the odds any one link gets clicked.
|
|
11
|
+
* - `"never"`: no prefetching at all.
|
|
12
|
+
*/
|
|
13
|
+
type PrefetchStrategy = "viewport" | "hover" | "never";
|
|
14
|
+
interface LinkComponentProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href"> {
|
|
15
|
+
href: string;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
prefetch?: PrefetchStrategy;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* What the design system needs from a link renderer. Consumers inject a router-aware implementation
|
|
21
|
+
* (`next/link`, a framework `<Link>`, and so on); without one, links fall back to {@link AnchorLink}.
|
|
22
|
+
*/
|
|
23
|
+
type LinkComponent = FC<LinkComponentProps>;
|
|
24
|
+
/**
|
|
25
|
+
* The framework-free default: a real `<a>`, which navigates correctly everywhere but without
|
|
26
|
+
* client-side routing. `prefetch` is destructured away rather than spread, since it is not a DOM
|
|
27
|
+
* attribute and React would warn about it.
|
|
28
|
+
*/
|
|
29
|
+
declare const AnchorLink: LinkComponent;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { AnchorLink, LinkComponent, LinkComponentProps, PrefetchStrategy };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
//#region src/atoms/links/anchor-link/anchor-link.tsx
|
|
3
|
+
/**
|
|
4
|
+
* The framework-free default: a real `<a>`, which navigates correctly everywhere but without
|
|
5
|
+
* client-side routing. `prefetch` is destructured away rather than spread, since it is not a DOM
|
|
6
|
+
* attribute and React would warn about it.
|
|
7
|
+
*/
|
|
8
|
+
const AnchorLink = ({ href, children, prefetch: _prefetch, ...rest }) => /* @__PURE__ */ jsx("a", {
|
|
9
|
+
href,
|
|
10
|
+
...rest,
|
|
11
|
+
children
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { AnchorLink };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC, ReactNode } from "react";
|
|
2
|
+
//#region src/atoms/links/external-link/external-link.d.ts
|
|
3
|
+
type ExternalLinkProps = {
|
|
4
|
+
href: string;
|
|
5
|
+
target?: string;
|
|
6
|
+
rel?: string;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
};
|
|
11
|
+
declare const ExternalLink: FC<ExternalLinkProps>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ExternalLink };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/atoms/links/external-link/external-link.tsx
|
|
5
|
+
const ExternalLink = (t0) => {
|
|
6
|
+
const $ = c(7);
|
|
7
|
+
const { children, href, onClick, target, rel, className } = t0;
|
|
8
|
+
let t1;
|
|
9
|
+
if ($[0] !== children || $[1] !== className || $[2] !== href || $[3] !== onClick || $[4] !== rel || $[5] !== target) {
|
|
10
|
+
t1 = /* @__PURE__ */ jsx("a", {
|
|
11
|
+
href,
|
|
12
|
+
onClick,
|
|
13
|
+
className,
|
|
14
|
+
target,
|
|
15
|
+
rel,
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
$[0] = children;
|
|
19
|
+
$[1] = className;
|
|
20
|
+
$[2] = href;
|
|
21
|
+
$[3] = onClick;
|
|
22
|
+
$[4] = rel;
|
|
23
|
+
$[5] = target;
|
|
24
|
+
$[6] = t1;
|
|
25
|
+
} else t1 = $[6];
|
|
26
|
+
return t1;
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { ExternalLink };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LinkComponent, PrefetchStrategy } from "../anchor-link/anchor-link.mjs";
|
|
2
|
+
import "../anchor-link/index.mjs";
|
|
3
|
+
import { FC, ReactNode } from "react";
|
|
4
|
+
//#region src/atoms/links/internal-link/internal-link.d.ts
|
|
5
|
+
interface InternalLinkProps {
|
|
6
|
+
to: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
prefetch?: PrefetchStrategy;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
linkComponent?: LinkComponent;
|
|
12
|
+
}
|
|
13
|
+
declare const InternalLink: FC<InternalLinkProps>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { InternalLink, InternalLinkProps };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AnchorLink } from "../anchor-link/anchor-link.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/atoms/links/internal-link/internal-link.tsx
|
|
4
|
+
const InternalLink = ({ children, className, to, onClick, prefetch = "viewport", linkComponent: Link = AnchorLink }) => /* @__PURE__ */ jsx(Link, {
|
|
5
|
+
className,
|
|
6
|
+
href: to,
|
|
7
|
+
prefetch,
|
|
8
|
+
onClick,
|
|
9
|
+
children
|
|
10
|
+
});
|
|
11
|
+
//#endregion
|
|
12
|
+
export { InternalLink };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { MotionDiv } from "../../animation/motion-div/motion-div.mjs";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/atoms/loader/loader/loader.tsx
|
|
6
|
+
const sizeClasses = {
|
|
7
|
+
sm: "h-1.5 w-1.5",
|
|
8
|
+
md: "h-2.5 w-2.5",
|
|
9
|
+
lg: "h-3.5 w-3.5"
|
|
10
|
+
};
|
|
11
|
+
const gapClasses = {
|
|
12
|
+
sm: "gap-1",
|
|
13
|
+
md: "gap-2",
|
|
14
|
+
lg: "gap-3"
|
|
15
|
+
};
|
|
16
|
+
const dots = [
|
|
17
|
+
0,
|
|
18
|
+
1,
|
|
19
|
+
2
|
|
20
|
+
];
|
|
21
|
+
const Loader = (t0) => {
|
|
22
|
+
const $ = c(6);
|
|
23
|
+
const { size: t1, className, label: t2 } = t0;
|
|
24
|
+
const size = t1 === void 0 ? "md" : t1;
|
|
25
|
+
const label = t2 === void 0 ? "Loading" : t2;
|
|
26
|
+
const t3 = `flex items-center ${gapClasses[size]}${className ? ` ${className}` : ""}`;
|
|
27
|
+
let t4;
|
|
28
|
+
if ($[0] !== size) {
|
|
29
|
+
t4 = dots.map((i) => /* @__PURE__ */ jsx(MotionDiv, {
|
|
30
|
+
animate: { y: [
|
|
31
|
+
0,
|
|
32
|
+
-8,
|
|
33
|
+
0
|
|
34
|
+
] },
|
|
35
|
+
transition: {
|
|
36
|
+
duration: .6,
|
|
37
|
+
repeat: Infinity,
|
|
38
|
+
delay: i * .15,
|
|
39
|
+
ease: "easeInOut"
|
|
40
|
+
},
|
|
41
|
+
className: `${sizeClasses[size]} rounded-full bg-accent`
|
|
42
|
+
}, i));
|
|
43
|
+
$[0] = size;
|
|
44
|
+
$[1] = t4;
|
|
45
|
+
} else t4 = $[1];
|
|
46
|
+
let t5;
|
|
47
|
+
if ($[2] !== label || $[3] !== t3 || $[4] !== t4) {
|
|
48
|
+
t5 = /* @__PURE__ */ jsx("div", {
|
|
49
|
+
role: "status",
|
|
50
|
+
"aria-label": label,
|
|
51
|
+
className: t3,
|
|
52
|
+
children: t4
|
|
53
|
+
});
|
|
54
|
+
$[2] = label;
|
|
55
|
+
$[3] = t3;
|
|
56
|
+
$[4] = t4;
|
|
57
|
+
$[5] = t5;
|
|
58
|
+
} else t5 = $[5];
|
|
59
|
+
return t5;
|
|
60
|
+
};
|
|
61
|
+
//#endregion
|
|
62
|
+
export { Loader };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC, RefObject } from "react";
|
|
2
|
+
//#region src/atoms/typography/input-field/input-field.d.ts
|
|
3
|
+
interface InputFieldProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
className?: string;
|
|
5
|
+
ref?: RefObject<HTMLInputElement | null>;
|
|
6
|
+
}
|
|
7
|
+
declare const InputField: FC<InputFieldProps>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { InputField };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
//#region src/atoms/typography/input-field/input-field.tsx
|
|
3
|
+
const InputField = ({ className, ...props }) => /* @__PURE__ */ jsx("input", {
|
|
4
|
+
className: `glow-container rounded-xl bg-none outline-none text-accent${className ? ` ${className}` : ""}`,
|
|
5
|
+
...props
|
|
6
|
+
});
|
|
7
|
+
//#endregion
|
|
8
|
+
export { InputField };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC, InputHTMLAttributes, ReactElement } from "react";
|
|
2
|
+
//#region src/atoms/typography/label/label.d.ts
|
|
3
|
+
interface LabelProps extends Omit<InputHTMLAttributes<HTMLLabelElement>, "className"> {
|
|
4
|
+
value: string;
|
|
5
|
+
icon?: ReactElement;
|
|
6
|
+
}
|
|
7
|
+
declare const Label: FC<LabelProps>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Label, LabelProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/atoms/typography/label/label.tsx
|
|
3
|
+
const Label = ({ value, icon, ...labelProps }) => {
|
|
4
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
5
|
+
htmlFor: labelProps.id,
|
|
6
|
+
className: "text-matrix-green mb-2 flex items-center gap-2 font-medium",
|
|
7
|
+
children: [icon, value]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Label };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import remarkEmoji from "remark-emoji";
|
|
2
|
+
import remarkGfm from "remark-gfm";
|
|
3
|
+
import remarkMath from "remark-math";
|
|
4
|
+
//#region src/atoms/typography/markdown/markdown-plugins.ts
|
|
5
|
+
/**
|
|
6
|
+
* Shared by the renderer and by the block splitter in use-markdown-store: the splitter must see the
|
|
7
|
+
* same block-level constructs the renderer does, or it cuts a block in half (display math, tables)
|
|
8
|
+
* and the renderer then never matches it.
|
|
9
|
+
*/
|
|
10
|
+
const markdownRemarkPlugins = [
|
|
11
|
+
remarkGfm,
|
|
12
|
+
remarkMath,
|
|
13
|
+
remarkEmoji
|
|
14
|
+
];
|
|
15
|
+
//#endregion
|
|
16
|
+
export { markdownRemarkPlugins };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { markdownRemarkPlugins } from "./markdown-plugins.mjs";
|
|
2
|
+
import { useMarkdownStore } from "./use-markdown-store.mjs";
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import ReactMarkdown from "react-markdown";
|
|
6
|
+
import rehypeHighlight from "rehype-highlight";
|
|
7
|
+
import rehypeKatex from "rehype-katex";
|
|
8
|
+
//#region src/atoms/typography/markdown/markdown.tsx
|
|
9
|
+
const MarkdownBlock = memo(({ content }) => /* @__PURE__ */ jsx(ReactMarkdown, {
|
|
10
|
+
remarkPlugins: markdownRemarkPlugins,
|
|
11
|
+
rehypePlugins: [rehypeHighlight, rehypeKatex],
|
|
12
|
+
children: content
|
|
13
|
+
}), (prevProps, nextProps) => prevProps.content === nextProps.content);
|
|
14
|
+
MarkdownBlock.displayName = "MarkdownBlock";
|
|
15
|
+
const MarkdownRenderer = ({ content, id }) => {
|
|
16
|
+
const { state } = useMarkdownStore(content);
|
|
17
|
+
const { blocks } = state;
|
|
18
|
+
return blocks.map((block, index) => /* @__PURE__ */ jsx(MarkdownBlock, { content: block }, `${id}-block_${index}`));
|
|
19
|
+
};
|
|
20
|
+
const Markdown = memo(MarkdownRenderer);
|
|
21
|
+
Markdown.displayName = "Markdown";
|
|
22
|
+
//#endregion
|
|
23
|
+
export { Markdown };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { markdownRemarkPlugins } from "./markdown-plugins.mjs";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import remarkParse from "remark-parse";
|
|
4
|
+
import { unified } from "unified";
|
|
5
|
+
//#region src/atoms/typography/markdown/use-markdown-store.ts
|
|
6
|
+
const parser = unified().use(remarkParse).use(markdownRemarkPlugins);
|
|
7
|
+
/**
|
|
8
|
+
* Splits content into top-level blocks so each memoises independently while a response streams.
|
|
9
|
+
* If any node lacks source offsets the whole content is returned as one block: that loses the
|
|
10
|
+
* memoisation granularity, but never drops content.
|
|
11
|
+
*/
|
|
12
|
+
const topLevelBlocks = (content) => {
|
|
13
|
+
const blocks = [];
|
|
14
|
+
for (const { position } of parser.parse(content).children) {
|
|
15
|
+
if (position?.start.offset === void 0 || position.end.offset === void 0) return [content];
|
|
16
|
+
blocks.push(content.slice(position.start.offset, position.end.offset));
|
|
17
|
+
}
|
|
18
|
+
return blocks;
|
|
19
|
+
};
|
|
20
|
+
const useMarkdownStore = (content) => {
|
|
21
|
+
return { state: { blocks: useMemo(() => topLevelBlocks(content), [content]) } };
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { useMarkdownStore };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from "react";
|
|
2
|
+
//#region src/atoms/typography/terminal-blocks/terminal-blocks.d.ts
|
|
3
|
+
type TerminalLineSize = "sm" | "md" | "lg";
|
|
4
|
+
declare const TerminalLine: FC<PropsWithChildren<{
|
|
5
|
+
size?: TerminalLineSize;
|
|
6
|
+
}>>;
|
|
7
|
+
declare const TerminalQuoteLine: FC<PropsWithChildren>;
|
|
8
|
+
declare const Cursor: FC<PropsWithChildren>;
|
|
9
|
+
declare const ErrorText: FC<PropsWithChildren>;
|
|
10
|
+
declare const SuccessText: FC<PropsWithChildren>;
|
|
11
|
+
declare const QuoteText: FC<PropsWithChildren>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Cursor, ErrorText, QuoteText, SuccessText, TerminalLine, TerminalLineSize, TerminalQuoteLine };
|