trepur_components 0.3.16 → 0.3.19
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/components/Button/index.js +13 -73
- package/dist/components/Card/index.js +5 -3
- package/dist/components/FyreCard/index.js +1 -1
- package/dist/components/NewsCard/index.js +1 -1
- package/dist/components/SocialBlock/index.js +7 -86
- package/dist/components/TextAndTitle/index.js +37 -21
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/
|
|
3
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.buttonProps = void 0;
|
|
9
9
|
|
|
10
|
-
require("core-js/modules/
|
|
10
|
+
require("core-js/modules/es.object.assign.js");
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
@@ -36,7 +36,6 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
36
36
|
const buttonProps = {
|
|
37
37
|
id: _propTypes.default.string,
|
|
38
38
|
classes: _propTypes.default.string,
|
|
39
|
-
text: _propTypes.default.string,
|
|
40
39
|
onClick: _propTypes.default.func,
|
|
41
40
|
bgColor: _propTypes.default.string,
|
|
42
41
|
textColor: _propTypes.default.string,
|
|
@@ -52,6 +51,7 @@ const buttonProps = {
|
|
|
52
51
|
rounded: _propTypes.default.bool,
|
|
53
52
|
disabled: _propTypes.default.bool,
|
|
54
53
|
isLoading: _propTypes.default.bool,
|
|
54
|
+
target: _propTypes.default.string,
|
|
55
55
|
leftIcon: _propTypes.default.shape(_Icon.iconProps),
|
|
56
56
|
rightIcon: _propTypes.default.shape(_Icon.iconProps),
|
|
57
57
|
centerIcon: _propTypes.default.shape(_Icon.iconProps)
|
|
@@ -60,9 +60,9 @@ exports.buttonProps = buttonProps;
|
|
|
60
60
|
|
|
61
61
|
const Button = _ref => {
|
|
62
62
|
let {
|
|
63
|
-
buttonProps
|
|
63
|
+
buttonProps,
|
|
64
|
+
children
|
|
64
65
|
} = _ref;
|
|
65
|
-
const [hovering, setHovering] = (0, _react.useState)(false);
|
|
66
66
|
if (buttonProps == undefined) return;
|
|
67
67
|
const design = (0, _classnames.default)({
|
|
68
68
|
[buttonProps.design]: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.design,
|
|
@@ -104,28 +104,6 @@ const Button = _ref => {
|
|
|
104
104
|
'invisible': buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.isLoading
|
|
105
105
|
}, 'flex');
|
|
106
106
|
|
|
107
|
-
const iconLeft = (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.leftIcon) && /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
108
|
-
iconProps: {
|
|
109
|
-
classes: (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.leftIcon.brand) && 'fa-brands',
|
|
110
|
-
size: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.leftIcon.size,
|
|
111
|
-
type: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.leftIcon.type,
|
|
112
|
-
hollow: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.leftIcon.hollow
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
const iconRight = (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.rightIcon) && /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
117
|
-
iconProps: {
|
|
118
|
-
classes: buttonProps !== null && buttonProps !== void 0 && buttonProps.rightIcon.brand ? 'fa-brands' : '',
|
|
119
|
-
size: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.rightIcon.size,
|
|
120
|
-
type: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.rightIcon.type,
|
|
121
|
-
hollow: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.rightIcon.hollow
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
const iconCenter = (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.centerIcon) && /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
126
|
-
iconProps: buttonProps.centerIcon
|
|
127
|
-
});
|
|
128
|
-
|
|
129
107
|
const loadingIcon = /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
130
108
|
iconProps: {
|
|
131
109
|
size: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.size,
|
|
@@ -134,61 +112,23 @@ const Button = _ref => {
|
|
|
134
112
|
}
|
|
135
113
|
});
|
|
136
114
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}), /*#__PURE__*/_react.default.createElement("button", _extends({}, (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.id) && {
|
|
143
|
-
id: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.id
|
|
144
|
-
}, {
|
|
145
|
-
className: classList,
|
|
146
|
-
type: "button",
|
|
147
|
-
"aria-busy": buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.isLoading,
|
|
148
|
-
onMouseOver: () => setHovering(true),
|
|
149
|
-
onMouseOut: () => setHovering(false)
|
|
150
|
-
}, (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.onClick) && {
|
|
151
|
-
onClick: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.onClick
|
|
152
|
-
}, (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.disabled) && {
|
|
153
|
-
disabled: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.disabled
|
|
154
|
-
}), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
155
|
-
className: buttonContentClasses
|
|
156
|
-
}, (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.leftIcon) && iconLeft, /*#__PURE__*/_react.default.createElement("p", null, hovering ? buttonProps !== null && buttonProps !== void 0 && buttonProps.hoverText ? buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.hoverText : buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.text : buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.text), (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.rightIcon) && iconRight), /*#__PURE__*/_react.default.createElement("div", {
|
|
157
|
-
className: loadingClasses
|
|
158
|
-
}, loadingIcon))));
|
|
159
|
-
} else if (['social', 'icon'].includes(buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.type)) {
|
|
160
|
-
return /*#__PURE__*/_react.default.createElement("button", _extends({}, (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.id) && {
|
|
161
|
-
id: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.id
|
|
162
|
-
}, {
|
|
163
|
-
className: classList,
|
|
164
|
-
type: "button",
|
|
165
|
-
"aria-busy": buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.isLoading,
|
|
166
|
-
onMouseOver: () => setHovering(true),
|
|
167
|
-
onMouseOut: () => setHovering(false)
|
|
168
|
-
}, (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.onClick) && {
|
|
169
|
-
onClick: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.onClick
|
|
170
|
-
}, (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.disabled) && {
|
|
171
|
-
disabled: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.disabled
|
|
172
|
-
}), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
173
|
-
className: buttonProps !== null && buttonProps !== void 0 && buttonProps.isLoading ? 'invisible' : ''
|
|
174
|
-
}, (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.centerIcon) && iconCenter), /*#__PURE__*/_react.default.createElement("div", {
|
|
175
|
-
className: loadingClasses
|
|
176
|
-
}, loadingIcon)));
|
|
177
|
-
} else return /*#__PURE__*/_react.default.createElement("button", _extends({}, (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.id) && {
|
|
115
|
+
return /*#__PURE__*/_react.default.createElement("a", _extends({}, (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.target) && {
|
|
116
|
+
target: '_blank'
|
|
117
|
+
}, {
|
|
118
|
+
href: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.url
|
|
119
|
+
}), /*#__PURE__*/_react.default.createElement("button", _extends({}, (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.id) && {
|
|
178
120
|
id: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.id
|
|
179
121
|
}, {
|
|
180
122
|
className: classList,
|
|
181
123
|
type: "button",
|
|
182
|
-
"aria-busy": buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.isLoading
|
|
183
|
-
onMouseOver: () => setHovering(true),
|
|
184
|
-
onMouseOut: () => setHovering(false)
|
|
124
|
+
"aria-busy": buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.isLoading
|
|
185
125
|
}, (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.onClick) && {
|
|
186
126
|
onClick: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.onClick
|
|
187
127
|
}, (buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.disabled) && {
|
|
188
128
|
disabled: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.disabled
|
|
189
|
-
}), /*#__PURE__*/_react.default.createElement("div",
|
|
129
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
190
130
|
className: buttonProps !== null && buttonProps !== void 0 && buttonProps.isLoading ? 'invisible' : ''
|
|
191
|
-
},
|
|
131
|
+
}, children), buttonProps.isLoading && /*#__PURE__*/_react.default.createElement("div", {
|
|
192
132
|
className: loadingClasses
|
|
193
133
|
}, loadingIcon)));
|
|
194
134
|
};
|
|
@@ -21,6 +21,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
21
21
|
|
|
22
22
|
require("../index.css");
|
|
23
23
|
|
|
24
|
+
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
25
|
+
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
27
|
|
|
26
28
|
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); }
|
|
@@ -140,13 +142,13 @@ const Card = _ref => {
|
|
|
140
142
|
className: "flex p-2 order-last h-24"
|
|
141
143
|
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
142
144
|
buttonProps: iconButtonProps
|
|
143
|
-
}), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
145
|
+
}, iconButtonProps.children), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
144
146
|
buttonProps: button2Props
|
|
145
|
-
}))),
|
|
147
|
+
}, button2Props.children))), cardButtonProps && /*#__PURE__*/_react.default.createElement("div", {
|
|
146
148
|
className: btnClass
|
|
147
149
|
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
148
150
|
buttonProps: cardButtonProps
|
|
149
|
-
})));
|
|
151
|
+
}, cardButtonProps.children)));
|
|
150
152
|
};
|
|
151
153
|
|
|
152
154
|
var _default = Card;
|
|
@@ -23,6 +23,8 @@ require("../index.css");
|
|
|
23
23
|
|
|
24
24
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
25
25
|
|
|
26
|
+
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
27
|
+
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
29
|
|
|
28
30
|
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); }
|
|
@@ -51,7 +53,8 @@ const SocialBlock = _ref => {
|
|
|
51
53
|
editTextClasses,
|
|
52
54
|
editInputClasses,
|
|
53
55
|
buttonWrapperClasses,
|
|
54
|
-
textWrapperClasses
|
|
56
|
+
textWrapperClasses,
|
|
57
|
+
socialButtons
|
|
55
58
|
} = _ref;
|
|
56
59
|
const defaultComponentData = {
|
|
57
60
|
title: {
|
|
@@ -75,70 +78,6 @@ const SocialBlock = _ref => {
|
|
|
75
78
|
[hoverClasses]: withLiveUpdates && !isInEditingMode && isHovering,
|
|
76
79
|
[textWrapperClasses]: textWrapperClasses
|
|
77
80
|
});
|
|
78
|
-
const socialButtons = [{
|
|
79
|
-
classes: 'mx-2 w-16 py-4 border border-1',
|
|
80
|
-
bgColor: "bg-social-facebook",
|
|
81
|
-
textColor: "text-white",
|
|
82
|
-
borderColor: "border-social-facebook",
|
|
83
|
-
type: "social",
|
|
84
|
-
hoverBgColor: "hover:bg-white",
|
|
85
|
-
hoverBorderColor: "hover:border-social-facebook",
|
|
86
|
-
hoverTextColor: "hover:text-social-facebook",
|
|
87
|
-
url: "https://www.facebook.com/rupert.bennett",
|
|
88
|
-
iconProps: {
|
|
89
|
-
type: "facebook-f",
|
|
90
|
-
brand: true,
|
|
91
|
-
size: 2,
|
|
92
|
-
classes: 'mx-auto'
|
|
93
|
-
}
|
|
94
|
-
}, {
|
|
95
|
-
classes: 'mx-2 w-16 py-4 border border-1',
|
|
96
|
-
bgColor: "bg-social-linkedin",
|
|
97
|
-
textColor: "text-white",
|
|
98
|
-
borderColor: "border-social-linkedin",
|
|
99
|
-
type: "social",
|
|
100
|
-
hoverBgColor: "hover:bg-white",
|
|
101
|
-
hoverBorderColor: "hover:border-social-linkedin",
|
|
102
|
-
hoverTextColor: "hover:text-social-linkedin",
|
|
103
|
-
url: "https://www.linkedin.com/in/rupert-bennett",
|
|
104
|
-
iconProps: {
|
|
105
|
-
brand: true,
|
|
106
|
-
type: "linkedin-in",
|
|
107
|
-
size: 2,
|
|
108
|
-
classes: 'mx-auto'
|
|
109
|
-
}
|
|
110
|
-
}, {
|
|
111
|
-
classes: 'mx-2 w-16 py-4 border border-1',
|
|
112
|
-
bgColor: "bg-black",
|
|
113
|
-
textColor: "text-white",
|
|
114
|
-
borderColor: "border-black",
|
|
115
|
-
type: "social",
|
|
116
|
-
hoverBgColor: "hover:bg-white",
|
|
117
|
-
hoverBorderColor: "hover:border-black",
|
|
118
|
-
hoverTextColor: "hover:text-black",
|
|
119
|
-
url: "https://github.com/irupertbennett",
|
|
120
|
-
iconProps: {
|
|
121
|
-
brand: true,
|
|
122
|
-
type: "github",
|
|
123
|
-
size: 2,
|
|
124
|
-
classes: 'mx-auto'
|
|
125
|
-
}
|
|
126
|
-
}, {
|
|
127
|
-
classes: 'mx-2 w-16 py-4 border border-1',
|
|
128
|
-
bgColor: "bg-brand-error",
|
|
129
|
-
textColor: "text-white",
|
|
130
|
-
borderColor: "border-brand-error",
|
|
131
|
-
type: "social",
|
|
132
|
-
hoverBgColor: "hover:bg-white",
|
|
133
|
-
hoverBorderColor: "hover:border-brand-error",
|
|
134
|
-
hoverTextColor: "hover:text-brand-error",
|
|
135
|
-
url: "mailto:irupertbennett@gmail.com?subject=rupertbennett.com-&body=Referred from rupertbennett.com",
|
|
136
|
-
iconProps: {
|
|
137
|
-
type: "envelope",
|
|
138
|
-
size: 2,
|
|
139
|
-
classes: 'mx-auto'
|
|
140
|
-
}
|
|
141
|
-
}];
|
|
142
81
|
|
|
143
82
|
const toggleEditState = () => {
|
|
144
83
|
withLiveUpdates && setIsInEditingMode(!isInEditingMode);
|
|
@@ -205,7 +144,6 @@ const SocialBlock = _ref => {
|
|
|
205
144
|
}), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
206
145
|
buttonProps: {
|
|
207
146
|
classes: 'mt-4',
|
|
208
|
-
text: 'Save',
|
|
209
147
|
onClick: handleButtonSave,
|
|
210
148
|
bgColor: saveButtonProps === null || saveButtonProps === void 0 ? void 0 : saveButtonProps.bgColor,
|
|
211
149
|
borderColor: saveButtonProps === null || saveButtonProps === void 0 ? void 0 : saveButtonProps.borderColor,
|
|
@@ -214,10 +152,9 @@ const SocialBlock = _ref => {
|
|
|
214
152
|
hoverBorderColor: saveButtonProps === null || saveButtonProps === void 0 ? void 0 : saveButtonProps.hoverBorderColor,
|
|
215
153
|
hoverBgColor: saveButtonProps === null || saveButtonProps === void 0 ? void 0 : saveButtonProps.hoverBgColor
|
|
216
154
|
}
|
|
217
|
-
}), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
155
|
+
}, "Save"), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
218
156
|
buttonProps: {
|
|
219
157
|
classes: 'mt-4 ml-4',
|
|
220
|
-
text: 'Cancel',
|
|
221
158
|
onClick: handleButtonCancel,
|
|
222
159
|
bgColor: cancelButtonProps === null || cancelButtonProps === void 0 ? void 0 : cancelButtonProps.bgColor,
|
|
223
160
|
borderColor: cancelButtonProps === null || cancelButtonProps === void 0 ? void 0 : cancelButtonProps.borderColor,
|
|
@@ -226,7 +163,7 @@ const SocialBlock = _ref => {
|
|
|
226
163
|
hoverBorderColor: cancelButtonProps === null || cancelButtonProps === void 0 ? void 0 : cancelButtonProps.hoverBorderColor,
|
|
227
164
|
hoverBgColor: cancelButtonProps === null || cancelButtonProps === void 0 ? void 0 : cancelButtonProps.hoverBgColor
|
|
228
165
|
}
|
|
229
|
-
})) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
166
|
+
}, "Cancel")) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
230
167
|
onMouseOver: () => toggleHoverState(),
|
|
231
168
|
onMouseOut: () => toggleHoverState(),
|
|
232
169
|
onClick: toggleEditState,
|
|
@@ -238,23 +175,7 @@ const SocialBlock = _ref => {
|
|
|
238
175
|
}, componentData.text.text)), /*#__PURE__*/_react.default.createElement("div", {
|
|
239
176
|
className: buttnoWrapperClasslist
|
|
240
177
|
}, socialButtons && socialButtons.map((button, i) => {
|
|
241
|
-
return
|
|
242
|
-
key: "".concat(i, "_button"),
|
|
243
|
-
buttonProps: {
|
|
244
|
-
classes: button.classes,
|
|
245
|
-
bgColor: button.bgColor,
|
|
246
|
-
textColor: button.textColor,
|
|
247
|
-
borderColor: button.borderColor,
|
|
248
|
-
type: button.type,
|
|
249
|
-
hoverBgColor: button.hoverBgColor,
|
|
250
|
-
hoverBorderColor: button.hoverBorderColor,
|
|
251
|
-
hoverTextColor: button.hoverTextColor,
|
|
252
|
-
onClick: button.onClick,
|
|
253
|
-
url: button.url,
|
|
254
|
-
border: true,
|
|
255
|
-
centerIcon: button.iconProps
|
|
256
|
-
}
|
|
257
|
-
});
|
|
178
|
+
return button;
|
|
258
179
|
}))));
|
|
259
180
|
};
|
|
260
181
|
|
|
@@ -61,7 +61,8 @@ 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
|
|
|
@@ -69,7 +70,8 @@ const TextAndTitle = _ref => {
|
|
|
69
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 justify-center 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
|
}, {
|
|
@@ -204,38 +215,43 @@ const TextAndTitle = _ref => {
|
|
|
204
215
|
}), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
205
216
|
buttonProps: {
|
|
206
217
|
classes: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa === void 0 ? void 0 : _textAndTitleProps$sa.classes,
|
|
207
|
-
text: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa2 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa2 === void 0 ? void 0 : _textAndTitleProps$sa2.text,
|
|
208
218
|
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$
|
|
219
|
+
bgColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa2 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa2 === void 0 ? void 0 : _textAndTitleProps$sa2.bgColor,
|
|
220
|
+
borderColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa3 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa3 === void 0 ? void 0 : _textAndTitleProps$sa3.borderColor,
|
|
221
|
+
textColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa4 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa4 === void 0 ? void 0 : _textAndTitleProps$sa4.textColor,
|
|
222
|
+
hoverTextColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa5 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa5 === void 0 ? void 0 : _textAndTitleProps$sa5.hoverTextColor,
|
|
223
|
+
hoverBorderColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa6 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa6 === void 0 ? void 0 : _textAndTitleProps$sa6.hoverBorderColor,
|
|
224
|
+
hoverBgColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa7 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa7 === void 0 ? void 0 : _textAndTitleProps$sa7.hoverBgColor
|
|
215
225
|
}
|
|
216
|
-
}), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
226
|
+
}, textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa8 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa8 === void 0 ? void 0 : _textAndTitleProps$sa8.text), /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
217
227
|
buttonProps: {
|
|
218
228
|
classes: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca === void 0 ? void 0 : _textAndTitleProps$ca.classes,
|
|
219
|
-
text: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca2 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca2 === void 0 ? void 0 : _textAndTitleProps$ca2.text,
|
|
220
229
|
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$
|
|
230
|
+
bgColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca2 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca2 === void 0 ? void 0 : _textAndTitleProps$ca2.bgColor,
|
|
231
|
+
borderColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca3 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca3 === void 0 ? void 0 : _textAndTitleProps$ca3.borderColor,
|
|
232
|
+
textColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca4 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca4 === void 0 ? void 0 : _textAndTitleProps$ca4.textColor,
|
|
233
|
+
hoverTextColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca5 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca5 === void 0 ? void 0 : _textAndTitleProps$ca5.hoverTextColor,
|
|
234
|
+
hoverBorderColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca6 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca6 === void 0 ? void 0 : _textAndTitleProps$ca6.hoverBorderColor,
|
|
235
|
+
hoverBgColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca7 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca7 === void 0 ? void 0 : _textAndTitleProps$ca7.hoverBgColor
|
|
227
236
|
}
|
|
228
|
-
})) : /*#__PURE__*/_react.default.createElement("div", {
|
|
237
|
+
}, textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca8 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca8 === void 0 ? void 0 : _textAndTitleProps$ca8.text)) : /*#__PURE__*/_react.default.createElement("div", {
|
|
238
|
+
className: wrapperClassList,
|
|
229
239
|
onClick: toggleEditState
|
|
230
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
240
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
241
|
+
className: titleWrapperClassList
|
|
242
|
+
}, componentData.title.text ? /*#__PURE__*/_react.default.createElement("h1", {
|
|
243
|
+
className: titleClassList
|
|
244
|
+
}, componentData.title.text) : /*#__PURE__*/_react.default.createElement("div", null, children)), /*#__PURE__*/_react.default.createElement("div", {
|
|
245
|
+
className: textWrapperClassList
|
|
246
|
+
}, !componentData.title.text ? /*#__PURE__*/_react.default.createElement("h1", {
|
|
231
247
|
className: titleClassList
|
|
232
|
-
}, componentData.
|
|
248
|
+
}, componentData.textLineOne.text) : /*#__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 = {
|