diff --git a/src/components/Checkbox.tsx b/src/components/Checkbox.tsx index 56ac931..2de29ad 100644 --- a/src/components/Checkbox.tsx +++ b/src/components/Checkbox.tsx @@ -1,3 +1,4 @@ +import clsx from 'clsx'; import { MutableRefObject, useState } from 'react'; import Toggle from 'react-toggle'; @@ -7,10 +8,10 @@ interface SelectorProps { labelComponent?: JSX.Element; disabled?: boolean; innerRef?: MutableRefObject; - placeholder?: string; fieldClass?: string; isChecked?: boolean; onChangeCallback?: (value, { target }) => void; + dir?: 'ltr' | 'rtl'; } export default function Checkbox({ @@ -20,9 +21,9 @@ export default function Checkbox({ disabled = false, innerRef = null, fieldClass = '', - placeholder = 'Type something...', isChecked, onChangeCallback, + dir = 'ltr', }: Readonly): JSX.Element { const [checkboxValue, setCheckboxValue] = useState(isChecked); @@ -34,7 +35,7 @@ export default function Checkbox({ } return ( -
+
{label && (
); } diff --git a/src/styles/globals.scss b/src/styles/globals.scss index d305a93..afd66bc 100644 --- a/src/styles/globals.scss +++ b/src/styles/globals.scss @@ -161,6 +161,14 @@ input::placeholder { display: flex; align-items: center; gap: 5px; + + &.ltr { + flex-direction: row; + } + + &.rtl { + flex-direction: row-reverse; + } } select:not(.nostyle) {