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.
Files changed (55) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +2 -0
  3. package/README_ja.md +2 -0
  4. package/README_zh.md +2 -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 +985 -0
  18. package/dist/components/click.cjs.map +1 -0
  19. package/dist/components/click.css +9 -0
  20. package/dist/components/click.d.cts +250 -0
  21. package/dist/components/click.d.ts +250 -0
  22. package/dist/components/click.js +967 -0
  23. package/dist/components/click.js.map +1 -0
  24. package/dist/components/feedback.cjs +2 -2
  25. package/dist/components/feedback.css +1 -1
  26. package/dist/components/feedback.js +3 -3
  27. package/dist/components/interaction.cjs +2 -2
  28. package/dist/components/interaction.css +1 -1
  29. package/dist/components/interaction.js +3 -3
  30. package/dist/components/physics.cjs +2 -2
  31. package/dist/components/physics.js +4 -4
  32. package/dist/components/reveal.cjs +1 -1
  33. package/dist/components/reveal.js +2 -2
  34. package/dist/components/text.cjs +1 -1
  35. package/dist/components/text.js +2 -2
  36. package/dist/components/transitions.cjs +1 -1
  37. package/dist/components/transitions.js +2 -2
  38. package/dist/components/ui.cjs +1082 -0
  39. package/dist/components/ui.cjs.map +1 -0
  40. package/dist/components/ui.css +14 -0
  41. package/dist/components/ui.d.cts +251 -0
  42. package/dist/components/ui.d.ts +251 -0
  43. package/dist/components/ui.js +1064 -0
  44. package/dist/components/ui.js.map +1 -0
  45. package/dist/components.cjs +44 -4
  46. package/dist/components.cjs.map +1 -1
  47. package/dist/components.css +21 -2
  48. package/dist/components.d.cts +427 -2
  49. package/dist/components.d.ts +427 -2
  50. package/dist/components.js +14 -3
  51. package/dist/components.js.map +1 -1
  52. package/dist/components.umd.js +2 -2
  53. package/dist/components.umd.js.map +1 -1
  54. package/docs/components.md +33 -0
  55. package/package.json +24 -2
@@ -1001,6 +1001,429 @@ declare global {
1001
1001
  }
1002
1002
  }
1003
1003
 
1004
+ declare const CLICK_EFFECTS: readonly ["ripple", "burst", "confetti", "squish", "press-spring", "shake"];
1005
+ type ClickEffect = (typeof CLICK_EFFECTS)[number];
1006
+ /**
1007
+ * `<usa-click>` — click / tap effects on whatever it wraps (combinable:
1008
+ * `effect="press-spring burst"`).
1009
+ *
1010
+ * - `ripple` — an ink wave from the pointer (enhanced: `color`, soft edge);
1011
+ * - `burst` — particles radiating from the pointer (`shape`: circle, square, star, heart, emoji);
1012
+ * - `confetti` — a confetti cannon from the click point;
1013
+ * - `squish` — squash on press, stretch on release (spring);
1014
+ * - `press-spring` — dips while pressed, springs back with overshoot;
1015
+ * - `shake` — horizontal error shake; plays on `invalid` events from a form
1016
+ * inside, on `shake()`, or on click when `trigger="click"`.
1017
+ *
1018
+ * Attributes: `effect`, `color`, `shape`, `count`, `haptic` (vibrate ms,
1019
+ * where supported), `disabled`. Keyboard (Space/Enter) triggers the effects
1020
+ * from the centre. Reduced motion: no particles or movement; press dims.
1021
+ */
1022
+ interface UsaClickElement extends UsaElement {
1023
+ readonly effects: string[];
1024
+ play(x?: number, y?: number): void;
1025
+ shake(): void;
1026
+ }
1027
+ declare function defineClick(tag?: string): CustomElementConstructor | undefined;
1028
+
1029
+ declare const BUTTON_DEFORMS: readonly ["squash", "wobble", "gooey", "dent"];
1030
+ type ButtonDeform = (typeof BUTTON_DEFORMS)[number];
1031
+ type ButtonShape = 'pill' | 'circle' | 'icon';
1032
+ type ButtonState = 'idle' | 'loading' | 'success' | 'error';
1033
+ /**
1034
+ * `<usa-button>` — **button click deformation** (按钮点击形变) around a
1035
+ * native `<button>` (or `<a>`) child — or the element itself becomes a button.
1036
+ *
1037
+ * `deform` (combinable, e.g. `deform="squash wobble"`):
1038
+ * - `squash` — squash on press, stretch-and-settle on release (spring);
1039
+ * - `wobble` — elastic border-radius wobble after a click;
1040
+ * - `gooey` — liquid blob: droplets squeeze out from the press point and
1041
+ * merge back (SVG goo filter);
1042
+ * - `dent` — the surface dents toward the pressed point (3D tilt + inner shade).
1043
+ *
1044
+ * `shape="pill | circle | icon"` morphs the outline with a spring (label =
1045
+ * `[data-label]`, icon = `[data-icon]` children); `morphTo(shape)`.
1046
+ *
1047
+ * `morph="submit"` — click → `loading` (shrinks to a circle with a spinner,
1048
+ * `aria-busy`), then `success` (check) or `error` (shake + cross), and back
1049
+ * to `idle` after `reset` ms (1800). Drive it with `state="…"` / `.state`, or
1050
+ * call `event.detail.done(ok)` from a `usa:submit` listener.
1051
+ *
1052
+ * Attributes: `deform`, `shape`, `morph`, `state`, `reset`, `haptic`,
1053
+ * `disabled`. Events: `usa:submit`, `usa:state`. Reduced motion: no
1054
+ * deformation; shape and state changes are instant; status still announced.
1055
+ */
1056
+ interface UsaButtonElement extends UsaElement {
1057
+ readonly target: HTMLElement;
1058
+ shape: ButtonShape;
1059
+ state: ButtonState;
1060
+ morphTo(shape: ButtonShape): Promise<void>;
1061
+ }
1062
+ declare function defineButton(tag?: string): CustomElementConstructor | undefined;
1063
+
1064
+ type Pt = [number, number];
1065
+ type Quad = [Pt, Pt, Pt, Pt];
1066
+ /**
1067
+ * Morphable icons: every icon is three quads (four points each) on a 24×24
1068
+ * grid, so any icon can morph into any other by interpolating points.
1069
+ */
1070
+ declare const MORPH_ICONS: Record<string, [Quad, Quad, Quad]>;
1071
+ /** SVG path data for an icon, or for the interpolation `t` (0–1) between two. */
1072
+ declare function morphPath(from: string, to?: string, t?: number): string;
1073
+ /**
1074
+ * `<usa-icon-morph>` — an icon that morphs between shapes with a spring:
1075
+ * play ↔ pause, menu ↔ close, plus ↔ minus, check, arrow-right…
1076
+ *
1077
+ * Attributes: `icons` (comma list, cycled; default `play,pause`), `index`
1078
+ * (current, 0), `size` (px, 24), `toggle` (makes it a button that cycles
1079
+ * on click / Enter / Space), `labels` (comma list of accessible names per
1080
+ * icon, e.g. `Play,Pause`), `preset` (spring, `wobbly`). Methods:
1081
+ * `next()`, `show(nameOrIndex)`. Events: `usa:change` (`{ index, icon }`).
1082
+ * Inside a `<usa-button>` or `<button>` it is decorative. Reduced motion:
1083
+ * the icon switches instantly.
1084
+ */
1085
+ interface UsaIconMorphElement extends UsaElement {
1086
+ index: number;
1087
+ readonly icon: string;
1088
+ next(): void;
1089
+ show(icon: string | number): void;
1090
+ }
1091
+ declare function defineIconMorph(tag?: string): CustomElementConstructor | undefined;
1092
+
1093
+ /**
1094
+ * `<usa-like>` — a like / favourite toggle: the heart pops with a spring and
1095
+ * bursts into particles when liked. `role="button"` + `aria-pressed`.
1096
+ *
1097
+ * Attributes: `liked`, `count` (shown next to the heart, updated ±1),
1098
+ * `label` (accessible name, default "Like"), `color`, `size` (px, 24),
1099
+ * `haptic`, `disabled`. Events: `change`, `usa:change` (`{ liked, count }`).
1100
+ * Reduced motion: colour change only.
1101
+ */
1102
+ interface UsaLikeElement extends UsaElement {
1103
+ liked: boolean;
1104
+ count: number | null;
1105
+ toggle(force?: boolean): void;
1106
+ }
1107
+ declare function defineLike(tag?: string): CustomElementConstructor | undefined;
1108
+
1109
+ /**
1110
+ * `<usa-hold>` — hold-to-confirm: press and hold (pointer, Space or Enter)
1111
+ * while a progress ring fills; releasing early rewinds it. Good for
1112
+ * destructive actions.
1113
+ *
1114
+ * Attributes: `duration` (ms, 1200), `label` (accessible name), `color`,
1115
+ * `disabled`. CSS variable `--usa-hold` (0–1). Events: `usa:progress`,
1116
+ * `usa:confirm`, `usa:cancel`. Reduced motion: same timing, the ring fills
1117
+ * without the scale pulse.
1118
+ */
1119
+ interface UsaHoldElement extends UsaElement {
1120
+ readonly progress: number;
1121
+ cancel(): void;
1122
+ }
1123
+ declare function defineHold(tag?: string): CustomElementConstructor | undefined;
1124
+
1125
+ /**
1126
+ * `<usa-double-tap>` — detects a double tap / double click on its content
1127
+ * (photos, posts) and pops a heart (or `icon`) at the tap point.
1128
+ *
1129
+ * Attributes: `icon` (text / emoji, default ♥), `color`, `delay` (max ms
1130
+ * between taps, 300), `haptic`, `disabled`. Events: `usa:double-tap`
1131
+ * (`{ x, y }`, element-relative). Keyboard users: press `L` while focused.
1132
+ * Reduced motion: the icon fades in and out without scaling or particles.
1133
+ */
1134
+ interface UsaDoubleTapElement extends UsaElement {
1135
+ pop(x?: number, y?: number): void;
1136
+ }
1137
+ declare function defineDoubleTap(tag?: string): CustomElementConstructor | undefined;
1138
+
1139
+ /**
1140
+ * `<usa-checkbox>` — an animated, form-associated checkbox: the box springs
1141
+ * and the check mark draws itself. `role="checkbox"` + `aria-checked`
1142
+ * (`mixed` with `indeterminate`).
1143
+ *
1144
+ * Attributes: `checked`, `indeterminate`, `disabled`, `name`, `value`
1145
+ * (`on`), `label`, `shape` (`square` default, `circle`). Events: `change`,
1146
+ * `usa:change` (`{ checked }`). Reduced motion: no spring or drawing.
1147
+ */
1148
+ interface UsaCheckboxElement extends UsaElement {
1149
+ checked: boolean;
1150
+ indeterminate: boolean;
1151
+ toggle(force?: boolean): void;
1152
+ }
1153
+ declare function defineCheckbox(tag?: string): CustomElementConstructor | undefined;
1154
+
1155
+ interface BurstOptions {
1156
+ /** Number of particles (default 12). */
1157
+ count?: number;
1158
+ /** Colours to pick from (default: accent palette). */
1159
+ colors?: string[];
1160
+ /** Travel distance in px (default 48). */
1161
+ distance?: number;
1162
+ /** Particle size in px (default 6). */
1163
+ size?: number;
1164
+ /** `circle` (default), `square`, `star`, `heart` or any text / emoji. */
1165
+ shape?: 'circle' | 'square' | 'star' | 'heart' | string;
1166
+ /** Duration in ms (default 600). */
1167
+ duration?: number;
1168
+ }
1169
+ /** Particles radiating from client point (x, y). Returns the number spawned. */
1170
+ declare function burst(x: number, y: number, options?: BurstOptions): number;
1171
+ interface ConfettiOptions {
1172
+ /** Origin in client px (default: centre-bottom third of the viewport). */
1173
+ x?: number;
1174
+ y?: number;
1175
+ /** Pieces (default 80). */
1176
+ count?: number;
1177
+ /** Spread angle in degrees (default 70). */
1178
+ spread?: number;
1179
+ /** Launch speed multiplier (default 1). */
1180
+ velocity?: number;
1181
+ colors?: string[];
1182
+ /** Duration in ms (default 1600). */
1183
+ duration?: number;
1184
+ }
1185
+ /** A confetti cannon (paper pieces with gravity, drift and spin). */
1186
+ declare function confetti(options?: ConfettiOptions): number;
1187
+ /** Horizontal error shake (`intensity` px, default 8). Reduced motion: a red outline flash. */
1188
+ declare function shake(el: Element, intensity?: number, duration?: number): Animation | null;
1189
+ /** `navigator.vibrate()` where supported (Android Chrome, some WebViews). Returns whether it ran. */
1190
+ declare function haptic(pattern?: number | number[]): boolean;
1191
+
1192
+ /**
1193
+ * use-scroll-animate/components/click — click & tap effects (v2.5).
1194
+ * `<usa-click>` (ripple, burst, confetti, squish, press-spring, shake),
1195
+ * `<usa-button>` (button click deformation: squash, wobble, gooey, dent;
1196
+ * shape morph; submit → loading → success), `<usa-icon-morph>`,
1197
+ * `<usa-like>`, `<usa-hold>`, `<usa-double-tap>`, `<usa-checkbox>`, plus
1198
+ * `burst()`, `confetti()`, `shake()` and `haptic()`.
1199
+ */
1200
+
1201
+ /** Register every component of this category under its default tag. */
1202
+ declare function defineClickComponents(): void;
1203
+ declare global {
1204
+ interface HTMLElementTagNameMap {
1205
+ 'usa-click': UsaClickElement;
1206
+ 'usa-button': UsaButtonElement;
1207
+ 'usa-icon-morph': UsaIconMorphElement;
1208
+ 'usa-like': UsaLikeElement;
1209
+ 'usa-hold': UsaHoldElement;
1210
+ 'usa-double-tap': UsaDoubleTapElement;
1211
+ 'usa-checkbox': UsaCheckboxElement;
1212
+ }
1213
+ }
1214
+
1215
+ /**
1216
+ * `<usa-tabs>` — accessible tabs with a sliding (spring) indicator.
1217
+ * Tabs: `[data-tab]` children (buttons); panels: `[data-panel]` children, in
1218
+ * the same order. Arrow keys / Home / End move between tabs (roving tabindex).
1219
+ *
1220
+ * Attributes: `selected` (index, 0), `indicator` (`line` default, `pill`),
1221
+ * `variant`. Events: `usa:change` (`{ index }`). Panels fade/slide in;
1222
+ * reduced motion: the indicator jumps and panels switch instantly.
1223
+ */
1224
+ interface UsaTabsElement extends UsaElement {
1225
+ selected: number;
1226
+ select(i: number, focus?: boolean): void;
1227
+ }
1228
+ declare function defineTabs(tag?: string): CustomElementConstructor | undefined;
1229
+
1230
+ /**
1231
+ * `<usa-drawer>` — a side panel that slides in with a spring and can be
1232
+ * dragged / swiped closed. Modal: backdrop, Esc, focus returns on close.
1233
+ * Attributes: `open`, `side` (`left` default, `right`, `top`, `bottom`),
1234
+ * `label`, `variant`. Events: `usa:open`, `usa:close`. `[data-close]` closes.
1235
+ * Reduced motion: opens and closes instantly.
1236
+ */
1237
+ interface UsaDrawerElement extends UsaElement {
1238
+ open: boolean;
1239
+ show(): void;
1240
+ close(): void;
1241
+ }
1242
+ /**
1243
+ * `<usa-bottom-sheet>` — a draggable bottom sheet with snap points
1244
+ * (`snap="0.3,0.6,0.92"`, fractions of the viewport height; default
1245
+ * `0.5,0.92`; `start` = index of the snap it opens at, default 0), inertia and drag-down-to-dismiss. `[data-handle]` (or the
1246
+ * built-in grabber) drags it. Attributes: `open`, `snap`, `start` (initial
1247
+ * snap index), `label`, `variant`. Events: `usa:open`, `usa:close`, `usa:snap`.
1248
+ */
1249
+ interface UsaBottomSheetElement extends UsaDrawerElement {
1250
+ }
1251
+ declare function defineDrawer(tag?: string): CustomElementConstructor | undefined;
1252
+ declare function defineBottomSheet(tag?: string): CustomElementConstructor | undefined;
1253
+
1254
+ /**
1255
+ * `<usa-pull-refresh>` — pull-to-refresh for a scroll container (itself):
1256
+ * pull down at the top (touch / pointer) and a spinner stretches in; past
1257
+ * `threshold` (px, 70) releasing fires `usa:refresh` — call
1258
+ * `event.detail.done()` (or return a promise to `onrefresh`) to finish.
1259
+ * Also exposes `refresh()` for a keyboard / button path.
1260
+ * Attributes: `threshold`, `disabled`, `label` (status text, "Refreshing").
1261
+ * Reduced motion: no stretch; the spinner simply appears while refreshing.
1262
+ */
1263
+ interface UsaPullRefreshElement extends UsaElement {
1264
+ readonly refreshing: boolean;
1265
+ refresh(): Promise<void>;
1266
+ }
1267
+ declare function definePullRefresh(tag?: string): CustomElementConstructor | undefined;
1268
+
1269
+ /**
1270
+ * `<usa-fab>` — floating action button with a speed dial. The first element
1271
+ * child is the main button; the others are actions that fan out with a
1272
+ * staggered spring when it opens (`direction="up"` default, `down`, `left`,
1273
+ * `right`, `radial`). Esc / outside click closes; `aria-expanded` on the
1274
+ * main button; actions are hidden from AT while closed.
1275
+ * Attributes: `open`, `direction`, `position` (`bottom-right` default, `bottom-left`,
1276
+ * `inline`), `gap` (px, 56), `variant`. Events: `usa:toggle` (`{ open }`).
1277
+ * Reduced motion: actions appear without travel.
1278
+ */
1279
+ interface UsaFabElement extends UsaElement {
1280
+ open: boolean;
1281
+ toggle(force?: boolean): void;
1282
+ }
1283
+ declare function defineFab(tag?: string): CustomElementConstructor | undefined;
1284
+
1285
+ /**
1286
+ * `<usa-navbar>` — an app bar that hides while you scroll down and returns
1287
+ * as soon as you scroll up (or reach the top); `shrink` makes it compact
1288
+ * once scrolled. Focus inside always reveals it.
1289
+ * Attributes: `threshold` (px of scroll before hiding, 64), `shrink`,
1290
+ * `target` (selector of a scroll container instead of the page), `variant`.
1291
+ * State attributes: `data-hidden`, `data-scrolled`. Events: `usa:hide`, `usa:show`.
1292
+ * Reduced motion: hides/shows without sliding (instant).
1293
+ */
1294
+ interface UsaNavbarElement extends UsaElement {
1295
+ readonly hiddenByScroll: boolean;
1296
+ show(): void;
1297
+ }
1298
+ declare function defineNavbar(tag?: string): CustomElementConstructor | undefined;
1299
+
1300
+ /**
1301
+ * `<usa-slider>` — a form-associated range slider (`role="slider"`). The
1302
+ * thumb follows with a spring, grows while dragged and shows a value bubble.
1303
+ * Keyboard: arrows (step), PageUp/PageDown (10 steps), Home/End.
1304
+ * Attributes: `value`, `min` (0), `max` (100), `step` (1), `name`, `label`,
1305
+ * `bubble` (show the value while dragging), `disabled`, `variant`.
1306
+ * Events: `input` + `usa:input` while moving, `change` + `usa:change` on release.
1307
+ * Reduced motion: the thumb jumps (no spring).
1308
+ */
1309
+ interface UsaSliderElement extends UsaElement {
1310
+ value: number;
1311
+ }
1312
+ declare function defineSlider(tag?: string): CustomElementConstructor | undefined;
1313
+
1314
+ /**
1315
+ * `<usa-rating>` — star rating with hover preview and a springy pop when a
1316
+ * value is chosen. `role="slider"` (arrow keys, Home/End, number keys).
1317
+ * Attributes: `value` (0), `max` (5), `icon` (★), `readonly`, `label`
1318
+ * ("Rating"), `name` (form value), `variant`. Events: `change`, `usa:change` (`{ value }`).
1319
+ * Reduced motion: no pop.
1320
+ */
1321
+ interface UsaRatingElement extends UsaElement {
1322
+ value: number;
1323
+ }
1324
+ declare function defineRating(tag?: string): CustomElementConstructor | undefined;
1325
+
1326
+ /**
1327
+ * `<usa-tooltip text="…">` — a tooltip for the element it wraps, shown on
1328
+ * hover (after `delay` ms, 300) and on keyboard focus, hidden on Esc / blur.
1329
+ * It springs in from its placement side and flips to stay on screen; the
1330
+ * trigger gets `aria-describedby`.
1331
+ * Attributes: `text`, `placement` (`top` default, `bottom`, `left`, `right`),
1332
+ * `delay`, `variant`. Reduced motion: fades only.
1333
+ */
1334
+ interface UsaTooltipElement extends UsaElement {
1335
+ show(): void;
1336
+ hide(): void;
1337
+ }
1338
+ declare function defineTooltip(tag?: string): CustomElementConstructor | undefined;
1339
+
1340
+ /**
1341
+ * `<usa-popover>` — a click-to-open popover: the first element child is the
1342
+ * trigger, `[data-popover]` is the content. Springs open from the trigger,
1343
+ * flips to stay on screen; Esc or an outside click closes and focus returns
1344
+ * to the trigger. `aria-expanded` / `aria-controls` on the trigger.
1345
+ * Attributes: `open`, `placement` (`bottom` default), `variant`. Events:
1346
+ * `usa:open`, `usa:close`. Reduced motion: fades only.
1347
+ */
1348
+ interface UsaPopoverElement extends UsaElement {
1349
+ open: boolean;
1350
+ toggle(force?: boolean): void;
1351
+ }
1352
+ declare function definePopover(tag?: string): CustomElementConstructor | undefined;
1353
+
1354
+ /**
1355
+ * `<usa-badge>` — a count / dot badge on whatever it wraps; bumps with a
1356
+ * spring whenever the value changes and pulses with `pulse`.
1357
+ * Attributes: `value` (number or text; 0 / empty hides it unless
1358
+ * `show-zero`), `max` (99 → "99+"), `dot`, `pulse`, `label` (accessible
1359
+ * text, default "{n} new"), `variant`. Reduced motion: no bump or pulse.
1360
+ */
1361
+ interface UsaBadgeElement extends UsaElement {
1362
+ value: string;
1363
+ }
1364
+ declare function defineBadge(tag?: string): CustomElementConstructor | undefined;
1365
+
1366
+ /**
1367
+ * `<usa-avatar-stack>` — overlapping avatars (its children: `<img>` or any
1368
+ * element) that spread apart with a spring on hover / focus; extra ones
1369
+ * collapse into a "+N" chip.
1370
+ * Attributes: `max` (visible avatars, 5), `size` (px, 36), `overlap` (0–1,
1371
+ * 0.35), `label` (group name), `variant`. Reduced motion: no spreading.
1372
+ */
1373
+ interface UsaAvatarStackElement extends UsaElement {
1374
+ }
1375
+ declare function defineAvatarStack(tag?: string): CustomElementConstructor | undefined;
1376
+
1377
+ /**
1378
+ * Style variants (v2.6): `variant="minimal | neon | glass | brutalist |
1379
+ * fluent | material"` on any `<usa-*>` element — or on any ancestor as
1380
+ * `data-usa-variant`, or page-wide with `setVariant()` — sets the shared
1381
+ * design tokens every component reads:
1382
+ *
1383
+ * `--usa-accent`, `--usa-accent-text`, `--usa-surface`, `--usa-text`,
1384
+ * `--usa-radius`, `--usa-border`, `--usa-shadow`, `--usa-blur`, `--usa-font`.
1385
+ *
1386
+ * (`<usa-spinner>`, `<usa-check>` and `<usa-dialog>` already use `variant`
1387
+ * for their kind; the token names never clash with those values except
1388
+ * `fluent`, which means the same thing there.)
1389
+ */
1390
+ declare const VARIANTS: readonly ["minimal", "neon", "glass", "brutalist", "fluent", "material"];
1391
+ type Variant = (typeof VARIANTS)[number];
1392
+ /** Inject the variant token sheet (done automatically by every `ui` component). */
1393
+ declare function adoptVariants(): void;
1394
+ /** Apply a variant to the whole page (or `root`); `null` removes it. */
1395
+ declare function setVariant(variant: Variant | null, root?: Element | null): void;
1396
+
1397
+ type Placement = 'top' | 'bottom' | 'left' | 'right';
1398
+
1399
+ /**
1400
+ * use-scroll-animate/components/ui — animated UI components + style variants (v2.6).
1401
+ * `<usa-tabs>`, `<usa-drawer>`, `<usa-bottom-sheet>`, `<usa-pull-refresh>`,
1402
+ * `<usa-fab>`, `<usa-navbar>`, `<usa-slider>`, `<usa-rating>`,
1403
+ * `<usa-tooltip>`, `<usa-popover>`, `<usa-badge>`, `<usa-avatar-stack>`,
1404
+ * and `variant="minimal | neon | glass | brutalist | fluent | material"`
1405
+ * design tokens (`setVariant()`, `VARIANTS`).
1406
+ */
1407
+
1408
+ /** Register every component of this category under its default tag. */
1409
+ declare function defineUiComponents(): void;
1410
+ declare global {
1411
+ interface HTMLElementTagNameMap {
1412
+ 'usa-tabs': UsaTabsElement;
1413
+ 'usa-drawer': UsaDrawerElement;
1414
+ 'usa-bottom-sheet': UsaBottomSheetElement;
1415
+ 'usa-pull-refresh': UsaPullRefreshElement;
1416
+ 'usa-fab': UsaFabElement;
1417
+ 'usa-navbar': UsaNavbarElement;
1418
+ 'usa-slider': UsaSliderElement;
1419
+ 'usa-rating': UsaRatingElement;
1420
+ 'usa-tooltip': UsaTooltipElement;
1421
+ 'usa-popover': UsaPopoverElement;
1422
+ 'usa-badge': UsaBadgeElement;
1423
+ 'usa-avatar-stack': UsaAvatarStackElement;
1424
+ }
1425
+ }
1426
+
1004
1427
  /** The component categories and their default tags. */
1005
1428
  declare const COMPONENT_CATEGORIES: {
1006
1429
  readonly reveal: readonly ["usa-reveal", "usa-stagger", "usa-scroll-progress", "usa-scrolly"];
@@ -1011,6 +1434,8 @@ declare const COMPONENT_CATEGORIES: {
1011
1434
  readonly transitions: readonly ["usa-dialog", "usa-accordion", "usa-flip-list", "usa-view-switch"];
1012
1435
  readonly physics: readonly ["usa-spring", "usa-draggable", "usa-overscroll"];
1013
1436
  readonly cards: readonly ["usa-card", "usa-card-stack", "usa-sticky-stack", "usa-carousel-3d"];
1437
+ readonly click: readonly ["usa-click", "usa-button", "usa-icon-morph", "usa-like", "usa-hold", "usa-double-tap", "usa-checkbox"];
1438
+ readonly ui: readonly ["usa-tabs", "usa-drawer", "usa-bottom-sheet", "usa-pull-refresh", "usa-fab", "usa-navbar", "usa-slider", "usa-rating", "usa-tooltip", "usa-popover", "usa-badge", "usa-avatar-stack"];
1014
1439
  };
1015
1440
  type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
1016
1441
  /**
@@ -1019,5 +1444,5 @@ type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;
1019
1444
  */
1020
1445
  declare function defineComponents(categories?: ComponentCategory[]): void;
1021
1446
 
1022
- export { CARD_EFFECTS, COMPONENT_CATEGORIES, REVEAL_EFFECTS, SPINNER_VARIANTS, SPRING_EFFECTS, SPRING_PRESETS, configureComponents, connectedAnimation, createSpring, defineAccordion, defineAcrylic, defineAurora, defineBackgroundComponents, defineCard, defineCardComponents, defineCardStack, defineCarousel3d, defineCheck, defineComponents, defineCounter, defineDialog, defineDraggable, defineFeedbackComponents, defineFlipList, defineGrain, defineInteractionComponents, defineMagnetic, defineMarquee, defineOverscroll, defineParticles, definePhysicsComponents, definePress, defineProgress, defineReveal, defineRevealComponents, defineRipple, defineScramble, defineScrollProgress, defineScrolly, defineShimmerText, defineSkeleton, defineSpinner, defineSplitText, defineSpotlight, defineSpring, defineStagger, defineStickyStack, defineTextComponents, defineTextRotate, defineTilt, defineToaster, defineToggle, defineTransitionComponents, defineTypewriter, defineViewSwitch, easeOutExpo, flip, linearEasing, prefersReducedMotion, projectInertia, readScrollProgress, resolveSpring, revealKeyframes, rubberBand, scrambleFrame, snapTo, spring, springEasing, springEffectKeyframes, springSamples, stepSpring, supportsLinearEasing, toast, viewTransition };
1023
- export type { CardEffect, ComponentCategory, ComponentsConfig, ConnectedOptions, DialogVariant, FlipOptions, RevealEffect, SpinnerVariant, SpringConfig, SpringEffect, SpringInput, SpringPreset, SpringValue, SpringValueOptions, ToastHandle, ToastOptions, ToastType, UsaAccordionElement, UsaAcrylicElement, UsaAuroraElement, UsaCardElement, UsaCardStackElement, UsaCarousel3dElement, UsaCheckElement, UsaCounterElement, UsaDialogElement, UsaDraggableElement, UsaElement, UsaFlipListElement, UsaGrainElement, UsaMagneticElement, UsaMarqueeElement, UsaOverscrollElement, UsaParticlesElement, UsaPressElement, UsaProgressElement, UsaRevealElement, UsaRippleElement, UsaScrambleElement, UsaScrollProgressElement, UsaScrollyElement, UsaShimmerTextElement, UsaSkeletonElement, UsaSpinnerElement, UsaSplitTextElement, UsaSpotlightElement, UsaSpringElement, UsaStaggerElement, UsaStickyStackElement, UsaTextRotateElement, UsaTiltElement, UsaToasterElement, UsaToggleElement, UsaTypewriterElement, UsaViewSwitchElement, ViewTransitionOptions };
1447
+ export { BUTTON_DEFORMS, CARD_EFFECTS, CLICK_EFFECTS, COMPONENT_CATEGORIES, MORPH_ICONS, REVEAL_EFFECTS, SPINNER_VARIANTS, SPRING_EFFECTS, SPRING_PRESETS, VARIANTS, adoptVariants, burst, confetti, configureComponents, connectedAnimation, createSpring, defineAccordion, defineAcrylic, defineAurora, defineAvatarStack, defineBackgroundComponents, defineBadge, defineBottomSheet, defineButton, defineCard, defineCardComponents, defineCardStack, defineCarousel3d, defineCheck, defineCheckbox, defineClick, defineClickComponents, defineComponents, defineCounter, defineDialog, defineDoubleTap, defineDraggable, defineDrawer, defineFab, defineFeedbackComponents, defineFlipList, defineGrain, defineHold, defineIconMorph, defineInteractionComponents, defineLike, defineMagnetic, defineMarquee, defineNavbar, defineOverscroll, defineParticles, definePhysicsComponents, definePopover, definePress, defineProgress, definePullRefresh, defineRating, defineReveal, defineRevealComponents, defineRipple, defineScramble, defineScrollProgress, defineScrolly, defineShimmerText, defineSkeleton, defineSlider, defineSpinner, defineSplitText, defineSpotlight, defineSpring, defineStagger, defineStickyStack, defineTabs, defineTextComponents, defineTextRotate, defineTilt, defineToaster, defineToggle, defineTooltip, defineTransitionComponents, defineTypewriter, defineUiComponents, defineViewSwitch, easeOutExpo, flip, haptic, linearEasing, morphPath, prefersReducedMotion, projectInertia, readScrollProgress, resolveSpring, revealKeyframes, rubberBand, scrambleFrame, setVariant, shake, snapTo, spring, springEasing, springEffectKeyframes, springSamples, stepSpring, supportsLinearEasing, toast, viewTransition };
1448
+ export type { BurstOptions, ButtonDeform, ButtonShape, ButtonState, CardEffect, ClickEffect, ComponentCategory, ComponentsConfig, ConfettiOptions, ConnectedOptions, DialogVariant, FlipOptions, Placement, RevealEffect, SpinnerVariant, SpringConfig, SpringEffect, SpringInput, SpringPreset, SpringValue, SpringValueOptions, ToastHandle, ToastOptions, ToastType, UsaAccordionElement, UsaAcrylicElement, UsaAuroraElement, UsaAvatarStackElement, UsaBadgeElement, UsaBottomSheetElement, UsaButtonElement, UsaCardElement, UsaCardStackElement, UsaCarousel3dElement, UsaCheckElement, UsaCheckboxElement, UsaClickElement, UsaCounterElement, UsaDialogElement, UsaDoubleTapElement, UsaDraggableElement, UsaDrawerElement, UsaElement, UsaFabElement, UsaFlipListElement, UsaGrainElement, UsaHoldElement, UsaIconMorphElement, UsaLikeElement, UsaMagneticElement, UsaMarqueeElement, UsaNavbarElement, UsaOverscrollElement, UsaParticlesElement, UsaPopoverElement, UsaPressElement, UsaProgressElement, UsaPullRefreshElement, UsaRatingElement, UsaRevealElement, UsaRippleElement, UsaScrambleElement, UsaScrollProgressElement, UsaScrollyElement, UsaShimmerTextElement, UsaSkeletonElement, UsaSliderElement, UsaSpinnerElement, UsaSplitTextElement, UsaSpotlightElement, UsaSpringElement, UsaStaggerElement, UsaStickyStackElement, UsaTabsElement, UsaTextRotateElement, UsaTiltElement, UsaToasterElement, UsaToggleElement, UsaTooltipElement, UsaTypewriterElement, UsaViewSwitchElement, Variant, ViewTransitionOptions };
@@ -14,8 +14,13 @@ import { definePhysicsComponents } from './components/physics.js';
14
14
  export { SPRING_EFFECTS, defineDraggable, defineOverscroll, defineSpring, springEffectKeyframes } from './components/physics.js';
15
15
  import { defineCardComponents } from './components/cards.js';
16
16
  export { CARD_EFFECTS, defineCard, defineCardStack, defineCarousel3d, defineStickyStack } from './components/cards.js';
17
- export { S as SPRING_PRESETS, c as createSpring, l as linearEasing, p as projectInertia, r as resolveSpring, a as rubberBand, s as snapTo, b as spring, d as springEasing, e as springSamples, f as stepSpring, g as supportsLinearEasing } from './chunks/spring-BKUU7-Xm.js';
18
- export { c as configureComponents, p as prefersReducedMotion } from './chunks/base-CuvCgqLy.js';
17
+ import { defineClickComponents } from './components/click.js';
18
+ export { BUTTON_DEFORMS, CLICK_EFFECTS, MORPH_ICONS, burst, confetti, defineButton, defineCheckbox, defineClick, defineDoubleTap, defineHold, defineIconMorph, defineLike, haptic, morphPath, shake } from './components/click.js';
19
+ import { adoptVariants, defineUiComponents } from './components/ui.js';
20
+ export { VARIANTS, defineAvatarStack, defineBadge, defineBottomSheet, defineDrawer, defineFab, defineNavbar, definePopover, definePullRefresh, defineRating, defineSlider, defineTabs, defineTooltip, setVariant } from './components/ui.js';
21
+ import { c as canDefine } from './chunks/base-08OYzphB.js';
22
+ export { a as configureComponents, p as prefersReducedMotion } from './chunks/base-08OYzphB.js';
23
+ export { S as SPRING_PRESETS, c as createSpring, l as linearEasing, p as projectInertia, r as resolveSpring, a as rubberBand, s as snapTo, b as spring, d as springEasing, e as springSamples, f as stepSpring, g as supportsLinearEasing } from './chunks/spring-CpeFkxNd.js';
19
24
 
20
25
  /**
21
26
  * use-scroll-animate/components
@@ -47,6 +52,8 @@ const COMPONENT_CATEGORIES = {
47
52
  transitions: ['usa-dialog', 'usa-accordion', 'usa-flip-list', 'usa-view-switch'],
48
53
  physics: ['usa-spring', 'usa-draggable', 'usa-overscroll'],
49
54
  cards: ['usa-card', 'usa-card-stack', 'usa-sticky-stack', 'usa-carousel-3d'],
55
+ click: ['usa-click', 'usa-button', 'usa-icon-morph', 'usa-like', 'usa-hold', 'usa-double-tap', 'usa-checkbox'],
56
+ ui: ['usa-tabs', 'usa-drawer', 'usa-bottom-sheet', 'usa-pull-refresh', 'usa-fab', 'usa-navbar', 'usa-slider', 'usa-rating', 'usa-tooltip', 'usa-popover', 'usa-badge', 'usa-avatar-stack'],
50
57
  };
51
58
  const BY_CATEGORY = {
52
59
  reveal: defineRevealComponents,
@@ -57,14 +64,18 @@ const BY_CATEGORY = {
57
64
  transitions: defineTransitionComponents,
58
65
  physics: definePhysicsComponents,
59
66
  cards: defineCardComponents,
67
+ click: defineClickComponents,
68
+ ui: defineUiComponents,
60
69
  };
61
70
  /**
62
71
  * Register every `<usa-*>` component (or only the given categories).
63
72
  * Safe to call more than once and on the server (no-op without DOM).
64
73
  */
65
74
  function defineComponents(categories) {
75
+ if (canDefine())
76
+ adoptVariants();
66
77
  (categories || Object.keys(BY_CATEGORY)).forEach((c) => BY_CATEGORY[c]?.());
67
78
  }
68
79
 
69
- export { COMPONENT_CATEGORIES, defineBackgroundComponents, defineCardComponents, defineComponents, defineFeedbackComponents, defineInteractionComponents, definePhysicsComponents, defineRevealComponents, defineTextComponents, defineTransitionComponents };
80
+ export { COMPONENT_CATEGORIES, adoptVariants, defineBackgroundComponents, defineCardComponents, defineClickComponents, defineComponents, defineFeedbackComponents, defineInteractionComponents, definePhysicsComponents, defineRevealComponents, defineTextComponents, defineTransitionComponents, defineUiComponents };
70
81
  //# sourceMappingURL=components.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.js","sources":["../src/components/index.ts"],"sourcesContent":["/**\n * use-scroll-animate/components\n *\n * Framework-agnostic, dependency-free animated UI components built on\n * Custom Elements + CSS + the Web Animations API. They run in any browser\n * and in Windows desktop apps that render with a web view: Electron, Tauri\n * (WebView2), WinUI 3 / WPF / WinForms with WebView2, and installed PWAs.\n *\n * ```js\n * import { defineComponents } from 'use-scroll-animate/components';\n * defineComponents(); // registers every <usa-*> element\n * // or only what you use (tree-shakable):\n * import { defineTypewriter } from 'use-scroll-animate/components/text';\n * ```\n *\n * Importing has no side effects and is SSR-safe; nothing is registered\n * until a `define*()` function runs in a browser.\n *\n * @license MIT\n */\nimport { defineRevealComponents } from './reveal/index';\nimport { defineTextComponents } from './text/index';\nimport { defineInteractionComponents } from './interaction/index';\nimport { defineFeedbackComponents } from './feedback/index';\nimport { defineBackgroundComponents } from './background/index';\nimport { defineTransitionComponents } from './transitions/index';\nimport { definePhysicsComponents } from './physics/index';\nimport { defineCardComponents } from './cards/index';\n\nexport * from './reveal/index';\nexport * from './text/index';\nexport * from './interaction/index';\nexport * from './feedback/index';\nexport * from './background/index';\nexport * from './transitions/index';\nexport * from './physics/index';\nexport * from './cards/index';\n\n/** The component categories and their default tags. */\nexport const COMPONENT_CATEGORIES = {\n reveal: ['usa-reveal', 'usa-stagger', 'usa-scroll-progress', 'usa-scrolly'],\n text: ['usa-typewriter', 'usa-split-text', 'usa-scramble', 'usa-counter', 'usa-shimmer-text', 'usa-text-rotate'],\n interaction: ['usa-ripple', 'usa-magnetic', 'usa-tilt', 'usa-spotlight', 'usa-press', 'usa-toggle'],\n feedback: ['usa-spinner', 'usa-skeleton', 'usa-progress', 'usa-toaster', 'usa-check'],\n background: ['usa-aurora', 'usa-particles', 'usa-grain', 'usa-marquee', 'usa-acrylic'],\n transitions: ['usa-dialog', 'usa-accordion', 'usa-flip-list', 'usa-view-switch'],\n physics: ['usa-spring', 'usa-draggable', 'usa-overscroll'],\n cards: ['usa-card', 'usa-card-stack', 'usa-sticky-stack', 'usa-carousel-3d'],\n} as const;\n\nexport type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;\n\nconst BY_CATEGORY: Record<ComponentCategory, () => void> = {\n reveal: defineRevealComponents,\n text: defineTextComponents,\n interaction: defineInteractionComponents,\n feedback: defineFeedbackComponents,\n background: defineBackgroundComponents,\n transitions: defineTransitionComponents,\n physics: definePhysicsComponents,\n cards: defineCardComponents,\n};\n\n/**\n * Register every `<usa-*>` component (or only the given categories).\n * Safe to call more than once and on the server (no-op without DOM).\n */\nexport function defineComponents(categories?: ComponentCategory[]): void {\n (categories || (Object.keys(BY_CATEGORY) as ComponentCategory[])).forEach((c) => BY_CATEGORY[c]?.());\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAmBH;AACO,MAAM,oBAAoB,GAAG;IAClC,MAAM,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,aAAa,CAAC;AAC3E,IAAA,IAAI,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,iBAAiB,CAAC;AAChH,IAAA,WAAW,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,CAAC;IACnG,QAAQ,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,CAAC;IACrF,UAAU,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,CAAC;IACtF,WAAW,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,CAAC;AAChF,IAAA,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,gBAAgB,CAAC;IAC1D,KAAK,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,CAAC;;AAK9E,MAAM,WAAW,GAA0C;AACzD,IAAA,MAAM,EAAE,sBAAsB;AAC9B,IAAA,IAAI,EAAE,oBAAoB;AAC1B,IAAA,WAAW,EAAE,2BAA2B;AACxC,IAAA,QAAQ,EAAE,wBAAwB;AAClC,IAAA,UAAU,EAAE,0BAA0B;AACtC,IAAA,WAAW,EAAE,0BAA0B;AACvC,IAAA,OAAO,EAAE,uBAAuB;AAChC,IAAA,KAAK,EAAE,oBAAoB;CAC5B;AAED;;;AAGG;AACG,SAAU,gBAAgB,CAAC,UAAgC,EAAA;IAC/D,CAAC,UAAU,IAAK,MAAM,CAAC,IAAI,CAAC,WAAW,CAAyB,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;AACtG;;;;"}
1
+ {"version":3,"file":"components.js","sources":["../src/components/index.ts"],"sourcesContent":["/**\n * use-scroll-animate/components\n *\n * Framework-agnostic, dependency-free animated UI components built on\n * Custom Elements + CSS + the Web Animations API. They run in any browser\n * and in Windows desktop apps that render with a web view: Electron, Tauri\n * (WebView2), WinUI 3 / WPF / WinForms with WebView2, and installed PWAs.\n *\n * ```js\n * import { defineComponents } from 'use-scroll-animate/components';\n * defineComponents(); // registers every <usa-*> element\n * // or only what you use (tree-shakable):\n * import { defineTypewriter } from 'use-scroll-animate/components/text';\n * ```\n *\n * Importing has no side effects and is SSR-safe; nothing is registered\n * until a `define*()` function runs in a browser.\n *\n * @license MIT\n */\nimport { defineRevealComponents } from './reveal/index';\nimport { defineTextComponents } from './text/index';\nimport { defineInteractionComponents } from './interaction/index';\nimport { defineFeedbackComponents } from './feedback/index';\nimport { defineBackgroundComponents } from './background/index';\nimport { defineTransitionComponents } from './transitions/index';\nimport { definePhysicsComponents } from './physics/index';\nimport { defineCardComponents } from './cards/index';\nimport { defineClickComponents } from './click/index';\nimport { defineUiComponents } from './ui/index';\nimport { adoptVariants } from './ui/variants';\nimport { canDefine } from './base';\n\nexport * from './reveal/index';\nexport * from './text/index';\nexport * from './interaction/index';\nexport * from './feedback/index';\nexport * from './background/index';\nexport * from './transitions/index';\nexport * from './physics/index';\nexport * from './cards/index';\nexport * from './click/index';\nexport * from './ui/index';\n\n/** The component categories and their default tags. */\nexport const COMPONENT_CATEGORIES = {\n reveal: ['usa-reveal', 'usa-stagger', 'usa-scroll-progress', 'usa-scrolly'],\n text: ['usa-typewriter', 'usa-split-text', 'usa-scramble', 'usa-counter', 'usa-shimmer-text', 'usa-text-rotate'],\n interaction: ['usa-ripple', 'usa-magnetic', 'usa-tilt', 'usa-spotlight', 'usa-press', 'usa-toggle'],\n feedback: ['usa-spinner', 'usa-skeleton', 'usa-progress', 'usa-toaster', 'usa-check'],\n background: ['usa-aurora', 'usa-particles', 'usa-grain', 'usa-marquee', 'usa-acrylic'],\n transitions: ['usa-dialog', 'usa-accordion', 'usa-flip-list', 'usa-view-switch'],\n physics: ['usa-spring', 'usa-draggable', 'usa-overscroll'],\n cards: ['usa-card', 'usa-card-stack', 'usa-sticky-stack', 'usa-carousel-3d'],\n click: ['usa-click', 'usa-button', 'usa-icon-morph', 'usa-like', 'usa-hold', 'usa-double-tap', 'usa-checkbox'],\n ui: ['usa-tabs', 'usa-drawer', 'usa-bottom-sheet', 'usa-pull-refresh', 'usa-fab', 'usa-navbar', 'usa-slider', 'usa-rating', 'usa-tooltip', 'usa-popover', 'usa-badge', 'usa-avatar-stack'],\n} as const;\n\nexport type ComponentCategory = keyof typeof COMPONENT_CATEGORIES;\n\nconst BY_CATEGORY: Record<ComponentCategory, () => void> = {\n reveal: defineRevealComponents,\n text: defineTextComponents,\n interaction: defineInteractionComponents,\n feedback: defineFeedbackComponents,\n background: defineBackgroundComponents,\n transitions: defineTransitionComponents,\n physics: definePhysicsComponents,\n cards: defineCardComponents,\n click: defineClickComponents,\n ui: defineUiComponents,\n};\n\n/**\n * Register every `<usa-*>` component (or only the given categories).\n * Safe to call more than once and on the server (no-op without DOM).\n */\nexport function defineComponents(categories?: ComponentCategory[]): void {\n if (canDefine()) adoptVariants();\n (categories || (Object.keys(BY_CATEGORY) as ComponentCategory[])).forEach((c) => BY_CATEGORY[c]?.());\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;AAyBH;AACO,MAAM,oBAAoB,GAAG;IAClC,MAAM,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,aAAa,CAAC;AAC3E,IAAA,IAAI,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,iBAAiB,CAAC;AAChH,IAAA,WAAW,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,CAAC;IACnG,QAAQ,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,CAAC;IACrF,UAAU,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,CAAC;IACtF,WAAW,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,CAAC;AAChF,IAAA,OAAO,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,gBAAgB,CAAC;IAC1D,KAAK,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,CAAC;AAC5E,IAAA,KAAK,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,cAAc,CAAC;IAC9G,EAAE,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAkB,CAAC;;AAK5L,MAAM,WAAW,GAA0C;AACzD,IAAA,MAAM,EAAE,sBAAsB;AAC9B,IAAA,IAAI,EAAE,oBAAoB;AAC1B,IAAA,WAAW,EAAE,2BAA2B;AACxC,IAAA,QAAQ,EAAE,wBAAwB;AAClC,IAAA,UAAU,EAAE,0BAA0B;AACtC,IAAA,WAAW,EAAE,0BAA0B;AACvC,IAAA,OAAO,EAAE,uBAAuB;AAChC,IAAA,KAAK,EAAE,oBAAoB;AAC3B,IAAA,KAAK,EAAE,qBAAqB;AAC5B,IAAA,EAAE,EAAE,kBAAkB;CACvB;AAED;;;AAGG;AACG,SAAU,gBAAgB,CAAC,UAAgC,EAAA;AAC/D,IAAA,IAAI,SAAS,EAAE;AAAE,QAAA,aAAa,EAAE;IAChC,CAAC,UAAU,IAAK,MAAM,CAAC,IAAI,CAAC,WAAW,CAAyB,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;AACtG;;;;"}