@angular/material 16.0.2 → 16.1.0-next.1

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 (63) hide show
  1. package/autocomplete/index.d.ts +28 -0
  2. package/autocomplete/testing/index.d.ts +3 -1
  3. package/chips/_chips-theme.scss +44 -60
  4. package/core/mdc-helpers/_mdc-helpers.scss +6 -6
  5. package/core/tokens/m2/mdc/_chip.scss +313 -0
  6. package/core/tokens/m2/mdc/_plain-tooltip.scss +80 -0
  7. package/esm2022/autocomplete/autocomplete-trigger.mjs +58 -3
  8. package/esm2022/autocomplete/testing/autocomplete-harness.mjs +5 -1
  9. package/esm2022/chips/chip-option.mjs +2 -2
  10. package/esm2022/chips/chip-row.mjs +2 -2
  11. package/esm2022/chips/chip.mjs +2 -2
  12. package/esm2022/core/option/option.mjs +3 -3
  13. package/esm2022/core/version.mjs +1 -1
  14. package/esm2022/form-field/directives/floating-label.mjs +66 -5
  15. package/esm2022/form-field/directives/notched-outline.mjs +14 -16
  16. package/esm2022/form-field/form-field.mjs +30 -36
  17. package/esm2022/legacy-tooltip/testing/tooltip-harness.mjs +2 -1
  18. package/esm2022/legacy-tooltip/tooltip.mjs +3 -2
  19. package/esm2022/select/select.mjs +60 -4
  20. package/esm2022/snack-bar/snack-bar-container.mjs +4 -2
  21. package/esm2022/tabs/tab-group.mjs +3 -2
  22. package/esm2022/tabs/tab-header.mjs +2 -2
  23. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +12 -3
  24. package/esm2022/tooltip/testing/tooltip-harness.mjs +7 -1
  25. package/esm2022/tooltip/tooltip.mjs +5 -4
  26. package/fesm2022/autocomplete/testing.mjs +4 -0
  27. package/fesm2022/autocomplete/testing.mjs.map +1 -1
  28. package/fesm2022/autocomplete.mjs +57 -3
  29. package/fesm2022/autocomplete.mjs.map +1 -1
  30. package/fesm2022/chips.mjs +6 -6
  31. package/fesm2022/chips.mjs.map +1 -1
  32. package/fesm2022/core.mjs +3 -3
  33. package/fesm2022/core.mjs.map +1 -1
  34. package/fesm2022/form-field.mjs +102 -50
  35. package/fesm2022/form-field.mjs.map +1 -1
  36. package/fesm2022/legacy-tooltip/testing.mjs +1 -0
  37. package/fesm2022/legacy-tooltip/testing.mjs.map +1 -1
  38. package/fesm2022/legacy-tooltip.mjs +2 -1
  39. package/fesm2022/legacy-tooltip.mjs.map +1 -1
  40. package/fesm2022/select.mjs +59 -3
  41. package/fesm2022/select.mjs.map +1 -1
  42. package/fesm2022/snack-bar.mjs +3 -1
  43. package/fesm2022/snack-bar.mjs.map +1 -1
  44. package/fesm2022/tabs.mjs +15 -5
  45. package/fesm2022/tabs.mjs.map +1 -1
  46. package/fesm2022/tooltip/testing.mjs +6 -0
  47. package/fesm2022/tooltip/testing.mjs.map +1 -1
  48. package/fesm2022/tooltip.mjs +4 -3
  49. package/fesm2022/tooltip.mjs.map +1 -1
  50. package/form-field/index.d.ts +44 -12
  51. package/legacy-tooltip/testing/index.d.ts +1 -0
  52. package/package.json +7 -7
  53. package/prebuilt-themes/deeppurple-amber.css +1 -1
  54. package/prebuilt-themes/indigo-pink.css +1 -1
  55. package/prebuilt-themes/pink-bluegrey.css +1 -1
  56. package/prebuilt-themes/purple-green.css +1 -1
  57. package/schematics/ng-add/index.js +2 -2
  58. package/schematics/ng-add/index.mjs +2 -2
  59. package/select/index.d.ts +28 -0
  60. package/tabs/_tabs-common.scss +4 -0
  61. package/tabs/index.d.ts +4 -1
  62. package/tooltip/_tooltip-theme.scss +18 -22
  63. package/tooltip/testing/index.d.ts +4 -0
package/select/index.d.ts CHANGED
@@ -287,6 +287,34 @@ export declare abstract class _MatSelectBase<C> extends _MatSelectMixinBase impl
287
287
  toggle(): void;
288
288
  /** Opens the overlay panel. */
289
289
  open(): void;
290
+ /**
291
+ * Track which modal we have modified the `aria-owns` attribute of. When the combobox trigger is
292
+ * inside an aria-modal, we apply aria-owns to the parent modal with the `id` of the options
293
+ * panel. Track the modal we have changed so we can undo the changes on destroy.
294
+ */
295
+ private _trackedModal;
296
+ /**
297
+ * If the autocomplete trigger is inside of an `aria-modal` element, connect
298
+ * that modal to the options panel with `aria-owns`.
299
+ *
300
+ * For some browser + screen reader combinations, when navigation is inside
301
+ * of an `aria-modal` element, the screen reader treats everything outside
302
+ * of that modal as hidden or invisible.
303
+ *
304
+ * This causes a problem when the combobox trigger is _inside_ of a modal, because the
305
+ * options panel is rendered _outside_ of that modal, preventing screen reader navigation
306
+ * from reaching the panel.
307
+ *
308
+ * We can work around this issue by applying `aria-owns` to the modal with the `id` of
309
+ * the options panel. This effectively communicates to assistive technology that the
310
+ * options panel is part of the same interaction as the modal.
311
+ *
312
+ * At time of this writing, this issue is present in VoiceOver.
313
+ * See https://github.com/angular/components/issues/20694
314
+ */
315
+ private _applyModalPanelOwnership;
316
+ /** Clears the reference to the listbox overlay element from the modal it was added to. */
317
+ private _clearFromModal;
290
318
  /** Closes the overlay panel and focuses the host element. */
291
319
  close(): void;
292
320
  /**
@@ -217,6 +217,10 @@ $mat-tab-animation-duration: 500ms !default;
217
217
  tokens-mat-tab-header.$prefix, tokens-mat-tab-header.get-unthemable-tokens());
218
218
  }
219
219
 
220
+ .mdc-tab-indicator .mdc-tab-indicator__content {
221
+ transition-duration: var(--mat-tab-animation-duration, 250ms);
222
+ }
223
+
220
224
  .mat-mdc-tab-header-pagination {
221
225
  @include vendor-prefixes.user-select(none);
222
226
  position: relative;
package/tabs/index.d.ts CHANGED
@@ -896,6 +896,9 @@ export declare class MatTabNav extends _MatTabNavBase implements AfterContentIni
896
896
  get stretchTabs(): boolean;
897
897
  set stretchTabs(v: BooleanInput);
898
898
  private _stretchTabs;
899
+ get animationDuration(): string;
900
+ set animationDuration(value: NumberInput);
901
+ private _animationDuration;
899
902
  _items: QueryList<MatTabLink>;
900
903
  _tabListContainer: ElementRef;
901
904
  _tabList: ElementRef;
@@ -907,7 +910,7 @@ export declare class MatTabNav extends _MatTabNavBase implements AfterContentIni
907
910
  ngAfterContentInit(): void;
908
911
  ngAfterViewInit(): void;
909
912
  static ɵfac: i0.ɵɵFactoryDeclaration<MatTabNav, [null, { optional: true; }, null, null, null, null, { optional: true; }, { optional: true; }]>;
910
- static ɵcmp: i0.ɵɵComponentDeclaration<MatTabNav, "[mat-tab-nav-bar]", ["matTabNavBar", "matTabNav"], { "color": { "alias": "color"; "required": false; }; "fitInkBarToContent": { "alias": "fitInkBarToContent"; "required": false; }; "stretchTabs": { "alias": "mat-stretch-tabs"; "required": false; }; }, {}, ["_items"], ["*"], false, never>;
913
+ static ɵcmp: i0.ɵɵComponentDeclaration<MatTabNav, "[mat-tab-nav-bar]", ["matTabNavBar", "matTabNav"], { "color": { "alias": "color"; "required": false; }; "fitInkBarToContent": { "alias": "fitInkBarToContent"; "required": false; }; "stretchTabs": { "alias": "mat-stretch-tabs"; "required": false; }; "animationDuration": { "alias": "animationDuration"; "required": false; }; }, {}, ["_items"], ["*"], false, never>;
911
914
  }
912
915
 
913
916
  /**
@@ -1,41 +1,37 @@
1
- @use 'sass:map';
2
- @use '@material/tooltip/plain-tooltip-theme';
3
- @use '@material/theme/theme-color' as mdc-theme-color;
4
- @use '@material/typography/typography' as mdc-typography;
1
+ @use '@material/tooltip/plain-tooltip-theme' as mdc-plain-tooltip-theme;
5
2
  @use '../core/theming/theming';
6
- @use '../core/theming/palette';
7
- @use '../core/mdc-helpers/mdc-helpers';
8
3
  @use '../core/typography/typography';
4
+ @use '../core/tokens/m2/mdc/plain-tooltip' as m2-mdc-plain-tooltip;
9
5
 
10
6
  @mixin color($config-or-theme) {
11
7
  $config: theming.get-color-config($config-or-theme);
12
- @include mdc-helpers.using-mdc-theme($config) {
13
- .mat-mdc-tooltip {
14
- @include plain-tooltip-theme.theme((
15
- container-color: map.get(palette.$light-theme-background-palette, tooltip),
16
- supporting-text-color: mdc-theme-color.prop-value(text-primary-on-dark)
17
- ));
18
- }
8
+ $mdc-tooltip-color-tokens: m2-mdc-plain-tooltip.get-color-tokens($config);
9
+
10
+ // Add values for MDC tooltip tokens.
11
+ .mat-mdc-tooltip {
12
+ @include mdc-plain-tooltip-theme.theme($mdc-tooltip-color-tokens);
19
13
  }
20
14
  }
21
15
 
22
16
  @mixin typography($config-or-theme) {
23
17
  $config: typography.private-typography-to-2018-config(
24
18
  theming.get-typography-config($config-or-theme));
25
- @include mdc-helpers.using-mdc-typography($config) {
26
- .mat-mdc-tooltip {
27
- @include plain-tooltip-theme.theme((
28
- supporting-text-font: mdc-typography.get-font(caption),
29
- supporting-text-size: mdc-typography.get-size(caption),
30
- supporting-text-weight: mdc-typography.get-weight(caption),
31
- supporting-text-tracking: mdc-typography.get-tracking(caption),
32
- ));
33
- }
19
+ $mdc-tooltip-typography-tokens: m2-mdc-plain-tooltip.get-typography-tokens($config);
20
+
21
+ // Add values for MDC tooltip tokens.
22
+ .mat-mdc-tooltip {
23
+ @include mdc-plain-tooltip-theme.theme($mdc-tooltip-typography-tokens);
34
24
  }
35
25
  }
36
26
 
37
27
  @mixin density($config-or-theme) {
38
28
  $density-scale: theming.get-density-config($config-or-theme);
29
+ $mdc-tooltip-density-tokens: m2-mdc-plain-tooltip.get-density-tokens($density-scale);
30
+
31
+ // Add values for MDC tooltip tokens.
32
+ .mat-mdc-tooltip {
33
+ @include mdc-plain-tooltip-theme.theme($mdc-tooltip-density-tokens);
34
+ }
39
35
  }
40
36
 
41
37
  @mixin theme($theme-or-color-config) {
@@ -10,6 +10,7 @@ export declare class MatTooltipHarness extends _MatTooltipHarnessBase {
10
10
  protected _optionalPanel: AsyncFactoryFn<TestElement | null>;
11
11
  static hostSelector: string;
12
12
  protected _hiddenClass: string;
13
+ protected _disabledClass: string;
13
14
  protected _showAnimationName: string;
14
15
  protected _hideAnimationName: string;
15
16
  /**
@@ -24,6 +25,7 @@ export declare class MatTooltipHarness extends _MatTooltipHarnessBase {
24
25
  export declare abstract class _MatTooltipHarnessBase extends ComponentHarness {
25
26
  protected abstract _optionalPanel: AsyncFactoryFn<TestElement | null>;
26
27
  protected abstract _hiddenClass: string;
28
+ protected abstract _disabledClass: string;
27
29
  protected abstract _showAnimationName: string;
28
30
  protected abstract _hideAnimationName: string;
29
31
  /** Shows the tooltip. */
@@ -32,6 +34,8 @@ export declare abstract class _MatTooltipHarnessBase extends ComponentHarness {
32
34
  hide(): Promise<void>;
33
35
  /** Gets whether the tooltip is open. */
34
36
  isOpen(): Promise<boolean>;
37
+ /** Gets whether the tooltip is disabled */
38
+ isDisabled(): Promise<boolean>;
35
39
  /** Gets a promise for the tooltip panel's text. */
36
40
  getTooltipText(): Promise<string>;
37
41
  }