@nayan-ui/react-native
Version:
React Native Component Library for smooth and faster mobile application development.
37 lines (36 loc) • 1.45 kB
JavaScript
import * as React from 'react';
import { View } from 'react-native';
import * as RadioGroupPrimitive from '@rn-primitives/radio-group';
import { cn } from "../../lib/utils.js";
import { jsx as _jsx } from "react-native-css-interop/jsx-runtime";
const RadioGroup = /*#__PURE__*/React.forwardRef(({
className,
...props
}, ref) => {
return _jsx(RadioGroupPrimitive.Root, {
className: cn('web:grid gap-2', className),
...props,
ref: ref
});
});
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
const RadioGroupItem = /*#__PURE__*/React.forwardRef(({
className,
...props
}, ref) => {
return _jsx(RadioGroupPrimitive.Item, {
ref: ref,
className: cn('aspect-square h-4 w-4 native:h-5 native:w-5 rounded-full justify-center items-center border border-primary text-primary web:ring-offset-background web:focus:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2', props.disabled && 'web:cursor-not-allowed opacity-50', className),
...props,
children: _jsx(RadioGroupPrimitive.Indicator, {
className: "flex items-center justify-center",
children: _jsx(View, {
className: "aspect-square h-[9px] w-[9px] native:h-[10] native:w-[10] bg-primary rounded-full"
})
})
});
});
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
export { RadioGroup, RadioGroupItem };
//# sourceMappingURL=radio-group.js.map
;