motionary 10.0.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 +36 -0
- package/README.md +82 -0
- package/bin/create-motionary-plugin.mjs +124 -0
- package/dist/chunks/keyframes-W-474DMc.js +183 -0
- package/dist/chunks/keyframes-W-474DMc.js.map +1 -0
- package/dist/chunks/keyframes-ZheOkpt0.cjs +187 -0
- package/dist/chunks/keyframes-ZheOkpt0.cjs.map +1 -0
- package/dist/chunks/registry-BIEjKngP.js +69 -0
- package/dist/chunks/registry-BIEjKngP.js.map +1 -0
- package/dist/chunks/registry-eJgpFAzI.cjs +81 -0
- package/dist/chunks/registry-eJgpFAzI.cjs.map +1 -0
- 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-CBuWYpI-.cjs +487 -0
- package/dist/chunks/tween-CBuWYpI-.cjs.map +1 -0
- package/dist/chunks/tween-CqX1JBuj.js +476 -0
- 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/marketplace.cjs +104 -0
- package/dist/components/marketplace.cjs.map +1 -1
- package/dist/components/marketplace.d.cts +33 -2
- package/dist/components/marketplace.d.ts +33 -2
- package/dist/components/marketplace.js +101 -1
- package/dist/components/marketplace.js.map +1 -1
- package/dist/components/widgets.cjs +623 -199
- package/dist/components/widgets.cjs.map +1 -1
- package/dist/components/widgets.d.cts +186 -2
- package/dist/components/widgets.d.ts +186 -2
- package/dist/components/widgets.js +620 -201
- package/dist/components/widgets.js.map +1 -1
- package/dist/llms-full.txt +3115 -0
- package/dist/llms.txt +211 -0
- package/dist/manifest.json +7820 -0
- package/dist/manifest.schema.json +85 -0
- package/dist/runtime/format-css.cjs +185 -0
- package/dist/runtime/format-css.cjs.map +1 -0
- package/dist/runtime/format-css.d.cts +174 -0
- package/dist/runtime/format-css.d.ts +174 -0
- package/dist/runtime/format-css.iife.js +2 -0
- package/dist/runtime/format-css.iife.js.map +1 -0
- package/dist/runtime/format-css.js +177 -0
- package/dist/runtime/format-css.js.map +1 -0
- package/dist/runtime/format-motion.cjs +139 -0
- package/dist/runtime/format-motion.cjs.map +1 -0
- package/dist/runtime/format-motion.d.cts +208 -0
- package/dist/runtime/format-motion.d.ts +208 -0
- package/dist/runtime/format-motion.iife.js +2 -0
- package/dist/runtime/format-motion.iife.js.map +1 -0
- package/dist/runtime/format-motion.js +133 -0
- package/dist/runtime/format-motion.js.map +1 -0
- 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 +79 -0
- package/dist/runtime.cjs.map +1 -0
- package/dist/runtime.d.cts +236 -0
- package/dist/runtime.d.ts +236 -0
- package/dist/runtime.iife.js +2 -0
- package/dist/runtime.iife.js.map +1 -0
- package/dist/runtime.js +55 -0
- package/dist/runtime.js.map +1 -0
- package/dist/widgets.umd.js +1 -1
- package/dist/widgets.umd.js.map +1 -1
- package/docs/ROADMAP.md +69 -38
- 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 +105 -0
- package/docs/runtime/core.md +55 -0
- package/docs/runtime/format-css.md +59 -0
- package/docs/runtime/format-motion.md +56 -0
- package/docs/runtime/format-svg.md +62 -0
- package/docs/runtime/scroll.md +61 -0
- package/package.json +71 -7
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# `<usa-audio>` — Beat-triggered 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
|
+
5.6: <usa-audio> renders a toggle (a user gesture starts Web Audio), detects beats and plays any registered effect on children with data-usa-beat="effect". JS: bindBeat(el, "pop"). Beats play nothing under reduced motion.
|
|
6
|
+
|
|
7
|
+
- **Category:** fx
|
|
8
|
+
- **Import:** `import { defineAudio } from 'motionary/components/effects'` then `defineAudio();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `source`
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `toggle()`
|
|
14
|
+
- **Source:** [src/components/effects/audio.ts](../../src/components/effects/audio.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<audio id="track" src="song.mp3" controls></audio>
|
|
20
|
+
<usa-audio source="#track" label="Play with visuals">
|
|
21
|
+
<div data-usa-beat="pop">♪</div>
|
|
22
|
+
</usa-audio>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## ES module
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import { defineAudio } from 'motionary/components/effects';
|
|
29
|
+
|
|
30
|
+
defineAudio(); // registers <usa-audio>
|
|
31
|
+
|
|
32
|
+
/* then use it in your HTML:
|
|
33
|
+
<audio id="track" src="song.mp3" controls></audio>
|
|
34
|
+
<usa-audio source="#track" label="Play with visuals">
|
|
35
|
+
<div data-usa-beat="pop">♪</div>
|
|
36
|
+
</usa-audio>
|
|
37
|
+
*/
|
|
38
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# `<usa-aurora>` — Aurora
|
|
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 slow drifting gradient mesh behind its content. Transforms only, paused off-screen, still under reduced motion.
|
|
6
|
+
|
|
7
|
+
- **Category:** background
|
|
8
|
+
- **Import:** `import { defineAurora } from 'motionary/components/background'` then `defineAurora();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `colors`, `speed`, `intensity`
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/background/aurora.ts](../../src/components/background/aurora.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-aurora colors="#7c5cff,#22d3ee,#f472b6">
|
|
20
|
+
<h1>Hero</h1>
|
|
21
|
+
</usa-aurora>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## ES module
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import { defineAurora } from 'motionary/components/background';
|
|
28
|
+
|
|
29
|
+
defineAurora(); // registers <usa-aurora>
|
|
30
|
+
|
|
31
|
+
/* then use it in your HTML:
|
|
32
|
+
<usa-aurora colors="#7c5cff,#22d3ee,#f472b6">
|
|
33
|
+
<h1>Hero</h1>
|
|
34
|
+
</usa-aurora>
|
|
35
|
+
*/
|
|
36
|
+
```
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# `<usa-auto-animate>` — Auto-animate
|
|
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 a list or grid: items that are added fade in, removed ones fade out in place, and everything else glides to its new spot — on sort, filter or resize. Zero code at the call site.
|
|
6
|
+
|
|
7
|
+
- **Category:** layout
|
|
8
|
+
- **Import:** `import { defineAutoAnimate } from 'motionary/components/layout'` then `defineAutoAnimate();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** —
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `enable()`, `disable()`
|
|
14
|
+
- **Source:** [src/components/layout/elements.ts](../../src/components/layout/elements.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-auto-animate>
|
|
20
|
+
<ul class="todo">…</ul>
|
|
21
|
+
</usa-auto-animate>
|
|
22
|
+
|
|
23
|
+
<!-- or on any element: -->
|
|
24
|
+
<script type="module">
|
|
25
|
+
import { autoAnimate } from 'motionary/components/layout';
|
|
26
|
+
autoAnimate(document.querySelector('.grid'));
|
|
27
|
+
</script>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## ES module
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { defineAutoAnimate } from 'motionary/components/layout';
|
|
34
|
+
|
|
35
|
+
defineAutoAnimate(); // registers <usa-auto-animate>
|
|
36
|
+
|
|
37
|
+
/* then use it in your HTML:
|
|
38
|
+
<usa-auto-animate>
|
|
39
|
+
<ul class="todo">…</ul>
|
|
40
|
+
</usa-auto-animate>
|
|
41
|
+
|
|
42
|
+
<!-- or on any element: -->
|
|
43
|
+
*/
|
|
44
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# `<usa-auto-skeleton>` — Auto skeleton
|
|
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
|
+
Set loading and every heading, paragraph, image and button inside becomes a shimmering placeholder of its own size — no extra markup.
|
|
6
|
+
|
|
7
|
+
- **Category:** page
|
|
8
|
+
- **Import:** `import { defineAutoSkeleton } from 'motionary/components/page'` then `defineAutoSkeleton();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `loading`
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/page/auto-skeleton.ts](../../src/components/page/auto-skeleton.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-auto-skeleton loading>
|
|
20
|
+
<h3>{{ title }}</h3>
|
|
21
|
+
<p>{{ body }}</p>
|
|
22
|
+
</usa-auto-skeleton>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## ES module
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import { defineAutoSkeleton } from 'motionary/components/page';
|
|
29
|
+
|
|
30
|
+
defineAutoSkeleton(); // registers <usa-auto-skeleton>
|
|
31
|
+
|
|
32
|
+
/* then use it in your HTML:
|
|
33
|
+
<usa-auto-skeleton loading>
|
|
34
|
+
<h3>{{ title }}</h3>
|
|
35
|
+
<p>{{ body }}</p>
|
|
36
|
+
</usa-auto-skeleton>
|
|
37
|
+
*/
|
|
38
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# `<usa-avatar-stack>` — Avatar stack
|
|
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
|
+
Overlapping avatars that spread apart with a spring on hover; extras collapse into “+N”.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui
|
|
8
|
+
- **Import:** `import { defineAvatarStack } from 'motionary/components/ui'` then `defineAvatarStack();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `max`, `size`, `overlap`
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `adoptVariants()`, `mount()`
|
|
14
|
+
- **Source:** [src/components/ui/avatar-stack.ts](../../src/components/ui/avatar-stack.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-avatar-stack max="4">
|
|
20
|
+
<img src="a.jpg" alt="Ana">
|
|
21
|
+
…
|
|
22
|
+
</usa-avatar-stack>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## ES module
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import { defineAvatarStack } from 'motionary/components/ui';
|
|
29
|
+
|
|
30
|
+
defineAvatarStack(); // registers <usa-avatar-stack>
|
|
31
|
+
|
|
32
|
+
/* then use it in your HTML:
|
|
33
|
+
<usa-avatar-stack max="4">
|
|
34
|
+
<img src="a.jpg" alt="Ana">
|
|
35
|
+
…
|
|
36
|
+
</usa-avatar-stack>
|
|
37
|
+
*/
|
|
38
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-back-to-top>` — Back to top
|
|
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
|
+
Appears after you scroll, shows reading progress as a ring and springs the page back up, then moves focus to the top.
|
|
6
|
+
|
|
7
|
+
- **Category:** page
|
|
8
|
+
- **Import:** `import { defineBackToTop } from 'motionary/components/page'` then `defineBackToTop();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** —
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/page/back-to-top.ts](../../src/components/page/back-to-top.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-back-to-top offset="400"></usa-back-to-top>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineBackToTop } from 'motionary/components/page';
|
|
26
|
+
|
|
27
|
+
defineBackToTop(); // registers <usa-back-to-top>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-back-to-top offset="400"></usa-back-to-top>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# `<usa-badge-wall>` — Badge wall
|
|
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.5: an achievement grid — locked badges are grey with a 🔒; unlock(name) flips a badge to its colour side with a shine and the “n / m unlocked” counter updates.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 7.5
|
|
8
|
+
- **Import:** `import { defineBadgeWall } from 'motionary/components/widgets'` then `defineBadgeWall();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** —
|
|
11
|
+
- **Events:** `usa:unlock`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `unlock()`
|
|
14
|
+
- **Source:** [src/components/widgets/badge-wall.ts](../../src/components/widgets/badge-wall.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-badge-wall>
|
|
20
|
+
<li data-icon="🏆">First win</li>
|
|
21
|
+
<li data-icon="🔥" data-locked>7-day streak</li>
|
|
22
|
+
</usa-badge-wall>
|
|
23
|
+
<script>wall.unlock('7-day streak');</script>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineBadgeWall } from 'motionary/components/widgets';
|
|
30
|
+
|
|
31
|
+
defineBadgeWall(); // registers <usa-badge-wall>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-badge-wall>
|
|
35
|
+
<li data-icon="🏆">First win</li>
|
|
36
|
+
<li data-icon="🔥" data-locked>7-day streak</li>
|
|
37
|
+
</usa-badge-wall>
|
|
38
|
+
*/
|
|
39
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# `<usa-badge>` — Badge
|
|
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
|
+
Count or dot badge that bumps with a spring when its value changes; 99+ capping, optional pulse.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui
|
|
8
|
+
- **Import:** `import { defineBadge } from 'motionary/components/ui'` then `defineBadge();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `value`, `max`, `dot`, `label`
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/ui/badge.ts](../../src/components/ui/badge.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-badge value="3">
|
|
20
|
+
<button>Inbox</button>
|
|
21
|
+
</usa-badge>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## ES module
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import { defineBadge } from 'motionary/components/ui';
|
|
28
|
+
|
|
29
|
+
defineBadge(); // registers <usa-badge>
|
|
30
|
+
|
|
31
|
+
/* then use it in your HTML:
|
|
32
|
+
<usa-badge value="3">
|
|
33
|
+
<button>Inbox</button>
|
|
34
|
+
</usa-badge>
|
|
35
|
+
*/
|
|
36
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# `<usa-bar-chart>` — Animated bar chart
|
|
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.2: bars grow from the baseline in a stagger on first view and new data glides every bar to its new height — bars that appear grow in, bars that leave shrink away. Data from values/labels, <data> children or the data property.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 7.2
|
|
8
|
+
- **Import:** `import { defineBarChart } from 'motionary/components/widgets'` then `defineBarChart();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `horizontal`, `unit`, `max`
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/widgets/bar-chart.ts](../../src/components/widgets/bar-chart.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-bar-chart values="12,19,8,15,22" labels="Mon,Tue,Wed,Thu,Fri" unit="k"></usa-bar-chart>
|
|
20
|
+
<script>chart.data = [{ label: 'Mon', value: 18 }, …];</script>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## ES module
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
import { defineBarChart } from 'motionary/components/widgets';
|
|
27
|
+
|
|
28
|
+
defineBarChart(); // registers <usa-bar-chart>
|
|
29
|
+
|
|
30
|
+
/* then use it in your HTML:
|
|
31
|
+
<usa-bar-chart values="12,19,8,15,22" labels="Mon,Tue,Wed,Thu,Fri" unit="k"></usa-bar-chart>
|
|
32
|
+
*/
|
|
33
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-bg-generator>` — Background generator
|
|
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.3: a background generator — pick a palette and a style (mesh gradient, grain, stripes, dots), shuffle the seed and copy the CSS.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 9.3
|
|
8
|
+
- **Import:** `import { defineBgGenerator } from 'motionary/components/widgets'` then `defineBgGenerator();`
|
|
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:** `shuffle()`, `copy()`
|
|
14
|
+
- **Source:** [src/components/widgets/bg-generator.ts](../../src/components/widgets/bg-generator.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-bg-generator palette="candy" style="mesh"></usa-bg-generator>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineBgGenerator } from 'motionary/components/widgets';
|
|
26
|
+
|
|
27
|
+
defineBgGenerator(); // registers <usa-bg-generator>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-bg-generator palette="candy" style="mesh"></usa-bg-generator>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-blobs>` — Fluid blobs
|
|
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
|
+
Soft colour blobs that slowly morph and drift — a fluid gradient backdrop.
|
|
6
|
+
|
|
7
|
+
- **Category:** background
|
|
8
|
+
- **Import:** `import { defineBlobs } from 'motionary/components/background'` then `defineBlobs();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** —
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `mount()`
|
|
14
|
+
- **Source:** [src/components/background/bg-fx.ts](../../src/components/background/bg-fx.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-blobs colors="#7c5cff,#22d3ee,#f472b6">…</usa-blobs>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineBlobs } from 'motionary/components/background';
|
|
26
|
+
|
|
27
|
+
defineBlobs(); // registers <usa-blobs>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-blobs colors="#7c5cff,#22d3ee,#f472b6">…</usa-blobs>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-bottom-sheet>` — Bottom 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
|
+
A draggable sheet with snap points, inertia and drag-down-to-dismiss — the iOS / Android pattern for web and Windows web-view apps.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui
|
|
8
|
+
- **Import:** `import { defineBottomSheet } from 'motionary/components/ui'` then `defineBottomSheet();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `open`, `snap`
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `show()`, `close()`
|
|
14
|
+
- **Source:** [src/components/ui/sheet.ts](../../src/components/ui/sheet.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-bottom-sheet snap="0.4,0.9" label="Filters">…</usa-bottom-sheet>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineBottomSheet } from 'motionary/components/ui';
|
|
26
|
+
|
|
27
|
+
defineBottomSheet(); // registers <usa-bottom-sheet>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-bottom-sheet snap="0.4,0.9" label="Filters">…</usa-bottom-sheet>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# `<usa-button>` — Button deformation
|
|
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
|
+
Spring-driven button click deformation: squash & stretch, elastic border-radius wobble, gooey liquid droplets, and a dent toward the pressed point. Combine them with deform="squash wobble".
|
|
6
|
+
|
|
7
|
+
- **Category:** click
|
|
8
|
+
- **Import:** `import { defineButton } from 'motionary/components/click'` then `defineButton();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `deform`, `state`, `shape`, `disabled`
|
|
11
|
+
- **Events:** `usa:submit`, `usa:state`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `morphTo()`
|
|
14
|
+
- **Source:** [src/components/click/button.ts](../../src/components/click/button.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-button deform="squash">
|
|
20
|
+
<button>Squash</button>
|
|
21
|
+
</usa-button>
|
|
22
|
+
<usa-button deform="gooey"><button>Gooey</button></usa-button>
|
|
23
|
+
<usa-button deform="dent"><button>Dent</button></usa-button>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineButton } from 'motionary/components/click';
|
|
30
|
+
|
|
31
|
+
defineButton(); // registers <usa-button>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-button deform="squash">
|
|
35
|
+
<button>Squash</button>
|
|
36
|
+
</usa-button>
|
|
37
|
+
<usa-button deform="gooey"><button>Gooey</button></usa-button>
|
|
38
|
+
<usa-button deform="dent"><button>Dent</button></usa-button>
|
|
39
|
+
*/
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Variants
|
|
43
|
+
|
|
44
|
+
### Button deformation
|
|
45
|
+
|
|
46
|
+
Spring-driven button click deformation: squash & stretch, elastic border-radius wobble, gooey liquid droplets, and a dent toward the pressed point. Combine them with deform="squash wobble".
|
|
47
|
+
|
|
48
|
+
```html
|
|
49
|
+
<usa-button deform="squash">
|
|
50
|
+
<button>Squash</button>
|
|
51
|
+
</usa-button>
|
|
52
|
+
<usa-button deform="gooey"><button>Gooey</button></usa-button>
|
|
53
|
+
<usa-button deform="dent"><button>Dent</button></usa-button>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Shape morph
|
|
57
|
+
|
|
58
|
+
The button morphs between pill, circle and icon-only with a spring — label and icon cross-fade. Click to cycle.
|
|
59
|
+
|
|
60
|
+
```html
|
|
61
|
+
<usa-button shape="pill">
|
|
62
|
+
<button><span data-icon>+</span> <span data-label>New file</span></button>
|
|
63
|
+
</usa-button>
|
|
64
|
+
<script>btn.morphTo('icon');</script>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Submit → loading → success
|
|
68
|
+
|
|
69
|
+
morph="submit": click shrinks the button into a spinner (aria-busy), then a drawn check (or a shake + cross on error) and back. Call event.detail.done(ok) from usa:submit.
|
|
70
|
+
|
|
71
|
+
```html
|
|
72
|
+
<usa-button morph="submit" deform="squash">
|
|
73
|
+
<button>Pay $20</button>
|
|
74
|
+
</usa-button>
|
|
75
|
+
<script>
|
|
76
|
+
btn.addEventListener('usa:submit', async (e) => e.detail.done(await pay()));
|
|
77
|
+
</script>
|
|
78
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `<usa-card-stack>` — Swipe stack
|
|
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 deck where the top card swipes away left or right (pointer, touch, arrow keys) and the next springs forward. loop sends cards to the back.
|
|
6
|
+
|
|
7
|
+
- **Category:** cards
|
|
8
|
+
- **Import:** `import { defineCardStack } from 'motionary/components/cards'` then `defineCardStack();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `visible`, `offset`, `disabled`
|
|
11
|
+
- **Events:** `usa:swipe`, `usa:empty`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `swipe()`
|
|
14
|
+
- **Source:** [src/components/cards/card-stack.ts](../../src/components/cards/card-stack.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-card-stack loop>
|
|
20
|
+
<article>1</article>
|
|
21
|
+
<article>2</article>
|
|
22
|
+
<article>3</article>
|
|
23
|
+
</usa-card-stack>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineCardStack } from 'motionary/components/cards';
|
|
30
|
+
|
|
31
|
+
defineCardStack(); // registers <usa-card-stack>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-card-stack loop>
|
|
35
|
+
<article>1</article>
|
|
36
|
+
<article>2</article>
|
|
37
|
+
<article>3</article>
|
|
38
|
+
</usa-card-stack>
|
|
39
|
+
*/
|
|
40
|
+
```
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# `<usa-card>` — Card
|
|
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
|
+
Ten card effects you can combine (effect="lift sheen"): flip (hover or click, x/y axis), holo, glass, border-glow, conic-border, lift, spotlight, sheen, parallax-layers and expand (card → detail with FLIP + spring).
|
|
6
|
+
|
|
7
|
+
- **Category:** cards
|
|
8
|
+
- **Import:** `import { defineCard } from 'motionary/components/cards'` then `defineCard();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `effect`, `trigger`, `disabled`
|
|
11
|
+
- **Events:** `usa:flip`, `usa:expand`, `usa:collapse`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `flip()`, `expand()`, `collapse()`
|
|
14
|
+
- **Source:** [src/components/cards/card.ts](../../src/components/cards/card.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-card effect="lift sheen">
|
|
20
|
+
<h3>Pro plan</h3>
|
|
21
|
+
</usa-card>
|
|
22
|
+
<usa-card effect="flip" trigger="click">
|
|
23
|
+
<div data-front>Front</div>
|
|
24
|
+
<div data-back>Back</div>
|
|
25
|
+
</usa-card>
|
|
26
|
+
<usa-card effect="expand">
|
|
27
|
+
<h3>Title</h3>
|
|
28
|
+
<div data-detail>Long text… <button data-close>Close</button></div>
|
|
29
|
+
</usa-card>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## ES module
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
import { defineCard } from 'motionary/components/cards';
|
|
36
|
+
|
|
37
|
+
defineCard(); // registers <usa-card>
|
|
38
|
+
|
|
39
|
+
/* then use it in your HTML:
|
|
40
|
+
<usa-card effect="lift sheen">
|
|
41
|
+
<h3>Pro plan</h3>
|
|
42
|
+
</usa-card>
|
|
43
|
+
<usa-card effect="flip" trigger="click">
|
|
44
|
+
<div data-front>Front</div>
|
|
45
|
+
<div data-back>Back</div>
|
|
46
|
+
</usa-card>
|
|
47
|
+
<usa-card effect="expand">
|
|
48
|
+
<h3>Title</h3>
|
|
49
|
+
<div data-detail>Long text… <button data-close>Close</button></div>
|
|
50
|
+
</usa-card>
|
|
51
|
+
*/
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Variants
|
|
55
|
+
|
|
56
|
+
### Card
|
|
57
|
+
|
|
58
|
+
Ten card effects you can combine (effect="lift sheen"): flip (hover or click, x/y axis), holo, glass, border-glow, conic-border, lift, spotlight, sheen, parallax-layers and expand (card → detail with FLIP + spring).
|
|
59
|
+
|
|
60
|
+
```html
|
|
61
|
+
<usa-card effect="lift sheen">
|
|
62
|
+
<h3>Pro plan</h3>
|
|
63
|
+
</usa-card>
|
|
64
|
+
<usa-card effect="flip" trigger="click">
|
|
65
|
+
<div data-front>Front</div>
|
|
66
|
+
<div data-back>Back</div>
|
|
67
|
+
</usa-card>
|
|
68
|
+
<usa-card effect="expand">
|
|
69
|
+
<h3>Title</h3>
|
|
70
|
+
<div data-detail>Long text… <button data-close>Close</button></div>
|
|
71
|
+
</usa-card>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Flip card
|
|
75
|
+
|
|
76
|
+
Front and back faces ([data-front] / [data-back]) flip in 3D on hover, or on click / Enter with trigger="click". axis="x" flips vertically. Reduced motion cross-fades.
|
|
77
|
+
|
|
78
|
+
```html
|
|
79
|
+
<usa-card effect="flip" trigger="click" axis="y">
|
|
80
|
+
<div data-front>Front</div>
|
|
81
|
+
<div data-back>Back</div>
|
|
82
|
+
</usa-card>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Expand to detail
|
|
86
|
+
|
|
87
|
+
Click a card and it grows into a full detail view with a spring (FLIP); [data-detail] content appears. Esc, the backdrop or [data-close] collapses it back into place.
|
|
88
|
+
|
|
89
|
+
```html
|
|
90
|
+
<usa-card effect="expand">
|
|
91
|
+
<h3>Title</h3>
|
|
92
|
+
<div data-detail>…<button data-close>Close</button></div>
|
|
93
|
+
</usa-card>
|
|
94
|
+
```
|