refactor: migrate modal components

This commit is contained in:
Carlos Valente
2025-07-04 10:34:30 +02:00
committed by Carlos Valente
parent 36223ff49f
commit a8ea1080f3
13 changed files with 288 additions and 307 deletions
@@ -33,6 +33,10 @@
opacity: 0.4;
cursor: not-allowed;
}
&.fluid {
width: 100%;
}
}
.selectIcon {
@@ -2,6 +2,8 @@ import { IoCheckmark } from 'react-icons/io5';
import { LuChevronsUpDown } from 'react-icons/lu';
import { Select as BaseSelect } from '@base-ui-components/react/select';
import { cx } from '../../utils/styleUtils';
import styles from './Select.module.scss';
interface SelectProps<T> extends Omit<BaseSelect.Root.Props<T>, 'items'> {
@@ -10,12 +12,13 @@ interface SelectProps<T> extends Omit<BaseSelect.Root.Props<T>, 'items'> {
value: T;
label: string;
}[];
fluid?: boolean;
}
export default function Select<T>({ options, ...selectRootProps }: SelectProps<T>) {
export default function Select<T>({ options, fluid, ...selectRootProps }: SelectProps<T>) {
return (
<BaseSelect.Root items={options} {...selectRootProps}>
<BaseSelect.Trigger className={styles.select}>
<BaseSelect.Trigger className={cx([styles.select, fluid && styles.fluid])}>
<BaseSelect.Value />
<BaseSelect.Icon className={styles.selectIcon}>
<LuChevronsUpDown />