@solace-health/ui 0.10.709 → 0.10.711

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 (210) hide show
  1. package/dist/BackLink/BackLink.cjs +1 -1
  2. package/dist/BackLink/BackLink.js +1 -1
  3. package/dist/Card/illustrations/Clock.cjs +1 -1
  4. package/dist/Card/illustrations/Clock.js +1 -1
  5. package/dist/Card/illustrations/Coffee.cjs +1 -1
  6. package/dist/Card/illustrations/Coffee.js +1 -1
  7. package/dist/Card/illustrations/Laptop.cjs +1 -1
  8. package/dist/Card/illustrations/Laptop.js +1 -1
  9. package/dist/Card/illustrations/Medication.cjs +1 -1
  10. package/dist/Card/illustrations/Medication.js +1 -1
  11. package/dist/Card/illustrations/Notepad.cjs +1 -1
  12. package/dist/Card/illustrations/Notepad.js +1 -1
  13. package/dist/Card/illustrations/index.cjs +1 -1
  14. package/dist/Card/illustrations/index.js +1 -1
  15. package/dist/Card/index.cjs +1 -1
  16. package/dist/Card/index.js +1 -1
  17. package/dist/DateDropdown/index.cjs +1 -1
  18. package/dist/DateDropdown/index.js +1 -1
  19. package/dist/DateSelectCalendar/DateSelectCalendar.cjs +1 -1
  20. package/dist/DateSelectCalendar/DateSelectCalendar.js +1 -1
  21. package/dist/Error/index.cjs +1 -1
  22. package/dist/Error/index.js +1 -1
  23. package/dist/ExpandableDrawer/index.cjs +1 -1
  24. package/dist/ExpandableDrawer/index.js +1 -1
  25. package/dist/File/index.cjs +1 -1
  26. package/dist/File/index.js +1 -1
  27. package/dist/Form/AddressSelect/index.cjs +1 -1
  28. package/dist/Form/AddressSelect/index.js +1 -1
  29. package/dist/Form/Checkbox/index.cjs +1 -1
  30. package/dist/Form/Checkbox/index.js +1 -1
  31. package/dist/Form/DateDropdown/index.cjs +1 -1
  32. package/dist/Form/DateDropdown/index.js +1 -1
  33. package/dist/Form/DateSelect/index.cjs +1 -1
  34. package/dist/Form/DateSelect/index.js +1 -1
  35. package/dist/Form/DateTextMaskInput/index.cjs +1 -1
  36. package/dist/Form/DateTextMaskInput/index.js +1 -1
  37. package/dist/Form/FileUpload/index.cjs +1 -1
  38. package/dist/Form/FileUpload/index.js +1 -1
  39. package/dist/Form/Keyword/index.cjs +1 -1
  40. package/dist/Form/Keyword/index.js +1 -1
  41. package/dist/Form/LocationSelect/index.cjs +1 -1
  42. package/dist/Form/LocationSelect/index.js +1 -1
  43. package/dist/Form/Number/index.cjs +1 -1
  44. package/dist/Form/Number/index.js +1 -1
  45. package/dist/Form/OTP/index.cjs +1 -1
  46. package/dist/Form/OTP/index.js +1 -1
  47. package/dist/Form/Radio/index.cjs +1 -1
  48. package/dist/Form/Radio/index.js +1 -1
  49. package/dist/Form/Select/index.cjs +1 -1
  50. package/dist/Form/Select/index.js +1 -1
  51. package/dist/Form/SelectMenu/index.cjs +1 -1
  52. package/dist/Form/SelectMenu/index.js +1 -1
  53. package/dist/Form/SentimentSelector/index.cjs +1 -1
  54. package/dist/Form/SentimentSelector/index.js +1 -1
  55. package/dist/Form/Signature/index.cjs +1 -1
  56. package/dist/Form/Signature/index.js +1 -1
  57. package/dist/Form/Text/index.cjs +1 -1
  58. package/dist/Form/Text/index.js +1 -1
  59. package/dist/Form/TextInput/index.cjs +1 -1
  60. package/dist/Form/TextInput/index.js +1 -1
  61. package/dist/Form/TimePicker/index.cjs +1 -1
  62. package/dist/Form/TimePicker/index.js +1 -1
  63. package/dist/Form/TimeSelect/index.cjs +1 -1
  64. package/dist/Form/TimeSelect/index.js +1 -1
  65. package/dist/Form/index.cjs +1 -1
  66. package/dist/Form/index.js +1 -1
  67. package/dist/Form/shared/FormInputLabel.cjs +1 -1
  68. package/dist/Form/shared/FormInputLabel.js +1 -1
  69. package/dist/Form/shared/HelpModal.cjs +1 -1
  70. package/dist/Form/shared/HelpModal.js +1 -1
  71. package/dist/IconSelector/IconSelector.cjs +1 -1
  72. package/dist/IconSelector/IconSelector.js +1 -1
  73. package/dist/Input/index.cjs +1 -1
  74. package/dist/Input/index.js +1 -1
  75. package/dist/Menu/ExpandIcon.cjs +1 -1
  76. package/dist/Menu/ExpandIcon.js +1 -1
  77. package/dist/Menu/index.cjs +1 -1
  78. package/dist/Menu/index.js +1 -1
  79. package/dist/Molecules/FilterPopover/FiltersMenu/FiltersMenu.cjs +1 -1
  80. package/dist/Molecules/FilterPopover/FiltersMenu/FiltersMenu.js +1 -1
  81. package/dist/Molecules/FilterPopover/index.cjs +1 -1
  82. package/dist/Molecules/FilterPopover/index.js +1 -1
  83. package/dist/NavigationMenu/ExpandIcon.cjs +1 -1
  84. package/dist/NavigationMenu/ExpandIcon.js +1 -1
  85. package/dist/NavigationMenu/index.cjs +1 -1
  86. package/dist/NavigationMenu/index.js +1 -1
  87. package/dist/PreviewDrawer/PreviewDrawer.cjs +1 -1
  88. package/dist/PreviewDrawer/PreviewDrawer.js +1 -1
  89. package/dist/Search/index.cjs +1 -1
  90. package/dist/Search/index.js +1 -1
  91. package/dist/SelectClient/index.cjs +1 -1
  92. package/dist/SelectClient/index.js +1 -1
  93. package/dist/SentimentSelector/index.cjs +1 -1
  94. package/dist/SentimentSelector/index.js +1 -1
  95. package/dist/TimeSelect/styles.cjs +4 -4
  96. package/dist/TimeSelect/styles.js +1 -1
  97. package/dist/{chunk-6JZ7R26F.cjs → chunk-2BHGUK45.cjs} +2 -2
  98. package/dist/{chunk-6JZ7R26F.cjs.map → chunk-2BHGUK45.cjs.map} +1 -1
  99. package/dist/chunk-2USGDLDW.js +2 -0
  100. package/dist/chunk-2USGDLDW.js.map +1 -0
  101. package/dist/{chunk-5UAV775I.js → chunk-3ZCSAQG7.js} +2 -2
  102. package/dist/{chunk-5UAV775I.js.map → chunk-3ZCSAQG7.js.map} +1 -1
  103. package/dist/{chunk-66OYFOJG.cjs → chunk-4CHRDQR7.cjs} +2 -2
  104. package/dist/{chunk-66OYFOJG.cjs.map → chunk-4CHRDQR7.cjs.map} +1 -1
  105. package/dist/{chunk-EUQF6F5F.js → chunk-4L5ZRFHA.js} +2 -2
  106. package/dist/{chunk-EUQF6F5F.js.map → chunk-4L5ZRFHA.js.map} +1 -1
  107. package/dist/{chunk-JCXXDXSA.cjs → chunk-4MTRF322.cjs} +2 -2
  108. package/dist/{chunk-JCXXDXSA.cjs.map → chunk-4MTRF322.cjs.map} +1 -1
  109. package/dist/chunk-54DZOSDP.cjs +2 -0
  110. package/dist/chunk-54DZOSDP.cjs.map +1 -0
  111. package/dist/{chunk-DOXWPQB7.cjs → chunk-6C5ROFWH.cjs} +2 -2
  112. package/dist/{chunk-DOXWPQB7.cjs.map → chunk-6C5ROFWH.cjs.map} +1 -1
  113. package/dist/chunk-6T7SNM2F.cjs +2 -0
  114. package/dist/chunk-6T7SNM2F.cjs.map +1 -0
  115. package/dist/{chunk-WTGHWP7T.cjs → chunk-BFHEVJNW.cjs} +2 -2
  116. package/dist/{chunk-WTGHWP7T.cjs.map → chunk-BFHEVJNW.cjs.map} +1 -1
  117. package/dist/chunk-C7YYWHDQ.js +2 -0
  118. package/dist/chunk-C7YYWHDQ.js.map +1 -0
  119. package/dist/{chunk-36YHOTU6.js → chunk-D5AT3ZJD.js} +2 -2
  120. package/dist/{chunk-36YHOTU6.js.map → chunk-D5AT3ZJD.js.map} +1 -1
  121. package/dist/chunk-DM3KOEH4.js +2 -0
  122. package/dist/{chunk-UDNQL2TT.js.map → chunk-DM3KOEH4.js.map} +1 -1
  123. package/dist/{chunk-QNQLCXEU.js → chunk-DMGSZX4T.js} +2 -2
  124. package/dist/{chunk-QNQLCXEU.js.map → chunk-DMGSZX4T.js.map} +1 -1
  125. package/dist/{chunk-G4NTJXGK.cjs → chunk-IBQWP337.cjs} +2 -2
  126. package/dist/{chunk-G4NTJXGK.cjs.map → chunk-IBQWP337.cjs.map} +1 -1
  127. package/dist/{chunk-CINH35OT.cjs → chunk-IJ7FBO3U.cjs} +2 -2
  128. package/dist/{chunk-CINH35OT.cjs.map → chunk-IJ7FBO3U.cjs.map} +1 -1
  129. package/dist/{chunk-IDHBCJT6.js → chunk-J624VXFX.js} +2 -2
  130. package/dist/{chunk-IDHBCJT6.js.map → chunk-J624VXFX.js.map} +1 -1
  131. package/dist/{chunk-P4TOP5DA.cjs → chunk-KJULJRWW.cjs} +2 -2
  132. package/dist/{chunk-P4TOP5DA.cjs.map → chunk-KJULJRWW.cjs.map} +1 -1
  133. package/dist/{chunk-JTOJMLMA.js → chunk-KPBWHCJ2.js} +2 -2
  134. package/dist/{chunk-JTOJMLMA.js.map → chunk-KPBWHCJ2.js.map} +1 -1
  135. package/dist/{chunk-FTPAMVPB.cjs → chunk-LVCOLESY.cjs} +2 -2
  136. package/dist/{chunk-FTPAMVPB.cjs.map → chunk-LVCOLESY.cjs.map} +1 -1
  137. package/dist/{chunk-QA5JXTX4.js → chunk-MESFO57T.js} +2 -2
  138. package/dist/{chunk-QA5JXTX4.js.map → chunk-MESFO57T.js.map} +1 -1
  139. package/dist/{chunk-P2V66OV3.cjs → chunk-PXY2YVT5.cjs} +2 -2
  140. package/dist/{chunk-P2V66OV3.cjs.map → chunk-PXY2YVT5.cjs.map} +1 -1
  141. package/dist/{chunk-XN7TZP35.js → chunk-QFJFQRIG.js} +2 -2
  142. package/dist/{chunk-XN7TZP35.js.map → chunk-QFJFQRIG.js.map} +1 -1
  143. package/dist/chunk-RI4OVMZ5.cjs +2 -0
  144. package/dist/{chunk-ET3FITCB.cjs.map → chunk-RI4OVMZ5.cjs.map} +1 -1
  145. package/dist/{chunk-SALN7IZP.js → chunk-RO2VXW7E.js} +2 -2
  146. package/dist/{chunk-SALN7IZP.js.map → chunk-RO2VXW7E.js.map} +1 -1
  147. package/dist/{chunk-BAH6YD44.cjs → chunk-SAQ6DVGT.cjs} +2 -2
  148. package/dist/{chunk-BAH6YD44.cjs.map → chunk-SAQ6DVGT.cjs.map} +1 -1
  149. package/dist/chunk-T3UASV2F.js +2 -0
  150. package/dist/{chunk-U7BJ3NHK.js.map → chunk-T3UASV2F.js.map} +1 -1
  151. package/dist/{chunk-ZWRW73XY.cjs → chunk-TKAISLRS.cjs} +2 -2
  152. package/dist/{chunk-ZWRW73XY.cjs.map → chunk-TKAISLRS.cjs.map} +1 -1
  153. package/dist/{chunk-EHKB6ZPX.js → chunk-TMZCPQ5S.js} +3 -3
  154. package/dist/{chunk-EHKB6ZPX.js.map → chunk-TMZCPQ5S.js.map} +1 -1
  155. package/dist/{chunk-G4Z5MO5Z.cjs → chunk-TRRPWYEF.cjs} +6 -6
  156. package/dist/{chunk-G4Z5MO5Z.cjs.map → chunk-TRRPWYEF.cjs.map} +1 -1
  157. package/dist/{chunk-I4XMX6UQ.js → chunk-V3BTA2FJ.js} +2 -2
  158. package/dist/{chunk-I4XMX6UQ.js.map → chunk-V3BTA2FJ.js.map} +1 -1
  159. package/dist/{chunk-B3XPQEJJ.cjs → chunk-VAKTF34U.cjs} +2 -2
  160. package/dist/{chunk-B3XPQEJJ.cjs.map → chunk-VAKTF34U.cjs.map} +1 -1
  161. package/dist/{chunk-VUICODT4.js → chunk-VRNWKIGB.js} +2 -2
  162. package/dist/{chunk-VUICODT4.js.map → chunk-VRNWKIGB.js.map} +1 -1
  163. package/dist/{chunk-JLEVRYCV.js → chunk-ZGR3AQC3.js} +2 -2
  164. package/dist/{chunk-JLEVRYCV.js.map → chunk-ZGR3AQC3.js.map} +1 -1
  165. package/dist/index.cjs +1 -1
  166. package/dist/index.js +1 -1
  167. package/dist/metafile-cjs.json +1 -1
  168. package/dist/metafile-esm.json +1 -1
  169. package/dist/v2/address-input/address-input.cjs +1 -1
  170. package/dist/v2/address-input/address-input.js +1 -1
  171. package/dist/v2/combobox/combobox.cjs +1 -1
  172. package/dist/v2/combobox/combobox.js +1 -1
  173. package/dist/v2/command/command.cjs +1 -1
  174. package/dist/v2/command/command.js +1 -1
  175. package/dist/v2/date-picker/date-picker-input.cjs +1 -1
  176. package/dist/v2/date-picker/date-picker-input.js +1 -1
  177. package/dist/v2/date-picker/date-picker.cjs +1 -1
  178. package/dist/v2/date-picker/date-picker.js +1 -1
  179. package/dist/v2/dialog/dialog.cjs +1 -1
  180. package/dist/v2/dialog/dialog.d.ts +1 -0
  181. package/dist/v2/dialog/dialog.js +1 -1
  182. package/dist/v2/image-preview/image-preview.cjs +1 -1
  183. package/dist/v2/image-preview/image-preview.js +1 -1
  184. package/dist/v2/index.cjs +1 -1
  185. package/dist/v2/index.d.ts +1 -0
  186. package/dist/v2/index.js +1 -1
  187. package/dist/v2/multiselect/components/MultiSelectCommandGroup.cjs +1 -1
  188. package/dist/v2/multiselect/components/MultiSelectCommandGroup.js +1 -1
  189. package/dist/v2/multiselect/components/MultiSelectDropdown.cjs +1 -1
  190. package/dist/v2/multiselect/components/MultiSelectDropdown.js +1 -1
  191. package/dist/v2/multiselect/components/MultiSelectInput.cjs +1 -1
  192. package/dist/v2/multiselect/components/MultiSelectInput.js +1 -1
  193. package/dist/v2/multiselect/multiselect.cjs +1 -1
  194. package/dist/v2/multiselect/multiselect.js +1 -1
  195. package/dist/v2/time-input/time-input.cjs +2 -0
  196. package/dist/v2/time-input/time-input.cjs.map +1 -0
  197. package/dist/v2/time-input/time-input.d.ts +21 -0
  198. package/dist/v2/time-input/time-input.js +2 -0
  199. package/dist/v2/time-input/time-input.js.map +1 -0
  200. package/dist/v2/time-input/time-input.stories.d.ts +7 -0
  201. package/dist/v2/time-select/time-select.cjs +1 -1
  202. package/dist/v2/time-select/time-select.js +1 -1
  203. package/package.json +2 -2
  204. package/dist/chunk-3OPY3U2E.js +0 -2
  205. package/dist/chunk-3OPY3U2E.js.map +0 -1
  206. package/dist/chunk-ET3FITCB.cjs +0 -2
  207. package/dist/chunk-FTYKFS5H.cjs +0 -2
  208. package/dist/chunk-FTYKFS5H.cjs.map +0 -1
  209. package/dist/chunk-U7BJ3NHK.js +0 -2
  210. package/dist/chunk-UDNQL2TT.js +0 -2
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkIINNHABI_cjs=require('./chunk-IINNHABI.cjs'),chunkQRO22BPZ_cjs=require('./chunk-QRO22BPZ.cjs'),chunkNALIS6SG_cjs=require('./chunk-NALIS6SG.cjs'),chunkIUJL5ICA_cjs=require('./chunk-IUJL5ICA.cjs'),chunkGFZQIFBY_cjs=require('./chunk-GFZQIFBY.cjs'),chunkULTFWLWO_cjs=require('./chunk-ULTFWLWO.cjs'),react=require('react'),vaul=require('vaul'),i=require('radix-ui/dialog'),internal=require('radix-ui/internal'),lu=require('react-icons/lu'),jsxRuntime=require('react/jsx-runtime');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var i__namespace=/*#__PURE__*/_interopNamespace(i);var l=react.createContext({isResponsive:true}),E=react.createContext({anchorFooter:true,keyboardOpen:false}),K=.9,V="transform 0.5s cubic-bezier(0.32, 0.72, 0, 1), bottom 0.2s ease-out, max-height 0.2s ease-out";function U({disableDrawerOnMobile:t=false,...o}){let{isMobile:a}=chunkULTFWLWO_cjs.b(),r=react.useMemo(()=>({isResponsive:!t}),[t]);return jsxRuntime.jsx(l.Provider,{value:r,children:a&&!t?jsxRuntime.jsx(vaul.Drawer.Root,{"data-slot":"drawer",direction:"bottom",repositionInputs:false,...o}):jsxRuntime.jsx(i__namespace.Root,{"data-slot":"dialog",...o})})}function Y({...t}){let{isMobile:o}=chunkULTFWLWO_cjs.b(),{isResponsive:a}=react.useContext(l);return o&&a?jsxRuntime.jsx(vaul.Drawer.Trigger,{"data-slot":"drawer-trigger",...t}):jsxRuntime.jsx(i__namespace.Trigger,{"data-slot":"dialog-trigger",...t})}function k({...t}){let{isMobile:o}=chunkULTFWLWO_cjs.b(),{isResponsive:a}=react.useContext(l);return o&&a?jsxRuntime.jsx(vaul.Drawer.Portal,{"data-slot":"drawer-portal",...t}):jsxRuntime.jsx(i__namespace.Portal,{"data-slot":"dialog-portal",...t})}function R({...t}){let{isMobile:o}=chunkULTFWLWO_cjs.b(),{isResponsive:a}=react.useContext(l);return o&&a?jsxRuntime.jsx(vaul.Drawer.Close,{"data-slot":"drawer-close",...t}):jsxRuntime.jsx(i__namespace.Close,{"data-slot":"dialog-close",...t})}var T=react.forwardRef(({className:t,...o},a)=>{let{isMobile:r}=chunkULTFWLWO_cjs.b(),{isResponsive:m}=react.useContext(l);return r&&m?jsxRuntime.jsx(vaul.Drawer.Overlay,{"data-slot":"drawer-overlay",className:chunkQRO22BPZ_cjs.a("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-modal-stacking-context fixed inset-0 bg-black/50",t),ref:a,...o}):jsxRuntime.jsx(i__namespace.Overlay,{"data-slot":"dialog-overlay",className:chunkQRO22BPZ_cjs.a("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-modal-stacking-context fixed inset-0 bg-black/50",t),ref:a,...o})}),Z=react.forwardRef(({className:t,children:o=null,overlayClassName:a,style:r,footerBehavior:m="anchor",...w},g)=>{let{isMobile:z}=chunkNALIS6SG_cjs.a(),{isResponsive:H}=react.useContext(l),f=z&&H,[v,I]=react.useState(null),B=internal.useComposedRefs(g,I);chunkIUJL5ICA_cjs.d(v,f);let s=chunkGFZQIFBY_cjs.b(f);react.useEffect(()=>{if(!f||!s.keyboardOpen||!v)return;let b=document.activeElement;if(b instanceof HTMLElement&&v.contains(b))return chunkIUJL5ICA_cjs.c(b,v)},[f,v,s.keyboardOpen,s.bottom,s.height]);let A=react.useMemo(()=>({anchorFooter:m==="anchor",keyboardOpen:s.keyboardOpen}),[m,s.keyboardOpen]);if(f){let b=s.keyboardOpen?{bottom:s.bottom,maxHeight:Math.round(s.height*K)}:void 0;return jsxRuntime.jsxs(k,{"data-slot":"drawer-portal",children:[jsxRuntime.jsx(T,{className:a}),jsxRuntime.jsx(vaul.Drawer.Content,{"data-slot":"drawer-content","data-keyboard-open":s.keyboardOpen?"":void 0,style:{transition:V,...b,...r},className:chunkQRO22BPZ_cjs.a("group/drawer-content bg-background z-modal-stacking-context fixed flex h-auto flex-col px-4","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[90dvh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[90dvh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-md","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm","max-w-dvw!",t),ref:B,...w,children:jsxRuntime.jsx(E.Provider,{value:A,children:o})})]})}return jsxRuntime.jsxs(k,{"data-slot":"dialog-portal",children:[jsxRuntime.jsx(T,{className:a}),jsxRuntime.jsx(i__namespace.Content,{"data-slot":"dialog-content",className:chunkQRO22BPZ_cjs.a("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-modal-stacking-context fixed top-[50%] left-[50%] grid w-[550px] max-w-[720px] min-w-[440px] translate-x-[-50%] translate-y-[-50%] rounded-lg border border-gray-300 p-6 shadow-sm duration-200",t),ref:g,style:r,...w,children:o})]})});function $({className:t,showCloseButton:o=true,...a}){let{isMobile:r}=chunkULTFWLWO_cjs.b(),{isResponsive:m}=react.useContext(l);return r&&m?jsxRuntime.jsxs("div",{"data-slot":"drawer-header",className:chunkQRO22BPZ_cjs.a("relative flex flex-col gap-0.5 pt-6 pb-4 text-left md:gap-1.5",t),...a,children:[o&&jsxRuntime.jsx(R,{asChild:true,children:jsxRuntime.jsxs(chunkIINNHABI_cjs.b,{className:"absolute top-5 right-0",size:"sm",variant:"ghost-icon",children:[jsxRuntime.jsx(lu.LuX,{}),jsxRuntime.jsx("span",{className:"sr-only",children:"Close dialog"})]})}),a.children]}):jsxRuntime.jsxs("div",{"data-slot":"dialog-header",className:chunkQRO22BPZ_cjs.a("relative flex flex-col gap-2 pb-4",t),...a,children:[o&&jsxRuntime.jsx(R,{asChild:true,children:jsxRuntime.jsxs(chunkIINNHABI_cjs.b,{className:"absolute top-0 right-0",size:"sm",variant:"ghost-icon",children:[jsxRuntime.jsx(lu.LuX,{}),jsxRuntime.jsx("span",{className:"sr-only",children:"Close dialog"})]})}),a.children]})}function j({className:t,...o}){let{isMobile:a}=chunkULTFWLWO_cjs.b(),{isResponsive:r}=react.useContext(l),{anchorFooter:m,keyboardOpen:w}=react.useContext(E);if(a&&r){let g=m&&w;return jsxRuntime.jsx("div",{"data-slot":"drawer-footer","data-behind-keyboard":g?"":void 0,className:chunkQRO22BPZ_cjs.a("mt-auto flex flex-col gap-2 py-4",g&&"bg-background absolute inset-x-0 top-full",t),...o})}return jsxRuntime.jsx("div",{"data-slot":"dialog-footer",className:chunkQRO22BPZ_cjs.a("mt-2 flex gap-2 pt-3",t),...o})}function tt({className:t,...o}){let{isMobile:a}=chunkNALIS6SG_cjs.a(),{isResponsive:r}=react.useContext(l);return a&&r?jsxRuntime.jsx(vaul.Drawer.Title,{"data-slot":"drawer-title",className:chunkQRO22BPZ_cjs.a("font-display pr-6 text-3xl",t),...o}):jsxRuntime.jsx(i__namespace.Title,{"data-slot":"dialog-title",className:chunkQRO22BPZ_cjs.a("font-display pr-6 text-3xl leading-none tracking-[0.01rem]",t),...o})}function et({className:t,...o}){let{isMobile:a}=chunkULTFWLWO_cjs.b(),{isResponsive:r}=react.useContext(l);return a&&r?jsxRuntime.jsx(vaul.Drawer.Description,{"data-slot":"drawer-description",className:t,...o}):jsxRuntime.jsx(i__namespace.Description,{"data-slot":"dialog-description",className:chunkQRO22BPZ_cjs.a("text-muted-foreground text-sm",t),...o})}exports.a=U;exports.b=Y;exports.c=k;exports.d=R;exports.e=T;exports.f=Z;exports.g=$;exports.h=j;exports.i=tt;exports.j=et;//# sourceMappingURL=chunk-54DZOSDP.cjs.map
2
+ //# sourceMappingURL=chunk-54DZOSDP.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/v2/dialog/dialog.tsx"],"names":["DialogContext","createContext","DrawerKeyboardContext","DRAWER_MAX_HEIGHT_RATIO","DRAWER_TRANSITION","Dialog","disableDrawerOnMobile","props","isMobile","useWindowSize_default","contextValue","useMemo","jsx","DrawerPrimitive","i","DialogTrigger","isResponsive","useContext","DialogPortal","DialogClose","DialogOverlay","forwardRef","className","ref","cn","DialogContent","children","overlayClassName","style","footerBehavior","useIsMobile","isDrawer","contentEl","setContentEl","useState","setContentRef","useComposedRefs","useKeyboardFocusGuard","inset","useVisualViewportInset","useEffect","active","revealWhenSettled","keyboardContextValue","keyboardStyle","jsxs","DialogHeader","showCloseButton","Button","LuX","DialogFooter","anchorFooter","keyboardOpen","isBehindKeyboard","DialogTitle","DialogDescription"],"mappings":"u1BAwBA,IAAMA,CAAAA,CAAgBC,mBAAAA,CAAc,CAAE,aAAc,IAAK,CAAC,EACpDC,CAAAA,CAAwBD,mBAAAA,CAAc,CAAE,YAAA,CAAc,IAAA,CAAM,YAAA,CAAc,KAAM,CAAC,CAAA,CAEjFE,EAA0B,EAAA,CAE1BC,CAAAA,CACJ,gGAEF,SAASC,CAAAA,CAAO,CACd,qBAAA,CAAAC,CAAAA,CAAwB,KAAA,CACxB,GAAGC,CACL,CAAA,CACqF,CACnF,GAAM,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CAAA,CACpF,GAAGf,CAAAA,CACN,CAEJ,CAEA,SAASgD,GAAkB,CACzB,SAAA,CAAAjC,EACA,GAAGf,CACL,CAAA,CACsD,CACpD,GAAM,CAAE,SAAAC,CAAS,CAAA,CAAIC,qBAAc,CAC7B,CAAE,aAAAO,CAAa,CAAA,CAAIC,gBAAAA,CAAWjB,CAAa,CAAA,CACjD,OAAIQ,GAAYQ,CAAAA,CAEZJ,cAAAA,CAACC,YAAgB,WAAA,CAAhB,CACC,YAAU,oBAAA,CACV,SAAA,CAAWS,CAAAA,CACV,GAAGf,CAAAA,CACN,CAAA,CAIFK,eAAiBE,YAAA,CAAA,WAAA,CAAhB,CACC,WAAA,CAAU,oBAAA,CACV,SAAA,CAAWU,mBAAAA,CAAG,gCAAiCF,CAAS,CAAA,CACvD,GAAGf,CAAAA,CACN,CAEJ","file":"chunk-54DZOSDP.cjs","sourcesContent":["import {\n type ComponentProps,\n createContext,\n forwardRef,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\nimport * as DialogPrimitive from 'radix-ui/dialog';\nimport { useComposedRefs } from 'radix-ui/internal';\nimport { LuX } from 'react-icons/lu';\n\nimport { cn } from '@/lib/utils';\nimport { Button } from '../button/button';\nimport {\n revealWhenSettled,\n useIsMobile,\n useKeyboardFocusGuard,\n useVisualViewportInset,\n useWindowSize,\n} from '@/hooks';\n\nconst DialogContext = createContext({ isResponsive: true });\nconst DrawerKeyboardContext = createContext({ anchorFooter: true, keyboardOpen: false });\n\nconst DRAWER_MAX_HEIGHT_RATIO = 0.9;\n\nconst DRAWER_TRANSITION =\n 'transform 0.5s cubic-bezier(0.32, 0.72, 0, 1), bottom 0.2s ease-out, max-height 0.2s ease-out';\n\nfunction Dialog({\n disableDrawerOnMobile = false,\n ...props\n}: ComponentProps<typeof DialogPrimitive.Root> &\n ComponentProps<typeof DrawerPrimitive.Root> & { disableDrawerOnMobile?: boolean }) {\n const { isMobile } = useWindowSize();\n\n const contextValue = useMemo(\n () => ({ isResponsive: !disableDrawerOnMobile }),\n [disableDrawerOnMobile],\n );\n\n return (\n <DialogContext.Provider value={contextValue}>\n {isMobile && !disableDrawerOnMobile ? (\n <DrawerPrimitive.Root\n data-slot=\"drawer\"\n direction=\"bottom\"\n repositionInputs={false}\n {...props}\n />\n ) : (\n <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n )}\n </DialogContext.Provider>\n );\n}\n\nfunction DialogTrigger({\n ...props\n}: ComponentProps<typeof DialogPrimitive.Trigger> &\n ComponentProps<typeof DrawerPrimitive.Trigger>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n }\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: ComponentProps<typeof DialogPrimitive.Portal> & ComponentProps<typeof DrawerPrimitive.Portal>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n }\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: ComponentProps<typeof DialogPrimitive.Close> & ComponentProps<typeof DrawerPrimitive.Close>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n }\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nconst DialogOverlay = forwardRef<\n HTMLDivElement,\n ComponentProps<typeof DialogPrimitive.Overlay> & ComponentProps<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-modal-stacking-context fixed inset-0 bg-black/50',\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n }\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-modal-stacking-context fixed inset-0 bg-black/50',\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n});\n\nconst DialogContent = forwardRef<\n HTMLDivElement,\n ComponentProps<typeof DialogPrimitive.Content> &\n ComponentProps<typeof DrawerPrimitive.Content> & {\n onBackButtonClick?: () => void;\n overlayClassName?: string | undefined;\n footerBehavior?: 'lift' | 'anchor';\n }\n>(\n (\n { className, children = null, overlayClassName, style, footerBehavior = 'anchor', ...props },\n ref,\n ) => {\n const { isMobile } = useIsMobile();\n const { isResponsive } = useContext(DialogContext);\n const isDrawer = isMobile && isResponsive;\n\n // Keyboard handling for the mobile drawer, in three parts:\n // 1. `useKeyboardFocusGuard` stops the browser panning the page when a field is focused, so\n // the only movement is the one we make.\n // 2. `useVisualViewportInset` tells us the keyboard height; we pin the drawer's bottom edge to\n // it and cap the height to 90% of what's visible.\n // 3. After each inset change we scroll the drawer's own scroll area so the focused field is\n // still in view.\n const [contentEl, setContentEl] = useState<HTMLDivElement | null>(null);\n const setContentRef = useComposedRefs(ref, setContentEl);\n useKeyboardFocusGuard(contentEl, isDrawer);\n const inset = useVisualViewportInset(isDrawer);\n\n useEffect(() => {\n if (!isDrawer || !inset.keyboardOpen || !contentEl) {\n return undefined;\n }\n const active = document.activeElement;\n if (active instanceof HTMLElement && contentEl.contains(active)) {\n // The new max-height is still transitioning at this point, so reveal again once it settles.\n return revealWhenSettled(active, contentEl);\n }\n return undefined;\n }, [isDrawer, contentEl, inset.keyboardOpen, inset.bottom, inset.height]);\n\n const keyboardContextValue = useMemo(\n () => ({ anchorFooter: footerBehavior === 'anchor', keyboardOpen: inset.keyboardOpen }),\n [footerBehavior, inset.keyboardOpen],\n );\n\n if (isDrawer) {\n const keyboardStyle = inset.keyboardOpen\n ? { bottom: inset.bottom, maxHeight: Math.round(inset.height * DRAWER_MAX_HEIGHT_RATIO) }\n : undefined;\n return (\n <DialogPortal data-slot=\"drawer-portal\">\n <DialogOverlay className={overlayClassName} />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n data-keyboard-open={inset.keyboardOpen ? '' : undefined}\n style={{ transition: DRAWER_TRANSITION, ...keyboardStyle, ...style }}\n className={cn(\n 'group/drawer-content bg-background z-modal-stacking-context fixed flex h-auto flex-col px-4',\n 'data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[90dvh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b',\n 'data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[90dvh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t',\n 'data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-md',\n 'data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm',\n 'max-w-dvw!',\n className,\n )}\n ref={setContentRef}\n {...props}\n >\n <DrawerKeyboardContext.Provider value={keyboardContextValue}>\n {children}\n </DrawerKeyboardContext.Provider>\n </DrawerPrimitive.Content>\n </DialogPortal>\n );\n }\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay className={overlayClassName} />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-modal-stacking-context fixed top-[50%] left-[50%] grid w-[550px] max-w-[720px] min-w-[440px] translate-x-[-50%] translate-y-[-50%] rounded-lg border border-gray-300 p-6 shadow-sm duration-200',\n className,\n )}\n ref={ref}\n style={style}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n },\n);\n\nfunction DialogHeader({\n className,\n showCloseButton = true,\n ...props\n}: ComponentProps<'div'> & {\n showCloseButton?: boolean;\n}) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn('relative flex flex-col gap-0.5 pt-6 pb-4 text-left md:gap-1.5', className)}\n {...props}\n >\n {showCloseButton && (\n <DialogClose asChild>\n <Button className=\"absolute top-5 right-0\" size=\"sm\" variant=\"ghost-icon\">\n <LuX />\n <span className=\"sr-only\">Close dialog</span>\n </Button>\n </DialogClose>\n )}\n {props.children}\n </div>\n );\n }\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('relative flex flex-col gap-2 pb-4', className)}\n {...props}\n >\n {showCloseButton && (\n <DialogClose asChild>\n <Button className=\"absolute top-0 right-0\" size=\"sm\" variant=\"ghost-icon\">\n <LuX />\n <span className=\"sr-only\">Close dialog</span>\n </Button>\n </DialogClose>\n )}\n {props.children}\n </div>\n );\n}\n\nfunction DialogFooter({ className, ...props }: ComponentProps<'div'>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n const { anchorFooter, keyboardOpen } = useContext(DrawerKeyboardContext);\n if (isMobile && isResponsive) {\n // hide header context to make more visual room when the keyboard is open\n const isBehindKeyboard = anchorFooter && keyboardOpen;\n return (\n <div\n data-slot=\"drawer-footer\"\n data-behind-keyboard={isBehindKeyboard ? '' : undefined}\n className={cn(\n 'mt-auto flex flex-col gap-2 py-4',\n isBehindKeyboard && 'bg-background absolute inset-x-0 top-full',\n className,\n )}\n {...props}\n />\n );\n }\n return (\n <div data-slot=\"dialog-footer\" className={cn('mt-2 flex gap-2 pt-3', className)} {...props} />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: ComponentProps<typeof DialogPrimitive.Title> & ComponentProps<typeof DrawerPrimitive.Title>) {\n const { isMobile } = useIsMobile();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn('font-display pr-6 text-3xl', className)}\n {...props}\n />\n );\n }\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('font-display pr-6 text-3xl leading-none tracking-[0.01rem]', className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: ComponentProps<typeof DialogPrimitive.Description> &\n ComponentProps<typeof DrawerPrimitive.Description>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={className}\n {...props}\n />\n );\n }\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkODAOIGPB_cjs=require('./chunk-ODAOIGPB.cjs'),chunk66OYFOJG_cjs=require('./chunk-66OYFOJG.cjs'),chunkQRO22BPZ_cjs=require('./chunk-QRO22BPZ.cjs'),lu=require('react-icons/lu'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var J=({classNames:r=void 0,disabled:_=false,options:l,preSearchOptions:z=void 0,onSearchChange:F=void 0,onChange:L=void 0,onOpenChange:g=void 0,placeholder:O="Select an option",searchLabel:T="Search...",notFoundMessage:E="Not found.",value:n=void 0,size:I="default",error:m=false,shouldFilter:D=true,pinnedOption:a=void 0})=>{let[d,u]=react.useState(false),[G,p]=react.useState(false),R=G?l:z||l,[H,s]=react.useState(""),K=()=>{u(!d),p(false),s(""),g?.(!d);},b=e=>{L?.(e===n?"":e),u(false),p(false),s(""),g?.(false);},M=a&&a.value===n?a:l.find(e=>e.value===n);return jsxRuntime.jsxs(chunkODAOIGPB_cjs.a,{open:d,onOpenChange:K,children:[jsxRuntime.jsxs(chunkODAOIGPB_cjs.b,{"aria-invalid":m,"data-placeholder":n?void 0:"",disabled:_,className:chunkQRO22BPZ_cjs.a("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:border-dark-green inline-flex h-12 w-full shrink-0 cursor-pointer items-center justify-between gap-2 rounded-md border px-4 whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:bg-gray-200 disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-5",I==="sm"&&"py-xs h-8 px-3 [&_svg:not([class*='size-'])]:size-4",r?.trigger),children:[jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[!n&&jsxRuntime.jsx(lu.LuSearch,{className:chunkQRO22BPZ_cjs.a(m&&"text-red")}),jsxRuntime.jsx("span",{className:chunkQRO22BPZ_cjs.a("block min-w-0 truncate",!n&&"text-gray-700"),children:n?M?.label:O})]}),jsxRuntime.jsx(lu.LuChevronsUpDown,{className:"opacity-50"})]}),jsxRuntime.jsx(chunkODAOIGPB_cjs.c,{align:"start",className:chunkQRO22BPZ_cjs.a("w-[var(--radix-popover-trigger-width)] p-0",r?.content),children:jsxRuntime.jsxs(chunk66OYFOJG_cjs.a,{shouldFilter:D,value:H,onValueChange:s,children:[jsxRuntime.jsx(chunk66OYFOJG_cjs.c,{placeholder:T,className:chunkQRO22BPZ_cjs.a("h-9",r?.input),onValueChange:e=>{p(!!e),F?.(e);}}),jsxRuntime.jsxs(chunk66OYFOJG_cjs.d,{onWheel:e=>e.stopPropagation(),children:[jsxRuntime.jsx(chunk66OYFOJG_cjs.e,{children:E}),jsxRuntime.jsx(chunk66OYFOJG_cjs.f,{children:R.map(e=>jsxRuntime.jsxs(chunk66OYFOJG_cjs.h,{value:e.value,keywords:[typeof e.label=="string"?e.label:"",e.additionalSearchText??""],onSelect:b,className:r?.item,disabled:e.disabled,children:[e.label,jsxRuntime.jsx(lu.LuCheck,{className:chunkQRO22BPZ_cjs.a("ml-auto",n===e.value?"opacity-100":"opacity-0")})]},e.value))})]}),a&&jsxRuntime.jsx(chunk66OYFOJG_cjs.j,{className:"border-t-0",children:jsxRuntime.jsxs("button",{type:"button",disabled:a.disabled,onClick:()=>b(a.value),onPointerEnter:()=>s(""),onFocus:()=>s(""),onKeyDown:e=>{e.key==="Enter"&&e.stopPropagation();},className:chunkQRO22BPZ_cjs.a("text-dark-green hover:bg-accent focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex w-full cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-left italic outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",r?.pinnedOption),children:[a.label,jsxRuntime.jsx(lu.LuCheck,{className:chunkQRO22BPZ_cjs.a("ml-auto",n===a.value?"opacity-100":"opacity-0")})]})})]})})]})};exports.a=J;//# sourceMappingURL=chunk-DOXWPQB7.cjs.map
2
- //# sourceMappingURL=chunk-DOXWPQB7.cjs.map
1
+ 'use strict';var chunkODAOIGPB_cjs=require('./chunk-ODAOIGPB.cjs'),chunk4CHRDQR7_cjs=require('./chunk-4CHRDQR7.cjs'),chunkQRO22BPZ_cjs=require('./chunk-QRO22BPZ.cjs'),lu=require('react-icons/lu'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var J=({classNames:r=void 0,disabled:_=false,options:l,preSearchOptions:z=void 0,onSearchChange:F=void 0,onChange:L=void 0,onOpenChange:g=void 0,placeholder:O="Select an option",searchLabel:T="Search...",notFoundMessage:E="Not found.",value:n=void 0,size:I="default",error:m=false,shouldFilter:D=true,pinnedOption:a=void 0})=>{let[d,u]=react.useState(false),[G,p]=react.useState(false),R=G?l:z||l,[H,s]=react.useState(""),K=()=>{u(!d),p(false),s(""),g?.(!d);},b=e=>{L?.(e===n?"":e),u(false),p(false),s(""),g?.(false);},M=a&&a.value===n?a:l.find(e=>e.value===n);return jsxRuntime.jsxs(chunkODAOIGPB_cjs.a,{open:d,onOpenChange:K,children:[jsxRuntime.jsxs(chunkODAOIGPB_cjs.b,{"aria-invalid":m,"data-placeholder":n?void 0:"",disabled:_,className:chunkQRO22BPZ_cjs.a("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:border-dark-green inline-flex h-12 w-full shrink-0 cursor-pointer items-center justify-between gap-2 rounded-md border px-4 whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:bg-gray-200 disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-5",I==="sm"&&"py-xs h-8 px-3 [&_svg:not([class*='size-'])]:size-4",r?.trigger),children:[jsxRuntime.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[!n&&jsxRuntime.jsx(lu.LuSearch,{className:chunkQRO22BPZ_cjs.a(m&&"text-red")}),jsxRuntime.jsx("span",{className:chunkQRO22BPZ_cjs.a("block min-w-0 truncate",!n&&"text-gray-700"),children:n?M?.label:O})]}),jsxRuntime.jsx(lu.LuChevronsUpDown,{className:"opacity-50"})]}),jsxRuntime.jsx(chunkODAOIGPB_cjs.c,{align:"start",className:chunkQRO22BPZ_cjs.a("w-[var(--radix-popover-trigger-width)] p-0",r?.content),children:jsxRuntime.jsxs(chunk4CHRDQR7_cjs.a,{shouldFilter:D,value:H,onValueChange:s,children:[jsxRuntime.jsx(chunk4CHRDQR7_cjs.c,{placeholder:T,className:chunkQRO22BPZ_cjs.a("h-9",r?.input),onValueChange:e=>{p(!!e),F?.(e);}}),jsxRuntime.jsxs(chunk4CHRDQR7_cjs.d,{onWheel:e=>e.stopPropagation(),children:[jsxRuntime.jsx(chunk4CHRDQR7_cjs.e,{children:E}),jsxRuntime.jsx(chunk4CHRDQR7_cjs.f,{children:R.map(e=>jsxRuntime.jsxs(chunk4CHRDQR7_cjs.h,{value:e.value,keywords:[typeof e.label=="string"?e.label:"",e.additionalSearchText??""],onSelect:b,className:r?.item,disabled:e.disabled,children:[e.label,jsxRuntime.jsx(lu.LuCheck,{className:chunkQRO22BPZ_cjs.a("ml-auto",n===e.value?"opacity-100":"opacity-0")})]},e.value))})]}),a&&jsxRuntime.jsx(chunk4CHRDQR7_cjs.j,{className:"border-t-0",children:jsxRuntime.jsxs("button",{type:"button",disabled:a.disabled,onClick:()=>b(a.value),onPointerEnter:()=>s(""),onFocus:()=>s(""),onKeyDown:e=>{e.key==="Enter"&&e.stopPropagation();},className:chunkQRO22BPZ_cjs.a("text-dark-green hover:bg-accent focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex w-full cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-left italic outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",r?.pinnedOption),children:[a.label,jsxRuntime.jsx(lu.LuCheck,{className:chunkQRO22BPZ_cjs.a("ml-auto",n===a.value?"opacity-100":"opacity-0")})]})})]})})]})};exports.a=J;//# sourceMappingURL=chunk-6C5ROFWH.cjs.map
2
+ //# sourceMappingURL=chunk-6C5ROFWH.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/v2/combobox/combobox.tsx"],"names":["Combobox","classNames","disabled","options","preSearchOptions","onSearchChange","onChange","onOpenChange","placeholder","searchLabel","notFoundMessage","value","size","error","shouldFilter","pinnedOption","open","setOpen","useState","isSearching","setIsSearching","optionsToDisplay","highlighted","setHighlighted","handleOpenChange","handleSelect","selectedValue","selectedOption","item","jsxs","Popover","PopoverTrigger","cn","jsx","LuSearch","LuChevronsUpDown","PopoverContent","Command","CommandInput","val","CommandList","CommandEmpty","CommandGroup","CommandItem","LuCheck","CommandFooter"],"mappings":"mQAiDO,IAAMA,CAAAA,CAAW,CAAC,CACvB,UAAA,CAAAC,CAAAA,CAAa,OACb,QAAA,CAAAC,CAAAA,CAAW,MACX,OAAA,CAAAC,CAAAA,CACA,iBAAAC,CAAAA,CAAmB,MAAA,CACnB,eAAAC,CAAAA,CAAiB,MAAA,CACjB,SAAAC,CAAAA,CAAW,MAAA,CACX,aAAAC,CAAAA,CAAe,MAAA,CACf,YAAAC,CAAAA,CAAc,kBAAA,CACd,WAAA,CAAAC,CAAAA,CAAc,WAAA,CACd,eAAA,CAAAC,EAAkB,YAAA,CAClB,KAAA,CAAAC,EAAQ,MAAA,CACR,IAAA,CAAAC,EAAO,SAAA,CACP,KAAA,CAAAC,EAAQ,KAAA,CACR,YAAA,CAAAC,EAAe,IAAA,CACf,YAAA,CAAAC,EAAe,MACjB,CAAA,GAAqB,CACnB,GAAM,CAACC,CAAAA,CAAMC,CAAO,CAAA,CAAIC,cAAAA,CAAS,KAAK,CAAA,CAIhC,CAACC,EAAaC,CAAc,CAAA,CAAIF,eAAS,KAAK,CAAA,CAC9CG,EAAmBF,CAAAA,CAAchB,CAAAA,CAAUC,GAAoBD,CAAAA,CAG/D,CAACmB,EAAaC,CAAc,CAAA,CAAIL,eAAS,EAAE,CAAA,CAE3CM,CAA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,CAAgB,WAAW,EAC7E,CAAA,CAAA,CAAA,CAbKA,CAAAA,CAAK,KAcZ,CACD,CAAA,CACH,GACF,CAAA,CACCb,CAAAA,EAGCkB,eAACY,mBAAAA,CAAA,CAAc,UAAU,YAAA,CACvB,QAAA,CAAAhB,gBAAC,QAAA,CAAA,CACC,IAAA,CAAK,SACL,QAAA,CAAUd,CAAAA,CAAa,QAAA,CACvB,OAAA,CAAS,IAAMU,CAAAA,CAAaV,EAAa,KAAK,CAAA,CAE9C,eAAgB,IAAMQ,CAAAA,CAAe,EAAE,CAAA,CACvC,OAAA,CAAS,IAAMA,CAAAA,CAAe,EAAE,EAChC,SAAA,CAAY,CAAA,EAAM,CAGZ,CAAA,CAAE,GAAA,GAAQ,SAAS,CAAA,CAAE,eAAA,GAC3B,CAAA,CACA,SAAA,CAAWS,mBAAAA,CACT,8TACA/B,CAAAA,EAAY,YACd,EAEC,QAAA,CAAA,CAAAc,CAAAA,CAAa,MACdkB,cAAAA,CAACW,UAAAA,CAAA,CACC,SAAA,CAAWZ,mBAAAA,CACT,SAAA,CACArB,IAAUI,CAAAA,CAAa,KAAA,CAAQ,cAAgB,WACjD,CAAA,CACF,GACF,CAAA,CACF,CAAA,CAAA,CAEJ,CAAA,CACF,CAAA,CAAA,CACF,CAEJ","file":"chunk-DOXWPQB7.cjs","sourcesContent":["import { LuCheck, LuChevronsUpDown, LuSearch } from 'react-icons/lu';\nimport { useState } from 'react';\nimport { Popover, PopoverContent, PopoverTrigger } from '@/v2/popover/popover';\nimport { cn } from '@/lib/utils';\nimport {\n Command,\n CommandEmpty,\n CommandFooter,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '@/v2/command/command';\n\nexport type ComboboxOption = {\n label: string | React.ReactNode;\n value: string;\n additionalSearchText?: string;\n disabled?: boolean;\n};\n\nexport type ComboboxProps = {\n classNames?: {\n content?: string;\n input?: string;\n item?: string;\n pinnedOption?: string;\n trigger?: string;\n };\n disabled?: boolean;\n options: ComboboxOption[];\n preSearchOptions?: ComboboxOption[];\n onSearchChange?: (value: string) => void;\n onChange?: (value: string) => void;\n onOpenChange?: (open: boolean) => void;\n placeholder?: string;\n searchLabel?: string;\n notFoundMessage?: string;\n value?: string;\n size?: 'default' | 'sm';\n error?: boolean;\n shouldFilter?: boolean;\n /**\n * An option pinned below the scrollable list, always visible and never filtered.\n * Selecting it calls `onChange` like any other option.\n */\n pinnedOption?: ComboboxOption;\n};\n\nexport const Combobox = ({\n classNames = undefined,\n disabled = false,\n options,\n preSearchOptions = undefined,\n onSearchChange = undefined,\n onChange = undefined,\n onOpenChange = undefined,\n placeholder = 'Select an option',\n searchLabel = 'Search...',\n notFoundMessage = 'Not found.',\n value = undefined,\n size = 'default',\n error = false,\n shouldFilter = true,\n pinnedOption = undefined,\n}: ComboboxProps) => {\n const [open, setOpen] = useState(false);\n\n // Allow filtering down to just a subset of options before searching\n // NOTE: preSearchOptions is optional, while options is a required prop that we can fallback to\n const [isSearching, setIsSearching] = useState(false);\n const optionsToDisplay = isSearching ? options : preSearchOptions || options;\n\n // cmdk's highlighted item, controlled so hovering the pinned option can clear it\n const [highlighted, setHighlighted] = useState('');\n\n const handleOpenChange = () => {\n setOpen(!open);\n setIsSearching(false);\n setHighlighted('');\n onOpenChange?.(!open);\n };\n\n // Shared by the list items and the pinned option so they can't drift apart\n const handleSelect = (selectedValue: string) => {\n onChange?.(selectedValue === value ? '' : selectedValue);\n setOpen(false);\n setIsSearching(false);\n setHighlighted('');\n onOpenChange?.(false);\n };\n\n const selectedOption =\n pinnedOption && pinnedOption.value === value\n ? pinnedOption\n : options.find((item) => item.value === value);\n\n return (\n <Popover open={open} onOpenChange={handleOpenChange}>\n <PopoverTrigger\n aria-invalid={error}\n data-placeholder={!value ? '' : undefined}\n disabled={disabled}\n className={cn(\n \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:border-dark-green inline-flex h-12 w-full shrink-0 cursor-pointer items-center justify-between gap-2 rounded-md border px-4 whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:bg-gray-200 disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-5\",\n size === 'sm' && \"py-xs h-8 px-3 [&_svg:not([class*='size-'])]:size-4\",\n classNames?.trigger,\n )}\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-2\">\n {!value && <LuSearch className={cn(error && 'text-red')} />}\n <span className={cn('block min-w-0 truncate', !value && 'text-gray-700')}>\n {value ? selectedOption?.label : placeholder}\n </span>\n </div>\n <LuChevronsUpDown className=\"opacity-50\" />\n </PopoverTrigger>\n <PopoverContent\n align=\"start\"\n className={cn('w-[var(--radix-popover-trigger-width)] p-0', classNames?.content)}\n >\n <Command\n shouldFilter={\n // This should be mainly be driven by the presence of the `onSearchChange` function\n // to match multiselect's behavior, however we omit this for backwards compatibility.\n shouldFilter\n }\n value={highlighted}\n onValueChange={setHighlighted}\n >\n <CommandInput\n placeholder={searchLabel}\n className={cn('h-9', classNames?.input)}\n onValueChange={(val) => {\n setIsSearching(!!val);\n onSearchChange?.(val);\n }}\n />\n <CommandList onWheel={(e) => e.stopPropagation()}>\n <CommandEmpty>{notFoundMessage}</CommandEmpty>\n <CommandGroup>\n {optionsToDisplay.map((item) => (\n <CommandItem\n key={item.value}\n value={item.value}\n keywords={[\n typeof item.label === 'string' ? item.label : '',\n item.additionalSearchText ?? '',\n ]}\n onSelect={handleSelect}\n className={classNames?.item}\n disabled={item.disabled}\n >\n {item.label}\n <LuCheck\n className={cn('ml-auto', value === item.value ? 'opacity-100' : 'opacity-0')}\n />\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n {pinnedOption && (\n // A plain button, not a CommandItem, so cmdk never filters it out. The trade-off is\n // that arrow keys don't reach it; it's reachable with Tab from the search input instead.\n <CommandFooter className=\"border-t-0\">\n <button\n type=\"button\"\n disabled={pinnedOption.disabled}\n onClick={() => handleSelect(pinnedOption.value)}\n // cmdk keeps the last hovered item highlighted; clear it so only one row looks active\n onPointerEnter={() => setHighlighted('')}\n onFocus={() => setHighlighted('')}\n onKeyDown={(e) => {\n // cmdk's root handles Enter by preventing the default and selecting the\n // highlighted option, which would swallow this button's own activation\n if (e.key === 'Enter') e.stopPropagation();\n }}\n className={cn(\n \"text-dark-green hover:bg-accent focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex w-full cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-left italic outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0\",\n classNames?.pinnedOption,\n )}\n >\n {pinnedOption.label}\n <LuCheck\n className={cn(\n 'ml-auto',\n value === pinnedOption.value ? 'opacity-100' : 'opacity-0',\n )}\n />\n </button>\n </CommandFooter>\n )}\n </Command>\n </PopoverContent>\n </Popover>\n );\n};\n"]}
1
+ {"version":3,"sources":["../src/v2/combobox/combobox.tsx"],"names":["Combobox","classNames","disabled","options","preSearchOptions","onSearchChange","onChange","onOpenChange","placeholder","searchLabel","notFoundMessage","value","size","error","shouldFilter","pinnedOption","open","setOpen","useState","isSearching","setIsSearching","optionsToDisplay","highlighted","setHighlighted","handleOpenChange","handleSelect","selectedValue","selectedOption","item","jsxs","Popover","PopoverTrigger","cn","jsx","LuSearch","LuChevronsUpDown","PopoverContent","Command","CommandInput","val","CommandList","CommandEmpty","CommandGroup","CommandItem","LuCheck","CommandFooter"],"mappings":"mQAiDO,IAAMA,CAAAA,CAAW,CAAC,CACvB,UAAA,CAAAC,CAAAA,CAAa,OACb,QAAA,CAAAC,CAAAA,CAAW,MACX,OAAA,CAAAC,CAAAA,CACA,iBAAAC,CAAAA,CAAmB,MAAA,CACnB,eAAAC,CAAAA,CAAiB,MAAA,CACjB,SAAAC,CAAAA,CAAW,MAAA,CACX,aAAAC,CAAAA,CAAe,MAAA,CACf,YAAAC,CAA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,WACjD,CAAA,CACF,GACF,CAAA,CACF,CAAA,CAAA,CAEJ,CAAA,CACF,CAAA,CAAA,CACF,CAEJ","file":"chunk-6C5ROFWH.cjs","sourcesContent":["import { LuCheck, LuChevronsUpDown, LuSearch } from 'react-icons/lu';\nimport { useState } from 'react';\nimport { Popover, PopoverContent, PopoverTrigger } from '@/v2/popover/popover';\nimport { cn } from '@/lib/utils';\nimport {\n Command,\n CommandEmpty,\n CommandFooter,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from '@/v2/command/command';\n\nexport type ComboboxOption = {\n label: string | React.ReactNode;\n value: string;\n additionalSearchText?: string;\n disabled?: boolean;\n};\n\nexport type ComboboxProps = {\n classNames?: {\n content?: string;\n input?: string;\n item?: string;\n pinnedOption?: string;\n trigger?: string;\n };\n disabled?: boolean;\n options: ComboboxOption[];\n preSearchOptions?: ComboboxOption[];\n onSearchChange?: (value: string) => void;\n onChange?: (value: string) => void;\n onOpenChange?: (open: boolean) => void;\n placeholder?: string;\n searchLabel?: string;\n notFoundMessage?: string;\n value?: string;\n size?: 'default' | 'sm';\n error?: boolean;\n shouldFilter?: boolean;\n /**\n * An option pinned below the scrollable list, always visible and never filtered.\n * Selecting it calls `onChange` like any other option.\n */\n pinnedOption?: ComboboxOption;\n};\n\nexport const Combobox = ({\n classNames = undefined,\n disabled = false,\n options,\n preSearchOptions = undefined,\n onSearchChange = undefined,\n onChange = undefined,\n onOpenChange = undefined,\n placeholder = 'Select an option',\n searchLabel = 'Search...',\n notFoundMessage = 'Not found.',\n value = undefined,\n size = 'default',\n error = false,\n shouldFilter = true,\n pinnedOption = undefined,\n}: ComboboxProps) => {\n const [open, setOpen] = useState(false);\n\n // Allow filtering down to just a subset of options before searching\n // NOTE: preSearchOptions is optional, while options is a required prop that we can fallback to\n const [isSearching, setIsSearching] = useState(false);\n const optionsToDisplay = isSearching ? options : preSearchOptions || options;\n\n // cmdk's highlighted item, controlled so hovering the pinned option can clear it\n const [highlighted, setHighlighted] = useState('');\n\n const handleOpenChange = () => {\n setOpen(!open);\n setIsSearching(false);\n setHighlighted('');\n onOpenChange?.(!open);\n };\n\n // Shared by the list items and the pinned option so they can't drift apart\n const handleSelect = (selectedValue: string) => {\n onChange?.(selectedValue === value ? '' : selectedValue);\n setOpen(false);\n setIsSearching(false);\n setHighlighted('');\n onOpenChange?.(false);\n };\n\n const selectedOption =\n pinnedOption && pinnedOption.value === value\n ? pinnedOption\n : options.find((item) => item.value === value);\n\n return (\n <Popover open={open} onOpenChange={handleOpenChange}>\n <PopoverTrigger\n aria-invalid={error}\n data-placeholder={!value ? '' : undefined}\n disabled={disabled}\n className={cn(\n \"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:border-dark-green inline-flex h-12 w-full shrink-0 cursor-pointer items-center justify-between gap-2 rounded-md border px-4 whitespace-nowrap transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:bg-gray-200 disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-5\",\n size === 'sm' && \"py-xs h-8 px-3 [&_svg:not([class*='size-'])]:size-4\",\n classNames?.trigger,\n )}\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-2\">\n {!value && <LuSearch className={cn(error && 'text-red')} />}\n <span className={cn('block min-w-0 truncate', !value && 'text-gray-700')}>\n {value ? selectedOption?.label : placeholder}\n </span>\n </div>\n <LuChevronsUpDown className=\"opacity-50\" />\n </PopoverTrigger>\n <PopoverContent\n align=\"start\"\n className={cn('w-[var(--radix-popover-trigger-width)] p-0', classNames?.content)}\n >\n <Command\n shouldFilter={\n // This should be mainly be driven by the presence of the `onSearchChange` function\n // to match multiselect's behavior, however we omit this for backwards compatibility.\n shouldFilter\n }\n value={highlighted}\n onValueChange={setHighlighted}\n >\n <CommandInput\n placeholder={searchLabel}\n className={cn('h-9', classNames?.input)}\n onValueChange={(val) => {\n setIsSearching(!!val);\n onSearchChange?.(val);\n }}\n />\n <CommandList onWheel={(e) => e.stopPropagation()}>\n <CommandEmpty>{notFoundMessage}</CommandEmpty>\n <CommandGroup>\n {optionsToDisplay.map((item) => (\n <CommandItem\n key={item.value}\n value={item.value}\n keywords={[\n typeof item.label === 'string' ? item.label : '',\n item.additionalSearchText ?? '',\n ]}\n onSelect={handleSelect}\n className={classNames?.item}\n disabled={item.disabled}\n >\n {item.label}\n <LuCheck\n className={cn('ml-auto', value === item.value ? 'opacity-100' : 'opacity-0')}\n />\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n {pinnedOption && (\n // A plain button, not a CommandItem, so cmdk never filters it out. The trade-off is\n // that arrow keys don't reach it; it's reachable with Tab from the search input instead.\n <CommandFooter className=\"border-t-0\">\n <button\n type=\"button\"\n disabled={pinnedOption.disabled}\n onClick={() => handleSelect(pinnedOption.value)}\n // cmdk keeps the last hovered item highlighted; clear it so only one row looks active\n onPointerEnter={() => setHighlighted('')}\n onFocus={() => setHighlighted('')}\n onKeyDown={(e) => {\n // cmdk's root handles Enter by preventing the default and selecting the\n // highlighted option, which would swallow this button's own activation\n if (e.key === 'Enter') e.stopPropagation();\n }}\n className={cn(\n \"text-dark-green hover:bg-accent focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex w-full cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-left italic outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0\",\n classNames?.pinnedOption,\n )}\n >\n {pinnedOption.label}\n <LuCheck\n className={cn(\n 'ml-auto',\n value === pinnedOption.value ? 'opacity-100' : 'opacity-0',\n )}\n />\n </button>\n </CommandFooter>\n )}\n </Command>\n </PopoverContent>\n </Popover>\n );\n};\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunk2DLCWPKO_cjs=require('./chunk-2DLCWPKO.cjs'),chunkODAOIGPB_cjs=require('./chunk-ODAOIGPB.cjs'),chunkQRO22BPZ_cjs=require('./chunk-QRO22BPZ.cjs'),react=require('react'),O=require('dayjs'),_=require('dayjs/plugin/customParseFormat'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var O__default=/*#__PURE__*/_interopDefault(O);var ___default=/*#__PURE__*/_interopDefault(_);O__default.default.extend(___default.default);var H=15,$="h:mm A",F=/^(\d{1,2})(?::?(\d{2}))?\s*(?:([ap])\.?m?\.?)?$/,f=(o,r)=>`${String(o).padStart(2,"0")}:${String(r).padStart(2,"0")}`,I=o=>O__default.default(o,"HH:mm").format($),B=(o,r)=>{let e=F.exec(o.trim().toLowerCase());if(!e)return null;let n=Number(e[1]),i=Number(e[2]??0),s=e[3];if(i>59)return null;if(s)return n<1||n>12?null:f(n%12+(s==="p"?12:0),i);if(n>23)return null;if(n===0||n>=12)return f(n,i);let u=!!r&&O__default.default(r,"HH:mm").hour()>=12;return f(n%12+(u?12:0),i)},c=Array.from({length:1440/H+1},(o,r)=>{let e=r*H;return f(Math.floor(e/60),e%60)}),V=o=>c.findLast(r=>r<=o)??c[0],G=({id:o,placeholder:r,value:e,onChange:n})=>{let[i,s]=react.useState(false),[u,m]=react.useState(null),[l,g]=react.useState(),h=react.useId(),v=react.useRef(null),x=react.useRef(null),T=l??(e?V(e):void 0),w=t=>`${h}-${t}`;react.useEffect(()=>{i&&x.current?.scrollIntoView?.({block:"center"});},[i]),react.useEffect(()=>{l&&x.current?.scrollIntoView?.({block:"nearest"});},[l]);let b=()=>{m(null),g(void 0),s(false);},y=t=>{t!==e&&n(t),b();},A=()=>{if(l)return y(l);let t=u===null?null:B(u,e);t&&t!==e&&n(t),b();},R=t=>{let p=T?c.indexOf(T):-1,d=c[Math.min(Math.max(p+t,0),c.length-1)];s(true),g(d),m(I(d));};return jsxRuntime.jsxs(chunkODAOIGPB_cjs.a,{open:i,children:[jsxRuntime.jsx(chunkODAOIGPB_cjs.d,{children:jsxRuntime.jsx("div",{ref:v,children:jsxRuntime.jsx(chunk2DLCWPKO_cjs.b,{id:o,type:"text",autoComplete:"off",role:"combobox","aria-expanded":i,"aria-controls":h,"aria-autocomplete":"list","aria-activedescendant":i&&l?w(l):void 0,placeholder:r,value:u??(e?I(e):""),onFocus:t=>{t.target.select(),s(true);},onClick:()=>s(true),onChange:t=>{m(t.target.value),g(void 0);},onBlur:A,onKeyDown:t=>{(t.key==="ArrowDown"||t.key==="ArrowUp")&&(t.preventDefault(),R(t.key==="ArrowDown"?1:-1)),t.key==="Enter"&&(t.preventDefault(),A()),t.key==="Escape"&&b();}})})}),jsxRuntime.jsx(chunkODAOIGPB_cjs.c,{className:"max-h-90 w-(--radix-popover-trigger-width) overflow-y-auto p-1",align:"start",onOpenAutoFocus:t=>t.preventDefault(),onWheel:t=>t.stopPropagation(),onTouchMove:t=>t.stopPropagation(),onInteractOutside:t=>{v.current?.contains(t.target)?t.preventDefault():s(false);},children:jsxRuntime.jsx("div",{id:h,role:"listbox",className:"flex flex-col",children:c.map(t=>{let p=t===T;return jsxRuntime.jsx("button",{ref:p?x:void 0,id:w(t),type:"button",role:"option","aria-selected":t===e,tabIndex:-1,className:chunkQRO22BPZ_cjs.a("text-body-md h-10 shrink-0 rounded-sm px-3 text-left hover:bg-green-100",p&&"bg-green-100"),onPointerDown:d=>d.preventDefault(),onClick:()=>y(t),children:I(t)},t)})})})]})};exports.a=I;exports.b=B;exports.c=G;//# sourceMappingURL=chunk-6T7SNM2F.cjs.map
2
+ //# sourceMappingURL=chunk-6T7SNM2F.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/v2/time-input/time-input.tsx"],"names":["dayjs","customParseFormat","OPTION_INTERVAL_MINUTES","DISPLAY_FORMAT","TYPED_TIME_PATTERN","toRaw","hour","minute","formatTime","raw","parseTypedTime","text","current","match","meridiem","isCurrentPm","OPTIONS","_","index","minutes","nearestOptionAtOrBefore","value","option","TimeInput","id","placeholder","onChange","open","setOpen","useState","draft","setDraft","activeOption","setActiveOption","listboxId","useId","wrapperRef","useRef","highlightedOptionRef","highlightedOption","optionId","useEffect","close","selectOption","commit","parsed","moveActiveOption","step","next","jsxs","Popover","jsx","PopoverAnchor","Input","event","PopoverContent","isHighlighted","cn"],"mappings":"ocAOAA,kBAAAA,CAAM,OAAOC,kBAAiB,CAAA,CAE9B,IAAMC,CAAAA,CAA0B,GAC1BC,CAAAA,CAAiB,QAAA,CAGjBC,CAAAA,CAAqB,iDAAA,CAErBC,EAAQ,CAACC,CAAAA,CAAcC,CAAAA,GAC3B,CAAA,EAAG,MAAA,CAAOD,CAAI,CAAA,CAAE,QAAA,CAAS,EAAG,GAAG,CAAC,CAAA,CAAA,EAAI,MAAA,CAAOC,CAAM,CAAA,CAAE,QAAA,CAAS,CAAA,CAAG,GAAG,CAAC,CAAA,CAAA,CAExDC,CAAAA,CAAcC,CAAAA,EAAgBT,kBAAAA,CAAMS,CAAAA,CAAK,OAAO,CAAA,CAAE,MAAA,CAAON,CAAc,CAAA,CAOvEO,CAAAA,CAAiB,CAACC,CAAAA,CAAcC,IAAoC,CAC/E,IAAMC,CAAAA,CAAQT,CAAAA,CAAmB,KAAKO,CAAAA,CAAK,IAAA,EAAK,CAAE,WAAA,EAAa,CAAA,CAC/D,GAAI,CAACE,EAAO,OAAO,IAAA,CAEnB,IAAMP,CAAAA,CAAO,MAAA,CAAOO,CAAAA,CAAM,CAAC,CAAC,EACtBN,CAAAA,CAAS,MAAA,CAAOM,CAAAA,CAAM,CAAC,CAAA,EAAK,CAAC,CAAA,CAC7BC,CAAAA,CAAWD,EAAM,CAAC,CAAA,CACxB,GAAIN,CAAAA,CAAS,GAAI,OAAO,IAAA,CAGxB,GAAIO,CAAAA,CACF,OAAIR,CAAAA,CAAO,CAAA,EAAKA,CAAAA,CAAO,EAAA,CAAW,IAAA,CAC3BD,CAAAA,CAAOC,CAAAA,CAAO,EAAA,EAAOQ,IAAa,GAAA,CAAM,EAAA,CAAK,CAAA,CAAA,CAAIP,CA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WoC,oBACT,yEAAA,CACAD,CAAAA,EAAiB,cACnB,CAAA,CAEA,cAAgBF,CAAAA,EAAUA,CAAAA,CAAM,cAAA,EAAe,CAC/C,OAAA,CAAS,IAAMX,CAAAA,CAAarB,CAAM,EAEjC,QAAA,CAAAd,CAAAA,CAAWc,CAAM,CAAA,CAAA,CAfbA,CAgBP,CAEJ,CAAC,CAAA,CACH,CAAA,CACF,GACF,CAEJ","file":"chunk-6T7SNM2F.cjs","sourcesContent":["import { useEffect, useId, useRef, useState } from 'react';\nimport dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport { Input } from '../input/input';\nimport { Popover, PopoverAnchor, PopoverContent } from '../popover/popover';\nimport { cn } from '@/lib/utils';\n\ndayjs.extend(customParseFormat);\n\nconst OPTION_INTERVAL_MINUTES = 15;\nconst DISPLAY_FORMAT = 'h:mm A';\n\n/** \"1:33pm\", \"1:33 PM\", \"133p\", \"13:33\", \"1330\", \"1pm\", \"1\" */\nconst TYPED_TIME_PATTERN = /^(\\d{1,2})(?::?(\\d{2}))?\\s*(?:([ap])\\.?m?\\.?)?$/;\n\nconst toRaw = (hour: number, minute: number) =>\n `${String(hour).padStart(2, '0')}:${String(minute).padStart(2, '0')}`;\n\nexport const formatTime = (raw: string) => dayjs(raw, 'HH:mm').format(DISPLAY_FORMAT);\n\n/**\n * Parses typed text into an \"HH:mm\" value, or null when it isn't a time.\n * Without am/pm, hours 1-11 keep the meridiem of `current` so \"4:15\" next to \"3:00 PM\"\n * stays in the afternoon. Hours 0 and 12-23 read as a 24-hour clock.\n */\nexport const parseTypedTime = (text: string, current?: string): string | null => {\n const match = TYPED_TIME_PATTERN.exec(text.trim().toLowerCase());\n if (!match) return null;\n\n const hour = Number(match[1]);\n const minute = Number(match[2] ?? 0);\n const meridiem = match[3];\n if (minute > 59) return null;\n\n // With am/pm, e.g. \"1:30pm\" or \"11a\"\n if (meridiem) {\n if (hour < 1 || hour > 12) return null;\n return toRaw((hour % 12) + (meridiem === 'p' ? 12 : 0), minute);\n }\n\n if (hour > 23) return null;\n\n // Without am/pm, and the hour is unambiguous: 0 (midnight), 12 (noon), or 13-23\n if (hour === 0 || hour >= 12) return toRaw(hour, minute);\n\n // Without am/pm, and the hour is 1-11: use am/pm from the current value\n const isCurrentPm = !!current && dayjs(current, 'HH:mm').hour() >= 12;\n return toRaw((hour % 12) + (isCurrentPm ? 12 : 0), minute);\n};\n\n// Ends with \"24:00\" so an event can run until midnight, same as the TimeSelect this replaced\nconst OPTIONS = Array.from({ length: (24 * 60) / OPTION_INTERVAL_MINUTES + 1 }, (_, index) => {\n const minutes = index * OPTION_INTERVAL_MINUTES;\n return toRaw(Math.floor(minutes / 60), minutes % 60);\n});\n\n/** The option at or just before `value`, so an off-interval time opens the list near itself */\nconst nearestOptionAtOrBefore = (value: string) =>\n OPTIONS.findLast((option) => option <= value) ?? OPTIONS[0];\n\ntype TimeInputProps = {\n id?: string;\n placeholder?: string;\n /** \"HH:mm\" */\n value?: string;\n onChange: (value: string) => void;\n};\n\n/**\n * A typeable time field with a dropdown of 15-minute suggestions, modeled on Google Calendar.\n * Any minute can be typed; the text is parsed on blur or Enter and reverts when it isn't a time.\n * Arrow keys move through the suggestions, and Enter or blur picks the one they land on.\n */\nexport const TimeInput = ({ id, placeholder, value, onChange }: TimeInputProps) => {\n const [open, setOpen] = useState(false);\n // null while not editing, so the field always shows the committed value\n const [draft, setDraft] = useState<string | null>(null);\n // The option reached with the arrow keys, undefined until one is pressed\n const [activeOption, setActiveOption] = useState<string>();\n const listboxId = useId();\n const wrapperRef = useRef<HTMLDivElement>(null);\n const highlightedOptionRef = useRef<HTMLButtonElement>(null);\n\n const highlightedOption = activeOption ?? (value ? nearestOptionAtOrBefore(value) : undefined);\n const optionId = (option: string) => `${listboxId}-${option}`;\n\n useEffect(() => {\n if (open) highlightedOptionRef.current?.scrollIntoView?.({ block: 'center' });\n }, [open]);\n\n useEffect(() => {\n if (activeOption) highlightedOptionRef.current?.scrollIntoView?.({ block: 'nearest' });\n }, [activeOption]);\n\n const close = () => {\n setDraft(null);\n setActiveOption(undefined);\n setOpen(false);\n };\n\n const selectOption = (option: string) => {\n if (option !== value) onChange(option);\n close();\n };\n\n // Picks the arrowed-to option as is, since \"24:00\" reads back from its text as midnight at the start of the day\n const commit = () => {\n if (activeOption) return selectOption(activeOption);\n const parsed = draft === null ? null : parseTypedTime(draft, value);\n if (parsed && parsed !== value) onChange(parsed);\n close();\n return undefined;\n };\n\n const moveActiveOption = (step: 1 | -1) => {\n const index = highlightedOption ? OPTIONS.indexOf(highlightedOption) : -1;\n const next = OPTIONS[Math.min(Math.max(index + step, 0), OPTIONS.length - 1)];\n setOpen(true);\n setActiveOption(next);\n setDraft(formatTime(next));\n };\n\n return (\n <Popover open={open}>\n <PopoverAnchor>\n <div ref={wrapperRef}>\n <Input\n id={id}\n type=\"text\"\n autoComplete=\"off\"\n role=\"combobox\"\n aria-expanded={open}\n aria-controls={listboxId}\n aria-autocomplete=\"list\"\n aria-activedescendant={open && activeOption ? optionId(activeOption) : undefined}\n placeholder={placeholder}\n value={draft ?? (value ? formatTime(value) : '')}\n onFocus={(event) => {\n event.target.select();\n setOpen(true);\n }}\n onClick={() => setOpen(true)}\n onChange={(event) => {\n setDraft(event.target.value);\n setActiveOption(undefined);\n }}\n onBlur={commit}\n onKeyDown={(event) => {\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n moveActiveOption(event.key === 'ArrowDown' ? 1 : -1);\n }\n if (event.key === 'Enter') {\n event.preventDefault();\n commit();\n }\n if (event.key === 'Escape') close();\n }}\n />\n </div>\n </PopoverAnchor>\n <PopoverContent\n className=\"max-h-90 w-(--radix-popover-trigger-width) overflow-y-auto p-1\"\n align=\"start\"\n onOpenAutoFocus={(event) => event.preventDefault()}\n // The dialog's scroll lock cancels wheel/touch scrolling outside it, and this list is portaled out\n onWheel={(event) => event.stopPropagation()}\n onTouchMove={(event) => event.stopPropagation()}\n onInteractOutside={(event) => {\n if (wrapperRef.current?.contains(event.target as Node)) event.preventDefault();\n else setOpen(false);\n }}\n >\n <div id={listboxId} role=\"listbox\" className=\"flex flex-col\">\n {OPTIONS.map((option) => {\n const isHighlighted = option === highlightedOption;\n return (\n <button\n key={option}\n ref={isHighlighted ? highlightedOptionRef : undefined}\n id={optionId(option)}\n type=\"button\"\n role=\"option\"\n aria-selected={option === value}\n tabIndex={-1}\n className={cn(\n 'text-body-md h-10 shrink-0 rounded-sm px-3 text-left hover:bg-green-100',\n isHighlighted && 'bg-green-100',\n )}\n // Keeps focus in the input so its blur doesn't commit a stale draft first\n onPointerDown={(event) => event.preventDefault()}\n onClick={() => selectOption(option)}\n >\n {formatTime(option)}\n </button>\n );\n })}\n </div>\n </PopoverContent>\n </Popover>\n );\n};\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkI5LC3XFB_cjs=require('./chunk-I5LC3XFB.cjs'),chunkIJMCTNX6_cjs=require('./chunk-IJMCTNX6.cjs'),chunkMKSIR4NW_cjs=require('./chunk-MKSIR4NW.cjs'),jsxRuntime=require('react/jsx-runtime');var m=({active:a=false})=>jsxRuntime.jsxs(chunkI5LC3XFB_cjs.a,{children:[jsxRuntime.jsxs(chunkI5LC3XFB_cjs.b,{children:[jsxRuntime.jsx("img",{src:`${chunkMKSIR4NW_cjs.a}/illustrations/card/medication-desktop.svg`,alt:"medication",width:"300",height:"300"}),jsxRuntime.jsx(chunkIJMCTNX6_cjs.a,{active:a,children:jsxRuntime.jsx("img",{src:`${chunkMKSIR4NW_cjs.a}/illustrations/card/medication-desktop-fill.svg`,alt:"",width:"300",height:"300"})})]}),jsxRuntime.jsxs(chunkI5LC3XFB_cjs.c,{children:[jsxRuntime.jsx("img",{src:`${chunkMKSIR4NW_cjs.a}/illustrations/card/medication-mobile.svg`,alt:"medication",width:"358",height:"112"}),jsxRuntime.jsx(chunkIJMCTNX6_cjs.a,{active:a,children:jsxRuntime.jsx("img",{src:`${chunkMKSIR4NW_cjs.a}/illustrations/card/medication-mobile-fill.svg`,alt:"",width:"358",height:"112"})})]})]});exports.a=m;//# sourceMappingURL=chunk-WTGHWP7T.cjs.map
2
- //# sourceMappingURL=chunk-WTGHWP7T.cjs.map
1
+ 'use strict';var chunkIJMCTNX6_cjs=require('./chunk-IJMCTNX6.cjs'),chunkI5LC3XFB_cjs=require('./chunk-I5LC3XFB.cjs'),chunkMKSIR4NW_cjs=require('./chunk-MKSIR4NW.cjs'),jsxRuntime=require('react/jsx-runtime');var m=({active:a=false})=>jsxRuntime.jsxs(chunkI5LC3XFB_cjs.a,{children:[jsxRuntime.jsxs(chunkI5LC3XFB_cjs.b,{children:[jsxRuntime.jsx("img",{src:`${chunkMKSIR4NW_cjs.a}/illustrations/card/medication-desktop.svg`,alt:"medication",width:"300",height:"300"}),jsxRuntime.jsx(chunkIJMCTNX6_cjs.a,{active:a,children:jsxRuntime.jsx("img",{src:`${chunkMKSIR4NW_cjs.a}/illustrations/card/medication-desktop-fill.svg`,alt:"",width:"300",height:"300"})})]}),jsxRuntime.jsxs(chunkI5LC3XFB_cjs.c,{children:[jsxRuntime.jsx("img",{src:`${chunkMKSIR4NW_cjs.a}/illustrations/card/medication-mobile.svg`,alt:"medication",width:"358",height:"112"}),jsxRuntime.jsx(chunkIJMCTNX6_cjs.a,{active:a,children:jsxRuntime.jsx("img",{src:`${chunkMKSIR4NW_cjs.a}/illustrations/card/medication-mobile-fill.svg`,alt:"",width:"358",height:"112"})})]})]});exports.a=m;//# sourceMappingURL=chunk-BFHEVJNW.cjs.map
2
+ //# sourceMappingURL=chunk-BFHEVJNW.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Card/illustrations/Medication.tsx"],"names":["Medication","active","jsxs","IllustrationContainer","DesktopIllustration","jsx","ILLUSTRATIONS_BASE_URL","FillContainer_default","MobileIllustration"],"mappings":"+MAQO,IAAMA,CAAAA,CAAa,CAAC,CAAE,MAAA,CAAAC,EAAS,KAAM,CAAA,GAC1CC,gBAACC,mBAAAA,CAAA,CACC,UAAAD,eAAAA,CAACE,mBAAAA,CAAA,CACC,QAAA,CAAA,CAAAC,cAAAA,CAAC,OACC,GAAA,CAAK,CAAA,EAAGC,mBAAsB,CAAA,0CAAA,CAAA,CAC9B,GAAA,CAAI,aACJ,KAAA,CAAM,KAAA,CACN,OAAO,KAAA,CACT,CAAA,CAEAD,eAACE,mBAAAA,CAAA,CAAc,OAAQN,CAAAA,CACrB,QAAA,CAAAI,eAAC,KAAA,CAAA,CACC,GAAA,CAAK,GAAGC,mBAAsB,CAAA,+CAAA,CAAA,CAC9B,IAAI,EAAA,CACJ,KAAA,CAAM,MACN,MAAA,CAAO,KAAA,CACT,EACF,CAAA,CAAA,CACF,CAAA,CACAJ,gBAACM,mBAAAA,CAAA,CACC,UAAAH,cAAAA,CAAC,KAAA,CAAA,CACC,IAAK,CAAA,EAAGC,mBAAsB,4CAC9B,GAAA,CAAI,YAAA,CACJ,MAAM,KAAA,CACN,MAAA,CAAO,MACT,CAAA,CACAD,cAAAA,CAACE,oBAAA,CAAc,MAAA,CAAQN,EACrB,QAAA,CAAAI,cAAAA,CAAC,OACC,GAAA,CAAK,CAAA,EAAGC,mBAAsB,CAAA,8CAAA,CAAA,CAC9B,GAAA,CAAI,GACJ,KAAA,CAAM,KAAA,CACN,OAAO,KAAA,CACT,CAAA,CACF,GACF,CAAA,CAAA,CACF","file":"chunk-WTGHWP7T.cjs","sourcesContent":["import { ILLUSTRATIONS_BASE_URL } from '../../constants';\nimport FillContainer from '../../Form/Checkbox/shared/FillContainer';\nimport {\n DesktopIllustration,\n IllustrationContainer,\n MobileIllustration,\n} from '../../Form/Checkbox/shared/style';\n\nexport const Medication = ({ active = false }: { active?: boolean }) => (\n <IllustrationContainer>\n <DesktopIllustration>\n <img\n src={`${ILLUSTRATIONS_BASE_URL}/illustrations/card/medication-desktop.svg`}\n alt=\"medication\"\n width=\"300\"\n height=\"300\"\n />\n\n <FillContainer active={active}>\n <img\n src={`${ILLUSTRATIONS_BASE_URL}/illustrations/card/medication-desktop-fill.svg`}\n alt=\"\"\n width=\"300\"\n height=\"300\"\n />\n </FillContainer>\n </DesktopIllustration>\n <MobileIllustration>\n <img\n src={`${ILLUSTRATIONS_BASE_URL}/illustrations/card/medication-mobile.svg`}\n alt=\"medication\"\n width=\"358\"\n height=\"112\"\n />\n <FillContainer active={active}>\n <img\n src={`${ILLUSTRATIONS_BASE_URL}/illustrations/card/medication-mobile-fill.svg`}\n alt=\"\"\n width=\"358\"\n height=\"112\"\n />\n </FillContainer>\n </MobileIllustration>\n </IllustrationContainer>\n);\n"]}
1
+ {"version":3,"sources":["../src/Card/illustrations/Medication.tsx"],"names":["Medication","active","jsxs","IllustrationContainer","DesktopIllustration","jsx","ILLUSTRATIONS_BASE_URL","FillContainer_default","MobileIllustration"],"mappings":"+MAQO,IAAMA,CAAAA,CAAa,CAAC,CAAE,MAAA,CAAAC,EAAS,KAAM,CAAA,GAC1CC,gBAACC,mBAAAA,CAAA,CACC,UAAAD,eAAAA,CAACE,mBAAAA,CAAA,CACC,QAAA,CAAA,CAAAC,cAAAA,CAAC,OACC,GAAA,CAAK,CAAA,EAAGC,mBAAsB,CAAA,0CAAA,CAAA,CAC9B,GAAA,CAAI,aACJ,KAAA,CAAM,KAAA,CACN,OAAO,KAAA,CACT,CAAA,CAEAD,eAACE,mBAAAA,CAAA,CAAc,OAAQN,CAAAA,CACrB,QAAA,CAAAI,eAAC,KAAA,CAAA,CACC,GAAA,CAAK,GAAGC,mBAAsB,CAAA,+CAAA,CAAA,CAC9B,IAAI,EAAA,CACJ,KAAA,CAAM,MACN,MAAA,CAAO,KAAA,CACT,EACF,CAAA,CAAA,CACF,CAAA,CACAJ,gBAACM,mBAAAA,CAAA,CACC,UAAAH,cAAAA,CAAC,KAAA,CAAA,CACC,IAAK,CAAA,EAAGC,mBAAsB,4CAC9B,GAAA,CAAI,YAAA,CACJ,MAAM,KAAA,CACN,MAAA,CAAO,MACT,CAAA,CACAD,cAAAA,CAACE,oBAAA,CAAc,MAAA,CAAQN,EACrB,QAAA,CAAAI,cAAAA,CAAC,OACC,GAAA,CAAK,CAAA,EAAGC,mBAAsB,CAAA,8CAAA,CAAA,CAC9B,GAAA,CAAI,GACJ,KAAA,CAAM,KAAA,CACN,OAAO,KAAA,CACT,CAAA,CACF,GACF,CAAA,CAAA,CACF","file":"chunk-BFHEVJNW.cjs","sourcesContent":["import { ILLUSTRATIONS_BASE_URL } from '../../constants';\nimport FillContainer from '../../Form/Checkbox/shared/FillContainer';\nimport {\n DesktopIllustration,\n IllustrationContainer,\n MobileIllustration,\n} from '../../Form/Checkbox/shared/style';\n\nexport const Medication = ({ active = false }: { active?: boolean }) => (\n <IllustrationContainer>\n <DesktopIllustration>\n <img\n src={`${ILLUSTRATIONS_BASE_URL}/illustrations/card/medication-desktop.svg`}\n alt=\"medication\"\n width=\"300\"\n height=\"300\"\n />\n\n <FillContainer active={active}>\n <img\n src={`${ILLUSTRATIONS_BASE_URL}/illustrations/card/medication-desktop-fill.svg`}\n alt=\"\"\n width=\"300\"\n height=\"300\"\n />\n </FillContainer>\n </DesktopIllustration>\n <MobileIllustration>\n <img\n src={`${ILLUSTRATIONS_BASE_URL}/illustrations/card/medication-mobile.svg`}\n alt=\"medication\"\n width=\"358\"\n height=\"112\"\n />\n <FillContainer active={active}>\n <img\n src={`${ILLUSTRATIONS_BASE_URL}/illustrations/card/medication-mobile-fill.svg`}\n alt=\"\"\n width=\"358\"\n height=\"112\"\n />\n </FillContainer>\n </MobileIllustration>\n </IllustrationContainer>\n);\n"]}
@@ -0,0 +1,2 @@
1
+ import {b as b$2}from'./chunk-NNPDHI4P.js';import {a}from'./chunk-YTIIAU4W.js';import {a as a$1}from'./chunk-CWXZFXQT.js';import {d,c}from'./chunk-P37DIGUW.js';import {b as b$1}from'./chunk-4XXEMJ5J.js';import {b}from'./chunk-6MYNQMQU.js';import {createContext,forwardRef,useContext,useState,useEffect,useMemo}from'react';import {Drawer}from'vaul';import*as i from'radix-ui/dialog';import {useComposedRefs}from'radix-ui/internal';import {LuX}from'react-icons/lu';import {jsx,jsxs}from'react/jsx-runtime';var l=createContext({isResponsive:true}),E=createContext({anchorFooter:true,keyboardOpen:false}),K=.9,V="transform 0.5s cubic-bezier(0.32, 0.72, 0, 1), bottom 0.2s ease-out, max-height 0.2s ease-out";function U({disableDrawerOnMobile:t=false,...o}){let{isMobile:a}=b(),r=useMemo(()=>({isResponsive:!t}),[t]);return jsx(l.Provider,{value:r,children:a&&!t?jsx(Drawer.Root,{"data-slot":"drawer",direction:"bottom",repositionInputs:false,...o}):jsx(i.Root,{"data-slot":"dialog",...o})})}function Y({...t}){let{isMobile:o}=b(),{isResponsive:a}=useContext(l);return o&&a?jsx(Drawer.Trigger,{"data-slot":"drawer-trigger",...t}):jsx(i.Trigger,{"data-slot":"dialog-trigger",...t})}function k({...t}){let{isMobile:o}=b(),{isResponsive:a}=useContext(l);return o&&a?jsx(Drawer.Portal,{"data-slot":"drawer-portal",...t}):jsx(i.Portal,{"data-slot":"dialog-portal",...t})}function R({...t}){let{isMobile:o}=b(),{isResponsive:a}=useContext(l);return o&&a?jsx(Drawer.Close,{"data-slot":"drawer-close",...t}):jsx(i.Close,{"data-slot":"dialog-close",...t})}var T=forwardRef(({className:t,...o},a$1)=>{let{isMobile:r}=b(),{isResponsive:m}=useContext(l);return r&&m?jsx(Drawer.Overlay,{"data-slot":"drawer-overlay",className:a("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-modal-stacking-context fixed inset-0 bg-black/50",t),ref:a$1,...o}):jsx(i.Overlay,{"data-slot":"dialog-overlay",className:a("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-modal-stacking-context fixed inset-0 bg-black/50",t),ref:a$1,...o})}),Z=forwardRef(({className:t,children:o=null,overlayClassName:a$2,style:r,footerBehavior:m="anchor",...w},g)=>{let{isMobile:z}=a$1(),{isResponsive:H}=useContext(l),f=z&&H,[v,I]=useState(null),B=useComposedRefs(g,I);d(v,f);let s=b$1(f);useEffect(()=>{if(!f||!s.keyboardOpen||!v)return;let b=document.activeElement;if(b instanceof HTMLElement&&v.contains(b))return c(b,v)},[f,v,s.keyboardOpen,s.bottom,s.height]);let A=useMemo(()=>({anchorFooter:m==="anchor",keyboardOpen:s.keyboardOpen}),[m,s.keyboardOpen]);if(f){let b=s.keyboardOpen?{bottom:s.bottom,maxHeight:Math.round(s.height*K)}:void 0;return jsxs(k,{"data-slot":"drawer-portal",children:[jsx(T,{className:a$2}),jsx(Drawer.Content,{"data-slot":"drawer-content","data-keyboard-open":s.keyboardOpen?"":void 0,style:{transition:V,...b,...r},className:a("group/drawer-content bg-background z-modal-stacking-context fixed flex h-auto flex-col px-4","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[90dvh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[90dvh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-md","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm","max-w-dvw!",t),ref:B,...w,children:jsx(E.Provider,{value:A,children:o})})]})}return jsxs(k,{"data-slot":"dialog-portal",children:[jsx(T,{className:a$2}),jsx(i.Content,{"data-slot":"dialog-content",className:a("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-modal-stacking-context fixed top-[50%] left-[50%] grid w-[550px] max-w-[720px] min-w-[440px] translate-x-[-50%] translate-y-[-50%] rounded-lg border border-gray-300 p-6 shadow-sm duration-200",t),ref:g,style:r,...w,children:o})]})});function $({className:t,showCloseButton:o=true,...a$1}){let{isMobile:r}=b(),{isResponsive:m}=useContext(l);return r&&m?jsxs("div",{"data-slot":"drawer-header",className:a("relative flex flex-col gap-0.5 pt-6 pb-4 text-left md:gap-1.5",t),...a$1,children:[o&&jsx(R,{asChild:true,children:jsxs(b$2,{className:"absolute top-5 right-0",size:"sm",variant:"ghost-icon",children:[jsx(LuX,{}),jsx("span",{className:"sr-only",children:"Close dialog"})]})}),a$1.children]}):jsxs("div",{"data-slot":"dialog-header",className:a("relative flex flex-col gap-2 pb-4",t),...a$1,children:[o&&jsx(R,{asChild:true,children:jsxs(b$2,{className:"absolute top-0 right-0",size:"sm",variant:"ghost-icon",children:[jsx(LuX,{}),jsx("span",{className:"sr-only",children:"Close dialog"})]})}),a$1.children]})}function j({className:t,...o}){let{isMobile:a$1}=b(),{isResponsive:r}=useContext(l),{anchorFooter:m,keyboardOpen:w}=useContext(E);if(a$1&&r){let g=m&&w;return jsx("div",{"data-slot":"drawer-footer","data-behind-keyboard":g?"":void 0,className:a("mt-auto flex flex-col gap-2 py-4",g&&"bg-background absolute inset-x-0 top-full",t),...o})}return jsx("div",{"data-slot":"dialog-footer",className:a("mt-2 flex gap-2 pt-3",t),...o})}function tt({className:t,...o}){let{isMobile:a$2}=a$1(),{isResponsive:r}=useContext(l);return a$2&&r?jsx(Drawer.Title,{"data-slot":"drawer-title",className:a("font-display pr-6 text-3xl",t),...o}):jsx(i.Title,{"data-slot":"dialog-title",className:a("font-display pr-6 text-3xl leading-none tracking-[0.01rem]",t),...o})}function et({className:t,...o}){let{isMobile:a$1}=b(),{isResponsive:r}=useContext(l);return a$1&&r?jsx(Drawer.Description,{"data-slot":"drawer-description",className:t,...o}):jsx(i.Description,{"data-slot":"dialog-description",className:a("text-muted-foreground text-sm",t),...o})}export{U as a,Y as b,k as c,R as d,T as e,Z as f,$ as g,j as h,tt as i,et as j};//# sourceMappingURL=chunk-C7YYWHDQ.js.map
2
+ //# sourceMappingURL=chunk-C7YYWHDQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/v2/dialog/dialog.tsx"],"names":["DialogContext","createContext","DrawerKeyboardContext","DRAWER_MAX_HEIGHT_RATIO","DRAWER_TRANSITION","Dialog","disableDrawerOnMobile","props","isMobile","useWindowSize_default","contextValue","useMemo","jsx","DrawerPrimitive","DialogTrigger","isResponsive","useContext","DialogPortal","DialogClose","DialogOverlay","forwardRef","className","ref","cn","DialogContent","children","overlayClassName","style","footerBehavior","useIsMobile","isDrawer","contentEl","setContentEl","useState","setContentRef","useComposedRefs","useKeyboardFocusGuard","inset","useVisualViewportInset","useEffect","active","revealWhenSettled","keyboardContextValue","keyboardStyle","jsxs","DialogHeader","showCloseButton","Button","LuX","DialogFooter","anchorFooter","keyboardOpen","isBehindKeyboard","DialogTitle","DialogDescription"],"mappings":"wfAwBA,IAAMA,CAAAA,CAAgBC,aAAAA,CAAc,CAAE,aAAc,IAAK,CAAC,EACpDC,CAAAA,CAAwBD,aAAAA,CAAc,CAAE,YAAA,CAAc,IAAA,CAAM,YAAA,CAAc,KAAM,CAAC,CAAA,CAEjFE,EAA0B,EAAA,CAE1BC,CAAAA,CACJ,gGAEF,SAASC,CAAAA,CAAO,CACd,qBAAA,CAAAC,CAAAA,CAAwB,KAAA,CACxB,GAAGC,CACL,CAAA,CACqF,CACnF,GAAM,CAAE,SAAAC,CAAS,CAAA,CAAIC,GAAc,CAE7BC,CAAAA,CAAeC,OAAAA,CACnB,KAAO,CAAE,YAAA,CAAc,CAACL,CAAs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,CAAA,CAAIC,UAAAA,CAAWhB,CAAa,CAAA,CACjD,OAAIQ,KAAYO,CAAAA,CAEZH,GAAAA,CAACC,OAAgB,WAAA,CAAhB,CACC,YAAU,oBAAA,CACV,SAAA,CAAWQ,CAAAA,CACV,GAAGd,CAAAA,CACN,CAAA,CAIFK,IAAiB,CAAA,CAAA,WAAA,CAAhB,CACC,WAAA,CAAU,oBAAA,CACV,SAAA,CAAWW,CAAAA,CAAG,gCAAiCF,CAAS,CAAA,CACvD,GAAGd,CAAAA,CACN,CAEJ","file":"chunk-C7YYWHDQ.js","sourcesContent":["import {\n type ComponentProps,\n createContext,\n forwardRef,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\nimport * as DialogPrimitive from 'radix-ui/dialog';\nimport { useComposedRefs } from 'radix-ui/internal';\nimport { LuX } from 'react-icons/lu';\n\nimport { cn } from '@/lib/utils';\nimport { Button } from '../button/button';\nimport {\n revealWhenSettled,\n useIsMobile,\n useKeyboardFocusGuard,\n useVisualViewportInset,\n useWindowSize,\n} from '@/hooks';\n\nconst DialogContext = createContext({ isResponsive: true });\nconst DrawerKeyboardContext = createContext({ anchorFooter: true, keyboardOpen: false });\n\nconst DRAWER_MAX_HEIGHT_RATIO = 0.9;\n\nconst DRAWER_TRANSITION =\n 'transform 0.5s cubic-bezier(0.32, 0.72, 0, 1), bottom 0.2s ease-out, max-height 0.2s ease-out';\n\nfunction Dialog({\n disableDrawerOnMobile = false,\n ...props\n}: ComponentProps<typeof DialogPrimitive.Root> &\n ComponentProps<typeof DrawerPrimitive.Root> & { disableDrawerOnMobile?: boolean }) {\n const { isMobile } = useWindowSize();\n\n const contextValue = useMemo(\n () => ({ isResponsive: !disableDrawerOnMobile }),\n [disableDrawerOnMobile],\n );\n\n return (\n <DialogContext.Provider value={contextValue}>\n {isMobile && !disableDrawerOnMobile ? (\n <DrawerPrimitive.Root\n data-slot=\"drawer\"\n direction=\"bottom\"\n repositionInputs={false}\n {...props}\n />\n ) : (\n <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n )}\n </DialogContext.Provider>\n );\n}\n\nfunction DialogTrigger({\n ...props\n}: ComponentProps<typeof DialogPrimitive.Trigger> &\n ComponentProps<typeof DrawerPrimitive.Trigger>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n }\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: ComponentProps<typeof DialogPrimitive.Portal> & ComponentProps<typeof DrawerPrimitive.Portal>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n }\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: ComponentProps<typeof DialogPrimitive.Close> & ComponentProps<typeof DrawerPrimitive.Close>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n }\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nconst DialogOverlay = forwardRef<\n HTMLDivElement,\n ComponentProps<typeof DialogPrimitive.Overlay> & ComponentProps<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-modal-stacking-context fixed inset-0 bg-black/50',\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n }\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 z-modal-stacking-context fixed inset-0 bg-black/50',\n className,\n )}\n ref={ref}\n {...props}\n />\n );\n});\n\nconst DialogContent = forwardRef<\n HTMLDivElement,\n ComponentProps<typeof DialogPrimitive.Content> &\n ComponentProps<typeof DrawerPrimitive.Content> & {\n onBackButtonClick?: () => void;\n overlayClassName?: string | undefined;\n footerBehavior?: 'lift' | 'anchor';\n }\n>(\n (\n { className, children = null, overlayClassName, style, footerBehavior = 'anchor', ...props },\n ref,\n ) => {\n const { isMobile } = useIsMobile();\n const { isResponsive } = useContext(DialogContext);\n const isDrawer = isMobile && isResponsive;\n\n // Keyboard handling for the mobile drawer, in three parts:\n // 1. `useKeyboardFocusGuard` stops the browser panning the page when a field is focused, so\n // the only movement is the one we make.\n // 2. `useVisualViewportInset` tells us the keyboard height; we pin the drawer's bottom edge to\n // it and cap the height to 90% of what's visible.\n // 3. After each inset change we scroll the drawer's own scroll area so the focused field is\n // still in view.\n const [contentEl, setContentEl] = useState<HTMLDivElement | null>(null);\n const setContentRef = useComposedRefs(ref, setContentEl);\n useKeyboardFocusGuard(contentEl, isDrawer);\n const inset = useVisualViewportInset(isDrawer);\n\n useEffect(() => {\n if (!isDrawer || !inset.keyboardOpen || !contentEl) {\n return undefined;\n }\n const active = document.activeElement;\n if (active instanceof HTMLElement && contentEl.contains(active)) {\n // The new max-height is still transitioning at this point, so reveal again once it settles.\n return revealWhenSettled(active, contentEl);\n }\n return undefined;\n }, [isDrawer, contentEl, inset.keyboardOpen, inset.bottom, inset.height]);\n\n const keyboardContextValue = useMemo(\n () => ({ anchorFooter: footerBehavior === 'anchor', keyboardOpen: inset.keyboardOpen }),\n [footerBehavior, inset.keyboardOpen],\n );\n\n if (isDrawer) {\n const keyboardStyle = inset.keyboardOpen\n ? { bottom: inset.bottom, maxHeight: Math.round(inset.height * DRAWER_MAX_HEIGHT_RATIO) }\n : undefined;\n return (\n <DialogPortal data-slot=\"drawer-portal\">\n <DialogOverlay className={overlayClassName} />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n data-keyboard-open={inset.keyboardOpen ? '' : undefined}\n style={{ transition: DRAWER_TRANSITION, ...keyboardStyle, ...style }}\n className={cn(\n 'group/drawer-content bg-background z-modal-stacking-context fixed flex h-auto flex-col px-4',\n 'data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[90dvh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b',\n 'data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[90dvh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t',\n 'data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-md',\n 'data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm',\n 'max-w-dvw!',\n className,\n )}\n ref={setContentRef}\n {...props}\n >\n <DrawerKeyboardContext.Provider value={keyboardContextValue}>\n {children}\n </DrawerKeyboardContext.Provider>\n </DrawerPrimitive.Content>\n </DialogPortal>\n );\n }\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay className={overlayClassName} />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 z-modal-stacking-context fixed top-[50%] left-[50%] grid w-[550px] max-w-[720px] min-w-[440px] translate-x-[-50%] translate-y-[-50%] rounded-lg border border-gray-300 p-6 shadow-sm duration-200',\n className,\n )}\n ref={ref}\n style={style}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n },\n);\n\nfunction DialogHeader({\n className,\n showCloseButton = true,\n ...props\n}: ComponentProps<'div'> & {\n showCloseButton?: boolean;\n}) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn('relative flex flex-col gap-0.5 pt-6 pb-4 text-left md:gap-1.5', className)}\n {...props}\n >\n {showCloseButton && (\n <DialogClose asChild>\n <Button className=\"absolute top-5 right-0\" size=\"sm\" variant=\"ghost-icon\">\n <LuX />\n <span className=\"sr-only\">Close dialog</span>\n </Button>\n </DialogClose>\n )}\n {props.children}\n </div>\n );\n }\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('relative flex flex-col gap-2 pb-4', className)}\n {...props}\n >\n {showCloseButton && (\n <DialogClose asChild>\n <Button className=\"absolute top-0 right-0\" size=\"sm\" variant=\"ghost-icon\">\n <LuX />\n <span className=\"sr-only\">Close dialog</span>\n </Button>\n </DialogClose>\n )}\n {props.children}\n </div>\n );\n}\n\nfunction DialogFooter({ className, ...props }: ComponentProps<'div'>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n const { anchorFooter, keyboardOpen } = useContext(DrawerKeyboardContext);\n if (isMobile && isResponsive) {\n // hide header context to make more visual room when the keyboard is open\n const isBehindKeyboard = anchorFooter && keyboardOpen;\n return (\n <div\n data-slot=\"drawer-footer\"\n data-behind-keyboard={isBehindKeyboard ? '' : undefined}\n className={cn(\n 'mt-auto flex flex-col gap-2 py-4',\n isBehindKeyboard && 'bg-background absolute inset-x-0 top-full',\n className,\n )}\n {...props}\n />\n );\n }\n return (\n <div data-slot=\"dialog-footer\" className={cn('mt-2 flex gap-2 pt-3', className)} {...props} />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: ComponentProps<typeof DialogPrimitive.Title> & ComponentProps<typeof DrawerPrimitive.Title>) {\n const { isMobile } = useIsMobile();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn('font-display pr-6 text-3xl', className)}\n {...props}\n />\n );\n }\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('font-display pr-6 text-3xl leading-none tracking-[0.01rem]', className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: ComponentProps<typeof DialogPrimitive.Description> &\n ComponentProps<typeof DrawerPrimitive.Description>) {\n const { isMobile } = useWindowSize();\n const { isResponsive } = useContext(DialogContext);\n if (isMobile && isResponsive) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={className}\n {...props}\n />\n );\n }\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"]}
@@ -1,2 +1,2 @@
1
- import {a}from'./chunk-Z2IHO2AX.js';import {a as a$1}from'./chunk-QNQLCXEU.js';import {d,h}from'./chunk-IDHBCJT6.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var g=({uniqueId:t,open:p,loading:l,options:o,selected:c,toggleOption:a$2,onSearch:d$1,scrollbarRef:r,inputRef:f,emptyIndicator:R,loadingIndicator:n,selectFirstItem:M})=>jsx("div",{className:"relative",children:p&&jsx(d,{id:t,className:"bg-popover text-popover-foreground animate-in absolute top-1 z-10 w-full rounded-md border shadow-xs outline-none",onMouseLeave:()=>{r.current=false;},onMouseEnter:()=>{r.current=true;},onMouseUp:()=>{f?.current?.focus();},children:l&&n?n:jsxs(Fragment,{children:[jsx(a,{onSearch:d$1,options:o,emptyIndicator:R}),!M&&jsx(h,{value:"-",className:"hidden"}),jsx(a$1,{options:o,uniqueId:t,selected:c,toggleOption:a$2})]})})});export{g as a};//# sourceMappingURL=chunk-36YHOTU6.js.map
2
- //# sourceMappingURL=chunk-36YHOTU6.js.map
1
+ import {a}from'./chunk-Z2IHO2AX.js';import {a as a$1}from'./chunk-DMGSZX4T.js';import {d,h}from'./chunk-J624VXFX.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var g=({uniqueId:t,open:p,loading:l,options:o,selected:c,toggleOption:a$2,onSearch:d$1,scrollbarRef:r,inputRef:f,emptyIndicator:R,loadingIndicator:n,selectFirstItem:M})=>jsx("div",{className:"relative",children:p&&jsx(d,{id:t,className:"bg-popover text-popover-foreground animate-in absolute top-1 z-10 w-full rounded-md border shadow-xs outline-none",onMouseLeave:()=>{r.current=false;},onMouseEnter:()=>{r.current=true;},onMouseUp:()=>{f?.current?.focus();},children:l&&n?n:jsxs(Fragment,{children:[jsx(a,{onSearch:d$1,options:o,emptyIndicator:R}),!M&&jsx(h,{value:"-",className:"hidden"}),jsx(a$1,{options:o,uniqueId:t,selected:c,toggleOption:a$2})]})})});export{g as a};//# sourceMappingURL=chunk-D5AT3ZJD.js.map
2
+ //# sourceMappingURL=chunk-D5AT3ZJD.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/v2/multiselect/components/MultiSelectDropdown.tsx"],"names":["MultiSelectDropdown","uniqueId","open","loading","options","selected","toggleOption","onSearch","scrollbarRef","inputRef","emptyIndicator","loadingIndicator","selectFirstItem","jsx","CommandList","jsxs","Fragment","EmptyItem","CommandItem","MultiSelectCommandGroup"],"mappings":"uKAgBO,IAAMA,CAAAA,CAAsB,CAAC,CAClC,QAAA,CAAAC,CAAAA,CACA,KAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,EACA,YAAA,CAAAC,GAAAA,CACA,QAAA,CAAAC,GAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,SAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,eAAA,CAAAC,CACF,CAAA,GAEIC,GAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,UAAA,CACZ,QAAA,CAAAX,GACCW,GAAAA,CAACC,CAAAA,CAAA,CACC,EAAA,CAAIb,CAAAA,CACJ,SAAA,CAAU,mHAAA,CACV,YAAA,CAAc,IAAM,CAElBO,CAAAA,CAAa,OAAA,CAAU,MAEzB,CAAA,CACA,aAAc,IAAM,CAElBA,CAAAA,CAAa,OAAA,CAAU,KAEzB,CAAA,CACA,UAAW,IAAM,CACfC,CAAAA,EAAU,OAAA,EAAS,KAAA,GACrB,EAEC,QAAA,CAAAN,CAAAA,EAAWQ,CAAAA,CACVA,CAAAA,CAEAI,IAAAA,CAAAC,QAAAA,CAAA,CACE,QAAA,CAAA,CAAAH,GAAAA,CAACI,CAAAA,CAAA,CAAgB,QAAA,CAAAV,GAAAA,CAAU,OAAA,CAAAH,EAAS,cAAA,CAAAM,CAAAA,CAAkB,CAAA,CACrD,CAACE,CAAAA,EAAmBC,GAAAA,CAACK,EAAA,CAAY,KAAA,CAAM,GAAA,CAAI,SAAA,CAAU,QAAA,CAAS,CAAA,CAC/DL,IAACM,GAAAA,CAAA,CAA8B,OAAA,CAAAf,CAAAA,CAAS,QAAA,CAAAH,CAAAA,CAAU,QAAA,CAAAI,CAAAA,CAAU,YAAA,CAAAC,GAAAA,CAAgB,CAAA,CAAA,CAC9E,CAAA,CAEJ,CAAA,CAEJ","file":"chunk-36YHOTU6.js","sourcesContent":["import { CommandItem, CommandList } from '@/v2/command/command';\nimport { MultiSelectProps } from '../types';\nimport { MultiSelectCommandGroup } from './MultiSelectCommandGroup';\nimport { EmptyItem } from './EmptyItem';\nimport type { UseRefsReturn } from '../hooks/useRefs';\nimport { UseMultiSelectReturn } from '../hooks/useMultiSelect';\nimport { UseInteractionsReturn } from '../hooks/useInteractions';\n\ntype Props = Pick<\n MultiSelectProps,\n 'loading' | 'loadingIndicator' | 'emptyIndicator' | 'onSearch' | 'selectFirstItem'\n> &\n Pick<UseRefsReturn, 'inputRef' | 'scrollbarRef'> &\n Pick<UseMultiSelectReturn, 'uniqueId' | 'open' | 'selected' | 'options'> &\n Pick<UseInteractionsReturn, 'toggleOption'>;\n\nexport const MultiSelectDropdown = ({\n uniqueId,\n open,\n loading,\n options,\n selected,\n toggleOption,\n onSearch,\n scrollbarRef,\n inputRef,\n emptyIndicator,\n loadingIndicator,\n selectFirstItem,\n}: Props) => {\n return (\n <div className=\"relative\">\n {open && (\n <CommandList\n id={uniqueId}\n className=\"bg-popover text-popover-foreground animate-in absolute top-1 z-10 w-full rounded-md border shadow-xs outline-none\"\n onMouseLeave={() => {\n // eslint-disable-next-line no-param-reassign\n scrollbarRef.current = false;\n // setOnScrollbar(false);\n }}\n onMouseEnter={() => {\n // eslint-disable-next-line no-param-reassign\n scrollbarRef.current = true;\n // setOnScrollbar(true);\n }}\n onMouseUp={() => {\n inputRef?.current?.focus();\n }}\n >\n {loading && loadingIndicator ? (\n loadingIndicator\n ) : (\n <>\n <EmptyItem {...{ onSearch, options, emptyIndicator }} />\n {!selectFirstItem && <CommandItem value=\"-\" className=\"hidden\" />}\n <MultiSelectCommandGroup {...{ options, uniqueId, selected, toggleOption }} />\n </>\n )}\n </CommandList>\n )}\n </div>\n );\n};\n"]}
1
+ {"version":3,"sources":["../src/v2/multiselect/components/MultiSelectDropdown.tsx"],"names":["MultiSelectDropdown","uniqueId","open","loading","options","selected","toggleOption","onSearch","scrollbarRef","inputRef","emptyIndicator","loadingIndicator","selectFirstItem","jsx","CommandList","jsxs","Fragment","EmptyItem","C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chunk-D5AT3ZJD.js","sourcesContent":["import { CommandItem, CommandList } from '@/v2/command/command';\nimport { MultiSelectProps } from '../types';\nimport { MultiSelectCommandGroup } from './MultiSelectCommandGroup';\nimport { EmptyItem } from './EmptyItem';\nimport type { UseRefsReturn } from '../hooks/useRefs';\nimport { UseMultiSelectReturn } from '../hooks/useMultiSelect';\nimport { UseInteractionsReturn } from '../hooks/useInteractions';\n\ntype Props = Pick<\n MultiSelectProps,\n 'loading' | 'loadingIndicator' | 'emptyIndicator' | 'onSearch' | 'selectFirstItem'\n> &\n Pick<UseRefsReturn, 'inputRef' | 'scrollbarRef'> &\n Pick<UseMultiSelectReturn, 'uniqueId' | 'open' | 'selected' | 'options'> &\n Pick<UseInteractionsReturn, 'toggleOption'>;\n\nexport const MultiSelectDropdown = ({\n uniqueId,\n open,\n loading,\n options,\n selected,\n toggleOption,\n onSearch,\n scrollbarRef,\n inputRef,\n emptyIndicator,\n loadingIndicator,\n selectFirstItem,\n}: Props) => {\n return (\n <div className=\"relative\">\n {open && (\n <CommandList\n id={uniqueId}\n className=\"bg-popover text-popover-foreground animate-in absolute top-1 z-10 w-full rounded-md border shadow-xs outline-none\"\n onMouseLeave={() => {\n // eslint-disable-next-line no-param-reassign\n scrollbarRef.current = false;\n // setOnScrollbar(false);\n }}\n onMouseEnter={() => {\n // eslint-disable-next-line no-param-reassign\n scrollbarRef.current = true;\n // setOnScrollbar(true);\n }}\n onMouseUp={() => {\n inputRef?.current?.focus();\n }}\n >\n {loading && loadingIndicator ? (\n loadingIndicator\n ) : (\n <>\n <EmptyItem {...{ onSearch, options, emptyIndicator }} />\n {!selectFirstItem && <CommandItem value=\"-\" className=\"hidden\" />}\n <MultiSelectCommandGroup {...{ options, uniqueId, selected, toggleOption }} />\n </>\n )}\n </CommandList>\n )}\n </div>\n );\n};\n"]}
@@ -0,0 +1,2 @@
1
+ import {a as a$2}from'./chunk-ZGR3AQC3.js';import {a as a$1}from'./chunk-VRNWKIGB.js';import {a as a$4}from'./chunk-QFJFQRIG.js';import {a as a$3}from'./chunk-KPBWHCJ2.js';import {a}from'./chunk-MESFO57T.js';var c={Clock:a$4,Coffee:a$3,Medication:a$2,Notepad:a$1,Laptop:a};export{c as a};//# sourceMappingURL=chunk-DM3KOEH4.js.map
2
+ //# sourceMappingURL=chunk-DM3KOEH4.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Card/illustrations/index.tsx"],"names":["illustrations_default","Clock","Coffee","Medication","Notepad","Laptop"],"mappings":"gNAMA,IAAOA,CAAAA,CAAQ,CAAE,KAAA,CAAAC,GAAAA,CAAO,MAAA,CAAAC,GAAAA,CAAQ,UAAA,CAAAC,GAAAA,CAAY,OAAA,CAAAC,GAAAA,CAAS,MAAA,CAAAC,CAAO","file":"chunk-UDNQL2TT.js","sourcesContent":["import { Clock } from './Clock';\nimport { Coffee } from './Coffee';\nimport { Medication } from './Medication';\nimport { Notepad } from './Notepad';\nimport { Laptop } from './Laptop';\n\nexport default { Clock, Coffee, Medication, Notepad, Laptop };\n"]}
1
+ {"version":3,"sources":["../src/Card/illustrations/index.tsx"],"names":["illustrations_default","Clock","Coffee","Medication","Notepad","Laptop"],"mappings":"gNAMA,IAAOA,CAAAA,CAAQ,CAAE,KAAA,CAAAC,GAAAA,CAAO,MAAA,CAAAC,GAAAA,CAAQ,UAAA,CAAAC,GAAAA,CAAY,OAAA,CAAAC,GAAAA,CAAS,MAAA,CAAAC,CAAO","file":"chunk-DM3KOEH4.js","sourcesContent":["import { Clock } from './Clock';\nimport { Coffee } from './Coffee';\nimport { Medication } from './Medication';\nimport { Notepad } from './Notepad';\nimport { Laptop } from './Laptop';\n\nexport default { Clock, Coffee, Medication, Notepad, Laptop };\n"]}
@@ -1,2 +1,2 @@
1
- import {a}from'./chunk-N6CDLFD7.js';import {f,h}from'./chunk-IDHBCJT6.js';import {a as a$1}from'./chunk-YTIIAU4W.js';import {LuCheck}from'react-icons/lu';import {jsx,jsxs}from'react/jsx-runtime';var S=({options:o,selected:l,toggleOption:i,onSearch:c,uniqueId:p})=>{let d=a({selected:l,options:o});return jsx(f,{className:"h-full overflow-auto",children:jsx("div",{className:"flex flex-col gap-1",children:(c?d:o).map(e=>{let s=l.some(t=>t.value===e.value);return jsxs(h,{value:e.value,keywords:typeof e.label=="string"?[e.label]:void 0,disabled:e.disable,onMouseDown:t=>{t.preventDefault(),t.stopPropagation();},onSelect:()=>i(e),className:a$1("flex cursor-pointer items-center justify-between p-3 data-[selected=true]:bg-green-200 hover:data-[selected=true]:bg-green-200",e.disable&&"text-muted-foreground cursor-default",s&&"bg-green-100"),children:[e.label,s&&jsx(LuCheck,{className:"h-4 w-4 text-green-800"})]},e.value)})})},`${p}-command-group`)};export{S as a};//# sourceMappingURL=chunk-QNQLCXEU.js.map
2
- //# sourceMappingURL=chunk-QNQLCXEU.js.map
1
+ import {a}from'./chunk-N6CDLFD7.js';import {f,h}from'./chunk-J624VXFX.js';import {a as a$1}from'./chunk-YTIIAU4W.js';import {LuCheck}from'react-icons/lu';import {jsx,jsxs}from'react/jsx-runtime';var S=({options:o,selected:l,toggleOption:i,onSearch:c,uniqueId:p})=>{let d=a({selected:l,options:o});return jsx(f,{className:"h-full overflow-auto",children:jsx("div",{className:"flex flex-col gap-1",children:(c?d:o).map(e=>{let s=l.some(t=>t.value===e.value);return jsxs(h,{value:e.value,keywords:typeof e.label=="string"?[e.label]:void 0,disabled:e.disable,onMouseDown:t=>{t.preventDefault(),t.stopPropagation();},onSelect:()=>i(e),className:a$1("flex cursor-pointer items-center justify-between p-3 data-[selected=true]:bg-green-200 hover:data-[selected=true]:bg-green-200",e.disable&&"text-muted-foreground cursor-default",s&&"bg-green-100"),children:[e.label,s&&jsx(LuCheck,{className:"h-4 w-4 text-green-800"})]},e.value)})})},`${p}-command-group`)};export{S as a};//# sourceMappingURL=chunk-DMGSZX4T.js.map
2
+ //# sourceMappingURL=chunk-DMGSZX4T.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/v2/multiselect/components/MultiSelectCommandGroup.tsx"],"names":["MultiSelectCommandGroup","options","selected","toggleOption","onSearch","uniqueId","mergedOptions","useMergeOptions","jsx","CommandGroup","option","optionSelected","s","jsxs","CommandItem","e","cn","LuCheck"],"mappings":"mMAeO,IAAMA,CAAAA,CAA0B,CAAC,CACtC,OAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CACF,CAAA,GAAa,CACX,IAAMC,CAAAA,CAAgBC,CAAAA,CAAgB,CAAE,QAAA,CAAAL,CAAAA,CAAU,OAAA,CAAAD,CAAQ,CAAC,CAAA,CAG3D,OACEO,GAAAA,CAACC,CAAAA,CAAA,CAA+C,SAAA,CAAU,sBAAA,CACxD,QAAA,CAAAD,GAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,qBAAA,CACZ,QAAA,CAAA,CALgBJ,CAAAA,CAAWE,CAAAA,CAAgBL,CAAAA,EAK5B,GAAA,CAAKS,CAAAA,EAAmB,CACtC,IAAMC,CAAAA,CAAiBT,CAAAA,CAAS,IAAA,CAAMU,CAAAA,EAAMA,CAAAA,CAAE,KAAA,GAAUF,EAAO,KAAK,CAAA,CACpE,OACEG,IAAAA,CAACC,CAAAA,CAAA,CAEC,KAAA,CAAOJ,CAAAA,CAAO,KAAA,CACd,QAAA,CAAU,OAAOA,CAAAA,CAAO,KAAA,EAAU,QAAA,CAAW,CAACA,CAAAA,CAAO,KAAK,CAAA,CAAI,MAAA,CAC9D,QAAA,CAAUA,CAAAA,CAAO,OAAA,CACjB,WAAA,CAAcK,CAAAA,EAAM,CAClBA,CAAAA,CAAE,cAAA,EAAe,CACjBA,CAAAA,CAAE,eAAA,GACJ,CAAA,CACA,QAAA,CAAU,IAAMZ,CAAAA,CAAaO,CAAM,CAAA,CACnC,SAAA,CAAWM,GAAAA,CAGT,gIAAA,CACAN,CAAAA,CAAO,OAAA,EAAW,sCAAA,CAClBC,CAAAA,EAAkB,cACpB,CAAA,CAEC,QAAA,CAAA,CAAAD,CAAAA,CAAO,KAAA,CACPC,CAAAA,EAAkBH,GAAAA,CAACS,OAAAA,CAAA,CAAQ,SAAA,CAAU,wBAAA,CAAyB,CAAA,CAAA,CAAA,CAlB1DP,CAAAA,CAAO,KAmBd,CAEJ,CAAC,CAAA,CACH,CAAA,CAAA,CA5BiB,CAAA,EAAGL,CAAQ,gBA6B9B,CAEJ","file":"chunk-QNQLCXEU.js","sourcesContent":["import { LuCheck } from 'react-icons/lu';\n\nimport { CommandGroup, CommandItem } from '@/v2/command/command';\nimport { cn } from '@/lib/utils';\nimport { MultiSelectProps, Option } from '../types';\nimport { UseMultiSelectReturn } from '../hooks/useMultiSelect';\nimport { UseInteractionsReturn } from '../hooks/useInteractions';\nimport { useMergeOptions } from '../hooks/useMergeOptions';\n\ntype Props = Pick<MultiSelectProps, 'onSearch'> &\n Pick<UseMultiSelectReturn, 'selected' | 'uniqueId'> &\n Pick<UseInteractionsReturn, 'toggleOption'> & {\n options: Option[];\n };\n\nexport const MultiSelectCommandGroup = ({\n options,\n selected,\n toggleOption,\n onSearch,\n uniqueId,\n}: Props) => {\n const mergedOptions = useMergeOptions({ selected, options });\n const displayOptions = onSearch ? mergedOptions : options;\n\n return (\n <CommandGroup key={`${uniqueId}-command-group`} className=\"h-full overflow-auto\">\n <div className=\"flex flex-col gap-1\">\n {displayOptions.map((option: Option) => {\n const optionSelected = selected.some((s) => s.value === option.value);\n return (\n <CommandItem\n key={option.value}\n value={option.value}\n keywords={typeof option.label === 'string' ? [option.label] : undefined}\n disabled={option.disable}\n onMouseDown={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n onSelect={() => toggleOption(option)}\n className={cn(\n // data-[selected=true] means when the user navigates onto an option with the keyboard\n // optionSelected means the user has actually toggled on the option\n 'flex cursor-pointer items-center justify-between p-3 data-[selected=true]:bg-green-200 hover:data-[selected=true]:bg-green-200',\n option.disable && 'text-muted-foreground cursor-default',\n optionSelected && 'bg-green-100',\n )}\n >\n {option.label}\n {optionSelected && <LuCheck className=\"h-4 w-4 text-green-800\" />}\n </CommandItem>\n );\n })}\n </div>\n </CommandGroup>\n );\n};\n"]}
1
+ {"version":3,"sources":["../src/v2/multiselect/components/MultiSelectCommandGroup.tsx"],"names":["MultiSelectCommandGroup","options","selected","toggleOption","onSearch","uniqueId","mergedOptions","useMergeOptions","jsx","CommandGroup","option","optionSelected","s","jsxs","CommandItem","e","cn","LuCheck"],"mappings":"mMAeO,IAAMA,CAAAA,CAA0B,CAAC,CACtC,OAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CACF,CAAA,GAAa,CACX,IAAMC,CAAAA,CAAgBC,CAAAA,CAAgB,CAAE,QAAA,CAAAL,CAAAA,CAAU,OAAA,CAAAD,CAAQ,CAAC,CAAA,CAG3D,OACEO,GAAAA,CAACC,CAAAA,CAAA,CAA+C,SAAA,CAAU,sBAAA,CACxD,QAAA,CAAAD,GAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,qBAAA,CACZ,QAAA,CAAA,CALgBJ,CAAAA,CAAWE,CAAAA,CAAgBL,CAAAA,EAK5B,GAAA,CAAKS,CAAAA,EAAmB,CACtC,IAAMC,CAAAA,CAAiBT,CAAAA,CAAS,IAAA,CAAMU,CAAAA,EAAMA,CAAAA,CAAE,KAAA,GAAUF,EAAO,KAAK,CAAA,CACpE,OACEG,IAAAA,CAACC,CAAAA,CAAA,CAEC,KAAA,CAAOJ,CAAAA,CAAO,KAAA,CACd,QAAA,CAAU,OAAOA,CAAAA,CAAO,KAAA,EAAU,QAAA,CAAW,CAACA,CAAAA,CAAO,KAAK,CAAA,CAAI,MAAA,CAC9D,QAAA,CAAUA,CAAAA,CAAO,OAAA,CACjB,WAAA,CAAcK,CAAAA,EAAM,CAClBA,CAAAA,CAAE,cAAA,EAAe,CACjBA,CAAAA,CAAE,eAAA,GACJ,CAAA,CACA,QAAA,CAAU,IAAMZ,CAAAA,CAAaO,CAAM,CAAA,CACnC,SAAA,CAAWM,GAAAA,CAGT,gIAAA,CACAN,CAAAA,CAAO,OAAA,EAAW,sCAAA,CAClBC,CAAAA,EAAkB,cACpB,CAAA,CAEC,QAAA,CAAA,CAAAD,CAAAA,CAAO,KAAA,CACPC,CAAAA,EAAkBH,GAAAA,CAACS,OAAAA,CAAA,CAAQ,SAAA,CAAU,wBAAA,CAAyB,CAAA,CAAA,CAAA,CAlB1DP,CAAAA,CAAO,KAmBd,CAEJ,CAAC,CAAA,CACH,CAAA,CAAA,CA5BiB,CAAA,EAAGL,CAAQ,gBA6B9B,CAEJ","file":"chunk-DMGSZX4T.js","sourcesContent":["import { LuCheck } from 'react-icons/lu';\n\nimport { CommandGroup, CommandItem } from '@/v2/command/command';\nimport { cn } from '@/lib/utils';\nimport { MultiSelectProps, Option } from '../types';\nimport { UseMultiSelectReturn } from '../hooks/useMultiSelect';\nimport { UseInteractionsReturn } from '../hooks/useInteractions';\nimport { useMergeOptions } from '../hooks/useMergeOptions';\n\ntype Props = Pick<MultiSelectProps, 'onSearch'> &\n Pick<UseMultiSelectReturn, 'selected' | 'uniqueId'> &\n Pick<UseInteractionsReturn, 'toggleOption'> & {\n options: Option[];\n };\n\nexport const MultiSelectCommandGroup = ({\n options,\n selected,\n toggleOption,\n onSearch,\n uniqueId,\n}: Props) => {\n const mergedOptions = useMergeOptions({ selected, options });\n const displayOptions = onSearch ? mergedOptions : options;\n\n return (\n <CommandGroup key={`${uniqueId}-command-group`} className=\"h-full overflow-auto\">\n <div className=\"flex flex-col gap-1\">\n {displayOptions.map((option: Option) => {\n const optionSelected = selected.some((s) => s.value === option.value);\n return (\n <CommandItem\n key={option.value}\n value={option.value}\n keywords={typeof option.label === 'string' ? [option.label] : undefined}\n disabled={option.disable}\n onMouseDown={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n onSelect={() => toggleOption(option)}\n className={cn(\n // data-[selected=true] means when the user navigates onto an option with the keyboard\n // optionSelected means the user has actually toggled on the option\n 'flex cursor-pointer items-center justify-between p-3 data-[selected=true]:bg-green-200 hover:data-[selected=true]:bg-green-200',\n option.disable && 'text-muted-foreground cursor-default',\n optionSelected && 'bg-green-100',\n )}\n >\n {option.label}\n {optionSelected && <LuCheck className=\"h-4 w-4 text-green-800\" />}\n </CommandItem>\n );\n })}\n </div>\n </CommandGroup>\n );\n};\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkI5LC3XFB_cjs=require('./chunk-I5LC3XFB.cjs'),chunkIJMCTNX6_cjs=require('./chunk-IJMCTNX6.cjs'),chunkMKSIR4NW_cjs=require('./chunk-MKSIR4NW.cjs'),jsxRuntime=require('react/jsx-runtime');var h=({active:a=false})=>jsxRuntime.jsxs(chunkI5LC3XFB_cjs.a,{children:[jsxRuntime.jsxs(chunkI5LC3XFB_cjs.b,{children:[jsxRuntime.jsx("img",{src:`${chunkMKSIR4NW_cjs.a}/illustrations/card/laptop-desktop.svg`,alt:"laptop",width:"290",height:"290"}),jsxRuntime.jsx(chunkIJMCTNX6_cjs.a,{active:a,children:jsxRuntime.jsx("img",{src:`${chunkMKSIR4NW_cjs.a}/illustrations/card/laptop-desktop-fill.svg`,alt:"",width:"290",height:"290"})})]}),jsxRuntime.jsxs(chunkI5LC3XFB_cjs.c,{children:[jsxRuntime.jsx("img",{src:`${chunkMKSIR4NW_cjs.a}/illustrations/card/laptop-mobile.svg`,alt:"laptop",width:"358",height:"112"}),jsxRuntime.jsx(chunkIJMCTNX6_cjs.a,{active:a,children:jsxRuntime.jsx("img",{src:`${chunkMKSIR4NW_cjs.a}/illustrations/card/laptop-mobile-fill.svg`,alt:"",width:"358",height:"112"})})]})]});exports.a=h;//# sourceMappingURL=chunk-G4NTJXGK.cjs.map
2
- //# sourceMappingURL=chunk-G4NTJXGK.cjs.map
1
+ 'use strict';var chunkIJMCTNX6_cjs=require('./chunk-IJMCTNX6.cjs'),chunkI5LC3XFB_cjs=require('./chunk-I5LC3XFB.cjs'),chunkMKSIR4NW_cjs=require('./chunk-MKSIR4NW.cjs'),jsxRuntime=require('react/jsx-runtime');var h=({active:a=false})=>jsxRuntime.jsxs(chunkI5LC3XFB_cjs.a,{children:[jsxRuntime.jsxs(chunkI5LC3XFB_cjs.b,{children:[jsxRuntime.jsx("img",{src:`${chunkMKSIR4NW_cjs.a}/illustrations/card/laptop-desktop.svg`,alt:"laptop",width:"290",height:"290"}),jsxRuntime.jsx(chunkIJMCTNX6_cjs.a,{active:a,children:jsxRuntime.jsx("img",{src:`${chunkMKSIR4NW_cjs.a}/illustrations/card/laptop-desktop-fill.svg`,alt:"",width:"290",height:"290"})})]}),jsxRuntime.jsxs(chunkI5LC3XFB_cjs.c,{children:[jsxRuntime.jsx("img",{src:`${chunkMKSIR4NW_cjs.a}/illustrations/card/laptop-mobile.svg`,alt:"laptop",width:"358",height:"112"}),jsxRuntime.jsx(chunkIJMCTNX6_cjs.a,{active:a,children:jsxRuntime.jsx("img",{src:`${chunkMKSIR4NW_cjs.a}/illustrations/card/laptop-mobile-fill.svg`,alt:"",width:"358",height:"112"})})]})]});exports.a=h;//# sourceMappingURL=chunk-IBQWP337.cjs.map
2
+ //# sourceMappingURL=chunk-IBQWP337.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Card/illustrations/Laptop.tsx"],"names":["Laptop","active","jsxs","IllustrationContainer","DesktopIllustration","jsx","ILLUSTRATIONS_BASE_URL","FillContainer_default","MobileIllustration"],"mappings":"+MAQO,IAAMA,CAAAA,CAAS,CAAC,CAAE,MAAA,CAAAC,EAAS,KAAM,CAAA,GACtCC,gBAACC,mBAAAA,CAAA,CACC,UAAAD,eAAAA,CAACE,mBAAAA,CAAA,CACC,QAAA,CAAA,CAAAC,cAAAA,CAAC,OACC,GAAA,CAAK,CAAA,EAAGC,mBAAsB,CAAA,sCAAA,CAAA,CAC9B,GAAA,CAAI,SACJ,KAAA,CAAM,KAAA,CACN,OAAO,KAAA,CACT,CAAA,CACAD,eAACE,mBAAAA,CAAA,CAAc,OAAQN,CAAAA,CACrB,QAAA,CAAAI,eAAC,KAAA,CAAA,CACC,GAAA,CAAK,GAAGC,mBAAsB,CAAA,2CAAA,CAAA,CAC9B,IAAI,EAAA,CACJ,KAAA,CAAM,MACN,MAAA,CAAO,KAAA,CACT,EACF,CAAA,CAAA,CACF,CAAA,CACAJ,gBAACM,mBAAAA,CAAA,CACC,UAAAH,cAAAA,CAAC,KAAA,CAAA,CACC,IAAK,CAAA,EAAGC,mBAAsB,wCAC9B,GAAA,CAAI,QAAA,CACJ,MAAM,KAAA,CACN,MAAA,CAAO,MACT,CAAA,CAEAD,cAAAA,CAACE,oBAAA,CAAc,MAAA,CAAQN,EACrB,QAAA,CAAAI,cAAAA,CAAC,OACC,GAAA,CAAK,CAAA,EAAGC,mBAAsB,CAAA,0CAAA,CAAA,CAC9B,GAAA,CAAI,GACJ,KAAA,CAAM,KAAA,CACN,OAAO,KAAA,CACT,CAAA,CACF,GACF,CAAA,CAAA,CACF","file":"chunk-G4NTJXGK.cjs","sourcesContent":["import { ILLUSTRATIONS_BASE_URL } from '../../constants';\nimport FillContainer from '../../Form/Checkbox/shared/FillContainer';\nimport {\n DesktopIllustration,\n IllustrationContainer,\n MobileIllustration,\n} from '../../Form/Checkbox/shared/style';\n\nexport const Laptop = ({ active = false }: { active?: boolean }) => (\n <IllustrationContainer>\n <DesktopIllustration>\n <img\n src={`${ILLUSTRATIONS_BASE_URL}/illustrations/card/laptop-desktop.svg`}\n alt=\"laptop\"\n width=\"290\"\n height=\"290\"\n />\n <FillContainer active={active}>\n <img\n src={`${ILLUSTRATIONS_BASE_URL}/illustrations/card/laptop-desktop-fill.svg`}\n alt=\"\"\n width=\"290\"\n height=\"290\"\n />\n </FillContainer>\n </DesktopIllustration>\n <MobileIllustration>\n <img\n src={`${ILLUSTRATIONS_BASE_URL}/illustrations/card/laptop-mobile.svg`}\n alt=\"laptop\"\n width=\"358\"\n height=\"112\"\n />\n\n <FillContainer active={active}>\n <img\n src={`${ILLUSTRATIONS_BASE_URL}/illustrations/card/laptop-mobile-fill.svg`}\n alt=\"\"\n width=\"358\"\n height=\"112\"\n />\n </FillContainer>\n </MobileIllustration>\n </IllustrationContainer>\n);\n"]}
1
+ {"version":3,"sources":["../src/Card/illustrations/Laptop.tsx"],"names":["Laptop","active","jsxs","IllustrationContainer","DesktopIllustration","jsx","ILLUSTRATIONS_BASE_URL","FillContainer_default","MobileIllustration"],"mappings":"+MAQO,IAAMA,CAAAA,CAAS,CAAC,CAAE,MAAA,CAAAC,EAAS,KAAM,CAAA,GACtCC,gBAACC,mBAAAA,CAAA,CACC,UAAAD,eAAAA,CAACE,mBAAAA,CAAA,CACC,QAAA,CAAA,CAAAC,cAAAA,CAAC,OACC,GAAA,CAAK,CAAA,EAAGC,mBAAsB,CAAA,sCAAA,CAAA,CAC9B,GAAA,CAAI,SACJ,KAAA,CAAM,KAAA,CACN,OAAO,KAAA,CACT,CAAA,CACAD,eAACE,mBAAAA,CAAA,CAAc,OAAQN,CAAAA,CACrB,QAAA,CAAAI,eAAC,KAAA,CAAA,CACC,GAAA,CAAK,GAAGC,mBAAsB,CAAA,2CAAA,CAAA,CAC9B,IAAI,EAAA,CACJ,KAAA,CAAM,MACN,MAAA,CAAO,KAAA,CACT,EACF,CAAA,CAAA,CACF,CAAA,CACAJ,gBAACM,mBAAAA,CAAA,CACC,UAAAH,cAAAA,CAAC,KAAA,CAAA,CACC,IAAK,CAAA,EAAGC,mBAAsB,wCAC9B,GAAA,CAAI,QAAA,CACJ,MAAM,KAAA,CACN,MAAA,CAAO,MACT,CAAA,CAEAD,cAAAA,CAACE,oBAAA,CAAc,MAAA,CAAQN,EACrB,QAAA,CAAAI,cAAAA,CAAC,OACC,GAAA,CAAK,CAAA,EAAGC,mBAAsB,CAAA,0CAAA,CAAA,CAC9B,GAAA,CAAI,GACJ,KAAA,CAAM,KAAA,CACN,OAAO,KAAA,CACT,CAAA,CACF,GACF,CAAA,CAAA,CACF","file":"chunk-IBQWP337.cjs","sourcesContent":["import { ILLUSTRATIONS_BASE_URL } from '../../constants';\nimport FillContainer from '../../Form/Checkbox/shared/FillContainer';\nimport {\n DesktopIllustration,\n IllustrationContainer,\n MobileIllustration,\n} from '../../Form/Checkbox/shared/style';\n\nexport const Laptop = ({ active = false }: { active?: boolean }) => (\n <IllustrationContainer>\n <DesktopIllustration>\n <img\n src={`${ILLUSTRATIONS_BASE_URL}/illustrations/card/laptop-desktop.svg`}\n alt=\"laptop\"\n width=\"290\"\n height=\"290\"\n />\n <FillContainer active={active}>\n <img\n src={`${ILLUSTRATIONS_BASE_URL}/illustrations/card/laptop-desktop-fill.svg`}\n alt=\"\"\n width=\"290\"\n height=\"290\"\n />\n </FillContainer>\n </DesktopIllustration>\n <MobileIllustration>\n <img\n src={`${ILLUSTRATIONS_BASE_URL}/illustrations/card/laptop-mobile.svg`}\n alt=\"laptop\"\n width=\"358\"\n height=\"112\"\n />\n\n <FillContainer active={active}>\n <img\n src={`${ILLUSTRATIONS_BASE_URL}/illustrations/card/laptop-mobile-fill.svg`}\n alt=\"\"\n width=\"358\"\n height=\"112\"\n />\n </FillContainer>\n </MobileIllustration>\n </IllustrationContainer>\n);\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkVJHFFAS4_cjs=require('./chunk-VJHFFAS4.cjs'),chunk777NH37Z_cjs=require('./chunk-777NH37Z.cjs'),chunk2DLCWPKO_cjs=require('./chunk-2DLCWPKO.cjs'),chunkODAOIGPB_cjs=require('./chunk-ODAOIGPB.cjs'),chunkRTFBAC56_cjs=require('./chunk-RTFBAC56.cjs'),chunkIINNHABI_cjs=require('./chunk-IINNHABI.cjs'),chunkQRO22BPZ_cjs=require('./chunk-QRO22BPZ.cjs'),Be=require('use-places-autocomplete'),react=require('react'),api=require('@react-google-maps/api'),lu=require('react-icons/lu'),T=require('dayjs'),be=require('dayjs/plugin/customParseFormat.js'),reactImask=require('react-imask'),reactDayPicker=require('react-day-picker'),jsxRuntime=require('react/jsx-runtime'),Ee=require('react-easy-crop'),luxon=require('luxon');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Be__default=/*#__PURE__*/_interopDefault(Be);var T__default=/*#__PURE__*/_interopDefault(T);var be__default=/*#__PURE__*/_interopDefault(be);var Ee__default=/*#__PURE__*/_interopDefault(Ee);T__default.default.extend(be__default.default);var te="MM/DD/YYYY",De="00/00/0000",q=["MM/DD/YYYY","MM/D/YYYY","M/DD/YYYY","M/D/YYYY","YYYY-MM-DD"];function I(i){return i?T__default.default(i).format(te):""}function Ce({className:i="",wrapperClassName:r="",value:t=void 0,onChange:a=void 0,disabled:o=false,calendarProps:l=void 0,placeholder:p,inputProps:g=void 0,showCalendarIcon:b=true,editable:m=false}){let[d,x]=react.useState(false),v=p??(m?te:"Pick a date"),[e,n]=react.useState(void 0),u=react.useRef(t);t!==u.current&&(u.current=t,e!==void 0&&n(void 0));let c=e??t,s=f=>l?.disabled?!reactDayPicker.isMatch(f,l.disabled):true,D=react.useRef(a);D.current=a;let N=react.useRef(s);N.current=s;let{ref:W,setValue:B}=reactImask.useIMask({mask:De,lazy:true,overwrite:false},{onComplete:f=>{let C=T__default.default(f,q,true);C.isValid()&&N.current(C.toDate())&&D.current?.(C.toDate());}}),de=f=>{a?.(f),B(I(f)),x(false);},me=f=>{let C=f.clipboardData.getData("text").trim(),V=T__default.default(C,q,true);if(V.isValid()&&s(V.toDate())){f.preventDefault();let J=V.toDate();a?.(J),B(I(J));}},ue=()=>{B(I(t));},ce=()=>{let f=W.current?.value??"";if(f===""){t!==void 0&&a?.(void 0);return}let C=T__default.default(f,q,true);C.isValid()&&s(C.toDate())&&a?.(C.toDate()),B(I(t));},fe=chunkQRO22BPZ_cjs.a(chunk2DLCWPKO_cjs.a(),b&&"pl-10",d?"border-dark-green":"",i);return jsxRuntime.jsxs(chunkODAOIGPB_cjs.a,{open:!o&&d,onOpenChange:x,children:[jsxRuntime.jsx(chunkODAOIGPB_cjs.b,{asChild:true,children:jsxRuntime.jsxs("div",{className:chunkQRO22BPZ_cjs.a("relative flex w-full items-center rounded-md",r),children:[m?jsxRuntime.jsx("input",{ref:W,defaultValue:I(t),className:fe,placeholder:v,disabled:o,onFocus:ue,onPaste:me,onBlur:f=>{ce(),g?.onBlur?.(f);}}):jsxRuntime.jsx(chunk2DLCWPKO_cjs.b,{className:chunkQRO22BPZ_cjs.a(b&&"pl-10",d?"border-dark-green":"",i),...g,value:I(t),placeholder:v,readOnly:true,disabled:o}),b&&jsxRuntime.jsx("div",{className:chunkQRO22BPZ_cjs.a("absolute top-1/2 left-4 h-4 w-4 -translate-y-1/2",o?"text-gray-400":"cursor-pointer text-black"),children:jsxRuntime.jsx(lu.LuCalendar,{size:16})})]})}),jsxRuntime.jsx(chunkODAOIGPB_cjs.c,{className:"w-auto overflow-hidden p-0",align:"start",onOpenAutoFocus:m?f=>f.preventDefault():void 0,children:jsxRuntime.jsx(chunkRTFBAC56_cjs.b,{mode:"single",selected:t?T__default.default(t).toDate():void 0,onSelect:de,...m?{month:c,onMonthChange:n}:{},...l})})]})}function Pe(i){let r=i.replace(/\D/g,"").slice(0,8);return r.length<=2?r:r.length<=4?`${r.slice(0,2)}/${r.slice(2)}`:`${r.slice(0,2)}/${r.slice(2,4)}/${r.slice(4)}`}function we(i){if(i.length!==10)return;let r=i.split("/");if(r.length!==3||r[2].length!==4)return;let t=parseInt(r[0],10),a=parseInt(r[1],10),o=parseInt(r[2],10);if(Number.isNaN(t)||Number.isNaN(a)||Number.isNaN(o))return;let l=new Date(o,t-1,a);if(!(l.getFullYear()!==o||l.getMonth()!==t-1||l.getDate()!==a))return l}function Ie({className:i,wrapperClassName:r,value:t,onChange:a,disabled:o=false,calendarProps:l,placeholder:p="MM/DD/YYYY",variant:g}){let[b,m]=react.useState(false),[d,x]=react.useState(t),[v,e]=react.useState(t?T__default.default(t).format("MM/DD/YYYY"):""),n=react.useRef(t?T__default.default(t).format("MM/DD/YYYY"):"");react.useEffect(()=>{let s=t?T__default.default(t).format("MM/DD/YYYY"):"";s!==n.current&&(n.current=s,e(s),t&&x(t));},[t]);let u=s=>{let D=Pe(s.target.value);e(D);let N=we(D);N?(n.current=D,a?.(N)):D===""&&(n.current="",a?.(void 0));},c=s=>{s.key==="ArrowDown"&&(s.preventDefault(),m(true)),!/[0-9/]/.test(s.key)&&!["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","Tab"].includes(s.key)&&!s.metaKey&&!s.ctrlKey&&s.preventDefault();};return jsxRuntime.jsxs("div",{className:chunkQRO22BPZ_cjs.a("relative w-full",r),children:[jsxRuntime.jsx("input",{type:"text","data-slot":"input",className:chunkQRO22BPZ_cjs.a(chunk2DLCWPKO_cjs.a({variant:g}),"pr-10",i),value:v,placeholder:p,onChange:u,onKeyDown:c,disabled:o}),jsxRuntime.jsxs(chunkODAOIGPB_cjs.a,{open:!o&&b,onOpenChange:m,children:[jsxRuntime.jsx(chunkODAOIGPB_cjs.b,{asChild:true,children:jsxRuntime.jsx(chunkIINNHABI_cjs.b,{variant:"ghost-icon",size:"sm",className:"absolute top-1/2 right-1 -translate-y-1/2",disabled:o,"aria-label":"Select date",type:"button",children:jsxRuntime.jsx(lu.LuCalendar,{})})}),jsxRuntime.jsx(chunkODAOIGPB_cjs.c,{className:"w-auto overflow-hidden p-0",align:"end",sideOffset:10,children:jsxRuntime.jsx(chunkRTFBAC56_cjs.b,{mode:"single",selected:t,month:d,onMonthChange:x,onSelect:s=>{let D=s?T__default.default(s).format("MM/DD/YYYY"):"";n.current=D,e(D),a?.(s),m(false);},...l})})]})]})}var Re=({alt:i,className:r="",containerClassName:t="",imagePreview:a=void 0,cropper:o=void 0})=>{let[l,p]=react.useState(false),g=!a||!l,b=!!o;return jsxRuntime.jsxs("div",{className:chunkQRO22BPZ_cjs.a("flex max-w-[386px] flex-col",r),children:[jsxRuntime.jsxs("div",{className:chunkQRO22BPZ_cjs.a("relative h-60 rounded-md border",t),children:[a&&b?jsxRuntime.jsx(Ee__default.default,{image:a,crop:o.crop,zoom:o.zoom,aspect:o.aspect,objectFit:"contain",onCropChange:o.setCrop,onZoomChange:o.setZoom,onCropComplete:o.onCropComplete,onMediaLoaded:()=>p(true),showGrid:false}):a&&jsxRuntime.jsx("img",{alt:i,className:`m-auto h-full w-full object-contain transition-opacity duration-300 ${l?"opacity-100":"opacity-0"}`,src:a,onLoad:()=>p(true),draggable:false}),g&&jsxRuntime.jsx("div",{"aria-label":a?"Loading image":"Awaiting image",className:"from-grey-300 to-grey-300 absolute inset-0 animate-pulse bg-gradient-to-r"})]}),!g&&b&&jsxRuntime.jsxs("div",{className:"mt-3 flex flex-col items-center justify-between gap-1 px-1 sm:flex-row sm:gap-4",children:[jsxRuntime.jsxs("div",{className:"flex w-full items-center gap-3",children:[jsxRuntime.jsx(chunkIINNHABI_cjs.b,{"aria-label":"zoom out",onClick:()=>o.setZoom(Math.max(o.zoom-.1,1)),className:"h-8",variant:"ghost-icon",children:jsxRuntime.jsx(lu.LuZoomOut,{})}),jsxRuntime.jsx(chunk777NH37Z_cjs.a,{value:[o.zoom],min:1,max:3,step:.01,onValueChange:m=>o.setZoom(m[0]),className:"w-full sm:flex-50",classNames:{thumb:"border-2 border-green-800",range:"bg-green-900"}}),jsxRuntime.jsx(chunkIINNHABI_cjs.b,{"aria-label":"zoom in",onClick:()=>o.setZoom(Math.min(o.zoom+.1,3)),variant:"ghost-icon",className:"h-8",children:jsxRuntime.jsx(lu.LuZoomIn,{})})]}),jsxRuntime.jsxs(chunkIINNHABI_cjs.b,{onClick:o.reset,variant:"ghost",className:"h-8 p-2",children:[jsxRuntime.jsx(lu.LuRefreshCcw,{}),"Reset"]})]})]})};var re="00:00",ne="24:00",ae=i=>luxon.DateTime.fromFormat(i,"HH:mm").isValid,se=({startTime:i=re,endTime:r=ne,interval:t=30,onChange:a=void 0,className:o="",placeholder:l="Select one",size:p="default",portal:g=true,triggerIcon:b,getSublabel:m,...d})=>{ae(i)||(console.error(`Invalid startTime: ${i}`),i=re),ae(r)||(console.error(`Invalid endTime: ${r}`),r=ne);let x=react.useMemo(()=>{let e=luxon.DateTime.fromFormat(r,"HH:mm"),n=luxon.Duration.fromObject({minutes:t}),u=[],c=luxon.DateTime.fromFormat(i,"HH:mm");for(;c<=e;){let s=c.toFormat("HH:mm");s==="00:00"&&c.equals(e)&&(s="24:00"),u.push({label:c.toFormat("h:mm a"),value:{hour:c.toFormat("HH"),min:c.toFormat("mm"),raw:s,formatted:c.toFormat("h:mm a")}}),c=c.plus(n);}return u},[i,r,t]);return jsxRuntime.jsxs(chunkVJHFFAS4_cjs.a,{onValueChange:e=>{let n=x.find(u=>u.value.raw===e);n&&a?.(n);},...d,children:[jsxRuntime.jsx(chunkVJHFFAS4_cjs.d,{className:chunkQRO22BPZ_cjs.a("max-w-[240px] md:w-[150px]",o),size:p,triggerIcon:b,children:jsxRuntime.jsx(chunkVJHFFAS4_cjs.c,{placeholder:l})}),jsxRuntime.jsx(chunkVJHFFAS4_cjs.g,{position:"popper",className:"max-h-90",portal:g,children:x.map(e=>{let n=m?.(e);return jsxRuntime.jsx(chunkVJHFFAS4_cjs.i,{className:chunkQRO22BPZ_cjs.a(n?"h-auto py-2":"h-10"),value:e.value.raw,sublabel:n,children:e.label},e.value.raw)})})]})},Pt=se;var _e=i=>{let r="",t="",a="",o="",l="",p="";if(i.address_components.forEach(d=>{d.types.some(x=>{switch(x){case "locality":return r=d.long_name,true;case "sublocality":case "administrative_area_level_3":case "neighborhood":return r=r||d.long_name,true;case "administrative_area_level_1":return t=d.short_name,true;case "street_number":return a=d.short_name,true;case "route":return o=d.short_name,true;case "subpremise":return l=d.long_name,true;case "postal_code":return p=d.short_name,true;default:return false}});}),l){let d=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),x=i.formatted_address?.match(new RegExp(`(?<![A-Za-z])(?:Apt|Apartment|Suite|Ste|Unit|Bldg|Building|Fl|Floor|Rm|Room|Lot|Space|Spc|Trlr|Trailer|#)\\.?\\s*#?\\s*${d}\\b`,"i"));x&&(l=x[0].trim());}let g=i.geometry.location.lat(),b=i.geometry.location.lng(),m=`${a} ${o}`.trim();return {city:r,state:t,street:m,unit:l,zip:p,lat:g,long:b}},Oe=2,ze=({onSelectAddress:i=void 0,...r})=>{let t=react.useRef(null),a=react.useRef(`address-input-${Math.random().toString(36).slice(2)}-listbox`),[o,l]=react.useState(-1),{suggestions:{data:p=[]},setValue:g,clearSuggestions:b}=Be__default.default({requestOptions:{componentRestrictions:{country:"us"}}}),m=react.useCallback(()=>{b(),l(-1);},[b]);react.useEffect(()=>{let e=u=>{t.current&&!t.current.contains(u.target)&&m();},n=u=>{u.key==="Escape"&&m();};return p.length>0&&(document.addEventListener("mousedown",e),document.addEventListener("keydown",n)),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",n);}},[p.length,m]),react.useEffect(()=>{p.length===0?l(-1):l(e=>e<0?e:Math.min(e,p.length-1));},[p.length]);let d=e=>{g(e,false),m(),!(e.length<=Oe)&&Be.getGeocode({address:e}).then(n=>{if(!n||n.length===0)return;let u=_e(n[0]);i?.(u);});},x=react.useCallback(e=>{g(e),l(-1);},[g]),v=o>=0?`${a.current}-option-${o}`:void 0;return jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(chunk2DLCWPKO_cjs.b,{...r,onChange:e=>{r.onChange?.(e),x(e.target.value);},onKeyDown:e=>{if(r.onKeyDown?.(e),!e.defaultPrevented){if(!p.length){e.key==="Escape"&&m();return}if(e.key==="ArrowDown"){e.preventDefault(),l(n=>{let u=n+1;return u>=p.length||u<0?0:u});return}if(e.key==="ArrowUp"){e.preventDefault(),l(n=>n<=0?p.length-1:n-1);return}if(e.key==="Enter"&&o>=0){e.preventDefault();let n=p[o];n&&d(n.description);return}e.key==="Escape"&&(e.preventDefault(),m());}},role:"combobox","aria-expanded":p.length>0,"aria-controls":p.length>0?a.current:void 0,"aria-activedescendant":v,"aria-autocomplete":"list"}),p.length>0&&jsxRuntime.jsx("div",{ref:t,id:a.current,role:"listbox",className:"z-modal-stacking-context absolute mt-1 max-h-60 w-full overflow-auto rounded-md border border-gray-200 bg-white shadow-lg",children:p.map((e,n)=>{let u=`${a.current}-option-${n}`,c=n===o;return jsxRuntime.jsx("div",{id:u,role:"option","aria-selected":c,tabIndex:-1,className:`cursor-pointer px-3 py-2 text-sm hover:bg-green-100 ${c?"bg-green-100":""}`,onMouseEnter:()=>l(n),onMouseDown:s=>s.preventDefault(),onClick:()=>d(e.description),onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),d(e.description));},children:e.description},e.place_id)})})]})},$e=["places"],Ye=({googleMapsApiKey:i,onSelectAddress:r=void 0,...t})=>{let{isLoaded:a,loadError:o}=api.useLoadScript({googleMapsApiKey:i,libraries:$e});return !a||o?jsxRuntime.jsx(chunk2DLCWPKO_cjs.b,{...t}):jsxRuntime.jsx(ze,{onSelectAddress:r,...t})};exports.a=_e;exports.b=ze;exports.c=Ye;exports.d=Ce;exports.e=Ie;exports.f=Re;exports.g=se;exports.h=Pt;//# sourceMappingURL=chunk-CINH35OT.cjs.map
2
- //# sourceMappingURL=chunk-CINH35OT.cjs.map
1
+ 'use strict';var chunkVJHFFAS4_cjs=require('./chunk-VJHFFAS4.cjs'),chunk777NH37Z_cjs=require('./chunk-777NH37Z.cjs'),chunk2DLCWPKO_cjs=require('./chunk-2DLCWPKO.cjs'),chunkODAOIGPB_cjs=require('./chunk-ODAOIGPB.cjs'),chunkRTFBAC56_cjs=require('./chunk-RTFBAC56.cjs'),chunkIINNHABI_cjs=require('./chunk-IINNHABI.cjs'),chunkQRO22BPZ_cjs=require('./chunk-QRO22BPZ.cjs'),Be=require('use-places-autocomplete'),react=require('react'),api=require('@react-google-maps/api'),lu=require('react-icons/lu'),T=require('dayjs'),be=require('dayjs/plugin/customParseFormat.js'),reactImask=require('react-imask'),reactDayPicker=require('react-day-picker'),jsxRuntime=require('react/jsx-runtime'),Ee=require('react-easy-crop'),luxon=require('luxon');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Be__default=/*#__PURE__*/_interopDefault(Be);var T__default=/*#__PURE__*/_interopDefault(T);var be__default=/*#__PURE__*/_interopDefault(be);var Ee__default=/*#__PURE__*/_interopDefault(Ee);T__default.default.extend(be__default.default);var te="MM/DD/YYYY",De="00/00/0000",q=["MM/DD/YYYY","MM/D/YYYY","M/DD/YYYY","M/D/YYYY","YYYY-MM-DD"];function w(i){return i?T__default.default(i).format(te):""}function Ce({className:i="",wrapperClassName:r="",value:t=void 0,onChange:a=void 0,disabled:o=false,calendarProps:l=void 0,placeholder:p,inputProps:g=void 0,showCalendarIcon:b=true,editable:m=false}){let[d,x]=react.useState(false),v=p??(m?te:"Pick a date"),[e,n]=react.useState(void 0),u=react.useRef(t);t!==u.current&&(u.current=t,e!==void 0&&n(void 0));let c=e??t,s=f=>l?.disabled?!reactDayPicker.isMatch(f,l.disabled):true,D=react.useRef(a);D.current=a;let N=react.useRef(s);N.current=s;let{ref:W,setValue:B}=reactImask.useIMask({mask:De,lazy:true,overwrite:false},{onComplete:f=>{let C=T__default.default(f,q,true);C.isValid()&&N.current(C.toDate())&&D.current?.(C.toDate());}}),de=f=>{a?.(f),B(w(f)),x(false);},me=f=>{let C=f.clipboardData.getData("text").trim(),V=T__default.default(C,q,true);if(V.isValid()&&s(V.toDate())){f.preventDefault();let J=V.toDate();a?.(J),B(w(J));}},ue=()=>{B(w(t));},ce=()=>{let f=W.current?.value??"";if(f===""){t!==void 0&&a?.(void 0);return}let C=T__default.default(f,q,true);C.isValid()&&s(C.toDate())&&a?.(C.toDate()),B(w(t));},fe=chunkQRO22BPZ_cjs.a(chunk2DLCWPKO_cjs.a(),b&&"pl-10",d?"border-dark-green":"",i);return jsxRuntime.jsxs(chunkODAOIGPB_cjs.a,{open:!o&&d,onOpenChange:x,children:[jsxRuntime.jsx(chunkODAOIGPB_cjs.b,{asChild:true,children:jsxRuntime.jsxs("div",{className:chunkQRO22BPZ_cjs.a("relative flex w-full items-center rounded-md",r),children:[m?jsxRuntime.jsx("input",{ref:W,defaultValue:w(t),className:fe,placeholder:v,disabled:o,onFocus:ue,onPaste:me,onBlur:f=>{ce(),g?.onBlur?.(f);}}):jsxRuntime.jsx(chunk2DLCWPKO_cjs.b,{className:chunkQRO22BPZ_cjs.a(b&&"pl-10",d?"border-dark-green":"",i),...g,value:w(t),placeholder:v,readOnly:true,disabled:o}),b&&jsxRuntime.jsx("div",{className:chunkQRO22BPZ_cjs.a("absolute top-1/2 left-4 h-4 w-4 -translate-y-1/2",o?"text-gray-400":"cursor-pointer text-black"),children:jsxRuntime.jsx(lu.LuCalendar,{size:16})})]})}),jsxRuntime.jsx(chunkODAOIGPB_cjs.c,{className:"w-auto overflow-hidden p-0",align:"start",onOpenAutoFocus:m?f=>f.preventDefault():void 0,children:jsxRuntime.jsx(chunkRTFBAC56_cjs.b,{mode:"single",selected:t?T__default.default(t).toDate():void 0,onSelect:de,...m?{month:c,onMonthChange:n}:{},...l})})]})}function Pe(i){let r=i.replace(/\D/g,"").slice(0,8);return r.length<=2?r:r.length<=4?`${r.slice(0,2)}/${r.slice(2)}`:`${r.slice(0,2)}/${r.slice(2,4)}/${r.slice(4)}`}function Ie(i){if(i.length!==10)return;let r=i.split("/");if(r.length!==3||r[2].length!==4)return;let t=parseInt(r[0],10),a=parseInt(r[1],10),o=parseInt(r[2],10);if(Number.isNaN(t)||Number.isNaN(a)||Number.isNaN(o))return;let l=new Date(o,t-1,a);if(!(l.getFullYear()!==o||l.getMonth()!==t-1||l.getDate()!==a))return l}function we({className:i,wrapperClassName:r,value:t,onChange:a,disabled:o=false,calendarProps:l,placeholder:p="MM/DD/YYYY",variant:g}){let[b,m]=react.useState(false),[d,x]=react.useState(t),[v,e]=react.useState(t?T__default.default(t).format("MM/DD/YYYY"):""),n=react.useRef(t?T__default.default(t).format("MM/DD/YYYY"):"");react.useEffect(()=>{let s=t?T__default.default(t).format("MM/DD/YYYY"):"";s!==n.current&&(n.current=s,e(s),t&&x(t));},[t]);let u=s=>{let D=Pe(s.target.value);e(D);let N=Ie(D);N?(n.current=D,a?.(N)):D===""&&(n.current="",a?.(void 0));},c=s=>{s.key==="ArrowDown"&&(s.preventDefault(),m(true)),!/[0-9/]/.test(s.key)&&!["Backspace","Delete","ArrowLeft","ArrowRight","ArrowUp","Tab"].includes(s.key)&&!s.metaKey&&!s.ctrlKey&&s.preventDefault();};return jsxRuntime.jsxs("div",{className:chunkQRO22BPZ_cjs.a("relative w-full",r),children:[jsxRuntime.jsx("input",{type:"text","data-slot":"input",className:chunkQRO22BPZ_cjs.a(chunk2DLCWPKO_cjs.a({variant:g}),"pr-10",i),value:v,placeholder:p,onChange:u,onKeyDown:c,disabled:o}),jsxRuntime.jsxs(chunkODAOIGPB_cjs.a,{open:!o&&b,onOpenChange:m,children:[jsxRuntime.jsx(chunkODAOIGPB_cjs.b,{asChild:true,children:jsxRuntime.jsx(chunkIINNHABI_cjs.b,{variant:"ghost-icon",size:"sm",className:"absolute top-1/2 right-1 -translate-y-1/2",disabled:o,"aria-label":"Select date",type:"button",children:jsxRuntime.jsx(lu.LuCalendar,{})})}),jsxRuntime.jsx(chunkODAOIGPB_cjs.c,{className:"w-auto overflow-hidden p-0",align:"end",sideOffset:10,children:jsxRuntime.jsx(chunkRTFBAC56_cjs.b,{mode:"single",selected:t,month:d,onMonthChange:x,onSelect:s=>{let D=s?T__default.default(s).format("MM/DD/YYYY"):"";n.current=D,e(D),a?.(s),m(false);},...l})})]})]})}var Re=({alt:i,className:r="",containerClassName:t="",imagePreview:a=void 0,cropper:o=void 0})=>{let[l,p]=react.useState(false),g=!a||!l,b=!!o;return jsxRuntime.jsxs("div",{className:chunkQRO22BPZ_cjs.a("flex max-w-[386px] flex-col",r),children:[jsxRuntime.jsxs("div",{className:chunkQRO22BPZ_cjs.a("relative h-60 rounded-md border",t),children:[a&&b?jsxRuntime.jsx(Ee__default.default,{image:a,crop:o.crop,zoom:o.zoom,aspect:o.aspect,objectFit:"contain",onCropChange:o.setCrop,onZoomChange:o.setZoom,onCropComplete:o.onCropComplete,onMediaLoaded:()=>p(true),showGrid:false}):a&&jsxRuntime.jsx("img",{alt:i,className:`m-auto h-full w-full object-contain transition-opacity duration-300 ${l?"opacity-100":"opacity-0"}`,src:a,onLoad:()=>p(true),draggable:false}),g&&jsxRuntime.jsx("div",{"aria-label":a?"Loading image":"Awaiting image",className:"from-grey-300 to-grey-300 absolute inset-0 animate-pulse bg-gradient-to-r"})]}),!g&&b&&jsxRuntime.jsxs("div",{className:"mt-3 flex flex-col items-center justify-between gap-1 px-1 sm:flex-row sm:gap-4",children:[jsxRuntime.jsxs("div",{className:"flex w-full items-center gap-3",children:[jsxRuntime.jsx(chunkIINNHABI_cjs.b,{"aria-label":"zoom out",onClick:()=>o.setZoom(Math.max(o.zoom-.1,1)),className:"h-8",variant:"ghost-icon",children:jsxRuntime.jsx(lu.LuZoomOut,{})}),jsxRuntime.jsx(chunk777NH37Z_cjs.a,{value:[o.zoom],min:1,max:3,step:.01,onValueChange:m=>o.setZoom(m[0]),className:"w-full sm:flex-50",classNames:{thumb:"border-2 border-green-800",range:"bg-green-900"}}),jsxRuntime.jsx(chunkIINNHABI_cjs.b,{"aria-label":"zoom in",onClick:()=>o.setZoom(Math.min(o.zoom+.1,3)),variant:"ghost-icon",className:"h-8",children:jsxRuntime.jsx(lu.LuZoomIn,{})})]}),jsxRuntime.jsxs(chunkIINNHABI_cjs.b,{onClick:o.reset,variant:"ghost",className:"h-8 p-2",children:[jsxRuntime.jsx(lu.LuRefreshCcw,{}),"Reset"]})]})]})};var re="00:00",ne="24:00",ae=i=>luxon.DateTime.fromFormat(i,"HH:mm").isValid,se=({startTime:i=re,endTime:r=ne,interval:t=30,onChange:a=void 0,className:o="",placeholder:l="Select one",size:p="default",portal:g=true,triggerIcon:b,getSublabel:m,...d})=>{ae(i)||(console.error(`Invalid startTime: ${i}`),i=re),ae(r)||(console.error(`Invalid endTime: ${r}`),r=ne);let x=react.useMemo(()=>{let e=luxon.DateTime.fromFormat(r,"HH:mm"),n=luxon.Duration.fromObject({minutes:t}),u=[],c=luxon.DateTime.fromFormat(i,"HH:mm");for(;c<=e;){let s=c.toFormat("HH:mm");s==="00:00"&&c.equals(e)&&(s="24:00"),u.push({label:c.toFormat("h:mm a"),value:{hour:c.toFormat("HH"),min:c.toFormat("mm"),raw:s,formatted:c.toFormat("h:mm a")}}),c=c.plus(n);}return u},[i,r,t]);return jsxRuntime.jsxs(chunkVJHFFAS4_cjs.a,{onValueChange:e=>{let n=x.find(u=>u.value.raw===e);n&&a?.(n);},...d,children:[jsxRuntime.jsx(chunkVJHFFAS4_cjs.d,{className:chunkQRO22BPZ_cjs.a("max-w-[240px] md:w-[150px]",o),size:p,triggerIcon:b,children:jsxRuntime.jsx(chunkVJHFFAS4_cjs.c,{placeholder:l})}),jsxRuntime.jsx(chunkVJHFFAS4_cjs.g,{position:"popper",className:"max-h-90",portal:g,children:x.map(e=>{let n=m?.(e);return jsxRuntime.jsx(chunkVJHFFAS4_cjs.i,{className:chunkQRO22BPZ_cjs.a(n?"h-auto py-2":"h-10"),value:e.value.raw,sublabel:n,children:e.label},e.value.raw)})})]})},Pt=se;var _e=i=>{let r="",t="",a="",o="",l="",p="";if(i.address_components.forEach(d=>{d.types.some(x=>{switch(x){case "locality":return r=d.long_name,true;case "sublocality":case "administrative_area_level_3":case "neighborhood":return r=r||d.long_name,true;case "administrative_area_level_1":return t=d.short_name,true;case "street_number":return a=d.short_name,true;case "route":return o=d.short_name,true;case "subpremise":return l=d.long_name,true;case "postal_code":return p=d.short_name,true;default:return false}});}),l){let d=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),x=i.formatted_address?.match(new RegExp(`(?<![A-Za-z])(?:Apt|Apartment|Suite|Ste|Unit|Bldg|Building|Fl|Floor|Rm|Room|Lot|Space|Spc|Trlr|Trailer|#)\\.?\\s*#?\\s*${d}\\b`,"i"));x&&(l=x[0].trim());}let g=i.geometry.location.lat(),b=i.geometry.location.lng(),m=`${a} ${o}`.trim();return {city:r,state:t,street:m,unit:l,zip:p,lat:g,long:b}},Oe=2,ze=({onSelectAddress:i=void 0,...r})=>{let t=react.useRef(null),a=react.useRef(`address-input-${Math.random().toString(36).slice(2)}-listbox`),[o,l]=react.useState(-1),{suggestions:{data:p=[]},setValue:g,clearSuggestions:b}=Be__default.default({requestOptions:{componentRestrictions:{country:"us"}}}),m=react.useCallback(()=>{b(),l(-1);},[b]);react.useEffect(()=>{let e=u=>{t.current&&!t.current.contains(u.target)&&m();},n=u=>{u.key==="Escape"&&m();};return p.length>0&&(document.addEventListener("mousedown",e),document.addEventListener("keydown",n)),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",n);}},[p.length,m]),react.useEffect(()=>{p.length===0?l(-1):l(e=>e<0?e:Math.min(e,p.length-1));},[p.length]);let d=e=>{g(e,false),m(),!(e.length<=Oe)&&Be.getGeocode({address:e}).then(n=>{if(!n||n.length===0)return;let u=_e(n[0]);i?.(u);});},x=react.useCallback(e=>{g(e),l(-1);},[g]),v=o>=0?`${a.current}-option-${o}`:void 0;return jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(chunk2DLCWPKO_cjs.b,{...r,onChange:e=>{r.onChange?.(e),x(e.target.value);},onKeyDown:e=>{if(r.onKeyDown?.(e),!e.defaultPrevented){if(!p.length){e.key==="Escape"&&m();return}if(e.key==="ArrowDown"){e.preventDefault(),l(n=>{let u=n+1;return u>=p.length||u<0?0:u});return}if(e.key==="ArrowUp"){e.preventDefault(),l(n=>n<=0?p.length-1:n-1);return}if(e.key==="Enter"&&o>=0){e.preventDefault();let n=p[o];n&&d(n.description);return}e.key==="Escape"&&(e.preventDefault(),m());}},role:"combobox","aria-expanded":p.length>0,"aria-controls":p.length>0?a.current:void 0,"aria-activedescendant":v,"aria-autocomplete":"list"}),p.length>0&&jsxRuntime.jsx("div",{ref:t,id:a.current,role:"listbox",className:"z-modal-stacking-context absolute mt-1 max-h-60 w-full overflow-auto rounded-md border border-gray-200 bg-white shadow-lg",children:p.map((e,n)=>{let u=`${a.current}-option-${n}`,c=n===o;return jsxRuntime.jsx("div",{id:u,role:"option","aria-selected":c,tabIndex:-1,className:`cursor-pointer px-3 py-2 text-sm hover:bg-green-100 ${c?"bg-green-100":""}`,onMouseEnter:()=>l(n),onMouseDown:s=>s.preventDefault(),onClick:()=>d(e.description),onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),d(e.description));},children:e.description},e.place_id)})})]})},$e=["places"],Ye=({googleMapsApiKey:i,onSelectAddress:r=void 0,...t})=>{let{isLoaded:a,loadError:o}=api.useLoadScript({googleMapsApiKey:i,libraries:$e});return !a||o?jsxRuntime.jsx(chunk2DLCWPKO_cjs.b,{...t}):jsxRuntime.jsx(ze,{onSelectAddress:r,...t})};exports.a=_e;exports.b=ze;exports.c=Ye;exports.d=Ce;exports.e=we;exports.f=Re;exports.g=se;exports.h=Pt;//# sourceMappingURL=chunk-IJ7FBO3U.cjs.map
2
+ //# sourceMappingURL=chunk-IJ7FBO3U.cjs.map