@tuspe/components 1.8.15 → 1.9.1

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
@@ -25,7 +25,7 @@ A breadcrumb navigation provide links back to previous pages, and shows the user
25
25
  position?: string
26
26
  }
27
27
 
28
- interface Props {
28
+ type Props = {
29
29
  homeName?: string
30
30
  homeSlug?: string
31
31
  onlyMeta?: boolean
@@ -39,7 +39,7 @@ A breadcrumb navigation provide links back to previous pages, and shows the user
39
39
  Easily replace most buttons in your project with this versatile button component. The `control` value makes it ideal for icons and as a toggler for the mobile menu.
40
40
 
41
41
  ```TypeScript
42
- interface Props {
42
+ type Props = {
43
43
  ariaControls?: string | undefined
44
44
  ariaExpanded?: boolean | undefined
45
45
  ariaLabel?: string | undefined
@@ -82,7 +82,7 @@ Easily replace most buttons in your project with this versatile button component
82
82
  Arrow icons for navigation, such as image sliders or content transitions.
83
83
 
84
84
  ```TypeScript
85
- interface Props {
85
+ type Props = {
86
86
  ariaLabel: string
87
87
  color?: string
88
88
  direction: 'left' | 'right'
@@ -96,7 +96,7 @@ Arrow icons for navigation, such as image sliders or content transitions.
96
96
  Close button for modals and other dismissible elements.
97
97
 
98
98
  ```TypeScript
99
- interface Props {
99
+ type Props = {
100
100
  ariaLabel?: string
101
101
  color?: string
102
102
  hover?: 'black' | 'primary' | 'secondary' | 'success' | 'transparent'
@@ -111,7 +111,7 @@ Close button for modals and other dismissible elements.
111
111
  A button for toggling the mobile menu, dynamically changing its icon based on the menu's open or closed state.
112
112
 
113
113
  ```TypeScript
114
- interface Props {
114
+ type Props = {
115
115
  ariaControls: string
116
116
  color?: 'black' | 'white'
117
117
  extraClass?: string
@@ -135,7 +135,7 @@ A versatile image component supporting various aspect ratios and object fit opti
135
135
  width?: number
136
136
  }
137
137
 
138
- interface Props {
138
+ type Props = {
139
139
  ariaHidden?: boolean
140
140
  aspect?: '3:4' | '4:3' | 'square' | 'video'
141
141
  ball?: boolean
@@ -155,7 +155,7 @@ A versatile image component supporting various aspect ratios and object fit opti
155
155
  A flexible `Input` component supporting common input types with basic styling for form fields. It includes optional attributes for labels, placeholders, min/max values, steps, and event handlers but does not perform content validation.
156
156
 
157
157
  ```TypeScript
158
- interface Props {
158
+ type Props = {
159
159
  onchange?: () => void
160
160
  onclick?: () => void
161
161
  borderColor?: string
@@ -183,7 +183,7 @@ A customizable `Select` component for choosing from a list of options. Supports
183
183
  value: number | string
184
184
  }
185
185
 
186
- interface Props {
186
+ type Props = {
187
187
  disabled?: boolean
188
188
  id?: string
189
189
  innerClass?: string
@@ -202,7 +202,7 @@ A customizable `Select` component for choosing from a list of options. Supports
202
202
  Allows users to toggle between checked and unchecked states.
203
203
 
204
204
  ```TypeScript
205
- interface Props {
205
+ type Props = {
206
206
  checked?: boolean
207
207
  children: Snippet
208
208
  disabled?: boolean
@@ -220,7 +220,7 @@ Allows users to toggle between checked and unchecked states.
220
220
  A simple `Modal` component that displays a popup with customizable content.
221
221
 
222
222
  ```TypeScript
223
- interface Props {
223
+ type Props = {
224
224
  children: Snippet
225
225
  buttonAriaLabel?: string
226
226
  colorButton?: string
@@ -1,18 +1,12 @@
1
1
  <script lang="ts">
2
2
  import {page} from '$app/state'
3
3
  import {onMount} from 'svelte'
4
- import {validateArray, type Breadcrumb} from './'
4
+ import {validateArray} from './'
5
+ import type {Breadcrumb} from './'
6
+ import type {BreadcrumbView} from './types'
5
7
 
6
- interface Props {
7
- homeName?: string
8
- homeSlug?: string
9
- onlyMeta?: boolean
10
- outerClass?: string
11
- values: Breadcrumb[]
12
- }
13
-
14
- let {homeName = 'Etusivu', homeSlug = '', onlyMeta = false, outerClass, values}: Props = $props(),
15
- classes = $state('truncate')
8
+ let {homeName = 'Etusivu', homeSlug = '', onlyMeta = false, outerClass, values}: BreadcrumbView = $props()
9
+ let classes = $state('truncate')
16
10
 
17
11
  const origin = page.url.origin + '/'
18
12
 
@@ -1,11 +1,4 @@
1
- import { type Breadcrumb } from './';
2
- interface Props {
3
- homeName?: string;
4
- homeSlug?: string;
5
- onlyMeta?: boolean;
6
- outerClass?: string;
7
- values: Breadcrumb[];
8
- }
9
- declare const Breadcrumbs: import("svelte").Component<Props, {}, "">;
1
+ import type { BreadcrumbView } from './types';
2
+ declare const Breadcrumbs: import("svelte").Component<BreadcrumbView, {}, "">;
10
3
  type Breadcrumbs = ReturnType<typeof Breadcrumbs>;
11
4
  export default Breadcrumbs;
@@ -1,43 +1,6 @@
1
1
  <script lang="ts">
2
2
  import {loading} from './'
3
- import type {Snippet} from 'svelte'
4
-
5
- interface Props {
6
- ariaControls?: string | undefined
7
- ariaExpanded?: boolean | undefined
8
- ariaLabel?: string | undefined
9
- ariaPopup?: 'dialog' | 'listbox' | 'menu' | undefined
10
- borderColor?: 'content' | 'default' | 'primary'
11
- borderSize?: 0 | 1 | 2
12
- children: Snippet
13
- color?: string
14
- colorBg?: string
15
- control?: boolean
16
- disabled?: boolean
17
- extraClass?: string
18
- fill?: boolean
19
- fontWeight?: 'normal' | 'bold'
20
- fullWidth?: boolean
21
- hover?: 'black' | 'primary' | 'secondary' | 'success' | 'transparent'
22
- hoverText?: 'black' | 'primary' | 'secondary' | 'white'
23
- href?: string | undefined
24
- id?: string
25
- noCenter?: boolean
26
- noHeight?: boolean
27
- noPadding?: boolean
28
- noSpinner?: boolean
29
- onclick?: any
30
- preload?: 'hover' | 'tap'
31
- rel?: string
32
- role?: string
33
- rounded?: 'full' | 'lg' | 'none' | 'sm'
34
- spinnerColor?: 'black' | 'white'
35
- target?: '_blank' | '_top' | undefined
36
- title?: string | undefined
37
- type?: 'submit'
38
- uppercase?: boolean
39
- value?: string | number
40
- }
3
+ import type {ButtonView} from './types'
41
4
 
42
5
  let {
43
6
  ariaControls,
@@ -74,7 +37,7 @@
74
37
  type,
75
38
  uppercase = true,
76
39
  value
77
- }: Props = $props()
40
+ }: ButtonView = $props()
78
41
 
79
42
  let classes = $state(`btn text-${color}`)
80
43
 
@@ -1,40 +1,4 @@
1
- import type { Snippet } from 'svelte';
2
- interface Props {
3
- ariaControls?: string | undefined;
4
- ariaExpanded?: boolean | undefined;
5
- ariaLabel?: string | undefined;
6
- ariaPopup?: 'dialog' | 'listbox' | 'menu' | undefined;
7
- borderColor?: 'content' | 'default' | 'primary';
8
- borderSize?: 0 | 1 | 2;
9
- children: Snippet;
10
- color?: string;
11
- colorBg?: string;
12
- control?: boolean;
13
- disabled?: boolean;
14
- extraClass?: string;
15
- fill?: boolean;
16
- fontWeight?: 'normal' | 'bold';
17
- fullWidth?: boolean;
18
- hover?: 'black' | 'primary' | 'secondary' | 'success' | 'transparent';
19
- hoverText?: 'black' | 'primary' | 'secondary' | 'white';
20
- href?: string | undefined;
21
- id?: string;
22
- noCenter?: boolean;
23
- noHeight?: boolean;
24
- noPadding?: boolean;
25
- noSpinner?: boolean;
26
- onclick?: any;
27
- preload?: 'hover' | 'tap';
28
- rel?: string;
29
- role?: string;
30
- rounded?: 'full' | 'lg' | 'none' | 'sm';
31
- spinnerColor?: 'black' | 'white';
32
- target?: '_blank' | '_top' | undefined;
33
- title?: string | undefined;
34
- type?: 'submit';
35
- uppercase?: boolean;
36
- value?: string | number;
37
- }
38
- declare const Button: import("svelte").Component<Props, {}, "">;
1
+ import type { ButtonView } from './types';
2
+ declare const Button: import("svelte").Component<ButtonView, {}, "">;
39
3
  type Button = ReturnType<typeof Button>;
40
4
  export default Button;
@@ -1,13 +1,7 @@
1
1
  <script lang="ts">
2
2
  import Button from './Button.svelte'
3
- interface Props {
4
- ariaLabel: string
5
- color?: string
6
- direction: 'left' | 'right'
7
- id?: string
8
- onclick?: () => any
9
- }
10
- let {onclick, ariaLabel, color = 'black', direction, id}: Props = $props()
3
+ import type {ButtonArrowView} from './types'
4
+ let {onclick, ariaLabel, color = 'black', direction, id}: ButtonArrowView = $props()
11
5
  </script>
12
6
 
13
7
  <Button {ariaLabel} control {color} {id} {onclick}>
@@ -1,10 +1,4 @@
1
- interface Props {
2
- ariaLabel: string;
3
- color?: string;
4
- direction: 'left' | 'right';
5
- id?: string;
6
- onclick?: () => any;
7
- }
8
- declare const ButtonArrow: import("svelte").Component<Props, {}, "">;
1
+ import type { ButtonArrowView } from './types';
2
+ declare const ButtonArrow: import("svelte").Component<ButtonArrowView, {}, "">;
9
3
  type ButtonArrow = ReturnType<typeof ButtonArrow>;
10
4
  export default ButtonArrow;
@@ -1,16 +1,7 @@
1
1
  <script lang="ts">
2
2
  import Button from './Button.svelte'
3
-
4
- interface Props {
5
- ariaLabel?: string
6
- color?: string
7
- hover?: 'black' | 'primary' | 'secondary' | 'success' | 'transparent'
8
- hoverText?: 'black' | 'primary' | 'secondary' | 'white'
9
- id?: string
10
- onclick?: any
11
- }
12
-
13
- let {ariaLabel, color = 'white', hover = 'transparent', id, onclick}: Props = $props()
3
+ import type {ButtonCloseView} from './types'
4
+ let {ariaLabel, color = 'white', hover = 'transparent', id, onclick}: ButtonCloseView = $props()
14
5
  </script>
15
6
 
16
7
  <div class="close-button">
@@ -1,11 +1,4 @@
1
- interface Props {
2
- ariaLabel?: string;
3
- color?: string;
4
- hover?: 'black' | 'primary' | 'secondary' | 'success' | 'transparent';
5
- hoverText?: 'black' | 'primary' | 'secondary' | 'white';
6
- id?: string;
7
- onclick?: any;
8
- }
9
- declare const ButtonClose: import("svelte").Component<Props, {}, "">;
1
+ import type { ButtonCloseView } from './types';
2
+ declare const ButtonClose: import("svelte").Component<ButtonCloseView, {}, "">;
10
3
  type ButtonClose = ReturnType<typeof ButtonClose>;
11
4
  export default ButtonClose;
@@ -1,16 +1,7 @@
1
1
  <script lang="ts">
2
2
  import Button from './Button.svelte'
3
- interface Props {
4
- ariaControls: string
5
- color?: 'black' | 'white'
6
- extraClass?: string
7
- hidden?: boolean
8
- id?: string
9
- onclick?: () => any
10
- open: boolean
11
- title: string
12
- }
13
- let {ariaControls, title, color = 'white', extraClass, hidden = false, id, open = $bindable()}: Props = $props()
3
+ import type {ButtonMenuView} from './types'
4
+ let {ariaControls, title, color = 'white', extraClass, hidden = false, id, open = $bindable()}: ButtonMenuView = $props()
14
5
  const handleOpen = () => {
15
6
  open = !open
16
7
  }
@@ -1,13 +1,4 @@
1
- interface Props {
2
- ariaControls: string;
3
- color?: 'black' | 'white';
4
- extraClass?: string;
5
- hidden?: boolean;
6
- id?: string;
7
- onclick?: () => any;
8
- open: boolean;
9
- title: string;
10
- }
11
- declare const ButtonMenu: import("svelte").Component<Props, {}, "open">;
1
+ import type { ButtonMenuView } from './types';
2
+ declare const ButtonMenu: import("svelte").Component<ButtonMenuView, {}, "open">;
12
3
  type ButtonMenu = ReturnType<typeof ButtonMenu>;
13
4
  export default ButtonMenu;
@@ -1,21 +1,18 @@
1
1
  <script lang="ts">
2
2
  import {loading} from './'
3
- import type {Snippet} from 'svelte'
4
-
5
- interface Props {
6
- children: Snippet
7
- onchange?: () => void
8
- checked?: boolean
9
- disabled?: boolean
10
- group?: boolean
11
- id?: string
12
- outerClass?: string
13
- required?: boolean
14
- value?: number | string
15
- }
16
-
17
- let {children, onchange, checked = $bindable(false), disabled, group = $bindable(), id, outerClass, required, value, ...props}: Props = $props()
18
-
3
+ import type {CheckboxView} from './types'
4
+ let {
5
+ children,
6
+ onchange,
7
+ checked = $bindable(false),
8
+ disabled,
9
+ group = $bindable(),
10
+ id,
11
+ outerClass,
12
+ required,
13
+ value,
14
+ ...props
15
+ }: CheckboxView = $props()
19
16
  let classes = $state('input-checkbox')
20
17
  if (outerClass) {
21
18
  classes += ` ${outerClass}`
@@ -23,7 +20,7 @@
23
20
  </script>
24
21
 
25
22
  <label class={classes}>
26
- <input bind:checked disabled={disabled || $loading} {id} {onchange} {required} type="checkbox" {value} {...props} />
23
+ <input bind:checked disabled={disabled || $loading ? true : false} {id} {onchange} {required} type="checkbox" {value} {...props} />
27
24
  <span>
28
25
  {@render children?.()}
29
26
  {#if required}<sup>*</sup>{/if}
@@ -1,15 +1,4 @@
1
- import type { Snippet } from 'svelte';
2
- interface Props {
3
- children: Snippet;
4
- onchange?: () => void;
5
- checked?: boolean;
6
- disabled?: boolean;
7
- group?: boolean;
8
- id?: string;
9
- outerClass?: string;
10
- required?: boolean;
11
- value?: number | string;
12
- }
13
- declare const Checkbox: import("svelte").Component<Props, {}, "checked" | "group">;
1
+ import type { CheckboxView } from './types';
2
+ declare const Checkbox: import("svelte").Component<CheckboxView, {}, "checked" | "group">;
14
3
  type Checkbox = ReturnType<typeof Checkbox>;
15
4
  export default Checkbox;
package/dist/Image.svelte CHANGED
@@ -1,20 +1,5 @@
1
1
  <script lang="ts">
2
- import type {ImageData} from './'
3
-
4
- interface Props {
5
- ariaHidden?: boolean
6
- aspect?: '3:4' | '4:3' | 'square' | 'video'
7
- ball?: boolean
8
- border?: boolean
9
- center?: boolean
10
- display?: 'block' | 'inline-block'
11
- extraClasses?: string
12
- fullWidth?: boolean
13
- image: ImageData
14
- loading?: 'eager' | 'lazy'
15
- objectFit?: 'contain' | 'cover'
16
- }
17
-
2
+ import type {ImageView} from './types'
18
3
  let {
19
4
  ariaHidden,
20
5
  aspect,
@@ -27,7 +12,7 @@
27
12
  image,
28
13
  loading = 'lazy',
29
14
  objectFit
30
- }: Props = $props()
15
+ }: ImageView = $props()
31
16
 
32
17
  let classes = $state(display)
33
18
  if (aspect) {
@@ -1,17 +1,4 @@
1
- import type { ImageData } from './';
2
- interface Props {
3
- ariaHidden?: boolean;
4
- aspect?: '3:4' | '4:3' | 'square' | 'video';
5
- ball?: boolean;
6
- border?: boolean;
7
- center?: boolean;
8
- display?: 'block' | 'inline-block';
9
- extraClasses?: string;
10
- fullWidth?: boolean;
11
- image: ImageData;
12
- loading?: 'eager' | 'lazy';
13
- objectFit?: 'contain' | 'cover';
14
- }
15
- declare const Image: import("svelte").Component<Props, {}, "">;
1
+ import type { ImageView } from './types';
2
+ declare const Image: import("svelte").Component<ImageView, {}, "">;
16
3
  type Image = ReturnType<typeof Image>;
17
4
  export default Image;
package/dist/Input.svelte CHANGED
@@ -1,24 +1,6 @@
1
1
  <script lang="ts">
2
2
  import {loading} from './'
3
-
4
- interface Props {
5
- onchange?: () => void
6
- onclick?: () => void
7
- borderColor?: 'content' | 'default' | 'primary' | 'none'
8
- bgColor?: 'transparent' | 'white' | 'none'
9
- disabled?: boolean
10
- id?: string
11
- inputClass?: string
12
- label: string
13
- max?: number | string
14
- min?: number | string
15
- outerClass?: string
16
- placeholder?: string
17
- required?: boolean
18
- step?: number
19
- type?: 'email' | 'date' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'textarea' | 'time' | 'url'
20
- value: string | number
21
- }
3
+ import type {InputView} from './types'
22
4
 
23
5
  let {
24
6
  bgColor = 'transparent',
@@ -37,7 +19,7 @@
37
19
  type = 'text',
38
20
  value = $bindable(),
39
21
  ...props
40
- }: Props = $props()
22
+ }: InputView = $props()
41
23
 
42
24
  let classesIn = $state(''),
43
25
  classesOut = $state(`input-${type}`)
@@ -62,7 +44,7 @@
62
44
  <textarea
63
45
  bind:value
64
46
  class={classesIn}
65
- disabled={disabled || $loading}
47
+ disabled={disabled || $loading ? true : false}
66
48
  {id}
67
49
  maxlength={max ? Number(max) : undefined}
68
50
  {required}
@@ -74,7 +56,7 @@
74
56
  <input
75
57
  bind:value
76
58
  class={classesIn}
77
- disabled={disabled || $loading}
59
+ disabled={disabled || $loading ? true : false}
78
60
  lang="fi-FI"
79
61
  {max}
80
62
  {min}
@@ -93,7 +75,7 @@
93
75
  {required}
94
76
  {type}
95
77
  class={classesIn}
96
- disabled={disabled || $loading}
78
+ disabled={disabled || $loading ? true : false}
97
79
  maxlength={max ? Number(max) : undefined}
98
80
  minlength={min ? Number(min) : undefined}
99
81
  onkeyup={onchange}
@@ -1,21 +1,4 @@
1
- interface Props {
2
- onchange?: () => void;
3
- onclick?: () => void;
4
- borderColor?: 'content' | 'default' | 'primary' | 'none';
5
- bgColor?: 'transparent' | 'white' | 'none';
6
- disabled?: boolean;
7
- id?: string;
8
- inputClass?: string;
9
- label: string;
10
- max?: number | string;
11
- min?: number | string;
12
- outerClass?: string;
13
- placeholder?: string;
14
- required?: boolean;
15
- step?: number;
16
- type?: 'email' | 'date' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'textarea' | 'time' | 'url';
17
- value: string | number;
18
- }
19
- declare const Input: import("svelte").Component<Props, {}, "value">;
1
+ import type { InputView } from './types';
2
+ declare const Input: import("svelte").Component<InputView, {}, "value">;
20
3
  type Input = ReturnType<typeof Input>;
21
4
  export default Input;
package/dist/Modal.svelte CHANGED
@@ -1,18 +1,6 @@
1
1
  <script lang="ts">
2
- import type {Snippet} from 'svelte'
3
2
  import ButtonClose from './ButtonClose.svelte'
4
- interface Props {
5
- children: Snippet
6
- buttonAriaLabel?: string
7
- colorButton?: string
8
- colorBg?: string
9
- headerClass?: string
10
- innerClass?: string
11
- open?: boolean
12
- outerClass?: string
13
- title?: string
14
- titleClass?: string
15
- }
3
+ import type {ModalView} from './types'
16
4
  let {
17
5
  children,
18
6
  buttonAriaLabel,
@@ -23,7 +11,7 @@
23
11
  outerClass = 'bg-white text-content',
24
12
  title,
25
13
  titleClass = 'text-white'
26
- }: Props = $props()
14
+ }: ModalView = $props()
27
15
  const handleClose = () => {
28
16
  open = false
29
17
  }
@@ -1,16 +1,4 @@
1
- import type { Snippet } from 'svelte';
2
- interface Props {
3
- children: Snippet;
4
- buttonAriaLabel?: string;
5
- colorButton?: string;
6
- colorBg?: string;
7
- headerClass?: string;
8
- innerClass?: string;
9
- open?: boolean;
10
- outerClass?: string;
11
- title?: string;
12
- titleClass?: string;
13
- }
14
- declare const Modal: import("svelte").Component<Props, {}, "open">;
1
+ import type { ModalView } from './types';
2
+ declare const Modal: import("svelte").Component<ModalView, {}, "open">;
15
3
  type Modal = ReturnType<typeof Modal>;
16
4
  export default Modal;
@@ -1,34 +1,20 @@
1
1
  <script lang="ts">
2
- import {loading, type SelectItem} from './'
3
-
4
- interface Props {
5
- colorBg?: string
6
- disabled?: boolean
7
- id?: string
8
- innerClass?: string
9
- label: string
10
- onchange?: () => void
11
- outerClass?: string
12
- placeholder?: string
13
- required?: boolean
14
- value: string | number
15
- values: SelectItem[]
16
- }
17
-
2
+ import {loading} from './'
3
+ import type {SelectView} from './types'
18
4
  let {
19
- colorBg = 'bg-transparent',
20
- disabled,
21
- id,
22
- innerClass,
23
- label,
24
- onchange,
25
- outerClass,
26
- placeholder,
27
- required = false,
28
- value = $bindable(),
29
- values
30
- }: Props = $props(),
31
- classes = $state(colorBg)
5
+ colorBg = 'bg-transparent',
6
+ disabled,
7
+ id,
8
+ innerClass,
9
+ label,
10
+ onchange,
11
+ outerClass,
12
+ placeholder,
13
+ required = false,
14
+ value = $bindable(),
15
+ values
16
+ }: SelectView = $props()
17
+ let classes = $state(colorBg)
32
18
  if (innerClass) {
33
19
  classes += ' ' + innerClass
34
20
  }
@@ -37,7 +23,7 @@
37
23
  <label class={outerClass}>
38
24
  {label}
39
25
  {#if required}<sup>*</sup>{/if}
40
- <select bind:value {onchange} class={classes} disabled={disabled || $loading} {id} {placeholder} {required}>
26
+ <select bind:value {onchange} class={classes} disabled={disabled || $loading ? true : false} {id} {placeholder} {required}>
41
27
  {#each values as item}
42
28
  <option value={item.value}>{item.name}</option>
43
29
  {/each}
@@ -1,17 +1,4 @@
1
- import { type SelectItem } from './';
2
- interface Props {
3
- colorBg?: string;
4
- disabled?: boolean;
5
- id?: string;
6
- innerClass?: string;
7
- label: string;
8
- onchange?: () => void;
9
- outerClass?: string;
10
- placeholder?: string;
11
- required?: boolean;
12
- value: string | number;
13
- values: SelectItem[];
14
- }
15
- declare const Select: import("svelte").Component<Props, {}, "value">;
1
+ import type { SelectView } from './types';
2
+ declare const Select: import("svelte").Component<SelectView, {}, "value">;
16
3
  type Select = ReturnType<typeof Select>;
17
4
  export default Select;
@@ -0,0 +1,137 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { Breadcrumb, ImageData, SelectItem } from './';
3
+ export interface BreadcrumbView {
4
+ homeName?: string;
5
+ homeSlug?: string;
6
+ onlyMeta?: boolean;
7
+ outerClass?: string;
8
+ values: Breadcrumb[];
9
+ }
10
+ export interface ButtonArrowView {
11
+ onclick?: () => any;
12
+ ariaLabel: string;
13
+ color?: string;
14
+ direction: 'left' | 'right';
15
+ id?: string;
16
+ }
17
+ export interface ButtonCloseView {
18
+ onclick?: any;
19
+ ariaLabel?: string;
20
+ color?: string;
21
+ hover?: 'black' | 'primary' | 'secondary' | 'success' | 'transparent';
22
+ hoverText?: 'black' | 'primary' | 'secondary' | 'white';
23
+ id?: string;
24
+ }
25
+ export interface ButtonMenuView {
26
+ onclick?: () => any;
27
+ ariaControls: string;
28
+ color?: 'black' | 'white';
29
+ extraClass?: string;
30
+ hidden?: boolean;
31
+ id?: string;
32
+ open: boolean;
33
+ title: string;
34
+ }
35
+ export interface ButtonView {
36
+ children: Snippet;
37
+ ariaControls?: string | undefined;
38
+ ariaExpanded?: boolean | undefined;
39
+ ariaLabel?: string | undefined;
40
+ ariaPopup?: 'dialog' | 'listbox' | 'menu' | undefined;
41
+ borderColor?: 'content' | 'default' | 'primary';
42
+ borderSize?: 0 | 1 | 2;
43
+ color?: string;
44
+ colorBg?: string;
45
+ control?: boolean;
46
+ disabled?: boolean;
47
+ extraClass?: string;
48
+ fill?: boolean;
49
+ fontWeight?: 'normal' | 'bold';
50
+ fullWidth?: boolean;
51
+ hover?: 'black' | 'primary' | 'secondary' | 'success' | 'transparent';
52
+ hoverText?: 'black' | 'primary' | 'secondary' | 'white';
53
+ href?: string | undefined;
54
+ id?: string;
55
+ noCenter?: boolean;
56
+ noHeight?: boolean;
57
+ noPadding?: boolean;
58
+ noSpinner?: boolean;
59
+ onclick?: any;
60
+ preload?: 'hover' | 'tap';
61
+ rel?: string;
62
+ role?: string;
63
+ rounded?: 'full' | 'lg' | 'none' | 'sm';
64
+ spinnerColor?: 'black' | 'white';
65
+ target?: '_blank' | '_top' | undefined;
66
+ title?: string | undefined;
67
+ type?: 'submit';
68
+ uppercase?: boolean;
69
+ value?: string | number;
70
+ }
71
+ export interface CheckboxView {
72
+ children: Snippet;
73
+ onchange?: () => void;
74
+ checked?: boolean;
75
+ disabled?: boolean;
76
+ group?: boolean;
77
+ id?: string;
78
+ outerClass?: string;
79
+ required?: boolean;
80
+ value?: number | string;
81
+ }
82
+ export interface ImageView {
83
+ ariaHidden?: boolean;
84
+ aspect?: '3:4' | '4:3' | 'square' | 'video';
85
+ ball?: boolean;
86
+ border?: boolean;
87
+ center?: boolean;
88
+ display?: 'block' | 'inline-block';
89
+ extraClasses?: string;
90
+ fullWidth?: boolean;
91
+ image: ImageData;
92
+ loading?: 'eager' | 'lazy';
93
+ objectFit?: 'contain' | 'cover';
94
+ }
95
+ export interface InputView {
96
+ onchange?: () => void;
97
+ onclick?: () => void;
98
+ borderColor?: 'content' | 'default' | 'primary' | 'none';
99
+ bgColor?: 'transparent' | 'white' | 'none';
100
+ disabled?: boolean;
101
+ id?: string;
102
+ inputClass?: string;
103
+ label: string;
104
+ max?: number | string;
105
+ min?: number | string;
106
+ outerClass?: string;
107
+ placeholder?: string;
108
+ required?: boolean;
109
+ step?: number;
110
+ type?: 'email' | 'date' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'textarea' | 'time' | 'url';
111
+ value: string | number;
112
+ }
113
+ export interface ModalView {
114
+ children: Snippet;
115
+ buttonAriaLabel?: string;
116
+ colorButton?: string;
117
+ colorBg?: string;
118
+ headerClass?: string;
119
+ innerClass?: string;
120
+ open?: boolean;
121
+ outerClass?: string;
122
+ title?: string;
123
+ titleClass?: string;
124
+ }
125
+ export interface SelectView {
126
+ onchange?: () => void;
127
+ colorBg?: string;
128
+ disabled?: boolean;
129
+ id?: string;
130
+ innerClass?: string;
131
+ label: string;
132
+ outerClass?: string;
133
+ placeholder?: string;
134
+ required?: boolean;
135
+ value: string | number;
136
+ values: SelectItem[];
137
+ }
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuspe/components",
3
- "version": "1.8.15",
3
+ "version": "1.9.1",
4
4
  "description": "A reusable SvelteKit component library for form elements, breadcrumbs, prices and images.",
5
5
  "keywords": [
6
6
  "svelteKit",
@@ -27,19 +27,6 @@
27
27
  "type": "git",
28
28
  "url": "git+https://github.com/TuspeDesign/svelte-components.git"
29
29
  },
30
- "scripts": {
31
- "dev": "vite dev",
32
- "build": "vite build && npm run prepack",
33
- "preview": "vite preview",
34
- "prepare": "svelte-kit sync",
35
- "prepack": "svelte-kit sync && svelte-package",
36
- "publint": "publint .",
37
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
38
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
39
- "format": "prettier --write .",
40
- "lint": "prettier --check . && eslint .",
41
- "publish": "npm publish --access public"
42
- },
43
30
  "files": [
44
31
  "dist",
45
32
  "!dist/**/*.test.*",
@@ -63,20 +50,30 @@
63
50
  "@eslint/compat": "^1.2.9",
64
51
  "@eslint/js": "^9.26.0",
65
52
  "@sveltejs/adapter-static": "^3.0.8",
66
- "@sveltejs/kit": "^2.20.8",
53
+ "@sveltejs/kit": "^2.21.0",
67
54
  "@sveltejs/package": "^2.3.11",
68
55
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
69
56
  "eslint-config-prettier": "^10.1.5",
70
- "eslint-plugin-svelte": "^3.5.1",
57
+ "eslint-plugin-svelte": "^3.6.0",
71
58
  "eslint": "^9.26.0",
72
59
  "globals": "^16.1.0",
73
60
  "prettier-plugin-svelte": "^3.3.3",
74
61
  "prettier": "^3.5.3",
75
62
  "publint": "^0.3.12",
76
63
  "svelte-check": "^4.1.7",
77
- "svelte": "^5.28.2",
78
- "typescript-eslint": "^8.32.0",
64
+ "svelte": "^5.28.6",
65
+ "typescript-eslint": "^8.32.1",
79
66
  "typescript": "^5.8.3",
80
67
  "vite": "^6.3.5"
68
+ },
69
+ "scripts": {
70
+ "dev": "vite dev",
71
+ "build": "vite build && npm run prepack",
72
+ "preview": "vite preview",
73
+ "publint": "publint .",
74
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
75
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
76
+ "format": "prettier --write .",
77
+ "lint": "prettier --check . && eslint ."
81
78
  }
82
79
  }