@heyramzi/ui 0.0.0-stage → 6.1.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 +141 -0
- package/README.md +130 -2
- package/package.json +215 -3
- package/scripts/lib/sync-core.mjs +113 -0
- package/scripts/relative-imports.mjs +39 -0
- package/scripts/sf-symbol.mjs +93 -0
- package/scripts/sync-shadcn.mjs +341 -0
- package/scripts/sync-transitions.mjs +146 -0
- package/scripts/validate-apple-symbol-exports.mjs +45 -0
- package/src/agents/agent-avatar.svelte +639 -0
- package/src/agents/agent-cast.svelte +173 -0
- package/src/agents/demo.svelte +78 -0
- package/src/agents/index.ts +11 -0
- package/src/agents/types.ts +72 -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/composer/Composer.css +108 -0
- package/src/ai/composer/Composer.svelte +111 -0
- package/src/ai/composer/index.ts +10 -0
- package/src/ai/confirmation/Confirmation.svelte +54 -0
- package/src/ai/confirmation/ConfirmationAccepted.svelte +23 -0
- package/src/ai/confirmation/ConfirmationAction.svelte +53 -0
- package/src/ai/confirmation/ConfirmationActions.svelte +24 -0
- package/src/ai/confirmation/ConfirmationFailed.svelte +23 -0
- package/src/ai/confirmation/ConfirmationRejected.svelte +23 -0
- package/src/ai/confirmation/ConfirmationRequest.svelte +25 -0
- package/src/ai/confirmation/ConfirmationTitle.svelte +25 -0
- package/src/ai/confirmation/confirmation-context.svelte.ts +22 -0
- package/src/ai/confirmation/index.ts +50 -0
- package/src/ai/conversation/Conversation.svelte +28 -0
- package/src/ai/conversation/ConversationContent.svelte +35 -0
- package/src/ai/conversation/ConversationEmptyState.svelte +46 -0
- package/src/ai/conversation/ConversationScrollButton.svelte +51 -0
- package/src/ai/conversation/index.ts +33 -0
- package/src/ai/conversation/stick-to-bottom-context.svelte.ts +131 -0
- package/src/ai/index.ts +119 -0
- package/src/ai/loading-state/PixelLoader.svelte +138 -0
- package/src/ai/loading-state/index.ts +5 -0
- package/src/ai/prompt-input/PromptInput.svelte +38 -0
- package/src/ai/prompt-input/PromptInputBody.svelte +19 -0
- package/src/ai/prompt-input/PromptInputSubmit.svelte +73 -0
- package/src/ai/prompt-input/PromptInputTextarea.svelte +74 -0
- package/src/ai/prompt-input/PromptInputToolbar.svelte +19 -0
- package/src/ai/prompt-input/index.ts +34 -0
- package/src/ai/reasoning/Reasoning.svelte +47 -0
- package/src/ai/reasoning/ReasoningContent.svelte +27 -0
- package/src/ai/reasoning/ReasoningTrigger.svelte +48 -0
- package/src/ai/reasoning/index.ts +22 -0
- package/src/ai/reasoning/reasoning-context.svelte.ts +20 -0
- package/src/ai/response/Response.css +32 -0
- package/src/ai/response/Response.svelte +130 -0
- package/src/ai/response/index.ts +5 -0
- package/src/ai/suggestion/Suggestion.svelte +43 -0
- package/src/ai/suggestion/Suggestions.svelte +25 -0
- package/src/ai/suggestion/index.ts +14 -0
- package/src/ai/thinking-dots/ThinkingDots.svelte +42 -0
- package/src/ai/thinking-dots/index.ts +5 -0
- package/src/ai/typing-dots/TypingDots.css +39 -0
- package/src/ai/typing-dots/TypingDots.svelte +27 -0
- package/src/ai/typing-dots/index.ts +10 -0
- package/src/ai/voice-waveform/VoiceWaveform.css +40 -0
- package/src/ai/voice-waveform/VoiceWaveform.svelte +46 -0
- package/src/ai/voice-waveform/index.ts +5 -0
- package/src/animations/README.md +84 -0
- package/src/animations/accordion.css +58 -0
- package/src/animations/avatar-group-hover.css +47 -0
- package/src/animations/card-tilt.css +74 -0
- package/src/animations/digit-pop-in.css +78 -0
- package/src/animations/dropdown.css +121 -0
- package/src/animations/icon-swap.css +43 -0
- package/src/animations/index.css +34 -0
- package/src/animations/input-clear-dissolve.css +86 -0
- package/src/animations/input-shake.css +114 -0
- package/src/animations/learn-more-hover.css +48 -0
- package/src/animations/like-button.css +93 -0
- package/src/animations/modal.css +75 -0
- package/src/animations/notification-badge.css +81 -0
- package/src/animations/page-side-by-side.css +63 -0
- package/src/animations/panel.css +86 -0
- package/src/animations/plus-menu-morph.css +97 -0
- package/src/animations/reasoning-stream.css +49 -0
- package/src/animations/resize.css +20 -0
- package/src/animations/shimmer-text.css +72 -0
- package/src/animations/skeleton-reveal.css +97 -0
- package/src/animations/spinning-counter.css +52 -0
- package/src/animations/streaming-text.css +31 -0
- package/src/animations/success-check.css +120 -0
- package/src/animations/tabs-sliding.css +83 -0
- package/src/animations/text-swap.css +40 -0
- package/src/animations/text-swap.ts +40 -0
- package/src/animations/texts-reveal.css +70 -0
- package/src/animations/thinking-states.css +65 -0
- package/src/animations/tooltip.css +72 -0
- package/src/animations/upstream-coverage.test.ts +65 -0
- package/src/animations/view-transition-reveal.ts +74 -0
- package/src/charts/animated-value.css +7 -0
- package/src/charts/animated-value.svelte +110 -0
- package/src/charts/area-chart.css +29 -0
- package/src/charts/area-chart.svelte +195 -0
- package/src/charts/bar-chart.css +119 -0
- package/src/charts/bar-chart.svelte +269 -0
- package/src/charts/charts.css +201 -0
- package/src/charts/crosshair.svelte +35 -0
- package/src/charts/donut-chart.css +56 -0
- package/src/charts/donut-chart.svelte +158 -0
- package/src/charts/edge-fade.svelte +43 -0
- package/src/charts/edge-fade.ts +16 -0
- package/src/charts/figure.css +100 -0
- package/src/charts/figure.svelte +122 -0
- package/src/charts/gauge-chart.css +94 -0
- package/src/charts/gauge-chart.svelte +303 -0
- package/src/charts/hover-band.test.ts +30 -0
- package/src/charts/hover-band.ts +21 -0
- package/src/charts/hover-focus.svelte +85 -0
- package/src/charts/index.ts +30 -0
- package/src/charts/legend.css +131 -0
- package/src/charts/legend.svelte +112 -0
- package/src/charts/line-chart.css +26 -0
- package/src/charts/line-chart.svelte +256 -0
- package/src/charts/motion.ts +19 -0
- package/src/charts/number-chart.css +168 -0
- package/src/charts/number-chart.svelte +177 -0
- package/src/charts/primitives/chart-container.svelte +57 -0
- package/src/charts/primitives/chart-style.svelte +36 -0
- package/src/charts/primitives/chart-tooltip.svelte +161 -0
- package/src/charts/primitives/chart-utils.ts +54 -0
- package/src/charts/primitives/index.ts +11 -0
- package/src/charts/reveal.svelte +61 -0
- package/src/charts/ring-chart.css +96 -0
- package/src/charts/ring-chart.svelte +158 -0
- package/src/charts/sparkline.css +45 -0
- package/src/charts/sparkline.svelte +140 -0
- package/src/charts/stat-card.css +103 -0
- package/src/charts/stat-card.svelte +267 -0
- package/src/charts/time-series-chart.css +28 -0
- package/src/charts/time-series-chart.svelte +179 -0
- package/src/charts/trend-pill.css +38 -0
- package/src/charts/trend-pill.svelte +48 -0
- package/src/design/index.css +270 -0
- package/src/design/polish.css +159 -0
- package/src/effects/animated-beam/AnimatedBeam.svelte +132 -0
- package/src/effects/animated-beam/diagrams/BeamSvg.svelte +91 -0
- package/src/effects/animated-beam/index.ts +2 -0
- package/src/effects/animated-beam/path-calculator.svelte.ts +70 -0
- package/src/effects/animated-beam/types.ts +23 -0
- package/src/effects/border-beam/BorderBeam.svelte +223 -0
- package/src/effects/border-beam/css.test.ts +46 -0
- package/src/effects/border-beam/css.ts +574 -0
- package/src/effects/border-beam/presets.ts +699 -0
- package/src/effects/border-beam/register-properties.test.ts +74 -0
- package/src/effects/border-beam/register-properties.ts +73 -0
- package/src/effects/border-beam/types.ts +38 -0
- package/src/effects/image-comparison/ImageComparison.css +66 -0
- package/src/effects/image-comparison/ImageComparison.svelte +92 -0
- package/src/effects/image-reveal/ImageReveal.css +10 -0
- package/src/effects/image-reveal/ImageReveal.svelte +357 -0
- package/src/effects/image-reveal/index.ts +2 -0
- package/src/effects/image-reveal/types.ts +35 -0
- package/src/effects/magnetic/magnetic.ts +81 -0
- package/src/effects/marquee/Marquee.css +52 -0
- package/src/effects/marquee/Marquee.svelte +96 -0
- package/src/effects/progressive-blur/ProgressiveBlur.css +9 -0
- package/src/effects/progressive-blur/ProgressiveBlur.svelte +63 -0
- package/src/effects/reveal/AnimatedGroup.svelte +101 -0
- package/src/effects/reveal/InView.svelte +77 -0
- package/src/effects/reveal/TextEffect.svelte +142 -0
- package/src/effects/reveal/index.ts +10 -0
- package/src/effects/reveal/observe.ts +33 -0
- package/src/effects/reveal/reveal.css +141 -0
- package/src/effects/reveal/types.ts +25 -0
- package/src/effects/shader-gradient/ShaderGradient.svelte +227 -0
- package/src/effects/shader-gradient/color.ts +44 -0
- package/src/effects/shader-gradient/index.ts +5 -0
- package/src/effects/shader-gradient/renderer.ts +456 -0
- package/src/effects/shader-gradient/shaders.ts +324 -0
- package/src/effects/shader-gradient/types.ts +68 -0
- package/src/effects/spotlight/Spotlight.css +14 -0
- package/src/effects/spotlight/Spotlight.svelte +61 -0
- package/src/effects/theme-toggle/ThemeToggle.css +21 -0
- package/src/effects/theme-toggle/ThemeToggle.svelte +101 -0
- package/src/icons/TradeIcon.svelte +16 -0
- package/src/icons/apple-symbol-exports.ts +135 -0
- package/src/icons/sf-symbols.ts +527 -0
- package/src/icons/trades.ts +89 -0
- package/src/index.ts +49 -0
- package/src/lib/arrive.ts +26 -0
- package/src/lib/hooks/is-mobile.svelte.ts +11 -0
- package/src/lib/icon-types.ts +17 -0
- package/src/lib/layout.ts +8 -0
- package/src/lib/panel.ts +15 -0
- package/src/lib/theme-transition.ts +51 -0
- package/src/lib/utils.ts +45 -0
- package/src/shadcn/accordion/accordion-content.svelte +22 -0
- package/src/shadcn/accordion/accordion-item.svelte +17 -0
- package/src/shadcn/accordion/accordion-trigger.svelte +35 -0
- package/src/shadcn/accordion/accordion.svelte +19 -0
- package/src/shadcn/accordion/index.ts +16 -0
- package/src/shadcn/alert/alert-description.svelte +23 -0
- package/src/shadcn/alert/alert-title.svelte +20 -0
- package/src/shadcn/alert/alert.svelte +44 -0
- package/src/shadcn/alert/index.ts +14 -0
- package/src/shadcn/alert-dialog/alert-dialog-action.svelte +18 -0
- package/src/shadcn/alert-dialog/alert-dialog-cancel.svelte +18 -0
- package/src/shadcn/alert-dialog/alert-dialog-content.svelte +29 -0
- package/src/shadcn/alert-dialog/alert-dialog-description.svelte +17 -0
- package/src/shadcn/alert-dialog/alert-dialog-footer.svelte +20 -0
- package/src/shadcn/alert-dialog/alert-dialog-header.svelte +20 -0
- package/src/shadcn/alert-dialog/alert-dialog-overlay.svelte +17 -0
- package/src/shadcn/alert-dialog/alert-dialog-portal.svelte +7 -0
- package/src/shadcn/alert-dialog/alert-dialog-title.svelte +17 -0
- package/src/shadcn/alert-dialog/alert-dialog-trigger.svelte +7 -0
- package/src/shadcn/alert-dialog/alert-dialog.svelte +7 -0
- package/src/shadcn/alert-dialog/index.ts +37 -0
- package/src/shadcn/attachment/attachment-action.svelte +23 -0
- package/src/shadcn/attachment/attachment-actions.svelte +23 -0
- package/src/shadcn/attachment/attachment-content.svelte +23 -0
- package/src/shadcn/attachment/attachment-description.svelte +23 -0
- package/src/shadcn/attachment/attachment-group.svelte +23 -0
- package/src/shadcn/attachment/attachment-media.svelte +44 -0
- package/src/shadcn/attachment/attachment-title.svelte +23 -0
- package/src/shadcn/attachment/attachment-trigger.svelte +29 -0
- package/src/shadcn/attachment/attachment.svelte +55 -0
- package/src/shadcn/attachment/index.ts +40 -0
- package/src/shadcn/avatar/avatar-badge.svelte +26 -0
- package/src/shadcn/avatar/avatar-fallback.svelte +20 -0
- package/src/shadcn/avatar/avatar-group-count.svelte +23 -0
- package/src/shadcn/avatar/avatar-group.svelte +23 -0
- package/src/shadcn/avatar/avatar-image.svelte +17 -0
- package/src/shadcn/avatar/avatar.svelte +26 -0
- package/src/shadcn/avatar/index.ts +22 -0
- package/src/shadcn/badge/badge.svelte +53 -0
- package/src/shadcn/badge/index.ts +2 -0
- package/src/shadcn/breadcrumb/breadcrumb-ellipsis.svelte +23 -0
- package/src/shadcn/breadcrumb/breadcrumb-item.svelte +20 -0
- package/src/shadcn/breadcrumb/breadcrumb-link.svelte +31 -0
- package/src/shadcn/breadcrumb/breadcrumb-list.svelte +23 -0
- package/src/shadcn/breadcrumb/breadcrumb-page.svelte +23 -0
- package/src/shadcn/breadcrumb/breadcrumb-separator.svelte +27 -0
- package/src/shadcn/breadcrumb/breadcrumb.svelte +21 -0
- package/src/shadcn/breadcrumb/index.ts +25 -0
- package/src/shadcn/bubble/bubble-content.svelte +31 -0
- package/src/shadcn/bubble/bubble-group.svelte +20 -0
- package/src/shadcn/bubble/bubble-reactions.svelte +52 -0
- package/src/shadcn/bubble/bubble.svelte +58 -0
- package/src/shadcn/bubble/index.ts +25 -0
- package/src/shadcn/button/button.svelte +121 -0
- package/src/shadcn/button/index.ts +17 -0
- package/src/shadcn/calendar/calendar-caption.svelte +76 -0
- package/src/shadcn/calendar/calendar-cell.svelte +19 -0
- package/src/shadcn/calendar/calendar-day.svelte +35 -0
- package/src/shadcn/calendar/calendar-grid-body.svelte +12 -0
- package/src/shadcn/calendar/calendar-grid-head.svelte +12 -0
- package/src/shadcn/calendar/calendar-grid-row.svelte +12 -0
- package/src/shadcn/calendar/calendar-grid.svelte +16 -0
- package/src/shadcn/calendar/calendar-head-cell.svelte +19 -0
- package/src/shadcn/calendar/calendar-header.svelte +19 -0
- package/src/shadcn/calendar/calendar-heading.svelte +16 -0
- package/src/shadcn/calendar/calendar-month-select.svelte +44 -0
- package/src/shadcn/calendar/calendar-month.svelte +15 -0
- package/src/shadcn/calendar/calendar-months.svelte +19 -0
- package/src/shadcn/calendar/calendar-nav.svelte +19 -0
- package/src/shadcn/calendar/calendar-next-button.svelte +31 -0
- package/src/shadcn/calendar/calendar-prev-button.svelte +31 -0
- package/src/shadcn/calendar/calendar-year-select.svelte +43 -0
- package/src/shadcn/calendar/calendar.svelte +118 -0
- package/src/shadcn/calendar/index.ts +40 -0
- package/src/shadcn/card/card-action.svelte +23 -0
- package/src/shadcn/card/card-content.svelte +20 -0
- package/src/shadcn/card/card-description.svelte +20 -0
- package/src/shadcn/card/card-footer.svelte +23 -0
- package/src/shadcn/card/card-header.svelte +23 -0
- package/src/shadcn/card/card-title.svelte +29 -0
- package/src/shadcn/card/card.svelte +25 -0
- package/src/shadcn/card/index.ts +25 -0
- package/src/shadcn/checkbox/checkbox.svelte +38 -0
- package/src/shadcn/checkbox/index.ts +6 -0
- package/src/shadcn/collapsible/collapsible-content.svelte +7 -0
- package/src/shadcn/collapsible/collapsible-trigger.svelte +7 -0
- package/src/shadcn/collapsible/collapsible.svelte +11 -0
- package/src/shadcn/collapsible/index.ts +13 -0
- package/src/shadcn/command/command-dialog.svelte +66 -0
- package/src/shadcn/command/command-empty.svelte +17 -0
- package/src/shadcn/command/command-group.svelte +40 -0
- package/src/shadcn/command/command-input.svelte +64 -0
- package/src/shadcn/command/command-item.svelte +37 -0
- package/src/shadcn/command/command-link-item.svelte +20 -0
- package/src/shadcn/command/command-list.svelte +20 -0
- package/src/shadcn/command/command-loading.svelte +7 -0
- package/src/shadcn/command/command-separator.svelte +17 -0
- package/src/shadcn/command/command-shortcut.svelte +23 -0
- package/src/shadcn/command/command.svelte +28 -0
- package/src/shadcn/command/index.ts +37 -0
- package/src/shadcn/context-menu/context-menu-checkbox-item.svelte +41 -0
- package/src/shadcn/context-menu/context-menu-content.svelte +28 -0
- package/src/shadcn/context-menu/context-menu-group-heading.svelte +21 -0
- package/src/shadcn/context-menu/context-menu-group.svelte +7 -0
- package/src/shadcn/context-menu/context-menu-item.svelte +27 -0
- package/src/shadcn/context-menu/context-menu-label.svelte +27 -0
- package/src/shadcn/context-menu/context-menu-portal.svelte +7 -0
- package/src/shadcn/context-menu/context-menu-radio-group.svelte +16 -0
- package/src/shadcn/context-menu/context-menu-radio-item.svelte +35 -0
- package/src/shadcn/context-menu/context-menu-separator.svelte +17 -0
- package/src/shadcn/context-menu/context-menu-shortcut.svelte +23 -0
- package/src/shadcn/context-menu/context-menu-sub-content.svelte +25 -0
- package/src/shadcn/context-menu/context-menu-sub-trigger.svelte +29 -0
- package/src/shadcn/context-menu/context-menu-sub.svelte +7 -0
- package/src/shadcn/context-menu/context-menu-trigger.svelte +17 -0
- package/src/shadcn/context-menu/context-menu.svelte +7 -0
- package/src/shadcn/context-menu/index.ts +52 -0
- package/src/shadcn/dialog/dialog-close.svelte +11 -0
- package/src/shadcn/dialog/dialog-content.svelte +57 -0
- package/src/shadcn/dialog/dialog-description.svelte +20 -0
- package/src/shadcn/dialog/dialog-footer.svelte +32 -0
- package/src/shadcn/dialog/dialog-header.svelte +20 -0
- package/src/shadcn/dialog/dialog-overlay.svelte +20 -0
- package/src/shadcn/dialog/dialog-portal.svelte +7 -0
- package/src/shadcn/dialog/dialog-title.svelte +17 -0
- package/src/shadcn/dialog/dialog-trigger.svelte +11 -0
- package/src/shadcn/dialog/dialog.svelte +7 -0
- package/src/shadcn/dialog/index.ts +34 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-checkbox-group.svelte +16 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-checkbox-item.svelte +43 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-content.svelte +31 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-group-heading.svelte +22 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-group.svelte +7 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-item.svelte +29 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-label.svelte +27 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-portal.svelte +7 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-radio-group.svelte +16 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-radio-item.svelte +34 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-separator.svelte +17 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-shortcut.svelte +23 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-sub-content.svelte +20 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-sub-trigger.svelte +29 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-sub.svelte +7 -0
- package/src/shadcn/dropdown-menu/dropdown-menu-trigger.svelte +7 -0
- package/src/shadcn/dropdown-menu/dropdown-menu.svelte +7 -0
- package/src/shadcn/dropdown-menu/index.ts +56 -0
- package/src/shadcn/dropdown-menu/menu-item.ts +43 -0
- package/src/shadcn/empty/empty-content.svelte +23 -0
- package/src/shadcn/empty/empty-description.svelte +23 -0
- package/src/shadcn/empty/empty-header.svelte +20 -0
- package/src/shadcn/empty/empty-media.svelte +41 -0
- package/src/shadcn/empty/empty-title.svelte +20 -0
- package/src/shadcn/empty/empty.svelte +23 -0
- package/src/shadcn/empty/index.ts +22 -0
- package/src/shadcn/field/field-content.svelte +20 -0
- package/src/shadcn/field/field-description.svelte +25 -0
- package/src/shadcn/field/field-error.svelte +58 -0
- package/src/shadcn/field/field-group.svelte +23 -0
- package/src/shadcn/field/field-label.svelte +26 -0
- package/src/shadcn/field/field-legend.svelte +29 -0
- package/src/shadcn/field/field-separator.svelte +35 -0
- package/src/shadcn/field/field-set.svelte +24 -0
- package/src/shadcn/field/field-title.svelte +23 -0
- package/src/shadcn/field/field.svelte +53 -0
- package/src/shadcn/field/index.ts +33 -0
- package/src/shadcn/hooks/is-mobile.svelte.ts +9 -0
- package/src/shadcn/hover-card/hover-card-content.svelte +31 -0
- package/src/shadcn/hover-card/hover-card-portal.svelte +7 -0
- package/src/shadcn/hover-card/hover-card-trigger.svelte +7 -0
- package/src/shadcn/hover-card/hover-card.svelte +7 -0
- package/src/shadcn/hover-card/index.ts +15 -0
- package/src/shadcn/input/index.ts +9 -0
- package/src/shadcn/input/input.svelte +48 -0
- package/src/shadcn/input/secret-input.svelte +75 -0
- package/src/shadcn/input-otp/index.ts +15 -0
- package/src/shadcn/input-otp/input-otp-group.svelte +20 -0
- package/src/shadcn/input-otp/input-otp-separator.svelte +25 -0
- package/src/shadcn/input-otp/input-otp-slot.svelte +26 -0
- package/src/shadcn/input-otp/input-otp.svelte +22 -0
- package/src/shadcn/label/index.ts +7 -0
- package/src/shadcn/label/label.svelte +20 -0
- package/src/shadcn/marker/index.ts +15 -0
- package/src/shadcn/marker/marker-content.svelte +23 -0
- package/src/shadcn/marker/marker-icon.svelte +21 -0
- package/src/shadcn/marker/marker.svelte +52 -0
- package/src/shadcn/message/index.ts +22 -0
- package/src/shadcn/message/message-avatar.svelte +23 -0
- package/src/shadcn/message/message-content.svelte +23 -0
- package/src/shadcn/message/message-footer.svelte +23 -0
- package/src/shadcn/message/message-group.svelte +20 -0
- package/src/shadcn/message/message-header.svelte +23 -0
- package/src/shadcn/message/message.svelte +27 -0
- package/src/shadcn/popover/index.ts +28 -0
- package/src/shadcn/popover/popover-close.svelte +7 -0
- package/src/shadcn/popover/popover-content.svelte +38 -0
- package/src/shadcn/popover/popover-description.svelte +20 -0
- package/src/shadcn/popover/popover-header.svelte +20 -0
- package/src/shadcn/popover/popover-portal.svelte +7 -0
- package/src/shadcn/popover/popover-title.svelte +15 -0
- package/src/shadcn/popover/popover-trigger.svelte +17 -0
- package/src/shadcn/popover/popover.svelte +7 -0
- package/src/shadcn/progress/index.ts +7 -0
- package/src/shadcn/progress/progress.svelte +30 -0
- package/src/shadcn/radio-group/index.ts +10 -0
- package/src/shadcn/radio-group/radio-group-item.svelte +31 -0
- package/src/shadcn/radio-group/radio-group.svelte +19 -0
- package/src/shadcn/scroll-area/index.ts +10 -0
- package/src/shadcn/scroll-area/scroll-area-scrollbar.svelte +30 -0
- package/src/shadcn/scroll-area/scroll-area.svelte +43 -0
- package/src/shadcn/select/index.ts +37 -0
- package/src/shadcn/select/select-content.svelte +45 -0
- package/src/shadcn/select/select-group-heading.svelte +21 -0
- package/src/shadcn/select/select-group.svelte +17 -0
- package/src/shadcn/select/select-item.svelte +38 -0
- package/src/shadcn/select/select-label.svelte +20 -0
- package/src/shadcn/select/select-portal.svelte +7 -0
- package/src/shadcn/select/select-scroll-down-button.svelte +23 -0
- package/src/shadcn/select/select-scroll-up-button.svelte +23 -0
- package/src/shadcn/select/select-separator.svelte +18 -0
- package/src/shadcn/select/select-trigger.svelte +33 -0
- package/src/shadcn/select/select.svelte +11 -0
- package/src/shadcn/separator/index.ts +7 -0
- package/src/shadcn/separator/separator.svelte +23 -0
- package/src/shadcn/sheet/index.ts +34 -0
- package/src/shadcn/sheet/sheet-close.svelte +7 -0
- package/src/shadcn/sheet/sheet-content.svelte +72 -0
- package/src/shadcn/sheet/sheet-description.svelte +17 -0
- package/src/shadcn/sheet/sheet-footer.svelte +20 -0
- package/src/shadcn/sheet/sheet-header.svelte +20 -0
- package/src/shadcn/sheet/sheet-overlay.svelte +20 -0
- package/src/shadcn/sheet/sheet-portal.svelte +7 -0
- package/src/shadcn/sheet/sheet-title.svelte +17 -0
- package/src/shadcn/sheet/sheet-trigger.svelte +7 -0
- package/src/shadcn/sheet/sheet.svelte +7 -0
- package/src/shadcn/sidebar/constants.ts +6 -0
- package/src/shadcn/sidebar/context.svelte.ts +81 -0
- package/src/shadcn/sidebar/index.ts +75 -0
- package/src/shadcn/sidebar/sidebar-content.svelte +24 -0
- package/src/shadcn/sidebar/sidebar-footer.svelte +21 -0
- package/src/shadcn/sidebar/sidebar-group-action.svelte +33 -0
- package/src/shadcn/sidebar/sidebar-group-content.svelte +21 -0
- package/src/shadcn/sidebar/sidebar-group-label.svelte +33 -0
- package/src/shadcn/sidebar/sidebar-group.svelte +21 -0
- package/src/shadcn/sidebar/sidebar-header.svelte +21 -0
- package/src/shadcn/sidebar/sidebar-input.svelte +21 -0
- package/src/shadcn/sidebar/sidebar-inset.svelte +23 -0
- package/src/shadcn/sidebar/sidebar-menu-action.svelte +37 -0
- package/src/shadcn/sidebar/sidebar-menu-badge.svelte +24 -0
- package/src/shadcn/sidebar/sidebar-menu-button.svelte +103 -0
- package/src/shadcn/sidebar/sidebar-menu-item.svelte +21 -0
- package/src/shadcn/sidebar/sidebar-menu-skeleton.svelte +36 -0
- package/src/shadcn/sidebar/sidebar-menu-sub-button.svelte +39 -0
- package/src/shadcn/sidebar/sidebar-menu-sub-item.svelte +21 -0
- package/src/shadcn/sidebar/sidebar-menu-sub.svelte +24 -0
- package/src/shadcn/sidebar/sidebar-menu.svelte +21 -0
- package/src/shadcn/sidebar/sidebar-provider.svelte +62 -0
- package/src/shadcn/sidebar/sidebar-rail.svelte +36 -0
- package/src/shadcn/sidebar/sidebar-separator.svelte +19 -0
- package/src/shadcn/sidebar/sidebar-trigger.svelte +37 -0
- package/src/shadcn/sidebar/sidebar.svelte +109 -0
- package/src/shadcn/skeleton/index.ts +7 -0
- package/src/shadcn/skeleton/skeleton.svelte +17 -0
- package/src/shadcn/slider/index.ts +7 -0
- package/src/shadcn/slider/slider.svelte +52 -0
- package/src/shadcn/sonner/index.ts +1 -0
- package/src/shadcn/sonner/sonner.svelte +34 -0
- package/src/shadcn/spinner/index.ts +1 -0
- package/src/shadcn/spinner/spinner.svelte +26 -0
- package/src/shadcn/switch/index.ts +7 -0
- package/src/shadcn/switch/switch.svelte +31 -0
- package/src/shadcn/table/index.ts +28 -0
- package/src/shadcn/table/table-body.svelte +20 -0
- package/src/shadcn/table/table-caption.svelte +20 -0
- package/src/shadcn/table/table-cell.svelte +20 -0
- package/src/shadcn/table/table-footer.svelte +20 -0
- package/src/shadcn/table/table-head.svelte +23 -0
- package/src/shadcn/table/table-header.svelte +20 -0
- package/src/shadcn/table/table-row.svelte +23 -0
- package/src/shadcn/table/table.svelte +25 -0
- package/src/shadcn/tabs/index.ts +16 -0
- package/src/shadcn/tabs/tabs-content.svelte +17 -0
- package/src/shadcn/tabs/tabs-list.svelte +25 -0
- package/src/shadcn/tabs/tabs-trigger.svelte +20 -0
- package/src/shadcn/tabs/tabs.svelte +19 -0
- package/src/shadcn/textarea/index.ts +7 -0
- package/src/shadcn/textarea/textarea.svelte +23 -0
- package/src/shadcn/toggle/index.ts +13 -0
- package/src/shadcn/toggle/toggle.svelte +53 -0
- package/src/shadcn/toggle-group/index.ts +10 -0
- package/src/shadcn/toggle-group/toggle-group-item.svelte +35 -0
- package/src/shadcn/toggle-group/toggle-group.svelte +59 -0
- package/src/shadcn/tooltip/context.ts +16 -0
- package/src/shadcn/tooltip/index.ts +19 -0
- package/src/shadcn/tooltip/tooltip-content.svelte +38 -0
- package/src/shadcn/tooltip/tooltip-portal.svelte +7 -0
- package/src/shadcn/tooltip/tooltip-provider.svelte +16 -0
- package/src/shadcn/tooltip/tooltip-trigger.svelte +7 -0
- package/src/shadcn/tooltip/tooltip.svelte +19 -0
- package/src/shadcn/utilities.css +549 -0
- package/src/showcase/AiSection.svelte +157 -0
- package/src/showcase/AnimationsSection.svelte +1658 -0
- package/src/showcase/ChartsSection.svelte +458 -0
- package/src/showcase/EffectsSection.svelte +152 -0
- package/src/showcase/ShadcnSection.svelte +27 -0
- package/src/showcase/ShowcaseImport.svelte +126 -0
- package/src/showcase/ShowcaseList.svelte +132 -0
- package/src/showcase/ShowcaseNav.svelte +247 -0
- package/src/showcase/ShowcaseSection.svelte +112 -0
- package/src/showcase/ShowcaseShell.svelte +55 -0
- package/src/showcase/ShowcaseStage.svelte +342 -0
- package/src/showcase/ShowcaseVariant.svelte +109 -0
- package/src/showcase/assets/image-reveal/art-1.jpg +0 -0
- package/src/showcase/assets/image-reveal/art-2.jpg +0 -0
- package/src/showcase/assets/image-reveal/art-3.jpg +0 -0
- package/src/showcase/check.svg +1 -0
- package/src/showcase/chevron-arms.svg +2 -0
- package/src/showcase/chevron-down.svg +1 -0
- package/src/showcase/copy.svg +2 -0
- package/src/showcase/demos/ai/confirmation.svelte +59 -0
- package/src/showcase/demos/ai/conversation.svelte +59 -0
- package/src/showcase/demos/ai/loading-state.svelte +19 -0
- package/src/showcase/demos/ai/prompt-input.svelte +57 -0
- package/src/showcase/demos/ai/reasoning.svelte +19 -0
- package/src/showcase/demos/ai/thinking-dots.svelte +15 -0
- package/src/showcase/demos/ai/voice-waveform.svelte +24 -0
- package/src/showcase/demos/effects/animated-beam.svelte +50 -0
- package/src/showcase/demos/effects/animated-group.svelte +47 -0
- package/src/showcase/demos/effects/border-beam-default.svelte +20 -0
- package/src/showcase/demos/effects/border-beam-line.svelte +20 -0
- package/src/showcase/demos/effects/border-beam-mono.svelte +20 -0
- package/src/showcase/demos/effects/border-beam-sunset.svelte +20 -0
- package/src/showcase/demos/effects/image-comparison.svelte +25 -0
- package/src/showcase/demos/effects/image-reveal.svelte +49 -0
- package/src/showcase/demos/effects/in-view.svelte +41 -0
- package/src/showcase/demos/effects/integrations-hub.svelte +82 -0
- package/src/showcase/demos/effects/magnetic.svelte +31 -0
- package/src/showcase/demos/effects/marquee.svelte +33 -0
- package/src/showcase/demos/effects/progressive-blur.svelte +47 -0
- package/src/showcase/demos/effects/spotlight.svelte +40 -0
- package/src/showcase/demos/effects/text-effect.svelte +55 -0
- package/src/showcase/demos/shadcn/accordion.svelte +45 -0
- package/src/showcase/demos/shadcn/alert-dialog.svelte +23 -0
- package/src/showcase/demos/shadcn/alert.svelte +30 -0
- package/src/showcase/demos/shadcn/attachment.svelte +71 -0
- package/src/showcase/demos/shadcn/avatar.svelte +30 -0
- package/src/showcase/demos/shadcn/badge.svelte +26 -0
- package/src/showcase/demos/shadcn/breadcrumb.svelte +34 -0
- package/src/showcase/demos/shadcn/bubble.svelte +36 -0
- package/src/showcase/demos/shadcn/button.svelte +11 -0
- package/src/showcase/demos/shadcn/calendar.svelte +8 -0
- package/src/showcase/demos/shadcn/card.svelte +39 -0
- package/src/showcase/demos/shadcn/checkbox.svelte +39 -0
- package/src/showcase/demos/shadcn/collapsible.svelte +20 -0
- package/src/showcase/demos/shadcn/command.svelte +48 -0
- package/src/showcase/demos/shadcn/context-menu.svelte +54 -0
- package/src/showcase/demos/shadcn/demo-harness.svelte +12 -0
- package/src/showcase/demos/shadcn/demos.test.ts +20 -0
- package/src/showcase/demos/shadcn/dialog.svelte +38 -0
- package/src/showcase/demos/shadcn/dropdown-menu.svelte +59 -0
- package/src/showcase/demos/shadcn/empty.svelte +29 -0
- package/src/showcase/demos/shadcn/field.svelte +115 -0
- package/src/showcase/demos/shadcn/hover-card.svelte +32 -0
- package/src/showcase/demos/shadcn/index.ts +358 -0
- package/src/showcase/demos/shadcn/input-otp.svelte +19 -0
- package/src/showcase/demos/shadcn/input.svelte +5 -0
- package/src/showcase/demos/shadcn/label.svelte +11 -0
- package/src/showcase/demos/shadcn/marker.svelte +30 -0
- package/src/showcase/demos/shadcn/message.svelte +75 -0
- package/src/showcase/demos/shadcn/popover.svelte +36 -0
- package/src/showcase/demos/shadcn/progress.svelte +13 -0
- package/src/showcase/demos/shadcn/radio-group.svelte +19 -0
- package/src/showcase/demos/shadcn/scroll-area.svelte +18 -0
- package/src/showcase/demos/shadcn/select.svelte +29 -0
- package/src/showcase/demos/shadcn/separator.svelte +12 -0
- package/src/showcase/demos/shadcn/sheet.svelte +48 -0
- package/src/showcase/demos/shadcn/skeleton.svelte +11 -0
- package/src/showcase/demos/shadcn/slider.svelte +7 -0
- package/src/showcase/demos/shadcn/sonner.svelte +18 -0
- package/src/showcase/demos/shadcn/spinner.svelte +11 -0
- package/src/showcase/demos/shadcn/switch.svelte +9 -0
- package/src/showcase/demos/shadcn/table.svelte +76 -0
- package/src/showcase/demos/shadcn/tabs.svelte +62 -0
- package/src/showcase/demos/shadcn/textarea.svelte +5 -0
- package/src/showcase/demos/shadcn/toggle-group.svelte +18 -0
- package/src/showcase/demos/shadcn/toggle.svelte +14 -0
- package/src/showcase/demos/shadcn/tooltip.svelte +13 -0
- package/src/showcase/heart.svg +1 -0
- package/src/showcase/index.ts +38 -0
- package/src/showcase/kit.test.ts +72 -0
- package/src/showcase/kit.ts +17 -0
- package/src/showcase/plus.svg +1 -0
- package/src/showcase/showcase-shell.css +91 -0
- package/src/showcase/stacked-section.css +15 -0
- package/src/showcase/success-check.svg +1 -0
- package/src/showcase/types.ts +29 -0
- package/src/svg-raw.d.ts +7 -0
- package/src/test-setup.ts +34 -0
- package/src/tokens.css +993 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { BotAvatarFace, BotAvatarPreset, BotAvatarState, BotAvatarType } from "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The eighteen types: each body has its own colour and says where on it the
|
|
5
|
+
* face sits. Every type wears the eyes alone by default.
|
|
6
|
+
*/
|
|
7
|
+
export const botAvatarPresets: Record<BotAvatarType, BotAvatarPreset> = {
|
|
8
|
+
clover: {
|
|
9
|
+
label: "Clover",
|
|
10
|
+
color: "#41C4FF",
|
|
11
|
+
face: "eyes",
|
|
12
|
+
faceX: 50,
|
|
13
|
+
faceY: 50,
|
|
14
|
+
faceScale: 1,
|
|
15
|
+
brightness: 1.2,
|
|
16
|
+
saturation: 1.59,
|
|
17
|
+
},
|
|
18
|
+
flower: {
|
|
19
|
+
label: "Flower",
|
|
20
|
+
color: "#2FCB7A",
|
|
21
|
+
face: "eyes",
|
|
22
|
+
faceX: 50,
|
|
23
|
+
faceY: 51,
|
|
24
|
+
faceScale: 0.95,
|
|
25
|
+
},
|
|
26
|
+
triangle: {
|
|
27
|
+
label: "Triangle",
|
|
28
|
+
color: "#DC48FF",
|
|
29
|
+
face: "eyes",
|
|
30
|
+
faceX: 50,
|
|
31
|
+
faceY: 61,
|
|
32
|
+
faceScale: 0.9,
|
|
33
|
+
},
|
|
34
|
+
square: { label: "Square", color: "#35B8FF", face: "eyes", faceX: 50, faceY: 50, faceScale: 1 },
|
|
35
|
+
blob: { label: "Blob", color: "#2FCB7A", face: "eyes", faceX: 49.5, faceY: 50, faceScale: 1 },
|
|
36
|
+
ghost: { label: "Ghost", color: "#F4F2FA", face: "eyes", faceX: 50, faceY: 48, faceScale: 0.95 },
|
|
37
|
+
circle: { label: "Circle", color: "#9A62FF", face: "eyes", faceX: 50, faceY: 50, faceScale: 1 },
|
|
38
|
+
drop: { label: "Drop", color: "#1ED3C6", face: "eyes", faceX: 50, faceY: 62, faceScale: 0.9 },
|
|
39
|
+
star: {
|
|
40
|
+
label: "Star",
|
|
41
|
+
color: "#EFDB8E",
|
|
42
|
+
face: "eyes",
|
|
43
|
+
faceX: 50,
|
|
44
|
+
faceY: 52,
|
|
45
|
+
faceScale: 0.82,
|
|
46
|
+
brightness: 1.1,
|
|
47
|
+
saturation: 1.84,
|
|
48
|
+
},
|
|
49
|
+
droid: { label: "Droid", color: "#D5DBEA", face: "eyes", faceX: 50, faceY: 60, faceScale: 0.95 },
|
|
50
|
+
mech: { label: "Mech", color: "#95A6C4", face: "eyes", faceX: 50, faceY: 59, faceScale: 1 },
|
|
51
|
+
alien: { label: "Alien", color: "#9CD66A", face: "eyes", faceX: 50, faceY: 45, faceScale: 1.05 },
|
|
52
|
+
hexagon: {
|
|
53
|
+
label: "Hexagon",
|
|
54
|
+
color: "#EB7575",
|
|
55
|
+
face: "eyes",
|
|
56
|
+
faceX: 50,
|
|
57
|
+
faceY: 50,
|
|
58
|
+
faceScale: 0.95,
|
|
59
|
+
},
|
|
60
|
+
cat: {
|
|
61
|
+
label: "Cat",
|
|
62
|
+
color: "#EAA06F",
|
|
63
|
+
face: "eyes",
|
|
64
|
+
faceX: 50,
|
|
65
|
+
faceY: 58,
|
|
66
|
+
faceScale: 1,
|
|
67
|
+
brightness: 1.22,
|
|
68
|
+
saturation: 1.88,
|
|
69
|
+
},
|
|
70
|
+
cloud: { label: "Cloud", color: "#CFD5E4", face: "eyes", faceX: 50, faceY: 58, faceScale: 0.95 },
|
|
71
|
+
pill: { label: "Pill", color: "#ACAAF3", face: "eyes", faceX: 50, faceY: 50, faceScale: 0.9 },
|
|
72
|
+
pebble: {
|
|
73
|
+
label: "Pebble",
|
|
74
|
+
color: "#ABC793",
|
|
75
|
+
face: "eyes",
|
|
76
|
+
faceX: 50,
|
|
77
|
+
faceY: 50,
|
|
78
|
+
faceScale: 0.95,
|
|
79
|
+
},
|
|
80
|
+
puddle: {
|
|
81
|
+
label: "Puddle",
|
|
82
|
+
color: "#EE8BDB",
|
|
83
|
+
face: "eyes",
|
|
84
|
+
faceX: 50,
|
|
85
|
+
faceY: 50,
|
|
86
|
+
faceScale: 0.95,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const botAvatarTypes = Object.keys(botAvatarPresets) as BotAvatarType[];
|
|
91
|
+
export const botAvatarFaces: BotAvatarFace[] = ["eyes", "mouth"];
|
|
92
|
+
export const botAvatarStates: BotAvatarState[] = ["default", "working", "sleeping"];
|
|
93
|
+
|
|
94
|
+
/** Body colour by type — the palette on its own. */
|
|
95
|
+
export const botAvatarPalette: Record<BotAvatarType, string> = Object.fromEntries(
|
|
96
|
+
botAvatarTypes.map((t) => [t, botAvatarPresets[t].color]),
|
|
97
|
+
) as Record<BotAvatarType, string>;
|
|
98
|
+
|
|
99
|
+
export const stateLabels: Record<BotAvatarState, string> = {
|
|
100
|
+
default: "idle",
|
|
101
|
+
working: "working",
|
|
102
|
+
sleeping: "sleeping",
|
|
103
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* Generated by scripts/gen-shapes.mjs — do not edit by hand. Body
|
|
2
|
+
outlines in a 100×100 box, centred on (50, 50). */
|
|
3
|
+
|
|
4
|
+
import type { BotAvatarType } from "./types";
|
|
5
|
+
|
|
6
|
+
export const SHAPE_PATHS: Record<BotAvatarType, string> = {
|
|
7
|
+
clover:
|
|
8
|
+
"M26.53 22.38A25 25 0 0 1 73.47 22.38A7 7 0 0 0 77.62 26.53A25 25 0 0 1 77.62 73.47A7 7 0 0 0 73.47 77.62A25 25 0 0 1 26.53 77.62A7 7 0 0 0 22.38 73.47A25 25 0 0 1 22.38 26.53A7 7 0 0 0 26.53 22.38Z",
|
|
9
|
+
flower:
|
|
10
|
+
"M31.2 19.82A20.5 20.5 0 0 1 68.8 19.82A5 5 0 0 0 72.9 22.8A20.5 20.5 0 0 1 84.51 58.55A5 5 0 0 0 82.95 63.37A20.5 20.5 0 0 1 52.54 85.47A5 5 0 0 0 47.46 85.47A20.5 20.5 0 0 1 17.05 63.37A5 5 0 0 0 15.49 58.55A20.5 20.5 0 0 1 27.1 22.8A5 5 0 0 0 31.2 19.82Z",
|
|
11
|
+
triangle:
|
|
12
|
+
"M38.75 27.43A13 13 0 0 1 61.25 27.43L82.7 64.49A13 13 0 0 1 71.45 84L28.55 84A13 13 0 0 1 17.3 64.49L38.75 27.43Z",
|
|
13
|
+
square:
|
|
14
|
+
"M93 50C93 53.66 92.96 58.23 92.88 60.97C92.8 63.71 92.67 64.81 92.51 66.44C92.35 68.08 92.15 69.44 91.9 70.77C91.66 72.1 91.37 73.3 91.04 74.44C90.72 75.58 90.35 76.63 89.94 77.63C89.53 78.63 89.07 79.55 88.58 80.43C88.08 81.31 87.54 82.13 86.96 82.9C86.37 83.67 85.75 84.39 85.07 85.07C84.39 85.75 83.67 86.37 82.9 86.96C82.13 87.54 81.31 88.08 80.43 88.58C79.55 89.07 78.63 89.53 77.63 89.94C76.63 90.35 75.58 90.72 74.44 91.04C73.3 91.37 72.1 91.66 70.77 91.9C69.44 92.15 68.08 92.35 66.44 92.51C64.81 92.67 63.71 92.8 60.97 92.88C58.23 92.96 53.66 93 50 93C46.34 93 41.77 92.96 39.03 92.88C36.29 92.8 35.19 92.67 33.56 92.51C31.92 92.35 30.56 92.15 29.23 91.9C27.9 91.66 26.7 91.37 25.56 91.04C24.42 90.72 23.37 90.35 22.37 89.94C21.37 89.53 20.45 89.07 19.57 88.58C18.69 88.08 17.87 87.54 17.1 86.96C16.33 86.37 15.61 85.75 14.93 85.07C14.25 84.39 13.63 83.67 13.04 82.9C12.46 82.13 11.92 81.31 11.42 80.43C10.93 79.55 10.47 78.63 10.06 77.63C9.65 76.63 9.28 75.58 8.96 74.44C8.63 73.3 8.34 72.1 8.1 70.77C7.85 69.44 7.65 68.08 7.49 66.44C7.33 64.81 7.2 63.71 7.12 60.97C7.04 58.23 7 53.66 7 50C7 46.34 7.04 41.77 7.12 39.03C7.2 36.29 7.33 35.19 7.49 33.56C7.65 31.92 7.85 30.56 8.1 29.23C8.34 27.9 8.63 26.7 8.96 25.56C9.28 24.42 9.65 23.37 10.06 22.37C10.47 21.37 10.93 20.45 11.42 19.57C11.92 18.69 12.46 17.87 13.04 17.1C13.63 16.33 14.25 15.61 14.93 14.93C15.61 14.25 16.33 13.63 17.1 13.04C17.87 12.46 18.69 11.92 19.57 11.42C20.45 10.93 21.37 10.47 22.37 10.06C23.37 9.65 24.42 9.28 25.56 8.96C26.7 8.63 27.9 8.34 29.23 8.1C30.56 7.85 31.92 7.65 33.56 7.49C35.19 7.33 36.29 7.2 39.03 7.12C41.77 7.04 46.34 7 50 7C53.66 7 58.23 7.04 60.97 7.12C63.71 7.2 64.81 7.33 66.44 7.49C68.08 7.65 69.44 7.85 70.77 8.1C72.1 8.34 73.3 8.63 74.44 8.96C75.58 9.28 76.63 9.65 77.63 10.06C78.63 10.47 79.55 10.93 80.43 11.42C81.31 11.92 82.13 12.46 82.9 13.04C83.67 13.63 84.39 14.25 85.07 14.93C85.75 15.61 86.37 16.33 86.96 17.1C87.54 17.87 88.08 18.69 88.58 19.57C89.07 20.45 89.53 21.37 89.94 22.37C90.35 23.37 90.72 24.42 91.04 25.56C91.37 26.7 91.66 27.9 91.9 29.23C92.15 30.56 92.35 31.92 92.51 33.56C92.67 35.19 92.8 36.29 92.88 39.03C92.96 41.77 93 46.34 93 50Z",
|
|
15
|
+
blob: "M93.92 50C94.18 51.9 94.24 53.9 93.99 55.79C93.73 57.68 93.18 59.61 92.39 61.36C91.6 63.1 90.48 64.78 89.27 66.27C88.07 67.76 86.58 69.08 85.14 70.29C83.7 71.49 82.1 72.5 80.62 73.5C79.14 74.49 77.64 75.34 76.24 76.24C74.84 77.15 73.51 78 72.2 78.93C70.88 79.86 69.66 80.83 68.36 81.8C67.06 82.76 65.78 83.82 64.39 84.74C63 85.67 61.55 86.63 60.01 87.35C58.47 88.08 56.82 88.73 55.15 89.1C53.48 89.47 51.71 89.64 50 89.57C48.29 89.5 46.55 89.16 44.91 88.68C43.27 88.21 41.67 87.47 40.16 86.72C38.65 85.96 37.24 85.02 35.86 84.13C34.48 83.24 33.19 82.29 31.89 81.37C30.58 80.46 29.32 79.56 28.03 78.63C26.74 77.71 25.44 76.82 24.16 75.84C22.88 74.86 21.57 73.87 20.36 72.74C19.15 71.62 17.95 70.42 16.91 69.1C15.88 67.79 14.92 66.35 14.15 64.85C13.38 63.35 12.76 61.73 12.29 60.1C11.81 58.48 11.52 56.78 11.29 55.1C11.06 53.41 10.98 51.71 10.91 50C10.83 48.29 10.83 46.59 10.83 44.84C10.84 43.1 10.85 41.34 10.93 39.53C11.02 37.72 11.09 35.86 11.34 33.99C11.59 32.12 11.88 30.16 12.43 28.31C12.99 26.46 13.69 24.56 14.66 22.88C15.64 21.21 16.86 19.58 18.27 18.27C19.69 16.96 21.4 15.84 23.17 15.03C24.93 14.22 26.95 13.71 28.89 13.43C30.83 13.15 32.9 13.21 34.82 13.36C36.74 13.5 38.66 13.92 40.43 14.28C42.2 14.65 43.87 15.16 45.46 15.54C47.06 15.93 48.52 16.31 50 16.58C51.48 16.85 52.87 17.02 54.32 17.17C55.77 17.32 57.22 17.36 58.71 17.49C60.2 17.62 61.74 17.7 63.28 17.95C64.81 18.19 66.39 18.5 67.91 18.98C69.43 19.46 70.95 20.08 72.38 20.83C73.81 21.58 75.19 22.5 76.5 23.5C77.81 24.5 79.03 25.63 80.22 26.81C81.41 27.99 82.54 29.25 83.65 30.57C84.76 31.89 85.85 33.26 86.89 34.72C87.93 36.18 88.98 37.69 89.9 39.31C90.82 40.92 91.73 42.64 92.4 44.42C93.07 46.2 93.66 48.1 93.92 50Z",
|
|
16
|
+
ghost:
|
|
17
|
+
"M17 50C17 31.78 31.78 17 50 17C68.22 17 83 31.78 83 50V81.5Q72 93.5 61 81.5Q50 93.5 39 81.5Q28 93.5 17 81.5Z",
|
|
18
|
+
circle: "M50 8A42 42 0 1 1 50 92A42 42 0 1 1 50 8Z",
|
|
19
|
+
drop: "M50 8.5C52.2 8.5 53.4 10.3 56.4 15.2C62.9 25.5 84 44.6 84 61.5C84 80.3 68.8 92 50 92C31.2 92 16 80.3 16 61.5C16 44.6 37.1 25.5 43.6 15.2C46.6 10.3 47.8 8.5 50 8.5Z",
|
|
20
|
+
star: "M45.77 9.7A5 5 0 0 1 54.23 9.7L65.02 26.81A4 4 0 0 0 67.42 28.55L87.02 33.53A5 5 0 0 1 89.63 41.57L76.7 57.12A4 4 0 0 0 75.78 59.94L77.11 80.12A5 5 0 0 1 70.26 85.09L51.48 77.59A4 4 0 0 0 48.52 77.59L29.74 85.09A5 5 0 0 1 22.89 80.12L24.22 59.94A4 4 0 0 0 23.3 57.12L10.37 41.57A5 5 0 0 1 12.98 33.53L32.58 28.55A4 4 0 0 0 34.98 26.81L45.77 9.7Z",
|
|
21
|
+
droid:
|
|
22
|
+
"M16 50C16 38.95 24.95 30 36 30H64C75.05 30 84 38.95 84 50V70C84 81.05 75.05 90 64 90H36C24.95 90 16 81.05 16 70ZM4 62A7 7 0 1 1 18 62A7 7 0 1 1 4 62ZM82 62A7 7 0 1 1 96 62A7 7 0 1 1 82 62Z",
|
|
23
|
+
mech: "M10 48C10 38.06 18.06 30 28 30H72C81.94 30 90 38.06 90 48V70C90 79.94 81.94 88 72 88H28C18.06 88 10 79.94 10 70ZM3 54C3 51.79 4.79 50 7 50H11V72H7C4.79 72 3 70.21 3 68ZM89 50H93C95.21 50 97 51.79 97 54V68C97 70.21 95.21 72 93 72H89Z",
|
|
24
|
+
alien: "M50 10C70 10 83 27 83 46C83 65 64 92 50 92C36 92 17 65 17 46C17 27 30 10 50 10Z",
|
|
25
|
+
hexagon:
|
|
26
|
+
"M91.4 45.5A9 9 0 0 1 91.4 54.5L74.6 83.61A9 9 0 0 1 66.8 88.11L33.2 88.11A9 9 0 0 1 25.4 83.61L8.6 54.5A9 9 0 0 1 8.6 45.5L25.4 16.39A9 9 0 0 1 33.2 11.89L66.8 11.89A9 9 0 0 1 74.6 16.39L91.4 45.5Z",
|
|
27
|
+
cat: "M50 20A36 36 0 1 1 50 92A36 36 0 1 1 50 20ZM24.72 44.64A4.5 4.5 0 0 1 17.35 40.67L20.21 16.66A4.5 4.5 0 0 1 26.86 13.26L42.3 21.83A4.5 4.5 0 0 1 43.02 29.21L24.72 44.64ZM82.65 40.67A4.5 4.5 0 0 1 75.28 44.64L56.98 29.21A4.5 4.5 0 0 1 57.7 21.83L73.14 13.26A4.5 4.5 0 0 1 79.79 16.66L82.65 40.67Z",
|
|
28
|
+
cloud:
|
|
29
|
+
"M19 44A25 25 0 1 1 69 44A25 25 0 1 1 19 44ZM47 50A21 21 0 1 1 89 50A21 21 0 1 1 47 50ZM7 68A17 17 0 1 1 41 68A17 17 0 1 1 7 68ZM32 73A18 18 0 1 1 68 73A18 18 0 1 1 32 73ZM60 70A16 16 0 1 1 92 70A16 16 0 1 1 60 70Z",
|
|
30
|
+
pill: "M28 28H72C84.15 28 94 37.85 94 50C94 62.15 84.15 72 72 72H28C15.85 72 6 62.15 6 50C6 37.85 15.85 28 28 28Z",
|
|
31
|
+
pebble:
|
|
32
|
+
"M94.6 50C94.71 51.92 94.56 53.93 94.17 55.82C93.79 57.7 93.13 59.6 92.28 61.33C91.44 63.06 90.32 64.72 89.1 66.19C87.87 67.67 86.41 69.01 84.92 70.16C83.42 71.31 81.75 72.29 80.11 73.1C78.47 73.92 76.73 74.55 75.06 75.06C73.39 75.58 71.7 75.91 70.1 76.2C68.5 76.48 66.93 76.62 65.45 76.76C63.96 76.9 62.55 76.94 61.2 77.03C59.84 77.11 58.57 77.16 57.31 77.26C56.05 77.36 54.86 77.48 53.64 77.63C52.42 77.79 51.24 77.98 50 78.18C48.76 78.39 47.52 78.64 46.2 78.85C44.89 79.06 43.53 79.3 42.11 79.46C40.69 79.61 39.2 79.75 37.67 79.77C36.14 79.78 34.54 79.74 32.95 79.54C31.35 79.33 29.7 79.03 28.1 78.55C26.49 78.07 24.86 77.45 23.33 76.67C21.8 75.88 20.29 74.94 18.92 73.85C17.54 72.77 16.23 71.51 15.08 70.16C13.94 68.8 12.9 67.29 12.04 65.72C11.17 64.16 10.45 62.46 9.91 60.74C9.36 59.03 8.98 57.22 8.76 55.43C8.55 53.64 8.5 51.8 8.6 50C8.71 48.2 8.98 46.39 9.38 44.65C9.79 42.91 10.35 41.19 11.02 39.56C11.7 37.92 12.52 36.34 13.43 34.85C14.34 33.37 15.39 31.96 16.5 30.66C17.61 29.36 18.84 28.15 20.11 27.07C21.39 25.98 22.76 25 24.15 24.15C25.54 23.3 27.01 22.56 28.48 21.95C29.94 21.33 31.46 20.85 32.95 20.46C34.44 20.08 35.95 19.83 37.43 19.66C38.91 19.48 40.38 19.43 41.81 19.43C43.24 19.43 44.64 19.53 46.01 19.66C47.37 19.78 48.7 19.98 50 20.18C51.3 20.39 52.57 20.63 53.83 20.87C55.1 21.11 56.34 21.37 57.6 21.62C58.87 21.87 60.13 22.12 61.43 22.39C62.74 22.66 64.07 22.93 65.45 23.24C66.83 23.56 68.25 23.88 69.72 24.3C71.19 24.72 72.71 25.17 74.25 25.75C75.78 26.34 77.37 27 78.91 27.81C80.46 28.63 82.04 29.56 83.5 30.66C84.97 31.75 86.43 33 87.7 34.38C88.98 35.77 90.19 37.32 91.17 38.97C92.14 40.62 92.98 42.43 93.56 44.27C94.13 46.1 94.5 48.08 94.6 50Z",
|
|
33
|
+
puddle:
|
|
34
|
+
"M85.34 50C85.65 51.54 85.9 53.13 86.01 54.74C86.11 56.35 86.11 58 85.95 59.63C85.8 61.26 85.51 62.93 85.07 64.52C84.62 66.12 84.03 67.72 83.3 69.23C82.58 70.74 81.7 72.21 80.72 73.57C79.74 74.94 78.62 76.23 77.43 77.43C76.24 78.62 74.93 79.72 73.58 80.73C72.23 81.74 70.79 82.65 69.33 83.48C67.86 84.31 66.34 85.04 64.79 85.71C63.24 86.37 61.65 86.95 60.04 87.46C58.42 87.96 56.77 88.4 55.1 88.75C53.43 89.09 51.72 89.37 50 89.54C48.28 89.71 46.52 89.81 44.76 89.76C43.01 89.72 41.22 89.58 39.47 89.29C37.72 89 35.95 88.58 34.26 88C32.57 87.42 30.89 86.69 29.33 85.8C27.77 84.92 26.26 83.87 24.91 82.7C23.56 81.53 22.3 80.19 21.23 78.77C20.16 77.35 19.22 75.79 18.47 74.2C17.71 72.61 17.13 70.91 16.7 69.23C16.26 67.55 16.02 65.81 15.88 64.13C15.75 62.45 15.78 60.76 15.88 59.14C15.97 57.52 16.21 55.94 16.45 54.42C16.7 52.89 17.03 51.43 17.34 50C17.65 48.57 18 47.2 18.32 45.83C18.63 44.46 18.94 43.13 19.24 41.76C19.53 40.39 19.79 39.03 20.08 37.61C20.36 36.18 20.62 34.74 20.95 33.23C21.28 31.72 21.61 30.16 22.07 28.57C22.52 26.98 23.02 25.32 23.69 23.69C24.35 22.06 25.11 20.38 26.05 18.79C26.99 17.21 28.08 15.62 29.33 14.2C30.58 12.78 32 11.41 33.54 10.26C35.08 9.12 36.8 8.11 38.57 7.35C40.34 6.6 42.27 6.04 44.17 5.73C46.08 5.43 48.08 5.37 50 5.54C51.92 5.71 53.87 6.15 55.69 6.75C57.52 7.36 59.3 8.22 60.94 9.19C62.57 10.15 64.11 11.33 65.51 12.56C66.91 13.78 68.17 15.15 69.33 16.52C70.48 17.89 71.5 19.34 72.44 20.76C73.38 22.18 74.19 23.62 74.97 25.03C75.75 26.43 76.44 27.83 77.12 29.19C77.8 30.56 78.42 31.89 79.05 33.23C79.67 34.57 80.28 35.87 80.87 37.21C81.46 38.55 82.05 39.88 82.6 41.27C83.14 42.65 83.68 44.05 84.14 45.51C84.6 46.96 85.03 48.46 85.34 50Z",
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** Thin parts (antennae) drawn with a fraction of the body's depth. */
|
|
38
|
+
export const SHAPE_PARTS: Partial<Record<BotAvatarType, string>> = {
|
|
39
|
+
droid: "M47.5 14H52.5V32H47.5ZM43 11A7 7 0 1 1 57 11A7 7 0 1 1 43 11Z",
|
|
40
|
+
mech: "M19.5 32L24.5 32L17 13L12 13ZM75.5 32L80.5 32L88 13L83 13ZM10 11.5A4.5 4.5 0 1 1 19 11.5A4.5 4.5 0 1 1 10 11.5ZM81 11.5A4.5 4.5 0 1 1 90 11.5A4.5 4.5 0 1 1 81 11.5Z",
|
|
41
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/* One animation frame loop for every avatar on the page. Subscribers get
|
|
2
|
+
the seconds since their last tick; the loop stops while the tab is
|
|
3
|
+
hidden and while nobody is subscribed. */
|
|
4
|
+
|
|
5
|
+
type Tick = (dt: number) => void;
|
|
6
|
+
|
|
7
|
+
/** The last pointer position on the page, NaN while it is away. */
|
|
8
|
+
export const pointer = { x: NaN, y: NaN };
|
|
9
|
+
|
|
10
|
+
const subs = new Set<Tick>();
|
|
11
|
+
let raf = 0;
|
|
12
|
+
let last = 0;
|
|
13
|
+
|
|
14
|
+
function frame(now: number) {
|
|
15
|
+
raf = 0;
|
|
16
|
+
const dt = last ? Math.min(0.1, (now - last) / 1000) : 0;
|
|
17
|
+
last = now;
|
|
18
|
+
subs.forEach((fn) => fn(dt));
|
|
19
|
+
if (subs.size) raf = requestAnimationFrame(frame);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function start() {
|
|
23
|
+
if (raf || typeof document === "undefined" || document.hidden) return;
|
|
24
|
+
last = 0;
|
|
25
|
+
raf = requestAnimationFrame(frame);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let wired = false;
|
|
29
|
+
function wire() {
|
|
30
|
+
if (wired || typeof document === "undefined") return;
|
|
31
|
+
wired = true;
|
|
32
|
+
document.addEventListener(
|
|
33
|
+
"pointermove",
|
|
34
|
+
(e) => {
|
|
35
|
+
pointer.x = e.clientX;
|
|
36
|
+
pointer.y = e.clientY;
|
|
37
|
+
},
|
|
38
|
+
{ passive: true },
|
|
39
|
+
);
|
|
40
|
+
document.addEventListener("pointerleave", () => {
|
|
41
|
+
pointer.x = NaN;
|
|
42
|
+
pointer.y = NaN;
|
|
43
|
+
});
|
|
44
|
+
window.addEventListener("blur", () => {
|
|
45
|
+
pointer.x = NaN;
|
|
46
|
+
pointer.y = NaN;
|
|
47
|
+
});
|
|
48
|
+
document.addEventListener("visibilitychange", () => {
|
|
49
|
+
if (document.hidden) {
|
|
50
|
+
if (raf) cancelAnimationFrame(raf);
|
|
51
|
+
raf = 0;
|
|
52
|
+
} else if (subs.size) start();
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function subscribe(fn: Tick): () => void {
|
|
57
|
+
wire();
|
|
58
|
+
subs.add(fn);
|
|
59
|
+
start();
|
|
60
|
+
return () => {
|
|
61
|
+
subs.delete(fn);
|
|
62
|
+
if (!subs.size && raf) {
|
|
63
|
+
cancelAnimationFrame(raf);
|
|
64
|
+
raf = 0;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
export type BotAvatarAttrs = Record<string, unknown>;
|
|
2
|
+
export type BotAvatarStyle = string | Record<string, string | number>;
|
|
3
|
+
|
|
4
|
+
/** The eighteen body shapes. */
|
|
5
|
+
export type BotAvatarType =
|
|
6
|
+
| "clover"
|
|
7
|
+
| "flower"
|
|
8
|
+
| "triangle"
|
|
9
|
+
| "square"
|
|
10
|
+
| "blob"
|
|
11
|
+
| "ghost"
|
|
12
|
+
| "circle"
|
|
13
|
+
| "drop"
|
|
14
|
+
| "star"
|
|
15
|
+
| "droid"
|
|
16
|
+
| "mech"
|
|
17
|
+
| "alien"
|
|
18
|
+
| "hexagon"
|
|
19
|
+
| "cat"
|
|
20
|
+
| "cloud"
|
|
21
|
+
| "pill"
|
|
22
|
+
| "pebble"
|
|
23
|
+
| "puddle";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* What the face is made of. The eyes alone by default; `mouth` adds a
|
|
27
|
+
* small mouth that changes with the state.
|
|
28
|
+
*/
|
|
29
|
+
export type BotAvatarFace = "eyes" | "mouth";
|
|
30
|
+
|
|
31
|
+
/** What the bot is doing. Each state is a pose plus its own motion. */
|
|
32
|
+
export type BotAvatarState = "default" | "working" | "sleeping";
|
|
33
|
+
|
|
34
|
+
/** How the landing squash of a jump plays out. */
|
|
35
|
+
export type BotAvatarSquashEase = "sharp" | "pulse" | "soft" | "bouncy";
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* How the body is lit. `fabric` (default): a plush faux fur — a baked
|
|
39
|
+
* pillow form under a studio light, fine strands combed down the form and
|
|
40
|
+
* gathered into lit locks, the silhouette breaking into soft tufts with a
|
|
41
|
+
* haze of hairs; the eyes turn into glossy beads. `plastic`: the same form
|
|
42
|
+
* as a real glossy material shaded per pixel — a hot spot and a sheen, a
|
|
43
|
+
* Fresnel rim, a window reflection, saturated shadows. `crisp`: a lit rim with
|
|
44
|
+
* a clean edge round the front, vector-style. `smooth`: no edge, a soft
|
|
45
|
+
* shadow and highlight across the whole form. `flat`: the depth alone, no
|
|
46
|
+
* lighting.
|
|
47
|
+
*/
|
|
48
|
+
export type BotAvatarShading = "crisp" | "smooth" | "plastic" | "flat" | "fabric";
|
|
49
|
+
|
|
50
|
+
/** Something to wear on the head. */
|
|
51
|
+
export type BotAvatarHat = "none" | "beret" | "beanie" | "party" | "crown";
|
|
52
|
+
|
|
53
|
+
/** Something to wear over the eyes. */
|
|
54
|
+
export type BotAvatarGlasses = "none" | "round" | "square" | "shades";
|
|
55
|
+
|
|
56
|
+
export interface BotAvatarPreset {
|
|
57
|
+
/** Display name, for labels and the default `aria-label`. */
|
|
58
|
+
label: string;
|
|
59
|
+
/** The type's own body colour. */
|
|
60
|
+
color: string;
|
|
61
|
+
/** The face the type ships with. */
|
|
62
|
+
face: BotAvatarFace;
|
|
63
|
+
/** Where the face sits, in the 100×100 body box. */
|
|
64
|
+
faceX: number;
|
|
65
|
+
faceY: number;
|
|
66
|
+
/** Face scale: shapes with a small middle wear a smaller face. */
|
|
67
|
+
faceScale: number;
|
|
68
|
+
/** The type's own `brightness` and `saturation`, where the props leave
|
|
69
|
+
them out (otherwise 1 and 1.5). */
|
|
70
|
+
brightness?: number;
|
|
71
|
+
saturation?: number;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface BotAvatarProps extends BotAvatarAttrs {
|
|
75
|
+
/** Body shape. Default `clover`. */
|
|
76
|
+
type?: BotAvatarType;
|
|
77
|
+
/**
|
|
78
|
+
* A custom body outline: SVG path data in the 100×100 body box, centred
|
|
79
|
+
* on (50, 50), replacing the type's own (and its antennae). The type
|
|
80
|
+
* still sets the face's place, the default colour and the label, so keep
|
|
81
|
+
* the outline solid round the face. Default: the type's outline.
|
|
82
|
+
*/
|
|
83
|
+
path?: string;
|
|
84
|
+
/** Face kind. Defaults to the type's own. */
|
|
85
|
+
face?: BotAvatarFace;
|
|
86
|
+
/** What the bot is doing: `default` (idle), `working` (hopping, spinning) or `sleeping`. */
|
|
87
|
+
state?: BotAvatarState;
|
|
88
|
+
/** Rendered size in px, or any CSS length. Default `64`. */
|
|
89
|
+
size?: number | string;
|
|
90
|
+
/** Body colour. Defaults to the type's palette colour. */
|
|
91
|
+
color?: string;
|
|
92
|
+
/** Face ink. Defaults to dark, or light on a dark body. */
|
|
93
|
+
ink?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Lightness of the body colour: 1 as the palette has it, below 1 darker,
|
|
96
|
+
* above 1 lighter (0.5–1.5 is the useful range). Default `1`, or the
|
|
97
|
+
* type's own (the star's is `1.1`).
|
|
98
|
+
*/
|
|
99
|
+
brightness?: number;
|
|
100
|
+
/**
|
|
101
|
+
* Saturation of the body colour: 1 as the palette has it, below 1
|
|
102
|
+
* duller, above 1 more vivid, 0.5–2.5. Past 1.5, where most of the
|
|
103
|
+
* palette is already as saturated as a screen shows it, the colour is
|
|
104
|
+
* pushed along its own hue toward its most vivid shade (deepening by at
|
|
105
|
+
* most 15% where the screen cannot show it brighter), the shade side
|
|
106
|
+
* grows richer, and `plastic` and `fabric` keep
|
|
107
|
+
* more of it in the light — highlights, sheen, rim and fur tips stay
|
|
108
|
+
* coloured rather than paling toward white. Default `1.5`, or the
|
|
109
|
+
* type's own (the star's is `1.84`).
|
|
110
|
+
*/
|
|
111
|
+
saturation?: number;
|
|
112
|
+
/** Multiplier on every animation's speed. Default `1`. */
|
|
113
|
+
speed?: number;
|
|
114
|
+
/** Freeze every animation on its current frame. */
|
|
115
|
+
paused?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* 0–1. Offsets the blink and glance timing so a row of avatars does not
|
|
118
|
+
* blink in unison. Defaults to a value derived from the instance id.
|
|
119
|
+
*/
|
|
120
|
+
seed?: number;
|
|
121
|
+
/** How the body is lit: `fabric` (default), `plastic`, `crisp`, `smooth`
|
|
122
|
+
* or `flat`. `true` and `false` mean crisp and flat. */
|
|
123
|
+
shading?: BotAvatarShading | boolean;
|
|
124
|
+
/** A hat, sitting on the top of the head and turning with it: `beret`,
|
|
125
|
+
* `beanie`, `party` or `crown`. Default `none`. */
|
|
126
|
+
hat?: BotAvatarHat;
|
|
127
|
+
/** Glasses over the eyes: `round`, `square` or `shades`. Default `none`. */
|
|
128
|
+
glasses?: BotAvatarGlasses;
|
|
129
|
+
/** Headphones over the head, a cup on either side. Default `false`. */
|
|
130
|
+
headphones?: boolean;
|
|
131
|
+
/** A bow tie under the face. Default `false`. */
|
|
132
|
+
bowTie?: boolean;
|
|
133
|
+
/** Colour of the hat, the headphones and the bow tie. Default a soft black. */
|
|
134
|
+
accessoryColor?: string;
|
|
135
|
+
/** Strength of the shadow side, 0–2. Default `0.35` (`1.15` for `fabric`). */
|
|
136
|
+
shadow?: number;
|
|
137
|
+
/** Strength of the lit side, 0–2. Default `1.3` (`1.45` for `fabric`). */
|
|
138
|
+
highlight?: number;
|
|
139
|
+
/** Thickness of the body, 0.2–2: what shows when it turns or flips. Default `0.65`. */
|
|
140
|
+
depth?: number;
|
|
141
|
+
/**
|
|
142
|
+
* `plastic` and `fabric`: the body's profile through its depth, 0–1. At
|
|
143
|
+
* `1` (default) it is inflated like a cushion or a plush toy — thickest in
|
|
144
|
+
* the middle and rounding off to nothing at the outline all round, so a
|
|
145
|
+
* turn shows a round side; toward `0` it becomes a slab with soft edges.
|
|
146
|
+
*/
|
|
147
|
+
roundness?: number;
|
|
148
|
+
/** `fabric`: length of the pile, 0.3–2.5. Default `1`. */
|
|
149
|
+
furLength?: number;
|
|
150
|
+
/** `fabric`: how many fibres, 0.3–2. Default `1.6`. */
|
|
151
|
+
furDensity?: number;
|
|
152
|
+
/** `fabric`: softness of the silhouette — the haze of fine hairs standing past it, 0–1. Default `0.9`. */
|
|
153
|
+
furFuzz?: number;
|
|
154
|
+
/** `fabric`: how much the fibres gather into tufts, 0–1. Default `0.4`. */
|
|
155
|
+
furClumps?: number;
|
|
156
|
+
/** `fabric`: how wavy the fibres are, 0 (straight) – 1. Default `0.7`. */
|
|
157
|
+
furCurl?: number;
|
|
158
|
+
/**
|
|
159
|
+
* `fabric`: how much the pile hangs, 0–1 — combed down from a parting at
|
|
160
|
+
* the top, lying over the top edge and hanging off the sides and bottom,
|
|
161
|
+
* rather than standing out evenly all round. Default `0.9`.
|
|
162
|
+
*/
|
|
163
|
+
furGravity?: number;
|
|
164
|
+
/** Where the light comes from, in degrees clockwise from the top. Default `300` (`295` for `fabric`): from the upper left, like a studio key light. */
|
|
165
|
+
light?: number;
|
|
166
|
+
/** Width of the lit rim in `crisp` shading, strength of the Fresnel rim in `plastic`, of the back light in `fabric` — the bright rim it wraps round the top and sides, and the glow of the edge's hairs — 0–2. Default `0.5` (`0.6` for `fabric`). */
|
|
167
|
+
rim?: number;
|
|
168
|
+
/** `fabric`: where the back light comes from, in degrees clockwise from the top. Default: above the toy, toward the side away from `light`. */
|
|
169
|
+
backLight?: number;
|
|
170
|
+
/** `fabric`: how far round to the front the key light sits, in degrees — `0` grazes the toy from the side (dramatic), `85` lights it nearly from the camera (flat). Default `32`. */
|
|
171
|
+
lightFront?: number;
|
|
172
|
+
/** `fabric`: strength of the highlights along single fibres where the key grazes the pile, 0–2. Default `0` (off: a soft, matte pile). */
|
|
173
|
+
shine?: number;
|
|
174
|
+
/** `fabric`: the smooth, satin sheen over the body's edge — the key's sheen and the back light's band as even gradients, a material shine rather than the fur's own — 0 (matte, only the fibres shine) – 2. Default `0`. */
|
|
175
|
+
sheen?: number;
|
|
176
|
+
/** `fabric`: how soft the back light is, 0–1 — `0` a small source caught on single fibres as crisp bright hairs, `1` a large one, an even glow reaching further in from the edge and fading out gently. Default `1`. */
|
|
177
|
+
backSoftness?: number;
|
|
178
|
+
/** Reach of the soft shading in `smooth`, width of the highlight in `plastic`, how far the light wraps round in `fabric`, 0.4–2.5. Default `1.55` (`1.6` for `fabric`). */
|
|
179
|
+
spread?: number;
|
|
180
|
+
/**
|
|
181
|
+
* Holds the body at this orientation, in radians — `yaw` turns it to the
|
|
182
|
+
* viewer's right, `pitch` tips it to look up, `roll` tilts it — in the
|
|
183
|
+
* state's rest pose, overriding the animation's turns, hops and glances
|
|
184
|
+
* (and pointer play) while it is set. For turning an avatar round by
|
|
185
|
+
* hand, as a 3D viewer does; usually with `paused`.
|
|
186
|
+
*/
|
|
187
|
+
pose?: { yaw?: number; pitch?: number; roll?: number };
|
|
188
|
+
/**
|
|
189
|
+
* Pointer play: the eyes and head follow a pointer that comes near, and
|
|
190
|
+
* a click makes the avatar hop and turn right round. Default `true`.
|
|
191
|
+
*/
|
|
192
|
+
interactive?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* The surface the avatar sits on, for touches that have to read against
|
|
195
|
+
* it. `auto` (default) reads an ancestor `data-theme` attribute or
|
|
196
|
+
* `dark` / `light` class, then `prefers-color-scheme`.
|
|
197
|
+
*/
|
|
198
|
+
theme?: "auto" | "dark" | "light";
|
|
199
|
+
/**
|
|
200
|
+
* How far the head turns from side to side while idle, 0–2: `1` as the
|
|
201
|
+
* library has it, `0` keeps it facing forward. Default `1`.
|
|
202
|
+
*/
|
|
203
|
+
turn?: number;
|
|
204
|
+
/** The whirl round a spin: its strength, 0–2. Off by default (`0`); `1` turns it on. */
|
|
205
|
+
whirl?: number;
|
|
206
|
+
/** Size of the whirl's ring, 0.6–1.6. Default `1`. */
|
|
207
|
+
whirlSize?: number;
|
|
208
|
+
/** Thickness of the whirl's trail, 0.4–2. Default `1`. */
|
|
209
|
+
whirlWidth?: number;
|
|
210
|
+
/** Length of the trail round the ring, 0.4–1.6. Default `1`. */
|
|
211
|
+
whirlLength?: number;
|
|
212
|
+
/** How flat the ring is seen, 0.5–1.8 (higher is more open). Default `1`. */
|
|
213
|
+
whirlTilt?: number;
|
|
214
|
+
/** The jump (an idle flip, a click): how high, in body units — the body is 100 tall. Default `26`. */
|
|
215
|
+
jumpHeight?: number;
|
|
216
|
+
/** Seconds the jump spends in the air. Default `0.68`. */
|
|
217
|
+
jumpTime?: number;
|
|
218
|
+
/** How much the body stretches in the air, 0–2. Default `1`. */
|
|
219
|
+
jumpStretch?: number;
|
|
220
|
+
/** How much the body squashes on the ground, before take-off and on landing, 0–2. Default `1.15`. */
|
|
221
|
+
jumpSquash?: number;
|
|
222
|
+
/** Seconds the landing squash takes, from contact to recovered. Default `0.37`. */
|
|
223
|
+
jumpSquashTime?: number;
|
|
224
|
+
/**
|
|
225
|
+
* How the landing squash plays out: `sharp` (all at once, then eases
|
|
226
|
+
* off), `pulse` (a quick press that recovers without a wobble, the
|
|
227
|
+
* default), `soft` (eases in and out), `bouncy` (overshoots into a
|
|
228
|
+
* stretch and settles).
|
|
229
|
+
*/
|
|
230
|
+
jumpSquashEase?: BotAvatarSquashEase;
|
|
231
|
+
/** Seconds a jump holds its deepest squash on the ground before recovering. Default `0.11`. */
|
|
232
|
+
jumpGroundTime?: number;
|
|
233
|
+
/**
|
|
234
|
+
* How the weight settles through that hold, in the same shapes as
|
|
235
|
+
* `jumpSquashEase`: the body presses a little deeper and comes back to
|
|
236
|
+
* the held depth, `sharp` at once, `pulse` quickly, `soft` in the
|
|
237
|
+
* middle, `bouncy` with a wobble. Default `pulse`.
|
|
238
|
+
*/
|
|
239
|
+
jumpGroundEase?: BotAvatarSquashEase;
|
|
240
|
+
/** Seconds the body takes to rise from its deepest squash back to its own shape. Default `0.33`. */
|
|
241
|
+
jumpRiseTime?: number;
|
|
242
|
+
/**
|
|
243
|
+
* How it rises: `sharp` lets go at once and eases in to rest, `pulse`
|
|
244
|
+
* leaves quickly with a long settle, `soft` eases out of the squash and
|
|
245
|
+
* into rest, `bouncy` passes rest into a slight stretch and settles
|
|
246
|
+
* back. Default `pulse`.
|
|
247
|
+
*/
|
|
248
|
+
jumpRiseEase?: BotAvatarSquashEase;
|
|
249
|
+
/** Seconds a click's jump takes for its landing squash (an idle jump's uses `jumpSquashTime`). Default `0.24`. */
|
|
250
|
+
jumpClickSquashTime?: number;
|
|
251
|
+
/** Whole turns made in the air, 0–2. Default `1`. */
|
|
252
|
+
jumpSpin?: number;
|
|
253
|
+
/** Degrees of lean into a jump. Default `6`. */
|
|
254
|
+
jumpLean?: number;
|
|
255
|
+
/** Seconds between idle jumps, give or take 40 %; 0 for none. Default `8`. */
|
|
256
|
+
jumpEvery?: number;
|
|
257
|
+
/** When the landing squash begins: seconds before touch-down (negative, bracing for the ground) or after it. Default `0`, the moment of contact. */
|
|
258
|
+
jumpLand?: number;
|
|
259
|
+
className?: string;
|
|
260
|
+
style?: BotAvatarStyle;
|
|
261
|
+
}
|