@commercetools/nimbus 2.0.1-rc3 → 2.0.1

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 (325) hide show
  1. package/dist/chunks/{accordion-CKDnNkVv.es.js → accordion-CrISuCHH.es.js} +2 -2
  2. package/dist/chunks/accordion-CrISuCHH.es.js.map +1 -0
  3. package/dist/chunks/accordion-D7a9HHSH.cjs.js +2 -0
  4. package/dist/chunks/accordion-D7a9HHSH.cjs.js.map +1 -0
  5. package/dist/chunks/calendar-0Tr21POc.cjs.js +2 -0
  6. package/dist/chunks/calendar-0Tr21POc.cjs.js.map +1 -0
  7. package/dist/chunks/{calendar-lD6G93R9.es.js → calendar-okvAi9qK.es.js} +2 -2
  8. package/dist/chunks/calendar-okvAi9qK.es.js.map +1 -0
  9. package/dist/chunks/{checkbox-BB-WJdal.es.js → checkbox-Bp0eyZ6q.es.js} +2 -2
  10. package/dist/chunks/{checkbox-BB-WJdal.es.js.map → checkbox-Bp0eyZ6q.es.js.map} +1 -1
  11. package/dist/chunks/checkbox-QQkdNVJO.cjs.js +2 -0
  12. package/dist/chunks/{checkbox-Dod-yTj4.cjs.js.map → checkbox-QQkdNVJO.cjs.js.map} +1 -1
  13. package/dist/chunks/collapsible-motion-CykDlHn3.cjs.js +2 -0
  14. package/dist/chunks/collapsible-motion-CykDlHn3.cjs.js.map +1 -0
  15. package/dist/chunks/{collapsible-motion-CSrKjF8X.es.js → collapsible-motion-DPqgzRWq.es.js} +2 -2
  16. package/dist/chunks/collapsible-motion-DPqgzRWq.es.js.map +1 -0
  17. package/dist/chunks/combobox-Bntl4sYo.cjs.js +2 -0
  18. package/dist/chunks/{combobox-B5UxZWSX.cjs.js.map → combobox-Bntl4sYo.cjs.js.map} +1 -1
  19. package/dist/chunks/{combobox-D_7gr3DY.es.js → combobox-DYREbkL7.es.js} +2 -2
  20. package/dist/chunks/{combobox-D_7gr3DY.es.js.map → combobox-DYREbkL7.es.js.map} +1 -1
  21. package/dist/chunks/data-table-BhV1DJXJ.cjs.js +2 -0
  22. package/dist/chunks/{data-table-C51WU0Cc.cjs.js.map → data-table-BhV1DJXJ.cjs.js.map} +1 -1
  23. package/dist/chunks/{data-table-ClMivKY1.es.js → data-table-TSza8b10.es.js} +4 -4
  24. package/dist/chunks/{data-table-ClMivKY1.es.js.map → data-table-TSza8b10.es.js.map} +1 -1
  25. package/dist/chunks/date-input-B84sXbjL.cjs.js +2 -0
  26. package/dist/chunks/date-input-B84sXbjL.cjs.js.map +1 -0
  27. package/dist/chunks/{date-input-Cap8-3zj.es.js → date-input-BiOdvpWz.es.js} +2 -2
  28. package/dist/chunks/date-input-BiOdvpWz.es.js.map +1 -0
  29. package/dist/chunks/date-picker-2SDD5gY9.cjs.js +2 -0
  30. package/dist/chunks/{date-picker-CZAoPNsT.cjs.js.map → date-picker-2SDD5gY9.cjs.js.map} +1 -1
  31. package/dist/chunks/{date-picker-ChZ8H-MT.es.js → date-picker-EuMU6RtR.es.js} +5 -5
  32. package/dist/chunks/{date-picker-ChZ8H-MT.es.js.map → date-picker-EuMU6RtR.es.js.map} +1 -1
  33. package/dist/chunks/{date-range-picker-DGWMdcAN.es.js → date-range-picker-CL-QH8BW.es.js} +5 -5
  34. package/dist/chunks/{date-range-picker-DGWMdcAN.es.js.map → date-range-picker-CL-QH8BW.es.js.map} +1 -1
  35. package/dist/chunks/date-range-picker-DmHmhMvU.cjs.js +2 -0
  36. package/dist/chunks/{date-range-picker-iENzosfN.cjs.js.map → date-range-picker-DmHmhMvU.cjs.js.map} +1 -1
  37. package/dist/chunks/{dialog-CKwC3dk3.cjs.js → dialog-BeKbQUsU.cjs.js} +2 -2
  38. package/dist/chunks/{dialog-CKwC3dk3.cjs.js.map → dialog-BeKbQUsU.cjs.js.map} +1 -1
  39. package/dist/chunks/{dialog-BwtIcIvd.es.js → dialog-C9Dn6GoU.es.js} +2 -2
  40. package/dist/chunks/{dialog-BwtIcIvd.es.js.map → dialog-C9Dn6GoU.es.js.map} +1 -1
  41. package/dist/chunks/{dialog.title-CP_ZeiK4.es.js → dialog.title-CfBfNT9q.es.js} +2 -2
  42. package/dist/chunks/dialog.title-CfBfNT9q.es.js.map +1 -0
  43. package/dist/chunks/dialog.title-CynBe3KN.cjs.js +2 -0
  44. package/dist/chunks/dialog.title-CynBe3KN.cjs.js.map +1 -0
  45. package/dist/chunks/{draggable-list-s43baxoM.es.js → draggable-list-3KlajQgQ.es.js} +3 -3
  46. package/dist/chunks/{draggable-list-s43baxoM.es.js.map → draggable-list-3KlajQgQ.es.js.map} +1 -1
  47. package/dist/chunks/{draggable-list-MGvr5-A-.cjs.js → draggable-list-uMR8JUsT.cjs.js} +2 -2
  48. package/dist/chunks/{draggable-list-MGvr5-A-.cjs.js.map → draggable-list-uMR8JUsT.cjs.js.map} +1 -1
  49. package/dist/chunks/{drawer-BJ4qvGnj.es.js → drawer-CT5qAdLo.es.js} +2 -2
  50. package/dist/chunks/drawer-CT5qAdLo.es.js.map +1 -0
  51. package/dist/chunks/drawer-vgDYdzlq.cjs.js +2 -0
  52. package/dist/chunks/drawer-vgDYdzlq.cjs.js.map +1 -0
  53. package/dist/chunks/{extractStyleProps-DYXEhLtq.es.js → extract-style-props-DYXEhLtq.es.js} +1 -1
  54. package/dist/chunks/extract-style-props-DYXEhLtq.es.js.map +1 -0
  55. package/dist/chunks/{extractStyleProps-Dk3fpLyQ.cjs.js → extract-style-props-Dk3fpLyQ.cjs.js} +1 -1
  56. package/dist/chunks/extract-style-props-Dk3fpLyQ.cjs.js.map +1 -0
  57. package/dist/chunks/group-BqUFlw5R.cjs.js.map +1 -1
  58. package/dist/chunks/group-CWADf2vF.es.js.map +1 -1
  59. package/dist/chunks/icon-CenxuChf.es.js.map +1 -1
  60. package/dist/chunks/icon-D39U--jA.cjs.js.map +1 -1
  61. package/dist/chunks/{icon-toggle-button-Bi-9Obfx.es.js → icon-toggle-button-Bt_1Mdus.es.js} +2 -2
  62. package/dist/chunks/{icon-toggle-button-Bi-9Obfx.es.js.map → icon-toggle-button-Bt_1Mdus.es.js.map} +1 -1
  63. package/dist/chunks/{icon-toggle-button-eLrsWehe.cjs.js → icon-toggle-button-Bv-FwWwz.cjs.js} +2 -2
  64. package/dist/chunks/{icon-toggle-button-eLrsWehe.cjs.js.map → icon-toggle-button-Bv-FwWwz.cjs.js.map} +1 -1
  65. package/dist/chunks/kbd-BaeV_DL-.cjs.js.map +1 -1
  66. package/dist/chunks/kbd-CH9rYghB.es.js.map +1 -1
  67. package/dist/chunks/{localized-field-D3G0Uy7Z.es.js → localized-field-Bp4N2Mvl.es.js} +5 -5
  68. package/dist/chunks/{localized-field-D3G0Uy7Z.es.js.map → localized-field-Bp4N2Mvl.es.js.map} +1 -1
  69. package/dist/chunks/{localized-field-C7Vribb2.cjs.js → localized-field-Cmwb6fmQ.cjs.js} +2 -2
  70. package/dist/chunks/{localized-field-C7Vribb2.cjs.js.map → localized-field-Cmwb6fmQ.cjs.js.map} +1 -1
  71. package/dist/chunks/menu-SXtkybBB.cjs.js +2 -0
  72. package/dist/chunks/menu-SXtkybBB.cjs.js.map +1 -0
  73. package/dist/chunks/{menu-D-vE6ZpM.es.js → menu-XKnGXngu.es.js} +2 -2
  74. package/dist/chunks/menu-XKnGXngu.es.js.map +1 -0
  75. package/dist/chunks/{money-input-sk0Slpeu.es.js → money-input-BqYBGLzc.es.js} +4 -4
  76. package/dist/chunks/{money-input-sk0Slpeu.es.js.map → money-input-BqYBGLzc.es.js.map} +1 -1
  77. package/dist/chunks/money-input-Cz8E18lq.cjs.js +2 -0
  78. package/dist/chunks/{money-input-Cu_J86Eu.cjs.js.map → money-input-Cz8E18lq.cjs.js.map} +1 -1
  79. package/dist/chunks/{multiline-text-input-CilSJJaO.es.js → multiline-text-input-AyyHGKY2.es.js} +2 -2
  80. package/dist/chunks/multiline-text-input-AyyHGKY2.es.js.map +1 -0
  81. package/dist/chunks/multiline-text-input-jGidPD3q.cjs.js +2 -0
  82. package/dist/chunks/multiline-text-input-jGidPD3q.cjs.js.map +1 -0
  83. package/dist/chunks/number-input-CynG_F-c.cjs.js +2 -0
  84. package/dist/chunks/{number-input-wMW-o4di.cjs.js.map → number-input-CynG_F-c.cjs.js.map} +1 -1
  85. package/dist/chunks/{number-input-CktMxOdZ.es.js → number-input-rotBI7ui.es.js} +2 -2
  86. package/dist/chunks/{number-input-CktMxOdZ.es.js.map → number-input-rotBI7ui.es.js.map} +1 -1
  87. package/dist/chunks/{pagination-BWdg8s6g.cjs.js → pagination-DdMhz-Ka.cjs.js} +2 -2
  88. package/dist/chunks/{pagination-BWdg8s6g.cjs.js.map → pagination-DdMhz-Ka.cjs.js.map} +1 -1
  89. package/dist/chunks/{pagination-Bcq69Nv3.es.js → pagination-Dqt0f5WQ.es.js} +3 -3
  90. package/dist/chunks/{pagination-Bcq69Nv3.es.js.map → pagination-Dqt0f5WQ.es.js.map} +1 -1
  91. package/dist/chunks/{password-input-6SMjhXSO.cjs.js → password-input-BVHKD6s2.cjs.js} +2 -2
  92. package/dist/chunks/{password-input-6SMjhXSO.cjs.js.map → password-input-BVHKD6s2.cjs.js.map} +1 -1
  93. package/dist/chunks/{password-input-6MO4I-2j.es.js → password-input-DRmX3C3I.es.js} +2 -2
  94. package/dist/chunks/{password-input-6MO4I-2j.es.js.map → password-input-DRmX3C3I.es.js.map} +1 -1
  95. package/dist/chunks/popover-CfEq5G5-.cjs.js.map +1 -1
  96. package/dist/chunks/popover-DNaC7CwB.es.js.map +1 -1
  97. package/dist/chunks/progress-bar-CmQaITmw.cjs.js +2 -0
  98. package/dist/chunks/progress-bar-CmQaITmw.cjs.js.map +1 -0
  99. package/dist/chunks/{progress-bar-DwuOjOcH.es.js → progress-bar-DGFMl3Vg.es.js} +2 -2
  100. package/dist/chunks/progress-bar-DGFMl3Vg.es.js.map +1 -0
  101. package/dist/chunks/radio-input-Cg5MZ21w.cjs.js +2 -0
  102. package/dist/chunks/{radio-input-Dp05SXja.cjs.js.map → radio-input-Cg5MZ21w.cjs.js.map} +1 -1
  103. package/dist/chunks/{radio-input-4jw6HUjC.es.js → radio-input-DPwU5M16.es.js} +2 -2
  104. package/dist/chunks/{radio-input-4jw6HUjC.es.js.map → radio-input-DPwU5M16.es.js.map} +1 -1
  105. package/dist/chunks/{range-calendar-DBpl6y5i.es.js → range-calendar-PUt59Hda.es.js} +2 -2
  106. package/dist/chunks/range-calendar-PUt59Hda.es.js.map +1 -0
  107. package/dist/chunks/range-calendar-lhmomEF_.cjs.js +2 -0
  108. package/dist/chunks/range-calendar-lhmomEF_.cjs.js.map +1 -0
  109. package/dist/chunks/{rich-text-input-BC8CBVio.es.js → rich-text-input-Cm0M04n-.es.js} +6 -6
  110. package/dist/chunks/rich-text-input-Cm0M04n-.es.js.map +1 -0
  111. package/dist/chunks/{rich-text-input-Da5WFZ3l.cjs.js → rich-text-input-DqwZD5Di.cjs.js} +2 -2
  112. package/dist/chunks/rich-text-input-DqwZD5Di.cjs.js.map +1 -0
  113. package/dist/chunks/search-input-BvJKOCVM.cjs.js +2 -0
  114. package/dist/chunks/{search-input-BefkmgPy.cjs.js.map → search-input-BvJKOCVM.cjs.js.map} +1 -1
  115. package/dist/chunks/{search-input-DJy2NHYW.es.js → search-input-C8cD1bnn.es.js} +2 -2
  116. package/dist/chunks/{search-input-DJy2NHYW.es.js.map → search-input-C8cD1bnn.es.js.map} +1 -1
  117. package/dist/chunks/select-DfuSGQSs.cjs.js +2 -0
  118. package/dist/chunks/{select-DMsU6bk9.cjs.js.map → select-DfuSGQSs.cjs.js.map} +1 -1
  119. package/dist/chunks/{select-BmMhTBo-.es.js → select-X1qJU5Yn.es.js} +2 -2
  120. package/dist/chunks/{select-BmMhTBo-.es.js.map → select-X1qJU5Yn.es.js.map} +1 -1
  121. package/dist/chunks/{separator-DJGUFG-o.es.js → separator-BHD3Ztot.es.js} +2 -2
  122. package/dist/chunks/separator-BHD3Ztot.es.js.map +1 -0
  123. package/dist/chunks/separator-FEY8A05K.cjs.js +2 -0
  124. package/dist/chunks/separator-FEY8A05K.cjs.js.map +1 -0
  125. package/dist/chunks/{split-button-BxyZmuNi.es.js → split-button-LENwoBTF.es.js} +2 -2
  126. package/dist/chunks/split-button-LENwoBTF.es.js.map +1 -0
  127. package/dist/chunks/{split-button-BO52sL7h.cjs.js → split-button-go3Ez6Ea.cjs.js} +2 -2
  128. package/dist/chunks/split-button-go3Ez6Ea.cjs.js.map +1 -0
  129. package/dist/chunks/{switch-01hEhL9A.es.js → switch-BDRu376G.es.js} +2 -2
  130. package/dist/chunks/switch-BDRu376G.es.js.map +1 -0
  131. package/dist/chunks/switch-RPIMfaqs.cjs.js +2 -0
  132. package/dist/chunks/switch-RPIMfaqs.cjs.js.map +1 -0
  133. package/dist/chunks/{tabs-Dhte-RCe.es.js → tabs-BtWK-J_p.es.js} +2 -2
  134. package/dist/chunks/{tabs-Dhte-RCe.es.js.map → tabs-BtWK-J_p.es.js.map} +1 -1
  135. package/dist/chunks/tabs-CEB3Dfex.cjs.js +2 -0
  136. package/dist/chunks/{tabs-CJ0OAUSR.cjs.js.map → tabs-CEB3Dfex.cjs.js.map} +1 -1
  137. package/dist/chunks/tag-group-Btt0egzG.cjs.js.map +1 -1
  138. package/dist/chunks/tag-group-D2dgXSsV.es.js.map +1 -1
  139. package/dist/chunks/text-input-CKGfCx6k.cjs.js +2 -0
  140. package/dist/chunks/text-input-CKGfCx6k.cjs.js.map +1 -0
  141. package/dist/chunks/{text-input-CSAODlCw.es.js → text-input-DNorjU50.es.js} +2 -2
  142. package/dist/chunks/text-input-DNorjU50.es.js.map +1 -0
  143. package/dist/chunks/{time-input--a_qv-Jk.es.js → time-input-B6we5H7C.es.js} +2 -2
  144. package/dist/chunks/time-input-B6we5H7C.es.js.map +1 -0
  145. package/dist/chunks/time-input-CweVZv1Q.cjs.js +2 -0
  146. package/dist/chunks/time-input-CweVZv1Q.cjs.js.map +1 -0
  147. package/dist/chunks/toggle-button-CLEgCPGX.cjs.js +2 -0
  148. package/dist/chunks/toggle-button-CLEgCPGX.cjs.js.map +1 -0
  149. package/dist/chunks/{toggle-button-awb1jBf8.es.js → toggle-button-D3M4e72c.es.js} +2 -2
  150. package/dist/chunks/toggle-button-D3M4e72c.es.js.map +1 -0
  151. package/dist/chunks/{toolbar-Dduysqqi.es.js → toolbar-Bn9pAwjU.es.js} +2 -2
  152. package/dist/chunks/toolbar-Bn9pAwjU.es.js.map +1 -0
  153. package/dist/chunks/toolbar-D3Jj83mp.cjs.js +2 -0
  154. package/dist/chunks/{toolbar-DV0l5MqA.cjs.js.map → toolbar-D3Jj83mp.cjs.js.map} +1 -1
  155. package/dist/chunks/tooltip-BPTOkK7W.cjs.js.map +1 -1
  156. package/dist/chunks/tooltip-sgakxhiy.es.js.map +1 -1
  157. package/dist/components/accordion/accordion.slots.d.ts +1 -1
  158. package/dist/components/accordion/accordion.types.d.ts +4 -4
  159. package/dist/components/accordion.cjs +1 -1
  160. package/dist/components/accordion.es.js +1 -1
  161. package/dist/components/calendar/calendar.slots.d.ts +1 -1
  162. package/dist/components/calendar.cjs +1 -1
  163. package/dist/components/calendar.es.js +1 -1
  164. package/dist/components/checkbox.cjs +1 -1
  165. package/dist/components/checkbox.es.js +1 -1
  166. package/dist/components/collapsible-motion/collapsible-motion.slots.d.ts +1 -1
  167. package/dist/components/collapsible-motion.cjs +1 -1
  168. package/dist/components/collapsible-motion.es.js +1 -1
  169. package/dist/components/combobox/combobox.slots.d.ts +1 -1
  170. package/dist/components/combobox.cjs +1 -1
  171. package/dist/components/combobox.es.js +1 -1
  172. package/dist/components/components.cjs +1 -1
  173. package/dist/components/components.es.js +1 -1
  174. package/dist/components/data-table.cjs +1 -1
  175. package/dist/components/data-table.es.js +1 -1
  176. package/dist/components/date-input.cjs +1 -1
  177. package/dist/components/date-input.es.js +1 -1
  178. package/dist/components/date-picker.cjs +1 -1
  179. package/dist/components/date-picker.es.js +1 -1
  180. package/dist/components/date-range-picker.cjs +1 -1
  181. package/dist/components/date-range-picker.es.js +1 -1
  182. package/dist/components/dialog.cjs +1 -1
  183. package/dist/components/dialog.es.js +1 -1
  184. package/dist/components/draggable-list.cjs +1 -1
  185. package/dist/components/draggable-list.es.js +1 -1
  186. package/dist/components/drawer.cjs +1 -1
  187. package/dist/components/drawer.es.js +1 -1
  188. package/dist/components/group/group.slots.d.ts +1 -1
  189. package/dist/components/icon/icon.slots.d.ts +1 -1
  190. package/dist/components/icon-toggle-button.cjs +1 -1
  191. package/dist/components/icon-toggle-button.es.js +1 -1
  192. package/dist/components/kbd/kbd.slots.d.ts +1 -1
  193. package/dist/components/localized-field.cjs +1 -1
  194. package/dist/components/localized-field.es.js +1 -1
  195. package/dist/components/menu/menu.slots.d.ts +1 -1
  196. package/dist/components/money-input.cjs +1 -1
  197. package/dist/components/money-input.es.js +1 -1
  198. package/dist/components/multiline-text-input.cjs +1 -1
  199. package/dist/components/multiline-text-input.es.js +1 -1
  200. package/dist/components/number-input.cjs +1 -1
  201. package/dist/components/number-input.es.js +1 -1
  202. package/dist/components/pagination.cjs +1 -1
  203. package/dist/components/pagination.es.js +1 -1
  204. package/dist/components/password-input.cjs +1 -1
  205. package/dist/components/password-input.es.js +1 -1
  206. package/dist/components/popover/popover.slots.d.ts +1 -1
  207. package/dist/components/progress-bar.cjs +1 -1
  208. package/dist/components/progress-bar.es.js +1 -1
  209. package/dist/components/radio-input.cjs +1 -1
  210. package/dist/components/radio-input.es.js +1 -1
  211. package/dist/components/range-calendar/range-calendar.slots.d.ts +1 -1
  212. package/dist/components/range-calendar.cjs +1 -1
  213. package/dist/components/range-calendar.es.js +1 -1
  214. package/dist/components/rich-text-input/rich-text-input.slots.d.ts +1 -1
  215. package/dist/components/rich-text-input.cjs +1 -1
  216. package/dist/components/rich-text-input.es.js +1 -1
  217. package/dist/components/scoped-search-input.cjs +1 -1
  218. package/dist/components/scoped-search-input.cjs.map +1 -1
  219. package/dist/components/scoped-search-input.es.js +3 -3
  220. package/dist/components/scoped-search-input.es.js.map +1 -1
  221. package/dist/components/search-input.cjs +1 -1
  222. package/dist/components/search-input.es.js +1 -1
  223. package/dist/components/select.cjs +1 -1
  224. package/dist/components/select.es.js +1 -1
  225. package/dist/components/separator/separator.slots.d.ts +1 -1
  226. package/dist/components/separator.cjs +1 -1
  227. package/dist/components/separator.es.js +1 -1
  228. package/dist/components/split-button/split-button.slots.d.ts +1 -1
  229. package/dist/components/split-button.cjs +1 -1
  230. package/dist/components/split-button.es.js +1 -1
  231. package/dist/components/switch/switch.slots.d.ts +1 -1
  232. package/dist/components/switch.cjs +1 -1
  233. package/dist/components/switch.es.js +1 -1
  234. package/dist/components/tabs/tabs.slots.d.ts +1 -1
  235. package/dist/components/tabs.cjs +1 -1
  236. package/dist/components/tabs.es.js +1 -1
  237. package/dist/components/tag-group/tag-group.slots.d.ts +1 -1
  238. package/dist/components/text-input.cjs +1 -1
  239. package/dist/components/text-input.es.js +1 -1
  240. package/dist/components/time-input.cjs +1 -1
  241. package/dist/components/time-input.es.js +1 -1
  242. package/dist/components/toggle-button.cjs +1 -1
  243. package/dist/components/toggle-button.es.js +1 -1
  244. package/dist/components/toolbar.cjs +1 -1
  245. package/dist/components/toolbar.es.js +1 -1
  246. package/dist/components/tooltip/tooltip.slots.d.ts +1 -1
  247. package/dist/components/tooltip/tooltip.types.d.ts +2 -2
  248. package/dist/index.cjs +1 -1
  249. package/dist/index.cjs.map +1 -1
  250. package/dist/index.d.ts +1 -1
  251. package/dist/index.es.js +197 -202
  252. package/dist/index.es.js.map +1 -1
  253. package/dist/type-utils/index.d.ts +2 -0
  254. package/dist/{components/utils/type-helpers.d.ts → type-utils/omit-props.d.ts} +5 -5
  255. package/dist/utils/extract-aria-attributes.d.ts +6 -0
  256. package/dist/utils/index.d.ts +3 -3
  257. package/package.json +5 -5
  258. package/dist/chunks/accordion-B2FLWAh5.cjs.js +0 -2
  259. package/dist/chunks/accordion-B2FLWAh5.cjs.js.map +0 -1
  260. package/dist/chunks/accordion-CKDnNkVv.es.js.map +0 -1
  261. package/dist/chunks/calendar-V0KeNCQ3.cjs.js +0 -2
  262. package/dist/chunks/calendar-V0KeNCQ3.cjs.js.map +0 -1
  263. package/dist/chunks/calendar-lD6G93R9.es.js.map +0 -1
  264. package/dist/chunks/checkbox-Dod-yTj4.cjs.js +0 -2
  265. package/dist/chunks/collapsible-motion-C7M_CLNI.cjs.js +0 -2
  266. package/dist/chunks/collapsible-motion-C7M_CLNI.cjs.js.map +0 -1
  267. package/dist/chunks/collapsible-motion-CSrKjF8X.es.js.map +0 -1
  268. package/dist/chunks/combobox-B5UxZWSX.cjs.js +0 -2
  269. package/dist/chunks/data-table-C51WU0Cc.cjs.js +0 -2
  270. package/dist/chunks/date-input-Cap8-3zj.es.js.map +0 -1
  271. package/dist/chunks/date-input-DvOM0DLT.cjs.js +0 -2
  272. package/dist/chunks/date-input-DvOM0DLT.cjs.js.map +0 -1
  273. package/dist/chunks/date-picker-CZAoPNsT.cjs.js +0 -2
  274. package/dist/chunks/date-range-picker-iENzosfN.cjs.js +0 -2
  275. package/dist/chunks/dialog.title-CP_ZeiK4.es.js.map +0 -1
  276. package/dist/chunks/dialog.title-DOPP47Zy.cjs.js +0 -2
  277. package/dist/chunks/dialog.title-DOPP47Zy.cjs.js.map +0 -1
  278. package/dist/chunks/drawer-BJ4qvGnj.es.js.map +0 -1
  279. package/dist/chunks/drawer-DzW9wBMk.cjs.js +0 -2
  280. package/dist/chunks/drawer-DzW9wBMk.cjs.js.map +0 -1
  281. package/dist/chunks/extractStyleProps-DYXEhLtq.es.js.map +0 -1
  282. package/dist/chunks/extractStyleProps-Dk3fpLyQ.cjs.js.map +0 -1
  283. package/dist/chunks/menu-D-vE6ZpM.es.js.map +0 -1
  284. package/dist/chunks/menu-DIepV2KZ.cjs.js +0 -2
  285. package/dist/chunks/menu-DIepV2KZ.cjs.js.map +0 -1
  286. package/dist/chunks/money-input-Cu_J86Eu.cjs.js +0 -2
  287. package/dist/chunks/multiline-text-input-B9TBDieZ.cjs.js +0 -2
  288. package/dist/chunks/multiline-text-input-B9TBDieZ.cjs.js.map +0 -1
  289. package/dist/chunks/multiline-text-input-CilSJJaO.es.js.map +0 -1
  290. package/dist/chunks/number-input-wMW-o4di.cjs.js +0 -2
  291. package/dist/chunks/progress-bar-Bhp7W6Eo.cjs.js +0 -2
  292. package/dist/chunks/progress-bar-Bhp7W6Eo.cjs.js.map +0 -1
  293. package/dist/chunks/progress-bar-DwuOjOcH.es.js.map +0 -1
  294. package/dist/chunks/radio-input-Dp05SXja.cjs.js +0 -2
  295. package/dist/chunks/range-calendar-DBpl6y5i.es.js.map +0 -1
  296. package/dist/chunks/range-calendar-_dZfAsdG.cjs.js +0 -2
  297. package/dist/chunks/range-calendar-_dZfAsdG.cjs.js.map +0 -1
  298. package/dist/chunks/rich-text-input-BC8CBVio.es.js.map +0 -1
  299. package/dist/chunks/rich-text-input-Da5WFZ3l.cjs.js.map +0 -1
  300. package/dist/chunks/search-input-BefkmgPy.cjs.js +0 -2
  301. package/dist/chunks/select-DMsU6bk9.cjs.js +0 -2
  302. package/dist/chunks/separator-CvRn_J0r.cjs.js +0 -2
  303. package/dist/chunks/separator-CvRn_J0r.cjs.js.map +0 -1
  304. package/dist/chunks/separator-DJGUFG-o.es.js.map +0 -1
  305. package/dist/chunks/split-button-BO52sL7h.cjs.js.map +0 -1
  306. package/dist/chunks/split-button-BxyZmuNi.es.js.map +0 -1
  307. package/dist/chunks/switch-01hEhL9A.es.js.map +0 -1
  308. package/dist/chunks/switch-CdLhBEPq.cjs.js +0 -2
  309. package/dist/chunks/switch-CdLhBEPq.cjs.js.map +0 -1
  310. package/dist/chunks/tabs-CJ0OAUSR.cjs.js +0 -2
  311. package/dist/chunks/text-input-CSAODlCw.es.js.map +0 -1
  312. package/dist/chunks/text-input-DZdkCbdd.cjs.js +0 -2
  313. package/dist/chunks/text-input-DZdkCbdd.cjs.js.map +0 -1
  314. package/dist/chunks/time-input--a_qv-Jk.es.js.map +0 -1
  315. package/dist/chunks/time-input-zXykDANk.cjs.js +0 -2
  316. package/dist/chunks/time-input-zXykDANk.cjs.js.map +0 -1
  317. package/dist/chunks/toggle-button-DxMZsem4.cjs.js +0 -2
  318. package/dist/chunks/toggle-button-DxMZsem4.cjs.js.map +0 -1
  319. package/dist/chunks/toggle-button-awb1jBf8.es.js.map +0 -1
  320. package/dist/chunks/toolbar-DV0l5MqA.cjs.js +0 -2
  321. package/dist/chunks/toolbar-Dduysqqi.es.js.map +0 -1
  322. package/dist/components/utils/index.d.ts +0 -4
  323. /package/dist/{utils → type-utils}/slot-types.d.ts +0 -0
  324. /package/dist/utils/{extractStyleProps.d.ts → extract-style-props.d.ts} +0 -0
  325. /package/dist/utils/{noop.d.ts → no-op.d.ts} +0 -0
@@ -0,0 +1,2 @@
1
+ "use strict";const e=require("react/jsx-runtime"),m=require("@chakra-ui/react"),n=require("./DateField-CDTSjqvQ.cjs.js"),h=require("@chakra-ui/react/styled-system"),S=require("./index-CRFg4Mhx.cjs.js"),g=require("./extract-style-props-Dk3fpLyQ.cjs.js"),{withProvider:j,withContext:t}=m.createSlotRecipeContext({key:"dateInput"}),I=j("div","root"),D=t("div","leadingElement"),$=t("div","trailingElement"),f=t("div","segmentGroup"),P=t("div","segment"),s=c=>{const o=h.useRecipe({recipe:S.dateInputSlotRecipe}),{leadingElement:r,trailingElement:i,...l}=c,[a,d]=o.splitVariantProps({...l}),[p,u]=g.extractStyleProps(d);return e.jsx(I,{...a,...p,asChild:!0,children:e.jsx(n.$40825cdb76e74f70$export$d9781c7894a82487,{...u,children:e.jsxs(e.Fragment,{children:[r&&e.jsx(D,{children:r}),e.jsx(f,{asChild:!0,children:e.jsx(n.$40825cdb76e74f70$export$7edc06cf1783b30f,{children:x=>e.jsx(P,{asChild:!0,children:e.jsx(n.$40825cdb76e74f70$export$336ab7fa954c4b5f,{segment:x})})})}),i&&e.jsx($,{children:i})]})})})};s.displayName="DateInput";exports.DateInput=s;
2
+ //# sourceMappingURL=date-input-B84sXbjL.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-input-B84sXbjL.cjs.js","sources":["../../src/components/date-input/date-input.slots.tsx","../../src/components/date-input/date-input.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { DateInputRootSlotProps } from \"./date-input.types\";\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"dateInput\",\n});\n\n/**\n * Root component that provides the styling context for the DateInput component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DateInputRootSlot = withProvider<\n HTMLDivElement,\n DateInputRootSlotProps\n>(\"div\", \"root\");\n\nexport const DateInputLeadingElementSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"leadingElement\");\n\nexport const DateInputTrailingElementSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"trailingElement\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segmentGroup\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segment\");\n","import {\n DateInputLeadingElementSlot,\n DateInputRootSlot,\n DateInputSegmentGroupSlot,\n DateInputSegmentSlot,\n DateInputTrailingElementSlot,\n} from \"./date-input.slots\";\n\nimport {\n DateField,\n DateInput as DateInputField,\n DateSegment,\n} from \"react-aria-components\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { dateInputSlotRecipe } from \"./date-input.recipe\";\nimport type { DateInputProps } from \"./date-input.types\";\nimport { extractStyleProps } from \"@/utils\";\n\n/**\n * # DateInput\n *\n * allows entering a date\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/dateinput}\n */\nexport const DateInput = (props: DateInputProps) => {\n const recipe = useRecipe({ recipe: dateInputSlotRecipe });\n const { leadingElement, trailingElement, ...rest } = props;\n const [recipeProps, recipeFreeProps] = recipe.splitVariantProps({ ...rest });\n const [styleProps, functionalProps] = extractStyleProps(recipeFreeProps);\n\n return (\n <DateInputRootSlot {...recipeProps} {...styleProps} asChild>\n <DateField {...functionalProps}>\n <>\n {leadingElement && (\n <DateInputLeadingElementSlot>\n {leadingElement}\n </DateInputLeadingElementSlot>\n )}\n <DateInputSegmentGroupSlot asChild>\n <DateInputField>\n {(segment) => (\n <DateInputSegmentSlot asChild>\n <DateSegment segment={segment} />\n </DateInputSegmentSlot>\n )}\n </DateInputField>\n </DateInputSegmentGroupSlot>\n {trailingElement && (\n <DateInputTrailingElementSlot>\n {trailingElement}\n </DateInputTrailingElementSlot>\n )}\n </>\n </DateField>\n </DateInputRootSlot>\n );\n};\n\nDateInput.displayName = \"DateInput\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","DateInputRootSlot","DateInputLeadingElementSlot","DateInputTrailingElementSlot","DateInputSegmentGroupSlot","DateInputSegmentSlot","DateInput","props","recipe","useRecipe","dateInputSlotRecipe","leadingElement","trailingElement","rest","recipeProps","recipeFreeProps","styleProps","functionalProps","extractStyleProps","jsx","DateField","jsxs","Fragment","DateInputField","segment","DateSegment"],"mappings":"6PAOM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,WACP,CAAC,EAMYC,EAAoBH,EAG/B,MAAO,MAAM,EAEFI,EAA8BH,EAGzC,MAAO,gBAAgB,EAEZI,EAA+BJ,EAG1C,MAAO,iBAAiB,EAKbK,EAA4BL,EAGvC,MAAO,cAAc,EAKVM,EAAuBN,EAGlC,MAAO,SAAS,ECnBLO,EAAaC,GAA0B,CAClD,MAAMC,EAASC,EAAAA,UAAU,CAAE,OAAQC,EAAAA,oBAAqB,EAClD,CAAE,eAAAC,EAAgB,gBAAAC,EAAiB,GAAGC,GAASN,EAC/C,CAACO,EAAaC,CAAe,EAAIP,EAAO,kBAAkB,CAAE,GAAGK,EAAM,EACrE,CAACG,EAAYC,CAAe,EAAIC,EAAAA,kBAAkBH,CAAe,EAEvE,OACEI,EAAAA,IAAClB,EAAA,CAAmB,GAAGa,EAAc,GAAGE,EAAY,QAAO,GACzD,SAAAG,EAAAA,IAACC,EAAAA,0CAAA,CAAW,GAAGH,EACb,SAAAI,OAAAC,EAAAA,SAAA,CACG,SAAA,CAAAX,GACCQ,EAAAA,IAACjB,GACE,SAAAS,CAAA,CACH,QAEDP,EAAA,CAA0B,QAAO,GAChC,SAAAe,EAAAA,IAACI,6CACE,SAACC,GACAL,EAAAA,IAACd,EAAA,CAAqB,QAAO,GAC3B,SAAAc,EAAAA,IAACM,6CAAY,QAAAD,CAAA,CAAkB,EACjC,EAEJ,CAAA,CACF,EACCZ,GACCO,EAAAA,IAAChB,EAAA,CACE,SAAAS,CAAA,CACH,CAAA,CAAA,CAEJ,EACF,EACF,CAEJ,EAEAN,EAAU,YAAc"}
@@ -3,7 +3,7 @@ import { createSlotRecipeContext as f } from "@chakra-ui/react";
3
3
  import { c as h, a as g, b as S } from "./DateField-DZwn3cIj.es.js";
4
4
  import { useRecipe as x } from "@chakra-ui/react/styled-system";
5
5
  import { d as I } from "./index-CtB71yr7.es.js";
6
- import { e as $ } from "./extractStyleProps-DYXEhLtq.es.js";
6
+ import { e as $ } from "./extract-style-props-DYXEhLtq.es.js";
7
7
  const { withProvider: D, withContext: t } = /* @__PURE__ */ f({
8
8
  key: "dateInput"
9
9
  }), b = /* @__PURE__ */ D("div", "root"), P = /* @__PURE__ */ t("div", "leadingElement"), v = /* @__PURE__ */ t("div", "trailingElement"), E = /* @__PURE__ */ t("div", "segmentGroup"), C = /* @__PURE__ */ t("div", "segment"), y = (o) => {
@@ -18,4 +18,4 @@ y.displayName = "DateInput";
18
18
  export {
19
19
  y as D
20
20
  };
21
- //# sourceMappingURL=date-input-Cap8-3zj.es.js.map
21
+ //# sourceMappingURL=date-input-BiOdvpWz.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-input-BiOdvpWz.es.js","sources":["../../src/components/date-input/date-input.slots.tsx","../../src/components/date-input/date-input.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { DateInputRootSlotProps } from \"./date-input.types\";\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"dateInput\",\n});\n\n/**\n * Root component that provides the styling context for the DateInput component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DateInputRootSlot = withProvider<\n HTMLDivElement,\n DateInputRootSlotProps\n>(\"div\", \"root\");\n\nexport const DateInputLeadingElementSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"leadingElement\");\n\nexport const DateInputTrailingElementSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"trailingElement\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segmentGroup\");\n\n/**\n * Slot component for the DateField part of the DateInput.\n */\nexport const DateInputSegmentSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"segment\");\n","import {\n DateInputLeadingElementSlot,\n DateInputRootSlot,\n DateInputSegmentGroupSlot,\n DateInputSegmentSlot,\n DateInputTrailingElementSlot,\n} from \"./date-input.slots\";\n\nimport {\n DateField,\n DateInput as DateInputField,\n DateSegment,\n} from \"react-aria-components\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { dateInputSlotRecipe } from \"./date-input.recipe\";\nimport type { DateInputProps } from \"./date-input.types\";\nimport { extractStyleProps } from \"@/utils\";\n\n/**\n * # DateInput\n *\n * allows entering a date\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/dateinput}\n */\nexport const DateInput = (props: DateInputProps) => {\n const recipe = useRecipe({ recipe: dateInputSlotRecipe });\n const { leadingElement, trailingElement, ...rest } = props;\n const [recipeProps, recipeFreeProps] = recipe.splitVariantProps({ ...rest });\n const [styleProps, functionalProps] = extractStyleProps(recipeFreeProps);\n\n return (\n <DateInputRootSlot {...recipeProps} {...styleProps} asChild>\n <DateField {...functionalProps}>\n <>\n {leadingElement && (\n <DateInputLeadingElementSlot>\n {leadingElement}\n </DateInputLeadingElementSlot>\n )}\n <DateInputSegmentGroupSlot asChild>\n <DateInputField>\n {(segment) => (\n <DateInputSegmentSlot asChild>\n <DateSegment segment={segment} />\n </DateInputSegmentSlot>\n )}\n </DateInputField>\n </DateInputSegmentGroupSlot>\n {trailingElement && (\n <DateInputTrailingElementSlot>\n {trailingElement}\n </DateInputTrailingElementSlot>\n )}\n </>\n </DateField>\n </DateInputRootSlot>\n );\n};\n\nDateInput.displayName = \"DateInput\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","DateInputRootSlot","DateInputLeadingElementSlot","DateInputTrailingElementSlot","DateInputSegmentGroupSlot","DateInputSegmentSlot","DateInput","props","recipe","useRecipe","dateInputSlotRecipe","leadingElement","trailingElement","rest","recipeProps","recipeFreeProps","styleProps","functionalProps","extractStyleProps","jsx","DateField","jsxs","Fragment","DateInputField","segment","DateSegment"],"mappings":";;;;;;AAOA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAMYC,IAAoB,gBAAAH,EAG/B,OAAO,MAAM,GAEFI,IAA8B,gBAAAH,EAGzC,OAAO,gBAAgB,GAEZI,IAA+B,gBAAAJ,EAG1C,OAAO,iBAAiB,GAKbK,IAA4B,gBAAAL,EAGvC,OAAO,cAAc,GAKVM,IAAuB,gBAAAN,EAGlC,OAAO,SAAS,GCnBLO,IAAY,CAACC,MAA0B;AAClD,QAAMC,IAASC,EAAU,EAAE,QAAQC,GAAqB,GAClD,EAAE,gBAAAC,GAAgB,iBAAAC,GAAiB,GAAGC,MAASN,GAC/C,CAACO,GAAaC,CAAe,IAAIP,EAAO,kBAAkB,EAAE,GAAGK,GAAM,GACrE,CAACG,GAAYC,CAAe,IAAIC,EAAkBH,CAAe;AAEvE,SACE,gBAAAI,EAAClB,GAAA,EAAmB,GAAGa,GAAc,GAAGE,GAAY,SAAO,IACzD,UAAA,gBAAAG,EAACC,GAAA,EAAW,GAAGH,GACb,UAAA,gBAAAI,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAX,KACC,gBAAAQ,EAACjB,KACE,UAAAS,EAAA,CACH;AAAA,sBAEDP,GAAA,EAA0B,SAAO,IAChC,UAAA,gBAAAe,EAACI,KACE,UAAA,CAACC,MACA,gBAAAL,EAACd,GAAA,EAAqB,SAAO,IAC3B,UAAA,gBAAAc,EAACM,KAAY,SAAAD,EAAA,CAAkB,GACjC,GAEJ,EAAA,CACF;AAAA,IACCZ,KACC,gBAAAO,EAAChB,GAAA,EACE,UAAAS,EAAA,CACH;AAAA,EAAA,EAAA,CAEJ,GACF,GACF;AAEJ;AAEAN,EAAU,cAAc;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const e=require("react/jsx-runtime"),j=require("@chakra-ui/react"),P=require("@commercetools/nimbus-icons"),x=require("./DatePicker-DCjrqg4Q.cjs.js"),T=require("./Dialog-XGXh4NXU.cjs.js"),q=require("./Group-BX1EpD9E.cjs.js"),v=require("@chakra-ui/react/styled-system"),C=require("./index-CRFg4Mhx.cjs.js"),I=require("./extract-style-props-Dk3fpLyQ.cjs.js"),f=require("react"),h=require("react-intl"),M=require("./time-input-CweVZv1Q.cjs.js"),E=require("@chakra-ui/react/flex"),H=require("./text-CCW9kDT_.cjs.js"),k=require("./Button-CFZnLKVR.cjs.js"),S=require("./utils-BHdR5Nww.cjs.js"),R=require("./DateField-CDTSjqvQ.cjs.js"),N=require("./date-input-B84sXbjL.cjs.js"),V=require("./calendar-0Tr21POc.cjs.js"),B=require("./box-CWni3A32.cjs.js"),y=require("./icon-button-vWPrT-bR.cjs.js"),{withProvider:w,withContext:g}=j.createSlotRecipeContext({key:"datePicker"}),z=w("div","root"),F=g("div","group"),G=g("div","popover"),A=g("div","calendar"),m=h.defineMessages({clearInput:{id:"Nimbus.DatePicker.clearInput",description:"aria-label for clear input button in date picker",defaultMessage:"Clear input value"},enterTime:{id:"Nimbus.DatePicker.Time.enterTime",description:"aria-label for time input field in date picker",defaultMessage:"Enter time"},enterTimeHour:{id:"Nimbus.DatePicker.Time.enterTimeHour",description:"aria-label for hour-only time input in date picker",defaultMessage:"Enter time (hour)"},enterTimeHourMinute:{id:"Nimbus.DatePicker.Time.enterTimeHourMinute",description:"aria-label for hour and minute time input in date picker",defaultMessage:"Enter time (hour and minute)"},enterTimeHourMinuteSecond:{id:"Nimbus.DatePicker.Time.enterTimeHourMinuteSecond",description:"aria-label for full time input with seconds in date picker",defaultMessage:"Enter time (hour, minute, and second)"},startTime:{id:"Nimbus.DatePicker.Time.startTime",description:"Label for start time in date picker",defaultMessage:"Start time"}}),L=({hideTimeZone:n,hourCycle:r})=>{const s=f.useContext(x.$06d5b8ec9ee5d538$export$50a10c048fdcdee9),{granularity:o,dateValue:t}=s,a=f.useRef(null),u=f.useRef(t);return o==="day"?null:(f.useEffect(()=>{let i;if(t&&u.current?.compare(t)!==0){const c=a.current,l=document.activeElement;c?.contains(l)&&l?.getAttribute("role")==="spinbutton"||(i=setTimeout(()=>{c&&c.querySelector('[role="spinbutton"]')?.focus()},50))}return u.current=t,()=>{i&&clearTimeout(i)}},[t]),e.jsxs(E.Flex,{ref:a,borderTop:"solid-25",borderColor:"neutral.3",py:"300",px:"400",alignItems:"center",justifyContent:"center",gap:"200",children:[e.jsx(H.Text,{textStyle:"xs",fontWeight:"500",color:"neutral.12",children:e.jsx(h.FormattedMessage,{...m.startTime})}),e.jsx(M.TimeInput,{slot:"timeInput",variant:"ghost",size:"sm",hideTimeZone:n,hourCycle:r})]}))},O=({children:n})=>{const r=h.useIntl(),s=S.$64fa3d84918910a7$export$fabf2dc03a41866e(k.$d2b4bc8c273e7be6$export$24d547caef80ccd1)||{},o=f.useContext(x.$06d5b8ec9ee5d538$export$50a10c048fdcdee9),t=o?.dateValue===null,{timeValue:a,setTimeValue:u,granularity:i}=o,c=s?.isDisabled,l=()=>{switch(i){case"hour":return r.formatMessage(m.enterTimeHour);case"minute":return r.formatMessage(m.enterTimeHourMinute);case"second":return r.formatMessage(m.enterTimeHourMinuteSecond);default:return r.formatMessage(m.enterTime)}},b={calendarToggle:{...s,onPress:d=>{const $=document?.activeElement;$&&$.blur(),s.onPress?.(d)}},clear:{onPress:()=>o?.setValue(null),"aria-label":r.formatMessage(m.clearInput),isDisabled:c,style:t?{display:"none"}:void 0,"aria-hidden":t?!0:void 0}},p={timeInput:{value:a,onChange:d=>{d!==null&&u(d)},granularity:i==="day"?void 0:i,"aria-label":l()}};return e.jsx(S.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[k.$d2b4bc8c273e7be6$export$24d547caef80ccd1,{slots:b}],[R.$40825cdb76e74f70$export$8e17ddc448e87c1e,{slots:p}]],children:n})},D=n=>{const{size:r="md",variant:s,granularity:o="day",hideTimeZone:t,hourCycle:a}=n,u=v.useSlotRecipe({recipe:C.datePickerSlotRecipe}),[i,c]=u.splitVariantProps(n),[l,b]=I.extractStyleProps(c),p=r==="md"?"xs":"2xs",d=o==="day"?n.shouldCloseOnSelect:!1;return e.jsx(z,{...i,...l,asChild:!0,children:e.jsx(x.$06d5b8ec9ee5d538$export$5109c6dd95d8fb00,{...b,shouldCloseOnSelect:d,children:e.jsxs(O,{children:[e.jsx(F,{asChild:!0,children:e.jsx(q.$a049562f99e7db0e$export$eb2fcfdbd7ba97d4,{children:e.jsx(N.DateInput,{size:r,variant:s,width:"full",hideTimeZone:t,hourCycle:a,trailingElement:e.jsxs(B.Box,{children:[e.jsx(y.IconButton,{tone:"primary",variant:"ghost",size:p,slot:"clear",children:e.jsx(P.Close,{})}),e.jsx(y.IconButton,{tone:"primary",variant:"ghost",size:p,slot:"calendarToggle",children:e.jsx(P.CalendarMonth,{})})]})})})}),e.jsx(G,{asChild:!0,children:e.jsx(T.$07b14b47974efb58$export$5b6b19405a83ff9d,{placement:"bottom end",children:e.jsxs(T.$de32f1b87079253c$export$3ddf2d174ce01153,{children:[e.jsx(A,{children:e.jsx(V.Calendar,{})}),e.jsx(L,{hideTimeZone:t,hourCycle:a})]})})})]})})})};D.displayName="DatePicker";exports.DatePicker=D;
2
+ //# sourceMappingURL=date-picker-2SDD5gY9.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker-CZAoPNsT.cjs.js","sources":["../../src/components/date-picker/date-picker.slots.tsx","../../src/components/date-picker/date-picker.i18n.ts","../../src/components/date-picker/components/date-picker.time-input.tsx","../../src/components/date-picker/components/date-picker.custom-context.tsx","../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { DatePickerRootSlotProps } from \"./date-picker.types\";\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"datePicker\",\n});\n\n/**\n * Root component that provides the styling context for the DatePicker component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DatePickerRootSlot = withProvider<\n HTMLDivElement,\n DatePickerRootSlotProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the input group containing the DateInput.\n */\nexport const DatePickerGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"group\");\n\n/**\n * Slot component for the popover container.\n */\nexport const DatePickerPopoverSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"popover\");\n\n/**\n * Slot component for the calendar container within the popover.\n */\nexport const DatePickerCalendarSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"calendar\");\n\n/**\n * Slot component for the calendar header.\n */\nexport const DatePickerCalendarHeaderSlot = withContext<\n HTMLElement,\n HTMLChakraProps<\"header\">\n>(\"header\", \"calendarHeader\");\n\n/**\n * Slot component for the calendar grid.\n */\nexport const DatePickerCalendarGridSlot = withContext<\n HTMLTableElement,\n HTMLChakraProps<\"table\">\n>(\"table\", \"calendarGrid\");\n\n/**\n * Slot component for individual calendar cells.\n */\nexport const DatePickerCalendarCellSlot = withContext<\n HTMLTableCellElement,\n HTMLChakraProps<\"td\">\n>(\"td\", \"calendarCell\");\n","import { defineMessages } from \"react-intl\";\n\nexport default defineMessages({\n clearInput: {\n id: \"Nimbus.DatePicker.clearInput\",\n description: \"aria-label for clear input button in date picker\",\n defaultMessage: \"Clear input value\",\n },\n enterTime: {\n id: \"Nimbus.DatePicker.Time.enterTime\",\n description: \"aria-label for time input field in date picker\",\n defaultMessage: \"Enter time\",\n },\n enterTimeHour: {\n id: \"Nimbus.DatePicker.Time.enterTimeHour\",\n description: \"aria-label for hour-only time input in date picker\",\n defaultMessage: \"Enter time (hour)\",\n },\n enterTimeHourMinute: {\n id: \"Nimbus.DatePicker.Time.enterTimeHourMinute\",\n description: \"aria-label for hour and minute time input in date picker\",\n defaultMessage: \"Enter time (hour and minute)\",\n },\n enterTimeHourMinuteSecond: {\n id: \"Nimbus.DatePicker.Time.enterTimeHourMinuteSecond\",\n description: \"aria-label for full time input with seconds in date picker\",\n defaultMessage: \"Enter time (hour, minute, and second)\",\n },\n startTime: {\n id: \"Nimbus.DatePicker.Time.startTime\",\n description: \"Label for start time in date picker\",\n defaultMessage: \"Start time\",\n },\n});\n","import { Flex, Text, TimeInput } from \"@/components\";\nimport { useContext, useRef, useEffect } from \"react\";\nimport { DatePickerStateContext } from \"react-aria-components\";\nimport type { DatePickerTimeInputProps } from \"../date-picker.types\";\nimport { FormattedMessage } from \"react-intl\";\nimport messages from \"../date-picker.i18n\";\n\nexport const DatePickerTimeInput = ({\n hideTimeZone,\n hourCycle,\n}: DatePickerTimeInputProps) => {\n const datePickerState = useContext(DatePickerStateContext);\n const { granularity, dateValue } = datePickerState!;\n const timeInputRef = useRef<HTMLDivElement>(null);\n const previousDateRef = useRef(dateValue);\n\n // do not show up to the party if you're not invited\n if (granularity === \"day\") {\n return null;\n }\n\n // Focus the time input when date changes (user selects a date from calendar)\n useEffect(() => {\n // Check if date changed\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n if (dateValue && previousDateRef.current?.compare(dateValue) !== 0) {\n // Only auto-focus if no time input segment currently has focus\n // This prevents stealing focus during user interaction with time segments\n const container = timeInputRef.current;\n const activeElement = document.activeElement;\n const hasTimeSegmentFocus =\n container?.contains(activeElement) &&\n activeElement?.getAttribute(\"role\") === \"spinbutton\";\n\n if (!hasTimeSegmentFocus) {\n // Small delay to ensure the DOM is ready\n timeoutId = setTimeout(() => {\n // Find the first focusable segment within the time input container\n if (container) {\n const firstSegment = container.querySelector(\n '[role=\"spinbutton\"]'\n ) as HTMLElement;\n firstSegment?.focus();\n }\n }, 50);\n }\n }\n\n previousDateRef.current = dateValue;\n\n // Cleanup timeout on effect re-run or unmount to prevent memory leaks\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [dateValue]);\n\n return (\n <Flex\n ref={timeInputRef}\n borderTop=\"solid-25\"\n borderColor=\"neutral.3\"\n py=\"300\"\n px=\"400\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"200\"\n >\n <Text textStyle=\"xs\" fontWeight=\"500\" color=\"neutral.12\">\n <FormattedMessage {...messages.startTime} />\n </Text>\n <TimeInput\n slot=\"timeInput\"\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n );\n};\n","import { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n DatePickerStateContext,\n TimeFieldContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport type { PressEvent, TimeValue } from \"react-aria\";\nimport { useIntl } from \"react-intl\";\nimport messages from \"../date-picker.i18n\";\n\nexport const DatePickerCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const intl = useIntl();\n const buttonContext = useSlottedContext(ButtonContext) || {};\n const datePickerState = useContext(DatePickerStateContext);\n const noInputValue = datePickerState?.dateValue === null;\n\n const { timeValue, setTimeValue, granularity } = datePickerState!;\n\n // Try to get disabled state from the button context\n const isDatePickerDisabled = buttonContext?.isDisabled;\n\n // Generate default aria-label based on granularity if not provided\n const getDefaultTimeInputAriaLabel = () => {\n switch (granularity) {\n case \"hour\":\n return intl.formatMessage(messages.enterTimeHour);\n case \"minute\":\n return intl.formatMessage(messages.enterTimeHourMinute);\n case \"second\":\n return intl.formatMessage(messages.enterTimeHourMinuteSecond);\n default:\n return intl.formatMessage(messages.enterTime);\n }\n };\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n /** toggles the calendar popover */\n calendarToggle: {\n ...buttonContext,\n onPress: (event: PressEvent) => {\n // Ensure any active input (e.g., date picker segment) loses focus\n // because blurring the input will close the popover if it's open (or was just opened)\n const activeElement = document?.activeElement as HTMLElement | null;\n\n if (activeElement) {\n activeElement.blur();\n }\n\n buttonContext.onPress?.(event);\n },\n },\n /** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */\n clear: {\n onPress: () => datePickerState?.setValue(null),\n \"aria-label\": intl.formatMessage(messages.clearInput),\n isDisabled: isDatePickerDisabled,\n // Hide the button when there's no value\n style: noInputValue ? { display: \"none\" } : undefined,\n \"aria-hidden\": noInputValue ? true : undefined,\n },\n };\n\n /**\n * TimeInput slots\n * ================================\n */\n\n const timeInputSlots = {\n timeInput: {\n value: timeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null) {\n setTimeValue(value);\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(),\n },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: buttonSlots,\n },\n ],\n [TimeFieldContext, { slots: timeInputSlots }],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import {\n DatePickerRootSlot,\n DatePickerGroupSlot,\n DatePickerPopoverSlot,\n DatePickerCalendarSlot,\n} from \"./date-picker.slots\";\n\nimport { CalendarMonth, Close } from \"@commercetools/nimbus-icons\";\n\nimport {\n DatePicker as ReactAriaDatePicker,\n Group,\n Popover,\n Dialog,\n} from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\nimport type { DatePickerProps } from \"./date-picker.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { DateInput, Calendar, IconButton, Box } from \"@/components\";\nimport { DatePickerTimeInput } from \"./components/date-picker.time-input\";\nimport { DatePickerCustomContext } from \"./components/date-picker.custom-context\";\n\n/**\n * # DatePicker\n *\n * a UI component for users to enter or select a specific calendar date.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/datepicker}\n */\nexport const DatePicker = (props: DatePickerProps) => {\n const {\n size = \"md\",\n variant,\n granularity = \"day\",\n hideTimeZone,\n hourCycle,\n } = props;\n const recipe = useSlotRecipe({ recipe: datePickerSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n // the size of the buttons overlaying the input\n const overlayButtonSize = size === \"md\" ? \"xs\" : \"2xs\";\n\n // When granularity is \"day\", use the prop value (defaults to true if not provided)\n // For other granularities (time-based), force to false so users can set both date and time\n const shouldCloseOnSelect =\n granularity === \"day\" ? props.shouldCloseOnSelect : false;\n\n return (\n <DatePickerRootSlot {...recipeProps} {...styleProps} asChild>\n <ReactAriaDatePicker\n {...otherProps}\n shouldCloseOnSelect={shouldCloseOnSelect}\n >\n <DatePickerCustomContext>\n <DatePickerGroupSlot asChild>\n <Group>\n <DateInput\n size={size}\n variant={variant}\n width=\"full\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n trailingElement={\n <Box>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"clear\"\n >\n <Close />\n </IconButton>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"calendarToggle\"\n >\n <CalendarMonth />\n </IconButton>\n </Box>\n }\n />\n </Group>\n </DatePickerGroupSlot>\n <DatePickerPopoverSlot asChild>\n <Popover placement=\"bottom end\">\n <Dialog>\n <DatePickerCalendarSlot>\n <Calendar />\n </DatePickerCalendarSlot>\n <DatePickerTimeInput\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Dialog>\n </Popover>\n </DatePickerPopoverSlot>\n </DatePickerCustomContext>\n </ReactAriaDatePicker>\n </DatePickerRootSlot>\n );\n};\n\nDatePicker.displayName = \"DatePicker\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","DatePickerRootSlot","DatePickerGroupSlot","DatePickerPopoverSlot","DatePickerCalendarSlot","messages","defineMessages","DatePickerTimeInput","hideTimeZone","hourCycle","datePickerState","useContext","DatePickerStateContext","granularity","dateValue","timeInputRef","useRef","previousDateRef","useEffect","timeoutId","container","activeElement","jsxs","Flex","jsx","Text","FormattedMessage","TimeInput","DatePickerCustomContext","children","intl","useIntl","buttonContext","useSlottedContext","ButtonContext","noInputValue","timeValue","setTimeValue","isDatePickerDisabled","getDefaultTimeInputAriaLabel","buttonSlots","event","timeInputSlots","value","Provider","TimeFieldContext","DatePicker","props","size","variant","recipe","useSlotRecipe","datePickerSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","overlayButtonSize","shouldCloseOnSelect","ReactAriaDatePicker","Group","DateInput","Box","IconButton","Close","CalendarMonth","Popover","Dialog","Calendar"],"mappings":"gyBAOM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,YACP,CAAC,E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A,EAGTzC,EAAAA,IAACwC,EAAAA,WAAA,CACC,KAAK,UACL,QAAQ,QACR,KAAMN,EACN,KAAK,iBAEL,eAACQ,EAAAA,cAAA,CAAA,CAAc,CAAA,CAAA,CACjB,CAAA,CACF,CAAA,CAAA,EAGN,CAAA,CACF,EACA1C,EAAAA,IAACrB,GAAsB,QAAO,GAC5B,eAACgE,EAAAA,0CAAA,CAAQ,UAAU,aACjB,SAAA7C,EAAAA,KAAC8C,EAAAA,0CAAA,CACC,SAAA,CAAA5C,EAAAA,IAACpB,EAAA,CACC,SAAAoB,EAAAA,IAAC6C,EAAAA,SAAA,CAAA,CAAS,EACZ,EACA7C,EAAAA,IAACjB,EAAA,CACC,aAAAC,EACA,UAAAC,CAAA,CAAA,CACF,CAAA,CACF,EACF,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAAA,EAEJ,CAEJ,EAEAqC,EAAW,YAAc"}
1
+ {"version":3,"file":"date-picker-2SDD5gY9.cjs.js","sources":["../../src/components/date-picker/date-picker.slots.tsx","../../src/components/date-picker/date-picker.i18n.ts","../../src/components/date-picker/components/date-picker.time-input.tsx","../../src/components/date-picker/components/date-picker.custom-context.tsx","../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { DatePickerRootSlotProps } from \"./date-picker.types\";\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"datePicker\",\n});\n\n/**\n * Root component that provides the styling context for the DatePicker component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DatePickerRootSlot = withProvider<\n HTMLDivElement,\n DatePickerRootSlotProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the input group containing the DateInput.\n */\nexport const DatePickerGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"group\");\n\n/**\n * Slot component for the popover container.\n */\nexport const DatePickerPopoverSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"popover\");\n\n/**\n * Slot component for the calendar container within the popover.\n */\nexport const DatePickerCalendarSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"calendar\");\n\n/**\n * Slot component for the calendar header.\n */\nexport const DatePickerCalendarHeaderSlot = withContext<\n HTMLElement,\n HTMLChakraProps<\"header\">\n>(\"header\", \"calendarHeader\");\n\n/**\n * Slot component for the calendar grid.\n */\nexport const DatePickerCalendarGridSlot = withContext<\n HTMLTableElement,\n HTMLChakraProps<\"table\">\n>(\"table\", \"calendarGrid\");\n\n/**\n * Slot component for individual calendar cells.\n */\nexport const DatePickerCalendarCellSlot = withContext<\n HTMLTableCellElement,\n HTMLChakraProps<\"td\">\n>(\"td\", \"calendarCell\");\n","import { defineMessages } from \"react-intl\";\n\nexport default defineMessages({\n clearInput: {\n id: \"Nimbus.DatePicker.clearInput\",\n description: \"aria-label for clear input button in date picker\",\n defaultMessage: \"Clear input value\",\n },\n enterTime: {\n id: \"Nimbus.DatePicker.Time.enterTime\",\n description: \"aria-label for time input field in date picker\",\n defaultMessage: \"Enter time\",\n },\n enterTimeHour: {\n id: \"Nimbus.DatePicker.Time.enterTimeHour\",\n description: \"aria-label for hour-only time input in date picker\",\n defaultMessage: \"Enter time (hour)\",\n },\n enterTimeHourMinute: {\n id: \"Nimbus.DatePicker.Time.enterTimeHourMinute\",\n description: \"aria-label for hour and minute time input in date picker\",\n defaultMessage: \"Enter time (hour and minute)\",\n },\n enterTimeHourMinuteSecond: {\n id: \"Nimbus.DatePicker.Time.enterTimeHourMinuteSecond\",\n description: \"aria-label for full time input with seconds in date picker\",\n defaultMessage: \"Enter time (hour, minute, and second)\",\n },\n startTime: {\n id: \"Nimbus.DatePicker.Time.startTime\",\n description: \"Label for start time in date picker\",\n defaultMessage: \"Start time\",\n },\n});\n","import { Flex, Text, TimeInput } from \"@/components\";\nimport { useContext, useRef, useEffect } from \"react\";\nimport { DatePickerStateContext } from \"react-aria-components\";\nimport type { DatePickerTimeInputProps } from \"../date-picker.types\";\nimport { FormattedMessage } from \"react-intl\";\nimport messages from \"../date-picker.i18n\";\n\nexport const DatePickerTimeInput = ({\n hideTimeZone,\n hourCycle,\n}: DatePickerTimeInputProps) => {\n const datePickerState = useContext(DatePickerStateContext);\n const { granularity, dateValue } = datePickerState!;\n const timeInputRef = useRef<HTMLDivElement>(null);\n const previousDateRef = useRef(dateValue);\n\n // do not show up to the party if you're not invited\n if (granularity === \"day\") {\n return null;\n }\n\n // Focus the time input when date changes (user selects a date from calendar)\n useEffect(() => {\n // Check if date changed\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n if (dateValue && previousDateRef.current?.compare(dateValue) !== 0) {\n // Only auto-focus if no time input segment currently has focus\n // This prevents stealing focus during user interaction with time segments\n const container = timeInputRef.current;\n const activeElement = document.activeElement;\n const hasTimeSegmentFocus =\n container?.contains(activeElement) &&\n activeElement?.getAttribute(\"role\") === \"spinbutton\";\n\n if (!hasTimeSegmentFocus) {\n // Small delay to ensure the DOM is ready\n timeoutId = setTimeout(() => {\n // Find the first focusable segment within the time input container\n if (container) {\n const firstSegment = container.querySelector(\n '[role=\"spinbutton\"]'\n ) as HTMLElement;\n firstSegment?.focus();\n }\n }, 50);\n }\n }\n\n previousDateRef.current = dateValue;\n\n // Cleanup timeout on effect re-run or unmount to prevent memory leaks\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [dateValue]);\n\n return (\n <Flex\n ref={timeInputRef}\n borderTop=\"solid-25\"\n borderColor=\"neutral.3\"\n py=\"300\"\n px=\"400\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"200\"\n >\n <Text textStyle=\"xs\" fontWeight=\"500\" color=\"neutral.12\">\n <FormattedMessage {...messages.startTime} />\n </Text>\n <TimeInput\n slot=\"timeInput\"\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n );\n};\n","import { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n DatePickerStateContext,\n TimeFieldContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport type { PressEvent, TimeValue } from \"react-aria\";\nimport { useIntl } from \"react-intl\";\nimport messages from \"../date-picker.i18n\";\n\nexport const DatePickerCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const intl = useIntl();\n const buttonContext = useSlottedContext(ButtonContext) || {};\n const datePickerState = useContext(DatePickerStateContext);\n const noInputValue = datePickerState?.dateValue === null;\n\n const { timeValue, setTimeValue, granularity } = datePickerState!;\n\n // Try to get disabled state from the button context\n const isDatePickerDisabled = buttonContext?.isDisabled;\n\n // Generate default aria-label based on granularity if not provided\n const getDefaultTimeInputAriaLabel = () => {\n switch (granularity) {\n case \"hour\":\n return intl.formatMessage(messages.enterTimeHour);\n case \"minute\":\n return intl.formatMessage(messages.enterTimeHourMinute);\n case \"second\":\n return intl.formatMessage(messages.enterTimeHourMinuteSecond);\n default:\n return intl.formatMessage(messages.enterTime);\n }\n };\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n /** toggles the calendar popover */\n calendarToggle: {\n ...buttonContext,\n onPress: (event: PressEvent) => {\n // Ensure any active input (e.g., date picker segment) loses focus\n // because blurring the input will close the popover if it's open (or was just opened)\n const activeElement = document?.activeElement as HTMLElement | null;\n\n if (activeElement) {\n activeElement.blur();\n }\n\n buttonContext.onPress?.(event);\n },\n },\n /** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */\n clear: {\n onPress: () => datePickerState?.setValue(null),\n \"aria-label\": intl.formatMessage(messages.clearInput),\n isDisabled: isDatePickerDisabled,\n // Hide the button when there's no value\n style: noInputValue ? { display: \"none\" } : undefined,\n \"aria-hidden\": noInputValue ? true : undefined,\n },\n };\n\n /**\n * TimeInput slots\n * ================================\n */\n\n const timeInputSlots = {\n timeInput: {\n value: timeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null) {\n setTimeValue(value);\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(),\n },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: buttonSlots,\n },\n ],\n [TimeFieldContext, { slots: timeInputSlots }],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import {\n DatePickerRootSlot,\n DatePickerGroupSlot,\n DatePickerPopoverSlot,\n DatePickerCalendarSlot,\n} from \"./date-picker.slots\";\n\nimport { CalendarMonth, Close } from \"@commercetools/nimbus-icons\";\n\nimport {\n DatePicker as ReactAriaDatePicker,\n Group,\n Popover,\n Dialog,\n} from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\nimport type { DatePickerProps } from \"./date-picker.types\";\nimport { extractStyleProps } from \"@/utils\";\nimport { DateInput, Calendar, IconButton, Box } from \"@/components\";\nimport { DatePickerTimeInput } from \"./components/date-picker.time-input\";\nimport { DatePickerCustomContext } from \"./components/date-picker.custom-context\";\n\n/**\n * # DatePicker\n *\n * a UI component for users to enter or select a specific calendar date.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/datepicker}\n */\nexport const DatePicker = (props: DatePickerProps) => {\n const {\n size = \"md\",\n variant,\n granularity = \"day\",\n hideTimeZone,\n hourCycle,\n } = props;\n const recipe = useSlotRecipe({ recipe: datePickerSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n // the size of the buttons overlaying the input\n const overlayButtonSize = size === \"md\" ? \"xs\" : \"2xs\";\n\n // When granularity is \"day\", use the prop value (defaults to true if not provided)\n // For other granularities (time-based), force to false so users can set both date and time\n const shouldCloseOnSelect =\n granularity === \"day\" ? props.shouldCloseOnSelect : false;\n\n return (\n <DatePickerRootSlot {...recipeProps} {...styleProps} asChild>\n <ReactAriaDatePicker\n {...otherProps}\n shouldCloseOnSelect={shouldCloseOnSelect}\n >\n <DatePickerCustomContext>\n <DatePickerGroupSlot asChild>\n <Group>\n <DateInput\n size={size}\n variant={variant}\n width=\"full\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n trailingElement={\n <Box>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"clear\"\n >\n <Close />\n </IconButton>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"calendarToggle\"\n >\n <CalendarMonth />\n </IconButton>\n </Box>\n }\n />\n </Group>\n </DatePickerGroupSlot>\n <DatePickerPopoverSlot asChild>\n <Popover placement=\"bottom end\">\n <Dialog>\n <DatePickerCalendarSlot>\n <Calendar />\n </DatePickerCalendarSlot>\n <DatePickerTimeInput\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Dialog>\n </Popover>\n </DatePickerPopoverSlot>\n </DatePickerCustomContext>\n </ReactAriaDatePicker>\n </DatePickerRootSlot>\n );\n};\n\nDatePicker.displayName = \"DatePicker\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","DatePickerRootSlot","DatePickerGroupSlot","DatePickerPopoverSlot","DatePickerCalendarSlot","messages","defineMessages","DatePickerTimeInput","hideTimeZone","hourCycle","datePickerState","useContext","DatePickerStateContext","granularity","dateValue","timeInputRef","useRef","previousDateRef","useEffect","timeoutId","container","activeElement","jsxs","Flex","jsx","Text","FormattedMessage","TimeInput","DatePickerCustomContext","children","intl","useIntl","buttonContext","useSlottedContext","ButtonContext","noInputValue","timeValue","setTimeValue","isDatePickerDisabled","getDefaultTimeInputAriaLabel","buttonSlots","event","timeInputSlots","value","Provider","TimeFieldContext","DatePicker","props","size","variant","recipe","useSlotRecipe","datePickerSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","overlayButtonSize","shouldCloseOnSelect","ReactAriaDatePicker","Group","DateInput","Box","IconButton","Close","CalendarMonth","Popover","Dialog","Calendar"],"mappings":"kyBAOM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,YACP,CAAC,EAMYC,EAAqBH,EAGhC,MAAO,MAAM,EAKFI,EAAsBH,EAGjC,MAAO,OAAO,EAKHI,EAAwBJ,EAGnC,MAAO,SAAS,EAKLK,EAAyBL,EAGpC,MAAO,UAAU,ECxCnBM,EAAeC,iBAAe,CAC5B,WAAY,CACV,GAAI,+BACJ,YAAa,mDACb,eAAgB,mBAAA,EAElB,UAAW,CACT,GAAI,mCACJ,YAAa,iDACb,eAAgB,YAAA,EAElB,cAAe,CACb,GAAI,uCACJ,YAAa,qDACb,eAAgB,mBAAA,EAElB,oBAAqB,CACnB,GAAI,6CACJ,YAAa,2DACb,eAAgB,8BAAA,EAElB,0BAA2B,CACzB,GAAI,mDACJ,YAAa,6DACb,eAAgB,uCAAA,EAElB,UAAW,CACT,GAAI,mCACJ,YAAa,sCACb,eAAgB,YAAA,CAEpB,CAAC,EC1BYC,EAAsB,CAAC,CAClC,aAAAC,EACA,UAAAC,CACF,IAAgC,CAC9B,MAAMC,EAAkBC,EAAAA,WAAWC,2CAAsB,EACnD,CAAE,YAAAC,EAAa,UAAAC,CAAA,EAAcJ,EAC7BK,EAAeC,EAAAA,OAAuB,IAAI,EAC1CC,EAAkBD,EAAAA,OAAOF,CAAS,EAGxC,OAAID,IAAgB,MACX,MAITK,EAAAA,UAAU,IAAM,CAEd,IAAIC,EAEJ,GAAIL,GAAaG,EAAgB,SAAS,QAAQH,CAAS,IAAM,EAAG,CAGlE,MAAMM,EAAYL,EAAa,QACzBM,EAAgB,SAAS,cAE7BD,GAAW,SAASC,CAAa,GACjCA,GAAe,aAAa,MAAM,IAAM,eAIxCF,EAAY,WAAW,IAAM,CAEvBC,GACmBA,EAAU,cAC7B,qBAAA,GA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AAM,OACN,aAAAzC,EACA,UAAAC,EACA,uBACGsD,MAAA,CAEC,SAAA,CAAAvC,EAAAA,IAACwC,EAAAA,WAAA,CACC,KAAK,UACL,QAAQ,QACR,KAAMN,EACN,KAAK,QAEL,eAACO,EAAAA,MAAA,CAAA,CAAM,CAAA,CAAA,EAGTzC,EAAAA,IAACwC,EAAAA,WAAA,CACC,KAAK,UACL,QAAQ,QACR,KAAMN,EACN,KAAK,iBAEL,eAACQ,EAAAA,cAAA,CAAA,CAAc,CAAA,CAAA,CACjB,CAAA,CACF,CAAA,CAAA,EAGN,CAAA,CACF,EACA1C,EAAAA,IAACrB,GAAsB,QAAO,GAC5B,eAACgE,EAAAA,0CAAA,CAAQ,UAAU,aACjB,SAAA7C,EAAAA,KAAC8C,EAAAA,0CAAA,CACC,SAAA,CAAA5C,EAAAA,IAACpB,EAAA,CACC,SAAAoB,EAAAA,IAAC6C,EAAAA,SAAA,CAAA,CAAS,EACZ,EACA7C,EAAAA,IAACjB,EAAA,CACC,aAAAC,EACA,UAAAC,CAAA,CAAA,CACF,CAAA,CACF,EACF,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAAA,EAEJ,CAEJ,EAEAqC,EAAW,YAAc"}
@@ -6,17 +6,17 @@ import { $ as C, h as M } from "./Dialog-Qpq4hk89.es.js";
6
6
  import { $ as I } from "./Group-BBaUrRF9.es.js";
7
7
  import { useSlotRecipe as E } from "@chakra-ui/react/styled-system";
8
8
  import { h as H } from "./index-CtB71yr7.es.js";
9
- import { e as N } from "./extractStyleProps-DYXEhLtq.es.js";
9
+ import { e as N } from "./extract-style-props-DYXEhLtq.es.js";
10
10
  import { useContext as x, useRef as T, useEffect as R } from "react";
11
11
  import { defineMessages as V, FormattedMessage as w, useIntl as z } from "react-intl";
12
- import { T as B } from "./time-input--a_qv-Jk.es.js";
12
+ import { T as B } from "./time-input-B6we5H7C.es.js";
13
13
  import { Flex as F } from "@chakra-ui/react/flex";
14
14
  import { T as j } from "./text-BgiP8ZB6.es.js";
15
15
  import { $ as P } from "./Button-Dx3xzN8n.es.js";
16
16
  import { e as A, d as G } from "./utils-Cyja2WdR.es.js";
17
17
  import { d as L } from "./DateField-DZwn3cIj.es.js";
18
- import { D as O } from "./date-input-Cap8-3zj.es.js";
19
- import { C as q } from "./calendar-lD6G93R9.es.js";
18
+ import { D as O } from "./date-input-BiOdvpWz.es.js";
19
+ import { C as q } from "./calendar-okvAi9qK.es.js";
20
20
  import { B as W } from "./box-DuBoAZvq.es.js";
21
21
  import { I as $ } from "./icon-button-DQS2apw-.es.js";
22
22
  const { withProvider: Z, withContext: h } = /* @__PURE__ */ S({
@@ -217,4 +217,4 @@ _.displayName = "DatePicker";
217
217
  export {
218
218
  _ as D
219
219
  };
220
- //# sourceMappingURL=date-picker-ChZ8H-MT.es.js.map
220
+ //# sourceMappingURL=date-picker-EuMU6RtR.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker-ChZ8H-MT.es.js","sources":["../../src/components/date-picker/date-picker.slots.tsx","../../src/components/date-picker/date-picker.i18n.ts","../../src/components/date-picker/components/date-picker.time-input.tsx","../../src/components/date-picker/components/date-picker.custom-context.tsx","../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { DatePickerRootSlotProps } from \"./date-picker.types\";\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"datePicker\",\n});\n\n/**\n * Root component that provides the styling context for the DatePicker component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DatePickerRootSlot = withProvider<\n HTMLDivElement,\n DatePickerRootSlotProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the input group containing the DateInput.\n */\nexport const DatePickerGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"group\");\n\n/**\n * Slot component for the popover container.\n */\nexport const DatePickerPopoverSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"popover\");\n\n/**\n * Slot component for the calendar container within the popover.\n */\nexport const DatePickerCalendarSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"calendar\");\n\n/**\n * Slot component for the calendar header.\n */\nexport const DatePickerCalendarHeaderSlot = withContext<\n HTMLElement,\n HTMLChakraProps<\"header\">\n>(\"header\", \"calendarHeader\");\n\n/**\n * Slot component for the calendar grid.\n */\nexport const DatePickerCalendarGridSlot = withContext<\n HTMLTableElement,\n HTMLChakraProps<\"table\">\n>(\"table\", \"calendarGrid\");\n\n/**\n * Slot component for individual calendar cells.\n */\nexport const DatePickerCalendarCellSlot = withContext<\n HTMLTableCellElement,\n HTMLChakraProps<\"td\">\n>(\"td\", \"calendarCell\");\n","import { defineMessages } from \"react-intl\";\n\nexport default defineMessages({\n clearInput: {\n id: \"Nimbus.DatePicker.clearInput\",\n description: \"aria-label for clear input button in date picker\",\n defaultMessage: \"Clear input value\",\n },\n enterTime: {\n id: \"Nimbus.DatePicker.Time.enterTime\",\n description: \"aria-label for time input field in date picker\",\n defaultMessage: \"Enter time\",\n },\n enterTimeHour: {\n id: \"Nimbus.DatePicker.Time.enterTimeHour\",\n description: \"aria-label for hour-only time input in date picker\",\n defaultMessage: \"Enter time (hour)\",\n },\n enterTimeHourMinute: {\n id: \"Nimbus.DatePicker.Time.enterTimeHourMinute\",\n description: \"aria-label for hour and minute time input in date picker\",\n defaultMessage: \"Enter time (hour and minute)\",\n },\n enterTimeHourMinuteSecond: {\n id: \"Nimbus.DatePicker.Time.enterTimeHourMinuteSecond\",\n description: \"aria-label for full time input with seconds in date picker\",\n defaultMessage: \"Enter time (hour, minute, and second)\",\n },\n startTime: {\n id: \"Nimbus.DatePicker.Time.startTime\",\n description: \"Label for start time in date picker\",\n defaultMessage: \"Start time\",\n },\n});\n","import { Flex, Text, TimeInput } from \"@/components\";\nimport { useContext, useRef, useEffect } from \"react\";\nimport { DatePickerStateContext } from \"react-aria-components\";\nimport type { DatePickerTimeInputProps } from \"../date-picker.types\";\nimport { FormattedMessage } from \"react-intl\";\nimport messages from \"../date-picker.i18n\";\n\nexport const DatePickerTimeInput = ({\n hideTimeZone,\n hourCycle,\n}: DatePickerTimeInputProps) => {\n const datePickerState = useContext(DatePickerStateContext);\n const { granularity, dateValue } = datePickerState!;\n const timeInputRef = useRef<HTMLDivElement>(null);\n const previousDateRef = useRef(dateValue);\n\n // do not show up to the party if you're not invited\n if (granularity === \"day\") {\n return null;\n }\n\n // Focus the time input when date changes (user selects a date from calendar)\n useEffect(() => {\n // Check if date changed\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n if (dateValue && previousDateRef.current?.compare(dateValue) !== 0) {\n // Only auto-focus if no time input segment currently has focus\n // This prevents stealing focus during user interaction with time segments\n const container = timeInputRef.current;\n const activeElement = document.activeElement;\n const hasTimeSegmentFocus =\n container?.contains(activeElement) &&\n activeElement?.getAttribute(\"role\") === \"spinbutton\";\n\n if (!hasTimeSegmentFocus) {\n // Small delay to ensure the DOM is ready\n timeoutId = setTimeout(() => {\n // Find the first focusable segment within the time input container\n if (container) {\n const firstSegment = container.querySelector(\n '[role=\"spinbutton\"]'\n ) as HTMLElement;\n firstSegment?.focus();\n }\n }, 50);\n }\n }\n\n previousDateRef.current = dateValue;\n\n // Cleanup timeout on effect re-run or unmount to prevent memory leaks\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [dateValue]);\n\n return (\n <Flex\n ref={timeInputRef}\n borderTop=\"solid-25\"\n borderColor=\"neutral.3\"\n py=\"300\"\n px=\"400\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"200\"\n >\n <Text textStyle=\"xs\" fontWeight=\"500\" color=\"neutral.12\">\n <FormattedMessage {...messages.startTime} />\n </Text>\n <TimeInput\n slot=\"timeInput\"\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n );\n};\n","import { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n DatePickerStateContext,\n TimeFieldContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport type { PressEvent, TimeValue } from \"react-aria\";\nimport { useIntl } from \"react-intl\";\nimport messages from \"../date-picker.i18n\";\n\nexport const DatePickerCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const intl = useIntl();\n const buttonContext = useSlottedContext(ButtonContext) || {};\n const datePickerState = useContext(DatePickerStateContext);\n const noInputValue = datePickerState?.dateValue === null;\n\n const { timeValue, setTimeValue, granularity } = datePickerState!;\n\n // Try to get disabled state from the button context\n const isDatePickerDisabled = buttonContext?.isDisabled;\n\n // Generate default aria-label based on granularity if not provided\n const getDefaultTimeInputAriaLabel = () => {\n switch (granularity) {\n case \"hour\":\n return intl.formatMessage(messages.enterTimeHour);\n case \"minute\":\n return intl.formatMessage(messages.enterTimeHourMinute);\n case \"second\":\n return intl.formatMessage(messages.enterTimeHourMinuteSecond);\n default:\n return intl.formatMessage(messages.enterTime);\n }\n };\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n /** toggles the calendar popover */\n calendarToggle: {\n ...buttonContext,\n onPress: (event: PressEvent) => {\n // Ensure any active input (e.g., date picker segment) loses focus\n // because blurring the input will close the popover if it's open (or was just opened)\n const activeElement = document?.activeElement as HTMLElement | null;\n\n if (activeElement) {\n activeElement.blur();\n }\n\n buttonContext.onPress?.(event);\n },\n },\n /** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */\n clear: {\n onPress: () => datePickerState?.setValue(null),\n \"aria-label\": intl.formatMessage(messages.clearInput),\n isDisabled: isDatePickerDisabled,\n // Hide the button when there's no value\n style: noInputValue ? { display: \"none\" } : undefined,\n \"aria-hidden\": noInputValue ? true : undefined,\n },\n };\n\n /**\n * TimeInput slots\n * ================================\n */\n\n const timeInputSlots = {\n timeInput: {\n value: timeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null) {\n setTimeValue(value);\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(),\n },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: buttonSlots,\n },\n ],\n [TimeFieldContext, { slots: timeInputSlots }],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import {\n DatePickerRootSlot,\n DatePickerGroupSlot,\n DatePickerPopoverSlot,\n DatePickerCalendarSlot,\n} from \"./date-picker.slots\";\n\nimport { CalendarMonth, Close } from \"@commercetools/nimbus-icons\";\n\nimport {\n DatePicker as ReactAriaDatePicker,\n Group,\n Popover,\n Dialog,\n} from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\nimport type { DatePickerProps } from \"./date-picker.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { DateInput, Calendar, IconButton, Box } from \"@/components\";\nimport { DatePickerTimeInput } from \"./components/date-picker.time-input\";\nimport { DatePickerCustomContext } from \"./components/date-picker.custom-context\";\n\n/**\n * # DatePicker\n *\n * a UI component for users to enter or select a specific calendar date.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/datepicker}\n */\nexport const DatePicker = (props: DatePickerProps) => {\n const {\n size = \"md\",\n variant,\n granularity = \"day\",\n hideTimeZone,\n hourCycle,\n } = props;\n const recipe = useSlotRecipe({ recipe: datePickerSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n // the size of the buttons overlaying the input\n const overlayButtonSize = size === \"md\" ? \"xs\" : \"2xs\";\n\n // When granularity is \"day\", use the prop value (defaults to true if not provided)\n // For other granularities (time-based), force to false so users can set both date and time\n const shouldCloseOnSelect =\n granularity === \"day\" ? props.shouldCloseOnSelect : false;\n\n return (\n <DatePickerRootSlot {...recipeProps} {...styleProps} asChild>\n <ReactAriaDatePicker\n {...otherProps}\n shouldCloseOnSelect={shouldCloseOnSelect}\n >\n <DatePickerCustomContext>\n <DatePickerGroupSlot asChild>\n <Group>\n <DateInput\n size={size}\n variant={variant}\n width=\"full\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n trailingElement={\n <Box>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"clear\"\n >\n <Close />\n </IconButton>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"calendarToggle\"\n >\n <CalendarMonth />\n </IconButton>\n </Box>\n }\n />\n </Group>\n </DatePickerGroupSlot>\n <DatePickerPopoverSlot asChild>\n <Popover placement=\"bottom end\">\n <Dialog>\n <DatePickerCalendarSlot>\n <Calendar />\n </DatePickerCalendarSlot>\n <DatePickerTimeInput\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Dialog>\n </Popover>\n </DatePickerPopoverSlot>\n </DatePickerCustomContext>\n </ReactAriaDatePicker>\n </DatePickerRootSlot>\n );\n};\n\nDatePicker.displayName = \"DatePicker\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","DatePickerRootSlot","DatePickerGroupSlot","DatePickerPopoverSlot","DatePickerCalendarSlot","messages","defineMessages","DatePickerTimeInput","hideTimeZone","hourCycle","datePickerState","useContext","DatePickerStateContext","granularity","dateValue","timeInputRef","useRef","previousDateRef","useEffect","timeoutId","container","activeElement","jsxs","Flex","jsx","Text","FormattedMessage","TimeInput","DatePickerCustomContext","children","intl","useIntl","buttonContext","useSlottedContext","ButtonContext","noInputValue","timeValue","setTimeValue","isDatePickerDisabled","getDefaultTimeInputAriaLabel","buttonSlots","event","timeInputSlots","value","Provider","TimeFieldContext","DatePicker","props","size","variant","recipe","useSlotRecipe","datePickerSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","overlayButtonSize","shouldCloseOnSelect","ReactAriaDatePicker","Group","DateInput","Box","IconButton","Close","CalendarMonth","Popover","Dialog","Calendar"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAMYC,IAAqB,gBAAAH,EAGhC,OAAO,MAAM,GAKFI,IAAsB,gBAAAH,EAGjC,OAAO,OAAO,GAKHI,IAAwB,gBAAAJ,EAGnC,OAAO,SAAS,GAKLK,IAAyB,gBAAAL,EAGpC,OAAO,UAAU,GCxCnBM,IAAe,gBAAAC,EAAe;AAAA,EAC5B,YAAY;AAAA,IACV,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,WAAW;AAAA,IACT,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,eAAe;AAAA,IACb,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,qBAAqB;AAAA,IACnB,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,2BAA2B;AAAA,IACzB,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAAA,EAElB,WAAW;AAAA,IACT,IAAI;AAAA,IACJ,aAAa;AAAA,IACb,gBAAgB;AAAA,EAAA;AAEpB,CAAC,GC1BYC,IAAsB,CAAC;AAAA,EAClC,cAAAC;AAAA,EACA,WAAAC;AACF,MAAgC;AAC9B,QAAMC,IAAkBC,EAAWC,CAAsB,GACnD,EAAE,aAAAC,GAAa,WAAAC,EAAA,IAAcJ,GAC7BK,IAAeC,EAAuB,IAAI,GAC1CC,IAAkBD,EAAOF,CAAS;AAGxC,SAAID,MAAgB,QACX,QAITK,EAAU,MAAM;AAEd,QAAIC;AAEJ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EAAA,CACF;AAAA,QACA,gBAAA1C,EAACrB,KAAsB,SAAO,IAC5B,4BAACgE,GAAA,EAAQ,WAAU,cACjB,UAAA,gBAAA7C,EAAC8C,GAAA,EACC,UAAA;AAAA,UAAA,gBAAA5C,EAACpB,GAAA,EACC,UAAA,gBAAAoB,EAAC6C,GAAA,CAAA,CAAS,GACZ;AAAA,UACA,gBAAA7C;AAAA,YAACjB;AAAA,YAAA;AAAA,cACC,cAAAC;AAAA,cACA,WAAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CACF,GACF,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEAqC,EAAW,cAAc;"}
1
+ {"version":3,"file":"date-picker-EuMU6RtR.es.js","sources":["../../src/components/date-picker/date-picker.slots.tsx","../../src/components/date-picker/date-picker.i18n.ts","../../src/components/date-picker/components/date-picker.time-input.tsx","../../src/components/date-picker/components/date-picker.custom-context.tsx","../../src/components/date-picker/date-picker.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { DatePickerRootSlotProps } from \"./date-picker.types\";\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"datePicker\",\n});\n\n/**\n * Root component that provides the styling context for the DatePicker component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DatePickerRootSlot = withProvider<\n HTMLDivElement,\n DatePickerRootSlotProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the input group containing the DateInput.\n */\nexport const DatePickerGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"group\");\n\n/**\n * Slot component for the popover container.\n */\nexport const DatePickerPopoverSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"popover\");\n\n/**\n * Slot component for the calendar container within the popover.\n */\nexport const DatePickerCalendarSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"calendar\");\n\n/**\n * Slot component for the calendar header.\n */\nexport const DatePickerCalendarHeaderSlot = withContext<\n HTMLElement,\n HTMLChakraProps<\"header\">\n>(\"header\", \"calendarHeader\");\n\n/**\n * Slot component for the calendar grid.\n */\nexport const DatePickerCalendarGridSlot = withContext<\n HTMLTableElement,\n HTMLChakraProps<\"table\">\n>(\"table\", \"calendarGrid\");\n\n/**\n * Slot component for individual calendar cells.\n */\nexport const DatePickerCalendarCellSlot = withContext<\n HTMLTableCellElement,\n HTMLChakraProps<\"td\">\n>(\"td\", \"calendarCell\");\n","import { defineMessages } from \"react-intl\";\n\nexport default defineMessages({\n clearInput: {\n id: \"Nimbus.DatePicker.clearInput\",\n description: \"aria-label for clear input button in date picker\",\n defaultMessage: \"Clear input value\",\n },\n enterTime: {\n id: \"Nimbus.DatePicker.Time.enterTime\",\n description: \"aria-label for time input field in date picker\",\n defaultMessage: \"Enter time\",\n },\n enterTimeHour: {\n id: \"Nimbus.DatePicker.Time.enterTimeHour\",\n description: \"aria-label for hour-only time input in date picker\",\n defaultMessage: \"Enter time (hour)\",\n },\n enterTimeHourMinute: {\n id: \"Nimbus.DatePicker.Time.enterTimeHourMinute\",\n description: \"aria-label for hour and minute time input in date picker\",\n defaultMessage: \"Enter time (hour and minute)\",\n },\n enterTimeHourMinuteSecond: {\n id: \"Nimbus.DatePicker.Time.enterTimeHourMinuteSecond\",\n description: \"aria-label for full time input with seconds in date picker\",\n defaultMessage: \"Enter time (hour, minute, and second)\",\n },\n startTime: {\n id: \"Nimbus.DatePicker.Time.startTime\",\n description: \"Label for start time in date picker\",\n defaultMessage: \"Start time\",\n },\n});\n","import { Flex, Text, TimeInput } from \"@/components\";\nimport { useContext, useRef, useEffect } from \"react\";\nimport { DatePickerStateContext } from \"react-aria-components\";\nimport type { DatePickerTimeInputProps } from \"../date-picker.types\";\nimport { FormattedMessage } from \"react-intl\";\nimport messages from \"../date-picker.i18n\";\n\nexport const DatePickerTimeInput = ({\n hideTimeZone,\n hourCycle,\n}: DatePickerTimeInputProps) => {\n const datePickerState = useContext(DatePickerStateContext);\n const { granularity, dateValue } = datePickerState!;\n const timeInputRef = useRef<HTMLDivElement>(null);\n const previousDateRef = useRef(dateValue);\n\n // do not show up to the party if you're not invited\n if (granularity === \"day\") {\n return null;\n }\n\n // Focus the time input when date changes (user selects a date from calendar)\n useEffect(() => {\n // Check if date changed\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n if (dateValue && previousDateRef.current?.compare(dateValue) !== 0) {\n // Only auto-focus if no time input segment currently has focus\n // This prevents stealing focus during user interaction with time segments\n const container = timeInputRef.current;\n const activeElement = document.activeElement;\n const hasTimeSegmentFocus =\n container?.contains(activeElement) &&\n activeElement?.getAttribute(\"role\") === \"spinbutton\";\n\n if (!hasTimeSegmentFocus) {\n // Small delay to ensure the DOM is ready\n timeoutId = setTimeout(() => {\n // Find the first focusable segment within the time input container\n if (container) {\n const firstSegment = container.querySelector(\n '[role=\"spinbutton\"]'\n ) as HTMLElement;\n firstSegment?.focus();\n }\n }, 50);\n }\n }\n\n previousDateRef.current = dateValue;\n\n // Cleanup timeout on effect re-run or unmount to prevent memory leaks\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [dateValue]);\n\n return (\n <Flex\n ref={timeInputRef}\n borderTop=\"solid-25\"\n borderColor=\"neutral.3\"\n py=\"300\"\n px=\"400\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"200\"\n >\n <Text textStyle=\"xs\" fontWeight=\"500\" color=\"neutral.12\">\n <FormattedMessage {...messages.startTime} />\n </Text>\n <TimeInput\n slot=\"timeInput\"\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n );\n};\n","import { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n DatePickerStateContext,\n TimeFieldContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport type { PressEvent, TimeValue } from \"react-aria\";\nimport { useIntl } from \"react-intl\";\nimport messages from \"../date-picker.i18n\";\n\nexport const DatePickerCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const intl = useIntl();\n const buttonContext = useSlottedContext(ButtonContext) || {};\n const datePickerState = useContext(DatePickerStateContext);\n const noInputValue = datePickerState?.dateValue === null;\n\n const { timeValue, setTimeValue, granularity } = datePickerState!;\n\n // Try to get disabled state from the button context\n const isDatePickerDisabled = buttonContext?.isDisabled;\n\n // Generate default aria-label based on granularity if not provided\n const getDefaultTimeInputAriaLabel = () => {\n switch (granularity) {\n case \"hour\":\n return intl.formatMessage(messages.enterTimeHour);\n case \"minute\":\n return intl.formatMessage(messages.enterTimeHourMinute);\n case \"second\":\n return intl.formatMessage(messages.enterTimeHourMinuteSecond);\n default:\n return intl.formatMessage(messages.enterTime);\n }\n };\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n /** toggles the calendar popover */\n calendarToggle: {\n ...buttonContext,\n onPress: (event: PressEvent) => {\n // Ensure any active input (e.g., date picker segment) loses focus\n // because blurring the input will close the popover if it's open (or was just opened)\n const activeElement = document?.activeElement as HTMLElement | null;\n\n if (activeElement) {\n activeElement.blur();\n }\n\n buttonContext.onPress?.(event);\n },\n },\n /** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */\n clear: {\n onPress: () => datePickerState?.setValue(null),\n \"aria-label\": intl.formatMessage(messages.clearInput),\n isDisabled: isDatePickerDisabled,\n // Hide the button when there's no value\n style: noInputValue ? { display: \"none\" } : undefined,\n \"aria-hidden\": noInputValue ? true : undefined,\n },\n };\n\n /**\n * TimeInput slots\n * ================================\n */\n\n const timeInputSlots = {\n timeInput: {\n value: timeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null) {\n setTimeValue(value);\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(),\n },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: buttonSlots,\n },\n ],\n [TimeFieldContext, { slots: timeInputSlots }],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import {\n DatePickerRootSlot,\n DatePickerGroupSlot,\n DatePickerPopoverSlot,\n DatePickerCalendarSlot,\n} from \"./date-picker.slots\";\n\nimport { CalendarMonth, Close } from \"@commercetools/nimbus-icons\";\n\nimport {\n DatePicker as ReactAriaDatePicker,\n Group,\n Popover,\n Dialog,\n} from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { datePickerSlotRecipe } from \"./date-picker.recipe\";\nimport type { DatePickerProps } from \"./date-picker.types\";\nimport { extractStyleProps } from \"@/utils\";\nimport { DateInput, Calendar, IconButton, Box } from \"@/components\";\nimport { DatePickerTimeInput } from \"./components/date-picker.time-input\";\nimport { DatePickerCustomContext } from \"./components/date-picker.custom-context\";\n\n/**\n * # DatePicker\n *\n * a UI component for users to enter or select a specific calendar date.\n *\n * @see {@link https://nimbus-documentation.vercel.app/components/inputs/datepicker}\n */\nexport const DatePicker = (props: DatePickerProps) => {\n const {\n size = \"md\",\n variant,\n granularity = \"day\",\n hideTimeZone,\n hourCycle,\n } = props;\n const recipe = useSlotRecipe({ recipe: datePickerSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n // the size of the buttons overlaying the input\n const overlayButtonSize = size === \"md\" ? \"xs\" : \"2xs\";\n\n // When granularity is \"day\", use the prop value (defaults to true if not provided)\n // For other granularities (time-based), force to false so users can set both date and time\n const shouldCloseOnSelect =\n granularity === \"day\" ? props.shouldCloseOnSelect : false;\n\n return (\n <DatePickerRootSlot {...recipeProps} {...styleProps} asChild>\n <ReactAriaDatePicker\n {...otherProps}\n shouldCloseOnSelect={shouldCloseOnSelect}\n >\n <DatePickerCustomContext>\n <DatePickerGroupSlot asChild>\n <Group>\n <DateInput\n size={size}\n variant={variant}\n width=\"full\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n trailingElement={\n <Box>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"clear\"\n >\n <Close />\n </IconButton>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"calendarToggle\"\n >\n <CalendarMonth />\n </IconButton>\n </Box>\n }\n />\n </Group>\n </DatePickerGroupSlot>\n <DatePickerPopoverSlot asChild>\n <Popover placement=\"bottom end\">\n <Dialog>\n <DatePickerCalendarSlot>\n <Calendar />\n </DatePickerCalendarSlot>\n <DatePickerTimeInput\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Dialog>\n </Popover>\n </DatePickerPopoverSlot>\n </DatePickerCustomContext>\n </ReactAriaDatePicker>\n </DatePickerRootSlot>\n );\n};\n\nDatePicker.displayName = \"DatePicker\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","DatePickerRootSlot","DatePickerGroupSlot","DatePickerPopoverSlot","DatePickerCalendarSlot","messages","defineMessages","DatePickerTimeInput","hideTimeZone","hourCycle","datePickerState","useContext","DatePickerStateContext","granularity","dateValue","timeInputRef","useRef","previousDateRef","useEffect","timeoutId","container","activeElement","jsxs","Flex","jsx","Text","FormattedMessage","TimeInput","DatePickerCustomContext","children","intl","useIntl","buttonContext","useSlottedContext","ButtonContext","noInputValue","timeValue","setTimeValue","isDatePickerDisabled","getDefaultTimeInputAriaLabel","buttonSlots","event","timeInputSlots","value","Provider","TimeFieldContext","DatePicker","props","size","variant","recipe","useSlotRecipe","datePickerSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","overlayButtonSize","shouldCloseOnSelect","ReactAriaDatePicker","Group","DateInput","Box","IconButton","Close","CalendarMonth","Popover","Dialog","Calendar"],"mappings":";;;;;;;;;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AAA,EACC,UAAA;AAAA,UAAA,gBAAA5C,EAACpB,GAAA,EACC,UAAA,gBAAAoB,EAAC6C,GAAA,CAAA,CAAS,GACZ;AAAA,UACA,gBAAA7C;AAAA,YAACjB;AAAA,YAAA;AAAA,cACC,cAAAC;AAAA,cACA,WAAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CACF,GACF,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEAqC,EAAW,cAAc;"}
@@ -6,16 +6,16 @@ import { $ as w, h as W } from "./Dialog-Qpq4hk89.es.js";
6
6
  import { $ as j } from "./Group-BBaUrRF9.es.js";
7
7
  import { useSlotRecipe as F } from "@chakra-ui/react/styled-system";
8
8
  import { g as A } from "./index-CtB71yr7.es.js";
9
- import { e as B } from "./extractStyleProps-DYXEhLtq.es.js";
9
+ import { e as B } from "./extract-style-props-DYXEhLtq.es.js";
10
10
  import { useContext as I, useRef as S, useEffect as G } from "react";
11
11
  import { Flex as x } from "@chakra-ui/react/flex";
12
12
  import { T as y } from "./text-BgiP8ZB6.es.js";
13
- import { T as P } from "./time-input--a_qv-Jk.es.js";
13
+ import { T as P } from "./time-input-B6we5H7C.es.js";
14
14
  import { $ as C } from "./Button-Dx3xzN8n.es.js";
15
15
  import { e as O, d as q } from "./utils-Cyja2WdR.es.js";
16
16
  import { d as H } from "./DateField-DZwn3cIj.es.js";
17
- import { R as L } from "./range-calendar-DBpl6y5i.es.js";
18
- import { D } from "./date-input-Cap8-3zj.es.js";
17
+ import { R as L } from "./range-calendar-PUt59Hda.es.js";
18
+ import { D } from "./date-input-BiOdvpWz.es.js";
19
19
  import { I as R } from "./icon-button-DQS2apw-.es.js";
20
20
  const { withProvider: M, withContext: $ } = /* @__PURE__ */ k({
21
21
  key: "dateRangePicker"
@@ -278,4 +278,4 @@ Z.displayName = "DateRangePicker";
278
278
  export {
279
279
  Z as D
280
280
  };
281
- //# sourceMappingURL=date-range-picker-DGWMdcAN.es.js.map
281
+ //# sourceMappingURL=date-range-picker-CL-QH8BW.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-range-picker-DGWMdcAN.es.js","sources":["../../src/components/date-range-picker/date-range-picker.slots.tsx","../../src/components/date-range-picker/components/date-range-picker.time-input.tsx","../../src/components/date-range-picker/components/date-range-picker.custom-context.tsx","../../src/components/date-range-picker/date-range-picker.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { DateRangePickerRootSlotProps } from \"./date-range-picker.types\";\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"dateRangePicker\",\n});\n\n/**\n * Root component that provides the styling context for the DateRangePicker component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DateRangePickerRootSlot = withProvider<\n HTMLDivElement,\n DateRangePickerRootSlotProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the input group containing the DateInput and trigger button.\n */\nexport const DateRangePickerGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"group\");\n\n/**\n * Slot component for the trigger button that opens the calendar popover.\n */\nexport const DateRangePickerTriggerSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"trigger\");\n\n/**\n * Slot component for the popover container.\n */\nexport const DateRangePickerPopoverSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"popover\");\n\n/**\n * Slot component for the calendar container within the popover.\n */\nexport const DateRangePickerCalendarSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"calendar\");\n\n/**\n * Slot component for the calendar header.\n */\nexport const DateRangePickerCalendarHeaderSlot = withContext<\n HTMLElement,\n HTMLChakraProps<\"header\">\n>(\"header\", \"calendarHeader\");\n\n/**\n * Slot component for the calendar grid.\n */\nexport const DateRangePickerCalendarGridSlot = withContext<\n HTMLTableElement,\n HTMLChakraProps<\"table\">\n>(\"table\", \"calendarGrid\");\n\n/**\n * Slot component for individual calendar cells.\n */\nexport const DateRangePickerCalendarCellSlot = withContext<\n HTMLTableCellElement,\n HTMLChakraProps<\"td\">\n>(\"td\", \"calendarCell\");\n","import { Flex, Text, TimeInput } from \"@/components\";\nimport { useContext, useRef, useEffect } from \"react\";\nimport { DateRangePickerStateContext } from \"react-aria-components\";\nimport type { DateRangePickerTimeInputProps } from \"../date-range-picker.types\";\n\nexport const DateRangePickerTimeInput = ({\n hideTimeZone,\n hourCycle,\n}: DateRangePickerTimeInputProps) => {\n const dateRangePickerState = useContext(DateRangePickerStateContext);\n const { granularity, value } = dateRangePickerState!;\n const timeInputRef = useRef<HTMLDivElement>(null);\n const previousValueRef = useRef(value);\n\n // do not show up to the party if you're not invited\n if (granularity === \"day\") {\n return null;\n }\n\n // Focus the time input when date range changes (user selects dates from calendar)\n useEffect(() => {\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n // Check if date range changed by comparing start and end dates\n const hasValueChanged =\n (value?.start &&\n previousValueRef.current?.start?.compare(value.start) !== 0) ||\n (value?.end && previousValueRef.current?.end?.compare(value.end) !== 0);\n\n if (hasValueChanged) {\n // Only auto-focus if no time input segment currently has focus\n // This prevents stealing focus during user interaction with time segments\n const container = timeInputRef.current;\n const activeElement = document.activeElement;\n const hasTimeSegmentFocus =\n container?.contains(activeElement) &&\n activeElement?.getAttribute(\"role\") === \"spinbutton\";\n\n if (!hasTimeSegmentFocus) {\n // Small delay to ensure the DOM is ready\n timeoutId = setTimeout(() => {\n // Find the first focusable segment within the time input container\n if (container) {\n const firstSegment = container.querySelector(\n '[role=\"spinbutton\"]'\n ) as HTMLElement;\n\n if (firstSegment) {\n firstSegment.focus();\n }\n }\n }, 50);\n }\n }\n\n previousValueRef.current = value;\n\n // Cleanup timeout on effect re-run or unmount to prevent memory leaks\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [value]);\n\n return (\n <Flex\n ref={timeInputRef}\n borderTop=\"solid-25\"\n borderColor=\"neutral.3\"\n py=\"300\"\n px=\"400\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"200\"\n >\n {/* Start DateInput with separate label */}\n <Flex alignItems=\"center\" gap=\"200\">\n {/* TODO: translate hardcoded string */}\n <Text\n textStyle=\"xs\"\n fontWeight=\"500\"\n color=\"neutral.12\"\n minWidth=\"fit-content\"\n >\n Start time\n </Text>\n <TimeInput\n slot=\"startTimeInput\"\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n\n {/* End DateInput with separate label */}\n <Flex alignItems=\"center\" gap=\"200\">\n {/* TODO: translate hardcoded string */}\n <Text\n textStyle=\"xs\"\n fontWeight=\"500\"\n color=\"neutral.12\"\n minWidth=\"fit-content\"\n >\n End time\n </Text>\n <TimeInput\n slot=\"endTimeInput\"\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n </Flex>\n );\n};\n","import { useContext, type ReactNode } from \"react\";\nimport {\n Provider,\n ButtonContext,\n DateRangePickerStateContext,\n TimeFieldContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport type { PressEvent, TimeValue } from \"react-aria\";\n\nexport const DateRangePickerCustomContext = ({\n children,\n}: {\n children: ReactNode;\n}) => {\n const buttonContext = useSlottedContext(ButtonContext) || {};\n const dateRangePickerState = useContext(DateRangePickerStateContext);\n\n // Check if all 6 segments (start: day, month, year; end: day, month, year) have values\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const hasCompleteRangeDate = (date: any) =>\n date?.day && date?.month && date?.year;\n\n const incompleteValue =\n !dateRangePickerState?.value ||\n !hasCompleteRangeDate(dateRangePickerState.value.start) ||\n !hasCompleteRangeDate(dateRangePickerState.value.end);\n\n const { granularity } = dateRangePickerState!;\n\n // Extract time values from start and end dates separately\n const startTimeValue =\n dateRangePickerState?.value?.start &&\n \"hour\" in dateRangePickerState.value.start\n ? dateRangePickerState.value.start\n : null;\n const endTimeValue =\n dateRangePickerState?.value?.end && \"hour\" in dateRangePickerState.value.end\n ? dateRangePickerState.value.end\n : null;\n\n // Try to get disabled state from the button context\n const isDateRangePickerDisabled = buttonContext?.isDisabled;\n\n // Generate default aria-label based on granularity if not provided\n const getDefaultTimeInputAriaLabel = (type: \"start\" | \"end\") => {\n const prefix = type === \"start\" ? \"Start\" : \"End\";\n switch (granularity) {\n case \"hour\":\n return `${prefix} time (hour)`;\n case \"minute\":\n return `${prefix} time (hour and minute)`;\n case \"second\":\n return `${prefix} time (hour, minute, and second)`;\n default:\n return `${prefix} time`;\n }\n };\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n /** toggles the calendar popover */\n calendarToggle: {\n ...buttonContext,\n onPress: (event: PressEvent) => {\n // Ensure any active input (e.g., date picker segment) loses focus\n // because blurring the input will close the popover if it's open (or was just opened)\n const activeElement = document?.activeElement as HTMLElement | null;\n\n if (activeElement) {\n activeElement.blur();\n }\n\n buttonContext.onPress?.(event);\n },\n },\n /** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */\n clear: {\n // Clear both start and end values\n onPress: () => dateRangePickerState?.setValue(null),\n \"aria-label\": \"Clear input value\",\n isDisabled: isDateRangePickerDisabled,\n // Hide the button when there's no value\n style: incompleteValue ? { display: \"none\" } : undefined,\n \"aria-hidden\": incompleteValue ? true : undefined,\n },\n };\n\n /**\n * TimeInput slots\n * ================================\n */\n\n // Separate time input slots for start and end times\n const timeInputSlots = {\n startTimeInput: {\n value: startTimeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null && dateRangePickerState?.value?.start) {\n // Update the start date with the new time\n const currentValue = dateRangePickerState.value;\n const startDate = currentValue.start;\n const endDate = currentValue.end;\n if (startDate && endDate) {\n const newStartDate = startDate.set({\n hour: value.hour,\n minute: value.minute || 0,\n second: value.second || 0,\n millisecond: value.millisecond || 0,\n });\n\n dateRangePickerState.setValue({\n start: newStartDate,\n end: endDate,\n });\n }\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(\"start\"),\n },\n endTimeInput: {\n value: endTimeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null && dateRangePickerState?.value?.end) {\n // Update the end date with the new time\n const currentValue = dateRangePickerState.value;\n const startDate = currentValue.start;\n const endDate = currentValue.end;\n if (startDate && endDate) {\n const newEndDate = endDate.set({\n hour: value.hour,\n minute: value.minute || 0,\n second: value.second || 0,\n millisecond: value.millisecond || 0,\n });\n\n dateRangePickerState.setValue({\n start: startDate,\n end: newEndDate,\n });\n }\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(\"end\"),\n },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: buttonSlots,\n },\n ],\n [TimeFieldContext, { slots: timeInputSlots }],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import {\n DateRangePickerRootSlot,\n DateRangePickerGroupSlot,\n DateRangePickerTriggerSlot,\n DateRangePickerPopoverSlot,\n DateRangePickerCalendarSlot,\n} from \"./date-range-picker.slots\";\n\nimport { CalendarMonth, Close } from \"@commercetools/nimbus-icons\";\n\nimport {\n DateRangePicker as ReactAriaDateRangePicker,\n Group,\n Popover,\n Dialog,\n} from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { dateRangePickerSlotRecipe } from \"./date-range-picker.recipe\";\nimport type { DateRangePickerProps } from \"./date-range-picker.types\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { DateInput, RangeCalendar, IconButton, Text } from \"@/components\";\nimport { DateRangePickerTimeInput } from \"./components/date-range-picker.time-input\";\nimport { DateRangePickerCustomContext } from \"./components/date-range-picker.custom-context\";\n\n/**\n * DateRangePicker\n * ============================================================\n * Combines a DateInput with a RangeCalendar popover for date range selection.\n * Users can either type a date range directly or select from the calendar.\n */\nexport const DateRangePicker = (props: DateRangePickerProps) => {\n // Forward hideTimeZone and hourCycle to child components (footer time inputs)\n const { granularity = \"day\", hideTimeZone, hourCycle } = props;\n const recipe = useSlotRecipe({ recipe: dateRangePickerSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n // Extract size and variant from recipe props to pass to DateInputs\n const { size = \"md\" } = recipeProps;\n\n // the size of the buttons overlaying the input\n const overlayButtonSize = size === \"md\" ? \"xs\" : \"2xs\";\n\n // When granularity is \"day\", use the prop value (defaults to true if not provided)\n // For other granularities (time-based), force to false so users can set both date and time\n const shouldCloseOnSelect =\n granularity === \"day\" ? props.shouldCloseOnSelect : false;\n\n return (\n <DateRangePickerRootSlot {...recipeProps} {...styleProps} asChild>\n <ReactAriaDateRangePicker\n {...otherProps}\n shouldCloseOnSelect={shouldCloseOnSelect}\n >\n <DateRangePickerCustomContext>\n <DateRangePickerGroupSlot asChild>\n <Group>\n <DateInput\n slot=\"start\"\n size={props.size}\n variant=\"plain\"\n width=\"auto\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n <Text\n as=\"span\"\n px=\"150\"\n color=\"neutral.11\"\n userSelect=\"none\"\n aria-hidden=\"true\"\n slot={null}\n >\n –\n </Text>\n <DateInput\n slot=\"end\"\n size={props.size}\n variant=\"plain\"\n width=\"auto\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n <DateRangePickerTriggerSlot>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"clear\"\n >\n <Close />\n </IconButton>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"calendarToggle\"\n >\n <CalendarMonth />\n </IconButton>\n </DateRangePickerTriggerSlot>\n </Group>\n </DateRangePickerGroupSlot>\n <DateRangePickerPopoverSlot asChild>\n <Popover placement=\"bottom end\">\n <Dialog>\n <DateRangePickerCalendarSlot>\n <RangeCalendar />\n </DateRangePickerCalendarSlot>\n <DateRangePickerTimeInput\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Dialog>\n </Popover>\n </DateRangePickerPopoverSlot>\n </DateRangePickerCustomContext>\n </ReactAriaDateRangePicker>\n </DateRangePickerRootSlot>\n );\n};\n\nDateRangePicker.displayName = \"DateRangePicker\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","DateRangePickerRootSlot","DateRangePickerGroupSlot","DateRangePickerTriggerSlot","DateRangePickerPopoverSlot","DateRangePickerCalendarSlot","DateRangePickerTimeInput","hideTimeZone","hourCycle","dateRangePickerState","useContext","DateRangePickerStateContext","granularity","value","timeInputRef","useRef","previousValueRef","useEffect","timeoutId","container","activeElement","firstSegment","jsxs","Flex","jsx","Text","TimeInput","DateRangePickerCustomContext","children","buttonContext","useSlottedContext","ButtonContext","hasCompleteRangeDate","date","incompleteValue","startTimeValue","endTimeValue","isDateRangePickerDisabled","getDefaultTimeInputAriaLabel","type","prefix","buttonSlots","event","timeInputSlots","currentValue","startDate","endDate","newStartDate","newEndDate","Provider","TimeFieldContext","DateRangePicker","props","recipe","useSlotRecipe","dateRangePickerSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","size","overlayButtonSize","shouldCloseOnSelect","ReactAriaDateRangePicker","Group","DateInput","IconButton","Close","CalendarMonth","Popover","Dialog","RangeCalendar"],"mappings":";;;;;;;;;;;;;;;;;;;AAOA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAMYC,IAA0B,gBAAAH,EAGrC,OAAO,MAAM,GAKFI,IAA2B,gBAAAH,EAGtC,OAAO,OAAO,GAKHI,IAA6B,gBAAAJ,EAG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R,MAAML;AAAA,gBACN,MAAK;AAAA,gBAEL,4BAACO,GAAA,CAAA,CAAc;AAAA,cAAA;AAAA,YAAA;AAAA,UACjB,EAAA,CACF;AAAA,QAAA,EAAA,CACF,EAAA,CACF;AAAA,QACA,gBAAA7C,EAACpB,KAA2B,SAAO,IACjC,4BAACkE,GAAA,EAAQ,WAAU,cACjB,UAAA,gBAAAhD,EAACiD,GAAA,EACC,UAAA;AAAA,UAAA,gBAAA/C,EAACnB,GAAA,EACC,UAAA,gBAAAmB,EAACgD,GAAA,CAAA,CAAc,GACjB;AAAA,UACA,gBAAAhD;AAAA,YAAClB;AAAA,YAAA;AAAA,cACC,cAAAC;AAAA,cACA,WAAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CACF,GACF,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEA2C,EAAgB,cAAc;"}
1
+ {"version":3,"file":"date-range-picker-CL-QH8BW.es.js","sources":["../../src/components/date-range-picker/date-range-picker.slots.tsx","../../src/components/date-range-picker/components/date-range-picker.time-input.tsx","../../src/components/date-range-picker/components/date-range-picker.custom-context.tsx","../../src/components/date-range-picker/date-range-picker.tsx"],"sourcesContent":["import {\n type HTMLChakraProps,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\nimport type { DateRangePickerRootSlotProps } from \"./date-range-picker.types\";\n\n// Correctly destructure from createSlotRecipeContext based on project examples\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"dateRangePicker\",\n});\n\n/**\n * Root component that provides the styling context for the DateRangePicker component.\n * Uses Chakra UI's recipe context system for consistent styling across instances.\n */\nexport const DateRangePickerRootSlot = withProvider<\n HTMLDivElement,\n DateRangePickerRootSlotProps\n>(\"div\", \"root\");\n\n/**\n * Slot component for the input group containing the DateInput and trigger button.\n */\nexport const DateRangePickerGroupSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"group\");\n\n/**\n * Slot component for the trigger button that opens the calendar popover.\n */\nexport const DateRangePickerTriggerSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"trigger\");\n\n/**\n * Slot component for the popover container.\n */\nexport const DateRangePickerPopoverSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"popover\");\n\n/**\n * Slot component for the calendar container within the popover.\n */\nexport const DateRangePickerCalendarSlot = withContext<\n HTMLDivElement,\n HTMLChakraProps<\"div\">\n>(\"div\", \"calendar\");\n\n/**\n * Slot component for the calendar header.\n */\nexport const DateRangePickerCalendarHeaderSlot = withContext<\n HTMLElement,\n HTMLChakraProps<\"header\">\n>(\"header\", \"calendarHeader\");\n\n/**\n * Slot component for the calendar grid.\n */\nexport const DateRangePickerCalendarGridSlot = withContext<\n HTMLTableElement,\n HTMLChakraProps<\"table\">\n>(\"table\", \"calendarGrid\");\n\n/**\n * Slot component for individual calendar cells.\n */\nexport const DateRangePickerCalendarCellSlot = withContext<\n HTMLTableCellElement,\n HTMLChakraProps<\"td\">\n>(\"td\", \"calendarCell\");\n","import { Flex, Text, TimeInput } from \"@/components\";\nimport { useContext, useRef, useEffect } from \"react\";\nimport { DateRangePickerStateContext } from \"react-aria-components\";\nimport type { DateRangePickerTimeInputProps } from \"../date-range-picker.types\";\n\nexport const DateRangePickerTimeInput = ({\n hideTimeZone,\n hourCycle,\n}: DateRangePickerTimeInputProps) => {\n const dateRangePickerState = useContext(DateRangePickerStateContext);\n const { granularity, value } = dateRangePickerState!;\n const timeInputRef = useRef<HTMLDivElement>(null);\n const previousValueRef = useRef(value);\n\n // do not show up to the party if you're not invited\n if (granularity === \"day\") {\n return null;\n }\n\n // Focus the time input when date range changes (user selects dates from calendar)\n useEffect(() => {\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n\n // Check if date range changed by comparing start and end dates\n const hasValueChanged =\n (value?.start &&\n previousValueRef.current?.start?.compare(value.start) !== 0) ||\n (value?.end && previousValueRef.current?.end?.compare(value.end) !== 0);\n\n if (hasValueChanged) {\n // Only auto-focus if no time input segment currently has focus\n // This prevents stealing focus during user interaction with time segments\n const container = timeInputRef.current;\n const activeElement = document.activeElement;\n const hasTimeSegmentFocus =\n container?.contains(activeElement) &&\n activeElement?.getAttribute(\"role\") === \"spinbutton\";\n\n if (!hasTimeSegmentFocus) {\n // Small delay to ensure the DOM is ready\n timeoutId = setTimeout(() => {\n // Find the first focusable segment within the time input container\n if (container) {\n const firstSegment = container.querySelector(\n '[role=\"spinbutton\"]'\n ) as HTMLElement;\n\n if (firstSegment) {\n firstSegment.focus();\n }\n }\n }, 50);\n }\n }\n\n previousValueRef.current = value;\n\n // Cleanup timeout on effect re-run or unmount to prevent memory leaks\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n };\n }, [value]);\n\n return (\n <Flex\n ref={timeInputRef}\n borderTop=\"solid-25\"\n borderColor=\"neutral.3\"\n py=\"300\"\n px=\"400\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap=\"200\"\n >\n {/* Start DateInput with separate label */}\n <Flex alignItems=\"center\" gap=\"200\">\n {/* TODO: translate hardcoded string */}\n <Text\n textStyle=\"xs\"\n fontWeight=\"500\"\n color=\"neutral.12\"\n minWidth=\"fit-content\"\n >\n Start time\n </Text>\n <TimeInput\n slot=\"startTimeInput\"\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n\n {/* End DateInput with separate label */}\n <Flex alignItems=\"center\" gap=\"200\">\n {/* TODO: translate hardcoded string */}\n <Text\n textStyle=\"xs\"\n fontWeight=\"500\"\n color=\"neutral.12\"\n minWidth=\"fit-content\"\n >\n End time\n </Text>\n <TimeInput\n slot=\"endTimeInput\"\n variant=\"ghost\"\n size=\"sm\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Flex>\n </Flex>\n );\n};\n","import { useContext, type ReactNode } from \"react\";\nimport {\n Provider,\n ButtonContext,\n DateRangePickerStateContext,\n TimeFieldContext,\n useSlottedContext,\n} from \"react-aria-components\";\nimport type { PressEvent, TimeValue } from \"react-aria\";\n\nexport const DateRangePickerCustomContext = ({\n children,\n}: {\n children: ReactNode;\n}) => {\n const buttonContext = useSlottedContext(ButtonContext) || {};\n const dateRangePickerState = useContext(DateRangePickerStateContext);\n\n // Check if all 6 segments (start: day, month, year; end: day, month, year) have values\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const hasCompleteRangeDate = (date: any) =>\n date?.day && date?.month && date?.year;\n\n const incompleteValue =\n !dateRangePickerState?.value ||\n !hasCompleteRangeDate(dateRangePickerState.value.start) ||\n !hasCompleteRangeDate(dateRangePickerState.value.end);\n\n const { granularity } = dateRangePickerState!;\n\n // Extract time values from start and end dates separately\n const startTimeValue =\n dateRangePickerState?.value?.start &&\n \"hour\" in dateRangePickerState.value.start\n ? dateRangePickerState.value.start\n : null;\n const endTimeValue =\n dateRangePickerState?.value?.end && \"hour\" in dateRangePickerState.value.end\n ? dateRangePickerState.value.end\n : null;\n\n // Try to get disabled state from the button context\n const isDateRangePickerDisabled = buttonContext?.isDisabled;\n\n // Generate default aria-label based on granularity if not provided\n const getDefaultTimeInputAriaLabel = (type: \"start\" | \"end\") => {\n const prefix = type === \"start\" ? \"Start\" : \"End\";\n switch (granularity) {\n case \"hour\":\n return `${prefix} time (hour)`;\n case \"minute\":\n return `${prefix} time (hour and minute)`;\n case \"second\":\n return `${prefix} time (hour, minute, and second)`;\n default:\n return `${prefix} time`;\n }\n };\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n /** toggles the calendar popover */\n calendarToggle: {\n ...buttonContext,\n onPress: (event: PressEvent) => {\n // Ensure any active input (e.g., date picker segment) loses focus\n // because blurring the input will close the popover if it's open (or was just opened)\n const activeElement = document?.activeElement as HTMLElement | null;\n\n if (activeElement) {\n activeElement.blur();\n }\n\n buttonContext.onPress?.(event);\n },\n },\n /** Clear button that displays when there's a value in each segment - hidden from both visual and screen readers when there's no value */\n clear: {\n // Clear both start and end values\n onPress: () => dateRangePickerState?.setValue(null),\n \"aria-label\": \"Clear input value\",\n isDisabled: isDateRangePickerDisabled,\n // Hide the button when there's no value\n style: incompleteValue ? { display: \"none\" } : undefined,\n \"aria-hidden\": incompleteValue ? true : undefined,\n },\n };\n\n /**\n * TimeInput slots\n * ================================\n */\n\n // Separate time input slots for start and end times\n const timeInputSlots = {\n startTimeInput: {\n value: startTimeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null && dateRangePickerState?.value?.start) {\n // Update the start date with the new time\n const currentValue = dateRangePickerState.value;\n const startDate = currentValue.start;\n const endDate = currentValue.end;\n if (startDate && endDate) {\n const newStartDate = startDate.set({\n hour: value.hour,\n minute: value.minute || 0,\n second: value.second || 0,\n millisecond: value.millisecond || 0,\n });\n\n dateRangePickerState.setValue({\n start: newStartDate,\n end: endDate,\n });\n }\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(\"start\"),\n },\n endTimeInput: {\n value: endTimeValue,\n onChange: (value: TimeValue | null) => {\n if (value !== null && dateRangePickerState?.value?.end) {\n // Update the end date with the new time\n const currentValue = dateRangePickerState.value;\n const startDate = currentValue.start;\n const endDate = currentValue.end;\n if (startDate && endDate) {\n const newEndDate = endDate.set({\n hour: value.hour,\n minute: value.minute || 0,\n second: value.second || 0,\n millisecond: value.millisecond || 0,\n });\n\n dateRangePickerState.setValue({\n start: startDate,\n end: newEndDate,\n });\n }\n }\n },\n granularity: granularity === \"day\" ? undefined : granularity,\n \"aria-label\": getDefaultTimeInputAriaLabel(\"end\"),\n },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n slots: buttonSlots,\n },\n ],\n [TimeFieldContext, { slots: timeInputSlots }],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import {\n DateRangePickerRootSlot,\n DateRangePickerGroupSlot,\n DateRangePickerTriggerSlot,\n DateRangePickerPopoverSlot,\n DateRangePickerCalendarSlot,\n} from \"./date-range-picker.slots\";\n\nimport { CalendarMonth, Close } from \"@commercetools/nimbus-icons\";\n\nimport {\n DateRangePicker as ReactAriaDateRangePicker,\n Group,\n Popover,\n Dialog,\n} from \"react-aria-components\";\nimport { useSlotRecipe } from \"@chakra-ui/react/styled-system\";\nimport { dateRangePickerSlotRecipe } from \"./date-range-picker.recipe\";\nimport type { DateRangePickerProps } from \"./date-range-picker.types\";\nimport { extractStyleProps } from \"@/utils\";\nimport { DateInput, RangeCalendar, IconButton, Text } from \"@/components\";\nimport { DateRangePickerTimeInput } from \"./components/date-range-picker.time-input\";\nimport { DateRangePickerCustomContext } from \"./components/date-range-picker.custom-context\";\n\n/**\n * DateRangePicker\n * ============================================================\n * Combines a DateInput with a RangeCalendar popover for date range selection.\n * Users can either type a date range directly or select from the calendar.\n */\nexport const DateRangePicker = (props: DateRangePickerProps) => {\n // Forward hideTimeZone and hourCycle to child components (footer time inputs)\n const { granularity = \"day\", hideTimeZone, hourCycle } = props;\n const recipe = useSlotRecipe({ recipe: dateRangePickerSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n // Extract size and variant from recipe props to pass to DateInputs\n const { size = \"md\" } = recipeProps;\n\n // the size of the buttons overlaying the input\n const overlayButtonSize = size === \"md\" ? \"xs\" : \"2xs\";\n\n // When granularity is \"day\", use the prop value (defaults to true if not provided)\n // For other granularities (time-based), force to false so users can set both date and time\n const shouldCloseOnSelect =\n granularity === \"day\" ? props.shouldCloseOnSelect : false;\n\n return (\n <DateRangePickerRootSlot {...recipeProps} {...styleProps} asChild>\n <ReactAriaDateRangePicker\n {...otherProps}\n shouldCloseOnSelect={shouldCloseOnSelect}\n >\n <DateRangePickerCustomContext>\n <DateRangePickerGroupSlot asChild>\n <Group>\n <DateInput\n slot=\"start\"\n size={props.size}\n variant=\"plain\"\n width=\"auto\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n <Text\n as=\"span\"\n px=\"150\"\n color=\"neutral.11\"\n userSelect=\"none\"\n aria-hidden=\"true\"\n slot={null}\n >\n –\n </Text>\n <DateInput\n slot=\"end\"\n size={props.size}\n variant=\"plain\"\n width=\"auto\"\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n <DateRangePickerTriggerSlot>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"clear\"\n >\n <Close />\n </IconButton>\n {/* @ts-expect-error react aria is adding the aria-label prop */}\n <IconButton\n tone=\"primary\"\n variant=\"ghost\"\n size={overlayButtonSize}\n slot=\"calendarToggle\"\n >\n <CalendarMonth />\n </IconButton>\n </DateRangePickerTriggerSlot>\n </Group>\n </DateRangePickerGroupSlot>\n <DateRangePickerPopoverSlot asChild>\n <Popover placement=\"bottom end\">\n <Dialog>\n <DateRangePickerCalendarSlot>\n <RangeCalendar />\n </DateRangePickerCalendarSlot>\n <DateRangePickerTimeInput\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n />\n </Dialog>\n </Popover>\n </DateRangePickerPopoverSlot>\n </DateRangePickerCustomContext>\n </ReactAriaDateRangePicker>\n </DateRangePickerRootSlot>\n );\n};\n\nDateRangePicker.displayName = \"DateRangePicker\";\n"],"names":["withProvider","withContext","createSlotRecipeContext","DateRangePickerRootSlot","DateRangePickerGroupSlot","DateRangePickerTriggerSlot","DateRangePickerPopoverSlot","DateRangePickerCalendarSlot","DateRangePickerTimeInput","hideTimeZone","hourCycle","dateRangePickerState","useContext","DateRangePickerStateContext","granularity","value","timeInputRef","useRef","previousValueRef","useEffect","timeoutId","container","activeElement","firstSegment","jsxs","Flex","jsx","Text","TimeInput","DateRangePickerCustomContext","children","buttonContext","useSlottedContext","ButtonContext","hasCompleteRangeDate","date","incompleteValue","startTimeValue","endTimeValue","isDateRangePickerDisabled","getDefaultTimeInputAriaLabel","type","prefix","buttonSlots","event","timeInputSlots","currentValue","startDate","endDate","newStartDate","newEndDate","Provider","TimeFieldContext","DateRangePicker","props","recipe","useSlotRecipe","dateRangePickerSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","size","overlayButtonSize","shouldCloseOnSelect","ReactAriaDateRangePicker","Group","DateInput","IconButton","Close","CalendarMonth","Popover","Dialog","RangeCalendar"],"mappings":";;;;;;;;;;;;;;;;;;;AAOA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAMYC,IAA0B,gBAAAH,EAGrC,OAAO,MAAM,GAKFI,IAA2B,gBAAAH,EAGtC,OAAO,OAAO,GAKHI,IAA6B,gBAAAJ,EAGxC,OAAO,SAAS,GAKLK,IAA6B,gBAAAL,EAGxC,OAAO,SAAS,GAKLM,IAA8B,gBAAAN,EAGzC,OAAO,UAAU,GC7CNO,IAA2B,CAAC;AAAA,EACvC,cAAAC;AAAA,EACA,WAAAC;AACF,MAAqC;AACnC,QAAMC,IAAuBC,EAAWC,CAA2B,GAC7D,EAAE,aAAAC,GAAa,OAAAC,EAAA,IAAUJ,GACzBK,IAAeC,EAAuB,IAAI,GAC1CC,IAAmBD,EAAOF,CAAK;AAGrC,SAAID,MAAgB,QACX,QAITK,EAAU,MAAM;AACd,QAAIC;AAQJ,QAJGL,GAAO,SACNG,EAAiB,SAAS,OAAO,QAAQH,EAAM,KAAK,MAAM,KAC3DA,GAAO,OAAOG,EAAiB,SAAS,KAAK,QAAQH,EAAM,GAAG,MAAM,GAElD;AAGnB,YAAMM,IAAYL,EAAa,SACzBM,IAAgB,SAAS;AAK/B,MAHED,GAAW,SAASC,CAAa,KACjCA,GAAe,aAAa,MAAM,MAAM,iBAIxCF,IAAY,WAAW,MAAM;AAE3B,YAAIC,GAAW;AACb,gBAAME,IAAeF,EAAU;AAAA,YAC7B;AAAA,UAAA;AAGF,UAAIE,KACF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AA,UAGD,gBAAAD;AAAA,YAAC0C;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,MAAMd,EAAM;AAAA,cACZ,SAAQ;AAAA,cACR,OAAM;AAAA,cACN,cAAA7C;AAAA,cACA,WAAAC;AAAA,YAAA;AAAA,UAAA;AAAA,4BAEDL,GAAA,EAEC,UAAA;AAAA,YAAA,gBAAAqB;AAAA,cAAC2C;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAQ;AAAA,gBACR,MAAML;AAAA,gBACN,MAAK;AAAA,gBAEL,4BAACM,GAAA,CAAA,CAAM;AAAA,cAAA;AAAA,YAAA;AAAA,YAGT,gBAAA5C;AAAA,cAAC2C;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAQ;AAAA,gBACR,MAAML;AAAA,gBACN,MAAK;AAAA,gBAEL,4BAACO,GAAA,CAAA,CAAc;AAAA,cAAA;AAAA,YAAA;AAAA,UACjB,EAAA,CACF;AAAA,QAAA,EAAA,CACF,EAAA,CACF;AAAA,QACA,gBAAA7C,EAACpB,KAA2B,SAAO,IACjC,4BAACkE,GAAA,EAAQ,WAAU,cACjB,UAAA,gBAAAhD,EAACiD,GAAA,EACC,UAAA;AAAA,UAAA,gBAAA/C,EAACnB,GAAA,EACC,UAAA,gBAAAmB,EAACgD,GAAA,CAAA,CAAc,GACjB;AAAA,UACA,gBAAAhD;AAAA,YAAClB;AAAA,YAAA;AAAA,cACC,cAAAC;AAAA,cACA,WAAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QACF,EAAA,CACF,GACF,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEA2C,EAAgB,cAAc;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const e=require("react/jsx-runtime"),k=require("@chakra-ui/react"),P=require("@commercetools/nimbus-icons"),y=require("./DatePicker-DCjrqg4Q.cjs.js"),S=require("./Dialog-XGXh4NXU.cjs.js"),V=require("./Group-BX1EpD9E.cjs.js"),z=require("@chakra-ui/react/styled-system"),E=require("./index-CRFg4Mhx.cjs.js"),w=require("./extract-style-props-Dk3fpLyQ.cjs.js"),p=require("react"),v=require("@chakra-ui/react/flex"),j=require("./text-CCW9kDT_.cjs.js"),D=require("./time-input-CweVZv1Q.cjs.js"),R=require("./Button-CFZnLKVR.cjs.js"),C=require("./utils-BHdR5Nww.cjs.js"),F=require("./DateField-CDTSjqvQ.cjs.js"),B=require("./range-calendar-lhmomEF_.cjs.js"),I=require("./date-input-B84sXbjL.cjs.js"),T=require("./icon-button-vWPrT-bR.cjs.js"),{withProvider:W,withContext:b}=k.createSlotRecipeContext({key:"dateRangePicker"}),G=W("div","root"),A=b("div","group"),O=b("div","trigger"),H=b("div","popover"),L=b("div","calendar"),M=({hideTimeZone:o,hourCycle:i})=>{const t=p.useContext(y.$06d5b8ec9ee5d538$export$80d7ae1f804790be),{granularity:c,value:a}=t,s=p.useRef(null),u=p.useRef(a);return c==="day"?null:(p.useEffect(()=>{let d;if(a?.start&&u.current?.start?.compare(a.start)!==0||a?.end&&u.current?.end?.compare(a.end)!==0){const l=s.current,m=document.activeElement;l?.contains(m)&&m?.getAttribute("role")==="spinbutton"||(d=setTimeout(()=>{if(l){const n=l.querySelector('[role="spinbutton"]');n&&n.focus()}},50))}return u.current=a,()=>{d&&clearTimeout(d)}},[a]),e.jsxs(v.Flex,{ref:s,borderTop:"solid-25",borderColor:"neutral.3",py:"300",px:"400",alignItems:"center",justifyContent:"center",gap:"200",children:[e.jsxs(v.Flex,{alignItems:"center",gap:"200",children:[e.jsx(j.Text,{textStyle:"xs",fontWeight:"500",color:"neutral.12",minWidth:"fit-content",children:"Start time"}),e.jsx(D.TimeInput,{slot:"startTimeInput",variant:"ghost",size:"sm",hideTimeZone:o,hourCycle:i})]}),e.jsxs(v.Flex,{alignItems:"center",gap:"200",children:[e.jsx(j.Text,{textStyle:"xs",fontWeight:"500",color:"neutral.12",minWidth:"fit-content",children:"End time"}),e.jsx(D.TimeInput,{slot:"endTimeInput",variant:"ghost",size:"sm",hideTimeZone:o,hourCycle:i})]})]}))},N=({children:o})=>{const i=C.$64fa3d84918910a7$export$fabf2dc03a41866e(R.$d2b4bc8c273e7be6$export$24d547caef80ccd1)||{},t=p.useContext(y.$06d5b8ec9ee5d538$export$80d7ae1f804790be),c=n=>n?.day&&n?.month&&n?.year,a=!t?.value||!c(t.value.start)||!c(t.value.end),{granularity:s}=t,u=t?.value?.start&&"hour"in t.value.start?t.value.start:null,d=t?.value?.end&&"hour"in t.value.end?t.value.end:null,g=i?.isDisabled,l=n=>{const r=n==="start"?"Start":"End";switch(s){case"hour":return`${r} time (hour)`;case"minute":return`${r} time (hour and minute)`;case"second":return`${r} time (hour, minute, and second)`;default:return`${r} time`}},m={calendarToggle:{...i,onPress:n=>{const r=document?.activeElement;r&&r.blur(),i.onPress?.(n)}},clear:{onPress:()=>t?.setValue(null),"aria-label":"Clear input value",isDisabled:g,style:a?{display:"none"}:void 0,"aria-hidden":a?!0:void 0}},f={startTimeInput:{value:u,onChange:n=>{if(n!==null&&t?.value?.start){const r=t.value,x=r.start,h=r.end;if(x&&h){const $=x.set({hour:n.hour,minute:n.minute||0,second:n.second||0,millisecond:n.millisecond||0});t.setValue({start:$,end:h})}}},granularity:s==="day"?void 0:s,"aria-label":l("start")},endTimeInput:{value:d,onChange:n=>{if(n!==null&&t?.value?.end){const r=t.value,x=r.start,h=r.end;if(x&&h){const $=h.set({hour:n.hour,minute:n.minute||0,second:n.second||0,millisecond:n.millisecond||0});t.setValue({start:x,end:$})}}},granularity:s==="day"?void 0:s,"aria-label":l("end")}};return e.jsx(C.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[R.$d2b4bc8c273e7be6$export$24d547caef80ccd1,{slots:m}],[F.$40825cdb76e74f70$export$8e17ddc448e87c1e,{slots:f}]],children:o})},q=o=>{const{granularity:i="day",hideTimeZone:t,hourCycle:c}=o,a=z.useSlotRecipe({recipe:E.dateRangePickerSlotRecipe}),[s,u]=a.splitVariantProps(o),[d,g]=w.extractStyleProps(u),{size:l="md"}=s,m=l==="md"?"xs":"2xs",f=i==="day"?o.shouldCloseOnSelect:!1;return e.jsx(G,{...s,...d,asChild:!0,children:e.jsx(y.$06d5b8ec9ee5d538$export$17334619f3ac2224,{...g,shouldCloseOnSelect:f,children:e.jsxs(N,{children:[e.jsx(A,{asChild:!0,children:e.jsxs(V.$a049562f99e7db0e$export$eb2fcfdbd7ba97d4,{children:[e.jsx(I.DateInput,{slot:"start",size:o.size,variant:"plain",width:"auto",hideTimeZone:t,hourCycle:c}),e.jsx(j.Text,{as:"span",px:"150",color:"neutral.11",userSelect:"none","aria-hidden":"true",slot:null,children:"–"}),e.jsx(I.DateInput,{slot:"end",size:o.size,variant:"plain",width:"auto",hideTimeZone:t,hourCycle:c}),e.jsxs(O,{children:[e.jsx(T.IconButton,{tone:"primary",variant:"ghost",size:m,slot:"clear",children:e.jsx(P.Close,{})}),e.jsx(T.IconButton,{tone:"primary",variant:"ghost",size:m,slot:"calendarToggle",children:e.jsx(P.CalendarMonth,{})})]})]})}),e.jsx(H,{asChild:!0,children:e.jsx(S.$07b14b47974efb58$export$5b6b19405a83ff9d,{placement:"bottom end",children:e.jsxs(S.$de32f1b87079253c$export$3ddf2d174ce01153,{children:[e.jsx(L,{children:e.jsx(B.RangeCalendar,{})}),e.jsx(M,{hideTimeZone:t,hourCycle:c})]})})})]})})})};q.displayName="DateRangePicker";exports.DateRangePicker=q;
2
+ //# sourceMappingURL=date-range-picker-DmHmhMvU.cjs.js.map