Socket
Socket
Sign inDemoInstall

@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.13 to 0.0.14

2

dist/index.js

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

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

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

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;
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 n}from"@radix-ui/react-primitive";import{useControllableState as d}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,v]=c("Radio"),b=/*#__PURE__*/s.forwardRef(((e,r)=>{const{as:o=p,"aria-labelledby":n,name:i,checked:c,defaultChecked:v,required:b,disabled:h,readOnly:R,value:x="on",onCheckedChange:g,...C}=e,y=s.useRef(null),E=s.useRef(null),w=l(r,E),G=a(E),I=n||G,[F=!1,D]=d({prop:c,defaultProp:v});/*#__PURE__*/return s.createElement(s.Fragment,null,/*#__PURE__*/s.createElement("input",{ref:y,type:"radio",name:i,checked:F,required:b,disabled:h,readOnly:R,value:x,hidden:!0,onChange:u(g,(e=>{D(e.target.checked)}))}),/*#__PURE__*/s.createElement(f,{checked:F,disabled:h},/*#__PURE__*/s.createElement(t,m({type:"button",role:"radio","aria-checked":F,"aria-labelledby":I,"data-state":k(F),"data-readonly":R,"data-disabled":h?"":void 0,disabled:h,value:x},C,{as:o,ref:w,onClick:u(e.onClick,(()=>{var e;return null===(e=y.current)||void 0===e?void 0:e.click()}),{checkForDefaultPrevented:!1})}))))})),h="span",R=/*#__PURE__*/s.forwardRef(((e,r)=>{const{as:a=h,forceMount:n,...d}=e,i=v("RadioIndicator");/*#__PURE__*/return s.createElement(o,{present:n||i.checked},/*#__PURE__*/s.createElement(t,m({"data-state":k(i.checked),"data-disabled":i.disabled?"":void 0},d,{as:a,ref:r})))}));function k(e){return e?"checked":"unchecked"}const[x,g]=c("RadioGroup");export const RadioGroup=/*#__PURE__*/s.forwardRef(((r,o)=>{const{name:n,"aria-labelledby":c,defaultValue:l,value:p,required:f,rovingFocus:v=!0,onValueChange:b,...h}=r,R=a(),k=c||R,g=i(b),[C,y]=d({prop:p,defaultProp:l}),E=/*#__PURE__*/s.createElement(t,m({},h,{ref:o,role:"radiogroup","aria-labelledby":k}));/*#__PURE__*/return s.createElement(x,{name:n,value:C,required:f,rovingFocus:v,onValueChange:s.useCallback(u(g,(e=>y(e.target.value))),[g])},v?/*#__PURE__*/s.createElement(e,{loop:!0},E):E)}));/*#__PURE__*/export const RadioGroupItem=/*#__PURE__*/s.forwardRef(((e,r)=>g("RadioGroupItem").rovingFocus?/*#__PURE__*/s.createElement(C,m({},e,{ref:r})):/*#__PURE__*/s.createElement(y,m({},e,{ref:r}))));/*#__PURE__*/const C=/*#__PURE__*/s.forwardRef(((e,a)=>{const{disabled:o,...t}=e,n=g("RadioGroupItem"),d=s.useRef(null),i=l(a,d),c=n.value===t.value,p=r({disabled:o,active:c});/*#__PURE__*/return s.createElement(y,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!==n.value&&(null===(e=d.current)||void 0===e||e.click())})))}))})),y=/*#__PURE__*/s.forwardRef(((e,r)=>{const a=g("RadioGroupItem"),o=a.value===e.value;/*#__PURE__*/return s.createElement(b,m({required:a.required,checked:o,name:a.name},e,{ref:r,onCheckedChange:u(e.onCheckedChange,a.onValueChange)}))}));export const RadioGroupIndicator=n(R,{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.13",
"version": "0.0.14",
"license": "MIT",

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

"@babel/runtime": "^7.13.10",
"@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"
"@radix-ui/primitive": "0.0.5",
"@radix-ui/react-compose-refs": "0.0.5",
"@radix-ui/react-context": "0.0.5",
"@radix-ui/react-label": "0.0.11",
"@radix-ui/react-polymorphic": "0.0.10",
"@radix-ui/react-presence": "0.0.13",
"@radix-ui/react-primitive": "0.0.11",
"@radix-ui/react-roving-focus": "0.0.11",
"@radix-ui/react-use-callback-ref": "0.0.5",
"@radix-ui/react-use-controllable-state": "0.0.6"
},

@@ -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