@tuspe/components 1.7.18 → 1.7.20

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.
package/README.md CHANGED
@@ -77,10 +77,11 @@ Arrow icons for navigation, such as image sliders or content transitions.
77
77
 
78
78
  ```TypeScript
79
79
  interface Props {
80
- onclick?: () => any
81
80
  ariaLabel: string
82
81
  color?: string
83
82
  direction: 'left' | 'right'
83
+ id?: string
84
+ onclick?: () => any
84
85
  }
85
86
  ```
86
87
 
@@ -94,7 +95,8 @@ Close button for modals and other dismissible elements.
94
95
  color?: string
95
96
  hover?: 'black' | 'primary' | 'secondary' | 'success' | 'transparent'
96
97
  hoverText?: 'black' | 'primary' | 'secondary' | 'white'
97
- onclick: () => any
98
+ id?: string
99
+ onclick?: any
98
100
  }
99
101
  ```
100
102
 
@@ -104,12 +106,13 @@ A button for toggling the mobile menu, dynamically changing its icon based on th
104
106
 
105
107
  ```TypeScript
106
108
  interface Props {
107
- onclick?: () => any
108
109
  ariaControls: string
109
110
  ariaLabel: string
110
111
  color?: 'black' | 'white'
111
112
  extraClass?: string
112
113
  hidden?: boolean
114
+ id?: string
115
+ onclick?: () => any
113
116
  open: boolean
114
117
  }
115
118
  ```
@@ -114,7 +114,7 @@
114
114
  </script>
115
115
 
116
116
  {#if href}
117
- <a {href} class={classes} {target} data-sveltekit-preload-data={preload} rel="nofollow noopener">
117
+ <a class={classes} {href} {id} {target} data-sveltekit-preload-data={preload} rel="nofollow noopener">
118
118
  {@render children?.()}
119
119
  </a>
120
120
  {:else if control}
@@ -1,15 +1,16 @@
1
1
  <script lang="ts">
2
2
  import Button from './Button.svelte'
3
3
  interface Props {
4
- onclick?: () => any
5
4
  ariaLabel: string
6
5
  color?: string
7
6
  direction: 'left' | 'right'
7
+ id?: string
8
+ onclick?: () => any
8
9
  }
9
- let {onclick, ariaLabel, color = 'black', direction}: Props = $props()
10
+ let {onclick, ariaLabel, color = 'black', direction, id}: Props = $props()
10
11
  </script>
11
12
 
12
- <Button {color} {onclick} {ariaLabel} control>
13
+ <Button {ariaLabel} control {color} {id} {onclick}>
13
14
  <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24">
14
15
  <title>Arrow {direction}</title>
15
16
  {#if direction === 'left'}
@@ -1,8 +1,9 @@
1
1
  interface Props {
2
- onclick?: () => any;
3
2
  ariaLabel: string;
4
3
  color?: string;
5
4
  direction: 'left' | 'right';
5
+ id?: string;
6
+ onclick?: () => any;
6
7
  }
7
8
  declare const ButtonArrow: import("svelte").Component<Props, {}, "">;
8
9
  type ButtonArrow = ReturnType<typeof ButtonArrow>;
@@ -6,14 +6,15 @@
6
6
  color?: string
7
7
  hover?: 'black' | 'primary' | 'secondary' | 'success' | 'transparent'
8
8
  hoverText?: 'black' | 'primary' | 'secondary' | 'white'
9
+ id?: string
9
10
  onclick?: any
10
11
  }
11
12
 
12
- let {ariaLabel, color = 'white', hover = 'transparent', onclick}: Props = $props()
13
+ let {ariaLabel, color = 'white', hover = 'transparent', id, onclick}: Props = $props()
13
14
  </script>
14
15
 
15
16
  <div class="close-button">
16
- <Button {ariaLabel} {color} {onclick} control fill {hover}>
17
+ <Button {ariaLabel} {color} {onclick} control fill {hover} {id}>
17
18
  <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" aria-hidden="true" fill={color}>
18
19
  <title>Close</title>
19
20
  <path
@@ -3,6 +3,7 @@ interface Props {
3
3
  color?: string;
4
4
  hover?: 'black' | 'primary' | 'secondary' | 'success' | 'transparent';
5
5
  hoverText?: 'black' | 'primary' | 'secondary' | 'white';
6
+ id?: string;
6
7
  onclick?: any;
7
8
  }
8
9
  declare const ButtonClose: import("svelte").Component<Props, {}, "">;
@@ -1,22 +1,23 @@
1
1
  <script lang="ts">
2
2
  import Button from './Button.svelte'
3
3
  interface Props {
4
- onclick?: () => any
5
4
  ariaControls: string
6
5
  ariaLabel: string
7
6
  color?: 'black' | 'white'
8
7
  extraClass?: string
9
8
  hidden?: boolean
9
+ id?: string
10
+ onclick?: () => any
10
11
  open: boolean
11
12
  }
12
- let {ariaControls, ariaLabel, color = 'white', extraClass, hidden = false, open = $bindable()}: Props = $props()
13
+ let {ariaControls, ariaLabel, color = 'white', extraClass, hidden = false, id, open = $bindable()}: Props = $props()
13
14
  const handleOpen = () => {
14
15
  open = !open
15
16
  }
16
17
  </script>
17
18
 
18
19
  <div id="menu-button" class={extraClass} class:hidden>
19
- <Button onclick={handleOpen} {ariaControls} ariaPopup="menu" ariaExpanded={open} {ariaLabel} {color} control fill>
20
+ <Button onclick={handleOpen} {ariaControls} ariaPopup="menu" ariaExpanded={open} {ariaLabel} {color} control fill {id}>
20
21
  <svg
21
22
  fill={color}
22
23
  clip-rule="evenodd"
@@ -1,10 +1,11 @@
1
1
  interface Props {
2
- onclick?: () => any;
3
2
  ariaControls: string;
4
3
  ariaLabel: string;
5
4
  color?: 'black' | 'white';
6
5
  extraClass?: string;
7
6
  hidden?: boolean;
7
+ id?: string;
8
+ onclick?: () => any;
8
9
  open: boolean;
9
10
  }
10
11
  declare const ButtonMenu: import("svelte").Component<Props, {}, "open">;
@@ -16,7 +16,7 @@
16
16
  }
17
17
 
18
18
  let {
19
- colorBg = 'transparent',
19
+ colorBg = 'bg-transparent',
20
20
  disabled,
21
21
  id,
22
22
  innerClass,
@@ -28,7 +28,7 @@
28
28
  value = $bindable(),
29
29
  values
30
30
  }: Props = $props(),
31
- classes = $state(`bg-${colorBg}`)
31
+ classes = $state(colorBg)
32
32
  if (innerClass) {
33
33
  classes += ' ' + innerClass
34
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuspe/components",
3
- "version": "1.7.18",
3
+ "version": "1.7.20",
4
4
  "description": "A reusable SvelteKit component library for form elements, breadcrumbs, prices and images.",
5
5
  "keywords": [
6
6
  "svelteKit",
@@ -63,7 +63,7 @@
63
63
  "@eslint/compat": "^1.2.7",
64
64
  "@eslint/js": "^9.22.0",
65
65
  "@sveltejs/adapter-static": "^3.0.8",
66
- "@sveltejs/kit": "^2.19.0",
66
+ "@sveltejs/kit": "^2.19.1",
67
67
  "@sveltejs/package": "^2.3.10",
68
68
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
69
69
  "eslint-config-prettier": "^10.1.1",
@@ -77,6 +77,6 @@
77
77
  "svelte": "^5.23.0",
78
78
  "typescript-eslint": "^8.26.1",
79
79
  "typescript": "^5.8.2",
80
- "vite": "^6.2.1"
80
+ "vite": "^6.2.2"
81
81
  }
82
- }
82
+ }