@skeletonlabs/skeleton-svelte 1.0.0-next.21 → 1.0.0-next.22
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/dist/components/Avatar/Avatar.svelte +7 -12
- package/dist/components/Avatar/types.d.ts +2 -5
- package/dist/components/Combobox/Combobox.svelte +18 -11
- package/dist/components/Combobox/Combobox.svelte.d.ts +17 -3
- package/dist/components/Combobox/types.d.ts +10 -7
- package/dist/components/FileUpload/FileUpload.svelte +1 -1
- package/dist/components/Modal/Modal.svelte +1 -1
- package/dist/components/Modal/types.d.ts +2 -2
- package/dist/components/Popover/Popover.svelte +1 -1
- package/dist/components/Popover/types.d.ts +2 -2
- package/dist/components/ProgressRing/ProgressRing.svelte +2 -1
- package/dist/components/Segment/Segment.svelte +1 -1
- package/dist/components/Slider/Slider.svelte +2 -0
- package/dist/components/TagsInput/TagsInput.svelte +4 -6
- package/dist/components/TagsInput/types.d.ts +2 -4
- package/dist/components/Toast/ToastProvider.svelte +12 -12
- package/dist/components/Toast/types.d.ts +9 -9
- package/dist/components/Tooltip/Tooltip.svelte +1 -1
- package/dist/components/Tooltip/types.d.ts +2 -2
- package/package.json +36 -41
- package/dist/components/Accordion/Accordion.test.d.ts +0 -1
- package/dist/components/Accordion/Accordion.test.js +0 -63
- package/dist/components/Accordion/Accordion.test.svelte +0 -22
- package/dist/components/Accordion/Accordion.test.svelte.d.ts +0 -7
- package/dist/components/AppBar/AppBar.test.d.ts +0 -1
- package/dist/components/AppBar/AppBar.test.js +0 -66
- package/dist/components/Avatar/Avatar.test.d.ts +0 -1
- package/dist/components/Avatar/Avatar.test.js +0 -73
- package/dist/components/Combobox/Combobox.test.d.ts +0 -1
- package/dist/components/Combobox/Combobox.test.js +0 -14
- package/dist/components/FileUpload/FIleUpload.test.d.ts +0 -1
- package/dist/components/FileUpload/FIleUpload.test.js +0 -48
- package/dist/components/Modal/Modal.test.d.ts +0 -1
- package/dist/components/Modal/Modal.test.js +0 -14
- package/dist/components/Navigation/NavBar.test.svelte +0 -14
- package/dist/components/Navigation/NavBar.test.svelte.d.ts +0 -6
- package/dist/components/Navigation/NavRail.test.svelte +0 -24
- package/dist/components/Navigation/NavRail.test.svelte.d.ts +0 -7
- package/dist/components/Navigation/Navigation.test.d.ts +0 -1
- package/dist/components/Navigation/Navigation.test.js +0 -223
- package/dist/components/Pagination/Pagination.test.d.ts +0 -1
- package/dist/components/Pagination/Pagination.test.js +0 -74
- package/dist/components/Popover/Popover.test.d.ts +0 -1
- package/dist/components/Popover/Popover.test.js +0 -14
- package/dist/components/Progress/Progress.test.d.ts +0 -1
- package/dist/components/Progress/Progress.test.js +0 -130
- package/dist/components/ProgressRing/ProgressRing.test.d.ts +0 -1
- package/dist/components/ProgressRing/ProgressRing.test.js +0 -114
- package/dist/components/Rating/Rating.test.d.ts +0 -1
- package/dist/components/Rating/Rating.test.js +0 -47
- package/dist/components/Segment/Segment.test.d.ts +0 -1
- package/dist/components/Segment/Segment.test.js +0 -81
- package/dist/components/Segment/Segment.test.svelte +0 -14
- package/dist/components/Segment/Segment.test.svelte.d.ts +0 -7
- package/dist/components/Slider/Slider.test.d.ts +0 -1
- package/dist/components/Slider/Slider.test.js +0 -65
- package/dist/components/Switch/Switch.test.d.ts +0 -1
- package/dist/components/Switch/Switch.test.js +0 -119
- package/dist/components/Tabs/Tabs.test.d.ts +0 -1
- package/dist/components/Tabs/Tabs.test.js +0 -83
- package/dist/components/Tabs/Tabs.test.svelte +0 -21
- package/dist/components/Tabs/Tabs.test.svelte.d.ts +0 -8
- package/dist/components/TagsInput/TagsInput.test.d.ts +0 -1
- package/dist/components/TagsInput/TagsInput.test.js +0 -54
- package/dist/components/Tooltip/Tooltip.test.d.ts +0 -1
- package/dist/components/Tooltip/Tooltip.test.js +0 -14
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
src,
|
|
8
8
|
srcset,
|
|
9
9
|
name,
|
|
10
|
-
filter,
|
|
11
10
|
// Root
|
|
12
11
|
base = 'overflow-hidden isolate',
|
|
13
12
|
background = 'bg-surface-400-600',
|
|
@@ -49,7 +48,12 @@
|
|
|
49
48
|
|
|
50
49
|
<!-- @component An image with a fallback for representing a single user. -->
|
|
51
50
|
|
|
52
|
-
<figure
|
|
51
|
+
<figure
|
|
52
|
+
{...api.getRootProps()}
|
|
53
|
+
class="{base} {background} {size} {font} {border} {rounded} {shadow} {classes}"
|
|
54
|
+
{style}
|
|
55
|
+
data-testid="avatar"
|
|
56
|
+
>
|
|
53
57
|
<!-- Fallback -->
|
|
54
58
|
<span {...api.getFallbackProps()} class="{fallbackBase} {fallbackClasses}" data-testid="avatar-fallback">
|
|
55
59
|
{#if children}
|
|
@@ -60,15 +64,6 @@
|
|
|
60
64
|
</span>
|
|
61
65
|
<!-- Image -->
|
|
62
66
|
{#if src || srcset}
|
|
63
|
-
<img
|
|
64
|
-
{...api.getImageProps()}
|
|
65
|
-
{src}
|
|
66
|
-
{srcset}
|
|
67
|
-
alt={name}
|
|
68
|
-
class="{imageBase} {imageClasses}"
|
|
69
|
-
style:filter={filter && `url(${filter})`}
|
|
70
|
-
data-testid="avatar-image"
|
|
71
|
-
{style}
|
|
72
|
-
/>
|
|
67
|
+
<img {...api.getImageProps()} {src} {srcset} alt={name} class="{imageBase} {imageClasses}" data-testid="avatar-image" />
|
|
73
68
|
{/if}
|
|
74
69
|
</figure>
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
1
2
|
import type { Snippet } from 'svelte';
|
|
2
3
|
import type * as avatar from '@zag-js/avatar';
|
|
3
|
-
export interface AvatarProps extends Omit<avatar.Props, 'id'> {
|
|
4
|
+
export interface AvatarProps extends Omit<avatar.Props, 'id'>, Pick<HTMLAttributes<HTMLElement>, 'style'> {
|
|
4
5
|
/** Set avatar image source URL. */
|
|
5
6
|
src?: string;
|
|
6
7
|
/** The source set of the avatar image. */
|
|
7
8
|
srcset?: string;
|
|
8
9
|
/** Provide a name or username for the avatar. */
|
|
9
10
|
name: string;
|
|
10
|
-
/** Set avatar image filter name, such as: "#Apollo". */
|
|
11
|
-
filter?: string;
|
|
12
11
|
/** Set base styles. */
|
|
13
12
|
base?: string;
|
|
14
13
|
/** Set background styles. */
|
|
@@ -29,8 +28,6 @@ export interface AvatarProps extends Omit<avatar.Props, 'id'> {
|
|
|
29
28
|
imageBase?: string;
|
|
30
29
|
/** Provide avatar image arbitrary CSS classes. */
|
|
31
30
|
imageClasses?: string;
|
|
32
|
-
/** Set avatar image styles. */
|
|
33
|
-
style?: string;
|
|
34
31
|
/** Set base classes for the fallback element. */
|
|
35
32
|
fallbackBase?: string;
|
|
36
33
|
/** Provide arbitrary CSS classes to fallback element. */
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
<script lang="ts">
|
|
1
|
+
<script lang="ts" generics="T extends ComboboxItem">
|
|
2
2
|
import { fade } from 'svelte/transition';
|
|
3
3
|
import * as combobox from '@zag-js/combobox';
|
|
4
4
|
import { useMachine, normalizeProps, mergeProps } from '@zag-js/svelte';
|
|
5
|
-
import type { ComboboxProps } from './types.js';
|
|
5
|
+
import type { ComboboxProps, ComboboxItem } from './types.js';
|
|
6
6
|
|
|
7
7
|
const {
|
|
8
8
|
data = [],
|
|
9
9
|
label = '',
|
|
10
|
+
zIndex = 'auto',
|
|
10
11
|
// Base
|
|
11
12
|
base = '',
|
|
12
13
|
width = '',
|
|
@@ -23,7 +24,6 @@
|
|
|
23
24
|
inputGroupClasses = '',
|
|
24
25
|
// Positioner
|
|
25
26
|
positionerBase = '',
|
|
26
|
-
zIndex = 'auto',
|
|
27
27
|
positionerClasses = '',
|
|
28
28
|
// Content
|
|
29
29
|
contentBase = 'card p-2',
|
|
@@ -37,11 +37,12 @@
|
|
|
37
37
|
optionClasses = '',
|
|
38
38
|
// Snippets
|
|
39
39
|
arrow,
|
|
40
|
+
item,
|
|
40
41
|
// Events
|
|
41
42
|
onclick,
|
|
42
43
|
// Zag ---
|
|
43
44
|
...zagProps
|
|
44
|
-
}: ComboboxProps = $props();
|
|
45
|
+
}: ComboboxProps<T> = $props();
|
|
45
46
|
|
|
46
47
|
// Zag
|
|
47
48
|
let options = $state.raw(data);
|
|
@@ -58,6 +59,7 @@
|
|
|
58
59
|
const service = useMachine(combobox.machine, () => ({
|
|
59
60
|
id: id,
|
|
60
61
|
collection: collection,
|
|
62
|
+
...zagProps,
|
|
61
63
|
onOpenChange(event) {
|
|
62
64
|
options = data;
|
|
63
65
|
zagProps.onOpenChange?.(event);
|
|
@@ -66,8 +68,8 @@
|
|
|
66
68
|
const filtered = data.filter((item) => item.label.toLowerCase().includes(event.inputValue.toLowerCase()));
|
|
67
69
|
collection.setItems(filtered);
|
|
68
70
|
options = filtered;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
zagProps.onInputValueChange?.(event);
|
|
72
|
+
}
|
|
71
73
|
}));
|
|
72
74
|
const api = $derived(combobox.connect(service, normalizeProps));
|
|
73
75
|
const triggerProps = $derived(mergeProps(api.getTriggerProps(), { onclick }));
|
|
@@ -115,13 +117,18 @@
|
|
|
115
117
|
class="{contentBase} {contentBackground} {contentSpaceY} {contentClasses}"
|
|
116
118
|
style="z-index: {zIndex}"
|
|
117
119
|
>
|
|
118
|
-
{#each options as
|
|
119
|
-
{@const isChecked = api.getItemProps({ item })['data-state'] === 'checked'}
|
|
120
|
+
{#each options as option (option.label)}
|
|
121
|
+
{@const isChecked = api.getItemProps({ item: option })['data-state'] === 'checked'}
|
|
120
122
|
{@const displayClass = isChecked ? optionActive : optionHover}
|
|
121
123
|
<!-- Option -->
|
|
122
|
-
<!-- ZagJs should have set button type to "button" here.
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
<!-- ZagJs should have set button type to "button" here. -->
|
|
125
|
+
<!-- See https://github.com/skeletonlabs/skeleton/pull/2998#discussion_r1855511385 -->
|
|
126
|
+
<button {...api.getItemProps({ item: option })} class="{optionBase} {displayClass} {optionClasses}" type="button">
|
|
127
|
+
{#if item}
|
|
128
|
+
{@render item(option)}
|
|
129
|
+
{:else}
|
|
130
|
+
{option.label}
|
|
131
|
+
{/if}
|
|
125
132
|
</button>
|
|
126
133
|
{/each}
|
|
127
134
|
</nav>
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
import type { ComboboxProps } from './types.js';
|
|
2
|
-
declare
|
|
3
|
-
|
|
1
|
+
import type { ComboboxProps, ComboboxItem } from './types.js';
|
|
2
|
+
declare class __sveltets_Render<T extends ComboboxItem> {
|
|
3
|
+
props(): ComboboxProps<T>;
|
|
4
|
+
events(): {};
|
|
5
|
+
slots(): {};
|
|
6
|
+
bindings(): "";
|
|
7
|
+
exports(): {};
|
|
8
|
+
}
|
|
9
|
+
interface $$IsomorphicComponent {
|
|
10
|
+
new <T extends ComboboxItem>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
11
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
12
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
13
|
+
<T extends ComboboxItem>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
14
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
15
|
+
}
|
|
16
|
+
declare const Combobox: $$IsomorphicComponent;
|
|
17
|
+
type Combobox<T extends ComboboxItem> = InstanceType<typeof Combobox<T>>;
|
|
4
18
|
export default Combobox;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import * as combobox from '@zag-js/combobox';
|
|
3
|
-
export interface ComboboxProps extends Omit<combobox.Props, 'id' | 'collection'> {
|
|
3
|
+
export interface ComboboxProps<T extends ComboboxItem> extends Omit<combobox.Props, 'id' | 'collection'> {
|
|
4
4
|
/** Provide the list of label and value data */
|
|
5
|
-
data?:
|
|
6
|
-
label: string;
|
|
7
|
-
value: string;
|
|
8
|
-
}[];
|
|
5
|
+
data?: T[];
|
|
9
6
|
/** Set the label to display. */
|
|
10
7
|
label?: string;
|
|
8
|
+
/** Set z-index for the positioner. */
|
|
9
|
+
zIndex?: string;
|
|
11
10
|
/** Set base classes for the root element. */
|
|
12
11
|
base?: string;
|
|
13
12
|
/** Set width classes for the root element. */
|
|
@@ -32,8 +31,6 @@ export interface ComboboxProps extends Omit<combobox.Props, 'id' | 'collection'>
|
|
|
32
31
|
inputGroupClasses?: string;
|
|
33
32
|
/** Set base classes for the positioner. */
|
|
34
33
|
positionerBase?: string;
|
|
35
|
-
/** Set z-index for the positioner. */
|
|
36
|
-
zIndex?: string;
|
|
37
34
|
/** Provide arbitrary classes for the positioner. */
|
|
38
35
|
positionerClasses?: string;
|
|
39
36
|
/** Set base classes for the content. */
|
|
@@ -56,6 +53,12 @@ export interface ComboboxProps extends Omit<combobox.Props, 'id' | 'collection'>
|
|
|
56
53
|
optionClasses?: string;
|
|
57
54
|
/** Provide a custom arrow icon. */
|
|
58
55
|
arrow?: Snippet;
|
|
56
|
+
/** Provide a custom template for the option. */
|
|
57
|
+
item?: Snippet<[T]>;
|
|
59
58
|
/** Handle the combobox dropdown button click event. */
|
|
60
59
|
onclick?: (event: Event) => void;
|
|
61
60
|
}
|
|
61
|
+
export interface ComboboxItem {
|
|
62
|
+
label: string;
|
|
63
|
+
value: string;
|
|
64
|
+
}
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
{#if !children}
|
|
102
102
|
<ul {...api.getItemGroupProps()} class="{filesListBase} {filesListClasses}" data-testid="uploader-files-list">
|
|
103
103
|
<!-- Loop Files -->
|
|
104
|
-
{#each api.acceptedFiles as file}
|
|
104
|
+
{#each api.acceptedFiles as file (file.name)}
|
|
105
105
|
<!-- File -->
|
|
106
106
|
<li
|
|
107
107
|
{...api.getItemProps({ file })}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
// Base
|
|
9
9
|
base = '',
|
|
10
10
|
classes = '',
|
|
11
|
+
zIndex = 'auto',
|
|
11
12
|
// Trigger
|
|
12
13
|
triggerBase = '',
|
|
13
14
|
triggerBackground = '',
|
|
@@ -23,7 +24,6 @@
|
|
|
23
24
|
positionerJustify = 'justify-center',
|
|
24
25
|
positionerAlign = 'items-center',
|
|
25
26
|
positionerPadding = 'p-4',
|
|
26
|
-
zIndex = 'auto',
|
|
27
27
|
positionerClasses = '',
|
|
28
28
|
// Content
|
|
29
29
|
contentBase = '',
|
|
@@ -6,6 +6,8 @@ export interface ModalProps extends Omit<dialog.Props, 'id'> {
|
|
|
6
6
|
base?: string;
|
|
7
7
|
/** Provide arbitrary classes for the root element. */
|
|
8
8
|
classes?: string;
|
|
9
|
+
/** Set z-index for the positioner. */
|
|
10
|
+
zIndex?: string;
|
|
9
11
|
/** Set base classes for the trigger. */
|
|
10
12
|
triggerBase?: string;
|
|
11
13
|
/** Set background classes for the trigger. */
|
|
@@ -30,8 +32,6 @@ export interface ModalProps extends Omit<dialog.Props, 'id'> {
|
|
|
30
32
|
positionerAlign?: string;
|
|
31
33
|
/** Set padding classes for the positioner. */
|
|
32
34
|
positionerPadding?: string;
|
|
33
|
-
/** Set z-index for the positioner. */
|
|
34
|
-
zIndex?: string;
|
|
35
35
|
/** Provide arbitrary classes for the positioner. */
|
|
36
36
|
positionerClasses?: string;
|
|
37
37
|
/** Set base classes for the content. */
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
const {
|
|
9
9
|
arrow = false,
|
|
10
|
+
zIndex = 'auto',
|
|
10
11
|
// Base
|
|
11
12
|
base = '',
|
|
12
13
|
classes = '',
|
|
@@ -17,7 +18,6 @@
|
|
|
17
18
|
triggerAriaLabel = '',
|
|
18
19
|
// Positioner
|
|
19
20
|
positionerBase = '',
|
|
20
|
-
zIndex = 'auto',
|
|
21
21
|
positionerClasses = '',
|
|
22
22
|
// Content
|
|
23
23
|
contentBase = '',
|
|
@@ -3,6 +3,8 @@ import * as popover from '@zag-js/popover';
|
|
|
3
3
|
export interface PopoverProps extends Omit<popover.Props, 'id'> {
|
|
4
4
|
/** Enable display of the popover arrow. */
|
|
5
5
|
arrow?: boolean;
|
|
6
|
+
/** Set z-index for the positioner. */
|
|
7
|
+
zIndex?: string;
|
|
6
8
|
/** Set base classes for the root element. */
|
|
7
9
|
base?: string;
|
|
8
10
|
/** Provide arbitrary classes for the root element. */
|
|
@@ -17,8 +19,6 @@ export interface PopoverProps extends Omit<popover.Props, 'id'> {
|
|
|
17
19
|
triggerAriaLabel?: string;
|
|
18
20
|
/** Set base classes for the positioner. */
|
|
19
21
|
positionerBase?: string;
|
|
20
|
-
/** Set z-index for the positioner. */
|
|
21
|
-
zIndex?: string;
|
|
22
22
|
/** Provide arbitrary classes for the positioner. */
|
|
23
23
|
positionerClasses?: string;
|
|
24
24
|
/** Set base classes for the content. */
|
|
@@ -65,8 +65,9 @@
|
|
|
65
65
|
<!-- SVG -->
|
|
66
66
|
<svg
|
|
67
67
|
{...api.getCircleProps()}
|
|
68
|
+
viewBox="0 0 100 100"
|
|
68
69
|
class="{svgBase} {svgClasses} {rxAnimCircle}"
|
|
69
|
-
style="--size:
|
|
70
|
+
style="--size:100px;--thickness:{strokeWidth};"
|
|
70
71
|
data-testid="progress-ring-svg"
|
|
71
72
|
>
|
|
72
73
|
<!-- Track -->
|
|
@@ -72,6 +72,8 @@
|
|
|
72
72
|
</div>
|
|
73
73
|
<!-- NOTE: this div centers thumbs vertically -->
|
|
74
74
|
<div class={height} style="display: flex; align-items: center; transform: translateY(-100%);" data-testid="slider-thumb-wrapper">
|
|
75
|
+
<!-- Disabled: skipping this so we can match Zag implementation. -->
|
|
76
|
+
<!-- eslint-disable @typescript-eslint/no-unused-vars -->
|
|
75
77
|
{#each api.value as _, index}
|
|
76
78
|
<div {...api.getThumbProps({ index })}>
|
|
77
79
|
<!-- Thumb -->
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import * as tagsInput from '@zag-js/tags-input';
|
|
3
3
|
import { useMachine, normalizeProps } from '@zag-js/svelte';
|
|
4
|
-
|
|
5
4
|
import type { TagsInputProps } from './types.js';
|
|
6
5
|
|
|
7
6
|
// Props
|
|
@@ -16,16 +15,15 @@
|
|
|
16
15
|
inputBase = 'input-ghost',
|
|
17
16
|
inputClasses = '',
|
|
18
17
|
// Tag List
|
|
19
|
-
tagListBase = 'flex gap-
|
|
18
|
+
tagListBase = 'flex flex-wrap gap-1',
|
|
20
19
|
tagListClasses = '',
|
|
21
20
|
// Tag
|
|
22
21
|
tagBase = 'chip',
|
|
23
22
|
tagBackground = 'preset-filled',
|
|
24
23
|
tagClasses = '',
|
|
25
24
|
// Input: Edit
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
inputEditClasses,
|
|
25
|
+
tagEditInputBase = 'input',
|
|
26
|
+
tagEditInputClasses = '',
|
|
29
27
|
// Delete Button
|
|
30
28
|
buttonDeleteBase = '',
|
|
31
29
|
buttonDeleteClasses = '',
|
|
@@ -85,7 +83,7 @@
|
|
|
85
83
|
<!-- Editing -->
|
|
86
84
|
<input
|
|
87
85
|
{...api.getItemInputProps({ index, value })}
|
|
88
|
-
class="{
|
|
86
|
+
class="{tagEditInputBase} {tagEditInputClasses}"
|
|
89
87
|
style:display={itemState.editing ? '' : 'none'}
|
|
90
88
|
data-testid="tags-input-edit"
|
|
91
89
|
/>
|
|
@@ -26,11 +26,9 @@ export interface TagsInputProps extends Omit<tagsInput.Props, 'id'> {
|
|
|
26
26
|
/** Provide arbitrary classes to each tag. */
|
|
27
27
|
tagClasses?: string;
|
|
28
28
|
/** Set base classes for the edit tag input. */
|
|
29
|
-
|
|
30
|
-
/** Set background classes for the edit tag input. */
|
|
31
|
-
tagEditBackground?: string;
|
|
29
|
+
tagEditInputBase?: string;
|
|
32
30
|
/** Provide arbitrary classes to the edit tag input. */
|
|
33
|
-
|
|
31
|
+
tagEditInputClasses?: string;
|
|
34
32
|
/** Set base classes for the delete button. */
|
|
35
33
|
buttonDeleteBase?: string;
|
|
36
34
|
/** Provide arbitrary classes to the delete button. */
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
offset = '16px',
|
|
11
11
|
dismissLabel = '',
|
|
12
12
|
// Group
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
base = 'fixed flex flex-col items-end',
|
|
14
|
+
gap = 'gap-4',
|
|
15
|
+
zIndex = 'z-[888]',
|
|
16
|
+
classes = '',
|
|
17
17
|
// Toast
|
|
18
18
|
toastBase = 'card py-2 px-3 grid grid-cols-[1fr_auto] items-center',
|
|
19
19
|
toastPadding = 'py-2 px-3',
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
messageDescription = '',
|
|
27
27
|
messageClasses = '',
|
|
28
28
|
// Dismiss Button
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
buttonDismissBase = 'btn-icon btn-icon-sm text-base',
|
|
30
|
+
buttonDimissPreset = '',
|
|
31
|
+
buttonDismissHover = 'hover:preset-tonal',
|
|
32
|
+
buttonDismissClasses = '',
|
|
33
33
|
// State
|
|
34
34
|
stateInfo = 'preset-filled',
|
|
35
35
|
stateError = 'preset-filled-error-500',
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
}: ToastProviderProps = $props();
|
|
40
40
|
|
|
41
41
|
// Local
|
|
42
|
-
|
|
42
|
+
const defaults: Record<string, Toast> = {
|
|
43
43
|
info: { duration: 5000 },
|
|
44
44
|
error: { duration: 5000 },
|
|
45
45
|
success: { duration: 2000 }
|
|
46
46
|
};
|
|
47
|
-
|
|
47
|
+
const placementOptions: Record<string, PlacementStyles> = {
|
|
48
48
|
'top-start': { top: offset, left: offset, 'align-items': 'flex-start' },
|
|
49
49
|
'top-end': { top: offset, right: offset, 'align-items': 'flex-end' },
|
|
50
50
|
'bottom-start': { bottom: offset, left: offset, 'align-items': 'flex-start' },
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
<!-- Toast Group -->
|
|
98
98
|
{#if toastQueue.length}
|
|
99
99
|
<div
|
|
100
|
-
class="{
|
|
100
|
+
class="{base} {gap} {zIndex} {classes}"
|
|
101
101
|
style={formatStyleAttr(placementOptions[placement])}
|
|
102
102
|
data-part="root"
|
|
103
103
|
data-testid="toast-provider"
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
<!-- Dismiss -->
|
|
121
121
|
<button
|
|
122
122
|
type="button"
|
|
123
|
-
class="{
|
|
123
|
+
class="{buttonDismissBase} {buttonDimissPreset} {buttonDismissHover} {buttonDismissClasses}"
|
|
124
124
|
onclick={() => dismiss(toast.id)}
|
|
125
125
|
>
|
|
126
126
|
{#if dismissLabel}{dismissLabel}{:else}×{/if}
|
|
@@ -43,13 +43,13 @@ export interface ToastProviderProps {
|
|
|
43
43
|
*/
|
|
44
44
|
dismissLabel?: string;
|
|
45
45
|
/** Provide base classes for the root element. */
|
|
46
|
-
|
|
47
|
-
/** Provide z-index classes for the root element. */
|
|
48
|
-
groupZIndex?: string;
|
|
46
|
+
base?: string;
|
|
49
47
|
/** Provide gap classes for the root element. */
|
|
50
|
-
|
|
48
|
+
gap?: string;
|
|
49
|
+
/** Provide z-index classes for the root element. */
|
|
50
|
+
zIndex?: string;
|
|
51
51
|
/** Provide arbitrary classes for the root element. */
|
|
52
|
-
|
|
52
|
+
classes?: string;
|
|
53
53
|
/** Provide base classes for the toast cards. */
|
|
54
54
|
toastBase?: string;
|
|
55
55
|
/** Provide padding classes for the toast cards. */
|
|
@@ -69,13 +69,13 @@ export interface ToastProviderProps {
|
|
|
69
69
|
/** Provide arbitrary classes for the message region. */
|
|
70
70
|
messageClasses?: string;
|
|
71
71
|
/** Provide base classes for the dismiss button. */
|
|
72
|
-
|
|
72
|
+
buttonDismissBase?: string;
|
|
73
73
|
/** Provide preset classes for the dismiss button. */
|
|
74
|
-
|
|
74
|
+
buttonDimissPreset?: string;
|
|
75
75
|
/** Provide hover classes for the dismiss button. */
|
|
76
|
-
|
|
76
|
+
buttonDismissHover?: string;
|
|
77
77
|
/** Provide arbitrary classes for the dismiss button. */
|
|
78
|
-
|
|
78
|
+
buttonDismissClasses?: string;
|
|
79
79
|
/** Provide base classes for info toasts. */
|
|
80
80
|
stateInfo?: string;
|
|
81
81
|
/** Provide base classes for error toasts. */
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
const {
|
|
9
9
|
arrow = false,
|
|
10
|
+
zIndex = 'auto',
|
|
10
11
|
// Base
|
|
11
12
|
base = '',
|
|
12
13
|
classes = '',
|
|
@@ -17,7 +18,6 @@
|
|
|
17
18
|
triggerAriaLabel = '',
|
|
18
19
|
// Positioner
|
|
19
20
|
positionerBase = '',
|
|
20
|
-
zIndex = 'auto',
|
|
21
21
|
positionerClasses = '',
|
|
22
22
|
// Content
|
|
23
23
|
contentBase = '',
|
|
@@ -3,6 +3,8 @@ import * as tooltip from '@zag-js/tooltip';
|
|
|
3
3
|
export interface TooltipProps extends Omit<tooltip.Props, 'id'> {
|
|
4
4
|
/** Enable display of the popover arrow. */
|
|
5
5
|
arrow?: boolean;
|
|
6
|
+
/** Set z-index for the positioner. */
|
|
7
|
+
zIndex?: string;
|
|
6
8
|
/** Set base classes for the root element. */
|
|
7
9
|
base?: string;
|
|
8
10
|
/** Provide arbitrary classes for the root element. */
|
|
@@ -17,8 +19,6 @@ export interface TooltipProps extends Omit<tooltip.Props, 'id'> {
|
|
|
17
19
|
triggerAriaLabel?: string;
|
|
18
20
|
/** Set base classes for the positioner. */
|
|
19
21
|
positionerBase?: string;
|
|
20
|
-
/** Set z-index for the positioner. */
|
|
21
|
-
zIndex?: string;
|
|
22
22
|
/** Provide arbitrary classes for the positioner. */
|
|
23
23
|
positionerClasses?: string;
|
|
24
24
|
/** Set base styles for the content. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skeletonlabs/skeleton-svelte",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.22",
|
|
4
4
|
"description": "The Svelte package for Skeleton.",
|
|
5
5
|
"author": "endigo9740 <chris@skeletonlabs.dev>",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -13,54 +13,49 @@
|
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"dist",
|
|
16
|
-
"!dist/**/*.test.*"
|
|
17
|
-
"!dist/**/*.spec.*",
|
|
18
|
-
"./dist/**/*.svelte",
|
|
19
|
-
"./dist/**/*.js",
|
|
20
|
-
"./dist/**/*.d.ts",
|
|
21
|
-
"./dist/**/*.cjs",
|
|
22
|
-
"./dist/**/*.d.cts"
|
|
16
|
+
"!dist/**/*.test.*"
|
|
23
17
|
],
|
|
24
18
|
"dependencies": {
|
|
25
|
-
"@zag-js/accordion": "^1.
|
|
26
|
-
"@zag-js/avatar": "^1.
|
|
27
|
-
"@zag-js/combobox": "^1.
|
|
28
|
-
"@zag-js/dialog": "^1.
|
|
29
|
-
"@zag-js/file-upload": "^1.
|
|
30
|
-
"@zag-js/pagination": "^1.
|
|
31
|
-
"@zag-js/popover": "^1.
|
|
32
|
-
"@zag-js/progress": "^1.
|
|
33
|
-
"@zag-js/radio-group": "^1.
|
|
34
|
-
"@zag-js/rating-group": "^1.
|
|
35
|
-
"@zag-js/slider": "^1.
|
|
36
|
-
"@zag-js/svelte": "^1.
|
|
37
|
-
"@zag-js/switch": "^1.
|
|
38
|
-
"@zag-js/tabs": "^1.
|
|
39
|
-
"@zag-js/tags-input": "^1.
|
|
40
|
-
"@zag-js/tooltip": "^1.
|
|
19
|
+
"@zag-js/accordion": "^1.3.1",
|
|
20
|
+
"@zag-js/avatar": "^1.3.1",
|
|
21
|
+
"@zag-js/combobox": "^1.3.1",
|
|
22
|
+
"@zag-js/dialog": "^1.3.1",
|
|
23
|
+
"@zag-js/file-upload": "^1.3.1",
|
|
24
|
+
"@zag-js/pagination": "^1.3.1",
|
|
25
|
+
"@zag-js/popover": "^1.3.1",
|
|
26
|
+
"@zag-js/progress": "^1.3.1",
|
|
27
|
+
"@zag-js/radio-group": "^1.3.1",
|
|
28
|
+
"@zag-js/rating-group": "^1.3.1",
|
|
29
|
+
"@zag-js/slider": "^1.3.1",
|
|
30
|
+
"@zag-js/svelte": "^1.3.1",
|
|
31
|
+
"@zag-js/switch": "^1.3.1",
|
|
32
|
+
"@zag-js/tabs": "^1.3.1",
|
|
33
|
+
"@zag-js/tags-input": "^1.3.1",
|
|
34
|
+
"@zag-js/tooltip": "^1.3.1"
|
|
41
35
|
},
|
|
42
36
|
"peerDependencies": {
|
|
43
|
-
"svelte": "^5.
|
|
37
|
+
"svelte": "^5.20.0",
|
|
38
|
+
"@skeletonlabs/skeleton": "^3.0.0-next.13"
|
|
44
39
|
},
|
|
45
40
|
"devDependencies": {
|
|
46
|
-
"@sveltejs/adapter-auto": "^
|
|
47
|
-
"@sveltejs/kit": "^2.
|
|
48
|
-
"@sveltejs/package": "^2.3.
|
|
49
|
-
"@sveltejs/vite-plugin-svelte": "^5.0.
|
|
50
|
-
"@tailwindcss/forms": "^0.5.
|
|
51
|
-
"@tailwindcss/vite": "^4.0.
|
|
41
|
+
"@sveltejs/adapter-auto": "^4.0.0",
|
|
42
|
+
"@sveltejs/kit": "^2.19.0",
|
|
43
|
+
"@sveltejs/package": "^2.3.10",
|
|
44
|
+
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
|
45
|
+
"@tailwindcss/forms": "^0.5.10",
|
|
46
|
+
"@tailwindcss/vite": "^4.0.12",
|
|
52
47
|
"@testing-library/jest-dom": "^6.6.3",
|
|
53
|
-
"@testing-library/svelte": "^5.2.
|
|
54
|
-
"jsdom": "^
|
|
55
|
-
"publint": "^0.
|
|
56
|
-
"svelte": "^5.
|
|
57
|
-
"svelte-check": "^4.1.
|
|
58
|
-
"tailwindcss": "^4.0.
|
|
48
|
+
"@testing-library/svelte": "^5.2.7",
|
|
49
|
+
"jsdom": "^26.0.0",
|
|
50
|
+
"publint": "^0.3.9",
|
|
51
|
+
"svelte": "^5.22.1",
|
|
52
|
+
"svelte-check": "^4.1.5",
|
|
53
|
+
"tailwindcss": "^4.0.9",
|
|
59
54
|
"tslib": "^2.8.1",
|
|
60
|
-
"typescript": "^5.
|
|
61
|
-
"vite": "^6.
|
|
62
|
-
"vitest": "3.0.
|
|
63
|
-
"@skeletonlabs/skeleton": "3.0.0-next.
|
|
55
|
+
"typescript": "^5.8.2",
|
|
56
|
+
"vite": "^6.2.1",
|
|
57
|
+
"vitest": "3.0.8",
|
|
58
|
+
"@skeletonlabs/skeleton": "3.0.0-next.13"
|
|
64
59
|
},
|
|
65
60
|
"type": "module",
|
|
66
61
|
"scripts": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|