From 96352f835b219a4af13f3ed2562fcb603d7c1825 Mon Sep 17 00:00:00 2001 From: Conor_Mack Date: Fri, 20 Mar 2020 09:57:49 +0000 Subject: [PATCH] Card with lay undefined issue --- .../materialdesign-components/package.json | 4 +- .../src/Button/Button.svelte | 10 ++- .../src/Card/Card.svelte | 45 ++++++++++++++ .../src/Card/CardBody.svelte | 12 ++++ .../src/Card/CardFooter.svelte | 31 ++++++++++ .../src/Card/CardHeader.svelte | 45 ++++++++++++++ .../src/Card/CardImage.svelte | 62 +++++++++++++++++++ .../src/Card/_styles.scss | 1 + .../src/Card/index.js | 7 +++ .../src/Common/Icon.svelte | 2 - .../src/DatePicker/DatePicker.svelte | 5 +- .../src/IconButton/IconButton.svelte | 9 +++ .../src/Test/TestApp.svelte | 2 + .../src/Test/props.js | 55 +++++++++++++++- .../src/Typography/Body2.svelte | 8 ++- .../src/Typography/H6.svelte | 8 ++- .../src/Typography/Sub2.svelte | 8 ++- .../materialdesign-components/src/index.js | 7 +++ 18 files changed, 310 insertions(+), 11 deletions(-) create mode 100644 packages/materialdesign-components/src/Card/Card.svelte create mode 100644 packages/materialdesign-components/src/Card/CardBody.svelte create mode 100644 packages/materialdesign-components/src/Card/CardFooter.svelte create mode 100644 packages/materialdesign-components/src/Card/CardHeader.svelte create mode 100644 packages/materialdesign-components/src/Card/CardImage.svelte create mode 100644 packages/materialdesign-components/src/Card/_styles.scss create mode 100644 packages/materialdesign-components/src/Card/index.js 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..eb37f0c33b --- /dev/null +++ b/packages/materialdesign-components/src/Card/CardBody.svelte @@ -0,0 +1,12 @@ + + +
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..7f9e80cd17 --- /dev/null +++ b/packages/materialdesign-components/src/Card/CardHeader.svelte @@ -0,0 +1,45 @@ + + +
+ {#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" + +