use-scroll-animate 2.4.0 → 2.6.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 +35 -0
- package/README.md +2 -0
- package/README_ja.md +2 -0
- package/README_zh.md +2 -0
- package/dist/chunks/{base-CuvCgqLy.js → base-08OYzphB.js} +2 -2
- package/dist/chunks/{base-CuvCgqLy.js.map → base-08OYzphB.js.map} +1 -1
- package/dist/chunks/{base-CJ7XfidP.cjs → base-5DFCAnvH.cjs} +3 -1
- package/dist/chunks/{base-CJ7XfidP.cjs.map → base-5DFCAnvH.cjs.map} +1 -1
- package/dist/chunks/{spring-CGO9Jd9b.cjs → spring-Bi4qY0pL.cjs} +2 -2
- package/dist/chunks/{spring-CGO9Jd9b.cjs.map → spring-Bi4qY0pL.cjs.map} +1 -1
- package/dist/chunks/{spring-BKUU7-Xm.js → spring-CpeFkxNd.js} +2 -2
- package/dist/chunks/{spring-BKUU7-Xm.js.map → spring-CpeFkxNd.js.map} +1 -1
- package/dist/components/background.cjs +1 -1
- package/dist/components/background.js +2 -2
- package/dist/components/cards.cjs +2 -2
- package/dist/components/cards.js +3 -3
- 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/feedback.cjs +2 -2
- package/dist/components/feedback.css +1 -1
- package/dist/components/feedback.js +3 -3
- package/dist/components/interaction.cjs +2 -2
- package/dist/components/interaction.css +1 -1
- package/dist/components/interaction.js +3 -3
- package/dist/components/physics.cjs +2 -2
- package/dist/components/physics.js +4 -4
- package/dist/components/reveal.cjs +1 -1
- package/dist/components/reveal.js +2 -2
- package/dist/components/text.cjs +1 -1
- package/dist/components/text.js +2 -2
- package/dist/components/transitions.cjs +1 -1
- package/dist/components/transitions.js +2 -2
- package/dist/components/ui.cjs +1082 -0
- package/dist/components/ui.cjs.map +1 -0
- package/dist/components/ui.css +14 -0
- package/dist/components/ui.d.cts +251 -0
- package/dist/components/ui.d.ts +251 -0
- package/dist/components/ui.js +1064 -0
- package/dist/components/ui.js.map +1 -0
- package/dist/components.cjs +44 -4
- package/dist/components.cjs.map +1 -1
- package/dist/components.css +21 -2
- package/dist/components.d.cts +427 -2
- package/dist/components.d.ts +427 -2
- package/dist/components.js +14 -3
- 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 +33 -0
- package/package.json +24 -2
package/docs/components.md
CHANGED
|
@@ -142,6 +142,39 @@ 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
|
+
|
|
158
|
+
### 10. UI components & variants — `components/ui`
|
|
159
|
+
|
|
160
|
+
**Style variants.** `variant="minimal | neon | glass | brutalist | fluent | material"` works on every `<usa-*>` element (or `data-usa-variant` on an ancestor, or `setVariant('fluent')` page-wide). Variants only set design tokens — `--usa-accent`, `--usa-accent-text`, `--usa-surface`, `--usa-text`, `--usa-radius`, `--usa-border`, `--usa-shadow`, `--usa-blur`, `--usa-font` — which you can also set yourself. (`<usa-spinner>` / `<usa-check>` / `<usa-dialog>` keep using `variant` for their kind; `fluent` means the Windows look in both.)
|
|
161
|
+
|
|
162
|
+
| Element | What it does | Key attributes | JS API / events |
|
|
163
|
+
|---|---|---|---|
|
|
164
|
+
| `<usa-tabs>` | Tabs with a sliding spring indicator (`[data-tab]` + `[data-panel]`) | `selected`, `indicator` (`line` · `pill`) | `selected`, `select(i)`; `usa:change` |
|
|
165
|
+
| `<usa-drawer>` | Side panel, swipe to close | `open`, `side` (`left` · `right` · `top` · `bottom`), `label`; `[data-close]` | `open`, `show()`, `close()`; `usa:open`, `usa:close` |
|
|
166
|
+
| `<usa-bottom-sheet>` | Draggable sheet with snap points | `open`, `snap` (`0.5,0.92`), `start`, `label`; `[data-handle]` | `usa:open`, `usa:close`, `usa:snap` |
|
|
167
|
+
| `<usa-pull-refresh>` | Pull-to-refresh scroller | `threshold` (70), `label`, `disabled` | `refresh()`, `refreshing`; `usa:refresh` (`detail.done()`), `onrefresh` |
|
|
168
|
+
| `<usa-fab>` | FAB speed dial (first child = main button) | `open`, `direction` (`up` · `down` · `left` · `right` · `radial`), `position`, `gap` (56) | `open`, `toggle()`; `usa:toggle` |
|
|
169
|
+
| `<usa-navbar>` | Auto-hiding app bar | `threshold` (64), `shrink`, `target` | `show()`, `hiddenByScroll`; `usa:hide`, `usa:show` |
|
|
170
|
+
| `<usa-slider>` | Range slider (form-associated) | `value`, `min`, `max`, `step`, `name`, `label`, `bubble`, `disabled` | `value`; `input`/`change`, `usa:input`/`usa:change`; `--usa-slider` |
|
|
171
|
+
| `<usa-rating>` | Star rating | `value`, `max` (5), `icon`, `readonly`, `label`, `name` | `value`; `change`, `usa:change` |
|
|
172
|
+
| `<usa-tooltip>` | Tooltip on hover / focus | `text`, `placement` (`top`), `delay` (300) | `show()`, `hide()` |
|
|
173
|
+
| `<usa-popover>` | Click-to-open panel (`[data-popover]`) | `open`, `placement` (`bottom`) | `open`, `toggle()`; `usa:open`, `usa:close` |
|
|
174
|
+
| `<usa-badge>` | Count / dot badge | `value`, `max` (99), `dot`, `pulse`, `show-zero`, `label` | `value` |
|
|
175
|
+
| `<usa-avatar-stack>` | Overlapping avatars | `max` (5), `size` (36), `overlap` (0.35), `label` | — |
|
|
176
|
+
| `setVariant(v)` · `VARIANTS` · `adoptVariants()` | Page-wide variant / token sheet | — | — |
|
|
177
|
+
|
|
145
178
|
## Frameworks
|
|
146
179
|
|
|
147
180
|
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.6.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,26 @@
|
|
|
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
|
+
},
|
|
171
|
+
"./components/ui": {
|
|
172
|
+
"import": {
|
|
173
|
+
"types": "./dist/components/ui.d.ts",
|
|
174
|
+
"default": "./dist/components/ui.js"
|
|
175
|
+
},
|
|
176
|
+
"require": {
|
|
177
|
+
"types": "./dist/components/ui.d.cts",
|
|
178
|
+
"default": "./dist/components/ui.cjs"
|
|
179
|
+
}
|
|
180
|
+
},
|
|
161
181
|
"./components.css": "./dist/components.css",
|
|
162
182
|
"./components/reveal.css": "./dist/components/reveal.css",
|
|
163
183
|
"./components/text.css": "./dist/components/text.css",
|
|
@@ -167,6 +187,8 @@
|
|
|
167
187
|
"./components/transitions.css": "./dist/components/transitions.css",
|
|
168
188
|
"./components/physics.css": "./dist/components/physics.css",
|
|
169
189
|
"./components/cards.css": "./dist/components/cards.css",
|
|
190
|
+
"./components/click.css": "./dist/components/click.css",
|
|
191
|
+
"./components/ui.css": "./dist/components/ui.css",
|
|
170
192
|
"./package.json": "./package.json"
|
|
171
193
|
},
|
|
172
194
|
"files": [
|
|
@@ -187,7 +209,7 @@
|
|
|
187
209
|
"typecheck": "tsc --noEmit -p .",
|
|
188
210
|
"test": "vitest run",
|
|
189
211
|
"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",
|
|
212
|
+
"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 ./components/ui.css",
|
|
191
213
|
"size": "node scripts/size.mjs",
|
|
192
214
|
"prepublishOnly": "npm run typecheck && npm test && npm run build && npm run check:exports",
|
|
193
215
|
"size:check": "node scripts/size.mjs --check",
|