use-scroll-animate 2.3.0 → 2.5.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.
@@ -133,6 +133,28 @@ All attributes are optional unless noted. Events are `CustomEvent`s that bubble,
133
133
 
134
134
  Presets (`SPRING_PRESETS`): `default` (170/26), `gentle` (120/14), `wobbly` (180/12), `stiff` (210/20), `bouncy` (300/10), `slow` (280/60), `molasses` (280/120) — stiffness/damping, mass 1.
135
135
 
136
+ ### 8. Card effects — `components/cards`
137
+
138
+ | Element | What it does | Key attributes | JS API / events |
139
+ |---|---|---|---|
140
+ | `<usa-card>` | Combinable card effects: `flip`, `holo`, `glass`, `border-glow`, `conic-border`, `lift`, `spotlight`, `sheen`, `parallax-layers`, `expand` | `effect` (space-separated), `trigger` (`hover` · `click`, flip), `axis` (`y` · `x`), `depth` (16), `color`, `flipped`, `disabled`; children `[data-front]` / `[data-back]` / `[data-detail]` / `[data-depth]` / `[data-close]` | `flip(force?)`, `expand()`, `collapse()`, `flipped`, `expanded`; `usa:flip`, `usa:expand`, `usa:collapse`; `--usa-card-x/-y/-nx/-ny`, `--usa-card-radius`, `--usa-card-bg`, `--usa-card-glow` |
141
+ | `<usa-card-stack>` | Swipeable deck, cards fan out behind the top one | `threshold` (90), `visible` (3), `offset` (10), `loop`, `disabled` | `top`, `swipe('left' \| 'right')`; `usa:swipe`, `usa:empty` |
142
+ | `<usa-sticky-stack>` | Cards stack while scrolling; covered ones shrink & dim | `top` (80), `gap` (16), `scale` (0.06) | `update()` |
143
+ | `<usa-carousel-3d>` | 3D ring carousel with spring rotation | `radius` (auto), `perspective` (1200), `autoplay` (ms), `index` | `index`, `next()`, `prev()`, `goTo(i)`; `usa:change` |
144
+
145
+ ### 9. Click & tap — `components/click`
146
+
147
+ | Element / API | What it does | Key attributes | JS API / events |
148
+ |---|---|---|---|
149
+ | `<usa-button>` | **Button click deformation**: `squash`, `wobble`, `gooey`, `dent` (combinable); shape morph; submit morph | `deform`, `shape` (`pill` · `circle` · `icon`), `morph="submit"`, `state` (`idle` · `loading` · `success` · `error`), `reset` (1800 ms), `haptic`, `disabled`; children `[data-label]`, `[data-icon]` | `target`, `shape`, `state`, `morphTo(shape)`; `usa:submit` (`detail.done(ok)`), `usa:state`; `--usa-dent-x/-y` |
150
+ | `<usa-icon-morph>` | Spring icon morphs (play/pause, menu/close, plus/minus, check, arrow-right) | `icons` (`play,pause`), `index`, `size` (24), `toggle`, `labels`, `preset` | `next()`, `show(name \| i)`, `icon`; `usa:change` |
151
+ | `<usa-click>` | `ripple`, `burst`, `confetti`, `squish`, `press-spring`, `shake` (combinable) | `effect`, `color` (comma list), `shape`, `count`, `trigger="click"` (shake), `haptic`, `disabled` | `play(x?, y?)`, `shake()`; `usa:click-effect` |
152
+ | `<usa-like>` | Heart toggle with pop + burst | `liked`, `count`, `label`, `color`, `size`, `haptic` | `liked`, `count`, `toggle()`; `change`, `usa:change` |
153
+ | `<usa-hold>` | Hold-to-confirm ring | `duration` (1200), `label`, `color`, `haptic` | `progress`, `cancel()`; `usa:progress`, `usa:confirm`, `usa:cancel`; `--usa-hold` |
154
+ | `<usa-double-tap>` | Double tap → heart at the point | `icon` (♥), `color`, `delay` (300), `haptic` | `pop(x?, y?)`; `usa:double-tap` |
155
+ | `<usa-checkbox>` | Animated form-associated checkbox | `checked`, `indeterminate`, `name`, `value`, `label`, `shape` (`circle`) | `checked`, `toggle()`; `change`, `usa:change` |
156
+ | `burst()` · `confetti()` · `shake()` · `haptic()` | The click-effect engine as functions | — | particles skip under reduced motion |
157
+
136
158
  ## Frameworks
137
159
 
138
160
  Custom elements work in every framework. Register once (e.g. in your entry file), then use the tags.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "use-scroll-animate",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "description": "A lightweight, high-performance, dependency-free scroll animation library and animated UI components (Web Components) for the web and Windows web-view apps.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -148,6 +148,26 @@
148
148
  "default": "./dist/components/physics.cjs"
149
149
  }
150
150
  },
151
+ "./components/cards": {
152
+ "import": {
153
+ "types": "./dist/components/cards.d.ts",
154
+ "default": "./dist/components/cards.js"
155
+ },
156
+ "require": {
157
+ "types": "./dist/components/cards.d.cts",
158
+ "default": "./dist/components/cards.cjs"
159
+ }
160
+ },
161
+ "./components/click": {
162
+ "import": {
163
+ "types": "./dist/components/click.d.ts",
164
+ "default": "./dist/components/click.js"
165
+ },
166
+ "require": {
167
+ "types": "./dist/components/click.d.cts",
168
+ "default": "./dist/components/click.cjs"
169
+ }
170
+ },
151
171
  "./components.css": "./dist/components.css",
152
172
  "./components/reveal.css": "./dist/components/reveal.css",
153
173
  "./components/text.css": "./dist/components/text.css",
@@ -156,6 +176,8 @@
156
176
  "./components/background.css": "./dist/components/background.css",
157
177
  "./components/transitions.css": "./dist/components/transitions.css",
158
178
  "./components/physics.css": "./dist/components/physics.css",
179
+ "./components/cards.css": "./dist/components/cards.css",
180
+ "./components/click.css": "./dist/components/click.css",
159
181
  "./package.json": "./package.json"
160
182
  },
161
183
  "files": [
@@ -176,7 +198,7 @@
176
198
  "typecheck": "tsc --noEmit -p .",
177
199
  "test": "vitest run",
178
200
  "check:exports": "node scripts/check-exports.mjs",
179
- "lint:package": "publint && attw --pack . --profile node16 --exclude-entrypoints ./components.css ./components/reveal.css ./components/text.css ./components/interaction.css ./components/feedback.css ./components/background.css ./components/transitions.css ./components/physics.css",
201
+ "lint:package": "publint && attw --pack . --profile node16 --exclude-entrypoints ./components.css ./components/reveal.css ./components/text.css ./components/interaction.css ./components/feedback.css ./components/background.css ./components/transitions.css ./components/physics.css ./components/cards.css ./components/click.css",
180
202
  "size": "node scripts/size.mjs",
181
203
  "prepublishOnly": "npm run typecheck && npm test && npm run build && npm run check:exports",
182
204
  "size:check": "node scripts/size.mjs --check",