breaking: convert offset > over-under

change offset direction and relabel to over-under
This commit is contained in:
Carlos Valente
2025-07-14 11:12:52 +02:00
parent 92a34cf135
commit 1e1f547ce1
18 changed files with 89 additions and 72 deletions
@@ -103,7 +103,7 @@ function DurationInput({
onClick={handleFakeFocus}
onFocus={handleFakeFocus}
muted={!lockedValue}
delayed={delayed}
offset={delayed ? 'behind' : undefined}
ref={textRef}
>
{children}
@@ -14,7 +14,11 @@
overflow: hidden;
&.delayed {
&.ahead {
color: $playback-ahead;
}
&.behind {
color: $ontime-delay-text;
}
@@ -5,29 +5,30 @@ import { cx } from '../../../../common/utils/styleUtils';
import style from './TextLikeInput.module.scss';
interface TextLikeInputProps extends HTMLAttributes<HTMLSpanElement> {
delayed?: boolean;
offset?: 'ahead' | 'behind';
muted?: boolean;
}
const TextLikeInput = forwardRef((props: PropsWithChildren<TextLikeInputProps>, textRef) => {
const { delayed, muted, children, className, ...elementProps } = props;
const ref = useRef<HTMLDivElement | null>(null);
const classes = cx([style.textInput, delayed && style.delayed, muted && style.muted, className]);
const TextLikeInput = forwardRef(
({ offset, muted, children, className, ...elementProps }: PropsWithChildren<TextLikeInputProps>, textRef) => {
const ref = useRef<HTMLDivElement | null>(null);
const classes = cx([style.textInput, offset && style[offset], muted && style.muted, className]);
useImperativeHandle(textRef, () => {
return {
focusParentElement() {
ref.current?.parentElement?.focus();
},
};
});
useImperativeHandle(textRef, () => {
return {
focusParentElement() {
ref.current?.parentElement?.focus();
},
};
});
return (
<div className={classes} {...elementProps} tabIndex={0} ref={ref}>
{children}
</div>
);
});
return (
<div className={classes} tabIndex={0} {...elementProps} ref={ref}>
{children}
</div>
);
},
);
TextLikeInput.displayName = 'TextLikeInput';
@@ -105,7 +105,7 @@ function TimeInputDuration({
onClick={handleFakeFocus}
onFocus={handleFakeFocus}
muted={!lockedValue}
delayed={delayed}
offset={delayed ? 'behind' : undefined}
ref={textRef}
>
{children}