@onsvisual/svelte-components 1.0.0-next.5 → 1.0.0-next.7

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.
Files changed (95) hide show
  1. package/dist/datavis/DataTile/DataTile.stories.svelte +14 -0
  2. package/dist/datavis/DataTile/DataTile.svelte +23 -4
  3. package/dist/datavis/DataTile/DataTile.svelte.d.ts +4 -0
  4. package/dist/datavis/DataTile/Sparkline.svelte +117 -0
  5. package/dist/datavis/DataTile/Sparkline.svelte.d.ts +27 -0
  6. package/dist/datavis/Table/Table.svelte +6 -0
  7. package/dist/datavis/Table/Table.svelte.d.ts +2 -0
  8. package/dist/decorators/Divider/Divider.svelte +8 -3
  9. package/dist/decorators/Divider/Divider.svelte.d.ts +2 -0
  10. package/dist/decorators/Icon/Icon.stories.svelte +25 -0
  11. package/dist/{inputs/Button/Icon.svelte.d.ts → decorators/Icon/Icon.stories.svelte.d.ts} +2 -6
  12. package/dist/{inputs/Button → decorators/Icon}/Icon.svelte +20 -3
  13. package/dist/decorators/Icon/Icon.svelte.d.ts +29 -0
  14. package/dist/decorators/Icon/docs/component.md +12 -0
  15. package/dist/inputs/Button/Button.svelte +9 -4
  16. package/dist/inputs/Button/Button.svelte.d.ts +6 -4
  17. package/dist/inputs/Checkbox/Checkbox.svelte +6 -1
  18. package/dist/inputs/Checkbox/Checkbox.svelte.d.ts +2 -0
  19. package/dist/inputs/Checkboxes/Checkboxes.svelte +6 -1
  20. package/dist/inputs/Checkboxes/Checkboxes.svelte.d.ts +2 -0
  21. package/dist/inputs/Dropdown/Dropdown.svelte +6 -1
  22. package/dist/inputs/Dropdown/Dropdown.svelte.d.ts +2 -0
  23. package/dist/inputs/ErrorPanel/ErrorPanel.svelte +6 -1
  24. package/dist/inputs/ErrorPanel/ErrorPanel.svelte.d.ts +2 -0
  25. package/dist/inputs/ErrorSummary/ErrorSummary.svelte +6 -1
  26. package/dist/inputs/ErrorSummary/ErrorSummary.svelte.d.ts +2 -0
  27. package/dist/inputs/Input/Input.svelte +6 -1
  28. package/dist/inputs/Input/Input.svelte.d.ts +2 -0
  29. package/dist/inputs/Radios/Radios.svelte +6 -1
  30. package/dist/inputs/Radios/Radios.svelte.d.ts +2 -0
  31. package/dist/inputs/Select/Select.svelte +6 -1
  32. package/dist/inputs/Select/Select.svelte.d.ts +2 -0
  33. package/dist/inputs/Textarea/Textarea.svelte +6 -1
  34. package/dist/inputs/Textarea/Textarea.svelte.d.ts +2 -0
  35. package/dist/layout/Accordion/Accordion.svelte +1 -1
  36. package/dist/layout/Accordion/Accordion.svelte.d.ts +2 -2
  37. package/dist/layout/Breadcrumb/Breadcrumb.svelte +6 -1
  38. package/dist/layout/Breadcrumb/Breadcrumb.svelte.d.ts +4 -2
  39. package/dist/layout/Card/Card.svelte +1 -1
  40. package/dist/layout/Card/Card.svelte.d.ts +2 -2
  41. package/dist/layout/Contents/Contents.svelte +6 -1
  42. package/dist/layout/Contents/Contents.svelte.d.ts +2 -0
  43. package/dist/layout/DescriptionList/DescriptionList.svelte +6 -1
  44. package/dist/layout/DescriptionList/DescriptionList.svelte.d.ts +2 -0
  45. package/dist/layout/Details/Details.svelte +6 -1
  46. package/dist/layout/Details/Details.svelte.d.ts +2 -0
  47. package/dist/layout/DocumentList/DocumentList.svelte +6 -1
  48. package/dist/layout/DocumentList/DocumentList.svelte.d.ts +2 -0
  49. package/dist/layout/Footer/Footer.svelte +1 -1
  50. package/dist/layout/Footer/Footer.svelte.d.ts +4 -4
  51. package/dist/layout/Grid/Grid.svelte +3 -3
  52. package/dist/layout/Grid/Grid.svelte.d.ts +2 -2
  53. package/dist/layout/Header/Header.svelte +1 -1
  54. package/dist/layout/Header/Header.svelte.d.ts +4 -4
  55. package/dist/layout/Hero/Hero.stories.svelte +2 -1
  56. package/dist/layout/Hero/Hero.svelte +9 -8
  57. package/dist/layout/Hero/Hero.svelte.d.ts +8 -6
  58. package/dist/layout/Highlight/Highlight.svelte +15 -22
  59. package/dist/layout/Highlight/Highlight.svelte.d.ts +6 -6
  60. package/dist/layout/Image/Image.svelte +6 -1
  61. package/dist/layout/Image/Image.svelte.d.ts +2 -0
  62. package/dist/layout/List/List.svelte +6 -1
  63. package/dist/layout/List/List.svelte.d.ts +2 -0
  64. package/dist/layout/NavSections/NavSection.svelte +1 -1
  65. package/dist/layout/NavSections/NavSection.svelte.d.ts +2 -2
  66. package/dist/layout/NavSections/NavSections.svelte +3 -3
  67. package/dist/layout/NavSections/NavSections.svelte.d.ts +2 -2
  68. package/dist/layout/Notice/Notice.svelte +6 -1
  69. package/dist/layout/Notice/Notice.svelte.d.ts +2 -0
  70. package/dist/layout/PhaseBanner/PhaseBanner.svelte +6 -1
  71. package/dist/layout/PhaseBanner/PhaseBanner.svelte.d.ts +2 -0
  72. package/dist/layout/RelatedContent/RelatedContent.svelte +6 -1
  73. package/dist/layout/RelatedContent/RelatedContent.svelte.d.ts +2 -0
  74. package/dist/layout/Scroller/Scroller.svelte +6 -1
  75. package/dist/layout/Scroller/Scroller.svelte.d.ts +2 -0
  76. package/dist/layout/Scroller/ScrollerSection.svelte +6 -1
  77. package/dist/layout/Scroller/ScrollerSection.svelte.d.ts +2 -0
  78. package/dist/layout/Section/Section.svelte +3 -3
  79. package/dist/layout/Section/Section.svelte.d.ts +2 -2
  80. package/dist/layout/ShareButtons/ShareButtons.svelte +8 -3
  81. package/dist/layout/ShareButtons/ShareButtons.svelte.d.ts +2 -0
  82. package/dist/layout/Summary/Summary.svelte +6 -1
  83. package/dist/layout/Summary/Summary.svelte.d.ts +2 -0
  84. package/dist/layout/Tabs/Tabs.svelte +6 -1
  85. package/dist/layout/Tabs/Tabs.svelte.d.ts +2 -0
  86. package/dist/templates/intro.mdx +1 -1
  87. package/dist/wrappers/Container/Container.svelte +41 -28
  88. package/dist/wrappers/Container/Container.svelte.d.ts +8 -4
  89. package/dist/wrappers/Container/docs/component.md +4 -2
  90. package/dist/wrappers/Theme/Theme.svelte +4 -4
  91. package/dist/wrappers/Theme/Theme.svelte.d.ts +6 -6
  92. package/dist/wrappers/Theme/docs/component.md +1 -1
  93. package/dist/wrappers/Theme/themes.d.ts +28 -0
  94. package/dist/wrappers/Theme/themes.js +2 -1
  95. package/package.json +3 -1
@@ -1,5 +1,4 @@
1
1
  <script>
2
- import Theme from "../../wrappers/Theme/Theme.svelte";
3
2
  import Container from "../../wrappers/Container/Container.svelte";
4
3
 
5
4
  /**
@@ -8,7 +7,7 @@
8
7
  */
9
8
  export let id = "";
10
9
  /**
11
- * Optional: Set a CSS class for the section
10
+ * Optional: Set an additional CSS class for the section
12
11
  * @type {string}
13
12
  */
14
13
  export let cls = "";
@@ -29,7 +28,7 @@
29
28
  export let height = null;
30
29
  /**
31
30
  * Sets a predefined theme
32
- * @type {"light"|"dark"|"paleblue"|"blue"|"navyblue"|null}
31
+ * @type {"light"|"dark"|"paleblue"|"blue"|"navyblue"|"grey"|null}
33
32
  */
34
33
  export let theme = "paleblue";
35
34
  /**
@@ -43,34 +42,28 @@
43
42
  */
44
43
  export let background = null;
45
44
  /**
46
- * Optional margin above section
45
+ * Adds margin above section
47
46
  * @type {boolean}
48
47
  */
49
48
  export let marginTop = false;
50
49
  /**
51
- * Optional margin below section
50
+ * Adds margin below section
52
51
  * @type {boolean}
53
52
  */
54
53
  export let marginBottom = true;
55
54
  </script>
56
55
 
57
- <Theme {theme} overrides={themeOverrides} {background}>
58
- <Container {id} {cls} {width} {marginTop} {marginBottom}>
59
- <section
60
- class="ons-section__highlight ons-u-mt-xl ons-u-mb-xl"
61
- class:ons-u-fs-l={bigText}
62
- style:height={typeof height === "number"
63
- ? `${height}px`
64
- : height === "full"
65
- ? "100vh"
66
- : height}
67
- >
68
- <div>
69
- <slot />
70
- </div>
71
- </section>
72
- </Container>
73
- </Theme>
56
+ <Container {id} {cls} {width} {marginTop} {marginBottom} {theme} {themeOverrides} {background}>
57
+ <section
58
+ class="ons-section__highlight ons-u-mt-xl ons-u-mb-xl"
59
+ class:ons-u-fs-l={bigText}
60
+ style:height={typeof height === "number" ? `${height}px` : height === "full" ? "100vh" : height}
61
+ >
62
+ <div>
63
+ <slot />
64
+ </div>
65
+ </section>
66
+ </Container>
74
67
 
75
68
  <style>
76
69
  .ons-section__highlight {
@@ -2,14 +2,14 @@
2
2
  /** @typedef {typeof __propDef.events} HighlightEvents */
3
3
  /** @typedef {typeof __propDef.slots} HighlightSlots */
4
4
  export default class Highlight extends SvelteComponentTyped<{
5
- id?: string | undefined;
5
+ theme?: "light" | "dark" | "paleblue" | "blue" | "navyblue" | "grey" | null | undefined;
6
+ background?: string | null | undefined;
6
7
  cls?: string | undefined;
8
+ id?: string | undefined;
7
9
  width?: "narrow" | "medium" | "wide" | "wider" | "full" | undefined;
8
10
  height?: string | number | null | undefined;
9
11
  marginTop?: boolean | undefined;
10
12
  marginBottom?: boolean | undefined;
11
- background?: string | null | undefined;
12
- theme?: "light" | "dark" | "paleblue" | "blue" | "navyblue" | null | undefined;
13
13
  themeOverrides?: object | undefined;
14
14
  bigText?: boolean | undefined;
15
15
  }, {
@@ -24,14 +24,14 @@ export type HighlightSlots = typeof __propDef.slots;
24
24
  import { SvelteComponentTyped } from "svelte";
25
25
  declare const __propDef: {
26
26
  props: {
27
- id?: string | undefined;
27
+ theme?: "light" | "dark" | "paleblue" | "blue" | "navyblue" | "grey" | null | undefined;
28
+ background?: string | null | undefined;
28
29
  cls?: string | undefined;
30
+ id?: string | undefined;
29
31
  width?: "narrow" | "medium" | "wide" | "wider" | "full" | undefined;
30
32
  height?: string | number | null | undefined;
31
33
  marginTop?: boolean | undefined;
32
34
  marginBottom?: boolean | undefined;
33
- background?: string | null | undefined;
34
- theme?: "light" | "dark" | "paleblue" | "blue" | "navyblue" | null | undefined;
35
35
  themeOverrides?: object | undefined;
36
36
  bigText?: boolean | undefined;
37
37
  };
@@ -14,9 +14,14 @@
14
14
  * @type {string}
15
15
  */
16
16
  export let caption = "";
17
+ /**
18
+ * Optional: Set an additional CSS class for the component
19
+ * @type {string}
20
+ */
21
+ export let cls = "";
17
22
  </script>
18
23
 
19
- <figure class="ons-image">
24
+ <figure class="ons-image {cls}">
20
25
  <img class="ons-image__img" {src} {alt} />
21
26
  {#if caption}
22
27
  <figcaption class="ons-image__caption">{caption}</figcaption>
@@ -2,6 +2,7 @@
2
2
  /** @typedef {typeof __propDef.events} ImageEvents */
3
3
  /** @typedef {typeof __propDef.slots} ImageSlots */
4
4
  export default class Image extends SvelteComponentTyped<{
5
+ cls?: string | undefined;
5
6
  caption?: string | undefined;
6
7
  src?: string | undefined;
7
8
  alt?: string | undefined;
@@ -15,6 +16,7 @@ export type ImageSlots = typeof __propDef.slots;
15
16
  import { SvelteComponentTyped } from "svelte";
16
17
  declare const __propDef: {
17
18
  props: {
19
+ cls?: string | undefined;
18
20
  caption?: string | undefined;
19
21
  src?: string | undefined;
20
22
  alt?: string | undefined;
@@ -11,10 +11,15 @@
11
11
  * @type {string[]|null}
12
12
  */
13
13
  export let items = null;
14
+ /**
15
+ * Optional: Set an additional CSS class for the component
16
+ * @type {string}
17
+ */
18
+ export let cls = "";
14
19
  </script>
15
20
 
16
21
  {#if mode === "number"}
17
- <ol class="ons-list">
22
+ <ol class="ons-list {cls}">
18
23
  <slot>
19
24
  {#if items}
20
25
  {#each items as item}
@@ -2,6 +2,7 @@
2
2
  /** @typedef {typeof __propDef.events} ListEvents */
3
3
  /** @typedef {typeof __propDef.slots} ListSlots */
4
4
  export default class List extends SvelteComponentTyped<{
5
+ cls?: string | undefined;
5
6
  mode?: "number" | "inline" | "bullet" | "dash" | "bare" | undefined;
6
7
  items?: string[] | null | undefined;
7
8
  }, {
@@ -16,6 +17,7 @@ export type ListSlots = typeof __propDef.slots;
16
17
  import { SvelteComponentTyped } from "svelte";
17
18
  declare const __propDef: {
18
19
  props: {
20
+ cls?: string | undefined;
19
21
  mode?: "number" | "inline" | "bullet" | "dash" | "bare" | undefined;
20
22
  items?: string[] | null | undefined;
21
23
  };
@@ -14,7 +14,7 @@
14
14
  */
15
15
  export let id = slugify(title);
16
16
  /**
17
- * Optional: Set a CSS class for the section
17
+ * Optional: Set an additional CSS class for the section
18
18
  * @type {string}
19
19
  */
20
20
  export let cls = "";
@@ -2,8 +2,8 @@
2
2
  /** @typedef {typeof __propDef.events} NavSectionEvents */
3
3
  /** @typedef {typeof __propDef.slots} NavSectionSlots */
4
4
  export default class NavSection extends SvelteComponentTyped<{
5
- id?: string | undefined;
6
5
  cls?: string | undefined;
6
+ id?: string | undefined;
7
7
  title?: string | undefined;
8
8
  hideTitle?: boolean | undefined;
9
9
  subsection?: boolean | undefined;
@@ -19,8 +19,8 @@ export type NavSectionSlots = typeof __propDef.slots;
19
19
  import { SvelteComponentTyped } from "svelte";
20
20
  declare const __propDef: {
21
21
  props: {
22
- id?: string | undefined;
23
22
  cls?: string | undefined;
23
+ id?: string | undefined;
24
24
  title?: string | undefined;
25
25
  hideTitle?: boolean | undefined;
26
26
  subsection?: boolean | undefined;
@@ -9,7 +9,7 @@
9
9
  */
10
10
  export let id = "toc";
11
11
  /**
12
- * Optional: Set a CSS class for the section
12
+ * Optional: Set an additional CSS class for the section
13
13
  * @type {string}
14
14
  */
15
15
  export let cls = "";
@@ -29,12 +29,12 @@
29
29
  */
30
30
  export let noContents = false;
31
31
  /**
32
- * Optional margin above section
32
+ * Adds margin above section
33
33
  * @type {boolean}
34
34
  */
35
35
  export let marginTop = false;
36
36
  /**
37
- * Optional margin below section
37
+ * Adds margin below section
38
38
  * @type {boolean}
39
39
  */
40
40
  export let marginBottom = true;
@@ -2,8 +2,8 @@
2
2
  /** @typedef {typeof __propDef.events} NavSectionsEvents */
3
3
  /** @typedef {typeof __propDef.slots} NavSectionsSlots */
4
4
  export default class NavSections extends SvelteComponentTyped<{
5
- id?: string | undefined;
6
5
  cls?: string | undefined;
6
+ id?: string | undefined;
7
7
  width?: "narrow" | "medium" | "wide" | "wider" | "full" | undefined;
8
8
  marginTop?: boolean | undefined;
9
9
  marginBottom?: boolean | undefined;
@@ -26,8 +26,8 @@ export type NavSectionsSlots = typeof __propDef.slots;
26
26
  import { SvelteComponentTyped } from "svelte";
27
27
  declare const __propDef: {
28
28
  props: {
29
- id?: string | undefined;
30
29
  cls?: string | undefined;
30
+ id?: string | undefined;
31
31
  width?: "narrow" | "medium" | "wide" | "wider" | "full" | undefined;
32
32
  marginTop?: boolean | undefined;
33
33
  marginBottom?: boolean | undefined;
@@ -4,10 +4,15 @@
4
4
  * @type {"info"|"success"|"error"|"warning"}
5
5
  */
6
6
  export let mode = "info";
7
+ /**
8
+ * Optional: Set an additional CSS class for the component
9
+ * @type {string}
10
+ */
11
+ export let cls = "";
7
12
  </script>
8
13
 
9
14
  <div
10
- class="ons-panel ons-panel--no-title"
15
+ class="ons-panel ons-panel--no-title {cls}"
11
16
  class:ons-panel--info={mode === "info"}
12
17
  class:ons-panel--warn={mode === "warning"}
13
18
  class:ons-panel--error={mode === "error"}
@@ -2,6 +2,7 @@
2
2
  /** @typedef {typeof __propDef.events} NoticeEvents */
3
3
  /** @typedef {typeof __propDef.slots} NoticeSlots */
4
4
  export default class Notice extends SvelteComponentTyped<{
5
+ cls?: string | undefined;
5
6
  mode?: "error" | "info" | "success" | "warning" | undefined;
6
7
  }, {
7
8
  [evt: string]: CustomEvent<any>;
@@ -15,6 +16,7 @@ export type NoticeSlots = typeof __propDef.slots;
15
16
  import { SvelteComponentTyped } from "svelte";
16
17
  declare const __propDef: {
17
18
  props: {
19
+ cls?: string | undefined;
18
20
  mode?: "error" | "info" | "success" | "warning" | undefined;
19
21
  };
20
22
  events: {
@@ -9,9 +9,14 @@
9
9
  * @type {string}
10
10
  */
11
11
  export let href = "https://www.ons.gov.uk/feedback";
12
+ /**
13
+ * Optional: Set an additional CSS class for the component
14
+ * @type {string}
15
+ */
16
+ export let cls = "";
12
17
  </script>
13
18
 
14
- <div class="ons-phase-banner">
19
+ <div class="ons-phase-banner {cls}">
15
20
  <div class="ons-container">
16
21
  <div
17
22
  class="ons-grid ons-grid-flex ons-grid--gutterless ons-grid-flex--vertical-center ons-grid-flex--no-wrap"
@@ -2,6 +2,7 @@
2
2
  /** @typedef {typeof __propDef.events} PhaseBannerEvents */
3
3
  /** @typedef {typeof __propDef.slots} PhaseBannerSlots */
4
4
  export default class PhaseBanner extends SvelteComponentTyped<{
5
+ cls?: string | undefined;
5
6
  href?: string | undefined;
6
7
  phase?: string | undefined;
7
8
  }, {
@@ -14,6 +15,7 @@ export type PhaseBannerSlots = typeof __propDef.slots;
14
15
  import { SvelteComponentTyped } from "svelte";
15
16
  declare const __propDef: {
16
17
  props: {
18
+ cls?: string | undefined;
17
19
  href?: string | undefined;
18
20
  phase?: string | undefined;
19
21
  };
@@ -14,9 +14,14 @@
14
14
  * @type {object[]}
15
15
  */
16
16
  export let related = [{ title, links }];
17
+ /**
18
+ * Optional: Set an additional CSS class for the component
19
+ * @type {string}
20
+ */
21
+ export let cls = "";
17
22
  </script>
18
23
 
19
- <aside class="ons-related-content" aria-label="Related content">
24
+ <aside class="ons-related-content {cls}" aria-label="Related content">
20
25
  <slot />
21
26
  {#each related as section}
22
27
  <div class="ons-related-content__section">
@@ -2,6 +2,7 @@
2
2
  /** @typedef {typeof __propDef.events} RelatedContentEvents */
3
3
  /** @typedef {typeof __propDef.slots} RelatedContentSlots */
4
4
  export default class RelatedContent extends SvelteComponentTyped<{
5
+ cls?: string | undefined;
5
6
  title?: string | undefined;
6
7
  links?: object | object[] | undefined;
7
8
  related?: object[] | undefined;
@@ -17,6 +18,7 @@ export type RelatedContentSlots = typeof __propDef.slots;
17
18
  import { SvelteComponentTyped } from "svelte";
18
19
  declare const __propDef: {
19
20
  props: {
21
+ cls?: string | undefined;
20
22
  title?: string | undefined;
21
23
  links?: object | object[] | undefined;
22
24
  related?: object[] | undefined;
@@ -136,6 +136,11 @@
136
136
  * @type {boolean}
137
137
  */
138
138
  export let visible = false;
139
+ /**
140
+ * Optional: Set an additional CSS class for the component
141
+ * @type {string}
142
+ */
143
+ export let cls = "";
139
144
 
140
145
  const sections = writable([]);
141
146
  setContext("sections", sections);
@@ -251,7 +256,7 @@
251
256
  <div class="ons-u-mt-xl"></div>
252
257
  {/if}
253
258
 
254
- <svelte-scroller-outer {id} bind:this={outer} class:splitscreen>
259
+ <svelte-scroller-outer {id} bind:this={outer} class={cls} class:splitscreen>
255
260
  <svelte-scroller-background-container class="background-container" style="{style}{widthStyle}">
256
261
  <svelte-scroller-background bind:this={background}>
257
262
  <slot name="background" />
@@ -2,6 +2,7 @@
2
2
  /** @typedef {typeof __propDef.events} ScrollerEvents */
3
3
  /** @typedef {typeof __propDef.slots} ScrollerSlots */
4
4
  export default class Scroller extends SvelteComponentTyped<{
5
+ cls?: string | undefined;
5
6
  id?: string | undefined;
6
7
  marginTop?: boolean | undefined;
7
8
  marginBottom?: boolean | undefined;
@@ -30,6 +31,7 @@ export type ScrollerSlots = typeof __propDef.slots;
30
31
  import { SvelteComponentTyped } from "svelte";
31
32
  declare const __propDef: {
32
33
  props: {
34
+ cls?: string | undefined;
33
35
  id?: string | undefined;
34
36
  marginTop?: boolean | undefined;
35
37
  marginBottom?: boolean | undefined;
@@ -17,6 +17,11 @@
17
17
  * @type {boolean}
18
18
  */
19
19
  export let hideTitle = false;
20
+ /**
21
+ * Optional: Set an additional CSS class for the component
22
+ * @type {string}
23
+ */
24
+ export let cls = "";
20
25
 
21
26
  let section;
22
27
 
@@ -35,7 +40,7 @@
35
40
  });
36
41
  </script>
37
42
 
38
- <section data-id={id} bind:this={section}>
43
+ <section data-id={id} bind:this={section} class={cls}>
39
44
  <Container width="narrow">
40
45
  <div class="ons-scroller-section">
41
46
  {#if title}
@@ -2,6 +2,7 @@
2
2
  /** @typedef {typeof __propDef.events} ScrollerSectionEvents */
3
3
  /** @typedef {typeof __propDef.slots} ScrollerSectionSlots */
4
4
  export default class ScrollerSection extends SvelteComponentTyped<{
5
+ cls?: string | undefined;
5
6
  id?: string | undefined;
6
7
  title?: string | undefined;
7
8
  hideTitle?: boolean | undefined;
@@ -17,6 +18,7 @@ export type ScrollerSectionSlots = typeof __propDef.slots;
17
18
  import { SvelteComponentTyped } from "svelte";
18
19
  declare const __propDef: {
19
20
  props: {
21
+ cls?: string | undefined;
20
22
  id?: string | undefined;
21
23
  title?: string | undefined;
22
24
  hideTitle?: boolean | undefined;
@@ -8,7 +8,7 @@
8
8
  */
9
9
  export let id = "";
10
10
  /**
11
- * Optional: Set a CSS class for the section
11
+ * Optional: Set an additional CSS class for the section
12
12
  * @type {string}
13
13
  */
14
14
  export let cls = "";
@@ -33,12 +33,12 @@
33
33
  */
34
34
  export let hideTitle = false;
35
35
  /**
36
- * Optional margin above section
36
+ * Adds margin above section
37
37
  * @type {boolean}
38
38
  */
39
39
  export let marginTop = false;
40
40
  /**
41
- * Optional margin below section
41
+ * Adds margin below section
42
42
  * @type {boolean}
43
43
  */
44
44
  export let marginBottom = true;
@@ -2,8 +2,8 @@
2
2
  /** @typedef {typeof __propDef.events} SectionEvents */
3
3
  /** @typedef {typeof __propDef.slots} SectionSlots */
4
4
  export default class Section extends SvelteComponentTyped<{
5
- id?: string | undefined;
6
5
  cls?: string | undefined;
6
+ id?: string | undefined;
7
7
  width?: "narrow" | "medium" | "wide" | "wider" | "full" | undefined;
8
8
  height?: string | number | null | undefined;
9
9
  marginTop?: boolean | undefined;
@@ -22,8 +22,8 @@ export type SectionSlots = typeof __propDef.slots;
22
22
  import { SvelteComponentTyped } from "svelte";
23
23
  declare const __propDef: {
24
24
  props: {
25
- id?: string | undefined;
26
25
  cls?: string | undefined;
26
+ id?: string | undefined;
27
27
  width?: "narrow" | "medium" | "wide" | "wider" | "full" | undefined;
28
28
  height?: string | number | null | undefined;
29
29
  marginTop?: boolean | undefined;
@@ -8,15 +8,20 @@
8
8
  */
9
9
  export let title = "Share this page";
10
10
  /**
11
- * Optional margin above section
11
+ * Adds margin above section
12
12
  * @type {boolean}
13
13
  */
14
14
  export let marginTop = false;
15
15
  /**
16
- * Optional margin below section
16
+ * Adds margin below section
17
17
  * @type {boolean}
18
18
  */
19
19
  export let marginBottom = true;
20
+ /**
21
+ * Optional: Set an additional CSS class for the component
22
+ * @type {string}
23
+ */
24
+ export let cls = "";
20
25
 
21
26
  let href = "";
22
27
  let pageTitle = "";
@@ -27,7 +32,7 @@
27
32
  });
28
33
  </script>
29
34
 
30
- <Container width="wide" {marginTop} {marginBottom}>
35
+ <Container width="wide" {marginTop} {marginBottom} {cls}>
31
36
  <h2 class="ons-u-fs-r--b ons-u-mb-2xs">{title}</h2>
32
37
  <ul class="ons-list ons-list--inline ons-list--icons">
33
38
  <li class="ons-list__item">
@@ -2,6 +2,7 @@
2
2
  /** @typedef {typeof __propDef.events} ShareButtonsEvents */
3
3
  /** @typedef {typeof __propDef.slots} ShareButtonsSlots */
4
4
  export default class ShareButtons extends SvelteComponentTyped<{
5
+ cls?: string | undefined;
5
6
  marginTop?: boolean | undefined;
6
7
  marginBottom?: boolean | undefined;
7
8
  title?: string | undefined;
@@ -15,6 +16,7 @@ export type ShareButtonsSlots = typeof __propDef.slots;
15
16
  import { SvelteComponentTyped } from "svelte";
16
17
  declare const __propDef: {
17
18
  props: {
19
+ cls?: string | undefined;
18
20
  marginTop?: boolean | undefined;
19
21
  marginBottom?: boolean | undefined;
20
22
  title?: string | undefined;
@@ -18,13 +18,18 @@
18
18
  * @type {object[]}
19
19
  */
20
20
  export let items = [];
21
+ /**
22
+ * Optional: Set an additional CSS class for the component
23
+ * @type {string}
24
+ */
25
+ export let cls = "";
21
26
 
22
27
  function handleChange(item) {
23
28
  dispatch("change", { item });
24
29
  }
25
30
  </script>
26
31
 
27
- <div class="ons-summary">
32
+ <div class="ons-summary {cls}">
28
33
  <div {id} class="ons-summary__group">
29
34
  {#if title}<h2 class="ons-summary__group-title">{title}</h2>{/if}
30
35
  <dl class="ons-summary__items">
@@ -2,6 +2,7 @@
2
2
  /** @typedef {typeof __propDef.events} SummaryEvents */
3
3
  /** @typedef {typeof __propDef.slots} SummarySlots */
4
4
  export default class Summary extends SvelteComponentTyped<{
5
+ cls?: string | undefined;
5
6
  id?: string | undefined;
6
7
  title?: string | undefined;
7
8
  items?: object[] | undefined;
@@ -17,6 +18,7 @@ export type SummarySlots = typeof __propDef.slots;
17
18
  import { SvelteComponentTyped } from "svelte";
18
19
  declare const __propDef: {
19
20
  props: {
21
+ cls?: string | undefined;
20
22
  id?: string | undefined;
21
23
  title?: string | undefined;
22
24
  items?: object[] | undefined;
@@ -20,6 +20,11 @@
20
20
  * @type {string|null}
21
21
  */
22
22
  export let selected = null;
23
+ /**
24
+ * Optional: Set an additional CSS class for the component
25
+ * @type {string}
26
+ */
27
+ export let cls = "";
23
28
 
24
29
  let el;
25
30
 
@@ -39,7 +44,7 @@
39
44
  </script>
40
45
 
41
46
  <section
42
- class="ons-tabs"
47
+ class="ons-tabs {cls}"
43
48
  class:ons-tabs__border={border}
44
49
  class:ons-tabs__compact={compact}
45
50
  bind:this={el}
@@ -2,6 +2,7 @@
2
2
  /** @typedef {typeof __propDef.events} TabsEvents */
3
3
  /** @typedef {typeof __propDef.slots} TabsSlots */
4
4
  export default class Tabs extends SvelteComponentTyped<{
5
+ cls?: string | undefined;
5
6
  compact?: boolean | undefined;
6
7
  border?: boolean | undefined;
7
8
  selected?: string | null | undefined;
@@ -19,6 +20,7 @@ export type TabsSlots = typeof __propDef.slots;
19
20
  import { SvelteComponentTyped } from "svelte";
20
21
  declare const __propDef: {
21
22
  props: {
23
+ cls?: string | undefined;
22
24
  compact?: boolean | undefined;
23
25
  border?: boolean | undefined;
24
26
  selected?: string | null | undefined;
@@ -4,7 +4,7 @@ import { Meta } from "@storybook/addon-docs/blocks";
4
4
 
5
5
  # Using templates
6
6
 
7
- This section includes a series of starter templates constructed from multiple components within this library. All of these templates are included in the [sveltekit-starter](https://github.com/ONSvisual/sveltekit-starter) project, which is typically to be the easiest way to use them.
7
+ This section includes a series of starter templates constructed from multiple components within this library. Similar templates to these examples are included in the [sveltekit-starter](https://github.com/ONSvisual/sveltekit-starter) project, which is typically the easiest way to use them.
8
8
 
9
9
  When using these templates in an existing SvelteKit project (or one built from scratch), you will need to include the **main.css** file from this library, which is best imported to your top-level `+layout.svelte` file in Svelte Kit. By doing this, you will not need to include it on individual pages.
10
10