Skip to content

Commit

Permalink
docs(material/progress-spinner): Update description and examples for …
Browse files Browse the repository at this point in the history
…color input description on API page (#29332)

(cherry picked from commit 0f8e887)
  • Loading branch information
amysorto committed Jun 26, 2024
1 parent b633efa commit 83417ad
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,6 @@
<mat-card-content>
<h2 class="example-h2">Progress spinner configuration</h2>

<section class="example-section">
<label class="example-margin">Color:</label>
<mat-radio-group [(ngModel)]="color">
<mat-radio-button class="example-margin" value="primary">
Primary
</mat-radio-button>
<mat-radio-button class="example-margin" value="accent">
Accent
</mat-radio-button>
<mat-radio-button class="example-margin" value="warn">
Warn
</mat-radio-button>
</mat-radio-group>
</section>

<section class="example-section">
<label class="example-margin">Mode:</label>
<mat-radio-group [(ngModel)]="mode">
Expand Down Expand Up @@ -46,7 +31,6 @@ <h2 class="example-h2">Result</h2>

<mat-progress-spinner
class="example-margin"
[color]="color"
[mode]="mode"
[value]="value">
</mat-progress-spinner>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Component} from '@angular/core';
import {ThemePalette} from '@angular/material/core';
import {ProgressSpinnerMode, MatProgressSpinnerModule} from '@angular/material/progress-spinner';
import {MatSliderModule} from '@angular/material/slider';
import {FormsModule} from '@angular/forms';
Expand All @@ -17,7 +16,6 @@ import {MatCardModule} from '@angular/material/card';
imports: [MatCardModule, MatRadioModule, FormsModule, MatSliderModule, MatProgressSpinnerModule],
})
export class ProgressSpinnerConfigurableExample {
color: ThemePalette = 'primary';
mode: ProgressSpinnerMode = 'determinate';
value = 50;
}
5 changes: 0 additions & 5 deletions src/material/progress-spinner/progress-spinner.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ which can be a whole number between 0 and 100.

In "indeterminate" mode, the `value` property is ignored.


### Theming
The color of a progress-spinner can be changed by using the `color` property. By default,
progress-spinners use the theme's primary color. This can be changed to `'accent'` or `'warn'`.

### Accessibility

`MatLegacyProgressSpinner` implements the ARIA `role="progressbar"` pattern. By default, the spinner
Expand Down
16 changes: 14 additions & 2 deletions src/material/progress-spinner/progress-spinner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ export type ProgressSpinnerMode = 'determinate' | 'indeterminate';

/** Default `mat-progress-spinner` options that can be overridden. */
export interface MatProgressSpinnerDefaultOptions {
/** Default color of the spinner. */
/**
* Default theme color of the progress spinner. This API is supported in M2 themes only, it
* has no effect in M3 themes.
*
* For information on applying color variants in M3, see
* https://material.angular.io/guide/theming#using-component-color-variants.
*/
color?: ThemePalette;
/** Diameter of the spinner. */
diameter?: number;
Expand Down Expand Up @@ -95,7 +101,13 @@ export class MatProgressSpinner {
_noopAnimations: boolean;

// TODO: should be typed as `ThemePalette` but internal apps pass in arbitrary strings.
/** Theme palette color of the progress spinner. */
/**
* Theme color of the progress spinner. This API is supported in M2 themes only, it
* has no effect in M3 themes.
*
* For information on applying color variants in M3, see
* https://material.angular.io/guide/theming#using-component-color-variants.
*/
@Input()
get color() {
return this._color || this._defaultColor;
Expand Down

0 comments on commit 83417ad

Please sign in to comment.