@onsvisual/svelte-components 1.0.10 → 1.0.12

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.
@@ -23,6 +23,7 @@
23
23
  name="Big number"
24
24
  args={{
25
25
  title: "Consumer Price Index (CPI)",
26
+ subtitle: "United Kingdom",
26
27
  value: "up 2.5%",
27
28
  caption: "in 12 months to December 2024",
28
29
  source: "Source: ONS"
@@ -51,16 +51,16 @@
51
51
 
52
52
  <Card {title} {href} mode="featured" {cls}>
53
53
  {#if subtitle}
54
- <p class="ons-u-fs-s">{subtitle}</p>
54
+ <p class="ons-card__subtitle ons-u-fs-s">{subtitle}</p>
55
55
  {/if}
56
56
  {#if mode === "sparkline" && data}
57
57
  <Sparkline {data} />
58
58
  {/if}
59
59
  {#if value}
60
- <p class="headline-figures__figure ons-u-fs-3xl ons-u-fs-2xl@m ons-u-mb-no">{value}</p>
60
+ <p class="ons-card__figure ons-u-fs-3xl ons-u-fw-b ons-u-mb-no">{value}</p>
61
61
  {/if}
62
62
  {#if caption}
63
- <p class="headline-figures__supporting-text ons-u-fs-r ons-u-mt-2xs ons-u-mb-no">
63
+ <p class="ons-card__body">
64
64
  {@html caption}
65
65
  </p>
66
66
  {/if}
@@ -9,9 +9,10 @@ Note: This component is experimental. Its attributes and options are likely to c
9
9
  </script>
10
10
 
11
11
  <DataCard
12
- title="Consumer Price Index (CPI)",
13
- value="up 2.5%",
14
- caption="in 12 months to December 2024",
12
+ title="Consumer Price Index (CPI)"
13
+ subtitle="Consumer Price Index (CPI)"
14
+ value="up 2.5%"
15
+ caption="in 12 months to December 2024"
15
16
  source="Source: ONS"
16
17
  />
17
18
  ```
@@ -102,9 +102,7 @@
102
102
  <h2 {id} class="ons-card__title ons-u-fs-m" class:ons-u-vh={hideTitle}>{title}</h2>
103
103
  {/if}
104
104
  {/if}
105
- <p id="text1">
106
- <slot />
107
- </p>
105
+ <slot />
108
106
  </div>
109
107
  </GridCell>
110
108
 
@@ -36,7 +36,11 @@
36
36
  observer.observe(el);
37
37
  });
38
38
 
39
- onDestroy(() => (observer?.unobserve ? observer.unobserve(el) : null));
39
+ onDestroy(() => {
40
+ if (el && observer) {
41
+ observer.unobserve(el);
42
+ }
43
+ });
40
44
  </script>
41
45
 
42
46
  {#if entered}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onsvisual/svelte-components",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "npm run build:package && npm run build:docs",