@heyramzi/ui 0.0.0-stage → 1.53.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/COMPONENTS.md +133 -0
- package/README.md +136 -2
- package/package.json +217 -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 +354 -0
- package/scripts/sync-transitions.mjs +146 -0
- package/scripts/validate-apple-symbol-exports.mjs +45 -0
- package/src/agents/agent-avatar.svelte +592 -0
- package/src/agents/agent-cast.svelte +197 -0
- package/src/agents/demo.svelte +125 -0
- package/src/agents/helpers.ts +58 -0
- package/src/agents/index.ts +11 -0
- package/src/agents/page-state.ts +70 -0
- package/src/agents/types.ts +74 -0
- package/src/agents/vendor/LICENSE +21 -0
- package/src/agents/vendor/color.ts +155 -0
- package/src/agents/vendor/draw.ts +840 -0
- package/src/agents/vendor/engine.ts +845 -0
- package/src/agents/vendor/mesh.ts +838 -0
- package/src/agents/vendor/plastic.ts +4958 -0
- package/src/agents/vendor/presets.ts +103 -0
- package/src/agents/vendor/shapes.ts +41 -0
- package/src/agents/vendor/ticker.ts +67 -0
- package/src/agents/vendor/types.ts +261 -0
- package/src/agents/vendor/wear.ts +1699 -0
- package/src/ai/ai-button/AiButton.svelte +86 -0
- package/src/ai/ai-button/index.ts +4 -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/generation-progress/GenerationProgress.svelte +354 -0
- package/src/ai/generation-progress/index.ts +7 -0
- package/src/ai/index.ts +111 -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 +56 -0
- package/src/ai/prompt-input/PromptInputBody.svelte +19 -0
- package/src/ai/prompt-input/PromptInputSubmit.svelte +79 -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 +50 -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/ambient.d.ts +4 -0
- package/src/animations/README.md +84 -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/index.css +23 -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/page-side-by-side.css +63 -0
- package/src/animations/plus-menu-morph.css +97 -0
- package/src/animations/resize.css +20 -0
- package/src/animations/shimmer-text.css +72 -0
- package/src/animations/spinning-counter.css +52 -0
- package/src/animations/success-check.css +120 -0
- package/src/animations/text-swap.css +40 -0
- package/src/animations/text-swap.ts +40 -0
- package/src/animations/thinking-states.css +65 -0
- package/src/animations/upstream-coverage.test.ts +65 -0
- package/src/components/copy/clipboard.test.ts +206 -0
- package/src/components/copy/clipboard.ts +49 -0
- package/src/components/copy/copied.svelte.ts +39 -0
- package/src/components/copy/copy-button.svelte +175 -0
- package/src/components/copy/copy-button.test.ts +110 -0
- package/src/components/copy/index.ts +3 -0
- package/src/components/data-table/data-table.test.ts +134 -0
- package/src/components/data-table/data-table.ts +77 -0
- package/src/components/data-table/index.ts +20 -0
- package/src/components/data-table/infinite-scroll.svelte +69 -0
- package/src/components/data-table/pagination.svelte +62 -0
- package/src/components/data-table/row-arrow.svelte +28 -0
- package/src/components/data-table/row-context-menu.svelte +106 -0
- package/src/components/data-table/row-context-menu.test.ts +18 -0
- package/src/components/data-table/sortable-head.svelte +56 -0
- package/src/components/data-table/table-skeleton.svelte +83 -0
- package/src/components/hold-to-confirm/hold-to-confirm.svelte +232 -0
- package/src/components/hold-to-confirm/index.ts +1 -0
- package/src/components/icon/icon.svelte +23 -0
- package/src/components/icon/index.ts +1 -0
- package/src/components/language-flag/index.ts +1 -0
- package/src/components/language-flag/language-flag.svelte +60 -0
- package/src/components/list-page/detail-empty.svelte +50 -0
- package/src/components/list-page/detail-header.svelte +107 -0
- package/src/components/list-page/detail-panel.svelte +90 -0
- package/src/components/list-page/detail-row.svelte +36 -0
- package/src/components/list-page/detail-stack.svelte +33 -0
- package/src/components/list-page/empty-state.svelte +91 -0
- package/src/components/list-page/filter-item.svelte +49 -0
- package/src/components/list-page/filter-popover.svelte +88 -0
- package/src/components/list-page/filter-section.ts +12 -0
- package/src/components/list-page/grouped-list.svelte +116 -0
- package/src/components/list-page/index.ts +28 -0
- package/src/components/list-page/list-page-shell.svelte +195 -0
- package/src/components/list-page/list-table.ts +19 -0
- package/src/components/list-page/master-detail.svelte +206 -0
- package/src/components/list-page/master-detail.test.ts +37 -0
- package/src/components/list-page/notice-bar.svelte +68 -0
- package/src/components/list-page/prev-next.svelte +104 -0
- package/src/components/list-page/queue-rail.ts +25 -0
- package/src/components/list-page/rail-body.svelte +29 -0
- package/src/components/list-page/rail-empty.svelte +51 -0
- package/src/components/list-page/rail-head.svelte +49 -0
- package/src/components/list-page/rail-row.svelte +163 -0
- package/src/components/list-page/section-host.ts +24 -0
- package/src/components/list-page/section-label.svelte +39 -0
- package/src/components/list-page/step.test.ts +21 -0
- package/src/components/list-page/step.ts +10 -0
- package/src/components/list-page/toolbar-search.svelte +63 -0
- package/src/components/list-page/toolbar-trigger.ts +23 -0
- package/src/components/list-page/types.ts +1 -0
- package/src/components/locale-switch/index.ts +1 -0
- package/src/components/locale-switch/locale-switch.svelte +59 -0
- package/src/components/mark/index.ts +1 -0
- package/src/components/mark/mark.svelte +70 -0
- package/src/components/open-in/index.ts +6 -0
- package/src/components/open-in/open-in.svelte +106 -0
- package/src/components/picker/index.ts +4 -0
- package/src/components/picker/mark-picker.svelte +84 -0
- package/src/components/picker/picker.svelte +143 -0
- package/src/components/picker/trigger.ts +42 -0
- package/src/components/picker/types.ts +26 -0
- package/src/components/segmented/animated-tabs.svelte +175 -0
- package/src/components/segmented/collapse.test.ts +49 -0
- package/src/components/segmented/collapse.ts +39 -0
- package/src/components/segmented/index.ts +41 -0
- package/src/components/segmented/section-runs.svelte +79 -0
- package/src/components/segmented/segment.svelte +106 -0
- package/src/components/segmented/segmented-filter.svelte +125 -0
- package/src/components/segmented/segmented-nav.svelte +82 -0
- package/src/components/segmented/segmented-overflow.svelte +85 -0
- package/src/components/segmented/segmented-track.svelte +181 -0
- package/src/components/segmented/segmented.test.ts +20 -0
- package/src/components/segmented/segmented.ts +80 -0
- package/src/components/star-rating-input/index.ts +9 -0
- package/src/components/star-rating-input/star-rating-input.svelte +256 -0
- package/src/components/svg/index.ts +1 -0
- package/src/components/svg/svg.svelte +9 -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 +100 -0
- package/src/effects/image-comparison/ImageComparison.svelte +209 -0
- package/src/effects/image-comparison/compare.test.ts +17 -0
- package/src/effects/image-comparison/compare.ts +5 -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/interactive-hover-button/InteractiveHoverButton.svelte +338 -0
- package/src/effects/magic-card/MagicCard.css +47 -0
- package/src/effects/magic-card/MagicCard.svelte +57 -0
- package/src/effects/magnetic/magnetic.ts +81 -0
- package/src/effects/marquee/Marquee.css +78 -0
- package/src/effects/marquee/Marquee.svelte +160 -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 +11 -0
- package/src/effects/reveal/observe.test.ts +60 -0
- package/src/effects/reveal/observe.ts +65 -0
- package/src/effects/reveal/reveal.css +141 -0
- package/src/effects/reveal/types.ts +32 -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 +214 -0
- package/src/effects/theme-toggle/ThemeToggle.svelte +126 -0
- package/src/gallery.test.ts +52 -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 +53 -0
- package/src/lib/arrive.ts +26 -0
- package/src/lib/icon-types.ts +17 -0
- package/src/lib/layout.ts +8 -0
- package/src/lib/panel.ts +21 -0
- package/src/lib/sliding-pill.ts +68 -0
- package/src/lib/theme-transition.ts +79 -0
- package/src/lib/tone.ts +48 -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 +44 -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 +46 -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 +54 -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 +124 -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/code-block/code-block-actions.svelte +23 -0
- package/src/shadcn/code-block/code-block-content.svelte +55 -0
- package/src/shadcn/code-block/code-block-copy-button.svelte +10 -0
- package/src/shadcn/code-block/code-block-footer.svelte +20 -0
- package/src/shadcn/code-block/code-block-header.svelte +23 -0
- package/src/shadcn/code-block/code-block-line.svelte +71 -0
- package/src/shadcn/code-block/code-block-title.svelte +23 -0
- package/src/shadcn/code-block/code-block.svelte +47 -0
- package/src/shadcn/code-block/index.ts +42 -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 +40 -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 +36 -0
- package/src/shadcn/field/simple-field.svelte +71 -0
- package/src/shadcn/field/simple-field.test.ts +47 -0
- package/src/shadcn/hooks/highlighter.ts +132 -0
- package/src/shadcn/hooks/is-mobile.svelte.ts +9 -0
- package/src/shadcn/hooks/use-highlighted-code.svelte.ts +98 -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/kbd/index.ts +10 -0
- package/src/shadcn/kbd/kbd-group.svelte +20 -0
- package/src/shadcn/kbd/kbd.svelte +23 -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/message-scroller/index.ts +28 -0
- package/src/shadcn/message-scroller/message-scroller-button.svelte +52 -0
- package/src/shadcn/message-scroller/message-scroller-content.svelte +17 -0
- package/src/shadcn/message-scroller/message-scroller-item.svelte +22 -0
- package/src/shadcn/message-scroller/message-scroller-provider.svelte +7 -0
- package/src/shadcn/message-scroller/message-scroller-viewport.svelte +20 -0
- package/src/shadcn/message-scroller/message-scroller.svelte +20 -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 +32 -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 +73 -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.css +48 -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 +31 -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 +36 -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 +66 -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/trace/index.ts +29 -0
- package/src/shadcn/trace/trace-collapsible-content.svelte +29 -0
- package/src/shadcn/trace/trace-collapsible-trigger.svelte +29 -0
- package/src/shadcn/trace/trace-collapsible.svelte +20 -0
- package/src/shadcn/trace/trace-description.svelte +20 -0
- package/src/shadcn/trace/trace-icon.svelte +24 -0
- package/src/shadcn/trace/trace-line.svelte +31 -0
- package/src/shadcn/trace/trace-title.svelte +20 -0
- package/src/shadcn/trace/trace.svelte +23 -0
- package/src/shadcn/utilities.css +549 -0
- package/src/test-setup.ts +34 -0
- package/src/tokens.css +993 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// =========================
|
|
3
|
+
// IMPORTS
|
|
4
|
+
// =========================
|
|
5
|
+
import { cn } from "@heyramzi/utils";
|
|
6
|
+
import * as Empty from "../../shadcn/empty/index.js";
|
|
7
|
+
import type { PhosphorIcon, IconWeight } from "../../lib/icon-types.js";
|
|
8
|
+
|
|
9
|
+
// =========================
|
|
10
|
+
// TYPES
|
|
11
|
+
// =========================
|
|
12
|
+
interface Props {
|
|
13
|
+
// Not `EmptyState`, which has a 48px icon and an action. This says a filter
|
|
14
|
+
// came back empty, in one sentence that fits a 280px rail.
|
|
15
|
+
icon?: PhosphorIcon;
|
|
16
|
+
iconWeight?: IconWeight;
|
|
17
|
+
iconClass?: string;
|
|
18
|
+
title: string;
|
|
19
|
+
hint?: string;
|
|
20
|
+
class?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// =========================
|
|
24
|
+
// PROPS
|
|
25
|
+
// =========================
|
|
26
|
+
let {
|
|
27
|
+
icon: Icon,
|
|
28
|
+
iconWeight,
|
|
29
|
+
iconClass,
|
|
30
|
+
title,
|
|
31
|
+
hint,
|
|
32
|
+
class: className,
|
|
33
|
+
}: Props = $props();
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<!-- =========================== -->
|
|
37
|
+
<!-- MARKUP -->
|
|
38
|
+
<!-- =========================== -->
|
|
39
|
+
<Empty.Root class={cn("h-full gap-2 px-6 py-12", className)}>
|
|
40
|
+
{#if Icon}
|
|
41
|
+
<Icon
|
|
42
|
+
weight={iconWeight}
|
|
43
|
+
class={cn("size-6", iconClass ?? "text-muted-foreground/40")}
|
|
44
|
+
aria-hidden="true"
|
|
45
|
+
/>
|
|
46
|
+
{/if}
|
|
47
|
+
<Empty.Title>{title}</Empty.Title>
|
|
48
|
+
{#if hint}
|
|
49
|
+
<Empty.Description class="max-w-56 text-xs leading-relaxed">{hint}</Empty.Description>
|
|
50
|
+
{/if}
|
|
51
|
+
</Empty.Root>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// =========================
|
|
3
|
+
// IMPORTS
|
|
4
|
+
// =========================
|
|
5
|
+
import type { Snippet } from "svelte";
|
|
6
|
+
import SectionLabel from "./section-label.svelte";
|
|
7
|
+
import { cn } from "@heyramzi/utils";
|
|
8
|
+
|
|
9
|
+
// =========================
|
|
10
|
+
// TYPES
|
|
11
|
+
// =========================
|
|
12
|
+
type Props = {
|
|
13
|
+
// The fixed top of a queue rail: label, filter, search. A fixed height, so
|
|
14
|
+
// rows start on the same line on every queue page.
|
|
15
|
+
label?: string;
|
|
16
|
+
// A low-emphasis control beside the label (compose, refresh).
|
|
17
|
+
action?: Snippet;
|
|
18
|
+
// The filter, the search, whatever narrows the list. Optional: a rail of four
|
|
19
|
+
// records has nothing to narrow, and an empty strip under the label is chrome.
|
|
20
|
+
children?: Snippet;
|
|
21
|
+
class?: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// =========================
|
|
25
|
+
// PROPS
|
|
26
|
+
// =========================
|
|
27
|
+
let { label, action, children, class: className }: Props = $props();
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<!-- =========================== -->
|
|
31
|
+
<!-- MARKUP -->
|
|
32
|
+
<!-- =========================== -->
|
|
33
|
+
<div class={cn("shrink-0 space-y-2 border-b border-border px-3 py-2.5", className)}>
|
|
34
|
+
{#if label || action}
|
|
35
|
+
<div class="flex min-h-7 items-center justify-between gap-2 pl-1">
|
|
36
|
+
{#if label}
|
|
37
|
+
<SectionLabel>{label}</SectionLabel>
|
|
38
|
+
{:else}
|
|
39
|
+
<span></span>
|
|
40
|
+
{/if}
|
|
41
|
+
{#if action}
|
|
42
|
+
{@render action()}
|
|
43
|
+
{/if}
|
|
44
|
+
</div>
|
|
45
|
+
{/if}
|
|
46
|
+
{#if children}
|
|
47
|
+
{@render children()}
|
|
48
|
+
{/if}
|
|
49
|
+
</div>
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// =========================
|
|
3
|
+
// IMPORTS
|
|
4
|
+
// =========================
|
|
5
|
+
import type { Snippet } from "svelte";
|
|
6
|
+
import { getContext } from "svelte";
|
|
7
|
+
import { cn } from "@heyramzi/utils";
|
|
8
|
+
import { MASTER_DETAIL_PANE, type MasterDetailPane } from "./queue-rail.js";
|
|
9
|
+
|
|
10
|
+
// =========================
|
|
11
|
+
// TYPES
|
|
12
|
+
// =========================
|
|
13
|
+
type Props = {
|
|
14
|
+
// One row shape for every queue rail, in a fixed order: identity, preview,
|
|
15
|
+
// facts. Three pages used to draw three different rows.
|
|
16
|
+
title: string;
|
|
17
|
+
selected?: boolean;
|
|
18
|
+
onclick: () => void;
|
|
19
|
+
// A thumbnail or avatar ahead of the title.
|
|
20
|
+
leading?: Snippet;
|
|
21
|
+
// The record's state, at the end of the preview line. Never beside the title,
|
|
22
|
+
// where it competes with the name.
|
|
23
|
+
trailing?: Snippet;
|
|
24
|
+
// One line of the record's own words, under the title.
|
|
25
|
+
preview?: string | null;
|
|
26
|
+
// Dot-separated facts under the preview. Falsy entries drop out.
|
|
27
|
+
meta?: Array<string | null | undefined | false>;
|
|
28
|
+
// Which fact gives up its width first. The others hold their full text, so
|
|
29
|
+
// a date or a count never truncates to nonsense.
|
|
30
|
+
metaTruncate?: "first" | "last";
|
|
31
|
+
// Icons that qualify the facts (a waiting reply, a removed comment).
|
|
32
|
+
metaTrail?: Snippet;
|
|
33
|
+
// Controls that appear on hover, over the row's top-right corner.
|
|
34
|
+
actions?: Snippet;
|
|
35
|
+
// Long records (thread titles) need two lines to be recognisable.
|
|
36
|
+
titleLines?: 1 | 2;
|
|
37
|
+
class?: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// =========================
|
|
41
|
+
// PROPS
|
|
42
|
+
// =========================
|
|
43
|
+
let {
|
|
44
|
+
title,
|
|
45
|
+
selected = false,
|
|
46
|
+
onclick,
|
|
47
|
+
leading,
|
|
48
|
+
trailing,
|
|
49
|
+
preview,
|
|
50
|
+
meta,
|
|
51
|
+
metaTruncate = "first",
|
|
52
|
+
metaTrail,
|
|
53
|
+
actions,
|
|
54
|
+
titleLines = 1,
|
|
55
|
+
class: className,
|
|
56
|
+
}: Props = $props();
|
|
57
|
+
|
|
58
|
+
// =========================
|
|
59
|
+
// DERIVED
|
|
60
|
+
// =========================
|
|
61
|
+
let facts = $derived((meta ?? []).filter((item): item is string => Boolean(item)));
|
|
62
|
+
|
|
63
|
+
// =========================
|
|
64
|
+
// FUNCTIONS
|
|
65
|
+
// =========================
|
|
66
|
+
// Picking a row moves a phone from list to record. `undefined` outside a
|
|
67
|
+
// `MasterDetail`, where a rail is just a list.
|
|
68
|
+
let row = $state<HTMLDivElement>();
|
|
69
|
+
|
|
70
|
+
// A row picked from a link, a shortcut or the next arrow can sit below the fold.
|
|
71
|
+
$effect(() => {
|
|
72
|
+
if (selected) row?.scrollIntoView({ block: "nearest" });
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
let pane = getContext<MasterDetailPane | undefined>(MASTER_DETAIL_PANE);
|
|
76
|
+
|
|
77
|
+
function select() {
|
|
78
|
+
onclick();
|
|
79
|
+
pane?.open();
|
|
80
|
+
}
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<!-- =========================== -->
|
|
84
|
+
<!-- MARKUP -->
|
|
85
|
+
<!-- =========================== -->
|
|
86
|
+
<!-- The hairline belongs to the row, so grouped and flat rails draw it the same.
|
|
87
|
+
`first:border-t-0` keeps each group's top row clean under its header. -->
|
|
88
|
+
<div
|
|
89
|
+
bind:this={row}
|
|
90
|
+
class={cn(
|
|
91
|
+
// `group/row` too: `CopyHandoff` waits for `group-hover/row`, and a bare
|
|
92
|
+
// `group` left it invisible on every rail.
|
|
93
|
+
"group group/row relative border-t border-border first:border-t-0",
|
|
94
|
+
selected ? "bg-accent" : "hover:bg-muted/50",
|
|
95
|
+
className,
|
|
96
|
+
)}
|
|
97
|
+
>
|
|
98
|
+
<button
|
|
99
|
+
type="button"
|
|
100
|
+
class={cn(
|
|
101
|
+
"t-press flex w-full items-start gap-3 px-4 py-3 text-left any-pointer-coarse:py-3.5",
|
|
102
|
+
"focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",
|
|
103
|
+
// WHY: the hover actions sit over this corner, so the text stops short
|
|
104
|
+
// of them rather than sliding underneath when a title is long.
|
|
105
|
+
actions && "pr-24",
|
|
106
|
+
)}
|
|
107
|
+
onclick={select}
|
|
108
|
+
aria-current={selected ? "page" : undefined}
|
|
109
|
+
>
|
|
110
|
+
{#if leading}
|
|
111
|
+
<span class="shrink-0">{@render leading()}</span>
|
|
112
|
+
{/if}
|
|
113
|
+
<!-- The title owns its column. A chip beside it took a third of the width
|
|
114
|
+
and clamped two-line titles. -->
|
|
115
|
+
<span class="flex min-w-0 flex-1 flex-col gap-1">
|
|
116
|
+
<span
|
|
117
|
+
class={cn(
|
|
118
|
+
"text-sm font-medium leading-snug",
|
|
119
|
+
titleLines === 2 ? "line-clamp-2" : "truncate",
|
|
120
|
+
selected && "text-accent-foreground",
|
|
121
|
+
)}
|
|
122
|
+
>
|
|
123
|
+
{title}
|
|
124
|
+
</span>
|
|
125
|
+
<!-- The state rides the preview, not the facts. Facts are `shrink-0`, so
|
|
126
|
+
at 280px the chip got pushed off the row. Prose can give up width. -->
|
|
127
|
+
{#if preview || trailing}
|
|
128
|
+
<span class="flex min-w-0 items-center text-xs text-muted-foreground">
|
|
129
|
+
{#if preview}
|
|
130
|
+
<span class="truncate">{preview}</span>
|
|
131
|
+
{/if}
|
|
132
|
+
{#if trailing}
|
|
133
|
+
<span class="ml-auto flex shrink-0 items-center gap-1.5 pl-2">{@render trailing()}</span>
|
|
134
|
+
{/if}
|
|
135
|
+
</span>
|
|
136
|
+
{/if}
|
|
137
|
+
{#if facts.length > 0 || metaTrail}
|
|
138
|
+
<span class="flex min-w-0 items-center text-xs text-muted-foreground">
|
|
139
|
+
{#each facts as fact, i (i)}
|
|
140
|
+
{#if i > 0}
|
|
141
|
+
<span aria-hidden="true" class="mx-1.5 shrink-0 opacity-40">·</span>
|
|
142
|
+
{/if}
|
|
143
|
+
{@const flexible =
|
|
144
|
+
facts.length > 1 && i === (metaTruncate === "last" ? facts.length - 1 : 0)}
|
|
145
|
+
<span class={flexible ? "truncate" : "shrink-0"}>{fact}</span>
|
|
146
|
+
{/each}
|
|
147
|
+
{#if metaTrail}
|
|
148
|
+
<span class="ml-1.5 flex shrink-0 items-center gap-1">{@render metaTrail()}</span>
|
|
149
|
+
{/if}
|
|
150
|
+
</span>
|
|
151
|
+
{/if}
|
|
152
|
+
</span>
|
|
153
|
+
</button>
|
|
154
|
+
{#if actions}
|
|
155
|
+
<!-- WHY visible on a coarse pointer: there is no hover on a touchscreen, so
|
|
156
|
+
the row's actions would be unreachable there. -->
|
|
157
|
+
<div
|
|
158
|
+
class="absolute right-2 top-2 hidden items-center gap-1 group-hover:flex group-focus-within:flex any-pointer-coarse:flex"
|
|
159
|
+
>
|
|
160
|
+
{@render actions()}
|
|
161
|
+
</div>
|
|
162
|
+
{/if}
|
|
163
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { getContext, setContext } from "svelte";
|
|
2
|
+
import type { SectionStrip } from "../segmented/section-runs.svelte";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* What an app shell gives a list page so the page's toolbar can draw the
|
|
6
|
+
* section strip. `strip` must be reactive (a `$state` field), and `claim` tells
|
|
7
|
+
* the shell a toolbar is drawing it and returns the release.
|
|
8
|
+
*/
|
|
9
|
+
export interface SectionHost {
|
|
10
|
+
readonly strip: SectionStrip | null;
|
|
11
|
+
claim(): () => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// WHY context: the shell decides the strip once and ninety pages draw it, so a prop on every page would be ninety edits.
|
|
15
|
+
const KEY = Symbol("list-page.section-host");
|
|
16
|
+
|
|
17
|
+
/** Call once in the layout that owns the section strip. */
|
|
18
|
+
export function setSectionHost(host: SectionHost): void {
|
|
19
|
+
setContext(KEY, host);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function getSectionHost(): SectionHost | undefined {
|
|
23
|
+
return getContext<SectionHost | undefined>(KEY);
|
|
24
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// =========================
|
|
3
|
+
// IMPORTS
|
|
4
|
+
// =========================
|
|
5
|
+
import type { Snippet } from "svelte";
|
|
6
|
+
import { cn } from "@heyramzi/utils";
|
|
7
|
+
import type { PhosphorIcon } from "../../lib/icon-types.js";
|
|
8
|
+
|
|
9
|
+
// =========================
|
|
10
|
+
// TYPES
|
|
11
|
+
// =========================
|
|
12
|
+
type Props = {
|
|
13
|
+
// The one label style for panel, rail group and sub-section headers. Retyped
|
|
14
|
+
// copies drifted to a different tracking value.
|
|
15
|
+
icon?: PhosphorIcon;
|
|
16
|
+
children: Snippet;
|
|
17
|
+
class?: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// =========================
|
|
21
|
+
// PROPS
|
|
22
|
+
// =========================
|
|
23
|
+
let { icon: Icon, children, class: className }: Props = $props();
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<!-- =========================== -->
|
|
27
|
+
<!-- MARKUP -->
|
|
28
|
+
<!-- =========================== -->
|
|
29
|
+
<span
|
|
30
|
+
class={cn(
|
|
31
|
+
"flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground",
|
|
32
|
+
className,
|
|
33
|
+
)}
|
|
34
|
+
>
|
|
35
|
+
{#if Icon}
|
|
36
|
+
<Icon class="size-4 text-brand-indigo" aria-hidden="true" />
|
|
37
|
+
{/if}
|
|
38
|
+
{@render children()}
|
|
39
|
+
</span>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { describe, expect, it } from "vite-plus/test";
|
|
2
|
+
import { stepTo } from "./step.js";
|
|
3
|
+
|
|
4
|
+
describe("stepTo", () => {
|
|
5
|
+
const ids = ["a", "b", "c"];
|
|
6
|
+
|
|
7
|
+
it("steps both ways from the middle", () => {
|
|
8
|
+
expect(stepTo(ids, "b", -1)).toBe("a");
|
|
9
|
+
expect(stepTo(ids, "b", 1)).toBe("c");
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("stops at either end", () => {
|
|
13
|
+
expect(stepTo(ids, "a", -1)).toBe(null);
|
|
14
|
+
expect(stepTo(ids, "c", 1)).toBe(null);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("goes nowhere without a listed selection", () => {
|
|
18
|
+
expect(stepTo(ids, null, 1)).toBe(null);
|
|
19
|
+
expect(stepTo(ids, "z", 1)).toBe(null);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** The id `by` rows away from `current`, or null at either end or when `current` isn't listed. */
|
|
2
|
+
export function stepTo(
|
|
3
|
+
ids: readonly string[],
|
|
4
|
+
current: string | null | undefined,
|
|
5
|
+
by: 1 | -1,
|
|
6
|
+
): string | null {
|
|
7
|
+
const index = current ? ids.indexOf(current) : -1;
|
|
8
|
+
if (index < 0) return null;
|
|
9
|
+
return ids[index + by] ?? null;
|
|
10
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// =========================
|
|
3
|
+
// IMPORTS
|
|
4
|
+
// =========================
|
|
5
|
+
import { Input } from "../../shadcn/input/index.js";
|
|
6
|
+
import { MagnifyingGlass } from "phosphor-svelte";
|
|
7
|
+
import { cn } from "@heyramzi/utils";
|
|
8
|
+
|
|
9
|
+
// =========================
|
|
10
|
+
// TYPES
|
|
11
|
+
// =========================
|
|
12
|
+
type Props = {
|
|
13
|
+
value: string;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
size?: "sm" | "default";
|
|
16
|
+
class?: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// =========================
|
|
20
|
+
// PROPS
|
|
21
|
+
// =========================
|
|
22
|
+
let {
|
|
23
|
+
value = $bindable(""),
|
|
24
|
+
placeholder = "Search...",
|
|
25
|
+
size = "default",
|
|
26
|
+
class: extraClass,
|
|
27
|
+
}: Props = $props();
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<!-- =========================== -->
|
|
31
|
+
<!-- MARKUP -->
|
|
32
|
+
<!-- =========================== -->
|
|
33
|
+
<!-- WHY: leading magnifying glass + a fixed height so every list page's toolbar
|
|
34
|
+
keeps the same rhythm; size="sm" matches the compact filter chips and
|
|
35
|
+
tabs used on dense list pages. -->
|
|
36
|
+
<!-- Drops the caller's desk width once the toolbar row breaks, read from the
|
|
37
|
+
shell's container. Outside the shell the caller's width stands. -->
|
|
38
|
+
<div
|
|
39
|
+
class={cn(
|
|
40
|
+
"relative",
|
|
41
|
+
extraClass,
|
|
42
|
+
"@max-3xl/toolbar:w-auto @max-3xl/toolbar:min-w-0 @max-3xl/toolbar:flex-1"
|
|
43
|
+
)}
|
|
44
|
+
>
|
|
45
|
+
<MagnifyingGlass
|
|
46
|
+
class={cn(
|
|
47
|
+
"pointer-events-none absolute top-1/2 -translate-y-1/2 text-muted-foreground",
|
|
48
|
+
size === "sm" ? "left-2 size-3" : "left-2 size-3",
|
|
49
|
+
)}
|
|
50
|
+
aria-hidden="true"
|
|
51
|
+
/>
|
|
52
|
+
<!-- Keyed to the pointer, not the viewport. On an iPad, 12px text makes
|
|
53
|
+
Safari zoom on focus and never zoom back. -->
|
|
54
|
+
<Input
|
|
55
|
+
bind:value
|
|
56
|
+
{placeholder}
|
|
57
|
+
class={cn(
|
|
58
|
+
"w-full",
|
|
59
|
+
size === "sm" ? "h-7 pl-7 pr-2.5 text-xs" : "h-7 pl-7 pr-2.5 text-xs",
|
|
60
|
+
"any-pointer-coarse:h-10 any-pointer-coarse:text-base",
|
|
61
|
+
)}
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cn } from "@heyramzi/utils";
|
|
2
|
+
|
|
3
|
+
type ToolbarTriggerOpts = {
|
|
4
|
+
active?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
// The trigger class for every toolbar control. Coarse pointers get a taller
|
|
9
|
+
// box at the same type size, since the chip is too small for a thumb.
|
|
10
|
+
|
|
11
|
+
// One fixed height, matching the `sm` button and the segmented track. A second
|
|
12
|
+
// size put a 24px filter beside 28px controls on the calendar (14 Oct 2026).
|
|
13
|
+
export function toolbarTriggerClass({
|
|
14
|
+
active = false,
|
|
15
|
+
className,
|
|
16
|
+
}: ToolbarTriggerOpts = {}): string {
|
|
17
|
+
return cn(
|
|
18
|
+
"inline-flex cursor-pointer items-center gap-1.5 rounded-lg border border-border font-medium transition-colors active:translate-y-px",
|
|
19
|
+
"h-7 px-2.5 text-xs any-pointer-coarse:h-10 any-pointer-coarse:px-3",
|
|
20
|
+
active ? "bg-muted text-foreground" : "text-muted-foreground hover:text-foreground",
|
|
21
|
+
className,
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ViewMode = "list" | "board" | "grid";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as LocaleSwitch } from "./locale-switch.svelte";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// =========================
|
|
3
|
+
// IMPORTS
|
|
4
|
+
// =========================
|
|
5
|
+
import { SegmentedFilter, type TabDef } from "../segmented/index.js";
|
|
6
|
+
|
|
7
|
+
// =========================
|
|
8
|
+
// TYPES
|
|
9
|
+
// =========================
|
|
10
|
+
type LocaleOption = {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
flag: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type Props = {
|
|
17
|
+
// Wraps `SegmentedFilter` so it shares one track with every other strip. It
|
|
18
|
+
// only adds each language's flag.
|
|
19
|
+
value: string;
|
|
20
|
+
onchange: (value: string) => void;
|
|
21
|
+
options?: LocaleOption[];
|
|
22
|
+
/** Names the control for a screen reader. Without it the group is two bare letters. */
|
|
23
|
+
ariaLabel?: string;
|
|
24
|
+
class?: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// =========================
|
|
28
|
+
// PROPS
|
|
29
|
+
// =========================
|
|
30
|
+
let {
|
|
31
|
+
value,
|
|
32
|
+
onchange,
|
|
33
|
+
options = [
|
|
34
|
+
{ value: "en", label: "EN", flag: "/flags/US.svg" },
|
|
35
|
+
{ value: "fr", label: "FR", flag: "/flags/FR.svg" },
|
|
36
|
+
],
|
|
37
|
+
ariaLabel = "Language",
|
|
38
|
+
class: className,
|
|
39
|
+
}: Props = $props();
|
|
40
|
+
|
|
41
|
+
// =========================
|
|
42
|
+
// DERIVED
|
|
43
|
+
// =========================
|
|
44
|
+
let segments = $derived<TabDef<string>[]>(
|
|
45
|
+
options.map((option) => ({ value: option.value, label: option.label, image: option.flag })),
|
|
46
|
+
);
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<!-- =========================== -->
|
|
50
|
+
<!-- MARKUP -->
|
|
51
|
+
<!-- =========================== -->
|
|
52
|
+
<SegmentedFilter
|
|
53
|
+
{value}
|
|
54
|
+
onValueChange={onchange}
|
|
55
|
+
options={segments}
|
|
56
|
+
block={false}
|
|
57
|
+
{ariaLabel}
|
|
58
|
+
class={className}
|
|
59
|
+
/>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Mark } from "./mark.svelte";
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// =========================
|
|
3
|
+
// IMPORTS
|
|
4
|
+
// =========================
|
|
5
|
+
import { cn } from "@heyramzi/utils";
|
|
6
|
+
|
|
7
|
+
// =========================
|
|
8
|
+
// TYPES
|
|
9
|
+
// =========================
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A brand's mark at glyph size: a kit icon, a channel avatar, a client logo.
|
|
13
|
+
* One renderer, because three places each handled a missing file their own way.
|
|
14
|
+
*/
|
|
15
|
+
type Props = {
|
|
16
|
+
/** The file. A missing or broken one falls back to the label's initial. */
|
|
17
|
+
src?: string;
|
|
18
|
+
/** Read for the fallback letter. The mark itself is decorative. */
|
|
19
|
+
label: string;
|
|
20
|
+
/** `circle` crops a photograph to a disc, `square` fits a logo whole. */
|
|
21
|
+
shape?: "square" | "circle";
|
|
22
|
+
class?: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// =========================
|
|
26
|
+
// PROPS
|
|
27
|
+
// =========================
|
|
28
|
+
let { src, label, shape = "square", class: className }: Props = $props();
|
|
29
|
+
|
|
30
|
+
// =========================
|
|
31
|
+
// STATE
|
|
32
|
+
// =========================
|
|
33
|
+
/** The src that failed, so a later one gets its own chance to load. */
|
|
34
|
+
let broken = $state("");
|
|
35
|
+
|
|
36
|
+
// =========================
|
|
37
|
+
// DERIVED
|
|
38
|
+
// =========================
|
|
39
|
+
let round = $derived(shape === "circle");
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<!-- =========================== -->
|
|
43
|
+
<!-- MARKUP -->
|
|
44
|
+
<!-- =========================== -->
|
|
45
|
+
<!-- WHY the letter is a fallback and not a backdrop: a tile drawn UNDER the mark
|
|
46
|
+
shows its initial through every logo that is not a full-bleed square. -->
|
|
47
|
+
{#if src && broken !== src}
|
|
48
|
+
<img
|
|
49
|
+
{src}
|
|
50
|
+
alt=""
|
|
51
|
+
loading="lazy"
|
|
52
|
+
referrerpolicy="no-referrer"
|
|
53
|
+
class={cn(
|
|
54
|
+
"size-4 shrink-0",
|
|
55
|
+
round ? "rounded-full object-cover" : "object-contain",
|
|
56
|
+
className,
|
|
57
|
+
)}
|
|
58
|
+
onerror={() => (broken = src)}
|
|
59
|
+
/>
|
|
60
|
+
{:else}
|
|
61
|
+
<span
|
|
62
|
+
class={cn(
|
|
63
|
+
"bg-muted text-muted-foreground flex size-4 shrink-0 items-center justify-center text-[10px] leading-none font-bold",
|
|
64
|
+
round ? "rounded-full" : "rounded-xs",
|
|
65
|
+
className,
|
|
66
|
+
)}
|
|
67
|
+
>
|
|
68
|
+
{label.charAt(0)}
|
|
69
|
+
</span>
|
|
70
|
+
{/if}
|