@ahrowe/ui 0.34.0 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (516) hide show
  1. package/README.md +101 -40
  2. package/dist/esm/common/accordion/accordion.mjs +1 -1
  3. package/dist/esm/common/accordion/accordion.mjs.map +1 -1
  4. package/dist/esm/common/accordion/accordion.module.mjs +1 -1
  5. package/dist/esm/common/accordion/accordion.module.mjs.map +1 -1
  6. package/dist/esm/common/accordion/accordion.plain.module.mjs +1 -1
  7. package/dist/esm/common/accordion/accordion.plain.module.mjs.map +1 -1
  8. package/dist/esm/common/accordion/accordion.primary.module.mjs +1 -1
  9. package/dist/esm/common/accordion/accordion.primary.module.mjs.map +1 -1
  10. package/dist/esm/common/accordion/accordion.types.mjs +1 -1
  11. package/dist/esm/common/accordion/accordion.types.mjs.map +1 -1
  12. package/dist/esm/common/actionButtons/actionButtons.mjs +1 -1
  13. package/dist/esm/common/actionButtons/actionButtons.mjs.map +1 -1
  14. package/dist/esm/common/actionButtons/actionButtons.module.mjs +1 -1
  15. package/dist/esm/common/actionIcon/actionIcon.mjs +1 -1
  16. package/dist/esm/common/actionIcon/actionIcon.mjs.map +1 -1
  17. package/dist/esm/common/actionIcon/actionIcon.module.mjs +1 -1
  18. package/dist/esm/common/alert/alert.mjs +1 -1
  19. package/dist/esm/common/alert/alert.mjs.map +1 -1
  20. package/dist/esm/common/alert/alert.module.mjs +1 -1
  21. package/dist/esm/common/alert/alert.types.mjs +1 -1
  22. package/dist/esm/common/alert/alert.types.mjs.map +1 -1
  23. package/dist/esm/common/animatedIcon/animatedIcon.mjs +1 -1
  24. package/dist/esm/common/animatedIcon/animatedIcon.mjs.map +1 -1
  25. package/dist/esm/common/animatedIcon/animatedIcon.module.mjs +1 -1
  26. package/dist/esm/common/animatedLogo/animatedLogo.mjs +1 -1
  27. package/dist/esm/common/animatedLogo/animatedLogo.mjs.map +1 -1
  28. package/dist/esm/common/animatedLogo/animatedLogo.module.mjs +1 -1
  29. package/dist/esm/common/animatedText/animatedText.mjs +1 -1
  30. package/dist/esm/common/animatedText/animatedText.mjs.map +1 -1
  31. package/dist/esm/common/animatedText/animatedText.module.mjs +1 -1
  32. package/dist/esm/common/animatedText/animatedText.types.mjs +1 -1
  33. package/dist/esm/common/animatedText/animatedText.types.mjs.map +1 -1
  34. package/dist/esm/common/avatar/avatar.mjs +1 -1
  35. package/dist/esm/common/avatar/avatar.mjs.map +1 -1
  36. package/dist/esm/common/avatar/avatar.module.mjs +1 -1
  37. package/dist/esm/common/avatar/avatarGroup.mjs +1 -1
  38. package/dist/esm/common/avatar/avatarGroup.mjs.map +1 -1
  39. package/dist/esm/common/badge/badge.mjs +1 -1
  40. package/dist/esm/common/badge/badge.mjs.map +1 -1
  41. package/dist/esm/common/badge/badge.module.mjs +1 -1
  42. package/dist/esm/common/badge/badge.types.mjs +1 -1
  43. package/dist/esm/common/badge/badge.types.mjs.map +1 -1
  44. package/dist/esm/common/bodyEnd/bodyEnd.mjs +1 -1
  45. package/dist/esm/common/bodyEnd/bodyEnd.mjs.map +1 -1
  46. package/dist/esm/common/breadcrumb/breadcrumb.mjs +1 -1
  47. package/dist/esm/common/breadcrumb/breadcrumb.mjs.map +1 -1
  48. package/dist/esm/common/breadcrumb/breadcrumb.module.mjs +1 -1
  49. package/dist/esm/common/button/button.mjs +1 -1
  50. package/dist/esm/common/button/button.mjs.map +1 -1
  51. package/dist/esm/common/button/button.module.mjs +1 -1
  52. package/dist/esm/common/button/button.types.mjs +1 -1
  53. package/dist/esm/common/button/button.types.mjs.map +1 -1
  54. package/dist/esm/common/buttonGroup/buttonGroup.mjs +1 -1
  55. package/dist/esm/common/buttonGroup/buttonGroup.mjs.map +1 -1
  56. package/dist/esm/common/buttonGroup/buttonGroup.module.mjs +1 -1
  57. package/dist/esm/common/buttonGroup/buttonGroup.types.mjs +1 -1
  58. package/dist/esm/common/buttonGroup/buttonGroup.types.mjs.map +1 -1
  59. package/dist/esm/common/card/Card.mjs +1 -1
  60. package/dist/esm/common/card/Card.mjs.map +1 -1
  61. package/dist/esm/common/card/CardActions.mjs +1 -1
  62. package/dist/esm/common/card/CardActions.mjs.map +1 -1
  63. package/dist/esm/common/card/CardContent.mjs +1 -1
  64. package/dist/esm/common/card/CardContent.mjs.map +1 -1
  65. package/dist/esm/common/card/CardHeader.mjs +1 -1
  66. package/dist/esm/common/card/CardHeader.mjs.map +1 -1
  67. package/dist/esm/common/card/CardMedia.mjs +1 -1
  68. package/dist/esm/common/card/CardMedia.mjs.map +1 -1
  69. package/dist/esm/common/card/card.module.mjs +1 -1
  70. package/dist/esm/common/card/card.module.mjs.map +1 -1
  71. package/dist/esm/common/card/card.types.mjs +1 -1
  72. package/dist/esm/common/card/card.types.mjs.map +1 -1
  73. package/dist/esm/common/carousel/carousel.mjs +1 -1
  74. package/dist/esm/common/carousel/carousel.mjs.map +1 -1
  75. package/dist/esm/common/carousel/carousel.module.mjs +1 -1
  76. package/dist/esm/common/checkbox/checkbox.mjs +1 -1
  77. package/dist/esm/common/checkbox/checkbox.mjs.map +1 -1
  78. package/dist/esm/common/checkbox/checkbox.module.mjs +1 -1
  79. package/dist/esm/common/checkbox/checkbox.module.mjs.map +1 -1
  80. package/dist/esm/common/chip/chip.mjs +1 -1
  81. package/dist/esm/common/chip/chip.mjs.map +1 -1
  82. package/dist/esm/common/chip/chip.module.mjs +1 -1
  83. package/dist/esm/common/chip/chip.types.mjs +1 -1
  84. package/dist/esm/common/chip/chip.types.mjs.map +1 -1
  85. package/dist/esm/common/chip/chipContainer.mjs +1 -1
  86. package/dist/esm/common/chip/chipContainer.mjs.map +1 -1
  87. package/dist/esm/common/colorPicker/colorPicker.mjs +1 -1
  88. package/dist/esm/common/colorPicker/colorPicker.mjs.map +1 -1
  89. package/dist/esm/common/colorPicker/colorPicker.module.mjs +1 -1
  90. package/dist/esm/common/colorPicker/colorPicker.module.mjs.map +1 -1
  91. package/dist/esm/common/colorPicker/toHex.mjs +1 -1
  92. package/dist/esm/common/colorPicker/toHex.mjs.map +1 -1
  93. package/dist/esm/common/configProvider/configProvider.mjs +1 -1
  94. package/dist/esm/common/configProvider/configProvider.mjs.map +1 -1
  95. package/dist/esm/common/configProvider/presentation.types.mjs +1 -1
  96. package/dist/esm/common/configProvider/presentation.types.mjs.map +1 -1
  97. package/dist/esm/common/configProvider/useComponentDefaults.mjs +1 -1
  98. package/dist/esm/common/configProvider/useComponentDefaults.mjs.map +1 -1
  99. package/dist/esm/common/configProvider/useLabels.mjs +1 -1
  100. package/dist/esm/common/configProvider/useLabels.mjs.map +1 -1
  101. package/dist/esm/common/configProvider/usePresentationDefault.mjs +1 -1
  102. package/dist/esm/common/configProvider/usePresentationDefault.mjs.map +1 -1
  103. package/dist/esm/common/confirmModal/confirmModal.mjs +1 -1
  104. package/dist/esm/common/confirmModal/confirmModal.mjs.map +1 -1
  105. package/dist/esm/common/datePicker/components/datePickerMonth/datePickerMonth.mjs +1 -1
  106. package/dist/esm/common/datePicker/components/datePickerMonth/datePickerMonth.mjs.map +1 -1
  107. package/dist/esm/common/datePicker/components/datePickerMonth/datePickerMonth.module.mjs +1 -1
  108. package/dist/esm/common/datePicker/dateFunctions.mjs +1 -1
  109. package/dist/esm/common/datePicker/dateFunctions.mjs.map +1 -1
  110. package/dist/esm/common/datePicker/datePicker.mjs +1 -1
  111. package/dist/esm/common/datePicker/datePicker.mjs.map +1 -1
  112. package/dist/esm/common/datePicker/datePicker.module.mjs +1 -1
  113. package/dist/esm/common/divider/divider.mjs +1 -1
  114. package/dist/esm/common/divider/divider.mjs.map +1 -1
  115. package/dist/esm/common/divider/divider.module.mjs +1 -1
  116. package/dist/esm/common/divider/divider.types.mjs +1 -1
  117. package/dist/esm/common/divider/divider.types.mjs.map +1 -1
  118. package/dist/esm/common/drawer/drawer.mjs +1 -1
  119. package/dist/esm/common/drawer/drawer.mjs.map +1 -1
  120. package/dist/esm/common/drawer/drawer.module.mjs +1 -1
  121. package/dist/esm/common/dropZone/dropZone.mjs +1 -1
  122. package/dist/esm/common/dropZone/dropZone.mjs.map +1 -1
  123. package/dist/esm/common/dropZone/dropZone.module.mjs +1 -1
  124. package/dist/esm/common/dropZone/dropZone.types.mjs +1 -1
  125. package/dist/esm/common/dropZone/dropZone.types.mjs.map +1 -1
  126. package/dist/esm/common/dropdown/dropdown.mjs +1 -1
  127. package/dist/esm/common/dropdown/dropdown.mjs.map +1 -1
  128. package/dist/esm/common/dropdown/dropdown.module.mjs +1 -1
  129. package/dist/esm/common/dropdown/dropdown.module.mjs.map +1 -1
  130. package/dist/esm/common/emptyState/emptyState.mjs +1 -1
  131. package/dist/esm/common/emptyState/emptyState.mjs.map +1 -1
  132. package/dist/esm/common/emptyState/emptyState.module.mjs +1 -1
  133. package/dist/esm/common/errorBoundary/errorBoundary.mjs +1 -1
  134. package/dist/esm/common/errorBoundary/errorBoundary.mjs.map +1 -1
  135. package/dist/esm/common/errorBoundary/errorBoundary.module.mjs +1 -1
  136. package/dist/esm/common/fab/components/fabBase/fabBase.mjs +1 -1
  137. package/dist/esm/common/fab/components/fabBase/fabBase.mjs.map +1 -1
  138. package/dist/esm/common/fab/components/fabBase/fabBase.module.mjs +1 -1
  139. package/dist/esm/common/fab/fab.mjs +1 -1
  140. package/dist/esm/common/fab/fab.mjs.map +1 -1
  141. package/dist/esm/common/fab/fab.module.mjs +1 -1
  142. package/dist/esm/common/fab/fab.module.mjs.map +1 -1
  143. package/dist/esm/common/flip/flip.mjs +1 -1
  144. package/dist/esm/common/flip/flip.mjs.map +1 -1
  145. package/dist/esm/common/flip/flip.module.mjs +1 -1
  146. package/dist/esm/common/floorPlan/floorPlan.faces.mjs +1 -1
  147. package/dist/esm/common/floorPlan/floorPlan.faces.mjs.map +1 -1
  148. package/dist/esm/common/floorPlan/floorPlan.geometry.mjs +1 -1
  149. package/dist/esm/common/floorPlan/floorPlan.geometry.mjs.map +1 -1
  150. package/dist/esm/common/floorPlan/floorPlan.graph.mjs +1 -1
  151. package/dist/esm/common/floorPlan/floorPlan.graph.mjs.map +1 -1
  152. package/dist/esm/common/floorPlan/floorPlan.hit.mjs +1 -1
  153. package/dist/esm/common/floorPlan/floorPlan.hit.mjs.map +1 -1
  154. package/dist/esm/common/floorPlan/floorPlan.json.mjs +1 -1
  155. package/dist/esm/common/floorPlan/floorPlan.json.mjs.map +1 -1
  156. package/dist/esm/common/floorPlan/floorPlan.mesh.mjs +1 -1
  157. package/dist/esm/common/floorPlan/floorPlan.mesh.mjs.map +1 -1
  158. package/dist/esm/common/floorPlan/floorPlan.path.mjs +1 -1
  159. package/dist/esm/common/floorPlan/floorPlan.path.mjs.map +1 -1
  160. package/dist/esm/common/floorPlan/floorPlan.plan.mjs +1 -1
  161. package/dist/esm/common/floorPlan/floorPlan.plan.mjs.map +1 -1
  162. package/dist/esm/common/floorPlan/floorPlan.rooms.mjs +1 -1
  163. package/dist/esm/common/floorPlan/floorPlan.rooms.mjs.map +1 -1
  164. package/dist/esm/common/floorPlan/floorPlan.snap.mjs +1 -1
  165. package/dist/esm/common/floorPlan/floorPlan.snap.mjs.map +1 -1
  166. package/dist/esm/common/floorPlan/floorPlan.triangulate.mjs +1 -1
  167. package/dist/esm/common/floorPlan/floorPlan.triangulate.mjs.map +1 -1
  168. package/dist/esm/common/floorPlan/floorPlan.types.mjs +1 -1
  169. package/dist/esm/common/floorPlan/floorPlan.types.mjs.map +1 -1
  170. package/dist/esm/common/floorPlan/legacySvg.mjs +1 -1
  171. package/dist/esm/common/floorPlan/legacySvg.mjs.map +1 -1
  172. package/dist/esm/common/hooks/useAnchorTracking.mjs +1 -1
  173. package/dist/esm/common/hooks/useAnchorTracking.mjs.map +1 -1
  174. package/dist/esm/common/hooks/useCoarsePointer.mjs +1 -1
  175. package/dist/esm/common/hooks/useCoarsePointer.mjs.map +1 -1
  176. package/dist/esm/common/hooks/useFocusBoundary.mjs +1 -1
  177. package/dist/esm/common/hooks/useFocusBoundary.mjs.map +1 -1
  178. package/dist/esm/common/hooks/useMediaQuery.mjs +1 -1
  179. package/dist/esm/common/hooks/useMediaQuery.mjs.map +1 -1
  180. package/dist/esm/common/hooks/useOverlay.mjs +1 -1
  181. package/dist/esm/common/hooks/useOverlay.mjs.map +1 -1
  182. package/dist/esm/common/hooks/useSheet.mjs +1 -1
  183. package/dist/esm/common/hooks/useSheet.mjs.map +1 -1
  184. package/dist/esm/common/hooks/useSwipeDismiss.mjs +1 -1
  185. package/dist/esm/common/hooks/useSwipeDismiss.mjs.map +1 -1
  186. package/dist/esm/common/hooks/useVisualViewportSize.mjs +1 -1
  187. package/dist/esm/common/hooks/useVisualViewportSize.mjs.map +1 -1
  188. package/dist/esm/common/iconPicker/iconPicker.mjs +1 -1
  189. package/dist/esm/common/iconPicker/iconPicker.mjs.map +1 -1
  190. package/dist/esm/common/iconPicker/iconPicker.module.mjs +1 -1
  191. package/dist/esm/common/idleManager/idleManager.mjs +1 -1
  192. package/dist/esm/common/idleManager/idleManager.mjs.map +1 -1
  193. package/dist/esm/common/infiniteBlock/infiniteBlock.mjs +1 -1
  194. package/dist/esm/common/infiniteBlock/infiniteBlock.mjs.map +1 -1
  195. package/dist/esm/common/infiniteBlock/infiniteBlock.module.mjs +1 -1
  196. package/dist/esm/common/input/input.mjs +1 -1
  197. package/dist/esm/common/input/input.mjs.map +1 -1
  198. package/dist/esm/common/input/input.module.mjs +1 -1
  199. package/dist/esm/common/input/input.module.mjs.map +1 -1
  200. package/dist/esm/common/input/input.types.mjs +1 -1
  201. package/dist/esm/common/input/input.types.mjs.map +1 -1
  202. package/dist/esm/common/inputDropdown/inputDropdown.mjs +1 -1
  203. package/dist/esm/common/inputDropdown/inputDropdown.mjs.map +1 -1
  204. package/dist/esm/common/inputDropdown/inputDropdown.module.mjs +1 -1
  205. package/dist/esm/common/interactableDiv/index.mjs +1 -1
  206. package/dist/esm/common/interactableDiv/index.mjs.map +1 -1
  207. package/dist/esm/common/interactableDiv/interactableDiv.mjs +1 -1
  208. package/dist/esm/common/interactableDiv/interactableDiv.mjs.map +1 -1
  209. package/dist/esm/common/interactableDiv/interactableDiv.module.mjs +1 -1
  210. package/dist/esm/common/kanbanBoard/KanbanBoard.mjs +1 -1
  211. package/dist/esm/common/kanbanBoard/KanbanBoard.mjs.map +1 -1
  212. package/dist/esm/common/kanbanBoard/KanbanColumn.mjs +1 -1
  213. package/dist/esm/common/kanbanBoard/KanbanColumn.mjs.map +1 -1
  214. package/dist/esm/common/kanbanBoard/KanbanItem.mjs +1 -1
  215. package/dist/esm/common/kanbanBoard/KanbanItem.mjs.map +1 -1
  216. package/dist/esm/common/kanbanBoard/kanbanBoard.module.mjs +1 -1
  217. package/dist/esm/common/kanbanBoard/kanbanBoard.utils.mjs +1 -1
  218. package/dist/esm/common/kanbanBoard/kanbanBoard.utils.mjs.map +1 -1
  219. package/dist/esm/common/klipyPicker/components/gifPreview/gifPreview.mjs +1 -1
  220. package/dist/esm/common/klipyPicker/components/gifPreview/gifPreview.mjs.map +1 -1
  221. package/dist/esm/common/klipyPicker/components/gifPreview/gifPreview.module.mjs +1 -1
  222. package/dist/esm/common/klipyPicker/components/gifView/gifView.mjs +1 -1
  223. package/dist/esm/common/klipyPicker/components/gifView/gifView.mjs.map +1 -1
  224. package/dist/esm/common/klipyPicker/components/gifView/gifView.module.mjs +1 -1
  225. package/dist/esm/common/klipyPicker/klipyPicker.mjs +1 -1
  226. package/dist/esm/common/klipyPicker/klipyPicker.mjs.map +1 -1
  227. package/dist/esm/common/klipyPicker/klipyPicker.module.mjs +1 -1
  228. package/dist/esm/common/loading/iconLoading/iconLoading.mjs +1 -1
  229. package/dist/esm/common/loading/iconLoading/iconLoading.mjs.map +1 -1
  230. package/dist/esm/common/loading/iconLoading/iconLoading.module.mjs +1 -1
  231. package/dist/esm/common/loading/iconLoading/index.mjs +1 -1
  232. package/dist/esm/common/loading/iconLoading/index.mjs.map +1 -1
  233. package/dist/esm/common/loading/spinnerLoading/index.mjs +1 -1
  234. package/dist/esm/common/loading/spinnerLoading/index.mjs.map +1 -1
  235. package/dist/esm/common/loading/spinnerLoading/spinnerLoading.mjs +1 -1
  236. package/dist/esm/common/loading/spinnerLoading/spinnerLoading.mjs.map +1 -1
  237. package/dist/esm/common/loading/spinnerLoading/spinnerLoading.module.mjs +1 -1
  238. package/dist/esm/common/menu/menu.mjs +1 -1
  239. package/dist/esm/common/menu/menu.mjs.map +1 -1
  240. package/dist/esm/common/menu/menu.module.mjs +1 -1
  241. package/dist/esm/common/menu/menu.types.mjs +1 -1
  242. package/dist/esm/common/menu/menu.types.mjs.map +1 -1
  243. package/dist/esm/common/modal/modal.mjs +1 -1
  244. package/dist/esm/common/modal/modal.mjs.map +1 -1
  245. package/dist/esm/common/modal/modal.module.mjs +1 -1
  246. package/dist/esm/common/modal/modal.module.mjs.map +1 -1
  247. package/dist/esm/common/multiSelect/multiSelect.mjs +1 -1
  248. package/dist/esm/common/multiSelect/multiSelect.mjs.map +1 -1
  249. package/dist/esm/common/multiSelect/multiSelect.module.mjs +1 -1
  250. package/dist/esm/common/multiSelect/multiSelect.module.mjs.map +1 -1
  251. package/dist/esm/common/numberInput/index.mjs +1 -1
  252. package/dist/esm/common/numberInput/index.mjs.map +1 -1
  253. package/dist/esm/common/numberInput/numberInput.mjs +1 -1
  254. package/dist/esm/common/numberInput/numberInput.mjs.map +1 -1
  255. package/dist/esm/common/numberInput/numberInput.module.mjs +1 -1
  256. package/dist/esm/common/numberInput/useStepRepeat.mjs +1 -1
  257. package/dist/esm/common/numberInput/useStepRepeat.mjs.map +1 -1
  258. package/dist/esm/common/optionPicker/optionPicker.mjs +1 -1
  259. package/dist/esm/common/optionPicker/optionPicker.mjs.map +1 -1
  260. package/dist/esm/common/optionPicker/optionPicker.module.mjs +1 -1
  261. package/dist/esm/common/otpInput/otpInput.mjs +1 -1
  262. package/dist/esm/common/otpInput/otpInput.mjs.map +1 -1
  263. package/dist/esm/common/otpInput/otpInput.module.mjs +1 -1
  264. package/dist/esm/common/otpInput/otpInput.types.mjs +1 -1
  265. package/dist/esm/common/otpInput/otpInput.types.mjs.map +1 -1
  266. package/dist/esm/common/overscroll/overscroll.mjs +1 -1
  267. package/dist/esm/common/overscroll/overscroll.mjs.map +1 -1
  268. package/dist/esm/common/overscroll/overscroll.module.mjs +1 -1
  269. package/dist/esm/common/pagination/pagination.mjs +1 -1
  270. package/dist/esm/common/pagination/pagination.mjs.map +1 -1
  271. package/dist/esm/common/pagination/pagination.module.mjs +1 -1
  272. package/dist/esm/common/planCanvas/planCanvas.mjs +1 -1
  273. package/dist/esm/common/planCanvas/planCanvas.mjs.map +1 -1
  274. package/dist/esm/common/planCanvas/planCanvas.module.mjs +1 -1
  275. package/dist/esm/common/popover/popover.mjs +1 -1
  276. package/dist/esm/common/popover/popover.mjs.map +1 -1
  277. package/dist/esm/common/popover/popover.module.mjs +1 -1
  278. package/dist/esm/common/popover/popover.types.mjs +1 -1
  279. package/dist/esm/common/popover/popover.types.mjs.map +1 -1
  280. package/dist/esm/common/popover/usePopoverPosition.mjs +1 -1
  281. package/dist/esm/common/popover/usePopoverPosition.mjs.map +1 -1
  282. package/dist/esm/common/progressBar/progressBar.mjs +1 -1
  283. package/dist/esm/common/progressBar/progressBar.mjs.map +1 -1
  284. package/dist/esm/common/progressBar/progressBar.module.mjs +1 -1
  285. package/dist/esm/common/progressBar/progressBar.module.mjs.map +1 -1
  286. package/dist/esm/common/radioGroup/radioGroup.mjs +1 -1
  287. package/dist/esm/common/radioGroup/radioGroup.mjs.map +1 -1
  288. package/dist/esm/common/radioGroup/radioGroup.module.mjs +1 -1
  289. package/dist/esm/common/radioGroup/radioGroup.module.mjs.map +1 -1
  290. package/dist/esm/common/radioGroup/radioGroup.types.mjs +1 -1
  291. package/dist/esm/common/radioGroup/radioGroup.types.mjs.map +1 -1
  292. package/dist/esm/common/rating/rating.mjs +1 -1
  293. package/dist/esm/common/rating/rating.mjs.map +1 -1
  294. package/dist/esm/common/rating/rating.module.mjs +1 -1
  295. package/dist/esm/common/revealLens/revealLens.mjs +1 -1
  296. package/dist/esm/common/revealLens/revealLens.mjs.map +1 -1
  297. package/dist/esm/common/revealLens/revealLens.module.mjs +1 -1
  298. package/dist/esm/common/ripple/ripple.mjs +1 -1
  299. package/dist/esm/common/ripple/ripple.mjs.map +1 -1
  300. package/dist/esm/common/ripple/ripple.module.mjs +1 -1
  301. package/dist/esm/common/ripple/ripple.module.mjs.map +1 -1
  302. package/dist/esm/common/roomDrawer/roomDrawer.mjs +1 -1
  303. package/dist/esm/common/roomDrawer/roomDrawer.mjs.map +1 -1
  304. package/dist/esm/common/roomDrawer/roomDrawer.module.mjs +1 -1
  305. package/dist/esm/common/roomDrawer/usePlanHistory.mjs +1 -1
  306. package/dist/esm/common/roomDrawer/usePlanHistory.mjs.map +1 -1
  307. package/dist/esm/common/roomViewer/roomViewer.mjs +1 -1
  308. package/dist/esm/common/roomViewer/roomViewer.mjs.map +1 -1
  309. package/dist/esm/common/roomViewer/roomViewer.module.mjs +1 -1
  310. package/dist/esm/common/scrollbarProvider/index.mjs +1 -1
  311. package/dist/esm/common/scrollbarProvider/index.mjs.map +1 -1
  312. package/dist/esm/common/scrollbarProvider/scrollbarProvider.mjs +1 -1
  313. package/dist/esm/common/scrollbarProvider/scrollbarProvider.mjs.map +1 -1
  314. package/dist/esm/common/scrollbarProvider/scrollbarProvider.module.mjs +1 -1
  315. package/dist/esm/common/searchInput/searchInput.mjs +1 -1
  316. package/dist/esm/common/searchInput/searchInput.mjs.map +1 -1
  317. package/dist/esm/common/searchInput/searchInput.module.mjs +1 -1
  318. package/dist/esm/common/sectionHeader/sectionHeader.mjs +1 -1
  319. package/dist/esm/common/sectionHeader/sectionHeader.mjs.map +1 -1
  320. package/dist/esm/common/sectionHeader/sectionHeader.module.mjs +1 -1
  321. package/dist/esm/common/sectionHeader/sectionHeader.types.mjs +1 -1
  322. package/dist/esm/common/sectionHeader/sectionHeader.types.mjs.map +1 -1
  323. package/dist/esm/common/sheetBackdrop/sheetBackdrop.mjs +1 -1
  324. package/dist/esm/common/sheetBackdrop/sheetBackdrop.mjs.map +1 -1
  325. package/dist/esm/common/skeleton/skeleton.mjs +1 -1
  326. package/dist/esm/common/skeleton/skeleton.mjs.map +1 -1
  327. package/dist/esm/common/skeleton/skeleton.module.mjs +1 -1
  328. package/dist/esm/common/skeleton/skeleton.types.mjs +1 -1
  329. package/dist/esm/common/skeleton/skeleton.types.mjs.map +1 -1
  330. package/dist/esm/common/slider/slider.mjs +1 -1
  331. package/dist/esm/common/slider/slider.mjs.map +1 -1
  332. package/dist/esm/common/slider/slider.module.mjs +1 -1
  333. package/dist/esm/common/splitButton/splitButton.mjs +1 -1
  334. package/dist/esm/common/splitButton/splitButton.mjs.map +1 -1
  335. package/dist/esm/common/splitButton/splitButton.module.mjs +1 -1
  336. package/dist/esm/common/stepper/stepper.mjs +1 -1
  337. package/dist/esm/common/stepper/stepper.mjs.map +1 -1
  338. package/dist/esm/common/stepper/stepper.module.mjs +1 -1
  339. package/dist/esm/common/stepper/stepper.types.mjs +1 -1
  340. package/dist/esm/common/stepper/stepper.types.mjs.map +1 -1
  341. package/dist/esm/common/sticky/sticky.mjs +1 -1
  342. package/dist/esm/common/sticky/sticky.mjs.map +1 -1
  343. package/dist/esm/common/sticky/sticky.module.mjs +1 -1
  344. package/dist/esm/common/sticky/stickyStack.mjs +1 -1
  345. package/dist/esm/common/sticky/stickyStack.mjs.map +1 -1
  346. package/dist/esm/common/styles/sheet.module.mjs +1 -1
  347. package/dist/esm/common/styles/sheet.module.mjs.map +1 -1
  348. package/dist/esm/common/switch/switch.mjs +1 -1
  349. package/dist/esm/common/switch/switch.mjs.map +1 -1
  350. package/dist/esm/common/switch/switch.module.mjs +1 -1
  351. package/dist/esm/common/switch/switch.module.mjs.map +1 -1
  352. package/dist/esm/common/tabHeader/tabHeader.mjs +1 -1
  353. package/dist/esm/common/tabHeader/tabHeader.mjs.map +1 -1
  354. package/dist/esm/common/tabHeader/tabHeader.module.mjs +1 -1
  355. package/dist/esm/common/textarea/textarea.mjs +1 -1
  356. package/dist/esm/common/textarea/textarea.mjs.map +1 -1
  357. package/dist/esm/common/themeProvider/defaultTheme.mjs +1 -1
  358. package/dist/esm/common/themeProvider/defaultTheme.mjs.map +1 -1
  359. package/dist/esm/common/themeProvider/lightTheme.mjs +2 -0
  360. package/dist/esm/common/themeProvider/lightTheme.mjs.map +1 -0
  361. package/dist/esm/common/themeProvider/theme.module.mjs +1 -1
  362. package/dist/esm/common/themeProvider/themeProvider.mjs +1 -1
  363. package/dist/esm/common/themeProvider/themeProvider.mjs.map +1 -1
  364. package/dist/esm/common/themeProvider/themeVariablesContext.mjs +1 -1
  365. package/dist/esm/common/themeProvider/themeVariablesContext.mjs.map +1 -1
  366. package/dist/esm/common/themeProvider/useTheme.mjs +1 -1
  367. package/dist/esm/common/themeProvider/useTheme.mjs.map +1 -1
  368. package/dist/esm/common/tilt/tilt.mjs +1 -1
  369. package/dist/esm/common/tilt/tilt.mjs.map +1 -1
  370. package/dist/esm/common/tilt/tilt.module.mjs +1 -1
  371. package/dist/esm/common/tilt/tiltMath.mjs +1 -1
  372. package/dist/esm/common/tilt/tiltMath.mjs.map +1 -1
  373. package/dist/esm/common/tiltGroup/tiltGroup.mjs +1 -1
  374. package/dist/esm/common/tiltGroup/tiltGroup.mjs.map +1 -1
  375. package/dist/esm/common/timeInput/components/clockDial/clockDial.mjs +1 -1
  376. package/dist/esm/common/timeInput/components/clockDial/clockDial.mjs.map +1 -1
  377. package/dist/esm/common/timeInput/components/clockDial/clockDial.module.mjs +1 -1
  378. package/dist/esm/common/timeInput/timeFunctions.mjs +1 -1
  379. package/dist/esm/common/timeInput/timeFunctions.mjs.map +1 -1
  380. package/dist/esm/common/timeInput/timeInput.mjs +1 -1
  381. package/dist/esm/common/timeInput/timeInput.mjs.map +1 -1
  382. package/dist/esm/common/timeInput/timeInput.module.mjs +1 -1
  383. package/dist/esm/common/timeline/timeline.mjs +1 -1
  384. package/dist/esm/common/timeline/timeline.mjs.map +1 -1
  385. package/dist/esm/common/timeline/timeline.module.mjs +1 -1
  386. package/dist/esm/common/timeline/timeline.types.mjs +1 -1
  387. package/dist/esm/common/timeline/timeline.types.mjs.map +1 -1
  388. package/dist/esm/common/timer/timer.chime.mjs +1 -1
  389. package/dist/esm/common/timer/timer.chime.mjs.map +1 -1
  390. package/dist/esm/common/timer/timer.mjs +1 -1
  391. package/dist/esm/common/timer/timer.mjs.map +1 -1
  392. package/dist/esm/common/timer/timer.module.mjs +1 -1
  393. package/dist/esm/common/toast/toast.mjs +1 -1
  394. package/dist/esm/common/toast/toast.mjs.map +1 -1
  395. package/dist/esm/common/toast/toast.module.mjs +1 -1
  396. package/dist/esm/common/toast/toast.module.mjs.map +1 -1
  397. package/dist/esm/common/toast/toastProvider.mjs +1 -1
  398. package/dist/esm/common/toast/toastProvider.mjs.map +1 -1
  399. package/dist/esm/common/toast/toastService.mjs +1 -1
  400. package/dist/esm/common/toast/toastService.mjs.map +1 -1
  401. package/dist/esm/common/tooltip/tooltip.mjs +1 -1
  402. package/dist/esm/common/tooltip/tooltip.mjs.map +1 -1
  403. package/dist/esm/common/tooltip/tooltip.module.mjs +1 -1
  404. package/dist/esm/common/tree/flattenTree.mjs +1 -1
  405. package/dist/esm/common/tree/flattenTree.mjs.map +1 -1
  406. package/dist/esm/common/tree/tree.mjs +1 -1
  407. package/dist/esm/common/tree/tree.mjs.map +1 -1
  408. package/dist/esm/common/tree/tree.module.mjs +1 -1
  409. package/dist/esm/common/tree/tree.module.mjs.map +1 -1
  410. package/dist/esm/common/utils/activationKey.mjs +1 -1
  411. package/dist/esm/common/utils/activationKey.mjs.map +1 -1
  412. package/dist/esm/common/utils/mergeRefs.mjs +2 -0
  413. package/dist/esm/common/utils/mergeRefs.mjs.map +1 -0
  414. package/dist/esm/common/utils/renderIcon.mjs +1 -1
  415. package/dist/esm/common/utils/renderIcon.mjs.map +1 -1
  416. package/dist/esm/common/utils/scrollAncestors.mjs +1 -1
  417. package/dist/esm/common/utils/scrollAncestors.mjs.map +1 -1
  418. package/dist/esm/common/utils/visualViewport.mjs +1 -1
  419. package/dist/esm/common/utils/visualViewport.mjs.map +1 -1
  420. package/dist/esm/common/virtualList/useColumnResize.mjs +1 -1
  421. package/dist/esm/common/virtualList/useColumnResize.mjs.map +1 -1
  422. package/dist/esm/common/virtualList/useColumns.mjs +1 -1
  423. package/dist/esm/common/virtualList/useColumns.mjs.map +1 -1
  424. package/dist/esm/common/virtualList/useHeaderNavigation.mjs +1 -1
  425. package/dist/esm/common/virtualList/useHeaderNavigation.mjs.map +1 -1
  426. package/dist/esm/common/virtualList/useRowDrag.mjs +1 -1
  427. package/dist/esm/common/virtualList/useRowDrag.mjs.map +1 -1
  428. package/dist/esm/common/virtualList/useRowNavigation.mjs +1 -1
  429. package/dist/esm/common/virtualList/useRowNavigation.mjs.map +1 -1
  430. package/dist/esm/common/virtualList/useSelection.mjs +1 -1
  431. package/dist/esm/common/virtualList/useSelection.mjs.map +1 -1
  432. package/dist/esm/common/virtualList/useSorting.mjs +1 -1
  433. package/dist/esm/common/virtualList/useSorting.mjs.map +1 -1
  434. package/dist/esm/common/virtualList/useVirtualWindow.mjs +1 -1
  435. package/dist/esm/common/virtualList/useVirtualWindow.mjs.map +1 -1
  436. package/dist/esm/common/virtualList/virtualList.mjs +1 -1
  437. package/dist/esm/common/virtualList/virtualList.mjs.map +1 -1
  438. package/dist/esm/common/virtualList/virtualList.module.mjs +1 -1
  439. package/dist/esm/common/virtualList/virtualList.utils.mjs +1 -1
  440. package/dist/esm/common/virtualList/virtualList.utils.mjs.map +1 -1
  441. package/dist/esm/common/virtualList/virtualListHeader.mjs +1 -1
  442. package/dist/esm/common/virtualList/virtualListHeader.mjs.map +1 -1
  443. package/dist/esm/common/virtualList/virtualRow.mjs +1 -1
  444. package/dist/esm/common/virtualList/virtualRow.mjs.map +1 -1
  445. package/dist/esm/common/wizard/wizard.mjs +1 -1
  446. package/dist/esm/common/wizard/wizard.mjs.map +1 -1
  447. package/dist/esm/common/wizard/wizard.module.mjs +1 -1
  448. package/dist/esm/hooks/useWindowSize.mjs +1 -1
  449. package/dist/esm/hooks/useWindowSize.mjs.map +1 -1
  450. package/dist/esm/index.mjs +1 -1
  451. package/dist/esm/services/formValidation/FormValidatorGroupWithForm.mjs +1 -1
  452. package/dist/esm/services/formValidation/FormValidatorGroupWithForm.mjs.map +1 -1
  453. package/dist/esm/services/formValidation/index.mjs +1 -1
  454. package/dist/esm/services/formValidation/useFormValidatorGroup.mjs +1 -1
  455. package/dist/esm/services/formValidation/useFormValidatorGroup.mjs.map +1 -1
  456. package/dist/esm/services/formValidation/validatableComponent.mjs +1 -1
  457. package/dist/esm/services/formValidation/validatableComponent.mjs.map +1 -1
  458. package/dist/esm/services/klipy.mjs +1 -1
  459. package/dist/esm/services/klipy.mjs.map +1 -1
  460. package/dist/esm/services/localization.mjs +1 -1
  461. package/dist/esm/services/localization.mjs.map +1 -1
  462. package/dist/index.cjs +3 -3
  463. package/dist/index.cjs.map +1 -1
  464. package/dist/mcp.js +21096 -5
  465. package/dist/style.css +1 -1
  466. package/dist/types/common/actionIcon/actionIcon.types.d.ts +3 -1
  467. package/dist/types/common/card/card.types.d.ts +3 -1
  468. package/dist/types/common/checkbox/checkbox.types.d.ts +3 -1
  469. package/dist/types/common/colorPicker/colorPicker.types.d.ts +4 -0
  470. package/dist/types/common/configProvider/configProvider.types.d.ts +4 -0
  471. package/dist/types/common/flip/flip.d.ts +2 -2
  472. package/dist/types/common/flip/flip.types.d.ts +3 -1
  473. package/dist/types/common/input/input.types.d.ts +5 -0
  474. package/dist/types/common/interactableDiv/interactableDiv.d.ts +3 -2
  475. package/dist/types/common/loading/spinnerLoading/spinnerLoading.d.ts +0 -5
  476. package/dist/types/common/numberInput/numberInput.types.d.ts +2 -0
  477. package/dist/types/common/otpInput/otpInput.types.d.ts +2 -0
  478. package/dist/types/common/planCanvas/planCanvas.d.ts +1 -1
  479. package/dist/types/common/planCanvas/planCanvas.types.d.ts +3 -1
  480. package/dist/types/common/ripple/ripple.d.ts +1 -1
  481. package/dist/types/common/ripple/ripple.types.d.ts +1 -0
  482. package/dist/types/common/roomDrawer/roomDrawer.d.ts +2 -2
  483. package/dist/types/common/roomDrawer/roomDrawer.types.d.ts +3 -1
  484. package/dist/types/common/roomViewer/roomViewer.d.ts +2 -2
  485. package/dist/types/common/roomViewer/roomViewer.types.d.ts +3 -1
  486. package/dist/types/common/searchInput/searchInput.d.ts +1 -1
  487. package/dist/types/common/searchInput/searchInput.types.d.ts +3 -0
  488. package/dist/types/common/switch/switch.types.d.ts +3 -1
  489. package/dist/types/common/themeProvider/index.d.ts +1 -0
  490. package/dist/types/common/themeProvider/lightTheme.d.ts +13 -0
  491. package/dist/types/common/tilt/tilt.d.ts +2 -2
  492. package/dist/types/common/tilt/tilt.types.d.ts +3 -1
  493. package/dist/types/common/timer/timer.d.ts +2 -2
  494. package/dist/types/common/timer/timer.types.d.ts +3 -1
  495. package/dist/types/common/tooltip/tooltip.d.ts +1 -1
  496. package/dist/types/common/tooltip/tooltip.types.d.ts +7 -0
  497. package/dist/types/common/types/baseProps.types.d.ts +6 -0
  498. package/dist/types/common/utils/mergeRefs.d.ts +12 -0
  499. package/dist/types/common/virtualList/virtualList.d.ts +2 -4
  500. package/dist/types/common/virtualList/virtualList.types.d.ts +3 -1
  501. package/docs/Accordion.md +9 -0
  502. package/docs/ActionIcon.md +1 -0
  503. package/docs/CLAUDE.md +37 -0
  504. package/docs/Card.md +1 -0
  505. package/docs/Checkbox.md +1 -0
  506. package/docs/ColorPicker.md +12 -2
  507. package/docs/Input.md +1 -0
  508. package/docs/KlipyPicker.md +1 -1
  509. package/docs/NumberInput.md +1 -0
  510. package/docs/OtpInput.md +1 -0
  511. package/docs/SearchInput.md +1 -0
  512. package/docs/Switch.md +1 -0
  513. package/docs/Textarea.md +1 -0
  514. package/docs/ThemeProvider.md +30 -1
  515. package/docs/Tooltip.md +23 -1
  516. package/package.json +8 -7
@@ -1 +1 @@
1
- {"version":3,"file":"toHex.mjs","names":[],"sources":["../../../../package/common/colorPicker/toHex.ts"],"sourcesContent":["/**\n * Normalises any CSS colour the browser understands into hex, which is the only form\n * ColorPicker's own arithmetic can take. Without it every non-hex value — `transparent`,\n * `rgba(...)`, and above all `oklch(...)`, which a whole theme may be written in — silently\n * became the picker's default blue: a swatch confidently showing a colour nothing asked for.\n *\n * The canvas 2D context is the browser's own colour parser. Under jsdom there is none, so\n * this returns `undefined` and callers keep their previous fallback — meaning the widened\n * behaviour is only observable in a real browser, and only `*.browser.test.ts` can cover it.\n */\n\n/** `undefined` until first use, `null` once we know there is no 2D context (jsdom). */\nlet ctx: CanvasRenderingContext2D | null | undefined;\n\n/*\n * Six or eight digits only. Shorthand is deliberately NOT short-circuited: ColorPicker's own\n * isValidHex accepts those two lengths and nothing else, so handing it `#abc` untouched would\n * have produced exactly the default-blue swatch this helper exists to prevent. Letting it fall\n * through to the canvas expands it.\n */\nconst HEX = /^#([0-9a-f]{6}|[0-9a-f]{8})$/i;\n/*\n * Two of them, because an unparseable value leaves fillStyle at whatever preceded it: seed\n * with each in turn and a real colour resolves the same way twice, while a rejected one\n * comes back as the two different seeds. One sentinel could not tell a rejected value from\n * a value that happens to BE the sentinel — `rgb(1, 2, 3)` normalises to exactly `#010203`.\n */\nconst SEED_A = '#010203';\nconst SEED_B = '#040506';\n\nfunction byteToHex(n: number): string {\n return Math.max(0, Math.min(255, Math.round(n)))\n .toString(16)\n .padStart(2, '0');\n}\n\n/** `#rrggbb`, widened to `#rrggbbaa` only when the colour is not fully opaque. */\nfunction pack(r: number, g: number, b: number, a: number): string {\n const alpha = Math.round(a);\n return `#${byteToHex(r)}${byteToHex(g)}${byteToHex(b)}${alpha === 255 ? '' : byteToHex(alpha)}`;\n}\n\nexport function toHex(value: string | undefined): string | undefined {\n const raw = value?.trim();\n if (!raw) return undefined;\n if (HEX.test(raw)) return raw;\n\n if (ctx === undefined) ctx = document.createElement('canvas').getContext('2d');\n if (!ctx) return undefined;\n\n ctx.fillStyle = SEED_A;\n ctx.fillStyle = raw;\n const resolved = ctx.fillStyle;\n ctx.fillStyle = SEED_B;\n ctx.fillStyle = raw;\n if (ctx.fillStyle !== resolved) return undefined;\n\n // fillStyle normalises sRGB inputs to `#rrggbb` or `rgba(r, g, b, a)`, which are exact.\n if (resolved.startsWith('#')) return resolved;\n const parts = /^rgba?\\(([^)]+)\\)$/i.exec(resolved);\n if (parts) {\n const [r, g, b, a = '1'] = parts[1].split(',').map((part) => part.trim());\n return pack(Number(r), Number(g), Number(b), Number(a) * 255);\n }\n\n /*\n * Anything in a wide-gamut syntax — oklch(), oklab(), color-mix() — comes back verbatim\n * rather than as sRGB, so the browser is asked to paint it and the pixel is read instead.\n * Only reached for those: canvas un-premultiplies alpha on the way out, which costs a\n * little precision on a very transparent colour, and the exact paths above avoid it.\n */\n ctx.clearRect(0, 0, 1, 1);\n ctx.fillRect(0, 0, 1, 1);\n const [r, g, b, a] = ctx.getImageData(0, 0, 1, 1).data;\n return pack(r, g, b, a);\n}\n"],"mappings":"AAYA,IAAI,EAQE,EAAM,gCAUZ,SAAS,EAAU,EAAmB,CACpC,OAAO,KAAK,IAAI,EAAG,KAAK,IAAI,IAAK,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAC7C,SAAS,EAAE,CAAC,CACZ,SAAS,EAAG,GAAG,CACpB,CAGA,SAAS,EAAK,EAAW,EAAW,EAAW,EAAmB,CAChE,IAAM,EAAQ,KAAK,MAAM,CAAC,EAC1B,MAAO,IAAI,EAAU,CAAC,IAAI,EAAU,CAAC,IAAI,EAAU,CAAC,IAAI,IAAU,IAAM,GAAK,EAAU,CAAK,GAC9F,CAEA,SAAgB,EAAM,EAA+C,CACnE,IAAM,EAAM,GAAO,KAAK,EACxB,GAAI,CAAC,EAAK,OACV,GAAI,EAAI,KAAK,CAAG,EAAG,OAAO,EAG1B,GADI,IAAQ,IAAA,KAAW,EAAM,SAAS,cAAc,QAAQ,CAAC,CAAC,WAAW,IAAI,GACzE,CAAC,EAAK,OAEV,EAAI,UAAY,UAChB,EAAI,UAAY,EAChB,IAAM,EAAW,EAAI,UAGrB,GAFA,EAAI,UAAY,UAChB,EAAI,UAAY,EACZ,EAAI,YAAc,EAAU,OAGhC,GAAI,EAAS,WAAW,GAAG,EAAG,OAAO,EACrC,IAAM,EAAQ,sBAAsB,KAAK,CAAQ,EACjD,GAAI,EAAO,CACT,GAAM,CAAC,EAAG,EAAG,EAAG,EAAI,KAAO,EAAM,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,IAAK,GAAS,EAAK,KAAK,CAAC,EACxE,OAAO,EAAK,OAAO,CAAC,EAAG,OAAO,CAAC,EAAG,OAAO,CAAC,EAAG,OAAO,CAAC,EAAI,GAAG,CAC9D,CAQA,EAAI,UAAU,EAAG,EAAG,EAAG,CAAC,EACxB,EAAI,SAAS,EAAG,EAAG,EAAG,CAAC,EACvB,GAAM,CAAC,EAAG,EAAG,EAAG,GAAK,EAAI,aAAa,EAAG,EAAG,EAAG,CAAC,CAAC,CAAC,KAClD,OAAO,EAAK,EAAG,EAAG,EAAG,CAAC,CACxB"}
1
+ {"version":3,"file":"toHex.mjs","names":[],"sources":["../../../../package/common/colorPicker/toHex.ts"],"sourcesContent":["/**\n * Normalises any CSS colour the browser understands into hex, which is the only form\n * ColorPicker's own arithmetic can take. Without it every non-hex value — `transparent`,\n * `rgba(...)`, and above all `oklch(...)`, which a whole theme may be written in — silently\n * became the picker's default blue: a swatch confidently showing a colour nothing asked for.\n *\n * The canvas 2D context is the browser's own colour parser. Under jsdom there is none, so\n * this returns `undefined` and callers keep their previous fallback — meaning the widened\n * behaviour is only observable in a real browser, and only `*.browser.test.ts` can cover it.\n */\n\n/** `undefined` until first use, `null` once we know there is no 2D context (jsdom). */\nlet ctx: CanvasRenderingContext2D | null | undefined;\n\n/*\n * Six or eight digits only. Shorthand is deliberately NOT short-circuited: ColorPicker's own\n * isValidHex accepts those two lengths and nothing else, so handing it `#abc` untouched would\n * have produced exactly the default-blue swatch this helper exists to prevent. Letting it fall\n * through to the canvas expands it.\n */\nconst HEX = /^#([0-9a-f]{6}|[0-9a-f]{8})$/i;\n/*\n * Two of them, because an unparseable value leaves fillStyle at whatever preceded it: seed\n * with each in turn and a real colour resolves the same way twice, while a rejected one\n * comes back as the two different seeds. One sentinel could not tell a rejected value from\n * a value that happens to BE the sentinel — `rgb(1, 2, 3)` normalises to exactly `#010203`.\n */\nconst SEED_A = '#010203';\nconst SEED_B = '#040506';\n\nfunction byteToHex(n: number): string {\n return Math.max(0, Math.min(255, Math.round(n)))\n .toString(16)\n .padStart(2, '0');\n}\n\n/** `#rrggbb`, widened to `#rrggbbaa` only when the colour is not fully opaque. */\nfunction pack(r: number, g: number, b: number, a: number): string {\n const alpha = Math.round(a);\n return `#${byteToHex(r)}${byteToHex(g)}${byteToHex(b)}${alpha === 255 ? '' : byteToHex(alpha)}`;\n}\n\nexport function toHex(value: string | undefined): string | undefined {\n const raw = value?.trim();\n if (!raw) return undefined;\n if (HEX.test(raw)) return raw;\n\n if (ctx === undefined) ctx = document.createElement('canvas').getContext('2d');\n if (!ctx) return undefined;\n\n ctx.fillStyle = SEED_A;\n ctx.fillStyle = raw;\n const resolved = ctx.fillStyle;\n ctx.fillStyle = SEED_B;\n ctx.fillStyle = raw;\n if (ctx.fillStyle !== resolved) return undefined;\n\n // fillStyle normalises sRGB inputs to `#rrggbb` or `rgba(r, g, b, a)`, which are exact.\n if (resolved.startsWith('#')) return resolved;\n const parts = /^rgba?\\(([^)]+)\\)$/i.exec(resolved);\n if (parts) {\n const [r, g, b, a = '1'] = parts[1].split(',').map((part) => part.trim());\n return pack(Number(r), Number(g), Number(b), Number(a) * 255);\n }\n\n /*\n * Anything in a wide-gamut syntax — oklch(), oklab(), color-mix() — comes back verbatim\n * rather than as sRGB, so the browser is asked to paint it and the pixel is read instead.\n * Only reached for those: canvas un-premultiplies alpha on the way out, which costs a\n * little precision on a very transparent colour, and the exact paths above avoid it.\n */\n ctx.clearRect(0, 0, 1, 1);\n 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AAC,EACvB,GAAM,CAAC,EAAG,EAAG,EAAG,GAAK,EAAI,aAAa,EAAG,EAAG,EAAG,CAAC,CAAC,CAAC,KAClD,OAAO,EAAK,EAAG,EAAG,EAAG,CAAC,CACxB"}
@@ -1,2 +1,2 @@
1
- import{createContext as e,useContext as t,useMemo as n}from"react";import{jsx as r}from"react/jsx-runtime";var i=e(null),a=e(void 0);function o(e,t){if(!e)return t??{};if(!t)return e;let n={...e};for(let r in t)n[r]={...e[r],...t[r]};return n}function s({children:e,defaultProps:s,presentation:c}){let l=t(i),u=n(()=>o(l,s),[l,s]),d=t(a),f=c??d;return r(i.Provider,{value:u,children:r(a.Provider,{value:f,children:e})})}export{i as ConfigContext,a as PresentationContext,s as default};
1
+ "use client";import{createContext as e,useContext as t,useMemo as n}from"react";import{jsx as r}from"react/jsx-runtime";var i=e(null),a=e(void 0);function o(e,t){if(!e)return t??{};if(!t)return e;let n={...e};for(let r in t)n[r]={...e[r],...t[r]};return n}function s({children:e,defaultProps:s,presentation:c}){let l=t(i),u=n(()=>o(l,s),[l,s]),d=t(a),f=c??d;return r(i.Provider,{value:u,children:r(a.Provider,{value:f,children:e})})}export{i as ConfigContext,a as PresentationContext,s as default};
2
2
  //# sourceMappingURL=configProvider.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"configProvider.mjs","names":[],"sources":["../../../../package/common/configProvider/configProvider.tsx"],"sourcesContent":["import React, { createContext, useContext, useMemo } from 'react';\nimport type { ComponentDefaults, ConfigProviderProps } from './configProvider.types';\nimport type { Presentation } from '../configProvider/presentation.types';\n\nexport const ConfigContext = createContext<ComponentDefaults | null>(null);\n\n/**\n * One setting for every component that can present as a bottom sheet, kept separate from\n * `defaultProps` so that turning sheets on (or off) app-wide is a single switch rather than one\n * entry per component key — the components that can do it are unrelated to each other, and a\n * consumer who missed one would get sheets in half their app.\n */\nexport const PresentationContext = createContext<Presentation | undefined>(undefined);\n\n/**\n * Shallow-merge two default maps per component key, so nested ConfigProviders\n * compose: an inner provider's `Input` defaults extend (and override on\n * conflict) the outer provider's `Input` defaults rather than replacing them.\n */\nfunction mergeDefaults(parent: ComponentDefaults | null, own: ComponentDefaults | undefined): ComponentDefaults {\n if (!parent) return own ?? {};\n if (!own) return parent;\n\n const merged: Record<string, object> = { ...parent };\n for (const key in own) {\n merged[key] = {\n ...(parent as Record<string, object>)[key],\n ...(own as Record<string, object>)[key],\n };\n }\n return merged as ComponentDefaults;\n}\n\nfunction ConfigProvider({ children, defaultProps, presentation }: ConfigProviderProps) {\n const parent = useContext(ConfigContext);\n const value = useMemo(() => mergeDefaults(parent, defaultProps), [parent, defaultProps]);\n\n // A nested provider that doesn't set `presentation` keeps the outer one's, the same way\n // `defaultProps` compose.\n const inheritedPresentation = useContext(PresentationContext);\n const presentationValue = presentation ?? inheritedPresentation;\n\n return (\n <ConfigContext.Provider value={value}>\n <PresentationContext.Provider value={presentationValue}>{children}</PresentationContext.Provider>\n </ConfigContext.Provider>\n );\n}\n\nexport default ConfigProvider;\n"],"mappings":"2GAIA,IAAa,EAAgB,EAAwC,IAAI,EAQ5D,EAAsB,EAAwC,IAAA,EAAS,EAOpF,SAAS,EAAc,EAAkC,EAAuD,CAC9G,GAAI,CAAC,EAAQ,OAAO,GAAO,CAAC,EAC5B,GAAI,CAAC,EAAK,OAAO,EAEjB,IAAM,EAAiC,CAAE,GAAG,CAAO,EACnD,IAAK,IAAM,KAAO,EAChB,EAAO,GAAO,CACZ,GAAI,EAAkC,GACtC,GAAI,EAA+B,EACrC,EAEF,OAAO,CACT,CAEA,SAAS,EAAe,CAAE,WAAU,eAAc,gBAAqC,CACrF,IAAM,EAAS,EAAW,CAAa,EACjC,EAAQ,MAAc,EAAc,EAAQ,CAAY,EAAG,CAAC,EAAQ,CAAY,CAAC,EAIjF,EAAwB,EAAW,CAAmB,EACtD,EAAoB,GAAgB,EAE1C,OACE,EAAC,EAAc,SAAf,CAA+B,QAC7B,SAAA,EAAC,EAAoB,SAArB,CAA8B,MAAO,EAAoB,UAAuC,CAAA,CAC1E,CAAA,CAE5B"}
1
+ {"version":3,"file":"configProvider.mjs","names":[],"sources":["../../../../package/common/configProvider/configProvider.tsx"],"sourcesContent":["import React, { createContext, useContext, useMemo } from 'react';\nimport type { ComponentDefaults, ConfigProviderProps } from './configProvider.types';\nimport type { Presentation } from '../configProvider/presentation.types';\n\nexport const ConfigContext = createContext<ComponentDefaults | null>(null);\n\n/**\n * One setting for every component that can present as a bottom sheet, kept separate from\n * `defaultProps` so that turning sheets on (or off) app-wide is a single switch rather than one\n * entry per component key — the components that can do it are unrelated to each other, and a\n * consumer who missed one would get sheets in half their app.\n */\nexport const PresentationContext = createContext<Presentation | undefined>(undefined);\n\n/**\n * Shallow-merge two default maps per component key, so nested ConfigProviders\n * compose: an inner provider's `Input` defaults extend (and override on\n * conflict) the outer provider's `Input` defaults rather than replacing them.\n */\nfunction mergeDefaults(parent: ComponentDefaults | null, own: ComponentDefaults | undefined): ComponentDefaults {\n if (!parent) return own ?? {};\n if (!own) return parent;\n\n const merged: Record<string, object> = { ...parent };\n for (const key in own) {\n merged[key] = {\n ...(parent as Record<string, object>)[key],\n ...(own as Record<string, object>)[key],\n };\n }\n return merged as ComponentDefaults;\n}\n\nfunction ConfigProvider({ children, defaultProps, presentation }: ConfigProviderProps) {\n const parent = useContext(ConfigContext);\n const value = useMemo(() => mergeDefaults(parent, defaultProps), [parent, defaultProps]);\n\n // A nested provider that doesn't set `presentation` keeps the outer one's, the same way\n // `defaultProps` compose.\n const inheritedPresentation = useContext(PresentationContext);\n const presentationValue = presentation ?? inheritedPresentation;\n\n return (\n <ConfigContext.Provider value={value}>\n <PresentationContext.Provider value={presentationValue}>{children}</PresentationContext.Provider>\n </ConfigContext.Provider>\n );\n}\n\nexport default ConfigProvider;\n"],"mappings":"wHAIA,IAAa,EAAgB,EAAwC,IAAI,EAQ5D,EAAsB,EAAwC,IAAA,EAAS,EAOpF,SAAS,EAAc,EAAkC,EAAuD,CAC9G,GAAI,CAAC,EAAQ,OAAO,GAAO,CAAC,EAC5B,GAAI,CAAC,EAAK,OAAO,EAEjB,IAAM,EAAiC,CAAE,GAAG,CAAO,EACnD,IAAK,IAAM,KAAO,EAChB,EAAO,GAAO,CACZ,GAAI,EAAkC,GACtC,GAAI,EAA+B,EACrC,EAEF,OAAO,CACT,CAEA,SAAS,EAAe,CAAE,WAAU,eAAc,gBAAqC,CACrF,IAAM,EAAS,EAAW,CAAa,EACjC,EAAQ,MAAc,EAAc,EAAQ,CAAY,EAAG,CAAC,EAAQ,CAAY,CAAC,EAIjF,EAAwB,EAAW,CAAmB,EACtD,EAAoB,GAAgB,EAE1C,OACE,EAAC,EAAc,SAAf,CAA+B,QAC7B,SAAA,EAAC,EAAoB,SAArB,CAA8B,MAAO,EAAoB,UAAuC,CAAA,CAC1E,CAAA,CAE5B"}
@@ -1,2 +1,2 @@
1
- var e=function(e){return e.Default=`default`,e.Sheet=`sheet`,e.Auto=`auto`,e}({});export{e as Presentation};
1
+ "use client";var e=function(e){return e.Default=`default`,e.Sheet=`sheet`,e.Auto=`auto`,e}({});export{e as Presentation};
2
2
  //# sourceMappingURL=presentation.types.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"presentation.types.mjs","names":[],"sources":["../../../../package/common/configProvider/presentation.types.ts"],"sourcesContent":["/**\n * How a surface is presented on screen. Lives here rather than with any one of\n * the components that read it: `Modal`, `Popover`, `Dropdown` and `MultiSelect`\n * all take it, and `ConfigProvider` owns the app-wide switch that sets it for\n * every one of them at once.\n */\nexport enum Presentation {\n /** Wherever the component normally puts it: anchored to its trigger, or centred for a Modal. */\n Default = 'default',\n /** Pinned to the bottom of the screen, full width up to a maximum. */\n Sheet = 'sheet',\n /** A sheet on touch devices with a small screen, anchored everywhere else. */\n Auto = 'auto',\n}\n"],"mappings":"AAMA,IAAY,EAAL,SAAA,EAAA,OAEL,GAAA,QAAA,UAEA,EAAA,MAAA,QAEA,EAAA,KAAA,QACF,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"presentation.types.mjs","names":[],"sources":["../../../../package/common/configProvider/presentation.types.ts"],"sourcesContent":["/**\n * How a surface is presented on screen. Lives here rather than with any one of\n * the components that read it: `Modal`, `Popover`, `Dropdown` and `MultiSelect`\n * all take it, and `ConfigProvider` owns the app-wide switch that sets it for\n * every one of them at once.\n */\nexport enum Presentation {\n /** Wherever the component normally puts it: anchored to its trigger, or centred for a Modal. */\n Default = 'default',\n /** Pinned to the bottom of the screen, full width up to a maximum. */\n Sheet = 'sheet',\n /** A sheet on touch devices with a small screen, anchored everywhere else. */\n Auto = 'auto',\n}\n"],"mappings":"aAMA,IAAY,EAAL,SAAA,EAAA,OAEL,GAAA,QAAA,UAEA,EAAA,MAAA,QAEA,EAAA,KAAA,QACF,EAAA,CAAA,CAAA"}
@@ -1,2 +1,2 @@
1
- import{ConfigContext as e}from"./configProvider.mjs";import{useContext as t}from"react";function n(n,r){let i=t(e)?.[n];if(!i)return r;let a={...i};for(let e in r){let t=r[e];t!==void 0&&(a[e]=t)}return a}export{n as useComponentDefaults};
1
+ "use client";import{ConfigContext as e}from"./configProvider.mjs";import{useContext as t}from"react";function n(n,r){let i=t(e)?.[n];if(!i)return r;let a={...i};for(let e in r){let t=r[e];t!==void 0&&(a[e]=t)}return a}export{n as useComponentDefaults};
2
2
  //# sourceMappingURL=useComponentDefaults.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useComponentDefaults.mjs","names":[],"sources":["../../../../package/common/configProvider/useComponentDefaults.ts"],"sourcesContent":["import { useContext } from 'react';\nimport { ConfigContext } from './configProvider';\nimport type { ComponentDefaults } from './configProvider.types';\n\n/**\n * Merge global defaults from the nearest `ConfigProvider` **under** the props\n * the caller actually passed: an explicit prop always wins, a global default\n * fills in only props the caller left `undefined`, and the component's own\n * built-in default (its destructuring default) applies when neither is set.\n *\n * Call it at the very top of a component and destructure from the result\n * instead of from the raw props:\n *\n * ```tsx\n * function Input(props: InputProps) {\n * const { alwaysFloatLabel = false, ... } = useComponentDefaults('Input', props);\n * }\n * ```\n */\nexport function useComponentDefaults<P extends object>(component: keyof ComponentDefaults, props: P): P {\n const ctx = useContext(ConfigContext);\n const defaults = ctx?.[component];\n if (!defaults) return props;\n\n const merged: Record<string, unknown> = { ...defaults };\n for (const key in props) {\n const value = (props as Record<string, unknown>)[key];\n if (value !== undefined) merged[key] = value;\n }\n return merged as P;\n}\n"],"mappings":"wFAmBA,SAAgB,EAAuC,EAAoC,EAAa,CAEtG,IAAM,EADM,EAAW,CACN,CAAA,GAAM,GACvB,GAAI,CAAC,EAAU,OAAO,EAEtB,IAAM,EAAkC,CAAE,GAAG,CAAS,EACtD,IAAK,IAAM,KAAO,EAAO,CACvB,IAAM,EAAS,EAAkC,GAC7C,IAAU,IAAA,KAAW,EAAO,GAAO,EACzC,CACA,OAAO,CACT"}
1
+ {"version":3,"file":"useComponentDefaults.mjs","names":[],"sources":["../../../../package/common/configProvider/useComponentDefaults.ts"],"sourcesContent":["import { useContext } from 'react';\nimport { ConfigContext } from './configProvider';\nimport type { ComponentDefaults } from './configProvider.types';\n\n/**\n * Merge global defaults from the nearest `ConfigProvider` **under** the props\n * the caller actually passed: an explicit prop always wins, a global default\n * fills in only props the caller left `undefined`, and the component's own\n * built-in default (its destructuring default) applies when neither is set.\n *\n * Call it at the very top of a component and destructure from the result\n * instead of from the raw props:\n *\n * ```tsx\n * function Input(props: InputProps) {\n * const { alwaysFloatLabel = false, ... } = useComponentDefaults('Input', props);\n * }\n * ```\n */\nexport function useComponentDefaults<P extends object>(component: keyof ComponentDefaults, props: P): P {\n const ctx = useContext(ConfigContext);\n const defaults = ctx?.[component];\n if (!defaults) return props;\n\n const merged: Record<string, unknown> = { ...defaults };\n for (const key in props) {\n const value = (props as Record<string, unknown>)[key];\n if (value !== undefined) merged[key] = value;\n }\n return merged as P;\n}\n"],"mappings":"qGAmBA,SAAgB,EAAuC,EAAoC,EAAa,CAEtG,IAAM,EADM,EAAW,CACN,CAAA,GAAM,GACvB,GAAI,CAAC,EAAU,OAAO,EAEtB,IAAM,EAAkC,CAAE,GAAG,CAAS,EACtD,IAAK,IAAM,KAAO,EAAO,CACvB,IAAM,EAAS,EAAkC,GAC7C,IAAU,IAAA,KAAW,EAAO,GAAO,EACzC,CACA,OAAO,CACT"}
@@ -1,2 +1,2 @@
1
- import{ConfigContext as e}from"./configProvider.mjs";import{useContext as t}from"react";function n(n,r,i){let a=t(e)?.[n]?.labels;return{...i,...a,...r}}export{n as useLabels};
1
+ "use client";import{ConfigContext as e}from"./configProvider.mjs";import{useContext as t}from"react";function n(n,r,i){let a=t(e)?.[n]?.labels;return{...i,...a,...r}}export{n as useLabels};
2
2
  //# sourceMappingURL=useLabels.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLabels.mjs","names":[],"sources":["../../../../package/common/configProvider/useLabels.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { ConfigContext } from './configProvider';\nimport type { ComponentDefaults } from './configProvider.types';\n\n/**\n * Resolves the text a component renders of its own, per key, from three places:\n * the component's built-in English, the nearest `ConfigProvider`, and the\n * instance's `labels` prop, in that order of increasing precedence.\n *\n * Per key is the point, and the reason this exists next to `useComponentDefaults`\n * rather than relying on it. That one fills in whole props: a `labels` object on\n * an instance would replace the provider's entirely, so translating an app once\n * and overriding a single string on one instance would silently drop every other\n * translation for that component.\n *\n * ```tsx\n * const DEFAULT_LABELS: Required<ModalLabels> = { close: 'Close' };\n *\n * function Modal({ labels, ...rest }: ModalProps) {\n * const text = useLabels('Modal', labels, DEFAULT_LABELS);\n * // text.close\n * }\n * ```\n */\nexport function useLabels<L extends object>(\n component: keyof ComponentDefaults,\n labels: Partial<L> | undefined,\n defaults: L,\n): L {\n const ctx = useContext(ConfigContext);\n const global = (ctx?.[component] as { labels?: Partial<L> } | undefined)?.labels;\n // Not memoised on purpose: `defaults` and `labels` are object literals at every\n // call site, so a dependency list would never hit and the bookkeeping would\n // cost more than three spreads of a handful of strings.\n return { ...defaults, ...global, ...labels };\n}\n"],"mappings":"wFAyBA,SAAgB,EACd,EACA,EACA,EACG,CAEH,IAAM,EADM,EAAW,CACP,CAAA,GAAM,EAAA,EAAoD,OAI1E,MAAO,CAAE,GAAG,EAAU,GAAG,EAAQ,GAAG,CAAO,CAC7C"}
1
+ {"version":3,"file":"useLabels.mjs","names":[],"sources":["../../../../package/common/configProvider/useLabels.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { ConfigContext } from './configProvider';\nimport type { ComponentDefaults } from './configProvider.types';\n\n/**\n * Resolves the text a component renders of its own, per key, from three places:\n * the component's built-in English, the nearest `ConfigProvider`, and the\n * instance's `labels` prop, in that order of increasing precedence.\n *\n * Per key is the point, and the reason this exists next to `useComponentDefaults`\n * rather than relying on it. That one fills in whole props: a `labels` object on\n * an instance would replace the provider's entirely, so translating an app once\n * and overriding a single string on one instance would silently drop every other\n * translation for that component.\n *\n * ```tsx\n * const DEFAULT_LABELS: Required<ModalLabels> = { close: 'Close' };\n *\n * function Modal({ labels, ...rest }: ModalProps) {\n * const text = useLabels('Modal', labels, DEFAULT_LABELS);\n * // text.close\n * }\n * ```\n */\nexport function useLabels<L extends object>(\n component: keyof ComponentDefaults,\n labels: Partial<L> | undefined,\n defaults: L,\n): L {\n const ctx = useContext(ConfigContext);\n const global = (ctx?.[component] as { labels?: Partial<L> } | undefined)?.labels;\n // Not memoised on purpose: `defaults` and `labels` are object literals at every\n // call site, so a dependency list would never hit and the bookkeeping would\n // cost more than three spreads of a handful of strings.\n return { ...defaults, ...global, ...labels };\n}\n"],"mappings":"qGAyBA,SAAgB,EACd,EACA,EACA,EACG,CAEH,IAAM,EADM,EAAW,CACP,CAAA,GAAM,EAAA,EAAoD,OAI1E,MAAO,CAAE,GAAG,EAAU,GAAG,EAAQ,GAAG,CAAO,CAC7C"}
@@ -1,2 +1,2 @@
1
- import{PresentationContext as e}from"./configProvider.mjs";import{useContext as t}from"react";function n(){return t(e)}export{n as usePresentationDefault};
1
+ "use client";import{PresentationContext as e}from"./configProvider.mjs";import{useContext as t}from"react";function n(){return t(e)}export{n as usePresentationDefault};
2
2
  //# sourceMappingURL=usePresentationDefault.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePresentationDefault.mjs","names":[],"sources":["../../../../package/common/configProvider/usePresentationDefault.ts"],"sourcesContent":["import { useContext } from 'react';\nimport { PresentationContext } from './configProvider';\nimport type { Presentation } from '../configProvider/presentation.types';\n\n/**\n * The nearest `ConfigProvider`'s app-wide `presentation`, or `undefined` when none is set.\n *\n * Sits between a component-keyed global default and the component's own built-in default, so the\n * full order is: explicit prop → `defaultProps.<Component>.presentation` → this → built-in.\n */\nexport function usePresentationDefault(): Presentation | undefined {\n return useContext(PresentationContext);\n}\n"],"mappings":"8FAUA,SAAgB,GAAmD,CACjE,OAAO,EAAW,CAAmB,CACvC"}
1
+ {"version":3,"file":"usePresentationDefault.mjs","names":[],"sources":["../../../../package/common/configProvider/usePresentationDefault.ts"],"sourcesContent":["import { useContext } from 'react';\nimport { PresentationContext } from './configProvider';\nimport type { Presentation } from '../configProvider/presentation.types';\n\n/**\n * The nearest `ConfigProvider`'s app-wide `presentation`, or `undefined` when none is set.\n *\n * Sits between a component-keyed global default and the component's own built-in default, so the\n * full order is: explicit prop → `defaultProps.<Component>.presentation` → this → built-in.\n */\nexport function usePresentationDefault(): Presentation | undefined {\n return useContext(PresentationContext);\n}\n"],"mappings":"2GAUA,SAAgB,GAAmD,CACjE,OAAO,EAAW,CAAmB,CACvC"}
@@ -1,2 +1,2 @@
1
- import{useComponentDefaults as e}from"../configProvider/useComponentDefaults.mjs";import{useLabels as t}from"../configProvider/useLabels.mjs";import{ButtonStyleType as n}from"../button/button.types.mjs";import r from"../actionButtons/actionButtons.mjs";import i from"../modal/modal.mjs";import{useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c={submit:`Confirm`,cancel:`Cancel`};function l(l){let{children:u=null,className:d=``,onClose:f=()=>{},onConfirm:p=()=>{},title:m=``,content:h=null,isOpen:g=void 0,labels:_,isDelete:v=!1,actionButtonsProps:y={},style:b,...x}=e(`ConfirmModal`,l),S=t(`ConfirmModal`,_,c),[C,w]=a(!1),[T,E]=a(!1);function D(e=!1){w(!1),f(e)}async function O(){E(!0);try{await p(),D(!0)}catch{}finally{E(!1)}}let k=s(i,{title:m,isOpen:g===void 0?C:g,onClose:()=>D(),className:u?void 0:d,children:[h,o(r,{onClose:()=>D(),onSubmit:O,labels:{submit:S.submit,cancel:S.cancel},submitButtonStyle:v?n.Delete:void 0,isSubmitButtonLoading:T,...y})]});return u?s(`div`,{...x,className:d,style:b,children:[o(`span`,{onClick:()=>w(!0),children:u}),k]}):k}export{l as default};
1
+ "use client";import{useComponentDefaults as e}from"../configProvider/useComponentDefaults.mjs";import{useLabels as t}from"../configProvider/useLabels.mjs";import{ButtonStyleType as n}from"../button/button.types.mjs";import r from"../actionButtons/actionButtons.mjs";import i from"../modal/modal.mjs";import{useState as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c={submit:`Confirm`,cancel:`Cancel`};function l(l){let{children:u=null,className:d=``,onClose:f=()=>{},onConfirm:p=()=>{},title:m=``,content:h=null,isOpen:g=void 0,labels:_,isDelete:v=!1,actionButtonsProps:y={},style:b,...x}=e(`ConfirmModal`,l),S=t(`ConfirmModal`,_,c),[C,w]=a(!1),[T,E]=a(!1);function D(e=!1){w(!1),f(e)}async function O(){E(!0);try{await p(),D(!0)}catch{}finally{E(!1)}}let k=s(i,{title:m,isOpen:g===void 0?C:g,onClose:()=>D(),className:u?void 0:d,children:[h,o(r,{onClose:()=>D(),onSubmit:O,labels:{submit:S.submit,cancel:S.cancel},submitButtonStyle:v?n.Delete:void 0,isSubmitButtonLoading:T,...y})]});return u?s(`div`,{...x,className:d,style:b,children:[o(`span`,{onClick:()=>w(!0),children:u}),k]}):k}export{l as default};
2
2
  //# sourceMappingURL=confirmModal.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"confirmModal.mjs","names":[],"sources":["../../../../package/common/confirmModal/confirmModal.tsx"],"sourcesContent":["import { useState, type ReactElement } from 'react';\n\nimport Modal from '../modal';\nimport { ActionButtons } from '../actionButtons';\nimport { ButtonStyleType } from '../button';\nimport { useComponentDefaults, useLabels } from '../configProvider';\nimport type { ConfirmModalLabels, ConfirmModalProps } from './confirmModal.types';\n\nconst DEFAULT_LABELS: Required<ConfirmModalLabels> = {\n submit: 'Confirm',\n cancel: 'Cancel',\n};\n\nfunction ConfirmModal(props: ConfirmModalProps): ReactElement {\n const {\n children = null,\n className = '',\n onClose = () => {},\n onConfirm = () => {},\n title = '',\n content = null,\n isOpen: propIsOpen = undefined,\n labels,\n isDelete = false,\n actionButtonsProps = {},\n style,\n ...rest\n } = useComponentDefaults('ConfirmModal', props);\n const text = useLabels('ConfirmModal', labels, DEFAULT_LABELS);\n const [internalOpen, setInternalOpen] = useState(false);\n const [isSubmitting, setIsSubmitting] = useState(false);\n\n function handleClose(didSubmit = false) {\n setInternalOpen(false);\n onClose(didSubmit);\n }\n\n async function handleConfirm() {\n setIsSubmitting(true);\n try {\n await onConfirm();\n handleClose(true);\n } catch {\n // Nothing is awaiting this handler, so a rejection would surface as an unhandled one.\n // The dialog staying open is the signal that the action did not go through; reporting\n // the failure itself belongs to whoever wrote `onConfirm`.\n } finally {\n setIsSubmitting(false);\n }\n }\n\n const isOpen = propIsOpen === undefined ? internalOpen : propIsOpen;\n\n const modal = (\n <Modal title={title} isOpen={isOpen} onClose={() => handleClose()} className={children ? undefined : className}>\n {content}\n <ActionButtons\n onClose={() => handleClose()}\n onSubmit={handleConfirm}\n labels={{ submit: text.submit, cancel: text.cancel }}\n submitButtonStyle={isDelete ? ButtonStyleType.Delete : undefined}\n isSubmitButtonLoading={isSubmitting}\n {...actionButtonsProps}\n />\n </Modal>\n );\n\n if (!children) return modal;\n\n return (\n <div {...rest} className={className} style={style}>\n <span onClick={() => setInternalOpen(true)}>{children}</span>\n {modal}\n </div>\n );\n}\n\nexport default ConfirmModal;\n"],"mappings":"kXAQA,IAAM,EAA+C,CACnD,OAAQ,UACR,OAAQ,QACV,EAEA,SAAS,EAAa,EAAwC,CAC5D,GAAM,CACJ,WAAW,KACX,YAAY,GACZ,cAAgB,CAAC,EACjB,gBAAkB,CAAC,EACnB,QAAQ,GACR,UAAU,KACV,OAAQ,EAAa,IAAA,GACrB,SACA,WAAW,GACX,qBAAqB,CAAC,EACtB,QACA,GAAG,GACD,EAAqB,eAAgB,CAAK,EACxC,EAAO,EAAU,eAAgB,EAAQ,CAAc,EACvD,CAAC,EAAc,GAAmB,EAAS,EAAK,EAChD,CAAC,EAAc,GAAmB,EAAS,EAAK,EAEtD,SAAS,EAAY,EAAY,GAAO,CACtC,EAAgB,EAAK,EACrB,EAAQ,CAAS,CACnB,CAEA,eAAe,GAAgB,CAC7B,EAAgB,EAAI,EACpB,GAAI,CACF,MAAM,EAAU,EAChB,EAAY,EAAI,CAClB,MAAQ,CAIR,QAAU,CACR,EAAgB,EAAK,CACvB,CACF,CAIA,IAAM,EACJ,EAAC,EAAD,CAAc,QAAe,OAHhB,IAAe,IAAA,GAAY,EAAe,EAGlB,YAAe,EAAY,EAAG,UAAW,EAAW,IAAA,GAAY,EAArG,SAAA,CACG,EACD,EAAC,EAAD,CACE,YAAe,EAAY,EAC3B,SAAU,EACV,OAAQ,CAAE,OAAQ,EAAK,OAAQ,OAAQ,EAAK,MAAO,EACnD,kBAAmB,EAAW,EAAgB,OAAS,IAAA,GACvD,sBAAuB,EACvB,GAAI,CACL,CAAA,CACI,IAKT,OAFK,EAGH,EAAC,MAAD,CAAK,GAAI,EAAiB,YAAkB,QAA5C,SAAA,CACE,EAAC,OAAD,CAAM,YAAe,EAAgB,EAAI,EAAI,UAAe,CAAA,EAC3D,CACE,IANe,CAQxB"}
1
+ {"version":3,"file":"confirmModal.mjs","names":[],"sources":["../../../../package/common/confirmModal/confirmModal.tsx"],"sourcesContent":["import { useState, type ReactElement } from 'react';\n\nimport Modal from '../modal';\nimport { ActionButtons } from '../actionButtons';\nimport { ButtonStyleType } from '../button';\nimport { useComponentDefaults, useLabels } from '../configProvider';\nimport type { ConfirmModalLabels, ConfirmModalProps } from './confirmModal.types';\n\nconst DEFAULT_LABELS: Required<ConfirmModalLabels> = {\n submit: 'Confirm',\n cancel: 'Cancel',\n};\n\nfunction ConfirmModal(props: ConfirmModalProps): ReactElement {\n const {\n children = null,\n className = '',\n onClose = () => {},\n onConfirm = () => {},\n title = '',\n content = null,\n isOpen: propIsOpen = undefined,\n labels,\n isDelete = false,\n actionButtonsProps = {},\n style,\n ...rest\n } = useComponentDefaults('ConfirmModal', props);\n const text = useLabels('ConfirmModal', labels, DEFAULT_LABELS);\n const [internalOpen, setInternalOpen] = useState(false);\n const [isSubmitting, setIsSubmitting] = useState(false);\n\n function handleClose(didSubmit = false) {\n setInternalOpen(false);\n onClose(didSubmit);\n }\n\n async function handleConfirm() {\n setIsSubmitting(true);\n try {\n await onConfirm();\n handleClose(true);\n } catch {\n // Nothing is awaiting this handler, so a rejection would surface as an unhandled one.\n // The dialog staying open is the signal that the action did not go through; reporting\n // the failure itself belongs to whoever wrote `onConfirm`.\n } finally {\n setIsSubmitting(false);\n }\n }\n\n const isOpen = propIsOpen === undefined ? internalOpen : propIsOpen;\n\n const modal = (\n <Modal title={title} isOpen={isOpen} onClose={() => handleClose()} className={children ? undefined : className}>\n {content}\n <ActionButtons\n onClose={() => handleClose()}\n onSubmit={handleConfirm}\n labels={{ submit: text.submit, cancel: text.cancel }}\n submitButtonStyle={isDelete ? ButtonStyleType.Delete : undefined}\n isSubmitButtonLoading={isSubmitting}\n {...actionButtonsProps}\n />\n </Modal>\n );\n\n if (!children) return modal;\n\n return (\n <div {...rest} className={className} style={style}>\n <span onClick={() => setInternalOpen(true)}>{children}</span>\n {modal}\n </div>\n );\n}\n\nexport default ConfirmModal;\n"],"mappings":"+XAQA,IAAM,EAA+C,CACnD,OAAQ,UACR,OAAQ,QACV,EAEA,SAAS,EAAa,EAAwC,CAC5D,GAAM,CACJ,WAAW,KACX,YAAY,GACZ,cAAgB,CAAC,EACjB,gBAAkB,CAAC,EACnB,QAAQ,GACR,UAAU,KACV,OAAQ,EAAa,IAAA,GACrB,SACA,WAAW,GACX,qBAAqB,CAAC,EACtB,QACA,GAAG,GACD,EAAqB,eAAgB,CAAK,EACxC,EAAO,EAAU,eAAgB,EAAQ,CAAc,EACvD,CAAC,EAAc,GAAmB,EAAS,EAAK,EAChD,CAAC,EAAc,GAAmB,EAAS,EAAK,EAEtD,SAAS,EAAY,EAAY,GAAO,CACtC,EAAgB,EAAK,EACrB,EAAQ,CAAS,CACnB,CAEA,eAAe,GAAgB,CAC7B,EAAgB,EAAI,EACpB,GAAI,CACF,MAAM,EAAU,EAChB,EAAY,EAAI,CAClB,MAAQ,CAIR,QAAU,CACR,EAAgB,EAAK,CACvB,CACF,CAIA,IAAM,EACJ,EAAC,EAAD,CAAc,QAAe,OAHhB,IAAe,IAAA,GAAY,EAAe,EAGlB,YAAe,EAAY,EAAG,UAAW,EAAW,IAAA,GAAY,EAArG,SAAA,CACG,EACD,EAAC,EAAD,CACE,YAAe,EAAY,EAC3B,SAAU,EACV,OAAQ,CAAE,OAAQ,EAAK,OAAQ,OAAQ,EAAK,MAAO,EACnD,kBAAmB,EAAW,EAAgB,OAAS,IAAA,GACvD,sBAAuB,EACvB,GAAI,CACL,CAAA,CACI,IAKT,OAFK,EAGH,EAAC,MAAD,CAAK,GAAI,EAAiB,YAAkB,QAA5C,SAAA,CACE,EAAC,OAAD,CAAM,YAAe,EAAgB,EAAI,EAAI,UAAe,CAAA,EAC3D,CACE,IANe,CAQxB"}
@@ -1,2 +1,2 @@
1
- import e from"../../../interactableDiv/index.mjs";import t from"./datePickerMonth.module.mjs";import{getLocale as n}from"../../../../services/localization.mjs";import{addDays as r,getDateFromDayMonthAndYear as i,getDayMonthAndYearOfDate as a,getDaysInMonth as o,getStartWeekDayOfMonth as s,getWeekDays as c}from"../../dateFunctions.mjs";import{useEffect as l,useRef as u,useState as d}from"react";import f from"classnames";import{jsx as p,jsxs as m}from"react/jsx-runtime";function h(e,t,n){if(n){let r=a(n);if(r.month===e&&r.year===t)return r.day}let r=a(new Date);return r.month===e&&r.year===t?r.day:1}function g(e,t,n,r,o){let{day:s,month:c,year:l}=r?a(r):{day:void 0,month:void 0,year:void 0},{day:u,month:d,year:f}=o?a(o):{day:void 0,month:void 0,year:void 0},p=i(e,t,n),m=e===s&&t===c&&n===l,h=e===u&&t===d&&n===f,g=!1;if(s!==void 0&&c!==void 0&&l!==void 0&&u!==void 0&&d!==void 0&&f!==void 0){let e=i(s,c,l),t=i(u,d,f);g=p.getTime()>=e.getTime()&&p.getTime()<=t.getTime()}return{isStartDate:m,isInRange:g,isEndDate:h}}function _(e,t,n,r,o){let s=i(e,t,n);if(r){let{day:e,month:t,year:n}=a(r);if(s<i(e,t,n))return!0}if(o){let{day:e,month:t,year:n}=a(o);if(s>i(e,t,n))return!0}return!1}function v(e,t,n){let{day:r,month:i,year:o}=a(new Date);return e===r&&t===i&&n===o}function y({style:a,className:y=``,month:b=new Date().getMonth()+1,year:x=new Date().getFullYear(),onSelect:S=()=>null,selectionStart:C,selectionEnd:w,minDate:T=null,maxDate:E=null,onNavigateMonth:D}){let O=n(`-`),k=o(b,x),A=s(b,x),j=u({}),[M,N]=d(()=>h(b,x,C)),P=u(null);l(()=>{if(P.current!=null){let e=P.current;P.current=null,N(e),j.current[e]?.focus()}else N(h(b,x,C))},[b,x]);function F(e,t){let n=0;if(e.key===`ArrowRight`)n=1;else if(e.key===`ArrowLeft`)n=-1;else if(e.key===`ArrowDown`)n=7;else if(e.key===`ArrowUp`)n=-7;else return;e.preventDefault();let i=r(t,b,x,n);i.month!==b||i.year!==x?(P.current=i.day,D?.(i.month>b||i.year>x?1:-1)):(N(i.day),j.current[i.day]?.focus())}return p(`div`,{className:f(t.datePickerMonth,y),style:a,children:m(`div`,{className:f(t.datePickerMonthContent),children:[c(O).map((e,t)=>p(`div`,{children:e},t)),Array.from(Array(A-1).keys()).map(e=>p(`div`,{className:f(t.datePickerMonthItem,t.datePickerMonthPlaceholder)},e)),Array.from(Array(k).keys()).map(n=>{let r=n+1,a=g(r,b,x,C,w),o=_(r,b,x,T,E),s=v(r,b,x);return p(e,{ref:e=>{j.current[r]=e},tabIndex:r===M?0:-1,onKeyDown:e=>F(e,r),onClick:()=>o?null:S(i(r,b,x)),className:f(t.datePickerMonthDay,t.datePickerMonthItem,{[t.datePickerMonthDaySelected]:a.isInRange,[t.datePickerMonthDaySelectedStart]:a.isStartDate,[t.datePickerMonthDaySelectedEnd]:a.isEndDate,[t.datePickerMonthDayDisabled]:o,[t.datePickerMonthDayToday]:s}),children:r},r)}),Array.from(Array(42-(A+k-1)).keys()).map(e=>p(`div`,{className:f(t.datePickerMonthItem,t.datePickerMonthPlaceholder),children:`\xA0`},e))]})})}export{y as default};
1
+ "use client";import e from"../../../interactableDiv/index.mjs";import t from"./datePickerMonth.module.mjs";import{getLocale as n}from"../../../../services/localization.mjs";import{addDays as r,getDateFromDayMonthAndYear as i,getDayMonthAndYearOfDate as a,getDaysInMonth as o,getStartWeekDayOfMonth as s,getWeekDays as c}from"../../dateFunctions.mjs";import{useEffect as l,useRef as u,useState as d}from"react";import f from"classnames";import{jsx as p,jsxs as m}from"react/jsx-runtime";function h(e,t,n){if(n){let r=a(n);if(r.month===e&&r.year===t)return r.day}let r=a(new Date);return r.month===e&&r.year===t?r.day:1}function g(e,t,n,r,o){let{day:s,month:c,year:l}=r?a(r):{day:void 0,month:void 0,year:void 0},{day:u,month:d,year:f}=o?a(o):{day:void 0,month:void 0,year:void 0},p=i(e,t,n),m=e===s&&t===c&&n===l,h=e===u&&t===d&&n===f,g=!1;if(s!==void 0&&c!==void 0&&l!==void 0&&u!==void 0&&d!==void 0&&f!==void 0){let e=i(s,c,l),t=i(u,d,f);g=p.getTime()>=e.getTime()&&p.getTime()<=t.getTime()}return{isStartDate:m,isInRange:g,isEndDate:h}}function _(e,t,n,r,o){let s=i(e,t,n);if(r){let{day:e,month:t,year:n}=a(r);if(s<i(e,t,n))return!0}if(o){let{day:e,month:t,year:n}=a(o);if(s>i(e,t,n))return!0}return!1}function v(e,t,n){let{day:r,month:i,year:o}=a(new Date);return e===r&&t===i&&n===o}function y({style:a,className:y=``,month:b=new Date().getMonth()+1,year:x=new Date().getFullYear(),onSelect:S=()=>null,selectionStart:C,selectionEnd:w,minDate:T=null,maxDate:E=null,onNavigateMonth:D}){let O=n(`-`),k=o(b,x),A=s(b,x),j=u({}),[M,N]=d(()=>h(b,x,C)),P=u(null);l(()=>{if(P.current!=null){let e=P.current;P.current=null,N(e),j.current[e]?.focus()}else N(h(b,x,C))},[b,x]);function F(e,t){let n=0;if(e.key===`ArrowRight`)n=1;else if(e.key===`ArrowLeft`)n=-1;else if(e.key===`ArrowDown`)n=7;else if(e.key===`ArrowUp`)n=-7;else return;e.preventDefault();let i=r(t,b,x,n);i.month!==b||i.year!==x?(P.current=i.day,D?.(i.month>b||i.year>x?1:-1)):(N(i.day),j.current[i.day]?.focus())}return p(`div`,{className:f(t.datePickerMonth,y),style:a,children:m(`div`,{className:f(t.datePickerMonthContent),children:[c(O).map((e,t)=>p(`div`,{children:e},t)),Array.from(Array(A-1).keys()).map(e=>p(`div`,{className:f(t.datePickerMonthItem,t.datePickerMonthPlaceholder)},e)),Array.from(Array(k).keys()).map(n=>{let r=n+1,a=g(r,b,x,C,w),o=_(r,b,x,T,E),s=v(r,b,x);return p(e,{ref:e=>{j.current[r]=e},tabIndex:r===M?0:-1,onKeyDown:e=>F(e,r),onClick:()=>o?null:S(i(r,b,x)),className:f(t.datePickerMonthDay,t.datePickerMonthItem,{[t.datePickerMonthDaySelected]:a.isInRange,[t.datePickerMonthDaySelectedStart]:a.isStartDate,[t.datePickerMonthDaySelectedEnd]:a.isEndDate,[t.datePickerMonthDayDisabled]:o,[t.datePickerMonthDayToday]:s}),children:r},r)}),Array.from(Array(42-(A+k-1)).keys()).map(e=>p(`div`,{className:f(t.datePickerMonthItem,t.datePickerMonthPlaceholder),children:`\xA0`},e))]})})}export{y as default};
2
2
  //# sourceMappingURL=datePickerMonth.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"datePickerMonth.mjs","names":[],"sources":["../../../../../../package/common/datePicker/components/datePickerMonth/datePickerMonth.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport cx from 'classnames';\n\nimport styles from './datePickerMonth.module.pcss';\nimport { getLocale } from 'services/localization';\nimport InteractableDiv from 'components/common/interactableDiv';\nimport {\n addDays,\n getDateFromDayMonthAndYear,\n getDayMonthAndYearOfDate,\n getDaysInMonth,\n getStartWeekDayOfMonth,\n getWeekDays,\n} from '../../dateFunctions';\nimport type { DatePickerMonthProps } from './datePickerMonth.types';\n\n// Which day gets the sole tab stop when this month first renders (or when the displayed\n// month changes via the header, not via arrow navigation): the selected day if it falls in\n// this month, else today if it falls in this month, else the 1st.\nfunction getDefaultFocusedDay(month: number, year: number, selectionStart: Date | undefined): number {\n if (selectionStart) {\n const sel = getDayMonthAndYearOfDate(selectionStart);\n if (sel.month === month && sel.year === year) return sel.day;\n }\n const today = getDayMonthAndYearOfDate(new Date());\n if (today.month === month && today.year === year) return today.day;\n return 1;\n}\n\nfunction checkSelected(\n day: number,\n month: number,\n year: number,\n selectionStart: Date | undefined,\n selectionEnd: Date | undefined,\n) {\n const {\n day: startDay,\n month: startMonth,\n year: startYear,\n } = selectionStart ? getDayMonthAndYearOfDate(selectionStart) : { day: undefined, month: undefined, year: undefined };\n const {\n day: endDay,\n month: endMonth,\n year: endYear,\n } = selectionEnd ? getDayMonthAndYearOfDate(selectionEnd) : { day: undefined, month: undefined, year: undefined };\n\n const toCheckNoTime = getDateFromDayMonthAndYear(day, month, year);\n\n const isStartDate = day === startDay && month === startMonth && year === startYear;\n const isEndDate = day === endDay && month === endMonth && year === endYear;\n\n let isInRange = false;\n if (\n startDay !== undefined &&\n startMonth !== undefined &&\n startYear !== undefined &&\n endDay !== undefined &&\n endMonth !== undefined &&\n endYear !== undefined\n ) {\n const selectionStartNoTime = getDateFromDayMonthAndYear(startDay, startMonth, startYear);\n const selectionEndNoTime = getDateFromDayMonthAndYear(endDay, endMonth, endYear);\n isInRange =\n toCheckNoTime.getTime() >= selectionStartNoTime.getTime() &&\n toCheckNoTime.getTime() <= selectionEndNoTime.getTime();\n }\n\n return { isStartDate, isInRange, isEndDate };\n}\n\nfunction checkDisabled(\n day: number,\n month: number,\n year: number,\n minDate: Date | null | undefined,\n maxDate: Date | null | undefined,\n): boolean {\n const toCheckNoTime = getDateFromDayMonthAndYear(day, month, year);\n\n if (minDate) {\n const { day: minDay, month: minMonth, year: minYear } = getDayMonthAndYearOfDate(minDate);\n if (toCheckNoTime < getDateFromDayMonthAndYear(minDay, minMonth, minYear)) return true;\n }\n\n if (maxDate) {\n const { day: maxDay, month: maxMonth, year: maxYear } = getDayMonthAndYearOfDate(maxDate);\n if (toCheckNoTime > getDateFromDayMonthAndYear(maxDay, maxMonth, maxYear)) return true;\n }\n\n return false;\n}\n\nfunction checkIsToday(day: number, month: number, year: number): boolean {\n const { day: currDay, month: currMonth, year: currYear } = getDayMonthAndYearOfDate(new Date());\n return day === currDay && month === currMonth && year === currYear;\n}\n\nexport default function DatePickerMonth({\n style,\n className = '',\n month = new Date().getMonth() + 1,\n year = new Date().getFullYear(),\n onSelect = () => null,\n selectionStart,\n selectionEnd,\n minDate = null,\n maxDate = null,\n onNavigateMonth,\n}: DatePickerMonthProps) {\n const locale = getLocale('-');\n const daysInMonth = getDaysInMonth(month, year);\n const startWeekDayOfMonth = getStartWeekDayOfMonth(month, year);\n\n const dayRefs = useRef<Record<number, HTMLDivElement | null>>({});\n const [focusedDay, setFocusedDay] = useState(() => getDefaultFocusedDay(month, year, selectionStart));\n\n // A day arrowed onto in an adjacent month, waiting for that month's grid to render so it\n // can be focused. `onNavigateMonth` only shifts `month`/`year` — the actual DOM focus has\n // to happen after this component re-renders with the new days, hence the effect below.\n const pendingFocusDayRef = useRef<number | null>(null);\n\n useEffect(() => {\n if (pendingFocusDayRef.current != null) {\n const day = pendingFocusDayRef.current;\n pendingFocusDayRef.current = null;\n setFocusedDay(day);\n dayRefs.current[day]?.focus();\n } else {\n // The displayed month changed some other way (header chevrons, month/year dropdowns) —\n // re-pick a sensible tab stop, but don't steal focus from whatever the user just used.\n setFocusedDay(getDefaultFocusedDay(month, year, selectionStart));\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [month, year]);\n\n function handleDayKeyDown(event: React.KeyboardEvent<HTMLDivElement>, day: number) {\n let delta = 0;\n if (event.key === 'ArrowRight') delta = 1;\n else if (event.key === 'ArrowLeft') delta = -1;\n else if (event.key === 'ArrowDown') delta = 7;\n else if (event.key === 'ArrowUp') delta = -7;\n else return;\n\n event.preventDefault();\n const next = addDays(day, month, year, delta);\n\n if (next.month !== month || next.year !== year) {\n pendingFocusDayRef.current = next.day;\n onNavigateMonth?.(next.month > month || next.year > year ? 1 : -1);\n } else {\n setFocusedDay(next.day);\n dayRefs.current[next.day]?.focus();\n }\n }\n\n return (\n <div className={cx(styles.datePickerMonth, className)} style={style}>\n <div className={cx(styles.datePickerMonthContent)}>\n {getWeekDays(locale).map((weekDay, index) => (\n <div key={index}>{weekDay}</div>\n ))}\n {Array.from(Array(startWeekDayOfMonth - 1).keys()).map((index) => (\n <div key={index} className={cx(styles.datePickerMonthItem, styles.datePickerMonthPlaceholder)} />\n ))}\n {Array.from(Array(daysInMonth).keys()).map((index) => {\n const day = index + 1;\n const selectedRes = checkSelected(day, month, year, selectionStart, selectionEnd);\n const isDisabled = checkDisabled(day, month, year, minDate, maxDate);\n const isToday = checkIsToday(day, month, year);\n\n return (\n <InteractableDiv\n key={day}\n ref={(el) => {\n dayRefs.current[day] = el;\n }}\n tabIndex={day === focusedDay ? 0 : -1}\n onKeyDown={(event) => handleDayKeyDown(event, day)}\n onClick={() => (isDisabled ? null : onSelect(getDateFromDayMonthAndYear(day, month, year)))}\n className={cx(styles.datePickerMonthDay, styles.datePickerMonthItem, {\n [styles.datePickerMonthDaySelected]: selectedRes.isInRange,\n [styles.datePickerMonthDaySelectedStart]: selectedRes.isStartDate,\n [styles.datePickerMonthDaySelectedEnd]: selectedRes.isEndDate,\n [styles.datePickerMonthDayDisabled]: isDisabled,\n [styles.datePickerMonthDayToday]: isToday,\n })}\n >\n {day}\n </InteractableDiv>\n );\n })}\n {Array.from(Array(42 - (startWeekDayOfMonth + daysInMonth - 1)).keys()).map((index) => (\n <div key={index} className={cx(styles.datePickerMonthItem, styles.datePickerMonthPlaceholder)}>\n &nbsp;\n </div>\n ))}\n </div>\n </div>\n );\n}\n"],"mappings":"ydAmBA,SAAS,EAAqB,EAAe,EAAc,EAA0C,CACnG,GAAI,EAAgB,CAClB,IAAM,EAAM,EAAyB,CAAc,EACnD,GAAI,EAAI,QAAU,GAAS,EAAI,OAAS,EAAM,OAAO,EAAI,GAC3D,CACA,IAAM,EAAQ,EAAyB,IAAI,IAAM,EAEjD,OADI,EAAM,QAAU,GAAS,EAAM,OAAS,EAAa,EAAM,IACxD,CACT,CAEA,SAAS,EACP,EACA,EACA,EACA,EACA,EACA,CACA,GAAM,CACJ,IAAK,EACL,MAAO,EACP,KAAM,GACJ,EAAiB,EAAyB,CAAc,EAAI,CAAE,IAAK,IAAA,GAAW,MAAO,IAAA,GAAW,KAAM,IAAA,EAAU,EAC9G,CACJ,IAAK,EACL,MAAO,EACP,KAAM,GACJ,EAAe,EAAyB,CAAY,EAAI,CAAE,IAAK,IAAA,GAAW,MAAO,IAAA,GAAW,KAAM,IAAA,EAAU,EAE1G,EAAgB,EAA2B,EAAK,EAAO,CAAI,EAE3D,EAAc,IAAQ,GAAY,IAAU,GAAc,IAAS,EACnE,EAAY,IAAQ,GAAU,IAAU,GAAY,IAAS,EAE/D,EAAY,GAChB,GACE,IAAa,IAAA,IACb,IAAe,IAAA,IACf,IAAc,IAAA,IACd,IAAW,IAAA,IACX,IAAa,IAAA,IACb,IAAY,IAAA,GACZ,CACA,IAAM,EAAuB,EAA2B,E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AAM,EAAS,CAAO,EAC7D,EAAU,EAAa,EAAK,EAAO,CAAI,EAE7C,OACE,EAAC,EAAD,CAEE,IAAM,GAAO,CACX,EAAQ,QAAQ,GAAO,CACzB,EACA,SAAU,IAAQ,EAAa,EAAI,GACnC,UAAY,GAAU,EAAiB,EAAO,CAAG,EACjD,YAAgB,EAAa,KAAO,EAAS,EAA2B,EAAK,EAAO,CAAI,CAAC,EACzF,UAAW,EAAG,EAAO,mBAAoB,EAAO,oBAAqB,EAClE,EAAO,4BAA6B,EAAY,WAChD,EAAO,iCAAkC,EAAY,aACrD,EAAO,+BAAgC,EAAY,WACnD,EAAO,4BAA6B,GACpC,EAAO,yBAA0B,CACpC,CAAC,EAEA,SAAA,CACc,EAhBV,CAgBU,CAErB,CAAC,EACA,MAAM,KAAK,MAAM,IAAM,EAAsB,EAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAK,GAC3E,EAAC,MAAD,CAAiB,UAAW,EAAG,EAAO,oBAAqB,EAAO,0BAA0B,EAAG,SAAA,MAE1F,EAFK,CAEL,CACN,CACE,GACF,CAAA,CAET"}
1
+ {"version":3,"file":"datePickerMonth.mjs","names":[],"sources":["../../../../../../package/common/datePicker/components/datePickerMonth/datePickerMonth.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport cx from 'classnames';\n\nimport styles from './datePickerMonth.module.pcss';\nimport { getLocale } from 'services/localization';\nimport InteractableDiv from 'components/common/interactableDiv';\nimport {\n addDays,\n getDateFromDayMonthAndYear,\n getDayMonthAndYearOfDate,\n getDaysInMonth,\n getStartWeekDayOfMonth,\n getWeekDays,\n} from '../../dateFunctions';\nimport type { DatePickerMonthProps } from './datePickerMonth.types';\n\n// Which day gets the sole tab stop when this month first renders (or when the displayed\n// month changes via the header, not via arrow navigation): the selected day if it falls in\n// this month, else today if it falls in this month, else the 1st.\nfunction getDefaultFocusedDay(month: number, year: number, selectionStart: Date | undefined): number {\n if (selectionStart) {\n const sel = getDayMonthAndYearOfDate(selectionStart);\n if (sel.month === month && sel.year === year) return sel.day;\n }\n const today = getDayMonthAndYearOfDate(new Date());\n if (today.month === month && today.year === year) return today.day;\n return 1;\n}\n\nfunction checkSelected(\n day: number,\n month: number,\n year: number,\n selectionStart: Date | undefined,\n selectionEnd: Date | undefined,\n) {\n const {\n day: startDay,\n month: startMonth,\n year: startYear,\n } = selectionStart ? getDayMonthAndYearOfDate(selectionStart) : { day: undefined, month: undefined, year: undefined };\n const {\n day: endDay,\n month: endMonth,\n year: endYear,\n } = selectionEnd ? getDayMonthAndYearOfDate(selectionEnd) : { day: undefined, month: undefined, year: undefined };\n\n const toCheckNoTime = getDateFromDayMonthAndYear(day, month, year);\n\n const isStartDate = day === startDay && month === startMonth && year === startYear;\n const isEndDate = day === endDay && month === endMonth && year === endYear;\n\n let isInRange = false;\n if (\n startDay !== undefined &&\n startMonth !== undefined &&\n startYear !== undefined &&\n endDay !== undefined &&\n endMonth !== undefined &&\n endYear !== undefined\n ) {\n const selectionStartNoTime = getDateFromDayMonthAndYear(startDay, startMonth, startYear);\n const selectionEndNoTime = getDateFromDayMonthAndYear(endDay, endMonth, endYear);\n isInRange =\n toCheckNoTime.getTime() >= selectionStartNoTime.getTime() &&\n toCheckNoTime.getTime() <= selectionEndNoTime.getTime();\n }\n\n return { isStartDate, isInRange, isEndDate };\n}\n\nfunction checkDisabled(\n day: number,\n month: number,\n year: number,\n minDate: Date | null | undefined,\n maxDate: Date | null | undefined,\n): boolean {\n const toCheckNoTime = getDateFromDayMonthAndYear(day, month, year);\n\n if (minDate) {\n const { day: minDay, month: minMonth, year: minYear } = getDayMonthAndYearOfDate(minDate);\n if (toCheckNoTime < getDateFromDayMonthAndYear(minDay, minMonth, minYear)) return true;\n }\n\n if (maxDate) {\n const { day: maxDay, month: maxMonth, year: maxYear } = getDayMonthAndYearOfDate(maxDate);\n if (toCheckNoTime > getDateFromDayMonthAndYear(maxDay, maxMonth, maxYear)) return true;\n }\n\n return false;\n}\n\nfunction checkIsToday(day: number, month: number, year: number): boolean {\n const { day: currDay, month: currMonth, year: currYear } = getDayMonthAndYearOfDate(new Date());\n return day === currDay && month === currMonth && year === currYear;\n}\n\nexport default function DatePickerMonth({\n style,\n className = '',\n month = new Date().getMonth() + 1,\n year = new Date().getFullYear(),\n onSelect = () => null,\n selectionStart,\n selectionEnd,\n minDate = null,\n maxDate = null,\n onNavigateMonth,\n}: DatePickerMonthProps) {\n const locale = getLocale('-');\n const daysInMonth = getDaysInMonth(month, year);\n const startWeekDayOfMonth = getStartWeekDayOfMonth(month, year);\n\n const dayRefs = useRef<Record<number, HTMLDivElement | null>>({});\n const [focusedDay, setFocusedDay] = useState(() => getDefaultFocusedDay(month, year, selectionStart));\n\n // A day arrowed onto in an adjacent month, waiting for that month's grid to render so it\n // can be focused. `onNavigateMonth` only shifts `month`/`year` — the actual DOM focus has\n // to happen after this component re-renders with the new days, hence the effect below.\n const pendingFocusDayRef = useRef<number | null>(null);\n\n useEffect(() => {\n if (pendingFocusDayRef.current != null) {\n const day = pendingFocusDayRef.current;\n pendingFocusDayRef.current = null;\n setFocusedDay(day);\n dayRefs.current[day]?.focus();\n } else {\n // The displayed month changed some other way (header chevrons, month/year dropdowns) —\n // re-pick a sensible tab stop, but don't steal focus from whatever the user just used.\n setFocusedDay(getDefaultFocusedDay(month, year, selectionStart));\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [month, year]);\n\n function handleDayKeyDown(event: React.KeyboardEvent<HTMLDivElement>, day: number) {\n let delta = 0;\n if (event.key === 'ArrowRight') delta = 1;\n else if (event.key === 'ArrowLeft') delta = -1;\n else if (event.key === 'ArrowDown') delta = 7;\n else if (event.key === 'ArrowUp') delta = -7;\n else return;\n\n event.preventDefault();\n const next = addDays(day, month, year, delta);\n\n if (next.month !== month || next.year !== year) {\n pendingFocusDayRef.current = next.day;\n onNavigateMonth?.(next.month > month || next.year > year ? 1 : -1);\n } else {\n setFocusedDay(next.day);\n dayRefs.current[next.day]?.focus();\n }\n }\n\n return (\n <div className={cx(styles.datePickerMonth, className)} style={style}>\n <div className={cx(styles.datePickerMonthContent)}>\n {getWeekDays(locale).map((weekDay, index) => (\n <div key={index}>{weekDay}</div>\n ))}\n {Array.from(Array(startWeekDayOfMonth - 1).keys()).map((index) => (\n <div key={index} className={cx(styles.datePickerMonthItem, styles.datePickerMonthPlaceholder)} />\n ))}\n {Array.from(Array(daysInMonth).keys()).map((index) => {\n const day = index + 1;\n const selectedRes = checkSelected(day, month, year, selectionStart, selectionEnd);\n const isDisabled = checkDisabled(day, month, year, minDate, maxDate);\n const isToday = checkIsToday(day, month, year);\n\n return (\n <InteractableDiv\n key={day}\n ref={(el) => {\n dayRefs.current[day] = el;\n }}\n tabIndex={day === focusedDay ? 0 : -1}\n onKeyDown={(event) => handleDayKeyDown(event, day)}\n onClick={() => (isDisabled ? null : onSelect(getDateFromDayMonthAndYear(day, month, year)))}\n className={cx(styles.datePickerMonthDay, styles.datePickerMonthItem, {\n [styles.datePickerMonthDaySelected]: selectedRes.isInRange,\n [styles.datePickerMonthDaySelectedStart]: selectedRes.isStartDate,\n [styles.datePickerMonthDaySelectedEnd]: selectedRes.isEndDate,\n [styles.datePickerMonthDayDisabled]: isDisabled,\n [styles.datePickerMonthDayToday]: isToday,\n })}\n >\n {day}\n </InteractableDiv>\n );\n })}\n {Array.from(Array(42 - (startWeekDayOfMonth + daysInMonth - 1)).keys()).map((index) => (\n <div key={index} className={cx(styles.datePickerMonthItem, styles.datePickerMonthPlaceholder)}>\n &nbsp;\n </div>\n ))}\n </div>\n </div>\n );\n}\n"],"mappings":"seAmBA,SAAS,EAAqB,EAAe,EAAc,EAA0C,CACnG,GAAI,EAAgB,CAClB,IAAM,EAAM,EAAyB,CAAc,EACnD,GAAI,EAAI,QAAU,GAAS,EAAI,OAAS,EAAM,OAAO,EAAI,GAC3D,CACA,IAAM,EAAQ,EAAyB,IAAI,IAAM,EAEjD,OADI,EAAM,QAAU,GAAS,EAAM,OAAS,E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qB,EAAO,0BAA0B,EAAG,SAAA,MAE1F,EAFK,CAEL,CACN,CACE,GACF,CAAA,CAET"}
@@ -1,2 +1,2 @@
1
- var e=`datePickerMonth-item_30WWy`,t=`datePickerMonth-content_9bbSs`,n=`datePickerMonth-day_SaASA`,r=`datePickerMonth-day-today_RXOIr`,i=`datePickerMonth-day-selected_yMF-v`,a=`datePickerMonth-day-selected-start_ftVeI`,o=`datePickerMonth-day-selected-end_MZ2qy`,s=`datePickerMonth-day-disabled_4t0Ci`,c=`datePickerMonth-placeholder_gy1Yx`,l={"datePickerMonth-item":`datePickerMonth-item_30WWy`,datePickerMonthItem:e,"datePickerMonth-content":`datePickerMonth-content_9bbSs`,datePickerMonthContent:t,"datePickerMonth-day":`datePickerMonth-day_SaASA`,datePickerMonthDay:n,"datePickerMonth-day-today":`datePickerMonth-day-today_RXOIr`,datePickerMonthDayToday:r,"datePickerMonth-day-selected":`datePickerMonth-day-selected_yMF-v`,datePickerMonthDaySelected:i,"datePickerMonth-day-selected-start":`datePickerMonth-day-selected-start_ftVeI`,datePickerMonthDaySelectedStart:a,"datePickerMonth-day-selected-end":`datePickerMonth-day-selected-end_MZ2qy`,datePickerMonthDaySelectedEnd:o,"datePickerMonth-day-disabled":`datePickerMonth-day-disabled_4t0Ci`,datePickerMonthDayDisabled:s,"datePickerMonth-placeholder":`datePickerMonth-placeholder_gy1Yx`,datePickerMonthPlaceholder:c};export{t as datePickerMonthContent,n as datePickerMonthDay,s as datePickerMonthDayDisabled,i as datePickerMonthDaySelected,o as datePickerMonthDaySelectedEnd,a as datePickerMonthDaySelectedStart,r as datePickerMonthDayToday,e as datePickerMonthItem,c as datePickerMonthPlaceholder,l as default};
1
+ "use client";var e=`datePickerMonth-item_30WWy`,t=`datePickerMonth-content_9bbSs`,n=`datePickerMonth-day_SaASA`,r=`datePickerMonth-day-today_RXOIr`,i=`datePickerMonth-day-selected_yMF-v`,a=`datePickerMonth-day-selected-start_ftVeI`,o=`datePickerMonth-day-selected-end_MZ2qy`,s=`datePickerMonth-day-disabled_4t0Ci`,c=`datePickerMonth-placeholder_gy1Yx`,l={"datePickerMonth-item":`datePickerMonth-item_30WWy`,datePickerMonthItem:e,"datePickerMonth-content":`datePickerMonth-content_9bbSs`,datePickerMonthContent:t,"datePickerMonth-day":`datePickerMonth-day_SaASA`,datePickerMonthDay:n,"datePickerMonth-day-today":`datePickerMonth-day-today_RXOIr`,datePickerMonthDayToday:r,"datePickerMonth-day-selected":`datePickerMonth-day-selected_yMF-v`,datePickerMonthDaySelected:i,"datePickerMonth-day-selected-start":`datePickerMonth-day-selected-start_ftVeI`,datePickerMonthDaySelectedStart:a,"datePickerMonth-day-selected-end":`datePickerMonth-day-selected-end_MZ2qy`,datePickerMonthDaySelectedEnd:o,"datePickerMonth-day-disabled":`datePickerMonth-day-disabled_4t0Ci`,datePickerMonthDayDisabled:s,"datePickerMonth-placeholder":`datePickerMonth-placeholder_gy1Yx`,datePickerMonthPlaceholder:c};export{t as datePickerMonthContent,n as datePickerMonthDay,s as datePickerMonthDayDisabled,i as datePickerMonthDaySelected,o as datePickerMonthDaySelectedEnd,a as datePickerMonthDaySelectedStart,r as datePickerMonthDayToday,e as datePickerMonthItem,c as datePickerMonthPlaceholder,l as default};
2
2
  //# sourceMappingURL=datePickerMonth.module.mjs.map
@@ -1,2 +1,2 @@
1
- import{getLocale as e}from"../../services/localization.mjs";function t(e,t){return new Date(t,e,0).getDate()}function n(e,t,n){return new Date(Date.UTC(n,t-1,e))}function r(e,t,n,r,i=!1){return new Date(Date.UTC(t,n-1,r)).toLocaleDateString(e,{month:i?`short`:`long`})}function i(t=e(`-`)){return Array.from(Array(12).keys()).map(e=>r(t,2023,e+1,1))}function a(e,t=!0){let n=new Date(Date.UTC(2023,3,10)),r=[];for(let i=0;i<7;i++)r.push(n.toLocaleDateString(e,{weekday:t?`short`:`long`})),n.setDate(n.getDate()+1);return r}function o(e,t){return new Date(Date.UTC(t,e-1,1)).getDay()||7}function s(e,n,r,i){let a=e+i,o=n,s=r;for(;a<1;)--o,o<1&&(o=12,--s),a+=t(o,s);for(;a>t(o,s);)a-=t(o,s),o+=1,o>12&&(o=1,s+=1);return{day:a,month:o,year:s}}function c(e){return{day:e.getDate(),month:e.getMonth()+1,year:e.getFullYear()}}function l(e){let t=e.getDate(),n=e.getMonth()+1,r=e.getFullYear();return`${t<10?`0${t}`:t}.${n<10?`0${n}`:n}.${r}`}function u(e,t,n){let r=e,i=n;return r[0]!==`_`&&(r[0]>`3`?(r=`0${r[0]}${t.substring(2)}`,i={start:3,end:3}):r[0]===`3`&&r[1]!==`_`&&r[1]>`1`&&(r=`0${r[1]}${t.substring(2)}`,i={start:3,end:3})),r[3]!==`_`&&r[3]>`1`&&(r=`${r.substring(0,3)}0${r[3]}${t.substring(5)}`,i={start:6,end:6}),r[3]===`1`&&r[4]!==`_`&&r[4]>`2`&&(r=`${r.substring(0,3)}${r[3]}2${t.substring(5)}`),{value:r,selection:i}}export{s as addDays,u as correctDateMaskValue,n as getDateFromDayMonthAndYear,l as getDateString,c as getDayMonthAndYearOfDate,t as getDaysInMonth,r as getMonthName,i as getMonthNames,o as getStartWeekDayOfMonth,a as getWeekDays};
1
+ "use client";import{getLocale as e}from"../../services/localization.mjs";function t(e,t){return new Date(t,e,0).getDate()}function n(e,t,n){return new Date(Date.UTC(n,t-1,e))}function r(e,t,n,r,i=!1){return new Date(Date.UTC(t,n-1,r)).toLocaleDateString(e,{month:i?`short`:`long`})}function i(t=e(`-`)){return Array.from(Array(12).keys()).map(e=>r(t,2023,e+1,1))}function a(e,t=!0){let n=new Date(Date.UTC(2023,3,10)),r=[];for(let i=0;i<7;i++)r.push(n.toLocaleDateString(e,{weekday:t?`short`:`long`})),n.setDate(n.getDate()+1);return r}function o(e,t){return new Date(Date.UTC(t,e-1,1)).getDay()||7}function s(e,n,r,i){let a=e+i,o=n,s=r;for(;a<1;)--o,o<1&&(o=12,--s),a+=t(o,s);for(;a>t(o,s);)a-=t(o,s),o+=1,o>12&&(o=1,s+=1);return{day:a,month:o,year:s}}function c(e){return{day:e.getDate(),month:e.getMonth()+1,year:e.getFullYear()}}function l(e){let t=e.getDate(),n=e.getMonth()+1,r=e.getFullYear();return`${t<10?`0${t}`:t}.${n<10?`0${n}`:n}.${r}`}function u(e,t,n){let r=e,i=n;return r[0]!==`_`&&(r[0]>`3`?(r=`0${r[0]}${t.substring(2)}`,i={start:3,end:3}):r[0]===`3`&&r[1]!==`_`&&r[1]>`1`&&(r=`0${r[1]}${t.substring(2)}`,i={start:3,end:3})),r[3]!==`_`&&r[3]>`1`&&(r=`${r.substring(0,3)}0${r[3]}${t.substring(5)}`,i={start:6,end:6}),r[3]===`1`&&r[4]!==`_`&&r[4]>`2`&&(r=`${r.substring(0,3)}${r[3]}2${t.substring(5)}`),{value:r,selection:i}}export{s as addDays,u as correctDateMaskValue,n as getDateFromDayMonthAndYear,l as getDateString,c as getDayMonthAndYearOfDate,t as getDaysInMonth,r as getMonthName,i as getMonthNames,o as getStartWeekDayOfMonth,a as getWeekDays};
2
2
  //# sourceMappingURL=dateFunctions.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dateFunctions.mjs","names":[],"sources":["../../../../package/common/datePicker/dateFunctions.ts"],"sourcesContent":["import { getLocale } from 'services/localization';\n\nexport function getDaysInMonth(month: number, year: number): number {\n return new Date(year, month, 0).getDate();\n}\n\nexport function getDateFromDayMonthAndYear(day: number, month: number, year: number): Date {\n return new Date(Date.UTC(year, month - 1, day));\n}\n\nexport function getMonthName(locale: string, year: number, month: number, day: number, short = false): string {\n const currDate = new Date(Date.UTC(year, month - 1, day));\n return currDate.toLocaleDateString(locale, { month: short ? 'short' : 'long' });\n}\n\nexport function getMonthNames(locale = getLocale('-')): string[] {\n return Array.from(Array(12).keys()).map((index) => getMonthName(locale, 2023, index + 1, 1));\n}\n\nexport function getWeekDays(locale: string, short = true): string[] {\n const currDate = new Date(Date.UTC(2023, 3, 10)); // Random Monday - 10.4.2023\n const weekDays: string[] = [];\n for (let i = 0; i < 7; i++) {\n weekDays.push(currDate.toLocaleDateString(locale, { weekday: short ? 'short' : 'long' }));\n currDate.setDate(currDate.getDate() + 1);\n }\n return weekDays;\n}\n\nexport function getStartWeekDayOfMonth(month: number, year: number): number {\n const start = new Date(Date.UTC(year, month - 1, 1)).getDay();\n return start || 7;\n}\n\n/**\n * Adds `delta` days to a day/month/year triple, rolling over into adjacent months/years as\n * needed. Pure integer arithmetic over `getDaysInMonth` rather than a `Date` object, so it\n * can't drift a day from local-vs-UTC ambiguity the way mutating a UTC-constructed `Date`\n * with its local `setDate` would.\n */\nexport function addDays(\n day: number,\n month: number,\n year: number,\n delta: number,\n): { day: number; month: number; year: number } {\n let d = day + delta;\n let m = month;\n let y = year;\n while (d < 1) {\n m -= 1;\n if (m < 1) {\n m = 12;\n y -= 1;\n }\n d += getDaysInMonth(m, y);\n }\n while (d > getDaysInMonth(m, y)) {\n d -= getDaysInMonth(m, y);\n m += 1;\n if (m > 12) {\n m = 1;\n y += 1;\n }\n }\n return { day: d, month: m, year: y };\n}\n\nexport function getDayMonthAndYearOfDate(date: Date): { day: number; month: number; year: number } {\n return {\n day: date.getDate(),\n month: date.getMonth() + 1,\n year: date.getFullYear(),\n };\n}\n\nexport function getDateString(date: Date): string {\n const day = date.getDate();\n const month = date.getMonth() + 1;\n const year = date.getFullYear();\n\n return `${day < 10 ? `0${day}` : day}.${month < 10 ? `0${month}` : month}.${year}`;\n}\n\nexport interface DateMaskSelection {\n start: number;\n end: number;\n}\n\nexport interface DateMaskState {\n value: string;\n selection: DateMaskSelection | null;\n}\n\n/**\n * Auto-corrects a partially typed `dd.mm.yyyy` mask value so a single out-of-range\n * digit doesn't force the user to backtrack:\n * - a day \"tens\" digit > 3 (e.g. typing `4`) becomes `04` and the caret jumps to the month\n * - a day of `3x` where x > 1 (e.g. `35`) becomes `0x`\n * - a month \"tens\" digit > 1 (e.g. `2`) becomes `02` and the caret jumps to the year\n * - a month `1x` where x > 2 (e.g. `13`) is clamped to `12`\n *\n * `previousValue` supplies the digits to retain for the part of the field that isn't\n * being rewritten. The returned `selection` is the adjusted caret position, or the\n * passed-in `selection` when no correction applies.\n */\nexport function correctDateMaskValue(\n nextValue: string,\n previousValue: string,\n selection: DateMaskSelection | null,\n): DateMaskState {\n let value = nextValue;\n let nextSelection = selection;\n\n if (value[0] !== '_') {\n if (value[0] > '3') {\n value = `0${value[0]}${previousValue.substring(2)}`;\n nextSelection = { start: 3, end: 3 };\n } else if (value[0] === '3') {\n if (value[1] !== '_' && value[1] > '1') {\n value = `0${value[1]}${previousValue.substring(2)}`;\n nextSelection = { start: 3, end: 3 };\n }\n }\n }\n if (value[3] !== '_' && value[3] > '1') {\n value = `${value.substring(0, 3)}0${value[3]}${previousValue.substring(5)}`;\n nextSelection = { start: 6, end: 6 };\n }\n if (value[3] === '1' && value[4] !== '_' && value[4] > '2') {\n value = `${value.substring(0, 3)}${value[3]}2${previousValue.substring(5)}`;\n }\n\n return { value, selection: nextSelection };\n}\n"],"mappings":"4DAEA,SAAgB,EAAe,EAAe,EAAsB,CAClE,OAAO,IAAI,KAAK,EAAM,EAAO,CAAC,CAAC,CAAC,QAAQ,CAC1C,CAEA,SAAgB,EAA2B,EAAa,EAAe,EAAoB,CACzF,OAAO,IAAI,KAAK,KAAK,IAAI,EAAM,EAAQ,EAAG,CAAG,CAAC,CAChD,CAEA,SAAgB,EAAa,EAAgB,EAAc,EAAe,EAAa,EAAQ,GAAe,CAE5G,OAAO,IADc,KAAK,KAAK,IAAI,EAAM,EAAQ,EAAG,CAAG,CAChD,CAAA,CAAS,mBAAmB,EAAQ,CAAE,MAAO,EAAQ,QAAU,MAAO,CAAC,CAChF,CAEA,SAAgB,EAAc,EAAS,EAAU,GAAG,EAAa,CAC/D,OAAO,MAAM,KAAK,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAK,GAAU,EAAa,EAAQ,KAAM,EAAQ,EAAG,CAAC,CAAC,CAC7F,CAEA,SAAgB,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,EAAQ,IAAI,EAAM,KAAK,EAAc,UAAU,CAAC,IAChD,EAAgB,CAAE,MAAO,EAAG,IAAK,CAAE,GAC1B,EAAM,KAAO,KAClB,EAAM,KAAO,KAAO,EAAM,GAAK,MACjC,EAAQ,IAAI,EAAM,KAAK,EAAc,UAAU,CAAC,IAChD,EAAgB,CAAE,MAAO,EAAG,IAAK,CAAE,IAIrC,EAAM,KAAO,KAAO,EAAM,GAAK,MACjC,EAAQ,GAAG,EAAM,UAAU,EAAG,CAAC,EAAE,GAAG,EAAM,KAAK,EAAc,UAAU,CAAC,IACxE,EAAgB,CAAE,MAAO,EAAG,IAAK,CAAE,GAEjC,EAAM,KAAO,KAAO,EAAM,KAAO,KAAO,EAAM,GAAK,MACrD,EAAQ,GAAG,EAAM,UAAU,EAAG,CAAC,IAAI,EAAM,GAAG,GAAG,EAAc,UAAU,CAAC,KAGnE,CAAE,QAAO,UAAW,CAAc,CAC3C"}
1
+ {"version":3,"file":"dateFunctions.mjs","names":[],"sources":["../../../../package/common/datePicker/dateFunctions.ts"],"sourcesContent":["import { getLocale } from 'services/localization';\n\nexport function getDaysInMonth(month: number, year: number): number {\n return new Date(year, month, 0).getDate();\n}\n\nexport function getDateFromDayMonthAndYear(day: number, month: number, year: number): Date {\n return new Date(Date.UTC(year, month - 1, day));\n}\n\nexport function getMonthName(locale: string, year: number, month: number, day: number, short = false): string {\n const currDate = new Date(Date.UTC(year, month - 1, day));\n return currDate.toLocaleDateString(locale, { month: short ? 'short' : 'long' });\n}\n\nexport function getMonthNames(locale = getLocale('-')): string[] {\n return Array.from(Array(12).keys()).map((index) => getMonthName(locale, 2023, index + 1, 1));\n}\n\nexport function getWeekDays(locale: string, short = true): string[] {\n const currDate = new Date(Date.UTC(2023, 3, 10)); // Random Monday - 10.4.2023\n const weekDays: string[] = [];\n for (let i = 0; i < 7; i++) {\n weekDays.push(currDate.toLocaleDateString(locale, { weekday: short ? 'short' : 'long' }));\n currDate.setDate(currDate.getDate() + 1);\n }\n return weekDays;\n}\n\nexport function getStartWeekDayOfMonth(month: number, year: number): number {\n const start = new Date(Date.UTC(year, month - 1, 1)).getDay();\n return start || 7;\n}\n\n/**\n * Adds `delta` days to a day/month/year triple, rolling over into adjacent months/years as\n * needed. Pure integer arithmetic over `getDaysInMonth` rather than a `Date` object, so it\n * can't drift a day from local-vs-UTC ambiguity the way mutating a UTC-constructed `Date`\n * with its local `setDate` would.\n */\nexport function addDays(\n day: number,\n month: number,\n year: number,\n delta: number,\n): { day: number; month: number; year: number } {\n let d = day + delta;\n let m = month;\n let y = year;\n while (d < 1) {\n m -= 1;\n if (m < 1) {\n m = 12;\n y -= 1;\n }\n d += getDaysInMonth(m, y);\n }\n while (d > getDaysInMonth(m, y)) {\n d -= getDaysInMonth(m, y);\n m += 1;\n if (m > 12) {\n m = 1;\n y += 1;\n }\n }\n return { day: d, month: m, year: y };\n}\n\nexport function getDayMonthAndYearOfDate(date: Date): { day: number; month: number; year: number } {\n return {\n day: date.getDate(),\n month: date.getMonth() + 1,\n year: date.getFullYear(),\n };\n}\n\nexport function getDateString(date: Date): string {\n const day = date.getDate();\n const month = date.getMonth() + 1;\n const year = date.getFullYear();\n\n return `${day < 10 ? `0${day}` : day}.${month < 10 ? `0${month}` : month}.${year}`;\n}\n\nexport interface DateMaskSelection {\n start: number;\n end: number;\n}\n\nexport interface DateMaskState {\n value: string;\n selection: DateMaskSelection | null;\n}\n\n/**\n * Auto-corrects a partially typed `dd.mm.yyyy` mask value so a single out-of-range\n * digit doesn't force the user to backtrack:\n * - a day \"tens\" digit > 3 (e.g. typing `4`) becomes `04` and the caret jumps to the month\n * - a day of `3x` where x > 1 (e.g. `35`) becomes `0x`\n * - a month \"tens\" digit > 1 (e.g. `2`) becomes `02` and the caret jumps to the year\n * - a month `1x` where x > 2 (e.g. `13`) is clamped to `12`\n *\n * `previousValue` supplies the digits to retain for the part of the field that isn't\n * being rewritten. The returned `selection` is the adjusted caret position, or the\n * passed-in `selection` when no correction applies.\n */\nexport function correctDateMaskValue(\n nextValue: string,\n previousValue: string,\n selection: DateMaskSelection | null,\n): DateMaskState {\n let value = nextValue;\n let nextSelection = selection;\n\n if (value[0] !== '_') {\n if (value[0] > '3') {\n value = `0${value[0]}${previousValue.substring(2)}`;\n nextSelection = { start: 3, end: 3 };\n } else if (value[0] === '3') {\n if (value[1] !== '_' && value[1] > '1') {\n value = `0${value[1]}${previousValue.substring(2)}`;\n nextSelection = { start: 3, end: 3 };\n }\n }\n }\n if (value[3] !== '_' && value[3] > '1') {\n value = `${value.substring(0, 3)}0${value[3]}${previousValue.substring(5)}`;\n nextSelection = { start: 6, end: 6 };\n }\n if (value[3] === '1' && value[4] !== '_' && value[4] > '2') {\n value = `${value.substring(0, 3)}${value[3]}2${previousValue.substring(5)}`;\n }\n\n return { value, selection: nextSelection };\n}\n"],"mappings":"yEAEA,SAAgB,EAAe,EAAe,EAAsB,CAClE,OAAO,IAAI,KAAK,EAAM,EAAO,CAAC,CAAC,CAAC,QAAQ,CAC1C,CAEA,SAAgB,EAA2B,EAAa,EAAe,EAAoB,CACzF,OAAO,IAAI,KAAK,KAAK,IAAI,EAAM,EAAQ,EAAG,CAAG,CAAC,CAChD,CAEA,SAAgB,EAAa,EAAgB,EAAc,EAAe,EAAa,EAAQ,GAAe,CAE5G,OAAO,IADc,KAAK,KAAK,IAAI,EAAM,EAAQ,EAAG,CAAG,CAChD,CAAA,CAAS,mBAAmB,EAAQ,CAAE,MAAO,EAAQ,QAAU,MAAO,CAAC,CAChF,CAEA,SAAgB,EAAc,EAAS,EAAU,GAAG,EAAa,CAC/D,OAAO,MAAM,KAAK,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAK,GAAU,EAAa,EAAQ,KAAM,EAAQ,EAAG,CAAC,CAAC,CAC7F,CAEA,SAAgB,EAAY,EAAgB,EAAQ,GAAgB,CAClE,IAAM,EAAW,IAAI,KAAK,KAAK,IAAI,KAAM,EAAG,EAAE,CAAC,EACzC,EAAq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O,KAClB,EAAM,KAAO,KAAO,EAAM,GAAK,MACjC,EAAQ,IAAI,EAAM,KAAK,EAAc,UAAU,CAAC,IAChD,EAAgB,CAAE,MAAO,EAAG,IAAK,CAAE,IAIrC,EAAM,KAAO,KAAO,EAAM,GAAK,MACjC,EAAQ,GAAG,EAAM,UAAU,EAAG,CAAC,EAAE,GAAG,EAAM,KAAK,EAAc,UAAU,CAAC,IACxE,EAAgB,CAAE,MAAO,EAAG,IAAK,CAAE,GAEjC,EAAM,KAAO,KAAO,EAAM,KAAO,KAAO,EAAM,GAAK,MACrD,EAAQ,GAAG,EAAM,UAAU,EAAG,CAAC,IAAI,EAAM,GAAG,GAAG,EAAc,UAAU,CAAC,KAGnE,CAAE,QAAO,UAAW,CAAc,CAC3C"}
@@ -1,2 +1,2 @@
1
- import{useComponentDefaults as e}from"../configProvider/useComponentDefaults.mjs";import t from"../button/button.mjs";import n from"../actionIcon/actionIcon.mjs";import{PopoverAlign as r,PopoverPlacement as i}from"../popover/popover.types.mjs";import ee from"../popover/popover.mjs";import te from"../tooltip/tooltip.mjs";import ne from"../input/input.mjs";import a from"../modal/modal.mjs";import{getLocale as o}from"../../services/localization.mjs";import{correctDateMaskValue as re,getDateFromDayMonthAndYear as ie,getDateString as s,getMonthName as ae,getMonthNames as oe}from"./dateFunctions.mjs";import se from"./components/datePickerMonth/datePickerMonth.mjs";import c from"../dropdown/dropdown.mjs";import l from"./datePicker.module.mjs";import{useEffect as ce,useRef as le,useState as u}from"react";import d from"classnames";import{faChevronLeft as f,faChevronRight as p}from"@fortawesome/free-solid-svg-icons";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import ue from"@mona-health/react-input-mask";function _(_){let{className:de=``,selected:v,onSelect:fe=()=>null,formValidator:y=null,noInput:pe=!1,noHeader:me=!1,isModal:b=!1,isInline:x=!1,onChange:he=()=>null,minDate:S=null,maxDate:C=null,children:ge=null,showClearButton:_e=!1,label:ve=``,isValid:ye=!0,errorMessage:w=``,isRequired:T=!1,startDate:E,endDate:D,style:O,classNames:k,styles:A,...j}=e(`DatePicker`,_),M=()=>y?y.value:v,N=M()??new Date,[P,F]=u(N.getMonth()+1),[I,L]=u(N.getFullYear()),[R,z]=u(!1),[B,V]=u(()=>M()?s(N):``),[be,H]=u(!1),[xe,U]=u(!1),[,Se]=u(0),[Ce,we]=u(v),W=le(y);if(Ce!==v){we(v);let e=v??new Date;F(e.getMonth()+1),L(e.getFullYear()),V(v?s(v):``)}ce(()=>{if(W.current=y,!y)return;let e=()=>{let e=y.value;e?(F(e.getMonth()+1),L(e.getFullYear()),V(s(e))):V(``),Se(e=>e+1)};return y.registerOnUpdateListener(e),()=>y.removeOnUpdateListener(e)},[y]);let Te=()=>y?y.touched&&y.hasError():!ye||!!w,Ee=()=>!!(T||y?.validators.find(e=>e.validatorId===`required`)),G=e=>{V(e?s(e):``),y&&y.set(e),he(e)},K=e=>{G(e),fe(e),z(!1)},q=e=>{F(t=>{let n=t+e;return n<1?(n=12,L(e=>e-1)):n>12&&(n=1,L(e=>e+1)),n})},J=e=>{if(e.match(/\d{2}\.\d{2}\.\d{4}/gi)){let[t,n,r]=e.split(`.`),i=ie(Number(t),Number(n),Number(r));if(i&&i.toString()!==`Invalid Date`&&(!C||i<=C)&&(!S||i>=S))return i}return null},De=({previousState:e,nextState:t})=>{if(!e||t.value===e.value)return t;let n=re(t.value,e.value,t.selection??null),r=J(n.value);return r&&G(r),n},Y=()=>{let e=400,t=new Date().getFullYear()-200;return S&&(t=S.getFullYear()),C&&(e=C.getFullYear()-t+1),Array.from(Array(e).keys()).map(e=>({key:e+t,label:e+t}))},X=M(),Z=Te(),Oe=me?null:g(`div`,{className:d(l.datePickerHeader,k?.header),style:A?.header,children:[h(n,{icon:f,onClick:()=>q(-1)}),h(`div`,{className:l.datePickerHeaderMonthAndYearContainer,children:g(`div`,{className:l.datePickerHeaderMonthAndYear,children:[h(c,{plainStyle:!0,scrollToSelected:!0,onChange:e=>F(e),className:d(l.datePickerHeaderMonth,k?.monthDropdown),style:A?.monthDropdown,value:ae(o(`-`),I,P,1),items:oe().map((e,t)=>({key:t+1,label:e}))}),h(c,{plainStyle:!0,scrollToSelected:!0,useMatLabelStyle:!1,className:d(l.datePickerHeaderYear,k?.yearDropdown),style:A?.yearDropdown,onChange:e=>L(e),value:I,items:Y()})]})}),h(n,{icon:p,onClick:()=>q(1)})]}),Q=g(m,{children:[Oe,h(se,{className:d(l.datePickerMonth,k?.calendar),style:A?.calendar,month:P,year:I,onSelect:K,selectionStart:E??X,selectionEnd:D??X,minDate:S,maxDate:C,onNavigateMonth:q}),_e&&h(t,{onClick:()=>K(null),className:k?.clearButton,style:A?.clearButton,children:`Clear`}),ge]}),$=pe?null:h(ne,{autoComplete:`off`,className:k?.input,style:A?.input,readOnly:b,classNames:b?{input:l.datePickerModalInput}:void 0,label:`${ve}${Ee()?` *`:``}`,value:B,onChange:e=>V(e),onClick:()=>z(!0),customInput:h(ue,{mask:`99.99.9999`,maskPlaceholder:`_`,beforeMaskedStateChange:De}),onBlur:()=>{W.current&&(W.current.touched=!0),H(!1),G(J(B))},onFocus:()=>H(!0),onMouseEnter:()=>U(!0),onMouseLeave:()=>U(!1),isValid:!Z}),ke=x?Q:b?h(a,{hideHeader:!0,isOpen:R,onClose:()=>z(!1),children:Q}):h(ee,{isOpen:R,onOpenChange:e=>z(e),content:Q,placement:i.Bottom,align:r.Start,closeOnTriggerClick:!1,constrainWidth:!1,children:$});return g(`div`,{...j,className:d(l.datePicker,de,k?.root),style:{...O,...A?.root},children:[(b||x)&&$,ke,h(te,{variant:`error`,message:y?y.getCurrentErrorMessage():w||``,isVisible:Z&&(be||xe)})]})}export{_ as default};
1
+ "use client";import{useComponentDefaults as e}from"../configProvider/useComponentDefaults.mjs";import t from"../button/button.mjs";import n from"../actionIcon/actionIcon.mjs";import{PopoverAlign as r,PopoverPlacement as i}from"../popover/popover.types.mjs";import ee from"../popover/popover.mjs";import te from"../tooltip/tooltip.mjs";import ne from"../input/input.mjs";import a from"../modal/modal.mjs";import{getLocale as o}from"../../services/localization.mjs";import{correctDateMaskValue as re,getDateFromDayMonthAndYear as ie,getDateString as s,getMonthName as ae,getMonthNames as oe}from"./dateFunctions.mjs";import se from"./components/datePickerMonth/datePickerMonth.mjs";import c from"../dropdown/dropdown.mjs";import l from"./datePicker.module.mjs";import{useEffect as ce,useRef as le,useState as u}from"react";import d from"classnames";import{faChevronLeft as f,faChevronRight as p}from"@fortawesome/free-solid-svg-icons";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import ue from"@mona-health/react-input-mask";function _(_){let{className:de=``,selected:v,onSelect:fe=()=>null,formValidator:y=null,noInput:pe=!1,noHeader:me=!1,isModal:b=!1,isInline:x=!1,onChange:he=()=>null,minDate:S=null,maxDate:C=null,children:ge=null,showClearButton:_e=!1,label:ve=``,isValid:ye=!0,errorMessage:w=``,isRequired:T=!1,startDate:E,endDate:D,style:O,classNames:k,styles:A,...j}=e(`DatePicker`,_),M=()=>y?y.value:v,N=M()??new Date,[P,F]=u(N.getMonth()+1),[I,L]=u(N.getFullYear()),[R,z]=u(!1),[B,V]=u(()=>M()?s(N):``),[be,H]=u(!1),[xe,U]=u(!1),[,Se]=u(0),[Ce,we]=u(v),W=le(y);if(Ce!==v){we(v);let e=v??new Date;F(e.getMonth()+1),L(e.getFullYear()),V(v?s(v):``)}ce(()=>{if(W.current=y,!y)return;let e=()=>{let e=y.value;e?(F(e.getMonth()+1),L(e.getFullYear()),V(s(e))):V(``),Se(e=>e+1)};return y.registerOnUpdateListener(e),()=>y.removeOnUpdateListener(e)},[y]);let Te=()=>y?y.touched&&y.hasError():!ye||!!w,Ee=()=>!!(T||y?.validators.find(e=>e.validatorId===`required`)),G=e=>{V(e?s(e):``),y&&y.set(e),he(e)},K=e=>{G(e),fe(e),z(!1)},q=e=>{F(t=>{let n=t+e;return n<1?(n=12,L(e=>e-1)):n>12&&(n=1,L(e=>e+1)),n})},J=e=>{if(e.match(/\d{2}\.\d{2}\.\d{4}/gi)){let[t,n,r]=e.split(`.`),i=ie(Number(t),Number(n),Number(r));if(i&&i.toString()!==`Invalid Date`&&(!C||i<=C)&&(!S||i>=S))return i}return null},De=({previousState:e,nextState:t})=>{if(!e||t.value===e.value)return t;let n=re(t.value,e.value,t.selection??null),r=J(n.value);return r&&G(r),n},Y=()=>{let e=400,t=new Date().getFullYear()-200;return S&&(t=S.getFullYear()),C&&(e=C.getFullYear()-t+1),Array.from(Array(e).keys()).map(e=>({key:e+t,label:e+t}))},X=M(),Z=Te(),Oe=me?null:g(`div`,{className:d(l.datePickerHeader,k?.header),style:A?.header,children:[h(n,{icon:f,onClick:()=>q(-1)}),h(`div`,{className:l.datePickerHeaderMonthAndYearContainer,children:g(`div`,{className:l.datePickerHeaderMonthAndYear,children:[h(c,{plainStyle:!0,scrollToSelected:!0,onChange:e=>F(e),className:d(l.datePickerHeaderMonth,k?.monthDropdown),style:A?.monthDropdown,value:ae(o(`-`),I,P,1),items:oe().map((e,t)=>({key:t+1,label:e}))}),h(c,{plainStyle:!0,scrollToSelected:!0,useMatLabelStyle:!1,className:d(l.datePickerHeaderYear,k?.yearDropdown),style:A?.yearDropdown,onChange:e=>L(e),value:I,items:Y()})]})}),h(n,{icon:p,onClick:()=>q(1)})]}),Q=g(m,{children:[Oe,h(se,{className:d(l.datePickerMonth,k?.calendar),style:A?.calendar,month:P,year:I,onSelect:K,selectionStart:E??X,selectionEnd:D??X,minDate:S,maxDate:C,onNavigateMonth:q}),_e&&h(t,{onClick:()=>K(null),className:k?.clearButton,style:A?.clearButton,children:`Clear`}),ge]}),$=pe?null:h(ne,{autoComplete:`off`,className:k?.input,style:A?.input,readOnly:b,classNames:b?{input:l.datePickerModalInput}:void 0,label:`${ve}${Ee()?` *`:``}`,value:B,onChange:e=>V(e),onClick:()=>z(!0),customInput:h(ue,{mask:`99.99.9999`,maskPlaceholder:`_`,beforeMaskedStateChange:De}),onBlur:()=>{W.current&&(W.current.touched=!0),H(!1),G(J(B))},onFocus:()=>H(!0),onMouseEnter:()=>U(!0),onMouseLeave:()=>U(!1),isValid:!Z}),ke=x?Q:b?h(a,{hideHeader:!0,isOpen:R,onClose:()=>z(!1),children:Q}):h(ee,{isOpen:R,onOpenChange:e=>z(e),content:Q,placement:i.Bottom,align:r.Start,closeOnTriggerClick:!1,constrainWidth:!1,children:$});return g(`div`,{...j,className:d(l.datePicker,de,k?.root),style:{...O,...A?.root},children:[(b||x)&&$,ke,h(te,{variant:`error`,message:y?y.getCurrentErrorMessage():w||``,isVisible:Z&&(be||xe)})]})}export{_ as default};
2
2
  //# sourceMappingURL=datePicker.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"datePicker.mjs","names":[],"sources":["../../../../package/common/datePicker/datePicker.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\nimport cx from 'classnames';\nimport Input from '../input';\nimport { useComponentDefaults } from '../configProvider';\nimport DatePickerMonth from './components/datePickerMonth';\nimport { faChevronLeft, faChevronRight } from '@fortawesome/free-solid-svg-icons';\nimport { getLocale } from 'services/localization';\nimport ActionIcon from '../actionIcon';\nimport Modal from '../modal';\nimport Popover from '../popover';\nimport Dropdown from '../dropdown';\nimport { PopoverAlign, PopoverPlacement } from '../popover/popover.types';\nimport InputMask, { InputState, BeforeMaskedStateChangeStates } from '@mona-health/react-input-mask';\nimport {\n getDateFromDayMonthAndYear,\n getMonthName,\n getMonthNames,\n getDateString,\n correctDateMaskValue,\n} from './dateFunctions';\nimport Button from '../button';\nimport Tooltip from '../tooltip';\nimport type { DatePickerProps } from './datePicker.types';\n\nimport styles from './datePicker.module.pcss';\n\nexport default function DatePicker(props: DatePickerProps) {\n const {\n className = '',\n selected,\n onSelect = () => null,\n formValidator = null,\n noInput = false,\n noHeader = false,\n isModal = false,\n isInline = false,\n onChange = () => null,\n minDate = null,\n maxDate = null,\n children = null,\n showClearButton = false,\n label = '',\n isValid = true,\n errorMessage = '',\n isRequired = false,\n startDate,\n endDate,\n style,\n classNames,\n styles: slotStyles,\n ...rest\n } = useComponentDefaults('DatePicker', props);\n const getCurrValue = (): Date | undefined => (formValidator ? (formValidator.value as Date) : selected);\n\n const initialDate = getCurrValue() ?? new Date();\n\n const [currentMonth, setCurrentMonth] = useState(initialDate.getMonth() + 1);\n const [currentYear, setCurrentYear] = useState(initialDate.getFullYear());\n const [isPickerOpen, setIsPickerOpen] = useState(false);\n const [currentDateString, setCurrentDateString] = useState(() => (getCurrValue() ? getDateString(initialDate) : ''));\n const [isFocused, setIsFocused] = useState(false);\n const [isHovered, setIsHovered] = useState(false);\n const [, forceUpdate] = useState(0);\n const [prevSelected, setPrevSelected] = useState(selected);\n\n const fvRef = useRef(formValidator);\n\n // Sync navigation view when `selected` prop changes externally\n if (prevSelected !== selected) {\n setPrevSelected(selected);\n const d = selected ?? new Date();\n setCurrentMonth(d.getMonth() + 1);\n setCurrentYear(d.getFullYear());\n setCurrentDateString(selected ? getDateString(selected) : '');\n }\n\n // Subscribe to formValidator updates (external system → setState in callback)\n useEffect(() => {\n fvRef.current = formValidator;\n if (!formValidator) return;\n const listener = () => {\n const val = formValidator.value as Date | undefined;\n if (val) {\n setCurrentMonth(val.getMonth() + 1);\n setCurrentYear(val.getFullYear());\n setCurrentDateString(getDateString(val));\n } else {\n setCurrentDateString('');\n }\n forceUpdate((n: number) => n + 1);\n };\n formValidator.registerOnUpdateListener(listener);\n return () => formValidator.removeOnUpdateListener(listener);\n }, [formValidator]);\n\n const hasError = (): boolean => {\n return formValidator ? formValidator.touched && formValidator.hasError() : !isValid || !!errorMessage;\n };\n\n const computedIsRequired = (): boolean => {\n return !!(\n isRequired || formValidator?.validators.find((v) => (v as { validatorId?: string }).validatorId === 'required')\n );\n };\n\n const handleChange = (date: Date | null) => {\n setCurrentDateString(date ? getDateString(date) : '');\n if (formValidator) formValidator.set(date);\n onChange(date);\n };\n\n const handleSelect = (date: Date | null) => {\n handleChange(date);\n onSelect(date);\n setIsPickerOpen(false);\n };\n\n const changeMonth = (delta: number) => {\n setCurrentMonth((prev) => {\n let next = prev + delta;\n if (next < 1) {\n next = 12;\n setCurrentYear((y) => y - 1);\n } else if (next > 12) {\n next = 1;\n setCurrentYear((y) => y + 1);\n }\n return next;\n });\n };\n\n const tryParseDateString = (dateString: string): Date | null => {\n if (dateString.match(/\\d{2}\\.\\d{2}\\.\\d{4}/gi)) {\n const [day, month, year] = dateString.split('.');\n const parsedDate = getDateFromDayMonthAndYear(Number(day), Number(month), Number(year));\n if (parsedDate && parsedDate.toString() !== 'Invalid Date') {\n const isSmallerThanMaxDate = !maxDate || parsedDate <= maxDate;\n const isBiggerThanMinDate = !minDate || parsedDate >= minDate;\n if (isSmallerThanMaxDate && isBiggerThanMinDate) return parsedDate;\n }\n }\n return null;\n };\n\n const beforeMaskedStateChange = ({ previousState, nextState }: BeforeMaskedStateChangeStates): InputState => {\n // previousState is only supplied on user-driven change events; on mount/focus/blur\n // there is nothing to auto-correct, so the next state passes through unchanged.\n if (!previousState || nextState.value === previousState.value) return nextState;\n\n const corrected = correctDateMaskValue(nextState.value, previousState.value, nextState.selection ?? null);\n\n const parsedDate = tryParseDateString(corrected.value);\n if (parsedDate) handleChange(parsedDate);\n\n return corrected;\n };\n\n const getYearDropdownOptions = () => {\n let length = 400;\n let zeroOffset = new Date().getFullYear() - 200;\n if (minDate) zeroOffset = minDate.getFullYear();\n if (maxDate) length = maxDate.getFullYear() - zeroOffset + 1;\n return Array.from(Array(length).keys()).map((i) => ({ key: i + zeroOffset, label: i + zeroOffset }));\n };\n\n const currValue = getCurrValue();\n const hasErr = hasError();\n\n const header = noHeader ? null : (\n <div className={cx(styles.datePickerHeader, classNames?.header)} style={slotStyles?.header}>\n <ActionIcon icon={faChevronLeft} onClick={() => changeMonth(-1)} />\n <div className={styles.datePickerHeaderMonthAndYearContainer}>\n <div className={styles.datePickerHeaderMonthAndYear}>\n <Dropdown\n plainStyle\n scrollToSelected\n onChange={(v) => setCurrentMonth(v as number)}\n className={cx(styles.datePickerHeaderMonth, classNames?.monthDropdown)}\n style={slotStyles?.monthDropdown}\n value={getMonthName(getLocale('-'), currentYear, currentMonth, 1)}\n items={getMonthNames().map((month, index) => ({ key: index + 1, label: month }))}\n />\n <Dropdown\n plainStyle\n scrollToSelected\n useMatLabelStyle={false}\n className={cx(styles.datePickerHeaderYear, classNames?.yearDropdown)}\n style={slotStyles?.yearDropdown}\n onChange={(v) => setCurrentYear(v as number)}\n value={currentYear}\n items={getYearDropdownOptions()}\n />\n </div>\n </div>\n <ActionIcon icon={faChevronRight} onClick={() => changeMonth(1)} />\n </div>\n );\n\n const pickerContent = (\n <>\n {header}\n <DatePickerMonth\n className={cx(styles.datePickerMonth, classNames?.calendar)}\n style={slotStyles?.calendar}\n month={currentMonth}\n year={currentYear}\n onSelect={handleSelect}\n selectionStart={startDate ?? currValue}\n selectionEnd={endDate ?? currValue}\n minDate={minDate}\n maxDate={maxDate}\n onNavigateMonth={changeMonth}\n />\n {showClearButton && (\n <Button onClick={() => handleSelect(null)} className={classNames?.clearButton} style={slotStyles?.clearButton}>\n Clear\n </Button>\n )}\n {children}\n </>\n );\n\n const input = noInput ? null : (\n <Input\n autoComplete='off'\n className={classNames?.input}\n style={slotStyles?.input}\n readOnly={isModal}\n classNames={isModal ? { input: styles.datePickerModalInput } : undefined}\n label={`${label}${computedIsRequired() ? ' *' : ''}`}\n value={currentDateString}\n onChange={(v) => setCurrentDateString(v as string)}\n onClick={() => setIsPickerOpen(true)}\n customInput={\n <InputMask mask='99.99.9999' maskPlaceholder='_' beforeMaskedStateChange={beforeMaskedStateChange} />\n }\n onBlur={() => {\n if (fvRef.current) fvRef.current.touched = true;\n setIsFocused(false);\n handleChange(tryParseDateString(currentDateString));\n }}\n onFocus={() => setIsFocused(true)}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n isValid={!hasErr}\n />\n );\n\n const picker = (() => {\n if (isInline) return pickerContent;\n if (isModal) {\n return (\n <Modal hideHeader isOpen={isPickerOpen} onClose={() => setIsPickerOpen(false)}>\n {pickerContent}\n </Modal>\n );\n }\n return (\n <Popover\n isOpen={isPickerOpen}\n onOpenChange={(open: boolean) => setIsPickerOpen(open)}\n content={pickerContent}\n placement={PopoverPlacement.Bottom}\n align={PopoverAlign.Start}\n // A click to place the caret in the field must not take the panel away.\n // The focus stays there on its own: Popover only follows a keyboard open.\n closeOnTriggerClick={false}\n constrainWidth={false}\n >\n {input}\n </Popover>\n );\n })();\n\n return (\n <div\n {...rest}\n className={cx(styles.datePicker, className, classNames?.root)}\n style={{ ...style, ...slotStyles?.root }}\n >\n {(isModal || isInline) && input}\n {picker}\n <Tooltip\n variant='error'\n message={formValidator ? formValidator.getCurrentErrorMessage() : errorMessage || ''}\n isVisible={hasErr && (isFocused || isHovered)}\n />\n </div>\n );\n}\n"],"mappings":"sgCA0BA,SAAwB,EAAW,EAAwB,CACzD,GAAM,CACJ,aAAY,GACZ,WACA,gBAAiB,KACjB,gBAAgB,KAChB,WAAU,GACV,YAAW,GACX,UAAU,GACV,WAAW,GACX,gBAAiB,KACjB,UAAU,KACV,UAAU,KACV,YAAW,KACX,mBAAkB,GAClB,SAAQ,GACR,WAAU,GACV,eAAe,GACf,aAAa,GACb,YACA,UACA,QACA,aACA,OAAQ,EACR,GAAG,GACD,EAAqB,aAAc,CAAK,EACtC,MAAwC,EAAiB,EAAc,MAAiB,EAExF,EAAc,EAAa,GAAK,IAAI,KAEpC,CAAC,EAAc,GAAmB,EAAS,EAAY,SAAS,EAAI,CAAC,EACrE,CAAC,EAAa,GAAkB,EAAS,EAAY,YAAY,CAAC,EAClE,CAAC,EAAc,GAAmB,EAAS,EAAK,EAChD,CAAC,EAAmB,GAAwB,MAAgB,EAAa,EAAI,EAAc,CAAW,EAAI,EAAG,EAC7G,CAAC,GAAW,GAAgB,EAAS,EAAK,EAC1C,CAAC,GAAW,GAAgB,EAAS,EAAK,EAC1C,EAAG,IAAe,EAAS,CAAC,EAC5B,CAAC,GAAc,IAAmB,EAAS,CAAQ,EA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AAoB,EAAa,EAAK,EACtC,QAAS,CAAC,CACX,CAAA,EAGG,GACA,EAAiB,EACjB,EAEA,EAAC,EAAD,CAAO,WAAA,GAAW,OAAQ,EAAc,YAAe,EAAgB,EAAK,EACzE,SAAA,CACI,CAAA,EAIT,EAAC,GAAD,CACE,OAAQ,EACR,aAAe,GAAkB,EAAgB,CAAI,EACrD,QAAS,EACT,UAAW,EAAiB,OAC5B,MAAO,EAAa,MAGpB,oBAAqB,GACrB,eAAgB,GAEf,SAAA,CACM,CAAA,EAIb,OACE,EAAC,MAAD,CACE,GAAI,EACJ,UAAW,EAAG,EAAO,WAAY,GAAW,GAAY,IAAI,EAC5D,MAAO,CAAE,GAAG,EAAO,GAAG,GAAY,IAAK,EAHzC,SAAA,EAKI,GAAW,IAAa,EACzB,GACD,EAAC,GAAD,CACE,QAAQ,QACR,QAAS,EAAgB,EAAc,uBAAuB,EAAI,GAAgB,GAClF,UAAW,IAAW,IAAa,GACpC,CAAA,CACE,GAET"}
1
+ {"version":3,"file":"datePicker.mjs","names":[],"sources":["../../../../package/common/datePicker/datePicker.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\nimport cx from 'classnames';\nimport Input from '../input';\nimport { useComponentDefaults } from '../configProvider';\nimport DatePickerMonth from './components/datePickerMonth';\nimport { faChevronLeft, faChevronRight } from '@fortawesome/free-solid-svg-icons';\nimport { getLocale } from 'services/localization';\nimport ActionIcon from '../actionIcon';\nimport Modal from '../modal';\nimport Popover from '../popover';\nimport Dropdown from '../dropdown';\nimport { PopoverAlign, PopoverPlacement } from '../popover/popover.types';\nimport InputMask, { InputState, BeforeMaskedStateChangeStates } from '@mona-health/react-input-mask';\nimport {\n getDateFromDayMonthAndYear,\n getMonthName,\n getMonthNames,\n getDateString,\n correctDateMaskValue,\n} from './dateFunctions';\nimport Button from '../button';\nimport Tooltip from '../tooltip';\nimport type { DatePickerProps } from './datePicker.types';\n\nimport styles from './datePicker.module.pcss';\n\nexport default function DatePicker(props: DatePickerProps) {\n const {\n className = '',\n selected,\n onSelect = () => null,\n formValidator = null,\n noInput = false,\n noHeader = false,\n isModal = false,\n isInline = false,\n onChange = () => null,\n minDate = null,\n maxDate = null,\n children = null,\n showClearButton = false,\n label = '',\n isValid = true,\n errorMessage = '',\n isRequired = false,\n startDate,\n endDate,\n style,\n classNames,\n styles: slotStyles,\n ...rest\n } = useComponentDefaults('DatePicker', props);\n const getCurrValue = (): Date | undefined => (formValidator ? (formValidator.value as Date) : selected);\n\n const initialDate = getCurrValue() ?? new Date();\n\n const [currentMonth, setCurrentMonth] = useState(initialDate.getMonth() + 1);\n const [currentYear, setCurrentYear] = useState(initialDate.getFullYear());\n const [isPickerOpen, setIsPickerOpen] = useState(false);\n const [currentDateString, setCurrentDateString] = useState(() => (getCurrValue() ? getDateString(initialDate) : ''));\n const [isFocused, setIsFocused] = useState(false);\n const [isHovered, setIsHovered] = useState(false);\n const [, forceUpdate] = useState(0);\n const [prevSelected, setPrevSelected] = useState(selected);\n\n const fvRef = useRef(formValidator);\n\n // Sync navigation view when `selected` prop changes externally\n if (prevSelected !== selected) {\n setPrevSelected(selected);\n const d = selected ?? new Date();\n setCurrentMonth(d.getMonth() + 1);\n setCurrentYear(d.getFullYear());\n setCurrentDateString(selected ? getDateString(selected) : '');\n }\n\n // Subscribe to formValidator updates (external system → setState in callback)\n useEffect(() => {\n fvRef.current = formValidator;\n if (!formValidator) return;\n const listener = () => {\n const val = formValidator.value as Date | undefined;\n if (val) {\n setCurrentMonth(val.getMonth() + 1);\n setCurrentYear(val.getFullYear());\n setCurrentDateString(getDateString(val));\n } else {\n setCurrentDateString('');\n }\n forceUpdate((n: number) => n + 1);\n };\n formValidator.registerOnUpdateListener(listener);\n return () => formValidator.removeOnUpdateListener(listener);\n }, [formValidator]);\n\n const hasError = (): boolean => {\n return formValidator ? formValidator.touched && formValidator.hasError() : !isValid || !!errorMessage;\n };\n\n const computedIsRequired = (): boolean => {\n return !!(\n isRequired || formValidator?.validators.find((v) => (v as { validatorId?: string }).validatorId === 'required')\n );\n };\n\n const handleChange = (date: Date | null) => {\n setCurrentDateString(date ? getDateString(date) : '');\n if (formValidator) formValidator.set(date);\n onChange(date);\n };\n\n const handleSelect = (date: Date | null) => {\n handleChange(date);\n onSelect(date);\n setIsPickerOpen(false);\n };\n\n const changeMonth = (delta: number) => {\n setCurrentMonth((prev) => {\n let next = prev + delta;\n if (next < 1) {\n next = 12;\n setCurrentYear((y) => y - 1);\n } else if (next > 12) {\n next = 1;\n setCurrentYear((y) => y + 1);\n }\n return next;\n });\n };\n\n const tryParseDateString = (dateString: string): Date | null => {\n if (dateString.match(/\\d{2}\\.\\d{2}\\.\\d{4}/gi)) {\n const [day, month, year] = dateString.split('.');\n const parsedDate = getDateFromDayMonthAndYear(Number(day), Number(month), Number(year));\n if (parsedDate && parsedDate.toString() !== 'Invalid Date') {\n const isSmallerThanMaxDate = !maxDate || parsedDate <= maxDate;\n const isBiggerThanMinDate = !minDate || parsedDate >= minDate;\n if (isSmallerThanMaxDate && isBiggerThanMinDate) return parsedDate;\n }\n }\n return null;\n };\n\n const beforeMaskedStateChange = ({ previousState, nextState }: BeforeMaskedStateChangeStates): InputState => {\n // previousState is only supplied on user-driven change events; on mount/focus/blur\n // there is nothing to auto-correct, so the next state passes through unchanged.\n if (!previousState || nextState.value === previousState.value) return nextState;\n\n const corrected = correctDateMaskValue(nextState.value, previousState.value, nextState.selection ?? null);\n\n const parsedDate = tryParseDateString(corrected.value);\n if (parsedDate) handleChange(parsedDate);\n\n return corrected;\n };\n\n const getYearDropdownOptions = () => {\n let length = 400;\n let zeroOffset = new Date().getFullYear() - 200;\n if (minDate) zeroOffset = minDate.getFullYear();\n if (maxDate) length = maxDate.getFullYear() - zeroOffset + 1;\n return Array.from(Array(length).keys()).map((i) => ({ key: i + zeroOffset, label: i + zeroOffset }));\n };\n\n const currValue = getCurrValue();\n const hasErr = hasError();\n\n const header = noHeader ? null : (\n <div className={cx(styles.datePickerHeader, classNames?.header)} style={slotStyles?.header}>\n <ActionIcon icon={faChevronLeft} onClick={() => changeMonth(-1)} />\n <div className={styles.datePickerHeaderMonthAndYearContainer}>\n <div className={styles.datePickerHeaderMonthAndYear}>\n <Dropdown\n plainStyle\n scrollToSelected\n onChange={(v) => setCurrentMonth(v as number)}\n className={cx(styles.datePickerHeaderMonth, classNames?.monthDropdown)}\n style={slotStyles?.monthDropdown}\n value={getMonthName(getLocale('-'), currentYear, currentMonth, 1)}\n items={getMonthNames().map((month, index) => ({ key: index + 1, label: month }))}\n />\n <Dropdown\n plainStyle\n scrollToSelected\n useMatLabelStyle={false}\n className={cx(styles.datePickerHeaderYear, classNames?.yearDropdown)}\n style={slotStyles?.yearDropdown}\n onChange={(v) => setCurrentYear(v as number)}\n value={currentYear}\n items={getYearDropdownOptions()}\n />\n </div>\n </div>\n <ActionIcon icon={faChevronRight} onClick={() => changeMonth(1)} />\n </div>\n );\n\n const pickerContent = (\n <>\n {header}\n <DatePickerMonth\n className={cx(styles.datePickerMonth, classNames?.calendar)}\n style={slotStyles?.calendar}\n month={currentMonth}\n year={currentYear}\n onSelect={handleSelect}\n selectionStart={startDate ?? currValue}\n selectionEnd={endDate ?? currValue}\n minDate={minDate}\n maxDate={maxDate}\n onNavigateMonth={changeMonth}\n />\n {showClearButton && (\n <Button onClick={() => handleSelect(null)} className={classNames?.clearButton} style={slotStyles?.clearButton}>\n Clear\n </Button>\n )}\n {children}\n </>\n );\n\n const input = noInput ? null : (\n <Input\n autoComplete='off'\n className={classNames?.input}\n style={slotStyles?.input}\n readOnly={isModal}\n classNames={isModal ? { input: styles.datePickerModalInput } : undefined}\n label={`${label}${computedIsRequired() ? ' *' : ''}`}\n value={currentDateString}\n onChange={(v) => setCurrentDateString(v as string)}\n onClick={() => setIsPickerOpen(true)}\n customInput={\n <InputMask mask='99.99.9999' maskPlaceholder='_' beforeMaskedStateChange={beforeMaskedStateChange} />\n }\n onBlur={() => {\n if (fvRef.current) fvRef.current.touched = true;\n setIsFocused(false);\n handleChange(tryParseDateString(currentDateString));\n }}\n onFocus={() => setIsFocused(true)}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n isValid={!hasErr}\n />\n );\n\n const picker = (() => {\n if (isInline) return pickerContent;\n if (isModal) {\n return (\n <Modal hideHeader isOpen={isPickerOpen} onClose={() => setIsPickerOpen(false)}>\n {pickerContent}\n </Modal>\n );\n }\n return (\n <Popover\n isOpen={isPickerOpen}\n onOpenChange={(open: boolean) => setIsPickerOpen(open)}\n content={pickerContent}\n placement={PopoverPlacement.Bottom}\n align={PopoverAlign.Start}\n // A click to place the caret in the field must not take the panel away.\n // The focus stays there on its own: Popover only follows a keyboard open.\n closeOnTriggerClick={false}\n constrainWidth={false}\n >\n {input}\n </Popover>\n );\n })();\n\n return (\n <div\n {...rest}\n className={cx(styles.datePicker, className, classNames?.root)}\n style={{ ...style, ...slotStyles?.root }}\n >\n {(isModal || isInline) && input}\n {picker}\n <Tooltip\n variant='error'\n message={formValidator ? formValidator.getCurrentErrorMessage() : errorMessage || ''}\n isVisible={hasErr && (isFocused || isHovered)}\n />\n </div>\n );\n}\n"],"mappings":"mhCA0BA,SAAwB,EAAW,EAAwB,CACzD,GAAM,CACJ,aAAY,GACZ,WACA,gBAAiB,KACjB,gBAAgB,KAChB,WAAU,GACV,YAAW,GACX,UAAU,GACV,WAAW,GACX,gBAAiB,KACjB,UAAU,KACV,UAAU,KACV,YAAW,KACX,mBAAkB,GAClB,SAAQ,GACR,WAAU,GACV,eAAe,GACf,aAAa,GACb,YACA,UACA,QACA,aACA,OAAQ,EACR,GAAG,GACD,EAAqB,aAAc,CAAK,EACtC,MAAwC,EAAiB,EAAc,MAAiB,EAExF,EAAc,EAAa,GAAK,IAAI,KAEpC,CAAC,EAAc,GAAmB,EAAS,EAAY,SAAS,EAAI,CAAC,EACrE,CAAC,EAAa,GAAkB,EAAS,EAAY,YAAY,CAAC,EAClE,CAAC,EAAc,GAAmB,EAAS,EAAK,EAChD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D,CAAW,KAAK,aAAa,gBAAgB,IAA6B,0BAA0B,CAAA,EAEtG,WAAc,CACR,EAAM,UAAS,EAAM,QAAQ,QAAU,IAC3C,EAAa,EAAK,EAClB,EAAa,EAAmB,CAAiB,CAAC,CACpD,EACA,YAAe,EAAa,EAAI,EAChC,iBAAoB,EAAa,EAAI,EACrC,iBAAoB,EAAa,EAAK,EACtC,QAAS,CAAC,CACX,CAAA,EAGG,GACA,EAAiB,EACjB,EAEA,EAAC,EAAD,CAAO,WAAA,GAAW,OAAQ,EAAc,YAAe,EAAgB,EAAK,EACzE,SAAA,CACI,CAAA,EAIT,EAAC,GAAD,CACE,OAAQ,EACR,aAAe,GAAkB,EAAgB,CAAI,EACrD,QAAS,EACT,UAAW,EAAiB,OAC5B,MAAO,EAAa,MAGpB,oBAAqB,GACrB,eAAgB,GAEf,SAAA,CACM,CAAA,EAIb,OACE,EAAC,MAAD,CACE,GAAI,EACJ,UAAW,EAAG,EAAO,WAAY,GAAW,GAAY,IAAI,EAC5D,MAAO,CAAE,GAAG,EAAO,GAAG,GAAY,IAAK,EAHzC,SAAA,EAKI,GAAW,IAAa,EACzB,GACD,EAAC,GAAD,CACE,QAAQ,QACR,QAAS,EAAgB,EAAc,uBAAuB,EAAI,GAAgB,GAClF,UAAW,IAAW,IAAa,GACpC,CAAA,CACE,GAET"}
@@ -1,2 +1,2 @@
1
- var e=`datePicker_ZohTp`,t=`datePicker-header_YmSWE`,n=`datePicker-header-monthAndYear_b5ntO`,r=`datePicker-header-monthAndYear-container_Hcgks`,i=`datePicker-header-month_jqFHl`,a=`datePicker-header-year_4egHF`,o=`datePicker-month_7iosT`,s=`datePicker-modalInput_E2Vig`,c={datePicker:e,"datePicker-header":`datePicker-header_YmSWE`,datePickerHeader:t,"datePicker-header-monthAndYear":`datePicker-header-monthAndYear_b5ntO`,datePickerHeaderMonthAndYear:n,"datePicker-header-monthAndYear-container":`datePicker-header-monthAndYear-container_Hcgks`,datePickerHeaderMonthAndYearContainer:r,"datePicker-header-month":`datePicker-header-month_jqFHl`,datePickerHeaderMonth:i,"datePicker-header-year":`datePicker-header-year_4egHF`,datePickerHeaderYear:a,"datePicker-month":`datePicker-month_7iosT`,datePickerMonth:o,"datePicker-modalInput":`datePicker-modalInput_E2Vig`,datePickerModalInput:s};export{e as datePicker,t as datePickerHeader,i as datePickerHeaderMonth,n as datePickerHeaderMonthAndYear,r as datePickerHeaderMonthAndYearContainer,a as datePickerHeaderYear,s as datePickerModalInput,o as datePickerMonth,c as default};
1
+ "use client";var e=`datePicker_ZohTp`,t=`datePicker-header_YmSWE`,n=`datePicker-header-monthAndYear_b5ntO`,r=`datePicker-header-monthAndYear-container_Hcgks`,i=`datePicker-header-month_jqFHl`,a=`datePicker-header-year_4egHF`,o=`datePicker-month_7iosT`,s=`datePicker-modalInput_E2Vig`,c={datePicker:e,"datePicker-header":`datePicker-header_YmSWE`,datePickerHeader:t,"datePicker-header-monthAndYear":`datePicker-header-monthAndYear_b5ntO`,datePickerHeaderMonthAndYear:n,"datePicker-header-monthAndYear-container":`datePicker-header-monthAndYear-container_Hcgks`,datePickerHeaderMonthAndYearContainer:r,"datePicker-header-month":`datePicker-header-month_jqFHl`,datePickerHeaderMonth:i,"datePicker-header-year":`datePicker-header-year_4egHF`,datePickerHeaderYear:a,"datePicker-month":`datePicker-month_7iosT`,datePickerMonth:o,"datePicker-modalInput":`datePicker-modalInput_E2Vig`,datePickerModalInput:s};export{e as datePicker,t as datePickerHeader,i as datePickerHeaderMonth,n as datePickerHeaderMonthAndYear,r as datePickerHeaderMonthAndYearContainer,a as datePickerHeaderYear,s as datePickerModalInput,o as datePickerMonth,c as default};
2
2
  //# sourceMappingURL=datePicker.module.mjs.map
@@ -1,2 +1,2 @@
1
- import{useComponentDefaults as e}from"../configProvider/useComponentDefaults.mjs";import{DividerOrientation as t,DividerTextPosition as n}from"./divider.types.mjs";import r from"./divider.module.mjs";import i from"classnames";import{jsx as a,jsxs as o}from"react/jsx-runtime";var s={[n.Left]:r.dividerTextLeft,[n.Center]:r.dividerTextCenter,[n.Right]:r.dividerTextRight};function c(c){let{text:l,textPosition:u=n.Center,orientation:d=t.Horizontal,className:f,style:p,classNames:m,styles:h,...g}=e(`Divider`,c),_=l!=null&&l!==``,v=d===t.Vertical;return o(`div`,{...g,role:`separator`,"aria-orientation":v?`vertical`:void 0,className:i(r.divider,v&&r.dividerVertical,_&&s[u],f,m?.root),style:{...p,...h?.root},children:[a(`span`,{className:i(r.dividerLine,m?.line),style:h?.line}),_&&a(`span`,{className:i(r.dividerContent,m?.content),style:h?.content,children:l}),_&&a(`span`,{className:i(r.dividerLine,m?.line),style:h?.line})]})}export{c as default};
1
+ "use client";import{useComponentDefaults as e}from"../configProvider/useComponentDefaults.mjs";import{DividerOrientation as t,DividerTextPosition as n}from"./divider.types.mjs";import r from"./divider.module.mjs";import i from"classnames";import{jsx as a,jsxs as o}from"react/jsx-runtime";var s={[n.Left]:r.dividerTextLeft,[n.Center]:r.dividerTextCenter,[n.Right]:r.dividerTextRight};function c(c){let{text:l,textPosition:u=n.Center,orientation:d=t.Horizontal,className:f,style:p,classNames:m,styles:h,...g}=e(`Divider`,c),_=l!=null&&l!==``,v=d===t.Vertical;return o(`div`,{...g,role:`separator`,"aria-orientation":v?`vertical`:void 0,className:i(r.divider,v&&r.dividerVertical,_&&s[u],f,m?.root),style:{...p,...h?.root},children:[a(`span`,{className:i(r.dividerLine,m?.line),style:h?.line}),_&&a(`span`,{className:i(r.dividerContent,m?.content),style:h?.content,children:l}),_&&a(`span`,{className:i(r.dividerLine,m?.line),style:h?.line})]})}export{c as default};
2
2
  //# sourceMappingURL=divider.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"divider.mjs","names":[],"sources":["../../../../package/common/divider/divider.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport cx from 'classnames';\n\nimport { DividerTextPosition, DividerOrientation } from './divider.types';\nimport type { DividerProps } from './divider.types';\nimport styles from './divider.module.pcss';\nimport { useComponentDefaults } from '../configProvider';\n\nconst CLASS_BY_TEXT_POSITION: Record<DividerTextPosition, string> = {\n [DividerTextPosition.Left]: styles.dividerTextLeft,\n [DividerTextPosition.Center]: styles.dividerTextCenter,\n [DividerTextPosition.Right]: styles.dividerTextRight,\n};\n\nfunction Divider(props: DividerProps): ReactElement {\n const {\n text,\n textPosition = DividerTextPosition.Center,\n orientation = DividerOrientation.Horizontal,\n className,\n style,\n classNames,\n styles: slotStyles,\n ...rest\n } = useComponentDefaults('Divider', props);\n\n const hasText = text != null && text !== '';\n const isVertical = orientation === DividerOrientation.Vertical;\n\n return (\n <div\n {...rest}\n role='separator'\n aria-orientation={isVertical ? 'vertical' : undefined}\n className={cx(\n styles.divider,\n isVertical && styles.dividerVertical,\n hasText && CLASS_BY_TEXT_POSITION[textPosition],\n className,\n classNames?.root,\n )}\n style={{ ...style, ...slotStyles?.root }}\n >\n <span className={cx(styles.dividerLine, classNames?.line)} style={slotStyles?.line} />\n {hasText && (\n <span className={cx(styles.dividerContent, classNames?.content)} style={slotStyles?.content}>\n {text}\n </span>\n )}\n {hasText && <span className={cx(styles.dividerLine, classNames?.line)} style={slotStyles?.line} />}\n </div>\n );\n}\n\nexport default Divider;\n"],"mappings":"oRAQA,IAAM,EAA8D,EACjE,EAAoB,MAAO,EAAO,iBAClC,EAAoB,QAAS,EAAO,mBACpC,EAAoB,OAAQ,EAAO,gBACtC,EAEA,SAAS,EAAQ,EAAmC,CAClD,GAAM,CACJ,OACA,eAAe,EAAoB,OACnC,cAAc,EAAmB,WACjC,YACA,QACA,aACA,OAAQ,EACR,GAAG,GACD,EAAqB,UAAW,CAAK,EAEnC,EAAU,GAAQ,MAAQ,IAAS,GACnC,EAAa,IAAgB,EAAmB,SAEtD,OACE,EAAC,MAAD,CACE,GAAI,EACJ,KAAK,YACL,mBAAkB,EAAa,WAAa,IAAA,GAC5C,UAAW,EACT,EAAO,QACP,GAAc,EAAO,gBACrB,GAAW,EAAuB,GAClC,EACA,GAAY,IACd,EACA,MAAO,CAAE,GAAG,EAAO,GAAG,GAAY,IAAK,EAXzC,SAAA,CAaE,EAAC,OAAD,CAAM,UAAW,EAAG,EAAO,YAAa,GAAY,IAAI,EAAG,MAAO,GAAY,IAAO,CAAA,EACpF,GACC,EAAC,OAAD,CAAM,UAAW,EAAG,EAAO,eAAgB,GAAY,OAAO,EAAG,MAAO,GAAY,QACjF,SAAA,CACG,CAAA,EAEP,GAAW,EAAC,OAAD,CAAM,UAAW,EAAG,EAAO,YAAa,GAAY,IAAI,EAAG,MAAO,GAAY,IAAO,CAAA,CAC9F,GAET"}
1
+ {"version":3,"file":"divider.mjs","names":[],"sources":["../../../../package/common/divider/divider.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport cx from 'classnames';\n\nimport { DividerTextPosition, DividerOrientation } from './divider.types';\nimport type { DividerProps } from './divider.types';\nimport styles from './divider.module.pcss';\nimport { useComponentDefaults } from '../configProvider';\n\nconst CLASS_BY_TEXT_POSITION: Record<DividerTextPosition, string> = {\n [DividerTextPosition.Left]: styles.dividerTextLeft,\n [DividerTextPosition.Center]: styles.dividerTextCenter,\n [DividerTextPosition.Right]: styles.dividerTextRight,\n};\n\nfunction Divider(props: DividerProps): ReactElement {\n const {\n text,\n textPosition = DividerTextPosition.Center,\n orientation = DividerOrientation.Horizontal,\n className,\n style,\n classNames,\n styles: slotStyles,\n ...rest\n } = useComponentDefaults('Divider', props);\n\n const hasText = text != null && text !== '';\n const isVertical = orientation === DividerOrientation.Vertical;\n\n return (\n <div\n {...rest}\n role='separator'\n aria-orientation={isVertical ? 'vertical' : undefined}\n className={cx(\n styles.divider,\n isVertical && styles.dividerVertical,\n hasText && CLASS_BY_TEXT_POSITION[textPosition],\n className,\n classNames?.root,\n )}\n style={{ ...style, ...slotStyles?.root }}\n >\n <span className={cx(styles.dividerLine, classNames?.line)} style={slotStyles?.line} />\n {hasText && (\n <span className={cx(styles.dividerContent, classNames?.content)} style={slotStyles?.content}>\n {text}\n </span>\n )}\n {hasText && <span className={cx(styles.dividerLine, classNames?.line)} style={slotStyles?.line} />}\n </div>\n );\n}\n\nexport default Divider;\n"],"mappings":"iSAQA,IAAM,EAA8D,EACjE,EAAoB,MAAO,EAAO,iBAClC,EAAoB,QAAS,EAAO,mBACpC,EAAoB,OAAQ,EAAO,gBACtC,EAEA,SAAS,EAAQ,EAAmC,CAClD,GAAM,CACJ,OACA,eAAe,EAAoB,OACnC,cAAc,EAAmB,WACjC,YACA,QACA,aACA,OAAQ,EACR,GAAG,GACD,EAAqB,UAAW,CAAK,EAEnC,EAAU,GAAQ,MAAQ,IAAS,GACnC,EAAa,IAAgB,EAAmB,SAEtD,OACE,EAAC,MAAD,CACE,GAAI,EACJ,KAAK,YACL,mBAAkB,EAAa,WAAa,IAAA,GAC5C,UAAW,EACT,EAAO,QACP,GAAc,EAAO,gBACrB,GAAW,EAAuB,GAClC,EACA,GAAY,IACd,EACA,MAAO,CAAE,GAAG,EAAO,GAAG,GAAY,IAAK,EAXzC,SAAA,CAaE,EAAC,OAAD,CAAM,UAAW,EAAG,EAAO,YAAa,GAAY,IAAI,EAAG,MAAO,GAAY,IAAO,CAAA,EACpF,GACC,EAAC,OAAD,CAAM,UAAW,EAAG,EAAO,eAAgB,GAAY,OAAO,EAAG,MAAO,GAAY,QACjF,SAAA,CACG,CAAA,EAEP,GAAW,EAAC,OAAD,CAAM,UAAW,EAAG,EAAO,YAAa,GAAY,IAAI,EAAG,MAAO,GAAY,IAAO,CAAA,CAC9F,GAET"}
@@ -1,2 +1,2 @@
1
- var e=`divider_OO203`,t=`divider-line_nVep8`,n=`divider-content_-y7ou`,r=`divider-text-left_HYmeQ`,i=`divider-text-right_RH5sH`,a=`divider-vertical_CasA6`,o={divider:e,"divider-line":`divider-line_nVep8`,dividerLine:t,"divider-content":`divider-content_-y7ou`,dividerContent:n,"divider-text-left":`divider-text-left_HYmeQ`,dividerTextLeft:r,"divider-text-right":`divider-text-right_RH5sH`,dividerTextRight:i,"divider-vertical":`divider-vertical_CasA6`,dividerVertical:a};export{o as default,e as divider,n as dividerContent,t as dividerLine,r as dividerTextLeft,i as dividerTextRight,a as dividerVertical};
1
+ "use client";var e=`divider_OO203`,t=`divider-line_nVep8`,n=`divider-content_-y7ou`,r=`divider-text-left_HYmeQ`,i=`divider-text-right_RH5sH`,a=`divider-vertical_CasA6`,o={divider:e,"divider-line":`divider-line_nVep8`,dividerLine:t,"divider-content":`divider-content_-y7ou`,dividerContent:n,"divider-text-left":`divider-text-left_HYmeQ`,dividerTextLeft:r,"divider-text-right":`divider-text-right_RH5sH`,dividerTextRight:i,"divider-vertical":`divider-vertical_CasA6`,dividerVertical:a};export{o as default,e as divider,n as dividerContent,t as dividerLine,r as dividerTextLeft,i as dividerTextRight,a as dividerVertical};
2
2
  //# sourceMappingURL=divider.module.mjs.map
@@ -1,2 +1,2 @@
1
- var e=function(e){return e.Left=`left`,e.Center=`center`,e.Right=`right`,e}({}),t=function(e){return e.Horizontal=`horizontal`,e.Vertical=`vertical`,e}({});export{t as DividerOrientation,e as DividerTextPosition};
1
+ "use client";var e=function(e){return e.Left=`left`,e.Center=`center`,e.Right=`right`,e}({}),t=function(e){return e.Horizontal=`horizontal`,e.Vertical=`vertical`,e}({});export{t as DividerOrientation,e as DividerTextPosition};
2
2
  //# sourceMappingURL=divider.types.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"divider.types.mjs","names":[],"sources":["../../../../package/common/divider/divider.types.ts"],"sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport type { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';\n\nexport enum DividerTextPosition {\n Left = 'left',\n Center = 'center',\n Right = 'right',\n}\n\nexport enum DividerOrientation {\n Horizontal = 'horizontal',\n Vertical = 'vertical',\n}\n\nexport type DividerSlots = 'root' | 'line' | 'content';\n\nexport interface DividerProps extends HtmlProps {\n text?: ReactNode;\n textPosition?: DividerTextPosition;\n orientation?: DividerOrientation;\n className?: string;\n style?: CSSProperties;\n classNames?: SlotClassNames<DividerSlots>;\n styles?: SlotStyles<DividerSlots>;\n}\n"],"mappings":"AAGA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,KAAA,OACA,EAAA,OAAA,SACA,EAAA,MAAA,SACF,EAAA,CAAA,CAAA,EAEY,EAAL,SAAA,EAAA,OACL,GAAA,WAAA,aACA,EAAA,SAAA,YACF,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"divider.types.mjs","names":[],"sources":["../../../../package/common/divider/divider.types.ts"],"sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport type { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';\n\nexport enum DividerTextPosition {\n Left = 'left',\n Center = 'center',\n Right = 'right',\n}\n\nexport enum DividerOrientation {\n Horizontal = 'horizontal',\n Vertical = 'vertical',\n}\n\nexport type DividerSlots = 'root' | 'line' | 'content';\n\nexport interface DividerProps extends HtmlProps {\n text?: ReactNode;\n textPosition?: DividerTextPosition;\n orientation?: DividerOrientation;\n className?: string;\n style?: CSSProperties;\n classNames?: SlotClassNames<DividerSlots>;\n styles?: SlotStyles<DividerSlots>;\n}\n"],"mappings":"aAGA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,KAAA,OACA,EAAA,OAAA,SACA,EAAA,MAAA,SACF,EAAA,CAAA,CAAA,EAEY,EAAL,SAAA,EAAA,OACL,GAAA,WAAA,aACA,EAAA,SAAA,YACF,EAAA,CAAA,CAAA"}
@@ -1,2 +1,2 @@
1
- import e from"./drawer.module.mjs";import{useEffect as t,useRef as n}from"react";import r from"classnames";import{jsx as i}from"react/jsx-runtime";function a({className:a,isOpen:o=!1,closedWidth:s,openedWidth:c,children:l,style:u,classNames:d,styles:f,...p}){let m=n(null),h=n(null);return t(()=>{let e=new ResizeObserver(()=>{m.current&&h.current&&m.current.style.setProperty(`--drawer-content-width`,`${h.current.scrollWidth}px`)});return h.current&&e.observe(h.current),()=>e.disconnect()},[]),i(`div`,{...p,ref:m,className:r(e.drawer,o&&e.drawerOpen,a,d?.root),style:{...s!==void 0&&{"--drawer-closed-width":s},...c!==void 0&&{"--drawer-opened-width":c},...u,...f?.root},children:i(`div`,{ref:h,className:r(e.drawerContent,d?.content),style:f?.content,children:i(`div`,{className:r(e.drawerContentInner,d?.inner),style:f?.inner,children:l})})})}export{a as default};
1
+ "use client";import e from"./drawer.module.mjs";import{useEffect as t,useRef as n}from"react";import r from"classnames";import{jsx as i}from"react/jsx-runtime";function a({className:a,isOpen:o=!1,closedWidth:s,openedWidth:c,children:l,style:u,classNames:d,styles:f,...p}){let m=n(null),h=n(null);return t(()=>{let e=new ResizeObserver(()=>{m.current&&h.current&&m.current.style.setProperty(`--drawer-content-width`,`${h.current.scrollWidth}px`)});return h.current&&e.observe(h.current),()=>e.disconnect()},[]),i(`div`,{...p,ref:m,className:r(e.drawer,o&&e.drawerOpen,a,d?.root),style:{...s!==void 0&&{"--drawer-closed-width":s},...c!==void 0&&{"--drawer-opened-width":c},...u,...f?.root},children:i(`div`,{ref:h,className:r(e.drawerContent,d?.content),style:f?.content,children:i(`div`,{className:r(e.drawerContentInner,d?.inner),style:f?.inner,children:l})})})}export{a as default};
2
2
  //# sourceMappingURL=drawer.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.mjs","names":[],"sources":["../../../../package/common/drawer/drawer.tsx"],"sourcesContent":["import type { ReactElement, CSSProperties } from 'react';\nimport { useRef, useEffect } from 'react';\nimport { DrawerProps } from './drawer.types';\nimport cx from 'classnames';\n\nimport styles from './drawer.module.pcss';\n\nfunction Drawer({\n className,\n isOpen = false,\n closedWidth,\n openedWidth,\n children,\n style,\n classNames,\n styles: slotStyles,\n ...rest\n}: DrawerProps): ReactElement {\n const containerRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const observer = new ResizeObserver(() => {\n if (containerRef.current && contentRef.current) {\n containerRef.current.style.setProperty('--drawer-content-width', `${contentRef.current.scrollWidth}px`);\n }\n });\n if (contentRef.current) observer.observe(contentRef.current);\n return () => observer.disconnect();\n }, []);\n\n return (\n <div\n {...rest}\n ref={containerRef}\n className={cx(styles.drawer, isOpen && styles.drawerOpen, className, classNames?.root)}\n style={\n {\n ...(closedWidth !== undefined && { '--drawer-closed-width': closedWidth }),\n ...(openedWidth !== undefined && { '--drawer-opened-width': openedWidth }),\n ...style,\n ...slotStyles?.root,\n } as CSSProperties\n }\n >\n <div ref={contentRef} className={cx(styles.drawerContent, classNames?.content)} style={slotStyles?.content}>\n <div className={cx(styles.drawerContentInner, classNames?.inner)} style={slotStyles?.inner}>\n {children}\n </div>\n </div>\n </div>\n );\n}\n\nexport default Drawer;\n"],"mappings":"mJAOA,SAAS,EAAO,CACd,YACA,SAAS,GACT,cACA,cACA,WACA,QACA,aACA,OAAQ,EACR,GAAG,GACyB,CAC5B,IAAM,EAAe,EAAuB,IAAI,EAC1C,EAAa,EAAuB,IAAI,EAY9C,OAVA,MAAgB,CACd,IAAM,EAAW,IAAI,mBAAqB,CACpC,EAAa,SAAW,EAAW,SACrC,EAAa,QAAQ,MAAM,YAAY,yBAA0B,GAAG,EAAW,QAAQ,YAAY,GAAG,CAE1G,CAAC,EAED,OADI,EAAW,SAAS,EAAS,QAAQ,EAAW,OAAO,MAC9C,EAAS,WAAW,CACnC,EAAG,CAAC,CAAC,EAGH,EAAC,MAAD,CACE,GAAI,EACJ,IAAK,EACL,UAAW,EAAG,EAAO,OAAQ,GAAU,EAAO,WAAY,EAAW,GAAY,IAAI,EACrF,MACE,CACE,GAAI,IAAgB,IAAA,IAAa,CAAE,wBAAyB,CAAY,EACxE,GAAI,IAAgB,IAAA,IAAa,CAAE,wBAAyB,CAAY,EACxE,GAAG,EACH,GAAG,GAAY,IACjB,EAGF,SAAA,EAAC,MAAD,CAAK,IAAK,EAAY,UAAW,EAAG,EAAO,cAAe,GAAY,OAAO,EAAG,MAAO,GAAY,QACjG,SAAA,EAAC,MAAD,CAAK,UAAW,EAAG,EAAO,mBAAoB,GAAY,KAAK,EAAG,MAAO,GAAY,MAClF,UACE,CAAA,CACF,CAAA,CACF,CAAA,CAET"}
1
+ {"version":3,"file":"drawer.mjs","names":[],"sources":["../../../../package/common/drawer/drawer.tsx"],"sourcesContent":["import type { ReactElement, CSSProperties } from 'react';\nimport { useRef, useEffect } from 'react';\nimport { DrawerProps } from './drawer.types';\nimport cx from 'classnames';\n\nimport styles from './drawer.module.pcss';\n\nfunction Drawer({\n className,\n isOpen = false,\n closedWidth,\n openedWidth,\n children,\n style,\n classNames,\n styles: slotStyles,\n ...rest\n}: DrawerProps): ReactElement {\n const containerRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const observer = new ResizeObserver(() => {\n if (containerRef.current && contentRef.current) {\n containerRef.current.style.setProperty('--drawer-content-width', `${contentRef.current.scrollWidth}px`);\n }\n });\n if (contentRef.current) observer.observe(contentRef.current);\n return () => observer.disconnect();\n }, []);\n\n return (\n <div\n {...rest}\n ref={containerRef}\n className={cx(styles.drawer, isOpen && styles.drawerOpen, className, classNames?.root)}\n style={\n {\n ...(closedWidth !== undefined && { '--drawer-closed-width': closedWidth }),\n ...(openedWidth !== undefined && { '--drawer-opened-width': openedWidth }),\n ...style,\n ...slotStyles?.root,\n } as CSSProperties\n }\n >\n <div ref={contentRef} className={cx(styles.drawerContent, classNames?.content)} style={slotStyles?.content}>\n <div className={cx(styles.drawerContentInner, classNames?.inner)} style={slotStyles?.inner}>\n {children}\n </div>\n </div>\n </div>\n );\n}\n\nexport default Drawer;\n"],"mappings":"gKAOA,SAAS,EAAO,CACd,YACA,SAAS,GACT,cACA,cACA,WACA,QACA,aACA,OAAQ,EACR,GAAG,GACyB,CAC5B,IAAM,EAAe,EAAuB,IAAI,EAC1C,EAAa,EAAuB,IAAI,EAY9C,OAVA,MAAgB,CACd,IAAM,EAAW,IAAI,mBAAqB,CACpC,EAAa,SAAW,EAAW,SACrC,EAAa,QAAQ,MAAM,YAAY,yBAA0B,GAAG,EAAW,QAAQ,YAAY,GAAG,CAE1G,CAAC,EAED,OADI,EAAW,SAAS,EAAS,QAAQ,EAAW,OAAO,MAC9C,EAAS,WAAW,CACnC,EAAG,CAAC,CAAC,EAGH,EAAC,MAAD,CACE,GAAI,EACJ,IAAK,EACL,UAAW,EAAG,EAAO,OAAQ,GAAU,EAAO,WAAY,EAAW,GAAY,IAAI,EACrF,MACE,CACE,GAAI,IAAgB,IAAA,IAAa,CAAE,wBAAyB,CAAY,EACxE,GAAI,IAAgB,IAAA,IAAa,CAAE,wBAAyB,CAAY,EACxE,GAAG,EACH,GAAG,GAAY,IACjB,EAGF,SAAA,EAAC,MAAD,CAAK,IAAK,EAAY,UAAW,EAAG,EAAO,cAAe,GAAY,OAAO,EAAG,MAAO,GAAY,QACjG,SAAA,EAAC,MAAD,CAAK,UAAW,EAAG,EAAO,mBAAoB,GAAY,KAAK,EAAG,MAAO,GAAY,MAClF,UACE,CAAA,CACF,CAAA,CACF,CAAA,CAET"}
@@ -1,2 +1,2 @@
1
- var e=`drawer_5SRoc`,t=`drawer-open_-YQ8n`,n=`drawer-content_sHIAP`,r=`drawer-content-inner_f-IDz`,i={drawer:e,"drawer-open":`drawer-open_-YQ8n`,drawerOpen:t,"drawer-content":`drawer-content_sHIAP`,drawerContent:n,"drawer-content-inner":`drawer-content-inner_f-IDz`,drawerContentInner:r};export{i as default,e as drawer,n as drawerContent,r as drawerContentInner,t as drawerOpen};
1
+ "use client";var e=`drawer_5SRoc`,t=`drawer-open_-YQ8n`,n=`drawer-content_sHIAP`,r=`drawer-content-inner_f-IDz`,i={drawer:e,"drawer-open":`drawer-open_-YQ8n`,drawerOpen:t,"drawer-content":`drawer-content_sHIAP`,drawerContent:n,"drawer-content-inner":`drawer-content-inner_f-IDz`,drawerContentInner:r};export{i as default,e as drawer,n as drawerContent,r as drawerContentInner,t as drawerOpen};
2
2
  //# sourceMappingURL=drawer.module.mjs.map
@@ -1,2 +1,2 @@
1
- import{isSelfActivation as e}from"../utils/activationKey.mjs";import{DropZoneReturnType as t,DropZoneStatus as n}from"./dropZone.types.mjs";import r from"./dropZone.module.mjs";import{useCallback as i,useEffect as a,useId as o,useRef as s,useState as c}from"react";import l from"classnames";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(e,t){if(!t.length)return!0;let n=e.name.toLowerCase(),r=e.type.toLowerCase();return t.some(e=>{let t=e.trim().toLowerCase();return t?t.startsWith(`.`)?n.endsWith(t):t.endsWith(`/*`)?r.startsWith(t.slice(0,-1)):r===t:!1})}function p(e,n){return n===t.File?Promise.resolve({ok:!0,value:e}):new Promise(r=>{let i=new FileReader;i.onload=t=>{let n=t.target?.result;if(typeof n!=`string`){r({ok:!1});return}r({ok:!0,value:{name:e.name,size:e.size,type:e.type,lastModified:e.lastModified,data:n}})},i.onerror=()=>r({ok:!1}),n===t.Base64?i.readAsDataURL(e):i.readAsText(e)})}function m(e){return new Promise(t=>{if(e.isFile)e.file(e=>t([e]),()=>t([]));else if(e.isDirectory){let n=e.createReader(),r=[],i=()=>{n.readEntries(e=>{e.length?(r.push(...e),i()):Promise.all(r.map(m)).then(e=>t(e.flat()))},()=>t([]))};i()}else t([])})}function h(e,t){let n=e.items;if(n&&n.length){if(t&&typeof n[0].webkitGetAsEntry==`function`){let e=[];for(let t=0;t<n.length;t+=1)if(n[t].kind===`file`){let r=n[t].webkitGetAsEntry();r&&e.push(r)}if(e.length)return Promise.all(e.map(m)).then(e=>e.flat())}let e=[];for(let t=0;t<n.length;t+=1)if(n[t].kind===`file`){let r=n[t].getAsFile();r&&e.push(r)}return Promise.resolve(e)}return Promise.resolve(Array.from(e.files||[]))}function g({children:m,acceptedTypes:g=[],returnType:_=t.File,openPickerOnClick:v=!1,multiple:y=!0,maxFiles:b,maxSize:x,enablePaste:S=!1,allowDirectories:C=!0,capture:w,disabled:T=!1,unstyled:E=!1,showFileNames:D=!1,files:O,onFilesChanged:k,onReject:A,onStatusChanged:j,className:M,style:N,classNames:P,styles:F,...I}){let[L,ee]=c(n.Idle),R=s(null),z=o(),B=s(L),V=s(0),H=s(0),U=s({acceptedTypes:g,returnType:_,multiple:y,maxFiles:b,maxSize:x,allowDirectories:C,disabled:T,onFilesChanged:k,onReject:A,onStatusChanged:j});a(()=>{U.current={acceptedTypes:g,returnType:_,multiple:y,maxFiles:b,maxSize:x,allowDirectories:C,disabled:T,onFilesChanged:k,onReject:A,onStatusChanged:j}});let W=i(e=>{B.current!==e&&(B.current=e,ee(e),U.current.onStatusChanged?.(e))},[]),G=i(async e=>{let t=U.current,r=[],i=[];for(let n of e)f(n,t.acceptedTypes)?t.maxSize!=null&&n.size>t.maxSize?r.push({file:n,reason:`tooLarge`}):i.push(n):r.push({file:n,reason:`unacceptedType`});t.multiple||(i=i.slice(0,1)),t.maxFiles!=null&&i.length>t.maxFiles&&(i.slice(t.maxFiles).forEach(e=>r.push({file:e,reason:`tooMany`})),i=i.slice(0,t.maxFiles));let a=await Promise.all(i.map(e=>p(e,t.returnType))),o=[];a.forEach((e,t)=>{e.ok?o.push(e.value):r.push({file:i[t],reason:`readError`})}),r.length&&t.onReject?.(r),W(r.length&&!o.length?n.Error:n.Idle),o.length&&t.onFilesChanged?.(o)},[W]);a(()=>{let e=e=>!e||Array.from(e.types||[]).includes(`Files`),t=t=>{!U.current.disabled&&e(t.dataTransfer)&&(V.current+=1,(B.current===n.Idle||B.current===n.Error)&&W(n.Dragging))},r=()=>{V.current=Math.max(0,V.current-1),V.current===0&&B.current===n.Dragging&&W(n.Idle)},i=()=>{V.current=0,H.current=0,B.current===n.Dragging&&W(n.Idle)};return window.addEventListener(`dragenter`,t),window.addEventListener(`dragleave`,r),window.addEventListener(`drop`,i),()=>{window.removeEventListener(`dragenter`,t),window.removeEventListener(`dragleave`,r),window.removeEventListener(`drop`,i)}},[W]);let K=i(e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=T?`none`:`copy`)},[T]),q=i(e=>{e.preventDefault(),e.stopPropagation(),!T&&(H.current+=1,W(n.Active))},[T,W]),J=i(e=>{e.preventDefault(),e.stopPropagation(),H.current=Math.max(0,H.current-1),H.current===0&&W(V.current>0?n.Dragging:n.Idle)},[W]),Y=i(e=>{if(e.preventDefault(),e.stopPropagation(),H.current=0,V.current=0,T||!e.dataTransfer){W(n.Idle);return}W(n.Idle),h(e.dataTransfer,U.current.allowDirectories).then(e=>{e.length&&G(e)})},[T,W,G]),X=i(()=>{!T&&v&&R.current?.click()},[T,v]),Z=i(e=>{let t=Array.from(e.target.files||[]);e.target.value=``,t.length&&G(t)},[G]),Q=i(e=>{if(!S||T)return;let t=Array.from(e.clipboardData?.files||[]);t.length&&(e.preventDefault(),G(t))},[S,T,G]),te=i(t=>{v&&!T&&e(t)&&(t.preventDefault(),X())},[v,T,X]),$=L===n.Dragging||L===n.Active,ne={status:L,isDragging:$,isActive:L===n.Active,disabled:T},re=g.length?g.join(`,`):void 0;return d(`div`,{...I,className:l(r.dropZone,v&&r.dropZoneClickable,T&&r.dropZoneDisabled,!E&&r.dropZoneDefault,!E&&L===n.Dragging&&r.dropZoneDragging,!E&&L===n.Active&&r.dropZoneActive,!E&&L===n.Error&&r.dropZoneError,P?.root,M),style:{...F?.root,...N},onDragEnter:q,onDragLeave:J,onDragOver:K,onDrop:Y,onClick:X,onKeyDown:te,onPaste:S?Q:void 0,role:v?`button`:void 0,tabIndex:v&&!T?0:void 0,"aria-disabled":T||void 0,children:[u(`div`,{className:l(r.dropZoneContent,$&&r.dropZoneContentDragging,P?.content),style:F?.content,children:typeof m==`function`?m(ne):m}),D&&O&&O.length>0&&u(`div`,{className:l(r.dropZoneFileList,P?.fileList),style:F?.fileList,children:O.map((e,t)=>u(`div`,{className:l(r.dropZoneFileItem,P?.fileItem),style:F?.fileItem,children:e.name},`${e.name}-${t}`))}),u(`input`,{ref:R,id:z,type:`file`,className:l(r.dropZoneInput,P?.input),style:F?.input,accept:re,multiple:y,capture:w,disabled:T,onChange:Z,tabIndex:-1,"aria-hidden":`true`})]})}export{g as default};
1
+ "use client";import{isSelfActivation as e}from"../utils/activationKey.mjs";import{DropZoneReturnType as t,DropZoneStatus as n}from"./dropZone.types.mjs";import r from"./dropZone.module.mjs";import{useCallback as i,useEffect as a,useId as o,useRef as s,useState as c}from"react";import l from"classnames";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(e,t){if(!t.length)return!0;let n=e.name.toLowerCase(),r=e.type.toLowerCase();return t.some(e=>{let t=e.trim().toLowerCase();return t?t.startsWith(`.`)?n.endsWith(t):t.endsWith(`/*`)?r.startsWith(t.slice(0,-1)):r===t:!1})}function p(e,n){return n===t.File?Promise.resolve({ok:!0,value:e}):new Promise(r=>{let i=new FileReader;i.onload=t=>{let n=t.target?.result;if(typeof n!=`string`){r({ok:!1});return}r({ok:!0,value:{name:e.name,size:e.size,type:e.type,lastModified:e.lastModified,data:n}})},i.onerror=()=>r({ok:!1}),n===t.Base64?i.readAsDataURL(e):i.readAsText(e)})}function m(e){return new Promise(t=>{if(e.isFile)e.file(e=>t([e]),()=>t([]));else if(e.isDirectory){let n=e.createReader(),r=[],i=()=>{n.readEntries(e=>{e.length?(r.push(...e),i()):Promise.all(r.map(m)).then(e=>t(e.flat()))},()=>t([]))};i()}else t([])})}function h(e,t){let n=e.items;if(n&&n.length){if(t&&typeof n[0].webkitGetAsEntry==`function`){let e=[];for(let t=0;t<n.length;t+=1)if(n[t].kind===`file`){let r=n[t].webkitGetAsEntry();r&&e.push(r)}if(e.length)return Promise.all(e.map(m)).then(e=>e.flat())}let e=[];for(let t=0;t<n.length;t+=1)if(n[t].kind===`file`){let r=n[t].getAsFile();r&&e.push(r)}return Promise.resolve(e)}return Promise.resolve(Array.from(e.files||[]))}function g({children:m,acceptedTypes:g=[],returnType:_=t.File,openPickerOnClick:v=!1,multiple:y=!0,maxFiles:b,maxSize:x,enablePaste:S=!1,allowDirectories:C=!0,capture:w,disabled:T=!1,unstyled:E=!1,showFileNames:D=!1,files:O,onFilesChanged:k,onReject:A,onStatusChanged:j,className:M,style:N,classNames:P,styles:F,...I}){let[L,ee]=c(n.Idle),R=s(null),z=o(),B=s(L),V=s(0),H=s(0),U=s({acceptedTypes:g,returnType:_,multiple:y,maxFiles:b,maxSize:x,allowDirectories:C,disabled:T,onFilesChanged:k,onReject:A,onStatusChanged:j});a(()=>{U.current={acceptedTypes:g,returnType:_,multiple:y,maxFiles:b,maxSize:x,allowDirectories:C,disabled:T,onFilesChanged:k,onReject:A,onStatusChanged:j}});let W=i(e=>{B.current!==e&&(B.current=e,ee(e),U.current.onStatusChanged?.(e))},[]),G=i(async e=>{let t=U.current,r=[],i=[];for(let n of e)f(n,t.acceptedTypes)?t.maxSize!=null&&n.size>t.maxSize?r.push({file:n,reason:`tooLarge`}):i.push(n):r.push({file:n,reason:`unacceptedType`});t.multiple||(i=i.slice(0,1)),t.maxFiles!=null&&i.length>t.maxFiles&&(i.slice(t.maxFiles).forEach(e=>r.push({file:e,reason:`tooMany`})),i=i.slice(0,t.maxFiles));let a=await Promise.all(i.map(e=>p(e,t.returnType))),o=[];a.forEach((e,t)=>{e.ok?o.push(e.value):r.push({file:i[t],reason:`readError`})}),r.length&&t.onReject?.(r),W(r.length&&!o.length?n.Error:n.Idle),o.length&&t.onFilesChanged?.(o)},[W]);a(()=>{let e=e=>!e||Array.from(e.types||[]).includes(`Files`),t=t=>{!U.current.disabled&&e(t.dataTransfer)&&(V.current+=1,(B.current===n.Idle||B.current===n.Error)&&W(n.Dragging))},r=()=>{V.current=Math.max(0,V.current-1),V.current===0&&B.current===n.Dragging&&W(n.Idle)},i=()=>{V.current=0,H.current=0,B.current===n.Dragging&&W(n.Idle)};return window.addEventListener(`dragenter`,t),window.addEventListener(`dragleave`,r),window.addEventListener(`drop`,i),()=>{window.removeEventListener(`dragenter`,t),window.removeEventListener(`dragleave`,r),window.removeEventListener(`drop`,i)}},[W]);let K=i(e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=T?`none`:`copy`)},[T]),q=i(e=>{e.preventDefault(),e.stopPropagation(),!T&&(H.current+=1,W(n.Active))},[T,W]),J=i(e=>{e.preventDefault(),e.stopPropagation(),H.current=Math.max(0,H.current-1),H.current===0&&W(V.current>0?n.Dragging:n.Idle)},[W]),Y=i(e=>{if(e.preventDefault(),e.stopPropagation(),H.current=0,V.current=0,T||!e.dataTransfer){W(n.Idle);return}W(n.Idle),h(e.dataTransfer,U.current.allowDirectories).then(e=>{e.length&&G(e)})},[T,W,G]),X=i(()=>{!T&&v&&R.current?.click()},[T,v]),Z=i(e=>{let t=Array.from(e.target.files||[]);e.target.value=``,t.length&&G(t)},[G]),Q=i(e=>{if(!S||T)return;let t=Array.from(e.clipboardData?.files||[]);t.length&&(e.preventDefault(),G(t))},[S,T,G]),te=i(t=>{v&&!T&&e(t)&&(t.preventDefault(),X())},[v,T,X]),$=L===n.Dragging||L===n.Active,ne={status:L,isDragging:$,isActive:L===n.Active,disabled:T},re=g.length?g.join(`,`):void 0;return d(`div`,{...I,className:l(r.dropZone,v&&r.dropZoneClickable,T&&r.dropZoneDisabled,!E&&r.dropZoneDefault,!E&&L===n.Dragging&&r.dropZoneDragging,!E&&L===n.Active&&r.dropZoneActive,!E&&L===n.Error&&r.dropZoneError,P?.root,M),style:{...F?.root,...N},onDragEnter:q,onDragLeave:J,onDragOver:K,onDrop:Y,onClick:X,onKeyDown:te,onPaste:S?Q:void 0,role:v?`button`:void 0,tabIndex:v&&!T?0:void 0,"aria-disabled":T||void 0,children:[u(`div`,{className:l(r.dropZoneContent,$&&r.dropZoneContentDragging,P?.content),style:F?.content,children:typeof m==`function`?m(ne):m}),D&&O&&O.length>0&&u(`div`,{className:l(r.dropZoneFileList,P?.fileList),style:F?.fileList,children:O.map((e,t)=>u(`div`,{className:l(r.dropZoneFileItem,P?.fileItem),style:F?.fileItem,children:e.name},`${e.name}-${t}`))}),u(`input`,{ref:R,id:z,type:`file`,className:l(r.dropZoneInput,P?.input),style:F?.input,accept:re,multiple:y,capture:w,disabled:T,onChange:Z,tabIndex:-1,"aria-hidden":`true`})]})}export{g as default};
2
2
  //# sourceMappingURL=dropZone.mjs.map