@sparrowengg/integrations-templates-frontend 1.9.63 → 1.9.64

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 (185) hide show
  1. package/dist/cjs/_virtual/index10.js +2 -2
  2. package/dist/cjs/_virtual/index8.js +2 -2
  3. package/dist/cjs/_virtual/index9.js +2 -2
  4. package/dist/cjs/node_modules/@internationalized/date/dist/utils.js +1 -2
  5. package/dist/cjs/node_modules/@internationalized/date/dist/utils.js.map +1 -1
  6. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/alert-dialog/alert-dialog.js +9 -3
  7. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/alert-dialog/alert-dialog.js.map +1 -1
  8. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/box/box.js +6 -8
  9. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/box/box.js.map +1 -1
  10. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/button.js +106 -99
  11. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/button.js.map +1 -1
  12. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/icon-button.js +18 -1
  13. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/icon-button.js.map +1 -1
  14. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/side-element.js +113 -71
  15. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/side-element.js.map +1 -1
  16. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/split-button.js +31 -8
  17. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/split-button.js.map +1 -1
  18. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/utils.js +19 -1
  19. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/button/utils.js.map +1 -1
  20. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-cell.js +20 -4
  21. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-cell.js.map +1 -1
  22. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-grid.js +5 -3
  23. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-grid.js.map +1 -1
  24. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js +43 -13
  25. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js.map +1 -1
  26. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-time-picker.js +18 -15
  27. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-time-picker.js.map +1 -1
  28. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-timezone-picker.js +60 -52
  29. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-timezone-picker.js.map +1 -1
  30. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-years-view.js +90 -20
  31. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-years-view.js.map +1 -1
  32. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar.js +138 -113
  33. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar.js.map +1 -1
  34. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js +71 -13
  35. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js.map +1 -1
  36. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/chip/chip.js +660 -88
  37. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/chip/chip.js.map +1 -1
  38. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js +68 -13
  39. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js.map +1 -1
  40. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-alert.js +11 -1
  41. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-alert.js.map +1 -1
  42. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-confirm.js +22 -2
  43. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-confirm.js.map +1 -1
  44. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-modal.js +25 -19
  45. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-modal.js.map +1 -1
  46. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js +28 -6
  47. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js.map +1 -1
  48. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/flex/flex.js +56 -54
  49. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/flex/flex.js.map +1 -1
  50. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/form-helper-text/form-helper-text.js +28 -1
  51. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/form-helper-text/form-helper-text.js.map +1 -1
  52. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js +109 -20
  53. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js.map +1 -1
  54. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/input/form-input.js +103 -66
  55. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/input/form-input.js.map +1 -1
  56. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/input/input.js +199 -110
  57. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/input/input.js.map +1 -1
  58. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/loader/circle.js +10 -1
  59. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/loader/circle.js.map +1 -1
  60. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -1
  61. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js.map +1 -1
  62. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/factoryWithTypeCheckers.js +4 -4
  63. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/factoryWithTypeCheckers.js.map +1 -1
  64. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/index.js +2 -2
  65. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/index.js.map +1 -1
  66. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-down.js +2 -1
  67. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-down.js.map +1 -1
  68. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-left.js +2 -1
  69. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-left.js.map +1 -1
  70. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-right.js +2 -1
  71. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-right.js.map +1 -1
  72. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/close.js +4 -2
  73. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/close.js.map +1 -1
  74. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/search.js +4 -2
  75. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/search.js.map +1 -1
  76. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js +7 -5
  77. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js.map +1 -1
  78. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/select/select.js +143 -25
  79. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/select/select.js.map +1 -1
  80. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/stitches.config.js +23 -18
  81. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/stitches.config.js.map +1 -1
  82. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js +2 -2
  83. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js.map +1 -1
  84. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js +112 -14
  85. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js.map +1 -1
  86. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js +10 -2
  87. package/dist/cjs/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js.map +1 -1
  88. package/dist/cjs/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +1 -1
  89. package/dist/cjs/node_modules/html-dom-parser/node_modules/domutils/lib/index.js +1 -1
  90. package/dist/cjs/node_modules/html-dom-parser/node_modules/htmlparser2/lib/index.js +1 -1
  91. package/dist/cjs/node_modules/style-to-js/cjs/index.js +1 -1
  92. package/dist/cjs/node_modules/style-to-object/cjs/index.js +1 -1
  93. package/dist/es/_virtual/index10.js +2 -2
  94. package/dist/es/_virtual/index8.js +2 -2
  95. package/dist/es/_virtual/index9.js +2 -2
  96. package/dist/es/node_modules/@internationalized/date/dist/utils.js +1 -2
  97. package/dist/es/node_modules/@internationalized/date/dist/utils.js.map +1 -1
  98. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/alert-dialog/alert-dialog.js +9 -3
  99. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/alert-dialog/alert-dialog.js.map +1 -1
  100. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/box/box.js +6 -8
  101. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/box/box.js.map +1 -1
  102. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/button.js +107 -100
  103. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/button.js.map +1 -1
  104. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/icon-button.js +18 -1
  105. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/icon-button.js.map +1 -1
  106. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/side-element.js +113 -71
  107. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/side-element.js.map +1 -1
  108. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/split-button.js +31 -8
  109. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/split-button.js.map +1 -1
  110. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/utils.js +19 -2
  111. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/button/utils.js.map +1 -1
  112. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-cell.js +20 -4
  113. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-cell.js.map +1 -1
  114. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-grid.js +5 -3
  115. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-grid.js.map +1 -1
  116. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js +43 -13
  117. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js.map +1 -1
  118. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-time-picker.js +19 -16
  119. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-time-picker.js.map +1 -1
  120. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-timezone-picker.js +60 -52
  121. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-timezone-picker.js.map +1 -1
  122. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-years-view.js +90 -20
  123. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-years-view.js.map +1 -1
  124. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar.js +134 -109
  125. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar.js.map +1 -1
  126. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js +71 -13
  127. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js.map +1 -1
  128. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/chip/chip.js +662 -90
  129. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/chip/chip.js.map +1 -1
  130. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js +66 -13
  131. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialog.js.map +1 -1
  132. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-alert.js +12 -2
  133. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-alert.js.map +1 -1
  134. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-confirm.js +23 -3
  135. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-confirm.js.map +1 -1
  136. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-modal.js +26 -20
  137. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dialog/dialogs-manager/default-modal.js.map +1 -1
  138. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js +28 -6
  139. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js.map +1 -1
  140. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/flex/flex.js +56 -54
  141. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/flex/flex.js.map +1 -1
  142. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/form-helper-text/form-helper-text.js +28 -1
  143. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/form-helper-text/form-helper-text.js.map +1 -1
  144. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js +110 -21
  145. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js.map +1 -1
  146. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/input/form-input.js +105 -67
  147. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/input/form-input.js.map +1 -1
  148. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/input/input.js +199 -110
  149. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/input/input.js.map +1 -1
  150. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/loader/circle.js +10 -1
  151. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/loader/circle.js.map +1 -1
  152. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -1
  153. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js.map +1 -1
  154. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/factoryWithTypeCheckers.js +2 -2
  155. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/factoryWithTypeCheckers.js.map +1 -1
  156. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/index.js +2 -2
  157. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/node_modules/prop-types/index.js.map +1 -1
  158. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-down.js +2 -1
  159. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-down.js.map +1 -1
  160. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-left.js +2 -1
  161. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-left.js.map +1 -1
  162. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-right.js +2 -1
  163. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/chevron-right.js.map +1 -1
  164. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/close.js +4 -2
  165. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/close.js.map +1 -1
  166. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/search.js +4 -2
  167. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/packages/react-icons/dist/es/icons/search.js.map +1 -1
  168. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js +7 -5
  169. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js.map +1 -1
  170. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/select/select.js +144 -26
  171. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/select/select.js.map +1 -1
  172. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/stitches.config.js +22 -19
  173. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/stitches.config.js.map +1 -1
  174. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js +2 -2
  175. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js.map +1 -1
  176. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js +110 -15
  177. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/table/table.js.map +1 -1
  178. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js +10 -2
  179. package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js.map +1 -1
  180. package/dist/es/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +1 -1
  181. package/dist/es/node_modules/html-dom-parser/node_modules/domutils/lib/index.js +1 -1
  182. package/dist/es/node_modules/html-dom-parser/node_modules/htmlparser2/lib/index.js +1 -1
  183. package/dist/es/node_modules/style-to-js/cjs/index.js +1 -1
  184. package/dist/es/node_modules/style-to-object/cjs/index.js +1 -1
  185. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"split-button.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/button/split-button.js"],"sourcesContent":["import { jsx, jsxs, Fragment } from 'react/jsx-runtime';\nimport React__default, { forwardRef, Children, useContext, cloneElement } from 'react';\nimport { styled } from '../stitches.config.js';\nimport { Box } from '../box/box.js';\nimport { Button } from './button.js';\nimport { IconButton } from './icon-button.js';\nimport { SplitButtonContext } from './split-button-context.js';\n\nconst StyledSplitButtonContainer = styled(Box, {\n display: \"inline-flex\",\n position: \"relative\",\n alignItems: \"center\",\n whiteSpace: \"nowrap\"\n});\nconst StyledPrimaryButton = styled(Box, {\n \"button,a\": {\n borderEndEndRadius: 0,\n borderStartEndRadius: 0\n }\n});\nconst StyledSecondaryButton = styled(Box, {\n \"button,a\": {\n borderEndStartRadius: 0,\n borderStartStartRadius: 0\n },\n variants: {\n color: {\n primary: {\n \"button,a\": {\n borderLeft: \"1.5px solid $primary500\"\n }\n },\n secondary: {\n \"button,a\": {\n borderLeft: \"1.5px solid $secondary600\"\n }\n }\n },\n size: {\n xxs: {\n \"button,a\": {\n borderLeftWidth: \".8px\"\n }\n },\n xs: {\n \"button,a\": {\n borderLeftWidth: \".8px\"\n }\n },\n sm: {\n \"button,a\": {\n borderLeftWidth: \"1px\"\n }\n },\n md: {\n \"button,a\": {\n borderLeftWidth: \"1px\"\n }\n },\n lg: {\n \"button,a\": {\n borderLeftWidth: \"1.2px\"\n }\n },\n xl: {\n \"button,a\": {\n borderLeftWidth: \"1.5px\"\n }\n },\n \"2xl\": {\n \"button,a\": {\n borderLeftWidth: \"1.5px\"\n }\n }\n }\n }\n});\nconst ButtonContainer = ({ children }) => {\n const { color, disabled, size } = useContext(SplitButtonContext);\n if (React__default.isValidElement(children) && (children.type === Button || children.type === IconButton)) {\n return cloneElement(children, {\n color,\n disabled,\n size\n });\n }\n return /* @__PURE__ */ jsx(Fragment, { children });\n};\nconst SplitButtonContainer = forwardRef(({ children }, ref) => /* @__PURE__ */ jsx(StyledSplitButtonContainer, { ref, children }));\nconst SplitButton = forwardRef(\n ({\n children,\n disabled = false,\n color = \"primary\",\n size = \"md\"\n }, ref) => {\n if (Children.count(children) !== 2) {\n throw new Error(\"SplitButton component requires exactly two children\");\n }\n const [PrimaryAction, SecondaryAction] = Children.toArray(children);\n return /* @__PURE__ */ jsx(SplitButtonContext.Provider, { value: { color, disabled, size }, children: /* @__PURE__ */ jsxs(SplitButtonContainer, { ref, children: [\n /* @__PURE__ */ jsx(StyledPrimaryButton, { children: /* @__PURE__ */ jsx(ButtonContainer, { children: PrimaryAction }) }),\n /* @__PURE__ */ jsx(StyledSecondaryButton, { color, size, children: /* @__PURE__ */ jsx(ButtonContainer, { children: SecondaryAction }) })\n ] }) });\n }\n);\n\nexport { SplitButton, SplitButtonContainer };\n//# sourceMappingURL=split-button.js.map\n"],"names":[],"mappings":";;;;;;;;AAQA,MAAM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E;AACxC,MAAM,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;AAC7E,KAAK;AACL,IAAI,MAAM,CAAC,aAAa,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AACxE,IAAI,uBAAuB,GAAG,CAAC,kBAAkB,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,QAAQ,kBAAkB,IAAI,CAAC,oBAAoB,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE;AACtK,sBAAsB,GAAG,CAAC,mBAAmB,EAAE,EAAE,QAAQ,kBAAkB,GAAG,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;AAC/H,sBAAsB,GAAG,CAAC,qBAAqB,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,kBAAkB,GAAG,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,EAAE,CAAC;AAChJ,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AACZ,GAAG;AACH;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"split-button.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/button/split-button.js"],"sourcesContent":["import { jsx, jsxs, Fragment } from 'react/jsx-runtime';\nimport React__default, { forwardRef, Children, useContext, cloneElement } from 'react';\nimport { styled } from '../stitches.config.js';\nimport { Box } from '../box/box.js';\nimport { Button } from './button.js';\nimport { IconButton } from './icon-button.js';\nimport { SplitButtonContext } from './split-button-context.js';\n\nconst StyledSplitButtonContainer = styled(Box, {\n display: \"inline-flex\",\n position: \"relative\",\n alignItems: \"center\",\n whiteSpace: \"nowrap\"\n});\nconst StyledSecondaryButton = styled(Box, {\n \"button,a\": {\n borderEndStartRadius: 0,\n borderStartStartRadius: 0,\n \"&:not(:disabled):hover, &:active, &:focus\": {\n borderLeftColor: \"transparent\"\n }\n },\n variants: {\n color: {\n primary: {\n \"button,a\": {\n borderLeft: \"1.5px solid $primary600\"\n }\n },\n secondary: {\n \"button,a\": {\n borderLeft: \"1.5px solid $secondary600\"\n }\n },\n default: {\n \"button,a\": {\n borderLeft: \"1.5px solid $secondary400\",\n borderColorOpacity: [\"$secondary500\", 0.2]\n }\n },\n light: {\n \"button,a\": {\n borderLeft: \"1.5px solid $white300\"\n }\n },\n error: {\n \"button,a\": {\n borderLeft: \"1.5px solid $negative200\"\n }\n }\n },\n size: {\n xxs: {\n \"button,a\": {\n borderLeftWidth: \".8px\"\n }\n },\n xs: {\n \"button,a\": {\n borderLeftWidth: \".8px\"\n }\n },\n sm: {\n \"button,a\": {\n borderLeftWidth: \"1px\"\n }\n },\n md: {\n \"button,a\": {\n borderLeftWidth: \"1px\"\n }\n },\n lg: {\n \"button,a\": {\n borderLeftWidth: \"1.2px\"\n }\n },\n xl: {\n \"button,a\": {\n borderLeftWidth: \"1.5px\"\n }\n },\n \"2xl\": {\n \"button,a\": {\n borderLeftWidth: \"1.5px\"\n }\n }\n }\n }\n});\nconst StyledPrimaryButton = styled(Box, {\n \"button,a\": {\n borderEndEndRadius: 0,\n borderStartEndRadius: 0\n },\n [`&:has(button:not(:disabled):hover, button:active, button:focus) + ${StyledSecondaryButton} button,\n &:has(a:not(:disabled):hover, a:active, a:focus) + ${StyledSecondaryButton} a`]: {\n borderLeftColor: \"transparent\"\n }\n});\nconst ButtonContainer = ({ children }) => {\n const { color, disabled, size } = useContext(SplitButtonContext);\n if (React__default.isValidElement(children) && (children.type === Button || children.type === IconButton)) {\n return cloneElement(children, {\n color,\n disabled,\n size\n });\n }\n return /* @__PURE__ */ jsx(Fragment, { children });\n};\nconst SplitButtonContainer = forwardRef(({ children }, ref) => /* @__PURE__ */ jsx(StyledSplitButtonContainer, { ref, children }));\nconst SplitButton = forwardRef(\n ({\n children,\n disabled = false,\n color = \"primary\",\n size = \"md\"\n }, ref) => {\n if (Children.count(children) !== 2) {\n throw new Error(\"SplitButton component requires exactly two children\");\n }\n const [PrimaryAction, SecondaryAction] = Children.toArray(children);\n return /* @__PURE__ */ jsx(SplitButtonContext.Provider, { value: { color, disabled, size }, children: /* @__PURE__ */ jsxs(SplitButtonContainer, { ref, children: [\n /* @__PURE__ */ jsx(StyledPrimaryButton, { children: /* @__PURE__ */ jsx(ButtonContainer, { children: PrimaryAction }) }),\n /* @__PURE__ */ jsx(StyledSecondaryButton, { color, size, children: /* @__PURE__ */ jsx(ButtonContainer, { children: SecondaryAction }) })\n ] }) });\n }\n);\n\nexport { SplitButton, SplitButtonContainer };\n//# sourceMappingURL=split-button.js.map\n"],"names":[],"mappings":";;;;;;;;AAQA,MAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,EAAE;AAC/C,EAAE,OAAO,EAAE,aAAa;AACxB,EAAE,QAAQ,EAAE,UAAU;AACtB,EAAE,UAAU,EAAE,QAAQ;AACtB,EAAE,UAAU,EAAE,QAAQ;AACtB,CAAC,CAAC,CAAC;AACH,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,EAAE;AAC1C,EAAE,UAAU,EAAE;AACd,IAAI,oBAAoB,EAAE,CAAC;AAC3B,IAAI,sBAAsB,EAAE,CAAC;AAC7B,IAAI,2CAA2C,EAAE;AACjD,MAAM,eAAe,EAAE,aAAa;AACpC,KAAK;AACL,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,KAAK,EAAE;AACX,MAAM,OAAO,EAAE;AACf,QAAQ,UAAU,EAAE;AACpB,UAAU,UAAU,EAAE,yBAAyB;AAC/C,SAAS;AACT,OAAO;AACP,MAAM,SAAS,EAAE;AACjB,QAAQ,UAAU,EAAE;AACpB,UAAU,UAAU,EAAE,2BAA2B;AACjD,SAAS;AACT,OAAO;AACP,MAAM,OAAO,EAAE;AACf,QAAQ,UAAU,EAAE;AACpB,UAAU,UAAU,EAAE,2BAA2B;AACjD,UAAU,kBAAkB,EAAE,CAAC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,CAAC,kBAAkB,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,QAAQ,kBAAkB,IAAI,CAAC,oBAAoB,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE;AACtK,sBAAsB,GAAG,CAAC,mBAAmB,EAAE,EAAE,QAAQ,kBAAkB,GAAG,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;AAC/H,sBAAsB,GAAG,CAAC,qBAAqB,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,kBAAkB,GAAG,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,EAAE,CAAC;AAChJ,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AACZ,GAAG;AACH;;;;","x_google_ignoreList":[0]}
@@ -1,3 +1,5 @@
1
+ import { prefixClassName } from '../utils/prefix-class-name.js';
2
+
1
3
  const buttonSizeToLineLoaderSizeMapping = {
2
4
  "2xl": {
3
5
  size: "lg"
@@ -70,7 +72,10 @@ const buttonVariantToLoaderVariantMapping = {
70
72
  light: "bright",
71
73
  error: "negative"
72
74
  };
73
- const getLoaderVariantFromButtonVariant = ({ color, variant }) => {
75
+ const getLoaderVariantFromButtonVariant = ({
76
+ color,
77
+ variant
78
+ }) => {
74
79
  const colorString = color;
75
80
  const variantString = variant;
76
81
  if (buttonVariantToLoaderVariantMapping[`${colorString}-${variantString}`]) {
@@ -78,6 +83,18 @@ const getLoaderVariantFromButtonVariant = ({ color, variant }) => {
78
83
  }
79
84
  return buttonVariantToLoaderVariantMapping[colorString];
80
85
  };
86
+ const BUTTON_CLASSNAMES = {
87
+ button: prefixClassName("button"),
88
+ iconContainer: prefixClassName("button__icon-container"),
89
+ iconBox: prefixClassName("button__icon-box"),
90
+ loader: prefixClassName("button__loader"),
91
+ content: prefixClassName("button__content"),
92
+ loading: prefixClassName("button--loading"),
93
+ disabled: prefixClassName("button--disabled"),
94
+ sideElement: prefixClassName("button__side-element"),
95
+ sideElementLoaderHidden: prefixClassName("button__side-element--loader-hidden"),
96
+ sideElementIconHidden: prefixClassName("button__side-element--icon-hidden")
97
+ };
81
98
 
82
- export { buttonVariantToLoaderVariantMapping, getLoaderIconSizeFromButtonProps, getLoaderVariantFromButtonVariant };
99
+ export { BUTTON_CLASSNAMES, buttonVariantToLoaderVariantMapping, getLoaderIconSizeFromButtonProps, getLoaderVariantFromButtonVariant };
83
100
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/button/utils.js"],"sourcesContent":["const buttonSizeToLineLoaderSizeMapping = {\n \"2xl\": {\n size: \"lg\"\n },\n xl: {\n size: \"md\",\n width: \"$5\"\n },\n lg: {\n size: \"sm\",\n width: \"$5\"\n },\n md: {\n size: \"sm\",\n width: \"$4\"\n },\n sm: {\n size: \"sm\",\n width: \"$4\"\n },\n xs: {\n size: \"sm\",\n width: \"$3\"\n },\n xxs: {\n size: \"sm\",\n width: \"$3\"\n }\n};\nconst buttonSizeToCircleLoaderSizeMapping = {\n \"2xl\": {\n size: \"lg\"\n },\n xl: {\n size: \"lg\"\n },\n lg: {\n size: \"lg\"\n },\n md: {\n size: \"md\"\n },\n sm: {\n size: \"sm\"\n },\n xs: {\n size: \"xs\"\n },\n xxs: {\n size: \"xs\"\n }\n};\nconst getLoaderIconSizeFromButtonProps = ({\n buttonSize,\n loaderType\n}) => {\n if (loaderType === \"circle\") {\n return buttonSizeToCircleLoaderSizeMapping[typeof buttonSize === \"string\" ? buttonSize : \"lg\"];\n }\n return buttonSizeToLineLoaderSizeMapping[typeof buttonSize === \"string\" ? buttonSize : \"lg\"];\n};\nconst buttonVariantToLoaderVariantMapping = {\n default: \"secondary\",\n bright: \"secondary\",\n primary: \"primary\",\n \"primary-solid\": \"bright\",\n secondary: \"bright\",\n \"secondary-outline\": \"secondary\",\n \"secondary-ghost\": \"secondary\",\n light: \"bright\",\n error: \"negative\"\n};\nconst getLoaderVariantFromButtonVariant = ({ color, variant }) => {\n const colorString = color;\n const variantString = variant;\n if (buttonVariantToLoaderVariantMapping[`${colorString}-${variantString}`]) {\n return buttonVariantToLoaderVariantMapping[`${colorString}-${variantString}`];\n }\n return buttonVariantToLoaderVariantMapping[colorString];\n};\n\nexport { buttonVariantToLoaderVariantMapping, getLoaderIconSizeFromButtonProps, getLoaderVariantFromButtonVariant };\n//# sourceMappingURL=utils.js.map\n"],"names":[],"mappings":"AAAA,MAAM,iCAAiC,GAAG;AAC1C,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,IAAI;AACd,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,CAAC,CAAC;AACF,MAAM,mCAAmC,GAAG;AAC5C,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,IAAI;AACd,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,GA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W,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;AAClF,GAAG;AACH,EAAE,OAAO,mCAAmC,CAAC,WAAW,CAAC,CAAC;AAC1D;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/button/utils.js"],"sourcesContent":["import { prefixClassName } from '../utils/prefix-class-name.js';\n\nconst buttonSizeToLineLoaderSizeMapping = {\n \"2xl\": {\n size: \"lg\"\n },\n xl: {\n size: \"md\",\n width: \"$5\"\n },\n lg: {\n size: \"sm\",\n width: \"$5\"\n },\n md: {\n size: \"sm\",\n width: \"$4\"\n },\n sm: {\n size: \"sm\",\n width: \"$4\"\n },\n xs: {\n size: \"sm\",\n width: \"$3\"\n },\n xxs: {\n size: \"sm\",\n width: \"$3\"\n }\n};\nconst buttonSizeToCircleLoaderSizeMapping = {\n \"2xl\": {\n size: \"lg\"\n },\n xl: {\n size: \"lg\"\n },\n lg: {\n size: \"lg\"\n },\n md: {\n size: \"md\"\n },\n sm: {\n size: \"sm\"\n },\n xs: {\n size: \"xs\"\n },\n xxs: {\n size: \"xs\"\n }\n};\nconst getLoaderIconSizeFromButtonProps = ({\n buttonSize,\n loaderType\n}) => {\n if (loaderType === \"circle\") {\n return buttonSizeToCircleLoaderSizeMapping[typeof buttonSize === \"string\" ? buttonSize : \"lg\"];\n }\n return buttonSizeToLineLoaderSizeMapping[typeof buttonSize === \"string\" ? buttonSize : \"lg\"];\n};\nconst buttonVariantToLoaderVariantMapping = {\n default: \"secondary\",\n bright: \"secondary\",\n primary: \"primary\",\n \"primary-solid\": \"bright\",\n secondary: \"bright\",\n \"secondary-outline\": \"secondary\",\n \"secondary-ghost\": \"secondary\",\n light: \"bright\",\n error: \"negative\"\n};\nconst getLoaderVariantFromButtonVariant = ({\n color,\n variant\n}) => {\n const colorString = color;\n const variantString = variant;\n if (buttonVariantToLoaderVariantMapping[`${colorString}-${variantString}`]) {\n return buttonVariantToLoaderVariantMapping[`${colorString}-${variantString}`];\n }\n return buttonVariantToLoaderVariantMapping[colorString];\n};\nconst BUTTON_CLASSNAMES = {\n button: prefixClassName(\"button\"),\n iconContainer: prefixClassName(\"button__icon-container\"),\n iconBox: prefixClassName(\"button__icon-box\"),\n loader: prefixClassName(\"button__loader\"),\n content: prefixClassName(\"button__content\"),\n loading: prefixClassName(\"button--loading\"),\n disabled: prefixClassName(\"button--disabled\"),\n sideElement: prefixClassName(\"button__side-element\"),\n sideElementLoaderHidden: prefixClassName(\"button__side-element--loader-hidden\"),\n sideElementIconHidden: prefixClassName(\"button__side-element--icon-hidden\")\n};\n\nexport { BUTTON_CLASSNAMES, buttonVariantToLoaderVariantMapping, getLoaderIconSizeFromButtonProps, getLoaderVariantFromButtonVariant };\n//# sourceMappingURL=utils.js.map\n"],"names":[],"mappings":";;AAEA,MAAM,iCAAiC,GAAG;AAC1C,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,IAAI;AACd,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,EAAE,GAAG,EAAE;AACP,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,IAAI;AACf,GAAG;AACH,CAAC,CAAC;AACF,MAAM,mCAAmC,GAAG;AAC5C,EAAE,K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5B,EAAE,MAAM,aAAa,GAAG,OAAO,CAAC;AAChC,EAAE,IAAI,mCAAmC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE;AAC9E,IAAI,OAAO,mCAAmC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;AAClF,GAAG;AACH,EAAE,OAAO,mCAAmC,CAAC,WAAW,CAAC,CAAC;AAC1D,EAAE;AACG,MAAC,iBAAiB,GAAG;AAC1B,EAAE,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC;AACnC,EAAE,aAAa,EAAE,eAAe,CAAC,wBAAwB,CAAC;AAC1D,EAAE,OAAO,EAAE,eAAe,CAAC,kBAAkB,CAAC;AAC9C,EAAE,MAAM,EAAE,eAAe,CAAC,gBAAgB,CAAC;AAC3C,EAAE,OAAO,EAAE,eAAe,CAAC,iBAAiB,CAAC;AAC7C,EAAE,OAAO,EAAE,eAAe,CAAC,iBAAiB,CAAC;AAC7C,EAAE,QAAQ,EAAE,eAAe,CAAC,kBAAkB,CAAC;AAC/C,EAAE,WAAW,EAAE,eAAe,CAAC,sBAAsB,CAAC;AACtD,EAAE,uBAAuB,EAAE,eAAe,CAAC,qCAAqC,CAAC;AACjF,EAAE,qBAAqB,EAAE,eAAe,CAAC,mCAAmC,CAAC;AAC7E;;;;","x_google_ignoreList":[0]}
@@ -24,14 +24,23 @@ var __spreadValues = (a, b) => {
24
24
  return a;
25
25
  };
26
26
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27
- const CalendarCell = ({ state, date, currentMonth }) => {
27
+ const CalendarCell = ({
28
+ state,
29
+ date,
30
+ currentMonth,
31
+ onDaySelect
32
+ }) => {
28
33
  const ref = useRef(null);
29
34
  const {
30
35
  cellProps,
31
36
  buttonProps,
32
37
  isSelected,
33
38
  formattedDate
34
- } = $36a0ac60f04457c5$export$136073280381448e({ date }, state, ref);
39
+ } = $36a0ac60f04457c5$export$136073280381448e(
40
+ { date },
41
+ state,
42
+ ref
43
+ );
35
44
  const calendarContext = useCalendarContext();
36
45
  const isOutsideMonth = !$14e0f24ef4ac5c92$export$a18c89cbd24170ff(currentMonth, date);
37
46
  let isSelectionStart = false;
@@ -45,8 +54,8 @@ const CalendarCell = ({ state, date, currentMonth }) => {
45
54
  return /* @__PURE__ */ jsx(
46
55
  DayContainer,
47
56
  __spreadProps(__spreadValues({}, cellProps), {
48
- "data-selection-start": isSelectionStart,
49
- "data-selection-end": isSelectionEnd,
57
+ "data-selection-start": isSelectionStart && !isOutsideMonth,
58
+ "data-selection-end": isSelectionEnd && !isOutsideMonth,
50
59
  "data-in-range": isRangeCalendar && isSelected,
51
60
  children: /* @__PURE__ */ jsx(
52
61
  Day,
@@ -55,6 +64,13 @@ const CalendarCell = ({ state, date, currentMonth }) => {
55
64
  isHidden: isOutsideMonth,
56
65
  isSelected,
57
66
  size: calendarContext.size,
67
+ onClick: (e) => {
68
+ var _a;
69
+ (_a = buttonProps == null ? void 0 : buttonProps.onClick) == null ? void 0 : _a.call(buttonProps, e);
70
+ if (onDaySelect) {
71
+ onDaySelect(date);
72
+ }
73
+ },
58
74
  children: formattedDate
59
75
  })
60
76
  )
@@ -1 +1 @@
1
- {"version":3,"file":"calendar-cell.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-cell.js"],"sourcesContent":["import { jsx } from 'react/jsx-runtime';\nimport { isSameMonth as $14e0f24ef4ac5c92$export$a18c89cbd24170ff, isSameDay as $14e0f24ef4ac5c92$export$ea39ec197993aef0 } from '../node_modules/@internationalized/date/dist/import.js';\nimport { useRef } from 'react';\nimport { DayContainer, Day } from './calendar-day.js';\nimport { useCalendarContext } from './calendar-utils.js';\nimport { useCalendarCell as $36a0ac60f04457c5$export$136073280381448e } from '../node_modules/@react-aria/calendar/dist/import.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nconst CalendarCell = ({ state, date, currentMonth }) => {\n const ref = useRef(null);\n const {\n cellProps,\n buttonProps,\n isSelected,\n formattedDate\n } = $36a0ac60f04457c5$export$136073280381448e({ date }, state, ref);\n const calendarContext = useCalendarContext();\n const isOutsideMonth = !$14e0f24ef4ac5c92$export$a18c89cbd24170ff(currentMonth, date);\n let isSelectionStart = false;\n let isSelectionEnd = false;\n let isRangeCalendar = false;\n if (\"highlightedRange\" in state && state.highlightedRange) {\n isSelectionStart = $14e0f24ef4ac5c92$export$ea39ec197993aef0(date, state.highlightedRange.start);\n isSelectionEnd = $14e0f24ef4ac5c92$export$ea39ec197993aef0(date, state.highlightedRange.end);\n isRangeCalendar = true;\n }\n return /* @__PURE__ */ jsx(\n DayContainer,\n __spreadProps(__spreadValues({}, cellProps), {\n \"data-selection-start\": isSelectionStart,\n \"data-selection-end\": isSelectionEnd,\n \"data-in-range\": isRangeCalendar && isSelected,\n children: /* @__PURE__ */ jsx(\n Day,\n __spreadProps(__spreadValues({}, buttonProps), {\n ref,\n isHidden: isOutsideMonth,\n isSelected,\n size: calendarContext.size,\n children: formattedDate\n })\n )\n })\n );\n};\n\nexport { CalendarCell };\n//# sourceMappingURL=calendar-cell.js.map\n"],"names":[],"m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,QAAQ,GAAG;AACX,QAAQ,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE;AACvD,UAAU,GAAG;AACb,UAAU,QAAQ,EAAE,cAAc;AAClC,UAAU,UAAU;AACpB,UAAU,IAAI,EAAE,eAAe,CAAC,IAAI;AACpC,UAAU,QAAQ,EAAE,aAAa;AACjC,SAAS,CAAC;AACV,OAAO;AACP,KAAK,CAAC;AACN,GAAG,CAAC;AACJ;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"calendar-cell.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-cell.js"],"sourcesContent":["import { jsx } from 'react/jsx-runtime';\nimport { isSameMonth as $14e0f24ef4ac5c92$export$a18c89cbd24170ff, isSameDay as $14e0f24ef4ac5c92$export$ea39ec197993aef0 } from '../node_modules/@internationalized/date/dist/import.js';\nimport { useRef } from 'react';\nimport { DayContainer, Day } from './calendar-day.js';\nimport { useCalendarContext } from './calendar-utils.js';\nimport { useCalendarCell as $36a0ac60f04457c5$export$136073280381448e } from '../node_modules/@react-aria/calendar/dist/import.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nconst CalendarCell = ({\n state,\n date,\n currentMonth,\n onDaySelect\n}) => {\n const ref = useRef(null);\n const {\n cellProps,\n buttonProps,\n isSelected,\n formattedDate\n } = $36a0ac60f04457c5$export$136073280381448e(\n { date },\n state,\n ref\n );\n const calendarContext = useCalendarContext();\n const isOutsideMonth = !$14e0f24ef4ac5c92$export$a18c89cbd24170ff(currentMonth, date);\n let isSelectionStart = false;\n let isSelectionEnd = false;\n let isRangeCalendar = false;\n if (\"highlightedRange\" in state && state.highlightedRange) {\n isSelectionStart = $14e0f24ef4ac5c92$export$ea39ec197993aef0(date, state.highlightedRange.start);\n isSelectionEnd = $14e0f24ef4ac5c92$export$ea39ec197993aef0(date, state.highlightedRange.end);\n isRangeCalendar = true;\n }\n return /* @__PURE__ */ jsx(\n DayContainer,\n __spreadProps(__spreadValues({}, cellProps), {\n \"data-selection-start\": isSelectionStart && !isOutsideMonth,\n \"data-selection-end\": isSelectionEnd && !isOutsideMonth,\n \"data-in-range\": isRangeCalendar && isSelected,\n children: /* @__PURE__ */ jsx(\n Day,\n __spreadProps(__spreadValues({}, buttonProps), {\n ref,\n isHidden: isOutsideMonth,\n isSelected,\n size: calendarContext.size,\n onClick: (e) => {\n var _a;\n (_a = buttonProps == null ? void 0 : buttonProps.onClick) == null ? void 0 : _a.call(buttonProps, e);\n if (onDaySelect) {\n onDaySelect(date);\n }\n },\n children: formattedDate\n })\n )\n })\n );\n};\n\nexport { CalendarCell };\n//# sourceMappingURL=calendar-cell.js.map\n"],"names":[],"mappings":";;;;;;;AAOA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,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CAAC,CAAC,KAAK;AAC1B,YAAY,IAAI,EAAE,CAAC;AACnB,YAAY,CAAC,EAAE,GAAG,WAAW,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,WAAW,CAAC,OAAO,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;AACjH,YAAY,IAAI,WAAW,EAAE;AAC7B,cAAc,WAAW,CAAC,IAAI,CAAC,CAAC;AAChC,aAAa;AACb,WAAW;AACX,UAAU,QAAQ,EAAE,aAAa;AACjC,SAAS,CAAC;AACV,OAAO;AACP,KAAK,CAAC;AACN,GAAG,CAAC;AACJ;;;;","x_google_ignoreList":[0]}
@@ -32,7 +32,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
32
32
  const CalendarGrid = ({
33
33
  state,
34
34
  offset = {},
35
- containerCSS = {}
35
+ containerCSS = {},
36
+ onDaySelect
36
37
  }) => {
37
38
  const { locale } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
38
39
  const id = useId();
@@ -47,7 +48,7 @@ const CalendarGrid = ({
47
48
  },
48
49
  state
49
50
  );
50
- const weeksInMonth = $14e0f24ef4ac5c92$export$ccc1b2479e7dd654(state.visibleRange.start, locale);
51
+ const weeksInMonth = $14e0f24ef4ac5c92$export$ccc1b2479e7dd654(startDate, locale);
51
52
  return /* @__PURE__ */ jsxs(
52
53
  GridContainer,
53
54
  __spreadProps(__spreadValues({
@@ -74,7 +75,8 @@ const CalendarGrid = ({
74
75
  {
75
76
  state,
76
77
  date,
77
- currentMonth: startDate
78
+ currentMonth: startDate,
79
+ onDaySelect
78
80
  },
79
81
  `twigs-calendar-cell-${date}-${id}`
80
82
  ) : null) }, `weekIndex-${startDate}-${id}-${index}`)
@@ -1 +1 @@
1
- {"version":3,"file":"calendar-grid.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-grid.js"],"sourcesContent":["import { jsxs, jsx } from 'react/jsx-runtime';\nimport { endOfMonth as $14e0f24ef4ac5c92$export$a2258d9c4118825c, getWeeksInMonth as $14e0f24ef4ac5c92$export$ccc1b2479e7dd654 } from '../node_modules/@internationalized/date/dist/import.js';\nimport { useId } from 'react';\nimport { Box } from '../box/box.js';\nimport { CalendarCell } from './calendar-cell.js';\nimport { DaysContainer } from './calendar-day.js';\nimport { WeekContainer, Week } from './calendar-week.js';\nimport { GridContainer } from './calendar-commons.js';\nimport { useCalendarContext } from './calendar-utils.js';\nimport { useCalendarGrid as $e3031d1f8c9d64eb$export$cb95147730a423f5 } from '../node_modules/@react-aria/calendar/dist/import.js';\nimport { useLocale as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from '../node_modules/@react-aria/i18n/dist/real-module.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nconst CalendarGrid = ({\n state,\n offset = {},\n containerCSS = {}\n}) => {\n const { locale } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();\n const id = useId();\n const calendarContext = useCalendarContext();\n const startDate = state.visibleRange.start.add(offset);\n const endDate = $14e0f24ef4ac5c92$export$a2258d9c4118825c(startDate);\n const { gridProps, headerProps, weekDays } = $e3031d1f8c9d64eb$export$cb95147730a423f5(\n {\n startDate,\n endDate,\n weekdayStyle: \"short\"\n },\n state\n );\n const weeksInMonth = $14e0f24ef4ac5c92$export$ccc1b2479e7dd654(state.visibleRange.start, locale);\n return /* @__PURE__ */ jsxs(\n GridContainer,\n __spreadProps(__spreadValues({\n calendarSize: calendarContext.size\n }, gridProps), {\n css: containerCSS,\n children: [\n /* @__PURE__ */ jsx(WeekContainer, __spreadProps(__spreadValues({}, headerProps), { calendarSize: calendarContext.size, children: weekDays.map((day, index) => (\n // eslint-disable-next-line react/no-array-index-key\n /* @__PURE__ */ jsx(Week, { children: day.substring(0, 2) }, `twigs-calendar-grid-${day}-${startDate}-${id}-${index}`)\n )) })),\n /* @__PURE__ */ jsx(\n Box,\n {\n css: __spreadValues({\n padding: \"$8 0\"\n }, calendarContext.size === \"lg\" && {\n paddingBottom: \"$4\"\n }),\n children: [...new Array(weeksInMonth).keys()].map((weekIndex, index) => (\n // eslint-disable-next-line react/no-array-index-key\n /* @__PURE__ */ jsx(DaysContainer, { children: state.getDatesInWeek(weekIndex, startDate).map((date) => date ? /* @__PURE__ */ jsx(\n CalendarCell,\n {\n state,\n date,\n currentMonth: startDate\n },\n `twigs-calendar-cell-${date}-${id}`\n ) : null) }, `weekIndex-${startDate}-${id}-${index}`)\n ))\n }\n )\n ]\n })\n );\n};\n\nexport { CalendarGrid };\n//# sourceMappingURL=calendar-grid.js.map\n"],"names":[],"mappings":";;;;;;;;;;;;AAYA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBA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ACV,YAAY,GAAG,EAAE,cAAc,CAAC;AAChC,cAAc,OAAO,EAAE,MAAM;AAC7B,aAAa,EAAE,eAAe,CAAC,IAAI,KAAK,IAAI,IAAI;AAChD,cAAc,aAAa,EAAE,IAAI;AACjC,aAAa,CAAC;AACd,YAAY,QAAQ,EAAE,CAAC,GAAG,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,KAAK;AAC/E;AACA,8BAA8B,GAAG,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,mBAAmB,GAAG;AAChJ,gBAAgB,YAAY;AAC5B,gBAAgB;AAChB,kBAAkB,KAAK;AACvB,kBAAkB,IAAI;AACtB,kBAAkB,YAAY,EAAE,SAAS;AACzC,iBAAiB;AACjB,gBAAgB,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACnD,eAAe,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AACnE,aAAa,CAAC;AACd,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK,CAAC;AACN,GAAG,CAAC;AACJ;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"calendar-grid.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-grid.js"],"sourcesContent":["import { jsxs, jsx } from 'react/jsx-runtime';\nimport { endOfMonth as $14e0f24ef4ac5c92$export$a2258d9c4118825c, getWeeksInMonth as $14e0f24ef4ac5c92$export$ccc1b2479e7dd654 } from '../node_modules/@internationalized/date/dist/import.js';\nimport { useId } from 'react';\nimport { Box } from '../box/box.js';\nimport { CalendarCell } from './calendar-cell.js';\nimport { DaysContainer } from './calendar-day.js';\nimport { WeekContainer, Week } from './calendar-week.js';\nimport { GridContainer } from './calendar-commons.js';\nimport { useCalendarContext } from './calendar-utils.js';\nimport { useCalendarGrid as $e3031d1f8c9d64eb$export$cb95147730a423f5 } from '../node_modules/@react-aria/calendar/dist/import.js';\nimport { useLocale as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from '../node_modules/@react-aria/i18n/dist/real-module.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nconst CalendarGrid = ({\n state,\n offset = {},\n containerCSS = {},\n onDaySelect\n}) => {\n const { locale } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();\n const id = useId();\n const calendarContext = useCalendarContext();\n const startDate = state.visibleRange.start.add(offset);\n const endDate = $14e0f24ef4ac5c92$export$a2258d9c4118825c(startDate);\n const { gridProps, headerProps, weekDays } = $e3031d1f8c9d64eb$export$cb95147730a423f5(\n {\n startDate,\n endDate,\n weekdayStyle: \"short\"\n },\n state\n );\n const weeksInMonth = $14e0f24ef4ac5c92$export$ccc1b2479e7dd654(startDate, locale);\n return /* @__PURE__ */ jsxs(\n GridContainer,\n __spreadProps(__spreadValues({\n calendarSize: calendarContext.size\n }, gridProps), {\n css: containerCSS,\n children: [\n /* @__PURE__ */ jsx(WeekContainer, __spreadProps(__spreadValues({}, headerProps), { calendarSize: calendarContext.size, children: weekDays.map((day, index) => (\n // eslint-disable-next-line react/no-array-index-key\n /* @__PURE__ */ jsx(Week, { children: day.substring(0, 2) }, `twigs-calendar-grid-${day}-${startDate}-${id}-${index}`)\n )) })),\n /* @__PURE__ */ jsx(\n Box,\n {\n css: __spreadValues({\n padding: \"$8 0\"\n }, calendarContext.size === \"lg\" && {\n paddingBottom: \"$4\"\n }),\n children: [...new Array(weeksInMonth).keys()].map((weekIndex, index) => (\n // eslint-disable-next-line react/no-array-index-key\n /* @__PURE__ */ jsx(DaysContainer, { children: state.getDatesInWeek(weekIndex, startDate).map((date) => date ? /* @__PURE__ */ jsx(\n CalendarCell,\n {\n state,\n date,\n currentMonth: startDate,\n onDaySelect\n },\n `twigs-calendar-cell-${date}-${id}`\n ) : null) }, `weekIndex-${startDate}-${id}-${index}`)\n ))\n }\n )\n ]\n })\n );\n};\n\nexport { CalendarGrid };\n//# sourceMappingURL=calendar-grid.js.map\n"],"names":[],"mappings":";;;;;;;;;;;;AAYA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EA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,KAAK,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,KAAK;AAC/E;AACA,8BAA8B,GAAG,CAAC,aAAa,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,mBAAmB,GAAG;AAChJ,gBAAgB,YAAY;AAC5B,gBAAgB;AAChB,kBAAkB,KAAK;AACvB,kBAAkB,IAAI;AACtB,kBAAkB,YAAY,EAAE,SAAS;AACzC,kBAAkB,WAAW;AAC7B,iBAAiB;AACjB,gBAAgB,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACnD,eAAe,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AACnE,aAAa,CAAC;AACd,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK,CAAC;AACN,GAAG,CAAC;AACJ;;;;","x_google_ignoreList":[0]}
@@ -30,6 +30,7 @@ var __spreadValues = (a, b) => {
30
30
  const CalendarMonthsView = ({
31
31
  state,
32
32
  range,
33
+ onMonthSelect,
33
34
  setCurrentCalendarView
34
35
  }) => {
35
36
  const monthFormatter = $896ba0a80a8f4d36$export$85fd5fdf27bacc79({
@@ -65,7 +66,7 @@ const CalendarMonthsView = ({
65
66
  if (!containerRef.current)
66
67
  return;
67
68
  const currentMonth = containerRef.current.querySelector(
68
- `button[data-monthId="${dateValue.month}"]`
69
+ `button[data-month-id="${dateValue == null ? void 0 : dateValue.month}"]`
69
70
  );
70
71
  if (currentMonth) {
71
72
  currentMonth.focus();
@@ -107,6 +108,41 @@ const CalendarMonthsView = ({
107
108
  }
108
109
  }
109
110
  };
111
+ const getButtonTabIndex = (index, month) => {
112
+ if (dateValue == null ? void 0 : dateValue.month) {
113
+ return dateValue.month === month ? 0 : -1;
114
+ }
115
+ return index === 0 ? 0 : -1;
116
+ };
117
+ const isButtonDisabled = (date) => {
118
+ if (!state.minValue && !state.maxValue)
119
+ return false;
120
+ if (state.minValue && date.year === state.minValue.year && date.month < state.minValue.month) {
121
+ return true;
122
+ }
123
+ if (state.maxValue && date.year === state.maxValue.year && date.month > state.maxValue.month) {
124
+ return true;
125
+ }
126
+ return false;
127
+ };
128
+ const handleMonthSelect = (date) => {
129
+ let updatedDate = date.set({});
130
+ if (state.isInvalid(date)) {
131
+ if (state.minValue && date.day < state.minValue.day) {
132
+ updatedDate = updatedDate.set({ day: state.minValue.day });
133
+ } else if (state.maxValue && date.day > state.maxValue.day) {
134
+ updatedDate = updatedDate.set({ day: state.maxValue.day });
135
+ }
136
+ }
137
+ if (!range) {
138
+ state.selectDate(updatedDate);
139
+ }
140
+ state.setFocusedDate(updatedDate);
141
+ if (onMonthSelect) {
142
+ onMonthSelect(updatedDate);
143
+ }
144
+ setCurrentCalendarView(CALENDAR_VIEW.GRID);
145
+ };
110
146
  return /* @__PURE__ */ jsxs(
111
147
  Box,
112
148
  {
@@ -145,25 +181,19 @@ const CalendarMonthsView = ({
145
181
  children: months.map((month, i) => /* @__PURE__ */ jsx(
146
182
  Button,
147
183
  {
148
- color: dateValue.month === month.date.month ? "default" : "bright",
149
- "data-monthId": month.date.month,
150
- tabIndex: dateValue.month === month.date.month ? 0 : -1,
151
- disabled: state.isInvalid(month.date),
184
+ color: (dateValue == null ? void 0 : dateValue.month) === month.date.month ? "default" : "bright",
185
+ "data-month-id": month.date.month,
186
+ tabIndex: getButtonTabIndex(i, month.date.month),
187
+ disabled: isButtonDisabled(month.date),
152
188
  css: __spreadValues({
153
189
  padding: "$6",
154
190
  height: CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT[calendarContext.size]
155
- }, dateValue.month === month.date.month && {
191
+ }, (dateValue == null ? void 0 : dateValue.month) === month.date.month && {
156
192
  color: "$secondary600"
157
193
  }),
158
194
  onKeyDown: (e) => handleKeyDown(e, i),
159
195
  size: calendarContext.size,
160
- onClick: () => {
161
- if (!range) {
162
- state.selectDate(month.date);
163
- }
164
- state.setFocusedDate(month.date);
165
- setCurrentCalendarView(CALENDAR_VIEW.GRID);
166
- },
196
+ onClick: () => handleMonthSelect(month.date),
167
197
  children: month.label
168
198
  },
169
199
  month.label
@@ -1 +1 @@
1
- {"version":3,"file":"calendar-months-view.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js"],"sourcesContent":["import { jsxs, jsx } from 'react/jsx-runtime';\nimport { useId, useMemo, useRef, useEffect } from 'react';\nimport { Box } from '../box/box.js';\nimport { Button } from '../button/button.js';\nimport '../button/icon-button.js';\nimport '../button/split-button.js';\nimport { Text } from '../text/text.js';\nimport { CALENDAR_VIEW } from './calendar.js';\nimport { MonthYearGridContainer } from './calendar-commons.js';\nimport { CalendarHeader } from './calendar-header.js';\nimport { useCalendarContext, CALENDAR_SIZE_TO_WIDTH, CALENDAR_SIZE_TO_FONT_SIZE, CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT } from './calendar-utils.js';\nimport { useDateFormatter as $896ba0a80a8f4d36$export$85fd5fdf27bacc79 } from '../node_modules/@react-aria/i18n/dist/real-module.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nconst CalendarMonthsView = ({\n state,\n range,\n setCurrentCalendarView\n}) => {\n const monthFormatter = $896ba0a80a8f4d36$export$85fd5fdf27bacc79({\n month: \"short\",\n timeZone: state.timeZone\n });\n const monthsContainerId = useId();\n const calendarContext = useCalendarContext();\n const dateValue = useMemo(() => {\n var _a;\n if (range && ((_a = state.value) == null ? void 0 : _a[range])) {\n return state.value[range];\n }\n return state.value;\n }, [state, range]);\n const months = useMemo(() => {\n const data = [];\n const numMonths = state.focusedDate.calendar.getMonthsInYear(\n state.focusedDate\n );\n for (let i = 1; i <= numMonths; i++) {\n const date = state.focusedDate.set({ month: i });\n data.push({\n date,\n label: monthFormatter.format(date.toDate(state.timeZone))\n });\n }\n return data;\n }, []);\n const containerRef = useRef(null);\n useEffect(() => {\n setTimeout(() => {\n if (!containerRef.current)\n return;\n const currentMonth = containerRef.current.querySelector(\n `button[data-monthId=\"${dateValue.month}\"]`\n );\n if (currentMonth) {\n currentMonth.focus();\n }\n }, 200);\n }, []);\n const handleKeyDown = (e, index) => {\n if (e.key === \"ArrowRight\") {\n e.preventDefault();\n e.stopPropagation();\n const nextMonth = months[index + 1];\n if (nextMonth && !state.isInvalid(nextMonth.date)) {\n const date = state.focusedDate.set({\n month: nextMonth.date.month\n });\n state.setFocusedDate(date);\n const nextButton = e.currentTarget.nextElementSibling;\n if (nextButton) {\n nextButton.setAttribute(\"tabindex\", \"0\");\n nextButton.focus();\n e.currentTarget.setAttribute(\"tabindex\", \"-1\");\n }\n }\n } else if (e.key === \"ArrowLeft\") {\n e.preventDefault();\n e.stopPropagation();\n const prevMonth = months[index - 1];\n if (prevMonth && !state.isInvalid(prevMonth.date)) {\n const date = state.focusedDate.set({\n month: prevMonth.date.month\n });\n state.setFocusedDate(date);\n const prevButton = e.currentTarget.previousElementSibling;\n if (prevButton) {\n prevButton.setAttribute(\"tabindex\", \"0\");\n prevButton.focus();\n e.currentTarget.setAttribute(\"tabindex\", \"-1\");\n }\n }\n }\n };\n return /* @__PURE__ */ jsxs(\n Box,\n {\n css: {\n minWidth: CALENDAR_SIZE_TO_WIDTH[calendarContext.size]\n },\n children: [\n /* @__PURE__ */ jsx(\n CalendarHeader,\n {\n calendarSize: calendarContext.size,\n css: {\n borderBottom: \"1px solid $neutral100\",\n justifyContent: \"center\"\n },\n children: /* @__PURE__ */ jsx(\n Text,\n {\n size: CALENDAR_SIZE_TO_FONT_SIZE[calendarContext.size],\n weight: \"bold\",\n css: {\n color: \"$neutral800\",\n padding: \"0 $6\"\n },\n children: \"Choose Month\"\n }\n )\n }\n ),\n /* @__PURE__ */ jsx(\n MonthYearGridContainer,\n {\n ref: containerRef,\n id: monthsContainerId,\n calendarSize: calendarContext.size,\n children: months.map((month, i) => /* @__PURE__ */ jsx(\n Button,\n {\n color: dateValue.month === month.date.month ? \"default\" : \"bright\",\n \"data-monthId\": month.date.month,\n tabIndex: dateValue.month === month.date.month ? 0 : -1,\n disabled: state.isInvalid(month.date),\n css: __spreadValues({\n padding: \"$6\",\n height: CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT[calendarContext.size]\n }, dateValue.month === month.date.month && {\n color: \"$secondary600\"\n }),\n onKeyDown: (e) => handleKeyDown(e, i),\n size: calendarContext.size,\n onClick: () => {\n if (!range) {\n state.selectDate(month.date);\n }\n state.setFocusedDate(month.date);\n setCurrentCalendarView(CALENDAR_VIEW.GRID);\n },\n children: month.label\n },\n month.label\n ))\n }\n )\n ]\n }\n );\n};\n\nexport { CalendarMonthsView };\n//# sourceMappingURL=calendar-months-view.js.map\n"],"names":[],"mappings":";;;;;;;;;;;;;AAaA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,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gBAAgB,IAAI,EAAE,eAAe,CAAC,IAAI;AAC1C,gBAAgB,OAAO,EAAE,MAAM;AAC/B,kBAAkB,IAAI,CAAC,KAAK,EAAE;AAC9B,oBAAoB,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACjD,mBAAmB;AACnB,kBAAkB,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACnD,kBAAkB,sBAAsB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AAC7D,iBAAiB;AACjB,gBAAgB,QAAQ,EAAE,KAAK,CAAC,KAAK;AACrC,eAAe;AACf,cAAc,KAAK,CAAC,KAAK;AACzB,aAAa,CAAC;AACd,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK;AACL,GAAG,CAAC;AACJ;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"calendar-months-view.js","sources":["../../../../../../../../../../node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar-months-view.js"],"sourcesContent":["import { jsxs, jsx } from 'react/jsx-runtime';\nimport { useId, useMemo, useRef, useEffect } from 'react';\nimport { Box } from '../box/box.js';\nimport { Button } from '../button/button.js';\nimport '../button/icon-button.js';\nimport '../button/split-button.js';\nimport { Text } from '../text/text.js';\nimport { CALENDAR_VIEW } from './calendar.js';\nimport { MonthYearGridContainer } from './calendar-commons.js';\nimport { CalendarHeader } from './calendar-header.js';\nimport { useCalendarContext, CALENDAR_SIZE_TO_WIDTH, CALENDAR_SIZE_TO_FONT_SIZE, CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT } from './calendar-utils.js';\nimport { useDateFormatter as $896ba0a80a8f4d36$export$85fd5fdf27bacc79 } from '../node_modules/@react-aria/i18n/dist/real-module.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nconst CalendarMonthsView = ({\n state,\n range,\n onMonthSelect,\n setCurrentCalendarView\n}) => {\n const monthFormatter = $896ba0a80a8f4d36$export$85fd5fdf27bacc79({\n month: \"short\",\n timeZone: state.timeZone\n });\n const monthsContainerId = useId();\n const calendarContext = useCalendarContext();\n const dateValue = useMemo(() => {\n var _a;\n if (range && ((_a = state.value) == null ? void 0 : _a[range])) {\n return state.value[range];\n }\n return state.value;\n }, [state, range]);\n const months = useMemo(() => {\n const data = [];\n const numMonths = state.focusedDate.calendar.getMonthsInYear(\n state.focusedDate\n );\n for (let i = 1; i <= numMonths; i++) {\n const date = state.focusedDate.set({ month: i });\n data.push({\n date,\n label: monthFormatter.format(date.toDate(state.timeZone))\n });\n }\n return data;\n }, []);\n const containerRef = useRef(null);\n useEffect(() => {\n setTimeout(() => {\n if (!containerRef.current)\n return;\n const currentMonth = containerRef.current.querySelector(\n `button[data-month-id=\"${dateValue == null ? void 0 : dateValue.month}\"]`\n );\n if (currentMonth) {\n currentMonth.focus();\n }\n }, 200);\n }, []);\n const handleKeyDown = (e, index) => {\n if (e.key === \"ArrowRight\") {\n e.preventDefault();\n e.stopPropagation();\n const nextMonth = months[index + 1];\n if (nextMonth && !state.isInvalid(nextMonth.date)) {\n const date = state.focusedDate.set({\n month: nextMonth.date.month\n });\n state.setFocusedDate(date);\n const nextButton = e.currentTarget.nextElementSibling;\n if (nextButton) {\n nextButton.setAttribute(\"tabindex\", \"0\");\n nextButton.focus();\n e.currentTarget.setAttribute(\"tabindex\", \"-1\");\n }\n }\n } else if (e.key === \"ArrowLeft\") {\n e.preventDefault();\n e.stopPropagation();\n const prevMonth = months[index - 1];\n if (prevMonth && !state.isInvalid(prevMonth.date)) {\n const date = state.focusedDate.set({\n month: prevMonth.date.month\n });\n state.setFocusedDate(date);\n const prevButton = e.currentTarget.previousElementSibling;\n if (prevButton) {\n prevButton.setAttribute(\"tabindex\", \"0\");\n prevButton.focus();\n e.currentTarget.setAttribute(\"tabindex\", \"-1\");\n }\n }\n }\n };\n const getButtonTabIndex = (index, month) => {\n if (dateValue == null ? void 0 : dateValue.month) {\n return dateValue.month === month ? 0 : -1;\n }\n return index === 0 ? 0 : -1;\n };\n const isButtonDisabled = (date) => {\n if (!state.minValue && !state.maxValue)\n return false;\n if (state.minValue && date.year === state.minValue.year && date.month < state.minValue.month) {\n return true;\n }\n if (state.maxValue && date.year === state.maxValue.year && date.month > state.maxValue.month) {\n return true;\n }\n return false;\n };\n const handleMonthSelect = (date) => {\n let updatedDate = date.set({});\n if (state.isInvalid(date)) {\n if (state.minValue && date.day < state.minValue.day) {\n updatedDate = updatedDate.set({ day: state.minValue.day });\n } else if (state.maxValue && date.day > state.maxValue.day) {\n updatedDate = updatedDate.set({ day: state.maxValue.day });\n }\n }\n if (!range) {\n state.selectDate(updatedDate);\n }\n state.setFocusedDate(updatedDate);\n if (onMonthSelect) {\n onMonthSelect(updatedDate);\n }\n setCurrentCalendarView(CALENDAR_VIEW.GRID);\n };\n return /* @__PURE__ */ jsxs(\n Box,\n {\n css: {\n minWidth: CALENDAR_SIZE_TO_WIDTH[calendarContext.size]\n },\n children: [\n /* @__PURE__ */ jsx(\n CalendarHeader,\n {\n calendarSize: calendarContext.size,\n css: {\n borderBottom: \"1px solid $neutral100\",\n justifyContent: \"center\"\n },\n children: /* @__PURE__ */ jsx(\n Text,\n {\n size: CALENDAR_SIZE_TO_FONT_SIZE[calendarContext.size],\n weight: \"bold\",\n css: {\n color: \"$neutral800\",\n padding: \"0 $6\"\n },\n children: \"Choose Month\"\n }\n )\n }\n ),\n /* @__PURE__ */ jsx(\n MonthYearGridContainer,\n {\n ref: containerRef,\n id: monthsContainerId,\n calendarSize: calendarContext.size,\n children: months.map((month, i) => /* @__PURE__ */ jsx(\n Button,\n {\n color: (dateValue == null ? void 0 : dateValue.month) === month.date.month ? \"default\" : \"bright\",\n \"data-month-id\": month.date.month,\n tabIndex: getButtonTabIndex(i, month.date.month),\n disabled: isButtonDisabled(month.date),\n css: __spreadValues({\n padding: \"$6\",\n height: CALENDAR_SIZE_TO_YEAR_MONTH_BTN_HEIGHT[calendarContext.size]\n }, (dateValue == null ? void 0 : dateValue.month) === month.date.month && {\n color: \"$secondary600\"\n }),\n onKeyDown: (e) => handleKeyDown(e, i),\n size: calendarContext.size,\n onClick: () => handleMonthSelect(month.date),\n children: month.label\n },\n month.label\n ))\n }\n )\n ]\n }\n );\n};\n\nexport { CalendarMonthsView };\n//# sourceMappingURL=calendar-months-view.js.map\n"],"names":[],"mappings":";;;;;;;;;;;;;AAaA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;A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KAAK,CAAC,IAAI,CAAC;AACtD,gBAAgB,GAAG,EAAE,cAAc,CAAC;AACpC,kBAAkB,OAAO,EAAE,IAAI;AAC/B,kBAAkB,MAAM,EAAE,sCAAsC,CAAC,eAAe,CAAC,IAAI,CAAC;AACtF,iBAAiB,EAAE,CAAC,SAAS,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,SAAS,CAAC,KAAK,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI;AAC1F,kBAAkB,KAAK,EAAE,eAAe;AACxC,iBAAiB,CAAC;AAClB,gBAAgB,SAAS,EAAE,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC;AACrD,gBAAgB,IAAI,EAAE,eAAe,CAAC,IAAI;AAC1C,gBAAgB,OAAO,EAAE,MAAM,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC;AAC5D,gBAAgB,QAAQ,EAAE,KAAK,CAAC,KAAK;AACrC,eAAe;AACf,cAAc,KAAK,CAAC,KAAK;AACzB,aAAa,CAAC;AACd,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK;AACL,GAAG,CAAC;AACJ;;;;","x_google_ignoreList":[0]}
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { toCalendarDateTime as $11d87f3f76e88657$export$b21e0b124e224484, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f, ZonedDateTime as $35ea8db9cb2ccb90$export$d3b7288e7994edea } from '../node_modules/@internationalized/date/dist/import.js';
2
+ import { today as $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3, getLocalTimeZone as $14e0f24ef4ac5c92$export$aa8b41735afcabd2, toCalendarDateTime as $11d87f3f76e88657$export$b21e0b124e224484, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f, ZonedDateTime as $35ea8db9cb2ccb90$export$d3b7288e7994edea } from '../node_modules/@internationalized/date/dist/import.js';
3
3
  import { useState, useMemo, useRef, useEffect } from 'react';
4
4
  import { Button } from '../button/button.js';
5
5
  import '../button/icon-button.js';
@@ -9,7 +9,6 @@ import { Popover, PopoverTrigger, PopoverContent } from '../popover/popover.js';
9
9
  import { styled } from '../stitches.config.js';
10
10
  import { Text } from '../text/text.js';
11
11
  import { FieldButton } from './calendar-commons.js';
12
- import { useCalendarContext } from './calendar-utils.js';
13
12
  import { ChevronDownIcon } from '../packages/react-icons/dist/es/icons/chevron-down.js';
14
13
 
15
14
  var __defProp = Object.defineProperty;
@@ -30,21 +29,24 @@ var __spreadValues = (a, b) => {
30
29
  };
31
30
  const CalendarTimePicker = ({
32
31
  value,
33
- calendarState,
34
- onChange
32
+ onChange,
33
+ size,
34
+ renderCustomTrigger
35
35
  }) => {
36
+ const [localDateValue, setLocalDateValue] = useState($14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2()));
37
+ const dateValue = value != null ? value : localDateValue;
36
38
  const [popoverOpen, setPopoverOpen] = useState(false);
37
- const calendarContext = useCalendarContext();
38
39
  const timeState = useMemo(() => {
39
- if (!value) {
40
- const timeObj = $11d87f3f76e88657$export$b21e0b124e224484(calendarState.value);
40
+ if (!dateValue) {
41
+ const calendarDate = $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2());
42
+ const timeObj = $11d87f3f76e88657$export$b21e0b124e224484(calendarDate);
41
43
  return timeObj;
42
44
  }
43
- if (value instanceof $35ea8db9cb2ccb90$export$ca871e8dbb80966f || value instanceof $35ea8db9cb2ccb90$export$d3b7288e7994edea) {
44
- return value;
45
+ if (dateValue instanceof $35ea8db9cb2ccb90$export$ca871e8dbb80966f || dateValue instanceof $35ea8db9cb2ccb90$export$d3b7288e7994edea) {
46
+ return dateValue;
45
47
  }
46
- return $11d87f3f76e88657$export$b21e0b124e224484(value);
47
- }, [value]);
48
+ return $11d87f3f76e88657$export$b21e0b124e224484(dateValue);
49
+ }, [dateValue]);
48
50
  const hoursInTwelveHourFormat = timeState.hour % 12 || 12;
49
51
  const initialHours = hoursInTwelveHourFormat.toString().padStart(2, "0");
50
52
  const initialMinutes = timeState.minute.toString().padStart(2, "0");
@@ -92,7 +94,7 @@ const CalendarTimePicker = ({
92
94
  }
93
95
  case "ArrowLeft": {
94
96
  e.preventDefault();
95
- if (parentColumn && parentColumn.previousElementSibling) {
97
+ if (parentColumn == null ? void 0 : parentColumn.previousElementSibling) {
96
98
  const prevColumn = parentColumn.previousElementSibling.querySelector(
97
99
  '[data-is-selected="true"]'
98
100
  );
@@ -105,7 +107,7 @@ const CalendarTimePicker = ({
105
107
  }
106
108
  case "ArrowRight": {
107
109
  e.preventDefault();
108
- if (parentColumn && parentColumn.nextElementSibling) {
110
+ if (parentColumn == null ? void 0 : parentColumn.nextElementSibling) {
109
111
  const nextColumn = parentColumn.nextElementSibling.querySelector(
110
112
  '[data-is-selected="true"]'
111
113
  );
@@ -120,20 +122,21 @@ const CalendarTimePicker = ({
120
122
  };
121
123
  const handleApply = () => {
122
124
  const updatedTime = timeState.set({
123
- hour: timeValue.pm ? parseInt(timeValue.hour, 10) + 12 : parseInt(timeValue.hour, 10),
125
+ hour: timeValue.pm ? 12 + parseInt(timeValue.hour, 10) % 12 : parseInt(timeValue.hour, 10) % 12,
124
126
  minute: parseInt(timeValue.minute, 10)
125
127
  });
126
128
  if (onChange) {
129
+ setLocalDateValue(updatedTime);
127
130
  onChange(updatedTime);
128
131
  }
129
132
  setPopoverOpen(false);
130
133
  };
131
134
  return /* @__PURE__ */ jsxs(Popover, { open: popoverOpen, onOpenChange: (open) => setPopoverOpen(open), children: [
132
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
135
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: renderCustomTrigger ? renderCustomTrigger({ timeValue }) : /* @__PURE__ */ jsxs(
133
136
  Button,
134
137
  {
135
138
  color: "default",
136
- size: calendarContext.size === "lg" ? "md" : "sm",
139
+ size: size === "lg" ? "md" : "sm",
137
140
  rightIcon: /* @__PURE__ */ jsx(ChevronDownIcon, {}),
138
141
  children: [
139
142
  initialHours,