@atom-learning/components 6.17.0-beta.1 → 6.17.0-beta.2
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/components/carousel/Carousel.d.ts +2 -1
- package/dist/components/carousel/Carousel.js +1 -1
- package/dist/components/carousel/CarouselSlide.js +4 -2
- package/dist/components/carousel/CarouselSlide.js.map +1 -1
- package/dist/components/carousel/CarouselSlider.d.ts +5 -1
- package/dist/components/carousel/CarouselSlider.js +12 -3
- package/dist/components/carousel/CarouselSlider.js.map +1 -1
- package/dist/docgen.json +1 -1
- package/dist/index.cjs.js +24 -14
- package/dist/index.cjs.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -2195,20 +2195,17 @@ var CarouselPagination = ({ className, ...rest }) => {
|
|
|
2195
2195
|
})));
|
|
2196
2196
|
};
|
|
2197
2197
|
//#endregion
|
|
2198
|
-
//#region src/components/carousel/CarouselSlide.tsx
|
|
2199
|
-
var CarouselSlide = ({ children, className, index, ...rest }) => {
|
|
2200
|
-
const { selectedIndex } = useCarousel();
|
|
2201
|
-
const isSelected = selectedIndex === index;
|
|
2202
|
-
return /* @__PURE__ */ react.createElement("div", {
|
|
2203
|
-
role: "option",
|
|
2204
|
-
"aria-selected": isSelected,
|
|
2205
|
-
className: cn("basis-full", "shrink-0", className),
|
|
2206
|
-
...rest
|
|
2207
|
-
}, /* @__PURE__ */ react.createElement("div", { className: "flex items-center justify-center px-3" }, children));
|
|
2208
|
-
};
|
|
2209
|
-
//#endregion
|
|
2210
2198
|
//#region src/components/carousel/CarouselSlider.tsx
|
|
2211
|
-
var
|
|
2199
|
+
var toSlideGapClass = {
|
|
2200
|
+
none: "",
|
|
2201
|
+
0: "px-0.5",
|
|
2202
|
+
1: "px-1",
|
|
2203
|
+
2: "px-2",
|
|
2204
|
+
3: "px-3",
|
|
2205
|
+
4: "px-4"
|
|
2206
|
+
};
|
|
2207
|
+
var CarouselSlideGapContext = react.createContext(3);
|
|
2208
|
+
var CarouselSlider = ({ children, className, gap = 3, overflow, tabIndex = 0, ...rest }) => {
|
|
2212
2209
|
const { emblaRef } = useCarousel();
|
|
2213
2210
|
return /* @__PURE__ */ react.createElement("div", {
|
|
2214
2211
|
ref: emblaRef,
|
|
@@ -2217,7 +2214,20 @@ var CarouselSlider = ({ children, className, overflow, tabIndex = 0, ...rest })
|
|
|
2217
2214
|
"aria-live": "polite",
|
|
2218
2215
|
tabIndex,
|
|
2219
2216
|
...rest
|
|
2220
|
-
}, /* @__PURE__ */ react.createElement("div", { className: "flex" }, children));
|
|
2217
|
+
}, /* @__PURE__ */ react.createElement("div", { className: "flex" }, /* @__PURE__ */ react.createElement(CarouselSlideGapContext.Provider, { value: gap }, children)));
|
|
2218
|
+
};
|
|
2219
|
+
//#endregion
|
|
2220
|
+
//#region src/components/carousel/CarouselSlide.tsx
|
|
2221
|
+
var CarouselSlide = ({ children, className, index, ...rest }) => {
|
|
2222
|
+
const { selectedIndex } = useCarousel();
|
|
2223
|
+
const gap = react.useContext(CarouselSlideGapContext);
|
|
2224
|
+
const isSelected = selectedIndex === index;
|
|
2225
|
+
return /* @__PURE__ */ react.createElement("div", {
|
|
2226
|
+
role: "option",
|
|
2227
|
+
"aria-selected": isSelected,
|
|
2228
|
+
className: cn("min-w-0", "basis-full", "shrink-0", className),
|
|
2229
|
+
...rest
|
|
2230
|
+
}, /* @__PURE__ */ react.createElement("div", { className: cn("flex items-center justify-center", toSlideGapClass[gap]) }, children));
|
|
2221
2231
|
};
|
|
2222
2232
|
//#endregion
|
|
2223
2233
|
//#region src/components/carousel/Carousel.tsx
|