sodtrack-web-ui 0.51.3 → 0.52.0

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.
Files changed (102) hide show
  1. package/dist/accordion-form.js +2 -2
  2. package/dist/accordion-form.mjs +1 -1
  3. package/dist/accordion.js +2 -2
  4. package/dist/accordion.mjs +1 -1
  5. package/dist/alert-dialog.js +2 -2
  6. package/dist/alert-dialog.mjs +1 -1
  7. package/dist/alert-message.js +2 -2
  8. package/dist/alert-message.mjs +1 -1
  9. package/dist/avatar.mjs +1 -1
  10. package/dist/button.js +2 -2
  11. package/dist/button.mjs +1 -1
  12. package/dist/calendar.mjs +1 -1
  13. package/dist/checkbox.js +2 -2
  14. package/dist/checkbox.mjs +1 -1
  15. package/dist/chip-form-complementary.d.mts +3 -3
  16. package/dist/chip-form-complementary.d.ts +3 -3
  17. package/dist/chip-form.d.mts +3 -3
  18. package/dist/chip-form.d.ts +3 -3
  19. package/dist/chip-input.js +2 -2
  20. package/dist/chip-input.mjs +1 -1
  21. package/dist/chip-status-complementary.d.mts +1 -1
  22. package/dist/chip-status-complementary.d.ts +1 -1
  23. package/dist/{chunk-3EAPAHQO.mjs → chunk-27KPDDYB.mjs} +1 -1
  24. package/dist/{chunk-HWLLVJWJ.mjs → chunk-5E3VGYQJ.mjs} +1 -1
  25. package/dist/{chunk-6CCSHVKZ.mjs → chunk-5FC6Y6GC.mjs} +1 -1
  26. package/dist/{chunk-WGOFOREW.mjs → chunk-5YIWTLVY.mjs} +1 -1
  27. package/dist/{chunk-L2JEVDDH.mjs → chunk-6AFCO3N6.mjs} +1 -1
  28. package/dist/{chunk-A5A22HEL.mjs → chunk-6NIMZBNH.mjs} +1 -1
  29. package/dist/{chunk-AZOZKDKH.mjs → chunk-7RQ3O67S.mjs} +1 -1
  30. package/dist/chunk-7TPCN744.mjs +1 -0
  31. package/dist/{chunk-2VL36SBW.mjs → chunk-AQPJ5OS4.mjs} +1 -1
  32. package/dist/chunk-B65IFRKA.mjs +1 -0
  33. package/dist/{chunk-2GJHRBSH.mjs → chunk-L43TLWY4.mjs} +1 -1
  34. package/dist/{chunk-5UJVYIVN.mjs → chunk-MLQUPPLV.mjs} +1 -1
  35. package/dist/{chunk-562EYVK4.mjs → chunk-N42EN3DO.mjs} +1 -1
  36. package/dist/{chunk-UGGS6W5K.mjs → chunk-P7XUCLSY.mjs} +1 -1
  37. package/dist/chunk-PTBL4WCK.mjs +1 -0
  38. package/dist/{chunk-ZJOF2Z6O.mjs → chunk-QMBF563Y.mjs} +1 -1
  39. package/dist/chunk-QUFOGBCP.mjs +1 -0
  40. package/dist/{chunk-VU35PLD2.mjs → chunk-RLWH7O3A.mjs} +1 -1
  41. package/dist/{chunk-TGTW7UYA.mjs → chunk-SNIFUQVS.mjs} +10 -2
  42. package/dist/{chunk-PL44ZCIA.mjs → chunk-T22XDFYS.mjs} +1 -1
  43. package/dist/{chunk-5IDTRNUI.mjs → chunk-THQYCFLR.mjs} +1 -1
  44. package/dist/{chunk-HILDVXOO.mjs → chunk-VEYMK4K2.mjs} +1 -1
  45. package/dist/{chunk-JO4I3WWL.mjs → chunk-X3GM445W.mjs} +1 -1
  46. package/dist/{chunk-TGANR27R.mjs → chunk-XCVRZRCP.mjs} +1 -1
  47. package/dist/{chunk-Z7A5HM3M.mjs → chunk-XSOK32QE.mjs} +1 -1
  48. package/dist/{chunk-OA64AHYH.mjs → chunk-YG4GZU65.mjs} +1 -1
  49. package/dist/{chunk-JDBAUMA2.mjs → chunk-Z7HQYK3T.mjs} +1 -1
  50. package/dist/{chunk-FGMEWKU3.mjs → chunk-ZXOJX4FK.mjs} +1 -1
  51. package/dist/country-text-field.js +2 -2
  52. package/dist/country-text-field.mjs +1 -1
  53. package/dist/data-table.js +2 -2
  54. package/dist/data-table.mjs +1 -1
  55. package/dist/date-picker.mjs +1 -1
  56. package/dist/dialog.js +2 -2
  57. package/dist/dialog.mjs +1 -1
  58. package/dist/drawer-sticky.js +2 -2
  59. package/dist/drawer-sticky.mjs +1 -1
  60. package/dist/drawer.js +2 -2
  61. package/dist/drawer.mjs +1 -1
  62. package/dist/flag-select.js +2 -2
  63. package/dist/flag-select.mjs +1 -1
  64. package/dist/icons.d.mts +2 -1
  65. package/dist/icons.d.ts +2 -1
  66. package/dist/icons.js +10 -2
  67. package/dist/icons.mjs +1 -1
  68. package/dist/index.d.mts +2 -1
  69. package/dist/index.d.ts +2 -1
  70. package/dist/index.js +10 -2
  71. package/dist/index.mjs +1 -1
  72. package/dist/list-item-arrow.js +2 -2
  73. package/dist/list-item-arrow.mjs +1 -1
  74. package/dist/list-item-checkbox.js +2 -2
  75. package/dist/list-item-checkbox.mjs +1 -1
  76. package/dist/list-item.mjs +1 -1
  77. package/dist/rating.d.mts +4 -6
  78. package/dist/rating.d.ts +4 -6
  79. package/dist/rating.js +10 -2
  80. package/dist/rating.mjs +1 -1
  81. package/dist/search-bar.js +2 -2
  82. package/dist/search-bar.mjs +1 -1
  83. package/dist/select.js +2 -2
  84. package/dist/select.mjs +1 -1
  85. package/dist/snackbar.js +2 -2
  86. package/dist/snackbar.mjs +1 -1
  87. package/dist/spinner.js +2 -2
  88. package/dist/spinner.mjs +1 -1
  89. package/dist/tab.d.mts +1 -1
  90. package/dist/tab.d.ts +1 -1
  91. package/dist/tab.js +2 -2
  92. package/dist/tab.mjs +1 -1
  93. package/dist/table.js +2 -2
  94. package/dist/table.mjs +1 -1
  95. package/dist/text-field.js +2 -2
  96. package/dist/text-field.mjs +1 -1
  97. package/dist/time-picker.mjs +1 -1
  98. package/package.json +1 -1
  99. package/dist/chunk-AJC4WJ6X.mjs +0 -1
  100. package/dist/chunk-MVFX36ZC.mjs +0 -1
  101. package/dist/chunk-QQOVYZR6.mjs +0 -1
  102. package/dist/chunk-TYHJTIAW.mjs +0 -1
@@ -1 +1 @@
1
- import {c as c$1}from'./chunk-2VL36SBW.mjs';import {f,b,c,e,d}from'./chunk-TYHJTIAW.mjs';import {a}from'./chunk-2WINTZSS.mjs';import {useState}from'react';import {tv}from'tailwind-variants';import {jsxs,jsx}from'react/jsx-runtime';var M=tv({slots:{container:"flex flex-shrink-0 justify-between rounded-lg",icon:"mr-3 h-[1.375rem] w-[1.375rem] shrink-0"},variants:{hasCloseButton:{true:{container:"pr-2"}},size:{sm:{container:"p-2"},md:{container:"p-4"},lg:{container:"p-4"}},variant:{warning:{container:"bg-warning-100",icon:"text-warning-500"},success:{container:"bg-success-100",icon:"text-success-500"},error:{container:"bg-error-100",icon:"text-error-500"},info:{container:"bg-info-100",icon:"text-info-500"}}},defaultVariants:{variant:"info",size:"md",hasCloseButton:!0}}),S=({variant:s,className:u,description:N,size:n,title:i,hasCloseButton:c$2=!0,actionButton:a$1})=>{let[x,h]=useState(!0),{container:v,icon:t}=M({variant:s,hasCloseButton:c$2,size:n});return jsxs("div",{className:a(v(),u,!x&&"hidden"),children:[jsxs("div",{className:"flex flex-1 items-center justify-between gap-2",children:[jsxs("div",{className:"flex",children:[s==="warning"&&jsx(f,{className:t()}),s==="success"&&jsx(b,{className:t()}),s==="error"&&jsx(c,{className:t()}),s==="info"&&jsx(e,{className:t({})}),n==="sm"&&jsx("p",{className:"leading-[130%]",children:i}),n!=="sm"&&jsxs("div",{className:"flex flex-col",children:[jsx("h6",{className:"font-semibold leading-[130%]",children:i}),jsx("p",{className:"mt-1 text-sm leading-[130%] text-neutral-700",children:N})]})]}),a$1&&jsx(c$1,{...a$1,variant:"white",className:a("mr-1",a$1.className),size:"md"})]}),c$2&&jsx(d,{className:"-mt-1 ml-4 size-6 shrink-0 cursor-pointer",onClick:()=>h(!1)})]})};export{S as a};
1
+ import {c as c$1}from'./chunk-AQPJ5OS4.mjs';import {f,b,c,e,d}from'./chunk-7TPCN744.mjs';import {a}from'./chunk-2WINTZSS.mjs';import {useState}from'react';import {tv}from'tailwind-variants';import {jsxs,jsx}from'react/jsx-runtime';var M=tv({slots:{container:"flex flex-shrink-0 justify-between rounded-lg",icon:"mr-3 h-[1.375rem] w-[1.375rem] shrink-0"},variants:{hasCloseButton:{true:{container:"pr-2"}},size:{sm:{container:"p-2"},md:{container:"p-4"},lg:{container:"p-4"}},variant:{warning:{container:"bg-warning-100",icon:"text-warning-500"},success:{container:"bg-success-100",icon:"text-success-500"},error:{container:"bg-error-100",icon:"text-error-500"},info:{container:"bg-info-100",icon:"text-info-500"}}},defaultVariants:{variant:"info",size:"md",hasCloseButton:!0}}),S=({variant:s,className:u,description:N,size:n,title:i,hasCloseButton:c$2=!0,actionButton:a$1})=>{let[x,h]=useState(!0),{container:v,icon:t}=M({variant:s,hasCloseButton:c$2,size:n});return jsxs("div",{className:a(v(),u,!x&&"hidden"),children:[jsxs("div",{className:"flex flex-1 items-center justify-between gap-2",children:[jsxs("div",{className:"flex",children:[s==="warning"&&jsx(f,{className:t()}),s==="success"&&jsx(b,{className:t()}),s==="error"&&jsx(c,{className:t()}),s==="info"&&jsx(e,{className:t({})}),n==="sm"&&jsx("p",{className:"leading-[130%]",children:i}),n!=="sm"&&jsxs("div",{className:"flex flex-col",children:[jsx("h6",{className:"font-semibold leading-[130%]",children:i}),jsx("p",{className:"mt-1 text-sm leading-[130%] text-neutral-700",children:N})]})]}),a$1&&jsx(c$1,{...a$1,variant:"white",className:a("mr-1",a$1.className),size:"md"})]}),c$2&&jsx(d,{className:"-mt-1 ml-4 size-6 shrink-0 cursor-pointer",onClick:()=>h(!1)})]})};export{S as a};
@@ -1,4 +1,4 @@
1
- import {forwardRef,createElement}from'react';var B=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),c=(...t)=>t.filter((e,u,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===u).join(" ").trim();var F={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var D=forwardRef(({color:t="currentColor",size:e=24,strokeWidth:u=2,absoluteStrokeWidth:s,className:n="",children:i,iconNode:R,...q},T)=>createElement("svg",{ref:T,...F,width:e,height:e,stroke:t,strokeWidth:s?Number(u)*24/Number(e):u,className:c("lucide",n),...q},[...R.map(([y,b])=>createElement(y,b)),...Array.isArray(i)?i:[i]]));var a=(t,e)=>{let u=forwardRef(({className:s,...n},i)=>createElement(D,{ref:i,iconNode:e,className:c(`lucide-${B(t)}`,s),...n}));return u.displayName=`${t}`,u};var p=a("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);var L=a("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var m=a("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var I=a("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var x=a("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var o=a("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);var d=a("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var l=a("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);var C=a("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);var h=a("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var f=a("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);var S=a("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var g=a("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);var w=a("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var k=a("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var r=a("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var P=a("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var A=a("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/*! Bundled license information:
1
+ import {forwardRef,createElement}from'react';var F=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),c=(...t)=>t.filter((e,u,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===u).join(" ").trim();var M={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var R=forwardRef(({color:t="currentColor",size:e=24,strokeWidth:u=2,absoluteStrokeWidth:s,className:n="",children:i,iconNode:q,...T},y)=>createElement("svg",{ref:y,...M,width:e,height:e,stroke:t,strokeWidth:s?Number(u)*24/Number(e):u,className:c("lucide",n),...T},[...q.map(([b,U])=>createElement(b,U)),...Array.isArray(i)?i:[i]]));var a=(t,e)=>{let u=forwardRef(({className:s,...n},i)=>createElement(R,{ref:i,iconNode:e,className:c(`lucide-${F(t)}`,s),...n}));return u.displayName=`${t}`,u};var p=a("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);var L=a("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var m=a("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var I=a("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var x=a("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var o=a("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);var d=a("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var l=a("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);var C=a("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);var h=a("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var f=a("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);var S=a("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var g=a("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);var w=a("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var k=a("StarHalf",[["path",{d:"M12 18.338a2.1 2.1 0 0 0-.987.244L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.12 2.12 0 0 0 1.597-1.16l2.309-4.679A.53.53 0 0 1 12 2",key:"2ksp49"}]]);var P=a("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var r=a("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var A=a("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var B=a("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/*! Bundled license information:
2
2
 
3
3
  lucide-react/dist/esm/shared/src/utils.js:
4
4
  (**
@@ -144,6 +144,14 @@ lucide-react/dist/esm/icons/search.js:
144
144
  * See the LICENSE file in the root directory of this source tree.
145
145
  *)
146
146
 
147
+ lucide-react/dist/esm/icons/star-half.js:
148
+ (**
149
+ * @license lucide-react v0.469.0 - ISC
150
+ *
151
+ * This source code is licensed under the ISC license.
152
+ * See the LICENSE file in the root directory of this source tree.
153
+ *)
154
+
147
155
  lucide-react/dist/esm/icons/star.js:
148
156
  (**
149
157
  * @license lucide-react v0.469.0 - ISC
@@ -183,4 +191,4 @@ lucide-react/dist/esm/lucide-react.js:
183
191
  * This source code is licensed under the ISC license.
184
192
  * See the LICENSE file in the root directory of this source tree.
185
193
  *)
186
- */export{p as a,L as b,m as c,I as d,x as e,o as f,d as g,l as h,C as i,h as j,f as k,S as l,g as m,w as n,k as o,r as p,P as q,A as r};
194
+ */export{p as a,L as b,m as c,I as d,x as e,o as f,d as g,l as h,C as i,h as j,f as k,S as l,g as m,w as n,k as o,P as p,r as q,A as r,B as s};
@@ -1 +1 @@
1
- import {a}from'./chunk-2GJHRBSH.mjs';import {a as a$2}from'./chunk-QHBCNAWO.mjs';import {a as a$1}from'./chunk-2WINTZSS.mjs';import $,{useId,useRef,useState,useEffect}from'react';import*as R from'@radix-ui/react-portal';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var i=56,u=6,q=({options:n,noResults:w,selectedOption:L,onSelect:P,onChange:C,onClick:T,className:k,...I})=>{let N=useId(),l=useRef(null),o=useRef(null),g=useRef(null),[H,M]=useState("bottom"),[r,F]=useState(),[s,c]=useState(-1),[h,y]=useState(L??null),b=e=>{l.current.style.display="none",o.current.value=e.label,y(e),P?.(e);},A=e=>{if(e.key==="ArrowDown"){if(s===n.length-1)return;c(t=>t+1),l.current.style.display="flex",x();}else if(e.key==="ArrowUp"){if(s===0)return;c(t=>t-1),x();}else e.key==="Enter"&&(b(n[s]),c(-1));},x=()=>{let e=i*u;g.current.scroll({top:(s+2)*i<=e?0:i*(s+2)-e,behavior:"smooth"});};return useEffect(()=>{if(!o.current)return;let e=()=>{if(!o.current)return;let t=i*(n.length<u?n.length:u)+16,m=o.current.getBoundingClientRect();F(m);let B=window.innerHeight-m.bottom>t,D=m.top>t;M(B?"bottom":D?"top":"bottom");};return e(),o.current.addEventListener("mousedown",e),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{o.current?.removeEventListener("mousedown",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e);}},[o.current]),useEffect(()=>{function e(t){l.current&&!l.current.contains(t.target)&&(l.current.style.display="none",c(-1));}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e);}},[l.current]),jsxs(Fragment,{children:[jsx(a,{className:a$1("w-full !cursor-pointer",k),readOnly:!0,ref:o,autoComplete:"off",list:"",selectMode:!0,value:h?.label,showClearButton:!1,onClick:e=>{l.current.style.display="flex",T?.(e);},onChange:e=>{c(-1),y(null),C?.(e);},onKeyDown:A,...I}),jsx(R.Root,{asChild:!0,children:jsx("ul",{ref:l,className:"pointer-events-auto absolute z-[10000] hidden w-full",style:r?{width:`${r.width}px`,left:r.left,top:H==="bottom"?`${r.height+r.top+window.scrollY}px`:window.scrollY+r.top-(n.length<u?n.length:u)*i-16}:void 0,children:jsxs(a$2,{className:"elevation-8 my-2 flex max-h-[336px] w-full flex-col rounded-lg bg-neutral-50",ref:g,children:[n.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col items-center justify-center rounded-lg bg-neutral-50 px-8 py-6",children:[$.cloneElement(w.icon,{className:"mb-2 h-8 w-8 text-neutral-300"}),jsx("p",{className:"text-center text-sm leading-[120%] text-neutral-500",children:w.message})]}),n.map((e,t)=>jsx("li",{onClick:()=>{b(e);},className:a$1("w-full flex-shrink-0 cursor-pointer py-4 pl-4 pr-6 text-left hover:bg-primary-100",h?.value===e.value&&"bg-primary-200",s===t&&"bg-primary-200"),children:e.label},`select-option-${N}-${e.key??e.value}`))]})})})]})};export{q as a};
1
+ import {a}from'./chunk-L43TLWY4.mjs';import {a as a$2}from'./chunk-QHBCNAWO.mjs';import {a as a$1}from'./chunk-2WINTZSS.mjs';import $,{useId,useRef,useState,useEffect}from'react';import*as R from'@radix-ui/react-portal';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var i=56,u=6,q=({options:n,noResults:w,selectedOption:L,onSelect:P,onChange:C,onClick:T,className:k,...I})=>{let N=useId(),l=useRef(null),o=useRef(null),g=useRef(null),[H,M]=useState("bottom"),[r,F]=useState(),[s,c]=useState(-1),[h,y]=useState(L??null),b=e=>{l.current.style.display="none",o.current.value=e.label,y(e),P?.(e);},A=e=>{if(e.key==="ArrowDown"){if(s===n.length-1)return;c(t=>t+1),l.current.style.display="flex",x();}else if(e.key==="ArrowUp"){if(s===0)return;c(t=>t-1),x();}else e.key==="Enter"&&(b(n[s]),c(-1));},x=()=>{let e=i*u;g.current.scroll({top:(s+2)*i<=e?0:i*(s+2)-e,behavior:"smooth"});};return useEffect(()=>{if(!o.current)return;let e=()=>{if(!o.current)return;let t=i*(n.length<u?n.length:u)+16,m=o.current.getBoundingClientRect();F(m);let B=window.innerHeight-m.bottom>t,D=m.top>t;M(B?"bottom":D?"top":"bottom");};return e(),o.current.addEventListener("mousedown",e),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{o.current?.removeEventListener("mousedown",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e);}},[o.current]),useEffect(()=>{function e(t){l.current&&!l.current.contains(t.target)&&(l.current.style.display="none",c(-1));}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e);}},[l.current]),jsxs(Fragment,{children:[jsx(a,{className:a$1("w-full !cursor-pointer",k),readOnly:!0,ref:o,autoComplete:"off",list:"",selectMode:!0,value:h?.label,showClearButton:!1,onClick:e=>{l.current.style.display="flex",T?.(e);},onChange:e=>{c(-1),y(null),C?.(e);},onKeyDown:A,...I}),jsx(R.Root,{asChild:!0,children:jsx("ul",{ref:l,className:"pointer-events-auto absolute z-[10000] hidden w-full",style:r?{width:`${r.width}px`,left:r.left,top:H==="bottom"?`${r.height+r.top+window.scrollY}px`:window.scrollY+r.top-(n.length<u?n.length:u)*i-16}:void 0,children:jsxs(a$2,{className:"elevation-8 my-2 flex max-h-[336px] w-full flex-col rounded-lg bg-neutral-50",ref:g,children:[n.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col items-center justify-center rounded-lg bg-neutral-50 px-8 py-6",children:[$.cloneElement(w.icon,{className:"mb-2 h-8 w-8 text-neutral-300"}),jsx("p",{className:"text-center text-sm leading-[120%] text-neutral-500",children:w.message})]}),n.map((e,t)=>jsx("li",{onClick:()=>{b(e);},className:a$1("w-full flex-shrink-0 cursor-pointer py-4 pl-4 pr-6 text-left hover:bg-primary-100",h?.value===e.value&&"bg-primary-200",s===t&&"bg-primary-200"),children:e.label},`select-option-${N}-${e.key??e.value}`))]})})})]})};export{q as a};
@@ -1 +1 @@
1
- import {d}from'./chunk-FAMLJ6AJ.mjs';import {a as a$1}from'./chunk-BVHU5ZT3.mjs';import {g}from'./chunk-TYHJTIAW.mjs';import {a}from'./chunk-2WINTZSS.mjs';import*as n from'react';import*as e from'@radix-ui/react-accordion';import {jsx,jsxs}from'react/jsx-runtime';var b=["sm","md"],w=n.forwardRef(({className:i,children:o,size:r="md",...a$1},d)=>jsx(e.Root,{"data-size":r,className:a("group/root space-y-2",i),...a$1,ref:d,children:o})),y=n.forwardRef(({className:i,...o},r)=>jsx(e.Item,{ref:r,className:i,...o}));y.displayName="AccordionFormItem";var R=n.forwardRef(({className:i,title:o,onEndButtonClick:r,StartIcon:a$2,children:d$1,badgeNumber:p,chipStatus:c,...g$1},u)=>jsx(e.Header,{className:"flex",children:jsxs(e.Trigger,{title:o,ref:u,className:a("group flex h-8 items-center gap-4 [&[data-state=open]>div>.chevron-icon]:rotate-180",i),...g$1,children:[jsxs("div",{className:"group flex items-center",children:[a$2&&jsx(a$2,{className:"mr-2 h-4.5 w-4.5 flex-shrink-0 text-primary-500 transition-colors group-hover:group-enabled:text-primary-700 group-disabled:text-neutral-500 group-data-[size=sm]/root:h-3.5 group-data-[size=sm]/root:w-3.5"}),jsx("div",{children:jsx("p",{className:"line-clamp-1 text-left text-base font-semibold !leading-[130%] text-primary-500 transition-colors group-hover:group-enabled:text-primary-700 group-disabled:text-neutral-500 group-data-[size=sm]/root:text-sm",children:o})})]}),jsxs("div",{className:"flex flex-shrink-0 items-center gap-1",children:[c&&jsx(d,{variant:c.variant,type:c.type,size:"xs",className:"flex-shrink-0",children:c.text}),p?.toString()&&jsx(a$1,{variant:"alert",size:"md",content:p.toString()}),jsx(g,{className:"chevron-icon h-4.5 w-4.5 shrink-0 text-primary-500 transition-transform group-hover:group-enabled:text-primary-700 group-disabled:text-neutral-500"})]})]})}));R.displayName=e.Trigger.displayName;var A=n.forwardRef(({className:i,children:o,...r},a)=>jsx(e.Content,{ref:a,className:"overflow-hidden data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:jsx("div",{className:i,children:o})}));A.displayName=e.Content.displayName;export{b as a,w as b,y as c,R as d,A as e};
1
+ import {d}from'./chunk-FAMLJ6AJ.mjs';import {a as a$1}from'./chunk-BVHU5ZT3.mjs';import {g}from'./chunk-7TPCN744.mjs';import {a}from'./chunk-2WINTZSS.mjs';import*as n from'react';import*as e from'@radix-ui/react-accordion';import {jsx,jsxs}from'react/jsx-runtime';var b=["sm","md"],w=n.forwardRef(({className:i,children:o,size:r="md",...a$1},d)=>jsx(e.Root,{"data-size":r,className:a("group/root space-y-2",i),...a$1,ref:d,children:o})),y=n.forwardRef(({className:i,...o},r)=>jsx(e.Item,{ref:r,className:i,...o}));y.displayName="AccordionFormItem";var R=n.forwardRef(({className:i,title:o,onEndButtonClick:r,StartIcon:a$2,children:d$1,badgeNumber:p,chipStatus:c,...g$1},u)=>jsx(e.Header,{className:"flex",children:jsxs(e.Trigger,{title:o,ref:u,className:a("group flex h-8 items-center gap-4 [&[data-state=open]>div>.chevron-icon]:rotate-180",i),...g$1,children:[jsxs("div",{className:"group flex items-center",children:[a$2&&jsx(a$2,{className:"mr-2 h-4.5 w-4.5 flex-shrink-0 text-primary-500 transition-colors group-hover:group-enabled:text-primary-700 group-disabled:text-neutral-500 group-data-[size=sm]/root:h-3.5 group-data-[size=sm]/root:w-3.5"}),jsx("div",{children:jsx("p",{className:"line-clamp-1 text-left text-base font-semibold !leading-[130%] text-primary-500 transition-colors group-hover:group-enabled:text-primary-700 group-disabled:text-neutral-500 group-data-[size=sm]/root:text-sm",children:o})})]}),jsxs("div",{className:"flex flex-shrink-0 items-center gap-1",children:[c&&jsx(d,{variant:c.variant,type:c.type,size:"xs",className:"flex-shrink-0",children:c.text}),p?.toString()&&jsx(a$1,{variant:"alert",size:"md",content:p.toString()}),jsx(g,{className:"chevron-icon h-4.5 w-4.5 shrink-0 text-primary-500 transition-transform group-hover:group-enabled:text-primary-700 group-disabled:text-neutral-500"})]})]})}));R.displayName=e.Trigger.displayName;var A=n.forwardRef(({className:i,children:o,...r},a)=>jsx(e.Content,{ref:a,className:"overflow-hidden data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:jsx("div",{className:i,children:o})}));A.displayName=e.Content.displayName;export{b as a,w as b,y as c,R as d,A as e};
@@ -1 +1 @@
1
- import {a}from'./chunk-KTRSJBA4.mjs';import {a as a$1}from'./chunk-2GJHRBSH.mjs';import {a as a$3}from'./chunk-6CCSHVKZ.mjs';import {n}from'./chunk-TYHJTIAW.mjs';import {a as a$2}from'./chunk-2WINTZSS.mjs';import {useState,useRef,useMemo,useCallback,useEffect}from'react';import*as w from'@radix-ui/react-portal';import {format}from'date-fns';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var q=({value:c,onChange:m,locale:x,disabledDates:D,...T})=>{let[E,f]=useState(!1),[a$4,d]=useState(c),[o,P]=useState(),[L,F]=useState("bottom"),[k,y]=useState(0),l=useRef(null),e=useRef(null),[u,H]=useState();a(l,()=>{f(!1);});let z=n=>{d(n),m?.(n);},M=useMemo(()=>a$4?format(a$4,"P"):"",[a$4]),N=()=>{d(void 0),m?.(void 0);},t=useCallback(()=>{if(!e.current)return;let n=e.current.getBoundingClientRect();if(!u)return;let i=u.height;y(i),P(n);let O=window.innerHeight-n.bottom>i,B=n.top+n.height>i;F(O?"bottom":B?"top":"bottom");},[e.current,u]);return useEffect(()=>{d(c);},[c]),useEffect(()=>{if(e?.current)return t(),e.current.addEventListener("mousedown",t),e.current.addEventListener("input",t),window.addEventListener("scroll",t,!0),window.addEventListener("resize",t),()=>{e.current?.removeEventListener("mousedown",t),e.current?.removeEventListener("input",t),window.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t);}},[e.current,t]),useEffect(()=>{H(l.current?.getBoundingClientRect());},[l.current]),jsxs(Fragment,{children:[jsx(a$1,{ref:e,startIcon:jsx(n,{}),onClean:N,readOnly:!0,value:M,onClick:n=>{P(n.currentTarget.getBoundingClientRect()),f(i=>!i);},...T}),jsx(w.Root,{asChild:!0,children:jsx("div",{ref:l,className:a$2("pointer-events-auto fixed z-50 hidden",E&&"block"),style:o?{top:L==="bottom"?`${o.height+o.y}px`:o.top-k,left:o?.left}:void 0,children:jsx(a$3,{className:"w-[20rem] max-w-full",mode:"single",selected:a$4,onSelect:z,locale:x,disabled:D})})})]})};q.displayName="DatePicker";export{q as a};
1
+ import {a}from'./chunk-KTRSJBA4.mjs';import {a as a$1}from'./chunk-L43TLWY4.mjs';import {a as a$3}from'./chunk-5FC6Y6GC.mjs';import {n}from'./chunk-7TPCN744.mjs';import {a as a$2}from'./chunk-2WINTZSS.mjs';import {useState,useRef,useMemo,useCallback,useEffect}from'react';import*as w from'@radix-ui/react-portal';import {format}from'date-fns';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var q=({value:c,onChange:m,locale:x,disabledDates:D,...T})=>{let[E,f]=useState(!1),[a$4,d]=useState(c),[o,P]=useState(),[L,F]=useState("bottom"),[k,y]=useState(0),l=useRef(null),e=useRef(null),[u,H]=useState();a(l,()=>{f(!1);});let z=n=>{d(n),m?.(n);},M=useMemo(()=>a$4?format(a$4,"P"):"",[a$4]),N=()=>{d(void 0),m?.(void 0);},t=useCallback(()=>{if(!e.current)return;let n=e.current.getBoundingClientRect();if(!u)return;let i=u.height;y(i),P(n);let O=window.innerHeight-n.bottom>i,B=n.top+n.height>i;F(O?"bottom":B?"top":"bottom");},[e.current,u]);return useEffect(()=>{d(c);},[c]),useEffect(()=>{if(e?.current)return t(),e.current.addEventListener("mousedown",t),e.current.addEventListener("input",t),window.addEventListener("scroll",t,!0),window.addEventListener("resize",t),()=>{e.current?.removeEventListener("mousedown",t),e.current?.removeEventListener("input",t),window.removeEventListener("scroll",t,!0),window.removeEventListener("resize",t);}},[e.current,t]),useEffect(()=>{H(l.current?.getBoundingClientRect());},[l.current]),jsxs(Fragment,{children:[jsx(a$1,{ref:e,startIcon:jsx(n,{}),onClean:N,readOnly:!0,value:M,onClick:n=>{P(n.currentTarget.getBoundingClientRect()),f(i=>!i);},...T}),jsx(w.Root,{asChild:!0,children:jsx("div",{ref:l,className:a$2("pointer-events-auto fixed z-50 hidden",E&&"block"),style:o?{top:L==="bottom"?`${o.height+o.y}px`:o.top-k,left:o?.left}:void 0,children:jsx(a$3,{className:"w-[20rem] max-w-full",mode:"single",selected:a$4,onSelect:z,locale:x,disabled:D})})})]})};q.displayName="DatePicker";export{q as a};
@@ -1 +1 @@
1
- import {a as a$5}from'./chunk-KTRSJBA4.mjs';import {a as a$4}from'./chunk-2GJHRBSH.mjs';import {a}from'./chunk-QHBCNAWO.mjs';import {b}from'./chunk-UGGS6W5K.mjs';import {d}from'./chunk-AZOZKDKH.mjs';import {a as a$1}from'./chunk-WGMDH4XX.mjs';import {a as a$3}from'./chunk-BVHU5ZT3.mjs';import {c}from'./chunk-2VL36SBW.mjs';import {c as c$1,h}from'./chunk-TYHJTIAW.mjs';import {a as a$2}from'./chunk-2WINTZSS.mjs';import bt,{createContext,useMemo,useCallback,useState,useRef,useEffect,useContext,useId}from'react';import*as zt from'@radix-ui/react-portal';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var Gt=({title:t,titleLines:o=2,description:r,descriptionLines:e=1,Icon:s,iconAsColumn:i=!0,className:a,...n})=>jsxs("div",{className:a$2("flex gap-2 py-4 pl-4 pr-6",i&&"flex-col items-center gap-1",!i&&!r&&"items-center"),...n,children:[s&&jsx(s,{className:a$2("shrink-0 text-neutral-300"),size:24}),jsxs("div",{className:a$2("flex flex-col gap-1",i&&"text-center"),children:[jsx("p",{className:a$2("leading-[130%] text-neutral-500",!!r&&"font-medium"),style:o?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:o}:void 0,children:t}),r&&jsx("p",{className:"text-sm leading-[130%] text-neutral-500",style:e?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:e}:void 0,children:r})]})]}),at=Gt;var $t=bt.memo(({handleSelect:t,NoResultsIcon:o,noResultsLabel:r,noResultsDescription:e,noResultsDescriptionLines:s,noResultsAsColumn:i,noResultsButtonOnClick:a$3,optionDescriptionLines:n,noResultsButtonLabel:w,filteredOptions:c$1,inputRect:p,inputRef:f,popoverPosition:x,optionsListRef:k,selectedOption:m,options:R,setFilteredOptions:h})=>jsx(zt.Root,{asChild:!0,children:jsx("div",{ref:k,className:"pointer-events-auto fixed z-50 hidden w-full",style:p?{width:`${p.width}px`,left:p.left,top:x==="bottom"?`${p.bottom}px`:void 0,bottom:x==="top"?`${window.innerHeight-p.top}px`:void 0}:void 0,children:jsxs(a,{className:"elevation-8 mb-2 flex max-h-[336px] w-full flex-col rounded-lg bg-neutral-50",children:[c$1.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col justify-center rounded-lg bg-neutral-50",children:[jsx(at,{title:r,description:e,Icon:o,iconAsColumn:i,descriptionLines:s}),a$3&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(c,{variant:"ghost",className:"my-3 w-fit self-center",onClick:u=>{k.current.style.display="none",f.current.value="",h(R),a$3();},children:w})]})]}),c$1.map(u=>jsx(Mt,{title:u.label,disabled:u.disabled,description:u.description,descriptionLines:n,onClick:()=>t(u),className:a$2(m?.value===u.value&&"bg-primary-200")},u.key??u.value))]})})})),Ct=$t;var qt=336,rr=({options:t,defaultSelectedOption:o,onSelect:r,onClick:e,onInputChange:s,error:i,helperText:a,label:n,placeholder:w,value:c,size:p="md",optionDescriptionLines:f=1,noResultsLabel:x,noResultsIcon:k,noResultsDescription:m,noResultsDescriptionLines:R,noResultsAsColumn:h,noResultsButtonOnClick:u,noResultsButtonLabel:A,className:j,disabled:b})=>{let[d,y]=useState(o??null),z=useRef(null),g=useRef(null),[nt,st]=useState(),[lt,T]=useState([]),[ct,H]=useState("bottom"),[G,K]=useState(),U=qt,N=useCallback(v=>{z.current.style.display="none",g.current.value=v.label,y(v),r?.(v);},[r]),C=useCallback(()=>{if(!g?.current)return;let v=g.current.getBoundingClientRect();st(v);let O=G?G.height:U,M=window.innerHeight-v.bottom>O,Q=v.top>O;H(M?"bottom":Q?"top":"bottom");},[G?.height]),$=useCallback(()=>{let v=t.filter(O=>O.label.toLowerCase().includes(g?.current?.value.toLowerCase()??""));if(T(v),z?.current){let O=z.current.getBoundingClientRect();K(O);}},[t]);return useEffect(()=>{T(t);},[t]),useEffect(()=>{if(!c){y(null),g.current&&(g.current.value="");return}(!g.current?.value||d?.value!==c.value)&&(y(c),g.current.value=c.label);},[c]),a$5(z,()=>{z.current.style.display="none",d&&g.current&&(g.current.value=d.label);}),useEffect(()=>{if(g?.current)return C(),g.current.addEventListener("mousedown",C),g.current.addEventListener("input",$),window.addEventListener("scroll",C,!0),window.addEventListener("resize",C),()=>{g.current?.removeEventListener("mousedown",C),g.current?.removeEventListener("input",$),window.removeEventListener("scroll",C,!0),window.removeEventListener("resize",C);}},[C,$]),jsxs("div",{className:a$2("relative",j),children:[jsx(a$4,{ref:g,autoComplete:"off",list:"",selectMode:!0,onChange:v=>{v.target.value||(y(null),r?.(null)),s?.(v);},onClean:()=>{y(null),T(t),r?.(null);},onClick:v=>{z.current.style.display="flex",e?.(v);},onBlur:()=>{d&&g.current&&(g.current.value=d.label);},label:n,helperText:a,placeholder:w,size:p,error:i,disabled:b}),jsx(Ct,{handleSelect:N,noResultsLabel:x,NoResultsIcon:k,optionDescriptionLines:f,noResultsAsColumn:h,noResultsButtonLabel:A,noResultsButtonOnClick:u,noResultsDescription:m,noResultsDescriptionLines:R,filteredOptions:lt,inputRect:nt,inputRef:g,popoverPosition:ct,optionsListRef:z,selectedOption:d,options:t,setFilteredOptions:T})]})};var Kt=({children:t,title:o,titleLines:r,description:e="",descriptionLines:s,disabled:i=!1,className:a,...n})=>jsxs("div",{className:"flex w-full flex-col",...n,children:[jsx("p",{className:a$2("break-all",!!e&&"font-medium"),style:r?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:r}:void 0,children:o}),e&&jsx("p",{className:a$2("text-sm",i?"text-neutral-400":"text-neutral-700"),style:s?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:s}:void 0,children:e})]}),Y=Kt;var mr=({children:t,title:o,titleLines:r,description:e="",descriptionLines:s,startIcon:i,badgeContent:a,hasDivider:n=!1,disabled:w=!1,onSelect:c,className:p,...f})=>jsxs(W,{hasDescription:!!e,disabled:w,onClick:c,hasDivider:n,className:a$2(!w&&"cursor-pointer",p),...f,children:[i&&bt.cloneElement(i,{className:a$2(e?"mt-[0.4rem]":"self-center","shrink-0"),size:18}),jsx(Y,{title:o,titleLines:r,description:e,descriptionLines:s,disabled:w}),jsxs("div",{className:"flex gap-2",children:[a&&jsx(a$3,{content:a,size:"lg",variant:"alert",className:a$2("self-center",w&&"bg-neutral-400")}),jsx(h,{className:"h-4.5 w-4.5 self-center"})]})]});var St=({children:t,title:o,titleLines:r=1,description:e="",descriptionLines:s,startIcon:i,hasDivider:a=!1,disabled:n=!1,checked:w,onCheckedChange:c,className:p,...f})=>jsxs(W,{hasDescription:!!e,disabled:n,hasDivider:a,...f,className:a$2("pr-6",p),children:[i&&bt.cloneElement(i,{className:a$2(e?"mt-[0.4rem]":"self-center","shrink-0"),size:18}),jsx(Y,{title:o,titleLines:r,description:e,descriptionLines:s,disabled:n}),jsx(b,{size:"sm",checked:w,onCheckedChange:c,className:"self-center",disabled:n})]});var E=336,Ft=createContext({inputRef:null,optionsListRef:null,scrollAreaRef:null,autocompleteId:"",inputRect:void 0,showChips:!1,filteredOptions:[],currentFocus:-1,popoverPosition:"bottom",setFilteredOptions:()=>{},setCurrentFocus:()=>{},setShowChips:()=>{},setPopoverPosition:()=>{},setInputRect:()=>{},optionsListHeight:E,setOptionsListHeight:()=>{},optionsListRect:void 0,setOptionsListRect:()=>{}}),I=()=>{let t=useContext(Ft);if(t===null)throw new Error("useAutocompleteMultipleContext must be used within a AutocompleteMultipleProvider");return t},Dt=({children:t})=>{let o=useRef(null),r=useRef(null),e=useRef(null),s=useId(),[i,a]=useState(),[n,w]=useState(!0),[c,p]=useState([]),[f,x]=useState(-1),[k,m]=useState("bottom"),[R,h]=useState(),[u,A]=useState(E);return jsx(Ft.Provider,{value:{optionsListRef:o,inputRef:r,scrollAreaRef:e,autocompleteId:s,inputRect:i,showChips:n,filteredOptions:c,currentFocus:f,popoverPosition:k,setFilteredOptions:p,setCurrentFocus:x,setShowChips:w,setPopoverPosition:m,setInputRect:a,optionsListHeight:u,optionsListRect:R,setOptionsListRect:h,setOptionsListHeight:A},children:t})};var le=({option:t,onMountWidth:o,size:r})=>{let e=useRef(null);return useEffect(()=>{e.current&&o?.(e.current.clientWidth);},[]),jsx(d,{type:"fill",variant:"standard",ref:e,className:"flex-shrink-0",size:r==="md"?"xs":"sm",hasCloseIcon:!1,children:t.label})},Tt=le;var ge=150,we=bt.memo(({selectedOptions:t,error:o,onCleanSelectedOptions:r,disabled:e,size:s})=>{let{autocompleteId:i,inputRect:a,inputRef:n,optionsListRef:w}=I(),c=bt.useRef(null),[p,f]=bt.useState(new Map),x=useMemo(()=>{if(!a?.width)return [];let m=0,R=a.width-ge,h=0;for(let u=0;u<t.length&&(h+=p.get(u)??0,!(h>R));u++)m++;return t.slice(0,m)},[a?.width,t,p]),k=useCallback(()=>{e||(n?.current?.focus(),w.current.style.display="flex");},[e]);return jsxs("div",{onClick:k,className:a$2("absolute top-0 z-30 flex w-full cursor-pointer flex-nowrap items-center gap-2 pl-3 pr-12",e&&"cursor-not-allowed"),style:{maxWidth:a?.width?a?.width:void 0,height:a?.height?a?.height:void 0},children:[jsx("div",{className:"flex flex-1 gap-1 overflow-hidden",ref:c,children:x.map((m,R)=>jsx(Tt,{option:m,onMountWidth:h=>f(u=>new Map(u).set(R,h)),size:s},`chip-input-${i}-${m.value}`))}),t.length>x.length&&jsx("span",{className:"text-base",children:"..."}),t.length>0&&!o&&jsx(a$3,{content:String(t.length),size:s}),o&&t.length>0&&jsx(c$1,{className:"h-6 w-6 text-error-700",onClick:m=>{m.stopPropagation(),r();}})]})}),Ht=we;var be=bt.memo(({option:t,index:o,onPressOption:r,isSelected:e,optionDescriptionLines:s})=>{let{currentFocus:i,inputRef:a}=I();return jsx(St,{title:t.label,checked:e,disabled:t.disabled,className:i===o?"bg-primary-200":void 0,onMouseDown:n=>{t.disabled||(a?.current?.value&&n.preventDefault(),r?.(t,n));},description:t.description,descriptionLines:s})}),ht=be;var xe=bt.memo(({selectedOptions:t,handleSelect:o,NoResultsIcon:r,noResultsLabel:e,noResultsDescription:s,noResultsDescriptionLines:i,noResultsAsColumn:a$2,noResultsButtonOnClick:n,optionDescriptionLines:w,noResultsButtonLabel:c$1})=>{let{popoverPosition:p,scrollAreaRef:f,optionsListRef:x,filteredOptions:k,inputRect:m,autocompleteId:R,inputRef:h,optionsListHeight:u}=I(),A=useCallback(b=>t.some(d=>d.value===b.value),[t]),j=useMemo(()=>t.filter(b=>b.label.toLowerCase().includes(h?.current?.value.toLowerCase()??"")),[t,h?.current?.value]);return jsx(zt.Root,{asChild:!0,children:jsx("div",{ref:x,className:"pointer-events-auto fixed z-50 hidden w-full",style:m?{width:`${m.width}px`,left:m.left,top:p==="bottom"?`${m.bottom}px`:void 0,bottom:p==="top"?`${window.innerHeight-m.top}px`:void 0}:void 0,children:jsxs(a,{className:"elevation-8 mb-2 flex w-full flex-col rounded-lg bg-neutral-50",style:{maxHeight:u+"px"},ref:f,children:[k.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col justify-center rounded-lg bg-neutral-50",children:[jsx(at,{title:e,description:s,Icon:r,iconAsColumn:a$2,descriptionLines:i}),n&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(c,{variant:"ghost",className:"my-3 w-fit self-center",onClick:b=>{x.current.style.display="none",h.current.value="",n();},children:c$1})]})]}),j.map((b,d)=>jsx(ht,{option:b,index:d,onPressOption:y=>o(y),isSelected:A(b),optionDescriptionLines:w},`autocomplete-option-${R}-${b.key??b.value}`)),k.map((b,d)=>!t.some(y=>y.value===b.value)&&jsx(ht,{option:b,index:d,onPressOption:y=>o(y),isSelected:A(b),optionDescriptionLines:w},`autocomplete-option-${R}-${b.key??b.value}`))]})})})}),Xt=xe;var Le=bt.memo(({selectedOptions:t,onSelect:o,error:r,helperText:e,label:s,placeholder:i,options:a,onInputChange:n,size:w,disabled:c})=>{let{setCurrentFocus:p,setFilteredOptions:f,optionsListRef:x,inputRef:k}=I();return jsx(a$4,{ref:k,autoComplete:"off",list:"",disabled:c,selectMode:!0,onChange:m=>{p(-1),n?.(m.target.value);},onClean:()=>{p(-1),f(a),o?.(null,t);},onClick:()=>{c||(x.current.style.display="flex");},error:r,helperText:e,label:s,placeholder:i,fixedTopLabel:t.length>0,size:w})}),Bt=Le;var Yt=({options:t,defaultSelectedOptions:o,onSelect:r,error:e,helperText:s,label:i,placeholder:a,noResultsLabel:n,noResultsIcon:w,noResultsDescription:c,noResultsDescriptionLines:p,noResultsAsColumn:f,noResultsButtonOnClick:x,noResultsButtonLabel:k,className:m,onInputChange:R,value:h,loading:u,size:A="md",optionDescriptionLines:j=1,disabled:b})=>{let{inputRef:d,optionsListRef:y,setFilteredOptions:z,setShowChips:g,setInputRect:nt,setPopoverPosition:st,setCurrentFocus:lt,showChips:T,setOptionsListRect:ct,optionsListRect:H,setOptionsListHeight:G}=I(),K=useRef(!1),[U,N]=useState(o??[]),C=useCallback(L=>{N(P=>{let S,_=P.findIndex(jt=>jt.value===L.value);return _===-1?(S=P.concat(L),r?.(L,S),S):(S=P.toSpliced(_,1),r?.(L,S),S)});},[r]),$=useCallback(()=>{N([]),z(t),r?.(null,[]);},[]),v=useCallback(()=>{g(!1);},[]),O=useCallback(()=>{g(!0);},[]),M=useCallback(()=>{if(!d?.current)return;let L=d.current.getBoundingClientRect();nt(L);let P=H?H.height>E?E:H.height:E,S=window.innerHeight-L.bottom>P,_=L.top>P;st(S?"bottom":_?"top":"bottom"),G(_?E:window.innerHeight-L.bottom>E?E:window.innerHeight-L.bottom);},[H?.height]),Q=useCallback(()=>{let L=t.filter(P=>P.label.toLowerCase().includes(d?.current?.value.toLowerCase()??""));if(z(L),y?.current){let P=y.current.getBoundingClientRect();ct(P);}},[t,y?.current]);return useEffect(()=>{z(t);},[t]),a$5(y,()=>{y.current.style.display="none",lt(-1);}),useEffect(()=>{if(d?.current)return M(),d.current.addEventListener("mousedown",M),d.current.addEventListener("input",Q),d.current.addEventListener("focusin",v),d.current.addEventListener("focusout",O),window.addEventListener("scroll",M,!0),window.addEventListener("resize",M),()=>{d.current?.removeEventListener("mousedown",M),d.current?.removeEventListener("input",M),d.current?.removeEventListener("focusout",O),d.current?.removeEventListener("focusin",v),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M);}},[M,O,v,Q]),useEffect(()=>{h&&(N(h),g(!0));},[h]),useEffect(()=>{u||o&&o.length&&!K.current&&(N(o),K.current=!0,g(!0));},[o,u]),jsxs("div",{className:a$2("relative",m),children:[jsx(Bt,{selectedOptions:U,onSelect:r,error:e,helperText:s,label:i,placeholder:a,handleSelect:C,options:t,onInputChange:R,size:A,disabled:b}),T&&jsx(Ht,{selectedOptions:U,disabled:b,error:e,onCleanSelectedOptions:$,size:A}),jsx(Xt,{handleSelect:C,selectedOptions:U,noResultsLabel:n,NoResultsIcon:w,optionDescriptionLines:j,noResultsAsColumn:f,noResultsButtonLabel:k,noResultsButtonOnClick:x,noResultsDescription:c,noResultsDescriptionLines:p})]})};var Oo=t=>jsx(Dt,{children:jsx(Yt,{...t})});var Oe=({children:t,hasDescription:o=!1,disabled:r=!1,hasDivider:e=!1,className:s,onClick:i,...a})=>jsxs(Fragment,{children:[jsx("div",{className:a$2("line-height-[120%] flex flex-row gap-4 pl-4 pr-3",o?"py-3":"py-[0.875rem]",r?"text-neutral-400":"hover:bg-primary-100 focus:bg-primary-200",s),onClick:n=>{r||i?.(n);},...a,children:t}),e&&jsx(a$1,{})]}),W=Oe;var Mt=({children:t,title:o,titleLines:r,description:e="",descriptionLines:s,startIcon:i,hasDivider:a=!1,disabled:n=!1,className:w,...c})=>jsxs(W,{hasDescription:!!e,disabled:n,hasDivider:a,className:w,...c,children:[i&&bt.cloneElement(i,{className:a$2(e?"mt-[0.4rem]":"self-center","shrink-0"),size:18}),jsx(Y,{title:o,titleLines:r,description:e,descriptionLines:s,disabled:n})]});export{rr as a,Mt as b,mr as c,St as d,Oo as e};
1
+ import {a as a$5}from'./chunk-KTRSJBA4.mjs';import {a as a$4}from'./chunk-L43TLWY4.mjs';import {a}from'./chunk-QHBCNAWO.mjs';import {b}from'./chunk-P7XUCLSY.mjs';import {d}from'./chunk-7RQ3O67S.mjs';import {a as a$1}from'./chunk-WGMDH4XX.mjs';import {a as a$3}from'./chunk-BVHU5ZT3.mjs';import {c}from'./chunk-AQPJ5OS4.mjs';import {c as c$1,h}from'./chunk-7TPCN744.mjs';import {a as a$2}from'./chunk-2WINTZSS.mjs';import bt,{createContext,useMemo,useCallback,useState,useRef,useEffect,useContext,useId}from'react';import*as zt from'@radix-ui/react-portal';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var Gt=({title:t,titleLines:o=2,description:r,descriptionLines:e=1,Icon:s,iconAsColumn:i=!0,className:a,...n})=>jsxs("div",{className:a$2("flex gap-2 py-4 pl-4 pr-6",i&&"flex-col items-center gap-1",!i&&!r&&"items-center"),...n,children:[s&&jsx(s,{className:a$2("shrink-0 text-neutral-300"),size:24}),jsxs("div",{className:a$2("flex flex-col gap-1",i&&"text-center"),children:[jsx("p",{className:a$2("leading-[130%] text-neutral-500",!!r&&"font-medium"),style:o?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:o}:void 0,children:t}),r&&jsx("p",{className:"text-sm leading-[130%] text-neutral-500",style:e?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:e}:void 0,children:r})]})]}),at=Gt;var $t=bt.memo(({handleSelect:t,NoResultsIcon:o,noResultsLabel:r,noResultsDescription:e,noResultsDescriptionLines:s,noResultsAsColumn:i,noResultsButtonOnClick:a$3,optionDescriptionLines:n,noResultsButtonLabel:w,filteredOptions:c$1,inputRect:p,inputRef:f,popoverPosition:x,optionsListRef:k,selectedOption:m,options:R,setFilteredOptions:h})=>jsx(zt.Root,{asChild:!0,children:jsx("div",{ref:k,className:"pointer-events-auto fixed z-50 hidden w-full",style:p?{width:`${p.width}px`,left:p.left,top:x==="bottom"?`${p.bottom}px`:void 0,bottom:x==="top"?`${window.innerHeight-p.top}px`:void 0}:void 0,children:jsxs(a,{className:"elevation-8 mb-2 flex max-h-[336px] w-full flex-col rounded-lg bg-neutral-50",children:[c$1.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col justify-center rounded-lg bg-neutral-50",children:[jsx(at,{title:r,description:e,Icon:o,iconAsColumn:i,descriptionLines:s}),a$3&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(c,{variant:"ghost",className:"my-3 w-fit self-center",onClick:u=>{k.current.style.display="none",f.current.value="",h(R),a$3();},children:w})]})]}),c$1.map(u=>jsx(Mt,{title:u.label,disabled:u.disabled,description:u.description,descriptionLines:n,onClick:()=>t(u),className:a$2(m?.value===u.value&&"bg-primary-200")},u.key??u.value))]})})})),Ct=$t;var qt=336,rr=({options:t,defaultSelectedOption:o,onSelect:r,onClick:e,onInputChange:s,error:i,helperText:a,label:n,placeholder:w,value:c,size:p="md",optionDescriptionLines:f=1,noResultsLabel:x,noResultsIcon:k,noResultsDescription:m,noResultsDescriptionLines:R,noResultsAsColumn:h,noResultsButtonOnClick:u,noResultsButtonLabel:A,className:j,disabled:b})=>{let[d,y]=useState(o??null),z=useRef(null),g=useRef(null),[nt,st]=useState(),[lt,T]=useState([]),[ct,H]=useState("bottom"),[G,K]=useState(),U=qt,N=useCallback(v=>{z.current.style.display="none",g.current.value=v.label,y(v),r?.(v);},[r]),C=useCallback(()=>{if(!g?.current)return;let v=g.current.getBoundingClientRect();st(v);let O=G?G.height:U,M=window.innerHeight-v.bottom>O,Q=v.top>O;H(M?"bottom":Q?"top":"bottom");},[G?.height]),$=useCallback(()=>{let v=t.filter(O=>O.label.toLowerCase().includes(g?.current?.value.toLowerCase()??""));if(T(v),z?.current){let O=z.current.getBoundingClientRect();K(O);}},[t]);return useEffect(()=>{T(t);},[t]),useEffect(()=>{if(!c){y(null),g.current&&(g.current.value="");return}(!g.current?.value||d?.value!==c.value)&&(y(c),g.current.value=c.label);},[c]),a$5(z,()=>{z.current.style.display="none",d&&g.current&&(g.current.value=d.label);}),useEffect(()=>{if(g?.current)return C(),g.current.addEventListener("mousedown",C),g.current.addEventListener("input",$),window.addEventListener("scroll",C,!0),window.addEventListener("resize",C),()=>{g.current?.removeEventListener("mousedown",C),g.current?.removeEventListener("input",$),window.removeEventListener("scroll",C,!0),window.removeEventListener("resize",C);}},[C,$]),jsxs("div",{className:a$2("relative",j),children:[jsx(a$4,{ref:g,autoComplete:"off",list:"",selectMode:!0,onChange:v=>{v.target.value||(y(null),r?.(null)),s?.(v);},onClean:()=>{y(null),T(t),r?.(null);},onClick:v=>{z.current.style.display="flex",e?.(v);},onBlur:()=>{d&&g.current&&(g.current.value=d.label);},label:n,helperText:a,placeholder:w,size:p,error:i,disabled:b}),jsx(Ct,{handleSelect:N,noResultsLabel:x,NoResultsIcon:k,optionDescriptionLines:f,noResultsAsColumn:h,noResultsButtonLabel:A,noResultsButtonOnClick:u,noResultsDescription:m,noResultsDescriptionLines:R,filteredOptions:lt,inputRect:nt,inputRef:g,popoverPosition:ct,optionsListRef:z,selectedOption:d,options:t,setFilteredOptions:T})]})};var Kt=({children:t,title:o,titleLines:r,description:e="",descriptionLines:s,disabled:i=!1,className:a,...n})=>jsxs("div",{className:"flex w-full flex-col",...n,children:[jsx("p",{className:a$2("break-all",!!e&&"font-medium"),style:r?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:r}:void 0,children:o}),e&&jsx("p",{className:a$2("text-sm",i?"text-neutral-400":"text-neutral-700"),style:s?{overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:s}:void 0,children:e})]}),Y=Kt;var mr=({children:t,title:o,titleLines:r,description:e="",descriptionLines:s,startIcon:i,badgeContent:a,hasDivider:n=!1,disabled:w=!1,onSelect:c,className:p,...f})=>jsxs(W,{hasDescription:!!e,disabled:w,onClick:c,hasDivider:n,className:a$2(!w&&"cursor-pointer",p),...f,children:[i&&bt.cloneElement(i,{className:a$2(e?"mt-[0.4rem]":"self-center","shrink-0"),size:18}),jsx(Y,{title:o,titleLines:r,description:e,descriptionLines:s,disabled:w}),jsxs("div",{className:"flex gap-2",children:[a&&jsx(a$3,{content:a,size:"lg",variant:"alert",className:a$2("self-center",w&&"bg-neutral-400")}),jsx(h,{className:"h-4.5 w-4.5 self-center"})]})]});var St=({children:t,title:o,titleLines:r=1,description:e="",descriptionLines:s,startIcon:i,hasDivider:a=!1,disabled:n=!1,checked:w,onCheckedChange:c,className:p,...f})=>jsxs(W,{hasDescription:!!e,disabled:n,hasDivider:a,...f,className:a$2("pr-6",p),children:[i&&bt.cloneElement(i,{className:a$2(e?"mt-[0.4rem]":"self-center","shrink-0"),size:18}),jsx(Y,{title:o,titleLines:r,description:e,descriptionLines:s,disabled:n}),jsx(b,{size:"sm",checked:w,onCheckedChange:c,className:"self-center",disabled:n})]});var E=336,Ft=createContext({inputRef:null,optionsListRef:null,scrollAreaRef:null,autocompleteId:"",inputRect:void 0,showChips:!1,filteredOptions:[],currentFocus:-1,popoverPosition:"bottom",setFilteredOptions:()=>{},setCurrentFocus:()=>{},setShowChips:()=>{},setPopoverPosition:()=>{},setInputRect:()=>{},optionsListHeight:E,setOptionsListHeight:()=>{},optionsListRect:void 0,setOptionsListRect:()=>{}}),I=()=>{let t=useContext(Ft);if(t===null)throw new Error("useAutocompleteMultipleContext must be used within a AutocompleteMultipleProvider");return t},Dt=({children:t})=>{let o=useRef(null),r=useRef(null),e=useRef(null),s=useId(),[i,a]=useState(),[n,w]=useState(!0),[c,p]=useState([]),[f,x]=useState(-1),[k,m]=useState("bottom"),[R,h]=useState(),[u,A]=useState(E);return jsx(Ft.Provider,{value:{optionsListRef:o,inputRef:r,scrollAreaRef:e,autocompleteId:s,inputRect:i,showChips:n,filteredOptions:c,currentFocus:f,popoverPosition:k,setFilteredOptions:p,setCurrentFocus:x,setShowChips:w,setPopoverPosition:m,setInputRect:a,optionsListHeight:u,optionsListRect:R,setOptionsListRect:h,setOptionsListHeight:A},children:t})};var le=({option:t,onMountWidth:o,size:r})=>{let e=useRef(null);return useEffect(()=>{e.current&&o?.(e.current.clientWidth);},[]),jsx(d,{type:"fill",variant:"standard",ref:e,className:"flex-shrink-0",size:r==="md"?"xs":"sm",hasCloseIcon:!1,children:t.label})},Tt=le;var ge=150,we=bt.memo(({selectedOptions:t,error:o,onCleanSelectedOptions:r,disabled:e,size:s})=>{let{autocompleteId:i,inputRect:a,inputRef:n,optionsListRef:w}=I(),c=bt.useRef(null),[p,f]=bt.useState(new Map),x=useMemo(()=>{if(!a?.width)return [];let m=0,R=a.width-ge,h=0;for(let u=0;u<t.length&&(h+=p.get(u)??0,!(h>R));u++)m++;return t.slice(0,m)},[a?.width,t,p]),k=useCallback(()=>{e||(n?.current?.focus(),w.current.style.display="flex");},[e]);return jsxs("div",{onClick:k,className:a$2("absolute top-0 z-30 flex w-full cursor-pointer flex-nowrap items-center gap-2 pl-3 pr-12",e&&"cursor-not-allowed"),style:{maxWidth:a?.width?a?.width:void 0,height:a?.height?a?.height:void 0},children:[jsx("div",{className:"flex flex-1 gap-1 overflow-hidden",ref:c,children:x.map((m,R)=>jsx(Tt,{option:m,onMountWidth:h=>f(u=>new Map(u).set(R,h)),size:s},`chip-input-${i}-${m.value}`))}),t.length>x.length&&jsx("span",{className:"text-base",children:"..."}),t.length>0&&!o&&jsx(a$3,{content:String(t.length),size:s}),o&&t.length>0&&jsx(c$1,{className:"h-6 w-6 text-error-700",onClick:m=>{m.stopPropagation(),r();}})]})}),Ht=we;var be=bt.memo(({option:t,index:o,onPressOption:r,isSelected:e,optionDescriptionLines:s})=>{let{currentFocus:i,inputRef:a}=I();return jsx(St,{title:t.label,checked:e,disabled:t.disabled,className:i===o?"bg-primary-200":void 0,onMouseDown:n=>{t.disabled||(a?.current?.value&&n.preventDefault(),r?.(t,n));},description:t.description,descriptionLines:s})}),ht=be;var xe=bt.memo(({selectedOptions:t,handleSelect:o,NoResultsIcon:r,noResultsLabel:e,noResultsDescription:s,noResultsDescriptionLines:i,noResultsAsColumn:a$2,noResultsButtonOnClick:n,optionDescriptionLines:w,noResultsButtonLabel:c$1})=>{let{popoverPosition:p,scrollAreaRef:f,optionsListRef:x,filteredOptions:k,inputRect:m,autocompleteId:R,inputRef:h,optionsListHeight:u}=I(),A=useCallback(b=>t.some(d=>d.value===b.value),[t]),j=useMemo(()=>t.filter(b=>b.label.toLowerCase().includes(h?.current?.value.toLowerCase()??"")),[t,h?.current?.value]);return jsx(zt.Root,{asChild:!0,children:jsx("div",{ref:x,className:"pointer-events-auto fixed z-50 hidden w-full",style:m?{width:`${m.width}px`,left:m.left,top:p==="bottom"?`${m.bottom}px`:void 0,bottom:p==="top"?`${window.innerHeight-m.top}px`:void 0}:void 0,children:jsxs(a,{className:"elevation-8 mb-2 flex w-full flex-col rounded-lg bg-neutral-50",style:{maxHeight:u+"px"},ref:f,children:[k.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col justify-center rounded-lg bg-neutral-50",children:[jsx(at,{title:e,description:s,Icon:r,iconAsColumn:a$2,descriptionLines:i}),n&&jsxs(Fragment,{children:[jsx(a$1,{}),jsx(c,{variant:"ghost",className:"my-3 w-fit self-center",onClick:b=>{x.current.style.display="none",h.current.value="",n();},children:c$1})]})]}),j.map((b,d)=>jsx(ht,{option:b,index:d,onPressOption:y=>o(y),isSelected:A(b),optionDescriptionLines:w},`autocomplete-option-${R}-${b.key??b.value}`)),k.map((b,d)=>!t.some(y=>y.value===b.value)&&jsx(ht,{option:b,index:d,onPressOption:y=>o(y),isSelected:A(b),optionDescriptionLines:w},`autocomplete-option-${R}-${b.key??b.value}`))]})})})}),Xt=xe;var Le=bt.memo(({selectedOptions:t,onSelect:o,error:r,helperText:e,label:s,placeholder:i,options:a,onInputChange:n,size:w,disabled:c})=>{let{setCurrentFocus:p,setFilteredOptions:f,optionsListRef:x,inputRef:k}=I();return jsx(a$4,{ref:k,autoComplete:"off",list:"",disabled:c,selectMode:!0,onChange:m=>{p(-1),n?.(m.target.value);},onClean:()=>{p(-1),f(a),o?.(null,t);},onClick:()=>{c||(x.current.style.display="flex");},error:r,helperText:e,label:s,placeholder:i,fixedTopLabel:t.length>0,size:w})}),Bt=Le;var Yt=({options:t,defaultSelectedOptions:o,onSelect:r,error:e,helperText:s,label:i,placeholder:a,noResultsLabel:n,noResultsIcon:w,noResultsDescription:c,noResultsDescriptionLines:p,noResultsAsColumn:f,noResultsButtonOnClick:x,noResultsButtonLabel:k,className:m,onInputChange:R,value:h,loading:u,size:A="md",optionDescriptionLines:j=1,disabled:b})=>{let{inputRef:d,optionsListRef:y,setFilteredOptions:z,setShowChips:g,setInputRect:nt,setPopoverPosition:st,setCurrentFocus:lt,showChips:T,setOptionsListRect:ct,optionsListRect:H,setOptionsListHeight:G}=I(),K=useRef(!1),[U,N]=useState(o??[]),C=useCallback(L=>{N(P=>{let S,_=P.findIndex(jt=>jt.value===L.value);return _===-1?(S=P.concat(L),r?.(L,S),S):(S=P.toSpliced(_,1),r?.(L,S),S)});},[r]),$=useCallback(()=>{N([]),z(t),r?.(null,[]);},[]),v=useCallback(()=>{g(!1);},[]),O=useCallback(()=>{g(!0);},[]),M=useCallback(()=>{if(!d?.current)return;let L=d.current.getBoundingClientRect();nt(L);let P=H?H.height>E?E:H.height:E,S=window.innerHeight-L.bottom>P,_=L.top>P;st(S?"bottom":_?"top":"bottom"),G(_?E:window.innerHeight-L.bottom>E?E:window.innerHeight-L.bottom);},[H?.height]),Q=useCallback(()=>{let L=t.filter(P=>P.label.toLowerCase().includes(d?.current?.value.toLowerCase()??""));if(z(L),y?.current){let P=y.current.getBoundingClientRect();ct(P);}},[t,y?.current]);return useEffect(()=>{z(t);},[t]),a$5(y,()=>{y.current.style.display="none",lt(-1);}),useEffect(()=>{if(d?.current)return M(),d.current.addEventListener("mousedown",M),d.current.addEventListener("input",Q),d.current.addEventListener("focusin",v),d.current.addEventListener("focusout",O),window.addEventListener("scroll",M,!0),window.addEventListener("resize",M),()=>{d.current?.removeEventListener("mousedown",M),d.current?.removeEventListener("input",M),d.current?.removeEventListener("focusout",O),d.current?.removeEventListener("focusin",v),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M);}},[M,O,v,Q]),useEffect(()=>{h&&(N(h),g(!0));},[h]),useEffect(()=>{u||o&&o.length&&!K.current&&(N(o),K.current=!0,g(!0));},[o,u]),jsxs("div",{className:a$2("relative",m),children:[jsx(Bt,{selectedOptions:U,onSelect:r,error:e,helperText:s,label:i,placeholder:a,handleSelect:C,options:t,onInputChange:R,size:A,disabled:b}),T&&jsx(Ht,{selectedOptions:U,disabled:b,error:e,onCleanSelectedOptions:$,size:A}),jsx(Xt,{handleSelect:C,selectedOptions:U,noResultsLabel:n,NoResultsIcon:w,optionDescriptionLines:j,noResultsAsColumn:f,noResultsButtonLabel:k,noResultsButtonOnClick:x,noResultsDescription:c,noResultsDescriptionLines:p})]})};var Oo=t=>jsx(Dt,{children:jsx(Yt,{...t})});var Oe=({children:t,hasDescription:o=!1,disabled:r=!1,hasDivider:e=!1,className:s,onClick:i,...a})=>jsxs(Fragment,{children:[jsx("div",{className:a$2("line-height-[120%] flex flex-row gap-4 pl-4 pr-3",o?"py-3":"py-[0.875rem]",r?"text-neutral-400":"hover:bg-primary-100 focus:bg-primary-200",s),onClick:n=>{r||i?.(n);},...a,children:t}),e&&jsx(a$1,{})]}),W=Oe;var Mt=({children:t,title:o,titleLines:r,description:e="",descriptionLines:s,startIcon:i,hasDivider:a=!1,disabled:n=!1,className:w,...c})=>jsxs(W,{hasDescription:!!e,disabled:n,hasDivider:a,className:w,...c,children:[i&&bt.cloneElement(i,{className:a$2(e?"mt-[0.4rem]":"self-center","shrink-0"),size:18}),jsx(Y,{title:o,titleLines:r,description:e,descriptionLines:s,disabled:n})]});export{rr as a,Mt as b,mr as c,St as d,Oo as e};
@@ -1 +1 @@
1
- import {d}from'./chunk-FAMLJ6AJ.mjs';import {a as a$1}from'./chunk-BVHU5ZT3.mjs';import {g}from'./chunk-TYHJTIAW.mjs';import {a}from'./chunk-2WINTZSS.mjs';import*as c from'react';import*as e from'@radix-ui/react-accordion';export{e as a };import {jsx,jsxs}from'react/jsx-runtime';var S=["sm","md"],k=c.forwardRef(({className:r,children:o,size:i="md",...a$1},d)=>jsx(e.Root,{"data-size":i,className:a("group/root space-y-2",r),...a$1,ref:d,children:o})),y=c.forwardRef(({className:r,...o},i)=>jsx(e.Item,{ref:i,className:a("rounded-lg bg-neutral-50",r),...o}));y.displayName="AccordionItem";var P=c.forwardRef(({className:r,children:o,...i},a$1)=>jsx(e.Header,{className:"flex",children:jsxs(e.Trigger,{ref:a$1,className:a("group flex flex-1 items-center justify-between p-4 transition-all [&[data-state=open]>svg]:rotate-180",r),...i,children:[o,jsx(g,{className:"h-6 w-6 shrink-0 transition-transform duration-200 group-disabled:text-neutral-500"})]})}));P.displayName=e.Trigger.displayName;var x=c.forwardRef(({className:r,title:o,description:i,onEndButtonClick:a$2,StartIcon:d$1,EndIcon:l,children:N,badgeNumber:f,chipStatus:m,...v},A)=>jsx(e.Header,{className:"flex",children:jsxs(e.Trigger,{title:o,ref:A,className:a("group flex flex-1 items-center justify-between gap-3 rounded-lg p-2 pl-3 transition-all hover:[&:not(:disabled)]:bg-primary-100 [&[data-state=open]>div>.chevron-icon]:rotate-180",a(!i&&"min-h-12",i&&"group-data-[size=md]/root:min-h-15.75 group-data-[size=sm]/root:min-h-12"),r),...v,children:[jsxs("div",{className:"flex",children:[d$1&&jsx(d$1,{className:"mr-2 h-4.5 w-4.5 text-neutral-900 group-disabled:text-neutral-500 group-data-[size=md]/root:h-4.5 group-data-[size=sm]:h-3.5 group-data-[size=md]/root:w-4.5 group-data-[size=sm]/root:w-3.5"}),jsxs("div",{children:[jsx("p",{className:"text-left text-base font-semibold !leading-[125%] text-neutral-900 group-disabled:text-neutral-500 group-data-[size=sm]/root:text-sm",children:o}),jsx("p",{className:"text-left text-sm font-normal leading-[130%] tracking-sm text-neutral-700 group-disabled:text-neutral-500 group-data-[size=sm]/root:text-xs",children:i})]})]}),jsxs("div",{className:"flex flex-shrink-0 items-center gap-1",children:[m&&jsx(d,{variant:m.variant,type:m.type,size:"xs",className:"flex-shrink-0",children:m.text}),f?.toString()&&jsx(a$1,{variant:"alert",size:"md",content:f.toString()}),l&&jsx(l,{className:"m-1.75 text-neutral-900 group-disabled:text-neutral-500",size:18,onClick:R=>{R.stopPropagation(),a$2?.();}}),jsx(g,{className:"chevron-icon h-4.5 w-4.5 shrink-0 transition-transform duration-200 group-disabled:text-neutral-500"})]})]})}));x.displayName=e.Trigger.displayName;var h=c.forwardRef(({className:r,children:o,...i},a$1)=>jsx(e.Content,{ref:a$1,className:"overflow-hidden data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...i,children:jsx("div",{className:a("pl-3 pr-2 group-data-[size=md]/root:py-4 group-data-[size=sm]/root:py-2",r),children:o})}));h.displayName=e.Content.displayName;export{S as b,k as c,y as d,P as e,x as f,h as g};
1
+ import {d}from'./chunk-FAMLJ6AJ.mjs';import {a as a$1}from'./chunk-BVHU5ZT3.mjs';import {g}from'./chunk-7TPCN744.mjs';import {a}from'./chunk-2WINTZSS.mjs';import*as c from'react';import*as e from'@radix-ui/react-accordion';export{e as a };import {jsx,jsxs}from'react/jsx-runtime';var S=["sm","md"],k=c.forwardRef(({className:r,children:o,size:i="md",...a$1},d)=>jsx(e.Root,{"data-size":i,className:a("group/root space-y-2",r),...a$1,ref:d,children:o})),y=c.forwardRef(({className:r,...o},i)=>jsx(e.Item,{ref:i,className:a("rounded-lg bg-neutral-50",r),...o}));y.displayName="AccordionItem";var P=c.forwardRef(({className:r,children:o,...i},a$1)=>jsx(e.Header,{className:"flex",children:jsxs(e.Trigger,{ref:a$1,className:a("group flex flex-1 items-center justify-between p-4 transition-all [&[data-state=open]>svg]:rotate-180",r),...i,children:[o,jsx(g,{className:"h-6 w-6 shrink-0 transition-transform duration-200 group-disabled:text-neutral-500"})]})}));P.displayName=e.Trigger.displayName;var x=c.forwardRef(({className:r,title:o,description:i,onEndButtonClick:a$2,StartIcon:d$1,EndIcon:l,children:N,badgeNumber:f,chipStatus:m,...v},A)=>jsx(e.Header,{className:"flex",children:jsxs(e.Trigger,{title:o,ref:A,className:a("group flex flex-1 items-center justify-between gap-3 rounded-lg p-2 pl-3 transition-all hover:[&:not(:disabled)]:bg-primary-100 [&[data-state=open]>div>.chevron-icon]:rotate-180",a(!i&&"min-h-12",i&&"group-data-[size=md]/root:min-h-15.75 group-data-[size=sm]/root:min-h-12"),r),...v,children:[jsxs("div",{className:"flex",children:[d$1&&jsx(d$1,{className:"mr-2 h-4.5 w-4.5 text-neutral-900 group-disabled:text-neutral-500 group-data-[size=md]/root:h-4.5 group-data-[size=sm]:h-3.5 group-data-[size=md]/root:w-4.5 group-data-[size=sm]/root:w-3.5"}),jsxs("div",{children:[jsx("p",{className:"text-left text-base font-semibold !leading-[125%] text-neutral-900 group-disabled:text-neutral-500 group-data-[size=sm]/root:text-sm",children:o}),jsx("p",{className:"text-left text-sm font-normal leading-[130%] tracking-sm text-neutral-700 group-disabled:text-neutral-500 group-data-[size=sm]/root:text-xs",children:i})]})]}),jsxs("div",{className:"flex flex-shrink-0 items-center gap-1",children:[m&&jsx(d,{variant:m.variant,type:m.type,size:"xs",className:"flex-shrink-0",children:m.text}),f?.toString()&&jsx(a$1,{variant:"alert",size:"md",content:f.toString()}),l&&jsx(l,{className:"m-1.75 text-neutral-900 group-disabled:text-neutral-500",size:18,onClick:R=>{R.stopPropagation(),a$2?.();}}),jsx(g,{className:"chevron-icon h-4.5 w-4.5 shrink-0 transition-transform duration-200 group-disabled:text-neutral-500"})]})]})}));x.displayName=e.Trigger.displayName;var h=c.forwardRef(({className:r,children:o,...i},a$1)=>jsx(e.Content,{ref:a$1,className:"overflow-hidden data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...i,children:jsx("div",{className:a("pl-3 pr-2 group-data-[size=md]/root:py-4 group-data-[size=sm]/root:py-2",r),children:o})}));h.displayName=e.Content.displayName;export{S as b,k as c,y as d,P as e,x as f,h as g};
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-QHBCNAWO.mjs';import {c as c$1}from'./chunk-WS2F7JWJ.mjs';import {c}from'./chunk-2VL36SBW.mjs';import {d}from'./chunk-TYHJTIAW.mjs';import {a}from'./chunk-2WINTZSS.mjs';import {Dialog}from'@ark-ui/react/dialog';import {Portal}from'@ark-ui/react/portal';import {forwardRef,useCallback}from'react';import {jsxs,jsx}from'react/jsx-runtime';var q=({onOpenChange:a,...o})=>{let r=useCallback(t=>{a?.(t.open);},[a]);return jsx(Dialog.Root,{unmountOnExit:!0,lazyMount:!0,onOpenChange:r,trapFocus:!1,...o})},G=Dialog.Trigger,J=["sm","md","lg","xl"],v=forwardRef(({children:a$1,className:o,size:r="sm",...t},n)=>jsxs(Portal,{children:[jsx(Dialog.Backdrop,{className:"fixed inset-0 z-40 bg-neutral-900/60 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),jsx(Dialog.Positioner,{className:"fixed left-0 top-0 z-40 flex h-screen w-screen items-center justify-end",children:jsx(Dialog.Content,{ref:n,className:a("elevation-10 h-full bg-neutral-50 data-[state=closed]:animate-swipeOut data-[state=open]:animate-slideIn",r==="sm"&&"w-117.5",r==="md"&&"w-187",r==="lg"&&"w-235",r==="xl"&&"w-312",o),...t,children:jsx("div",{className:"flex h-full flex-1 flex-col",children:a$1})})})]}));v.displayName="DrawerStickyContent";var C=forwardRef(({children:a$1,className:o,title:r,buttons:t=[],description:n,...D},g)=>jsxs("div",{className:a("border-b-1 border-neutral-200 pb-3.75 pl-4.5 pt-2",o),ref:g,...D,children:[jsx(Dialog.CloseTrigger,{asChild:!0,children:jsx(d,{className:"ml-auto mr-2 size-6 cursor-pointer"})}),jsxs("div",{className:"mr-4.5 mt-2 flex items-center justify-between gap-4.5",children:[jsx(Dialog.Title,{className:"line-clamp-1 break-all font-jakarta text-2xl font-semibold leading-[130%] text-neutral-900",children:r}),!Array.isArray(t)&&t.visible!==!1&&jsx(c,{size:"sm",variant:"ghost",...t}),Array.isArray(t)&&jsx("div",{className:"flex gap-1",children:t.map(({visible:f=!0,...u},w)=>f?jsx(c$1,{variant:"ghost",size:"sm",...u},w):null)})]}),n&&jsx(Dialog.Description,{className:"mr-4.5 mt-1 line-clamp-2 break-all font-inter text-sm leading-[130%] text-neutral-900",children:n})]}));C.displayName="DrawerStickyHeader";var P=forwardRef(({children:a$1,className:o,...r},t)=>jsx("div",{className:a("flex justify-end gap-3 border-t-1 border-neutral-200 px-4.5 pb-4.5 pt-4.25",o),ref:t,...r,children:a$1}));P.displayName="DrawerStickyFooter";var b=forwardRef(({children:a$2,className:o,...r},t)=>jsxs(a$1,{viewPortClassName:"py-4 px-6",className:a("h-full",o),ref:t,...r,children:[a$2,jsx("div",{className:"min-h-4"})]}));b.displayName="DrawerStickyBody";var K=Dialog.CloseTrigger;export{q as a,G as b,J as c,v as d,C as e,P as f,b as g,K as h};
1
+ import {a as a$1}from'./chunk-QHBCNAWO.mjs';import {c as c$1}from'./chunk-WS2F7JWJ.mjs';import {c}from'./chunk-AQPJ5OS4.mjs';import {d}from'./chunk-7TPCN744.mjs';import {a}from'./chunk-2WINTZSS.mjs';import {Dialog}from'@ark-ui/react/dialog';import {Portal}from'@ark-ui/react/portal';import {forwardRef,useCallback}from'react';import {jsxs,jsx}from'react/jsx-runtime';var q=({onOpenChange:a,...o})=>{let r=useCallback(t=>{a?.(t.open);},[a]);return jsx(Dialog.Root,{unmountOnExit:!0,lazyMount:!0,onOpenChange:r,trapFocus:!1,...o})},G=Dialog.Trigger,J=["sm","md","lg","xl"],v=forwardRef(({children:a$1,className:o,size:r="sm",...t},n)=>jsxs(Portal,{children:[jsx(Dialog.Backdrop,{className:"fixed inset-0 z-40 bg-neutral-900/60 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),jsx(Dialog.Positioner,{className:"fixed left-0 top-0 z-40 flex h-screen w-screen items-center justify-end",children:jsx(Dialog.Content,{ref:n,className:a("elevation-10 h-full bg-neutral-50 data-[state=closed]:animate-swipeOut data-[state=open]:animate-slideIn",r==="sm"&&"w-117.5",r==="md"&&"w-187",r==="lg"&&"w-235",r==="xl"&&"w-312",o),...t,children:jsx("div",{className:"flex h-full flex-1 flex-col",children:a$1})})})]}));v.displayName="DrawerStickyContent";var C=forwardRef(({children:a$1,className:o,title:r,buttons:t=[],description:n,...D},g)=>jsxs("div",{className:a("border-b-1 border-neutral-200 pb-3.75 pl-4.5 pt-2",o),ref:g,...D,children:[jsx(Dialog.CloseTrigger,{asChild:!0,children:jsx(d,{className:"ml-auto mr-2 size-6 cursor-pointer"})}),jsxs("div",{className:"mr-4.5 mt-2 flex items-center justify-between gap-4.5",children:[jsx(Dialog.Title,{className:"line-clamp-1 break-all font-jakarta text-2xl font-semibold leading-[130%] text-neutral-900",children:r}),!Array.isArray(t)&&t.visible!==!1&&jsx(c,{size:"sm",variant:"ghost",...t}),Array.isArray(t)&&jsx("div",{className:"flex gap-1",children:t.map(({visible:f=!0,...u},w)=>f?jsx(c$1,{variant:"ghost",size:"sm",...u},w):null)})]}),n&&jsx(Dialog.Description,{className:"mr-4.5 mt-1 line-clamp-2 break-all font-inter text-sm leading-[130%] text-neutral-900",children:n})]}));C.displayName="DrawerStickyHeader";var P=forwardRef(({children:a$1,className:o,...r},t)=>jsx("div",{className:a("flex justify-end gap-3 border-t-1 border-neutral-200 px-4.5 pb-4.5 pt-4.25",o),ref:t,...r,children:a$1}));P.displayName="DrawerStickyFooter";var b=forwardRef(({children:a$2,className:o,...r},t)=>jsxs(a$1,{viewPortClassName:"py-4 px-6",className:a("h-full",o),ref:t,...r,children:[a$2,jsx("div",{className:"min-h-4"})]}));b.displayName="DrawerStickyBody";var K=Dialog.CloseTrigger;export{q as a,G as b,J as c,v as d,C as e,P as f,b as g,K as h};
@@ -1 +1 @@
1
- import {d as d$1}from'./chunk-TYHJTIAW.mjs';import {a}from'./chunk-2WINTZSS.mjs';import*as s from'react';import*as t from'@radix-ui/react-toast';import {jsx,jsxs}from'react/jsx-runtime';var d=({children:i,...e})=>jsxs(t.Provider,{...e,children:[i,jsx(n,{})]}),n=s.forwardRef(({className:i,...e},a$1)=>jsx(t.Viewport,{ref:a$1,className:a("fixed right-4 top-5 z-[100000]",i),...e}));n.displayName=t.Viewport.displayName;var p=s.forwardRef(({className:i,...e},a)=>jsx(t.Root,{ref:a,className:"flex items-center rounded-lg bg-neutral-900 px-4 py-4 data-[state=closed]:animate-swipeOut data-[state=end]:animate-hide data-[state=open]:animate-slideIn",...e}));p.displayName=t.Root.displayName;var c=s.forwardRef(({className:i,...e},a)=>jsx(t.Action,{ref:a,className:"px-3 py-2 text-sm font-semibold text-primary-400",altText:"action",...e}));c.displayName=t.Action.displayName;var f=s.forwardRef((i,e)=>jsx(t.Close,{ref:e,"toast-close":"",...i,children:jsx(d$1,{className:"h-6 w-6 text-neutral-50"})}));f.displayName=t.Close.displayName;var l=s.forwardRef(({className:i,...e},a$1)=>jsx(t.Title,{ref:a$1,className:a("text-sm text-neutral-50",i),...e}));l.displayName=t.Title.displayName;var R=s.forwardRef(({className:i,...e},a)=>jsx(t.Description,{ref:a,className:"text-sm text-neutral-50",...e}));R.displayName=t.Description.displayName;export{d as a,n as b,p as c,c as d,f as e,l as f};
1
+ import {d as d$1}from'./chunk-7TPCN744.mjs';import {a}from'./chunk-2WINTZSS.mjs';import*as s from'react';import*as t from'@radix-ui/react-toast';import {jsx,jsxs}from'react/jsx-runtime';var d=({children:i,...e})=>jsxs(t.Provider,{...e,children:[i,jsx(n,{})]}),n=s.forwardRef(({className:i,...e},a$1)=>jsx(t.Viewport,{ref:a$1,className:a("fixed right-4 top-5 z-[100000]",i),...e}));n.displayName=t.Viewport.displayName;var p=s.forwardRef(({className:i,...e},a)=>jsx(t.Root,{ref:a,className:"flex items-center rounded-lg bg-neutral-900 px-4 py-4 data-[state=closed]:animate-swipeOut data-[state=end]:animate-hide data-[state=open]:animate-slideIn",...e}));p.displayName=t.Root.displayName;var c=s.forwardRef(({className:i,...e},a)=>jsx(t.Action,{ref:a,className:"px-3 py-2 text-sm font-semibold text-primary-400",altText:"action",...e}));c.displayName=t.Action.displayName;var f=s.forwardRef((i,e)=>jsx(t.Close,{ref:e,"toast-close":"",...i,children:jsx(d$1,{className:"h-6 w-6 text-neutral-50"})}));f.displayName=t.Close.displayName;var l=s.forwardRef(({className:i,...e},a$1)=>jsx(t.Title,{ref:a$1,className:a("text-sm text-neutral-50",i),...e}));l.displayName=t.Title.displayName;var R=s.forwardRef(({className:i,...e},a)=>jsx(t.Description,{ref:a,className:"text-sm text-neutral-50",...e}));R.displayName=t.Description.displayName;export{d as a,n as b,p as c,c as d,f as e,l as f};
@@ -1 +1 @@
1
- import {a as a$3,b,c,d,e,f,g as g$1,h,i}from'./chunk-E5G7444M.mjs';import {a as a$1}from'./chunk-2GJHRBSH.mjs';import {a as a$2}from'./chunk-QHBCNAWO.mjs';import {g}from'./chunk-TYHJTIAW.mjs';import {a}from'./chunk-2WINTZSS.mjs';import Q,{useId,useRef,useState,useEffect}from'react';import*as A from'@radix-ui/react-portal';import {jsx,jsxs}from'react/jsx-runtime';var H=56,p=6,Z=[{id:0,code:"+56",name:"Chile",flag:a$3,country:"CL"},{id:1,code:"+54",name:"Argentina",flag:b,country:"AR"},{id:2,code:"+57",name:"Colombia",flag:c,country:"CO"},{id:3,code:"+502",name:"Guatemala",flag:d,country:"GT"},{id:4,code:"+52",name:"Mexico",flag:e,country:"MX"},{id:5,code:"+51",name:"Per\xFA",flag:f,country:"PE"},{id:6,code:"+55",name:"Brasil",flag:g$1,country:"BR"},{id:7,code:"+598",name:"Uruguay",flag:h,country:"UY"},{id:8,code:"+1",name:"Estados Unidos",flag:i,country:"US"}],we=({options:o=Z,noResults:y,selectedOption:B,onSelect:U,onChange:h,onClick:ee,className:G,defaultCountry:v="CL",initialValue:s,size:$="md",...i})=>{let z=useId(),c=useRef(null),l=useRef(null),D=useRef(null),[Y,_]=useState("bottom"),[d,V]=useState(),[X,j]=useState(-1),[a$3,x]=useState(B??null),[E,F]=useState(""),q=e=>{let t={target:{value:e.code+E}};h?.(t),c.current.style.display="none",l.current.value=e.code,x(e),U?.(e);};return useEffect(()=>{if(!l.current)return;let e=()=>{if(!l.current)return;let t=H*(o.length<p?o.length:p)+16,m=l.current.getBoundingClientRect();V(m);let J=window.innerHeight-m.bottom>t,K=m.top>t;_(J?"bottom":K?"top":"bottom");};return e(),l.current.addEventListener("mousedown",e),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{l.current?.removeEventListener("mousedown",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e);}},[l.current]),useEffect(()=>{function e(t){c.current&&!c.current.contains(t.target)&&(c.current.style.display="none",j(-1));}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e);}},[c.current]),useEffect(()=>{if(v&&!s){let e=o.find(t=>t.country===v)??null;x(e);}},[v,s]),useEffect(()=>{if(s){let e=o.find(t=>s.includes(t.code))??null;x(e),F(s.replace(e?.code??"",""));}},[s]),jsx("div",{className:a("flex flex-col",G),children:jsxs("div",{className:a("relative flex flex-col"),children:[jsx(a$1,{ref:l,value:E,placeholder:i.placeholder??"",onChange:e=>{let t=e.target.value.replace(/\D/g,"");F(t);let m={target:{value:a$3?.code&&!t.includes(a$3.code)?a$3?.code+t:t}};h?.(m);},startComponent:jsxs("div",{className:"z-[100000] ml-3 flex h-2 w-[7.5rem] cursor-pointer items-center",onClick:()=>{i.disabled||(c.current.style.display="flex");},children:[jsx("img",{src:a$3?.flag,alt:a$3?.country,className:a("h-6 w-6 cursor-pointer",i.disabled&&"cursor-not-allowed text-neutral-400")}),jsx("span",{className:a("ml-1",i.disabled&&"cursor-not-allowed text-neutral-400"),children:a$3?.code}),jsx(g,{className:a($==="md"?"h-6 w-6":"h-4.5 w-4.5","cursor-pointer",i.disabled&&"cursor-not-allowed text-neutral-400")})]}),...i}),jsx(A.Root,{asChild:!0,children:jsx("ul",{ref:c,className:"pointer-events-auto absolute z-[10000] hidden w-full",style:d?{width:`${d.width}px`,left:d.left,top:Y==="bottom"?`${d.height+d.top+window.scrollY}px`:window.scrollY+d.top-(o.length<p?o.length:p)*H-16}:void 0,children:jsxs(a$2,{className:"elevation-8 my-2 flex max-h-[336px] w-full flex-col rounded-lg bg-neutral-50",ref:D,children:[o.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col items-center justify-center rounded-lg bg-neutral-50 px-8 py-6",children:[Q.cloneElement(y.icon,{className:"mb-2 h-8 w-8 text-neutral-300"}),jsx("p",{className:"text-center text-sm leading-[120%] text-neutral-500",children:y.message})]}),o.map((e,t)=>jsx("li",{onClick:()=>{q(e);},className:a("flex-shrink-0 cursor-pointer py-4 pl-4 pr-6 text-left hover:bg-primary-100",a$3?.code===e.code&&"bg-primary-200",X===t&&"bg-primary-200"),value:e.code,children:jsxs("div",{className:a("flex items-center space-x-3"),children:[jsx("img",{src:e.flag,alt:e.country,className:"h-6 w-6"}),jsx("p",{children:e.name}),jsx("p",{className:"text-primary-500",children:`(${e.code})`})]})},`select-option-${z}-${e.id??e.code}`))]})})})]})})};export{we as a};
1
+ import {a as a$3,b,c,d,e,f,g as g$1,h,i}from'./chunk-E5G7444M.mjs';import {a as a$1}from'./chunk-L43TLWY4.mjs';import {a as a$2}from'./chunk-QHBCNAWO.mjs';import {g}from'./chunk-7TPCN744.mjs';import {a}from'./chunk-2WINTZSS.mjs';import Q,{useId,useRef,useState,useEffect}from'react';import*as A from'@radix-ui/react-portal';import {jsx,jsxs}from'react/jsx-runtime';var H=56,p=6,Z=[{id:0,code:"+56",name:"Chile",flag:a$3,country:"CL"},{id:1,code:"+54",name:"Argentina",flag:b,country:"AR"},{id:2,code:"+57",name:"Colombia",flag:c,country:"CO"},{id:3,code:"+502",name:"Guatemala",flag:d,country:"GT"},{id:4,code:"+52",name:"Mexico",flag:e,country:"MX"},{id:5,code:"+51",name:"Per\xFA",flag:f,country:"PE"},{id:6,code:"+55",name:"Brasil",flag:g$1,country:"BR"},{id:7,code:"+598",name:"Uruguay",flag:h,country:"UY"},{id:8,code:"+1",name:"Estados Unidos",flag:i,country:"US"}],we=({options:o=Z,noResults:y,selectedOption:B,onSelect:U,onChange:h,onClick:ee,className:G,defaultCountry:v="CL",initialValue:s,size:$="md",...i})=>{let z=useId(),c=useRef(null),l=useRef(null),D=useRef(null),[Y,_]=useState("bottom"),[d,V]=useState(),[X,j]=useState(-1),[a$3,x]=useState(B??null),[E,F]=useState(""),q=e=>{let t={target:{value:e.code+E}};h?.(t),c.current.style.display="none",l.current.value=e.code,x(e),U?.(e);};return useEffect(()=>{if(!l.current)return;let e=()=>{if(!l.current)return;let t=H*(o.length<p?o.length:p)+16,m=l.current.getBoundingClientRect();V(m);let J=window.innerHeight-m.bottom>t,K=m.top>t;_(J?"bottom":K?"top":"bottom");};return e(),l.current.addEventListener("mousedown",e),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{l.current?.removeEventListener("mousedown",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e);}},[l.current]),useEffect(()=>{function e(t){c.current&&!c.current.contains(t.target)&&(c.current.style.display="none",j(-1));}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e);}},[c.current]),useEffect(()=>{if(v&&!s){let e=o.find(t=>t.country===v)??null;x(e);}},[v,s]),useEffect(()=>{if(s){let e=o.find(t=>s.includes(t.code))??null;x(e),F(s.replace(e?.code??"",""));}},[s]),jsx("div",{className:a("flex flex-col",G),children:jsxs("div",{className:a("relative flex flex-col"),children:[jsx(a$1,{ref:l,value:E,placeholder:i.placeholder??"",onChange:e=>{let t=e.target.value.replace(/\D/g,"");F(t);let m={target:{value:a$3?.code&&!t.includes(a$3.code)?a$3?.code+t:t}};h?.(m);},startComponent:jsxs("div",{className:"z-[100000] ml-3 flex h-2 w-[7.5rem] cursor-pointer items-center",onClick:()=>{i.disabled||(c.current.style.display="flex");},children:[jsx("img",{src:a$3?.flag,alt:a$3?.country,className:a("h-6 w-6 cursor-pointer",i.disabled&&"cursor-not-allowed text-neutral-400")}),jsx("span",{className:a("ml-1",i.disabled&&"cursor-not-allowed text-neutral-400"),children:a$3?.code}),jsx(g,{className:a($==="md"?"h-6 w-6":"h-4.5 w-4.5","cursor-pointer",i.disabled&&"cursor-not-allowed text-neutral-400")})]}),...i}),jsx(A.Root,{asChild:!0,children:jsx("ul",{ref:c,className:"pointer-events-auto absolute z-[10000] hidden w-full",style:d?{width:`${d.width}px`,left:d.left,top:Y==="bottom"?`${d.height+d.top+window.scrollY}px`:window.scrollY+d.top-(o.length<p?o.length:p)*H-16}:void 0,children:jsxs(a$2,{className:"elevation-8 my-2 flex max-h-[336px] w-full flex-col rounded-lg bg-neutral-50",ref:D,children:[o.length===0&&jsxs("div",{className:"elevation-8 max-h-88 flex flex-1 flex-col items-center justify-center rounded-lg bg-neutral-50 px-8 py-6",children:[Q.cloneElement(y.icon,{className:"mb-2 h-8 w-8 text-neutral-300"}),jsx("p",{className:"text-center text-sm leading-[120%] text-neutral-500",children:y.message})]}),o.map((e,t)=>jsx("li",{onClick:()=>{q(e);},className:a("flex-shrink-0 cursor-pointer py-4 pl-4 pr-6 text-left hover:bg-primary-100",a$3?.code===e.code&&"bg-primary-200",X===t&&"bg-primary-200"),value:e.code,children:jsxs("div",{className:a("flex items-center space-x-3"),children:[jsx("img",{src:e.flag,alt:e.country,className:"h-6 w-6"}),jsx("p",{children:e.name}),jsx("p",{className:"text-primary-500",children:`(${e.code})`})]})},`select-option-${z}-${e.id??e.code}`))]})})})]})})};export{we as a};
@@ -1 +1 @@
1
- import {a}from'./chunk-KTRSJBA4.mjs';import {a as a$1}from'./chunk-2GJHRBSH.mjs';import {a as a$3}from'./chunk-QHBCNAWO.mjs';import {o}from'./chunk-TYHJTIAW.mjs';import {a as a$2}from'./chunk-2WINTZSS.mjs';import {useState,useRef,useMemo,useEffect}from'react';import*as S from'@radix-ui/react-portal';import {format}from'date-fns';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var U=["00:00:00","00:30:00","01:00:00","01:30:00","02:00:00","02:30:00","03:00:00","03:30:00","04:00:00","04:30:00","05:00:00","05:30:00","06:00:00","06:30:00","07:00:00","07:30:00","08:00:00","08:30:00","09:00:00","09:30:00","10:00:00","10:30:00","11:00:00","11:30:00","12:00:00","12:30:00","13:00:00","13:30:00","14:00:00","14:30:00","15:00:00","15:30:00","16:00:00","16:30:00","17:00:00","17:30:00","18:00:00","18:30:00","19:00:00","19:30:00","20:00:00","20:30:00","21:00:00","21:30:00","22:00:00","22:30:00","23:00:00","23:30:00"],i=56,d=6,V=({value:f,onChange:P,locale:g,minTime:T,maxTime:v,...N})=>{let[O,u]=useState(!1),[p,h]=useState(f),[n,y]=useState(),[z,A]=useState("bottom"),E=useRef(null),o$1=useRef(null),x=useRef(null),[l,c]=useState(-1),k=e=>{h(e),P?.(e),u(!1),c(-1);},B=useMemo(()=>p?format(new Date("2024-01-01T"+p),"p"):"",[p,g]),K=()=>{h(void 0),c(-1),P?.(void 0);},r=useMemo(()=>U.map(e=>({value:e,label:format(new Date("2024-01-01T"+e),"p"),disabled:T&&e<T||v&&e>v})),[g,T,v]),_=e=>{if(e.preventDefault(),e.key==="ArrowDown"){if(l===r.length-1)return;c(t=>t+1),u(!0),L();}else if(e.key==="ArrowUp"){if(l===0)return;c(t=>t-1),L();}else e.key==="Enter"&&(k(r[l].value),c(-1));},L=()=>{let e=i*d;x.current.scroll({top:(l+2)*i<=e?0:i*(l+2)-e,behavior:"smooth"});};return useEffect(()=>{h(f);},[f]),a(E,()=>{u(!1);}),useEffect(()=>{if(!o$1.current)return;let e=()=>{if(!o$1.current)return;let t=i*(r.length<d?r.length:d)+16,m=o$1.current.getBoundingClientRect();y(m);let $=window.innerHeight-m.bottom>t,G=m.top+m.height>t;A($?"bottom":G?"top":"bottom");};return e(),o$1.current.addEventListener("mousedown",e),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{o$1.current?.removeEventListener("mousedown",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e);}},[o$1.current]),jsxs(Fragment,{children:[jsx(a$1,{ref:o$1,autoComplete:"off",startIcon:jsx(o,{}),onClean:K,readOnly:!0,value:B,onKeyDown:_,onClick:e=>{y(e.currentTarget.getBoundingClientRect()),u(t=>!t);},...N}),jsx(S.Root,{children:jsx("div",{ref:E,className:a$2("pointer-events-auto fixed z-50 hidden",O&&"block"),style:n?{width:`${n.width}px`,top:z==="bottom"?`${n.height+n.top}px`:n.top-(r.length<d?r.length:d)*i-16,left:n?.left}:void 0,children:jsx(a$3,{className:"elevation-8 my-2 flex max-h-84 w-full flex-col rounded-lg bg-neutral-50",ref:x,children:r.map((e,t)=>jsx("div",{onClick:()=>!e.disabled&&k(e.value),className:a$2("flex w-full items-center px-2 hover:cursor-pointer",!e.disabled&&"hover:bg-primary-100",p===e.value&&"bg-primary-200",l===t&&"bg-primary-200",e.disabled&&"text-neutral-500 hover:cursor-not-allowed"),style:{height:i},children:e.label},e.value))})})})]})};V.displayName="TimePicker";export{V as a};
1
+ import {a}from'./chunk-KTRSJBA4.mjs';import {a as a$1}from'./chunk-L43TLWY4.mjs';import {a as a$3}from'./chunk-QHBCNAWO.mjs';import {o}from'./chunk-7TPCN744.mjs';import {a as a$2}from'./chunk-2WINTZSS.mjs';import {useState,useRef,useMemo,useEffect}from'react';import*as S from'@radix-ui/react-portal';import {format}from'date-fns';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var U=["00:00:00","00:30:00","01:00:00","01:30:00","02:00:00","02:30:00","03:00:00","03:30:00","04:00:00","04:30:00","05:00:00","05:30:00","06:00:00","06:30:00","07:00:00","07:30:00","08:00:00","08:30:00","09:00:00","09:30:00","10:00:00","10:30:00","11:00:00","11:30:00","12:00:00","12:30:00","13:00:00","13:30:00","14:00:00","14:30:00","15:00:00","15:30:00","16:00:00","16:30:00","17:00:00","17:30:00","18:00:00","18:30:00","19:00:00","19:30:00","20:00:00","20:30:00","21:00:00","21:30:00","22:00:00","22:30:00","23:00:00","23:30:00"],i=56,d=6,V=({value:f,onChange:P,locale:g,minTime:T,maxTime:v,...N})=>{let[O,u]=useState(!1),[p,h]=useState(f),[n,y]=useState(),[z,A]=useState("bottom"),E=useRef(null),o$1=useRef(null),x=useRef(null),[l,c]=useState(-1),k=e=>{h(e),P?.(e),u(!1),c(-1);},B=useMemo(()=>p?format(new Date("2024-01-01T"+p),"p"):"",[p,g]),K=()=>{h(void 0),c(-1),P?.(void 0);},r=useMemo(()=>U.map(e=>({value:e,label:format(new Date("2024-01-01T"+e),"p"),disabled:T&&e<T||v&&e>v})),[g,T,v]),_=e=>{if(e.preventDefault(),e.key==="ArrowDown"){if(l===r.length-1)return;c(t=>t+1),u(!0),L();}else if(e.key==="ArrowUp"){if(l===0)return;c(t=>t-1),L();}else e.key==="Enter"&&(k(r[l].value),c(-1));},L=()=>{let e=i*d;x.current.scroll({top:(l+2)*i<=e?0:i*(l+2)-e,behavior:"smooth"});};return useEffect(()=>{h(f);},[f]),a(E,()=>{u(!1);}),useEffect(()=>{if(!o$1.current)return;let e=()=>{if(!o$1.current)return;let t=i*(r.length<d?r.length:d)+16,m=o$1.current.getBoundingClientRect();y(m);let $=window.innerHeight-m.bottom>t,G=m.top+m.height>t;A($?"bottom":G?"top":"bottom");};return e(),o$1.current.addEventListener("mousedown",e),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{o$1.current?.removeEventListener("mousedown",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e);}},[o$1.current]),jsxs(Fragment,{children:[jsx(a$1,{ref:o$1,autoComplete:"off",startIcon:jsx(o,{}),onClean:K,readOnly:!0,value:B,onKeyDown:_,onClick:e=>{y(e.currentTarget.getBoundingClientRect()),u(t=>!t);},...N}),jsx(S.Root,{children:jsx("div",{ref:E,className:a$2("pointer-events-auto fixed z-50 hidden",O&&"block"),style:n?{width:`${n.width}px`,top:z==="bottom"?`${n.height+n.top}px`:n.top-(r.length<d?r.length:d)*i-16,left:n?.left}:void 0,children:jsx(a$3,{className:"elevation-8 my-2 flex max-h-84 w-full flex-col rounded-lg bg-neutral-50",ref:x,children:r.map((e,t)=>jsx("div",{onClick:()=>!e.disabled&&k(e.value),className:a$2("flex w-full items-center px-2 hover:cursor-pointer",!e.disabled&&"hover:bg-primary-100",p===e.value&&"bg-primary-200",l===t&&"bg-primary-200",e.disabled&&"text-neutral-500 hover:cursor-not-allowed"),style:{height:i},children:e.label},e.value))})})})]})};V.displayName="TimePicker";export{V as a};