@sierra-95/svelte-scaffold 1.0.20 → 1.0.22

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,5 +1,5 @@
1
- <script>
2
- import {isMobile} from '../../../../index.js';
1
+ <script lang="ts">
2
+ import {buttonRipple} from '../../../../index.js';
3
3
  import GridIcon from './gridIcon.svelte';
4
4
  import './header.css';
5
5
  const {
@@ -11,16 +11,18 @@
11
11
  headerCenterContent,
12
12
  headerRightContent,
13
13
  dashboardMenuColor,
14
- dashboardMenuSize
14
+ dashboardMenuSize,
15
+ dashboardMenu,
15
16
  } = $props();
17
+
18
+ function conditionalRipple(node: HTMLElement) {
19
+ if (dashboardMenu) {
20
+ return buttonRipple(node);
21
+ }
22
+ }
16
23
  </script>
17
24
  <header id='sierra-header'>
18
25
  <div style="display: flex; align-items: center; gap: 1rem;">
19
- <!-- <button aria-label="Toggle menu" style="cursor: pointer; margin-left: 0.5rem; {$isMobile ? '':'display:none;'}" onclick={toggleMenu}>
20
- <div class="bar"></div>
21
- <div class="bar"></div>
22
- <div class="bar"></div>
23
- </button> -->
24
26
  <a href={headerLink} style="display: flex; align-items: center; gap: 0.5rem; color: inherit; margin-left: 1rem;'}">
25
27
  {#if headerImage}
26
28
  <img style="--header-image-size : {headerImageSize}" src={headerImage} alt="Logo"/>
@@ -33,6 +35,14 @@
33
35
  <div>{@render headerCenterContent?.()}</div>
34
36
  <div style="display: flex; gap: 1rem; align-items: center;">
35
37
  {@render headerRightContent?.()}
36
- <button onclick={toggleMenu} title="Menu" style="margin-right: 1rem;"><GridIcon {dashboardMenuColor} {dashboardMenuSize} /></button>
38
+ <button use:conditionalRipple onclick={toggleMenu} title="Menu" style="margin-right: 1rem;">
39
+ {#if dashboardMenu}
40
+ <GridIcon {dashboardMenuColor} {dashboardMenuSize} />
41
+ {:else}
42
+ <div class="bar"></div>
43
+ <div class="bar"></div>
44
+ <div class="bar"></div>
45
+ {/if}
46
+ </button>
37
47
  </div>
38
48
  </header>
@@ -1,8 +1,4 @@
1
- export default Header;
2
- type Header = {
3
- $on?(type: string, callback: (e: any) => void): () => void;
4
- $set?(props: Partial<$$ComponentProps>): void;
5
- };
1
+ import './header.css';
6
2
  declare const Header: import("svelte").Component<{
7
3
  headerTitle: any;
8
4
  headerLink: any;
@@ -13,15 +9,7 @@ declare const Header: import("svelte").Component<{
13
9
  headerRightContent: any;
14
10
  dashboardMenuColor: any;
15
11
  dashboardMenuSize: any;
12
+ dashboardMenu: any;
16
13
  }, {}, "">;
17
- type $$ComponentProps = {
18
- headerTitle: any;
19
- headerLink: any;
20
- headerImage: any;
21
- headerImageSize: any;
22
- toggleMenu?: any;
23
- headerCenterContent: any;
24
- headerRightContent: any;
25
- dashboardMenuColor: any;
26
- dashboardMenuSize: any;
27
- };
14
+ type Header = ReturnType<typeof Header>;
15
+ export default Header;
@@ -18,8 +18,9 @@
18
18
  headerCenterContent = null,
19
19
  headerRightContent = null,
20
20
  paddingOff = false,
21
+ dashboardMenu = false,
21
22
  dashboardMenuColor = 'var(--text)',
22
- dashboardMenuSize = "35px"
23
+ dashboardMenuSize = "30px",
23
24
  } = $props();
24
25
 
25
26
 
@@ -81,6 +82,7 @@
81
82
  {headerRightContent}
82
83
  {dashboardMenuColor}
83
84
  {dashboardMenuSize}
85
+ {dashboardMenu}
84
86
  />
85
87
  {#if $isLoading}<LinearProgress />{/if}
86
88
  <div id="sierra-layout">
@@ -14,6 +14,7 @@ declare const Main: import("svelte").Component<{
14
14
  headerCenterContent?: any;
15
15
  headerRightContent?: any;
16
16
  paddingOff?: boolean;
17
+ dashboardMenu?: boolean;
17
18
  dashboardMenuColor?: string;
18
19
  dashboardMenuSize?: string;
19
20
  }, {}, "">;
@@ -28,6 +29,7 @@ type $$ComponentProps = {
28
29
  headerCenterContent?: any;
29
30
  headerRightContent?: any;
30
31
  paddingOff?: boolean;
32
+ dashboardMenu?: boolean;
31
33
  dashboardMenuColor?: string;
32
34
  dashboardMenuSize?: string;
33
35
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sierra-95/svelte-scaffold",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",