@onsvisual/svelte-components 0.1.60 → 0.1.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,8 @@ export default class Card extends SvelteComponentTyped<{
15
15
  }, {
16
16
  [evt: string]: CustomEvent<any>;
17
17
  }, {
18
+ image: {};
19
+ title: {};
18
20
  default: {};
19
21
  }> {
20
22
  }
@@ -39,6 +41,8 @@ declare const __propDef: {
39
41
  [evt: string]: CustomEvent<any>;
40
42
  };
41
43
  slots: {
44
+ image: {};
45
+ title: {};
42
46
  default: {};
43
47
  };
44
48
  };
@@ -31,31 +31,41 @@
31
31
  <div id="{id}" class="ons-card" aria-describedBy="{id}_text">
32
32
  {#if href && title}
33
33
  <a href="{href}" class="ons-card__link ons-u-db" class:ons-u-vh="{hideTitle}">
34
- {#if image}
35
- <img
36
- class="ons-card__image ons-u-mb-s"
37
- style:width="100%"
38
- src="{image}"
39
- alt="{imageAlt}"
40
- loading="lazy"
41
- />
42
- {/if}
34
+ <slot name="image">
35
+ {#if image}
36
+ <img
37
+ class="ons-card__image ons-u-mb-s"
38
+ style:width="100%"
39
+ src="{image}"
40
+ alt="{imageAlt}"
41
+ loading="lazy"
42
+ />
43
+ {/if}
44
+ </slot>
45
+ <slot name="title">
46
+ <h3
47
+ class="ons-card__title ons-u-fs-m"
48
+ style:padding="{!noBackground && !image
49
+ ? "12px 16px 0"
50
+ : !noBackground
51
+ ? "0 16px"
52
+ : ""}"
53
+ >
54
+ {title}
55
+ </h3>
56
+ </slot>
57
+ </a>
58
+ {:else if title}
59
+ <slot name="title">
43
60
  <h3
44
61
  class="ons-card__title ons-u-fs-m"
45
- style:padding="{!noBackground && !image ? "12px 16px 0" : !noBackground ? "0 16px" : ""}"
62
+ class:ons-u-vh="{hideTitle}"
63
+ style:padding="{!noBackground ? "8px 16px 0" : ""}"
64
+ style:margin-bottom="5px"
46
65
  >
47
66
  {title}
48
67
  </h3>
49
- </a>
50
- {:else if title}
51
- <h3
52
- class="ons-card__title ons-u-fs-m"
53
- class:ons-u-vh="{hideTitle}"
54
- style:padding="{!noBackground ? "8px 16px 0" : ""}"
55
- style:margin-bottom="5px"
56
- >
57
- {title}
58
- </h3>
68
+ </slot>
59
69
  {/if}
60
70
  <div id="{id}_text" class:tile__body="{!noBackground}">
61
71
  <slot />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onsvisual/svelte-components",
3
- "version": "0.1.60",
3
+ "version": "0.1.61",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "homepage": "https://onsvisual.github.io/svelte-components",