diff --git a/front/src/modules/ui/display/checkmark/components/Checkmark.tsx b/front/src/modules/ui/display/checkmark/components/Checkmark.tsx index 71db51f98..f6a74d7ac 100644 --- a/front/src/modules/ui/display/checkmark/components/Checkmark.tsx +++ b/front/src/modules/ui/display/checkmark/components/Checkmark.tsx @@ -14,13 +14,15 @@ const StyledContainer = styled.div` width: 20px; `; -export type CheckmarkProps = React.ComponentPropsWithoutRef<'div'>; +export type CheckmarkProps = React.ComponentPropsWithoutRef<'div'> & { + className?: string; +}; -export const Checkmark = (_props: CheckmarkProps) => { +export const Checkmark = ({ className }: CheckmarkProps) => { const theme = useTheme(); return ( - + ); diff --git a/front/src/modules/ui/display/chip/components/EntityChip.tsx b/front/src/modules/ui/display/chip/components/EntityChip.tsx index 789b1c65e..58f78e26e 100644 --- a/front/src/modules/ui/display/chip/components/EntityChip.tsx +++ b/front/src/modules/ui/display/chip/components/EntityChip.tsx @@ -16,6 +16,7 @@ export type EntityChipProps = { avatarType?: AvatarType; variant?: EntityChipVariant; LeftIcon?: IconComponent; + className?: string; }; export enum EntityChipVariant { @@ -31,6 +32,7 @@ export const EntityChip = ({ avatarType = 'rounded', variant = EntityChipVariant.Regular, LeftIcon, + className, }: EntityChipProps) => { const navigate = useNavigate(); @@ -69,6 +71,7 @@ export const EntityChip = ({ } clickable={!!linkToEntity} onClick={handleLinkClick} + className={className} /> ) : ( <> diff --git a/front/src/modules/ui/display/tooltip/OverflowingTextWithTooltip.tsx b/front/src/modules/ui/display/tooltip/OverflowingTextWithTooltip.tsx index 46caf9059..41b266efa 100644 --- a/front/src/modules/ui/display/tooltip/OverflowingTextWithTooltip.tsx +++ b/front/src/modules/ui/display/tooltip/OverflowingTextWithTooltip.tsx @@ -21,8 +21,10 @@ const StyledOverflowingText = styled.div<{ cursorPointer: boolean }>` export const OverflowingTextWithTooltip = ({ text, + className, }: { text: string | null | undefined; + className?: string; }) => { const textElementId = `title-id-${uuidV4()}`; @@ -51,6 +53,7 @@ export const OverflowingTextWithTooltip = ({ <> theme.spacing(3)}; `; -export const H2Title = ({ title, description, addornment }: H2TitleProps) => ( - +export const H2Title = ({ + title, + description, + addornment, + className, +}: H2TitleProps) => ( + {title} {addornment} diff --git a/front/src/modules/ui/feedback/dialog-manager/components/Dialog.tsx b/front/src/modules/ui/feedback/dialog-manager/components/Dialog.tsx index f41786ff9..daaaf6904 100644 --- a/front/src/modules/ui/feedback/dialog-manager/components/Dialog.tsx +++ b/front/src/modules/ui/feedback/dialog-manager/components/Dialog.tsx @@ -69,6 +69,7 @@ export type DialogProps = React.ComponentPropsWithoutRef & { buttons?: DialogButtonOptions[]; allowDismiss?: boolean; children?: React.ReactNode; + className?: string; onClose?: () => void; }; @@ -78,6 +79,7 @@ export const Dialog = ({ buttons = [], allowDismiss = true, children, + className, onClose, id, }: DialogProps) => { @@ -133,6 +135,7 @@ export const Dialog = ({ closeSnackbar(); } }} + className={className} > Promise; }; -const StyledBar = styled.div>` +const StyledBar = styled.div` height: ${({ barHeight }) => barHeight}px; overflow: hidden; width: 100%; @@ -43,6 +49,7 @@ export const ProgressBar = forwardRef( barHeight = 24, barColor, autoStart = true, + className, }, ref, ) => { @@ -86,7 +93,7 @@ export const ProgressBar = forwardRef( }, [controls, delay, duration, easing, autoStart, start]); return ( - + { duration?: number; variant?: SnackbarVariant; children?: React.ReactNode; + className?: string; onClose?: () => void; } @@ -113,6 +114,7 @@ export const SnackBar = ({ onClose, id, title, + className, }: SnackBarProps) => { const theme = useTheme(); @@ -157,6 +159,7 @@ export const SnackBar = ({ return ( diff --git a/front/src/modules/ui/input/button/components/FloatingButtonGroup.tsx b/front/src/modules/ui/input/button/components/FloatingButtonGroup.tsx index fe7dcbc58..a194dcc22 100644 --- a/front/src/modules/ui/input/button/components/FloatingButtonGroup.tsx +++ b/front/src/modules/ui/input/button/components/FloatingButtonGroup.tsx @@ -13,13 +13,15 @@ const StyledFloatingButtonGroupContainer = styled.div` export type FloatingButtonGroupProps = Pick & { children: React.ReactElement[]; + className?: string; }; export const FloatingButtonGroup = ({ children, size, + className, }: FloatingButtonGroupProps) => ( - + {React.Children.map(children, (child, index) => { let position: FloatingButtonPosition; diff --git a/front/src/modules/ui/input/button/components/IconButtonGroup.tsx b/front/src/modules/ui/input/button/components/IconButtonGroup.tsx index 57488cbd6..c80608447 100644 --- a/front/src/modules/ui/input/button/components/IconButtonGroup.tsx +++ b/front/src/modules/ui/input/button/components/IconButtonGroup.tsx @@ -18,6 +18,7 @@ export type IconButtonGroupProps = Pick< Icon: IconComponent; onClick?: (event: MouseEvent) => void; }[]; + className?: string; }; export const IconButtonGroup = ({ @@ -25,8 +26,9 @@ export const IconButtonGroup = ({ iconButtons, size, variant, + className, }: IconButtonGroupProps) => ( - + {iconButtons.map(({ Icon, onClick }, index) => { const position: IconButtonPosition = index === 0 diff --git a/front/src/modules/ui/input/button/components/MainButton.tsx b/front/src/modules/ui/input/button/components/MainButton.tsx index 082718c49..4d75be9ae 100644 --- a/front/src/modules/ui/input/button/components/MainButton.tsx +++ b/front/src/modules/ui/input/button/components/MainButton.tsx @@ -106,10 +106,14 @@ export const MainButton = ({ type, onClick, disabled, + className, }: MainButtonProps) => { const theme = useTheme(); return ( - + {Icon && } {title} diff --git a/front/src/modules/ui/input/button/components/RoundedIconButton.tsx b/front/src/modules/ui/input/button/components/RoundedIconButton.tsx index bde76d675..c17328631 100644 --- a/front/src/modules/ui/input/button/components/RoundedIconButton.tsx +++ b/front/src/modules/ui/input/button/components/RoundedIconButton.tsx @@ -37,11 +37,12 @@ export const RoundedIconButton = ({ Icon, onClick, disabled, + className, }: RoundedIconButtonProps) => { const theme = useTheme(); return ( - + {} ); diff --git a/front/src/modules/ui/input/color-scheme/components/ColorSchemeCard.tsx b/front/src/modules/ui/input/color-scheme/components/ColorSchemeCard.tsx index ff6d40aef..f46b73086 100644 --- a/front/src/modules/ui/input/color-scheme/components/ColorSchemeCard.tsx +++ b/front/src/modules/ui/input/color-scheme/components/ColorSchemeCard.tsx @@ -96,17 +96,20 @@ const StyledColorSchemeContent = styled(motion.div)< export type ColorSchemeSegmentProps = { variant: ColorScheme; controls: AnimationControls; + className?: string; } & React.ComponentPropsWithoutRef<'div'>; const ColorSchemeSegment = ({ variant, controls, style, + className, onClick, onMouseEnter, onMouseLeave, }: ColorSchemeSegmentProps) => ( diff --git a/front/src/modules/ui/input/color-scheme/components/ColorSchemePicker.tsx b/front/src/modules/ui/input/color-scheme/components/ColorSchemePicker.tsx index e1d14de01..71e900ab4 100644 --- a/front/src/modules/ui/input/color-scheme/components/ColorSchemePicker.tsx +++ b/front/src/modules/ui/input/color-scheme/components/ColorSchemePicker.tsx @@ -27,14 +27,16 @@ const StyledLabel = styled.span` export type ColorSchemePickerProps = { value: ColorScheme; + className?: string; onChange: (value: ColorScheme) => void; }; export const ColorSchemePicker = ({ value, onChange, + className, }: ColorSchemePickerProps) => ( - + onChange('Light')} diff --git a/front/src/modules/ui/input/components/AutosizeTextInput.tsx b/front/src/modules/ui/input/components/AutosizeTextInput.tsx index 7f0c8fd0f..c347c8158 100644 --- a/front/src/modules/ui/input/components/AutosizeTextInput.tsx +++ b/front/src/modules/ui/input/components/AutosizeTextInput.tsx @@ -26,6 +26,7 @@ type AutosizeTextInputProps = { variant?: AutosizeTextInputVariant; buttonTitle?: string; value?: string; + className?: string; }; const StyledContainer = styled.div` @@ -117,6 +118,7 @@ export const AutosizeTextInput = ({ variant = AutosizeTextInputVariant.Default, buttonTitle, value = '', + className, }: AutosizeTextInputProps) => { const [isFocused, setIsFocused] = useState(false); const [isHidden, setIsHidden] = useState( @@ -183,7 +185,7 @@ export const AutosizeTextInput = ({ return ( <> - + {!isHidden && ( { const [isInternalChecked, setIsInternalChecked] = React.useState(false); @@ -134,7 +136,7 @@ export const Checkbox = ({ const checkboxId = 'checkbox' + v4(); return ( - + void; + className?: string; }; const StyledDoubleTextContainer = styled.div` @@ -41,6 +42,7 @@ export const EntityTitleDoubleTextInput = ({ firstValuePlaceholder, secondValuePlaceholder, onChange, + className, }: EntityTitleDoubleTextInputProps) => { const { goBackToPreviousHotkeyScope, @@ -54,7 +56,7 @@ export const EntityTitleDoubleTextInput = ({ }; return ( - + {(nodeDimensions) => ( void; onOpen?: () => void; variant?: IconButtonVariant; + className?: string; }; const StyledMenuIconItemsContainer = styled.div` @@ -52,6 +53,7 @@ export const IconPicker = ({ onClose, onOpen, variant = 'secondary', + className, }: IconPickerProps) => { const [searchString, setSearchString] = useState(''); @@ -79,55 +81,57 @@ export const IconPicker = ({ return ( - - } - dropdownMenuWidth={176} - dropdownComponents={ - - setSearchString(event.target.value)} +
+ - - - {isLoading ? ( - - ) : ( - - {iconKeys.map((iconKey) => ( - { - onChange({ iconKey, Icon: icons[iconKey] }); - closeDropdown(); - }} - /> - ))} - - )} - - - } - onClickOutside={onClickOutside} - onClose={() => { - onClose?.(); - setSearchString(''); - }} - onOpen={onOpen} - /> + } + dropdownMenuWidth={176} + dropdownComponents={ + + setSearchString(event.target.value)} + /> + + + {isLoading ? ( + + ) : ( + + {iconKeys.map((iconKey) => ( + { + onChange({ iconKey, Icon: icons[iconKey] }); + closeDropdown(); + }} + /> + ))} + + )} + + + } + onClickOutside={onClickOutside} + onClose={() => { + onClose?.(); + setSearchString(''); + }} + onOpen={onOpen} + /> +
); }; diff --git a/front/src/modules/ui/input/components/ImageInput.tsx b/front/src/modules/ui/input/components/ImageInput.tsx index c7fd7afdd..4c6641ac7 100644 --- a/front/src/modules/ui/input/components/ImageInput.tsx +++ b/front/src/modules/ui/input/components/ImageInput.tsx @@ -90,6 +90,7 @@ type ImageInputProps = Omit, 'children'> & { isUploading?: boolean; errorMessage?: string | null; disabled?: boolean; + className?: string; }; export const ImageInput = ({ @@ -100,6 +101,7 @@ export const ImageInput = ({ isUploading = false, errorMessage, disabled = false, + className, }: ImageInputProps) => { const theme = useTheme(); const hiddenFileInput = React.useRef(null); @@ -108,7 +110,7 @@ export const ImageInput = ({ }; return ( - + { const handleChange = (event: React.ChangeEvent) => { onChange?.(event); @@ -125,7 +126,7 @@ export const Radio = ({ }; return ( - + void; placeholder?: string; value?: string; + className?: string; }; const StyledTextArea = styled(TextareaAutosize)` @@ -51,6 +52,7 @@ export const TextArea = ({ placeholder, minRows = 1, value = '', + className, onChange, }: TextAreaProps) => { const computedMinRows = Math.min(minRows, MAX_ROWS); @@ -78,6 +80,7 @@ export const TextArea = ({ onFocus={handleFocus} onBlur={handleBlur} disabled={disabled} + className={className} /> ); }; diff --git a/front/src/modules/ui/input/components/Toggle.tsx b/front/src/modules/ui/input/components/Toggle.tsx index 649ac84e6..894222a90 100644 --- a/front/src/modules/ui/input/components/Toggle.tsx +++ b/front/src/modules/ui/input/components/Toggle.tsx @@ -36,6 +36,7 @@ export type ToggleProps = { onChange?: (value: boolean) => void; color?: string; toggleSize?: ToggleSize; + className?: string; }; export const Toggle = ({ @@ -43,6 +44,7 @@ export const Toggle = ({ onChange, color, toggleSize = 'medium', + className, }: ToggleProps) => { const [isOn, setIsOn] = useState(value ?? false); @@ -72,6 +74,7 @@ export const Toggle = ({ isOn={isOn} color={color} toggleSize={toggleSize} + className={className} >