@unicity/design-system
Version:
A comprehensive React component library built on Material-UI with advanced theming capabilities including neumorphism design support
12 lines • 1.16 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Typography, Box, } from '@mui/material';
import { StyledSlider, SliderContainer } from './Slider.style';
export const Slider = ({ value, onChange, min = 0, max = 100, step = 1, valueLabelDisplay = 'auto', label, showMinMax = false, marks = false, disabled = false, color = 'primary', size = 'medium', ...props }) => {
const handleChange = (event, newValue) => {
if (onChange) {
onChange(newValue);
}
};
return (_jsxs(SliderContainer, { children: [label && (_jsx(Typography, { variant: "body2", gutterBottom: true, children: label })), showMinMax && (_jsxs(Box, { display: "flex", justifyContent: "space-between", mb: 1, children: [_jsx(Typography, { variant: "caption", color: "textSecondary", children: min }), _jsx(Typography, { variant: "caption", color: "textSecondary", children: max })] })), _jsx(StyledSlider, { value: value, onChange: handleChange, min: min, max: max, step: step, valueLabelDisplay: valueLabelDisplay, marks: marks, disabled: disabled, color: color, size: size, ...props })] }));
};
//# sourceMappingURL=Slider.js.map