UNPKG

@kubit-ui-web/react-components

Version:

Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience

36 lines 2.05 kB
import { jsx as _jsx } from "react/jsx-runtime"; import React from 'react'; import { STYLES_NAME } from '../../constants/stylesName/stylesName'; import { useStyles } from '../../hooks/useStyles/useStyles'; import { ErrorBoundary } from '../../provider/errorBoundary/errorBoundary'; import { FallbackComponent } from '../../provider/errorBoundary/fallbackComponent'; import { useMediaProgressBar } from './hooks/useMediaProgressBar'; import { MediaProgressBarStandalone } from './mediaProgressBarStandAlone'; const MediaProgressBarComponent = React.forwardRef(({ variant, barsNum = 1, currentBar = 0, onBarChange, onFinish, ctv, playingExternal = false, circular = false, onBarClick, onBarKeyDown, ...props }, ref) => { const styles = useStyles(STYLES_NAME.MEDIA_PROGRESS_BAR, variant, ctv); const { playing, barRef, progressBarRef, handleClickBar, handleKeyDownBar } = useMediaProgressBar({ playingExternal, circular, currentBar, barsNum, onBarChange, onFinish, onBarClick, onBarKeyDown, }); return (_jsx(MediaProgressBarStandalone, { ...props, ref: ref, barRef: barRef, barsNum: barsNum, currentBar: currentBar, playing: playing, progressBarRef: progressBarRef, styles: styles, onBarClick: handleClickBar, onBarKeyDown: handleKeyDownBar })); }); MediaProgressBarComponent.displayName = 'MediaProgressBarComponent'; const MediaProgressBarBoundary = (props, ref) => (_jsx(ErrorBoundary, { fallBackComponent: _jsx(FallbackComponent, { children: _jsx(MediaProgressBarStandalone, { ...props, ref: ref }) }), children: _jsx(MediaProgressBarComponent, { ...props, ref: ref }) })); const MediaProgressBar = React.forwardRef(MediaProgressBarBoundary); /** * @description * MediaProgressBar component is used to show a progress bar. * @param {React.PropsWithChildren<IMediaProgressBar<V>>} props * @returns {JSX.Element} * @constructor * @example * <MediaProgressBar variant="mediaProgressBar" /> */ export { MediaProgressBar }; //# sourceMappingURL=mediaProgressBar.js.map