trepur_components 0.3.31 → 0.3.34

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.
@@ -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/es.object.assign.js");
10
+ require("core-js/modules/web.dom-collections.iterator.js");
9
11
 
10
- var _react = _interopRequireDefault(require("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,19 +43,57 @@ 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("img", _extends({}, (imageProps === null || imageProps === void 0 ? void 0 : imageProps.id) && {
76
+ }, widthClassList, heightClassList, 'ml-16');
77
+ return /*#__PURE__*/_react.default.createElement("div", {
78
+ className: classList
79
+ }, (imageProps === null || imageProps === void 0 ? void 0 : imageProps.imageName) && /*#__PURE__*/_react.default.createElement("div", {
80
+ className: "absolute ".concat(widthClassList, " ").concat(heightClassList, " z-10 bg-white transition-opacity duration-700 ").concat(isHovering ? 'opacity-50' : 'opacity-0')
81
+ }), (imageProps === null || imageProps === void 0 ? void 0 : imageProps.imageName) && /*#__PURE__*/_react.default.createElement("div", {
82
+ className: "flex absolute ".concat(widthClassList, " ").concat(heightClassList, " z-20 transition-opacity duration-700 ").concat(isHovering ? 'opacity-100' : 'opacity-0'),
83
+ onMouseEnter: () => setIsHovering(true),
84
+ onMouseLeave: () => setIsHovering(false)
85
+ }, /*#__PURE__*/_react.default.createElement("p", {
86
+ className: "m-auto text-center"
87
+ }, 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
88
  id: imageProps === null || imageProps === void 0 ? void 0 : imageProps.id
46
89
  }, {
47
- className: classList,
48
90
  src: imageProps === null || imageProps === void 0 ? void 0 : imageProps.image
49
91
  }, (imageProps === null || imageProps === void 0 ? void 0 : imageProps.altText) && {
50
92
  alt: imageProps === null || imageProps === void 0 ? void 0 : imageProps.altText
51
93
  }, (imageProps === null || imageProps === void 0 ? void 0 : imageProps.title) && {
52
94
  title: imageProps === null || imageProps === void 0 ? void 0 : imageProps.title
95
+ })), (imageProps === null || imageProps === void 0 ? void 0 : imageProps.imageName) && isHovering && /*#__PURE__*/_react.default.createElement("p", {
96
+ className: "".concat(widthClassList, " text-center ").concat(isHovering ? 'block' : 'hidden')
53
97
  }));
54
98
  };
55
99
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "trepur_components",
3
3
  "description": "component lib",
4
4
  "author": "trepur_ttenneb",
5
- "version": "0.3.31",
5
+ "version": "0.3.34",
6
6
  "private": false,
7
7
  "keywords": [
8
8
  "react",