diff --git a/web/libs/editor/src/common/Label/Label.scss b/web/libs/editor/src/common/Label/Label.scss index 828723c4f2fc..8754089ba274 100644 --- a/web/libs/editor/src/common/Label/Label.scss +++ b/web/libs/editor/src/common/Label/Label.scss @@ -22,6 +22,13 @@ line-height: 0; } + &_size_small &__text { + font-size: 10px; + margin: 0; + height: 14px; + line-height: 14px; + } + &_size_large &__text { font-weight: 500; font-size: 16px; @@ -44,12 +51,6 @@ color: var(--sand_500); } - &_large &__text { - font-size: 16px; - font-weight: 500; - margin-bottom: 16px; - } - &_placement_right { display: inline-flex; flex-direction: row-reverse; @@ -79,4 +80,4 @@ &_placement_left.label_withDescription &__field { margin-top: 5px; } -} \ No newline at end of file +} diff --git a/web/libs/editor/src/components/SidePanels/DetailsPanel/RegionEditor.tsx b/web/libs/editor/src/components/SidePanels/DetailsPanel/RegionEditor.tsx index a39c6110d2a6..cad8ff430097 100644 --- a/web/libs/editor/src/components/SidePanels/DetailsPanel/RegionEditor.tsx +++ b/web/libs/editor/src/components/SidePanels/DetailsPanel/RegionEditor.tsx @@ -96,6 +96,8 @@ const RegionEditorComponent: FC = ({ region }) => { isSidepanel={true} onChangeStartTime={changeStartTimeHandler} onChangeEndTime={changeEndTimeHandler} + showLabels + showDuration /> ); diff --git a/web/libs/editor/src/components/TimeDurationControl/TimeBox.scss b/web/libs/editor/src/components/TimeDurationControl/TimeBox.scss index 4fb1ffc22bce..49591c25d274 100644 --- a/web/libs/editor/src/components/TimeDurationControl/TimeBox.scss +++ b/web/libs/editor/src/components/TimeDurationControl/TimeBox.scss @@ -1,19 +1,15 @@ .time-box { width: 100px; height: 24px; - border-radius: 4px 0 0 4px; + border-radius: 4px; border: 1px solid var(--sand_300); font-size: 14px; + font-weight: 400; &_sidepanel { width: 100%; } - &_inverted { - border-left: none; - border-radius: 0 4px 4px 0; - } - &__input-time { border: none; padding: 0; @@ -35,4 +31,4 @@ color: var(--sand_400); } } -} \ No newline at end of file +} diff --git a/web/libs/editor/src/components/TimeDurationControl/TimeBox.tsx b/web/libs/editor/src/components/TimeDurationControl/TimeBox.tsx index 41358c069c57..86f88b3ca077 100644 --- a/web/libs/editor/src/components/TimeDurationControl/TimeBox.tsx +++ b/web/libs/editor/src/components/TimeDurationControl/TimeBox.tsx @@ -1,6 +1,7 @@ import React, { type FC, useCallback, useEffect, useState } from "react"; import { Block, Elem } from "../../utils/bem"; import { MaskUtil } from "../../utils/InputMask"; +import Label from "../../common/Label/Label"; import "./TimeBox.scss"; @@ -8,18 +9,11 @@ export interface TimerProps { sidepanel: boolean; value: number; readonly?: boolean; - inverted?: boolean; onChange: (value: number) => void; + label?: string; } -export const TimeBox: FC = ({ - sidepanel = false, - value, - inverted = false, - readonly = false, - onChange, - ...props -}) => { +export const TimeBox: FC = ({ sidepanel = false, value, readonly = false, onChange, label, ...props }) => { const inputRef = React.createRef(); const [currentInputTime, setCurrentInputTime] = useState(value); @@ -97,9 +91,17 @@ export const TimeBox: FC = ({ ); }; - return ( - + const timeBoxContent = ( + {renderInputTime()} ); + + return label ? ( + + ) : ( + timeBoxContent + ); }; diff --git a/web/libs/editor/src/components/TimeDurationControl/TimeDurationControl.scss b/web/libs/editor/src/components/TimeDurationControl/TimeDurationControl.scss index 033afeaab8bf..0d4c74a74f26 100644 --- a/web/libs/editor/src/components/TimeDurationControl/TimeDurationControl.scss +++ b/web/libs/editor/src/components/TimeDurationControl/TimeDurationControl.scss @@ -1,3 +1,16 @@ .timer-duration-control { display: flex; -} \ No newline at end of file + + & > label:not(:first-child) .time-box, + & > .time-box:not(:first-child) { + border-bottom-left-radius: 0; + border-top-left-radius: 0; + } + + & > label:not(:last-child) .time-box, + & > .time-box:not(:last-child) { + border-right: none; + border-bottom-right-radius: 0; + border-top-right-radius: 0; + } +} diff --git a/web/libs/editor/src/components/TimeDurationControl/TimeDurationControl.tsx b/web/libs/editor/src/components/TimeDurationControl/TimeDurationControl.tsx index 55f08e249014..5be144046805 100644 --- a/web/libs/editor/src/components/TimeDurationControl/TimeDurationControl.tsx +++ b/web/libs/editor/src/components/TimeDurationControl/TimeDurationControl.tsx @@ -15,6 +15,8 @@ export interface TimerProps { endTimeReadonly?: boolean; onChangeStartTime?: (value: number) => void; onChangeEndTime?: (value: number) => void; + showDuration?: boolean; + showLabels?: boolean; } export const TimeDurationControl: FC = ({ @@ -28,6 +30,8 @@ export const TimeDurationControl: FC = ({ endTimeReadonly = false, onChangeStartTime, onChangeEndTime, + showDuration = false, + showLabels = false, }) => { const _currentTime = !currentTime ? startTime : currentTime; @@ -46,6 +50,7 @@ export const TimeDurationControl: FC = ({ readonly={startTimeReadonly} value={_currentTime} onChange={handleChangeCurrentTime} + label={showLabels ? "Start" : undefined} data-testid="timebox-current-time" /> = ({ value={endTime} onChange={handleChangeEndTime} data-testid="timebox-end-time" - inverted + label={showLabels ? "End" : undefined} /> + {showDuration && ( + {}} + data-testid="timebox-duration-time" + label={showLabels ? "Duration" : undefined} + /> + )} ); };