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,40 @@
|
|
|
1
|
+
# `<usa-carousel-3d>` — 3D carousel
|
|
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
|
+
Items on a 3D ring, rotated by drag, arrow keys, clicks or autoplay — with spring motion. Reduced motion shows one flat item at a time.
|
|
6
|
+
|
|
7
|
+
- **Category:** cards
|
|
8
|
+
- **Import:** `import { defineCarousel3d } from 'motionary/components/cards'` then `defineCarousel3d();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `radius`, `perspective`, `autoplay`
|
|
11
|
+
- **Events:** `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `next()`, `prev()`, `goTo()`
|
|
14
|
+
- **Source:** [src/components/cards/carousel-3d.ts](../../src/components/cards/carousel-3d.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-carousel-3d autoplay="3000">
|
|
20
|
+
<img src="1.jpg" alt="">
|
|
21
|
+
<img src="2.jpg" alt="">
|
|
22
|
+
…
|
|
23
|
+
</usa-carousel-3d>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineCarousel3d } from 'motionary/components/cards';
|
|
30
|
+
|
|
31
|
+
defineCarousel3d(); // registers <usa-carousel-3d>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-carousel-3d autoplay="3000">
|
|
35
|
+
<img src="1.jpg" alt="">
|
|
36
|
+
<img src="2.jpg" alt="">
|
|
37
|
+
…
|
|
38
|
+
</usa-carousel-3d>
|
|
39
|
+
*/
|
|
40
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `<usa-carousel>` — Carousel / slider
|
|
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: swipe, drag, arrow keys, dots and autoplay (pauses on hover, focus, off screen). Four transitions — slide, fade, scale and a 3D "cards" coverflow. Reduced motion: slides switch without movement.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 6.2
|
|
8
|
+
- **Import:** `import { defineCarousel } from 'motionary/components/widgets'` then `defineCarousel();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `effect`, `autoplay`, `loop`, `no-controls`, `no-dots`
|
|
11
|
+
- **Events:** `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `next()`, `prev()`, `goTo()`
|
|
14
|
+
- **Source:** [src/components/widgets/carousel.ts](../../src/components/widgets/carousel.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-carousel effect="cards" loop autoplay="4000" label="Featured">
|
|
20
|
+
<img src="a.jpg" alt="…">
|
|
21
|
+
<img src="b.jpg" alt="…">
|
|
22
|
+
<img src="c.jpg" alt="…">
|
|
23
|
+
</usa-carousel>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineCarousel } from 'motionary/components/widgets';
|
|
30
|
+
|
|
31
|
+
defineCarousel(); // registers <usa-carousel>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-carousel effect="cards" loop autoplay="4000" label="Featured">
|
|
35
|
+
<img src="a.jpg" alt="…">
|
|
36
|
+
<img src="b.jpg" alt="…">
|
|
37
|
+
<img src="c.jpg" alt="…">
|
|
38
|
+
</usa-carousel>
|
|
39
|
+
*/
|
|
40
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# `<usa-cart-drawer>` — Cart 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
|
+
7.3: a cart button with a count badge and a drawer that slides in from the side — lines slide in (or bump their quantity), removed lines collapse, the badge bumps and the total rolls. Esc / backdrop close; focus is managed.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 7.3
|
|
8
|
+
- **Import:** `import { defineCartDrawer } from 'motionary/components/widgets'` then `defineCartDrawer();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** —
|
|
11
|
+
- **Events:** `usa:open`, `usa:close`, `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `add()`, `removeItem()`, `toggle()`
|
|
14
|
+
- **Source:** [src/components/widgets/cart-drawer.ts](../../src/components/widgets/cart-drawer.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-cart-drawer currency="$"></usa-cart-drawer>
|
|
20
|
+
<script>cart.add({ id: 'tee', name: 'T-shirt', price: 24 });</script>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## ES module
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
import { defineCartDrawer } from 'motionary/components/widgets';
|
|
27
|
+
|
|
28
|
+
defineCartDrawer(); // registers <usa-cart-drawer>
|
|
29
|
+
|
|
30
|
+
/* then use it in your HTML:
|
|
31
|
+
<usa-cart-drawer currency="$"></usa-cart-drawer>
|
|
32
|
+
*/
|
|
33
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `<usa-chapter-nav>` — Chapter nav
|
|
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.1: chapter navigation for long-form stories — one entry per chapter with a reading-progress bar that fills as you scroll, the current chapter highlighted, click to glide there.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 9.1
|
|
8
|
+
- **Import:** `import { defineChapterNav } from 'motionary/components/widgets'` then `defineChapterNav();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `for`, `orientation`, `label`
|
|
11
|
+
- **Events:** `usa:chapter`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `goTo()`
|
|
14
|
+
- **Source:** [src/components/widgets/chapter-nav.ts](../../src/components/widgets/chapter-nav.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-chapter-nav for="#story"></usa-chapter-nav>
|
|
20
|
+
<article id="story">
|
|
21
|
+
<section data-chapter="Prologue">…</section>
|
|
22
|
+
<section data-chapter="The storm">…</section>
|
|
23
|
+
</article>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineChapterNav } from 'motionary/components/widgets';
|
|
30
|
+
|
|
31
|
+
defineChapterNav(); // registers <usa-chapter-nav>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-chapter-nav for="#story"></usa-chapter-nav>
|
|
35
|
+
<article id="story">
|
|
36
|
+
<section data-chapter="Prologue">…</section>
|
|
37
|
+
<section data-chapter="The storm">…</section>
|
|
38
|
+
</article>
|
|
39
|
+
*/
|
|
40
|
+
```
|
|
@@ -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
|
+
```
|