freemium-ui 1.0.143 → 1.0.147

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs.js CHANGED
@@ -66,7 +66,7 @@ object-assign
66
66
  user-select: none;
67
67
  ${({theme:{typography:e,colors:{components:{button:t}}},_type:n,size:r})=>{const{hover:o,color:i,...a}=t[n],s=a&&a.backgroundGradient&&a.backgroundGradient.from?`linear-gradient(180deg, ${a.backgroundGradient.from} 0%, ${a.backgroundGradient.to} 100%)`:"";return{...a,...e.body.secondary,backgroundImage:s,boxShadow:"link"===n?"none":"0 1px 0 0 rgba(24,50,71,0.05)",color:i,height:(e=>e===ci.NORMAL?"34px":e===ci.LARGE?"45px":"auto")(r),fontSize:r===ci.MINI?"12px":"14px"}}}
68
68
  ${e=>{const{theme:{colors:{components:{button:t},pseudo:n},palette:r},_type:o,btnLoading:i=!1}=e,{hover:a,active:s,disabled:l}=t[o];return`\n &:not([disabled]) {\n &:hover {\n background-color: ${a};\n background-image: none;\n }\n \n &:active {\n outline: 0;\n box-shadow: inset 0px 0px 4px 1px ${Lt(r.E900,.2)};\n background-color: ${s.backgroundColor};\n border: 1px solid ${s.borderColor};\n }\n }\n \n &[disabled] {\n cursor: not-allowed;\n }\n\n &:focus:not(:active) {\n outline: none;\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px ${n.focus};\n }\n \n ${i?"":`&[disabled] {\n -webkit-box-shadow: none;\n box-shadow: none;\n background-image: linear-gradient(180deg, ${l.backgroundGradient.from} 0%, ${l.backgroundGradient.to} 100%);\n border: 1px solid ${l.borderColor};\n color: ${l.color};\n }`}`}};
69
- `,ui=e=>{const{inline:t=!1,children:r,disabled:o,className:i="",htmlType:a,type:s="primary",onClick:l,size:c,overrideStyleClassName:d="",loading:u=!1,...p}=e;return n.createElement(di,Object.assign({inline:t,_type:s,disabled:o,className:`${i} ${d}`,type:a,onClick:l,size:c,btnLoading:Boolean(u)},p),u?n.createElement(si.Box,null,n.createElement(li,null)):r)},pi=t.forwardRef(((e,t)=>n.createElement(hi,{checked:e.checked,disabled:e.disabled||!1},n.createElement("label",null,n.createElement("input",{ref:t,id:e.id,type:"checkbox",name:e.name,readOnly:e.readOnly,disabled:e.disabled,"aria-disabled":e.disabled,value:e.value,checked:e.checked,onChange:e.readOnly?()=>{}:t=>e.onChange(t,t.target.checked)}),n.createElement("div",{className:"checkbox"},e.checked&&n.createElement("span",null,n.createElement(En,{size:"12",viewBox:"0 0 10 10",glyph:"tick"}))),n.createElement("div",null,e.children))))),hi=Qe.div`
69
+ `,ui=e=>{const{inline:t=!1,children:r,disabled:o,className:i="",htmlType:a,type:s="primary",onClick:l,size:c,overrideStyleClassName:d="",loading:u=!1,...p}=e;return n.createElement(di,Object.assign({inline:t,_type:s,disabled:o,className:`${i} ${d}`,type:a,onClick:l,size:c,btnLoading:Boolean(u)},p),u?n.createElement(si.Box,null,n.createElement(li,null)):r)},pi=t.forwardRef(((e,t)=>n.createElement(hi,{checked:e.checked,disabled:e.disabled||!1},n.createElement("label",null,n.createElement("input",{ref:t,id:e.id,type:"checkbox",name:e.name,readOnly:e.readOnly,disabled:e.disabled,"aria-disabled":e.disabled,value:e.value,checked:e.checked,onChange:e.readOnly?()=>{}:t=>{e.onChange&&e.onChange(t,t.target.checked)}}),n.createElement("div",{className:"checkbox"},e.checked&&n.createElement("span",null,n.createElement(En,{size:"12",viewBox:"0 0 10 10",glyph:"tick"}))),n.createElement("div",null,e.children))))),hi=Qe.div`
70
70
  ${({theme:{colors:{components:{checkbox:e},pseudo:t},typography:{body:n}},disabled:r,checked:o})=>`\n font-size : ${n.label.fontSize};\n font-weight : ${n.label.fontWeight};\n input {\n clip : rect(0px 0px 0px 0px);\n width : 1px;\n height : 1px;\n &:focus{\n & ~ .checkbox {\n box-shadow: ${t.focus} 0px 0px 0px 2px;\n border-color : transparent;\n }\n }\n }\n label {\n cursor: ${r?"not-allowed":"inherit"};\n display: flex;\n align-items: center;\n user-select: none;\n opacity : ${r?.5:1};\n }\n .checkbox {\n background-color: ${o?e.backgroundColor:"#fff"};\n border: ${o?"none":"1px solid"};\n border-color: ${o?e.backgroundColor:e.borderColor};\n transition: background-color ease-in 0.2s;\n min-width: 14px;\n min-height: 14px;\n border-radius: 2px;\n position: relative;\n margin-right: 10px;\n span {\n left: 2px;\n top : 2px;\n position: absolute;\n }\n &:hover {\n ${r?"":`border-color : ${o?e.backgroundColor:e.hoverBorderColor}!important`};\n box-shadow: ${r?"unset":`${t.hover} 0px 0px 0px 5px!important`}; \n }\n`}
71
71
  `,fi=rt(pi,{checked:!1,sizeVariant:"md"});var mi={palette:ot,colors:xn,layout:{gap:"16pt",gapNegative:"-16pt",gapHalf:"8pt",gapHalfNegative:"-8pt",gapQuarter:"4pt",gapQuarterNegative:"-4pt",pageMargin:"16pt",pageWidth:"750pt",pageWidthWithMargin:"782pt",radius:"5px"},typography:{fontFamily:'-apple-system, ".SFNSText-Regular", "San Francisco", BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", "Lucida Grande", Arial, sans-serif',headings:{h1:{fontSize:"44px",lineHeight:"66px",margin:"0px"},h2:{fontSize:"32px",lineHeight:"48px",margin:"0px"},h3:{fontSize:"24px",lineHeight:"36px",margin:"0px"},h4:{fontSize:"18px",lineHeight:18*1.3+"px",margin:"0px"},h5:{fontSize:"16px",lineHeight:"20.8px",margin:"0px"}},text:{regular:{fontWeight:400},semiBold:{fontWeight:500},bold:{fontWeight:600}},body:{regular:{fontSize:"14px",lineHeight:"18.2px",margin:"0px"},regularBold:{fontSize:"14px",fontWeight:"bold",lineHeight:"21px",margin:"0px"},secondary:{fontSize:"12px"},secondaryBold:{fontSize:"12px",lineHeight:"18px",fontWeight:600},dropdown:{fontSize:"13px",lineHeight:"30px"},label:{fontSize:"12px",lineHeight:"19px",fontWeight:500},requiredLabel:{fontWeight:700,fontSize:"14px",lineHeight:"14px"},errorText:{fontSize:"12px"},anchor:{light:{fontSize:"14px",lineHeight:"17px"},bold:{fontSize:"14px",fontWeight:600,lineHeight:"15px"}},tagText:{fontSize:"12px",lineHeight:"14px",fontWeight:"500",letterSpacing:"0.2px"}},input:{text:{fontSize:"14px",lineHeight:"32px",fontWeight:"500"},textarea:{fontSize:"14px",lineHeight:"1.4",fontWeight:"500"},disabled:{fontWeight:"bold"},label:{fontSize:"12px",lineHeight:"20px",fontWeight:600},error:{fontSize:"12px",lineHeight:"17px"}},table:{header:{fontWeight:800,fontSize:"12px",padding:"16px",lineHeight:"16px"},body:{fontWeight:400,fontSize:"14px",padding:"12px",lineHeight:"20px"}},tabs:{fontSize:"14px",padding:"8px"},menu:{padding:"8px",menuItem:{fontWeight:500,fontSize:"14px",padding:"8px"}}}};const gi=tt`
72
72
  html,
@@ -1280,4 +1280,4 @@ to {right : 10px}
1280
1280
  .toast-container.hover {
1281
1281
  transform: translate3d(0, -10px, 0);
1282
1282
  }
1283
- `,Ed=()=>{const e=((e=yd())=>{const n=`ui-${e}`,{isBrowser:r}=bd(),[o,i]=t.useState(r?vd(n):null);return t.useEffect((()=>{const e=document.querySelector(`#${n}`),t=e||vd(n);e||document.body.appendChild(t),i(t)}),[]),o})("toast"),[r,o]=t.useState(!1),i=t.useRef(),{toasts:s,updateToastHoverStatus:l}=gd(),c=t.useMemo((()=>s.map(((e,t)=>n.createElement(_d,{index:t,total:s.length,toast:e,onHover:r,key:`toast-${t}`})))),[s,r]),d=e=>{if(e)return i.current&&clearTimeout(i.current),l((()=>!0)),o(!0);i.current=window.setTimeout((()=>{o(!1),l((()=>!1)),i.current&&clearTimeout(i.current)}),200)};return e&&s&&0!==s.length?a.createPortal(n.createElement(kd,null,n.createElement("div",{className:"toast-container "+(r?"hover":""),onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1)},c)),e):null},Sd=2e3;let Cd,Id=[],Od=0;var Dd=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Nd}(e)}(e)};var Nd="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Md(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Ld((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Td(e,t,n){return e.concat(t).map((function(e){return Md(e,n)}))}function Rd(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function Ad(e,t){try{return t in e}catch(e){return!1}}function Pd(e,t,n){var r={};return n.isMergeableObject(e)&&Rd(e).forEach((function(t){r[t]=Md(e[t],n)})),Rd(t).forEach((function(o){(function(e,t){return Ad(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(Ad(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return Ld;var n=t.customMerge(e);return"function"==typeof n?n:Ld}(o,n)(e[o],t[o],n):r[o]=Md(t[o],n))})),r}function Ld(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Td,n.isMergeableObject=n.isMergeableObject||Dd,n.cloneUnlessOtherwiseSpecified=Md;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):Pd(e,t,n):Md(t,n)}Ld.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Ld(e,n,t)}),{})};var Vd=Ld;exports.Alert=Mn,exports.BUTTON_SIZE_VARIANTS=ci,exports.BoxedRadio=Bc,exports.Button=ui,exports.ButtonDropdown=Fl,exports.Checkbox=fi,exports.Confirmation=ji,exports.ConfirmationBody=Bi,exports.ConfirmationContent=Fi,exports.ConfirmationFooter=Wi,exports.ConfirmationOverlay=Hi,exports.CssBaseLine=gi,exports.DatePicker=e=>{const{onDateChange:r,onClose:o=(()=>null),initialDate:i,anchorDirection:a="right",minMonths:s=6,minimumNights:l=0,...c}=e,[p,h]=t.useState(i&&Gi(i)),[f,m]=t.useState(!1),[g,b]=t.useState(c.autoFocusEndDate?u.END_DATE:u.START_DATE),y=e=>{const t=document.getElementsByClassName("DayPickerNavigation_button")["prev"===e?0:1];return t?t.childNodes[0]:null},v=(e,t)=>{t?e.classList&&e.classList.add("disable-nav"):e.classList&&e.classList.remove("disable-nav")},{autoFocus:x,autoFocusEndDate:w,..._}=c;return n.createElement(si.Box,{style:{position:"relative",height:"100%"}},n.createElement(Ji,null,n.createElement(d.DayPickerSingleDateController,Object.assign({},_,{daySize:32,minimumNights:l,onNextMonthClick:e=>{const t=y("prev"),n=y("next");if(n){Gi().isSame(e.add(1,"months"),"month")?(v(t,!1),v(n,!0)):(v(t,!1),v(n,!1))}},onPrevMonthClick:e=>{const t=y("prev"),n=y("next"),r=s-1;if(t){!Gi().subtract(r,"months").isBefore(e,"month")?(v(t,!0),v(n,!1)):(v(t,!1),v(n,!1))}},navPrev:n.createElement(ta,null),navNext:n.createElement(na,null),renderMonthElement:e=>{const t=y("next"),r=e.month.isAfter(Gi(),"month");return t&&r&&v(t,!0),n.createElement(ra,{dateRangePickerProps:e})},isOutsideRange:e=>!qi(e,Gi()),date:p,onFocusChange:e=>{b(e||u.START_DATE)},focusedInput:g,initialDate:i,minDate:Gi().subtract(s-1,"months").subtract(0,"days"),maxDate:Gi().add(0,"months").endOf("month"),initialVisibleMonth:()=>Gi().subtract(1,"month"),onDateChange:e=>{h(e),r(e)},numberOfMonths:1,hideKeyboardShortcutsPanel:!0,weekDayFormat:"dd"}))))},exports.DismissIcon=pa,exports.Drawer=function(e){const{isOpen:n,onDismiss:r,hideDismissIcon:o,clickOutToClose:i=!0,size:a="default",placement:s="right",children:l,...c}=e;return t.createElement(ga,{in:n,placement:s},(e=>t.createElement(fa.Provider,{value:e},t.createElement(ya,{isOpen:!0,onDismiss:i?r:()=>{}},t.createElement(ba,{size:a},!o&&t.createElement(pa,{onClick:r},t.createElement(En,{glyph:"close",size:"12",viewBox:"-2 -2 10 10"})),l)))))},exports.DrawerBody=ua,exports.DrawerContent=ba,exports.DrawerFooter=ha,exports.DrawerOverlay=ya,exports.Dropdown=e=>{const{items:t,children:r,defaultSelectedItem:o,label:i="",placeholder:a,errorText:s,itemToString:l,itemComponent:c,onChange:d=(e=>e),type:u=pc.BUTTON,filterKey:p,width:h="100%",disabled:f,isErrored:m,isRequired:g,overrideButtonStyles:b,overrideContainerStyles:y,...v}=e;let x;return"object"!=typeof t[0]||l?x=e=>e?l?l(e):"object"!=typeof e?String(e):null:null:console.warn("Your items are objects. So you need to pass a function to translate each object as a string which can be shown as dropdown item labels"),n.createElement("div",null,n.createElement(ys,Object.assign({itemToString:x,selectedItem:o,onChange:d},v),(e=>n.createElement($c,Object.assign({width:h,isRequired:g},e.getRootProps()),i&&n.createElement("label",Object.assign({},e.getLabelProps()),i),n.createElement(hc.Provider,{value:{downshift:e,items:t,filterKey:p,type:u,name:v.name}},r||n.createElement(n.Fragment,null,pc.BUTTON===u&&n.createElement(gc,{disabled:f,isErrored:m,overrideStyles:b,placeholder:a}),pc.INPUT===u&&n.createElement(Lc,{placeholder:a,isErrored:m}),n.createElement(Ac,{itemComponent:c,isErrored:m,overrideStyles:y})))))),m&&s&&n.createElement(Vc,null,s))},exports.Fade=Li,exports.FreemiumUIProvider=function(e){const{theme:n,children:r}=e;return t.createElement(Ze,{theme:n},t.createElement(gi,null),r)},exports.Glyph=kn,exports.Icons=En,exports.InlineSvg=wn,exports.Input=Ql,exports.Loader=e=>{const{size:t="medium",invert:r=!1}=e;return n.createElement(uc,{invert:r,size:t})},exports.Menu=zl,exports.Modal=({children:e,isOpen:t,onDismiss:r,position:o="center",align:i="center",size:a="default"})=>n.createElement(Li,{timeout:300,in:t,unmountOnExit:!0},(s=>n.createElement(oa,{className:"modal-overlay",style:s,align:i,position:o,isOpen:!0,onDismiss:r},n.createElement(Yi,{timeout:150,in:t,unmountOnExit:!0},(t=>n.createElement(la,{className:"modal-content",style:t,size:a,"aria-label":"dialog"},e)))))),exports.ModalBody=ca,exports.ModalContent=la,exports.ModalFooter=da,exports.ModalOverlay=oa,exports.MultiSelectDropdown=e=>{const{name:r,label:o,items:i,selectedItem:a,onChange:s,customValues:l=!1,placeholder:c,isErrored:d,errorText:u,itemLabelIdentifier:p,itemValueIdentifier:h,isRequired:f,renderCustomSuggestion:m,maxAllowedLength:g=2147483647,...b}=e,[y,v]=t.useState([]),[x,w]=t.useState(""),[_,k]=t.useState(!1),E=t.useRef(null);t.useEffect((()=>{v([...a])}),[a]);const S=e=>{y.some((t=>t[h]===e[h]))?I(e):_||C(e)},C=e=>{w(""),v([...y,e]),s([...y,e])},I=e=>{const t=y.filter((t=>t[p]!==e[p]));v(t),s(t)},O=e=>m?m(e):(({item:e,lengthError:t,maxAllowedLength:r,itemProps:o,index:i,highlightedIndex:a,selectedItem:s,itemValueIdentifier:l,itemLabelIdentifier:c})=>{const d=a===i,u=s.some((t=>t[l]&&t[l]===e[l]));return n.createElement(ac,Object.assign({disabled:e.disabled},o,{key:i,isHighlighted:d,isSelected:u,isRemove:u&&e.customValues,lengthError:t}),n.createElement(si.Flex,{alignItems:"center",justifyContent:"space-between"},n.createElement("div",{className:"primary-text","data-testid":`suggested-item-${e[l]}`},t?`Length cannot be greater than ${r} characters`:e.customValues&&""!==e[c]?`Enter to ${u?"remove":"add"} '${e[c]}'`:e[c]),u&&!e.customValues&&n.createElement(En,{glyph:"check",size:12,viewBox:"0 0 8 8"})))})(e);return n.createElement("div",null,n.createElement(ys,Object.assign({selectedItem:a,onChange:e=>{e&&S(e)},itemToString:e=>e?e[h]:"",inputValue:x,onInputValueChange:(e="")=>{l&&e.length>g?k(!0):k(!1),w(e)}},b),(({getInputProps:e,getItemProps:t,getRootProps:a,inputValue:s,selectedItem:u,toggleMenu:m,isOpen:b,highlightedIndex:y})=>n.createElement(sc,Object.assign({required:f},a()),o&&n.createElement("label",{htmlFor:o},o),n.createElement(oc,{isOpen:b,isErrored:d,id:"dropdownField container","data-testid":`formik-multi-select-${o}`,onClick:()=>{b||E&&E.current&&E.current.focus(),m()}},n.createElement("div",{className:"items"},(({selectedItem:e,removeSelectedItem:t,itemLabelIdentifier:r})=>e&&e.length>0&&e.map(((e,o)=>e[r]&&n.createElement(tc,{key:o,onCloseAction:n=>{n.stopPropagation(),t(e)}},e[r]))))({removeSelectedItem:I,selectedItem:u,itemLabelIdentifier:p}),(({label:e,name:t,searchRef:r,InputProps:o,items:i,placeholder:a,customValues:s})=>0!==i.length||s?n.createElement("input",Object.assign({name:t,size:25,"data-testid":`formik-multi-select-input-${e}`,ref:r,type:"text"},o,{placeholder:a})):null)({name:r,label:o||"",searchRef:E,selectedItem:u,removeSelectedItem:I,items:i,inputValue:s,placeholder:c,customValues:l,InputProps:{...e({onKeyDown:e=>{"Backspace"!==e.key||s||I(u[u.length-1]),"Enter"===e.key&&s&&l&&null===y&&S({[p]:s,[h]:s})}})}})),n.createElement("div",{className:"svg-wrapper"},n.createElement(En,{size:"8",viewBox:"0 0 8 8",glyph:"chevron-down"}))),n.createElement(Yi,{initialOffset:"-20px",timeout:200,in:b,unmountOnExit:!0},(e=>{const r=((e,t,n,r,o)=>{const i=t.filter((t=>t[n].toLowerCase().includes(e&&e.toLowerCase&&e.toLowerCase())));return 0==i.length&&o&&""!==e&&i.push({[r]:e,[n]:e,customValues:!0}),i})(s,i,p,h,l);return r&&r.length>0&&n.createElement(ic,{style:e},r.map(((e,n)=>O({lengthError:_,maxAllowedLength:g,item:e,index:n,itemProps:t({item:e,onClick:e=>e.stopPropagation(),disabled:e.disabled}),isActive:y===n,highlightedIndex:y,selectedItem:u,itemValueIdentifier:h,itemLabelIdentifier:p}))))}))))),d&&u&&n.createElement(rc,null,u))},exports.Popover=wa,exports.Radio=jc,exports.Slide=zi,exports.SlideFade=Yi,exports.SvgWrapper=_n,exports.Table=e=>{const{columns:t=[],data:r=[],count:o=0,offset:i=0,limit:a=0,next:s=!1,previous:l=!1,showPagination:c=!0,showSelectAllInTable:d=!1,showActions:u=!0,showSelections:p=!0,showFilters:f=!0,showOptions:m=!0,rowMenuOptions:g=(()=>[]),onRowSelect:b,onRowClick:y,onPrevious:v,onSelectAll:x,onNext:w,onMenuOptionSelect:_,headerComponent:k,initialState:E,state:S,filterComponent:C}=e,[I,O]=n.useState(f),[D,N]=n.useState(null),M=h.useTable({columns:t,data:r,initialState:E},h.useRowSelect,h.useColumnOrder,(e=>{e.visibleColumns.push((e=>p?[{id:"selection",disableResizing:!0,width:50,Header:({getToggleAllRowsSelectedProps:e,toggleAllRowsSelected:t})=>d?n.createElement("div",{className:"table-checkbox"},n.createElement(fi,Object.assign({id:"selectAll",name:"selectAll"},e(),{onChange:(e,n)=>{x&&x(n),t(n)}}))):n.createElement("div",null),Cell:e=>{const{row:t,column:r}=e;return n.createElement("div",{className:"table-checkbox"},n.createElement(fi,Object.assign({id:"selectRow",name:"selectRow"},t.getToggleRowSelectedProps(),{onChange:(e,n)=>{t.toggleRowSelected(n)}})))}},...e]:[...e]))})),{getTableProps:T,getTableBodyProps:R,headerGroups:A,rows:P,state:{selectedRowIds:L},prepareRow:V,setColumnOrder:$,getToggleAllRowsSelectedProps:z}=M;return h.useMountedLayoutEffect((()=>{$(E?.columnOrder)}),[E?.columnOrder]),h.useMountedLayoutEffect((()=>{b&&b(L)}),[b,L]),n.createElement(Gc,{className:"fui-table"},u&&n.createElement(qc,{className:"table-actions"},n.createElement("div",{className:"action"},!d&&p&&n.createElement(fi,Object.assign({id:"selectAll",name:"selectAll"},z()),"Select All")),k||void 0,n.createElement("div",{className:"pagination-actions"},c&&n.createElement(n.Fragment,null,n.createElement("div",{className:"pagination-text"},i+1," - ",i+a," of ",o),n.createElement(ui,{type:"secondary",disabled:!l,onClick:()=>v&&v(l)},n.createElement(En,{glyph:"chevron-left",size:12,viewBox:"0 0 6 8"})),n.createElement(ui,{type:"secondary",disabled:!s,onClick:()=>w&&w(s)},n.createElement(En,{glyph:"chevron-right",size:12,viewBox:"0 0 6 8"}))),f&&n.createElement(ui,{type:"secondary",className:"filter-toggle",onClick:()=>O(!I)},n.createElement(En,{glyph:I?"collapse":"expand",size:12,viewBox:"0 0 14 14"}))))," ",n.createElement(nd,{className:"table-content"},n.createElement(Kc,{showFilters:f&&I,className:"table-wrapper"},n.createElement(Zc,Object.assign({},T()),n.createElement(Jc,null,A.map((e=>{const{getHeaderGroupProps:t,headers:r}=e;return n.createElement(Xc,Object.assign({},t(),{className:"header-row"}),r.map((e=>{const{getHeaderProps:t,render:r}=e;return n.createElement(ed,Object.assign({},t()),r("Header"))})),m&&n.createElement(ed,null))}))),n.createElement(Qc,Object.assign({},R()),P.map((e=>{V(e);const{getRowProps:t,cells:r}=e;return n.createElement(Xc,Object.assign({},t(),{className:e.isSelected?"selected":""}),r.map((e=>{const{getCellProps:t,render:r}=e;return n.createElement(td,Object.assign({},t(),{onClick:()=>{"selection"!==e.column.id&&y&&y(e.row,e.column)}}),r("Cell"))})),m&&n.createElement(td,null,g&&g(e.original).length>0&&n.createElement(n.Fragment,null,n.createElement(od,{"aria-describedby":`row-popover-${e.id}`,onClick:e=>N(e.currentTarget)},n.createElement(En,{glyph:"more-vertical",size:12,viewBox:"0 0 4 16"})),n.createElement(wa,{id:`row-popover-${e.id}`,anchorEl:D,onClose:()=>N(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"}},n.createElement(zl,{options:g(e.original)||[],onSelect:t=>{_&&_(t.id,e.original),N(null)},closeMenuCallback:()=>N(null)})))))}))))),f&&I&&C&&n.createElement(rd,{className:"table-filters"},C)))},exports.Tabs=e=>{const{value:t,onChange:r=(()=>{}),idAccessor:o="id",nameAccessor:i="name",options:a=[],ref:s=null}=e;return n.createElement(id,{ref:s,role:"tablist"},a.map((e=>!e.hide&&n.createElement(ad,{"aria-disabled":Boolean(e.disabled),tabIndex:t===e[o]?-1:0,role:"tab",className:`${e.disabled?"disabled":""} ${t===e[o]?"selected":""}`.trim(),onClick:t=>!e.disabled&&r(t,e),id:e[o],key:e[o]},n.createElement("span",{className:"label"}," ",e[i])))))},exports.Tag=tc,exports.TextArea=ec,exports.ThemeProvider=function(e){const{children:n,theme:r={},globalStyle:o=!0}=e,i=Vd(mi,r);return t.createElement(Ze,{theme:i},o&&t.createElement(gi,null),n)},exports.ToastWrapper=e=>{const[r,o]=t.useState([]),[i,a]=t.useState(0),[l,c]=t.useState(!1),d=e=>{o(r.filter((t=>t.id!==e)))};return t.useEffect((()=>{r.length||c(!1)}),[r]),n.createElement(ld.Provider,{value:{pushToast:e=>{const t={...e,id:i};a(i+1),o([t,...r])},closeToast:d}},e.children,s.createPortal(n.createElement(ud,{length:r.length,isHovering:l,onMouseOver:()=>{c(!0)},onMouseLeave:()=>{c(!1)}},r.map(((e,t)=>n.createElement(cd,{key:e.id,index:t,toast:e,closeToast:d,isHovering:l})))," "),document.body))},exports.Toggle=fd,exports.Tooltip=({position:e="bottom",label:n,theme:r="dark",arrow:o=!0,trigger:i="mouseenter",interactive:a=!0,html:s=null,style:l={},children:c})=>t.createElement(t.Fragment,null,t.createElement(Ul,null),t.createElement(p.Tooltip,{title:n,position:e,theme:r,arrow:o,arrowSize:"regular",animateFill:!1,hideOnClick:"persistent",html:s,interactive:a,style:l,trigger:i,duration:150,delay:100},t.cloneElement(c))),exports.Transition=Ai,exports.UiProvider=({children:e})=>{const[r,o,i]=Ui([]),[a,s]=t.useState(!1),l=e=>{const t=e(i.current);o(t)},c=e=>{const t=e();s(t)},d=t.useMemo((()=>({toasts:r,toastHovering:a,updateToasts:l,updateToastHoverStatus:c})),[r,a]);return n.createElement(md.Provider,{value:d},n.createElement(n.Fragment,null,e,n.createElement(Ed,null)))},exports.debounce=(e,t)=>{let n=0;return(...r)=>{clearTimeout(n),n=setTimeout((()=>e(...r)),t)}},exports.useConfirmation=(e=!1)=>{const[t,n,r]=Ui(e);return{visible:t,setVisible:n,currentRef:r,bindings:{isOpen:t,onDismiss:()=>n(!1)}}},exports.useModal=(e=!1)=>{const[t,n,r]=Ui(e);return{visible:t,setVisible:n,currentRef:r,bindings:{isOpen:t,onDismiss:()=>n(!1)}}},exports.useTheme=function(){const e=t.useContext(qe);if(!e)throw Error("useTheme must be used within a ThemeProvider");return e},exports.useToasts=()=>{const{updateToasts:e,toastHovering:n,toasts:r}=gd(),[,o,i]=Ui(n);t.useEffect((()=>o(n)),[n]);return[r,t=>{const n=`toast-${yd()}`,r=t.delay||Sd,o=(t,n)=>{e((e=>e.map((e=>e.id!==t?e:{...e,willBeDestroy:!0})))),Id.push(t),((t,n)=>{n<=Od||(clearTimeout(Cd),Od=n,Cd=window.setTimeout((()=>{e((e=>Id.length<e.length?e:(Id=[],[]))),clearTimeout(Cd)}),t+350))})(n,performance.now())};e((e=>[...e,{...t,id:n,delay:r,cancel:()=>o(n,r)}]));const a=(e,t)=>{const n=window.setTimeout((()=>{if(i.current)return a(e,t),clearTimeout(n);o(e,t),clearTimeout(n)}),t)};a(n,r)}]};
1283
+ `,Ed=()=>{const e=((e=yd())=>{const n=`ui-${e}`,{isBrowser:r}=bd(),[o,i]=t.useState(r?vd(n):null);return t.useEffect((()=>{const e=document.querySelector(`#${n}`),t=e||vd(n);e||document.body.appendChild(t),i(t)}),[]),o})("toast"),[r,o]=t.useState(!1),i=t.useRef(),{toasts:s,updateToastHoverStatus:l}=gd(),c=t.useMemo((()=>s.map(((e,t)=>n.createElement(_d,{index:t,total:s.length,toast:e,onHover:r,key:`toast-${t}`})))),[s,r]),d=e=>{if(e)return i.current&&clearTimeout(i.current),l((()=>!0)),o(!0);i.current=window.setTimeout((()=>{o(!1),l((()=>!1)),i.current&&clearTimeout(i.current)}),200)};return e&&s&&0!==s.length?a.createPortal(n.createElement(kd,null,n.createElement("div",{className:"toast-container "+(r?"hover":""),onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1)},c)),e):null},Sd=2e3;let Cd,Id=[],Od=0;var Dd=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Nd}(e)}(e)};var Nd="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Md(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Ld((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Td(e,t,n){return e.concat(t).map((function(e){return Md(e,n)}))}function Rd(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function Ad(e,t){try{return t in e}catch(e){return!1}}function Pd(e,t,n){var r={};return n.isMergeableObject(e)&&Rd(e).forEach((function(t){r[t]=Md(e[t],n)})),Rd(t).forEach((function(o){(function(e,t){return Ad(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(Ad(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return Ld;var n=t.customMerge(e);return"function"==typeof n?n:Ld}(o,n)(e[o],t[o],n):r[o]=Md(t[o],n))})),r}function Ld(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Td,n.isMergeableObject=n.isMergeableObject||Dd,n.cloneUnlessOtherwiseSpecified=Md;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):Pd(e,t,n):Md(t,n)}Ld.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Ld(e,n,t)}),{})};var Vd=Ld;exports.Alert=Mn,exports.BUTTON_SIZE_VARIANTS=ci,exports.BoxedRadio=Bc,exports.Button=ui,exports.ButtonDropdown=Fl,exports.Checkbox=fi,exports.Confirmation=ji,exports.ConfirmationBody=Bi,exports.ConfirmationContent=Fi,exports.ConfirmationFooter=Wi,exports.ConfirmationOverlay=Hi,exports.CssBaseLine=gi,exports.DatePicker=e=>{const{onDateChange:r,onClose:o=(()=>null),initialDate:i,anchorDirection:a="right",minMonths:s=6,minimumNights:l=0,...c}=e,[p,h]=t.useState(i&&Gi(i)),[f,m]=t.useState(!1),[g,b]=t.useState(c.autoFocusEndDate?u.END_DATE:u.START_DATE),y=e=>{const t=document.getElementsByClassName("DayPickerNavigation_button")["prev"===e?0:1];return t?t.childNodes[0]:null},v=(e,t)=>{t?e.classList&&e.classList.add("disable-nav"):e.classList&&e.classList.remove("disable-nav")},{autoFocus:x,autoFocusEndDate:w,..._}=c;return n.createElement(si.Box,{style:{position:"relative",height:"100%"}},n.createElement(Ji,null,n.createElement(d.DayPickerSingleDateController,Object.assign({},_,{daySize:32,minimumNights:l,onNextMonthClick:e=>{const t=y("prev"),n=y("next");if(n){Gi().isSame(e.add(1,"months"),"month")?(v(t,!1),v(n,!0)):(v(t,!1),v(n,!1))}},onPrevMonthClick:e=>{const t=y("prev"),n=y("next"),r=s-1;if(t){!Gi().subtract(r,"months").isBefore(e,"month")?(v(t,!0),v(n,!1)):(v(t,!1),v(n,!1))}},navPrev:n.createElement(ta,null),navNext:n.createElement(na,null),renderMonthElement:e=>{const t=y("next"),r=e.month.isAfter(Gi(),"month");return t&&r&&v(t,!0),n.createElement(ra,{dateRangePickerProps:e})},isOutsideRange:e=>!qi(e,Gi()),date:p,onFocusChange:e=>{b(e||u.START_DATE)},focusedInput:g,initialDate:i,minDate:Gi().subtract(s-1,"months").subtract(0,"days"),maxDate:Gi().add(0,"months").endOf("month"),initialVisibleMonth:()=>Gi().subtract(1,"month"),onDateChange:e=>{h(e),r(e)},numberOfMonths:1,hideKeyboardShortcutsPanel:!0,weekDayFormat:"dd"}))))},exports.DismissIcon=pa,exports.Drawer=function(e){const{isOpen:n,onDismiss:r,hideDismissIcon:o,clickOutToClose:i=!0,size:a="default",placement:s="right",children:l,...c}=e;return t.createElement(ga,{in:n,placement:s},(e=>t.createElement(fa.Provider,{value:e},t.createElement(ya,{isOpen:!0,onDismiss:i?r:()=>{}},t.createElement(ba,{size:a},!o&&t.createElement(pa,{onClick:r},t.createElement(En,{glyph:"close",size:"12",viewBox:"-2 -2 10 10"})),l)))))},exports.DrawerBody=ua,exports.DrawerContent=ba,exports.DrawerFooter=ha,exports.DrawerOverlay=ya,exports.Dropdown=e=>{const{items:t,children:r,defaultSelectedItem:o,label:i="",placeholder:a,errorText:s,itemToString:l,itemComponent:c,onChange:d=(e=>e),type:u=pc.BUTTON,filterKey:p,width:h="100%",disabled:f,isErrored:m,isRequired:g,overrideButtonStyles:b,overrideContainerStyles:y,...v}=e;let x;return"object"!=typeof t[0]||l?x=e=>e?l?l(e):"object"!=typeof e?String(e):null:null:console.warn("Your items are objects. So you need to pass a function to translate each object as a string which can be shown as dropdown item labels"),n.createElement("div",null,n.createElement(ys,Object.assign({itemToString:x,selectedItem:o,onChange:d},v),(e=>n.createElement($c,Object.assign({width:h,isRequired:g},e.getRootProps()),i&&n.createElement("label",Object.assign({},e.getLabelProps()),i),n.createElement(hc.Provider,{value:{downshift:e,items:t,filterKey:p,type:u,name:v.name}},r||n.createElement(n.Fragment,null,pc.BUTTON===u&&n.createElement(gc,{disabled:f,isErrored:m,overrideStyles:b,placeholder:a}),pc.INPUT===u&&n.createElement(Lc,{placeholder:a,isErrored:m}),n.createElement(Ac,{itemComponent:c,isErrored:m,overrideStyles:y})))))),m&&s&&n.createElement(Vc,null,s))},exports.Fade=Li,exports.FreemiumUIProvider=function(e){const{theme:n,children:r}=e;return t.createElement(Ze,{theme:n},t.createElement(gi,null),r)},exports.Glyph=kn,exports.Icons=En,exports.InlineSvg=wn,exports.Input=Ql,exports.Loader=e=>{const{size:t="medium",invert:r=!1}=e;return n.createElement(uc,{invert:r,size:t})},exports.Menu=zl,exports.Modal=({children:e,isOpen:t,onDismiss:r,position:o="center",align:i="center",size:a="default"})=>n.createElement(Li,{timeout:300,in:t,unmountOnExit:!0},(s=>n.createElement(oa,{className:"modal-overlay",style:s,align:i,position:o,isOpen:!0,onDismiss:r},n.createElement(Yi,{timeout:150,in:t,unmountOnExit:!0},(t=>n.createElement(la,{className:"modal-content",style:t,size:a,"aria-label":"dialog"},e)))))),exports.ModalBody=ca,exports.ModalContent=la,exports.ModalFooter=da,exports.ModalOverlay=oa,exports.MultiSelectDropdown=e=>{const{name:r,label:o,items:i,selectedItem:a,onChange:s,customValues:l=!1,placeholder:c,isErrored:d,errorText:u,itemLabelIdentifier:p,itemValueIdentifier:h,isRequired:f,renderCustomSuggestion:m,maxAllowedLength:g=2147483647,...b}=e,[y,v]=t.useState([]),[x,w]=t.useState(""),[_,k]=t.useState(!1),E=t.useRef(null);t.useEffect((()=>{v([...a])}),[a]);const S=e=>{y.some((t=>t[h]===e[h]))?I(e):_||C(e)},C=e=>{w(""),v([...y,e]),s([...y,e])},I=e=>{const t=y.filter((t=>t[p]!==e[p]));v(t),s(t)},O=e=>m?m(e):(({item:e,lengthError:t,maxAllowedLength:r,itemProps:o,index:i,highlightedIndex:a,selectedItem:s,itemValueIdentifier:l,itemLabelIdentifier:c})=>{const d=a===i,u=s.some((t=>t[l]&&t[l]===e[l]));return n.createElement(ac,Object.assign({disabled:e.disabled},o,{key:i,isHighlighted:d,isSelected:u,isRemove:u&&e.customValues,lengthError:t}),n.createElement(si.Flex,{alignItems:"center",justifyContent:"space-between"},n.createElement("div",{className:"primary-text","data-testid":`suggested-item-${e[l]}`},t?`Length cannot be greater than ${r} characters`:e.customValues&&""!==e[c]?`Enter to ${u?"remove":"add"} '${e[c]}'`:e[c]),u&&!e.customValues&&n.createElement(En,{glyph:"check",size:12,viewBox:"0 0 8 8"})))})(e);return n.createElement("div",null,n.createElement(ys,Object.assign({selectedItem:a,onChange:e=>{e&&S(e)},itemToString:e=>e?e[h]:"",inputValue:x,onInputValueChange:(e="")=>{l&&e.length>g?k(!0):k(!1),w(e)}},b),(({getInputProps:e,getItemProps:t,getRootProps:a,inputValue:s,selectedItem:u,toggleMenu:m,isOpen:b,highlightedIndex:y})=>n.createElement(sc,Object.assign({required:f},a()),o&&n.createElement("label",{htmlFor:o},o),n.createElement(oc,{isOpen:b,isErrored:d,id:"dropdownField container","data-testid":`formik-multi-select-${o}`,onClick:()=>{b||E&&E.current&&E.current.focus(),m()}},n.createElement("div",{className:"items"},(({selectedItem:e,removeSelectedItem:t,itemLabelIdentifier:r})=>e&&e.length>0&&e.map(((e,o)=>e[r]&&n.createElement(tc,{key:o,onCloseAction:n=>{n.stopPropagation(),t(e)}},e[r]))))({removeSelectedItem:I,selectedItem:u,itemLabelIdentifier:p}),(({label:e,name:t,searchRef:r,InputProps:o,items:i,placeholder:a,customValues:s})=>0!==i.length||s?n.createElement("input",Object.assign({name:t,size:25,"data-testid":`formik-multi-select-input-${e}`,ref:r,type:"text"},o,{placeholder:a})):null)({name:r,label:o||"",searchRef:E,selectedItem:u,removeSelectedItem:I,items:i,inputValue:s,placeholder:c||"",customValues:l,InputProps:{...e({onKeyDown:e=>{"Backspace"!==e.key||s||I(u[u.length-1]),"Enter"===e.key&&s&&l&&null===y&&S({[p]:s,[h]:s})}})}})),n.createElement("div",{className:"svg-wrapper"},n.createElement(En,{size:"8",viewBox:"0 0 8 8",glyph:"chevron-down"}))),n.createElement(Yi,{initialOffset:"-20px",timeout:200,in:b,unmountOnExit:!0},(e=>{const r=((e,t,n,r,o)=>{const i=t.filter((t=>t[n].toLowerCase().includes(e&&e.toLowerCase&&e.toLowerCase())));return 0==i.length&&o&&""!==e&&i.push({[r]:e,[n]:e,customValues:!0}),i})(s,i,p,h,l);return r&&r.length>0&&n.createElement(ic,{style:e},r.map(((e,n)=>O({lengthError:_,maxAllowedLength:g,item:e,index:n,itemProps:t({item:e,onClick:e=>e.stopPropagation(),disabled:e.disabled}),isActive:y===n,highlightedIndex:y,selectedItem:u,itemValueIdentifier:h,itemLabelIdentifier:p}))))}))))),d&&u&&n.createElement(rc,null,u))},exports.Popover=wa,exports.Radio=jc,exports.Slide=zi,exports.SlideFade=Yi,exports.SvgWrapper=_n,exports.Table=e=>{const{columns:t=[],data:r=[],count:o=0,offset:i=0,limit:a=0,next:s=!1,previous:l=!1,showPagination:c=!0,showSelectAllInTable:d=!1,showActions:u=!0,showSelections:p=!0,showFilters:f=!0,showOptions:m=!0,rowMenuOptions:g=(()=>[]),onRowSelect:b,onRowClick:y,emptyComponent:v,onPrevious:x,onSelectAll:w,onNext:_,onMenuOptionSelect:k,headerComponent:E,initialState:S,state:C,filterComponent:I}=e,[O,D]=n.useState(f),[N,M]=n.useState(null),T=h.useTable({columns:t,data:r,initialState:S},h.useRowSelect,h.useColumnOrder,(e=>{e.visibleColumns.push((e=>p?[{id:"selection",disableResizing:!0,width:50,Header:({getToggleAllRowsSelectedProps:e,toggleAllRowsSelected:t})=>d?n.createElement("div",{className:"table-checkbox"},n.createElement(fi,Object.assign({id:"selectAll",name:"selectAll"},e(),{onChange:(e,n)=>{w&&w(n),t(n)}}))):n.createElement("div",null),Cell:e=>{const{row:t,column:r}=e;return n.createElement("div",{className:"table-checkbox"},n.createElement(fi,Object.assign({id:"selectRow",name:"selectRow"},t.getToggleRowSelectedProps(),{onChange:(e,n)=>{t.toggleRowSelected(n)}})))}},...e]:[...e]))})),{getTableProps:R,getTableBodyProps:A,headerGroups:P,rows:L,state:{selectedRowIds:V},prepareRow:$,setColumnOrder:z,getToggleAllRowsSelectedProps:Y}=T;return h.useMountedLayoutEffect((()=>{z(S?.columnOrder)}),[S?.columnOrder]),h.useMountedLayoutEffect((()=>{b&&b(V)}),[b,V]),n.createElement(Gc,{className:"fui-table"},u&&n.createElement(qc,{className:"table-actions"},n.createElement("div",{className:"action"},!d&&p&&n.createElement(fi,Object.assign({id:"selectAll",name:"selectAll"},Y()),"Select All")),E||void 0,n.createElement("div",{className:"pagination-actions"},c&&n.createElement(n.Fragment,null,n.createElement("div",{className:"pagination-text"},i+1," - ",i+a," of ",o),n.createElement(ui,{type:"secondary",disabled:!l,onClick:()=>x&&x(l)},n.createElement(En,{glyph:"chevron-left",size:12,viewBox:"0 0 6 8"})),n.createElement(ui,{type:"secondary",disabled:!s,onClick:()=>_&&_(s)},n.createElement(En,{glyph:"chevron-right",size:12,viewBox:"0 0 6 8"}))),f&&n.createElement(ui,{type:"secondary",className:"filter-toggle",onClick:()=>D(!O)},n.createElement(En,{glyph:O?"collapse":"expand",size:12,viewBox:"0 0 14 14"}))))," ",n.createElement(nd,{className:"table-content"},n.createElement(Kc,{showFilters:f&&O,className:"table-wrapper"},n.createElement(Zc,Object.assign({},R()),n.createElement(Jc,null,P.map((e=>{const{getHeaderGroupProps:t,headers:r}=e;return n.createElement(Xc,Object.assign({},t(),{className:"header-row"}),r.map((e=>{const{getHeaderProps:t,render:r}=e;return n.createElement(ed,Object.assign({},t()),r("Header"))})),m&&n.createElement(ed,null))}))),n.createElement(Qc,Object.assign({},A()),L.length>0?L.map((e=>{$(e);const{getRowProps:t,cells:r}=e;return n.createElement(Xc,Object.assign({},t(),{className:e.isSelected?"selected":""}),r.map((e=>{const{getCellProps:t,render:r}=e;return n.createElement(td,Object.assign({},t(),{onClick:()=>{"selection"!==e.column.id&&y&&y(e.row,e.column)}}),r("Cell"))})),m&&n.createElement(td,null,g&&g(e.original).length>0&&n.createElement(n.Fragment,null,n.createElement(od,{"aria-describedby":`row-popover-${e.id}`,onClick:e=>M(e.currentTarget)},n.createElement(En,{glyph:"more-vertical",size:12,viewBox:"0 0 4 16"})),n.createElement(wa,{id:`row-popover-${e.id}`,anchorEl:N,onClose:()=>M(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"}},n.createElement(zl,{options:g(e.original)||[],onSelect:t=>{k&&k(t.id,e.original),M(null)},closeMenuCallback:()=>M(null)})))))})):n.createElement(Xc,null,v)))),f&&O&&I&&n.createElement(rd,{className:"table-filters"},n.createElement(Xc,null,I))))},exports.Tabs=e=>{const{value:t,onChange:r=(()=>{}),idAccessor:o="id",nameAccessor:i="name",options:a=[],ref:s=null}=e;return n.createElement(id,{ref:s,role:"tablist"},a.map((e=>!e.hide&&n.createElement(ad,{"aria-disabled":Boolean(e.disabled),tabIndex:t===e[o]?-1:0,role:"tab",className:`${e.disabled?"disabled":""} ${t===e[o]?"selected":""}`.trim(),onClick:t=>!e.disabled&&r(t,e),id:e[o],key:e[o]},n.createElement("span",{className:"label"}," ",e[i])))))},exports.Tag=tc,exports.TextArea=ec,exports.ThemeProvider=function(e){const{children:n,theme:r={},globalStyle:o=!0}=e,i=Vd(mi,r);return t.createElement(Ze,{theme:i},o&&t.createElement(gi,null),n)},exports.ToastWrapper=e=>{const[r,o]=t.useState([]),[i,a]=t.useState(0),[l,c]=t.useState(!1),d=e=>{o(r.filter((t=>t.id!==e)))};return t.useEffect((()=>{r.length||c(!1)}),[r]),n.createElement(ld.Provider,{value:{pushToast:e=>{const t={...e,id:i};a(i+1),o([t,...r])},closeToast:d}},e.children,s.createPortal(n.createElement(ud,{length:r.length,isHovering:l,onMouseOver:()=>{c(!0)},onMouseLeave:()=>{c(!1)}},r.map(((e,t)=>n.createElement(cd,{key:e.id,index:t,toast:e,closeToast:d,isHovering:l})))," "),document.body))},exports.Toggle=fd,exports.Tooltip=({position:e="bottom",label:n,theme:r="dark",arrow:o=!0,trigger:i="mouseenter",interactive:a=!0,html:s=null,style:l={},children:c})=>t.createElement(t.Fragment,null,t.createElement(Ul,null),t.createElement(p.Tooltip,{title:n,position:e,theme:r,arrow:o,arrowSize:"regular",animateFill:!1,hideOnClick:"persistent",html:s,interactive:a,style:l,trigger:i,duration:150,delay:100},t.cloneElement(c))),exports.Transition=Ai,exports.UiProvider=({children:e})=>{const[r,o,i]=Ui([]),[a,s]=t.useState(!1),l=e=>{const t=e(i.current);o(t)},c=e=>{const t=e();s(t)},d=t.useMemo((()=>({toasts:r,toastHovering:a,updateToasts:l,updateToastHoverStatus:c})),[r,a]);return n.createElement(md.Provider,{value:d},n.createElement(n.Fragment,null,e,n.createElement(Ed,null)))},exports.debounce=(e,t)=>{let n=0;return(...r)=>{clearTimeout(n),n=setTimeout((()=>e(...r)),t)}},exports.useConfirmation=(e=!1)=>{const[t,n,r]=Ui(e);return{visible:t,setVisible:n,currentRef:r,bindings:{isOpen:t,onDismiss:()=>n(!1)}}},exports.useModal=(e=!1)=>{const[t,n,r]=Ui(e);return{visible:t,setVisible:n,currentRef:r,bindings:{isOpen:t,onDismiss:()=>n(!1)}}},exports.useTheme=function(){const e=t.useContext(qe);if(!e)throw Error("useTheme must be used within a ThemeProvider");return e},exports.useToasts=()=>{const{updateToasts:e,toastHovering:n,toasts:r}=gd(),[,o,i]=Ui(n);t.useEffect((()=>o(n)),[n]);return[r,t=>{const n=`toast-${yd()}`,r=t.delay||Sd,o=(t,n)=>{e((e=>e.map((e=>e.id!==t?e:{...e,willBeDestroy:!0})))),Id.push(t),((t,n)=>{n<=Od||(clearTimeout(Cd),Od=n,Cd=window.setTimeout((()=>{e((e=>Id.length<e.length?e:(Id=[],[]))),clearTimeout(Cd)}),t+350))})(n,performance.now())};e((e=>[...e,{...t,id:n,delay:r,cancel:()=>o(n,r)}]));const a=(e,t)=>{const n=window.setTimeout((()=>{if(i.current)return a(e,t),clearTimeout(n);o(e,t),clearTimeout(n)}),t)};a(n,r)}]};
package/lib/index.esm.js CHANGED
@@ -66,7 +66,7 @@ object-assign
66
66
  user-select: none;
67
67
  ${({theme:{typography:e,colors:{components:{button:t}}},_type:n,size:r})=>{const{hover:o,color:i,...a}=t[n],s=a&&a.backgroundGradient&&a.backgroundGradient.from?`linear-gradient(180deg, ${a.backgroundGradient.from} 0%, ${a.backgroundGradient.to} 100%)`:"";return{...a,...e.body.secondary,backgroundImage:s,boxShadow:"link"===n?"none":"0 1px 0 0 rgba(24,50,71,0.05)",color:i,height:(e=>e===Ii.NORMAL?"34px":e===Ii.LARGE?"45px":"auto")(r),fontSize:r===Ii.MINI?"12px":"14px"}}}
68
68
  ${e=>{const{theme:{colors:{components:{button:t},pseudo:n},palette:r},_type:o,btnLoading:i=!1}=e,{hover:a,active:s,disabled:l}=t[o];return`\n &:not([disabled]) {\n &:hover {\n background-color: ${a};\n background-image: none;\n }\n \n &:active {\n outline: 0;\n box-shadow: inset 0px 0px 4px 1px ${tn(r.E900,.2)};\n background-color: ${s.backgroundColor};\n border: 1px solid ${s.borderColor};\n }\n }\n \n &[disabled] {\n cursor: not-allowed;\n }\n\n &:focus:not(:active) {\n outline: none;\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px ${n.focus};\n }\n \n ${i?"":`&[disabled] {\n -webkit-box-shadow: none;\n box-shadow: none;\n background-image: linear-gradient(180deg, ${l.backgroundGradient.from} 0%, ${l.backgroundGradient.to} 100%);\n border: 1px solid ${l.borderColor};\n color: ${l.color};\n }`}`}};
69
- `,Ni=t=>{const{inline:n=!1,children:r,disabled:o,className:i="",htmlType:a,type:s="primary",onClick:l,size:c,overrideStyleClassName:d="",loading:u=!1,...p}=t;return e.createElement(Oi,Object.assign({inline:n,_type:s,disabled:o,className:`${i} ${d}`,type:a,onClick:l,size:c,btnLoading:Boolean(u)},p),u?e.createElement(Si.Box,null,e.createElement(Ci,null)):r)},Di=l(((t,n)=>e.createElement(Mi,{checked:t.checked,disabled:t.disabled||!1},e.createElement("label",null,e.createElement("input",{ref:n,id:t.id,type:"checkbox",name:t.name,readOnly:t.readOnly,disabled:t.disabled,"aria-disabled":t.disabled,value:t.value,checked:t.checked,onChange:t.readOnly?()=>{}:e=>t.onChange(e,e.target.checked)}),e.createElement("div",{className:"checkbox"},t.checked&&e.createElement("span",null,e.createElement(Hn,{size:"12",viewBox:"0 0 10 10",glyph:"tick"}))),e.createElement("div",null,t.children))))),Mi=yt.div`
69
+ `,Ni=t=>{const{inline:n=!1,children:r,disabled:o,className:i="",htmlType:a,type:s="primary",onClick:l,size:c,overrideStyleClassName:d="",loading:u=!1,...p}=t;return e.createElement(Oi,Object.assign({inline:n,_type:s,disabled:o,className:`${i} ${d}`,type:a,onClick:l,size:c,btnLoading:Boolean(u)},p),u?e.createElement(Si.Box,null,e.createElement(Ci,null)):r)},Di=l(((t,n)=>e.createElement(Mi,{checked:t.checked,disabled:t.disabled||!1},e.createElement("label",null,e.createElement("input",{ref:n,id:t.id,type:"checkbox",name:t.name,readOnly:t.readOnly,disabled:t.disabled,"aria-disabled":t.disabled,value:t.value,checked:t.checked,onChange:t.readOnly?()=>{}:e=>{t.onChange&&t.onChange(e,e.target.checked)}}),e.createElement("div",{className:"checkbox"},t.checked&&e.createElement("span",null,e.createElement(Hn,{size:"12",viewBox:"0 0 10 10",glyph:"tick"}))),e.createElement("div",null,t.children))))),Mi=yt.div`
70
70
  ${({theme:{colors:{components:{checkbox:e},pseudo:t},typography:{body:n}},disabled:r,checked:o})=>`\n font-size : ${n.label.fontSize};\n font-weight : ${n.label.fontWeight};\n input {\n clip : rect(0px 0px 0px 0px);\n width : 1px;\n height : 1px;\n &:focus{\n & ~ .checkbox {\n box-shadow: ${t.focus} 0px 0px 0px 2px;\n border-color : transparent;\n }\n }\n }\n label {\n cursor: ${r?"not-allowed":"inherit"};\n display: flex;\n align-items: center;\n user-select: none;\n opacity : ${r?.5:1};\n }\n .checkbox {\n background-color: ${o?e.backgroundColor:"#fff"};\n border: ${o?"none":"1px solid"};\n border-color: ${o?e.backgroundColor:e.borderColor};\n transition: background-color ease-in 0.2s;\n min-width: 14px;\n min-height: 14px;\n border-radius: 2px;\n position: relative;\n margin-right: 10px;\n span {\n left: 2px;\n top : 2px;\n position: absolute;\n }\n &:hover {\n ${r?"":`border-color : ${o?e.backgroundColor:e.hoverBorderColor}!important`};\n box-shadow: ${r?"unset":`${t.hover} 0px 0px 0px 5px!important`}; \n }\n`}
71
71
  `,Ti=_t(Di,{checked:!1,sizeVariant:"md"});var Ai={palette:kt,colors:zn,layout:{gap:"16pt",gapNegative:"-16pt",gapHalf:"8pt",gapHalfNegative:"-8pt",gapQuarter:"4pt",gapQuarterNegative:"-4pt",pageMargin:"16pt",pageWidth:"750pt",pageWidthWithMargin:"782pt",radius:"5px"},typography:{fontFamily:'-apple-system, ".SFNSText-Regular", "San Francisco", BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", "Lucida Grande", Arial, sans-serif',headings:{h1:{fontSize:"44px",lineHeight:"66px",margin:"0px"},h2:{fontSize:"32px",lineHeight:"48px",margin:"0px"},h3:{fontSize:"24px",lineHeight:"36px",margin:"0px"},h4:{fontSize:"18px",lineHeight:18*1.3+"px",margin:"0px"},h5:{fontSize:"16px",lineHeight:"20.8px",margin:"0px"}},text:{regular:{fontWeight:400},semiBold:{fontWeight:500},bold:{fontWeight:600}},body:{regular:{fontSize:"14px",lineHeight:"18.2px",margin:"0px"},regularBold:{fontSize:"14px",fontWeight:"bold",lineHeight:"21px",margin:"0px"},secondary:{fontSize:"12px"},secondaryBold:{fontSize:"12px",lineHeight:"18px",fontWeight:600},dropdown:{fontSize:"13px",lineHeight:"30px"},label:{fontSize:"12px",lineHeight:"19px",fontWeight:500},requiredLabel:{fontWeight:700,fontSize:"14px",lineHeight:"14px"},errorText:{fontSize:"12px"},anchor:{light:{fontSize:"14px",lineHeight:"17px"},bold:{fontSize:"14px",fontWeight:600,lineHeight:"15px"}},tagText:{fontSize:"12px",lineHeight:"14px",fontWeight:"500",letterSpacing:"0.2px"}},input:{text:{fontSize:"14px",lineHeight:"32px",fontWeight:"500"},textarea:{fontSize:"14px",lineHeight:"1.4",fontWeight:"500"},disabled:{fontWeight:"bold"},label:{fontSize:"12px",lineHeight:"20px",fontWeight:600},error:{fontSize:"12px",lineHeight:"17px"}},table:{header:{fontWeight:800,fontSize:"12px",padding:"16px",lineHeight:"16px"},body:{fontWeight:400,fontSize:"14px",padding:"12px",lineHeight:"20px"}},tabs:{fontSize:"14px",padding:"8px"},menu:{padding:"8px",menuItem:{fontWeight:500,fontSize:"14px",padding:"8px"}}}};const Ri=xt`
72
72
  html,
@@ -1011,7 +1011,7 @@ r.version="2.29.1",o(Kn),r.fn=ci,r.min=Qn,r.max=er,r.now=tr,r.utc=f,r.unix=di,r.
1011
1011
  ${({theme:{colors:e,typography:{body:t}},isHighlighted:n,isSelected:r,disabled:o,isRemove:i,lengthError:a})=>`\n .primary-text {\n font-size : ${t.regular.fontSize};\n line-height : ${t.regular.lineHeight};\n color: ${i||a?e.text.error:r?n?e.text.primary:e.text.link:o?e.text.disabled:e.text.primary};\n font-weight : ${r?"500":"400"};\n display: block;\n }\n padding : 8px;\n margin : 8px;\n border-radius: 4px;\n overflow-wrap : break-word; \n background: ${i?"none":r?e.background.selected:n?e.background.hover:"none"};\n :hover {\n cursor: ${o?"not-allowed":"pointer"};\n } \n `}
1012
1012
  `,Tc=yt.div`
1013
1013
  ${({required:e,theme:{colors:{text:t},typography:{body:n,input:r}}})=>`\n position : relative;\n label {\n display : inline-block;\n font-weight: ${n.label.fontWeight};\n font-size: ${n.label.fontSize};\n line-height: ${n.label.lineHeight};\n text-transform: capitalize;\n padding-left: 2px;\n margin-bottom : 8px;\n ${e?`&::after {\n content: '*';\n position: relative;\n top: 2px;\n font-weight: ${n.requiredLabel.fontWeight};\n font-size: ${n.requiredLabel.fontSize};\n color : ${t.error};\n padding-left: 3px;\n }`:""};\n }\n `}
1014
- `,Ac=t=>{const{name:n,label:o,items:i,selectedItem:a,onChange:s,customValues:l=!1,placeholder:u,isErrored:p,errorText:h,itemLabelIdentifier:f,itemValueIdentifier:m,isRequired:g,renderCustomSuggestion:b,maxAllowedLength:y=2147483647,...v}=t,[x,w]=c([]),[_,k]=c(""),[E,S]=c(!1),C=r(null);d((()=>{w([...a])}),[a]);const I=e=>{x.some((t=>t[m]===e[m]))?N(e):E||O(e)},O=e=>{k(""),w([...x,e]),s([...x,e])},N=e=>{const t=x.filter((t=>t[f]!==e[f]));w(t),s(t)},D=t=>b?b(t):(({item:t,lengthError:n,maxAllowedLength:r,itemProps:o,index:i,highlightedIndex:a,selectedItem:s,itemValueIdentifier:l,itemLabelIdentifier:c})=>{const d=a===i,u=s.some((e=>e[l]&&e[l]===t[l]));return e.createElement(Mc,Object.assign({disabled:t.disabled},o,{key:i,isHighlighted:d,isSelected:u,isRemove:u&&t.customValues,lengthError:n}),e.createElement(Si.Flex,{alignItems:"center",justifyContent:"space-between"},e.createElement("div",{className:"primary-text","data-testid":`suggested-item-${t[l]}`},n?`Length cannot be greater than ${r} characters`:t.customValues&&""!==t[c]?`Enter to ${u?"remove":"add"} '${t[c]}'`:t[c]),u&&!t.customValues&&e.createElement(Hn,{glyph:"check",size:12,viewBox:"0 0 8 8"})))})(t);return e.createElement("div",null,e.createElement(Fs,Object.assign({selectedItem:a,onChange:e=>{e&&I(e)},itemToString:e=>e?e[m]:"",inputValue:_,onInputValueChange:(e="")=>{l&&e.length>y?S(!0):S(!1),k(e)}},v),(({getInputProps:t,getItemProps:r,getRootProps:a,inputValue:s,selectedItem:c,toggleMenu:d,isOpen:h,highlightedIndex:b})=>e.createElement(Tc,Object.assign({required:g},a()),o&&e.createElement("label",{htmlFor:o},o),e.createElement(Nc,{isOpen:h,isErrored:p,id:"dropdownField container","data-testid":`formik-multi-select-${o}`,onClick:()=>{h||C&&C.current&&C.current.focus(),d()}},e.createElement("div",{className:"items"},(({selectedItem:t,removeSelectedItem:n,itemLabelIdentifier:r})=>t&&t.length>0&&t.map(((t,o)=>t[r]&&e.createElement(Cc,{key:o,onCloseAction:e=>{e.stopPropagation(),n(t)}},t[r]))))({removeSelectedItem:N,selectedItem:c,itemLabelIdentifier:f}),(({label:t,name:n,searchRef:r,InputProps:o,items:i,placeholder:a,customValues:s})=>0!==i.length||s?e.createElement("input",Object.assign({name:n,size:25,"data-testid":`formik-multi-select-input-${t}`,ref:r,type:"text"},o,{placeholder:a})):null)({name:n,label:o||"",searchRef:C,selectedItem:c,removeSelectedItem:N,items:i,inputValue:s,placeholder:u,customValues:l,InputProps:{...t({onKeyDown:e=>{"Backspace"!==e.key||s||N(c[c.length-1]),"Enter"===e.key&&s&&l&&null===b&&I({[f]:s,[m]:s})}})}})),e.createElement("div",{className:"svg-wrapper"},e.createElement(Hn,{size:"8",viewBox:"0 0 8 8",glyph:"chevron-down"}))),e.createElement(oa,{initialOffset:"-20px",timeout:200,in:h,unmountOnExit:!0},(t=>{const n=((e,t,n,r,o)=>{const i=t.filter((t=>t[n].toLowerCase().includes(e&&e.toLowerCase&&e.toLowerCase())));return 0==i.length&&o&&""!==e&&i.push({[r]:e,[n]:e,customValues:!0}),i})(s,i,f,m,l);return n&&n.length>0&&e.createElement(Dc,{style:t},n.map(((e,t)=>D({lengthError:E,maxAllowedLength:y,item:e,index:t,itemProps:r({item:e,onClick:e=>e.stopPropagation(),disabled:e.disabled}),isActive:b===t,highlightedIndex:b,selectedItem:c,itemValueIdentifier:m,itemLabelIdentifier:f}))))}))))),p&&h&&e.createElement(Oc,null,h))},Rc={small:16,medium:32,big:40},Pc=wt`
1014
+ `,Ac=t=>{const{name:n,label:o,items:i,selectedItem:a,onChange:s,customValues:l=!1,placeholder:u,isErrored:p,errorText:h,itemLabelIdentifier:f,itemValueIdentifier:m,isRequired:g,renderCustomSuggestion:b,maxAllowedLength:y=2147483647,...v}=t,[x,w]=c([]),[_,k]=c(""),[E,S]=c(!1),C=r(null);d((()=>{w([...a])}),[a]);const I=e=>{x.some((t=>t[m]===e[m]))?N(e):E||O(e)},O=e=>{k(""),w([...x,e]),s([...x,e])},N=e=>{const t=x.filter((t=>t[f]!==e[f]));w(t),s(t)},D=t=>b?b(t):(({item:t,lengthError:n,maxAllowedLength:r,itemProps:o,index:i,highlightedIndex:a,selectedItem:s,itemValueIdentifier:l,itemLabelIdentifier:c})=>{const d=a===i,u=s.some((e=>e[l]&&e[l]===t[l]));return e.createElement(Mc,Object.assign({disabled:t.disabled},o,{key:i,isHighlighted:d,isSelected:u,isRemove:u&&t.customValues,lengthError:n}),e.createElement(Si.Flex,{alignItems:"center",justifyContent:"space-between"},e.createElement("div",{className:"primary-text","data-testid":`suggested-item-${t[l]}`},n?`Length cannot be greater than ${r} characters`:t.customValues&&""!==t[c]?`Enter to ${u?"remove":"add"} '${t[c]}'`:t[c]),u&&!t.customValues&&e.createElement(Hn,{glyph:"check",size:12,viewBox:"0 0 8 8"})))})(t);return e.createElement("div",null,e.createElement(Fs,Object.assign({selectedItem:a,onChange:e=>{e&&I(e)},itemToString:e=>e?e[m]:"",inputValue:_,onInputValueChange:(e="")=>{l&&e.length>y?S(!0):S(!1),k(e)}},v),(({getInputProps:t,getItemProps:r,getRootProps:a,inputValue:s,selectedItem:c,toggleMenu:d,isOpen:h,highlightedIndex:b})=>e.createElement(Tc,Object.assign({required:g},a()),o&&e.createElement("label",{htmlFor:o},o),e.createElement(Nc,{isOpen:h,isErrored:p,id:"dropdownField container","data-testid":`formik-multi-select-${o}`,onClick:()=>{h||C&&C.current&&C.current.focus(),d()}},e.createElement("div",{className:"items"},(({selectedItem:t,removeSelectedItem:n,itemLabelIdentifier:r})=>t&&t.length>0&&t.map(((t,o)=>t[r]&&e.createElement(Cc,{key:o,onCloseAction:e=>{e.stopPropagation(),n(t)}},t[r]))))({removeSelectedItem:N,selectedItem:c,itemLabelIdentifier:f}),(({label:t,name:n,searchRef:r,InputProps:o,items:i,placeholder:a,customValues:s})=>0!==i.length||s?e.createElement("input",Object.assign({name:n,size:25,"data-testid":`formik-multi-select-input-${t}`,ref:r,type:"text"},o,{placeholder:a})):null)({name:n,label:o||"",searchRef:C,selectedItem:c,removeSelectedItem:N,items:i,inputValue:s,placeholder:u||"",customValues:l,InputProps:{...t({onKeyDown:e=>{"Backspace"!==e.key||s||N(c[c.length-1]),"Enter"===e.key&&s&&l&&null===b&&I({[f]:s,[m]:s})}})}})),e.createElement("div",{className:"svg-wrapper"},e.createElement(Hn,{size:"8",viewBox:"0 0 8 8",glyph:"chevron-down"}))),e.createElement(oa,{initialOffset:"-20px",timeout:200,in:h,unmountOnExit:!0},(t=>{const n=((e,t,n,r,o)=>{const i=t.filter((t=>t[n].toLowerCase().includes(e&&e.toLowerCase&&e.toLowerCase())));return 0==i.length&&o&&""!==e&&i.push({[r]:e,[n]:e,customValues:!0}),i})(s,i,f,m,l);return n&&n.length>0&&e.createElement(Dc,{style:t},n.map(((e,t)=>D({lengthError:E,maxAllowedLength:y,item:e,index:t,itemProps:r({item:e,onClick:e=>e.stopPropagation(),disabled:e.disabled}),isActive:b===t,highlightedIndex:b,selectedItem:c,itemValueIdentifier:m,itemLabelIdentifier:f}))))}))))),p&&h&&e.createElement(Oc,null,h))},Rc={small:16,medium:32,big:40},Pc=wt`
1015
1015
  to { transform: rotate(360deg); }
1016
1016
  `,Lc={small:3,medium:5,big:6},Vc=yt.div`
1017
1017
  position: relative;
@@ -1089,7 +1089,7 @@ r.version="2.29.1",o(Kn),r.fn=ci,r.min=Qn,r.max=er,r.now=tr,r.utc=f,r.unix=di,r.
1089
1089
  width: calc(100% + 12px);
1090
1090
  opacity: ${e=>e.disabled?.7:1};
1091
1091
  cursor: ${e=>e.disabled?"not-allowed":"pointer"};
1092
- `;var xd=_t((t=>{const[n,r]=c(t.defaultSelectedValue);return d((()=>{r(t.defaultSelectedValue)}),[t.defaultSelectedValue]),e.createElement(gd.Provider,{value:{groupValue:n,groupDisabled:t.disabled,updateGroupValue:e=>{t.disabled||(r(e),t.onChange&&t.onChange(e))}}},e.createElement(vd,{disabled:t.disabled,className:t.className},t.children))}),{disabled:!1,defaultSelectedValue:null,onChange:e=>{}});yd.Group=xd;const wd=t=>{const{columns:n=[],data:r=[],count:o=0,offset:i=0,limit:a=0,next:s=!1,previous:l=!1,showPagination:c=!0,showSelectAllInTable:d=!1,showActions:u=!0,showSelections:p=!0,showFilters:h=!0,showOptions:f=!0,rowMenuOptions:m=(()=>[]),onRowSelect:g,onRowClick:b,onPrevious:y,onSelectAll:v,onNext:x,onMenuOptionSelect:w,headerComponent:_,initialState:k,state:E,filterComponent:S}=t,[C,I]=e.useState(h),[O,A]=e.useState(null),R=N({columns:n,data:r,initialState:k},D,M,(t=>{t.visibleColumns.push((t=>p?[{id:"selection",disableResizing:!0,width:50,Header:({getToggleAllRowsSelectedProps:t,toggleAllRowsSelected:n})=>d?e.createElement("div",{className:"table-checkbox"},e.createElement(Ti,Object.assign({id:"selectAll",name:"selectAll"},t(),{onChange:(e,t)=>{v&&v(t),n(t)}}))):e.createElement("div",null),Cell:t=>{const{row:n,column:r}=t;return e.createElement("div",{className:"table-checkbox"},e.createElement(Ti,Object.assign({id:"selectRow",name:"selectRow"},n.getToggleRowSelectedProps(),{onChange:(e,t)=>{n.toggleRowSelected(t)}})))}},...t]:[...t]))})),{getTableProps:P,getTableBodyProps:L,headerGroups:V,rows:$,state:{selectedRowIds:z},prepareRow:Y,setColumnOrder:j,getToggleAllRowsSelectedProps:F}=R;return T((()=>{j(k?.columnOrder)}),[k?.columnOrder]),T((()=>{g&&g(z)}),[g,z]),e.createElement(_d,{className:"fui-table"},u&&e.createElement(Ed,{className:"table-actions"},e.createElement("div",{className:"action"},!d&&p&&e.createElement(Ti,Object.assign({id:"selectAll",name:"selectAll"},F()),"Select All")),_||void 0,e.createElement("div",{className:"pagination-actions"},c&&e.createElement(e.Fragment,null,e.createElement("div",{className:"pagination-text"},i+1," - ",i+a," of ",o),e.createElement(Ni,{type:"secondary",disabled:!l,onClick:()=>y&&y(l)},e.createElement(Hn,{glyph:"chevron-left",size:12,viewBox:"0 0 6 8"})),e.createElement(Ni,{type:"secondary",disabled:!s,onClick:()=>x&&x(s)},e.createElement(Hn,{glyph:"chevron-right",size:12,viewBox:"0 0 6 8"}))),h&&e.createElement(Ni,{type:"secondary",className:"filter-toggle",onClick:()=>I(!C)},e.createElement(Hn,{glyph:C?"collapse":"expand",size:12,viewBox:"0 0 14 14"}))))," ",e.createElement(Md,{className:"table-content"},e.createElement(kd,{showFilters:h&&C,className:"table-wrapper"},e.createElement(Sd,Object.assign({},P()),e.createElement(Id,null,V.map((t=>{const{getHeaderGroupProps:n,headers:r}=t;return e.createElement(Cd,Object.assign({},n(),{className:"header-row"}),r.map((t=>{const{getHeaderProps:n,render:r}=t;return e.createElement(Nd,Object.assign({},n()),r("Header"))})),f&&e.createElement(Nd,null))}))),e.createElement(Od,Object.assign({},L()),$.map((t=>{Y(t);const{getRowProps:n,cells:r}=t;return e.createElement(Cd,Object.assign({},n(),{className:t.isSelected?"selected":""}),r.map((t=>{const{getCellProps:n,render:r}=t;return e.createElement(Dd,Object.assign({},n(),{onClick:()=>{"selection"!==t.column.id&&b&&b(t.row,t.column)}}),r("Cell"))})),f&&e.createElement(Dd,null,m&&m(t.original).length>0&&e.createElement(e.Fragment,null,e.createElement(Ad,{"aria-describedby":`row-popover-${t.id}`,onClick:e=>A(e.currentTarget)},e.createElement(Hn,{glyph:"more-vertical",size:12,viewBox:"0 0 4 16"})),e.createElement(Wa,{id:`row-popover-${t.id}`,anchorEl:O,onClose:()=>A(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"}},e.createElement(cc,{options:m(t.original)||[],onSelect:e=>{w&&w(e.id,t.original),A(null)},closeMenuCallback:()=>A(null)})))))}))))),h&&C&&S&&e.createElement(Td,{className:"table-filters"},S)))},_d=yt.div`
1092
+ `;var xd=_t((t=>{const[n,r]=c(t.defaultSelectedValue);return d((()=>{r(t.defaultSelectedValue)}),[t.defaultSelectedValue]),e.createElement(gd.Provider,{value:{groupValue:n,groupDisabled:t.disabled,updateGroupValue:e=>{t.disabled||(r(e),t.onChange&&t.onChange(e))}}},e.createElement(vd,{disabled:t.disabled,className:t.className},t.children))}),{disabled:!1,defaultSelectedValue:null,onChange:e=>{}});yd.Group=xd;const wd=t=>{const{columns:n=[],data:r=[],count:o=0,offset:i=0,limit:a=0,next:s=!1,previous:l=!1,showPagination:c=!0,showSelectAllInTable:d=!1,showActions:u=!0,showSelections:p=!0,showFilters:h=!0,showOptions:f=!0,rowMenuOptions:m=(()=>[]),onRowSelect:g,onRowClick:b,emptyComponent:y,onPrevious:v,onSelectAll:x,onNext:w,onMenuOptionSelect:_,headerComponent:k,initialState:E,state:S,filterComponent:C}=t,[I,O]=e.useState(h),[A,R]=e.useState(null),P=N({columns:n,data:r,initialState:E},D,M,(t=>{t.visibleColumns.push((t=>p?[{id:"selection",disableResizing:!0,width:50,Header:({getToggleAllRowsSelectedProps:t,toggleAllRowsSelected:n})=>d?e.createElement("div",{className:"table-checkbox"},e.createElement(Ti,Object.assign({id:"selectAll",name:"selectAll"},t(),{onChange:(e,t)=>{x&&x(t),n(t)}}))):e.createElement("div",null),Cell:t=>{const{row:n,column:r}=t;return e.createElement("div",{className:"table-checkbox"},e.createElement(Ti,Object.assign({id:"selectRow",name:"selectRow"},n.getToggleRowSelectedProps(),{onChange:(e,t)=>{n.toggleRowSelected(t)}})))}},...t]:[...t]))})),{getTableProps:L,getTableBodyProps:V,headerGroups:$,rows:z,state:{selectedRowIds:Y},prepareRow:j,setColumnOrder:F,getToggleAllRowsSelectedProps:H}=P;return T((()=>{F(E?.columnOrder)}),[E?.columnOrder]),T((()=>{g&&g(Y)}),[g,Y]),e.createElement(_d,{className:"fui-table"},u&&e.createElement(Ed,{className:"table-actions"},e.createElement("div",{className:"action"},!d&&p&&e.createElement(Ti,Object.assign({id:"selectAll",name:"selectAll"},H()),"Select All")),k||void 0,e.createElement("div",{className:"pagination-actions"},c&&e.createElement(e.Fragment,null,e.createElement("div",{className:"pagination-text"},i+1," - ",i+a," of ",o),e.createElement(Ni,{type:"secondary",disabled:!l,onClick:()=>v&&v(l)},e.createElement(Hn,{glyph:"chevron-left",size:12,viewBox:"0 0 6 8"})),e.createElement(Ni,{type:"secondary",disabled:!s,onClick:()=>w&&w(s)},e.createElement(Hn,{glyph:"chevron-right",size:12,viewBox:"0 0 6 8"}))),h&&e.createElement(Ni,{type:"secondary",className:"filter-toggle",onClick:()=>O(!I)},e.createElement(Hn,{glyph:I?"collapse":"expand",size:12,viewBox:"0 0 14 14"}))))," ",e.createElement(Md,{className:"table-content"},e.createElement(kd,{showFilters:h&&I,className:"table-wrapper"},e.createElement(Sd,Object.assign({},L()),e.createElement(Id,null,$.map((t=>{const{getHeaderGroupProps:n,headers:r}=t;return e.createElement(Cd,Object.assign({},n(),{className:"header-row"}),r.map((t=>{const{getHeaderProps:n,render:r}=t;return e.createElement(Nd,Object.assign({},n()),r("Header"))})),f&&e.createElement(Nd,null))}))),e.createElement(Od,Object.assign({},V()),z.length>0?z.map((t=>{j(t);const{getRowProps:n,cells:r}=t;return e.createElement(Cd,Object.assign({},n(),{className:t.isSelected?"selected":""}),r.map((t=>{const{getCellProps:n,render:r}=t;return e.createElement(Dd,Object.assign({},n(),{onClick:()=>{"selection"!==t.column.id&&b&&b(t.row,t.column)}}),r("Cell"))})),f&&e.createElement(Dd,null,m&&m(t.original).length>0&&e.createElement(e.Fragment,null,e.createElement(Ad,{"aria-describedby":`row-popover-${t.id}`,onClick:e=>R(e.currentTarget)},e.createElement(Hn,{glyph:"more-vertical",size:12,viewBox:"0 0 4 16"})),e.createElement(Wa,{id:`row-popover-${t.id}`,anchorEl:A,onClose:()=>R(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"}},e.createElement(cc,{options:m(t.original)||[],onSelect:e=>{_&&_(e.id,t.original),R(null)},closeMenuCallback:()=>R(null)})))))})):e.createElement(Cd,null,y)))),h&&I&&C&&e.createElement(Td,{className:"table-filters"},e.createElement(Cd,null,C))))},_d=yt.div`
1093
1093
  flex: 1;
1094
1094
  overflow: auto;
1095
1095
  `,kd=yt.div`
@@ -7,7 +7,7 @@ interface CheckboxProps {
7
7
  children?: any;
8
8
  name: string;
9
9
  value?: string | number;
10
- onChange: (event: React.ChangeEvent<HTMLInputElement> | React.KeyboardEvent<HTMLInputElement>, checked: boolean) => void;
10
+ onChange?: (event: React.ChangeEvent<HTMLInputElement> | React.KeyboardEvent<HTMLInputElement>, checked: boolean) => void;
11
11
  id?: string;
12
12
  }
13
13
  export declare const Checkbox: React.ComponentType<Partial<{
@@ -1,11 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  declare type MultiSelectProps = {
3
3
  name: string;
4
+ id?: string;
4
5
  label?: string;
5
6
  items: any[];
6
7
  selectedItem: any;
7
8
  onChange: (items: any) => void;
8
- placeholder: string;
9
+ placeholder?: string;
9
10
  itemLabelIdentifier: string;
10
11
  itemValueIdentifier: string;
11
12
  errorText?: string;
@@ -102,6 +102,7 @@ declare type TableProps = {
102
102
  onRowSelect?: (selectedRowIds: Record<IdType, boolean>) => void;
103
103
  onRowClick?: (row: RowProps, column: HeaderProps) => void;
104
104
  columns?: Array<ColumnOptions> | Array<ColumnGroupOptions>;
105
+ emptyComponent?: React.ReactNode;
105
106
  headerComponent?: React.ReactNode;
106
107
  filterComponent?: React.ReactNode;
107
108
  data?: Array<unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freemium-ui",
3
- "version": "1.0.143",
3
+ "version": "1.0.147",
4
4
  "description": "React Ui Components for Freemium Apps",
5
5
  "main": "lib/index.cjs.js",
6
6
  "module": "lib/index.esm.js",