@functionalcms/svelte-components 3.5.16 → 3.5.18

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 (129) hide show
  1. package/css/functional.css +1 -1
  2. package/css/functional.css.map +1 -1
  3. package/dist/components/Banner.svelte +1 -1
  4. package/dist/components/Banner.svelte.d.ts +8 -13
  5. package/dist/components/Link.svelte.d.ts +45 -34
  6. package/dist/components/Logo.svelte.d.ts +26 -22
  7. package/dist/components/Markdown.svelte.d.ts +5 -14
  8. package/dist/components/Spacer.svelte.d.ts +6 -14
  9. package/dist/components/Well.svelte.d.ts +11 -13
  10. package/dist/components/agnostic/Button/Button.svelte +333 -332
  11. package/dist/components/agnostic/Button/Button.svelte.d.ts +50 -39
  12. package/dist/components/agnostic/Button/ButtonGroup.svelte.d.ts +30 -19
  13. package/dist/components/agnostic/Close/Close.svelte.d.ts +22 -18
  14. package/dist/components/agnostic/Disclose/Disclose.svelte.d.ts +10 -13
  15. package/dist/components/agnostic/Divider/Divider.svelte.d.ts +21 -17
  16. package/dist/components/agnostic/Loader/Loader.svelte.d.ts +20 -16
  17. package/dist/components/blog/BlogDescription.svelte.d.ts +21 -17
  18. package/dist/components/blog/BlogTitle.svelte.d.ts +21 -17
  19. package/dist/components/form/DateTimePicker.svelte.d.ts +16 -12
  20. package/dist/components/form/Input.svelte +1 -1
  21. package/dist/components/form/Input.svelte.d.ts +46 -20
  22. package/dist/components/form/InputAddonItem.svelte +34 -34
  23. package/dist/components/form/InputAddonItem.svelte.d.ts +27 -27
  24. package/dist/components/form/Select.svelte.d.ts +32 -28
  25. package/dist/components/{agnostic/Switch → form}/Switch.svelte +1 -1
  26. package/dist/components/form/Switch.svelte.d.ts +30 -0
  27. package/dist/components/layouts/DefaultLayout.svelte.d.ts +11 -13
  28. package/dist/components/layouts/Meta.svelte.d.ts +10 -13
  29. package/dist/components/layouts/SimpleFooter.svelte.d.ts +7 -13
  30. package/dist/components/layouts/Tracker.svelte.d.ts +5 -13
  31. package/dist/components/layouts/TwoColumnsLayout.svelte.d.ts +9 -13
  32. package/dist/components/menu/CollapsibleMenu.svelte.d.ts +27 -23
  33. package/dist/components/menu/DynamicMenu.svelte.d.ts +27 -23
  34. package/dist/components/menu/HamburgerMenu.svelte +3 -3
  35. package/dist/components/menu/HamburgerMenu.svelte.d.ts +25 -21
  36. package/dist/components/menu/Menu.svelte.d.ts +31 -27
  37. package/dist/components/menu/MenuItem.svelte.d.ts +37 -25
  38. package/dist/components/menu/NavigationItems.svelte +9 -4
  39. package/dist/components/menu/NavigationItems.svelte.d.ts +27 -23
  40. package/dist/components/presentation/Card.svelte.d.ts +17 -13
  41. package/dist/components/presentation/Carousel/carousel-content.svelte +35 -0
  42. package/dist/components/presentation/Carousel/carousel-content.svelte.d.ts +28 -0
  43. package/dist/components/presentation/Carousel/carousel-item.svelte +25 -0
  44. package/dist/components/presentation/Carousel/carousel-item.svelte.d.ts +28 -0
  45. package/dist/components/presentation/Carousel/carousel-next.svelte +39 -0
  46. package/dist/components/presentation/Carousel/carousel-next.svelte.d.ts +18 -0
  47. package/dist/components/presentation/Carousel/carousel-previous.svelte +40 -0
  48. package/dist/components/presentation/Carousel/carousel-previous.svelte.d.ts +18 -0
  49. package/dist/components/presentation/Carousel/carousel.svelte +99 -0
  50. package/dist/components/presentation/Carousel/carousel.svelte.d.ts +31 -0
  51. package/dist/components/presentation/Carousel/context.d.ts +32 -0
  52. package/dist/components/presentation/Carousel/context.js +12 -0
  53. package/dist/components/presentation/Carousel.svelte +4 -0
  54. package/dist/components/presentation/Carousel.svelte.d.ts +18 -0
  55. package/dist/components/presentation/Carusele.d.ts +1 -1
  56. package/dist/components/presentation/Carusele.js +1 -1
  57. package/dist/components/presentation/Gallery.svelte.d.ts +14 -13
  58. package/dist/components/presentation/ImageCompare.svelte +15 -12
  59. package/dist/components/presentation/ImageCompare.svelte.d.ts +24 -38
  60. package/dist/index.d.ts +4 -4
  61. package/dist/index.js +11 -6
  62. package/package.json +24 -24
  63. package/dist/components/agnostic/Alert/Alert.svelte +0 -317
  64. package/dist/components/agnostic/Alert/Alert.svelte.d.ts +0 -29
  65. package/dist/components/agnostic/Avatar/Avatar.svelte +0 -127
  66. package/dist/components/agnostic/Avatar/Avatar.svelte.d.ts +0 -24
  67. package/dist/components/agnostic/Avatar/AvatarGroup.svelte +0 -106
  68. package/dist/components/agnostic/Avatar/AvatarGroup.svelte.d.ts +0 -27
  69. package/dist/components/agnostic/Breadcrumb/Breadcrumb.svelte +0 -65
  70. package/dist/components/agnostic/Breadcrumb/Breadcrumb.svelte.d.ts +0 -18
  71. package/dist/components/agnostic/Breadcrumb/api.d.ts +0 -4
  72. package/dist/components/agnostic/Breadcrumb/api.js +0 -1
  73. package/dist/components/agnostic/ChoiceInput/ChoiceInput.svelte +0 -365
  74. package/dist/components/agnostic/ChoiceInput/ChoiceInput.svelte.d.ts +0 -35
  75. package/dist/components/agnostic/ChoiceInput/api.d.ts +0 -7
  76. package/dist/components/agnostic/ChoiceInput/api.js +0 -1
  77. package/dist/components/agnostic/Dialog/Dialog.svelte +0 -278
  78. package/dist/components/agnostic/Dialog/Dialog.svelte.d.ts +0 -37
  79. package/dist/components/agnostic/Dialog/SvelteA11yDialog.svelte +0 -128
  80. package/dist/components/agnostic/Dialog/SvelteA11yDialog.svelte.d.ts +0 -28
  81. package/dist/components/agnostic/Dialog/a11y-dialog.d.ts +0 -56
  82. package/dist/components/agnostic/Dialog/a11y-dialog.js +0 -216
  83. package/dist/components/agnostic/Dialog/dom-utils.d.ts +0 -26
  84. package/dist/components/agnostic/Dialog/dom-utils.js +0 -206
  85. package/dist/components/agnostic/Drawer/Drawer.svelte +0 -34
  86. package/dist/components/agnostic/Drawer/Drawer.svelte.d.ts +0 -26
  87. package/dist/components/agnostic/Drawer/api.d.ts +0 -1
  88. package/dist/components/agnostic/Drawer/api.js +0 -1
  89. package/dist/components/agnostic/EmptyState/EmptyState.svelte +0 -49
  90. package/dist/components/agnostic/EmptyState/EmptyState.svelte.d.ts +0 -21
  91. package/dist/components/agnostic/Header/Header.svelte +0 -111
  92. package/dist/components/agnostic/Header/Header.svelte.d.ts +0 -24
  93. package/dist/components/agnostic/Header/HeaderNav.svelte +0 -29
  94. package/dist/components/agnostic/Header/HeaderNav.svelte.d.ts +0 -18
  95. package/dist/components/agnostic/Header/HeaderNavItem.svelte +0 -31
  96. package/dist/components/agnostic/Header/HeaderNavItem.svelte.d.ts +0 -18
  97. package/dist/components/agnostic/Icon/Icon.svelte +0 -188
  98. package/dist/components/agnostic/Icon/Icon.svelte.d.ts +0 -21
  99. package/dist/components/agnostic/Icon/api.d.ts +0 -2
  100. package/dist/components/agnostic/Icon/api.js +0 -1
  101. package/dist/components/agnostic/Progress/Progress.svelte +0 -51
  102. package/dist/components/agnostic/Progress/Progress.svelte.d.ts +0 -18
  103. package/dist/components/agnostic/Spinner/Spinner.svelte +0 -108
  104. package/dist/components/agnostic/Spinner/Spinner.svelte.d.ts +0 -17
  105. package/dist/components/agnostic/Switch/Switch.svelte.d.ts +0 -43
  106. package/dist/components/agnostic/Table/Table.svelte +0 -521
  107. package/dist/components/agnostic/Table/Table.svelte.d.ts +0 -34
  108. package/dist/components/agnostic/Table/TableCustomRenderComponent.svelte +0 -13
  109. package/dist/components/agnostic/Table/TableCustomRenderComponent.svelte.d.ts +0 -23
  110. package/dist/components/agnostic/Tabs/TabButtonCustom.svelte +0 -77
  111. package/dist/components/agnostic/Tabs/TabButtonCustom.svelte.d.ts +0 -33
  112. package/dist/components/agnostic/Tabs/Tabs.svelte +0 -399
  113. package/dist/components/agnostic/Tabs/Tabs.svelte.d.ts +0 -32
  114. package/dist/components/agnostic/Tabs/api.d.ts +0 -10
  115. package/dist/components/agnostic/Tabs/api.js +0 -1
  116. package/dist/components/agnostic/Tag/Tag.svelte +0 -78
  117. package/dist/components/agnostic/Tag/Tag.svelte.d.ts +0 -21
  118. package/dist/components/agnostic/Tag/TagSlots.svelte +0 -52
  119. package/dist/components/agnostic/Tag/TagSlots.svelte.d.ts +0 -14
  120. package/dist/components/agnostic/Toasts/Toasts.svelte +0 -56
  121. package/dist/components/agnostic/Toasts/Toasts.svelte.d.ts +0 -20
  122. package/dist/components/agnostic/Tooltip/Tooltip.svelte +0 -120
  123. package/dist/components/agnostic/Tooltip/Tooltip.svelte.d.ts +0 -21
  124. package/dist/components/agnostic/Tooltip/TooltipSlots.svelte +0 -82
  125. package/dist/components/agnostic/Tooltip/TooltipSlots.svelte.d.ts +0 -14
  126. package/dist/components/agnostic/Tooltip/api.d.ts +0 -1
  127. package/dist/components/agnostic/Tooltip/api.js +0 -1
  128. package/dist/components/presentation/Carusel.svelte +0 -109
  129. package/dist/components/presentation/Carusel.svelte.d.ts +0 -56
@@ -1,14 +1,18 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: Record<string, never>;
4
- events: {
5
- [evt: string]: CustomEvent<any>;
6
- };
7
- slots: {};
8
- };
9
- export type CardProps = typeof __propDef.props;
10
- export type CardEvents = typeof __propDef.events;
11
- export type CardSlots = typeof __propDef.slots;
12
- export default class Card extends SvelteComponentTyped<CardProps, CardEvents, CardSlots> {
1
+ import type { Snippet } from 'svelte';
2
+ import { Orientation } from '../Styling';
3
+ interface Props {
4
+ children: Snippet;
5
+ isAnimated?: boolean;
6
+ isSkinned?: boolean;
7
+ isStacked?: boolean;
8
+ isShadow?: boolean;
9
+ isBorder?: boolean;
10
+ isRounded?: boolean;
11
+ noWrap?: boolean;
12
+ orientation?: Orientation;
13
+ type?: string;
14
+ css?: string;
13
15
  }
14
- export {};
16
+ declare const Card: import("svelte").Component<Props, {}, "">;
17
+ type Card = ReturnType<typeof Card>;
18
+ export default Card;
@@ -0,0 +1,35 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ import emblaCarouselSvelte from "embla-carousel-svelte";
4
+ import { getEmblaContext } from "./context.js";
5
+ import { cn } from "../../../utils.js";
6
+
7
+ type $$Props = HTMLAttributes<HTMLDivElement>;
8
+
9
+ let className: string | undefined | null = undefined;
10
+ export { className as class };
11
+
12
+ const { orientation, options, plugins, onInit } = getEmblaContext("<Carousel.Content/>");
13
+ </script>
14
+
15
+ <div
16
+ class="overflow-hidden"
17
+ use:emblaCarouselSvelte={{
18
+ options: {
19
+ container: "[data-embla-container]",
20
+ slides: "[data-embla-slide]",
21
+ ...$options,
22
+ axis: $orientation === "horizontal" ? "x" : "y",
23
+ },
24
+ plugins: $plugins,
25
+ }}
26
+ on:emblaInit={onInit}
27
+ >
28
+ <div
29
+ class={cn("flex", $orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className)}
30
+ data-embla-container=""
31
+ {...$$restProps}
32
+ >
33
+ <slot />
34
+ </div>
35
+ </div>
@@ -0,0 +1,28 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
+ $$bindings?: Bindings;
5
+ } & Exports;
6
+ (internal: unknown, props: Props & {
7
+ $$events?: Events;
8
+ $$slots?: Slots;
9
+ }): Exports & {
10
+ $set?: any;
11
+ $on?: any;
12
+ };
13
+ z_$$bindings?: Bindings;
14
+ }
15
+ type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
16
+ default: any;
17
+ } ? Props extends Record<string, never> ? any : {
18
+ children?: any;
19
+ } : {});
20
+ declare const CarouselContent: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<HTMLAttributes<HTMLDivElement>, {
21
+ default: {};
22
+ }>, {
23
+ [evt: string]: CustomEvent<any>;
24
+ }, {
25
+ default: {};
26
+ }, {}, string>;
27
+ type CarouselContent = InstanceType<typeof CarouselContent>;
28
+ export default CarouselContent;
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ import { getEmblaContext } from "./context.js";
4
+ import { cn } from "../../../utils.js";
5
+
6
+ type $$Props = HTMLAttributes<HTMLDivElement>;
7
+ let className: string | undefined | null = undefined;
8
+ export { className as class };
9
+
10
+ const { orientation } = getEmblaContext("<Carousel.Item/>");
11
+ </script>
12
+
13
+ <div
14
+ role="group"
15
+ aria-roledescription="slide"
16
+ class={cn(
17
+ "min-w-0 shrink-0 grow-0 basis-full",
18
+ $orientation === "horizontal" ? "pl-4" : "pt-4",
19
+ className
20
+ )}
21
+ data-embla-slide=""
22
+ {...$$restProps}
23
+ >
24
+ <slot />
25
+ </div>
@@ -0,0 +1,28 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
+ $$bindings?: Bindings;
5
+ } & Exports;
6
+ (internal: unknown, props: Props & {
7
+ $$events?: Events;
8
+ $$slots?: Slots;
9
+ }): Exports & {
10
+ $set?: any;
11
+ $on?: any;
12
+ };
13
+ z_$$bindings?: Bindings;
14
+ }
15
+ type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
16
+ default: any;
17
+ } ? Props extends Record<string, never> ? any : {
18
+ children?: any;
19
+ } : {});
20
+ declare const CarouselItem: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<HTMLAttributes<HTMLDivElement>, {
21
+ default: {};
22
+ }>, {
23
+ [evt: string]: CustomEvent<any>;
24
+ }, {
25
+ default: {};
26
+ }, {}, string>;
27
+ type CarouselItem = InstanceType<typeof CarouselItem>;
28
+ export default CarouselItem;
@@ -0,0 +1,39 @@
1
+ <script lang="ts">
2
+ import ArrowRight from "lucide-svelte/icons/arrow-right";
3
+ import type { VariantProps } from "tailwind-variants";
4
+ import { getEmblaContext } from "./context.js";
5
+ import { cn } from "../../../utils.js";
6
+ import {
7
+ Button,
8
+ type Props,
9
+ type buttonVariants,
10
+ } from "../../../registry/default/ui/button/index.js";
11
+
12
+ type $$Props = Props;
13
+
14
+ let className: $$Props["class"] = undefined;
15
+ export { className as class };
16
+ export let variant: VariantProps<typeof buttonVariants>["variant"] = "outline";
17
+ export let size: VariantProps<typeof buttonVariants>["size"] = "icon";
18
+ const { orientation, canScrollNext, scrollNext, handleKeyDown } =
19
+ getEmblaContext("<Carousel.Next/>");
20
+ </script>
21
+
22
+ <Button
23
+ {variant}
24
+ {size}
25
+ class={cn(
26
+ "absolute h-8 w-8 touch-manipulation rounded-full",
27
+ $orientation === "horizontal"
28
+ ? "-right-12 top-1/2 -translate-y-1/2"
29
+ : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
30
+ className
31
+ )}
32
+ disabled={!$canScrollNext}
33
+ on:click={scrollNext}
34
+ on:keydown={handleKeyDown}
35
+ {...$$restProps}
36
+ >
37
+ <ArrowRight class="h-4 w-4" />
38
+ <span class="sr-only">Next slide</span>
39
+ </Button>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const CarouselNext: $$__sveltets_2_IsomorphicComponent<Props, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type CarouselNext = InstanceType<typeof CarouselNext>;
18
+ export default CarouselNext;
@@ -0,0 +1,40 @@
1
+ <script lang="ts">
2
+ import ArrowLeft from "lucide-svelte/icons/arrow-left";
3
+ import type { VariantProps } from "tailwind-variants";
4
+ import { getEmblaContext } from "./context.js";
5
+ import { cn } from "../../../utils.js";
6
+ import {
7
+ Button,
8
+ type Props,
9
+ type buttonVariants,
10
+ } from "../../../registry/default/ui/button/index.js";
11
+
12
+ type $$Props = Props;
13
+
14
+ let className: $$Props["class"] = undefined;
15
+ export { className as class };
16
+ export let variant: VariantProps<typeof buttonVariants>["variant"] = "outline";
17
+ export let size: VariantProps<typeof buttonVariants>["size"] = "icon";
18
+
19
+ const { orientation, canScrollPrev, scrollPrev, handleKeyDown } =
20
+ getEmblaContext("<Carousel.Previous/>");
21
+ </script>
22
+
23
+ <Button
24
+ {variant}
25
+ {size}
26
+ class={cn(
27
+ "absolute h-8 w-8 touch-manipulation rounded-full",
28
+ $orientation === "horizontal"
29
+ ? "-left-12 top-1/2 -translate-y-1/2"
30
+ : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
31
+ className
32
+ )}
33
+ disabled={!$canScrollPrev}
34
+ on:click={scrollPrev}
35
+ on:keydown={handleKeyDown}
36
+ {...$$restProps}
37
+ >
38
+ <ArrowLeft class="h-4 w-4" />
39
+ <span class="sr-only">Previous slide</span>
40
+ </Button>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const CarouselPrevious: $$__sveltets_2_IsomorphicComponent<Props, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type CarouselPrevious = InstanceType<typeof CarouselPrevious>;
18
+ export default CarouselPrevious;
@@ -0,0 +1,99 @@
1
+ <script lang="ts">
2
+ import { writable } from "svelte/store";
3
+ import { onDestroy } from "svelte";
4
+ import { type CarouselAPI, type CarouselProps, setEmblaContext } from "./context.js";
5
+ import { mergedClasses } from "../../CssHelper.js";
6
+
7
+ type $$Props = CarouselProps;
8
+
9
+ export let opts = {};
10
+ export let plugins: NonNullable<$$Props["plugins"]> = [];
11
+ export let api: $$Props["api"] = undefined;
12
+ export let orientation: NonNullable<$$Props["orientation"]> = "horizontal";
13
+
14
+ let className: $$Props["class"] = undefined;
15
+ export { className as class };
16
+
17
+ const apiStore = writable<CarouselAPI | undefined>(undefined);
18
+ const orientationStore = writable(orientation);
19
+ const canScrollPrev = writable(false);
20
+ const canScrollNext = writable(false);
21
+ const optionsStore = writable(opts);
22
+ const pluginStore = writable(plugins);
23
+ const scrollSnapsStore = writable<number[]>([]);
24
+ const selectedIndexStore = writable(0);
25
+
26
+ $: orientationStore.set(orientation);
27
+ $: pluginStore.set(plugins);
28
+ $: optionsStore.set(opts);
29
+
30
+ function scrollPrev() {
31
+ api?.scrollPrev();
32
+ }
33
+ function scrollNext() {
34
+ api?.scrollNext();
35
+ }
36
+ function scrollTo(index: number, jump?: boolean) {
37
+ api?.scrollTo(index, jump);
38
+ }
39
+
40
+ function onSelect(api: CarouselAPI) {
41
+ if (!api) return;
42
+ canScrollPrev.set(api.canScrollPrev());
43
+ canScrollNext.set(api.canScrollNext());
44
+ selectedIndexStore.set(api.selectedScrollSnap());
45
+ }
46
+
47
+ $: if (api) {
48
+ onSelect(api);
49
+ api.on("select", onSelect);
50
+ api.on("reInit", onSelect);
51
+ }
52
+
53
+ function handleKeyDown(e: KeyboardEvent) {
54
+ if (e.key === "ArrowLeft") {
55
+ e.preventDefault();
56
+ scrollPrev();
57
+ } else if (e.key === "ArrowRight") {
58
+ e.preventDefault();
59
+ scrollNext();
60
+ }
61
+ }
62
+
63
+ setEmblaContext({
64
+ api: apiStore,
65
+ scrollPrev,
66
+ scrollNext,
67
+ orientation: orientationStore,
68
+ canScrollNext,
69
+ canScrollPrev,
70
+ handleKeyDown,
71
+ options: optionsStore,
72
+ plugins: pluginStore,
73
+ onInit,
74
+ scrollSnaps: scrollSnapsStore,
75
+ selectedIndex: selectedIndexStore,
76
+ scrollTo,
77
+ });
78
+
79
+ function onInit(event: CustomEvent<CarouselAPI>) {
80
+ api = event.detail;
81
+ apiStore.set(api);
82
+ scrollSnapsStore.set(api.scrollSnapList());
83
+ }
84
+
85
+ onDestroy(() => {
86
+ api?.off("select", onSelect);
87
+ });
88
+ </script>
89
+
90
+ <div
91
+ class={mergedClasses("relative", className)}
92
+ on:mouseenter
93
+ on:mouseleave
94
+ role="region"
95
+ aria-roledescription="carousel"
96
+ {...$$restProps}
97
+ >
98
+ <slot />
99
+ </div>
@@ -0,0 +1,31 @@
1
+ import { type CarouselProps } from "./context.js";
2
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
+ $$bindings?: Bindings;
5
+ } & Exports;
6
+ (internal: unknown, props: Props & {
7
+ $$events?: Events;
8
+ $$slots?: Slots;
9
+ }): Exports & {
10
+ $set?: any;
11
+ $on?: any;
12
+ };
13
+ z_$$bindings?: Bindings;
14
+ }
15
+ type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
16
+ default: any;
17
+ } ? Props extends Record<string, never> ? any : {
18
+ children?: any;
19
+ } : {});
20
+ declare const Carousel: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<CarouselProps, {
21
+ default: {};
22
+ }>, {
23
+ mouseenter: MouseEvent;
24
+ mouseleave: MouseEvent;
25
+ } & {
26
+ [evt: string]: CustomEvent<any>;
27
+ }, {
28
+ default: {};
29
+ }, {}, string>;
30
+ type Carousel = InstanceType<typeof Carousel>;
31
+ export default Carousel;
@@ -0,0 +1,32 @@
1
+ import type { EmblaCarouselSvelteType } from "embla-carousel-svelte";
2
+ import type emblaCarouselSvelte from "embla-carousel-svelte";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+ import type { Readable, Writable } from "svelte/store";
5
+ export type CarouselAPI = NonNullable<NonNullable<EmblaCarouselSvelteType["$$_attributes"]>["on:emblaInit"]> extends (evt: CustomEvent<infer CarouselAPI>) => void ? CarouselAPI : never;
6
+ type EmblaCarouselConfig = NonNullable<Parameters<typeof emblaCarouselSvelte>[1]>;
7
+ export type CarouselOptions = EmblaCarouselConfig["options"];
8
+ export type CarouselPlugins = EmblaCarouselConfig["plugins"];
9
+ export type CarouselProps = {
10
+ opts?: CarouselOptions;
11
+ plugins?: CarouselPlugins;
12
+ api?: CarouselAPI;
13
+ orientation?: "horizontal" | "vertical";
14
+ } & HTMLAttributes<HTMLDivElement>;
15
+ type EmblaContext = {
16
+ api: Writable<CarouselAPI | undefined>;
17
+ orientation: Writable<"horizontal" | "vertical">;
18
+ scrollNext: () => void;
19
+ scrollPrev: () => void;
20
+ canScrollNext: Readable<boolean>;
21
+ canScrollPrev: Readable<boolean>;
22
+ handleKeyDown: (e: KeyboardEvent) => void;
23
+ options: Writable<CarouselOptions>;
24
+ plugins: Writable<CarouselPlugins>;
25
+ onInit: (e: CustomEvent<CarouselAPI>) => void;
26
+ scrollTo: (index: number, jump?: boolean) => void;
27
+ scrollSnaps: Readable<number[]>;
28
+ selectedIndex: Readable<number>;
29
+ };
30
+ export declare function setEmblaContext(config: EmblaContext): EmblaContext;
31
+ export declare function getEmblaContext(name?: string): EmblaContext;
32
+ export {};
@@ -0,0 +1,12 @@
1
+ import { getContext, hasContext, setContext } from "svelte";
2
+ const EMBLA_CAROUSEL_CONTEXT = Symbol("EMBLA_CAROUSEL_CONTEXT");
3
+ export function setEmblaContext(config) {
4
+ setContext(EMBLA_CAROUSEL_CONTEXT, config);
5
+ return config;
6
+ }
7
+ export function getEmblaContext(name = "This component") {
8
+ if (!hasContext(EMBLA_CAROUSEL_CONTEXT)) {
9
+ throw new Error(`${name} must be used within a <Carousel.Root> component`);
10
+ }
11
+ return getContext(EMBLA_CAROUSEL_CONTEXT);
12
+ }
@@ -0,0 +1,4 @@
1
+ <script lang="ts">
2
+ </script>
3
+
4
+ <style></style>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const Carousel: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type Carousel = InstanceType<typeof Carousel>;
18
+ export default Carousel;
@@ -1,4 +1,4 @@
1
- export declare class CaruseleItem {
1
+ export declare class CarouselItem {
2
2
  text: string;
3
3
  image: string;
4
4
  link: string;
@@ -1,4 +1,4 @@
1
- export class CaruseleItem {
1
+ export class CarouselItem {
2
2
  text = "";
3
3
  image = "";
4
4
  link = "";
@@ -1,14 +1,15 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: Record<string, never>;
4
- events: {
5
- [evt: string]: CustomEvent<any>;
6
- };
7
- slots: {};
8
- };
9
- export type GalleryProps = typeof __propDef.props;
10
- export type GalleryEvents = typeof __propDef.events;
11
- export type GallerySlots = typeof __propDef.slots;
12
- export default class Gallery extends SvelteComponentTyped<GalleryProps, GalleryEvents, GallerySlots> {
1
+ import type { ShowItem } from './ShowItem.js';
2
+ import { AlignItmes, Justify, Orientation } from '../Styling.js';
3
+ import type { Snippet } from 'svelte';
4
+ interface GaleryProps {
5
+ items: Array<ShowItem>;
6
+ renderItem: Snippet<[ShowItem]>;
7
+ justify: Justify;
8
+ alignItems: AlignItmes;
9
+ orientation: Orientation;
10
+ restProps: any;
11
+ css: string;
13
12
  }
14
- export {};
13
+ declare const Gallery: import("svelte").Component<GaleryProps, {}, "">;
14
+ type Gallery = ReturnType<typeof Gallery>;
15
+ export default Gallery;
@@ -1,19 +1,17 @@
1
- <script>
1
+ <script lang="ts">
2
2
  let hideOnSlide = true,
3
3
  imgOffset = null,
4
4
  sliding = false,
5
5
  contain = false,
6
6
  overlay = true,
7
7
  offset = 0.5,
8
- before = "",
9
- after = "",
8
+ before = '',
9
+ after = '',
10
10
  lazyLoad = false,
11
11
  img;
12
12
 
13
13
  function resize(e) {
14
- imgOffset = (
15
- e.type === "load" ? e.target : img
16
- ).getBoundingClientRect();
14
+ imgOffset = (e.type === 'load' ? e.target : img).getBoundingClientRect();
17
15
  }
18
16
 
19
17
  function move(e) {
@@ -37,10 +35,8 @@
37
35
  $: h = imgOffset && imgOffset.height;
38
36
  $: x = w * offset;
39
37
  $: opacity = hideOnSlide && sliding ? 0 : 1;
40
- $: style = contain
41
- ? `width:100%;height:100%;`
42
- : `width:${w}px;height:${h}px;`;
43
- $: imageLoading = lazyLoad ? "lazy" : "eager";
38
+ $: style = contain ? `width:100%;height:100%;` : `width:${w}px;height:${h}px;`;
39
+ $: imageLoading = lazyLoad ? 'lazy' : 'eager';
44
40
 
45
41
  export { before, after, offset, overlay, contain, lazyLoad, hideOnSlide };
46
42
  </script>
@@ -53,7 +49,14 @@
53
49
  on:resize={resize}
54
50
  />
55
51
 
56
- <div class="container" {style} on:touchstart={start} on:mousedown={start} role="img" aria-roledescription="image slider">
52
+ <div
53
+ class="container"
54
+ {style}
55
+ on:touchstart={start}
56
+ on:mousedown={start}
57
+ role="img"
58
+ aria-roledescription="image slider"
59
+ >
57
60
  <img
58
61
  bind:this={img}
59
62
  loading={imageLoading}
@@ -144,7 +147,7 @@
144
147
  }
145
148
  .handle:before,
146
149
  .handle:after {
147
- content: "";
150
+ content: '';
148
151
  height: 9999px;
149
152
  position: absolute;
150
153
  left: calc(50% - 2px);
@@ -1,14 +1,24 @@
1
- /** @typedef {typeof __propDef.props} ImageCompareProps */
2
- /** @typedef {typeof __propDef.events} ImageCompareEvents */
3
- /** @typedef {typeof __propDef.slots} ImageCompareSlots */
4
- export default class ImageCompare extends SvelteComponentTyped<{
5
- before?: string | undefined;
6
- after?: string | undefined;
7
- offset?: number | undefined;
8
- overlay?: boolean | undefined;
9
- contain?: boolean | undefined;
10
- lazyLoad?: boolean | undefined;
11
- hideOnSlide?: boolean | undefined;
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const ImageCompare: $$__sveltets_2_IsomorphicComponent<{
15
+ before?: string;
16
+ after?: string;
17
+ offset?: number;
18
+ overlay?: boolean;
19
+ contain?: boolean;
20
+ lazyLoad?: boolean;
21
+ hideOnSlide?: boolean;
12
22
  }, {
13
23
  mousedown: MouseEvent;
14
24
  } & {
@@ -16,30 +26,6 @@ export default class ImageCompare extends SvelteComponentTyped<{
16
26
  }, {
17
27
  before: {};
18
28
  after: {};
19
- }> {
20
- }
21
- export type ImageCompareProps = typeof __propDef.props;
22
- export type ImageCompareEvents = typeof __propDef.events;
23
- export type ImageCompareSlots = typeof __propDef.slots;
24
- import { SvelteComponentTyped } from "svelte";
25
- declare const __propDef: {
26
- props: {
27
- before?: string | undefined;
28
- after?: string | undefined;
29
- offset?: number | undefined;
30
- overlay?: boolean | undefined;
31
- contain?: boolean | undefined;
32
- lazyLoad?: boolean | undefined;
33
- hideOnSlide?: boolean | undefined;
34
- };
35
- events: {
36
- mousedown: MouseEvent;
37
- } & {
38
- [evt: string]: CustomEvent<any>;
39
- };
40
- slots: {
41
- before: {};
42
- after: {};
43
- };
44
- };
45
- export {};
29
+ }, {}, string>;
30
+ type ImageCompare = InstanceType<typeof ImageCompare>;
31
+ export default ImageCompare;