@heyramzi/ui 1.54.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COMPONENTS.md +3 -2
- package/README.md +34 -9
- package/package.json +200 -7
- package/scripts/sync-shadcn.mjs +2 -2
- package/src/ai/ai-button/AiButton.svelte +1 -1
- package/src/ai/confirmation/Confirmation.svelte +1 -1
- package/src/ai/confirmation/ConfirmationAction.svelte +1 -1
- package/src/ai/confirmation/ConfirmationActions.svelte +1 -1
- package/src/ai/confirmation/ConfirmationTitle.svelte +1 -1
- package/src/ai/generation-progress/GenerationProgress.svelte +13 -13
- package/src/ai/loading-state/PixelLoader.svelte +1 -1
- package/src/ai/prompt-input/PromptInput.svelte +1 -1
- package/src/ai/prompt-input/PromptInputBody.svelte +1 -1
- package/src/ai/prompt-input/PromptInputSubmit.svelte +1 -1
- package/src/ai/prompt-input/PromptInputTextarea.svelte +1 -1
- package/src/ai/prompt-input/PromptInputToolbar.svelte +1 -1
- package/src/ai/reasoning/Reasoning.svelte +1 -1
- package/src/ai/reasoning/ReasoningContent.svelte +1 -1
- package/src/ai/reasoning/ReasoningTrigger.svelte +1 -1
- package/src/ai/response/Response.svelte +1 -1
- package/src/ai/suggestion/Suggestion.svelte +1 -1
- package/src/ai/suggestion/Suggestions.svelte +1 -1
- package/src/ai/thinking-dots/ThinkingDots.svelte +1 -1
- package/src/ai/typing-dots/TypingDots.svelte +1 -1
- package/src/ai/voice-waveform/VoiceWaveform.svelte +1 -1
- package/src/ambient.d.ts +8 -0
- package/src/brand/brand.test.ts +67 -0
- package/src/brand/index.ts +137 -0
- package/src/canvas/README.md +236 -0
- package/src/canvas/card/card-frame.svelte +61 -0
- package/src/canvas/card/card.css +39 -0
- package/src/canvas/card/resize-handles.svelte +119 -0
- package/src/canvas/card/resize.ts +33 -0
- package/src/canvas/chrome/chrome-zoom.svelte +120 -0
- package/src/canvas/chrome/chrome.css +231 -0
- package/src/canvas/chrome/lock-badge.svelte +18 -0
- package/src/canvas/chrome/side-handles.svelte +30 -0
- package/src/canvas/chrome/size-chip.svelte +45 -0
- package/src/canvas/chrome/snap-guides.svelte +69 -0
- package/src/canvas/components/icons/ToolIcon.svelte +30 -0
- package/src/canvas/components/shared/svg/PreviewSvg.svelte +67 -0
- package/src/canvas/components/shared/svg/ShapeOutline.svelte +76 -0
- package/src/canvas/components/shared/svg/StrokeNode.svelte +69 -0
- package/src/canvas/components/shared/svg/TextRule.svelte +37 -0
- package/src/canvas/edges/bend-handle.svelte +76 -0
- package/src/canvas/edges/edge-gradient.svelte +30 -0
- package/src/canvas/edges/edge-path.test.ts +58 -0
- package/src/canvas/edges/edge-path.ts +293 -0
- package/src/canvas/edges/gradient-edge.svelte +43 -0
- package/src/canvas/editor/context-menu.test.ts +65 -0
- package/src/canvas/editor/context-menu.ts +48 -0
- package/src/canvas/editor/dispatch.svelte.test.ts +243 -0
- package/src/canvas/editor/dispatch.svelte.ts +205 -0
- package/src/canvas/editor/editor-context.ts +62 -0
- package/src/canvas/editor/editor-mode.ts +67 -0
- package/src/canvas/editor/frame.ts +98 -0
- package/src/canvas/editor/hand-context.ts +15 -0
- package/src/canvas/editor/history-core.test.ts +239 -0
- package/src/canvas/editor/history-core.ts +247 -0
- package/src/canvas/editor/keymap.test.ts +161 -0
- package/src/canvas/editor/keymap.ts +151 -0
- package/src/canvas/editor/layout-actions.test.ts +156 -0
- package/src/canvas/editor/layout-actions.ts +219 -0
- package/src/canvas/editor/lock.test.ts +68 -0
- package/src/canvas/editor/lock.ts +87 -0
- package/src/canvas/editor/rebase.test.ts +208 -0
- package/src/canvas/editor/rebase.ts +272 -0
- package/src/canvas/editor/style.ts +184 -0
- package/src/canvas/editor/text-field-context.ts +41 -0
- package/src/canvas/editor/z-order.test.ts +75 -0
- package/src/canvas/editor/z-order.ts +87 -0
- package/src/canvas/headless/alignment.test.ts +59 -0
- package/src/canvas/headless/alignment.ts +23 -0
- package/src/canvas/headless/break-apart-find.ts +418 -0
- package/src/canvas/headless/break-apart-pieces.ts +104 -0
- package/src/canvas/headless/break-apart-plan.ts +439 -0
- package/src/canvas/headless/break-apart-style.ts +106 -0
- package/src/canvas/headless/break-apart.ts +244 -0
- package/src/canvas/headless/canvas-cleanup.test.ts +181 -0
- package/src/canvas/headless/canvas-cleanup.ts +102 -0
- package/src/canvas/headless/edge-anchors.test.ts +70 -0
- package/src/canvas/headless/edge-anchors.ts +143 -0
- package/src/canvas/headless/edge-memo.test.ts +58 -0
- package/src/canvas/headless/edge-memo.ts +32 -0
- package/src/canvas/headless/edge-serialization.test.ts +55 -0
- package/src/canvas/headless/edge-serialization.ts +32 -0
- package/src/canvas/headless/figure-geometry.ts +293 -0
- package/src/canvas/headless/fit-viewport.test.ts +85 -0
- package/src/canvas/headless/fit-viewport.ts +137 -0
- package/src/canvas/headless/grid.test.ts +34 -0
- package/src/canvas/headless/grid.ts +94 -0
- package/src/canvas/headless/icon-node.test.ts +23 -0
- package/src/canvas/headless/icon-node.ts +66 -0
- package/src/canvas/headless/index.ts +9 -0
- package/src/canvas/headless/linkify.test.ts +23 -0
- package/src/canvas/headless/linkify.ts +25 -0
- package/src/canvas/headless/pen-marks.ts +133 -0
- package/src/canvas/headless/sketch.test.ts +99 -0
- package/src/canvas/headless/sketch.ts +302 -0
- package/src/canvas/headless/snap-guides.test.ts +61 -0
- package/src/canvas/headless/snap-guides.ts +146 -0
- package/src/canvas/headless/svg-figure.test.ts +49 -0
- package/src/canvas/headless/svg-figure.ts +176 -0
- package/src/canvas/headless/table-layout.test.ts +158 -0
- package/src/canvas/headless/table-layout.ts +309 -0
- package/src/canvas/index.ts +35 -0
- package/src/canvas/lod/lod-mode.svelte.ts +30 -0
- package/src/canvas/lod/lod-switch.svelte +140 -0
- package/src/canvas/lod/render-all.svelte.ts +52 -0
- package/src/canvas/ops/arrange.ts +108 -0
- package/src/canvas/ops/ops.test.ts +98 -0
- package/src/canvas/ops/ops.ts +347 -0
- package/src/canvas/pen/PenField.svelte +128 -0
- package/src/canvas/pen/PenField.test.ts +87 -0
- package/src/canvas/pen/PenOverlay.svelte +172 -0
- package/src/canvas/pen/ShapeNode.svelte +64 -0
- package/src/canvas/pen/TextNode.svelte +97 -0
- package/src/canvas/pen/colors.ts +28 -0
- package/src/canvas/pen/eraser.ts +46 -0
- package/src/canvas/pen/geometry.ts +148 -0
- package/src/canvas/pen/host-field.test.svelte +13 -0
- package/src/canvas/pen/index.ts +40 -0
- package/src/canvas/pen/ops.ts +16 -0
- package/src/canvas/pen/pen-session.ts +177 -0
- package/src/canvas/pen/pen.css +149 -0
- package/src/canvas/pen/plugin.ts +139 -0
- package/src/canvas/pen/shapes.ts +104 -0
- package/src/canvas/pen/stroke-path.ts +54 -0
- package/src/canvas/pen/types.ts +96 -0
- package/src/canvas/pen/ui.ts +26 -0
- package/src/canvas/plugin.test.ts +45 -0
- package/src/canvas/plugin.ts +159 -0
- package/src/canvas/screen/GlyphIcon.svelte +25 -0
- package/src/canvas/screen/PartView.svelte +176 -0
- package/src/canvas/screen/ScreenBody.svelte +142 -0
- package/src/canvas/screen/ScreenCard.svelte +32 -0
- package/src/canvas/screen/glyphs/button.svg +1 -0
- package/src/canvas/screen/glyphs/close.svg +1 -0
- package/src/canvas/screen/glyphs/down.svg +1 -0
- package/src/canvas/screen/glyphs/header.svg +1 -0
- package/src/canvas/screen/glyphs/hills.svg +1 -0
- package/src/canvas/screen/glyphs/image.svg +1 -0
- package/src/canvas/screen/glyphs/input.svg +1 -0
- package/src/canvas/screen/glyphs/list.svg +1 -0
- package/src/canvas/screen/glyphs/modal.svg +1 -0
- package/src/canvas/screen/glyphs/plus.svg +1 -0
- package/src/canvas/screen/glyphs/up.svg +1 -0
- package/src/canvas/screen/glyphs.ts +40 -0
- package/src/canvas/screen/labels.ts +41 -0
- package/src/canvas/screen/parts.ts +164 -0
- package/src/canvas/screen/plugin.ts +67 -0
- package/src/canvas/screen/screen.css +593 -0
- package/src/canvas/screen/types.ts +47 -0
- package/src/canvas/screen/ui.ts +13 -0
- package/src/canvas/test-utils.ts +18 -0
- package/src/canvas/types.ts +53 -0
- package/src/canvas/ui/CanvasToolbar.svelte +169 -0
- package/src/canvas/ui/FrameLayer.svelte +116 -0
- package/src/canvas/ui/PenLayer.svelte +39 -0
- package/src/canvas/ui/StylePanel.svelte +268 -0
- package/src/canvas/ui/canvas-grid.svelte +156 -0
- package/src/canvas/ui/canvas-ui.css +350 -0
- package/src/canvas/ui/forward-wheel.ts +29 -0
- package/src/canvas/ui/icons.ts +124 -0
- package/src/canvas/ui/place-panel.ts +80 -0
- package/src/canvas/ui/shortcut-tip.test.ts +16 -0
- package/src/canvas/ui/shortcut-tip.ts +17 -0
- package/src/canvas/ui/tools.ts +146 -0
- package/src/charts/README.md +104 -0
- package/src/charts/ambient.d.ts +4 -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 +204 -0
- package/src/charts/bar-chart.css +119 -0
- package/src/charts/bar-chart.svelte +275 -0
- package/src/charts/charts.css +201 -0
- package/src/charts/crosshair.svelte +35 -0
- package/src/charts/dashboard/chart.ts +5 -0
- package/src/charts/dashboard/dashboard-empty.svelte +55 -0
- package/src/charts/dashboard/dashboard-section.svelte +58 -0
- package/src/charts/dashboard/data-panel.svelte +81 -0
- package/src/charts/dashboard/data-sort-head.svelte +102 -0
- package/src/charts/dashboard/data-table.svelte +278 -0
- package/src/charts/dashboard/data-table.ts +26 -0
- package/src/charts/dashboard/index.ts +25 -0
- package/src/charts/dashboard/panel-grid.svelte +43 -0
- package/src/charts/dashboard/period-filter.svelte +53 -0
- package/src/charts/dashboard/rating-chip.svelte +35 -0
- package/src/charts/dashboard/stat-band.svelte +47 -0
- package/src/charts/dashboard/stat-tile.svelte +176 -0
- package/src/charts/dashboard/windows.ts +8 -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 +302 -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 +31 -0
- package/src/charts/legend.css +136 -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 +179 -0
- package/src/charts/number-chart.svelte +187 -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/reference-line.css +18 -0
- package/src/charts/reference-line.svelte +31 -0
- package/src/charts/reveal.svelte +61 -0
- package/src/charts/ring-chart.css +104 -0
- package/src/charts/ring-chart.svelte +166 -0
- package/src/charts/sparkline.css +45 -0
- package/src/charts/sparkline.svelte +141 -0
- package/src/charts/stat-card.css +105 -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/components/copy/clipboard.ts +13 -9
- package/src/components/copy/copy-button.svelte +2 -2
- package/src/components/data-table/row-arrow.svelte +1 -1
- package/src/components/data-table/sortable-head.svelte +1 -1
- package/src/components/docs/doc-page.svelte +1 -1
- package/src/components/docs/on-this-page.svelte +2 -2
- package/src/components/field-row/field-row.svelte +1 -1
- package/src/components/hold-to-confirm/hold-to-confirm.svelte +1 -1
- package/src/components/language-flag/language-flag.svelte +1 -1
- package/src/components/list-page/detail-empty.svelte +1 -1
- package/src/components/list-page/detail-header.svelte +1 -1
- package/src/components/list-page/detail-panel.svelte +1 -1
- package/src/components/list-page/detail-row.svelte +1 -1
- package/src/components/list-page/detail-stack.svelte +1 -1
- package/src/components/list-page/empty-state.svelte +1 -1
- package/src/components/list-page/filter-item.svelte +1 -1
- package/src/components/list-page/filter-popover.svelte +2 -2
- package/src/components/list-page/filter-section.ts +1 -1
- package/src/components/list-page/grouped-list.svelte +1 -1
- package/src/components/list-page/list-page-shell.svelte +1 -1
- package/src/components/list-page/list-table.ts +1 -1
- package/src/components/list-page/master-detail.svelte +1 -1
- package/src/components/list-page/notice-bar.svelte +1 -1
- package/src/components/list-page/prev-next.svelte +1 -1
- package/src/components/list-page/rail-body.svelte +1 -1
- package/src/components/list-page/rail-empty.svelte +1 -1
- package/src/components/list-page/rail-head.svelte +1 -1
- package/src/components/list-page/rail-row.svelte +1 -1
- package/src/components/list-page/section-label.svelte +2 -2
- package/src/components/list-page/toolbar-search.svelte +1 -1
- package/src/components/list-page/toolbar-trigger.ts +1 -1
- package/src/components/mark/mark.svelte +1 -1
- package/src/components/open-in/open-in.svelte +1 -1
- package/src/components/picker/mark-picker.svelte +1 -1
- package/src/components/picker/picker.svelte +1 -1
- package/src/components/section-card/section-card.svelte +1 -1
- package/src/components/segmented/animated-tabs.svelte +1 -1
- package/src/components/segmented/section-runs.svelte +1 -1
- package/src/components/segmented/segment.svelte +5 -5
- package/src/components/segmented/segmented-filter.svelte +1 -1
- package/src/components/segmented/segmented-nav.svelte +1 -1
- package/src/components/segmented/segmented-overflow.svelte +1 -1
- package/src/components/segmented/segmented-track.svelte +1 -1
- package/src/components/star-rating-input/star-rating-input.svelte +1 -1
- package/src/components/table-view/table-view.svelte +1 -1
- package/src/components/theme/theme-provider.svelte +6 -4
- package/src/components/toolbar/index.ts +5 -0
- package/src/components/toolbar/toolbar.svelte +168 -0
- package/src/components/toolbar/toolbar.test.ts +66 -0
- package/src/editor/README.md +58 -0
- package/src/editor/ambient.d.ts +1 -0
- package/src/editor/block-id.ts +77 -0
- package/src/editor/block-ops.test.ts +237 -0
- package/src/editor/block-ops.ts +157 -0
- package/src/editor/content.css +418 -0
- package/src/editor/editor-toolbar.svelte +303 -0
- package/src/editor/editor.svelte +462 -0
- package/src/editor/extensions.ts +145 -0
- package/src/editor/image-toolbar.svelte +123 -0
- package/src/editor/index.ts +17 -0
- package/src/editor/inline-editor.svelte +261 -0
- package/src/editor/markdown-escaping.test.ts +158 -0
- package/src/editor/markdown-marks.test.ts +89 -0
- package/src/editor/markdown-test-helpers.ts +13 -0
- package/src/editor/markdown-youtube.test.ts +93 -0
- package/src/editor/markdown.test.ts +250 -0
- package/src/editor/markdown.ts +511 -0
- package/src/editor/renderer.svelte +92 -0
- package/src/editor/serializer.test.ts +133 -0
- package/src/editor/serializer.ts +370 -0
- package/src/editor/slash-items.ts +115 -0
- package/src/editor/slash-menu.svelte +159 -0
- package/src/editor/youtube-url.ts +35 -0
- package/src/effects/animated-beam/AnimatedBeam.svelte +1 -1
- package/src/effects/border-beam/register-properties.ts +4 -2
- package/src/effects/image-comparison/ImageComparison.svelte +1 -1
- package/src/effects/image-reveal/ImageReveal.svelte +1 -1
- package/src/effects/interactive-hover-button/InteractiveHoverButton.svelte +13 -13
- package/src/effects/magic-card/MagicCard.svelte +1 -1
- package/src/effects/marquee/Marquee.svelte +1 -1
- package/src/effects/progressive-blur/ProgressiveBlur.svelte +1 -1
- package/src/effects/reveal/AnimatedGroup.svelte +1 -1
- package/src/effects/reveal/InView.svelte +1 -1
- package/src/effects/reveal/TextEffect.svelte +1 -1
- package/src/effects/shader-gradient/ShaderGradient.svelte +1 -1
- package/src/effects/spotlight/Spotlight.svelte +1 -1
- package/src/effects/theme-toggle/ThemeToggle.svelte +4 -4
- package/src/lib/result.ts +19 -0
- package/src/lib/utils.ts +18 -0
- package/src/onboarding/README.md +120 -0
- package/src/onboarding/define-tours.test.ts +50 -0
- package/src/onboarding/define-tours.ts +31 -0
- package/src/onboarding/demo.svelte +86 -0
- package/src/onboarding/index.ts +12 -0
- package/src/onboarding/onboarding-provider.svelte +120 -0
- package/src/onboarding/onboarding.svelte.ts +24 -0
- package/src/onboarding/pick.test.ts +79 -0
- package/src/onboarding/pick.ts +36 -0
- package/src/onboarding/stores.test.ts +103 -0
- package/src/onboarding/stores.ts +58 -0
- package/src/onboarding/tour-card.svelte +70 -0
- package/src/onboarding/tour-runner.svelte +197 -0
- package/src/onboarding/types.ts +34 -0
- package/src/onboarding/wait.ts +29 -0
- package/src/shadcn/accordion/accordion-content.svelte +1 -1
- package/src/shadcn/accordion/accordion-item.svelte +1 -1
- package/src/shadcn/accordion/accordion-trigger.svelte +1 -1
- package/src/shadcn/accordion/accordion.svelte +1 -1
- package/src/shadcn/alert/alert-description.svelte +1 -1
- package/src/shadcn/alert/alert-title.svelte +1 -1
- package/src/shadcn/alert/alert.svelte +1 -1
- package/src/shadcn/alert-dialog/alert-dialog-action.svelte +1 -1
- package/src/shadcn/alert-dialog/alert-dialog-cancel.svelte +1 -1
- package/src/shadcn/alert-dialog/alert-dialog-content.svelte +1 -1
- package/src/shadcn/alert-dialog/alert-dialog-description.svelte +1 -1
- package/src/shadcn/alert-dialog/alert-dialog-footer.svelte +1 -1
- package/src/shadcn/alert-dialog/alert-dialog-header.svelte +1 -1
- package/src/shadcn/alert-dialog/alert-dialog-overlay.svelte +1 -1
- package/src/shadcn/alert-dialog/alert-dialog-title.svelte +1 -1
- package/src/shadcn/attachment/attachment-action.svelte +1 -1
- package/src/shadcn/attachment/attachment-actions.svelte +1 -1
- package/src/shadcn/attachment/attachment-content.svelte +1 -1
- package/src/shadcn/attachment/attachment-description.svelte +1 -1
- package/src/shadcn/attachment/attachment-group.svelte +1 -1
- package/src/shadcn/attachment/attachment-media.svelte +1 -1
- package/src/shadcn/attachment/attachment-title.svelte +1 -1
- package/src/shadcn/attachment/attachment-trigger.svelte +1 -1
- package/src/shadcn/attachment/attachment.svelte +1 -1
- package/src/shadcn/avatar/avatar-badge.svelte +1 -1
- package/src/shadcn/avatar/avatar-fallback.svelte +1 -1
- package/src/shadcn/avatar/avatar-group-count.svelte +1 -1
- package/src/shadcn/avatar/avatar-group.svelte +1 -1
- package/src/shadcn/avatar/avatar-image.svelte +1 -1
- package/src/shadcn/avatar/avatar.svelte +1 -1
- package/src/shadcn/badge/badge.svelte +1 -1
- package/src/shadcn/breadcrumb/breadcrumb-ellipsis.svelte +1 -1
- package/src/shadcn/breadcrumb/breadcrumb-item.svelte +1 -1
- package/src/shadcn/breadcrumb/breadcrumb-link.svelte +1 -1
- package/src/shadcn/breadcrumb/breadcrumb-list.svelte +1 -1
- package/src/shadcn/breadcrumb/breadcrumb-page.svelte +1 -1
- package/src/shadcn/breadcrumb/breadcrumb-separator.svelte +1 -1
- package/src/shadcn/breadcrumb/breadcrumb.svelte +1 -1
- package/src/shadcn/bubble/bubble-content.svelte +1 -1
- package/src/shadcn/bubble/bubble-group.svelte +1 -1
- package/src/shadcn/bubble/bubble-reactions.svelte +1 -1
- package/src/shadcn/bubble/bubble.svelte +1 -1
- package/src/shadcn/button/button.svelte +1 -1
- package/src/shadcn/calendar/calendar-cell.svelte +1 -1
- package/src/shadcn/calendar/calendar-day.svelte +1 -1
- package/src/shadcn/calendar/calendar-grid-body.svelte +1 -1
- package/src/shadcn/calendar/calendar-grid-head.svelte +1 -1
- package/src/shadcn/calendar/calendar-grid-row.svelte +1 -1
- package/src/shadcn/calendar/calendar-grid.svelte +1 -1
- package/src/shadcn/calendar/calendar-head-cell.svelte +1 -1
- package/src/shadcn/calendar/calendar-header.svelte +1 -1
- package/src/shadcn/calendar/calendar-heading.svelte +1 -1
- package/src/shadcn/calendar/calendar-month-select.svelte +1 -1
- package/src/shadcn/calendar/calendar-month.svelte +1 -1
- package/src/shadcn/calendar/calendar-months.svelte +1 -1
- package/src/shadcn/calendar/calendar-nav.svelte +1 -1
- package/src/shadcn/calendar/calendar-next-button.svelte +1 -1
- package/src/shadcn/calendar/calendar-prev-button.svelte +1 -1
- package/src/shadcn/calendar/calendar-year-select.svelte +1 -1
- package/src/shadcn/calendar/calendar.svelte +1 -1
- package/src/shadcn/card/card-action.svelte +1 -1
- package/src/shadcn/card/card-content.svelte +1 -1
- package/src/shadcn/card/card-description.svelte +1 -1
- package/src/shadcn/card/card-footer.svelte +1 -1
- package/src/shadcn/card/card-header.svelte +1 -1
- package/src/shadcn/card/card-title.svelte +1 -1
- package/src/shadcn/card/card.svelte +1 -1
- package/src/shadcn/checkbox/checkbox.svelte +1 -1
- package/src/shadcn/code-block/code-block-actions.svelte +1 -1
- package/src/shadcn/code-block/code-block-content.svelte +1 -1
- package/src/shadcn/code-block/code-block-footer.svelte +1 -1
- package/src/shadcn/code-block/code-block-header.svelte +1 -1
- package/src/shadcn/code-block/code-block-line.svelte +1 -1
- package/src/shadcn/code-block/code-block-title.svelte +1 -1
- package/src/shadcn/code-block/code-block.svelte +1 -1
- package/src/shadcn/command/command-dialog.svelte +1 -1
- package/src/shadcn/command/command-empty.svelte +1 -1
- package/src/shadcn/command/command-group.svelte +1 -1
- package/src/shadcn/command/command-input.svelte +2 -2
- package/src/shadcn/command/command-item.svelte +1 -1
- package/src/shadcn/command/command-link-item.svelte +1 -1
- package/src/shadcn/command/command-list.svelte +1 -1
- package/src/shadcn/command/command-separator.svelte +1 -1
- package/src/shadcn/command/command-shortcut.svelte +1 -1
- package/src/shadcn/command/command.svelte +1 -1
- package/src/shadcn/context-menu/context-menu-checkbox-item.svelte +1 -1
- package/src/shadcn/context-menu/context-menu-content.svelte +2 -2
- package/src/shadcn/context-menu/context-menu-group-heading.svelte +1 -1
- package/src/shadcn/context-menu/context-menu-item.svelte +1 -1
- package/src/shadcn/context-menu/context-menu-label.svelte +1 -1
- package/src/shadcn/context-menu/context-menu-radio-item.svelte +1 -1
- package/src/shadcn/context-menu/context-menu-separator.svelte +1 -1
- package/src/shadcn/context-menu/context-menu-shortcut.svelte +1 -1
- package/src/shadcn/context-menu/context-menu-sub-content.svelte +1 -1
- package/src/shadcn/context-menu/context-menu-sub-trigger.svelte +1 -1
- package/src/shadcn/context-menu/context-menu-trigger.svelte +1 -1
- package/src/shadcn/dialog/dialog-content.svelte +1 -1
- package/src/shadcn/dialog/dialog-description.svelte +1 -1
- package/src/shadcn/dialog/dialog-footer.svelte +1 -1
- package/src/shadcn/dialog/dialog-header.svelte +1 -1
- package/src/shadcn/dialog/dialog-overlay.svelte +1 -1
- package/src/shadcn/dialog/dialog-title.svelte +1 -1
- package/src/shadcn/dropdown-menu/dropdown-menu-checkbox-item.svelte +1 -1
- package/src/shadcn/dropdown-menu/dropdown-menu-content.svelte +1 -1
- package/src/shadcn/dropdown-menu/dropdown-menu-group-heading.svelte +1 -1
- package/src/shadcn/dropdown-menu/dropdown-menu-item.svelte +1 -1
- package/src/shadcn/dropdown-menu/dropdown-menu-label.svelte +1 -1
- package/src/shadcn/dropdown-menu/dropdown-menu-radio-item.svelte +1 -1
- package/src/shadcn/dropdown-menu/dropdown-menu-separator.svelte +1 -1
- package/src/shadcn/dropdown-menu/dropdown-menu-shortcut.svelte +1 -1
- package/src/shadcn/dropdown-menu/dropdown-menu-sub-content.svelte +1 -1
- package/src/shadcn/dropdown-menu/dropdown-menu-sub-trigger.svelte +1 -1
- package/src/shadcn/empty/empty-content.svelte +1 -1
- package/src/shadcn/empty/empty-description.svelte +1 -1
- package/src/shadcn/empty/empty-header.svelte +1 -1
- package/src/shadcn/empty/empty-media.svelte +1 -1
- package/src/shadcn/empty/empty-title.svelte +1 -1
- package/src/shadcn/empty/empty.svelte +1 -1
- package/src/shadcn/field/field-content.svelte +1 -1
- package/src/shadcn/field/field-description.svelte +1 -1
- package/src/shadcn/field/field-error.svelte +1 -1
- package/src/shadcn/field/field-group.svelte +1 -1
- package/src/shadcn/field/field-label.svelte +1 -1
- package/src/shadcn/field/field-legend.svelte +1 -1
- package/src/shadcn/field/field-separator.svelte +1 -1
- package/src/shadcn/field/field-set.svelte +1 -1
- package/src/shadcn/field/field-title.svelte +1 -1
- package/src/shadcn/field/field.svelte +1 -1
- package/src/shadcn/field/simple-field.svelte +1 -1
- package/src/shadcn/hover-card/hover-card-content.svelte +1 -1
- package/src/shadcn/input/input.svelte +1 -1
- package/src/shadcn/input/secret-input.svelte +1 -1
- package/src/shadcn/input-otp/input-otp-group.svelte +1 -1
- package/src/shadcn/input-otp/input-otp-separator.svelte +1 -1
- package/src/shadcn/input-otp/input-otp-slot.svelte +1 -1
- package/src/shadcn/input-otp/input-otp.svelte +1 -1
- package/src/shadcn/kbd/kbd-group.svelte +1 -1
- package/src/shadcn/kbd/kbd.svelte +1 -1
- package/src/shadcn/label/label.svelte +1 -1
- package/src/shadcn/marker/marker-content.svelte +1 -1
- package/src/shadcn/marker/marker-icon.svelte +1 -1
- package/src/shadcn/marker/marker.svelte +1 -1
- package/src/shadcn/message/message-avatar.svelte +1 -1
- package/src/shadcn/message/message-content.svelte +1 -1
- package/src/shadcn/message/message-footer.svelte +1 -1
- package/src/shadcn/message/message-group.svelte +1 -1
- package/src/shadcn/message/message-header.svelte +1 -1
- package/src/shadcn/message/message.svelte +1 -1
- package/src/shadcn/message-scroller/message-scroller-button.svelte +1 -1
- package/src/shadcn/message-scroller/message-scroller-content.svelte +1 -1
- package/src/shadcn/message-scroller/message-scroller-item.svelte +1 -1
- package/src/shadcn/message-scroller/message-scroller-viewport.svelte +1 -1
- package/src/shadcn/message-scroller/message-scroller.svelte +1 -1
- package/src/shadcn/popover/popover-content.svelte +1 -1
- package/src/shadcn/popover/popover-description.svelte +1 -1
- package/src/shadcn/popover/popover-header.svelte +1 -1
- package/src/shadcn/popover/popover-title.svelte +1 -1
- package/src/shadcn/popover/popover-trigger.svelte +1 -1
- package/src/shadcn/progress/progress.svelte +1 -1
- package/src/shadcn/radio-group/radio-group-item.svelte +1 -1
- package/src/shadcn/radio-group/radio-group.svelte +1 -1
- package/src/shadcn/scroll-area/scroll-area-scrollbar.svelte +1 -1
- package/src/shadcn/scroll-area/scroll-area.svelte +1 -1
- package/src/shadcn/select/select-content.svelte +2 -2
- package/src/shadcn/select/select-group-heading.svelte +1 -1
- package/src/shadcn/select/select-group.svelte +1 -1
- package/src/shadcn/select/select-item.svelte +1 -1
- package/src/shadcn/select/select-label.svelte +1 -1
- package/src/shadcn/select/select-scroll-down-button.svelte +1 -1
- package/src/shadcn/select/select-scroll-up-button.svelte +1 -1
- package/src/shadcn/select/select-separator.svelte +1 -1
- package/src/shadcn/select/select-trigger.svelte +1 -1
- package/src/shadcn/separator/separator.svelte +1 -1
- package/src/shadcn/sheet/sheet-content.svelte +1 -1
- package/src/shadcn/sheet/sheet-description.svelte +1 -1
- package/src/shadcn/sheet/sheet-footer.svelte +1 -1
- package/src/shadcn/sheet/sheet-header.svelte +1 -1
- package/src/shadcn/sheet/sheet-overlay.svelte +1 -1
- package/src/shadcn/sheet/sheet-title.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-content.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-footer.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-group-action.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-group-content.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-group-label.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-group.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-header.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-input.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-inset.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-menu-action.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-menu-badge.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-menu-button.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-menu-item.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-menu-skeleton.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-menu-sub-button.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-menu-sub-item.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-menu-sub.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-menu.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-provider.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-rail.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-separator.svelte +1 -1
- package/src/shadcn/sidebar/sidebar-trigger.svelte +1 -1
- package/src/shadcn/sidebar/sidebar.svelte +1 -1
- package/src/shadcn/skeleton/skeleton.svelte +1 -1
- package/src/shadcn/slider/slider.svelte +1 -1
- package/src/shadcn/spinner/spinner.svelte +1 -1
- package/src/shadcn/switch/switch.svelte +1 -1
- package/src/shadcn/table/table-body.svelte +1 -1
- package/src/shadcn/table/table-caption.svelte +1 -1
- package/src/shadcn/table/table-cell.svelte +1 -1
- package/src/shadcn/table/table-footer.svelte +1 -1
- package/src/shadcn/table/table-head.svelte +1 -1
- package/src/shadcn/table/table-header.svelte +1 -1
- package/src/shadcn/table/table-row.svelte +1 -1
- package/src/shadcn/table/table.svelte +1 -1
- package/src/shadcn/tabs/tabs-content.svelte +1 -1
- package/src/shadcn/tabs/tabs-list.svelte +1 -1
- package/src/shadcn/tabs/tabs-trigger.svelte +1 -1
- package/src/shadcn/tabs/tabs.svelte +1 -1
- package/src/shadcn/textarea/textarea.svelte +1 -1
- package/src/shadcn/toggle/toggle.svelte +1 -1
- package/src/shadcn/toggle-group/toggle-group-item.svelte +1 -1
- package/src/shadcn/toggle-group/toggle-group.svelte +1 -1
- package/src/shadcn/tooltip/tooltip-content.svelte +2 -2
- package/src/shadcn/trace/trace-collapsible-content.svelte +1 -1
- package/src/shadcn/trace/trace-collapsible-trigger.svelte +1 -1
- package/src/shadcn/trace/trace-collapsible.svelte +1 -1
- package/src/shadcn/trace/trace-description.svelte +1 -1
- package/src/shadcn/trace/trace-icon.svelte +1 -1
- package/src/shadcn/trace/trace-line.svelte +1 -1
- package/src/shadcn/trace/trace-title.svelte +1 -1
- package/src/shadcn/trace/trace.svelte +1 -1
- package/src/slides/Controls.svelte +138 -0
- package/src/slides/Deck.svelte +271 -0
- package/src/slides/Fragment.svelte +71 -0
- package/src/slides/Overview.svelte +113 -0
- package/src/slides/Presenter.svelte +292 -0
- package/src/slides/README.md +89 -0
- package/src/slides/Slide.svelte +179 -0
- package/src/slides/SlideList.svelte +19 -0
- package/src/slides/ambient.d.ts +1 -0
- package/src/slides/bridges.ts +69 -0
- package/src/slides/deck-controller.svelte.ts +292 -0
- package/src/slides/demo-slides.svelte +358 -0
- package/src/slides/demo.svelte +176 -0
- package/src/slides/export/capture.ts +113 -0
- package/src/slides/export/ffmpeg.ts +120 -0
- package/src/slides/export/index.ts +9 -0
- package/src/slides/export/launch.ts +10 -0
- package/src/slides/export/pdf.ts +152 -0
- package/src/slides/export/types.ts +48 -0
- package/src/slides/index.ts +19 -0
- package/src/slides/labels.ts +48 -0
- package/src/slides/layout.ts +51 -0
- package/src/slides/model.ts +47 -0
- package/src/slides/navigation.ts +100 -0
- package/src/slides/theme.css +205 -0
- package/src/slides/types.ts +86 -0
- package/src/tasks/README.md +312 -0
- package/src/tasks/ambient.d.ts +3 -0
- package/src/tasks/board-order.ts +137 -0
- package/src/tasks/dates.ts +31 -0
- package/src/tasks/define-statuses.ts +32 -0
- package/src/tasks/demo.svelte +389 -0
- package/src/tasks/detail/detail-demo.svelte +186 -0
- package/src/tasks/detail/detail-types.ts +54 -0
- package/src/tasks/detail/task-chip.svelte +28 -0
- package/src/tasks/detail/task-detail.svelte +315 -0
- package/src/tasks/detail/task-property.svelte +17 -0
- package/src/tasks/detail/task-thread.svelte +258 -0
- package/src/tasks/gantt/gantt-bar.svelte +243 -0
- package/src/tasks/gantt/gantt-grid.svelte +94 -0
- package/src/tasks/gantt/gantt-group-row.svelte +55 -0
- package/src/tasks/gantt/gantt-header.svelte +71 -0
- package/src/tasks/gantt/gantt-task-row.svelte +186 -0
- package/src/tasks/gantt/gantt.css +22 -0
- package/src/tasks/gantt/gantt.test.ts +77 -0
- package/src/tasks/gantt/logic.test.ts +163 -0
- package/src/tasks/gantt/logic.ts +248 -0
- package/src/tasks/inbox/inbox-card.svelte +283 -0
- package/src/tasks/inbox/inbox-draft.svelte +84 -0
- package/src/tasks/inbox/inbox-logic.ts +55 -0
- package/src/tasks/inbox/inbox-statuses.ts +48 -0
- package/src/tasks/inbox/inbox-trace.svelte +45 -0
- package/src/tasks/inbox/inbox-types.ts +108 -0
- package/src/tasks/inbox/inbox.svelte +203 -0
- package/src/tasks/inbox/index.ts +23 -0
- package/src/tasks/index.ts +85 -0
- package/src/tasks/kanban-board.svelte +561 -0
- package/src/tasks/kanban-column.svelte +117 -0
- package/src/tasks/kanban-drag.ts +38 -0
- package/src/tasks/kanban-types.ts +65 -0
- package/src/tasks/presets/sales.ts +16 -0
- package/src/tasks/record/demo-data.ts +286 -0
- package/src/tasks/record/field-section.svelte +53 -0
- package/src/tasks/record/fields.ts +142 -0
- package/src/tasks/record/format.ts +87 -0
- package/src/tasks/record/gutter.ts +2 -0
- package/src/tasks/record/index.ts +54 -0
- package/src/tasks/record/info-list.svelte +316 -0
- package/src/tasks/record/kinds.ts +42 -0
- package/src/tasks/record/logic.ts +324 -0
- package/src/tasks/record/next-up.svelte +70 -0
- package/src/tasks/record/project-list.svelte +133 -0
- package/src/tasks/record/record-demo.svelte +324 -0
- package/src/tasks/record/record-header.svelte +70 -0
- package/src/tasks/record/record-shell.svelte +138 -0
- package/src/tasks/record/record-stats.svelte +48 -0
- package/src/tasks/record/record-timeline.svelte +231 -0
- package/src/tasks/record/record.test.ts +350 -0
- package/src/tasks/record/steps-rail.svelte +474 -0
- package/src/tasks/record/types.ts +280 -0
- package/src/tasks/record/where-we-are.svelte +121 -0
- package/src/tasks/reorder.ts +19 -0
- package/src/tasks/side-panel-types.ts +16 -0
- package/src/tasks/side-panel.svelte +193 -0
- package/src/tasks/status-badge.svelte +63 -0
- package/src/tasks/status-dot.svelte +228 -0
- package/src/tasks/status-icon.svelte +30 -0
- package/src/tasks/status-types.ts +40 -0
- package/src/tasks/task-gantt.svelte +230 -0
- package/src/tasks/task-list.svelte +470 -0
- package/src/tasks/task-types.ts +33 -0
- package/src/tasks/time/duration.ts +69 -0
- package/src/tasks/time/time-chip.svelte +62 -0
- package/src/tasks/time/time-dot.svelte +58 -0
- package/src/tasks/time/time-ring.svelte +74 -0
- package/src/tasks/time/time-tracker.svelte +565 -0
- package/src/tasks/time/time-types.ts +74 -0
- package/src/tasks/use-kanban-dnd.svelte.ts +173 -0
- package/src/tokens/base.css +5 -5
- package/src/tokens/palette.css +115 -120
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
// WHY: each gradient needs a document-unique <defs> id; a module counter keeps
|
|
3
|
+
// SSR and hydration in lockstep (def and ref share the same value per render).
|
|
4
|
+
let gradientSeq = 0;
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
// =========================
|
|
9
|
+
// IMPORTS
|
|
10
|
+
// =========================
|
|
11
|
+
import "./gauge-chart.css";
|
|
12
|
+
import { cn } from "../lib/utils.js";
|
|
13
|
+
import AnimatedValue from "./animated-value.svelte";
|
|
14
|
+
|
|
15
|
+
// =========================
|
|
16
|
+
// TYPES
|
|
17
|
+
// =========================
|
|
18
|
+
interface Props {
|
|
19
|
+
/** Arc fill, 0-100 (how many notches light up). */
|
|
20
|
+
value: number;
|
|
21
|
+
/** "gauge" = notched arc, "ring" = continuous swept arc. */
|
|
22
|
+
variant?: "gauge" | "ring";
|
|
23
|
+
/** Show the center value/label. Off when the number sits beside the gauge. */
|
|
24
|
+
showValue?: boolean;
|
|
25
|
+
/** Active arc color (CSS color or var). Alias for `activeFill`. */
|
|
26
|
+
color?: string;
|
|
27
|
+
/** Single-hue gradient along the active arc. Alias for `useGradient`. */
|
|
28
|
+
gradient?: boolean;
|
|
29
|
+
/** Center label under the value. Alias for `defaultLabel`. */
|
|
30
|
+
label?: string;
|
|
31
|
+
/** Center statistic. Defaults to `value`. Formatted via `formatOptions`. */
|
|
32
|
+
centerValue?: number;
|
|
33
|
+
/** Notch count around the arc. */
|
|
34
|
+
totalNotches?: number;
|
|
35
|
+
/** Gap between notches as a percentage of the arc. */
|
|
36
|
+
spacing?: number;
|
|
37
|
+
/** Radial depth of the notch band as a percentage of the default. */
|
|
38
|
+
notchLengthPercent?: number;
|
|
39
|
+
/** Corner fillet in viewBox units (0 = sharp). Defaults to a soft pill. */
|
|
40
|
+
notchCornerRadius?: number;
|
|
41
|
+
/** Rectangular notches instead of angular/tapered. */
|
|
42
|
+
uniformWidth?: boolean;
|
|
43
|
+
/** Arc start in degrees (default 135, sweeping to 405 = 270deg with a bottom gap). */
|
|
44
|
+
startAngle?: number;
|
|
45
|
+
endAngle?: number;
|
|
46
|
+
/** Single-hue gradient along the active arc instead of a flat fill. */
|
|
47
|
+
useGradient?: boolean;
|
|
48
|
+
/** Hex stops for the active gradient. Defaults to a tonal ramp of `activeFill`. */
|
|
49
|
+
activeGradient?: [string, string];
|
|
50
|
+
/** Active notch color (CSS color or var). */
|
|
51
|
+
activeFill?: string;
|
|
52
|
+
/** Track notch color. Defaults to `activeFill`. */
|
|
53
|
+
inactiveFill?: string;
|
|
54
|
+
activeFillOpacity?: number;
|
|
55
|
+
inactiveFillOpacity?: number;
|
|
56
|
+
/** Center label under the value. */
|
|
57
|
+
defaultLabel?: string;
|
|
58
|
+
/** Intl formatting for the center value. */
|
|
59
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
60
|
+
locale?: string;
|
|
61
|
+
prefix?: string;
|
|
62
|
+
suffix?: string;
|
|
63
|
+
/** Fixed square size in px. Omit to fill the parent (responsive). */
|
|
64
|
+
size?: number;
|
|
65
|
+
/** Minimum width when responsive. */
|
|
66
|
+
minWidth?: number;
|
|
67
|
+
/** Accessible description, e.g. "ARR run rate". */
|
|
68
|
+
ariaLabel?: string;
|
|
69
|
+
class?: string;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// =========================
|
|
73
|
+
// PROPS
|
|
74
|
+
// =========================
|
|
75
|
+
let {
|
|
76
|
+
value,
|
|
77
|
+
variant = "gauge",
|
|
78
|
+
showValue = true,
|
|
79
|
+
color,
|
|
80
|
+
gradient,
|
|
81
|
+
label,
|
|
82
|
+
centerValue,
|
|
83
|
+
totalNotches = 40,
|
|
84
|
+
spacing = 25,
|
|
85
|
+
notchLengthPercent = 100,
|
|
86
|
+
notchCornerRadius,
|
|
87
|
+
uniformWidth = false,
|
|
88
|
+
startAngle = 135,
|
|
89
|
+
endAngle = 405,
|
|
90
|
+
useGradient = false,
|
|
91
|
+
activeGradient,
|
|
92
|
+
activeFill = "var(--chart-1)",
|
|
93
|
+
inactiveFill,
|
|
94
|
+
activeFillOpacity = 1,
|
|
95
|
+
inactiveFillOpacity = 0.12,
|
|
96
|
+
defaultLabel = "Total",
|
|
97
|
+
formatOptions,
|
|
98
|
+
locale,
|
|
99
|
+
prefix,
|
|
100
|
+
suffix,
|
|
101
|
+
size,
|
|
102
|
+
minWidth = 160,
|
|
103
|
+
ariaLabel,
|
|
104
|
+
class: className,
|
|
105
|
+
}: Props = $props();
|
|
106
|
+
|
|
107
|
+
// =========================
|
|
108
|
+
// CONST
|
|
109
|
+
// =========================
|
|
110
|
+
// Normalized 100x100 coordinate space so the SVG scales to any container.
|
|
111
|
+
const CX = 50;
|
|
112
|
+
const CY = 50;
|
|
113
|
+
const OUTER_R = 42;
|
|
114
|
+
const gradientId = `hr-gauge-grad-${(gradientSeq += 1)}`;
|
|
115
|
+
|
|
116
|
+
// =========================
|
|
117
|
+
// DERIVED
|
|
118
|
+
// =========================
|
|
119
|
+
const clamped = $derived(Math.max(0, Math.min(100, value)));
|
|
120
|
+
const center = $derived(centerValue ?? value);
|
|
121
|
+
const effFill = $derived(color ?? activeFill);
|
|
122
|
+
const effGradient = $derived(gradient ?? useGradient);
|
|
123
|
+
const effLabel = $derived(label ?? defaultLabel);
|
|
124
|
+
const band = $derived(14 * (Math.max(5, Math.min(100, notchLengthPercent)) / 100));
|
|
125
|
+
const innerR = $derived(OUTER_R - band);
|
|
126
|
+
const midR = $derived((OUTER_R + innerR) / 2);
|
|
127
|
+
const corner = $derived(notchCornerRadius ?? band * 0.22);
|
|
128
|
+
const totalAngle = $derived(endAngle - startAngle);
|
|
129
|
+
const activeCount = $derived(Math.round((clamped / 100) * totalNotches));
|
|
130
|
+
const trackFill = $derived(inactiveFill ?? effFill);
|
|
131
|
+
const activePaint = $derived(effGradient ? `url(#${gradientId})` : effFill);
|
|
132
|
+
const gradStops = $derived(
|
|
133
|
+
activeGradient ?? [`color-mix(in oklab, ${effFill}, white 45%)`, effFill],
|
|
134
|
+
);
|
|
135
|
+
// WHY: ring variant draws a single rounded arc that sweeps from empty; the
|
|
136
|
+
// stroke-dashoffset (with pathLength 100) maps 1:1 to the percent value.
|
|
137
|
+
const ringTrack = $derived(arcPath(startAngle, endAngle));
|
|
138
|
+
const ringOffset = $derived(100 - clamped);
|
|
139
|
+
|
|
140
|
+
const notches = $derived.by(() => {
|
|
141
|
+
const notchAngle = (totalAngle * (1 - spacing / 100)) / totalNotches;
|
|
142
|
+
const gapAngle = (totalAngle * (spacing / 100)) / Math.max(1, totalNotches - 1);
|
|
143
|
+
const half = (notchAngle * 0.8 * Math.PI) / 180 / 2;
|
|
144
|
+
const items: { d: string; active: boolean; index: number }[] = [];
|
|
145
|
+
for (let i = 0; i < totalNotches; i++) {
|
|
146
|
+
const angle = startAngle + i * (notchAngle + gapAngle) + notchAngle / 2;
|
|
147
|
+
items.push({
|
|
148
|
+
index: i,
|
|
149
|
+
active: i < activeCount,
|
|
150
|
+
d: notchPath(buildQuad(angle, half), corner),
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
return items;
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// =========================
|
|
157
|
+
// FUNCTIONS
|
|
158
|
+
// =========================
|
|
159
|
+
function buildQuad(
|
|
160
|
+
angleDeg: number,
|
|
161
|
+
half: number,
|
|
162
|
+
): [number, number, number, number, number, number, number, number] {
|
|
163
|
+
const rad = (angleDeg * Math.PI) / 180;
|
|
164
|
+
if (uniformWidth) {
|
|
165
|
+
// WHY: constant perpendicular half-width gives rectangular notches; the
|
|
166
|
+
// chord at the mid radius keeps them visually consistent with tapered ones.
|
|
167
|
+
const w = midR * Math.sin(half);
|
|
168
|
+
const ux = Math.cos(rad);
|
|
169
|
+
const uy = Math.sin(rad);
|
|
170
|
+
const px = -uy;
|
|
171
|
+
const py = ux;
|
|
172
|
+
const ox = CX + ux * OUTER_R;
|
|
173
|
+
const oy = CY + uy * OUTER_R;
|
|
174
|
+
const ix = CX + ux * innerR;
|
|
175
|
+
const iy = CY + uy * innerR;
|
|
176
|
+
return [
|
|
177
|
+
ox + px * w,
|
|
178
|
+
oy + py * w,
|
|
179
|
+
ox - px * w,
|
|
180
|
+
oy - py * w,
|
|
181
|
+
ix - px * w,
|
|
182
|
+
iy - py * w,
|
|
183
|
+
ix + px * w,
|
|
184
|
+
iy + py * w,
|
|
185
|
+
];
|
|
186
|
+
}
|
|
187
|
+
return [
|
|
188
|
+
CX + Math.cos(rad - half) * OUTER_R,
|
|
189
|
+
CY + Math.sin(rad - half) * OUTER_R,
|
|
190
|
+
CX + Math.cos(rad + half) * OUTER_R,
|
|
191
|
+
CY + Math.sin(rad + half) * OUTER_R,
|
|
192
|
+
CX + Math.cos(rad + half) * innerR,
|
|
193
|
+
CY + Math.sin(rad + half) * innerR,
|
|
194
|
+
CX + Math.cos(rad - half) * innerR,
|
|
195
|
+
CY + Math.sin(rad - half) * innerR,
|
|
196
|
+
];
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function arcPath(startDeg: number, endDeg: number): string {
|
|
200
|
+
const a0 = (startDeg * Math.PI) / 180;
|
|
201
|
+
const a1 = (endDeg * Math.PI) / 180;
|
|
202
|
+
const sx = CX + Math.cos(a0) * midR;
|
|
203
|
+
const sy = CY + Math.sin(a0) * midR;
|
|
204
|
+
const ex = CX + Math.cos(a1) * midR;
|
|
205
|
+
const ey = CY + Math.sin(a1) * midR;
|
|
206
|
+
const large = endDeg - startDeg > 180 ? 1 : 0;
|
|
207
|
+
return `M ${sx} ${sy} A ${midR} ${midR} 0 ${large} 1 ${ex} ${ey}`;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// WHY: rounded corners (lerp toward each vertex, then a quadratic through it)
|
|
211
|
+
// read as soft pills, matching the bklit gauge look.
|
|
212
|
+
function notchPath([x1, y1, x2, y2, x3, y3, x4, y4]: number[], cornerR: number): string {
|
|
213
|
+
if (cornerR <= 0) {
|
|
214
|
+
return `M ${x1} ${y1} L ${x2} ${y2} L ${x3} ${y3} L ${x4} ${y4} Z`;
|
|
215
|
+
}
|
|
216
|
+
const lerp = (a: number, b: number, t: number) => a + (b - a) * t;
|
|
217
|
+
const dist = (ax: number, ay: number, bx: number, by: number) => Math.hypot(bx - ax, by - ay);
|
|
218
|
+
const d12 = dist(x1, y1, x2, y2);
|
|
219
|
+
const d23 = dist(x2, y2, x3, y3);
|
|
220
|
+
const d34 = dist(x3, y3, x4, y4);
|
|
221
|
+
const d41 = dist(x4, y4, x1, y1);
|
|
222
|
+
const r1 = Math.min(cornerR / d12, 0.49);
|
|
223
|
+
const r2 = Math.min(cornerR / d23, 0.49);
|
|
224
|
+
const r3 = Math.min(cornerR / d34, 0.49);
|
|
225
|
+
const r4 = Math.min(cornerR / d41, 0.49);
|
|
226
|
+
const p = (ax: number, ay: number, bx: number, by: number, t: number) =>
|
|
227
|
+
`${lerp(ax, bx, t)} ${lerp(ay, by, t)}`;
|
|
228
|
+
return (
|
|
229
|
+
`M ${p(x1, y1, x4, y4, r4)} Q ${x1} ${y1} ${p(x1, y1, x2, y2, r1)} ` +
|
|
230
|
+
`L ${p(x2, y2, x1, y1, r1)} Q ${x2} ${y2} ${p(x2, y2, x3, y3, r2)} ` +
|
|
231
|
+
`L ${p(x3, y3, x2, y2, r2)} Q ${x3} ${y3} ${p(x3, y3, x4, y4, r3)} ` +
|
|
232
|
+
`L ${p(x4, y4, x3, y3, r3)} Q ${x4} ${y4} ${p(x4, y4, x1, y1, r4)} Z`
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
</script>
|
|
236
|
+
|
|
237
|
+
<!-- =========================== -->
|
|
238
|
+
<!-- MARKUP -->
|
|
239
|
+
<!-- =========================== -->
|
|
240
|
+
<div
|
|
241
|
+
class={cn("hr-gauge", className)}
|
|
242
|
+
style:width={size ? `${size}px` : "100%"}
|
|
243
|
+
style:min-width="{minWidth}px"
|
|
244
|
+
role="img"
|
|
245
|
+
aria-label={ariaLabel
|
|
246
|
+
? `${ariaLabel}: ${Math.round(clamped)}%`
|
|
247
|
+
: `Gauge at ${Math.round(clamped)}%`}
|
|
248
|
+
>
|
|
249
|
+
<svg viewBox="0 0 100 100" aria-hidden="true">
|
|
250
|
+
{#if effGradient}
|
|
251
|
+
<defs>
|
|
252
|
+
<linearGradient id={gradientId} gradientUnits="userSpaceOnUse" x1="8" y1="0" x2="92" y2="0">
|
|
253
|
+
<stop offset="0%" stop-color={gradStops[0]} />
|
|
254
|
+
<stop offset="100%" stop-color={gradStops[1]} />
|
|
255
|
+
</linearGradient>
|
|
256
|
+
</defs>
|
|
257
|
+
{/if}
|
|
258
|
+
{#if variant === "ring"}
|
|
259
|
+
<path
|
|
260
|
+
class="ring-track"
|
|
261
|
+
d={ringTrack}
|
|
262
|
+
stroke={trackFill}
|
|
263
|
+
stroke-opacity={inactiveFillOpacity}
|
|
264
|
+
style:stroke-width="{band}px"
|
|
265
|
+
/>
|
|
266
|
+
<path
|
|
267
|
+
class="ring-fill"
|
|
268
|
+
d={ringTrack}
|
|
269
|
+
pathLength="100"
|
|
270
|
+
stroke={activePaint}
|
|
271
|
+
style:stroke-width="{band}px"
|
|
272
|
+
style:stroke-dashoffset={ringOffset}
|
|
273
|
+
/>
|
|
274
|
+
{:else}
|
|
275
|
+
{#each notches as notch (notch.index)}
|
|
276
|
+
<path class="track" d={notch.d} fill={trackFill} fill-opacity={inactiveFillOpacity} />
|
|
277
|
+
{/each}
|
|
278
|
+
{#each notches as notch (notch.index)}
|
|
279
|
+
{#if notch.active}
|
|
280
|
+
<path
|
|
281
|
+
class="fill"
|
|
282
|
+
d={notch.d}
|
|
283
|
+
fill={activePaint}
|
|
284
|
+
fill-opacity={activeFillOpacity}
|
|
285
|
+
style:animation-delay="{100 + notch.index * 18}ms"
|
|
286
|
+
/>
|
|
287
|
+
{/if}
|
|
288
|
+
{/each}
|
|
289
|
+
{/if}
|
|
290
|
+
</svg>
|
|
291
|
+
|
|
292
|
+
{#if showValue}
|
|
293
|
+
<div class="center">
|
|
294
|
+
<span class="value">
|
|
295
|
+
<AnimatedValue value={center} {formatOptions} {locale} {prefix} {suffix} />
|
|
296
|
+
</span>
|
|
297
|
+
{#if effLabel}
|
|
298
|
+
<span class="label">{effLabel}</span>
|
|
299
|
+
{/if}
|
|
300
|
+
</div>
|
|
301
|
+
{/if}
|
|
302
|
+
</div>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { describe, expect, it } from "vite-plus/test";
|
|
2
|
+
import { hoverBand } from "./hover-band.js";
|
|
3
|
+
|
|
4
|
+
const center = (b: { x: number; width: number } | null) => (b ? b.x + b.width / 2 : NaN);
|
|
5
|
+
|
|
6
|
+
describe("hoverBand", () => {
|
|
7
|
+
it("centers on the point when the gaps are even", () => {
|
|
8
|
+
expect(hoverBand([0, 100, 200], 1, 300)).toEqual({ x: 20, width: 160 });
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it("stays centered when the gaps differ", () => {
|
|
12
|
+
const b = hoverBand([0, 40, 200], 1, 300);
|
|
13
|
+
expect(center(b)).toBe(40);
|
|
14
|
+
expect(b?.width).toBe(64);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("stays centered at either end of the line", () => {
|
|
18
|
+
expect(center(hoverBand([0, 100, 200], 0, 300))).toBe(0);
|
|
19
|
+
expect(center(hoverBand([0, 100, 200], 2, 300))).toBe(200);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("falls back to the plot width for a single point", () => {
|
|
23
|
+
expect(hoverBand([50], 0, 100)).toEqual({ x: -30, width: 160 });
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it("returns null for an index off the data", () => {
|
|
27
|
+
expect(hoverBand([0, 100], -1, 300)).toBeNull();
|
|
28
|
+
expect(hoverBand([0, 100], 2, 300)).toBeNull();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** How far the hover band reaches each side of the point, as a share of the gap to its neighbour. */
|
|
2
|
+
export const HOVER_BAND_REACH = 0.8;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The hovered segment's clip, centered on the point at `xs[i]`.
|
|
6
|
+
* Both sides take the shorter neighbour gap, so the dot always sits in the middle.
|
|
7
|
+
*/
|
|
8
|
+
export function hoverBand(
|
|
9
|
+
xs: number[],
|
|
10
|
+
i: number,
|
|
11
|
+
width: number,
|
|
12
|
+
reach = HOVER_BAND_REACH,
|
|
13
|
+
): { x: number; width: number } | null {
|
|
14
|
+
if (i < 0 || i >= xs.length) return null;
|
|
15
|
+
const at = xs[i];
|
|
16
|
+
const before = i > 0 ? at - xs[i - 1] : Infinity;
|
|
17
|
+
const after = i < xs.length - 1 ? xs[i + 1] - at : Infinity;
|
|
18
|
+
const gap = Math.min(before, after);
|
|
19
|
+
const half = (Number.isFinite(gap) ? gap : width) * reach;
|
|
20
|
+
return { x: at - half, width: half * 2 };
|
|
21
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// =========================
|
|
3
|
+
// IMPORTS
|
|
4
|
+
// =========================
|
|
5
|
+
import { getChartContext } from "layerchart";
|
|
6
|
+
import type { Snippet } from "svelte";
|
|
7
|
+
import { prefersReducedMotion, Spring } from "svelte/motion";
|
|
8
|
+
import { fade } from "svelte/transition";
|
|
9
|
+
import { HOVER_BAND_REACH, hoverBand } from "./hover-band.js";
|
|
10
|
+
|
|
11
|
+
// =========================
|
|
12
|
+
// TYPES
|
|
13
|
+
// =========================
|
|
14
|
+
interface Props {
|
|
15
|
+
/** The series: dims while a point is hovered. */
|
|
16
|
+
children: Snippet;
|
|
17
|
+
/** The strokes alone, redrawn at full strength around the hovered point. */
|
|
18
|
+
segment: Snippet;
|
|
19
|
+
/** Headroom above and below the plot so a thick stroke is not cut. */
|
|
20
|
+
bleed?: number;
|
|
21
|
+
/** How far the band reaches each side of the point, as a share of the gap to its neighbour. */
|
|
22
|
+
reach?: number;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// =========================
|
|
26
|
+
// PROPS
|
|
27
|
+
// =========================
|
|
28
|
+
let { children, segment, bleed = 6, reach = HOVER_BAND_REACH }: Props = $props();
|
|
29
|
+
|
|
30
|
+
// =========================
|
|
31
|
+
// STATE
|
|
32
|
+
// =========================
|
|
33
|
+
const ctx = getChartContext();
|
|
34
|
+
const id = `hr-focus-${Math.random().toString(36).slice(2, 8)}`;
|
|
35
|
+
const left = new Spring(0, { stiffness: 0.2, damping: 0.85 });
|
|
36
|
+
const width = new Spring(0, { stiffness: 0.2, damping: 0.85 });
|
|
37
|
+
|
|
38
|
+
// =========================
|
|
39
|
+
// DERIVED
|
|
40
|
+
// =========================
|
|
41
|
+
const band = $derived.by(() => {
|
|
42
|
+
const d = ctx.tooltip.data;
|
|
43
|
+
const xs = (ctx.data as unknown[]).map((r) => Number(ctx.xGet(r)));
|
|
44
|
+
// WHY by x and not indexOf: ctx.data hands back proxies, so identity never matches.
|
|
45
|
+
const at = d ? Number(ctx.xGet(d)) : NaN;
|
|
46
|
+
return hoverBand(xs, xs.indexOf(at), ctx.width, reach);
|
|
47
|
+
});
|
|
48
|
+
const duration = $derived(prefersReducedMotion.current ? 0 : 400);
|
|
49
|
+
|
|
50
|
+
// =========================
|
|
51
|
+
// EFFECTS
|
|
52
|
+
// =========================
|
|
53
|
+
// WHY instant on first hover: the clip should open where the pointer is, not
|
|
54
|
+
// slide in from wherever it last closed.
|
|
55
|
+
let wasOn = false;
|
|
56
|
+
$effect(() => {
|
|
57
|
+
if (!band) {
|
|
58
|
+
wasOn = false;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const instant = !wasOn || prefersReducedMotion.current;
|
|
62
|
+
left.set(band.x, { instant });
|
|
63
|
+
width.set(band.width, { instant });
|
|
64
|
+
wasOn = true;
|
|
65
|
+
});
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<!-- =========================== -->
|
|
69
|
+
<!-- HOVER FOCUS -->
|
|
70
|
+
<!-- =========================== -->
|
|
71
|
+
<g class="hr-hover-dim" class:hr-hover-dimmed={band !== null}>
|
|
72
|
+
{@render children()}
|
|
73
|
+
</g>
|
|
74
|
+
<!-- WHY outside the if: the segment fades out after hover ends, and without its
|
|
75
|
+
clip it would flash as the whole line. -->
|
|
76
|
+
<defs>
|
|
77
|
+
<clipPath {id}>
|
|
78
|
+
<rect x={left.current} y={-bleed} width={width.current} height={ctx.height + bleed * 2} />
|
|
79
|
+
</clipPath>
|
|
80
|
+
</defs>
|
|
81
|
+
{#if band}
|
|
82
|
+
<g clip-path="url(#{id})" transition:fade={{ duration }}>
|
|
83
|
+
{@render segment()}
|
|
84
|
+
</g>
|
|
85
|
+
{/if}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import "./charts.css";
|
|
2
|
+
|
|
3
|
+
export { default as BarChart } from "./bar-chart.svelte";
|
|
4
|
+
export { default as AreaChart } from "./area-chart.svelte";
|
|
5
|
+
export { default as LineChart } from "./line-chart.svelte";
|
|
6
|
+
export { default as DonutChart } from "./donut-chart.svelte";
|
|
7
|
+
export { default as Sparkline } from "./sparkline.svelte";
|
|
8
|
+
export { default as TimeSeriesChart } from "./time-series-chart.svelte";
|
|
9
|
+
export { default as GaugeChart } from "./gauge-chart.svelte";
|
|
10
|
+
export { default as RingChart } from "./ring-chart.svelte";
|
|
11
|
+
export { default as Legend } from "./legend.svelte";
|
|
12
|
+
export { type ChartReference } from "./reference-line.svelte";
|
|
13
|
+
export { default as StatCard } from "./stat-card.svelte";
|
|
14
|
+
export { default as NumberChart, type NumberDirection } from "./number-chart.svelte";
|
|
15
|
+
export { default as Figure } from "./figure.svelte";
|
|
16
|
+
export { default as TrendPill } from "./trend-pill.svelte";
|
|
17
|
+
export { default as AnimatedValue } from "./animated-value.svelte";
|
|
18
|
+
export { default as EdgeFade } from "./edge-fade.svelte";
|
|
19
|
+
export { resolveEdgeFade, EDGE_FADE_DEFAULT } from "./edge-fade.js";
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
ChartContainer,
|
|
23
|
+
ChartTooltip,
|
|
24
|
+
ChartStyle,
|
|
25
|
+
type ChartConfig,
|
|
26
|
+
type TooltipSeriesItem,
|
|
27
|
+
getPayloadConfigFromPayload,
|
|
28
|
+
useChart,
|
|
29
|
+
setChartContext,
|
|
30
|
+
THEMES,
|
|
31
|
+
} from "./primitives/index.js";
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/* Styles for Legend. Plain stylesheet (see area-chart.css for why). Selectors
|
|
2
|
+
are namespaced under `.hr-legend`; the `.horizontal` layout modifier sits on
|
|
3
|
+
the same root element. */
|
|
4
|
+
|
|
5
|
+
.hr-legend {
|
|
6
|
+
width: 100%;
|
|
7
|
+
font-size: 0.8125rem;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.hr-legend-title {
|
|
11
|
+
margin: 0 0 0.625rem;
|
|
12
|
+
font-size: 0.8125rem;
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
color: var(--foreground);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.hr-legend-items {
|
|
18
|
+
list-style: none;
|
|
19
|
+
margin: 0;
|
|
20
|
+
padding: 0;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
gap: 0.125rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.hr-legend.horizontal .hr-legend-items {
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
flex-wrap: wrap;
|
|
29
|
+
gap: 0.5rem 1rem;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.hr-legend-item {
|
|
33
|
+
width: 100%;
|
|
34
|
+
display: grid;
|
|
35
|
+
grid-template-columns: auto 1fr auto;
|
|
36
|
+
align-items: center;
|
|
37
|
+
gap: 0.5rem 0.625rem;
|
|
38
|
+
padding: 0.375rem 0.5rem;
|
|
39
|
+
border: 0;
|
|
40
|
+
border-radius: 0.5rem;
|
|
41
|
+
background: transparent;
|
|
42
|
+
font: inherit;
|
|
43
|
+
color: var(--foreground);
|
|
44
|
+
text-align: left;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
transition:
|
|
47
|
+
background 160ms ease,
|
|
48
|
+
opacity 160ms ease;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.hr-legend.horizontal .hr-legend-item {
|
|
52
|
+
width: auto;
|
|
53
|
+
grid-template-columns: auto auto;
|
|
54
|
+
padding: 0.25rem 0.375rem;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.hr-legend-item:focus-visible {
|
|
58
|
+
background: var(--muted);
|
|
59
|
+
outline: none;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media (hover: hover) and (pointer: fine) {
|
|
63
|
+
.hr-legend-item:hover {
|
|
64
|
+
background: var(--muted);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.hr-legend-item.dimmed {
|
|
69
|
+
opacity: 0.4;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.hr-legend-marker {
|
|
73
|
+
width: 0.625rem;
|
|
74
|
+
height: 0.625rem;
|
|
75
|
+
border-radius: 3px;
|
|
76
|
+
flex-shrink: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.hr-legend-label {
|
|
80
|
+
font-weight: 500;
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
text-overflow: ellipsis;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.hr-legend-value {
|
|
87
|
+
display: inline-flex;
|
|
88
|
+
align-items: baseline;
|
|
89
|
+
gap: 0.3125rem;
|
|
90
|
+
font-variant-numeric: tabular-nums;
|
|
91
|
+
color: var(--foreground);
|
|
92
|
+
white-space: nowrap;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.hr-legend-pct {
|
|
96
|
+
font-size: 0.6875rem;
|
|
97
|
+
color: var(--muted-foreground);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.hr-legend-track {
|
|
101
|
+
grid-column: 1 / -1;
|
|
102
|
+
height: 0.375rem;
|
|
103
|
+
border-radius: 999px;
|
|
104
|
+
background: var(--muted);
|
|
105
|
+
overflow: hidden;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.hr-legend-bar {
|
|
109
|
+
display: block;
|
|
110
|
+
width: 100%;
|
|
111
|
+
height: 100%;
|
|
112
|
+
border-radius: 999px;
|
|
113
|
+
/* WHY: scaleX from the left avoids the layout thrash of animating width;
|
|
114
|
+
the bar's fill fraction is set inline as --hr-bar-scale. The entrance
|
|
115
|
+
sweeps from 0 once (delays match the ring sweep); the transition takes
|
|
116
|
+
over for later data changes. */
|
|
117
|
+
transform-origin: left center;
|
|
118
|
+
transform: scaleX(var(--hr-bar-scale, 0));
|
|
119
|
+
animation: hr-legend-fill var(--chart-motion-reveal, 1100ms)
|
|
120
|
+
var(--chart-ease-reveal, cubic-bezier(0.85, 0, 0.15, 1)) both;
|
|
121
|
+
transition: transform var(--chart-motion-slow, 1.1s)
|
|
122
|
+
var(--chart-ease-out, cubic-bezier(0.22, 1, 0.36, 1));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@keyframes hr-legend-fill {
|
|
126
|
+
from {
|
|
127
|
+
transform: scaleX(0);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@media (prefers-reduced-motion: reduce) {
|
|
132
|
+
.hr-legend-bar {
|
|
133
|
+
animation: none;
|
|
134
|
+
transition: none;
|
|
135
|
+
}
|
|
136
|
+
}
|