@functionalcms/svelte-components 4.2.10 → 4.2.12

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.
@@ -29,40 +29,35 @@
29
29
  let buttonCss = $derived(cn('hamburger-handle', css.buttonCss ?? ''));
30
30
 
31
31
  $inspect(isOpen);
32
- function toggleDrawer(){
32
+ function toggleDrawer() {
33
33
  isOpen = !isOpen;
34
34
  }
35
+
36
+ const close = () => (isOpen = false);
35
37
  </script>
36
38
 
37
- <Button
38
- type="button"
39
- isPrimary
40
- css={buttonCss}
41
- onclick={() => toggleDrawer()}
42
- >
43
- &#9776;
44
- </Button>
39
+ <Button type="button" isPrimary css={buttonCss} onclick={() => toggleDrawer()}>&#9776;</Button>
45
40
 
46
41
  <Drawer {placement} open={isOpen} clickAway={() => isOpen != isOpen}>
47
- <Button css="close" onclick={() => isOpen = false}>X</Button>
48
- <ListMenu {localPages} {css}>
49
- </ListMenu>
42
+ <div class="flex flex-row justify-between">
43
+ <ListMenu {localPages} {css} onclick={() => close()}></ListMenu>
44
+ <Button css="close" onclick={() => close()}>X</Button>
45
+ </div>
50
46
  </Drawer>
51
47
 
52
48
  <style>
53
49
  :global(#hamburger-menu) {
54
50
  z-index: 10001;
55
51
  }
56
- :global(.hamburger-handle){
57
- background: none;
58
- border: none;
52
+ :global(.hamburger-handle) {
53
+ background: none !important;
54
+ border: none !important;
59
55
  }
60
- :global(.btn.close){
56
+ :global(.btn.close) {
61
57
  position: fixed;
62
58
  top: var(--hamburger-menu-margin, 25px);
63
59
  right: var(--hamburger-menu-margin, 25px);
64
- background: none;
65
- border: none;
60
+ background: none !important;
61
+ border: none !important;
66
62
  }
67
63
  </style>
68
-
@@ -16,6 +16,7 @@
16
16
  css?: CssProps;
17
17
  orientation?: Orientation;
18
18
  includeSubpagesForSelect?: boolean;
19
+ onclick: () => void;
19
20
  }
20
21
 
21
22
  let {
@@ -23,7 +24,8 @@
23
24
  css = { container: '', link: '' },
24
25
  localPages = [],
25
26
  orientation = Orientation.Column,
26
- includeSubpagesForSelect = true
27
+ includeSubpagesForSelect = true,
28
+ onclick = () => {}
27
29
  }: Props = $props();
28
30
 
29
31
  let containerCss = cn('flex', orientation, css.container ?? '');
@@ -38,7 +40,7 @@
38
40
  role="none"
39
41
  >
40
42
  <span class="screenreader-only">Navigate to {pageItem.name}</span>
41
- <a href={pageItem.path} role="menuitem">
43
+ <a href={pageItem.path} role="menuitem" onclick={onclick}>
42
44
  {pageItem.name}
43
45
  </a>
44
46
 
@@ -11,6 +11,7 @@ interface Props {
11
11
  css?: CssProps;
12
12
  orientation?: Orientation;
13
13
  includeSubpagesForSelect?: boolean;
14
+ onclick: () => void;
14
15
  }
15
16
  declare const ListMenu: import("svelte").Component<Props, {}, "">;
16
17
  type ListMenu = ReturnType<typeof ListMenu>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functionalcms/svelte-components",
3
- "version": "4.2.10",
3
+ "version": "4.2.12",
4
4
  "watch": {
5
5
  "build": {
6
6
  "patterns": [