use-scroll-animate 2.4.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.
- package/CHANGELOG.md +15 -0
- package/README.md +1 -0
- package/README_ja.md +1 -0
- package/README_zh.md +1 -0
- package/dist/components/click.cjs +985 -0
- package/dist/components/click.cjs.map +1 -0
- package/dist/components/click.css +9 -0
- package/dist/components/click.d.cts +250 -0
- package/dist/components/click.d.ts +250 -0
- package/dist/components/click.js +967 -0
- package/dist/components/click.js.map +1 -0
- package/dist/components.cjs +19 -0
- package/dist/components.cjs.map +1 -1
- package/dist/components.css +7 -0
- package/dist/components.d.cts +214 -2
- package/dist/components.d.ts +214 -2
- package/dist/components.js +5 -1
- package/dist/components.js.map +1 -1
- package/dist/components.umd.js +2 -2
- package/dist/components.umd.js.map +1 -1
- package/docs/components.md +13 -0
- package/package.json +13 -2
package/docs/components.md
CHANGED
|
@@ -142,6 +142,19 @@ Presets (`SPRING_PRESETS`): `default` (170/26), `gentle` (120/14), `wobbly` (180
|
|
|
142
142
|
| `<usa-sticky-stack>` | Cards stack while scrolling; covered ones shrink & dim | `top` (80), `gap` (16), `scale` (0.06) | `update()` |
|
|
143
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
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
|
+
|
|
145
158
|
## Frameworks
|
|
146
159
|
|
|
147
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
|
+
"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",
|
|
@@ -158,6 +158,16 @@
|
|
|
158
158
|
"default": "./dist/components/cards.cjs"
|
|
159
159
|
}
|
|
160
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
|
+
},
|
|
161
171
|
"./components.css": "./dist/components.css",
|
|
162
172
|
"./components/reveal.css": "./dist/components/reveal.css",
|
|
163
173
|
"./components/text.css": "./dist/components/text.css",
|
|
@@ -167,6 +177,7 @@
|
|
|
167
177
|
"./components/transitions.css": "./dist/components/transitions.css",
|
|
168
178
|
"./components/physics.css": "./dist/components/physics.css",
|
|
169
179
|
"./components/cards.css": "./dist/components/cards.css",
|
|
180
|
+
"./components/click.css": "./dist/components/click.css",
|
|
170
181
|
"./package.json": "./package.json"
|
|
171
182
|
},
|
|
172
183
|
"files": [
|
|
@@ -187,7 +198,7 @@
|
|
|
187
198
|
"typecheck": "tsc --noEmit -p .",
|
|
188
199
|
"test": "vitest run",
|
|
189
200
|
"check:exports": "node scripts/check-exports.mjs",
|
|
190
|
-
"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",
|
|
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",
|
|
191
202
|
"size": "node scripts/size.mjs",
|
|
192
203
|
"prepublishOnly": "npm run typecheck && npm test && npm run build && npm run check:exports",
|
|
193
204
|
"size:check": "node scripts/size.mjs --check",
|