@fluixi-ui/carousel 0.1.0-alpha.1 → 0.1.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/carousel.d.ts +42 -0
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +456 -374
- package/dist/index.js +2 -10
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +6 -5
package/dist/carousel.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type FxProp } from '@fluixi-ui/fx';
|
|
1
2
|
import { type Accessor } from '@fluixi/reactive/signal';
|
|
2
3
|
import { type Orientation } from '@fluixi-ui/kit';
|
|
3
4
|
import { type Collection, type CollectionItem } from '@fluixi-ui/primitives';
|
|
@@ -42,6 +43,16 @@ export interface CarouselProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onC
|
|
|
42
43
|
pauseOnHover?: boolean;
|
|
43
44
|
/** Allow dragging/swiping the viewport to change slides. Default `true`. */
|
|
44
45
|
draggable?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Lay the controls over the slides instead of below them.
|
|
48
|
+
*
|
|
49
|
+
* The arrows sit against the viewport's edges and the dots along its bottom,
|
|
50
|
+
* so the carousel occupies only the height of its slides. Controls get a
|
|
51
|
+
* translucent scrim so they stay legible over an arbitrary image.
|
|
52
|
+
*/
|
|
53
|
+
overlay?: boolean;
|
|
54
|
+
/** Token-aware style object. See `@fluixi-ui/fx`. */
|
|
55
|
+
fx?: FxProp;
|
|
45
56
|
}
|
|
46
57
|
/**
|
|
47
58
|
* Root of a carousel. Owns the active slide index (controlled `index` or
|
|
@@ -67,14 +78,45 @@ export interface CarouselProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onC
|
|
|
67
78
|
*/
|
|
68
79
|
export declare function Carousel(props: CarouselProps): ComponentChild;
|
|
69
80
|
export interface CarouselViewportProps extends HTMLAttributes<HTMLDivElement> {
|
|
81
|
+
/** Token-aware style object. See `@fluixi-ui/fx`. */
|
|
82
|
+
fx?: FxProp;
|
|
70
83
|
}
|
|
71
84
|
/** Clips the slides and translates the track to the active slide. */
|
|
72
85
|
export declare function CarouselViewport(props: CarouselViewportProps): ComponentChild;
|
|
73
86
|
export interface CarouselSlideProps extends HTMLAttributes<HTMLDivElement> {
|
|
87
|
+
/** Token-aware style object. See `@fluixi-ui/fx`. */
|
|
88
|
+
fx?: FxProp;
|
|
74
89
|
}
|
|
75
90
|
/** A single slide; registers with the carousel so counts and dots stay in sync. */
|
|
76
91
|
export declare function CarouselSlide(props: CarouselSlideProps): ComponentChild;
|
|
92
|
+
export interface CarouselControlsProps extends HTMLAttributes<HTMLDivElement> {
|
|
93
|
+
/** Token-aware style object. See `@fluixi-ui/fx`. */
|
|
94
|
+
fx?: FxProp;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Lays out the carousel's controls: previous, dots, next.
|
|
98
|
+
*
|
|
99
|
+
* Without it every consumer hand-rolls a flex row, and they tend to end up flush
|
|
100
|
+
* against the carousel's edges. In `overlay` mode this becomes a transparent
|
|
101
|
+
* layer over the slides — it stops reserving height, and only the controls
|
|
102
|
+
* themselves take pointer events, so a drag still starts on the slide beneath.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```tsx
|
|
106
|
+
* <Carousel overlay>
|
|
107
|
+
* <CarouselViewport>…</CarouselViewport>
|
|
108
|
+
* <CarouselControls>
|
|
109
|
+
* <CarouselPrevious />
|
|
110
|
+
* <CarouselDots />
|
|
111
|
+
* <CarouselNext />
|
|
112
|
+
* </CarouselControls>
|
|
113
|
+
* </Carousel>
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
export declare function CarouselControls(props: CarouselControlsProps): ComponentChild;
|
|
77
117
|
export interface CarouselButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
118
|
+
/** Token-aware style object. See `@fluixi-ui/fx`. */
|
|
119
|
+
fx?: FxProp;
|
|
78
120
|
}
|
|
79
121
|
/** Moves to the previous slide; disabled at the start unless the carousel loops. */
|
|
80
122
|
export declare function CarouselPrevious(props: CarouselButtonProps): ComponentChild;
|
package/dist/carousel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../src/carousel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../src/carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EAAE,KAAK,QAAQ,EAAyC,MAAM,yBAAyB,CAAC;AAE/F,OAAO,EAQL,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAoB,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC/F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEnF,UAAU,oBAAoB;IAC5B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxB,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxB,WAAW,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IACnC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IACxB,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC/B,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;IACvC,SAAS,EAAE,QAAQ,CAAC,OAAO,C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