trepur_components 0.3.1 → 0.3.4

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.
@@ -25,6 +25,8 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
25
25
 
26
26
  //https://keen-slider.io/docs#usage-in-react
27
27
  const CarouselV2 = _ref => {
28
+ var _instanceRef$current3, _instanceRef$current4, _instanceRef$current5, _instanceRef$current6, _instanceRef$current7, _instanceRef$current8, _instanceRef$current9, _instanceRef$current10;
29
+
28
30
  let {
29
31
  id,
30
32
  classes,
@@ -65,7 +67,7 @@ const CarouselV2 = _ref => {
65
67
  dots
66
68
  } = _ref;
67
69
  const classList = "".concat(classes);
68
- const dotClasses = "w-4 h-4 cursor-pointer focus:".concat(dots.activeColours, " rounded-full mx-1 ");
70
+ const dotClasses = "w-4 h-4 cursor-pointer focus:".concat(dots === null || dots === void 0 ? void 0 : dots.activeColours, " rounded-full mx-1 ");
69
71
  const [currentSlide, setCurrentSlide] = (0, _react.useState)(0);
70
72
  const [loaded, setLoaded] = (0, _react.useState)(false);
71
73
  const [sliderRef, instanceRef] = (0, _react2.useKeenSlider)({
@@ -121,7 +123,7 @@ const CarouselV2 = _ref => {
121
123
  }), /*#__PURE__*/_react.default.createElement("div", {
122
124
  ref: sliderRef,
123
125
  className: "keen-slider"
124
- }, slides && slides), arrows.visible && loaded && instanceRef.current && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(Arrow, {
126
+ }, 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
127
  left: true,
126
128
  onClick: e => {
127
129
  var _instanceRef$current;
@@ -136,35 +138,37 @@ const CarouselV2 = _ref => {
136
138
 
137
139
  return e.stopPropagation() || ((_instanceRef$current2 = instanceRef.current) === null || _instanceRef$current2 === void 0 ? void 0 : _instanceRef$current2.next());
138
140
  },
139
- disabled: currentSlide === instanceRef.current.track.details.slides.length - 1,
141
+ disabled: currentSlide === (instanceRef === null || instanceRef === void 0 ? void 0 : (_instanceRef$current3 = instanceRef.current) === null || _instanceRef$current3 === void 0 ? void 0 : (_instanceRef$current4 = _instanceRef$current3.track) === null || _instanceRef$current4 === void 0 ? void 0 : (_instanceRef$current5 = _instanceRef$current4.details) === null || _instanceRef$current5 === void 0 ? void 0 : (_instanceRef$current6 = _instanceRef$current5.slides) === null || _instanceRef$current6 === void 0 ? void 0 : _instanceRef$current6.length) - 1,
140
142
  arrows: arrows
141
- }))), dots.visible && loaded && instanceRef.current && /*#__PURE__*/_react.default.createElement("div", {
143
+ }))), (dots === null || dots === void 0 ? void 0 : dots.visible) && loaded && instanceRef.current && /*#__PURE__*/_react.default.createElement("div", {
142
144
  className: "flex py-4 justify-center"
143
- }, [...Array(instanceRef.current.track.details.slides.length).keys()].map(idx => {
145
+ }, [...Array(instanceRef === null || instanceRef === void 0 ? void 0 : (_instanceRef$current7 = instanceRef.current) === null || _instanceRef$current7 === void 0 ? void 0 : (_instanceRef$current8 = _instanceRef$current7.track) === null || _instanceRef$current8 === void 0 ? void 0 : (_instanceRef$current9 = _instanceRef$current8.details) === null || _instanceRef$current9 === void 0 ? void 0 : (_instanceRef$current10 = _instanceRef$current9.slides) === null || _instanceRef$current10 === void 0 ? void 0 : _instanceRef$current10.length).keys()].map(idx => {
144
146
  return /*#__PURE__*/_react.default.createElement("button", {
145
147
  key: idx,
146
148
  onClick: () => {
147
- var _instanceRef$current3;
149
+ var _instanceRef$current11;
148
150
 
149
- (_instanceRef$current3 = instanceRef.current) === null || _instanceRef$current3 === void 0 ? void 0 : _instanceRef$current3.moveToIdx(idx);
151
+ (_instanceRef$current11 = instanceRef.current) === null || _instanceRef$current11 === void 0 ? void 0 : _instanceRef$current11.moveToIdx(idx);
150
152
  },
151
- className: dotClasses + (currentSlide === idx ? " active ".concat(dots.activeColours) : " ".concat(dots.colours))
153
+ 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
154
  });
153
155
  })));
154
156
  };
155
157
 
156
158
  function Arrow(props) {
157
- const disabeld = props.disabled ? " arrow--disabled ".concat(props.arrows.disabledColours) : "";
159
+ var _props$arrows, _props$arrows2, _props$arrows3;
160
+
161
+ 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
162
  return /*#__PURE__*/_react.default.createElement("svg", {
159
- onClick: props.onClick,
163
+ onClick: props === null || props === void 0 ? void 0 : props.onClick,
160
164
  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
165
  xmlns: "http://www.w3.org/2000/svg",
162
166
  viewBox: "0 0 24 24"
163
- }, props.left && /*#__PURE__*/_react.default.createElement("path", {
164
- className: "".concat(props.arrows.colours),
167
+ }, (props === null || props === void 0 ? void 0 : props.left) && /*#__PURE__*/_react.default.createElement("path", {
168
+ className: "".concat(props === null || props === void 0 ? void 0 : (_props$arrows2 = props.arrows) === null || _props$arrows2 === void 0 ? void 0 : _props$arrows2.colours),
165
169
  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),
170
+ }), !(props !== null && props !== void 0 && props.left) && /*#__PURE__*/_react.default.createElement("path", {
171
+ className: "".concat(props === null || props === void 0 ? void 0 : (_props$arrows3 = props.arrows) === null || _props$arrows3 === void 0 ? void 0 : _props$arrows3.colours),
168
172
  d: "M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"
169
173
  }));
170
174
  }
@@ -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 = '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 ' + classes;
33
- let roundedClass = rounded ? 'rounded-full' : '';
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), ctaText && /*#__PURE__*/_react.default.createElement(_Button.default, {
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: ctaText
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 = classes + ' grid md:grid-cols-4 sm:grid-cols-2';
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 += imageClassList;
50
+ imageProps.classes = (imageProps === null || imageProps === void 0 ? void 0 : imageProps.classes) + ' ' + imageClassList;
51
51
  return /*#__PURE__*/_react.default.createElement("div", _extends({}, id && {
52
52
  id: id
53
53
  }, {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "trepur_components",
3
3
  "description": "component lib",
4
4
  "author": "trepur_ttenneb",
5
- "version": "0.3.1",
5
+ "version": "0.3.4",
6
6
  "private": false,
7
7
  "keywords": [
8
8
  "react",