mado-ui 0.5.0 → 0.5.2
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/button.d.ts +3 -2
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/details.d.ts +5 -4
- package/dist/components/details.d.ts.map +1 -0
- package/dist/components/drop-down.d.ts +8 -7
- package/dist/components/drop-down.d.ts.map +1 -0
- package/dist/components/form/fieldset.d.ts +3 -1
- package/dist/components/form/fieldset.d.ts.map +1 -0
- package/dist/components/form/index.d.ts +2 -1
- package/dist/components/form/index.d.ts.map +1 -0
- package/dist/components/form/input/date/index.d.ts +3 -1
- package/dist/components/form/input/date/index.d.ts.map +1 -0
- package/dist/components/form/input/index.d.ts +3 -2
- package/dist/components/form/input/index.d.ts.map +1 -0
- package/dist/components/form/submit-button.d.ts +3 -2
- package/dist/components/form/submit-button.d.ts.map +1 -0
- package/dist/components/form/textarea.d.ts +3 -2
- package/dist/components/form/textarea.d.ts.map +1 -0
- package/dist/components/ghost.d.ts +4 -4
- package/dist/components/ghost.d.ts.map +1 -0
- package/dist/components/heading.d.ts +3 -2
- package/dist/components/heading.d.ts.map +1 -0
- package/dist/components/iframe.d.ts +3 -2
- package/dist/components/iframe.d.ts.map +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/link.d.ts +4 -3
- package/dist/components/link.d.ts.map +1 -0
- package/dist/components/modal.d.ts +7 -6
- package/dist/components/modal.d.ts.map +1 -0
- package/dist/components/time.d.ts +3 -2
- package/dist/components/time.d.ts.map +1 -0
- package/dist/components/tooltip.d.ts +5 -4
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/video.d.ts +3 -2
- package/dist/components/video.d.ts.map +1 -0
- package/dist/components.d.ts +665 -1
- package/dist/components.d.ts.map +1 -0
- package/dist/components.esm.js +262 -100
- package/dist/components.esm.js.map +1 -1
- package/dist/components.js +261 -99
- package/dist/components.js.map +1 -1
- package/dist/hooks/create-fast-context.d.ts +1 -0
- package/dist/hooks/create-fast-context.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/use-fieldset-context.d.ts +1 -0
- package/dist/hooks/use-fieldset-context.d.ts.map +1 -0
- package/dist/hooks/use-form-context.d.ts +1 -0
- package/dist/hooks/use-form-context.d.ts.map +1 -0
- package/dist/hooks/use-form-status.d.ts +1 -0
- package/dist/hooks/use-form-status.d.ts.map +1 -0
- package/dist/hooks/use-pointer-movement.d.ts +17 -0
- package/dist/hooks/use-pointer-movement.d.ts.map +1 -0
- package/dist/hooks.d.ts +95 -1
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.esm.js +104 -2
- package/dist/hooks.esm.js.map +1 -1
- package/dist/hooks.js +103 -0
- package/dist/hooks.js.map +1 -1
- package/dist/icons/10-arrow-trianglehead-clockwise.d.ts +1 -0
- package/dist/icons/10-arrow-trianglehead-clockwise.d.ts.map +1 -0
- package/dist/icons/10-arrow-trianglehead-counterclockwise.d.ts +1 -0
- package/dist/icons/10-arrow-trianglehead-counterclockwise.d.ts.map +1 -0
- package/dist/icons/15-arrow-trianglehead-clockwise.d.ts +1 -0
- package/dist/icons/15-arrow-trianglehead-clockwise.d.ts.map +1 -0
- package/dist/icons/15-arrow-trianglehead-counterclockwise.d.ts +1 -0
- package/dist/icons/15-arrow-trianglehead-counterclockwise.d.ts.map +1 -0
- package/dist/icons/3-people.d.ts +1 -0
- package/dist/icons/3-people.d.ts.map +1 -0
- package/dist/icons/3-rectangles-desktop-fill.d.ts +1 -0
- package/dist/icons/3-rectangles-desktop-fill.d.ts.map +1 -0
- package/dist/icons/3-rectangles-desktop.d.ts +1 -0
- package/dist/icons/3-rectangles-desktop.d.ts.map +1 -0
- package/dist/icons/30-arrow-trianglehead-clockwise.d.ts +1 -0
- package/dist/icons/30-arrow-trianglehead-clockwise.d.ts.map +1 -0
- package/dist/icons/30-arrow-trianglehead-counterclockwise.d.ts +1 -0
- package/dist/icons/30-arrow-trianglehead-counterclockwise.d.ts.map +1 -0
- package/dist/icons/45-arrow-trianglehead-clockwise.d.ts +1 -0
- package/dist/icons/45-arrow-trianglehead-clockwise.d.ts.map +1 -0
- package/dist/icons/45-arrow-trianglehead-counterclockwise.d.ts +1 -0
- package/dist/icons/45-arrow-trianglehead-counterclockwise.d.ts.map +1 -0
- package/dist/icons/5-arrow-trianglehead-clockwise.d.ts +1 -0
- package/dist/icons/5-arrow-trianglehead-clockwise.d.ts.map +1 -0
- package/dist/icons/5-arrow-trianglehead-counterclockwise.d.ts +1 -0
- package/dist/icons/5-arrow-trianglehead-counterclockwise.d.ts.map +1 -0
- package/dist/icons/60-arrow-trianglehead-clockwise.d.ts +1 -0
- package/dist/icons/60-arrow-trianglehead-clockwise.d.ts.map +1 -0
- package/dist/icons/60-arrow-trianglehead-counterclockwise.d.ts +1 -0
- package/dist/icons/60-arrow-trianglehead-counterclockwise.d.ts.map +1 -0
- package/dist/icons/75-arrow-trianglehead-clockwise.d.ts +1 -0
- package/dist/icons/75-arrow-trianglehead-clockwise.d.ts.map +1 -0
- package/dist/icons/75-arrow-trianglehead-counterclockwise.d.ts +1 -0
- package/dist/icons/75-arrow-trianglehead-counterclockwise.d.ts.map +1 -0
- package/dist/icons/90-arrow-trianglehead-clockwise.d.ts +1 -0
- package/dist/icons/90-arrow-trianglehead-clockwise.d.ts.map +1 -0
- package/dist/icons/90-arrow-trianglehead-counterclockwise.d.ts +1 -0
- package/dist/icons/90-arrow-trianglehead-counterclockwise.d.ts.map +1 -0
- package/dist/icons/airplane.d.ts +1 -0
- package/dist/icons/airplane.d.ts.map +1 -0
- package/dist/icons/arrow-down-backward-and-arrow-up-forward-rectangle.d.ts +1 -0
- package/dist/icons/arrow-down-backward-and-arrow-up-forward-rectangle.d.ts.map +1 -0
- package/dist/icons/arrow-triangle-2-circlepath-circle-fill.d.ts +1 -0
- package/dist/icons/arrow-triangle-2-circlepath-circle-fill.d.ts.map +1 -0
- package/dist/icons/arrow-triangle-2-circlepath-circle.d.ts +1 -0
- package/dist/icons/arrow-triangle-2-circlepath-circle.d.ts.map +1 -0
- package/dist/icons/arrow-up-forward-and-arrow-down-backward-rectangle.d.ts +1 -0
- package/dist/icons/arrow-up-forward-and-arrow-down-backward-rectangle.d.ts.map +1 -0
- package/dist/icons/bag-fill.d.ts +1 -0
- package/dist/icons/bag-fill.d.ts.map +1 -0
- package/dist/icons/banknote.d.ts +1 -0
- package/dist/icons/banknote.d.ts.map +1 -0
- package/dist/icons/bell-fill.d.ts +1 -0
- package/dist/icons/bell-fill.d.ts.map +1 -0
- package/dist/icons/bolt-car.d.ts +1 -0
- package/dist/icons/bolt-car.d.ts.map +1 -0
- package/dist/icons/bolt-fill.d.ts +1 -0
- package/dist/icons/bolt-fill.d.ts.map +1 -0
- package/dist/icons/bolt-ring-closed.d.ts +1 -0
- package/dist/icons/bolt-ring-closed.d.ts.map +1 -0
- package/dist/icons/bolt-trianglebadge-exclamationmark.d.ts +1 -0
- package/dist/icons/bolt-trianglebadge-exclamationmark.d.ts.map +1 -0
- package/dist/icons/book-fill.d.ts +1 -0
- package/dist/icons/book-fill.d.ts.map +1 -0
- package/dist/icons/bookmark-fill.d.ts +1 -0
- package/dist/icons/bookmark-fill.d.ts.map +1 -0
- package/dist/icons/briefcase-fill.d.ts +1 -0
- package/dist/icons/briefcase-fill.d.ts.map +1 -0
- package/dist/icons/bubble-left-fill.d.ts +1 -0
- package/dist/icons/bubble-left-fill.d.ts.map +1 -0
- package/dist/icons/building-2-fill.d.ts +1 -0
- package/dist/icons/building-2-fill.d.ts.map +1 -0
- package/dist/icons/calendar.d.ts +1 -0
- package/dist/icons/calendar.d.ts.map +1 -0
- package/dist/icons/camera-fill.d.ts +1 -0
- package/dist/icons/camera-fill.d.ts.map +1 -0
- package/dist/icons/car-fill.d.ts +1 -0
- package/dist/icons/car-fill.d.ts.map +1 -0
- package/dist/icons/cart-fill.d.ts +1 -0
- package/dist/icons/cart-fill.d.ts.map +1 -0
- package/dist/icons/chart-bar-doc-horizontal.d.ts +1 -0
- package/dist/icons/chart-bar-doc-horizontal.d.ts.map +1 -0
- package/dist/icons/checkmark-seal.d.ts +1 -0
- package/dist/icons/checkmark-seal.d.ts.map +1 -0
- package/dist/icons/checkmark.d.ts +1 -0
- package/dist/icons/checkmark.d.ts.map +1 -0
- package/dist/icons/chevron-compact-down.d.ts +1 -0
- package/dist/icons/chevron-compact-down.d.ts.map +1 -0
- package/dist/icons/chevron-down.d.ts +1 -0
- package/dist/icons/chevron-down.d.ts.map +1 -0
- package/dist/icons/chevron-left-forwardslash-chevron-right.d.ts +1 -0
- package/dist/icons/chevron-left-forwardslash-chevron-right.d.ts.map +1 -0
- package/dist/icons/chevron-left.d.ts +1 -0
- package/dist/icons/chevron-left.d.ts.map +1 -0
- package/dist/icons/chevron-right.d.ts +1 -0
- package/dist/icons/chevron-right.d.ts.map +1 -0
- package/dist/icons/chevron-up-chevron-down.d.ts +1 -0
- package/dist/icons/chevron-up-chevron-down.d.ts.map +1 -0
- package/dist/icons/circle-fill.d.ts +1 -0
- package/dist/icons/circle-fill.d.ts.map +1 -0
- package/dist/icons/clock-badge-checkmark.d.ts +1 -0
- package/dist/icons/clock-badge-checkmark.d.ts.map +1 -0
- package/dist/icons/clock-fill.d.ts +1 -0
- package/dist/icons/clock-fill.d.ts.map +1 -0
- package/dist/icons/cloud-fill.d.ts +1 -0
- package/dist/icons/cloud-fill.d.ts.map +1 -0
- package/dist/icons/cube-fill.d.ts +1 -0
- package/dist/icons/cube-fill.d.ts.map +1 -0
- package/dist/icons/curve-point-left.d.ts +1 -0
- package/dist/icons/curve-point-left.d.ts.map +1 -0
- package/dist/icons/dial-high.d.ts +1 -0
- package/dist/icons/dial-high.d.ts.map +1 -0
- package/dist/icons/doc-fill.d.ts +1 -0
- package/dist/icons/doc-fill.d.ts.map +1 -0
- package/dist/icons/doc-on-clipboard.d.ts +1 -0
- package/dist/icons/doc-on-clipboard.d.ts.map +1 -0
- package/dist/icons/doc-on-doc-fill.d.ts +1 -0
- package/dist/icons/doc-on-doc-fill.d.ts.map +1 -0
- package/dist/icons/doc-on-doc.d.ts +1 -0
- package/dist/icons/doc-on-doc.d.ts.map +1 -0
- package/dist/icons/doc-text-magnifyingglass.d.ts +1 -0
- package/dist/icons/doc-text-magnifyingglass.d.ts.map +1 -0
- package/dist/icons/dollar-sign.d.ts +1 -0
- package/dist/icons/dollar-sign.d.ts.map +1 -0
- package/dist/icons/ellipsis-circle-fill.d.ts +1 -0
- package/dist/icons/ellipsis-circle-fill.d.ts.map +1 -0
- package/dist/icons/ellipsis-circle.d.ts +1 -0
- package/dist/icons/ellipsis-circle.d.ts.map +1 -0
- package/dist/icons/envelope-fill.d.ts +1 -0
- package/dist/icons/envelope-fill.d.ts.map +1 -0
- package/dist/icons/envelope.d.ts +1 -0
- package/dist/icons/envelope.d.ts.map +1 -0
- package/dist/icons/exclamationmark-octagon.d.ts +1 -0
- package/dist/icons/exclamationmark-octagon.d.ts.map +1 -0
- package/dist/icons/eye.d.ts +1 -0
- package/dist/icons/eye.d.ts.map +1 -0
- package/dist/icons/figure-water-fitness.d.ts +1 -0
- package/dist/icons/figure-water-fitness.d.ts.map +1 -0
- package/dist/icons/flag-fill.d.ts +1 -0
- package/dist/icons/flag-fill.d.ts.map +1 -0
- package/dist/icons/flame-fill.d.ts +1 -0
- package/dist/icons/flame-fill.d.ts.map +1 -0
- package/dist/icons/folder-fill.d.ts +1 -0
- package/dist/icons/folder-fill.d.ts.map +1 -0
- package/dist/icons/folder.d.ts +1 -0
- package/dist/icons/folder.d.ts.map +1 -0
- package/dist/icons/gearshape-fill.d.ts +1 -0
- package/dist/icons/gearshape-fill.d.ts.map +1 -0
- package/dist/icons/gearshape.d.ts +1 -0
- package/dist/icons/gearshape.d.ts.map +1 -0
- package/dist/icons/gift-fill.d.ts +1 -0
- package/dist/icons/gift-fill.d.ts.map +1 -0
- package/dist/icons/globe-americas-fill.d.ts +1 -0
- package/dist/icons/globe-americas-fill.d.ts.map +1 -0
- package/dist/icons/hare-fill.d.ts +1 -0
- package/dist/icons/hare-fill.d.ts.map +1 -0
- package/dist/icons/house-deskclock.d.ts +1 -0
- package/dist/icons/house-deskclock.d.ts.map +1 -0
- package/dist/icons/house-fill.d.ts +1 -0
- package/dist/icons/house-fill.d.ts.map +1 -0
- package/dist/icons/house.d.ts +1 -0
- package/dist/icons/house.d.ts.map +1 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/iphone-house.d.ts +1 -0
- package/dist/icons/iphone-house.d.ts.map +1 -0
- package/dist/icons/light-ribbon.d.ts +1 -0
- package/dist/icons/light-ribbon.d.ts.map +1 -0
- package/dist/icons/lightbulb-fill.d.ts +1 -0
- package/dist/icons/lightbulb-fill.d.ts.map +1 -0
- package/dist/icons/lightbulb-led.d.ts +1 -0
- package/dist/icons/lightbulb-led.d.ts.map +1 -0
- package/dist/icons/list-bullet-clipboard-fill.d.ts +1 -0
- package/dist/icons/list-bullet-clipboard-fill.d.ts.map +1 -0
- package/dist/icons/magnifyingglass.d.ts +1 -0
- package/dist/icons/magnifyingglass.d.ts.map +1 -0
- package/dist/icons/map-pin-ellipse.d.ts +1 -0
- package/dist/icons/map-pin-ellipse.d.ts.map +1 -0
- package/dist/icons/minus-plus-batterblock.d.ts +1 -0
- package/dist/icons/minus-plus-batterblock.d.ts.map +1 -0
- package/dist/icons/network-shield.d.ts +1 -0
- package/dist/icons/network-shield.d.ts.map +1 -0
- package/dist/icons/network.d.ts +1 -0
- package/dist/icons/network.d.ts.map +1 -0
- package/dist/icons/newspaper-fill.d.ts +1 -0
- package/dist/icons/newspaper-fill.d.ts.map +1 -0
- package/dist/icons/number.d.ts +1 -0
- package/dist/icons/number.d.ts.map +1 -0
- package/dist/icons/paperplane-fill.d.ts +1 -0
- package/dist/icons/paperplane-fill.d.ts.map +1 -0
- package/dist/icons/pause-fill.d.ts +1 -0
- package/dist/icons/pause-fill.d.ts.map +1 -0
- package/dist/icons/person-crop-square.d.ts +1 -0
- package/dist/icons/person-crop-square.d.ts.map +1 -0
- package/dist/icons/person-fill-questionmark.d.ts +1 -0
- package/dist/icons/person-fill-questionmark.d.ts.map +1 -0
- package/dist/icons/person-fill.d.ts +1 -0
- package/dist/icons/person-fill.d.ts.map +1 -0
- package/dist/icons/person.d.ts +1 -0
- package/dist/icons/person.d.ts.map +1 -0
- package/dist/icons/phone-arrow-up-right.d.ts +1 -0
- package/dist/icons/phone-arrow-up-right.d.ts.map +1 -0
- package/dist/icons/phone-fill.d.ts +1 -0
- package/dist/icons/phone-fill.d.ts.map +1 -0
- package/dist/icons/phone.d.ts +1 -0
- package/dist/icons/phone.d.ts.map +1 -0
- package/dist/icons/photo-badge-arrow-down-fill.d.ts +1 -0
- package/dist/icons/photo-badge-arrow-down-fill.d.ts.map +1 -0
- package/dist/icons/photo-badge-arrow-down.d.ts +1 -0
- package/dist/icons/photo-badge-arrow-down.d.ts.map +1 -0
- package/dist/icons/play-fill.d.ts +1 -0
- package/dist/icons/play-fill.d.ts.map +1 -0
- package/dist/icons/play-rectangle-fill.d.ts +1 -0
- package/dist/icons/play-rectangle-fill.d.ts.map +1 -0
- package/dist/icons/plus.d.ts +1 -0
- package/dist/icons/plus.d.ts.map +1 -0
- package/dist/icons/qrcode.d.ts +1 -0
- package/dist/icons/qrcode.d.ts.map +1 -0
- package/dist/icons/rectangle-fill-on-arrow-down-forward-topleading-rectangle.d.ts +1 -0
- package/dist/icons/rectangle-fill-on-arrow-down-forward-topleading-rectangle.d.ts.map +1 -0
- package/dist/icons/rectangle-fill.d.ts +1 -0
- package/dist/icons/rectangle-fill.d.ts.map +1 -0
- package/dist/icons/rectangle-portrait-and-arrow-left-fill.d.ts +1 -0
- package/dist/icons/rectangle-portrait-and-arrow-left-fill.d.ts.map +1 -0
- package/dist/icons/rectangle-portrait-and-arrow-left.d.ts +1 -0
- package/dist/icons/rectangle-portrait-and-arrow-left.d.ts.map +1 -0
- package/dist/icons/rectangle-triangle-up.d.ts +1 -0
- package/dist/icons/rectangle-triangle-up.d.ts.map +1 -0
- package/dist/icons/rectangle.d.ts +1 -0
- package/dist/icons/rectangle.d.ts.map +1 -0
- package/dist/icons/sensor.d.ts +1 -0
- package/dist/icons/sensor.d.ts.map +1 -0
- package/dist/icons/signature.d.ts +1 -0
- package/dist/icons/signature.d.ts.map +1 -0
- package/dist/icons/solar-panel.d.ts +1 -0
- package/dist/icons/solar-panel.d.ts.map +1 -0
- package/dist/icons/speaker-fill.d.ts +1 -0
- package/dist/icons/speaker-fill.d.ts.map +1 -0
- package/dist/icons/speaker-minus-fill.d.ts +1 -0
- package/dist/icons/speaker-minus-fill.d.ts.map +1 -0
- package/dist/icons/speaker-minus.d.ts +1 -0
- package/dist/icons/speaker-minus.d.ts.map +1 -0
- package/dist/icons/speaker-plus-fill.d.ts +1 -0
- package/dist/icons/speaker-plus-fill.d.ts.map +1 -0
- package/dist/icons/speaker-plus.d.ts +1 -0
- package/dist/icons/speaker-plus.d.ts.map +1 -0
- package/dist/icons/speaker-slash-fill.d.ts +1 -0
- package/dist/icons/speaker-slash-fill.d.ts.map +1 -0
- package/dist/icons/speaker-slash.d.ts +1 -0
- package/dist/icons/speaker-slash.d.ts.map +1 -0
- package/dist/icons/speaker-wave-1-fill.d.ts +1 -0
- package/dist/icons/speaker-wave-1-fill.d.ts.map +1 -0
- package/dist/icons/speaker-wave-1.d.ts +1 -0
- package/dist/icons/speaker-wave-1.d.ts.map +1 -0
- package/dist/icons/speaker-wave-2-fill.d.ts +1 -0
- package/dist/icons/speaker-wave-2-fill.d.ts.map +1 -0
- package/dist/icons/speaker-wave-2.d.ts +1 -0
- package/dist/icons/speaker-wave-2.d.ts.map +1 -0
- package/dist/icons/speaker-wave-3-fill.d.ts +1 -0
- package/dist/icons/speaker-wave-3-fill.d.ts.map +1 -0
- package/dist/icons/speaker-wave-3.d.ts +1 -0
- package/dist/icons/speaker-wave-3.d.ts.map +1 -0
- package/dist/icons/speaker.d.ts +1 -0
- package/dist/icons/speaker.d.ts.map +1 -0
- package/dist/icons/square-and-arrow-down-fill.d.ts +1 -0
- package/dist/icons/square-and-arrow-down-fill.d.ts.map +1 -0
- package/dist/icons/square-and-arrow-down.d.ts +1 -0
- package/dist/icons/square-and-arrow-down.d.ts.map +1 -0
- package/dist/icons/square-and-arrow-up-fill.d.ts +1 -0
- package/dist/icons/square-and-arrow-up-fill.d.ts.map +1 -0
- package/dist/icons/square-and-arrow-up.d.ts +1 -0
- package/dist/icons/square-and-arrow-up.d.ts.map +1 -0
- package/dist/icons/square-and-pencil-fill.d.ts +1 -0
- package/dist/icons/square-and-pencil-fill.d.ts.map +1 -0
- package/dist/icons/square-and-pencil.d.ts +1 -0
- package/dist/icons/square-and-pencil.d.ts.map +1 -0
- package/dist/icons/text-bubble.d.ts +1 -0
- package/dist/icons/text-bubble.d.ts.map +1 -0
- package/dist/icons/trash-fill.d.ts +1 -0
- package/dist/icons/trash-fill.d.ts.map +1 -0
- package/dist/icons/trash.d.ts +1 -0
- package/dist/icons/trash.d.ts.map +1 -0
- package/dist/icons/tree.d.ts +1 -0
- package/dist/icons/tree.d.ts.map +1 -0
- package/dist/icons/umbrella-fill.d.ts +1 -0
- package/dist/icons/umbrella-fill.d.ts.map +1 -0
- package/dist/icons/xmark.d.ts +1 -0
- package/dist/icons/xmark.d.ts.map +1 -0
- package/dist/icons.d.ts +290 -1
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.esm.js +1 -1
- package/dist/icons.esm.js.map +1 -1
- package/dist/icons.js +1 -1
- package/dist/icons.js.map +1 -1
- package/dist/index.d.ts +665 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +262 -100
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +261 -99
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/utils.d.ts +1 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types.d.ts +39 -1
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/class-management.d.ts +1 -0
- package/dist/utils/class-management.d.ts.map +1 -0
- package/dist/utils/custom-tailwind-merge.d.ts +1 -0
- package/dist/utils/custom-tailwind-merge.d.ts.map +1 -0
- package/dist/utils/get-date.d.ts +1 -0
- package/dist/utils/get-date.d.ts.map +1 -0
- package/dist/utils/helpers.d.ts +1 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/math.d.ts +1 -0
- package/dist/utils/math.d.ts.map +1 -0
- package/dist/utils/regex.d.ts +1 -0
- package/dist/utils/regex.d.ts.map +1 -0
- package/dist/utils/string-manipulation.d.ts +1 -0
- package/dist/utils/string-manipulation.d.ts.map +1 -0
- package/dist/utils/tw-sort.d.ts +1 -0
- package/dist/utils/tw-sort.d.ts.map +1 -0
- package/dist/utils.d.ts +287 -1
- package/dist/utils.d.ts.map +1 -0
- package/package.json +6 -5
package/dist/index.js
CHANGED
|
@@ -1107,10 +1107,6 @@ function SpeakerPlusFill(props) {
|
|
|
1107
1107
|
return (jsxRuntime.jsxs("svg", { ...props, viewBox: '0 0 64 47', children: [jsxRuntime.jsx("path", { d: 'M28.32,46.325C30.027,46.325 31.276,45.08 31.276,43.362L31.276,3.102C31.276,1.411 30.027,0 28.264,0C27.037,0 26.183,0.536 24.85,1.807L13.652,12.313C13.496,12.47 13.272,12.571 13.02,12.571L5.497,12.571C1.938,12.571 0,14.509 0,18.319L0,28.091C0,31.867 1.938,33.833 5.497,33.833L13.02,33.833C13.272,33.833 13.496,33.911 13.652,34.068L24.85,44.679C26.071,45.817 27.092,46.325 28.32,46.325Z' }), jsxRuntime.jsx("path", { d: 'M39.659,23.135C39.659,24.411 40.579,25.303 41.916,25.303L49.617,25.303L49.617,33.059C49.617,34.368 50.509,35.283 51.785,35.283C53.1,35.283 54.02,34.374 54.02,33.059L54.02,25.303L61.777,25.303C63.086,25.303 64,24.411 64,23.135C64,21.819 63.092,20.899 61.777,20.899L54.02,20.899L54.02,13.171C54.02,11.828 53.1,10.919 51.785,10.919C50.509,10.919 49.617,11.834 49.617,13.171L49.617,20.899L41.916,20.899C40.545,20.899 39.659,21.819 39.659,23.135Z' })] }));
|
|
1108
1108
|
}
|
|
1109
1109
|
|
|
1110
|
-
function SpeakerWave3Fill(props) {
|
|
1111
|
-
return (jsxRuntime.jsxs("svg", { viewBox: '0 0 64 47', ...props, children: [jsxRuntime.jsx("path", { d: 'M25.707,44.076C27.257,44.076 28.39,42.947 28.39,41.387L28.39,4.841C28.39,3.307 27.257,2.025 25.656,2.025C24.542,2.025 23.767,2.512 22.558,3.666L12.393,13.203C12.251,13.345 12.047,13.436 11.818,13.436L4.99,13.436C1.759,13.436 0,15.195 0,18.654L0,27.525C0,30.953 1.759,32.737 4.99,32.737L11.818,32.737C12.047,32.737 12.251,32.808 12.393,32.95L22.558,42.583C23.666,43.615 24.593,44.076 25.707,44.076Z' }), jsxRuntime.jsx("path", { "data-wave": '1', d: 'M36.874,33.192C37.684,33.728 38.797,33.566 39.439,32.64C41.265,30.222 42.371,26.683 42.371,23.026C42.371,19.368 41.265,15.855 39.439,13.411C38.797,12.485 37.684,12.323 36.874,12.885C35.923,13.553 35.761,14.721 36.505,15.713C37.901,17.607 38.662,20.249 38.662,23.026C38.662,25.802 37.876,28.419 36.505,30.338C35.786,31.355 35.923,32.498 36.874,33.192Z' }), jsxRuntime.jsx("path", { "data-wave": '2', d: 'M45.738,39.394C46.624,39.981 47.712,39.799 48.354,38.868C51.402,34.69 53.208,28.904 53.208,23.026C53.208,17.148 51.427,11.31 48.354,7.183C47.712,6.252 46.624,6.07 45.738,6.657C44.858,7.249 44.701,8.362 45.399,9.354C48.023,13.032 49.499,17.952 49.499,23.026C49.499,28.099 47.972,32.994 45.399,36.697C44.726,37.689 44.858,38.802 45.738,39.394Z' }), jsxRuntime.jsx("path", { "data-wave": '3', d: 'M54.679,45.708C55.514,46.32 56.683,46.082 57.315,45.121C61.498,39.091 64,31.447 64,23.026C64,14.604 61.422,6.986 57.315,0.93C56.683,-0.056 55.514,-0.269 54.679,0.343C53.804,0.956 53.668,2.079 54.33,3.071C58.012,8.514 60.342,15.379 60.342,23.026C60.342,30.647 58.012,37.562 54.33,42.98C53.668,43.972 53.804,45.095 54.679,45.708Z' })] }));
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
1110
|
function TenArrowTriangleheadClockwise(props) {
|
|
1115
1111
|
return (jsxRuntime.jsxs("svg", { viewBox: "0 0 59 64", ...props, children: [jsxRuntime.jsx("path", { d: "M29.213,64C45.355,64 58.456,50.929 58.456,34.787C58.456,24.967 53.645,16.446 46.273,11.115C45.02,10.166 43.366,10.489 42.667,11.662C41.944,12.848 42.327,14.192 43.476,15.079C49.571,19.462 53.573,26.628 53.573,34.787C53.573,48.254 42.679,59.148 29.213,59.148C15.746,59.148 4.877,48.254 4.877,34.787C4.877,23.179 12.932,13.576 23.706,11.072L23.706,15.18C23.706,17.212 25.087,17.76 26.657,16.652L35.809,10.242C37.117,9.311 37.147,7.954 35.809,7.023L26.687,0.583C25.087,-0.555 23.706,-0.007 23.706,2.055L23.706,6.098C10.28,8.639 -0,20.497 -0,34.787C-0,50.929 13.101,64 29.213,64Z" }), jsxRuntime.jsx("path", { d: "M21.596,46.561C22.831,46.561 23.585,45.673 23.585,44.438L23.585,26.365C23.585,24.935 22.709,24.096 21.286,24.096C20.118,24.096 19.316,24.613 18.416,25.288L15.162,27.705C14.602,28.131 14.267,28.587 14.267,29.287C14.267,30.108 14.864,30.765 15.685,30.765C16.081,30.765 16.361,30.638 16.689,30.376L19.522,28.258L19.577,28.258L19.577,44.438C19.577,45.679 20.355,46.561 21.596,46.561Z" }), jsxRuntime.jsx("path", { d: "M36.048,46.731C30.406,46.731 28.426,41.001 28.426,35.298C28.426,29.686 30.375,23.919 36.048,23.919C41.685,23.919 43.659,29.649 43.659,35.298C43.659,40.97 41.679,46.731 36.048,46.731ZM36.048,43.513C38.45,43.513 39.626,39.978 39.626,35.298C39.626,30.673 38.444,27.174 36.048,27.174C33.647,27.174 32.458,30.661 32.458,35.298C32.458,39.984 33.647,43.513 36.048,43.513Z" })] }));
|
|
1116
1112
|
}
|
|
@@ -1336,6 +1332,108 @@ function useFormStatus() {
|
|
|
1336
1332
|
return useStore(store => store);
|
|
1337
1333
|
}
|
|
1338
1334
|
|
|
1335
|
+
function usePointerMovement(props) {
|
|
1336
|
+
const pointerTypeRef = React.useRef('pointer'), [isTracking, setIsTracking] = React.useState(false), [delta, setDelta] = React.useState({ x: 0, y: 0 }), startCoordsRef = React.useRef({ x: 0, y: 0 });
|
|
1337
|
+
const styleID = React.useId();
|
|
1338
|
+
const changeCursor = (cursor) => {
|
|
1339
|
+
if (cursor === false) {
|
|
1340
|
+
document.querySelector(`#${styleID}`)?.remove();
|
|
1341
|
+
return;
|
|
1342
|
+
}
|
|
1343
|
+
const css = `*, *:active { cursor: ${cursor}; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; }`;
|
|
1344
|
+
const style = document.createElement('style');
|
|
1345
|
+
style.id = styleID;
|
|
1346
|
+
style.innerHTML = css;
|
|
1347
|
+
document.body.prepend(style);
|
|
1348
|
+
};
|
|
1349
|
+
const trackPointerMovement = (e) => {
|
|
1350
|
+
changeCursor(props?.activeCursor || 'grabbing');
|
|
1351
|
+
const { type } = e;
|
|
1352
|
+
switch (type) {
|
|
1353
|
+
case 'mousemove':
|
|
1354
|
+
case 'mouseup':
|
|
1355
|
+
case 'pointermove':
|
|
1356
|
+
case 'pointerup':
|
|
1357
|
+
case 'touchmove':
|
|
1358
|
+
case 'touchend':
|
|
1359
|
+
throw new Error('To initiate the tracking of pointer movement, you must use a `mousedown`, `pointerdown`, or `touchstart`.');
|
|
1360
|
+
case 'mousedown':
|
|
1361
|
+
pointerTypeRef.current = 'mouse';
|
|
1362
|
+
break;
|
|
1363
|
+
case 'pointerdown':
|
|
1364
|
+
pointerTypeRef.current = 'pointer';
|
|
1365
|
+
break;
|
|
1366
|
+
case 'touchstart':
|
|
1367
|
+
pointerTypeRef.current = 'touch';
|
|
1368
|
+
break;
|
|
1369
|
+
}
|
|
1370
|
+
let x = 0, y = 0;
|
|
1371
|
+
if ('touches' in e) {
|
|
1372
|
+
const { touches } = e;
|
|
1373
|
+
if (touches.length > 1)
|
|
1374
|
+
return;
|
|
1375
|
+
x = touches[0].clientX;
|
|
1376
|
+
y = touches[0].clientY;
|
|
1377
|
+
}
|
|
1378
|
+
else {
|
|
1379
|
+
x = e.clientX;
|
|
1380
|
+
y = e.clientY;
|
|
1381
|
+
}
|
|
1382
|
+
startCoordsRef.current = { x, y };
|
|
1383
|
+
setIsTracking(true);
|
|
1384
|
+
};
|
|
1385
|
+
const updateDelta = React.useCallback((e) => {
|
|
1386
|
+
let clientX = 0, clientY = 0;
|
|
1387
|
+
if ('touches' in e) {
|
|
1388
|
+
const { touches } = e;
|
|
1389
|
+
if (touches.length > 1)
|
|
1390
|
+
return;
|
|
1391
|
+
clientX = touches[0].clientX;
|
|
1392
|
+
clientY = touches[0].clientY;
|
|
1393
|
+
}
|
|
1394
|
+
else {
|
|
1395
|
+
clientX = e.clientX;
|
|
1396
|
+
clientY = e.clientY;
|
|
1397
|
+
}
|
|
1398
|
+
const { x, y } = startCoordsRef.current, newDelta = { x: clientX - x, y: clientY - y };
|
|
1399
|
+
setDelta(newDelta);
|
|
1400
|
+
props?.onChange?.(newDelta);
|
|
1401
|
+
}, []);
|
|
1402
|
+
const stopTracking = React.useCallback(() => {
|
|
1403
|
+
changeCursor(false);
|
|
1404
|
+
setIsTracking(false);
|
|
1405
|
+
props?.onEnd?.(delta);
|
|
1406
|
+
}, [delta]);
|
|
1407
|
+
React.useEffect(() => {
|
|
1408
|
+
if (typeof window === 'undefined')
|
|
1409
|
+
return;
|
|
1410
|
+
const controller = new AbortController(), signal = controller.signal;
|
|
1411
|
+
if (isTracking) {
|
|
1412
|
+
switch (pointerTypeRef.current) {
|
|
1413
|
+
case 'mouse':
|
|
1414
|
+
document.body.addEventListener('mousemove', updateDelta, { signal });
|
|
1415
|
+
document.body.addEventListener('mouseup', stopTracking, { signal });
|
|
1416
|
+
break;
|
|
1417
|
+
case 'pointer':
|
|
1418
|
+
document.body.addEventListener('pointermove', updateDelta, { signal });
|
|
1419
|
+
document.body.addEventListener('pointerup', stopTracking, { signal });
|
|
1420
|
+
break;
|
|
1421
|
+
case 'touch':
|
|
1422
|
+
document.body.addEventListener('touchmove', updateDelta, { signal });
|
|
1423
|
+
document.body.addEventListener('touchend', stopTracking, { signal });
|
|
1424
|
+
break;
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
else {
|
|
1428
|
+
controller.abort();
|
|
1429
|
+
}
|
|
1430
|
+
return () => {
|
|
1431
|
+
controller.abort();
|
|
1432
|
+
};
|
|
1433
|
+
}, [isTracking, updateDelta, stopTracking]);
|
|
1434
|
+
return { delta, stopTracking, trackPointerMovement };
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1339
1437
|
function Fieldset({ children, className, decorative = false, join, legend, legendProps, name, ...props }) {
|
|
1340
1438
|
const uniqueID = React.useId();
|
|
1341
1439
|
const fieldsetId = toLowerCase(legend || name, [' ', '_']) + '§' + uniqueID;
|
|
@@ -4256,37 +4354,30 @@ function Time({ children, dateObject, dateTime, day, hours, milliseconds, minute
|
|
|
4256
4354
|
|
|
4257
4355
|
const MAX_PROGRESS = 100;
|
|
4258
4356
|
function Video({ autoPlay, className, controls = true, poster, ref, srcSet, title, ...props }) {
|
|
4259
|
-
|
|
4260
|
-
const
|
|
4261
|
-
const sortedSrcSet = srcSet.sort((a, b) => a.width - b.width);
|
|
4357
|
+
// * General/Core
|
|
4358
|
+
const uniqueID = React.useId(), figureRef = React.useRef(null), videoPlayerRef = React.useRef(null), sortedSrcSet = srcSet.sort((a, b) => a.width - b.width);
|
|
4262
4359
|
const primaryPoster = poster ? poster.find(({ primary }) => primary)?.src || poster[0].src : '';
|
|
4360
|
+
const preventDefaultEvent = e => e.preventDefault();
|
|
4361
|
+
// * Play/Pause Controls
|
|
4362
|
+
const [isPlaying, setIsPlaying] = React.useState(autoPlay);
|
|
4363
|
+
const togglePlay = React.useCallback(() => {
|
|
4364
|
+
setIsPlaying(previous => {
|
|
4365
|
+
if (!previous)
|
|
4366
|
+
videoPlayerRef.current?.play();
|
|
4367
|
+
if (previous)
|
|
4368
|
+
videoPlayerRef.current?.pause();
|
|
4369
|
+
return !previous;
|
|
4370
|
+
});
|
|
4371
|
+
handleMouseMoveControls();
|
|
4372
|
+
}, []);
|
|
4373
|
+
// * Fullscreen Controls
|
|
4374
|
+
const isFullscreenRef = React.useRef(false), [isFullscreen, setIsFullscreen] = React.useState(false);
|
|
4263
4375
|
const updateFullscreenState = React.useCallback(() => {
|
|
4264
4376
|
if (Boolean(document.fullscreenElement) !== isFullscreenRef.current) {
|
|
4265
4377
|
setIsFullscreen(Boolean(document.fullscreenElement));
|
|
4266
4378
|
isFullscreenRef.current = Boolean(document.fullscreenElement);
|
|
4267
4379
|
}
|
|
4268
4380
|
}, []);
|
|
4269
|
-
React.useEffect(() => {
|
|
4270
|
-
if (typeof window === 'undefined')
|
|
4271
|
-
return;
|
|
4272
|
-
document.addEventListener('fullscreenchange', updateFullscreenState);
|
|
4273
|
-
return () => {
|
|
4274
|
-
document.removeEventListener('fullscreenchange', updateFullscreenState);
|
|
4275
|
-
};
|
|
4276
|
-
}, []);
|
|
4277
|
-
const handleTimeUpdate = () => {
|
|
4278
|
-
if (videoPlayerRef.current) {
|
|
4279
|
-
const newProgress = (videoPlayerRef.current.currentTime / videoPlayerRef.current.duration) * 100;
|
|
4280
|
-
setProgress(prev => (Math.abs(prev - newProgress) > 0.1 ? newProgress : prev));
|
|
4281
|
-
}
|
|
4282
|
-
};
|
|
4283
|
-
const togglePlay = React.useCallback(() => setIsPlaying(previous => {
|
|
4284
|
-
if (!previous)
|
|
4285
|
-
videoPlayerRef.current?.play();
|
|
4286
|
-
if (previous)
|
|
4287
|
-
videoPlayerRef.current?.pause();
|
|
4288
|
-
return !previous;
|
|
4289
|
-
}), []);
|
|
4290
4381
|
const toggleFullscreen = () => {
|
|
4291
4382
|
if (document.fullscreenElement) {
|
|
4292
4383
|
document.exitFullscreen();
|
|
@@ -4300,6 +4391,60 @@ function Video({ autoPlay, className, controls = true, poster, ref, srcSet, titl
|
|
|
4300
4391
|
figureRef.current?.requestFullscreen();
|
|
4301
4392
|
}, []);
|
|
4302
4393
|
const enterPictureInPicture = () => videoPlayerRef.current?.requestPictureInPicture();
|
|
4394
|
+
React.useEffect(() => {
|
|
4395
|
+
if (typeof window === 'undefined')
|
|
4396
|
+
return;
|
|
4397
|
+
document.addEventListener('fullscreenchange', updateFullscreenState);
|
|
4398
|
+
return () => {
|
|
4399
|
+
document.removeEventListener('fullscreenchange', updateFullscreenState);
|
|
4400
|
+
};
|
|
4401
|
+
}, []);
|
|
4402
|
+
// * Progress/Seeking Controls
|
|
4403
|
+
const [progress, setProgress] = React.useState(0), trackProgressStartTimeRef = React.useRef(0), [seekIndicator, setSeekIndicator] = React.useState({ isInPlayedArea: false, position: 0 }), seekIndicatorMouseDownPositionRef = React.useRef(0), scrubberRef = React.useRef(null), [timeRemaining, setTimeRemaining] = React.useState(0);
|
|
4404
|
+
const handleTimeUpdate = () => {
|
|
4405
|
+
const videoPlayer = videoPlayerRef.current;
|
|
4406
|
+
if (!videoPlayer)
|
|
4407
|
+
return;
|
|
4408
|
+
const { currentTime, duration } = videoPlayer;
|
|
4409
|
+
const newProgress = (currentTime / duration) * 100;
|
|
4410
|
+
setProgress(prev => (Math.abs(prev - newProgress) > 0.1 ? newProgress : prev));
|
|
4411
|
+
setTimeRemaining(duration - currentTime);
|
|
4412
|
+
};
|
|
4413
|
+
const handleProgressSlider = ({ x }) => {
|
|
4414
|
+
const videoPlayer = videoPlayerRef.current, scrubber = scrubberRef.current;
|
|
4415
|
+
if (!videoPlayer || !scrubber)
|
|
4416
|
+
return;
|
|
4417
|
+
const { duration } = videoPlayer, { width } = scrubber.getBoundingClientRect();
|
|
4418
|
+
videoPlayer.fastSeek(Math.max(Math.min(trackProgressStartTimeRef.current + x / (width / duration), duration - 1), 0));
|
|
4419
|
+
};
|
|
4420
|
+
const { trackPointerMovement: trackProgress } = usePointerMovement({ onChange: handleProgressSlider });
|
|
4421
|
+
const initiateTrackProgress = (e) => {
|
|
4422
|
+
const videoPlayer = videoPlayerRef.current;
|
|
4423
|
+
if (!videoPlayer)
|
|
4424
|
+
return;
|
|
4425
|
+
trackProgress(e);
|
|
4426
|
+
trackProgressStartTimeRef.current = videoPlayer.currentTime;
|
|
4427
|
+
};
|
|
4428
|
+
const handleSeekIndicatorMovement = e => {
|
|
4429
|
+
const videoPlayer = videoPlayerRef.current;
|
|
4430
|
+
if (!videoPlayer)
|
|
4431
|
+
return;
|
|
4432
|
+
const { currentTime, duration } = videoPlayer;
|
|
4433
|
+
const { clientX, currentTarget } = e, { width, x } = currentTarget.getBoundingClientRect();
|
|
4434
|
+
const position = clientX - x;
|
|
4435
|
+
const isInPlayedArea = position <= width / (duration / currentTime);
|
|
4436
|
+
setSeekIndicator({ isInPlayedArea, position });
|
|
4437
|
+
};
|
|
4438
|
+
const initializeSeeking = () => (seekIndicatorMouseDownPositionRef.current = seekIndicator.position);
|
|
4439
|
+
const handleSeekRelease = e => {
|
|
4440
|
+
const videoPlayer = videoPlayerRef.current;
|
|
4441
|
+
if (!videoPlayer)
|
|
4442
|
+
return;
|
|
4443
|
+
const { duration } = videoPlayer, { currentTarget } = e, { width } = currentTarget.getBoundingClientRect();
|
|
4444
|
+
if (seekIndicatorMouseDownPositionRef.current === seekIndicator.position)
|
|
4445
|
+
videoPlayer.fastSeek(Math.min(duration / (width / seekIndicatorMouseDownPositionRef.current), duration - 1));
|
|
4446
|
+
};
|
|
4447
|
+
// * Skip Controls
|
|
4303
4448
|
const [skipDuration, setSkipDuration] = React.useState(10);
|
|
4304
4449
|
const getSkipAmount = () => {
|
|
4305
4450
|
const modifierKeyList = pressedKeyListRef.current;
|
|
@@ -4321,19 +4466,71 @@ function Video({ autoPlay, className, controls = true, poster, ref, srcSet, titl
|
|
|
4321
4466
|
return skipAmount;
|
|
4322
4467
|
};
|
|
4323
4468
|
const skipBack = React.useCallback(() => {
|
|
4324
|
-
|
|
4469
|
+
const videoPlayer = videoPlayerRef.current;
|
|
4470
|
+
if (!videoPlayer)
|
|
4325
4471
|
return;
|
|
4326
|
-
const { currentTime } =
|
|
4472
|
+
const { currentTime } = videoPlayer;
|
|
4327
4473
|
const skipAmount = getSkipAmount();
|
|
4328
|
-
|
|
4474
|
+
videoPlayer.fastSeek(Math.max(currentTime - skipAmount, 0));
|
|
4329
4475
|
}, []);
|
|
4330
4476
|
const skipForward = React.useCallback(() => {
|
|
4331
|
-
|
|
4477
|
+
const videoPlayer = videoPlayerRef.current;
|
|
4478
|
+
if (!videoPlayer)
|
|
4332
4479
|
return;
|
|
4333
|
-
const { currentTime, duration } =
|
|
4480
|
+
const { currentTime, duration } = videoPlayer;
|
|
4334
4481
|
const skipAmount = getSkipAmount();
|
|
4335
|
-
|
|
4482
|
+
videoPlayer.fastSeek(Math.min(currentTime + skipAmount, duration - 1));
|
|
4336
4483
|
}, []);
|
|
4484
|
+
// * Volume Controls
|
|
4485
|
+
const [volume, setVolume] = React.useState(1), trackVolumeStartRef = React.useRef(0);
|
|
4486
|
+
const handleVolumeChange = e => {
|
|
4487
|
+
const { currentTarget } = e, { volume } = currentTarget;
|
|
4488
|
+
setVolume(volume);
|
|
4489
|
+
};
|
|
4490
|
+
const handleVolumeSlider = ({ y }) => {
|
|
4491
|
+
const videoPlayer = videoPlayerRef.current;
|
|
4492
|
+
if (!videoPlayer)
|
|
4493
|
+
return;
|
|
4494
|
+
videoPlayer.volume = Math.max(Math.min(trackVolumeStartRef.current + (y / 96) * -1, 1), 0);
|
|
4495
|
+
};
|
|
4496
|
+
const { trackPointerMovement: trackVolume } = usePointerMovement({ onChange: handleVolumeSlider });
|
|
4497
|
+
const initiateTrackVolume = (e) => {
|
|
4498
|
+
const videoPlayer = videoPlayerRef.current;
|
|
4499
|
+
if (!videoPlayer)
|
|
4500
|
+
return;
|
|
4501
|
+
trackVolume(e);
|
|
4502
|
+
trackVolumeStartRef.current = videoPlayer.volume;
|
|
4503
|
+
};
|
|
4504
|
+
const increaseVolume = () => {
|
|
4505
|
+
const videoPlayer = videoPlayerRef.current;
|
|
4506
|
+
if (!videoPlayer)
|
|
4507
|
+
return;
|
|
4508
|
+
videoPlayer.volume += 0.1;
|
|
4509
|
+
};
|
|
4510
|
+
const decreaseVolume = () => {
|
|
4511
|
+
const videoPlayer = videoPlayerRef.current;
|
|
4512
|
+
if (!videoPlayer)
|
|
4513
|
+
return;
|
|
4514
|
+
videoPlayer.volume -= 0.1;
|
|
4515
|
+
};
|
|
4516
|
+
// * Controls Visibility
|
|
4517
|
+
const [showControls, setShowControls] = React.useState(true), mouseMoveTimeoutRef = React.useRef(undefined);
|
|
4518
|
+
const displayControls = () => {
|
|
4519
|
+
if (!showControls)
|
|
4520
|
+
setShowControls(true);
|
|
4521
|
+
};
|
|
4522
|
+
const hideControls = () => {
|
|
4523
|
+
if (!videoPlayerRef.current?.paused)
|
|
4524
|
+
setShowControls(false);
|
|
4525
|
+
};
|
|
4526
|
+
const handleMouseMoveControls = () => {
|
|
4527
|
+
clearTimeout(mouseMoveTimeoutRef.current);
|
|
4528
|
+
displayControls();
|
|
4529
|
+
mouseMoveTimeoutRef.current = setTimeout(() => hideControls(), 1500);
|
|
4530
|
+
};
|
|
4531
|
+
const clearMouseMoveControlsTimeout = () => clearTimeout(mouseMoveTimeoutRef.current);
|
|
4532
|
+
// * Keyboard Controls
|
|
4533
|
+
const pressedKeyListRef = React.useRef([]), [pressedKeyList, setPressedKeyList] = React.useState([]);
|
|
4337
4534
|
const updateModifierKeys = React.useCallback(({ metaKey, altKey, shiftKey, ctrlKey, }) => {
|
|
4338
4535
|
if ((metaKey && !pressedKeyListRef.current.includes('meta')) ||
|
|
4339
4536
|
(altKey && !pressedKeyListRef.current.includes('alt')) ||
|
|
@@ -4357,7 +4554,6 @@ function Video({ autoPlay, className, controls = true, poster, ref, srcSet, titl
|
|
|
4357
4554
|
getSkipAmount();
|
|
4358
4555
|
}
|
|
4359
4556
|
}, []);
|
|
4360
|
-
const preventContextMenu = e => e.preventDefault();
|
|
4361
4557
|
const handleKeydown = React.useCallback((e) => {
|
|
4362
4558
|
const { key, metaKey, altKey, shiftKey, ctrlKey } = e;
|
|
4363
4559
|
updateModifierKeys({ metaKey, altKey, shiftKey, ctrlKey });
|
|
@@ -4376,10 +4572,10 @@ function Video({ autoPlay, className, controls = true, poster, ref, srcSet, titl
|
|
|
4376
4572
|
skipBack();
|
|
4377
4573
|
break;
|
|
4378
4574
|
case 'ArrowUp':
|
|
4379
|
-
|
|
4575
|
+
increaseVolume();
|
|
4380
4576
|
break;
|
|
4381
4577
|
case 'ArrowDown':
|
|
4382
|
-
|
|
4578
|
+
decreaseVolume();
|
|
4383
4579
|
break;
|
|
4384
4580
|
case 'f':
|
|
4385
4581
|
requestFullscreen();
|
|
@@ -4393,85 +4589,54 @@ function Video({ autoPlay, className, controls = true, poster, ref, srcSet, titl
|
|
|
4393
4589
|
React.useEffect(() => {
|
|
4394
4590
|
if (typeof window === 'undefined')
|
|
4395
4591
|
return;
|
|
4396
|
-
|
|
4397
|
-
document.addEventListener('
|
|
4592
|
+
const controller = new AbortController(), signal = controller.signal;
|
|
4593
|
+
document.addEventListener('keydown', handleKeydown, { signal });
|
|
4594
|
+
document.addEventListener('keyup', handleKeyup, { signal });
|
|
4398
4595
|
return () => {
|
|
4399
|
-
|
|
4400
|
-
document.removeEventListener('keyup', handleKeyup);
|
|
4596
|
+
controller.abort();
|
|
4401
4597
|
};
|
|
4402
4598
|
}, [handleKeydown, handleKeyup]);
|
|
4599
|
+
// * Remote Playback Controls
|
|
4403
4600
|
const handleRemotePlayback = () => videoPlayerRef.current?.remote.prompt();
|
|
4404
|
-
|
|
4405
|
-
if (!videoPlayerRef.current)
|
|
4406
|
-
return;
|
|
4407
|
-
const { currentTime, duration } = videoPlayerRef.current;
|
|
4408
|
-
const { clientX, currentTarget } = e, { width, x } = currentTarget.getBoundingClientRect();
|
|
4409
|
-
const position = clientX - x;
|
|
4410
|
-
const isInPlayedArea = position <= width / (duration / currentTime);
|
|
4411
|
-
setSeekIndicator({ isInPlayedArea, position });
|
|
4412
|
-
};
|
|
4413
|
-
const seekIndicatorMouseDownPositionRef = React.useRef(0);
|
|
4414
|
-
const initializeSeeking = () => (seekIndicatorMouseDownPositionRef.current = seekIndicator.position);
|
|
4415
|
-
const handleSeekRelease = e => {
|
|
4416
|
-
if (!videoPlayerRef.current)
|
|
4417
|
-
return;
|
|
4418
|
-
const { duration } = videoPlayerRef.current, { currentTarget } = e, { width } = currentTarget.getBoundingClientRect();
|
|
4419
|
-
if (seekIndicatorMouseDownPositionRef.current === seekIndicator.position)
|
|
4420
|
-
videoPlayerRef.current.fastSeek(Math.min(duration / (width / seekIndicatorMouseDownPositionRef.current), duration - 1));
|
|
4421
|
-
};
|
|
4422
|
-
const mouseMoveTimeoutRef = React.useRef(undefined);
|
|
4423
|
-
const displayControls = () => {
|
|
4424
|
-
if (!showControls)
|
|
4425
|
-
setShowControls(true);
|
|
4426
|
-
};
|
|
4427
|
-
const hideControls = () => {
|
|
4428
|
-
if (!videoPlayerRef.current?.paused)
|
|
4429
|
-
setShowControls(false);
|
|
4430
|
-
};
|
|
4431
|
-
const handleMouseMoveControls = () => {
|
|
4432
|
-
clearTimeout(mouseMoveTimeoutRef.current);
|
|
4433
|
-
displayControls();
|
|
4434
|
-
mouseMoveTimeoutRef.current = setTimeout(() => hideControls(), 1500);
|
|
4435
|
-
};
|
|
4436
|
-
const clearMouseMoveControlsTimeout = () => clearTimeout(mouseMoveTimeoutRef.current);
|
|
4601
|
+
// * Progressive Enhancement
|
|
4437
4602
|
const progressiveEnhancementSourceLengthRef = React.useRef(1);
|
|
4438
4603
|
const [progressiveEnhancementList, setProgressiveEnhancementList] = React.useState(sortedSrcSet.filter((_, index) => index < progressiveEnhancementSourceLengthRef.current));
|
|
4439
4604
|
const handleProEnhance = e => {
|
|
4440
4605
|
const { currentTarget } = e, { currentSrc, currentTime } = currentTarget;
|
|
4441
|
-
console.log('current:', currentSrc);
|
|
4442
4606
|
const proEnhanceSrcLength = progressiveEnhancementSourceLengthRef.current + 1, updatedProEnhanceList = sortedSrcSet.filter((_, index) => index < proEnhanceSrcLength);
|
|
4443
4607
|
console.log(updatedProEnhanceList);
|
|
4444
4608
|
setProgressiveEnhancementList(updatedProEnhanceList);
|
|
4445
4609
|
progressiveEnhancementSourceLengthRef.current = proEnhanceSrcLength;
|
|
4446
|
-
const srcToCompare = typeof updatedProEnhanceList
|
|
4447
|
-
? updatedProEnhanceList
|
|
4448
|
-
: updatedProEnhanceList
|
|
4610
|
+
const srcToCompare = typeof updatedProEnhanceList.at(-1)?.src === 'string'
|
|
4611
|
+
? updatedProEnhanceList.at(-1)?.src
|
|
4612
|
+
: updatedProEnhanceList.at(-1)?.srcGroup;
|
|
4449
4613
|
if (!srcToCompare)
|
|
4450
4614
|
return;
|
|
4451
4615
|
if ((Array.isArray(srcToCompare) && srcToCompare.every(({ src }) => src !== currentSrc)) ||
|
|
4452
4616
|
(!Array.isArray(srcToCompare) && srcToCompare !== currentSrc)) {
|
|
4453
|
-
const srcType = currentSrc.split('.')
|
|
4617
|
+
const srcType = currentSrc.split('.').at(-1);
|
|
4454
4618
|
const src = Array.isArray(srcToCompare)
|
|
4455
|
-
? srcToCompare.find(({ src }) => src.split('.')
|
|
4619
|
+
? srcToCompare.find(({ src }) => src.split('.').at(-1) === srcType)?.src || srcToCompare[0].src
|
|
4456
4620
|
: srcToCompare;
|
|
4457
4621
|
if (!src)
|
|
4458
4622
|
return;
|
|
4459
|
-
console.log('updated:', src);
|
|
4460
4623
|
currentTarget.src = src;
|
|
4461
4624
|
currentTarget.currentTime = currentTime || 0;
|
|
4462
4625
|
currentTarget.load();
|
|
4463
4626
|
}
|
|
4464
4627
|
};
|
|
4628
|
+
// * Download Controls
|
|
4465
4629
|
const captureCurrentFrame = () => {
|
|
4466
|
-
|
|
4630
|
+
const videoPlayer = videoPlayerRef.current;
|
|
4631
|
+
if (!videoPlayer)
|
|
4467
4632
|
return;
|
|
4468
|
-
const { videoHeight, videoWidth } =
|
|
4633
|
+
const { videoHeight, videoWidth } = videoPlayer;
|
|
4469
4634
|
const canvas = document.createElement('canvas'), canvasContext = canvas.getContext('2d');
|
|
4470
4635
|
if (!canvasContext)
|
|
4471
4636
|
return;
|
|
4472
4637
|
canvas.width = videoWidth;
|
|
4473
4638
|
canvas.height = videoHeight;
|
|
4474
|
-
canvasContext.drawImage(
|
|
4639
|
+
canvasContext.drawImage(videoPlayer, 0, 0, canvas.width, canvas.height);
|
|
4475
4640
|
canvas.toBlob(blob => {
|
|
4476
4641
|
if (!blob)
|
|
4477
4642
|
return;
|
|
@@ -4484,30 +4649,27 @@ function Video({ autoPlay, className, controls = true, poster, ref, srcSet, titl
|
|
|
4484
4649
|
URL.revokeObjectURL(url);
|
|
4485
4650
|
}, 'image/jpeg', 0.9);
|
|
4486
4651
|
};
|
|
4487
|
-
|
|
4488
|
-
if (!videoPlayerRef.current)
|
|
4489
|
-
return;
|
|
4490
|
-
videoPlayerRef.current.volume += 0.1;
|
|
4491
|
-
setVolume(videoPlayerRef.current.volume);
|
|
4492
|
-
};
|
|
4493
|
-
const decreaseVolume = () => {
|
|
4494
|
-
if (!videoPlayerRef.current)
|
|
4495
|
-
return;
|
|
4496
|
-
videoPlayerRef.current.volume -= 0.1;
|
|
4497
|
-
setVolume(videoPlayerRef.current.volume);
|
|
4498
|
-
};
|
|
4499
|
-
return (jsxRuntime.jsxs("figure", { ...(showControls ? { 'data-controls': true } : {}), ...(isFullscreen ? { 'data-fullscreen': true } : {}), ...(isPlaying ? { 'data-playing': true } : {}), ...Object.fromEntries(pressedKeyList.map(key => [`data-${key}`, true])), className: twMerge('group/video isolate aspect-video w-full overflow-clip', className), onMouseEnter: displayControls, onMouseLeave: hideControls, ref: figureRef, children: [jsxRuntime.jsx("video", { ...props, className: 'size-full object-cover', onLoad: handleProEnhance, onLoadedMetadata: handleProEnhance, onTimeUpdate: handleTimeUpdate, poster: primaryPoster, ref: videoPlayerRef || ref, title: title, children: progressiveEnhancementList.map(({ width, ...source }) => {
|
|
4652
|
+
return (jsxRuntime.jsxs("figure", { ...(showControls ? { 'data-controls': true } : {}), ...(isFullscreen ? { 'data-fullscreen': true } : {}), ...(isPlaying ? { 'data-playing': true } : {}), ...Object.fromEntries(pressedKeyList.map(key => [`data-${key}`, true])), className: twMerge('group/video isolate aspect-video w-full overflow-clip', className), onMouseEnter: displayControls, onMouseLeave: hideControls, ref: figureRef, children: [jsxRuntime.jsx("video", { ...props, className: 'size-full object-cover', onLoad: handleProEnhance, onTimeUpdate: handleTimeUpdate, onVolumeChange: handleVolumeChange, poster: primaryPoster, ref: videoPlayerRef || ref, title: title, children: progressiveEnhancementList.map(({ width, ...source }) => {
|
|
4500
4653
|
if (source.srcGroup) {
|
|
4501
4654
|
const { srcGroup } = source;
|
|
4502
4655
|
return srcGroup.map(({ src, type }) => (jsxRuntime.jsx("source", { src: src, type: type }, `${title}${type}${width}${uniqueID}`)));
|
|
4503
4656
|
}
|
|
4504
4657
|
const { src, type } = source;
|
|
4505
4658
|
return jsxRuntime.jsx("source", { src: src, type: type }, `${title}${type}${width}${uniqueID}`);
|
|
4506
|
-
}) }), controls && (jsxRuntime.jsxs("div", { className: 'absolute inset-0 isolate text-neutral-50 opacity-0 transition-opacity duration-1000 ease-exponential group-data-controls/video:opacity-100', children: [jsxRuntime.jsxs("div", { className: 'grid-flow-cols absolute top-1/2 left-1/2 grid -translate-x-1/2 -translate-y-1/2 place-items-center gap-2', children: [jsxRuntime.jsxs("button", { className: 'col-start-1 col-end-2 row-start-0 row-end-1 grid size-16 rounded-full backdrop-blur-[1px] backdrop-brightness-101 transition-[scale,-webkit-backdrop-filter,backdrop-filter] duration-300 ease-exponential active:scale-95 active:backdrop-blur-[2px] active:backdrop-brightness-125 pointer-fine:hover:scale-105 pointer-fine:hover:backdrop-blur-xs pointer-fine:hover:backdrop-brightness-110 pointer-fine:active:scale-95 pointer-fine:active:backdrop-blur-[2px] pointer-fine:active:backdrop-brightness-125', onClick: togglePlay, onContextMenu:
|
|
4659
|
+
}) }), controls && (jsxRuntime.jsxs("div", { className: 'absolute inset-0 isolate text-neutral-50 opacity-0 transition-opacity duration-1000 ease-exponential select-none group-data-controls/video:opacity-100', children: [jsxRuntime.jsxs("div", { className: 'grid-flow-cols absolute top-1/2 left-1/2 grid -translate-x-1/2 -translate-y-1/2 place-items-center gap-2', children: [jsxRuntime.jsxs("button", { className: 'col-start-1 col-end-2 row-start-0 row-end-1 grid size-16 rounded-full backdrop-blur-[1px] backdrop-brightness-101 transition-[scale,-webkit-backdrop-filter,backdrop-filter] duration-300 ease-exponential active:scale-95 active:backdrop-blur-[2px] active:backdrop-brightness-125 pointer-fine:hover:scale-105 pointer-fine:hover:backdrop-blur-xs pointer-fine:hover:backdrop-brightness-110 pointer-fine:active:scale-95 pointer-fine:active:backdrop-blur-[2px] pointer-fine:active:backdrop-brightness-125', onClick: togglePlay, onContextMenu: preventDefaultEvent, title: isPlaying ? 'Pause' : 'Play', children: [jsxRuntime.jsx(PauseFill, { className: 'col-start-0 col-end-1 row-start-0 row-end-1 size-full scale-0 opacity-0 drop-shadow-[0_.25rem_2rem] drop-shadow-neutral-950/75 transition-[scale,opacity] duration-500 ease-exponential group-data-playing/video:scale-60 group-data-playing/video:opacity-100' }), jsxRuntime.jsx(PlayFill, { className: '-right-0.5 col-start-0 col-end-1 row-start-0 row-end-1 size-full scale-60 drop-shadow-[0_.25rem_2rem] drop-shadow-neutral-950/75 transition-[scale,opacity] duration-500 ease-exponential group-data-playing/video:scale-0 group-data-playing/video:opacity-0' })] }), jsxRuntime.jsxs("button", { className: 'col-start-0 col-end-1 row-start-0 row-end-1 grid size-12 rounded-full backdrop-blur-[1px] backdrop-brightness-101 transition-[scale,-webkit-backdrop-filter,backdrop-filter] duration-300 ease-exponential active:scale-95 active:backdrop-blur-[2px] active:backdrop-brightness-125 pointer-fine:hover:scale-105 pointer-fine:hover:backdrop-blur-xs pointer-fine:hover:backdrop-brightness-110 pointer-fine:active:scale-95 pointer-fine:active:backdrop-blur-[2px] pointer-fine:active:backdrop-brightness-125', onClick: skipBack, onContextMenu: preventDefaultEvent, title: `Skip Back ${skipDuration} Seconds`, children: [jsxRuntime.jsx(FiveArrowTriangleheadCounterclockwise, { className: 'col-start-0 col-end-1 row-start-0 row-end-1 size-full scale-60 opacity-0 drop-shadow-[0_.25rem_2rem] drop-shadow-neutral-950/75 group-data-alt/video:group-data-meta/video:opacity-100 group-data-alt/video:group-data-meta/video:group-data-ctrl/video:opacity-0 group-data-alt/video:group-data-meta/video:group-data-shift/video:opacity-0' }), jsxRuntime.jsx(TenArrowTriangleheadCounterclockwise, { className: 'col-start-0 col-end-1 row-start-0 row-end-1 size-full scale-60 drop-shadow-[0_.25rem_2rem] drop-shadow-neutral-950/75 group-data-alt/video:opacity-0 group-data-alt/video:group-data-ctrl/video:opacity-100 group-data-alt/video:group-data-shift/video:group-data-meta/video:group-data-ctrl/video:opacity-0' }), jsxRuntime.jsx(FifteenArrowTriangleheadCounterclockwise, { className: 'col-start-0 col-end-1 row-start-0 row-end-1 size-full scale-60 opacity-0 drop-shadow-[0_.25rem_2rem] drop-shadow-neutral-950/75 group-data-alt/video:opacity-100 group-data-ctrl/video:opacity-0 group-data-meta/video:opacity-0 group-data-shift/video:opacity-0' }), jsxRuntime.jsx(ThirtyArrowTriangleheadCounterclockwise, { className: 'col-start-0 col-end-1 row-start-0 row-end-1 size-full scale-60 opacity-0 drop-shadow-[0_.25rem_2rem] drop-shadow-neutral-950/75 group-data-alt/video:group-data-shift/video:opacity-100 group-data-alt/video:group-data-ctrl/video:group-data-shift/video:opacity-0 group-data-alt/video:group-data-meta/video:group-data-shift/video:opacity-0' }), jsxRuntime.jsx(SixtyArrowTriangleheadCounterclockwise, { className: 'col-start-0 col-end-1 row-start-0 row-end-1 size-full scale-60 opacity-0 drop-shadow-[0_.25rem_2rem] drop-shadow-neutral-950/75 group-data-alt/video:group-data-shift/video:group-data-meta/video:opacity-100 group-data-alt/video:group-data-shift/video:group-data-meta/video:group-data-ctrl/video:opacity-0' }), jsxRuntime.jsx(NinetyArrowTriangleheadCounterclockwise, { className: 'col-start-0 col-end-1 row-start-0 row-end-1 size-full scale-60 opacity-0 drop-shadow-[0_.25rem_2rem] drop-shadow-neutral-950/75 group-data-alt/video:group-data-shift/video:group-data-meta/video:group-data-ctrl/video:opacity-100' })] }), jsxRuntime.jsxs("button", { className: 'col-start-2 col-end-3 row-start-0 row-end-1 grid size-12 rounded-full backdrop-blur-[1px] backdrop-brightness-101 transition-[scale,-webkit-backdrop-filter,backdrop-filter] duration-300 ease-exponential active:scale-95 active:backdrop-blur-[2px] active:backdrop-brightness-125 pointer-fine:hover:scale-105 pointer-fine:hover:backdrop-blur-xs pointer-fine:hover:backdrop-brightness-110 pointer-fine:active:scale-95 pointer-fine:active:backdrop-blur-[2px] pointer-fine:active:backdrop-brightness-125', onClick: skipForward, onContextMenu: preventDefaultEvent, title: `Skip Forward ${skipDuration} Seconds`, children: [jsxRuntime.jsx(FiveArrowTriangleheadClockwise, { className: 'col-start-0 col-end-1 row-start-0 row-end-1 size-full scale-60 opacity-0 drop-shadow-[0_.25rem_2rem] drop-shadow-neutral-950/75 group-data-alt/video:group-data-meta/video:opacity-100 group-data-alt/video:group-data-meta/video:group-data-ctrl/video:opacity-0 group-data-alt/video:group-data-meta/video:group-data-shift/video:opacity-0' }), jsxRuntime.jsx(TenArrowTriangleheadClockwise, { className: 'col-start-0 col-end-1 row-start-0 row-end-1 size-full scale-60 drop-shadow-[0_.25rem_2rem] drop-shadow-neutral-950/75 group-data-alt/video:opacity-0 group-data-alt/video:group-data-ctrl/video:opacity-100 group-data-alt/video:group-data-shift/video:group-data-meta/video:group-data-ctrl/video:opacity-0' }), jsxRuntime.jsx(FifteenArrowTriangleheadClockwise, { className: 'col-start-0 col-end-1 row-start-0 row-end-1 size-full scale-60 opacity-0 drop-shadow-[0_.25rem_2rem] drop-shadow-neutral-950/75 group-data-alt/video:opacity-100 group-data-ctrl/video:opacity-0 group-data-meta/video:opacity-0 group-data-shift/video:opacity-0' }), jsxRuntime.jsx(ThirtyArrowTriangleheadClockwise, { className: 'col-start-0 col-end-1 row-start-0 row-end-1 size-full scale-60 opacity-0 drop-shadow-[0_.25rem_2rem] drop-shadow-neutral-950/75 group-data-alt/video:group-data-shift/video:opacity-100 group-data-alt/video:group-data-ctrl/video:group-data-shift/video:opacity-0 group-data-alt/video:group-data-meta/video:group-data-shift/video:opacity-0' }), jsxRuntime.jsx(SixtyArrowTriangleheadClockwise, { className: 'col-start-0 col-end-1 row-start-0 row-end-1 size-full scale-60 opacity-0 drop-shadow-[0_.25rem_2rem] drop-shadow-neutral-950/75 group-data-alt/video:group-data-shift/video:group-data-meta/video:opacity-100 group-data-alt/video:group-data-shift/video:group-data-meta/video:group-data-ctrl/video:opacity-0' }), jsxRuntime.jsx(NinetyArrowTriangleheadClockwise, { className: 'col-start-0 col-end-1 row-start-0 row-end-1 size-full scale-60 opacity-0 drop-shadow-[0_.25rem_2rem] drop-shadow-neutral-950/75 group-data-alt/video:group-data-shift/video:group-data-meta/video:group-data-ctrl/video:opacity-100' })] })] }), jsxRuntime.jsxs("div", { className: 'absolute inset-x-2 bottom-2 flex items-center gap-2 rounded-xl bg-neutral-900/50 px-2 py-1 shadow-2xl backdrop-blur-xs backdrop-brightness-110', children: [jsxRuntime.jsxs("div", { className: 'group/scrubber h-2 w-max flex-grow cursor-grab overflow-clip rounded-md bg-neutral-50/50 backdrop-blur-xs backdrop-brightness-110 transition-[height] duration-300 ease-exponential active:h-4 pointer-fine:hover:h-4 pointer-fine:active:h-4', onMouseDown: e => {
|
|
4660
|
+
initiateTrackProgress(e);
|
|
4661
|
+
initializeSeeking();
|
|
4662
|
+
}, onMouseMove: handleSeekIndicatorMovement, onMouseUp: handleSeekRelease, onTouchStart: initiateTrackProgress, ref: scrubberRef, children: [jsxRuntime.jsx("div", { "aria-hidden": 'true', className: 'absolute inset-0 grid transition-cols duration-100 ease-linear', style: { gridTemplateColumns: `${progress / MAX_PROGRESS}fr` }, children: jsxRuntime.jsx("div", { className: 'overflow-hidden', children: jsxRuntime.jsxs("div", { className: 'h-full bg-neutral-50/70 text-[1px] text-transparent backdrop-blur-xs backdrop-brightness-125', children: [progress, "/", MAX_PROGRESS] }) }) }), jsxRuntime.jsx("div", { ...(seekIndicator.isInPlayedArea ? { 'data-in-played-area': true } : {}), "aria-hidden": 'true', className: 'absolute inset-y-0 w-1 cursor-grab bg-neutral-50 opacity-0 transition-opacity duration-300 ease-exponential group-hover/scrubber:opacity-100 data-in-played-area:bg-neutral-500 pointer-coarse:hidden', style: { transform: `translateX(${seekIndicator.position}px)` }, children: "\u00A0" }), jsxRuntime.jsx("progress", { className: 'sr-only', max: MAX_PROGRESS, value: progress })] }), jsxRuntime.jsx("span", { className: 'block text-xs', children: timeRemaining / 60 >= 1
|
|
4663
|
+
? `${Math.round(timeRemaining / 60)}:${Math.round((timeRemaining / 60 - Math.round(timeRemaining / 60)) * 60)
|
|
4664
|
+
.toString()
|
|
4665
|
+
.padStart(2, '0')}`
|
|
4666
|
+
: Math.round(timeRemaining) === 60
|
|
4667
|
+
? `1:00`
|
|
4668
|
+
: `0:${Math.round(timeRemaining).toString().padStart(2, '0')}` }), jsxRuntime.jsxs(DropDown, { children: [jsxRuntime.jsx(DropDownButton, { arrow: false, className: 'group/button flex size-6 items-center justify-center rounded-xs transition-transform duration-300 ease-exponential active:scale-95 pointer-fine:hover:scale-105 pointer-fine:active:scale-95', title: 'Volume', children: jsxRuntime.jsxs("svg", { viewBox: '0 0 64 47', className: 'size-full scale-80 drop-shadow-[0_.125rem_1rem] drop-shadow-neutral-950/75 transition-transform duration-300 ease-exponential', style: { translate: `${volume > 0.66 ? '0' : volume > 0.33 ? '2px' : volume > 0 ? '4px' : '6px'} 0` }, children: [jsxRuntime.jsx("path", { d: 'M25.707,44.076C27.257,44.076 28.39,42.947 28.39,41.387L28.39,4.841C28.39,3.307 27.257,2.025 25.656,2.025C24.542,2.025 23.767,2.512 22.558,3.666L12.393,13.203C12.251,13.345 12.047,13.436 11.818,13.436L4.99,13.436C1.759,13.436 0,15.195 0,18.654L0,27.525C0,30.953 1.759,32.737 4.99,32.737L11.818,32.737C12.047,32.737 12.251,32.808 12.393,32.95L22.558,42.583C23.666,43.615 24.593,44.076 25.707,44.076Z' }), jsxRuntime.jsx("path", { className: 'transition-opacity duration-300 ease-exponential', d: 'M36.874,33.192C37.684,33.728 38.797,33.566 39.439,32.64C41.265,30.222 42.371,26.683 42.371,23.026C42.371,19.368 41.265,15.855 39.439,13.411C38.797,12.485 37.684,12.323 36.874,12.885C35.923,13.553 35.761,14.721 36.505,15.713C37.901,17.607 38.662,20.249 38.662,23.026C38.662,25.802 37.876,28.419 36.505,30.338C35.786,31.355 35.923,32.498 36.874,33.192Z', style: { opacity: volume > 0 ? 1 : 0 } }), jsxRuntime.jsx("path", { className: 'transition-opacity duration-300 ease-exponential', d: 'M45.738,39.394C46.624,39.981 47.712,39.799 48.354,38.868C51.402,34.69 53.208,28.904 53.208,23.026C53.208,17.148 51.427,11.31 48.354,7.183C47.712,6.252 46.624,6.07 45.738,6.657C44.858,7.249 44.701,8.362 45.399,9.354C48.023,13.032 49.499,17.952 49.499,23.026C49.499,28.099 47.972,32.994 45.399,36.697C44.726,37.689 44.858,38.802 45.738,39.394Z', style: { opacity: volume > 0.33 ? 1 : 0 } }), jsxRuntime.jsx("path", { className: 'transition-opacity duration-300 ease-exponential', d: 'M54.679,45.708C55.514,46.32 56.683,46.082 57.315,45.121C61.498,39.091 64,31.447 64,23.026C64,14.604 61.422,6.986 57.315,0.93C56.683,-0.056 55.514,-0.269 54.679,0.343C53.804,0.956 53.668,2.079 54.33,3.071C58.012,8.514 60.342,15.379 60.342,23.026C60.342,30.647 58.012,37.562 54.33,42.98C53.668,43.972 53.804,45.095 54.679,45.708Z', style: { opacity: volume > 0.66 ? 1 : 0 } })] }) }), jsxRuntime.jsxs(DropDownItems, { anchor: {
|
|
4507
4669
|
gap: '.5rem',
|
|
4508
4670
|
padding: '.375rem',
|
|
4509
4671
|
to: 'top',
|
|
4510
|
-
}, className: 'bg-neutral-900/50 px-1.5 py-1.5 text-neutral-50 backdrop-blur-xs backdrop-brightness-110',
|
|
4672
|
+
}, className: 'bg-neutral-900/50 px-1.5 py-1.5 text-neutral-50 backdrop-blur-xs backdrop-brightness-110', children: [jsxRuntime.jsx(DropDownItem, { as: 'button', className: 'flex size-6 items-center justify-center rounded-xs transition-transform duration-300 ease-exponential active:scale-95 pointer-fine:hover:scale-105 pointer-fine:active:scale-95', onClick: increaseVolume, title: 'Increase volume', children: jsxRuntime.jsx(SpeakerPlusFill, { className: 'size-full scale-80 drop-shadow-[0_.125rem_1rem] drop-shadow-neutral-950/75' }) }), jsxRuntime.jsx(DropDownSeparator, { "aria-label": 'Volume slider', "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": volume * 100, className: 'mx-auto my-2 h-24 w-2 cursor-grab overflow-clip rounded-md bg-neutral-50/50 backdrop-blur-xs backdrop-brightness-110 transition-[width] duration-300 ease-exponential active:w-4 pointer-fine:hover:w-4 pointer-fine:active:w-4', onMouseDown: initiateTrackVolume, onTouchStart: initiateTrackVolume, role: 'slider', children: jsxRuntime.jsx("div", { "aria-hidden": 'true', className: 'grid size-full rotate-180 transition-rows duration-300 ease-exponential', style: { gridTemplateRows: `${volume}fr` }, children: jsxRuntime.jsx("div", { className: 'overflow-y-hidden', children: jsxRuntime.jsxs("div", { className: 'size-full bg-neutral-50/70 text-[1px] text-transparent backdrop-blur-xs backdrop-brightness-125', children: [volume * 100, "%"] }) }) }) }), jsxRuntime.jsx(DropDownItem, { as: 'button', className: 'flex size-6 items-center justify-center rounded-xs transition-transform duration-300 ease-exponential active:scale-95 pointer-fine:hover:scale-105 pointer-fine:active:scale-95', onClick: decreaseVolume, title: 'Decrease volume', children: jsxRuntime.jsx(SpeakerMinusFill, { className: 'size-full scale-80 drop-shadow-[0_.125rem_1rem] drop-shadow-neutral-950/75' }) })] })] }), jsxRuntime.jsx("button", { className: 'flex size-6 items-center justify-center rounded-xs transition-transform duration-300 ease-exponential active:scale-95 pointer-fine:hover:scale-105 pointer-fine:active:scale-95', onClick: enterPictureInPicture, title: 'Enter Picture-in-Picture', children: jsxRuntime.jsx(RectangleFillOnArrowDownForwardTopleadingRectangle, { className: 'size-full scale-80 drop-shadow-[0_.125rem_1rem] drop-shadow-neutral-950/75' }) }), jsxRuntime.jsx("button", { className: 'flex size-6 items-center justify-center rounded-xs transition-transform duration-300 ease-exponential active:scale-95 pointer-fine:hover:scale-105 pointer-fine:active:scale-95', onClick: handleRemotePlayback, title: 'Remote Playback', children: jsxRuntime.jsx(RectangleTriangleUp, { className: 'size-full scale-80 drop-shadow-[0_.125rem_1rem] drop-shadow-neutral-950/75' }) }), jsxRuntime.jsxs(DropDown, { children: [jsxRuntime.jsx(DropDownButton, { arrow: false, className: 'flex size-6 items-center justify-center rounded-xs transition-transform duration-300 ease-exponential active:scale-95 pointer-fine:hover:scale-105 pointer-fine:active:scale-95', title: 'Other Settings', children: jsxRuntime.jsx(GearshapeFill, { className: 'size-full scale-80 drop-shadow-[0_.125rem_1rem] drop-shadow-neutral-950/75' }) }), jsxRuntime.jsx(DropDownItems, { anchor: {
|
|
4511
4673
|
gap: '.5rem',
|
|
4512
4674
|
padding: '.375rem',
|
|
4513
4675
|
to: 'top end',
|