@nayan-ui/react-native
Version:
React Native Component Library for smooth and faster mobile application development.
29 lines (28 loc) • 1.22 kB
JavaScript
import * as React from 'react';
import { Platform } from 'react-native';
import * as CheckboxPrimitive from '@rn-primitives/checkbox';
import { Check } from "../../lib/icons/Check.js";
import { cn } from "../../lib/utils.js";
import { jsx as _jsx } from "react-native-css-interop/jsx-runtime";
const Checkbox = /*#__PURE__*/React.forwardRef(({
className,
...props
}, ref) => {
return _jsx(CheckboxPrimitive.Root, {
ref: ref,
className: cn('web:peer h-4 w-4 native:h-[20] native:w-[20] shrink-0 rounded-sm native:rounded border border-primary web:ring-offset-background web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', props.checked && 'bg-primary', className),
...props,
children: _jsx(CheckboxPrimitive.Indicator, {
className: cn('items-center justify-center h-full w-full'),
children: _jsx(Check, {
size: 12,
strokeWidth: Platform.OS === 'web' ? 2.5 : 3.5,
className: "text-white"
})
})
});
});
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
export { Checkbox };
//# sourceMappingURL=checkbox.js.map
;