@skeletonlabs/skeleton-svelte 1.2.3 → 1.3.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.
- package/dist/components/AppBar/AppBar.svelte +1 -1
- package/dist/components/Combobox/types.d.ts +1 -1
- package/dist/components/Modal/types.d.ts +2 -1
- package/dist/components/Popover/Popover.svelte +6 -10
- package/dist/components/Popover/types.d.ts +7 -4
- package/dist/components/Tooltip/Tooltip.svelte +20 -21
- package/dist/components/Tooltip/types.d.ts +7 -4
- package/package.json +2 -2
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
|
|
44
44
|
<!-- @component A header element for the top of a page layout. -->
|
|
45
45
|
|
|
46
|
-
<header class="{base} {background} {spaceY} {border} {padding} {shadow} {classes}"
|
|
46
|
+
<header class="{base} {background} {spaceY} {border} {padding} {shadow} {classes}" data-testid="app-bar">
|
|
47
47
|
<section class="{toolbarBase} {toolbarGridCols} {toolbarGap} {toolbarClasses}" data-testid="app-bar-toolbar">
|
|
48
48
|
{#if lead}
|
|
49
49
|
<div class="{leadBase} {leadSpaceX} {leadPadding} {leadClasses}">
|
|
@@ -5,7 +5,7 @@ export interface ComboboxProps<T extends ComboboxItem> extends Omit<combobox.Pro
|
|
|
5
5
|
data?: T[];
|
|
6
6
|
/** Set the label to display. */
|
|
7
7
|
label?: string;
|
|
8
|
-
/** Set z-index
|
|
8
|
+
/** Set a positioner style for z-index, ex: "10" */
|
|
9
9
|
zIndex?: string;
|
|
10
10
|
/** Set base classes for the root element. */
|
|
11
11
|
base?: string;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import * as dialog from '@zag-js/dialog';
|
|
3
3
|
import type { FlyParams, FadeParams } from 'svelte/transition';
|
|
4
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
4
5
|
export interface ModalProps extends Omit<dialog.Props, 'id'> {
|
|
5
6
|
/** Set base classes for the root element. */
|
|
6
7
|
base?: string;
|
|
7
8
|
/** Provide arbitrary classes for the root element. */
|
|
8
9
|
classes?: string;
|
|
9
|
-
/** Set z-index
|
|
10
|
+
/** Set a positioner style for z-index, ex: "10" */
|
|
10
11
|
zIndex?: string;
|
|
11
12
|
/** Set base classes for the trigger. */
|
|
12
13
|
triggerBase?: string;
|
|
@@ -6,8 +6,11 @@
|
|
|
6
6
|
import type { PopoverProps } from './types.js';
|
|
7
7
|
|
|
8
8
|
const {
|
|
9
|
-
arrow = false,
|
|
10
9
|
zIndex = 'auto',
|
|
10
|
+
// Arrow
|
|
11
|
+
arrow = false,
|
|
12
|
+
arrowBackground = 'var(--color-surface-950-50)',
|
|
13
|
+
arrowSize = '10px',
|
|
11
14
|
// Base
|
|
12
15
|
base = '',
|
|
13
16
|
classes = '',
|
|
@@ -25,7 +28,6 @@
|
|
|
25
28
|
contentClasses = '',
|
|
26
29
|
// Arrow
|
|
27
30
|
arrowBase = '',
|
|
28
|
-
arrowBackground = '!bg-surface-200 dark:!bg-surface-800',
|
|
29
31
|
arrowClasses = '',
|
|
30
32
|
// Snippets
|
|
31
33
|
trigger,
|
|
@@ -60,8 +62,8 @@
|
|
|
60
62
|
<div {...api.getContentProps()} transition:fade={{ duration: 100 }} style="z-index: {zIndex};">
|
|
61
63
|
<!-- Arrow -->
|
|
62
64
|
{#if arrow}
|
|
63
|
-
<div {...api.getArrowProps()}>
|
|
64
|
-
<div {...api.getArrowTipProps()} class="{arrowBase} {
|
|
65
|
+
<div {...api.getArrowProps()} style:--arrow-size={arrowSize}>
|
|
66
|
+
<div {...api.getArrowTipProps()} class="{arrowBase} {arrowClasses}" style:--arrow-background={arrowBackground}></div>
|
|
65
67
|
</div>
|
|
66
68
|
{/if}
|
|
67
69
|
<!-- Snippet: Content -->
|
|
@@ -70,9 +72,3 @@
|
|
|
70
72
|
{/if}
|
|
71
73
|
</div>
|
|
72
74
|
</span>
|
|
73
|
-
|
|
74
|
-
<style>
|
|
75
|
-
:global([data-part='arrow']) {
|
|
76
|
-
--arrow-size: 10px;
|
|
77
|
-
}
|
|
78
|
-
</style>
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import * as popover from '@zag-js/popover';
|
|
3
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
3
4
|
export interface PopoverProps extends Omit<popover.Props, 'id'> {
|
|
5
|
+
/** Set a positioner style for z-index, ex: "10" */
|
|
6
|
+
zIndex?: string;
|
|
4
7
|
/** Enable display of the popover arrow. */
|
|
5
8
|
arrow?: boolean;
|
|
6
|
-
/** Set
|
|
7
|
-
|
|
9
|
+
/** Set a style value for --arrow-background, ex: "var(--color-surface-50-950)" */
|
|
10
|
+
arrowBackground?: string;
|
|
11
|
+
/** Set a style value for --arrow-size, ex: "10px" */
|
|
12
|
+
arrowSize?: string;
|
|
8
13
|
/** Set base classes for the root element. */
|
|
9
14
|
base?: string;
|
|
10
15
|
/** Provide arbitrary classes for the root element. */
|
|
@@ -29,8 +34,6 @@ export interface PopoverProps extends Omit<popover.Props, 'id'> {
|
|
|
29
34
|
contentClasses?: string;
|
|
30
35
|
/** Set base classes for the arrow. */
|
|
31
36
|
arrowBase?: string;
|
|
32
|
-
/** Set background classes for the arrow. */
|
|
33
|
-
arrowBackground?: string;
|
|
34
37
|
/** Provide arbitrary classes for the arrow. */
|
|
35
38
|
arrowClasses?: string;
|
|
36
39
|
/** Provide the template contents inside the trigger button. */
|
|
@@ -6,8 +6,11 @@
|
|
|
6
6
|
import type { TooltipProps } from './types.js';
|
|
7
7
|
|
|
8
8
|
const {
|
|
9
|
-
arrow = false,
|
|
10
9
|
zIndex = 'auto',
|
|
10
|
+
// Arrow
|
|
11
|
+
arrow = false,
|
|
12
|
+
arrowBackground = 'var(--color-surface-950-50)',
|
|
13
|
+
arrowSize = '10px',
|
|
11
14
|
// Base
|
|
12
15
|
base = '',
|
|
13
16
|
classes = '',
|
|
@@ -25,7 +28,7 @@
|
|
|
25
28
|
contentClasses = '',
|
|
26
29
|
// Arrow
|
|
27
30
|
arrowBase = '',
|
|
28
|
-
arrowBackground = '
|
|
31
|
+
// arrowBackground = '',
|
|
29
32
|
arrowClasses = '',
|
|
30
33
|
// Snippets
|
|
31
34
|
trigger,
|
|
@@ -55,25 +58,21 @@
|
|
|
55
58
|
</button>
|
|
56
59
|
{/if}
|
|
57
60
|
<!-- Tooltip Content -->
|
|
58
|
-
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
{
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
<div {...api.getPositionerProps()} class="{positionerBase} {positionerClasses}">
|
|
62
|
+
<!-- Popover -->
|
|
63
|
+
{#if api.open}
|
|
64
|
+
<div {...api.getContentProps()} transition:fade={{ duration: 100 }} style="z-index: {zIndex};">
|
|
65
|
+
<!-- Arrow -->
|
|
66
|
+
{#if arrow}
|
|
67
|
+
<div {...api.getArrowProps()} style:--arrow-size={arrowSize}>
|
|
68
|
+
<div {...api.getArrowTipProps()} class="{arrowBase} {arrowClasses}" style:--arrow-background={arrowBackground}></div>
|
|
69
|
+
</div>
|
|
70
|
+
{/if}
|
|
71
|
+
<!-- Snippet Content -->
|
|
72
|
+
<div class="{contentBase} {contentBackground} {contentClasses}">
|
|
73
|
+
{@render content?.()}
|
|
64
74
|
</div>
|
|
65
|
-
{/if}
|
|
66
|
-
<!-- Snippet Content -->
|
|
67
|
-
<div {...api.getContentProps()} class="{contentBase} {contentBackground} {contentClasses}" style="z-index: {zIndex};">
|
|
68
|
-
{@render content?.()}
|
|
69
75
|
</div>
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
{/if}
|
|
77
|
+
</div>
|
|
72
78
|
</span>
|
|
73
|
-
|
|
74
|
-
<style>
|
|
75
|
-
:global([data-part='arrow']) {
|
|
76
|
-
--arrow-size: 10px;
|
|
77
|
-
--arrow-background: white;
|
|
78
|
-
}
|
|
79
|
-
</style>
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import * as tooltip from '@zag-js/tooltip';
|
|
3
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
3
4
|
export interface TooltipProps extends Omit<tooltip.Props, 'id'> {
|
|
5
|
+
/** Set a positioner style for z-index, ex: "10" */
|
|
6
|
+
zIndex?: string;
|
|
4
7
|
/** Enable display of the popover arrow. */
|
|
5
8
|
arrow?: boolean;
|
|
6
|
-
/** Set
|
|
7
|
-
|
|
9
|
+
/** Set a style value for --arrow-background, ex: "var(--color-surface-50-950)" */
|
|
10
|
+
arrowBackground?: string;
|
|
11
|
+
/** Set a style value for --arrow-size, ex: "10px" */
|
|
12
|
+
arrowSize?: string;
|
|
8
13
|
/** Set base classes for the root element. */
|
|
9
14
|
base?: string;
|
|
10
15
|
/** Provide arbitrary classes for the root element. */
|
|
@@ -29,8 +34,6 @@ export interface TooltipProps extends Omit<tooltip.Props, 'id'> {
|
|
|
29
34
|
contentClasses?: string;
|
|
30
35
|
/** Set base classes for the arrow. */
|
|
31
36
|
arrowBase?: string;
|
|
32
|
-
/** Set background classes for the arrow. */
|
|
33
|
-
arrowBackground?: string;
|
|
34
37
|
/** Provide arbitrary classes for the arrow. */
|
|
35
38
|
arrowClasses?: string;
|
|
36
39
|
/** Provide the template contents inside the trigger button. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skeletonlabs/skeleton-svelte",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "The Svelte package for Skeleton.",
|
|
5
5
|
"author": "endigo9740 <chris@skeletonlabs.dev>",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"typescript": "^5.8.2",
|
|
56
56
|
"vite": "^6.2.5",
|
|
57
57
|
"vitest": "3.1.1",
|
|
58
|
-
"@skeletonlabs/skeleton": "3.1.
|
|
58
|
+
"@skeletonlabs/skeleton": "3.1.5"
|
|
59
59
|
},
|
|
60
60
|
"type": "module",
|
|
61
61
|
"scripts": {
|