@functionalcms/svelte-components 4.2.11 → 4.2.13

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.
@@ -25,6 +25,7 @@
25
25
  ariaSelected?: boolean;
26
26
  ariaControls?: string;
27
27
  tabIndex?: number;
28
+ ariaLabel: string;
28
29
  click?: () => void;
29
30
  keydown?: (e: KeyboardEvent) => void;
30
31
  }
@@ -54,6 +55,7 @@
54
55
  tabIndex = 0,
55
56
  click = undefined,
56
57
  keydown = undefined,
58
+ ariaLabel = '',
57
59
  ...restProps
58
60
  }: Partial<Props> = $props();
59
61
 
@@ -86,6 +88,7 @@
86
88
  {role}
87
89
  aria-selected={ariaSelected}
88
90
  aria-controls={ariaControls}
91
+ aria-label={ariaLabel}
89
92
  tabindex={tabIndex}
90
93
  onclick={onclick}
91
94
  onkeydown={onkeydown}
@@ -101,6 +104,7 @@
101
104
  {role}
102
105
  aria-selected={ariaSelected}
103
106
  aria-controls={ariaControls}
107
+ aria-label={ariaLabel}
104
108
  tabindex={tabIndex}
105
109
  disabled={isDisabled}
106
110
  onclick={onclick}
@@ -22,6 +22,7 @@ declare const Button: import("svelte").Component<Partial<{
22
22
  ariaSelected?: boolean;
23
23
  ariaControls?: string;
24
24
  tabIndex?: number;
25
+ ariaLabel: string;
25
26
  click?: () => void;
26
27
  keydown?: (e: KeyboardEvent) => void;
27
28
  }>, {}, "">;
@@ -29,37 +29,31 @@
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
35
 
36
- const close = () => isOpen = false;
36
+ const close = () => (isOpen = false);
37
37
  </script>
38
38
 
39
- <Button
40
- type="button"
41
- isPrimary
42
- css={buttonCss}
43
- onclick={() => toggleDrawer()}
44
- >
45
- &#9776;
46
- </Button>
39
+ <Button type="button" isPrimary css={buttonCss} onclick={() => toggleDrawer()}>&#9776;</Button>
47
40
 
48
41
  <Drawer {placement} open={isOpen} clickAway={() => isOpen != isOpen}>
49
- <Button css="close" onclick={() => close()}>X</Button>
50
- <ListMenu {localPages} {css} onclick={() =>close()}>
51
- </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>
52
46
  </Drawer>
53
47
 
54
48
  <style>
55
49
  :global(#hamburger-menu) {
56
50
  z-index: 10001;
57
51
  }
58
- :global(.hamburger-handle){
52
+ :global(.hamburger-handle) {
59
53
  background: none !important;
60
54
  border: none !important;
61
55
  }
62
- :global(.btn.close){
56
+ :global(.btn.close) {
63
57
  position: fixed;
64
58
  top: var(--hamburger-menu-margin, 25px);
65
59
  right: var(--hamburger-menu-margin, 25px);
@@ -67,4 +61,3 @@
67
61
  border: none !important;
68
62
  }
69
63
  </style>
70
-
@@ -48,6 +48,7 @@
48
48
  <Button
49
49
  type="button"
50
50
  css="carousel__prev"
51
+ ariaLabel="Previous item on Carousele"
51
52
  style="order: -1 !important;width: 50px;height: 100%;background: none;border: none !important;align-self: center;"
52
53
  onclick={() => embla.scrollPrev()}
53
54
  >
@@ -71,6 +72,7 @@
71
72
  <Button
72
73
  type="button"
73
74
  css="carousel__next"
75
+ ariaLabel="Next item on Carousele"
74
76
  style="order: 1000 !important;width: 50px;height: 100%;background: none; border: none !important;align-self: center;"
75
77
  onclick={() => embla.scrollNext()}
76
78
  >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functionalcms/svelte-components",
3
- "version": "4.2.11",
3
+ "version": "4.2.13",
4
4
  "watch": {
5
5
  "build": {
6
6
  "patterns": [