infinity-forge 8.3.8 → 8.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.
- package/dist/ui/components/carousel/index.d.ts +2 -4
- package/dist/ui/components/carousel/index.js +7 -7
- package/dist/ui/components/carousel/index.js.map +1 -1
- package/dist/ui/components/carousel/interfaces.d.ts +6 -1
- package/dist/ui/components/spacing/styles.js +2 -2
- package/dist/ui/components/spacing/styles.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CarouselProps } from './interfaces.js';
|
|
1
|
+
import { ActionsCarousel, CarouselProps } from './interfaces.js';
|
|
2
2
|
export declare function useCarousel<T = any>({ id, items, Component, config }: CarouselProps<T>): {
|
|
3
3
|
Carousel: () => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
Prev: ({ children }: {
|
|
@@ -7,7 +7,5 @@ export declare function useCarousel<T = any>({ id, items, Component, config }: C
|
|
|
7
7
|
Next: ({ children }: {
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
actions:
|
|
11
|
-
slideTo: (index: number) => void;
|
|
12
|
-
};
|
|
10
|
+
actions: ActionsCarousel;
|
|
13
11
|
};
|
|
@@ -46,12 +46,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
46
46
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
47
|
exports.useCarousel = useCarousel;
|
|
48
48
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
49
|
+
var react_1 = require("react");
|
|
49
50
|
var ui_1 = require("../../../ui/index.js");
|
|
50
51
|
var swiper_1 = require("./carousel-lib/react/swiper.js");
|
|
51
52
|
var swiper_slide_1 = require("./carousel-lib/react/swiper-slide.js");
|
|
52
53
|
var index_1 = require("./carousel-lib/modules/index.js");
|
|
53
54
|
var S = __importStar(require("./styles.js"));
|
|
54
|
-
var react_1 = require("react");
|
|
55
55
|
function useCarousel(_a) {
|
|
56
56
|
var id = _a.id, items = _a.items, Component = _a.Component, config = _a.config;
|
|
57
57
|
var nextUID = 'next' + id;
|
|
@@ -67,12 +67,6 @@ function useCarousel(_a) {
|
|
|
67
67
|
var children = _a.children;
|
|
68
68
|
return ((0, jsx_runtime_1.jsx)("button", { type: 'button', className: nextUID, children: children }));
|
|
69
69
|
}
|
|
70
|
-
function Carousel() {
|
|
71
|
-
return ((0, jsx_runtime_1.jsx)(S.Carousel, { children: (0, jsx_runtime_1.jsx)(SwiperLib, __assign({}, config, { ref: swiperRef, modules: [index_1.Pagination, index_1.Autoplay, index_1.Navigation, index_1.Virtual, index_1.EffectFade, index_1.Grid], navigation: {
|
|
72
|
-
nextEl: '.' + nextUID,
|
|
73
|
-
prevEl: '.' + prevUID,
|
|
74
|
-
}, children: items.map(function (item) { return ((0, jsx_runtime_1.jsx)(SwiperSlideLib, { children: (0, jsx_runtime_1.jsx)(Component, __assign({}, item)) }, item.id || (0, ui_1.uid)(11, true))); }) })) }));
|
|
75
|
-
}
|
|
76
70
|
var actions = {
|
|
77
71
|
slideTo: function (index) {
|
|
78
72
|
if (swiperRef.current) {
|
|
@@ -80,6 +74,12 @@ function useCarousel(_a) {
|
|
|
80
74
|
}
|
|
81
75
|
},
|
|
82
76
|
};
|
|
77
|
+
function Carousel() {
|
|
78
|
+
return ((0, jsx_runtime_1.jsx)(S.Carousel, { children: (0, jsx_runtime_1.jsx)(SwiperLib, __assign({}, config, { ref: swiperRef, modules: [index_1.Pagination, index_1.Autoplay, index_1.Navigation, index_1.Virtual, index_1.EffectFade, index_1.Grid], navigation: {
|
|
79
|
+
nextEl: '.' + nextUID,
|
|
80
|
+
prevEl: '.' + prevUID,
|
|
81
|
+
}, children: items.map(function (item, index) { return ((0, jsx_runtime_1.jsx)(SwiperSlideLib, { children: (0, jsx_runtime_1.jsx)(Component, __assign({}, item, actions, { index: index })) }, item.id || (0, ui_1.uid)(11, true))); }) })) }));
|
|
82
|
+
}
|
|
83
83
|
return {
|
|
84
84
|
Carousel: Carousel,
|
|
85
85
|
Prev: Prev,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/components/carousel/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/components/carousel/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,kCA6DC;;AA1ED,+BAA8B;AAE9B,2BAA0B;AAE1B,sDAAoD;AACpD,kEAA+D;AAE/D,sDAA0G;AAI1G,0CAA6B;AAE7B,SAAgB,WAAW,CAAU,EAAkD;QAAhD,EAAE,QAAA,EAAE,KAAK,WAAA,EAAE,SAAS,eAAA,EAAE,MAAM,YAAA;IACjE,IAAM,OAAO,GAAG,MAAM,GAAG,EAAE,CAAA;IAC3B,IAAM,OAAO,GAAG,MAAM,GAAG,EAAE,CAAA;IAE3B,IAAM,SAAS,GAAG,eAAa,CAAA;IAC/B,IAAM,cAAc,GAAG,0BAAkB,CAAA;IAEzC,IAAM,SAAS,GAAG,IAAA,cAAM,EAAM,IAAI,CAAC,CAAA;IAEnC,SAAS,IAAI,CAAC,EAA2C;YAAzC,QAAQ,cAAA;QACtB,OAAO,CACL,mCAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,OAAO,YACrC,QAAQ,GACF,CACV,CAAA;IACH,CAAC;IAED,SAAS,IAAI,CAAC,EAA2C;YAAzC,QAAQ,cAAA;QACtB,OAAO,CACL,mCAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,OAAO,YACrC,QAAQ,GACF,CACV,CAAA;IACH,CAAC;IAED,IAAM,OAAO,GAAoB;QAC/B,OAAO,EAAE,UAAC,KAAa;YACrB,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;gBACtB,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;YACzC,CAAC;QACH,CAAC;KACF,CAAA;IAED,SAAS,QAAQ;QACf,OAAO,CACL,uBAAC,CAAC,CAAC,QAAQ,cACT,uBAAC,SAAS,eACJ,MAAM,IACV,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,CAAC,kBAAU,EAAE,gBAAQ,EAAE,kBAAU,EAAE,eAAO,EAAE,kBAAU,EAAE,YAAI,CAAC,EACtE,UAAU,EAAE;oBACV,MAAM,EAAE,GAAG,GAAG,OAAO;oBACrB,MAAM,EAAE,GAAG,GAAG,OAAO;iBACtB,YAEA,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,KAAK,IAAK,OAAA,CAC1B,uBAAC,cAAc,cACb,uBAAC,SAAS,eAAK,IAAI,EAAM,OAAO,IAAE,KAAK,EAAE,KAAK,IAAI,IAD9B,IAAY,CAAC,EAAE,IAAI,IAAA,QAAG,EAAC,EAAE,EAAE,IAAI,CAAC,CAErC,CAClB,EAJ2B,CAI3B,CAAC,IACQ,GACD,CACd,CAAA;IACH,CAAC;IAED,OAAO;QACL,QAAQ,UAAA;QACR,IAAI,MAAA;QACJ,IAAI,MAAA;QACJ,OAAO,SAAA;KACR,CAAA;AACH,CAAC"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { SwiperOptions } from "./carousel-lib/types/index.js";
|
|
2
|
+
export type ActionsCarousel = {
|
|
3
|
+
slideTo: (index: number) => void;
|
|
4
|
+
};
|
|
2
5
|
export interface CarouselProps<T = any> {
|
|
3
6
|
id: string;
|
|
4
7
|
items: T[];
|
|
5
8
|
config?: SwiperOptions;
|
|
6
|
-
Component: React.ComponentType<T
|
|
9
|
+
Component: React.ComponentType<T & ActionsCarousel & {
|
|
10
|
+
index: number;
|
|
11
|
+
}>;
|
|
7
12
|
}
|
|
@@ -39,12 +39,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.Spacing = void 0;
|
|
41
41
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
42
|
-
exports.Spacing = (0, styled_components_1.default)('section')(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: ", ";\n\n &.spacing + .spacing {\n
|
|
42
|
+
exports.Spacing = (0, styled_components_1.default)('section')(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: ", ";\n\n &.spacing + .spacing {\n padding-top: 0;\n }\n\n ", "\n"], ["\n padding: ", ";\n\n &.spacing + .spacing {\n padding-top: 0;\n }\n\n ", "\n"])), function (_a) {
|
|
43
43
|
var $padding = _a.$padding, $paddingBottom = _a.$paddingBottom;
|
|
44
44
|
return "".concat(Math.max(20, $padding), "px 0 ").concat($paddingBottom === 0 ? 0 : Math.max(20, $paddingBottom || $padding), "px");
|
|
45
45
|
}, function (_a) {
|
|
46
46
|
var $breakPoints = _a.$breakPoints, $padding = _a.$padding, $paddingBottom = _a.$paddingBottom, $interval = _a.$interval;
|
|
47
|
-
return $breakPoints === null || $breakPoints === void 0 ? void 0 : $breakPoints.map(function (breakPoint, index) { return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n @media only screen and (max-width: ", "px) {\n padding: ", "px 0\n ", "px;\n\n
|
|
47
|
+
return $breakPoints === null || $breakPoints === void 0 ? void 0 : $breakPoints.map(function (breakPoint, index) { return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n @media only screen and (max-width: ", "px) {\n padding: ", "px 0\n ", "px;\n\n &.spacing + .spacing {\n padding-top: 0;\n }\n }\n "], ["\n @media only screen and (max-width: ", "px) {\n padding: ", "px 0\n ", "px;\n\n &.spacing + .spacing {\n padding-top: 0;\n }\n }\n "])), breakPoint, Math.max(20, $padding - $interval * (index + 1)), $paddingBottom === 0 ? 0 : Math.max(20, ($paddingBottom || $padding) - $interval * (index + 1))); });
|
|
48
48
|
});
|
|
49
49
|
var templateObject_1, templateObject_2;
|
|
50
50
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/ui/components/spacing/styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qEAA+C;AAGlC,QAAA,OAAO,GAAG,IAAA,2BAAM,EAAC,SAAS,CAAC
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../src/ui/components/spacing/styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qEAA+C;AAGlC,QAAA,OAAO,GAAG,IAAA,2BAAM,EAAC,SAAS,CAAC,yJAKtC,eACW,EAC+F,+DAMxG,EAYC,IACJ,KApBY,UAAC,EAA4B;QAA1B,QAAQ,cAAA,EAAE,cAAc,oBAAA;IACpC,OAAA,UAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,kBAAQ,cAAc,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,cAAc,IAAI,QAAQ,CAAC,OAAI;AAAxG,CAAwG,EAMxG,UAAC,EAAqD;QAAnD,YAAY,kBAAA,EAAE,QAAQ,cAAA,EAAE,cAAc,oBAAA,EAAE,SAAS,eAAA;IACpD,OAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,GAAG,CACf,UAAC,UAAU,EAAE,KAAK,IAAK,WAAA,uBAAG,+QAAA,+CACa,EAAU,4BAClC,EAAgD,oBACvD,EAA+F,sGAMtG,KARsC,UAAU,EAClC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,GAAG,SAAS,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EACvD,cAAc,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,cAAc,IAAI,QAAQ,CAAC,GAAG,SAAS,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,GAHhF,CAStB,CACF;AAXD,CAWC,EACJ"}
|