trepur_components 0.2.74 → 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.
Files changed (36) 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.js +19 -21
  12. package/dist/components/Collapsible/index.js +85 -74
  13. package/dist/components/Column/index.js +36 -18
  14. package/dist/components/FyreCard/index.js +4 -23
  15. package/dist/components/Icon/index.js +66 -26
  16. package/dist/components/Image/index.js +36 -14
  17. package/dist/components/ImageLink/index.js +15 -7
  18. package/dist/components/ImageLinkList/index.js +5 -1
  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/package.json +1 -1
@@ -1,18 +1,22 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.assign.js");
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
- exports.default = void 0;
8
+ exports.informationIconProps = exports.default = void 0;
9
9
 
10
- require("core-js/modules/web.dom-collections.iterator.js");
10
+ require("core-js/modules/es.object.assign.js");
11
11
 
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
 
14
14
  var _Icon = _interopRequireDefault(require("../Icon"));
15
15
 
16
+ var _propTypes = _interopRequireDefault(require("prop-types"));
17
+
18
+ var _classnames = _interopRequireDefault(require("classnames"));
19
+
16
20
  require("../index.css");
17
21
 
18
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -21,37 +25,66 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
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; }
23
27
 
28
+ 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; }
29
+
30
+ 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; }
31
+
32
+ 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; }
33
+
24
34
  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); }
25
35
 
36
+ const informationIconProps = {
37
+ id: _propTypes.default.string,
38
+ classes: _propTypes.default.string,
39
+ imageClasses: _propTypes.default.string,
40
+ type: _propTypes.default.string,
41
+ size: _propTypes.default.number,
42
+ text: _propTypes.default.string,
43
+ number: _propTypes.default.number,
44
+ bordered: _propTypes.default.bool,
45
+ rounded: _propTypes.default.bool,
46
+ bgColor: _propTypes.default.string,
47
+ textColor: _propTypes.default.string,
48
+ hoverTextColor: _propTypes.default.string,
49
+ hoverBgColor: _propTypes.default.string,
50
+ withAnimation: _propTypes.default.bool
51
+ };
52
+ exports.informationIconProps = informationIconProps;
53
+
26
54
  const InformationIcon = _ref => {
27
55
  let {
28
- id,
29
- classes,
30
- imageClasses,
31
- type,
32
- size,
33
- text,
34
- number,
35
- bordered,
36
- rounded,
37
- bgColor,
38
- textColor,
39
- hoverTextColor,
40
- hoverBgColor,
41
- withAnimation
56
+ informationIconProps
42
57
  } = _ref;
43
58
  let loaded = (0, _react.useRef)(false);
44
- let imageClassList = 'mx-auto pt-2 ';
45
- imageClassList += imageClasses ? imageClasses : '';
46
- const wrapperClasses = 'h-96 flex items-center justify-center text-center py-12 hover:py-0 ease-out duration-300';
47
- let classList = 'flex flex-col items-center justify-center text-center w-full h-full mx-12 my-12 ease-out duration-300 hover:m-0 hover:text-sm ';
48
- classList += bordered ? 'border ' : '';
49
- classList += rounded ? 'rounded-2xl ' : '';
50
- classList += classes ? classes : '';
51
- const numberClass = number !== null ? 'text-lg' : '';
52
- const numberClasses = 'text-center ' + numberClass;
53
- const textClass = number === null ? ' text-lg ' : '';
54
- const textClasses = 'h-24 flex items-center justify-center text-center px-2 text-md md:text-lg ' + textClass;
59
+ (0, _react.useEffect)(() => {
60
+ const element = document.getElementById((informationIconProps === null || informationIconProps === void 0 ? void 0 : informationIconProps.id) + '_number');
61
+ let observer = new IntersectionObserver((entries, observer) => {
62
+ entries.forEach(entry => {
63
+ if (entry.intersectionRatio >= 0.1 && loaded.current == false) {
64
+ loaded.current = true;
65
+ counterAnimation(document.getElementById((informationIconProps === null || informationIconProps === void 0 ? void 0 : informationIconProps.id) + '_number'), 0, informationIconProps === null || informationIconProps === void 0 ? void 0 : informationIconProps.number, 3000);
66
+ }
67
+ });
68
+ }, {
69
+ threshold: 1
70
+ });
71
+ (informationIconProps === null || informationIconProps === void 0 ? void 0 : informationIconProps.withAnimation) && observer.observe(element);
72
+ }, []);
73
+ if (informationIconProps == undefined) return;
74
+ const wrapperClasses = "h-96 flex items-center text-center \n py-12 hover:py-0 ease-out duration-300";
75
+ const classList = (0, _classnames.default)({
76
+ [informationIconProps.classes]: informationIconProps === null || informationIconProps === void 0 ? void 0 : informationIconProps.classes,
77
+ 'border': informationIconProps === null || informationIconProps === void 0 ? void 0 : informationIconProps.bordered,
78
+ 'rounded-2xl': informationIconProps === null || informationIconProps === void 0 ? void 0 : informationIconProps.rounded,
79
+ [informationIconProps.textColor]: informationIconProps === null || informationIconProps === void 0 ? void 0 : informationIconProps.textColor,
80
+ [informationIconProps.bgColor]: informationIconProps === null || informationIconProps === void 0 ? void 0 : informationIconProps.bgColor,
81
+ 'text-black': !(informationIconProps !== null && informationIconProps !== void 0 && informationIconProps.textColor),
82
+ 'bg-white': !(informationIconProps !== null && informationIconProps !== void 0 && informationIconProps.bgColor),
83
+ [informationIconProps.hoverTextColor]: informationIconProps === null || informationIconProps === void 0 ? void 0 : informationIconProps.hoverTextColor,
84
+ [informationIconProps.hoverBgColor]: informationIconProps === null || informationIconProps === void 0 ? void 0 : informationIconProps.hoverBgColor,
85
+ 'hover:text-white': !(informationIconProps !== null && informationIconProps !== void 0 && informationIconProps.hoverTextColor),
86
+ 'hover:bg-black': !(informationIconProps !== null && informationIconProps !== void 0 && informationIconProps.hoverBgColor)
87
+ }, "flex flex-col justify-center w-full h-full items-center\n mx-12 my-12 ease-out duration-300 hover:m-0 text-lg hover:text-xl");
55
88
 
56
89
  const counterAnimation = (obj, start, end, duration) => {
57
90
  let startTimestamp = null;
@@ -69,62 +102,21 @@ const InformationIcon = _ref => {
69
102
  window.requestAnimationFrame(step);
70
103
  };
71
104
 
72
- (0, _react.useEffect)(() => {
73
- const element = document.getElementById(id + '_number');
74
- let observer = new IntersectionObserver((entries, observer) => {
75
- entries.forEach(entry => {
76
- if (entry.intersectionRatio >= 0.1 && loaded.current == false) {
77
- loaded.current = true;
78
- counterAnimation(document.getElementById(id + '_number'), 0, number, 3000);
79
- } else {}
80
- });
81
- }, {
82
- threshold: 1
83
- });
84
- withAnimation && observer.observe(element);
85
- }, []); //---------- Styling ---------------
86
-
87
- const [styles, setStyles] = (0, _react.useState)({
88
- 'backgroundColor': bgColor ? bgColor : 'white',
89
- color: textColor ? textColor : 'black'
90
- });
91
-
92
- const setHoverState = isHovering => {
93
- if (isHovering) {
94
- setStyles({
95
- 'backgroundColor': hoverBgColor ? hoverBgColor : 'white',
96
- color: hoverTextColor ? hoverTextColor : 'black'
97
- });
98
- } else {
99
- setStyles({
100
- 'backgroundColor': bgColor ? bgColor : 'white',
101
- color: textColor ? textColor : 'black'
102
- });
103
- }
104
- }; //-----------------------------------
105
-
106
-
107
- return /*#__PURE__*/_react.default.createElement("div", {
108
- id: "wrapper",
109
- className: wrapperClasses
110
- }, /*#__PURE__*/_react.default.createElement("div", _extends({}, id && {
111
- id: id
105
+ return /*#__PURE__*/_react.default.createElement("div", _extends({}, (informationIconProps === null || informationIconProps === void 0 ? void 0 : informationIconProps.id) && {
106
+ id: informationIconProps.id
112
107
  }, {
113
- style: styles,
114
- className: classList,
115
- onMouseOver: () => setHoverState(true),
116
- onMouseOut: () => setHoverState(false)
117
- }), type && /*#__PURE__*/_react.default.createElement(_Icon.default, {
118
- type: type,
119
- size: size,
120
- classes: imageClassList
121
- }), number && /*#__PURE__*/_react.default.createElement("p", {
122
- id: id + '_number',
123
- className: numberClasses
124
- }, number), /*#__PURE__*/_react.default.createElement("p", {
125
- className: textClasses
126
- }, text)));
108
+ className: wrapperClasses
109
+ }), /*#__PURE__*/_react.default.createElement("div", {
110
+ className: classList
111
+ }, (informationIconProps === null || informationIconProps === void 0 ? void 0 : informationIconProps.iconProps) && /*#__PURE__*/_react.default.createElement(_Icon.default, {
112
+ iconProps: informationIconProps.iconProps
113
+ }), (informationIconProps === null || informationIconProps === void 0 ? void 0 : informationIconProps.number) && /*#__PURE__*/_react.default.createElement("p", {
114
+ id: (informationIconProps === null || informationIconProps === void 0 ? void 0 : informationIconProps.id) + '_number'
115
+ }, informationIconProps === null || informationIconProps === void 0 ? void 0 : informationIconProps.number), /*#__PURE__*/_react.default.createElement("p", null, informationIconProps === null || informationIconProps === void 0 ? void 0 : informationIconProps.text)));
127
116
  };
128
117
 
118
+ InformationIcon.propTypes = {
119
+ informationIconProps: _propTypes.default.shape(_objectSpread({}, informationIconProps))
120
+ };
129
121
  var _default = InformationIcon;
130
122
  exports.default = _default;
@@ -3,91 +3,112 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.inputProps = 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 inputProps = {
29
+ id: _propTypes.default.string,
30
+ classes: _propTypes.default.string,
31
+ labelClasses: _propTypes.default.string,
32
+ inputClasses: _propTypes.default.string,
33
+ autoComplete: _propTypes.default.bool,
34
+ disabled: _propTypes.default.bool,
35
+ formId: _propTypes.default.string,
36
+ height: _propTypes.default.string,
37
+ maxLength: _propTypes.default.string,
38
+ minLength: _propTypes.default.string,
39
+ pattern: _propTypes.default.string,
40
+ required: _propTypes.default.bool,
41
+ readOnly: _propTypes.default.bool,
42
+ label: _propTypes.default.string,
43
+ type: _propTypes.default.string,
44
+ name: _propTypes.default.string,
45
+ placeholder: _propTypes.default.string,
46
+ bold: _propTypes.default.bool,
47
+ onChange: _propTypes.default.func,
48
+ onBlur: _propTypes.default.func,
49
+ onFocus: _propTypes.default.func,
50
+ hasValidation: _propTypes.default.bool,
51
+ errors: _propTypes.default.string,
52
+ value: _propTypes.default.string
53
+ };
54
+ exports.inputProps = inputProps;
55
+
18
56
  const Input = _ref => {
19
57
  let {
20
- id,
21
- classes,
22
- labelClasses,
23
- inputClasses,
24
- autoComplete,
25
- disabled,
26
- formId,
27
- height,
28
- maxLength,
29
- minLength,
30
- pattern,
31
- required,
32
- readOnly,
33
- label,
34
- type,
35
- name,
36
- placeholder,
37
- bold,
38
- onChange,
39
- onBlur,
40
- onFocus,
41
- hasValidation,
42
- errors,
43
- value
58
+ inputProps
44
59
  } = _ref;
45
- let classList = 'flex flex-col ';
46
- classList += classes ? classes : '';
47
- let labelClassList = 'w-auto ';
48
- labelClassList += bold ? 'font-bold ' : '';
49
- labelClassList += labelClasses ? labelClasses : '';
50
- let inputClassList = 'border px-2 rounded-md ';
51
- inputClassList += inputClasses ? inputClasses : '';
52
- return /*#__PURE__*/_react.default.createElement("div", _extends({}, id && {
53
- id: id
60
+ if (inputProps == undefined) return;
61
+ const classList = (0, _classnames.default)({
62
+ [inputProps.classes]: inputProps === null || inputProps === void 0 ? void 0 : inputProps.classes
63
+ }, "flex flex-col");
64
+ const labelClassList = (0, _classnames.default)({
65
+ 'font-bold': inputProps === null || inputProps === void 0 ? void 0 : inputProps.bold,
66
+ [inputProps.labelClasses]: inputProps === null || inputProps === void 0 ? void 0 : inputProps.labelClasses
67
+ }, "w-auto");
68
+ const inputClassList = (0, _classnames.default)({
69
+ [inputProps.inputClasses]: inputProps === null || inputProps === void 0 ? void 0 : inputProps.inputClasses
70
+ }, "border px-2 rounded-md");
71
+ return /*#__PURE__*/_react.default.createElement("div", _extends({}, (inputProps === null || inputProps === void 0 ? void 0 : inputProps.id) && {
72
+ id: inputProps.id
54
73
  }, {
55
74
  className: classList
56
- }), label && /*#__PURE__*/_react.default.createElement("label", {
57
- id: "label-".concat(id),
75
+ }), (inputProps === null || inputProps === void 0 ? void 0 : inputProps.label) && /*#__PURE__*/_react.default.createElement("label", {
76
+ id: "label-".concat(inputProps === null || inputProps === void 0 ? void 0 : inputProps.id),
58
77
  className: labelClassList,
59
- htmlFor: "input-".concat(id)
60
- }, /*#__PURE__*/_react.default.createElement("p", null, label, " ", required && /*#__PURE__*/_react.default.createElement("span", {
78
+ htmlFor: "input-".concat(inputProps === null || inputProps === void 0 ? void 0 : inputProps.id)
79
+ }, /*#__PURE__*/_react.default.createElement("p", null, inputProps === null || inputProps === void 0 ? void 0 : inputProps.label, (inputProps === null || inputProps === void 0 ? void 0 : inputProps.required) && /*#__PURE__*/_react.default.createElement("span", {
61
80
  className: "text-red"
62
81
  }, "*"))), /*#__PURE__*/_react.default.createElement("input", {
63
- id: "input-".concat(id),
82
+ id: "input-".concat(inputProps === null || inputProps === void 0 ? void 0 : inputProps.id),
64
83
  className: inputClassList,
65
- autoComplete: autoComplete,
66
- disabled: disabled,
67
- form: formId,
68
- height: height,
69
- maxLength: maxLength,
70
- minLength: minLength,
71
- pattern: pattern,
72
- required: required,
73
- readOnly: readOnly,
74
- type: type,
75
- name: name,
76
- value: value,
77
- placeholder: placeholder,
78
- onChange: onChange,
79
- onBlur: onBlur,
80
- onFocus: onFocus
81
- }), hasValidation && /*#__PURE__*/_react.default.createElement("div", {
82
- id: "".concat(id, "-errors")
83
- }, errors && errors.map((error, i) => {
84
+ autoComplete: inputProps === null || inputProps === void 0 ? void 0 : inputProps.autoComplete,
85
+ disabled: inputProps === null || inputProps === void 0 ? void 0 : inputProps.disabled,
86
+ form: inputProps === null || inputProps === void 0 ? void 0 : inputProps.formId,
87
+ height: inputProps === null || inputProps === void 0 ? void 0 : inputProps.height,
88
+ maxLength: inputProps === null || inputProps === void 0 ? void 0 : inputProps.maxLength,
89
+ minLength: inputProps === null || inputProps === void 0 ? void 0 : inputProps.minLength,
90
+ pattern: inputProps === null || inputProps === void 0 ? void 0 : inputProps.pattern,
91
+ required: inputProps === null || inputProps === void 0 ? void 0 : inputProps.required,
92
+ readOnly: inputProps === null || inputProps === void 0 ? void 0 : inputProps.readOnly,
93
+ type: inputProps === null || inputProps === void 0 ? void 0 : inputProps.type,
94
+ name: inputProps === null || inputProps === void 0 ? void 0 : inputProps.name,
95
+ value: inputProps === null || inputProps === void 0 ? void 0 : inputProps.value,
96
+ placeholder: inputProps === null || inputProps === void 0 ? void 0 : inputProps.placeholder,
97
+ onChange: inputProps === null || inputProps === void 0 ? void 0 : inputProps.onChange,
98
+ onBlur: inputProps === null || inputProps === void 0 ? void 0 : inputProps.onBlur,
99
+ onFocus: inputProps === null || inputProps === void 0 ? void 0 : inputProps.onFocus
100
+ }), (inputProps === null || inputProps === void 0 ? void 0 : inputProps.hasValidation) && /*#__PURE__*/_react.default.createElement("div", {
101
+ id: "".concat(inputProps === null || inputProps === void 0 ? void 0 : inputProps.id, "-errors")
102
+ }, (inputProps === null || inputProps === void 0 ? void 0 : inputProps.errors) && (inputProps === null || inputProps === void 0 ? void 0 : inputProps.errors.map((error, i) => {
84
103
  return /*#__PURE__*/_react.default.createElement("p", {
85
104
  key: "error_msg_".concat(i + 0),
86
- className: "text-red text-sm",
87
- key: i
105
+ className: "text-red text-sm"
88
106
  }, error);
89
- })));
107
+ }))));
90
108
  };
91
109
 
110
+ Input.propTypes = {
111
+ inputProps: _propTypes.default.shape(_objectSpread({}, inputProps))
112
+ };
92
113
  var _default = Input;
93
114
  exports.default = _default;
@@ -13,6 +13,8 @@ var _Column = _interopRequireDefault(require("../Column"));
13
13
 
14
14
  var _Icon = _interopRequireDefault(require("../Icon"));
15
15
 
16
+ var _classnames = _interopRequireDefault(require("classnames"));
17
+
16
18
  require("../index.css");
17
19
 
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -50,107 +52,72 @@ const Nav = _ref => {
50
52
  borderBottom,
51
53
  borderBottomColor
52
54
  } = _ref;
53
- //---------- Styling ---------------
54
- const [styles, setStyles] = (0, _react.useState)({
55
- 'backgroundColor': mobileNavButtonBgColor ? mobileNavButtonBgColor : 'white',
56
- color: mobileNavButtonColor ? mobileNavButtonColor : 'black'
55
+ const [showSideNav, setShowSideNav] = (0, _react.useState)(false);
56
+ const [showDropdownNav, setShowDropdownNav] = (0, _react.useState)(false);
57
+ const navRowHeight = 'h-16';
58
+ const firstRowClassList = (0, _classnames.default)({
59
+ [firstRowClasses]: firstRowClasses
60
+ }, 'flex');
61
+ const secondRowClassList = (0, _classnames.default)({
62
+ [secondRowClasses]: secondRowClasses
63
+ }, 'flex');
64
+ const thirdRowClassList = (0, _classnames.default)({
65
+ [thirdRowClasses]: thirdRowClasses
66
+ }, 'flex');
67
+ const styles = (0, _classnames.default)({
68
+ [mobileNavButtonBgColor]: mobileNavButtonBgColor,
69
+ 'bg-white': !mobileNavButtonBgColor,
70
+ [mobileNavButtonColor]: mobileNavButtonColor,
71
+ 'text-black': !mobileNavButtonColor,
72
+ [hoverMobileNavButtonBgColor]: hoverMobileNavButtonBgColor,
73
+ 'hover:bg-black': !hoverMobileNavButtonBgColor,
74
+ [hoverMobileNavButtonColor]: hoverMobileNavButtonColor,
75
+ 'hover:text-white': !hoverMobileNavButtonColor
57
76
  });
58
-
59
- const setHoverState = isHovering => {
60
- if (isHovering) {
61
- setStyles({
62
- 'backgroundColor': hoverMobileNavButtonBgColor ? hoverMobileNavButtonBgColor : 'black',
63
- color: hoverMobileNavButtonColor ? hoverMobileNavButtonColor : 'white'
64
- });
65
- } else {
66
- setStyles({
67
- 'backgroundColor': mobileNavButtonBgColor ? mobileNavButtonBgColor : 'white',
68
- color: mobileNavButtonColor ? mobileNavButtonColor : 'black'
69
- });
70
- }
71
- };
72
-
73
- const [sideNavWidth, setSideNavWidth] = (0, _react.useState)({
74
- 'width': '0px',
75
- 'backgroundColor': mobileBgColor ? mobileBgColor : bgColor
77
+ const sideNavClasses = (0, _classnames.default)({
78
+ [mobileBgColor]: mobileBgColor,
79
+ 'bg-white': !mobileBgColor,
80
+ 'w-0': !showSideNav,
81
+ ["w-".concat(sideBarWidth)]: showSideNav
82
+ }, "z-50 shadow-inner shaddow-lg lg:hidden pt-20 \n fixed top-0 left-0 z-1 overflow-hidden h-full\n duration-700");
83
+ const dropdownNavClasses = (0, _classnames.default)({
84
+ [mobileBgColor]: mobileBgColor,
85
+ [bgColor]: !mobileBgColor && bgColor,
86
+ 'bg-white': !mobileBgColor && !bgColor,
87
+ 'h-0': !showDropdownNav,
88
+ ["h-".concat(dropdownNavHeight)]: showDropdownNav
89
+ }, 'z-50 lg:hidden duration-500 overflow-hidden');
90
+ const logoImageClassList = (0, _classnames.default)({
91
+ [mobileLogoBannerClasses]: mobileLogoBannerClasses
92
+ }, 'h-16 w-auto');
93
+ const mobileClassList = (0, _classnames.default)({
94
+ 'fixed w-full z-50 top-0 mt-0': fixedTop,
95
+ 'border-b': borderBottom,
96
+ [mobileClasses]: mobileClasses
97
+ }, 'flex items-center lg:hidden py-2');
98
+ const colors = (0, _classnames.default)({
99
+ [bgColor]: bgColor,
100
+ 'bg-blue': !bgColor,
101
+ [borderBottomColor]: borderBottomColor,
102
+ 'border-b-social-facebook': !borderBottomColor
76
103
  });
77
-
78
- const openSideNav = () => {
79
- setSideNavWidth({
80
- 'width': "".concat(sideBarWidth),
81
- 'backgroundColor': mobileBgColor ? mobileBgColor : bgColor,
82
- 'paddingRight': '10px'
83
- });
84
- };
85
-
86
- const closeSideNav = () => {
87
- setSideNavWidth({
88
- 'width': '0px',
89
- 'backgroundColor': mobileBgColor ? mobileBgColor : bgColor
90
- });
91
- };
92
-
93
- const [navDropdownNavHeight, setDropdownNavHeight] = (0, _react.useState)({
94
- 'heigth': '0px',
95
- 'backgroundColor': mobileBgColor ? mobileBgColor : bgColor
96
- });
97
-
98
- const openDropdownNav = () => {
99
- setDropdownNavHeight({
100
- 'height': "".concat(dropdownNavHeight, "px"),
101
- 'backgroundColor': mobileBgColor ? mobileBgColor : bgColor
102
- });
103
- };
104
-
105
- const closeDropdownNav = () => {
106
- setDropdownNavHeight({
107
- 'height': '0px',
108
- 'backgroundColor': mobileBgColor ? mobileBgColor : bgColor
109
- });
110
- };
111
-
112
- const [mobileMenuState, setmobileMenuState] = (0, _react.useState)(false);
113
-
114
- const toggleDropdownNav = () => {
115
- if (mobileMenuState) {
116
- closeDropdownNav();
117
- } else {
118
- openDropdownNav();
119
- }
120
-
121
- setmobileMenuState(!mobileMenuState);
122
- }; //-----------------------------------
123
-
124
-
125
- let logoImageClassList = "h-16 w-auto ";
126
- logoImageClassList += mobileLogoBannerClasses ? mobileLogoBannerClasses : '';
127
- let mobileClassList = "flex items-center lg:hidden py-2";
128
- mobileClassList += mobileClasses ? " ".concat(mobileClasses) : '';
129
- mobileClassList += fixedTop ? ' fixed w-full z-50 top-0 mt-0' : '';
130
- mobileClassList += borderBottom ? ' border-b' : '';
131
- let desktopClassList = 'hidden lg:block items-center justify-between sm:items-stretch text-center';
132
- desktopClassList += fixedTop ? ' fixed w-full z-50 top-0 mt-0' : '';
133
- desktopClassList += borderBottom ? ' border-b border-rose-500' : '';
104
+ const desktopClassList = (0, _classnames.default)({
105
+ 'fixed w-full z-50 top-0 mt-0': fixedTop,
106
+ 'border-b': borderBottom
107
+ }, 'hidden lg:block items-center justify-between sm:items-stretch text-center');
134
108
  return /*#__PURE__*/_react.default.createElement("nav", {
135
109
  id: id,
136
110
  className: classes
137
111
  }, /*#__PURE__*/_react.default.createElement("div", {
138
112
  id: "sm-nav",
139
- className: mobileClassList,
140
- style: {
141
- 'backgroundColor': bgColor,
142
- 'borderColor': borderBottomColor
143
- }
113
+ className: "".concat(mobileClassList, " ").concat(colors)
144
114
  }, /*#__PURE__*/_react.default.createElement("div", {
145
115
  id: "nav-collapse-btn-wrapper",
146
116
  className: "absolute inset-y-0 left-2 flex items-center"
147
117
  }, /*#__PURE__*/_react.default.createElement("button", {
148
- style: styles,
149
- onMouseOver: () => setHoverState(true),
150
- onMouseOut: () => setHoverState(false),
151
- onClick: asSideBar ? () => openSideNav() : () => toggleDropdownNav(),
118
+ onClick: asSideBar ? () => setShowSideNav(true) : () => setShowDropdownNav(!showDropdownNav),
152
119
  type: "button",
153
- className: "inline-flex items-center justify-center p-2 rounded-md focus:ring-2 focus:ring-inset focus:ring-white",
120
+ className: "inline-flex items-center justify-center \n p-2 rounded-md focus:ring-2 focus:ring-inset \n focus:ring-white ".concat(styles),
154
121
  "aria-controls": "mobile-menu",
155
122
  "aria-expanded": "false"
156
123
  }, /*#__PURE__*/_react.default.createElement("svg", {
@@ -178,59 +145,60 @@ const Nav = _ref => {
178
145
  }, /*#__PURE__*/_react.default.createElement("img", {
179
146
  className: logoImageClassList,
180
147
  src: mobileLogo,
181
- alt: " Logo "
148
+ alt: "Logo"
182
149
  }))), /*#__PURE__*/_react.default.createElement("div", {
183
- className: desktopClassList,
184
- style: {
185
- 'backgroundColor': bgColor,
186
- 'borderColor': borderBottomColor
187
- }
150
+ className: "".concat(desktopClassList, " ").concat(colors)
188
151
  }, /*#__PURE__*/_react.default.createElement("div", {
189
- className: 'flex ' + firstRowClasses
152
+ className: firstRowClassList
190
153
  }, firstRow && firstRow.map((rowItem, i) => {
191
154
  return /*#__PURE__*/_react.default.createElement(_Column.default, {
192
155
  key: "row_item_1.".concat(i),
193
- classes: rowItem.columnClasses ? "".concat(rowItem.columnClasses, " h-16") : 'h-16',
194
- sm: rowItem.smColumnWidth,
195
- md: rowItem.columnWidth,
196
- lg: rowItem.lgColumnWidth,
197
- xl: rowItem.xlColumnWidth
198
- }, /*#__PURE__*/_react.default.createElement("div", {
199
- className: rowItem.classes
200
- }, rowItem.component));
156
+ columnProps: {
157
+ classes: "".concat(navRowHeight, " ").concat(rowItem.columnClasses),
158
+ sm: rowItem.smColumnWidth,
159
+ md: rowItem.columnWidth,
160
+ lg: rowItem.lgColumnWidth,
161
+ xl: rowItem.xlColumnWidth,
162
+ children: rowItem.component
163
+ }
164
+ });
201
165
  })), /*#__PURE__*/_react.default.createElement("div", {
202
- className: 'flex ' + secondRowClasses
166
+ className: secondRowClassList
203
167
  }, secondRow && secondRow.map((rowItem, i) => {
204
168
  return /*#__PURE__*/_react.default.createElement(_Column.default, {
205
169
  key: "row_item_2.".concat(i),
206
- classes: "h-16",
207
- sm: rowItem.smColumnWidth,
208
- md: rowItem.columnWidth,
209
- lg: rowItem.lgColumnWidth,
210
- xl: rowItem.xlColumnWidth
211
- }, rowItem.component);
170
+ columnProps: {
171
+ classes: "".concat(navRowHeight, " ").concat(rowItem.columnClasses),
172
+ sm: rowItem.smColumnWidth,
173
+ md: rowItem.columnWidth,
174
+ lg: rowItem.lgColumnWidth,
175
+ xl: rowItem.xlColumnWidth,
176
+ children: rowItem.component
177
+ }
178
+ });
212
179
  })), /*#__PURE__*/_react.default.createElement("div", {
213
- className: 'flex ' + thirdRowClasses
180
+ className: thirdRowClassList
214
181
  }, thirdRow && thirdRow.map((rowItem, i) => {
215
182
  return /*#__PURE__*/_react.default.createElement(_Column.default, {
216
183
  key: "row_item_3.".concat(i),
217
- classes: "h-16",
218
- sm: rowItem.smColumnWidth,
219
- md: rowItem.columnWidth,
220
- lg: rowItem.lgColumnWidth,
221
- xl: rowItem.xlColumnWidth
222
- }, rowItem.component);
184
+ columnProps: {
185
+ classes: "".concat(navRowHeight, " ").concat(rowItem.columnClasses),
186
+ sm: rowItem.smColumnWidth,
187
+ md: rowItem.columnWidth,
188
+ lg: rowItem.lgColumnWidth,
189
+ xl: rowItem.xlColumnWidth,
190
+ children: rowItem.component
191
+ }
192
+ });
223
193
  }))), asSideBar ? /*#__PURE__*/_react.default.createElement("div", {
224
- style: sideNavWidth,
225
- className: "z-50 shadow-inner shaddow-lg lg:hidden pt-20 fixed top-0 left-0 z-1 overflow-hidden h-full w-0 duration-700"
194
+ className: sideNavClasses
226
195
  }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
227
- style: {
228
- 'color': mobileNavCloseColor
229
- },
230
- classes: "absolute top-7 left-7",
231
- onClick: () => closeSideNav(),
232
- type: "times",
233
- size: "2"
196
+ iconProps: {
197
+ classes: 'absolute top-7 left-7',
198
+ onClick: () => setShowSideNav(false),
199
+ type: 'times',
200
+ size: 2
201
+ }
234
202
  }), mobileItems && mobileItems.map((item, i) => {
235
203
  return /*#__PURE__*/_react.default.createElement("div", {
236
204
  key: "mobile_item_".concat(i),
@@ -241,8 +209,7 @@ const Nav = _ref => {
241
209
 
242
210
  /* dropdown */
243
211
  _react.default.createElement("div", {
244
- style: navDropdownNavHeight,
245
- className: "z-50 lg:hidden duration-500 overflow-hidden h-0",
212
+ className: dropdownNavClasses,
246
213
  id: "mobile-menu"
247
214
  }, /*#__PURE__*/_react.default.createElement("div", {
248
215
  className: "px-2 pt-2 pb-3 space-y-1"