Skip to content

Commit ccddc51

Browse files
committed
feat(radio): ✨ extend RadioProps with BoxProps,
pass style through styleAdapter for customisation
1 parent 8becf18 commit ccddc51

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/components/radio/RadioGroup.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import React, { forwardRef, useState } from "react";
22
import { Platform } from "react-native";
33
import { getFocusableTreeWalker } from "@react-aria/focus";
4+
import { styleAdapter } from "lib/typescript";
45

5-
import { Box } from "../../primitives";
6+
import { Box, BoxProps } from "../../primitives";
67
import { useTheme } from "../../theme";
78
import {
89
createComponent,
@@ -32,7 +33,7 @@ const [RadioGroupProvider, useRadioGroupContext] =
3233

3334
export { useRadioGroupContext };
3435

35-
export interface RadioGroupProps {
36+
export interface RadioGroupProps extends BoxProps {
3637
/**
3738
* Radio Sizes
3839
* @default md
@@ -79,6 +80,7 @@ const RNRadioGroup: React.FC<Partial<RadioGroupProps>> = forwardRef<
7980
isDisabled = false,
8081
onChange,
8182
children,
83+
style,
8284
} = props;
8385

8486
const radioGroupProps = {
@@ -152,7 +154,10 @@ const RNRadioGroup: React.FC<Partial<RadioGroupProps>> = forwardRef<
152154
const validChildren = getValidChildren(children);
153155
return (
154156
<Box
155-
style={tailwind.style(cx(radioGroupTheme.group[orientation]?.common))}
157+
style={[
158+
tailwind.style(cx(radioGroupTheme.group[orientation]?.common)),
159+
styleAdapter(style),
160+
]}
156161
ref={ref}
157162
// Web Related Props
158163
accessibilityRole="radiogroup"

0 commit comments

Comments
 (0)