@max-ts/svelte 1.3.0 → 1.4.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.
Files changed (29) hide show
  1. package/dist/assets/styles.css.ts.vanilla-CFc3t0Nn.css +58 -0
  2. package/dist/assets/styles.css.ts.vanilla-GOQJy88x.css +56 -0
  3. package/dist/components/Carousel/Arrows/Arrows.js +59 -0
  4. package/dist/components/Carousel/Arrows/Arrows.svelte.d.ts +3 -0
  5. package/dist/components/Carousel/Arrows/index.d.ts +1 -0
  6. package/dist/components/Carousel/Arrows/styles.css.d.ts +10 -0
  7. package/dist/components/Carousel/Arrows/styles.css.js +21 -0
  8. package/dist/components/Carousel/Carousel.js +8 -5
  9. package/dist/components/Carousel/Dots/Dots.js +39 -0
  10. package/dist/components/Carousel/Dots/Dots.svelte.d.ts +3 -0
  11. package/dist/components/Carousel/Dots/index.d.ts +1 -0
  12. package/dist/components/Carousel/Dots/styles.css.d.ts +6 -0
  13. package/dist/components/Carousel/Dots/styles.css.js +19 -0
  14. package/dist/components/Carousel/index.d.ts +2 -2
  15. package/dist/components/Carousel/index.js +4 -4
  16. package/dist/components/Carousel/types.d.ts +3 -3
  17. package/package.json +1 -1
  18. package/dist/assets/styles.css.ts.vanilla-Cj0JBm6N.css +0 -25
  19. package/dist/assets/styles.css.ts.vanilla-D2NN324N.css +0 -25
  20. package/dist/components/Carousel/Next/Next.js +0 -69
  21. package/dist/components/Carousel/Next/Next.svelte.d.ts +0 -4
  22. package/dist/components/Carousel/Next/index.d.ts +0 -1
  23. package/dist/components/Carousel/Next/styles.css.d.ts +0 -7
  24. package/dist/components/Carousel/Next/styles.css.js +0 -16
  25. package/dist/components/Carousel/Previous/Previous.js +0 -69
  26. package/dist/components/Carousel/Previous/Previous.svelte.d.ts +0 -4
  27. package/dist/components/Carousel/Previous/index.d.ts +0 -1
  28. package/dist/components/Carousel/Previous/styles.css.d.ts +0 -7
  29. package/dist/components/Carousel/Previous/styles.css.js +0 -16
@@ -0,0 +1,58 @@
1
+ .styles_buttonBase__3ygkf90 {
2
+ position: absolute;
3
+ background-color: transparent;
4
+ border: none;
5
+ cursor: pointer;
6
+ display: flex;
7
+ justify-content: center;
8
+ align-items: center;
9
+ }
10
+ .styles_buttonBase__3ygkf90:disabled {
11
+ user-select: none;
12
+ cursor: default;
13
+ opacity: 0.5;
14
+ }
15
+ .styles_iconWrapper__3ygkf91 {
16
+ width: var(--spacing-8);
17
+ height: var(--spacing-8);
18
+ display: flex;
19
+ justify-content: center;
20
+ align-items: center;
21
+ background-color: var(--colors-background-paper);
22
+ border-radius: 9999px;
23
+ transition: transform 0.2s ease;
24
+ }
25
+ .styles_buttonBase__3ygkf90:not(:disabled):hover .styles_iconWrapper__3ygkf91 {
26
+ transform: scale(1.1);
27
+ }
28
+ .styles_iconWrapper__3ygkf91 svg {
29
+ width: var(--spacing-5);
30
+ height: var(--spacing-5);
31
+ }
32
+ .styles_buttonNext_horizontal__3ygkf92 {
33
+ right: 0;
34
+ top: 0;
35
+ width: clamp(2.5rem, 4vw, 4rem);
36
+ height: 100%;
37
+ }
38
+ .styles_buttonNext_vertical__3ygkf93 {
39
+ left: 0;
40
+ bottom: 0;
41
+ width: 100%;
42
+ height: clamp(2.5rem, 4vw, 4rem);
43
+ }
44
+ .styles_buttonPrev_horizontal__3ygkf94 {
45
+ left: 0;
46
+ top: 0;
47
+ width: clamp(2.5rem, 4vw, 4rem);
48
+ height: 100%;
49
+ }
50
+ .styles_buttonPrev_vertical__3ygkf95 {
51
+ right: 0;
52
+ top: 0;
53
+ width: 100%;
54
+ height: clamp(2.5rem, 4vw, 4rem);
55
+ }
56
+ .styles_buttonNext_vertical__3ygkf93 svg, .styles_buttonPrev_vertical__3ygkf95 svg {
57
+ transform: rotate(90deg);
58
+ }
@@ -0,0 +1,56 @@
1
+ .styles_baseWrapper__zoccy10 {
2
+ display: flex;
3
+ position: absolute;
4
+ z-index: 1;
5
+ overflow: auto;
6
+ justify-content: center;
7
+ gap: var(--spacing-1);
8
+ }
9
+ .styles_wrapper_horizontal__zoccy11 {
10
+ width: 100%;
11
+ height: auto;
12
+ bottom: var(--spacing-2);
13
+ left: 0;
14
+ }
15
+ .styles_wrapper_vertical__zoccy12 {
16
+ width: auto;
17
+ height: 100%;
18
+ bottom: 0;
19
+ left: var(--spacing-4);
20
+ flex-direction: column;
21
+ }
22
+ .styles_buttonBase__zoccy13 {
23
+ width: var(--spacing-6);
24
+ height: var(--spacing-6);
25
+ position: relative;
26
+ border: none;
27
+ background: transparent;
28
+ cursor: pointer;
29
+ }
30
+ .styles_buttonBase__zoccy13:focus {
31
+ outline: none;
32
+ }
33
+ .styles_buttonBase__zoccy13:after {
34
+ background-color: var(--colors-border);
35
+ }
36
+ .styles_dotButton_horizontal__zoccy14::after {
37
+ content: "";
38
+ position: absolute;
39
+ left: 0;
40
+ top: 50%;
41
+ transform: translateY(-50%);
42
+ width: 100%;
43
+ height: 2px;
44
+ }
45
+ .styles_dotButton_vertical__zoccy15::after {
46
+ content: "";
47
+ position: absolute;
48
+ left: 50%;
49
+ top: 0;
50
+ transform: translateX(-50%);
51
+ width: 2px;
52
+ height: 100%;
53
+ }
54
+ .styles_selected__zoccy16::after {
55
+ background-color: var(--colors-primary);
56
+ }
@@ -0,0 +1,59 @@
1
+ import { getEmblaContext } from "../context.js";
2
+ import styles_css_default from "./styles.css.js";
3
+ import "svelte/internal/disclose-version";
4
+ import * as $ from "svelte/internal/client";
5
+ import { ArrowLeftIcon } from "@lucide/svelte";
6
+ import ArrowRightIcon from "@lucide/svelte/icons/arrow-right";
7
+
8
+ //#region src/components/Carousel/Arrows/Arrows.svelte
9
+ var root = $.from_html(`<button><span><!></span></button> <button><span><!></span></button>`, 1);
10
+ function Arrows($$anchor, $$props) {
11
+ $.push($$props, true);
12
+ let restProps = $.rest_props($$props, [
13
+ "$$slots",
14
+ "$$events",
15
+ "$$legacy",
16
+ "class"
17
+ ]);
18
+ const emblaNextCtx = getEmblaContext("<Carousel.Next/>");
19
+ const emblaPrevCtx = getEmblaContext("<Carousel.Previous/>");
20
+ var fragment = root();
21
+ var button = $.first_child(fragment);
22
+ $.attribute_effect(button, () => ({
23
+ "data-slot": "carousel-previous",
24
+ disabled: !emblaPrevCtx.canScrollPrev,
25
+ class: [styles_css_default.buttonPrev[emblaPrevCtx.orientation], $$props.class],
26
+ onclick: emblaPrevCtx.scrollPrev,
27
+ onkeydown: emblaPrevCtx.handleKeyDown,
28
+ "aria-label": "Previous slide",
29
+ ...restProps
30
+ }));
31
+ var span = $.child(button);
32
+ ArrowLeftIcon($.child(span), {});
33
+ $.reset(span);
34
+ $.reset(button);
35
+ var button_1 = $.sibling(button, 2);
36
+ $.attribute_effect(button_1, () => ({
37
+ "data-slot": "carousel-next",
38
+ disabled: !emblaNextCtx.canScrollNext,
39
+ "aria-disabled": !emblaNextCtx.canScrollNext,
40
+ class: [styles_css_default.buttonNext[emblaNextCtx.orientation], $$props.class],
41
+ onclick: emblaNextCtx.scrollNext,
42
+ onkeydown: emblaNextCtx.handleKeyDown,
43
+ "aria-label": "Next slide",
44
+ ...restProps
45
+ }));
46
+ var span_1 = $.child(button_1);
47
+ ArrowRightIcon($.child(span_1), {});
48
+ $.reset(span_1);
49
+ $.reset(button_1);
50
+ $.template_effect(() => {
51
+ $.set_class(span, 1, $.clsx(styles_css_default.iconWrapper));
52
+ $.set_class(span_1, 1, $.clsx(styles_css_default.iconWrapper));
53
+ });
54
+ $.append($$anchor, fragment);
55
+ $.pop();
56
+ }
57
+
58
+ //#endregion
59
+ export { Arrows as default };
@@ -0,0 +1,3 @@
1
+ declare const Arrows: import("svelte").Component<Omit<import("svelte/elements").HTMLButtonAttributes, "children">, {}, "">;
2
+ type Arrows = ReturnType<typeof Arrows>;
3
+ export default Arrows;
@@ -0,0 +1 @@
1
+ export { default as Arrows } from './Arrows.svelte';
@@ -0,0 +1,10 @@
1
+ export declare const buttonBase: string;
2
+ export declare const iconWrapper: string;
3
+ export declare const buttonNext: Record<"horizontal" | "vertical", string>;
4
+ export declare const buttonPrev: Record<"horizontal" | "vertical", string>;
5
+ declare const _default: {
6
+ buttonNext: Record<"horizontal" | "vertical", string>;
7
+ buttonPrev: Record<"horizontal" | "vertical", string>;
8
+ iconWrapper: string;
9
+ };
10
+ export default _default;
@@ -0,0 +1,21 @@
1
+ import "./../../../assets/theme.css.ts.vanilla-HT3RGHeI.css";
2
+ import "./../../../assets/styles.css.ts.vanilla-CFc3t0Nn.css";
3
+
4
+ //#region src/components/Carousel/Arrows/styles.css.ts
5
+ var buttonNext = {
6
+ horizontal: "styles_buttonNext_horizontal__3ygkf92 styles_buttonBase__3ygkf90",
7
+ vertical: "styles_buttonNext_vertical__3ygkf93 styles_buttonBase__3ygkf90"
8
+ };
9
+ var buttonPrev = {
10
+ horizontal: "styles_buttonPrev_horizontal__3ygkf94 styles_buttonBase__3ygkf90",
11
+ vertical: "styles_buttonPrev_vertical__3ygkf95 styles_buttonBase__3ygkf90"
12
+ };
13
+ var __default__ = {
14
+ buttonNext,
15
+ buttonPrev,
16
+ iconWrapper: "styles_iconWrapper__3ygkf91"
17
+ };
18
+ var styles_css_default = __default__;
19
+
20
+ //#endregion
21
+ export { styles_css_default as default };
@@ -7,12 +7,12 @@ import * as $ from "svelte/internal/client";
7
7
  var root = $.from_html(`<div><!></div>`);
8
8
  function Carousel($$anchor, $$props) {
9
9
  $.push($$props, true);
10
- let ref = $.prop($$props, "ref", 15, null), opts = $.prop($$props, "opts", 19, () => ({})), plugins = $.prop($$props, "plugins", 19, () => []), setApi = $.prop($$props, "setApi", 3, () => {}), orientation = $.prop($$props, "orientation", 3, "horizontal"), restProps = $.rest_props($$props, [
10
+ let ref = $.prop($$props, "ref", 15, null), setApi = $.prop($$props, "setApi", 3, () => {}), orientation = $.prop($$props, "orientation", 3, "horizontal"), restProps = $.rest_props($$props, [
11
11
  "$$slots",
12
12
  "$$events",
13
13
  "$$legacy",
14
14
  "ref",
15
- "opts",
15
+ "options",
16
16
  "plugins",
17
17
  "setApi",
18
18
  "orientation",
@@ -23,12 +23,12 @@ function Carousel($$anchor, $$props) {
23
23
  api: void 0,
24
24
  scrollPrev,
25
25
  scrollNext,
26
- orientation: orientation(),
26
+ orientation: "horizontal",
27
27
  canScrollNext: false,
28
28
  canScrollPrev: false,
29
29
  handleKeyDown,
30
- options: opts(),
31
- plugins: plugins(),
30
+ options: {},
31
+ plugins: [],
32
32
  onInit,
33
33
  scrollSnaps: [],
34
34
  selectedIndex: 0,
@@ -67,6 +67,9 @@ function Carousel($$anchor, $$props) {
67
67
  onSelect();
68
68
  }
69
69
  $.user_effect(() => {
70
+ if (orientation()) carouselState.orientation = orientation();
71
+ if ($$props.options) carouselState.options = $$props.options;
72
+ if ($$props.plugins?.length) carouselState.plugins = $$props.plugins;
70
73
  return () => {
71
74
  carouselState.api?.off("select", onSelect);
72
75
  };
@@ -0,0 +1,39 @@
1
+ import { getEmblaContext } from "../context.js";
2
+ import styles_css_default from "./styles.css.js";
3
+ import "svelte/internal/disclose-version";
4
+ import * as $ from "svelte/internal/client";
5
+
6
+ //#region src/components/Carousel/Dots/Dots.svelte
7
+ var root_1 = $.from_html(`<button type="button" aria-label="Carousel Dots"></button>`);
8
+ var root = $.from_html(`<div></div>`);
9
+ function Dots($$anchor, $$props) {
10
+ $.push($$props, true);
11
+ let restProps = $.rest_props($$props, [
12
+ "$$slots",
13
+ "$$events",
14
+ "$$legacy",
15
+ "class"
16
+ ]);
17
+ const emblaCtx = getEmblaContext("<Carousel.Dots/>");
18
+ const onClick = (index) => {
19
+ emblaCtx.scrollTo(index);
20
+ };
21
+ var div = root();
22
+ $.attribute_effect(div, () => ({
23
+ class: [styles_css_default.wrapper[emblaCtx.orientation], $$props.class],
24
+ ...restProps
25
+ }));
26
+ $.each(div, 21, () => emblaCtx.scrollSnaps, $.index, ($$anchor$1, _, index) => {
27
+ var button = root_1();
28
+ button.__click = () => onClick(index);
29
+ $.template_effect(() => $.set_class(button, 1, $.clsx([styles_css_default.dotButton[emblaCtx.orientation], { [styles_css_default.selected]: index === emblaCtx.selectedIndex }])));
30
+ $.append($$anchor$1, button);
31
+ });
32
+ $.reset(div);
33
+ $.append($$anchor, div);
34
+ $.pop();
35
+ }
36
+ $.delegate(["click"]);
37
+
38
+ //#endregion
39
+ export { Dots as default };
@@ -0,0 +1,3 @@
1
+ declare const Dots: import("svelte").Component<Omit<import("svelte/elements").HTMLAttributes<HTMLDivElement>, "children">, {}, "">;
2
+ type Dots = ReturnType<typeof Dots>;
3
+ export default Dots;
@@ -0,0 +1 @@
1
+ export { default as Dots } from './Dots.svelte';
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ wrapper: Record<"horizontal" | "vertical", string>;
3
+ dotButton: Record<"horizontal" | "vertical", string>;
4
+ selected: string;
5
+ };
6
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import "./../../../assets/theme.css.ts.vanilla-HT3RGHeI.css";
2
+ import "./../../../assets/styles.css.ts.vanilla-GOQJy88x.css";
3
+
4
+ //#region src/components/Carousel/Dots/styles.css.ts
5
+ var __default__ = {
6
+ wrapper: {
7
+ horizontal: "styles_wrapper_horizontal__zoccy11 styles_baseWrapper__zoccy10",
8
+ vertical: "styles_wrapper_vertical__zoccy12 styles_baseWrapper__zoccy10"
9
+ },
10
+ dotButton: {
11
+ horizontal: "styles_dotButton_horizontal__zoccy14 styles_buttonBase__zoccy13",
12
+ vertical: "styles_dotButton_vertical__zoccy15 styles_buttonBase__zoccy13"
13
+ },
14
+ selected: "styles_selected__zoccy16"
15
+ };
16
+ var styles_css_default = __default__;
17
+
18
+ //#endregion
19
+ export { styles_css_default as default };
@@ -2,7 +2,7 @@ export declare const Carousel: {
2
2
  Root: import("svelte").Component<import("./types.js").CarouselProps, {}, "ref">;
3
3
  Content: import("svelte").Component<import("../../types.js").WithElementRef<import("svelte/elements").HTMLAttributes<HTMLDivElement>>, {}, "ref">;
4
4
  Item: import("svelte").Component<import("../../types.js").WithElementRef<import("svelte/elements").HTMLAttributes<HTMLDivElement>>, {}, "ref">;
5
- Next: import("svelte").Component<Omit<import("../Button/types.js").ButtonProps, "children">, {}, "ref">;
6
- Previous: import("svelte").Component<Omit<import("../Button/types.js").ButtonProps, "children">, {}, "ref">;
5
+ Arrows: import("svelte").Component<Omit<import("svelte/elements").HTMLButtonAttributes, "children">, {}, "">;
6
+ Dots: import("svelte").Component<Omit<import("svelte/elements").HTMLAttributes<HTMLDivElement>, "children">, {}, "">;
7
7
  };
8
8
  export type * from './types.js';
@@ -1,16 +1,16 @@
1
+ import Arrows from "./Arrows/Arrows.js";
1
2
  import Carousel$1 from "./Carousel.js";
2
3
  import Content from "./Content/Content.js";
4
+ import Dots from "./Dots/Dots.js";
3
5
  import Item from "./Item/Item.js";
4
- import Next from "./Next/Next.js";
5
- import Previous from "./Previous/Previous.js";
6
6
 
7
7
  //#region src/components/Carousel/index.ts
8
8
  const Carousel = {
9
9
  Root: Carousel$1,
10
10
  Content,
11
11
  Item,
12
- Next,
13
- Previous
12
+ Arrows,
13
+ Dots
14
14
  };
15
15
 
16
16
  //#endregion
@@ -1,12 +1,12 @@
1
- import type { WithElementRef } from '../../types.js';
2
- import type { HTMLAttributes } from 'svelte/elements';
3
1
  import type { EmblaCarouselSvelteType, default as emblaCarouselSvelte } from 'embla-carousel-svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ import type { WithElementRef } from '../../types.js';
4
4
  export type CarouselAPI = NonNullable<NonNullable<EmblaCarouselSvelteType['$$_attributes']>['onemblaInit']> extends (evt: CustomEvent<infer API>) => void ? API : any;
5
5
  type EmblaCarouselConfig = NonNullable<Parameters<typeof emblaCarouselSvelte>[1]>;
6
6
  export type CarouselOptions = EmblaCarouselConfig['options'];
7
7
  export type CarouselPlugins = EmblaCarouselConfig['plugins'];
8
8
  export interface CarouselProps extends WithElementRef<HTMLAttributes<HTMLDivElement>> {
9
- opts?: CarouselOptions;
9
+ options?: CarouselOptions;
10
10
  plugins?: CarouselPlugins;
11
11
  setApi?: (api: CarouselAPI | undefined) => void;
12
12
  orientation?: 'horizontal' | 'vertical';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@max-ts/svelte",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "type": "module",
5
5
  "description": "Svelte component library.",
6
6
  "author": "Tsepelev Maksim",
@@ -1,25 +0,0 @@
1
- .styles_button__2sfgz90 {
2
- position: absolute;
3
- width: var(--spacing-8);
4
- height: var(--spacing-8);
5
- border-radius: 9999px;
6
- }
7
- .styles_button__2sfgz90 span {
8
- visibility: hidden;
9
- width: 0;
10
- height: 0;
11
- }
12
- .styles_button__2sfgz90 svg {
13
- width: var(--spacing-4);
14
- height: var(--spacing-4);
15
- }
16
- .styles_orientation_horizontal__2sfgz91 {
17
- right: calc(-1 * var(--spacing-10));
18
- top: 50%;
19
- transform: translateY(-50%);
20
- }
21
- .styles_orientation_vertical__2sfgz92 {
22
- left: 50%;
23
- bottom: calc(-1 * var(--spacing-10));
24
- transform: translateX(-50%) rotate(90deg);
25
- }
@@ -1,25 +0,0 @@
1
- .styles_button__4va6680 {
2
- position: absolute;
3
- width: var(--spacing-8);
4
- height: var(--spacing-8);
5
- border-radius: 9999px;
6
- }
7
- .styles_button__4va6680 span {
8
- visibility: hidden;
9
- width: 0;
10
- height: 0;
11
- }
12
- .styles_button__4va6680 svg {
13
- width: var(--spacing-4);
14
- height: var(--spacing-4);
15
- }
16
- .styles_orientation_horizontal__4va6681 {
17
- left: calc(-1 * var(--spacing-10));
18
- top: 50%;
19
- transform: translateY(-50%);
20
- }
21
- .styles_orientation_vertical__4va6682 {
22
- left: 50%;
23
- top: calc(-1 * var(--spacing-10));
24
- transform: translateX(-50%) rotate(90deg);
25
- }
@@ -1,69 +0,0 @@
1
- import Button from "../../Button/Button.js";
2
- import { getEmblaContext } from "../context.js";
3
- import styles_css_default from "./styles.css.js";
4
- import "svelte/internal/disclose-version";
5
- import * as $ from "svelte/internal/client";
6
- import ArrowRightIcon from "@lucide/svelte/icons/arrow-right";
7
-
8
- //#region src/components/Carousel/Next/Next.svelte
9
- var root_1 = $.from_html(`<!> <span class="sr-only">Next slide</span>`, 1);
10
- function Next($$anchor, $$props) {
11
- $.push($$props, true);
12
- let ref = $.prop($$props, "ref", 15, null), variant = $.prop($$props, "variant", 3, "outline"), size = $.prop($$props, "size", 3, "icon"), restProps = $.rest_props($$props, [
13
- "$$slots",
14
- "$$events",
15
- "$$legacy",
16
- "ref",
17
- "class",
18
- "variant",
19
- "size"
20
- ]);
21
- const emblaCtx = getEmblaContext("<Carousel.Next/>");
22
- {
23
- let $0 = $.derived(() => !emblaCtx.canScrollNext);
24
- let $1 = $.derived(() => [
25
- styles_css_default.button,
26
- styles_css_default.orientation[emblaCtx.orientation],
27
- $$props.class
28
- ]);
29
- Button($$anchor, $.spread_props({
30
- "data-slot": "carousel-next",
31
- get variant() {
32
- return variant();
33
- },
34
- get size() {
35
- return size();
36
- },
37
- get disabled() {
38
- return $.get($0);
39
- },
40
- get class() {
41
- return $.get($1);
42
- },
43
- get onclick() {
44
- return emblaCtx.scrollNext;
45
- },
46
- get onkeydown() {
47
- return emblaCtx.handleKeyDown;
48
- }
49
- }, () => restProps, {
50
- get ref() {
51
- return ref();
52
- },
53
- set ref($$value) {
54
- ref($$value);
55
- },
56
- children: ($$anchor$1, $$slotProps) => {
57
- var fragment_1 = root_1();
58
- ArrowRightIcon($.first_child(fragment_1), {});
59
- $.next(2);
60
- $.append($$anchor$1, fragment_1);
61
- },
62
- $$slots: { default: true }
63
- }));
64
- }
65
- $.pop();
66
- }
67
-
68
- //#endregion
69
- export { Next as default };
@@ -1,4 +0,0 @@
1
- import type { ButtonProps } from '../../Button/types.js';
2
- declare const Next: import("svelte").Component<Omit<ButtonProps, "children">, {}, "ref">;
3
- type Next = ReturnType<typeof Next>;
4
- export default Next;
@@ -1 +0,0 @@
1
- export { default as Next } from './Next.svelte';
@@ -1,7 +0,0 @@
1
- export declare const button: string;
2
- export declare const orientation: Record<"horizontal" | "vertical", string>;
3
- declare const _default: {
4
- button: string;
5
- orientation: Record<"horizontal" | "vertical", string>;
6
- };
7
- export default _default;
@@ -1,16 +0,0 @@
1
- import "./../../../assets/theme.css.ts.vanilla-HT3RGHeI.css";
2
- import "./../../../assets/styles.css.ts.vanilla-Cj0JBm6N.css";
3
-
4
- //#region src/components/Carousel/Next/styles.css.ts
5
- var orientation = {
6
- horizontal: "styles_orientation_horizontal__2sfgz91",
7
- vertical: "styles_orientation_vertical__2sfgz92"
8
- };
9
- var __default__ = {
10
- button: "styles_button__2sfgz90",
11
- orientation
12
- };
13
- var styles_css_default = __default__;
14
-
15
- //#endregion
16
- export { styles_css_default as default };
@@ -1,69 +0,0 @@
1
- import Button from "../../Button/Button.js";
2
- import { getEmblaContext } from "../context.js";
3
- import styles_css_default from "./styles.css.js";
4
- import "svelte/internal/disclose-version";
5
- import * as $ from "svelte/internal/client";
6
- import ArrowLeftIcon from "@lucide/svelte/icons/arrow-left";
7
-
8
- //#region src/components/Carousel/Previous/Previous.svelte
9
- var root_1 = $.from_html(`<!> <span>Previous slide</span>`, 1);
10
- function Previous($$anchor, $$props) {
11
- $.push($$props, true);
12
- let ref = $.prop($$props, "ref", 15, null), variant = $.prop($$props, "variant", 3, "outline"), size = $.prop($$props, "size", 3, "icon"), restProps = $.rest_props($$props, [
13
- "$$slots",
14
- "$$events",
15
- "$$legacy",
16
- "ref",
17
- "class",
18
- "variant",
19
- "size"
20
- ]);
21
- const emblaCtx = getEmblaContext("<Carousel.Previous/>");
22
- {
23
- let $0 = $.derived(() => !emblaCtx.canScrollPrev);
24
- let $1 = $.derived(() => [
25
- styles_css_default.button,
26
- styles_css_default.orientation[emblaCtx.orientation],
27
- $$props.class
28
- ]);
29
- Button($$anchor, $.spread_props({
30
- "data-slot": "carousel-previous",
31
- get variant() {
32
- return variant();
33
- },
34
- get size() {
35
- return size();
36
- },
37
- get disabled() {
38
- return $.get($0);
39
- },
40
- get class() {
41
- return $.get($1);
42
- },
43
- get onclick() {
44
- return emblaCtx.scrollPrev;
45
- },
46
- get onkeydown() {
47
- return emblaCtx.handleKeyDown;
48
- }
49
- }, () => restProps, {
50
- get ref() {
51
- return ref();
52
- },
53
- set ref($$value) {
54
- ref($$value);
55
- },
56
- children: ($$anchor$1, $$slotProps) => {
57
- var fragment_1 = root_1();
58
- ArrowLeftIcon($.first_child(fragment_1), {});
59
- $.next(2);
60
- $.append($$anchor$1, fragment_1);
61
- },
62
- $$slots: { default: true }
63
- }));
64
- }
65
- $.pop();
66
- }
67
-
68
- //#endregion
69
- export { Previous as default };
@@ -1,4 +0,0 @@
1
- import type { ButtonProps } from '../../Button/types.js';
2
- declare const Previous: import("svelte").Component<Omit<ButtonProps, "children">, {}, "ref">;
3
- type Previous = ReturnType<typeof Previous>;
4
- export default Previous;
@@ -1 +0,0 @@
1
- export { default as Previous } from './Previous.svelte';
@@ -1,7 +0,0 @@
1
- export declare const button: string;
2
- export declare const orientation: Record<"horizontal" | "vertical", string>;
3
- declare const _default: {
4
- button: string;
5
- orientation: Record<"horizontal" | "vertical", string>;
6
- };
7
- export default _default;
@@ -1,16 +0,0 @@
1
- import "./../../../assets/theme.css.ts.vanilla-HT3RGHeI.css";
2
- import "./../../../assets/styles.css.ts.vanilla-D2NN324N.css";
3
-
4
- //#region src/components/Carousel/Previous/styles.css.ts
5
- var orientation = {
6
- horizontal: "styles_orientation_horizontal__4va6681",
7
- vertical: "styles_orientation_vertical__4va6682"
8
- };
9
- var __default__ = {
10
- button: "styles_button__4va6680",
11
- orientation
12
- };
13
- var styles_css_default = __default__;
14
-
15
- //#endregion
16
- export { styles_css_default as default };