Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@truework/forms

Package Overview
Dependencies
Maintainers
5
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@truework/forms - npm Package Compare versions

Comparing version 1.4.5 to 1.4.6

2

dist/index.esm.js

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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc