@radix-ui/react-checkbox
Advanced tools
Comparing version 0.1.1-rc.6 to 0.1.1-rc.7
@@ -1,2 +0,2 @@ | ||
var e,t,r,a=require("@radix-ui/react-primitive").Primitive,n=require("@radix-ui/react-presence").Presence,o=require("@radix-ui/react-label").useLabelContext,i=require("@radix-ui/react-use-size").useSize,c=require("@radix-ui/react-use-previous").usePrevious,s=require("@radix-ui/react-use-controllable-state").useControllableState,u=require("@radix-ui/primitive").composeEventHandlers,d=require("@radix-ui/react-context").createContext,l=require("@radix-ui/react-compose-refs").useComposedRefs,b=(e={},t=require("react"),Object.keys(t).forEach((function(r){"default"!==r&&"__esModule"!==r&&Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[r]}})})),e),p=(r=require("@babel/runtime/helpers/extends"))&&r.__esModule?r.default:r;const[f,x]=d("Checkbox"),m=/*#__PURE__*/b.forwardRef(((e,t)=>{const{"aria-labelledby":r,name:n,checked:i,defaultChecked:c,required:d,disabled:x,value:m="on",onCheckedChange:h,...q}=e,[y,E]=b.useState(null),P=l(t,(e=>E(e))),g=o(y),w=r||g,R=b.useRef(!1),I=!y||Boolean(y.closest("form")),[M=!1,O]=s({prop:i,defaultProp:c,onChange:h});/*#__PURE__*/return b.createElement(f,{state:M,disabled:x},/*#__PURE__*/b.createElement(a.button,p({type:"button",role:"checkbox","aria-checked":v(M)?"mixed":M,"aria-labelledby":w,"aria-required":d,"data-state":C(M),"data-disabled":x?"":void 0,disabled:x,value:m},q,{ref:P,onClick:u(e.onClick,(e=>{O((e=>!!v(e)||!e)),I&&(R.current=e.isPropagationStopped(),R.current||e.stopPropagation())}))})),I&&/*#__PURE__*/b.createElement(k,{control:y,bubbles:!R.current,name:n,value:m,checked:M,required:d,disabled:x,style:{transform:"translateX(-100%)"}}))}));exports.Checkbox=m;const h=/*#__PURE__*/b.forwardRef(((e,t)=>{const{forceMount:r,...o}=e,i=x("CheckboxIndicator");/*#__PURE__*/return b.createElement(n,{present:r||v(i.state)||!0===i.state},/*#__PURE__*/b.createElement(a.span,p({"data-state":C(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}));exports.CheckboxIndicator=h;const k=e=>{const{control:t,checked:r,bubbles:a=!0,...n}=e,o=b.useRef(null),s=c(r),u=i(t);return b.useEffect((()=>{const e=o.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(s!==r&&n){const t=new Event("click",{bubbles:a});e.indeterminate=v(r),n.call(e,!v(r)&&r),e.dispatchEvent(t)}}),[s,r,a]),/*#__PURE__*/b.createElement("input",p({type:"checkbox",defaultChecked:!v(r)&&r},n,{tabIndex:-1,ref:o,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function v(e){return"indeterminate"===e}function C(e){return v(e)?"indeterminate":e?"checked":"unchecked"}const q=m;exports.Root=q;const y=h;exports.Indicator=y; | ||
var e,t,r,a=require("@radix-ui/react-primitive").Primitive,n=require("@radix-ui/react-presence").Presence,i=require("@radix-ui/react-label").useLabelContext,o=require("@radix-ui/react-use-size").useSize,c=require("@radix-ui/react-use-previous").usePrevious,s=require("@radix-ui/react-use-controllable-state").useControllableState,u=require("@radix-ui/primitive").composeEventHandlers,d=require("@radix-ui/react-context").createContext,l=require("@radix-ui/react-compose-refs").useComposedRefs,b=(e={},t=require("react"),Object.keys(t).forEach((function(r){"default"!==r&&"__esModule"!==r&&Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[r]}})})),e),p=(r=require("@babel/runtime/helpers/extends"))&&r.__esModule?r.default:r;const[f,x]=d("Checkbox"),m=/*#__PURE__*/b.forwardRef(((e,t)=>{const{"aria-labelledby":r,name:n,checked:o,defaultChecked:c,required:d,disabled:x,value:m="on",onCheckedChange:h,...q}=e,[y,E]=b.useState(null),P=l(t,(e=>E(e))),g=i(y),w=r||g,R=b.useRef(!1),I=!y||Boolean(y.closest("form")),[M=!1,O]=s({prop:o,defaultProp:c,onChange:h});/*#__PURE__*/return b.createElement(f,{state:M,disabled:x},/*#__PURE__*/b.createElement(a.button,p({type:"button",role:"checkbox","aria-checked":v(M)?"mixed":M,"aria-labelledby":w,"aria-required":d,"data-state":C(M),"data-disabled":x?"":void 0,disabled:x,value:m},q,{ref:P,onClick:u(e.onClick,(e=>{O((e=>!!v(e)||!e)),I&&(R.current=e.isPropagationStopped(),R.current||e.stopPropagation())}))})),I&&/*#__PURE__*/b.createElement(k,{control:y,bubbles:!R.current,name:n,value:m,checked:M,required:d,disabled:x,style:{transform:"translateX(-100%)"}}))}));exports.Checkbox=m;const h=/*#__PURE__*/b.forwardRef(((e,t)=>{const{forceMount:r,...i}=e,o=x("CheckboxIndicator");/*#__PURE__*/return b.createElement(n,{present:r||v(o.state)||!0===o.state},/*#__PURE__*/b.createElement(a.span,p({"data-state":C(o.state),"data-disabled":o.disabled?"":void 0},i,{ref:t,style:{pointerEvents:"none",...e.style}})))}));exports.CheckboxIndicator=h;const k=e=>{const{control:t,checked:r,bubbles:a=!0,...n}=e,i=b.useRef(null),s=c(r),u=o(t);return b.useEffect((()=>{const e=i.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(s!==r&&n){const t=new Event("click",{bubbles:a});e.indeterminate=v(r),n.call(e,!v(r)&&r),e.dispatchEvent(t)}}),[s,r,a]),/*#__PURE__*/b.createElement("input",p({type:"checkbox","aria-hidden":!0,defaultChecked:!v(r)&&r},n,{tabIndex:-1,ref:i,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function v(e){return"indeterminate"===e}function C(e){return v(e)?"indeterminate":e?"checked":"unchecked"}const q=m;exports.Root=q;const y=h;exports.Indicator=y; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{Primitive as e}from"@radix-ui/react-primitive";import{Presence as t}from"@radix-ui/react-presence";import{useLabelContext as r}from"@radix-ui/react-label";import{useSize as o}from"@radix-ui/react-use-size";import{usePrevious as a}from"@radix-ui/react-use-previous";import{useControllableState as n}from"@radix-ui/react-use-controllable-state";import{composeEventHandlers as i}from"@radix-ui/primitive";import{createContext as c}from"@radix-ui/react-context";import{useComposedRefs as s}from"@radix-ui/react-compose-refs";import*as d from"react";import l from"@babel/runtime/helpers/esm/extends";const[u,p]=c("Checkbox");export const Checkbox=/*#__PURE__*/d.forwardRef(((t,o)=>{const{"aria-labelledby":a,name:c,checked:p,defaultChecked:x,required:h,disabled:k,value:C="on",onCheckedChange:v,...y}=t,[E,g]=d.useState(null),w=s(o,(e=>g(e))),I=r(E),R=a||I,P=d.useRef(!1),q=!E||Boolean(E.closest("form")),[M=!1,O]=n({prop:p,defaultProp:x,onChange:v});/*#__PURE__*/return d.createElement(u,{state:M,disabled:k},/*#__PURE__*/d.createElement(e.button,l({type:"button",role:"checkbox","aria-checked":b(M)?"mixed":M,"aria-labelledby":R,"aria-required":h,"data-state":f(M),"data-disabled":k?"":void 0,disabled:k,value:C},y,{ref:w,onClick:i(t.onClick,(e=>{O((e=>!!b(e)||!e)),q&&(P.current=e.isPropagationStopped(),P.current||e.stopPropagation())}))})),q&&/*#__PURE__*/d.createElement(m,{control:E,bubbles:!P.current,name:c,value:C,checked:M,required:h,disabled:k,style:{transform:"translateX(-100%)"}}))}));/*#__PURE__*/export const CheckboxIndicator=/*#__PURE__*/d.forwardRef(((r,o)=>{const{forceMount:a,...n}=r,i=p("CheckboxIndicator");/*#__PURE__*/return d.createElement(t,{present:a||b(i.state)||!0===i.state},/*#__PURE__*/d.createElement(e.span,l({"data-state":f(i.state),"data-disabled":i.disabled?"":void 0},n,{ref:o,style:{pointerEvents:"none",...r.style}})))}));/*#__PURE__*/const m=e=>{const{control:t,checked:r,bubbles:n=!0,...i}=e,c=d.useRef(null),s=a(r),u=o(t);return d.useEffect((()=>{const e=c.current,t=window.HTMLInputElement.prototype,o=Object.getOwnPropertyDescriptor(t,"checked").set;if(s!==r&&o){const t=new Event("click",{bubbles:n});e.indeterminate=b(r),o.call(e,!b(r)&&r),e.dispatchEvent(t)}}),[s,r,n]),/*#__PURE__*/d.createElement("input",l({type:"checkbox",defaultChecked:!b(r)&&r},i,{tabIndex:-1,ref:c,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function b(e){return"indeterminate"===e}function f(e){return b(e)?"indeterminate":e?"checked":"unchecked"}export const Root=Checkbox;export const Indicator=CheckboxIndicator; | ||
import{Primitive as e}from"@radix-ui/react-primitive";import{Presence as t}from"@radix-ui/react-presence";import{useLabelContext as r}from"@radix-ui/react-label";import{useSize as o}from"@radix-ui/react-use-size";import{usePrevious as a}from"@radix-ui/react-use-previous";import{useControllableState as n}from"@radix-ui/react-use-controllable-state";import{composeEventHandlers as i}from"@radix-ui/primitive";import{createContext as c}from"@radix-ui/react-context";import{useComposedRefs as d}from"@radix-ui/react-compose-refs";import*as s from"react";import l from"@babel/runtime/helpers/esm/extends";const[u,p]=c("Checkbox");export const Checkbox=/*#__PURE__*/s.forwardRef(((t,o)=>{const{"aria-labelledby":a,name:c,checked:p,defaultChecked:x,required:h,disabled:k,value:C="on",onCheckedChange:v,...y}=t,[E,g]=s.useState(null),w=d(o,(e=>g(e))),I=r(E),R=a||I,P=s.useRef(!1),q=!E||Boolean(E.closest("form")),[M=!1,O]=n({prop:p,defaultProp:x,onChange:v});/*#__PURE__*/return s.createElement(u,{state:M,disabled:k},/*#__PURE__*/s.createElement(e.button,l({type:"button",role:"checkbox","aria-checked":b(M)?"mixed":M,"aria-labelledby":R,"aria-required":h,"data-state":f(M),"data-disabled":k?"":void 0,disabled:k,value:C},y,{ref:w,onClick:i(t.onClick,(e=>{O((e=>!!b(e)||!e)),q&&(P.current=e.isPropagationStopped(),P.current||e.stopPropagation())}))})),q&&/*#__PURE__*/s.createElement(m,{control:E,bubbles:!P.current,name:c,value:C,checked:M,required:h,disabled:k,style:{transform:"translateX(-100%)"}}))}));/*#__PURE__*/export const CheckboxIndicator=/*#__PURE__*/s.forwardRef(((r,o)=>{const{forceMount:a,...n}=r,i=p("CheckboxIndicator");/*#__PURE__*/return s.createElement(t,{present:a||b(i.state)||!0===i.state},/*#__PURE__*/s.createElement(e.span,l({"data-state":f(i.state),"data-disabled":i.disabled?"":void 0},n,{ref:o,style:{pointerEvents:"none",...r.style}})))}));/*#__PURE__*/const m=e=>{const{control:t,checked:r,bubbles:n=!0,...i}=e,c=s.useRef(null),d=a(r),u=o(t);return s.useEffect((()=>{const e=c.current,t=window.HTMLInputElement.prototype,o=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==r&&o){const t=new Event("click",{bubbles:n});e.indeterminate=b(r),o.call(e,!b(r)&&r),e.dispatchEvent(t)}}),[d,r,n]),/*#__PURE__*/s.createElement("input",l({type:"checkbox","aria-hidden":!0,defaultChecked:!b(r)&&r},i,{tabIndex:-1,ref:c,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function b(e){return"indeterminate"===e}function f(e){return b(e)?"indeterminate":e?"checked":"unchecked"}export const Root=Checkbox;export const Indicator=CheckboxIndicator; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-checkbox", | ||
"version": "0.1.1-rc.6", | ||
"version": "0.1.1-rc.7", | ||
"license": "MIT", | ||
@@ -23,5 +23,5 @@ "source": "src/index.ts", | ||
"@radix-ui/react-context": "0.1.0", | ||
"@radix-ui/react-label": "0.1.1-rc.6", | ||
"@radix-ui/react-presence": "0.1.1-rc.3", | ||
"@radix-ui/react-primitive": "0.1.1-rc.6", | ||
"@radix-ui/react-label": "0.1.1-rc.7", | ||
"@radix-ui/react-presence": "0.1.1-rc.4", | ||
"@radix-ui/react-primitive": "0.1.1-rc.7", | ||
"@radix-ui/react-use-controllable-state": "0.1.0", | ||
@@ -28,0 +28,0 @@ "@radix-ui/react-use-previous": "0.1.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
32858
48
+ Added@radix-ui/react-label@0.1.1-rc.7(transitive)
+ Added@radix-ui/react-presence@0.1.1-rc.4(transitive)
+ Added@radix-ui/react-primitive@0.1.1-rc.7(transitive)
+ Added@radix-ui/react-slot@0.1.1-rc.3(transitive)
- Removed@radix-ui/react-label@0.1.1-rc.6(transitive)
- Removed@radix-ui/react-presence@0.1.1-rc.3(transitive)
- Removed@radix-ui/react-primitive@0.1.1-rc.6(transitive)
- Removed@radix-ui/react-slot@0.1.1-rc.2(transitive)