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.6 to 1.8.0

11

CHANGELOG.md
# @truework/forms
## 1.8.0
### Minor Changes
- 2d6f045: Migrate from old `Icon` usage towards importing them individually.
### Patch Changes
- Updated dependencies [a3a3946]
- @truework/ui@1.3.0
## 1.7.6

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

@@ -47,3 +47,3 @@ "main": "dist/index.js",

"dependencies": {
"@truework/ui": "^1.2.0",
"@truework/ui": "^1.3.0",
"formik": "^2.1.5",

@@ -54,2 +54,3 @@ "lodash": "^4.17.15",

"react": "16",
"react-feather": "^2.0.4",
"styled-components": "5",

@@ -56,0 +57,0 @@ "styled-system": "5",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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