', () => {
14 | describe('.styles', () => {
15 | createTokenTests(MdFilledField.styles);
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | *.js
3 | !web-test-runner.config.js
4 | !css-to-ts.js
5 | *.css
6 | *.css.ts
7 | *.map
8 | *.d.ts
9 | !types/*.d.ts
10 | .wireit/
11 |
12 | !catalog/**/*.css
13 | catalog/_dev
14 | catalog/_prod
15 | catalog/node_modules
16 | catalog/.wireit
17 | catalog/lib/
18 | catalog/build/
19 | catalog/site/components/*.md
20 | catalog/site/components/images
21 | catalog/*.tsbuildinfo
22 | catalog/stories/*/
23 | !catalog/stories/components/
--------------------------------------------------------------------------------
/catalog/site/index.html:
--------------------------------------------------------------------------------
1 | {% extends 'default.html' %}
2 |
3 | {% block head %}
4 |
5 |
6 | {% endblock %}
7 |
8 | {% block content %}
9 |
10 | Material Web
11 | The official web component set for Material 3
12 |
13 |
16 |
17 | {% endblock %}
--------------------------------------------------------------------------------
/field/outlined-field_test.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright 2023 Google LLC
4 | * SPDX-License-Identifier: Apache-2.0
5 | */
6 |
7 | // import 'jasmine'; (google3-only)
8 |
9 | import {createTokenTests} from '../testing/tokens.js';
10 |
11 | import {MdOutlinedField} from './outlined-field.js';
12 |
13 | describe('', () => {
14 | describe('.styles', () => {
15 | createTokenTests(MdOutlinedField.styles);
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/chips/suggestion-chip_test.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright 2023 Google LLC
4 | * SPDX-License-Identifier: Apache-2.0
5 | */
6 |
7 | // import 'jasmine'; (google3-only)
8 |
9 | import {createTokenTests} from '../testing/tokens.js';
10 |
11 | import {MdSuggestionChip} from './suggestion-chip.js';
12 |
13 | describe('', () => {
14 | describe('.styles', () => {
15 | createTokenTests(MdSuggestionChip.styles);
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/textfield/filled-text-field_test.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright 2023 Google LLC
4 | * SPDX-License-Identifier: Apache-2.0
5 | */
6 |
7 | // import 'jasmine'; (google3-only)
8 |
9 | import {createTokenTests} from '../testing/tokens.js';
10 |
11 | import {MdFilledTextField} from './filled-text-field.js';
12 |
13 | describe('', () => {
14 | describe('.styles', () => {
15 | createTokenTests(MdFilledTextField.styles);
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/textfield/lib/filled-text-field.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright 2021 Google LLC
4 | * SPDX-License-Identifier: Apache-2.0
5 | */
6 |
7 | import '../../field/filled-field.js';
8 |
9 | import {literal} from 'lit/static-html.js';
10 |
11 | import {TextField} from './text-field.js';
12 |
13 | /**
14 | * A filled text field component.
15 | */
16 | export class FilledTextField extends TextField {
17 | protected readonly fieldTag = literal`md-filled-field`;
18 | }
19 |
--------------------------------------------------------------------------------
/tokens/_md-comp-scrim.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright 2023 Google LLC
3 | // SPDX-License-Identifier: Apache-2.0
4 | //
5 |
6 | // go/keep-sorted start
7 | @use './md-sys-color';
8 | @use './v0_172/md-comp-scrim';
9 | // go/keep-sorted end
10 |
11 | $_default: (
12 | 'md-sys-color': md-sys-color.values-light(),
13 | );
14 |
15 | @function values($deps: $_default, $exclude-hardcoded-values: false) {
16 | @return md-comp-scrim.values($deps, $exclude-hardcoded-values);
17 | }
18 |
--------------------------------------------------------------------------------
/catalog/src/signals/inert.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright 2023 Google LLC
4 | * SPDX-License-Identifier: Apache-2.0
5 | */
6 |
7 | import {signal} from './signal-element.js';
8 |
9 | /**
10 | * Whether or not the site content should be inert (sidebar is still
11 | * interactive).
12 | */
13 | export const inertContentSignal = signal(false);
14 |
15 | /**
16 | * Whether or not the sidebar should be inert.
17 | */
18 | export const inertSidebarSignal = signal(false);
--------------------------------------------------------------------------------
/select/lib/filled-select.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright 2023 Google LLC
4 | * SPDX-License-Identifier: Apache-2.0
5 | */
6 |
7 | import '../../field/filled-field.js';
8 |
9 | import {literal} from 'lit/static-html.js';
10 |
11 | import {Select} from './select.js';
12 |
13 | // tslint:disable-next-line:enforce-comments-on-exported-symbols
14 | export abstract class FilledSelect extends Select {
15 | protected readonly fieldTag = literal`md-filled-field`;
16 | }
17 |
--------------------------------------------------------------------------------
/textfield/outlined-text-field_test.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright 2023 Google LLC
4 | * SPDX-License-Identifier: Apache-2.0
5 | */
6 |
7 | // import 'jasmine'; (google3-only)
8 |
9 | import {createTokenTests} from '../testing/tokens.js';
10 |
11 | import {MdOutlinedTextField} from './outlined-text-field.js';
12 |
13 | describe('', () => {
14 | describe('.styles', () => {
15 | createTokenTests(MdOutlinedTextField.styles);
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/select/lib/outlined-select.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright 2023 Google LLC
4 | * SPDX-License-Identifier: Apache-2.0
5 | */
6 |
7 | import '../../field/outlined-field.js';
8 |
9 | import {literal} from 'lit/static-html.js';
10 |
11 | import {Select} from './select.js';
12 |
13 | // tslint:disable-next-line:enforce-comments-on-exported-symbols
14 | export abstract class OutlinedSelect extends Select {
15 | protected readonly fieldTag = literal`md-outlined-field`;
16 | }
17 |
--------------------------------------------------------------------------------
/textfield/lib/outlined-text-field.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright 2021 Google LLC
4 | * SPDX-License-Identifier: Apache-2.0
5 | */
6 |
7 | import '../../field/outlined-field.js';
8 |
9 | import {literal} from 'lit/static-html.js';
10 |
11 | import {TextField} from './text-field.js';
12 |
13 | /**
14 | * An outlined text field component
15 | */
16 | export class OutlinedTextField extends TextField {
17 | protected readonly fieldTag = literal`md-outlined-field`;
18 | }
19 |
--------------------------------------------------------------------------------
/.github/workflows/build-catalog.yml:
--------------------------------------------------------------------------------
1 | name: Build Catalog
2 |
3 | on: [push]
4 |
5 | jobs:
6 | build-catalog:
7 | runs-on: ubuntu-latest
8 | steps:
9 | - uses: actions/checkout@v3
10 | - uses: actions/setup-node@v3
11 | with:
12 | node-version: 18
13 | cache: npm
14 | - uses: google/wireit@setup-github-actions-caching/v1
15 |
16 | - run: npm ci
17 | - run: npm run build:catalog
18 | env:
19 | WIREIT_FAILURES: continue
--------------------------------------------------------------------------------
/.github/workflows/commitlint.yml:
--------------------------------------------------------------------------------
1 | name: commitlint
2 |
3 | on: [pull_request]
4 |
5 | jobs:
6 | commitlint:
7 | runs-on: ubuntu-latest
8 |
9 | steps:
10 | - uses: actions/setup-node@v3
11 | with:
12 | node-version: 18
13 |
14 | - run: npm install -g commitlint @commitlint/config-conventional
15 | - run: 'echo "${PR_TITLE}" | commitlint -x @commitlint/config-conventional'
16 | env:
17 | PR_TITLE: ${{ github.event.pull_request.title }}
18 |
--------------------------------------------------------------------------------
/catalog/src/inline/apply-saved-theme.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright 2023 Google LLC
4 | * SPDX-License-Identifier: Apache-2.0
5 | */
6 |
7 | import {applyThemeString} from '../utils/apply-theme-string.js';
8 |
9 | // Checks if there has been a theme already generated from a prior visit
10 | const lastThemeString = localStorage.getItem('material-theme');
11 |
12 | // Applies the theme string to the document if available.
13 | if (lastThemeString) {
14 | applyThemeString(document, lastThemeString);
15 | }
16 |
--------------------------------------------------------------------------------
/checkbox/harness.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright 2022 Google LLC
4 | * SPDX-License-Identifier: Apache-2.0
5 | */
6 |
7 | import {Harness} from '../testing/harness.js';
8 |
9 | import {Checkbox} from './lib/checkbox.js';
10 |
11 | /**
12 | * Test harness for checkbox.
13 | */
14 | export class CheckboxHarness extends Harness {
15 | override async getInteractiveElement() {
16 | await this.element.updateComplete;
17 | return this.element.renderRoot.querySelector('input')!;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/radio/harness.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright 2022 Google LLC
4 | * SPDX-License-Identifier: Apache-2.0
5 | */
6 |
7 | import {Harness} from '../testing/harness.js';
8 |
9 | import {Radio} from './lib/radio.js';
10 |
11 | /**
12 | * Test harness for radio.
13 | */
14 | export class RadioHarness extends Harness {
15 | override async getInteractiveElement() {
16 | await this.element.updateComplete;
17 | return this.element.renderRoot.querySelector('input') as HTMLInputElement;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/button/harness.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright 2021 Google LLC
4 | * SPDX-License-Identifier: Apache-2.0
5 | */
6 |
7 | import {Harness} from '../testing/harness.js';
8 |
9 | import {Button} from './lib/button.js';
10 |
11 | /**
12 | * Test harness for buttons.
13 | */
14 | export class ButtonHarness extends Harness