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,32 @@
|
|
|
1
|
+
# `<usa-split-text>` — Split-text reveal
|
|
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
|
+
Splits a headline into letters or words and cascades them in: rise, fade, blur, flip or pop. Words never break.
|
|
6
|
+
|
|
7
|
+
- **Category:** text
|
|
8
|
+
- **Import:** `import { defineSplitText } from 'motionary/components/text'` then `defineSplitText();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `by`, `text`
|
|
11
|
+
- **Events:** `usa:complete`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `play()`, `reset()`
|
|
14
|
+
- **Source:** [src/components/text/split-text.ts](../../src/components/text/split-text.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-split-text effect="rise">Animated headline</usa-split-text>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineSplitText } from 'motionary/components/text';
|
|
26
|
+
|
|
27
|
+
defineSplitText(); // registers <usa-split-text>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-split-text effect="rise">Animated headline</usa-split-text>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `<usa-spotlight>` — Reveal highlight
|
|
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 Windows Fluent “Reveal” effect: a light follows the pointer, lighting the borders of nearby items and the hovered one.
|
|
6
|
+
|
|
7
|
+
- **Category:** interaction
|
|
8
|
+
- **Import:** `import { defineSpotlight } from 'motionary/components/interaction'` then `defineSpotlight();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `size`, `color`, `border`
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/interaction/spotlight.ts](../../src/components/interaction/spotlight.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-spotlight>
|
|
20
|
+
<button>Mail</button>
|
|
21
|
+
<button>Calendar</button>
|
|
22
|
+
<button>Photos</button>
|
|
23
|
+
</usa-spotlight>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineSpotlight } from 'motionary/components/interaction';
|
|
30
|
+
|
|
31
|
+
defineSpotlight(); // registers <usa-spotlight>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-spotlight>
|
|
35
|
+
<button>Mail</button>
|
|
36
|
+
<button>Calendar</button>
|
|
37
|
+
<button>Photos</button>
|
|
38
|
+
</usa-spotlight>
|
|
39
|
+
*/
|
|
40
|
+
```
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# `<usa-spring>` — Spring 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
|
+
bounce-in, pop and drop entrances with true spring timing (CSS linear() easing), plus jelly and rubber-band attention effects on view, hover or click.
|
|
6
|
+
|
|
7
|
+
- **Category:** physics
|
|
8
|
+
- **Import:** `import { defineSpring } from 'motionary/components/physics'` then `defineSpring();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `effect`, `trigger`, `repeat`
|
|
11
|
+
- **Events:** `usa:complete`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `play()`, `reset()`
|
|
14
|
+
- **Source:** [src/components/physics/spring-effect.ts](../../src/components/physics/spring-effect.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-spring effect="bounce-in" preset="bouncy">
|
|
20
|
+
<div class="card">Hello</div>
|
|
21
|
+
</usa-spring>
|
|
22
|
+
<usa-spring effect="jelly" trigger="click">
|
|
23
|
+
<button>Tap me</button>
|
|
24
|
+
</usa-spring>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## ES module
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
import { defineSpring } from 'motionary/components/physics';
|
|
31
|
+
|
|
32
|
+
defineSpring(); // registers <usa-spring>
|
|
33
|
+
|
|
34
|
+
/* then use it in your HTML:
|
|
35
|
+
<usa-spring effect="bounce-in" preset="bouncy">
|
|
36
|
+
<div class="card">Hello</div>
|
|
37
|
+
</usa-spring>
|
|
38
|
+
<usa-spring effect="jelly" trigger="click">
|
|
39
|
+
<button>Tap me</button>
|
|
40
|
+
</usa-spring>
|
|
41
|
+
*/
|
|
42
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `<usa-stagger>` — Stagger list
|
|
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
|
+
Reveals direct children one after another — lists, grids, feature rows.
|
|
6
|
+
|
|
7
|
+
- **Category:** reveal
|
|
8
|
+
- **Import:** `import { defineStagger } from 'motionary/components/reveal'` then `defineStagger();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `effect`, `repeat`, `threshold`
|
|
11
|
+
- **Events:** `usa:enter`, `usa:complete`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `reveal()`, `reset()`
|
|
14
|
+
- **Source:** [src/components/reveal/stagger.ts](../../src/components/reveal/stagger.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-stagger effect="rise" interval="80">
|
|
20
|
+
<li>One</li>
|
|
21
|
+
<li>Two</li>
|
|
22
|
+
<li>Three</li>
|
|
23
|
+
</usa-stagger>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineStagger } from 'motionary/components/reveal';
|
|
30
|
+
|
|
31
|
+
defineStagger(); // registers <usa-stagger>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-stagger effect="rise" interval="80">
|
|
35
|
+
<li>One</li>
|
|
36
|
+
<li>Two</li>
|
|
37
|
+
<li>Three</li>
|
|
38
|
+
</usa-stagger>
|
|
39
|
+
*/
|
|
40
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# `<usa-star-rating>` — Star rating 2.0
|
|
2
|
+
|
|
3
|
+
> Generated from the source and the gallery catalog by `scripts/gen-component-docs.mjs` (same data as [components.json](https://harrisoncn.github.io/Motionary/components.json) and [llms-full.txt](https://harrisoncn.github.io/Motionary/llms-full.txt)).
|
|
4
|
+
|
|
5
|
+
6.4: the fill follows the pointer (half stars with step="0.5"), a click pops the chosen star with a sparkle burst while the others ripple; stars or hearts; a keyboard slider (arrows, Home / End); readonly mode.
|
|
6
|
+
|
|
7
|
+
- **Category:** click · **since** 6.4
|
|
8
|
+
- **Import:** `import { defineStarRating } from 'motionary/components/widgets'` then `defineStarRating();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `max`, `icon`, `readonly`, `step`
|
|
11
|
+
- **Events:** `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/widgets/star-rating.ts](../../src/components/widgets/star-rating.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-star-rating value="3.5" step="0.5" label="Your rating"></usa-star-rating>
|
|
20
|
+
<usa-star-rating value="4" readonly></usa-star-rating>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## ES module
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
import { defineStarRating } from 'motionary/components/widgets';
|
|
27
|
+
|
|
28
|
+
defineStarRating(); // registers <usa-star-rating>
|
|
29
|
+
|
|
30
|
+
/* then use it in your HTML:
|
|
31
|
+
<usa-star-rating value="3.5" step="0.5" label="Your rating"></usa-star-rating>
|
|
32
|
+
<usa-star-rating value="4" readonly></usa-star-rating>
|
|
33
|
+
*/
|
|
34
|
+
```
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# `<usa-stepper>` — Stepper / wizard
|
|
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.7: the rail fills toward the current step, finished steps pop a drawn check mark and the current step pulses. Horizontal or vertical; next() / prev() / value.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 6.7
|
|
8
|
+
- **Import:** `import { defineStepper } from 'motionary/components/widgets'` then `defineStepper();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `orientation`
|
|
11
|
+
- **Events:** `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `next()`, `prev()`
|
|
14
|
+
- **Source:** [src/components/widgets/stepper.ts](../../src/components/widgets/stepper.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-stepper value="1" label="Checkout">
|
|
20
|
+
<span>Cart</span>
|
|
21
|
+
<span>Shipping</span>
|
|
22
|
+
<span>Payment</span>
|
|
23
|
+
<span>Done</span>
|
|
24
|
+
</usa-stepper>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## ES module
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
import { defineStepper } from 'motionary/components/widgets';
|
|
31
|
+
|
|
32
|
+
defineStepper(); // registers <usa-stepper>
|
|
33
|
+
|
|
34
|
+
/* then use it in your HTML:
|
|
35
|
+
<usa-stepper value="1" label="Checkout">
|
|
36
|
+
<span>Cart</span>
|
|
37
|
+
<span>Shipping</span>
|
|
38
|
+
<span>Payment</span>
|
|
39
|
+
<span>Done</span>
|
|
40
|
+
</usa-stepper>
|
|
41
|
+
*/
|
|
42
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `<usa-sticky-stack>` — Sticky 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
|
+
Cards stick while you scroll and the covered ones shrink and dim as the next slides over them.
|
|
6
|
+
|
|
7
|
+
- **Category:** cards
|
|
8
|
+
- **Import:** `import { defineStickyStack } from 'motionary/components/cards'` then `defineStickyStack();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `top`, `gap`, `scale`
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `update()`
|
|
14
|
+
- **Source:** [src/components/cards/sticky-stack.ts](../../src/components/cards/sticky-stack.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-sticky-stack top="80">
|
|
20
|
+
<section>One</section>
|
|
21
|
+
<section>Two</section>
|
|
22
|
+
<section>Three</section>
|
|
23
|
+
</usa-sticky-stack>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineStickyStack } from 'motionary/components/cards';
|
|
30
|
+
|
|
31
|
+
defineStickyStack(); // registers <usa-sticky-stack>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-sticky-stack top="80">
|
|
35
|
+
<section>One</section>
|
|
36
|
+
<section>Two</section>
|
|
37
|
+
<section>Three</section>
|
|
38
|
+
</usa-sticky-stack>
|
|
39
|
+
*/
|
|
40
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `<usa-sticky-wall>` — Sticky-note 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
|
+
8.5: a wall of sticky notes — each child becomes a pinned paper note with a slight tilt, the notes drop onto the wall one by one, and a tap lifts a note to the front.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 8.5
|
|
8
|
+
- **Import:** `import { defineStickyWall } from 'motionary/components/widgets'` then `defineStickyWall();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `seed`, `label`
|
|
11
|
+
- **Events:** `usa:pick`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `pick()`
|
|
14
|
+
- **Source:** [src/components/widgets/sticky-wall.ts](../../src/components/widgets/sticky-wall.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-sticky-wall label="Ideas">
|
|
20
|
+
<p>Ship 8.5 ✏️</p>
|
|
21
|
+
<p data-color="pink">Call Mia</p>
|
|
22
|
+
<p data-color="blue">Buy paper</p>
|
|
23
|
+
</usa-sticky-wall>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineStickyWall } from 'motionary/components/widgets';
|
|
30
|
+
|
|
31
|
+
defineStickyWall(); // registers <usa-sticky-wall>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-sticky-wall label="Ideas">
|
|
35
|
+
<p>Ship 8.5 ✏️</p>
|
|
36
|
+
<p data-color="pink">Call Mia</p>
|
|
37
|
+
<p data-color="blue">Buy paper</p>
|
|
38
|
+
</usa-sticky-wall>
|
|
39
|
+
*/
|
|
40
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# `<usa-stories>` — Stories viewer
|
|
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: segmented progress bars, auto-advance, tap left / right to step, press and hold to pause, plus a pause button. Under reduced motion it waits for the user instead of advancing.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 6.2
|
|
8
|
+
- **Import:** `import { defineStories } from 'motionary/components/widgets'` then `defineStories();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `duration`, `loop`
|
|
11
|
+
- **Events:** `usa:end`, `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `next()`, `prev()`, `goTo()`, `pause()`, `play()`
|
|
14
|
+
- **Source:** [src/components/widgets/stories.ts](../../src/components/widgets/stories.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-stories duration="5000" loop>
|
|
20
|
+
<img src="1.jpg" alt="…">
|
|
21
|
+
<img src="2.jpg" alt="…">
|
|
22
|
+
</usa-stories>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## ES module
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import { defineStories } from 'motionary/components/widgets';
|
|
29
|
+
|
|
30
|
+
defineStories(); // registers <usa-stories>
|
|
31
|
+
|
|
32
|
+
/* then use it in your HTML:
|
|
33
|
+
<usa-stories duration="5000" loop>
|
|
34
|
+
<img src="1.jpg" alt="…">
|
|
35
|
+
<img src="2.jpg" alt="…">
|
|
36
|
+
</usa-stories>
|
|
37
|
+
*/
|
|
38
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# `<usa-story>` — Story: before / after
|
|
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.4: <usa-story template="compare"> wipes from before to after as you scroll; the handle is draggable and a keyboard slider (←/→, Home/End). Full-page templates (pin, gallery, zoom) live on the Scroll stories page.
|
|
6
|
+
|
|
7
|
+
- **Category:** fx
|
|
8
|
+
- **Import:** `import { defineStory } from 'motionary/components/effects'` then `defineStory();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `template`, `zoom`
|
|
11
|
+
- **Events:** —
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** —
|
|
14
|
+
- **Source:** [src/components/effects/story.ts](../../src/components/effects/story.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-story template="compare" label="2019 vs 2026">
|
|
20
|
+
<div data-sticky>
|
|
21
|
+
<img data-before src="before.jpg" alt="Before">
|
|
22
|
+
<img data-after src="after.jpg" alt="After">
|
|
23
|
+
</div>
|
|
24
|
+
</usa-story>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## ES module
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
import { defineStory } from 'motionary/components/effects';
|
|
31
|
+
|
|
32
|
+
defineStory(); // registers <usa-story>
|
|
33
|
+
|
|
34
|
+
/* then use it in your HTML:
|
|
35
|
+
<usa-story template="compare" label="2019 vs 2026">
|
|
36
|
+
<div data-sticky>
|
|
37
|
+
<img data-before src="before.jpg" alt="Before">
|
|
38
|
+
<img data-after src="after.jpg" alt="After">
|
|
39
|
+
</div>
|
|
40
|
+
</usa-story>
|
|
41
|
+
*/
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Variants
|
|
45
|
+
|
|
46
|
+
### Story: before / after
|
|
47
|
+
|
|
48
|
+
5.4: <usa-story template="compare"> wipes from before to after as you scroll; the handle is draggable and a keyboard slider (←/→, Home/End). Full-page templates (pin, gallery, zoom) live on the Scroll stories page.
|
|
49
|
+
|
|
50
|
+
```html
|
|
51
|
+
<usa-story template="compare" label="2019 vs 2026">
|
|
52
|
+
<div data-sticky>
|
|
53
|
+
<img data-before src="before.jpg" alt="Before">
|
|
54
|
+
<img data-after src="after.jpg" alt="After">
|
|
55
|
+
</div>
|
|
56
|
+
</usa-story>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Story: data counters
|
|
60
|
+
|
|
61
|
+
5.4: template="counter" counts every [data-count] up (easing out, separators and prefix/suffix kept) when it scrolls into view; screen readers get the final value.
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
<usa-story template="counter">
|
|
65
|
+
<strong data-count="12,480">0</strong> users
|
|
66
|
+
<strong data-count="99.9%">0</strong> uptime
|
|
67
|
+
</usa-story>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Story: step highlight
|
|
71
|
+
|
|
72
|
+
5.4: template="highlight" dims every paragraph except the one crossing the viewport center (pin does the same for [data-step] sections next to a sticky [data-stage]); fires usa-story-step.
|
|
73
|
+
|
|
74
|
+
```html
|
|
75
|
+
<usa-story template="pin">
|
|
76
|
+
<figure data-stage>…chart…</figure>
|
|
77
|
+
<section data-step>Step 1</section>
|
|
78
|
+
<section data-step>Step 2</section>
|
|
79
|
+
</usa-story>
|
|
80
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-suggestion-chips>` — Suggestion chips
|
|
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: follow-up prompt chips that slide in one after another; picking one pulses it and (with dismiss) the others fade away. Real buttons, arrow-key navigation.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 7.8
|
|
8
|
+
- **Import:** `import { defineSuggestionChips } from 'motionary/components/widgets'` then `defineSuggestionChips();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `items`, `label`, `dismiss`
|
|
11
|
+
- **Events:** `usa:pick`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `setItems()`
|
|
14
|
+
- **Source:** [src/components/widgets/suggestion-chips.ts](../../src/components/widgets/suggestion-chips.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-suggestion-chips items="Summarise|Translate|Explain like I'm 5" dismiss></usa-suggestion-chips>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineSuggestionChips } from 'motionary/components/widgets';
|
|
26
|
+
|
|
27
|
+
defineSuggestionChips(); // registers <usa-suggestion-chips>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-suggestion-chips items="Summarise|Translate|Explain like I'm 5" dismiss></usa-suggestion-chips>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `<usa-swipe-deck>` — Swipe cards deck
|
|
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.8: drag the top card — it rotates with the pointer, LIKE / NOPE stamps fade in and past the threshold (or on a fling) it flies off; otherwise it springs back. like(), nope(), undo(), ← / →.
|
|
6
|
+
|
|
7
|
+
- **Category:** gesture · **since** 6.8
|
|
8
|
+
- **Import:** `import { defineSwipeDeck } from 'motionary/components/widgets'` then `defineSwipeDeck();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** —
|
|
11
|
+
- **Events:** `usa:swipe`, `usa:empty`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `like()`, `nope()`, `undo()`
|
|
14
|
+
- **Source:** [src/components/widgets/swipe-deck.ts](../../src/components/widgets/swipe-deck.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-swipe-deck threshold="110" label="Matches">
|
|
20
|
+
<article>Ada</article>
|
|
21
|
+
<article>Linus</article>
|
|
22
|
+
<article>Grace</article>
|
|
23
|
+
</usa-swipe-deck>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineSwipeDeck } from 'motionary/components/widgets';
|
|
30
|
+
|
|
31
|
+
defineSwipeDeck(); // registers <usa-swipe-deck>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-swipe-deck threshold="110" label="Matches">
|
|
35
|
+
<article>Ada</article>
|
|
36
|
+
<article>Linus</article>
|
|
37
|
+
<article>Grace</article>
|
|
38
|
+
</usa-swipe-deck>
|
|
39
|
+
*/
|
|
40
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# `<usa-swipeable>` — Swipeable
|
|
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
|
+
Swipe-to-dismiss and swipe actions: content follows the finger, flies out on a fast swipe or past the distance, otherwise springs home with your release velocity. Delete / arrow keys work too.
|
|
6
|
+
|
|
7
|
+
- **Category:** gesture
|
|
8
|
+
- **Import:** `import { defineSwipeable } from 'motionary/components/gesture'` then `defineSwipeable();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `axis`, `disabled`
|
|
11
|
+
- **Events:** `usa:swipe`, `usa:dismiss`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `swipe()`, `reset()`
|
|
14
|
+
- **Source:** [src/components/gesture/swipeable.ts](../../src/components/gesture/swipeable.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-swipeable distance="120" dismiss>
|
|
20
|
+
<div class="card">Swipe me away</div>
|
|
21
|
+
</usa-swipeable>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## ES module
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import { defineSwipeable } from 'motionary/components/gesture';
|
|
28
|
+
|
|
29
|
+
defineSwipeable(); // registers <usa-swipeable>
|
|
30
|
+
|
|
31
|
+
/* then use it in your HTML:
|
|
32
|
+
<usa-swipeable distance="120" dismiss>
|
|
33
|
+
<div class="card">Swipe me away</div>
|
|
34
|
+
</usa-swipeable>
|
|
35
|
+
*/
|
|
36
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `<usa-switch>` — Toggle switch variants
|
|
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.7: four switches — iOS (the thumb stretches while pressed), day / night (sun becomes moon, stars appear), bounce (squash at the end) and liquid (a gooey fill pours in). role="switch", forms, keyboard.
|
|
6
|
+
|
|
7
|
+
- **Category:** click · **since** 6.7
|
|
8
|
+
- **Import:** `import { defineSwitch } from 'motionary/components/widgets'` then `defineSwitch();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/widgets.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `variant`
|
|
11
|
+
- **Events:** `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `toggle()`
|
|
14
|
+
- **Source:** [src/components/widgets/switch.ts](../../src/components/widgets/switch.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-switch variant="daynight" name="dark" label="Dark mode"></usa-switch>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## ES module
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
import { defineSwitch } from 'motionary/components/widgets';
|
|
26
|
+
|
|
27
|
+
defineSwitch(); // registers <usa-switch>
|
|
28
|
+
|
|
29
|
+
/* then use it in your HTML:
|
|
30
|
+
<usa-switch variant="daynight" name="dark" label="Dark mode"></usa-switch>
|
|
31
|
+
*/
|
|
32
|
+
```
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# `<usa-tab-bar>` — Tabs with animated 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.2: the indicator stretches from the old tab to the new one (leading edge first) and the panel slides in from the side of travel. Pill, underline, glow or gooey; full tablist keyboard support.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui · **since** 6.2
|
|
8
|
+
- **Import:** `import { defineTabBar } from 'motionary/components/widgets'` then `defineTabBar();`
|
|
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:** `select()`
|
|
14
|
+
- **Source:** [src/components/widgets/tab-bar.ts](../../src/components/widgets/tab-bar.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-tab-bar indicator="pill">
|
|
20
|
+
<button>Overview</button>
|
|
21
|
+
<button>Specs</button>
|
|
22
|
+
<button>Reviews</button>
|
|
23
|
+
<div data-panel>…</div>
|
|
24
|
+
<div data-panel>…</div>
|
|
25
|
+
<div data-panel>…</div>
|
|
26
|
+
</usa-tab-bar>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## ES module
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
import { defineTabBar } from 'motionary/components/widgets';
|
|
33
|
+
|
|
34
|
+
defineTabBar(); // registers <usa-tab-bar>
|
|
35
|
+
|
|
36
|
+
/* then use it in your HTML:
|
|
37
|
+
<usa-tab-bar indicator="pill">
|
|
38
|
+
<button>Overview</button>
|
|
39
|
+
<button>Specs</button>
|
|
40
|
+
<button>Reviews</button>
|
|
41
|
+
<div data-panel>…</div>
|
|
42
|
+
<div data-panel>…</div>
|
|
43
|
+
<div data-panel>…</div>
|
|
44
|
+
</usa-tab-bar>
|
|
45
|
+
*/
|
|
46
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# `<usa-tabs>` — Tabs
|
|
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
|
+
Accessible tabs whose indicator slides between tabs with a spring; panels slide in from the direction you moved. Line or pill indicator.
|
|
6
|
+
|
|
7
|
+
- **Category:** ui
|
|
8
|
+
- **Import:** `import { defineTabs } from 'motionary/components/ui'` then `defineTabs();`
|
|
9
|
+
- **CDN:** `<script src="https://unpkg.com/motionary@10/dist/components.umd.js"></script>`
|
|
10
|
+
- **Attributes:** `indicator`
|
|
11
|
+
- **Events:** `usa:change`
|
|
12
|
+
- **Slots:** —
|
|
13
|
+
- **Methods:** `select()`
|
|
14
|
+
- **Source:** [src/components/ui/tabs.ts](../../src/components/ui/tabs.ts)
|
|
15
|
+
|
|
16
|
+
## Minimal example
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<usa-tabs>
|
|
20
|
+
<nav><button data-tab>One</button><button data-tab>Two</button></nav>
|
|
21
|
+
<section data-panel>…</section>
|
|
22
|
+
<section data-panel>…</section>
|
|
23
|
+
</usa-tabs>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## ES module
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { defineTabs } from 'motionary/components/ui';
|
|
30
|
+
|
|
31
|
+
defineTabs(); // registers <usa-tabs>
|
|
32
|
+
|
|
33
|
+
/* then use it in your HTML:
|
|
34
|
+
<usa-tabs>
|
|
35
|
+
<nav><button data-tab>One</button><button data-tab>Two</button></nav>
|
|
36
|
+
<section data-panel>…</section>
|
|
37
|
+
<section data-panel>…</section>
|
|
38
|
+
</usa-tabs>
|
|
39
|
+
*/
|
|
40
|
+
```
|