Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@radix-ui/react-radio-group

Package Overview
Dependencies
Maintainers
5
Versions
210
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-radio-group - npm Package Compare versions

Comparing version 0.0.12 to 0.0.13

2

dist/index.js

@@ -1,2 +0,2 @@

function e(e,r,a){Object.defineProperty(e,r,{get:a,enumerable:!0})}var r,a=require("@radix-ui/react-roving-focus"),o=a.RovingFocusGroup,n=a.useRovingFocus,t=require("@radix-ui/react-label").useLabelContext,i=require("@radix-ui/react-presence").Presence,u=require("@radix-ui/react-primitive"),d=u.Primitive,c=u.extendPrimitive,l=require("@radix-ui/react-use-controllable-state").useControllableState,s=require("@radix-ui/react-use-callback-ref").useCallbackRef,p=require("@radix-ui/react-context").createContext,v=require("@radix-ui/react-compose-refs").useComposedRefs,f=require("@radix-ui/primitive").composeEventHandlers,b=require("react"),m=b.forwardRef,R=b.createElement,h=b.useCallback,k=b.useRef,x=b.Fragment,C=(r=require("@babel/runtime/helpers/extends"))&&r.__esModule?r.default:r,g={};const y="button",[q,I]=p("Radio"),G=m(((e,r)=>{const{as:a=y,"aria-labelledby":o,name:n,checked:i,defaultChecked:u,required:c,disabled:s,readOnly:p,value:b="on",onCheckedChange:m,...h}=e,g=k(null),I=k(null),G=v(r,I),F=t(I),w=o||F,[P=!1,M]=l({prop:i,defaultProp:u});return R(x,null,R("input",{ref:g,type:"radio",name:n,checked:P,required:c,disabled:s,readOnly:p,value:b,hidden:!0,onChange:f(m,(e=>{M(e.target.checked)}))}),R(q,{checked:P,disabled:s},R(d,C({type:"button",role:"radio","aria-checked":P,"aria-labelledby":w,"data-state":D(P),"data-readonly":p,"data-disabled":s?"":void 0,disabled:s,value:b},h,{as:a,ref:G,onClick:f(e.onClick,(()=>{var e;return null===(e=g.current)||void 0===e?void 0:e.click()}),{checkForDefaultPrevented:!1})}))))}));G.displayName="Radio";const F="span",w=m(((e,r)=>{const{as:a=F,forceMount:o,...n}=e,t=I("RadioIndicator");return R(i,{present:o||t.checked},R(d,C({"data-state":D(t.checked),"data-disabled":t.disabled?"":void 0},n,{as:a,ref:r})))}));function D(e){return e?"checked":"unchecked"}w.displayName="RadioIndicator";const[P,M]=p("RadioGroup"),N=m(((e,r)=>{const{name:a,"aria-labelledby":n,defaultValue:i,value:u,required:c,rovingFocus:p=!0,onValueChange:v,...b}=e,m=t(),k=n||m,x=s(v),[g,y]=l({prop:u,defaultProp:i}),q=R(d,C({},b,{ref:r,role:"radiogroup","aria-labelledby":k}));return R(P,{name:a,value:g,required:c,rovingFocus:p,onValueChange:h(f(x,(e=>y(e.target.value))),[x])},p?R(o,{loop:!0},q):q)}));exports.RadioGroup=N,N.displayName="RadioGroup";const V=m(((e,r)=>M("RadioGroupItem").rovingFocus?R(K,C({},e,{ref:r})):R(O,C({},e,{ref:r}))));exports.RadioGroupItem=V,V.displayName="RadioGroupItem";const K=m(((e,r)=>{const{disabled:a,...o}=e,t=M("RadioGroupItem"),i=k(null),u=v(r,i),d=t.value===o.value,c=n({disabled:a,active:d});return R(O,C({disabled:a},o,c,{ref:u,onKeyDown:f(o.onKeyDown,c.onKeyDown),onMouseDown:f(o.onMouseDown,c.onMouseDown),onFocus:f(o.onFocus,f(c.onFocus,(()=>{var e;void 0!==t.value&&(null===(e=i.current)||void 0===e||e.click())})))}))})),O=m(((e,r)=>{const a=M("RadioGroupItem"),o=a.value===e.value;return R(G,C({required:a.required,checked:o,name:a.name},e,{ref:r,onCheckedChange:f(e.onCheckedChange,a.onValueChange)}))})),E=c(w,{displayName:"RadioGroupIndicator"});exports.RadioGroupIndicator=E;const _=N;exports.Root=_;const j=V;exports.Item=j;const H=E;exports.Indicator=H,e(g,"Indicator",(function(){return H})),e(g,"Item",(function(){return j})),e(g,"Root",(function(){return _})),e(g,"RadioGroupIndicator",(function(){return E})),e(g,"RadioGroupItem",(function(){return V})),e(g,"RadioGroup",(function(){return N}));
var e,r,a,o=require("@radix-ui/react-roving-focus"),t=o.RovingFocusGroup,n=o.useRovingFocus,d=require("@radix-ui/react-label").useLabelContext,i=require("@radix-ui/react-presence").Presence,u=require("@radix-ui/react-primitive"),l=u.Primitive,c=u.extendPrimitive,s=require("@radix-ui/react-use-controllable-state").useControllableState,p=require("@radix-ui/react-use-callback-ref").useCallbackRef,f=require("@radix-ui/react-context").createContext,m=require("@radix-ui/react-compose-refs").useComposedRefs,v=require("@radix-ui/primitive").composeEventHandlers,b=(e={},r=require("react"),Object.keys(r).forEach((function(a){"default"!==a&&"__esModule"!==a&&Object.defineProperty(e,a,{enumerable:!0,get:function(){return r[a]}})})),e),R=(a=require("@babel/runtime/helpers/extends"))&&a.__esModule?a.default:a;const h="button",[k,x]=f("Radio"),y=b.forwardRef(((e,r)=>{const{as:a=h,"aria-labelledby":o,name:t,checked:n,defaultChecked:i,required:u,disabled:c,readOnly:p,value:f="on",onCheckedChange:x,...y}=e,C=b.useRef(null),g=b.useRef(null),E=m(r,g),w=d(g),G=o||w,[I=!1,F]=s({prop:n,defaultProp:i});return b.createElement(b.Fragment,null,b.createElement("input",{ref:C,type:"radio",name:t,checked:I,required:u,disabled:c,readOnly:p,value:f,hidden:!0,onChange:v(x,(e=>{F(e.target.checked)}))}),b.createElement(k,{checked:I,disabled:c},b.createElement(l,R({type:"button",role:"radio","aria-checked":I,"aria-labelledby":G,"data-state":q(I),"data-readonly":p,"data-disabled":c?"":void 0,disabled:c,value:f},y,{as:a,ref:E,onClick:v(e.onClick,(()=>{var e;return null===(e=C.current)||void 0===e?void 0:e.click()}),{checkForDefaultPrevented:!1})}))))}));y.displayName="Radio";const C="span",g=b.forwardRef(((e,r)=>{const{as:a=C,forceMount:o,...t}=e,n=x("RadioIndicator");return b.createElement(i,{present:o||n.checked},b.createElement(l,R({"data-state":q(n.checked),"data-disabled":n.disabled?"":void 0},t,{as:a,ref:r})))}));function q(e){return e?"checked":"unchecked"}g.displayName="RadioIndicator";const[E,w]=f("RadioGroup"),G=b.forwardRef(((e,r)=>{const{name:a,"aria-labelledby":o,defaultValue:n,value:i,required:u,rovingFocus:c=!0,onValueChange:f,...m}=e,h=d(),k=o||h,x=p(f),[y,C]=s({prop:i,defaultProp:n}),g=b.createElement(l,R({},m,{ref:r,role:"radiogroup","aria-labelledby":k}));return b.createElement(E,{name:a,value:y,required:u,rovingFocus:c,onValueChange:b.useCallback(v(x,(e=>C(e.target.value))),[x])},c?b.createElement(t,{loop:!0},g):g)}));exports.RadioGroup=G,G.displayName="RadioGroup";const I=b.forwardRef(((e,r)=>w("RadioGroupItem").rovingFocus?b.createElement(F,R({},e,{ref:r})):b.createElement(D,R({},e,{ref:r}))));exports.RadioGroupItem=I,I.displayName="RadioGroupItem";const F=b.forwardRef(((e,r)=>{const{disabled:a,...o}=e,t=w("RadioGroupItem"),d=b.useRef(null),i=m(r,d),u=t.value===o.value,l=n({disabled:a,active:u});return b.createElement(D,R({disabled:a},o,l,{ref:i,onKeyDown:v(o.onKeyDown,l.onKeyDown),onMouseDown:v(o.onMouseDown,l.onMouseDown),onFocus:v(o.onFocus,v(l.onFocus,(()=>{var e;void 0!==t.value&&(null===(e=d.current)||void 0===e||e.click())})))}))})),D=b.forwardRef(((e,r)=>{const a=w("RadioGroupItem"),o=a.value===e.value;return b.createElement(y,R({required:a.required,checked:o,name:a.name},e,{ref:r,onCheckedChange:v(e.onCheckedChange,a.onValueChange)}))})),P=c(g,{displayName:"RadioGroupIndicator"});exports.RadioGroupIndicator=P;const M=G;exports.Root=M;const N=I;exports.Item=N;const O=P;exports.Indicator=O;
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

function e(e,o,r){Object.defineProperty(e,o,{get:r,enumerable:!0})}import{RovingFocusGroup as o,useRovingFocus as r}from"@radix-ui/react-roving-focus";import{useLabelContext as a}from"@radix-ui/react-label";import{Presence as t}from"@radix-ui/react-presence";import{Primitive as i,extendPrimitive as n}from"@radix-ui/react-primitive";import{useControllableState as d}from"@radix-ui/react-use-controllable-state";import{useCallbackRef as u}from"@radix-ui/react-use-callback-ref";import{createContext as c}from"@radix-ui/react-context";import{useComposedRefs as l}from"@radix-ui/react-compose-refs";import{composeEventHandlers as p}from"@radix-ui/primitive";import{forwardRef as s,createElement as m,useCallback as f,useRef as v,Fragment as R}from"react";import b from"@babel/runtime/helpers/esm/extends";var h={};const I="button",[G,k]=c("Radio"),y=s(((e,o)=>{const{as:r=I,"aria-labelledby":t,name:n,checked:u,defaultChecked:c,required:s,disabled:f,readOnly:h,value:k="on",onCheckedChange:y,...x}=e,g=v(null),D=v(null),F=l(o,D),q=a(D),w=t||q,[N=!1,M]=d({prop:u,defaultProp:c});return m(R,null,m("input",{ref:g,type:"radio",name:n,checked:N,required:s,disabled:f,readOnly:h,value:k,hidden:!0,onChange:p(y,(e=>{M(e.target.checked)}))}),m(G,{checked:N,disabled:f},m(i,b({type:"button",role:"radio","aria-checked":N,"aria-labelledby":w,"data-state":C(N),"data-readonly":h,"data-disabled":f?"":void 0,disabled:f,value:k},x,{as:r,ref:F,onClick:p(e.onClick,(()=>{var e;return null===(e=g.current)||void 0===e?void 0:e.click()}),{checkForDefaultPrevented:!1})}))))}));y.displayName="Radio";const x="span",g=s(((e,o)=>{const{as:r=x,forceMount:a,...n}=e,d=k("RadioIndicator");return m(t,{present:a||d.checked},m(i,b({"data-state":C(d.checked),"data-disabled":d.disabled?"":void 0},n,{as:r,ref:o})))}));function C(e){return e?"checked":"unchecked"}g.displayName="RadioIndicator";const[D,F]=c("RadioGroup");export const RadioGroup=s(((e,r)=>{const{name:t,"aria-labelledby":n,defaultValue:c,value:l,required:s,rovingFocus:v=!0,onValueChange:R,...h}=e,I=a(),G=n||I,k=u(R),[y,x]=d({prop:l,defaultProp:c}),g=m(i,b({},h,{ref:r,role:"radiogroup","aria-labelledby":G}));return m(D,{name:t,value:y,required:s,rovingFocus:v,onValueChange:f(p(k,(e=>x(e.target.value))),[k])},v?m(o,{loop:!0},g):g)}));RadioGroup.displayName="RadioGroup";export const RadioGroupItem=s(((e,o)=>F("RadioGroupItem").rovingFocus?m(q,b({},e,{ref:o})):m(w,b({},e,{ref:o}))));RadioGroupItem.displayName="RadioGroupItem";const q=s(((e,o)=>{const{disabled:a,...t}=e,i=F("RadioGroupItem"),n=v(null),d=l(o,n),u=i.value===t.value,c=r({disabled:a,active:u});return m(w,b({disabled:a},t,c,{ref:d,onKeyDown:p(t.onKeyDown,c.onKeyDown),onMouseDown:p(t.onMouseDown,c.onMouseDown),onFocus:p(t.onFocus,p(c.onFocus,(()=>{var e;void 0!==i.value&&(null===(e=n.current)||void 0===e||e.click())})))}))})),w=s(((e,o)=>{const r=F("RadioGroupItem"),a=r.value===e.value;return m(y,b({required:r.required,checked:a,name:r.name},e,{ref:o,onCheckedChange:p(e.onCheckedChange,r.onValueChange)}))}));export const RadioGroupIndicator=n(g,{displayName:"RadioGroupIndicator"});export const Root=RadioGroup;export const Item=RadioGroupItem;export const Indicator=RadioGroupIndicator;e(h,"Indicator",(function(){return Indicator})),e(h,"Item",(function(){return Item})),e(h,"Root",(function(){return Root})),e(h,"RadioGroupIndicator",(function(){return RadioGroupIndicator})),e(h,"RadioGroupItem",(function(){return RadioGroupItem})),e(h,"RadioGroup",(function(){return RadioGroup}));
import{RovingFocusGroup as e,useRovingFocus as r}from"@radix-ui/react-roving-focus";import{useLabelContext as a}from"@radix-ui/react-label";import{Presence as o}from"@radix-ui/react-presence";import{Primitive as t,extendPrimitive as d}from"@radix-ui/react-primitive";import{useControllableState as n}from"@radix-ui/react-use-controllable-state";import{useCallbackRef as i}from"@radix-ui/react-use-callback-ref";import{createContext as c}from"@radix-ui/react-context";import{useComposedRefs as l}from"@radix-ui/react-compose-refs";import{composeEventHandlers as u}from"@radix-ui/primitive";import*as s from"react";import m from"@babel/runtime/helpers/esm/extends";const p="button",[f,R]=c("Radio"),v=s.forwardRef(((e,r)=>{const{as:o=p,"aria-labelledby":d,name:i,checked:c,defaultChecked:R,required:v,disabled:b,readOnly:h,value:x="on",onCheckedChange:y,...g}=e,G=s.useRef(null),C=s.useRef(null),I=l(r,C),E=a(C),w=d||E,[F=!1,D]=n({prop:c,defaultProp:R});return s.createElement(s.Fragment,null,s.createElement("input",{ref:G,type:"radio",name:i,checked:F,required:v,disabled:b,readOnly:h,value:x,hidden:!0,onChange:u(y,(e=>{D(e.target.checked)}))}),s.createElement(f,{checked:F,disabled:b},s.createElement(t,m({type:"button",role:"radio","aria-checked":F,"aria-labelledby":w,"data-state":k(F),"data-readonly":h,"data-disabled":b?"":void 0,disabled:b,value:x},g,{as:o,ref:I,onClick:u(e.onClick,(()=>{var e;return null===(e=G.current)||void 0===e?void 0:e.click()}),{checkForDefaultPrevented:!1})}))))}));v.displayName="Radio";const b="span",h=s.forwardRef(((e,r)=>{const{as:a=b,forceMount:d,...n}=e,i=R("RadioIndicator");return s.createElement(o,{present:d||i.checked},s.createElement(t,m({"data-state":k(i.checked),"data-disabled":i.disabled?"":void 0},n,{as:a,ref:r})))}));function k(e){return e?"checked":"unchecked"}h.displayName="RadioIndicator";const[x,y]=c("RadioGroup");export const RadioGroup=s.forwardRef(((r,o)=>{const{name:d,"aria-labelledby":c,defaultValue:l,value:p,required:f,rovingFocus:R=!0,onValueChange:v,...b}=r,h=a(),k=c||h,y=i(v),[g,G]=n({prop:p,defaultProp:l}),C=s.createElement(t,m({},b,{ref:o,role:"radiogroup","aria-labelledby":k}));return s.createElement(x,{name:d,value:g,required:f,rovingFocus:R,onValueChange:s.useCallback(u(y,(e=>G(e.target.value))),[y])},R?s.createElement(e,{loop:!0},C):C)}));RadioGroup.displayName="RadioGroup";export const RadioGroupItem=s.forwardRef(((e,r)=>y("RadioGroupItem").rovingFocus?s.createElement(g,m({},e,{ref:r})):s.createElement(G,m({},e,{ref:r}))));RadioGroupItem.displayName="RadioGroupItem";const g=s.forwardRef(((e,a)=>{const{disabled:o,...t}=e,d=y("RadioGroupItem"),n=s.useRef(null),i=l(a,n),c=d.value===t.value,p=r({disabled:o,active:c});return s.createElement(G,m({disabled:o},t,p,{ref:i,onKeyDown:u(t.onKeyDown,p.onKeyDown),onMouseDown:u(t.onMouseDown,p.onMouseDown),onFocus:u(t.onFocus,u(p.onFocus,(()=>{var e;void 0!==d.value&&(null===(e=n.current)||void 0===e||e.click())})))}))})),G=s.forwardRef(((e,r)=>{const a=y("RadioGroupItem"),o=a.value===e.value;return s.createElement(v,m({required:a.required,checked:o,name:a.name},e,{ref:r,onCheckedChange:u(e.onCheckedChange,a.onValueChange)}))}));export const RadioGroupIndicator=d(h,{displayName:"RadioGroupIndicator"});export const Root=RadioGroup;export const Item=RadioGroupItem;export const Indicator=RadioGroupIndicator;
//# sourceMappingURL=index.module.js.map
{
"name": "@radix-ui/react-radio-group",
"version": "0.0.12",
"version": "0.0.13",
"license": "MIT",

@@ -21,12 +21,12 @@ "source": "src/index.ts",

"@babel/runtime": "^7.13.10",
"@radix-ui/primitive": "0.0.3",
"@radix-ui/react-compose-refs": "0.0.3",
"@radix-ui/react-context": "0.0.3",
"@radix-ui/react-label": "0.0.9",
"@radix-ui/react-polymorphic": "0.0.8",
"@radix-ui/react-presence": "0.0.11",
"@radix-ui/react-primitive": "0.0.9",
"@radix-ui/react-roving-focus": "0.0.9",
"@radix-ui/react-use-callback-ref": "0.0.3",
"@radix-ui/react-use-controllable-state": "0.0.4"
"@radix-ui/primitive": "0.0.4",
"@radix-ui/react-compose-refs": "0.0.4",
"@radix-ui/react-context": "0.0.4",
"@radix-ui/react-label": "0.0.10",
"@radix-ui/react-polymorphic": "0.0.9",
"@radix-ui/react-presence": "0.0.12",
"@radix-ui/react-primitive": "0.0.10",
"@radix-ui/react-roving-focus": "0.0.10",
"@radix-ui/react-use-callback-ref": "0.0.4",
"@radix-ui/react-use-controllable-state": "0.0.5"
},

@@ -33,0 +33,0 @@ "peerDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc