use-scroll-animate 2.5.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +1 -0
  3. package/README_ja.md +1 -0
  4. package/README_zh.md +1 -0
  5. package/dist/chunks/{base-CuvCgqLy.js → base-08OYzphB.js} +2 -2
  6. package/dist/chunks/{base-CuvCgqLy.js.map → base-08OYzphB.js.map} +1 -1
  7. package/dist/chunks/{base-CJ7XfidP.cjs → base-5DFCAnvH.cjs} +3 -1
  8. package/dist/chunks/{base-CJ7XfidP.cjs.map → base-5DFCAnvH.cjs.map} +1 -1
  9. package/dist/chunks/{spring-CGO9Jd9b.cjs → spring-Bi4qY0pL.cjs} +2 -2
  10. package/dist/chunks/{spring-CGO9Jd9b.cjs.map → spring-Bi4qY0pL.cjs.map} +1 -1
  11. package/dist/chunks/{spring-BKUU7-Xm.js → spring-CpeFkxNd.js} +2 -2
  12. package/dist/chunks/{spring-BKUU7-Xm.js.map → spring-CpeFkxNd.js.map} +1 -1
  13. package/dist/components/background.cjs +1 -1
  14. package/dist/components/background.js +2 -2
  15. package/dist/components/cards.cjs +2 -2
  16. package/dist/components/cards.js +3 -3
  17. package/dist/components/click.cjs +2 -2
  18. package/dist/components/click.js +3 -3
  19. package/dist/components/feedback.cjs +2 -2
  20. package/dist/components/feedback.css +1 -1
  21. package/dist/components/feedback.js +3 -3
  22. package/dist/components/interaction.cjs +2 -2
  23. package/dist/components/interaction.css +1 -1
  24. package/dist/components/interaction.js +3 -3
  25. package/dist/components/physics.cjs +2 -2
  26. package/dist/components/physics.js +4 -4
  27. package/dist/components/reveal.cjs +1 -1
  28. package/dist/components/reveal.js +2 -2
  29. package/dist/components/text.cjs +1 -1
  30. package/dist/components/text.js +2 -2
  31. package/dist/components/transitions.cjs +1 -1
  32. package/dist/components/transitions.js +2 -2
  33. package/dist/components/ui.cjs +1082 -0
  34. package/dist/components/ui.cjs.map +1 -0
  35. package/dist/components/ui.css +14 -0
  36. package/dist/components/ui.d.cts +251 -0
  37. package/dist/components/ui.d.ts +251 -0
  38. package/dist/components/ui.js +1064 -0
  39. package/dist/components/ui.js.map +1 -0
  40. package/dist/components.cjs +25 -4
  41. package/dist/components.cjs.map +1 -1
  42. package/dist/components.css +14 -2
  43. package/dist/components.d.cts +215 -2
  44. package/dist/components.d.ts +215 -2
  45. package/dist/components.js +10 -3
  46. package/dist/components.js.map +1 -1
  47. package/dist/components.umd.js +2 -2
  48. package/dist/components.umd.js.map +1 -1
  49. package/docs/components.md +20 -0
  50. package/package.json +13 -2
@@ -155,6 +155,26 @@ Presets (`SPRING_PRESETS`): `default` (170/26), `gentle` (120/14), `wobbly` (180
155
155
  | `<usa-checkbox>` | Animated form-associated checkbox | `checked`, `indeterminate`, `name`, `value`, `label`, `shape` (`circle`) | `checked`, `toggle()`; `change`, `usa:change` |
156
156
  | `burst()` · `confetti()` · `shake()` · `haptic()` | The click-effect engine as functions | — | particles skip under reduced motion |
157
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
+
158
178
  ## Frameworks
159
179
 
160
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.5.0",
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",
@@ -168,6 +168,16 @@
168
168
  "default": "./dist/components/click.cjs"
169
169
  }
170
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
+ },
171
181
  "./components.css": "./dist/components.css",
172
182
  "./components/reveal.css": "./dist/components/reveal.css",
173
183
  "./components/text.css": "./dist/components/text.css",
@@ -178,6 +188,7 @@
178
188
  "./components/physics.css": "./dist/components/physics.css",
179
189
  "./components/cards.css": "./dist/components/cards.css",
180
190
  "./components/click.css": "./dist/components/click.css",
191
+ "./components/ui.css": "./dist/components/ui.css",
181
192
  "./package.json": "./package.json"
182
193
  },
183
194
  "files": [
@@ -198,7 +209,7 @@
198
209
  "typecheck": "tsc --noEmit -p .",
199
210
  "test": "vitest run",
200
211
  "check:exports": "node scripts/check-exports.mjs",
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",
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",
202
213
  "size": "node scripts/size.mjs",
203
214
  "prepublishOnly": "npm run typecheck && npm test && npm run build && npm run check:exports",
204
215
  "size:check": "node scripts/size.mjs --check",