trepur_components 0.3.30 → 0.3.33
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/Image/index.js +47 -4
- package/dist/index.js +8 -0
- package/package.json +1 -1
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.object.assign.js");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.imageProps = exports.default = void 0;
|
|
7
9
|
|
|
8
|
-
require("core-js/modules/
|
|
10
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
9
11
|
|
|
10
|
-
var _react =
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
13
|
|
|
12
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
15
|
|
|
@@ -15,6 +17,10 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
15
17
|
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
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
|
+
|
|
18
24
|
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; }
|
|
19
25
|
|
|
20
26
|
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; }
|
|
@@ -37,11 +43,46 @@ const Image = _ref => {
|
|
|
37
43
|
let {
|
|
38
44
|
imageProps
|
|
39
45
|
} = _ref;
|
|
46
|
+
const [isHovering, setIsHovering] = (0, _react.useState)(false);
|
|
47
|
+
const widthClassList = (0, _classnames.default)({
|
|
48
|
+
'w-6': imageProps.width === 1,
|
|
49
|
+
'w-10': imageProps.width === 2,
|
|
50
|
+
'w-14': imageProps.width === 3,
|
|
51
|
+
'w-16': imageProps.width === 4,
|
|
52
|
+
'w-20': imageProps.width === 5,
|
|
53
|
+
'w-24': imageProps.width === 6,
|
|
54
|
+
'w-28': imageProps.width === 7,
|
|
55
|
+
'w-32': imageProps.width === 8,
|
|
56
|
+
'w-36': imageProps.width === 9,
|
|
57
|
+
'w-40': imageProps.width === 10,
|
|
58
|
+
'w-44': imageProps.width === 11
|
|
59
|
+
});
|
|
60
|
+
const heightClassList = (0, _classnames.default)({
|
|
61
|
+
'h-6': imageProps.height === 1,
|
|
62
|
+
'h-10': imageProps.height === 2,
|
|
63
|
+
'h-14': imageProps.height === 3,
|
|
64
|
+
'h-16': imageProps.height === 4,
|
|
65
|
+
'h-20': imageProps.height === 5,
|
|
66
|
+
'h-24': imageProps.height === 6,
|
|
67
|
+
'h-28': imageProps.height === 7,
|
|
68
|
+
'h-32': imageProps.height === 8,
|
|
69
|
+
'h-36': imageProps.height === 9,
|
|
70
|
+
'h-40': imageProps.height === 10,
|
|
71
|
+
'h-44': imageProps.height === 11
|
|
72
|
+
});
|
|
40
73
|
const classList = (0, _classnames.default)({
|
|
41
74
|
[imageProps === null || imageProps === void 0 ? void 0 : imageProps.classes]: imageProps === null || imageProps === void 0 ? void 0 : imageProps.classes,
|
|
42
75
|
'rounded-full': imageProps === null || imageProps === void 0 ? void 0 : imageProps.rounded
|
|
43
|
-
});
|
|
44
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
76
|
+
}, widthClassList, heightClassList);
|
|
77
|
+
return /*#__PURE__*/_react.default.createElement("div", null, (imageProps === null || imageProps === void 0 ? void 0 : imageProps.imageName) && /*#__PURE__*/_react.default.createElement("div", {
|
|
78
|
+
className: "fixed ".concat(widthClassList, " ").concat(heightClassList, " top-0 left-0 right-0 bottom-0 z-10 bg-white transition-opacity duration-700 ").concat(isHovering ? 'opacity-50' : 'opacity-0')
|
|
79
|
+
}), (imageProps === null || imageProps === void 0 ? void 0 : imageProps.imageName) && /*#__PURE__*/_react.default.createElement("div", {
|
|
80
|
+
className: "flex fixed ".concat(widthClassList, " ").concat(heightClassList, " top-0 left-0 right-0 bottom-0 z-20 transition-opacity duration-700 ").concat(isHovering ? 'opacity-100' : 'opacity-0'),
|
|
81
|
+
onMouseEnter: () => setIsHovering(true),
|
|
82
|
+
onMouseLeave: () => setIsHovering(false)
|
|
83
|
+
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
84
|
+
className: "m-auto text-center"
|
|
85
|
+
}, imageProps === null || imageProps === void 0 ? void 0 : imageProps.imageName)), /*#__PURE__*/_react.default.createElement("img", _extends({}, (imageProps === null || imageProps === void 0 ? void 0 : imageProps.id) && {
|
|
45
86
|
id: imageProps === null || imageProps === void 0 ? void 0 : imageProps.id
|
|
46
87
|
}, {
|
|
47
88
|
className: classList,
|
|
@@ -50,6 +91,8 @@ const Image = _ref => {
|
|
|
50
91
|
alt: imageProps === null || imageProps === void 0 ? void 0 : imageProps.altText
|
|
51
92
|
}, (imageProps === null || imageProps === void 0 ? void 0 : imageProps.title) && {
|
|
52
93
|
title: imageProps === null || imageProps === void 0 ? void 0 : imageProps.title
|
|
94
|
+
})), (imageProps === null || imageProps === void 0 ? void 0 : imageProps.imageName) && isHovering && /*#__PURE__*/_react.default.createElement("p", {
|
|
95
|
+
className: "".concat(widthClassList, " text-center ").concat(isHovering ? 'block' : 'hidden')
|
|
53
96
|
}));
|
|
54
97
|
};
|
|
55
98
|
|
package/dist/index.js
CHANGED
|
@@ -99,6 +99,12 @@ Object.defineProperty(exports, "FyreCard", {
|
|
|
99
99
|
return _FyreCard.default;
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
|
+
Object.defineProperty(exports, "Greeting", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function get() {
|
|
105
|
+
return _Greeting.default;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
102
108
|
Object.defineProperty(exports, "Icon", {
|
|
103
109
|
enumerable: true,
|
|
104
110
|
get: function get() {
|
|
@@ -258,6 +264,8 @@ var _FooterBar = _interopRequireDefault(require("./components/FooterBar"));
|
|
|
258
264
|
|
|
259
265
|
var _FyreCard = _interopRequireDefault(require("./components/FyreCard"));
|
|
260
266
|
|
|
267
|
+
var _Greeting = _interopRequireDefault(require("./components/Greeting"));
|
|
268
|
+
|
|
261
269
|
var _Icon = _interopRequireDefault(require("./components/Icon"));
|
|
262
270
|
|
|
263
271
|
var _Image = _interopRequireDefault(require("./components/Image"));
|