@tuspe/components 1.7.19 → 1.7.21

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
@@ -28,6 +28,8 @@ A breadcrumb navigation provide links back to previous pages, and shows the user
28
28
  interface Props {
29
29
  homeName?: string
30
30
  homeSlug?: string
31
+ onlyMeta?: boolean
32
+ outerClass?: string
31
33
  values: Breadcrumb[]
32
34
  }
33
35
  ```
@@ -77,10 +79,11 @@ Arrow icons for navigation, such as image sliders or content transitions.
77
79
 
78
80
  ```TypeScript
79
81
  interface Props {
80
- onclick?: () => any
81
82
  ariaLabel: string
82
83
  color?: string
83
84
  direction: 'left' | 'right'
85
+ id?: string
86
+ onclick?: () => any
84
87
  }
85
88
  ```
86
89
 
@@ -94,7 +97,8 @@ Close button for modals and other dismissible elements.
94
97
  color?: string
95
98
  hover?: 'black' | 'primary' | 'secondary' | 'success' | 'transparent'
96
99
  hoverText?: 'black' | 'primary' | 'secondary' | 'white'
97
- onclick: () => any
100
+ id?: string
101
+ onclick?: any
98
102
  }
99
103
  ```
100
104
 
@@ -104,12 +108,13 @@ A button for toggling the mobile menu, dynamically changing its icon based on th
104
108
 
105
109
  ```TypeScript
106
110
  interface Props {
107
- onclick?: () => any
108
111
  ariaControls: string
109
112
  ariaLabel: string
110
113
  color?: 'black' | 'white'
111
114
  extraClass?: string
112
115
  hidden?: boolean
116
+ id?: string
117
+ onclick?: () => any
113
118
  open: boolean
114
119
  }
115
120
  ```
@@ -6,18 +6,19 @@
6
6
  interface Props {
7
7
  homeName?: string
8
8
  homeSlug?: string
9
+ onlyMeta?: boolean
9
10
  outerClass?: string
10
11
  values: Breadcrumb[]
11
12
  }
12
13
 
13
- let {homeName = 'Etusivu', homeSlug = '', outerClass, values}: Props = $props(),
14
+ let {homeName = 'Etusivu', homeSlug = '', onlyMeta = false, outerClass, values}: Props = $props(),
14
15
  classes = $state('truncate')
15
16
 
16
17
  const origin = page.url.origin + '/'
17
18
 
18
19
  let originWithSlug = $state(origin + homeSlug),
19
20
  listItems = $derived<Breadcrumb[]>(
20
- Array.isArray(values) && values.length > 0
21
+ validateArray(values)
21
22
  ? [
22
23
  {
23
24
  '@type': 'ListItem',
@@ -51,7 +52,7 @@
51
52
  {/if}
52
53
  </svelte:head>
53
54
 
54
- {#if validateArray(listItems)}
55
+ {#if !onlyMeta && validateArray(listItems)}
55
56
  <div class={classes}>
56
57
  <ol id="breadcrumb" class="max-w-screen-xl mx-auto my-0 px-4 py-2" vocab="https://schema.org/" typeof="BreadcrumbList">
57
58
  {#each listItems as page}
@@ -2,6 +2,7 @@ import { type Breadcrumb } from './';
2
2
  interface Props {
3
3
  homeName?: string;
4
4
  homeSlug?: string;
5
+ onlyMeta?: boolean;
5
6
  outerClass?: string;
6
7
  values: Breadcrumb[];
7
8
  }
@@ -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">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuspe/components",
3
- "version": "1.7.19",
3
+ "version": "1.7.21",
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
  }