mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-08 04:50:12 +02:00
Add visualizer configuration (#1443)
* add visualizer configuration * add visualizer presets * add butterchurn visualizer * wrap visualizers in error boundary
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import {
|
||||
AngleSlider as MantineAngleSlider,
|
||||
AngleSliderProps as MantineAngleSliderProps,
|
||||
} from '@mantine/core';
|
||||
import { forwardRef } from 'react';
|
||||
|
||||
export interface AngleSliderProps extends MantineAngleSliderProps {}
|
||||
|
||||
export const AngleSlider = forwardRef<HTMLDivElement, AngleSliderProps>((props, ref) => {
|
||||
return <MantineAngleSlider {...props} ref={ref} />;
|
||||
});
|
||||
|
||||
AngleSlider.displayName = 'AngleSlider';
|
||||
@@ -0,0 +1,5 @@
|
||||
.root {
|
||||
&[data-variant='default'] {
|
||||
background: none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Fieldset as MantineFieldset, FieldsetProps as MantineFieldsetProps } from '@mantine/core';
|
||||
import { CSSProperties, forwardRef } from 'react';
|
||||
|
||||
import styles from './fieldset.module.css';
|
||||
|
||||
export interface FieldsetProps extends MantineFieldsetProps {
|
||||
maxWidth?: CSSProperties['maxWidth'];
|
||||
width?: CSSProperties['width'];
|
||||
}
|
||||
|
||||
export const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(
|
||||
({ children, ...props }, ref) => {
|
||||
return (
|
||||
<MantineFieldset classNames={{ root: styles.root }} {...props} ref={ref}>
|
||||
{children}
|
||||
</MantineFieldset>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Fieldset.displayName = 'Fieldset';
|
||||
@@ -1,25 +1,29 @@
|
||||
import type { SliderProps as MantineSliderProps } from '@mantine/core';
|
||||
|
||||
import { Slider as MantineSlider } from '@mantine/core';
|
||||
import { forwardRef } from 'react';
|
||||
|
||||
import styles from './slider.module.css';
|
||||
|
||||
export interface SliderProps extends MantineSliderProps {}
|
||||
|
||||
export const Slider = ({ classNames, style, ...props }: SliderProps) => {
|
||||
return (
|
||||
<MantineSlider
|
||||
classNames={{
|
||||
bar: styles.bar,
|
||||
label: styles.label,
|
||||
thumb: styles.thumb,
|
||||
track: styles.track,
|
||||
...classNames,
|
||||
}}
|
||||
style={{
|
||||
...style,
|
||||
}}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
};
|
||||
export const Slider = forwardRef<HTMLDivElement, SliderProps>(
|
||||
({ classNames, style, ...props }, ref) => {
|
||||
return (
|
||||
<MantineSlider
|
||||
classNames={{
|
||||
bar: styles.bar,
|
||||
label: styles.label,
|
||||
thumb: styles.thumb,
|
||||
track: styles.track,
|
||||
...classNames,
|
||||
}}
|
||||
ref={ref}
|
||||
style={{
|
||||
...style,
|
||||
}}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user