@commercetools/nimbus 0.0.0-canary-20250901065956 → 0.0.0-canary-20250902075758

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 (503) hide show
  1. package/dist/chunks/{Button-wUEF0Zow.es.js → Button--gemnXF8.es.js} +7 -7
  2. package/dist/chunks/{Button-wUEF0Zow.es.js.map → Button--gemnXF8.es.js.map} +1 -1
  3. package/dist/chunks/{Button-MmwT6xpw.cjs.js → Button-Bh-FLo_8.cjs.js} +2 -2
  4. package/dist/chunks/{Button-MmwT6xpw.cjs.js.map → Button-Bh-FLo_8.cjs.js.map} +1 -1
  5. package/dist/chunks/Collection-BYX373AD.cjs.js +18 -0
  6. package/dist/chunks/Collection-BYX373AD.cjs.js.map +1 -0
  7. package/dist/chunks/{Collection-CDJ_uFKV.es.js → Collection-Df3FPouy.es.js} +337 -366
  8. package/dist/chunks/Collection-Df3FPouy.es.js.map +1 -0
  9. package/dist/chunks/{DateField-Cg2n5ili.es.js → DateField-DVzmD_D6.es.js} +39 -40
  10. package/dist/chunks/{DateField-Cg2n5ili.es.js.map → DateField-DVzmD_D6.es.js.map} +1 -1
  11. package/dist/chunks/DateField-Dh2hoOBr.cjs.js +2 -0
  12. package/dist/chunks/{DateField-BRw4EOOA.cjs.js.map → DateField-Dh2hoOBr.cjs.js.map} +1 -1
  13. package/dist/chunks/{DatePicker-CqbnVxIC.cjs.js → DatePicker-C0NXSwOw.cjs.js} +2 -2
  14. package/dist/chunks/{DatePicker-CqbnVxIC.cjs.js.map → DatePicker-C0NXSwOw.cjs.js.map} +1 -1
  15. package/dist/chunks/{DatePicker-DVtAIdlj.es.js → DatePicker-_A7-hp_b.es.js} +17 -17
  16. package/dist/chunks/{DatePicker-DVtAIdlj.es.js.map → DatePicker-_A7-hp_b.es.js.map} +1 -1
  17. package/dist/chunks/Dialog-BnIvgMq1.cjs.js +2 -0
  18. package/dist/chunks/{Dialog-ljK75Ezb.cjs.js.map → Dialog-BnIvgMq1.cjs.js.map} +1 -1
  19. package/dist/chunks/{Dialog-BTicQJXP.es.js → Dialog-C3wKnoBH.es.js} +430 -431
  20. package/dist/chunks/{Dialog-BTicQJXP.es.js.map → Dialog-C3wKnoBH.es.js.map} +1 -1
  21. package/dist/chunks/{DragAndDrop-xhP_Ei7N.es.js → DragAndDrop-ChYb3tCX.es.js} +3 -3
  22. package/dist/chunks/{DragAndDrop-xhP_Ei7N.es.js.map → DragAndDrop-ChYb3tCX.es.js.map} +1 -1
  23. package/dist/chunks/{DragAndDrop-QpvgGL4C.cjs.js → DragAndDrop-cOfUfFj8.cjs.js} +2 -2
  24. package/dist/chunks/{DragAndDrop-QpvgGL4C.cjs.js.map → DragAndDrop-cOfUfFj8.cjs.js.map} +1 -1
  25. package/dist/chunks/FocusScope-CNO0fzPs.es.js +625 -0
  26. package/dist/chunks/FocusScope-CNO0fzPs.es.js.map +1 -0
  27. package/dist/chunks/FocusScope-DPn5XtSy.cjs.js +2 -0
  28. package/dist/chunks/FocusScope-DPn5XtSy.cjs.js.map +1 -0
  29. package/dist/chunks/{Group-CU1nz0u2.es.js → Group-Cfixd-fh.es.js} +5 -5
  30. package/dist/chunks/{Group-CU1nz0u2.es.js.map → Group-Cfixd-fh.es.js.map} +1 -1
  31. package/dist/chunks/{Group-DxD-SZdK.cjs.js → Group-MdeByg6t.cjs.js} +2 -2
  32. package/dist/chunks/{Group-DxD-SZdK.cjs.js.map → Group-MdeByg6t.cjs.js.map} +1 -1
  33. package/dist/chunks/Heading-BI5vqfiY.cjs.js +2 -0
  34. package/dist/chunks/{Heading-BorDTn_V.cjs.js.map → Heading-BI5vqfiY.cjs.js.map} +1 -1
  35. package/dist/chunks/{Heading-CXKMd84h.es.js → Heading-sepFdCCa.es.js} +26 -27
  36. package/dist/chunks/{Heading-CXKMd84h.es.js.map → Heading-sepFdCCa.es.js.map} +1 -1
  37. package/dist/chunks/{Input-B7Cnwv00.es.js → Input-BiHwUBo4.es.js} +5 -5
  38. package/dist/chunks/{Input-B7Cnwv00.es.js.map → Input-BiHwUBo4.es.js.map} +1 -1
  39. package/dist/chunks/{Input-DK49tQti.cjs.js → Input-HBDt7LmM.cjs.js} +2 -2
  40. package/dist/chunks/{Input-DK49tQti.cjs.js.map → Input-HBDt7LmM.cjs.js.map} +1 -1
  41. package/dist/chunks/{Label-CXgc_ps9.es.js → Label-B2YyCdLl.es.js} +2 -2
  42. package/dist/chunks/{Label-CXgc_ps9.es.js.map → Label-B2YyCdLl.es.js.map} +1 -1
  43. package/dist/chunks/{Label-DSG_MTc3.cjs.js → Label-BgrYyYXn.cjs.js} +2 -2
  44. package/dist/chunks/{Label-DSG_MTc3.cjs.js.map → Label-BgrYyYXn.cjs.js.map} +1 -1
  45. package/dist/chunks/{ListBox-DETV_5At.cjs.js → ListBox-B2Z13FyL.cjs.js} +2 -2
  46. package/dist/chunks/{ListBox-DETV_5At.cjs.js.map → ListBox-B2Z13FyL.cjs.js.map} +1 -1
  47. package/dist/chunks/{ListBox-CGw4-iNr.es.js → ListBox-BzuLanGT.es.js} +14 -14
  48. package/dist/chunks/{ListBox-CGw4-iNr.es.js.map → ListBox-BzuLanGT.es.js.map} +1 -1
  49. package/dist/chunks/{OverlayArrow-C_SkpQbf.cjs.js → OverlayArrow-C5Ymp9MC.cjs.js} +2 -2
  50. package/dist/chunks/{OverlayArrow-C_SkpQbf.cjs.js.map → OverlayArrow-C5Ymp9MC.cjs.js.map} +1 -1
  51. package/dist/chunks/{OverlayArrow-DbPNbnKm.es.js → OverlayArrow-ERS8ZqL3.es.js} +3 -3
  52. package/dist/chunks/{OverlayArrow-DbPNbnKm.es.js.map → OverlayArrow-ERS8ZqL3.es.js.map} +1 -1
  53. package/dist/chunks/{ProgressBar-Bm7vfOk4.cjs.js → ProgressBar-BNPexoD9.cjs.js} +2 -2
  54. package/dist/chunks/{ProgressBar-Bm7vfOk4.cjs.js.map → ProgressBar-BNPexoD9.cjs.js.map} +1 -1
  55. package/dist/chunks/{ProgressBar-DNmmtJsB.es.js → ProgressBar-BnGsEC_2.es.js} +5 -5
  56. package/dist/chunks/{ProgressBar-DNmmtJsB.es.js.map → ProgressBar-BnGsEC_2.es.js.map} +1 -1
  57. package/dist/chunks/Separator-QdyS03-E.cjs.js +2 -0
  58. package/dist/chunks/{Separator-CinA2hg4.cjs.js.map → Separator-QdyS03-E.cjs.js.map} +1 -1
  59. package/dist/chunks/{Separator-Ahj2J22_.es.js → Separator-T5Cc3sUj.es.js} +25 -26
  60. package/dist/chunks/{Separator-Ahj2J22_.es.js.map → Separator-T5Cc3sUj.es.js.map} +1 -1
  61. package/dist/chunks/{TextArea-DTir64d8.es.js → TextArea-BmpgvS0R.es.js} +5 -5
  62. package/dist/chunks/{TextArea-DTir64d8.es.js.map → TextArea-BmpgvS0R.es.js.map} +1 -1
  63. package/dist/chunks/{TextArea-p1OqtLgN.cjs.js → TextArea-D3FFXnUy.cjs.js} +2 -2
  64. package/dist/chunks/{TextArea-p1OqtLgN.cjs.js.map → TextArea-D3FFXnUy.cjs.js.map} +1 -1
  65. package/dist/chunks/{ToggleButton-CmN8Ay9u.es.js → ToggleButton-BoIyPi3U.es.js} +7 -7
  66. package/dist/chunks/{ToggleButton-CmN8Ay9u.es.js.map → ToggleButton-BoIyPi3U.es.js.map} +1 -1
  67. package/dist/chunks/{ToggleButton-DWTy3juF.cjs.js → ToggleButton-By3cqA7R.cjs.js} +2 -2
  68. package/dist/chunks/{ToggleButton-DWTy3juF.cjs.js.map → ToggleButton-By3cqA7R.cjs.js.map} +1 -1
  69. package/dist/chunks/{VisuallyHidden-DFP8AIDZ.cjs.js → VisuallyHidden-Bv_AJXZ7.cjs.js} +2 -2
  70. package/dist/chunks/{VisuallyHidden-DFP8AIDZ.cjs.js.map → VisuallyHidden-Bv_AJXZ7.cjs.js.map} +1 -1
  71. package/dist/chunks/{VisuallyHidden-BY2z9PpP.es.js → VisuallyHidden-VHEPK04F.es.js} +3 -3
  72. package/dist/chunks/{VisuallyHidden-BY2z9PpP.es.js.map → VisuallyHidden-VHEPK04F.es.js.map} +1 -1
  73. package/dist/chunks/{accordion-DF0by3UE.es.js → accordion-8XmJkF18.es.js} +5 -5
  74. package/dist/chunks/{accordion-DF0by3UE.es.js.map → accordion-8XmJkF18.es.js.map} +1 -1
  75. package/dist/chunks/{accordion-Db0ZaAwE.cjs.js → accordion-CAC36XIK.cjs.js} +2 -2
  76. package/dist/chunks/{accordion-Db0ZaAwE.cjs.js.map → accordion-CAC36XIK.cjs.js.map} +1 -1
  77. package/dist/chunks/{alert-DfnvHvbA.es.js → alert-CbAPX3xQ.es.js} +2 -2
  78. package/dist/chunks/{alert-DfnvHvbA.es.js.map → alert-CbAPX3xQ.es.js.map} +1 -1
  79. package/dist/chunks/{alert-Ck60ax0h.cjs.js → alert-STlW7NU8.cjs.js} +2 -2
  80. package/dist/chunks/{alert-Ck60ax0h.cjs.js.map → alert-STlW7NU8.cjs.js.map} +1 -1
  81. package/dist/chunks/{badge-B58WR_nK.es.js → badge-C2elCKPp.es.js} +2 -2
  82. package/dist/chunks/{badge-B58WR_nK.es.js.map → badge-C2elCKPp.es.js.map} +1 -1
  83. package/dist/chunks/{badge-D3iqhdY4.cjs.js → badge-HHzfG1BI.cjs.js} +2 -2
  84. package/dist/chunks/{badge-D3iqhdY4.cjs.js.map → badge-HHzfG1BI.cjs.js.map} +1 -1
  85. package/dist/chunks/{button-N0fUFhvD.cjs.js → button-CtWoT2k5.cjs.js} +2 -2
  86. package/dist/chunks/{button-N0fUFhvD.cjs.js.map → button-CtWoT2k5.cjs.js.map} +1 -1
  87. package/dist/chunks/{button-Nd45zL1x.es.js → button-_TqIjVy-.es.js} +5 -5
  88. package/dist/chunks/{button-Nd45zL1x.es.js.map → button-_TqIjVy-.es.js.map} +1 -1
  89. package/dist/chunks/{calendar-kDDTW9QY.es.js → calendar-Cgm2jctu.es.js} +8 -8
  90. package/dist/chunks/{calendar-kDDTW9QY.es.js.map → calendar-Cgm2jctu.es.js.map} +1 -1
  91. package/dist/chunks/{calendar-Cj6tlZEj.cjs.js → calendar-DFhIC3YS.cjs.js} +2 -2
  92. package/dist/chunks/{calendar-Cj6tlZEj.cjs.js.map → calendar-DFhIC3YS.cjs.js.map} +1 -1
  93. package/dist/chunks/{card-DFkYZ6Cs.cjs.js → card-CHfjhPF8.cjs.js} +2 -2
  94. package/dist/chunks/{card-DFkYZ6Cs.cjs.js.map → card-CHfjhPF8.cjs.js.map} +1 -1
  95. package/dist/chunks/{card-33QKPI9V.es.js → card-R8oaAKgo.es.js} +3 -3
  96. package/dist/chunks/{card-33QKPI9V.es.js.map → card-R8oaAKgo.es.js.map} +1 -1
  97. package/dist/chunks/{checkbox-D2tsRAy1.es.js → checkbox-Ce37pKIe.es.js} +9 -9
  98. package/dist/chunks/{checkbox-D2tsRAy1.es.js.map → checkbox-Ce37pKIe.es.js.map} +1 -1
  99. package/dist/chunks/{checkbox-g5gMaiLJ.cjs.js → checkbox-pYAJn7HX.cjs.js} +2 -2
  100. package/dist/chunks/{checkbox-g5gMaiLJ.cjs.js.map → checkbox-pYAJn7HX.cjs.js.map} +1 -1
  101. package/dist/chunks/{combobox-C1nOP0Qh.es.js → combobox-C3FEfver.es.js} +403 -423
  102. package/dist/chunks/combobox-C3FEfver.es.js.map +1 -0
  103. package/dist/chunks/combobox-CnUfDGC-.cjs.js +2 -0
  104. package/dist/chunks/combobox-CnUfDGC-.cjs.js.map +1 -0
  105. package/dist/chunks/data-table-BvTXYpZB.cjs.js +2 -0
  106. package/dist/chunks/{data-table-CgICAQC9.cjs.js.map → data-table-BvTXYpZB.cjs.js.map} +1 -1
  107. package/dist/chunks/{data-table-DlBw5XeS.es.js → data-table-BvYN1Stn.es.js} +426 -427
  108. package/dist/chunks/{data-table-DlBw5XeS.es.js.map → data-table-BvYN1Stn.es.js.map} +1 -1
  109. package/dist/chunks/{date-input-CHWJMf4Y.cjs.js → date-input-BmKSBIL2.cjs.js} +2 -2
  110. package/dist/chunks/{date-input-CHWJMf4Y.cjs.js.map → date-input-BmKSBIL2.cjs.js.map} +1 -1
  111. package/dist/chunks/{date-input-DBd91qhQ.es.js → date-input-DFx77xwE.es.js} +2 -2
  112. package/dist/chunks/{date-input-DBd91qhQ.es.js.map → date-input-DFx77xwE.es.js.map} +1 -1
  113. package/dist/chunks/{date-picker-DkegHUiZ.es.js → date-picker-BzkAJfXO.es.js} +12 -12
  114. package/dist/chunks/{date-picker-DkegHUiZ.es.js.map → date-picker-BzkAJfXO.es.js.map} +1 -1
  115. package/dist/chunks/{date-picker-W70bKrmU.cjs.js → date-picker-CsGYO3HW.cjs.js} +2 -2
  116. package/dist/chunks/{date-picker-W70bKrmU.cjs.js.map → date-picker-CsGYO3HW.cjs.js.map} +1 -1
  117. package/dist/chunks/{date-range-picker-vzDrtZ94.es.js → date-range-picker-B1Sxvj0C.es.js} +12 -12
  118. package/dist/chunks/{date-range-picker-vzDrtZ94.es.js.map → date-range-picker-B1Sxvj0C.es.js.map} +1 -1
  119. package/dist/chunks/{date-range-picker-Cqdj51fV.cjs.js → date-range-picker-uomzPtYK.cjs.js} +2 -2
  120. package/dist/chunks/{date-range-picker-Cqdj51fV.cjs.js.map → date-range-picker-uomzPtYK.cjs.js.map} +1 -1
  121. package/dist/chunks/{divider-BZkfiFj5.cjs.js → divider-CTTExmLv.cjs.js} +2 -2
  122. package/dist/chunks/{divider-BZkfiFj5.cjs.js.map → divider-CTTExmLv.cjs.js.map} +1 -1
  123. package/dist/chunks/{divider-Vtnb6QbI.es.js → divider-CpctZ_-U.es.js} +2 -2
  124. package/dist/chunks/{divider-Vtnb6QbI.es.js.map → divider-CpctZ_-U.es.js.map} +1 -1
  125. package/dist/chunks/filterDOMProps-BSVCO5jK.es.js.map +1 -1
  126. package/dist/chunks/filterDOMProps-WUskt27c.cjs.js.map +1 -1
  127. package/dist/chunks/{focusSafely-D8bIeV7X.es.js → focusSafely-DJpphVHF.es.js} +6 -5
  128. package/dist/chunks/{focusSafely-D8bIeV7X.es.js.map → focusSafely-DJpphVHF.es.js.map} +1 -1
  129. package/dist/chunks/focusSafely-jDMW9aEx.cjs.js +2 -0
  130. package/dist/chunks/{focusSafely-CgVjbH-x.cjs.js.map → focusSafely-jDMW9aEx.cjs.js.map} +1 -1
  131. package/dist/chunks/focusWithoutScrolling-BlyUcXdY.cjs.js.map +1 -1
  132. package/dist/chunks/focusWithoutScrolling-CDw3JYiq.es.js.map +1 -1
  133. package/dist/chunks/{form-field-CS9GGlbl.cjs.js → form-field-6_jyAhgo.cjs.js} +2 -2
  134. package/dist/chunks/{form-field-CS9GGlbl.cjs.js.map → form-field-6_jyAhgo.cjs.js.map} +1 -1
  135. package/dist/chunks/{form-field-DcQW2A1i.es.js → form-field-B1B4BtvO.es.js} +4 -4
  136. package/dist/chunks/{form-field-DcQW2A1i.es.js.map → form-field-B1B4BtvO.es.js.map} +1 -1
  137. package/dist/chunks/{group-DgCuvf_U.cjs.js → group-Buy-O6Mr.cjs.js} +2 -2
  138. package/dist/chunks/{group-DgCuvf_U.cjs.js.map → group-Buy-O6Mr.cjs.js.map} +1 -1
  139. package/dist/chunks/{group-CYRXn-NO.es.js → group-CqfSQXe7.es.js} +2 -2
  140. package/dist/chunks/{group-CYRXn-NO.es.js.map → group-CqfSQXe7.es.js.map} +1 -1
  141. package/dist/chunks/{icon-button-Cs41MKV5.cjs.js → icon-button-Dqhm4rBI.cjs.js} +2 -2
  142. package/dist/chunks/{icon-button-Cs41MKV5.cjs.js.map → icon-button-Dqhm4rBI.cjs.js.map} +1 -1
  143. package/dist/chunks/{icon-button-BkjZ1Pq8.es.js → icon-button-oIKucbza.es.js} +2 -2
  144. package/dist/chunks/{icon-button-BkjZ1Pq8.es.js.map → icon-button-oIKucbza.es.js.map} +1 -1
  145. package/dist/chunks/{icon-toggle-button-CEGHh-JB.es.js → icon-toggle-button-BYKHQRsq.es.js} +2 -2
  146. package/dist/chunks/{icon-toggle-button-CEGHh-JB.es.js.map → icon-toggle-button-BYKHQRsq.es.js.map} +1 -1
  147. package/dist/chunks/{icon-toggle-button-BljNXaJy.cjs.js → icon-toggle-button-DIfDVDd4.cjs.js} +2 -2
  148. package/dist/chunks/{icon-toggle-button-BljNXaJy.cjs.js.map → icon-toggle-button-DIfDVDd4.cjs.js.map} +1 -1
  149. package/dist/chunks/{kbd-BjfxBIWW.es.js → kbd-CDEXQyg2.es.js} +2 -2
  150. package/dist/chunks/{kbd-BjfxBIWW.es.js.map → kbd-CDEXQyg2.es.js.map} +1 -1
  151. package/dist/chunks/{kbd-DxwHwPaF.cjs.js → kbd-DP3lZ80W.cjs.js} +2 -2
  152. package/dist/chunks/{kbd-DxwHwPaF.cjs.js.map → kbd-DP3lZ80W.cjs.js.map} +1 -1
  153. package/dist/chunks/{link-D0XhkPu6.es.js → link-BoUhLeO-.es.js} +5 -5
  154. package/dist/chunks/{link-D0XhkPu6.es.js.map → link-BoUhLeO-.es.js.map} +1 -1
  155. package/dist/chunks/{link-CNe7kOhA.cjs.js → link-DTUiEXYJ.cjs.js} +2 -2
  156. package/dist/chunks/{link-CNe7kOhA.cjs.js.map → link-DTUiEXYJ.cjs.js.map} +1 -1
  157. package/dist/chunks/{loading-spinner-C_1gCLzP.cjs.js → loading-spinner-BLDpwNFm.cjs.js} +2 -2
  158. package/dist/chunks/{loading-spinner-C_1gCLzP.cjs.js.map → loading-spinner-BLDpwNFm.cjs.js.map} +1 -1
  159. package/dist/chunks/{loading-spinner-COTpElt8.es.js → loading-spinner-C7yZE-QF.es.js} +3 -3
  160. package/dist/chunks/{loading-spinner-COTpElt8.es.js.map → loading-spinner-C7yZE-QF.es.js.map} +1 -1
  161. package/dist/chunks/{make-element-focusable-DS5T93TG.es.js → make-element-focusable-C4ZHUSEU.es.js} +3 -3
  162. package/dist/chunks/{make-element-focusable-DS5T93TG.es.js.map → make-element-focusable-C4ZHUSEU.es.js.map} +1 -1
  163. package/dist/chunks/{make-element-focusable-Cj8VL4H4.cjs.js → make-element-focusable-bPAMXt4D.cjs.js} +2 -2
  164. package/dist/chunks/{make-element-focusable-Cj8VL4H4.cjs.js.map → make-element-focusable-bPAMXt4D.cjs.js.map} +1 -1
  165. package/dist/chunks/{menu-DKTon-Vn.es.js → menu-BZWMAG92.es.js} +5 -5
  166. package/dist/chunks/{menu-DKTon-Vn.es.js.map → menu-BZWMAG92.es.js.map} +1 -1
  167. package/dist/chunks/{menu-BaTd4n0a.cjs.js → menu-C41LRy4b.cjs.js} +2 -2
  168. package/dist/chunks/{menu-BaTd4n0a.cjs.js.map → menu-C41LRy4b.cjs.js.map} +1 -1
  169. package/dist/chunks/{mergeProps-DRkWdaVg.cjs.js → mergeProps-BA5Cwf5w.cjs.js} +2 -2
  170. package/dist/chunks/{mergeProps-DRkWdaVg.cjs.js.map → mergeProps-BA5Cwf5w.cjs.js.map} +1 -1
  171. package/dist/chunks/{mergeProps-CtwSzqnr.es.js → mergeProps-B_9syxhT.es.js} +4 -5
  172. package/dist/chunks/{mergeProps-CtwSzqnr.es.js.map → mergeProps-B_9syxhT.es.js.map} +1 -1
  173. package/dist/chunks/{multiline-text-input-DufrCFhg.cjs.js → multiline-text-input-B5XtIAAO.cjs.js} +2 -2
  174. package/dist/chunks/{multiline-text-input-DufrCFhg.cjs.js.map → multiline-text-input-B5XtIAAO.cjs.js.map} +1 -1
  175. package/dist/chunks/{multiline-text-input-Bsazfavw.es.js → multiline-text-input-Dy6gbL7T.es.js} +3 -3
  176. package/dist/chunks/{multiline-text-input-Bsazfavw.es.js.map → multiline-text-input-Dy6gbL7T.es.js.map} +1 -1
  177. package/dist/chunks/{nimbus-provider-BinjIRf7.es.js → nimbus-provider-C68IpiXi.es.js} +2 -2
  178. package/dist/chunks/{nimbus-provider-BinjIRf7.es.js.map → nimbus-provider-C68IpiXi.es.js.map} +1 -1
  179. package/dist/chunks/{number-input-l32lWVbX.es.js → number-input-BxLU6AgG.es.js} +192 -208
  180. package/dist/chunks/number-input-BxLU6AgG.es.js.map +1 -0
  181. package/dist/chunks/number-input-Dm2FFtQx.cjs.js +2 -0
  182. package/dist/chunks/number-input-Dm2FFtQx.cjs.js.map +1 -0
  183. package/dist/chunks/{openLink-BwkmFekP.es.js → openLink-Ctl0AdAy.es.js} +2 -2
  184. package/dist/chunks/{openLink-BwkmFekP.es.js.map → openLink-Ctl0AdAy.es.js.map} +1 -1
  185. package/dist/chunks/openLink-DkCJYbzq.cjs.js.map +1 -1
  186. package/dist/chunks/{password-input-q1cxpiOP.cjs.js → password-input-CwWWxcly.cjs.js} +2 -2
  187. package/dist/chunks/{password-input-q1cxpiOP.cjs.js.map → password-input-CwWWxcly.cjs.js.map} +1 -1
  188. package/dist/chunks/{password-input-B9Uv-ybv.es.js → password-input-DJjAz3TP.es.js} +4 -4
  189. package/dist/chunks/{password-input-B9Uv-ybv.es.js.map → password-input-DJjAz3TP.es.js.map} +1 -1
  190. package/dist/chunks/platform-BDLy2vDY.cjs.js.map +1 -1
  191. package/dist/chunks/{platform-BOO1jCtB.es.js → platform-Z5fvtFmM.es.js} +4 -4
  192. package/dist/chunks/{platform-BOO1jCtB.es.js.map → platform-Z5fvtFmM.es.js.map} +1 -1
  193. package/dist/chunks/{progress-bar-C8onDqV2.es.js → progress-bar-CDRI279T.es.js} +3 -3
  194. package/dist/chunks/{progress-bar-C8onDqV2.es.js.map → progress-bar-CDRI279T.es.js.map} +1 -1
  195. package/dist/chunks/{progress-bar-BGTJgcWE.cjs.js → progress-bar-nQCcdv_4.cjs.js} +2 -2
  196. package/dist/chunks/{progress-bar-BGTJgcWE.cjs.js.map → progress-bar-nQCcdv_4.cjs.js.map} +1 -1
  197. package/dist/chunks/radio-input-BXFY8CaT.cjs.js +2 -0
  198. package/dist/chunks/{radio-input-BlE9GNwl.cjs.js.map → radio-input-BXFY8CaT.cjs.js.map} +1 -1
  199. package/dist/chunks/{radio-input-uMVsYeTe.es.js → radio-input-CAogtJP7.es.js} +15 -15
  200. package/dist/chunks/{radio-input-uMVsYeTe.es.js.map → radio-input-CAogtJP7.es.js.map} +1 -1
  201. package/dist/chunks/{range-calendar-CvTT4HY-.cjs.js → range-calendar-BuzvPCc1.cjs.js} +2 -2
  202. package/dist/chunks/{range-calendar-CvTT4HY-.cjs.js.map → range-calendar-BuzvPCc1.cjs.js.map} +1 -1
  203. package/dist/chunks/{range-calendar-YuvY8LUd.es.js → range-calendar-D-CvB2-1.es.js} +8 -8
  204. package/dist/chunks/{range-calendar-YuvY8LUd.es.js.map → range-calendar-D-CvB2-1.es.js.map} +1 -1
  205. package/dist/chunks/{rich-text-input-C7EK9LsN.cjs.js → rich-text-input-Dmp5hx2t.cjs.js} +2 -2
  206. package/dist/chunks/{rich-text-input-C7EK9LsN.cjs.js.map → rich-text-input-Dmp5hx2t.cjs.js.map} +1 -1
  207. package/dist/chunks/{rich-text-input-CVqiVHV1.es.js → rich-text-input-Dv7OofX2.es.js} +11 -11
  208. package/dist/chunks/{rich-text-input-CVqiVHV1.es.js.map → rich-text-input-Dv7OofX2.es.js.map} +1 -1
  209. package/dist/chunks/scrollIntoView-BYF_8_6g.es.js +94 -0
  210. package/dist/chunks/scrollIntoView-BYF_8_6g.es.js.map +1 -0
  211. package/dist/chunks/scrollIntoView-BzIqpHLO.cjs.js +2 -0
  212. package/dist/chunks/scrollIntoView-BzIqpHLO.cjs.js.map +1 -0
  213. package/dist/chunks/{select-CgapbY3S.es.js → select-Dlg0m5Ww.es.js} +18 -18
  214. package/dist/chunks/{select-CgapbY3S.es.js.map → select-Dlg0m5Ww.es.js.map} +1 -1
  215. package/dist/chunks/{select-Dd2f6hd1.cjs.js → select-IUEop3i7.cjs.js} +2 -2
  216. package/dist/chunks/{select-Dd2f6hd1.cjs.js.map → select-IUEop3i7.cjs.js.map} +1 -1
  217. package/dist/chunks/{split-button-Blbr2czN.cjs.js → split-button-B4Wp7H3n.cjs.js} +2 -2
  218. package/dist/chunks/{split-button-Blbr2czN.cjs.js.map → split-button-B4Wp7H3n.cjs.js.map} +1 -1
  219. package/dist/chunks/{split-button-DoRlks-p.es.js → split-button-Dpj44F6g.es.js} +4 -4
  220. package/dist/chunks/{split-button-DoRlks-p.es.js.map → split-button-Dpj44F6g.es.js.map} +1 -1
  221. package/dist/chunks/{switch-Cb0mCIEe.es.js → switch-Ba9WXDDP.es.js} +5 -5
  222. package/dist/chunks/{switch-Cb0mCIEe.es.js.map → switch-Ba9WXDDP.es.js.map} +1 -1
  223. package/dist/chunks/{switch-Cha1HMzo.cjs.js → switch-CeNcr608.cjs.js} +2 -2
  224. package/dist/chunks/{switch-Cha1HMzo.cjs.js.map → switch-CeNcr608.cjs.js.map} +1 -1
  225. package/dist/chunks/{tag-group-CvKA8ufC.es.js → tag-group-BY7yGmmv.es.js} +22 -23
  226. package/dist/chunks/{tag-group-CvKA8ufC.es.js.map → tag-group-BY7yGmmv.es.js.map} +1 -1
  227. package/dist/chunks/tag-group-DXKC_JuG.cjs.js +2 -0
  228. package/dist/chunks/{tag-group-5uAuEquc.cjs.js.map → tag-group-DXKC_JuG.cjs.js.map} +1 -1
  229. package/dist/chunks/{text-DkO9mfur.es.js → text-B2wziCK6.es.js} +2 -2
  230. package/dist/chunks/{text-DkO9mfur.es.js.map → text-B2wziCK6.es.js.map} +1 -1
  231. package/dist/chunks/{text-BOdnmoaN.cjs.js → text-hUMahKuA.cjs.js} +2 -2
  232. package/dist/chunks/{text-BOdnmoaN.cjs.js.map → text-hUMahKuA.cjs.js.map} +1 -1
  233. package/dist/chunks/{text-input-C3q-zUxw.es.js → text-input-82882hyq.es.js} +3 -3
  234. package/dist/chunks/{text-input-C3q-zUxw.es.js.map → text-input-82882hyq.es.js.map} +1 -1
  235. package/dist/chunks/{text-input-eShRYnI3.cjs.js → text-input-CBcEG79G.cjs.js} +2 -2
  236. package/dist/chunks/{text-input-eShRYnI3.cjs.js.map → text-input-CBcEG79G.cjs.js.map} +1 -1
  237. package/dist/chunks/{time-input-CkNODZOE.cjs.js → time-input-CCnD_SWq.cjs.js} +2 -2
  238. package/dist/chunks/{time-input-CkNODZOE.cjs.js.map → time-input-CCnD_SWq.cjs.js.map} +1 -1
  239. package/dist/chunks/{time-input-ZZK92O_5.es.js → time-input-DAA-IK0I.es.js} +2 -2
  240. package/dist/chunks/{time-input-ZZK92O_5.es.js.map → time-input-DAA-IK0I.es.js.map} +1 -1
  241. package/dist/chunks/{toggle-button-Bfo8opbK.es.js → toggle-button-163ZMcpk.es.js} +2 -2
  242. package/dist/chunks/{toggle-button-Bfo8opbK.es.js.map → toggle-button-163ZMcpk.es.js.map} +1 -1
  243. package/dist/chunks/{toggle-button-BEOCbO0O.cjs.js → toggle-button-BTYd563-.cjs.js} +2 -2
  244. package/dist/chunks/{toggle-button-BEOCbO0O.cjs.js.map → toggle-button-BTYd563-.cjs.js.map} +1 -1
  245. package/dist/chunks/{toggle-button-group-yB5nqdV3.es.js → toggle-button-group-D-sGsuZ_.es.js} +2 -2
  246. package/dist/chunks/{toggle-button-group-yB5nqdV3.es.js.map → toggle-button-group-D-sGsuZ_.es.js.map} +1 -1
  247. package/dist/chunks/{toggle-button-group-B_C5ly_4.cjs.js → toggle-button-group-Dq51N27j.cjs.js} +2 -2
  248. package/dist/chunks/{toggle-button-group-B_C5ly_4.cjs.js.map → toggle-button-group-Dq51N27j.cjs.js.map} +1 -1
  249. package/dist/chunks/{toolbar-DvkcbAsl.es.js → toolbar-Ch-bOLkm.es.js} +4 -4
  250. package/dist/chunks/{toolbar-DvkcbAsl.es.js.map → toolbar-Ch-bOLkm.es.js.map} +1 -1
  251. package/dist/chunks/{toolbar-BZkvVoAw.cjs.js → toolbar-CzXpYEbP.cjs.js} +2 -2
  252. package/dist/chunks/{toolbar-BZkvVoAw.cjs.js.map → toolbar-CzXpYEbP.cjs.js.map} +1 -1
  253. package/dist/chunks/{tooltip-D7QmPw5W.cjs.js → tooltip-BFuuQNa4.cjs.js} +2 -2
  254. package/dist/chunks/{tooltip-D7QmPw5W.cjs.js.map → tooltip-BFuuQNa4.cjs.js.map} +1 -1
  255. package/dist/chunks/{tooltip-Bb_I4Owj.es.js → tooltip-BpUbO0NA.es.js} +7 -7
  256. package/dist/chunks/{tooltip-Bb_I4Owj.es.js.map → tooltip-BpUbO0NA.es.js.map} +1 -1
  257. package/dist/chunks/{useButton-6DDhTkQ5.cjs.js → useButton-C8n_NtBu.cjs.js} +2 -2
  258. package/dist/chunks/{useButton-6DDhTkQ5.cjs.js.map → useButton-C8n_NtBu.cjs.js.map} +1 -1
  259. package/dist/chunks/{useButton-CKkFEBt0.es.js → useButton-M3_syr-Y.es.js} +4 -4
  260. package/dist/chunks/{useButton-CKkFEBt0.es.js.map → useButton-M3_syr-Y.es.js.map} +1 -1
  261. package/dist/chunks/{useDateFormatter-DGeAh0SC.es.js → useDateFormatter-BqJA667a.es.js} +2 -2
  262. package/dist/chunks/{useDateFormatter-DGeAh0SC.es.js.map → useDateFormatter-BqJA667a.es.js.map} +1 -1
  263. package/dist/chunks/{useDateFormatter-BIkv89ta.cjs.js → useDateFormatter-Dq2Ly1Je.cjs.js} +2 -2
  264. package/dist/chunks/{useDateFormatter-BIkv89ta.cjs.js.map → useDateFormatter-Dq2Ly1Je.cjs.js.map} +1 -1
  265. package/dist/chunks/{useEvent-AOCWMUCu.cjs.js → useEvent-CuUOU5WV.cjs.js} +2 -2
  266. package/dist/chunks/{useEvent-AOCWMUCu.cjs.js.map → useEvent-CuUOU5WV.cjs.js.map} +1 -1
  267. package/dist/chunks/{useEvent-k0_MYJWL.es.js → useEvent-YHhqZvpU.es.js} +7 -7
  268. package/dist/chunks/{useEvent-k0_MYJWL.es.js.map → useEvent-YHhqZvpU.es.js.map} +1 -1
  269. package/dist/chunks/{useField-9-dizG-T.es.js → useField-Ce9zQxmx.es.js} +3 -3
  270. package/dist/chunks/{useField-9-dizG-T.es.js.map → useField-Ce9zQxmx.es.js.map} +1 -1
  271. package/dist/chunks/{useField-D5vZhNS3.cjs.js → useField-DmqO9k7a.cjs.js} +2 -2
  272. package/dist/chunks/{useField-D5vZhNS3.cjs.js.map → useField-DmqO9k7a.cjs.js.map} +1 -1
  273. package/dist/chunks/{useFocus-DpnjsJ3H.cjs.js → useFocus-BtJ38vev.cjs.js} +2 -2
  274. package/dist/chunks/{useFocus-DpnjsJ3H.cjs.js.map → useFocus-BtJ38vev.cjs.js.map} +1 -1
  275. package/dist/chunks/{useFocus-Lq2Mmyje.es.js → useFocus-DkWJ2TJC.es.js} +6 -6
  276. package/dist/chunks/{useFocus-Lq2Mmyje.es.js.map → useFocus-DkWJ2TJC.es.js.map} +1 -1
  277. package/dist/chunks/{useFocusRing-DjMwdeTr.cjs.js → useFocusRing-CzFer4bD.cjs.js} +2 -2
  278. package/dist/chunks/{useFocusRing-DjMwdeTr.cjs.js.map → useFocusRing-CzFer4bD.cjs.js.map} +1 -1
  279. package/dist/chunks/{useFocusRing-BFWuvq6P.es.js → useFocusRing-updnkDQg.es.js} +4 -4
  280. package/dist/chunks/{useFocusRing-BFWuvq6P.es.js.map → useFocusRing-updnkDQg.es.js.map} +1 -1
  281. package/dist/chunks/useFocusVisible-CWDaG0ze.es.js +111 -0
  282. package/dist/chunks/useFocusVisible-CWDaG0ze.es.js.map +1 -0
  283. package/dist/chunks/useFocusVisible-Co0C61s7.cjs.js +2 -0
  284. package/dist/chunks/useFocusVisible-Co0C61s7.cjs.js.map +1 -0
  285. package/dist/chunks/{useFocusWithin-BcxLc412.cjs.js → useFocusWithin-BDSWp3rw.cjs.js} +2 -2
  286. package/dist/chunks/{useFocusWithin-BcxLc412.cjs.js.map → useFocusWithin-BDSWp3rw.cjs.js.map} +1 -1
  287. package/dist/chunks/{useFocusWithin-QIERmzTm.es.js → useFocusWithin-ByYlHjju.es.js} +6 -6
  288. package/dist/chunks/{useFocusWithin-QIERmzTm.es.js.map → useFocusWithin-ByYlHjju.es.js.map} +1 -1
  289. package/dist/chunks/useFocusable-CrsD8ZcF.es.js +77 -0
  290. package/dist/chunks/useFocusable-CrsD8ZcF.es.js.map +1 -0
  291. package/dist/chunks/useFocusable-DCgmQxS1.cjs.js +2 -0
  292. package/dist/chunks/useFocusable-DCgmQxS1.cjs.js.map +1 -0
  293. package/dist/chunks/{useFormReset-7-vYPDFJ.cjs.js → useFormReset--wPlnEOl.cjs.js} +2 -2
  294. package/dist/chunks/{useFormReset-7-vYPDFJ.cjs.js.map → useFormReset--wPlnEOl.cjs.js.map} +1 -1
  295. package/dist/chunks/{useFormReset-C27nadG4.es.js → useFormReset-DurgUJL-.es.js} +2 -2
  296. package/dist/chunks/{useFormReset-C27nadG4.es.js.map → useFormReset-DurgUJL-.es.js.map} +1 -1
  297. package/dist/chunks/{useFormValidation-Chwu6llz.es.js → useFormValidation-4hZ1_a6w.es.js} +3 -3
  298. package/dist/chunks/{useFormValidation-Chwu6llz.es.js.map → useFormValidation-4hZ1_a6w.es.js.map} +1 -1
  299. package/dist/chunks/{useFormValidation-B5jwexNB.cjs.js → useFormValidation-BEaCuNx1.cjs.js} +2 -2
  300. package/dist/chunks/{useFormValidation-B5jwexNB.cjs.js.map → useFormValidation-BEaCuNx1.cjs.js.map} +1 -1
  301. package/dist/chunks/{useHighlightSelectionDescription-C7xYnRNQ.es.js → useHighlightSelectionDescription-CsL0QM95.es.js} +5 -5
  302. package/dist/chunks/{useHighlightSelectionDescription-C7xYnRNQ.es.js.map → useHighlightSelectionDescription-CsL0QM95.es.js.map} +1 -1
  303. package/dist/chunks/{useHighlightSelectionDescription-DbT86zJE.cjs.js → useHighlightSelectionDescription-DwBGGESb.cjs.js} +2 -2
  304. package/dist/chunks/{useHighlightSelectionDescription-DbT86zJE.cjs.js.map → useHighlightSelectionDescription-DwBGGESb.cjs.js.map} +1 -1
  305. package/dist/chunks/{useHover-BmNjdf-e.cjs.js → useHover-CiP9jMFy.cjs.js} +2 -2
  306. package/dist/chunks/{useHover-BmNjdf-e.cjs.js.map → useHover-CiP9jMFy.cjs.js.map} +1 -1
  307. package/dist/chunks/{useHover-C5D2lV7p.es.js → useHover-DhoE75lX.es.js} +2 -2
  308. package/dist/chunks/{useHover-C5D2lV7p.es.js.map → useHover-DhoE75lX.es.js.map} +1 -1
  309. package/dist/chunks/{useLabel-DHa3lVYx.es.js → useLabel-BBmkkrPP.es.js} +2 -2
  310. package/dist/chunks/{useLabel-DHa3lVYx.es.js.map → useLabel-BBmkkrPP.es.js.map} +1 -1
  311. package/dist/chunks/{useLabel-BvIA-VYU.cjs.js → useLabel-Y8tWagLu.cjs.js} +2 -2
  312. package/dist/chunks/{useLabel-BvIA-VYU.cjs.js.map → useLabel-Y8tWagLu.cjs.js.map} +1 -1
  313. package/dist/chunks/useObjectRef-CaJ5pgjX.es.js.map +1 -1
  314. package/dist/chunks/useObjectRef-dXOJdONs.cjs.js.map +1 -1
  315. package/dist/chunks/usePress-C8-hLXJw.cjs.js +8 -0
  316. package/dist/chunks/usePress-C8-hLXJw.cjs.js.map +1 -0
  317. package/dist/chunks/usePress-DHhWHfMz.es.js +456 -0
  318. package/dist/chunks/usePress-DHhWHfMz.es.js.map +1 -0
  319. package/dist/chunks/{useProgressBar-DPrqCXGF.cjs.js → useProgressBar-8ZyM2_T3.cjs.js} +2 -2
  320. package/dist/chunks/{useProgressBar-DPrqCXGF.cjs.js.map → useProgressBar-8ZyM2_T3.cjs.js.map} +1 -1
  321. package/dist/chunks/{useProgressBar-DjpcXNXW.es.js → useProgressBar-BgURyN6q.es.js} +3 -3
  322. package/dist/chunks/{useProgressBar-DjpcXNXW.es.js.map → useProgressBar-BgURyN6q.es.js.map} +1 -1
  323. package/dist/chunks/{useSingleSelectListState-CVyCydEV.cjs.js → useSingleSelectListState-8Jfm9Pr1.cjs.js} +2 -2
  324. package/dist/chunks/{useSingleSelectListState-CVyCydEV.cjs.js.map → useSingleSelectListState-8Jfm9Pr1.cjs.js.map} +1 -1
  325. package/dist/chunks/{useSingleSelectListState-C71okNUJ.es.js → useSingleSelectListState-CYqW_Fx5.es.js} +2 -2
  326. package/dist/chunks/{useSingleSelectListState-C71okNUJ.es.js.map → useSingleSelectListState-CYqW_Fx5.es.js.map} +1 -1
  327. package/dist/chunks/{useSpinButton-BmgSsr4J.es.js → useSpinButton-C-tpK-T9.es.js} +181 -210
  328. package/dist/chunks/useSpinButton-C-tpK-T9.es.js.map +1 -0
  329. package/dist/chunks/useSpinButton-Cw8QxU2l.cjs.js +2 -0
  330. package/dist/chunks/useSpinButton-Cw8QxU2l.cjs.js.map +1 -0
  331. package/dist/chunks/useSyncRef-DGRbdR4H.es.js +13 -0
  332. package/dist/chunks/useSyncRef-DGRbdR4H.es.js.map +1 -0
  333. package/dist/chunks/useSyncRef-bcjp9eId.cjs.js +2 -0
  334. package/dist/chunks/useSyncRef-bcjp9eId.cjs.js.map +1 -0
  335. package/dist/chunks/useTextField-BcthGRd8.cjs.js +2 -0
  336. package/dist/chunks/{useTextField-DvU8XT6q.cjs.js.map → useTextField-BcthGRd8.cjs.js.map} +1 -1
  337. package/dist/chunks/{useTextField-D0VFuWqP.es.js → useTextField-BnL6tOdd.es.js} +7 -7
  338. package/dist/chunks/{useTextField-D0VFuWqP.es.js.map → useTextField-BnL6tOdd.es.js.map} +1 -1
  339. package/dist/chunks/{useToggle-C9HpNiZE.es.js → useToggle-DqruaaTq.es.js} +5 -5
  340. package/dist/chunks/{useToggle-C9HpNiZE.es.js.map → useToggle-DqruaaTq.es.js.map} +1 -1
  341. package/dist/chunks/{useToggle-ChOojvWq.cjs.js → useToggle-VJWgbeCC.cjs.js} +2 -2
  342. package/dist/chunks/{useToggle-ChOojvWq.cjs.js.map → useToggle-VJWgbeCC.cjs.js.map} +1 -1
  343. package/dist/chunks/{useToolbar-Dzap6P-D.es.js → useToolbar-9B43whQM.es.js} +3 -3
  344. package/dist/chunks/{useToolbar-Dzap6P-D.es.js.map → useToolbar-9B43whQM.es.js.map} +1 -1
  345. package/dist/chunks/{useToolbar-DfnAHPrS.cjs.js → useToolbar-Coi7qK2U.cjs.js} +2 -2
  346. package/dist/chunks/{useToolbar-DfnAHPrS.cjs.js.map → useToolbar-Coi7qK2U.cjs.js.map} +1 -1
  347. package/dist/chunks/useUpdateEffect-C5YQs_1w.cjs.js.map +1 -1
  348. package/dist/chunks/useUpdateEffect-CCDx8D4X.es.js.map +1 -1
  349. package/dist/chunks/utils-BGHwK7fd.cjs.js +2 -0
  350. package/dist/chunks/utils-BGHwK7fd.cjs.js.map +1 -0
  351. package/dist/chunks/{utils-CB9xZl-T.cjs.js → utils-BHdR5Nww.cjs.js} +2 -2
  352. package/dist/chunks/{utils-CB9xZl-T.cjs.js.map → utils-BHdR5Nww.cjs.js.map} +1 -1
  353. package/dist/chunks/{utils-emYDjcZU.es.js → utils-BkdW_cdL.es.js} +2 -2
  354. package/dist/chunks/{utils-emYDjcZU.es.js.map → utils-BkdW_cdL.es.js.map} +1 -1
  355. package/dist/chunks/utils-jpfA6kxk.es.js +188 -0
  356. package/dist/chunks/utils-jpfA6kxk.es.js.map +1 -0
  357. package/dist/chunks/{visually-hidden-CQBnuJLY.cjs.js → visually-hidden-Bh-G5QHv.cjs.js} +2 -2
  358. package/dist/chunks/{visually-hidden-CQBnuJLY.cjs.js.map → visually-hidden-Bh-G5QHv.cjs.js.map} +1 -1
  359. package/dist/chunks/{visually-hidden-Bw4WH-b1.es.js → visually-hidden-BluyWhUI.es.js} +2 -2
  360. package/dist/chunks/{visually-hidden-Bw4WH-b1.es.js.map → visually-hidden-BluyWhUI.es.js.map} +1 -1
  361. package/dist/components/accordion.cjs +1 -1
  362. package/dist/components/accordion.es.js +1 -1
  363. package/dist/components/alert.cjs +1 -1
  364. package/dist/components/alert.es.js +1 -1
  365. package/dist/components/badge.cjs +1 -1
  366. package/dist/components/badge.es.js +1 -1
  367. package/dist/components/button.cjs +1 -1
  368. package/dist/components/button.es.js +1 -1
  369. package/dist/components/calendar.cjs +1 -1
  370. package/dist/components/calendar.es.js +1 -1
  371. package/dist/components/card.cjs +1 -1
  372. package/dist/components/card.es.js +1 -1
  373. package/dist/components/checkbox.cjs +1 -1
  374. package/dist/components/checkbox.es.js +1 -1
  375. package/dist/components/combobox.cjs +1 -1
  376. package/dist/components/combobox.es.js +1 -1
  377. package/dist/components/components.cjs +1 -1
  378. package/dist/components/components.es.js +42 -42
  379. package/dist/components/data-table.cjs +1 -1
  380. package/dist/components/data-table.es.js +1 -1
  381. package/dist/components/date-input.cjs +1 -1
  382. package/dist/components/date-input.es.js +1 -1
  383. package/dist/components/date-picker.cjs +1 -1
  384. package/dist/components/date-picker.es.js +1 -1
  385. package/dist/components/date-range-picker.cjs +1 -1
  386. package/dist/components/date-range-picker.es.js +1 -1
  387. package/dist/components/divider.cjs +1 -1
  388. package/dist/components/divider.es.js +1 -1
  389. package/dist/components/form-field.cjs +1 -1
  390. package/dist/components/form-field.es.js +1 -1
  391. package/dist/components/group.cjs +1 -1
  392. package/dist/components/group.es.js +1 -1
  393. package/dist/components/icon-button.cjs +1 -1
  394. package/dist/components/icon-button.es.js +1 -1
  395. package/dist/components/icon-toggle-button.cjs +1 -1
  396. package/dist/components/icon-toggle-button.es.js +1 -1
  397. package/dist/components/kbd.cjs +1 -1
  398. package/dist/components/kbd.es.js +1 -1
  399. package/dist/components/link.cjs +1 -1
  400. package/dist/components/link.es.js +1 -1
  401. package/dist/components/loading-spinner.cjs +1 -1
  402. package/dist/components/loading-spinner.es.js +1 -1
  403. package/dist/components/multiline-text-input.cjs +1 -1
  404. package/dist/components/multiline-text-input.es.js +1 -1
  405. package/dist/components/nimbus-provider.es.js +1 -1
  406. package/dist/components/number-input.cjs +1 -1
  407. package/dist/components/number-input.es.js +1 -1
  408. package/dist/components/password-input.cjs +1 -1
  409. package/dist/components/password-input.es.js +1 -1
  410. package/dist/components/popover.cjs +1 -1
  411. package/dist/components/popover.es.js +1 -1
  412. package/dist/components/progress-bar.cjs +1 -1
  413. package/dist/components/progress-bar.es.js +1 -1
  414. package/dist/components/radio-input.cjs +1 -1
  415. package/dist/components/radio-input.es.js +1 -1
  416. package/dist/components/range-calendar.cjs +1 -1
  417. package/dist/components/range-calendar.es.js +1 -1
  418. package/dist/components/rich-text-input.cjs +1 -1
  419. package/dist/components/rich-text-input.es.js +1 -1
  420. package/dist/components/select.cjs +1 -1
  421. package/dist/components/select.es.js +1 -1
  422. package/dist/components/split-button.cjs +1 -1
  423. package/dist/components/split-button.es.js +1 -1
  424. package/dist/components/switch.cjs +1 -1
  425. package/dist/components/switch.es.js +1 -1
  426. package/dist/components/tag-group.cjs +1 -1
  427. package/dist/components/tag-group.es.js +1 -1
  428. package/dist/components/text-input.cjs +1 -1
  429. package/dist/components/text-input.es.js +1 -1
  430. package/dist/components/text.cjs +1 -1
  431. package/dist/components/text.es.js +1 -1
  432. package/dist/components/time-input.cjs +1 -1
  433. package/dist/components/time-input.es.js +1 -1
  434. package/dist/components/toggle-button-group.cjs +1 -1
  435. package/dist/components/toggle-button-group.es.js +1 -1
  436. package/dist/components/toggle-button.cjs +1 -1
  437. package/dist/components/toggle-button.es.js +1 -1
  438. package/dist/components/toolbar.cjs +1 -1
  439. package/dist/components/toolbar.es.js +1 -1
  440. package/dist/components/tooltip.cjs +1 -1
  441. package/dist/components/tooltip.es.js +2 -2
  442. package/dist/components/visually-hidden.cjs +1 -1
  443. package/dist/components/visually-hidden.es.js +1 -1
  444. package/dist/index.cjs +1 -1
  445. package/dist/index.es.js +43 -43
  446. package/package.json +11 -11
  447. package/dist/chunks/Collection-CDJ_uFKV.es.js.map +0 -1
  448. package/dist/chunks/Collection-D_q1hY13.cjs.js +0 -18
  449. package/dist/chunks/Collection-D_q1hY13.cjs.js.map +0 -1
  450. package/dist/chunks/DateField-BRw4EOOA.cjs.js +0 -2
  451. package/dist/chunks/Dialog-ljK75Ezb.cjs.js +0 -2
  452. package/dist/chunks/FocusScope-B5Aod9bV.es.js +0 -696
  453. package/dist/chunks/FocusScope-B5Aod9bV.es.js.map +0 -1
  454. package/dist/chunks/FocusScope-sU1ErK5w.cjs.js +0 -2
  455. package/dist/chunks/FocusScope-sU1ErK5w.cjs.js.map +0 -1
  456. package/dist/chunks/Heading-BorDTn_V.cjs.js +0 -2
  457. package/dist/chunks/Separator-CinA2hg4.cjs.js +0 -2
  458. package/dist/chunks/combobox-C1nOP0Qh.es.js.map +0 -1
  459. package/dist/chunks/combobox-D1AqzXjA.cjs.js +0 -2
  460. package/dist/chunks/combobox-D1AqzXjA.cjs.js.map +0 -1
  461. package/dist/chunks/data-table-CgICAQC9.cjs.js +0 -2
  462. package/dist/chunks/domHelpers-InH3T0qs.es.js +0 -16
  463. package/dist/chunks/domHelpers-InH3T0qs.es.js.map +0 -1
  464. package/dist/chunks/domHelpers-YAYZ9fE9.cjs.js +0 -2
  465. package/dist/chunks/domHelpers-YAYZ9fE9.cjs.js.map +0 -1
  466. package/dist/chunks/focusSafely-CgVjbH-x.cjs.js +0 -2
  467. package/dist/chunks/number-input-2C9g1Xgr.cjs.js +0 -2
  468. package/dist/chunks/number-input-2C9g1Xgr.cjs.js.map +0 -1
  469. package/dist/chunks/number-input-l32lWVbX.es.js.map +0 -1
  470. package/dist/chunks/radio-input-BlE9GNwl.cjs.js +0 -2
  471. package/dist/chunks/scrollIntoView-B2eLOBfw.cjs.js +0 -2
  472. package/dist/chunks/scrollIntoView-B2eLOBfw.cjs.js.map +0 -1
  473. package/dist/chunks/scrollIntoView-CdmKMaOn.es.js +0 -64
  474. package/dist/chunks/scrollIntoView-CdmKMaOn.es.js.map +0 -1
  475. package/dist/chunks/tag-group-5uAuEquc.cjs.js +0 -2
  476. package/dist/chunks/useDescription-CVIOL3si.es.js +0 -33
  477. package/dist/chunks/useDescription-CVIOL3si.es.js.map +0 -1
  478. package/dist/chunks/useDescription-Dwd7oLGP.cjs.js +0 -2
  479. package/dist/chunks/useDescription-Dwd7oLGP.cjs.js.map +0 -1
  480. package/dist/chunks/useFocusVisible-CCKx2EYu.cjs.js +0 -2
  481. package/dist/chunks/useFocusVisible-CCKx2EYu.cjs.js.map +0 -1
  482. package/dist/chunks/useFocusVisible-DGwGbqVH.es.js +0 -148
  483. package/dist/chunks/useFocusVisible-DGwGbqVH.es.js.map +0 -1
  484. package/dist/chunks/useFocusable-BKWax3sD.cjs.js +0 -2
  485. package/dist/chunks/useFocusable-BKWax3sD.cjs.js.map +0 -1
  486. package/dist/chunks/useFocusable-ZY85zm7p.es.js +0 -101
  487. package/dist/chunks/useFocusable-ZY85zm7p.es.js.map +0 -1
  488. package/dist/chunks/usePress-CEcydhMs.es.js +0 -473
  489. package/dist/chunks/usePress-CEcydhMs.es.js.map +0 -1
  490. package/dist/chunks/usePress-_EFFCs1n.cjs.js +0 -8
  491. package/dist/chunks/usePress-_EFFCs1n.cjs.js.map +0 -1
  492. package/dist/chunks/useSpinButton-BmgSsr4J.es.js.map +0 -1
  493. package/dist/chunks/useSpinButton-CjLHguQd.cjs.js +0 -2
  494. package/dist/chunks/useSpinButton-CjLHguQd.cjs.js.map +0 -1
  495. package/dist/chunks/useSyncRef-Cey7oI1w.cjs.js +0 -2
  496. package/dist/chunks/useSyncRef-Cey7oI1w.cjs.js.map +0 -1
  497. package/dist/chunks/useSyncRef-KqQTqZax.es.js +0 -47
  498. package/dist/chunks/useSyncRef-KqQTqZax.es.js.map +0 -1
  499. package/dist/chunks/useTextField-DvU8XT6q.cjs.js +0 -2
  500. package/dist/chunks/utils-3xKI25I1.cjs.js +0 -2
  501. package/dist/chunks/utils-3xKI25I1.cjs.js.map +0 -1
  502. package/dist/chunks/utils-4CfAFtL7.es.js +0 -242
  503. package/dist/chunks/utils-4CfAFtL7.es.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"range-calendar-CvTT4HY-.cjs.js","sources":["../../src/components/range-calendar/range-calendar.slots.tsx","../../src/components/range-calendar/components/range-calendar.grids.tsx","../../src/components/range-calendar/components/range-calendar.header.tsx","../../src/components/range-calendar/components/range-calendar.custom-context.tsx","../../src/components/range-calendar/range-calendar.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n createSlotRecipeContext,\n type HTMLChakraProps,\n type RecipeVariantProps,\n} from \"@chakra-ui/react/styled-system\";\nimport { rangeCalendarSlotRecipe } from \"./range-calendar.recipe\";\nimport type { RangeCalendarProps } from \"react-aria-components\";\nimport type { DateValue } from \"@internationalized/date\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"rangeCalendar\",\n});\n\nexport interface RangeCalendarRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof rangeCalendarSlotRecipe> &\n RangeCalendarProps<DateValue>\n > {}\nexport const RangeCalendarRootSlot = withProvider<\n HTMLDivElement,\n RangeCalendarRootSlotProps\n>(\"div\", \"root\");\n\nexport interface RangeCalendarHeaderSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarHeaderSlot = withContext<\n HTMLDivElement,\n RangeCalendarHeaderSlotProps\n>(\"div\", \"header\");\n\nexport interface RangeCalendarGridsSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarGridsSlot = withContext<\n HTMLDivElement,\n RangeCalendarGridsSlotProps\n>(\"div\", \"grids\");\n\nexport interface RangeCalendarMonthTitleSlotProps\n extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarMonthTitleSlot = withContext<\n HTMLDivElement,\n RangeCalendarMonthTitleSlotProps\n>(\"div\", \"monthTitle\");\n\nexport interface RangeCalendarGridSlotProps extends HTMLChakraProps<\"table\"> {}\nexport const RangeCalendarGridSlot = withContext<\n HTMLTableElement,\n RangeCalendarGridSlotProps\n>(\"table\", \"grid\");\n\nexport interface RangeCalendarGridHeaderSlotProps\n extends HTMLChakraProps<\"thead\"> {}\nexport const RangeCalendarGridHeaderSlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridHeaderSlotProps\n>(\"thead\", \"gridHeader\");\n\nexport interface RangeCalendarHeaderCellSlotProps\n extends HTMLChakraProps<\"th\"> {}\nexport const RangeCalendarHeaderCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarHeaderCellSlotProps\n>(\"th\", \"headerCell\");\n\nexport interface RangeCalendarGridBodySlotProps\n extends HTMLChakraProps<\"tbody\"> {}\nexport const RangeCalendarGridBodySlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridBodySlotProps\n>(\"tbody\", \"gridBody\");\n\nexport interface RangeCalendarCellSlotProps extends HTMLChakraProps<\"td\"> {}\nexport const RangeCalendarCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarCellSlotProps\n>(\"td\", \"bodyCell\");\n","import { useContext } from \"react\";\nimport { today, getLocalTimeZone } from \"@internationalized/date\";\nimport {\n CalendarGrid as RaCalendarGrid,\n CalendarGridBody as RaCalendarGridBody,\n CalendarGridHeader as RaCalendarGridHeader,\n CalendarHeaderCell as RaCalendarHeaderCell,\n CalendarCell as RaCalendarCell,\n useSlottedContext,\n RangeCalendarContext,\n RangeCalendarStateContext,\n useLocale,\n} from \"react-aria-components\";\nimport { Box } from \"@/components\";\n\nimport {\n RangeCalendarCellSlot,\n RangeCalendarGridBodySlot,\n RangeCalendarGridHeaderSlot,\n RangeCalendarGridsSlot,\n RangeCalendarGridSlot,\n RangeCalendarHeaderCellSlot,\n RangeCalendarMonthTitleSlot,\n} from \"../range-calendar.slots\";\n\nexport const RangeCalendarGrids = () => {\n const { locale } = useLocale();\n const context = useSlottedContext(RangeCalendarContext);\n\n const calendarState = useContext(RangeCalendarStateContext)!;\n const visibleMonthsCount = context?.visibleDuration?.months || 1;\n const todayDate = today(getLocalTimeZone());\n const showMonthTitles = visibleMonthsCount > 1;\n\n return (\n <RangeCalendarGridsSlot>\n {Array.from({ length: visibleMonthsCount }, (_, index) => {\n const gridDate = calendarState.visibleRange.start.add({\n months: index,\n });\n const monthName = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(gridDate.toDate(getLocalTimeZone()));\n\n return (\n <Box\n key={monthName}\n width={visibleMonthsCount == 1 ? \"full\" : \"auto\"}\n >\n {showMonthTitles && (\n <RangeCalendarMonthTitleSlot>\n {monthName}\n </RangeCalendarMonthTitleSlot>\n )}\n <RangeCalendarGridSlot asChild>\n <RaCalendarGrid offset={{ months: index }} weekdayStyle=\"short\">\n <RangeCalendarGridHeaderSlot asChild>\n <RaCalendarGridHeader>\n {(day) => (\n <RangeCalendarHeaderCellSlot asChild>\n <RaCalendarHeaderCell>{day}</RaCalendarHeaderCell>\n </RangeCalendarHeaderCellSlot>\n )}\n </RaCalendarGridHeader>\n </RangeCalendarGridHeaderSlot>\n <RangeCalendarGridBodySlot asChild>\n <RaCalendarGridBody>\n {(date) => {\n const isToday = date.compare(todayDate) === 0;\n return (\n <RangeCalendarCellSlot asChild data-today={isToday}>\n <RaCalendarCell date={date} />\n </RangeCalendarCellSlot>\n );\n }}\n </RaCalendarGridBody>\n </RangeCalendarGridBodySlot>\n </RaCalendarGrid>\n </RangeCalendarGridSlot>\n </Box>\n );\n })}\n </RangeCalendarGridsSlot>\n );\n};\n","import {\n RangeCalendarContext,\n Heading,\n useSlottedContext,\n} from \"react-aria-components\";\nimport {\n Box,\n Flex,\n IconButton,\n Stack,\n Text,\n VisuallyHidden,\n} from \"@/components\";\nimport {\n KeyboardArrowLeft,\n KeyboardArrowRight,\n} from \"@commercetools/nimbus-icons\";\nimport { RangeCalendarHeaderSlot } from \"../range-calendar.slots\";\n\nexport const RangeCalendarHeader = () => {\n const rangeCalendarProps = useSlottedContext(RangeCalendarContext);\n\n // Needed to decide whether to show a single month or a range\n const visibleDurationMonths =\n rangeCalendarProps?.visibleDuration?.months || 1;\n const showRangeLabel = visibleDurationMonths > 1;\n\n return (\n <RangeCalendarHeaderSlot>\n <Flex>\n <Stack direction=\"row\" alignItems=\"center\">\n {/** solely for screen readers, if not present, a11y issues are raised */}\n <VisuallyHidden>\n <Heading />\n </VisuallyHidden>\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"previous\" : \"previous-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width={showRangeLabel ? \"4000\" : \"2000\"}\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot={showRangeLabel ? \"monthRange\" : \"month\"}\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"next\" : \"next-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n <Box flexGrow=\"1\" />\n <Stack direction=\"row\" alignItems=\"center\">\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot=\"previous-year\"\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width=\"1400\"\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot=\"year\"\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton slot=\"next-year\" size=\"xs\" variant=\"ghost\" tone=\"primary\">\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n </Flex>\n </RangeCalendarHeaderSlot>\n );\n};\n","import { getLocalTimeZone } from \"@internationalized/date\";\nimport { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n RangeCalendarStateContext,\n TextContext,\n useLocale,\n} from \"react-aria-components\";\n\nexport const RangeCalendarCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const { locale } = useLocale();\n const buttonContext = useContext(ButtonContext)!;\n const textContext = useContext(TextContext)!;\n const calendarState = useContext(RangeCalendarStateContext)!;\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n \"next-month\": {\n onPress: () => calendarState.focusNextSection(),\n \"aria-label\": \"Next month\",\n },\n \"previous-month\": {\n onPress: () => calendarState.focusPreviousSection(),\n \"aria-label\": \"Previous month\",\n },\n \"next-year\": {\n onPress: () => calendarState.focusNextSection(true),\n \"aria-label\": \"Next year\",\n },\n \"previous-year\": {\n onPress: () => calendarState.focusPreviousSection(true),\n \"aria-label\": \"Previous year\",\n },\n };\n\n /**\n * Text slots\n * ================================\n */\n const monthLabel = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const monthRangeLabel = [\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.start.toDate(getLocalTimeZone())),\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.end.toDate(getLocalTimeZone())),\n ].join(\" - \");\n\n const yearLabel = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const textSlots = {\n month: { children: monthLabel },\n monthRange: { children: monthRangeLabel },\n year: { children: yearLabel },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n ...buttonContext,\n slots: {\n ...(buttonContext &&\n typeof buttonContext === \"object\" &&\n \"slots\" in buttonContext\n ? buttonContext.slots\n : {}),\n ...buttonSlots,\n },\n },\n ],\n [\n TextContext,\n {\n ...textContext,\n slots: {\n ...(textContext &&\n typeof textContext === \"object\" &&\n \"slots\" in textContext\n ? textContext.slots\n : {}),\n ...textSlots,\n },\n },\n ],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import type { RangeCalendarProps } from \"./range-calendar.types\";\nimport type { DateValue } from \"@internationalized/date\";\n\nimport { RangeCalendar as RaRangeCalendar } from \"react-aria-components\";\n\nimport { RangeCalendarRootSlot } from \"./range-calendar.slots\";\nimport { RangeCalendarGrids } from \"./components/range-calendar.grids\";\nimport { RangeCalendarHeader } from \"./components/range-calendar.header\";\nimport { rangeCalendarSlotRecipe } from \"./range-calendar.recipe\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { RangeCalendarCustomContext } from \"./components/range-calendar.custom-context\";\n\nexport const RangeCalendar = (props: RangeCalendarProps<DateValue>) => {\n const recipe = useRecipe({ recipe: rangeCalendarSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n return (\n <RangeCalendarRootSlot {...recipeProps} {...styleProps} asChild>\n <RaRangeCalendar {...otherProps}>\n <RangeCalendarCustomContext>\n <RangeCalendarHeader />\n <RangeCalendarGrids />\n </RangeCalendarCustomContext>\n </RaRangeCalendar>\n </RangeCalendarRootSlot>\n );\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","RangeCalendarRootSlot","RangeCalendarHeaderSlot","RangeCalendarGridsSlot","RangeCalendarMonthTitleSlot","RangeCalendarGridSlot","RangeCalendarGridHeaderSlot","RangeCalendarHeaderCellSlot","RangeCalendarGridBodySlot","RangeCalendarCellSlot","RangeCalendarGrids","locale","useLocale","context","useSlottedContext","RangeCalendarContext","calendarState","useContext","RangeCalendarStateContext","visibleMonthsCount","todayDate","today","getLocalTimeZone","showMonthTitles","jsx","_","index","gridDate","monthName","jsxs","Box","RaCalendarGrid","RaCalendarGridHeader","day","RaCalendarHeaderCell","RaCalendarGridBody","date","isToday","RaCalendarCell","RangeCalendarHeader","showRangeLabel","Flex","Stack","VisuallyHidden","Heading","IconButton","KeyboardArrowLeft","Text","KeyboardArrowRight","RangeCalendarCustomContext","children","buttonContext","ButtonContext","textContext","TextContext","buttonSlots","monthLabel","monthRangeLabel","yearLabel","textSlots","Provider","RangeCalendar","props","recipe","useRecipe","rangeCalendarSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","RaRangeCalendar"],"mappings":"+vBAUM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,eACP,CAAC,EAQYC,EAAwBH,EAGnC,MAAO,MAAM,EAGFI,EAA0BH,EAGrC,MAAO,QAAQ,EAGJI,EAAyBJ,EAGpC,MAAO,OAAO,EAIHK,EAA8BL,EAGzC,MAAO,YAAY,EAGRM,EAAwBN,EAGnC,QAAS,MAA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+ {"version":3,"file":"range-calendar-BuzvPCc1.cjs.js","sources":["../../src/components/range-calendar/range-calendar.slots.tsx","../../src/components/range-calendar/components/range-calendar.grids.tsx","../../src/components/range-calendar/components/range-calendar.header.tsx","../../src/components/range-calendar/components/range-calendar.custom-context.tsx","../../src/components/range-calendar/range-calendar.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n createSlotRecipeContext,\n type HTMLChakraProps,\n type RecipeVariantProps,\n} from \"@chakra-ui/react/styled-system\";\nimport { rangeCalendarSlotRecipe } from \"./range-calendar.recipe\";\nimport type { RangeCalendarProps } from \"react-aria-components\";\nimport type { DateValue } from \"@internationalized/date\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"rangeCalendar\",\n});\n\nexport interface RangeCalendarRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof rangeCalendarSlotRecipe> &\n RangeCalendarProps<DateValue>\n > {}\nexport const RangeCalendarRootSlot = withProvider<\n HTMLDivElement,\n RangeCalendarRootSlotProps\n>(\"div\", \"root\");\n\nexport interface RangeCalendarHeaderSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarHeaderSlot = withContext<\n HTMLDivElement,\n RangeCalendarHeaderSlotProps\n>(\"div\", \"header\");\n\nexport interface RangeCalendarGridsSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarGridsSlot = withContext<\n HTMLDivElement,\n RangeCalendarGridsSlotProps\n>(\"div\", \"grids\");\n\nexport interface RangeCalendarMonthTitleSlotProps\n extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarMonthTitleSlot = withContext<\n HTMLDivElement,\n RangeCalendarMonthTitleSlotProps\n>(\"div\", \"monthTitle\");\n\nexport interface RangeCalendarGridSlotProps extends HTMLChakraProps<\"table\"> {}\nexport const RangeCalendarGridSlot = withContext<\n HTMLTableElement,\n RangeCalendarGridSlotProps\n>(\"table\", \"grid\");\n\nexport interface RangeCalendarGridHeaderSlotProps\n extends HTMLChakraProps<\"thead\"> {}\nexport const RangeCalendarGridHeaderSlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridHeaderSlotProps\n>(\"thead\", \"gridHeader\");\n\nexport interface RangeCalendarHeaderCellSlotProps\n extends HTMLChakraProps<\"th\"> {}\nexport const RangeCalendarHeaderCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarHeaderCellSlotProps\n>(\"th\", \"headerCell\");\n\nexport interface RangeCalendarGridBodySlotProps\n extends HTMLChakraProps<\"tbody\"> {}\nexport const RangeCalendarGridBodySlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridBodySlotProps\n>(\"tbody\", \"gridBody\");\n\nexport interface RangeCalendarCellSlotProps extends HTMLChakraProps<\"td\"> {}\nexport const RangeCalendarCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarCellSlotProps\n>(\"td\", \"bodyCell\");\n","import { useContext } from \"react\";\nimport { today, getLocalTimeZone } from \"@internationalized/date\";\nimport {\n CalendarGrid as RaCalendarGrid,\n CalendarGridBody as RaCalendarGridBody,\n CalendarGridHeader as RaCalendarGridHeader,\n CalendarHeaderCell as RaCalendarHeaderCell,\n CalendarCell as RaCalendarCell,\n useSlottedContext,\n RangeCalendarContext,\n RangeCalendarStateContext,\n useLocale,\n} from \"react-aria-components\";\nimport { Box } from \"@/components\";\n\nimport {\n RangeCalendarCellSlot,\n RangeCalendarGridBodySlot,\n RangeCalendarGridHeaderSlot,\n RangeCalendarGridsSlot,\n RangeCalendarGridSlot,\n RangeCalendarHeaderCellSlot,\n RangeCalendarMonthTitleSlot,\n} from \"../range-calendar.slots\";\n\nexport const RangeCalendarGrids = () => {\n const { locale } = useLocale();\n const context = useSlottedContext(RangeCalendarContext);\n\n const calendarState = useContext(RangeCalendarStateContext)!;\n const visibleMonthsCount = context?.visibleDuration?.months || 1;\n const todayDate = today(getLocalTimeZone());\n const showMonthTitles = visibleMonthsCount > 1;\n\n return (\n <RangeCalendarGridsSlot>\n {Array.from({ length: visibleMonthsCount }, (_, index) => {\n const gridDate = calendarState.visibleRange.start.add({\n months: index,\n });\n const monthName = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(gridDate.toDate(getLocalTimeZone()));\n\n return (\n <Box\n key={monthName}\n width={visibleMonthsCount == 1 ? \"full\" : \"auto\"}\n >\n {showMonthTitles && (\n <RangeCalendarMonthTitleSlot>\n {monthName}\n </RangeCalendarMonthTitleSlot>\n )}\n <RangeCalendarGridSlot asChild>\n <RaCalendarGrid offset={{ months: index }} weekdayStyle=\"short\">\n <RangeCalendarGridHeaderSlot asChild>\n <RaCalendarGridHeader>\n {(day) => (\n <RangeCalendarHeaderCellSlot asChild>\n <RaCalendarHeaderCell>{day}</RaCalendarHeaderCell>\n </RangeCalendarHeaderCellSlot>\n )}\n </RaCalendarGridHeader>\n </RangeCalendarGridHeaderSlot>\n <RangeCalendarGridBodySlot asChild>\n <RaCalendarGridBody>\n {(date) => {\n const isToday = date.compare(todayDate) === 0;\n return (\n <RangeCalendarCellSlot asChild data-today={isToday}>\n <RaCalendarCell date={date} />\n </RangeCalendarCellSlot>\n );\n }}\n </RaCalendarGridBody>\n </RangeCalendarGridBodySlot>\n </RaCalendarGrid>\n </RangeCalendarGridSlot>\n </Box>\n );\n })}\n </RangeCalendarGridsSlot>\n );\n};\n","import {\n RangeCalendarContext,\n Heading,\n useSlottedContext,\n} from \"react-aria-components\";\nimport {\n Box,\n Flex,\n IconButton,\n Stack,\n Text,\n VisuallyHidden,\n} from \"@/components\";\nimport {\n KeyboardArrowLeft,\n KeyboardArrowRight,\n} from \"@commercetools/nimbus-icons\";\nimport { RangeCalendarHeaderSlot } from \"../range-calendar.slots\";\n\nexport const RangeCalendarHeader = () => {\n const rangeCalendarProps = useSlottedContext(RangeCalendarContext);\n\n // Needed to decide whether to show a single month or a range\n const visibleDurationMonths =\n rangeCalendarProps?.visibleDuration?.months || 1;\n const showRangeLabel = visibleDurationMonths > 1;\n\n return (\n <RangeCalendarHeaderSlot>\n <Flex>\n <Stack direction=\"row\" alignItems=\"center\">\n {/** solely for screen readers, if not present, a11y issues are raised */}\n <VisuallyHidden>\n <Heading />\n </VisuallyHidden>\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"previous\" : \"previous-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width={showRangeLabel ? \"4000\" : \"2000\"}\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot={showRangeLabel ? \"monthRange\" : \"month\"}\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"next\" : \"next-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n <Box flexGrow=\"1\" />\n <Stack direction=\"row\" alignItems=\"center\">\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot=\"previous-year\"\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width=\"1400\"\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot=\"year\"\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton slot=\"next-year\" size=\"xs\" variant=\"ghost\" tone=\"primary\">\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n </Flex>\n </RangeCalendarHeaderSlot>\n );\n};\n","import { getLocalTimeZone } from \"@internationalized/date\";\nimport { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n RangeCalendarStateContext,\n TextContext,\n useLocale,\n} from \"react-aria-components\";\n\nexport const RangeCalendarCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const { locale } = useLocale();\n const buttonContext = useContext(ButtonContext)!;\n const textContext = useContext(TextContext)!;\n const calendarState = useContext(RangeCalendarStateContext)!;\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n \"next-month\": {\n onPress: () => calendarState.focusNextSection(),\n \"aria-label\": \"Next month\",\n },\n \"previous-month\": {\n onPress: () => calendarState.focusPreviousSection(),\n \"aria-label\": \"Previous month\",\n },\n \"next-year\": {\n onPress: () => calendarState.focusNextSection(true),\n \"aria-label\": \"Next year\",\n },\n \"previous-year\": {\n onPress: () => calendarState.focusPreviousSection(true),\n \"aria-label\": \"Previous year\",\n },\n };\n\n /**\n * Text slots\n * ================================\n */\n const monthLabel = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const monthRangeLabel = [\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.start.toDate(getLocalTimeZone())),\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.end.toDate(getLocalTimeZone())),\n ].join(\" - \");\n\n const yearLabel = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const textSlots = {\n month: { children: monthLabel },\n monthRange: { children: monthRangeLabel },\n year: { children: yearLabel },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n ...buttonContext,\n slots: {\n ...(buttonContext &&\n typeof buttonContext === \"object\" &&\n \"slots\" in buttonContext\n ? buttonContext.slots\n : {}),\n ...buttonSlots,\n },\n },\n ],\n [\n TextContext,\n {\n ...textContext,\n slots: {\n ...(textContext &&\n typeof textContext === \"object\" &&\n \"slots\" in textContext\n ? textContext.slots\n : {}),\n ...textSlots,\n },\n },\n ],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import type { RangeCalendarProps } from \"./range-calendar.types\";\nimport type { DateValue } from \"@internationalized/date\";\n\nimport { RangeCalendar as RaRangeCalendar } from \"react-aria-components\";\n\nimport { RangeCalendarRootSlot } from \"./range-calendar.slots\";\nimport { RangeCalendarGrids } from \"./components/range-calendar.grids\";\nimport { RangeCalendarHeader } from \"./components/range-calendar.header\";\nimport { rangeCalendarSlotRecipe } from \"./range-calendar.recipe\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { RangeCalendarCustomContext } from \"./components/range-calendar.custom-context\";\n\nexport const RangeCalendar = (props: RangeCalendarProps<DateValue>) => {\n const recipe = useRecipe({ recipe: rangeCalendarSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n return (\n <RangeCalendarRootSlot {...recipeProps} {...styleProps} asChild>\n <RaRangeCalendar {...otherProps}>\n <RangeCalendarCustomContext>\n <RangeCalendarHeader />\n <RangeCalendarGrids />\n </RangeCalendarCustomContext>\n </RaRangeCalendar>\n </RangeCalendarRootSlot>\n );\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","RangeCalendarRootSlot","RangeCalendarHeaderSlot","RangeCalendarGridsSlot","RangeCalendarMonthTitleSlot","RangeCalendarGridSlot","RangeCalendarGridHeaderSlot","RangeCalendarHeaderCellSlot","RangeCalendarGridBodySlot","RangeCalendarCellSlot","RangeCalendarGrids","locale","useLocale","context","useSlottedContext","RangeCalendarContext","calendarState","useContext","RangeCalendarStateContext","visibleMonthsCount","todayDate","today","getLocalTimeZone","showMonthTitles","jsx","_","index","gridDate","monthName","jsxs","Box","RaCalendarGrid","RaCalendarGridHeader","day","RaCalendarHeaderCell","RaCalendarGridBody","date","isToday","RaCalendarCell","RangeCalendarHeader","showRangeLabel","Flex","Stack","VisuallyHidden","Heading","IconButton","KeyboardArrowLeft","Text","KeyboardArrowRight","RangeCalendarCustomContext","children","buttonContext","ButtonContext","textContext","TextContext","buttonSlots","monthLabel","monthRangeLabel","yearLabel","textSlots","Provider","RangeCalendar","props","recipe","useRecipe","rangeCalendarSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","RaRangeCalendar"],"mappings":"+vBAUM,CAAE,aAAAA,EAAc,YAAAC,CAAA,EAAgBC,0BAAwB,CAC5D,IAAK,eACP,CAAC,EAQYC,EAAwBH,EAGnC,MAAO,MAAM,EAGFI,EAA0BH,EAGrC,MAAO,QAAQ,EAGJI,EAAyBJ,EAGpC,MAAO,OAAO,EAIHK,EAA8BL,EAGzC,MAAO,YAAY,EAGRM,EAAwBN,EAGnC,QAAS,MAAM,EAIJO,EAA8BP,EAGzC,QAAS,YAAY,EAIVQ,EAA8BR,EAGzC,KAAM,YAAY,EAIPS,EAA4BT,EAGvC,QAAS,UAAU,EAGRU,EAAwBV,EAGnC,KAAM,UAAU,EClDLW,EAAqB,IAAM,CACtC,KAAM,CAAE,OAAAC,CAAA,EAAWC,4CAAA,EACbC,EAAUC,EAAAA,0CAAkBC,2CAAoB,EAEhDC,EAAgBC,EAAAA,WAAWC,2CAAyB,EACpDC,EAAqBN,GAAS,iBAAiB,QAAU,EACzDO,EAAYC,4CAAMC,EAAAA,2CAAkB,EACpCC,EAAkBJ,EAAqB,EAE7C,OACEK,MAACrB,EAAA,CACE,SAAA,MAAM,KAAK,CAAE,OAAQgB,CAAA,EAAsB,CAACM,EAAGC,IAAU,CACxD,MAAMC,EAAWX,EAAc,aAAa,MAAM,IAAI,CACpD,OAAQU,CAAA,CACT,EACKE,EAAY,IAAI,KAAK,eAAejB,EAAQ,CAChD,MAAO,MAAA,CACR,EAAE,OAAOgB,EAAS,OAAOL,EAAAA,0CAAA,CAAkB,CAAC,EAE7C,OACEO,EAAAA,KAACC,EAAAA,IAAA,CAEC,MAAOX,GAAsB,EAAI,OAAS,OAEzC,SAAA,CAAAI,GACCC,EAAAA,IAACpB,GACE,SAAAwB,CAAA,CACH,EAEFJ,EAAAA,IAACnB,EAAA,CAAsB,QAAO,GAC5B,S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,CAACC,EAAaC,CAAc,EAAIJ,EAAO,kBAAkBD,CAAK,EAC9D,CAACM,EAAYC,CAAU,EAAIC,EAAAA,kBAAkBH,CAAc,EAEjE,OACE3C,EAAAA,IAACvB,EAAA,CAAuB,GAAGiE,EAAc,GAAGE,EAAY,QAAO,GAC7D,SAAA5C,EAAAA,IAAC+C,EAAAA,0CAAA,CAAiB,GAAGF,EACnB,gBAACpB,EAAA,CACC,SAAA,CAAAzB,EAAAA,IAACe,EAAA,EAAoB,QACpB7B,EAAA,CAAA,CAAmB,CAAA,CAAA,CACtB,EACF,EACF,CAEJ"}
@@ -1,20 +1,20 @@
1
1
  import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
- import { i as R, a as I, b as F, c as j, d as G, e as H, j as S, g as A, k as B } from "./Heading-CXKMd84h.es.js";
2
+ import { i as R, a as I, b as F, c as j, d as G, e as H, j as S, g as A, k as B } from "./Heading-sepFdCCa.es.js";
3
3
  import { c as L } from "./create-slot-recipe-context-DBNItnlK.es.js";
4
4
  import { useContext as p } from "react";
5
- import { $ as M, a as i } from "./useDateFormatter-DGeAh0SC.es.js";
6
- import { c as w, d as N } from "./utils-emYDjcZU.es.js";
5
+ import { $ as M, a as i } from "./useDateFormatter-BqJA667a.es.js";
6
+ import { c as w, d as N } from "./utils-BkdW_cdL.es.js";
7
7
  import { B as D } from "./box-C8731OYq.es.js";
8
8
  import { $ as P } from "./context-Pt-0ojuK.es.js";
9
- import { I as h } from "./icon-button-BkjZ1Pq8.es.js";
10
- import { T as u } from "./text-DkO9mfur.es.js";
9
+ import { I as h } from "./icon-button-oIKucbza.es.js";
10
+ import { T as u } from "./text-B2wziCK6.es.js";
11
11
  import { S as x } from "./stack-CBx-c8hI.es.js";
12
- import { V as k } from "./visually-hidden-Bw4WH-b1.es.js";
12
+ import { V as k } from "./visually-hidden-BluyWhUI.es.js";
13
13
  import { KeyboardArrowLeft as g, KeyboardArrowRight as C } from "@commercetools/nimbus-icons";
14
14
  import { F as z } from "./flex-B81RbgfK.es.js";
15
15
  import { r as V } from "./index-DRWeBbu8.es.js";
16
16
  import { e as K } from "./extractStyleProps-DX5GBd9K.es.js";
17
- import { $ as y } from "./Button-wUEF0Zow.es.js";
17
+ import { $ as y } from "./Button--gemnXF8.es.js";
18
18
  import { $ as v } from "./Text-DOcU1ycg.es.js";
19
19
  import { u as W } from "./use-recipe-CR4W7Dne.es.js";
20
20
  const { withProvider: _, withContext: n } = /* @__PURE__ */ L({
@@ -184,4 +184,4 @@ const { withProvider: _, withContext: n } = /* @__PURE__ */ L({
184
184
  export {
185
185
  ve as R
186
186
  };
187
- //# sourceMappingURL=range-calendar-YuvY8LUd.es.js.map
187
+ //# sourceMappingURL=range-calendar-D-CvB2-1.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"range-calendar-YuvY8LUd.es.js","sources":["../../src/components/range-calendar/range-calendar.slots.tsx","../../src/components/range-calendar/components/range-calendar.grids.tsx","../../src/components/range-calendar/components/range-calendar.header.tsx","../../src/components/range-calendar/components/range-calendar.custom-context.tsx","../../src/components/range-calendar/range-calendar.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n createSlotRecipeContext,\n type HTMLChakraProps,\n type RecipeVariantProps,\n} from \"@chakra-ui/react/styled-system\";\nimport { rangeCalendarSlotRecipe } from \"./range-calendar.recipe\";\nimport type { RangeCalendarProps } from \"react-aria-components\";\nimport type { DateValue } from \"@internationalized/date\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"rangeCalendar\",\n});\n\nexport interface RangeCalendarRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof rangeCalendarSlotRecipe> &\n RangeCalendarProps<DateValue>\n > {}\nexport const RangeCalendarRootSlot = withProvider<\n HTMLDivElement,\n RangeCalendarRootSlotProps\n>(\"div\", \"root\");\n\nexport interface RangeCalendarHeaderSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarHeaderSlot = withContext<\n HTMLDivElement,\n RangeCalendarHeaderSlotProps\n>(\"div\", \"header\");\n\nexport interface RangeCalendarGridsSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarGridsSlot = withContext<\n HTMLDivElement,\n RangeCalendarGridsSlotProps\n>(\"div\", \"grids\");\n\nexport interface RangeCalendarMonthTitleSlotProps\n extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarMonthTitleSlot = withContext<\n HTMLDivElement,\n RangeCalendarMonthTitleSlotProps\n>(\"div\", \"monthTitle\");\n\nexport interface RangeCalendarGridSlotProps extends HTMLChakraProps<\"table\"> {}\nexport const RangeCalendarGridSlot = withContext<\n HTMLTableElement,\n RangeCalendarGridSlotProps\n>(\"table\", \"grid\");\n\nexport interface RangeCalendarGridHeaderSlotProps\n extends HTMLChakraProps<\"thead\"> {}\nexport const RangeCalendarGridHeaderSlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridHeaderSlotProps\n>(\"thead\", \"gridHeader\");\n\nexport interface RangeCalendarHeaderCellSlotProps\n extends HTMLChakraProps<\"th\"> {}\nexport const RangeCalendarHeaderCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarHeaderCellSlotProps\n>(\"th\", \"headerCell\");\n\nexport interface RangeCalendarGridBodySlotProps\n extends HTMLChakraProps<\"tbody\"> {}\nexport const RangeCalendarGridBodySlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridBodySlotProps\n>(\"tbody\", \"gridBody\");\n\nexport interface RangeCalendarCellSlotProps extends HTMLChakraProps<\"td\"> {}\nexport const RangeCalendarCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarCellSlotProps\n>(\"td\", \"bodyCell\");\n","import { useContext } from \"react\";\nimport { today, getLocalTimeZone } from \"@internationalized/date\";\nimport {\n CalendarGrid as RaCalendarGrid,\n CalendarGridBody as RaCalendarGridBody,\n CalendarGridHeader as RaCalendarGridHeader,\n CalendarHeaderCell as RaCalendarHeaderCell,\n CalendarCell as RaCalendarCell,\n useSlottedContext,\n RangeCalendarContext,\n RangeCalendarStateContext,\n useLocale,\n} from \"react-aria-components\";\nimport { Box } from \"@/components\";\n\nimport {\n RangeCalendarCellSlot,\n RangeCalendarGridBodySlot,\n RangeCalendarGridHeaderSlot,\n RangeCalendarGridsSlot,\n RangeCalendarGridSlot,\n RangeCalendarHeaderCellSlot,\n RangeCalendarMonthTitleSlot,\n} from \"../range-calendar.slots\";\n\nexport const RangeCalendarGrids = () => {\n const { locale } = useLocale();\n const context = useSlottedContext(RangeCalendarContext);\n\n const calendarState = useContext(RangeCalendarStateContext)!;\n const visibleMonthsCount = context?.visibleDuration?.months || 1;\n const todayDate = today(getLocalTimeZone());\n const showMonthTitles = visibleMonthsCount > 1;\n\n return (\n <RangeCalendarGridsSlot>\n {Array.from({ length: visibleMonthsCount }, (_, index) => {\n const gridDate = calendarState.visibleRange.start.add({\n months: index,\n });\n const monthName = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(gridDate.toDate(getLocalTimeZone()));\n\n return (\n <Box\n key={monthName}\n width={visibleMonthsCount == 1 ? \"full\" : \"auto\"}\n >\n {showMonthTitles && (\n <RangeCalendarMonthTitleSlot>\n {monthName}\n </RangeCalendarMonthTitleSlot>\n )}\n <RangeCalendarGridSlot asChild>\n <RaCalendarGrid offset={{ months: index }} weekdayStyle=\"short\">\n <RangeCalendarGridHeaderSlot asChild>\n <RaCalendarGridHeader>\n {(day) => (\n <RangeCalendarHeaderCellSlot asChild>\n <RaCalendarHeaderCell>{day}</RaCalendarHeaderCell>\n </RangeCalendarHeaderCellSlot>\n )}\n </RaCalendarGridHeader>\n </RangeCalendarGridHeaderSlot>\n <RangeCalendarGridBodySlot asChild>\n <RaCalendarGridBody>\n {(date) => {\n const isToday = date.compare(todayDate) === 0;\n return (\n <RangeCalendarCellSlot asChild data-today={isToday}>\n <RaCalendarCell date={date} />\n </RangeCalendarCellSlot>\n );\n }}\n </RaCalendarGridBody>\n </RangeCalendarGridBodySlot>\n </RaCalendarGrid>\n </RangeCalendarGridSlot>\n </Box>\n );\n })}\n </RangeCalendarGridsSlot>\n );\n};\n","import {\n RangeCalendarContext,\n Heading,\n useSlottedContext,\n} from \"react-aria-components\";\nimport {\n Box,\n Flex,\n IconButton,\n Stack,\n Text,\n VisuallyHidden,\n} from \"@/components\";\nimport {\n KeyboardArrowLeft,\n KeyboardArrowRight,\n} from \"@commercetools/nimbus-icons\";\nimport { RangeCalendarHeaderSlot } from \"../range-calendar.slots\";\n\nexport const RangeCalendarHeader = () => {\n const rangeCalendarProps = useSlottedContext(RangeCalendarContext);\n\n // Needed to decide whether to show a single month or a range\n const visibleDurationMonths =\n rangeCalendarProps?.visibleDuration?.months || 1;\n const showRangeLabel = visibleDurationMonths > 1;\n\n return (\n <RangeCalendarHeaderSlot>\n <Flex>\n <Stack direction=\"row\" alignItems=\"center\">\n {/** solely for screen readers, if not present, a11y issues are raised */}\n <VisuallyHidden>\n <Heading />\n </VisuallyHidden>\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"previous\" : \"previous-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width={showRangeLabel ? \"4000\" : \"2000\"}\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot={showRangeLabel ? \"monthRange\" : \"month\"}\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"next\" : \"next-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n <Box flexGrow=\"1\" />\n <Stack direction=\"row\" alignItems=\"center\">\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot=\"previous-year\"\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width=\"1400\"\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot=\"year\"\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton slot=\"next-year\" size=\"xs\" variant=\"ghost\" tone=\"primary\">\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n </Flex>\n </RangeCalendarHeaderSlot>\n );\n};\n","import { getLocalTimeZone } from \"@internationalized/date\";\nimport { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n RangeCalendarStateContext,\n TextContext,\n useLocale,\n} from \"react-aria-components\";\n\nexport const RangeCalendarCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const { locale } = useLocale();\n const buttonContext = useContext(ButtonContext)!;\n const textContext = useContext(TextContext)!;\n const calendarState = useContext(RangeCalendarStateContext)!;\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n \"next-month\": {\n onPress: () => calendarState.focusNextSection(),\n \"aria-label\": \"Next month\",\n },\n \"previous-month\": {\n onPress: () => calendarState.focusPreviousSection(),\n \"aria-label\": \"Previous month\",\n },\n \"next-year\": {\n onPress: () => calendarState.focusNextSection(true),\n \"aria-label\": \"Next year\",\n },\n \"previous-year\": {\n onPress: () => calendarState.focusPreviousSection(true),\n \"aria-label\": \"Previous year\",\n },\n };\n\n /**\n * Text slots\n * ================================\n */\n const monthLabel = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const monthRangeLabel = [\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.start.toDate(getLocalTimeZone())),\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.end.toDate(getLocalTimeZone())),\n ].join(\" - \");\n\n const yearLabel = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const textSlots = {\n month: { children: monthLabel },\n monthRange: { children: monthRangeLabel },\n year: { children: yearLabel },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n ...buttonContext,\n slots: {\n ...(buttonContext &&\n typeof buttonContext === \"object\" &&\n \"slots\" in buttonContext\n ? buttonContext.slots\n : {}),\n ...buttonSlots,\n },\n },\n ],\n [\n TextContext,\n {\n ...textContext,\n slots: {\n ...(textContext &&\n typeof textContext === \"object\" &&\n \"slots\" in textContext\n ? textContext.slots\n : {}),\n ...textSlots,\n },\n },\n ],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import type { RangeCalendarProps } from \"./range-calendar.types\";\nimport type { DateValue } from \"@internationalized/date\";\n\nimport { RangeCalendar as RaRangeCalendar } from \"react-aria-components\";\n\nimport { RangeCalendarRootSlot } from \"./range-calendar.slots\";\nimport { RangeCalendarGrids } from \"./components/range-calendar.grids\";\nimport { RangeCalendarHeader } from \"./components/range-calendar.header\";\nimport { rangeCalendarSlotRecipe } from \"./range-calendar.recipe\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { RangeCalendarCustomContext } from \"./components/range-calendar.custom-context\";\n\nexport const RangeCalendar = (props: RangeCalendarProps<DateValue>) => {\n const recipe = useRecipe({ recipe: rangeCalendarSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n return (\n <RangeCalendarRootSlot {...recipeProps} {...styleProps} asChild>\n <RaRangeCalendar {...otherProps}>\n <RangeCalendarCustomContext>\n <RangeCalendarHeader />\n <RangeCalendarGrids />\n </RangeCalendarCustomContext>\n </RaRangeCalendar>\n </RangeCalendarRootSlot>\n );\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","RangeCalendarRootSlot","RangeCalendarHeaderSlot","RangeCalendarGridsSlot","RangeCalendarMonthTitleSlot","RangeCalendarGridSlot","RangeCalendarGridHeaderSlot","RangeCalendarHeaderCellSlot","RangeCalendarGridBodySlot","RangeCalendarCellSlot","RangeCalendarGrids","locale","useLocale","context","useSlottedContext","RangeCalendarContext","calendarState","useContext","RangeCalendarStateContext","visibleMonthsCount","todayDate","today","getLocalTimeZone","showMonthTitles","jsx","_","index","gridDate","monthName","jsxs","Box","RaCalendarGrid","RaCalendarGridHeader","day","RaCalendarHeaderCell","RaCalendarGridBody","date","isToday","RaCalendarCell","RangeCalendarHeader","showRangeLabel","Flex","Stack","VisuallyHidden","Heading","IconButton","KeyboardArrowLeft","Text","KeyboardArrowRight","RangeCalendarCustomContext","children","buttonContext","ButtonContext","textContext","TextContext","buttonSlots","monthLabel","monthRangeLabel","yearLabel","textSlots","Provider","RangeCalendar","props","recipe","useRecipe","rangeCalendarSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","RaRangeCalendar"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAQYC,IAAwB,gBAAAH,EAGnC,OAAO,MAAM,GAGFI,IAA0B,gBAAAH,EAGrC,OAAO,QAAQ,GAGJI,IAAyB,gBAAAJ,EAGpC,OAAO,OAAO,GAIHK,IAA8B,gBAAAL,EAGzC,OAAO,YAAY,GAGRM,IAAwB,gBAAAN,EAGnC,SAAS,MAAM,GAIJO,IAA8B,gBAAAP,EAGzC,SAAS,YAAY,GAIVQ,IAA8B,gBAAAR,EAGzC,MAAM,YAAY,GAIPS,IAA4B,gBAAAT,EAGvC,SAAS,UAAU,GAGRU,IAAwB,gBAAAV,EAGnC,MAAM,UAAU,GClDLW,KAAqB,MAAM;AACtC,QAAM,EAAE,QAAAC,EAAA,IAAWC,EAAA,GACbC,IAAUC,EAAkBC,CAAoB,GAEhDC,IAAgBC,EAAWC,CAAyB,GACpDC,IAA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BH,CAAc;AAEjE,SACE,gBAAA3C,EAACvB,GAAA,EAAuB,GAAGiE,GAAc,GAAGE,GAAY,SAAO,IAC7D,UAAA,gBAAA5C,EAAC+C,GAAA,EAAiB,GAAGF,GACnB,4BAACpB,IAAA,EACC,UAAA;AAAA,IAAA,gBAAAzB,EAACe,IAAA,EAAoB;AAAA,sBACpB7B,IAAA,CAAA,CAAmB;AAAA,EAAA,EAAA,CACtB,GACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"range-calendar-D-CvB2-1.es.js","sources":["../../src/components/range-calendar/range-calendar.slots.tsx","../../src/components/range-calendar/components/range-calendar.grids.tsx","../../src/components/range-calendar/components/range-calendar.header.tsx","../../src/components/range-calendar/components/range-calendar.custom-context.tsx","../../src/components/range-calendar/range-calendar.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport {\n createSlotRecipeContext,\n type HTMLChakraProps,\n type RecipeVariantProps,\n} from \"@chakra-ui/react/styled-system\";\nimport { rangeCalendarSlotRecipe } from \"./range-calendar.recipe\";\nimport type { RangeCalendarProps } from \"react-aria-components\";\nimport type { DateValue } from \"@internationalized/date\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n key: \"rangeCalendar\",\n});\n\nexport interface RangeCalendarRootSlotProps\n extends HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof rangeCalendarSlotRecipe> &\n RangeCalendarProps<DateValue>\n > {}\nexport const RangeCalendarRootSlot = withProvider<\n HTMLDivElement,\n RangeCalendarRootSlotProps\n>(\"div\", \"root\");\n\nexport interface RangeCalendarHeaderSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarHeaderSlot = withContext<\n HTMLDivElement,\n RangeCalendarHeaderSlotProps\n>(\"div\", \"header\");\n\nexport interface RangeCalendarGridsSlotProps extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarGridsSlot = withContext<\n HTMLDivElement,\n RangeCalendarGridsSlotProps\n>(\"div\", \"grids\");\n\nexport interface RangeCalendarMonthTitleSlotProps\n extends HTMLChakraProps<\"div\"> {}\nexport const RangeCalendarMonthTitleSlot = withContext<\n HTMLDivElement,\n RangeCalendarMonthTitleSlotProps\n>(\"div\", \"monthTitle\");\n\nexport interface RangeCalendarGridSlotProps extends HTMLChakraProps<\"table\"> {}\nexport const RangeCalendarGridSlot = withContext<\n HTMLTableElement,\n RangeCalendarGridSlotProps\n>(\"table\", \"grid\");\n\nexport interface RangeCalendarGridHeaderSlotProps\n extends HTMLChakraProps<\"thead\"> {}\nexport const RangeCalendarGridHeaderSlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridHeaderSlotProps\n>(\"thead\", \"gridHeader\");\n\nexport interface RangeCalendarHeaderCellSlotProps\n extends HTMLChakraProps<\"th\"> {}\nexport const RangeCalendarHeaderCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarHeaderCellSlotProps\n>(\"th\", \"headerCell\");\n\nexport interface RangeCalendarGridBodySlotProps\n extends HTMLChakraProps<\"tbody\"> {}\nexport const RangeCalendarGridBodySlot = withContext<\n HTMLTableSectionElement,\n RangeCalendarGridBodySlotProps\n>(\"tbody\", \"gridBody\");\n\nexport interface RangeCalendarCellSlotProps extends HTMLChakraProps<\"td\"> {}\nexport const RangeCalendarCellSlot = withContext<\n HTMLTableCellElement,\n RangeCalendarCellSlotProps\n>(\"td\", \"bodyCell\");\n","import { useContext } from \"react\";\nimport { today, getLocalTimeZone } from \"@internationalized/date\";\nimport {\n CalendarGrid as RaCalendarGrid,\n CalendarGridBody as RaCalendarGridBody,\n CalendarGridHeader as RaCalendarGridHeader,\n CalendarHeaderCell as RaCalendarHeaderCell,\n CalendarCell as RaCalendarCell,\n useSlottedContext,\n RangeCalendarContext,\n RangeCalendarStateContext,\n useLocale,\n} from \"react-aria-components\";\nimport { Box } from \"@/components\";\n\nimport {\n RangeCalendarCellSlot,\n RangeCalendarGridBodySlot,\n RangeCalendarGridHeaderSlot,\n RangeCalendarGridsSlot,\n RangeCalendarGridSlot,\n RangeCalendarHeaderCellSlot,\n RangeCalendarMonthTitleSlot,\n} from \"../range-calendar.slots\";\n\nexport const RangeCalendarGrids = () => {\n const { locale } = useLocale();\n const context = useSlottedContext(RangeCalendarContext);\n\n const calendarState = useContext(RangeCalendarStateContext)!;\n const visibleMonthsCount = context?.visibleDuration?.months || 1;\n const todayDate = today(getLocalTimeZone());\n const showMonthTitles = visibleMonthsCount > 1;\n\n return (\n <RangeCalendarGridsSlot>\n {Array.from({ length: visibleMonthsCount }, (_, index) => {\n const gridDate = calendarState.visibleRange.start.add({\n months: index,\n });\n const monthName = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(gridDate.toDate(getLocalTimeZone()));\n\n return (\n <Box\n key={monthName}\n width={visibleMonthsCount == 1 ? \"full\" : \"auto\"}\n >\n {showMonthTitles && (\n <RangeCalendarMonthTitleSlot>\n {monthName}\n </RangeCalendarMonthTitleSlot>\n )}\n <RangeCalendarGridSlot asChild>\n <RaCalendarGrid offset={{ months: index }} weekdayStyle=\"short\">\n <RangeCalendarGridHeaderSlot asChild>\n <RaCalendarGridHeader>\n {(day) => (\n <RangeCalendarHeaderCellSlot asChild>\n <RaCalendarHeaderCell>{day}</RaCalendarHeaderCell>\n </RangeCalendarHeaderCellSlot>\n )}\n </RaCalendarGridHeader>\n </RangeCalendarGridHeaderSlot>\n <RangeCalendarGridBodySlot asChild>\n <RaCalendarGridBody>\n {(date) => {\n const isToday = date.compare(todayDate) === 0;\n return (\n <RangeCalendarCellSlot asChild data-today={isToday}>\n <RaCalendarCell date={date} />\n </RangeCalendarCellSlot>\n );\n }}\n </RaCalendarGridBody>\n </RangeCalendarGridBodySlot>\n </RaCalendarGrid>\n </RangeCalendarGridSlot>\n </Box>\n );\n })}\n </RangeCalendarGridsSlot>\n );\n};\n","import {\n RangeCalendarContext,\n Heading,\n useSlottedContext,\n} from \"react-aria-components\";\nimport {\n Box,\n Flex,\n IconButton,\n Stack,\n Text,\n VisuallyHidden,\n} from \"@/components\";\nimport {\n KeyboardArrowLeft,\n KeyboardArrowRight,\n} from \"@commercetools/nimbus-icons\";\nimport { RangeCalendarHeaderSlot } from \"../range-calendar.slots\";\n\nexport const RangeCalendarHeader = () => {\n const rangeCalendarProps = useSlottedContext(RangeCalendarContext);\n\n // Needed to decide whether to show a single month or a range\n const visibleDurationMonths =\n rangeCalendarProps?.visibleDuration?.months || 1;\n const showRangeLabel = visibleDurationMonths > 1;\n\n return (\n <RangeCalendarHeaderSlot>\n <Flex>\n <Stack direction=\"row\" alignItems=\"center\">\n {/** solely for screen readers, if not present, a11y issues are raised */}\n <VisuallyHidden>\n <Heading />\n </VisuallyHidden>\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"previous\" : \"previous-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width={showRangeLabel ? \"4000\" : \"2000\"}\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot={showRangeLabel ? \"monthRange\" : \"month\"}\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot={showRangeLabel ? \"next\" : \"next-month\"}\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n <Box flexGrow=\"1\" />\n <Stack direction=\"row\" alignItems=\"center\">\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton\n slot=\"previous-year\"\n size=\"xs\"\n variant=\"ghost\"\n tone=\"primary\"\n >\n <KeyboardArrowLeft />\n </IconButton>\n <Text\n textStyle=\"sm\"\n fontWeight=\"500\"\n color=\"neutral.11\"\n width=\"1400\"\n textAlign=\"center\"\n aria-hidden=\"true\"\n slot=\"year\"\n />\n {/* @ts-expect-error - custom-context will add aria-label via the \"slot\" prop */}\n <IconButton slot=\"next-year\" size=\"xs\" variant=\"ghost\" tone=\"primary\">\n <KeyboardArrowRight />\n </IconButton>\n </Stack>\n </Flex>\n </RangeCalendarHeaderSlot>\n );\n};\n","import { getLocalTimeZone } from \"@internationalized/date\";\nimport { useContext } from \"react\";\nimport {\n Provider,\n ButtonContext,\n RangeCalendarStateContext,\n TextContext,\n useLocale,\n} from \"react-aria-components\";\n\nexport const RangeCalendarCustomContext = ({\n children,\n}: {\n children: React.ReactNode;\n}) => {\n const { locale } = useLocale();\n const buttonContext = useContext(ButtonContext)!;\n const textContext = useContext(TextContext)!;\n const calendarState = useContext(RangeCalendarStateContext)!;\n\n /**\n * Button slots\n * ================================\n */\n const buttonSlots = {\n \"next-month\": {\n onPress: () => calendarState.focusNextSection(),\n \"aria-label\": \"Next month\",\n },\n \"previous-month\": {\n onPress: () => calendarState.focusPreviousSection(),\n \"aria-label\": \"Previous month\",\n },\n \"next-year\": {\n onPress: () => calendarState.focusNextSection(true),\n \"aria-label\": \"Next year\",\n },\n \"previous-year\": {\n onPress: () => calendarState.focusPreviousSection(true),\n \"aria-label\": \"Previous year\",\n },\n };\n\n /**\n * Text slots\n * ================================\n */\n const monthLabel = new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const monthRangeLabel = [\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.start.toDate(getLocalTimeZone())),\n new Intl.DateTimeFormat(locale, {\n month: \"long\",\n }).format(calendarState.visibleRange.end.toDate(getLocalTimeZone())),\n ].join(\" - \");\n\n const yearLabel = new Intl.DateTimeFormat(locale, {\n year: \"numeric\",\n }).format(calendarState.focusedDate.toDate(getLocalTimeZone()));\n\n const textSlots = {\n month: { children: monthLabel },\n monthRange: { children: monthRangeLabel },\n year: { children: yearLabel },\n };\n\n return (\n <Provider\n values={[\n [\n ButtonContext,\n {\n ...buttonContext,\n slots: {\n ...(buttonContext &&\n typeof buttonContext === \"object\" &&\n \"slots\" in buttonContext\n ? buttonContext.slots\n : {}),\n ...buttonSlots,\n },\n },\n ],\n [\n TextContext,\n {\n ...textContext,\n slots: {\n ...(textContext &&\n typeof textContext === \"object\" &&\n \"slots\" in textContext\n ? textContext.slots\n : {}),\n ...textSlots,\n },\n },\n ],\n ]}\n >\n {children}\n </Provider>\n );\n};\n","import type { RangeCalendarProps } from \"./range-calendar.types\";\nimport type { DateValue } from \"@internationalized/date\";\n\nimport { RangeCalendar as RaRangeCalendar } from \"react-aria-components\";\n\nimport { RangeCalendarRootSlot } from \"./range-calendar.slots\";\nimport { RangeCalendarGrids } from \"./components/range-calendar.grids\";\nimport { RangeCalendarHeader } from \"./components/range-calendar.header\";\nimport { rangeCalendarSlotRecipe } from \"./range-calendar.recipe\";\nimport { useRecipe } from \"@chakra-ui/react/styled-system\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { RangeCalendarCustomContext } from \"./components/range-calendar.custom-context\";\n\nexport const RangeCalendar = (props: RangeCalendarProps<DateValue>) => {\n const recipe = useRecipe({ recipe: rangeCalendarSlotRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps(props);\n const [styleProps, otherProps] = extractStyleProps(remainingProps);\n\n return (\n <RangeCalendarRootSlot {...recipeProps} {...styleProps} asChild>\n <RaRangeCalendar {...otherProps}>\n <RangeCalendarCustomContext>\n <RangeCalendarHeader />\n <RangeCalendarGrids />\n </RangeCalendarCustomContext>\n </RaRangeCalendar>\n </RangeCalendarRootSlot>\n );\n};\n"],"names":["withProvider","withContext","createSlotRecipeContext","RangeCalendarRootSlot","RangeCalendarHeaderSlot","RangeCalendarGridsSlot","RangeCalendarMonthTitleSlot","RangeCalendarGridSlot","RangeCalendarGridHeaderSlot","RangeCalendarHeaderCellSlot","RangeCalendarGridBodySlot","RangeCalendarCellSlot","RangeCalendarGrids","locale","useLocale","context","useSlottedContext","RangeCalendarContext","calendarState","useContext","RangeCalendarStateContext","visibleMonthsCount","todayDate","today","getLocalTimeZone","showMonthTitles","jsx","_","index","gridDate","monthName","jsxs","Box","RaCalendarGrid","RaCalendarGridHeader","day","RaCalendarHeaderCell","RaCalendarGridBody","date","isToday","RaCalendarCell","RangeCalendarHeader","showRangeLabel","Flex","Stack","VisuallyHidden","Heading","IconButton","KeyboardArrowLeft","Text","KeyboardArrowRight","RangeCalendarCustomContext","children","buttonContext","ButtonContext","textContext","TextContext","buttonSlots","monthLabel","monthRangeLabel","yearLabel","textSlots","Provider","RangeCalendar","props","recipe","useRecipe","rangeCalendarSlotRecipe","recipeProps","remainingProps","styleProps","otherProps","extractStyleProps","RaRangeCalendar"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA,MAAM,EAAE,cAAAA,GAAc,aAAAC,EAAA,IAAgB,gBAAAC,EAAwB;AAAA,EAC5D,KAAK;AACP,CAAC,GAQYC,IAAwB,gBAAAH,EAGnC,OAAO,MAAM,GAGFI,IAA0B,gBAAAH,EAGrC,OAAO,QAAQ,GAGJI,IAAyB,gBAAAJ,EAGpC,OAAO,OAAO,GAIHK,IAA8B,gBAAAL,EAGzC,OAAO,YAAY,GAGRM,IAAwB,gBAAAN,EAGnC,SAAS,MAAM,GAIJO,IAA8B,gBAAAP,EAGzC,SAAS,YAAY,GAIVQ,IAA8B,gBAAAR,EAGzC,MAAM,YAAY,GAIPS,IAA4B,gBAAAT,EAGvC,SAAS,UAAU,GAGRU,IAAwB,gBAAAV,EAGnC,MAAM,UAAU,GClDLW,KAAqB,MAAM;AACtC,QAAM,EAAE,QAAAC,EAAA,IAAWC,EAAA,GACbC,IAAUC,EAAkBC,CAAoB,GAEhDC,IAAgBC,EAAWC,CAAyB,GACpDC,IAAqBN,GAAS,iBAAiB,UAAU,GACzDO,IAAYC,EAAMC,GAAkB,GACpCC,IAAkBJ,IAAqB;AAE7C,SACE,gBAAAK,EAACrB,GAAA,EACE,UAAA,MAAM,KAAK,EAAE,QAAQgB,EAAA,GAAsB,CAACM,GAAGC,MAAU;AACx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AzB,EAACe,IAAA,EAAoB;AAAA,sBACpB7B,IAAA,CAAA,CAAmB;AAAA,EAAA,EAAA,CACtB,GACF,GACF;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),p=require("react"),k=require("@chakra-ui/react"),oe=require("./extractStyleProps-yFm0qaXg.cjs.js"),n=require("./slate-helpers-CMAwCMk0.cjs.js"),D=require("./use-formatting-state-Denpy3Zo.cjs.js"),I=require("../components/constants.cjs"),b=require("./box-BPfqlznQ.cjs.js"),N=require("./divider-BZkfiFj5.cjs.js"),U=require("./group-DgCuvf_U.cjs.js"),O=require("./icon-button-Cs41MKV5.cjs.js"),w=require("./icon-toggle-button-BljNXaJy.cjs.js"),v=require("./text-BOdnmoaN.cjs.js"),d=require("./tooltip-D7QmPw5W.cjs.js"),M=require("./visually-hidden-CQBnuJLY.cjs.js"),_=require("./toggle-button-group-B_C5ly_4.cjs.js"),re=require("./toolbar-BZkvVoAw.cjs.js"),f=require("@commercetools/nimbus-icons"),y=require("./menu-BaTd4n0a.cjs.js"),G=k.defineSlotRecipe({slots:["root","toolbar","editable"],className:"nimbus-rich-text-input",base:{root:{display:"flex",flexDirection:"column",position:"relative",width:"full",borderRadius:"200",borderWidth:"{sizes.25}",colorPalette:"slate",borderColor:"colorPalette.7",backgroundColor:"colorPalette.contrast","&[data-invalid='true']":{borderWidth:"{sizes.50}",borderColor:"critical.7"}},toolbar:{boxShadow:"1","[data-disabled='true'] &":{opacity:"0.5"}},editable:{padding:"400",minHeight:"inherit",outline:"none","[data-disabled='true'] &":{cursor:"not-allowed",opacity:"0.5"},"& p":{textStyle:"md",fontWeight:"500"},"& h1":{textStyle:"2xl",fontWeight:"500"},"& h2":{textStyle:"xl",fontWeight:"500"},"& h3":{textStyle:"lg",fontWeight:"500"},"& h4":{textStyle:"md",fontWeight:"500"},"& h5":{textStyle:"xs",fontWeight:"500"},"& blockquote":{textStyle:"md",fontWeight:"400",borderLeftWidth:"{sizes.100}",paddingLeft:"400"},"& ul":{paddingLeft:"600",listStyleType:"disc"},"& ol":{paddingLeft:"600",listStyleType:"decimal"},"& code":{padding:"100",fontFamily:"mono"},"& pre":{padding:"300",borderRadius:"200",overflow:"auto","& code":{padding:"0"}},"& a":{color:"primary.11",textDecoration:"underline",cursor:"pointer",_hover:{textDecoration:"none"}},"& strong":{fontWeight:"700"},"& em":{fontStyle:"italic"},"& u":{textDecoration:"underline"},"& del":{textDecoration:"line-through"},"& sup":{fontSize:"75%",verticalAlign:"super",lineHeight:"0"},"& sub":{fontSize:"75%",verticalAlign:"sub",lineHeight:"0"}}},variants:{}}),{withProvider:ne,withContext:K}=k.createSlotRecipeContext({recipe:G}),ie=ne("div","root"),se=K("div","toolbar"),le=K("div","editable");var ae={isHistory(t){return n.isPlainObject(t)&&Array.isArray(t.redos)&&Array.isArray(t.undos)&&(t.redos.length===0||n.Operation.isOperationList(t.redos[0].operations))&&(t.undos.length===0||n.Operation.isOperationList(t.undos[0].operations))}},z=new WeakMap,S=new WeakMap,C=new WeakMap,m={isHistoryEditor(t){return ae.isHistory(t.history)&&n.Editor.isEditor(t)},isMerging(t){return S.get(t)},isSplittingOnce(t){return C.get(t)},setSplittingOnce(t,o){C.set(t,o)},isSaving(t){return z.get(t)},redo(t){t.redo()},undo(t){t.undo()},withMerging(t,o){var i=m.isMerging(t);S.set(t,!0),o(),S.set(t,i)},withNewBatch(t,o){var i=m.isMerging(t);S.set(t,!0),C.set(t,!0),o(),S.set(t,i),C.delete(t)},withoutMerging(t,o){var i=m.isMerging(t);S.set(t,!1),o(),S.set(t,i)},withoutSaving(t,o){var i=m.isSaving(t);z.set(t,!1);try{o()}finally{z.set(t,i)}}},de=t=>{var o=t,{apply:i}=o;return o.history={undos:[],redos:[]},o.redo=()=>{var{history:l}=o,{redos:s}=l;if(s.length>0){var a=s[s.length-1];a.selectionBefore&&n.Transforms.setSelection(o,a.selectionBefore),m.withoutSaving(o,()=>{n.Editor.withoutNormalizing(o,()=>{for(var c of a.operations)o.apply(c)})}),l.redos.pop(),o.writeHistory("undos",a)}},o.undo=()=>{var{history:l}=o,{undos:s}=l;if(s.length>0){var a=s[s.length-1];m.withoutSaving(o,()=>{n.Editor.withoutNormalizing(o,()=>{var c=a.operations.map(n.Operation.inverse).reverse();for(var u of c)o.apply(u);a.selectionBefore&&n.Transforms.setSelection(o,a.selectionBefore)})}),o.writeHistory("redos",a),l.undos.pop()}},o.apply=l=>{var{operations:s,history:a}=o,{undos:c}=a,u=c[c.length-1],j=u&&u.operations[u.operations.length-1],g=m.isSaving(o),h=m.isMerging(o);if(g==null&&(g=ue(l)),g){if(h==null&&(u==null?h=!1:s.length!==0?h=!0:h=ce(l,j)),m.isSplittingOnce(o)&&(h=!1,m.setSplittingOnce(o,void 0)),u&&h)u.operations.push(l);else{var r={operations:[l],selectionBefore:o.selection};o.writeHistory("undos",r)}for(;c.length>100;)c.shift();a.redos=[]}i(l)},o.writeHistory=(l,s)=>{o.history[l].push(s)},o},ce=(t,o)=>!!(o&&t.type==="insert_text"&&o.type==="insert_text"&&t.offset===o.offset+o.text.length&&n.Path.equals(t.path,o.path)||o&&t.type==="remove_text"&&o.type==="remove_text"&&t.offset+t.text.length===o.offset&&n.Path.equals(t.path,o.path)),ue=(t,o)=>t.type!=="set_selection";const X=p.forwardRef((t,o)=>{const{value:i,onChange:l,onFocus:s,onBlur:a,placeholder:c=I.EDITOR_DEFAULTS.placeholder,isDisabled:u=I.EDITOR_DEFAULTS.isDisabled,isReadOnly:j=I.EDITOR_DEFAULTS.isReadOnly,autoFocus:g=I.EDITOR_DEFAULTS.autoFocus,toolbar:h}=t,r=p.useMemo(()=>{const x=n.createEditor();return n.withLinks(de(n.withReact(x)))},[]),{handleKeyDown:E}=D.useKeyboardShortcuts({editor:r}),H=p.useCallback(x=>{s&&s(x)},[s]),L=p.useCallback(x=>{a&&a(x)},[a]);p.useImperativeHandle(o,()=>({focus:()=>n.focusEditor(r),resetValue:x=>n.resetEditor(r,x)}),[r]);const P=p.useCallback(x=>e.jsx(n.Element$1,{...x}),[]),F=p.useCallback(x=>e.jsx(n.Leaf,{...x}),[]),q=n.createEmptyValue(),V=Array.isArray(i)&&i.length>0?i:q;return e.jsxs(n.Slate,{editor:r,value:V,onChange:l,children:[h&&e.jsx(se,{children:h}),e.jsx(le,{asChild:!0,children:e.jsx(n.Editable,{renderElement:P,renderLeaf:F,placeholder:c,autoFocus:g,readOnly:j||u,onKeyDown:E,onFocus:H,onBlur:L,"aria-label":"Rich text editor",role:"textbox","aria-multiline":"true"})})]})});X.displayName="RichTextEditor";const he=({isDisabled:t=!1})=>{const o=n.useSlate(),i=D.usePreservedSelection(o),{allSelectedKeys:l,handleAllSelectionChange:s}=D.useFormattingState({withPreservedSelection:i});return e.jsxs(y.Menu.Root,{selectionMode:"multiple",selectedKeys:l,onSelectionChange:s,children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsx(y.Menu.Trigger,{asChild:!0,children:e.jsx(O.IconButton,{size:"xs",variant:"ghost","aria-label":"More formatting options",isDisabled:t,onMouseDown:a=>a.preventDefault(),children:e.jsx(f.MoreHoriz,{})})}),e.jsx(d.Tooltip.Content,{placement:"top",children:"More styles"})]}),e.jsxs(y.Menu.Content,{children:[e.jsx(y.Menu.Item,{id:"strikethrough",children:e.jsxs(b.Box,{slot:"label",display:"flex",alignItems:"center",gap:"200",children:[e.jsx(f.FormatStrikethrough,{}),e.jsx(v.Text,{textStyle:"sm",children:"Strikethrough"})]})}),e.jsx(y.Menu.Item,{id:"code",children:e.jsxs(b.Box,{slot:"label",display:"flex",alignItems:"center",gap:"200",children:[e.jsx(f.Code,{}),e.jsx(v.Text,{textStyle:"sm",children:"Code"})]})}),e.jsx(y.Menu.Item,{id:"superscript",children:e.jsxs(b.Box,{slot:"label",display:"flex",alignItems:"center",gap:"200",children:[e.jsx(v.Text,{children:"X²"}),e.jsx(v.Text,{textStyle:"sm",children:"Superscript"})]})}),e.jsx(y.Menu.Item,{id:"subscript",children:e.jsxs(b.Box,{slot:"label",display:"flex",alignItems:"center",gap:"200",children:[e.jsx(v.Text,{children:"X₂"}),e.jsx(v.Text,{textStyle:"sm",children:"Subscript"})]})})]})]})},$=({isDisabled:t=!1})=>{const o=n.useSlate(),i=D.usePreservedSelection(o),{currentTextStyle:l,selectedTextStyleLabel:s,handleTextStyleChange:a,handleListToggle:c,selectedFormatKeys:u,selectedListKeys:j,hasUndos:g,hasRedos:h}=D.useToolbarState({withPreservedSelection:i});return e.jsxs(re.Toolbar,{orientation:"horizontal","aria-label":"Text formatting",width:"full",overflow:"hidden",size:"xs",children:[e.jsx(U.Group,{children:e.jsxs(y.Menu.Root,{onAction:r=>a(String(r)),children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsx(y.Menu.Trigger,{height:"800",width:"4000",bg:"primary.1",borderRadius:"200",_hover:{bg:"primary.2"},isDisabled:t,onMouseDown:r=>r.preventDefault(),"aria-label":"Text style menu",children:e.jsxs(b.Box,{display:"flex",alignItems:"center",gap:"200",px:"200",children:[e.jsx(b.Box,{display:"flex",alignItems:"center",gap:"200",flexGrow:"1",children:e.jsx(v.Text,{my:"auto",textStyle:"sm",fontWeight:"500",children:s})}),e.jsx(f.KeyboardArrowDown,{})]})}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Text style"})]}),e.jsx(y.Menu.Content,{children:I.textStyles.map(r=>e.jsx(y.Menu.Item,{id:r.id,...l===r.id&&{"data-state":"checked"},children:e.jsx(v.Text,{...r.props,children:r.label})},r.id))})]})}),e.jsx(N.Divider,{orientation:"vertical"}),e.jsxs(_.ToggleButtonGroup.Root,{selectionMode:"multiple",selectedKeys:u,isDisabled:t,children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(w.IconToggleButton,{id:"bold",size:"xs",variant:"ghost","aria-label":"Bold",isDisabled:t,onMouseDown:r=>r.preventDefault(),onPress:i(()=>n.toggleMark(o,"bold")),children:[e.jsx(f.FormatBold,{}),e.jsx(M.VisuallyHidden,{children:"Bold"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Bold"})]}),e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(w.IconToggleButton,{id:"italic",size:"xs",variant:"ghost","aria-label":"Italic",isDisabled:t,onMouseDown:r=>r.preventDefault(),onPress:i(()=>n.toggleMark(o,"italic")),children:[e.jsx(f.FormatItalic,{}),e.jsx(M.VisuallyHidden,{children:"Italic"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Italic"})]}),e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(w.IconToggleButton,{id:"underline",size:"xs",variant:"ghost","aria-label":"Underline",isDisabled:t,onMouseDown:r=>r.preventDefault(),onPress:i(()=>n.toggleMark(o,"underline")),children:[e.jsx(f.FormatUnderlined,{}),e.jsx(M.VisuallyHidden,{children:"Underline"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Underline"})]})]}),e.jsx(he,{isDisabled:t}),e.jsx(N.Divider,{orientation:"vertical"}),e.jsxs(_.ToggleButtonGroup.Root,{selectionMode:"single",selectedKeys:j,onSelectionChange:c,"aria-label":"List formatting",isDisabled:t,children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsx(w.IconToggleButton,{id:"bulleted-list",size:"xs",variant:"ghost","aria-label":"Bulleted List",isDisabled:t,onMouseDown:r=>r.preventDefault(),children:e.jsx(f.FormatListBulleted,{})}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Bulleted list"})]}),e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsx(w.IconToggleButton,{id:"numbered-list",size:"xs",variant:"ghost","aria-label":"Numbered List",isDisabled:t,onMouseDown:r=>r.preventDefault(),children:e.jsx(f.FormatListNumbered,{})}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Numbered list"})]})]}),e.jsx(b.Box,{flexGrow:"1"}),e.jsxs(U.Group,{children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(O.IconButton,{size:"xs",variant:"ghost","aria-label":"Undo",isDisabled:!g||t,onPress:i(()=>o.undo()),onMouseDown:r=>r.preventDefault(),children:[e.jsx(f.Undo,{}),e.jsx(M.VisuallyHidden,{children:"Undo"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Undo"})]}),e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(O.IconButton,{size:"xs",variant:"ghost","aria-label":"Redo",isDisabled:!h||t,onPress:i(()=>o.redo()),onMouseDown:r=>r.preventDefault(),children:[e.jsx(f.Redo,{}),e.jsx(M.VisuallyHidden,{children:"Redo"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Redo"})]})]})]})};$.displayName="RichTextToolbar";const J=t=>{const{ref:o,value:i,defaultValue:l,onChange:s,onFocus:a,onBlur:c,placeholder:u="",isDisabled:j=!1,isReadOnly:g=!1,isInvalid:h=!1,autoFocus:r=!1,...E}=t,H=k.useSlotRecipe({recipe:G}),[L,P]=H.splitVariantProps({...E}),[F,q]=oe.extractStyleProps(P),V={"data-disabled":j?"true":void 0,"data-invalid":h?"true":void 0,"data-readonly":g?"true":void 0},[x,A]=p.useState(()=>{const T=i??l??"";try{return T?n.fromHTML(T):n.createEmptyValue()}catch(R){return console.warn("Failed to parse initial HTML, using empty value:",R),n.createEmptyValue()}}),[B,W]=p.useState(()=>i??l??""),Q=p.useRef(null);p.useEffect(()=>{if(i!==void 0&&i!==B){const T=i?n.fromHTML(i):n.createEmptyValue();A(T),W(i)}},[i,B]);const Y=p.useCallback(T=>{const R=n.toHTML(T),te=R!==B;A(T),W(R),te&&s&&s(R)},[B,s]),Z=x,ee=n.validSlateStateAdapter(Z);return e.jsx(ie,{...L,...F,...q,...V,ref:o,children:e.jsx(X,{ref:Q,value:ee,onChange:Y,onFocus:a,onBlur:c,placeholder:u,isDisabled:j,isReadOnly:g,autoFocus:r,toolbar:g?null:e.jsx($,{isDisabled:j})})})};J.displayName="RichTextInput";exports.RichTextInput=J;
2
- //# sourceMappingURL=rich-text-input-C7EK9LsN.cjs.js.map
1
+ "use strict";const e=require("react/jsx-runtime"),p=require("react"),k=require("@chakra-ui/react"),oe=require("./extractStyleProps-yFm0qaXg.cjs.js"),n=require("./slate-helpers-CMAwCMk0.cjs.js"),D=require("./use-formatting-state-Denpy3Zo.cjs.js"),I=require("../components/constants.cjs"),b=require("./box-BPfqlznQ.cjs.js"),N=require("./divider-CTTExmLv.cjs.js"),U=require("./group-Buy-O6Mr.cjs.js"),O=require("./icon-button-Dqhm4rBI.cjs.js"),w=require("./icon-toggle-button-DIfDVDd4.cjs.js"),v=require("./text-hUMahKuA.cjs.js"),d=require("./tooltip-BFuuQNa4.cjs.js"),M=require("./visually-hidden-Bh-G5QHv.cjs.js"),_=require("./toggle-button-group-Dq51N27j.cjs.js"),re=require("./toolbar-CzXpYEbP.cjs.js"),f=require("@commercetools/nimbus-icons"),y=require("./menu-C41LRy4b.cjs.js"),G=k.defineSlotRecipe({slots:["root","toolbar","editable"],className:"nimbus-rich-text-input",base:{root:{display:"flex",flexDirection:"column",position:"relative",width:"full",borderRadius:"200",borderWidth:"{sizes.25}",colorPalette:"slate",borderColor:"colorPalette.7",backgroundColor:"colorPalette.contrast","&[data-invalid='true']":{borderWidth:"{sizes.50}",borderColor:"critical.7"}},toolbar:{boxShadow:"1","[data-disabled='true'] &":{opacity:"0.5"}},editable:{padding:"400",minHeight:"inherit",outline:"none","[data-disabled='true'] &":{cursor:"not-allowed",opacity:"0.5"},"& p":{textStyle:"md",fontWeight:"500"},"& h1":{textStyle:"2xl",fontWeight:"500"},"& h2":{textStyle:"xl",fontWeight:"500"},"& h3":{textStyle:"lg",fontWeight:"500"},"& h4":{textStyle:"md",fontWeight:"500"},"& h5":{textStyle:"xs",fontWeight:"500"},"& blockquote":{textStyle:"md",fontWeight:"400",borderLeftWidth:"{sizes.100}",paddingLeft:"400"},"& ul":{paddingLeft:"600",listStyleType:"disc"},"& ol":{paddingLeft:"600",listStyleType:"decimal"},"& code":{padding:"100",fontFamily:"mono"},"& pre":{padding:"300",borderRadius:"200",overflow:"auto","& code":{padding:"0"}},"& a":{color:"primary.11",textDecoration:"underline",cursor:"pointer",_hover:{textDecoration:"none"}},"& strong":{fontWeight:"700"},"& em":{fontStyle:"italic"},"& u":{textDecoration:"underline"},"& del":{textDecoration:"line-through"},"& sup":{fontSize:"75%",verticalAlign:"super",lineHeight:"0"},"& sub":{fontSize:"75%",verticalAlign:"sub",lineHeight:"0"}}},variants:{}}),{withProvider:ne,withContext:K}=k.createSlotRecipeContext({recipe:G}),ie=ne("div","root"),se=K("div","toolbar"),le=K("div","editable");var ae={isHistory(t){return n.isPlainObject(t)&&Array.isArray(t.redos)&&Array.isArray(t.undos)&&(t.redos.length===0||n.Operation.isOperationList(t.redos[0].operations))&&(t.undos.length===0||n.Operation.isOperationList(t.undos[0].operations))}},z=new WeakMap,S=new WeakMap,C=new WeakMap,m={isHistoryEditor(t){return ae.isHistory(t.history)&&n.Editor.isEditor(t)},isMerging(t){return S.get(t)},isSplittingOnce(t){return C.get(t)},setSplittingOnce(t,o){C.set(t,o)},isSaving(t){return z.get(t)},redo(t){t.redo()},undo(t){t.undo()},withMerging(t,o){var i=m.isMerging(t);S.set(t,!0),o(),S.set(t,i)},withNewBatch(t,o){var i=m.isMerging(t);S.set(t,!0),C.set(t,!0),o(),S.set(t,i),C.delete(t)},withoutMerging(t,o){var i=m.isMerging(t);S.set(t,!1),o(),S.set(t,i)},withoutSaving(t,o){var i=m.isSaving(t);z.set(t,!1);try{o()}finally{z.set(t,i)}}},de=t=>{var o=t,{apply:i}=o;return o.history={undos:[],redos:[]},o.redo=()=>{var{history:l}=o,{redos:s}=l;if(s.length>0){var a=s[s.length-1];a.selectionBefore&&n.Transforms.setSelection(o,a.selectionBefore),m.withoutSaving(o,()=>{n.Editor.withoutNormalizing(o,()=>{for(var c of a.operations)o.apply(c)})}),l.redos.pop(),o.writeHistory("undos",a)}},o.undo=()=>{var{history:l}=o,{undos:s}=l;if(s.length>0){var a=s[s.length-1];m.withoutSaving(o,()=>{n.Editor.withoutNormalizing(o,()=>{var c=a.operations.map(n.Operation.inverse).reverse();for(var u of c)o.apply(u);a.selectionBefore&&n.Transforms.setSelection(o,a.selectionBefore)})}),o.writeHistory("redos",a),l.undos.pop()}},o.apply=l=>{var{operations:s,history:a}=o,{undos:c}=a,u=c[c.length-1],j=u&&u.operations[u.operations.length-1],g=m.isSaving(o),h=m.isMerging(o);if(g==null&&(g=ue(l)),g){if(h==null&&(u==null?h=!1:s.length!==0?h=!0:h=ce(l,j)),m.isSplittingOnce(o)&&(h=!1,m.setSplittingOnce(o,void 0)),u&&h)u.operations.push(l);else{var r={operations:[l],selectionBefore:o.selection};o.writeHistory("undos",r)}for(;c.length>100;)c.shift();a.redos=[]}i(l)},o.writeHistory=(l,s)=>{o.history[l].push(s)},o},ce=(t,o)=>!!(o&&t.type==="insert_text"&&o.type==="insert_text"&&t.offset===o.offset+o.text.length&&n.Path.equals(t.path,o.path)||o&&t.type==="remove_text"&&o.type==="remove_text"&&t.offset+t.text.length===o.offset&&n.Path.equals(t.path,o.path)),ue=(t,o)=>t.type!=="set_selection";const X=p.forwardRef((t,o)=>{const{value:i,onChange:l,onFocus:s,onBlur:a,placeholder:c=I.EDITOR_DEFAULTS.placeholder,isDisabled:u=I.EDITOR_DEFAULTS.isDisabled,isReadOnly:j=I.EDITOR_DEFAULTS.isReadOnly,autoFocus:g=I.EDITOR_DEFAULTS.autoFocus,toolbar:h}=t,r=p.useMemo(()=>{const x=n.createEditor();return n.withLinks(de(n.withReact(x)))},[]),{handleKeyDown:E}=D.useKeyboardShortcuts({editor:r}),H=p.useCallback(x=>{s&&s(x)},[s]),L=p.useCallback(x=>{a&&a(x)},[a]);p.useImperativeHandle(o,()=>({focus:()=>n.focusEditor(r),resetValue:x=>n.resetEditor(r,x)}),[r]);const P=p.useCallback(x=>e.jsx(n.Element$1,{...x}),[]),F=p.useCallback(x=>e.jsx(n.Leaf,{...x}),[]),q=n.createEmptyValue(),V=Array.isArray(i)&&i.length>0?i:q;return e.jsxs(n.Slate,{editor:r,value:V,onChange:l,children:[h&&e.jsx(se,{children:h}),e.jsx(le,{asChild:!0,children:e.jsx(n.Editable,{renderElement:P,renderLeaf:F,placeholder:c,autoFocus:g,readOnly:j||u,onKeyDown:E,onFocus:H,onBlur:L,"aria-label":"Rich text editor",role:"textbox","aria-multiline":"true"})})]})});X.displayName="RichTextEditor";const he=({isDisabled:t=!1})=>{const o=n.useSlate(),i=D.usePreservedSelection(o),{allSelectedKeys:l,handleAllSelectionChange:s}=D.useFormattingState({withPreservedSelection:i});return e.jsxs(y.Menu.Root,{selectionMode:"multiple",selectedKeys:l,onSelectionChange:s,children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsx(y.Menu.Trigger,{asChild:!0,children:e.jsx(O.IconButton,{size:"xs",variant:"ghost","aria-label":"More formatting options",isDisabled:t,onMouseDown:a=>a.preventDefault(),children:e.jsx(f.MoreHoriz,{})})}),e.jsx(d.Tooltip.Content,{placement:"top",children:"More styles"})]}),e.jsxs(y.Menu.Content,{children:[e.jsx(y.Menu.Item,{id:"strikethrough",children:e.jsxs(b.Box,{slot:"label",display:"flex",alignItems:"center",gap:"200",children:[e.jsx(f.FormatStrikethrough,{}),e.jsx(v.Text,{textStyle:"sm",children:"Strikethrough"})]})}),e.jsx(y.Menu.Item,{id:"code",children:e.jsxs(b.Box,{slot:"label",display:"flex",alignItems:"center",gap:"200",children:[e.jsx(f.Code,{}),e.jsx(v.Text,{textStyle:"sm",children:"Code"})]})}),e.jsx(y.Menu.Item,{id:"superscript",children:e.jsxs(b.Box,{slot:"label",display:"flex",alignItems:"center",gap:"200",children:[e.jsx(v.Text,{children:"X²"}),e.jsx(v.Text,{textStyle:"sm",children:"Superscript"})]})}),e.jsx(y.Menu.Item,{id:"subscript",children:e.jsxs(b.Box,{slot:"label",display:"flex",alignItems:"center",gap:"200",children:[e.jsx(v.Text,{children:"X₂"}),e.jsx(v.Text,{textStyle:"sm",children:"Subscript"})]})})]})]})},$=({isDisabled:t=!1})=>{const o=n.useSlate(),i=D.usePreservedSelection(o),{currentTextStyle:l,selectedTextStyleLabel:s,handleTextStyleChange:a,handleListToggle:c,selectedFormatKeys:u,selectedListKeys:j,hasUndos:g,hasRedos:h}=D.useToolbarState({withPreservedSelection:i});return e.jsxs(re.Toolbar,{orientation:"horizontal","aria-label":"Text formatting",width:"full",overflow:"hidden",size:"xs",children:[e.jsx(U.Group,{children:e.jsxs(y.Menu.Root,{onAction:r=>a(String(r)),children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsx(y.Menu.Trigger,{height:"800",width:"4000",bg:"primary.1",borderRadius:"200",_hover:{bg:"primary.2"},isDisabled:t,onMouseDown:r=>r.preventDefault(),"aria-label":"Text style menu",children:e.jsxs(b.Box,{display:"flex",alignItems:"center",gap:"200",px:"200",children:[e.jsx(b.Box,{display:"flex",alignItems:"center",gap:"200",flexGrow:"1",children:e.jsx(v.Text,{my:"auto",textStyle:"sm",fontWeight:"500",children:s})}),e.jsx(f.KeyboardArrowDown,{})]})}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Text style"})]}),e.jsx(y.Menu.Content,{children:I.textStyles.map(r=>e.jsx(y.Menu.Item,{id:r.id,...l===r.id&&{"data-state":"checked"},children:e.jsx(v.Text,{...r.props,children:r.label})},r.id))})]})}),e.jsx(N.Divider,{orientation:"vertical"}),e.jsxs(_.ToggleButtonGroup.Root,{selectionMode:"multiple",selectedKeys:u,isDisabled:t,children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(w.IconToggleButton,{id:"bold",size:"xs",variant:"ghost","aria-label":"Bold",isDisabled:t,onMouseDown:r=>r.preventDefault(),onPress:i(()=>n.toggleMark(o,"bold")),children:[e.jsx(f.FormatBold,{}),e.jsx(M.VisuallyHidden,{children:"Bold"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Bold"})]}),e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(w.IconToggleButton,{id:"italic",size:"xs",variant:"ghost","aria-label":"Italic",isDisabled:t,onMouseDown:r=>r.preventDefault(),onPress:i(()=>n.toggleMark(o,"italic")),children:[e.jsx(f.FormatItalic,{}),e.jsx(M.VisuallyHidden,{children:"Italic"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Italic"})]}),e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(w.IconToggleButton,{id:"underline",size:"xs",variant:"ghost","aria-label":"Underline",isDisabled:t,onMouseDown:r=>r.preventDefault(),onPress:i(()=>n.toggleMark(o,"underline")),children:[e.jsx(f.FormatUnderlined,{}),e.jsx(M.VisuallyHidden,{children:"Underline"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Underline"})]})]}),e.jsx(he,{isDisabled:t}),e.jsx(N.Divider,{orientation:"vertical"}),e.jsxs(_.ToggleButtonGroup.Root,{selectionMode:"single",selectedKeys:j,onSelectionChange:c,"aria-label":"List formatting",isDisabled:t,children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsx(w.IconToggleButton,{id:"bulleted-list",size:"xs",variant:"ghost","aria-label":"Bulleted List",isDisabled:t,onMouseDown:r=>r.preventDefault(),children:e.jsx(f.FormatListBulleted,{})}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Bulleted list"})]}),e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsx(w.IconToggleButton,{id:"numbered-list",size:"xs",variant:"ghost","aria-label":"Numbered List",isDisabled:t,onMouseDown:r=>r.preventDefault(),children:e.jsx(f.FormatListNumbered,{})}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Numbered list"})]})]}),e.jsx(b.Box,{flexGrow:"1"}),e.jsxs(U.Group,{children:[e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(O.IconButton,{size:"xs",variant:"ghost","aria-label":"Undo",isDisabled:!g||t,onPress:i(()=>o.undo()),onMouseDown:r=>r.preventDefault(),children:[e.jsx(f.Undo,{}),e.jsx(M.VisuallyHidden,{children:"Undo"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Undo"})]}),e.jsxs(d.Tooltip.Root,{delay:0,closeDelay:0,children:[e.jsxs(O.IconButton,{size:"xs",variant:"ghost","aria-label":"Redo",isDisabled:!h||t,onPress:i(()=>o.redo()),onMouseDown:r=>r.preventDefault(),children:[e.jsx(f.Redo,{}),e.jsx(M.VisuallyHidden,{children:"Redo"})]}),e.jsx(d.Tooltip.Content,{placement:"top",children:"Redo"})]})]})]})};$.displayName="RichTextToolbar";const J=t=>{const{ref:o,value:i,defaultValue:l,onChange:s,onFocus:a,onBlur:c,placeholder:u="",isDisabled:j=!1,isReadOnly:g=!1,isInvalid:h=!1,autoFocus:r=!1,...E}=t,H=k.useSlotRecipe({recipe:G}),[L,P]=H.splitVariantProps({...E}),[F,q]=oe.extractStyleProps(P),V={"data-disabled":j?"true":void 0,"data-invalid":h?"true":void 0,"data-readonly":g?"true":void 0},[x,A]=p.useState(()=>{const T=i??l??"";try{return T?n.fromHTML(T):n.createEmptyValue()}catch(R){return console.warn("Failed to parse initial HTML, using empty value:",R),n.createEmptyValue()}}),[B,W]=p.useState(()=>i??l??""),Q=p.useRef(null);p.useEffect(()=>{if(i!==void 0&&i!==B){const T=i?n.fromHTML(i):n.createEmptyValue();A(T),W(i)}},[i,B]);const Y=p.useCallback(T=>{const R=n.toHTML(T),te=R!==B;A(T),W(R),te&&s&&s(R)},[B,s]),Z=x,ee=n.validSlateStateAdapter(Z);return e.jsx(ie,{...L,...F,...q,...V,ref:o,children:e.jsx(X,{ref:Q,value:ee,onChange:Y,onFocus:a,onBlur:c,placeholder:u,isDisabled:j,isReadOnly:g,autoFocus:r,toolbar:g?null:e.jsx($,{isDisabled:j})})})};J.displayName="RichTextInput";exports.RichTextInput=J;
2
+ //# sourceMappingURL=rich-text-input-Dmp5hx2t.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rich-text-input-C7EK9LsN.cjs.js","sources":["../../src/components/rich-text-input/rich-text-input.recipe.tsx","../../src/components/rich-text-input/rich-text-input.slots.tsx","../../../../node_modules/.pnpm/slate-history@0.113.1_slate@0.75.0/node_modules/slate-history/dist/index.es.js","../../src/components/rich-text-input/components/rich-text-editor.tsx","../../src/components/rich-text-input/components/formatting-menu.tsx","../../src/components/rich-text-input/components/rich-text-toolbar.tsx","../../src/components/rich-text-input/rich-text-input.tsx"],"sourcesContent":["import { defineSlotRecipe } from \"@chakra-ui/react\";\n\nexport const richTextInputRecipe = defineSlotRecipe({\n slots: [\"root\", \"toolbar\", \"editable\"],\n className: \"nimbus-rich-text-input\",\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n position: \"relative\",\n width: \"full\",\n borderRadius: \"200\",\n borderWidth: \"{sizes.25}\",\n colorPalette: \"slate\",\n borderColor: \"colorPalette.7\",\n backgroundColor: \"colorPalette.contrast\",\n\n // Invalid state styling\n \"&[data-invalid='true']\": {\n borderWidth: \"{sizes.50}\",\n borderColor: \"critical.7\",\n },\n },\n toolbar: {\n boxShadow: \"1\",\n\n // Disabled state styling for toolbar\n \"[data-disabled='true'] &\": {\n opacity: \"0.5\",\n },\n },\n editable: {\n padding: \"400\",\n minHeight: \"inherit\",\n outline: \"none\",\n\n // Disabled state styling for editable\n \"[data-disabled='true'] &\": {\n cursor: \"not-allowed\",\n opacity: \"0.5\",\n },\n\n // Styling for user-facing editor text\n \"& p\": {\n textStyle: \"md\",\n fontWeight: \"500\",\n },\n \"& h1\": {\n textStyle: \"2xl\",\n fontWeight: \"500\",\n },\n \"& h2\": {\n textStyle: \"xl\",\n fontWeight: \"500\",\n },\n \"& h3\": {\n textStyle: \"lg\",\n fontWeight: \"500\",\n },\n \"& h4\": {\n textStyle: \"md\",\n fontWeight: \"500\",\n },\n \"& h5\": {\n textStyle: \"xs\",\n fontWeight: \"500\",\n },\n \"& blockquote\": {\n textStyle: \"md\",\n fontWeight: \"400\",\n borderLeftWidth: \"{sizes.100}\",\n paddingLeft: \"400\",\n },\n \"& ul\": {\n paddingLeft: \"600\",\n listStyleType: \"disc\",\n },\n \"& ol\": {\n paddingLeft: \"600\",\n listStyleType: \"decimal\",\n },\n \"& code\": {\n padding: \"100\",\n fontFamily: \"mono\",\n },\n \"& pre\": {\n padding: \"300\",\n borderRadius: \"200\",\n overflow: \"auto\",\n \"& code\": {\n padding: \"0\",\n },\n },\n \"& a\": {\n color: \"primary.11\",\n textDecoration: \"underline\",\n cursor: \"pointer\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n \"& strong\": {\n fontWeight: \"700\",\n },\n \"& em\": {\n fontStyle: \"italic\",\n },\n \"& u\": {\n textDecoration: \"underline\",\n },\n \"& del\": {\n textDecoration: \"line-through\",\n },\n \"& sup\": {\n fontSize: \"75%\",\n verticalAlign: \"super\",\n lineHeight: \"0\",\n },\n \"& sub\": {\n fontSize: \"75%\",\n verticalAlign: \"sub\",\n lineHeight: \"0\",\n },\n },\n },\n variants: {},\n});\n","import {\n type HTMLChakraProps,\n type RecipeVariantProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\nimport { richTextInputRecipe } from \"./rich-text-input.recipe\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: richTextInputRecipe,\n});\n\n// Root slot\nexport type RichTextInputRootSlotProps = HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof richTextInputRecipe> & UnstyledProp\n>;\n\nexport const RichTextInputRootSlot = withProvider<\n HTMLDivElement,\n RichTextInputRootSlotProps\n>(\"div\", \"root\");\n\n// Toolbar slot\nexport type RichTextInputToolbarSlotProps = HTMLChakraProps<\"div\">;\n\nexport const RichTextInputToolbarSlot = withContext<\n HTMLDivElement,\n RichTextInputToolbarSlotProps\n>(\"div\", \"toolbar\");\n\n// Editable slot\nexport type RichTextInputEditableSlotProps = HTMLChakraProps<\"div\">;\nexport const RichTextInputEditableSlot = withContext<\n HTMLDivElement,\n RichTextInputEditableSlotProps\n>(\"div\", \"editable\");\n","import { isPlainObject } from 'is-plain-object';\nimport { Operation, Editor, Transforms, Path } from 'slate';\n\n// eslint-disable-next-line no-redeclare\nvar History = {\n /**\n * Check if a value is a `History` object.\n */\n isHistory(value) {\n return isPlainObject(value) && Array.isArray(value.redos) && Array.isArray(value.undos) && (value.redos.length === 0 || Operation.isOperationList(value.redos[0].operations)) && (value.undos.length === 0 || Operation.isOperationList(value.undos[0].operations));\n }\n};\n\n/**\n * Weakmaps for attaching state to the editor.\n */\nvar HISTORY = new WeakMap();\nvar SAVING = new WeakMap();\nvar MERGING = new WeakMap();\nvar SPLITTING_ONCE = new WeakMap();\n// eslint-disable-next-line no-redeclare\nvar HistoryEditor = {\n /**\n * Check if a value is a `HistoryEditor` object.\n */\n isHistoryEditor(value) {\n return History.isHistory(value.history) && Editor.isEditor(value);\n },\n /**\n * Get the merge flag's current value.\n */\n isMerging(editor) {\n return MERGING.get(editor);\n },\n /**\n * Get the splitting once flag's current value.\n */\n isSplittingOnce(editor) {\n return SPLITTING_ONCE.get(editor);\n },\n setSplittingOnce(editor, value) {\n SPLITTING_ONCE.set(editor, value);\n },\n /**\n * Get the saving flag's current value.\n */\n isSaving(editor) {\n return SAVING.get(editor);\n },\n /**\n * Redo to the previous saved state.\n */\n redo(editor) {\n editor.redo();\n },\n /**\n * Undo to the previous saved state.\n */\n undo(editor) {\n editor.undo();\n },\n /**\n * Apply a series of changes inside a synchronous `fn`, These operations will\n * be merged into the previous history.\n */\n withMerging(editor, fn) {\n var prev = HistoryEditor.isMerging(editor);\n MERGING.set(editor, true);\n fn();\n MERGING.set(editor, prev);\n },\n /**\n * Apply a series of changes inside a synchronous `fn`, ensuring that the first\n * operation starts a new batch in the history. Subsequent operations will be\n * merged as usual.\n */\n withNewBatch(editor, fn) {\n var prev = HistoryEditor.isMerging(editor);\n MERGING.set(editor, true);\n SPLITTING_ONCE.set(editor, true);\n fn();\n MERGING.set(editor, prev);\n SPLITTING_ONCE.delete(editor);\n },\n /**\n * Apply a series of changes inside a synchronous `fn`, without merging any of\n * the new operations into previous save point in the history.\n */\n withoutMerging(editor, fn) {\n var prev = HistoryEditor.isMerging(editor);\n MERGING.set(editor, false);\n fn();\n MERGING.set(editor, prev);\n },\n /**\n * Apply a series of changes inside a synchronous `fn`, without saving any of\n * their operations into the history.\n */\n withoutSaving(editor, fn) {\n var prev = HistoryEditor.isSaving(editor);\n SAVING.set(editor, false);\n try {\n fn();\n } finally {\n SAVING.set(editor, prev);\n }\n }\n};\n\n/**\n * The `withHistory` plugin keeps track of the operation history of a Slate\n * editor as operations are applied to it, using undo and redo stacks.\n *\n * If you are using TypeScript, you must extend Slate's CustomTypes to use\n * this plugin.\n *\n * See https://docs.slatejs.org/concepts/11-typescript to learn how.\n */\nvar withHistory = editor => {\n var e = editor;\n var {\n apply\n } = e;\n e.history = {\n undos: [],\n redos: []\n };\n e.redo = () => {\n var {\n history\n } = e;\n var {\n redos\n } = history;\n if (redos.length > 0) {\n var batch = redos[redos.length - 1];\n if (batch.selectionBefore) {\n Transforms.setSelection(e, batch.selectionBefore);\n }\n HistoryEditor.withoutSaving(e, () => {\n Editor.withoutNormalizing(e, () => {\n for (var op of batch.operations) {\n e.apply(op);\n }\n });\n });\n history.redos.pop();\n e.writeHistory('undos', batch);\n }\n };\n e.undo = () => {\n var {\n history\n } = e;\n var {\n undos\n } = history;\n if (undos.length > 0) {\n var batch = undos[undos.length - 1];\n HistoryEditor.withoutSaving(e, () => {\n Editor.withoutNormalizing(e, () => {\n var inverseOps = batch.operations.map(Operation.inverse).reverse();\n for (var op of inverseOps) {\n e.apply(op);\n }\n if (batch.selectionBefore) {\n Transforms.setSelection(e, batch.selectionBefore);\n }\n });\n });\n e.writeHistory('redos', batch);\n history.undos.pop();\n }\n };\n e.apply = op => {\n var {\n operations,\n history\n } = e;\n var {\n undos\n } = history;\n var lastBatch = undos[undos.length - 1];\n var lastOp = lastBatch && lastBatch.operations[lastBatch.operations.length - 1];\n var save = HistoryEditor.isSaving(e);\n var merge = HistoryEditor.isMerging(e);\n if (save == null) {\n save = shouldSave(op);\n }\n if (save) {\n if (merge == null) {\n if (lastBatch == null) {\n merge = false;\n } else if (operations.length !== 0) {\n merge = true;\n } else {\n merge = shouldMerge(op, lastOp);\n }\n }\n if (HistoryEditor.isSplittingOnce(e)) {\n merge = false;\n HistoryEditor.setSplittingOnce(e, undefined);\n }\n if (lastBatch && merge) {\n lastBatch.operations.push(op);\n } else {\n var batch = {\n operations: [op],\n selectionBefore: e.selection\n };\n e.writeHistory('undos', batch);\n }\n while (undos.length > 100) {\n undos.shift();\n }\n history.redos = [];\n }\n apply(op);\n };\n e.writeHistory = (stack, batch) => {\n e.history[stack].push(batch);\n };\n return e;\n};\n/**\n * Check whether to merge an operation into the previous operation.\n */\nvar shouldMerge = (op, prev) => {\n if (prev && op.type === 'insert_text' && prev.type === 'insert_text' && op.offset === prev.offset + prev.text.length && Path.equals(op.path, prev.path)) {\n return true;\n }\n if (prev && op.type === 'remove_text' && prev.type === 'remove_text' && op.offset + op.text.length === prev.offset && Path.equals(op.path, prev.path)) {\n return true;\n }\n return false;\n};\n/**\n * Check whether an operation needs to be saved to the history.\n */\nvar shouldSave = (op, prev) => {\n if (op.type === 'set_selection') {\n return false;\n }\n return true;\n};\n\nexport { HISTORY, History, HistoryEditor, MERGING, SAVING, SPLITTING_ONCE, withHistory };\n//# sourceMappingURL=index.es.js.map\n","import {\n useMemo,\n useCallback,\n useImperativeHandle,\n forwardRef,\n type ForwardedRef,\n type FocusEventHandler,\n type ReactNode,\n} from \"react\";\nimport { createEditor, type Descendant } from \"slate\";\nimport { Slate, Editable, withReact } from \"slate-react\";\nimport { withHistory } from \"slate-history\";\nimport {\n RichTextInputEditableSlot,\n RichTextInputToolbarSlot,\n} from \"../rich-text-input.slots\";\nimport {\n Element,\n Leaf,\n withLinks,\n focusEditor,\n resetEditor,\n} from \"../utils/slate-helpers\";\nimport { createEmptyValue } from \"../utils/html-serialization\";\nimport { useKeyboardShortcuts } from \"../hooks/use-keyboard-shortcuts\";\nimport { EDITOR_DEFAULTS } from \"../constants\";\n\nexport interface RichTextEditorProps {\n value?: Descendant[];\n onChange: (value: Descendant[]) => void;\n onFocus?: FocusEventHandler<HTMLDivElement>;\n onBlur?: FocusEventHandler<HTMLDivElement>;\n placeholder?: string;\n isDisabled?: boolean;\n isReadOnly?: boolean;\n autoFocus?: boolean;\n toolbar?: ReactNode;\n}\n\nexport interface RichTextEditorRef {\n focus: () => void;\n resetValue: (html: string) => void;\n}\n\nexport const RichTextEditor = forwardRef<\n RichTextEditorRef,\n RichTextEditorProps\n>((props, forwardedRef: ForwardedRef<RichTextEditorRef>) => {\n const {\n value,\n onChange,\n onFocus,\n onBlur,\n placeholder = EDITOR_DEFAULTS.placeholder,\n isDisabled = EDITOR_DEFAULTS.isDisabled,\n isReadOnly = EDITOR_DEFAULTS.isReadOnly,\n autoFocus = EDITOR_DEFAULTS.autoFocus,\n toolbar,\n } = props;\n\n // Create editor with plugins\n const editor = useMemo(() => {\n const baseEditor = createEditor();\n return withLinks(withHistory(withReact(baseEditor)));\n }, []);\n\n // Handle keyboard shortcuts using hook\n const { handleKeyDown } = useKeyboardShortcuts({ editor });\n\n // Handle focus\n const handleFocus = useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n if (onFocus) {\n onFocus(event);\n }\n },\n [onFocus]\n );\n\n // Handle blur\n const handleBlur = useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n if (onBlur) {\n onBlur(event);\n }\n },\n [onBlur]\n );\n\n // Expose methods through ref\n useImperativeHandle(\n forwardedRef,\n () => ({\n focus: () => focusEditor(editor),\n resetValue: (html: string) => resetEditor(editor, html),\n }),\n [editor]\n );\n\n // Render element\n const renderElement = useCallback(\n (props: Parameters<typeof Element>[0]) => <Element {...props} />,\n []\n );\n\n // Render leaf\n const renderLeaf = useCallback(\n (props: Parameters<typeof Leaf>[0]) => <Leaf {...props} />,\n []\n );\n\n // Ensure we always have a valid value\n const defaultValue = createEmptyValue();\n const safeInitialValue =\n Array.isArray(value) && value.length > 0 ? value : defaultValue;\n\n return (\n <Slate editor={editor} value={safeInitialValue} onChange={onChange}>\n {toolbar && (\n <RichTextInputToolbarSlot>{toolbar}</RichTextInputToolbarSlot>\n )}\n <RichTextInputEditableSlot asChild>\n <Editable\n renderElement={renderElement}\n renderLeaf={renderLeaf}\n placeholder={placeholder}\n autoFocus={autoFocus}\n readOnly={isReadOnly || isDisabled}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n aria-label=\"Rich text editor\"\n role=\"textbox\"\n aria-multiline=\"true\"\n />\n </RichTextInputEditableSlot>\n </Slate>\n );\n});\n\nRichTextEditor.displayName = \"RichTextEditor\";\n","import { useSlate } from \"slate-react\";\nimport { Menu, IconButton, Text, Box, Tooltip } from \"@/components\";\nimport {\n MoreHoriz,\n FormatStrikethrough,\n Code,\n} from \"@commercetools/nimbus-icons\";\nimport { usePreservedSelection } from \"../hooks/use-preserved-selection\";\nimport { useFormattingState } from \"../hooks/use-formatting-state\";\n\nexport interface FormattingMenuProps {\n isDisabled?: boolean;\n}\n\nexport const FormattingMenu = ({ isDisabled = false }: FormattingMenuProps) => {\n const editor = useSlate();\n const withPreservedSelection = usePreservedSelection(editor);\n\n // Use the formatting state hook for all state management\n const { allSelectedKeys, handleAllSelectionChange } = useFormattingState({\n withPreservedSelection,\n });\n\n return (\n <Menu.Root\n selectionMode=\"multiple\"\n selectedKeys={allSelectedKeys}\n onSelectionChange={handleAllSelectionChange}\n >\n <Tooltip.Root delay={0} closeDelay={0}>\n <Menu.Trigger asChild>\n <IconButton\n size=\"xs\"\n variant=\"ghost\"\n aria-label=\"More formatting options\"\n isDisabled={isDisabled}\n onMouseDown={(event) => event.preventDefault()}\n >\n <MoreHoriz />\n </IconButton>\n </Menu.Trigger>\n <Tooltip.Content placement=\"top\">More styles</Tooltip.Content>\n </Tooltip.Root>\n <Menu.Content>\n <Menu.Item id=\"strikethrough\">\n <Box slot=\"label\" display=\"flex\" alignItems=\"center\" gap=\"200\">\n <FormatStrikethrough />\n <Text textStyle=\"sm\">Strikethrough</Text>\n </Box>\n </Menu.Item>\n <Menu.Item id=\"code\">\n <Box slot=\"label\" display=\"flex\" alignItems=\"center\" gap=\"200\">\n <Code />\n <Text textStyle=\"sm\">Code</Text>\n </Box>\n </Menu.Item>\n <Menu.Item id=\"superscript\">\n <Box slot=\"label\" display=\"flex\" alignItems=\"center\" gap=\"200\">\n <Text>X²</Text>\n <Text textStyle=\"sm\">Superscript</Text>\n </Box>\n </Menu.Item>\n <Menu.Item id=\"subscript\">\n <Box slot=\"label\" display=\"flex\" alignItems=\"center\" gap=\"200\">\n <Text>X₂</Text>\n <Text textStyle=\"sm\">Subscript</Text>\n </Box>\n </Menu.Item>\n </Menu.Content>\n </Menu.Root>\n );\n};\n","import { useSlate } from \"slate-react\";\nimport {\n Toolbar,\n Menu,\n VisuallyHidden,\n Divider,\n ToggleButtonGroup,\n IconToggleButton,\n IconButton,\n Text,\n Box,\n Tooltip,\n} from \"@/components\";\nimport { Group } from \"@/components/group\";\nimport {\n FormatBold,\n FormatItalic,\n FormatUnderlined,\n FormatListBulleted,\n FormatListNumbered,\n KeyboardArrowDown,\n Undo,\n Redo,\n} from \"@commercetools/nimbus-icons\";\nimport { toggleMark } from \"../utils/slate-helpers\";\nimport { usePreservedSelection } from \"../hooks/use-preserved-selection\";\nimport { useToolbarState } from \"../hooks/use-toolbar-state\";\nimport { textStyles } from \"../constants\";\nimport { FormattingMenu } from \"./formatting-menu\";\n\nexport interface RichTextToolbarProps {\n isDisabled?: boolean;\n}\n\nexport const RichTextToolbar = ({\n isDisabled = false,\n}: RichTextToolbarProps) => {\n const editor = useSlate();\n const withPreservedSelection = usePreservedSelection(editor);\n\n // Use the toolbar state hook for all state management\n const {\n currentTextStyle,\n selectedTextStyleLabel,\n handleTextStyleChange,\n handleListToggle,\n selectedFormatKeys,\n selectedListKeys,\n hasUndos,\n hasRedos,\n } = useToolbarState({ withPreservedSelection });\n\n return (\n <Toolbar\n orientation=\"horizontal\"\n aria-label=\"Text formatting\"\n width=\"full\"\n overflow=\"hidden\"\n size=\"xs\"\n >\n {/* Text Style Menu */}\n <Group>\n <Menu.Root\n onAction={(styleId) => handleTextStyleChange(String(styleId))}\n >\n <Tooltip.Root delay={0} closeDelay={0}>\n {/* Menu trigger styles mimic the Select component */}\n <Menu.Trigger\n height=\"800\"\n width=\"4000\"\n bg=\"primary.1\"\n borderRadius=\"200\"\n _hover={{ bg: \"primary.2\" }}\n isDisabled={isDisabled}\n onMouseDown={(event) => event.preventDefault()}\n aria-label=\"Text style menu\"\n >\n <Box display=\"flex\" alignItems=\"center\" gap=\"200\" px=\"200\">\n <Box display=\"flex\" alignItems=\"center\" gap=\"200\" flexGrow=\"1\">\n <Text my=\"auto\" textStyle=\"sm\" fontWeight=\"500\">\n {selectedTextStyleLabel}\n </Text>\n </Box>\n <KeyboardArrowDown />\n </Box>\n </Menu.Trigger>\n <Tooltip.Content placement=\"top\">Text style</Tooltip.Content>\n </Tooltip.Root>\n <Menu.Content>\n {textStyles.map((style) => (\n <Menu.Item\n key={style.id}\n id={style.id}\n {...(currentTextStyle === style.id && {\n \"data-state\": \"checked\",\n })}\n >\n <Text {...style.props}>{style.label}</Text>\n </Menu.Item>\n ))}\n </Menu.Content>\n </Menu.Root>\n </Group>\n\n <Divider orientation=\"vertical\" />\n\n {/* Text Formatting Toggles */}\n <ToggleButtonGroup.Root\n selectionMode=\"multiple\"\n selectedKeys={selectedFormatKeys}\n isDisabled={isDisabled}\n >\n <Tooltip.Root delay={0} closeDelay={0}>\n <IconToggleButton\n id=\"bold\"\n size=\"xs\"\n variant=\"ghost\"\n aria-label=\"Bold\"\n isDisabled={isDisabled}\n onMouseDown={(event) => event.preventDefault()}\n onPress={withPreservedSelection(() => toggleMark(editor, \"bold\"))}\n >\n <FormatBold />\n <VisuallyHidden>Bold</VisuallyHidden>\n </IconToggleButton>\n <Tooltip.Content placement=\"top\">Bold</Tooltip.Content>\n </Tooltip.Root>\n <Tooltip.Root delay={0} closeDelay={0}>\n <IconToggleButton\n id=\"italic\"\n size=\"xs\"\n variant=\"ghost\"\n aria-label=\"Italic\"\n isDisabled={isDisabled}\n onMouseDown={(event) => event.preventDefault()}\n onPress={withPreservedSelection(() => toggleMark(editor, \"italic\"))}\n >\n <FormatItalic />\n <VisuallyHidden>Italic</VisuallyHidden>\n </IconToggleButton>\n <Tooltip.Content placement=\"top\">Italic</Tooltip.Content>\n </Tooltip.Root>\n <Tooltip.Root delay={0} closeDelay={0}>\n <IconToggleButton\n id=\"underline\"\n size=\"xs\"\n variant=\"ghost\"\n aria-label=\"Underline\"\n isDisabled={isDisabled}\n onMouseDown={(event) => event.preventDefault()}\n onPress={withPreservedSelection(() =>\n toggleMark(editor, \"underline\")\n )}\n >\n <FormatUnderlined />\n <VisuallyHidden>Underline</VisuallyHidden>\n </IconToggleButton>\n <Tooltip.Content placement=\"top\">Underline</Tooltip.Content>\n </Tooltip.Root>\n </ToggleButtonGroup.Root>\n\n {/* Formatting Menu for additional options */}\n <FormattingMenu isDisabled={isDisabled} />\n\n <Divider orientation=\"vertical\" />\n\n {/* Lists & Indentation */}\n <ToggleButtonGroup.Root\n selectionMode=\"single\"\n selectedKeys={selectedListKeys}\n onSelectionChange={handleListToggle}\n aria-label=\"List formatting\"\n isDisabled={isDisabled}\n >\n <Tooltip.Root delay={0} closeDelay={0}>\n <IconToggleButton\n id=\"bulleted-list\"\n size=\"xs\"\n variant=\"ghost\"\n aria-label=\"Bulleted List\"\n isDisabled={isDisabled}\n onMouseDown={(event) => event.preventDefault()}\n >\n <FormatListBulleted />\n </IconToggleButton>\n <Tooltip.Content placement=\"top\">Bulleted list</Tooltip.Content>\n </Tooltip.Root>\n <Tooltip.Root delay={0} closeDelay={0}>\n <IconToggleButton\n id=\"numbered-list\"\n size=\"xs\"\n variant=\"ghost\"\n aria-label=\"Numbered List\"\n isDisabled={isDisabled}\n onMouseDown={(event) => event.preventDefault()}\n >\n <FormatListNumbered />\n </IconToggleButton>\n <Tooltip.Content placement=\"top\">Numbered list</Tooltip.Content>\n </Tooltip.Root>\n </ToggleButtonGroup.Root>\n\n {/* Spacer to push undo/redo buttons to the right */}\n <Box flexGrow=\"1\" />\n\n <Group>\n <Tooltip.Root delay={0} closeDelay={0}>\n <IconButton\n size=\"xs\"\n variant=\"ghost\"\n aria-label=\"Undo\"\n isDisabled={!hasUndos || isDisabled}\n onPress={withPreservedSelection(() => editor.undo())}\n onMouseDown={(event) => event.preventDefault()}\n >\n <Undo />\n <VisuallyHidden>Undo</VisuallyHidden>\n </IconButton>\n <Tooltip.Content placement=\"top\">Undo</Tooltip.Content>\n </Tooltip.Root>\n <Tooltip.Root delay={0} closeDelay={0}>\n <IconButton\n size=\"xs\"\n variant=\"ghost\"\n aria-label=\"Redo\"\n isDisabled={!hasRedos || isDisabled}\n onPress={withPreservedSelection(() => editor.redo())}\n onMouseDown={(event) => event.preventDefault()}\n >\n <Redo />\n <VisuallyHidden>Redo</VisuallyHidden>\n </IconButton>\n <Tooltip.Content placement=\"top\">Redo</Tooltip.Content>\n </Tooltip.Root>\n </Group>\n </Toolbar>\n );\n};\n\nRichTextToolbar.displayName = \"RichTextToolbar\";\n","import { useState, useCallback, useRef, useEffect } from \"react\";\nimport { useSlotRecipe } from \"@chakra-ui/react\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { RichTextInputRootSlot } from \"./rich-text-input.slots\";\nimport {\n RichTextEditor,\n type RichTextEditorRef,\n} from \"./components/rich-text-editor\";\nimport { RichTextToolbar } from \"./components/rich-text-toolbar\";\nimport type { RichTextInputProps } from \"./rich-text-input.types\";\nimport {\n toHTML,\n fromHTML,\n createEmptyValue,\n validSlateStateAdapter,\n} from \"./utils\";\nimport { richTextInputRecipe } from \"./rich-text-input.recipe\";\n\n/**\n RichTextInput - A rich text input component with formatting capabilities.\n */\nexport const RichTextInput = (props: RichTextInputProps) => {\n const {\n ref: forwardedRef,\n value,\n defaultValue,\n onChange,\n onFocus,\n onBlur,\n placeholder = \"\",\n isDisabled = false,\n isReadOnly = false,\n isInvalid = false,\n autoFocus = false,\n ...restProps\n } = props;\n\n const recipe = useSlotRecipe({ recipe: richTextInputRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps({\n // Only semantic variants go here (none currently defined)\n ...restProps,\n });\n const [styleProps, functionalProps] = extractStyleProps(remainingProps);\n\n // Data attributes for state-based styling\n const dataAttributes = {\n \"data-disabled\": isDisabled ? \"true\" : undefined,\n \"data-invalid\": isInvalid ? \"true\" : undefined,\n \"data-readonly\": isReadOnly ? \"true\" : undefined,\n };\n\n // Internal state management\n const [internalValue, setInternalValue] = useState(() => {\n const initialHtml = value ?? defaultValue ?? \"\";\n try {\n return initialHtml ? fromHTML(initialHtml) : createEmptyValue();\n } catch (error) {\n console.warn(\"Failed to parse initial HTML, using empty value:\", error);\n return createEmptyValue();\n }\n });\n\n const [serializedValue, setSerializedValue] = useState(() => {\n return value ?? defaultValue ?? \"\";\n });\n\n const editorRef = useRef<RichTextEditorRef>(null);\n\n // Handle controlled value changes\n useEffect(() => {\n if (value !== undefined && value !== serializedValue) {\n const newSlateValue = value ? fromHTML(value) : createEmptyValue();\n setInternalValue(newSlateValue);\n setSerializedValue(value);\n }\n }, [value, serializedValue]);\n\n const handleChange = useCallback(\n (slateValue: ReturnType<typeof createEmptyValue>) => {\n const newHtml = toHTML(slateValue);\n const hasSerializedValueChanged = newHtml !== serializedValue;\n\n setInternalValue(slateValue);\n setSerializedValue(newHtml);\n\n // Only call onChange if the serialized HTML actually changed\n if (hasSerializedValueChanged && onChange) {\n onChange(newHtml);\n }\n },\n [serializedValue, onChange]\n );\n\n const currentValue = internalValue;\n\n // Safety check: ensure we always have a valid Slate value\n const safeValue = validSlateStateAdapter(currentValue);\n\n return (\n <RichTextInputRootSlot\n {...recipeProps}\n {...styleProps}\n {...functionalProps}\n {...dataAttributes}\n ref={forwardedRef}\n >\n <RichTextEditor\n ref={editorRef}\n value={safeValue}\n onChange={handleChange}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n autoFocus={autoFocus}\n toolbar={\n !isReadOnly ? <RichTextToolbar isDisabled={isDisabled} /> : null\n }\n />\n </RichTextInputRootSlot>\n );\n};\n\nRichTextInput.displayName = \"RichTextInput\";\n"],"names":["richTextInputRecipe","defineSlotRecipe","withProvider","withContext","createSlotRecipeContext","RichTextInputRootSlot","RichTextInputToolbarSlot","RichTextInputEditableSlot","History","value","isPlainObject","Operation","SAVING","MERGING","SPLITTING_ONCE","HistoryEditor","Editor","editor","fn","prev","withHistory","e","apply","history","redos","batch","Transforms","op","undos","inverseOps","operations","lastBatch","lastOp","save","merge","shouldSave","shouldMerge","stack","Path","RichTextEditor","forwardRef","props","forwardedRef","onChange","onFocus","onBlur","placeholder","EDITOR_DEFAULTS","isDisabled","isReadOnly","autoFocus","toolbar","useMemo","baseEditor","createEditor","withLinks","withReact","handleKeyDown","useKeyboardShortcuts","handleFocus","useCallback","event","handleBlur","useImperativeHandle","focusEditor","html","resetEditor","renderElement","jsx","Element","renderLeaf","Leaf","defaultValue","createEmptyValue","safeInitialValue","jsxs","Slate","Editable","FormattingMenu","useSlate","withPreservedSelection","usePreservedSelection","allSelectedKeys","handleAllSelectionChange","useFormattingState","Menu","Tooltip","IconButton","MoreHoriz","Box","FormatStrikethrough","Text","Code","RichTextToolbar","currentTextStyle","selectedTextStyleLabel","handleTextStyleChange","handleListToggle","selectedFormatKeys","selectedListKeys","hasUndos","hasRedos","useToolbarState","Toolbar","Group","styleId","KeyboardArrowDown","textStyles","style","Divider","ToggleButtonGroup","IconToggleButton","toggleMark","FormatBold","VisuallyHidden","FormatItalic","FormatUnderlined","FormatListBulleted","FormatListNumbered","Undo","Redo","RichTextInput","isInvalid","restProps","recipe","useSlotRecipe","recipeProps","remainingProps","styleProps","functionalProps","extractStyleProps","dataAttributes","internalValue","setInternalValue","useState","initialHtml","fromHTML","error","serializedValue","setSerializedValue","editorRef","useRef","useEffect","newSlateValue","handleChange","slateValue","newHtml","toHTML","hasSerializedValueChanged","currentValue","safeValue","validSlateStateAdapter"],"mappings":"6wBAEaA,EAAsBC,EAAAA,iBAAiB,CAClD,MAAO,CAAC,OAAQ,UAAW,UAAU,EACrC,UAAW,yBACX,KAAM,CACJ,KAAM,CACJ,QAAS,OACT,cAAe,SACf,SAAU,WACV,MAAO,OACP,aAAc,MACd,YAAa,aACb,aAAc,QACd,YAAa,iBACb,gBAAiB,wBAGjB,yBAA0B,CACxB,YAAa,aACb,YAAa,YAAA,CACf,EAEF,QAAS,CACP,UAAW,IAGX,2BAA4B,CAC1B,QAAS,KAAA,CACX,EAEF,SAAU,CACR,QAAS,MACT,UAAW,UACX,QAAS,OAGT,2BAA4B,CAC1B,OAAQ,cACR,QAAS,KAAA,EAIX,MAAO,CACL,UAAW,KACX,WAAY,KAAA,EAEd,OAAQ,CACN,UAAW,MACX,WAAY,KAAA,EAEd,OAAQ,CACN,UAAW,KACX,WAAY,KAAA,EAEd,OAAQ,CACN,UAAW,KACX,WAAY,KAAA,EAEd,OAAQ,CACN,UAAW,KACX,WAAY,KAAA,EAEd,OAAQ,CACN,UAAW,KACX,WAAY,KAAA,EAEd,eAAgB,CACd,UAAW,KACX,WAAY,MACZ,gBAAiB,cACjB,YAAa,KAAA,EAEf,OAAQ,CACN,YAAa,MACb,cAAe,MAAA,EAEjB,OAAQ,CACN,YAAa,MACb,cAAe,SAAA,EAEjB,SAAU,CACR,QAAS,MACT,WAAY,MAAA,EAEd,QAAS,CACP,QAAS,MACT,aAAc,MACd,SAAU,OACV,SAAU,CACR,QAAS,GAAA,CACX,EAEF,MAAO,CACL,MAAO,aACP,eAAgB,YAChB,OAAQ,UACR,OAAQ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CAAK,CAAA,CAEhE,CAAA,CAGN,EAEAyE,EAAc,YAAc","x_google_ignoreList":[2]}
1
+ {"version":3,"file":"rich-text-input-Dmp5hx2t.cjs.js","sources":["../../src/components/rich-text-input/rich-text-input.recipe.tsx","../../src/components/rich-text-input/rich-text-input.slots.tsx","../../../../node_modules/.pnpm/slate-history@0.113.1_slate@0.75.0/node_modules/slate-history/dist/index.es.js","../../src/components/rich-text-input/components/rich-text-editor.tsx","../../src/components/rich-text-input/components/formatting-menu.tsx","../../src/components/rich-text-input/components/rich-text-toolbar.tsx","../../src/components/rich-text-input/rich-text-input.tsx"],"sourcesContent":["import { defineSlotRecipe } from \"@chakra-ui/react\";\n\nexport const richTextInputRecipe = defineSlotRecipe({\n slots: [\"root\", \"toolbar\", \"editable\"],\n className: \"nimbus-rich-text-input\",\n base: {\n root: {\n display: \"flex\",\n flexDirection: \"column\",\n position: \"relative\",\n width: \"full\",\n borderRadius: \"200\",\n borderWidth: \"{sizes.25}\",\n colorPalette: \"slate\",\n borderColor: \"colorPalette.7\",\n backgroundColor: \"colorPalette.contrast\",\n\n // Invalid state styling\n \"&[data-invalid='true']\": {\n borderWidth: \"{sizes.50}\",\n borderColor: \"critical.7\",\n },\n },\n toolbar: {\n boxShadow: \"1\",\n\n // Disabled state styling for toolbar\n \"[data-disabled='true'] &\": {\n opacity: \"0.5\",\n },\n },\n editable: {\n padding: \"400\",\n minHeight: \"inherit\",\n outline: \"none\",\n\n // Disabled state styling for editable\n \"[data-disabled='true'] &\": {\n cursor: \"not-allowed\",\n opacity: \"0.5\",\n },\n\n // Styling for user-facing editor text\n \"& p\": {\n textStyle: \"md\",\n fontWeight: \"500\",\n },\n \"& h1\": {\n textStyle: \"2xl\",\n fontWeight: \"500\",\n },\n \"& h2\": {\n textStyle: \"xl\",\n fontWeight: \"500\",\n },\n \"& h3\": {\n textStyle: \"lg\",\n fontWeight: \"500\",\n },\n \"& h4\": {\n textStyle: \"md\",\n fontWeight: \"500\",\n },\n \"& h5\": {\n textStyle: \"xs\",\n fontWeight: \"500\",\n },\n \"& blockquote\": {\n textStyle: \"md\",\n fontWeight: \"400\",\n borderLeftWidth: \"{sizes.100}\",\n paddingLeft: \"400\",\n },\n \"& ul\": {\n paddingLeft: \"600\",\n listStyleType: \"disc\",\n },\n \"& ol\": {\n paddingLeft: \"600\",\n listStyleType: \"decimal\",\n },\n \"& code\": {\n padding: \"100\",\n fontFamily: \"mono\",\n },\n \"& pre\": {\n padding: \"300\",\n borderRadius: \"200\",\n overflow: \"auto\",\n \"& code\": {\n padding: \"0\",\n },\n },\n \"& a\": {\n color: \"primary.11\",\n textDecoration: \"underline\",\n cursor: \"pointer\",\n _hover: {\n textDecoration: \"none\",\n },\n },\n \"& strong\": {\n fontWeight: \"700\",\n },\n \"& em\": {\n fontStyle: \"italic\",\n },\n \"& u\": {\n textDecoration: \"underline\",\n },\n \"& del\": {\n textDecoration: \"line-through\",\n },\n \"& sup\": {\n fontSize: \"75%\",\n verticalAlign: \"super\",\n lineHeight: \"0\",\n },\n \"& sub\": {\n fontSize: \"75%\",\n verticalAlign: \"sub\",\n lineHeight: \"0\",\n },\n },\n },\n variants: {},\n});\n","import {\n type HTMLChakraProps,\n type RecipeVariantProps,\n type UnstyledProp,\n createSlotRecipeContext,\n} from \"@chakra-ui/react\";\nimport { richTextInputRecipe } from \"./rich-text-input.recipe\";\n\nconst { withProvider, withContext } = createSlotRecipeContext({\n recipe: richTextInputRecipe,\n});\n\n// Root slot\nexport type RichTextInputRootSlotProps = HTMLChakraProps<\n \"div\",\n RecipeVariantProps<typeof richTextInputRecipe> & UnstyledProp\n>;\n\nexport const RichTextInputRootSlot = withProvider<\n HTMLDivElement,\n RichTextInputRootSlotProps\n>(\"div\", \"root\");\n\n// Toolbar slot\nexport type RichTextInputToolbarSlotProps = HTMLChakraProps<\"div\">;\n\nexport const RichTextInputToolbarSlot = withContext<\n HTMLDivElement,\n RichTextInputToolbarSlotProps\n>(\"div\", \"toolbar\");\n\n// Editable slot\nexport type RichTextInputEditableSlotProps = HTMLChakraProps<\"div\">;\nexport const RichTextInputEditableSlot = withContext<\n HTMLDivElement,\n RichTextInputEditableSlotProps\n>(\"div\", \"editable\");\n","import { isPlainObject } from 'is-plain-object';\nimport { Operation, Editor, Transforms, Path } from 'slate';\n\n// eslint-disable-next-line no-redeclare\nvar History = {\n /**\n * Check if a value is a `History` object.\n */\n isHistory(value) {\n return isPlainObject(value) && Array.isArray(value.redos) && Array.isArray(value.undos) && (value.redos.length === 0 || Operation.isOperationList(value.redos[0].operations)) && (value.undos.length === 0 || Operation.isOperationList(value.undos[0].operations));\n }\n};\n\n/**\n * Weakmaps for attaching state to the editor.\n */\nvar HISTORY = new WeakMap();\nvar SAVING = new WeakMap();\nvar MERGING = new WeakMap();\nvar SPLITTING_ONCE = new WeakMap();\n// eslint-disable-next-line no-redeclare\nvar HistoryEditor = {\n /**\n * Check if a value is a `HistoryEditor` object.\n */\n isHistoryEditor(value) {\n return History.isHistory(value.history) && Editor.isEditor(value);\n },\n /**\n * Get the merge flag's current value.\n */\n isMerging(editor) {\n return MERGING.get(editor);\n },\n /**\n * Get the splitting once flag's current value.\n */\n isSplittingOnce(editor) {\n return SPLITTING_ONCE.get(editor);\n },\n setSplittingOnce(editor, value) {\n SPLITTING_ONCE.set(editor, value);\n },\n /**\n * Get the saving flag's current value.\n */\n isSaving(editor) {\n return SAVING.get(editor);\n },\n /**\n * Redo to the previous saved state.\n */\n redo(editor) {\n editor.redo();\n },\n /**\n * Undo to the previous saved state.\n */\n undo(editor) {\n editor.undo();\n },\n /**\n * Apply a series of changes inside a synchronous `fn`, These operations will\n * be merged into the previous history.\n */\n withMerging(editor, fn) {\n var prev = HistoryEditor.isMerging(editor);\n MERGING.set(editor, true);\n fn();\n MERGING.set(editor, prev);\n },\n /**\n * Apply a series of changes inside a synchronous `fn`, ensuring that the first\n * operation starts a new batch in the history. Subsequent operations will be\n * merged as usual.\n */\n withNewBatch(editor, fn) {\n var prev = HistoryEditor.isMerging(editor);\n MERGING.set(editor, true);\n SPLITTING_ONCE.set(editor, true);\n fn();\n MERGING.set(editor, prev);\n SPLITTING_ONCE.delete(editor);\n },\n /**\n * Apply a series of changes inside a synchronous `fn`, without merging any of\n * the new operations into previous save point in the history.\n */\n withoutMerging(editor, fn) {\n var prev = HistoryEditor.isMerging(editor);\n MERGING.set(editor, false);\n fn();\n MERGING.set(editor, prev);\n },\n /**\n * Apply a series of changes inside a synchronous `fn`, without saving any of\n * their operations into the history.\n */\n withoutSaving(editor, fn) {\n var prev = HistoryEditor.isSaving(editor);\n SAVING.set(editor, false);\n try {\n fn();\n } finally {\n SAVING.set(editor, prev);\n }\n }\n};\n\n/**\n * The `withHistory` plugin keeps track of the operation history of a Slate\n * editor as operations are applied to it, using undo and redo stacks.\n *\n * If you are using TypeScript, you must extend Slate's CustomTypes to use\n * this plugin.\n *\n * See https://docs.slatejs.org/concepts/11-typescript to learn how.\n */\nvar withHistory = editor => {\n var e = editor;\n var {\n apply\n } = e;\n e.history = {\n undos: [],\n redos: []\n };\n e.redo = () => {\n var {\n history\n } = e;\n var {\n redos\n } = history;\n if (redos.length > 0) {\n var batch = redos[redos.length - 1];\n if (batch.selectionBefore) {\n Transforms.setSelection(e, batch.selectionBefore);\n }\n HistoryEditor.withoutSaving(e, () => {\n Editor.withoutNormalizing(e, () => {\n for (var op of batch.operations) {\n e.apply(op);\n }\n });\n });\n history.redos.pop();\n e.writeHistory('undos', batch);\n }\n };\n e.undo = () => {\n var {\n history\n } = e;\n var {\n undos\n } = history;\n if (undos.length > 0) {\n var batch = undos[undos.length - 1];\n HistoryEditor.withoutSaving(e, () => {\n Editor.withoutNormalizing(e, () => {\n var inverseOps = batch.operations.map(Operation.inverse).reverse();\n for (var op of inverseOps) {\n e.apply(op);\n }\n if (batch.selectionBefore) {\n Transforms.setSelection(e, batch.selectionBefore);\n }\n });\n });\n e.writeHistory('redos', batch);\n history.undos.pop();\n }\n };\n e.apply = op => {\n var {\n operations,\n history\n } = e;\n var {\n undos\n } = history;\n var lastBatch = undos[undos.length - 1];\n var lastOp = lastBatch && lastBatch.operations[lastBatch.operations.length - 1];\n var save = HistoryEditor.isSaving(e);\n var merge = HistoryEditor.isMerging(e);\n if (save == null) {\n save = shouldSave(op);\n }\n if (save) {\n if (merge == null) {\n if (lastBatch == null) {\n merge = false;\n } else if (operations.length !== 0) {\n merge = true;\n } else {\n merge = shouldMerge(op, lastOp);\n }\n }\n if (HistoryEditor.isSplittingOnce(e)) {\n merge = false;\n HistoryEditor.setSplittingOnce(e, undefined);\n }\n if (lastBatch && merge) {\n lastBatch.operations.push(op);\n } else {\n var batch = {\n operations: [op],\n selectionBefore: e.selection\n };\n e.writeHistory('undos', batch);\n }\n while (undos.length > 100) {\n undos.shift();\n }\n history.redos = [];\n }\n apply(op);\n };\n e.writeHistory = (stack, batch) => {\n e.history[stack].push(batch);\n };\n return e;\n};\n/**\n * Check whether to merge an operation into the previous operation.\n */\nvar shouldMerge = (op, prev) => {\n if (prev && op.type === 'insert_text' && prev.type === 'insert_text' && op.offset === prev.offset + prev.text.length && Path.equals(op.path, prev.path)) {\n return true;\n }\n if (prev && op.type === 'remove_text' && prev.type === 'remove_text' && op.offset + op.text.length === prev.offset && Path.equals(op.path, prev.path)) {\n return true;\n }\n return false;\n};\n/**\n * Check whether an operation needs to be saved to the history.\n */\nvar shouldSave = (op, prev) => {\n if (op.type === 'set_selection') {\n return false;\n }\n return true;\n};\n\nexport { HISTORY, History, HistoryEditor, MERGING, SAVING, SPLITTING_ONCE, withHistory };\n//# sourceMappingURL=index.es.js.map\n","import {\n useMemo,\n useCallback,\n useImperativeHandle,\n forwardRef,\n type ForwardedRef,\n type FocusEventHandler,\n type ReactNode,\n} from \"react\";\nimport { createEditor, type Descendant } from \"slate\";\nimport { Slate, Editable, withReact } from \"slate-react\";\nimport { withHistory } from \"slate-history\";\nimport {\n RichTextInputEditableSlot,\n RichTextInputToolbarSlot,\n} from \"../rich-text-input.slots\";\nimport {\n Element,\n Leaf,\n withLinks,\n focusEditor,\n resetEditor,\n} from \"../utils/slate-helpers\";\nimport { createEmptyValue } from \"../utils/html-serialization\";\nimport { useKeyboardShortcuts } from \"../hooks/use-keyboard-shortcuts\";\nimport { EDITOR_DEFAULTS } from \"../constants\";\n\nexport interface RichTextEditorProps {\n value?: Descendant[];\n onChange: (value: Descendant[]) => void;\n onFocus?: FocusEventHandler<HTMLDivElement>;\n onBlur?: FocusEventHandler<HTMLDivElement>;\n placeholder?: string;\n isDisabled?: boolean;\n isReadOnly?: boolean;\n autoFocus?: boolean;\n toolbar?: ReactNode;\n}\n\nexport interface RichTextEditorRef {\n focus: () => void;\n resetValue: (html: string) => void;\n}\n\nexport const RichTextEditor = forwardRef<\n RichTextEditorRef,\n RichTextEditorProps\n>((props, forwardedRef: ForwardedRef<RichTextEditorRef>) => {\n const {\n value,\n onChange,\n onFocus,\n onBlur,\n placeholder = EDITOR_DEFAULTS.placeholder,\n isDisabled = EDITOR_DEFAULTS.isDisabled,\n isReadOnly = EDITOR_DEFAULTS.isReadOnly,\n autoFocus = EDITOR_DEFAULTS.autoFocus,\n toolbar,\n } = props;\n\n // Create editor with plugins\n const editor = useMemo(() => {\n const baseEditor = createEditor();\n return withLinks(withHistory(withReact(baseEditor)));\n }, []);\n\n // Handle keyboard shortcuts using hook\n const { handleKeyDown } = useKeyboardShortcuts({ editor });\n\n // Handle focus\n const handleFocus = useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n if (onFocus) {\n onFocus(event);\n }\n },\n [onFocus]\n );\n\n // Handle blur\n const handleBlur = useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n if (onBlur) {\n onBlur(event);\n }\n },\n [onBlur]\n );\n\n // Expose methods through ref\n useImperativeHandle(\n forwardedRef,\n () => ({\n focus: () => focusEditor(editor),\n resetValue: (html: string) => resetEditor(editor, html),\n }),\n [editor]\n );\n\n // Render element\n const renderElement = useCallback(\n (props: Parameters<typeof Element>[0]) => <Element {...props} />,\n []\n );\n\n // Render leaf\n const renderLeaf = useCallback(\n (props: Parameters<typeof Leaf>[0]) => <Leaf {...props} />,\n []\n );\n\n // Ensure we always have a valid value\n const defaultValue = createEmptyValue();\n const safeInitialValue =\n Array.isArray(value) && value.length > 0 ? value : defaultValue;\n\n return (\n <Slate editor={editor} value={safeInitialValue} onChange={onChange}>\n {toolbar && (\n <RichTextInputToolbarSlot>{toolbar}</RichTextInputToolbarSlot>\n )}\n <RichTextInputEditableSlot asChild>\n <Editable\n renderElement={renderElement}\n renderLeaf={renderLeaf}\n placeholder={placeholder}\n autoFocus={autoFocus}\n readOnly={isReadOnly || isDisabled}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n onBlur={handleBlur}\n aria-label=\"Rich text editor\"\n role=\"textbox\"\n aria-multiline=\"true\"\n />\n </RichTextInputEditableSlot>\n </Slate>\n );\n});\n\nRichTextEditor.displayName = \"RichTextEditor\";\n","import { useSlate } from \"slate-react\";\nimport { Menu, IconButton, Text, Box, Tooltip } from \"@/components\";\nimport {\n MoreHoriz,\n FormatStrikethrough,\n Code,\n} from \"@commercetools/nimbus-icons\";\nimport { usePreservedSelection } from \"../hooks/use-preserved-selection\";\nimport { useFormattingState } from \"../hooks/use-formatting-state\";\n\nexport interface FormattingMenuProps {\n isDisabled?: boolean;\n}\n\nexport const FormattingMenu = ({ isDisabled = false }: FormattingMenuProps) => {\n const editor = useSlate();\n const withPreservedSelection = usePreservedSelection(editor);\n\n // Use the formatting state hook for all state management\n const { allSelectedKeys, handleAllSelectionChange } = useFormattingState({\n withPreservedSelection,\n });\n\n return (\n <Menu.Root\n selectionMode=\"multiple\"\n selectedKeys={allSelectedKeys}\n onSelectionChange={handleAllSelectionChange}\n >\n <Tooltip.Root delay={0} closeDelay={0}>\n <Menu.Trigger asChild>\n <IconButton\n size=\"xs\"\n variant=\"ghost\"\n aria-label=\"More formatting options\"\n isDisabled={isDisabled}\n onMouseDown={(event) => event.preventDefault()}\n >\n <MoreHoriz />\n </IconButton>\n </Menu.Trigger>\n <Tooltip.Content placement=\"top\">More styles</Tooltip.Content>\n </Tooltip.Root>\n <Menu.Content>\n <Menu.Item id=\"strikethrough\">\n <Box slot=\"label\" display=\"flex\" alignItems=\"center\" gap=\"200\">\n <FormatStrikethrough />\n <Text textStyle=\"sm\">Strikethrough</Text>\n </Box>\n </Menu.Item>\n <Menu.Item id=\"code\">\n <Box slot=\"label\" display=\"flex\" alignItems=\"center\" gap=\"200\">\n <Code />\n <Text textStyle=\"sm\">Code</Text>\n </Box>\n </Menu.Item>\n <Menu.Item id=\"superscript\">\n <Box slot=\"label\" display=\"flex\" alignItems=\"center\" gap=\"200\">\n <Text>X²</Text>\n <Text textStyle=\"sm\">Superscript</Text>\n </Box>\n </Menu.Item>\n <Menu.Item id=\"subscript\">\n <Box slot=\"label\" display=\"flex\" alignItems=\"center\" gap=\"200\">\n <Text>X₂</Text>\n <Text textStyle=\"sm\">Subscript</Text>\n </Box>\n </Menu.Item>\n </Menu.Content>\n </Menu.Root>\n );\n};\n","import { useSlate } from \"slate-react\";\nimport {\n Toolbar,\n Menu,\n VisuallyHidden,\n Divider,\n ToggleButtonGroup,\n IconToggleButton,\n IconButton,\n Text,\n Box,\n Tooltip,\n} from \"@/components\";\nimport { Group } from \"@/components/group\";\nimport {\n FormatBold,\n FormatItalic,\n FormatUnderlined,\n FormatListBulleted,\n FormatListNumbered,\n KeyboardArrowDown,\n Undo,\n Redo,\n} from \"@commercetools/nimbus-icons\";\nimport { toggleMark } from \"../utils/slate-helpers\";\nimport { usePreservedSelection } from \"../hooks/use-preserved-selection\";\nimport { useToolbarState } from \"../hooks/use-toolbar-state\";\nimport { textStyles } from \"../constants\";\nimport { FormattingMenu } from \"./formatting-menu\";\n\nexport interface RichTextToolbarProps {\n isDisabled?: boolean;\n}\n\nexport const RichTextToolbar = ({\n isDisabled = false,\n}: RichTextToolbarProps) => {\n const editor = useSlate();\n const withPreservedSelection = usePreservedSelection(editor);\n\n // Use the toolbar state hook for all state management\n const {\n currentTextStyle,\n selectedTextStyleLabel,\n handleTextStyleChange,\n handleListToggle,\n selectedFormatKeys,\n selectedListKeys,\n hasUndos,\n hasRedos,\n } = useToolbarState({ withPreservedSelection });\n\n return (\n <Toolbar\n orientation=\"horizontal\"\n aria-label=\"Text formatting\"\n width=\"full\"\n overflow=\"hidden\"\n size=\"xs\"\n >\n {/* Text Style Menu */}\n <Group>\n <Menu.Root\n onAction={(styleId) => handleTextStyleChange(String(styleId))}\n >\n <Tooltip.Root delay={0} closeDelay={0}>\n {/* Menu trigger styles mimic the Select component */}\n <Menu.Trigger\n height=\"800\"\n width=\"4000\"\n bg=\"primary.1\"\n borderRadius=\"200\"\n _hover={{ bg: \"primary.2\" }}\n isDisabled={isDisabled}\n onMouseDown={(event) => event.preventDefault()}\n aria-label=\"Text style menu\"\n >\n <Box display=\"flex\" alignItems=\"center\" gap=\"200\" px=\"200\">\n <Box display=\"flex\" alignItems=\"center\" gap=\"200\" flexGrow=\"1\">\n <Text my=\"auto\" textStyle=\"sm\" fontWeight=\"500\">\n {selectedTextStyleLabel}\n </Text>\n </Box>\n <KeyboardArrowDown />\n </Box>\n </Menu.Trigger>\n <Tooltip.Content placement=\"top\">Text style</Tooltip.Content>\n </Tooltip.Root>\n <Menu.Content>\n {textStyles.map((style) => (\n <Menu.Item\n key={style.id}\n id={style.id}\n {...(currentTextStyle === style.id && {\n \"data-state\": \"checked\",\n })}\n >\n <Text {...style.props}>{style.label}</Text>\n </Menu.Item>\n ))}\n </Menu.Content>\n </Menu.Root>\n </Group>\n\n <Divider orientation=\"vertical\" />\n\n {/* Text Formatting Toggles */}\n <ToggleButtonGroup.Root\n selectionMode=\"multiple\"\n selectedKeys={selectedFormatKeys}\n isDisabled={isDisabled}\n >\n <Tooltip.Root delay={0} closeDelay={0}>\n <IconToggleButton\n id=\"bold\"\n size=\"xs\"\n variant=\"ghost\"\n aria-label=\"Bold\"\n isDisabled={isDisabled}\n onMouseDown={(event) => event.preventDefault()}\n onPress={withPreservedSelection(() => toggleMark(editor, \"bold\"))}\n >\n <FormatBold />\n <VisuallyHidden>Bold</VisuallyHidden>\n </IconToggleButton>\n <Tooltip.Content placement=\"top\">Bold</Tooltip.Content>\n </Tooltip.Root>\n <Tooltip.Root delay={0} closeDelay={0}>\n <IconToggleButton\n id=\"italic\"\n size=\"xs\"\n variant=\"ghost\"\n aria-label=\"Italic\"\n isDisabled={isDisabled}\n onMouseDown={(event) => event.preventDefault()}\n onPress={withPreservedSelection(() => toggleMark(editor, \"italic\"))}\n >\n <FormatItalic />\n <VisuallyHidden>Italic</VisuallyHidden>\n </IconToggleButton>\n <Tooltip.Content placement=\"top\">Italic</Tooltip.Content>\n </Tooltip.Root>\n <Tooltip.Root delay={0} closeDelay={0}>\n <IconToggleButton\n id=\"underline\"\n size=\"xs\"\n variant=\"ghost\"\n aria-label=\"Underline\"\n isDisabled={isDisabled}\n onMouseDown={(event) => event.preventDefault()}\n onPress={withPreservedSelection(() =>\n toggleMark(editor, \"underline\")\n )}\n >\n <FormatUnderlined />\n <VisuallyHidden>Underline</VisuallyHidden>\n </IconToggleButton>\n <Tooltip.Content placement=\"top\">Underline</Tooltip.Content>\n </Tooltip.Root>\n </ToggleButtonGroup.Root>\n\n {/* Formatting Menu for additional options */}\n <FormattingMenu isDisabled={isDisabled} />\n\n <Divider orientation=\"vertical\" />\n\n {/* Lists & Indentation */}\n <ToggleButtonGroup.Root\n selectionMode=\"single\"\n selectedKeys={selectedListKeys}\n onSelectionChange={handleListToggle}\n aria-label=\"List formatting\"\n isDisabled={isDisabled}\n >\n <Tooltip.Root delay={0} closeDelay={0}>\n <IconToggleButton\n id=\"bulleted-list\"\n size=\"xs\"\n variant=\"ghost\"\n aria-label=\"Bulleted List\"\n isDisabled={isDisabled}\n onMouseDown={(event) => event.preventDefault()}\n >\n <FormatListBulleted />\n </IconToggleButton>\n <Tooltip.Content placement=\"top\">Bulleted list</Tooltip.Content>\n </Tooltip.Root>\n <Tooltip.Root delay={0} closeDelay={0}>\n <IconToggleButton\n id=\"numbered-list\"\n size=\"xs\"\n variant=\"ghost\"\n aria-label=\"Numbered List\"\n isDisabled={isDisabled}\n onMouseDown={(event) => event.preventDefault()}\n >\n <FormatListNumbered />\n </IconToggleButton>\n <Tooltip.Content placement=\"top\">Numbered list</Tooltip.Content>\n </Tooltip.Root>\n </ToggleButtonGroup.Root>\n\n {/* Spacer to push undo/redo buttons to the right */}\n <Box flexGrow=\"1\" />\n\n <Group>\n <Tooltip.Root delay={0} closeDelay={0}>\n <IconButton\n size=\"xs\"\n variant=\"ghost\"\n aria-label=\"Undo\"\n isDisabled={!hasUndos || isDisabled}\n onPress={withPreservedSelection(() => editor.undo())}\n onMouseDown={(event) => event.preventDefault()}\n >\n <Undo />\n <VisuallyHidden>Undo</VisuallyHidden>\n </IconButton>\n <Tooltip.Content placement=\"top\">Undo</Tooltip.Content>\n </Tooltip.Root>\n <Tooltip.Root delay={0} closeDelay={0}>\n <IconButton\n size=\"xs\"\n variant=\"ghost\"\n aria-label=\"Redo\"\n isDisabled={!hasRedos || isDisabled}\n onPress={withPreservedSelection(() => editor.redo())}\n onMouseDown={(event) => event.preventDefault()}\n >\n <Redo />\n <VisuallyHidden>Redo</VisuallyHidden>\n </IconButton>\n <Tooltip.Content placement=\"top\">Redo</Tooltip.Content>\n </Tooltip.Root>\n </Group>\n </Toolbar>\n );\n};\n\nRichTextToolbar.displayName = \"RichTextToolbar\";\n","import { useState, useCallback, useRef, useEffect } from \"react\";\nimport { useSlotRecipe } from \"@chakra-ui/react\";\nimport { extractStyleProps } from \"@/utils/extractStyleProps\";\nimport { RichTextInputRootSlot } from \"./rich-text-input.slots\";\nimport {\n RichTextEditor,\n type RichTextEditorRef,\n} from \"./components/rich-text-editor\";\nimport { RichTextToolbar } from \"./components/rich-text-toolbar\";\nimport type { RichTextInputProps } from \"./rich-text-input.types\";\nimport {\n toHTML,\n fromHTML,\n createEmptyValue,\n validSlateStateAdapter,\n} from \"./utils\";\nimport { richTextInputRecipe } from \"./rich-text-input.recipe\";\n\n/**\n RichTextInput - A rich text input component with formatting capabilities.\n */\nexport const RichTextInput = (props: RichTextInputProps) => {\n const {\n ref: forwardedRef,\n value,\n defaultValue,\n onChange,\n onFocus,\n onBlur,\n placeholder = \"\",\n isDisabled = false,\n isReadOnly = false,\n isInvalid = false,\n autoFocus = false,\n ...restProps\n } = props;\n\n const recipe = useSlotRecipe({ recipe: richTextInputRecipe });\n const [recipeProps, remainingProps] = recipe.splitVariantProps({\n // Only semantic variants go here (none currently defined)\n ...restProps,\n });\n const [styleProps, functionalProps] = extractStyleProps(remainingProps);\n\n // Data attributes for state-based styling\n const dataAttributes = {\n \"data-disabled\": isDisabled ? \"true\" : undefined,\n \"data-invalid\": isInvalid ? \"true\" : undefined,\n \"data-readonly\": isReadOnly ? \"true\" : undefined,\n };\n\n // Internal state management\n const [internalValue, setInternalValue] = useState(() => {\n const initialHtml = value ?? defaultValue ?? \"\";\n try {\n return initialHtml ? fromHTML(initialHtml) : createEmptyValue();\n } catch (error) {\n console.warn(\"Failed to parse initial HTML, using empty value:\", error);\n return createEmptyValue();\n }\n });\n\n const [serializedValue, setSerializedValue] = useState(() => {\n return value ?? defaultValue ?? \"\";\n });\n\n const editorRef = useRef<RichTextEditorRef>(null);\n\n // Handle controlled value changes\n useEffect(() => {\n if (value !== undefined && value !== serializedValue) {\n const newSlateValue = value ? fromHTML(value) : createEmptyValue();\n setInternalValue(newSlateValue);\n setSerializedValue(value);\n }\n }, [value, serializedValue]);\n\n const handleChange = useCallback(\n (slateValue: ReturnType<typeof createEmptyValue>) => {\n const newHtml = toHTML(slateValue);\n const hasSerializedValueChanged = newHtml !== serializedValue;\n\n setInternalValue(slateValue);\n setSerializedValue(newHtml);\n\n // Only call onChange if the serialized HTML actually changed\n if (hasSerializedValueChanged && onChange) {\n onChange(newHtml);\n }\n },\n [serializedValue, onChange]\n );\n\n const currentValue = internalValue;\n\n // Safety check: ensure we always have a valid Slate value\n const safeValue = validSlateStateAdapter(currentValue);\n\n return (\n <RichTextInputRootSlot\n {...recipeProps}\n {...styleProps}\n {...functionalProps}\n {...dataAttributes}\n ref={forwardedRef}\n >\n <RichTextEditor\n ref={editorRef}\n value={safeValue}\n onChange={handleChange}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n autoFocus={autoFocus}\n toolbar={\n !isReadOnly ? <RichTextToolbar isDisabled={isDisabled} /> : null\n }\n />\n </RichTextInputRootSlot>\n );\n};\n\nRichTextInput.displayName = \"RichTextInput\";\n"],"names":["richTextInputRecipe","defineSlotRecipe","withProvider","withContext","createSlotRecipeContext","RichTextInputRootSlot","RichTextInputToolbarSlot","RichTextInputEditableSlot","History","value","isPlainObject","Operation","SAVING","MERGING","SPLITTING_ONCE","HistoryEditor","Editor","editor","fn","prev","withHistory","e","apply","history","redos","batch","Transforms","op","undos","inverseOps","operations","lastBatch","lastOp","save","merge","shouldSave","shouldMerge","stack","Path","RichTextEditor","forwardRef","props","forwardedRef","onChange","onFocus","onBlur","placeholder","EDITOR_DEFAULTS","isDisabled","isReadOnly","autoFocus","toolbar","useMemo","baseEditor","createEditor","withLinks","withReact","handleKeyDown","useKeyboardShortcuts","handleFocus","useCallback","event","handleBlur","useImperativeHandle","focusEditor","html","resetEditor","renderElement","jsx","Element","renderLeaf","Leaf","defaultValue","createEmptyValue","safeInitialValue","jsxs","Slate","Editable","FormattingMenu","useSlate","withPreservedSelection","usePreservedSelection","allSelectedKeys","handleAllSelectionChange","useFormattingState","Menu","Tooltip","IconButton","MoreHoriz","Box","FormatStrikethrough","Text","Code","RichTextToolbar","currentTextStyle","selectedTextStyleLabel","handleTextStyleChange","handleListToggle","selectedFormatKeys","selectedListKeys","hasUndos","hasRedos","useToolbarState","Toolbar","Group","styleId","KeyboardArrowDown","textStyles","style","Divider","ToggleButtonGroup","IconToggleButton","toggleMark","FormatBold","VisuallyHidden","FormatItalic","FormatUnderlined","FormatListBulleted","FormatListNumbered","Undo","Redo","RichTextInput","isInvalid","restProps","recipe","useSlotRecipe","recipeProps","remainingProps","styleProps","functionalProps","extractStyleProps","dataAttributes","internalValue","setInternalValue","useState","initialHtml","fromHTML","error","serializedValue","setSerializedValue","editorRef","useRef","useEffect","newSlateValue","handleChange","slateValue","newHtml","toHTML","hasSerializedValueChanged","currentValue","safeValue","validSlateStateAdapter"],"mappings":"6wBAEaA,EAAsBC,EAAAA,iBAAiB,CAClD,MAAO,CAAC,OAAQ,UAAW,UAAU,EACrC,UAAW,yBACX,KAAM,CACJ,KAAM,CACJ,QAAS,OACT,cAAe,SACf,SAAU,WACV,MAAO,OACP,aAAc,MACd,YAAa,aACb,aAAc,QACd,YAAa,iBACb,gBAAiB,wBAGjB,yBAA0B,CACxB,YAAa,aACb,YAAa,YAAA,CACf,EAEF,QAAS,CACP,UAAW,IAGX,2BAA4B,CAC1B,QAAS,KAAA,CACX,EAEF,SAAU,CACR,QAAS,MACT,UAAW,UACX,QAAS,OAGT,2BAA4B,CAC1B,OAAQ,cACR,QAAS,KAAA,EAIX,MAAO,CACL,UAAW,KACX,WAAY,KAAA,EAEd,OAAQ,CACN,UAAW,MACX,WAAY,KAAA,EAEd,OAAQ,CACN,UAAW,KACX,WAAY,KAAA,EAEd,OAAQ,CACN,UAAW,KACX,WAAY,KAAA,EAEd,OAAQ,CACN,UAAW,KACX,WAAY,KAAA,EAEd,OAAQ,CACN,UAAW,KACX,WAAY,KAAA,EAEd,eAAgB,CACd,UAAW,KACX,WAAY,MACZ,gBAAiB,cACjB,YAAa,KAAA,EAEf,OAAQ,CACN,YAAa,MACb,cAAe,MAAA,EAEjB,OAAQ,CACN,YAAa,MACb,cAAe,SAAA,EAEjB,SAAU,CACR,QAAS,MACT,WAAY,MAAA,EAEd,QAAS,CACP,QAAS,MACT,aAAc,MACd,SAAU,OACV,SAAU,CACR,QAAS,GAAA,CACX,EAEF,MAAO,CACL,MAAO,aACP,eAAgB,YAChB,OAAQ,UACR,OAAQ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