mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
FormSliderControl: option to hide the track
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
import * as React from 'react';
|
||||
|
||||
import type { SxProps } from '@mui/joy/styles/types';
|
||||
import { FormControl, Slider, VariantProp } from '@mui/joy';
|
||||
|
||||
import { FormLabelStart } from './FormLabelStart';
|
||||
|
||||
|
||||
const _styleNoTrack = {
|
||||
'--Slider-trackBackground': 'transparent'
|
||||
} as const satisfies SxProps;
|
||||
|
||||
/**
|
||||
* Slider Control
|
||||
*/
|
||||
@@ -18,6 +23,7 @@ export function FormSliderControl(props: {
|
||||
value: number | number[] | null, onChange: (value: number) => void,
|
||||
startAdornment?: React.ReactNode,
|
||||
endAdornment?: React.ReactNode,
|
||||
styleNoTrack?: boolean,
|
||||
}) {
|
||||
|
||||
|
||||
@@ -60,6 +66,7 @@ export function FormSliderControl(props: {
|
||||
onChange={handleChange}
|
||||
onChangeCommitted={handleChangeCommitted}
|
||||
valueLabelDisplay={props.valueLabelDisplay}
|
||||
sx={props.styleNoTrack ? _styleNoTrack : undefined}
|
||||
// sx={{ py: 1, mt: 1.1 }}
|
||||
/>
|
||||
{props.endAdornment}
|
||||
|
||||
Reference in New Issue
Block a user