@skeletonlabs/skeleton 2.2.0-dev.f9583337 → 2.3.0-dev.041af337
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/Accordion/AccordionItem.svelte +1 -1
- package/dist/components/FileButton/FileButton.svelte +4 -3
- package/dist/components/FileButton/FileButton.svelte.d.ts +2 -0
- package/dist/components/FileDropzone/FileDropzone.svelte +5 -0
- package/dist/components/FileDropzone/FileDropzone.svelte.d.ts +5 -0
- package/dist/components/ProgressRadial/ProgressRadial.svelte +5 -3
- package/dist/components/ProgressRadial/ProgressRadial.svelte.d.ts +2 -0
- package/dist/utilities/Drawer/Drawer.svelte +13 -10
- package/dist/utilities/Drawer/Drawer.svelte.d.ts +10 -8
- package/dist/utilities/Drawer/types.d.ts +2 -2
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ const dispatch = createEventDispatcher();
|
|
|
5
5
|
export let open = false;
|
|
6
6
|
export let id = String(Math.random());
|
|
7
7
|
const cBase = "";
|
|
8
|
-
const cControl = "text-
|
|
8
|
+
const cControl = "text-start w-full flex items-center space-x-4";
|
|
9
9
|
const cControlCaret = "fill-current w-3 transition-transform duration-[200ms]";
|
|
10
10
|
const cPanel = "";
|
|
11
11
|
export let autocollapse = getContext("autocollapse");
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script>export let files = void 0;
|
|
2
|
+
export let fileInput = void 0;
|
|
2
3
|
export let name;
|
|
3
4
|
export let width = "";
|
|
4
5
|
export let button = "btn variant-filled";
|
|
5
|
-
let elemFileInput;
|
|
6
6
|
function onButtonClick() {
|
|
7
|
-
|
|
7
|
+
if (fileInput)
|
|
8
|
+
fileInput.click();
|
|
8
9
|
}
|
|
9
10
|
function prunedRestProps() {
|
|
10
11
|
delete $$restProps.class;
|
|
@@ -19,7 +20,7 @@ $:
|
|
|
19
20
|
<div class="file-button {classesBase}" data-testid="file-button">
|
|
20
21
|
<!-- NOTE: Don't use `hidden` as it prevents `required` from operating -->
|
|
21
22
|
<div class="w-0 h-0 overflow-hidden">
|
|
22
|
-
<input type="file" bind:this={
|
|
23
|
+
<input type="file" bind:this={fileInput} bind:files {name} {...prunedRestProps()} on:change />
|
|
23
24
|
</div>
|
|
24
25
|
<!-- Button -->
|
|
25
26
|
<button
|
|
@@ -4,6 +4,8 @@ declare const __propDef: {
|
|
|
4
4
|
[x: string]: any;
|
|
5
5
|
/** Bind FileList to the file input.*/
|
|
6
6
|
files?: FileList | undefined;
|
|
7
|
+
/** File input reference.*/
|
|
8
|
+
fileInput?: HTMLInputElement | undefined;
|
|
7
9
|
/** Required. Set a unique name for the file input.*/
|
|
8
10
|
name: string;
|
|
9
11
|
/** Provide classes to set the width.*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script>export let files = void 0;
|
|
2
|
+
export let fileInput = void 0;
|
|
2
3
|
export let name;
|
|
3
4
|
export let border = "border-2 border-dashed";
|
|
4
5
|
export let padding = "p-4 py-8";
|
|
@@ -28,6 +29,7 @@ function prunedRestProps() {
|
|
|
28
29
|
<!-- NOTE: keep `bind:files` here, unlike FileButton -->
|
|
29
30
|
<input
|
|
30
31
|
bind:files
|
|
32
|
+
bind:this={fileInput}
|
|
31
33
|
type="file"
|
|
32
34
|
{name}
|
|
33
35
|
class="dropzone-input {classesInput}"
|
|
@@ -41,6 +43,9 @@ function prunedRestProps() {
|
|
|
41
43
|
on:keydown
|
|
42
44
|
on:keyup
|
|
43
45
|
on:keypress
|
|
46
|
+
on:focus
|
|
47
|
+
on:focusin
|
|
48
|
+
on:focusout
|
|
44
49
|
/>
|
|
45
50
|
<!-- Interface -->
|
|
46
51
|
<div class="dropzone-interface {classesInterface} {regionInterface}">
|
|
@@ -4,6 +4,8 @@ declare const __propDef: {
|
|
|
4
4
|
[x: string]: any;
|
|
5
5
|
/** Bind FileList to the file input.*/
|
|
6
6
|
files?: FileList | undefined;
|
|
7
|
+
/** File input reference.*/
|
|
8
|
+
fileInput?: HTMLInputElement | undefined;
|
|
7
9
|
/** Required. Set a unique name for the file input.*/
|
|
8
10
|
name: string;
|
|
9
11
|
/** Provide classes to set the border styles.*/
|
|
@@ -33,6 +35,9 @@ declare const __propDef: {
|
|
|
33
35
|
keydown: KeyboardEvent;
|
|
34
36
|
keyup: KeyboardEvent;
|
|
35
37
|
keypress: KeyboardEvent;
|
|
38
|
+
focus: FocusEvent;
|
|
39
|
+
focusin: FocusEvent;
|
|
40
|
+
focusout: FocusEvent;
|
|
36
41
|
} & {
|
|
37
42
|
[evt: string]: CustomEvent<any>;
|
|
38
43
|
};
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
export let value = void 0;
|
|
4
4
|
export let stroke = 40;
|
|
5
5
|
export let font = 56;
|
|
6
|
+
export let strokeLinecap = "butt";
|
|
6
7
|
export let width = "w-36";
|
|
7
8
|
export let meter = "stroke-surface-900 dark:stroke-surface-50";
|
|
8
9
|
export let track = "stroke-surface-500/30";
|
|
@@ -12,7 +13,7 @@ const cBase = "progress-radial relative overflow-hidden";
|
|
|
12
13
|
const cBaseTrack = "fill-transparent";
|
|
13
14
|
const cBaseMeter = "fill-transparent transition-[stroke-dashoffset] duration-200 -rotate-90 origin-[50%_50%]";
|
|
14
15
|
const baseSize = 512;
|
|
15
|
-
const radius = baseSize / 2;
|
|
16
|
+
const radius = baseSize / 2 - stroke / 2;
|
|
16
17
|
let circumference = radius;
|
|
17
18
|
let dashoffset;
|
|
18
19
|
function setProgress(percent) {
|
|
@@ -40,18 +41,19 @@ $:
|
|
|
40
41
|
<!-- Draw SVG -->
|
|
41
42
|
<svg viewBox="0 0 {baseSize} {baseSize}" class="rounded-full" class:animate-spin={value === undefined}>
|
|
42
43
|
<!-- Track -->
|
|
43
|
-
<circle class="progress-radial-track {cBaseTrack} {track}" stroke-width={stroke} r={
|
|
44
|
+
<circle class="progress-radial-track {cBaseTrack} {track}" stroke-width={stroke} r={radius} cx="50%" cy="50%" />
|
|
44
45
|
|
|
45
46
|
<!-- Meter -->
|
|
46
47
|
<circle
|
|
47
48
|
class="progress-radial-meter {cBaseMeter} {meter}"
|
|
48
49
|
stroke-width={stroke}
|
|
49
|
-
r={
|
|
50
|
+
r={radius}
|
|
50
51
|
cx="50%"
|
|
51
52
|
cy="50%"
|
|
52
53
|
style:stroke-dasharray="{circumference}
|
|
53
54
|
{circumference}"
|
|
54
55
|
style:stroke-dashoffset={dashoffset}
|
|
56
|
+
stroke-linecap={strokeLinecap}
|
|
55
57
|
/>
|
|
56
58
|
|
|
57
59
|
<!-- Center Text -->
|
|
@@ -8,6 +8,8 @@ declare const __propDef: {
|
|
|
8
8
|
stroke?: number | undefined;
|
|
9
9
|
/** Sets the base font size. Scales responsively.*/
|
|
10
10
|
font?: number | undefined;
|
|
11
|
+
/** Sets the stoke-linecap value*/
|
|
12
|
+
strokeLinecap?: "butt" | "round" | "square" | undefined;
|
|
11
13
|
/** Provide classes to set the width.*/
|
|
12
14
|
width?: string | undefined;
|
|
13
15
|
/** Provide classes to set meter color.*/
|
|
@@ -7,20 +7,21 @@ import { getDrawerStore } from "./stores.js";
|
|
|
7
7
|
import { fade, fly } from "svelte/transition";
|
|
8
8
|
import { dynamicTransition } from "../../internal/transitions.js";
|
|
9
9
|
export let position = "left";
|
|
10
|
-
export let bgBackdrop = "bg-surface-backdrop-token";
|
|
11
|
-
export let blur = "";
|
|
12
|
-
export let padding = "";
|
|
13
10
|
export let bgDrawer = "bg-surface-100-800-token";
|
|
14
11
|
export let border = "";
|
|
15
12
|
export let rounded = "";
|
|
16
13
|
export let shadow = "shadow-xl";
|
|
17
14
|
export let width = "";
|
|
18
15
|
export let height = "";
|
|
16
|
+
export let bgBackdrop = "bg-surface-backdrop-token";
|
|
17
|
+
export let blur = "";
|
|
18
|
+
export let padding = "";
|
|
19
19
|
export let zIndex = "z-40";
|
|
20
20
|
export let regionBackdrop = "";
|
|
21
21
|
export let regionDrawer = "";
|
|
22
22
|
export let labelledby = "";
|
|
23
23
|
export let describedby = "";
|
|
24
|
+
export let duration = 200;
|
|
24
25
|
export let transitions = !$prefersReducedMotionStore;
|
|
25
26
|
export let opacityTransition = true;
|
|
26
27
|
const presets = {
|
|
@@ -47,10 +48,11 @@ const propDefaults = {
|
|
|
47
48
|
width,
|
|
48
49
|
height,
|
|
49
50
|
opacityTransition,
|
|
51
|
+
regionBackdrop,
|
|
52
|
+
regionDrawer,
|
|
50
53
|
labelledby,
|
|
51
54
|
describedby,
|
|
52
|
-
|
|
53
|
-
regionDrawer
|
|
55
|
+
duration
|
|
54
56
|
};
|
|
55
57
|
function applyPropSettings(settings) {
|
|
56
58
|
position = settings.position || propDefaults.position;
|
|
@@ -63,11 +65,12 @@ function applyPropSettings(settings) {
|
|
|
63
65
|
shadow = settings.shadow || propDefaults.shadow;
|
|
64
66
|
width = settings.width || propDefaults.width;
|
|
65
67
|
height = settings.height || propDefaults.height;
|
|
66
|
-
opacityTransition = settings.opacityTransition || propDefaults.opacityTransition;
|
|
67
68
|
regionBackdrop = settings.regionBackdrop || propDefaults.regionBackdrop;
|
|
68
69
|
regionDrawer = settings.regionDrawer || propDefaults.regionDrawer;
|
|
69
70
|
labelledby = settings.labelledby || propDefaults.labelledby;
|
|
70
71
|
describedby = settings.describedby || propDefaults.describedby;
|
|
72
|
+
opacityTransition = settings.opacityTransition || propDefaults.opacityTransition;
|
|
73
|
+
duration = settings.duration || propDefaults.duration;
|
|
71
74
|
}
|
|
72
75
|
function applyAnimationSettings() {
|
|
73
76
|
if (!BROWSER)
|
|
@@ -140,12 +143,12 @@ $:
|
|
|
140
143
|
on:keypress
|
|
141
144
|
in:dynamicTransition|local={{
|
|
142
145
|
transition: fade,
|
|
143
|
-
params: { duration
|
|
146
|
+
params: { duration },
|
|
144
147
|
enabled: transitions && opacityTransition
|
|
145
148
|
}}
|
|
146
149
|
out:dynamicTransition|local={{
|
|
147
150
|
transition: fade,
|
|
148
|
-
params: { duration
|
|
151
|
+
params: { duration },
|
|
149
152
|
enabled: transitions && opacityTransition
|
|
150
153
|
}}
|
|
151
154
|
use:focusTrap={true}
|
|
@@ -162,12 +165,12 @@ $:
|
|
|
162
165
|
aria-describedby={describedby}
|
|
163
166
|
in:dynamicTransition|local={{
|
|
164
167
|
transition: fly,
|
|
165
|
-
params: { x: anim.x, y: anim.y, duration
|
|
168
|
+
params: { x: anim.x, y: anim.y, duration, opacity: opacityTransition ? undefined : 1 },
|
|
166
169
|
enabled: transitions
|
|
167
170
|
}}
|
|
168
171
|
out:dynamicTransition|local={{
|
|
169
172
|
transition: fly,
|
|
170
|
-
params: { x: anim.x, y: anim.y, duration
|
|
173
|
+
params: { x: anim.x, y: anim.y, duration, opacity: opacityTransition ? undefined : 1 },
|
|
171
174
|
enabled: transitions
|
|
172
175
|
}}
|
|
173
176
|
>
|
|
@@ -4,12 +4,6 @@ declare const __propDef: {
|
|
|
4
4
|
[x: string]: any;
|
|
5
5
|
/** Set the anchor position.*/
|
|
6
6
|
position?: "left" | "top" | "right" | "bottom" | undefined;
|
|
7
|
-
/** Backdrop - Provide classes to set the backdrop background color*/
|
|
8
|
-
bgBackdrop?: string | undefined;
|
|
9
|
-
/** Backdrop - Provide classes to set the blur style.*/
|
|
10
|
-
blur?: string | undefined;
|
|
11
|
-
/** Backdrop - Provide classes to set padding.*/
|
|
12
|
-
padding?: string | undefined;
|
|
13
7
|
/** Drawer - Provide classes to set the drawer background color.*/
|
|
14
8
|
bgDrawer?: string | undefined;
|
|
15
9
|
/** Drawer - Provide classes to set border color.*/
|
|
@@ -22,7 +16,13 @@ declare const __propDef: {
|
|
|
22
16
|
width?: string | undefined;
|
|
23
17
|
/** Drawer - Provide classes to override the height.*/
|
|
24
18
|
height?: string | undefined;
|
|
25
|
-
/** Provide
|
|
19
|
+
/** Backdrop - Provide classes to set the backdrop background color*/
|
|
20
|
+
bgBackdrop?: string | undefined;
|
|
21
|
+
/** Backdrop - Provide classes to set the blur style.*/
|
|
22
|
+
blur?: string | undefined;
|
|
23
|
+
/** Backdrop - Provide classes to set padding.*/
|
|
24
|
+
padding?: string | undefined;
|
|
25
|
+
/** Backdrop - Provide a class to override the z-index*/
|
|
26
26
|
zIndex?: string | undefined;
|
|
27
27
|
/** Provide arbitrary classes to the backdrop region.*/
|
|
28
28
|
regionBackdrop?: string | undefined;
|
|
@@ -32,9 +32,11 @@ declare const __propDef: {
|
|
|
32
32
|
labelledby?: string | undefined;
|
|
33
33
|
/** Provide an ID of the element describing the drawer.*/
|
|
34
34
|
describedby?: string | undefined;
|
|
35
|
+
/** Set the transition duration in milliseconds.*/
|
|
36
|
+
duration?: number | undefined;
|
|
35
37
|
/** Enable/Disable transitions*/
|
|
36
38
|
transitions?: boolean | undefined;
|
|
37
|
-
/**
|
|
39
|
+
/** Enable/Disable opacity transition of Drawer*/
|
|
38
40
|
opacityTransition?: boolean | undefined;
|
|
39
41
|
};
|
|
40
42
|
events: {
|
|
@@ -9,8 +9,6 @@ export interface DrawerSettings {
|
|
|
9
9
|
* @type {'left' | 'top' | 'right' | 'bottom'}
|
|
10
10
|
*/
|
|
11
11
|
position?: 'left' | 'top' | 'right' | 'bottom';
|
|
12
|
-
/** Define the Svelte transition animation duration.*/
|
|
13
|
-
duration?: number;
|
|
14
12
|
/** Backdrop - Provide classes to set the backdrop background color*/
|
|
15
13
|
bgBackdrop?: string;
|
|
16
14
|
/** Backdrop - Provide classes to set the blur style.*/
|
|
@@ -29,6 +27,8 @@ export interface DrawerSettings {
|
|
|
29
27
|
width?: string;
|
|
30
28
|
/** Drawer - Provide classes to override the height.*/
|
|
31
29
|
height?: string;
|
|
30
|
+
/** Define the Svelte transition animation duration.*/
|
|
31
|
+
duration?: number;
|
|
32
32
|
/** Drawer - Enable/Disable opacity transition */
|
|
33
33
|
opacityTransition?: boolean;
|
|
34
34
|
/** Provide arbitrary classes to the backdrop region. */
|