@heyramzi/ui 0.0.0-stage → 6.0.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/COMPONENTS.md +141 -0
- package/LICENSE +21 -0
- package/README.md +125 -2
- package/package.json +209 -3
- package/scripts/lib/sync-core.mjs +113 -0
- package/scripts/relative-imports.mjs +39 -0
- package/scripts/sf-symbol.mjs +93 -0
- package/scripts/sync-shadcn.mjs +341 -0
- package/scripts/sync-transitions.mjs +146 -0
- package/scripts/validate-apple-symbol-exports.mjs +45 -0
- package/src/ai/composer/Composer.css +108 -0
- package/src/ai/composer/Composer.svelte +111 -0
- package/src/ai/composer/index.ts +10 -0
- package/src/ai/confirmation/Confirmation.svelte +54 -0
- package/src/ai/confirmation/ConfirmationAccepted.svelte +23 -0
- package/src/ai/confirmation/ConfirmationAction.svelte +53 -0
- package/src/ai/confirmation/ConfirmationActions.svelte +24 -0
- package/src/ai/confirmation/ConfirmationFailed.svelte +23 -0
- package/src/ai/confirmation/ConfirmationRejected.svelte +23 -0
- package/src/ai/confirmation/ConfirmationRequest.svelte +25 -0
- package/src/ai/confirmation/ConfirmationTitle.svelte +25 -0
- package/src/ai/confirmation/confirmation-context.svelte.ts +22 -0
- package/src/ai/confirmation/index.ts +50 -0
- package/src/ai/conversation/Conversation.svelte +28 -0
- package/src/ai/conversation/ConversationContent.svelte +35 -0
- package/src/ai/conversation/ConversationEmptyState.svelte +46 -0
- package/src/ai/conversation/ConversationScrollButton.svelte +51 -0
- package/src/ai/conversation/index.ts +33 -0
- package/src/ai/conversation/stick-to-bottom-context.svelte.ts +131 -0
- package/src/ai/index.ts +119 -0
- package/src/ai/loading-state/PixelLoader.svelte +138 -0
- package/src/ai/loading-state/index.ts +5 -0
- package/src/ai/prompt-input/PromptInput.svelte +38 -0
- package/src/ai/prompt-input/PromptInputBody.svelte +19 -0
- package/src/ai/prompt-input/PromptInputSubmit.svelte +73 -0
- package/src/ai/prompt-input/PromptInputTextarea.svelte +74 -0
- package/src/ai/prompt-input/PromptInputToolbar.svelte +19 -0
- package/src/ai/prompt-input/index.ts +34 -0
- package/src/ai/reasoning/Reasoning.svelte +47 -0
- package/src/ai/reasoning/ReasoningContent.svelte +27 -0
- package/src/ai/reasoning/ReasoningTrigger.svelte +48 -0
- package/src/ai/reasoning/index.ts +22 -0
- package/src/ai/reasoning/reasoning-context.svelte.ts +20 -0
- package/src/ai/response/Response.css +32 -0
- package/src/ai/response/Response.svelte +130 -0
- package/src/ai/response/index.ts +5 -0
- package/src/ai/suggestion/Suggestion.svelte +43 -0
- package/src/ai/suggestion/Suggestions.svelte +25 -0
- package/src/ai/suggestion/index.ts +14 -0
- package/src/ai/thinking-dots/ThinkingDots.svelte +42 -0
- package/src/ai/thinking-dots/index.ts +5 -0
- package/src/ai/typing-dots/TypingDots.css +39 -0
- package/src/ai/typing-dots/TypingDots.svelte +27 -0
- package/src/ai/typing-dots/index.ts +10 -0
- package/src/ai/voice-waveform/VoiceWaveform.css +40 -0
- package/src/ai/voice-waveform/VoiceWaveform.svelte +46 -0
- package/src/ai/voice-waveform/index.ts +5 -0
- package/src/animations/README.md +84 -0
- package/src/animations/accordion.css +58 -0
- package/src/animations/avatar-group-hover.css +47 -0
- package/src/animations/card-tilt.css +74 -0
- package/src/animations/digit-pop-in.css +78 -0
- package/src/animations/dropdown.css +121 -0
- package/src/animations/icon-swap.css +43 -0
- package/src/animations/index.css +34 -0
- package/src/animations/input-clear-dissolve.css +86 -0
- package/src/animations/input-shake.css +114 -0
- package/src/animations/learn-more-hover.css +48 -0
- package/src/animations/like-button.css +93 -0
- package/src/animations/modal.css +75 -0
- package/src/animations/notification-badge.css +81 -0
- package/src/animations/page-side-by-side.css +63 -0
- package/src/animations/panel.css +86 -0
- package/src/animations/plus-menu-morph.css +97 -0
- package/src/animations/reasoning-stream.css +49 -0
- package/src/animations/resize.css +20 -0
- package/src/animations/shimmer-text.css +72 -0
- package/src/animations/skeleton-reveal.css +97 -0
- package/src/animations/spinning-counter.css +52 -0
- package/src/animations/streaming-text.css +31 -0
- package/src/animations/success-check.css +120 -0
- package/src/animations/tabs-sliding.css +83 -0
- package/src/animations/text-swap.css +40 -0
- package/src/animations/text-swap.ts +40 -0
- package/src/animations/texts-reveal.css +70 -0
- package/src/animations/thinking-states.css +65 -0
- package/src/animations/tooltip.css +72 -0
- package/src/animations/upstream-coverage.test.ts +65 -0
- package/src/animations/view-transition-reveal.ts +74 -0
- package/src/charts/animated-value.css +7 -0
- package/src/charts/animated-value.svelte +110 -0
- package/src/charts/area-chart.css +29 -0
- package/src/charts/area-chart.svelte +195 -0
- package/src/charts/bar-chart.css +119 -0
- package/src/charts/bar-chart.svelte +269 -0
- package/src/charts/charts.css +201 -0
- package/src/charts/crosshair.svelte +35 -0
- package/src/charts/donut-chart.css +56 -0
- package/src/charts/donut-chart.svelte +158 -0
- package/src/charts/edge-fade.svelte +43 -0
- package/src/charts/edge-fade.ts +16 -0
- package/src/charts/figure.css +100 -0
- package/src/charts/figure.svelte +122 -0
- package/src/charts/gauge-chart.css +94 -0
- package/src/charts/gauge-chart.svelte +303 -0
- package/src/charts/hover-band.test.ts +30 -0
- package/src/charts/hover-band.ts +21 -0
- package/src/charts/hover-focus.svelte +85 -0
- package/src/charts/index.ts +30 -0
- package/src/charts/legend.css +131 -0
- package/src/charts/legend.svelte +112 -0
- package/src/charts/line-chart.css +26 -0
- package/src/charts/line-chart.svelte +256 -0
- package/src/charts/motion.ts +19 -0
- package/src/charts/number-chart.css +168 -0
- package/src/charts/number-chart.svelte +177 -0
- package/src/charts/primitives/chart-container.svelte +57 -0
- package/src/charts/primitives/chart-style.svelte +36 -0
- package/src/charts/primitives/chart-tooltip.svelte +161 -0
- package/src/charts/primitives/chart-utils.ts +54 -0
- package/src/charts/primitives/index.ts +11 -0
- package/src/charts/reveal.svelte +61 -0
- package/src/charts/ring-chart.css +96 -0
- package/src/charts/ring-chart.svelte +158 -0
- package/src/charts/sparkline.css +45 -0
- package/src/charts/sparkline.svelte +140 -0
- package/src/charts/stat-card.css +103 -0
- package/src/charts/stat-card.svelte +267 -0
- package/src/charts/time-series-chart.css +28 -0
- package/src/charts/time-series-chart.svelte +179 -0
- package/src/charts/trend-pill.css +38 -0
- package/src/charts/trend-pill.svelte +48 -0
- package/src/design/index.css +270 -0
- package/src/design/polish.css +159 -0
- package/src/effects/animated-beam/AnimatedBeam.svelte +132 -0
- package/src/effects/animated-beam/diagrams/BeamSvg.svelte +91 -0
- package/src/effects/animated-beam/index.ts +2 -0
- package/src/effects/animated-beam/path-calculator.svelte.ts +70 -0
- package/src/effects/animated-beam/types.ts +23 -0
- package/src/effects/border-beam/BorderBeam.svelte +223 -0
- package/src/effects/border-beam/css.test.ts +46 -0
- package/src/effects/border-beam/css.ts +574 -0
- package/src/effects/border-beam/presets.ts +699 -0
- package/src/effects/border-beam/register-properties.test.ts +74 -0
- package/src/effects/border-beam/register-properties.ts +73 -0
- package/src/effects/border-beam/types.ts +38 -0
- package/src/effects/image-comparison/ImageComparison.css +66 -0
- package/src/effects/image-comparison/ImageComparison.svelte +92 -0
- package/src/effects/image-reveal/ImageReveal.css +10 -0
- package/src/effects/image-reveal/ImageReveal.svelte +357 -0
- package/src/effects/image-reveal/index.ts +2 -0
- package/src/effects/image-reveal/types.ts +35 -0
- package/src/effects/magnetic/magnetic.ts +81 -0
- package/src/effects/marquee/Marquee.css +52 -0
- package/src/effects/marquee/Marquee.svelte +96 -0
- package/src/effects/progressive-blur/ProgressiveBlur.css +9 -0
- package/src/effects/progressive-blur/ProgressiveBlur.svelte +63 -0
- package/src/effects/reveal/AnimatedGroup.svelte +101 -0
- package/src/effects/reveal/InView.svelte +77 -0
- package/src/effects/reveal/TextEffect.svelte +142 -0
- package/src/effects/reveal/index.ts +10 -0
- package/src/effects/reveal/observe.ts +33 -0
- package/src/effects/reveal/reveal.css +141 -0
- package/src/effects/reveal/types.ts +25 -0
- package/src/effects/shader-gradient/ShaderGradient.svelte +227 -0
- package/src/effects/shader-gradient/color.ts +44 -0
- package/src/effects/shader-gradient/index.ts +5 -0
- package/src/effects/shader-gradient/renderer.ts +456 -0
- package/src/effects/shader-gradient/shaders.ts +324 -0
- package/src/effects/shader-gradient/types.ts +68 -0
- package/src/effects/spotlight/Spotlight.css +14 -0
- package/src/effects/spotlight/Spotlight.svelte +61 -0
- package/src/effects/theme-toggle/ThemeToggle.css +21 -0
- package/src/effects/theme-toggle/ThemeToggle.svelte +101 -0
- package/src/icons/TradeIcon.svelte +16 -0
- package/src/icons/apple-symbol-exports.ts +135 -0
- package/src/icons/sf-symbols.ts +527 -0
- package/src/icons/trades.ts +89 -0
- package/src/index.ts +49 -0
- package/src/lib/arrive.ts +26 -0
- package/src/lib/hooks/is-mobile.svelte.ts +11 -0
- package/src/lib/icon-types.ts +17 -0
- package/src/lib/layout.ts +8 -0
- package/src/lib/panel.ts +15 -0
- package/src/lib/theme-transition.ts +51 -0
- package/src/lib/utils.ts +45 -0
- package/src/shadcn/accordion/accordion-content.svelte +22 -0
- package/src/shadcn/accordion/accordion-item.svelte +17 -0
- package/src/shadcn/accordion/accordion-trigger.svelte +35 -0
- package/src/shadcn/accordion/accordion.svelte +19 -0
- package/src/shadcn/accordion/index.ts +16 -0
- package/src/shadcn/alert/alert-description.svelte +23 -0
- package/src/shadcn/alert/alert-title.svelte +20 -0
- package/src/shadcn/alert/alert.svelte +44 -0
- package/src/shadcn/alert/index.ts +14 -0
- package/src/shadcn/alert-dialog/alert-dialog-action.svelte +18 -0
- package/src/shadcn/alert-dialog/alert-dialog-cancel.svelte +18 -0
- package/src/shadcn/alert-dialog/alert-dialog-content.svelte +29 -0
- package/src/shadcn/alert-dialog/alert-dialog-description.svelte +17 -0
- package/src/shadcn/alert-dialog/alert-dialog-footer.svelte +20 -0
- package/src/shadcn/alert-dialog/alert-dialog-header.svelte +20 -0
- package/src/shadcn/alert-dialog/alert-dialog-overlay.svelte +17 -0
- package/src/shadcn/alert-dialog/alert-dialog-portal.svelte +7 -0
- package/src/shadcn/alert-dialog/alert-dialog-title.svelte +17 -0
- package/src/shadcn/alert-dialog/alert-dialog-trigger.svelte +7 -0
- package/src/shadcn/alert-dialog/alert-dialog.svelte +7 -0
- package/src/shadcn/alert-dialog/index.ts +37 -0
- package/src/shadcn/attachment/attachment-action.svelte +23 -0
- package/src/shadcn/attachment/attachment-actions.svelte +23 -0
- package/src/shadcn/attachment/attachment-content.svelte +23 -0
- package/src/shadcn/attachment/attachment-description.svelte +23 -0
- package/src/shadcn/attachment/attachment-group.svelte +23 -0
- package/src/shadcn/attachment/attachment-media.svelte +44 -0
- package/src/shadcn/attachment/attachment-title.svelte +23 -0
- package/src/shadcn/attachment/attachment-trigger.svelte +29 -0
- package/src/shadcn/attachment/attachment.svelte +55 -0
- package/src/shadcn/attachment/index.ts +40 -0
- package/src/shadcn/avatar/avatar-badge.svelte +26 -0
- package/src/shadcn/avatar/avatar-fallback.svelte +20 -0
- package/src/shadcn/avatar/avatar-group-count.svelte +23 -0
- package/src/shadcn/avatar/avatar-group.svelte +23 -0
- package/src/shadcn/avatar/avatar-image.svelte +17 -0
- package/src/shadcn/avatar/avatar.svelte +26 -0
- package/src/shadcn/avatar/index.ts +22 -0
- package/src/shadcn/badge/badge.svelte +53 -0
- package/src/shadcn/badge/index.ts +2 -0
- package/src/shadcn/breadcrumb/breadcrumb-ellipsis.svelte +23 -0
- package/src/shadcn/breadcrumb/breadcrumb-item.svelte +20 -0
- package/src/shadcn/breadcrumb/breadcrumb-link.svelte +31 -0
- package/src/shadcn/breadcrumb/breadcrumb-list.svelte +23 -0
- package/src/shadcn/breadcrumb/breadcrumb-page.svelte +23 -0
- package/src/shadcn/breadcrumb/breadcrumb-separator.svelte +27 -0
- package/src/shadcn/breadcrumb/breadcrumb.svelte +21 -0
- package/src/shadcn/breadcrumb/index.ts +25 -0
- package/src/shadcn/bubble/bubble-content.svelte +31 -0
- package/src/shadcn/bubble/bubble-group.svelte +20 -0
- package/src/shadcn/bubble/bubble-reactions.svelte +52 -0
- package/src/shadcn/bubble/bubble.svelte +58 -0
- package/src/shadcn/bubble/index.ts +25 -0
- package/src/shadcn/button/button.svelte +121 -0
- package/src/shadcn/button/index.ts +17 -0
- package/src/shadcn/calendar/calendar-caption.svelte +76 -0
- package/src/shadcn/calendar/calendar-cell.svelte +19 -0
- package/src/shadcn/calendar/calendar-day.svelte +35 -0
- package/src/shadcn/calendar/calendar-grid-body.svelte +12 -0
- package/src/shadcn/calendar/calendar-grid-head.svelte +12 -0
- package/src/shadcn/calendar/calendar-grid-row.svelte +12 -0
- package/src/shadcn/calendar/calendar-grid.svelte +16 -0
- package/src/shadcn/calendar/calendar-head-cell.svelte +19 -0
- package/src/shadcn/calendar/calendar-header.svelte +19 -0
- package/src/shadcn/calendar/calendar-heading.svelte +16 -0
- package/src/shadcn/calendar/calendar-month-select.svelte +44 -0
- package/src/shadcn/calendar/calendar-month.svelte +15 -0
- package/src/shadcn/calendar/calendar-months.svelte +19 -0
- package/src/shadcn/calendar/calendar-nav.svelte +19 -0
- package/src/shadcn/calendar/calendar-next-button.svelte +31 -0
- package/src/shadcn/calendar/calendar-prev-button.svelte +31 -0
- package/src/shadcn/calendar/calendar-year-select.svelte +43 -0
- package/src/shadcn/calendar/calendar.svelte +118 -0
- package/src/shadcn/calendar/index.ts +40 -0
- package/src/shadcn/card/card-action.svelte +23 -0
- package/src/shadcn/card/card-content.svelte +20 -0
- package/src/shadcn/card/card-description.svelte +20 -0
- package/src/shadcn/card/card-footer.svelte +23 -0
- package/src/shadcn/card/card-header.svelte +23 -0
- package/src/shadcn/card/card-title.svelte +29 -0
- package/src/shadcn/card/card.svelte +25 -0
- package/src/shadcn/card/index.ts +25 -0
- package/src/shadcn/checkbox/checkbox.svelte +38 -0
- package/src/shadcn/checkbox/index.ts +6 -0
- package/src/shadcn/collapsible/collapsible-content.svelte +7 -0
- package/src/shadcn/collapsible/collapsible-trigger.svelte +7 -0
- package/src/shadcn/collapsible/collapsible.svelte +11 -0
- package/src/shadcn/collapsible/index.ts +13 -0
- package/src/shadcn/command/command-dialog.svelte +66 -0
- package/src/shadcn/command/command-empty.svelte +17 -0
- package/src/shadcn/command/command-group.svelte +40 -0
- package/src/shadcn/command/command-input.svelte +64 -0
- package/src/shadcn/command/command-item.svelte +37 -0
- package/src/shadcn/command/command-link-item.svelte +20 -0
- package/src/shadcn/command/command-list.svelte +20 -0
- package/src/shadcn/command/command-loading.svelte +7 -0
- package/src/shadcn/command/command-separator.svelte +17 -0
- package/src/shadcn/command/command-shortcut.svelte +23 -0
- package/src/shadcn/command/command.svelte +28 -0
- package/src/shadcn/command/index.ts +37 -0
- package/src/shadcn/context-menu/context-menu-checkbox-item.svelte +41 -0
- package/src/shadcn/context-menu/context-menu-content.svelte +28 -0
- package/src/shadcn/context-menu/context-menu-group-heading.svelte +21 -0
- package/src/shadcn/context-menu/context-menu-group.svelte +7 -0
- package/src/shadcn/context-menu/context-menu-item.svelte +27 -0
- package/src/shadcn/context-menu/context-menu-label.svelte +27 -0
- package/src/shadcn/context-menu/context-menu-portal.svelte +7 -0
- package/src/shadcn/context-menu/context-menu-radio-group.svelte +16 -0
- package/src/shadcn/context-menu/context-menu-radio-item.svelte +35 -0
- package/src/shadcn/context-menu/context-menu-separator.svelte +17 -0
- package/src/shadcn/context-menu/context-menu-shortcut.svelte +23 -0
- package/src/shadcn/context-menu/context-menu-sub-content.svelte +25 -0
- package/src/shadcn/context-menu/context-menu-sub-trigger.svelte +29 -0
- package/src/shadcn/context-menu/context-menu-sub.svelte +7 -0
- package/src/shadcn/context-menu/context-menu-trigger.svelte +17 -0
- package/src/shadcn/context-menu/context-menu.svelte +7 -0
- package/src/shadcn/context-menu/index.ts +52 -0
- package/src/shadcn/dialog/dialog-close.svelte +11 -0
- package/src/shadcn/dialog/dialog-content.svelte +57 -0
- package/src/shadcn/dialog/dialog-description.svelte +20 -0
- package/src/shadcn/dialog/dialog-footer.svelte +32 -0
- package/src/shadcn/dialog/dialog-header.svelte +20 -0
- package/src/shadcn/dialog/dialog-overlay.svelte +20 -0
- package/src/shadcn/dialog/dialog-portal.svelte +7 -0
- package/src/shadcn/dialog/dialog-title.svelte +17 -0
- package/src/shadcn/dialog/dialog-trigger.svelte +11 -0
- package/src/shadcn/dialog/dialog.svelte +7 -0
- package/src/shadcn/dialog/index.ts +34 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-checkbox-group.svelte +16 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-checkbox-item.svelte +43 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-content.svelte +31 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-group-heading.svelte +22 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-group.svelte +7 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-item.svelte +29 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-label.svelte +27 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-portal.svelte +7 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-radio-group.svelte +16 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-radio-item.svelte +34 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-separator.svelte +17 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-shortcut.svelte +23 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-sub-content.svelte +20 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-sub-trigger.svelte +29 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-sub.svelte +7 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-trigger.svelte +7 -0
- package/src/shadcn/dropdown-menu/dropdown-menu.svelte +7 -0
- package/src/shadcn/dropdown-menu/index.ts +56 -0
- package/src/shadcn/dropdown-menu/menu-item.ts +43 -0
- package/src/shadcn/empty/empty-content.svelte +23 -0
- package/src/shadcn/empty/empty-description.svelte +23 -0
- package/src/shadcn/empty/empty-header.svelte +20 -0
- package/src/shadcn/empty/empty-media.svelte +41 -0
- package/src/shadcn/empty/empty-title.svelte +20 -0
- package/src/shadcn/empty/empty.svelte +23 -0
- package/src/shadcn/empty/index.ts +22 -0
- package/src/shadcn/field/field-content.svelte +20 -0
- package/src/shadcn/field/field-description.svelte +25 -0
- package/src/shadcn/field/field-error.svelte +58 -0
- package/src/shadcn/field/field-group.svelte +23 -0
- package/src/shadcn/field/field-label.svelte +26 -0
- package/src/shadcn/field/field-legend.svelte +29 -0
- package/src/shadcn/field/field-separator.svelte +35 -0
- package/src/shadcn/field/field-set.svelte +24 -0
- package/src/shadcn/field/field-title.svelte +23 -0
- package/src/shadcn/field/field.svelte +53 -0
- package/src/shadcn/field/index.ts +33 -0
- package/src/shadcn/hooks/is-mobile.svelte.ts +9 -0
- package/src/shadcn/hover-card/hover-card-content.svelte +31 -0
- package/src/shadcn/hover-card/hover-card-portal.svelte +7 -0
- package/src/shadcn/hover-card/hover-card-trigger.svelte +7 -0
- package/src/shadcn/hover-card/hover-card.svelte +7 -0
- package/src/shadcn/hover-card/index.ts +15 -0
- package/src/shadcn/input/index.ts +9 -0
- package/src/shadcn/input/input.svelte +48 -0
- package/src/shadcn/input/secret-input.svelte +75 -0
- package/src/shadcn/input-otp/index.ts +15 -0
- package/src/shadcn/input-otp/input-otp-group.svelte +20 -0
- package/src/shadcn/input-otp/input-otp-separator.svelte +25 -0
- package/src/shadcn/input-otp/input-otp-slot.svelte +26 -0
- package/src/shadcn/input-otp/input-otp.svelte +22 -0
- package/src/shadcn/label/index.ts +7 -0
- package/src/shadcn/label/label.svelte +20 -0
- package/src/shadcn/marker/index.ts +15 -0
- package/src/shadcn/marker/marker-content.svelte +23 -0
- package/src/shadcn/marker/marker-icon.svelte +21 -0
- package/src/shadcn/marker/marker.svelte +52 -0
- package/src/shadcn/message/index.ts +22 -0
- package/src/shadcn/message/message-avatar.svelte +23 -0
- package/src/shadcn/message/message-content.svelte +23 -0
- package/src/shadcn/message/message-footer.svelte +23 -0
- package/src/shadcn/message/message-group.svelte +20 -0
- package/src/shadcn/message/message-header.svelte +23 -0
- package/src/shadcn/message/message.svelte +27 -0
- package/src/shadcn/popover/index.ts +28 -0
- package/src/shadcn/popover/popover-close.svelte +7 -0
- package/src/shadcn/popover/popover-content.svelte +38 -0
- package/src/shadcn/popover/popover-description.svelte +20 -0
- package/src/shadcn/popover/popover-header.svelte +20 -0
- package/src/shadcn/popover/popover-portal.svelte +7 -0
- package/src/shadcn/popover/popover-title.svelte +15 -0
- package/src/shadcn/popover/popover-trigger.svelte +17 -0
- package/src/shadcn/popover/popover.svelte +7 -0
- package/src/shadcn/progress/index.ts +7 -0
- package/src/shadcn/progress/progress.svelte +30 -0
- package/src/shadcn/radio-group/index.ts +10 -0
- package/src/shadcn/radio-group/radio-group-item.svelte +31 -0
- package/src/shadcn/radio-group/radio-group.svelte +19 -0
- package/src/shadcn/scroll-area/index.ts +10 -0
- package/src/shadcn/scroll-area/scroll-area-scrollbar.svelte +30 -0
- package/src/shadcn/scroll-area/scroll-area.svelte +43 -0
- package/src/shadcn/select/index.ts +37 -0
- package/src/shadcn/select/select-content.svelte +45 -0
- package/src/shadcn/select/select-group-heading.svelte +21 -0
- package/src/shadcn/select/select-group.svelte +17 -0
- package/src/shadcn/select/select-item.svelte +38 -0
- package/src/shadcn/select/select-label.svelte +20 -0
- package/src/shadcn/select/select-portal.svelte +7 -0
- package/src/shadcn/select/select-scroll-down-button.svelte +23 -0
- package/src/shadcn/select/select-scroll-up-button.svelte +23 -0
- package/src/shadcn/select/select-separator.svelte +18 -0
- package/src/shadcn/select/select-trigger.svelte +33 -0
- package/src/shadcn/select/select.svelte +11 -0
- package/src/shadcn/separator/index.ts +7 -0
- package/src/shadcn/separator/separator.svelte +23 -0
- package/src/shadcn/sheet/index.ts +34 -0
- package/src/shadcn/sheet/sheet-close.svelte +7 -0
- package/src/shadcn/sheet/sheet-content.svelte +72 -0
- package/src/shadcn/sheet/sheet-description.svelte +17 -0
- package/src/shadcn/sheet/sheet-footer.svelte +20 -0
- package/src/shadcn/sheet/sheet-header.svelte +20 -0
- package/src/shadcn/sheet/sheet-overlay.svelte +20 -0
- package/src/shadcn/sheet/sheet-portal.svelte +7 -0
- package/src/shadcn/sheet/sheet-title.svelte +17 -0
- package/src/shadcn/sheet/sheet-trigger.svelte +7 -0
- package/src/shadcn/sheet/sheet.svelte +7 -0
- package/src/shadcn/sidebar/constants.ts +6 -0
- package/src/shadcn/sidebar/context.svelte.ts +81 -0
- package/src/shadcn/sidebar/index.ts +75 -0
- package/src/shadcn/sidebar/sidebar-content.svelte +24 -0
- package/src/shadcn/sidebar/sidebar-footer.svelte +21 -0
- package/src/shadcn/sidebar/sidebar-group-action.svelte +33 -0
- package/src/shadcn/sidebar/sidebar-group-content.svelte +21 -0
- package/src/shadcn/sidebar/sidebar-group-label.svelte +33 -0
- package/src/shadcn/sidebar/sidebar-group.svelte +21 -0
- package/src/shadcn/sidebar/sidebar-header.svelte +21 -0
- package/src/shadcn/sidebar/sidebar-input.svelte +21 -0
- package/src/shadcn/sidebar/sidebar-inset.svelte +23 -0
- package/src/shadcn/sidebar/sidebar-menu-action.svelte +37 -0
- package/src/shadcn/sidebar/sidebar-menu-badge.svelte +24 -0
- package/src/shadcn/sidebar/sidebar-menu-button.svelte +103 -0
- package/src/shadcn/sidebar/sidebar-menu-item.svelte +21 -0
- package/src/shadcn/sidebar/sidebar-menu-skeleton.svelte +36 -0
- package/src/shadcn/sidebar/sidebar-menu-sub-button.svelte +39 -0
- package/src/shadcn/sidebar/sidebar-menu-sub-item.svelte +21 -0
- package/src/shadcn/sidebar/sidebar-menu-sub.svelte +24 -0
- package/src/shadcn/sidebar/sidebar-menu.svelte +21 -0
- package/src/shadcn/sidebar/sidebar-provider.svelte +62 -0
- package/src/shadcn/sidebar/sidebar-rail.svelte +36 -0
- package/src/shadcn/sidebar/sidebar-separator.svelte +19 -0
- package/src/shadcn/sidebar/sidebar-trigger.svelte +37 -0
- package/src/shadcn/sidebar/sidebar.svelte +109 -0
- package/src/shadcn/skeleton/index.ts +7 -0
- package/src/shadcn/skeleton/skeleton.svelte +17 -0
- package/src/shadcn/slider/index.ts +7 -0
- package/src/shadcn/slider/slider.svelte +52 -0
- package/src/shadcn/sonner/index.ts +1 -0
- package/src/shadcn/sonner/sonner.svelte +34 -0
- package/src/shadcn/spinner/index.ts +1 -0
- package/src/shadcn/spinner/spinner.svelte +26 -0
- package/src/shadcn/switch/index.ts +7 -0
- package/src/shadcn/switch/switch.svelte +31 -0
- package/src/shadcn/table/index.ts +28 -0
- package/src/shadcn/table/table-body.svelte +20 -0
- package/src/shadcn/table/table-caption.svelte +20 -0
- package/src/shadcn/table/table-cell.svelte +20 -0
- package/src/shadcn/table/table-footer.svelte +20 -0
- package/src/shadcn/table/table-head.svelte +23 -0
- package/src/shadcn/table/table-header.svelte +20 -0
- package/src/shadcn/table/table-row.svelte +23 -0
- package/src/shadcn/table/table.svelte +25 -0
- package/src/shadcn/tabs/index.ts +16 -0
- package/src/shadcn/tabs/tabs-content.svelte +17 -0
- package/src/shadcn/tabs/tabs-list.svelte +25 -0
- package/src/shadcn/tabs/tabs-trigger.svelte +20 -0
- package/src/shadcn/tabs/tabs.svelte +19 -0
- package/src/shadcn/textarea/index.ts +7 -0
- package/src/shadcn/textarea/textarea.svelte +23 -0
- package/src/shadcn/toggle/index.ts +13 -0
- package/src/shadcn/toggle/toggle.svelte +53 -0
- package/src/shadcn/toggle-group/index.ts +10 -0
- package/src/shadcn/toggle-group/toggle-group-item.svelte +35 -0
- package/src/shadcn/toggle-group/toggle-group.svelte +59 -0
- package/src/shadcn/tooltip/context.ts +16 -0
- package/src/shadcn/tooltip/index.ts +19 -0
- package/src/shadcn/tooltip/tooltip-content.svelte +38 -0
- package/src/shadcn/tooltip/tooltip-portal.svelte +7 -0
- package/src/shadcn/tooltip/tooltip-provider.svelte +16 -0
- package/src/shadcn/tooltip/tooltip-trigger.svelte +7 -0
- package/src/shadcn/tooltip/tooltip.svelte +19 -0
- package/src/shadcn/utilities.css +549 -0
- package/src/showcase/AiSection.svelte +157 -0
- package/src/showcase/AnimationsSection.svelte +1658 -0
- package/src/showcase/ChartsSection.svelte +458 -0
- package/src/showcase/EffectsSection.svelte +152 -0
- package/src/showcase/ShadcnSection.svelte +27 -0
- package/src/showcase/ShowcaseImport.svelte +126 -0
- package/src/showcase/ShowcaseList.svelte +132 -0
- package/src/showcase/ShowcaseNav.svelte +247 -0
- package/src/showcase/ShowcaseSection.svelte +112 -0
- package/src/showcase/ShowcaseShell.svelte +55 -0
- package/src/showcase/ShowcaseStage.svelte +342 -0
- package/src/showcase/ShowcaseVariant.svelte +109 -0
- package/src/showcase/assets/image-reveal/art-1.jpg +0 -0
- package/src/showcase/assets/image-reveal/art-2.jpg +0 -0
- package/src/showcase/assets/image-reveal/art-3.jpg +0 -0
- package/src/showcase/check.svg +1 -0
- package/src/showcase/chevron-arms.svg +2 -0
- package/src/showcase/chevron-down.svg +1 -0
- package/src/showcase/copy.svg +2 -0
- package/src/showcase/demos/ai/confirmation.svelte +59 -0
- package/src/showcase/demos/ai/conversation.svelte +59 -0
- package/src/showcase/demos/ai/loading-state.svelte +19 -0
- package/src/showcase/demos/ai/prompt-input.svelte +57 -0
- package/src/showcase/demos/ai/reasoning.svelte +19 -0
- package/src/showcase/demos/ai/thinking-dots.svelte +15 -0
- package/src/showcase/demos/ai/voice-waveform.svelte +24 -0
- package/src/showcase/demos/effects/animated-beam.svelte +50 -0
- package/src/showcase/demos/effects/animated-group.svelte +47 -0
- package/src/showcase/demos/effects/border-beam-default.svelte +20 -0
- package/src/showcase/demos/effects/border-beam-line.svelte +20 -0
- package/src/showcase/demos/effects/border-beam-mono.svelte +20 -0
- package/src/showcase/demos/effects/border-beam-sunset.svelte +20 -0
- package/src/showcase/demos/effects/image-comparison.svelte +25 -0
- package/src/showcase/demos/effects/image-reveal.svelte +49 -0
- package/src/showcase/demos/effects/in-view.svelte +41 -0
- package/src/showcase/demos/effects/integrations-hub.svelte +82 -0
- package/src/showcase/demos/effects/magnetic.svelte +31 -0
- package/src/showcase/demos/effects/marquee.svelte +33 -0
- package/src/showcase/demos/effects/progressive-blur.svelte +47 -0
- package/src/showcase/demos/effects/spotlight.svelte +40 -0
- package/src/showcase/demos/effects/text-effect.svelte +55 -0
- package/src/showcase/demos/shadcn/accordion.svelte +45 -0
- package/src/showcase/demos/shadcn/alert-dialog.svelte +23 -0
- package/src/showcase/demos/shadcn/alert.svelte +30 -0
- package/src/showcase/demos/shadcn/attachment.svelte +71 -0
- package/src/showcase/demos/shadcn/avatar.svelte +30 -0
- package/src/showcase/demos/shadcn/badge.svelte +26 -0
- package/src/showcase/demos/shadcn/breadcrumb.svelte +34 -0
- package/src/showcase/demos/shadcn/bubble.svelte +36 -0
- package/src/showcase/demos/shadcn/button.svelte +11 -0
- package/src/showcase/demos/shadcn/calendar.svelte +8 -0
- package/src/showcase/demos/shadcn/card.svelte +39 -0
- package/src/showcase/demos/shadcn/checkbox.svelte +39 -0
- package/src/showcase/demos/shadcn/collapsible.svelte +20 -0
- package/src/showcase/demos/shadcn/command.svelte +48 -0
- package/src/showcase/demos/shadcn/context-menu.svelte +54 -0
- package/src/showcase/demos/shadcn/demo-harness.svelte +12 -0
- package/src/showcase/demos/shadcn/demos.test.ts +20 -0
- package/src/showcase/demos/shadcn/dialog.svelte +38 -0
- package/src/showcase/demos/shadcn/dropdown-menu.svelte +59 -0
- package/src/showcase/demos/shadcn/empty.svelte +29 -0
- package/src/showcase/demos/shadcn/field.svelte +115 -0
- package/src/showcase/demos/shadcn/hover-card.svelte +32 -0
- package/src/showcase/demos/shadcn/index.ts +358 -0
- package/src/showcase/demos/shadcn/input-otp.svelte +19 -0
- package/src/showcase/demos/shadcn/input.svelte +5 -0
- package/src/showcase/demos/shadcn/label.svelte +11 -0
- package/src/showcase/demos/shadcn/marker.svelte +30 -0
- package/src/showcase/demos/shadcn/message.svelte +75 -0
- package/src/showcase/demos/shadcn/popover.svelte +36 -0
- package/src/showcase/demos/shadcn/progress.svelte +13 -0
- package/src/showcase/demos/shadcn/radio-group.svelte +19 -0
- package/src/showcase/demos/shadcn/scroll-area.svelte +18 -0
- package/src/showcase/demos/shadcn/select.svelte +29 -0
- package/src/showcase/demos/shadcn/separator.svelte +12 -0
- package/src/showcase/demos/shadcn/sheet.svelte +48 -0
- package/src/showcase/demos/shadcn/skeleton.svelte +11 -0
- package/src/showcase/demos/shadcn/slider.svelte +7 -0
- package/src/showcase/demos/shadcn/sonner.svelte +18 -0
- package/src/showcase/demos/shadcn/spinner.svelte +11 -0
- package/src/showcase/demos/shadcn/switch.svelte +9 -0
- package/src/showcase/demos/shadcn/table.svelte +76 -0
- package/src/showcase/demos/shadcn/tabs.svelte +62 -0
- package/src/showcase/demos/shadcn/textarea.svelte +5 -0
- package/src/showcase/demos/shadcn/toggle-group.svelte +18 -0
- package/src/showcase/demos/shadcn/toggle.svelte +14 -0
- package/src/showcase/demos/shadcn/tooltip.svelte +13 -0
- package/src/showcase/heart.svg +1 -0
- package/src/showcase/index.ts +38 -0
- package/src/showcase/kit.test.ts +72 -0
- package/src/showcase/kit.ts +17 -0
- package/src/showcase/plus.svg +1 -0
- package/src/showcase/showcase-shell.css +91 -0
- package/src/showcase/stacked-section.css +15 -0
- package/src/showcase/success-check.svg +1 -0
- package/src/showcase/types.ts +29 -0
- package/src/svg-raw.d.ts +7 -0
- package/src/test-setup.ts +34 -0
- package/src/tokens.css +993 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export interface ShowcaseImportProps {
|
|
3
|
+
/** The line a consumer pastes, e.g. `@heyramzi/ui/shadcn/button`. */
|
|
4
|
+
path: string;
|
|
5
|
+
/** Accessible name suffix, so two rows on a page do not both read "Copy import". */
|
|
6
|
+
label?: string;
|
|
7
|
+
class?: string;
|
|
8
|
+
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { cn } from "@heyramzi/utils";
|
|
13
|
+
import checkIcon from "./check.svg?raw";
|
|
14
|
+
import copyIcon from "./copy.svg?raw";
|
|
15
|
+
|
|
16
|
+
let { path, label, class: className }: ShowcaseImportProps = $props();
|
|
17
|
+
|
|
18
|
+
let copied = $state(false);
|
|
19
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
20
|
+
|
|
21
|
+
async function copy() {
|
|
22
|
+
try {
|
|
23
|
+
await navigator.clipboard.writeText(path);
|
|
24
|
+
} catch {
|
|
25
|
+
// A denied clipboard is not worth an error state on a dev-only surface;
|
|
26
|
+
// the path is on screen and selectable either way.
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
copied = true;
|
|
30
|
+
clearTimeout(timer);
|
|
31
|
+
timer = setTimeout(() => (copied = false), 1600);
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<button
|
|
36
|
+
type="button"
|
|
37
|
+
class={cn("sc-import", className)}
|
|
38
|
+
data-copied={copied ? "true" : undefined}
|
|
39
|
+
onclick={copy}
|
|
40
|
+
aria-label="Copy import for {label ?? path}"
|
|
41
|
+
>
|
|
42
|
+
<code>{path}</code>
|
|
43
|
+
<span class="sc-import-state" aria-hidden="true">
|
|
44
|
+
{#if copied}
|
|
45
|
+
{@html checkIcon}
|
|
46
|
+
{:else}
|
|
47
|
+
{@html copyIcon}
|
|
48
|
+
{/if}
|
|
49
|
+
</span>
|
|
50
|
+
</button>
|
|
51
|
+
|
|
52
|
+
<style>
|
|
53
|
+
.sc-import {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
gap: 0.75rem;
|
|
58
|
+
width: 100%;
|
|
59
|
+
min-width: 0;
|
|
60
|
+
padding: 0.375rem 0.5rem 0.375rem 0.625rem;
|
|
61
|
+
border: 1px solid transparent;
|
|
62
|
+
border-radius: 0.5rem;
|
|
63
|
+
background: transparent;
|
|
64
|
+
color: var(--color-muted-foreground, var(--muted-foreground));
|
|
65
|
+
cursor: pointer;
|
|
66
|
+
text-align: start;
|
|
67
|
+
transition:
|
|
68
|
+
color 160ms ease,
|
|
69
|
+
background-color 160ms ease,
|
|
70
|
+
border-color 160ms ease;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.sc-import:hover {
|
|
74
|
+
color: var(--color-foreground, var(--foreground));
|
|
75
|
+
background: color-mix(in oklab, var(--color-muted, var(--muted)) 70%, transparent);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.sc-import:focus-visible {
|
|
79
|
+
outline: 2px solid var(--color-ring, var(--ring));
|
|
80
|
+
outline-offset: 2px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.sc-import[data-copied] {
|
|
84
|
+
color: var(--color-foreground, var(--foreground));
|
|
85
|
+
border-color: color-mix(in oklab, var(--color-ring, var(--ring)) 45%, transparent);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.sc-import code {
|
|
89
|
+
font-family: var(--font-mono, ui-monospace, "SF Mono", "JetBrains Mono", monospace);
|
|
90
|
+
font-size: 0.6875rem;
|
|
91
|
+
letter-spacing: -0.01em;
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
text-overflow: ellipsis;
|
|
94
|
+
white-space: nowrap;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.sc-import-state {
|
|
98
|
+
display: grid;
|
|
99
|
+
place-items: center;
|
|
100
|
+
flex-shrink: 0;
|
|
101
|
+
width: 0.875rem;
|
|
102
|
+
height: 0.875rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.sc-import-state :global(svg) {
|
|
106
|
+
width: 100%;
|
|
107
|
+
height: 100%;
|
|
108
|
+
animation: sc-icon-in 200ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@keyframes sc-icon-in {
|
|
112
|
+
from {
|
|
113
|
+
opacity: 0;
|
|
114
|
+
transform: scale(0.6);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@media (prefers-reduced-motion: reduce) {
|
|
119
|
+
.sc-import {
|
|
120
|
+
transition: none;
|
|
121
|
+
}
|
|
122
|
+
.sc-import-state :global(svg) {
|
|
123
|
+
animation: none;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
</style>
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export interface ShowcaseListItem {
|
|
3
|
+
/** Component name, e.g. "Context Menu". */
|
|
4
|
+
title: string;
|
|
5
|
+
/** Import line for the copy control. */
|
|
6
|
+
importPath: string;
|
|
7
|
+
/** Right-hand detail: a file count, a parts count, a source path. */
|
|
8
|
+
meta?: string;
|
|
9
|
+
/** Provenance beside the name, e.g. "shadcn" on a primitive the kit took as is. */
|
|
10
|
+
tag?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ShowcaseListProps {
|
|
14
|
+
items: ShowcaseListItem[];
|
|
15
|
+
/** Heading above the rows. Omit inside a section that is list-only. */
|
|
16
|
+
caption?: string;
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
import ShowcaseImport from "./ShowcaseImport.svelte";
|
|
22
|
+
import "./showcase-shell.css";
|
|
23
|
+
|
|
24
|
+
let { items, caption }: ShowcaseListProps = $props();
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<!-- WHY a row and not a stage: a component with no demo has one useful fact, its
|
|
28
|
+
import line. Given a card each, the undemoed majority buries the demos. -->
|
|
29
|
+
<div class="sc-list">
|
|
30
|
+
{#if caption}
|
|
31
|
+
<p class="sc-list-caption">{caption}</p>
|
|
32
|
+
{/if}
|
|
33
|
+
<ul>
|
|
34
|
+
{#each items as item (item.importPath)}
|
|
35
|
+
<li>
|
|
36
|
+
<span class="sc-list-title">
|
|
37
|
+
{item.title}
|
|
38
|
+
{#if item.tag}
|
|
39
|
+
<span class="sc-tag">{item.tag}</span>
|
|
40
|
+
{/if}
|
|
41
|
+
</span>
|
|
42
|
+
<ShowcaseImport path={item.importPath} label={item.title} class="sc-list-import" />
|
|
43
|
+
{#if item.meta}
|
|
44
|
+
<span class="sc-list-meta">{item.meta}</span>
|
|
45
|
+
{/if}
|
|
46
|
+
</li>
|
|
47
|
+
{/each}
|
|
48
|
+
</ul>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<style>
|
|
52
|
+
.sc-list {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
gap: 0.625rem;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.sc-list-caption {
|
|
59
|
+
margin: 0;
|
|
60
|
+
font-size: 0.6875rem;
|
|
61
|
+
font-weight: 500;
|
|
62
|
+
letter-spacing: 0.06em;
|
|
63
|
+
text-transform: uppercase;
|
|
64
|
+
color: var(--color-muted-foreground, var(--muted-foreground));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.sc-list ul {
|
|
68
|
+
list-style: none;
|
|
69
|
+
margin: 0;
|
|
70
|
+
padding: 0;
|
|
71
|
+
border: 1px solid var(--color-border, var(--border));
|
|
72
|
+
border-radius: calc(var(--radius, 0.625rem) + 0.375rem);
|
|
73
|
+
background: var(--color-card, var(--card));
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.sc-list li {
|
|
78
|
+
position: relative;
|
|
79
|
+
display: grid;
|
|
80
|
+
grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr) auto;
|
|
81
|
+
align-items: center;
|
|
82
|
+
gap: 0.75rem;
|
|
83
|
+
padding: 0.1875rem 0.75rem 0.1875rem 1rem;
|
|
84
|
+
min-height: 2.5rem;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Inset to the title column, so a scan down the names is not cut by a full-bleed
|
|
88
|
+
rule on every row. */
|
|
89
|
+
.sc-list li + li::before {
|
|
90
|
+
content: "";
|
|
91
|
+
position: absolute;
|
|
92
|
+
inset-block-start: 0;
|
|
93
|
+
inset-inline: 1rem 0;
|
|
94
|
+
height: 1px;
|
|
95
|
+
background: var(--color-border, var(--border));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.sc-list-title {
|
|
99
|
+
font-size: 0.8125rem;
|
|
100
|
+
font-weight: 500;
|
|
101
|
+
color: var(--color-card-foreground, var(--color-foreground, var(--foreground)));
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
text-overflow: ellipsis;
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.sc-list-meta {
|
|
108
|
+
font-size: 0.6875rem;
|
|
109
|
+
font-variant-numeric: tabular-nums;
|
|
110
|
+
color: var(--color-muted-foreground, var(--muted-foreground));
|
|
111
|
+
white-space: nowrap;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@media (max-width: 40rem) {
|
|
115
|
+
.sc-list li {
|
|
116
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
117
|
+
grid-template-areas:
|
|
118
|
+
"title meta"
|
|
119
|
+
"import import";
|
|
120
|
+
padding-block: 0.5rem;
|
|
121
|
+
}
|
|
122
|
+
.sc-list-title {
|
|
123
|
+
grid-area: title;
|
|
124
|
+
}
|
|
125
|
+
.sc-list-meta {
|
|
126
|
+
grid-area: meta;
|
|
127
|
+
}
|
|
128
|
+
.sc-list :global(.sc-list-import) {
|
|
129
|
+
grid-area: import;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
</style>
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { ShowcaseSectionMeta } from "./types.js";
|
|
3
|
+
|
|
4
|
+
export interface ShowcaseNavProps {
|
|
5
|
+
sections: ShowcaseSectionMeta[];
|
|
6
|
+
}
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
import { onMount } from "svelte";
|
|
11
|
+
|
|
12
|
+
let { sections }: ShowcaseNavProps = $props();
|
|
13
|
+
|
|
14
|
+
let active = $state(sections[0]?.id ?? "");
|
|
15
|
+
// Nothing is written back until the reader's place has been restored, or the
|
|
16
|
+
// observer's first call would overwrite it with whatever the top of the page is.
|
|
17
|
+
let restored = $state(false);
|
|
18
|
+
|
|
19
|
+
const storeKey = () => `sc-rail-active:${location.pathname}`;
|
|
20
|
+
|
|
21
|
+
// Consecutive sections sharing a group are drawn under one heading.
|
|
22
|
+
|
|
23
|
+
// Grouping by run rather than by key means the page's own order is the rail's order, and a section can be moved without also moving it in a second list.
|
|
24
|
+
const runs = $derived(
|
|
25
|
+
sections.reduce<{ group?: string; items: ShowcaseSectionMeta[] }[]>((acc, section) => {
|
|
26
|
+
const last = acc.at(-1);
|
|
27
|
+
if (last && last.group === section.group) last.items.push(section);
|
|
28
|
+
else acc.push({ group: section.group, items: [section] });
|
|
29
|
+
return acc;
|
|
30
|
+
}, []),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
// The rail follows the reader rather than the last click: an anchor jump and a
|
|
34
|
+
// scroll both end in the same place, so only one source of truth is needed.
|
|
35
|
+
$effect(() => {
|
|
36
|
+
const targets = sections
|
|
37
|
+
.map((section) => document.getElementById(section.id))
|
|
38
|
+
.filter((element): element is HTMLElement => element !== null);
|
|
39
|
+
if (targets.length === 0) return;
|
|
40
|
+
|
|
41
|
+
const observer = new IntersectionObserver(
|
|
42
|
+
(entries) => {
|
|
43
|
+
const visible = entries
|
|
44
|
+
.filter((entry) => entry.isIntersecting)
|
|
45
|
+
.toSorted((a, b) => a.boundingClientRect.top - b.boundingClientRect.top);
|
|
46
|
+
if (visible[0]) active = visible[0].target.id;
|
|
47
|
+
},
|
|
48
|
+
{ rootMargin: "-12% 0px -75% 0px", threshold: 0 },
|
|
49
|
+
);
|
|
50
|
+
for (const target of targets) observer.observe(target);
|
|
51
|
+
return () => observer.disconnect();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// The band the observer watches sits near the top of the viewport, and the last section is often too short to reach it,
|
|
55
|
+
|
|
56
|
+
// so the rail stopped one entry early at the foot of the page. The bottom of the scroll names the last section.
|
|
57
|
+
$effect(() => {
|
|
58
|
+
const onScroll = () => {
|
|
59
|
+
const last = sections.at(-1)?.id;
|
|
60
|
+
if (last && window.innerHeight + window.scrollY >= document.body.scrollHeight - 2) {
|
|
61
|
+
active = last;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
window.addEventListener("scroll", onScroll, { passive: true });
|
|
65
|
+
return () => window.removeEventListener("scroll", onScroll);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// A reload put the reader back at the top.
|
|
69
|
+
|
|
70
|
+
// The browser does restore a scroll offset, but the charts, images and fonts on this page settle after it, so the offset it restores is no longer the section it
|
|
71
|
+
|
|
72
|
+
// was taken from. The section id survives instead: the hash when the reader followed one, the last section read otherwise.
|
|
73
|
+
onMount(() => {
|
|
74
|
+
let wanted = decodeURIComponent(location.hash.slice(1));
|
|
75
|
+
if (!wanted) {
|
|
76
|
+
try {
|
|
77
|
+
wanted = sessionStorage.getItem(storeKey()) ?? "";
|
|
78
|
+
} catch {
|
|
79
|
+
wanted = "";
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (!wanted || !sections.some((section) => section.id === wanted)) {
|
|
83
|
+
restored = true;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
active = wanted;
|
|
88
|
+
// Two frames: the first paints the sections, the second lets what is inside
|
|
89
|
+
// them take its height, so the anchor lands on the heading and not above it.
|
|
90
|
+
requestAnimationFrame(() =>
|
|
91
|
+
requestAnimationFrame(() => {
|
|
92
|
+
document.getElementById(wanted)?.scrollIntoView({ block: "start" });
|
|
93
|
+
restored = true;
|
|
94
|
+
}),
|
|
95
|
+
);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
$effect(() => {
|
|
99
|
+
if (!restored || !active) return;
|
|
100
|
+
try {
|
|
101
|
+
sessionStorage.setItem(storeKey(), active);
|
|
102
|
+
} catch {
|
|
103
|
+
// A private window refuses the write. The rail still follows the reader.
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
</script>
|
|
107
|
+
|
|
108
|
+
<nav aria-label="Component sections">
|
|
109
|
+
{#each runs as run, index (run.group ?? index)}
|
|
110
|
+
{#if run.group}
|
|
111
|
+
<p class="sc-rail-group">{run.group}</p>
|
|
112
|
+
{/if}
|
|
113
|
+
<ul>
|
|
114
|
+
{#each run.items as section (section.id)}
|
|
115
|
+
<li>
|
|
116
|
+
<a
|
|
117
|
+
href="#{section.id}"
|
|
118
|
+
data-active={active === section.id ? "true" : undefined}
|
|
119
|
+
aria-current={active === section.id ? "page" : undefined}
|
|
120
|
+
>
|
|
121
|
+
<span class="sc-rail-label">{section.label}</span>
|
|
122
|
+
<span class="sc-rail-count">{section.demos || section.listed}</span>
|
|
123
|
+
</a>
|
|
124
|
+
</li>
|
|
125
|
+
{/each}
|
|
126
|
+
</ul>
|
|
127
|
+
{/each}
|
|
128
|
+
</nav>
|
|
129
|
+
|
|
130
|
+
<style>
|
|
131
|
+
/*
|
|
132
|
+
* WHY a rail and not a row of pills: the row was one line of chips that ran to
|
|
133
|
+
*/
|
|
134
|
+
|
|
135
|
+
/*
|
|
136
|
+
* nine sections and wrapped, so the reader's place in a long page was a chip somewhere in a block of chips. A vertical list holds a stable order, has room
|
|
137
|
+
*/
|
|
138
|
+
|
|
139
|
+
/*
|
|
140
|
+
* for group headings, and leaves the whole content column to the components.
|
|
141
|
+
*/
|
|
142
|
+
nav {
|
|
143
|
+
position: sticky;
|
|
144
|
+
top: var(--showcase-nav-top, 0px);
|
|
145
|
+
display: flex;
|
|
146
|
+
flex-direction: column;
|
|
147
|
+
gap: 0.125rem;
|
|
148
|
+
max-height: calc(100dvh - var(--showcase-nav-top, 0px));
|
|
149
|
+
padding: 1.25rem 0.75rem 2rem 0.4375rem;
|
|
150
|
+
overflow-y: auto;
|
|
151
|
+
/* WHY only x: `contain` on y stopped this zero-overflow rail chaining the wheel to the page. */
|
|
152
|
+
overscroll-behavior-x: contain;
|
|
153
|
+
scrollbar-width: thin;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.sc-rail-group {
|
|
157
|
+
margin: 1.125rem 0 0.375rem 0.5rem;
|
|
158
|
+
font-size: 0.625rem;
|
|
159
|
+
font-weight: 600;
|
|
160
|
+
letter-spacing: 0.08em;
|
|
161
|
+
text-transform: uppercase;
|
|
162
|
+
color: var(--color-muted-foreground, var(--muted-foreground));
|
|
163
|
+
opacity: 0.75;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.sc-rail-group:first-child {
|
|
167
|
+
margin-top: 0;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
ul {
|
|
171
|
+
display: flex;
|
|
172
|
+
flex-direction: column;
|
|
173
|
+
gap: 0.0625rem;
|
|
174
|
+
margin: 0;
|
|
175
|
+
padding: 0;
|
|
176
|
+
list-style: none;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
a {
|
|
180
|
+
position: relative;
|
|
181
|
+
display: flex;
|
|
182
|
+
align-items: center;
|
|
183
|
+
justify-content: space-between;
|
|
184
|
+
gap: 0.5rem;
|
|
185
|
+
padding: 0.3125rem 0.5rem 0.3125rem 0.6875rem;
|
|
186
|
+
border-radius: var(--radius-lg, 8px);
|
|
187
|
+
font-size: 0.78125rem;
|
|
188
|
+
line-height: 1.35;
|
|
189
|
+
color: var(--color-muted-foreground, var(--muted-foreground));
|
|
190
|
+
text-decoration: none;
|
|
191
|
+
transition:
|
|
192
|
+
color var(--duration-quick, 150ms) var(--ease-smooth-out, ease),
|
|
193
|
+
background-color var(--duration-quick, 150ms) var(--ease-smooth-out, ease);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
a:hover {
|
|
197
|
+
color: var(--color-foreground, var(--foreground));
|
|
198
|
+
background: color-mix(in oklab, var(--color-muted, var(--muted)) 60%, transparent);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/*
|
|
202
|
+
* The active row is a filled slot with a bar in the gutter. The bar is what the
|
|
203
|
+
*/
|
|
204
|
+
|
|
205
|
+
/*
|
|
206
|
+
* eye finds when it comes back to the rail after reading. A fill alone is too
|
|
207
|
+
*/
|
|
208
|
+
|
|
209
|
+
/*
|
|
210
|
+
* quiet at this weight, and a full-strength pill is too loud for a list this long.
|
|
211
|
+
*/
|
|
212
|
+
a[data-active] {
|
|
213
|
+
color: var(--color-foreground, var(--foreground));
|
|
214
|
+
font-weight: 500;
|
|
215
|
+
background: color-mix(in oklab, var(--color-muted, var(--muted)) 90%, transparent);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
a[data-active]::before {
|
|
219
|
+
content: "";
|
|
220
|
+
position: absolute;
|
|
221
|
+
inset-block: 0.3125rem;
|
|
222
|
+
inset-inline-start: -0.375rem;
|
|
223
|
+
width: 2px;
|
|
224
|
+
border-radius: 999px;
|
|
225
|
+
background: var(--color-ring, var(--ring));
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.sc-rail-label {
|
|
229
|
+
overflow: hidden;
|
|
230
|
+
text-overflow: ellipsis;
|
|
231
|
+
white-space: nowrap;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.sc-rail-count {
|
|
235
|
+
flex-shrink: 0;
|
|
236
|
+
font-size: 0.625rem;
|
|
237
|
+
font-variant-numeric: tabular-nums;
|
|
238
|
+
color: var(--color-muted-foreground, var(--muted-foreground));
|
|
239
|
+
opacity: 0.7;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
@media (prefers-reduced-motion: reduce) {
|
|
243
|
+
a {
|
|
244
|
+
transition: none;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
</style>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
|
|
4
|
+
export interface ShowcaseSectionProps {
|
|
5
|
+
/** Anchor id. Must match the ShowcaseSectionMeta the nav rail was given. */
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
/** What the section is for, in the reader's terms, not a list of its members. */
|
|
9
|
+
lead?: string;
|
|
10
|
+
/** Live demos. Stacked one per row unless `bare` is set. */
|
|
11
|
+
children?: Snippet;
|
|
12
|
+
/** Skip the stack, for content that brings a layout of its own. */
|
|
13
|
+
bare?: boolean;
|
|
14
|
+
/** Everything in the section with no demo, drawn as rows under the stack. */
|
|
15
|
+
listed?: Snippet;
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<script lang="ts">
|
|
20
|
+
let { id, label, lead, children, listed, bare = false }: ShowcaseSectionProps = $props();
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<section {id}>
|
|
24
|
+
<div class="sc-section-head">
|
|
25
|
+
<h2>{label}</h2>
|
|
26
|
+
{#if lead}
|
|
27
|
+
<p>{lead}</p>
|
|
28
|
+
{/if}
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
{#if children}
|
|
32
|
+
{#if bare}
|
|
33
|
+
{@render children()}
|
|
34
|
+
{:else}
|
|
35
|
+
<div class="sc-stack">
|
|
36
|
+
{@render children()}
|
|
37
|
+
</div>
|
|
38
|
+
{/if}
|
|
39
|
+
{/if}
|
|
40
|
+
|
|
41
|
+
{#if listed}
|
|
42
|
+
<div class="sc-section-listed">
|
|
43
|
+
{@render listed()}
|
|
44
|
+
</div>
|
|
45
|
+
{/if}
|
|
46
|
+
</section>
|
|
47
|
+
|
|
48
|
+
<style>
|
|
49
|
+
section {
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
/* Clears the sticky controls row, whose height the page declares once. */
|
|
53
|
+
scroll-margin-top: calc(var(--showcase-nav-top, 0px) + 4.5rem);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
* WHY the heading sits on its own rule rather than on whitespace: the page is
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
/*
|
|
61
|
+
* one long column of stages now, and a gap alone did not read as a boundary once the stages themselves had air inside them.
|
|
62
|
+
*/
|
|
63
|
+
.sc-section-head {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
gap: 0.3125rem;
|
|
67
|
+
margin-top: 2.25rem;
|
|
68
|
+
padding: 2.25rem 0 1.25rem;
|
|
69
|
+
border-top: 1px solid var(--color-border, var(--border));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
section:first-child .sc-section-head {
|
|
73
|
+
margin-top: 0;
|
|
74
|
+
padding-top: 1.5rem;
|
|
75
|
+
border-top: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
h2 {
|
|
79
|
+
margin: 0;
|
|
80
|
+
font-size: 1.125rem;
|
|
81
|
+
font-weight: 600;
|
|
82
|
+
line-height: 1.2;
|
|
83
|
+
letter-spacing: -0.014em;
|
|
84
|
+
color: var(--color-foreground, var(--foreground));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
p {
|
|
88
|
+
margin: 0;
|
|
89
|
+
max-width: 62ch;
|
|
90
|
+
font-size: 0.8125rem;
|
|
91
|
+
line-height: 1.55;
|
|
92
|
+
color: var(--color-muted-foreground, var(--muted-foreground));
|
|
93
|
+
text-wrap: pretty;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/*
|
|
97
|
+
* One stage per row. A grid of narrow cards made every component the size of the smallest one on the page, which is the opposite of what a showcase is
|
|
98
|
+
*/
|
|
99
|
+
|
|
100
|
+
/*
|
|
101
|
+
* for: a table and a button both got 20rem, and only one of them survived it.
|
|
102
|
+
*/
|
|
103
|
+
.sc-stack {
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-direction: column;
|
|
106
|
+
gap: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.sc-section-listed {
|
|
110
|
+
padding-top: 1rem;
|
|
111
|
+
}
|
|
112
|
+
</style>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import type { ShowcaseSectionMeta } from "./types.js";
|
|
4
|
+
|
|
5
|
+
export interface ShowcaseShellProps {
|
|
6
|
+
/** Every section the rail lists, in the order the page renders them. */
|
|
7
|
+
sections: ShowcaseSectionMeta[];
|
|
8
|
+
/** Search box, filters, anything that acts on the whole page. Spans both columns. */
|
|
9
|
+
controls?: Snippet;
|
|
10
|
+
/** Sits at the top of the rail, above the index. A title, a count, a legend. */
|
|
11
|
+
railHead?: Snippet;
|
|
12
|
+
/** The sections themselves. */
|
|
13
|
+
children: Snippet;
|
|
14
|
+
/** Rendered instead of the rail and the sections, e.g. a search result list. */
|
|
15
|
+
override?: Snippet;
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<script lang="ts">
|
|
20
|
+
import ShowcaseNav from "./ShowcaseNav.svelte";
|
|
21
|
+
import "./showcase-shell.css";
|
|
22
|
+
|
|
23
|
+
let { sections, controls, railHead, children, override }: ShowcaseShellProps = $props();
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<div class="sc-shell">
|
|
27
|
+
{#if controls}
|
|
28
|
+
<div class="sc-shell-controls">
|
|
29
|
+
{@render controls()}
|
|
30
|
+
</div>
|
|
31
|
+
{/if}
|
|
32
|
+
|
|
33
|
+
{#if override}
|
|
34
|
+
<div class="sc-shell-override">
|
|
35
|
+
{@render override()}
|
|
36
|
+
</div>
|
|
37
|
+
{:else}
|
|
38
|
+
<div class="sc-shell-body">
|
|
39
|
+
<!-- A landmark of its own, because the index is a second way through the
|
|
40
|
+
page rather than part of the page's content. -->
|
|
41
|
+
<aside class="sc-shell-rail">
|
|
42
|
+
{#if railHead}
|
|
43
|
+
<div class="sc-shell-rail-head">
|
|
44
|
+
{@render railHead()}
|
|
45
|
+
</div>
|
|
46
|
+
{/if}
|
|
47
|
+
<ShowcaseNav {sections} />
|
|
48
|
+
</aside>
|
|
49
|
+
|
|
50
|
+
<div class="sc-shell-main">
|
|
51
|
+
{@render children()}
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
{/if}
|
|
55
|
+
</div>
|