@accelint/design-toolkit
Version:
An open-source component library to serve as part of the entire ecosystem of UX for Accelint.
4 lines (3 loc) • 809 B
JavaScript
'use client';
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import'client-only';import {useContextProps,RadioGroup,composeRenderProps}from'react-aria-components';import {Label}from'../label/index.js';import {RadioContext}from'./context.js';import {RadioStyles}from'./styles.js';const{group:G,groupLabel:f}=RadioStyles();function C({ref:o,...r}){[r,o]=useContextProps(r,o??null,RadioContext);const{children:t,classNames:e,label:i,...l}=r;return jsx(RadioGroup,{...l,ref:o,className:composeRenderProps(e?.group,a=>G({className:a})),children:composeRenderProps(t,(a,{isDisabled:m,isRequired:u})=>jsxs(Fragment,{children:[i&&jsx(Label,{className:f({className:e?.label}),isDisabled:m,isRequired:u,children:i}),a]}))})}export{C as RadioGroup};//# sourceMappingURL=group.js.map
//# sourceMappingURL=group.js.map