@functionalcms/svelte-components 0.4.1 → 0.6.0

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.
@@ -1,6 +1,7 @@
1
1
  <script>
2
2
  // @ts-nocheck
3
- import { Header, HeaderNav, HeaderNavItem } from 'agnostic-svelte';
3
+ import { Header, HeaderNav, HeaderNavItem, MenuItem } from 'agnostic-svelte';
4
+ import { HeaderNavigationItem } from './HeaderNavigationItem';
4
5
 
5
6
  /**
6
7
  * @type {string}
@@ -11,7 +12,7 @@
11
12
  */
12
13
  export let logoUrl;
13
14
  /**
14
- * @type {array}
15
+ * @type {HeaderNavigationItem[]}
15
16
  */
16
17
  export let pages;
17
18
  </script>
@@ -23,10 +24,10 @@
23
24
  <img src={logoUrl} alt={companyName} />
24
25
  </a>
25
26
  </div>
26
- <HeaderNav css="nav-overrides">
27
+ <HeaderNav>
27
28
  {#each pages as page}
28
29
  <HeaderNavItem>
29
- <a href={page.path}>
30
+ <a on:click={page.action} href={page.path}>
30
31
  {page.name}
31
32
  </a>
32
33
  </HeaderNavItem>
@@ -4,7 +4,7 @@
4
4
  export default class Header extends SvelteComponent<{
5
5
  companyName: string;
6
6
  logoUrl: string;
7
- pages: any;
7
+ pages: HeaderNavigationItem[];
8
8
  }, {
9
9
  [evt: string]: CustomEvent<any>;
10
10
  }, {}> {
@@ -12,12 +12,13 @@ export default class Header extends SvelteComponent<{
12
12
  export type HeaderProps = typeof __propDef.props;
13
13
  export type HeaderEvents = typeof __propDef.events;
14
14
  export type HeaderSlots = typeof __propDef.slots;
15
+ import { HeaderNavigationItem } from './HeaderNavigationItem';
15
16
  import { SvelteComponent } from "svelte";
16
17
  declare const __propDef: {
17
18
  props: {
18
19
  companyName: string;
19
20
  logoUrl: string;
20
- pages: any;
21
+ pages: HeaderNavigationItem[];
21
22
  };
22
23
  events: {
23
24
  [evt: string]: CustomEvent<any>;
@@ -0,0 +1,7 @@
1
+ type ClickAction = () => void;
2
+ export declare class HeaderNavigationItem {
3
+ name: string;
4
+ path: string | undefined;
5
+ action: ClickAction | undefined;
6
+ }
7
+ export {};
@@ -0,0 +1,5 @@
1
+ export class HeaderNavigationItem {
2
+ name;
3
+ path;
4
+ action;
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functionalcms/svelte-components",
3
- "version": "0.4.1",
3
+ "version": "0.6.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },