@fluidattacks/design 3.30.39 → 3.30.40
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/dist/components/@core/index.js +1 -1
- package/dist/components/accordion/accordion-content/index.js +1 -1
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/advisories-card/index.js +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/card/card-header/index.js +1 -1
- package/dist/components/card/card-with-image/index.js +1 -1
- package/dist/components/card/card-with-input/index.js +1 -1
- package/dist/components/card/card-with-options/index.js +1 -1
- package/dist/components/card/card-with-selector/index.js +1 -1
- package/dist/components/card/card-with-switch/index.js +1 -1
- package/dist/components/card/index.js +1 -1
- package/dist/components/card/indicator-card/index.js +1 -1
- package/dist/components/card-container/index.js +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/cloud-image/index.js +1 -1
- package/dist/components/code-snippet/index.js +1 -1
- package/dist/components/code-snippet/location-code/index.js +1 -1
- package/dist/components/colors/index.js +1 -1
- package/dist/components/conditions-dialog/index.js +1 -1
- package/dist/components/confirm-dialog/index.js +1 -1
- package/dist/components/container/index.js +1 -1
- package/dist/components/copy-button/index.js +1 -1
- package/dist/components/divider/index.js +1 -1
- package/dist/components/dropdown/index.js +1 -1
- package/dist/components/empty-state/empty-button/index.js +1 -1
- package/dist/components/empty-state/index.js +1 -1
- package/dist/components/fa-tag/index.js +1 -1
- package/dist/components/file-preview/index.js +1 -1
- package/dist/components/form/index.js +1 -1
- package/dist/components/form/inner-form/index.js +1 -1
- package/dist/components/grid-container/index.js +1 -1
- package/dist/components/group-selector/index.js +1 -1
- package/dist/components/group-selector/option-container/index.js +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/indicator-card-db/index.js +1 -1
- package/dist/components/info-sidebar/index.js +1 -1
- package/dist/components/inputs/fields/combobox/field/index.js +1 -1
- package/dist/components/inputs/fields/combobox/index.js +1 -1
- package/dist/components/inputs/fields/combobox/option/index.js +1 -1
- package/dist/components/inputs/fields/date/calendar/cell/index.js +1 -1
- package/dist/components/inputs/fields/date/calendar/grid/index.js +1 -1
- package/dist/components/inputs/fields/date/calendar/header/index.js +1 -1
- package/dist/components/inputs/fields/date/calendar/index.js +1 -1
- package/dist/components/inputs/fields/date/index.js +1 -1
- package/dist/components/inputs/fields/date-range/calendar/index.js +1 -1
- package/dist/components/inputs/fields/date-range/index.js +1 -1
- package/dist/components/inputs/fields/date-time/calendar/index.js +1 -1
- package/dist/components/inputs/fields/date-time/index.js +1 -1
- package/dist/components/inputs/fields/editable/index.js +1 -1
- package/dist/components/inputs/fields/input-array/field/index.js +1 -1
- package/dist/components/inputs/fields/input-array/index.js +1 -1
- package/dist/components/inputs/fields/input-file/index.js +1 -1
- package/dist/components/inputs/fields/input-tags/field/index.js +1 -1
- package/dist/components/inputs/fields/input-tags/index.js +1 -1
- package/dist/components/inputs/fields/number/index.js +1 -1
- package/dist/components/inputs/fields/number-range/index.js +1 -1
- package/dist/components/inputs/fields/phone/index.js +1 -1
- package/dist/components/inputs/fields/text-area/index.js +1 -1
- package/dist/components/inputs/fields/text-input/index.js +1 -1
- package/dist/components/inputs/index.js +1 -1
- package/dist/components/inputs/label/index.js +1 -1
- package/dist/components/inputs/outline-container/index.js +1 -1
- package/dist/components/inputs/utils/action-button/index.js +1 -1
- package/dist/components/inputs/utils/calendar-button/index.js +1 -1
- package/dist/components/inputs/utils/date-selector/index.js +1 -1
- package/dist/components/inputs/utils/date-time-field/index.js +1 -1
- package/dist/components/inputs/utils/dialog/index.js +1 -1
- package/dist/components/inputs/utils/number-field/index.js +1 -1
- package/dist/components/inputs/utils/popover/index.js +1 -1
- package/dist/components/item-card-db/index.js +1 -1
- package/dist/components/layout/categories/buttons/index.js +1 -1
- package/dist/components/layout/categories/column/index.js +1 -1
- package/dist/components/layout/categories/gap/index.js +1 -1
- package/dist/components/layout/categories/row/index.js +1 -1
- package/dist/components/layout/index.js +1 -1
- package/dist/components/link/index.js +1 -1
- package/dist/components/list-item/index.js +1 -1
- package/dist/components/little-flag/index.js +1 -1
- package/dist/components/loading/index.js +1 -1
- package/dist/components/logo/index.js +1 -1
- package/dist/components/lottie/index.js +1 -1
- package/dist/components/menu/index.js +1 -1
- package/dist/components/message-banner/index.js +1 -1
- package/dist/components/modal/columns-modal/index.js +1 -1
- package/dist/components/modal/columns-modal/preview-panel/index.js +1 -1
- package/dist/components/modal/columns-modal/search-panel/index.js +1 -1
- package/dist/components/modal/filters-modal/applied-filter/index.js +1 -1
- package/dist/components/modal/filters-modal/applied-filters/index.js +1 -1
- package/dist/components/modal/filters-modal/column-filters/index.js +1 -1
- package/dist/components/modal/filters-modal/filter-control/index.js +1 -1
- package/dist/components/modal/filters-modal/filter-form/form-content/index.js +1 -1
- package/dist/components/modal/filters-modal/filter-form/hooks/index.js +1 -1
- package/dist/components/modal/filters-modal/filter-form/index.js +1 -1
- package/dist/components/modal/filters-modal/filters-list/index.js +1 -1
- package/dist/components/modal/filters-modal/index.js +1 -1
- package/dist/components/modal/footer/index.js +1 -1
- package/dist/components/modal/header/index.js +1 -1
- package/dist/components/modal/index.js +1 -1
- package/dist/components/modal/modal-confirm/index.js +1 -1
- package/dist/components/notification/index.js +1 -1
- package/dist/components/notification-sign/index.js +1 -1
- package/dist/components/oauth-selector/index.js +1 -1
- package/dist/components/oauth-selector/option-container/index.js +1 -1
- package/dist/components/paginator-db/btn/index.js +1 -1
- package/dist/components/paginator-db/dropdown/index.js +1 -1
- package/dist/components/paginator-db/index.js +1 -1
- package/dist/components/pop-up/description/index.js +1 -1
- package/dist/components/pop-up/index.js +1 -1
- package/dist/components/premium-feature/index.js +1 -1
- package/dist/components/priority-cards/card/index.js +1 -1
- package/dist/components/priority-cards/index.js +1 -1
- package/dist/components/priority-score/index.js +1 -1
- package/dist/components/progress-bar/index.js +1 -1
- package/dist/components/progress-indicator/in-progress-icon/index.js +1 -1
- package/dist/components/progress-indicator/index.js +1 -1
- package/dist/components/progress-indicator/step/index.js +1 -1
- package/dist/components/radio-button/index.js +1 -1
- package/dist/components/rank-position/icon/index.js +1 -1
- package/dist/components/rank-position/index.js +1 -1
- package/dist/components/scroll-button/index.js +1 -1
- package/dist/components/search/index.js +1 -1
- package/dist/components/search-dropdown/index.js +1 -1
- package/dist/components/severity-badge/index.js +1 -1
- package/dist/components/severity-overview/badge/index.js +1 -1
- package/dist/components/severity-overview/index.js +1 -1
- package/dist/components/show-on-hover/index.js +1 -1
- package/dist/components/slide-out-menu/index.js +1 -1
- package/dist/components/slide-out-menu/menu-item/index.js +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/thumb/index.js +1 -1
- package/dist/components/step-lapse/index.js +1 -1
- package/dist/components/table/context/index.js +1 -1
- package/dist/components/table/export-csv/index.js +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/table/pagination/pagination-control/index.js +1 -1
- package/dist/components/table/pagination/pagination-dropdown/index.js +1 -1
- package/dist/components/table/pagination/pagination-size/index.js +1 -1
- package/dist/components/table/sort-icon/index.js +1 -1
- package/dist/components/table/table-body/index.js +1 -1
- package/dist/components/table/table-column-toggle/index.js +1 -1
- package/dist/components/table/table-content/head/index.js +1 -1
- package/dist/components/table/table-content/index.js +1 -1
- package/dist/components/table/table-footer/footer-content/index.js +1 -1
- package/dist/components/table/table-footer/index.js +1 -1
- package/dist/components/table/table-options/caption-content/index.js +1 -1
- package/dist/components/table/table-options/controls-content/index.js +1 -1
- package/dist/components/table/table-options/highlighted-content/index.js +1 -1
- package/dist/components/table/table-options/index.js +1 -1
- package/dist/components/table/wrapper/index.js +1 -1
- package/dist/components/table-button/index.js +1 -1
- package/dist/components/table-content/index.js +1 -1
- package/dist/components/table-content/item-content/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/tab/index.js +1 -1
- package/dist/components/tag/index.js +1 -1
- package/dist/components/timeline/card/index.js +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/toggle/index.js +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tour/index.js +1 -1
- package/dist/components/typography/heading/index.js +1 -1
- package/dist/components/typography/index.js +1 -1
- package/dist/components/typography/span/index.js +1 -1
- package/dist/components/typography/text/index.js +1 -1
- package/dist/components/weaknesses-card/index.js +1 -1
- package/dist/{components-Km3fkkex.mjs → components-BTk61Di-.mjs} +208 -207
- package/dist/{components-DnDOyvWT.js → components-ugedtsd3.js} +14 -14
- package/dist/hooks/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -525,7 +525,7 @@
|
|
|
525
525
|
left: 50%;
|
|
526
526
|
transform: translateX(-50%) rotate(180deg);
|
|
527
527
|
`}}}
|
|
528
|
-
`,K=({children:e,disabled:n=!1,display:i="inline-block",height:r,icon:o,iconColor:a,iconSize:s,id:l,maxWidth:c,nodeTip:d,place:p="bottom",tip:g="",title:x="",hide:h=g===""&&x===""&&d===void 0,width:b})=>{const m=f.useTheme(),[w,v]=u.useState(!1),{refs:S,floatingStyles:k,context:j,placement:C}=y.useFloating({middleware:[y.flip({fallbackAxisSideDirection:"start"}),y.offset({mainAxis:10}),y.shift()],onOpenChange:v,open:w,placement:p,whileElementsMounted:y.autoUpdate}),z=y.useHover(j,{delay:{close:0,open:500},move:!1}),F=y.useFocus(j),
|
|
528
|
+
`,K=({children:e,disabled:n=!1,display:i="inline-block",height:r,icon:o,iconColor:a,iconSize:s,id:l,maxWidth:c,nodeTip:d,place:p="bottom",tip:g="",title:x="",hide:h=g===""&&x===""&&d===void 0,width:b})=>{const m=f.useTheme(),[w,v]=u.useState(!1),{refs:S,floatingStyles:k,context:j,placement:C}=y.useFloating({middleware:[y.flip({fallbackAxisSideDirection:"start"}),y.offset({mainAxis:10}),y.shift()],onOpenChange:v,open:w,placement:p,whileElementsMounted:y.autoUpdate}),z=y.useHover(j,{delay:{close:0,open:500},move:!1}),F=y.useFocus(j),R=y.useRole(j,{role:o?"label":"tooltip"}),{getReferenceProps:D,getFloatingProps:T}=y.useInteractions([z,F,R]),N=u.useMemo(()=>C.startsWith("top")?"top":C.startsWith("bottom")?"bottom":C.startsWith("left")?"left":C.startsWith("right")?"right":"bottom",[C]);return n?t.jsx(u.StrictMode,{children:e}):t.jsxs(t.Fragment,{children:[t.jsx(or,{...D(),display:i,height:r,id:l,ref:S.setReference,width:b,children:o?t.jsx(E,{clickable:!0,disabled:n,icon:o,iconColor:a,iconSize:s??"sm",iconType:w?"fa-solid":"fa-light"}):e}),w&&!h&&ce.createPortal(t.jsxs(ar,{...T(),$maxWidth:c,id:`floating-${l}`,ref:S.setFloating,style:k,children:[y.lodashExports.isEmpty(x)?void 0:t.jsx(I,{color:m.palette.white,fontWeight:"bold",mb:.25,size:"sm",textAlign:"start",wordWrap:"break-word",children:x}),y.lodashExports.isEmpty(g)?void 0:t.jsx(I,{color:m.palette.gray[100],size:"sm",textAlign:"start",whiteSpace:"normal",wordWrap:"break-word",children:g}),y.lodashExports.isEmpty(d)?void 0:d,t.jsx(sr,{$placement:N,children:t.jsx("svg",{fill:"none",height:"8",viewBox:"0 0 16 8",width:"16",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M16 0L0 0L6.58579 6.58579C7.36684 7.36684 8.63317 7.36684 9.41421 6.58579L16 0Z",fill:m.palette.gray[700]})})})]}),document.getElementById("root")??document.body)]})},_=u.forwardRef(function({borderRadius:n,disabled:i,icon:r,iconColor:o,iconSize:a="sm",iconTransform:s,iconType:l,id:c,justify:d="center",onClick:p,px:g,py:x,type:h="button",tooltip:b,tooltipPlace:m,value:w,variant:v="primary",...S},k){const j=t.jsx(rr,{$variant:v,"aria-disabled":i,"aria-label":c,borderRadius:n,disabled:i,id:c,justify:d,onClick:p,px:g,py:x,ref:k,type:h,value:w,...S,children:t.jsx(E,{clickable:!1,icon:r,iconColor:o,iconSize:a,iconTransform:s,iconType:l})}),z=(h+(v??"")+(c??r)).replace(/ /u,"_");return b===void 0?j:t.jsx(K,{id:`${z}-tooltip`,place:m,tip:b,children:j})}),lr=u.forwardRef(function({autoHide:n=!1,children:i,closable:r=!1,icon:o,iconEnabled:a=!0,iconPosition:s="center",onClose:l=void 0,onTimeOut:c,show:d=!0,time:p=8,title:g,variant:x="error",id:h,...b},m){const[w,v]=u.useState(d),S=u.useCallback(()=>{l==null||l(),v(!1)},[l]);return u.useEffect(()=>{const k=setTimeout(()=>{c==null||c(!0),n&&S()},p*1e3);return()=>{clearTimeout(k)}},[n,S,p,c]),u.useEffect(()=>{v(d)},[d,v]),t.jsx($,{display:w?"block":"none",ref:m,role:"alert",...b,children:t.jsxs(er,{$iconPosition:s,$variant:x,id:h,children:[a?t.jsx(E,{clickable:!1,icon:o??Ji(x),iconSize:"lg",iconType:"fa-light",mt:s==="top"?.25:0}):void 0,t.jsxs($,{display:"flex",flexDirection:"column",gap:.25,style:{flex:1},children:[g?t.jsx(tr,{children:g}):void 0,t.jsx(nr,{$hasTitle:!!g,children:i})]}),r?t.jsx(_,{height:"fit-content",icon:"close",iconSize:"lg",iconType:"fa-light",onClick:S,px:.125,py:.125,style:{alignSelf:"flex-start"},variant:"ghost"}):void 0]})})}),Ct=f.styled.div`
|
|
529
529
|
${({theme:e})=>`
|
|
530
530
|
align-items: center;
|
|
531
531
|
background-color: ${e.palette.gray[200]};
|
|
@@ -769,7 +769,7 @@
|
|
|
769
769
|
${Jt}
|
|
770
770
|
`,fr=f.styled(Ze.Link)`
|
|
771
771
|
${Jt}
|
|
772
|
-
`,ie=({children:e,color:n,download:i,href:r,iconPosition:o="right",onClick:a,target:s,variant:l="lowRelevance",wrap:c=!1})=>{const d=r.startsWith("https://"),p=t.jsx(E,{icon:i===void 0?"arrow-up-right-from-square":"arrow-down-to-bracket",iconSize:"sm",iconType:"fa-light",ml:.25,mr:.25});return d?t.jsxs(hr,{$color:n,$variant:l,$wrap:c,download:i,href:r,onClick:a,rel:"nofollow noopener noreferrer",target:s??"_blank",children:[o==="left"?p:void 0,e,o==="right"?p:void 0]}):t.jsxs(fr,{$variant:l,$wrap:c,download:i,onClick:a,rel:"nofollow noopener noreferrer",target:s,to:r,children:[s!==void 0&&o==="left"?p:void 0,e,s!==void 0&&o==="right"?p:void 0]})},q=({disabled:e,icon:n,iconColor:i="inherit",iconType:r="fa-light",id:o="close-tag",filterValues:a="",fontSize:s,href:l,linkLabel:c,onClose:d,priority:p="default",tagTitle:g="",tagLabel:x,variant:h="default"})=>{const b=x.length>25&&y.lodashExports.isEmpty(g+a),m=`${x.slice(0,25)}...`;return t.jsxs(ye,{className:"gap-0.5",display:l===void 0?"initial":"flex",size:"md",children:[t.jsxs(ur,{$fontSize:s,$variant:h,className:p,children:[n&&t.jsx(E,{icon:n,iconColor:i,iconSize:"sm",iconType:r}),t.jsxs("span",{className:"w-full",children:[t.jsx("strong",{children:g}),t.jsx("span",{children:b?m:x}),t.jsx("strong",{className:"w-full",children:a})]}),d?t.jsx(_,{disabled:e,icon:"xmark",iconSize:"sm",iconType:"fa-light",id:o,onClick:d,px:.125,py:.125,variant:"ghost"}):void 0]}),l===void 0?void 0:t.jsx(ie,{href:l,children:c})]})},Qt=(e,n=!0)=>{const i=window.open(e,n?void 0:"_self","noopener,noreferrer,");y.lodashExports.isObject(i)&&(i.opener=null)},O=u.forwardRef(function({children:n,disabled:i=!1,external:r=!1,href:o,id:a,icon:s,iconColor:l,
|
|
772
|
+
`,ie=({children:e,color:n,download:i,href:r,iconPosition:o="right",onClick:a,target:s,variant:l="lowRelevance",wrap:c=!1})=>{const d=r.startsWith("https://"),p=t.jsx(E,{icon:i===void 0?"arrow-up-right-from-square":"arrow-down-to-bracket",iconSize:"sm",iconType:"fa-light",ml:.25,mr:.25});return d?t.jsxs(hr,{$color:n,$variant:l,$wrap:c,download:i,href:r,onClick:a,rel:"nofollow noopener noreferrer",target:s??"_blank",children:[o==="left"?p:void 0,e,o==="right"?p:void 0]}):t.jsxs(fr,{$variant:l,$wrap:c,download:i,onClick:a,rel:"nofollow noopener noreferrer",target:s,to:r,children:[s!==void 0&&o==="left"?p:void 0,e,s!==void 0&&o==="right"?p:void 0]})},q=({disabled:e,icon:n,iconColor:i="inherit",iconType:r="fa-light",id:o="close-tag",filterValues:a="",fontSize:s,href:l,linkLabel:c,onClose:d,priority:p="default",tagTitle:g="",tagLabel:x,variant:h="default"})=>{const b=x.length>25&&y.lodashExports.isEmpty(g+a),m=`${x.slice(0,25)}...`;return t.jsxs(ye,{className:"gap-0.5",display:l===void 0?"initial":"flex",size:"md",children:[t.jsxs(ur,{$fontSize:s,$variant:h,className:p,children:[n&&t.jsx(E,{icon:n,iconColor:i,iconSize:"sm",iconType:r}),t.jsxs("span",{className:"w-full",children:[t.jsx("strong",{children:g}),t.jsx("span",{children:b?m:x}),t.jsx("strong",{className:"w-full",children:a})]}),d?t.jsx(_,{disabled:e,icon:"xmark",iconSize:"sm",iconType:"fa-light",id:o,onClick:d,px:.125,py:.125,variant:"ghost"}):void 0]}),l===void 0?void 0:t.jsx(ie,{href:l,children:c})]})},Qt=(e,n=!0)=>{const i=window.open(e,n?void 0:"_self","noopener,noreferrer,");y.lodashExports.isObject(i)&&(i.opener=null)},O=u.forwardRef(function({children:n,disabled:i=!1,external:r=!1,href:o,id:a,icon:s,iconColor:l,iconSize:c="lg",iconType:d,name:p,dotNotification:g,notification:x,onClick:h,rightIcon:b,tag:m,type:w="button",tooltip:v,tooltipPlace:S="bottom",underline:k=!1,value:j,variant:C="primary",width:z,...F},R){const D=v!==void 0,T=`${a}-tooltip`,N=u.useCallback(()=>{o&&Qt(o,r)},[r,o]),M=t.jsxs(qt,{$variant:C,"aria-disabled":i,className:k?"underline":void 0,disabled:i,id:a,name:p,onClick:C==="link"?N:h,ref:R,type:w,value:j,width:z,...D?{"data-tooltip-id":T}:{},...F,children:[g&&C==="ghost"&&!i?t.jsx(Le,{left:s!==void 0?"13%":"1%",show:!0,top:"20%",variant:"error"}):void 0,s!==void 0&&t.jsx(E,{icon:s,iconColor:l??void 0,iconSize:c,iconType:d??"fa-light"}),n,b||C==="link"?t.jsx(E,{icon:b??"arrow-right",iconSize:c,iconType:"fa-light"}):void 0,m===void 0||i?null:t.jsx(q,{tagLabel:m,variant:"default"}),x!==void 0&&C==="ghost"&&!i?t.jsx(Le,{numberIndicator:x,show:!0,variant:"error"}):void 0]});return D?t.jsx(K,{disabled:!D,id:T,place:S,tip:v,width:z,children:M}):M}),yr=u.forwardRef(function({children:n,onClick:i,userName:r,showIcon:o=!1,showUsername:a=!1},s){const l=!!i,c=f.useTheme();return t.jsx($,{id:"navbar-user-profile",ref:s,zIndex:9999,children:t.jsxs($,{alignItems:"end",display:"flex",flexDirection:"column",position:"relative",zIndex:30,children:[l?t.jsxs(O,{onClick:i,px:.5,py:.5,variant:"ghost",children:[t.jsx(Ct,{children:r[0].toUpperCase()}),a?t.jsx(I,{color:c.palette.gray[800],display:"inline",ml:.5,size:"md",children:r.split(" ")[0]}):void 0,o?t.jsx(E,{clickable:!1,icon:"ellipsis-v",iconSize:"xs",ml:.5}):void 0]}):t.jsxs($,{alignItems:"center",display:"flex",px:.5,py:.5,children:[t.jsx(Ct,{children:r[0].toUpperCase()}),a?t.jsxs(I,{color:c.palette.gray[800],display:"inline",ml:.5,size:"md",children:["Hi ",r.split(" ")[0],"!"]}):void 0,o?t.jsx(E,{clickable:!1,icon:"ellipsis-v",iconSize:"xs",ml:.5}):void 0]}),t.jsx(cr,{children:n})]})})}),Oe=({authorEmail:e,date:n,description:i,descriptionColor:r,id:o,title:a,titleColor:s,textAlign:l,textSpacing:c=0,tooltip:d})=>{const p=f.useTheme();return t.jsxs($,{width:"100%",children:[typeof a=="string"||d?t.jsxs($,{alignItems:"center",display:"inline-flex",gap:.5,width:"100%",children:[typeof a=="string"?t.jsx(I,{color:s??p.palette.gray[800],fontWeight:"bold",mb:c,size:"md",textAlign:l,wordBreak:"break-word",children:a}):a,d&&t.jsx(K,{icon:"circle-info",id:o,place:"top",tip:d})]}):void 0,t.jsxs($,{alignItems:"start",display:"flex",flexDirection:"column",gap:.25,children:[i&&t.jsx(I,{color:r??p.palette.gray[800],fontWeight:i===void 0?"bold":"regular",size:"md",textAlign:l,wordBreak:"break-word",children:i}),n&&t.jsx(I,{color:p.palette.gray[800],fontWeight:"bold",size:"md",textAlign:l,wordBreak:"break-word",children:`Date: ${n.split(" ")[0]}`}),e&&t.jsx(I,{color:p.palette.gray[800],fontWeight:"bold",size:"md",textAlign:l,wordBreak:"break-word",children:`Author: ${e}`})]})]})},St=f.styled($).attrs(({...e})=>({display:"inline-block",position:"relative",...e}))`
|
|
773
773
|
& img {
|
|
774
774
|
display: block;
|
|
775
775
|
}
|
|
@@ -1120,7 +1120,7 @@
|
|
|
1120
1120
|
fill: ${e.palette.white};
|
|
1121
1121
|
}
|
|
1122
1122
|
`}
|
|
1123
|
-
`,ae=u.forwardRef(function({checked:n,disabled:i=!1,label:r,name:o,onChange:a,onClick:s,onFocus:l,onKeyDown:c,tooltip:d,value:p,...g},x){return t.jsxs("div",{className:"gap-1 inline-flex items-start",children:[t.jsxs(zr,{"aria-disabled":i,children:[t.jsx("input",{"aria-checked":n,"aria-disabled":i,"aria-hidden":!1,"aria-label":o,checked:n,"data-testid":r??p,disabled:i,id:o,name:o,onChange:a,onClick:s,onFocus:l,onKeyDown:c,ref:x,type:"checkbox",value:p,...g}),t.jsx(E,{disabled:i,icon:"check",iconSize:"xl"}),r??p]}),d===void 0?void 0:t.jsx(K,{icon:"circle-info",id:d,place:"right",tip:d})]})}),tn=({item:e,multiSelection:n,name:i,register:r,setInputValue:o,setValue:a,state:s,watch:l})=>{var F,D
|
|
1123
|
+
`,ae=u.forwardRef(function({checked:n,disabled:i=!1,label:r,name:o,onChange:a,onClick:s,onFocus:l,onKeyDown:c,tooltip:d,value:p,...g},x){return t.jsxs("div",{className:"gap-1 inline-flex items-start",children:[t.jsxs(zr,{"aria-disabled":i,children:[t.jsx("input",{"aria-checked":n,"aria-disabled":i,"aria-hidden":!1,"aria-label":o,checked:n,"data-testid":r??p,disabled:i,id:o,name:o,onChange:a,onClick:s,onFocus:l,onKeyDown:c,ref:x,type:"checkbox",value:p,...g}),t.jsx(E,{disabled:i,icon:"check",iconSize:"xl"}),r??p]}),d===void 0?void 0:t.jsx(K,{icon:"circle-info",id:d,place:"right",tip:d})]})}),tn=({item:e,multiSelection:n,name:i,register:r,setInputValue:o,setValue:a,state:s,watch:l})=>{var F,R,D;const c=f.useTheme(),d=u.useRef(null),p=e.props.hrefLang,g=s.disabledKeys,x=Array.from(s.collection.getKeys()).filter(T=>!Array.from(g).includes(T)&&T!=="All"),{optionProps:h,isSelected:b,isFocused:m,isDisabled:w}=y.$293f70390ea03370$export$497855f14858aa34({key:e.key},s,d),v=[b?"selected":"",m?"focused":"",w?"disabled":""].join(" "),S=u.useCallback(T=>{o(""),a==null||a(`${i}Options`,""),T.currentTarget.checked&&(o(T.currentTarget.value),a==null||a(`${i}Options`,x))},[x,i,o,a]),k=u.useCallback(()=>{const T=l==null?void 0:l(`${i}Options`),N=typeof T=="string"?[T]:T;y.isEqual(x,N)&&!Array.from(g).includes("All")?(a==null||a("checkAll","All vulnerability types"),o("All vulnerability types")):(a==null||a("checkAll",""),o((N==null?void 0:N.length)<=2?N.join(", "):`${N.slice(0,2).join(", ")+`, +${N.length-2} more`}`))},[g,x,i,o,a,l]),j=e.key==="All"?t.jsx(ae,{...r==null?void 0:r("checkAll",{onChange:S}),label:(F=e.rendered)==null?void 0:F.toString(),name:"checkAll",value:(R=e.rendered)==null?void 0:R.toString()}):t.jsx(ae,{...r==null?void 0:r(`${i}Options`,{onChange:k}),label:(D=e.rendered)==null?void 0:D.toString(),name:`${i}Options`,value:e.key.toString()}),C=n&&!w?j:t.jsx(I,{color:c.palette.gray[800],size:"md",textOverflow:"ellipsis",whiteSpace:"nowrap",children:e.rendered}),z=u.useCallback(T=>{var N;T.preventDefault(),o(((N=e.rendered)==null?void 0:N.toString())??""),s.setSelectedKey(e.key),setTimeout(()=>{s.setOpen(!1)},50),Qt(p)},[p,e.key,e.rendered,s,o]);return X(document.getElementsByClassName("dropdown")[0],()=>{n&&s.close()},!0,document.getElementById("combobox")),t.jsxs(Sr,{...!n&&!p?h:{},$multiSelection:n,className:v,ref:d,children:[p?t.jsx(ie,{href:p,onClick:z,children:C}):C,b&&!w&&!n?t.jsx(E,{icon:"check",iconSize:"sm",iconType:"fa-light"}):void 0,e.rendered===e.textValue?void 0:t.jsx(q,{tagLabel:e.textValue,variant:"inactive"})]})},qe=({field:e,disabled:n=!1,disabledKeys:i,error:r,helpLink:o,helpLinkText:a,helpText:s,label:l,loadingItems:c,name:d,multiSelection:p=!1,items:g,onBlur:x,onChange:h,placeholder:b,register:m,required:w,setValue:v,tooltip:S,value:k,watch:j,weight:C})=>{var wt,jt;const z=f.useTheme(),F=n?void 0:r,R=(e==null?void 0:e.value)??k,[D,T]=u.useState(((wt=g.find(P=>P.value===R))==null?void 0:wt.name)??""),[N,M]=u.useState(R),[B,U]=u.useState(g),[H,W]=u.useState(!1),{contains:te}=y.$bb77f239b46e8c72$export$3274cf84b703fff({sensitivity:"base"}),de=u.useRef(null),Ve=u.useRef(null),Ue=u.useRef(null),Fe=u.useRef(null),Ge=u.useRef(null),di=u.useMemo(()=>g.toSorted((P,G)=>{const Y=Array.from(i??[]),pe=Y.includes(P.value),vt=Y.includes(G.value);return pe&&!vt?1:!pe&&vt?-1:0}).map(P=>te(P.name,D)||H?t.jsx(y.$c1d7fb2ec91bae71$export$6d08773d2e66f8f2,{"aria-label":P.value,hrefLang:P.href,textValue:P.tag,children:P.name},P.value):null),[te,i,D,g,H]),pi=u.useCallback(P=>{const G=P.split(/,|\s/u).slice(-1)[0].trim();T(p?G:P),P===""||P.endsWith(",")?W(!0):(W(!1),M(Y=>{const pe=P===""?"":Y;return e&&e.onChange(pe),h&&h(P),pe}),U(g.filter(Y=>te(Y.name,p?G:P))))},[te,g,e,p,h]),gi=u.useCallback(P=>{var G;T(((G=g.find(Y=>Y.value===P))==null?void 0:G.name)??""),M(P?String(P):""),e&&e.onChange(P),h&&h(P?String(P):""),U(g)},[g,e,h]),mt=u.useCallback(P=>{P.key==="Enter"&&P.preventDefault(),W(!1)},[]),ui=u.useCallback(()=>{x&&x(),e&&e.onBlur()},[e,x]),xi=u.useCallback(()=>{W(!0)},[]),J=y.$a9e7382a7d111cb5$export$b453a3bfd4a5fa9e({allowsCustomValue:p,allowsEmptyCollection:!0,disabledKeys:i,inputValue:D,items:B,menuTrigger:"focus",shouldCloseOnBlur:!p,selectedKey:N,onBlur:ui,onInputChange:pi,onKeyDown:mt,onKeyUp:xi,onOpenChange(P,G){W(P&&(G==="manual"||G==="focus")),P&&setTimeout(()=>{var Y;return(Y=de.current)==null?void 0:Y.focus()},50)},onSelectionChange:p?void 0:gi,children:di}),{buttonProps:hi,inputProps:fi,listBoxProps:yi}=y.$c350ade66beef0af$export$8c18d1b4f7232bbf({inputValue:D,buttonRef:Ve,id:d,inputRef:de,label:l??d,listBoxRef:Ue,name:d,placeholder:b,popoverRef:Ge},J),{listBoxProps:bi}=y.$c132121280ec012d$export$50eacbbf140a3141(yi,J,Ue),{buttonProps:$i}=y.$701a24aa0da5b062$export$ea18c227d4417cc3(hi,Ve),{width:mi}=((jt=Fe.current)==null?void 0:jt.getBoundingClientRect())??{width:240};return X(Fe.current,()=>{J.isOpen&&!p&&J.close()},!0,Ge.current),u.useEffect(()=>{var P;if((c===!1||!R)&&!p){const G=((P=g.find(Y=>Y.value===R))==null?void 0:P.name)??"";T(G),M(G)}},[R,g,c,p]),t.jsxs(Z,{error:F,helpLink:o,helpLinkText:a,helpText:s,htmlFor:d,id:"combobox",label:l,required:w,tooltip:S,weight:C,children:[t.jsxs(ee,{className:`${n?"disabled":""} ${F?"error":""}`,ref:Fe,children:[t.jsx("input",{...fi,"aria-invalid":F?"true":"false","aria-label":d,disabled:n,onKeyDown:mt,ref:de}),F?t.jsx(E,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:z.palette.error[500],iconSize:"lg"}):void 0,t.jsx(_,{...$i,className:"action",disabled:n,icon:J.isOpen&&!n?"chevron-up":"chevron-down",iconColor:z.palette.gray[400],iconSize:"sm",iconType:"fa-light",px:.125,py:.125,ref:Ve,type:"button",variant:"ghost"})]}),J.isOpen&&J.collection.size>0&&!n?t.jsx(Ee,{className:"dropdown",offset:4,placement:"bottom start",popoverRef:Ge,state:J,triggerRef:Fe,children:t.jsx(Cr,{...bi,$multiSelection:p&&!Array.from(i??[]).includes("All"),$width:mi,ref:Ue,children:[...J.collection].map(P=>t.jsx(tn,{item:P,multiSelection:p,name:d,register:m,setInputValue:T,setValue:v,state:J,watch:j},P.key))})}):null]})},gt=({control:e,disabled:n=!1,disabledKeys:i,error:r,helpLink:o,helpLinkText:a,helpText:s,label:l,loadingItems:c,name:d,multiSelection:p,items:g,onBlur:x,onChange:h,placeholder:b,register:m,required:w,setValue:v,tooltip:S,value:k,watch:j,weight:C})=>e?t.jsx(y.Controller,{control:e,name:d,render:({field:z,fieldState:F})=>{var R;return t.jsx(qe,{disabled:n,disabledKeys:i,error:(R=F.error)==null?void 0:R.message,field:z,helpLink:o,helpLinkText:a,helpText:s,items:g,label:l,loadingItems:c,multiSelection:p,name:d,onBlur:x,onChange:h,placeholder:b,register:m,required:w,setValue:v,tooltip:S,value:k,watch:j,weight:C})},rules:{required:w}}):t.jsx(qe,{disabled:n,disabledKeys:i,error:r,helpLink:o,helpLinkText:a,helpText:s,items:g,label:l,loadingItems:c,multiSelection:p,name:d,onBlur:x,onChange:h,placeholder:b,required:w,tooltip:S,value:k,weight:C}),Tr=f.styled.div`
|
|
1124
1124
|
${({theme:e})=>`
|
|
1125
1125
|
align-items: center;
|
|
1126
1126
|
color: ${e.palette.gray[800]};
|
|
@@ -1363,7 +1363,7 @@
|
|
|
1363
1363
|
background: ${n?e.palette.gray[200]:e.palette.white};
|
|
1364
1364
|
}
|
|
1365
1365
|
`}
|
|
1366
|
-
`,pn=({disabled:e=!1,error:n,label:i,name:r,required:o,tooltip:a,register:s,setValue:l,propsMax:c,propsMin:d,variant:p="default",...g})=>{const x=`${r}Max`,h=`${r}Min`,b=u.useRef(null),m=u.useCallback(
|
|
1366
|
+
`,pn=({disabled:e=!1,error:n,label:i,name:r,required:o,tooltip:a,register:s,setValue:l,propsMax:c,propsMin:d,variant:p="default",...g})=>{const x=`${r}Max`,h=`${r}Min`,b=u.useRef(null),m=u.useCallback(R=>{l&&R&&(l((c==null?void 0:c.name)??x,Pe(String(R.end))),l((d==null?void 0:d.name)??h,Pe(String(R.start))))},[x,h,l,c,d]),w=y.$93c38a5e28be6249$export$e50a61c1de9f574({...g,endName:(c==null?void 0:c.name)??x,startName:(d==null?void 0:d.name)??h,onChange(R){m(R)}}),{close:v}=w,{groupProps:S,startFieldProps:k,endFieldProps:j,buttonProps:C,dialogProps:z,calendarProps:F}=y.$887cac91b7cc8801$export$12fd5f0e9f4bb192({...g,"aria-label":i??r},w,b);return t.jsxs(Z,{error:e?void 0:n,htmlFor:r,label:i,required:o,tooltip:a,children:[t.jsxs(Or,{$disabled:e,$show:n!==void 0,ref:b,style:{flexDirection:p==="filters"?"column":"row"},children:[t.jsx(be,{buttonProps:C,datePickerRef:b,disabled:e,error:n,fieldProps:{...k,"aria-label":`${k["aria-label"]} ${r}`,validate:R=>j.value&&R>j.value?"Start date must be less than or equal to end date":null},groupProps:S,name:(d==null?void 0:d.name)??h,register:s,setValue:l,value:d==null?void 0:d.value}),t.jsx(be,{buttonProps:C,datePickerRef:b,disabled:e,error:n,fieldProps:{...j,"aria-label":`${j["aria-label"]} ${r}`,validate:R=>k.value&&R<k.value?"End date must be greater than or equal to start date":null},groupProps:S,name:(c==null?void 0:c.name)??x,register:s,setValue:l,value:c==null?void 0:c.value})]}),w.isOpen&&!e?t.jsx(Ee,{offset:8,placement:"bottom start",state:w,triggerRef:b,children:t.jsx(Be,{...z,children:t.jsx(dn,{onClose:v,props:F})})}):null]})},Wr=f.styled.div`
|
|
1367
1367
|
${({theme:e})=>`
|
|
1368
1368
|
align-items: center;
|
|
1369
1369
|
border-top: 1px solid ${e.palette.gray[200]};
|
|
@@ -1378,9 +1378,9 @@
|
|
|
1378
1378
|
gap: ${({theme:e})=>e.spacing[.5]};
|
|
1379
1379
|
justify-content: flex-end;
|
|
1380
1380
|
flex: 1 0 0;
|
|
1381
|
-
`,gn=({handleTimeChange:e,onClose:n,props:i,timeState:r})=>{const o=f.useTheme(),{locale:a}=y.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),s=y.$131cf43a05231e1e$export$6d095e787d2b5e1f({...i,createCalendar:y.$64244302c3013299$export$dd0bbc9b26defe37,locale:a}),{prevButtonProps:l,nextButtonProps:c,title:d}=y.$9942cad8a072a530$export$3ee915f8151bd4f1(i,s);return t.jsxs("div",{className:"calendar",children:[t.jsx(_e,{nextButtonProps:c,prevButtonProps:l,state:s,title:d}),t.jsx(We,{state:s}),t.jsxs(Wr,{children:[t.jsx(I,{color:o.palette.gray[800],fontWeight:"bold",size:"md",children:"Time"}),t.jsx(_r,{children:t.jsx(ln,{hourCycle:12,label:"time-field",onChange:e,value:r.timeValue})})]}),t.jsx(ut,{children:t.jsx(O,{onClick:n,variant:"ghost",children:"Cancel"})})]})},Br=e=>{const{disabled:n=!1,error:i,required:r,label:o,name:a,tooltip:s,register:l,setValue:c,watch:d}=e,p=d==null?void 0:d(a),g=u.useRef(null),x=y.$ab5bf3f618090389$export$87194bb378cc3ac2({...e,granularity:"minute",hourCycle:12,isDisabled:n,isRequired:r,shouldCloseOnSelect:!1,value:y._.isNil(p)||y._.isEmpty(p)||p==="-"||y.dayjs(p,"YYYY/MM/DD hh:mm A").isValid()===!1?null:y.$fae977aafc393c5c$export$588937bcd60ade55(y.dayjs(p,"YYYY/MM/DD hh:mm A").format("YYYY-MM-DDTHH:mm:ss"))}),{close:h}=x,{groupProps:b,fieldProps:m,buttonProps:w,dialogProps:v,calendarProps:S}=y.$6057a3d2a53a12fd$export$42df105a73306d51(e,x,g),k=u.useCallback(C=>{if(S.onChange&&S.onChange(C),x.timeValue){const z=Et(C,x.timeValue);c==null||c(a,z,{shouldDirty:!0})}else x.setDateValue(C)},[S,a,c,x]),j=u.useCallback(C=>{if(C){x.setTimeValue(C);const z=x.dateValue;if(z){const F=Et(z,C);c==null||c(a,F,{shouldDirty:!0})}}},[x,c,a]);return t.jsxs(Z,{error:n?void 0:i,htmlFor:a,label:o,required:r,tooltip:s,children:[t.jsx(be,{buttonProps:w,datePickerRef:g,disabled:n,error:i,fieldProps:m,granularity:"minute",groupProps:b,name:a,register:l,setValue:c,value:p}),x.isOpen&&!n?t.jsx(Ee,{offset:8,placement:"bottom start",state:x,triggerRef:g,children:t.jsx(Be,{...v,children:t.jsx(gn,{handleTimeChange:j,onClose:h,props:{...S,onChange:k},timeState:x})})}):null]})},Hr=({children:e,currentValue:n,externalLink:i,isEditing:r,label:o,name:a,tooltip:s})=>{if(r)return t.jsx("div",{children:e});const l=y.lodashExports.isNil(n)?"":n,c=String(i??l);return t.jsxs($,{children:[t.jsx(pt,{htmlFor:a,label:o,tooltip:s,weight:"bold"}),c.startsWith("https://")?t.jsx(ie,{href:c,children:l}):t.jsx(I,{size:"md",children:l})]})},He=({disabled:e=!1,hasIcon:n=!1,helpLink:i,helpLinkText:r,helpText:o,error:a,id:s,indexArray:l=0,isValid:c,isTouched:d,label:p,name:g,maskValue:x=!1,onPaste:h,placeholder:b,removeItemArray:m,register:w,suggestions:v,tooltip:S,type:k="text",weight:j,...C})=>{const{required:z,onBlur:F,onChange:
|
|
1381
|
+
`,gn=({handleTimeChange:e,onClose:n,props:i,timeState:r})=>{const o=f.useTheme(),{locale:a}=y.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),s=y.$131cf43a05231e1e$export$6d095e787d2b5e1f({...i,createCalendar:y.$64244302c3013299$export$dd0bbc9b26defe37,locale:a}),{prevButtonProps:l,nextButtonProps:c,title:d}=y.$9942cad8a072a530$export$3ee915f8151bd4f1(i,s);return t.jsxs("div",{className:"calendar",children:[t.jsx(_e,{nextButtonProps:c,prevButtonProps:l,state:s,title:d}),t.jsx(We,{state:s}),t.jsxs(Wr,{children:[t.jsx(I,{color:o.palette.gray[800],fontWeight:"bold",size:"md",children:"Time"}),t.jsx(_r,{children:t.jsx(ln,{hourCycle:12,label:"time-field",onChange:e,value:r.timeValue})})]}),t.jsx(ut,{children:t.jsx(O,{onClick:n,variant:"ghost",children:"Cancel"})})]})},Br=e=>{const{disabled:n=!1,error:i,required:r,label:o,name:a,tooltip:s,register:l,setValue:c,watch:d}=e,p=d==null?void 0:d(a),g=u.useRef(null),x=y.$ab5bf3f618090389$export$87194bb378cc3ac2({...e,granularity:"minute",hourCycle:12,isDisabled:n,isRequired:r,shouldCloseOnSelect:!1,value:y._.isNil(p)||y._.isEmpty(p)||p==="-"||y.dayjs(p,"YYYY/MM/DD hh:mm A").isValid()===!1?null:y.$fae977aafc393c5c$export$588937bcd60ade55(y.dayjs(p,"YYYY/MM/DD hh:mm A").format("YYYY-MM-DDTHH:mm:ss"))}),{close:h}=x,{groupProps:b,fieldProps:m,buttonProps:w,dialogProps:v,calendarProps:S}=y.$6057a3d2a53a12fd$export$42df105a73306d51(e,x,g),k=u.useCallback(C=>{if(S.onChange&&S.onChange(C),x.timeValue){const z=Et(C,x.timeValue);c==null||c(a,z,{shouldDirty:!0})}else x.setDateValue(C)},[S,a,c,x]),j=u.useCallback(C=>{if(C){x.setTimeValue(C);const z=x.dateValue;if(z){const F=Et(z,C);c==null||c(a,F,{shouldDirty:!0})}}},[x,c,a]);return t.jsxs(Z,{error:n?void 0:i,htmlFor:a,label:o,required:r,tooltip:s,children:[t.jsx(be,{buttonProps:w,datePickerRef:g,disabled:n,error:i,fieldProps:m,granularity:"minute",groupProps:b,name:a,register:l,setValue:c,value:p}),x.isOpen&&!n?t.jsx(Ee,{offset:8,placement:"bottom start",state:x,triggerRef:g,children:t.jsx(Be,{...v,children:t.jsx(gn,{handleTimeChange:j,onClose:h,props:{...S,onChange:k},timeState:x})})}):null]})},Hr=({children:e,currentValue:n,externalLink:i,isEditing:r,label:o,name:a,tooltip:s})=>{if(r)return t.jsx("div",{children:e});const l=y.lodashExports.isNil(n)?"":n,c=String(i??l);return t.jsxs($,{children:[t.jsx(pt,{htmlFor:a,label:o,tooltip:s,weight:"bold"}),c.startsWith("https://")?t.jsx(ie,{href:c,children:l}):t.jsx(I,{size:"md",children:l})]})},He=({disabled:e=!1,hasIcon:n=!1,helpLink:i,helpLinkText:r,helpText:o,error:a,id:s,indexArray:l=0,isValid:c,isTouched:d,label:p,name:g,maskValue:x=!1,onPaste:h,placeholder:b,removeItemArray:m,register:w,suggestions:v,tooltip:S,type:k="text",weight:j,...C})=>{const{required:z,onBlur:F,onChange:R}=C,D=f.useTheme(),T=e?void 0:a,[N,M]=u.useState(""),B=u.useCallback(W=>{M(W.target.value),R==null||R(W)},[R]),U=c&&d&&!e&&N.trim()!=="",H=u.useCallback(W=>{W.key==="Enter"&&W.preventDefault()},[]);return t.jsxs(Z,{error:T,helpLink:i,helpLinkText:r,helpText:o,htmlFor:g,label:p,required:z,tooltip:S,weight:j,children:[t.jsxs(ee,{className:`
|
|
1382
1382
|
${e?"disabled":""} ${T?"error":""} ${U?"success":""}
|
|
1383
|
-
`,children:[n?t.jsx(E,{icon:"user",iconSize:"xl",iconType:"fa-light"}):void 0,t.jsx("input",{"aria-hidden":!1,"aria-invalid":T?"true":"false","aria-label":g,"aria-required":z,autoComplete:"off",className:x?"sr-block":"","data-testid":`${g}-input`,disabled:e,id:g,list:v?`list_${g}`:void 0,onKeyDown:H,onPaste:h,placeholder:b,type:k,...w?w(g,{required:z,onBlur:F,onChange:B}):{...C,onChange:B}}),T?t.jsx(E,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:
|
|
1383
|
+
`,children:[n?t.jsx(E,{icon:"user",iconSize:"xl",iconType:"fa-light"}):void 0,t.jsx("input",{"aria-hidden":!1,"aria-invalid":T?"true":"false","aria-label":g,"aria-required":z,autoComplete:"off",className:x?"sr-block":"","data-testid":`${g}-input`,disabled:e,id:g,list:v?`list_${g}`:void 0,onKeyDown:H,onPaste:h,placeholder:b,type:k,...w?w(g,{required:z,onBlur:F,onChange:B}):{...C,onChange:B}}),T?t.jsx(E,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:D.palette.error[500],iconSize:"lg"}):void 0,U?t.jsx(E,{icon:"check-circle",iconClass:"success-icon",iconColor:D.palette.success[500],iconSize:"lg"}):void 0,s==="array"&&l>0?t.jsx(_,{color:D.palette.gray[400],icon:"trash",iconSize:"sm",iconType:"fa-light",onClick:m?m(l):void 0,variant:"ghost"}):void 0]}),v?t.jsx("datalist",{id:`list_${g}`,children:v.map(W=>t.jsx("option",{value:W},W))}):void 0]})},Vr=f.styled.div.attrs({className:"flex flex-wrap justify-center pv3 w-100"})``,Ur=f.styled.div.attrs({className:"flex flex-wrap items-center justify-start mb2"})`
|
|
1384
1384
|
gap: 12px;
|
|
1385
1385
|
`,Gr=f.styled.div.attrs({className:"flex flex-wrap items-center justify-end mb2"})`
|
|
1386
1386
|
gap: 8px;
|
|
@@ -1447,13 +1447,13 @@
|
|
|
1447
1447
|
position: absolute;
|
|
1448
1448
|
visibility: hidden;
|
|
1449
1449
|
width: 0;
|
|
1450
|
-
`,$e=(e,n,i)=>{const r=new Event(e);return Object.defineProperty(r,"target",{value:{name:n,value:i}}),r},eo=e=>{const n=e;return n?Array.from(n).map(i=>i.name).join(", "):""},to=({accept:e,disabled:n=!1,error:i,label:r,helpLink:o,helpText:a,id:s,multiple:l,name:c,onChange:d,required:p,register:g,setValue:x,tooltip:h,watch:b,weight:m})=>{const w=f.useTheme(),v=n?void 0:i,S=u.useRef(null),k=g==null?void 0:g(c,{required:p}),j=b==null?void 0:b(c),C=eo(j),z=u.useCallback(()=>{const
|
|
1450
|
+
`,$e=(e,n,i)=>{const r=new Event(e);return Object.defineProperty(r,"target",{value:{name:n,value:i}}),r},eo=e=>{const n=e;return n?Array.from(n).map(i=>i.name).join(", "):""},to=({accept:e,disabled:n=!1,error:i,label:r,helpLink:o,helpText:a,id:s,multiple:l,name:c,onChange:d,required:p,register:g,setValue:x,tooltip:h,watch:b,weight:m})=>{const w=f.useTheme(),v=n?void 0:i,S=u.useRef(null),k=g==null?void 0:g(c,{required:p}),j=b==null?void 0:b(c),C=eo(j),z=u.useCallback(()=>{const D=$e("change",c,void 0);x&&x(c,void 0),k&&k.onChange(D)},[k,c,x]),F=u.useCallback(D=>{const{files:T}=D.currentTarget,N=$e("change",c,T&&T.length>0?T:void 0);T&&T.length>0&&(d==null||d(N),x&&x(c,T),k&&k.onChange(N))},[k,c,d,x]),R=u.useCallback(D=>{n?D.preventDefault():S.current&&S.current.click()},[n]);return t.jsxs(Z,{error:v,helpLink:o,helpText:a,htmlFor:s??c,label:r,required:p,tooltip:h,weight:m,children:[t.jsxs(ee,{className:`${n?"disabled":""} ${v?"error":""}`,children:[t.jsx(Jr,{$size:"md",children:C}),t.jsxs($,{alignItems:"center",display:"flex",gap:.625,children:[y.lodashExports.isEmpty(C)||n?void 0:t.jsx(_,{color:w.palette.gray[400],height:"20px",icon:"xmark",iconSize:"64px",iconType:"fa-light",onClick:z,variant:"ghost",width:"20px"}),v&&t.jsx(E,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:w.palette.error[500],iconSize:"lg"}),t.jsxs(O,{border:n?`1px solid ${w.palette.gray[300]} !important`:"",borderRadius:"0px 8px 8px 0px !important",disabled:n,height:"40px",onClick:R,variant:"primary",width:"96px",children:[t.jsx(E,{icon:"search",iconSize:"xl",mr:.5}),"Add file"]})]})]}),t.jsx(Qr,{...k,accept:e,"aria-label":c,"data-testid":c,disabled:n,id:s??c,multiple:l,name:c,onChange:F,ref:S,type:"file"})]})},no=f.styled.input`
|
|
1451
1451
|
border: none;
|
|
1452
1452
|
background: transparent;
|
|
1453
1453
|
min-width: 15rem;
|
|
1454
1454
|
padding: 0;
|
|
1455
1455
|
flex: 1;
|
|
1456
|
-
`,et=({disabled:e=!1,error:n,field:i,helpLink:r,helpLinkText:o,helpText:a,label:s,name:l="input-tag",onChange:c,onRemove:d,placeholder:p,required:g,tooltip:x,value:h,weight:b})=>{const m=f.useTheme(),w=e?void 0:n,[v,S]=u.useState(""),k=c?h:i==null?void 0:i.value,j=u.useMemo(()=>k&&typeof k=="string"?k.split(",").filter(Boolean):[],[k]),C=u.useCallback(T=>{const
|
|
1456
|
+
`,et=({disabled:e=!1,error:n,field:i,helpLink:r,helpLinkText:o,helpText:a,label:s,name:l="input-tag",onChange:c,onRemove:d,placeholder:p,required:g,tooltip:x,value:h,weight:b})=>{const m=f.useTheme(),w=e?void 0:n,[v,S]=u.useState(""),k=c?h:i==null?void 0:i.value,j=u.useMemo(()=>k&&typeof k=="string"?k.split(",").filter(Boolean):[],[k]),C=u.useCallback(T=>{const M=[...new Set(T.filter(Boolean))].join(","),B=$e("change",l,M);i&&i.onChange(B),c&&c(B)},[i,l,c]),z=u.useCallback(T=>{S(T.target.value)},[]),F=u.useCallback(T=>{const N=v.trim();N.length&&!j.includes(N)&&(T.preventDefault(),C([...j,N]),S("")),i&&i.onBlur()},[v,i,C,j]),R=u.useCallback(T=>{const N=v.trim();T.key==="Enter"&&N.length===0&&T.preventDefault(),["Enter",","].includes(T.key)&&N.length>0&&!j.includes(N)?(T.preventDefault(),C([...j,N]),S("")):T.key==="Backspace"&&!N.length&&j.length&&(T.preventDefault(),d==null||d(j[j.length-1]),C(j.slice(0,-1)))},[v,d,C,j]),D=u.useCallback(T=>()=>{d==null||d(T),C(j.filter(N=>N!==T))},[d,C,j]);return t.jsx(Z,{error:w,helpLink:r,helpLinkText:o,helpText:a,htmlFor:l,label:s,required:g,tooltip:x,weight:b,children:t.jsxs(ee,{$overflowX:"auto",className:`${e?"disabled":""} ${w?"error":""}`,children:[j.map(T=>t.jsx(q,{disabled:e,onClose:D(T),tagLabel:T},T)),t.jsx(no,{"aria-hidden":!1,"aria-invalid":w?"true":"false","aria-label":l,"aria-required":g,autoComplete:"off",disabled:e,id:l,onBlur:F,onChange:z,onKeyDown:R,placeholder:j.length===0?p:void 0,ref:i==null?void 0:i.ref,type:"text",value:v}),w?t.jsx(E,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:m.palette.error[500],iconSize:"lg"}):void 0]})})},io=({disabled:e=!1,control:n,error:i,helpLink:r,helpLinkText:o,helpText:a,label:s,name:l="input-tag",onChange:c,onRemove:d,placeholder:p,required:g,tooltip:x,value:h,weight:b})=>n?t.jsx(y.Controller,{control:n,name:l,render:({field:m})=>t.jsx(et,{disabled:e,error:i,field:m,helpLink:r,helpLinkText:o,helpText:a,label:s,name:l,onRemove:d,placeholder:p,required:g,tooltip:x,weight:b}),rules:{required:g}}):t.jsx(et,{disabled:e,error:i,helpLink:r,helpLinkText:o,helpText:a,label:s,name:l,onChange:c,onRemove:d,placeholder:p,required:g,tooltip:x,value:h,weight:b}),ge=u.forwardRef(function({disabled:n,icon:i,margin:r,onClick:o,...a},s){return t.jsx(Fr,{$margin:r,"aria-label":i,className:"action-btn",disabled:n,onClick:o,ref:s,type:"button",...a,children:t.jsx(E,{icon:i,iconClass:"action",iconSize:"lg",iconType:"fa-light"})})}),me=({error:e,decimalPlaces:n=0,disabled:i=!1,id:r,maxLength:o,max:a=1/0,min:s=0,name:l,onChange:c,onEnter:d,placeholder:p,register:g,required:x,setValue:h,tooltipMessage:b,value:m,variant:w="full",defaultValue:v})=>{const S=f.useTheme(),k=i?void 0:e,j=n<0?0:n,[C,z]=u.useState(m?y._.toNumber(m):v?y._.toNumber(v):0),F=u.useCallback(()=>{const M=(C-10**-j).toFixed(j),B=Math.max(Number(s),Number(M));h&&h(l,B,{shouldDirty:!0}),z(B);const U=$e("change",l,M);c&&c(U)},[C,j,s,h,l,c]),R=u.useCallback(()=>{const M=(C+10**-j).toFixed(j),B=Math.min(Number(a),Number(M)>Number(s)?Number(M):Number(s));h&&h(l,B,{shouldDirty:!0}),z(B);const U=$e("change",l,M);c&&c(U)},[C,j,a,s,h,l,c]),D=u.useCallback(M=>{const{value:B}=M.target,U=/\d+/u.test(B)&&!y._.isEmpty(B);h&&h(l,U?B:void 0),c&&c(M),z(Number(B))},[l,c,h]),T=u.useCallback(M=>{M.stopPropagation(),M.key==="Enter"&&!y.lodashExports.isEmpty(M.currentTarget.value)&&(d==null||d(y.lodashExports.toNumber(M.currentTarget.value)))},[d]),N=()=>t.jsx("input",{"aria-hidden":!1,"aria-invalid":k?"true":"false","aria-label":l,"aria-required":x,autoComplete:"off",disabled:i,id:r??l,max:a,min:s,onChange:D,onKeyUp:T,placeholder:p,required:x,step:10**-j,type:"number",value:C,...g==null?void 0:g(l,{maxLength:o,max:a,min:s,onChange:D,value:m,valueAsNumber:!0})});return t.jsxs(ee,{$variant:w,className:`${i?"disabled":""} ${k?"error":""}`,children:[w==="compact"&&b?t.jsx(K,{id:`numberInputTooltip-${l}`,tip:b,width:"100%",children:N()}):N(),k&&t.jsx(E,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:S.palette.error[500],iconSize:"lg"}),w==="compact"?t.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",borderLeft:"inherit"},children:[t.jsx(ge,{borderRadius:`0 ${S.spacing[.5]} 0 0`,disabled:i,icon:"plus",onClick:R,px:.25}),t.jsx(vr,{}),t.jsx(ge,{borderRadius:`0 0 ${S.spacing[.5]} 0`,disabled:i,icon:"minus",onClick:F,px:.25})]}):t.jsxs(t.Fragment,{children:[t.jsx(ge,{borderLeft:"inherit",borderRight:"inherit",disabled:i,icon:"minus",margin:"0 -0.625rem 0 0",onClick:F,px:.75,py:.75}),t.jsx(ge,{borderRadius:`0 ${S.spacing[.5]} ${S.spacing[.5]} 0`,disabled:i,icon:"plus",onClick:R,px:.75,py:.75})]})]})},xn=({autoUpdate:e,decimalPlaces:n,disabled:i=!1,error:r,helpLink:o,helpLinkText:a,helpText:s,id:l,label:c,linkPosition:d,maxLength:p,max:g,min:x,name:h,onChange:b,onEnter:m,placeholder:w,register:v,required:S,setValue:k,tooltip:j,tooltipMessage:C,value:z,variant:F="full",watch:R,weight:D,defaultValue:T})=>F==="compact"?t.jsx(me,{"aria-label":h,autoUpdate:e,decimalPlaces:n,defaultValue:T??Number(z??0),disabled:i,max:g,min:x,name:h,onEnter:m??(()=>{}),tooltipMessage:C,value:z,variant:F}):t.jsx(Z,{error:i?void 0:r,helpLink:o,helpLinkText:a,helpText:s,htmlFor:h,label:c,linkPosition:d,maxLength:p,required:S,tooltip:j,weight:D,children:t.jsx(me,{decimalPlaces:n,disabled:i,error:r,id:l,max:g,maxLength:p,min:x,name:h,onChange:b,placeholder:w,register:v,required:S,setValue:k,value:R?R(h):z,variant:F})}),hn=({disabled:e=!1,error:n,name:i,label:r,propsMax:o,propsMin:a,required:s,tooltip:l,variant:c="default"})=>{const d=`${i}Max`,p=`${i}Min`;return t.jsx(Z,{error:e?void 0:n,htmlFor:i,label:r,required:s,tooltip:l,children:t.jsxs($,{display:"flex",flexDirection:c==="filters"?"column":"row",gap:.25,width:"100%",children:[t.jsx(me,{...a,disabled:e,error:n,name:(a==null?void 0:a.name)??p}),t.jsx(me,{...o,disabled:e,error:n,name:(o==null?void 0:o.name)??d})]})})},ro=f.styled.div`
|
|
1457
1457
|
${({theme:e})=>`
|
|
1458
1458
|
align-items: flex-start;
|
|
1459
1459
|
align-self: stretch;
|
|
@@ -1547,9 +1547,9 @@
|
|
|
1547
1547
|
overflow: hidden;
|
|
1548
1548
|
text-overflow: ellipsis;
|
|
1549
1549
|
white-space: nowrap;
|
|
1550
|
-
`,co=({disabled:e,error:n,label:i,name:r,placeholder:o,required:a,register:s,tooltip:l,value:c,watch:d,weight:p})=>{const g=f.useTheme(),x=u.useRef(null),h=e?void 0:n,b=(d==null?void 0:d(r))??c,[m,w]=u.useState(!1),[v,S]=u.useState(""),{refs:k,floatingStyles:j}=y.useFloating$1({placement:"bottom-start",whileElementsMounted:y.autoUpdate}),{inputRef:C,inputValue:z,handlePhoneValueChange:F,country:
|
|
1551
|
-
${e?"disabled":""} ${
|
|
1552
|
-
`,children:[t.jsx("textarea",{"aria-hidden":!1,"aria-invalid":
|
|
1550
|
+
`,co=({disabled:e,error:n,label:i,name:r,placeholder:o,required:a,register:s,tooltip:l,value:c,watch:d,weight:p})=>{const g=f.useTheme(),x=u.useRef(null),h=e?void 0:n,b=(d==null?void 0:d(r))??c,[m,w]=u.useState(!1),[v,S]=u.useState(""),{refs:k,floatingStyles:j}=y.useFloating$1({placement:"bottom-start",whileElementsMounted:y.autoUpdate}),{inputRef:C,inputValue:z,handlePhoneValueChange:F,country:R,setCountry:D}=y.ee({countries:y._$1,defaultCountry:"co",forceDialCode:!0,value:b?String(b):""}),T=u.useCallback(H=>{H.key==="Enter"&&H.preventDefault()},[]),N=u.useCallback(H=>{H.preventDefault(),w(W=>!W),m||S("")},[m]),M=u.useCallback(H=>()=>{D(H),w(!1),S("")},[D,w]),B=u.useCallback(H=>{H.key.length===1?S(W=>W+H.key):H.key==="Backspace"&&S(W=>W.slice(0,-1))},[]),U=y._$1.filter(H=>{const{name:W}=y.M(H);return W.toLowerCase().includes(v.toLowerCase())});return X(k.floating.current,()=>{w(!1),S("")},!0),t.jsx(Z,{error:h,htmlFor:r,label:i,required:a,tooltip:l,weight:p,children:t.jsxs(ro,{className:`${e?"disabled":""} ${h?"error":""}`,ref:x,children:[t.jsxs(oo,{"aria-label":"country-selector","data-testid":"country-selector",disabled:e,id:"country-selector",onClick:N,onKeyDown:B,ref:k.setReference,children:[t.jsx(y.q,{iso2:R.iso2,size:"16px"}),t.jsx(E,{icon:"angle-down",iconColor:g.palette.gray[400],iconSize:"lg",iconType:"fa-light"})]}),t.jsxs(ee,{className:`${e?"disabled":""} ${h?"error":""}`,children:[t.jsx("input",{"aria-hidden":!1,"aria-invalid":h?"true":"false","aria-label":r,"aria-required":a,autoComplete:"off","data-testid":`${r}-input`,disabled:e,id:r,name:r,onKeyDown:T,placeholder:o,ref:C,type:"tel",value:z,...s==null?void 0:s(r,{required:a,onChange:F})}),h?t.jsx(E,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:g.palette.error[500],iconSize:"lg"}):void 0]}),m&&ce.createPortal(t.jsx(ao,{ref:k.setFloating,style:j,children:U.map(H=>{const{dialCode:W,iso2:te,name:de}=y.M(H);return t.jsxs(so,{onClick:M(te),value:te,children:[t.jsx(y.q,{iso2:te,size:"16px"}),t.jsx(lo,{children:de}),t.jsx(I,{color:g.palette.gray[400],size:"md",textAlign:"end",children:"+"+W})]},te)})}),document.getElementById("modal-wrapper")??document.getElementById("root")??document.body)]})})},po=({disabled:e=!1,error:n,helpLink:i,helpLinkText:r,helpText:o,isTouched:a,isValid:s,label:l,name:c="input-text",id:d,maskValue:p=!1,maxLength:g,onBlur:x,placeholder:h,register:b,required:m,rows:w,tooltip:v,watch:S,weight:k,value:j})=>{const C=f.useTheme(),z=(S==null?void 0:S(c))??j,F=s&&a&&!e,R=e?void 0:n;return t.jsx(Z,{disabled:e,error:R,helpLink:i,helpLinkText:r,helpText:o,htmlFor:c,label:l,maxLength:g,required:m,tooltip:v,value:z?String(z):void 0,weight:k,children:t.jsxs(ee,{className:`
|
|
1551
|
+
${e?"disabled":""} ${R?"error":""} ${F?"success":""}
|
|
1552
|
+
`,children:[t.jsx("textarea",{"aria-hidden":!1,"aria-invalid":R?"true":"false","aria-label":c,"aria-required":m,className:p?"sr-block":"","data-testid":`${c}-text-area`,disabled:e,id:d??c,maxLength:g,placeholder:h,rows:w,value:z,...b==null?void 0:b(c,{required:m,onBlur:x})}),R?t.jsx(E,{icon:"exclamation-circle",iconClass:"error-icon",iconColor:C.palette.error[500],iconSize:"lg"}):void 0,F?t.jsx(E,{icon:"check-circle",iconClass:"success-icon",iconColor:C.palette.success[500],iconSize:"lg"}):void 0]})})},go=({control:e,description:n,disabled:i,id:r,items:o,align:a,inputType:s="text",inputNumberProps:l,minHeight:c,minWidth:d,name:p,placeholder:g,textAlign:x,tooltip:h,title:b,value:m,isTouched:w,isValid:v,error:S,onChange:k,register:j,setValue:C,watch:z})=>{const F=u.useMemo(()=>{if(s==="text")return t.jsx(He,{disabled:i,error:S,isTouched:w,isValid:v,name:p,placeholder:g,register:j});if(s==="date")return t.jsx(cn,{disabled:i,error:S,name:p,register:j,setValue:C,watch:z});if(s==="select"&&o)return t.jsx(gt,{control:e,disabled:i,items:o,name:p,placeholder:g,value:m});const{decimalPlaces:R,max:D,min:T}=l??{};return t.jsx(xn,{decimalPlaces:R,disabled:i,error:S,max:D,min:T,name:p,onChange:k,placeholder:g,register:j,setValue:C,value:m,watch:z})},[e,i,S,l,s,w,v,o,p,k,g,j,C,m,z]);return t.jsxs(wr,{$align:a,$minHeight:c,$minWidth:d,children:[t.jsx(Oe,{description:n,id:r,textAlign:x,title:b,tooltip:h}),F]})},fn=({options:e,title:n,checkboxesName:i,defaultBgColor:r,defaultCollapsed:o,onChange:a})=>{const s=f.useTheme(),[l,c]=u.useState(o??!1),d=u.useCallback(()=>{c(p=>!p)},[]);return t.jsxs($,{"aria-label":n,bgColor:l&&!r?s.palette.gray[50]:s.palette.white,border:"1px solid"+s.palette.gray[300],borderRadius:"8px",display:"inline-flex",flexDirection:"column",gap:.625,px:.75,py:.625,role:"region",width:"100%",children:[t.jsxs($,{alignItems:"center",cursor:"pointer",display:"flex",onClick:d,children:[t.jsx(I,{color:s.palette.gray[800],fontWeight:"bold",size:"md",children:n}),t.jsx(E,{icon:l?"chevron-up":"chevron-down",iconColor:s.palette.gray[400],iconSize:"lg"})]}),l?t.jsx($,{display:"flex",gap:.75,wrap:"wrap",children:e.map(p=>t.jsx($,{bgColor:s.palette.white,border:"1px solid",borderColor:s.palette.gray[300],borderRadius:s.spacing[.25],px:.5,py:.5,children:t.jsx(ae,{checked:p.visible,disabled:p.locked,label:p.name,name:`${i}-${p.name}`,onChange:a,value:p.name})},p.name))}):void 0]})},uo=f.styled.div`
|
|
1553
1553
|
display: flex;
|
|
1554
1554
|
align-self: flex-start;
|
|
1555
1555
|
margin-left: auto;
|
|
@@ -2152,7 +2152,7 @@ ${m[8]}...`:(m.length<8&&p(!1),i)},[l,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2152
2152
|
svg.fa-check {
|
|
2153
2153
|
border-radius: 2px;
|
|
2154
2154
|
}
|
|
2155
|
-
`,In=({control:e,option:n,register:i,watch:r,setValue:o})=>{var a,s,l,c;switch(n.type){case"checkboxes":{const p=r("search")??"",g=r("checkbox")??[],x=n.options??[],h=Ko(x,p,g);return t.jsxs("div",{style:{overflowX:"hidden",overflowY:"auto",maxHeight:"280px"},children:[!n.label||n.label===""?void 0:null,h.map(b=>t.jsx(At,{value:b.value,width:"content",children:t.jsx(ae,{...i("checkbox"),label:b.label,value:b.value})},`li-checkbox-${b.value}`))]})}case"radioButton":return t.jsxs("div",{style:{overflowX:"hidden",overflowY:"auto",maxHeight:"280px"},children:[n.label,(a=n.options)==null?void 0:a.map(p=>t.jsx(At,{value:p.value,width:"content",children:t.jsx(xt,{...i("radio"),label:p.label,value:p.value})},`li-radio-${p.value}`))]});case"select":return t.jsx(gt,{control:e,items:((s=n.options)==null?void 0:s.map(p=>({name:p.label??"",value:p.value})))??[],label:n.label,name:`text.${String(n.key)}-${n.filterFn??"caseInsensitive"}`,placeholder:n.placeholder,value:n.value});case"text":const d=`text.${String(n.key)}-${n.filterFn??"caseInsensitive"}`;return t.jsx(He,{label:n.label,name:d,placeholder:n.placeholder,register:i,value:n.value});case"numberRange":return t.jsx(hn,{label:n.label,name:String(n.key),propsMax:{placeholder:n.placeholder?`${n.placeholder} Max`:"Max",register:i,name:"maxValue",value:n.maxValue,setValue:o},propsMin:{placeholder:n.placeholder?`${n.placeholder} Min`:"Min",register:i,name:"minValue",value:n.minValue,setValue:o},variant:"filters"});case"dateRange":return t.jsx(pn,{label:n.label,name:String(n.key),propsMax:{name:"maxValue",value:(l=n.maxValue)==null?void 0:l.toString()},propsMin:{name:"minValue",value:(c=n.minValue)==null?void 0:c.toString()},register:i,setValue:o,variant:"filters"});default:return t.jsx("div",{})}},Dn=({control:e,items:n,register:i,setValue:r,watch:o})=>t.jsx(t.Fragment,{children:n.map((a,s)=>{const l=`${a.type}-${a.value}-${a.filterFn??"default"}`;return t.jsxs("div",{children:[t.jsx(In,{control:e,option:a,register:i,setValue:r,watch:o}),s<n.length-1&&t.jsx("hr",{style:{margin:"1.25rem 0 0.625rem"}})]},l)})}),En=e=>{var c,d,p,g,x;const[n,i]=u.useState([...e]),{control:r,register:o,handleSubmit:a,setValue:s,watch:l}=y.useForm({defaultValues:{checkbox:e.filter(h=>h.type==="checkboxes").flatMap(h=>{var b;return((b=h.options)==null?void 0:b.filter(m=>m.checked).map(m=>m.value))??[]}),radio:((p=(d=(c=e.find(h=>h.type==="radioButton"))==null?void 0:c.options)==null?void 0:d.find(({checked:h})=>h))==null?void 0:p.value)??"",text:e.filter(h=>["text","select"].includes(h.type)).reduce((h,b)=>({...h,[`${String(b.key)}-${b.filterFn??"caseInsensitive"}`]:b.value??""}),{}),minValue:(g=e.find(h=>["numberRange","dateRange"].includes(h.type)))==null?void 0:g.minValue,maxValue:(x=e.find(h=>["numberRange","dateRange"].includes(h.type)))==null?void 0:x.maxValue,search:""}});return{control:r,items:n,setItems:i,register:o,handleSubmit:a,setValue:s,watch:l}},tt=({options:e,onSearch:n,onSubmit:i,id:r,selectedFilter:o})=>{const{control:a,items:s,setItems:l,register:c,handleSubmit:d,setValue:p,watch:g}=En(e),x=e.some(v=>v.type==="checkboxes"&&v.hideSearch!==!0),h=e.some(v=>v.label&&v.label!==""),b=u.useCallback(async v=>{const{value:S}=v.target;p("search",S),n&&n(S)},[n,p]),m=u.useCallback(()=>{p("search",""),n&&n("")},[n,p]),w=u.useCallback(v=>{i&&i(v)},[i]);return u.useEffect(()=>{l(e),Yo(e,p)},[e,l,p]),t.jsxs("div",{className:"flex flex-col gap-[8px]",id:r,style:{writingMode:"horizontal-tb",maxWidth:"300px",width:"100%"},children:[x&&t.jsxs("div",{children:[h?o:void 0,t.jsx(le,{onChange:b,onClear:m,placeholder:"Search"})]}),t.jsxs("form",{id:r,onSubmit:d(w),children:[t.jsx(Dn,{control:a,items:s,register:c,setValue:p,watch:g}),t.jsx(O,{mt:1,type:"submit",children:"Apply"})]})]})},Rn=({options:e,variant:n,onApplyFilters:i,onSearch:r,setDirection:o,setHandler:a,onFilterStateChange:s})=>{const l=f.useTheme(),[c,d]=u.useState(e),[p,g]=u.useState([]),[x,h]=u.useState({}),[b,m]=u.useState(""),w=u.useCallback(k=>()=>{const j=c.find(z=>z.label===k),C=!(j!=null&&j.filterOptions.some(z=>z.type==="dateRange"||z.type==="select"));a==null||a(C??!0),m(k),g((j==null?void 0:j.filterOptions)??[])},[c,a]),v=u.useCallback(k=>{const j=[...k.checkbox,...Object.values(k.text??{}),...k.radio?[k.radio]:[],...k.minValue?[String(k.minValue)]:[],...k.maxValue?[String(k.maxValue)]:[]];h(R=>j.length>0?{...R,[b]:j}:R);const C=R=>{var T,N;return{...R,options:(T=R.options)==null?void 0:T.map(P=>({...P,checked:k.checkbox.includes(P.value)||k.radio===P.value})),value:["text","select"].includes(R.type)?((N=k.text)==null?void 0:N[`${String(R.key)}-${R.filterFn??"caseInsensitive"}`])??R.value:R.value,minValue:["numberRange","dateRange"].includes(R.type)?k.minValue:R.minValue,maxValue:["numberRange","dateRange"].includes(R.type)?k.maxValue:R.maxValue}},z=R=>R.label===b?{...R,filterOptions:R.filterOptions.map(C)}:R,F=c.map(z);d(R=>R.map(z));const D=F.flatMap(({filterOptions:R})=>R);i(D),g([])},[c,i,b]),S=u.useCallback((k,j)=>{const C=`li-filter-option-${k}`;return t.jsxs(Go,{icon:j,onClick:w(k),style:{minWidth:"180px",writingMode:"horizontal-tb"},value:C,width:"100%",children:[k,x[k]===void 0?void 0:t.jsx(q,{tagLabel:x[k].length.toString()})]},C)},[x,w]);return u.useEffect(()=>{const k=e.reduce((j,{label:C,filterOptions:z})=>{const F=z.flatMap(({value:T,minValue:N,maxValue:P})=>[N,P,T]).filter(Boolean),D=z.flatMap(({options:T})=>T??[]).filter(({checked:T=!1})=>T).map(({value:T})=>T),R=[...F,...D];return R.length===0?j:{...j,[C]:R}},{});h(k),p.length>0&&o&&o("column")},[p,e,o]),u.useEffect(()=>{s==null||s(p.length>0)},[p.length,s]),n==="grouped"?t.jsx($,{display:"flex",flexDirection:"row",maxHeight:p.length>0?"unset":"360px",style:{rowGap:"10px",writingMode:"vertical-lr"},wrap:"wrap",children:p.length>0?t.jsx(tt,{id:"filters-options",onSearch:r,onSubmit:v,options:p,selectedFilter:b}):Object.entries(yt(e)).map(([k,j])=>t.jsxs($,{style:{writingMode:"horizontal-tb"},children:[t.jsx(I,{color:l.palette.gray[400],fontWeight:"bold",mb:.25,size:"md",children:k}),j.map(({label:C,icon:z="filter-list"})=>S(C,z))]},k))}):t.jsx($,{display:"flex",flexDirection:"row",maxHeight:p.length>0?"unset":"200px",style:{rowGap:"10px",writingMode:"vertical-lr"},wrap:"wrap",children:p.length>0?t.jsx(tt,{id:"filters-options",onSearch:r,onSubmit:v,options:p,selectedFilter:b}):e.map(({label:k,icon:j="filter-list"})=>S(k,j))})},Fn=({options:e,onApplyFilters:n,onSearch:i,modalRef:r,variant:o})=>{const[a,s]=u.useState("row"),[l,c]=u.useState(!0),[d,p]=u.useState(!1),x=(o==="grouped"?Object.values(yt(e)).reduce((w,v)=>w+v.length,0):e.length)>5&&!d,h=f.useTheme(),b=u.useRef(null),m=t.jsx(_,{icon:"close",iconColor:h.palette.gray[400],iconSize:"lg",iconTransform:"grow-2",iconType:"fa-light",id:"modal-close",onClick:r.close,px:.25,py:.25,variant:"ghost"});return u.useEffect(()=>{const w=v=>{const S=b.current;S&&!S.contains(v.target)&&r.close()};if(l)return document.addEventListener("mousedown",w,!0),()=>{document.removeEventListener("mousedown",w,!0)}},[b,l,r]),t.jsx(Zo,{$bgColor:"transparent","aria-label":r.name,children:t.jsxs(ht,{$size:"fixed",alignItems:a==="row"?"start":"end",display:"flex",flexDirection:a,gap:.5,id:"filters-list",justify:"space-between",position:"relative",px:1.25,py:1.25,ref:b,style:{maxWidth:"620px",overflow:"hidden",width:"fit-content",paddingBottom:x?"0":void 0},children:[a==="column"?m:void 0,t.jsx(Rn,{onApplyFilters:n,onFilterStateChange:p,onSearch:i,options:e,setDirection:s,setHandler:c,variant:o}),a==="row"?m:void 0]})})};function Xo(e){if(!e)return;const n=20;if(e.length<=n)return e;const i=n-3,r=Math.ceil(i/2),o=Math.floor(i/2);return`${e.slice(0,r)}...${e.slice(e.length-o)}`}function Nn(e){if(!e||e.length===0)return;const n=e.filter(l=>l.checked).map(l=>l.label??l.value);if(n.length===0)return;const i=(l,c=20)=>{if(l.length<=c)return l;const d=c-3,p=Math.ceil(d/2),g=Math.floor(d/2);return`${l.slice(0,p)}...${l.slice(l.length-g)}`};if(n.length===1){const l=n[0];return l.length>20?i(l,20):l}if(n.length===2){const l=n[0],c=n.join(", ").length;return l.length>20||c>20?`${i(l,20)} +1 more`:`${n[0]}, ${n[1]}`}const r=n[0],o=n.length-1,a=20,s=n.join(", ").length;return r.length>a||s>a?`${i(r,a)} +${o} more`:`${n[0]}, ${n[1]}`}function qo(e,n,i){const r=i??"",o=y._.isEmpty(e)&&typeof e!="number"||Number.isNaN(e)?void 0:Number(e),a=y._.isEmpty(n)&&typeof n!="number"||Number.isNaN(n)?void 0:Number(String(n));if(!y._.isUndefined(o)&&!y._.isUndefined(a))return`${o}${r} - ${a}${r}`;if(!y._.isUndefined(o))return`Min ${o}${r}`;if(!y._.isUndefined(a))return`Max ${a}${r}`}function Jo(e,n){if(y.dayjs_minExports.extend(y.localizedFormat),!(y._.isUndefined(e)&&y._.isUndefined(n))){if(e!==""&&n!==""&&!y._.isUndefined(e)&&!y._.isUndefined(n))return`${y.dayjs(e).format("LL")} - ${y.dayjs(n).format("LL")}`;if(e!==""&&!y._.isUndefined(e))return`From ${y.dayjs(e).format("LL")}`;if(n!==""&&!y._.isUndefined(n))return`To ${y.dayjs(n).format("LL")}`}}function Qo(e,n,i){return e==="select"?n:`${n} ${i==="includesInsensitive"?"contains":"is"}`}const xe=({filter:e,icon:n="filter-list",label:i,onClose:r,filterValue:o})=>{if(y._.isNil(o)||y._.isEmpty(String(o)))return null;const a=e.type==="checkboxes"?(e.options??[]).filter(c=>c.checked).map(c=>c.label??c.value):[],{tooltipContent:s,shouldShowTooltip:l}=(()=>{var d,p,g;if(a.length>0){if(a.length===1){const m=(((d=a[0])==null?void 0:d.length)??0)>20;return{shouldShowTooltip:m,tooltipContent:m?a[0]:void 0}}if(a.length===2){const m=((p=a[0])==null?void 0:p.length)??0,w=a.join(", ").length,v=m>20||w>20;return{shouldShowTooltip:v,tooltipContent:v?a:void 0}}const x=((g=a[0])==null?void 0:g.length)??0,h=a.join(", ").length,b=x>20||h>20;return{shouldShowTooltip:b,tooltipContent:b?a:void 0}}const c=e.value;return typeof c=="string"&&c.length>20?{shouldShowTooltip:!0,tooltipContent:c}:{shouldShowTooltip:!1,tooltipContent:void 0}})();return t.jsx(K,{disabled:!l,id:"applied-filter-tooltip",nodeTip:l?Array.isArray(s)?t.jsx($,{display:"flex",flexDirection:"column",gap:.25,children:s.map(c=>t.jsxs($,{alignItems:"flex-start",display:"flex",gap:.5,children:[t.jsx("span",{children:"•"}),t.jsx($,{whiteSpace:"normal",wordWrap:"break-word",children:c})]},c))}):t.jsx($,{whiteSpace:"normal",wordWrap:"break-word",children:s}):void 0,children:t.jsx(q,{filterValues:o,icon:n,id:"remove-filter",onClose:r(e),tagLabel:`${i} `})})},ea=({options:e,onClose:n})=>{const i=e.flatMap(r=>r.filterOptions.map(o=>{const{filterFn:a,label:s,type:l,value:c,options:d,minValue:p,maxValue:g}=o;switch(l){case"numberRange":{const x=qo(p,g,r.placeholder);return t.jsx(xe,{filter:o,filterValue:x,icon:r.icon,label:r.label,onClose:n},s)}case"dateRange":{const x=Jo(p==null?void 0:p.toString(),g==null?void 0:g.toString());return t.jsx(xe,{filter:o,filterValue:x,icon:r.icon,label:r.label,onClose:n},s)}case"radioButton":case"checkboxes":{const x=Nn(d);return t.jsx(xe,{filter:o,filterValue:x,icon:r.icon,label:r.label,onClose:n},s)}case void 0:case"select":case"text":default:{const x=Xo(c),h=Qo(l,r.label,a);return t.jsx(xe,{filter:o,filterValue:x,icon:r.icon,label:h,onClose:n},s)}}})).filter(r=>{if(r===null)return!1;const{filterValue:o}=r.props;return!y._.isNil(o)&&!y._.isEmpty(String(o))});return i.length>0?t.jsx($,{alignItems:"center",display:"flex",gap:.5,pb:1,width:"100%",wrap:"wrap",children:i}):null},ta=e=>e.map(n=>{const i={key:String(n.key),type:n.type},r=(()=>{let o={...i};if(n.filterFn&&(o={...o,filterFn:n.filterFn}),n.value&&(o={...o,value:n.value}),n.minValue!==void 0&&n.minValue!==null&&(o={...o,minValue:n.minValue}),n.maxValue!==void 0&&n.maxValue!==null&&(o={...o,maxValue:n.maxValue}),n.options&&n.options.length>0){const a=n.options.filter(s=>s.checked).map(s=>s.value);a.length>0&&(o={...o,selectedValues:a})}return o})();return Object.keys(r).length>2?r:null}).filter(Boolean),na=(e,n)=>n.map(i=>{const r=e.find(a=>a.key===String(i.key)&&a.type===i.type);return r?(()=>{let a={...i};return r.filterFn&&(a={...a,filterFn:r.filterFn}),r.value!==void 0&&r.value!==null&&(a={...a,value:r.value}),r.minValue!==void 0&&r.minValue!==null&&(a={...a,minValue:r.minValue}),r.maxValue!==void 0&&r.maxValue!==null&&(a={...a,maxValue:r.maxValue}),r.selectedValues&&i.options&&(a={...a,options:i.options.map(s=>{var l;return{...s,checked:((l=r.selectedValues)==null?void 0:l.includes(s.value))??!1}})}),a})():i}),Ke=(e,n)=>{const i=ta(e);n(JSON.stringify(i))},ia=(e,n)=>{const i=e();if(!i)return n;try{const r=JSON.parse(i);return na(r,n)}catch{return n}},ra=(e,n)=>{function i(s,l){if(l.value===""||l.value===void 0||y._.defaultTo(l.isBackFilter,!1))return!0;switch(l.filterFn){case"includesInsensitive":return String(s[l.key]).toLowerCase().includes(l.value.toLowerCase());case"caseInsensitive":case void 0:default:return String(s[l.key]).toLowerCase()===l.value.toLowerCase()}}function r(s,l){if(!l.options||l.options.length===0)return!0;const c=l.options.filter(d=>d.checked).map(d=>d.value);return c.length===0?!0:c.includes(String(s[l.key]))}function o(s,l,c){const d=c(String(s[l.key])),{minValue:p,maxValue:g}=l,x=y._.isEmpty(p)&&typeof p!="number"?void 0:c(String(p)),h=y._.isEmpty(g)&&typeof g!="number"?void 0:c(String(g));return y._.isUndefined(x)&&y._.isUndefined(h)?!0:(x??-1/0)<=d&&d<=(h??1/0)}function a(s){return n.every(l=>{if(typeof l.key=="function")return l.key(s,l.value);switch(l.type){case"radioButton":case"checkboxes":return r(s,l);case"numberRange":return o(s,l,Number);case"dateRange":return o(s,l,c=>new Date(c));case"select":case"text":default:return i(s,l)}})}return e.filter(a)},oa=e=>[...e.flatMap(({options:i})=>i).filter(i=>i==null?void 0:i.checked),...e.flatMap(i=>[i.value,i.maxValue,i.minValue]).filter(Boolean)].length,aa=e=>{var i;const n=((i=e.options)==null?void 0:i.map(r=>({...r,checked:void 0})))??void 0;return{...e,minValue:void 0,maxValue:void 0,value:void 0,options:n}},sa=({dataset:e,setValues:n,getValues:i,options:r,setFilteredDataset:o,onFiltersChange:a,onReset:s,onSearch:l,variant:c="ungrouped"})=>{const d=De("filters-modal"),[p,g]=u.useState(!1),[x,h]=u.useState([]),b=oa(x),m=r.map(j=>({...j,filterOptions:j.filterOptions.map(C=>x.find(F=>F.key===C.key&&F.type===C.type&&F.filterFn===C.filterFn)??{...C})})),w=u.useCallback(j=>{h([...j]),Ke(j,n)},[h,n]),v=u.useCallback(()=>{s&&s(),d.isOpen||g(!0),d.toggle()},[d,s]),S=u.useCallback(j=>()=>{s&&s();const C=x.map(z=>z.key===j.key&&z.type===j.type&&z.filterFn===j.filterFn?aa(z):z);h(C),Ke(C,n)},[x,s,n]);return u.useEffect(()=>{const j=r.flatMap(F=>F.filterOptions),C=i();if((()=>{if(!C)return!1;try{const F=JSON.parse(C);return Array.isArray(F)&&F.length>0}catch{return!1}})()){const F=ia(i,j);h(F)}else j.flatMap(D=>D.value).filter(Boolean).length>0||j.flatMap(D=>D.options).filter(D=>(D==null?void 0:D.checked)===!0).length>0?(h(j),p&&Ke(j,n)):h(j)},[r,h,n,i,p]),u.useEffect(()=>{o&&e!==void 0&&o(ra(e,x)),a==null||a(x)},[e,x,o,a]),{Filters:()=>t.jsxs($,{alignItems:"center",display:"flex",gap:.25,maxWidth:"100%",position:"relative",wrap:"wrap",children:[t.jsx($,{pr:.25,children:t.jsx(O,{icon:"filter",id:"filter-btn",onClick:v,tag:b.toString(),variant:"ghost"})}),d.isOpen&&t.jsx(Fn,{modalRef:d,onApplyFilters:w,onSearch:l,options:m,variant:c})]}),options:m,removeFilter:S}},bt=({_portal:e=!0,alert:n,cancelButton:i=void 0,children:r=void 0,confirmButton:o=void 0,content:a=void 0,description:s=void 0,modalRef:l,otherActions:c=void 0,onClose:d=void 0,tabItems:p=void 0,title:g=void 0,size:x,id:h="modal-container"})=>{const b=f.useTheme(),[m,w]=u.useState(void 0),v=u.useRef(null),S=u.useRef(!1),k=Array.isArray(p)&&p.length>0,j=i??o;u.useEffect(()=>{if(k&&!S.current&&v.current){const z=v.current.getBoundingClientRect().height;z>50&&(w(z),S.current=!0)}l.isOpen||(w(void 0),S.current=!1)},[k,l.isOpen]);const C=t.jsx(mn,{"aria-label":l.name,"aria-modal":"true",id:"modal-wrapper",children:t.jsxs(ht,{$size:x,"data-testid":h,flexDirection:"column",id:h,ref:k?v:void 0,style:k&&m?{height:m}:void 0,children:[!y._.isEmpty(g)&&!y._.isNil(g)&&t.jsx(jn,{description:s,modalRef:l,onClose:d,otherActions:c,title:g}),p&&t.jsx($,{borderTop:`1px solid ${b.palette.gray[300]}`,display:"block",mb:1.25,position:"sticky",children:t.jsx(ft,{items:p})}),(y._.isObject(a)||r)&&t.jsxs(Ro,{style:j?{borderBottom:`1px solid ${b.palette.gray[200]}`}:void 0,children:[r,y._.isObject(a)&&y._.isString(a.imageSrc)&&t.jsx(Lo,{$framed:a.imageFramed,children:t.jsx(Q,{alt:"modal-img",publicId:a.imageSrc})}),y._.isObject(a)&&y._.isString(a.imageText)&&t.jsx(I,{size:"md",children:a.imageText})]}),t.jsx(wn,{alert:n,cancelButton:i,confirmButton:o,modalRef:l})]})});return e&&l.isOpen?ce.createPortal(C,document.getElementById("portals")??document.body):l.isOpen?C:null},la=(e,n,i)=>{const r=De("confirm-dialog-modal"),o=u.useRef(null),a=u.useCallback(async()=>(r.open(),new Promise(d=>{o.current=d})),[r]),s=u.useCallback(()=>{var d;r.close(),(d=o.current)==null||d.call(o,!0)},[r]),l=u.useCallback(()=>{var d;r.close(),(d=o.current)==null||d.call(o,!1)},[r]);return[a,({children:d})=>{const[p,g]=u.useState(i),x=u.useCallback(()=>{g({...i})},[]),h=u.useCallback(w=>()=>{g(v=>({...v,[w]:{...v[w],state:!v[w].state}}))},[]),b=!Object.values(p).every(({state:w})=>w),m=Object.entries(p).map(([w,{state:v,label:S}])=>t.jsx(ae,{defaultChecked:v,label:S,name:w,onChange:h(w)},w));return t.jsxs(bt,{"data-testid":e,id:e,modalRef:{...r,close:l},onClose:x,size:"sm",title:n,children:[d,t.jsx($,{display:"flex",flexDirection:"column",gap:.5,children:m}),t.jsx(vn,{disabled:b,id:e,onConfirm:s})]})}]},ca=()=>{const[e,n]=u.useState(!1),[i,r]=u.useState(),o=u.useRef(null),a=De("confirm-dialog-modal"),s=u.useCallback(async p=>(r(p),n(!0),new Promise(g=>{o.current=g})),[]),l=u.useCallback(()=>{var p;n(!1),r(void 0),(p=o.current)==null||p.call(o,!0)},[]),c=u.useCallback(()=>{var p;n(!1),r(void 0),(p=o.current)==null||p.call(o,!1)},[]);return u.useEffect(()=>{a.setIsOpen(e)},[e,a]),{ConfirmDialog:({id:p="confirm-dialog-modal",children:g})=>t.jsxs(bt,{cancelButton:{onClick:c,text:"Cancel"},confirmButton:{id:(i==null?void 0:i.id)??"modal-confirm",onClick:l,text:"Confirm"},description:i==null?void 0:i.message,id:p,modalRef:{...a,close:c},size:"sm",title:i==null?void 0:i.title,children:[i==null?void 0:i.content,g]}),confirm:s}},da=2e3,pa=({content:e})=>{const[n,i]=u.useState("Copy"),r=u.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{i("Copied"),setTimeout(()=>{i("Copy")},da)}).catch(()=>{i("Failed to copy")})},[e]);return t.jsx(_,{icon:"copy",iconSize:"lg",iconType:"fa-light",onClick:r,tooltip:n,variant:"ghost"})},ga=f.styled.ul`
|
|
2155
|
+
`,In=({control:e,option:n,register:i,watch:r,setValue:o})=>{var a,s,l,c;switch(n.type){case"checkboxes":{const p=r("search")??"",g=r("checkbox")??[],x=n.options??[],h=Ko(x,p,g);return t.jsxs("div",{style:{overflowX:"hidden",overflowY:"auto",maxHeight:"280px"},children:[!n.label||n.label===""?void 0:null,h.map(b=>t.jsx(At,{value:b.value,width:"content",children:t.jsx(ae,{...i("checkbox"),label:b.label,value:b.value})},`li-checkbox-${b.value}`))]})}case"radioButton":return t.jsxs("div",{style:{overflowX:"hidden",overflowY:"auto",maxHeight:"280px"},children:[n.label,(a=n.options)==null?void 0:a.map(p=>t.jsx(At,{value:p.value,width:"content",children:t.jsx(xt,{...i("radio"),label:p.label,value:p.value})},`li-radio-${p.value}`))]});case"select":return t.jsx(gt,{control:e,items:((s=n.options)==null?void 0:s.map(p=>({name:p.label??"",value:p.value})))??[],label:n.label,name:`text.${String(n.key)}-${n.filterFn??"caseInsensitive"}`,placeholder:n.placeholder,value:n.value});case"text":const d=`text.${String(n.key)}-${n.filterFn??"caseInsensitive"}`;return t.jsx(He,{label:n.label,name:d,placeholder:n.placeholder,register:i,value:n.value});case"numberRange":return t.jsx(hn,{label:n.label,name:String(n.key),propsMax:{placeholder:n.placeholder?`${n.placeholder} Max`:"Max",register:i,name:"maxValue",value:n.maxValue,setValue:o},propsMin:{placeholder:n.placeholder?`${n.placeholder} Min`:"Min",register:i,name:"minValue",value:n.minValue,setValue:o},variant:"filters"});case"dateRange":return t.jsx(pn,{label:n.label,name:String(n.key),propsMax:{name:"maxValue",value:(l=n.maxValue)==null?void 0:l.toString()},propsMin:{name:"minValue",value:(c=n.minValue)==null?void 0:c.toString()},register:i,setValue:o,variant:"filters"});default:return t.jsx("div",{})}},Dn=({control:e,items:n,register:i,setValue:r,watch:o})=>t.jsx(t.Fragment,{children:n.map((a,s)=>{const l=`${a.type}-${a.value}-${a.filterFn??"default"}`;return t.jsxs("div",{children:[t.jsx(In,{control:e,option:a,register:i,setValue:r,watch:o}),s<n.length-1&&t.jsx("hr",{style:{margin:"1.25rem 0 0.625rem"}})]},l)})}),En=e=>{var c,d,p,g,x;const[n,i]=u.useState([...e]),{control:r,register:o,handleSubmit:a,setValue:s,watch:l}=y.useForm({defaultValues:{checkbox:e.filter(h=>h.type==="checkboxes").flatMap(h=>{var b;return((b=h.options)==null?void 0:b.filter(m=>m.checked).map(m=>m.value))??[]}),radio:((p=(d=(c=e.find(h=>h.type==="radioButton"))==null?void 0:c.options)==null?void 0:d.find(({checked:h})=>h))==null?void 0:p.value)??"",text:e.filter(h=>["text","select"].includes(h.type)).reduce((h,b)=>({...h,[`${String(b.key)}-${b.filterFn??"caseInsensitive"}`]:b.value??""}),{}),minValue:(g=e.find(h=>["numberRange","dateRange"].includes(h.type)))==null?void 0:g.minValue,maxValue:(x=e.find(h=>["numberRange","dateRange"].includes(h.type)))==null?void 0:x.maxValue,search:""}});return{control:r,items:n,setItems:i,register:o,handleSubmit:a,setValue:s,watch:l}},tt=({options:e,onSearch:n,onSubmit:i,id:r,selectedFilter:o})=>{const{control:a,items:s,setItems:l,register:c,handleSubmit:d,setValue:p,watch:g}=En(e),x=e.some(v=>v.type==="checkboxes"&&v.hideSearch!==!0),h=e.some(v=>v.label&&v.label!==""),b=u.useCallback(async v=>{const{value:S}=v.target;p("search",S),n&&n(S)},[n,p]),m=u.useCallback(()=>{p("search",""),n&&n("")},[n,p]),w=u.useCallback(v=>{i&&i(v)},[i]);return u.useEffect(()=>{l(e),Yo(e,p)},[e,l,p]),t.jsxs("div",{className:"flex flex-col gap-[8px]",id:r,style:{writingMode:"horizontal-tb",maxWidth:"300px",width:"100%"},children:[x&&t.jsxs("div",{children:[h?o:void 0,t.jsx(le,{onChange:b,onClear:m,placeholder:"Search"})]}),t.jsxs("form",{id:r,onSubmit:d(w),children:[t.jsx(Dn,{control:a,items:s,register:c,setValue:p,watch:g}),t.jsx(O,{mt:1,type:"submit",children:"Apply"})]})]})},Rn=({options:e,variant:n,onApplyFilters:i,onSearch:r,setDirection:o,setHandler:a,onFilterStateChange:s})=>{const l=f.useTheme(),[c,d]=u.useState(e),[p,g]=u.useState([]),[x,h]=u.useState({}),[b,m]=u.useState(""),w=u.useCallback(k=>()=>{const j=c.find(z=>z.label===k),C=!(j!=null&&j.filterOptions.some(z=>z.type==="dateRange"||z.type==="select"));a==null||a(C??!0),m(k),g((j==null?void 0:j.filterOptions)??[])},[c,a]),v=u.useCallback(k=>{const j=[...k.checkbox,...Object.values(k.text??{}),...k.radio?[k.radio]:[],...k.minValue?[String(k.minValue)]:[],...k.maxValue?[String(k.maxValue)]:[]];h(D=>j.length>0?{...D,[b]:j}:D);const C=D=>{var T,N;return{...D,options:(T=D.options)==null?void 0:T.map(M=>({...M,checked:k.checkbox.includes(M.value)||k.radio===M.value})),value:["text","select"].includes(D.type)?((N=k.text)==null?void 0:N[`${String(D.key)}-${D.filterFn??"caseInsensitive"}`])??D.value:D.value,minValue:["numberRange","dateRange"].includes(D.type)?k.minValue:D.minValue,maxValue:["numberRange","dateRange"].includes(D.type)?k.maxValue:D.maxValue}},z=D=>D.label===b?{...D,filterOptions:D.filterOptions.map(C)}:D,F=c.map(z);d(D=>D.map(z));const R=F.flatMap(({filterOptions:D})=>D);i(R),g([])},[c,i,b]),S=u.useCallback((k,j)=>{const C=`li-filter-option-${k}`;return t.jsxs(Go,{icon:j,onClick:w(k),style:{minWidth:"180px",writingMode:"horizontal-tb"},value:C,width:"100%",children:[k,x[k]===void 0?void 0:t.jsx(q,{tagLabel:x[k].length.toString()})]},C)},[x,w]);return u.useEffect(()=>{const k=e.reduce((j,{label:C,filterOptions:z})=>{const F=z.flatMap(({value:T,minValue:N,maxValue:M})=>[N,M,T]).filter(Boolean),R=z.flatMap(({options:T})=>T??[]).filter(({checked:T=!1})=>T).map(({value:T})=>T),D=[...F,...R];return D.length===0?j:{...j,[C]:D}},{});h(k),p.length>0&&o&&o("column")},[p,e,o]),u.useEffect(()=>{s==null||s(p.length>0)},[p.length,s]),n==="grouped"?t.jsx($,{display:"flex",flexDirection:"row",maxHeight:p.length>0?"unset":"360px",style:{rowGap:"10px",writingMode:"vertical-lr"},wrap:"wrap",children:p.length>0?t.jsx(tt,{id:"filters-options",onSearch:r,onSubmit:v,options:p,selectedFilter:b}):Object.entries(yt(e)).map(([k,j])=>t.jsxs($,{style:{writingMode:"horizontal-tb"},children:[t.jsx(I,{color:l.palette.gray[400],fontWeight:"bold",mb:.25,size:"md",children:k}),j.map(({label:C,icon:z="filter-list"})=>S(C,z))]},k))}):t.jsx($,{display:"flex",flexDirection:"row",maxHeight:p.length>0?"unset":"200px",style:{rowGap:"10px",writingMode:"vertical-lr"},wrap:"wrap",children:p.length>0?t.jsx(tt,{id:"filters-options",onSearch:r,onSubmit:v,options:p,selectedFilter:b}):e.map(({label:k,icon:j="filter-list"})=>S(k,j))})},Fn=({options:e,onApplyFilters:n,onSearch:i,modalRef:r,variant:o})=>{const[a,s]=u.useState("row"),[l,c]=u.useState(!0),[d,p]=u.useState(!1),x=(o==="grouped"?Object.values(yt(e)).reduce((w,v)=>w+v.length,0):e.length)>5&&!d,h=f.useTheme(),b=u.useRef(null),m=t.jsx(_,{icon:"close",iconColor:h.palette.gray[400],iconSize:"lg",iconTransform:"grow-2",iconType:"fa-light",id:"modal-close",onClick:r.close,px:.25,py:.25,variant:"ghost"});return u.useEffect(()=>{const w=v=>{const S=b.current;S&&!S.contains(v.target)&&r.close()};if(l)return document.addEventListener("mousedown",w,!0),()=>{document.removeEventListener("mousedown",w,!0)}},[b,l,r]),t.jsx(Zo,{$bgColor:"transparent","aria-label":r.name,children:t.jsxs(ht,{$size:"fixed",alignItems:a==="row"?"start":"end",display:"flex",flexDirection:a,gap:.5,id:"filters-list",justify:"space-between",position:"relative",px:1.25,py:1.25,ref:b,style:{maxWidth:"620px",overflow:"hidden",width:"fit-content",paddingBottom:x?"0":void 0},children:[a==="column"?m:void 0,t.jsx(Rn,{onApplyFilters:n,onFilterStateChange:p,onSearch:i,options:e,setDirection:s,setHandler:c,variant:o}),a==="row"?m:void 0]})})};function Xo(e){if(!e)return;const n=20;if(e.length<=n)return e;const i=n-3,r=Math.ceil(i/2),o=Math.floor(i/2);return`${e.slice(0,r)}...${e.slice(e.length-o)}`}function Nn(e){if(!e||e.length===0)return;const n=e.filter(l=>l.checked).map(l=>l.label??l.value);if(n.length===0)return;const i=(l,c=20)=>{if(l.length<=c)return l;const d=c-3,p=Math.ceil(d/2),g=Math.floor(d/2);return`${l.slice(0,p)}...${l.slice(l.length-g)}`};if(n.length===1){const l=n[0];return l.length>20?i(l,20):l}if(n.length===2){const l=n[0],c=n.join(", ").length;return l.length>20||c>20?`${i(l,20)} +1 more`:`${n[0]}, ${n[1]}`}const r=n[0],o=n.length-1,a=20,s=n.join(", ").length;return r.length>a||s>a?`${i(r,a)} +${o} more`:`${n[0]}, ${n[1]}`}function qo(e,n,i){const r=i??"",o=y._.isEmpty(e)&&typeof e!="number"||Number.isNaN(e)?void 0:Number(e),a=y._.isEmpty(n)&&typeof n!="number"||Number.isNaN(n)?void 0:Number(String(n));if(!y._.isUndefined(o)&&!y._.isUndefined(a))return`${o}${r} - ${a}${r}`;if(!y._.isUndefined(o))return`Min ${o}${r}`;if(!y._.isUndefined(a))return`Max ${a}${r}`}function Jo(e,n){if(y.dayjs_minExports.extend(y.localizedFormat),!(y._.isUndefined(e)&&y._.isUndefined(n))){if(e!==""&&n!==""&&!y._.isUndefined(e)&&!y._.isUndefined(n))return`${y.dayjs(e).format("LL")} - ${y.dayjs(n).format("LL")}`;if(e!==""&&!y._.isUndefined(e))return`From ${y.dayjs(e).format("LL")}`;if(n!==""&&!y._.isUndefined(n))return`To ${y.dayjs(n).format("LL")}`}}function Qo(e,n,i){return e==="select"?n:`${n} ${i==="includesInsensitive"?"contains":"is"}`}const xe=({filter:e,icon:n="filter-list",label:i,onClose:r,filterValue:o})=>{if(y._.isNil(o)||y._.isEmpty(String(o)))return null;const a=e.type==="checkboxes"?(e.options??[]).filter(c=>c.checked).map(c=>c.label??c.value):[],{tooltipContent:s,shouldShowTooltip:l}=(()=>{var d,p,g;if(a.length>0){if(a.length===1){const m=(((d=a[0])==null?void 0:d.length)??0)>20;return{shouldShowTooltip:m,tooltipContent:m?a[0]:void 0}}if(a.length===2){const m=((p=a[0])==null?void 0:p.length)??0,w=a.join(", ").length,v=m>20||w>20;return{shouldShowTooltip:v,tooltipContent:v?a:void 0}}const x=((g=a[0])==null?void 0:g.length)??0,h=a.join(", ").length,b=x>20||h>20;return{shouldShowTooltip:b,tooltipContent:b?a:void 0}}const c=e.value;return typeof c=="string"&&c.length>20?{shouldShowTooltip:!0,tooltipContent:c}:{shouldShowTooltip:!1,tooltipContent:void 0}})();return t.jsx(K,{disabled:!l,id:"applied-filter-tooltip",nodeTip:l?Array.isArray(s)?t.jsx($,{display:"flex",flexDirection:"column",gap:.25,children:s.map(c=>t.jsxs($,{alignItems:"flex-start",display:"flex",gap:.5,children:[t.jsx("span",{children:"•"}),t.jsx($,{whiteSpace:"normal",wordWrap:"break-word",children:c})]},c))}):t.jsx($,{whiteSpace:"normal",wordWrap:"break-word",children:s}):void 0,children:t.jsx(q,{filterValues:o,icon:n,id:"remove-filter",onClose:r(e),tagLabel:`${i} `})})},ea=({options:e,onClose:n})=>{const i=e.flatMap(r=>r.filterOptions.map(o=>{const{filterFn:a,label:s,type:l,value:c,options:d,minValue:p,maxValue:g}=o;switch(l){case"numberRange":{const x=qo(p,g,r.placeholder);return t.jsx(xe,{filter:o,filterValue:x,icon:r.icon,label:r.label,onClose:n},s)}case"dateRange":{const x=Jo(p==null?void 0:p.toString(),g==null?void 0:g.toString());return t.jsx(xe,{filter:o,filterValue:x,icon:r.icon,label:r.label,onClose:n},s)}case"radioButton":case"checkboxes":{const x=Nn(d);return t.jsx(xe,{filter:o,filterValue:x,icon:r.icon,label:r.label,onClose:n},s)}case void 0:case"select":case"text":default:{const x=Xo(c),h=Qo(l,r.label,a);return t.jsx(xe,{filter:o,filterValue:x,icon:r.icon,label:h,onClose:n},s)}}})).filter(r=>{if(r===null)return!1;const{filterValue:o}=r.props;return!y._.isNil(o)&&!y._.isEmpty(String(o))});return i.length>0?t.jsx($,{alignItems:"center",display:"flex",gap:.5,pb:1,width:"100%",wrap:"wrap",children:i}):null},ta=e=>e.map(n=>{const i={key:String(n.key),type:n.type},r=(()=>{let o={...i};if(n.filterFn&&(o={...o,filterFn:n.filterFn}),n.value&&(o={...o,value:n.value}),n.minValue!==void 0&&n.minValue!==null&&(o={...o,minValue:n.minValue}),n.maxValue!==void 0&&n.maxValue!==null&&(o={...o,maxValue:n.maxValue}),n.options&&n.options.length>0){const a=n.options.filter(s=>s.checked).map(s=>s.value);a.length>0&&(o={...o,selectedValues:a})}return o})();return Object.keys(r).length>2?r:null}).filter(Boolean),na=(e,n)=>n.map(i=>{const r=e.find(a=>a.key===String(i.key)&&a.type===i.type);return r?(()=>{let a={...i};return r.filterFn&&(a={...a,filterFn:r.filterFn}),r.value!==void 0&&r.value!==null&&(a={...a,value:r.value}),r.minValue!==void 0&&r.minValue!==null&&(a={...a,minValue:r.minValue}),r.maxValue!==void 0&&r.maxValue!==null&&(a={...a,maxValue:r.maxValue}),r.selectedValues&&i.options&&(a={...a,options:i.options.map(s=>{var l;return{...s,checked:((l=r.selectedValues)==null?void 0:l.includes(s.value))??!1}})}),a})():i}),Ke=(e,n)=>{const i=ta(e);n(JSON.stringify(i))},ia=(e,n)=>{const i=e();if(!i)return n;try{const r=JSON.parse(i);return na(r,n)}catch{return n}},ra=(e,n)=>{function i(s,l){if(l.value===""||l.value===void 0||y._.defaultTo(l.isBackFilter,!1))return!0;switch(l.filterFn){case"includesInsensitive":return String(s[l.key]).toLowerCase().includes(l.value.toLowerCase());case"caseInsensitive":case void 0:default:return String(s[l.key]).toLowerCase()===l.value.toLowerCase()}}function r(s,l){if(!l.options||l.options.length===0)return!0;const c=l.options.filter(d=>d.checked).map(d=>d.value);return c.length===0?!0:c.includes(String(s[l.key]))}function o(s,l,c){const d=c(String(s[l.key])),{minValue:p,maxValue:g}=l,x=y._.isEmpty(p)&&typeof p!="number"?void 0:c(String(p)),h=y._.isEmpty(g)&&typeof g!="number"?void 0:c(String(g));return y._.isUndefined(x)&&y._.isUndefined(h)?!0:(x??-1/0)<=d&&d<=(h??1/0)}function a(s){return n.every(l=>{if(typeof l.key=="function")return l.key(s,l.value);switch(l.type){case"radioButton":case"checkboxes":return r(s,l);case"numberRange":return o(s,l,Number);case"dateRange":return o(s,l,c=>new Date(c));case"select":case"text":default:return i(s,l)}})}return e.filter(a)},oa=e=>[...e.flatMap(({options:i})=>i).filter(i=>i==null?void 0:i.checked),...e.flatMap(i=>[i.value,i.maxValue,i.minValue]).filter(Boolean)].length,aa=e=>{var i;const n=((i=e.options)==null?void 0:i.map(r=>({...r,checked:void 0})))??void 0;return{...e,minValue:void 0,maxValue:void 0,value:void 0,options:n}},sa=({dataset:e,setValues:n,getValues:i,options:r,setFilteredDataset:o,onFiltersChange:a,onReset:s,onSearch:l,variant:c="ungrouped"})=>{const d=De("filters-modal"),[p,g]=u.useState(!1),[x,h]=u.useState([]),b=oa(x),m=r.map(j=>({...j,filterOptions:j.filterOptions.map(C=>x.find(F=>F.key===C.key&&F.type===C.type&&F.filterFn===C.filterFn)??{...C})})),w=u.useCallback(j=>{h([...j]),Ke(j,n)},[h,n]),v=u.useCallback(()=>{s&&s(),d.isOpen||g(!0),d.toggle()},[d,s]),S=u.useCallback(j=>()=>{s&&s();const C=x.map(z=>z.key===j.key&&z.type===j.type&&z.filterFn===j.filterFn?aa(z):z);h(C),Ke(C,n)},[x,s,n]);return u.useEffect(()=>{const j=r.flatMap(F=>F.filterOptions),C=i();if((()=>{if(!C)return!1;try{const F=JSON.parse(C);return Array.isArray(F)&&F.length>0}catch{return!1}})()){const F=ia(i,j);h(F)}else j.flatMap(R=>R.value).filter(Boolean).length>0||j.flatMap(R=>R.options).filter(R=>(R==null?void 0:R.checked)===!0).length>0?(h(j),p&&Ke(j,n)):h(j)},[r,h,n,i,p]),u.useEffect(()=>{o&&e!==void 0&&o(ra(e,x)),a==null||a(x)},[e,x,o,a]),{Filters:()=>t.jsxs($,{alignItems:"center",display:"flex",gap:.25,maxWidth:"100%",position:"relative",wrap:"wrap",children:[t.jsx($,{pr:.25,children:t.jsx(O,{icon:"filter",id:"filter-btn",onClick:v,tag:b.toString(),variant:"ghost"})}),d.isOpen&&t.jsx(Fn,{modalRef:d,onApplyFilters:w,onSearch:l,options:m,variant:c})]}),options:m,removeFilter:S}},bt=({_portal:e=!0,alert:n,cancelButton:i=void 0,children:r=void 0,confirmButton:o=void 0,content:a=void 0,description:s=void 0,modalRef:l,otherActions:c=void 0,onClose:d=void 0,tabItems:p=void 0,title:g=void 0,size:x,id:h="modal-container"})=>{const b=f.useTheme(),[m,w]=u.useState(void 0),v=u.useRef(null),S=u.useRef(!1),k=Array.isArray(p)&&p.length>0,j=i??o;u.useEffect(()=>{if(k&&!S.current&&v.current){const z=v.current.getBoundingClientRect().height;z>50&&(w(z),S.current=!0)}l.isOpen||(w(void 0),S.current=!1)},[k,l.isOpen]);const C=t.jsx(mn,{"aria-label":l.name,"aria-modal":"true",id:"modal-wrapper",children:t.jsxs(ht,{$size:x,"data-testid":h,flexDirection:"column",id:h,ref:k?v:void 0,style:k&&m?{height:m}:void 0,children:[!y._.isEmpty(g)&&!y._.isNil(g)&&t.jsx(jn,{description:s,modalRef:l,onClose:d,otherActions:c,title:g}),p&&t.jsx($,{borderTop:`1px solid ${b.palette.gray[300]}`,display:"block",mb:1.25,position:"sticky",children:t.jsx(ft,{items:p})}),(y._.isObject(a)||r)&&t.jsxs(Ro,{style:j?{borderBottom:`1px solid ${b.palette.gray[200]}`}:void 0,children:[r,y._.isObject(a)&&y._.isString(a.imageSrc)&&t.jsx(Lo,{$framed:a.imageFramed,children:t.jsx(Q,{alt:"modal-img",publicId:a.imageSrc})}),y._.isObject(a)&&y._.isString(a.imageText)&&t.jsx(I,{size:"md",children:a.imageText})]}),t.jsx(wn,{alert:n,cancelButton:i,confirmButton:o,modalRef:l})]})});return e&&l.isOpen?ce.createPortal(C,document.getElementById("portals")??document.body):l.isOpen?C:null},la=(e,n,i)=>{const r=De("confirm-dialog-modal"),o=u.useRef(null),a=u.useCallback(async()=>(r.open(),new Promise(d=>{o.current=d})),[r]),s=u.useCallback(()=>{var d;r.close(),(d=o.current)==null||d.call(o,!0)},[r]),l=u.useCallback(()=>{var d;r.close(),(d=o.current)==null||d.call(o,!1)},[r]);return[a,({children:d})=>{const[p,g]=u.useState(i),x=u.useCallback(()=>{g({...i})},[]),h=u.useCallback(w=>()=>{g(v=>({...v,[w]:{...v[w],state:!v[w].state}}))},[]),b=!Object.values(p).every(({state:w})=>w),m=Object.entries(p).map(([w,{state:v,label:S}])=>t.jsx(ae,{defaultChecked:v,label:S,name:w,onChange:h(w)},w));return t.jsxs(bt,{"data-testid":e,id:e,modalRef:{...r,close:l},onClose:x,size:"sm",title:n,children:[d,t.jsx($,{display:"flex",flexDirection:"column",gap:.5,children:m}),t.jsx(vn,{disabled:b,id:e,onConfirm:s})]})}]},ca=()=>{const[e,n]=u.useState(!1),[i,r]=u.useState(),o=u.useRef(null),a=De("confirm-dialog-modal"),s=u.useCallback(async p=>(r(p),n(!0),new Promise(g=>{o.current=g})),[]),l=u.useCallback(()=>{var p;n(!1),r(void 0),(p=o.current)==null||p.call(o,!0)},[]),c=u.useCallback(()=>{var p;n(!1),r(void 0),(p=o.current)==null||p.call(o,!1)},[]);return u.useEffect(()=>{a.setIsOpen(e)},[e,a]),{ConfirmDialog:({id:p="confirm-dialog-modal",children:g})=>t.jsxs(bt,{cancelButton:{onClick:c,text:"Cancel"},confirmButton:{id:(i==null?void 0:i.id)??"modal-confirm",onClick:l,text:"Confirm"},description:i==null?void 0:i.message,id:p,modalRef:{...a,close:c},size:"sm",title:i==null?void 0:i.title,children:[i==null?void 0:i.content,g]}),confirm:s}},da=2e3,pa=({content:e})=>{const[n,i]=u.useState("Copy"),r=u.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{i("Copied"),setTimeout(()=>{i("Copy")},da)}).catch(()=>{i("Failed to copy")})},[e]);return t.jsx(_,{icon:"copy",iconSize:"lg",iconType:"fa-light",onClick:r,tooltip:n,variant:"ghost"})},ga=f.styled.ul`
|
|
2156
2156
|
${({theme:e})=>`
|
|
2157
2157
|
align-items: flex-start;
|
|
2158
2158
|
border-radius: ${e.spacing[.25]};
|
|
@@ -2523,7 +2523,7 @@ ${m[8]}...`:(m.length<8&&p(!1),i)},[l,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2523
2523
|
color: ${e.palette.white};
|
|
2524
2524
|
}
|
|
2525
2525
|
`}
|
|
2526
|
-
`,oe=({children:e,disabled:n,hasIcon:i=!1,selected:r,onClick:o})=>t.jsx(ns,{...r?{className:"selected"}:{},$hasIcon:i,disabled:n,onClick:n||r?void 0:o,children:e}),is=[10,20,50,100],Mn=({totalItems:e,pageSize:n,setPageSize:i,setTotalPages:r})=>{const o=f.useTheme(),[a,s]=u.useState(!1),{refs:l,floatingStyles:c}=y.useFloating({middleware:[y.flip(),y.offset({mainAxis:4})],placement:"top-end",whileElementsMounted:y.autoUpdate}),d=u.useCallback(()=>{s(g=>!g)},[]),p=u.useCallback(g=>()=>{i(g),r(Math.ceil(e/g)),s(!1)},[i,r,e]);return X(l.reference.current,()=>{s(!1)},!0,l.floating.current),t.jsxs(u.Fragment,{children:[t.jsxs($,{alignItems:"center",bgColor:o.palette.white,border:"1px solid",borderColor:o.palette.gray[200],borderRadius:o.spacing[.25],display:"flex",gap:.125,px:.25,py:.125,children:[t.jsx(I,{size:"md",children:n}),t.jsx(_,{color:o.palette.gray[400],icon:a?"chevron-up":"chevron-down",iconSize:"sm",iconType:"fa-light",id:"paginator-dropdown",onClick:d,px:.125,py:.125,ref:l.setReference,variant:"ghost"})]}),a?t.jsx($,{bgColor:o.palette.white,border:`1px solid ${o.palette.gray[200]}`,borderRadius:o.spacing[.5],display:"flex",flexDirection:"column",px:.25,py:.25,ref:l.setFloating,shadow:"md",style:c,children:is.map(g=>{const x=p(g);return t.jsx($,{bgColor:n===g?o.palette.gray[800]:"transparent",bgColorHover:o.palette.gray[n===g?800:100],borderRadius:o.spacing["0.25"],cursor:"pointer",maxWidth:"40px",minWidth:"40px",onClick:x,px:.25,py:.25,children:t.jsx(I,{color:n===g?o.palette.white:o.palette.gray[600],size:"md",textAlign:"center",children:g})},`${g}-${y.random(10)}`)})}):void 0]})},rs=(e,n)=>{if(n<=7)return{pages:Array.from({length:n},(o,a)=>a+1),ellipsis:{start:!1,middle:!1,end:!1}};if(e<=3||e>=n-2){const o=[1,2,3],a=[n-2,n-1,n];return{pages:[...o,...a],ellipsis:{start:!1,middle:!0,end:!1}}}return{pages:[1,...Array.from({length:5},(o,a)=>e-2+a),n],ellipsis:{start:!0,middle:!1,end:!0}}},os=({totalItems:e,totalPages:n,page:{pageIndex:i,pageSize:r,setPageIndex:o,setPageSize:a},onPageChange:s})=>{const l=f.useTheme(),[c,d]=u.useState(n),p=i*r,g=i===1,x=i===c,{pages:h,ellipsis:{start:b,middle:m,end:w}}=rs(i,c),v=u.useCallback(C=>()=>{o(C===0?1:c),s==null||s(C)},[o,c,s]),S=u.useCallback(C=>()=>{o(C),s==null||s(C)},[o,s]),k=u.useCallback(()=>{i>1&&(o(i-1),s==null||s(i-1))},[i,o,s]),j=u.useCallback(()=>{i<c&&(o(i+1),s==null||s(i+1))},[i,c,o,s]);return t.jsxs($,{alignItems:"center",as:"nav",display:"flex",justify:"space-between",py:.875,children:[t.jsx(I,{color:l.palette.gray[800],display:"inline",size:"md",children:`${p-r+1}-${p} of ${e} items`}),t.jsxs($,{alignItems:"center",display:"flex",gap:1,children:[t.jsx(oe,{disabled:g,hasIcon:!0,onClick:v(0),children:t.jsx(E,{icon:"angles-left",iconSize:"sm",iconType:"fa-light"})}),t.jsx(oe,{disabled:g,hasIcon:!0,onClick:k,children:t.jsx(E,{icon:"angle-left",iconSize:"sm",iconType:"fa-light"})}),h.map((C,z,F)=>{const
|
|
2526
|
+
`,oe=({children:e,disabled:n,hasIcon:i=!1,selected:r,onClick:o})=>t.jsx(ns,{...r?{className:"selected"}:{},$hasIcon:i,disabled:n,onClick:n||r?void 0:o,children:e}),is=[10,20,50,100],Mn=({totalItems:e,pageSize:n,setPageSize:i,setTotalPages:r})=>{const o=f.useTheme(),[a,s]=u.useState(!1),{refs:l,floatingStyles:c}=y.useFloating({middleware:[y.flip(),y.offset({mainAxis:4})],placement:"top-end",whileElementsMounted:y.autoUpdate}),d=u.useCallback(()=>{s(g=>!g)},[]),p=u.useCallback(g=>()=>{i(g),r(Math.ceil(e/g)),s(!1)},[i,r,e]);return X(l.reference.current,()=>{s(!1)},!0,l.floating.current),t.jsxs(u.Fragment,{children:[t.jsxs($,{alignItems:"center",bgColor:o.palette.white,border:"1px solid",borderColor:o.palette.gray[200],borderRadius:o.spacing[.25],display:"flex",gap:.125,px:.25,py:.125,children:[t.jsx(I,{size:"md",children:n}),t.jsx(_,{color:o.palette.gray[400],icon:a?"chevron-up":"chevron-down",iconSize:"sm",iconType:"fa-light",id:"paginator-dropdown",onClick:d,px:.125,py:.125,ref:l.setReference,variant:"ghost"})]}),a?t.jsx($,{bgColor:o.palette.white,border:`1px solid ${o.palette.gray[200]}`,borderRadius:o.spacing[.5],display:"flex",flexDirection:"column",px:.25,py:.25,ref:l.setFloating,shadow:"md",style:c,children:is.map(g=>{const x=p(g);return t.jsx($,{bgColor:n===g?o.palette.gray[800]:"transparent",bgColorHover:o.palette.gray[n===g?800:100],borderRadius:o.spacing["0.25"],cursor:"pointer",maxWidth:"40px",minWidth:"40px",onClick:x,px:.25,py:.25,children:t.jsx(I,{color:n===g?o.palette.white:o.palette.gray[600],size:"md",textAlign:"center",children:g})},`${g}-${y.random(10)}`)})}):void 0]})},rs=(e,n)=>{if(n<=7)return{pages:Array.from({length:n},(o,a)=>a+1),ellipsis:{start:!1,middle:!1,end:!1}};if(e<=3||e>=n-2){const o=[1,2,3],a=[n-2,n-1,n];return{pages:[...o,...a],ellipsis:{start:!1,middle:!0,end:!1}}}return{pages:[1,...Array.from({length:5},(o,a)=>e-2+a),n],ellipsis:{start:!0,middle:!1,end:!0}}},os=({totalItems:e,totalPages:n,page:{pageIndex:i,pageSize:r,setPageIndex:o,setPageSize:a},onPageChange:s})=>{const l=f.useTheme(),[c,d]=u.useState(n),p=i*r,g=i===1,x=i===c,{pages:h,ellipsis:{start:b,middle:m,end:w}}=rs(i,c),v=u.useCallback(C=>()=>{o(C===0?1:c),s==null||s(C)},[o,c,s]),S=u.useCallback(C=>()=>{o(C),s==null||s(C)},[o,s]),k=u.useCallback(()=>{i>1&&(o(i-1),s==null||s(i-1))},[i,o,s]),j=u.useCallback(()=>{i<c&&(o(i+1),s==null||s(i+1))},[i,c,o,s]);return t.jsxs($,{alignItems:"center",as:"nav",display:"flex",justify:"space-between",py:.875,children:[t.jsx(I,{color:l.palette.gray[800],display:"inline",size:"md",children:`${p-r+1}-${p} of ${e} items`}),t.jsxs($,{alignItems:"center",display:"flex",gap:1,children:[t.jsx(oe,{disabled:g,hasIcon:!0,onClick:v(0),children:t.jsx(E,{icon:"angles-left",iconSize:"sm",iconType:"fa-light"})}),t.jsx(oe,{disabled:g,hasIcon:!0,onClick:k,children:t.jsx(E,{icon:"angle-left",iconSize:"sm",iconType:"fa-light"})}),h.map((C,z,F)=>{const R=C===1,D=C===c,T=b&&R&&z===0,N=w&&D&&z===h.length-1,M=m&&z===F.length/2-1;return t.jsxs(t.Fragment,{children:[N&&t.jsx(oe,{disabled:!0,children:"..."}),t.jsx(oe,{onClick:S(C),selected:i===C,children:C}),(T||M)&&t.jsx(oe,{disabled:!0,children:"..."})]})}),t.jsx(oe,{disabled:x,hasIcon:!0,onClick:j,children:t.jsx(E,{icon:"angle-right",iconSize:"sm",iconType:"fa-light"})}),t.jsx(oe,{disabled:x,hasIcon:!0,onClick:v(-1),children:t.jsx(E,{icon:"angles-right",iconSize:"sm",iconType:"fa-light"})})]}),t.jsxs($,{alignItems:"center",display:"flex",gap:1,children:[t.jsx(Mn,{pageSize:r,setPageSize:a,setTotalPages:d,totalItems:e}),t.jsx(I,{color:l.palette.gray[800],display:"inline",size:"md",children:"Items per page"})]})]})},as=f.styled.div`
|
|
2527
2527
|
${({theme:e})=>`
|
|
2528
2528
|
height: ${e.spacing[1]};
|
|
2529
2529
|
width: ${e.spacing[1]};
|
|
@@ -2736,7 +2736,7 @@ ${m[8]}...`:(m.length<8&&p(!1),i)},[l,i,n]),h=u.useMemo(x,[x]),b=u.useCallback(a
|
|
|
2736
2736
|
padding: ${e.spacing[.75]};
|
|
2737
2737
|
color: ${e.palette.gray[500]};
|
|
2738
2738
|
`}
|
|
2739
|
-
`,Ds=300,Es=({name:e,items:n=[],renderItem:i,onSelectItem:r,onClear:o,onChange:a,value:s,maxLength:l=Ds,emptyText:c="No results",openOnFocus:d=!0,...p})=>{const g=f.useTheme(),x=u.useRef(null),[h,b]=u.useState(!1),[m,w]=u.useState(String(s??""));u.useEffect(()=>{w(String(s??""))},[s]);const{refs:v,floatingStyles:S}=y.useFloating$1({placement:"bottom-start"});X(v.floating.current,()=>b(!1),!0);const k=u.useCallback(()=>{d&&b(!0)},[d]),j=u.useCallback(T=>{const N=T.target.value;if(N.length>l){w(N.slice(0,l));return}w(N),a==null||a(T),b(!0)},[a,l]),C=u.useCallback(()=>{var T;w(""),o==null||o(),a&&a({target:{value:""},currentTarget:{value:""}}),(T=x.current)==null||T.focus(),b(!1)},[o,a]),z=u.useCallback(T=>{const N=Number(T.currentTarget.dataset.index),
|
|
2739
|
+
`,Ds=300,Es=({name:e,items:n=[],renderItem:i,onSelectItem:r,onClear:o,onChange:a,value:s,maxLength:l=Ds,emptyText:c="No results",openOnFocus:d=!0,...p})=>{const g=f.useTheme(),x=u.useRef(null),[h,b]=u.useState(!1),[m,w]=u.useState(String(s??""));u.useEffect(()=>{w(String(s??""))},[s]);const{refs:v,floatingStyles:S}=y.useFloating$1({placement:"bottom-start"});X(v.floating.current,()=>b(!1),!0);const k=u.useCallback(()=>{d&&b(!0)},[d]),j=u.useCallback(T=>{const N=T.target.value;if(N.length>l){w(N.slice(0,l));return}w(N),a==null||a(T),b(!0)},[a,l]),C=u.useCallback(()=>{var T;w(""),o==null||o(),a&&a({target:{value:""},currentTarget:{value:""}}),(T=x.current)==null||T.focus(),b(!1)},[o,a]),z=u.useCallback(T=>{const N=Number(T.currentTarget.dataset.index),M=n[N];r==null||r(M),b(!1)},[n,r]),F=h&&(m.trim().length>0||n.length>0),R=u.useMemo(()=>n.length===0?t.jsx(Is,{children:c}):t.jsx(zs,{role:"listbox",children:n.map((T,N)=>t.jsx(Ts,{onClick:z,role:"option",children:i(T)},N))}),[n,c,i,z]),D=u.useCallback(T=>{T.key==="Escape"&&b(!1)},[]);return t.jsxs(vs,{ref:v.setReference,children:[t.jsxs(ks,{children:[t.jsx(E,{icon:"magnifying-glass",iconColor:g.palette.gray[700],iconSize:"lg",iconType:"fa-light"}),t.jsx(Cs,{"aria-expanded":F,id:e,maxLength:l,name:e,onChange:j,onFocus:k,onKeyDown:D,ref:x,type:"search",value:m,...p}),!y.lodashExports.isEmpty(m)&&t.jsx(_,{icon:"xmark",iconColor:g.palette.gray[300],iconSize:"lg",iconType:"fa-light",onClick:C,px:.25,py:.25,type:"reset",variant:"ghost"})]}),F?t.jsx(Ss,{ref:v.setFloating,style:S,children:R}):void 0]})},Rs=(e,n)=>{const i={critical:A.palette.primary[700],high:A.palette.error[500],low:A.palette.warning[200],medium:A.palette.warning[500],none:A.palette.gray[200]},r={disabled:A.palette.gray[400],enabled:A.palette.gray[800]},o={critical:A.palette.white,high:A.palette.white,low:A.palette.gray[800],medium:A.palette.gray[800],none:A.palette.gray[400]};return{iconColor:n<1?i.none:i[e],iconText:y.lodashExports.capitalize(e.charAt(0)),iconTextColor:n<1?o.none:o[e],textColor:n<1?r.disabled:r.enabled}},he=({variant:e,value:n})=>{const{iconColor:i,iconText:r,iconTextColor:o,textColor:a}=Rs(e,n),s=y.lodashExports.capitalize(e.charAt(0))+e.slice(1);return t.jsxs($,{alignItems:"center",display:"inline-flex",gap:.5,minWidth:"43px",children:[t.jsx(K,{id:s,place:"top",tip:s,children:t.jsx($,{alignItems:"center",bgColor:i,borderRadius:"4px",cursor:"pointer",display:"flex",height:"22px",maxWidth:"22px",minWidth:"22px",children:t.jsx(I,{color:o,size:"md",textAlign:"center",children:r})})}),t.jsx(I,{color:a,size:"md",children:n})]})},Fs=({critical:e,high:n,medium:i,low:r})=>t.jsxs($,{alignItems:"center",display:"inline-flex",gap:1,children:[t.jsx(he,{value:e,variant:"critical"}),t.jsx(he,{value:n,variant:"high"}),t.jsx(he,{value:i,variant:"medium"}),t.jsx(he,{value:r,variant:"low"})]}),Ns=f.styled.div`
|
|
2740
2740
|
${({theme:e})=>`
|
|
2741
2741
|
border-radius: ${e.spacing[.25]};
|
|
2742
2742
|
cursor: pointer;
|
package/dist/hooks/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../components-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../components-ugedtsd3.js");exports.useCarousel=e.useCarousel;exports.useClickOutside=e.useClickOutside;exports.useCloudinaryImage=e.useCloudinaryImage;exports.useColumnsModal=e.useColumnsModal;exports.useDebouncedCallback=e.useDebouncedCallback;exports.useModal=e.useModal;exports.useSearch=e.useSearch;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/index.css');const e=require("./components-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./assets/index.css');const e=require("./components-ugedtsd3.js"),t=require("./vendor-D--QYeGr.js");exports.Accordion=e.Accordion;exports.AdvisoriesCard=e.AdvisoriesCard;exports.Alert=e.Alert;exports.AppliedFilters=e.AppliedFilters;exports.Avatar=e.Avatar;exports.BaseButtonComponent=e.BaseButtonComponent;exports.BaseComponent=e.BaseComponent;exports.BaseSpanComponent=e.BaseSpanComponent;exports.BaseTextComponent=e.BaseTextComponent;exports.Button=e.Button;exports.ButtonToolbarCenter=e.ButtonToolbarCenter;exports.ButtonToolbarRow=e.ButtonToolbarRow;exports.ButtonToolbarStartRow=e.ButtonToolbarStartRow;exports.CardContainer=e.CardContainer;exports.CardHeader=e.CardHeader;exports.CardWithImage=e.CardWithImage;exports.CardWithInput=e.CardWithInput;exports.CardWithOptions=e.CardWithOptions;exports.CardWithSelector=e.CardWithSelector;exports.CardWithSwitch=e.CardWithSwitch;exports.Carousel=e.Carousel;exports.Checkbox=e.Checkbox;exports.CloudImage=e.MemoizedImage;exports.CodeSnippet=e.CodeSnippet;exports.Col=e.Col;exports.ColumFilters=e.ColumFilters;exports.ColumnsModal=e.ColumnsModal;exports.ComboBox=e.ComboBox;exports.Container=e.Container;exports.CopyButton=e.CopyButton;exports.CustomThemeProvider=e.CustomThemeProvider;exports.Divider=e.Divider;exports.Dropdown=e.Dropdown;exports.Editable=e.Editable;exports.EmptyState=e.EmptyState;exports.ErrorMessage=e.ErrorMessage;exports.FATag=e.FATag;exports.FilePreview=e.FilePreview;exports.Form=e.Form;exports.Gap=e.Gap;exports.GridContainer=e.GridContainer;exports.GroupSelector=e.GroupSelector;exports.Heading=e.Heading;exports.Icon=e.Icon;exports.IconButton=e.IconButton;exports.IndicatorCard=e.IndicatorCard;exports.IndicatorCardDB=e.IndicatorCardDB;exports.InfoSidebar=e.InfoSidebar;exports.InnerForm=e.InnerForm;exports.InputArray=e.InputArray;exports.InputDate=e.InputDate;exports.InputDateRange=e.InputDateRange;exports.InputDateTime=e.InputDateTime;exports.InputFile=e.InputFile;exports.InputNumber=e.InputNumber;exports.InputNumberRange=e.InputNumberRange;exports.InputTags=e.InputTags;exports.ItemCardDB=e.ItemCardDB;exports.ItemContent=e.ItemContent;exports.Link=e.Link;exports.ListItem=e.ListItem;exports.ListItemsWrapper=e.ListItemsWrapper;exports.LittleFlag=e.LittleFlag;exports.Loading=e.Loading;exports.Logo=e.Logo;exports.Lottie=e.Lottie;exports.Menu=e.Menu;exports.MessageBanner=e.MessageBanner;exports.Modal=e.Modal;exports.ModalConfirm=e.ModalConfirm;exports.ModalFooter=e.ModalFooter;exports.Notification=e.Notification;exports.NotificationSign=e.NotificationSign;exports.OAuthSelector=e.OAuthSelector;exports.OptionContainer=e.OptionContainer;exports.OutlineContainer=e.OutlineContainer;exports.PaginatorDb=e.PaginatorDb;exports.PhoneInput=e.PhoneInput;exports.PopUp=e.PopUp;exports.PremiumFeature=e.PremiumFeature;exports.PriorityCards=e.PriorityCards;exports.PriorityScore=e.PriorityScore;exports.ProgressBar=e.ProgressBar;exports.ProgressIndicator=e.ProgressIndicator;exports.ProgressStep=e.ProgressStep;exports.RadioButton=e.RadioButton;exports.RankPosition=e.RankPosition;exports.Row=e.Row;exports.ScrollUpButton=e.ScrollUpButton;exports.Search=e.Search;exports.SearchDropdown=e.SearchDropdown;exports.SeverityBadge=e.SeverityBadge;exports.SeverityOverview=e.SeverityOverview;exports.ShowOnHover=e.ShowOnHover;exports.SlideOutMenu=e.SlideOutMenu;exports.Slider=e.Slider;exports.Span=e.Span;exports.StepLapse=e.StepLapse;exports.Table=e.Table;exports.TableButton=e.TableButton;exports.TableContent=e.TableContent;exports.Tabs=e.Tabs;exports.Tag=e.Tag;exports.Text=e.Text;exports.TextArea=e.TextArea;exports.TextInput=e.TextInput;exports.TimeLine=e.TimeLine;exports.TimeLineCard=e.TimeLineCard;exports.Toggle=e.Toggle;exports.Tooltip=e.Tooltip;exports.Tour=e.Tour;exports.WeaknessesCard=e.WeaknessesCard;exports.baseStep=e.baseStep;exports.formatCheckValues=e.formatCheckValues;exports.getStyledConfig=e.getStyledConfig;exports.hiddenProps=e.hiddenProps;exports.icons=e.icons;exports.setBorder=e.setBorder;exports.setDisplay=e.setDisplay;exports.setInteraction=e.setInteraction;exports.setMargin=e.setMargin;exports.setPadding=e.setPadding;exports.setPosition=e.setPosition;exports.setText=e.setText;exports.theme=e.theme;exports.useCarousel=e.useCarousel;exports.useClickOutside=e.useClickOutside;exports.useCloudinaryImage=e.useCloudinaryImage;exports.useColumnsModal=e.useColumnsModal;exports.useConditionsDialog=e.useConditionsDialog;exports.useConfirmDialog=e.useConfirmDialog;exports.useDebouncedCallback=e.useDebouncedCallback;exports.useFilters=e.useFilters;exports.useModal=e.useModal;exports.useSearch=e.useSearch;exports.variantBuilder=e.variantBuilder;exports.Controller=t.Controller;exports.useController=t.useController;exports.useFieldArray=t.useFieldArray;exports.useFormContext=t.useFormContext;exports.useNumberFormatter=t.$a916eb452884faea$export$b7a616150fdb9f44;exports.useWatch=t.useWatch;
|
package/package.json
CHANGED