trepur_components 0.3.1 → 0.3.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.
|
@@ -65,7 +65,7 @@ const CarouselV2 = _ref => {
|
|
|
65
65
|
dots
|
|
66
66
|
} = _ref;
|
|
67
67
|
const classList = "".concat(classes);
|
|
68
|
-
const dotClasses = "w-4 h-4 cursor-pointer focus:".concat(dots.activeColours, " rounded-full mx-1 ");
|
|
68
|
+
const dotClasses = "w-4 h-4 cursor-pointer focus:".concat(dots === null || dots === void 0 ? void 0 : dots.activeColours, " rounded-full mx-1 ");
|
|
69
69
|
const [currentSlide, setCurrentSlide] = (0, _react.useState)(0);
|
|
70
70
|
const [loaded, setLoaded] = (0, _react.useState)(false);
|
|
71
71
|
const [sliderRef, instanceRef] = (0, _react2.useKeenSlider)({
|
|
@@ -121,7 +121,7 @@ const CarouselV2 = _ref => {
|
|
|
121
121
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
122
122
|
ref: sliderRef,
|
|
123
123
|
className: "keen-slider"
|
|
124
|
-
}, slides && slides), arrows.visible && loaded && instanceRef.current && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Arrow, {
|
|
124
|
+
}, slides && slides), (arrows === null || arrows === void 0 ? void 0 : arrows.visible) && loaded && instanceRef.current && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Arrow, {
|
|
125
125
|
left: true,
|
|
126
126
|
onClick: e => {
|
|
127
127
|
var _instanceRef$current;
|
|
@@ -138,7 +138,7 @@ const CarouselV2 = _ref => {
|
|
|
138
138
|
},
|
|
139
139
|
disabled: currentSlide === instanceRef.current.track.details.slides.length - 1,
|
|
140
140
|
arrows: arrows
|
|
141
|
-
}))), dots.visible && loaded && instanceRef.current && /*#__PURE__*/_react.default.createElement("div", {
|
|
141
|
+
}))), (dots === null || dots === void 0 ? void 0 : dots.visible) && loaded && instanceRef.current && /*#__PURE__*/_react.default.createElement("div", {
|
|
142
142
|
className: "flex py-4 justify-center"
|
|
143
143
|
}, [...Array(instanceRef.current.track.details.slides.length).keys()].map(idx => {
|
|
144
144
|
return /*#__PURE__*/_react.default.createElement("button", {
|
|
@@ -148,23 +148,25 @@ const CarouselV2 = _ref => {
|
|
|
148
148
|
|
|
149
149
|
(_instanceRef$current3 = instanceRef.current) === null || _instanceRef$current3 === void 0 ? void 0 : _instanceRef$current3.moveToIdx(idx);
|
|
150
150
|
},
|
|
151
|
-
className: dotClasses + (currentSlide === idx ? " active ".concat(dots.activeColours) : " ".concat(dots.colours))
|
|
151
|
+
className: dotClasses + (currentSlide === idx ? " active ".concat(dots === null || dots === void 0 ? void 0 : dots.activeColours) : " ".concat(dots === null || dots === void 0 ? void 0 : dots.colours))
|
|
152
152
|
});
|
|
153
153
|
})));
|
|
154
154
|
};
|
|
155
155
|
|
|
156
156
|
function Arrow(props) {
|
|
157
|
-
|
|
157
|
+
var _props$arrows, _props$arrows2, _props$arrows3;
|
|
158
|
+
|
|
159
|
+
const disabeld = props.disabled ? " arrow--disabled ".concat(props === null || props === void 0 ? void 0 : (_props$arrows = props.arrows) === null || _props$arrows === void 0 ? void 0 : _props$arrows.disabledColours) : "";
|
|
158
160
|
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
159
|
-
onClick: props.onClick,
|
|
161
|
+
onClick: props === null || props === void 0 ? void 0 : props.onClick,
|
|
160
162
|
className: "arrow w-12 translate-y-2/4 h-12 absolute cursor-pointer top-1/2 ".concat(props.left ? "arrow--left left-1.5" : "arrow--right left-auto right-1.5", " ").concat(disabeld),
|
|
161
163
|
xmlns: "http://www.w3.org/2000/svg",
|
|
162
164
|
viewBox: "0 0 24 24"
|
|
163
|
-
}, props.left && /*#__PURE__*/_react.default.createElement("path", {
|
|
164
|
-
className: "".concat(props.arrows.colours),
|
|
165
|
+
}, (props === null || props === void 0 ? void 0 : props.left) && /*#__PURE__*/_react.default.createElement("path", {
|
|
166
|
+
className: "".concat(props === null || props === void 0 ? void 0 : (_props$arrows2 = props.arrows) === null || _props$arrows2 === void 0 ? void 0 : _props$arrows2.colours),
|
|
165
167
|
d: "M16.67 0l2.83 2.829-9.339 9.175 9.339 9.167-2.83 2.829-12.17-11.996z"
|
|
166
|
-
}), !props.left && /*#__PURE__*/_react.default.createElement("path", {
|
|
167
|
-
className: "".concat(props.arrows.colours),
|
|
168
|
+
}), !(props !== null && props !== void 0 && props.left) && /*#__PURE__*/_react.default.createElement("path", {
|
|
169
|
+
className: "".concat(props === null || props === void 0 ? void 0 : (_props$arrows3 = props.arrows) === null || _props$arrows3 === void 0 ? void 0 : _props$arrows3.colours),
|
|
168
170
|
d: "M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"
|
|
169
171
|
}));
|
|
170
172
|
}
|
|
@@ -11,6 +11,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _Button = _interopRequireDefault(require("../Button"));
|
|
13
13
|
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
14
16
|
require("../index.css");
|
|
15
17
|
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -24,13 +26,17 @@ const ImageLink = _ref => {
|
|
|
24
26
|
image,
|
|
25
27
|
altText,
|
|
26
28
|
title,
|
|
27
|
-
ctaText,
|
|
28
29
|
link,
|
|
29
30
|
rounded,
|
|
30
|
-
openInNewTab
|
|
31
|
+
openInNewTab,
|
|
32
|
+
buttonProps
|
|
31
33
|
} = _ref;
|
|
32
|
-
const classList =
|
|
33
|
-
|
|
34
|
+
const classList = (0, _classnames.default)({
|
|
35
|
+
[classes]: classes
|
|
36
|
+
}, 'cursor-pointer lg:mx-3 md:mx-1 mx-1 lg:mb-5 md:mb-2 mb-2 hover:opacity-50 overflow-hidden text-center');
|
|
37
|
+
const roundedClass = (0, _classnames.default)({
|
|
38
|
+
'rounded-full': rounded
|
|
39
|
+
});
|
|
34
40
|
return /*#__PURE__*/_react.default.createElement("a", _extends({}, id && {
|
|
35
41
|
id: id
|
|
36
42
|
}, {
|
|
@@ -45,10 +51,10 @@ const ImageLink = _ref => {
|
|
|
45
51
|
className: "object-cover w-full h-full"
|
|
46
52
|
}), title && /*#__PURE__*/_react.default.createElement("h1", {
|
|
47
53
|
className: "absolute bg-black text-white py-2 mt-4 top-0 inset-x-0 text-center"
|
|
48
|
-
}, title),
|
|
54
|
+
}, title), (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.text) && /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
49
55
|
buttonProps: {
|
|
50
56
|
classes: 'absolute mx-8 mb-4 bottom-0 inset-x-0 text-center',
|
|
51
|
-
text:
|
|
57
|
+
text: buttonProps.text
|
|
52
58
|
}
|
|
53
59
|
})));
|
|
54
60
|
};
|
|
@@ -11,6 +11,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _index = _interopRequireDefault(require("../ImageLink/index"));
|
|
13
13
|
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
14
16
|
require("../index.css");
|
|
15
17
|
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -23,7 +25,9 @@ const ImageLinkList = _ref => {
|
|
|
23
25
|
classes,
|
|
24
26
|
items
|
|
25
27
|
} = _ref;
|
|
26
|
-
const classList =
|
|
28
|
+
const classList = (0, _classnames.default)({
|
|
29
|
+
[classes]: classes
|
|
30
|
+
}, 'grid md:grid-cols-4 sm:grid-cols-2');
|
|
27
31
|
return /*#__PURE__*/_react.default.createElement("div", _extends({}, id && {
|
|
28
32
|
id: id
|
|
29
33
|
}, {
|
|
@@ -47,7 +47,7 @@ const Testimonial = _ref => {
|
|
|
47
47
|
const imageClassList = (0, _classnames.default)({
|
|
48
48
|
[imageClasses]: imageClasses
|
|
49
49
|
}, 'mx-auto rounded-full w-32 h-32');
|
|
50
|
-
imageProps.classes
|
|
50
|
+
imageProps.classes = imageProps.classes + ' ' + imageClassList;
|
|
51
51
|
return /*#__PURE__*/_react.default.createElement("div", _extends({}, id && {
|
|
52
52
|
id: id
|
|
53
53
|
}, {
|