argous 1.2.216 → 1.2.217

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 (41) hide show
  1. package/dist/components/Carousel/Carousel.d.ts +71 -0
  2. package/dist/components/Carousel/Carousel.js +225 -0
  3. package/dist/components/Carousel/index.d.ts +2 -0
  4. package/dist/components/Carousel/index.js +8 -0
  5. package/dist/components/TextToHtml/Cursor.d.ts +7 -0
  6. package/dist/components/TextToHtml/Cursor.js +39 -0
  7. package/dist/components/TextToHtml/TextStyles.d.ts +11 -0
  8. package/dist/components/TextToHtml/TextStyles.js +124 -0
  9. package/dist/components/TextToHtml/TextToHtml.d.ts +38 -0
  10. package/dist/components/TextToHtml/TextToHtml.js +484 -0
  11. package/dist/components/TextToHtml/index.d.ts +2 -0
  12. package/dist/components/TextToHtml/index.js +8 -0
  13. package/dist/components/TextToHtml/utils.d.ts +27 -0
  14. package/dist/components/TextToHtml/utils.js +798 -0
  15. package/dist/components/Zoom/Zoom.d.ts +11 -0
  16. package/dist/components/Zoom/Zoom.js +67 -0
  17. package/dist/components/Zoom/index.d.ts +2 -0
  18. package/dist/components/Zoom/index.js +8 -0
  19. package/dist/components/index.d.ts +10 -1
  20. package/dist/components/index.js +11 -1
  21. package/lib/components/Carousel/Carousel.d.ts +71 -0
  22. package/lib/components/Carousel/Carousel.js +218 -0
  23. package/lib/components/Carousel/index.d.ts +2 -0
  24. package/lib/components/Carousel/index.js +1 -0
  25. package/lib/components/TextToHtml/Cursor.js +24 -0
  26. package/lib/components/TextToHtml/TextStyles.js +111 -0
  27. package/lib/components/TextToHtml/TextToHtml.d.ts +38 -0
  28. package/lib/components/TextToHtml/TextToHtml.js +463 -0
  29. package/lib/components/TextToHtml/icons/resize_area.svg +2 -0
  30. package/lib/components/TextToHtml/index.d.ts +2 -0
  31. package/lib/components/TextToHtml/index.js +1 -0
  32. package/lib/components/TextToHtml/style.css +40 -0
  33. package/lib/components/TextToHtml/utils.js +848 -0
  34. package/lib/components/Zoom/Zoom.d.ts +11 -0
  35. package/lib/components/Zoom/Zoom.js +56 -0
  36. package/lib/components/Zoom/index.d.ts +2 -0
  37. package/lib/components/Zoom/index.js +1 -0
  38. package/lib/components/Zoom/style.css +25 -0
  39. package/lib/components/index.d.ts +10 -1
  40. package/lib/components/index.js +11 -1
  41. package/package.json +2 -1
@@ -0,0 +1,11 @@
1
+ export interface ZoomProps {
2
+ /**
3
+ * ID
4
+ */
5
+ id: string
6
+ }
7
+
8
+
9
+ declare function Zoom(props: ZoomProps) : JSX.Element
10
+
11
+ export default Zoom;
@@ -0,0 +1,56 @@
1
+ import clsx from 'clsx';
2
+ import React, { useCallback, useEffect, useState } from 'react';
3
+ import './style.css';
4
+
5
+
6
+ const Zoom = ({ id, children }) => {
7
+
8
+ const figureId = (id) ? `${id}-zoom-figure` : 'zoom-figure';
9
+ const [active, setActive] = useState(false);
10
+
11
+ const copyMediaUrl = useCallback(() => {
12
+ const figureElement = document.getElementById(figureId);
13
+ const mediaElement = figureElement.children?.[0];
14
+ if (mediaElement) figureElement.style.backgroundImage = "url('" + mediaElement.src + "')";
15
+ }, [figureId]);
16
+ useEffect(() => setTimeout(() => copyMediaUrl(), 500), [copyMediaUrl]);
17
+
18
+ function zoom(e, activeParameter) {
19
+ if (active || activeParameter) {
20
+ let offsetX, offsetY, x, y;
21
+ const figureElement = document.getElementById(figureId);
22
+
23
+ if (figureElement) {
24
+ if (e?.nativeEvent?.offsetX) offsetX = e.nativeEvent.offsetX;
25
+ else offsetX = e?.touches?.[0].pageX;
26
+ if (e?.nativeEvent?.offsetY) offsetY = e.nativeEvent.offsetY;
27
+ else offsetX = e?.touches?.[0].pageX;
28
+
29
+ x = ((offsetX / figureElement.offsetWidth) * 100);
30
+ y = ((offsetY / figureElement.offsetHeight) * 100);
31
+
32
+ figureElement.style.backgroundPosition = `${x}% ${y}%`;
33
+ }
34
+ }
35
+ }
36
+
37
+ const handleActive = e => {
38
+ const state = !active;
39
+ setActive(state);
40
+ (state) && zoom(e, state);
41
+ };
42
+
43
+
44
+ return <figure
45
+ id={figureId}
46
+ onMouseMove={zoom}
47
+ onTouchMove={zoom}
48
+ onClick={handleActive}
49
+ className={clsx('zoom-figure', { 'zoom-figure-active': active })}
50
+ >
51
+ {children}
52
+ </figure>;
53
+ };
54
+
55
+
56
+ export default Zoom;
@@ -0,0 +1,2 @@
1
+ export { default } from './Zoom';
2
+ export * from './Zoom';
@@ -0,0 +1 @@
1
+ export { default } from './Zoom';
@@ -0,0 +1,25 @@
1
+ figure.zoom-figure {
2
+ position: relative;
3
+ overflow: hidden;
4
+ cursor: zoom-in;
5
+ cursor: -moz-zoom-in;
6
+ cursor: -webkit-zoom-in;
7
+ background-repeat: no-repeat;
8
+ background-position: 50% 50%;
9
+
10
+ img {
11
+ transition: opacity 250ms;
12
+ display: block;
13
+ width: 100%;
14
+ }
15
+ }
16
+
17
+ figure.zoom-figure-active {
18
+ cursor: zoom-out;
19
+ cursor: -moz-zoom-out;
20
+ cursor: -webkit-zoom-out;
21
+
22
+ & img:hover {
23
+ opacity: 0;
24
+ }
25
+ }
@@ -157,4 +157,13 @@ export { default as HalfGauge } from './HalfGauge';
157
157
  export * from './HalfGauge';
158
158
 
159
159
  export { default as UserCard } from './UserCard';
160
- export * from './UserCard';
160
+ export * from './UserCard';
161
+
162
+ export { default as TextToHtml } from './TextToHtml';
163
+ export * from './TextToHtml';
164
+
165
+ export { default as Zoom } from './Zoom';
166
+ export * from './Zoom';
167
+
168
+ export { default as Carousel } from './Carousel';
169
+ export * from './Carousel';
@@ -154,4 +154,14 @@ export * from './PercentageDisplay';
154
154
  export { default as HalfGauge } from './HalfGauge';
155
155
  export * from './HalfGauge';
156
156
 
157
- export { default as UserCard } from './UserCard';
157
+ export { default as UserCard } from './UserCard';
158
+ export * from './UserCard';
159
+
160
+ export { default as TextToHtml } from './TextToHtml';
161
+ export * from './TextToHtml';
162
+
163
+ export { default as Zoom } from './Zoom';
164
+ export * from './Zoom';
165
+
166
+ export { default as Carousel } from './Carousel';
167
+ export * from './Carousel';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "argous",
3
- "version": "1.2.216",
3
+ "version": "1.2.217",
4
4
  "description": "Argous.",
5
5
  "main": "lib/index.js",
6
6
  "author": "Carlos Schneider",
@@ -98,6 +98,7 @@
98
98
  "dependencies": {
99
99
  "highlight.js": "^10.7.1",
100
100
  "jquery": "^3.6.0",
101
+ "react-colorful": "^5.6.1",
101
102
  "react-date-range": "0.9.4",
102
103
  "react-paginate": "^7.1.2",
103
104
  "react-transition-group": "^4.4.1",