@skeletonlabs/skeleton-svelte 2.0.0-next.5 → 2.0.0-next.6

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.
Files changed (52) hide show
  1. package/dist/components/file-upload/anatomy/dropzone.svelte +35 -0
  2. package/dist/components/file-upload/anatomy/dropzone.svelte.d.ts +9 -0
  3. package/dist/components/file-upload/anatomy/dropzone.svelte.d.ts.map +1 -0
  4. package/dist/components/file-upload/anatomy/hidden-input.svelte +31 -0
  5. package/dist/components/file-upload/anatomy/hidden-input.svelte.d.ts +8 -0
  6. package/dist/components/file-upload/anatomy/hidden-input.svelte.d.ts.map +1 -0
  7. package/dist/components/file-upload/anatomy/item-delete-trigger.svelte +39 -0
  8. package/dist/components/file-upload/anatomy/item-delete-trigger.svelte.d.ts +8 -0
  9. package/dist/components/file-upload/anatomy/item-delete-trigger.svelte.d.ts.map +1 -0
  10. package/dist/components/file-upload/anatomy/item-group.svelte +33 -0
  11. package/dist/components/file-upload/anatomy/item-group.svelte.d.ts +8 -0
  12. package/dist/components/file-upload/anatomy/item-group.svelte.d.ts.map +1 -0
  13. package/dist/components/file-upload/anatomy/item-name.svelte +35 -0
  14. package/dist/components/file-upload/anatomy/item-name.svelte.d.ts +8 -0
  15. package/dist/components/file-upload/anatomy/item-name.svelte.d.ts.map +1 -0
  16. package/dist/components/file-upload/anatomy/item-size-text.svelte +35 -0
  17. package/dist/components/file-upload/anatomy/item-size-text.svelte.d.ts +8 -0
  18. package/dist/components/file-upload/anatomy/item-size-text.svelte.d.ts.map +1 -0
  19. package/dist/components/file-upload/anatomy/item.svelte +39 -0
  20. package/dist/components/file-upload/anatomy/item.svelte.d.ts +9 -0
  21. package/dist/components/file-upload/anatomy/item.svelte.d.ts.map +1 -0
  22. package/dist/components/file-upload/anatomy/root-context.svelte +20 -0
  23. package/dist/components/file-upload/anatomy/root-context.svelte.d.ts +9 -0
  24. package/dist/components/file-upload/anatomy/root-context.svelte.d.ts.map +1 -0
  25. package/dist/components/file-upload/anatomy/root-provider.svelte +37 -0
  26. package/dist/components/file-upload/anatomy/root-provider.svelte.d.ts +10 -0
  27. package/dist/components/file-upload/anatomy/root-provider.svelte.d.ts.map +1 -0
  28. package/dist/components/file-upload/anatomy/root.svelte +44 -0
  29. package/dist/components/file-upload/anatomy/root.svelte.d.ts +9 -0
  30. package/dist/components/file-upload/anatomy/root.svelte.d.ts.map +1 -0
  31. package/dist/components/file-upload/anatomy/trigger.svelte +33 -0
  32. package/dist/components/file-upload/anatomy/trigger.svelte.d.ts +8 -0
  33. package/dist/components/file-upload/anatomy/trigger.svelte.d.ts.map +1 -0
  34. package/dist/components/file-upload/index.d.ts +12 -0
  35. package/dist/components/file-upload/index.d.ts.map +1 -0
  36. package/dist/components/file-upload/index.js +2 -0
  37. package/dist/components/file-upload/modules/anatomy.d.ts +13 -0
  38. package/dist/components/file-upload/modules/anatomy.d.ts.map +1 -0
  39. package/dist/components/file-upload/modules/anatomy.js +23 -0
  40. package/dist/components/file-upload/modules/item-context.d.ts +7 -0
  41. package/dist/components/file-upload/modules/item-context.d.ts.map +1 -0
  42. package/dist/components/file-upload/modules/item-context.js +2 -0
  43. package/dist/components/file-upload/modules/root-context.d.ts +6 -0
  44. package/dist/components/file-upload/modules/root-context.d.ts.map +1 -0
  45. package/dist/components/file-upload/modules/root-context.js +2 -0
  46. package/dist/components/file-upload/modules/use-file-upload.svelte.d.ts +3 -0
  47. package/dist/components/file-upload/modules/use-file-upload.svelte.d.ts.map +1 -0
  48. package/dist/components/file-upload/modules/use-file-upload.svelte.js +7 -0
  49. package/dist/index.d.ts +1 -0
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +1 -0
  52. package/package.json +2 -2
@@ -0,0 +1,35 @@
1
+ <script lang="ts" module>
2
+ import type { DropzoneProps } from '@zag-js/file-upload';
3
+
4
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
5
+ import type { PropsWithElement } from '../../../internal/props-with-element';
6
+
7
+ export interface FileUploadDropzoneProps extends DropzoneProps, PropsWithElement<'div'>, HTMLAttributes<'div'> {}
8
+ </script>
9
+
10
+ <script lang="ts">
11
+ import { classesFileUpload } from '@skeletonlabs/skeleton-common';
12
+ import { mergeProps } from '@zag-js/svelte';
13
+
14
+ import { FileUploadRootContext } from '../modules/root-context';
15
+
16
+ const props: FileUploadDropzoneProps = $props();
17
+
18
+ const fileUpload = FileUploadRootContext.consume();
19
+
20
+ const { element, children, ...rest } = $derived(props);
21
+
22
+ const attributes = $derived(
23
+ mergeProps(fileUpload().getDropzoneProps(props), rest, {
24
+ class: classesFileUpload.dropzone,
25
+ }),
26
+ );
27
+ </script>
28
+
29
+ {#if element}
30
+ {@render element(attributes)}
31
+ {:else}
32
+ <div {...attributes}>
33
+ {@render children?.()}
34
+ </div>
35
+ {/if}
@@ -0,0 +1,9 @@
1
+ import type { DropzoneProps } from '@zag-js/file-upload';
2
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
3
+ import type { PropsWithElement } from '../../../internal/props-with-element';
4
+ export interface FileUploadDropzoneProps extends DropzoneProps, PropsWithElement<'div'>, HTMLAttributes<'div'> {
5
+ }
6
+ declare const Dropzone: import("svelte").Component<FileUploadDropzoneProps, {}, "">;
7
+ type Dropzone = ReturnType<typeof Dropzone>;
8
+ export default Dropzone;
9
+ //# sourceMappingURL=dropzone.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropzone.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/file-upload/anatomy/dropzone.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,uBAAwB,SAAQ,aAAa,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC;CAAG;AAuClH,QAAA,MAAM,QAAQ,6DAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,31 @@
1
+ <script lang="ts" module>
2
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
3
+ import type { PropsWithElement } from '../../../internal/props-with-element';
4
+
5
+ export interface FileUploadHiddenInputProps extends PropsWithElement<'input'>, HTMLAttributes<'input', 'children'> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import { classesFileUpload } from '@skeletonlabs/skeleton-common';
10
+ import { mergeProps } from '@zag-js/svelte';
11
+
12
+ import { FileUploadRootContext } from '../modules/root-context';
13
+
14
+ const props: FileUploadHiddenInputProps = $props();
15
+
16
+ const fileUpload = FileUploadRootContext.consume();
17
+
18
+ const { element, ...rest } = $derived(props);
19
+
20
+ const attributes = $derived(
21
+ mergeProps(fileUpload().getHiddenInputProps(), rest, {
22
+ class: classesFileUpload.hiddenInput,
23
+ }),
24
+ );
25
+ </script>
26
+
27
+ {#if element}
28
+ {@render element(attributes)}
29
+ {:else}
30
+ <input {...attributes} />
31
+ {/if}
@@ -0,0 +1,8 @@
1
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
2
+ import type { PropsWithElement } from '../../../internal/props-with-element';
3
+ export interface FileUploadHiddenInputProps extends PropsWithElement<'input'>, HTMLAttributes<'input', 'children'> {
4
+ }
5
+ declare const HiddenInput: import("svelte").Component<FileUploadHiddenInputProps, {}, "">;
6
+ type HiddenInput = ReturnType<typeof HiddenInput>;
7
+ export default HiddenInput;
8
+ //# sourceMappingURL=hidden-input.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hidden-input.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/file-upload/anatomy/hidden-input.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,0BAA2B,SAAQ,gBAAgB,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,EAAE,UAAU,CAAC;CAAG;AAqCtH,QAAA,MAAM,WAAW,gEAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
@@ -0,0 +1,39 @@
1
+ <script lang="ts" module>
2
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
3
+ import type { PropsWithElement } from '../../../internal/props-with-element';
4
+
5
+ export interface FileUploadItemDeleteTriggerProps extends PropsWithElement<'button'>, HTMLAttributes<'button'> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import { classesFileUpload } from '@skeletonlabs/skeleton-common';
10
+ import { mergeProps } from '@zag-js/svelte';
11
+
12
+ import { FileUploadItemContext } from '../modules/item-context';
13
+ import { FileUploadRootContext } from '../modules/root-context';
14
+
15
+ const props: FileUploadItemDeleteTriggerProps = $props();
16
+
17
+ const fileUpload = FileUploadRootContext.consume();
18
+ const itemProps = FileUploadItemContext.consume();
19
+
20
+ const { element, children = times, ...rest } = $derived(props);
21
+
22
+ const attributes = $derived(
23
+ mergeProps(fileUpload().getItemDeleteTriggerProps(itemProps()), rest, {
24
+ class: classesFileUpload.itemDeleteTrigger,
25
+ }),
26
+ );
27
+ </script>
28
+
29
+ {#snippet times()}
30
+ &times;
31
+ {/snippet}
32
+
33
+ {#if element}
34
+ {@render element(attributes)}
35
+ {:else}
36
+ <button {...attributes}>
37
+ {@render children?.()}
38
+ </button>
39
+ {/if}
@@ -0,0 +1,8 @@
1
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
2
+ import type { PropsWithElement } from '../../../internal/props-with-element';
3
+ export interface FileUploadItemDeleteTriggerProps extends PropsWithElement<'button'>, HTMLAttributes<'button'> {
4
+ }
5
+ declare const ItemDeleteTrigger: import("svelte").Component<FileUploadItemDeleteTriggerProps, {}, "">;
6
+ type ItemDeleteTrigger = ReturnType<typeof ItemDeleteTrigger>;
7
+ export default ItemDeleteTrigger;
8
+ //# sourceMappingURL=item-delete-trigger.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item-delete-trigger.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/file-upload/anatomy/item-delete-trigger.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,gCAAiC,SAAQ,gBAAgB,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC;CAAG;AA4ClH,QAAA,MAAM,iBAAiB,sEAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,33 @@
1
+ <script lang="ts" module>
2
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
3
+ import type { PropsWithElement } from '../../../internal/props-with-element';
4
+
5
+ export interface FileUploadItemGroupProps extends PropsWithElement<'ul'>, HTMLAttributes<'ul'> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import { classesFileUpload } from '@skeletonlabs/skeleton-common';
10
+ import { mergeProps } from '@zag-js/svelte';
11
+
12
+ import { FileUploadRootContext } from '../modules/root-context';
13
+
14
+ const props: FileUploadItemGroupProps = $props();
15
+
16
+ const fileUpload = FileUploadRootContext.consume();
17
+
18
+ const { element, children, ...rest } = $derived(props);
19
+
20
+ const attributes = $derived(
21
+ mergeProps(fileUpload().getItemGroupProps(), rest, {
22
+ class: classesFileUpload.itemGroup,
23
+ }),
24
+ );
25
+ </script>
26
+
27
+ {#if element}
28
+ {@render element(attributes)}
29
+ {:else}
30
+ <ul {...attributes}>
31
+ {@render children?.()}
32
+ </ul>
33
+ {/if}
@@ -0,0 +1,8 @@
1
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
2
+ import type { PropsWithElement } from '../../../internal/props-with-element';
3
+ export interface FileUploadItemGroupProps extends PropsWithElement<'ul'>, HTMLAttributes<'ul'> {
4
+ }
5
+ declare const ItemGroup: import("svelte").Component<FileUploadItemGroupProps, {}, "">;
6
+ type ItemGroup = ReturnType<typeof ItemGroup>;
7
+ export default ItemGroup;
8
+ //# sourceMappingURL=item-group.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item-group.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/file-upload/anatomy/item-group.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC;CAAG;AAuClG,QAAA,MAAM,SAAS,8DAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
@@ -0,0 +1,35 @@
1
+ <script lang="ts" module>
2
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
3
+ import type { PropsWithElement } from '../../../internal/props-with-element';
4
+
5
+ export interface FileUploadItemNameProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import { classesFileUpload } from '@skeletonlabs/skeleton-common';
10
+ import { mergeProps } from '@zag-js/svelte';
11
+
12
+ import { FileUploadItemContext } from '../modules/item-context';
13
+ import { FileUploadRootContext } from '../modules/root-context';
14
+
15
+ const props: FileUploadItemNameProps = $props();
16
+
17
+ const fileUpload = FileUploadRootContext.consume();
18
+ const itemProps = FileUploadItemContext.consume();
19
+
20
+ const { element, children, ...rest } = $derived(props);
21
+
22
+ const attributes = $derived(
23
+ mergeProps(fileUpload().getItemNameProps(itemProps()), rest, {
24
+ class: classesFileUpload.itemName,
25
+ }),
26
+ );
27
+ </script>
28
+
29
+ {#if element}
30
+ {@render element(attributes)}
31
+ {:else}
32
+ <div {...attributes}>
33
+ {@render children?.()}
34
+ </div>
35
+ {/if}
@@ -0,0 +1,8 @@
1
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
2
+ import type { PropsWithElement } from '../../../internal/props-with-element';
3
+ export interface FileUploadItemNameProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {
4
+ }
5
+ declare const ItemName: import("svelte").Component<FileUploadItemNameProps, {}, "">;
6
+ type ItemName = ReturnType<typeof ItemName>;
7
+ export default ItemName;
8
+ //# sourceMappingURL=item-name.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item-name.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/file-upload/anatomy/item-name.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,uBAAwB,SAAQ,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC;CAAG;AA0CnG,QAAA,MAAM,QAAQ,6DAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,35 @@
1
+ <script lang="ts" module>
2
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
3
+ import type { PropsWithElement } from '../../../internal/props-with-element';
4
+
5
+ export interface FileUploadItemSizeTextProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import { classesFileUpload } from '@skeletonlabs/skeleton-common';
10
+ import { mergeProps } from '@zag-js/svelte';
11
+
12
+ import { FileUploadItemContext } from '../modules/item-context';
13
+ import { FileUploadRootContext } from '../modules/root-context';
14
+
15
+ const props: FileUploadItemSizeTextProps = $props();
16
+
17
+ const fileUpload = FileUploadRootContext.consume();
18
+ const itemProps = FileUploadItemContext.consume();
19
+
20
+ const { element, children, ...rest } = $derived(props);
21
+
22
+ const attributes = $derived(
23
+ mergeProps(fileUpload().getItemSizeTextProps(itemProps()), rest, {
24
+ class: classesFileUpload.itemSizeText,
25
+ }),
26
+ );
27
+ </script>
28
+
29
+ {#if element}
30
+ {@render element(attributes)}
31
+ {:else}
32
+ <div {...attributes}>
33
+ {@render children?.()}
34
+ </div>
35
+ {/if}
@@ -0,0 +1,8 @@
1
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
2
+ import type { PropsWithElement } from '../../../internal/props-with-element';
3
+ export interface FileUploadItemSizeTextProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {
4
+ }
5
+ declare const ItemSizeText: import("svelte").Component<FileUploadItemSizeTextProps, {}, "">;
6
+ type ItemSizeText = ReturnType<typeof ItemSizeText>;
7
+ export default ItemSizeText;
8
+ //# sourceMappingURL=item-size-text.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item-size-text.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/file-upload/anatomy/item-size-text.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC;CAAG;AA0CvG,QAAA,MAAM,YAAY,iEAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
@@ -0,0 +1,39 @@
1
+ <script lang="ts" module>
2
+ import { type ItemProps, splitItemProps } from '@zag-js/file-upload';
3
+
4
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
5
+ import type { PropsWithElement } from '../../../internal/props-with-element';
6
+
7
+ export interface FileUploadItemProps extends ItemProps, PropsWithElement<'li'>, HTMLAttributes<'li'> {}
8
+ </script>
9
+
10
+ <script lang="ts">
11
+ import { classesFileUpload } from '@skeletonlabs/skeleton-common';
12
+ import { mergeProps } from '@zag-js/svelte';
13
+
14
+ import { FileUploadItemContext } from '../modules/item-context';
15
+ import { FileUploadRootContext } from '../modules/root-context';
16
+
17
+ const props: FileUploadItemProps = $props();
18
+
19
+ const fileUpload = FileUploadRootContext.consume();
20
+
21
+ const [itemProps, componentProps] = $derived(splitItemProps(props));
22
+ const { element, children, ...rest } = $derived(componentProps);
23
+
24
+ const attributes = $derived(
25
+ mergeProps(fileUpload().getItemProps(itemProps), rest, {
26
+ class: classesFileUpload.item,
27
+ }),
28
+ );
29
+
30
+ FileUploadItemContext.provide(() => itemProps);
31
+ </script>
32
+
33
+ {#if element}
34
+ {@render element(attributes)}
35
+ {:else}
36
+ <li {...attributes}>
37
+ {@render children?.()}
38
+ </li>
39
+ {/if}
@@ -0,0 +1,9 @@
1
+ import { type ItemProps } from '@zag-js/file-upload';
2
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
3
+ import type { PropsWithElement } from '../../../internal/props-with-element';
4
+ export interface FileUploadItemProps extends ItemProps, PropsWithElement<'li'>, HTMLAttributes<'li'> {
5
+ }
6
+ declare const Item: import("svelte").Component<FileUploadItemProps, {}, "">;
7
+ type Item = ReturnType<typeof Item>;
8
+ export default Item;
9
+ //# sourceMappingURL=item.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/file-upload/anatomy/item.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,EAAE,KAAK,SAAS,EAAkB,MAAM,qBAAqB,CAAC;AAErE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,mBAAoB,SAAQ,SAAS,EAAE,gBAAgB,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC;CAAG;AA4CxG,QAAA,MAAM,IAAI,yDAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
@@ -0,0 +1,20 @@
1
+ <script lang="ts" module>
2
+ import type { Snippet } from 'svelte';
3
+
4
+ export interface FileUploadRootContextProps {
5
+ children: Snippet<[ReturnType<typeof useFileUpload>]>;
6
+ }
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import { FileUploadRootContext } from '../modules/root-context';
11
+ import type { useFileUpload } from '../modules/use-file-upload.svelte';
12
+
13
+ const props: FileUploadRootContextProps = $props();
14
+
15
+ const fileUpload = FileUploadRootContext.consume();
16
+
17
+ const { children } = $derived(props);
18
+ </script>
19
+
20
+ {@render children(fileUpload)}
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ export interface FileUploadRootContextProps {
3
+ children: Snippet<[ReturnType<typeof useFileUpload>]>;
4
+ }
5
+ import type { useFileUpload } from '../modules/use-file-upload.svelte';
6
+ declare const RootContext: import("svelte").Component<FileUploadRootContextProps, {}, "">;
7
+ type RootContext = ReturnType<typeof RootContext>;
8
+ export default RootContext;
9
+ //# sourceMappingURL=root-context.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-context.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/file-upload/anatomy/root-context.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,EAAE,OAAO,CAAC,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC;CACtD;AAIF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAmBvE,QAAA,MAAM,WAAW,gEAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
@@ -0,0 +1,37 @@
1
+ <script lang="ts" module>
2
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
3
+ import type { PropsWithElement } from '../../../internal/props-with-element';
4
+
5
+ import type { useFileUpload } from '../modules/use-file-upload.svelte';
6
+
7
+ export interface FileUploadRootProviderProps extends PropsWithElement<'div'>, Omit<HTMLAttributes<'div'>, 'id' | 'dir'> {
8
+ value: ReturnType<typeof useFileUpload>;
9
+ }
10
+ </script>
11
+
12
+ <script lang="ts">
13
+ import { classesFileUpload } from '@skeletonlabs/skeleton-common';
14
+ import { mergeProps } from '@zag-js/svelte';
15
+
16
+ import { FileUploadRootContext } from '../modules/root-context';
17
+
18
+ const props: FileUploadRootProviderProps = $props();
19
+
20
+ const { element, children, value: api, ...rest } = $derived(props);
21
+
22
+ const attributes = $derived(
23
+ mergeProps(api().getRootProps(), rest, {
24
+ class: classesFileUpload.root,
25
+ }),
26
+ );
27
+
28
+ FileUploadRootContext.provide(() => api());
29
+ </script>
30
+
31
+ {#if element}
32
+ {@render element(attributes)}
33
+ {:else}
34
+ <div {...attributes}>
35
+ {@render children?.()}
36
+ </div>
37
+ {/if}
@@ -0,0 +1,10 @@
1
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
2
+ import type { PropsWithElement } from '../../../internal/props-with-element';
3
+ import type { useFileUpload } from '../modules/use-file-upload.svelte';
4
+ export interface FileUploadRootProviderProps extends PropsWithElement<'div'>, Omit<HTMLAttributes<'div'>, 'id' | 'dir'> {
5
+ value: ReturnType<typeof useFileUpload>;
6
+ }
7
+ declare const RootProvider: import("svelte").Component<FileUploadRootProviderProps, {}, "">;
8
+ type RootProvider = ReturnType<typeof RootProvider>;
9
+ export default RootProvider;
10
+ //# sourceMappingURL=root-provider.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-provider.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/file-upload/anatomy/root-provider.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAEvE,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC;IACtH,KAAK,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;CACxC;AAuCF,QAAA,MAAM,YAAY,iEAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
@@ -0,0 +1,44 @@
1
+ <script lang="ts" module>
2
+ import type { Props } from '@zag-js/file-upload';
3
+
4
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
5
+ import type { PropsWithElement } from '../../../internal/props-with-element';
6
+
7
+ export interface FileUploadRootProps extends Omit<Props, 'id'>, PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {}
8
+ </script>
9
+
10
+ <script lang="ts">
11
+ import { classesFileUpload } from '@skeletonlabs/skeleton-common';
12
+ import { splitProps } from '@zag-js/file-upload';
13
+ import { mergeProps } from '@zag-js/svelte';
14
+
15
+ import { FileUploadRootContext } from '../modules/root-context';
16
+ import { useFileUpload } from '../modules/use-file-upload.svelte';
17
+
18
+ const props: FileUploadRootProps = $props();
19
+
20
+ const [machineProps, componentProps] = $derived(splitProps(props));
21
+ const { element, children, ...rest } = $derived(componentProps);
22
+
23
+ const id = $props.id();
24
+ const fileUpload = useFileUpload(() => ({
25
+ id: id,
26
+ ...machineProps,
27
+ }));
28
+
29
+ const attributes = $derived(
30
+ mergeProps(fileUpload().getRootProps(), rest, {
31
+ class: classesFileUpload.root,
32
+ }),
33
+ );
34
+
35
+ FileUploadRootContext.provide(() => fileUpload());
36
+ </script>
37
+
38
+ {#if element}
39
+ {@render element(attributes)}
40
+ {:else}
41
+ <div {...attributes}>
42
+ {@render children?.()}
43
+ </div>
44
+ {/if}
@@ -0,0 +1,9 @@
1
+ import type { Props } from '@zag-js/file-upload';
2
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
3
+ import type { PropsWithElement } from '../../../internal/props-with-element';
4
+ export interface FileUploadRootProps extends Omit<Props, 'id'>, PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
5
+ }
6
+ declare const Root: import("svelte").Component<FileUploadRootProps, {}, "">;
7
+ type Root = ReturnType<typeof Root>;
8
+ export default Root;
9
+ //# sourceMappingURL=root.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/file-upload/anatomy/root.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,EAAE,IAAI,GAAG,KAAK,CAAC;CAAG;AAkDhI,QAAA,MAAM,IAAI,yDAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
@@ -0,0 +1,33 @@
1
+ <script lang="ts" module>
2
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
3
+ import type { PropsWithElement } from '../../../internal/props-with-element';
4
+
5
+ export interface FileUploadTriggerProps extends PropsWithElement<'button'>, HTMLAttributes<'button'> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import { classesFileUpload } from '@skeletonlabs/skeleton-common';
10
+ import { mergeProps } from '@zag-js/svelte';
11
+
12
+ import { FileUploadRootContext } from '../modules/root-context';
13
+
14
+ const props: FileUploadTriggerProps = $props();
15
+
16
+ const fileUpload = FileUploadRootContext.consume();
17
+
18
+ const { element, children, ...rest } = $derived(props);
19
+
20
+ const attributes = $derived(
21
+ mergeProps(fileUpload().getTriggerProps(), rest, {
22
+ class: classesFileUpload.trigger,
23
+ }),
24
+ );
25
+ </script>
26
+
27
+ {#if element}
28
+ {@render element(attributes)}
29
+ {:else}
30
+ <button {...attributes}>
31
+ {@render children?.()}
32
+ </button>
33
+ {/if}
@@ -0,0 +1,8 @@
1
+ import type { HTMLAttributes } from '../../../internal/html-attributes';
2
+ import type { PropsWithElement } from '../../../internal/props-with-element';
3
+ export interface FileUploadTriggerProps extends PropsWithElement<'button'>, HTMLAttributes<'button'> {
4
+ }
5
+ declare const Trigger: import("svelte").Component<FileUploadTriggerProps, {}, "">;
6
+ type Trigger = ReturnType<typeof Trigger>;
7
+ export default Trigger;
8
+ //# sourceMappingURL=trigger.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trigger.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/file-upload/anatomy/trigger.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC;CAAG;AAuCxG,QAAA,MAAM,OAAO,4DAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
@@ -0,0 +1,12 @@
1
+ export type { FileUploadDropzoneProps } from './anatomy/dropzone.svelte';
2
+ export type { FileUploadItemProps } from './anatomy/item.svelte';
3
+ export type { FileUploadItemDeleteTriggerProps } from './anatomy/item-delete-trigger.svelte';
4
+ export type { FileUploadItemGroupProps } from './anatomy/item-group.svelte';
5
+ export type { FileUploadItemNameProps } from './anatomy/item-name.svelte';
6
+ export type { FileUploadRootProps } from './anatomy/root.svelte';
7
+ export type { FileUploadRootContextProps } from './anatomy/root-context.svelte';
8
+ export type { FileUploadRootProviderProps } from './anatomy/root-provider.svelte';
9
+ export type { FileUploadTriggerProps } from './anatomy/trigger.svelte';
10
+ export { FileUpload } from './modules/anatomy';
11
+ export { useFileUpload } from './modules/use-file-upload.svelte';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/file-upload/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,gCAAgC,EAAE,MAAM,sCAAsC,CAAC;AAC7F,YAAY,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,YAAY,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,YAAY,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAChF,YAAY,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAClF,YAAY,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { FileUpload } from './modules/anatomy';
2
+ export { useFileUpload } from './modules/use-file-upload.svelte';
@@ -0,0 +1,13 @@
1
+ export declare const FileUpload: import("svelte").Component<import("../anatomy/root.svelte").FileUploadRootProps, {}, ""> & {
2
+ Provider: import("svelte").Component<import("../anatomy/root-provider.svelte").FileUploadRootProviderProps, {}, "">;
3
+ Context: import("svelte").Component<import("../anatomy/root-context.svelte").FileUploadRootContextProps, {}, "">;
4
+ Dropzone: import("svelte").Component<import("../anatomy/dropzone.svelte").FileUploadDropzoneProps, {}, "">;
5
+ Trigger: import("svelte").Component<import("../anatomy/trigger.svelte").FileUploadTriggerProps, {}, "">;
6
+ HiddenInput: import("svelte").Component<import("../anatomy/hidden-input.svelte").FileUploadHiddenInputProps, {}, "">;
7
+ ItemGroup: import("svelte").Component<import("../anatomy/item-group.svelte").FileUploadItemGroupProps, {}, "">;
8
+ Item: import("svelte").Component<import("../anatomy/item.svelte").FileUploadItemProps, {}, "">;
9
+ ItemName: import("svelte").Component<import("../anatomy/item-name.svelte").FileUploadItemNameProps, {}, "">;
10
+ ItemSizeText: import("svelte").Component<import("../anatomy/item-size-text.svelte").FileUploadItemSizeTextProps, {}, "">;
11
+ ItemDeleteTrigger: import("svelte").Component<import("../anatomy/item-delete-trigger.svelte").FileUploadItemDeleteTriggerProps, {}, "">;
12
+ };
13
+ //# sourceMappingURL=anatomy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anatomy.d.ts","sourceRoot":"","sources":["../../../../src/components/file-upload/modules/anatomy.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,UAAU;;;;;;;;;;;CAWrB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import Dropzone from '../anatomy/dropzone.svelte';
2
+ import HiddenInput from '../anatomy/hidden-input.svelte';
3
+ import Item from '../anatomy/item.svelte';
4
+ import ItemDeleteTrigger from '../anatomy/item-delete-trigger.svelte';
5
+ import ItemGroup from '../anatomy/item-group.svelte';
6
+ import ItemName from '../anatomy/item-name.svelte';
7
+ import ItemSizeText from '../anatomy/item-size-text.svelte';
8
+ import Root from '../anatomy/root.svelte';
9
+ import RootContext from '../anatomy/root-context.svelte';
10
+ import RootProvider from '../anatomy/root-provider.svelte';
11
+ import Trigger from '../anatomy/trigger.svelte';
12
+ export const FileUpload = Object.assign(Root, {
13
+ Provider: RootProvider,
14
+ Context: RootContext,
15
+ Dropzone: Dropzone,
16
+ Trigger: Trigger,
17
+ HiddenInput: HiddenInput,
18
+ ItemGroup: ItemGroup,
19
+ Item: Item,
20
+ ItemName: ItemName,
21
+ ItemSizeText: ItemSizeText,
22
+ ItemDeleteTrigger: ItemDeleteTrigger,
23
+ });
@@ -0,0 +1,7 @@
1
+ import type { ItemProps } from '@zag-js/file-upload';
2
+ export declare const FileUploadItemContext: {
3
+ key: symbol;
4
+ consume(): () => ItemProps;
5
+ provide(value: () => ItemProps): () => ItemProps;
6
+ };
7
+ //# sourceMappingURL=item-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item-context.d.ts","sourceRoot":"","sources":["../../../../src/components/file-upload/modules/item-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIrD,eAAO,MAAM,qBAAqB;;qBAAuB,SAAS;yBAAT,SAAS,SAAT,SAAS;CAAG,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { createContext } from '../../../internal/create-context';
2
+ export const FileUploadItemContext = createContext();
@@ -0,0 +1,6 @@
1
+ export declare const FileUploadRootContext: {
2
+ key: symbol;
3
+ consume(): () => import("@zag-js/file-upload").Api;
4
+ provide(value: () => import("@zag-js/file-upload").Api): () => import("@zag-js/file-upload").Api;
5
+ };
6
+ //# sourceMappingURL=root-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-context.d.ts","sourceRoot":"","sources":["../../../../src/components/file-upload/modules/root-context.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB;;;;CAAoD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { createContext } from '../../../internal/create-context';
2
+ export const FileUploadRootContext = createContext();
@@ -0,0 +1,3 @@
1
+ import { type Api, type Props } from '@zag-js/file-upload';
2
+ export declare function useFileUpload(props: Props | (() => Props)): () => Api;
3
+ //# sourceMappingURL=use-file-upload.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-file-upload.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/file-upload/modules/use-file-upload.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAoB,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG7E,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,GAAG,MAAM,GAAG,CAIrE"}
@@ -0,0 +1,7 @@
1
+ import { connect, machine } from '@zag-js/file-upload';
2
+ import { normalizeProps, useMachine } from '@zag-js/svelte';
3
+ export function useFileUpload(props) {
4
+ const service = useMachine(machine, props);
5
+ const api = $derived(connect(service, normalizeProps));
6
+ return () => api;
7
+ }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './components/accordion/index';
2
2
  export * from './components/avatar/index';
3
+ export * from './components/file-upload/index';
3
4
  export * from './components/progress-linear/index';
4
5
  export * from './components/rating-group/index';
5
6
  export * from './components/switch/index';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './components/accordion/index';
2
2
  export * from './components/avatar/index';
3
+ export * from './components/file-upload/index';
3
4
  export * from './components/progress-linear/index';
4
5
  export * from './components/rating-group/index';
5
6
  export * from './components/switch/index';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skeletonlabs/skeleton-svelte",
3
- "version": "2.0.0-next.5",
3
+ "version": "2.0.0-next.6",
4
4
  "description": "The Svelte package for Skeleton.",
5
5
  "author": "endigo9740 <chris@skeletonlabs.dev>",
6
6
  "types": "./dist/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "@zag-js/tabs": "^1.24.0",
30
30
  "@zag-js/toast": "^1.24.0",
31
31
  "@zag-js/tooltip": "^1.24.0",
32
- "@skeletonlabs/skeleton-common": "1.0.0-next.4"
32
+ "@skeletonlabs/skeleton-common": "1.0.0-next.5"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "svelte": "^5.29.0"