@onsvisual/svelte-components 0.0.31 → 0.0.34

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.
@@ -6,6 +6,7 @@ export default class AnalyticsBanner extends SvelteComponentTyped<{
6
6
  width?: "wide" | "wider";
7
7
  analyticsId?: string;
8
8
  analyticsProps?: any;
9
+ hideBanner?: boolean;
9
10
  usageCookies?: boolean;
10
11
  }, {
11
12
  [evt: string]: CustomEvent<any>;
@@ -20,6 +21,7 @@ declare const __propDef: {
20
21
  width?: "wide" | "wider";
21
22
  analyticsId?: string;
22
23
  analyticsProps?: object;
24
+ hideBanner?: boolean;
23
25
  usageCookies?: boolean;
24
26
  };
25
27
  events: {
@@ -19,6 +19,11 @@
19
19
  * @type {object}
20
20
  */
21
21
  export let analyticsProps = {};
22
+ /**
23
+ * Use this to hide the banner (only initialises analytics if cookies already accepted)
24
+ * @type {boolean}
25
+ */
26
+ export let hideBanner = false;
22
27
  /**
23
28
  * Bind to this value if you need to know if cookies have been accepted
24
29
  * @type {boolean}
@@ -147,7 +152,7 @@
147
152
  const i18n = (text) => (lang == "cy" && texts[text] ? texts[text] : text);
148
153
  </script>
149
154
 
150
- {#if showBanner}
155
+ {#if showBanner && !hideBanner}
151
156
  <div
152
157
  class="ons-cookies-banner"
153
158
  role="region"
@@ -147,4 +147,5 @@
147
147
  <style>
148
148
  svg {
149
149
  overflow: visible;
150
+ width: auto;
150
151
  }</style>
@@ -13,7 +13,7 @@
13
13
  * Adds an exclamation mark icon
14
14
  * @type {boolean}
15
15
  */
16
- export let important = mode !== "warning";
16
+ export let important = mode === "warning";
17
17
 
18
18
  $: style =
19
19
  mode === "success"
@@ -37,9 +37,7 @@
37
37
  <div class="ons-panel__body">
38
38
  <div class="default-line-height" class:ons-u-fs-r="{mode !== 'warning'}">
39
39
  {#if title}<p><strong>{title}</strong></p>{/if}
40
- <p class="ons-u-mb-no">
41
- <slot />
42
- </p>
40
+ <slot />
43
41
  </div>
44
42
  </div>
45
43
  </div>
@@ -56,4 +54,7 @@
56
54
  color: rgb(0, 60, 87) !important;
57
55
  -webkit-text-decoration: underline solid rgb(0, 60, 87) 2px !important;
58
56
  text-decoration: underline solid rgb(0, 60, 87) 2px !important;
57
+ }
58
+ :global(.ons-panel__body p:last-of-type) {
59
+ margin-bottom: 0;
59
60
  }</style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onsvisual/svelte-components",
3
- "version": "0.0.31",
3
+ "version": "0.0.34",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "homepage": "https://onsvisual.github.io/svelte-components",