use-scroll-animate 6.5.0 → 6.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.
@@ -292,6 +292,70 @@ interface UsaCubeGalleryElement extends UsaElement {
292
292
  }
293
293
  declare function defineCubeGallery(tag?: string): CustomElementConstructor | undefined;
294
294
 
295
+ /**
296
+ * `<usa-dock>` (6.6) — a macOS-style dock: items magnify with a smooth
297
+ * cosine falloff as the pointer moves along it, neighbours make room, and a
298
+ * click bounces the item (`bounce`). Children are the items (`<a>` /
299
+ * `<button>`, each with an accessible name); `data-label` shows a tooltip
300
+ * label above the hovered item. Attributes: `magnify` (max scale, 1.9),
301
+ * `range` (px of influence, 140), `orientation="horizontal | vertical"`.
302
+ * Keyboard focus magnifies the focused item. Reduced motion: no
303
+ * magnification or bounce (labels still show).
304
+ */
305
+ interface UsaDockElement extends UsaElement {
306
+ readonly items: HTMLElement[];
307
+ }
308
+ declare function defineDock(tag?: string): CustomElementConstructor | undefined;
309
+
310
+ /**
311
+ * `<usa-nav-morph>` (6.6) — navigation links with an indicator that morphs
312
+ * between them: it follows the hovered / focused link (stretching from the
313
+ * old one, leading edge first) and settles back on the current page
314
+ * (`aria-current="page"`, `active` index, or a click). `indicator="underline |
315
+ * pill | blob | dot"`. Arrow keys move focus across links. Event
316
+ * `usa:change` (`{ index }`). Reduced motion: the indicator jumps.
317
+ */
318
+ interface UsaNavMorphElement extends UsaElement {
319
+ active: number;
320
+ }
321
+ declare const NAV_INDICATORS: readonly ["underline", "pill", "blob", "dot"];
322
+ declare function defineNavMorph(tag?: string): CustomElementConstructor | undefined;
323
+
324
+ /**
325
+ * `<usa-menu-toggle>` (6.6) — the hamburger button that morphs into its
326
+ * "open" icon: `variant="cross"` (✕, default), `arrow` (←), `minus` (—) or
327
+ * `plus-x` (+ turning into ✕). It is a real `<button>`-like control
328
+ * (`role="button"`, Space / Enter, `aria-expanded`); `for="<id>"` sets
329
+ * `aria-controls` and toggles the `hidden` attribute (or `.open()` /
330
+ * `.close()` / `.show()`) of that element. `pressed` reflects the state.
331
+ * Event `usa:toggle` (`{ open }`). Reduced motion: the icon switches without
332
+ * the morph.
333
+ */
334
+ interface UsaMenuToggleElement extends UsaElement {
335
+ open: boolean;
336
+ toggle(force?: boolean): void;
337
+ }
338
+ declare const TOGGLE_VARIANTS: readonly ["cross", "arrow", "minus", "plus-x"];
339
+ declare function defineMenuToggle(tag?: string): CustomElementConstructor | undefined;
340
+
341
+ /**
342
+ * `<usa-tip>` (6.6) — tooltip / popover 2.0. Wrap the trigger; the tip
343
+ * content is the `text` attribute or a child with `[slot="tip"]` / `[data-tip]`
344
+ * (rich content). It springs out of the trigger with its arrow,
345
+ * auto-flips to stay inside the viewport and shifts along the edge.
346
+ * `placement="top | bottom | left | right"`, `trigger="hover | click"`
347
+ * (`click` = popover: toggles, Esc / outside click close), `delay` (ms).
348
+ * Hover tips also open on keyboard focus and close on Esc (WCAG 1.4.13).
349
+ * Events `usa:open`, `usa:close`. Reduced motion: a short fade.
350
+ */
351
+ interface UsaTipElement extends UsaElement {
352
+ readonly opened: boolean;
353
+ show(): void;
354
+ hide(): void;
355
+ }
356
+ declare const TIP_PLACEMENTS: readonly ["top", "bottom", "left", "right"];
357
+ declare function defineTip(tag?: string): CustomElementConstructor | undefined;
358
+
295
359
  /**
296
360
  * motionary/components/widgets — the 6.x animated UI widgets, in their own
297
361
  * entry so `motionary/components` and `components/lite` keep their size
@@ -329,8 +393,12 @@ declare global {
329
393
  'usa-masonry-flow': UsaMasonryFlowElement;
330
394
  'usa-compare': UsaCompareElement;
331
395
  'usa-cube-gallery': UsaCubeGalleryElement;
396
+ 'usa-dock': UsaDockElement;
397
+ 'usa-nav-morph': UsaNavMorphElement;
398
+ 'usa-menu-toggle': UsaMenuToggleElement;
399
+ 'usa-tip': UsaTipElement;
332
400
  }
333
401
  }
334
402
 
335
- export { CAROUSEL_EFFECTS, MENU_EFFECTS, MODAL_EFFECTS, PROGRESS_VARIANTS, SHEET_SIDES, SKELETON_VARIANTS, TAB_INDICATORS, TOAST_POSITIONS, WIDGETS, WIDGET_TAGS, defineCarousel, defineCompare, defineCubeGallery, defineDisclosure, defineMasonryFlow, defineMenu, defineMilestones, defineModal, defineOdometer, defineProgressRing, defineSheet, defineSkeletonReveal, defineStarRating, defineStories, defineTabBar, defineToastStack, defineWidgets, stackToast };
336
- export type { StackToastOptions, UsaCarouselElement, UsaCompareElement, UsaCubeGalleryElement, UsaDisclosureElement, UsaMasonryFlowElement, UsaMenuElement, UsaMilestonesElement, UsaModalElement, UsaOdometerElement, UsaProgressRingElement, UsaSheetElement, UsaSkeletonRevealElement, UsaStarRatingElement, UsaStoriesElement, UsaTabBarElement, UsaToastStackElement };
403
+ export { CAROUSEL_EFFECTS, MENU_EFFECTS, MODAL_EFFECTS, NAV_INDICATORS, PROGRESS_VARIANTS, SHEET_SIDES, SKELETON_VARIANTS, TAB_INDICATORS, TIP_PLACEMENTS, TOAST_POSITIONS, TOGGLE_VARIANTS, WIDGETS, WIDGET_TAGS, defineCarousel, defineCompare, defineCubeGallery, defineDisclosure, defineDock, defineMasonryFlow, defineMenu, defineMenuToggle, defineMilestones, defineModal, defineNavMorph, defineOdometer, defineProgressRing, defineSheet, defineSkeletonReveal, defineStarRating, defineStories, defineTabBar, defineTip, defineToastStack, defineWidgets, stackToast };
404
+ export type { StackToastOptions, UsaCarouselElement, UsaCompareElement, UsaCubeGalleryElement, UsaDisclosureElement, UsaDockElement, UsaMasonryFlowElement, UsaMenuElement, UsaMenuToggleElement, UsaMilestonesElement, UsaModalElement, UsaNavMorphElement, UsaOdometerElement, UsaProgressRingElement, UsaSheetElement, UsaSkeletonRevealElement, UsaStarRatingElement, UsaStoriesElement, UsaTabBarElement, UsaTipElement, UsaToastStackElement };
@@ -292,6 +292,70 @@ interface UsaCubeGalleryElement extends UsaElement {
292
292
  }
293
293
  declare function defineCubeGallery(tag?: string): CustomElementConstructor | undefined;
294
294
 
295
+ /**
296
+ * `<usa-dock>` (6.6) — a macOS-style dock: items magnify with a smooth
297
+ * cosine falloff as the pointer moves along it, neighbours make room, and a
298
+ * click bounces the item (`bounce`). Children are the items (`<a>` /
299
+ * `<button>`, each with an accessible name); `data-label` shows a tooltip
300
+ * label above the hovered item. Attributes: `magnify` (max scale, 1.9),
301
+ * `range` (px of influence, 140), `orientation="horizontal | vertical"`.
302
+ * Keyboard focus magnifies the focused item. Reduced motion: no
303
+ * magnification or bounce (labels still show).
304
+ */
305
+ interface UsaDockElement extends UsaElement {
306
+ readonly items: HTMLElement[];
307
+ }
308
+ declare function defineDock(tag?: string): CustomElementConstructor | undefined;
309
+
310
+ /**
311
+ * `<usa-nav-morph>` (6.6) — navigation links with an indicator that morphs
312
+ * between them: it follows the hovered / focused link (stretching from the
313
+ * old one, leading edge first) and settles back on the current page
314
+ * (`aria-current="page"`, `active` index, or a click). `indicator="underline |
315
+ * pill | blob | dot"`. Arrow keys move focus across links. Event
316
+ * `usa:change` (`{ index }`). Reduced motion: the indicator jumps.
317
+ */
318
+ interface UsaNavMorphElement extends UsaElement {
319
+ active: number;
320
+ }
321
+ declare const NAV_INDICATORS: readonly ["underline", "pill", "blob", "dot"];
322
+ declare function defineNavMorph(tag?: string): CustomElementConstructor | undefined;
323
+
324
+ /**
325
+ * `<usa-menu-toggle>` (6.6) — the hamburger button that morphs into its
326
+ * "open" icon: `variant="cross"` (✕, default), `arrow` (←), `minus` (—) or
327
+ * `plus-x` (+ turning into ✕). It is a real `<button>`-like control
328
+ * (`role="button"`, Space / Enter, `aria-expanded`); `for="<id>"` sets
329
+ * `aria-controls` and toggles the `hidden` attribute (or `.open()` /
330
+ * `.close()` / `.show()`) of that element. `pressed` reflects the state.
331
+ * Event `usa:toggle` (`{ open }`). Reduced motion: the icon switches without
332
+ * the morph.
333
+ */
334
+ interface UsaMenuToggleElement extends UsaElement {
335
+ open: boolean;
336
+ toggle(force?: boolean): void;
337
+ }
338
+ declare const TOGGLE_VARIANTS: readonly ["cross", "arrow", "minus", "plus-x"];
339
+ declare function defineMenuToggle(tag?: string): CustomElementConstructor | undefined;
340
+
341
+ /**
342
+ * `<usa-tip>` (6.6) — tooltip / popover 2.0. Wrap the trigger; the tip
343
+ * content is the `text` attribute or a child with `[slot="tip"]` / `[data-tip]`
344
+ * (rich content). It springs out of the trigger with its arrow,
345
+ * auto-flips to stay inside the viewport and shifts along the edge.
346
+ * `placement="top | bottom | left | right"`, `trigger="hover | click"`
347
+ * (`click` = popover: toggles, Esc / outside click close), `delay` (ms).
348
+ * Hover tips also open on keyboard focus and close on Esc (WCAG 1.4.13).
349
+ * Events `usa:open`, `usa:close`. Reduced motion: a short fade.
350
+ */
351
+ interface UsaTipElement extends UsaElement {
352
+ readonly opened: boolean;
353
+ show(): void;
354
+ hide(): void;
355
+ }
356
+ declare const TIP_PLACEMENTS: readonly ["top", "bottom", "left", "right"];
357
+ declare function defineTip(tag?: string): CustomElementConstructor | undefined;
358
+
295
359
  /**
296
360
  * motionary/components/widgets — the 6.x animated UI widgets, in their own
297
361
  * entry so `motionary/components` and `components/lite` keep their size
@@ -329,8 +393,12 @@ declare global {
329
393
  'usa-masonry-flow': UsaMasonryFlowElement;
330
394
  'usa-compare': UsaCompareElement;
331
395
  'usa-cube-gallery': UsaCubeGalleryElement;
396
+ 'usa-dock': UsaDockElement;
397
+ 'usa-nav-morph': UsaNavMorphElement;
398
+ 'usa-menu-toggle': UsaMenuToggleElement;
399
+ 'usa-tip': UsaTipElement;
332
400
  }
333
401
  }
334
402
 
335
- export { CAROUSEL_EFFECTS, MENU_EFFECTS, MODAL_EFFECTS, PROGRESS_VARIANTS, SHEET_SIDES, SKELETON_VARIANTS, TAB_INDICATORS, TOAST_POSITIONS, WIDGETS, WIDGET_TAGS, defineCarousel, defineCompare, defineCubeGallery, defineDisclosure, defineMasonryFlow, defineMenu, defineMilestones, defineModal, defineOdometer, defineProgressRing, defineSheet, defineSkeletonReveal, defineStarRating, defineStories, defineTabBar, defineToastStack, defineWidgets, stackToast };
336
- export type { StackToastOptions, UsaCarouselElement, UsaCompareElement, UsaCubeGalleryElement, UsaDisclosureElement, UsaMasonryFlowElement, UsaMenuElement, UsaMilestonesElement, UsaModalElement, UsaOdometerElement, UsaProgressRingElement, UsaSheetElement, UsaSkeletonRevealElement, UsaStarRatingElement, UsaStoriesElement, UsaTabBarElement, UsaToastStackElement };
403
+ export { CAROUSEL_EFFECTS, MENU_EFFECTS, MODAL_EFFECTS, NAV_INDICATORS, PROGRESS_VARIANTS, SHEET_SIDES, SKELETON_VARIANTS, TAB_INDICATORS, TIP_PLACEMENTS, TOAST_POSITIONS, TOGGLE_VARIANTS, WIDGETS, WIDGET_TAGS, defineCarousel, defineCompare, defineCubeGallery, defineDisclosure, defineDock, defineMasonryFlow, defineMenu, defineMenuToggle, defineMilestones, defineModal, defineNavMorph, defineOdometer, defineProgressRing, defineSheet, defineSkeletonReveal, defineStarRating, defineStories, defineTabBar, defineTip, defineToastStack, defineWidgets, stackToast };
404
+ export type { StackToastOptions, UsaCarouselElement, UsaCompareElement, UsaCubeGalleryElement, UsaDisclosureElement, UsaDockElement, UsaMasonryFlowElement, UsaMenuElement, UsaMenuToggleElement, UsaMilestonesElement, UsaModalElement, UsaNavMorphElement, UsaOdometerElement, UsaProgressRingElement, UsaSheetElement, UsaSkeletonRevealElement, UsaStarRatingElement, UsaStoriesElement, UsaTabBarElement, UsaTipElement, UsaToastStackElement };