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,44 @@
|
|
|
1
|
+
# `<usa-menu>` — Dropdown menu
|
|
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.3: the list scales (or folds / slides) out of its button and the items cascade in. Full menu keyboard support — arrows, Home / End, Esc, Tab — and outside clicks close it.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 6.3
|
|
8
|
+
- **Import:** `import { defineMenu } from 'motionary/components/widgets'` then `defineMenu();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `placement`, `effect`
|
|
11
|
+
- **Events:** `usa:select`, `usa:open`, `usa:close`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `open()`, `close()`, `toggle()`
|
|
14
|
+
- **Source:** [src/components/widgets/menu.ts](../../src/components/widgets/menu.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-menu placement="bottom-start" effect="scale">
|
|
20
|
+
<button>Actions ▾</button>
|
|
21
|
+
<button>Edit</button>
|
|
22
|
+
<button>Duplicate</button>
|
|
23
|
+
<hr>
|
|
24
|
+
<button>Delete</button>
|
|
25
|
+
</usa-menu>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## ES module
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
import { defineMenu } from 'motionary/components/widgets';
|
|
32
|
+
|
|
33
|
+
defineMenu(); // registers <usa-menu>
|
|
34
|
+
|
|
35
|
+
/* then use it in your HTML:
|
|
36
|
+
<usa-menu placement="bottom-start" effect="scale">
|
|
37
|
+
<button>Actions ▾</button>
|
|
38
|
+
<button>Edit</button>
|
|
39
|
+
<button>Duplicate</button>
|
|
40
|
+
<hr>
|
|
41
|
+
<button>Delete</button>
|
|
42
|
+
</usa-menu>
|
|
43
|
+
*/
|
|
44
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# `<usa-message-list>` — Chat thread
|
|
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.4: a chat thread — new bubbles pop in from their side, consecutive messages group, the list sticks to the bottom (or shows a “↓ New messages” pill when you scrolled up) and typing(name) shows animated typing dots.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 7.4
|
|
8
|
+
- **Import:** `import { defineMessageList } from 'motionary/components/widgets'` then `defineMessageList();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** —
|
|
11
|
+
- **Events:** `usa:message`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `push()`, `typing()`
|
|
14
|
+
- **Source:** [src/components/widgets/message-list.ts](../../src/components/widgets/message-list.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-message-list>
|
|
20
|
+
<p data-from="Ada">Hi! 👋</p>
|
|
21
|
+
<p data-me>Hey Ada</p>
|
|
22
|
+
</usa-message-list>
|
|
23
|
+
<script>list.typing('Ada'); list.push({ from: 'Ada', text: 'Ship it?' });</script>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineMessageList } from 'motionary/components/widgets';
|
|
30
|
+
|
|
31
|
+
defineMessageList(); // registers <usa-message-list>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-message-list>
|
|
35
|
+
<p data-from="Ada">Hi! 👋</p>
|
|
36
|
+
<p data-me>Hey Ada</p>
|
|
37
|
+
</usa-message-list>
|
|
38
|
+
*/
|
|
39
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `<usa-milestones>` — Scroll-drawn milestones
|
|
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: a progress line grows down the rail as you scroll; each milestone pops its dot and slides its card in when the line reaches it. Alternating sides on wide screens, one column on phones; data-date labels.
|
|
6
|
+
|
|
7
|
+
- **Category:** timeline · **since** 6.5
|
|
8
|
+
- **Import:** `import { defineMilestones } from 'motionary/components/widgets'` then `defineMilestones();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `layout`
|
|
11
|
+
- **Events:** `usa:reach`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/widgets/milestones.ts](../../src/components/widgets/milestones.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-milestones>
|
|
20
|
+
<div data-date="2024"><h3>Idea</h3><p>…</p></div>
|
|
21
|
+
<div data-date="2025"><h3>Beta</h3><p>…</p></div>
|
|
22
|
+
<div data-date="2026"><h3>Launch</h3><p>…</p></div>
|
|
23
|
+
</usa-milestones>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineMilestones } from 'motionary/components/widgets';
|
|
30
|
+
|
|
31
|
+
defineMilestones(); // registers <usa-milestones>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-milestones>
|
|
35
|
+
<div data-date="2024"><h3>Idea</h3><p>…</p></div>
|
|
36
|
+
<div data-date="2025"><h3>Beta</h3><p>…</p></div>
|
|
37
|
+
<div data-date="2026"><h3>Launch</h3><p>…</p></div>
|
|
38
|
+
</usa-milestones>
|
|
39
|
+
*/
|
|
40
|
+
```
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# `<usa-modal>` — Modal dialog
|
|
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.3: native <dialog> (top layer, focus trap, Esc) with animated open / close and a blurred backdrop — scale, slide-up, flip, or origin: it grows out of the button that opened it. Focus returns to the opener.
|
|
6
|
+
|
|
7
|
+
- **Category:** transitions · **since** 6.3
|
|
8
|
+
- **Import:** `import { defineModal } from 'motionary/components/widgets'` then `defineModal();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** —
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [undefined](../../undefined)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<button data-usa-open="welcome">Open</button>
|
|
20
|
+
<usa-modal id="welcome" effect="origin" label="Welcome">
|
|
21
|
+
<h2>Hello 👋</h2>
|
|
22
|
+
<p>…</p>
|
|
23
|
+
<button data-usa-close="ok">Got it</button>
|
|
24
|
+
</usa-modal>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## ES module
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
import { defineModal } from 'motionary/components/widgets';
|
|
31
|
+
|
|
32
|
+
defineModal(); // registers <usa-modal>
|
|
33
|
+
|
|
34
|
+
/* then use it in your HTML:
|
|
35
|
+
<button data-usa-open="welcome">Open</button>
|
|
36
|
+
<usa-modal id="welcome" effect="origin" label="Welcome">
|
|
37
|
+
<h2>Hello 👋</h2>
|
|
38
|
+
<p>…</p>
|
|
39
|
+
<button data-usa-close="ok">Got it</button>
|
|
40
|
+
</usa-modal>
|
|
41
|
+
*/
|
|
42
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# `<usa-morph>` — Path morph
|
|
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
|
+
Morph an SVG path through a list of shapes (paths="A | B | C") on click, hover, in view or automatically. Same-structure paths morph point by point.
|
|
6
|
+
|
|
7
|
+
- **Category:** svg
|
|
8
|
+
- **Import:** `import { defineMorph } from 'motionary/components/svg'` then `defineMorph();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `paths`, `trigger`
|
|
11
|
+
- **Events:** `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `next()`
|
|
14
|
+
- **Source:** [src/components/svg/morph.ts](../../src/components/svg/morph.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-morph trigger="auto" interval="1800"
|
|
20
|
+
paths="M50 10 C75 10 90 30 90 50 C90 75 70 90 50 90 C25 90 10 70 10 50 C10 30 25 10 50 10 Z | M50 4 C80 20 96 26 86 54 C78 84 64 96 44 86 C14 80 4 64 14 44 C20 20 30 0 50 4 Z"></usa-morph>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## ES module
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
import { defineMorph } from 'motionary/components/svg';
|
|
27
|
+
|
|
28
|
+
defineMorph(); // registers <usa-morph>
|
|
29
|
+
|
|
30
|
+
/* then use it in your HTML:
|
|
31
|
+
<usa-morph trigger="auto" interval="1800"
|
|
32
|
+
paths="M50 10 C75 10 90 30 90 50 C90 75 70 90 50 90 C25 90 10 70 10 50 C10 30 25 10 50 10 Z | M50 4 C80 20 96 26 86 54 C78 84 64 96 44 86 C14 80 4 64 14 44 C20 20 30 0 50 4 Z"></usa-morph>
|
|
33
|
+
*/
|
|
34
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-motion-inspector>` — Motion inspector
|
|
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
|
+
10.2: a live panel listing the running animations in a scope (CSS animations, transitions, element.animate(), components) with state and progress, plus the motionary/runtime ticker when present — pause / play all, 0.25× slow motion and per-row scrub.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 10.2
|
|
8
|
+
- **Import:** `import { defineMotionInspector } from 'motionary/components/widgets'` then `defineMotionInspector();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `scope`, `interval`
|
|
11
|
+
- **Events:** `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `refresh()`, `pauseAll()`, `playAll()`, `setRate()`, `animations()`
|
|
14
|
+
- **Source:** [src/components/widgets/motion-inspector.ts](../../src/components/widgets/motion-inspector.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-motion-inspector scope="#app" interval="500"></usa-motion-inspector>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineMotionInspector } from 'motionary/components/widgets';
|
|
26
|
+
|
|
27
|
+
defineMotionInspector(); // registers <usa-motion-inspector>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-motion-inspector scope="#app" interval="500"></usa-motion-inspector>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-motion-prefs>` — Motion preference panel
|
|
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
|
+
9.5: a motion settings panel for your users — motion level (full, gentle, minimal, none), animation speed, pause autoplaying video, no parallax — applied instantly to every Motionary animation and remembered.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 9.5
|
|
8
|
+
- **Import:** `import { defineMotionPrefs } from 'motionary/components/widgets'` then `defineMotionPrefs();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `label`
|
|
11
|
+
- **Events:** `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `reset()`
|
|
14
|
+
- **Source:** [src/components/widgets/motion-prefs.ts](../../src/components/widgets/motion-prefs.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-motion-prefs></usa-motion-prefs>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineMotionPrefs } from 'motionary/components/widgets';
|
|
26
|
+
|
|
27
|
+
defineMotionPrefs(); // registers <usa-motion-prefs>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-motion-prefs></usa-motion-prefs>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-motion-spec>` — Motion spec sheet
|
|
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
|
+
9.7: a motion spec sheet for design hand-off — each rule of a motion string with its trigger, a duration bar on a shared timeline and the easing curve, a Play playhead and Copy CSS; pairs with the Figma plugin and Framer export of motionary/design.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 9.7
|
|
8
|
+
- **Import:** `import { defineMotionSpec } from 'motionary/components/widgets'` then `defineMotionSpec();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `rules`, `label`
|
|
11
|
+
- **Events:** `usa:copy`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `play()`
|
|
14
|
+
- **Source:** [src/components/widgets/motion-spec.ts](../../src/components/widgets/motion-spec.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-motion-spec label="Card entrance" rules="enter: fade-up 600ms ease-out stagger 80ms; hover: pop 300ms spring"></usa-motion-spec>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineMotionSpec } from 'motionary/components/widgets';
|
|
26
|
+
|
|
27
|
+
defineMotionSpec(); // registers <usa-motion-spec>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-motion-spec label="Card entrance" rules="enter: fade-up 600ms ease-out stagger 80ms; hover: pop 300ms spring"></usa-motion-spec>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# `<usa-motion-switch>` — Motion intensity
|
|
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
|
+
Let users pick Off · Low · Normal · High for the whole app; scales every component, persists, and Off equals reduced motion.
|
|
6
|
+
|
|
7
|
+
- **Category:** page
|
|
8
|
+
- **Import:** `import { defineMotionSwitch } from 'motionary/components/page'` then `defineMotionSwitch();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** —
|
|
11
|
+
- **Events:** `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/page/motion-switch.ts](../../src/components/page/motion-switch.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-motion-switch></usa-motion-switch>
|
|
20
|
+
<!-- or: setMotionIntensity('low', true) -->
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## ES module
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
import { defineMotionSwitch } from 'motionary/components/page';
|
|
27
|
+
|
|
28
|
+
defineMotionSwitch(); // registers <usa-motion-switch>
|
|
29
|
+
|
|
30
|
+
/* then use it in your HTML:
|
|
31
|
+
<usa-motion-switch></usa-motion-switch>
|
|
32
|
+
<!-- or: setMotionIntensity('low', true) -->
|
|
33
|
+
*/
|
|
34
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `<usa-motion-theme>` — Theme packs
|
|
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
|
+
5.8: <usa-motion-theme name> applies a theme pack — design tokens (--usa-theme-*), motion tokens and effect presets per role (enter / hover / click / attention / background). Neon, paper, glass, retro and brutalist; applyMotionTheme() for the whole page.
|
|
6
|
+
|
|
7
|
+
- **Category:** fx
|
|
8
|
+
- **Import:** `import { defineMotionTheme } from 'motionary/components/effects'` then `defineMotionTheme();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `name`
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/effects/themes.ts](../../src/components/effects/themes.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-motion-theme name="neon">
|
|
20
|
+
<div class="usa-surface">
|
|
21
|
+
<button data-theme-fx="click">Tap</button>
|
|
22
|
+
</div>
|
|
23
|
+
</usa-motion-theme>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineMotionTheme } from 'motionary/components/effects';
|
|
30
|
+
|
|
31
|
+
defineMotionTheme(); // registers <usa-motion-theme>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-motion-theme name="neon">
|
|
35
|
+
<div class="usa-surface">
|
|
36
|
+
<button data-theme-fx="click">Tap</button>
|
|
37
|
+
</div>
|
|
38
|
+
</usa-motion-theme>
|
|
39
|
+
*/
|
|
40
|
+
```
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# `<usa-motion>` — Motion DSL
|
|
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
|
+
9.0: the declarative motion DSL — describe motion as one readable string (“enter: fade-up 600ms stagger 80ms; hover: pop”) on <usa-motion> or any element’s data-motion, no JavaScript per element.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 9.0
|
|
8
|
+
- **Import:** `import { defineMotion } from 'motionary/components/widgets'` then `defineMotion();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `rules`
|
|
11
|
+
- **Events:** `usa:motion-error`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/widgets/motion.ts](../../src/components/widgets/motion.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-motion rules="enter: fade-up 600ms ease-out stagger 80ms; hover: pop">
|
|
20
|
+
<div class="card">One</div><div class="card">Two</div><div class="card">Three</div>
|
|
21
|
+
</usa-motion>
|
|
22
|
+
|
|
23
|
+
<!-- or on any element, with applyMotion() from motionary/dsl -->
|
|
24
|
+
<section data-motion="enter: fade-up 500ms; click: confetti count=40">…</section>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## ES module
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
import { defineMotion } from 'motionary/components/widgets';
|
|
31
|
+
|
|
32
|
+
defineMotion(); // registers <usa-motion>
|
|
33
|
+
|
|
34
|
+
/* then use it in your HTML:
|
|
35
|
+
<usa-motion rules="enter: fade-up 600ms ease-out stagger 80ms; hover: pop">
|
|
36
|
+
<div class="card">One</div><div class="card">Two</div><div class="card">Three</div>
|
|
37
|
+
</usa-motion>
|
|
38
|
+
|
|
39
|
+
<!-- or on any element, with applyMotion() from motionary/dsl -->
|
|
40
|
+
<section data-motion="enter: fade-up 500ms; click: confetti count=40">…</section>
|
|
41
|
+
*/
|
|
42
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# `<usa-music-player>` — Music player
|
|
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.1: the cover spins like a record while playing, play morphs to pause, mini equalizer bars dance and the progress bar is a scrubbable slider. Plays a child <audio> or simulates a track.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 7.1
|
|
8
|
+
- **Import:** `import { defineMusicPlayer } from 'motionary/components/widgets'` then `defineMusicPlayer();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `title`, `artist`, `cover`, `src`
|
|
11
|
+
- **Events:** `usa:play`, `usa:pause`, `usa:seek`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `play()`, `pause()`, `toggle()`, `seek()`
|
|
14
|
+
- **Source:** [src/components/widgets/music-player.ts](../../src/components/widgets/music-player.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-music-player title="Night Drive" artist="Motionary" cover="cover.jpg">
|
|
20
|
+
<audio src="track.mp3"></audio>
|
|
21
|
+
</usa-music-player>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## ES module
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import { defineMusicPlayer } from 'motionary/components/widgets';
|
|
28
|
+
|
|
29
|
+
defineMusicPlayer(); // registers <usa-music-player>
|
|
30
|
+
|
|
31
|
+
/* then use it in your HTML:
|
|
32
|
+
<usa-music-player title="Night Drive" artist="Motionary" cover="cover.jpg">
|
|
33
|
+
<audio src="track.mp3"></audio>
|
|
34
|
+
</usa-music-player>
|
|
35
|
+
*/
|
|
36
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# `<usa-native-preview>` — Native preview
|
|
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
|
+
9.8: preview web motion as it will feel on a phone — an iOS / Android device frame replays the entrance with the rule’s curve and presses with a spring — and copy the generated React Native and Flutter code.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 9.8
|
|
8
|
+
- **Import:** `import { defineNativePreview } from 'motionary/components/widgets'` then `defineNativePreview();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `rules`, `platform`, `name`
|
|
11
|
+
- **Events:** `usa:replay`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `replay()`, `code()`
|
|
14
|
+
- **Source:** [src/components/widgets/native-preview.ts](../../src/components/widgets/native-preview.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-native-preview platform="ios" rules="enter: fade-up 500ms smooth stagger 80ms; click: pop">
|
|
20
|
+
<div class="row">Inbox</div><div class="row">Starred</div>
|
|
21
|
+
</usa-native-preview>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## ES module
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import { defineNativePreview } from 'motionary/components/widgets';
|
|
28
|
+
|
|
29
|
+
defineNativePreview(); // registers <usa-native-preview>
|
|
30
|
+
|
|
31
|
+
/* then use it in your HTML:
|
|
32
|
+
<usa-native-preview platform="ios" rules="enter: fade-up 500ms smooth stagger 80ms; click: pop">
|
|
33
|
+
<div class="row">Inbox</div><div class="row">Starred</div>
|
|
34
|
+
</usa-native-preview>
|
|
35
|
+
*/
|
|
36
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `<usa-nav-morph>` — Navbar with morphing indicator
|
|
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.6: the indicator follows the hovered or focused link — stretching from the old one, leading edge first — and settles back on the current page. Underline, pill, blob or dot.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 6.6
|
|
8
|
+
- **Import:** `import { defineNavMorph } from 'motionary/components/widgets'` then `defineNavMorph();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `indicator`
|
|
11
|
+
- **Events:** `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/widgets/nav-morph.ts](../../src/components/widgets/nav-morph.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-nav-morph indicator="underline" label="Main">
|
|
20
|
+
<a href="/" aria-current="page">Home</a>
|
|
21
|
+
<a href="/docs">Docs</a>
|
|
22
|
+
<a href="/blog">Blog</a>
|
|
23
|
+
</usa-nav-morph>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineNavMorph } from 'motionary/components/widgets';
|
|
30
|
+
|
|
31
|
+
defineNavMorph(); // registers <usa-nav-morph>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-nav-morph indicator="underline" label="Main">
|
|
35
|
+
<a href="/" aria-current="page">Home</a>
|
|
36
|
+
<a href="/docs">Docs</a>
|
|
37
|
+
<a href="/blog">Blog</a>
|
|
38
|
+
</usa-nav-morph>
|
|
39
|
+
*/
|
|
40
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# `<usa-navbar>` — Auto-hide navbar
|
|
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
|
+
Hides while you scroll down, slides back on the first scroll up; shrink makes it compact once scrolled. This page’s demo scrolls an inner box.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui
|
|
8
|
+
- **Import:** `import { defineNavbar } from 'motionary/components/ui'` then `defineNavbar();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** —
|
|
11
|
+
- **Events:** `usa:hide`, `usa:show`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `show()`
|
|
14
|
+
- **Source:** [src/components/ui/navbar.ts](../../src/components/ui/navbar.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-navbar shrink>
|
|
20
|
+
<header>…</header>
|
|
21
|
+
</usa-navbar>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## ES module
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import { defineNavbar } from 'motionary/components/ui';
|
|
28
|
+
|
|
29
|
+
defineNavbar(); // registers <usa-navbar>
|
|
30
|
+
|
|
31
|
+
/* then use it in your HTML:
|
|
32
|
+
<usa-navbar shrink>
|
|
33
|
+
<header>…</header>
|
|
34
|
+
</usa-navbar>
|
|
35
|
+
*/
|
|
36
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# `<usa-notification-bell>` — Notification bell
|
|
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.4: a bell with an unread badge and a dropdown — notify() swings the bell, bumps the badge and slides the notice in; “Mark all read” shrinks the badge away. Esc / outside click close it.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 7.4
|
|
8
|
+
- **Import:** `import { defineNotificationBell } from 'motionary/components/widgets'` then `defineNotificationBell();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** —
|
|
11
|
+
- **Events:** `usa:notify`, `usa:read`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `notify()`, `markAllRead()`, `ring()`
|
|
14
|
+
- **Source:** [src/components/widgets/notification-bell.ts](../../src/components/widgets/notification-bell.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-notification-bell>
|
|
20
|
+
<li data-time="2m">Ada liked your post</li>
|
|
21
|
+
</usa-notification-bell>
|
|
22
|
+
<script>bell.notify({ text: 'New follower', time: 'now' });</script>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## ES module
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import { defineNotificationBell } from 'motionary/components/widgets';
|
|
29
|
+
|
|
30
|
+
defineNotificationBell(); // registers <usa-notification-bell>
|
|
31
|
+
|
|
32
|
+
/* then use it in your HTML:
|
|
33
|
+
<usa-notification-bell>
|
|
34
|
+
<li data-time="2m">Ada liked your post</li>
|
|
35
|
+
</usa-notification-bell>
|
|
36
|
+
*/
|
|
37
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# `<usa-odometer>` — Odometer 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
|
+
6.4: rolling digit wheels — every digit spins forward to its new value, new digits slide in, locale grouping via Intl.NumberFormat, decimals, prefix / suffix. The accessible name is the formatted number.
|
|
6
|
+
|
|
7
|
+
- **Category:** text · **since** 6.4
|
|
8
|
+
- **Import:** `import { defineOdometer } from 'motionary/components/widgets'` then `defineOdometer();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `value`, `locale`, `decimals`, `prefix`, `suffix`
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/widgets/meters.ts](../../src/components/widgets/meters.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-odometer value="1284" locale="en-US" prefix="$"></usa-odometer>
|
|
20
|
+
<!-- el.value = 2048 rolls every digit -->
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## ES module
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
import { defineOdometer } from 'motionary/components/widgets';
|
|
27
|
+
|
|
28
|
+
defineOdometer(); // registers <usa-odometer>
|
|
29
|
+
|
|
30
|
+
/* then use it in your HTML:
|
|
31
|
+
<usa-odometer value="1284" locale="en-US" prefix="$"></usa-odometer>
|
|
32
|
+
<!-- el.value = 2048 rolls every digit -->
|
|
33
|
+
*/
|
|
34
|
+
```
|