trepur_components 0.3.0 → 0.3.3
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/Accordion/index.js +1 -19
- package/dist/components/AlertBar/index.js +82 -56
- package/dist/components/Breadcrumbs/index.js +31 -11
- package/dist/components/BreadcrumbsBordered/index.js +13 -11
- package/dist/components/BreadcrumbsItem/index.css +3 -23
- package/dist/components/BreadcrumbsItem/index.js +110 -138
- package/dist/components/Button/index.js +123 -117
- package/dist/components/Card/index.js +73 -163
- package/dist/components/CardWithTopImage/index.js +21 -24
- package/dist/components/Carousel/index.js +8 -4
- package/dist/components/CarouselV2/index.js +12 -10
- package/dist/components/Collapsible/index.js +85 -74
- package/dist/components/Column/index.js +36 -18
- package/dist/components/FyreCard/index.js +4 -23
- package/dist/components/Icon/index.js +66 -26
- package/dist/components/Image/index.js +36 -14
- package/dist/components/ImageLink/index.js +15 -7
- package/dist/components/ImageLinkList/index.js +5 -1
- package/dist/components/InformationIcon/index.js +74 -82
- package/dist/components/Input/index.js +82 -61
- package/dist/components/Nav/index.js +96 -129
- package/dist/components/NavItem/index.js +82 -71
- package/dist/components/NewsCard/index.js +26 -42
- package/dist/components/Profile/index.js +35 -23
- package/dist/components/Row/index.js +31 -10
- package/dist/components/Search/index.js +19 -25
- package/dist/components/SocialBlock/index.js +108 -84
- package/dist/components/StarRating/index.js +61 -31
- package/dist/components/Testimonial/index.js +22 -18
- package/dist/components/TextAndTitle/index.js +121 -99
- package/dist/components/TextArea/index.js +68 -47
- package/dist/components/Timeline/index.js +81 -51
- package/dist/components/Tubestops/index.js +62 -30
- package/dist/components/UserIcon/index.js +14 -10
- package/dist/components/Video/index.js +45 -34
- package/package.json +1 -1
|
@@ -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
|
-
|
|
54
|
-
const [
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
'
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
|
|
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: "
|
|
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:
|
|
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
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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:
|
|
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
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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:
|
|
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
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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
|
-
|
|
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
|
-
|
|
228
|
-
'
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
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
|
-
|
|
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"
|
|
@@ -1,102 +1,113 @@
|
|
|
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
|
-
exports.default = void 0;
|
|
8
|
+
exports.navItemProps = exports.default = 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
|
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
+
|
|
14
18
|
require("../index.css");
|
|
15
19
|
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
16
22
|
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); }
|
|
17
23
|
|
|
18
24
|
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; }
|
|
19
25
|
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
20
32
|
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); }
|
|
21
33
|
|
|
34
|
+
const navItemProps = {
|
|
35
|
+
id: _propTypes.default.string,
|
|
36
|
+
classes: _propTypes.default.string,
|
|
37
|
+
linkClasses: _propTypes.default.string,
|
|
38
|
+
name: _propTypes.default.string,
|
|
39
|
+
url: _propTypes.default.string,
|
|
40
|
+
onClick: _propTypes.default.func,
|
|
41
|
+
borderColor: _propTypes.default.string,
|
|
42
|
+
textColor: _propTypes.default.string,
|
|
43
|
+
bgColor: _propTypes.default.string,
|
|
44
|
+
hoverBorderColor: _propTypes.default.string,
|
|
45
|
+
hoverTextColor: _propTypes.default.string,
|
|
46
|
+
hoverBgColor: _propTypes.default.string,
|
|
47
|
+
bordered: _propTypes.default.bool,
|
|
48
|
+
rounded: _propTypes.default.bool,
|
|
49
|
+
underlineOnHover: _propTypes.default.bool,
|
|
50
|
+
isActive: _propTypes.default.bool,
|
|
51
|
+
activeBorderColor: _propTypes.default.string,
|
|
52
|
+
activeTextColor: _propTypes.default.string,
|
|
53
|
+
activeBgColor: _propTypes.default.string
|
|
54
|
+
};
|
|
55
|
+
exports.navItemProps = navItemProps;
|
|
56
|
+
|
|
22
57
|
const NavItem = _ref => {
|
|
23
58
|
let {
|
|
24
|
-
|
|
25
|
-
classes,
|
|
26
|
-
linkClasses,
|
|
27
|
-
name,
|
|
28
|
-
url,
|
|
29
|
-
onClick,
|
|
30
|
-
borderColor,
|
|
31
|
-
textColor,
|
|
32
|
-
bgColor,
|
|
33
|
-
hoverBorderColor,
|
|
34
|
-
hoverTextColor,
|
|
35
|
-
hoverBgColor,
|
|
36
|
-
bordered,
|
|
37
|
-
rounded,
|
|
38
|
-
underlineOnHover,
|
|
39
|
-
isActive,
|
|
40
|
-
activeBorderColor,
|
|
41
|
-
activeTextColor,
|
|
42
|
-
activeBgColor
|
|
59
|
+
navItemProps
|
|
43
60
|
} = _ref;
|
|
44
|
-
|
|
45
|
-
classList
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
linkClassList
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
if (navItemProps == undefined) return;
|
|
62
|
+
const classList = (0, _classnames.default)({
|
|
63
|
+
[navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.classes]: navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.classes
|
|
64
|
+
}, 'w-auto list-none');
|
|
65
|
+
const linkClassList = (0, _classnames.default)({
|
|
66
|
+
'active': navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.isActive,
|
|
67
|
+
'border': navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.bordered,
|
|
68
|
+
'rounded-lg': navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.rounded,
|
|
69
|
+
'hover:underline': navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.underlineOnHover,
|
|
70
|
+
[navItemProps.linkClasses]: navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.linkClasses
|
|
71
|
+
}, 'px-4 mx-2 mb-4 text-center whitespace-nowrap');
|
|
72
|
+
const styleClasses = (0, _classnames.default)({
|
|
73
|
+
[navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.bgColor]: navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.bgColor,
|
|
74
|
+
'bg-black': !(navItemProps !== null && navItemProps !== void 0 && navItemProps.bgColor),
|
|
75
|
+
[navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.textColor]: navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.textColor,
|
|
76
|
+
'text-white': !(navItemProps !== null && navItemProps !== void 0 && navItemProps.textColor),
|
|
77
|
+
[navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.borderColor]: navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.borderColor,
|
|
78
|
+
'border-black': !(navItemProps !== null && navItemProps !== void 0 && navItemProps.borderColor)
|
|
57
79
|
});
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
80
|
+
const activeStyleClasses = (0, _classnames.default)({
|
|
81
|
+
[navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.activeBgColor]: navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.activeBgColor,
|
|
82
|
+
'bg-blue': !(navItemProps !== null && navItemProps !== void 0 && navItemProps.activeBgColor),
|
|
83
|
+
[navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.activeTextColor]: navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.activeTextColor,
|
|
84
|
+
'text-white': !(navItemProps !== null && navItemProps !== void 0 && navItemProps.activeTextColor),
|
|
85
|
+
[navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.activeBorderColor]: navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.activeBorderColor,
|
|
86
|
+
'border-blue': !(navItemProps !== null && navItemProps !== void 0 && navItemProps.activeBorderColor)
|
|
62
87
|
});
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
'backgroundColor': activeBgColor ? activeBgColor : 'white',
|
|
75
|
-
color: activeTextColor ? activeTextColor : 'black',
|
|
76
|
-
'borderColor': activeBorderColor ? activeBorderColor : 'black'
|
|
77
|
-
}) : setStyles({
|
|
78
|
-
'backgroundColor': bgColor ? bgColor : 'white',
|
|
79
|
-
color: textColor ? textColor : 'black',
|
|
80
|
-
'borderColor': borderColor ? borderColor : 'black'
|
|
81
|
-
});
|
|
82
|
-
}; //-----------------------------------
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return /*#__PURE__*/_react.default.createElement("div", _extends({}, id && {
|
|
86
|
-
id: id
|
|
88
|
+
const hoverStyles = (0, _classnames.default)({
|
|
89
|
+
[navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.hoverBgColor]: navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.hoverBgColor,
|
|
90
|
+
'hover:bg-white': !(navItemProps !== null && navItemProps !== void 0 && navItemProps.hoverBgColor),
|
|
91
|
+
[navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.hoverTextColor]: navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.hoverTextColor,
|
|
92
|
+
'hover:text-black': !(navItemProps !== null && navItemProps !== void 0 && navItemProps.hoverTextColor),
|
|
93
|
+
[navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.hoverBorderColor]: navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.hoverBorderColor,
|
|
94
|
+
'hover:border-black': !(navItemProps !== null && navItemProps !== void 0 && navItemProps.hoverBorderColor)
|
|
95
|
+
});
|
|
96
|
+
const c = navItemProps !== null && navItemProps !== void 0 && navItemProps.isActive ? activeStyleClasses : styleClasses;
|
|
97
|
+
return /*#__PURE__*/_react.default.createElement("div", _extends({}, (navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.id) && {
|
|
98
|
+
id: navItemProps.id
|
|
87
99
|
}, {
|
|
88
100
|
className: classList
|
|
89
101
|
}), /*#__PURE__*/_react.default.createElement("a", {
|
|
90
|
-
href: url
|
|
102
|
+
href: navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.url
|
|
91
103
|
}, /*#__PURE__*/_react.default.createElement("li", {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
key: name,
|
|
96
|
-
className: linkClassList,
|
|
97
|
-
onClick: onClick
|
|
98
|
-
}, name)));
|
|
104
|
+
className: "".concat(linkClassList, " ").concat(hoverStyles, " ").concat(c),
|
|
105
|
+
onClick: navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.onClick
|
|
106
|
+
}, navItemProps === null || navItemProps === void 0 ? void 0 : navItemProps.name)));
|
|
99
107
|
};
|
|
100
108
|
|
|
109
|
+
NavItem.propTypes = {
|
|
110
|
+
navItemProps: _propTypes.default.shape(_objectSpread({}, navItemProps))
|
|
111
|
+
};
|
|
101
112
|
var _default = NavItem;
|
|
102
113
|
exports.default = _default;
|
|
@@ -11,10 +11,10 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
|
|
12
12
|
var _Image = _interopRequireDefault(require("../Image"));
|
|
13
13
|
|
|
14
|
-
var _Column = _interopRequireDefault(require("../Column"));
|
|
15
|
-
|
|
16
14
|
var _Button = _interopRequireDefault(require("../Button"));
|
|
17
15
|
|
|
16
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
+
|
|
18
18
|
require("../index.css");
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -27,53 +27,37 @@ const NewsCard = _ref => {
|
|
|
27
27
|
classes,
|
|
28
28
|
title,
|
|
29
29
|
content,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
buttonType,
|
|
33
|
-
url,
|
|
34
|
-
buttonBgColor,
|
|
35
|
-
buttonTextColor,
|
|
36
|
-
buttonBorderColor,
|
|
37
|
-
hoverButtonBgColor,
|
|
38
|
-
hoverButtonTextColor,
|
|
39
|
-
hoverButtonBorderColor,
|
|
40
|
-
buttonDesign,
|
|
30
|
+
imageProps,
|
|
31
|
+
buttonProps,
|
|
41
32
|
rounded,
|
|
42
33
|
boldTitle
|
|
43
34
|
} = _ref;
|
|
44
|
-
const roundedClasses =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
const roundedClasses = (0, _classnames.default)({
|
|
36
|
+
'rounded-lg': rounded
|
|
37
|
+
});
|
|
38
|
+
const titleBold = (0, _classnames.default)({
|
|
39
|
+
'font-bold': boldTitle
|
|
40
|
+
});
|
|
41
|
+
const classList = (0, _classnames.default)({
|
|
42
|
+
'rounded-lg': rounded,
|
|
43
|
+
[classes]: classes
|
|
44
|
+
}, 'border flex p-2');
|
|
45
|
+
imageProps.classes = roundedClasses;
|
|
48
46
|
return /*#__PURE__*/_react.default.createElement("div", _extends({}, id && {
|
|
49
47
|
id: id
|
|
50
48
|
}, {
|
|
51
49
|
className: classList
|
|
52
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}, boldTitle ? /*#__PURE__*/_react.default.createElement("b", null, /*#__PURE__*/_react.default.createElement("p", null, title)) : /*#__PURE__*/_react.default.createElement("p", null, title), /*#__PURE__*/_react.default.createElement("p", null, content), ctaText && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Button.default, _extends({
|
|
64
|
-
className: "w-full",
|
|
65
|
-
ctaText: ctaText,
|
|
66
|
-
buttonType: buttonType,
|
|
67
|
-
url: url,
|
|
68
|
-
bgColor: buttonBgColor,
|
|
69
|
-
textColor: buttonTextColor,
|
|
70
|
-
borderColor: buttonBorderColor,
|
|
71
|
-
hoverBgColor: hoverButtonBgColor,
|
|
72
|
-
hoverTextColor: hoverButtonTextColor,
|
|
73
|
-
hoverBorderColor: hoverButtonBorderColor
|
|
74
|
-
}, buttonDesign && {
|
|
75
|
-
buttonDesign: buttonDesign
|
|
76
|
-
})))));
|
|
50
|
+
}), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Image.default, {
|
|
51
|
+
imageProps: imageProps
|
|
52
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
53
|
+
className: "flex flex-col justify-between expandable w-auto text-center"
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
55
|
+
className: titleBold
|
|
56
|
+
}, title), /*#__PURE__*/_react.default.createElement("p", null, content), buttonProps && /*#__PURE__*/_react.default.createElement("div", {
|
|
57
|
+
className: "px-8"
|
|
58
|
+
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
59
|
+
buttonProps: buttonProps
|
|
60
|
+
}))));
|
|
77
61
|
};
|
|
78
62
|
|
|
79
63
|
var _default = NewsCard;
|