diff --git a/packages/materialdesign-components/components.json b/packages/materialdesign-components/components.json index d017e54b11..9289f77652 100644 --- a/packages/materialdesign-components/components.json +++ b/packages/materialdesign-components/components.json @@ -111,6 +111,52 @@ }, "tags": [] }, + "Card": { + "name": "Card", + "description": "A Material Card container. Accepts CardHeader, CardBody and CardFooter as possible children", + "props": { + "width": "string", + "height": "string", + "variant": { + "type": "options", + "options": ["standard", "outlined"], + "default": "standard" + } + } + }, + "CardBody": { + "name": "CardBody", + "description": "A Material CardBody component. Contains the main content of a Material Card component", + "props": { + "onClick": "event" + } + }, + "CardImage": { + "name": "CardImage", + "description": "An image component for the Material Card component", + "props": { + "displayHorizontal": "bool", + "url": "string", + "title": "string", + "subtitle": "string" + } + }, + "CardHeader": { + "name": "CardHeader", + "description": "Displays a icon, title and subtitle above main body of the Material Card component", + "props": { + "title": "string", + "subtitle": "string", + "icon": "string" + } + }, + "CardFooter": { + "name": "CardFooter", + "description": "Displays buttons / icon buttons as actions for the Material Card component", + "props": { + "padding": "string" + } + }, "Checkbox": { "name": "Checkbox", "description": "A Material Design checkbox. Supports aligning label before or after checkbox.", diff --git a/packages/materialdesign-components/package.json b/packages/materialdesign-components/package.json index f21c6c8d6b..42bea7428c 100644 --- a/packages/materialdesign-components/package.json +++ b/packages/materialdesign-components/package.json @@ -50,5 +50,7 @@ "version": "0.0.27", "license": "MIT", "gitHead": "72a77a035eb7c1443b079bf93c29b3e5fe02094e", - "dependencies": {} + "dependencies": { + "@material/card": "4.0.0" + } } diff --git a/packages/materialdesign-components/src/Button/Button.svelte b/packages/materialdesign-components/src/Button/Button.svelte index 7c8821547a..80b3ddd792 100644 --- a/packages/materialdesign-components/src/Button/Button.svelte +++ b/packages/materialdesign-components/src/Button/Button.svelte @@ -1,5 +1,5 @@ + +
diff --git a/packages/materialdesign-components/src/Card/CardBody.svelte b/packages/materialdesign-components/src/Card/CardBody.svelte new file mode 100644 index 0000000000..08cb549e06 --- /dev/null +++ b/packages/materialdesign-components/src/Card/CardBody.svelte @@ -0,0 +1,10 @@ + + +
diff --git a/packages/materialdesign-components/src/Card/CardFooter.svelte b/packages/materialdesign-components/src/Card/CardFooter.svelte new file mode 100644 index 0000000000..b3702ee47f --- /dev/null +++ b/packages/materialdesign-components/src/Card/CardFooter.svelte @@ -0,0 +1,31 @@ + + +
+ + diff --git a/packages/materialdesign-components/src/Card/CardHeader.svelte b/packages/materialdesign-components/src/Card/CardHeader.svelte new file mode 100644 index 0000000000..72f1bc4ace --- /dev/null +++ b/packages/materialdesign-components/src/Card/CardHeader.svelte @@ -0,0 +1,44 @@ + + +
+ {#if useIcon} +
+ +
+ {/if} +
+
+ {#if useSubtitle} + + {/if} +
+
+ + diff --git a/packages/materialdesign-components/src/Card/CardImage.svelte b/packages/materialdesign-components/src/Card/CardImage.svelte new file mode 100644 index 0000000000..e7207271a0 --- /dev/null +++ b/packages/materialdesign-components/src/Card/CardImage.svelte @@ -0,0 +1,62 @@ + + +{#if !displayHorizontal} +
+
+ {#if useTitle} +
+ {#if useSubTitle} + + {/if} + {/if} +
+
+{:else} +
+
+
+ {#if useTitle} +
+ {#if useSubTitle} + + {/if} + {/if} +
+
+{/if} + + diff --git a/packages/materialdesign-components/src/Card/_styles.scss b/packages/materialdesign-components/src/Card/_styles.scss new file mode 100644 index 0000000000..67be710d6f --- /dev/null +++ b/packages/materialdesign-components/src/Card/_styles.scss @@ -0,0 +1 @@ +@import "@material/card/mdc-card.scss" diff --git a/packages/materialdesign-components/src/Card/index.js b/packages/materialdesign-components/src/Card/index.js new file mode 100644 index 0000000000..d950503099 --- /dev/null +++ b/packages/materialdesign-components/src/Card/index.js @@ -0,0 +1,7 @@ +import "./_styles.scss" +export { default as Card } from "./Card.svelte" +export { default as CardBody } from "./CardBody.svelte" +export { default as CardFooter } from "./CardFooter.svelte" +export { default as CardHeader } from "./CardHeader.svelte" +export { default as CardImage } from "./CardImage.svelte" + diff --git a/packages/materialdesign-components/src/Common/Icon.svelte b/packages/materialdesign-components/src/Common/Icon.svelte index d4820fcf6c..7a825f8cca 100644 --- a/packages/materialdesign-components/src/Common/Icon.svelte +++ b/packages/materialdesign-components/src/Common/Icon.svelte @@ -1,6 +1,4 @@ -{text} + + {text} + diff --git a/packages/materialdesign-components/src/Typography/H6.svelte b/packages/materialdesign-components/src/Typography/H6.svelte index 18a191d787..8a9d36c9e2 100644 --- a/packages/materialdesign-components/src/Typography/H6.svelte +++ b/packages/materialdesign-components/src/Typography/H6.svelte @@ -1,5 +1,11 @@ -
{text}
+
+ {text} +
diff --git a/packages/materialdesign-components/src/Typography/Sub2.svelte b/packages/materialdesign-components/src/Typography/Sub2.svelte index d6377cadab..c8860a5869 100644 --- a/packages/materialdesign-components/src/Typography/Sub2.svelte +++ b/packages/materialdesign-components/src/Typography/Sub2.svelte @@ -1,5 +1,11 @@ -{text} + + {text} + diff --git a/packages/materialdesign-components/src/index.js b/packages/materialdesign-components/src/index.js index 13cf4fb2ca..5ae421467b 100644 --- a/packages/materialdesign-components/src/index.js +++ b/packages/materialdesign-components/src/index.js @@ -21,3 +21,10 @@ export { Menu } from "./Menu" export { Select } from "./Select" export { DatePicker } from "./DatePicker" export { IconButton } from "./IconButton" +export { Card } from "./Card" +export { CardHeader } from "./Card" +export { CardImage } from "./Card" +export { CardBody } from "./Card" +export { CardFooter } from "./Card" + +