@radix-ui/react-checkbox
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -1,2 +0,2 @@ | ||
var e,r,t=require("@radix-ui/react-primitive").Primitive,n=require("@radix-ui/react-presence").Presence,a=require("@radix-ui/react-label").useLabelContext,o=require("@radix-ui/react-utils"),i=o.createContext,c=o.composeEventHandlers,l=o.useControlledState,u=o.useComposedRefs,d=require("@radix-ui/utils").getSelector,f=(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);function s(){return(s=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function b(e,r){if(null==e)return{};var t,n,a=function(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function h(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],n=!0,a=!1,o=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){a=!0,o=e}finally{try{n||null==c.return||c.return()}finally{if(a)throw o}}return t}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return v(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return v(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var y=h(i("CheckboxContext","Checkbox"),2),m=y[0],p=y[1],k=f.forwardRef((function(e,r){var n=e.as,o=void 0===n?"button":n,i=e.selector,v=void 0===i?d("Checkbox"):i,y=e["aria-labelledby"],p=e.children,k=e.name,x=e.checked,g=e.defaultChecked,O=e.required,j=e.disabled,E=e.readOnly,q=e.value,S=void 0===q?"on":q,w=e.onCheckedChange,I=b(e,["as","selector","aria-labelledby","children","name","checked","defaultChecked","required","disabled","readOnly","value","onCheckedChange"]),P=f.useRef(null),A=f.useRef(null),R=u(r,A),M=a(A),F=y||M,N=h(l({prop:x,defaultProp:g}),2),_=N[0],D=void 0!==_&&_,H=N[1];return f.useEffect((function(){var e="indeterminate"===D;P.current&&(P.current.indeterminate=e)})),f.createElement(f.Fragment,null,f.createElement("input",{ref:P,type:"checkbox",name:k,checked:"indeterminate"!==D&&D,required:O,disabled:j,readOnly:E,value:S,hidden:!0,onChange:c(w,(function(e){H(e.target.checked)}))}),f.createElement(t,s({type:"button"},I,{as:o,selector:v,ref:R,role:"checkbox","aria-checked":"indeterminate"===D?"mixed":D,"aria-labelledby":F,"aria-required":O,"data-state":C(D),"data-readonly":E,disabled:j,value:S,onClick:c(e.onClick,(function(){var e;return null===(e=P.current)||void 0===e?void 0:e.click()}),{checkForDefaultPrevented:!1})}),f.createElement(m.Provider,{value:D},p)))}));exports.Checkbox=k,k.displayName="Checkbox";var x=f.forwardRef((function(e,r){var a=e.as,o=void 0===a?"span":a,i=e.selector,c=void 0===i?d("CheckboxIndicator"):i,l=e.forceMount,u=b(e,["as","selector","forceMount"]),h=p("CheckboxIndicator");return f.createElement(n,{present:l||"indeterminate"===h||!0===h},f.createElement(t,s({},u,{as:o,selector:c,ref:r,"data-state":C(h)})))}));function C(e){return"indeterminate"===e?"indeterminate":e?"checked":"unchecked"}exports.CheckboxIndicator=x,x.displayName="CheckboxIndicator";var g=k;exports.Root=g;var O=x;exports.Indicator=O; | ||
var e,r,t=require("@radix-ui/react-primitive").Primitive,n=require("@radix-ui/react-presence").Presence,a=require("@radix-ui/react-label").useLabelContext,o=require("@radix-ui/react-utils"),i=o.createContext,c=o.composeEventHandlers,l=o.useControlledState,u=o.useComposedRefs,d=require("@radix-ui/utils").getSelector,f=(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);function s(){return(s=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function b(e,r){if(null==e)return{};var t,n,a=function(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function h(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],n=!0,a=!1,o=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){a=!0,o=e}finally{try{n||null==c.return||c.return()}finally{if(a)throw o}}return t}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return v(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return v(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var y=h(i("CheckboxContext","Checkbox"),2),m=y[0],p=y[1],k=f.forwardRef((function(e,r){var n=e.as,o=void 0===n?"button":n,i=e.selector,v=void 0===i?d("Checkbox"):i,y=e["aria-labelledby"],p=e.name,k=e.checked,x=e.defaultChecked,g=e.required,O=e.disabled,j=e.readOnly,E=e.value,q=void 0===E?"on":E,S=e.onCheckedChange,w=b(e,["as","selector","aria-labelledby","name","checked","defaultChecked","required","disabled","readOnly","value","onCheckedChange"]),I=f.useRef(null),P=f.useRef(null),A=u(r,P),R=a(P),M=y||R,F=h(l({prop:k,defaultProp:x}),2),N=F[0],_=void 0!==N&&N,D=F[1];return f.useEffect((function(){var e="indeterminate"===_;I.current&&(I.current.indeterminate=e)})),f.createElement(f.Fragment,null,f.createElement("input",{ref:I,type:"checkbox",name:p,checked:"indeterminate"!==_&&_,required:g,disabled:O,readOnly:j,value:q,hidden:!0,onChange:c(S,(function(e){D(e.target.checked)}))}),f.createElement(m.Provider,{value:_},f.createElement(t,s({type:"button"},w,{as:o,selector:v,ref:A,role:"checkbox","aria-checked":"indeterminate"===_?"mixed":_,"aria-labelledby":M,"aria-required":g,"data-state":C(_),"data-readonly":j,disabled:O,value:q,onClick:c(e.onClick,(function(){var e;return null===(e=I.current)||void 0===e?void 0:e.click()}),{checkForDefaultPrevented:!1})}))))}));exports.Checkbox=k,k.displayName="Checkbox";var x=f.forwardRef((function(e,r){var a=e.as,o=void 0===a?"span":a,i=e.selector,c=void 0===i?d("CheckboxIndicator"):i,l=e.forceMount,u=b(e,["as","selector","forceMount"]),h=p("CheckboxIndicator");return f.createElement(n,{present:l||"indeterminate"===h||!0===h},f.createElement(t,s({},u,{as:o,selector:c,ref:r,"data-state":C(h)})))}));function C(e){return"indeterminate"===e?"indeterminate":e?"checked":"unchecked"}exports.CheckboxIndicator=x,x.displayName="CheckboxIndicator";var g=k;exports.Root=g;var O=x;exports.Indicator=O; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{Primitive as e}from"@radix-ui/react-primitive";import{Presence as r}from"@radix-ui/react-presence";import{useLabelContext as t}from"@radix-ui/react-label";import{createContext as n,composeEventHandlers as a,useControlledState as o,useComposedRefs as c}from"@radix-ui/react-utils";import{getSelector as i}from"@radix-ui/utils";import*as l from"react";function d(){return(d=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function u(e,r){if(null==e)return{};var t,n,a=function(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}const s="Checkbox",f="button",[m,h]=n(s+"Context",s);export const Checkbox=l.forwardRef(((r,n)=>{const{as:h=f,selector:p=i(s),"aria-labelledby":b,children:x,name:y,checked:C,defaultChecked:v,required:O,disabled:g,readOnly:E,value:j="on",onCheckedChange:I}=r,P=u(r,["as","selector","aria-labelledby","children","name","checked","defaultChecked","required","disabled","readOnly","value","onCheckedChange"]),w=l.useRef(null),R=l.useRef(null),q=c(n,R),F=t(R),M=b||F,[N=!1,S]=o({prop:C,defaultProp:v});return l.useEffect((()=>{const e="indeterminate"===N;w.current&&(w.current.indeterminate=e)})),l.createElement(l.Fragment,null,l.createElement("input",{ref:w,type:"checkbox",name:y,checked:"indeterminate"!==N&&N,required:O,disabled:g,readOnly:E,value:j,hidden:!0,onChange:a(I,(e=>{S(e.target.checked)}))}),l.createElement(e,d({type:"button"},P,{as:h,selector:p,ref:q,role:"checkbox","aria-checked":"indeterminate"===N?"mixed":N,"aria-labelledby":M,"aria-required":O,"data-state":k(N),"data-readonly":E,disabled:g,value:j,onClick:a(r.onClick,(()=>{var e;return null===(e=w.current)||void 0===e?void 0:e.click()}),{checkForDefaultPrevented:!1})}),l.createElement(m.Provider,{value:N},x)))}));Checkbox.displayName=s;const p="CheckboxIndicator",b="span";export const CheckboxIndicator=l.forwardRef(((t,n)=>{const{as:a=b,selector:o=i(p),forceMount:c}=t,s=u(t,["as","selector","forceMount"]),f=h(p);return l.createElement(r,{present:c||"indeterminate"===f||!0===f},l.createElement(e,d({},s,{as:a,selector:o,ref:n,"data-state":k(f)})))}));function k(e){return"indeterminate"===e?"indeterminate":e?"checked":"unchecked"}CheckboxIndicator.displayName=p;export const Root=Checkbox;export const Indicator=CheckboxIndicator; | ||
import{Primitive as e}from"@radix-ui/react-primitive";import{Presence as r}from"@radix-ui/react-presence";import{useLabelContext as t}from"@radix-ui/react-label";import{createContext as n,composeEventHandlers as a,useControlledState as o,useComposedRefs as c}from"@radix-ui/react-utils";import{getSelector as i}from"@radix-ui/utils";import*as l from"react";function d(){return(d=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function u(e,r){if(null==e)return{};var t,n,a=function(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}const s="Checkbox",f="button",[m,p]=n(s+"Context",s);export const Checkbox=l.forwardRef(((r,n)=>{const{as:p=f,selector:b=i(s),"aria-labelledby":h,name:x,checked:y,defaultChecked:C,required:v,disabled:O,readOnly:g,value:E="on",onCheckedChange:j}=r,I=u(r,["as","selector","aria-labelledby","name","checked","defaultChecked","required","disabled","readOnly","value","onCheckedChange"]),P=l.useRef(null),w=l.useRef(null),R=c(n,w),q=t(w),F=h||q,[M=!1,N]=o({prop:y,defaultProp:C});return l.useEffect((()=>{const e="indeterminate"===M;P.current&&(P.current.indeterminate=e)})),l.createElement(l.Fragment,null,l.createElement("input",{ref:P,type:"checkbox",name:x,checked:"indeterminate"!==M&&M,required:v,disabled:O,readOnly:g,value:E,hidden:!0,onChange:a(j,(e=>{N(e.target.checked)}))}),l.createElement(m.Provider,{value:M},l.createElement(e,d({type:"button"},I,{as:p,selector:b,ref:R,role:"checkbox","aria-checked":"indeterminate"===M?"mixed":M,"aria-labelledby":F,"aria-required":v,"data-state":k(M),"data-readonly":g,disabled:O,value:E,onClick:a(r.onClick,(()=>{var e;return null===(e=P.current)||void 0===e?void 0:e.click()}),{checkForDefaultPrevented:!1})}))))}));Checkbox.displayName=s;const b="CheckboxIndicator",h="span";export const CheckboxIndicator=l.forwardRef(((t,n)=>{const{as:a=h,selector:o=i(b),forceMount:c}=t,s=u(t,["as","selector","forceMount"]),f=p(b);return l.createElement(r,{present:c||"indeterminate"===f||!0===f},l.createElement(e,d({},s,{as:a,selector:o,ref:n,"data-state":k(f)})))}));function k(e){return"indeterminate"===e?"indeterminate":e?"checked":"unchecked"}CheckboxIndicator.displayName=b;export const Root=Checkbox;export const Indicator=CheckboxIndicator; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-checkbox", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"license": "MIT", | ||
@@ -19,7 +19,7 @@ "source": "src/index.ts", | ||
"dependencies": { | ||
"@radix-ui/react-label": "0.0.3", | ||
"@radix-ui/react-polymorphic": "0.0.3", | ||
"@radix-ui/react-presence": "0.0.3", | ||
"@radix-ui/react-primitive": "0.0.2", | ||
"@radix-ui/react-utils": "0.0.3", | ||
"@radix-ui/react-label": "0.0.4", | ||
"@radix-ui/react-polymorphic": "0.0.4", | ||
"@radix-ui/react-presence": "0.0.4", | ||
"@radix-ui/react-primitive": "0.0.3", | ||
"@radix-ui/react-utils": "0.0.4", | ||
"@radix-ui/utils": "0.0.3" | ||
@@ -26,0 +26,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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29306
+ Added@radix-ui/react-label@0.0.4(transitive)
+ Added@radix-ui/react-polymorphic@0.0.4(transitive)
+ Added@radix-ui/react-presence@0.0.4(transitive)
+ Added@radix-ui/react-primitive@0.0.3(transitive)
+ Added@radix-ui/react-utils@0.0.4(transitive)
- Removed@radix-ui/react-label@0.0.3(transitive)
- Removed@radix-ui/react-polymorphic@0.0.3(transitive)
- Removed@radix-ui/react-presence@0.0.3(transitive)
- Removed@radix-ui/react-primitive@0.0.2(transitive)
- Removed@radix-ui/react-utils@0.0.3(transitive)
Updated@radix-ui/react-label@0.0.4
Updated@radix-ui/react-utils@0.0.4