diff --git a/labs/card/demo/demo.ts b/labs/card/demo/demo.ts new file mode 100644 index 00000000000..e5ecd5588d9 --- /dev/null +++ b/labs/card/demo/demo.ts @@ -0,0 +1,26 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +import './material-collection.js'; +import './index.js'; + +import { + KnobTypesToKnobs, + MaterialCollection, + materialInitsToStoryInits, + setUpDemo, +} from './material-collection.js'; + +import {stories, StoryKnobs} from './stories.js'; + +const collection = new MaterialCollection>( + 'Cards', + [], +); + +collection.addStories(...materialInitsToStoryInits(stories)); + +setUpDemo(collection); diff --git a/labs/card/demo/project.json b/labs/card/demo/project.json new file mode 100644 index 00000000000..92f3e79587d --- /dev/null +++ b/labs/card/demo/project.json @@ -0,0 +1,9 @@ +{ + "extends": "/assets/stories/base.json", + "files": { + "demo.ts": { + "hidden": true + }, + "stories.ts": {} + } +} diff --git a/labs/card/demo/stories.ts b/labs/card/demo/stories.ts new file mode 100644 index 00000000000..ad276a1767a --- /dev/null +++ b/labs/card/demo/stories.ts @@ -0,0 +1,44 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +import '@material/web/labs/card/elevated-card.js'; +import '@material/web/labs/card/filled-card.js'; +import '@material/web/labs/card/outlined-card.js'; + +import {MaterialStoryInit} from './material-collection.js'; +import {css, html} from 'lit'; + +/** Knob types for card stories. */ +export interface StoryKnobs {} + +const cards: MaterialStoryInit = { + name: 'Cards', + styles: css` + .container { + color: var(--md-sys-color-on-surface); + display: flex; + font: var(--md-sys-typescale-body-medium-weight, 400) + var(--md-sys-typescale-body-medium-size, 0.875rem) / + var(--md-sys-typescale-body-medium-line-height, 1.25rem) + var(--md-sys-typescale-body-medium-font, 'Roboto'); + gap: 8px; + } + `, + render() { + return html` +
+ An elevated card + + A filled card + + An outlined card +
+ `; + }, +}; + +/** Card stories. */ +export const stories = [cards];