@expressivecss/expressive 0.7.0 → 0.9.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 (122) hide show
  1. package/CHANGELOG.md +1313 -1
  2. package/README.md +76 -30
  3. package/dist/css/expressive.css +4896 -1777
  4. package/dist/css/expressive.css.map +1 -1
  5. package/dist/css/expressive.min.css +1 -1
  6. package/dist/css/expressive.min.css.map +1 -1
  7. package/dist/fonts/LICENSE-material-symbols +93 -0
  8. package/dist/fonts/LICENSE-noto-sans +93 -0
  9. package/dist/fonts/LICENSE-roboto +93 -0
  10. package/dist/fonts/material-symbols-outlined.woff2 +0 -0
  11. package/dist/fonts/material-symbols-rounded.woff2 +0 -0
  12. package/dist/fonts/material-symbols-sharp.woff2 +0 -0
  13. package/dist/fonts/noto-sans-latin-400.woff2 +0 -0
  14. package/dist/fonts/noto-sans-latin-500.woff2 +0 -0
  15. package/dist/fonts/roboto-latin-400.woff2 +0 -0
  16. package/dist/fonts/roboto-latin-500.woff2 +0 -0
  17. package/dist/js/expressive.cjs +1673 -1338
  18. package/dist/js/expressive.cjs.map +4 -4
  19. package/dist/js/expressive.js +1673 -1338
  20. package/dist/js/expressive.js.map +4 -4
  21. package/dist/js/expressive.min.js +13 -13
  22. package/dist/js/expressive.min.js.map +4 -4
  23. package/dist/js/expressive.mjs +1673 -1338
  24. package/dist/js/expressive.mjs.map +4 -4
  25. package/dist/types/behaviors/bottomSheets.d.ts +19 -11
  26. package/dist/types/behaviors/sheetDrag.d.ts +40 -0
  27. package/dist/types/behaviors/sideSheets.d.ts +2 -9
  28. package/dist/types/components/appBar.d.ts +26 -0
  29. package/dist/types/components/autocomplete.d.ts +15 -3
  30. package/dist/types/components/buttonGroup.d.ts +39 -0
  31. package/dist/types/components/buttons.d.ts +5 -1
  32. package/dist/types/components/cards.d.ts +11 -13
  33. package/dist/types/components/carousel.d.ts +87 -53
  34. package/dist/types/components/chips.d.ts +21 -1
  35. package/dist/types/components/expandingCard.d.ts +31 -0
  36. package/dist/types/components/index.d.ts +23 -20
  37. package/dist/types/components/lightbox.d.ts +1 -0
  38. package/dist/types/components/menu.d.ts +11 -1
  39. package/dist/types/components/{sidenav.d.ts → navigationDrawer.d.ts} +16 -16
  40. package/dist/types/components/registry.d.ts +18 -8
  41. package/dist/types/components/slider.d.ts +26 -85
  42. package/dist/types/components/snackbar.d.ts +20 -5
  43. package/dist/types/components/tabs.d.ts +12 -0
  44. package/dist/types/components/timepicker.d.ts +12 -10
  45. package/dist/types/components/tooltip.d.ts +1 -0
  46. package/dist/types/core/utils.d.ts +64 -53
  47. package/dist/types/index.d.ts +8 -9
  48. package/package.json +39 -3
  49. package/src/sass/README.md +61 -11
  50. package/src/sass/abstracts/_breakpoints.scss +17 -19
  51. package/src/sass/abstracts/_mixins.scss +155 -21
  52. package/src/sass/abstracts/_variables.scss +69 -5
  53. package/src/sass/base/_fonts.scss +63 -0
  54. package/src/sass/base/_global.scss +6 -24
  55. package/src/sass/base/_grid.scss +15 -12
  56. package/src/sass/base/_normalize.scss +34 -38
  57. package/src/sass/base/_typography.scss +4 -18
  58. package/src/sass/components/_badges.scss +3 -5
  59. package/src/sass/components/_banners.scss +298 -0
  60. package/src/sass/components/_bottom-app-bar.scss +180 -0
  61. package/src/sass/components/_bottom-sheet.scss +12 -4
  62. package/src/sass/components/_button-groups.scss +358 -0
  63. package/src/sass/components/_buttons.scss +245 -92
  64. package/src/sass/components/_cards.scss +514 -78
  65. package/src/sass/components/_carousel.scss +562 -68
  66. package/src/sass/components/_chips.scss +64 -5
  67. package/src/sass/components/_datepicker.scss +24 -24
  68. package/src/sass/components/_dialog.scss +17 -11
  69. package/src/sass/components/_drag-handle.scss +130 -0
  70. package/src/sass/components/_expanding-card.scss +226 -0
  71. package/src/sass/components/_fab-menu.scss +232 -0
  72. package/src/sass/components/_floating-sheet.scss +86 -0
  73. package/src/sass/components/_icon-buttons.scss +172 -0
  74. package/src/sass/components/_icons-material-design.scss +22 -10
  75. package/src/sass/components/_index.scss +22 -6
  76. package/src/sass/components/_list.scss +16 -13
  77. package/src/sass/components/_loading-indicator.scss +106 -0
  78. package/src/sass/components/_menu.scss +335 -61
  79. package/src/sass/components/_navbar.scss +245 -45
  80. package/src/sass/components/_navigation-bar.scss +22 -11
  81. package/src/sass/components/{_sidenav.scss → _navigation-drawer.scss} +123 -33
  82. package/src/sass/components/_navigation-rail.scss +31 -23
  83. package/src/sass/components/_page-footer.scss +19 -16
  84. package/src/sass/components/_pagination.scss +24 -6
  85. package/src/sass/components/_panes.scss +52 -11
  86. package/src/sass/components/{_preloader.scss → _progress.scss} +11 -3
  87. package/src/sass/components/_scrim.scss +37 -0
  88. package/src/sass/components/_search.scss +259 -0
  89. package/src/sass/components/_segmented-buttons.scss +188 -0
  90. package/src/sass/components/_side-sheet.scss +2 -2
  91. package/src/sass/components/_snackbar.scss +20 -15
  92. package/src/sass/components/_split-button.scss +196 -0
  93. package/src/sass/components/_tabs.scss +7 -8
  94. package/src/sass/components/_timepicker.scss +67 -58
  95. package/src/sass/components/_toolbar.scss +206 -80
  96. package/src/sass/components/_transitions.scss +8 -1
  97. package/src/sass/components/forms/_checkboxes.scss +49 -12
  98. package/src/sass/components/forms/_fieldset.scss +4 -4
  99. package/src/sass/components/forms/_file-input.scss +8 -1
  100. package/src/sass/components/forms/_index.scss +1 -1
  101. package/src/sass/components/forms/_input-fields.scss +50 -44
  102. package/src/sass/components/forms/_radio-buttons.scss +42 -10
  103. package/src/sass/components/forms/_select.scss +38 -1
  104. package/src/sass/components/forms/{_range.scss → _slider.scss} +8 -9
  105. package/src/sass/components/forms/_switches.scss +6 -7
  106. package/src/sass/expressive.scss +5 -0
  107. package/src/sass/tokens/_index.scss +4 -1
  108. package/src/sass/tokens/_reference.scss +70 -61
  109. package/src/sass/tokens/_state.scss +24 -0
  110. package/src/sass/tokens/_theme.scss +6 -3
  111. package/src/sass/tokens/_vibrant.scss +76 -0
  112. package/src/sass/utilities/_colors.scss +14 -1
  113. package/src/sass/utilities/_helpers.scss +5 -5
  114. package/src/sass/utilities/_visibility.scss +48 -26
  115. package/dist/types/behaviors/waves.d.ts +0 -15
  116. package/dist/types/components/parallax.d.ts +0 -16
  117. package/dist/types/components/range.d.ts +0 -43
  118. package/dist/types/core/bounding.d.ts +0 -6
  119. package/dist/types/core/edges.d.ts +0 -6
  120. package/src/sass/components/_parallax.scss +0 -104
  121. package/src/sass/components/_pulse.scss +0 -37
  122. package/src/sass/components/_slider.scss +0 -129
@@ -1,18 +1,26 @@
1
1
  /**
2
2
  * Drag-to-dismiss for `dialog.bottom-sheet` / `dialog.bottom`.
3
3
  *
4
- * The handle is the top 48dp of the sheet (or an explicit `.handle`).
5
- * A downward drag past 96dp, or a flick, closes. Anything else snaps back.
6
- * Content below the handle scrolls normally. Light-dismiss on the scrim
7
- * stays with {@link Dialogs}.
4
+ * The handle is the top 48dp of the sheet (or an explicit `.drag-handle`,
5
+ * `.handle` being its pre-1.0 spelling). A downward drag past 96dp, or a
6
+ * flick, closes. Anything else snaps back. Content below the handle scrolls
7
+ * normally. Light-dismiss on the scrim stays with {@link Dialogs}.
8
+ *
9
+ * The drag itself is {@link installSheetDrag}, shared with the side sheet. What
10
+ * is here is what is not shared: a handle written as a `<button>` also closes
11
+ * the sheet when it is *activated*, which is what makes it reachable without a
12
+ * pointer - dragging is a pointer gesture, so a control labelled "Dismiss" that
13
+ * only answers a drag promises an action a keyboard user cannot perform. A
14
+ * handle written as any other element is decoration and does nothing here -
15
+ * Escape still closes the sheet either way, natively.
8
16
  */
9
17
  export declare class BottomSheets {
10
- private static _drag;
18
+ /**
19
+ * Whether the last pointer sequence moved. A drag ends with a `click` on the
20
+ * element it started on, so without this the tail of a drag that snapped back
21
+ * would dismiss the sheet the drag had just declined to dismiss.
22
+ */
23
+ private static _dragged;
11
24
  static Init(): void;
12
- static _onDown(event: PointerEvent): void;
13
- static _onMove(event: PointerEvent): void;
14
- static _onUp(event: PointerEvent): void;
15
- static _onCancel(): void;
16
- private static _sheet;
17
- private static _inHandle;
25
+ static _onClick(event: MouseEvent): void;
18
26
  }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Drag-to-dismiss, shared by the bottom sheet and the side sheet.
3
+ *
4
+ * The two were the same state machine written twice on different axes - same
5
+ * dismissal distance, same flick velocity, same transition suppression, same
6
+ * pointer bookkeeping - so a fix to one could land without reaching the other.
7
+ * What actually differs between them is stated as configuration below.
8
+ *
9
+ * Light-dismiss on the scrim is not here; it stays with `Dialogs`.
10
+ */
11
+ export interface SheetDragConfig {
12
+ /** Which dialogs this drag applies to. */
13
+ selector: string;
14
+ /** The axis the sheet travels on. */
15
+ axis: 'x' | 'y';
16
+ /** The custom property carrying the live drag offset. */
17
+ property: string;
18
+ /**
19
+ * `1` when the sheet dismisses toward increasing coordinates (downward, or
20
+ * rightward for an end-docked side sheet), `-1` when it dismisses toward
21
+ * decreasing ones. A function rather than a constant because a side sheet's
22
+ * direction depends on which edge each individual sheet is docked to.
23
+ */
24
+ direction: (dialog: HTMLDialogElement) => 1 | -1;
25
+ /** Whether a press at this point landed on the sheet's drag handle. */
26
+ inHandle: (event: PointerEvent, dialog: HTMLDialogElement) => boolean;
27
+ /**
28
+ * Called first on every `pointerdown`, before any guard rejects it. The
29
+ * bottom sheet clears its dragged flag here so a sequence abandoned without
30
+ * a `pointerup` cannot leave the flag set and swallow the next tap.
31
+ */
32
+ onPress?: () => void;
33
+ /** Called when a drag ends, with whether the pointer actually moved. */
34
+ onRelease?: (dragged: boolean) => void;
35
+ }
36
+ /**
37
+ * Register one sheet kind's drag handlers on the document. Called once per kind
38
+ * at import time; there is nothing to tear down.
39
+ */
40
+ export declare function installSheetDrag(config: SheetDragConfig): void;
@@ -3,16 +3,9 @@
3
3
  *
4
4
  * Grab the header or the inner 24dp edge and drag toward the docked side.
5
5
  * Past 96dp, or a flick, closes. Light-dismiss on the scrim stays with
6
- * {@link Dialogs}.
6
+ * {@link Dialogs}. The drag itself is {@link installSheetDrag}, shared with
7
+ * the bottom sheet.
7
8
  */
8
9
  export declare class SideSheets {
9
- private static _drag;
10
10
  static Init(): void;
11
- static _onDown(event: PointerEvent): void;
12
- static _onMove(event: PointerEvent): void;
13
- static _onUp(event: PointerEvent): void;
14
- static _onCancel(): void;
15
- private static _sheet;
16
- private static _startDocked;
17
- private static _inHandle;
18
11
  }
@@ -0,0 +1,26 @@
1
+ import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
2
+ /**
3
+ * Collapse medium/large flexible app bars on scroll, and open the related
4
+ * search view when the search field in a search app bar is selected.
5
+ *
6
+ * Observation is IntersectionObserver on a 1px sentinel ahead of the header.
7
+ * A scroll listener would re-enter layout on every tick; this does not.
8
+ */
9
+ export declare class AppBar extends Component<BaseOptions> {
10
+ private _observer;
11
+ private _sentinel;
12
+ private _input;
13
+ private _view;
14
+ private _suppressSearchOpen;
15
+ constructor(el: HTMLElement, options: Partial<BaseOptions>);
16
+ static get defaults(): BaseOptions;
17
+ static init(el: HTMLElement, options?: Partial<BaseOptions>): AppBar;
18
+ static init(els: InitElements<InitElement>, options?: Partial<BaseOptions>): AppBar[];
19
+ static getInstance(el: HTMLElement): AppBar;
20
+ destroy(): void;
21
+ private _setupCollapse;
22
+ private _onIntersect;
23
+ private _setupSearch;
24
+ private _onSearchViewClose;
25
+ private _onSearchFocus;
26
+ }
@@ -78,7 +78,19 @@ export declare class Autocomplete extends Component<AutocompleteOptions> {
78
78
  activeIndex: number;
79
79
  private oldVal;
80
80
  private $active;
81
- private _mousedown;
81
+ private _openTimer;
82
+ /**
83
+ * The active entry, for both the eye and the screen reader. The class alone
84
+ * was invisible to assistive technology; aria-activedescendant on the input
85
+ * is what reports the move.
86
+ *
87
+ * Deliberately does not touch aria-selected. Active and selected are two
88
+ * different things - in a multi-select the checkboxes track real choices,
89
+ * and folding the highlight into aria-selected would announce a committed
90
+ * choice as unselected the moment the user arrowed past it.
91
+ */
92
+ private _setActive;
93
+ private _pointerDown;
82
94
  container: HTMLElement;
83
95
  /** Instance of the menu plugin for this autocomplete. */
84
96
  menu: Menu;
@@ -120,8 +132,8 @@ export declare class Autocomplete extends Component<AutocompleteOptions> {
120
132
  _inputChangeDetection: (value: string) => void;
121
133
  _handleInputKeydown: (e: KeyboardEvent) => void;
122
134
  _handleInputClick: () => void;
123
- _handleContainerMousedownAndTouchstart: () => void;
124
- _handleContainerMouseupAndTouchend: () => void;
135
+ _handleContainerPointerDown: (e: PointerEvent) => void;
136
+ _handleContainerPointerUp: () => void;
125
137
  _resetCurrentElementPosition(): void;
126
138
  _resetAutocomplete(): void;
127
139
  _highlightPartialText(input: string, label: string): string[];
@@ -0,0 +1,39 @@
1
+ import { Component, BaseOptions, InitElements, InitElement } from "../core/component";
2
+ export interface ButtonGroupOptions extends BaseOptions {
3
+ }
4
+ /**
5
+ * Coordinates Material button-group press geometry and optional toggle state.
6
+ *
7
+ * Standard groups redistribute the pressed item's 15% width growth from its
8
+ * immediate neighbors. `data-selection="single|multiple"` also enables
9
+ * `aria-pressed` state management.
10
+ */
11
+ export declare class ButtonGroup extends Component<ButtonGroupOptions> {
12
+ private _pressedStyles;
13
+ private _releaseStyles;
14
+ private _releaseTimer;
15
+ private _originalPressed;
16
+ private _activeItem;
17
+ constructor(el: HTMLElement, options?: Partial<ButtonGroupOptions>);
18
+ static get defaults(): ButtonGroupOptions;
19
+ static init(el: HTMLElement, options?: Partial<ButtonGroupOptions>): ButtonGroup;
20
+ static init(els: InitElements<InitElement>, options?: Partial<ButtonGroupOptions>): ButtonGroup[];
21
+ static getInstance(el: HTMLElement): ButtonGroup;
22
+ destroy(): void;
23
+ private get _selectionMode();
24
+ private get _items();
25
+ private get _toggleItems();
26
+ private _normalizeSelection;
27
+ private _itemFromEvent;
28
+ private _isDisabled;
29
+ private _handleClick;
30
+ private _rememberPressed;
31
+ private _handlePointerDown;
32
+ private _handleKeyDown;
33
+ private _handleKeyUp;
34
+ private _handleFocusOut;
35
+ private _startPress;
36
+ private _compressionCapacity;
37
+ private _resetPress;
38
+ private _finishRelease;
39
+ }
@@ -22,11 +22,15 @@ export interface FloatingActionButtonOptions extends BaseOptions {
22
22
  * Speed dial around a FAB. Open/close is the `.active` class; motion is
23
23
  * CSS. Hover is CSS (`:hover` when the pointer can hover). This class
24
24
  * toggles the class, wires keyboard / click-outside, and stamps direction.
25
+ *
26
+ * `.fab-menu` runs on the same instance: expanded state is one class and one
27
+ * `aria-expanded`, whichever host it is written on, and the two differ only
28
+ * in their Sass. The direction and hover options are inert there - the FAB
29
+ * menu opens upward and on click, both decided in CSS.
25
30
  */
26
31
  export declare class FloatingActionButton extends Component<FloatingActionButtonOptions> implements Openable {
27
32
  isOpen: boolean;
28
33
  private _anchor;
29
- private _menu;
30
34
  constructor(el: HTMLElement, options: Partial<FloatingActionButtonOptions>);
31
35
  static get defaults(): FloatingActionButtonOptions;
32
36
  static init(el: HTMLElement, options?: Partial<FloatingActionButtonOptions>): FloatingActionButton;
@@ -4,20 +4,21 @@ export interface CardsOptions extends BaseOptions {
4
4
  onClose: (el: Element) => void;
5
5
  }
6
6
  /**
7
- * What counts as a card.
7
+ * What counts as a card reveal.
8
8
  *
9
- * Shared with `components/registry.ts` rather than written out twice: the
10
- * registry used to claim `.cards`, which matches nothing this component
11
- * actually initializes, so the AutoInit entry was dead while `Cards.Init()`
12
- * quietly did the work through the selector below.
9
+ * Shared with `components/registry.ts` so `Cards.Init()` and `AutoInit()` use
10
+ * the same semantic selector.
13
11
  */
14
- export declare const CARDS_SELECTOR = "article:has(> aside)";
12
+ export declare const CARDS_SELECTOR = "article:has(> aside[id]:not([id=\"\"])):not(:has(> aside ~ aside)):has(> button.card-reveal-trigger[type=\"button\"], > :not(aside) button.card-reveal-trigger[type=\"button\"])";
13
+ export declare function isCardReveal(el: Element): el is HTMLElement;
15
14
  export declare class Cards extends Component<CardsOptions> implements Openable {
16
15
  isOpen: boolean;
17
16
  private readonly cardReveal;
18
17
  private _activators;
19
- private cardRevealClose;
20
- constructor(el: HTMLElement, options: Partial<CardsOptions>);
18
+ private _ownsRevealInitializedClass;
19
+ private _initialAriaControls;
20
+ private _lastActivator;
21
+ constructor(el: HTMLElement, options?: Partial<CardsOptions>);
21
22
  static get defaults(): CardsOptions;
22
23
  /**
23
24
  * Initializes instance of Cards.
@@ -38,12 +39,9 @@ export declare class Cards extends Component<CardsOptions> implements Openable {
38
39
  destroy(): void;
39
40
  _setupEventHandlers: () => void;
40
41
  _removeEventHandlers: () => void;
41
- _handleClickInteraction: () => void;
42
- _handleKeypressEvent: (e: KeyboardEvent) => void;
42
+ _handleClickInteraction: (event: MouseEvent) => void;
43
+ _handleKeydownEvent: (event: KeyboardEvent) => void;
43
44
  _handleRevealEvent: () => void;
44
- _setupRevealCloseEventHandlers: () => void;
45
- _removeRevealCloseEventHandlers: () => void;
46
- _handleKeypressCloseEvent: (e: KeyboardEvent) => void;
47
45
  /**
48
46
  * Show card reveal.
49
47
  */
@@ -1,32 +1,22 @@
1
1
  import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
2
+ export interface CarouselI18nOptions {
3
+ carousel: string;
4
+ item: string;
5
+ of: string;
6
+ indicators: string;
7
+ slide: string;
8
+ }
2
9
  export interface CarouselOptions extends BaseOptions {
3
10
  /**
4
- * Transition duration in milliseconds (coverflow). Snap mode uses CSS.
11
+ * Milliseconds allowed for a programmatic scroll to land. The track itself
12
+ * scrolls at the browser's own smooth-scroll speed; this only bounds how
13
+ * long the component waits for `scrollend` before assuming it arrived, and
14
+ * is added to `interval` to time each auto-advance rest.
5
15
  * @default 200
6
16
  */
7
17
  duration: number;
8
18
  /**
9
- * Perspective zoom. If 0, all items are the same size. Coverflow only.
10
- * @default -100
11
- */
12
- dist: number;
13
- /**
14
- * Extra spacing on the center item. Coverflow only.
15
- * @default 0
16
- */
17
- shift: number;
18
- /**
19
- * Padding between items that are not in the center. Coverflow only.
20
- * @default 0
21
- */
22
- padding: number;
23
- /**
24
- * How many items stay visible. Coverflow only.
25
- * @default 5
26
- */
27
- numVisible: number;
28
- /**
29
- * Linear snap track instead of 3D coverflow.
19
+ * Full-width compatibility track. Material 3 layouts are already linear.
30
20
  * Also implied by `.flat`.
31
21
  * @default false
32
22
  */
@@ -37,48 +27,82 @@ export interface CarouselOptions extends BaseOptions {
37
27
  */
38
28
  indicators: boolean;
39
29
  /**
40
- * Stop at the first and last items instead of wrapping. Coverflow only.
41
- * Snap tracks do not wrap.
30
+ * Stop auto-advance at the last item instead of looping back to the first.
31
+ * A scroll track never wraps under arrow keys or `set()` either way.
42
32
  * @default false
43
33
  */
44
34
  noWrap: boolean;
35
+ /**
36
+ * Milliseconds to rest between automatic advances, on top of `duration` -
37
+ * the gap follows each transition rather than containing it, so a full cycle
38
+ * takes `duration + interval`. 0 leaves auto-advance off.
39
+ * Whenever it is set the track pauses on hover and on keyboard focus, and
40
+ * `prefers-reduced-motion: reduce` suppresses it entirely - auto-advancing
41
+ * content is WCAG 2.2.2 territory, so neither is an option an author can
42
+ * turn off. `noWrap` stops it after one pass instead of looping.
43
+ * @default 0
44
+ */
45
+ interval: number;
46
+ /**
47
+ * Fixed track height in pixels. `null` sizes the carousel from its content.
48
+ * A fixed height gives the indicators their own row below the track instead
49
+ * of laying them over the media.
50
+ * @default null
51
+ */
52
+ height: number | null;
45
53
  /**
46
54
  * Called when a new item becomes the center.
47
55
  * @default null
48
56
  */
49
57
  onCycleTo: (current: Element, dragged: boolean) => void;
58
+ /**
59
+ * Accessible names generated for an unlabeled carousel, its items and its
60
+ * indicators.
61
+ */
62
+ i18n: Partial<CarouselI18nOptions>;
50
63
  }
51
64
  export declare class Carousel extends Component<CarouselOptions> {
52
65
  hasMultipleSlides: boolean;
53
66
  showIndicators: boolean;
54
- noWrap: boolean;
55
67
  pressed: boolean;
56
68
  dragged: boolean;
57
- offset: number;
58
- target: number;
59
69
  images: HTMLElement[];
60
- itemWidth: number;
61
- itemHeight: number;
62
- dim: number;
63
70
  _indicators: HTMLUListElement | HTMLElement;
64
71
  count: number;
65
- verticalDragged: boolean;
66
- reference: number;
67
- referenceY: number;
68
- velocity: number;
69
- frame: number;
70
- timestamp: number;
71
- amplitude: number;
72
72
  center: number;
73
- imageHeight: number;
74
73
  scrollingTimeout: ReturnType<typeof setTimeout>;
75
74
  oneTimeCallback: (current: Element, dragged: boolean) => void | null;
76
- private _flat;
77
75
  private _ownIndicators;
78
76
  private _trackEl;
79
77
  private _ignoreScroll;
80
78
  private _trackRaf;
81
79
  private _started;
80
+ private _vertical;
81
+ private _resizeObserver;
82
+ private _usesWindowResize;
83
+ private _dragPointerId;
84
+ private _dragStartX;
85
+ private _dragStartY;
86
+ private _dragStartScroll;
87
+ private _suppressClick;
88
+ private _suppressClickTimeout;
89
+ private _generatedContainerRole;
90
+ private _generatedContainerLabel;
91
+ private _generatedContainerDescription;
92
+ private _generatedWideLayout;
93
+ private _generatedFixedHeight;
94
+ private _authoredInlineHeight;
95
+ private _autoAdvanceTimer;
96
+ private _autoAdvances;
97
+ private _autoPaused;
98
+ private _hovered;
99
+ private _focused;
100
+ private _generatedItemTabIndexes;
101
+ private _generatedItemLabels;
102
+ private _generatedItemDescriptions;
103
+ private _generatedItemSizes;
104
+ private _authoredItemSizes;
105
+ private _itemA11yOriginal;
82
106
  private get _scroller();
83
107
  private static _live;
84
108
  private static _resizeListening;
@@ -90,34 +114,44 @@ export declare class Carousel extends Component<CarouselOptions> {
90
114
  static getInstance(el: HTMLElement): Carousel;
91
115
  destroy(): void;
92
116
  private _collectItems;
117
+ private _setupAccessibility;
93
118
  private _setupIndicators;
94
119
  _setupEventHandlers(): void;
95
120
  _removeEventHandlers(): void;
96
121
  private _teardown;
97
- _handleThrottledResize: (...args: unknown[]) => any;
98
- _handleCarouselTap: (e: PointerEvent) => void;
99
- _handleCarouselDrag: (e: PointerEvent) => void;
100
- _handleCarouselRelease: (e: PointerEvent) => void;
101
- _handleCarouselClick: (e: MouseEvent) => void;
122
+ _handleThrottledResize: (...args: unknown[]) => void;
123
+ _handleAutoAdvanceState: (e: Event) => void;
124
+ /** Start or stop the timer to match the current pause state. */
125
+ private _syncAutoAdvance;
126
+ private _tick;
127
+ private _advance;
128
+ _handleTrackPointerDown: (e: PointerEvent) => void;
129
+ _handleTrackPointerMove: (e: PointerEvent) => void;
130
+ _handleTrackPointerUp: (e: PointerEvent) => void;
131
+ _handleTrackClick: (e: MouseEvent) => void;
132
+ _handleTrackDragStart: (e: DragEvent) => void;
102
133
  _handleIndicatorClick: (e: Event) => void;
103
134
  _handleKeydown: (e: KeyboardEvent) => void;
104
- _handleFlatScroll: () => void;
135
+ _handleTrackScroll: () => void;
105
136
  _handleResize: () => void;
106
- _xpos(e: PointerEvent | MouseEvent | TouchEvent): number;
107
- _ypos(e: PointerEvent | MouseEvent | TouchEvent): number;
108
- _wrap(x: number): any;
109
- _track: () => void;
110
- _autoScroll: () => void;
111
- _scroll(x?: number): void;
112
- _updateItemStyle(el: HTMLElement, opacity: number, zIndex: number, transform: string): void;
113
137
  private _paintIndicators;
114
- private _syncA11y;
115
138
  private _syncActive;
139
+ private _syncLayoutRoles;
140
+ private _syncAdaptiveMode;
141
+ private _focusItem;
142
+ private _updateParallax;
116
143
  private _wrapTrack;
117
144
  private _unwrapTrack;
118
145
  private _nearestIndex;
119
146
  private _scrollToIndex;
120
147
  _cycleTo(n: number, callback?: CarouselOptions['onCycleTo']): void;
148
+ /**
149
+ * Stop auto-advance until start() is called. Without an `interval` there is
150
+ * nothing to stop and this does nothing.
151
+ */
152
+ pause(): void;
153
+ /** Resume auto-advance after pause(). */
154
+ start(): void;
121
155
  next(n?: number): void;
122
156
  prev(n?: number): void;
123
157
  set(n: number, callback?: CarouselOptions['onCycleTo']): void;
@@ -14,6 +14,10 @@ export interface ChipData {
14
14
  */
15
15
  image?: string;
16
16
  }
17
+ export interface ChipsI18nOptions {
18
+ /** Prefix for the delete button's accessible name. */
19
+ remove: string;
20
+ }
17
21
  export interface ChipsOptions extends BaseOptions {
18
22
  /**
19
23
  * Set the chip data.
@@ -55,6 +59,12 @@ export interface ChipsOptions extends BaseOptions {
55
59
  * @default false;
56
60
  */
57
61
  allowUserInput: boolean;
62
+ /**
63
+ * Strings the component generates. `remove` prefixes the delete button's
64
+ * accessible name, giving "Remove Apple".
65
+ * @default { remove: 'Remove' }
66
+ */
67
+ i18n: Partial<ChipsI18nOptions>;
58
68
  /**
59
69
  * Callback for chip add.
60
70
  * @default null
@@ -83,6 +93,16 @@ export declare class Chips extends Component<ChipsOptions> {
83
93
  _chips: HTMLElement[];
84
94
  static _keydown: boolean;
85
95
  private _selectedChip;
96
+ /**
97
+ * Selection is drawn by a class now, not by `:focus`, so it does not clear
98
+ * itself when focus moves - every path that changes the selection has to go
99
+ * through here or the class and the field drift apart.
100
+ *
101
+ * Deliberately no `aria-selected`: the chip is not an option in a listbox,
102
+ * and putting the attribute on an element with no such role is the same
103
+ * defect the semantics standard exists to remove.
104
+ */
105
+ private _setSelected;
86
106
  constructor(el: HTMLElement, options: Partial<ChipsOptions>);
87
107
  static get defaults(): ChipsOptions;
88
108
  /**
@@ -109,7 +129,7 @@ export declare class Chips extends Component<ChipsOptions> {
109
129
  _handleInputFocus: () => void;
110
130
  _handleInputBlur: () => void;
111
131
  _handleInputKeydown: (e: KeyboardEvent) => void;
112
- _renderChip(chip: ChipData): HTMLDivElement;
132
+ _renderChip(chip: ChipData): HTMLElement;
113
133
  _renderChips(): void;
114
134
  _setupAutocomplete(): void;
115
135
  _setupInput(): void;
@@ -0,0 +1,31 @@
1
+ import { Component, BaseOptions, InitElements, InitElement, Openable } from "../core/component";
2
+ export interface ExpandingCardOptions extends BaseOptions {
3
+ onOpen: (el: Element) => void;
4
+ onClose: (el: Element) => void;
5
+ }
6
+ export declare const EXPANDING_CARD_SELECTOR = "article.expanding-card:has(> dialog.expanding-card-dialog)";
7
+ /**
8
+ * Morphs a compact card into a full-screen modal detail surface.
9
+ */
10
+ export declare class ExpandingCard extends Component<ExpandingCardOptions> implements Openable {
11
+ isOpen: boolean;
12
+ private readonly trigger;
13
+ private readonly dialog;
14
+ private readonly closeButton;
15
+ private closeGeneration;
16
+ constructor(el: HTMLElement, options: Partial<ExpandingCardOptions>);
17
+ static get defaults(): ExpandingCardOptions;
18
+ static init(el: HTMLElement, options?: Partial<ExpandingCardOptions>): ExpandingCard;
19
+ static init(els: InitElements<InitElement>, options?: Partial<ExpandingCardOptions>): ExpandingCard[];
20
+ static getInstance(el: HTMLElement): ExpandingCard;
21
+ destroy(): void;
22
+ private _setupEventHandlers;
23
+ private _removeEventHandlers;
24
+ private _handleTriggerKeypress;
25
+ private _handleCancel;
26
+ private _handleNativeClose;
27
+ private _setTransitionOrigin;
28
+ open: () => void;
29
+ close: () => void;
30
+ static Init(): void;
31
+ }
@@ -1,20 +1,23 @@
1
- export { Autocomplete } from './autocomplete';
2
- export { FloatingActionButton } from './buttons';
3
- export { Cards } from './cards';
4
- export { Carousel } from './carousel';
5
- export { CharacterCounter } from './characterCounter';
6
- export { Chips } from './chips';
7
- export { Datepicker } from './datepicker';
8
- export { Menu } from './menu';
9
- export { Lightbox } from './lightbox';
10
- export { Parallax } from './parallax';
11
- export { Range } from './range';
12
- export { ScrollSpy } from './scrollspy';
13
- export { FormSelect } from './select';
14
- export { Sidenav } from './sidenav';
15
- export { NavigationRail } from './navigationRail';
16
- export { Slider } from './slider';
17
- export { Tabs } from './tabs';
18
- export { Timepicker } from './timepicker';
19
- export { Snackbar } from './snackbar';
20
- export { Tooltip } from './tooltip';
1
+ export { Autocomplete } from "./autocomplete";
2
+ export { AppBar } from "./appBar";
3
+ export { FloatingActionButton } from "./buttons";
4
+ export { ButtonGroup } from "./buttonGroup";
5
+ export { Cards } from "./cards";
6
+ export { ExpandingCard } from "./expandingCard";
7
+ export { Carousel } from "./carousel";
8
+ export { CharacterCounter } from "./characterCounter";
9
+ export { Chips } from "./chips";
10
+ export { Datepicker } from "./datepicker";
11
+ export { Menu } from "./menu";
12
+ export { Lightbox } from "./lightbox";
13
+ export { Slider } from "./slider";
14
+ export { ScrollSpy } from "./scrollspy";
15
+ export { FormSelect } from "./select";
16
+ export { NavigationDrawer } from "./navigationDrawer";
17
+ export { NavigationRail } from "./navigationRail";
18
+ export { Tabs } from "./tabs";
19
+ export { Timepicker } from "./timepicker";
20
+ export { Snackbar } from "./snackbar";
21
+ export { Tooltip } from "./tooltip";
22
+ export { Slider as Range } from "./slider";
23
+ export { NavigationDrawer as Sidenav } from "./navigationDrawer";
@@ -44,6 +44,7 @@ export declare class Lightbox extends Component<LightboxOptions> {
44
44
  originalHeight: number;
45
45
  private originInlineStyles;
46
46
  private placeholder;
47
+ /** Ancestors forced to `overflow: visible`, with the inline value to put back. */
47
48
  private _changedAncestorList;
48
49
  private newHeight;
49
50
  private newWidth;
@@ -12,6 +12,10 @@ export interface MenuOptions extends BaseOptions {
12
12
  autoFocus: boolean;
13
13
  /**
14
14
  * If true, constrainWidth to the size of the menu activator.
15
+ *
16
+ * A trigger narrower than the surface's own 112dp minimum cannot be
17
+ * honoured, so such a menu is sized to its content instead - see
18
+ * MIN_SURFACE_WIDTH.
15
19
  * @default true
16
20
  */
17
21
  constrainWidth: boolean;
@@ -19,7 +23,7 @@ export interface MenuOptions extends BaseOptions {
19
23
  * Provide an element that will be the bounding container of the menu.
20
24
  * @default null
21
25
  */
22
- container: Element;
26
+ container: Element | ShadowRoot;
23
27
  /**
24
28
  * If false, the menu will show below the trigger.
25
29
  * That is the M3 placement. Pass `true` to cover the trigger.
@@ -87,6 +91,8 @@ export declare class Menu extends Component<MenuOptions> implements Openable {
87
91
  focusedIndex: number;
88
92
  filterQuery: string[];
89
93
  filterTimeout: ReturnType<typeof setTimeout>;
94
+ private _pendingTimers;
95
+ private _transition;
90
96
  constructor(el: HTMLElement, options: Partial<MenuOptions>);
91
97
  static get defaults(): MenuOptions;
92
98
  /**
@@ -114,6 +120,7 @@ export declare class Menu extends Component<MenuOptions> implements Openable {
114
120
  _handleTriggerKeydown: (e: KeyboardEvent) => void;
115
121
  _handleDocumentTouchmove: (e: TouchEvent) => void;
116
122
  _handleMenuClick: (e: MouseEvent) => void;
123
+ private _setupAccessibility;
117
124
  private _isSubmenuTriggerClick;
118
125
  private _setupSubmenus;
119
126
  private _toggleSubmenu;
@@ -130,6 +137,7 @@ export declare class Menu extends Component<MenuOptions> implements Openable {
130
137
  _resetMenuPositioningStyles(): void;
131
138
  _moveMenuToElement(containerEl?: HTMLElement): void;
132
139
  _makeMenuFocusable(): void;
140
+ private _focusInitialItem;
133
141
  _focusFocusedItem(): void;
134
142
  _getMenuPosition(closestOverflowParent: HTMLElement): {
135
143
  x: number;
@@ -139,6 +147,8 @@ export declare class Menu extends Component<MenuOptions> implements Openable {
139
147
  height: number;
140
148
  width: number;
141
149
  };
150
+ private _schedule;
151
+ private _clearPendingTimers;
142
152
  _animateIn(): void;
143
153
  _animateOut(): void;
144
154
  private _getClosestAncestor;