trepur_components 0.3.15 → 0.3.18
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.
|
@@ -17,6 +17,10 @@ var _react2 = require("keen-slider/react");
|
|
|
17
17
|
|
|
18
18
|
require("./index.css");
|
|
19
19
|
|
|
20
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
20
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
25
|
|
|
22
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -156,19 +160,23 @@ const CarouselV2 = _ref => {
|
|
|
156
160
|
};
|
|
157
161
|
|
|
158
162
|
function Arrow(props) {
|
|
159
|
-
var _props$arrows, _props$arrows2, _props$arrows3;
|
|
160
|
-
|
|
161
|
-
const
|
|
163
|
+
var _props$arrows, _props$arrows2, _props$arrows3, _props$arrows4;
|
|
164
|
+
|
|
165
|
+
const arrowClasses = (0, _classnames.default)({
|
|
166
|
+
'arrow--left left-1.5': props.left,
|
|
167
|
+
'arrow--right left-auto right-1.5': !props.left,
|
|
168
|
+
[props === null || props === void 0 ? void 0 : (_props$arrows = props.arrows) === null || _props$arrows === void 0 ? void 0 : _props$arrows.colours]: (props === null || props === void 0 ? void 0 : (_props$arrows2 = props.arrows) === null || _props$arrows2 === void 0 ? void 0 : _props$arrows2.colours) && !props.disabled,
|
|
169
|
+
[props === null || props === void 0 ? void 0 : (_props$arrows3 = props.arrows) === null || _props$arrows3 === void 0 ? void 0 : _props$arrows3.disabledColours]: (props === null || props === void 0 ? void 0 : (_props$arrows4 = props.arrows) === null || _props$arrows4 === void 0 ? void 0 : _props$arrows4.disabledColours) && props.disabled,
|
|
170
|
+
'arrow--disabled': props.disabled
|
|
171
|
+
}, 'arrow w-12 translate-y-2/4 h-12 absolute cursor-pointer top-1/2');
|
|
162
172
|
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
163
173
|
onClick: props === null || props === void 0 ? void 0 : props.onClick,
|
|
164
|
-
className: "
|
|
174
|
+
className: "".concat(arrowClasses),
|
|
165
175
|
xmlns: "http://www.w3.org/2000/svg",
|
|
166
176
|
viewBox: "0 0 24 24"
|
|
167
177
|
}, (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),
|
|
169
178
|
d: "M16.67 0l2.83 2.829-9.339 9.175 9.339 9.167-2.83 2.829-12.17-11.996z"
|
|
170
179
|
}), !(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),
|
|
172
180
|
d: "M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z"
|
|
173
181
|
}));
|
|
174
182
|
}
|
|
@@ -61,15 +61,17 @@ const textAndTitleProps = {
|
|
|
61
61
|
withLiveUpdates: _propTypes.default.bool,
|
|
62
62
|
onSave: _propTypes.default.func,
|
|
63
63
|
saveButtonProps: _propTypes.default.object,
|
|
64
|
-
cancelButtonProps: _propTypes.default.object
|
|
64
|
+
cancelButtonProps: _propTypes.default.object,
|
|
65
|
+
isHorizontal: _propTypes.default.bool
|
|
65
66
|
};
|
|
66
67
|
exports.textAndTitleProps = textAndTitleProps;
|
|
67
68
|
|
|
68
69
|
const TextAndTitle = _ref => {
|
|
69
|
-
var _textAndTitleProps$sa, _textAndTitleProps$sa2, _textAndTitleProps$sa3, _textAndTitleProps$sa4, _textAndTitleProps$sa5, _textAndTitleProps$sa6, _textAndTitleProps$ca, _textAndTitleProps$ca2, _textAndTitleProps$ca3, _textAndTitleProps$ca4, _textAndTitleProps$ca5, _textAndTitleProps$ca6;
|
|
70
|
+
var _textAndTitleProps$sa, _textAndTitleProps$sa2, _textAndTitleProps$sa3, _textAndTitleProps$sa4, _textAndTitleProps$sa5, _textAndTitleProps$sa6, _textAndTitleProps$sa7, _textAndTitleProps$sa8, _textAndTitleProps$ca, _textAndTitleProps$ca2, _textAndTitleProps$ca3, _textAndTitleProps$ca4, _textAndTitleProps$ca5, _textAndTitleProps$ca6, _textAndTitleProps$ca7, _textAndTitleProps$ca8;
|
|
70
71
|
|
|
71
72
|
let {
|
|
72
|
-
textAndTitleProps
|
|
73
|
+
textAndTitleProps,
|
|
74
|
+
children
|
|
73
75
|
} = _ref;
|
|
74
76
|
const defaultComponentData = {
|
|
75
77
|
title: {
|
|
@@ -158,6 +160,15 @@ const TextAndTitle = _ref => {
|
|
|
158
160
|
(textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.withLiveUpdates) && setIsHovering(!isHovering);
|
|
159
161
|
};
|
|
160
162
|
|
|
163
|
+
const wrapperClassList = (0, _classnames.default)({
|
|
164
|
+
'flex flex-wrap md:items-center': textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.isHorizontal
|
|
165
|
+
});
|
|
166
|
+
const titleWrapperClassList = (0, _classnames.default)({
|
|
167
|
+
'md:w-1/2 md:text-center': textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.isHorizontal
|
|
168
|
+
});
|
|
169
|
+
const textWrapperClassList = (0, _classnames.default)({
|
|
170
|
+
'md:w-1/2 md:text-center md:py-8 md:pr-8': textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.isHorizontal
|
|
171
|
+
});
|
|
161
172
|
return /*#__PURE__*/_react.default.createElement("div", _extends({}, (textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.id) && {
|
|
162
173
|
id: textAndTitleProps.id
|
|
163
174
|
}, {
|
|
@@ -203,39 +214,44 @@ const TextAndTitle = _ref => {
|
|
|
203
214
|
}
|
|
204
215
|
}), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
205
216
|
buttonProps: {
|
|
206
|
-
classes: textAndTitleProps.saveButtonProps.classes,
|
|
207
|
-
text: textAndTitleProps.saveButtonProps.text,
|
|
217
|
+
classes: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa === void 0 ? void 0 : _textAndTitleProps$sa.classes,
|
|
218
|
+
text: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa2 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa2 === void 0 ? void 0 : _textAndTitleProps$sa2.text,
|
|
208
219
|
onClick: handleButtonSave,
|
|
209
|
-
bgColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$
|
|
210
|
-
borderColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$
|
|
211
|
-
textColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$
|
|
212
|
-
hoverTextColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$
|
|
213
|
-
hoverBorderColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$
|
|
214
|
-
hoverBgColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$
|
|
220
|
+
bgColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa3 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa3 === void 0 ? void 0 : _textAndTitleProps$sa3.bgColor,
|
|
221
|
+
borderColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa4 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa4 === void 0 ? void 0 : _textAndTitleProps$sa4.borderColor,
|
|
222
|
+
textColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa5 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa5 === void 0 ? void 0 : _textAndTitleProps$sa5.textColor,
|
|
223
|
+
hoverTextColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa6 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa6 === void 0 ? void 0 : _textAndTitleProps$sa6.hoverTextColor,
|
|
224
|
+
hoverBorderColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa7 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa7 === void 0 ? void 0 : _textAndTitleProps$sa7.hoverBorderColor,
|
|
225
|
+
hoverBgColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa8 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa8 === void 0 ? void 0 : _textAndTitleProps$sa8.hoverBgColor
|
|
215
226
|
}
|
|
216
227
|
}), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
217
228
|
buttonProps: {
|
|
218
|
-
classes: textAndTitleProps.cancelButtonProps.classes,
|
|
219
|
-
text: textAndTitleProps.cancelButtonProps.text,
|
|
229
|
+
classes: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca === void 0 ? void 0 : _textAndTitleProps$ca.classes,
|
|
230
|
+
text: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca2 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca2 === void 0 ? void 0 : _textAndTitleProps$ca2.text,
|
|
220
231
|
onClick: handleButtonCancel,
|
|
221
|
-
bgColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$
|
|
222
|
-
borderColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$
|
|
223
|
-
textColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$
|
|
224
|
-
hoverTextColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$
|
|
225
|
-
hoverBorderColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$
|
|
226
|
-
hoverBgColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$
|
|
232
|
+
bgColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca3 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca3 === void 0 ? void 0 : _textAndTitleProps$ca3.bgColor,
|
|
233
|
+
borderColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca4 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca4 === void 0 ? void 0 : _textAndTitleProps$ca4.borderColor,
|
|
234
|
+
textColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca5 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca5 === void 0 ? void 0 : _textAndTitleProps$ca5.textColor,
|
|
235
|
+
hoverTextColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca6 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca6 === void 0 ? void 0 : _textAndTitleProps$ca6.hoverTextColor,
|
|
236
|
+
hoverBorderColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca7 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca7 === void 0 ? void 0 : _textAndTitleProps$ca7.hoverBorderColor,
|
|
237
|
+
hoverBgColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca8 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca8 === void 0 ? void 0 : _textAndTitleProps$ca8.hoverBgColor
|
|
227
238
|
}
|
|
228
239
|
})) : /*#__PURE__*/_react.default.createElement("div", {
|
|
240
|
+
className: wrapperClassList,
|
|
229
241
|
onClick: toggleEditState
|
|
230
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
242
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
243
|
+
className: titleWrapperClassList
|
|
244
|
+
}, componentData.title.text ? /*#__PURE__*/_react.default.createElement("h1", {
|
|
231
245
|
className: titleClassList
|
|
232
|
-
}, componentData.title.text), /*#__PURE__*/_react.default.createElement("
|
|
246
|
+
}, componentData.title.text) : /*#__PURE__*/_react.default.createElement("div", null, children)), /*#__PURE__*/_react.default.createElement("div", {
|
|
247
|
+
className: textWrapperClassList
|
|
248
|
+
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
233
249
|
className: textClassList
|
|
234
250
|
}, componentData.textLineOne.text), /*#__PURE__*/_react.default.createElement("p", {
|
|
235
251
|
className: textClassList
|
|
236
252
|
}, componentData.textLineTwo.text), /*#__PURE__*/_react.default.createElement("p", {
|
|
237
253
|
className: textClassList
|
|
238
|
-
}, componentData.textLineThree.text)));
|
|
254
|
+
}, componentData.textLineThree.text))));
|
|
239
255
|
};
|
|
240
256
|
|
|
241
257
|
TextAndTitle.propTypes = {
|