next-helios-fe 1.8.152 → 1.9.1
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/content-container/media/audio-player.d.ts +10 -0
- package/dist/components/content-container/media/index.d.ts +11 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/media/audio-player.d.ts +10 -0
- package/dist/components/media/index.d.ts +10 -0
- package/dist/index.js +1 -1
- package/package.json +2 -1
- package/src/components/index.ts +1 -0
- package/src/components/media/audio-player.tsx +39 -0
- package/src/components/media/index.tsx +27 -0
- package/src/styles/audio-player.scss +247 -0
- package/src/styles/index.css +1 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "next-helios-fe",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.9.1",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -29,6 +29,7 @@
|
|
29
29
|
"react-easy-sort": "^1.6.0",
|
30
30
|
"react-google-recaptcha": "^3.1.0",
|
31
31
|
"react-google-recaptcha-v3": "^1.10.1",
|
32
|
+
"react-h5-audio-player": "^3.10.0",
|
32
33
|
"react-leaflet": "^4.2.1",
|
33
34
|
"react-pin-field": "^3.1.5",
|
34
35
|
"react-syntax-highlighter": "^15.5.0",
|
package/src/components/index.ts
CHANGED
@@ -0,0 +1,39 @@
|
|
1
|
+
"use client";
|
2
|
+
import React from "react";
|
3
|
+
import AP from "react-h5-audio-player";
|
4
|
+
import { Icon } from "@iconify/react";
|
5
|
+
import "../../styles";
|
6
|
+
|
7
|
+
export interface AudioPlayerProps {
|
8
|
+
src: string;
|
9
|
+
options?: {
|
10
|
+
layout: "stacked" | "horizontal" | "stacked-reverse" | "horizontal-reverse";
|
11
|
+
showSkipControls: boolean;
|
12
|
+
};
|
13
|
+
}
|
14
|
+
|
15
|
+
export const AudioPlayer: React.FC<AudioPlayerProps> = ({ src, options }) => {
|
16
|
+
return (
|
17
|
+
<AP
|
18
|
+
src={src}
|
19
|
+
className="rounded-md"
|
20
|
+
hasDefaultKeyBindings={false}
|
21
|
+
autoPlayAfterSrcChange={false}
|
22
|
+
showSkipControls={options?.showSkipControls ?? false}
|
23
|
+
showJumpControls={false}
|
24
|
+
layout={options?.layout || "stacked"}
|
25
|
+
customIcons={{
|
26
|
+
play: <Icon icon="heroicons:play-circle-solid" />,
|
27
|
+
pause: <Icon icon="heroicons:pause-circle-solid" />,
|
28
|
+
loop: <Icon icon="tabler:repeat" />,
|
29
|
+
loopOff: <Icon icon="tabler:repeat-off" />,
|
30
|
+
volume: <Icon icon="tabler:volume" />,
|
31
|
+
volumeMute: <Icon icon="tabler:volume-off" />,
|
32
|
+
forward: <Icon icon="iconoir:forward-solid" />,
|
33
|
+
rewind: <Icon icon="iconoir:rewind-solid" />,
|
34
|
+
next: <Icon icon="iconoir:skip-next-solid" />,
|
35
|
+
previous: <Icon icon="iconoir:skip-prev-solid" />,
|
36
|
+
}}
|
37
|
+
/>
|
38
|
+
);
|
39
|
+
};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use client";
|
2
|
+
import React from "react";
|
3
|
+
import { AudioPlayer, type AudioPlayerProps } from "./audio-player";
|
4
|
+
|
5
|
+
interface MediaProps extends React.FormHTMLAttributes<HTMLFormElement> {
|
6
|
+
children: React.ReactNode;
|
7
|
+
}
|
8
|
+
|
9
|
+
interface MediaComponent extends React.FC<MediaProps> {
|
10
|
+
AudioPlayer: React.FC<AudioPlayerProps>;
|
11
|
+
}
|
12
|
+
|
13
|
+
export const Media: MediaComponent = ({ children, onSubmit, ...rest }) => {
|
14
|
+
return (
|
15
|
+
<form
|
16
|
+
onSubmit={(e) => {
|
17
|
+
e.preventDefault();
|
18
|
+
onSubmit!(e);
|
19
|
+
}}
|
20
|
+
{...rest}
|
21
|
+
>
|
22
|
+
{children}
|
23
|
+
</form>
|
24
|
+
);
|
25
|
+
};
|
26
|
+
|
27
|
+
Media.AudioPlayer = AudioPlayer;
|
@@ -0,0 +1,247 @@
|
|
1
|
+
.rhap_container {
|
2
|
+
box-sizing: border-box;
|
3
|
+
display: flex;
|
4
|
+
flex-direction: column;
|
5
|
+
line-height: 1;
|
6
|
+
font-family: inherit;
|
7
|
+
width: 100%;
|
8
|
+
padding: 6px 12px;
|
9
|
+
background-color: var(--color-secondary-light);
|
10
|
+
}
|
11
|
+
.rhap_container:focus:not(:focus-visible) {
|
12
|
+
outline: 0;
|
13
|
+
}
|
14
|
+
.rhap_container svg {
|
15
|
+
vertical-align: initial;
|
16
|
+
}
|
17
|
+
|
18
|
+
.rhap_header {
|
19
|
+
margin-bottom: 10px;
|
20
|
+
}
|
21
|
+
|
22
|
+
.rhap_footer {
|
23
|
+
margin-top: 5px;
|
24
|
+
}
|
25
|
+
|
26
|
+
.rhap_main {
|
27
|
+
display: flex;
|
28
|
+
flex-direction: column;
|
29
|
+
flex: 1 1 auto;
|
30
|
+
}
|
31
|
+
|
32
|
+
.rhap_stacked .rhap_controls-section {
|
33
|
+
margin-top: 4px;
|
34
|
+
}
|
35
|
+
|
36
|
+
.rhap_horizontal {
|
37
|
+
flex-direction: row;
|
38
|
+
}
|
39
|
+
.rhap_horizontal .rhap_controls-section {
|
40
|
+
margin-left: 8px;
|
41
|
+
}
|
42
|
+
|
43
|
+
.rhap_horizontal-reverse {
|
44
|
+
flex-direction: row-reverse;
|
45
|
+
}
|
46
|
+
.rhap_horizontal-reverse .rhap_controls-section {
|
47
|
+
margin-right: 8px;
|
48
|
+
}
|
49
|
+
|
50
|
+
.rhap_stacked-reverse {
|
51
|
+
flex-direction: column-reverse;
|
52
|
+
}
|
53
|
+
.rhap_stacked-reverse .rhap_controls-section {
|
54
|
+
margin-bottom: 8px;
|
55
|
+
}
|
56
|
+
|
57
|
+
.rhap_progress-section {
|
58
|
+
display: flex;
|
59
|
+
flex: 3 1 auto;
|
60
|
+
align-items: center;
|
61
|
+
}
|
62
|
+
|
63
|
+
.rhap_progress-container {
|
64
|
+
display: flex;
|
65
|
+
align-items: center;
|
66
|
+
height: 20px;
|
67
|
+
flex: 1 0 auto;
|
68
|
+
align-self: center;
|
69
|
+
margin: 0 calc(10px + 1%);
|
70
|
+
cursor: pointer;
|
71
|
+
user-select: none;
|
72
|
+
-webkit-user-select: none;
|
73
|
+
}
|
74
|
+
.rhap_progress-container:focus:not(:focus-visible) {
|
75
|
+
outline: 0;
|
76
|
+
}
|
77
|
+
|
78
|
+
.rhap_time {
|
79
|
+
color: var(--color-default);
|
80
|
+
font-size: 14px;
|
81
|
+
user-select: none;
|
82
|
+
-webkit-user-select: none;
|
83
|
+
}
|
84
|
+
|
85
|
+
.rhap_progress-bar {
|
86
|
+
box-sizing: border-box;
|
87
|
+
position: relative;
|
88
|
+
z-index: 0;
|
89
|
+
width: 100%;
|
90
|
+
height: 5px;
|
91
|
+
background: var(--color-primary-transparent);
|
92
|
+
border-radius: 2px;
|
93
|
+
}
|
94
|
+
|
95
|
+
.rhap_progress-filled {
|
96
|
+
height: 100%;
|
97
|
+
position: absolute;
|
98
|
+
z-index: 2;
|
99
|
+
background-color: var(--color-primary);
|
100
|
+
border-radius: 2px;
|
101
|
+
}
|
102
|
+
|
103
|
+
/* .rhap_progress-bar-show-download {
|
104
|
+
background-color: rgba(221, 221, 221, 0.5);
|
105
|
+
} */
|
106
|
+
|
107
|
+
.rhap_download-progress {
|
108
|
+
height: 100%;
|
109
|
+
position: absolute;
|
110
|
+
z-index: 1;
|
111
|
+
background: var(--color-primary-transparent);
|
112
|
+
border-radius: 2px;
|
113
|
+
}
|
114
|
+
|
115
|
+
.rhap_progress-indicator {
|
116
|
+
box-sizing: border-box;
|
117
|
+
position: absolute;
|
118
|
+
z-index: 3;
|
119
|
+
width: 14px;
|
120
|
+
height: 14px;
|
121
|
+
margin-left: -7px;
|
122
|
+
top: -4.5px;
|
123
|
+
background: var(--color-primary);
|
124
|
+
opacity: 0.9;
|
125
|
+
border-radius: 50px;
|
126
|
+
}
|
127
|
+
|
128
|
+
.rhap_controls-section {
|
129
|
+
display: flex;
|
130
|
+
flex: 1 1 auto;
|
131
|
+
justify-content: space-between;
|
132
|
+
align-items: center;
|
133
|
+
}
|
134
|
+
|
135
|
+
.rhap_additional-controls {
|
136
|
+
display: flex;
|
137
|
+
flex: 1 0 auto;
|
138
|
+
align-items: center;
|
139
|
+
}
|
140
|
+
|
141
|
+
.rhap_repeat-button {
|
142
|
+
font-size: 20px;
|
143
|
+
color: var(--color-primary);
|
144
|
+
margin-right: 6px;
|
145
|
+
}
|
146
|
+
|
147
|
+
.rhap_main-controls {
|
148
|
+
flex: 0 1 auto;
|
149
|
+
display: flex;
|
150
|
+
justify-content: center;
|
151
|
+
align-items: center;
|
152
|
+
}
|
153
|
+
|
154
|
+
.rhap_main-controls-button {
|
155
|
+
margin: 0 3px;
|
156
|
+
color: var(--color-primary);
|
157
|
+
font-size: 24px;
|
158
|
+
}
|
159
|
+
|
160
|
+
.rhap_play-pause-button {
|
161
|
+
font-size: 36px;
|
162
|
+
}
|
163
|
+
|
164
|
+
.rhap_volume-controls {
|
165
|
+
display: flex;
|
166
|
+
flex: 1 0 auto;
|
167
|
+
justify-content: flex-end;
|
168
|
+
align-items: center;
|
169
|
+
}
|
170
|
+
|
171
|
+
.rhap_volume-button {
|
172
|
+
flex: 0 0 26px;
|
173
|
+
font-size: 20px;
|
174
|
+
color: var(--color-primary);
|
175
|
+
}
|
176
|
+
|
177
|
+
.rhap_volume-container {
|
178
|
+
display: flex;
|
179
|
+
align-items: center;
|
180
|
+
flex: 0 1 100px;
|
181
|
+
user-select: none;
|
182
|
+
-webkit-user-select: none;
|
183
|
+
}
|
184
|
+
|
185
|
+
.rhap_volume-bar-area {
|
186
|
+
display: flex;
|
187
|
+
align-items: center;
|
188
|
+
width: 100%;
|
189
|
+
height: 14px;
|
190
|
+
cursor: pointer;
|
191
|
+
}
|
192
|
+
.rhap_volume-bar-area:focus:not(:focus-visible) {
|
193
|
+
outline: 0;
|
194
|
+
}
|
195
|
+
|
196
|
+
.rhap_volume-bar {
|
197
|
+
box-sizing: border-box;
|
198
|
+
position: relative;
|
199
|
+
width: 100%;
|
200
|
+
height: 4px;
|
201
|
+
background: var(--color-primary-transparent);
|
202
|
+
border-radius: 2px;
|
203
|
+
}
|
204
|
+
|
205
|
+
.rhap_volume-indicator {
|
206
|
+
box-sizing: border-box;
|
207
|
+
position: absolute;
|
208
|
+
width: 12px;
|
209
|
+
height: 12px;
|
210
|
+
margin-left: -6px;
|
211
|
+
left: 0;
|
212
|
+
top: -4px;
|
213
|
+
background: var(--color-primary);
|
214
|
+
opacity: 0.9;
|
215
|
+
border-radius: 50px;
|
216
|
+
cursor: pointer;
|
217
|
+
}
|
218
|
+
.rhap_volume-indicator:hover {
|
219
|
+
opacity: 0.9;
|
220
|
+
}
|
221
|
+
|
222
|
+
.rhap_volume-filled {
|
223
|
+
height: 100%;
|
224
|
+
position: absolute;
|
225
|
+
z-index: 2;
|
226
|
+
background-color: var(--color-primary);
|
227
|
+
border-radius: 2px;
|
228
|
+
}
|
229
|
+
|
230
|
+
/* Utils */
|
231
|
+
.rhap_button-clear {
|
232
|
+
background-color: transparent;
|
233
|
+
border: none;
|
234
|
+
padding: 0;
|
235
|
+
overflow: hidden;
|
236
|
+
cursor: pointer;
|
237
|
+
}
|
238
|
+
.rhap_button-clear:hover {
|
239
|
+
opacity: 0.9;
|
240
|
+
transition-duration: 0.2s;
|
241
|
+
}
|
242
|
+
.rhap_button-clear:active {
|
243
|
+
opacity: 0.95;
|
244
|
+
}
|
245
|
+
.rhap_button-clear:focus:not(:focus-visible) {
|
246
|
+
outline: 0;
|
247
|
+
}
|
package/src/styles/index.css
CHANGED