funuicss 2.0.25 → 2.5.0

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 (72) hide show
  1. package/css/fun.css +1002 -3749
  2. package/js/Fun.js +2 -2
  3. package/js/Fun.tsx +9 -8
  4. package/package.json +2 -1
  5. package/tsconfig.tsbuildinfo +1 -1
  6. package/ui/alert/Alert.d.ts +1 -1
  7. package/ui/aos/AOS.d.ts +1 -1
  8. package/ui/appbar/AppBar.d.ts +1 -1
  9. package/ui/avatar/Avatar.d.ts +2 -1
  10. package/ui/breadcrumb/BreadCrumb.d.ts +2 -1
  11. package/ui/button/Button.d.ts +1 -1
  12. package/ui/card/Card.d.ts +1 -1
  13. package/ui/card/CardBody.d.ts +2 -2
  14. package/ui/card/CardFab.d.ts +2 -2
  15. package/ui/card/CardFooter.d.ts +2 -2
  16. package/ui/card/CardHeader.d.ts +2 -2
  17. package/ui/div/Div.d.ts +1 -1
  18. package/ui/drop/Action.d.ts +1 -1
  19. package/ui/drop/Down.d.ts +1 -1
  20. package/ui/drop/Item.d.ts +1 -1
  21. package/ui/drop/Menu.d.ts +1 -1
  22. package/ui/drop/Up.d.ts +1 -1
  23. package/ui/grid/Col.d.ts +2 -1
  24. package/ui/grid/Grid.d.ts +2 -1
  25. package/ui/input/Iconic.d.ts +2 -2
  26. package/ui/input/Input.d.ts +2 -0
  27. package/ui/input/Input.js +50 -9
  28. package/ui/input/Input.tsx +34 -7
  29. package/ui/list/Item.d.ts +1 -1
  30. package/ui/list/List.d.ts +1 -1
  31. package/ui/loader/Loader.d.ts +2 -1
  32. package/ui/modal/Action.d.ts +1 -1
  33. package/ui/modal/Close.d.ts +2 -1
  34. package/ui/modal/Content.d.ts +1 -1
  35. package/ui/modal/Header.d.ts +2 -2
  36. package/ui/modal/Header.tsx +1 -1
  37. package/ui/modal/Modal.d.ts +1 -1
  38. package/ui/notification/Content.d.ts +1 -1
  39. package/ui/notification/Footer.d.ts +1 -1
  40. package/ui/notification/Header.d.ts +1 -1
  41. package/ui/notification/Notification.d.ts +1 -1
  42. package/ui/page/NotFound.d.ts +1 -1
  43. package/ui/page/UnAuthorized.d.ts +1 -1
  44. package/ui/progress/Bar.d.ts +1 -1
  45. package/ui/sidebar/SideBar.d.ts +2 -1
  46. package/ui/sidebar/SideContent.d.ts +1 -1
  47. package/ui/specials/Circle.d.ts +3 -2
  48. package/ui/specials/Circle.js +2 -2
  49. package/ui/specials/Circle.tsx +4 -2
  50. package/ui/specials/FullCenteredPage.d.ts +1 -1
  51. package/ui/specials/Hr.d.ts +1 -1
  52. package/ui/specials/RowFlex.d.ts +1 -1
  53. package/ui/specials/Section.d.ts +1 -1
  54. package/ui/table/Body.d.ts +1 -1
  55. package/ui/table/Data.d.ts +1 -1
  56. package/ui/table/Head.d.ts +1 -1
  57. package/ui/table/Row.d.ts +1 -1
  58. package/ui/table/Table.d.ts +1 -1
  59. package/ui/table/Table.js +11 -7
  60. package/ui/table/Table.tsx +20 -8
  61. package/ui/text/Text.d.ts +5 -5
  62. package/ui/text/Text.js +20 -11
  63. package/ui/text/Text.tsx +62 -33
  64. package/ui/tooltip/Tip.d.ts +2 -1
  65. package/ui/tooltip/Tip.js +9 -5
  66. package/ui/tooltip/Tip.tsx +12 -2
  67. package/ui/tooltip/ToolTip.d.ts +1 -1
  68. package/ui/tooltip/ToolTip.js +1 -1
  69. package/ui/tooltip/ToolTip.tsx +7 -1
  70. package/ui/video/FunPlayer.d.ts +0 -7
  71. package/ui/video/FunPlayer.js +202 -179
  72. package/ui/video/FunPlayer.tsx +218 -218
@@ -1,221 +1,221 @@
1
- import React, { useState, useRef, useEffect } from 'react';
2
- import { PiCornersOut, PiDownload, PiFastForward, PiFileAudio, PiPause, PiPlay, PiRewind, PiSpeakerHifi, PiSpeakerLow } from 'react-icons/pi';
3
- import ToolTip from "../tooltip/ToolTip"
4
- import RowFlex from '../specials/RowFlex';
5
- import Button from '../button/Button'
6
- import Text from '../text/Text'
7
- import Tip from '../tooltip/Tip'
8
-
9
- interface VideoProps {
10
- src: string;
11
- autoPlay: boolean;
12
- onDuration?: (duration: number) => void;
13
- }
14
-
15
- export default function Video({ src, autoPlay, onDuration }: VideoProps) {
16
- const videoRef = useRef<HTMLVideoElement>(null);
17
- const [isPlaying, setIsPlaying] = useState<boolean>(autoPlay);
18
- const [currentTime, setCurrentTime] = useState<number>(0);
19
- const [duration, setDuration] = useState<number>(0);
20
- const [volume, setVolume] = useState<number>(1);
21
- const [isFullScreen, setIsFullScreen] = useState<boolean>(false);
22
- const [showVolume, setShowVolume] = useState<boolean>(false);
23
-
24
- useEffect(() => {
25
- if (!videoRef.current) return;
26
-
27
- const handleTimeUpdate = () => {
28
- setCurrentTime(videoRef.current.currentTime);
29
- };
30
-
31
- const handleDurationChange = () => {
32
- const newDuration = videoRef.current.duration;
33
- setDuration(newDuration);
34
- onDuration && onDuration(newDuration);
35
- };
36
-
37
- videoRef.current.addEventListener('timeupdate', handleTimeUpdate);
38
- videoRef.current.addEventListener('durationchange', handleDurationChange);
39
-
40
- return () => {
41
- videoRef.current?.removeEventListener('timeupdate', handleTimeUpdate);
42
- videoRef.current?.removeEventListener('durationchange', handleDurationChange);
43
- };
44
- }, [onDuration]);
45
-
46
- const formatTime = (time: number) => {
47
- const minutes = Math.floor(time / 60);
48
- const seconds = Math.floor(time % 60);
49
- return `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
50
- };
51
-
52
- const handlePlay = () => {
53
- videoRef.current?.play();
54
- setIsPlaying(true);
55
- };
56
-
57
- const handlePause = () => {
58
- videoRef.current?.pause();
59
- setIsPlaying(false);
60
- };
61
-
62
- const handleStop = () => {
63
- videoRef.current?.pause();
64
- videoRef.current.currentTime = 0;
65
- setIsPlaying(false);
66
- };
67
-
68
- const handleRewind = () => {
69
- if (videoRef.current) videoRef.current.currentTime -= 10; // Rewind 10 seconds
70
- };
71
-
72
- const handleForward = () => {
73
- if (videoRef.current) videoRef.current.currentTime += 10; // Forward 10 seconds
74
- };
75
-
76
- const handleToggleFullScreen = () => {
77
- if (videoRef.current) {
78
- if (videoRef.current.requestFullscreen) {
79
- videoRef.current.requestFullscreen();
80
- } else if (videoRef.current.mozRequestFullScreen) {
81
- videoRef.current.mozRequestFullScreen();
82
- } else if (videoRef.current.webkitRequestFullscreen) {
83
- videoRef.current.webkitRequestFullscreen();
84
- } else if (videoRef.current.msRequestFullscreen) {
85
- videoRef.current.msRequestFullscreen();
86
- }
87
- setIsFullScreen(true);
88
- }
89
- };
90
-
91
- // const handleExitFullScreen = () => {
92
- // if (document.exitFullscreen) {
93
- // document.exitFullscreen();
94
- // } else if (document.mozCancelFullScreen) {
95
- // document.mozCancelFullScreen();
96
- // } else if (document.webkitExitFullscreen) {
97
- // document.webkitExitFullscreen();
98
- // } else if (document.msExitFullscreen) {
99
- // document.msExitFullscreen();
1
+ // import React, { useState, useRef, useEffect } from 'react';
2
+ // import { PiCornersOut, PiDownload, PiFastForward, PiFileAudio, PiPause, PiPlay, PiRewind, PiSpeakerHifi, PiSpeakerLow } from 'react-icons/pi';
3
+ // import ToolTip from "../tooltip/ToolTip"
4
+ // import RowFlex from '../specials/RowFlex';
5
+ // import Button from '../button/Button'
6
+ // import Text from '../text/Text'
7
+ // import Tip from '../tooltip/Tip'
8
+
9
+ // interface VideoProps {
10
+ // src: string;
11
+ // autoPlay: boolean;
12
+ // onDuration?: (duration: number) => void;
13
+ // }
14
+
15
+ // export default function Video({ src, autoPlay, onDuration }: VideoProps) {
16
+ // const videoRef = useRef<HTMLVideoElement>(null);
17
+ // const [isPlaying, setIsPlaying] = useState<boolean>(autoPlay);
18
+ // const [currentTime, setCurrentTime] = useState<number>(0);
19
+ // const [duration, setDuration] = useState<number>(0);
20
+ // const [volume, setVolume] = useState<number>(1);
21
+ // const [isFullScreen, setIsFullScreen] = useState<boolean>(false);
22
+ // const [showVolume, setShowVolume] = useState<boolean>(false);
23
+
24
+ // useEffect(() => {
25
+ // if (!videoRef.current) return;
26
+
27
+ // const handleTimeUpdate = () => {
28
+ // setCurrentTime(videoRef.current.currentTime);
29
+ // };
30
+
31
+ // const handleDurationChange = () => {
32
+ // const newDuration = videoRef.current.duration;
33
+ // setDuration(newDuration);
34
+ // onDuration && onDuration(newDuration);
35
+ // };
36
+
37
+ // videoRef.current.addEventListener('timeupdate', handleTimeUpdate);
38
+ // videoRef.current.addEventListener('durationchange', handleDurationChange);
39
+
40
+ // return () => {
41
+ // videoRef.current?.removeEventListener('timeupdate', handleTimeUpdate);
42
+ // videoRef.current?.removeEventListener('durationchange', handleDurationChange);
43
+ // };
44
+ // }, [onDuration]);
45
+
46
+ // const formatTime = (time: number) => {
47
+ // const minutes = Math.floor(time / 60);
48
+ // const seconds = Math.floor(time % 60);
49
+ // return `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
50
+ // };
51
+
52
+ // const handlePlay = () => {
53
+ // videoRef.current?.play();
54
+ // setIsPlaying(true);
55
+ // };
56
+
57
+ // const handlePause = () => {
58
+ // videoRef.current?.pause();
59
+ // setIsPlaying(false);
60
+ // };
61
+
62
+ // const handleStop = () => {
63
+ // videoRef.current?.pause();
64
+ // videoRef.current.currentTime = 0;
65
+ // setIsPlaying(false);
66
+ // };
67
+
68
+ // const handleRewind = () => {
69
+ // if (videoRef.current) videoRef.current.currentTime -= 10; // Rewind 10 seconds
70
+ // };
71
+
72
+ // const handleForward = () => {
73
+ // if (videoRef.current) videoRef.current.currentTime += 10; // Forward 10 seconds
74
+ // };
75
+
76
+ // const handleToggleFullScreen = () => {
77
+ // if (videoRef.current) {
78
+ // if (videoRef.current.requestFullscreen) {
79
+ // videoRef.current.requestFullscreen();
80
+ // } else if (videoRef.current.mozRequestFullScreen) {
81
+ // videoRef.current.mozRequestFullScreen();
82
+ // } else if (videoRef.current.webkitRequestFullscreen) {
83
+ // videoRef.current.webkitRequestFullscreen();
84
+ // } else if (videoRef.current.msRequestFullscreen) {
85
+ // videoRef.current.msRequestFullscreen();
86
+ // }
87
+ // setIsFullScreen(true);
100
88
  // }
101
- // setIsFullScreen(false);
102
89
  // };
103
90
 
104
- const handleProgressBarChange = (e: React.ChangeEvent<HTMLInputElement>) => {
105
- const newTime = parseFloat(e.target.value);
106
- setCurrentTime(newTime);
107
- if (videoRef.current) videoRef.current.currentTime = newTime;
108
- };
109
-
110
- const handleVolumeChange = (e: React.ChangeEvent<HTMLInputElement>) => {
111
- const newVolume = parseFloat(e.target.value);
112
- setVolume(newVolume);
113
- if (videoRef.current) videoRef.current.volume = newVolume;
114
- };
115
-
116
- const timePlayed = formatTime(currentTime);
117
- const timeLeft = formatTime(duration - currentTime);
118
-
119
- return (
120
- <div className="vide_container">
121
- <video
122
- ref={videoRef}
123
- autoPlay={autoPlay}
124
- src={src}
125
- className="fit"
126
- ></video>
127
- <div className="video_controls" onDoubleClick={isPlaying ? handlePause : handlePlay}>
128
- <RowFlex gap={0.3} funcss="padding-5">
129
- <div>
130
- <Text
131
- text={timePlayed}
132
- size="small"
133
- bold
134
- />
135
- </div>
136
- <div className="col width-100-p">
137
- <input
138
- type="range"
139
- min={0}
140
- max={duration}
141
- value={currentTime}
142
- className="width-100-p"
143
- style={{ height: "3px" }}
144
- onChange={handleProgressBarChange}
145
- />
146
- </div>
147
- <div>
148
- <Text
149
- text={timeLeft}
150
- size="small"
151
- bold
152
- />
153
- </div>
154
- </RowFlex>
155
- <div className="margin-top-5"></div>
156
- <RowFlex gap={1} justify="space-between">
157
- <div>
158
- <RowFlex gap={0.5}>
159
- <ToolTip>
160
- <div className="width-30 height-30 pointer padding-5" onClick={isPlaying ? handlePause : handlePlay}>
161
- {isPlaying ? <PiPause /> : <PiPlay />}
162
- </div>
163
- <Tip tip="top" animation="ScaleUp" duration={0.5} content={isPlaying ? "Pause" : "Play"} />
164
- </ToolTip>
165
- <ToolTip>
166
- <div className="width-30 height-30 pointer padding-5" onClick={handleRewind}>
167
- <PiRewind />
168
- </div>
169
- <Tip tip="top" animation="ScaleUp" duration={0.5} content={"10 sec Back"} />
170
- </ToolTip>
171
- <ToolTip>
172
- <div className="width-30 height-30 pointer padding-5" onClick={handleForward}>
173
- <PiFastForward />
174
- </div>
175
- <Tip tip="top" animation="ScaleUp" duration={0.5} content={"10 sec Forward"} />
176
- </ToolTip>
177
- <div onMouseEnter={() => setShowVolume(true)} onMouseLeave={() => setShowVolume(false)}>
178
- <RowFlex >
179
- <ToolTip>
180
- <div className="width-30 height-30 pointer padding-5">
181
- <PiSpeakerLow />
182
- </div>
183
- <Tip tip="top" animation="ScaleUp" duration={0.5} content={"Volume"} />
184
- </ToolTip>
185
- {showVolume &&
186
- <input
187
- type="range"
188
- min={0}
189
- max={1}
190
- step={0.01}
191
- value={volume}
192
- className="width-100"
193
- style={{ height: "3px" }}
194
- onChange={handleVolumeChange}
195
- />
196
- }
197
- </RowFlex>
198
- </div>
199
- </RowFlex>
200
- </div>
201
- <div>
202
- <RowFlex gap={0.3}>
203
- <ToolTip>
204
- <div className="width-30 height-30 pointer padding-5" onClick={handleToggleFullScreen}>
205
- <PiCornersOut />
206
- </div>
207
- <Tip tip="top" animation="ScaleUp" duration={0.5} content={"Expand"} />
208
- </ToolTip>
209
- <ToolTip>
210
- <div className="width-30 height-30 pointer padding-5" onClick={() => { window.open(src || "", '_blank'); }}>
211
- <PiDownload />
212
- </div>
213
- <Tip tip="top" animation="ScaleUp" duration={0.5} content={"Download"} />
214
- </ToolTip>
215
- </RowFlex>
216
- </div>
217
- </RowFlex>
218
- </div>
219
- </div>
220
- );
221
- }
91
+ // // const handleExitFullScreen = () => {
92
+ // // if (document.exitFullscreen) {
93
+ // // document.exitFullscreen();
94
+ // // } else if (document.mozCancelFullScreen) {
95
+ // // document.mozCancelFullScreen();
96
+ // // } else if (document.webkitExitFullscreen) {
97
+ // // document.webkitExitFullscreen();
98
+ // // } else if (document.msExitFullscreen) {
99
+ // // document.msExitFullscreen();
100
+ // // }
101
+ // // setIsFullScreen(false);
102
+ // // };
103
+
104
+ // const handleProgressBarChange = (e: React.ChangeEvent<HTMLInputElement>) => {
105
+ // const newTime = parseFloat(e.target.value);
106
+ // setCurrentTime(newTime);
107
+ // if (videoRef.current) videoRef.current.currentTime = newTime;
108
+ // };
109
+
110
+ // const handleVolumeChange = (e: React.ChangeEvent<HTMLInputElement>) => {
111
+ // const newVolume = parseFloat(e.target.value);
112
+ // setVolume(newVolume);
113
+ // if (videoRef.current) videoRef.current.volume = newVolume;
114
+ // };
115
+
116
+ // const timePlayed = formatTime(currentTime);
117
+ // const timeLeft = formatTime(duration - currentTime);
118
+
119
+ // return (
120
+ // <div className="vide_container">
121
+ // <video
122
+ // ref={videoRef}
123
+ // autoPlay={autoPlay}
124
+ // src={src}
125
+ // className="fit"
126
+ // ></video>
127
+ // <div className="video_controls" onDoubleClick={isPlaying ? handlePause : handlePlay}>
128
+ // <RowFlex gap={0.3} funcss="padding-5">
129
+ // <div>
130
+ // <Text
131
+ // text={timePlayed}
132
+ // size="small"
133
+ // bold
134
+ // />
135
+ // </div>
136
+ // <div className="col width-100-p">
137
+ // <input
138
+ // type="range"
139
+ // min={0}
140
+ // max={duration}
141
+ // value={currentTime}
142
+ // className="width-100-p"
143
+ // style={{ height: "3px" }}
144
+ // onChange={handleProgressBarChange}
145
+ // />
146
+ // </div>
147
+ // <div>
148
+ // <Text
149
+ // text={timeLeft}
150
+ // size="small"
151
+ // bold
152
+ // />
153
+ // </div>
154
+ // </RowFlex>
155
+ // <div className="margin-top-5"></div>
156
+ // <RowFlex gap={1} justify="space-between">
157
+ // <div>
158
+ // <RowFlex gap={0.5}>
159
+ // <ToolTip>
160
+ // <div className="width-30 height-30 pointer padding-5" onClick={isPlaying ? handlePause : handlePlay}>
161
+ // {isPlaying ? <PiPause /> : <PiPlay />}
162
+ // </div>
163
+ // <Tip tip="top" animation="ScaleUp" duration={0.5} content={isPlaying ? "Pause" : "Play"} />
164
+ // </ToolTip>
165
+ // <ToolTip>
166
+ // <div className="width-30 height-30 pointer padding-5" onClick={handleRewind}>
167
+ // <PiRewind />
168
+ // </div>
169
+ // <Tip tip="top" animation="ScaleUp" duration={0.5} content={"10 sec Back"} />
170
+ // </ToolTip>
171
+ // <ToolTip>
172
+ // <div className="width-30 height-30 pointer padding-5" onClick={handleForward}>
173
+ // <PiFastForward />
174
+ // </div>
175
+ // <Tip tip="top" animation="ScaleUp" duration={0.5} content={"10 sec Forward"} />
176
+ // </ToolTip>
177
+ // <div onMouseEnter={() => setShowVolume(true)} onMouseLeave={() => setShowVolume(false)}>
178
+ // <RowFlex >
179
+ // <ToolTip>
180
+ // <div className="width-30 height-30 pointer padding-5">
181
+ // <PiSpeakerLow />
182
+ // </div>
183
+ // <Tip tip="top" animation="ScaleUp" duration={0.5} content={"Volume"} />
184
+ // </ToolTip>
185
+ // {showVolume &&
186
+ // <input
187
+ // type="range"
188
+ // min={0}
189
+ // max={1}
190
+ // step={0.01}
191
+ // value={volume}
192
+ // className="width-100"
193
+ // style={{ height: "3px" }}
194
+ // onChange={handleVolumeChange}
195
+ // />
196
+ // }
197
+ // </RowFlex>
198
+ // </div>
199
+ // </RowFlex>
200
+ // </div>
201
+ // <div>
202
+ // <RowFlex gap={0.3}>
203
+ // <ToolTip>
204
+ // <div className="width-30 height-30 pointer padding-5" onClick={handleToggleFullScreen}>
205
+ // <PiCornersOut />
206
+ // </div>
207
+ // <Tip tip="top" animation="ScaleUp" duration={0.5} content={"Expand"} />
208
+ // </ToolTip>
209
+ // <ToolTip>
210
+ // <div className="width-30 height-30 pointer padding-5" onClick={() => { window.open(src || "", '_blank'); }}>
211
+ // <PiDownload />
212
+ // </div>
213
+ // <Tip tip="top" animation="ScaleUp" duration={0.5} content={"Download"} />
214
+ // </ToolTip>
215
+ // </RowFlex>
216
+ // </div>
217
+ // </RowFlex>
218
+ // </div>
219
+ // </div>
220
+ // );
221
+ // }