Socket
Book a DemoInstallSign in
Socket

@radix-ui/react-switch

Package Overview
Dependencies
Maintainers
6
Versions
236
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

to
1.0.1-rc.1

7

dist/index.js

@@ -10,3 +10,2 @@ var $cWV9h$babelruntimehelpersextends = require("@babel/runtime/helpers/extends");

var $cWV9h$radixuireactprimitive = require("@radix-ui/react-primitive");
var $cWV9h$radixuireactlabel = require("@radix-ui/react-label");

@@ -34,3 +33,2 @@ function $parcel$export(e, n, v, s) {

/* -------------------------------------------------------------------------------------------------

@@ -42,8 +40,6 @@ * Switch

const $4465bdeb0ef4ccd7$export$b5d5cf8927ab7262 = /*#__PURE__*/ $cWV9h$react.forwardRef((props, forwardedRef)=>{
const { __scopeSwitch: __scopeSwitch , 'aria-labelledby': ariaLabelledby , name: name , checked: checkedProp , defaultChecked: defaultChecked , required: required , disabled: disabled , value: value = 'on' , onCheckedChange: onCheckedChange , ...switchProps } = props;
const { __scopeSwitch: __scopeSwitch , name: name , checked: checkedProp , defaultChecked: defaultChecked , required: required , disabled: disabled , value: value = 'on' , onCheckedChange: onCheckedChange , ...switchProps } = props;
const [button, setButton] = $cWV9h$react.useState(null);
const composedRefs = $cWV9h$radixuireactcomposerefs.useComposedRefs(forwardedRef, (node)=>setButton(node)
);
const labelId = $cWV9h$radixuireactlabel.useLabelContext(button);
const labelledBy = ariaLabelledby || labelId;
const hasConsumerStoppedPropagationRef = $cWV9h$react.useRef(false); // We set this to true by default so that events bubble to forms without JS (SSR)

@@ -64,3 +60,2 @@ const isFormControl = button ? Boolean(button.closest('form')) : true;

"aria-checked": checked,
"aria-labelledby": labelledBy,
"aria-required": required,

@@ -67,0 +62,0 @@ "data-state": $4465bdeb0ef4ccd7$var$getState(checked),

@@ -10,3 +10,2 @@ import $irPIl$babelruntimehelpersesmextends from "@babel/runtime/helpers/esm/extends";

import {Primitive as $irPIl$Primitive} from "@radix-ui/react-primitive";
import {useLabelContext as $irPIl$useLabelContext} from "@radix-ui/react-label";

@@ -22,3 +21,2 @@

/* -------------------------------------------------------------------------------------------------

@@ -30,8 +28,6 @@ * Switch

const $6be4966fd9bbc698$export$b5d5cf8927ab7262 = /*#__PURE__*/ $irPIl$forwardRef((props, forwardedRef)=>{
const { __scopeSwitch: __scopeSwitch , 'aria-labelledby': ariaLabelledby , name: name , checked: checkedProp , defaultChecked: defaultChecked , required: required , disabled: disabled , value: value = 'on' , onCheckedChange: onCheckedChange , ...switchProps } = props;
const { __scopeSwitch: __scopeSwitch , name: name , checked: checkedProp , defaultChecked: defaultChecked , required: required , disabled: disabled , value: value = 'on' , onCheckedChange: onCheckedChange , ...switchProps } = props;
const [button, setButton] = $irPIl$useState(null);
const composedRefs = $irPIl$useComposedRefs(forwardedRef, (node)=>setButton(node)
);
const labelId = $irPIl$useLabelContext(button);
const labelledBy = ariaLabelledby || labelId;
const hasConsumerStoppedPropagationRef = $irPIl$useRef(false); // We set this to true by default so that events bubble to forms without JS (SSR)

@@ -52,3 +48,2 @@ const isFormControl = button ? Boolean(button.closest('form')) : true;

"aria-checked": checked,
"aria-labelledby": labelledBy,
"aria-required": required,

@@ -55,0 +50,0 @@ "data-state": $6be4966fd9bbc698$var$getState(checked),

8

package.json
{
"name": "@radix-ui/react-switch",
"version": "1.0.0",
"version": "1.0.1-rc.1",
"license": "MIT",

@@ -23,4 +23,3 @@ "source": "src/index.ts",

"@radix-ui/react-context": "1.0.0",
"@radix-ui/react-label": "1.0.0",
"@radix-ui/react-primitive": "1.0.0",
"@radix-ui/react-primitive": "1.0.1-rc.1",
"@radix-ui/react-use-controllable-state": "1.0.0",

@@ -41,3 +40,4 @@ "@radix-ui/react-use-previous": "1.0.0",

"url": "https://github.com/radix-ui/primitives/issues"
}
},
"stableVersion": "1.0.0"
}

Sorry, the diff of this file is not supported yet

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.