New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@radix-ui/react-switch

Package Overview
Dependencies
Maintainers
5
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-switch - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

2

dist/index.js

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

var e,r,t,a=require("@radix-ui/react-label").useLabelContext,i=require("@radix-ui/react-primitive").Primitive,d=require("@radix-ui/react-use-controllable-state").useControllableState,c=require("@radix-ui/react-context").createContext,l=require("@radix-ui/react-compose-refs").useComposedRefs,n=require("@radix-ui/primitive").composeEventHandlers,u=(e={},r=require("react"),Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})})),e),o=(t=require("@babel/runtime/helpers/extends"))&&t.__esModule?t.default:t;const s="button",[h,b]=c("Switch"),m=u.forwardRef(((e,r)=>{const{as:t=s,"aria-labelledby":c,name:b,checked:m,defaultChecked:f,required:p,disabled:x,readOnly:v,value:q="on",onCheckedChange:y,...C}=e,w=u.useRef(null),E=u.useRef(null),S=l(r,E),R=a(E),g=c||R,[O=!1,P]=d({prop:m,defaultProp:f});return u.createElement(u.Fragment,null,u.createElement("input",{ref:w,type:"checkbox",name:b,checked:O,required:p,disabled:x,readOnly:v,value:q,hidden:!0,onChange:n(y,(e=>{P(e.target.checked)}))}),u.createElement(h,{checked:O,disabled:x},u.createElement(i,o({type:"button",role:"switch","aria-checked":O,"aria-labelledby":g,"aria-required":p,"data-state":k(O),"data-disabled":x?"":void 0,"data-readonly":v,disabled:x,value:q},C,{as:t,ref:S,onClick:n(e.onClick,(()=>{var e;return null===(e=w.current)||void 0===e?void 0:e.click()}),{checkForDefaultPrevented:!1})}))))}));exports.Switch=m,m.displayName="Switch";const f="span",p=u.forwardRef(((e,r)=>{const{as:t=f,...a}=e,d=b("SwitchThumb");return u.createElement(i,o({"data-state":k(d.checked),"data-disabled":d.disabled?"":void 0},a,{as:t,ref:r}))}));function k(e){return e?"checked":"unchecked"}exports.SwitchThumb=p,p.displayName="SwitchThumb";const x=m;exports.Root=x;const v=p;exports.Thumb=v;
var e,r,t,a=require("@radix-ui/react-label").useLabelContext,d=require("@radix-ui/react-primitive").Primitive,i=require("@radix-ui/react-use-controllable-state").useControllableState,c=require("@radix-ui/react-context").createContext,n=require("@radix-ui/react-compose-refs").useComposedRefs,l=require("@radix-ui/primitive").composeEventHandlers,u=(e={},r=require("react"),Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})})),e),o=(t=require("@babel/runtime/helpers/extends"))&&t.__esModule?t.default:t;const s="button",[b,h]=c("Switch"),f=/*#__PURE__*/u.forwardRef(((e,r)=>{const{as:t=s,"aria-labelledby":c,name:h,checked:f,defaultChecked:m,required:p,disabled:x,readOnly:v,value:q="on",onCheckedChange:C,...y}=e,w=u.useRef(null),E=u.useRef(null),R=n(r,E),g=a(E),S=c||g,[O=!1,P]=i({prop:f,defaultProp:m});/*#__PURE__*/return u.createElement(u.Fragment,null,/*#__PURE__*/u.createElement("input",{ref:w,type:"checkbox",name:h,checked:O,required:p,disabled:x,readOnly:v,value:q,hidden:!0,onChange:l(C,(e=>{P(e.target.checked)}))}),/*#__PURE__*/u.createElement(b,{checked:O,disabled:x},/*#__PURE__*/u.createElement(d,o({type:"button",role:"switch","aria-checked":O,"aria-labelledby":S,"aria-required":p,"data-state":k(O),"data-disabled":x?"":void 0,"data-readonly":v,disabled:x,value:q},y,{as:t,ref:R,onClick:l(e.onClick,(()=>{var e;return null===(e=w.current)||void 0===e?void 0:e.click()}),{checkForDefaultPrevented:!1})}))))}));exports.Switch=f;const m="span",p=/*#__PURE__*/u.forwardRef(((e,r)=>{const{as:t=m,...a}=e,i=h("SwitchThumb");/*#__PURE__*/return u.createElement(d,o({"data-state":k(i.checked),"data-disabled":i.disabled?"":void 0},a,{as:t,ref:r}))}));function k(e){return e?"checked":"unchecked"}exports.SwitchThumb=p;const x=f;exports.Root=x;const v=p;exports.Thumb=v;
//# sourceMappingURL=index.js.map

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

import{useLabelContext as e}from"@radix-ui/react-label";import{Primitive as t}from"@radix-ui/react-primitive";import{useControllableState as r}from"@radix-ui/react-use-controllable-state";import{createContext as a}from"@radix-ui/react-context";import{useComposedRefs as i}from"@radix-ui/react-compose-refs";import{composeEventHandlers as c}from"@radix-ui/primitive";import*as d from"react";import o from"@babel/runtime/helpers/esm/extends";const l="button",[n,u]=a("Switch");export const Switch=d.forwardRef(((a,u)=>{const{as:m=l,"aria-labelledby":h,name:p,checked:b,defaultChecked:f,required:k,disabled:w,readOnly:x,value:v="on",onCheckedChange:S,...y}=a,C=d.useRef(null),T=d.useRef(null),E=i(u,T),R=e(T),g=h||R,[q=!1,F]=r({prop:b,defaultProp:f});return d.createElement(d.Fragment,null,d.createElement("input",{ref:C,type:"checkbox",name:p,checked:q,required:k,disabled:w,readOnly:x,value:v,hidden:!0,onChange:c(S,(e=>{F(e.target.checked)}))}),d.createElement(n,{checked:q,disabled:w},d.createElement(t,o({type:"button",role:"switch","aria-checked":q,"aria-labelledby":g,"aria-required":k,"data-state":s(q),"data-disabled":w?"":void 0,"data-readonly":x,disabled:w,value:v},y,{as:m,ref:E,onClick:c(a.onClick,(()=>{var e;return null===(e=C.current)||void 0===e?void 0:e.click()}),{checkForDefaultPrevented:!1})}))))}));Switch.displayName="Switch";const m="span";export const SwitchThumb=d.forwardRef(((e,r)=>{const{as:a=m,...i}=e,c=u("SwitchThumb");return d.createElement(t,o({"data-state":s(c.checked),"data-disabled":c.disabled?"":void 0},i,{as:a,ref:r}))}));function s(e){return e?"checked":"unchecked"}SwitchThumb.displayName="SwitchThumb";export const Root=Switch;export const Thumb=SwitchThumb;
import{useLabelContext as e}from"@radix-ui/react-label";import{Primitive as t}from"@radix-ui/react-primitive";import{useControllableState as r}from"@radix-ui/react-use-controllable-state";import{createContext as a}from"@radix-ui/react-context";import{useComposedRefs as i}from"@radix-ui/react-compose-refs";import{composeEventHandlers as c}from"@radix-ui/primitive";import*as d from"react";import o from"@babel/runtime/helpers/esm/extends";const n="button",[l,u]=a("Switch");export const Switch=/*#__PURE__*/d.forwardRef(((a,u)=>{const{as:m=n,"aria-labelledby":h,name:p,checked:b,defaultChecked:f,required:k,disabled:x,readOnly:v,value:w="on",onCheckedChange:y,...C}=a,S=d.useRef(null),E=d.useRef(null),R=i(u,E),g=e(E),T=h||g,[q=!1,F]=r({prop:b,defaultProp:f});/*#__PURE__*/return d.createElement(d.Fragment,null,/*#__PURE__*/d.createElement("input",{ref:S,type:"checkbox",name:p,checked:q,required:k,disabled:x,readOnly:v,value:w,hidden:!0,onChange:c(y,(e=>{F(e.target.checked)}))}),/*#__PURE__*/d.createElement(l,{checked:q,disabled:x},/*#__PURE__*/d.createElement(t,o({type:"button",role:"switch","aria-checked":q,"aria-labelledby":T,"aria-required":k,"data-state":s(q),"data-disabled":x?"":void 0,"data-readonly":v,disabled:x,value:w},C,{as:m,ref:R,onClick:c(a.onClick,(()=>{var e;return null===(e=S.current)||void 0===e?void 0:e.click()}),{checkForDefaultPrevented:!1})}))))}));/*#__PURE__*/const m="span";export const SwitchThumb=/*#__PURE__*/d.forwardRef(((e,r)=>{const{as:a=m,...i}=e,c=u("SwitchThumb");/*#__PURE__*/return d.createElement(t,o({"data-state":s(c.checked),"data-disabled":c.disabled?"":void 0},i,{as:a,ref:r}))}));/*#__PURE__*/function s(e){return e?"checked":"unchecked"}export const Root=Switch;export const Thumb=SwitchThumb;
//# sourceMappingURL=index.module.js.map
{
"name": "@radix-ui/react-switch",
"version": "0.0.10",
"version": "0.0.11",
"license": "MIT",

@@ -21,9 +21,9 @@ "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-primitive": "0.0.10",
"@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-primitive": "0.0.11",
"@radix-ui/react-use-controllable-state": "0.0.6"
},

@@ -30,0 +30,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