@skeletonlabs/skeleton-svelte 1.3.0 → 1.4.0
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.
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
src,
|
|
8
8
|
srcset,
|
|
9
9
|
name,
|
|
10
|
+
initials = [0, -1],
|
|
10
11
|
// Root
|
|
11
12
|
base = 'overflow-hidden isolate',
|
|
12
13
|
background = 'bg-surface-400-600',
|
|
@@ -38,11 +39,9 @@
|
|
|
38
39
|
const api = $derived(avatar.connect(service, normalizeProps));
|
|
39
40
|
|
|
40
41
|
// Generate Initials
|
|
41
|
-
function getInitials(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
.map((word) => word[0])
|
|
45
|
-
.join('');
|
|
42
|
+
function getInitials() {
|
|
43
|
+
const lettersArr = initials.map((index) => name.split(' ').at(index)?.charAt(0).toUpperCase());
|
|
44
|
+
return lettersArr.join('');
|
|
46
45
|
}
|
|
47
46
|
</script>
|
|
48
47
|
|
|
@@ -59,7 +58,7 @@
|
|
|
59
58
|
{#if children}
|
|
60
59
|
{@render children()}
|
|
61
60
|
{:else}
|
|
62
|
-
{getInitials(
|
|
61
|
+
{getInitials()}
|
|
63
62
|
{/if}
|
|
64
63
|
</span>
|
|
65
64
|
<!-- Image -->
|
|
@@ -8,6 +8,8 @@ export interface AvatarProps extends Omit<avatar.Props, 'id'>, Pick<HTMLAttribut
|
|
|
8
8
|
srcset?: string;
|
|
9
9
|
/** Provide a name or username for the avatar. */
|
|
10
10
|
name: string;
|
|
11
|
+
/** Initials will be generated based on the name and this index array. */
|
|
12
|
+
initials?: number[];
|
|
11
13
|
/** Set base styles. */
|
|
12
14
|
base?: string;
|
|
13
15
|
/** Set background styles. */
|
|
@@ -40,8 +40,12 @@
|
|
|
40
40
|
</div>
|
|
41
41
|
{#if api.closable}
|
|
42
42
|
<!-- Dismiss Button -->
|
|
43
|
-
<button
|
|
44
|
-
|
|
43
|
+
<button
|
|
44
|
+
class="{props.btnDismissBase} {props.btnDismissClasses}"
|
|
45
|
+
title={props.btnDismissTitle}
|
|
46
|
+
aria-label={props.btnDismissAriaLabel}
|
|
47
|
+
{...api.getCloseTriggerProps()}
|
|
48
|
+
data-testid="toast-dismiss">×</button
|
|
45
49
|
>
|
|
46
50
|
{/if}
|
|
47
51
|
</div>
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
// Dismiss Button
|
|
26
26
|
btnDismissBase = 'btn-icon hover:preset-tonal',
|
|
27
27
|
btnDismissClasses = '',
|
|
28
|
+
btnDismissTitle = 'Dismiss',
|
|
29
|
+
btnDismissAriaLabel = 'Dismiss',
|
|
28
30
|
// State
|
|
29
31
|
stateInfo = 'preset-outlined-surface-200-800 preset-filled-surface-50-950',
|
|
30
32
|
stateSuccess = 'preset-filled-success-500',
|
|
@@ -56,6 +58,8 @@
|
|
|
56
58
|
{descriptionClasses}
|
|
57
59
|
{btnDismissBase}
|
|
58
60
|
{btnDismissClasses}
|
|
61
|
+
{btnDismissTitle}
|
|
62
|
+
{btnDismissAriaLabel}
|
|
59
63
|
{stateInfo}
|
|
60
64
|
{stateError}
|
|
61
65
|
{stateWarning}
|
|
@@ -27,6 +27,10 @@ export interface ToasterProps extends toast.StoreProps {
|
|
|
27
27
|
btnDismissBase?: string;
|
|
28
28
|
/** Provide arbitrary classes for the dismiss button. */
|
|
29
29
|
btnDismissClasses?: string;
|
|
30
|
+
/** Provide the title attribute for the dismiss button. */
|
|
31
|
+
btnDismissTitle?: string;
|
|
32
|
+
/** Provide the aria-label attribute for the dismiss button. */
|
|
33
|
+
btnDismissAriaLabel?: string;
|
|
30
34
|
/** Provide base classes for info toasts. */
|
|
31
35
|
stateInfo?: string;
|
|
32
36
|
/** Provide base classes for success toasts. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skeletonlabs/skeleton-svelte",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "The Svelte package for Skeleton.",
|
|
5
5
|
"author": "endigo9740 <chris@skeletonlabs.dev>",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -16,46 +16,46 @@
|
|
|
16
16
|
"!dist/**/*.test.*"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@zag-js/accordion": "^1.
|
|
20
|
-
"@zag-js/avatar": "^1.
|
|
21
|
-
"@zag-js/combobox": "^1.
|
|
22
|
-
"@zag-js/dialog": "^1.
|
|
23
|
-
"@zag-js/file-upload": "^1.
|
|
24
|
-
"@zag-js/pagination": "^1.
|
|
25
|
-
"@zag-js/popover": "^1.
|
|
26
|
-
"@zag-js/progress": "^1.
|
|
27
|
-
"@zag-js/radio-group": "^1.
|
|
28
|
-
"@zag-js/rating-group": "^1.
|
|
29
|
-
"@zag-js/slider": "^1.
|
|
30
|
-
"@zag-js/svelte": "^1.
|
|
31
|
-
"@zag-js/switch": "^1.
|
|
32
|
-
"@zag-js/tabs": "^1.
|
|
33
|
-
"@zag-js/tags-input": "^1.
|
|
34
|
-
"@zag-js/toast": "^1.
|
|
35
|
-
"@zag-js/tooltip": "^1.
|
|
19
|
+
"@zag-js/accordion": "^1.18.3",
|
|
20
|
+
"@zag-js/avatar": "^1.18.3",
|
|
21
|
+
"@zag-js/combobox": "^1.18.3",
|
|
22
|
+
"@zag-js/dialog": "^1.18.3",
|
|
23
|
+
"@zag-js/file-upload": "^1.18.3",
|
|
24
|
+
"@zag-js/pagination": "^1.18.3",
|
|
25
|
+
"@zag-js/popover": "^1.18.3",
|
|
26
|
+
"@zag-js/progress": "^1.18.3",
|
|
27
|
+
"@zag-js/radio-group": "^1.18.3",
|
|
28
|
+
"@zag-js/rating-group": "^1.18.3",
|
|
29
|
+
"@zag-js/slider": "^1.18.3",
|
|
30
|
+
"@zag-js/svelte": "^1.18.3",
|
|
31
|
+
"@zag-js/switch": "^1.18.3",
|
|
32
|
+
"@zag-js/tabs": "^1.18.3",
|
|
33
|
+
"@zag-js/tags-input": "^1.18.3",
|
|
34
|
+
"@zag-js/toast": "^1.18.3",
|
|
35
|
+
"@zag-js/tooltip": "^1.18.3"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"svelte": "^5.20.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@sveltejs/adapter-auto": "^
|
|
42
|
-
"@sveltejs/kit": "^2.
|
|
43
|
-
"@sveltejs/package": "^2.
|
|
44
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
41
|
+
"@sveltejs/adapter-auto": "^6.0.1",
|
|
42
|
+
"@sveltejs/kit": "^2.24.0",
|
|
43
|
+
"@sveltejs/package": "^2.4.0",
|
|
44
|
+
"@sveltejs/vite-plugin-svelte": "^6.1.0",
|
|
45
45
|
"@tailwindcss/forms": "^0.5.10",
|
|
46
|
-
"@tailwindcss/vite": "^4.
|
|
46
|
+
"@tailwindcss/vite": "^4.1.11",
|
|
47
47
|
"@testing-library/jest-dom": "^6.6.3",
|
|
48
|
-
"@testing-library/svelte": "^5.2.
|
|
49
|
-
"jsdom": "^26.
|
|
50
|
-
"publint": "^0.3.
|
|
51
|
-
"svelte": "^5.
|
|
52
|
-
"svelte-check": "^4.
|
|
53
|
-
"tailwindcss": "^4.
|
|
48
|
+
"@testing-library/svelte": "^5.2.8",
|
|
49
|
+
"jsdom": "^26.1.0",
|
|
50
|
+
"publint": "^0.3.12",
|
|
51
|
+
"svelte": "^5.36.1",
|
|
52
|
+
"svelte-check": "^4.2.2",
|
|
53
|
+
"tailwindcss": "^4.1.11",
|
|
54
54
|
"tslib": "^2.8.1",
|
|
55
|
-
"typescript": "^5.8.
|
|
56
|
-
"vite": "^
|
|
57
|
-
"vitest": "3.
|
|
58
|
-
"@skeletonlabs/skeleton": "3.1.
|
|
55
|
+
"typescript": "^5.8.3",
|
|
56
|
+
"vite": "^7.0.4",
|
|
57
|
+
"vitest": "3.2.4",
|
|
58
|
+
"@skeletonlabs/skeleton": "3.1.8"
|
|
59
59
|
},
|
|
60
60
|
"type": "module",
|
|
61
61
|
"scripts": {
|