kwant-ui 3.36.0-stable.0 → 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, {
@@ -7,6 +7,7 @@ type HorizontalStepperType = {
7
7
  activeStep?: any;
8
8
  setActiveStep?: any;
9
9
  navigateOnStepClick?: boolean;
10
+ onStepChange?: (value: any) => void;
10
11
  };
11
- declare const HorizontalStepper: ({ activeStep, setActiveStep, navigateOnStepClick, ...props }: HorizontalStepperType) => import("react/jsx-runtime").JSX.Element;
12
+ declare const HorizontalStepper: ({ activeStep, setActiveStep, navigateOnStepClick, onStepChange, ...props }: HorizontalStepperType) => import("react/jsx-runtime").JSX.Element;
12
13
  export { HorizontalStepper };
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%;
@@ -1811,7 +1819,7 @@ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n,{css as
1811
1819
  }
1812
1820
  }
1813
1821
  }
1814
- `,jr=({activeStep:r,setActiveStep:n,navigateOnStepClick:a=!0,...c})=>{const i=c.direction||"column",o="row"===i?"left":c.align||"center",s=c.steps||[{label:"",value:"1",status:""},{label:"",value:"2",status:""}],l=e=>{n(e)};return e(Pr,{direction:i,children:e("div",{className:"horizontal-stepper",children:s&&s.map(((n,c)=>{const h=s.length-1===c,v=r===n.value,p=s.findIndex((e=>r===e.value)),u="failed"===n.status,g=r!==n.value&&c<p;return t("div",{className:`horizontal-stepper__step ${u?"error-step":!u&&g?"completed-step":""}\n ${h&&"last-step"} ${v&&"current-step"} align-${o} direction-${i}`,children:[e("div",{className:"horizontal-stepper__step__body",children:t("div",{className:"horizontal-stepper__step__body__bullet",onClick:()=>(e=>{a&&l(e)})(n.value),children:[e(Hr,{current:v,step:`${c+1}`,children:e("input",{onClick:()=>{l(n.value)},id:"bullet",type:"radio"})}),e("label",{className:"bullet-label",children:n.label||""})]})}),e("div",{className:`horizontal-stepper__step__indicator ${g&&"active-indicator"}`})]},c)}))})})},Vr=n.div`
1822
+ `,jr=({activeStep:r,setActiveStep:n,navigateOnStepClick:a=!0,onStepChange:c,...i})=>{const o=i.direction||"column",s="row"===o?"left":i.align||"center",l=i.steps||[{label:"",value:"1",status:""},{label:"",value:"2",status:""}],h=e=>{n?.(e),c?.(e)};return e(Pr,{direction:o,children:e("div",{className:"horizontal-stepper",children:l&&l.map(((n,c)=>{const i=l.length-1===c,v=r===n.value,p=l.findIndex((e=>r===e.value)),u="failed"===n.status,g=r!==n.value&&c<p;return t("div",{className:`horizontal-stepper__step ${u?"error-step":!u&&g?"completed-step":""}\n ${i&&"last-step"} ${v&&"current-step"} align-${s} direction-${o}`,children:[e("div",{className:"horizontal-stepper__step__body",children:t("div",{className:"horizontal-stepper__step__body__bullet",onClick:()=>(e=>{a&&h(e)})(n.value),children:[e(Hr,{current:v,step:`${c+1}`,children:e("input",{onClick:()=>{h(n.value)},id:"bullet",type:"radio"})}),e("label",{className:"bullet-label",children:n.label||""})]})}),e("div",{className:`horizontal-stepper__step__indicator ${g&&"active-indicator"}`})]},c)}))})})},Vr=n.div`
1815
1823
  border: ${e=>e.strokeWidth+"px"} solid ${e=>e.color};
1816
1824
  border-left-color: ${A.grey.grey200};
1817
1825
  border-radius: 50%;
@@ -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;