kwant-ui 3.36.0-stable.1 → 3.36.0-stable.2

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.
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import dayjs from 'dayjs';
2
3
  import { CalendarProps, DateObject } from 'react-multi-date-picker';
3
4
  export type RangeDomainUnit = 'd' | 'w' | 'm' | 'y';
4
5
  export type RangeDomain = `${number}${RangeDomainUnit}`;
@@ -52,7 +53,7 @@ export declare namespace ICalendar {
52
53
  type SidebarOptionProps = {
53
54
  title: string;
54
55
  selected?: boolean;
55
- value?: () => DateObject[];
56
+ value?: (() => DateObject[]) | (() => dayjs.Dayjs[]);
56
57
  onClick?: () => void;
57
58
  };
58
59
  type Time = {
@@ -6,8 +6,12 @@ export declare const OptionsContainer: import("styled-components").StyledCompone
6
6
  separator?: boolean;
7
7
  showScrollbar?: boolean;
8
8
  }, never>;
9
- export declare const Option: import("styled-components").StyledComponent<"div", any, {}, never>;
10
- export declare const CustomOption: import("styled-components").StyledComponent<"div", any, {}, never>;
9
+ export declare const Option: import("styled-components").StyledComponent<"div", any, {
10
+ isSelected?: boolean;
11
+ }, never>;
12
+ export declare const CustomOption: import("styled-components").StyledComponent<"div", any, {
13
+ isSelected?: boolean;
14
+ }, never>;
11
15
  export declare const EmptyResultContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
12
16
  export declare const AddOptionContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
13
17
  export declare const CustomImageOption: import("styled-components").StyledComponent<"div", any, {
package/dist/index.es.js CHANGED
@@ -1351,6 +1351,7 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n,{css as
1351
1351
  font-style: normal;
1352
1352
  font-weight: 400;
1353
1353
  font-size: 14px;
1354
+ height: 40px;
1354
1355
  line-height: 20px;
1355
1356
  color: ${e=>e.theme.primary.primary100};
1356
1357
 
@@ -1358,7 +1359,14 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n,{css as
1358
1359
  background-color: ${e=>e.theme.blue.blue5};
1359
1360
  cursor: pointer;
1360
1361
  }
1361
- `,Ut=n.div``,Wt=n.div`
1362
+ ${({isSelected:e})=>e&&a`
1363
+ display: none;
1364
+ `}
1365
+ `,Ut=n.div`
1366
+ ${({isSelected:e})=>e&&a`
1367
+ display: none;
1368
+ `}
1369
+ `,Wt=n.div`
1362
1370
  padding: 12px;
1363
1371
  `,Xt=n.div`
1364
1372
  display: flex;
@@ -1412,7 +1420,7 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n,{css as
1412
1420
  position: absolute;
1413
1421
  bottom: ${e=>e.bottomOffset};
1414
1422
  right: ${e=>e.rightOffset};
1415
- `,nr={xxs:{avatarSize:24,fontSize:10},xs:{avatarSize:32,fontSize:14},sm:{avatarSize:48,fontSize:18},md:{avatarSize:64,fontSize:22},lg:{avatarSize:88,fontSize:26},xl:{avatarSize:128,fontSize:30},xxl:{avatarSize:180,fontSize:60}},ar=r=>{const{src:n,alt:a,size:c="md",fontSize:i,backgroundColor:o="random",fontColor:s="white",objectFit:h="cover",avatarButton:v,avatarButtonBottomOffset:u=0,avatarButtonRightOffset:g=0,onClick:m}=r,[d,f]=p(null),[_,w]=p(!1),b=((e="")=>{const t=e?.trim()?.split(" ");if(t.length>1){const[e,...r]=t;return`${e[0]}${r?.pop()?.[0]}`.toUpperCase()}const r=t[0];return r[0]?.toUpperCase()||""})(a),y="random"!==o?o:function(e){let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t);let r="#";for(let e=0;e<3;e++)r+=("00"+(t>>8*e&255).toString(16)).substr(-2);return r}(a),x=c in nr?nr[c]:{avatarSize:c,fontSize:i},Z=()=>w(!0),O=()=>w(!1);return l((()=>{if(n){const e=new Image;e.src=n,e.onload=Z,e.onerror=O,f(e)}else O()}),[n]),t(Gt,{children:[e(Jt,{background:y,size:ke(x.avatarSize),onClick:()=>{m?.(r)},children:_?e(er,{src:d?.currentSrc,alt:a,objectFit:h,loading:"lazy"}):e(tr,{fontSize:ke(i||x.fontSize),fontColor:s,children:b})}),e(rr,{rightOffset:ke(g,"0px"),bottomOffset:ke(u,"0px"),children:v})]})},cr=r=>{const{label:n="",image:a="",selected:c,avatarProps:i}=r;return t(Kt,{selected:c,children:[e(ar,{src:a,alt:n,size:"xs",...i}),e(qt,{category:"body2",weight:"medium",color:A.grey.grey900,children:r.label}),c&&e(nt,{icon:"check",width:20,height:20,fill:A.green.green400})]})},ir=r=>{const{maxHeight:n=350,width:a=350,offsetTop:c="60px",offsetLeft:i,offsetRight:o,offsetBottom:s,zIndex:h,opened:v,onChange:g,onDropdownVisibilityChange:m,data:d=[],onSelect:_,itemComponent:w,showSeparator:b=!0,collapseOnSelect:y=!0,inputLeftSection:x,inputRightSection:Z,searchPlaceholder:O="Search",searchable:M=!0,showScrollbar:E=!0,targetRef:P,onMouseEnter:j,onMouseLeave:V,onClose:C,searchAutofocus:A=!0,addable:L,selectInputValue:z,avatarProps:B,selectedValue:k,withInput:S}=r,[R,D]=p(""),[I,T]=p([]),N=Vt(R,400),F=u(null),Q=R?I:d,$=R&&0===I.length,Y=Q.some((e=>"image"in e)),U={select:(e,t)=>()=>{_?.(e,t),y&&C?.()},searchQueryChange:e=>{D(e.target.value)}};l((()=>{const e=R.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&");const t=new RegExp(e,"ig"),r=d?.filter((({label:e,value:r})=>e.match(t)||r?.match(t)));T(r)}),[N,d]),l((()=>{g?.(v),m?.(),D("")}),[v]);const W=(e,t)=>M||S?{onMouseDown:U.select(e,t)}:{onClick:U.select(e,t)};return e(Nt,{opened:v,onClose:C,width:ke(a),offsetTop:c,offsetLeft:i,offsetRight:o,offsetBottom:s,zIndex:h,targetRef:P,onMouseEnter:j,onMouseLeave:V,children:t(Ft,{expandedHeight:n,children:[M&&e(Qt,{children:e(at,{placeholder:O,value:R,onChange:U.searchQueryChange,leftSection:x,rightSection:Z,autoFocus:A})}),$?e(Wt,{children:e(Oe,{category:"body1",children:"Sorry, no results were found matching your search criteria."})}):t($t,{className:"select_item_container",separator:b,showScrollbar:E,ref:F,children:[e(H,{viewportRef:F,items:Q,children:(t,r)=>w?e(Ut,{...W(t,r),children:f(w,{...t,label:t.label,value:t.value,index:r,key:`${t.label}${t.value}`})},`${t.label}${t.value}+${r}`):Y?e(Ut,{...W(t,r),children:e(cr,{...t,avatarProps:B,selected:t.value===k})},`${t.label}${t.value}+${r}`):e(Yt,{...W(t,r),role:"button",children:t.label},`${t.label}${t.value}+${r}`)}),L&&0===Q.length&&e(Yt,{...M||S?{onMouseDown:U.select({label:z,value:null},0)}:{onClick:U.select({label:z,value:null},0)},role:"button",children:t(Xt,{children:[e(Oe,{category:"body1",weight:"semiBold",children:"Add:"}),t(Oe,{children:[" ",z]})]})})]})]})})},or=n.div`
1423
+ `,nr={xxs:{avatarSize:24,fontSize:10},xs:{avatarSize:32,fontSize:14},sm:{avatarSize:48,fontSize:18},md:{avatarSize:64,fontSize:22},lg:{avatarSize:88,fontSize:26},xl:{avatarSize:128,fontSize:30},xxl:{avatarSize:180,fontSize:60}},ar=r=>{const{src:n,alt:a,size:c="md",fontSize:i,backgroundColor:o="random",fontColor:s="white",objectFit:h="cover",avatarButton:v,avatarButtonBottomOffset:u=0,avatarButtonRightOffset:g=0,onClick:m}=r,[d,f]=p(null),[_,w]=p(!1),b=((e="")=>{const t=e?.trim()?.split(" ");if(t.length>1){const[e,...r]=t;return`${e[0]}${r?.pop()?.[0]}`.toUpperCase()}const r=t[0];return r[0]?.toUpperCase()||""})(a),y="random"!==o?o:function(e){let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t);let r="#";for(let e=0;e<3;e++)r+=("00"+(t>>8*e&255).toString(16)).substr(-2);return r}(a),x=c in nr?nr[c]:{avatarSize:c,fontSize:i},Z=()=>w(!0),O=()=>w(!1);return l((()=>{if(n){const e=new Image;e.src=n,e.onload=Z,e.onerror=O,f(e)}else O()}),[n]),t(Gt,{children:[e(Jt,{background:y,size:ke(x.avatarSize),onClick:()=>{m?.(r)},children:_?e(er,{src:d?.currentSrc,alt:a,objectFit:h,loading:"lazy"}):e(tr,{fontSize:ke(i||x.fontSize),fontColor:s,children:b})}),e(rr,{rightOffset:ke(g,"0px"),bottomOffset:ke(u,"0px"),children:v})]})},cr=r=>{const{label:n="",image:a="",selected:c,avatarProps:i}=r;return t(Kt,{selected:c,children:[e(ar,{src:a,alt:n,size:"xs",...i}),e(qt,{category:"body2",weight:"medium",color:A.grey.grey900,children:r.label}),c&&e(nt,{icon:"check",width:20,height:20,fill:A.green.green400})]})},ir=r=>{const{maxHeight:n=350,width:a=350,offsetTop:c="60px",offsetLeft:i,offsetRight:o,offsetBottom:s,zIndex:h,opened:v,onChange:g,onDropdownVisibilityChange:m,data:d=[],onSelect:_,itemComponent:w,showSeparator:b=!0,collapseOnSelect:y=!0,inputLeftSection:x,inputRightSection:Z,searchPlaceholder:O="Search",searchable:M=!0,showScrollbar:E=!0,targetRef:P,onMouseEnter:j,onMouseLeave:V,onClose:C,searchAutofocus:A=!0,addable:L,selectInputValue:z,avatarProps:B,selectedValue:k,withInput:S}=r,[R,D]=p(""),[I,T]=p([]),N=Vt(R,400),F=u(null),Q=R?I:d,$=R&&0===I.length,Y=Q.some((e=>"image"in e)),U={select:(e,t)=>()=>{_?.(e,t),y&&C?.()},searchQueryChange:e=>{D(e.target.value)}};l((()=>{const e=R.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&");const t=new RegExp(e,"ig"),r=d?.filter((({label:e,value:r})=>e.match(t)||r?.match(t)));T(r)}),[N,d]),l((()=>{g?.(v),m?.(),D("")}),[v]);const W=(e,t)=>M||S?{onMouseDown:U.select(e,t)}:{onClick:U.select(e,t)};return e(Nt,{opened:v,onClose:C,width:ke(a),offsetTop:c,offsetLeft:i,offsetRight:o,offsetBottom:s,zIndex:h,targetRef:P,onMouseEnter:j,onMouseLeave:V,children:t(Ft,{expandedHeight:n,children:[M&&e(Qt,{children:e(at,{placeholder:O,value:R,onChange:U.searchQueryChange,leftSection:x,rightSection:Z,autoFocus:A})}),$?e(Wt,{children:e(Oe,{category:"body1",children:"Sorry, no results were found matching your search criteria."})}):t($t,{className:"select_item_container",separator:b,showScrollbar:E,ref:F,children:[e(H,{viewportRef:F,items:Q,itemMargin:10,itemSize:Q.length,overscan:6,children:(t,r)=>t?.isSelected?null:w?e(Ut,{isSelected:t?.isSelected,...W(t,r),children:f(w,{...t,label:t.label,value:t.value,index:r,key:`${t.label}${t.value}`})},`${t.label}${t.value}+${r}`):Y?e(Ut,{...W(t,r),children:e(cr,{...t,avatarProps:B,selected:t.value===k})},`${t.label}${t.value}+${r}`):e(Yt,{...W(t,r),role:"button",isSelected:t?.isSelected,children:t.label},`${t.label}${t.value}+${r}`)}),L&&0===Q.length&&e(Yt,{...M||S?{onMouseDown:U.select({label:z,value:null},0)}:{onClick:U.select({label:z,value:null},0)},role:"button",children:t(Xt,{children:[e(Oe,{category:"body1",weight:"semiBold",children:"Add:"}),t(Oe,{children:[" ",z]})]})})]})]})})},or=n.div`
1416
1424
  position: relative;
1417
1425
  `,sr=n.div`
1418
1426
  width: 100%;
@@ -2046,7 +2054,7 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n,{css as
2046
2054
  `,Va=n.div`
2047
2055
  display: flex;
2048
2056
  cursor: pointer;
2049
- `,Ca={chevronLeft:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M11.6736 2.5799L10.4869 1.3999L3.89355 7.9999L10.4936 14.5999L11.6736 13.4199L6.25355 7.9999L11.6736 2.5799Z",fill:A.grey.grey900})}),chevronRight:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M4.32715 13.4199L5.50715 14.5999L12.1071 7.9999L5.50715 1.3999L4.32715 2.5799L9.74715 7.9999L4.32715 13.4199Z",fill:A.grey.grey900})}),calendar:e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M15.8333 3.33334H15V1.66667L13.3333 1.66667V3.33334L6.66667 3.33334V1.66667L5 1.66667V3.33334H4.16667C3.24167 3.33334 2.5 4.08334 2.5 5.00001L2.5 16.6667C2.5 17.5833 3.24167 18.3333 4.16667 18.3333H15.8333C16.75 18.3333 17.5 17.5833 17.5 16.6667V5.00001C17.5 4.08334 16.75 3.33334 15.8333 3.33334ZM15.8333 16.6667H4.16667L4.16667 8.33334L15.8333 8.33334L15.8333 16.6667ZM15.8333 6.66667L4.16667 6.66667L4.16667 5.00001L15.8333 5.00001V6.66667ZM5.83333 10L10 10L10 14.1667L5.83333 14.1667L5.83333 10Z",fill:A.grey.grey400})})};var Aa;!function(e){var t,r;(t=e.ClockTypeEnum||(e.ClockTypeEnum={})).am="am",t.pm="pm",(r=e.DatpickerNavigationDirectionEnum||(e.DatpickerNavigationDirectionEnum={})).right="right",r.left="left"}(Aa||(Aa={}));const La=(e,t)=>!!(t>1&&e),za=["Su","Mo","Tu","We","Th","Fr","Sa"],Ba=(e,t,r,n)=>new On.DateObject(((e,t,r)=>kt(e).subtract(t,r))(e,t,r)[n]("week").format("YYYY-MM-DD")),ka={TODAY:[new On.DateObject,new On.DateObject],CURRENT_WEEK:[(new On.DateObject).toFirstOfWeek(),(new On.DateObject).toLastOfWeek()],LAST_7_DAYS:[(new On.DateObject).subtract(6,"days"),new On.DateObject],LAST_WEEK:[Ba(new Date,1,"week","startOf"),Ba(new Date,1,"week","endOf")],LAST_2_WEEKS:[Ba(new Date,2,"week","startOf"),Ba(new Date,1,"week","endOf")],LAST_3_WEEKS:[Ba(new Date,3,"week","startOf"),Ba(new Date,1,"week","endOf")],LAST_4_WEEKS:[Ba(new Date,4,"week","startOf"),Ba(new Date,1,"week","endOf")],LAST_30_DAYS:[(new On.DateObject).subtract(29,"days"),new On.DateObject],THIS_MONTH:[(new On.DateObject).toFirstOfMonth(),(new On.DateObject).toLastOfMonth()],PAST_MONTH:[new On.DateObject(kt().subtract(1,"month").startOf("month").format("YYYY-MM-DD")),new On.DateObject(kt().subtract(1,"month").endOf("month").format("YYYY-MM-DD"))],CUSTOM_RANGE:[],NOW:[(new On.DateObject).set("second",0),(new On.DateObject).set("second",0)],LAST_HOUR:[(new On.DateObject).subtract(1,"hour").set("second",0),(new On.DateObject).set("second",0)],YESTERDAY:[new On.DateObject(kt().subtract(1,"day").startOf("day").format("YYYY-MM-DD")),new On.DateObject(kt().subtract(1,"day").endOf("day").format("YYYY-MM-DD"))],CUSTOM_RANGE_LOCATION_PLAN:[new On.DateObject,new On.DateObject]},Sa=e=>e instanceof On.DateObject?!kt(e.format("YYYY-MM-DD")).isSame(kt().startOf("month"),"month"):!kt(e).isSame(kt().startOf("month"),"month"),Ra=[{key:"from",label:"From"},{key:"to",label:"To"}],Da=e=>{const t=("0"+e).slice(-2);return"0"===t?"00":t},Ia=(t,r)=>e(ja,{onClick:e=>{e.stopPropagation(),r?.(e)},children:t===Aa.DatpickerNavigationDirectionEnum.right?Ca.chevronRight:Ca.chevronLeft}),Ta=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Na=["Su","Mo","Tu","We","Th","Fr","Sa"],Fa=e=>{const t=kt().format("YYYY-MM-DD"),{dateRange:r,timeRange:n}=e||{},{startDate:a,endDate:c}=r||{},{from:i,to:o}=n||{};return{startDate:`${a||t}T${Qa(`${i?.hour}:${i?.minute}:${i?.clockType}`)}:00`,endDate:`${c||t}T${Qa(`${o?.hour}:${o?.minute}:${o?.clockType}`)}:00`}},Qa=e=>{const[t,r,n]=e.split(":"),a="pm"===n,c=parseInt(t),i=parseInt(r);let o=c;a&&c<12?o+=12:a&&c>12?o-=12:a||12!==c||(o=0);return`${o.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`},$a=e=>{const t=String(e>12?e-12:e);return Da(t)},Ya=e=>{const{startDate:t,endDate:r}=e,[n,a]=t.split("T"),[c,i]=a.split(":"),[o,s]=r.split("T"),[l,h]=s.split(":"),v=Number(c),p=Number(l);return{startDateOnly:n,endDateOnly:o,time:{from:{hour:"00"===$a(v)?"12":$a(v),minute:i,clockType:v>12?Aa.ClockTypeEnum.pm:Aa.ClockTypeEnum.am},to:{hour:"00"===$a(p)?"12":$a(p),minute:h,clockType:p>12?Aa.ClockTypeEnum.pm:Aa.ClockTypeEnum.am}}}},Ua=(e,t,r)=>`${kt(e).format(t)||""} ${"00"===r.hour?"12":r.hour}:${r.minute||"00"} ${r.clockType.toUpperCase()}`,Wa=(e,t)=>{const{startDateOnly:r,endDateOnly:n,time:a}=Ya(e);return`${Ua(r,t,a.from)} ~ ${Ua(n,t,a.to)}`},Xa=n.div`
2057
+ `,Ca={chevronLeft:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M11.6736 2.5799L10.4869 1.3999L3.89355 7.9999L10.4936 14.5999L11.6736 13.4199L6.25355 7.9999L11.6736 2.5799Z",fill:A.grey.grey900})}),chevronRight:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M4.32715 13.4199L5.50715 14.5999L12.1071 7.9999L5.50715 1.3999L4.32715 2.5799L9.74715 7.9999L4.32715 13.4199Z",fill:A.grey.grey900})}),calendar:e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M15.8333 3.33334H15V1.66667L13.3333 1.66667V3.33334L6.66667 3.33334V1.66667L5 1.66667V3.33334H4.16667C3.24167 3.33334 2.5 4.08334 2.5 5.00001L2.5 16.6667C2.5 17.5833 3.24167 18.3333 4.16667 18.3333H15.8333C16.75 18.3333 17.5 17.5833 17.5 16.6667V5.00001C17.5 4.08334 16.75 3.33334 15.8333 3.33334ZM15.8333 16.6667H4.16667L4.16667 8.33334L15.8333 8.33334L15.8333 16.6667ZM15.8333 6.66667L4.16667 6.66667L4.16667 5.00001L15.8333 5.00001V6.66667ZM5.83333 10L10 10L10 14.1667L5.83333 14.1667L5.83333 10Z",fill:A.grey.grey400})})};var Aa;!function(e){var t,r;(t=e.ClockTypeEnum||(e.ClockTypeEnum={})).am="am",t.pm="pm",(r=e.DatpickerNavigationDirectionEnum||(e.DatpickerNavigationDirectionEnum={})).right="right",r.left="left"}(Aa||(Aa={}));const La=(e,t)=>!!(t>1&&e),za=["Su","Mo","Tu","We","Th","Fr","Sa"],Ba=(e,t,r,n)=>new On.DateObject(((e,t,r)=>kt(e).subtract(t,r))(e,t,r)[n]("week").format("YYYY-MM-DD")),ka={TODAY:[new On.DateObject,new On.DateObject],CURRENT_WEEK:[(new On.DateObject).toFirstOfWeek(),(new On.DateObject).toLastOfWeek()],LAST_7_DAYS:[(new On.DateObject).subtract(6,"days"),new On.DateObject],LAST_WEEK:[Ba(new Date,1,"week","startOf"),Ba(new Date,1,"week","endOf")],LAST_2_WEEKS:[Ba(new Date,2,"week","startOf"),Ba(new Date,1,"week","endOf")],LAST_3_WEEKS:[Ba(new Date,3,"week","startOf"),Ba(new Date,1,"week","endOf")],LAST_4_WEEKS:[Ba(new Date,4,"week","startOf"),Ba(new Date,1,"week","endOf")],LAST_30_DAYS:[(new On.DateObject).subtract(29,"days"),new On.DateObject],THIS_MONTH:[(new On.DateObject).toFirstOfMonth(),(new On.DateObject).toLastOfMonth()],PAST_MONTH:[new On.DateObject(kt().subtract(1,"month").startOf("month").format("YYYY-MM-DD")),new On.DateObject(kt().subtract(1,"month").endOf("month").format("YYYY-MM-DD"))],CUSTOM_RANGE:[],NOW:[(new On.DateObject).set("second",0),(new On.DateObject).set("second",0)],LAST_HOUR:[(new On.DateObject).subtract(1,"hour").set("second",0),(new On.DateObject).set("second",0)],YESTERDAY:[new On.DateObject(kt().subtract(1,"day").startOf("day").format("YYYY-MM-DD")),new On.DateObject(kt().subtract(1,"day").endOf("day").format("YYYY-MM-DD"))],CUSTOM_RANGE_LOCATION_PLAN:[new On.DateObject,new On.DateObject]},Sa=e=>e instanceof On.DateObject?!kt(e.format("YYYY-MM-DD")).isSame(kt().startOf("month"),"month"):!kt(e).isSame(kt().startOf("month"),"month"),Ra=[{key:"from",label:"From"},{key:"to",label:"To"}],Da=e=>{const t=("0"+e).slice(-2);return"0"===t?"00":t},Ia=(t,r)=>e(ja,{onClick:e=>{e.stopPropagation(),r?.(e)},children:t===Aa.DatpickerNavigationDirectionEnum.right?Ca.chevronRight:Ca.chevronLeft}),Ta=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Na=["Su","Mo","Tu","We","Th","Fr","Sa"],Fa=e=>{const t=kt().format("YYYY-MM-DD"),{dateRange:r,timeRange:n}=e||{},{startDate:a,endDate:c}=r||{},{from:i,to:o}=n||{};return{startDate:`${a||t}T${Qa(`${i?.hour}:${i?.minute}:${i?.clockType}`)}:00`,endDate:`${c||t}T${Qa(`${o?.hour}:${o?.minute}:${o?.clockType}`)}:00`}},Qa=e=>{const[t,r,n]=e.split(":"),a="pm"===n,c=parseInt(t),i=parseInt(r);let o=c;a&&c<12?o+=12:a&&c>12?o-=12:a||12!==c||(o=0);return`${o.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`},$a=e=>{const t=String(e>12?e-12:e);return Da(t)},Ya=e=>{const{startDate:t,endDate:r}=e,[n,a]=t.split("T"),[c,i]=a.split(":"),[o,s]=r.split("T"),[l,h]=s.split(":"),v=Number(c),p=Number(l);return{startDateOnly:n,endDateOnly:o,time:{from:{hour:"00"===$a(v)?"12":$a(v),minute:i,clockType:v>=12?Aa.ClockTypeEnum.pm:Aa.ClockTypeEnum.am},to:{hour:"00"===$a(p)?"12":$a(p),minute:h,clockType:p>=12?Aa.ClockTypeEnum.pm:Aa.ClockTypeEnum.am}}}},Ua=(e,t,r)=>`${kt(e).format(t)||""} ${"00"===r.hour?"12":r.hour}:${r.minute||"00"} ${r.clockType.toUpperCase()}`,Wa=(e,t)=>{const{startDateOnly:r,endDateOnly:n,time:a}=Ya(e);return`${Ua(r,t,a.from)} ~ ${Ua(n,t,a.to)}`},Xa=n.div`
2050
2058
  border-radius: 8px;
2051
2059
  width: fit-content;
2052
2060
  display: flex;
@@ -2140,7 +2148,7 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n,{css as
2140
2148
  `;var ic;n.div`
2141
2149
  display: flex;
2142
2150
  cursor: pointer;
2143
- `,function(e){var t;(t=e.DatpickerNavigationDirectionEnum||(e.DatpickerNavigationDirectionEnum={})).right="right",t.left="left"}(ic||(ic={}));const oc={chevronLeft:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M11.6736 2.5799L10.4869 1.3999L3.89355 7.9999L10.4936 14.5999L11.6736 13.4199L6.25355 7.9999L11.6736 2.5799Z",fill:A.grey.grey900})}),chevronRight:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M4.32715 13.4199L5.50715 14.5999L12.1071 7.9999L5.50715 1.3999L4.32715 2.5799L9.74715 7.9999L4.32715 13.4199Z",fill:A.grey.grey900})}),calendar:e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M15.8333 3.33334H15V1.66667L13.3333 1.66667V3.33334L6.66667 3.33334V1.66667L5 1.66667V3.33334H4.16667C3.24167 3.33334 2.5 4.08334 2.5 5.00001L2.5 16.6667C2.5 17.5833 3.24167 18.3333 4.16667 18.3333H15.8333C16.75 18.3333 17.5 17.5833 17.5 16.6667V5.00001C17.5 4.08334 16.75 3.33334 15.8333 3.33334ZM15.8333 16.6667H4.16667L4.16667 8.33334L15.8333 8.33334L15.8333 16.6667ZM15.8333 6.66667L4.16667 6.66667L4.16667 5.00001L15.8333 5.00001V6.66667ZM5.83333 10L10 10L10 14.1667L5.83333 14.1667L5.83333 10Z",fill:A.grey.grey900})})},sc=({title:t,selected:r,onClick:n})=>e(qa,{selected:r,onClick:n,children:e(Oe,{category:"body2",weight:"medium",color:r?A.blue.blue1000:A.grey.grey900,children:t})},t),lc=({options:t,selectedOption:r,onOptionClick:n})=>e(Ka,{children:t?.map((t=>e(sc,{...t,onClick:()=>n(t.value,t),selected:r===t.title},t.title)))}),hc=({label:r="",timeHour:n="",timeMinute:a="",clockType:c="am",disabled:i=!0,onClockTypeChange:o,onHourChange:s,onMinuteChange:l})=>t(ac,{children:[e(nc,{children:r}),t(ec,{children:[e(Ga,{type:"number",value:n,disabled:i,onChange:e=>{const t=e.target.value,n=Da(t);Number(t)<=12?s(r.toLowerCase(),n):s(r.toLowerCase(),"12")}}),e(Ja,{children:":"}),e(Ga,{type:"number",value:a,disabled:i,onChange:e=>{const t=e.target.value,n=Da(t);Number(t)<=59?l(r.toLowerCase(),n):l(r.toLowerCase(),"59")}}),e(tc,{content:[{key:"am",label:"AM"},{key:"pm",label:"PM"}],activeKey:c,onClick:e=>{o(r.toLowerCase(),e)},disabled:i})]})]}),vc=(t,r)=>e(cc,{onClick:r,children:t===ic.DatpickerNavigationDirectionEnum.right?oc.chevronRight:oc.chevronLeft}),pc="MM/DD/YYYY",uc=h(((t,r)=>{const{range:n,numberOfMonths:a=1,format:c=pc,onChange:i,label:o,placeholder:s=pc,required:h,readOnly:v,errorMessage:u,calendarRef:g,inputProps:m,showTime:d,dateTimeRange:f,onChangeDateTime:_,...w}=t,{time:b,setTime:y}=St(),[x,Z]=p(""),[O,M]=p(""),E=(e,t,r)=>{if(!b)return;const n={...b,[e]:{...b[e],[r]:t}};y?.(n)},H=e=>{const[t,r]=(n=e,n?Array.isArray(n)&&2===n.length?`${n[0].format("YYYY-MM-DD")} * ${n[1].format("YYYY-MM-DD")}`:Array.isArray(n)&&1===n.length?n[0].format("YYYY-MM-DD"):"":"").split(" * ");var n;Z(t),M(r)};return l((()=>{if(f?.startDate?.includes("T")&&f?.endDate?.includes("T")){const{startDateOnly:e,endDateOnly:t,time:r}=Ya(f);Z(e),M(t),y(r)}}),[]),e(Pa,{showTime:d,className:"date-picker",children:e(Ha,{renderButton:Ia,className:"date-picker-"+(La(n,a)?"range":"single"),ref:g,range:n,months:Ta,numberOfMonths:a,showOtherDays:!0,weekDays:Na,render:(t,n,a)=>e(at,{rightSection:e(Va,{onClick:()=>{!v&&n()},children:Ca.calendar}),placeholder:s,value:d&&t?x&&O?`${Ua(x,c,b.from)} ~ ${Ua(O,c,b.to)}`:"":t,onClick:()=>{!v&&n()},onChange:e=>{((e,t)=>{const r=e.target.value.match(/[^0-9/]/g);Array.isArray(r)||t(e)})(e,a)},label:o,required:h,readOnly:v,error:!!u,errorMessage:u,onFocusCapture:()=>{!v&&n()},ref:r,...m}),onChange:e=>{d?H(e):i&&i(e)},format:c,portal:!0,onClose:()=>{if(d){const e=Fa({dateRange:{startDate:x,endDate:O},timeRange:b});_(e)}},...w,children:d&&e(rc,{children:Ra.map((t=>{const r=b?.[t.key];return e(hc,{disabled:!1,label:t.label,timeHour:r?.hour,timeMinute:r?.minute,clockType:r?.clockType,onClockTypeChange:(e,t)=>{E(e,t,"clockType")},onHourChange:(e,t)=>{E(e,t,"hour")},onMinuteChange:(e,t)=>{E(e,t,"minute")}},t.key)}))})})})})),gc=n.div`
2151
+ `,function(e){var t;(t=e.DatpickerNavigationDirectionEnum||(e.DatpickerNavigationDirectionEnum={})).right="right",t.left="left"}(ic||(ic={}));const oc={chevronLeft:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M11.6736 2.5799L10.4869 1.3999L3.89355 7.9999L10.4936 14.5999L11.6736 13.4199L6.25355 7.9999L11.6736 2.5799Z",fill:A.grey.grey900})}),chevronRight:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M4.32715 13.4199L5.50715 14.5999L12.1071 7.9999L5.50715 1.3999L4.32715 2.5799L9.74715 7.9999L4.32715 13.4199Z",fill:A.grey.grey900})}),calendar:e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M15.8333 3.33334H15V1.66667L13.3333 1.66667V3.33334L6.66667 3.33334V1.66667L5 1.66667V3.33334H4.16667C3.24167 3.33334 2.5 4.08334 2.5 5.00001L2.5 16.6667C2.5 17.5833 3.24167 18.3333 4.16667 18.3333H15.8333C16.75 18.3333 17.5 17.5833 17.5 16.6667V5.00001C17.5 4.08334 16.75 3.33334 15.8333 3.33334ZM15.8333 16.6667H4.16667L4.16667 8.33334L15.8333 8.33334L15.8333 16.6667ZM15.8333 6.66667L4.16667 6.66667L4.16667 5.00001L15.8333 5.00001V6.66667ZM5.83333 10L10 10L10 14.1667L5.83333 14.1667L5.83333 10Z",fill:A.grey.grey900})})},sc=({title:t,selected:r,onClick:n})=>e(qa,{selected:r,onClick:n,children:e(Oe,{category:"body2",weight:"medium",color:r?A.blue.blue1000:A.grey.grey900,children:t})},t),lc=({options:t,selectedOption:r,onOptionClick:n})=>e(Ka,{children:t?.map((t=>e(sc,{...t,onClick:()=>n(t.value,t),selected:r===t.title},t.title)))}),hc=({label:r="",timeHour:n="",timeMinute:a="",clockType:c="am",disabled:i=!0,onClockTypeChange:o,onHourChange:s,onMinuteChange:l})=>t(ac,{children:[e(nc,{children:r}),t(ec,{children:[e(Ga,{type:"number",value:n,disabled:i,onChange:e=>{const t=e.target.value,n="0"===t?"01":Da(t);Number(t)<=12?s(r.toLowerCase(),n):s(r.toLowerCase(),"12")},min:1}),e(Ja,{children:":"}),e(Ga,{type:"number",value:a,disabled:i,onChange:e=>{const t=e.target.value,n=Da(t);Number(t)<=59?l(r.toLowerCase(),n):l(r.toLowerCase(),"59")},min:0}),e(tc,{content:[{key:"am",label:"AM"},{key:"pm",label:"PM"}],activeKey:c,onClick:e=>{o(r.toLowerCase(),e)},disabled:i})]})]}),vc=(t,r)=>e(cc,{onClick:r,children:t===ic.DatpickerNavigationDirectionEnum.right?oc.chevronRight:oc.chevronLeft}),pc="MM/DD/YYYY",uc=h(((t,r)=>{const{range:n,numberOfMonths:a=1,format:c=pc,onChange:i,label:o,placeholder:s=pc,required:h,readOnly:v,errorMessage:u,calendarRef:g,inputProps:m,showTime:d,dateTimeRange:f,onChangeDateTime:_,...w}=t,{time:b,setTime:y}=St(),[x,Z]=p(""),[O,M]=p(""),E=(e,t,r)=>{if(!b)return;const n={...b,[e]:{...b[e],[r]:t}};y?.(n)},H=e=>{const[t,r]=(n=e,n?Array.isArray(n)&&2===n.length?`${n[0].format("YYYY-MM-DD")} * ${n[1].format("YYYY-MM-DD")}`:Array.isArray(n)&&1===n.length?n[0].format("YYYY-MM-DD"):"":"").split(" * ");var n;t&&r&&(Z(t),M(r))};return l((()=>{if(f?.startDate?.includes("T")&&f?.endDate?.includes("T")){const{startDateOnly:e,endDateOnly:t,time:r}=Ya(f);Z(e),M(t),y(r)}}),[]),l((()=>{w.value||(Z(""),M(""))}),[w.value]),l((()=>{if(d&&x&&O&&b){const e=Fa({dateRange:{startDate:x,endDate:O},timeRange:b});_(e)}}),[x,O,b]),e(Pa,{showTime:d,className:"date-picker",children:e(Ha,{renderButton:Ia,className:"date-picker-"+(La(n,a)?"range":"single"),ref:g,range:n,months:Ta,numberOfMonths:a,showOtherDays:!0,weekDays:Na,render:(t,n,a)=>e(at,{rightSection:e(Va,{onClick:()=>{!v&&n()},children:Ca.calendar}),placeholder:s,value:d&&t?x&&O?`${Ua(x,c,b.from)} ~ ${Ua(O,c,b.to)}`:"":t,onClick:()=>{!v&&n()},onChange:e=>{((e,t)=>{const r=e.target.value.match(/[^0-9/]/g);Array.isArray(r)||t(e)})(e,a)},label:o,required:h,readOnly:v,error:!!u,errorMessage:u,onFocusCapture:()=>{!v&&n()},ref:r,...m}),onChange:e=>{d?H(e):i&&i(e)},format:c,portal:!0,...w,children:d&&e(rc,{children:Ra.map((t=>{const r=b?.[t.key];return e(hc,{disabled:!1,label:t.label,timeHour:r?.hour,timeMinute:r?.minute,clockType:r?.clockType,onClockTypeChange:(e,t)=>{E(e,t,"clockType")},onHourChange:(e,t)=>{E(e,t,"hour")},onMinuteChange:(e,t)=>{E(e,t,"minute")}},t.key)}))})})})})),gc=n.div`
2144
2152
  .xsmall {
2145
2153
  width: 20px;
2146
2154
  height: 20px;
package/dist/index.js CHANGED
@@ -1351,6 +1351,7 @@
1351
1351
  font-style: normal;
1352
1352
  font-weight: 400;
1353
1353
  font-size: 14px;
1354
+ height: 40px;
1354
1355
  line-height: 20px;
1355
1356
  color: ${e=>e.theme.primary.primary100};
1356
1357
 
@@ -1358,7 +1359,14 @@
1358
1359
  background-color: ${e=>e.theme.blue.blue5};
1359
1360
  cursor: pointer;
1360
1361
  }
1361
- `,_t=t.div``,wt=t.div`
1362
+ ${({isSelected:e})=>e&&t.css`
1363
+ display: none;
1364
+ `}
1365
+ `,_t=t.div`
1366
+ ${({isSelected:e})=>e&&t.css`
1367
+ display: none;
1368
+ `}
1369
+ `,wt=t.div`
1362
1370
  padding: 12px;
1363
1371
  `,bt=t.div`
1364
1372
  display: flex;
@@ -1412,7 +1420,7 @@
1412
1420
  position: absolute;
1413
1421
  bottom: ${e=>e.bottomOffset};
1414
1422
  right: ${e=>e.rightOffset};
1415
- `,Pt={xxs:{avatarSize:24,fontSize:10},xs:{avatarSize:32,fontSize:14},sm:{avatarSize:48,fontSize:18},md:{avatarSize:64,fontSize:22},lg:{avatarSize:88,fontSize:26},xl:{avatarSize:128,fontSize:30},xxl:{avatarSize:180,fontSize:60}},jt=t=>{const{src:n,alt:a,size:c="md",fontSize:i,backgroundColor:o="random",fontColor:s="white",objectFit:l="cover",avatarButton:h,avatarButtonBottomOffset:v=0,avatarButtonRightOffset:p=0,onClick:u}=t,[g,m]=r.useState(null),[d,f]=r.useState(!1),_=((e="")=>{const t=e?.trim()?.split(" ");if(t.length>1){const[e,...r]=t;return`${e[0]}${r?.pop()?.[0]}`.toUpperCase()}const r=t[0];return r[0]?.toUpperCase()||""})(a),w="random"!==o?o:function(e){let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t);let r="#";for(let e=0;e<3;e++)r+=("00"+(t>>8*e&255).toString(16)).substr(-2);return r}(a),b=c in Pt?Pt[c]:{avatarSize:c,fontSize:i},y=()=>f(!0),x=()=>f(!1);return r.useEffect((()=>{if(n){const e=new Image;e.src=n,e.onload=y,e.onerror=x,m(e)}else x()}),[n]),e.jsxs(Zt,{children:[e.jsx(Ot,{background:w,size:ue(b.avatarSize),onClick:()=>{u?.(t)},children:d?e.jsx(Mt,{src:g?.currentSrc,alt:a,objectFit:l,loading:"lazy"}):e.jsx(Et,{fontSize:ue(i||b.fontSize),fontColor:s,children:_})}),e.jsx(Ht,{rightOffset:ue(p,"0px"),bottomOffset:ue(v,"0px"),children:h})]})},Vt=t=>{const{label:r="",image:n="",selected:a,avatarProps:c}=t;return e.jsxs(yt,{selected:a,children:[e.jsx(jt,{src:n,alt:r,size:"xs",...c}),e.jsx(xt,{category:"body2",weight:"medium",color:v.grey.grey900,children:t.label}),a&&e.jsx(Le,{icon:"check",width:20,height:20,fill:v.green.green400})]})},Ct=t=>{const{maxHeight:n=350,width:c=350,offsetTop:i="60px",offsetLeft:o,offsetRight:s,offsetBottom:l,zIndex:h,opened:v,onChange:p,onDropdownVisibilityChange:u,data:g=[],onSelect:m,itemComponent:d,showSeparator:f=!0,collapseOnSelect:_=!0,inputLeftSection:w,inputRightSection:b,searchPlaceholder:y="Search",searchable:x=!0,showScrollbar:Z=!0,targetRef:O,onMouseEnter:M,onMouseLeave:E,onClose:H,searchAutofocus:P=!0,addable:j,selectInputValue:V,avatarProps:C,selectedValue:A,withInput:L}=t,[z,B]=r.useState(""),[k,S]=r.useState([]),R=rt(z,400),D=r.useRef(null),I=z?k:g,T=z&&0===k.length,N=I.some((e=>"image"in e)),F={select:(e,t)=>()=>{m?.(e,t),_&&H?.()},searchQueryChange:e=>{B(e.target.value)}};r.useEffect((()=>{const e=z.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&");const t=new RegExp(e,"ig"),r=g?.filter((({label:e,value:r})=>e.match(t)||r?.match(t)));S(r)}),[R,g]),r.useEffect((()=>{p?.(v),u?.(),B("")}),[v]);const Q=(e,t)=>x||L?{onMouseDown:F.select(e,t)}:{onClick:F.select(e,t)};return e.jsx(ut,{opened:v,onClose:H,width:ue(c),offsetTop:i,offsetLeft:o,offsetRight:s,offsetBottom:l,zIndex:h,targetRef:O,onMouseEnter:M,onMouseLeave:E,children:e.jsxs(gt,{expandedHeight:n,children:[x&&e.jsx(mt,{children:e.jsx(ze,{placeholder:y,value:z,onChange:F.searchQueryChange,leftSection:w,rightSection:b,autoFocus:P})}),T?e.jsx(wt,{children:e.jsx(re,{category:"body1",children:"Sorry, no results were found matching your search criteria."})}):e.jsxs(dt,{className:"select_item_container",separator:f,showScrollbar:Z,ref:D,children:[e.jsx(a.ViewportList,{viewportRef:D,items:I,children:(t,n)=>d?e.jsx(_t,{...Q(t,n),children:r.createElement(d,{...t,label:t.label,value:t.value,index:n,key:`${t.label}${t.value}`})},`${t.label}${t.value}+${n}`):N?e.jsx(_t,{...Q(t,n),children:e.jsx(Vt,{...t,avatarProps:C,selected:t.value===A})},`${t.label}${t.value}+${n}`):e.jsx(ft,{...Q(t,n),role:"button",children:t.label},`${t.label}${t.value}+${n}`)}),j&&0===I.length&&e.jsx(ft,{...x||L?{onMouseDown:F.select({label:V,value:null},0)}:{onClick:F.select({label:V,value:null},0)},role:"button",children:e.jsxs(bt,{children:[e.jsx(re,{category:"body1",weight:"semiBold",children:"Add:"}),e.jsxs(re,{children:[" ",V]})]})})]})]})})},At=t.div`
1423
+ `,Pt={xxs:{avatarSize:24,fontSize:10},xs:{avatarSize:32,fontSize:14},sm:{avatarSize:48,fontSize:18},md:{avatarSize:64,fontSize:22},lg:{avatarSize:88,fontSize:26},xl:{avatarSize:128,fontSize:30},xxl:{avatarSize:180,fontSize:60}},jt=t=>{const{src:n,alt:a,size:c="md",fontSize:i,backgroundColor:o="random",fontColor:s="white",objectFit:l="cover",avatarButton:h,avatarButtonBottomOffset:v=0,avatarButtonRightOffset:p=0,onClick:u}=t,[g,m]=r.useState(null),[d,f]=r.useState(!1),_=((e="")=>{const t=e?.trim()?.split(" ");if(t.length>1){const[e,...r]=t;return`${e[0]}${r?.pop()?.[0]}`.toUpperCase()}const r=t[0];return r[0]?.toUpperCase()||""})(a),w="random"!==o?o:function(e){let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t);let r="#";for(let e=0;e<3;e++)r+=("00"+(t>>8*e&255).toString(16)).substr(-2);return r}(a),b=c in Pt?Pt[c]:{avatarSize:c,fontSize:i},y=()=>f(!0),x=()=>f(!1);return r.useEffect((()=>{if(n){const e=new Image;e.src=n,e.onload=y,e.onerror=x,m(e)}else x()}),[n]),e.jsxs(Zt,{children:[e.jsx(Ot,{background:w,size:ue(b.avatarSize),onClick:()=>{u?.(t)},children:d?e.jsx(Mt,{src:g?.currentSrc,alt:a,objectFit:l,loading:"lazy"}):e.jsx(Et,{fontSize:ue(i||b.fontSize),fontColor:s,children:_})}),e.jsx(Ht,{rightOffset:ue(p,"0px"),bottomOffset:ue(v,"0px"),children:h})]})},Vt=t=>{const{label:r="",image:n="",selected:a,avatarProps:c}=t;return e.jsxs(yt,{selected:a,children:[e.jsx(jt,{src:n,alt:r,size:"xs",...c}),e.jsx(xt,{category:"body2",weight:"medium",color:v.grey.grey900,children:t.label}),a&&e.jsx(Le,{icon:"check",width:20,height:20,fill:v.green.green400})]})},Ct=t=>{const{maxHeight:n=350,width:c=350,offsetTop:i="60px",offsetLeft:o,offsetRight:s,offsetBottom:l,zIndex:h,opened:v,onChange:p,onDropdownVisibilityChange:u,data:g=[],onSelect:m,itemComponent:d,showSeparator:f=!0,collapseOnSelect:_=!0,inputLeftSection:w,inputRightSection:b,searchPlaceholder:y="Search",searchable:x=!0,showScrollbar:Z=!0,targetRef:O,onMouseEnter:M,onMouseLeave:E,onClose:H,searchAutofocus:P=!0,addable:j,selectInputValue:V,avatarProps:C,selectedValue:A,withInput:L}=t,[z,B]=r.useState(""),[k,S]=r.useState([]),R=rt(z,400),D=r.useRef(null),I=z?k:g,T=z&&0===k.length,N=I.some((e=>"image"in e)),F={select:(e,t)=>()=>{m?.(e,t),_&&H?.()},searchQueryChange:e=>{B(e.target.value)}};r.useEffect((()=>{const e=z.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&");const t=new RegExp(e,"ig"),r=g?.filter((({label:e,value:r})=>e.match(t)||r?.match(t)));S(r)}),[R,g]),r.useEffect((()=>{p?.(v),u?.(),B("")}),[v]);const Q=(e,t)=>x||L?{onMouseDown:F.select(e,t)}:{onClick:F.select(e,t)};return e.jsx(ut,{opened:v,onClose:H,width:ue(c),offsetTop:i,offsetLeft:o,offsetRight:s,offsetBottom:l,zIndex:h,targetRef:O,onMouseEnter:M,onMouseLeave:E,children:e.jsxs(gt,{expandedHeight:n,children:[x&&e.jsx(mt,{children:e.jsx(ze,{placeholder:y,value:z,onChange:F.searchQueryChange,leftSection:w,rightSection:b,autoFocus:P})}),T?e.jsx(wt,{children:e.jsx(re,{category:"body1",children:"Sorry, no results were found matching your search criteria."})}):e.jsxs(dt,{className:"select_item_container",separator:f,showScrollbar:Z,ref:D,children:[e.jsx(a.ViewportList,{viewportRef:D,items:I,itemMargin:10,itemSize:I.length,overscan:6,children:(t,n)=>t?.isSelected?null:d?e.jsx(_t,{isSelected:t?.isSelected,...Q(t,n),children:r.createElement(d,{...t,label:t.label,value:t.value,index:n,key:`${t.label}${t.value}`})},`${t.label}${t.value}+${n}`):N?e.jsx(_t,{...Q(t,n),children:e.jsx(Vt,{...t,avatarProps:C,selected:t.value===A})},`${t.label}${t.value}+${n}`):e.jsx(ft,{...Q(t,n),role:"button",isSelected:t?.isSelected,children:t.label},`${t.label}${t.value}+${n}`)}),j&&0===I.length&&e.jsx(ft,{...x||L?{onMouseDown:F.select({label:V,value:null},0)}:{onClick:F.select({label:V,value:null},0)},role:"button",children:e.jsxs(bt,{children:[e.jsx(re,{category:"body1",weight:"semiBold",children:"Add:"}),e.jsxs(re,{children:[" ",V]})]})})]})]})})},At=t.div`
1416
1424
  position: relative;
1417
1425
  `,Lt=t.div`
1418
1426
  width: 100%;
@@ -2046,7 +2054,7 @@
2046
2054
  `,Yn=t.div`
2047
2055
  display: flex;
2048
2056
  cursor: pointer;
2049
- `,Un={chevronLeft:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M11.6736 2.5799L10.4869 1.3999L3.89355 7.9999L10.4936 14.5999L11.6736 13.4199L6.25355 7.9999L11.6736 2.5799Z",fill:v.grey.grey900})}),chevronRight:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4.32715 13.4199L5.50715 14.5999L12.1071 7.9999L5.50715 1.3999L4.32715 2.5799L9.74715 7.9999L4.32715 13.4199Z",fill:v.grey.grey900})}),calendar:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15.8333 3.33334H15V1.66667L13.3333 1.66667V3.33334L6.66667 3.33334V1.66667L5 1.66667V3.33334H4.16667C3.24167 3.33334 2.5 4.08334 2.5 5.00001L2.5 16.6667C2.5 17.5833 3.24167 18.3333 4.16667 18.3333H15.8333C16.75 18.3333 17.5 17.5833 17.5 16.6667V5.00001C17.5 4.08334 16.75 3.33334 15.8333 3.33334ZM15.8333 16.6667H4.16667L4.16667 8.33334L15.8333 8.33334L15.8333 16.6667ZM15.8333 6.66667L4.16667 6.66667L4.16667 5.00001L15.8333 5.00001V6.66667ZM5.83333 10L10 10L10 14.1667L5.83333 14.1667L5.83333 10Z",fill:v.grey.grey400})})};var Wn;!function(e){var t,r;(t=e.ClockTypeEnum||(e.ClockTypeEnum={})).am="am",t.pm="pm",(r=e.DatpickerNavigationDirectionEnum||(e.DatpickerNavigationDirectionEnum={})).right="right",r.left="left"}(Wn||(Wn={}));const Xn=(e,t)=>!!(t>1&&e),Kn=["Su","Mo","Tu","We","Th","Fr","Sa"],qn=(e,t,r,n)=>new Dr.DateObject(((e,t,r)=>st(e).subtract(t,r))(e,t,r)[n]("week").format("YYYY-MM-DD")),Gn={TODAY:[new Dr.DateObject,new Dr.DateObject],CURRENT_WEEK:[(new Dr.DateObject).toFirstOfWeek(),(new Dr.DateObject).toLastOfWeek()],LAST_7_DAYS:[(new Dr.DateObject).subtract(6,"days"),new Dr.DateObject],LAST_WEEK:[qn(new Date,1,"week","startOf"),qn(new Date,1,"week","endOf")],LAST_2_WEEKS:[qn(new Date,2,"week","startOf"),qn(new Date,1,"week","endOf")],LAST_3_WEEKS:[qn(new Date,3,"week","startOf"),qn(new Date,1,"week","endOf")],LAST_4_WEEKS:[qn(new Date,4,"week","startOf"),qn(new Date,1,"week","endOf")],LAST_30_DAYS:[(new Dr.DateObject).subtract(29,"days"),new Dr.DateObject],THIS_MONTH:[(new Dr.DateObject).toFirstOfMonth(),(new Dr.DateObject).toLastOfMonth()],PAST_MONTH:[new Dr.DateObject(st().subtract(1,"month").startOf("month").format("YYYY-MM-DD")),new Dr.DateObject(st().subtract(1,"month").endOf("month").format("YYYY-MM-DD"))],CUSTOM_RANGE:[],NOW:[(new Dr.DateObject).set("second",0),(new Dr.DateObject).set("second",0)],LAST_HOUR:[(new Dr.DateObject).subtract(1,"hour").set("second",0),(new Dr.DateObject).set("second",0)],YESTERDAY:[new Dr.DateObject(st().subtract(1,"day").startOf("day").format("YYYY-MM-DD")),new Dr.DateObject(st().subtract(1,"day").endOf("day").format("YYYY-MM-DD"))],CUSTOM_RANGE_LOCATION_PLAN:[new Dr.DateObject,new Dr.DateObject]},Jn=e=>e instanceof Dr.DateObject?!st(e.format("YYYY-MM-DD")).isSame(st().startOf("month"),"month"):!st(e).isSame(st().startOf("month"),"month"),ea=[{key:"from",label:"From"},{key:"to",label:"To"}],ta=e=>{const t=("0"+e).slice(-2);return"0"===t?"00":t},ra=(t,r)=>e.jsx($n,{onClick:e=>{e.stopPropagation(),r?.(e)},children:t===Wn.DatpickerNavigationDirectionEnum.right?Un.chevronRight:Un.chevronLeft}),na=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],aa=["Su","Mo","Tu","We","Th","Fr","Sa"],ca=e=>{const t=st().format("YYYY-MM-DD"),{dateRange:r,timeRange:n}=e||{},{startDate:a,endDate:c}=r||{},{from:i,to:o}=n||{};return{startDate:`${a||t}T${ia(`${i?.hour}:${i?.minute}:${i?.clockType}`)}:00`,endDate:`${c||t}T${ia(`${o?.hour}:${o?.minute}:${o?.clockType}`)}:00`}},ia=e=>{const[t,r,n]=e.split(":"),a="pm"===n,c=parseInt(t),i=parseInt(r);let o=c;a&&c<12?o+=12:a&&c>12?o-=12:a||12!==c||(o=0);return`${o.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`},oa=e=>{const t=String(e>12?e-12:e);return ta(t)},sa=e=>{const{startDate:t,endDate:r}=e,[n,a]=t.split("T"),[c,i]=a.split(":"),[o,s]=r.split("T"),[l,h]=s.split(":"),v=Number(c),p=Number(l);return{startDateOnly:n,endDateOnly:o,time:{from:{hour:"00"===oa(v)?"12":oa(v),minute:i,clockType:v>12?Wn.ClockTypeEnum.pm:Wn.ClockTypeEnum.am},to:{hour:"00"===oa(p)?"12":oa(p),minute:h,clockType:p>12?Wn.ClockTypeEnum.pm:Wn.ClockTypeEnum.am}}}},la=(e,t,r)=>`${st(e).format(t)||""} ${"00"===r.hour?"12":r.hour}:${r.minute||"00"} ${r.clockType.toUpperCase()}`,ha=t.div`
2057
+ `,Un={chevronLeft:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M11.6736 2.5799L10.4869 1.3999L3.89355 7.9999L10.4936 14.5999L11.6736 13.4199L6.25355 7.9999L11.6736 2.5799Z",fill:v.grey.grey900})}),chevronRight:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4.32715 13.4199L5.50715 14.5999L12.1071 7.9999L5.50715 1.3999L4.32715 2.5799L9.74715 7.9999L4.32715 13.4199Z",fill:v.grey.grey900})}),calendar:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15.8333 3.33334H15V1.66667L13.3333 1.66667V3.33334L6.66667 3.33334V1.66667L5 1.66667V3.33334H4.16667C3.24167 3.33334 2.5 4.08334 2.5 5.00001L2.5 16.6667C2.5 17.5833 3.24167 18.3333 4.16667 18.3333H15.8333C16.75 18.3333 17.5 17.5833 17.5 16.6667V5.00001C17.5 4.08334 16.75 3.33334 15.8333 3.33334ZM15.8333 16.6667H4.16667L4.16667 8.33334L15.8333 8.33334L15.8333 16.6667ZM15.8333 6.66667L4.16667 6.66667L4.16667 5.00001L15.8333 5.00001V6.66667ZM5.83333 10L10 10L10 14.1667L5.83333 14.1667L5.83333 10Z",fill:v.grey.grey400})})};var Wn;!function(e){var t,r;(t=e.ClockTypeEnum||(e.ClockTypeEnum={})).am="am",t.pm="pm",(r=e.DatpickerNavigationDirectionEnum||(e.DatpickerNavigationDirectionEnum={})).right="right",r.left="left"}(Wn||(Wn={}));const Xn=(e,t)=>!!(t>1&&e),Kn=["Su","Mo","Tu","We","Th","Fr","Sa"],qn=(e,t,r,n)=>new Dr.DateObject(((e,t,r)=>st(e).subtract(t,r))(e,t,r)[n]("week").format("YYYY-MM-DD")),Gn={TODAY:[new Dr.DateObject,new Dr.DateObject],CURRENT_WEEK:[(new Dr.DateObject).toFirstOfWeek(),(new Dr.DateObject).toLastOfWeek()],LAST_7_DAYS:[(new Dr.DateObject).subtract(6,"days"),new Dr.DateObject],LAST_WEEK:[qn(new Date,1,"week","startOf"),qn(new Date,1,"week","endOf")],LAST_2_WEEKS:[qn(new Date,2,"week","startOf"),qn(new Date,1,"week","endOf")],LAST_3_WEEKS:[qn(new Date,3,"week","startOf"),qn(new Date,1,"week","endOf")],LAST_4_WEEKS:[qn(new Date,4,"week","startOf"),qn(new Date,1,"week","endOf")],LAST_30_DAYS:[(new Dr.DateObject).subtract(29,"days"),new Dr.DateObject],THIS_MONTH:[(new Dr.DateObject).toFirstOfMonth(),(new Dr.DateObject).toLastOfMonth()],PAST_MONTH:[new Dr.DateObject(st().subtract(1,"month").startOf("month").format("YYYY-MM-DD")),new Dr.DateObject(st().subtract(1,"month").endOf("month").format("YYYY-MM-DD"))],CUSTOM_RANGE:[],NOW:[(new Dr.DateObject).set("second",0),(new Dr.DateObject).set("second",0)],LAST_HOUR:[(new Dr.DateObject).subtract(1,"hour").set("second",0),(new Dr.DateObject).set("second",0)],YESTERDAY:[new Dr.DateObject(st().subtract(1,"day").startOf("day").format("YYYY-MM-DD")),new Dr.DateObject(st().subtract(1,"day").endOf("day").format("YYYY-MM-DD"))],CUSTOM_RANGE_LOCATION_PLAN:[new Dr.DateObject,new Dr.DateObject]},Jn=e=>e instanceof Dr.DateObject?!st(e.format("YYYY-MM-DD")).isSame(st().startOf("month"),"month"):!st(e).isSame(st().startOf("month"),"month"),ea=[{key:"from",label:"From"},{key:"to",label:"To"}],ta=e=>{const t=("0"+e).slice(-2);return"0"===t?"00":t},ra=(t,r)=>e.jsx($n,{onClick:e=>{e.stopPropagation(),r?.(e)},children:t===Wn.DatpickerNavigationDirectionEnum.right?Un.chevronRight:Un.chevronLeft}),na=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],aa=["Su","Mo","Tu","We","Th","Fr","Sa"],ca=e=>{const t=st().format("YYYY-MM-DD"),{dateRange:r,timeRange:n}=e||{},{startDate:a,endDate:c}=r||{},{from:i,to:o}=n||{};return{startDate:`${a||t}T${ia(`${i?.hour}:${i?.minute}:${i?.clockType}`)}:00`,endDate:`${c||t}T${ia(`${o?.hour}:${o?.minute}:${o?.clockType}`)}:00`}},ia=e=>{const[t,r,n]=e.split(":"),a="pm"===n,c=parseInt(t),i=parseInt(r);let o=c;a&&c<12?o+=12:a&&c>12?o-=12:a||12!==c||(o=0);return`${o.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`},oa=e=>{const t=String(e>12?e-12:e);return ta(t)},sa=e=>{const{startDate:t,endDate:r}=e,[n,a]=t.split("T"),[c,i]=a.split(":"),[o,s]=r.split("T"),[l,h]=s.split(":"),v=Number(c),p=Number(l);return{startDateOnly:n,endDateOnly:o,time:{from:{hour:"00"===oa(v)?"12":oa(v),minute:i,clockType:v>=12?Wn.ClockTypeEnum.pm:Wn.ClockTypeEnum.am},to:{hour:"00"===oa(p)?"12":oa(p),minute:h,clockType:p>=12?Wn.ClockTypeEnum.pm:Wn.ClockTypeEnum.am}}}},la=(e,t,r)=>`${st(e).format(t)||""} ${"00"===r.hour?"12":r.hour}:${r.minute||"00"} ${r.clockType.toUpperCase()}`,ha=t.div`
2050
2058
  border-radius: 8px;
2051
2059
  width: fit-content;
2052
2060
  display: flex;
@@ -2140,7 +2148,7 @@
2140
2148
  `;var ya;t.div`
2141
2149
  display: flex;
2142
2150
  cursor: pointer;
2143
- `,function(e){var t;(t=e.DatpickerNavigationDirectionEnum||(e.DatpickerNavigationDirectionEnum={})).right="right",t.left="left"}(ya||(ya={}));const xa={chevronLeft:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M11.6736 2.5799L10.4869 1.3999L3.89355 7.9999L10.4936 14.5999L11.6736 13.4199L6.25355 7.9999L11.6736 2.5799Z",fill:v.grey.grey900})}),chevronRight:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4.32715 13.4199L5.50715 14.5999L12.1071 7.9999L5.50715 1.3999L4.32715 2.5799L9.74715 7.9999L4.32715 13.4199Z",fill:v.grey.grey900})}),calendar:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15.8333 3.33334H15V1.66667L13.3333 1.66667V3.33334L6.66667 3.33334V1.66667L5 1.66667V3.33334H4.16667C3.24167 3.33334 2.5 4.08334 2.5 5.00001L2.5 16.6667C2.5 17.5833 3.24167 18.3333 4.16667 18.3333H15.8333C16.75 18.3333 17.5 17.5833 17.5 16.6667V5.00001C17.5 4.08334 16.75 3.33334 15.8333 3.33334ZM15.8333 16.6667H4.16667L4.16667 8.33334L15.8333 8.33334L15.8333 16.6667ZM15.8333 6.66667L4.16667 6.66667L4.16667 5.00001L15.8333 5.00001V6.66667ZM5.83333 10L10 10L10 14.1667L5.83333 14.1667L5.83333 10Z",fill:v.grey.grey900})})},Za=({title:t,selected:r,onClick:n})=>e.jsx(pa,{selected:r,onClick:n,children:e.jsx(re,{category:"body2",weight:"medium",color:r?v.blue.blue1000:v.grey.grey900,children:t})},t),Oa=({options:t,selectedOption:r,onOptionClick:n})=>e.jsx(va,{children:t?.map((t=>e.jsx(Za,{...t,onClick:()=>n(t.value,t),selected:r===t.title},t.title)))}),Ma=({label:t="",timeHour:r="",timeMinute:n="",clockType:a="am",disabled:c=!0,onClockTypeChange:i,onHourChange:o,onMinuteChange:s})=>e.jsxs(wa,{children:[e.jsx(_a,{children:t}),e.jsxs(ma,{children:[e.jsx(ua,{type:"number",value:r,disabled:c,onChange:e=>{const r=e.target.value,n=ta(r);Number(r)<=12?o(t.toLowerCase(),n):o(t.toLowerCase(),"12")}}),e.jsx(ga,{children:":"}),e.jsx(ua,{type:"number",value:n,disabled:c,onChange:e=>{const r=e.target.value,n=ta(r);Number(r)<=59?s(t.toLowerCase(),n):s(t.toLowerCase(),"59")}}),e.jsx(da,{content:[{key:"am",label:"AM"},{key:"pm",label:"PM"}],activeKey:a,onClick:e=>{i(t.toLowerCase(),e)},disabled:c})]})]}),Ea=(t,r)=>e.jsx(ba,{onClick:r,children:t===ya.DatpickerNavigationDirectionEnum.right?xa.chevronRight:xa.chevronLeft}),Ha="MM/DD/YYYY",Pa=r.forwardRef(((t,n)=>{const{range:a,numberOfMonths:c=1,format:i=Ha,onChange:o,label:s,placeholder:l=Ha,required:h,readOnly:v,errorMessage:p,calendarRef:u,inputProps:g,showTime:m,dateTimeRange:d,onChangeDateTime:f,..._}=t,{time:w,setTime:b}=lt(),[y,x]=r.useState(""),[Z,O]=r.useState(""),M=(e,t,r)=>{if(!w)return;const n={...w,[e]:{...w[e],[r]:t}};b?.(n)},E=e=>{const[t,r]=(n=e,n?Array.isArray(n)&&2===n.length?`${n[0].format("YYYY-MM-DD")} * ${n[1].format("YYYY-MM-DD")}`:Array.isArray(n)&&1===n.length?n[0].format("YYYY-MM-DD"):"":"").split(" * ");var n;x(t),O(r)};return r.useEffect((()=>{if(d?.startDate?.includes("T")&&d?.endDate?.includes("T")){const{startDateOnly:e,endDateOnly:t,time:r}=sa(d);x(e),O(t),b(r)}}),[]),e.jsx(Qn,{showTime:m,className:"date-picker",children:e.jsx(Fn,{renderButton:ra,className:"date-picker-"+(Xn(a,c)?"range":"single"),ref:u,range:a,months:na,numberOfMonths:c,showOtherDays:!0,weekDays:aa,render:(t,r,a)=>e.jsx(ze,{rightSection:e.jsx(Yn,{onClick:()=>{!v&&r()},children:Un.calendar}),placeholder:l,value:m&&t?y&&Z?`${la(y,i,w.from)} ~ ${la(Z,i,w.to)}`:"":t,onClick:()=>{!v&&r()},onChange:e=>{((e,t)=>{const r=e.target.value.match(/[^0-9/]/g);Array.isArray(r)||t(e)})(e,a)},label:s,required:h,readOnly:v,error:!!p,errorMessage:p,onFocusCapture:()=>{!v&&r()},ref:n,...g}),onChange:e=>{m?E(e):o&&o(e)},format:i,portal:!0,onClose:()=>{if(m){const e=ca({dateRange:{startDate:y,endDate:Z},timeRange:w});f(e)}},..._,children:m&&e.jsx(fa,{children:ea.map((t=>{const r=w?.[t.key];return e.jsx(Ma,{disabled:!1,label:t.label,timeHour:r?.hour,timeMinute:r?.minute,clockType:r?.clockType,onClockTypeChange:(e,t)=>{M(e,t,"clockType")},onHourChange:(e,t)=>{M(e,t,"hour")},onMinuteChange:(e,t)=>{M(e,t,"minute")}},t.key)}))})})})})),ja=t.div`
2151
+ `,function(e){var t;(t=e.DatpickerNavigationDirectionEnum||(e.DatpickerNavigationDirectionEnum={})).right="right",t.left="left"}(ya||(ya={}));const xa={chevronLeft:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M11.6736 2.5799L10.4869 1.3999L3.89355 7.9999L10.4936 14.5999L11.6736 13.4199L6.25355 7.9999L11.6736 2.5799Z",fill:v.grey.grey900})}),chevronRight:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4.32715 13.4199L5.50715 14.5999L12.1071 7.9999L5.50715 1.3999L4.32715 2.5799L9.74715 7.9999L4.32715 13.4199Z",fill:v.grey.grey900})}),calendar:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15.8333 3.33334H15V1.66667L13.3333 1.66667V3.33334L6.66667 3.33334V1.66667L5 1.66667V3.33334H4.16667C3.24167 3.33334 2.5 4.08334 2.5 5.00001L2.5 16.6667C2.5 17.5833 3.24167 18.3333 4.16667 18.3333H15.8333C16.75 18.3333 17.5 17.5833 17.5 16.6667V5.00001C17.5 4.08334 16.75 3.33334 15.8333 3.33334ZM15.8333 16.6667H4.16667L4.16667 8.33334L15.8333 8.33334L15.8333 16.6667ZM15.8333 6.66667L4.16667 6.66667L4.16667 5.00001L15.8333 5.00001V6.66667ZM5.83333 10L10 10L10 14.1667L5.83333 14.1667L5.83333 10Z",fill:v.grey.grey900})})},Za=({title:t,selected:r,onClick:n})=>e.jsx(pa,{selected:r,onClick:n,children:e.jsx(re,{category:"body2",weight:"medium",color:r?v.blue.blue1000:v.grey.grey900,children:t})},t),Oa=({options:t,selectedOption:r,onOptionClick:n})=>e.jsx(va,{children:t?.map((t=>e.jsx(Za,{...t,onClick:()=>n(t.value,t),selected:r===t.title},t.title)))}),Ma=({label:t="",timeHour:r="",timeMinute:n="",clockType:a="am",disabled:c=!0,onClockTypeChange:i,onHourChange:o,onMinuteChange:s})=>e.jsxs(wa,{children:[e.jsx(_a,{children:t}),e.jsxs(ma,{children:[e.jsx(ua,{type:"number",value:r,disabled:c,onChange:e=>{const r=e.target.value,n="0"===r?"01":ta(r);Number(r)<=12?o(t.toLowerCase(),n):o(t.toLowerCase(),"12")},min:1}),e.jsx(ga,{children:":"}),e.jsx(ua,{type:"number",value:n,disabled:c,onChange:e=>{const r=e.target.value,n=ta(r);Number(r)<=59?s(t.toLowerCase(),n):s(t.toLowerCase(),"59")},min:0}),e.jsx(da,{content:[{key:"am",label:"AM"},{key:"pm",label:"PM"}],activeKey:a,onClick:e=>{i(t.toLowerCase(),e)},disabled:c})]})]}),Ea=(t,r)=>e.jsx(ba,{onClick:r,children:t===ya.DatpickerNavigationDirectionEnum.right?xa.chevronRight:xa.chevronLeft}),Ha="MM/DD/YYYY",Pa=r.forwardRef(((t,n)=>{const{range:a,numberOfMonths:c=1,format:i=Ha,onChange:o,label:s,placeholder:l=Ha,required:h,readOnly:v,errorMessage:p,calendarRef:u,inputProps:g,showTime:m,dateTimeRange:d,onChangeDateTime:f,..._}=t,{time:w,setTime:b}=lt(),[y,x]=r.useState(""),[Z,O]=r.useState(""),M=(e,t,r)=>{if(!w)return;const n={...w,[e]:{...w[e],[r]:t}};b?.(n)},E=e=>{const[t,r]=(n=e,n?Array.isArray(n)&&2===n.length?`${n[0].format("YYYY-MM-DD")} * ${n[1].format("YYYY-MM-DD")}`:Array.isArray(n)&&1===n.length?n[0].format("YYYY-MM-DD"):"":"").split(" * ");var n;t&&r&&(x(t),O(r))};return r.useEffect((()=>{if(d?.startDate?.includes("T")&&d?.endDate?.includes("T")){const{startDateOnly:e,endDateOnly:t,time:r}=sa(d);x(e),O(t),b(r)}}),[]),r.useEffect((()=>{_.value||(x(""),O(""))}),[_.value]),r.useEffect((()=>{if(m&&y&&Z&&w){const e=ca({dateRange:{startDate:y,endDate:Z},timeRange:w});f(e)}}),[y,Z,w]),e.jsx(Qn,{showTime:m,className:"date-picker",children:e.jsx(Fn,{renderButton:ra,className:"date-picker-"+(Xn(a,c)?"range":"single"),ref:u,range:a,months:na,numberOfMonths:c,showOtherDays:!0,weekDays:aa,render:(t,r,a)=>e.jsx(ze,{rightSection:e.jsx(Yn,{onClick:()=>{!v&&r()},children:Un.calendar}),placeholder:l,value:m&&t?y&&Z?`${la(y,i,w.from)} ~ ${la(Z,i,w.to)}`:"":t,onClick:()=>{!v&&r()},onChange:e=>{((e,t)=>{const r=e.target.value.match(/[^0-9/]/g);Array.isArray(r)||t(e)})(e,a)},label:s,required:h,readOnly:v,error:!!p,errorMessage:p,onFocusCapture:()=>{!v&&r()},ref:n,...g}),onChange:e=>{m?E(e):o&&o(e)},format:i,portal:!0,..._,children:m&&e.jsx(fa,{children:ea.map((t=>{const r=w?.[t.key];return e.jsx(Ma,{disabled:!1,label:t.label,timeHour:r?.hour,timeMinute:r?.minute,clockType:r?.clockType,onClockTypeChange:(e,t)=>{M(e,t,"clockType")},onHourChange:(e,t)=>{M(e,t,"hour")},onMinuteChange:(e,t)=>{M(e,t,"minute")}},t.key)}))})})})})),ja=t.div`
2144
2152
  .xsmall {
2145
2153
  width: 20px;
2146
2154
  height: 20px;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kwant-ui",
3
- "version": "3.36.0-stable.1",
3
+ "version": "3.36.0-stable.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "types": "./dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kwant-ui",
3
- "version": "3.36.0-stable.1",
3
+ "version": "3.36.0-stable.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "types": "./dist/index.d.ts",