@tuspe/components 1.8.0 → 1.8.2

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
@@ -42,8 +42,8 @@ Easily replace most buttons in your project with this versatile button component
42
42
  interface Props {
43
43
  ariaControls?: string | undefined
44
44
  ariaExpanded?: boolean | undefined
45
- ariaLabel?: string
46
- ariaPopup?: 'dialog' | 'menu' | 'listbox' | undefined
45
+ ariaLabel?: string | undefined
46
+ ariaPopup?: 'dialog' | 'listbox' | 'menu' | undefined
47
47
  borderColor?: 'content' | 'default' | 'primary'
48
48
  borderSize?: 0 | 1 | 2
49
49
  children: Snippet
@@ -64,9 +64,11 @@ Easily replace most buttons in your project with this versatile button component
64
64
  noPadding?: boolean
65
65
  onclick?: any
66
66
  preload?: 'hover' | 'tap'
67
+ rel?: string
67
68
  role?: string
68
69
  rounded?: 'full' | 'lg' | 'none' | 'sm'
69
70
  target?: '_blank' | '_top' | undefined
71
+ title?: string | undefined
70
72
  type?: 'submit'
71
73
  uppercase?: boolean
72
74
  value?: string | number
@@ -109,13 +111,13 @@ A button for toggling the mobile menu, dynamically changing its icon based on th
109
111
  ```TypeScript
110
112
  interface Props {
111
113
  ariaControls: string
112
- ariaLabel: string
113
114
  color?: 'black' | 'white'
114
115
  extraClass?: string
115
116
  hidden?: boolean
116
117
  id?: string
117
118
  onclick?: () => any
118
119
  open: boolean
120
+ title: string
119
121
  }
120
122
  ```
121
123
 
@@ -5,7 +5,7 @@
5
5
  interface Props {
6
6
  ariaControls?: string | undefined
7
7
  ariaExpanded?: boolean | undefined
8
- ariaLabel?: string
8
+ ariaLabel?: string | undefined
9
9
  ariaPopup?: 'dialog' | 'listbox' | 'menu' | undefined
10
10
  borderColor?: 'content' | 'default' | 'primary'
11
11
  borderSize?: 0 | 1 | 2
@@ -27,9 +27,11 @@
27
27
  noPadding?: boolean
28
28
  onclick?: any
29
29
  preload?: 'hover' | 'tap'
30
+ rel?: string
30
31
  role?: string
31
32
  rounded?: 'full' | 'lg' | 'none' | 'sm'
32
33
  target?: '_blank' | '_top' | undefined
34
+ title?: string | undefined
33
35
  type?: 'submit'
34
36
  uppercase?: boolean
35
37
  value?: string | number
@@ -60,9 +62,11 @@
60
62
  noPadding,
61
63
  onclick = undefined,
62
64
  preload,
65
+ rel = 'noopener noreferrer',
63
66
  role,
64
67
  rounded = 'sm',
65
68
  target,
69
+ title,
66
70
  type,
67
71
  uppercase = true,
68
72
  value
@@ -114,7 +118,7 @@
114
118
  </script>
115
119
 
116
120
  {#if href}
117
- <a class={classes} {href} {id} {target} data-sveltekit-preload-data={preload} rel="nofollow noopener">
121
+ <a class={classes} {href} {id} {target} data-sveltekit-preload-data={preload} {rel} {title}>
118
122
  {@render children?.()}
119
123
  </a>
120
124
  {:else if control}
@@ -122,6 +126,7 @@
122
126
  {id}
123
127
  {onclick}
124
128
  {role}
129
+ {title}
125
130
  {value}
126
131
  aria-controls={ariaControls}
127
132
  aria-expanded={ariaExpanded}
@@ -133,7 +138,7 @@
133
138
  {@render children?.()}
134
139
  </button>
135
140
  {:else}
136
- <button {onclick} class={classes} {disabled} {type}>
141
+ <button {onclick} class={classes} {disabled} {title} {type}>
137
142
  {@render children?.()}
138
143
  </button>
139
144
  {/if}
@@ -2,7 +2,7 @@ import type { Snippet } from 'svelte';
2
2
  interface Props {
3
3
  ariaControls?: string | undefined;
4
4
  ariaExpanded?: boolean | undefined;
5
- ariaLabel?: string;
5
+ ariaLabel?: string | undefined;
6
6
  ariaPopup?: 'dialog' | 'listbox' | 'menu' | undefined;
7
7
  borderColor?: 'content' | 'default' | 'primary';
8
8
  borderSize?: 0 | 1 | 2;
@@ -24,9 +24,11 @@ interface Props {
24
24
  noPadding?: boolean;
25
25
  onclick?: any;
26
26
  preload?: 'hover' | 'tap';
27
+ rel?: string;
27
28
  role?: string;
28
29
  rounded?: 'full' | 'lg' | 'none' | 'sm';
29
30
  target?: '_blank' | '_top' | undefined;
31
+ title?: string | undefined;
30
32
  type?: 'submit';
31
33
  uppercase?: boolean;
32
34
  value?: string | number;
@@ -2,22 +2,22 @@
2
2
  import Button from './Button.svelte'
3
3
  interface Props {
4
4
  ariaControls: string
5
- ariaLabel: string
6
5
  color?: 'black' | 'white'
7
6
  extraClass?: string
8
7
  hidden?: boolean
9
8
  id?: string
10
9
  onclick?: () => any
11
10
  open: boolean
11
+ title: string
12
12
  }
13
- let {ariaControls, ariaLabel, color = 'white', extraClass, hidden = false, id, open = $bindable()}: Props = $props()
13
+ let {ariaControls, title, color = 'white', extraClass, hidden = false, id, open = $bindable()}: Props = $props()
14
14
  const handleOpen = () => {
15
15
  open = !open
16
16
  }
17
17
  </script>
18
18
 
19
19
  <div id="menu-button" class={extraClass} class:hidden>
20
- <Button onclick={handleOpen} {ariaControls} ariaPopup="menu" ariaExpanded={open} {ariaLabel} {color} control fill {id}>
20
+ <Button onclick={handleOpen} {ariaControls} ariaPopup="menu" ariaExpanded={open} {title} {color} control fill {id}>
21
21
  <svg
22
22
  fill={color}
23
23
  clip-rule="evenodd"
@@ -1,12 +1,12 @@
1
1
  interface Props {
2
2
  ariaControls: string;
3
- ariaLabel: string;
4
3
  color?: 'black' | 'white';
5
4
  extraClass?: string;
6
5
  hidden?: boolean;
7
6
  id?: string;
8
7
  onclick?: () => any;
9
8
  open: boolean;
9
+ title: string;
10
10
  }
11
11
  declare const ButtonMenu: import("svelte").Component<Props, {}, "open">;
12
12
  type ButtonMenu = ReturnType<typeof ButtonMenu>;
package/dist/Input.svelte CHANGED
@@ -38,8 +38,6 @@
38
38
  value = $bindable()
39
39
  }: Props = $props()
40
40
 
41
- let isDisabled = $state(disabled || $loading)
42
-
43
41
  let classes = $state('')
44
42
  if (inputClass) {
45
43
  classes = inputClass
@@ -56,10 +54,18 @@
56
54
  {label}{#if required}<sup>*</sup>{/if}
57
55
 
58
56
  {#if type === 'textarea'}
59
- <textarea bind:value class={classes} disabled={isDisabled} {id} maxlength={max ? Number(max) : undefined} {required} {placeholder} rows={4}
57
+ <textarea
58
+ bind:value
59
+ class={classes}
60
+ disabled={disabled || $loading}
61
+ {id}
62
+ maxlength={max ? Number(max) : undefined}
63
+ {required}
64
+ {placeholder}
65
+ rows={4}
60
66
  ></textarea>
61
67
  {:else if ['date', 'number'].includes(type)}
62
- <input bind:value class={classes} disabled={isDisabled} lang="fi-FI" {max} {min} {onchange} {required} {step} {type} {placeholder} />
68
+ <input bind:value class={classes} disabled={disabled || $loading} lang="fi-FI" {max} {min} {onchange} {required} {step} {type} {placeholder} />
63
69
  {:else}
64
70
  <input
65
71
  bind:value
@@ -68,7 +74,7 @@
68
74
  {required}
69
75
  {type}
70
76
  class={classes}
71
- disabled={isDisabled}
77
+ disabled={disabled || $loading}
72
78
  maxlength={max ? Number(max) : undefined}
73
79
  minlength={min ? Number(min) : undefined}
74
80
  onkeyup={onchange}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuspe/components",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "description": "A reusable SvelteKit component library for form elements, breadcrumbs, prices and images.",
5
5
  "keywords": [
6
6
  "svelteKit",
@@ -61,21 +61,21 @@
61
61
  },
62
62
  "devDependencies": {
63
63
  "@eslint/compat": "^1.2.7",
64
- "@eslint/js": "^9.22.0",
64
+ "@eslint/js": "^9.23.0",
65
65
  "@sveltejs/adapter-static": "^3.0.8",
66
- "@sveltejs/kit": "^2.19.2",
66
+ "@sveltejs/kit": "^2.20.2",
67
67
  "@sveltejs/package": "^2.3.10",
68
68
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
69
69
  "eslint-config-prettier": "^10.1.1",
70
- "eslint-plugin-svelte": "^3.2.1",
71
- "eslint": "^9.22.0",
70
+ "eslint-plugin-svelte": "^3.3.3",
71
+ "eslint": "^9.23.0",
72
72
  "globals": "^16.0.0",
73
73
  "prettier-plugin-svelte": "^3.3.3",
74
74
  "prettier": "^3.5.3",
75
75
  "publint": "^0.3.9",
76
76
  "svelte-check": "^4.1.5",
77
- "svelte": "^5.23.1",
78
- "typescript-eslint": "^8.26.1",
77
+ "svelte": "^5.25.2",
78
+ "typescript-eslint": "^8.27.0",
79
79
  "typescript": "^5.8.2",
80
80
  "vite": "^6.2.2"
81
81
  }