Socket
Socket
Sign inDemoInstall

@truework/forms

Package Overview
Dependencies
112
Maintainers
5
Versions
66
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.4.2 to 1.4.3

2

dist/index.esm.js

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

import{space as n,color as o,typography as r}from"styled-system";import{useSelect as e}from"use-drop";import t,{css as i}from"styled-components";import{Span as a,H5 as l,Icon as s,Box as c,P as d,theme as p}from"@truework/ui";import{createElement as u,useRef as b,useState as h,useEffect as m,useCallback as f,Fragment as g,forwardRef as v,Children as x,cloneElement as y}from"react";import{Field as w,ErrorMessage as k}from"formik";import{get as O,times as _}from"lodash";import{clean as z,mask as j,format as B}from"parse-ssn";function C(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}var D=Object.freeze([""]),F=t(s)(D),E=t.div(function(n){var o=n.theme;return"\n position: relative;\n width: 16px;\n height: 16px;\n border-radius: 2px;\n margin-top: 2px;\n margin-right: 8px;\n border: 1px solid "+(n.checked?o.colors.primaryDark:o.colors.outline)+";\n transition-property: background, border-color;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.ease+";\n\n "+F+" {\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: auto;\n width: 12px;\n height: 12px;\n color: white;\n stroke: white;\n stroke-width: 2px;\n transition-property: transform;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.ease+";\n transform: scale(0);\n }\n "}),T=t(l)(function(n){var o=n.theme;return"\n width: calc(100% - 16px);\n transition-property: color;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.ease+";\n "}),I=t.input(function(n){var o=n.theme;return"\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n position: absolute;\n whitespace: nowrap;\n wordwrap: normal;\n\n &:focus ~ "+E+" {\n border-color: "+o.colors.primaryDark+";\n }\n &:checked ~ "+E+" {\n background: "+o.colors.primary+";\n border-color: "+o.colors.primaryDark+";\n\n "+F+" {\n transform: scale(1);\n }\n }\n &:focus ~ "+T+", &:focus ~"+a+", &:checked ~ "+a+" {\n color: "+o.colors.primary+";\n }\n\n "+(n.hasError?"\n & ~ "+E+" {\n border-color: "+o.colors.error+" !important;\n }\n ":"")+"\n "}),P=t.label(function(n){var o=n.theme;return"\n display: flex;\n align-items: flex-start;\n width: 100%;\n margin-bottom: 0 !important;\n\n "+(n.disabled?"\n "+E+" {\n background: "+o.colors.background+";\n }\n "+a+" {\n color: "+o.colors.placeholder+";\n }\n ":"\n &:hover "+E+" {\n border-color: "+o.colors.primaryDark+";\n }\n &:hover "+T+", &:hover "+a+" {\n color: "+o.colors.primary+";\n }\n ")+"\n "}),R=t.div(function(n){var o=n.theme;return"\n width: 100%;\n\n "+P+" {\n padding: "+o.space.sm+";\n border: 1px solid "+o.colors.outline+";\n border-top: none;\n display: flex;\n align-items: center;\n }\n\n "+P+":first-child {\n border-top: 1px solid "+o.colors.outline+";\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n }\n\n "+P+":last-child {\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n }\n "});function S(n){var o=n.children,r=n.name,e=n.checked,t=n.disabled,i=C(n,["children","name","checked","disabled"]);return u(P,{htmlFor:r,disabled:t},u(I,Object.assign({id:r,name:r,type:"checkbox",checked:e,disabled:t},i)),u(E,{checked:e},u(F,{name:"Check"})),u(a,{display:"block",width:"calc(100% - 16px)",fontSize:1,lineHeight:1,fontWeight:5,style:{transitionProperty:"color",transitionDuration:"150ms",transitionTimingFunction:"ease-in-out"}},o))}function N(n){var o=n.name,r=n.validate,e=n.onChange,t=n.onBlur,i=C(n,["name","validate","onChange","onBlur"]);return u(w,{name:o,validate:r},function(n){var r=n.field,a=Boolean(O(n.form,["errors",o]));return u(S,Object.assign({},i,r,{checked:Boolean(r.value),hasError:a,onChange:function(n){r.onChange(n),e&&e(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}function H(n){return n<10?"0"+n:""+n}var V=Object.freeze(["\n display: block;\n position: relative;\n font-weight: 500;\n letter-spacing: 0.6px;\n ","\n ","\n ","\n"]),M=t.label(V,r,o,n);M.displayName="Label",M.defaultProps={fontSize:1,lineHeight:1,mb:"xs"};var U=Object.freeze(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 12px;\n z-index: 1;\n height: 16px;\n width: 16px;\n margin: auto 0;\n border: 1px solid currentColor;\n border-radius: 16px;\n color: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0.5;\n transition: opacity ","\n ",";\n\n &:hover {\n opacity: 1;\n }\n "]),W=Object.freeze(["\n appearance: none;\n border: none;\n display: block;\n position: relative;\n font-family: ",";\n color: ",";\n font-size: ",";\n font-family: ",";\n line-height: ",";\n letter-spacing: 0.6px;\n margin: 0;\n min-height: 48px;\n padding: "," 8px "," 10px;\n text-align: center;\n max-width: 33.333333%;\n background: transparent;\n color: ",";\n cursor: pointer;\n z-index: 2;\n transition-property: border-color, color;\n transition-duration: 150ms;\n transition-timing-function: ease-in-out;\n\n &::-ms-expand {\n display: none;\n }\n &:disabled {\n background: transparent;\n color: ",";\n cursor: not-allowed;\n & ~ .__border {\n background: ",";\n cursor: not-allowed;\n }\n }\n &:not(:disabled):active,\n &:not(:disabled):focus,\n &:not(:disabled):hover {\n outline: 0;\n color: ",";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: ",";\n\n div {\n border-color: ",";\n color: ",";\n }\n }\n }\n "]),Y=t.select(function(n){var o=n.theme,r=n.hasError;return i(W,o.fonts.roboto,o.colors.body,o.fontSizes[1],o.fonts.mono,o.lineHeights[0],o.space.sm,o.space.sm,n.hasValue?o.colors.body:o.colors.secondary,function(n){return n.theme.colors.placeholder},o.colors.background,o.colors.body,r?o.colors.error:o.colors.primary,r?o.colors.error:o.colors.primary,r?o.colors.error:o.colors.primary)}),A=t.button(function(n){var o=n.theme;return i(U,o.colors.secondary,o.transitionDurations.fast,o.transitionTimingFunctions.ease)});function L(n){var o=n.name,r=n.label;void 0===r&&(r="Date");var e=n.disabled,t=n.initialMonth;void 0===t&&(t=0);var i=n.initialDay;void 0===i&&(i=0);var a=n.initialYear;void 0===a&&(a=0);var l=n.minMonth;void 0===l&&(l=1);var d=n.minDay;void 0===d&&(d=1);var p=n.minYear;void 0===p&&(p=1980);var g=n.maxMonth;void 0===g&&(g=12);var v=n.maxDay;void 0===v&&(v=31);var x=n.maxYear;void 0===x&&(x=2030);var y=n.hasError,w=n.onUpdate,k=b(null),O=b(null),z=b(null),j=h(t),B=j[0],C=j[1],D=h(i),F=D[0],E=D[1],T=h(a),I=T[0],P=T[1],R=function(n){return new Date(n.year,n.month,0).getUTCDate()}({year:I||2020,month:B});m(function(){w(I&&B&&F?I+"-"+H(B)+"-"+H(F):"")},[B,F,I]);var S=f(function(){C(0),E(0),P(0)},[C,E,P]);return u(c,{ml:"-4px",mr:"-4px",p:"4px"},u(c,{display:"flex",alignItems:"center",height:"48px",pl:"56px"},u(Y,{ref:k,name:o+"-month",value:B,disabled:e,onChange:function(n){C(parseInt(n.target.value,10)),O.current&&O.current.focus()},"aria-label":r+": Month",hasValue:Boolean(B),hasError:y},u("option",{value:"0",disabled:!0},"mm"),_(g-l+1,function(){return""}).map(function(n,o){var r=l+o;return u("option",{key:r,value:r},H(r))})),u(c,{height:"50%",width:"1px",bg:y?"error":"outline",zIndex:2,transform:"rotate(10deg)"}),u(Y,{ref:O,name:o+"-day",value:F,disabled:e,onChange:function(n){E(parseInt(n.target.value,10)),z.current&&z.current.focus()},"aria-label":r+": Day",hasValue:Boolean(F),hasError:y},u("option",{value:"0",disabled:!0},"dd"),_(Math.min(v,R)-d+1,function(){return""}).map(function(n,o){var r=d+o;return u("option",{key:r,value:r},H(r))})),u(c,{height:"50%",width:"1px",bg:y?"error":"outline",zIndex:2,transform:"rotate(10deg)"}),u(Y,{ref:z,name:o+"-year",value:I,disabled:e,onChange:function(n){P(parseInt(n.target.value,10))},"aria-label":r+": Year",hasValue:Boolean(I),hasError:y},u("option",{value:"0",disabled:!0},"yyyy"),_(x-p+1,function(n){return p+n}).map(function(n){return u("option",{key:n,value:n},n)})),(B||F||I)&&u(A,{title:"Clear",onClick:S},u(s,{name:"X",width:"12px",height:"12px"})),u(c,{className:"__bg",bg:y?"error-alpha01":"primary-alpha01",position:"absolute",top:"-4px",bottom:"-4px",left:"-4px",right:"-4px",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),u(c,{className:"__border",bg:"white",border:["1px solid",y?"error":"outline"],position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"},u(c,{"aria-hidden":"true",position:"absolute",top:"0",left:"0",display:"flex",alignItems:"center",justifyContent:"center",px:"sm",height:"100%",zIndex:0,color:y?"error":"secondary",bg:y?"#FDEBF0":"background",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px",borderRight:["1px solid",y?"error":"outline"],transitionProperty:"border-color, color",transitionDuration:"fast",transitionTimingFunction:"ease"},u(s,{name:"Calendar"})))))}function X(n){var o=n.name,r=n.validate,e=function(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}(n,["name","validate"]);return u(w,{name:o,validate:r},function(n){var r=n.field,t=n.form,i=Boolean(O(t,["errors",o])),a=(r.value||"").split("-"),l=a[0];void 0===l&&(l="");var s=a[1];void 0===s&&(s="");var c=a[2];return void 0===c&&(c=""),u(L,Object.assign({name:o},e,{initialMonth:s?parseInt(s,10):void 0,initialDay:c?parseInt(c,10):void 0,initialYear:l?parseInt(l,10):void 0,hasError:i,onUpdate:function(n){t.setFieldValue(o,n)}}))})}function q(n){return u(g,null,u(M,{htmlFor:n.name},n.label),u(X,Object.assign({},n)))}function G(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}var J=t(c)(function(n){var o=n.theme,r=n.selected,e=n.highlighted;return"\n display: flex;\n align-items: center;\n padding: "+o.space.sm+";\n color: "+(r||e?o.colors.body:o.colors.secondary)+";\n background-color: "+(r||e?o.colors.background:"white")+";\n cursor: pointer;\n font-size: "+o.fontSizes[1]+";\n font-weight: 400;\n line-height: "+o.lineHeights[1]+";\n letter-spacing: 0.6px;\n\n &:hover {\n background: "+o.colors.background+";\n }\n"});function K(n){var o=n.children,r=G(n,["children"]);return u(J,Object.assign({as:"li"},r),o)}var Q=v(function(n,o){var r=n.children,e=G(n,["children"]);return u(c,Object.assign({ref:o,as:"ul",boxShadow:"medium",borderRadius:2,overflow:"auto",width:"100%",bg:"white"},e),r)});Q.displayName="Body";var Z=t.button(function(n){var o=n.theme,r=n.hasError;return"\n display: block;\n position: relative;\n width: 100%;\n z-index: 1;\n height: 48px;\n padding: 0 16px;\n text-align: left;\n font-size: "+o.fontSizes[1]+";\n font-weight: 400;\n line-height: "+o.lineHeights[1]+";\n color: "+o.colors.secondary+";\n transition-property: color;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.ease+";\n\n "+(n.disabled?"\n background: transparent;\n color: "+o.colors.placeholder+";\n cursor: not-allowed;\n & ~ .__border {\n background: "+o.colors.background+";\n cursor: not-allowed;\n }\n ":"\n &:active,\n &:focus,\n &:hover {\n outline: 0;\n color: "+o.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(r?o.colors.error:o.colors.primary)+";\n\n div {\n border-color: "+(r?o.colors.error:o.colors.primary)+";\n color: "+(r?o.colors.error:o.colors.primary)+";\n }\n }\n }\n ")+"\n\n "+(n.isActive?"\n outline: 0;\n color: "+o.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(r?o.colors.error:o.colors.primary)+";\n\n div {\n border-color: "+(r?o.colors.error:o.colors.primary)+";\n color: "+(r?o.colors.error:o.colors.primary)+";\n }\n }\n ":"")+"\n"});Z.displayName="ControlOuter";var $=v(function(n,o){var r=n.children,e=n.isActive,t=n.hasError,i=G(n,["children","isActive","hasError"]);return u("div",{style:{position:"relative"}},u(Z,Object.assign({ref:o,isActive:e,hasError:t,type:"button"},i),u(a,{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},u(a,{width:"100%",fontWeight:4,style:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",letterSpacing:"0.6px"}},r),u(s,{name:"ChevronDown",ml:"xs"}))),u(c,{className:"__bg",bg:t?"error-alpha01":"primary-alpha01",position:"absolute",top:"-2px",bottom:"-2px",left:"-2px",right:"-2px",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),u(c,{className:"__border",bg:"white",border:["1px solid",t?"error":"outline"],position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"}))});function nn(n){var o=n.value,r=n.placeholder,t=n.label,i=n.items,a=n.hasError,l=n.disabled,s=n.onSelect,d=n.onRemove,p=h(O(i.filter(function(n){return n.value===o})[0],"label")||r||"Please select"),b=p[0],m=p[1],f=e({items:i.map(function(n){return Object.assign({},n,{selected:n.value===o})}),onSelect:function(n){m(n.label),s&&s(n)},onRemove:function(n){m("Please select"),d&&d(n)}}),g=f.items,v=f.isOpen,x=f.getDropProps;return u(c,null,u($,Object.assign({id:f.id},l?{}:(0,f.getControlProps)(),{"aria-label":t,isActive:v,hasError:a,disabled:l}),b),v&&u(c,{position:"absolute",bottom:"0",width:"100%",transform:"translateY(100%) translateY(6px)",zIndex:1e3},u(Q,Object.assign({},x(),{style:{maxHeight:"240px",overflow:"auto"}}),g.map(function(n){return u(K,Object.assign({key:n.value,selected:n.selected,highlighted:n.highlighted},n.getItemProps()),n.label)}))))}function on(n){var o=n.name,r=n.validate,e=G(n,["name","validate"]);return u(w,{name:o,validate:r},function(n){var o=n.field,r=n.form,t=Boolean(r.errors&&r.errors[o.name]);return u(nn,Object.assign({},e,{hasError:t,onSelect:function(n){r.setFieldValue(o.name,n.value),e.onSelect&&e.onSelect(n)}}))})}function rn(n){return u(g,null,u(M,{htmlFor:n.name},n.label),u(on,Object.assign({},n)))}function en(n){return u(k,{name:n.name,render:function(n){return u(a,{color:"error",fontSize:0},n)}})}function tn(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}$.displayName="Control";var an=t.input(function(n){var o=n.theme,r=n.small,e=n.hasError;return"\n appearance: none;\n border: none;\n display: block;\n position: relative;\n font-family: "+o.fonts.roboto+";\n color: "+o.colors.body+";\n font-size: "+(r?o.fontSizes[0]:o.fontSizes[1])+";\n line-height: "+o.lineHeights[0]+";\n letter-spacing: 0.6px;\n width: 100%;\n margin: 0;\n min-height: "+(r?"36px":"48px")+";\n padding: "+(r?"10px 16px":o.space.sm)+";\n background: transparent;\n color: "+(n.hasValue?o.colors.body:o.colors.secondary)+";\n cursor: pointer;\n z-index: 2;\n transition-property: border-color, color;\n transition-duration: 150ms;\n transition-timing-function: ease-in-out;\n\n &::placeholder {\n color: "+o.colors.secondary+";\n line-height: "+o.lineHeights[0]+";\n opacity: 1;\n }\n &:-webkit-autofill {\n -webkit-text-fill-color: "+o.colors.body+";\n -webkit-box-shadow: 0 0 0px 1000px #fff inset;\n }\n &:disabled {\n background: transparent;\n color: "+o.colors.placeholder+";\n cursor: not-allowed;\n & ~ .__border {\n background: "+o.colors.background+";\n cursor: not-allowed;\n }\n }\n &:invalid,\n &:not(:disabled):active,\n &:not(:disabled):focus,\n &:not(:disabled):hover {\n box-shadow: none;\n outline: 0;\n color: "+o.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(e?o.colors.error:o.colors.primary)+";\n }\n & ~ .__tab {\n border-color: "+(e?o.colors.error:o.colors.primary)+";\n color: "+(e?o.colors.error:o.colors.primary)+";\n }\n }\n "+(r?"\n & ~ .__tab {\n padding: 10px;\n }\n ":"")+"\n\n & ~ .__tab svg {\n max-width: "+(r?"14px":"16px")+";\n max-height: "+(r?"14px":"16px")+";\n }\n"});an.displayName="InputElement";var ln=v(function(n,o){var r=n.hasError,e=n.preTab,t=n.postTab,i=tn(n,["hasError","preTab","postTab"]),a=Boolean(e),l=e||t;return u(c,{display:"flex",ml:"-2px",mr:"-2px",p:"2px"},u(an,Object.assign({ref:o,hasError:r},i)),l&&u(c,{className:"__tab","aria-hidden":"true",display:"flex",alignItems:"center",justifyContent:"center",px:"sm",zIndex:1,color:r?"error":"secondary",bg:r?"#FDEBF0":"background",borderTopLeftRadius:a?"4px":"0",borderBottomLeftRadius:a?"4px":"0",borderTopRightRadius:a?"0":"4px",borderBottomRightRadius:a?"0":"4px",border:["1px solid",r?"error":"outline"],order:a?-1:1,transitionProperty:"border-color, color",transitionDuration:"fast",transitionTimingFunction:"ease"},l),u(c,{className:"__bg",bg:r?"error-alpha01":"primary-alpha01",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),u(c,{className:"__border",bg:"white",border:["1px solid",r?"error":"outline"],position:"absolute",top:"2px",bottom:"2px",left:"2px",right:"2px",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"}))});function sn(n){var o=n.name,r=n.validate,e=n.onChange,t=n.onBlur,i=tn(n,["name","validate","onChange","onBlur"]);return u(w,{name:o,validate:r},function(n){var r=n.field,a=Boolean(O(n.form,["errors",o]));return u(ln,Object.assign({},i,r,{hasError:a,onChange:function(n){r.onChange(n),e&&e(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}function cn(n){return u(g,null,u(M,{htmlFor:n.name},n.label),u(sn,Object.assign({},n)))}function dn(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}var pn=Object.freeze(["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n cursor: pointer;\n z-index: 0;\n"]),un=t.span(function(n){var o=n.theme;return"\n display: block;\n font-size: "+o.fontSizes[1]+";\n font-weight: "+o.fontWeights[5]+";\n line-height: "+o.lineHeights[0]+";\n transition-property: color;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.ease+";\n "}),bn=t.div(function(n){var o=n.theme;return"\n width: 100%;\n border: 1px solid "+o.colors.outline+";\n border-radius: 4px;\n\n "+gn+" {\n padding: "+o.space.sm+";\n border-top: 1px solid "+o.colors.outline+";\n\n &:first-of-type {\n border-top: 0;\n }\n }\n\n "+(n.hasError?"\n border-color: "+o.colors.error+" !important;\n\n & "+gn+" {\n border-color: "+o.colors.error+" !important;\n }\n ":"")+"\n "}),hn=t.div(function(n){var o=n.theme;return"\n position: relative;\n width: 16px;\n height: 16px;\n border-radius: 100%;\n margin-top: 2px;\n margin-right: 16px;\n border: 1px solid "+(n.checked?o.colors.primaryDark:o.colors.outline)+";\n z-index: 1;\n transition-property: background, border-color;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.ease+";\n\n &::after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: auto;\n width: 8px;\n height: 8px;\n border-radius: 100%;\n background: white;\n transition-property: transform;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.ease+";\n transform: scale(0);\n }\n "}),mn=t.input(function(n){var o=n.theme;return"\n position: relative;\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n position: absolute;\n whitespace: nowrap;\n wordwrap: normal;\n z-index: 1;\n\n &:focus ~ "+hn+" {\n border-color: "+o.colors.primaryDark+";\n }\n &:focus ~ "+c+" "+un+" {\n color: "+o.colors.primary+";\n }\n\n &:checked ~ "+hn+" {\n background: "+o.colors.primary+";\n border-color: "+o.colors.primaryDark+";\n\n &::after {\n transform: scale(1);\n }\n }\n &:checked ~ "+c+" "+un+" {\n color: "+o.colors.primary+";\n }\n\n &:disabled ~ "+hn+" {\n border-color: "+o.colors.outline+" !important;\n }\n &:disabled ~ "+fn+" {\n background-color: "+o.colors.background+";\n }\n &:disabled ~ "+c+" "+un+" {\n color: "+o.colors.secondary+" !important;\n }\n "}),fn=t.span(pn),gn=t.label(function(n){var o=n.theme;return"\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n margin-bottom: 0 !important;\n cursor: pointer;\n overflow: hidden;\n\n &:hover "+hn+" {\n border-color: "+o.colors.primaryDark+";\n }\n &:hover "+un+" {\n color: "+o.colors.primary+";\n }\n "});function vn(n){var o=n.name,r=n.checked,e=n.description,t=n.label,i=dn(n,["children","name","checked","description","label"]),a=o+i.value;return u(gn,{htmlFor:a},u(mn,Object.assign({id:a,name:o,type:"radio",checked:r},i)),u(hn,{checked:r}),u(c,{display:"block",position:"relative",zIndex:1,width:"calc(100% - 32px)",maxWidth:"calc(100% - 32px)"},t&&u(un,null,t),e&&u(d,{mt:"xxs",color:"secondary",fontSize:0,fontWeight:4,lineHeight:0},e)),u(fn,null))}function xn(n){var o=n.children,r=n.name,e=n.validate,t=n.onChange,i=n.onBlur,a=dn(n,["children","name","validate","onChange","onBlur"]);return u(w,{name:r,validate:e},function(n){var e=n.field,l=Boolean(O(n.form,["errors",r]));return u(bn,{hasError:l},x.toArray(o).map(function(n){return y(n,Object.assign({},e,a,{value:n.props.value,hasError:l,checked:Boolean(e.value===n.props.value),onChange:function(n){e.onChange(n),t&&t(n)},onBlur:function(n){e.onBlur(n),i&&i(n)}}))}))})}function yn(n){var o=n.label,r=dn(n,["label"]);return u(g,null,u(M,{htmlFor:r.name},o),u(xn,Object.assign({},r)))}function wn(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}var kn=t.select(function(n){var o=n.theme,r=n.hasError;return"\n appearance: none;\n border: none;\n display: block;\n position: relative;\n font-family: "+o.fonts.roboto+";\n color: "+o.colors.body+";\n font-size: "+o.fontSizes[1]+";\n line-height: "+o.lineHeights[0]+";\n letter-spacing: 0.6px;\n width: 100%;\n margin: 0;\n min-height: 48px;\n padding: "+o.space.sm+";\n background: transparent;\n color: "+(n.hasValue?o.colors.body:o.colors.secondary)+";\n cursor: pointer;\n z-index: 2;\n transition-property: border-color, color;\n transition-duration: 150ms;\n transition-timing-function: ease-in-out;\n\n &::placeholder {\n color: "+o.colors.secondary+";\n line-height: "+o.lineHeights[0]+";\n opacity: 1;\n }\n &:-webkit-autofill {\n -webkit-text-fill-color: "+o.colors.body+";\n -webkit-box-shadow: 0 0 0px 1000px #fff inset;\n }\n &:disabled {\n background: transparent;\n color: "+o.colors.placeholder+";\n cursor: not-allowed;\n & ~ .__border {\n background: "+o.colors.background+";\n cursor: not-allowed;\n }\n }\n &:invalid,\n &:-moz-ui-invalid,\n &:not(:disabled):active,\n &:not(:disabled):focus,\n &:not(:disabled):hover {\n box-shadow: none;\n outline: 0;\n color: "+o.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(r?o.colors.error:o.colors.primary)+";\n\n div {\n border-color: "+(r?o.colors.error:o.colors.primary)+";\n color: "+(r?o.colors.error:o.colors.primary)+";\n }\n }\n }\n\n "+(n.small&&"\n height: 36px;\n min-height: 36px;\n padding: 0px 32px 0 16px;\n margin-right: 16px;\n font-size: "+o.fontSizes[0]+";\n line-height: "+o.lineHeights[0]+";\n ")+"\n"});kn.displayName="SelectElement";var On=v(function(n,o){var r=n.children,e=n.hasError,t=n.placeholder;void 0===t&&(t="");var i=wn(n,["children","hasError","placeholder"]);return u(c,{ml:"-2px",mr:"-2px",p:"2px"},u(kn,Object.assign({ref:o,hasValue:Boolean(i.value),hasError:e},i,{value:i.value||""}),t&&u("option",{value:"",disabled:!0},t),r),u(c,{className:"__bg",bg:e?"error-alpha01":"primary-alpha01",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),u(c,{className:"__border",bg:"white",border:["1px solid",e?"error":"outline"],position:"absolute",top:"2px",bottom:"2px",left:"2px",right:"2px",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"}),u(c,{position:"absolute",right:"0",top:"0",bottom:"0",height:"16px",my:"auto",pr:"sm",style:{pointerEvents:"none"}},u(s,{name:"ChevronDown",color:"secondary"})))});function _n(n){var o=n.name,r=n.validate,e=n.onChange,t=n.onBlur,i=wn(n,["name","validate","onChange","onBlur"]);return u(w,{name:o,validate:r},function(n){var r=n.field,a=Boolean(O(n.form,["errors",o]));return u(On,Object.assign({},i,r,{hasError:a,onChange:function(n){r.onChange(n),e&&e(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}function zn(n){return u(g,null,u(M,{htmlFor:n.name},n.label),u(_n,Object.assign({},n)))}var jn=t(c)(function(n){return"\n border-left: 2px solid currentColor;\n padding-left: "+n.theme.space.sm+";\n "});function Bn(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}var Cn=t.textarea(function(n){var o=n.theme,r=n.hasError;return"\n appearance: none;\n border: none;\n display: block;\n position: relative;\n font-family: "+o.fonts.roboto+";\n color: "+o.colors.body+";\n font-size: "+o.fontSizes[1]+";\n line-height: "+o.lineHeights[0]+";\n letter-spacing: 0.6px;\n width: 100%;\n margin: 0;\n min-height: 48px;\n padding: "+o.space.sm+";\n background: transparent;\n color: "+(n.hasValue?o.colors.body:o.colors.secondary)+";\n cursor: pointer;\n z-index: 2;\n transition-property: border-color, color;\n transition-duration: 150ms;\n transition-timing-function: ease-in-out;\n\n &::placeholder {\n color: "+o.colors.secondary+";\n line-height: "+o.lineHeights[0]+";\n opacity: 1;\n }\n &:-webkit-autofill {\n -webkit-text-fill-color: "+o.colors.body+";\n -webkit-box-shadow: 0 0 0px 1000px #fff inset;\n }\n &:disabled {\n background: transparent;\n color: "+o.colors.placeholder+";\n cursor: not-allowed;\n & ~ .__border {\n background: "+o.colors.background+";\n cursor: not-allowed;\n }\n }\n &:invalid,\n &:-moz-ui-invalid,\n &:not(:disabled):active,\n &:not(:disabled):focus,\n &:not(:disabled):hover {\n box-shadow: none;\n outline: 0;\n color: "+o.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(r?o.colors.error:o.colors.primary)+";\n\n div {\n border-color: "+(r?o.colors.error:o.colors.primary)+";\n color: "+(r?o.colors.error:o.colors.primary)+";\n }\n }\n }\n"});Cn.displayName="TextareaElement",Cn.defaultProps={rows:4};var Dn=v(function(n,o){var r=n.hasError,e=Bn(n,["hasError"]);return u(c,{ml:"-2px",mr:"-2px",p:"2px"},u(Cn,Object.assign({ref:o,hasError:r},e)),u(c,{className:"__bg",bg:r?"error-alpha01":"primary-alpha01",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),u(c,{className:"__border",bg:"white",border:["1px solid",r?"error":"outline"],position:"absolute",top:"2px",bottom:"2px",left:"2px",right:"2px",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"}))});function Fn(n){var o=n.name,r=n.validate,e=n.onChange,t=n.onBlur,i=Bn(n,["name","validate","onChange","onBlur"]);return u(w,{name:o,validate:r},function(n){var r=n.field,a=Boolean(O(n.form,["errors",o]));return u(Dn,Object.assign({},i,r,{hasError:a,onChange:function(n){r.onChange(n),e&&e(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}function En(n){return u(g,null,u(M,{htmlFor:n.name},n.label),u(Fn,Object.assign({},n)))}function Tn(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}var In=Object.freeze(["\n margin: 0;\n padding: 0;\n appearance: none;\n\n &:checked\n ~ ",",\n &:hover\n ~ ",",\n &:focus\n ~ "," {\n border: 1px solid ",";\n background-color: rgb(91, 99, 254, 0.1);\n }\n\n &:checked ~ "," {\n color: ",";\n }\n"]),Pn=Object.freeze(["\n width: 100%;\n height: 100%;\n padding: "," ",";\n top: 0px;\n position: absolute;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n color: ",";\n background-color: ",";\n border: 1px solid ",";\n border-radius: ",";\n\n transition-property: color, background-color, border-color;\n transition-duration: ",";\n transition-timing-function: ",";\n"]),Rn=Object.freeze(["\n width: 100%;\n height: 100%;\n position: relative;\n display: block;\n cursor: pointer;\n"]),Sn=t.label(Rn),Nn=t.div(Pn,p.space.med,p.space.sm,p.colors.body,p.colors.background,p.colors.outline,p.space.xxs,p.transitionDurations.fast,p.transitionTimingFunctions.ease),Hn=t.input(In,Nn,Nn,Nn,p.colors.primary,Nn,p.colors.primary);function Vn(n){var o=n.id,r=n.icon,e=n.label,t=Tn(n,["id","icon","label","width","height"]);return u(Sn,{htmlFor:o},u(Hn,Object.assign({id:o,type:"radio"},t)),u(Nn,null,r&&u(c,{mb:"xs",backgroundColor:"white",width:"48px",height:"48px",borderRadius:"50%",display:"flex",justifyContent:"center",alignItems:"center"},r),u(a,{display:"flex",alignItems:"center",minHeight:"32px",fontSize:0,fontWeight:5,lineHeight:0},e)))}function Mn(n){var o=n.name,r=n.validate,e=n.onChange,t=n.onBlur,i=Tn(n,["name","validate","onChange","onBlur"]);return u(w,{name:o,validate:r},function(n){var o=n.field;return u(Vn,Object.assign({},i,o,{onChange:function(n){o.onChange(n),e&&e(n)},onBlur:function(n){o.onBlur(n),t&&t(n)}}))})}var Un=Object.freeze(["\n ","\n"]),Wn="\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n position: absolute;\n whitespace: nowrap;\n wordwrap: normal;\n",Yn=t.div(function(n){var o=n.theme;return"\n display: block;\n position: absolute;\n top: 3px;\n bottom: 0;\n left: 3px;\n width: 24px;\n height: 24px;\n border-radius: 100px;\n border: 1px solid "+o.colors.outline+";\n color: white;\n background: white;\n stroke: white;\n transition-property: transform, background, border-color;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.natural+";\n"}),An=t.div(function(n){var o=n.theme;return"\n position: relative;\n width: 56px;\n height: 32px;\n border-radius: 100px;\n border: 1px solid "+o.colors.outline+";\n background: "+o.colors.background+";\n cursor: pointer;\n transition-property: background, border-color;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.natural+";\n "}),Ln=t.label(function(n){return"\n display: flex;\n align-items: center;\n margin-bottom: 0 !important;\n\n &:hover "+An+" {\n "+Yn+" {\n border-color: "+n.theme.colors.primaryDark+";\n }\n }\n "}),Xn=t.input(function(n){var o=n.theme;return"\n "+Wn+"\n\n &:focus ~ "+An+" {\n border-color: "+o.colors.primary+";\n }\n &:checked ~ "+An+" {\n border-color: "+o.colors.primary+";\n\n "+Yn+" {\n background: "+o.colors.primary+";\n border-color: "+o.colors.primaryDark+";\n transform: translateX(24px);\n }\n }\n &:disabled ~ "+An+" {\n pointer-events: none;\n "+Yn+" {\n border-color: "+o.colors.outline+";\n }\n }\n "}),qn=t.span(Un,Wn);function Gn(n){var o=n.label,r=n.name,e=n.checked,t=function(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}(n,["label","name","checked"]);return u(Ln,{htmlFor:r},u(Xn,Object.assign({id:r,name:r,type:"checkbox",checked:e},t)),u(An,null,u(Yn,null,u(s,{name:"Check",width:"12px",height:"12px",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",m:"auto",style:{strokeWidth:"2px"}}))),u(qn,null,o))}function Jn(n){var o=n.label;return u(w,{name:n.name,validate:n.validate},function(n){var r=n.field;return u(Gn,Object.assign({label:o},r,{checked:Boolean(r.value)}))})}function Kn(n){var o=n.value;void 0===o&&(o="");var r=n.masker;void 0===r&&(r="*");var e=n.separator;void 0===e&&(e="-");var t=h(o),i=t[0],a=t[1],l=h(!1),s=l[1],c=l[0]?i:B(j(i,r),e),d=f(function(){s(!0)},[s]),p=f(function(){s(!1)},[s]);return m(function(){n.onUpdate&&n.onUpdate(i)},[i,n.onUpdate]),u(ln,Object.assign({},n,{value:c,onFocus:d,onClick:d,onBlur:p,onChange:function(n){a(z(n.target.value))}}))}function Qn(n){var o=n.name,r=n.validate,e=function(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}(n,["name","validate"]);return u(w,{name:o,validate:r},function(n){var r=n.field,t=n.form,i=Boolean(O(t,["errors",o])),a=f(function(n){t.setFieldValue(o,n)},[o,t.setFieldValue]);return u(Kn,Object.assign({},e,r,{hasError:i,onUpdate:a}))})}function Zn(n){return u(g,null,u(M,{htmlFor:n.name},n.label),u(Qn,Object.assign({},n)))}export{R as CheckboxGroup,S as Checkbox,N as CheckboxField,L as DateInput,X as DateInputField,q as DateInputFieldWithLabel,K as Item,Q as Body,$ as Control,nn as Dropdown,on as DropdownField,rn as DropdownFieldWithLabel,en as ErrorMessage,ln as Input,sn as InputField,cn as InputFieldWithLabel,M as Label,vn as Radio,xn as RadioField,yn as RadioFieldWithLabel,On as Select,_n as SelectField,zn as SelectFieldWithLabel,jn as SubGroup,Dn as Textarea,Fn as TextareaField,En as TextareaFieldWithLabel,Vn as Tile,Mn as TileField,Wn as hidden,Gn as Toggle,Jn as ToggleField,Kn as SSNInput,Qn as SSNInputField,Zn as SSNInputFieldWithLabel};
import{space as n,color as o,typography as r}from"styled-system";import{useSelect as e}from"use-drop";import t,{css as i}from"styled-components";import{Span as a,H5 as l,Icon as s,Box as c,P as d,Circle as p}from"@truework/ui";import{createElement as u,useRef as b,useState as h,useEffect as m,useCallback as f,Fragment as g,forwardRef as v,Children as x,cloneElement as y}from"react";import{Field as w,ErrorMessage as k}from"formik";import{get as O,times as _}from"lodash";import{clean as z,mask as j,format as D}from"parse-ssn";function E(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}var F=Object.freeze([""]),B=t(s)(F),C=t.div(function(n){var o=n.theme;return"\n position: relative;\n width: 16px;\n height: 16px;\n border-radius: 2px;\n margin-top: 2px;\n margin-right: 8px;\n border: 1px solid "+(n.checked?o.colors.primaryDark:o.colors.outline)+";\n transition-property: background, border-color;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.ease+";\n\n "+B+" {\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: auto;\n width: 12px;\n height: 12px;\n color: white;\n stroke: white;\n stroke-width: 2px;\n transition-property: transform;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.ease+";\n transform: scale(0);\n }\n "}),T=t(l)(function(n){var o=n.theme;return"\n width: calc(100% - 16px);\n transition-property: color;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.ease+";\n "}),I=t.input(function(n){var o=n.theme;return"\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n position: absolute;\n whitespace: nowrap;\n wordwrap: normal;\n\n &:focus ~ "+C+" {\n border-color: "+o.colors.primaryDark+";\n }\n &:checked ~ "+C+" {\n background: "+o.colors.primary+";\n border-color: "+o.colors.primaryDark+";\n\n "+B+" {\n transform: scale(1);\n }\n }\n &:focus ~ "+T+", &:focus ~"+a+", &:checked ~ "+a+" {\n color: "+o.colors.primary+";\n }\n\n "+(n.hasError?"\n & ~ "+C+" {\n border-color: "+o.colors.error+" !important;\n }\n ":"")+"\n "}),P=t.label(function(n){var o=n.theme;return"\n display: flex;\n align-items: flex-start;\n width: 100%;\n margin-bottom: 0 !important;\n\n "+(n.disabled?"\n "+C+" {\n background: "+o.colors.background+";\n }\n "+a+" {\n color: "+o.colors.placeholder+";\n }\n ":"\n &:hover "+C+" {\n border-color: "+o.colors.primaryDark+";\n }\n &:hover "+T+", &:hover "+a+" {\n color: "+o.colors.primary+";\n }\n ")+"\n "}),S=t.div(function(n){var o=n.theme;return"\n width: 100%;\n\n "+P+" {\n padding: "+o.space.sm+";\n border: 1px solid "+o.colors.outline+";\n border-top: none;\n display: flex;\n align-items: center;\n }\n\n "+P+":first-child {\n border-top: 1px solid "+o.colors.outline+";\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n }\n\n "+P+":last-child {\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n }\n "});function R(n){var o=n.children,r=n.name,e=n.checked,t=n.disabled,i=E(n,["children","name","checked","disabled"]);return u(P,{htmlFor:r,disabled:t},u(I,Object.assign({id:r,name:r,type:"checkbox",checked:e,disabled:t},i)),u(C,{checked:e},u(B,{name:"Check"})),u(a,{display:"block",width:"calc(100% - 16px)",fontSize:1,lineHeight:1,fontWeight:5,style:{transitionProperty:"color",transitionDuration:"150ms",transitionTimingFunction:"ease-in-out"}},o))}function N(n){var o=n.name,r=n.validate,e=n.onChange,t=n.onBlur,i=E(n,["name","validate","onChange","onBlur"]);return u(w,{name:o,validate:r},function(n){var r=n.field,a=Boolean(O(n.form,["errors",o]));return u(R,Object.assign({},i,r,{checked:Boolean(r.value),hasError:a,onChange:function(n){r.onChange(n),e&&e(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}function H(n){return n<10?"0"+n:""+n}var V=Object.freeze(["\n display: block;\n position: relative;\n font-weight: 500;\n letter-spacing: 0.6px;\n ","\n ","\n ","\n"]),M=t.label(V,r,o,n);M.displayName="Label",M.defaultProps={fontSize:1,lineHeight:1,mb:"xs"};var U=Object.freeze(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 12px;\n z-index: 1;\n height: 16px;\n width: 16px;\n margin: auto 0;\n border: 1px solid currentColor;\n border-radius: 16px;\n color: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0.5;\n transition: opacity ","\n ",";\n\n &:hover {\n opacity: 1;\n }\n "]),W=Object.freeze(["\n appearance: none;\n border: none;\n display: block;\n position: relative;\n font-family: ",";\n color: ",";\n font-size: ",";\n font-family: ",";\n line-height: ",";\n letter-spacing: 0.6px;\n margin: 0;\n min-height: 48px;\n padding: "," 8px "," 10px;\n text-align: center;\n max-width: 33.333333%;\n background: transparent;\n color: ",";\n cursor: pointer;\n z-index: 2;\n transition-property: border-color, color;\n transition-duration: 150ms;\n transition-timing-function: ease-in-out;\n\n &::-ms-expand {\n display: none;\n }\n &:disabled {\n background: transparent;\n color: ",";\n cursor: not-allowed;\n & ~ .__border {\n background: ",";\n cursor: not-allowed;\n }\n }\n &:not(:disabled):active,\n &:not(:disabled):focus,\n &:not(:disabled):hover {\n outline: 0;\n color: ",";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: ",";\n\n div {\n border-color: ",";\n color: ",";\n }\n }\n }\n "]),Y=t.select(function(n){var o=n.theme,r=n.hasError;return i(W,o.fonts.roboto,o.colors.body,o.fontSizes[1],o.fonts.mono,o.lineHeights[0],o.space.sm,o.space.sm,n.hasValue?o.colors.body:o.colors.secondary,function(n){return n.theme.colors.placeholder},o.colors.background,o.colors.body,r?o.colors.error:o.colors.primary,r?o.colors.error:o.colors.primary,r?o.colors.error:o.colors.primary)}),A=t.button(function(n){var o=n.theme;return i(U,o.colors.secondary,o.transitionDurations.fast,o.transitionTimingFunctions.ease)});function L(n){var o=n.name,r=n.label;void 0===r&&(r="Date");var e=n.disabled,t=n.initialMonth;void 0===t&&(t=0);var i=n.initialDay;void 0===i&&(i=0);var a=n.initialYear;void 0===a&&(a=0);var l=n.minMonth;void 0===l&&(l=1);var d=n.minDay;void 0===d&&(d=1);var p=n.minYear;void 0===p&&(p=1980);var g=n.maxMonth;void 0===g&&(g=12);var v=n.maxDay;void 0===v&&(v=31);var x=n.maxYear;void 0===x&&(x=2030);var y=n.hasError,w=n.onUpdate,k=b(null),O=b(null),z=b(null),j=h(t),D=j[0],E=j[1],F=h(i),B=F[0],C=F[1],T=h(a),I=T[0],P=T[1],S=function(n){return new Date(n.year,n.month,0).getUTCDate()}({year:I||2020,month:D});m(function(){w(I&&D&&B?I+"-"+H(D)+"-"+H(B):"")},[D,B,I]);var R=f(function(){E(0),C(0),P(0)},[E,C,P]);return u(c,{ml:"-4px",mr:"-4px",p:"4px"},u(c,{display:"flex",alignItems:"center",height:"48px",pl:"56px"},u(Y,{ref:k,name:o+"-month",value:D,disabled:e,onChange:function(n){E(parseInt(n.target.value,10)),O.current&&O.current.focus()},"aria-label":r+": Month",hasValue:Boolean(D),hasError:y},u("option",{value:"0",disabled:!0},"mm"),_(g-l+1,function(){return""}).map(function(n,o){var r=l+o;return u("option",{key:r,value:r},H(r))})),u(c,{height:"50%",width:"1px",bg:y?"error":"outline",zIndex:2,transform:"rotate(10deg)"}),u(Y,{ref:O,name:o+"-day",value:B,disabled:e,onChange:function(n){C(parseInt(n.target.value,10)),z.current&&z.current.focus()},"aria-label":r+": Day",hasValue:Boolean(B),hasError:y},u("option",{value:"0",disabled:!0},"dd"),_(Math.min(v,S)-d+1,function(){return""}).map(function(n,o){var r=d+o;return u("option",{key:r,value:r},H(r))})),u(c,{height:"50%",width:"1px",bg:y?"error":"outline",zIndex:2,transform:"rotate(10deg)"}),u(Y,{ref:z,name:o+"-year",value:I,disabled:e,onChange:function(n){P(parseInt(n.target.value,10))},"aria-label":r+": Year",hasValue:Boolean(I),hasError:y},u("option",{value:"0",disabled:!0},"yyyy"),_(x-p+1,function(n){return p+n}).map(function(n){return u("option",{key:n,value:n},n)})),(D||B||I)&&u(A,{title:"Clear",onClick:R},u(s,{name:"X",width:"12px",height:"12px"})),u(c,{className:"__bg",bg:y?"error-alpha01":"primary-alpha01",position:"absolute",top:"-4px",bottom:"-4px",left:"-4px",right:"-4px",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),u(c,{className:"__border",bg:"white",border:["1px solid",y?"error":"outline"],position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"},u(c,{"aria-hidden":"true",position:"absolute",top:"0",left:"0",display:"flex",alignItems:"center",justifyContent:"center",px:"sm",height:"100%",zIndex:0,color:y?"error":"secondary",bg:y?"#FDEBF0":"background",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px",borderRight:["1px solid",y?"error":"outline"],transitionProperty:"border-color, color",transitionDuration:"fast",transitionTimingFunction:"ease"},u(s,{name:"Calendar"})))))}function X(n){var o=n.name,r=n.validate,e=function(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}(n,["name","validate"]);return u(w,{name:o,validate:r},function(n){var r=n.field,t=n.form,i=Boolean(O(t,["errors",o])),a=(r.value||"").split("-"),l=a[0];void 0===l&&(l="");var s=a[1];void 0===s&&(s="");var c=a[2];return void 0===c&&(c=""),u(L,Object.assign({name:o},e,{initialMonth:s?parseInt(s,10):void 0,initialDay:c?parseInt(c,10):void 0,initialYear:l?parseInt(l,10):void 0,hasError:i,onUpdate:function(n){t.setFieldValue(o,n)}}))})}function q(n){return u(g,null,u(M,{htmlFor:n.name},n.label),u(X,Object.assign({},n)))}function G(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}var J=t(c)(function(n){var o=n.theme,r=n.selected,e=n.highlighted;return"\n display: flex;\n align-items: center;\n padding: "+o.space.sm+";\n color: "+(r||e?o.colors.body:o.colors.secondary)+";\n background-color: "+(r||e?o.colors.background:"white")+";\n cursor: pointer;\n font-size: "+o.fontSizes[1]+";\n font-weight: 400;\n line-height: "+o.lineHeights[1]+";\n letter-spacing: 0.6px;\n\n &:hover {\n background: "+o.colors.background+";\n }\n"});function K(n){var o=n.children,r=G(n,["children"]);return u(J,Object.assign({as:"li"},r),o)}var Q=v(function(n,o){var r=n.children,e=G(n,["children"]);return u(c,Object.assign({ref:o,as:"ul",boxShadow:"medium",borderRadius:2,overflow:"auto",width:"100%",bg:"white"},e),r)});Q.displayName="Body";var Z=t.button(function(n){var o=n.theme,r=n.hasError;return"\n display: block;\n position: relative;\n width: 100%;\n z-index: 1;\n height: 48px;\n padding: 0 16px;\n text-align: left;\n font-size: "+o.fontSizes[1]+";\n font-weight: 400;\n line-height: "+o.lineHeights[1]+";\n color: "+o.colors.secondary+";\n transition-property: color;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.ease+";\n\n "+(n.disabled?"\n background: transparent;\n color: "+o.colors.placeholder+";\n cursor: not-allowed;\n & ~ .__border {\n background: "+o.colors.background+";\n cursor: not-allowed;\n }\n ":"\n &:active,\n &:focus,\n &:hover {\n outline: 0;\n color: "+o.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(r?o.colors.error:o.colors.primary)+";\n\n div {\n border-color: "+(r?o.colors.error:o.colors.primary)+";\n color: "+(r?o.colors.error:o.colors.primary)+";\n }\n }\n }\n ")+"\n\n "+(n.isActive?"\n outline: 0;\n color: "+o.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(r?o.colors.error:o.colors.primary)+";\n\n div {\n border-color: "+(r?o.colors.error:o.colors.primary)+";\n color: "+(r?o.colors.error:o.colors.primary)+";\n }\n }\n ":"")+"\n"});Z.displayName="ControlOuter";var $=v(function(n,o){var r=n.children,e=n.isActive,t=n.hasError,i=G(n,["children","isActive","hasError"]);return u("div",{style:{position:"relative"}},u(Z,Object.assign({ref:o,isActive:e,hasError:t,type:"button"},i),u(a,{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},u(a,{width:"100%",fontWeight:4,style:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",letterSpacing:"0.6px"}},r),u(s,{name:"ChevronDown",ml:"xs"}))),u(c,{className:"__bg",bg:t?"error-alpha01":"primary-alpha01",position:"absolute",top:"-2px",bottom:"-2px",left:"-2px",right:"-2px",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),u(c,{className:"__border",bg:"white",border:["1px solid",t?"error":"outline"],position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"}))});function nn(n){var o=n.value,r=n.placeholder,t=n.label,i=n.items,a=n.hasError,l=n.disabled,s=n.onSelect,d=n.onRemove,p=h(O(i.filter(function(n){return n.value===o})[0],"label")||r||"Please select"),b=p[0],m=p[1],f=e({items:i.map(function(n){return Object.assign({},n,{selected:n.value===o})}),onSelect:function(n){m(n.label),s&&s(n)},onRemove:function(n){m("Please select"),d&&d(n)}}),g=f.items,v=f.isOpen,x=f.getDropProps;return u(c,null,u($,Object.assign({id:f.id},l?{}:(0,f.getControlProps)(),{"aria-label":t,isActive:v,hasError:a,disabled:l}),b),v&&u(c,{position:"absolute",bottom:"0",width:"100%",transform:"translateY(100%) translateY(6px)",zIndex:1e3},u(Q,Object.assign({},x(),{style:{maxHeight:"240px",overflow:"auto"}}),g.map(function(n){return u(K,Object.assign({key:n.value,selected:n.selected,highlighted:n.highlighted},n.getItemProps()),n.label)}))))}function on(n){var o=n.name,r=n.validate,e=G(n,["name","validate"]);return u(w,{name:o,validate:r},function(n){var o=n.field,r=n.form,t=Boolean(r.errors&&r.errors[o.name]);return u(nn,Object.assign({},e,{hasError:t,onSelect:function(n){r.setFieldValue(o.name,n.value),e.onSelect&&e.onSelect(n)}}))})}function rn(n){return u(g,null,u(M,{htmlFor:n.name},n.label),u(on,Object.assign({},n)))}function en(n){return u(k,{name:n.name,render:function(n){return u(a,{color:"error",fontSize:0},n)}})}function tn(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}$.displayName="Control";var an=t.input(function(n){var o=n.theme,r=n.small,e=n.hasError;return"\n appearance: none;\n border: none;\n display: block;\n position: relative;\n font-family: "+o.fonts.roboto+";\n color: "+o.colors.body+";\n font-size: "+(r?o.fontSizes[0]:o.fontSizes[1])+";\n line-height: "+o.lineHeights[0]+";\n letter-spacing: 0.6px;\n width: 100%;\n margin: 0;\n min-height: "+(r?"36px":"48px")+";\n padding: "+(r?"10px 16px":o.space.sm)+";\n background: transparent;\n color: "+(n.hasValue?o.colors.body:o.colors.secondary)+";\n cursor: pointer;\n z-index: 2;\n transition-property: border-color, color;\n transition-duration: 150ms;\n transition-timing-function: ease-in-out;\n\n &::placeholder {\n color: "+o.colors.secondary+";\n line-height: "+o.lineHeights[0]+";\n opacity: 1;\n }\n &:-webkit-autofill {\n -webkit-text-fill-color: "+o.colors.body+";\n -webkit-box-shadow: 0 0 0px 1000px #fff inset;\n }\n &:disabled {\n background: transparent;\n color: "+o.colors.placeholder+";\n cursor: not-allowed;\n & ~ .__border {\n background: "+o.colors.background+";\n cursor: not-allowed;\n }\n }\n &:invalid,\n &:not(:disabled):active,\n &:not(:disabled):focus,\n &:not(:disabled):hover {\n box-shadow: none;\n outline: 0;\n color: "+o.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(e?o.colors.error:o.colors.primary)+";\n }\n & ~ .__tab {\n border-color: "+(e?o.colors.error:o.colors.primary)+";\n color: "+(e?o.colors.error:o.colors.primary)+";\n }\n }\n "+(r?"\n & ~ .__tab {\n padding: 10px;\n }\n ":"")+"\n\n & ~ .__tab svg {\n max-width: "+(r?"14px":"16px")+";\n max-height: "+(r?"14px":"16px")+";\n }\n"});an.displayName="InputElement";var ln=v(function(n,o){var r=n.hasError,e=n.preTab,t=n.postTab,i=tn(n,["hasError","preTab","postTab"]),a=Boolean(e),l=e||t;return u(c,{display:"flex",ml:"-2px",mr:"-2px",p:"2px"},u(an,Object.assign({ref:o,hasError:r},i)),l&&u(c,{className:"__tab","aria-hidden":"true",display:"flex",alignItems:"center",justifyContent:"center",px:"sm",zIndex:1,color:r?"error":"secondary",bg:r?"#FDEBF0":"background",borderTopLeftRadius:a?"4px":"0",borderBottomLeftRadius:a?"4px":"0",borderTopRightRadius:a?"0":"4px",borderBottomRightRadius:a?"0":"4px",border:["1px solid",r?"error":"outline"],order:a?-1:1,transitionProperty:"border-color, color",transitionDuration:"fast",transitionTimingFunction:"ease"},l),u(c,{className:"__bg",bg:r?"error-alpha01":"primary-alpha01",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),u(c,{className:"__border",bg:"white",border:["1px solid",r?"error":"outline"],position:"absolute",top:"2px",bottom:"2px",left:"2px",right:"2px",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"}))});function sn(n){var o=n.name,r=n.validate,e=n.onChange,t=n.onBlur,i=tn(n,["name","validate","onChange","onBlur"]);return u(w,{name:o,validate:r},function(n){var r=n.field,a=Boolean(O(n.form,["errors",o]));return u(ln,Object.assign({},i,r,{hasError:a,onChange:function(n){r.onChange(n),e&&e(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}function cn(n){return u(g,null,u(M,{htmlFor:n.name},n.label),u(sn,Object.assign({},n)))}function dn(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}var pn=Object.freeze(["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n cursor: pointer;\n z-index: 0;\n"]),un=t.span(function(n){var o=n.theme;return"\n display: block;\n font-size: "+o.fontSizes[1]+";\n font-weight: "+o.fontWeights[5]+";\n line-height: "+o.lineHeights[0]+";\n transition-property: color;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.ease+";\n "}),bn=t.div(function(n){var o=n.theme;return"\n width: 100%;\n border: 1px solid "+o.colors.outline+";\n border-radius: 4px;\n\n "+gn+" {\n padding: "+o.space.sm+";\n border-top: 1px solid "+o.colors.outline+";\n\n &:first-of-type {\n border-top: 0;\n }\n }\n\n "+(n.hasError?"\n border-color: "+o.colors.error+" !important;\n\n & "+gn+" {\n border-color: "+o.colors.error+" !important;\n }\n ":"")+"\n "}),hn=t.div(function(n){var o=n.theme;return"\n position: relative;\n width: 16px;\n height: 16px;\n border-radius: 100%;\n margin-top: 2px;\n margin-right: 16px;\n border: 1px solid "+(n.checked?o.colors.primaryDark:o.colors.outline)+";\n z-index: 1;\n transition-property: background, border-color;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.ease+";\n\n &::after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: auto;\n width: 8px;\n height: 8px;\n border-radius: 100%;\n background: white;\n transition-property: transform;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.ease+";\n transform: scale(0);\n }\n "}),mn=t.input(function(n){var o=n.theme;return"\n position: relative;\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n position: absolute;\n whitespace: nowrap;\n wordwrap: normal;\n z-index: 1;\n\n &:focus ~ "+hn+" {\n border-color: "+o.colors.primaryDark+";\n }\n &:focus ~ "+c+" "+un+" {\n color: "+o.colors.primary+";\n }\n\n &:checked ~ "+hn+" {\n background: "+o.colors.primary+";\n border-color: "+o.colors.primaryDark+";\n\n &::after {\n transform: scale(1);\n }\n }\n &:checked ~ "+c+" "+un+" {\n color: "+o.colors.primary+";\n }\n\n &:disabled ~ "+hn+" {\n border-color: "+o.colors.outline+" !important;\n }\n &:disabled ~ "+fn+" {\n background-color: "+o.colors.background+";\n }\n &:disabled ~ "+c+" "+un+" {\n color: "+o.colors.secondary+" !important;\n }\n "}),fn=t.span(pn),gn=t.label(function(n){var o=n.theme;return"\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n margin-bottom: 0 !important;\n cursor: pointer;\n overflow: hidden;\n\n &:hover "+hn+" {\n border-color: "+o.colors.primaryDark+";\n }\n &:hover "+un+" {\n color: "+o.colors.primary+";\n }\n "});function vn(n){var o=n.name,r=n.checked,e=n.description,t=n.label,i=dn(n,["children","name","checked","description","label"]),a=o+i.value;return u(gn,{htmlFor:a},u(mn,Object.assign({id:a,name:o,type:"radio",checked:r},i)),u(hn,{checked:r}),u(c,{display:"block",position:"relative",zIndex:1,width:"calc(100% - 32px)",maxWidth:"calc(100% - 32px)"},t&&u(un,null,t),e&&u(d,{mt:"xxs",color:"secondary",fontSize:0,fontWeight:4,lineHeight:0},e)),u(fn,null))}function xn(n){var o=n.children,r=n.name,e=n.validate,t=n.onChange,i=n.onBlur,a=dn(n,["children","name","validate","onChange","onBlur"]);return u(w,{name:r,validate:e},function(n){var e=n.field,l=Boolean(O(n.form,["errors",r]));return u(bn,{hasError:l},x.toArray(o).map(function(n){return y(n,Object.assign({},e,a,{value:n.props.value,hasError:l,checked:Boolean(e.value===n.props.value),onChange:function(n){e.onChange(n),t&&t(n)},onBlur:function(n){e.onBlur(n),i&&i(n)}}))}))})}function yn(n){var o=n.label,r=dn(n,["label"]);return u(g,null,u(M,{htmlFor:r.name},o),u(xn,Object.assign({},r)))}function wn(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}var kn=t.select(function(n){var o=n.theme,r=n.hasError;return"\n appearance: none;\n border: none;\n display: block;\n position: relative;\n font-family: "+o.fonts.roboto+";\n color: "+o.colors.body+";\n font-size: "+o.fontSizes[1]+";\n line-height: "+o.lineHeights[0]+";\n letter-spacing: 0.6px;\n width: 100%;\n margin: 0;\n min-height: 48px;\n padding: "+o.space.sm+";\n background: transparent;\n color: "+(n.hasValue?o.colors.body:o.colors.secondary)+";\n cursor: pointer;\n z-index: 2;\n transition-property: border-color, color;\n transition-duration: 150ms;\n transition-timing-function: ease-in-out;\n\n &::placeholder {\n color: "+o.colors.secondary+";\n line-height: "+o.lineHeights[0]+";\n opacity: 1;\n }\n &:-webkit-autofill {\n -webkit-text-fill-color: "+o.colors.body+";\n -webkit-box-shadow: 0 0 0px 1000px #fff inset;\n }\n &:disabled {\n background: transparent;\n color: "+o.colors.placeholder+";\n cursor: not-allowed;\n & ~ .__border {\n background: "+o.colors.background+";\n cursor: not-allowed;\n }\n }\n &:invalid,\n &:-moz-ui-invalid,\n &:not(:disabled):active,\n &:not(:disabled):focus,\n &:not(:disabled):hover {\n box-shadow: none;\n outline: 0;\n color: "+o.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(r?o.colors.error:o.colors.primary)+";\n\n div {\n border-color: "+(r?o.colors.error:o.colors.primary)+";\n color: "+(r?o.colors.error:o.colors.primary)+";\n }\n }\n }\n\n "+(n.small&&"\n height: 36px;\n min-height: 36px;\n padding: 0px 32px 0 16px;\n margin-right: 16px;\n font-size: "+o.fontSizes[0]+";\n line-height: "+o.lineHeights[0]+";\n ")+"\n"});kn.displayName="SelectElement";var On=v(function(n,o){var r=n.children,e=n.hasError,t=n.placeholder;void 0===t&&(t="");var i=wn(n,["children","hasError","placeholder"]);return u(c,{ml:"-2px",mr:"-2px",p:"2px"},u(kn,Object.assign({ref:o,hasValue:Boolean(i.value),hasError:e},i,{value:i.value||""}),t&&u("option",{value:"",disabled:!0},t),r),u(c,{className:"__bg",bg:e?"error-alpha01":"primary-alpha01",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),u(c,{className:"__border",bg:"white",border:["1px solid",e?"error":"outline"],position:"absolute",top:"2px",bottom:"2px",left:"2px",right:"2px",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"}),u(c,{position:"absolute",right:"0",top:"0",bottom:"0",height:"16px",my:"auto",pr:"sm",style:{pointerEvents:"none"}},u(s,{name:"ChevronDown",color:"secondary"})))});function _n(n){var o=n.name,r=n.validate,e=n.onChange,t=n.onBlur,i=wn(n,["name","validate","onChange","onBlur"]);return u(w,{name:o,validate:r},function(n){var r=n.field,a=Boolean(O(n.form,["errors",o]));return u(On,Object.assign({},i,r,{hasError:a,onChange:function(n){r.onChange(n),e&&e(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}function zn(n){return u(g,null,u(M,{htmlFor:n.name},n.label),u(_n,Object.assign({},n)))}var jn=t(c)(function(n){return"\n border-left: 2px solid currentColor;\n padding-left: "+n.theme.space.sm+";\n "});function Dn(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}var En=t.textarea(function(n){var o=n.theme,r=n.hasError;return"\n appearance: none;\n border: none;\n display: block;\n position: relative;\n font-family: "+o.fonts.roboto+";\n color: "+o.colors.body+";\n font-size: "+o.fontSizes[1]+";\n line-height: "+o.lineHeights[0]+";\n letter-spacing: 0.6px;\n width: 100%;\n margin: 0;\n min-height: 48px;\n padding: "+o.space.sm+";\n background: transparent;\n color: "+(n.hasValue?o.colors.body:o.colors.secondary)+";\n cursor: pointer;\n z-index: 2;\n transition-property: border-color, color;\n transition-duration: 150ms;\n transition-timing-function: ease-in-out;\n\n &::placeholder {\n color: "+o.colors.secondary+";\n line-height: "+o.lineHeights[0]+";\n opacity: 1;\n }\n &:-webkit-autofill {\n -webkit-text-fill-color: "+o.colors.body+";\n -webkit-box-shadow: 0 0 0px 1000px #fff inset;\n }\n &:disabled {\n background: transparent;\n color: "+o.colors.placeholder+";\n cursor: not-allowed;\n & ~ .__border {\n background: "+o.colors.background+";\n cursor: not-allowed;\n }\n }\n &:invalid,\n &:-moz-ui-invalid,\n &:not(:disabled):active,\n &:not(:disabled):focus,\n &:not(:disabled):hover {\n box-shadow: none;\n outline: 0;\n color: "+o.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(r?o.colors.error:o.colors.primary)+";\n\n div {\n border-color: "+(r?o.colors.error:o.colors.primary)+";\n color: "+(r?o.colors.error:o.colors.primary)+";\n }\n }\n }\n"});En.displayName="TextareaElement",En.defaultProps={rows:4};var Fn=v(function(n,o){var r=n.hasError,e=Dn(n,["hasError"]);return u(c,{ml:"-2px",mr:"-2px",p:"2px"},u(En,Object.assign({ref:o,hasError:r},e)),u(c,{className:"__bg",bg:r?"error-alpha01":"primary-alpha01",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),u(c,{className:"__border",bg:"white",border:["1px solid",r?"error":"outline"],position:"absolute",top:"2px",bottom:"2px",left:"2px",right:"2px",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"}))});function Bn(n){var o=n.name,r=n.validate,e=n.onChange,t=n.onBlur,i=Dn(n,["name","validate","onChange","onBlur"]);return u(w,{name:o,validate:r},function(n){var r=n.field,a=Boolean(O(n.form,["errors",o]));return u(Fn,Object.assign({},i,r,{hasError:a,onChange:function(n){r.onChange(n),e&&e(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}function Cn(n){return u(g,null,u(M,{htmlFor:n.name},n.label),u(Bn,Object.assign({},n)))}var Tn=Object.freeze(["\n display: block;\n position: relative;\n cursor: pointer;\n"]),In=t.label(Tn),Pn=t.div(function(n){var o=n.theme;return"\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n width: 100%;\n padding: "+o.space.med+" "+o.space.sm+";\n color: "+o.colors.body+";\n background-color: "+o.colors.background+";\n border: 1px solid "+(n.hasError?o.colors.error:o.colors.outline)+";\n border-radius: "+o.space.xxs+";\n transition-property: color, background-color, border-color;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.ease+";\n"}),Sn=t.input(function(n){var o=n.theme;return"\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n position: absolute;\n whitespace: nowrap;\n wordwrap: normal;\n\n &:checked\n ~ "+Pn+",\n &:hover\n ~ "+Pn+",\n &:focus\n ~ "+Pn+" {\n border: 1px solid "+o.colors.primary+";\n background-color: rgb(91, 99, 254, 0.1);\n }\n\n &:checked ~ "+Pn+" {\n color: "+o.colors.primary+";\n }\n"});function Rn(n){var o=n.icon,r=n.label,e=n.hasError,t=function(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}(n,["icon","label","hasError"]),i=t.name+t.value;return u(In,{htmlFor:i},u(Sn,Object.assign({id:i,type:"radio"},t)),u(Pn,{hasError:e},o&&u(p,{mb:"xs",background:"white",width:"48px",height:"48px"},o),u(a,{display:"flex",alignItems:"center",minHeight:"32px",fontSize:0,fontWeight:5,lineHeight:0},r)))}var Nn=Object.freeze(["\n ","\n"]),Hn="\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n position: absolute;\n whitespace: nowrap;\n wordwrap: normal;\n",Vn=t.div(function(n){var o=n.theme;return"\n display: block;\n position: absolute;\n top: 3px;\n bottom: 0;\n left: 3px;\n width: 24px;\n height: 24px;\n border-radius: 100px;\n border: 1px solid "+o.colors.outline+";\n color: white;\n background: white;\n stroke: white;\n transition-property: transform, background, border-color;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.natural+";\n"}),Mn=t.div(function(n){var o=n.theme;return"\n position: relative;\n width: 56px;\n height: 32px;\n border-radius: 100px;\n border: 1px solid "+o.colors.outline+";\n background: "+o.colors.background+";\n cursor: pointer;\n transition-property: background, border-color;\n transition-duration: "+o.transitionDurations.fast+";\n transition-timing-function: "+o.transitionTimingFunctions.natural+";\n "}),Un=t.label(function(n){return"\n display: flex;\n align-items: center;\n margin-bottom: 0 !important;\n\n &:hover "+Mn+" {\n "+Vn+" {\n border-color: "+n.theme.colors.primaryDark+";\n }\n }\n "}),Wn=t.input(function(n){var o=n.theme;return"\n "+Hn+"\n\n &:focus ~ "+Mn+" {\n border-color: "+o.colors.primary+";\n }\n &:checked ~ "+Mn+" {\n border-color: "+o.colors.primary+";\n\n "+Vn+" {\n background: "+o.colors.primary+";\n border-color: "+o.colors.primaryDark+";\n transform: translateX(24px);\n }\n }\n &:disabled ~ "+Mn+" {\n pointer-events: none;\n "+Vn+" {\n border-color: "+o.colors.outline+";\n }\n }\n "}),Yn=t.span(Nn,Hn);function An(n){var o=n.label,r=n.name,e=n.checked,t=function(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}(n,["label","name","checked"]);return u(Un,{htmlFor:r},u(Wn,Object.assign({id:r,name:r,type:"checkbox",checked:e},t)),u(Mn,null,u(Vn,null,u(s,{name:"Check",width:"12px",height:"12px",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",m:"auto",style:{strokeWidth:"2px"}}))),u(Yn,null,o))}function Ln(n){var o=n.label;return u(w,{name:n.name,validate:n.validate},function(n){var r=n.field;return u(An,Object.assign({label:o},r,{checked:Boolean(r.value)}))})}function Xn(n){var o=n.value;void 0===o&&(o="");var r=n.masker;void 0===r&&(r="*");var e=n.separator;void 0===e&&(e="-");var t=h(o),i=t[0],a=t[1],l=h(!1),s=l[1],c=l[0]?i:D(j(i,r),e),d=f(function(){s(!0)},[s]),p=f(function(){s(!1)},[s]);return m(function(){n.onUpdate&&n.onUpdate(i)},[i,n.onUpdate]),u(ln,Object.assign({},n,{value:c,onFocus:d,onClick:d,onBlur:p,onChange:function(n){a(z(n.target.value))}}))}function qn(n){var o=n.name,r=n.validate,e=function(n,o){var r={};for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&-1===o.indexOf(e)&&(r[e]=n[e]);return r}(n,["name","validate"]);return u(w,{name:o,validate:r},function(n){var r=n.field,t=n.form,i=Boolean(O(t,["errors",o])),a=f(function(n){t.setFieldValue(o,n)},[o,t.setFieldValue]);return u(Xn,Object.assign({},e,r,{hasError:i,onUpdate:a}))})}function Gn(n){return u(g,null,u(M,{htmlFor:n.name},n.label),u(qn,Object.assign({},n)))}export{S as CheckboxGroup,R as Checkbox,N as CheckboxField,L as DateInput,X as DateInputField,q as DateInputFieldWithLabel,K as Item,Q as Body,$ as Control,nn as Dropdown,on as DropdownField,rn as DropdownFieldWithLabel,en as ErrorMessage,ln as Input,sn as InputField,cn as InputFieldWithLabel,M as Label,vn as Radio,xn as RadioField,yn as RadioFieldWithLabel,On as Select,_n as SelectField,zn as SelectFieldWithLabel,jn as SubGroup,Fn as Textarea,Bn as TextareaField,Cn as TextareaFieldWithLabel,Rn as Tile,Hn as hidden,An as Toggle,Ln as ToggleField,Xn as SSNInput,qn as SSNInputField,Gn as SSNInputFieldWithLabel};
//# sourceMappingURL=index.esm.js.map

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

var n,e=require("styled-system"),r=require("use-drop"),o=require("styled-components"),t=(n=o)&&"object"==typeof n&&"default"in n?n.default:n,a=require("@truework/ui"),i=require("react"),l=require("formik"),s=require("lodash"),c=require("parse-ssn");function d(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}var p=Object.freeze([""]),u=t(a.Icon)(p),m=t.div(function(n){var e=n.theme;return"\n position: relative;\n width: 16px;\n height: 16px;\n border-radius: 2px;\n margin-top: 2px;\n margin-right: 8px;\n border: 1px solid "+(n.checked?e.colors.primaryDark:e.colors.outline)+";\n transition-property: background, border-color;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.ease+";\n\n "+u+" {\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: auto;\n width: 12px;\n height: 12px;\n color: white;\n stroke: white;\n stroke-width: 2px;\n transition-property: transform;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.ease+";\n transform: scale(0);\n }\n "}),b=t(a.H5)(function(n){var e=n.theme;return"\n width: calc(100% - 16px);\n transition-property: color;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.ease+";\n "}),h=t.input(function(n){var e=n.theme;return"\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n position: absolute;\n whitespace: nowrap;\n wordwrap: normal;\n\n &:focus ~ "+m+" {\n border-color: "+e.colors.primaryDark+";\n }\n &:checked ~ "+m+" {\n background: "+e.colors.primary+";\n border-color: "+e.colors.primaryDark+";\n\n "+u+" {\n transform: scale(1);\n }\n }\n &:focus ~ "+b+", &:focus ~"+a.Span+", &:checked ~ "+a.Span+" {\n color: "+e.colors.primary+";\n }\n\n "+(n.hasError?"\n & ~ "+m+" {\n border-color: "+e.colors.error+" !important;\n }\n ":"")+"\n "}),f=t.label(function(n){var e=n.theme;return"\n display: flex;\n align-items: flex-start;\n width: 100%;\n margin-bottom: 0 !important;\n\n "+(n.disabled?"\n "+m+" {\n background: "+e.colors.background+";\n }\n "+a.Span+" {\n color: "+e.colors.placeholder+";\n }\n ":"\n &:hover "+m+" {\n border-color: "+e.colors.primaryDark+";\n }\n &:hover "+b+", &:hover "+a.Span+" {\n color: "+e.colors.primary+";\n }\n ")+"\n "}),g=t.div(function(n){var e=n.theme;return"\n width: 100%;\n\n "+f+" {\n padding: "+e.space.sm+";\n border: 1px solid "+e.colors.outline+";\n border-top: none;\n display: flex;\n align-items: center;\n }\n\n "+f+":first-child {\n border-top: 1px solid "+e.colors.outline+";\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n }\n\n "+f+":last-child {\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n }\n "});function x(n){var e=n.children,r=n.name,o=n.checked,t=n.disabled,l=d(n,["children","name","checked","disabled"]);return i.createElement(f,{htmlFor:r,disabled:t},i.createElement(h,Object.assign({id:r,name:r,type:"checkbox",checked:o,disabled:t},l)),i.createElement(m,{checked:o},i.createElement(u,{name:"Check"})),i.createElement(a.Span,{display:"block",width:"calc(100% - 16px)",fontSize:1,lineHeight:1,fontWeight:5,style:{transitionProperty:"color",transitionDuration:"150ms",transitionTimingFunction:"ease-in-out"}},e))}function v(n){return n<10?"0"+n:""+n}var y=Object.freeze(["\n display: block;\n position: relative;\n font-weight: 500;\n letter-spacing: 0.6px;\n ","\n ","\n ","\n"]),E=t.label(y,e.typography,e.color,e.space);E.displayName="Label",E.defaultProps={fontSize:1,lineHeight:1,mb:"xs"};var w=Object.freeze(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 12px;\n z-index: 1;\n height: 16px;\n width: 16px;\n margin: auto 0;\n border: 1px solid currentColor;\n border-radius: 16px;\n color: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0.5;\n transition: opacity ","\n ",";\n\n &:hover {\n opacity: 1;\n }\n "]),k=Object.freeze(["\n appearance: none;\n border: none;\n display: block;\n position: relative;\n font-family: ",";\n color: ",";\n font-size: ",";\n font-family: ",";\n line-height: ",";\n letter-spacing: 0.6px;\n margin: 0;\n min-height: 48px;\n padding: "," 8px "," 10px;\n text-align: center;\n max-width: 33.333333%;\n background: transparent;\n color: ",";\n cursor: pointer;\n z-index: 2;\n transition-property: border-color, color;\n transition-duration: 150ms;\n transition-timing-function: ease-in-out;\n\n &::-ms-expand {\n display: none;\n }\n &:disabled {\n background: transparent;\n color: ",";\n cursor: not-allowed;\n & ~ .__border {\n background: ",";\n cursor: not-allowed;\n }\n }\n &:not(:disabled):active,\n &:not(:disabled):focus,\n &:not(:disabled):hover {\n outline: 0;\n color: ",";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: ",";\n\n div {\n border-color: ",";\n color: ",";\n }\n }\n }\n "]),B=t.select(function(n){var e=n.theme,r=n.hasError;return o.css(k,e.fonts.roboto,e.colors.body,e.fontSizes[1],e.fonts.mono,e.lineHeights[0],e.space.sm,e.space.sm,n.hasValue?e.colors.body:e.colors.secondary,function(n){return n.theme.colors.placeholder},e.colors.background,e.colors.body,r?e.colors.error:e.colors.primary,r?e.colors.error:e.colors.primary,r?e.colors.error:e.colors.primary)}),F=t.button(function(n){var e=n.theme;return o.css(w,e.colors.secondary,e.transitionDurations.fast,e.transitionTimingFunctions.ease)});function O(n){var e=n.name,r=n.label;void 0===r&&(r="Date");var o=n.disabled,t=n.initialMonth;void 0===t&&(t=0);var l=n.initialDay;void 0===l&&(l=0);var c=n.initialYear;void 0===c&&(c=0);var d=n.minMonth;void 0===d&&(d=1);var p=n.minDay;void 0===p&&(p=1);var u=n.minYear;void 0===u&&(u=1980);var m=n.maxMonth;void 0===m&&(m=12);var b=n.maxDay;void 0===b&&(b=31);var h=n.maxYear;void 0===h&&(h=2030);var f=n.hasError,g=n.onUpdate,x=i.useRef(null),y=i.useRef(null),E=i.useRef(null),w=i.useState(t),k=w[0],O=w[1],_=i.useState(l),z=_[0],j=_[1],C=i.useState(c),D=C[0],S=C[1],I=function(n){return new Date(n.year,n.month,0).getUTCDate()}({year:D||2020,month:k});i.useEffect(function(){g(D&&k&&z?D+"-"+v(k)+"-"+v(z):"")},[k,z,D]);var T=i.useCallback(function(){O(0),j(0),S(0)},[O,j,S]);return i.createElement(a.Box,{ml:"-4px",mr:"-4px",p:"4px"},i.createElement(a.Box,{display:"flex",alignItems:"center",height:"48px",pl:"56px"},i.createElement(B,{ref:x,name:e+"-month",value:k,disabled:o,onChange:function(n){O(parseInt(n.target.value,10)),y.current&&y.current.focus()},"aria-label":r+": Month",hasValue:Boolean(k),hasError:f},i.createElement("option",{value:"0",disabled:!0},"mm"),s.times(m-d+1,function(){return""}).map(function(n,e){var r=d+e;return i.createElement("option",{key:r,value:r},v(r))})),i.createElement(a.Box,{height:"50%",width:"1px",bg:f?"error":"outline",zIndex:2,transform:"rotate(10deg)"}),i.createElement(B,{ref:y,name:e+"-day",value:z,disabled:o,onChange:function(n){j(parseInt(n.target.value,10)),E.current&&E.current.focus()},"aria-label":r+": Day",hasValue:Boolean(z),hasError:f},i.createElement("option",{value:"0",disabled:!0},"dd"),s.times(Math.min(b,I)-p+1,function(){return""}).map(function(n,e){var r=p+e;return i.createElement("option",{key:r,value:r},v(r))})),i.createElement(a.Box,{height:"50%",width:"1px",bg:f?"error":"outline",zIndex:2,transform:"rotate(10deg)"}),i.createElement(B,{ref:E,name:e+"-year",value:D,disabled:o,onChange:function(n){S(parseInt(n.target.value,10))},"aria-label":r+": Year",hasValue:Boolean(D),hasError:f},i.createElement("option",{value:"0",disabled:!0},"yyyy"),s.times(h-u+1,function(n){return u+n}).map(function(n){return i.createElement("option",{key:n,value:n},n)})),(k||z||D)&&i.createElement(F,{title:"Clear",onClick:T},i.createElement(a.Icon,{name:"X",width:"12px",height:"12px"})),i.createElement(a.Box,{className:"__bg",bg:f?"error-alpha01":"primary-alpha01",position:"absolute",top:"-4px",bottom:"-4px",left:"-4px",right:"-4px",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),i.createElement(a.Box,{className:"__border",bg:"white",border:["1px solid",f?"error":"outline"],position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"},i.createElement(a.Box,{"aria-hidden":"true",position:"absolute",top:"0",left:"0",display:"flex",alignItems:"center",justifyContent:"center",px:"sm",height:"100%",zIndex:0,color:f?"error":"secondary",bg:f?"#FDEBF0":"background",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px",borderRight:["1px solid",f?"error":"outline"],transitionProperty:"border-color, color",transitionDuration:"fast",transitionTimingFunction:"ease"},i.createElement(a.Icon,{name:"Calendar"})))))}function _(n){var e=n.name,r=n.validate,o=function(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}(n,["name","validate"]);return i.createElement(l.Field,{name:e,validate:r},function(n){var r=n.field,t=n.form,a=Boolean(s.get(t,["errors",e])),l=(r.value||"").split("-"),c=l[0];void 0===c&&(c="");var d=l[1];void 0===d&&(d="");var p=l[2];return void 0===p&&(p=""),i.createElement(O,Object.assign({name:e},o,{initialMonth:d?parseInt(d,10):void 0,initialDay:p?parseInt(p,10):void 0,initialYear:c?parseInt(c,10):void 0,hasError:a,onUpdate:function(n){t.setFieldValue(e,n)}}))})}function z(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}var j=t(a.Box)(function(n){var e=n.theme,r=n.selected,o=n.highlighted;return"\n display: flex;\n align-items: center;\n padding: "+e.space.sm+";\n color: "+(r||o?e.colors.body:e.colors.secondary)+";\n background-color: "+(r||o?e.colors.background:"white")+";\n cursor: pointer;\n font-size: "+e.fontSizes[1]+";\n font-weight: 400;\n line-height: "+e.lineHeights[1]+";\n letter-spacing: 0.6px;\n\n &:hover {\n background: "+e.colors.background+";\n }\n"});function C(n){var e=n.children,r=z(n,["children"]);return i.createElement(j,Object.assign({as:"li"},r),e)}var D=i.forwardRef(function(n,e){var r=n.children,o=z(n,["children"]);return i.createElement(a.Box,Object.assign({ref:e,as:"ul",boxShadow:"medium",borderRadius:2,overflow:"auto",width:"100%",bg:"white"},o),r)});D.displayName="Body";var S=t.button(function(n){var e=n.theme,r=n.hasError;return"\n display: block;\n position: relative;\n width: 100%;\n z-index: 1;\n height: 48px;\n padding: 0 16px;\n text-align: left;\n font-size: "+e.fontSizes[1]+";\n font-weight: 400;\n line-height: "+e.lineHeights[1]+";\n color: "+e.colors.secondary+";\n transition-property: color;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.ease+";\n\n "+(n.disabled?"\n background: transparent;\n color: "+e.colors.placeholder+";\n cursor: not-allowed;\n & ~ .__border {\n background: "+e.colors.background+";\n cursor: not-allowed;\n }\n ":"\n &:active,\n &:focus,\n &:hover {\n outline: 0;\n color: "+e.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(r?e.colors.error:e.colors.primary)+";\n\n div {\n border-color: "+(r?e.colors.error:e.colors.primary)+";\n color: "+(r?e.colors.error:e.colors.primary)+";\n }\n }\n }\n ")+"\n\n "+(n.isActive?"\n outline: 0;\n color: "+e.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(r?e.colors.error:e.colors.primary)+";\n\n div {\n border-color: "+(r?e.colors.error:e.colors.primary)+";\n color: "+(r?e.colors.error:e.colors.primary)+";\n }\n }\n ":"")+"\n"});S.displayName="ControlOuter";var I=i.forwardRef(function(n,e){var r=n.children,o=n.isActive,t=n.hasError,l=z(n,["children","isActive","hasError"]);return i.createElement("div",{style:{position:"relative"}},i.createElement(S,Object.assign({ref:e,isActive:o,hasError:t,type:"button"},l),i.createElement(a.Span,{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},i.createElement(a.Span,{width:"100%",fontWeight:4,style:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",letterSpacing:"0.6px"}},r),i.createElement(a.Icon,{name:"ChevronDown",ml:"xs"}))),i.createElement(a.Box,{className:"__bg",bg:t?"error-alpha01":"primary-alpha01",position:"absolute",top:"-2px",bottom:"-2px",left:"-2px",right:"-2px",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),i.createElement(a.Box,{className:"__border",bg:"white",border:["1px solid",t?"error":"outline"],position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"}))});function T(n){var e=n.value,o=n.placeholder,t=n.label,l=n.items,c=n.hasError,d=n.disabled,p=n.onSelect,u=n.onRemove,m=i.useState(s.get(l.filter(function(n){return n.value===e})[0],"label")||o||"Please select"),b=m[0],h=m[1],f=r.useSelect({items:l.map(function(n){return Object.assign({},n,{selected:n.value===e})}),onSelect:function(n){h(n.label),p&&p(n)},onRemove:function(n){h("Please select"),u&&u(n)}}),g=f.items,x=f.isOpen,v=f.getDropProps;return i.createElement(a.Box,null,i.createElement(I,Object.assign({id:f.id},d?{}:(0,f.getControlProps)(),{"aria-label":t,isActive:x,hasError:c,disabled:d}),b),x&&i.createElement(a.Box,{position:"absolute",bottom:"0",width:"100%",transform:"translateY(100%) translateY(6px)",zIndex:1e3},i.createElement(D,Object.assign({},v(),{style:{maxHeight:"240px",overflow:"auto"}}),g.map(function(n){return i.createElement(C,Object.assign({key:n.value,selected:n.selected,highlighted:n.highlighted},n.getItemProps()),n.label)}))))}function R(n){var e=n.name,r=n.validate,o=z(n,["name","validate"]);return i.createElement(l.Field,{name:e,validate:r},function(n){var e=n.field,r=n.form,t=Boolean(r.errors&&r.errors[e.name]);return i.createElement(T,Object.assign({},o,{hasError:t,onSelect:function(n){r.setFieldValue(e.name,n.value),o.onSelect&&o.onSelect(n)}}))})}function P(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}I.displayName="Control";var N=t.input(function(n){var e=n.theme,r=n.small,o=n.hasError;return"\n appearance: none;\n border: none;\n display: block;\n position: relative;\n font-family: "+e.fonts.roboto+";\n color: "+e.colors.body+";\n font-size: "+(r?e.fontSizes[0]:e.fontSizes[1])+";\n line-height: "+e.lineHeights[0]+";\n letter-spacing: 0.6px;\n width: 100%;\n margin: 0;\n min-height: "+(r?"36px":"48px")+";\n padding: "+(r?"10px 16px":e.space.sm)+";\n background: transparent;\n color: "+(n.hasValue?e.colors.body:e.colors.secondary)+";\n cursor: pointer;\n z-index: 2;\n transition-property: border-color, color;\n transition-duration: 150ms;\n transition-timing-function: ease-in-out;\n\n &::placeholder {\n color: "+e.colors.secondary+";\n line-height: "+e.lineHeights[0]+";\n opacity: 1;\n }\n &:-webkit-autofill {\n -webkit-text-fill-color: "+e.colors.body+";\n -webkit-box-shadow: 0 0 0px 1000px #fff inset;\n }\n &:disabled {\n background: transparent;\n color: "+e.colors.placeholder+";\n cursor: not-allowed;\n & ~ .__border {\n background: "+e.colors.background+";\n cursor: not-allowed;\n }\n }\n &:invalid,\n &:not(:disabled):active,\n &:not(:disabled):focus,\n &:not(:disabled):hover {\n box-shadow: none;\n outline: 0;\n color: "+e.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(o?e.colors.error:e.colors.primary)+";\n }\n & ~ .__tab {\n border-color: "+(o?e.colors.error:e.colors.primary)+";\n color: "+(o?e.colors.error:e.colors.primary)+";\n }\n }\n "+(r?"\n & ~ .__tab {\n padding: 10px;\n }\n ":"")+"\n\n & ~ .__tab svg {\n max-width: "+(r?"14px":"16px")+";\n max-height: "+(r?"14px":"16px")+";\n }\n"});N.displayName="InputElement";var H=i.forwardRef(function(n,e){var r=n.hasError,o=n.preTab,t=n.postTab,l=P(n,["hasError","preTab","postTab"]),s=Boolean(o),c=o||t;return i.createElement(a.Box,{display:"flex",ml:"-2px",mr:"-2px",p:"2px"},i.createElement(N,Object.assign({ref:e,hasError:r},l)),c&&i.createElement(a.Box,{className:"__tab","aria-hidden":"true",display:"flex",alignItems:"center",justifyContent:"center",px:"sm",zIndex:1,color:r?"error":"secondary",bg:r?"#FDEBF0":"background",borderTopLeftRadius:s?"4px":"0",borderBottomLeftRadius:s?"4px":"0",borderTopRightRadius:s?"0":"4px",borderBottomRightRadius:s?"0":"4px",border:["1px solid",r?"error":"outline"],order:s?-1:1,transitionProperty:"border-color, color",transitionDuration:"fast",transitionTimingFunction:"ease"},c),i.createElement(a.Box,{className:"__bg",bg:r?"error-alpha01":"primary-alpha01",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),i.createElement(a.Box,{className:"__border",bg:"white",border:["1px solid",r?"error":"outline"],position:"absolute",top:"2px",bottom:"2px",left:"2px",right:"2px",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"}))});function W(n){var e=n.name,r=n.validate,o=n.onChange,t=n.onBlur,a=P(n,["name","validate","onChange","onBlur"]);return i.createElement(l.Field,{name:e,validate:r},function(n){var r=n.field,l=Boolean(s.get(n.form,["errors",e]));return i.createElement(H,Object.assign({},a,r,{hasError:l,onChange:function(n){r.onChange(n),o&&o(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}function L(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}var V=Object.freeze(["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n cursor: pointer;\n z-index: 0;\n"]),q=t.span(function(n){var e=n.theme;return"\n display: block;\n font-size: "+e.fontSizes[1]+";\n font-weight: "+e.fontWeights[5]+";\n line-height: "+e.lineHeights[0]+";\n transition-property: color;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.ease+";\n "}),M=t.div(function(n){var e=n.theme;return"\n width: 100%;\n border: 1px solid "+e.colors.outline+";\n border-radius: 4px;\n\n "+G+" {\n padding: "+e.space.sm+";\n border-top: 1px solid "+e.colors.outline+";\n\n &:first-of-type {\n border-top: 0;\n }\n }\n\n "+(n.hasError?"\n border-color: "+e.colors.error+" !important;\n\n & "+G+" {\n border-color: "+e.colors.error+" !important;\n }\n ":"")+"\n "}),U=t.div(function(n){var e=n.theme;return"\n position: relative;\n width: 16px;\n height: 16px;\n border-radius: 100%;\n margin-top: 2px;\n margin-right: 16px;\n border: 1px solid "+(n.checked?e.colors.primaryDark:e.colors.outline)+";\n z-index: 1;\n transition-property: background, border-color;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.ease+";\n\n &::after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: auto;\n width: 8px;\n height: 8px;\n border-radius: 100%;\n background: white;\n transition-property: transform;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.ease+";\n transform: scale(0);\n }\n "}),Y=t.input(function(n){var e=n.theme;return"\n position: relative;\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n position: absolute;\n whitespace: nowrap;\n wordwrap: normal;\n z-index: 1;\n\n &:focus ~ "+U+" {\n border-color: "+e.colors.primaryDark+";\n }\n &:focus ~ "+a.Box+" "+q+" {\n color: "+e.colors.primary+";\n }\n\n &:checked ~ "+U+" {\n background: "+e.colors.primary+";\n border-color: "+e.colors.primaryDark+";\n\n &::after {\n transform: scale(1);\n }\n }\n &:checked ~ "+a.Box+" "+q+" {\n color: "+e.colors.primary+";\n }\n\n &:disabled ~ "+U+" {\n border-color: "+e.colors.outline+" !important;\n }\n &:disabled ~ "+A+" {\n background-color: "+e.colors.background+";\n }\n &:disabled ~ "+a.Box+" "+q+" {\n color: "+e.colors.secondary+" !important;\n }\n "}),A=t.span(V),G=t.label(function(n){var e=n.theme;return"\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n margin-bottom: 0 !important;\n cursor: pointer;\n overflow: hidden;\n\n &:hover "+U+" {\n border-color: "+e.colors.primaryDark+";\n }\n &:hover "+q+" {\n color: "+e.colors.primary+";\n }\n "});function X(n){var e=n.children,r=n.name,o=n.validate,t=n.onChange,a=n.onBlur,c=L(n,["children","name","validate","onChange","onBlur"]);return i.createElement(l.Field,{name:r,validate:o},function(n){var o=n.field,l=Boolean(s.get(n.form,["errors",r]));return i.createElement(M,{hasError:l},i.Children.toArray(e).map(function(n){return i.cloneElement(n,Object.assign({},o,c,{value:n.props.value,hasError:l,checked:Boolean(o.value===n.props.value),onChange:function(n){o.onChange(n),t&&t(n)},onBlur:function(n){o.onBlur(n),a&&a(n)}}))}))})}function J(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}var K=t.select(function(n){var e=n.theme,r=n.hasError;return"\n appearance: none;\n border: none;\n display: block;\n position: relative;\n font-family: "+e.fonts.roboto+";\n color: "+e.colors.body+";\n font-size: "+e.fontSizes[1]+";\n line-height: "+e.lineHeights[0]+";\n letter-spacing: 0.6px;\n width: 100%;\n margin: 0;\n min-height: 48px;\n padding: "+e.space.sm+";\n background: transparent;\n color: "+(n.hasValue?e.colors.body:e.colors.secondary)+";\n cursor: pointer;\n z-index: 2;\n transition-property: border-color, color;\n transition-duration: 150ms;\n transition-timing-function: ease-in-out;\n\n &::placeholder {\n color: "+e.colors.secondary+";\n line-height: "+e.lineHeights[0]+";\n opacity: 1;\n }\n &:-webkit-autofill {\n -webkit-text-fill-color: "+e.colors.body+";\n -webkit-box-shadow: 0 0 0px 1000px #fff inset;\n }\n &:disabled {\n background: transparent;\n color: "+e.colors.placeholder+";\n cursor: not-allowed;\n & ~ .__border {\n background: "+e.colors.background+";\n cursor: not-allowed;\n }\n }\n &:invalid,\n &:-moz-ui-invalid,\n &:not(:disabled):active,\n &:not(:disabled):focus,\n &:not(:disabled):hover {\n box-shadow: none;\n outline: 0;\n color: "+e.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(r?e.colors.error:e.colors.primary)+";\n\n div {\n border-color: "+(r?e.colors.error:e.colors.primary)+";\n color: "+(r?e.colors.error:e.colors.primary)+";\n }\n }\n }\n\n "+(n.small&&"\n height: 36px;\n min-height: 36px;\n padding: 0px 32px 0 16px;\n margin-right: 16px;\n font-size: "+e.fontSizes[0]+";\n line-height: "+e.lineHeights[0]+";\n ")+"\n"});K.displayName="SelectElement";var Q=i.forwardRef(function(n,e){var r=n.children,o=n.hasError,t=n.placeholder;void 0===t&&(t="");var l=J(n,["children","hasError","placeholder"]);return i.createElement(a.Box,{ml:"-2px",mr:"-2px",p:"2px"},i.createElement(K,Object.assign({ref:e,hasValue:Boolean(l.value),hasError:o},l,{value:l.value||""}),t&&i.createElement("option",{value:"",disabled:!0},t),r),i.createElement(a.Box,{className:"__bg",bg:o?"error-alpha01":"primary-alpha01",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),i.createElement(a.Box,{className:"__border",bg:"white",border:["1px solid",o?"error":"outline"],position:"absolute",top:"2px",bottom:"2px",left:"2px",right:"2px",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"}),i.createElement(a.Box,{position:"absolute",right:"0",top:"0",bottom:"0",height:"16px",my:"auto",pr:"sm",style:{pointerEvents:"none"}},i.createElement(a.Icon,{name:"ChevronDown",color:"secondary"})))});function Z(n){var e=n.name,r=n.validate,o=n.onChange,t=n.onBlur,a=J(n,["name","validate","onChange","onBlur"]);return i.createElement(l.Field,{name:e,validate:r},function(n){var r=n.field,l=Boolean(s.get(n.form,["errors",e]));return i.createElement(Q,Object.assign({},a,r,{hasError:l,onChange:function(n){r.onChange(n),o&&o(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}var $=t(a.Box)(function(n){return"\n border-left: 2px solid currentColor;\n padding-left: "+n.theme.space.sm+";\n "});function nn(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}var en=t.textarea(function(n){var e=n.theme,r=n.hasError;return"\n appearance: none;\n border: none;\n display: block;\n position: relative;\n font-family: "+e.fonts.roboto+";\n color: "+e.colors.body+";\n font-size: "+e.fontSizes[1]+";\n line-height: "+e.lineHeights[0]+";\n letter-spacing: 0.6px;\n width: 100%;\n margin: 0;\n min-height: 48px;\n padding: "+e.space.sm+";\n background: transparent;\n color: "+(n.hasValue?e.colors.body:e.colors.secondary)+";\n cursor: pointer;\n z-index: 2;\n transition-property: border-color, color;\n transition-duration: 150ms;\n transition-timing-function: ease-in-out;\n\n &::placeholder {\n color: "+e.colors.secondary+";\n line-height: "+e.lineHeights[0]+";\n opacity: 1;\n }\n &:-webkit-autofill {\n -webkit-text-fill-color: "+e.colors.body+";\n -webkit-box-shadow: 0 0 0px 1000px #fff inset;\n }\n &:disabled {\n background: transparent;\n color: "+e.colors.placeholder+";\n cursor: not-allowed;\n & ~ .__border {\n background: "+e.colors.background+";\n cursor: not-allowed;\n }\n }\n &:invalid,\n &:-moz-ui-invalid,\n &:not(:disabled):active,\n &:not(:disabled):focus,\n &:not(:disabled):hover {\n box-shadow: none;\n outline: 0;\n color: "+e.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(r?e.colors.error:e.colors.primary)+";\n\n div {\n border-color: "+(r?e.colors.error:e.colors.primary)+";\n color: "+(r?e.colors.error:e.colors.primary)+";\n }\n }\n }\n"});en.displayName="TextareaElement",en.defaultProps={rows:4};var rn=i.forwardRef(function(n,e){var r=n.hasError,o=nn(n,["hasError"]);return i.createElement(a.Box,{ml:"-2px",mr:"-2px",p:"2px"},i.createElement(en,Object.assign({ref:e,hasError:r},o)),i.createElement(a.Box,{className:"__bg",bg:r?"error-alpha01":"primary-alpha01",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),i.createElement(a.Box,{className:"__border",bg:"white",border:["1px solid",r?"error":"outline"],position:"absolute",top:"2px",bottom:"2px",left:"2px",right:"2px",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"}))});function on(n){var e=n.name,r=n.validate,o=n.onChange,t=n.onBlur,a=nn(n,["name","validate","onChange","onBlur"]);return i.createElement(l.Field,{name:e,validate:r},function(n){var r=n.field,l=Boolean(s.get(n.form,["errors",e]));return i.createElement(rn,Object.assign({},a,r,{hasError:l,onChange:function(n){r.onChange(n),o&&o(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}function tn(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}var an=Object.freeze(["\n margin: 0;\n padding: 0;\n appearance: none;\n\n &:checked\n ~ ",",\n &:hover\n ~ ",",\n &:focus\n ~ "," {\n border: 1px solid ",";\n background-color: rgb(91, 99, 254, 0.1);\n }\n\n &:checked ~ "," {\n color: ",";\n }\n"]),ln=Object.freeze(["\n width: 100%;\n height: 100%;\n padding: "," ",";\n top: 0px;\n position: absolute;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n color: ",";\n background-color: ",";\n border: 1px solid ",";\n border-radius: ",";\n\n transition-property: color, background-color, border-color;\n transition-duration: ",";\n transition-timing-function: ",";\n"]),sn=Object.freeze(["\n width: 100%;\n height: 100%;\n position: relative;\n display: block;\n cursor: pointer;\n"]),cn=t.label(sn),dn=t.div(ln,a.theme.space.med,a.theme.space.sm,a.theme.colors.body,a.theme.colors.background,a.theme.colors.outline,a.theme.space.xxs,a.theme.transitionDurations.fast,a.theme.transitionTimingFunctions.ease),pn=t.input(an,dn,dn,dn,a.theme.colors.primary,dn,a.theme.colors.primary);function un(n){var e=n.id,r=n.icon,o=n.label,t=tn(n,["id","icon","label","width","height"]);return i.createElement(cn,{htmlFor:e},i.createElement(pn,Object.assign({id:e,type:"radio"},t)),i.createElement(dn,null,r&&i.createElement(a.Box,{mb:"xs",backgroundColor:"white",width:"48px",height:"48px",borderRadius:"50%",display:"flex",justifyContent:"center",alignItems:"center"},r),i.createElement(a.Span,{display:"flex",alignItems:"center",minHeight:"32px",fontSize:0,fontWeight:5,lineHeight:0},o)))}var mn=Object.freeze(["\n ","\n"]),bn="\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n position: absolute;\n whitespace: nowrap;\n wordwrap: normal;\n",hn=t.div(function(n){var e=n.theme;return"\n display: block;\n position: absolute;\n top: 3px;\n bottom: 0;\n left: 3px;\n width: 24px;\n height: 24px;\n border-radius: 100px;\n border: 1px solid "+e.colors.outline+";\n color: white;\n background: white;\n stroke: white;\n transition-property: transform, background, border-color;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.natural+";\n"}),fn=t.div(function(n){var e=n.theme;return"\n position: relative;\n width: 56px;\n height: 32px;\n border-radius: 100px;\n border: 1px solid "+e.colors.outline+";\n background: "+e.colors.background+";\n cursor: pointer;\n transition-property: background, border-color;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.natural+";\n "}),gn=t.label(function(n){return"\n display: flex;\n align-items: center;\n margin-bottom: 0 !important;\n\n &:hover "+fn+" {\n "+hn+" {\n border-color: "+n.theme.colors.primaryDark+";\n }\n }\n "}),xn=t.input(function(n){var e=n.theme;return"\n "+bn+"\n\n &:focus ~ "+fn+" {\n border-color: "+e.colors.primary+";\n }\n &:checked ~ "+fn+" {\n border-color: "+e.colors.primary+";\n\n "+hn+" {\n background: "+e.colors.primary+";\n border-color: "+e.colors.primaryDark+";\n transform: translateX(24px);\n }\n }\n &:disabled ~ "+fn+" {\n pointer-events: none;\n "+hn+" {\n border-color: "+e.colors.outline+";\n }\n }\n "}),vn=t.span(mn,bn);function yn(n){var e=n.label,r=n.name,o=n.checked,t=function(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}(n,["label","name","checked"]);return i.createElement(gn,{htmlFor:r},i.createElement(xn,Object.assign({id:r,name:r,type:"checkbox",checked:o},t)),i.createElement(fn,null,i.createElement(hn,null,i.createElement(a.Icon,{name:"Check",width:"12px",height:"12px",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",m:"auto",style:{strokeWidth:"2px"}}))),i.createElement(vn,null,e))}function En(n){var e=n.value;void 0===e&&(e="");var r=n.masker;void 0===r&&(r="*");var o=n.separator;void 0===o&&(o="-");var t=i.useState(e),a=t[0],l=t[1],s=i.useState(!1),d=s[1],p=s[0]?a:c.format(c.mask(a,r),o),u=i.useCallback(function(){d(!0)},[d]),m=i.useCallback(function(){d(!1)},[d]);return i.useEffect(function(){n.onUpdate&&n.onUpdate(a)},[a,n.onUpdate]),i.createElement(H,Object.assign({},n,{value:p,onFocus:u,onClick:u,onBlur:m,onChange:function(n){l(c.clean(n.target.value))}}))}function wn(n){var e=n.name,r=n.validate,o=function(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}(n,["name","validate"]);return i.createElement(l.Field,{name:e,validate:r},function(n){var r=n.field,t=n.form,a=Boolean(s.get(t,["errors",e])),l=i.useCallback(function(n){t.setFieldValue(e,n)},[e,t.setFieldValue]);return i.createElement(En,Object.assign({},o,r,{hasError:a,onUpdate:l}))})}exports.CheckboxGroup=g,exports.Checkbox=x,exports.CheckboxField=function(n){var e=n.name,r=n.validate,o=n.onChange,t=n.onBlur,a=d(n,["name","validate","onChange","onBlur"]);return i.createElement(l.Field,{name:e,validate:r},function(n){var r=n.field,l=Boolean(s.get(n.form,["errors",e]));return i.createElement(x,Object.assign({},a,r,{checked:Boolean(r.value),hasError:l,onChange:function(n){r.onChange(n),o&&o(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})},exports.DateInput=O,exports.DateInputField=_,exports.DateInputFieldWithLabel=function(n){return i.createElement(i.Fragment,null,i.createElement(E,{htmlFor:n.name},n.label),i.createElement(_,Object.assign({},n)))},exports.Item=C,exports.Body=D,exports.Control=I,exports.Dropdown=T,exports.DropdownField=R,exports.DropdownFieldWithLabel=function(n){return i.createElement(i.Fragment,null,i.createElement(E,{htmlFor:n.name},n.label),i.createElement(R,Object.assign({},n)))},exports.ErrorMessage=function(n){return i.createElement(l.ErrorMessage,{name:n.name,render:function(n){return i.createElement(a.Span,{color:"error",fontSize:0},n)}})},exports.Input=H,exports.InputField=W,exports.InputFieldWithLabel=function(n){return i.createElement(i.Fragment,null,i.createElement(E,{htmlFor:n.name},n.label),i.createElement(W,Object.assign({},n)))},exports.Label=E,exports.Radio=function(n){var e=n.name,r=n.checked,o=n.description,t=n.label,l=L(n,["children","name","checked","description","label"]),s=e+l.value;return i.createElement(G,{htmlFor:s},i.createElement(Y,Object.assign({id:s,name:e,type:"radio",checked:r},l)),i.createElement(U,{checked:r}),i.createElement(a.Box,{display:"block",position:"relative",zIndex:1,width:"calc(100% - 32px)",maxWidth:"calc(100% - 32px)"},t&&i.createElement(q,null,t),o&&i.createElement(a.P,{mt:"xxs",color:"secondary",fontSize:0,fontWeight:4,lineHeight:0},o)),i.createElement(A,null))},exports.RadioField=X,exports.RadioFieldWithLabel=function(n){var e=n.label,r=L(n,["label"]);return i.createElement(i.Fragment,null,i.createElement(E,{htmlFor:r.name},e),i.createElement(X,Object.assign({},r)))},exports.Select=Q,exports.SelectField=Z,exports.SelectFieldWithLabel=function(n){return i.createElement(i.Fragment,null,i.createElement(E,{htmlFor:n.name},n.label),i.createElement(Z,Object.assign({},n)))},exports.SubGroup=$,exports.Textarea=rn,exports.TextareaField=on,exports.TextareaFieldWithLabel=function(n){return i.createElement(i.Fragment,null,i.createElement(E,{htmlFor:n.name},n.label),i.createElement(on,Object.assign({},n)))},exports.Tile=un,exports.TileField=function(n){var e=n.name,r=n.validate,o=n.onChange,t=n.onBlur,a=tn(n,["name","validate","onChange","onBlur"]);return i.createElement(l.Field,{name:e,validate:r},function(n){var e=n.field;return i.createElement(un,Object.assign({},a,e,{onChange:function(n){e.onChange(n),o&&o(n)},onBlur:function(n){e.onBlur(n),t&&t(n)}}))})},exports.hidden=bn,exports.Toggle=yn,exports.ToggleField=function(n){var e=n.label;return i.createElement(l.Field,{name:n.name,validate:n.validate},function(n){var r=n.field;return i.createElement(yn,Object.assign({label:e},r,{checked:Boolean(r.value)}))})},exports.SSNInput=En,exports.SSNInputField=wn,exports.SSNInputFieldWithLabel=function(n){return i.createElement(i.Fragment,null,i.createElement(E,{htmlFor:n.name},n.label),i.createElement(wn,Object.assign({},n)))};
var n,e=require("styled-system"),r=require("use-drop"),o=require("styled-components"),t=(n=o)&&"object"==typeof n&&"default"in n?n.default:n,a=require("@truework/ui"),i=require("react"),l=require("formik"),s=require("lodash"),c=require("parse-ssn");function d(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}var p=Object.freeze([""]),u=t(a.Icon)(p),m=t.div(function(n){var e=n.theme;return"\n position: relative;\n width: 16px;\n height: 16px;\n border-radius: 2px;\n margin-top: 2px;\n margin-right: 8px;\n border: 1px solid "+(n.checked?e.colors.primaryDark:e.colors.outline)+";\n transition-property: background, border-color;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.ease+";\n\n "+u+" {\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: auto;\n width: 12px;\n height: 12px;\n color: white;\n stroke: white;\n stroke-width: 2px;\n transition-property: transform;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.ease+";\n transform: scale(0);\n }\n "}),b=t(a.H5)(function(n){var e=n.theme;return"\n width: calc(100% - 16px);\n transition-property: color;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.ease+";\n "}),h=t.input(function(n){var e=n.theme;return"\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n position: absolute;\n whitespace: nowrap;\n wordwrap: normal;\n\n &:focus ~ "+m+" {\n border-color: "+e.colors.primaryDark+";\n }\n &:checked ~ "+m+" {\n background: "+e.colors.primary+";\n border-color: "+e.colors.primaryDark+";\n\n "+u+" {\n transform: scale(1);\n }\n }\n &:focus ~ "+b+", &:focus ~"+a.Span+", &:checked ~ "+a.Span+" {\n color: "+e.colors.primary+";\n }\n\n "+(n.hasError?"\n & ~ "+m+" {\n border-color: "+e.colors.error+" !important;\n }\n ":"")+"\n "}),f=t.label(function(n){var e=n.theme;return"\n display: flex;\n align-items: flex-start;\n width: 100%;\n margin-bottom: 0 !important;\n\n "+(n.disabled?"\n "+m+" {\n background: "+e.colors.background+";\n }\n "+a.Span+" {\n color: "+e.colors.placeholder+";\n }\n ":"\n &:hover "+m+" {\n border-color: "+e.colors.primaryDark+";\n }\n &:hover "+b+", &:hover "+a.Span+" {\n color: "+e.colors.primary+";\n }\n ")+"\n "}),g=t.div(function(n){var e=n.theme;return"\n width: 100%;\n\n "+f+" {\n padding: "+e.space.sm+";\n border: 1px solid "+e.colors.outline+";\n border-top: none;\n display: flex;\n align-items: center;\n }\n\n "+f+":first-child {\n border-top: 1px solid "+e.colors.outline+";\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n }\n\n "+f+":last-child {\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n }\n "});function x(n){var e=n.children,r=n.name,o=n.checked,t=n.disabled,l=d(n,["children","name","checked","disabled"]);return i.createElement(f,{htmlFor:r,disabled:t},i.createElement(h,Object.assign({id:r,name:r,type:"checkbox",checked:o,disabled:t},l)),i.createElement(m,{checked:o},i.createElement(u,{name:"Check"})),i.createElement(a.Span,{display:"block",width:"calc(100% - 16px)",fontSize:1,lineHeight:1,fontWeight:5,style:{transitionProperty:"color",transitionDuration:"150ms",transitionTimingFunction:"ease-in-out"}},e))}function v(n){return n<10?"0"+n:""+n}var y=Object.freeze(["\n display: block;\n position: relative;\n font-weight: 500;\n letter-spacing: 0.6px;\n ","\n ","\n ","\n"]),E=t.label(y,e.typography,e.color,e.space);E.displayName="Label",E.defaultProps={fontSize:1,lineHeight:1,mb:"xs"};var w=Object.freeze(["\n position: absolute;\n top: 0;\n bottom: 0;\n right: 12px;\n z-index: 1;\n height: 16px;\n width: 16px;\n margin: auto 0;\n border: 1px solid currentColor;\n border-radius: 16px;\n color: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0.5;\n transition: opacity ","\n ",";\n\n &:hover {\n opacity: 1;\n }\n "]),k=Object.freeze(["\n appearance: none;\n border: none;\n display: block;\n position: relative;\n font-family: ",";\n color: ",";\n font-size: ",";\n font-family: ",";\n line-height: ",";\n letter-spacing: 0.6px;\n margin: 0;\n min-height: 48px;\n padding: "," 8px "," 10px;\n text-align: center;\n max-width: 33.333333%;\n background: transparent;\n color: ",";\n cursor: pointer;\n z-index: 2;\n transition-property: border-color, color;\n transition-duration: 150ms;\n transition-timing-function: ease-in-out;\n\n &::-ms-expand {\n display: none;\n }\n &:disabled {\n background: transparent;\n color: ",";\n cursor: not-allowed;\n & ~ .__border {\n background: ",";\n cursor: not-allowed;\n }\n }\n &:not(:disabled):active,\n &:not(:disabled):focus,\n &:not(:disabled):hover {\n outline: 0;\n color: ",";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: ",";\n\n div {\n border-color: ",";\n color: ",";\n }\n }\n }\n "]),F=t.select(function(n){var e=n.theme,r=n.hasError;return o.css(k,e.fonts.roboto,e.colors.body,e.fontSizes[1],e.fonts.mono,e.lineHeights[0],e.space.sm,e.space.sm,n.hasValue?e.colors.body:e.colors.secondary,function(n){return n.theme.colors.placeholder},e.colors.background,e.colors.body,r?e.colors.error:e.colors.primary,r?e.colors.error:e.colors.primary,r?e.colors.error:e.colors.primary)}),B=t.button(function(n){var e=n.theme;return o.css(w,e.colors.secondary,e.transitionDurations.fast,e.transitionTimingFunctions.ease)});function O(n){var e=n.name,r=n.label;void 0===r&&(r="Date");var o=n.disabled,t=n.initialMonth;void 0===t&&(t=0);var l=n.initialDay;void 0===l&&(l=0);var c=n.initialYear;void 0===c&&(c=0);var d=n.minMonth;void 0===d&&(d=1);var p=n.minDay;void 0===p&&(p=1);var u=n.minYear;void 0===u&&(u=1980);var m=n.maxMonth;void 0===m&&(m=12);var b=n.maxDay;void 0===b&&(b=31);var h=n.maxYear;void 0===h&&(h=2030);var f=n.hasError,g=n.onUpdate,x=i.useRef(null),y=i.useRef(null),E=i.useRef(null),w=i.useState(t),k=w[0],O=w[1],_=i.useState(l),z=_[0],j=_[1],D=i.useState(c),C=D[0],S=D[1],I=function(n){return new Date(n.year,n.month,0).getUTCDate()}({year:C||2020,month:k});i.useEffect(function(){g(C&&k&&z?C+"-"+v(k)+"-"+v(z):"")},[k,z,C]);var T=i.useCallback(function(){O(0),j(0),S(0)},[O,j,S]);return i.createElement(a.Box,{ml:"-4px",mr:"-4px",p:"4px"},i.createElement(a.Box,{display:"flex",alignItems:"center",height:"48px",pl:"56px"},i.createElement(F,{ref:x,name:e+"-month",value:k,disabled:o,onChange:function(n){O(parseInt(n.target.value,10)),y.current&&y.current.focus()},"aria-label":r+": Month",hasValue:Boolean(k),hasError:f},i.createElement("option",{value:"0",disabled:!0},"mm"),s.times(m-d+1,function(){return""}).map(function(n,e){var r=d+e;return i.createElement("option",{key:r,value:r},v(r))})),i.createElement(a.Box,{height:"50%",width:"1px",bg:f?"error":"outline",zIndex:2,transform:"rotate(10deg)"}),i.createElement(F,{ref:y,name:e+"-day",value:z,disabled:o,onChange:function(n){j(parseInt(n.target.value,10)),E.current&&E.current.focus()},"aria-label":r+": Day",hasValue:Boolean(z),hasError:f},i.createElement("option",{value:"0",disabled:!0},"dd"),s.times(Math.min(b,I)-p+1,function(){return""}).map(function(n,e){var r=p+e;return i.createElement("option",{key:r,value:r},v(r))})),i.createElement(a.Box,{height:"50%",width:"1px",bg:f?"error":"outline",zIndex:2,transform:"rotate(10deg)"}),i.createElement(F,{ref:E,name:e+"-year",value:C,disabled:o,onChange:function(n){S(parseInt(n.target.value,10))},"aria-label":r+": Year",hasValue:Boolean(C),hasError:f},i.createElement("option",{value:"0",disabled:!0},"yyyy"),s.times(h-u+1,function(n){return u+n}).map(function(n){return i.createElement("option",{key:n,value:n},n)})),(k||z||C)&&i.createElement(B,{title:"Clear",onClick:T},i.createElement(a.Icon,{name:"X",width:"12px",height:"12px"})),i.createElement(a.Box,{className:"__bg",bg:f?"error-alpha01":"primary-alpha01",position:"absolute",top:"-4px",bottom:"-4px",left:"-4px",right:"-4px",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),i.createElement(a.Box,{className:"__border",bg:"white",border:["1px solid",f?"error":"outline"],position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"},i.createElement(a.Box,{"aria-hidden":"true",position:"absolute",top:"0",left:"0",display:"flex",alignItems:"center",justifyContent:"center",px:"sm",height:"100%",zIndex:0,color:f?"error":"secondary",bg:f?"#FDEBF0":"background",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px",borderRight:["1px solid",f?"error":"outline"],transitionProperty:"border-color, color",transitionDuration:"fast",transitionTimingFunction:"ease"},i.createElement(a.Icon,{name:"Calendar"})))))}function _(n){var e=n.name,r=n.validate,o=function(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}(n,["name","validate"]);return i.createElement(l.Field,{name:e,validate:r},function(n){var r=n.field,t=n.form,a=Boolean(s.get(t,["errors",e])),l=(r.value||"").split("-"),c=l[0];void 0===c&&(c="");var d=l[1];void 0===d&&(d="");var p=l[2];return void 0===p&&(p=""),i.createElement(O,Object.assign({name:e},o,{initialMonth:d?parseInt(d,10):void 0,initialDay:p?parseInt(p,10):void 0,initialYear:c?parseInt(c,10):void 0,hasError:a,onUpdate:function(n){t.setFieldValue(e,n)}}))})}function z(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}var j=t(a.Box)(function(n){var e=n.theme,r=n.selected,o=n.highlighted;return"\n display: flex;\n align-items: center;\n padding: "+e.space.sm+";\n color: "+(r||o?e.colors.body:e.colors.secondary)+";\n background-color: "+(r||o?e.colors.background:"white")+";\n cursor: pointer;\n font-size: "+e.fontSizes[1]+";\n font-weight: 400;\n line-height: "+e.lineHeights[1]+";\n letter-spacing: 0.6px;\n\n &:hover {\n background: "+e.colors.background+";\n }\n"});function D(n){var e=n.children,r=z(n,["children"]);return i.createElement(j,Object.assign({as:"li"},r),e)}var C=i.forwardRef(function(n,e){var r=n.children,o=z(n,["children"]);return i.createElement(a.Box,Object.assign({ref:e,as:"ul",boxShadow:"medium",borderRadius:2,overflow:"auto",width:"100%",bg:"white"},o),r)});C.displayName="Body";var S=t.button(function(n){var e=n.theme,r=n.hasError;return"\n display: block;\n position: relative;\n width: 100%;\n z-index: 1;\n height: 48px;\n padding: 0 16px;\n text-align: left;\n font-size: "+e.fontSizes[1]+";\n font-weight: 400;\n line-height: "+e.lineHeights[1]+";\n color: "+e.colors.secondary+";\n transition-property: color;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.ease+";\n\n "+(n.disabled?"\n background: transparent;\n color: "+e.colors.placeholder+";\n cursor: not-allowed;\n & ~ .__border {\n background: "+e.colors.background+";\n cursor: not-allowed;\n }\n ":"\n &:active,\n &:focus,\n &:hover {\n outline: 0;\n color: "+e.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(r?e.colors.error:e.colors.primary)+";\n\n div {\n border-color: "+(r?e.colors.error:e.colors.primary)+";\n color: "+(r?e.colors.error:e.colors.primary)+";\n }\n }\n }\n ")+"\n\n "+(n.isActive?"\n outline: 0;\n color: "+e.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(r?e.colors.error:e.colors.primary)+";\n\n div {\n border-color: "+(r?e.colors.error:e.colors.primary)+";\n color: "+(r?e.colors.error:e.colors.primary)+";\n }\n }\n ":"")+"\n"});S.displayName="ControlOuter";var I=i.forwardRef(function(n,e){var r=n.children,o=n.isActive,t=n.hasError,l=z(n,["children","isActive","hasError"]);return i.createElement("div",{style:{position:"relative"}},i.createElement(S,Object.assign({ref:e,isActive:o,hasError:t,type:"button"},l),i.createElement(a.Span,{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},i.createElement(a.Span,{width:"100%",fontWeight:4,style:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",letterSpacing:"0.6px"}},r),i.createElement(a.Icon,{name:"ChevronDown",ml:"xs"}))),i.createElement(a.Box,{className:"__bg",bg:t?"error-alpha01":"primary-alpha01",position:"absolute",top:"-2px",bottom:"-2px",left:"-2px",right:"-2px",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),i.createElement(a.Box,{className:"__border",bg:"white",border:["1px solid",t?"error":"outline"],position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"}))});function T(n){var e=n.value,o=n.placeholder,t=n.label,l=n.items,c=n.hasError,d=n.disabled,p=n.onSelect,u=n.onRemove,m=i.useState(s.get(l.filter(function(n){return n.value===e})[0],"label")||o||"Please select"),b=m[0],h=m[1],f=r.useSelect({items:l.map(function(n){return Object.assign({},n,{selected:n.value===e})}),onSelect:function(n){h(n.label),p&&p(n)},onRemove:function(n){h("Please select"),u&&u(n)}}),g=f.items,x=f.isOpen,v=f.getDropProps;return i.createElement(a.Box,null,i.createElement(I,Object.assign({id:f.id},d?{}:(0,f.getControlProps)(),{"aria-label":t,isActive:x,hasError:c,disabled:d}),b),x&&i.createElement(a.Box,{position:"absolute",bottom:"0",width:"100%",transform:"translateY(100%) translateY(6px)",zIndex:1e3},i.createElement(C,Object.assign({},v(),{style:{maxHeight:"240px",overflow:"auto"}}),g.map(function(n){return i.createElement(D,Object.assign({key:n.value,selected:n.selected,highlighted:n.highlighted},n.getItemProps()),n.label)}))))}function R(n){var e=n.name,r=n.validate,o=z(n,["name","validate"]);return i.createElement(l.Field,{name:e,validate:r},function(n){var e=n.field,r=n.form,t=Boolean(r.errors&&r.errors[e.name]);return i.createElement(T,Object.assign({},o,{hasError:t,onSelect:function(n){r.setFieldValue(e.name,n.value),o.onSelect&&o.onSelect(n)}}))})}function P(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}I.displayName="Control";var N=t.input(function(n){var e=n.theme,r=n.small,o=n.hasError;return"\n appearance: none;\n border: none;\n display: block;\n position: relative;\n font-family: "+e.fonts.roboto+";\n color: "+e.colors.body+";\n font-size: "+(r?e.fontSizes[0]:e.fontSizes[1])+";\n line-height: "+e.lineHeights[0]+";\n letter-spacing: 0.6px;\n width: 100%;\n margin: 0;\n min-height: "+(r?"36px":"48px")+";\n padding: "+(r?"10px 16px":e.space.sm)+";\n background: transparent;\n color: "+(n.hasValue?e.colors.body:e.colors.secondary)+";\n cursor: pointer;\n z-index: 2;\n transition-property: border-color, color;\n transition-duration: 150ms;\n transition-timing-function: ease-in-out;\n\n &::placeholder {\n color: "+e.colors.secondary+";\n line-height: "+e.lineHeights[0]+";\n opacity: 1;\n }\n &:-webkit-autofill {\n -webkit-text-fill-color: "+e.colors.body+";\n -webkit-box-shadow: 0 0 0px 1000px #fff inset;\n }\n &:disabled {\n background: transparent;\n color: "+e.colors.placeholder+";\n cursor: not-allowed;\n & ~ .__border {\n background: "+e.colors.background+";\n cursor: not-allowed;\n }\n }\n &:invalid,\n &:not(:disabled):active,\n &:not(:disabled):focus,\n &:not(:disabled):hover {\n box-shadow: none;\n outline: 0;\n color: "+e.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(o?e.colors.error:e.colors.primary)+";\n }\n & ~ .__tab {\n border-color: "+(o?e.colors.error:e.colors.primary)+";\n color: "+(o?e.colors.error:e.colors.primary)+";\n }\n }\n "+(r?"\n & ~ .__tab {\n padding: 10px;\n }\n ":"")+"\n\n & ~ .__tab svg {\n max-width: "+(r?"14px":"16px")+";\n max-height: "+(r?"14px":"16px")+";\n }\n"});N.displayName="InputElement";var H=i.forwardRef(function(n,e){var r=n.hasError,o=n.preTab,t=n.postTab,l=P(n,["hasError","preTab","postTab"]),s=Boolean(o),c=o||t;return i.createElement(a.Box,{display:"flex",ml:"-2px",mr:"-2px",p:"2px"},i.createElement(N,Object.assign({ref:e,hasError:r},l)),c&&i.createElement(a.Box,{className:"__tab","aria-hidden":"true",display:"flex",alignItems:"center",justifyContent:"center",px:"sm",zIndex:1,color:r?"error":"secondary",bg:r?"#FDEBF0":"background",borderTopLeftRadius:s?"4px":"0",borderBottomLeftRadius:s?"4px":"0",borderTopRightRadius:s?"0":"4px",borderBottomRightRadius:s?"0":"4px",border:["1px solid",r?"error":"outline"],order:s?-1:1,transitionProperty:"border-color, color",transitionDuration:"fast",transitionTimingFunction:"ease"},c),i.createElement(a.Box,{className:"__bg",bg:r?"error-alpha01":"primary-alpha01",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),i.createElement(a.Box,{className:"__border",bg:"white",border:["1px solid",r?"error":"outline"],position:"absolute",top:"2px",bottom:"2px",left:"2px",right:"2px",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"}))});function W(n){var e=n.name,r=n.validate,o=n.onChange,t=n.onBlur,a=P(n,["name","validate","onChange","onBlur"]);return i.createElement(l.Field,{name:e,validate:r},function(n){var r=n.field,l=Boolean(s.get(n.form,["errors",e]));return i.createElement(H,Object.assign({},a,r,{hasError:l,onChange:function(n){r.onChange(n),o&&o(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}function L(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}var V=Object.freeze(["\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n cursor: pointer;\n z-index: 0;\n"]),q=t.span(function(n){var e=n.theme;return"\n display: block;\n font-size: "+e.fontSizes[1]+";\n font-weight: "+e.fontWeights[5]+";\n line-height: "+e.lineHeights[0]+";\n transition-property: color;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.ease+";\n "}),M=t.div(function(n){var e=n.theme;return"\n width: 100%;\n border: 1px solid "+e.colors.outline+";\n border-radius: 4px;\n\n "+G+" {\n padding: "+e.space.sm+";\n border-top: 1px solid "+e.colors.outline+";\n\n &:first-of-type {\n border-top: 0;\n }\n }\n\n "+(n.hasError?"\n border-color: "+e.colors.error+" !important;\n\n & "+G+" {\n border-color: "+e.colors.error+" !important;\n }\n ":"")+"\n "}),U=t.div(function(n){var e=n.theme;return"\n position: relative;\n width: 16px;\n height: 16px;\n border-radius: 100%;\n margin-top: 2px;\n margin-right: 16px;\n border: 1px solid "+(n.checked?e.colors.primaryDark:e.colors.outline)+";\n z-index: 1;\n transition-property: background, border-color;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.ease+";\n\n &::after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: auto;\n width: 8px;\n height: 8px;\n border-radius: 100%;\n background: white;\n transition-property: transform;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.ease+";\n transform: scale(0);\n }\n "}),Y=t.input(function(n){var e=n.theme;return"\n position: relative;\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n position: absolute;\n whitespace: nowrap;\n wordwrap: normal;\n z-index: 1;\n\n &:focus ~ "+U+" {\n border-color: "+e.colors.primaryDark+";\n }\n &:focus ~ "+a.Box+" "+q+" {\n color: "+e.colors.primary+";\n }\n\n &:checked ~ "+U+" {\n background: "+e.colors.primary+";\n border-color: "+e.colors.primaryDark+";\n\n &::after {\n transform: scale(1);\n }\n }\n &:checked ~ "+a.Box+" "+q+" {\n color: "+e.colors.primary+";\n }\n\n &:disabled ~ "+U+" {\n border-color: "+e.colors.outline+" !important;\n }\n &:disabled ~ "+A+" {\n background-color: "+e.colors.background+";\n }\n &:disabled ~ "+a.Box+" "+q+" {\n color: "+e.colors.secondary+" !important;\n }\n "}),A=t.span(V),G=t.label(function(n){var e=n.theme;return"\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n margin-bottom: 0 !important;\n cursor: pointer;\n overflow: hidden;\n\n &:hover "+U+" {\n border-color: "+e.colors.primaryDark+";\n }\n &:hover "+q+" {\n color: "+e.colors.primary+";\n }\n "});function X(n){var e=n.children,r=n.name,o=n.validate,t=n.onChange,a=n.onBlur,c=L(n,["children","name","validate","onChange","onBlur"]);return i.createElement(l.Field,{name:r,validate:o},function(n){var o=n.field,l=Boolean(s.get(n.form,["errors",r]));return i.createElement(M,{hasError:l},i.Children.toArray(e).map(function(n){return i.cloneElement(n,Object.assign({},o,c,{value:n.props.value,hasError:l,checked:Boolean(o.value===n.props.value),onChange:function(n){o.onChange(n),t&&t(n)},onBlur:function(n){o.onBlur(n),a&&a(n)}}))}))})}function J(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}var K=t.select(function(n){var e=n.theme,r=n.hasError;return"\n appearance: none;\n border: none;\n display: block;\n position: relative;\n font-family: "+e.fonts.roboto+";\n color: "+e.colors.body+";\n font-size: "+e.fontSizes[1]+";\n line-height: "+e.lineHeights[0]+";\n letter-spacing: 0.6px;\n width: 100%;\n margin: 0;\n min-height: 48px;\n padding: "+e.space.sm+";\n background: transparent;\n color: "+(n.hasValue?e.colors.body:e.colors.secondary)+";\n cursor: pointer;\n z-index: 2;\n transition-property: border-color, color;\n transition-duration: 150ms;\n transition-timing-function: ease-in-out;\n\n &::placeholder {\n color: "+e.colors.secondary+";\n line-height: "+e.lineHeights[0]+";\n opacity: 1;\n }\n &:-webkit-autofill {\n -webkit-text-fill-color: "+e.colors.body+";\n -webkit-box-shadow: 0 0 0px 1000px #fff inset;\n }\n &:disabled {\n background: transparent;\n color: "+e.colors.placeholder+";\n cursor: not-allowed;\n & ~ .__border {\n background: "+e.colors.background+";\n cursor: not-allowed;\n }\n }\n &:invalid,\n &:-moz-ui-invalid,\n &:not(:disabled):active,\n &:not(:disabled):focus,\n &:not(:disabled):hover {\n box-shadow: none;\n outline: 0;\n color: "+e.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(r?e.colors.error:e.colors.primary)+";\n\n div {\n border-color: "+(r?e.colors.error:e.colors.primary)+";\n color: "+(r?e.colors.error:e.colors.primary)+";\n }\n }\n }\n\n "+(n.small&&"\n height: 36px;\n min-height: 36px;\n padding: 0px 32px 0 16px;\n margin-right: 16px;\n font-size: "+e.fontSizes[0]+";\n line-height: "+e.lineHeights[0]+";\n ")+"\n"});K.displayName="SelectElement";var Q=i.forwardRef(function(n,e){var r=n.children,o=n.hasError,t=n.placeholder;void 0===t&&(t="");var l=J(n,["children","hasError","placeholder"]);return i.createElement(a.Box,{ml:"-2px",mr:"-2px",p:"2px"},i.createElement(K,Object.assign({ref:e,hasValue:Boolean(l.value),hasError:o},l,{value:l.value||""}),t&&i.createElement("option",{value:"",disabled:!0},t),r),i.createElement(a.Box,{className:"__bg",bg:o?"error-alpha01":"primary-alpha01",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),i.createElement(a.Box,{className:"__border",bg:"white",border:["1px solid",o?"error":"outline"],position:"absolute",top:"2px",bottom:"2px",left:"2px",right:"2px",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"}),i.createElement(a.Box,{position:"absolute",right:"0",top:"0",bottom:"0",height:"16px",my:"auto",pr:"sm",style:{pointerEvents:"none"}},i.createElement(a.Icon,{name:"ChevronDown",color:"secondary"})))});function Z(n){var e=n.name,r=n.validate,o=n.onChange,t=n.onBlur,a=J(n,["name","validate","onChange","onBlur"]);return i.createElement(l.Field,{name:e,validate:r},function(n){var r=n.field,l=Boolean(s.get(n.form,["errors",e]));return i.createElement(Q,Object.assign({},a,r,{hasError:l,onChange:function(n){r.onChange(n),o&&o(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}var $=t(a.Box)(function(n){return"\n border-left: 2px solid currentColor;\n padding-left: "+n.theme.space.sm+";\n "});function nn(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}var en=t.textarea(function(n){var e=n.theme,r=n.hasError;return"\n appearance: none;\n border: none;\n display: block;\n position: relative;\n font-family: "+e.fonts.roboto+";\n color: "+e.colors.body+";\n font-size: "+e.fontSizes[1]+";\n line-height: "+e.lineHeights[0]+";\n letter-spacing: 0.6px;\n width: 100%;\n margin: 0;\n min-height: 48px;\n padding: "+e.space.sm+";\n background: transparent;\n color: "+(n.hasValue?e.colors.body:e.colors.secondary)+";\n cursor: pointer;\n z-index: 2;\n transition-property: border-color, color;\n transition-duration: 150ms;\n transition-timing-function: ease-in-out;\n\n &::placeholder {\n color: "+e.colors.secondary+";\n line-height: "+e.lineHeights[0]+";\n opacity: 1;\n }\n &:-webkit-autofill {\n -webkit-text-fill-color: "+e.colors.body+";\n -webkit-box-shadow: 0 0 0px 1000px #fff inset;\n }\n &:disabled {\n background: transparent;\n color: "+e.colors.placeholder+";\n cursor: not-allowed;\n & ~ .__border {\n background: "+e.colors.background+";\n cursor: not-allowed;\n }\n }\n &:invalid,\n &:-moz-ui-invalid,\n &:not(:disabled):active,\n &:not(:disabled):focus,\n &:not(:disabled):hover {\n box-shadow: none;\n outline: 0;\n color: "+e.colors.body+";\n\n & ~ .__bg {\n opacity: 1;\n }\n & ~ .__border {\n border-color: "+(r?e.colors.error:e.colors.primary)+";\n\n div {\n border-color: "+(r?e.colors.error:e.colors.primary)+";\n color: "+(r?e.colors.error:e.colors.primary)+";\n }\n }\n }\n"});en.displayName="TextareaElement",en.defaultProps={rows:4};var rn=i.forwardRef(function(n,e){var r=n.hasError,o=nn(n,["hasError"]);return i.createElement(a.Box,{ml:"-2px",mr:"-2px",p:"2px"},i.createElement(en,Object.assign({ref:e,hasError:r},o)),i.createElement(a.Box,{className:"__bg",bg:r?"error-alpha01":"primary-alpha01",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"6px",opacity:0,transitionProperty:"opacity",transitionDuration:"fast",transitionTimingFunction:"ease"}),i.createElement(a.Box,{className:"__border",bg:"white",border:["1px solid",r?"error":"outline"],position:"absolute",top:"2px",bottom:"2px",left:"2px",right:"2px",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"}))});function on(n){var e=n.name,r=n.validate,o=n.onChange,t=n.onBlur,a=nn(n,["name","validate","onChange","onBlur"]);return i.createElement(l.Field,{name:e,validate:r},function(n){var r=n.field,l=Boolean(s.get(n.form,["errors",e]));return i.createElement(rn,Object.assign({},a,r,{hasError:l,onChange:function(n){r.onChange(n),o&&o(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}var tn=Object.freeze(["\n display: block;\n position: relative;\n cursor: pointer;\n"]),an=t.label(tn),ln=t.div(function(n){var e=n.theme;return"\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n width: 100%;\n padding: "+e.space.med+" "+e.space.sm+";\n color: "+e.colors.body+";\n background-color: "+e.colors.background+";\n border: 1px solid "+(n.hasError?e.colors.error:e.colors.outline)+";\n border-radius: "+e.space.xxs+";\n transition-property: color, background-color, border-color;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.ease+";\n"}),sn=t.input(function(n){var e=n.theme;return"\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n position: absolute;\n whitespace: nowrap;\n wordwrap: normal;\n\n &:checked\n ~ "+ln+",\n &:hover\n ~ "+ln+",\n &:focus\n ~ "+ln+" {\n border: 1px solid "+e.colors.primary+";\n background-color: rgb(91, 99, 254, 0.1);\n }\n\n &:checked ~ "+ln+" {\n color: "+e.colors.primary+";\n }\n"}),cn=Object.freeze(["\n ","\n"]),dn="\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n position: absolute;\n whitespace: nowrap;\n wordwrap: normal;\n",pn=t.div(function(n){var e=n.theme;return"\n display: block;\n position: absolute;\n top: 3px;\n bottom: 0;\n left: 3px;\n width: 24px;\n height: 24px;\n border-radius: 100px;\n border: 1px solid "+e.colors.outline+";\n color: white;\n background: white;\n stroke: white;\n transition-property: transform, background, border-color;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.natural+";\n"}),un=t.div(function(n){var e=n.theme;return"\n position: relative;\n width: 56px;\n height: 32px;\n border-radius: 100px;\n border: 1px solid "+e.colors.outline+";\n background: "+e.colors.background+";\n cursor: pointer;\n transition-property: background, border-color;\n transition-duration: "+e.transitionDurations.fast+";\n transition-timing-function: "+e.transitionTimingFunctions.natural+";\n "}),mn=t.label(function(n){return"\n display: flex;\n align-items: center;\n margin-bottom: 0 !important;\n\n &:hover "+un+" {\n "+pn+" {\n border-color: "+n.theme.colors.primaryDark+";\n }\n }\n "}),bn=t.input(function(n){var e=n.theme;return"\n "+dn+"\n\n &:focus ~ "+un+" {\n border-color: "+e.colors.primary+";\n }\n &:checked ~ "+un+" {\n border-color: "+e.colors.primary+";\n\n "+pn+" {\n background: "+e.colors.primary+";\n border-color: "+e.colors.primaryDark+";\n transform: translateX(24px);\n }\n }\n &:disabled ~ "+un+" {\n pointer-events: none;\n "+pn+" {\n border-color: "+e.colors.outline+";\n }\n }\n "}),hn=t.span(cn,dn);function fn(n){var e=n.label,r=n.name,o=n.checked,t=function(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}(n,["label","name","checked"]);return i.createElement(mn,{htmlFor:r},i.createElement(bn,Object.assign({id:r,name:r,type:"checkbox",checked:o},t)),i.createElement(un,null,i.createElement(pn,null,i.createElement(a.Icon,{name:"Check",width:"12px",height:"12px",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",m:"auto",style:{strokeWidth:"2px"}}))),i.createElement(hn,null,e))}function gn(n){var e=n.value;void 0===e&&(e="");var r=n.masker;void 0===r&&(r="*");var o=n.separator;void 0===o&&(o="-");var t=i.useState(e),a=t[0],l=t[1],s=i.useState(!1),d=s[1],p=s[0]?a:c.format(c.mask(a,r),o),u=i.useCallback(function(){d(!0)},[d]),m=i.useCallback(function(){d(!1)},[d]);return i.useEffect(function(){n.onUpdate&&n.onUpdate(a)},[a,n.onUpdate]),i.createElement(H,Object.assign({},n,{value:p,onFocus:u,onClick:u,onBlur:m,onChange:function(n){l(c.clean(n.target.value))}}))}function xn(n){var e=n.name,r=n.validate,o=function(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}(n,["name","validate"]);return i.createElement(l.Field,{name:e,validate:r},function(n){var r=n.field,t=n.form,a=Boolean(s.get(t,["errors",e])),l=i.useCallback(function(n){t.setFieldValue(e,n)},[e,t.setFieldValue]);return i.createElement(gn,Object.assign({},o,r,{hasError:a,onUpdate:l}))})}exports.CheckboxGroup=g,exports.Checkbox=x,exports.CheckboxField=function(n){var e=n.name,r=n.validate,o=n.onChange,t=n.onBlur,a=d(n,["name","validate","onChange","onBlur"]);return i.createElement(l.Field,{name:e,validate:r},function(n){var r=n.field,l=Boolean(s.get(n.form,["errors",e]));return i.createElement(x,Object.assign({},a,r,{checked:Boolean(r.value),hasError:l,onChange:function(n){r.onChange(n),o&&o(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})},exports.DateInput=O,exports.DateInputField=_,exports.DateInputFieldWithLabel=function(n){return i.createElement(i.Fragment,null,i.createElement(E,{htmlFor:n.name},n.label),i.createElement(_,Object.assign({},n)))},exports.Item=D,exports.Body=C,exports.Control=I,exports.Dropdown=T,exports.DropdownField=R,exports.DropdownFieldWithLabel=function(n){return i.createElement(i.Fragment,null,i.createElement(E,{htmlFor:n.name},n.label),i.createElement(R,Object.assign({},n)))},exports.ErrorMessage=function(n){return i.createElement(l.ErrorMessage,{name:n.name,render:function(n){return i.createElement(a.Span,{color:"error",fontSize:0},n)}})},exports.Input=H,exports.InputField=W,exports.InputFieldWithLabel=function(n){return i.createElement(i.Fragment,null,i.createElement(E,{htmlFor:n.name},n.label),i.createElement(W,Object.assign({},n)))},exports.Label=E,exports.Radio=function(n){var e=n.name,r=n.checked,o=n.description,t=n.label,l=L(n,["children","name","checked","description","label"]),s=e+l.value;return i.createElement(G,{htmlFor:s},i.createElement(Y,Object.assign({id:s,name:e,type:"radio",checked:r},l)),i.createElement(U,{checked:r}),i.createElement(a.Box,{display:"block",position:"relative",zIndex:1,width:"calc(100% - 32px)",maxWidth:"calc(100% - 32px)"},t&&i.createElement(q,null,t),o&&i.createElement(a.P,{mt:"xxs",color:"secondary",fontSize:0,fontWeight:4,lineHeight:0},o)),i.createElement(A,null))},exports.RadioField=X,exports.RadioFieldWithLabel=function(n){var e=n.label,r=L(n,["label"]);return i.createElement(i.Fragment,null,i.createElement(E,{htmlFor:r.name},e),i.createElement(X,Object.assign({},r)))},exports.Select=Q,exports.SelectField=Z,exports.SelectFieldWithLabel=function(n){return i.createElement(i.Fragment,null,i.createElement(E,{htmlFor:n.name},n.label),i.createElement(Z,Object.assign({},n)))},exports.SubGroup=$,exports.Textarea=rn,exports.TextareaField=on,exports.TextareaFieldWithLabel=function(n){return i.createElement(i.Fragment,null,i.createElement(E,{htmlFor:n.name},n.label),i.createElement(on,Object.assign({},n)))},exports.Tile=function(n){var e=n.icon,r=n.label,o=n.hasError,t=function(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}(n,["icon","label","hasError"]),l=t.name+t.value;return i.createElement(an,{htmlFor:l},i.createElement(sn,Object.assign({id:l,type:"radio"},t)),i.createElement(ln,{hasError:o},e&&i.createElement(a.Circle,{mb:"xs",background:"white",width:"48px",height:"48px"},e),i.createElement(a.Span,{display:"flex",alignItems:"center",minHeight:"32px",fontSize:0,fontWeight:5,lineHeight:0},r)))},exports.hidden=dn,exports.Toggle=fn,exports.ToggleField=function(n){var e=n.label;return i.createElement(l.Field,{name:n.name,validate:n.validate},function(n){var r=n.field;return i.createElement(fn,Object.assign({label:e},r,{checked:Boolean(r.value)}))})},exports.SSNInput=gn,exports.SSNInputField=xn,exports.SSNInputFieldWithLabel=function(n){return i.createElement(i.Fragment,null,i.createElement(E,{htmlFor:n.name},n.label),i.createElement(xn,Object.assign({},n)))};
//# sourceMappingURL=index.js.map
import * as React from 'react';
import { FieldConfig } from 'formik';
export declare type TileProps = {
id: string;
name: string;
value: string;
label: string;
icon?: React.ReactElement;
label: string;
hasError?: boolean;
} & React.InputHTMLAttributes<HTMLInputElement>;
export declare type TileFieldProps = {
name: string;
} & TileProps & Pick<FieldConfig, 'validate'>;
export declare function Tile({ id, icon, label, width, height, ...props }: TileProps): JSX.Element;
export declare function TileField({ name, validate, onChange, onBlur, ...rest }: TileFieldProps): JSX.Element;
export declare function Tile({ icon, label, hasError, ...props }: TileProps): JSX.Element;
{
"name": "@truework/forms",
"version": "1.4.2",
"version": "1.4.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc