Socket
Socket
Sign inDemoInstall

@truework/forms

Package Overview
Dependencies
114
Maintainers
5
Versions
66
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.7.2 to 1.7.3

6

CHANGELOG.md
# @truework/forms
## 1.7.3
### Patch Changes
- ff42863: Fix validation throwing error, which Formik was swallowing
## 1.7.2

@@ -4,0 +10,0 @@

2

dist/index.esm.js

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

import{picomask as n,transform as r}from"picomask";import{space as o,color as e,typography as t}from"styled-system";import{useSelect as i}from"use-drop";import a,{css as l}from"styled-components";import{Span as s,H5 as c,Icon as d,Box as p,P as u,Circle as b}from"@truework/ui";import{createElement as h,useState as m,useEffect as f,useCallback as g,Fragment as v,useRef as x,useLayoutEffect as y,forwardRef as w,Children as k,cloneElement as O}from"react";import{Field as _,ErrorMessage as D}from"formik";import{get as z,times as E}from"lodash";import{clean as j,mask as F,format as B}from"parse-ssn";function C(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 T=Object.freeze([""]),I=a(d)(T),P=a.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 "+I+" {\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 "}),S=a(c)(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 "}),R=a.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 ~ "+P+" {\n border-color: "+r.colors.primaryDark+";\n }\n &:checked ~ "+P+" {\n background: "+r.colors.primary+";\n border-color: "+r.colors.primaryDark+";\n\n "+I+" {\n transform: scale(1);\n }\n }\n &:focus ~ "+S+", &:focus ~"+s+", &:checked ~ "+s+" {\n color: "+r.colors.primary+";\n }\n\n "+(n.hasError?"\n & ~ "+P+" {\n border-color: "+r.colors.error+" !important;\n }\n ":"")+"\n "}),N=a.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 "+P+" {\n background: "+r.colors.background+";\n }\n "+s+" {\n color: "+r.colors.placeholder+";\n }\n ":"\n &:hover "+P+" {\n border-color: "+r.colors.primaryDark+";\n }\n &:hover "+S+", &:hover "+s+" {\n color: "+r.colors.primary+";\n }\n ")+"\n "}),H=a.div(function(n){var r=n.theme;return"\n width: 100%;\n\n "+N+" {\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 "+N+":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 "+N+":last-child {\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n }\n "});function V(n){var r=n.children,o=n.name,e=n.checked,t=n.disabled,i=C(n,["children","name","checked","disabled"]);return h(N,{htmlFor:o,disabled:t},h(R,Object.assign({},{id:o,name:o,type:"checkbox",checked:e,disabled:t},i)),h(P,{checked:e},h(I,{name:"Check"})),h(s,{display:"block",width:"calc(100% - 16px)",fontSize:1,lineHeight:1,fontWeight:5,style:{transitionProperty:"color",transitionDuration:"150ms",transitionTimingFunction:"ease-in-out"}},r))}function M(n){var r=n.name,o=n.validate,e=n.onChange,t=n.onBlur,i=C(n,["name","validate","onChange","onBlur"]);return h(_,{name:r,validate:o},function(n){var o=n.field,a=Boolean(z(n.form,["errors",r]));return h(V,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)}}))})}var U="yyyy-mm-dd",A=["January","February","March","April","May","June","July","August","September","October","November","December"];function Y(n){return new Date(n.year,n.month,0).getUTCDate()}function W(n){return n<10?"0"+n:""+n}function L(n){return n.replace(/[^\d]/g,"").slice(0,8)}function J(o){var e=o.date,t=o.min,i=o.max,a=o.pattern;void 0===a&&(a=U);var l=L(e);if(0!==l.length){var s=n(e,U),c=s.y,d=s.m,p=s.d,u=parseInt(c),b=parseInt(d),h=parseInt(p),m=Y({month:b,year:u});return l.length<8?"Please enter a valid date matching "+a:b>12?"There are only 12 months":"00"===p?"Day cannot be 0":"00"===d?"Month cannot be 0":"0000"===c?"Year cannot be 0":h>m?"There are only "+m+" days in "+A[b-1]+" "+u:t&&new Date(e)<new Date(t)?"Date must be after "+r(n(t,U),a).value:i&&new Date(e)>new Date(i)?"Date must be before "+r(n(i,U),a).value:void 0}}var X=Object.freeze(["\n display: block;\n position: relative;\n font-weight: 500;\n letter-spacing: 0.6px;\n ","\n ","\n ","\n"]),q=a.label(X,t,e,o);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}q.displayName="Label",q.defaultProps={fontSize:1,lineHeight:1,mb:"xs"};var K=a.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: 1px;\n border-radius: 4px;\n min-height: "+(o?"34px":"46px")+";\n padding: "+(o?"10px 16px":"14px 16px")+";\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 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"});K.displayName="InputElement";var Q=w(function(n,r){var o=n.hasError,e=n.preTab,t=n.postTab,i=G(n,["hasError","preTab","postTab"]),a=Boolean(e),l=e||t;return h(p,{display:"flex",ml:"-2px",mr:"-2px",p:"2px"},h(K,Object.assign({},{ref:r,hasError:o},i)),l&&h(p,{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),h(p,{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"}),h(p,{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 Z(n){var r=n.name,o=n.validate,e=n.onChange,t=n.onBlur,i=G(n,["name","validate","onChange","onBlur"]);return h(_,{name:r,validate:o},function(n){var o=n.field,a=Boolean(z(n.form,["errors",r]));return h(Q,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 $(n){return h(v,null,h(q,{htmlFor:n.name},n.label),h(Z,Object.assign({},n)))}function nn(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 rn=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 &:hover {\n opacity: 1;\n }\n "]),on=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 "]),en=a.select(function(n){var r=n.theme,o=n.hasError;return l(on,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)}),tn=a.button(function(n){var r=n.theme;return l(rn,r.colors.secondary,r.transitionDurations.fast,r.transitionTimingFunctions.ease)});function an(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 s=n.minDay;void 0===s&&(s=1);var c=n.minYear;void 0===c&&(c=1980);var u=n.maxMonth;void 0===u&&(u=12);var b=n.maxDay;void 0===b&&(b=31);var v=n.maxYear;void 0===v&&(v=2030);var x=n.hasError,y=n.onUpdate,w=m(t),k=w[0],O=w[1],_=m(i),D=_[0],z=_[1],j=m(a),F=j[0],B=j[1],C=Y({year:F||2020,month:k});f(function(){y(F&&k&&D?F+"-"+W(k)+"-"+W(D):"")},[k,D,F]);var T=g(function(){O(0),z(0),B(0)},[O,z,B]);return h(p,{ml:"-2px",mr:"-2px",p:"2px"},h(p,{display:"flex",alignItems:"center",height:"48px",pl:"56px"},h(en,{name:r+"-month",value:k,disabled:e,onChange:function(n){O(parseInt(n.target.value,10))},"aria-label":o+": Month",hasValue:Boolean(k),hasError:x},h("option",{value:"0",disabled:!0},"mm"),E(u-l+1,function(){return""}).map(function(n,r){var o=l+r;return h("option",{key:o,value:o},W(o))})),h(p,{height:"50%",width:"1px",bg:x?"error":"outline",zIndex:2,transform:"rotate(10deg)"}),h(en,{name:r+"-day",value:D,disabled:e,onChange:function(n){z(parseInt(n.target.value,10))},"aria-label":o+": Day",hasValue:Boolean(D),hasError:x},h("option",{value:"0",disabled:!0},"dd"),E(Math.min(b,C)-s+1,function(){return""}).map(function(n,r){var o=s+r;return h("option",{key:o,value:o},W(o))})),h(p,{height:"50%",width:"1px",bg:x?"error":"outline",zIndex:2,transform:"rotate(10deg)"}),h(en,{name:r+"-year",value:F,disabled:e,onChange:function(n){B(parseInt(n.target.value,10))},"aria-label":o+": Year",hasValue:Boolean(F),hasError:x},h("option",{value:"0",disabled:!0},"yyyy"),E(v-c+1,function(n){return c+n}).map(function(n){return h("option",{key:n,value:n},n)})),(k||D||F)&&h(tn,{title:"Clear",onClick:T},h(d,{name:"X",width:"12px",height:"12px"})),h(p,{className:"__bg",bg:x?"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"}),h(p,{className:"__border",bg:"white",border:["1px solid",x?"error":"outline"],position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"},h(p,{"aria-hidden":"true",position:"absolute",top:"0",left:"0",display:"flex",alignItems:"center",justifyContent:"center",px:"sm",height:"100%",zIndex:0,color:x?"error":"secondary",bg:x?"#FDEBF0":"background",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px",borderRight:["1px solid",x?"error":"outline"],transitionProperty:"border-color, color",transitionDuration:"fast",transitionTimingFunction:"ease"},h(d,{name:"Calendar"})))))}function ln(n){var r=n.name,o=n.validate,e=nn(n,["name","validate"]);return h(_,{name:r,validate:o},function(n){var o=n.field,t=n.form,i=Boolean(z(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=""),h(an,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 sn(n){return h(v,null,h(q,{htmlFor:n.name},n.label),h(ln,Object.assign({},n)))}function cn(o){var e=o.hasError,t=o.onUpdate,i=o.onValidationError,a=o.pattern;void 0===a&&(a=U);var l=o.showErrors,c=o.minDate,p=o.maxDate,u=nn(o,["hasError","onUpdate","onValidationError","pattern","showErrors","minDate","maxDate"]),b=x(null),w=x(0),k=m(!1),O=k[0],_=k[1],D=m(),z=D[0],E=D[1],j=m(L(u.value?r(n(String(u.value),U),a).value:"")),F=j[0],B=j[1],C=n(F,a),T=g(function(n){i&&i(n),E(n)},[i,E]),I=g(function(r){r.persist(),O||_(!0);var o=r.target.value,e=L(o),t=L(o.slice(0,r.target.selectionEnd||0)),i=n(t,a).value;w.current=i.length,B(e)},[F,B]);return y(function(){b.current&&b.current.setSelectionRange(w.current,w.current)},[F]),f(function(){if(O){var o=J({date:r(n(F,a),U).value,min:c,max:p,pattern:a}),e=r(n(F,a),U).value;T(o),t&&t(e)}},[F,a,c,p,O,t,T]),h(v,null,h(Q,Object.assign({},{ref:b,preTab:h(d,{name:"Calendar"}),placeholder:a},u,{hasError:l&&Boolean(z)||e,value:C.value,onChange:I,onBlur:I})),l&&z&&h(s,{color:"error",fontSize:0},z))}function dn(n){var r=n.name,o=n.validate,e=n.pattern;void 0===e&&(e=U);var t=nn(n,["name","validate","pattern"]);return h(_,{name:r,validate:function(n){var r=J({date:n,min:t.minDate,max:t.maxDate,pattern:e}),i=o?o(n):void 0;return r||i}},function(n){var o=n.field,i=n.form,a=Boolean(z(i,["errors",r])),l=g(function(n){i.setFieldTouched(r),i.setFieldValue(r,n)},[r,i.setFieldValue]),s=g(function(n){i.setFieldError(r,n)},[r,i.setFieldError]);return h(cn,Object.assign({},t,o,{pattern:e,hasError:a,onUpdate:l,onValidationError:s}))})}function pn(n){return h(v,null,h(q,{htmlFor:n.name},n.label),h(dn,Object.assign({},n)))}function un(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 bn=a(p)(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 hn(n){var r=n.children,o=un(n,["children"]);return h(bn,Object.assign({},{as:"li"},o),r)}var mn=w(function(n,r){var o=n.children,e=un(n,["children"]);return h(p,Object.assign({},{ref:r,as:"ul",boxShadow:"medium",borderRadius:2,overflow:"auto",width:"100%",bg:"white"},e),o)});mn.displayName="Body";var fn=a.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"});fn.displayName="ControlOuter";var gn=w(function(n,r){var o=n.children,e=n.isActive,t=n.hasError,i=un(n,["children","isActive","hasError"]);return h("div",{style:{position:"relative"}},h(fn,Object.assign({},{ref:r,isActive:e,hasError:t,type:"button"},i),h(s,{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},h(s,{width:"100%",fontWeight:4,style:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",letterSpacing:"0.6px"}},o),h(d,{name:"ChevronDown",ml:"xs"}))),h(p,{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"}),h(p,{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 vn(n){var r=n.value,o=n.placeholder;return z(n.items.filter(function(n){return n.value===r})[0],"label")||o||"Please select"}function xn(n){var r=n.value,o=n.placeholder,e=n.label,t=n.items,a=n.hasError,l=n.disabled,s=n.onSelect,c=n.onRemove,d=m(vn({items:t,value:r,placeholder:o})),u=d[0],b=d[1];f(function(){b(vn({items:t,value:r,placeholder:o}))},[t,r,o]);var g=i({items:t.map(function(n){return Object.assign({},n,{selected:n.value===r})}),onSelect:function(n){b(n.label),s&&s(n)},onRemove:function(n){b(o||"Please select"),c&&c(n)}}),v=g.items,x=g.isOpen,y=g.getDropProps;return h(p,null,h(gn,Object.assign({},{id:g.id},l?{}:(0,g.getControlProps)(),{"aria-label":e,isActive:x,hasError:a,disabled:l}),u),x&&h(p,{position:"absolute",bottom:"0",width:"100%",transform:"translateY(100%) translateY(6px)",zIndex:1e3},h(mn,Object.assign({},y(),{style:{maxHeight:"240px",overflow:"auto"}}),v.map(function(n){return h(hn,Object.assign({},{key:n.value,selected:n.selected,highlighted:n.highlighted},n.getItemProps()),n.label)}))))}function yn(n){var r=n.name,o=n.validate,e=un(n,["name","validate"]);return h(_,{name:r,validate:o},function(n){var r=n.field,o=n.form,t=Boolean(o.errors&&o.errors[r.name]);return h(xn,Object.assign({},e,{hasError:t,onSelect:function(n){o.setFieldValue(r.name,n.value),e.onSelect&&e.onSelect(n)}}))})}function wn(n){return h(v,null,h(q,{htmlFor:n.name},n.label),h(yn,Object.assign({},n)))}function kn(n){return h(D,{name:n.name,render:function(n){return h(s,{color:"error",fontSize:0},n)}})}function On(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}gn.displayName="Control";var _n=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"]),Dn=a.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 "}),zn=a.div(function(n){var r=n.theme;return"\n width: 100%;\n border: 1px solid "+r.colors.outline+";\n border-radius: 4px;\n\n "+Bn+" {\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 & "+Bn+" {\n border-color: "+r.colors.error+" !important;\n }\n ":"")+"\n "}),En=a.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 "}),jn=a.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 ~ "+En+" {\n border-color: "+r.colors.primaryDark+";\n }\n &:focus ~ "+p+" "+Dn+" {\n color: "+r.colors.primary+";\n }\n\n &:checked ~ "+En+" {\n background: "+r.colors.primary+";\n border-color: "+r.colors.primaryDark+";\n\n &::after {\n transform: scale(1);\n }\n }\n &:checked ~ "+p+" "+Dn+" {\n color: "+r.colors.primary+";\n }\n\n &:disabled ~ "+En+" {\n border-color: "+r.colors.outline+" !important;\n }\n &:disabled ~ "+Fn+" {\n background-color: "+r.colors.background+";\n }\n &:disabled ~ "+p+" "+Dn+" {\n color: "+r.colors.secondary+" !important;\n }\n "}),Fn=a.span(_n),Bn=a.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 "+En+" {\n border-color: "+r.colors.primaryDark+";\n }\n &:hover "+Dn+" {\n color: "+r.colors.primary+";\n }\n "});function Cn(n){var r=n.name,o=n.checked,e=n.description,t=n.label,i=On(n,["children","name","checked","description","label"]),a=r+i.value;return h(Bn,{htmlFor:a},h(jn,Object.assign({},{id:a,name:r,type:"radio",checked:o},i)),h(En,{checked:o}),h(p,{display:"block",position:"relative",zIndex:1,width:"calc(100% - 32px)",maxWidth:"calc(100% - 32px)"},t&&h(Dn,null,t),e&&h(u,{mt:"xxs",color:"secondary",fontSize:0,fontWeight:4,lineHeight:0},e)),h(Fn,null))}function Tn(n){var r=n.children,o=n.name,e=n.validate,t=n.onChange,i=n.onBlur,a=On(n,["children","name","validate","onChange","onBlur"]);return h(_,{name:o,validate:e},function(n){var e=n.field,l=Boolean(z(n.form,["errors",o]));return h(zn,{hasError:l},k.toArray(r).map(function(n){return O(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 In(n){var r=n.label,o=On(n,["label"]);return h(v,null,h(q,{htmlFor:o.name},r),h(Tn,Object.assign({},o)))}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 Sn=a.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"});Sn.displayName="SelectElement";var Rn=w(function(n,r){var o=n.children,e=n.hasError,t=n.placeholder;void 0===t&&(t="");var i=Pn(n,["children","hasError","placeholder"]);return h(p,{ml:"-2px",mr:"-2px",p:"2px"},h(Sn,Object.assign({},{ref:r,hasValue:Boolean(i.value),hasError:e},i,{value:i.value||""}),t&&h("option",{value:"",disabled:!0},t),o),h(p,{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"}),h(p,{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"}),h(p,{position:"absolute",right:"0",top:"0",bottom:"0",height:"16px",my:"auto",pr:"sm",style:{pointerEvents:"none"}},h(d,{name:"ChevronDown",color:"secondary"})))});function Nn(n){var r=n.name,o=n.validate,e=n.onChange,t=n.onBlur,i=Pn(n,["name","validate","onChange","onBlur"]);return h(_,{name:r,validate:o},function(n){var o=n.field,a=Boolean(z(n.form,["errors",r]));return h(Rn,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 Hn(n){return h(v,null,h(q,{htmlFor:n.name},n.label),h(Nn,Object.assign({},n)))}var Vn=a(p)(function(n){return"\n border-left: 2px solid currentColor;\n padding-left: "+n.theme.space.sm+";\n "});function Mn(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=a.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"});Un.displayName="TextareaElement",Un.defaultProps={rows:4};var An=w(function(n,r){var o=n.hasError,e=Mn(n,["hasError"]);return h(p,{ml:"-2px",mr:"-2px",p:"2px"},h(Un,Object.assign({},{ref:r,hasError:o},e)),h(p,{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"}),h(p,{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 Yn(n){var r=n.name,o=n.validate,e=n.onChange,t=n.onBlur,i=Mn(n,["name","validate","onChange","onBlur"]);return h(_,{name:r,validate:o},function(n){var o=n.field,a=Boolean(z(n.form,["errors",r]));return h(An,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 Wn(n){return h(v,null,h(q,{htmlFor:n.name},n.label),h(Yn,Object.assign({},n)))}var Ln=Object.freeze(["\n display: block;\n position: relative;\n cursor: pointer;\n"]),Jn=a.label(Ln),Xn=a.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"}),qn=a.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 ~ "+Xn+",\n &:hover\n ~ "+Xn+",\n &:focus\n ~ "+Xn+" {\n border: 1px solid "+r.colors.primary+";\n background-color: rgba(91, 99, 254, 0.1);\n }\n\n &:checked ~ "+Xn+" {\n color: "+r.colors.primary+";\n }\n"});function Gn(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 h(Jn,{htmlFor:i},h(qn,Object.assign({},{id:i,type:"radio"},t)),h(Xn,{hasError:e},r&&h(b,{mb:"xs",background:"white",width:"48px",height:"48px"},r),h(s,{display:"flex",justifyContent:"center",minHeight:"32px",fontSize:0,fontWeight:5,lineHeight:0,width:"100%"},o)))}var Kn=Object.freeze(["\n ","\n"]),Qn="\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",Zn=a.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"}),$n=a.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 "}),nr=a.label(function(n){return"\n display: flex;\n align-items: center;\n margin-bottom: 0 !important;\n\n &:hover "+$n+" {\n "+Zn+" {\n border-color: "+n.theme.colors.primaryDark+";\n }\n }\n "}),rr=a.input(function(n){var r=n.theme;return"\n "+Qn+"\n\n &:focus ~ "+$n+" {\n border-color: "+r.colors.primary+";\n }\n &:checked ~ "+$n+" {\n border-color: "+r.colors.primary+";\n\n "+Zn+" {\n background: "+r.colors.primary+";\n border-color: "+r.colors.primaryDark+";\n transform: translateX(24px);\n }\n }\n &:disabled ~ "+$n+" {\n pointer-events: none;\n "+Zn+" {\n border-color: "+r.colors.outline+";\n }\n }\n "}),or=a.span(Kn,Qn);function er(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 h(nr,{htmlFor:o},h(rr,Object.assign({},{id:o,name:o,type:"checkbox",checked:e},t)),h($n,null,h(Zn,null,h(d,{name:"Check",width:"12px",height:"12px",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",m:"auto",style:{strokeWidth:"2px"}}))),h(or,null,r))}function tr(n){var r=n.label;return h(_,{name:n.name,validate:n.validate},function(n){var o=n.field;return h(er,Object.assign({},{label:r},o,{checked:Boolean(o.value)}))})}function ir(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=m(r),i=t[0],a=t[1],l=m(!1),s=l[1],c=l[0]?i:B(F(i,o),e),d=g(function(){s(!0)},[s]),p=g(function(){s(!1)},[s]);return f(function(){n.onUpdate&&n.onUpdate(i)},[i,n.onUpdate]),h(Q,Object.assign({},n,{value:c,onFocus:d,onClick:d,onBlur:p,onChange:function(n){var r=n.target.value,o=/\*\*/.test(r);a(o?"":j(r))}}))}function ar(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 h(_,{name:r,validate:o},function(n){var o=n.field,t=n.form,i=Boolean(z(t,["errors",r])),a=g(function(n){t.setFieldValue(r,n)},[r,t.setFieldValue]);return h(ir,Object.assign({},e,o,{hasError:i,onUpdate:a}))})}function lr(n){return h(v,null,h(q,{htmlFor:n.name},n.label),h(ar,Object.assign({},n)))}export{H as CheckboxGroup,V as Checkbox,M as CheckboxField,an as DateInput,ln as DateInputField,sn as DateInputFieldWithLabel,cn as DateInputTypeIn,dn as DateInputTypeInField,pn as DateInputTypeInFieldWithLabel,hn as Item,mn as Body,gn as Control,xn as Dropdown,yn as DropdownField,wn as DropdownFieldWithLabel,kn as ErrorMessage,Q as Input,Z as InputField,$ as InputFieldWithLabel,q as Label,Cn as Radio,Tn as RadioField,In as RadioFieldWithLabel,Rn as Select,Nn as SelectField,Hn as SelectFieldWithLabel,Vn as SubGroup,An as Textarea,Yn as TextareaField,Wn as TextareaFieldWithLabel,Gn as Tile,Qn as hidden,er as Toggle,tr as ToggleField,ir as SSNInput,ar as SSNInputField,lr as SSNInputFieldWithLabel};
import{picomask as n,transform as r}from"picomask";import{space as o,color as e,typography as t}from"styled-system";import{useSelect as i}from"use-drop";import a,{css as l}from"styled-components";import{Span as s,H5 as c,Icon as d,Box as p,P as u,Circle as b}from"@truework/ui";import{createElement as h,useState as m,useEffect as f,useCallback as g,Fragment as v,useRef as x,useLayoutEffect as y,forwardRef as w,Children as k,cloneElement as O}from"react";import{Field as _,ErrorMessage as D}from"formik";import{get as z,times as E}from"lodash";import{clean as j,mask as F,format as B}from"parse-ssn";function C(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 T=Object.freeze([""]),I=a(d)(T),P=a.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 "+I+" {\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 "}),S=a(c)(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 "}),R=a.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 ~ "+P+" {\n border-color: "+r.colors.primaryDark+";\n }\n &:checked ~ "+P+" {\n background: "+r.colors.primary+";\n border-color: "+r.colors.primaryDark+";\n\n "+I+" {\n transform: scale(1);\n }\n }\n &:focus ~ "+S+", &:focus ~"+s+", &:checked ~ "+s+" {\n color: "+r.colors.primary+";\n }\n\n "+(n.hasError?"\n & ~ "+P+" {\n border-color: "+r.colors.error+" !important;\n }\n ":"")+"\n "}),N=a.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 "+P+" {\n background: "+r.colors.background+";\n }\n "+s+" {\n color: "+r.colors.placeholder+";\n }\n ":"\n &:hover "+P+" {\n border-color: "+r.colors.primaryDark+";\n }\n &:hover "+S+", &:hover "+s+" {\n color: "+r.colors.primary+";\n }\n ")+"\n "}),H=a.div(function(n){var r=n.theme;return"\n width: 100%;\n\n "+N+" {\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 "+N+":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 "+N+":last-child {\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n }\n "});function V(n){var r=n.children,o=n.name,e=n.checked,t=n.disabled,i=C(n,["children","name","checked","disabled"]);return h(N,{htmlFor:o,disabled:t},h(R,Object.assign({},{id:o,name:o,type:"checkbox",checked:e,disabled:t},i)),h(P,{checked:e},h(I,{name:"Check"})),h(s,{display:"block",width:"calc(100% - 16px)",fontSize:1,lineHeight:1,fontWeight:5,style:{transitionProperty:"color",transitionDuration:"150ms",transitionTimingFunction:"ease-in-out"}},r))}function M(n){var r=n.name,o=n.validate,e=n.onChange,t=n.onBlur,i=C(n,["name","validate","onChange","onBlur"]);return h(_,{name:r,validate:o},function(n){var o=n.field,a=Boolean(z(n.form,["errors",r]));return h(V,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)}}))})}var U="yyyy-mm-dd",A=["January","February","March","April","May","June","July","August","September","October","November","December"];function Y(n){return new Date(n.year,n.month,0).getUTCDate()}function W(n){return n<10?"0"+n:""+n}function L(n){return n.replace(/[^\d]/g,"").slice(0,8)}function J(o){var e=o.date,t=o.min,i=o.max,a=o.pattern;void 0===a&&(a=U);var l=L(e);if(0!==l.length){var s=n(e,U),c=s.y,d=s.m,p=s.d,u=parseInt(c),b=parseInt(d),h=parseInt(p),m=Y({month:b,year:u});return l.length<8?"Please enter a valid date matching "+a:b>12?"There are only 12 months":"00"===p?"Day cannot be 0":"00"===d?"Month cannot be 0":"0000"===c?"Year cannot be 0":h>m?"There are only "+m+" days in "+A[b-1]+" "+u:t&&new Date(e)<new Date(t)?"Date must be after "+r(n(t,U),a).value:i&&new Date(e)>new Date(i)?"Date must be before "+r(n(i,U),a).value:void 0}}var X=Object.freeze(["\n display: block;\n position: relative;\n font-weight: 500;\n letter-spacing: 0.6px;\n ","\n ","\n ","\n"]),q=a.label(X,t,e,o);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}q.displayName="Label",q.defaultProps={fontSize:1,lineHeight:1,mb:"xs"};var K=a.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: 1px;\n border-radius: 4px;\n min-height: "+(o?"34px":"46px")+";\n padding: "+(o?"10px 16px":"14px 16px")+";\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 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"});K.displayName="InputElement";var Q=w(function(n,r){var o=n.hasError,e=n.preTab,t=n.postTab,i=G(n,["hasError","preTab","postTab"]),a=Boolean(e),l=e||t;return h(p,{display:"flex",ml:"-2px",mr:"-2px",p:"2px"},h(K,Object.assign({},{ref:r,hasError:o},i)),l&&h(p,{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),h(p,{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"}),h(p,{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 Z(n){var r=n.name,o=n.validate,e=n.onChange,t=n.onBlur,i=G(n,["name","validate","onChange","onBlur"]);return h(_,{name:r,validate:o},function(n){var o=n.field,a=Boolean(z(n.form,["errors",r]));return h(Q,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 $(n){return h(v,null,h(q,{htmlFor:n.name},n.label),h(Z,Object.assign({},n)))}function nn(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 rn=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 &:hover {\n opacity: 1;\n }\n "]),on=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 "]),en=a.select(function(n){var r=n.theme,o=n.hasError;return l(on,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)}),tn=a.button(function(n){var r=n.theme;return l(rn,r.colors.secondary,r.transitionDurations.fast,r.transitionTimingFunctions.ease)});function an(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 s=n.minDay;void 0===s&&(s=1);var c=n.minYear;void 0===c&&(c=1980);var u=n.maxMonth;void 0===u&&(u=12);var b=n.maxDay;void 0===b&&(b=31);var v=n.maxYear;void 0===v&&(v=2030);var x=n.hasError,y=n.onUpdate,w=m(t),k=w[0],O=w[1],_=m(i),D=_[0],z=_[1],j=m(a),F=j[0],B=j[1],C=Y({year:F||2020,month:k});f(function(){y(F&&k&&D?F+"-"+W(k)+"-"+W(D):"")},[k,D,F]);var T=g(function(){O(0),z(0),B(0)},[O,z,B]);return h(p,{ml:"-2px",mr:"-2px",p:"2px"},h(p,{display:"flex",alignItems:"center",height:"48px",pl:"56px"},h(en,{name:r+"-month",value:k,disabled:e,onChange:function(n){O(parseInt(n.target.value,10))},"aria-label":o+": Month",hasValue:Boolean(k),hasError:x},h("option",{value:"0",disabled:!0},"mm"),E(u-l+1,function(){return""}).map(function(n,r){var o=l+r;return h("option",{key:o,value:o},W(o))})),h(p,{height:"50%",width:"1px",bg:x?"error":"outline",zIndex:2,transform:"rotate(10deg)"}),h(en,{name:r+"-day",value:D,disabled:e,onChange:function(n){z(parseInt(n.target.value,10))},"aria-label":o+": Day",hasValue:Boolean(D),hasError:x},h("option",{value:"0",disabled:!0},"dd"),E(Math.min(b,C)-s+1,function(){return""}).map(function(n,r){var o=s+r;return h("option",{key:o,value:o},W(o))})),h(p,{height:"50%",width:"1px",bg:x?"error":"outline",zIndex:2,transform:"rotate(10deg)"}),h(en,{name:r+"-year",value:F,disabled:e,onChange:function(n){B(parseInt(n.target.value,10))},"aria-label":o+": Year",hasValue:Boolean(F),hasError:x},h("option",{value:"0",disabled:!0},"yyyy"),E(v-c+1,function(n){return c+n}).map(function(n){return h("option",{key:n,value:n},n)})),(k||D||F)&&h(tn,{title:"Clear",onClick:T},h(d,{name:"X",width:"12px",height:"12px"})),h(p,{className:"__bg",bg:x?"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"}),h(p,{className:"__border",bg:"white",border:["1px solid",x?"error":"outline"],position:"absolute",top:"0",bottom:"0",left:"0",right:"0",zIndex:0,borderRadius:"4px",transitionProperty:"border-color",transitionDuration:"fast",transitionTimingFunction:"ease"},h(p,{"aria-hidden":"true",position:"absolute",top:"0",left:"0",display:"flex",alignItems:"center",justifyContent:"center",px:"sm",height:"100%",zIndex:0,color:x?"error":"secondary",bg:x?"#FDEBF0":"background",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px",borderRight:["1px solid",x?"error":"outline"],transitionProperty:"border-color, color",transitionDuration:"fast",transitionTimingFunction:"ease"},h(d,{name:"Calendar"})))))}function ln(n){var r=n.name,o=n.validate,e=nn(n,["name","validate"]);return h(_,{name:r,validate:o},function(n){var o=n.field,t=n.form,i=Boolean(z(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=""),h(an,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 sn(n){return h(v,null,h(q,{htmlFor:n.name},n.label),h(ln,Object.assign({},n)))}function cn(o){var e=o.hasError,t=o.onUpdate,i=o.onValidationError,a=o.pattern;void 0===a&&(a=U);var l=o.showErrors,c=o.minDate,p=o.maxDate,u=nn(o,["hasError","onUpdate","onValidationError","pattern","showErrors","minDate","maxDate"]),b=x(null),w=x(0),k=m(!1),O=k[0],_=k[1],D=m(),z=D[0],E=D[1],j=m(L(u.value?r(n(String(u.value),U),a).value:"")),F=j[0],B=j[1],C=n(F,a),T=g(function(n){i&&i(n),E(n)},[i,E]),I=g(function(r){r.persist(),O||_(!0);var o=r.target.value,e=L(o),t=L(o.slice(0,r.target.selectionEnd||0)),i=n(t,a).value;w.current=i.length,B(e)},[F,B]);return y(function(){b.current&&b.current.setSelectionRange(w.current,w.current)},[F]),f(function(){if(O){var o=J({date:r(n(F,a),U).value,min:c,max:p,pattern:a}),e=r(n(F,a),U).value;T(o),t&&t(e)}},[F,a,c,p,O,t,T]),h(v,null,h(Q,Object.assign({},{ref:b,preTab:h(d,{name:"Calendar"}),placeholder:a},u,{hasError:l&&Boolean(z)||e,value:C.value,onChange:I,onBlur:I})),l&&z&&h(s,{color:"error",fontSize:0},z))}function dn(n){var r=n.name,o=n.validate,e=n.pattern;void 0===e&&(e=U);var t=nn(n,["name","validate","pattern"]);return h(_,{name:r,validate:function(n){var r=J({date:n||"",min:t.minDate,max:t.maxDate,pattern:e}),i=o?o(n):void 0;return r||i}},function(n){var o=n.field,i=n.form,a=Boolean(z(i,["errors",r])),l=g(function(n){i.setFieldTouched(r),i.setFieldValue(r,n)},[r,i.setFieldValue]),s=g(function(n){i.setFieldError(r,n)},[r,i.setFieldError]);return h(cn,Object.assign({},t,o,{pattern:e,hasError:a,onUpdate:l,onValidationError:s}))})}function pn(n){return h(v,null,h(q,{htmlFor:n.name},n.label),h(dn,Object.assign({},n)))}function un(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 bn=a(p)(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 hn(n){var r=n.children,o=un(n,["children"]);return h(bn,Object.assign({},{as:"li"},o),r)}var mn=w(function(n,r){var o=n.children,e=un(n,["children"]);return h(p,Object.assign({},{ref:r,as:"ul",boxShadow:"medium",borderRadius:2,overflow:"auto",width:"100%",bg:"white"},e),o)});mn.displayName="Body";var fn=a.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"});fn.displayName="ControlOuter";var gn=w(function(n,r){var o=n.children,e=n.isActive,t=n.hasError,i=un(n,["children","isActive","hasError"]);return h("div",{style:{position:"relative"}},h(fn,Object.assign({},{ref:r,isActive:e,hasError:t,type:"button"},i),h(s,{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},h(s,{width:"100%",fontWeight:4,style:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",letterSpacing:"0.6px"}},o),h(d,{name:"ChevronDown",ml:"xs"}))),h(p,{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"}),h(p,{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 vn(n){var r=n.value,o=n.placeholder;return z(n.items.filter(function(n){return n.value===r})[0],"label")||o||"Please select"}function xn(n){var r=n.value,o=n.placeholder,e=n.label,t=n.items,a=n.hasError,l=n.disabled,s=n.onSelect,c=n.onRemove,d=m(vn({items:t,value:r,placeholder:o})),u=d[0],b=d[1];f(function(){b(vn({items:t,value:r,placeholder:o}))},[t,r,o]);var g=i({items:t.map(function(n){return Object.assign({},n,{selected:n.value===r})}),onSelect:function(n){b(n.label),s&&s(n)},onRemove:function(n){b(o||"Please select"),c&&c(n)}}),v=g.items,x=g.isOpen,y=g.getDropProps;return h(p,null,h(gn,Object.assign({},{id:g.id},l?{}:(0,g.getControlProps)(),{"aria-label":e,isActive:x,hasError:a,disabled:l}),u),x&&h(p,{position:"absolute",bottom:"0",width:"100%",transform:"translateY(100%) translateY(6px)",zIndex:1e3},h(mn,Object.assign({},y(),{style:{maxHeight:"240px",overflow:"auto"}}),v.map(function(n){return h(hn,Object.assign({},{key:n.value,selected:n.selected,highlighted:n.highlighted},n.getItemProps()),n.label)}))))}function yn(n){var r=n.name,o=n.validate,e=un(n,["name","validate"]);return h(_,{name:r,validate:o},function(n){var r=n.field,o=n.form,t=Boolean(o.errors&&o.errors[r.name]);return h(xn,Object.assign({},e,{hasError:t,onSelect:function(n){o.setFieldValue(r.name,n.value),e.onSelect&&e.onSelect(n)}}))})}function wn(n){return h(v,null,h(q,{htmlFor:n.name},n.label),h(yn,Object.assign({},n)))}function kn(n){return h(D,{name:n.name,render:function(n){return h(s,{color:"error",fontSize:0},n)}})}function On(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}gn.displayName="Control";var _n=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"]),Dn=a.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 "}),zn=a.div(function(n){var r=n.theme;return"\n width: 100%;\n border: 1px solid "+r.colors.outline+";\n border-radius: 4px;\n\n "+Bn+" {\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 & "+Bn+" {\n border-color: "+r.colors.error+" !important;\n }\n ":"")+"\n "}),En=a.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 "}),jn=a.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 ~ "+En+" {\n border-color: "+r.colors.primaryDark+";\n }\n &:focus ~ "+p+" "+Dn+" {\n color: "+r.colors.primary+";\n }\n\n &:checked ~ "+En+" {\n background: "+r.colors.primary+";\n border-color: "+r.colors.primaryDark+";\n\n &::after {\n transform: scale(1);\n }\n }\n &:checked ~ "+p+" "+Dn+" {\n color: "+r.colors.primary+";\n }\n\n &:disabled ~ "+En+" {\n border-color: "+r.colors.outline+" !important;\n }\n &:disabled ~ "+Fn+" {\n background-color: "+r.colors.background+";\n }\n &:disabled ~ "+p+" "+Dn+" {\n color: "+r.colors.secondary+" !important;\n }\n "}),Fn=a.span(_n),Bn=a.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 "+En+" {\n border-color: "+r.colors.primaryDark+";\n }\n &:hover "+Dn+" {\n color: "+r.colors.primary+";\n }\n "});function Cn(n){var r=n.name,o=n.checked,e=n.description,t=n.label,i=On(n,["children","name","checked","description","label"]),a=r+i.value;return h(Bn,{htmlFor:a},h(jn,Object.assign({},{id:a,name:r,type:"radio",checked:o},i)),h(En,{checked:o}),h(p,{display:"block",position:"relative",zIndex:1,width:"calc(100% - 32px)",maxWidth:"calc(100% - 32px)"},t&&h(Dn,null,t),e&&h(u,{mt:"xxs",color:"secondary",fontSize:0,fontWeight:4,lineHeight:0},e)),h(Fn,null))}function Tn(n){var r=n.children,o=n.name,e=n.validate,t=n.onChange,i=n.onBlur,a=On(n,["children","name","validate","onChange","onBlur"]);return h(_,{name:o,validate:e},function(n){var e=n.field,l=Boolean(z(n.form,["errors",o]));return h(zn,{hasError:l},k.toArray(r).map(function(n){return O(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 In(n){var r=n.label,o=On(n,["label"]);return h(v,null,h(q,{htmlFor:o.name},r),h(Tn,Object.assign({},o)))}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 Sn=a.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"});Sn.displayName="SelectElement";var Rn=w(function(n,r){var o=n.children,e=n.hasError,t=n.placeholder;void 0===t&&(t="");var i=Pn(n,["children","hasError","placeholder"]);return h(p,{ml:"-2px",mr:"-2px",p:"2px"},h(Sn,Object.assign({},{ref:r,hasValue:Boolean(i.value),hasError:e},i,{value:i.value||""}),t&&h("option",{value:"",disabled:!0},t),o),h(p,{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"}),h(p,{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"}),h(p,{position:"absolute",right:"0",top:"0",bottom:"0",height:"16px",my:"auto",pr:"sm",style:{pointerEvents:"none"}},h(d,{name:"ChevronDown",color:"secondary"})))});function Nn(n){var r=n.name,o=n.validate,e=n.onChange,t=n.onBlur,i=Pn(n,["name","validate","onChange","onBlur"]);return h(_,{name:r,validate:o},function(n){var o=n.field,a=Boolean(z(n.form,["errors",r]));return h(Rn,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 Hn(n){return h(v,null,h(q,{htmlFor:n.name},n.label),h(Nn,Object.assign({},n)))}var Vn=a(p)(function(n){return"\n border-left: 2px solid currentColor;\n padding-left: "+n.theme.space.sm+";\n "});function Mn(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=a.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"});Un.displayName="TextareaElement",Un.defaultProps={rows:4};var An=w(function(n,r){var o=n.hasError,e=Mn(n,["hasError"]);return h(p,{ml:"-2px",mr:"-2px",p:"2px"},h(Un,Object.assign({},{ref:r,hasError:o},e)),h(p,{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"}),h(p,{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 Yn(n){var r=n.name,o=n.validate,e=n.onChange,t=n.onBlur,i=Mn(n,["name","validate","onChange","onBlur"]);return h(_,{name:r,validate:o},function(n){var o=n.field,a=Boolean(z(n.form,["errors",r]));return h(An,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 Wn(n){return h(v,null,h(q,{htmlFor:n.name},n.label),h(Yn,Object.assign({},n)))}var Ln=Object.freeze(["\n display: block;\n position: relative;\n cursor: pointer;\n"]),Jn=a.label(Ln),Xn=a.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"}),qn=a.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 ~ "+Xn+",\n &:hover\n ~ "+Xn+",\n &:focus\n ~ "+Xn+" {\n border: 1px solid "+r.colors.primary+";\n background-color: rgba(91, 99, 254, 0.1);\n }\n\n &:checked ~ "+Xn+" {\n color: "+r.colors.primary+";\n }\n"});function Gn(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 h(Jn,{htmlFor:i},h(qn,Object.assign({},{id:i,type:"radio"},t)),h(Xn,{hasError:e},r&&h(b,{mb:"xs",background:"white",width:"48px",height:"48px"},r),h(s,{display:"flex",justifyContent:"center",minHeight:"32px",fontSize:0,fontWeight:5,lineHeight:0,width:"100%"},o)))}var Kn=Object.freeze(["\n ","\n"]),Qn="\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",Zn=a.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"}),$n=a.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 "}),nr=a.label(function(n){return"\n display: flex;\n align-items: center;\n margin-bottom: 0 !important;\n\n &:hover "+$n+" {\n "+Zn+" {\n border-color: "+n.theme.colors.primaryDark+";\n }\n }\n "}),rr=a.input(function(n){var r=n.theme;return"\n "+Qn+"\n\n &:focus ~ "+$n+" {\n border-color: "+r.colors.primary+";\n }\n &:checked ~ "+$n+" {\n border-color: "+r.colors.primary+";\n\n "+Zn+" {\n background: "+r.colors.primary+";\n border-color: "+r.colors.primaryDark+";\n transform: translateX(24px);\n }\n }\n &:disabled ~ "+$n+" {\n pointer-events: none;\n "+Zn+" {\n border-color: "+r.colors.outline+";\n }\n }\n "}),or=a.span(Kn,Qn);function er(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 h(nr,{htmlFor:o},h(rr,Object.assign({},{id:o,name:o,type:"checkbox",checked:e},t)),h($n,null,h(Zn,null,h(d,{name:"Check",width:"12px",height:"12px",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",m:"auto",style:{strokeWidth:"2px"}}))),h(or,null,r))}function tr(n){var r=n.label;return h(_,{name:n.name,validate:n.validate},function(n){var o=n.field;return h(er,Object.assign({},{label:r},o,{checked:Boolean(o.value)}))})}function ir(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=m(r),i=t[0],a=t[1],l=m(!1),s=l[1],c=l[0]?i:B(F(i,o),e),d=g(function(){s(!0)},[s]),p=g(function(){s(!1)},[s]);return f(function(){n.onUpdate&&n.onUpdate(i)},[i,n.onUpdate]),h(Q,Object.assign({},n,{value:c,onFocus:d,onClick:d,onBlur:p,onChange:function(n){var r=n.target.value,o=/\*\*/.test(r);a(o?"":j(r))}}))}function ar(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 h(_,{name:r,validate:o},function(n){var o=n.field,t=n.form,i=Boolean(z(t,["errors",r])),a=g(function(n){t.setFieldValue(r,n)},[r,t.setFieldValue]);return h(ir,Object.assign({},e,o,{hasError:i,onUpdate:a}))})}function lr(n){return h(v,null,h(q,{htmlFor:n.name},n.label),h(ar,Object.assign({},n)))}export{H as CheckboxGroup,V as Checkbox,M as CheckboxField,an as DateInput,ln as DateInputField,sn as DateInputFieldWithLabel,cn as DateInputTypeIn,dn as DateInputTypeInField,pn as DateInputTypeInFieldWithLabel,hn as Item,mn as Body,gn as Control,xn as Dropdown,yn as DropdownField,wn as DropdownFieldWithLabel,kn as ErrorMessage,Q as Input,Z as InputField,$ as InputFieldWithLabel,q as Label,Cn as Radio,Tn as RadioField,In as RadioFieldWithLabel,Rn as Select,Nn as SelectField,Hn as SelectFieldWithLabel,Vn as SubGroup,An as Textarea,Yn as TextareaField,Wn as TextareaFieldWithLabel,Gn as Tile,Qn as hidden,er as Toggle,tr as ToggleField,ir as SSNInput,ar as SSNInputField,lr as SSNInputFieldWithLabel};
//# sourceMappingURL=index.esm.js.map

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

var n,e=require("picomask"),r=require("styled-system"),o=require("use-drop"),t=require("styled-components"),a=(n=t)&&"object"==typeof n&&"default"in n?n.default:n,i=require("@truework/ui"),l=require("react"),s=require("formik"),c=require("lodash"),d=require("parse-ssn");function p(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}var u=Object.freeze([""]),m=a(i.Icon)(u),b=a.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 "+m+" {\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 "}),h=a(i.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 "}),f=a.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 ~ "+b+" {\n border-color: "+e.colors.primaryDark+";\n }\n &:checked ~ "+b+" {\n background: "+e.colors.primary+";\n border-color: "+e.colors.primaryDark+";\n\n "+m+" {\n transform: scale(1);\n }\n }\n &:focus ~ "+h+", &:focus ~"+i.Span+", &:checked ~ "+i.Span+" {\n color: "+e.colors.primary+";\n }\n\n "+(n.hasError?"\n & ~ "+b+" {\n border-color: "+e.colors.error+" !important;\n }\n ":"")+"\n "}),g=a.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 "+b+" {\n background: "+e.colors.background+";\n }\n "+i.Span+" {\n color: "+e.colors.placeholder+";\n }\n ":"\n &:hover "+b+" {\n border-color: "+e.colors.primaryDark+";\n }\n &:hover "+h+", &:hover "+i.Span+" {\n color: "+e.colors.primary+";\n }\n ")+"\n "}),x=a.div(function(n){var e=n.theme;return"\n width: 100%;\n\n "+g+" {\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 "+g+":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 "+g+":last-child {\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n }\n "});function v(n){var e=n.children,r=n.name,o=n.checked,t=n.disabled,a=p(n,["children","name","checked","disabled"]);return l.createElement(g,{htmlFor:r,disabled:t},l.createElement(f,Object.assign({},{id:r,name:r,type:"checkbox",checked:o,disabled:t},a)),l.createElement(b,{checked:o},l.createElement(m,{name:"Check"})),l.createElement(i.Span,{display:"block",width:"calc(100% - 16px)",fontSize:1,lineHeight:1,fontWeight:5,style:{transitionProperty:"color",transitionDuration:"150ms",transitionTimingFunction:"ease-in-out"}},e))}var y="yyyy-mm-dd",E=["January","February","March","April","May","June","July","August","September","October","November","December"];function k(n){return new Date(n.year,n.month,0).getUTCDate()}function w(n){return n<10?"0"+n:""+n}function F(n){return n.replace(/[^\d]/g,"").slice(0,8)}function B(n){var r=n.date,o=n.min,t=n.max,a=n.pattern;void 0===a&&(a=y);var i=F(r);if(0!==i.length){var l=e.picomask(r,y),s=l.y,c=l.m,d=l.d,p=parseInt(s),u=parseInt(c),m=parseInt(d),b=k({month:u,year:p});return i.length<8?"Please enter a valid date matching "+a:u>12?"There are only 12 months":"00"===d?"Day cannot be 0":"00"===c?"Month cannot be 0":"0000"===s?"Year cannot be 0":m>b?"There are only "+b+" days in "+E[u-1]+" "+p:o&&new Date(r)<new Date(o)?"Date must be after "+e.transform(e.picomask(o,y),a).value:t&&new Date(r)>new Date(t)?"Date must be before "+e.transform(e.picomask(t,y),a).value:void 0}}var O=Object.freeze(["\n display: block;\n position: relative;\n font-weight: 500;\n letter-spacing: 0.6px;\n ","\n ","\n ","\n"]),D=a.label(O,r.typography,r.color,r.space);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}D.displayName="Label",D.defaultProps={fontSize:1,lineHeight:1,mb:"xs"};var C=a.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: 1px;\n border-radius: 4px;\n min-height: "+(r?"34px":"46px")+";\n padding: "+(r?"10px 16px":"14px 16px")+";\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 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"});C.displayName="InputElement";var j=l.forwardRef(function(n,e){var r=n.hasError,o=n.preTab,t=n.postTab,a=_(n,["hasError","preTab","postTab"]),s=Boolean(o),c=o||t;return l.createElement(i.Box,{display:"flex",ml:"-2px",mr:"-2px",p:"2px"},l.createElement(C,Object.assign({},{ref:e,hasError:r},a)),c&&l.createElement(i.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),l.createElement(i.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"}),l.createElement(i.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 z(n){var e=n.name,r=n.validate,o=n.onChange,t=n.onBlur,a=_(n,["name","validate","onChange","onBlur"]);return l.createElement(s.Field,{name:e,validate:r},function(n){var r=n.field,i=Boolean(c.get(n.form,["errors",e]));return l.createElement(j,Object.assign({},a,r,{hasError:i,onChange:function(n){r.onChange(n),o&&o(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}function S(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 I=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 &:hover {\n opacity: 1;\n }\n "]),T=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 "]),R=a.select(function(n){var e=n.theme,r=n.hasError;return t.css(T,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)}),P=a.button(function(n){var e=n.theme;return t.css(I,e.colors.secondary,e.transitionDurations.fast,e.transitionTimingFunctions.ease)});function N(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 a=n.initialDay;void 0===a&&(a=0);var s=n.initialYear;void 0===s&&(s=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=l.useState(t),v=x[0],y=x[1],E=l.useState(a),F=E[0],B=E[1],O=l.useState(s),D=O[0],_=O[1],C=k({year:D||2020,month:v});l.useEffect(function(){g(D&&v&&F?D+"-"+w(v)+"-"+w(F):"")},[v,F,D]);var j=l.useCallback(function(){y(0),B(0),_(0)},[y,B,_]);return l.createElement(i.Box,{ml:"-2px",mr:"-2px",p:"2px"},l.createElement(i.Box,{display:"flex",alignItems:"center",height:"48px",pl:"56px"},l.createElement(R,{name:e+"-month",value:v,disabled:o,onChange:function(n){y(parseInt(n.target.value,10))},"aria-label":r+": Month",hasValue:Boolean(v),hasError:f},l.createElement("option",{value:"0",disabled:!0},"mm"),c.times(m-d+1,function(){return""}).map(function(n,e){var r=d+e;return l.createElement("option",{key:r,value:r},w(r))})),l.createElement(i.Box,{height:"50%",width:"1px",bg:f?"error":"outline",zIndex:2,transform:"rotate(10deg)"}),l.createElement(R,{name:e+"-day",value:F,disabled:o,onChange:function(n){B(parseInt(n.target.value,10))},"aria-label":r+": Day",hasValue:Boolean(F),hasError:f},l.createElement("option",{value:"0",disabled:!0},"dd"),c.times(Math.min(b,C)-p+1,function(){return""}).map(function(n,e){var r=p+e;return l.createElement("option",{key:r,value:r},w(r))})),l.createElement(i.Box,{height:"50%",width:"1px",bg:f?"error":"outline",zIndex:2,transform:"rotate(10deg)"}),l.createElement(R,{name:e+"-year",value:D,disabled:o,onChange:function(n){_(parseInt(n.target.value,10))},"aria-label":r+": Year",hasValue:Boolean(D),hasError:f},l.createElement("option",{value:"0",disabled:!0},"yyyy"),c.times(h-u+1,function(n){return u+n}).map(function(n){return l.createElement("option",{key:n,value:n},n)})),(v||F||D)&&l.createElement(P,{title:"Clear",onClick:j},l.createElement(i.Icon,{name:"X",width:"12px",height:"12px"})),l.createElement(i.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"}),l.createElement(i.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"},l.createElement(i.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"},l.createElement(i.Icon,{name:"Calendar"})))))}function H(n){var e=n.name,r=n.validate,o=S(n,["name","validate"]);return l.createElement(s.Field,{name:e,validate:r},function(n){var r=n.field,t=n.form,a=Boolean(c.get(t,["errors",e])),i=(r.value||"").split("-"),s=i[0];void 0===s&&(s="");var d=i[1];void 0===d&&(d="");var p=i[2];return void 0===p&&(p=""),l.createElement(N,Object.assign({},{name:e},o,{initialMonth:d?parseInt(d,10):void 0,initialDay:p?parseInt(p,10):void 0,initialYear:s?parseInt(s,10):void 0,hasError:a,onUpdate:function(n){t.setFieldValue(e,n)}}))})}function V(n){var r=n.hasError,o=n.onUpdate,t=n.onValidationError,a=n.pattern;void 0===a&&(a=y);var s=n.showErrors,c=n.minDate,d=n.maxDate,p=S(n,["hasError","onUpdate","onValidationError","pattern","showErrors","minDate","maxDate"]),u=l.useRef(null),m=l.useRef(0),b=l.useState(!1),h=b[0],f=b[1],g=l.useState(),x=g[0],v=g[1],E=l.useState(F(p.value?e.transform(e.picomask(String(p.value),y),a).value:"")),k=E[0],w=E[1],O=e.picomask(k,a),D=l.useCallback(function(n){t&&t(n),v(n)},[t,v]),_=l.useCallback(function(n){n.persist(),h||f(!0);var r=n.target.value,o=F(r),t=F(r.slice(0,n.target.selectionEnd||0)),i=e.picomask(t,a).value;m.current=i.length,w(o)},[k,w]);return l.useLayoutEffect(function(){u.current&&u.current.setSelectionRange(m.current,m.current)},[k]),l.useEffect(function(){if(h){var n=B({date:e.transform(e.picomask(k,a),y).value,min:c,max:d,pattern:a}),r=e.transform(e.picomask(k,a),y).value;D(n),o&&o(r)}},[k,a,c,d,h,o,D]),l.createElement(l.Fragment,null,l.createElement(j,Object.assign({},{ref:u,preTab:l.createElement(i.Icon,{name:"Calendar"}),placeholder:a},p,{hasError:s&&Boolean(x)||r,value:O.value,onChange:_,onBlur:_})),s&&x&&l.createElement(i.Span,{color:"error",fontSize:0},x))}function L(n){var e=n.name,r=n.validate,o=n.pattern;void 0===o&&(o=y);var t=S(n,["name","validate","pattern"]);return l.createElement(s.Field,{name:e,validate:function(n){var e=B({date:n,min:t.minDate,max:t.maxDate,pattern:o}),a=r?r(n):void 0;return e||a}},function(n){var r=n.field,a=n.form,i=Boolean(c.get(a,["errors",e])),s=l.useCallback(function(n){a.setFieldTouched(e),a.setFieldValue(e,n)},[e,a.setFieldValue]),d=l.useCallback(function(n){a.setFieldError(e,n)},[e,a.setFieldError]);return l.createElement(V,Object.assign({},t,r,{pattern:o,hasError:i,onUpdate:s,onValidationError:d}))})}function W(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 M=a(i.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 U(n){var e=n.children,r=W(n,["children"]);return l.createElement(M,Object.assign({},{as:"li"},r),e)}var q=l.forwardRef(function(n,e){var r=n.children,o=W(n,["children"]);return l.createElement(i.Box,Object.assign({},{ref:e,as:"ul",boxShadow:"medium",borderRadius:2,overflow:"auto",width:"100%",bg:"white"},o),r)});q.displayName="Body";var A=a.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"});A.displayName="ControlOuter";var Y=l.forwardRef(function(n,e){var r=n.children,o=n.isActive,t=n.hasError,a=W(n,["children","isActive","hasError"]);return l.createElement("div",{style:{position:"relative"}},l.createElement(A,Object.assign({},{ref:e,isActive:o,hasError:t,type:"button"},a),l.createElement(i.Span,{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},l.createElement(i.Span,{width:"100%",fontWeight:4,style:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",letterSpacing:"0.6px"}},r),l.createElement(i.Icon,{name:"ChevronDown",ml:"xs"}))),l.createElement(i.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"}),l.createElement(i.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 J(n){var e=n.value,r=n.placeholder;return c.get(n.items.filter(function(n){return n.value===e})[0],"label")||r||"Please select"}function G(n){var e=n.value,r=n.placeholder,t=n.label,a=n.items,s=n.hasError,c=n.disabled,d=n.onSelect,p=n.onRemove,u=l.useState(J({items:a,value:e,placeholder:r})),m=u[0],b=u[1];l.useEffect(function(){b(J({items:a,value:e,placeholder:r}))},[a,e,r]);var h=o.useSelect({items:a.map(function(n){return Object.assign({},n,{selected:n.value===e})}),onSelect:function(n){b(n.label),d&&d(n)},onRemove:function(n){b(r||"Please select"),p&&p(n)}}),f=h.items,g=h.isOpen,x=h.getDropProps;return l.createElement(i.Box,null,l.createElement(Y,Object.assign({},{id:h.id},c?{}:(0,h.getControlProps)(),{"aria-label":t,isActive:g,hasError:s,disabled:c}),m),g&&l.createElement(i.Box,{position:"absolute",bottom:"0",width:"100%",transform:"translateY(100%) translateY(6px)",zIndex:1e3},l.createElement(q,Object.assign({},x(),{style:{maxHeight:"240px",overflow:"auto"}}),f.map(function(n){return l.createElement(U,Object.assign({},{key:n.value,selected:n.selected,highlighted:n.highlighted},n.getItemProps()),n.label)}))))}function X(n){var e=n.name,r=n.validate,o=W(n,["name","validate"]);return l.createElement(s.Field,{name:e,validate:r},function(n){var e=n.field,r=n.form,t=Boolean(r.errors&&r.errors[e.name]);return l.createElement(G,Object.assign({},o,{hasError:t,onSelect:function(n){r.setFieldValue(e.name,n.value),o.onSelect&&o.onSelect(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}Y.displayName="Control";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"]),Z=a.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 "}),$=a.div(function(n){var e=n.theme;return"\n width: 100%;\n border: 1px solid "+e.colors.outline+";\n border-radius: 4px;\n\n "+on+" {\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 & "+on+" {\n border-color: "+e.colors.error+" !important;\n }\n ":"")+"\n "}),nn=a.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 "}),en=a.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 ~ "+nn+" {\n border-color: "+e.colors.primaryDark+";\n }\n &:focus ~ "+i.Box+" "+Z+" {\n color: "+e.colors.primary+";\n }\n\n &:checked ~ "+nn+" {\n background: "+e.colors.primary+";\n border-color: "+e.colors.primaryDark+";\n\n &::after {\n transform: scale(1);\n }\n }\n &:checked ~ "+i.Box+" "+Z+" {\n color: "+e.colors.primary+";\n }\n\n &:disabled ~ "+nn+" {\n border-color: "+e.colors.outline+" !important;\n }\n &:disabled ~ "+rn+" {\n background-color: "+e.colors.background+";\n }\n &:disabled ~ "+i.Box+" "+Z+" {\n color: "+e.colors.secondary+" !important;\n }\n "}),rn=a.span(Q),on=a.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 "+nn+" {\n border-color: "+e.colors.primaryDark+";\n }\n &:hover "+Z+" {\n color: "+e.colors.primary+";\n }\n "});function tn(n){var e=n.children,r=n.name,o=n.validate,t=n.onChange,a=n.onBlur,i=K(n,["children","name","validate","onChange","onBlur"]);return l.createElement(s.Field,{name:r,validate:o},function(n){var o=n.field,s=Boolean(c.get(n.form,["errors",r]));return l.createElement($,{hasError:s},l.Children.toArray(e).map(function(n){return l.cloneElement(n,Object.assign({},o,i,{value:n.props.value,hasError:s,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 an(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 ln=a.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"});ln.displayName="SelectElement";var sn=l.forwardRef(function(n,e){var r=n.children,o=n.hasError,t=n.placeholder;void 0===t&&(t="");var a=an(n,["children","hasError","placeholder"]);return l.createElement(i.Box,{ml:"-2px",mr:"-2px",p:"2px"},l.createElement(ln,Object.assign({},{ref:e,hasValue:Boolean(a.value),hasError:o},a,{value:a.value||""}),t&&l.createElement("option",{value:"",disabled:!0},t),r),l.createElement(i.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"}),l.createElement(i.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"}),l.createElement(i.Box,{position:"absolute",right:"0",top:"0",bottom:"0",height:"16px",my:"auto",pr:"sm",style:{pointerEvents:"none"}},l.createElement(i.Icon,{name:"ChevronDown",color:"secondary"})))});function cn(n){var e=n.name,r=n.validate,o=n.onChange,t=n.onBlur,a=an(n,["name","validate","onChange","onBlur"]);return l.createElement(s.Field,{name:e,validate:r},function(n){var r=n.field,i=Boolean(c.get(n.form,["errors",e]));return l.createElement(sn,Object.assign({},a,r,{hasError:i,onChange:function(n){r.onChange(n),o&&o(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}var dn=a(i.Box)(function(n){return"\n border-left: 2px solid currentColor;\n padding-left: "+n.theme.space.sm+";\n "});function pn(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 un=a.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"});un.displayName="TextareaElement",un.defaultProps={rows:4};var mn=l.forwardRef(function(n,e){var r=n.hasError,o=pn(n,["hasError"]);return l.createElement(i.Box,{ml:"-2px",mr:"-2px",p:"2px"},l.createElement(un,Object.assign({},{ref:e,hasError:r},o)),l.createElement(i.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"}),l.createElement(i.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 bn(n){var e=n.name,r=n.validate,o=n.onChange,t=n.onBlur,a=pn(n,["name","validate","onChange","onBlur"]);return l.createElement(s.Field,{name:e,validate:r},function(n){var r=n.field,i=Boolean(c.get(n.form,["errors",e]));return l.createElement(mn,Object.assign({},a,r,{hasError:i,onChange:function(n){r.onChange(n),o&&o(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}var hn=Object.freeze(["\n display: block;\n position: relative;\n cursor: pointer;\n"]),fn=a.label(hn),gn=a.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"}),xn=a.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 ~ "+gn+",\n &:hover\n ~ "+gn+",\n &:focus\n ~ "+gn+" {\n border: 1px solid "+e.colors.primary+";\n background-color: rgba(91, 99, 254, 0.1);\n }\n\n &:checked ~ "+gn+" {\n color: "+e.colors.primary+";\n }\n"}),vn=Object.freeze(["\n ","\n"]),yn="\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",En=a.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"}),kn=a.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 "}),wn=a.label(function(n){return"\n display: flex;\n align-items: center;\n margin-bottom: 0 !important;\n\n &:hover "+kn+" {\n "+En+" {\n border-color: "+n.theme.colors.primaryDark+";\n }\n }\n "}),Fn=a.input(function(n){var e=n.theme;return"\n "+yn+"\n\n &:focus ~ "+kn+" {\n border-color: "+e.colors.primary+";\n }\n &:checked ~ "+kn+" {\n border-color: "+e.colors.primary+";\n\n "+En+" {\n background: "+e.colors.primary+";\n border-color: "+e.colors.primaryDark+";\n transform: translateX(24px);\n }\n }\n &:disabled ~ "+kn+" {\n pointer-events: none;\n "+En+" {\n border-color: "+e.colors.outline+";\n }\n }\n "}),Bn=a.span(vn,yn);function On(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 l.createElement(wn,{htmlFor:r},l.createElement(Fn,Object.assign({},{id:r,name:r,type:"checkbox",checked:o},t)),l.createElement(kn,null,l.createElement(En,null,l.createElement(i.Icon,{name:"Check",width:"12px",height:"12px",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",m:"auto",style:{strokeWidth:"2px"}}))),l.createElement(Bn,null,e))}function Dn(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=l.useState(e),a=t[0],i=t[1],s=l.useState(!1),c=s[1],p=s[0]?a:d.format(d.mask(a,r),o),u=l.useCallback(function(){c(!0)},[c]),m=l.useCallback(function(){c(!1)},[c]);return l.useEffect(function(){n.onUpdate&&n.onUpdate(a)},[a,n.onUpdate]),l.createElement(j,Object.assign({},n,{value:p,onFocus:u,onClick:u,onBlur:m,onChange:function(n){var e=n.target.value,r=/\*\*/.test(e);i(r?"":d.clean(e))}}))}function _n(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 l.createElement(s.Field,{name:e,validate:r},function(n){var r=n.field,t=n.form,a=Boolean(c.get(t,["errors",e])),i=l.useCallback(function(n){t.setFieldValue(e,n)},[e,t.setFieldValue]);return l.createElement(Dn,Object.assign({},o,r,{hasError:a,onUpdate:i}))})}exports.CheckboxGroup=x,exports.Checkbox=v,exports.CheckboxField=function(n){var e=n.name,r=n.validate,o=n.onChange,t=n.onBlur,a=p(n,["name","validate","onChange","onBlur"]);return l.createElement(s.Field,{name:e,validate:r},function(n){var r=n.field,i=Boolean(c.get(n.form,["errors",e]));return l.createElement(v,Object.assign({},a,r,{checked:Boolean(r.value),hasError:i,onChange:function(n){r.onChange(n),o&&o(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})},exports.DateInput=N,exports.DateInputField=H,exports.DateInputFieldWithLabel=function(n){return l.createElement(l.Fragment,null,l.createElement(D,{htmlFor:n.name},n.label),l.createElement(H,Object.assign({},n)))},exports.DateInputTypeIn=V,exports.DateInputTypeInField=L,exports.DateInputTypeInFieldWithLabel=function(n){return l.createElement(l.Fragment,null,l.createElement(D,{htmlFor:n.name},n.label),l.createElement(L,Object.assign({},n)))},exports.Item=U,exports.Body=q,exports.Control=Y,exports.Dropdown=G,exports.DropdownField=X,exports.DropdownFieldWithLabel=function(n){return l.createElement(l.Fragment,null,l.createElement(D,{htmlFor:n.name},n.label),l.createElement(X,Object.assign({},n)))},exports.ErrorMessage=function(n){return l.createElement(s.ErrorMessage,{name:n.name,render:function(n){return l.createElement(i.Span,{color:"error",fontSize:0},n)}})},exports.Input=j,exports.InputField=z,exports.InputFieldWithLabel=function(n){return l.createElement(l.Fragment,null,l.createElement(D,{htmlFor:n.name},n.label),l.createElement(z,Object.assign({},n)))},exports.Label=D,exports.Radio=function(n){var e=n.name,r=n.checked,o=n.description,t=n.label,a=K(n,["children","name","checked","description","label"]),s=e+a.value;return l.createElement(on,{htmlFor:s},l.createElement(en,Object.assign({},{id:s,name:e,type:"radio",checked:r},a)),l.createElement(nn,{checked:r}),l.createElement(i.Box,{display:"block",position:"relative",zIndex:1,width:"calc(100% - 32px)",maxWidth:"calc(100% - 32px)"},t&&l.createElement(Z,null,t),o&&l.createElement(i.P,{mt:"xxs",color:"secondary",fontSize:0,fontWeight:4,lineHeight:0},o)),l.createElement(rn,null))},exports.RadioField=tn,exports.RadioFieldWithLabel=function(n){var e=n.label,r=K(n,["label"]);return l.createElement(l.Fragment,null,l.createElement(D,{htmlFor:r.name},e),l.createElement(tn,Object.assign({},r)))},exports.Select=sn,exports.SelectField=cn,exports.SelectFieldWithLabel=function(n){return l.createElement(l.Fragment,null,l.createElement(D,{htmlFor:n.name},n.label),l.createElement(cn,Object.assign({},n)))},exports.SubGroup=dn,exports.Textarea=mn,exports.TextareaField=bn,exports.TextareaFieldWithLabel=function(n){return l.createElement(l.Fragment,null,l.createElement(D,{htmlFor:n.name},n.label),l.createElement(bn,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"]),a=t.name+t.value;return l.createElement(fn,{htmlFor:a},l.createElement(xn,Object.assign({},{id:a,type:"radio"},t)),l.createElement(gn,{hasError:o},e&&l.createElement(i.Circle,{mb:"xs",background:"white",width:"48px",height:"48px"},e),l.createElement(i.Span,{display:"flex",justifyContent:"center",minHeight:"32px",fontSize:0,fontWeight:5,lineHeight:0,width:"100%"},r)))},exports.hidden=yn,exports.Toggle=On,exports.ToggleField=function(n){var e=n.label;return l.createElement(s.Field,{name:n.name,validate:n.validate},function(n){var r=n.field;return l.createElement(On,Object.assign({},{label:e},r,{checked:Boolean(r.value)}))})},exports.SSNInput=Dn,exports.SSNInputField=_n,exports.SSNInputFieldWithLabel=function(n){return l.createElement(l.Fragment,null,l.createElement(D,{htmlFor:n.name},n.label),l.createElement(_n,Object.assign({},n)))};
var n,e=require("picomask"),r=require("styled-system"),o=require("use-drop"),t=require("styled-components"),a=(n=t)&&"object"==typeof n&&"default"in n?n.default:n,i=require("@truework/ui"),l=require("react"),s=require("formik"),c=require("lodash"),d=require("parse-ssn");function p(n,e){var r={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&-1===e.indexOf(o)&&(r[o]=n[o]);return r}var u=Object.freeze([""]),m=a(i.Icon)(u),b=a.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 "+m+" {\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 "}),h=a(i.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 "}),f=a.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 ~ "+b+" {\n border-color: "+e.colors.primaryDark+";\n }\n &:checked ~ "+b+" {\n background: "+e.colors.primary+";\n border-color: "+e.colors.primaryDark+";\n\n "+m+" {\n transform: scale(1);\n }\n }\n &:focus ~ "+h+", &:focus ~"+i.Span+", &:checked ~ "+i.Span+" {\n color: "+e.colors.primary+";\n }\n\n "+(n.hasError?"\n & ~ "+b+" {\n border-color: "+e.colors.error+" !important;\n }\n ":"")+"\n "}),g=a.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 "+b+" {\n background: "+e.colors.background+";\n }\n "+i.Span+" {\n color: "+e.colors.placeholder+";\n }\n ":"\n &:hover "+b+" {\n border-color: "+e.colors.primaryDark+";\n }\n &:hover "+h+", &:hover "+i.Span+" {\n color: "+e.colors.primary+";\n }\n ")+"\n "}),x=a.div(function(n){var e=n.theme;return"\n width: 100%;\n\n "+g+" {\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 "+g+":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 "+g+":last-child {\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n }\n "});function v(n){var e=n.children,r=n.name,o=n.checked,t=n.disabled,a=p(n,["children","name","checked","disabled"]);return l.createElement(g,{htmlFor:r,disabled:t},l.createElement(f,Object.assign({},{id:r,name:r,type:"checkbox",checked:o,disabled:t},a)),l.createElement(b,{checked:o},l.createElement(m,{name:"Check"})),l.createElement(i.Span,{display:"block",width:"calc(100% - 16px)",fontSize:1,lineHeight:1,fontWeight:5,style:{transitionProperty:"color",transitionDuration:"150ms",transitionTimingFunction:"ease-in-out"}},e))}var y="yyyy-mm-dd",E=["January","February","March","April","May","June","July","August","September","October","November","December"];function k(n){return new Date(n.year,n.month,0).getUTCDate()}function w(n){return n<10?"0"+n:""+n}function F(n){return n.replace(/[^\d]/g,"").slice(0,8)}function B(n){var r=n.date,o=n.min,t=n.max,a=n.pattern;void 0===a&&(a=y);var i=F(r);if(0!==i.length){var l=e.picomask(r,y),s=l.y,c=l.m,d=l.d,p=parseInt(s),u=parseInt(c),m=parseInt(d),b=k({month:u,year:p});return i.length<8?"Please enter a valid date matching "+a:u>12?"There are only 12 months":"00"===d?"Day cannot be 0":"00"===c?"Month cannot be 0":"0000"===s?"Year cannot be 0":m>b?"There are only "+b+" days in "+E[u-1]+" "+p:o&&new Date(r)<new Date(o)?"Date must be after "+e.transform(e.picomask(o,y),a).value:t&&new Date(r)>new Date(t)?"Date must be before "+e.transform(e.picomask(t,y),a).value:void 0}}var O=Object.freeze(["\n display: block;\n position: relative;\n font-weight: 500;\n letter-spacing: 0.6px;\n ","\n ","\n ","\n"]),D=a.label(O,r.typography,r.color,r.space);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}D.displayName="Label",D.defaultProps={fontSize:1,lineHeight:1,mb:"xs"};var C=a.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: 1px;\n border-radius: 4px;\n min-height: "+(r?"34px":"46px")+";\n padding: "+(r?"10px 16px":"14px 16px")+";\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 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"});C.displayName="InputElement";var j=l.forwardRef(function(n,e){var r=n.hasError,o=n.preTab,t=n.postTab,a=_(n,["hasError","preTab","postTab"]),s=Boolean(o),c=o||t;return l.createElement(i.Box,{display:"flex",ml:"-2px",mr:"-2px",p:"2px"},l.createElement(C,Object.assign({},{ref:e,hasError:r},a)),c&&l.createElement(i.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),l.createElement(i.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"}),l.createElement(i.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 z(n){var e=n.name,r=n.validate,o=n.onChange,t=n.onBlur,a=_(n,["name","validate","onChange","onBlur"]);return l.createElement(s.Field,{name:e,validate:r},function(n){var r=n.field,i=Boolean(c.get(n.form,["errors",e]));return l.createElement(j,Object.assign({},a,r,{hasError:i,onChange:function(n){r.onChange(n),o&&o(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}function S(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 I=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 &:hover {\n opacity: 1;\n }\n "]),T=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 "]),R=a.select(function(n){var e=n.theme,r=n.hasError;return t.css(T,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)}),P=a.button(function(n){var e=n.theme;return t.css(I,e.colors.secondary,e.transitionDurations.fast,e.transitionTimingFunctions.ease)});function N(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 a=n.initialDay;void 0===a&&(a=0);var s=n.initialYear;void 0===s&&(s=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=l.useState(t),v=x[0],y=x[1],E=l.useState(a),F=E[0],B=E[1],O=l.useState(s),D=O[0],_=O[1],C=k({year:D||2020,month:v});l.useEffect(function(){g(D&&v&&F?D+"-"+w(v)+"-"+w(F):"")},[v,F,D]);var j=l.useCallback(function(){y(0),B(0),_(0)},[y,B,_]);return l.createElement(i.Box,{ml:"-2px",mr:"-2px",p:"2px"},l.createElement(i.Box,{display:"flex",alignItems:"center",height:"48px",pl:"56px"},l.createElement(R,{name:e+"-month",value:v,disabled:o,onChange:function(n){y(parseInt(n.target.value,10))},"aria-label":r+": Month",hasValue:Boolean(v),hasError:f},l.createElement("option",{value:"0",disabled:!0},"mm"),c.times(m-d+1,function(){return""}).map(function(n,e){var r=d+e;return l.createElement("option",{key:r,value:r},w(r))})),l.createElement(i.Box,{height:"50%",width:"1px",bg:f?"error":"outline",zIndex:2,transform:"rotate(10deg)"}),l.createElement(R,{name:e+"-day",value:F,disabled:o,onChange:function(n){B(parseInt(n.target.value,10))},"aria-label":r+": Day",hasValue:Boolean(F),hasError:f},l.createElement("option",{value:"0",disabled:!0},"dd"),c.times(Math.min(b,C)-p+1,function(){return""}).map(function(n,e){var r=p+e;return l.createElement("option",{key:r,value:r},w(r))})),l.createElement(i.Box,{height:"50%",width:"1px",bg:f?"error":"outline",zIndex:2,transform:"rotate(10deg)"}),l.createElement(R,{name:e+"-year",value:D,disabled:o,onChange:function(n){_(parseInt(n.target.value,10))},"aria-label":r+": Year",hasValue:Boolean(D),hasError:f},l.createElement("option",{value:"0",disabled:!0},"yyyy"),c.times(h-u+1,function(n){return u+n}).map(function(n){return l.createElement("option",{key:n,value:n},n)})),(v||F||D)&&l.createElement(P,{title:"Clear",onClick:j},l.createElement(i.Icon,{name:"X",width:"12px",height:"12px"})),l.createElement(i.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"}),l.createElement(i.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"},l.createElement(i.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"},l.createElement(i.Icon,{name:"Calendar"})))))}function H(n){var e=n.name,r=n.validate,o=S(n,["name","validate"]);return l.createElement(s.Field,{name:e,validate:r},function(n){var r=n.field,t=n.form,a=Boolean(c.get(t,["errors",e])),i=(r.value||"").split("-"),s=i[0];void 0===s&&(s="");var d=i[1];void 0===d&&(d="");var p=i[2];return void 0===p&&(p=""),l.createElement(N,Object.assign({},{name:e},o,{initialMonth:d?parseInt(d,10):void 0,initialDay:p?parseInt(p,10):void 0,initialYear:s?parseInt(s,10):void 0,hasError:a,onUpdate:function(n){t.setFieldValue(e,n)}}))})}function V(n){var r=n.hasError,o=n.onUpdate,t=n.onValidationError,a=n.pattern;void 0===a&&(a=y);var s=n.showErrors,c=n.minDate,d=n.maxDate,p=S(n,["hasError","onUpdate","onValidationError","pattern","showErrors","minDate","maxDate"]),u=l.useRef(null),m=l.useRef(0),b=l.useState(!1),h=b[0],f=b[1],g=l.useState(),x=g[0],v=g[1],E=l.useState(F(p.value?e.transform(e.picomask(String(p.value),y),a).value:"")),k=E[0],w=E[1],O=e.picomask(k,a),D=l.useCallback(function(n){t&&t(n),v(n)},[t,v]),_=l.useCallback(function(n){n.persist(),h||f(!0);var r=n.target.value,o=F(r),t=F(r.slice(0,n.target.selectionEnd||0)),i=e.picomask(t,a).value;m.current=i.length,w(o)},[k,w]);return l.useLayoutEffect(function(){u.current&&u.current.setSelectionRange(m.current,m.current)},[k]),l.useEffect(function(){if(h){var n=B({date:e.transform(e.picomask(k,a),y).value,min:c,max:d,pattern:a}),r=e.transform(e.picomask(k,a),y).value;D(n),o&&o(r)}},[k,a,c,d,h,o,D]),l.createElement(l.Fragment,null,l.createElement(j,Object.assign({},{ref:u,preTab:l.createElement(i.Icon,{name:"Calendar"}),placeholder:a},p,{hasError:s&&Boolean(x)||r,value:O.value,onChange:_,onBlur:_})),s&&x&&l.createElement(i.Span,{color:"error",fontSize:0},x))}function L(n){var e=n.name,r=n.validate,o=n.pattern;void 0===o&&(o=y);var t=S(n,["name","validate","pattern"]);return l.createElement(s.Field,{name:e,validate:function(n){var e=B({date:n||"",min:t.minDate,max:t.maxDate,pattern:o}),a=r?r(n):void 0;return e||a}},function(n){var r=n.field,a=n.form,i=Boolean(c.get(a,["errors",e])),s=l.useCallback(function(n){a.setFieldTouched(e),a.setFieldValue(e,n)},[e,a.setFieldValue]),d=l.useCallback(function(n){a.setFieldError(e,n)},[e,a.setFieldError]);return l.createElement(V,Object.assign({},t,r,{pattern:o,hasError:i,onUpdate:s,onValidationError:d}))})}function W(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 M=a(i.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 U(n){var e=n.children,r=W(n,["children"]);return l.createElement(M,Object.assign({},{as:"li"},r),e)}var q=l.forwardRef(function(n,e){var r=n.children,o=W(n,["children"]);return l.createElement(i.Box,Object.assign({},{ref:e,as:"ul",boxShadow:"medium",borderRadius:2,overflow:"auto",width:"100%",bg:"white"},o),r)});q.displayName="Body";var A=a.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"});A.displayName="ControlOuter";var Y=l.forwardRef(function(n,e){var r=n.children,o=n.isActive,t=n.hasError,a=W(n,["children","isActive","hasError"]);return l.createElement("div",{style:{position:"relative"}},l.createElement(A,Object.assign({},{ref:e,isActive:o,hasError:t,type:"button"},a),l.createElement(i.Span,{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},l.createElement(i.Span,{width:"100%",fontWeight:4,style:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",letterSpacing:"0.6px"}},r),l.createElement(i.Icon,{name:"ChevronDown",ml:"xs"}))),l.createElement(i.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"}),l.createElement(i.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 J(n){var e=n.value,r=n.placeholder;return c.get(n.items.filter(function(n){return n.value===e})[0],"label")||r||"Please select"}function G(n){var e=n.value,r=n.placeholder,t=n.label,a=n.items,s=n.hasError,c=n.disabled,d=n.onSelect,p=n.onRemove,u=l.useState(J({items:a,value:e,placeholder:r})),m=u[0],b=u[1];l.useEffect(function(){b(J({items:a,value:e,placeholder:r}))},[a,e,r]);var h=o.useSelect({items:a.map(function(n){return Object.assign({},n,{selected:n.value===e})}),onSelect:function(n){b(n.label),d&&d(n)},onRemove:function(n){b(r||"Please select"),p&&p(n)}}),f=h.items,g=h.isOpen,x=h.getDropProps;return l.createElement(i.Box,null,l.createElement(Y,Object.assign({},{id:h.id},c?{}:(0,h.getControlProps)(),{"aria-label":t,isActive:g,hasError:s,disabled:c}),m),g&&l.createElement(i.Box,{position:"absolute",bottom:"0",width:"100%",transform:"translateY(100%) translateY(6px)",zIndex:1e3},l.createElement(q,Object.assign({},x(),{style:{maxHeight:"240px",overflow:"auto"}}),f.map(function(n){return l.createElement(U,Object.assign({},{key:n.value,selected:n.selected,highlighted:n.highlighted},n.getItemProps()),n.label)}))))}function X(n){var e=n.name,r=n.validate,o=W(n,["name","validate"]);return l.createElement(s.Field,{name:e,validate:r},function(n){var e=n.field,r=n.form,t=Boolean(r.errors&&r.errors[e.name]);return l.createElement(G,Object.assign({},o,{hasError:t,onSelect:function(n){r.setFieldValue(e.name,n.value),o.onSelect&&o.onSelect(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}Y.displayName="Control";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"]),Z=a.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 "}),$=a.div(function(n){var e=n.theme;return"\n width: 100%;\n border: 1px solid "+e.colors.outline+";\n border-radius: 4px;\n\n "+on+" {\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 & "+on+" {\n border-color: "+e.colors.error+" !important;\n }\n ":"")+"\n "}),nn=a.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 "}),en=a.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 ~ "+nn+" {\n border-color: "+e.colors.primaryDark+";\n }\n &:focus ~ "+i.Box+" "+Z+" {\n color: "+e.colors.primary+";\n }\n\n &:checked ~ "+nn+" {\n background: "+e.colors.primary+";\n border-color: "+e.colors.primaryDark+";\n\n &::after {\n transform: scale(1);\n }\n }\n &:checked ~ "+i.Box+" "+Z+" {\n color: "+e.colors.primary+";\n }\n\n &:disabled ~ "+nn+" {\n border-color: "+e.colors.outline+" !important;\n }\n &:disabled ~ "+rn+" {\n background-color: "+e.colors.background+";\n }\n &:disabled ~ "+i.Box+" "+Z+" {\n color: "+e.colors.secondary+" !important;\n }\n "}),rn=a.span(Q),on=a.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 "+nn+" {\n border-color: "+e.colors.primaryDark+";\n }\n &:hover "+Z+" {\n color: "+e.colors.primary+";\n }\n "});function tn(n){var e=n.children,r=n.name,o=n.validate,t=n.onChange,a=n.onBlur,i=K(n,["children","name","validate","onChange","onBlur"]);return l.createElement(s.Field,{name:r,validate:o},function(n){var o=n.field,s=Boolean(c.get(n.form,["errors",r]));return l.createElement($,{hasError:s},l.Children.toArray(e).map(function(n){return l.cloneElement(n,Object.assign({},o,i,{value:n.props.value,hasError:s,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 an(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 ln=a.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"});ln.displayName="SelectElement";var sn=l.forwardRef(function(n,e){var r=n.children,o=n.hasError,t=n.placeholder;void 0===t&&(t="");var a=an(n,["children","hasError","placeholder"]);return l.createElement(i.Box,{ml:"-2px",mr:"-2px",p:"2px"},l.createElement(ln,Object.assign({},{ref:e,hasValue:Boolean(a.value),hasError:o},a,{value:a.value||""}),t&&l.createElement("option",{value:"",disabled:!0},t),r),l.createElement(i.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"}),l.createElement(i.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"}),l.createElement(i.Box,{position:"absolute",right:"0",top:"0",bottom:"0",height:"16px",my:"auto",pr:"sm",style:{pointerEvents:"none"}},l.createElement(i.Icon,{name:"ChevronDown",color:"secondary"})))});function cn(n){var e=n.name,r=n.validate,o=n.onChange,t=n.onBlur,a=an(n,["name","validate","onChange","onBlur"]);return l.createElement(s.Field,{name:e,validate:r},function(n){var r=n.field,i=Boolean(c.get(n.form,["errors",e]));return l.createElement(sn,Object.assign({},a,r,{hasError:i,onChange:function(n){r.onChange(n),o&&o(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}var dn=a(i.Box)(function(n){return"\n border-left: 2px solid currentColor;\n padding-left: "+n.theme.space.sm+";\n "});function pn(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 un=a.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"});un.displayName="TextareaElement",un.defaultProps={rows:4};var mn=l.forwardRef(function(n,e){var r=n.hasError,o=pn(n,["hasError"]);return l.createElement(i.Box,{ml:"-2px",mr:"-2px",p:"2px"},l.createElement(un,Object.assign({},{ref:e,hasError:r},o)),l.createElement(i.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"}),l.createElement(i.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 bn(n){var e=n.name,r=n.validate,o=n.onChange,t=n.onBlur,a=pn(n,["name","validate","onChange","onBlur"]);return l.createElement(s.Field,{name:e,validate:r},function(n){var r=n.field,i=Boolean(c.get(n.form,["errors",e]));return l.createElement(mn,Object.assign({},a,r,{hasError:i,onChange:function(n){r.onChange(n),o&&o(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})}var hn=Object.freeze(["\n display: block;\n position: relative;\n cursor: pointer;\n"]),fn=a.label(hn),gn=a.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"}),xn=a.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 ~ "+gn+",\n &:hover\n ~ "+gn+",\n &:focus\n ~ "+gn+" {\n border: 1px solid "+e.colors.primary+";\n background-color: rgba(91, 99, 254, 0.1);\n }\n\n &:checked ~ "+gn+" {\n color: "+e.colors.primary+";\n }\n"}),vn=Object.freeze(["\n ","\n"]),yn="\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",En=a.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"}),kn=a.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 "}),wn=a.label(function(n){return"\n display: flex;\n align-items: center;\n margin-bottom: 0 !important;\n\n &:hover "+kn+" {\n "+En+" {\n border-color: "+n.theme.colors.primaryDark+";\n }\n }\n "}),Fn=a.input(function(n){var e=n.theme;return"\n "+yn+"\n\n &:focus ~ "+kn+" {\n border-color: "+e.colors.primary+";\n }\n &:checked ~ "+kn+" {\n border-color: "+e.colors.primary+";\n\n "+En+" {\n background: "+e.colors.primary+";\n border-color: "+e.colors.primaryDark+";\n transform: translateX(24px);\n }\n }\n &:disabled ~ "+kn+" {\n pointer-events: none;\n "+En+" {\n border-color: "+e.colors.outline+";\n }\n }\n "}),Bn=a.span(vn,yn);function On(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 l.createElement(wn,{htmlFor:r},l.createElement(Fn,Object.assign({},{id:r,name:r,type:"checkbox",checked:o},t)),l.createElement(kn,null,l.createElement(En,null,l.createElement(i.Icon,{name:"Check",width:"12px",height:"12px",position:"absolute",top:"0",bottom:"0",left:"0",right:"0",m:"auto",style:{strokeWidth:"2px"}}))),l.createElement(Bn,null,e))}function Dn(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=l.useState(e),a=t[0],i=t[1],s=l.useState(!1),c=s[1],p=s[0]?a:d.format(d.mask(a,r),o),u=l.useCallback(function(){c(!0)},[c]),m=l.useCallback(function(){c(!1)},[c]);return l.useEffect(function(){n.onUpdate&&n.onUpdate(a)},[a,n.onUpdate]),l.createElement(j,Object.assign({},n,{value:p,onFocus:u,onClick:u,onBlur:m,onChange:function(n){var e=n.target.value,r=/\*\*/.test(e);i(r?"":d.clean(e))}}))}function _n(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 l.createElement(s.Field,{name:e,validate:r},function(n){var r=n.field,t=n.form,a=Boolean(c.get(t,["errors",e])),i=l.useCallback(function(n){t.setFieldValue(e,n)},[e,t.setFieldValue]);return l.createElement(Dn,Object.assign({},o,r,{hasError:a,onUpdate:i}))})}exports.CheckboxGroup=x,exports.Checkbox=v,exports.CheckboxField=function(n){var e=n.name,r=n.validate,o=n.onChange,t=n.onBlur,a=p(n,["name","validate","onChange","onBlur"]);return l.createElement(s.Field,{name:e,validate:r},function(n){var r=n.field,i=Boolean(c.get(n.form,["errors",e]));return l.createElement(v,Object.assign({},a,r,{checked:Boolean(r.value),hasError:i,onChange:function(n){r.onChange(n),o&&o(n)},onBlur:function(n){r.onBlur(n),t&&t(n)}}))})},exports.DateInput=N,exports.DateInputField=H,exports.DateInputFieldWithLabel=function(n){return l.createElement(l.Fragment,null,l.createElement(D,{htmlFor:n.name},n.label),l.createElement(H,Object.assign({},n)))},exports.DateInputTypeIn=V,exports.DateInputTypeInField=L,exports.DateInputTypeInFieldWithLabel=function(n){return l.createElement(l.Fragment,null,l.createElement(D,{htmlFor:n.name},n.label),l.createElement(L,Object.assign({},n)))},exports.Item=U,exports.Body=q,exports.Control=Y,exports.Dropdown=G,exports.DropdownField=X,exports.DropdownFieldWithLabel=function(n){return l.createElement(l.Fragment,null,l.createElement(D,{htmlFor:n.name},n.label),l.createElement(X,Object.assign({},n)))},exports.ErrorMessage=function(n){return l.createElement(s.ErrorMessage,{name:n.name,render:function(n){return l.createElement(i.Span,{color:"error",fontSize:0},n)}})},exports.Input=j,exports.InputField=z,exports.InputFieldWithLabel=function(n){return l.createElement(l.Fragment,null,l.createElement(D,{htmlFor:n.name},n.label),l.createElement(z,Object.assign({},n)))},exports.Label=D,exports.Radio=function(n){var e=n.name,r=n.checked,o=n.description,t=n.label,a=K(n,["children","name","checked","description","label"]),s=e+a.value;return l.createElement(on,{htmlFor:s},l.createElement(en,Object.assign({},{id:s,name:e,type:"radio",checked:r},a)),l.createElement(nn,{checked:r}),l.createElement(i.Box,{display:"block",position:"relative",zIndex:1,width:"calc(100% - 32px)",maxWidth:"calc(100% - 32px)"},t&&l.createElement(Z,null,t),o&&l.createElement(i.P,{mt:"xxs",color:"secondary",fontSize:0,fontWeight:4,lineHeight:0},o)),l.createElement(rn,null))},exports.RadioField=tn,exports.RadioFieldWithLabel=function(n){var e=n.label,r=K(n,["label"]);return l.createElement(l.Fragment,null,l.createElement(D,{htmlFor:r.name},e),l.createElement(tn,Object.assign({},r)))},exports.Select=sn,exports.SelectField=cn,exports.SelectFieldWithLabel=function(n){return l.createElement(l.Fragment,null,l.createElement(D,{htmlFor:n.name},n.label),l.createElement(cn,Object.assign({},n)))},exports.SubGroup=dn,exports.Textarea=mn,exports.TextareaField=bn,exports.TextareaFieldWithLabel=function(n){return l.createElement(l.Fragment,null,l.createElement(D,{htmlFor:n.name},n.label),l.createElement(bn,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"]),a=t.name+t.value;return l.createElement(fn,{htmlFor:a},l.createElement(xn,Object.assign({},{id:a,type:"radio"},t)),l.createElement(gn,{hasError:o},e&&l.createElement(i.Circle,{mb:"xs",background:"white",width:"48px",height:"48px"},e),l.createElement(i.Span,{display:"flex",justifyContent:"center",minHeight:"32px",fontSize:0,fontWeight:5,lineHeight:0,width:"100%"},r)))},exports.hidden=yn,exports.Toggle=On,exports.ToggleField=function(n){var e=n.label;return l.createElement(s.Field,{name:n.name,validate:n.validate},function(n){var r=n.field;return l.createElement(On,Object.assign({},{label:e},r,{checked:Boolean(r.value)}))})},exports.SSNInput=Dn,exports.SSNInputField=_n,exports.SSNInputFieldWithLabel=function(n){return l.createElement(l.Fragment,null,l.createElement(D,{htmlFor:n.name},n.label),l.createElement(_n,Object.assign({},n)))};
//# sourceMappingURL=index.js.map
{
"name": "@truework/forms",
"version": "1.7.2",
"version": "1.7.3",
"description": "",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc