@onsvisual/svelte-components 0.0.22 → 0.0.24

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 (31) hide show
  1. package/dist/@types/index.d.ts +2 -0
  2. package/dist/@types/inputs/Checkbox/Checkbox.svelte.d.ts +2 -2
  3. package/dist/@types/inputs/Dropdown/Dropdown.svelte.d.ts +2 -2
  4. package/dist/@types/inputs/Input/Input.svelte.d.ts +2 -2
  5. package/dist/@types/inputs/Radios/Radio.svelte.d.ts +2 -2
  6. package/dist/@types/inputs/Radios/Radios.svelte.d.ts +2 -2
  7. package/dist/@types/inputs/Select/Select.svelte.d.ts +2 -2
  8. package/dist/@types/inputs/Textarea/Textarea.svelte.d.ts +2 -2
  9. package/dist/@types/layout/Accordion/AccordionItem.svelte.d.ts +2 -2
  10. package/dist/@types/layout/Cards/Card.svelte.d.ts +43 -0
  11. package/dist/@types/layout/Cards/Cards.svelte.d.ts +51 -0
  12. package/dist/@types/layout/Grid/Grid.svelte.d.ts +8 -2
  13. package/dist/@types/layout/Hero/Hero.svelte.d.ts +4 -2
  14. package/dist/@types/layout/Highlight/Highlight.svelte.d.ts +2 -2
  15. package/dist/@types/layout/NavSections/NavSection.svelte.d.ts +2 -2
  16. package/dist/@types/layout/Scroller/Scroller.svelte.d.ts +2 -2
  17. package/dist/@types/layout/Scroller/ScrollerSection.svelte.d.ts +2 -2
  18. package/dist/@types/layout/Section/Section.svelte.d.ts +4 -2
  19. package/dist/@types/layout/Tabs/Tab.svelte.d.ts +2 -2
  20. package/dist/@types/wrappers/Container/Container.svelte.d.ts +4 -0
  21. package/dist/@types/wrappers/Theme/Theme.svelte.d.ts +4 -0
  22. package/dist/index.js +2 -0
  23. package/dist/layout/Cards/Card.svelte +85 -0
  24. package/dist/layout/Cards/Cards.svelte +95 -0
  25. package/dist/layout/Grid/Grid.svelte +24 -3
  26. package/dist/layout/Hero/Hero.svelte +8 -1
  27. package/dist/layout/Section/Section.svelte +8 -1
  28. package/dist/wrappers/Container/Container.svelte +31 -4
  29. package/dist/wrappers/Embed/Embed.svelte +8 -1
  30. package/dist/wrappers/Theme/Theme.svelte +11 -2
  31. package/package.json +3 -1
@@ -5,6 +5,8 @@ export { default as Theme } from "./wrappers/Theme/Theme.svelte";
5
5
  export { default as Accordion } from "./layout/Accordion/Accordion.svelte";
6
6
  export { default as Backlink } from "./layout/Backlink/Backlink.svelte";
7
7
  export { default as Breadcrumb } from "./layout/Breadcrumb/Breadcrumb.svelte";
8
+ export { default as Cards } from "./layout/Cards/Cards.svelte";
9
+ export { default as Card } from "./layout/Cards/Card.svelte";
8
10
  export { default as Contents } from "./layout/Contents/Contents.svelte";
9
11
  export { default as ErrorPage } from "./layout/ErrorPage/ErrorPage.svelte";
10
12
  export { default as Footer } from "./layout/Footer/Footer.svelte";
@@ -2,8 +2,8 @@
2
2
  /** @typedef {typeof __propDef.events} CheckboxEvents */
3
3
  /** @typedef {typeof __propDef.slots} CheckboxSlots */
4
4
  export default class Checkbox extends SvelteComponentTyped<{
5
- label: string;
6
5
  id: string;
6
+ label: string;
7
7
  compact?: boolean;
8
8
  description?: string;
9
9
  variant?: "default" | "ghost";
@@ -22,8 +22,8 @@ export type CheckboxSlots = typeof __propDef.slots;
22
22
  import { SvelteComponentTyped } from "svelte";
23
23
  declare const __propDef: {
24
24
  props: {
25
- label: string;
26
25
  id: string;
26
+ label: string;
27
27
  compact?: boolean;
28
28
  description?: string;
29
29
  variant?: "default" | "ghost";
@@ -2,8 +2,8 @@
2
2
  /** @typedef {typeof __propDef.events} DropdownEvents */
3
3
  /** @typedef {typeof __propDef.slots} DropdownSlots */
4
4
  export default class Dropdown extends SvelteComponentTyped<{
5
- label?: string;
6
5
  id?: string;
6
+ label?: string;
7
7
  value?: any;
8
8
  hideLabel?: boolean;
9
9
  placeholder?: string;
@@ -20,8 +20,8 @@ export type DropdownSlots = typeof __propDef.slots;
20
20
  import { SvelteComponentTyped } from "svelte";
21
21
  declare const __propDef: {
22
22
  props: {
23
- label?: string;
24
23
  id?: string;
24
+ label?: string;
25
25
  value?: object;
26
26
  hideLabel?: boolean;
27
27
  placeholder?: string;
@@ -2,9 +2,9 @@
2
2
  /** @typedef {typeof __propDef.events} InputEvents */
3
3
  /** @typedef {typeof __propDef.slots} InputSlots */
4
4
  export default class Input extends SvelteComponentTyped<{
5
+ id?: string;
5
6
  width?: number;
6
7
  label?: string;
7
- id?: string;
8
8
  numeric?: boolean;
9
9
  error?: boolean;
10
10
  pattern?: string;
@@ -27,9 +27,9 @@ export type InputSlots = typeof __propDef.slots;
27
27
  import { SvelteComponentTyped } from "svelte";
28
28
  declare const __propDef: {
29
29
  props: {
30
+ id?: string;
30
31
  width?: number;
31
32
  label?: string;
32
- id?: string;
33
33
  numeric?: boolean;
34
34
  error?: boolean;
35
35
  pattern?: string;
@@ -2,8 +2,8 @@
2
2
  /** @typedef {typeof __propDef.events} RadioEvents */
3
3
  /** @typedef {typeof __propDef.slots} RadioSlots */
4
4
  export default class Radio extends SvelteComponentTyped<{
5
- label: string;
6
5
  id: string;
6
+ label: string;
7
7
  groupId: string;
8
8
  compact?: boolean;
9
9
  value?: string;
@@ -20,8 +20,8 @@ export type RadioSlots = typeof __propDef.slots;
20
20
  import { SvelteComponentTyped } from "svelte";
21
21
  declare const __propDef: {
22
22
  props: {
23
- label: string;
24
23
  id: string;
24
+ label: string;
25
25
  groupId: string;
26
26
  compact?: boolean;
27
27
  value?: string;
@@ -2,9 +2,9 @@
2
2
  /** @typedef {typeof __propDef.events} RadiosEvents */
3
3
  /** @typedef {typeof __propDef.slots} RadiosSlots */
4
4
  export default class Radios extends SvelteComponentTyped<{
5
+ id?: string;
5
6
  label?: string;
6
7
  compact?: boolean;
7
- id?: string;
8
8
  items?: any[];
9
9
  value?: string;
10
10
  }, {
@@ -21,9 +21,9 @@ export type RadiosSlots = typeof __propDef.slots;
21
21
  import { SvelteComponentTyped } from "svelte";
22
22
  declare const __propDef: {
23
23
  props: {
24
+ id?: string;
24
25
  label?: string;
25
26
  compact?: boolean;
26
- id?: string;
27
27
  items?: any[];
28
28
  value?: string;
29
29
  };
@@ -2,9 +2,9 @@
2
2
  /** @typedef {typeof __propDef.events} SelectEvents */
3
3
  /** @typedef {typeof __propDef.slots} SelectSlots */
4
4
  export default class Select extends SvelteComponentTyped<{
5
+ id?: string;
5
6
  width?: number;
6
7
  label?: string;
7
- id?: string;
8
8
  mode?: "default" | "search";
9
9
  value?: any;
10
10
  hideLabel?: boolean;
@@ -35,9 +35,9 @@ export type SelectSlots = typeof __propDef.slots;
35
35
  import { SvelteComponentTyped } from "svelte";
36
36
  declare const __propDef: {
37
37
  props: {
38
+ id?: string;
38
39
  width?: number;
39
40
  label?: string;
40
- id?: string;
41
41
  mode?: "default" | "search";
42
42
  value?: object;
43
43
  hideLabel?: boolean;
@@ -2,9 +2,9 @@
2
2
  /** @typedef {typeof __propDef.events} TextareaEvents */
3
3
  /** @typedef {typeof __propDef.slots} TextareaSlots */
4
4
  export default class Textarea extends SvelteComponentTyped<{
5
+ id?: string;
5
6
  width?: number;
6
7
  label?: string;
7
- id?: string;
8
8
  value?: string;
9
9
  description?: string;
10
10
  hideLabel?: boolean;
@@ -20,9 +20,9 @@ export type TextareaSlots = typeof __propDef.slots;
20
20
  import { SvelteComponentTyped } from "svelte";
21
21
  declare const __propDef: {
22
22
  props: {
23
+ id?: string;
23
24
  width?: number;
24
25
  label?: string;
25
- id?: string;
26
26
  value?: string;
27
27
  description?: string;
28
28
  hideLabel?: boolean;
@@ -2,8 +2,8 @@
2
2
  /** @typedef {typeof __propDef.events} AccordionItemEvents */
3
3
  /** @typedef {typeof __propDef.slots} AccordionItemSlots */
4
4
  export default class AccordionItem extends SvelteComponentTyped<{
5
- title?: string;
6
5
  id?: string;
6
+ title?: string;
7
7
  open?: boolean;
8
8
  }, {
9
9
  [evt: string]: CustomEvent<any>;
@@ -17,8 +17,8 @@ export type AccordionItemSlots = typeof __propDef.slots;
17
17
  import { SvelteComponentTyped } from "svelte";
18
18
  declare const __propDef: {
19
19
  props: {
20
- title?: string;
21
20
  id?: string;
21
+ title?: string;
22
22
  open?: boolean;
23
23
  };
24
24
  events: {
@@ -0,0 +1,43 @@
1
+ /** @typedef {typeof __propDef.props} CardProps */
2
+ /** @typedef {typeof __propDef.events} CardEvents */
3
+ /** @typedef {typeof __propDef.slots} CardSlots */
4
+ export default class Card extends SvelteComponentTyped<{
5
+ id?: any;
6
+ title?: string;
7
+ href?: string;
8
+ hideTitle?: boolean;
9
+ noBackground?: any;
10
+ image?: string;
11
+ imageAlt?: string;
12
+ colspan?: number;
13
+ grow?: boolean;
14
+ }, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {
17
+ default: {};
18
+ }> {
19
+ }
20
+ export type CardProps = typeof __propDef.props;
21
+ export type CardEvents = typeof __propDef.events;
22
+ export type CardSlots = typeof __propDef.slots;
23
+ import { SvelteComponentTyped } from "svelte";
24
+ declare const __propDef: {
25
+ props: {
26
+ id?: any;
27
+ title?: string;
28
+ href?: string;
29
+ hideTitle?: boolean;
30
+ noBackground?: any;
31
+ image?: string;
32
+ imageAlt?: string;
33
+ colspan?: number;
34
+ grow?: boolean;
35
+ };
36
+ events: {
37
+ [evt: string]: CustomEvent<any>;
38
+ };
39
+ slots: {
40
+ default: {};
41
+ };
42
+ };
43
+ export {};
@@ -0,0 +1,51 @@
1
+ /** @typedef {typeof __propDef.props} CardsProps */
2
+ /** @typedef {typeof __propDef.events} CardsEvents */
3
+ /** @typedef {typeof __propDef.slots} CardsSlots */
4
+ export default class Cards extends SvelteComponentTyped<{
5
+ theme?: "light" | "dark" | "lightblue";
6
+ id?: string;
7
+ cls?: string;
8
+ width?: "narrow" | "medium" | "wide" | "full";
9
+ height?: string | number;
10
+ marginTop?: boolean;
11
+ marginBottom?: boolean;
12
+ themeOverrides?: any;
13
+ title?: string;
14
+ hideTitle?: boolean;
15
+ colwidth?: "narrow" | "medium" | "wide" | "full";
16
+ gap?: number;
17
+ noBackground?: boolean;
18
+ }, {
19
+ [evt: string]: CustomEvent<any>;
20
+ }, {
21
+ default: {};
22
+ }> {
23
+ }
24
+ export type CardsProps = typeof __propDef.props;
25
+ export type CardsEvents = typeof __propDef.events;
26
+ export type CardsSlots = typeof __propDef.slots;
27
+ import { SvelteComponentTyped } from "svelte";
28
+ declare const __propDef: {
29
+ props: {
30
+ theme?: "light" | "dark" | "lightblue";
31
+ id?: string;
32
+ cls?: string;
33
+ width?: "narrow" | "medium" | "wide" | "full";
34
+ height?: number | string;
35
+ marginTop?: boolean;
36
+ marginBottom?: boolean;
37
+ themeOverrides?: object;
38
+ title?: string;
39
+ hideTitle?: boolean;
40
+ colwidth?: "narrow" | "medium" | "wide" | "full";
41
+ gap?: number;
42
+ noBackground?: boolean;
43
+ };
44
+ events: {
45
+ [evt: string]: CustomEvent<any>;
46
+ };
47
+ slots: {
48
+ default: {};
49
+ };
50
+ };
51
+ export {};
@@ -3,13 +3,16 @@
3
3
  /** @typedef {typeof __propDef.slots} GridSlots */
4
4
  export default class Grid extends SvelteComponentTyped<{
5
5
  theme?: "light" | "dark" | "lightblue";
6
+ id?: string;
7
+ cls?: string;
6
8
  width?: "narrow" | "medium" | "wide" | "full";
7
9
  height?: string | number;
8
10
  marginTop?: boolean;
9
11
  marginBottom?: boolean;
10
12
  themeOverrides?: any;
11
13
  caption?: string;
12
- id?: string;
14
+ title?: string;
15
+ hideTitle?: boolean;
13
16
  colwidth?: "narrow" | "medium" | "wide" | "full";
14
17
  gap?: number;
15
18
  }, {
@@ -25,13 +28,16 @@ import { SvelteComponentTyped } from "svelte";
25
28
  declare const __propDef: {
26
29
  props: {
27
30
  theme?: "light" | "dark" | "lightblue";
31
+ id?: string;
32
+ cls?: string;
28
33
  width?: "narrow" | "medium" | "wide" | "full";
29
34
  height?: number | string;
30
35
  marginTop?: boolean;
31
36
  marginBottom?: boolean;
32
37
  themeOverrides?: object;
33
38
  caption?: string;
34
- id?: string;
39
+ title?: string;
40
+ hideTitle?: boolean;
35
41
  colwidth?: "narrow" | "medium" | "wide" | "full";
36
42
  gap?: number;
37
43
  };
@@ -3,12 +3,13 @@
3
3
  /** @typedef {typeof __propDef.slots} HeroSlots */
4
4
  export default class Hero extends SvelteComponentTyped<{
5
5
  theme?: "light" | "dark" | "lightblue";
6
+ id?: string;
7
+ cls?: string;
6
8
  background?: string;
7
9
  width?: "narrow" | "medium" | "wide" | "full";
8
10
  height?: "full" | "auto" | "tall";
9
11
  themeOverrides?: any;
10
12
  title?: string;
11
- id?: string;
12
13
  lede?: string;
13
14
  date?: string;
14
15
  }, {
@@ -24,12 +25,13 @@ import { SvelteComponentTyped } from "svelte";
24
25
  declare const __propDef: {
25
26
  props: {
26
27
  theme?: "light" | "dark" | "lightblue";
28
+ id?: string;
29
+ cls?: string;
27
30
  background?: string;
28
31
  width?: "narrow" | "medium" | "wide" | "full";
29
32
  height?: "auto" | "tall" | "full";
30
33
  themeOverrides?: object;
31
34
  title?: string;
32
- id?: string;
33
35
  lede?: string;
34
36
  date?: string;
35
37
  };
@@ -3,13 +3,13 @@
3
3
  /** @typedef {typeof __propDef.slots} HighlightSlots */
4
4
  export default class Highlight extends SvelteComponentTyped<{
5
5
  theme?: "light" | "dark" | "lightblue";
6
+ id?: string;
6
7
  background?: string;
7
8
  width?: "narrow" | "medium" | "wide" | "full";
8
9
  height?: "full" | "auto" | "tall";
9
10
  marginTop?: boolean;
10
11
  marginBottom?: boolean;
11
12
  themeOverrides?: any;
12
- id?: string;
13
13
  }, {
14
14
  [evt: string]: CustomEvent<any>;
15
15
  }, {
@@ -23,13 +23,13 @@ import { SvelteComponentTyped } from "svelte";
23
23
  declare const __propDef: {
24
24
  props: {
25
25
  theme?: "light" | "dark" | "lightblue";
26
+ id?: string;
26
27
  background?: string;
27
28
  width?: "narrow" | "medium" | "wide" | "full";
28
29
  height?: "auto" | "tall" | "full";
29
30
  marginTop?: boolean;
30
31
  marginBottom?: boolean;
31
32
  themeOverrides?: object;
32
- id?: string;
33
33
  };
34
34
  events: {
35
35
  [evt: string]: CustomEvent<any>;
@@ -2,9 +2,9 @@
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;
5
6
  title?: string;
6
7
  hideTitle?: boolean;
7
- id?: string;
8
8
  }, {
9
9
  [evt: string]: CustomEvent<any>;
10
10
  }, {
@@ -17,9 +17,9 @@ export type NavSectionSlots = typeof __propDef.slots;
17
17
  import { SvelteComponentTyped } from "svelte";
18
18
  declare const __propDef: {
19
19
  props: {
20
+ id?: string;
20
21
  title?: string;
21
22
  hideTitle?: boolean;
22
- id?: string;
23
23
  };
24
24
  events: {
25
25
  [evt: string]: CustomEvent<any>;
@@ -2,9 +2,9 @@
2
2
  /** @typedef {typeof __propDef.events} ScrollerEvents */
3
3
  /** @typedef {typeof __propDef.slots} ScrollerSlots */
4
4
  export default class Scroller extends SvelteComponentTyped<{
5
+ id?: string;
5
6
  marginBottom?: boolean;
6
7
  progress?: number;
7
- id?: string;
8
8
  splitscreen?: boolean;
9
9
  threshold?: number;
10
10
  count?: number;
@@ -27,9 +27,9 @@ export type ScrollerSlots = typeof __propDef.slots;
27
27
  import { SvelteComponentTyped } from "svelte";
28
28
  declare const __propDef: {
29
29
  props: {
30
+ id?: string;
30
31
  marginBottom?: boolean;
31
32
  progress?: number;
32
- id?: string;
33
33
  splitscreen?: boolean;
34
34
  threshold?: number;
35
35
  count?: number;
@@ -3,9 +3,9 @@
3
3
  /** @typedef {typeof __propDef.slots} ScrollerSectionSlots */
4
4
  export default class ScrollerSection extends SvelteComponentTyped<{
5
5
  theme?: "light" | "dark" | "lightblue";
6
+ id?: string;
6
7
  title?: string;
7
8
  hideTitle?: boolean;
8
- id?: string;
9
9
  }, {
10
10
  [evt: string]: CustomEvent<any>;
11
11
  }, {
@@ -19,9 +19,9 @@ import { SvelteComponentTyped } from "svelte";
19
19
  declare const __propDef: {
20
20
  props: {
21
21
  theme?: "light" | "dark" | "lightblue";
22
+ id?: string;
22
23
  title?: string;
23
24
  hideTitle?: boolean;
24
- id?: string;
25
25
  };
26
26
  events: {
27
27
  [evt: string]: CustomEvent<any>;
@@ -3,6 +3,8 @@
3
3
  /** @typedef {typeof __propDef.slots} SectionSlots */
4
4
  export default class Section extends SvelteComponentTyped<{
5
5
  theme?: "light" | "dark" | "lightblue";
6
+ id?: string;
7
+ cls?: string;
6
8
  background?: string;
7
9
  width?: "narrow" | "medium" | "wide" | "full";
8
10
  marginTop?: boolean;
@@ -10,7 +12,6 @@ export default class Section extends SvelteComponentTyped<{
10
12
  themeOverrides?: any;
11
13
  title?: string;
12
14
  hideTitle?: boolean;
13
- id?: string;
14
15
  }, {
15
16
  [evt: string]: CustomEvent<any>;
16
17
  }, {
@@ -24,6 +25,8 @@ import { SvelteComponentTyped } from "svelte";
24
25
  declare const __propDef: {
25
26
  props: {
26
27
  theme?: "light" | "dark" | "lightblue";
28
+ id?: string;
29
+ cls?: string;
27
30
  background?: string;
28
31
  width?: "narrow" | "medium" | "wide" | "full";
29
32
  marginTop?: boolean;
@@ -31,7 +34,6 @@ declare const __propDef: {
31
34
  themeOverrides?: object;
32
35
  title?: string;
33
36
  hideTitle?: boolean;
34
- id?: string;
35
37
  };
36
38
  events: {
37
39
  [evt: string]: CustomEvent<any>;
@@ -2,9 +2,9 @@
2
2
  /** @typedef {typeof __propDef.events} TabEvents */
3
3
  /** @typedef {typeof __propDef.slots} TabSlots */
4
4
  export default class Tab extends SvelteComponentTyped<{
5
+ id?: string;
5
6
  title?: string;
6
7
  hideTitle?: boolean;
7
- id?: string;
8
8
  }, {
9
9
  [evt: string]: CustomEvent<any>;
10
10
  }, {
@@ -17,9 +17,9 @@ export type TabSlots = typeof __propDef.slots;
17
17
  import { SvelteComponentTyped } from "svelte";
18
18
  declare const __propDef: {
19
19
  props: {
20
+ id?: string;
20
21
  title?: string;
21
22
  hideTitle?: boolean;
22
- id?: string;
23
23
  };
24
24
  events: {
25
25
  [evt: string]: CustomEvent<any>;
@@ -3,6 +3,8 @@
3
3
  /** @typedef {typeof __propDef.slots} ContainerSlots */
4
4
  export default class Container extends SvelteComponentTyped<{
5
5
  theme?: "light" | "dark" | "lightblue";
6
+ id?: string;
7
+ cls?: string;
6
8
  background?: string;
7
9
  width?: "narrow" | "medium" | "wide" | "full";
8
10
  height?: "full" | "auto" | "tall";
@@ -22,6 +24,8 @@ import { SvelteComponentTyped } from "svelte";
22
24
  declare const __propDef: {
23
25
  props: {
24
26
  theme?: "light" | "dark" | "lightblue";
27
+ id?: string;
28
+ cls?: string;
25
29
  background?: string;
26
30
  width?: "narrow" | "medium" | "wide" | "full";
27
31
  height?: "auto" | "tall" | "full";
@@ -3,6 +3,8 @@
3
3
  /** @typedef {typeof __propDef.slots} ThemeSlots */
4
4
  export default class Theme extends SvelteComponentTyped<{
5
5
  theme?: "light" | "dark" | "lightblue";
6
+ id?: string;
7
+ cls?: string;
6
8
  global?: boolean;
7
9
  overrides?: any;
8
10
  background?: string;
@@ -19,6 +21,8 @@ import { SvelteComponentTyped } from "svelte";
19
21
  declare const __propDef: {
20
22
  props: {
21
23
  theme?: "light" | "dark" | "lightblue";
24
+ id?: string;
25
+ cls?: string;
22
26
  global?: boolean;
23
27
  overrides?: object;
24
28
  background?: string;
package/dist/index.js CHANGED
@@ -10,6 +10,8 @@ export { default as AnalyticsBanner } from "./layout/AnalyticsBanner/AnalyticsBa
10
10
  export { analyticsEvent } from "./layout/AnalyticsBanner/AnalyticsBanner.svelte";
11
11
  export { default as Backlink } from "./layout/Backlink/Backlink.svelte";
12
12
  export { default as Breadcrumb } from "./layout/Breadcrumb/Breadcrumb.svelte";
13
+ export { default as Cards } from "./layout/Cards/Cards.svelte";
14
+ export { default as Card } from "./layout/Cards/Card.svelte";
13
15
  export { default as Contents } from "./layout/Contents/Contents.svelte";
14
16
  export { default as ErrorPage } from "./layout/ErrorPage/ErrorPage.svelte";
15
17
  export { default as Footer } from "./layout/Footer/Footer.svelte";
@@ -0,0 +1,85 @@
1
+ <script>
2
+ import { getContext } from "svelte";
3
+ import { slugify } from "../../js/utils";
4
+
5
+ export let title = "Card title";
6
+ export let id = slugify(title);
7
+ export let hideTitle = false;
8
+ export let image = "";
9
+ export let imageAlt = "";
10
+ export let href = "";
11
+
12
+ export let colspan = 1; // 1, 2 or 3
13
+ export let noBackground = getContext("noBackground") || false;
14
+ export let grow = false;
15
+
16
+ const cols = getContext("cols");
17
+ </script>
18
+
19
+ <div
20
+ class="{!noBackground ? 'tile tile__content' : ''}"
21
+ style:grid-column="span {grow && $cols < 3
22
+ ? $cols
23
+ : colspan == 1
24
+ ? 1
25
+ : colspan > $cols
26
+ ? $cols
27
+ : colspan}"
28
+ style:grid-column-end="{grow ? $cols + 1 : null}"
29
+ >
30
+ <div id="{id}" class="ons-card" aria-describedBy="{id}_text">
31
+ {#if href && title && !hideTitle}
32
+ <a href="{href}" class="ons-card__link ons-u-db">
33
+ {#if image}
34
+ <img
35
+ class="ons-card__image ons-u-mb-s"
36
+ style:width="100%"
37
+ src="{image}"
38
+ alt="{imageAlt}"
39
+ loading="lazy"
40
+ />
41
+ {/if}
42
+ <h3
43
+ class="ons-card__title ons-u-fs-m"
44
+ style:padding="{!noBackground && !image ? "12px 16px 0" : !noBackground ? "0 16px" : ""}"
45
+ >
46
+ {title}
47
+ </h3>
48
+ </a>
49
+ {:else if title && !hideTitle}
50
+ <h3
51
+ class="ons-card__title ons-u-fs-m"
52
+ style:padding="{!noBackground ? "8px 16px 0" : ""}"
53
+ style:margin-bottom="5px"
54
+ >
55
+ {title}
56
+ </h3>
57
+ {/if}
58
+ <div id="{id}_text" class:tile__body="{!noBackground}">
59
+ <slot />
60
+ </div>
61
+ </div>
62
+ </div>
63
+
64
+ <style>
65
+ .tile {
66
+ position: relative;
67
+ z-index: 0;
68
+ overflow: hidden;
69
+ box-shadow: 0 2px var(--muted, #4140424d);
70
+ }
71
+ .tile::before {
72
+ content: "";
73
+ position: absolute;
74
+ z-index: -1;
75
+ width: 100%;
76
+ height: 100%;
77
+ background-color: var(--hinted, hsl(240, 5%, 96%));
78
+ filter: contrast(calc(1 / 4)) brightness(1.6);
79
+ }
80
+ .tile__body {
81
+ padding: 0 16px 16px;
82
+ }
83
+ .ons-card__image {
84
+ margin-bottom: 12px !important;
85
+ }</style>
@@ -0,0 +1,95 @@
1
+ <script>
2
+ import { setContext } from "svelte";
3
+ import Grid from "../Grid/Grid.svelte";
4
+
5
+ /**
6
+ * (Optional) Sets the unique ID of the section
7
+ * @type {string}
8
+ */
9
+ export let id = null;
10
+ /**
11
+ * (Optional) Sets a css class for the component
12
+ * @type {string}
13
+ */
14
+ export let cls = "ons-cards";
15
+ /**
16
+ * Sets the width of the section
17
+ * @type {"narrow"|"medium"|"wide"|"full"}
18
+ */
19
+ export let width = "medium";
20
+ /**
21
+ * Sets the title of the section
22
+ * @type {string}
23
+ */
24
+ export let title = "";
25
+ /**
26
+ * Allows the h2 title tag for the section to be visually hidden
27
+ * @type {boolean}
28
+ */
29
+ export let hideTitle = false;
30
+ /**
31
+ * Sets a predefined theme
32
+ * @type {"light"|"dark"|"lightblue"}
33
+ */
34
+ export let theme = null;
35
+ /**
36
+ * Define additional props to override the base theme
37
+ * @type {object}
38
+ */
39
+ export let themeOverrides = null;
40
+ /**
41
+ * Optional margin above section
42
+ * @type {boolean}
43
+ */
44
+ export let marginTop = false;
45
+ /**
46
+ * Optional margin below section
47
+ * @type {boolean}
48
+ */
49
+ export let marginBottom = true;
50
+ /**
51
+ * Sets the width of the section
52
+ * @type {"narrow"|"medium"|"wide"|"full"}
53
+ */
54
+ export let colwidth = "medium"; // narrow | medium | wide | full
55
+ /**
56
+ * Set the minimum height of a grid row (can be a number in pixels, or a valid CSS height, like "100vh")
57
+ * @type {number|string}
58
+ */
59
+ export let height = 200; // pixel height or "full" for 100vh
60
+ /**
61
+ * Removes the backgroup on the cards
62
+ * @type {boolean}
63
+ */
64
+ export let noBackground = false;
65
+ /**
66
+ * Set the gap between cards, in pixels
67
+ * @type {number}
68
+ */
69
+ export let gap = noBackground ? 36 : 16;
70
+
71
+ setContext("noBackground", noBackground);
72
+ </script>
73
+
74
+ <Grid
75
+ id="{id}"
76
+ cls="{cls}"
77
+ width="{width}"
78
+ height="{height}"
79
+ title="{title}"
80
+ hideTitle="{hideTitle}"
81
+ theme="{theme}"
82
+ themeOverrides="{themeOverrides}"
83
+ marginTop="{marginTop}"
84
+ marginBottom="{marginBottom}"
85
+ colwidth="{colwidth}"
86
+ gap="{gap}"
87
+ >
88
+ <slot />
89
+ </Grid>
90
+
91
+ <style>
92
+ :global(.ons-cards h2.section-title) {
93
+ font-weight: normal;
94
+ margin-bottom: 12px;
95
+ }</style>
@@ -6,11 +6,26 @@
6
6
  * @type {string}
7
7
  */
8
8
  export let id = null;
9
+ /**
10
+ * (Optional) Sets a css class for the component
11
+ * @type {string}
12
+ */
13
+ export let cls = null;
9
14
  /**
10
15
  * Sets the width of the section
11
16
  * @type {"narrow"|"medium"|"wide"|"full"}
12
17
  */
13
18
  export let width = "medium";
19
+ /**
20
+ * Sets the title of the section
21
+ * @type {string}
22
+ */
23
+ export let title = "";
24
+ /**
25
+ * Allows the h2 title tag for the section to be visually hidden
26
+ * @type {boolean}
27
+ */
28
+ export let hideTitle = false;
14
29
  /**
15
30
  * Sets a predefined theme
16
31
  * @type {"light"|"dark"|"lightblue"}
@@ -57,8 +72,10 @@
57
72
  let gridGap = !Number.isNaN(gap) ? gap + "px" : gap;
58
73
  </script>
59
74
 
60
- <figure id="{id}" aria-label="{caption}">
75
+ <figure aria-label="{caption}">
61
76
  <Container
77
+ id="{id}"
78
+ cls="{cls}"
62
79
  theme="{theme}"
63
80
  themeOverrides="{themeOverrides}"
64
81
  width="{width}"
@@ -66,6 +83,9 @@
66
83
  marginTop="{marginTop}"
67
84
  marginBottom="{!caption ? marginBottom : false}"
68
85
  >
86
+ {#if title}
87
+ <h2 class="section-title" class:ons-u-vh="{hideTitle}">{title}</h2>
88
+ {/if}
69
89
  <div class="grid {gridClass}" style:grid-gap="{gridGap}" style:min-height="{rowHeight}">
70
90
  <slot />
71
91
  </div>
@@ -73,6 +93,7 @@
73
93
  {#if caption}
74
94
  <figcaption>
75
95
  <Container
96
+ cls="{cls}"
76
97
  theme="{theme}"
77
98
  themeOverrides="{themeOverrides}"
78
99
  width="narrow"
@@ -98,10 +119,10 @@
98
119
  margin: 0;
99
120
  }
100
121
  .grid-narrow {
101
- grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
122
+ grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
102
123
  }
103
124
  .grid-medium {
104
- grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
125
+ grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)) !important;
105
126
  }
106
127
  .grid-wide {
107
128
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)) !important;
@@ -7,6 +7,11 @@
7
7
  * @type {string}
8
8
  */
9
9
  export let id = null;
10
+ /**
11
+ * (Optional) Sets a css class for the section
12
+ * @type {string}
13
+ */
14
+ export let cls = null;
10
15
  /**
11
16
  * Sets the width of the section
12
17
  * @type {"narrow"|"medium"|"wide"|"full"}
@@ -50,13 +55,15 @@
50
55
  </script>
51
56
 
52
57
  <Container
58
+ id="{id}"
59
+ cls="{cls}"
53
60
  theme="{theme}"
54
61
  themeOverrides="{themeOverrides}"
55
62
  width="{width}"
56
63
  background="{background}"
57
64
  height="{height}"
58
65
  >
59
- <div id="{id}" class="ons-hero__details ons-grid__col ons-col-8@m ons-col-10@s@m">
66
+ <div class="ons-hero__details ons-grid__col ons-col-8@m ons-col-10@s@m">
60
67
  {#if title}
61
68
  <header>
62
69
  <h1 class="ons-hero__title ons-u-fs-xxxl">{title}</h1>
@@ -7,6 +7,11 @@
7
7
  * @type {string}
8
8
  */
9
9
  export let id = null;
10
+ /**
11
+ * (Optional) Sets a css class for the section
12
+ * @type {string}
13
+ */
14
+ export let cls = null;
10
15
  /**
11
16
  * Sets the width of the container
12
17
  * @type {"narrow"|"medium"|"wide"|"full"}
@@ -50,6 +55,8 @@
50
55
  </script>
51
56
 
52
57
  <Container
58
+ id="{id ? id : slugify(title)}"
59
+ cls="{cls}"
53
60
  theme="{theme}"
54
61
  themeOverrides="{themeOverrides}"
55
62
  width="{width}"
@@ -57,7 +64,7 @@
57
64
  marginBottom="{marginBottom}"
58
65
  background="{background}"
59
66
  >
60
- <section id="{id ? id : slugify(title)}" aria-label="{title}" class="ons-feature__section">
67
+ <section aria-label="{title}" class="ons-feature__section">
61
68
  {#if title}
62
69
  <h2 class="section-title" class:ons-u-vh="{hideTitle}">{title}</h2>
63
70
  {/if}
@@ -1,6 +1,16 @@
1
1
  <script>
2
2
  import Theme from "../Theme/Theme.svelte";
3
3
 
4
+ /**
5
+ * (Optional) Sets the unique ID of the container
6
+ * @type {string}
7
+ */
8
+ export let id = null;
9
+ /**
10
+ * (Optional) Sets a css class for the container
11
+ * @type {string}
12
+ */
13
+ export let cls = null;
4
14
  /**
5
15
  * Sets the width of the container
6
16
  * @type {"narrow"|"medium"|"wide"|"full"}
@@ -36,12 +46,22 @@
36
46
  * @type {string}
37
47
  */
38
48
  export let background = null;
49
+
50
+ $: _id = id && !(theme || background) ? id : null;
51
+ $: _cls = cls && !(theme || background) ? cls : "";
39
52
  </script>
40
53
 
41
54
  {#if width === "narrow"}
42
- <Theme theme="{theme}" background="{background}" overrides="{themeOverrides}">
55
+ <Theme
56
+ id="{id}"
57
+ cls="{cls}"
58
+ theme="{theme}"
59
+ background="{background}"
60
+ overrides="{themeOverrides}"
61
+ >
43
62
  <div
44
- class="ons-page__container ons-container"
63
+ id="{_id}"
64
+ class="ons-page__container ons-container {_cls}"
45
65
  class:ons-page__container--tall-height="{height === 'tall'}"
46
66
  class:ons-page__container--full-height="{height === 'full'}"
47
67
  >
@@ -53,9 +73,16 @@
53
73
  </div>
54
74
  </Theme>
55
75
  {:else}
56
- <Theme theme="{theme}" background="{background}" overrides="{themeOverrides}">
76
+ <Theme
77
+ id="{id}"
78
+ cls="{cls}"
79
+ theme="{theme}"
80
+ background="{background}"
81
+ overrides="{themeOverrides}"
82
+ >
57
83
  <div
58
- class="ons-page__container ons-container"
84
+ id="{_id}"
85
+ class="ons-page__container ons-container {_cls}"
59
86
  class:ons-page__container--wide="{width === 'wide'}"
60
87
  class:ons-page__container--full="{width === 'full'}"
61
88
  class:ons-page__container--tall-height="{height === 'tall'}"
@@ -9,7 +9,14 @@
9
9
  export let pymChild = null;
10
10
 
11
11
  onMount(() => {
12
- pymChild = new pym.Child({ polling: 1000 });
12
+ pymChild = new pym.Child();
13
+
14
+ setInterval(() => {
15
+ pymChild.sendMessage(
16
+ "height",
17
+ Math.max(document.body.scrollHeight, document.body.offsetHeight)
18
+ );
19
+ }, 1000);
13
20
  });
14
21
  </script>
15
22
 
@@ -1,8 +1,17 @@
1
1
  <script>
2
2
  import { setContext, getContext } from "svelte";
3
- import { writable } from "svelte/store";
4
3
  import themes from "./themes.js";
5
4
 
5
+ /**
6
+ * (Optional) Sets the unique ID of the container
7
+ * @type {string}
8
+ */
9
+ export let id = null;
10
+ /**
11
+ * (Optional) Sets a css class for the container
12
+ * @type {string}
13
+ */
14
+ export let cls = null;
6
15
  /**
7
16
  * Sets the body background to match this theme (only use this at the top level)
8
17
  * @type {boolean}
@@ -54,7 +63,7 @@
54
63
  </svelte:head>
55
64
 
56
65
  {#if style}
57
- <div class="theme-wrapper" style="{style}">
66
+ <div id="{id}" class="{cls ? `theme-wrapper ${cls}` : 'theme-wrapper'}" style="{style}">
58
67
  <slot />
59
68
  </div>
60
69
  {:else}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onsvisual/svelte-components",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "homepage": "https://onsvisual.github.io/svelte-components",
@@ -143,6 +143,8 @@
143
143
  "./layout/AnalyticsBanner/AnalyticsBanner.svelte": "./dist/layout/AnalyticsBanner/AnalyticsBanner.svelte",
144
144
  "./layout/Backlink/Backlink.svelte": "./dist/layout/Backlink/Backlink.svelte",
145
145
  "./layout/Breadcrumb/Breadcrumb.svelte": "./dist/layout/Breadcrumb/Breadcrumb.svelte",
146
+ "./layout/Cards/Card.svelte": "./dist/layout/Cards/Card.svelte",
147
+ "./layout/Cards/Cards.svelte": "./dist/layout/Cards/Cards.svelte",
146
148
  "./layout/Contents/Contents.svelte": "./dist/layout/Contents/Contents.svelte",
147
149
  "./layout/ErrorPage/ErrorPage.svelte": "./dist/layout/ErrorPage/ErrorPage.svelte",
148
150
  "./layout/Footer/Footer.svelte": "./dist/layout/Footer/Footer.svelte",