-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #632 from ar-io/develop
Release reassign name
- Loading branch information
Showing
16 changed files
with
996 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import * as RadixRadioGroup from '@radix-ui/react-radio-group'; | ||
import { ReactNode } from 'react'; | ||
|
||
function RadioGroup({ | ||
items, | ||
className, | ||
defaultValue = '', | ||
groupLabel, | ||
indicatorClass, | ||
onChange, | ||
value, | ||
}: { | ||
items?: { label?: ReactNode; value?: any; className?: string }[]; | ||
className?: string; | ||
defaultValue?: any; | ||
groupLabel?: string; | ||
indicatorClass?: string; | ||
onChange?: (val: any) => void; | ||
value?: any; | ||
}) { | ||
function handleValueChange(v: any) { | ||
onChange?.(v); | ||
} | ||
return ( | ||
<form> | ||
<RadixRadioGroup.Root | ||
onValueChange={handleValueChange} | ||
value={value} | ||
className={className} | ||
defaultValue={defaultValue} | ||
aria-label={groupLabel} | ||
> | ||
{items?.map((item, index) => { | ||
return ( | ||
<div key={index} className={'flex items-center'}> | ||
<RadixRadioGroup.Item | ||
className={item.className} | ||
value={item.value} | ||
id={'r' + index} | ||
> | ||
<RadixRadioGroup.Indicator className={indicatorClass} /> | ||
</RadixRadioGroup.Item> | ||
|
||
{item.label} | ||
</div> | ||
); | ||
})} | ||
</RadixRadioGroup.Root> | ||
</form> | ||
); | ||
} | ||
|
||
export default RadioGroup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.