@hanifhan1f/vidstack-react 1.12.13 → 1.12.15
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/dev/chunks/vidstack-B-FM4-oZ.js +668 -0
- package/dev/chunks/vidstack-B92UncBI.js +61 -0
- package/dev/chunks/vidstack-BDiAEW1N.js +11691 -0
- package/dev/chunks/vidstack-BZIhWvGa.js +1371 -0
- package/dev/chunks/vidstack-Bfi_jCvb.js +476 -0
- package/dev/chunks/vidstack-CBF7iUqu.js +22 -0
- package/dev/chunks/vidstack-CFZ0rYJz.js +34 -0
- package/dev/chunks/vidstack-CM82l-7o.js +551 -0
- package/dev/chunks/vidstack-CvWDiSTs.js +84 -0
- package/dev/chunks/vidstack-CzU-uC5f.js +189 -0
- package/dev/chunks/vidstack-D-hQD1eE.js +9 -0
- package/dev/chunks/vidstack-D6_9yy0x.js +643 -0
- package/dev/chunks/vidstack-DJQOTrl6.js +180 -0
- package/dev/chunks/vidstack-DNbKNc4R.js +288 -0
- package/dev/chunks/vidstack-D_bWd66h.js +2023 -0
- package/dev/chunks/vidstack-Dm1xEU9Q.js +36 -0
- package/dev/chunks/vidstack-f6WXkmfP.js +375 -0
- package/dev/chunks/vidstack-krOAtKMi.js +34 -0
- package/dev/chunks/vidstack-lYFZKRUc.js +401 -0
- package/dev/chunks/vidstack-vz-aZSfo.js +1497 -0
- package/dev/player/vidstack-default-components.js +14 -0
- package/dev/player/vidstack-default-icons.js +88 -0
- package/dev/player/vidstack-default-layout.js +14 -0
- package/dev/player/vidstack-plyr-icons.js +62 -0
- package/dev/player/vidstack-plyr-layout.js +636 -0
- package/dev/player/vidstack-remotion.js +345 -0
- package/dev/vidstack.js +587 -0
- package/dom.d.ts +91 -0
- package/google-cast.d.ts +1422 -0
- package/icons.d.ts +5 -0
- package/index.d.ts +8 -0
- package/package.json +9 -60
- package/player/layouts/default.d.ts +11392 -0
- package/player/layouts/plyr.d.ts +5 -0
- package/player/remotion.d.ts +5 -0
- package/player/styles/base.css +153 -0
- package/player/styles/default/buffering.css +55 -0
- package/player/styles/default/buttons.css +175 -0
- package/player/styles/default/captions.css +181 -0
- package/player/styles/default/chapter-title.css +26 -0
- package/player/styles/default/controls.css +56 -0
- package/player/styles/default/gestures.css +19 -0
- package/player/styles/default/icons.css +6 -0
- package/player/styles/default/keyboard.css +148 -0
- package/player/styles/default/layouts/audio.css +417 -0
- package/player/styles/default/layouts/video.css +1082 -0
- package/player/styles/default/menus.css +959 -0
- package/player/styles/default/poster.css +52 -0
- package/player/styles/default/sliders.css +391 -0
- package/player/styles/default/theme.css +2461 -0
- package/player/styles/default/thumbnail.css +40 -0
- package/player/styles/default/time.css +45 -0
- package/player/styles/default/tooltips.css +141 -0
- package/player/styles/plyr/theme.css +1237 -0
- package/prod/chunks/vidstack-0Foyib2F.js +34 -0
- package/prod/chunks/vidstack-BbPEqH3g.js +11196 -0
- package/prod/chunks/vidstack-Bh7M8kL6.js +663 -0
- package/prod/chunks/vidstack-BlPINAXN.js +189 -0
- package/prod/chunks/vidstack-C5Rzkyfp.js +375 -0
- package/prod/chunks/vidstack-CBF7iUqu.js +22 -0
- package/prod/chunks/vidstack-CZNlvfmV.js +288 -0
- package/prod/chunks/vidstack-CZgUA94N.js +1979 -0
- package/prod/chunks/vidstack-Ce0Qn3e1.js +1497 -0
- package/prod/chunks/vidstack-D0XCUWbp.js +159 -0
- package/prod/chunks/vidstack-DTyDOhwS.js +504 -0
- package/prod/chunks/vidstack-DhC5F6c8.js +470 -0
- package/prod/chunks/vidstack-Dm1xEU9Q.js +36 -0
- package/prod/chunks/vidstack-Ma9rwtR0.js +386 -0
- package/prod/chunks/vidstack-WsodkLQg.js +1371 -0
- package/prod/chunks/vidstack-jIPoNqhj.js +545 -0
- package/prod/chunks/vidstack-krOAtKMi.js +34 -0
- package/prod/chunks/vidstack-vqp2QaHR.js +9 -0
- package/prod/chunks/vidstack-xo_SmgiV.js +84 -0
- package/prod/chunks/vidstack-xvxeRtaN.js +61 -0
- package/prod/player/vidstack-default-components.js +14 -0
- package/prod/player/vidstack-default-icons.js +88 -0
- package/prod/player/vidstack-default-layout.js +14 -0
- package/prod/player/vidstack-plyr-icons.js +62 -0
- package/prod/player/vidstack-plyr-layout.js +636 -0
- package/prod/player/vidstack-remotion.js +335 -0
- package/prod/vidstack-icons.js +435 -0
- package/prod/vidstack.js +648 -0
- package/server/chunks/vidstack-2zMSe4ym.js +1371 -0
- package/server/chunks/vidstack-BtqWstSj.js +375 -0
- package/server/chunks/vidstack-C-HdFsZi.js +84 -0
- package/server/chunks/vidstack-C4iWXMC-.js +545 -0
- package/server/chunks/vidstack-C5zFBMwg.js +386 -0
- package/server/chunks/vidstack-CBF7iUqu.js +22 -0
- package/server/chunks/vidstack-CEh38XpD.js +288 -0
- package/server/chunks/vidstack-CWR0J8Qz.js +1497 -0
- package/server/chunks/vidstack-CkMAeO-e.js +34 -0
- package/server/chunks/vidstack-Cm0qnRvu.js +11196 -0
- package/server/chunks/vidstack-CoGzBr_V.js +663 -0
- package/server/chunks/vidstack-CyFwkPiu.js +470 -0
- package/server/chunks/vidstack-D-hQD1eE.js +9 -0
- package/server/chunks/vidstack-D_bWd66h.js +2023 -0
- package/server/chunks/vidstack-Dm1xEU9Q.js +36 -0
- package/server/chunks/vidstack-DtQSvsQr.js +189 -0
- package/server/chunks/vidstack-jlaBqZq5.js +61 -0
- package/server/chunks/vidstack-krOAtKMi.js +34 -0
- package/server/chunks/vidstack-rWs25cS9.js +159 -0
- package/server/chunks/vidstack-uyCXITen.js +504 -0
- package/server/player/vidstack-default-components.js +14 -0
- package/server/player/vidstack-default-icons.js +88 -0
- package/server/player/vidstack-default-layout.js +14 -0
- package/server/player/vidstack-plyr-icons.js +62 -0
- package/server/player/vidstack-plyr-layout.js +636 -0
- package/server/player/vidstack-remotion.js +335 -0
- package/server/vidstack.js +648 -0
- package/tailwind.cjs +101 -0
- package/tailwind.d.cts +15 -0
- package/.templates/sandbox/document.css +0 -27
- package/.templates/sandbox/favicon-32x32.png +0 -0
- package/.templates/sandbox/index.html +0 -21
- package/.templates/sandbox/main.tsx +0 -12
- package/.templates/sandbox/player.css +0 -39
- package/.templates/sandbox/player.tsx +0 -121
- package/.templates/sandbox/tracks.ts +0 -23
- package/analyze.config.ts +0 -7
- package/build/build-icons.js +0 -62
- package/rollup.config.ts +0 -256
- package/src/components/announcer.tsx +0 -47
- package/src/components/layouts/default/audio-layout.tsx +0 -231
- package/src/components/layouts/default/context.ts +0 -28
- package/src/components/layouts/default/hooks.ts +0 -13
- package/src/components/layouts/default/icons.tsx +0 -225
- package/src/components/layouts/default/index.ts +0 -11
- package/src/components/layouts/default/media-layout.tsx +0 -259
- package/src/components/layouts/default/slots.tsx +0 -98
- package/src/components/layouts/default/ui/announcer.tsx +0 -22
- package/src/components/layouts/default/ui/buttons.tsx +0 -301
- package/src/components/layouts/default/ui/captions.tsx +0 -16
- package/src/components/layouts/default/ui/controls.tsx +0 -12
- package/src/components/layouts/default/ui/keyboard-display.tsx +0 -132
- package/src/components/layouts/default/ui/menus/accessibility-menu.tsx +0 -100
- package/src/components/layouts/default/ui/menus/audio-menu.tsx +0 -167
- package/src/components/layouts/default/ui/menus/captions-menu.tsx +0 -61
- package/src/components/layouts/default/ui/menus/chapters-menu.tsx +0 -132
- package/src/components/layouts/default/ui/menus/font-menu.tsx +0 -331
- package/src/components/layouts/default/ui/menus/items/menu-checkbox.tsx +0 -72
- package/src/components/layouts/default/ui/menus/items/menu-items.tsx +0 -135
- package/src/components/layouts/default/ui/menus/items/menu-slider.tsx +0 -92
- package/src/components/layouts/default/ui/menus/playback-menu.tsx +0 -232
- package/src/components/layouts/default/ui/menus/settings-menu.tsx +0 -114
- package/src/components/layouts/default/ui/menus/utils.ts +0 -12
- package/src/components/layouts/default/ui/sliders.tsx +0 -136
- package/src/components/layouts/default/ui/time.tsx +0 -73
- package/src/components/layouts/default/ui/title.tsx +0 -24
- package/src/components/layouts/default/ui/tooltip.tsx +0 -27
- package/src/components/layouts/default/ui.ts +0 -8
- package/src/components/layouts/default/video-layout.tsx +0 -344
- package/src/components/layouts/plyr/context.ts +0 -26
- package/src/components/layouts/plyr/icons/plyr-airplay.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-captions-off.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-captions-on.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-download.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-enter-fullscreen.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-exit-fullscreen.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-fast-forward.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-muted.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-pause.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-pip.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-play.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-restart.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-rewind.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-settings.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-volume.js +0 -1
- package/src/components/layouts/plyr/icons.tsx +0 -71
- package/src/components/layouts/plyr/index.ts +0 -11
- package/src/components/layouts/plyr/layout.tsx +0 -1024
- package/src/components/layouts/plyr/props.ts +0 -104
- package/src/components/layouts/plyr/slots.tsx +0 -52
- package/src/components/layouts/remotion-ui.ts +0 -13
- package/src/components/layouts/utils.ts +0 -17
- package/src/components/player-callbacks.ts +0 -67
- package/src/components/player.tsx +0 -67
- package/src/components/primitives/instances.ts +0 -92
- package/src/components/primitives/nodes.tsx +0 -58
- package/src/components/primitives/slot.tsx +0 -132
- package/src/components/provider.tsx +0 -187
- package/src/components/text-track.tsx +0 -106
- package/src/components/ui/buttons/airplay-button.tsx +0 -53
- package/src/components/ui/buttons/caption-button.tsx +0 -55
- package/src/components/ui/buttons/fullscreen-button.tsx +0 -55
- package/src/components/ui/buttons/google-cast-button.tsx +0 -53
- package/src/components/ui/buttons/live-button.tsx +0 -56
- package/src/components/ui/buttons/mute-button.tsx +0 -60
- package/src/components/ui/buttons/pip-button.tsx +0 -54
- package/src/components/ui/buttons/play-button.tsx +0 -53
- package/src/components/ui/buttons/seek-button.tsx +0 -55
- package/src/components/ui/buttons/toggle-button.tsx +0 -51
- package/src/components/ui/caption.tsx +0 -70
- package/src/components/ui/captions.tsx +0 -41
- package/src/components/ui/chapter-title.tsx +0 -40
- package/src/components/ui/controls.tsx +0 -90
- package/src/components/ui/gesture.tsx +0 -43
- package/src/components/ui/menu.tsx +0 -251
- package/src/components/ui/poster.tsx +0 -101
- package/src/components/ui/radio-group.tsx +0 -88
- package/src/components/ui/sliders/audio-gain-slider.tsx +0 -55
- package/src/components/ui/sliders/quality-slider.tsx +0 -54
- package/src/components/ui/sliders/slider-callbacks.ts +0 -14
- package/src/components/ui/sliders/slider-value.tsx +0 -13
- package/src/components/ui/sliders/slider.tsx +0 -254
- package/src/components/ui/sliders/speed-slider.tsx +0 -54
- package/src/components/ui/sliders/time-slider.tsx +0 -379
- package/src/components/ui/sliders/volume-slider.tsx +0 -55
- package/src/components/ui/spinner.tsx +0 -105
- package/src/components/ui/thumbnail.tsx +0 -82
- package/src/components/ui/time.tsx +0 -77
- package/src/components/ui/title.tsx +0 -32
- package/src/components/ui/tooltip.tsx +0 -135
- package/src/globals.d.ts +0 -3
- package/src/hooks/create-text-track.ts +0 -22
- package/src/hooks/options/use-audio-gain-options.ts +0 -75
- package/src/hooks/options/use-audio-options.ts +0 -71
- package/src/hooks/options/use-caption-options.ts +0 -95
- package/src/hooks/options/use-chapter-options.ts +0 -97
- package/src/hooks/options/use-playback-rate-options.ts +0 -75
- package/src/hooks/options/use-video-quality-options.ts +0 -123
- package/src/hooks/use-active-text-cues.ts +0 -28
- package/src/hooks/use-active-text-track.ts +0 -19
- package/src/hooks/use-chapter-title.ts +0 -12
- package/src/hooks/use-dom.ts +0 -121
- package/src/hooks/use-media-context.ts +0 -6
- package/src/hooks/use-media-player.ts +0 -19
- package/src/hooks/use-media-provider.ts +0 -31
- package/src/hooks/use-media-remote.ts +0 -37
- package/src/hooks/use-media-state.ts +0 -58
- package/src/hooks/use-signals.ts +0 -24
- package/src/hooks/use-slider-preview.ts +0 -126
- package/src/hooks/use-slider-state.ts +0 -63
- package/src/hooks/use-state.ts +0 -47
- package/src/hooks/use-text-cues.ts +0 -33
- package/src/hooks/use-thumbnails.ts +0 -69
- package/src/icon.ts +0 -37
- package/src/icons.ts +0 -754
- package/src/index.ts +0 -181
- package/src/providers/remotion/index.ts +0 -10
- package/src/providers/remotion/layout-engine.ts +0 -123
- package/src/providers/remotion/loader.ts +0 -35
- package/src/providers/remotion/playback-engine.ts +0 -142
- package/src/providers/remotion/provider.tsx +0 -514
- package/src/providers/remotion/type-check.ts +0 -13
- package/src/providers/remotion/types.ts +0 -94
- package/src/providers/remotion/ui/context.tsx +0 -120
- package/src/providers/remotion/ui/error-boundary.tsx +0 -57
- package/src/providers/remotion/ui/poster.tsx +0 -33
- package/src/providers/remotion/ui/slider-thumbnail.tsx +0 -41
- package/src/providers/remotion/ui/thumbnail.tsx +0 -166
- package/src/providers/remotion/validate.ts +0 -220
- package/src/source.ts +0 -5
- package/src/utils.ts +0 -27
- package/tsconfig.build.json +0 -10
- package/tsconfig.json +0 -11
- package/types/react/src/components/announcer.d.ts +0 -16
- package/types/react/src/components/layouts/default/audio-layout.d.ts +0 -27
- package/types/react/src/components/layouts/default/context.d.ts +0 -14
- package/types/react/src/components/layouts/default/hooks.d.ts +0 -2
- package/types/react/src/components/layouts/default/icons.d.ts +0 -95
- package/types/react/src/components/layouts/default/index.d.ts +0 -5
- package/types/react/src/components/layouts/default/media-layout.d.ts +0 -133
- package/types/react/src/components/layouts/default/slots.d.ts +0 -22
- package/types/react/src/components/layouts/default/ui/announcer.d.ts +0 -6
- package/types/react/src/components/layouts/default/ui/buttons.d.ts +0 -54
- package/types/react/src/components/layouts/default/ui/captions.d.ts +0 -6
- package/types/react/src/components/layouts/default/ui/controls.d.ts +0 -6
- package/types/react/src/components/layouts/default/ui/keyboard-display.d.ts +0 -8
- package/types/react/src/components/layouts/default/ui/menus/accessibility-menu.d.ts +0 -10
- package/types/react/src/components/layouts/default/ui/menus/audio-menu.d.ts +0 -10
- package/types/react/src/components/layouts/default/ui/menus/captions-menu.d.ts +0 -10
- package/types/react/src/components/layouts/default/ui/menus/chapters-menu.d.ts +0 -7
- package/types/react/src/components/layouts/default/ui/menus/font-menu.d.ts +0 -6
- package/types/react/src/components/layouts/default/ui/menus/items/menu-checkbox.d.ts +0 -13
- package/types/react/src/components/layouts/default/ui/menus/items/menu-items.d.ts +0 -49
- package/types/react/src/components/layouts/default/ui/menus/items/menu-slider.d.ts +0 -26
- package/types/react/src/components/layouts/default/ui/menus/playback-menu.d.ts +0 -10
- package/types/react/src/components/layouts/default/ui/menus/settings-menu.d.ts +0 -15
- package/types/react/src/components/layouts/default/ui/menus/utils.d.ts +0 -1
- package/types/react/src/components/layouts/default/ui/sliders.d.ts +0 -24
- package/types/react/src/components/layouts/default/ui/time.d.ts +0 -30
- package/types/react/src/components/layouts/default/ui/title.d.ts +0 -6
- package/types/react/src/components/layouts/default/ui/tooltip.d.ts +0 -12
- package/types/react/src/components/layouts/default/ui.d.ts +0 -8
- package/types/react/src/components/layouts/default/video-layout.d.ts +0 -47
- package/types/react/src/components/layouts/plyr/context.d.ts +0 -12
- package/types/react/src/components/layouts/plyr/icons/plyr-airplay.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-captions-off.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-captions-on.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-download.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-enter-fullscreen.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-exit-fullscreen.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-fast-forward.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-muted.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-pause.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-pip.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-play.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-restart.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-rewind.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-settings.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-volume.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons.d.ts +0 -25
- package/types/react/src/components/layouts/plyr/index.d.ts +0 -6
- package/types/react/src/components/layouts/plyr/layout.d.ts +0 -17
- package/types/react/src/components/layouts/plyr/props.d.ts +0 -71
- package/types/react/src/components/layouts/plyr/slots.d.ts +0 -9
- package/types/react/src/components/layouts/remotion-ui.d.ts +0 -3
- package/types/react/src/components/layouts/utils.d.ts +0 -1
- package/types/react/src/components/player-callbacks.d.ts +0 -6
- package/types/react/src/components/player.d.ts +0 -32
- package/types/react/src/components/primitives/instances.d.ts +0 -83
- package/types/react/src/components/primitives/nodes.d.ts +0 -15
- package/types/react/src/components/primitives/slot.d.ts +0 -11
- package/types/react/src/components/provider.d.ts +0 -26
- package/types/react/src/components/text-track.d.ts +0 -100
- package/types/react/src/components/ui/buttons/airplay-button.d.ts +0 -22
- package/types/react/src/components/ui/buttons/caption-button.d.ts +0 -24
- package/types/react/src/components/ui/buttons/fullscreen-button.d.ts +0 -24
- package/types/react/src/components/ui/buttons/google-cast-button.d.ts +0 -22
- package/types/react/src/components/ui/buttons/live-button.d.ts +0 -26
- package/types/react/src/components/ui/buttons/mute-button.d.ts +0 -30
- package/types/react/src/components/ui/buttons/pip-button.d.ts +0 -24
- package/types/react/src/components/ui/buttons/play-button.d.ts +0 -23
- package/types/react/src/components/ui/buttons/seek-button.d.ts +0 -25
- package/types/react/src/components/ui/buttons/toggle-button.d.ts +0 -22
- package/types/react/src/components/ui/caption.d.ts +0 -11
- package/types/react/src/components/ui/captions.d.ts +0 -20
- package/types/react/src/components/ui/chapter-title.d.ts +0 -20
- package/types/react/src/components/ui/controls.d.ts +0 -40
- package/types/react/src/components/ui/gesture.d.ts +0 -20
- package/types/react/src/components/ui/menu.d.ts +0 -102
- package/types/react/src/components/ui/poster.d.ts +0 -25
- package/types/react/src/components/ui/radio-group.d.ts +0 -39
- package/types/react/src/components/ui/sliders/audio-gain-slider.d.ts +0 -29
- package/types/react/src/components/ui/sliders/quality-slider.d.ts +0 -28
- package/types/react/src/components/ui/sliders/slider-callbacks.d.ts +0 -6
- package/types/react/src/components/ui/sliders/slider-value.d.ts +0 -9
- package/types/react/src/components/ui/sliders/slider.d.ts +0 -134
- package/types/react/src/components/ui/sliders/speed-slider.d.ts +0 -28
- package/types/react/src/components/ui/sliders/time-slider.d.ts +0 -124
- package/types/react/src/components/ui/sliders/volume-slider.d.ts +0 -29
- package/types/react/src/components/ui/spinner.d.ts +0 -31
- package/types/react/src/components/ui/thumbnail.d.ts +0 -26
- package/types/react/src/components/ui/time.d.ts +0 -20
- package/types/react/src/components/ui/title.d.ts +0 -15
- package/types/react/src/components/ui/tooltip.d.ts +0 -63
- package/types/react/src/hooks/create-text-track.d.ts +0 -7
- package/types/react/src/hooks/options/use-audio-gain-options.d.ts +0 -22
- package/types/react/src/hooks/options/use-audio-options.d.ts +0 -17
- package/types/react/src/hooks/options/use-caption-options.d.ts +0 -24
- package/types/react/src/hooks/options/use-chapter-options.d.ts +0 -18
- package/types/react/src/hooks/options/use-playback-rate-options.d.ts +0 -22
- package/types/react/src/hooks/options/use-video-quality-options.d.ts +0 -35
- package/types/react/src/hooks/use-active-text-cues.d.ts +0 -6
- package/types/react/src/hooks/use-active-text-track.d.ts +0 -5
- package/types/react/src/hooks/use-chapter-title.d.ts +0 -4
- package/types/react/src/hooks/use-dom.d.ts +0 -9
- package/types/react/src/hooks/use-media-context.d.ts +0 -1
- package/types/react/src/hooks/use-media-player.d.ts +0 -7
- package/types/react/src/hooks/use-media-provider.d.ts +0 -7
- package/types/react/src/hooks/use-media-remote.d.ts +0 -12
- package/types/react/src/hooks/use-media-state.d.ts +0 -15
- package/types/react/src/hooks/use-signals.d.ts +0 -5
- package/types/react/src/hooks/use-slider-preview.d.ts +0 -27
- package/types/react/src/hooks/use-slider-state.d.ts +0 -16
- package/types/react/src/hooks/use-state.d.ts +0 -18
- package/types/react/src/hooks/use-text-cues.d.ts +0 -6
- package/types/react/src/hooks/use-thumbnails.d.ts +0 -16
- package/types/react/src/icon.d.ts +0 -17
- package/types/react/src/icons.d.ts +0 -215
- package/types/react/src/index.d.ts +0 -78
- package/types/react/src/providers/remotion/index.d.ts +0 -7
- package/types/react/src/providers/remotion/layout-engine.d.ts +0 -8
- package/types/react/src/providers/remotion/loader.d.ts +0 -9
- package/types/react/src/providers/remotion/playback-engine.d.ts +0 -11
- package/types/react/src/providers/remotion/provider.d.ts +0 -26
- package/types/react/src/providers/remotion/type-check.d.ts +0 -6
- package/types/react/src/providers/remotion/types.d.ts +0 -91
- package/types/react/src/providers/remotion/ui/context.d.ts +0 -17
- package/types/react/src/providers/remotion/ui/error-boundary.d.ts +0 -21
- package/types/react/src/providers/remotion/ui/poster.d.ts +0 -18
- package/types/react/src/providers/remotion/ui/slider-thumbnail.d.ts +0 -17
- package/types/react/src/providers/remotion/ui/thumbnail.d.ts +0 -32
- package/types/react/src/providers/remotion/validate.d.ts +0 -12
- package/types/react/src/source.d.ts +0 -3
- package/types/react/src/utils.d.ts +0 -3
- package/types/vidstack/src/core/api/src-types.d.ts +0 -50
- package/types/vidstack/src/utils/mime.d.ts +0 -15
- package/types/vidstack/src/utils/network.d.ts +0 -17
- package/types/vidstack/src/utils/support.d.ts +0 -72
- package/vite.config.ts +0 -23
- /package/{npm/analyze.json.d.ts → analyze.json.d.ts} +0 -0
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { useSignal } from 'maverick.js/react';
|
|
4
|
-
import { camelToKebabCase } from 'maverick.js/std';
|
|
5
|
-
import {
|
|
6
|
-
FONT_COLOR_OPTION,
|
|
7
|
-
FONT_FAMILY_OPTION,
|
|
8
|
-
FONT_OPACITY_OPTION,
|
|
9
|
-
FONT_SIGNALS,
|
|
10
|
-
FONT_SIZE_OPTION,
|
|
11
|
-
FONT_TEXT_SHADOW_OPTION,
|
|
12
|
-
onFontReset,
|
|
13
|
-
type DefaultFontSettingProps,
|
|
14
|
-
type FontRadioOption,
|
|
15
|
-
type FontSliderOption,
|
|
16
|
-
} from 'vidstack/exports/font.ts';
|
|
17
|
-
|
|
18
|
-
import { useMediaPlayer } from '../../../../../hooks/use-media-player';
|
|
19
|
-
import { useMediaState } from '../../../../../hooks/use-media-state';
|
|
20
|
-
import * as Menu from '../../../../ui/menu';
|
|
21
|
-
import * as Slider from '../../../../ui/sliders/slider';
|
|
22
|
-
import { i18n, useDefaultLayoutContext, useDefaultLayoutWord } from '../../context';
|
|
23
|
-
import type { DefaultLayoutIcon } from '../../icons';
|
|
24
|
-
import {
|
|
25
|
-
createRadioOptions,
|
|
26
|
-
DefaultMenuButton,
|
|
27
|
-
DefaultMenuItem,
|
|
28
|
-
DefaultMenuRadioGroup,
|
|
29
|
-
DefaultMenuSection,
|
|
30
|
-
} from './items/menu-items';
|
|
31
|
-
import { DefaultMenuSliderItem, DefaultSliderParts, DefaultSliderSteps } from './items/menu-slider';
|
|
32
|
-
|
|
33
|
-
/* -------------------------------------------------------------------------------------------------
|
|
34
|
-
* DefaultFontMenu
|
|
35
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
36
|
-
|
|
37
|
-
function DefaultFontMenu() {
|
|
38
|
-
const label = useDefaultLayoutWord('Caption Styles'),
|
|
39
|
-
$hasCaptions = useMediaState('hasCaptions'),
|
|
40
|
-
fontSectionLabel = useDefaultLayoutWord('Font'),
|
|
41
|
-
textSectionLabel = useDefaultLayoutWord('Text'),
|
|
42
|
-
textBgSectionLabel = useDefaultLayoutWord('Text Background'),
|
|
43
|
-
displayBgSectionLabel = useDefaultLayoutWord('Display Background');
|
|
44
|
-
|
|
45
|
-
if (!$hasCaptions) return null;
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<Menu.Root className="vds-font-menu vds-menu">
|
|
49
|
-
<DefaultMenuButton label={label} />
|
|
50
|
-
<Menu.Content className="vds-font-style-items vds-menu-items">
|
|
51
|
-
<DefaultMenuSection label={fontSectionLabel}>
|
|
52
|
-
<DefaultFontFamilyMenu />
|
|
53
|
-
<DefaultFontSizeSlider />
|
|
54
|
-
</DefaultMenuSection>
|
|
55
|
-
|
|
56
|
-
<DefaultMenuSection label={textSectionLabel}>
|
|
57
|
-
<DefaultTextColorInput />
|
|
58
|
-
<DefaultTextShadowMenu />
|
|
59
|
-
<DefaultTextOpacitySlider />
|
|
60
|
-
</DefaultMenuSection>
|
|
61
|
-
|
|
62
|
-
<DefaultMenuSection label={textBgSectionLabel}>
|
|
63
|
-
<DefaultTextBgInput />
|
|
64
|
-
<DefaultTextBgOpacitySlider />
|
|
65
|
-
</DefaultMenuSection>
|
|
66
|
-
|
|
67
|
-
<DefaultMenuSection label={displayBgSectionLabel}>
|
|
68
|
-
<DefaultDisplayBgInput />
|
|
69
|
-
<DefaultDisplayBgOpacitySlider />
|
|
70
|
-
</DefaultMenuSection>
|
|
71
|
-
|
|
72
|
-
<DefaultMenuSection>
|
|
73
|
-
<DefaultResetMenuItem />
|
|
74
|
-
</DefaultMenuSection>
|
|
75
|
-
</Menu.Content>
|
|
76
|
-
</Menu.Root>
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
DefaultFontMenu.displayName = 'DefaultFontMenu';
|
|
81
|
-
export { DefaultFontMenu };
|
|
82
|
-
|
|
83
|
-
/* -------------------------------------------------------------------------------------------------
|
|
84
|
-
* DefaultFontFamilyMenu
|
|
85
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
86
|
-
|
|
87
|
-
function DefaultFontFamilyMenu() {
|
|
88
|
-
return <DefaultFontSetting label="Family" type="fontFamily" option={FONT_FAMILY_OPTION} />;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
DefaultFontFamilyMenu.displayName = 'DefaultFontFamilyMenu';
|
|
92
|
-
|
|
93
|
-
/* -------------------------------------------------------------------------------------------------
|
|
94
|
-
* DefaultFontSizeSlider
|
|
95
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
96
|
-
|
|
97
|
-
function DefaultFontSizeSlider() {
|
|
98
|
-
const { icons: Icons } = useDefaultLayoutContext(),
|
|
99
|
-
option: FontSliderOption = {
|
|
100
|
-
...FONT_SIZE_OPTION,
|
|
101
|
-
upIcon: Icons.Menu.FontSizeUp,
|
|
102
|
-
downIcon: Icons.Menu.FontSizeDown,
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
return <DefaultFontSetting label="Size" type="fontSize" option={option} />;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
DefaultFontSizeSlider.displayName = 'DefaultFontSizeSlider';
|
|
109
|
-
|
|
110
|
-
/* -------------------------------------------------------------------------------------------------
|
|
111
|
-
* DefaultTextColoInput
|
|
112
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
113
|
-
|
|
114
|
-
function DefaultTextColorInput() {
|
|
115
|
-
return <DefaultFontSetting label="Color" type="textColor" option={FONT_COLOR_OPTION} />;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
DefaultTextColorInput.displayName = 'DefaultTextColorInput';
|
|
119
|
-
|
|
120
|
-
/* -------------------------------------------------------------------------------------------------
|
|
121
|
-
* DefaultTextOpacitySlider
|
|
122
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
123
|
-
|
|
124
|
-
function DefaultTextOpacitySlider() {
|
|
125
|
-
const { icons: Icons } = useDefaultLayoutContext(),
|
|
126
|
-
option = {
|
|
127
|
-
...FONT_OPACITY_OPTION,
|
|
128
|
-
upIcon: Icons.Menu.OpacityUp,
|
|
129
|
-
downIcon: Icons.Menu.OpacityDown,
|
|
130
|
-
};
|
|
131
|
-
return <DefaultFontSetting label="Opacity" type="textOpacity" option={option} />;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
DefaultTextOpacitySlider.displayName = 'DefaultTextOpacitySlider';
|
|
135
|
-
|
|
136
|
-
/* -------------------------------------------------------------------------------------------------
|
|
137
|
-
* DefaultTextShadowMenu
|
|
138
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
139
|
-
|
|
140
|
-
function DefaultTextShadowMenu() {
|
|
141
|
-
return <DefaultFontSetting label="Shadow" type="textShadow" option={FONT_TEXT_SHADOW_OPTION} />;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
DefaultTextShadowMenu.displayName = 'DefaultTextShadowMenu';
|
|
145
|
-
|
|
146
|
-
/* -------------------------------------------------------------------------------------------------
|
|
147
|
-
* DefaultTextBgInput
|
|
148
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
149
|
-
|
|
150
|
-
function DefaultTextBgInput() {
|
|
151
|
-
return <DefaultFontSetting label="Color" type="textBg" option={FONT_COLOR_OPTION} />;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
DefaultTextBgInput.displayName = 'DefaultTextBgInput';
|
|
155
|
-
|
|
156
|
-
/* -------------------------------------------------------------------------------------------------
|
|
157
|
-
* DefaultTextBgOpacitySlider
|
|
158
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
159
|
-
|
|
160
|
-
function DefaultTextBgOpacitySlider() {
|
|
161
|
-
const { icons: Icons } = useDefaultLayoutContext(),
|
|
162
|
-
option = {
|
|
163
|
-
...FONT_OPACITY_OPTION,
|
|
164
|
-
upIcon: Icons.Menu.OpacityUp,
|
|
165
|
-
downIcon: Icons.Menu.OpacityDown,
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
return <DefaultFontSetting label="Opacity" type="textBgOpacity" option={option} />;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
DefaultTextBgOpacitySlider.displayName = 'DefaultTextBgOpacitySlider';
|
|
172
|
-
|
|
173
|
-
/* -------------------------------------------------------------------------------------------------
|
|
174
|
-
* DefaultDisplayBgInput
|
|
175
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
176
|
-
|
|
177
|
-
function DefaultDisplayBgInput() {
|
|
178
|
-
return <DefaultFontSetting label="Color" type="displayBg" option={FONT_COLOR_OPTION} />;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
DefaultDisplayBgInput.displayName = 'DefaultDisplayBgInput';
|
|
182
|
-
|
|
183
|
-
/* -------------------------------------------------------------------------------------------------
|
|
184
|
-
* DefaultDisplayBgOpacitySlider
|
|
185
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
186
|
-
|
|
187
|
-
function DefaultDisplayBgOpacitySlider() {
|
|
188
|
-
const { icons: Icons } = useDefaultLayoutContext(),
|
|
189
|
-
option = {
|
|
190
|
-
...FONT_OPACITY_OPTION,
|
|
191
|
-
upIcon: Icons.Menu.OpacityUp,
|
|
192
|
-
downIcon: Icons.Menu.OpacityDown,
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
return <DefaultFontSetting label="Opacity" type="displayBgOpacity" option={option} />;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
DefaultDisplayBgOpacitySlider.displayName = 'DefaultDisplayBgOpacitySlider';
|
|
199
|
-
|
|
200
|
-
/* -------------------------------------------------------------------------------------------------
|
|
201
|
-
* DefaultFontSetting
|
|
202
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
203
|
-
|
|
204
|
-
function DefaultFontSetting({ label, option, type }: DefaultFontSettingProps) {
|
|
205
|
-
const player = useMediaPlayer(),
|
|
206
|
-
$currentValue = FONT_SIGNALS[type],
|
|
207
|
-
$value = useSignal($currentValue),
|
|
208
|
-
translatedLabel = useDefaultLayoutWord(label);
|
|
209
|
-
|
|
210
|
-
const notify = React.useCallback(() => {
|
|
211
|
-
player?.dispatchEvent(new Event('vds-font-change'));
|
|
212
|
-
}, [player]);
|
|
213
|
-
|
|
214
|
-
const onChange = React.useCallback(
|
|
215
|
-
(newValue: string) => {
|
|
216
|
-
$currentValue.set(newValue);
|
|
217
|
-
notify();
|
|
218
|
-
},
|
|
219
|
-
[$currentValue, notify],
|
|
220
|
-
);
|
|
221
|
-
|
|
222
|
-
if (option.type === 'color') {
|
|
223
|
-
function onColorChange(event) {
|
|
224
|
-
onChange(event.target.value);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
return (
|
|
228
|
-
<DefaultMenuItem label={translatedLabel}>
|
|
229
|
-
<input className="vds-color-picker" type="color" value={$value} onChange={onColorChange} />
|
|
230
|
-
</DefaultMenuItem>
|
|
231
|
-
);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
if (option.type === 'slider') {
|
|
235
|
-
const { min, max, step, upIcon, downIcon } = option;
|
|
236
|
-
|
|
237
|
-
function onSliderValueChange(value) {
|
|
238
|
-
onChange(value + '%');
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
return (
|
|
242
|
-
<DefaultMenuSliderItem
|
|
243
|
-
label={translatedLabel}
|
|
244
|
-
value={$value}
|
|
245
|
-
UpIcon={upIcon as DefaultLayoutIcon}
|
|
246
|
-
DownIcon={downIcon as DefaultLayoutIcon}
|
|
247
|
-
isMin={$value === min + '%'}
|
|
248
|
-
isMax={$value === max + '%'}
|
|
249
|
-
>
|
|
250
|
-
<Slider.Root
|
|
251
|
-
className="vds-slider"
|
|
252
|
-
min={min}
|
|
253
|
-
max={max}
|
|
254
|
-
step={step}
|
|
255
|
-
keyStep={step}
|
|
256
|
-
value={parseInt($value)}
|
|
257
|
-
aria-label={translatedLabel}
|
|
258
|
-
onValueChange={onSliderValueChange}
|
|
259
|
-
onDragValueChange={onSliderValueChange}
|
|
260
|
-
>
|
|
261
|
-
<DefaultSliderParts />
|
|
262
|
-
<DefaultSliderSteps />
|
|
263
|
-
</Slider.Root>
|
|
264
|
-
</DefaultMenuSliderItem>
|
|
265
|
-
);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
if (option.type === 'radio') {
|
|
269
|
-
return (
|
|
270
|
-
<DefaultFontRadioGroup
|
|
271
|
-
id={camelToKebabCase(type)}
|
|
272
|
-
label={translatedLabel}
|
|
273
|
-
value={$value}
|
|
274
|
-
values={option.values}
|
|
275
|
-
onChange={onChange}
|
|
276
|
-
/>
|
|
277
|
-
);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
return null;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
DefaultFontSetting.displayName = 'DefaultFontSetting';
|
|
284
|
-
|
|
285
|
-
/* -------------------------------------------------------------------------------------------------
|
|
286
|
-
* DefaultFontRadioGroup
|
|
287
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
288
|
-
|
|
289
|
-
interface DefaultFontRadioGroupProps {
|
|
290
|
-
id: string;
|
|
291
|
-
label: string;
|
|
292
|
-
value: string;
|
|
293
|
-
values: FontRadioOption['values'];
|
|
294
|
-
onChange: (value: string) => void;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
function DefaultFontRadioGroup({ id, label, value, values, onChange }: DefaultFontRadioGroupProps) {
|
|
298
|
-
const radioOptions = createRadioOptions(values),
|
|
299
|
-
{ translations } = useDefaultLayoutContext(),
|
|
300
|
-
hint = React.useMemo(() => {
|
|
301
|
-
const label = radioOptions.find((radio) => radio.value === value)?.label || '';
|
|
302
|
-
return i18n(translations, label);
|
|
303
|
-
}, [value, radioOptions]);
|
|
304
|
-
|
|
305
|
-
return (
|
|
306
|
-
<Menu.Root className={`vds-${id}-menu vds-menu`}>
|
|
307
|
-
<DefaultMenuButton label={label} hint={hint} />
|
|
308
|
-
<Menu.Items className="vds-menu-items">
|
|
309
|
-
<DefaultMenuRadioGroup value={value} options={radioOptions} onChange={onChange} />
|
|
310
|
-
</Menu.Items>
|
|
311
|
-
</Menu.Root>
|
|
312
|
-
);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
DefaultFontRadioGroup.displayName = 'DefaultFontRadioGroup';
|
|
316
|
-
|
|
317
|
-
/* -------------------------------------------------------------------------------------------------
|
|
318
|
-
* DefaultResetMenuItem
|
|
319
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
320
|
-
|
|
321
|
-
function DefaultResetMenuItem() {
|
|
322
|
-
const resetText = useDefaultLayoutWord('Reset');
|
|
323
|
-
|
|
324
|
-
return (
|
|
325
|
-
<button className="vds-menu-item" role="menuitem" onClick={onFontReset}>
|
|
326
|
-
<span className="vds-menu-item-label">{resetText}</span>
|
|
327
|
-
</button>
|
|
328
|
-
);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
DefaultResetMenuItem.displayName = 'DefaultResetMenuItem';
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { isBoolean, isKeyboardClick } from 'maverick.js/std';
|
|
4
|
-
|
|
5
|
-
export interface DefaultMenuCheckboxProps {
|
|
6
|
-
label: string;
|
|
7
|
-
checked?: boolean;
|
|
8
|
-
storageKey?: string;
|
|
9
|
-
defaultChecked?: boolean;
|
|
10
|
-
onChange?(checked: boolean, trigger?: Event): void;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function DefaultMenuCheckbox({
|
|
14
|
-
label,
|
|
15
|
-
checked,
|
|
16
|
-
storageKey,
|
|
17
|
-
defaultChecked = false,
|
|
18
|
-
onChange,
|
|
19
|
-
}: DefaultMenuCheckboxProps) {
|
|
20
|
-
const [isChecked, setIsChecked] = React.useState(defaultChecked),
|
|
21
|
-
[isActive, setIsActive] = React.useState(false);
|
|
22
|
-
|
|
23
|
-
React.useEffect(() => {
|
|
24
|
-
const savedValue = storageKey ? localStorage.getItem(storageKey) : null,
|
|
25
|
-
checked = !!(savedValue ?? defaultChecked);
|
|
26
|
-
setIsChecked(checked);
|
|
27
|
-
onChange?.(checked);
|
|
28
|
-
}, []);
|
|
29
|
-
|
|
30
|
-
React.useEffect(() => {
|
|
31
|
-
if (isBoolean(checked)) setIsChecked(checked);
|
|
32
|
-
}, [checked]);
|
|
33
|
-
|
|
34
|
-
function onPress(event?: React.PointerEvent | React.KeyboardEvent) {
|
|
35
|
-
if (event && 'button' in event && event?.button === 1) return;
|
|
36
|
-
|
|
37
|
-
const toggledCheck = !isChecked;
|
|
38
|
-
|
|
39
|
-
setIsChecked(toggledCheck);
|
|
40
|
-
if (storageKey) localStorage.setItem(storageKey, toggledCheck ? '1' : '');
|
|
41
|
-
|
|
42
|
-
onChange?.(toggledCheck, event?.nativeEvent);
|
|
43
|
-
|
|
44
|
-
setIsActive(false);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function onActive(event: React.PointerEvent) {
|
|
48
|
-
if (event.button !== 0) return;
|
|
49
|
-
setIsActive(true);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function onKeyDown(event: React.KeyboardEvent) {
|
|
53
|
-
if (isKeyboardClick(event.nativeEvent)) onPress();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<div
|
|
58
|
-
className="vds-menu-checkbox"
|
|
59
|
-
role="menuitemcheckbox"
|
|
60
|
-
tabIndex={0}
|
|
61
|
-
aria-label={label}
|
|
62
|
-
aria-checked={isChecked ? 'true' : 'false'}
|
|
63
|
-
data-active={isActive ? '' : null}
|
|
64
|
-
onPointerUp={onPress}
|
|
65
|
-
onPointerDown={onActive}
|
|
66
|
-
onKeyDown={onKeyDown}
|
|
67
|
-
/>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
DefaultMenuCheckbox.displayName = 'DefaultMenuCheckbox';
|
|
72
|
-
export { DefaultMenuCheckbox };
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import { isArray } from 'maverick.js/std';
|
|
4
|
-
|
|
5
|
-
import * as Menu from '../../../../../ui/menu';
|
|
6
|
-
import { DefaultLayoutContext, useDefaultLayoutContext } from '../../../context';
|
|
7
|
-
import type { DefaultLayoutIcon } from '../../../icons';
|
|
8
|
-
|
|
9
|
-
/* -------------------------------------------------------------------------------------------------
|
|
10
|
-
* DefaultMenuSection
|
|
11
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
12
|
-
|
|
13
|
-
export interface DefaultMenuSectionProps {
|
|
14
|
-
label?: string;
|
|
15
|
-
value?: string;
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function DefaultMenuSection({ label, value, children }: DefaultMenuSectionProps) {
|
|
20
|
-
const id = React.useId();
|
|
21
|
-
|
|
22
|
-
if (!label) {
|
|
23
|
-
return (
|
|
24
|
-
<div className="vds-menu-section">
|
|
25
|
-
<div className="vds-menu-section-body">{children}</div>
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<section className="vds-menu-section" role="group" aria-labelledby={id}>
|
|
32
|
-
<div className="vds-menu-section-title">
|
|
33
|
-
<header id={id}>{label}</header>
|
|
34
|
-
{value ? <div className="vds-menu-section-value">{value}</div> : null}
|
|
35
|
-
</div>
|
|
36
|
-
<div className="vds-menu-section-body">{children}</div>
|
|
37
|
-
</section>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
DefaultMenuSection.displayName = 'DefaultMenuSection';
|
|
42
|
-
export { DefaultMenuSection };
|
|
43
|
-
|
|
44
|
-
/* -------------------------------------------------------------------------------------------------
|
|
45
|
-
* DefaultMenuButton
|
|
46
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
47
|
-
|
|
48
|
-
export interface DefaultMenuButtonProps {
|
|
49
|
-
label: string;
|
|
50
|
-
hint?: string;
|
|
51
|
-
disabled?: boolean;
|
|
52
|
-
Icon?: DefaultLayoutIcon;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function DefaultMenuButton({ label, hint = '', Icon, disabled = false }: DefaultMenuButtonProps) {
|
|
56
|
-
const { icons: Icons } = React.useContext(DefaultLayoutContext);
|
|
57
|
-
return (
|
|
58
|
-
<Menu.Button className="vds-menu-item" disabled={disabled}>
|
|
59
|
-
<Icons.Menu.ArrowLeft className="vds-menu-close-icon vds-icon" />
|
|
60
|
-
{Icon ? <Icon className="vds-menu-item-icon vds-icon" /> : null}
|
|
61
|
-
<span className="vds-menu-item-label">{label}</span>
|
|
62
|
-
<span className="vds-menu-item-hint">{hint}</span>
|
|
63
|
-
<Icons.Menu.ArrowRight className="vds-menu-open-icon vds-icon" />
|
|
64
|
-
</Menu.Button>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
DefaultMenuButton.displayName = 'DefaultMenuButton';
|
|
69
|
-
export { DefaultMenuButton };
|
|
70
|
-
|
|
71
|
-
/* -------------------------------------------------------------------------------------------------
|
|
72
|
-
* DefaultMenuItem
|
|
73
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
74
|
-
|
|
75
|
-
export interface DefaultMenuItemProps {
|
|
76
|
-
label: string;
|
|
77
|
-
children: React.ReactNode;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function DefaultMenuItem({ label, children }: DefaultMenuItemProps) {
|
|
81
|
-
return (
|
|
82
|
-
<div className="vds-menu-item">
|
|
83
|
-
<div className="vds-menu-item-label">{label}</div>
|
|
84
|
-
{children}
|
|
85
|
-
</div>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
DefaultMenuItem.displayName = 'DefaultMenuItem';
|
|
90
|
-
export { DefaultMenuItem };
|
|
91
|
-
|
|
92
|
-
/* -------------------------------------------------------------------------------------------------
|
|
93
|
-
* DefaultMenuRadioGroup
|
|
94
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
95
|
-
|
|
96
|
-
export interface DefaultMenuRadioGroupProps {
|
|
97
|
-
value: string;
|
|
98
|
-
options: { label: string; value: string }[];
|
|
99
|
-
onChange?(newValue: string): void;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function DefaultMenuRadioGroup({ value, options, onChange }: DefaultMenuRadioGroupProps) {
|
|
103
|
-
const { icons: Icons } = useDefaultLayoutContext();
|
|
104
|
-
return (
|
|
105
|
-
<Menu.RadioGroup className="vds-radio-group" value={value} onChange={onChange}>
|
|
106
|
-
{options.map((option) => (
|
|
107
|
-
<Menu.Radio className="vds-radio" value={option.value} key={option.value}>
|
|
108
|
-
<Icons.Menu.RadioCheck className="vds-icon" />
|
|
109
|
-
<span className="vds-radio-label" data-part="label">
|
|
110
|
-
{option.label}
|
|
111
|
-
</span>
|
|
112
|
-
</Menu.Radio>
|
|
113
|
-
))}
|
|
114
|
-
</Menu.RadioGroup>
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
DefaultMenuRadioGroup.displayName = 'DefaultMenuRadioGroup';
|
|
119
|
-
export { DefaultMenuRadioGroup };
|
|
120
|
-
|
|
121
|
-
/* -------------------------------------------------------------------------------------------------
|
|
122
|
-
* Utils
|
|
123
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
124
|
-
|
|
125
|
-
export function createRadioOptions(
|
|
126
|
-
entries: string[] | Record<string, string>,
|
|
127
|
-
): { label: string; value: string }[] {
|
|
128
|
-
return React.useMemo(
|
|
129
|
-
() =>
|
|
130
|
-
isArray(entries)
|
|
131
|
-
? entries.map((entry) => ({ label: entry, value: entry.toLowerCase() }))
|
|
132
|
-
: Object.keys(entries).map((label) => ({ label, value: entries[label] })),
|
|
133
|
-
[entries],
|
|
134
|
-
);
|
|
135
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
import * as Slider from '../../../../../ui/sliders/slider';
|
|
4
|
-
import type { DefaultLayoutIcon } from '../../../icons';
|
|
5
|
-
|
|
6
|
-
/* -------------------------------------------------------------------------------------------------
|
|
7
|
-
* DefaultMenuSliderItem
|
|
8
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
9
|
-
|
|
10
|
-
export interface DefaultMenuSliderItemProps {
|
|
11
|
-
label?: string;
|
|
12
|
-
value?: string;
|
|
13
|
-
UpIcon?: DefaultLayoutIcon;
|
|
14
|
-
DownIcon?: DefaultLayoutIcon;
|
|
15
|
-
children: React.ReactNode;
|
|
16
|
-
isMin: boolean;
|
|
17
|
-
isMax: boolean;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function DefaultMenuSliderItem({
|
|
21
|
-
label,
|
|
22
|
-
value,
|
|
23
|
-
UpIcon,
|
|
24
|
-
DownIcon,
|
|
25
|
-
children,
|
|
26
|
-
isMin,
|
|
27
|
-
isMax,
|
|
28
|
-
}: DefaultMenuSliderItemProps) {
|
|
29
|
-
const hasTitle = label || value,
|
|
30
|
-
Content = (
|
|
31
|
-
<>
|
|
32
|
-
{DownIcon ? <DownIcon className="vds-icon down" /> : null}
|
|
33
|
-
{children}
|
|
34
|
-
{UpIcon ? <UpIcon className="vds-icon up" /> : null}
|
|
35
|
-
</>
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<div
|
|
40
|
-
className={`vds-menu-item vds-menu-slider-item${hasTitle ? ' group' : ''}`}
|
|
41
|
-
data-min={isMin ? '' : null}
|
|
42
|
-
data-max={isMax ? '' : null}
|
|
43
|
-
>
|
|
44
|
-
{hasTitle ? (
|
|
45
|
-
<>
|
|
46
|
-
<div className="vds-menu-slider-title">
|
|
47
|
-
{label ? <div>{label}</div> : null}
|
|
48
|
-
{value ? <div>{value}</div> : null}
|
|
49
|
-
</div>
|
|
50
|
-
<div className="vds-menu-slider-body">{Content}</div>
|
|
51
|
-
</>
|
|
52
|
-
) : (
|
|
53
|
-
Content
|
|
54
|
-
)}
|
|
55
|
-
</div>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
DefaultMenuSliderItem.displayName = 'DefaultMenuSliderItem';
|
|
60
|
-
export { DefaultMenuSliderItem };
|
|
61
|
-
|
|
62
|
-
/* -------------------------------------------------------------------------------------------------
|
|
63
|
-
* DefaultSliderParts
|
|
64
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
65
|
-
|
|
66
|
-
function DefaultSliderParts() {
|
|
67
|
-
return (
|
|
68
|
-
<>
|
|
69
|
-
<Slider.Track className="vds-slider-track" />
|
|
70
|
-
<Slider.TrackFill className="vds-slider-track-fill vds-slider-track" />
|
|
71
|
-
<Slider.Thumb className="vds-slider-thumb" />
|
|
72
|
-
</>
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
DefaultSliderParts.displayName = 'DefaultSliderParts';
|
|
77
|
-
export { DefaultSliderParts };
|
|
78
|
-
|
|
79
|
-
/* -------------------------------------------------------------------------------------------------
|
|
80
|
-
* DefaultSliderSteps
|
|
81
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
82
|
-
|
|
83
|
-
function DefaultSliderSteps() {
|
|
84
|
-
return (
|
|
85
|
-
<Slider.Steps className="vds-slider-steps">
|
|
86
|
-
{(step) => <div className="vds-slider-step" key={String(step)} />}
|
|
87
|
-
</Slider.Steps>
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
DefaultSliderSteps.displayName = 'DefaultSliderSteps';
|
|
92
|
-
export { DefaultSliderSteps };
|