refactor: cuesheet design review

fix: parsing of custom fields for blocks
refactor: extract cuesheet settings
refactor: cuesheet actions
refactor: improve cuesheet performance on resizing
This commit is contained in:
Carlos Valente
2025-06-29 08:51:38 +02:00
committed by Carlos Valente
parent 0726c04f20
commit 8ad260d28a
61 changed files with 1421 additions and 734 deletions
@@ -79,3 +79,22 @@
border-color: $gray-1250;
}
}
.ghosted {
background: transparent;
color: $ui-white;
&:hover:not(:disabled):not(:active) {
background: $gray-1000;
color: $ui-white;
}
&:active:not(:disabled) {
background: $gray-1100;
border-color: $gray-1250;
}
&:disabled {
opacity: $opacity-disabled;
}
}
@@ -1,20 +1,21 @@
import { ButtonHTMLAttributes } from 'react';
import { ButtonHTMLAttributes, forwardRef } from 'react';
import { cx } from '../../utils/styleUtils';
import style from './Button.module.scss';
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
variant?: 'primary' | 'subtle' | 'subtle-white' | 'destructive' | 'subtle-destructive';
variant?: 'primary' | 'subtle' | 'subtle-white' | 'destructive' | 'subtle-destructive' | 'ghosted';
size?: 'small' | 'medium' | 'large' | 'xlarge';
fluid?: boolean;
}
export default function Button(props: ButtonProps) {
const Button = forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => {
const { className, children, variant = 'subtle', size = 'medium', fluid, ...buttonProps } = props;
return (
<button
ref={ref}
className={cx([style.baseButton, style[variant], style[size], fluid && style.fluid, className])}
type='button'
{...buttonProps}
@@ -22,4 +23,8 @@ export default function Button(props: ButtonProps) {
{children}
</button>
);
}
});
Button.displayName = 'Button';
export default Button;
@@ -7,7 +7,7 @@
place-content: center;
border: 1px solid transparent;
border-radius: 3px;
border-radius: $component-border-radius-md;
cursor: pointer;
@@ -17,6 +17,11 @@
}
}
.small {
height: 1.5rem;
font-size: calc(1rem - 3px);
}
.medium {
height: 2rem;
width: 2rem;
@@ -5,8 +5,8 @@ import { cx } from '../../utils/styleUtils';
import style from './IconButton.module.scss';
interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
variant?: 'primary' | 'subtle' | 'subtle-white' | 'destructive' | 'subtle-destructive';
size?: 'medium' | 'large' | 'xlarge';
variant?: 'primary' | 'subtle' | 'subtle-white' | 'destructive' | 'subtle-destructive' | 'ghosted';
size?: 'small' | 'medium' | 'large' | 'xlarge';
}
export default function IconButton({