@yamada-ui/carousel 0.1.4 → 0.1.6
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-indicators.js +14 -10
- package/dist/carousel-indicators.mjs +1 -1
- package/dist/carousel.js +14 -10
- package/dist/carousel.mjs +2 -2
- package/dist/{chunk-PQ3S6YEB.mjs → chunk-ASYTKKOY.mjs} +1 -1
- package/dist/{chunk-UMRTZXZW.mjs → chunk-YF54MDFK.mjs} +14 -10
- package/dist/index.js +14 -10
- package/dist/index.mjs +2 -2
- package/package.json +8 -8
|
@@ -78,17 +78,9 @@ var useCarouselIndicators = () => {
|
|
|
78
78
|
// src/carousel-indicators.tsx
|
|
79
79
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
80
80
|
var CarouselIndicators = (0, import_core2.forwardRef)(
|
|
81
|
-
({ className, component
|
|
81
|
+
({ className, component, ...rest }, ref) => {
|
|
82
82
|
const { selectedIndex, orientation, styles } = useCarouselContext();
|
|
83
83
|
const { indexes, getIndicatorProps } = useCarouselIndicators();
|
|
84
|
-
const cloneChildren = indexes.map((index) => {
|
|
85
|
-
const isSelected = index === selectedIndex;
|
|
86
|
-
const child = component({ index, isSelected });
|
|
87
|
-
if (!child)
|
|
88
|
-
return null;
|
|
89
|
-
const props = getIndicatorProps({ ...child.props, index });
|
|
90
|
-
return (0, import_react2.cloneElement)(child, props);
|
|
91
|
-
});
|
|
92
84
|
const css = {
|
|
93
85
|
position: "absolute",
|
|
94
86
|
zIndex: "kurillin",
|
|
@@ -97,7 +89,19 @@ var CarouselIndicators = (0, import_core2.forwardRef)(
|
|
|
97
89
|
...styles.indicators,
|
|
98
90
|
...orientation === "vertical" ? { flexDirection: "column" } : { flexDirection: "row" }
|
|
99
91
|
};
|
|
100
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core2.ui.div, { ref, className: (0, import_utils2.cx)("ui-carousel-indicators", className), __css: css, ...rest, children:
|
|
92
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core2.ui.div, { ref, className: (0, import_utils2.cx)("ui-carousel-indicators", className), __css: css, ...rest, children: indexes.map((index) => {
|
|
93
|
+
const isSelected = index === selectedIndex;
|
|
94
|
+
if (typeof component === "function") {
|
|
95
|
+
const child = component({ index, isSelected });
|
|
96
|
+
if (!child)
|
|
97
|
+
return null;
|
|
98
|
+
const props = getIndicatorProps({ ...child.props, index });
|
|
99
|
+
return (0, import_react2.cloneElement)(child, props);
|
|
100
|
+
} else {
|
|
101
|
+
const { key, ...props } = getIndicatorProps({ index });
|
|
102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CarouselIndicator, { ...props }, key);
|
|
103
|
+
}
|
|
104
|
+
}) });
|
|
101
105
|
}
|
|
102
106
|
);
|
|
103
107
|
var CarouselIndicator = ({ className, ...rest }) => {
|
package/dist/carousel.js
CHANGED
|
@@ -374,17 +374,9 @@ var import_utils4 = require("@yamada-ui/utils");
|
|
|
374
374
|
var import_react2 = require("react");
|
|
375
375
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
376
376
|
var CarouselIndicators = (0, import_core4.forwardRef)(
|
|
377
|
-
({ className, component
|
|
377
|
+
({ className, component, ...rest }, ref) => {
|
|
378
378
|
const { selectedIndex, orientation, styles } = useCarouselContext();
|
|
379
379
|
const { indexes, getIndicatorProps } = useCarouselIndicators();
|
|
380
|
-
const cloneChildren = indexes.map((index) => {
|
|
381
|
-
const isSelected = index === selectedIndex;
|
|
382
|
-
const child = component({ index, isSelected });
|
|
383
|
-
if (!child)
|
|
384
|
-
return null;
|
|
385
|
-
const props = getIndicatorProps({ ...child.props, index });
|
|
386
|
-
return (0, import_react2.cloneElement)(child, props);
|
|
387
|
-
});
|
|
388
380
|
const css = {
|
|
389
381
|
position: "absolute",
|
|
390
382
|
zIndex: "kurillin",
|
|
@@ -393,7 +385,19 @@ var CarouselIndicators = (0, import_core4.forwardRef)(
|
|
|
393
385
|
...styles.indicators,
|
|
394
386
|
...orientation === "vertical" ? { flexDirection: "column" } : { flexDirection: "row" }
|
|
395
387
|
};
|
|
396
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core4.ui.div, { ref, className: (0, import_utils4.cx)("ui-carousel-indicators", className), __css: css, ...rest, children:
|
|
388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core4.ui.div, { ref, className: (0, import_utils4.cx)("ui-carousel-indicators", className), __css: css, ...rest, children: indexes.map((index) => {
|
|
389
|
+
const isSelected = index === selectedIndex;
|
|
390
|
+
if (typeof component === "function") {
|
|
391
|
+
const child = component({ index, isSelected });
|
|
392
|
+
if (!child)
|
|
393
|
+
return null;
|
|
394
|
+
const props = getIndicatorProps({ ...child.props, index });
|
|
395
|
+
return (0, import_react2.cloneElement)(child, props);
|
|
396
|
+
} else {
|
|
397
|
+
const { key, ...props } = getIndicatorProps({ index });
|
|
398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CarouselIndicator, { ...props }, key);
|
|
399
|
+
}
|
|
400
|
+
}) });
|
|
397
401
|
}
|
|
398
402
|
);
|
|
399
403
|
var CarouselIndicator = ({ className, ...rest }) => {
|
package/dist/carousel.mjs
CHANGED
|
@@ -9,17 +9,9 @@ import { cx } from "@yamada-ui/utils";
|
|
|
9
9
|
import { cloneElement } from "react";
|
|
10
10
|
import { jsx } from "react/jsx-runtime";
|
|
11
11
|
var CarouselIndicators = forwardRef(
|
|
12
|
-
({ className, component
|
|
12
|
+
({ className, component, ...rest }, ref) => {
|
|
13
13
|
const { selectedIndex, orientation, styles } = useCarouselContext();
|
|
14
14
|
const { indexes, getIndicatorProps } = useCarouselIndicators();
|
|
15
|
-
const cloneChildren = indexes.map((index) => {
|
|
16
|
-
const isSelected = index === selectedIndex;
|
|
17
|
-
const child = component({ index, isSelected });
|
|
18
|
-
if (!child)
|
|
19
|
-
return null;
|
|
20
|
-
const props = getIndicatorProps({ ...child.props, index });
|
|
21
|
-
return cloneElement(child, props);
|
|
22
|
-
});
|
|
23
15
|
const css = {
|
|
24
16
|
position: "absolute",
|
|
25
17
|
zIndex: "kurillin",
|
|
@@ -28,7 +20,19 @@ var CarouselIndicators = forwardRef(
|
|
|
28
20
|
...styles.indicators,
|
|
29
21
|
...orientation === "vertical" ? { flexDirection: "column" } : { flexDirection: "row" }
|
|
30
22
|
};
|
|
31
|
-
return /* @__PURE__ */ jsx(ui.div, { ref, className: cx("ui-carousel-indicators", className), __css: css, ...rest, children:
|
|
23
|
+
return /* @__PURE__ */ jsx(ui.div, { ref, className: cx("ui-carousel-indicators", className), __css: css, ...rest, children: indexes.map((index) => {
|
|
24
|
+
const isSelected = index === selectedIndex;
|
|
25
|
+
if (typeof component === "function") {
|
|
26
|
+
const child = component({ index, isSelected });
|
|
27
|
+
if (!child)
|
|
28
|
+
return null;
|
|
29
|
+
const props = getIndicatorProps({ ...child.props, index });
|
|
30
|
+
return cloneElement(child, props);
|
|
31
|
+
} else {
|
|
32
|
+
const { key, ...props } = getIndicatorProps({ index });
|
|
33
|
+
return /* @__PURE__ */ jsx(CarouselIndicator, { ...props }, key);
|
|
34
|
+
}
|
|
35
|
+
}) });
|
|
32
36
|
}
|
|
33
37
|
);
|
|
34
38
|
var CarouselIndicator = ({ className, ...rest }) => {
|
package/dist/index.js
CHANGED
|
@@ -483,17 +483,9 @@ var import_utils5 = require("@yamada-ui/utils");
|
|
|
483
483
|
var import_react3 = require("react");
|
|
484
484
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
485
485
|
var CarouselIndicators = (0, import_core5.forwardRef)(
|
|
486
|
-
({ className, component
|
|
486
|
+
({ className, component, ...rest }, ref) => {
|
|
487
487
|
const { selectedIndex, orientation, styles } = useCarouselContext();
|
|
488
488
|
const { indexes, getIndicatorProps } = useCarouselIndicators();
|
|
489
|
-
const cloneChildren = indexes.map((index) => {
|
|
490
|
-
const isSelected = index === selectedIndex;
|
|
491
|
-
const child = component({ index, isSelected });
|
|
492
|
-
if (!child)
|
|
493
|
-
return null;
|
|
494
|
-
const props = getIndicatorProps({ ...child.props, index });
|
|
495
|
-
return (0, import_react3.cloneElement)(child, props);
|
|
496
|
-
});
|
|
497
489
|
const css = {
|
|
498
490
|
position: "absolute",
|
|
499
491
|
zIndex: "kurillin",
|
|
@@ -502,7 +494,19 @@ var CarouselIndicators = (0, import_core5.forwardRef)(
|
|
|
502
494
|
...styles.indicators,
|
|
503
495
|
...orientation === "vertical" ? { flexDirection: "column" } : { flexDirection: "row" }
|
|
504
496
|
};
|
|
505
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core5.ui.div, { ref, className: (0, import_utils5.cx)("ui-carousel-indicators", className), __css: css, ...rest, children:
|
|
497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core5.ui.div, { ref, className: (0, import_utils5.cx)("ui-carousel-indicators", className), __css: css, ...rest, children: indexes.map((index) => {
|
|
498
|
+
const isSelected = index === selectedIndex;
|
|
499
|
+
if (typeof component === "function") {
|
|
500
|
+
const child = component({ index, isSelected });
|
|
501
|
+
if (!child)
|
|
502
|
+
return null;
|
|
503
|
+
const props = getIndicatorProps({ ...child.props, index });
|
|
504
|
+
return (0, import_react3.cloneElement)(child, props);
|
|
505
|
+
} else {
|
|
506
|
+
const { key, ...props } = getIndicatorProps({ index });
|
|
507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CarouselIndicator, { ...props }, key);
|
|
508
|
+
}
|
|
509
|
+
}) });
|
|
506
510
|
}
|
|
507
511
|
);
|
|
508
512
|
var CarouselIndicator = ({ className, ...rest }) => {
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Carousel
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ASYTKKOY.mjs";
|
|
4
4
|
import {
|
|
5
5
|
CarouselControlNext,
|
|
6
6
|
CarouselControlPrev
|
|
7
7
|
} from "./chunk-FDF2QUCY.mjs";
|
|
8
8
|
import {
|
|
9
9
|
CarouselIndicators
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YF54MDFK.mjs";
|
|
11
11
|
import {
|
|
12
12
|
CarouselSlide
|
|
13
13
|
} from "./chunk-BWFAE3UJ.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/carousel",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Yamada UI carousel component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yamada",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"embla-carousel-react": "^7.0.0",
|
|
39
|
-
"@yamada-ui/button": "0.1.
|
|
40
|
-
"@yamada-ui/core": "0.1.
|
|
41
|
-
"@yamada-ui/icon": "0.1.
|
|
42
|
-
"@yamada-ui/use-controllable-state": "0.1.
|
|
43
|
-
"@yamada-ui/use-token": "0.1.
|
|
44
|
-
"@yamada-ui/use-value": "0.1.
|
|
45
|
-
"@yamada-ui/utils": "0.1.
|
|
39
|
+
"@yamada-ui/button": "0.1.5",
|
|
40
|
+
"@yamada-ui/core": "0.1.5",
|
|
41
|
+
"@yamada-ui/icon": "0.1.5",
|
|
42
|
+
"@yamada-ui/use-controllable-state": "0.1.1",
|
|
43
|
+
"@yamada-ui/use-token": "0.1.5",
|
|
44
|
+
"@yamada-ui/use-value": "0.1.5",
|
|
45
|
+
"@yamada-ui/utils": "0.1.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"clean-package": "2.2.0",
|