@yamada-ui/carousel 1.0.28 → 2.0.0-next-20240513035416
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/carousel-control.d.mts +8 -0
- package/dist/carousel-control.d.ts +8 -0
- package/dist/carousel-control.js +158 -0
- package/dist/carousel-control.js.map +1 -0
- package/dist/carousel-control.mjs +11 -0
- package/dist/carousel-control.mjs.map +1 -0
- package/dist/carousel-indicators.d.mts +17 -0
- package/dist/carousel-indicators.d.ts +17 -0
- package/dist/carousel-indicators.js +141 -0
- package/dist/carousel-indicators.js.map +1 -0
- package/dist/carousel-indicators.mjs +9 -0
- package/dist/carousel-indicators.mjs.map +1 -0
- package/dist/carousel-slide.d.mts +17 -0
- package/dist/carousel-slide.d.ts +17 -0
- package/dist/carousel-slide.js +106 -0
- package/dist/carousel-slide.js.map +1 -0
- package/dist/carousel-slide.mjs +9 -0
- package/dist/carousel-slide.mjs.map +1 -0
- package/dist/carousel.d.mts +144 -0
- package/dist/carousel.d.ts +144 -0
- package/dist/carousel.js +599 -0
- package/dist/carousel.js.map +1 -0
- package/dist/carousel.mjs +12 -0
- package/dist/carousel.mjs.map +1 -0
- package/dist/chunk-DDY7Q2IV.mjs +87 -0
- package/dist/chunk-DDY7Q2IV.mjs.map +1 -0
- package/dist/chunk-IKJXFLRJ.mjs +72 -0
- package/dist/chunk-IKJXFLRJ.mjs.map +1 -0
- package/dist/chunk-QQ2HS4J4.mjs +260 -0
- package/dist/chunk-QQ2HS4J4.mjs.map +1 -0
- package/dist/chunk-VQX7S5CU.mjs +50 -0
- package/dist/chunk-VQX7S5CU.mjs.map +1 -0
- package/dist/chunk-YDLJHKEU.mjs +171 -0
- package/dist/chunk-YDLJHKEU.mjs.map +1 -0
- package/dist/index.d.mts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +609 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +23 -0
- package/dist/index.mjs.map +1 -0
- package/dist/use-carousel.d.mts +176 -0
- package/dist/use-carousel.d.ts +176 -0
- package/dist/use-carousel.js +292 -0
- package/dist/use-carousel.js.map +1 -0
- package/dist/use-carousel.mjs +18 -0
- package/dist/use-carousel.mjs.map +1 -0
- package/package.json +1 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
@@ -0,0 +1,144 @@
|
|
1
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
2
|
+
import { ThemeProps, HTMLUIProps, Token, CSSUIProps } from '@yamada-ui/core';
|
3
|
+
import { UseCarouselProps } from './use-carousel.mjs';
|
4
|
+
import { CarouselControlProps } from './carousel-control.mjs';
|
5
|
+
import { CarouselIndicatorsProps } from './carousel-indicators.mjs';
|
6
|
+
import 'react';
|
7
|
+
import '@yamada-ui/button';
|
8
|
+
import 'embla-carousel-react';
|
9
|
+
|
10
|
+
type CarouselOptions = {
|
11
|
+
/**
|
12
|
+
* The orientation of the carousel.
|
13
|
+
*
|
14
|
+
* @default 'horizontal'
|
15
|
+
*/
|
16
|
+
orientation?: Token<"vertical" | "horizontal">;
|
17
|
+
/**
|
18
|
+
* The alignment of the carousel.
|
19
|
+
*
|
20
|
+
* @default 'center'
|
21
|
+
*/
|
22
|
+
align?: Token<"start" | "center" | "end" | number>;
|
23
|
+
/**
|
24
|
+
* Clear leading and trailing empty space that causes excessive scrolling.
|
25
|
+
* Use trimSnaps to only use snap points that trigger scrolling or keepSnaps to keep them.
|
26
|
+
*
|
27
|
+
* @default ''
|
28
|
+
*/
|
29
|
+
containScroll?: Token<"trimSnaps" | "keepSnaps" | "">;
|
30
|
+
/**
|
31
|
+
* The number of slides that should be scrolled with next or previous buttons.
|
32
|
+
*
|
33
|
+
* @default 1
|
34
|
+
*/
|
35
|
+
slidesToScroll?: Token<number>;
|
36
|
+
/**
|
37
|
+
* If `true`, momentum scrolling will be enabled.
|
38
|
+
*
|
39
|
+
* @default false
|
40
|
+
*/
|
41
|
+
dragFree?: Token<boolean>;
|
42
|
+
/**
|
43
|
+
* If `true`, carousel can be scrolled with mouse and touch interactions.
|
44
|
+
*
|
45
|
+
* @default true
|
46
|
+
*/
|
47
|
+
draggable?: Token<boolean>;
|
48
|
+
/**
|
49
|
+
* Choose a fraction representing the percentage portion of a slide that needs to be visible in order to be considered in view.
|
50
|
+
*
|
51
|
+
* @default 0
|
52
|
+
*/
|
53
|
+
inViewThreshold?: Token<number>;
|
54
|
+
/**
|
55
|
+
* If `true`, infinite looping.
|
56
|
+
* Automatically falls back to false if slide content isn't enough to loop.
|
57
|
+
*
|
58
|
+
* @default true
|
59
|
+
*/
|
60
|
+
loop?: Token<boolean>;
|
61
|
+
/**
|
62
|
+
* If `true`, allow the carousel to skip scroll snaps if it's dragged vigorously.
|
63
|
+
* Note that this option will be ignored if the dragFree option is set to true.
|
64
|
+
*
|
65
|
+
* @default false
|
66
|
+
*/
|
67
|
+
skipSnaps?: Token<boolean>;
|
68
|
+
/**
|
69
|
+
* Adjusts scroll speed when triggered by any of the methods.
|
70
|
+
* Higher numbers enables faster scrolling.
|
71
|
+
*
|
72
|
+
* @default 10
|
73
|
+
*/
|
74
|
+
speed?: Token<number>;
|
75
|
+
/**
|
76
|
+
* The number for the autoplay interval of the carousel.
|
77
|
+
*
|
78
|
+
* @default 4000
|
79
|
+
*/
|
80
|
+
delay?: Token<number>;
|
81
|
+
/**
|
82
|
+
* If `true`, the carousel will be autoplay.
|
83
|
+
*
|
84
|
+
* @default false
|
85
|
+
*/
|
86
|
+
autoplay?: Token<boolean>;
|
87
|
+
/**
|
88
|
+
* If `true`, autoplay will pause when the mouse entries over.
|
89
|
+
*
|
90
|
+
* @default true
|
91
|
+
*/
|
92
|
+
stopMouseEnterAutoplay?: Token<boolean>;
|
93
|
+
/**
|
94
|
+
* If `true`, gap will be treated as part of the carousel slide size.
|
95
|
+
*
|
96
|
+
* @default true
|
97
|
+
*/
|
98
|
+
includeGapInSize?: Token<boolean>;
|
99
|
+
/**
|
100
|
+
* The CSS `width` property.
|
101
|
+
*/
|
102
|
+
slideSize?: CSSUIProps["width"];
|
103
|
+
/**
|
104
|
+
* Props for carousel inner element.
|
105
|
+
*/
|
106
|
+
innerProps?: HTMLUIProps<"div">;
|
107
|
+
/**
|
108
|
+
* If `true`, display the carousel control buttons.
|
109
|
+
*
|
110
|
+
* @default true
|
111
|
+
*/
|
112
|
+
withControls?: Token<boolean>;
|
113
|
+
/**
|
114
|
+
* Props for carousel control element.
|
115
|
+
*/
|
116
|
+
controlProps?: CarouselControlProps;
|
117
|
+
/**
|
118
|
+
* Props for previous of the carousel control element.
|
119
|
+
*/
|
120
|
+
controlPrevProps?: CarouselControlProps;
|
121
|
+
/**
|
122
|
+
* Props for next of the carousel control element.
|
123
|
+
*/
|
124
|
+
controlNextProps?: CarouselControlProps;
|
125
|
+
/**
|
126
|
+
* If `true`, display the carousel indicator buttons.
|
127
|
+
*
|
128
|
+
* @default true
|
129
|
+
*/
|
130
|
+
withIndicators?: Token<boolean>;
|
131
|
+
/**
|
132
|
+
* Props for carousel indicators element.
|
133
|
+
*/
|
134
|
+
indicatorsProps?: CarouselIndicatorsProps;
|
135
|
+
};
|
136
|
+
type CarouselProps = ThemeProps<"Carousel"> & Omit<HTMLUIProps<"div">, "onChange" | "draggable"> & Pick<UseCarouselProps, "index" | "defaultIndex" | "onChange" | "onScrollProgress"> & CarouselOptions;
|
137
|
+
/**
|
138
|
+
* `Carousel` is a component that displays multiple elements like a slideshow.
|
139
|
+
*
|
140
|
+
* @see Docs https://yamada-ui.com/components/data-display/carousel
|
141
|
+
*/
|
142
|
+
declare const Carousel: _yamada_ui_core.Component<"div", CarouselProps>;
|
143
|
+
|
144
|
+
export { Carousel, type CarouselProps };
|
@@ -0,0 +1,144 @@
|
|
1
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
2
|
+
import { ThemeProps, HTMLUIProps, Token, CSSUIProps } from '@yamada-ui/core';
|
3
|
+
import { UseCarouselProps } from './use-carousel.js';
|
4
|
+
import { CarouselControlProps } from './carousel-control.js';
|
5
|
+
import { CarouselIndicatorsProps } from './carousel-indicators.js';
|
6
|
+
import 'react';
|
7
|
+
import '@yamada-ui/button';
|
8
|
+
import 'embla-carousel-react';
|
9
|
+
|
10
|
+
type CarouselOptions = {
|
11
|
+
/**
|
12
|
+
* The orientation of the carousel.
|
13
|
+
*
|
14
|
+
* @default 'horizontal'
|
15
|
+
*/
|
16
|
+
orientation?: Token<"vertical" | "horizontal">;
|
17
|
+
/**
|
18
|
+
* The alignment of the carousel.
|
19
|
+
*
|
20
|
+
* @default 'center'
|
21
|
+
*/
|
22
|
+
align?: Token<"start" | "center" | "end" | number>;
|
23
|
+
/**
|
24
|
+
* Clear leading and trailing empty space that causes excessive scrolling.
|
25
|
+
* Use trimSnaps to only use snap points that trigger scrolling or keepSnaps to keep them.
|
26
|
+
*
|
27
|
+
* @default ''
|
28
|
+
*/
|
29
|
+
containScroll?: Token<"trimSnaps" | "keepSnaps" | "">;
|
30
|
+
/**
|
31
|
+
* The number of slides that should be scrolled with next or previous buttons.
|
32
|
+
*
|
33
|
+
* @default 1
|
34
|
+
*/
|
35
|
+
slidesToScroll?: Token<number>;
|
36
|
+
/**
|
37
|
+
* If `true`, momentum scrolling will be enabled.
|
38
|
+
*
|
39
|
+
* @default false
|
40
|
+
*/
|
41
|
+
dragFree?: Token<boolean>;
|
42
|
+
/**
|
43
|
+
* If `true`, carousel can be scrolled with mouse and touch interactions.
|
44
|
+
*
|
45
|
+
* @default true
|
46
|
+
*/
|
47
|
+
draggable?: Token<boolean>;
|
48
|
+
/**
|
49
|
+
* Choose a fraction representing the percentage portion of a slide that needs to be visible in order to be considered in view.
|
50
|
+
*
|
51
|
+
* @default 0
|
52
|
+
*/
|
53
|
+
inViewThreshold?: Token<number>;
|
54
|
+
/**
|
55
|
+
* If `true`, infinite looping.
|
56
|
+
* Automatically falls back to false if slide content isn't enough to loop.
|
57
|
+
*
|
58
|
+
* @default true
|
59
|
+
*/
|
60
|
+
loop?: Token<boolean>;
|
61
|
+
/**
|
62
|
+
* If `true`, allow the carousel to skip scroll snaps if it's dragged vigorously.
|
63
|
+
* Note that this option will be ignored if the dragFree option is set to true.
|
64
|
+
*
|
65
|
+
* @default false
|
66
|
+
*/
|
67
|
+
skipSnaps?: Token<boolean>;
|
68
|
+
/**
|
69
|
+
* Adjusts scroll speed when triggered by any of the methods.
|
70
|
+
* Higher numbers enables faster scrolling.
|
71
|
+
*
|
72
|
+
* @default 10
|
73
|
+
*/
|
74
|
+
speed?: Token<number>;
|
75
|
+
/**
|
76
|
+
* The number for the autoplay interval of the carousel.
|
77
|
+
*
|
78
|
+
* @default 4000
|
79
|
+
*/
|
80
|
+
delay?: Token<number>;
|
81
|
+
/**
|
82
|
+
* If `true`, the carousel will be autoplay.
|
83
|
+
*
|
84
|
+
* @default false
|
85
|
+
*/
|
86
|
+
autoplay?: Token<boolean>;
|
87
|
+
/**
|
88
|
+
* If `true`, autoplay will pause when the mouse entries over.
|
89
|
+
*
|
90
|
+
* @default true
|
91
|
+
*/
|
92
|
+
stopMouseEnterAutoplay?: Token<boolean>;
|
93
|
+
/**
|
94
|
+
* If `true`, gap will be treated as part of the carousel slide size.
|
95
|
+
*
|
96
|
+
* @default true
|
97
|
+
*/
|
98
|
+
includeGapInSize?: Token<boolean>;
|
99
|
+
/**
|
100
|
+
* The CSS `width` property.
|
101
|
+
*/
|
102
|
+
slideSize?: CSSUIProps["width"];
|
103
|
+
/**
|
104
|
+
* Props for carousel inner element.
|
105
|
+
*/
|
106
|
+
innerProps?: HTMLUIProps<"div">;
|
107
|
+
/**
|
108
|
+
* If `true`, display the carousel control buttons.
|
109
|
+
*
|
110
|
+
* @default true
|
111
|
+
*/
|
112
|
+
withControls?: Token<boolean>;
|
113
|
+
/**
|
114
|
+
* Props for carousel control element.
|
115
|
+
*/
|
116
|
+
controlProps?: CarouselControlProps;
|
117
|
+
/**
|
118
|
+
* Props for previous of the carousel control element.
|
119
|
+
*/
|
120
|
+
controlPrevProps?: CarouselControlProps;
|
121
|
+
/**
|
122
|
+
* Props for next of the carousel control element.
|
123
|
+
*/
|
124
|
+
controlNextProps?: CarouselControlProps;
|
125
|
+
/**
|
126
|
+
* If `true`, display the carousel indicator buttons.
|
127
|
+
*
|
128
|
+
* @default true
|
129
|
+
*/
|
130
|
+
withIndicators?: Token<boolean>;
|
131
|
+
/**
|
132
|
+
* Props for carousel indicators element.
|
133
|
+
*/
|
134
|
+
indicatorsProps?: CarouselIndicatorsProps;
|
135
|
+
};
|
136
|
+
type CarouselProps = ThemeProps<"Carousel"> & Omit<HTMLUIProps<"div">, "onChange" | "draggable"> & Pick<UseCarouselProps, "index" | "defaultIndex" | "onChange" | "onScrollProgress"> & CarouselOptions;
|
137
|
+
/**
|
138
|
+
* `Carousel` is a component that displays multiple elements like a slideshow.
|
139
|
+
*
|
140
|
+
* @see Docs https://yamada-ui.com/components/data-display/carousel
|
141
|
+
*/
|
142
|
+
declare const Carousel: _yamada_ui_core.Component<"div", CarouselProps>;
|
143
|
+
|
144
|
+
export { Carousel, type CarouselProps };
|