@therealtinhtute/baroiplayer 1.2.0 → 2.0.0-beta.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/README.md +91 -73
- package/dist/components/icons/index.d.ts +36 -0
- package/dist/components/icons/index.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/ArrowLeftIcon.d.ts +4 -0
- package/dist/components/icons/svg-icons/ArrowLeftIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/ArrowRightIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/ArrowRightIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/AudioIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/AudioIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/BackwardIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/BackwardIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/CameraIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/CameraIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/CheckIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/CheckIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/EnablePiPIcon.d.ts +4 -0
- package/dist/components/icons/svg-icons/EnablePiPIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/ForwardIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/ForwardIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/FullscreenEnterIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/FullscreenEnterIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/FullscreenExitIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/FullscreenExitIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/LoadingIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/LoadingIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/PauseIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/PauseIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/PlayIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/PlayIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/PlaybackSpeedIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/PlaybackSpeedIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/QualityIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/QualityIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/SettingsIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/SettingsIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/SliderIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/SliderIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/SubtitleIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/SubtitleIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/SubtitleOffIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/SubtitleOffIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/UnPiPIcon.d.ts +4 -0
- package/dist/components/icons/svg-icons/UnPiPIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/VolumeMutedIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/VolumeMutedIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/VolumeOneIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/VolumeOneIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/VolumeThreeIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/VolumeThreeIcon.d.ts.map +1 -0
- package/dist/components/icons/svg-icons/VolumeTwoIcon.d.ts +5 -0
- package/dist/components/icons/svg-icons/VolumeTwoIcon.d.ts.map +1 -0
- package/dist/components/variants/gradient/gradient-audio.d.ts +13 -0
- package/dist/components/variants/gradient/gradient-audio.d.ts.map +1 -0
- package/dist/components/variants/gradient/gradient-controls.d.ts +4 -0
- package/dist/components/variants/gradient/gradient-controls.d.ts.map +1 -0
- package/dist/components/variants/gradient/gradient-glyphs.d.ts +30 -0
- package/dist/components/variants/gradient/gradient-glyphs.d.ts.map +1 -0
- package/dist/components/variants/gradient/gradient-video.d.ts +16 -0
- package/dist/components/variants/gradient/gradient-video.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -112
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +786 -6271
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +3 -0
- package/package.json +110 -108
- package/src/components/variants/gradient/gradient-audio.tsx +47 -0
- package/src/components/variants/gradient/gradient-controls.tsx +254 -0
- package/src/components/variants/gradient/gradient-glyphs.test.tsx +69 -0
- package/src/components/variants/gradient/gradient-glyphs.tsx +129 -0
- package/src/components/variants/gradient/gradient-skin.css +211 -0
- package/src/components/variants/gradient/gradient-video.tsx +70 -0
- package/src/index.ts +5 -198
- package/src/test/accessibility-utils.ts +0 -59
- package/dist/context/media.js +0 -2
- package/dist/context/media.js.map +0 -1
- package/dist/context/media.mjs +0 -15
- package/dist/context/media.mjs.map +0 -1
- package/dist/context/store.js +0 -2
- package/dist/context/store.js.map +0 -1
- package/dist/context/store.mjs +0 -5
- package/dist/context/store.mjs.map +0 -1
- package/dist/context-BYwDoSRX.js +0 -1172
- package/dist/context-BYwDoSRX.js.map +0 -1
- package/dist/context-eNS62_ac.cjs +0 -23
- package/dist/context-eNS62_ac.cjs.map +0 -1
- package/dist/core-events-B1iM2F46.cjs +0 -2
- package/dist/core-events-B1iM2F46.cjs.map +0 -1
- package/dist/core-events-DunPHKRE.js +0 -484
- package/dist/core-events-DunPHKRE.js.map +0 -1
- package/dist/core-plugins-By-4-kGs.cjs +0 -2
- package/dist/core-plugins-By-4-kGs.cjs.map +0 -1
- package/dist/core-plugins-DSBWcTuX.js +0 -821
- package/dist/core-plugins-DSBWcTuX.js.map +0 -1
- package/dist/core.js +0 -37
- package/dist/core.js.map +0 -1
- package/dist/core.mjs +0 -1233
- package/dist/core.mjs.map +0 -1
- package/dist/enhanced-components-B_l3cist.js +0 -1142
- package/dist/enhanced-components-B_l3cist.js.map +0 -1
- package/dist/enhanced-components-BspFs9OO.cjs +0 -2
- package/dist/enhanced-components-BspFs9OO.cjs.map +0 -1
- package/dist/hooks-BXwI8QG6.cjs +0 -4
- package/dist/hooks-BXwI8QG6.cjs.map +0 -1
- package/dist/hooks-Bpi-jDiO.js +0 -1816
- package/dist/hooks-Bpi-jDiO.js.map +0 -1
- package/dist/minimal-components-C4z900Ro.js +0 -1926
- package/dist/minimal-components-C4z900Ro.js.map +0 -1
- package/dist/minimal-components-v4qBp6jv.cjs +0 -2
- package/dist/minimal-components-v4qBp6jv.cjs.map +0 -1
- package/dist/minimal-components.css +0 -1
- package/dist/mona-loading.gif +0 -0
- package/dist/performance-monitor-C5k6FDXw.js +0 -301
- package/dist/performance-monitor-C5k6FDXw.js.map +0 -1
- package/dist/performance-monitor-lJmuUjQQ.cjs +0 -2
- package/dist/performance-monitor-lJmuUjQQ.cjs.map +0 -1
- package/dist/utils-CFOue_9K.cjs +0 -9
- package/dist/utils-CFOue_9K.cjs.map +0 -1
- package/dist/utils-Dzpl2ArK.js +0 -2844
- package/dist/utils-Dzpl2ArK.js.map +0 -1
- package/dist/utils.js +0 -2
- package/dist/utils.js.map +0 -1
- package/dist/utils.mjs +0 -11
- package/dist/utils.mjs.map +0 -1
- package/src/adapters/videojs-adapter.tsx +0 -470
- package/src/assets/mona-loading.gif +0 -0
- package/src/components/AnimateLoading.tsx +0 -107
- package/src/components/LoadingState.tsx +0 -239
- package/src/components/__tests__/media-player-accessibility.test.tsx +0 -510
- package/src/components/__tests__/media-player-react19.test.tsx +0 -457
- package/src/components/accessibility/keyboard-help-overlay.tsx +0 -207
- package/src/components/audio-player.tsx +0 -85
- package/src/components/basic/index.ts +0 -37
- package/src/components/enhanced/advanced-features.tsx +0 -311
- package/src/components/enhanced/debug-panel.tsx +0 -448
- package/src/components/enhanced/enhanced-controls.tsx +0 -597
- package/src/components/enhanced/enhanced-media-player.tsx +0 -566
- package/src/components/enhanced/error-handling.tsx +0 -338
- package/src/components/enhanced/index.ts +0 -39
- package/src/components/enhanced/media-player-enhanced.tsx +0 -383
- package/src/components/examples/basic-video-player.tsx +0 -50
- package/src/components/examples/custom-controls-example.tsx +0 -63
- package/src/components/examples/enhanced-controls-example.tsx +0 -100
- package/src/components/examples/enhanced-media-player-example.tsx +0 -302
- package/src/components/examples/loading-states-demo.tsx +0 -142
- package/src/components/examples/react-19-demo.tsx +0 -353
- package/src/components/examples/volume-orientation-demo.tsx +0 -106
- package/src/components/icon-demo.tsx +0 -196
- package/src/components/legacy.tsx +0 -87
- package/src/components/media-metadata-display.tsx +0 -99
- package/src/components/media-player-audio.tsx +0 -39
- package/src/components/media-player-controls.tsx +0 -223
- package/src/components/media-player-error.tsx +0 -163
- package/src/components/media-player-fullscreen.tsx +0 -109
- package/src/components/media-player-hls.tsx +0 -111
- package/src/components/media-player-loading.tsx +0 -76
- package/src/components/media-player-play.tsx +0 -75
- package/src/components/media-player-root.tsx +0 -338
- package/src/components/media-player-seek.tsx +0 -168
- package/src/components/media-player-time.tsx +0 -99
- package/src/components/media-player-tooltip.tsx +0 -58
- package/src/components/media-player-video.tsx +0 -54
- package/src/components/media-player-volume.tsx +0 -155
- package/src/components/media-player.tsx +0 -292
- package/src/components/media-suspense.tsx +0 -344
- package/src/components/player-settings-form.tsx +0 -158
- package/src/components/react-player-wrapper.tsx +0 -651
- package/src/components/simple-video-player.tsx +0 -62
- package/src/components/ui/blur-poster.tsx +0 -93
- package/src/components/ui/empty-state.tsx +0 -91
- package/src/components/ui/enhanced-seek-bar.tsx +0 -254
- package/src/components/ui/error-state.tsx +0 -124
- package/src/components/ui/fullscreen-button.tsx +0 -81
- package/src/components/ui/loading-skeleton.tsx +0 -107
- package/src/components/ui/media-resource-preloader.tsx +0 -458
- package/src/components/ui/offline-message.tsx +0 -98
- package/src/components/ui/play-button.tsx +0 -99
- package/src/components/ui/seek-bar.tsx +0 -191
- package/src/components/ui/time-display.tsx +0 -61
- package/src/components/ui/volume-control.tsx +0 -190
- package/src/components/unified/base-media-player.tsx +0 -252
- package/src/components/unified/media-player.tsx +0 -75
- package/src/components/variants/minimal/AccessibleMinimalPlayer.tsx +0 -587
- package/src/components/variants/minimal/EnhancedMinimalMediaPlayer.tsx +0 -573
- package/src/components/variants/minimal/MinimalControls.tsx +0 -124
- package/src/components/variants/minimal/MinimalLoading.tsx +0 -28
- package/src/components/variants/minimal/MinimalMediaPlayer.tsx +0 -318
- package/src/components/variants/minimal/MinimalOverlay.tsx +0 -58
- package/src/components/variants/minimal/MinimalPlayButton.tsx +0 -56
- package/src/components/variants/minimal/MinimalSeekBar.tsx +0 -140
- package/src/components/variants/minimal/MinimalVolumeControl.tsx +0 -75
- package/src/components/variants/minimal/SimpleMinimalPlayer.tsx +0 -206
- package/src/components/variants/minimal/components/CenterPlayButton.tsx +0 -22
- package/src/components/variants/minimal/components/ControlBar.tsx +0 -142
- package/src/components/variants/minimal/components/EnhancedSettingsMenu.tsx +0 -412
- package/src/components/variants/minimal/components/PlaybackControls.tsx +0 -46
- package/src/components/variants/minimal/components/RightControls.tsx +0 -164
- package/src/components/variants/minimal/components/SeekBar.tsx +0 -127
- package/src/components/variants/minimal/components/SettingsDropdown.tsx +0 -68
- package/src/components/variants/minimal/components/SubtitleDisplay.tsx +0 -21
- package/src/components/variants/minimal/components/TimeDisplay.tsx +0 -15
- package/src/components/variants/minimal/components/VideoElement.tsx +0 -33
- package/src/components/variants/minimal/components/VolumeControl.tsx +0 -220
- package/src/components/variants/minimal/index.ts +0 -23
- package/src/components/video-player.tsx +0 -100
- package/src/context/__tests__/media-store.test.ts +0 -509
- package/src/context/error-handling.ts +0 -398
- package/src/context/media-context.tsx +0 -254
- package/src/context/media-provider.tsx +0 -264
- package/src/context/media-store.ts +0 -387
- package/src/context/persistence.ts +0 -462
- package/src/core/events/event-system.ts +0 -448
- package/src/core/events/hooks.ts +0 -325
- package/src/core/events/index.ts +0 -22
- package/src/core/events/middleware.ts +0 -286
- package/src/core/index.ts +0 -22
- package/src/core/optimization/bundle-optimizer.tsx +0 -312
- package/src/core/performance/cicd.ts +0 -98
- package/src/core/performance/index.ts +0 -38
- package/src/core/performance/media-loading-optimizer.ts +0 -544
- package/src/core/performance/performance-budgets.ts +0 -437
- package/src/core/performance/performance-monitor.tsx +0 -488
- package/src/core/performance/performance-testing.ts +0 -461
- package/src/core/plugins/__tests__/registry.test.ts +0 -595
- package/src/core/plugins/base-plugin.ts +0 -225
- package/src/core/plugins/enhanced-plugin-system.ts +0 -435
- package/src/core/plugins/examples/analytics-plugin.ts +0 -241
- package/src/core/plugins/index.ts +0 -39
- package/src/core/plugins/registry.ts +0 -546
- package/src/core/plugins/types.ts +0 -169
- package/src/core/plugins/utils.ts +0 -317
- package/src/core/progressive-loading.tsx +0 -331
- package/src/core/providers/enhanced-hls-provider.ts +0 -307
- package/src/core/providers/lazy-provider.tsx +0 -14
- package/src/core/providers/service-provider.tsx +0 -164
- package/src/core/utils.tsx +0 -34
- package/src/features/media-session/media-session-manager.ts +0 -411
- package/src/features/picture-in-picture/pip-manager.ts +0 -428
- package/src/features/playlist/playlist-manager.ts +0 -626
- package/src/features/subtitles/subtitle-manager.ts +0 -435
- package/src/features/subtitles/subtitle-parser.ts +0 -284
- package/src/features/thumbnails/thumbnail-generator.ts +0 -528
- package/src/hooks/__tests__/currentTime-fix.test.ts +0 -149
- package/src/hooks/__tests__/use-media-player.test.ts +0 -712
- package/src/hooks/__tests__/use-media-state.test.tsx +0 -316
- package/src/hooks/accessibility/index.ts +0 -27
- package/src/hooks/accessibility/use-accessibility-preferences.ts +0 -190
- package/src/hooks/accessibility/use-focus-management.ts +0 -183
- package/src/hooks/accessibility/use-keyboard-shortcuts.ts +0 -152
- package/src/hooks/accessibility/use-screen-reader.ts +0 -212
- package/src/hooks/core/index.ts +0 -47
- package/src/hooks/legacy.ts +0 -21
- package/src/hooks/use-buffer-health.ts +0 -218
- package/src/hooks/use-enhanced-media-player.ts +0 -575
- package/src/hooks/use-focus-trap.tsx +0 -162
- package/src/hooks/use-intelligent-preloading.ts +0 -387
- package/src/hooks/use-keyboard-controls.ts +0 -115
- package/src/hooks/use-keyboard-shortcuts.ts +0 -255
- package/src/hooks/use-media-actions.ts +0 -184
- package/src/hooks/use-media-metadata.ts +0 -91
- package/src/hooks/use-media-optimistic.ts +0 -264
- package/src/hooks/use-media-player.ts +0 -343
- package/src/hooks/use-media-state.ts +0 -194
- package/src/hooks/use-memory-optimization.ts +0 -360
- package/src/hooks/use-network-status.ts +0 -124
- package/src/hooks/use-optimistic-controls.ts +0 -95
- package/src/hooks/use-optimized-media.ts +0 -283
- package/src/hooks/use-smart-preload.ts +0 -229
- package/src/hooks/use-touch-gestures.ts +0 -461
- package/src/hooks/useEnhancedSubtitles.ts +0 -258
- package/src/hooks/useKeyboardShortcuts.ts +0 -106
- package/src/hooks/useMediaControls.ts +0 -52
- package/src/hooks/useScreenshot.ts +0 -61
- package/src/hooks/useSubtitles.ts +0 -91
- package/src/hooks/useVideoPlayer.ts +0 -278
- package/src/icons/components/FullscreenIcon.tsx +0 -36
- package/src/icons/components/SettingsIcon.tsx +0 -37
- package/src/icons/components/animated/LoadingIcon.tsx +0 -27
- package/src/icons/components/animated/PlayPauseIcon.tsx +0 -42
- package/src/icons/components/media/PauseIcon.tsx +0 -38
- package/src/icons/components/media/PlayIcon.tsx +0 -37
- package/src/icons/components/volume/VolumeIcon.tsx +0 -38
- package/src/icons/components/volume/VolumeOffIcon.tsx +0 -38
- package/src/icons/index.ts +0 -56
- package/src/icons/provider.tsx +0 -58
- package/src/icons/types.ts +0 -60
- package/src/index-enhanced.ts +0 -35
- package/src/index-legacy.ts +0 -324
- package/src/index.css +0 -102
- package/src/lib/__tests__/async-utils.test.ts +0 -291
- package/src/lib/async-utils.ts +0 -194
- package/src/lib/deprecation.ts +0 -51
- package/src/lib/format-time.ts +0 -37
- package/src/lib/index.ts +0 -4
- package/src/lib/utils.ts +0 -6
- package/src/styles/globals.css +0 -462
- package/src/styles/minimal-player.css +0 -621
- package/src/styles/pixel-art.css +0 -41
- package/src/styles/videojs.css +0 -100
- package/src/types/events.ts +0 -47
- package/src/types/formats.ts +0 -79
- package/src/types/index.ts +0 -203
- package/src/types/videojs-plugins.d.ts +0 -14
package/package.json
CHANGED
|
@@ -1,110 +1,112 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
2
|
+
"name": "@therealtinhtute/baroiplayer",
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "A customizable media player component library for React",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"development": {
|
|
11
|
+
"types": "./src/index.ts",
|
|
12
|
+
"default": "./src/index.ts"
|
|
13
|
+
},
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.mjs",
|
|
16
|
+
"require": "./dist/index.js",
|
|
17
|
+
"default": "./dist/index.mjs"
|
|
18
|
+
},
|
|
19
|
+
"./globals.css": "./src/styles/globals.css",
|
|
20
|
+
"./minimal-player.css": "./src/styles/minimal-player.css",
|
|
21
|
+
"./dist/*": "./dist/*"
|
|
22
|
+
},
|
|
23
|
+
"main": "./dist/index.js",
|
|
24
|
+
"module": "./dist/index.mjs",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"src",
|
|
29
|
+
"README.md",
|
|
30
|
+
"LICENSE"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "vite build",
|
|
34
|
+
"build:analyze": "vite build --mode analyze",
|
|
35
|
+
"build:watch": "vite build --watch",
|
|
36
|
+
"dev": "vite build --watch",
|
|
37
|
+
"prepublishOnly": "bun run build && bun run lint",
|
|
38
|
+
"publish:beta": "npm publish --tag beta",
|
|
39
|
+
"publish:next": "npm publish --tag next",
|
|
40
|
+
"lint": "biome lint .",
|
|
41
|
+
"check-types": "tsc --noEmit",
|
|
42
|
+
"test": "vitest",
|
|
43
|
+
"test:watch": "vitest --watch",
|
|
44
|
+
"test:coverage": "vitest --coverage",
|
|
45
|
+
"size-limit": "size-limit",
|
|
46
|
+
"bundle-analyzer": "vite-bundle-analyzer dist"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@rp/typescript-config": "workspace:*",
|
|
50
|
+
"@size-limit/esbuild": "12.1.0",
|
|
51
|
+
"@size-limit/file": "^12.1.0",
|
|
52
|
+
"@tailwindcss/postcss": "4.3.2",
|
|
53
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
54
|
+
"@testing-library/react": "^16.3.2",
|
|
55
|
+
"@testing-library/user-event": "^14.5.2",
|
|
56
|
+
"@types/node": "^20",
|
|
57
|
+
"@types/react": "^19.2.17",
|
|
58
|
+
"@types/react-dom": "^19.2.3",
|
|
59
|
+
"@videojs/react": "10.0.0-rc.2",
|
|
60
|
+
"@vitejs/plugin-react": "^6.0.3",
|
|
61
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
62
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
63
|
+
"jsdom": "^29.1.1",
|
|
64
|
+
"lightningcss": "^1.30.1",
|
|
65
|
+
"rollup-plugin-analyzer": "^4.0.0",
|
|
66
|
+
"rollup-plugin-bundle-analyzer": "^1.1.0",
|
|
67
|
+
"size-limit": "^12.1.0",
|
|
68
|
+
"tailwindcss": "4.3.2",
|
|
69
|
+
"ts-morph": "^27.0.0",
|
|
70
|
+
"typescript": "^5.9.3",
|
|
71
|
+
"vite": "^8.1.4",
|
|
72
|
+
"vite-bundle-analyzer": "^0.13.1",
|
|
73
|
+
"vite-plugin-dts": "^5.1.1",
|
|
74
|
+
"vitest": "^4.1.10"
|
|
75
|
+
},
|
|
76
|
+
"peerDependencies": {
|
|
77
|
+
"@videojs/react": "10.0.0-rc.2",
|
|
78
|
+
"react": ">=18.0.0",
|
|
79
|
+
"react-dom": ">=18.0.0",
|
|
80
|
+
"tailwindcss": ">=4.0.0"
|
|
81
|
+
},
|
|
82
|
+
"peerDependenciesMeta": {
|
|
83
|
+
"tailwindcss": {
|
|
84
|
+
"optional": true
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"keywords": [
|
|
88
|
+
"react",
|
|
89
|
+
"media-player",
|
|
90
|
+
"video-player",
|
|
91
|
+
"audio-player",
|
|
92
|
+
"typescript",
|
|
93
|
+
"hls",
|
|
94
|
+
"streaming",
|
|
95
|
+
"accessibility",
|
|
96
|
+
"tailwindcss",
|
|
97
|
+
"react-19"
|
|
98
|
+
],
|
|
99
|
+
"author": "Baroi Team",
|
|
100
|
+
"license": "MIT",
|
|
101
|
+
"repository": {
|
|
102
|
+
"type": "git",
|
|
103
|
+
"url": "git+https://github.com/ryanphanrp/baroiplayer.git"
|
|
104
|
+
},
|
|
105
|
+
"homepage": "https://github.com/ryanphanrp/baroiplayer#readme",
|
|
106
|
+
"bugs": {
|
|
107
|
+
"url": "https://github.com/ryanphanrp/baroiplayer/issues"
|
|
108
|
+
},
|
|
109
|
+
"engines": {
|
|
110
|
+
"node": ">=20.19.0"
|
|
111
|
+
}
|
|
110
112
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import "@videojs/react/audio/skin.css"
|
|
4
|
+
import "./gradient-skin.css"
|
|
5
|
+
import { Audio, AudioPlayer } from "@videojs/react/audio"
|
|
6
|
+
import { Container, Dialog, ErrorDialog } from "@videojs/react"
|
|
7
|
+
import { GradientAudioIcon } from "./gradient-glyphs"
|
|
8
|
+
import { GradientControls } from "./gradient-controls"
|
|
9
|
+
|
|
10
|
+
export interface GradientAudioProps {
|
|
11
|
+
src: string
|
|
12
|
+
className?: string
|
|
13
|
+
autoPlay?: boolean
|
|
14
|
+
loop?: boolean
|
|
15
|
+
title?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Gradient audio skin on Video.js v10 — `AudioPlayer` + `Audio` from the preset, with the
|
|
20
|
+
* same ejected skin layer and glyph bindings as `GradientVideo`.
|
|
21
|
+
*/
|
|
22
|
+
export function GradientAudio({ src, className, autoPlay, loop, title }: GradientAudioProps) {
|
|
23
|
+
return (
|
|
24
|
+
<AudioPlayer title={title}>
|
|
25
|
+
<Container className={`gradient-skin gradient-audio ${className ?? ""}`} data-theme="gradient" data-preset="audio">
|
|
26
|
+
<div className="gradient-audio-head">
|
|
27
|
+
<GradientAudioIcon size={44} className="gradient-audio-icon" />
|
|
28
|
+
{title ? <p className="gradient-audio-title">{title}</p> : null}
|
|
29
|
+
</div>
|
|
30
|
+
<Audio src={src} autoPlay={autoPlay} loop={loop} className="gradient-audio-element" />
|
|
31
|
+
<ErrorDialog.Root>
|
|
32
|
+
<Dialog.Backdrop className="media-dialog-backdrop" />
|
|
33
|
+
<Dialog.Popup className="media-dialog-popup">
|
|
34
|
+
<div className="media-dialog-content">
|
|
35
|
+
<ErrorDialog.Title className="media-dialog-title" />
|
|
36
|
+
<ErrorDialog.Description className="media-dialog-description" />
|
|
37
|
+
</div>
|
|
38
|
+
<div className="media-dialog-actions">
|
|
39
|
+
<ErrorDialog.Close className="media-dialog-close">Dismiss</ErrorDialog.Close>
|
|
40
|
+
</div>
|
|
41
|
+
</Dialog.Popup>
|
|
42
|
+
</ErrorDialog.Root>
|
|
43
|
+
<GradientControls audio />
|
|
44
|
+
</Container>
|
|
45
|
+
</AudioPlayer>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
CaptionsButton,
|
|
5
|
+
Controls,
|
|
6
|
+
FullscreenButton,
|
|
7
|
+
Menu,
|
|
8
|
+
MuteButton,
|
|
9
|
+
PiPButton,
|
|
10
|
+
PlayButton,
|
|
11
|
+
PlaybackRateButton,
|
|
12
|
+
SeekButton,
|
|
13
|
+
Time,
|
|
14
|
+
TimeSlider,
|
|
15
|
+
Tooltip,
|
|
16
|
+
VolumeSlider,
|
|
17
|
+
useCaptionsOptions,
|
|
18
|
+
usePlaybackRateOptions,
|
|
19
|
+
useQualityOptions
|
|
20
|
+
} from "@videojs/react"
|
|
21
|
+
import {
|
|
22
|
+
GradientBackward10Icon,
|
|
23
|
+
GradientCaptionsOffIcon,
|
|
24
|
+
GradientCaptionsOnIcon,
|
|
25
|
+
GradientCheckIcon,
|
|
26
|
+
GradientExitFullscreenIcon,
|
|
27
|
+
GradientForward10Icon,
|
|
28
|
+
GradientFullscreenIcon,
|
|
29
|
+
GradientPauseIcon,
|
|
30
|
+
GradientPiPEnterIcon,
|
|
31
|
+
GradientPiPExitIcon,
|
|
32
|
+
GradientPlayIcon,
|
|
33
|
+
GradientSettingsIcon,
|
|
34
|
+
GradientSliderThumbIcon,
|
|
35
|
+
GradientSpeedIcon,
|
|
36
|
+
GradientVolumeLevelIcon,
|
|
37
|
+
GradientVolumeMutedIcon
|
|
38
|
+
} from "./gradient-glyphs"
|
|
39
|
+
|
|
40
|
+
const GLYPH_SIZE = 22
|
|
41
|
+
|
|
42
|
+
function PlayPauseGlyph({ paused }: { paused: boolean }) {
|
|
43
|
+
return paused ? (
|
|
44
|
+
<GradientPlayIcon size={GLYPH_SIZE} />
|
|
45
|
+
) : (
|
|
46
|
+
<GradientPauseIcon size={GLYPH_SIZE} />
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function VolumeGlyph({ muted, volumeLevel }: { muted: boolean; volumeLevel: "off" | "low" | "medium" | "high" }) {
|
|
51
|
+
return muted ? (
|
|
52
|
+
<GradientVolumeMutedIcon size={GLYPH_SIZE} />
|
|
53
|
+
) : (
|
|
54
|
+
<GradientVolumeLevelIcon level={volumeLevel} size={GLYPH_SIZE} />
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function CaptionsGlyph({ showing }: { showing: boolean }) {
|
|
59
|
+
return showing ? (
|
|
60
|
+
<GradientCaptionsOnIcon size={GLYPH_SIZE} />
|
|
61
|
+
) : (
|
|
62
|
+
<GradientCaptionsOffIcon size={GLYPH_SIZE} />
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** The v1 `SliderIcon` glyph as the seek + volume thumb. */
|
|
67
|
+
function GradientThumb() {
|
|
68
|
+
return <GradientSliderThumbIcon size={14} />
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function SettingsMenu() {
|
|
72
|
+
const rates = usePlaybackRateOptions()
|
|
73
|
+
const qualities = useQualityOptions()
|
|
74
|
+
const captions = useCaptionsOptions()
|
|
75
|
+
const rateOptions = rates?.options ?? []
|
|
76
|
+
const qualityOptions = qualities?.options ?? []
|
|
77
|
+
const captionOptions = captions?.options ?? []
|
|
78
|
+
return (
|
|
79
|
+
<Menu.Root>
|
|
80
|
+
<Menu.Trigger className="gradient-control-btn gradient-settings-trigger" aria-label="Settings">
|
|
81
|
+
<GradientSettingsIcon size={GLYPH_SIZE} />
|
|
82
|
+
</Menu.Trigger>
|
|
83
|
+
<Menu.Popup className="gradient-menu-popup">
|
|
84
|
+
<Menu.Content className="gradient-menu">
|
|
85
|
+
{rateOptions.length > 0 && rates && (
|
|
86
|
+
<>
|
|
87
|
+
<Menu.Group>
|
|
88
|
+
<Menu.GroupLabel>Playback speed</Menu.GroupLabel>
|
|
89
|
+
<Menu.RadioGroup value={rates.value} onValueChange={rates.setValue}>
|
|
90
|
+
{rateOptions.map((rate) => (
|
|
91
|
+
<Menu.RadioItem key={rate.value} value={rate.value} className="gradient-menu-item">
|
|
92
|
+
<Menu.ItemIndicator>
|
|
93
|
+
<GradientCheckIcon size={14} />
|
|
94
|
+
</Menu.ItemIndicator>
|
|
95
|
+
<span className="gradient-menu-label">{rate.label}</span>
|
|
96
|
+
</Menu.RadioItem>
|
|
97
|
+
))}
|
|
98
|
+
</Menu.RadioGroup>
|
|
99
|
+
</Menu.Group>
|
|
100
|
+
<Menu.Separator />
|
|
101
|
+
</>
|
|
102
|
+
)}
|
|
103
|
+
{qualityOptions.length > 0 && qualities && (
|
|
104
|
+
<>
|
|
105
|
+
<Menu.Group>
|
|
106
|
+
<Menu.GroupLabel>Quality</Menu.GroupLabel>
|
|
107
|
+
<Menu.RadioGroup value={qualities.value} onValueChange={qualities.setValue}>
|
|
108
|
+
{qualityOptions.map((quality) => (
|
|
109
|
+
<Menu.RadioItem key={quality.value} value={quality.value} className="gradient-menu-item">
|
|
110
|
+
<Menu.ItemIndicator>
|
|
111
|
+
<GradientCheckIcon size={14} />
|
|
112
|
+
</Menu.ItemIndicator>
|
|
113
|
+
<span className="gradient-menu-label">{quality.label}</span>
|
|
114
|
+
</Menu.RadioItem>
|
|
115
|
+
))}
|
|
116
|
+
</Menu.RadioGroup>
|
|
117
|
+
</Menu.Group>
|
|
118
|
+
<Menu.Separator />
|
|
119
|
+
</>
|
|
120
|
+
)}
|
|
121
|
+
{captionOptions.length > 0 && captions && (
|
|
122
|
+
<Menu.Group>
|
|
123
|
+
<Menu.GroupLabel>Captions</Menu.GroupLabel>
|
|
124
|
+
<Menu.RadioGroup value={captions.value} onValueChange={captions.setValue}>
|
|
125
|
+
{captionOptions.map((caption) => (
|
|
126
|
+
<Menu.RadioItem key={caption.value} value={caption.value} className="gradient-menu-item">
|
|
127
|
+
<Menu.ItemIndicator>
|
|
128
|
+
<GradientCheckIcon size={14} />
|
|
129
|
+
</Menu.ItemIndicator>
|
|
130
|
+
<span className="gradient-menu-label">{caption.label}</span>
|
|
131
|
+
</Menu.RadioItem>
|
|
132
|
+
))}
|
|
133
|
+
</Menu.RadioGroup>
|
|
134
|
+
</Menu.Group>
|
|
135
|
+
)}
|
|
136
|
+
</Menu.Content>
|
|
137
|
+
</Menu.Popup>
|
|
138
|
+
</Menu.Root>
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function GradientControls({ audio = false }: { audio?: boolean }) {
|
|
143
|
+
return (
|
|
144
|
+
<Controls.Root visibility={audio ? "always" : undefined}>
|
|
145
|
+
<Controls.Backdrop className="gradient-controls-backdrop" />
|
|
146
|
+
<Controls.Content className="gradient-controls gradient-controls-content">
|
|
147
|
+
<Tooltip.Provider>
|
|
148
|
+
<Controls.Group className="gradient-controls-primary">
|
|
149
|
+
<Tooltip.Root>
|
|
150
|
+
<Tooltip.Trigger
|
|
151
|
+
className="gradient-tooltip-trigger"
|
|
152
|
+
render={
|
|
153
|
+
<PlayButton
|
|
154
|
+
className="gradient-control-btn"
|
|
155
|
+
render={(buttonProps, state) => (
|
|
156
|
+
<button {...buttonProps}>
|
|
157
|
+
<PlayPauseGlyph paused={state.paused} />
|
|
158
|
+
</button>
|
|
159
|
+
)}
|
|
160
|
+
/>
|
|
161
|
+
}
|
|
162
|
+
/>
|
|
163
|
+
<Tooltip.Popup className="gradient-tooltip">
|
|
164
|
+
<Tooltip.Label>Play / Pause</Tooltip.Label>
|
|
165
|
+
</Tooltip.Popup>
|
|
166
|
+
</Tooltip.Root>
|
|
167
|
+
<SeekButton
|
|
168
|
+
seconds={-10}
|
|
169
|
+
className="gradient-control-btn"
|
|
170
|
+
render={(props) => (
|
|
171
|
+
<button {...props} aria-label="Rewind 10 seconds">
|
|
172
|
+
<GradientBackward10Icon size={GLYPH_SIZE} />
|
|
173
|
+
</button>
|
|
174
|
+
)}
|
|
175
|
+
/>
|
|
176
|
+
<SeekButton
|
|
177
|
+
seconds={10}
|
|
178
|
+
className="gradient-control-btn"
|
|
179
|
+
render={(props) => (
|
|
180
|
+
<button {...props} aria-label="Forward 10 seconds">
|
|
181
|
+
<GradientForward10Icon size={GLYPH_SIZE} />
|
|
182
|
+
</button>
|
|
183
|
+
)}
|
|
184
|
+
/>
|
|
185
|
+
<MuteButton
|
|
186
|
+
className="gradient-control-btn"
|
|
187
|
+
render={(props, state) => (
|
|
188
|
+
<button {...props}>
|
|
189
|
+
<VolumeGlyph muted={state.muted} volumeLevel={state.volumeLevel} />
|
|
190
|
+
</button>
|
|
191
|
+
)}
|
|
192
|
+
/>
|
|
193
|
+
<VolumeSlider.Root className="gradient-volume-slider">
|
|
194
|
+
<VolumeSlider.Track className="gradient-slider-track" />
|
|
195
|
+
<VolumeSlider.Fill className="gradient-slider-fill" />
|
|
196
|
+
<VolumeSlider.Thumb className="gradient-slider-thumb" render={(thumbProps) => <div {...thumbProps}><GradientThumb /></div>} />
|
|
197
|
+
</VolumeSlider.Root>
|
|
198
|
+
</Controls.Group>
|
|
199
|
+
<Controls.Group className="gradient-controls-time">
|
|
200
|
+
<Time.Group>
|
|
201
|
+
<Time.Value type="current" className="gradient-time" />
|
|
202
|
+
<Time.Separator className="gradient-time-sep">/</Time.Separator>
|
|
203
|
+
<Time.Value type="duration" className="gradient-time" />
|
|
204
|
+
</Time.Group>
|
|
205
|
+
<TimeSlider.Root className="gradient-seekbar">
|
|
206
|
+
<TimeSlider.Track className="gradient-slider-track" />
|
|
207
|
+
<TimeSlider.Fill className="gradient-slider-fill" />
|
|
208
|
+
<TimeSlider.Thumb className="gradient-slider-thumb" render={(thumbProps) => <div {...thumbProps}><GradientThumb /></div>} />
|
|
209
|
+
</TimeSlider.Root>
|
|
210
|
+
</Controls.Group>
|
|
211
|
+
<Controls.Group className="gradient-controls-secondary">
|
|
212
|
+
<CaptionsButton
|
|
213
|
+
className="gradient-control-btn"
|
|
214
|
+
render={(props, state) => (
|
|
215
|
+
<button {...props} aria-label="Captions">
|
|
216
|
+
<CaptionsGlyph showing={state.subtitlesShowing} />
|
|
217
|
+
</button>
|
|
218
|
+
)}
|
|
219
|
+
/>
|
|
220
|
+
<PlaybackRateButton
|
|
221
|
+
className="gradient-control-btn"
|
|
222
|
+
render={(props, state) => (
|
|
223
|
+
<button {...props} aria-label={`Playback speed ${state.rate}x`}>
|
|
224
|
+
<GradientSpeedIcon size={GLYPH_SIZE} />
|
|
225
|
+
</button>
|
|
226
|
+
)}
|
|
227
|
+
/>
|
|
228
|
+
<SettingsMenu />
|
|
229
|
+
{!audio && (
|
|
230
|
+
<>
|
|
231
|
+
<PiPButton
|
|
232
|
+
className="gradient-control-btn"
|
|
233
|
+
render={(props, state) => (
|
|
234
|
+
<button {...props} aria-label="Picture in picture">
|
|
235
|
+
{state.pip ? <GradientPiPExitIcon size={GLYPH_SIZE} /> : <GradientPiPEnterIcon size={GLYPH_SIZE} />}
|
|
236
|
+
</button>
|
|
237
|
+
)}
|
|
238
|
+
/>
|
|
239
|
+
<FullscreenButton
|
|
240
|
+
className="gradient-control-btn"
|
|
241
|
+
render={(props, state) => (
|
|
242
|
+
<button {...props} aria-label="Fullscreen">
|
|
243
|
+
{state.fullscreen ? <GradientExitFullscreenIcon size={GLYPH_SIZE} /> : <GradientFullscreenIcon size={GLYPH_SIZE} />}
|
|
244
|
+
</button>
|
|
245
|
+
)}
|
|
246
|
+
/>
|
|
247
|
+
</>
|
|
248
|
+
)}
|
|
249
|
+
</Controls.Group>
|
|
250
|
+
</Tooltip.Provider>
|
|
251
|
+
</Controls.Content>
|
|
252
|
+
</Controls.Root>
|
|
253
|
+
)
|
|
254
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { render } from "@testing-library/react"
|
|
2
|
+
import { describe, expect, it } from "vitest"
|
|
3
|
+
import {
|
|
4
|
+
GradientAudioIcon,
|
|
5
|
+
GradientBackward10Icon,
|
|
6
|
+
GradientCaptionsOffIcon,
|
|
7
|
+
GradientCaptionsOnIcon,
|
|
8
|
+
GradientCheckIcon,
|
|
9
|
+
GradientExitFullscreenIcon,
|
|
10
|
+
GradientForward10Icon,
|
|
11
|
+
GradientFullscreenIcon,
|
|
12
|
+
GradientPiPEnterIcon,
|
|
13
|
+
GradientPiPExitIcon,
|
|
14
|
+
GradientPlayIcon,
|
|
15
|
+
GradientQualityIcon,
|
|
16
|
+
GradientSettingsIcon,
|
|
17
|
+
GradientSliderThumbIcon,
|
|
18
|
+
GradientSpeedIcon,
|
|
19
|
+
GradientSpinnerIcon,
|
|
20
|
+
GradientVolumeLevelIcon,
|
|
21
|
+
GradientVolumeMutedIcon
|
|
22
|
+
} from "./gradient-glyphs"
|
|
23
|
+
|
|
24
|
+
const ALL_GLYPHS = [
|
|
25
|
+
GradientAudioIcon,
|
|
26
|
+
GradientBackward10Icon,
|
|
27
|
+
GradientCaptionsOffIcon,
|
|
28
|
+
GradientCaptionsOnIcon,
|
|
29
|
+
GradientCheckIcon,
|
|
30
|
+
GradientExitFullscreenIcon,
|
|
31
|
+
GradientForward10Icon,
|
|
32
|
+
GradientFullscreenIcon,
|
|
33
|
+
GradientPiPEnterIcon,
|
|
34
|
+
GradientPiPExitIcon,
|
|
35
|
+
GradientPlayIcon,
|
|
36
|
+
GradientQualityIcon,
|
|
37
|
+
GradientSettingsIcon,
|
|
38
|
+
GradientSliderThumbIcon,
|
|
39
|
+
GradientSpeedIcon,
|
|
40
|
+
GradientSpinnerIcon,
|
|
41
|
+
GradientVolumeMutedIcon
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
describe("gradient glyphs", () => {
|
|
45
|
+
it("renders every bound v1 glyph as an svg", () => {
|
|
46
|
+
for (const Glyph of ALL_GLYPHS) {
|
|
47
|
+
const { container } = render(<Glyph />)
|
|
48
|
+
expect(container.querySelector("svg"), Glyph.name).not.toBeNull()
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it("switches the volume glyph by level", () => {
|
|
53
|
+
const off = render(<GradientVolumeLevelIcon level="off" />)
|
|
54
|
+
const low = render(<GradientVolumeLevelIcon level="low" />)
|
|
55
|
+
const medium = render(<GradientVolumeLevelIcon level="medium" />)
|
|
56
|
+
const high = render(<GradientVolumeLevelIcon level="high" />)
|
|
57
|
+
expect(off.container.querySelector("svg")).not.toBeNull()
|
|
58
|
+
expect(low.container.querySelector("svg")).not.toBeNull()
|
|
59
|
+
expect(medium.container.querySelector("svg")).not.toBeNull()
|
|
60
|
+
expect(high.container.querySelector("svg")).not.toBeNull()
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
it("forwards size to the svg", () => {
|
|
64
|
+
const { container } = render(<GradientPlayIcon size={18} />)
|
|
65
|
+
const svg = container.querySelector("svg")
|
|
66
|
+
expect(svg?.getAttribute("width")).toBe("18")
|
|
67
|
+
expect(svg?.getAttribute("height")).toBe("18")
|
|
68
|
+
})
|
|
69
|
+
})
|