trepur_components 0.2.73 → 0.3.1

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.
Files changed (37) hide show
  1. package/dist/components/Accordion/index.js +1 -19
  2. package/dist/components/AlertBar/index.js +82 -56
  3. package/dist/components/Breadcrumbs/index.js +31 -11
  4. package/dist/components/BreadcrumbsBordered/index.js +13 -11
  5. package/dist/components/BreadcrumbsItem/index.css +3 -23
  6. package/dist/components/BreadcrumbsItem/index.js +110 -138
  7. package/dist/components/Button/index.js +157 -182
  8. package/dist/components/Card/index.js +73 -163
  9. package/dist/components/CardWithTopImage/index.js +21 -24
  10. package/dist/components/Carousel/index.js +8 -4
  11. package/dist/components/CarouselV2/index.css +3 -0
  12. package/dist/components/CarouselV2/index.js +173 -0
  13. package/dist/components/Collapsible/index.js +85 -74
  14. package/dist/components/Column/index.js +36 -18
  15. package/dist/components/FyreCard/index.js +4 -23
  16. package/dist/components/Icon/index.js +66 -26
  17. package/dist/components/Image/index.js +36 -14
  18. package/dist/components/ImageLink/index.js +4 -2
  19. package/dist/components/InformationIcon/index.js +74 -82
  20. package/dist/components/Input/index.js +82 -61
  21. package/dist/components/Nav/index.js +96 -129
  22. package/dist/components/NavItem/index.js +82 -71
  23. package/dist/components/NewsCard/index.js +26 -42
  24. package/dist/components/Profile/index.js +35 -23
  25. package/dist/components/Row/index.js +31 -10
  26. package/dist/components/Search/index.js +19 -25
  27. package/dist/components/SocialBlock/index.js +108 -84
  28. package/dist/components/StarRating/index.js +61 -31
  29. package/dist/components/Testimonial/index.js +22 -18
  30. package/dist/components/TextAndTitle/index.js +121 -99
  31. package/dist/components/TextArea/index.js +68 -47
  32. package/dist/components/Timeline/index.js +81 -51
  33. package/dist/components/Tubestops/index.js +62 -30
  34. package/dist/components/UserIcon/index.js +14 -10
  35. package/dist/components/Video/index.js +45 -34
  36. package/dist/index.js +8 -0
  37. package/package.json +2 -1
@@ -5,7 +5,7 @@ require("core-js/modules/es.object.assign.js");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = void 0;
8
+ exports.textAndTitleProps = exports.default = void 0;
9
9
 
10
10
  require("core-js/modules/web.dom-collections.iterator.js");
11
11
 
@@ -19,10 +19,12 @@ var _Input = _interopRequireDefault(require("../Input"));
19
19
 
20
20
  var _Button = _interopRequireDefault(require("../Button"));
21
21
 
22
- require("../index.css");
22
+ var _propTypes = _interopRequireDefault(require("prop-types"));
23
23
 
24
24
  var _classnames = _interopRequireDefault(require("classnames"));
25
25
 
26
+ require("../index.css");
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); }
@@ -37,71 +39,81 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
37
39
 
38
40
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
39
41
 
42
+ const textAndTitleProps = {
43
+ id: _propTypes.default.string,
44
+ classes: _propTypes.default.string,
45
+ titleClasses: _propTypes.default.string,
46
+ editTitleClasses: _propTypes.default.string,
47
+ editTextClasses: _propTypes.default.string,
48
+ editInputClasses: _propTypes.default.string,
49
+ textClasses: _propTypes.default.string,
50
+ textLineOne: _propTypes.default.string,
51
+ textLineTwo: _propTypes.default.string,
52
+ textLineThree: _propTypes.default.string,
53
+ title: _propTypes.default.string,
54
+ titleBold: _propTypes.default.bool,
55
+ titleBgColor: _propTypes.default.string,
56
+ textBgColor: _propTypes.default.string,
57
+ textColor: _propTypes.default.string,
58
+ titleColor: _propTypes.default.string,
59
+ textCenter: _propTypes.default.bool,
60
+ titleCenter: _propTypes.default.bool,
61
+ withLiveUpdates: _propTypes.default.bool,
62
+ onSave: _propTypes.default.func,
63
+ saveButtonProps: _propTypes.default.object,
64
+ cancelButtonProps: _propTypes.default.object
65
+ };
66
+ exports.textAndTitleProps = textAndTitleProps;
67
+
40
68
  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
+
41
71
  let {
42
- id,
43
- classes,
44
- titleClasses,
45
- editTitleClasses,
46
- editTextClasses,
47
- editInputClasses,
48
- textClasses,
49
- textLineOne,
50
- textLineTwo,
51
- textLineThree,
52
- title,
53
- titleBold,
54
- bgColor,
55
- textColor,
56
- titleColor,
57
- textCenter,
58
- titleCenter,
59
- withLiveUpdates,
60
- onSave,
61
- saveButtonProps,
62
- cancelButtonProps
72
+ textAndTitleProps
63
73
  } = _ref;
64
74
  const defaultComponentData = {
65
75
  title: {
66
- text: title
76
+ text: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.title
67
77
  },
68
78
  textLineOne: {
69
- text: textLineOne
79
+ text: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.textLineOne
70
80
  },
71
81
  textLineTwo: {
72
- text: textLineTwo
82
+ text: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.textLineTwo
73
83
  },
74
84
  textLineThree: {
75
- text: textLineThree
85
+ text: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.textLineThree
76
86
  }
77
87
  };
78
88
  const [isInEditingMode, setIsInEditingMode] = (0, _react.useState)(false);
79
89
  const [isHovering, setIsHovering] = (0, _react.useState)(false);
80
90
  const [componentData, setComponentData] = (0, _react.useState)(defaultComponentData);
91
+ if (textAndTitleProps == undefined) return;
81
92
  const hoverClasses = 'border-dashed border';
82
93
  const classList = (0, _classnames.default)({
83
- [hoverClasses]: withLiveUpdates && !isInEditingMode && isHovering,
84
- [classes]: classes
94
+ [hoverClasses]: (textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.withLiveUpdates) && !isInEditingMode && isHovering,
95
+ [textAndTitleProps.classes]: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.classes
85
96
  });
86
- let titleClassList = 'text-md sm:text-lg ';
87
- titleClassList += titleBold ? 'font-bold ' : '';
88
- titleClassList += titleCenter ? 'text-center ' : '';
89
- titleClassList += titleClasses ? titleClasses : '';
90
- let textClassList = 'pt-4';
91
- textClassList += textCenter ? 'text-center ' : '';
92
- textClassList += textClasses ? textClasses : ''; //---------- Styling ---------------
93
-
94
- const textStyles = {
95
- 'backgroundColor': bgColor,
96
- 'color': textColor
97
- };
98
- const titleStyles = {
99
- 'backgroundColor': bgColor,
100
- 'color': titleColor
101
- }; //-----------------------------------
97
+ const titleClassList = (0, _classnames.default)({
98
+ 'font-bold': textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.titleBold,
99
+ 'text-center': textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.titleCenter,
100
+ [textAndTitleProps.titleClasses]: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.titleClasses,
101
+ [textAndTitleProps.titleBgColor]: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.titleBgColor,
102
+ 'bg-white': !(textAndTitleProps !== null && textAndTitleProps !== void 0 && textAndTitleProps.titleBgColor),
103
+ [textAndTitleProps.titleColor]: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.titleColor,
104
+ 'text-black': !(textAndTitleProps !== null && textAndTitleProps !== void 0 && textAndTitleProps.titleColor)
105
+ }, 'text-md sm:text-lg');
106
+ const textClassList = (0, _classnames.default)({
107
+ 'text-center': textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.textCenter,
108
+ [textAndTitleProps.textClasses]: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.textClasses,
109
+ [textAndTitleProps.textBgColor]: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.textBgColor,
110
+ 'bg-white': !(textAndTitleProps !== null && textAndTitleProps !== void 0 && textAndTitleProps.textBgColor),
111
+ [textAndTitleProps.textColor]: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.textColor,
112
+ 'text-black': !(textAndTitleProps !== null && textAndTitleProps !== void 0 && textAndTitleProps.textColor)
113
+ }, 'pt-4');
102
114
 
103
115
  const toggleEditState = () => {
104
- withLiveUpdates && setIsInEditingMode(!isInEditingMode);
116
+ (textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.withLiveUpdates) && setIsInEditingMode(!isInEditingMode);
105
117
  };
106
118
 
107
119
  const handleButtonSave = () => {
@@ -123,7 +135,7 @@ const TextAndTitle = _ref => {
123
135
  value: componentData.textLineThree.text
124
136
  });
125
137
  toggleEditState();
126
- onSave(arr, id);
138
+ textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.onSave(arr, textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.id);
127
139
  setIsHovering(false);
128
140
  };
129
141
 
@@ -134,7 +146,6 @@ const TextAndTitle = _ref => {
134
146
 
135
147
  const handleChange = e => {
136
148
  let id = e.target.id;
137
- console.log('id', id);
138
149
  id = id.split('-')[id.split('-').length - 1];
139
150
  setComponentData(_objectSpread(_objectSpread({}, componentData), {}, {
140
151
  [id]: {
@@ -144,80 +155,91 @@ const TextAndTitle = _ref => {
144
155
  };
145
156
 
146
157
  const toggleHoverState = () => {
147
- withLiveUpdates && setIsHovering(!isHovering);
158
+ (textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.withLiveUpdates) && setIsHovering(!isHovering);
148
159
  };
149
160
 
150
- return /*#__PURE__*/_react.default.createElement("div", _extends({}, id && {
151
- id: id
161
+ return /*#__PURE__*/_react.default.createElement("div", _extends({}, (textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.id) && {
162
+ id: textAndTitleProps.id
152
163
  }, {
153
164
  className: classList,
154
165
  onMouseOver: () => toggleHoverState(),
155
166
  onMouseOut: () => toggleHoverState()
156
- }), withLiveUpdates && isInEditingMode ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Input.default, {
157
- id: "title",
158
- classes: editTitleClasses,
159
- inputClasses: editInputClasses,
160
- autoFocus: true,
161
- value: componentData.title.text,
162
- onChange: e => handleChange(e),
163
- type: "text"
167
+ }), textAndTitleProps !== null && textAndTitleProps !== void 0 && textAndTitleProps.withLiveUpdates && isInEditingMode ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Input.default, {
168
+ inputProps: {
169
+ id: 'title',
170
+ classes: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.editTitleClasses,
171
+ inputClasses: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.editInputClasses,
172
+ autoFocus: true,
173
+ value: componentData.title.text,
174
+ onChange: e => handleChange(e),
175
+ type: "text"
176
+ }
164
177
  }), /*#__PURE__*/_react.default.createElement(_Input.default, {
165
- id: "textLineOne",
166
- classes: editTextClasses,
167
- inputClasses: editInputClasses,
168
- value: componentData.textLineOne.text,
169
- onChange: e => handleChange(e),
170
- type: "text"
178
+ inputProps: {
179
+ id: 'textLineOne',
180
+ classes: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.editTextClasses,
181
+ inputClasses: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.editInputClasses,
182
+ value: componentData.textLineOne.text,
183
+ onChange: e => handleChange(e),
184
+ type: "text"
185
+ }
171
186
  }), /*#__PURE__*/_react.default.createElement(_Input.default, {
172
- id: "textLineTwo",
173
- classes: editTextClasses,
174
- inputClasses: editInputClasses,
175
- value: componentData.textLineTwo.text,
176
- onChange: e => handleChange(e),
177
- type: "text"
187
+ inputProps: {
188
+ id: 'textLineTwo',
189
+ classes: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.editTextClasses,
190
+ inputClasses: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.editInputClasses,
191
+ value: componentData.textLineTwo.text,
192
+ onChange: e => handleChange(e),
193
+ type: "text"
194
+ }
178
195
  }), /*#__PURE__*/_react.default.createElement(_Input.default, {
179
- id: "textLineThree",
180
- classes: editTextClasses,
181
- inputClasses: editInputClasses,
182
- value: componentData.textLineThree.text,
183
- onChange: e => handleChange(e),
184
- type: "text"
196
+ inputProps: {
197
+ id: 'textLineThree',
198
+ classes: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.editTextClasses,
199
+ inputClasses: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : textAndTitleProps.editInputClasses,
200
+ value: componentData.textLineThree.text,
201
+ onChange: e => handleChange(e),
202
+ type: "text"
203
+ }
185
204
  }), /*#__PURE__*/_react.default.createElement(_Button.default, {
186
- buttonClasses: "mt-4",
187
- buttonText: "Save",
188
- buttonOnClick: handleButtonSave,
189
- buttonBgColor: saveButtonProps === null || saveButtonProps === void 0 ? void 0 : saveButtonProps.bgColor,
190
- buttonBorderColor: saveButtonProps === null || saveButtonProps === void 0 ? void 0 : saveButtonProps.borderColor,
191
- buttonTextColor: saveButtonProps === null || saveButtonProps === void 0 ? void 0 : saveButtonProps.textColor,
192
- buttonHoverTextColor: saveButtonProps === null || saveButtonProps === void 0 ? void 0 : saveButtonProps.hoverTextColor,
193
- buttonHoverBorderColor: saveButtonProps === null || saveButtonProps === void 0 ? void 0 : saveButtonProps.hoverBorderColor,
194
- buttonHoverBgColor: saveButtonProps === null || saveButtonProps === void 0 ? void 0 : saveButtonProps.hoverBgColor
205
+ buttonProps: {
206
+ classes: textAndTitleProps.saveButtonProps.classes,
207
+ text: textAndTitleProps.saveButtonProps.text,
208
+ onClick: handleButtonSave,
209
+ bgColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa === void 0 ? void 0 : _textAndTitleProps$sa.bgColor,
210
+ borderColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa2 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa2 === void 0 ? void 0 : _textAndTitleProps$sa2.borderColor,
211
+ textColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa3 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa3 === void 0 ? void 0 : _textAndTitleProps$sa3.textColor,
212
+ hoverTextColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa4 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa4 === void 0 ? void 0 : _textAndTitleProps$sa4.hoverTextColor,
213
+ hoverBorderColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa5 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa5 === void 0 ? void 0 : _textAndTitleProps$sa5.hoverBorderColor,
214
+ hoverBgColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$sa6 = textAndTitleProps.saveButtonProps) === null || _textAndTitleProps$sa6 === void 0 ? void 0 : _textAndTitleProps$sa6.hoverBgColor
215
+ }
195
216
  }), /*#__PURE__*/_react.default.createElement(_Button.default, {
196
- buttonClasses: "mt-4 ml-4",
197
- buttonText: "Cancel",
198
- buttonOnClick: handleButtonCancel,
199
- buttonBgColor: cancelButtonProps === null || cancelButtonProps === void 0 ? void 0 : cancelButtonProps.bgColor,
200
- buttonBorderColor: cancelButtonProps === null || cancelButtonProps === void 0 ? void 0 : cancelButtonProps.borderColor,
201
- buttonTextColor: cancelButtonProps === null || cancelButtonProps === void 0 ? void 0 : cancelButtonProps.textColor,
202
- buttonHoverTextColor: cancelButtonProps === null || cancelButtonProps === void 0 ? void 0 : cancelButtonProps.hoverTextColor,
203
- buttonHoverBorderColor: cancelButtonProps === null || cancelButtonProps === void 0 ? void 0 : cancelButtonProps.hoverBorderColor,
204
- buttonHoverBgColor: cancelButtonProps === null || cancelButtonProps === void 0 ? void 0 : cancelButtonProps.hoverBgColor
217
+ buttonProps: {
218
+ classes: textAndTitleProps.cancelButtonProps.classes,
219
+ text: textAndTitleProps.cancelButtonProps.text,
220
+ onClick: handleButtonCancel,
221
+ bgColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca === void 0 ? void 0 : _textAndTitleProps$ca.bgColor,
222
+ borderColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca2 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca2 === void 0 ? void 0 : _textAndTitleProps$ca2.borderColor,
223
+ textColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca3 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca3 === void 0 ? void 0 : _textAndTitleProps$ca3.textColor,
224
+ hoverTextColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca4 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca4 === void 0 ? void 0 : _textAndTitleProps$ca4.hoverTextColor,
225
+ hoverBorderColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca5 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca5 === void 0 ? void 0 : _textAndTitleProps$ca5.hoverBorderColor,
226
+ hoverBgColor: textAndTitleProps === null || textAndTitleProps === void 0 ? void 0 : (_textAndTitleProps$ca6 = textAndTitleProps.cancelButtonProps) === null || _textAndTitleProps$ca6 === void 0 ? void 0 : _textAndTitleProps$ca6.hoverBgColor
227
+ }
205
228
  })) : /*#__PURE__*/_react.default.createElement("div", {
206
229
  onClick: toggleEditState
207
230
  }, /*#__PURE__*/_react.default.createElement("h1", {
208
- style: titleStyles,
209
231
  className: titleClassList
210
232
  }, componentData.title.text), /*#__PURE__*/_react.default.createElement("p", {
211
- style: textStyles,
212
233
  className: textClassList
213
234
  }, componentData.textLineOne.text), /*#__PURE__*/_react.default.createElement("p", {
214
- style: textStyles,
215
235
  className: textClassList
216
236
  }, componentData.textLineTwo.text), /*#__PURE__*/_react.default.createElement("p", {
217
- style: textStyles,
218
237
  className: textClassList
219
238
  }, componentData.textLineThree.text)));
220
239
  };
221
240
 
241
+ TextAndTitle.propTypes = {
242
+ textAndTitleProps: _propTypes.default.shape(_objectSpread({}, textAndTitleProps))
243
+ };
222
244
  var _default = TextAndTitle;
223
245
  exports.default = _default;
@@ -3,73 +3,94 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.textAreaProps = exports.default = void 0;
7
7
 
8
8
  require("core-js/modules/es.object.assign.js");
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
+
14
+ var _classnames = _interopRequireDefault(require("classnames"));
15
+
12
16
  require("../index.css");
13
17
 
14
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
19
 
20
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
21
+
22
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
23
+
24
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
25
+
16
26
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
27
 
28
+ const textAreaProps = {
29
+ id: _propTypes.default.string,
30
+ classes: _propTypes.default.string,
31
+ labelClasses: _propTypes.default.string,
32
+ textAreaClasses: _propTypes.default.string,
33
+ label: _propTypes.default.string,
34
+ placeholder: _propTypes.default.string,
35
+ bold: _propTypes.default.bool,
36
+ name: _propTypes.default.string,
37
+ disabled: _propTypes.default.bool,
38
+ rows: _propTypes.default.number,
39
+ cols: _propTypes.default.number,
40
+ autoFocus: _propTypes.default.bool,
41
+ formId: _propTypes.default.string,
42
+ maxLength: _propTypes.default.string,
43
+ readOnly: _propTypes.default.string,
44
+ required: _propTypes.default.bool,
45
+ onBlur: _propTypes.default.func,
46
+ onFocus: _propTypes.default.func,
47
+ onChange: _propTypes.default.func
48
+ };
49
+ exports.textAreaProps = textAreaProps;
50
+
18
51
  const TextArea = _ref => {
19
52
  let {
20
- id,
21
- classes,
22
- labelClasses,
23
- textAreaClasses,
24
- label,
25
- placeholder,
26
- bold,
27
- onChange,
28
- name,
29
- disabled,
30
- rows,
31
- cols,
32
- autoFocus,
33
- formId,
34
- maxLength,
35
- readOnly,
36
- required,
37
- onBlur,
38
- onFocus
53
+ textAreaProps
39
54
  } = _ref;
40
- let classList = 'flex flex-col ';
41
- classList += classes ? classes : '';
42
- let labelClassList = 'w-auto ';
43
- labelClassList += bold ? 'font-bold ' : '';
44
- labelClassList += labelClasses ? labelClasses : '';
45
- let textAreaClassList = 'border px-2 ';
46
- textAreaClassList += textAreaClasses ? textAreaClasses : '';
47
- return /*#__PURE__*/_react.default.createElement("div", _extends({}, id && {
48
- id: id
55
+ const classList = (0, _classnames.default)({
56
+ [textAreaProps.classes]: textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.classes
57
+ }, 'flex flex-col');
58
+ const labelClassList = (0, _classnames.default)({
59
+ 'font-bold': textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.bold,
60
+ [textAreaProps.labelClasses]: textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.labelClasses
61
+ }, 'w-auto');
62
+ const textAreaClassList = (0, _classnames.default)({
63
+ [textAreaProps.textAreaClasses]: textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.textAreaClasses
64
+ }, 'border px-2');
65
+ return /*#__PURE__*/_react.default.createElement("div", _extends({}, (textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.id) && {
66
+ id: textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.id
49
67
  }, {
50
68
  className: classList
51
- }), label && /*#__PURE__*/_react.default.createElement("label", {
52
- id: "label-".concat(id),
69
+ }), (textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.label) && /*#__PURE__*/_react.default.createElement("label", {
70
+ id: "label-".concat(textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.id),
53
71
  className: labelClassList,
54
- htmlFor: "text-area-".concat(id)
55
- }, label), /*#__PURE__*/_react.default.createElement("textarea", {
56
- id: "text-area-".concat(id),
72
+ htmlFor: "text-area-".concat(textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.id)
73
+ }, textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.label), /*#__PURE__*/_react.default.createElement("textarea", {
74
+ id: "text-area-".concat(textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.id),
57
75
  className: textAreaClassList,
58
- autoFocus: autoFocus,
59
- form: formId,
60
- maxLength: maxLength,
61
- readOnly: readOnly,
62
- required: required,
63
- disabled: disabled,
64
- rows: rows,
65
- cols: cols,
66
- name: name,
67
- placeholder: placeholder,
68
- onChange: onChange,
69
- onFocus: onFocus,
70
- onBlur: onBlur
76
+ autoFocus: textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.autoFocus,
77
+ form: textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.formId,
78
+ maxLength: textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.maxLength,
79
+ readOnly: textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.readOnly,
80
+ required: textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.required,
81
+ disabled: textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.disabled,
82
+ rows: textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.rows,
83
+ cols: textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.cols,
84
+ name: textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.name,
85
+ placeholder: textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.placeholder,
86
+ onChange: textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.onChange,
87
+ onFocus: textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.onFocus,
88
+ onBlur: textAreaProps === null || textAreaProps === void 0 ? void 0 : textAreaProps.onBlur
71
89
  }));
72
90
  };
73
91
 
92
+ TextArea.propTypes = {
93
+ textAreaProps: _propTypes.default.shape(_objectSpread({}, textAreaProps))
94
+ };
74
95
  var _default = TextArea;
75
96
  exports.default = _default;