🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@twilio-paste/checkbox

Package Overview
Dependencies
Maintainers
5
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twilio-paste/checkbox - npm Package Compare versions

Comparing version

to
2.0.7-beta.15

dist/tsconfig.tsbuildinfo

2

dist/CheckboxGroup.d.ts

@@ -8,4 +8,4 @@ import * as React from 'react';

}
declare const CheckboxGroup: React.ForwardRefExoticComponent<Pick<CheckboxGroupProps, "onChange" | "disabled" | "form" | "name" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "errorText" | "isSelectAll" | "orientation" | "value" | "helpText" | "legend" | "required"> & React.RefAttributes<HTMLFieldSetElement>>;
declare const CheckboxGroup: React.ForwardRefExoticComponent<Pick<CheckboxGroupProps, "disabled" | "id" | "name" | "onChange" | "value" | "children" | "helpText" | "isSelectAll" | "form" | "placeholder" | "required" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "legend" | "errorText" | "orientation"> & React.RefAttributes<HTMLFieldSetElement>>;
export { CheckboxGroup };
//# sourceMappingURL=CheckboxGroup.d.ts.map

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

import{createElement as e,createContext as r,forwardRef as i,useContext as o,useCallback as n,useMemo as l,Children as a,isValidElement as t,cloneElement as c,Fragment as d}from"react";import{node as s,bool as p,string as u,func as h,oneOfType as f,oneOf as b}from"prop-types";import{useUID as v}from"@twilio-paste/uid-library";import{Box as m,safelySpreadBoxProps as g}from"@twilio-paste/box";import{BaseRadioCheckboxLabel as y,BaseRadioCheckboxControl as x,BaseRadioCheckboxLabelText as C,BaseRadioCheckboxHelpText as O}from"@twilio-paste/base-radio-checkbox";import{InlineControlGroup as k}from"@twilio-paste/inline-control-group";import{HelpText as w}from"@twilio-paste/help-text";var T=function(){return(T=Object.assign||function(e){for(var r,i=1,o=arguments.length;i<o;i++)for(var n in r=arguments[i])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e}).apply(this,arguments)};function z(e,r){var i={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(i[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)r.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(i[o[n]]=e[o[n]])}return i}var E=function(){return(E=Object.assign||function(e){for(var r,i=1,o=arguments.length;i<o;i++)for(var n in r=arguments[i])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e}).apply(this,arguments)},I=function(r){var i=r.display,o=r.color,n=r.size,l=function(e,r){var i={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(i[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)r.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(i[o[n]]=e[o[n]])}return i}(r,["display","color","size"]);return e(m,E({},g(l),{lineHeight:"lineHeight0",display:i,color:o,size:n}))};I.defaultProps={as:"span",display:"block",color:"currentColor",size:"sizeIcon30"},I.displayName="IconWrapper";var S=function(r){var i=r.as,o=r.display,n=r.size,l=r.color,a=r.title,t=r.decorative,c="CheckboxCheckIcon-"+v();if(!t&&null==a)throw new Error("[CheckboxCheckIcon]: Missing a title for non-decorative icon.");return e(I,{as:i,display:o,size:n,color:l},e("svg",{role:"img","aria-hidden":t,width:"100%",height:"100%",viewBox:"0 0 20 20","aria-labelledby":c},a?e("title",{id:c},a):null,e("path",{fill:"currentColor",fillRule:"evenodd",d:"M15.59 5.916a1.386 1.386 0 00-1.98 0l-5.04 5.138L6.39 8.83a1.38 1.38 0 00-1.98 0 1.448 1.448 0 000 2.018l3.171 3.233a1.382 1.382 0 001.98 0l6.03-6.148a1.448 1.448 0 000-2.018z"})))};S.displayName="CheckboxCheckIcon";var N=function(r){var i=r.as,o=r.display,n=r.size,l=r.color,a=r.title,t=r.decorative,c="MinusIcon-"+v();if(!t&&null==a)throw new Error("[MinusIcon]: Missing a title for non-decorative icon.");return e(I,{as:i,display:o,size:n,color:l},e("svg",{role:"img","aria-hidden":t,width:"100%",height:"100%",viewBox:"0 0 20 20","aria-labelledby":c},a?e("title",{id:c},a):null,e("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.167 9.5c.46 0 .833.448.833 1 0 .513-.322.936-.736.993l-.097.007H5.833c-.46 0-.833-.448-.833-1 0-.513.322-.936.736-.993l.097-.007h8.334z"})))};N.displayName="MinusIcon";var R=r({disabled:!1,name:void 0,hasError:void 0,onChange:function(){}}),j=i((function(r,i){return e(m,T({},r,{ref:i,as:"input",type:"checkbox",size:"size0",border:"none",overflow:"hidden",padding:"space0",margin:"space0",whiteSpace:"nowrap",textTransform:"none",position:"absolute",clip:"rect(0 0 0 0)"}))})),A=function(r){var i=r.checked,o=r.disabled,n=r.indeterminate,l=o&&(i||n)?"colorTextInverseWeaker":"colorTextInverse";return n?e(N,{decorative:!0,color:l,size:"sizeIcon10"}):e(S,{hidden:!i,decorative:!0,color:l,size:"sizeIcon10"})},P=i((function(r,i){var n=r.checked,l=r.children,a=r.helpText,t=r.id,c=r.indeterminate,d=r.isSelectAll,s=r.isSelectAllChild,p=z(r,["checked","children","helpText","id","indeterminate","isSelectAll","isSelectAllChild"]),u=v(),h=o(R),f=null!=p.disabled?p.disabled:h.disabled,b=null!=p.name?p.name:h.name,k=null!=p.hasError?p.hasError:h.hasError,w=null!=p.onChange?p.onChange:h.onChange,E=null,I=null;return d&&(E="space20",n||c?I="colorBackgroundPrimaryLightest":f||(I="colorBackground")),s&&(E="space30"),e(m,{backgroundColor:I,borderRadius:d?"borderRadius10":null,display:"inline-flex",flexDirection:"column",padding:d?"space30":null,paddingBottom:d?"space20":null,paddingLeft:E,paddingRight:s?"space30":null,paddingTop:d?"space20":null},e(j,T({},g(p),{checked:n,disabled:f,name:b,onChange:w,"aria-describedby":u,"aria-checked":c?"mixed":n,"aria-invalid":k,id:t,ref:i})),e(y,{disabled:f,htmlFor:t},e(x,{alignItems:"center",borderRadius:"borderRadius10",disabled:f,position:"relative",type:"checkbox"},e(A,{checked:n,disabled:f,indeterminate:c})),e(C,{fontWeight:d?null:"fontWeightNormal"},l)),a&&e(O,{helpTextId:u},a))}));P.displayName="Checkbox","development"===process.env.NODE_ENV&&(P.propTypes={children:s.isRequired,disabled:p,name:u,onChange:h,hasError:p,helpText:f([u,s]),id:u.isRequired,indeterminate:p,isSelectAll:p,isSelectAllChild:p});var M=i((function(r,i){var o=r.children,d=r.disabled,s=void 0!==d&&d,p=r.errorText,u=r.isSelectAll,h=void 0!==u&&u,f=r.name,b=r.onChange,v=r.orientation,m=void 0===v?"vertical":v,g=(r.value,z(r,["children","disabled","errorText","isSelectAll","name","onChange","orientation","value"])),y=n((function(e){null!=b&&b(e.target.checked)}),[b]),x=l((function(){return{disabled:s,name:f,onChange:y,hasError:!!p||void 0}}),[s,f,y]);return e(R.Provider,{value:x},e(k,T({},g,{disabled:s,errorText:p,name:f,orientation:m,ref:i}),a.map(o,(function(e,r){return t(e)?c(e,{isSelectAll:h&&0===r,isSelectAllChild:h&&"vertical"===m&&0!==r}):e}))))}));M.displayName="CheckboxGroup","development"===process.env.NODE_ENV&&(M.propTypes={isSelectAll:p,name:u.isRequired,onChange:h,disabled:p,errorText:u,helpText:u,orientation:b(["vertical","horizontal"]),value:u});var B=i((function(r,i){var o=r.children,n=r.errorText,l=z(r,["children","errorText"]);return e(d,null,e(m,{backgroundColor:"colorBackground",borderRadius:"borderRadius20",padding:"space50"},e(P,T({},l,{hasError:null!=n,ref:i}),o)),n&&e(m,{marginTop:"space30",marginLeft:"space50"},e(w,{variant:"error"},n)))}));B.displayName="CheckboxDisclaimer","development"===process.env.NODE_ENV&&(B.propTypes={children:s.isRequired,errorText:f([u,s])});export{P as Checkbox,B as CheckboxDisclaimer,M as CheckboxGroup};
import{createElement as i,forwardRef as T,useContext as B}from"react";import{bool as ee,func as oe,node as re,oneOfType as ne,string as te}from"prop-types";import{useUID as N}from"@twilio-paste/uid-library";import{Box as g,safelySpreadBoxProps as w}from"@twilio-paste/box";import{CheckboxCheckIcon as H}from"@twilio-paste/icons/esm/CheckboxCheckIcon";import{MinusIcon as L}from"@twilio-paste/icons/esm/MinusIcon";import{BaseRadioCheckboxControl as D,BaseRadioCheckboxLabel as G,BaseRadioCheckboxLabelText as M,BaseRadioCheckboxHelpText as O}from"@twilio-paste/base-radio-checkbox";import{createContext as I}from"react";var u=I({disabled:!1,name:void 0,hasError:void 0,onChange:()=>{}});var S=T((e,o)=>i(g,{...e,ref:o,as:"input",type:"checkbox",size:"size0",border:"none",overflow:"hidden",padding:"space0",margin:"space0",whiteSpace:"nowrap",textTransform:"none",position:"absolute",clip:"rect(0 0 0 0)"})),z=({checked:e,disabled:o,indeterminate:r})=>{let n=o&&(e||r)?"colorTextInverseWeaker":"colorTextInverse";return r?i(L,{decorative:!0,color:n,size:"sizeIcon10"}):i(H,{hidden:!e,decorative:!0,color:n,size:"sizeIcon10"})},m=T(({checked:e,children:o,helpText:r,id:n,indeterminate:s,isSelectAll:t,isSelectAllChild:d,...a},C)=>{let h=N(),l=B(u),p=a.disabled!=null?a.disabled:l.disabled,c=a.name!=null?a.name:l.name,x=a.hasError!=null?a.hasError:l.hasError,E=a.onChange!=null?a.onChange:l.onChange,f=null,k=null;return t&&(f="space20",e||s?k="colorBackgroundPrimaryLightest":p||(k="colorBackground")),d&&(f="space30"),i(g,{backgroundColor:k,borderRadius:t?"borderRadius10":null,display:"inline-flex",flexDirection:"column",padding:t?"space30":null,paddingBottom:t?"space20":null,paddingLeft:f,paddingRight:d?"space30":null,paddingTop:t?"space20":null},i(S,{...w(a),checked:e,disabled:p,name:c,onChange:E,"aria-describedby":h,"aria-checked":s?"mixed":e,"aria-invalid":x,id:n,ref:C}),i(G,{disabled:p,htmlFor:n},i(D,{alignItems:"center",borderRadius:"borderRadius10",disabled:p,position:"relative",type:"checkbox"},i(z,{checked:e,disabled:p,indeterminate:s})),i(M,{fontWeight:t?null:"fontWeightNormal"},o)),r&&i(O,{helpTextId:h},r))});m.displayName="Checkbox";import{Children as V,cloneElement as q,createElement as R,forwardRef as A,isValidElement as F,useCallback as W,useMemo as _}from"react";import{bool as xe,func as ue,oneOf as me,string as Ce}from"prop-types";import{InlineControlGroup as U}from"@twilio-paste/inline-control-group";var y=A(({children:e,disabled:o=!1,errorText:r,isSelectAll:n=!1,name:s,onChange:t,orientation:d="vertical",value:a,...C},h)=>{let l=W(c=>{t!=null&&t(c.target.checked)},[t]),p=_(()=>({disabled:o,name:s,onChange:l,hasError:r?!0:void 0}),[o,s,l]);return R(u.Provider,{value:p},R(U,{...C,disabled:o,errorText:r,name:s,orientation:d,ref:h},V.map(e,(c,x)=>F(c)?q(c,{isSelectAll:n&&x===0,isSelectAllChild:n&&d==="vertical"&&x!==0}):c)))});y.displayName="CheckboxGroup";import{Fragment as j,createElement as b,forwardRef as J}from"react";import{node as Pe,oneOfType as ve,string as Ee}from"prop-types";import{Box as P}from"@twilio-paste/box";import{HelpText as K}from"@twilio-paste/help-text";var v=J(({children:e,errorText:o,...r},n)=>b(j,null,b(P,{backgroundColor:"colorBackground",borderRadius:"borderRadius20",padding:"space50"},b(m,{...r,hasError:o!=null,ref:n},e)),o&&b(P,{marginTop:"space30",marginLeft:"space50"},b(K,{variant:"error"},o))));v.displayName="CheckboxDisclaimer";export{m as Checkbox,v as CheckboxDisclaimer,y as CheckboxGroup};

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("prop-types"),o=require("@twilio-paste/uid-library"),n=require("@twilio-paste/box"),t=require("@twilio-paste/base-radio-checkbox"),l=require("@twilio-paste/inline-control-group"),i=require("@twilio-paste/help-text"),a=function(){return(a=Object.assign||function(e){for(var r,o=1,n=arguments.length;o<n;o++)for(var t in r=arguments[o])Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e}).apply(this,arguments)};function c(e,r){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)r.indexOf(n[t])<0&&Object.prototype.propertyIsEnumerable.call(e,n[t])&&(o[n[t]]=e[n[t]])}return o}var d=function(){return(d=Object.assign||function(e){for(var r,o=1,n=arguments.length;o<n;o++)for(var t in r=arguments[o])Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e}).apply(this,arguments)},s=function(r){var o=r.display,t=r.color,l=r.size,i=function(e,r){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)r.indexOf(n[t])<0&&Object.prototype.propertyIsEnumerable.call(e,n[t])&&(o[n[t]]=e[n[t]])}return o}(r,["display","color","size"]);return e.createElement(n.Box,d({},n.safelySpreadBoxProps(i),{lineHeight:"lineHeight0",display:o,color:t,size:l}))};s.defaultProps={as:"span",display:"block",color:"currentColor",size:"sizeIcon30"},s.displayName="IconWrapper";var p=function(r){var n=r.as,t=r.display,l=r.size,i=r.color,a=r.title,c=r.decorative,d="CheckboxCheckIcon-"+o.useUID();if(!c&&null==a)throw new Error("[CheckboxCheckIcon]: Missing a title for non-decorative icon.");return e.createElement(s,{as:n,display:t,size:l,color:i},e.createElement("svg",{role:"img","aria-hidden":c,width:"100%",height:"100%",viewBox:"0 0 20 20","aria-labelledby":d},a?e.createElement("title",{id:d},a):null,e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M15.59 5.916a1.386 1.386 0 00-1.98 0l-5.04 5.138L6.39 8.83a1.38 1.38 0 00-1.98 0 1.448 1.448 0 000 2.018l3.171 3.233a1.382 1.382 0 001.98 0l6.03-6.148a1.448 1.448 0 000-2.018z"})))};p.displayName="CheckboxCheckIcon";var u=function(r){var n=r.as,t=r.display,l=r.size,i=r.color,a=r.title,c=r.decorative,d="MinusIcon-"+o.useUID();if(!c&&null==a)throw new Error("[MinusIcon]: Missing a title for non-decorative icon.");return e.createElement(s,{as:n,display:t,size:l,color:i},e.createElement("svg",{role:"img","aria-hidden":c,width:"100%",height:"100%",viewBox:"0 0 20 20","aria-labelledby":d},a?e.createElement("title",{id:d},a):null,e.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.167 9.5c.46 0 .833.448.833 1 0 .513-.322.936-.736.993l-.097.007H5.833c-.46 0-.833-.448-.833-1 0-.513.322-.936.736-.993l.097-.007h8.334z"})))};u.displayName="MinusIcon";var h=e.createContext({disabled:!1,name:void 0,hasError:void 0,onChange:function(){}}),b=e.forwardRef((function(r,o){return e.createElement(n.Box,a({},r,{ref:o,as:"input",type:"checkbox",size:"size0",border:"none",overflow:"hidden",padding:"space0",margin:"space0",whiteSpace:"nowrap",textTransform:"none",position:"absolute",clip:"rect(0 0 0 0)"}))})),m=function(r){var o=r.checked,n=r.disabled,t=r.indeterminate,l=n&&(o||t)?"colorTextInverseWeaker":"colorTextInverse";return t?e.createElement(u,{decorative:!0,color:l,size:"sizeIcon10"}):e.createElement(p,{hidden:!o,decorative:!0,color:l,size:"sizeIcon10"})},f=e.forwardRef((function(r,l){var i=r.checked,d=r.children,s=r.helpText,p=r.id,u=r.indeterminate,f=r.isSelectAll,v=r.isSelectAllChild,g=c(r,["checked","children","helpText","id","indeterminate","isSelectAll","isSelectAllChild"]),x=o.useUID(),y=e.useContext(h),E=null!=g.disabled?g.disabled:y.disabled,C=null!=g.name?g.name:y.name,k=null!=g.hasError?g.hasError:y.hasError,O=null!=g.onChange?g.onChange:y.onChange,w=null,T=null;return f&&(w="space20",i||u?T="colorBackgroundPrimaryLightest":E||(T="colorBackground")),v&&(w="space30"),e.createElement(n.Box,{backgroundColor:T,borderRadius:f?"borderRadius10":null,display:"inline-flex",flexDirection:"column",padding:f?"space30":null,paddingBottom:f?"space20":null,paddingLeft:w,paddingRight:v?"space30":null,paddingTop:f?"space20":null},e.createElement(b,a({},n.safelySpreadBoxProps(g),{checked:i,disabled:E,name:C,onChange:O,"aria-describedby":x,"aria-checked":u?"mixed":i,"aria-invalid":k,id:p,ref:l})),e.createElement(t.BaseRadioCheckboxLabel,{disabled:E,htmlFor:p},e.createElement(t.BaseRadioCheckboxControl,{alignItems:"center",borderRadius:"borderRadius10",disabled:E,position:"relative",type:"checkbox"},e.createElement(m,{checked:i,disabled:E,indeterminate:u})),e.createElement(t.BaseRadioCheckboxLabelText,{fontWeight:f?null:"fontWeightNormal"},d)),s&&e.createElement(t.BaseRadioCheckboxHelpText,{helpTextId:x},s))}));f.displayName="Checkbox","development"===process.env.NODE_ENV&&(f.propTypes={children:r.node.isRequired,disabled:r.bool,name:r.string,onChange:r.func,hasError:r.bool,helpText:r.oneOfType([r.string,r.node]),id:r.string.isRequired,indeterminate:r.bool,isSelectAll:r.bool,isSelectAllChild:r.bool});var v=e.forwardRef((function(r,o){var n=r.children,t=r.disabled,i=void 0!==t&&t,d=r.errorText,s=r.isSelectAll,p=void 0!==s&&s,u=r.name,b=r.onChange,m=r.orientation,f=void 0===m?"vertical":m,v=(r.value,c(r,["children","disabled","errorText","isSelectAll","name","onChange","orientation","value"])),g=e.useCallback((function(e){null!=b&&b(e.target.checked)}),[b]),x=e.useMemo((function(){return{disabled:i,name:u,onChange:g,hasError:!!d||void 0}}),[i,u,g]);return e.createElement(h.Provider,{value:x},e.createElement(l.InlineControlGroup,a({},v,{disabled:i,errorText:d,name:u,orientation:f,ref:o}),e.Children.map(n,(function(r,o){return e.isValidElement(r)?e.cloneElement(r,{isSelectAll:p&&0===o,isSelectAllChild:p&&"vertical"===f&&0!==o}):r}))))}));v.displayName="CheckboxGroup","development"===process.env.NODE_ENV&&(v.propTypes={isSelectAll:r.bool,name:r.string.isRequired,onChange:r.func,disabled:r.bool,errorText:r.string,helpText:r.string,orientation:r.oneOf(["vertical","horizontal"]),value:r.string});var g=e.forwardRef((function(r,o){var t=r.children,l=r.errorText,d=c(r,["children","errorText"]);return e.createElement(e.Fragment,null,e.createElement(n.Box,{backgroundColor:"colorBackground",borderRadius:"borderRadius20",padding:"space50"},e.createElement(f,a({},d,{hasError:null!=l,ref:o}),t)),l&&e.createElement(n.Box,{marginTop:"space30",marginLeft:"space50"},e.createElement(i.HelpText,{variant:"error"},l)))}));g.displayName="CheckboxDisclaimer","development"===process.env.NODE_ENV&&(g.propTypes={children:r.node.isRequired,errorText:r.oneOfType([r.string,r.node])}),exports.Checkbox=f,exports.CheckboxDisclaimer=g,exports.CheckboxGroup=v;
var le=Object.create,g=Object.defineProperty,ce=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty,pe=Object.getOwnPropertyNames,de=Object.getOwnPropertyDescriptor;var q=e=>g(e,"__esModule",{value:!0});var N=(e,o)=>()=>(o||(o={exports:{}},e(o.exports,o)),o.exports),ue=(e,o)=>{q(e);for(var r in o)g(e,r,{get:o[r],enumerable:!0})},be=(e,o,r)=>{if(q(e),o&&typeof o=="object"||typeof o=="function")for(let t of pe(o))!se.call(e,t)&&t!=="default"&&g(e,t,{get:()=>o[t],enumerable:!(r=de(o,t))||r.enumerable});return e},l=e=>e&&e.__esModule?e:be(g(e!=null?le(ce(e)):{},"default",{value:e,enumerable:!0}),e);var H=N(G=>{var he=Object.create,k=Object.defineProperty,me=Object.getPrototypeOf,fe=Object.prototype.hasOwnProperty,xe=Object.getOwnPropertyNames,Ce=Object.getOwnPropertyDescriptor,W=e=>k(e,"__esModule",{value:!0}),ye=(e,o)=>{W(e);for(var r in o)k(e,r,{get:o[r],enumerable:!0})},ge=(e,o,r)=>{if(W(e),o&&typeof o=="object"||typeof o=="function")for(let t of xe(o))!fe.call(e,t)&&t!=="default"&&k(e,t,{get:()=>o[t],enumerable:!(r=Ce(o,t))||r.enumerable});return e},S=e=>e&&e.__esModule?e:ge(k(e!=null?he(me(e)):{},"default",{value:e,enumerable:!0}),e);ye(G,{IconWrapper:()=>j});var ke=S(require("react")),V=S(require("@twilio-paste/box")),j=({display:e,color:o,size:r,...t})=>ke.createElement(V.Box,{...V.safelySpreadBoxProps(t),lineHeight:"lineHeight0",display:e,color:o,size:r});j.defaultProps={as:"span",display:"block",color:"currentColor",size:"sizeIcon30"},j.displayName="IconWrapper"});var $=N(A=>{var Pe=Object.create,P=Object.defineProperty,ve=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty,Re=Object.getOwnPropertyNames,Ie=Object.getOwnPropertyDescriptor,F=e=>P(e,"__esModule",{value:!0}),Oe=(e,o)=>{F(e);for(var r in o)P(e,r,{get:o[r],enumerable:!0})},Ee=(e,o,r)=>{if(F(e),o&&typeof o=="object"||typeof o=="function")for(let t of Re(o))!Te.call(e,t)&&t!=="default"&&P(e,t,{get:()=>o[t],enumerable:!(r=Ie(o,t))||r.enumerable});return e},z=e=>e&&e.__esModule?e:Ee(P(e!=null?Pe(ve(e)):{},"default",{value:e,enumerable:!0}),e);Oe(A,{CheckboxCheckIcon:()=>U});var v=z(require("react")),we=z(require("@twilio-paste/uid-library")),Me=z(H()),U=({as:e,display:o,size:r,color:t,title:i,decorative:n})=>{let s=`CheckboxCheckIcon-${we.useUID()}`;if(!n&&i==null)throw new Error("[CheckboxCheckIcon]: Missing a title for non-decorative icon.");return v.createElement(Me.IconWrapper,{as:e,display:o,size:r,color:t},v.createElement("svg",{role:"img","aria-hidden":n,width:"100%",height:"100%",viewBox:"0 0 20 20","aria-labelledby":s},i?v.createElement("title",{id:s},i):null,v.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M15.59 5.916a1.386 1.386 0 00-1.98 0l-5.04 5.138L6.39 8.83a1.38 1.38 0 00-1.98 0 1.448 1.448 0 000 2.018l3.171 3.233a1.382 1.382 0 001.98 0l6.03-6.148a1.448 1.448 0 000-2.018z"})))};U.displayName="CheckboxCheckIcon"});var X=N(J=>{var Be=Object.create,T=Object.defineProperty,Ne=Object.getPrototypeOf,je=Object.prototype.hasOwnProperty,He=Object.getOwnPropertyNames,ze=Object.getOwnPropertyDescriptor,K=e=>T(e,"__esModule",{value:!0}),Le=(e,o)=>{K(e);for(var r in o)T(e,r,{get:o[r],enumerable:!0})},De=(e,o,r)=>{if(K(e),o&&typeof o=="object"||typeof o=="function")for(let t of He(o))!je.call(e,t)&&t!=="default"&&T(e,t,{get:()=>o[t],enumerable:!(r=ze(o,t))||r.enumerable});return e},L=e=>e&&e.__esModule?e:De(T(e!=null?Be(Ne(e)):{},"default",{value:e,enumerable:!0}),e);Le(J,{MinusIcon:()=>Q});var R=L(require("react")),_e=L(require("@twilio-paste/uid-library")),qe=L(H()),Q=({as:e,display:o,size:r,color:t,title:i,decorative:n})=>{let s=`MinusIcon-${_e.useUID()}`;if(!n&&i==null)throw new Error("[MinusIcon]: Missing a title for non-decorative icon.");return R.createElement(qe.IconWrapper,{as:e,display:o,size:r,color:t},R.createElement("svg",{role:"img","aria-hidden":n,width:"100%",height:"100%",viewBox:"0 0 20 20","aria-labelledby":s},i?R.createElement("title",{id:s},i):null,R.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.167 9.5c.46 0 .833.448.833 1 0 .513-.322.936-.736.993l-.097.007H5.833c-.46 0-.833-.448-.833-1 0-.513.322-.936.736-.993l.097-.007h8.334z"})))};Q.displayName="MinusIcon"});ue(exports,{Checkbox:()=>O,CheckboxDisclaimer:()=>ae,CheckboxGroup:()=>te});var a=l(require("react")),f=l(require("prop-types")),Z=l(require("@twilio-paste/uid-library")),x=l(require("@twilio-paste/box")),ee=l($()),oe=l(X()),u=l(require("@twilio-paste/base-radio-checkbox"));var Y=l(require("react")),I=Y.createContext({disabled:!1,name:void 0,hasError:void 0,onChange:()=>{}});var Ge=a.forwardRef((e,o)=>a.createElement(x.Box,{...e,ref:o,as:"input",type:"checkbox",size:"size0",border:"none",overflow:"hidden",padding:"space0",margin:"space0",whiteSpace:"nowrap",textTransform:"none",position:"absolute",clip:"rect(0 0 0 0)"})),We=({checked:e,disabled:o,indeterminate:r})=>{let t=o&&(e||r)?"colorTextInverseWeaker":"colorTextInverse";return r?a.createElement(oe.MinusIcon,{decorative:!0,color:t,size:"sizeIcon10"}):a.createElement(ee.CheckboxCheckIcon,{hidden:!e,decorative:!0,color:t,size:"sizeIcon10"})},O=a.forwardRef(({checked:e,children:o,helpText:r,id:t,indeterminate:i,isSelectAll:n,isSelectAllChild:s,...p},w)=>{let C=Z.useUID(),b=a.useContext(I),h=p.disabled!=null?p.disabled:b.disabled,m=p.name!=null?p.name:b.name,y=p.hasError!=null?p.hasError:b.hasError,ie=p.onChange!=null?p.onChange:b.onChange,M=null,B=null;return n&&(M="space20",e||i?B="colorBackgroundPrimaryLightest":h||(B="colorBackground")),s&&(M="space30"),a.createElement(x.Box,{backgroundColor:B,borderRadius:n?"borderRadius10":null,display:"inline-flex",flexDirection:"column",padding:n?"space30":null,paddingBottom:n?"space20":null,paddingLeft:M,paddingRight:s?"space30":null,paddingTop:n?"space20":null},a.createElement(Ge,{...x.safelySpreadBoxProps(p),checked:e,disabled:h,name:m,onChange:ie,"aria-describedby":C,"aria-checked":i?"mixed":e,"aria-invalid":y,id:t,ref:w}),a.createElement(u.BaseRadioCheckboxLabel,{disabled:h,htmlFor:t},a.createElement(u.BaseRadioCheckboxControl,{alignItems:"center",borderRadius:"borderRadius10",disabled:h,position:"relative",type:"checkbox"},a.createElement(We,{checked:e,disabled:h,indeterminate:i})),a.createElement(u.BaseRadioCheckboxLabelText,{fontWeight:n?null:"fontWeightNormal"},o)),r&&a.createElement(u.BaseRadioCheckboxHelpText,{helpTextId:C},r))});O.displayName="Checkbox";var c=l(require("react")),E=l(require("prop-types")),re=l(require("@twilio-paste/inline-control-group"));var te=c.forwardRef(({children:e,disabled:o=!1,errorText:r,isSelectAll:t=!1,name:i,onChange:n,orientation:s="vertical",value:p,...w},C)=>{let b=c.useCallback(m=>{n!=null&&n(m.target.checked)},[n]),h=c.useMemo(()=>({disabled:o,name:i,onChange:b,hasError:r?!0:void 0}),[o,i,b]);return c.createElement(I.Provider,{value:h},c.createElement(re.InlineControlGroup,{...w,disabled:o,errorText:r,name:i,orientation:s,ref:C},c.Children.map(e,(m,y)=>c.isValidElement(m)?c.cloneElement(m,{isSelectAll:t&&y===0,isSelectAllChild:t&&s==="vertical"&&y!==0}):m)))});te.displayName="CheckboxGroup";var d=l(require("react")),D=l(require("prop-types")),_=l(require("@twilio-paste/box")),ne=l(require("@twilio-paste/help-text"));var ae=d.forwardRef(({children:e,errorText:o,...r},t)=>d.createElement(d.Fragment,null,d.createElement(_.Box,{backgroundColor:"colorBackground",borderRadius:"borderRadius20",padding:"space50"},d.createElement(O,{...r,hasError:o!=null,ref:t},e)),o&&d.createElement(_.Box,{marginTop:"space30",marginLeft:"space50"},d.createElement(ne.HelpText,{variant:"error"},o))));ae.displayName="CheckboxDisclaimer";
{
"name": "@twilio-paste/checkbox",
"version": "2.0.6",
"version": "2.0.7-beta.15+c193ca0b",
"category": "user input",

@@ -21,31 +21,9 @@ "status": "production",

"scripts": {
"build": "yarn clean && yarn compile",
"build:dev": "yarn clean && yarn compile:dev",
"build": "yarn clean && NODE_ENV=production node build.js && tsc",
"build:js": "NODE_ENV=development node build.js",
"build:props": "typedoc --tsconfig ./tsconfig.json --json ./dist/prop-types.json",
"clean": "rm -rf ./dist && rm -rf tsconfig.build.tsbuildinfo && rm -rf .rpt2_cache",
"compile": "rollup -c --environment NODE_ENV:production",
"compile:dev": "rollup -c --environment NODE_ENV:development"
"clean": "rm -rf ./dist",
"tsc": "tsc"
},
"peerDependencies": {
"@twilio-paste/base-radio-checkbox": "^2.0.5",
"@twilio-paste/box": "^2.12.2",
"@twilio-paste/design-tokens": "^6.4.1",
"@twilio-paste/flex": "^0.4.6",
"@twilio-paste/help-text": "^2.0.5",
"@twilio-paste/icons": "^3.11.1",
"@twilio-paste/inline-control-group": "^2.0.5",
"@twilio-paste/label": "^2.0.4",
"@twilio-paste/screen-reader-only": "^2.0.4",
"@twilio-paste/sibling-box": "^1.1.18",
"@twilio-paste/style-props": "^1.8.15",
"@twilio-paste/styling-library": "^0.2.1",
"@twilio-paste/text": "^2.4.2",
"@twilio-paste/theme": "^4.1.1",
"@twilio-paste/types": "^3.0.30",
"@twilio-paste/uid-library": "^0.1.2",
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-dom": "^16.8.6"
},
"devDependencies": {
"@twilio-paste/base-radio-checkbox": "^2.0.6",

@@ -71,3 +49,24 @@ "@twilio-paste/box": "^2.12.3",

},
"gitHead": "c4163904aa7c0cd4b9c4b46ffc40fe4d0db7cfb7"
"devDependencies": {
"@twilio-paste/base-radio-checkbox": "^2.0.7-beta.15+c193ca0b",
"@twilio-paste/box": "^2.12.4-beta.15+c193ca0b",
"@twilio-paste/design-tokens": "^6.4.1",
"@twilio-paste/flex": "^0.4.8-beta.15+c193ca0b",
"@twilio-paste/help-text": "^2.0.7-beta.15+c193ca0b",
"@twilio-paste/icons": "^3.11.3-beta.15+c193ca0b",
"@twilio-paste/inline-control-group": "^2.0.7-beta.15+c193ca0b",
"@twilio-paste/label": "^2.0.6-beta.15+c193ca0b",
"@twilio-paste/screen-reader-only": "^2.0.6-beta.15+c193ca0b",
"@twilio-paste/sibling-box": "^1.1.20-beta.15+c193ca0b",
"@twilio-paste/style-props": "^1.8.17-beta.15+c193ca0b",
"@twilio-paste/styling-library": "^0.2.2",
"@twilio-paste/text": "^2.4.4-beta.15+c193ca0b",
"@twilio-paste/theme": "^4.1.3-beta.15+c193ca0b",
"@twilio-paste/types": "^3.0.31",
"@twilio-paste/uid-library": "^0.1.3",
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-dom": "^16.8.6"
},
"gitHead": "c193ca0b8017f60515cb15878d35881962c087af"
}