motionary 10.1.0 → 10.2.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/AGENTS.md +61 -0
- package/CHANGELOG.md +14 -0
- package/README.md +37 -0
- package/dist/chunks/{keyframes-CyH_abhI.js → keyframes-W-474DMc.js} +2 -2
- package/dist/chunks/{keyframes-CyH_abhI.js.map → keyframes-W-474DMc.js.map} +1 -1
- package/dist/chunks/{keyframes-cUdsXSXQ.cjs → keyframes-ZheOkpt0.cjs} +2 -2
- package/dist/chunks/{keyframes-cUdsXSXQ.cjs.map → keyframes-ZheOkpt0.cjs.map} +1 -1
- package/dist/chunks/{registry-jF8VIA_9.js → registry-BIEjKngP.js} +2 -2
- package/dist/chunks/{registry-jF8VIA_9.js.map → registry-BIEjKngP.js.map} +1 -1
- package/dist/chunks/{registry-C0xLNq3-.cjs → registry-eJgpFAzI.cjs} +2 -2
- package/dist/chunks/{registry-C0xLNq3-.cjs.map → registry-eJgpFAzI.cjs.map} +1 -1
- package/dist/chunks/ticker-CM_56oVy.js +70 -0
- package/dist/chunks/ticker-CM_56oVy.js.map +1 -0
- package/dist/chunks/ticker-D4o6enH0.cjs +72 -0
- package/dist/chunks/ticker-D4o6enH0.cjs.map +1 -0
- package/dist/chunks/{tween-JEthWrjo.cjs → tween-CBuWYpI-.cjs} +5 -72
- package/dist/chunks/tween-CBuWYpI-.cjs.map +1 -0
- package/dist/chunks/{tween-DDObu9iA.js → tween-CqX1JBuj.js} +5 -71
- package/dist/chunks/tween-CqX1JBuj.js.map +1 -0
- package/dist/components/core.cjs +106 -0
- package/dist/components/core.cjs.map +1 -1
- package/dist/components/core.d.cts +44 -2
- package/dist/components/core.d.ts +44 -2
- package/dist/components/core.js +105 -1
- package/dist/components/core.js.map +1 -1
- package/dist/components/widgets.cjs +401 -198
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +146 -2
- package/dist/components/widgets.d.ts +146 -2
- package/dist/components/widgets.js +399 -199
- package/dist/components/widgets.js.map +1 -1
- package/dist/llms-full.txt +98 -1
- package/dist/llms.txt +6 -2
- package/dist/manifest.json +259 -1
- package/dist/runtime/format-css.cjs +4 -3
- package/dist/runtime/format-css.cjs.map +1 -1
- package/dist/runtime/format-css.js +4 -3
- package/dist/runtime/format-css.js.map +1 -1
- package/dist/runtime/format-motion.cjs +4 -3
- package/dist/runtime/format-motion.cjs.map +1 -1
- package/dist/runtime/format-motion.js +4 -3
- package/dist/runtime/format-motion.js.map +1 -1
- package/dist/runtime/format-svg.cjs +457 -0
- package/dist/runtime/format-svg.cjs.map +1 -0
- package/dist/runtime/format-svg.d.cts +214 -0
- package/dist/runtime/format-svg.d.ts +214 -0
- package/dist/runtime/format-svg.iife.js +2 -0
- package/dist/runtime/format-svg.iife.js.map +1 -0
- package/dist/runtime/format-svg.js +446 -0
- package/dist/runtime/format-svg.js.map +1 -0
- package/dist/runtime/scroll.cjs +301 -0
- package/dist/runtime/scroll.cjs.map +1 -0
- package/dist/runtime/scroll.d.cts +236 -0
- package/dist/runtime/scroll.d.ts +236 -0
- package/dist/runtime/scroll.iife.js +2 -0
- package/dist/runtime/scroll.iife.js.map +1 -0
- package/dist/runtime/scroll.js +292 -0
- package/dist/runtime/scroll.js.map +1 -0
- package/dist/runtime.cjs +5 -4
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.d.cts +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.iife.js +1 -1
- package/dist/runtime.iife.js.map +1 -1
- package/dist/runtime.js +5 -4
- package/dist/runtime.js.map +1 -1
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/docs/ROADMAP.md +1 -1
- package/docs/ai-prompt-guide.md +54 -0
- package/docs/components/README.md +253 -0
- package/docs/components/usa-accordion.md +38 -0
- package/docs/components/usa-acrylic.md +38 -0
- package/docs/components/usa-add-to-cart.md +40 -0
- package/docs/components/usa-ambient.md +32 -0
- package/docs/components/usa-anim-icon.md +34 -0
- package/docs/components/usa-audio.md +38 -0
- package/docs/components/usa-aurora.md +36 -0
- package/docs/components/usa-auto-animate.md +44 -0
- package/docs/components/usa-auto-skeleton.md +38 -0
- package/docs/components/usa-avatar-stack.md +38 -0
- package/docs/components/usa-back-to-top.md +32 -0
- package/docs/components/usa-badge-wall.md +39 -0
- package/docs/components/usa-badge.md +36 -0
- package/docs/components/usa-bar-chart.md +33 -0
- package/docs/components/usa-bg-generator.md +32 -0
- package/docs/components/usa-blobs.md +32 -0
- package/docs/components/usa-bottom-sheet.md +32 -0
- package/docs/components/usa-button.md +78 -0
- package/docs/components/usa-card-stack.md +40 -0
- package/docs/components/usa-card.md +94 -0
- package/docs/components/usa-carousel-3d.md +40 -0
- package/docs/components/usa-carousel.md +40 -0
- package/docs/components/usa-cart-drawer.md +33 -0
- package/docs/components/usa-chapter-nav.md +40 -0
- package/docs/components/usa-chat-composer.md +33 -0
- package/docs/components/usa-check.md +32 -0
- package/docs/components/usa-checkbox.md +32 -0
- package/docs/components/usa-click.md +36 -0
- package/docs/components/usa-clock-control.md +37 -0
- package/docs/components/usa-code-export.md +36 -0
- package/docs/components/usa-color-picker.md +32 -0
- package/docs/components/usa-command-palette.md +39 -0
- package/docs/components/usa-compare.md +38 -0
- package/docs/components/usa-countdown.md +32 -0
- package/docs/components/usa-counter.md +32 -0
- package/docs/components/usa-cube-gallery.md +40 -0
- package/docs/components/usa-cube.md +36 -0
- package/docs/components/usa-cursor.md +32 -0
- package/docs/components/usa-date-picker.md +32 -0
- package/docs/components/usa-depth.md +44 -0
- package/docs/components/usa-dialog.md +40 -0
- package/docs/components/usa-disclosure.md +38 -0
- package/docs/components/usa-distort.md +36 -0
- package/docs/components/usa-dock.md +40 -0
- package/docs/components/usa-dot-network.md +32 -0
- package/docs/components/usa-double-tap.md +36 -0
- package/docs/components/usa-draggable.md +38 -0
- package/docs/components/usa-draw.md +36 -0
- package/docs/components/usa-drawer.md +34 -0
- package/docs/components/usa-equalizer.md +33 -0
- package/docs/components/usa-fab.md +40 -0
- package/docs/components/usa-festival-banner.md +32 -0
- package/docs/components/usa-field.md +34 -0
- package/docs/components/usa-file-drop.md +35 -0
- package/docs/components/usa-fullpage.md +38 -0
- package/docs/components/usa-fx.md +851 -0
- package/docs/components/usa-gauge.md +32 -0
- package/docs/components/usa-gen-art.md +32 -0
- package/docs/components/usa-gesture-fx.md +36 -0
- package/docs/components/usa-gesture-sticker.md +36 -0
- package/docs/components/usa-glitch.md +32 -0
- package/docs/components/usa-globe.md +33 -0
- package/docs/components/usa-gradient-text.md +32 -0
- package/docs/components/usa-grain.md +36 -0
- package/docs/components/usa-grid-glow.md +36 -0
- package/docs/components/usa-gyro-card.md +38 -0
- package/docs/components/usa-handwriting.md +32 -0
- package/docs/components/usa-hero-video.md +38 -0
- package/docs/components/usa-hold.md +32 -0
- package/docs/components/usa-hud-panel.md +38 -0
- package/docs/components/usa-hydrate.md +42 -0
- package/docs/components/usa-icon-morph.md +34 -0
- package/docs/components/usa-install-button.md +32 -0
- package/docs/components/usa-kanban.md +46 -0
- package/docs/components/usa-keyframe-editor.md +37 -0
- package/docs/components/usa-kpi.md +32 -0
- package/docs/components/usa-leaderboard.md +41 -0
- package/docs/components/usa-like.md +32 -0
- package/docs/components/usa-liquid-nav.md +36 -0
- package/docs/components/usa-liquid.md +36 -0
- package/docs/components/usa-loading-bar.md +35 -0
- package/docs/components/usa-location-card.md +34 -0
- package/docs/components/usa-lottie-icon.md +34 -0
- package/docs/components/usa-lottie.md +32 -0
- package/docs/components/usa-lyrics.md +38 -0
- package/docs/components/usa-magnetic.md +32 -0
- package/docs/components/usa-marquee.md +38 -0
- package/docs/components/usa-mask-reveal.md +36 -0
- package/docs/components/usa-masonry-flow.md +42 -0
- package/docs/components/usa-masonry.md +38 -0
- package/docs/components/usa-menu-toggle.md +34 -0
- package/docs/components/usa-menu.md +44 -0
- package/docs/components/usa-message-list.md +39 -0
- package/docs/components/usa-milestones.md +40 -0
- package/docs/components/usa-modal.md +42 -0
- package/docs/components/usa-morph.md +34 -0
- package/docs/components/usa-motion-inspector.md +32 -0
- package/docs/components/usa-motion-prefs.md +32 -0
- package/docs/components/usa-motion-spec.md +32 -0
- package/docs/components/usa-motion-switch.md +34 -0
- package/docs/components/usa-motion-theme.md +40 -0
- package/docs/components/usa-motion.md +42 -0
- package/docs/components/usa-music-player.md +36 -0
- package/docs/components/usa-native-preview.md +36 -0
- package/docs/components/usa-nav-morph.md +40 -0
- package/docs/components/usa-navbar.md +36 -0
- package/docs/components/usa-notification-bell.md +37 -0
- package/docs/components/usa-odometer.md +34 -0
- package/docs/components/usa-organic-card.md +36 -0
- package/docs/components/usa-otp.md +33 -0
- package/docs/components/usa-overscroll.md +36 -0
- package/docs/components/usa-pack.md +111 -0
- package/docs/components/usa-pagination.md +32 -0
- package/docs/components/usa-panorama.md +32 -0
- package/docs/components/usa-particles.md +32 -0
- package/docs/components/usa-pause-all.md +32 -0
- package/docs/components/usa-perf-monitor.md +32 -0
- package/docs/components/usa-pinch-zoom.md +36 -0
- package/docs/components/usa-player.md +38 -0
- package/docs/components/usa-plugin-card.md +61 -0
- package/docs/components/usa-plugin-store.md +36 -0
- package/docs/components/usa-popover.md +38 -0
- package/docs/components/usa-post-fx.md +36 -0
- package/docs/components/usa-presence.md +36 -0
- package/docs/components/usa-press.md +32 -0
- package/docs/components/usa-prize-wheel.md +32 -0
- package/docs/components/usa-product-gallery.md +40 -0
- package/docs/components/usa-progress-ring.md +38 -0
- package/docs/components/usa-progress.md +34 -0
- package/docs/components/usa-prop-panel.md +34 -0
- package/docs/components/usa-pull-cord.md +32 -0
- package/docs/components/usa-pull-refresh.md +37 -0
- package/docs/components/usa-radar.md +32 -0
- package/docs/components/usa-reactions.md +32 -0
- package/docs/components/usa-red-envelope.md +32 -0
- package/docs/components/usa-retro-button.md +34 -0
- package/docs/components/usa-reveal.md +36 -0
- package/docs/components/usa-ripple.md +32 -0
- package/docs/components/usa-scene.md +38 -0
- package/docs/components/usa-scramble.md +32 -0
- package/docs/components/usa-scroll-highlight.md +34 -0
- package/docs/components/usa-scroll-progress.md +36 -0
- package/docs/components/usa-scroll-scene.md +66 -0
- package/docs/components/usa-scrolly.md +40 -0
- package/docs/components/usa-segmented.md +40 -0
- package/docs/components/usa-shader.md +74 -0
- package/docs/components/usa-sheet.md +42 -0
- package/docs/components/usa-shimmer-text.md +32 -0
- package/docs/components/usa-shortcut.md +34 -0
- package/docs/components/usa-skeleton-reveal.md +42 -0
- package/docs/components/usa-skeleton.md +36 -0
- package/docs/components/usa-sketch-chart.md +32 -0
- package/docs/components/usa-slider.md +32 -0
- package/docs/components/usa-sparkline.md +32 -0
- package/docs/components/usa-spatial-card.md +40 -0
- package/docs/components/usa-spinner.md +34 -0
- package/docs/components/usa-splash.md +36 -0
- package/docs/components/usa-split-text.md +32 -0
- package/docs/components/usa-spotlight.md +40 -0
- package/docs/components/usa-spring.md +42 -0
- package/docs/components/usa-stagger.md +40 -0
- package/docs/components/usa-star-rating.md +34 -0
- package/docs/components/usa-stepper.md +42 -0
- package/docs/components/usa-sticky-stack.md +40 -0
- package/docs/components/usa-sticky-wall.md +40 -0
- package/docs/components/usa-stories.md +38 -0
- package/docs/components/usa-story.md +80 -0
- package/docs/components/usa-suggestion-chips.md +32 -0
- package/docs/components/usa-swipe-deck.md +40 -0
- package/docs/components/usa-swipeable.md +36 -0
- package/docs/components/usa-switch.md +32 -0
- package/docs/components/usa-tab-bar.md +46 -0
- package/docs/components/usa-tabs.md +40 -0
- package/docs/components/usa-terminal.md +38 -0
- package/docs/components/usa-text-rotate.md +32 -0
- package/docs/components/usa-theme-surface.md +36 -0
- package/docs/components/usa-theme-switcher.md +32 -0
- package/docs/components/usa-tilt.md +36 -0
- package/docs/components/usa-timeline.md +40 -0
- package/docs/components/usa-tip.md +44 -0
- package/docs/components/usa-toast-stack.md +36 -0
- package/docs/components/usa-toaster.md +36 -0
- package/docs/components/usa-typewriter.md +32 -0
- package/docs/components/usa-upload-progress.md +33 -0
- package/docs/components/usa-video-card.md +40 -0
- package/docs/components/usa-view-switch.md +38 -0
- package/docs/components/usa-voice-button.md +33 -0
- package/docs/components/usa-volume-knob.md +32 -0
- package/docs/components/usa-water-ripple.md +36 -0
- package/docs/components/usa-wave-text.md +32 -0
- package/docs/components/usa-weather-card.md +32 -0
- package/docs/components/usa-worker-canvas.md +32 -0
- package/docs/components/usa-xp-bar.md +33 -0
- package/docs/components.md +50 -0
- package/docs/runtime/format-svg.md +62 -0
- package/docs/runtime/scroll.md +61 -0
- package/package.json +25 -3
- package/dist/chunks/tween-DDObu9iA.js.map +0 -1
- package/dist/chunks/tween-JEthWrjo.cjs.map +0 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# `<usa-chat-composer>` — AI chat composer
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
7.8: an AI chat input that grows with its text; Enter sends, the send button pops when there is text and morphs into Stop while busy, with a thinking glow running round the composer.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 7.8
|
|
8
|
+
- **Import:** `import { defineChatComposer } from 'motionary/components/widgets'` then `defineChatComposer();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `placeholder`, `label`, `rows`, `busy`
|
|
11
|
+
- **Events:** `usa:stop`, `usa:send`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `send()`, `clear()`
|
|
14
|
+
- **Source:** [src/components/widgets/chat-composer.ts](../../src/components/widgets/chat-composer.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-chat-composer placeholder="Ask anything…"></usa-chat-composer>
|
|
20
|
+
<script>composer.addEventListener('usa:send', async (e) => { composer.busy = true; await ask(e.detail.text); composer.busy = false; });</script>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## ES module
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
import { defineChatComposer } from 'motionary/components/widgets';
|
|
27
|
+
|
|
28
|
+
defineChatComposer(); // registers <usa-chat-composer>
|
|
29
|
+
|
|
30
|
+
/* then use it in your HTML:
|
|
31
|
+
<usa-chat-composer placeholder="Ask anything…"></usa-chat-composer>
|
|
32
|
+
*/
|
|
33
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-check>` — Result icon
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
The circle draws itself, then a check, cross or exclamation strokes in with a pop. Great after a payment or upload.
|
|
6
|
+
|
|
7
|
+
- **Category:** feedback
|
|
8
|
+
- **Import:** `import { defineCheck } from 'motionary/components/feedback'` then `defineCheck();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `kind`, `size`, `label`
|
|
11
|
+
- **Events:** `usa:complete`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `play()`, `reset()`
|
|
14
|
+
- **Source:** [src/components/feedback/check.ts](../../src/components/feedback/check.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-check kind="success" label="Payment complete"></usa-check>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineCheck } from 'motionary/components/feedback';
|
|
26
|
+
|
|
27
|
+
defineCheck(); // registers <usa-check>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-check kind="success" label="Payment complete"></usa-check>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-checkbox>` — Animated checkbox
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
Form-associated checkbox: the box springs and the check draws itself; indeterminate state, circle shape.
|
|
6
|
+
|
|
7
|
+
- **Category:** click
|
|
8
|
+
- **Import:** `import { defineCheckbox } from 'motionary/components/click'` then `defineCheckbox();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `checked`, `indeterminate`, `disabled`, `label`
|
|
11
|
+
- **Events:** `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `toggle()`
|
|
14
|
+
- **Source:** [src/components/click/checkbox.ts](../../src/components/click/checkbox.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-checkbox name="terms">I agree</usa-checkbox>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineCheckbox } from 'motionary/components/click';
|
|
26
|
+
|
|
27
|
+
defineCheckbox(); // registers <usa-checkbox>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-checkbox name="terms">I agree</usa-checkbox>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# `<usa-click>` — Click effects
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
Wrap anything: ripple, burst (circle, star, heart, emoji), confetti, squish, press-spring and error shake — combinable, keyboard-friendly, optional haptics.
|
|
6
|
+
|
|
7
|
+
- **Category:** click
|
|
8
|
+
- **Import:** `import { defineClick } from 'motionary/components/click'` then `defineClick();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `effect`, `disabled`
|
|
11
|
+
- **Events:** `usa:click-effect`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `play()`, `shake()`
|
|
14
|
+
- **Source:** [src/components/click/click.ts](../../src/components/click/click.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-click effect="press-spring burst" shape="star">
|
|
20
|
+
<button>Celebrate</button>
|
|
21
|
+
</usa-click>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## ES module
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import { defineClick } from 'motionary/components/click';
|
|
28
|
+
|
|
29
|
+
defineClick(); // registers <usa-click>
|
|
30
|
+
|
|
31
|
+
/* then use it in your HTML:
|
|
32
|
+
<usa-click effect="press-spring burst" shape="star">
|
|
33
|
+
<button>Celebrate</button>
|
|
34
|
+
</usa-click>
|
|
35
|
+
*/
|
|
36
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# `<usa-clock-control>` — Motion clock control
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
8.0: a pause / speed bar for the unified motion clock — pause, slow down or speed up every Motionary animation and frame loop on the page at once (motionClock in motionary/engine).
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 8.0
|
|
8
|
+
- **Import:** `import { defineClockControl } from 'motionary/components/widgets'` then `defineClockControl();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `speeds`, `label`
|
|
11
|
+
- **Events:** `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/widgets/clock-control.ts](../../src/components/widgets/clock-control.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-clock-control speeds="0.25,0.5,1,2"></usa-clock-control>
|
|
20
|
+
<script type="module">
|
|
21
|
+
import { motionClock, createTimeline } from 'motionary/engine';
|
|
22
|
+
motionClock.rate = 0.5;
|
|
23
|
+
createTimeline().add(a, [{ opacity: 0 }, { opacity: 1 }], 400).add(b, [{ transform: 'scale(0)' }, { transform: 'none' }], 500, '-=200').play();
|
|
24
|
+
</script>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## ES module
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
import { defineClockControl } from 'motionary/components/widgets';
|
|
31
|
+
|
|
32
|
+
defineClockControl(); // registers <usa-clock-control>
|
|
33
|
+
|
|
34
|
+
/* then use it in your HTML:
|
|
35
|
+
<usa-clock-control speeds="0.25,0.5,1,2"></usa-clock-control>
|
|
36
|
+
*/
|
|
37
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# `<usa-code-export>` — Code export
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
8.9 low-code: shows copy-paste code (HTML, React, Vue or JSON) for a live, configured component next to it, follows its attribute changes and copies with one click.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 8.9
|
|
8
|
+
- **Import:** `import { defineCodeExport } from 'motionary/components/widgets'` then `defineCodeExport();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `for`, `formats`
|
|
11
|
+
- **Events:** `usa:copy`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `copy()`
|
|
14
|
+
- **Source:** [src/components/widgets/code-export.ts](../../src/components/widgets/code-export.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-code-export formats="html,react,vue">
|
|
20
|
+
<usa-star-rating value="4"></usa-star-rating>
|
|
21
|
+
</usa-code-export>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## ES module
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import { defineCodeExport } from 'motionary/components/widgets';
|
|
28
|
+
|
|
29
|
+
defineCodeExport(); // registers <usa-code-export>
|
|
30
|
+
|
|
31
|
+
/* then use it in your HTML:
|
|
32
|
+
<usa-code-export formats="html,react,vue">
|
|
33
|
+
<usa-star-rating value="4"></usa-star-rating>
|
|
34
|
+
</usa-code-export>
|
|
35
|
+
*/
|
|
36
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-color-picker>` — Color picker
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
6.9: a saturation / brightness square and a hue strip with spring-follow thumbs (both keyboard sliders), a preview chip that morphs to the new colour and swatches that pop.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 6.9
|
|
8
|
+
- **Import:** `import { defineColorPicker } from 'motionary/components/widgets'` then `defineColorPicker();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `swatches`
|
|
11
|
+
- **Events:** `usa:change`, `usa:input`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/widgets/color-picker.ts](../../src/components/widgets/color-picker.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-color-picker value="#7c5cff" swatches="#f43f5e,#f59e0b,#22c55e,#0ea5e9"></usa-color-picker>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineColorPicker } from 'motionary/components/widgets';
|
|
26
|
+
|
|
27
|
+
defineColorPicker(); // registers <usa-color-picker>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-color-picker value="#7c5cff" swatches="#f43f5e,#f59e0b,#22c55e,#0ea5e9"></usa-color-picker>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# `<usa-command-palette>` — Command palette (⌘K)
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
7.9: a ⌘K command palette on the native <dialog> — scales in, filters as you type with fuzzy matching and highlighted letters, results stagger in and a highlight glides between rows (↑ ↓ Enter).
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 7.9
|
|
8
|
+
- **Import:** `import { defineCommandPalette } from 'motionary/components/widgets'` then `defineCommandPalette();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `placeholder`, `label`, `hotkey`, `inline`
|
|
11
|
+
- **Events:** `usa:run`, `usa:open`, `usa:close`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `setCommands()`, `show()`, `close()`, `toggle()`
|
|
14
|
+
- **Source:** [src/components/widgets/command-palette.ts](../../src/components/widgets/command-palette.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-command-palette>
|
|
20
|
+
<option value="new" data-group="File" data-keys="mod+n">New file</option>
|
|
21
|
+
<option value="theme" data-group="View">Toggle theme</option>
|
|
22
|
+
</usa-command-palette>
|
|
23
|
+
<script>palette.addEventListener('usa:run', (e) => run(e.detail.id));</script>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineCommandPalette } from 'motionary/components/widgets';
|
|
30
|
+
|
|
31
|
+
defineCommandPalette(); // registers <usa-command-palette>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-command-palette>
|
|
35
|
+
<option value="new" data-group="File" data-keys="mod+n">New file</option>
|
|
36
|
+
<option value="theme" data-group="View">Toggle theme</option>
|
|
37
|
+
</usa-command-palette>
|
|
38
|
+
*/
|
|
39
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# `<usa-compare>` — Before / after compare
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
6.5: drag the handle (or hover with the hover attribute), click to jump, or use the keyboard slider; horizontal or vertical; an intro sweep plays once when it scrolls into view.
|
|
6
|
+
|
|
7
|
+
- **Category:** interaction · **since** 6.5
|
|
8
|
+
- **Import:** `import { defineCompare } from 'motionary/components/widgets'` then `defineCompare();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `orientation`, `labels`
|
|
11
|
+
- **Events:** `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/widgets/compare.ts](../../src/components/widgets/compare.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-compare labels="Before,After" intro>
|
|
20
|
+
<img src="before.jpg" alt="Before">
|
|
21
|
+
<img src="after.jpg" alt="After">
|
|
22
|
+
</usa-compare>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## ES module
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import { defineCompare } from 'motionary/components/widgets';
|
|
29
|
+
|
|
30
|
+
defineCompare(); // registers <usa-compare>
|
|
31
|
+
|
|
32
|
+
/* then use it in your HTML:
|
|
33
|
+
<usa-compare labels="Before,After" intro>
|
|
34
|
+
<img src="before.jpg" alt="Before">
|
|
35
|
+
<img src="after.jpg" alt="After">
|
|
36
|
+
</usa-compare>
|
|
37
|
+
*/
|
|
38
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-countdown>` — Flip countdown
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
7.3: a split-flap countdown to a date (to) or for a number of seconds — every digit flips when it changes; fires usa:done at zero. The timer label updates once a minute so screen readers are not flooded.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 7.3
|
|
8
|
+
- **Import:** `import { defineCountdown } from 'motionary/components/widgets'` then `defineCountdown();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `to`, `seconds`
|
|
11
|
+
- **Events:** `usa:tick`, `usa:done`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `start()`, `stop()`
|
|
14
|
+
- **Source:** [src/components/widgets/countdown.ts](../../src/components/widgets/countdown.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-countdown to="2026-12-24T00:00:00" units="d,h,m,s"></usa-countdown>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineCountdown } from 'motionary/components/widgets';
|
|
26
|
+
|
|
27
|
+
defineCountdown(); // registers <usa-countdown>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-countdown to="2026-12-24T00:00:00" units="d,h,m,s"></usa-countdown>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-counter>` — Number counter
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
Counts up to a number when visible, locale-formatted with tabular digits. Set .value to animate live dashboards.
|
|
6
|
+
|
|
7
|
+
- **Category:** text
|
|
8
|
+
- **Import:** `import { defineCounter } from 'motionary/components/text'` then `defineCounter();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `to`, `decimals`, `locale`, `prefix`, `suffix`, `grouping`
|
|
11
|
+
- **Events:** `usa:complete`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `play()`, `format()`
|
|
14
|
+
- **Source:** [src/components/text/counter.ts](../../src/components/text/counter.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-counter to="128490" prefix="$" duration="2000"></usa-counter>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineCounter } from 'motionary/components/text';
|
|
26
|
+
|
|
27
|
+
defineCounter(); // registers <usa-counter>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-counter to="128490" prefix="$" duration="2000"></usa-counter>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `<usa-cube-gallery>` — Cube gallery
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
6.5: slides sit on adjacent faces of a 3D cube that turns between them — swipe, arrow keys, buttons or autoplay (pauses on hover / focus / off screen); turn around the Y or X axis.
|
|
6
|
+
|
|
7
|
+
- **Category:** cards · **since** 6.5
|
|
8
|
+
- **Import:** `import { defineCubeGallery } from 'motionary/components/widgets'` then `defineCubeGallery();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `axis`, `autoplay`
|
|
11
|
+
- **Events:** `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `next()`, `prev()`, `goTo()`
|
|
14
|
+
- **Source:** [src/components/widgets/cube-gallery.ts](../../src/components/widgets/cube-gallery.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-cube-gallery autoplay="4000" label="Products">
|
|
20
|
+
<img src="a.jpg" alt="…">
|
|
21
|
+
<img src="b.jpg" alt="…">
|
|
22
|
+
<img src="c.jpg" alt="…">
|
|
23
|
+
</usa-cube-gallery>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineCubeGallery } from 'motionary/components/widgets';
|
|
30
|
+
|
|
31
|
+
defineCubeGallery(); // registers <usa-cube-gallery>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-cube-gallery autoplay="4000" label="Products">
|
|
35
|
+
<img src="a.jpg" alt="…">
|
|
36
|
+
<img src="b.jpg" alt="…">
|
|
37
|
+
<img src="c.jpg" alt="…">
|
|
38
|
+
</usa-cube-gallery>
|
|
39
|
+
*/
|
|
40
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# `<usa-cube>` — 3D cube
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
Up to six children become the faces of a CSS 3D cube. Drag / swipe, arrow keys, autoplay or show("top"); spring-driven, the front face is the only one exposed to screen readers.
|
|
6
|
+
|
|
7
|
+
- **Category:** depth
|
|
8
|
+
- **Import:** `import { defineCube } from 'motionary/components/depth'` then `defineCube();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `size`, `autoplay`
|
|
11
|
+
- **Events:** `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `show()`, `next()`, `prev()`
|
|
14
|
+
- **Source:** [src/components/depth/cube.ts](../../src/components/depth/cube.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-cube size="200" autoplay="3000">
|
|
20
|
+
<div>Front</div><div>Right</div><div>Back</div><div>Left</div>
|
|
21
|
+
</usa-cube>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## ES module
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import { defineCube } from 'motionary/components/depth';
|
|
28
|
+
|
|
29
|
+
defineCube(); // registers <usa-cube>
|
|
30
|
+
|
|
31
|
+
/* then use it in your HTML:
|
|
32
|
+
<usa-cube size="200" autoplay="3000">
|
|
33
|
+
<div>Front</div><div>Right</div><div>Back</div><div>Left</div>
|
|
34
|
+
</usa-cube>
|
|
35
|
+
*/
|
|
36
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-cursor>` — Custom cursor
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
A spring-lagged ring, a magnetic ring that wraps buttons and links, or a soft glow following the pointer. Mouse / pen only. (6.0: for a comet tail use the comet-trail effect.)
|
|
6
|
+
|
|
7
|
+
- **Category:** page
|
|
8
|
+
- **Import:** `import { defineCursor } from 'motionary/components/page'` then `defineCursor();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `mode`, `size`, `color`, `hide-native`
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/page/cursor.ts](../../src/components/page/cursor.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-cursor mode="magnetic" hide-native></usa-cursor>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineCursor } from 'motionary/components/page';
|
|
26
|
+
|
|
27
|
+
defineCursor(); // registers <usa-cursor>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-cursor mode="magnetic" hide-native></usa-cursor>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-date-picker>` — Date picker
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
6.9: months slide in from the direction of travel, the chosen day pops inside a spring circle, today has a ring. A real date grid: arrows, PageUp / PageDown, Home / End, min / max.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 6.9
|
|
8
|
+
- **Import:** `import { defineDatePicker } from 'motionary/components/widgets'` then `defineDatePicker();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `min`, `max`, `first-day`, `locale`
|
|
11
|
+
- **Events:** `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `showMonth()`
|
|
14
|
+
- **Source:** [src/components/widgets/date-picker.ts](../../src/components/widgets/date-picker.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-date-picker value="2026-10-08" min="2026-01-01" first-day="1"></usa-date-picker>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineDatePicker } from 'motionary/components/widgets';
|
|
26
|
+
|
|
27
|
+
defineDatePicker(); // registers <usa-date-picker>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-date-picker value="2026-10-08" min="2026-01-01" first-day="1"></usa-date-picker>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# `<usa-depth>` — Depth parallax
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
Layers with data-depth (-1…1) shift and scale by depth as the pointer moves, the phone tilts (source="orientation") or the page scrolls; optional whole-scene rotation.
|
|
6
|
+
|
|
7
|
+
- **Category:** depth
|
|
8
|
+
- **Import:** `import { defineDepth } from 'motionary/components/depth'` then `defineDepth();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `source`, `strength`, `rotate`
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `requestPermission()`
|
|
14
|
+
- **Source:** [src/components/depth/depth-el.ts](../../src/components/depth/depth-el.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-depth source="pointer orientation" strength="40" rotate="6">
|
|
20
|
+
<div class="scene">
|
|
21
|
+
<img data-depth="-0.6" src="sky.png" alt="">
|
|
22
|
+
<img data-depth="0.2" src="hills.png" alt="">
|
|
23
|
+
<h2 data-depth="0.8">Title</h2>
|
|
24
|
+
</div>
|
|
25
|
+
</usa-depth>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## ES module
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
import { defineDepth } from 'motionary/components/depth';
|
|
32
|
+
|
|
33
|
+
defineDepth(); // registers <usa-depth>
|
|
34
|
+
|
|
35
|
+
/* then use it in your HTML:
|
|
36
|
+
<usa-depth source="pointer orientation" strength="40" rotate="6">
|
|
37
|
+
<div class="scene">
|
|
38
|
+
<img data-depth="-0.6" src="sky.png" alt="">
|
|
39
|
+
<img data-depth="0.2" src="hills.png" alt="">
|
|
40
|
+
<h2 data-depth="0.8">Title</h2>
|
|
41
|
+
</div>
|
|
42
|
+
</usa-depth>
|
|
43
|
+
*/
|
|
44
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `<usa-dialog>` — Modal & drawer
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
Animated modal, side drawers and bottom sheet on the native <dialog>: top layer, focus trap, Esc, backdrop click.
|
|
6
|
+
|
|
7
|
+
- **Category:** transitions
|
|
8
|
+
- **Import:** `import { defineDialog } from 'motionary/components/transitions'` then `defineDialog();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `open`, `kind`, `label`
|
|
11
|
+
- **Events:** `usa:open`, `usa:beforeclose`, `usa:close`
|
|
12
|
+
- **Slots:** default
|
|
13
|
+
- **Methods:** `show()`, `close()`
|
|
14
|
+
- **Source:** [src/components/transitions/dialog.ts](../../src/components/transitions/dialog.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-dialog id="dlg" kind="modal" label="Settings">
|
|
20
|
+
<h2>Settings</h2>
|
|
21
|
+
<button data-close>Done</button>
|
|
22
|
+
</usa-dialog>
|
|
23
|
+
<button onclick="dlg.show()">Open</button>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineDialog } from 'motionary/components/transitions';
|
|
30
|
+
|
|
31
|
+
defineDialog(); // registers <usa-dialog>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-dialog id="dlg" kind="modal" label="Settings">
|
|
35
|
+
<h2>Settings</h2>
|
|
36
|
+
<button data-close>Done</button>
|
|
37
|
+
</usa-dialog>
|
|
38
|
+
<button onclick="dlg.show()">Open</button>
|
|
39
|
+
*/
|
|
40
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# `<usa-disclosure>` — Accordion 2.0
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
6.2: native <details> that spring open and closed (height + fade) with an overshooting chevron; one open at a time unless multiple. Find-in-page and keyboard keep working.
|
|
6
|
+
|
|
7
|
+
- **Category:** transitions · **since** 6.2
|
|
8
|
+
- **Import:** `import { defineDisclosure } from 'motionary/components/widgets'` then `defineDisclosure();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** —
|
|
11
|
+
- **Events:** `usa:toggle`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `toggle()`, `openAll()`, `closeAll()`
|
|
14
|
+
- **Source:** [src/components/widgets/disclosure.ts](../../src/components/widgets/disclosure.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-disclosure variant="cards">
|
|
20
|
+
<details><summary>Shipping</summary><p>…</p></details>
|
|
21
|
+
<details><summary>Returns</summary><p>…</p></details>
|
|
22
|
+
</usa-disclosure>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## ES module
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import { defineDisclosure } from 'motionary/components/widgets';
|
|
29
|
+
|
|
30
|
+
defineDisclosure(); // registers <usa-disclosure>
|
|
31
|
+
|
|
32
|
+
/* then use it in your HTML:
|
|
33
|
+
<usa-disclosure variant="cards">
|
|
34
|
+
<details><summary>Shipping</summary><p>…</p></details>
|
|
35
|
+
<details><summary>Returns</summary><p>…</p></details>
|
|
36
|
+
</usa-disclosure>
|
|
37
|
+
*/
|
|
38
|
+
```
|