@hitachivantara/uikit-react-core 5.80.1 → 5.81.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 (587) hide show
  1. package/dist/cjs/Accordion/Accordion.cjs +5 -5
  2. package/dist/cjs/ActionBar/ActionBar.cjs +4 -3
  3. package/dist/cjs/ActionsGeneric/ActionsGeneric.cjs +3 -2
  4. package/dist/cjs/AppSwitcher/AppSwitcher.cjs +3 -2
  5. package/dist/cjs/Avatar/Avatar.cjs +1 -1
  6. package/dist/cjs/AvatarGroup/AvatarGroup.cjs +1 -1
  7. package/dist/cjs/Badge/Badge.cjs +1 -1
  8. package/dist/cjs/Banner/Banner.cjs +3 -2
  9. package/dist/cjs/Banner/BannerContent/BannerContent.cjs +1 -1
  10. package/dist/cjs/BaseCheckBox/BaseCheckBox.cjs +1 -1
  11. package/dist/cjs/BaseDropdown/BaseDropdown.cjs +83 -166
  12. package/dist/cjs/BaseDropdown/BaseDropdown.styles.cjs +2 -2
  13. package/dist/cjs/BaseDropdown/BaseDropdownPanel.cjs +80 -0
  14. package/dist/cjs/BaseDropdown/{BaseDropdownContext/BaseDropdownContext.cjs → context.cjs} +2 -2
  15. package/dist/cjs/BaseInput/BaseInput.cjs +5 -3
  16. package/dist/cjs/BaseRadio/BaseRadio.cjs +1 -1
  17. package/dist/cjs/BaseSwitch/BaseSwitch.cjs +1 -1
  18. package/dist/cjs/BreadCrumb/BreadCrumb.cjs +3 -3
  19. package/dist/cjs/BulkActions/BulkActions.cjs +4 -2
  20. package/dist/cjs/BulkActions/BulkActions.styles.cjs +1 -3
  21. package/dist/cjs/Button/Button.styles.cjs +6 -2
  22. package/dist/cjs/Card/Card.cjs +3 -2
  23. package/dist/cjs/Carousel/Carousel.cjs +3 -2
  24. package/dist/cjs/Carousel/CarouselThumbnails.cjs +1 -1
  25. package/dist/cjs/CheckBox/CheckBox.cjs +1 -1
  26. package/dist/cjs/CheckBoxGroup/CheckBoxGroup.cjs +1 -1
  27. package/dist/cjs/ColorPicker/ColorPicker.cjs +1 -1
  28. package/dist/cjs/Container/Container.cjs +1 -1
  29. package/dist/cjs/DatePicker/DatePicker.cjs +1 -1
  30. package/dist/cjs/Drawer/Drawer.cjs +4 -2
  31. package/dist/cjs/DropDownMenu/DropDownMenu.cjs +24 -30
  32. package/dist/cjs/DropDownMenu/DropDownMenu.styles.cjs +15 -2
  33. package/dist/cjs/Dropdown/List/List.cjs +6 -5
  34. package/dist/cjs/DropdownButton/DropdownButton.cjs +1 -1
  35. package/dist/cjs/EmptyState/EmptyState.cjs +4 -3
  36. package/dist/cjs/FilterGroup/FilterContent/FilterContent.cjs +1 -1
  37. package/dist/cjs/FilterGroup/FilterGroup.cjs +1 -1
  38. package/dist/cjs/Footer/Footer.cjs +4 -2
  39. package/dist/cjs/GlobalActions/GlobalActions.cjs +4 -2
  40. package/dist/cjs/Grid/Grid.cjs +1 -1
  41. package/dist/cjs/Header/Actions/Actions.cjs +1 -1
  42. package/dist/cjs/Header/Brand/Brand.cjs +1 -1
  43. package/dist/cjs/Header/Header.cjs +4 -2
  44. package/dist/cjs/Header/Navigation/Navigation.cjs +1 -1
  45. package/dist/cjs/Input/Input.cjs +1 -1
  46. package/dist/cjs/ListContainer/ListContainer.cjs +1 -1
  47. package/dist/cjs/ListContainer/ListItem/ListItem.cjs +1 -1
  48. package/dist/cjs/Loading/Loading.cjs +4 -2
  49. package/dist/cjs/LoadingContainer/LoadingContainer.cjs +4 -3
  50. package/dist/cjs/Login/Login.cjs +4 -4
  51. package/dist/cjs/MultiButton/MultiButton.cjs +3 -4
  52. package/dist/cjs/MultiButton/MultiButton.styles.cjs +48 -109
  53. package/dist/cjs/Pagination/Pagination.cjs +3 -3
  54. package/dist/cjs/Pagination/Pagination.styles.cjs +1 -1
  55. package/dist/cjs/Panel/Panel.cjs +1 -1
  56. package/dist/cjs/Panel/Panel.styles.cjs +2 -1
  57. package/dist/cjs/Radio/Radio.cjs +1 -1
  58. package/dist/cjs/RadioGroup/RadioGroup.cjs +1 -1
  59. package/dist/cjs/Section/Section.cjs +26 -31
  60. package/dist/cjs/Section/Section.styles.cjs +12 -8
  61. package/dist/cjs/Select/OptionGroup.cjs +1 -1
  62. package/dist/cjs/SelectionList/SelectionList.cjs +1 -1
  63. package/dist/cjs/Snackbar/Snackbar.cjs +27 -24
  64. package/dist/cjs/Switch/Switch.cjs +1 -1
  65. package/dist/cjs/Tab/Tab.cjs +4 -2
  66. package/dist/cjs/Table/Table.cjs +1 -1
  67. package/dist/cjs/Table/TableCell/TableCell.cjs +2 -2
  68. package/dist/cjs/Table/TableCell/TableCell.styles.cjs +2 -5
  69. package/dist/cjs/Table/TableHeader/TableHeader.cjs +43 -51
  70. package/dist/cjs/Table/TableHeader/TableHeader.styles.cjs +18 -20
  71. package/dist/cjs/Table/TableRow/TableRow.styles.cjs +7 -15
  72. package/dist/cjs/TableSection/TableSection.cjs +1 -1
  73. package/dist/cjs/TableSection/TableSection.styles.cjs +16 -14
  74. package/dist/cjs/Tabs/Tabs.cjs +5 -3
  75. package/dist/cjs/Tag/Tag.cjs +1 -1
  76. package/dist/cjs/TagsInput/TagsInput.cjs +1 -1
  77. package/dist/cjs/TextArea/TextArea.cjs +1 -1
  78. package/dist/cjs/TimePicker/Placeholder.cjs +1 -1
  79. package/dist/cjs/TimePicker/TimePicker.cjs +1 -1
  80. package/dist/cjs/ToggleButton/ToggleButton.cjs +1 -1
  81. package/dist/cjs/Tooltip/Tooltip.cjs +1 -1
  82. package/dist/cjs/TreeView/TreeItem/DefaultContent.cjs +1 -1
  83. package/dist/cjs/TreeView/TreeItem/TreeItem.cjs +1 -1
  84. package/dist/cjs/VerticalNavigation/TreeView/TreeView.cjs +1 -1
  85. package/dist/cjs/VerticalNavigation/VerticalNavigation.cjs +1 -1
  86. package/dist/cjs/utils/helpers.cjs +2 -2
  87. package/dist/esm/Accordion/Accordion.js +6 -6
  88. package/dist/esm/Accordion/Accordion.js.map +1 -1
  89. package/dist/esm/Accordion/Accordion.styles.js.map +1 -1
  90. package/dist/esm/ActionBar/ActionBar.js +4 -3
  91. package/dist/esm/ActionBar/ActionBar.js.map +1 -1
  92. package/dist/esm/ActionBar/ActionBar.styles.js.map +1 -1
  93. package/dist/esm/ActionsGeneric/ActionsGeneric.js +4 -3
  94. package/dist/esm/ActionsGeneric/ActionsGeneric.js.map +1 -1
  95. package/dist/esm/ActionsGeneric/ActionsGeneric.styles.js.map +1 -1
  96. package/dist/esm/AppSwitcher/Action/Action.js.map +1 -1
  97. package/dist/esm/AppSwitcher/Action/Action.styles.js.map +1 -1
  98. package/dist/esm/AppSwitcher/AppSwitcher.js +4 -3
  99. package/dist/esm/AppSwitcher/AppSwitcher.js.map +1 -1
  100. package/dist/esm/AppSwitcher/AppSwitcher.styles.js.map +1 -1
  101. package/dist/esm/Avatar/Avatar.js +1 -1
  102. package/dist/esm/Avatar/Avatar.js.map +1 -1
  103. package/dist/esm/Avatar/Avatar.styles.js.map +1 -1
  104. package/dist/esm/AvatarGroup/AvatarGroup.js +1 -1
  105. package/dist/esm/AvatarGroup/AvatarGroup.js.map +1 -1
  106. package/dist/esm/AvatarGroup/AvatarGroup.styles.js.map +1 -1
  107. package/dist/esm/Badge/Badge.js +1 -1
  108. package/dist/esm/Badge/Badge.js.map +1 -1
  109. package/dist/esm/Badge/Badge.styles.js.map +1 -1
  110. package/dist/esm/Banner/Banner.js +4 -3
  111. package/dist/esm/Banner/Banner.js.map +1 -1
  112. package/dist/esm/Banner/Banner.styles.js.map +1 -1
  113. package/dist/esm/Banner/BannerContent/ActionContainer/ActionContainer.js.map +1 -1
  114. package/dist/esm/Banner/BannerContent/ActionContainer/ActionContainer.styles.js.map +1 -1
  115. package/dist/esm/Banner/BannerContent/BannerContent.js +1 -1
  116. package/dist/esm/Banner/BannerContent/BannerContent.js.map +1 -1
  117. package/dist/esm/Banner/BannerContent/BannerContent.styles.js.map +1 -1
  118. package/dist/esm/Banner/BannerContent/MessageContainer/MessageContainer.js.map +1 -1
  119. package/dist/esm/Banner/BannerContent/MessageContainer/MessageContainer.styles.js.map +1 -1
  120. package/dist/esm/BaseCheckBox/BaseCheckBox.js +1 -1
  121. package/dist/esm/BaseCheckBox/BaseCheckBox.js.map +1 -1
  122. package/dist/esm/BaseCheckBox/BaseCheckBox.styles.js.map +1 -1
  123. package/dist/esm/BaseCheckBox/icons.js.map +1 -1
  124. package/dist/esm/BaseDropdown/BaseDropdown.js +83 -164
  125. package/dist/esm/BaseDropdown/BaseDropdown.js.map +1 -1
  126. package/dist/esm/BaseDropdown/BaseDropdown.styles.js +2 -2
  127. package/dist/esm/BaseDropdown/BaseDropdown.styles.js.map +1 -1
  128. package/dist/esm/BaseDropdown/BaseDropdownPanel.js +80 -0
  129. package/dist/esm/BaseDropdown/BaseDropdownPanel.js.map +1 -0
  130. package/dist/esm/BaseDropdown/{BaseDropdownContext/BaseDropdownContext.js → context.js} +1 -1
  131. package/dist/esm/BaseDropdown/context.js.map +1 -0
  132. package/dist/esm/BaseInput/BaseInput.js +6 -4
  133. package/dist/esm/BaseInput/BaseInput.js.map +1 -1
  134. package/dist/esm/BaseInput/BaseInput.styles.js.map +1 -1
  135. package/dist/esm/BaseInput/validations.js.map +1 -1
  136. package/dist/esm/BaseRadio/BaseRadio.js +1 -1
  137. package/dist/esm/BaseRadio/BaseRadio.js.map +1 -1
  138. package/dist/esm/BaseRadio/BaseRadio.styles.js.map +1 -1
  139. package/dist/esm/BaseRadio/icons.js.map +1 -1
  140. package/dist/esm/BaseSwitch/BaseSwitch.js +1 -1
  141. package/dist/esm/BaseSwitch/BaseSwitch.js.map +1 -1
  142. package/dist/esm/BaseSwitch/BaseSwitch.styles.js.map +1 -1
  143. package/dist/esm/BreadCrumb/BreadCrumb.js +4 -4
  144. package/dist/esm/BreadCrumb/BreadCrumb.js.map +1 -1
  145. package/dist/esm/BreadCrumb/BreadCrumb.styles.js.map +1 -1
  146. package/dist/esm/BreadCrumb/Page/Page.js.map +1 -1
  147. package/dist/esm/BreadCrumb/Page/Page.styles.js.map +1 -1
  148. package/dist/esm/BreadCrumb/PathElement/PathElement.js.map +1 -1
  149. package/dist/esm/BreadCrumb/PathElement/PathElement.styles.js.map +1 -1
  150. package/dist/esm/BreadCrumb/utils.js.map +1 -1
  151. package/dist/esm/BulkActions/BulkActions.js +4 -2
  152. package/dist/esm/BulkActions/BulkActions.js.map +1 -1
  153. package/dist/esm/BulkActions/BulkActions.styles.js +1 -3
  154. package/dist/esm/BulkActions/BulkActions.styles.js.map +1 -1
  155. package/dist/esm/Button/Button.js.map +1 -1
  156. package/dist/esm/Button/Button.styles.js +6 -2
  157. package/dist/esm/Button/Button.styles.js.map +1 -1
  158. package/dist/esm/ButtonBase/ButtonBase.js.map +1 -1
  159. package/dist/esm/ButtonBase/ButtonBase.styles.js.map +1 -1
  160. package/dist/esm/Calendar/Calendar.js.map +1 -1
  161. package/dist/esm/Calendar/Calendar.styles.js.map +1 -1
  162. package/dist/esm/Calendar/CalendarHeader/CalendarHeader.js.map +1 -1
  163. package/dist/esm/Calendar/CalendarHeader/CalendarHeader.styles.js.map +1 -1
  164. package/dist/esm/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.js.map +1 -1
  165. package/dist/esm/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.js.map +1 -1
  166. package/dist/esm/Calendar/CalendarNavigation/MonthSelector/MonthSelector.js.map +1 -1
  167. package/dist/esm/Calendar/CalendarNavigation/MonthSelector/MonthSelector.styles.js.map +1 -1
  168. package/dist/esm/Calendar/CalendarNavigation/Navigation/Navigation.js.map +1 -1
  169. package/dist/esm/Calendar/CalendarNavigation/Navigation/Navigation.styles.js.map +1 -1
  170. package/dist/esm/Calendar/SingleCalendar/CalendarCell.js.map +1 -1
  171. package/dist/esm/Calendar/SingleCalendar/CalendarCell.styles.js.map +1 -1
  172. package/dist/esm/Calendar/SingleCalendar/SingleCalendar.js.map +1 -1
  173. package/dist/esm/Calendar/SingleCalendar/SingleCalendar.styles.js.map +1 -1
  174. package/dist/esm/Calendar/model.js.map +1 -1
  175. package/dist/esm/Calendar/utils.js.map +1 -1
  176. package/dist/esm/Card/Card.js +3 -2
  177. package/dist/esm/Card/Card.js.map +1 -1
  178. package/dist/esm/Card/Card.styles.js.map +1 -1
  179. package/dist/esm/Card/Content/Content.js.map +1 -1
  180. package/dist/esm/Card/Content/Content.styles.js.map +1 -1
  181. package/dist/esm/Card/Header/Header.js.map +1 -1
  182. package/dist/esm/Card/Header/Header.styles.js.map +1 -1
  183. package/dist/esm/Card/Media/Media.js.map +1 -1
  184. package/dist/esm/Card/Media/Media.styles.js.map +1 -1
  185. package/dist/esm/Carousel/Carousel.js +4 -3
  186. package/dist/esm/Carousel/Carousel.js.map +1 -1
  187. package/dist/esm/Carousel/Carousel.styles.js.map +1 -1
  188. package/dist/esm/Carousel/CarouselControls.js.map +1 -1
  189. package/dist/esm/Carousel/CarouselSlide/CarouselSlide.js.map +1 -1
  190. package/dist/esm/Carousel/CarouselSlide/CarouselSlide.styles.js.map +1 -1
  191. package/dist/esm/Carousel/CarouselThumbnails.js +1 -1
  192. package/dist/esm/Carousel/CarouselThumbnails.js.map +1 -1
  193. package/dist/esm/CheckBox/CheckBox.js +1 -1
  194. package/dist/esm/CheckBox/CheckBox.js.map +1 -1
  195. package/dist/esm/CheckBox/CheckBox.styles.js.map +1 -1
  196. package/dist/esm/CheckBoxGroup/CheckBoxGroup.js +1 -1
  197. package/dist/esm/CheckBoxGroup/CheckBoxGroup.js.map +1 -1
  198. package/dist/esm/CheckBoxGroup/CheckBoxGroup.styles.js.map +1 -1
  199. package/dist/esm/ColorPicker/ColorPicker.js +1 -1
  200. package/dist/esm/ColorPicker/ColorPicker.js.map +1 -1
  201. package/dist/esm/ColorPicker/ColorPicker.styles.js.map +1 -1
  202. package/dist/esm/ColorPicker/Fields/Fields.js.map +1 -1
  203. package/dist/esm/ColorPicker/Fields/Fields.styles.js.map +1 -1
  204. package/dist/esm/ColorPicker/Picker/Picker.js.map +1 -1
  205. package/dist/esm/ColorPicker/Picker/Picker.styles.js.map +1 -1
  206. package/dist/esm/ColorPicker/PresetColors/PresetColors.js.map +1 -1
  207. package/dist/esm/ColorPicker/PresetColors/PresetColors.styles.js.map +1 -1
  208. package/dist/esm/ColorPicker/SavedColors/SavedColors.js.map +1 -1
  209. package/dist/esm/ColorPicker/SavedColors/SavedColors.styles.js.map +1 -1
  210. package/dist/esm/Container/Container.js +1 -1
  211. package/dist/esm/Container/Container.js.map +1 -1
  212. package/dist/esm/Container/Container.styles.js.map +1 -1
  213. package/dist/esm/Controls/Controls.js.map +1 -1
  214. package/dist/esm/Controls/Controls.styles.js.map +1 -1
  215. package/dist/esm/Controls/LeftControl/LeftControl.js.map +1 -1
  216. package/dist/esm/Controls/RightControl/RightControl.js.map +1 -1
  217. package/dist/esm/Controls/context/ControlsContext.js.map +1 -1
  218. package/dist/esm/DatePicker/DatePicker.js +1 -1
  219. package/dist/esm/DatePicker/DatePicker.js.map +1 -1
  220. package/dist/esm/DatePicker/DatePicker.styles.js.map +1 -1
  221. package/dist/esm/DatePicker/useVisibleDate.js.map +1 -1
  222. package/dist/esm/DatePicker/utils.js.map +1 -1
  223. package/dist/esm/Dialog/Actions/Actions.js.map +1 -1
  224. package/dist/esm/Dialog/Actions/Actions.styles.js.map +1 -1
  225. package/dist/esm/Dialog/Content/Content.js.map +1 -1
  226. package/dist/esm/Dialog/Content/Content.styles.js.map +1 -1
  227. package/dist/esm/Dialog/Dialog.js.map +1 -1
  228. package/dist/esm/Dialog/Dialog.styles.js.map +1 -1
  229. package/dist/esm/Dialog/Title/Title.js.map +1 -1
  230. package/dist/esm/Dialog/Title/Title.styles.js.map +1 -1
  231. package/dist/esm/Dialog/context.js.map +1 -1
  232. package/dist/esm/DotPagination/DotPagination.js.map +1 -1
  233. package/dist/esm/DotPagination/DotPagination.styles.js.map +1 -1
  234. package/dist/esm/Drawer/Drawer.js +4 -2
  235. package/dist/esm/Drawer/Drawer.js.map +1 -1
  236. package/dist/esm/Drawer/Drawer.styles.js.map +1 -1
  237. package/dist/esm/DropDownMenu/DropDownMenu.js +23 -29
  238. package/dist/esm/DropDownMenu/DropDownMenu.js.map +1 -1
  239. package/dist/esm/DropDownMenu/DropDownMenu.styles.js +15 -2
  240. package/dist/esm/DropDownMenu/DropDownMenu.styles.js.map +1 -1
  241. package/dist/esm/Dropdown/Dropdown.js.map +1 -1
  242. package/dist/esm/Dropdown/Dropdown.styles.js.map +1 -1
  243. package/dist/esm/Dropdown/List/List.js +6 -5
  244. package/dist/esm/Dropdown/List/List.js.map +1 -1
  245. package/dist/esm/Dropdown/List/List.styles.js.map +1 -1
  246. package/dist/esm/Dropdown/utils.js.map +1 -1
  247. package/dist/esm/DropdownButton/DropdownButton.js +1 -1
  248. package/dist/esm/DropdownButton/DropdownButton.js.map +1 -1
  249. package/dist/esm/DropdownButton/DropdownButton.styles.js.map +1 -1
  250. package/dist/esm/EmptyState/EmptyState.js +4 -3
  251. package/dist/esm/EmptyState/EmptyState.js.map +1 -1
  252. package/dist/esm/EmptyState/EmptyState.styles.js.map +1 -1
  253. package/dist/esm/FileUploader/DropZone/DropZone.js.map +1 -1
  254. package/dist/esm/FileUploader/DropZone/DropZone.styles.js.map +1 -1
  255. package/dist/esm/FileUploader/File/File.js.map +1 -1
  256. package/dist/esm/FileUploader/File/File.styles.js.map +1 -1
  257. package/dist/esm/FileUploader/FileList/FileList.js.map +1 -1
  258. package/dist/esm/FileUploader/FileList/FileList.styles.js.map +1 -1
  259. package/dist/esm/FileUploader/FileUploader.js.map +1 -1
  260. package/dist/esm/FileUploader/Preview/Preview.js.map +1 -1
  261. package/dist/esm/FileUploader/Preview/Preview.styles.js.map +1 -1
  262. package/dist/esm/FileUploader/utils.js.map +1 -1
  263. package/dist/esm/FilterGroup/Counter/Counter.js.map +1 -1
  264. package/dist/esm/FilterGroup/Counter/Counter.styles.js.map +1 -1
  265. package/dist/esm/FilterGroup/FilterContent/FilterContent.js +1 -1
  266. package/dist/esm/FilterGroup/FilterContent/FilterContent.js.map +1 -1
  267. package/dist/esm/FilterGroup/FilterContent/FilterContent.styles.js.map +1 -1
  268. package/dist/esm/FilterGroup/FilterGroup.js +1 -1
  269. package/dist/esm/FilterGroup/FilterGroup.js.map +1 -1
  270. package/dist/esm/FilterGroup/FilterGroup.styles.js.map +1 -1
  271. package/dist/esm/FilterGroup/FilterGroupContext.js.map +1 -1
  272. package/dist/esm/FilterGroup/LeftPanel/LeftPanel.js.map +1 -1
  273. package/dist/esm/FilterGroup/LeftPanel/LeftPanel.styles.js.map +1 -1
  274. package/dist/esm/FilterGroup/RightPanel/RightPanel.js.map +1 -1
  275. package/dist/esm/FilterGroup/RightPanel/RightPanel.styles.js.map +1 -1
  276. package/dist/esm/Focus/Focus.js.map +1 -1
  277. package/dist/esm/Focus/Focus.styles.js.map +1 -1
  278. package/dist/esm/Focus/utils.js.map +1 -1
  279. package/dist/esm/Footer/Footer.js +4 -2
  280. package/dist/esm/Footer/Footer.js.map +1 -1
  281. package/dist/esm/Footer/Footer.styles.js.map +1 -1
  282. package/dist/esm/Forms/Adornment/Adornment.js.map +1 -1
  283. package/dist/esm/Forms/Adornment/Adornment.styles.js.map +1 -1
  284. package/dist/esm/Forms/CharCounter/CharCounter.js.map +1 -1
  285. package/dist/esm/Forms/FormElement/FormElement.js.map +1 -1
  286. package/dist/esm/Forms/FormElement/FormElement.styles.js.map +1 -1
  287. package/dist/esm/Forms/FormElement/context/FormElementContext.js.map +1 -1
  288. package/dist/esm/Forms/FormElement/context/FormElementDescriptorsContext.js.map +1 -1
  289. package/dist/esm/Forms/FormElement/utils/FormUtils.js.map +1 -1
  290. package/dist/esm/Forms/InfoMessage/InfoMessage.js.map +1 -1
  291. package/dist/esm/Forms/Label/Label.js.map +1 -1
  292. package/dist/esm/Forms/Suggestions/Suggestions.js.map +1 -1
  293. package/dist/esm/Forms/Suggestions/Suggestions.styles.js.map +1 -1
  294. package/dist/esm/Forms/WarningText/WarningText.js.map +1 -1
  295. package/dist/esm/GlobalActions/GlobalActions.js +4 -2
  296. package/dist/esm/GlobalActions/GlobalActions.js.map +1 -1
  297. package/dist/esm/GlobalActions/GlobalActions.styles.js.map +1 -1
  298. package/dist/esm/Grid/Grid.js +1 -1
  299. package/dist/esm/Grid/Grid.js.map +1 -1
  300. package/dist/esm/Grid/Grid.styles.js.map +1 -1
  301. package/dist/esm/Header/Actions/Actions.js +1 -1
  302. package/dist/esm/Header/Actions/Actions.js.map +1 -1
  303. package/dist/esm/Header/Actions/Actions.styles.js.map +1 -1
  304. package/dist/esm/Header/Brand/Brand.js +1 -1
  305. package/dist/esm/Header/Brand/Brand.js.map +1 -1
  306. package/dist/esm/Header/Brand/Brand.styles.js.map +1 -1
  307. package/dist/esm/Header/Header.js +4 -2
  308. package/dist/esm/Header/Header.js.map +1 -1
  309. package/dist/esm/Header/Header.styles.js.map +1 -1
  310. package/dist/esm/Header/Navigation/MenuBar/Bar.js.map +1 -1
  311. package/dist/esm/Header/Navigation/MenuBar/Bar.styles.js.map +1 -1
  312. package/dist/esm/Header/Navigation/MenuBar/MenuBar.js.map +1 -1
  313. package/dist/esm/Header/Navigation/MenuItem/MenuItem.js.map +1 -1
  314. package/dist/esm/Header/Navigation/MenuItem/MenuItem.styles.js.map +1 -1
  315. package/dist/esm/Header/Navigation/Navigation.js +1 -1
  316. package/dist/esm/Header/Navigation/Navigation.js.map +1 -1
  317. package/dist/esm/Header/Navigation/Navigation.styles.js.map +1 -1
  318. package/dist/esm/Header/Navigation/useSelectionPath.js.map +1 -1
  319. package/dist/esm/Header/Navigation/utils/FocusContext.js.map +1 -1
  320. package/dist/esm/IconButton/IconButton.js.map +1 -1
  321. package/dist/esm/InlineEditor/InlineEditor.js.map +1 -1
  322. package/dist/esm/InlineEditor/InlineEditor.styles.js.map +1 -1
  323. package/dist/esm/Input/Input.js +1 -1
  324. package/dist/esm/Input/Input.js.map +1 -1
  325. package/dist/esm/Input/Input.styles.js.map +1 -1
  326. package/dist/esm/Kpi/Kpi.js.map +1 -1
  327. package/dist/esm/Link/Link.js.map +1 -1
  328. package/dist/esm/Link/Link.styles.js.map +1 -1
  329. package/dist/esm/List/List.js.map +1 -1
  330. package/dist/esm/List/List.styles.js.map +1 -1
  331. package/dist/esm/List/utils.js.map +1 -1
  332. package/dist/esm/ListContainer/ListContainer.js +1 -1
  333. package/dist/esm/ListContainer/ListContainer.js.map +1 -1
  334. package/dist/esm/ListContainer/ListContainer.styles.js.map +1 -1
  335. package/dist/esm/ListContainer/ListContext/ListContext.js.map +1 -1
  336. package/dist/esm/ListContainer/ListItem/ListItem.js +1 -1
  337. package/dist/esm/ListContainer/ListItem/ListItem.js.map +1 -1
  338. package/dist/esm/ListContainer/ListItem/ListItem.styles.js.map +1 -1
  339. package/dist/esm/Loading/Loading.js +4 -2
  340. package/dist/esm/Loading/Loading.js.map +1 -1
  341. package/dist/esm/Loading/Loading.styles.js.map +1 -1
  342. package/dist/esm/LoadingContainer/LoadingContainer.js +4 -3
  343. package/dist/esm/LoadingContainer/LoadingContainer.js.map +1 -1
  344. package/dist/esm/LoadingContainer/LoadingContainer.styles.js.map +1 -1
  345. package/dist/esm/Login/Login.js +4 -4
  346. package/dist/esm/Login/Login.js.map +1 -1
  347. package/dist/esm/Login/Login.styles.js.map +1 -1
  348. package/dist/esm/MultiButton/MultiButton.js +3 -4
  349. package/dist/esm/MultiButton/MultiButton.js.map +1 -1
  350. package/dist/esm/MultiButton/MultiButton.styles.js +48 -109
  351. package/dist/esm/MultiButton/MultiButton.styles.js.map +1 -1
  352. package/dist/esm/OverflowTooltip/OverflowTooltip.js.map +1 -1
  353. package/dist/esm/OverflowTooltip/OverflowTooltip.styles.js.map +1 -1
  354. package/dist/esm/Pagination/Pagination.js +4 -4
  355. package/dist/esm/Pagination/Pagination.js.map +1 -1
  356. package/dist/esm/Pagination/Pagination.styles.js +1 -1
  357. package/dist/esm/Pagination/Pagination.styles.js.map +1 -1
  358. package/dist/esm/Pagination/Select.js.map +1 -1
  359. package/dist/esm/Pagination/Select.styles.js.map +1 -1
  360. package/dist/esm/Panel/Panel.js +1 -1
  361. package/dist/esm/Panel/Panel.js.map +1 -1
  362. package/dist/esm/Panel/Panel.styles.js +2 -1
  363. package/dist/esm/Panel/Panel.styles.js.map +1 -1
  364. package/dist/esm/ProgressBar/ProgressBar.js.map +1 -1
  365. package/dist/esm/ProgressBar/ProgressBar.styles.js.map +1 -1
  366. package/dist/esm/QueryBuilder/ConfirmationDialog/ConfirmationDialog.js.map +1 -1
  367. package/dist/esm/QueryBuilder/ConfirmationDialog/ConfirmationDialog.styles.js.map +1 -1
  368. package/dist/esm/QueryBuilder/Context.js.map +1 -1
  369. package/dist/esm/QueryBuilder/QueryBuilder.js.map +1 -1
  370. package/dist/esm/QueryBuilder/QueryBuilder.styles.js.map +1 -1
  371. package/dist/esm/QueryBuilder/Rule/Attribute/Attribute.js.map +1 -1
  372. package/dist/esm/QueryBuilder/Rule/Operator/Operator.js.map +1 -1
  373. package/dist/esm/QueryBuilder/Rule/Rule.js.map +1 -1
  374. package/dist/esm/QueryBuilder/Rule/Rule.styles.js.map +1 -1
  375. package/dist/esm/QueryBuilder/Rule/Value/BooleanValue/BooleanValue.js.map +1 -1
  376. package/dist/esm/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.js.map +1 -1
  377. package/dist/esm/QueryBuilder/Rule/Value/DateTimeValue/DateTimeValue.styles.js.map +1 -1
  378. package/dist/esm/QueryBuilder/Rule/Value/DateTimeValue/utils.js.map +1 -1
  379. package/dist/esm/QueryBuilder/Rule/Value/EmptyValue/EmptyValue.js.map +1 -1
  380. package/dist/esm/QueryBuilder/Rule/Value/NumericValue/Numeric.styles.js.map +1 -1
  381. package/dist/esm/QueryBuilder/Rule/Value/NumericValue/NumericValue.js.map +1 -1
  382. package/dist/esm/QueryBuilder/Rule/Value/TextValue/TextValue.js.map +1 -1
  383. package/dist/esm/QueryBuilder/Rule/Value/TextValue/TextValue.styles.js.map +1 -1
  384. package/dist/esm/QueryBuilder/Rule/Value/Value.js.map +1 -1
  385. package/dist/esm/QueryBuilder/RuleGroup/RuleGroup.js.map +1 -1
  386. package/dist/esm/QueryBuilder/utils/index.js.map +1 -1
  387. package/dist/esm/QueryBuilder/utils/reducer.js.map +1 -1
  388. package/dist/esm/Radio/Radio.js +1 -1
  389. package/dist/esm/Radio/Radio.js.map +1 -1
  390. package/dist/esm/Radio/Radio.styles.js.map +1 -1
  391. package/dist/esm/RadioGroup/RadioGroup.js +1 -1
  392. package/dist/esm/RadioGroup/RadioGroup.js.map +1 -1
  393. package/dist/esm/RadioGroup/RadioGroup.styles.js.map +1 -1
  394. package/dist/esm/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.js.map +1 -1
  395. package/dist/esm/ScrollTo/Horizontal/HorizontalScrollListItem/HorizontalScrollListItem.styles.js.map +1 -1
  396. package/dist/esm/ScrollTo/Horizontal/ScrollToHorizontal.js.map +1 -1
  397. package/dist/esm/ScrollTo/Horizontal/ScrollToHorizontal.styles.js.map +1 -1
  398. package/dist/esm/ScrollTo/Vertical/ScrollToVertical.js.map +1 -1
  399. package/dist/esm/ScrollTo/Vertical/ScrollToVertical.styles.js.map +1 -1
  400. package/dist/esm/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.js.map +1 -1
  401. package/dist/esm/ScrollTo/Vertical/VerticalScrollListItem/VerticalScrollListItem.styles.js.map +1 -1
  402. package/dist/esm/ScrollTo/useScrollTo.js.map +1 -1
  403. package/dist/esm/ScrollTo/utils.js.map +1 -1
  404. package/dist/esm/Section/Section.js +26 -31
  405. package/dist/esm/Section/Section.js.map +1 -1
  406. package/dist/esm/Section/Section.styles.js +12 -8
  407. package/dist/esm/Section/Section.styles.js.map +1 -1
  408. package/dist/esm/Select/Option.js.map +1 -1
  409. package/dist/esm/Select/OptionGroup.js +1 -1
  410. package/dist/esm/Select/OptionGroup.js.map +1 -1
  411. package/dist/esm/Select/Select.js.map +1 -1
  412. package/dist/esm/Select/Select.styles.js.map +1 -1
  413. package/dist/esm/SelectionList/SelectionList.js +1 -1
  414. package/dist/esm/SelectionList/SelectionList.js.map +1 -1
  415. package/dist/esm/SelectionList/SelectionList.styles.js.map +1 -1
  416. package/dist/esm/SimpleGrid/SimpleGrid.js.map +1 -1
  417. package/dist/esm/SimpleGrid/SimpleGrid.styles.js.map +1 -1
  418. package/dist/esm/Skeleton/Skeleton.js.map +1 -1
  419. package/dist/esm/Skeleton/Skeleton.styles.js.map +1 -1
  420. package/dist/esm/Slider/Slider.js.map +1 -1
  421. package/dist/esm/Slider/Slider.styles.js.map +1 -1
  422. package/dist/esm/Slider/SliderInput/SliderInput.js.map +1 -1
  423. package/dist/esm/Slider/base.js.map +1 -1
  424. package/dist/esm/Slider/utils.js.map +1 -1
  425. package/dist/esm/Snackbar/Snackbar.js +28 -25
  426. package/dist/esm/Snackbar/Snackbar.js.map +1 -1
  427. package/dist/esm/Snackbar/Snackbar.styles.js.map +1 -1
  428. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.js.map +1 -1
  429. package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.styles.js.map +1 -1
  430. package/dist/esm/SnackbarProvider/SnackbarProvider.js.map +1 -1
  431. package/dist/esm/SnackbarProvider/SnackbarProvider.styles.js.map +1 -1
  432. package/dist/esm/Stack/Stack.js.map +1 -1
  433. package/dist/esm/Stack/Stack.styles.js.map +1 -1
  434. package/dist/esm/Switch/Switch.js +1 -1
  435. package/dist/esm/Switch/Switch.js.map +1 -1
  436. package/dist/esm/Switch/Switch.styles.js.map +1 -1
  437. package/dist/esm/Tab/Tab.js +4 -2
  438. package/dist/esm/Tab/Tab.js.map +1 -1
  439. package/dist/esm/Tab/Tab.styles.js.map +1 -1
  440. package/dist/esm/Table/Table.js +1 -1
  441. package/dist/esm/Table/Table.js.map +1 -1
  442. package/dist/esm/Table/Table.styles.js.map +1 -1
  443. package/dist/esm/Table/TableBody/TableBody.js.map +1 -1
  444. package/dist/esm/Table/TableCell/TableCell.js +2 -2
  445. package/dist/esm/Table/TableCell/TableCell.js.map +1 -1
  446. package/dist/esm/Table/TableCell/TableCell.styles.js +2 -5
  447. package/dist/esm/Table/TableCell/TableCell.styles.js.map +1 -1
  448. package/dist/esm/Table/TableContainer/TableContainer.js.map +1 -1
  449. package/dist/esm/Table/TableContainer/TableContainer.styles.js.map +1 -1
  450. package/dist/esm/Table/TableHead/TableHead.js.map +1 -1
  451. package/dist/esm/Table/TableHeader/TableHeader.js +47 -54
  452. package/dist/esm/Table/TableHeader/TableHeader.js.map +1 -1
  453. package/dist/esm/Table/TableHeader/TableHeader.styles.js +18 -20
  454. package/dist/esm/Table/TableHeader/TableHeader.styles.js.map +1 -1
  455. package/dist/esm/Table/TableHeader/utils.js.map +1 -1
  456. package/dist/esm/Table/TableRow/TableRow.js.map +1 -1
  457. package/dist/esm/Table/TableRow/TableRow.styles.js +7 -15
  458. package/dist/esm/Table/TableRow/TableRow.styles.js.map +1 -1
  459. package/dist/esm/Table/hooks/useBulkActions.js.map +1 -1
  460. package/dist/esm/Table/hooks/useFilters.js.map +1 -1
  461. package/dist/esm/Table/hooks/useGlobalFilter.js.map +1 -1
  462. package/dist/esm/Table/hooks/useHeaderGroups.js.map +1 -1
  463. package/dist/esm/Table/hooks/usePagination.js.map +1 -1
  464. package/dist/esm/Table/hooks/useResizeColumns.js.map +1 -1
  465. package/dist/esm/Table/hooks/useRowExpand.js.map +1 -1
  466. package/dist/esm/Table/hooks/useRowSelection.js.map +1 -1
  467. package/dist/esm/Table/hooks/useRowState.js.map +1 -1
  468. package/dist/esm/Table/hooks/useSortBy.js.map +1 -1
  469. package/dist/esm/Table/hooks/useSticky.js.map +1 -1
  470. package/dist/esm/Table/hooks/useTable.js.map +1 -1
  471. package/dist/esm/Table/hooks/useTableStyles.js.map +1 -1
  472. package/dist/esm/Table/renderers/DateColumnCell/DateColumnCell.js.map +1 -1
  473. package/dist/esm/Table/renderers/ProgressColumnCell/ProgressColumnCell.js.map +1 -1
  474. package/dist/esm/Table/renderers/ProgressColumnCell/ProgressColumnCell.styles.js.map +1 -1
  475. package/dist/esm/Table/renderers/SwitchColumnCell/SwitchColumnCell.js.map +1 -1
  476. package/dist/esm/Table/renderers/SwitchColumnCell/SwitchColumnCell.styles.js.map +1 -1
  477. package/dist/esm/Table/renderers/renderers.js.map +1 -1
  478. package/dist/esm/Table/utils/fallbacks.js.map +1 -1
  479. package/dist/esm/Table/utils/utils.js.map +1 -1
  480. package/dist/esm/TableSection/TableSection.js +1 -1
  481. package/dist/esm/TableSection/TableSection.js.map +1 -1
  482. package/dist/esm/TableSection/TableSection.styles.js +16 -14
  483. package/dist/esm/TableSection/TableSection.styles.js.map +1 -1
  484. package/dist/esm/Tabs/Tabs.js +5 -3
  485. package/dist/esm/Tabs/Tabs.js.map +1 -1
  486. package/dist/esm/Tabs/Tabs.styles.js.map +1 -1
  487. package/dist/esm/Tag/Tag.js +1 -1
  488. package/dist/esm/Tag/Tag.js.map +1 -1
  489. package/dist/esm/Tag/Tag.styles.js.map +1 -1
  490. package/dist/esm/TagsInput/TagsInput.js +1 -1
  491. package/dist/esm/TagsInput/TagsInput.js.map +1 -1
  492. package/dist/esm/TagsInput/TagsInput.styles.js.map +1 -1
  493. package/dist/esm/TextArea/TextArea.js +1 -1
  494. package/dist/esm/TextArea/TextArea.js.map +1 -1
  495. package/dist/esm/TimeAgo/TimeAgo.js.map +1 -1
  496. package/dist/esm/TimeAgo/TimeAgo.styles.js.map +1 -1
  497. package/dist/esm/TimeAgo/formatUtils.js.map +1 -1
  498. package/dist/esm/TimeAgo/useTimeAgo.js.map +1 -1
  499. package/dist/esm/TimePicker/Placeholder.js +1 -1
  500. package/dist/esm/TimePicker/Placeholder.js.map +1 -1
  501. package/dist/esm/TimePicker/TimePicker.js +1 -1
  502. package/dist/esm/TimePicker/TimePicker.js.map +1 -1
  503. package/dist/esm/TimePicker/TimePicker.styles.js.map +1 -1
  504. package/dist/esm/TimePicker/Unit/Unit.js.map +1 -1
  505. package/dist/esm/TimePicker/Unit/Unit.styles.js.map +1 -1
  506. package/dist/esm/ToggleButton/ToggleButton.js +1 -1
  507. package/dist/esm/ToggleButton/ToggleButton.js.map +1 -1
  508. package/dist/esm/Tooltip/Tooltip.js +1 -1
  509. package/dist/esm/Tooltip/Tooltip.js.map +1 -1
  510. package/dist/esm/Tooltip/Tooltip.styles.js.map +1 -1
  511. package/dist/esm/TreeView/TreeItem/DefaultContent.js +1 -1
  512. package/dist/esm/TreeView/TreeItem/DefaultContent.js.map +1 -1
  513. package/dist/esm/TreeView/TreeItem/TreeItem.js +1 -1
  514. package/dist/esm/TreeView/TreeItem/TreeItem.js.map +1 -1
  515. package/dist/esm/TreeView/TreeItem/TreeItem.styles.js.map +1 -1
  516. package/dist/esm/TreeView/TreeItem/useHvTreeItem.js.map +1 -1
  517. package/dist/esm/TreeView/TreeView.js.map +1 -1
  518. package/dist/esm/TreeView/TreeView.styles.js.map +1 -1
  519. package/dist/esm/TreeView/internals/DescendantProvider.js.map +1 -1
  520. package/dist/esm/TreeView/internals/TreeViewProvider.js.map +1 -1
  521. package/dist/esm/TreeView/internals/hooks/plugins/useTreeViewContextValueBuilder.js.map +1 -1
  522. package/dist/esm/TreeView/internals/hooks/plugins/useTreeViewExpansion.js.map +1 -1
  523. package/dist/esm/TreeView/internals/hooks/plugins/useTreeViewFocus.js.map +1 -1
  524. package/dist/esm/TreeView/internals/hooks/plugins/useTreeViewKeyboardNavigation.js.map +1 -1
  525. package/dist/esm/TreeView/internals/hooks/plugins/useTreeViewNodes.js.map +1 -1
  526. package/dist/esm/TreeView/internals/hooks/plugins/useTreeViewSelection.js.map +1 -1
  527. package/dist/esm/TreeView/internals/hooks/useInstanceEventHandler.js.map +1 -1
  528. package/dist/esm/TreeView/internals/hooks/useTreeView.js.map +1 -1
  529. package/dist/esm/TreeView/internals/hooks/useTreeViewInstanceEvents.js.map +1 -1
  530. package/dist/esm/TreeView/internals/hooks/useTreeViewModels.js.map +1 -1
  531. package/dist/esm/TreeView/internals/hooks/utils.js.map +1 -1
  532. package/dist/esm/TreeView/internals/utils/EventManager.js.map +1 -1
  533. package/dist/esm/TreeView/internals/utils/FinalizationRegistryBasedCleanupTracking.js.map +1 -1
  534. package/dist/esm/TreeView/internals/utils/TimerBasedCleanupTracking.js.map +1 -1
  535. package/dist/esm/Typography/Typography.js.map +1 -1
  536. package/dist/esm/Typography/Typography.styles.js.map +1 -1
  537. package/dist/esm/VerticalNavigation/Actions/Action.js.map +1 -1
  538. package/dist/esm/VerticalNavigation/Actions/Action.styles.js.map +1 -1
  539. package/dist/esm/VerticalNavigation/Actions/Actions.js.map +1 -1
  540. package/dist/esm/VerticalNavigation/Actions/Actions.styles.js.map +1 -1
  541. package/dist/esm/VerticalNavigation/Header/Header.js.map +1 -1
  542. package/dist/esm/VerticalNavigation/Header/Header.styles.js.map +1 -1
  543. package/dist/esm/VerticalNavigation/Navigation/Navigation.js.map +1 -1
  544. package/dist/esm/VerticalNavigation/Navigation/Navigation.styles.js.map +1 -1
  545. package/dist/esm/VerticalNavigation/NavigationPopup/NavigationPopup.styles.js.map +1 -1
  546. package/dist/esm/VerticalNavigation/NavigationPopup/NavigationPopupContainer.js.map +1 -1
  547. package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.js.map +1 -1
  548. package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js.map +1 -1
  549. package/dist/esm/VerticalNavigation/NavigationSlider/utils.js.map +1 -1
  550. package/dist/esm/VerticalNavigation/TreeView/TreeView.js +1 -1
  551. package/dist/esm/VerticalNavigation/TreeView/TreeView.js.map +1 -1
  552. package/dist/esm/VerticalNavigation/TreeView/TreeView.styles.js.map +1 -1
  553. package/dist/esm/VerticalNavigation/TreeView/TreeViewContext.js.map +1 -1
  554. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
  555. package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js.map +1 -1
  556. package/dist/esm/VerticalNavigation/VerticalNavigation.js +1 -1
  557. package/dist/esm/VerticalNavigation/VerticalNavigation.js.map +1 -1
  558. package/dist/esm/VerticalNavigation/VerticalNavigation.styles.js.map +1 -1
  559. package/dist/esm/VerticalNavigation/VerticalNavigationContext.js.map +1 -1
  560. package/dist/esm/hocs/withTooltip.js.map +1 -1
  561. package/dist/esm/hooks/useClickOutside.js.map +1 -1
  562. package/dist/esm/hooks/useComputation.js.map +1 -1
  563. package/dist/esm/hooks/useControlled.js.map +1 -1
  564. package/dist/esm/hooks/useExpandable.js.map +1 -1
  565. package/dist/esm/hooks/useForkRef.js.map +1 -1
  566. package/dist/esm/hooks/useImageLoaded.js.map +1 -1
  567. package/dist/esm/hooks/useIsMounted.js.map +1 -1
  568. package/dist/esm/hooks/useUniqueId.js.map +1 -1
  569. package/dist/esm/hooks/useWidth.js.map +1 -1
  570. package/dist/esm/providers/Provider.js.map +1 -1
  571. package/dist/esm/providers/ThemeProvider.js.map +1 -1
  572. package/dist/esm/utils/Random.js.map +1 -1
  573. package/dist/esm/utils/browser.js.map +1 -1
  574. package/dist/esm/utils/deepMerge.js.map +1 -1
  575. package/dist/esm/utils/document.js.map +1 -1
  576. package/dist/esm/utils/focusableElementFinder.js.map +1 -1
  577. package/dist/esm/utils/helpers.js +2 -2
  578. package/dist/esm/utils/helpers.js.map +1 -1
  579. package/dist/esm/utils/iconVariant.js.map +1 -1
  580. package/dist/esm/utils/multiSelectionEventHandler.js.map +1 -1
  581. package/dist/esm/utils/sizes.js.map +1 -1
  582. package/dist/esm/utils/theme.js.map +1 -1
  583. package/dist/esm/utils/useSavedState.js.map +1 -1
  584. package/dist/esm/utils/wrapperTooltip.js.map +1 -1
  585. package/dist/types/index.d.ts +44 -42
  586. package/package.json +6 -6
  587. package/dist/esm/BaseDropdown/BaseDropdownContext/BaseDropdownContext.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../src/Button/Button.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport {\n mergeStyles,\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport {\n getColor,\n HvColorAny,\n HvRadius,\n HvSize,\n theme,\n} from \"@hitachivantara/uikit-styles\";\n\nimport {\n fixedForwardRef,\n PolymorphicComponentRef,\n PolymorphicRef,\n} from \"../types/generic\";\nimport {\n getIconSizeStyles,\n getOverrideColors,\n getSizeStyles,\n staticClasses,\n useClasses,\n} from \"./Button.styles\";\nimport { HvButtonVariant } from \"./types\";\n\ntype Variant = \"contained\" | \"subtle\" | \"ghost\";\n\nexport { staticClasses as buttonClasses };\n\nexport type HvButtonClasses = ExtractNames<typeof useClasses>;\n\nexport type HvButtonProps<C extends React.ElementType = \"button\"> =\n PolymorphicComponentRef<\n C,\n {\n /** Use the variant prop to change the visual style of the button. */\n variant?: HvButtonVariant;\n /** Whether the button is an icon-only button. */\n icon?: boolean;\n /** Whether the button is disabled or not. */\n disabled?: boolean;\n /** Class names to be applied. */\n className?: string;\n /** Element placed before the children. */\n startIcon?: React.ReactNode;\n /** Element placed after the children. */\n endIcon?: React.ReactNode;\n /** Color of the button. */\n color?: HvColorAny;\n /** Button size. */\n size?: HvSize;\n /** Button border radius. */\n radius?: HvRadius;\n /** Defines the default colors of the button are forced into the icon. */\n overrideIconColors?: boolean;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvButtonClasses;\n /** Whether the button is selected or not. */\n selected?: boolean;\n /**\n * Whether the button is focusable when disabled.\n * Without this property, the accessibility of the button decreases when disabled since it's not read by screen readers.\n * Set this property to `true` when you need the button to still be focusable when disabled for accessibility purposes.\n */\n focusableWhenDisabled?: boolean;\n }\n >;\n\nfunction parseVariant(variant: HvButtonVariant): [HvColorAny, Variant] {\n const deprecatedVariantMap: Record<string, HvButtonVariant> = {\n secondary: \"secondarySubtle\",\n };\n\n const mappedVariant = deprecatedVariantMap[variant];\n\n if (import.meta.env.DEV && mappedVariant) {\n // eslint-disable-next-line no-console\n console.warn(\n `HvButton variant '${variant}' is deprecated. Please use '${mappedVariant}'.`,\n );\n }\n\n if (variant === \"semantic\") return [\"inherit\", \"ghost\"];\n if (variant === \"secondary\") return [\"secondary\", \"subtle\"];\n if (variant === \"ghost\") return [\"primary\", \"ghost\"];\n if (variant === \"contained\" || variant === \"subtle\") {\n return [\"secondary\", variant];\n }\n\n const result = variant.split(/(?=[A-Z])/);\n if (!result[1]) return [result[0], \"contained\"];\n\n return result.map((x) => x.toLowerCase()) as [HvColorAny, Variant];\n}\n/**\n * Button component is used to trigger an action or event.\n */\nexport const HvButton = fixedForwardRef(function HvButton<\n C extends React.ElementType = \"button\",\n>(props: HvButtonProps<C>, ref: PolymorphicRef<C>) {\n const {\n classes: classesProp,\n children,\n icon = false,\n variant: variantProp = icon ? \"secondaryGhost\" : \"primary\",\n color: colorProp,\n disabled = false,\n className,\n startIcon,\n endIcon,\n size,\n radius,\n overrideIconColors = true,\n component: Component = \"button\",\n focusableWhenDisabled,\n onClick: onClickProp,\n onMouseDown: onMouseDownProp,\n selected,\n style,\n ...others\n } = useDefaultProps(\"HvButton\", props);\n const { classes, css, cx } = useClasses(classesProp);\n const [parsedColor, variant] = parseVariant(variantProp);\n const color = colorProp ?? parsedColor;\n\n const handleClick: HvButtonProps[\"onClick\"] = (e) => {\n if (disabled) return;\n onClickProp?.(e);\n };\n\n const handleMouseDown: HvButtonProps[\"onMouseDown\"] = (e) => {\n if (disabled) return;\n onMouseDownProp?.(e);\n };\n\n const sizeStyles = useMemo(\n () => size && (icon ? getIconSizeStyles(size) : getSizeStyles(size)),\n [size, icon],\n );\n\n return (\n <Component\n ref={ref}\n style={mergeStyles(style, {\n \"--color\": color && getColor(color),\n \"--radius\": radius && theme.radii[radius],\n \"--HvButton-height\": sizeStyles?.height ?? \"32px\",\n })}\n className={cx(\n classes.root,\n classes[variant],\n classes[variantProp as keyof HvButtonClasses], // Placed after type and color CSS for DS3 override\n overrideIconColors && css(getOverrideColors()),\n {\n [classes.icon]: icon,\n [classes.disabled]: disabled,\n },\n sizeStyles && css(sizeStyles),\n className,\n )}\n data-color={color}\n onClick={handleClick}\n onMouseDown={handleMouseDown}\n {...(Component === \"button\" && { type: \"button\" })}\n {...(disabled && {\n disabled: !focusableWhenDisabled,\n tabIndex: focusableWhenDisabled ? 0 : -1,\n \"aria-disabled\": true,\n })}\n {...(selected && { \"aria-pressed\": selected })}\n {...others}\n >\n {startIcon && <span className={classes.startIcon}>{startIcon}</span>}\n {children}\n {endIcon && <span className={classes.endIcon}>{endIcon}</span>}\n </Component>\n );\n});\n"],"names":["HvButton"],"mappings":";;;;;;;AAuEA,SAAS,aAAa,SAAiD;AAcrE,MAAI,YAAY,WAAmB,QAAA,CAAC,WAAW,OAAO;AACtD,MAAI,YAAY,YAAoB,QAAA,CAAC,aAAa,QAAQ;AAC1D,MAAI,YAAY,QAAgB,QAAA,CAAC,WAAW,OAAO;AAC/C,MAAA,YAAY,eAAe,YAAY,UAAU;AAC5C,WAAA,CAAC,aAAa,OAAO;AAAA,EAC9B;AAEM,QAAA,SAAS,QAAQ,MAAM,WAAW;AACpC,MAAA,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,WAAW;AAE9C,SAAO,OAAO,IAAI,CAAC,MAAM,EAAE,aAAa;AAC1C;AAIO,MAAM,WAAW,gBAAgB,SAASA,UAE/C,OAAyB,KAAwB;AAC3C,QAAA;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA,OAAO;AAAA,IACP,SAAS,cAAc,OAAO,mBAAmB;AAAA,IACjD,OAAO;AAAA,IACP,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,qBAAqB;AAAA,IACrB,WAAW,YAAY;AAAA,IACvB;AAAA,IACA,SAAS;AAAA,IACT,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,YAAY,KAAK;AACrC,QAAM,EAAE,SAAS,KAAK,GAAG,IAAI,WAA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,QACA,WAAY,oBAAA,QAAA,EAAK,WAAW,QAAQ,SAAU,UAAQ,SAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG7D,CAAC;"}
1
+ {"version":3,"file":"Button.js","sources":["../../../src/Button/Button.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport {\n mergeStyles,\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport {\n getColor,\n HvColorAny,\n HvRadius,\n HvSize,\n theme,\n} from \"@hitachivantara/uikit-styles\";\n\nimport {\n fixedForwardRef,\n PolymorphicComponentRef,\n PolymorphicRef,\n} from \"../types/generic\";\nimport {\n getIconSizeStyles,\n getOverrideColors,\n getSizeStyles,\n staticClasses,\n useClasses,\n} from \"./Button.styles\";\nimport { HvButtonVariant } from \"./types\";\n\ntype Variant = \"contained\" | \"subtle\" | \"ghost\";\n\nexport { staticClasses as buttonClasses };\n\nexport type HvButtonClasses = ExtractNames<typeof useClasses>;\n\nexport type HvButtonProps<C extends React.ElementType = \"button\"> =\n PolymorphicComponentRef<\n C,\n {\n /** Use the variant prop to change the visual style of the button. */\n variant?: HvButtonVariant;\n /** Whether the button is an icon-only button. */\n icon?: boolean;\n /** Whether the button is disabled or not. */\n disabled?: boolean;\n /** Class names to be applied. */\n className?: string;\n /** Element placed before the children. */\n startIcon?: React.ReactNode;\n /** Element placed after the children. */\n endIcon?: React.ReactNode;\n /** Color of the button. */\n color?: HvColorAny;\n /** Button size. */\n size?: HvSize;\n /** Button border radius. */\n radius?: HvRadius;\n /** Defines the default colors of the button are forced into the icon. */\n overrideIconColors?: boolean;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvButtonClasses;\n /** Whether the button is selected or not. */\n selected?: boolean;\n /**\n * Whether the button is focusable when disabled.\n * Without this property, the accessibility of the button decreases when disabled since it's not read by screen readers.\n * Set this property to `true` when you need the button to still be focusable when disabled for accessibility purposes.\n */\n focusableWhenDisabled?: boolean;\n }\n >;\n\nfunction parseVariant(variant: HvButtonVariant): [HvColorAny, Variant] {\n const deprecatedVariantMap: Record<string, HvButtonVariant> = {\n secondary: \"secondarySubtle\",\n };\n\n const mappedVariant = deprecatedVariantMap[variant];\n\n if (import.meta.env.DEV && mappedVariant) {\n // eslint-disable-next-line no-console\n console.warn(\n `HvButton variant '${variant}' is deprecated. Please use '${mappedVariant}'.`,\n );\n }\n\n if (variant === \"semantic\") return [\"inherit\", \"ghost\"];\n if (variant === \"secondary\") return [\"secondary\", \"subtle\"];\n if (variant === \"ghost\") return [\"primary\", \"ghost\"];\n if (variant === \"contained\" || variant === \"subtle\") {\n return [\"secondary\", variant];\n }\n\n const result = variant.split(/(?=[A-Z])/);\n if (!result[1]) return [result[0], \"contained\"];\n\n return result.map((x) => x.toLowerCase()) as [HvColorAny, Variant];\n}\n/**\n * Button component is used to trigger an action or event.\n */\nexport const HvButton = fixedForwardRef(function HvButton<\n C extends React.ElementType = \"button\",\n>(props: HvButtonProps<C>, ref: PolymorphicRef<C>) {\n const {\n classes: classesProp,\n children,\n icon = false,\n variant: variantProp = icon ? \"secondaryGhost\" : \"primary\",\n color: colorProp,\n disabled = false,\n className,\n startIcon,\n endIcon,\n size,\n radius,\n overrideIconColors = true,\n component: Component = \"button\",\n focusableWhenDisabled,\n onClick: onClickProp,\n onMouseDown: onMouseDownProp,\n selected,\n style,\n ...others\n } = useDefaultProps(\"HvButton\", props);\n const { classes, css, cx } = useClasses(classesProp);\n const [parsedColor, variant] = parseVariant(variantProp);\n const color = colorProp ?? parsedColor;\n\n const handleClick: HvButtonProps[\"onClick\"] = (e) => {\n if (disabled) return;\n onClickProp?.(e);\n };\n\n const handleMouseDown: HvButtonProps[\"onMouseDown\"] = (e) => {\n if (disabled) return;\n onMouseDownProp?.(e);\n };\n\n const sizeStyles = useMemo(\n () => size && (icon ? getIconSizeStyles(size) : getSizeStyles(size)),\n [size, icon],\n );\n\n return (\n <Component\n ref={ref}\n style={mergeStyles(style, {\n \"--color\": color && getColor(color),\n \"--radius\": radius && theme.radii[radius],\n \"--HvButton-height\": sizeStyles?.height ?? \"32px\",\n })}\n className={cx(\n classes.root,\n classes[variant],\n classes[variantProp as keyof HvButtonClasses], // Placed after type and color CSS for DS3 override\n overrideIconColors && css(getOverrideColors()),\n {\n [classes.icon]: icon,\n [classes.disabled]: disabled,\n },\n sizeStyles && css(sizeStyles),\n className,\n )}\n data-color={color}\n onClick={handleClick}\n onMouseDown={handleMouseDown}\n {...(Component === \"button\" && { type: \"button\" })}\n {...(disabled && {\n disabled: !focusableWhenDisabled,\n tabIndex: focusableWhenDisabled ? 0 : -1,\n \"aria-disabled\": true,\n })}\n {...(selected && { \"aria-pressed\": selected })}\n {...others}\n >\n {startIcon && <span className={classes.startIcon}>{startIcon}</span>}\n {children}\n {endIcon && <span className={classes.endIcon}>{endIcon}</span>}\n </Component>\n );\n});\n"],"names":["HvButton"],"mappings":";;;;;;;AAuEA,SAAS,aAAa,SAAiD;AAcrE,MAAI,YAAY,WAAmB,QAAA,CAAC,WAAW,OAAO;AACtD,MAAI,YAAY,YAAoB,QAAA,CAAC,aAAa,QAAQ;AAC1D,MAAI,YAAY,QAAgB,QAAA,CAAC,WAAW,OAAO;AAC/C,MAAA,YAAY,eAAe,YAAY,UAAU;AAC5C,WAAA,CAAC,aAAa,OAAO;AAAA,EAAA;AAGxB,QAAA,SAAS,QAAQ,MAAM,WAAW;AACpC,MAAA,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,WAAW;AAE9C,SAAO,OAAO,IAAI,CAAC,MAAM,EAAE,aAAa;AAC1C;AAIO,MAAM,WAAW,gBAAgB,SAASA,UAE/C,OAAyB,KAAwB;AAC3C,QAAA;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA,OAAO;AAAA,IACP,SAAS,cAAc,OAAO,mBAAmB;AAAA,IACjD,OAAO;AAAA,IACP,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,qBA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QACtC,iBAAiB;AAAA,MACnB;AAAA,MACC,GAAI,YAAY,EAAE,gBAAgB,SAAS;AAAA,MAC3C,GAAG;AAAA,MAEH,UAAA;AAAA,QAAA,aAAc,oBAAA,QAAA,EAAK,WAAW,QAAQ,WAAY,UAAU,WAAA;AAAA,QAC5D;AAAA,QACA,WAAY,oBAAA,QAAA,EAAK,WAAW,QAAQ,SAAU,UAAQ,QAAA,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACzD;AAEJ,CAAC;"}
@@ -32,10 +32,14 @@ const { staticClasses, useClasses } = createClasses("HvButton", {
32
32
  padding: theme.spacing(0, "sm")
33
33
  },
34
34
  startIcon: {
35
- marginLeft: `calc(-1 * ${theme.space.xs})`
35
+ marginLeft: theme.spacing(-1),
36
+ marginTop: -1,
37
+ marginBottom: -1
36
38
  },
37
39
  endIcon: {
38
- marginRight: `calc(-1 * ${theme.space.xs})`
40
+ marginRight: theme.spacing(-1),
41
+ marginTop: -1,
42
+ marginBottom: -1
39
43
  },
40
44
  focusVisible: {},
41
45
  disabled: {
@@ -1 +1 @@
1
- {"version":3,"file":"Button.styles.js","sources":["../../../src/Button/Button.styles.ts"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme, type HvSize } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvButton\", {\n /**\n * Classes applied to the root element\n */\n root: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n textTransform: \"none\",\n cursor: \"pointer\",\n whiteSpace: \"nowrap\",\n\n // Background color common for almost all variants\n \":where(:not($disabled))\": {\n \":hover, :focus-visible\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n },\n \":focus-visible\": {\n ...outlineStyles,\n },\n\n // Default button - no size specified\n fontFamily: theme.fontFamily.body,\n ...theme.typography.label,\n color: \"var(--color, currentcolor)\",\n backgroundColor: \"transparent\",\n height: \"var(--HvButton-height)\",\n border: \"1px solid transparent\",\n borderRadius: `var(--radius, ${theme.radii.base})`,\n padding: theme.spacing(0, \"sm\"),\n },\n startIcon: {\n marginLeft: `calc(-1 * ${theme.space.xs})`,\n },\n endIcon: {\n marginRight: `calc(-1 * ${theme.space.xs})`,\n },\n focusVisible: {},\n disabled: {\n cursor: \"not-allowed\",\n color: theme.colors.secondary_60,\n backgroundColor: \"transparent\",\n borderColor: \"transparent\",\n \":hover, :focus-visible\": {\n backgroundColor: \"transparent\",\n borderColor: \"transparent\",\n },\n },\n icon: {\n margin: 0,\n padding: 0,\n height: \"fit-content\",\n \"& > *\": {\n margin: -1,\n },\n },\n contained: {\n color: theme.colors.atmo1, // `color-contrast(var(--color) vs ${colors.atmo1}, ${colors.base_light}, ${colors.base_dark})`,\n backgroundColor: \"var(--color)\",\n \":where(:not($disabled))\": {\n \":hover, :focus-visible\": {\n backgroundColor: \"color-mix(in srgb, var(--color), black 20%)\",\n },\n \":active\": {\n backgroundColor: \"color-mix(in srgb, var(--color), black 30%)\",\n },\n },\n },\n subtle: {\n borderColor: \"currentcolor\",\n },\n ghost: {},\n semantic: {\n color: theme.colors.base_dark,\n backgroundColor: \"transparent\",\n borderColor: \"transparent\",\n \"&:hover, &:focus-visible\": {\n backgroundColor: theme.alpha(\"base_light\", 0.3),\n },\n \"&:active\": {\n backgroundColor: theme.alpha(\"base_light\", 0.5),\n },\n \"&$disabled\": {\n backgroundColor: theme.alpha(\"base_light\", 0.1),\n },\n },\n\n // TODO - remove in v6\n primary: {},\n primarySubtle: {},\n primaryGhost: {},\n secondarySubtle: {},\n secondaryGhost: {},\n\n // Deprecated (DS3)\n secondary: {},\n});\n\n// TODO - remove xs and xl in v6 since they are not DS spec\nconst sizes: Record<\n HvSize,\n { height: string; space?: HvSize; fontSize?: keyof typeof theme.fontSizes }\n> = {\n xs: { height: \"24px\", fontSize: \"sm\" },\n sm: { height: \"24px\", fontSize: \"sm\" },\n md: { height: \"32px\" },\n lg: { height: \"48px\", space: \"md\" },\n xl: { height: \"48px\", space: \"md\" },\n};\n\nexport const getSizeStyles = (size: HvSize) => {\n const { height, space = \"sm\", fontSize } = sizes[size];\n return {\n height,\n padding: theme.spacing(0, space),\n fontSize: fontSize && theme.fontSizes[fontSize],\n };\n};\n\nexport const getIconSizeStyles = (size: HvSize) => {\n const { height } = sizes[size];\n return {\n height,\n width: height,\n };\n};\n\nexport const getOverrideColors = () => ({\n \"& svg .color0\": {\n fill: \"currentcolor\",\n },\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,YAAY;AAAA;AAAA;AAAA;AAAA,EAIrE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,QAAQ;AAAA,IACR,YAAY;AAAA;AAAA,IAGZ,2BAA2B;AAAA,MACzB,0BAA0B;AAAA,QACxB,iBAAiB,MAAM,OAAO;AAAA,MAChC;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB,GAAG;AAAA,IACL;AAAA;AAAA,IAGA,YAAY,MAAM,WAAW;AAAA,IAC7B,GAAG,MAAM,WAAW;AAAA,IACpB,OAAO;AAAA,IACP,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,cAAc,iBAAiB,MAAM,MAAM,IAAI;AAAA,IAC/C,SAAS,MAAM,QAAQ,GAAG,IAAI;AAAA,EAChC;AAAA,EACA,WAAW;AAAA,IACT,YAAY,aAAa,MAAM,MAAM,EAAE;AAAA,EACzC;AAAA,EACA,SAAS;AAAA,IACP,aAAa,aAAa,MAAM,MAAM,EAAE;AAAA,EAC1C;AAAA,EACA,cAAc,CAAC;AAAA,EACf,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,MAAM,OAAO;AAAA,IACpB,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,0BAA0B;AAAA,MACxB,iBAAiB;AAAA,MACj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,QAAM,EAAE,QAAQ,QAAQ,MAAM,aAAa,MAAM,IAAI;AAC9C,SAAA;AAAA,IACL;AAAA,IACA,SAAS,MAAM,QAAQ,GAAG,KAAK;AAAA,IAC/B,UAAU,YAAY,MAAM,UAAU,QAAQ;AAAA,EAAA;AAElD;AAEa,MAAA,oBAAoB,CAAC,SAAiB;AACjD,QAAM,EAAE,OAAA,IAAW,MAAM,IAAI;AACtB,SAAA;AAAA,IACL;AAAA,IACA,OAAO;AAAA,EAAA;AAEX;AAEO,MAAM,oBAAoB,OAAO;AAAA,EACtC,iBAAiB;AAAA,IACf,MAAM;AAAA,EACR;AACF;"}
1
+ {"version":3,"file":"Button.styles.js","sources":["../../../src/Button/Button.styles.ts"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme, type HvSize } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvButton\", {\n /**\n * Classes applied to the root element\n */\n root: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n textTransform: \"none\",\n cursor: \"pointer\",\n whiteSpace: \"nowrap\",\n\n // Background color common for almost all variants\n \":where(:not($disabled))\": {\n \":hover, :focus-visible\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n },\n \":focus-visible\": {\n ...outlineStyles,\n },\n\n // Default button - no size specified\n fontFamily: theme.fontFamily.body,\n ...theme.typography.label,\n color: \"var(--color, currentcolor)\",\n backgroundColor: \"transparent\",\n height: \"var(--HvButton-height)\",\n border: \"1px solid transparent\",\n borderRadius: `var(--radius, ${theme.radii.base})`,\n padding: theme.spacing(0, \"sm\"),\n },\n startIcon: {\n marginLeft: theme.spacing(-1),\n marginTop: -1,\n marginBottom: -1,\n },\n endIcon: {\n marginRight: theme.spacing(-1),\n marginTop: -1,\n marginBottom: -1,\n },\n focusVisible: {},\n disabled: {\n cursor: \"not-allowed\",\n color: theme.colors.secondary_60,\n backgroundColor: \"transparent\",\n borderColor: \"transparent\",\n \":hover, :focus-visible\": {\n backgroundColor: \"transparent\",\n borderColor: \"transparent\",\n },\n },\n icon: {\n margin: 0,\n padding: 0,\n height: \"fit-content\",\n \"& > *\": {\n margin: -1,\n },\n },\n contained: {\n color: theme.colors.atmo1, // `color-contrast(var(--color) vs ${colors.atmo1}, ${colors.base_light}, ${colors.base_dark})`,\n backgroundColor: \"var(--color)\",\n \":where(:not($disabled))\": {\n \":hover, :focus-visible\": {\n backgroundColor: \"color-mix(in srgb, var(--color), black 20%)\",\n },\n \":active\": {\n backgroundColor: \"color-mix(in srgb, var(--color), black 30%)\",\n },\n },\n },\n subtle: {\n borderColor: \"currentcolor\",\n },\n ghost: {},\n semantic: {\n color: theme.colors.base_dark,\n backgroundColor: \"transparent\",\n borderColor: \"transparent\",\n \"&:hover, &:focus-visible\": {\n backgroundColor: theme.alpha(\"base_light\", 0.3),\n },\n \"&:active\": {\n backgroundColor: theme.alpha(\"base_light\", 0.5),\n },\n \"&$disabled\": {\n backgroundColor: theme.alpha(\"base_light\", 0.1),\n },\n },\n\n // TODO - remove in v6\n primary: {},\n primarySubtle: {},\n primaryGhost: {},\n secondarySubtle: {},\n secondaryGhost: {},\n\n // Deprecated (DS3)\n secondary: {},\n});\n\n// TODO - remove xs and xl in v6 since they are not DS spec\nconst sizes: Record<\n HvSize,\n { height: string; space?: HvSize; fontSize?: keyof typeof theme.fontSizes }\n> = {\n xs: { height: \"24px\", fontSize: \"sm\" },\n sm: { height: \"24px\", fontSize: \"sm\" },\n md: { height: \"32px\" },\n lg: { height: \"48px\", space: \"md\" },\n xl: { height: \"48px\", space: \"md\" },\n};\n\nexport const getSizeStyles = (size: HvSize) => {\n const { height, space = \"sm\", fontSize } = sizes[size];\n return {\n height,\n padding: theme.spacing(0, space),\n fontSize: fontSize && theme.fontSizes[fontSize],\n };\n};\n\nexport const getIconSizeStyles = (size: HvSize) => {\n const { height } = sizes[size];\n return {\n height,\n width: height,\n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,EAChD;AACF;AAEa,MAAA,oBAAoB,CAAC,SAAiB;AACjD,QAAM,EAAE,OAAA,IAAW,MAAM,IAAI;AACtB,SAAA;AAAA,IACL;AAAA,IACA,OAAO;AAAA,EACT;AACF;AAEO,MAAM,oBAAoB,OAAO;AAAA,EACtC,iBAAiB;AAAA,IACf,MAAM;AAAA,EAAA;AAEV;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.js","sources":["../../../src/ButtonBase/ButtonBase.tsx"],"sourcesContent":["import {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport {\n fixedForwardRef,\n PolymorphicComponentRef,\n PolymorphicRef,\n} from \"../types/generic\";\nimport { staticClasses, useClasses } from \"./ButtonBase.styles\";\n\nexport { staticClasses as buttonBaseClasses };\n\nexport type HvButtonBaseClasses = ExtractNames<typeof useClasses>;\n\nexport type HvButtonBaseProps<C extends React.ElementType = \"button\"> =\n PolymorphicComponentRef<\n C,\n {\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvButtonBaseClasses;\n /** Whether the button is selected or not. */\n selected?: boolean;\n /** Whether the button is disabled or not. */\n disabled?: boolean;\n /**\n * Whether the button is focusable when disabled.\n * Without this property, the accessibility of the button decreases when disabled since it's not read by screen readers.\n * Set this property to `true` when you need the button to still be focusable when disabled for accessibility purposes.\n */\n focusableWhenDisabled?: boolean;\n }\n >;\n\n/**\n * Button component is used to trigger an action or event.\n */\nexport const HvButtonBase = fixedForwardRef(function HvButtonBase<\n C extends React.ElementType = \"button\",\n>(props: HvButtonBaseProps<C>, ref: PolymorphicRef<C>) {\n const {\n className,\n classes: classesProp,\n children,\n selected,\n disabled,\n focusableWhenDisabled,\n component: Component = \"button\",\n onClick: onClickProp,\n onMouseDown: onMouseDownProp,\n ...others\n } = useDefaultProps(\"HvButtonBase\", props);\n const { classes, cx } = useClasses(classesProp);\n\n return (\n <Component\n ref={ref}\n className={cx(\n classes.root,\n {\n [classes.disabled]: disabled,\n },\n className,\n )}\n onClick={(e) => {\n if (disabled) return;\n onClickProp?.(e);\n }}\n onMouseDown={(e) => {\n if (disabled) return;\n onMouseDownProp?.(e);\n }}\n {...(Component === \"button\" && { type: \"button\" })}\n {...(disabled && {\n disabled: !focusableWhenDisabled,\n tabIndex: focusableWhenDisabled ? 0 : -1,\n \"aria-disabled\": true,\n })}\n {...(selected && { \"aria-pressed\": selected })}\n {...others}\n >\n {children}\n </Component>\n );\n});\n"],"names":["HvButtonBase"],"mappings":";;;;;AAsCO,MAAM,eAAe,gBAAgB,SAASA,cAEnD,OAA6B,KAAwB;AAC/C,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW,YAAY;AAAA,IACvB,SAAS;AAAA,IACT,aAAa;AAAA,IACb,GAAG;AAAA,EAAA,IACD,gBAAgB,gBAAgB,KAAK;AACzC,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAG5C,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT,QAAQ;AAAA,QACR;AAAA,UACE,CAAC,QAAQ,QAAQ,GAAG;AAAA,QACtB;AAAA,QACA;AAAA,MACF;AAAA,MACA,SAAS,CAAC,MAAM;AACd,YAAI,SAAU;AACd,sBAAc,CAAC;AAAA,MACjB;AAAA,MACA,aAAa,CAAC,MAAM;AAClB,YAAI,SAAU;AACd,0BAAkB,CAAC;AAAA,MACrB;AAAA,MACC,GAAI,cAAc,YAAY,EAAE,MAAM,SAAS;AAAA,MAC/C,GAAI,YAAY;AAAA,QACf,UAAU,CAAC;AAAA,QACX,UAAU,wBAAwB,IAAI;AAAA,QACtC,iBAAiB;AAAA,MACnB;AAAA,MACC,GAAI,YAAY,EAAE,gBAAgB,SAAS;AAAA,MAC3C,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
1
+ {"version":3,"file":"ButtonBase.js","sources":["../../../src/ButtonBase/ButtonBase.tsx"],"sourcesContent":["import {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport {\n fixedForwardRef,\n PolymorphicComponentRef,\n PolymorphicRef,\n} from \"../types/generic\";\nimport { staticClasses, useClasses } from \"./ButtonBase.styles\";\n\nexport { staticClasses as buttonBaseClasses };\n\nexport type HvButtonBaseClasses = ExtractNames<typeof useClasses>;\n\nexport type HvButtonBaseProps<C extends React.ElementType = \"button\"> =\n PolymorphicComponentRef<\n C,\n {\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvButtonBaseClasses;\n /** Whether the button is selected or not. */\n selected?: boolean;\n /** Whether the button is disabled or not. */\n disabled?: boolean;\n /**\n * Whether the button is focusable when disabled.\n * Without this property, the accessibility of the button decreases when disabled since it's not read by screen readers.\n * Set this property to `true` when you need the button to still be focusable when disabled for accessibility purposes.\n */\n focusableWhenDisabled?: boolean;\n }\n >;\n\n/**\n * Button component is used to trigger an action or event.\n */\nexport const HvButtonBase = fixedForwardRef(function HvButtonBase<\n C extends React.ElementType = \"button\",\n>(props: HvButtonBaseProps<C>, ref: PolymorphicRef<C>) {\n const {\n className,\n classes: classesProp,\n children,\n selected,\n disabled,\n focusableWhenDisabled,\n component: Component = \"button\",\n onClick: onClickProp,\n onMouseDown: onMouseDownProp,\n ...others\n } = useDefaultProps(\"HvButtonBase\", props);\n const { classes, cx } = useClasses(classesProp);\n\n return (\n <Component\n ref={ref}\n className={cx(\n classes.root,\n {\n [classes.disabled]: disabled,\n },\n className,\n )}\n onClick={(e) => {\n if (disabled) return;\n onClickProp?.(e);\n }}\n onMouseDown={(e) => {\n if (disabled) return;\n onMouseDownProp?.(e);\n }}\n {...(Component === \"button\" && { type: \"button\" })}\n {...(disabled && {\n disabled: !focusableWhenDisabled,\n tabIndex: focusableWhenDisabled ? 0 : -1,\n \"aria-disabled\": true,\n })}\n {...(selected && { \"aria-pressed\": selected })}\n {...others}\n >\n {children}\n </Component>\n );\n});\n"],"names":["HvButtonBase"],"mappings":";;;;;AAsCO,MAAM,eAAe,gBAAgB,SAASA,cAEnD,OAA6B,KAAwB;AAC/C,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW,YAAY;AAAA,IACvB,SAAS;AAAA,IACT,aAAa;AAAA,IACb,GAAG;AAAA,EAAA,IACD,gBAAgB,gBAAgB,KAAK;AACzC,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAG5C,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT,QAAQ;AAAA,QACR;AAAA,UACE,CAAC,QAAQ,QAAQ,GAAG;AAAA,QACtB;AAAA,QACA;AAAA,MACF;AAAA,MACA,SAAS,CAAC,MAAM;AACd,YAAI,SAAU;AACd,sBAAc,CAAC;AAAA,MACjB;AAAA,MACA,aAAa,CAAC,MAAM;AAClB,YAAI,SAAU;AACd,0BAAkB,CAAC;AAAA,MACrB;AAAA,MACC,GAAI,cAAc,YAAY,EAAE,MAAM,SAAS;AAAA,MAC/C,GAAI,YAAY;AAAA,QACf,UAAU,CAAC;AAAA,QACX,UAAU,wBAAwB,IAAI;AAAA,QACtC,iBAAiB;AAAA,MACnB;AAAA,MACC,GAAI,YAAY,EAAE,gBAAgB,SAAS;AAAA,MAC3C,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EACH;AAEJ,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.styles.js","sources":["../../../src/ButtonBase/ButtonBase.styles.ts"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvButtonBase\", {\n root: {\n display: \"inline-flex\",\n cursor: \"pointer\",\n background: \"none\",\n padding: 0,\n\n // Background color common for almost all variants\n \"&:hover\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n \"&:focus-visible\": {\n ...outlineStyles,\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n\n // Default button - no size specified\n fontFamily: theme.fontFamily.body,\n fontSize: \"inherit\",\n color: \"inherit\",\n },\n disabled: {\n cursor: \"not-allowed\",\n color: theme.colors.secondary_60,\n \"&:hover, &:focus-visible\": {\n backgroundColor: \"transparent\",\n },\n },\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,gBAAgB;AAAA,EACzE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,SAAS;AAAA;AAAA,IAGT,WAAW;AAAA,MACT,iBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA,IACA,mBAAmB;AAAA,MACjB,GAAG;AAAA,MACH,iBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA;AAAA,IAGA,YAAY,MAAM,WAAW;AAAA,IAC7B,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AAAA,EACA,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,MAAM,OAAO;AAAA,IACpB,4BAA4B;AAAA,MAC1B,iBAAiB;AAAA,IACnB;AAAA,EACF;AACF,CAAC;"}
1
+ {"version":3,"file":"ButtonBase.styles.js","sources":["../../../src/ButtonBase/ButtonBase.styles.ts"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvButtonBase\", {\n root: {\n display: \"inline-flex\",\n cursor: \"pointer\",\n background: \"none\",\n padding: 0,\n\n // Background color common for almost all variants\n \"&:hover\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n \"&:focus-visible\": {\n ...outlineStyles,\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n\n // Default button - no size specified\n fontFamily: theme.fontFamily.body,\n fontSize: \"inherit\",\n color: \"inherit\",\n },\n disabled: {\n cursor: \"not-allowed\",\n color: theme.colors.secondary_60,\n \"&:hover, &:focus-visible\": {\n backgroundColor: \"transparent\",\n },\n },\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,gBAAgB;AAAA,EACzE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,SAAS;AAAA;AAAA,IAGT,WAAW;AAAA,MACT,iBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA,IACA,mBAAmB;AAAA,MACjB,GAAG;AAAA,MACH,iBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA;AAAA,IAGA,YAAY,MAAM,WAAW;AAAA,IAC7B,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AAAA,EACA,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,OAAO,MAAM,OAAO;AAAA,IACpB,4BAA4B;AAAA,MAC1B,iBAAiB;AAAA,IAAA;AAAA,EACnB;AAEJ,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Calendar.js","sources":["../../../src/Calendar/Calendar.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvFormElementContext, HvFormElementValueContext } from \"../Forms\";\nimport { setId } from \"../utils/setId\";\nimport { staticClasses, useClasses } from \"./Calendar.styles\";\nimport { HvSingleCalendar } from \"./SingleCalendar\";\nimport { DateRangeProp, VisibilitySelectorActions } from \"./types\";\nimport { isRange } from \"./utils\";\n\nexport { staticClasses as calendarClasses };\n\nexport type HvCalendarClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvCalendarProps {\n /**\n * Styles applied from the theme.\n */\n classes?: HvCalendarClasses;\n /**\n * Identifier.\n */\n id?: string;\n /**\n * The calendar locale. If undefined, it defaults to en-US\n *\n */\n locale?: string;\n /**\n * Date that the calendar would show.\n * if using the object format the calendar enter in range mode showing two calendars\n */\n value?: DateRangeProp | Date;\n /**\n * Controls the visible month of the Calendar\n */\n visibleMonth?: number;\n /**\n * Controls the visible year of the Calendar\n */\n visibleYear?: number;\n /**\n * Controls the visible month of the Calendar on the right side of the datepicker\n */\n rightVisibleMonth?: number;\n /**\n * Controls the visible year of the Calendar on the right side of the datepicker\n */\n rightVisibleYear?: number;\n /**\n * Callback function to be triggered when the selected date has changed.\n */\n onChange?: (\n event:\n | React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>\n | undefined,\n value: Date | DateRangeProp,\n ) => void;\n /**\n * Callback function to be triggered when the selected date input has changed.\n */\n onInputChange?: (\n event:\n | React.ChangeEvent<\n HTMLTextAreaElement | HTMLInputElement | HTMLButtonElement\n >\n | undefined,\n value: Date | DateRangeProp,\n position: \"left\" | \"right\",\n ) => void;\n /**\n * Callback function to be triggered when the user clicks on the month or year selector.\n * it receives the action that was pressed:\n * previous_month, next_month, previous_year, next_year,month\n */\n onVisibleDateChange?: (\n event:\n | React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>\n | undefined,\n action: VisibilitySelectorActions,\n value?: Date | DateRangeProp | number,\n position?: \"left\" | \"right\",\n ) => void;\n /**\n * The maximum selectable date after this all values are disabled.\n */\n maximumDate?: Date;\n /**\n * The minimum selectable date before this all values are disabled.\n */\n minimumDate?: Date;\n /**\n * An element placed before the Calendar\n */\n startAdornment?: React.ReactNode;\n /**\n * Indicates if header should display the day of week.\n */\n showDayOfWeek?: boolean;\n /**\n * Label shown when date is invalid.\n */\n invalidDateLabel?: string;\n}\n\nexport const HvCalendar = (props: HvCalendarProps) => {\n const {\n classes: classesProp,\n id,\n locale = \"en-US\",\n value,\n visibleMonth,\n visibleYear,\n rightVisibleMonth,\n rightVisibleYear,\n minimumDate,\n maximumDate,\n startAdornment,\n onChange,\n onInputChange,\n onVisibleDateChange,\n invalidDateLabel,\n ...others\n } = useDefaultProps(\"HvCalendar\", props);\n const { classes } = useClasses(classesProp);\n\n const { elementId } = useContext(HvFormElementContext);\n const elementValue = useContext(HvFormElementValueContext);\n const localValue = value ?? elementValue;\n const localId = id ?? setId(elementId, \"single-calendar\");\n const rangeMode = isRange(localValue);\n const rightCalendarId = setId(localId, \"single-calendar-right\");\n const clampedMonth =\n visibleMonth && visibleMonth % 13 > 0 ? visibleMonth % 13 : 1;\n\n const singleCalendar = (\n <HvSingleCalendar\n id={localId}\n locale={locale}\n value={localValue}\n visibleMonth={clampedMonth}\n visibleYear={visibleYear}\n minimumDate={minimumDate}\n maximumDate={maximumDate}\n onChange={onChange}\n onInputChange={(evt, date) => {\n onInputChange?.(evt, date, \"left\");\n }}\n onVisibleDateChange={onVisibleDateChange}\n invalidDateLabel={invalidDateLabel}\n {...others}\n />\n );\n\n const rangeCalendar = (\n <div className={classes.rangeCalendarContainer}>\n <HvSingleCalendar\n className={classes.singleCalendar}\n id={localId}\n locale={locale}\n value={localValue}\n visibleMonth={clampedMonth}\n visibleYear={visibleYear}\n minimumDate={minimumDate}\n maximumDate={maximumDate}\n onChange={onChange}\n onInputChange={(evt, date) => {\n onInputChange?.(evt, date, \"left\");\n }}\n onVisibleDateChange={(event, action, index) =>\n onVisibleDateChange?.(event, action, index, \"left\")\n }\n invalidDateLabel={invalidDateLabel}\n {...others}\n />\n\n <HvSingleCalendar\n className={classes.singleCalendar}\n id={rightCalendarId}\n locale={locale}\n value={localValue}\n visibleMonth={rightVisibleMonth}\n visibleYear={rightVisibleYear}\n minimumDate={minimumDate}\n maximumDate={maximumDate}\n onChange={onChange}\n onInputChange={(evt, date) => {\n onInputChange?.(evt, date, \"right\");\n }}\n onVisibleDateChange={(event, action, index) => {\n onVisibleDateChange?.(event, action, index, \"right\");\n }}\n showEndDate\n invalidDateLabel={invalidDateLabel}\n {...others}\n />\n </div>\n );\n\n return (\n <div className={classes.root}>\n {startAdornment}\n {rangeMode ? rangeCalendar : singleCalendar}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AAA,QACnC;AAAA,QACA,qBAAqB,CAAC,OAAO,QAAQ,UACnC,sBAAsB,OAAO,QAAQ,OAAO,MAAM;AAAA,QAEpD;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IACN;AAAA,IAEA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,QAAQ;AAAA,QACnB,IAAI;AAAA,QACJ;AAAA,QACA,OAAO;AAAA,QACP,cAAc;AAAA,QACd,aAAa;AAAA,QACb;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe,CAAC,KAAK,SAAS;AACZ,0BAAA,KAAK,MAAM,OAAO;AAAA,QACpC;AAAA,QACA,qBAAqB,CAAC,OAAO,QAAQ,UAAU;AACvB,gCAAA,OAAO,QAAQ,OAAO,OAAO;AAAA,QACrD;AAAA,QACA,aAAW;AAAA,QACX;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IACN;AAAA,EACF,EAAA,CAAA;AAGF,SACG,qBAAA,OAAA,EAAI,WAAW,QAAQ,MACrB,UAAA;AAAA,IAAA;AAAA,IACA,YAAY,gBAAgB;AAAA,EAC/B,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"Calendar.js","sources":["../../../src/Calendar/Calendar.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvFormElementContext, HvFormElementValueContext } from \"../Forms\";\nimport { setId } from \"../utils/setId\";\nimport { staticClasses, useClasses } from \"./Calendar.styles\";\nimport { HvSingleCalendar } from \"./SingleCalendar\";\nimport { DateRangeProp, VisibilitySelectorActions } from \"./types\";\nimport { isRange } from \"./utils\";\n\nexport { staticClasses as calendarClasses };\n\nexport type HvCalendarClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvCalendarProps {\n /**\n * Styles applied from the theme.\n */\n classes?: HvCalendarClasses;\n /**\n * Identifier.\n */\n id?: string;\n /**\n * The calendar locale. If undefined, it defaults to en-US\n *\n */\n locale?: string;\n /**\n * Date that the calendar would show.\n * if using the object format the calendar enter in range mode showing two calendars\n */\n value?: DateRangeProp | Date;\n /**\n * Controls the visible month of the Calendar\n */\n visibleMonth?: number;\n /**\n * Controls the visible year of the Calendar\n */\n visibleYear?: number;\n /**\n * Controls the visible month of the Calendar on the right side of the datepicker\n */\n rightVisibleMonth?: number;\n /**\n * Controls the visible year of the Calendar on the right side of the datepicker\n */\n rightVisibleYear?: number;\n /**\n * Callback function to be triggered when the selected date has changed.\n */\n onChange?: (\n event:\n | React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>\n | undefined,\n value: Date | DateRangeProp,\n ) => void;\n /**\n * Callback function to be triggered when the selected date input has changed.\n */\n onInputChange?: (\n event:\n | React.ChangeEvent<\n HTMLTextAreaElement | HTMLInputElement | HTMLButtonElement\n >\n | undefined,\n value: Date | DateRangeProp,\n position: \"left\" | \"right\",\n ) => void;\n /**\n * Callback function to be triggered when the user clicks on the month or year selector.\n * it receives the action that was pressed:\n * previous_month, next_month, previous_year, next_year,month\n */\n onVisibleDateChange?: (\n event:\n | React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>\n | undefined,\n action: VisibilitySelectorActions,\n value?: Date | DateRangeProp | number,\n position?: \"left\" | \"right\",\n ) => void;\n /**\n * The maximum selectable date after this all values are disabled.\n */\n maximumDate?: Date;\n /**\n * The minimum selectable date before this all values are disabled.\n */\n minimumDate?: Date;\n /**\n * An element placed before the Calendar\n */\n startAdornment?: React.ReactNode;\n /**\n * Indicates if header should display the day of week.\n */\n showDayOfWeek?: boolean;\n /**\n * Label shown when date is invalid.\n */\n invalidDateLabel?: string;\n}\n\nexport const HvCalendar = (props: HvCalendarProps) => {\n const {\n classes: classesProp,\n id,\n locale = \"en-US\",\n value,\n visibleMonth,\n visibleYear,\n rightVisibleMonth,\n rightVisibleYear,\n minimumDate,\n maximumDate,\n startAdornment,\n onChange,\n onInputChange,\n onVisibleDateChange,\n invalidDateLabel,\n ...others\n } = useDefaultProps(\"HvCalendar\", props);\n const { classes } = useClasses(classesProp);\n\n const { elementId } = useContext(HvFormElementContext);\n const elementValue = useContext(HvFormElementValueContext);\n const localValue = value ?? elementValue;\n const localId = id ?? setId(elementId, \"single-calendar\");\n const rangeMode = isRange(localValue);\n const rightCalendarId = setId(localId, \"single-calendar-right\");\n const clampedMonth =\n visibleMonth && visibleMonth % 13 > 0 ? visibleMonth % 13 : 1;\n\n const singleCalendar = (\n <HvSingleCalendar\n id={localId}\n locale={locale}\n value={localValue}\n visibleMonth={clampedMonth}\n visibleYear={visibleYear}\n minimumDate={minimumDate}\n maximumDate={maximumDate}\n onChange={onChange}\n onInputChange={(evt, date) => {\n onInputChange?.(evt, date, \"left\");\n }}\n onVisibleDateChange={onVisibleDateChange}\n invalidDateLabel={invalidDateLabel}\n {...others}\n />\n );\n\n const rangeCalendar = (\n <div className={classes.rangeCalendarContainer}>\n <HvSingleCalendar\n className={classes.singleCalendar}\n id={localId}\n locale={locale}\n value={localValue}\n visibleMonth={clampedMonth}\n visibleYear={visibleYear}\n minimumDate={minimumDate}\n maximumDate={maximumDate}\n onChange={onChange}\n onInputChange={(evt, date) => {\n onInputChange?.(evt, date, \"left\");\n }}\n onVisibleDateChange={(event, action, index) =>\n onVisibleDateChange?.(event, action, index, \"left\")\n }\n invalidDateLabel={invalidDateLabel}\n {...others}\n />\n\n <HvSingleCalendar\n className={classes.singleCalendar}\n id={rightCalendarId}\n locale={locale}\n value={localValue}\n visibleMonth={rightVisibleMonth}\n visibleYear={rightVisibleYear}\n minimumDate={minimumDate}\n maximumDate={maximumDate}\n onChange={onChange}\n onInputChange={(evt, date) => {\n onInputChange?.(evt, date, \"right\");\n }}\n onVisibleDateChange={(event, action, index) => {\n onVisibleDateChange?.(event, action, index, \"right\");\n }}\n showEndDate\n invalidDateLabel={invalidDateLabel}\n {...others}\n />\n </div>\n );\n\n return (\n <div className={classes.root}>\n {startAdornment}\n {rangeMode ? rangeCalendar : singleCalendar}\n </div>\n );\n};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A,QACA,qBAAqB,CAAC,OAAO,QAAQ,UACnC,sBAAsB,OAAO,QAAQ,OAAO,MAAM;AAAA,QAEpD;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IACN;AAAA,IAEA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,QAAQ;AAAA,QACnB,IAAI;AAAA,QACJ;AAAA,QACA,OAAO;AAAA,QACP,cAAc;AAAA,QACd,aAAa;AAAA,QACb;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe,CAAC,KAAK,SAAS;AACZ,0BAAA,KAAK,MAAM,OAAO;AAAA,QACpC;AAAA,QACA,qBAAqB,CAAC,OAAO,QAAQ,UAAU;AACvB,gCAAA,OAAO,QAAQ,OAAO,OAAO;AAAA,QACrD;AAAA,QACA,aAAW;AAAA,QACX;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EACN,GACF;AAGF,SACG,qBAAA,OAAA,EAAI,WAAW,QAAQ,MACrB,UAAA;AAAA,IAAA;AAAA,IACA,YAAY,gBAAgB;AAAA,EAAA,GAC/B;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Calendar.styles.js","sources":["../../../src/Calendar/Calendar.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvCalendar\", {\n root: {\n display: \"flex\",\n justifyContent: \"center\",\n },\n rangeCalendarContainer: {\n display: \"flex\",\n },\n singleCalendar: {\n \"&:hover\": {\n \"& ~ $singleCalendar\": {\n // target the next calendar when the former is hovered\n \"& > div\": {\n \"& > div:nth-of-type(3)\": {\n \"& > div\": {\n \"& > div[data-calendar-cell='calendarCell']\": {\n backgroundColor: theme.colors.atmo1,\n },\n },\n },\n },\n },\n },\n },\n focusSelection: {},\n calendarMonthlyCell: {},\n calendarMonthlyCellSelected: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,cAAc;AAAA,EACvE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,gBAAgB;AAAA,EAClB;AAAA,EACA,wBAAwB;AAAA,IACtB,SAAS;AAAA,EACX;AAAA,EACA,gBAAgB;AAAA,IACd,WAAW;AAAA,MACT,uBAAuB;AAAA;AAAA,QAErB,WAAW;AAAA,UACT,0BAA0B;AAAA,YACxB,WAAW;AAAA,cACT,8CAA8C;AAAA,gBAC5C,iBAAiB,MAAM,OAAO;AAAA,cAChC;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,gBAAgB,CAAC;AAAA,EACjB,qBAAqB,CAAC;AAAA,EACtB,6BAA6B,CAAC;AAChC,CAAC;"}
1
+ {"version":3,"file":"Calendar.styles.js","sources":["../../../src/Calendar/Calendar.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvCalendar\", {\n root: {\n display: \"flex\",\n justifyContent: \"center\",\n },\n rangeCalendarContainer: {\n display: \"flex\",\n },\n singleCalendar: {\n \"&:hover\": {\n \"& ~ $singleCalendar\": {\n // target the next calendar when the former is hovered\n \"& > div\": {\n \"& > div:nth-of-type(3)\": {\n \"& > div\": {\n \"& > div[data-calendar-cell='calendarCell']\": {\n backgroundColor: theme.colors.atmo1,\n },\n },\n },\n },\n },\n },\n },\n focusSelection: {},\n calendarMonthlyCell: {},\n calendarMonthlyCellSelected: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,cAAc;AAAA,EACvE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,gBAAgB;AAAA,EAClB;AAAA,EACA,wBAAwB;AAAA,IACtB,SAAS;AAAA,EACX;AAAA,EACA,gBAAgB;AAAA,IACd,WAAW;AAAA,MACT,uBAAuB;AAAA;AAAA,QAErB,WAAW;AAAA,UACT,0BAA0B;AAAA,YACxB,WAAW;AAAA,cACT,8CAA8C;AAAA,gBAC5C,iBAAiB,MAAM,OAAO;AAAA,cAAA;AAAA,YAChC;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EAEJ;AAAA,EACA,gBAAgB,CAAC;AAAA,EACjB,qBAAqB,CAAC;AAAA,EACtB,6BAA6B,CAAA;AAC/B,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarHeader.js","sources":["../../../../src/Calendar/CalendarHeader/CalendarHeader.tsx"],"sourcesContent":["import { useContext, useEffect, useState } from \"react\";\nimport dayjs from \"dayjs\";\nimport customParseFormat from \"dayjs/plugin/customParseFormat\";\nimport localeData from \"dayjs/plugin/localeData\";\nimport localizedFormat from \"dayjs/plugin/localizedFormat\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport {\n HvFormElementContext,\n HvFormElementDescriptorsContext,\n HvFormElementValueContext,\n} from \"../../Forms\";\nimport { HvInput, HvInputProps } from \"../../Input\";\nimport { HvTypography } from \"../../Typography\";\nimport { isKey } from \"../../utils/keyboardUtils\";\nimport { setId } from \"../../utils/setId\";\nimport { DateRangeProp } from \"../types\";\nimport { formatToLocale, isDate, isRange, isSameDay } from \"../utils\";\nimport { staticClasses, useClasses } from \"./CalendarHeader.styles\";\n\nexport { staticClasses as calendarHeaderClasses };\n\nexport type HvCalendarHeaderClasses = ExtractNames<typeof useClasses>;\n\ndayjs.extend(localeData);\ndayjs.extend(localizedFormat);\ndayjs.extend(customParseFormat);\n\nexport const HvCalendarHeader = (props: HvCalendarHeaderProps) => {\n const {\n id,\n value,\n locale = \"en-US\",\n classes: classesProp,\n onChange,\n showEndDate,\n showDayOfWeek = false,\n onFocus,\n invalidDateLabel = \"Invalid Date\",\n } = useDefaultProps(\"HvCalendarHeader\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const { elementId } = useContext(HvFormElementContext);\n const elementValue = useContext(HvFormElementValueContext);\n const { label } = useContext(HvFormElementDescriptorsContext);\n\n let localValue: string | Date | DateRangeProp | undefined =\n value ?? elementValue ?? \"\";\n if (isRange(localValue)) {\n localValue = showEndDate ? localValue.endDate : localValue.startDate;\n }\n\n const [dateValue, setDateValue] = useState<\n string | Date | DateRangeProp | undefined\n >(localValue);\n const [editedValue, setEditedValue] = useState<string | null>(null);\n const [displayValue, setDisplayValue] = useState(\"\");\n const [weekdayDisplay, setWeekdayDisplay] = useState(\"\");\n\n const localId = id ?? setId(elementId, \"calendarHeader\");\n\n const inputValue = editedValue ?? displayValue;\n const localeFormat = dayjs().locale(locale).localeData().longDateFormat(\"L\");\n\n const [isValidValue, setIsValidValue] = useState(\n inputValue.length === 0 || (!!inputValue && dayjs(localValue).isValid()),\n );\n\n const validateInput = (incomingValid: any) =>\n incomingValid === undefined || dayjs(incomingValid).isValid();\n\n useEffect(() => {\n const valid = validateInput(localValue);\n setIsValidValue(valid);\n if (valid) {\n if (!localValue) {\n setDisplayValue(\"\");\n setEditedValue(null);\n setWeekdayDisplay(\"\");\n return;\n }\n const weekday = new Intl.DateTimeFormat(locale, {\n weekday: \"short\",\n }).format(isDate(localValue) ? localValue : 0);\n setDisplayValue(formatToLocale(localValue, locale));\n setEditedValue(null);\n setWeekdayDisplay(weekday);\n }\n }, [localValue, locale]);\n\n const handleNewDate = (event: any, date: string) => {\n // attempt to format in locale data, or fallback to default\n const localeParsedDate = dayjs(date, localeFormat);\n\n const isValidInput = localeParsedDate.isValid();\n const dateParsed = isValidInput\n ? localeParsedDate.toDate()\n : dayjs(date).toDate();\n // prevent extra updates\n if (!isSameDay(dateParsed, dateValue)) {\n setDateValue(dateParsed);\n onChange?.(event, dateParsed);\n }\n\n setIsValidValue(isValidInput);\n if (isValidInput) {\n setEditedValue(null);\n }\n };\n\n const onBlurHandler: HvInputProps[\"onBlur\"] = (event) => {\n if (editedValue == null) return;\n if (editedValue === \"\") {\n setIsValidValue(true);\n setEditedValue(null);\n return;\n }\n handleNewDate(event, editedValue);\n };\n\n const keyDownHandler: HvInputProps[\"onKeyDown\"] = (event) => {\n if (!isKey(event, \"Enter\") || editedValue == null || editedValue === \"\")\n return;\n event.preventDefault();\n\n handleNewDate(event, editedValue);\n };\n\n const onFocusHandler: HvInputProps[\"onFocus\"] = (event) => {\n if (!localValue) return;\n const formattedDate =\n isValidValue && isDate(localValue)\n ? dayjs(localValue).locale(locale).format(\"L\")\n : editedValue;\n setEditedValue(formattedDate);\n onFocus?.(event, formattedDate);\n };\n\n const onChangeHandler: HvInputProps[\"onChange\"] = (event, val) => {\n setEditedValue(val);\n };\n\n const isInvalid = !isValidValue && inputValue !== \"\";\n\n // This component needs to be further refactored\n // It's not possible to clear the date\n // In a new major there's no need for all these classes\n return (\n <div\n id={localId}\n className={cx(classes.root, {\n [classes.invalid]: isInvalid,\n })}\n >\n {showDayOfWeek && (\n <HvTypography className={classes.headerDayOfWeek}>\n {weekdayDisplay || \"\\u00A0\"}\n </HvTypography>\n )}\n <HvInput\n type=\"text\"\n id={setId(localId, \"header-input\")}\n className={classes.headerDate}\n classes={{\n input: classes.input,\n inputBorderContainer: classes.inputBorderContainer,\n error: classes.invalidMessageStyling,\n }}\n placeholder={localeFormat}\n value={inputValue}\n aria-labelledby={label?.[0]?.id}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n onChange={onChangeHandler}\n onKeyDown={keyDownHandler}\n status={isInvalid ? \"invalid\" : \"valid\"}\n statusMessage={invalidDateLabel}\n />\n </div>\n );\n};\n\n// TODO: refactor this out\nHvCalendarHeader.formElementType = \"HvCalendarHeader\";\n\nexport interface HvCalendarHeaderProps {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes?: HvCalendarHeaderClasses;\n /**\n * Identifier.\n */\n id?: string;\n /**\n * The text to be shown on the main part of the header.\n */\n value?: string | Date | DateRangeProp;\n /**\n * Locale to be used by the calendar.\n */\n locale?: string;\n /**\n * Callback to define the input date.\n */\n onChange?: (\n event:\n | React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>\n | undefined,\n value: Date | DateRangeProp,\n ) => void;\n /**\n * Callback to handle input onFocus.\n */\n onFocus?: (\n event: React.FocusEvent<HTMLTextAreaElement | HTMLInputElement>,\n formattedDate: string | null,\n ) => void;\n /**\n * Indicates if header should display end date in a date range.\n */\n showEndDate?: boolean;\n /**\n * Indicates if header should display the day of week.\n */\n showDayOfWeek?: boolean;\n /**\n * Label shown when date is invalid.\n */\n invalidDateLabel?: string;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AA2BA,MAAM,OAAO,UAAU;AACvB,MAAM,OAAO,eAAe;AAC5B,MAAM,OAAO,iBAAiB;AAEjB,MAAA,mBAAmB,CAAC,UAAiC;AAC1D,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB;AAAA,IACA,mBAAmB;AAAA,EAAA,IACjB,gBAAgB,oBAAoB,KAAK;AAE7C,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAE9C,QAAM,EAAE,UAAA,IAAc,WAAW,oBAAoB;AAC/C,QAAA,eAAe,WAAW,yBAAyB;AACzD,QAAM,EAAE,MAAA,IAAU,WAAW,+BAA+B;AAExD,MAAA,aACF,SAAS,gBAAgB;AACvB,MAAA,QAAQ,UAAU,GAAG;AACV,iBAAA,cAAc,WAAW,UAAU,WAAW;AAAA,EAC7D;AAEA,QAAM,CAAC,WAAW,YAAY,IAAI,SAEhC,UAAU;AACZ,QAAM,CAAC,aAAa,cAAc,IAAI,SAAwB,IAAI;AAClE,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,EAAE;AACnD,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAS,EAAE;AAEvD,QAAM,UAAU,MAAM,MAAM,WAAW,gBAAgB;AAEvD,QAAM,aAAa,eAAe;AAC5B,QAAA,eAA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../../../../src/Calendar/CalendarHeader/CalendarHeader.tsx"],"sourcesContent":["import { useContext, useEffect, useState } from \"react\";\nimport dayjs from \"dayjs\";\nimport customParseFormat from \"dayjs/plugin/customParseFormat\";\nimport localeData from \"dayjs/plugin/localeData\";\nimport localizedFormat from \"dayjs/plugin/localizedFormat\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport {\n HvFormElementContext,\n HvFormElementDescriptorsContext,\n HvFormElementValueContext,\n} from \"../../Forms\";\nimport { HvInput, HvInputProps } from \"../../Input\";\nimport { HvTypography } from \"../../Typography\";\nimport { isKey } from \"../../utils/keyboardUtils\";\nimport { setId } from \"../../utils/setId\";\nimport { DateRangeProp } from \"../types\";\nimport { formatToLocale, isDate, isRange, isSameDay } from \"../utils\";\nimport { staticClasses, useClasses } from \"./CalendarHeader.styles\";\n\nexport { staticClasses as calendarHeaderClasses };\n\nexport type HvCalendarHeaderClasses = ExtractNames<typeof useClasses>;\n\ndayjs.extend(localeData);\ndayjs.extend(localizedFormat);\ndayjs.extend(customParseFormat);\n\nexport const HvCalendarHeader = (props: HvCalendarHeaderProps) => {\n const {\n id,\n value,\n locale = \"en-US\",\n classes: classesProp,\n onChange,\n showEndDate,\n showDayOfWeek = false,\n onFocus,\n invalidDateLabel = \"Invalid Date\",\n } = useDefaultProps(\"HvCalendarHeader\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const { elementId } = useContext(HvFormElementContext);\n const elementValue = useContext(HvFormElementValueContext);\n const { label } = useContext(HvFormElementDescriptorsContext);\n\n let localValue: string | Date | DateRangeProp | undefined =\n value ?? elementValue ?? \"\";\n if (isRange(localValue)) {\n localValue = showEndDate ? localValue.endDate : localValue.startDate;\n }\n\n const [dateValue, setDateValue] = useState<\n string | Date | DateRangeProp | undefined\n >(localValue);\n const [editedValue, setEditedValue] = useState<string | null>(null);\n const [displayValue, setDisplayValue] = useState(\"\");\n const [weekdayDisplay, setWeekdayDisplay] = useState(\"\");\n\n const localId = id ?? setId(elementId, \"calendarHeader\");\n\n const inputValue = editedValue ?? displayValue;\n const localeFormat = dayjs().locale(locale).localeData().longDateFormat(\"L\");\n\n const [isValidValue, setIsValidValue] = useState(\n inputValue.length === 0 || (!!inputValue && dayjs(localValue).isValid()),\n );\n\n const validateInput = (incomingValid: any) =>\n incomingValid === undefined || dayjs(incomingValid).isValid();\n\n useEffect(() => {\n const valid = validateInput(localValue);\n setIsValidValue(valid);\n if (valid) {\n if (!localValue) {\n setDisplayValue(\"\");\n setEditedValue(null);\n setWeekdayDisplay(\"\");\n return;\n }\n const weekday = new Intl.DateTimeFormat(locale, {\n weekday: \"short\",\n }).format(isDate(localValue) ? localValue : 0);\n setDisplayValue(formatToLocale(localValue, locale));\n setEditedValue(null);\n setWeekdayDisplay(weekday);\n }\n }, [localValue, locale]);\n\n const handleNewDate = (event: any, date: string) => {\n // attempt to format in locale data, or fallback to default\n const localeParsedDate = dayjs(date, localeFormat);\n\n const isValidInput = localeParsedDate.isValid();\n const dateParsed = isValidInput\n ? localeParsedDate.toDate()\n : dayjs(date).toDate();\n // prevent extra updates\n if (!isSameDay(dateParsed, dateValue)) {\n setDateValue(dateParsed);\n onChange?.(event, dateParsed);\n }\n\n setIsValidValue(isValidInput);\n if (isValidInput) {\n setEditedValue(null);\n }\n };\n\n const onBlurHandler: HvInputProps[\"onBlur\"] = (event) => {\n if (editedValue == null) return;\n if (editedValue === \"\") {\n setIsValidValue(true);\n setEditedValue(null);\n return;\n }\n handleNewDate(event, editedValue);\n };\n\n const keyDownHandler: HvInputProps[\"onKeyDown\"] = (event) => {\n if (!isKey(event, \"Enter\") || editedValue == null || editedValue === \"\")\n return;\n event.preventDefault();\n\n handleNewDate(event, editedValue);\n };\n\n const onFocusHandler: HvInputProps[\"onFocus\"] = (event) => {\n if (!localValue) return;\n const formattedDate =\n isValidValue && isDate(localValue)\n ? dayjs(localValue).locale(locale).format(\"L\")\n : editedValue;\n setEditedValue(formattedDate);\n onFocus?.(event, formattedDate);\n };\n\n const onChangeHandler: HvInputProps[\"onChange\"] = (event, val) => {\n setEditedValue(val);\n };\n\n const isInvalid = !isValidValue && inputValue !== \"\";\n\n // This component needs to be further refactored\n // It's not possible to clear the date\n // In a new major there's no need for all these classes\n return (\n <div\n id={localId}\n className={cx(classes.root, {\n [classes.invalid]: isInvalid,\n })}\n >\n {showDayOfWeek && (\n <HvTypography className={classes.headerDayOfWeek}>\n {weekdayDisplay || \"\\u00A0\"}\n </HvTypography>\n )}\n <HvInput\n type=\"text\"\n id={setId(localId, \"header-input\")}\n className={classes.headerDate}\n classes={{\n input: classes.input,\n inputBorderContainer: classes.inputBorderContainer,\n error: classes.invalidMessageStyling,\n }}\n placeholder={localeFormat}\n value={inputValue}\n aria-labelledby={label?.[0]?.id}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n onChange={onChangeHandler}\n onKeyDown={keyDownHandler}\n status={isInvalid ? \"invalid\" : \"valid\"}\n statusMessage={invalidDateLabel}\n />\n </div>\n );\n};\n\n// TODO: refactor this out\nHvCalendarHeader.formElementType = \"HvCalendarHeader\";\n\nexport interface HvCalendarHeaderProps {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes?: HvCalendarHeaderClasses;\n /**\n * Identifier.\n */\n id?: string;\n /**\n * The text to be shown on the main part of the header.\n */\n value?: string | Date | DateRangeProp;\n /**\n * Locale to be used by the calendar.\n */\n locale?: string;\n /**\n * Callback to define the input date.\n */\n onChange?: (\n event:\n | React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>\n | undefined,\n value: Date | DateRangeProp,\n ) => void;\n /**\n * Callback to handle input onFocus.\n */\n onFocus?: (\n event: React.FocusEvent<HTMLTextAreaElement | HTMLInputElement>,\n formattedDate: string | null,\n ) => void;\n /**\n * Indicates if header should display end date in a date range.\n */\n showEndDate?: boolean;\n /**\n * Indicates if header should display the day of week.\n */\n showDayOfWeek?: boolean;\n /**\n * Label shown when date is invalid.\n */\n invalidDateLabel?: string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a;AAC5B,cAAU,OAAO,aAAa;AAAA,EAChC;AAEM,QAAA,kBAA4C,CAAC,OAAO,QAAQ;AAChE,mBAAe,GAAG;AAAA,EACpB;AAEM,QAAA,YAAY,CAAC,gBAAgB,eAAe;AAMhD,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAI;AAAA,MACJ,WAAW,GAAG,QAAQ,MAAM;AAAA,QAC1B,CAAC,QAAQ,OAAO,GAAG;AAAA,MAAA,CACpB;AAAA,MAEA,UAAA;AAAA,QAAA,qCACE,cAAa,EAAA,WAAW,QAAQ,iBAC9B,4BAAkB,KACrB;AAAA,QAEF;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,IAAI,MAAM,SAAS,cAAc;AAAA,YACjC,WAAW,QAAQ;AAAA,YACnB,SAAS;AAAA,cACP,OAAO,QAAQ;AAAA,cACf,sBAAsB,QAAQ;AAAA,cAC9B,OAAO,QAAQ;AAAA,YACjB;AAAA,YACA,aAAa;AAAA,YACb,OAAO;AAAA,YACP,mBAAiB,QAAQ,CAAC,GAAG;AAAA,YAC7B,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,UAAU;AAAA,YACV,WAAW;AAAA,YACX,QAAQ,YAAY,YAAY;AAAA,YAChC,eAAe;AAAA,UAAA;AAAA,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EACF;AAEJ;AAGA,iBAAiB,kBAAkB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarHeader.styles.js","sources":["../../../../src/Calendar/CalendarHeader/CalendarHeader.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvCalendarHeader\", {\n root: {\n paddingBottom: theme.space.sm,\n\n \"&$invalid\": {\n paddingBottom: 0,\n },\n },\n invalid: {},\n headerDayOfWeek: {\n color: theme.colors.secondary_80,\n },\n headerDate: {},\n input: {},\n inputBorderContainer: {},\n invalidMessageStyling: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,oBAAoB;AAAA,EAC7E,MAAM;AAAA,IACJ,eAAe,MAAM,MAAM;AAAA,IAE3B,aAAa;AAAA,MACX,eAAe;AAAA,IACjB;AAAA,EACF;AAAA,EACA,SAAS,CAAC;AAAA,EACV,iBAAiB;AAAA,IACf,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,YAAY,CAAC;AAAA,EACb,OAAO,CAAC;AAAA,EACR,sBAAsB,CAAC;AAAA,EACvB,uBAAuB,CAAC;AAC1B,CAAC;"}
1
+ {"version":3,"file":"CalendarHeader.styles.js","sources":["../../../../src/Calendar/CalendarHeader/CalendarHeader.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvCalendarHeader\", {\n root: {\n paddingBottom: theme.space.sm,\n\n \"&$invalid\": {\n paddingBottom: 0,\n },\n },\n invalid: {},\n headerDayOfWeek: {\n color: theme.colors.secondary_80,\n },\n headerDate: {},\n input: {},\n inputBorderContainer: {},\n invalidMessageStyling: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,oBAAoB;AAAA,EAC7E,MAAM;AAAA,IACJ,eAAe,MAAM,MAAM;AAAA,IAE3B,aAAa;AAAA,MACX,eAAe;AAAA,IAAA;AAAA,EAEnB;AAAA,EACA,SAAS,CAAC;AAAA,EACV,iBAAiB;AAAA,IACf,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,YAAY,CAAC;AAAA,EACb,OAAO,CAAC;AAAA,EACR,sBAAsB,CAAC;AAAA,EACvB,uBAAuB,CAAA;AACzB,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ComposedNavigation.js","sources":["../../../../../src/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.tsx"],"sourcesContent":["import { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { setId } from \"../../../utils/setId\";\nimport { ViewMode } from \"../../enums\";\nimport { VisibilitySelectorActions } from \"../../types\";\nimport { getMonthNamesList } from \"../../utils\";\nimport { Navigation } from \"../Navigation\";\nimport { staticClasses, useClasses } from \"./ComposedNavigation.styles\";\n\nexport { staticClasses as composedNavigationClasses };\n\nexport type HvComposedNavigationClasses = ExtractNames<typeof useClasses>;\n\nexport const HvComposedNavigation = ({\n classes: classesProp,\n id,\n locale,\n onChange,\n onViewModeChange,\n visibleYear,\n visibleMonth,\n ...others\n}: HvComposedNavigationProps) => {\n const { classes } = useClasses(classesProp);\n\n const listMonthNamesLong = getMonthNamesList(locale, \"long\");\n const monthName = listMonthNamesLong[visibleMonth - 1];\n\n return (\n <div className={classes.navigationContainer} {...others}>\n <div className={classes.navigationMonth}>\n <Navigation\n id={setId(id, \"navigation-month\")}\n navigationText={monthName}\n onNavigatePrevious={(event) => {\n onChange?.(event, \"previous_month\");\n }}\n onNavigateNext={(event) => {\n onChange?.(event, \"next_month\");\n }}\n onTextClick={() => {\n onViewModeChange(\"monthly\");\n }}\n className={classes.navigationMonth}\n />\n </div>\n\n <Navigation\n id={setId(id, \"navigation-year\")}\n navigationText={visibleYear.toString()}\n onNavigatePrevious={(event) => {\n onChange?.(event, \"previous_year\");\n }}\n onNavigateNext={(event) => {\n onChange?.(event, \"next_year\");\n }}\n />\n </div>\n );\n};\n\nexport interface HvComposedNavigationProps {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes?: HvComposedNavigationClasses;\n /**\n * Identifier.\n */\n id?: string;\n /**\n * Locale to be used by the calendar.\n */\n locale?: string;\n /**\n * Callback to define the input date.\n */\n onChange?: (event: any, action: VisibilitySelectorActions) => void;\n /**\n * Callback to define the view mode.\n */\n onViewModeChange: (viewMode: ViewMode) => void;\n /**\n * Controls the visible month of the Calendar\n */\n visibleMonth: number;\n /**\n * Controls the visible month of the Calendar\n */\n visibleYear: number;\n}\n"],"names":[],"mappings":";;;;;;AAaO,MAAM,uBAAuB,CAAC;AAAA,EACnC,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAiC;AAC/B,QAAM,EAAE,QAAA,IAAY,WAAW,WAAW;AAEpC,QAAA,qBAAqB,kBAAkB,QAAQ,MAAM;AACrD,QAAA,YAAY,mBAAmB,eAAe,CAAC;AAErD,8BACG,OAAI,EAAA,WAAW,QAAQ,qBAAsB,GAAG,QAC/C,UAAA;AAAA,IAAC,oBAAA,OAAA,EAAI,WAAW,QAAQ,iBACtB,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI,MAAM,IAAI,kBAAkB;AAAA,QAChC,gBAAgB;AAAA,QAChB,oBAAoB,CAAC,UAAU;AAC7B,qBAAW,OAAO,gBAAgB;AAAA,QACpC;AAAA,QACA,gBAAgB,CAAC,UAAU;AACzB,qBAAW,OAAO,YAAY;AAAA,QAChC;AAAA,QACA,aAAa,MAAM;AACjB,2BAAiB,SAAS;AAAA,QAC5B;AAAA,QACA,WAAW,QAAQ;AAAA,MAAA;AAAA,IAAA,GAEvB;AAAA,IAEA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI,MAAM,IAAI,iBAAiB;AAAA,QAC/B,gBAAgB,YAAY,SAAS;AAAA,QACrC,oBAAoB,CAAC,UAAU;AAC7B,qBAAW,OAAO,eAAe;AAAA,QACnC;AAAA,QACA,gBAAgB,CAAC,UAAU;AACzB,qBAAW,OAAO,WAAW;AAAA,QAC/B;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"ComposedNavigation.js","sources":["../../../../../src/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.tsx"],"sourcesContent":["import { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { setId } from \"../../../utils/setId\";\nimport { ViewMode } from \"../../enums\";\nimport { VisibilitySelectorActions } from \"../../types\";\nimport { getMonthNamesList } from \"../../utils\";\nimport { Navigation } from \"../Navigation\";\nimport { staticClasses, useClasses } from \"./ComposedNavigation.styles\";\n\nexport { staticClasses as composedNavigationClasses };\n\nexport type HvComposedNavigationClasses = ExtractNames<typeof useClasses>;\n\nexport const HvComposedNavigation = ({\n classes: classesProp,\n id,\n locale,\n onChange,\n onViewModeChange,\n visibleYear,\n visibleMonth,\n ...others\n}: HvComposedNavigationProps) => {\n const { classes } = useClasses(classesProp);\n\n const listMonthNamesLong = getMonthNamesList(locale, \"long\");\n const monthName = listMonthNamesLong[visibleMonth - 1];\n\n return (\n <div className={classes.navigationContainer} {...others}>\n <div className={classes.navigationMonth}>\n <Navigation\n id={setId(id, \"navigation-month\")}\n navigationText={monthName}\n onNavigatePrevious={(event) => {\n onChange?.(event, \"previous_month\");\n }}\n onNavigateNext={(event) => {\n onChange?.(event, \"next_month\");\n }}\n onTextClick={() => {\n onViewModeChange(\"monthly\");\n }}\n className={classes.navigationMonth}\n />\n </div>\n\n <Navigation\n id={setId(id, \"navigation-year\")}\n navigationText={visibleYear.toString()}\n onNavigatePrevious={(event) => {\n onChange?.(event, \"previous_year\");\n }}\n onNavigateNext={(event) => {\n onChange?.(event, \"next_year\");\n }}\n />\n </div>\n );\n};\n\nexport interface HvComposedNavigationProps {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes?: HvComposedNavigationClasses;\n /**\n * Identifier.\n */\n id?: string;\n /**\n * Locale to be used by the calendar.\n */\n locale?: string;\n /**\n * Callback to define the input date.\n */\n onChange?: (event: any, action: VisibilitySelectorActions) => void;\n /**\n * Callback to define the view mode.\n */\n onViewModeChange: (viewMode: ViewMode) => void;\n /**\n * Controls the visible month of the Calendar\n */\n visibleMonth: number;\n /**\n * Controls the visible month of the Calendar\n */\n visibleYear: number;\n}\n"],"names":[],"mappings":";;;;;;AAaO,MAAM,uBAAuB,CAAC;AAAA,EACnC,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAiC;AAC/B,QAAM,EAAE,QAAA,IAAY,WAAW,WAAW;AAEpC,QAAA,qBAAqB,kBAAkB,QAAQ,MAAM;AACrD,QAAA,YAAY,mBAAmB,eAAe,CAAC;AAErD,8BACG,OAAI,EAAA,WAAW,QAAQ,qBAAsB,GAAG,QAC/C,UAAA;AAAA,IAAC,oBAAA,OAAA,EAAI,WAAW,QAAQ,iBACtB,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI,MAAM,IAAI,kBAAkB;AAAA,QAChC,gBAAgB;AAAA,QAChB,oBAAoB,CAAC,UAAU;AAC7B,qBAAW,OAAO,gBAAgB;AAAA,QACpC;AAAA,QACA,gBAAgB,CAAC,UAAU;AACzB,qBAAW,OAAO,YAAY;AAAA,QAChC;AAAA,QACA,aAAa,MAAM;AACjB,2BAAiB,SAAS;AAAA,QAC5B;AAAA,QACA,WAAW,QAAQ;AAAA,MAAA;AAAA,IAAA,GAEvB;AAAA,IAEA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI,MAAM,IAAI,iBAAiB;AAAA,QAC/B,gBAAgB,YAAY,SAAS;AAAA,QACrC,oBAAoB,CAAC,UAAU;AAC7B,qBAAW,OAAO,eAAe;AAAA,QACnC;AAAA,QACA,gBAAgB,CAAC,UAAU;AACzB,qBAAW,OAAO,WAAW;AAAA,QAAA;AAAA,MAC/B;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ComposedNavigation.styles.js","sources":["../../../../../src/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\n \"HvComposedNavigation\",\n {\n navigationContainer: {\n display: \"flex\",\n justifyContent: \"space-between\",\n paddingBottom: theme.space.xs,\n },\n navigationMonth: {\n minWidth: \"160px\",\n },\n },\n);\n"],"names":[],"mappings":";;AAGa,MAAA,EAAE,eAAe,WAAA,IAAe;AAAA,EAC3C;AAAA,EACA;AAAA,IACE,qBAAqB;AAAA,MACnB,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,eAAe,MAAM,MAAM;AAAA,IAC7B;AAAA,IACA,iBAAiB;AAAA,MACf,UAAU;AAAA,IACZ;AAAA,EACF;AACF;"}
1
+ {"version":3,"file":"ComposedNavigation.styles.js","sources":["../../../../../src/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\n \"HvComposedNavigation\",\n {\n navigationContainer: {\n display: \"flex\",\n justifyContent: \"space-between\",\n paddingBottom: theme.space.xs,\n },\n navigationMonth: {\n minWidth: \"160px\",\n },\n },\n);\n"],"names":[],"mappings":";;AAGa,MAAA,EAAE,eAAe,WAAA,IAAe;AAAA,EAC3C;AAAA,EACA;AAAA,IACE,qBAAqB;AAAA,MACnB,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,eAAe,MAAM,MAAM;AAAA,IAC7B;AAAA,IACA,iBAAiB;AAAA,MACf,UAAU;AAAA,IAAA;AAAA,EACZ;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MonthSelector.js","sources":["../../../../../src/Calendar/CalendarNavigation/MonthSelector/MonthSelector.tsx"],"sourcesContent":["import { HvButtonBase } from \"packages/core/src/ButtonBase\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { ViewMode } from \"../../enums\";\nimport { DateRangeProp, VisibilitySelectorActions } from \"../../types\";\nimport { getMonthNamesList } from \"../../utils\";\nimport { staticClasses, useClasses } from \"./MonthSelector.styles\";\n\nexport { staticClasses as monthSelectorClasses };\n\nexport type HvMonthSelectorClasses = ExtractNames<typeof useClasses>;\n\nexport const HvMonthSelector = ({\n classes: classesProp,\n id,\n locale,\n onChange,\n onViewModeChange,\n rangeMode,\n visibleMonth,\n ...others\n}: HvMonthSelectorProps) => {\n const { classes, cx } = useClasses(classesProp);\n\n const listMonthNamesShort = getMonthNamesList(locale, \"short\");\n\n return (\n <div\n className={cx(classes.calendarMonthlyGrid, {\n [classes.rangeModeWidth]: rangeMode,\n [classes.normalWidth]: !rangeMode,\n })}\n >\n {listMonthNamesShort.map((monthName, index) => (\n <HvButtonBase\n key={monthName}\n className={cx(classes.calendarMonthlyCell, {\n [classes.calendarMonthlyCellSelected]: index + 1 === visibleMonth,\n })}\n onClick={(event) => {\n onChange?.(event, \"month\", index + 1);\n onViewModeChange(\"calendar\");\n }}\n {...others}\n >\n {monthName}\n </HvButtonBase>\n ))}\n </div>\n );\n};\n\nexport interface HvMonthSelectorProps {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes?: HvMonthSelectorClasses;\n /**\n * Identifier.\n */\n id?: string;\n /**\n * Locale to be used by the calendar.\n */\n locale?: string;\n /**\n * Callback to define the input date.\n */\n onChange?: (\n event: any,\n action: VisibilitySelectorActions,\n value: Date | DateRangeProp | number,\n ) => void;\n /**\n * Callback to define the input date.\n */\n onViewModeChange: (viewMode: ViewMode) => void;\n /**\n * Controls the visible month of the Calendar\n */\n visibleMonth: number;\n /**\n * Controls the visible month of the Calendar\n */\n visibleYear?: number;\n rangeMode?: boolean;\n}\n"],"names":[],"mappings":";;;;;AAYO,MAAM,kBAAkB,CAAC;AAAA,EAC9B,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA4B;AAC1B,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAExC,QAAA,sBAAsB,kBAAkB,QAAQ,OAAO;AAG3D,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,GAAG,QAAQ,qBAAqB;AAAA,QACzC,CAAC,QAAQ,cAAc,GAAG;AAAA,QAC1B,CAAC,QAAQ,WAAW,GAAG,CAAC;AAAA,MAAA,CACzB;AAAA,MAEA,UAAoB,oBAAA,IAAI,CAAC,WAAW,UACnC;AAAA,QAAC;AAAA,QAAA;AAAA,UAEC,WAAW,GAAG,QAAQ,qBAAqB;AAAA,YACzC,CAAC,QAAQ,2BAA2B,GAAG,QAAQ,MAAM;AAAA,UAAA,CACtD;AAAA,UACD,SAAS,CAAC,UAAU;AACP,uBAAA,OAAO,SAAS,QAAQ,CAAC;AACpC,6BAAiB,UAAU;AAAA,UAC7B;AAAA,UACC,GAAG;AAAA,UAEH,UAAA;AAAA,QAAA;AAAA,QAVI;AAAA,MAAA,CAYR;AAAA,IAAA;AAAA,EAAA;AAGP;"}
1
+ {"version":3,"file":"MonthSelector.js","sources":["../../../../../src/Calendar/CalendarNavigation/MonthSelector/MonthSelector.tsx"],"sourcesContent":["import { HvButtonBase } from \"packages/core/src/ButtonBase\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { ViewMode } from \"../../enums\";\nimport { DateRangeProp, VisibilitySelectorActions } from \"../../types\";\nimport { getMonthNamesList } from \"../../utils\";\nimport { staticClasses, useClasses } from \"./MonthSelector.styles\";\n\nexport { staticClasses as monthSelectorClasses };\n\nexport type HvMonthSelectorClasses = ExtractNames<typeof useClasses>;\n\nexport const HvMonthSelector = ({\n classes: classesProp,\n id,\n locale,\n onChange,\n onViewModeChange,\n rangeMode,\n visibleMonth,\n ...others\n}: HvMonthSelectorProps) => {\n const { classes, cx } = useClasses(classesProp);\n\n const listMonthNamesShort = getMonthNamesList(locale, \"short\");\n\n return (\n <div\n className={cx(classes.calendarMonthlyGrid, {\n [classes.rangeModeWidth]: rangeMode,\n [classes.normalWidth]: !rangeMode,\n })}\n >\n {listMonthNamesShort.map((monthName, index) => (\n <HvButtonBase\n key={monthName}\n className={cx(classes.calendarMonthlyCell, {\n [classes.calendarMonthlyCellSelected]: index + 1 === visibleMonth,\n })}\n onClick={(event) => {\n onChange?.(event, \"month\", index + 1);\n onViewModeChange(\"calendar\");\n }}\n {...others}\n >\n {monthName}\n </HvButtonBase>\n ))}\n </div>\n );\n};\n\nexport interface HvMonthSelectorProps {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes?: HvMonthSelectorClasses;\n /**\n * Identifier.\n */\n id?: string;\n /**\n * Locale to be used by the calendar.\n */\n locale?: string;\n /**\n * Callback to define the input date.\n */\n onChange?: (\n event: any,\n action: VisibilitySelectorActions,\n value: Date | DateRangeProp | number,\n ) => void;\n /**\n * Callback to define the input date.\n */\n onViewModeChange: (viewMode: ViewMode) => void;\n /**\n * Controls the visible month of the Calendar\n */\n visibleMonth: number;\n /**\n * Controls the visible month of the Calendar\n */\n visibleYear?: number;\n rangeMode?: boolean;\n}\n"],"names":[],"mappings":";;;;;AAYO,MAAM,kBAAkB,CAAC;AAAA,EAC9B,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA4B;AAC1B,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,QAAA,sBAAsB,kBAAkB,QAAQ,OAAO;AAG3D,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,GAAG,QAAQ,qBAAqB;AAAA,QACzC,CAAC,QAAQ,cAAc,GAAG;AAAA,QAC1B,CAAC,QAAQ,WAAW,GAAG,CAAC;AAAA,MAAA,CACzB;AAAA,MAEA,UAAoB,oBAAA,IAAI,CAAC,WAAW,UACnC;AAAA,QAAC;AAAA,QAAA;AAAA,UAEC,WAAW,GAAG,QAAQ,qBAAqB;AAAA,YACzC,CAAC,QAAQ,2BAA2B,GAAG,QAAQ,MAAM;AAAA,UAAA,CACtD;AAAA,UACD,SAAS,CAAC,UAAU;AACP,uBAAA,OAAO,SAAS,QAAQ,CAAC;AACpC,6BAAiB,UAAU;AAAA,UAC7B;AAAA,UACC,GAAG;AAAA,UAEH,UAAA;AAAA,QAAA;AAAA,QAVI;AAAA,MAYR,CAAA;AAAA,IAAA;AAAA,EACH;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"MonthSelector.styles.js","sources":["../../../../../src/Calendar/CalendarNavigation/MonthSelector/MonthSelector.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvMonthSelector\", {\n calendarMonthlyGrid: {\n display: \"grid\",\n gridTemplateColumns: \"repeat(3, 1fr)\",\n zIndex: \"10\",\n alignContent: \"center\",\n },\n rangeModeWidth: {},\n normalWidth: {},\n calendarMonthlyCell: {\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n height: \"40px\",\n width: \"92px\",\n },\n calendarMonthlyCellSelected: {\n backgroundColor: theme.colors.atmo3,\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,mBAAmB;AAAA,EAC5E,qBAAqB;AAAA,IACnB,SAAS;AAAA,IACT,qBAAqB;AAAA,IACrB,QAAQ;AAAA,IACR,cAAc;AAAA,EAChB;AAAA,EACA,gBAAgB,CAAC;AAAA,EACjB,aAAa,CAAC;AAAA,EACd,qBAAqB;AAAA,IACnB,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAAA,EACA,6BAA6B;AAAA,IAC3B,iBAAiB,MAAM,OAAO;AAAA,EAChC;AACF,CAAC;"}
1
+ {"version":3,"file":"MonthSelector.styles.js","sources":["../../../../../src/Calendar/CalendarNavigation/MonthSelector/MonthSelector.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvMonthSelector\", {\n calendarMonthlyGrid: {\n display: \"grid\",\n gridTemplateColumns: \"repeat(3, 1fr)\",\n zIndex: \"10\",\n alignContent: \"center\",\n },\n rangeModeWidth: {},\n normalWidth: {},\n calendarMonthlyCell: {\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n height: \"40px\",\n width: \"92px\",\n },\n calendarMonthlyCellSelected: {\n backgroundColor: theme.colors.atmo3,\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,mBAAmB;AAAA,EAC5E,qBAAqB;AAAA,IACnB,SAAS;AAAA,IACT,qBAAqB;AAAA,IACrB,QAAQ;AAAA,IACR,cAAc;AAAA,EAChB;AAAA,EACA,gBAAgB,CAAC;AAAA,EACjB,aAAa,CAAC;AAAA,EACd,qBAAqB;AAAA,IACnB,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAAA,EACA,6BAA6B;AAAA,IAC3B,iBAAiB,MAAM,OAAO;AAAA,EAAA;AAElC,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Navigation.js","sources":["../../../../../src/Calendar/CalendarNavigation/Navigation/Navigation.tsx"],"sourcesContent":["import {\n DropLeftXS as DropLeftIcon,\n DropRightXS as DropRightIcon,\n} from \"@hitachivantara/uikit-react-icons\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButton } from \"../../../Button\";\nimport { HvBaseProps } from \"../../../types/generic\";\nimport { setId } from \"../../../utils/setId\";\nimport { staticClasses, useClasses } from \"./Navigation.styles\";\n\nexport { staticClasses as navigationClasses };\n\nexport type HvNavigationClasses = ExtractNames<typeof useClasses>;\n\nexport const Navigation = ({\n id,\n classes: classesProp,\n onNavigatePrevious,\n onNavigateNext,\n onTextClick,\n navigationText = \"n/a\",\n isPreviousEnabled = true,\n isNextEnabled = true,\n}: NavigationProps) => {\n const { classes, cx } = useClasses(classesProp);\n\n return (\n <div className={classes.root}>\n <HvButton\n icon\n disabled={!isPreviousEnabled}\n aria-label=\"Previous\"\n id={setId(id, \"left\")}\n className={cx(classes.icon, {\n [classes.disabled]: !isPreviousEnabled,\n })}\n onClick={onNavigatePrevious}\n >\n <DropLeftIcon />\n </HvButton>\n\n <HvButton\n id={id}\n variant=\"secondaryGhost\"\n onClick={onTextClick}\n component={onTextClick ? \"button\" : \"div\"}\n className={cx(classes.text, {\n [classes.textWithoutHover]: !onTextClick,\n })}\n >\n {navigationText}\n </HvButton>\n\n <HvButton\n icon\n disabled={!isNextEnabled}\n aria-label=\"Next\"\n id={setId(id, \"right\")}\n className={cx(classes.icon, {\n [classes.disabled]: !isNextEnabled,\n })}\n onClick={onNavigateNext}\n >\n <DropRightIcon />\n </HvButton>\n </div>\n );\n};\n\nexport interface NavigationProps extends HvBaseProps {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes?: HvNavigationClasses;\n /**\n * A function to be executed whenever the navigate previous action is triggered.\n */\n onNavigatePrevious: (event: React.MouseEvent<HTMLElement>) => void;\n /**\n * A function to be executed whenever the navigate next action is triggered.\n */\n onNavigateNext: (event: React.MouseEvent<HTMLElement>) => void;\n /**\n * A function to be executed whenever the text is clicked.\n */\n onTextClick?: () => void;\n /**\n * The text that will be shown between the navigation buttons.\n */\n navigationText?: string;\n /**\n * Flag stating if the previous button should be enabled or disabled.\n */\n isPreviousEnabled?: boolean;\n /**\n * Flag stating if the next button should be enabled or disabled.\n */\n isNextEnabled?: boolean;\n}\n"],"names":["DropLeftIcon","DropRightIcon"],"mappings":";;;;;;AAeO,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,gBAAgB;AAClB,MAAuB;AACrB,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAE9C,SACG,qBAAA,OAAA,EAAI,WAAW,QAAQ,MACtB,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAI;AAAA,QACJ,UAAU,CAAC;AAAA,QACX,cAAW;AAAA,QACX,IAAI,MAAM,IAAI,MAAM;AAAA,QACpB,WAAW,GAAG,QAAQ,MAAM;AAAA,UAC1B,CAAC,QAAQ,QAAQ,GAAG,CAAC;AAAA,QAAA,CACtB;AAAA,QACD,SAAS;AAAA,QAET,8BAACA,YAAa,EAAA;AAAA,MAAA;AAAA,IAChB;AAAA,IAEA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,SAAQ;AAAA,QACR,SAAS;AAAA,QACT,WAAW,cAAc,WAAW;AAAA,QACpC,WAAW,GAAG,QAAQ,MAAM;AAAA,UAC1B,CAAC,QAAQ,gBAAgB,GAAG,CAAC;AAAA,QAAA,CAC9B;AAAA,QAEA,UAAA;AAAA,MAAA;AAAA,IACH;AAAA,IAEA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAI;AAAA,QACJ,UAAU,CAAC;AAAA,QACX,cAAW;AAAA,QACX,IAAI,MAAM,IAAI,OAAO;AAAA,QACrB,WAAW,GAAG,QAAQ,MAAM;AAAA,UAC1B,CAAC,QAAQ,QAAQ,GAAG,CAAC;AAAA,QAAA,CACtB;AAAA,QACD,SAAS;AAAA,QAET,8BAACC,aAAc,EAAA;AAAA,MAAA;AAAA,IACjB;AAAA,EACF,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"Navigation.js","sources":["../../../../../src/Calendar/CalendarNavigation/Navigation/Navigation.tsx"],"sourcesContent":["import {\n DropLeftXS as DropLeftIcon,\n DropRightXS as DropRightIcon,\n} from \"@hitachivantara/uikit-react-icons\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButton } from \"../../../Button\";\nimport { HvBaseProps } from \"../../../types/generic\";\nimport { setId } from \"../../../utils/setId\";\nimport { staticClasses, useClasses } from \"./Navigation.styles\";\n\nexport { staticClasses as navigationClasses };\n\nexport type HvNavigationClasses = ExtractNames<typeof useClasses>;\n\nexport const Navigation = ({\n id,\n classes: classesProp,\n onNavigatePrevious,\n onNavigateNext,\n onTextClick,\n navigationText = \"n/a\",\n isPreviousEnabled = true,\n isNextEnabled = true,\n}: NavigationProps) => {\n const { classes, cx } = useClasses(classesProp);\n\n return (\n <div className={classes.root}>\n <HvButton\n icon\n disabled={!isPreviousEnabled}\n aria-label=\"Previous\"\n id={setId(id, \"left\")}\n className={cx(classes.icon, {\n [classes.disabled]: !isPreviousEnabled,\n })}\n onClick={onNavigatePrevious}\n >\n <DropLeftIcon />\n </HvButton>\n\n <HvButton\n id={id}\n variant=\"secondaryGhost\"\n onClick={onTextClick}\n component={onTextClick ? \"button\" : \"div\"}\n className={cx(classes.text, {\n [classes.textWithoutHover]: !onTextClick,\n })}\n >\n {navigationText}\n </HvButton>\n\n <HvButton\n icon\n disabled={!isNextEnabled}\n aria-label=\"Next\"\n id={setId(id, \"right\")}\n className={cx(classes.icon, {\n [classes.disabled]: !isNextEnabled,\n })}\n onClick={onNavigateNext}\n >\n <DropRightIcon />\n </HvButton>\n </div>\n );\n};\n\nexport interface NavigationProps extends HvBaseProps {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes?: HvNavigationClasses;\n /**\n * A function to be executed whenever the navigate previous action is triggered.\n */\n onNavigatePrevious: (event: React.MouseEvent<HTMLElement>) => void;\n /**\n * A function to be executed whenever the navigate next action is triggered.\n */\n onNavigateNext: (event: React.MouseEvent<HTMLElement>) => void;\n /**\n * A function to be executed whenever the text is clicked.\n */\n onTextClick?: () => void;\n /**\n * The text that will be shown between the navigation buttons.\n */\n navigationText?: string;\n /**\n * Flag stating if the previous button should be enabled or disabled.\n */\n isPreviousEnabled?: boolean;\n /**\n * Flag stating if the next button should be enabled or disabled.\n */\n isNextEnabled?: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"file":"Navigation.styles.js","sources":["../../../../../src/Calendar/CalendarNavigation/Navigation/Navigation.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvNavigation\", {\n root: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: theme.space.xs,\n },\n icon: {},\n disabled: {},\n text: {\n minWidth: \"unset\",\n flex: 1,\n color: theme.colors.secondary,\n fontWeight: theme.typography.body.fontWeight,\n padding: 0,\n },\n textWithoutHover: {\n pointerEvents: \"none\",\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,gBAAgB;AAAA,EACzE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,KAAK,MAAM,MAAM;AAAA,EACnB;AAAA,EACA,MAAM,CAAC;AAAA,EACP,UAAU,CAAC;AAAA,EACX,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO,MAAM,OAAO;AAAA,IACpB,YAAY,MAAM,WAAW,KAAK;AAAA,IAClC,SAAS;AAAA,EACX;AAAA,EACA,kBAAkB;AAAA,IAChB,eAAe;AAAA,EACjB;AACF,CAAC;"}
1
+ {"version":3,"file":"Navigation.styles.js","sources":["../../../../../src/Calendar/CalendarNavigation/Navigation/Navigation.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvNavigation\", {\n root: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: theme.space.xs,\n },\n icon: {},\n disabled: {},\n text: {\n minWidth: \"unset\",\n flex: 1,\n color: theme.colors.secondary,\n fontWeight: theme.typography.body.fontWeight,\n padding: 0,\n },\n textWithoutHover: {\n pointerEvents: \"none\",\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,gBAAgB;AAAA,EACzE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,KAAK,MAAM,MAAM;AAAA,EACnB;AAAA,EACA,MAAM,CAAC;AAAA,EACP,UAAU,CAAC;AAAA,EACX,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO,MAAM,OAAO;AAAA,IACpB,YAAY,MAAM,WAAW,KAAK;AAAA,IAClC,SAAS;AAAA,EACX;AAAA,EACA,kBAAkB;AAAA,IAChB,eAAe;AAAA,EAAA;AAEnB,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarCell.js","sources":["../../../../src/Calendar/SingleCalendar/CalendarCell.tsx"],"sourcesContent":["import { useRef } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButtonBase, HvButtonBaseProps } from \"../../ButtonBase\";\nimport { HvTypography } from \"../../Typography\";\nimport CalendarModel from \"../model\";\nimport { DateRangeProp } from \"../types\";\nimport {\n checkIfDateIsDisabled,\n dateInProvidedValueRange,\n isDateRangeProp,\n isSameDay,\n isSameMonth,\n} from \"../utils\";\nimport { staticClasses, useClasses } from \"./CalendarCell.styles\";\n\nexport { staticClasses as calendarCellClasses };\n\nexport type HvCalendarCellClasses = ExtractNames<typeof useClasses>;\n\nexport const HvCalendarCell = (props: HvCalendarCellProps) => {\n const {\n classes: classesProp,\n onChange,\n calendarValue,\n firstDayOfCurrentMonth,\n value,\n isDateSelectionMode,\n today,\n locale,\n minimumDate,\n maximumDate,\n rangeMode = false,\n ...others\n } = useDefaultProps(\"HvCalendarCell\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const buttonEl = useRef<HTMLButtonElement>(null);\n\n const startDate = isDateRangeProp(calendarValue)\n ? calendarValue.startDate\n : undefined;\n const endDate = isDateRangeProp(calendarValue)\n ? calendarValue.endDate\n : undefined;\n const isCellToday = isSameDay(value, today);\n const isCellSelected = isSameDay(calendarValue, value);\n const inMonth = isSameMonth(value, firstDayOfCurrentMonth);\n const isCellAfterStartingDate =\n rangeMode && value && startDate ? value >= startDate : false;\n const isCellStartingDate = rangeMode ? isSameDay(value, startDate) : false;\n const isDateInSelectionRange =\n calendarValue && rangeMode\n ? dateInProvidedValueRange(value, calendarValue)\n : false;\n const isDateDisabled = checkIfDateIsDisabled(value, minimumDate, maximumDate);\n const startBookend = isSameDay(startDate, value);\n const endBookend = isSameDay(endDate, value);\n const isSelecting = isDateSelectionMode && isCellAfterStartingDate;\n\n const handleClick = (event: React.SyntheticEvent) => {\n if (value) {\n onChange?.(event, value);\n if (buttonEl.current) setTimeout(() => buttonEl?.current?.focus());\n }\n };\n\n const renderDate = () => (\n <HvButtonBase\n ref={buttonEl}\n className={classes.cellContainer}\n onClick={handleClick}\n disabled={isDateDisabled || !inMonth}\n data-in-month={inMonth}\n {...others}\n >\n <HvTypography\n component=\"span\"\n variant={isCellToday ? \"label\" : \"body\"}\n className={cx(classes.calendarDate, {\n [classes.calendarDateSelected]: inMonth && isCellSelected,\n [classes.calendarDateNotInMonth]: !inMonth,\n [classes.calendarDateInSelectionRange]:\n inMonth && rangeMode && isDateInSelectionRange,\n [classes.calendarDateDisabled]: isDateDisabled,\n [classes.startBookend]:\n inMonth &&\n ((startBookend && rangeMode) ||\n (isCellStartingDate && isDateSelectionMode)),\n [classes.endBookend]: inMonth && endBookend && rangeMode,\n })}\n >\n {value?.getDate()}\n </HvTypography>\n </HvButtonBase>\n );\n\n return (\n <div\n className={cx(classes.dateWrapper, {\n [classes.cellsInRange]: inMonth && rangeMode && isSelecting,\n [classes.cellsOutsideRange]: rangeMode && !isSelecting,\n })}\n data-calendar-cell=\"calendarCell\"\n >\n {renderDate()}\n </div>\n );\n};\n\nexport interface HvCalendarCellProps\n extends Omit<HvButtonBaseProps, \"value\" | \"classes\" | \"onChange\"> {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes?: HvCalendarCellClasses;\n /**\n * The text to be shown on the main part of the header.\n */\n calendarValue?: string | Date | DateRangeProp;\n /**\n * The text to be shown on the main part of the header.\n */\n value?: Date;\n /**\n * Locale to be used by the calendar.\n */\n locale?: string;\n /**\n * Callback to define the input date.\n */\n onChange?: (event: React.SyntheticEvent, value: Date | DateRangeProp) => void;\n /**\n * Callback to handle input onFocus.\n */\n onFocus?: React.FocusEventHandler<any>;\n\n calendarModel?: CalendarModel;\n\n today?: Date;\n minimumDate?: Date;\n maximumDate?: Date;\n firstDayOfCurrentMonth?: Date;\n isDateSelectionMode?: boolean;\n rangeMode?: boolean;\n tabIndex?: number;\n}\n\nexport default HvCalendarCell;\n"],"names":[],"mappings":";;;;;;;;AAuBa,MAAA,iBAAiB,CAAC,UAA+B;AACtD,QAAA;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,IACD,gBAAgB,kBAAkB,KAAK;AAE3C,QAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAExC,QAAA,WAAW,OAA0B,IAAI;AAE/C,QAAM,YAAY,gBAAgB,aAAa,IAC3C,cAAc,YACd;AACJ,QAAM,UAAU,gBAAgB,aAAa,IACzC,cAAc,UACd;AACE,QAAA,cAAc,UAAU,OAAO,KAAK;AACpC,QAAA,iBAAiB,UAAU,eAAe,KAAK;AAC/C,QAAA,UAAU,YAAY,OAAO,sBAAsB;AACzD,QAAM,0BACJ,aAAa,SAAS,YAAY,SAAS,YAAY;AACzD,QAAM,qBAAqB,YAAY,UAAU,OAAO,SAAS,IAAI;AACrE,QAAM,yBACJ,iBAAiB,YACb,yBAAyB,OAAO,aAAa,IAC7C;AACN,QAAM,iBAAiB,sBAA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B;"}
1
+ {"version":3,"file":"CalendarCell.js","sources":["../../../../src/Calendar/SingleCalendar/CalendarCell.tsx"],"sourcesContent":["import { useRef } from \"react\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButtonBase, HvButtonBaseProps } from \"../../ButtonBase\";\nimport { HvTypography } from \"../../Typography\";\nimport CalendarModel from \"../model\";\nimport { DateRangeProp } from \"../types\";\nimport {\n checkIfDateIsDisabled,\n dateInProvidedValueRange,\n isDateRangeProp,\n isSameDay,\n isSameMonth,\n} from \"../utils\";\nimport { staticClasses, useClasses } from \"./CalendarCell.styles\";\n\nexport { staticClasses as calendarCellClasses };\n\nexport type HvCalendarCellClasses = ExtractNames<typeof useClasses>;\n\nexport const HvCalendarCell = (props: HvCalendarCellProps) => {\n const {\n classes: classesProp,\n onChange,\n calendarValue,\n firstDayOfCurrentMonth,\n value,\n isDateSelectionMode,\n today,\n locale,\n minimumDate,\n maximumDate,\n rangeMode = false,\n ...others\n } = useDefaultProps(\"HvCalendarCell\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const buttonEl = useRef<HTMLButtonElement>(null);\n\n const startDate = isDateRangeProp(calendarValue)\n ? calendarValue.startDate\n : undefined;\n const endDate = isDateRangeProp(calendarValue)\n ? calendarValue.endDate\n : undefined;\n const isCellToday = isSameDay(value, today);\n const isCellSelected = isSameDay(calendarValue, value);\n const inMonth = isSameMonth(value, firstDayOfCurrentMonth);\n const isCellAfterStartingDate =\n rangeMode && value && startDate ? value >= startDate : false;\n const isCellStartingDate = rangeMode ? isSameDay(value, startDate) : false;\n const isDateInSelectionRange =\n calendarValue && rangeMode\n ? dateInProvidedValueRange(value, calendarValue)\n : false;\n const isDateDisabled = checkIfDateIsDisabled(value, minimumDate, maximumDate);\n const startBookend = isSameDay(startDate, value);\n const endBookend = isSameDay(endDate, value);\n const isSelecting = isDateSelectionMode && isCellAfterStartingDate;\n\n const handleClick = (event: React.SyntheticEvent) => {\n if (value) {\n onChange?.(event, value);\n if (buttonEl.current) setTimeout(() => buttonEl?.current?.focus());\n }\n };\n\n const renderDate = () => (\n <HvButtonBase\n ref={buttonEl}\n className={classes.cellContainer}\n onClick={handleClick}\n disabled={isDateDisabled || !inMonth}\n data-in-month={inMonth}\n {...others}\n >\n <HvTypography\n component=\"span\"\n variant={isCellToday ? \"label\" : \"body\"}\n className={cx(classes.calendarDate, {\n [classes.calendarDateSelected]: inMonth && isCellSelected,\n [classes.calendarDateNotInMonth]: !inMonth,\n [classes.calendarDateInSelectionRange]:\n inMonth && rangeMode && isDateInSelectionRange,\n [classes.calendarDateDisabled]: isDateDisabled,\n [classes.startBookend]:\n inMonth &&\n ((startBookend && rangeMode) ||\n (isCellStartingDate && isDateSelectionMode)),\n [classes.endBookend]: inMonth && endBookend && rangeMode,\n })}\n >\n {value?.getDate()}\n </HvTypography>\n </HvButtonBase>\n );\n\n return (\n <div\n className={cx(classes.dateWrapper, {\n [classes.cellsInRange]: inMonth && rangeMode && isSelecting,\n [classes.cellsOutsideRange]: rangeMode && !isSelecting,\n })}\n data-calendar-cell=\"calendarCell\"\n >\n {renderDate()}\n </div>\n );\n};\n\nexport interface HvCalendarCellProps\n extends Omit<HvButtonBaseProps, \"value\" | \"classes\" | \"onChange\"> {\n /**\n * A Jss Object used to override or extend the component styles.\n */\n classes?: HvCalendarCellClasses;\n /**\n * The text to be shown on the main part of the header.\n */\n calendarValue?: string | Date | DateRangeProp;\n /**\n * The text to be shown on the main part of the header.\n */\n value?: Date;\n /**\n * Locale to be used by the calendar.\n */\n locale?: string;\n /**\n * Callback to define the input date.\n */\n onChange?: (event: React.SyntheticEvent, value: Date | DateRangeProp) => void;\n /**\n * Callback to handle input onFocus.\n */\n onFocus?: React.FocusEventHandler<any>;\n\n calendarModel?: CalendarModel;\n\n today?: Date;\n minimumDate?: Date;\n maximumDate?: Date;\n firstDayOfCurrentMonth?: Date;\n isDateSelectionMode?: boolean;\n rangeMode?: boolean;\n tabIndex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AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAU;AAAA,UACV,SAAS,cAAc,UAAU;AAAA,UACjC,WAAW,GAAG,QAAQ,cAAc;AAAA,YAClC,CAAC,QAAQ,oBAAoB,GAAG,WAAW;AAAA,YAC3C,CAAC,QAAQ,sBAAsB,GAAG,CAAC;AAAA,YACnC,CAAC,QAAQ,4BAA4B,GACnC,WAAW,aAAa;AAAA,YAC1B,CAAC,QAAQ,oBAAoB,GAAG;AAAA,YAChC,CAAC,QAAQ,YAAY,GACnB,YACE,gBAAgB,aACf,sBAAsB;AAAA,YAC3B,CAAC,QAAQ,UAAU,GAAG,WAAW,cAAc;AAAA,UAAA,CAChD;AAAA,UAEA,iBAAO,QAAQ;AAAA,QAAA;AAAA,MAAA;AAAA,IAClB;AAAA,EACF;AAIA,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,GAAG,QAAQ,aAAa;AAAA,QACjC,CAAC,QAAQ,YAAY,GAAG,WAAW,aAAa;AAAA,QAChD,CAAC,QAAQ,iBAAiB,GAAG,aAAa,CAAC;AAAA,MAAA,CAC5C;AAAA,MACD,sBAAmB;AAAA,MAElB,UAAW,WAAA;AAAA,IAAA;AAAA,EACd;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarCell.styles.js","sources":["../../../../src/Calendar/SingleCalendar/CalendarCell.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nconst hover = {\n backgroundColor: theme.colors.containerBackgroundHover,\n cursor: \"pointer\",\n};\n\nexport const { staticClasses, useClasses } = createClasses(\"HvCalendarCell\", {\n cellContainer: {},\n calendarDate: {\n display: \"flex\",\n justifyContent: \"center\",\n flexDirection: \"column\",\n textAlign: \"center\",\n height: \"40px\",\n width: \"40px\",\n },\n calendarDateSelected: {\n backgroundColor: theme.colors.atmo3,\n color: theme.colors.secondary,\n \"&:hover\": {\n ...hover,\n },\n },\n calendarDateNotInMonth: {\n color: theme.colors.secondary_60,\n cursor: \"not-allowed\",\n },\n calendarDateInSelectionRange: {\n backgroundColor: theme.colors.atmo3,\n },\n calendarDateDisabled: {\n color: theme.colors.secondary_60,\n cursor: \"no-drop\",\n },\n startBookend: {\n borderLeft: `1px solid ${theme.colors.secondary}`,\n },\n endBookend: {\n borderRight: `1px solid ${theme.colors.secondary}`,\n },\n dateWrapper: {\n width: \"40px\",\n height: \"40px\",\n },\n cellsInRange: {\n \"&:focus\": {\n outside: \"none\",\n },\n },\n cellsOutsideRange: {\n \"&:focus\": {\n outside: \"none\",\n },\n },\n});\n"],"names":[],"mappings":";;AAGA,MAAM,QAAQ;AAAA,EACZ,iBAAiB,MAAM,OAAO;AAAA,EAC9B,QAAQ;AACV;AAEO,MAAM,EAAE,eAAe,eAAe,cAAc,kBAAkB;AAAA,EAC3E,eAAe,CAAC;AAAA,EAChB,cAAc;AAAA,IACZ,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAAA,EACA,sBAAsB;AAAA,IACpB,iBAAiB,MAAM,OAAO;AAAA,IAC9B,OAAO,MAAM,OAAO;AAAA,IACpB,WAAW;AAAA,MACT,GAAG;AAAA,IACL;AAAA,EACF;AAAA,EACA,wBAAwB;AAAA,IACtB,OAAO,MAAM,OAAO;AAAA,IACpB,QAAQ;AAAA,EACV;AAAA,EACA,8BAA8B;AAAA,IAC5B,iBAAiB,MAAM,OAAO;AAAA,EAChC;AAAA,EACA,sBAAsB;AAAA,IACpB,OAAO,MAAM,OAAO;AAAA,IACpB,QAAQ;AAAA,EACV;AAAA,EACA,cAAc;AAAA,IACZ,YAAY,aAAa,MAAM,OAAO,SAAS;AAAA,EACjD;AAAA,EACA,YAAY;AAAA,IACV,aAAa,aAAa,MAAM,OAAO,SAAS;AAAA,EAClD;AAAA,EACA,aAAa;AAAA,IACX,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AAAA,EACA,cAAc;AAAA,IACZ,WAAW;AAAA,MACT,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,mBAAmB;AAAA,IACjB,WAAW;AAAA,MACT,SAAS;AAAA,IACX;AAAA,EACF;AACF,CAAC;"}
1
+ {"version":3,"file":"CalendarCell.styles.js","sources":["../../../../src/Calendar/SingleCalendar/CalendarCell.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nconst hover = {\n backgroundColor: theme.colors.containerBackgroundHover,\n cursor: \"pointer\",\n};\n\nexport const { staticClasses, useClasses } = createClasses(\"HvCalendarCell\", {\n cellContainer: {},\n calendarDate: {\n display: \"flex\",\n justifyContent: \"center\",\n flexDirection: \"column\",\n textAlign: \"center\",\n height: \"40px\",\n width: \"40px\",\n },\n calendarDateSelected: {\n backgroundColor: theme.colors.atmo3,\n color: theme.colors.secondary,\n \"&:hover\": {\n ...hover,\n },\n },\n calendarDateNotInMonth: {\n color: theme.colors.secondary_60,\n cursor: \"not-allowed\",\n },\n calendarDateInSelectionRange: {\n backgroundColor: theme.colors.atmo3,\n },\n calendarDateDisabled: {\n color: theme.colors.secondary_60,\n cursor: \"no-drop\",\n },\n startBookend: {\n borderLeft: `1px solid ${theme.colors.secondary}`,\n },\n endBookend: {\n borderRight: `1px solid ${theme.colors.secondary}`,\n },\n dateWrapper: {\n width: \"40px\",\n height: \"40px\",\n },\n cellsInRange: {\n \"&:focus\": {\n outside: \"none\",\n },\n },\n cellsOutsideRange: {\n \"&:focus\": {\n outside: \"none\",\n },\n },\n});\n"],"names":[],"mappings":";;AAGA,MAAM,QAAQ;AAAA,EACZ,iBAAiB,MAAM,OAAO;AAAA,EAC9B,QAAQ;AACV;AAEO,MAAM,EAAE,eAAe,eAAe,cAAc,kBAAkB;AAAA,EAC3E,eAAe,CAAC;AAAA,EAChB,cAAc;AAAA,IACZ,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAAA,EACA,sBAAsB;AAAA,IACpB,iBAAiB,MAAM,OAAO;AAAA,IAC9B,OAAO,MAAM,OAAO;AAAA,IACpB,WAAW;AAAA,MACT,GAAG;AAAA,IAAA;AAAA,EAEP;AAAA,EACA,wBAAwB;AAAA,IACtB,OAAO,MAAM,OAAO;AAAA,IACpB,QAAQ;AAAA,EACV;AAAA,EACA,8BAA8B;AAAA,IAC5B,iBAAiB,MAAM,OAAO;AAAA,EAChC;AAAA,EACA,sBAAsB;AAAA,IACpB,OAAO,MAAM,OAAO;AAAA,IACpB,QAAQ;AAAA,EACV;AAAA,EACA,cAAc;AAAA,IACZ,YAAY,aAAa,MAAM,OAAO,SAAS;AAAA,EACjD;AAAA,EACA,YAAY;AAAA,IACV,aAAa,aAAa,MAAM,OAAO,SAAS;AAAA,EAClD;AAAA,EACA,aAAa;AAAA,IACX,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AAAA,EACA,cAAc;AAAA,IACZ,WAAW;AAAA,MACT,SAAS;AAAA,IAAA;AAAA,EAEb;AAAA,EACA,mBAAmB;AAAA,IACjB,WAAW;AAAA,MACT,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SingleCalendar.js","sources":["../../../../src/Calendar/SingleCalendar/SingleCalendar.tsx"],"sourcesContent":["import { useMemo, useState } from \"react\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvPanel } from \"../../Panel\";\nimport { HvTypography } from \"../../Typography\";\nimport { isKey } from \"../../utils/keyboardUtils\";\nimport { setId } from \"../../utils/setId\";\nimport { HvCalendarHeader } from \"../CalendarHeader/CalendarHeader\";\nimport { HvComposedNavigation, HvMonthSelector } from \"../CalendarNavigation\";\nimport { ViewMode } from \"../enums\";\nimport { generateCalendarModel } from \"../model\";\nimport { DateRangeProp, VisibilitySelectorActions } from \"../types\";\nimport { getWeekdayNamesList, isDate, isRange } from \"../utils\";\nimport { HvCalendarCell } from \"./CalendarCell\";\nimport { staticClasses, useClasses } from \"./SingleCalendar.styles\";\n\nexport { staticClasses as singleCalendarClasses };\n\nexport type HvSingleCalendarClasses = ExtractNames<typeof useClasses>;\n\nexport const HvSingleCalendar = ({\n classes: classesProp,\n className,\n id,\n locale = \"en-US\",\n value,\n visibleMonth,\n visibleYear,\n minimumDate,\n maximumDate,\n onChange,\n onInputChange,\n onVisibleDateChange,\n showEndDate,\n showDayOfWeek,\n invalidDateLabel,\n children,\n ...others\n}: HvSingleCalendarProps) => {\n // TODO: refactor this out\n // const { HvCalendarHeader } = useContext(HvFormElementDescriptorsContext);\n\n const { classes, cx } = useClasses(classesProp);\n\n const today = new Date();\n const localValue = value ?? today;\n\n const [calViewMode, setCalViewMode] = useState<ViewMode>(\"calendar\");\n\n const rangeMode = isRange(localValue);\n const isDateSelectionMode = rangeMode && !isDate(localValue.endDate);\n const calModel = rangeMode\n ? generateCalendarModel(localValue.startDate, visibleMonth, visibleYear)\n : generateCalendarModel(localValue, visibleMonth, visibleYear);\n const firstDayOfCurrentMonth = new Date(calModel.year, calModel.month - 1, 1);\n const firstDayOfCurrentMonthTime = firstDayOfCurrentMonth.getTime();\n\n const listWeekdayNames = useMemo(() => getWeekdayNamesList(locale), [locale]);\n\n const handleChange = (event: any, date: Date | DateRangeProp) => {\n event?.preventDefault();\n onChange?.(event, date);\n };\n\n const handleInputChange = (event: any, date: any) => {\n event?.preventDefault();\n onInputChange?.(event, date);\n };\n\n const getNavChild = (event: KeyboardEvent, siblings: any, i: number) => {\n if (isKey(event, \"ArrowLeft\")) return siblings[i - 1];\n if (isKey(event, \"ArrowRight\")) return siblings[i + 1];\n if (isKey(event, \"ArrowUp\")) return siblings[i - 7];\n if (isKey(event, \"ArrowDown\")) return siblings[i + 7];\n return undefined;\n };\n\n const handleKeyDown = (event: any) => {\n // This code is very brittle and should be managed with the focus wrapper\n const el = document?.activeElement;\n const parent = el?.parentElement?.parentElement;\n const siblings =\n parent != null\n ? Array.from(\n parent.getElementsByClassName(classes.cellContainer as string),\n )\n : [];\n const elIndex = el ? siblings.indexOf(el) : 0;\n\n if (isKey(event, \"Enter\")) {\n (el as HTMLElement).focus();\n return;\n }\n\n const child = getNavChild(event, siblings, elIndex);\n\n if (child) {\n const inMonth = child.getAttribute(\"data-in-month\");\n if (inMonth === \"true\") {\n event?.preventDefault();\n child?.focus();\n }\n }\n };\n\n const renderWeekLabel = (dayName: string, index: number) => (\n <HvTypography key={index} variant=\"label\" className={classes.calendarDay}>\n {dayName}\n </HvTypography>\n );\n\n /** Renders the element representing the received date. */\n const renderCalendarDate = (currentDate: Date) => {\n return (\n <HvCalendarCell\n classes={classes}\n key={currentDate.toString()}\n tabIndex={currentDate.getTime() === firstDayOfCurrentMonthTime ? 0 : -1}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n value={currentDate}\n today={today}\n calendarValue={localValue}\n rangeMode={rangeMode}\n isDateSelectionMode={isDateSelectionMode}\n locale={locale}\n firstDayOfCurrentMonth={firstDayOfCurrentMonth}\n maximumDate={maximumDate}\n minimumDate={minimumDate}\n />\n );\n };\n\n return (\n <HvPanel id={id} className={cx(classes.root, className)} {...others}>\n <HvCalendarHeader\n id={setId(id, \"header\")}\n locale={locale}\n onChange={handleInputChange}\n showEndDate={showEndDate && !isDateSelectionMode}\n showDayOfWeek={showDayOfWeek}\n invalidDateLabel={invalidDateLabel}\n />\n {calViewMode === \"calendar\" && (\n <>\n <HvComposedNavigation\n id={id}\n locale={locale}\n onChange={onVisibleDateChange}\n onViewModeChange={setCalViewMode}\n visibleYear={visibleYear || today.getFullYear()}\n visibleMonth={visibleMonth || today.getMonth() + 1}\n />\n <div\n className={classes.calendarGrid}\n // @ts-ignore TODO: review\n aria-controls={HvCalendarHeader?.[0]?.id}\n >\n {listWeekdayNames.map(renderWeekLabel)}\n {calModel.dates.map(renderCalendarDate)}\n </div>\n </>\n )}\n {calViewMode === \"monthly\" && (\n <HvMonthSelector\n id={id}\n locale={locale}\n onChange={onVisibleDateChange}\n onViewModeChange={setCalViewMode}\n visibleMonth={visibleMonth || today.getMonth() + 1}\n rangeMode={rangeMode}\n />\n )}\n </HvPanel>\n );\n};\n\nexport interface HvSingleCalendarProps {\n /**\n * Styles applied from the theme.\n */\n classes?: HvSingleCalendarClasses;\n /**\n * Identifier.\n */\n id?: string;\n /**\n * The class name to add at the root of the single calendar\n */\n className?: string;\n /**\n * The calendar locale.\n *\n */\n locale: string;\n /**\n * Date that the calendar would show.\n */\n value?: string | Date | DateRangeProp;\n /**\n * Date that will be used to know which month and year should be displayed on the calendar. The value of the day is\n * irrelevant.\n */\n visibleDate?: Date;\n /**\n * Controls the visible month of the Calendar\n */\n visibleMonth?: number;\n /**\n * Controls the visible month of the Calendar\n */\n visibleYear?: number;\n /**\n * Callback function to be triggered when the selected date has changed.\n */\n onChange?: (\n event:\n | React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>\n | undefined,\n value: Date | DateRangeProp,\n ) => void;\n /**\n * Callback function to be triggered when the selected date input has changed.\n */\n onInputChange?: (\n event:\n | React.ChangeEvent<\n HTMLTextAreaElement | HTMLInputElement | HTMLButtonElement\n >\n | undefined,\n value: Date | DateRangeProp,\n position?: \"left\" | \"right\",\n ) => void;\n /**\n * Callback function to be triggered when visible date has changed.\n */\n onVisibleDateChange?: (\n event:\n | React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>\n | undefined,\n action: VisibilitySelectorActions,\n value?: Date | DateRangeProp | number,\n ) => void;\n /**\n * The maximum selectable date after this all values are disabled.\n */\n maximumDate?: Date;\n /**\n * The minimum selectable date before this all values are disabled.\n */\n minimumDate?: Date;\n /**\n * Indicates if header should display end date in a date range.\n */\n showEndDate?: boolean;\n /**\n * Indicates if header should display the day of week.\n */\n showDayOfWeek?: boolean;\n /**\n * Content on the upper part of the calendar.\n */\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A,UAAU;AAAA,QACV,aAAa,eAAe,CAAC;AAAA,QAC7B;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,IACC,gBAAgB,cAEb,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA,UAAU;AAAA,UACV,kBAAkB;AAAA,UAClB,aAAa,eAAe,MAAM,YAAY;AAAA,UAC9C,cAAc,gBAAgB,MAAM,SAAa,IAAA;AAAA,QAAA;AAAA,MACnD;AAAA,MACA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAW,QAAQ;AAAA,UAEnB,iBAAe,mBAAmB,CAAC,GAAG;AAAA,UAErC,UAAA;AAAA,YAAA,iBAAiB,IAAI,eAAe;AAAA,YACpC,SAAS,MAAM,IAAI,kBAAkB;AAAA,UAAA;AAAA,QAAA;AAAA,MACxC;AAAA,IAAA,GACF;AAAA,IAED,gBAAgB,aACf;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,UAAU;AAAA,QACV,kBAAkB;AAAA,QAClB,cAAc,gBAAgB,MAAM,SAAa,IAAA;AAAA,QACjD;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"SingleCalendar.js","sources":["../../../../src/Calendar/SingleCalendar/SingleCalendar.tsx"],"sourcesContent":["import { useMemo, useState } from \"react\";\nimport { type ExtractNames } from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvPanel } from \"../../Panel\";\nimport { HvTypography } from \"../../Typography\";\nimport { isKey } from \"../../utils/keyboardUtils\";\nimport { setId } from \"../../utils/setId\";\nimport { HvCalendarHeader } from \"../CalendarHeader/CalendarHeader\";\nimport { HvComposedNavigation, HvMonthSelector } from \"../CalendarNavigation\";\nimport { ViewMode } from \"../enums\";\nimport { generateCalendarModel } from \"../model\";\nimport { DateRangeProp, VisibilitySelectorActions } from \"../types\";\nimport { getWeekdayNamesList, isDate, isRange } from \"../utils\";\nimport { HvCalendarCell } from \"./CalendarCell\";\nimport { staticClasses, useClasses } from \"./SingleCalendar.styles\";\n\nexport { staticClasses as singleCalendarClasses };\n\nexport type HvSingleCalendarClasses = ExtractNames<typeof useClasses>;\n\nexport const HvSingleCalendar = ({\n classes: classesProp,\n className,\n id,\n locale = \"en-US\",\n value,\n visibleMonth,\n visibleYear,\n minimumDate,\n maximumDate,\n onChange,\n onInputChange,\n onVisibleDateChange,\n showEndDate,\n showDayOfWeek,\n invalidDateLabel,\n children,\n ...others\n}: HvSingleCalendarProps) => {\n // TODO: refactor this out\n // const { HvCalendarHeader } = useContext(HvFormElementDescriptorsContext);\n\n const { classes, cx } = useClasses(classesProp);\n\n const today = new Date();\n const localValue = value ?? today;\n\n const [calViewMode, setCalViewMode] = useState<ViewMode>(\"calendar\");\n\n const rangeMode = isRange(localValue);\n const isDateSelectionMode = rangeMode && !isDate(localValue.endDate);\n const calModel = rangeMode\n ? generateCalendarModel(localValue.startDate, visibleMonth, visibleYear)\n : generateCalendarModel(localValue, visibleMonth, visibleYear);\n const firstDayOfCurrentMonth = new Date(calModel.year, calModel.month - 1, 1);\n const firstDayOfCurrentMonthTime = firstDayOfCurrentMonth.getTime();\n\n const listWeekdayNames = useMemo(() => getWeekdayNamesList(locale), [locale]);\n\n const handleChange = (event: any, date: Date | DateRangeProp) => {\n event?.preventDefault();\n onChange?.(event, date);\n };\n\n const handleInputChange = (event: any, date: any) => {\n event?.preventDefault();\n onInputChange?.(event, date);\n };\n\n const getNavChild = (event: KeyboardEvent, siblings: any, i: number) => {\n if (isKey(event, \"ArrowLeft\")) return siblings[i - 1];\n if (isKey(event, \"ArrowRight\")) return siblings[i + 1];\n if (isKey(event, \"ArrowUp\")) return siblings[i - 7];\n if (isKey(event, \"ArrowDown\")) return siblings[i + 7];\n return undefined;\n };\n\n const handleKeyDown = (event: any) => {\n // This code is very brittle and should be managed with the focus wrapper\n const el = document?.activeElement;\n const parent = el?.parentElement?.parentElement;\n const siblings =\n parent != null\n ? Array.from(\n parent.getElementsByClassName(classes.cellContainer as string),\n )\n : [];\n const elIndex = el ? siblings.indexOf(el) : 0;\n\n if (isKey(event, \"Enter\")) {\n (el as HTMLElement).focus();\n return;\n }\n\n const child = getNavChild(event, siblings, elIndex);\n\n if (child) {\n const inMonth = child.getAttribute(\"data-in-month\");\n if (inMonth === \"true\") {\n event?.preventDefault();\n child?.focus();\n }\n }\n };\n\n const renderWeekLabel = (dayName: string, index: number) => (\n <HvTypography key={index} variant=\"label\" className={classes.calendarDay}>\n {dayName}\n </HvTypography>\n );\n\n /** Renders the element representing the received date. */\n const renderCalendarDate = (currentDate: Date) => {\n return (\n <HvCalendarCell\n classes={classes}\n key={currentDate.toString()}\n tabIndex={currentDate.getTime() === firstDayOfCurrentMonthTime ? 0 : -1}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n value={currentDate}\n today={today}\n calendarValue={localValue}\n rangeMode={rangeMode}\n isDateSelectionMode={isDateSelectionMode}\n locale={locale}\n firstDayOfCurrentMonth={firstDayOfCurrentMonth}\n maximumDate={maximumDate}\n minimumDate={minimumDate}\n />\n );\n };\n\n return (\n <HvPanel id={id} className={cx(classes.root, className)} {...others}>\n <HvCalendarHeader\n id={setId(id, \"header\")}\n locale={locale}\n onChange={handleInputChange}\n showEndDate={showEndDate && !isDateSelectionMode}\n showDayOfWeek={showDayOfWeek}\n invalidDateLabel={invalidDateLabel}\n />\n {calViewMode === \"calendar\" && (\n <>\n <HvComposedNavigation\n id={id}\n locale={locale}\n onChange={onVisibleDateChange}\n onViewModeChange={setCalViewMode}\n visibleYear={visibleYear || today.getFullYear()}\n visibleMonth={visibleMonth || today.getMonth() + 1}\n />\n <div\n className={classes.calendarGrid}\n // @ts-ignore TODO: review\n aria-controls={HvCalendarHeader?.[0]?.id}\n >\n {listWeekdayNames.map(renderWeekLabel)}\n {calModel.dates.map(renderCalendarDate)}\n </div>\n </>\n )}\n {calViewMode === \"monthly\" && (\n <HvMonthSelector\n id={id}\n locale={locale}\n onChange={onVisibleDateChange}\n onViewModeChange={setCalViewMode}\n visibleMonth={visibleMonth || today.getMonth() + 1}\n rangeMode={rangeMode}\n />\n )}\n </HvPanel>\n );\n};\n\nexport interface HvSingleCalendarProps {\n /**\n * Styles applied from the theme.\n */\n classes?: HvSingleCalendarClasses;\n /**\n * Identifier.\n */\n id?: string;\n /**\n * The class name to add at the root of the single calendar\n */\n className?: string;\n /**\n * The calendar locale.\n *\n */\n locale: string;\n /**\n * Date that the calendar would show.\n */\n value?: string | Date | DateRangeProp;\n /**\n * Date that will be used to know which month and year should be displayed on the calendar. The value of the day is\n * irrelevant.\n */\n visibleDate?: Date;\n /**\n * Controls the visible month of the Calendar\n */\n visibleMonth?: number;\n /**\n * Controls the visible month of the Calendar\n */\n visibleYear?: number;\n /**\n * Callback function to be triggered when the selected date has changed.\n */\n onChange?: (\n event:\n | React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>\n | undefined,\n value: Date | DateRangeProp,\n ) => void;\n /**\n * Callback function to be triggered when the selected date input has changed.\n */\n onInputChange?: (\n event:\n | React.ChangeEvent<\n HTMLTextAreaElement | HTMLInputElement | HTMLButtonElement\n >\n | undefined,\n value: Date | DateRangeProp,\n position?: \"left\" | \"right\",\n ) => void;\n /**\n * Callback function to be triggered when visible date has changed.\n */\n onVisibleDateChange?: (\n event:\n | React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>\n | undefined,\n action: VisibilitySelectorActions,\n value?: Date | DateRangeProp | number,\n ) => void;\n /**\n * The maximum selectable date after this all values are disabled.\n */\n maximumDate?: Date;\n /**\n * The minimum selectable date before this all values are disabled.\n */\n minimumDate?: Date;\n /**\n * Indicates if header should display end date in a date range.\n */\n showEndDate?: boolean;\n /**\n * Indicates if header should display the day of week.\n */\n showDayOfWeek?: boolean;\n /**\n * Content on the upper part of the calendar.\n */\n children?: React.ReactNode;\n /**\n * Label shown when date is invalid.\n */\n invalidDateLabel?: string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AC;AAAA,QAC7B;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,IACC,gBAAgB,cAEb,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA,UAAU;AAAA,UACV,kBAAkB;AAAA,UAClB,aAAa,eAAe,MAAM,YAAY;AAAA,UAC9C,cAAc,gBAAgB,MAAM,aAAa;AAAA,QAAA;AAAA,MACnD;AAAA,MACA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAW,QAAQ;AAAA,UAEnB,iBAAe,mBAAmB,CAAC,GAAG;AAAA,UAErC,UAAA;AAAA,YAAA,iBAAiB,IAAI,eAAe;AAAA,YACpC,SAAS,MAAM,IAAI,kBAAkB;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACxC,GACF;AAAA,IAED,gBAAgB,aACf;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,UAAU;AAAA,QACV,kBAAkB;AAAA,QAClB,cAAc,gBAAgB,MAAM,SAAa,IAAA;AAAA,QACjD;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GAEJ;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SingleCalendar.styles.js","sources":["../../../../src/Calendar/SingleCalendar/SingleCalendar.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvSingleCalendar\", {\n root: {\n overflow: \"hidden\",\n },\n calendarGrid: {\n display: \"grid\",\n gridTemplateColumns: \"repeat(7, 1fr)\",\n \"& $cellsInRange\": {\n backgroundColor: theme.colors.atmo3,\n \"& $startBookend\": {\n borderLeft: `1px solid ${theme.colors.secondary}`,\n backgroundColor: theme.colors.atmo3,\n \"&:hover\": {\n borderRight: `1px solid ${theme.colors.secondary}`,\n },\n },\n },\n \"&:hover $cellsInRange\": {\n backgroundColor: theme.colors.atmo3,\n \"& $startBookend\": {\n borderLeft: `1px solid ${theme.colors.secondary}`,\n borderRight: \"inherit\",\n },\n },\n \"& $cellsInRange:hover\": {\n backgroundColor: theme.colors.atmo3,\n \"& $calendarDate\": {\n borderRight: `1px solid ${theme.colors.secondary}`,\n },\n },\n \"& $cellsInRange:hover ~ $cellsInRange\": {\n backgroundColor: theme.colors.atmo1, // controls the right side of the hovered range\n },\n \"& $cellsOutsideRange:hover ~ $cellsInRange\": {\n backgroundColor: theme.colors.atmo1, // control the right side when hovering outside of the range\n },\n },\n calendarDay: {\n display: \"flex\",\n justifyContent: \"center\",\n flexDirection: \"column\",\n textAlign: \"center\",\n height: \"40px\",\n width: \"40px\",\n },\n navigationContainer: {},\n focusSelection: {},\n navigationMonth: {},\n calendarDate: {},\n calendarDateNotInMonth: {},\n calendarDateSelected: {},\n calendarDateInvalid: {},\n calendarDateInSelectionRange: {},\n startBookend: {},\n endBookend: {},\n cellsInRange: {\n backgroundColor: theme.colors.atmo3,\n },\n cellsOutsideRange: {},\n cellContainer: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,oBAAoB;AAAA,EAC7E,MAAM;AAAA,IACJ,UAAU;AAAA,EACZ;AAAA,EACA,cAAc;AAAA,IACZ,SAAS;AAAA,IACT,qBAAqB;AAAA,IACrB,mBAAmB;AAAA,MACjB,iBAAiB,MAAM,OAAO;AAAA,MAC9B,mBAAmB;AAAA,QACjB,YAAY,aAAa,MAAM,OAAO,SAAS;AAAA,QAC/C,iBAAiB,MAAM,OAAO;AAAA,QAC9B,WAAW;AAAA,UACT,aAAa,aAAa,MAAM,OAAO,SAAS;AAAA,QAClD;AAAA,MACF;AAAA,IACF;AAAA,IACA,yBAAyB;AAAA,MACvB,iBAAiB,MAAM,OAAO;AAAA,MAC9B,mBAAmB;AAAA,QACjB,YAAY,aAAa,MAAM,OAAO,SAAS;AAAA,QAC/C,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IACA,yBAAyB;AAAA,MACvB,iBAAiB,MAAM,OAAO;AAAA,MAC9B,mBAAmB;AAAA,QACjB,aAAa,aAAa,MAAM,OAAO,SAAS;AAAA,MAClD;AAAA,IACF;AAAA,IACA,yCAAyC;AAAA,MACvC,iBAAiB,MAAM,OAAO;AAAA;AAAA,IAChC;AAAA,IACA,8CAA8C;AAAA,MAC5C,iBAAiB,MAAM,OAAO;AAAA;AAAA,IAChC;AAAA,EACF;AAAA,EACA,aAAa;AAAA,IACX,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAAA,EACA,qBAAqB,CAAC;AAAA,EACtB,gBAAgB,CAAC;AAAA,EACjB,iBAAiB,CAAC;AAAA,EAClB,cAAc,CAAC;AAAA,EACf,wBAAwB,CAAC;AAAA,EACzB,sBAAsB,CAAC;AAAA,EACvB,qBAAqB,CAAC;AAAA,EACtB,8BAA8B,CAAC;AAAA,EAC/B,cAAc,CAAC;AAAA,EACf,YAAY,CAAC;AAAA,EACb,cAAc;AAAA,IACZ,iBAAiB,MAAM,OAAO;AAAA,EAChC;AAAA,EACA,mBAAmB,CAAC;AAAA,EACpB,eAAe,CAAC;AAClB,CAAC;"}
1
+ {"version":3,"file":"SingleCalendar.styles.js","sources":["../../../../src/Calendar/SingleCalendar/SingleCalendar.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvSingleCalendar\", {\n root: {\n overflow: \"hidden\",\n },\n calendarGrid: {\n display: \"grid\",\n gridTemplateColumns: \"repeat(7, 1fr)\",\n \"& $cellsInRange\": {\n backgroundColor: theme.colors.atmo3,\n \"& $startBookend\": {\n borderLeft: `1px solid ${theme.colors.secondary}`,\n backgroundColor: theme.colors.atmo3,\n \"&:hover\": {\n borderRight: `1px solid ${theme.colors.secondary}`,\n },\n },\n },\n \"&:hover $cellsInRange\": {\n backgroundColor: theme.colors.atmo3,\n \"& $startBookend\": {\n borderLeft: `1px solid ${theme.colors.secondary}`,\n borderRight: \"inherit\",\n },\n },\n \"& $cellsInRange:hover\": {\n backgroundColor: theme.colors.atmo3,\n \"& $calendarDate\": {\n borderRight: `1px solid ${theme.colors.secondary}`,\n },\n },\n \"& $cellsInRange:hover ~ $cellsInRange\": {\n backgroundColor: theme.colors.atmo1, // controls the right side of the hovered range\n },\n \"& $cellsOutsideRange:hover ~ $cellsInRange\": {\n backgroundColor: theme.colors.atmo1, // control the right side when hovering outside of the range\n },\n },\n calendarDay: {\n display: \"flex\",\n justifyContent: \"center\",\n flexDirection: \"column\",\n textAlign: \"center\",\n height: \"40px\",\n width: \"40px\",\n },\n navigationContainer: {},\n focusSelection: {},\n navigationMonth: {},\n calendarDate: {},\n calendarDateNotInMonth: {},\n calendarDateSelected: {},\n calendarDateInvalid: {},\n calendarDateInSelectionRange: {},\n startBookend: {},\n endBookend: {},\n cellsInRange: {\n backgroundColor: theme.colors.atmo3,\n },\n cellsOutsideRange: {},\n cellContainer: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,oBAAoB;AAAA,EAC7E,MAAM;AAAA,IACJ,UAAU;AAAA,EACZ;AAAA,EACA,cAAc;AAAA,IACZ,SAAS;AAAA,IACT,qBAAqB;AAAA,IACrB,mBAAmB;AAAA,MACjB,iBAAiB,MAAM,OAAO;AAAA,MAC9B,mBAAmB;AAAA,QACjB,YAAY,aAAa,MAAM,OAAO,SAAS;AAAA,QAC/C,iBAAiB,MAAM,OAAO;AAAA,QAC9B,WAAW;AAAA,UACT,aAAa,aAAa,MAAM,OAAO,SAAS;AAAA,QAAA;AAAA,MAClD;AAAA,IAEJ;AAAA,IACA,yBAAyB;AAAA,MACvB,iBAAiB,MAAM,OAAO;AAAA,MAC9B,mBAAmB;AAAA,QACjB,YAAY,aAAa,MAAM,OAAO,SAAS;AAAA,QAC/C,aAAa;AAAA,MAAA;AAAA,IAEjB;AAAA,IACA,yBAAyB;AAAA,MACvB,iBAAiB,MAAM,OAAO;AAAA,MAC9B,mBAAmB;AAAA,QACjB,aAAa,aAAa,MAAM,OAAO,SAAS;AAAA,MAAA;AAAA,IAEpD;AAAA,IACA,yCAAyC;AAAA,MACvC,iBAAiB,MAAM,OAAO;AAAA;AAAA,IAChC;AAAA,IACA,8CAA8C;AAAA,MAC5C,iBAAiB,MAAM,OAAO;AAAA;AAAA,IAAA;AAAA,EAElC;AAAA,EACA,aAAa;AAAA,IACX,SAAS;AAAA,IACT,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,OAAO;AAAA,EACT;AAAA,EACA,qBAAqB,CAAC;AAAA,EACtB,gBAAgB,CAAC;AAAA,EACjB,iBAAiB,CAAC;AAAA,EAClB,cAAc,CAAC;AAAA,EACf,wBAAwB,CAAC;AAAA,EACzB,sBAAsB,CAAC;AAAA,EACvB,qBAAqB,CAAC;AAAA,EACtB,8BAA8B,CAAC;AAAA,EAC/B,cAAc,CAAC;AAAA,EACf,YAAY,CAAC;AAAA,EACb,cAAc;AAAA,IACZ,iBAAiB,MAAM,OAAO;AAAA,EAChC;AAAA,EACA,mBAAmB,CAAC;AAAA,EACpB,eAAe,CAAA;AACjB,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"model.js","sources":["../../../src/Calendar/model.tsx"],"sourcesContent":["import { createDatesArray, isRange } from \"./utils\";\n\n/**\n * Calendar builder for a specific month and year.\n * Returns an array of date objects.\n */\nexport default class CalendarModel {\n month: any;\n\n year: any;\n\n dates: Date[] = [];\n\n constructor(month?: number, year?: number) {\n this.updateModel(month!, year!);\n }\n\n /**\n * Updates the model with the received month and year\n *\n * @param month - Number of the month (1 to 12).\n * @param year - Number of the year.\n * @memberOf CalendarModel\n */\n updateModel = (month: number, year: number) => {\n let validMonth = month;\n let validYear = year;\n if (!Number.isInteger(validMonth)) {\n validMonth = new Date().getMonth() + 1;\n }\n if (!Number.isInteger(validYear)) {\n validYear = new Date().getFullYear();\n }\n\n this.month = validMonth;\n this.year = validYear;\n this.dates = createDatesArray(validMonth, validYear);\n };\n}\n\nconst generateModelFromDate = (seedValue: any) => {\n let calendarModel;\n\n if (typeof seedValue === \"string\") {\n const today = new Date();\n calendarModel = new CalendarModel(\n today.getMonth() + 1,\n today.getFullYear(),\n );\n } else if (isRange(seedValue)) {\n calendarModel = new CalendarModel(\n seedValue.startDate.getMonth() + 1,\n seedValue.startDate.getFullYear(),\n );\n } else {\n calendarModel = new CalendarModel(\n seedValue.getMonth() + 1,\n seedValue.getFullYear(),\n );\n }\n\n return calendarModel;\n};\n\nexport const generateCalendarModel = (\n seedValue: any,\n visibleMonth?: number,\n visibleYear?: number,\n) => {\n let calendarModel;\n\n if (visibleMonth && visibleYear) {\n calendarModel = new CalendarModel(visibleMonth, visibleYear);\n } else if (visibleMonth && !visibleYear) {\n calendarModel = new CalendarModel(visibleMonth, seedValue.getFullYear());\n } else if (!visibleMonth && visibleYear) {\n calendarModel = new CalendarModel(1, visibleYear);\n } else {\n calendarModel = generateModelFromDate(seedValue);\n }\n\n return calendarModel;\n};\n"],"names":[],"mappings":";AAMA,MAAqB,cAAc;AAAA,EACjC;AAAA,EAEA;AAAA,EAEA,QAAgB,CAAA;AAAA,EAEhB,YAAY,OAAgB,MAAe;AACpC,SAAA,YAAY,OAAQ,IAAK;AAAA,EAChC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,cAAc,CAAC,OAAe,SAAiB;AAC7C,QAAI,aAAa;AACjB,QAAI,YAAY;AAChB,QAAI,CAAC,OAAO,UAAU,UAAU,GAAG;AACjC,oBAAiB,oBAAA,KAAO,GAAA,SAAA,IAAa;AAAA,IACvC;AACA,QAAI,CAAC,OAAO,UAAU,SAAS,GAAG;AACpB,mBAAA,oBAAI,KAAK,GAAE,YAAY;AAAA,IACrC;AAEA,SAAK,QAAQ;AACb,SAAK,OAAO;AACP,SAAA,QAAQ,iBAAiB,YAAY,SAAS;AAAA,EAAA;AAEvD;AAEA,MAAM,wBAAwB,CAAC,cAAmB;AAC5C,MAAA;AAEA,MAAA,OAAO,cAAc,UAAU;AAC3B,UAAA,4BAAY;AAClB,oBAAgB,IAAI;AAAA,MAClB,MAAM,aAAa;AAAA,MACnB,MAAM,YAAY;AAAA,IAAA;AAAA,EACpB,WACS,QAAQ,SAAS,GAAG;AAC7B,oBAAgB,IAAI;AAAA,MAClB,UAAU,UAAU,SAAA,IAAa;AAAA,MACjC,UAAU,UAAU,YAAY;AAAA,IAAA;AAAA,EAClC,OACK;AACL,oBAAgB,IAAI;AAAA,MAClB,UAAU,aAAa;AAAA,MACvB,UAAU,YAAY;AAAA,IAAA;AAAA,EAE1B;AAEO,SAAA;AACT;AAEO,MAAM,wBAAwB,CACnC,WACA,cACA,gBACG;AACC,MAAA;AAEJ,MAAI,gBAAgB,aAAa;AACf,oBAAA,IAAI,cAAc,cAAc,WAAW;AAAA,EAAA,WAClD,gBAAgB,CAAC,aAAa;AACvC,oBAAgB,IAAI,cAAc,cAAc,UAAU,YAAa,CAAA;AAAA,EAAA,WAC9D,CAAC,gBAAgB,aAAa;AACvB,oBAAA,IAAI,cAAc,GAAG,WAAW;AAAA,EAAA,OAC3C;AACL,oBAAgB,sBAAsB,SAAS;AAAA,EACjD;AAEO,SAAA;AACT;"}
1
+ {"version":3,"file":"model.js","sources":["../../../src/Calendar/model.tsx"],"sourcesContent":["import { createDatesArray, isRange } from \"./utils\";\n\n/**\n * Calendar builder for a specific month and year.\n * Returns an array of date objects.\n */\nexport default class CalendarModel {\n month: any;\n\n year: any;\n\n dates: Date[] = [];\n\n constructor(month?: number, year?: number) {\n this.updateModel(month!, year!);\n }\n\n /**\n * Updates the model with the received month and year\n *\n * @param month - Number of the month (1 to 12).\n * @param year - Number of the year.\n * @memberOf CalendarModel\n */\n updateModel = (month: number, year: number) => {\n let validMonth = month;\n let validYear = year;\n if (!Number.isInteger(validMonth)) {\n validMonth = new Date().getMonth() + 1;\n }\n if (!Number.isInteger(validYear)) {\n validYear = new Date().getFullYear();\n }\n\n this.month = validMonth;\n this.year = validYear;\n this.dates = createDatesArray(validMonth, validYear);\n };\n}\n\nconst generateModelFromDate = (seedValue: any) => {\n let calendarModel;\n\n if (typeof seedValue === \"string\") {\n const today = new Date();\n calendarModel = new CalendarModel(\n today.getMonth() + 1,\n today.getFullYear(),\n );\n } else if (isRange(seedValue)) {\n calendarModel = new CalendarModel(\n seedValue.startDate.getMonth() + 1,\n seedValue.startDate.getFullYear(),\n );\n } else {\n calendarModel = new CalendarModel(\n seedValue.getMonth() + 1,\n seedValue.getFullYear(),\n );\n }\n\n return calendarModel;\n};\n\nexport const generateCalendarModel = (\n seedValue: any,\n visibleMonth?: number,\n visibleYear?: number,\n) => {\n let calendarModel;\n\n if (visibleMonth && visibleYear) {\n calendarModel = new CalendarModel(visibleMonth, visibleYear);\n } else if (visibleMonth && !visibleYear) {\n calendarModel = new CalendarModel(visibleMonth, seedValue.getFullYear());\n } else if (!visibleMonth && visibleYear) {\n calendarModel = new CalendarModel(1, visibleYear);\n } else {\n calendarModel = generateModelFromDate(seedValue);\n }\n\n return calendarModel;\n};\n"],"names":[],"mappings":";AAMA,MAAqB,cAAc;AAAA,EACjC;AAAA,EAEA;AAAA,EAEA,QAAgB,CAAC;AAAA,EAEjB,YAAY,OAAgB,MAAe;AACpC,SAAA,YAAY,OAAQ,IAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUhC,cAAc,CAAC,OAAe,SAAiB;AAC7C,QAAI,aAAa;AACjB,QAAI,YAAY;AAChB,QAAI,CAAC,OAAO,UAAU,UAAU,GAAG;AACjC,oBAAiB,oBAAA,QAAO,SAAa,IAAA;AAAA,IAAA;AAEvC,QAAI,CAAC,OAAO,UAAU,SAAS,GAAG;AACpB,mBAAA,oBAAI,KAAK,GAAE,YAAY;AAAA,IAAA;AAGrC,SAAK,QAAQ;AACb,SAAK,OAAO;AACP,SAAA,QAAQ,iBAAiB,YAAY,SAAS;AAAA,EACrD;AACF;AAEA,MAAM,wBAAwB,CAAC,cAAmB;AAC5C,MAAA;AAEA,MAAA,OAAO,cAAc,UAAU;AAC3B,UAAA,4BAAY,KAAK;AACvB,oBAAgB,IAAI;AAAA,MAClB,MAAM,aAAa;AAAA,MACnB,MAAM,YAAY;AAAA,IACpB;AAAA,EAAA,WACS,QAAQ,SAAS,GAAG;AAC7B,oBAAgB,IAAI;AAAA,MAClB,UAAU,UAAU,SAAA,IAAa;AAAA,MACjC,UAAU,UAAU,YAAY;AAAA,IAClC;AAAA,EAAA,OACK;AACL,oBAAgB,IAAI;AAAA,MAClB,UAAU,aAAa;AAAA,MACvB,UAAU,YAAY;AAAA,IACxB;AAAA,EAAA;AAGK,SAAA;AACT;AAEO,MAAM,wBAAwB,CACnC,WACA,cACA,gBACG;AACC,MAAA;AAEJ,MAAI,gBAAgB,aAAa;AACf,oBAAA,IAAI,cAAc,cAAc,WAAW;AAAA,EAAA,WAClD,gBAAgB,CAAC,aAAa;AACvC,oBAAgB,IAAI,cAAc,cAAc,UAAU,aAAa;AAAA,EAAA,WAC9D,CAAC,gBAAgB,aAAa;AACvB,oBAAA,IAAI,cAAc,GAAG,WAAW;AAAA,EAAA,OAC3C;AACL,oBAAgB,sBAAsB,SAAS;AAAA,EAAA;AAG1C,SAAA;AACT;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../src/Calendar/utils.tsx"],"sourcesContent":["import dayjs from \"dayjs\";\n\nimport { capitalize } from \"../utils/helpers\";\nimport { DateRangeProp } from \"./types\";\n\n/**\n * Constant with the number of weeks to be displayed on the calendar.\n */\nexport const CALENDAR_WEEKS = 6;\n\n/**\n * Constant with the default locale that should be used as the default.\n */\nexport const DEFAULT_LOCALE = \"en\";\n\n/**\n * Pads a string value with leading zeroes(0) until length is reached.\n *\n * @param value - Value to be padded.\n * @param length - Length of the value after the padding is added.\n * @returns The value as a string with the received amount of padding.\n *\n * @example zeroPad(5, 2) => \"05\"\n */\nexport const zeroPad = (value: number, length: number) =>\n `${value}`.padStart(length, \"0\");\n\n/**\n * Returns the number of days in the month given a month and year.\n *\n * @param month - Number of the month (1 to 12).\n * @param year - Number of the year.\n * @returns The number of days in a month for the received year.\n */\nexport const getMonthDays = (month: number, year: number) =>\n new Date(year, month, 0).getDate();\n\n/**\n * Gets the week day of the first day of a given month and year.\n * From 0 (Sunday) to 6 (Saturday).\n *\n * @param month - Number of the month (1 to 12).\n * @param year - Number of the year.\n * @returns The zero indexed week day where 0 is Sunday (0 to 6).\n */\nexport const getMonthFirstWeekday = (month: number, year: number) =>\n new Date(year, month - 1, 1).getDay();\n\n/**\n * Creates a `Date` instance in UTC timezone.\n *\n * @param year - The year of the date.\n * @param monthIndex - The zero indexed month of the year (0 to 11).\n * @param day - The day of the month.\n * @param [hour=1] - The hour of the day.\n * @returns A `Date` instance in UTC timezone.\n */\nexport const makeUTCDate = (\n year: number,\n monthIndex: number,\n day: number,\n hour = 1,\n) => new Date(Date.UTC(year, monthIndex, day, hour));\n\n/**\n * Checks if the received date is a valid date.\n *\n * @param date - The date to be validated.\n * @returns A flag stating if the date is valid or not.\n */\nexport const isDate = (date: any): date is Date =>\n Object.prototype.toString.call(date) === \"[object Date]\" &&\n !Number.isNaN(date.valueOf());\n\nexport const isDateRangeProp = (date: any): date is DateRangeProp =>\n \"startDate\" in date;\n\n/**\n * Checks if two dates are in the same month and year.\n *\n * @param date1 - First date.\n * @param date2 - Second date.\n * @returns A flag stating if the dates are in the same month and year or not.\n */\nexport const isSameMonth = (date1: any, date2: any) => {\n if (!(isDate(date1) && isDate(date2))) return false;\n\n return (\n date1.getMonth() === date2.getMonth() &&\n date1.getFullYear() === date2.getFullYear()\n );\n};\n\n/**\n * Checks if two dates are on the same day.\n *\n * @param date1 - First date.\n * @param date2 - Second date.\n * @returns A flag stating if the dates are in the same day or not.\n */\nexport const isSameDay = (date1: any, date2: any) => {\n if (!(isDate(date1) && isDate(date2))) return false;\n\n return (\n date1.getDate() === date2.getDate() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getFullYear() === date2.getFullYear()\n );\n};\n\n/**\n * Formats the received date using the ISO format (YYYY-MM-DD).\n *\n * @param date - The date to be formatted.\n * @returns The formatted date in ISO format.\n */\nexport const getDateISO = (date?: Date) => {\n if (!isDate(date)) return null;\n\n return [\n date.getFullYear(),\n zeroPad(date.getMonth() + 1, 2),\n zeroPad(date.getDate(), 2),\n ].join(\"-\");\n};\n\n/**\n * Returns an object with the previous month taking also into consideration the year.\n * For example the previous month of January 2000 will be December 1999.\n *\n * @param month - Number of the month.\n * @param year - Number of the year.\n * @returns Object with new month and year defined.\n */\nexport const getPreviousMonth = (month: number, year: number) => {\n const prevMonth = month > 1 ? month - 1 : 12;\n const prevMonthYear = month > 1 ? year : year - 1;\n\n return { month: prevMonth, year: prevMonthYear };\n};\n\n/**\n * Returns an object with the next month taking also into consideration the year.\n * For example the next month of December 2000 will be January 2001.\n *\n * @param month - Number of the month.\n * @param year - Number of the year.\n * @returns Object with new month and year defined.\n */\nexport const getNextMonth = (month: number, year: number) => {\n const nextMonth = month < 12 ? month + 1 : 1;\n const nextMonthYear = month < 12 ? year : year + 1;\n\n return { month: nextMonth, year: nextMonthYear };\n};\n\n/**\n * Returns a list with the names of all the months localized in the received locale and representation value.\n *\n * @param locale - The locale to be applied to the Intl format.\n * @param representationValue - The representation value for the month.\n * @returns An array with all the months names.\n */\nexport const getMonthNamesList = (\n locale: string | undefined,\n representationValue: Intl.DateTimeFormatOptions[\"month\"] = \"long\",\n) => {\n const options = { month: representationValue, timeZone: \"UTC\" };\n\n return [...Array(12).keys()].map((index) => {\n const auxDate = makeUTCDate(1970, index, 1);\n return capitalize(Intl.DateTimeFormat(locale, options).format(auxDate));\n });\n};\n\n/**\n * Returns a list with the names of all the weekdays localized in the received locale and representation value.\n *\n * @param locale - The locale to be applied.\n * @returns An array with all the weekday names.\n */\nexport const getWeekdayNamesList = (locale: string) => {\n const formatter = new Intl.DateTimeFormat(locale, {\n weekday: \"narrow\",\n timeZone: \"UTC\",\n });\n\n return [...Array(7).keys()].map((index) => {\n return formatter.format(makeUTCDate(1970, 0, 4 + index));\n });\n};\n\n/**\n * Returns the name of the month for the supplied month localized in the received locale and representation value.\n *\n * @param date - The date from which the month name is extracted.\n * @param locale - The locale to be applied to the Intl format.\n * @param representationValue - The locale to be applied to the Intl format.\n * @returns The name of the month.\n */\nexport const getMonthName = (\n date: Date,\n locale: string,\n representationValue: Intl.DateTimeFormatOptions[\"month\"] = \"long\",\n) =>\n new Intl.DateTimeFormat(locale, { month: representationValue }).format(date);\n\n/**\n * Formats the received date according to Design System specifications.\n * Currently: day month, year => `14 Aug, 2019`.\n *\n * @param date - UTC date to be formatted.\n * @param locale - The locale to be applied to the Intl format.\n * @returns The formatted date as a string.\n */\nexport const getFormattedDate = (\n // TODO: fix this\n date: any,\n locale: any,\n rep: Intl.DateTimeFormatOptions[\"month\"] = \"short\",\n) =>\n `${date.getDate()} ${getMonthName(date, locale, rep)} ${date.getFullYear()}`;\n\n/**\n * Creates an array of 42 days. The complete current month and enough days from the previous and next months to fill\n * the 42 positions.\n *\n * @param month - The number of the month (1 to 12).\n * @param year - The number of the year.\n * @returns The array of dates.\n */\nexport const createDatesArray = (month: number, year: number) => {\n // Initializes the variables needed to calculate the dates for the received month and year\n const monthDays = getMonthDays(month, year);\n const daysFromPrevMonth = getMonthFirstWeekday(month, year);\n const daysFromNextMonth =\n CALENDAR_WEEKS * 7 - (daysFromPrevMonth + monthDays);\n const prevMonthYear = getPreviousMonth(month, year);\n const nextMonthYear = getNextMonth(month, year);\n const prevMonthDays = getMonthDays(prevMonthYear.month, prevMonthYear.year);\n\n // Creates the arrays for the dates for previous, current and next months\n const prevMonthDates = [...Array(daysFromPrevMonth).keys()].map((index) => {\n const day = index + 1 + (prevMonthDays - daysFromPrevMonth);\n return new Date(prevMonthYear.year, prevMonthYear.month - 1, day);\n });\n const currentMonthDates = [...Array(monthDays).keys()].map((index) => {\n const day = index + 1;\n return new Date(year, month - 1, day);\n });\n const nextMonthDates = [...Array(daysFromNextMonth).keys()].map((index) => {\n const day = index + 1;\n return new Date(nextMonthYear.year, nextMonthYear.month - 1, day);\n });\n\n return [...prevMonthDates, ...currentMonthDates, ...nextMonthDates];\n};\n\nexport const isRange = (date: any): date is DateRangeProp =>\n date != null && typeof date === \"object\" && \"startDate\" in date;\n\n/**\n * Checks if the date falls within a specified date range.\n *\n * @param date - The date to be evaluated.\n * @param providedValueRange - Provided selection range.\n * @returns - True if the date falls within the range, false otherwise.\n */\nexport const dateInProvidedValueRange = (\n date: any,\n providedValueRange: any,\n) => {\n const { startDate, endDate } = providedValueRange;\n\n if (!isRange(providedValueRange) || endDate == null) return false;\n const localEndDate = endDate;\n\n const modStartDate = dayjs(startDate).format(\"YYYY-MM-DD\");\n const modEndDate = dayjs(localEndDate).format(\"YYYY-MM-DD\");\n\n const convertedDate = dayjs(date).format(\"YYYY-MM-DD\");\n\n return convertedDate >= modStartDate && convertedDate <= modEndDate;\n};\n\nexport const checkIfDateIsDisabled = (\n date?: string | number | Date | dayjs.Dayjs,\n minimumDate?: string | number | Date | dayjs.Dayjs,\n maximumDate?: string | number | Date | dayjs.Dayjs,\n) => {\n if (!minimumDate && !maximumDate) return false;\n const modStartDate = minimumDate\n ? dayjs(minimumDate).format(\"YYYY-MM-DD\")\n : undefined;\n const modEndDate = maximumDate\n ? dayjs(maximumDate).format(\"YYYY-MM-DD\")\n : undefined;\n\n const convertedDate = dayjs(date).format(\"YYYY-MM-DD\");\n\n return (\n (modStartDate !== undefined && convertedDate < modStartDate) ||\n (modEndDate !== undefined && convertedDate > modEndDate)\n );\n};\n\nexport const formatToLocale = (date: any, locale: any) => {\n return new Intl.DateTimeFormat(locale, {\n day: \"numeric\",\n month: \"short\",\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,gBAC9C,eAAe,UAAa,gBAAgB;AAEjD;AAEa,MAAA,iBAAiB,CAAC,MAAW,WAAgB;AACjD,SAAA,IAAI,KAAK,eAAe,QAAQ;AAAA,IACrC,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,EAAA,CACP,EAAE,OAAO,IAAI;AAChB;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../src/Calendar/utils.tsx"],"sourcesContent":["import dayjs from \"dayjs\";\n\nimport { capitalize } from \"../utils/helpers\";\nimport { DateRangeProp } from \"./types\";\n\n/**\n * Constant with the number of weeks to be displayed on the calendar.\n */\nexport const CALENDAR_WEEKS = 6;\n\n/**\n * Constant with the default locale that should be used as the default.\n */\nexport const DEFAULT_LOCALE = \"en\";\n\n/**\n * Pads a string value with leading zeroes(0) until length is reached.\n *\n * @param value - Value to be padded.\n * @param length - Length of the value after the padding is added.\n * @returns The value as a string with the received amount of padding.\n *\n * @example zeroPad(5, 2) => \"05\"\n */\nexport const zeroPad = (value: number, length: number) =>\n `${value}`.padStart(length, \"0\");\n\n/**\n * Returns the number of days in the month given a month and year.\n *\n * @param month - Number of the month (1 to 12).\n * @param year - Number of the year.\n * @returns The number of days in a month for the received year.\n */\nexport const getMonthDays = (month: number, year: number) =>\n new Date(year, month, 0).getDate();\n\n/**\n * Gets the week day of the first day of a given month and year.\n * From 0 (Sunday) to 6 (Saturday).\n *\n * @param month - Number of the month (1 to 12).\n * @param year - Number of the year.\n * @returns The zero indexed week day where 0 is Sunday (0 to 6).\n */\nexport const getMonthFirstWeekday = (month: number, year: number) =>\n new Date(year, month - 1, 1).getDay();\n\n/**\n * Creates a `Date` instance in UTC timezone.\n *\n * @param year - The year of the date.\n * @param monthIndex - The zero indexed month of the year (0 to 11).\n * @param day - The day of the month.\n * @param [hour=1] - The hour of the day.\n * @returns A `Date` instance in UTC timezone.\n */\nexport const makeUTCDate = (\n year: number,\n monthIndex: number,\n day: number,\n hour = 1,\n) => new Date(Date.UTC(year, monthIndex, day, hour));\n\n/**\n * Checks if the received date is a valid date.\n *\n * @param date - The date to be validated.\n * @returns A flag stating if the date is valid or not.\n */\nexport const isDate = (date: any): date is Date =>\n Object.prototype.toString.call(date) === \"[object Date]\" &&\n !Number.isNaN(date.valueOf());\n\nexport const isDateRangeProp = (date: any): date is DateRangeProp =>\n \"startDate\" in date;\n\n/**\n * Checks if two dates are in the same month and year.\n *\n * @param date1 - First date.\n * @param date2 - Second date.\n * @returns A flag stating if the dates are in the same month and year or not.\n */\nexport const isSameMonth = (date1: any, date2: any) => {\n if (!(isDate(date1) && isDate(date2))) return false;\n\n return (\n date1.getMonth() === date2.getMonth() &&\n date1.getFullYear() === date2.getFullYear()\n );\n};\n\n/**\n * Checks if two dates are on the same day.\n *\n * @param date1 - First date.\n * @param date2 - Second date.\n * @returns A flag stating if the dates are in the same day or not.\n */\nexport const isSameDay = (date1: any, date2: any) => {\n if (!(isDate(date1) && isDate(date2))) return false;\n\n return (\n date1.getDate() === date2.getDate() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getFullYear() === date2.getFullYear()\n );\n};\n\n/**\n * Formats the received date using the ISO format (YYYY-MM-DD).\n *\n * @param date - The date to be formatted.\n * @returns The formatted date in ISO format.\n */\nexport const getDateISO = (date?: Date) => {\n if (!isDate(date)) return null;\n\n return [\n date.getFullYear(),\n zeroPad(date.getMonth() + 1, 2),\n zeroPad(date.getDate(), 2),\n ].join(\"-\");\n};\n\n/**\n * Returns an object with the previous month taking also into consideration the year.\n * For example the previous month of January 2000 will be December 1999.\n *\n * @param month - Number of the month.\n * @param year - Number of the year.\n * @returns Object with new month and year defined.\n */\nexport const getPreviousMonth = (month: number, year: number) => {\n const prevMonth = month > 1 ? month - 1 : 12;\n const prevMonthYear = month > 1 ? year : year - 1;\n\n return { month: prevMonth, year: prevMonthYear };\n};\n\n/**\n * Returns an object with the next month taking also into consideration the year.\n * For example the next month of December 2000 will be January 2001.\n *\n * @param month - Number of the month.\n * @param year - Number of the year.\n * @returns Object with new month and year defined.\n */\nexport const getNextMonth = (month: number, year: number) => {\n const nextMonth = month < 12 ? month + 1 : 1;\n const nextMonthYear = month < 12 ? year : year + 1;\n\n return { month: nextMonth, year: nextMonthYear };\n};\n\n/**\n * Returns a list with the names of all the months localized in the received locale and representation value.\n *\n * @param locale - The locale to be applied to the Intl format.\n * @param representationValue - The representation value for the month.\n * @returns An array with all the months names.\n */\nexport const getMonthNamesList = (\n locale: string | undefined,\n representationValue: Intl.DateTimeFormatOptions[\"month\"] = \"long\",\n) => {\n const options = { month: representationValue, timeZone: \"UTC\" };\n\n return [...Array(12).keys()].map((index) => {\n const auxDate = makeUTCDate(1970, index, 1);\n return capitalize(Intl.DateTimeFormat(locale, options).format(auxDate));\n });\n};\n\n/**\n * Returns a list with the names of all the weekdays localized in the received locale and representation value.\n *\n * @param locale - The locale to be applied.\n * @returns An array with all the weekday names.\n */\nexport const getWeekdayNamesList = (locale: string) => {\n const formatter = new Intl.DateTimeFormat(locale, {\n weekday: \"narrow\",\n timeZone: \"UTC\",\n });\n\n return [...Array(7).keys()].map((index) => {\n return formatter.format(makeUTCDate(1970, 0, 4 + index));\n });\n};\n\n/**\n * Returns the name of the month for the supplied month localized in the received locale and representation value.\n *\n * @param date - The date from which the month name is extracted.\n * @param locale - The locale to be applied to the Intl format.\n * @param representationValue - The locale to be applied to the Intl format.\n * @returns The name of the month.\n */\nexport const getMonthName = (\n date: Date,\n locale: string,\n representationValue: Intl.DateTimeFormatOptions[\"month\"] = \"long\",\n) =>\n new Intl.DateTimeFormat(locale, { month: representationValue }).format(date);\n\n/**\n * Formats the received date according to Design System specifications.\n * Currently: day month, year => `14 Aug, 2019`.\n *\n * @param date - UTC date to be formatted.\n * @param locale - The locale to be applied to the Intl format.\n * @returns The formatted date as a string.\n */\nexport const getFormattedDate = (\n // TODO: fix this\n date: any,\n locale: any,\n rep: Intl.DateTimeFormatOptions[\"month\"] = \"short\",\n) =>\n `${date.getDate()} ${getMonthName(date, locale, rep)} ${date.getFullYear()}`;\n\n/**\n * Creates an array of 42 days. The complete current month and enough days from the previous and next months to fill\n * the 42 positions.\n *\n * @param month - The number of the month (1 to 12).\n * @param year - The number of the year.\n * @returns The array of dates.\n */\nexport const createDatesArray = (month: number, year: number) => {\n // Initializes the variables needed to calculate the dates for the received month and year\n const monthDays = getMonthDays(month, year);\n const daysFromPrevMonth = getMonthFirstWeekday(month, year);\n const daysFromNextMonth =\n CALENDAR_WEEKS * 7 - (daysFromPrevMonth + monthDays);\n const prevMonthYear = getPreviousMonth(month, year);\n const nextMonthYear = getNextMonth(month, year);\n const prevMonthDays = getMonthDays(prevMonthYear.month, prevMonthYear.year);\n\n // Creates the arrays for the dates for previous, current and next months\n const prevMonthDates = [...Array(daysFromPrevMonth).keys()].map((index) => {\n const day = index + 1 + (prevMonthDays - daysFromPrevMonth);\n return new Date(prevMonthYear.year, prevMonthYear.month - 1, day);\n });\n const currentMonthDates = [...Array(monthDays).keys()].map((index) => {\n const day = index + 1;\n return new Date(year, month - 1, day);\n });\n const nextMonthDates = [...Array(daysFromNextMonth).keys()].map((index) => {\n const day = index + 1;\n return new Date(nextMonthYear.year, nextMonthYear.month - 1, day);\n });\n\n return [...prevMonthDates, ...currentMonthDates, ...nextMonthDates];\n};\n\nexport const isRange = (date: any): date is DateRangeProp =>\n date != null && typeof date === \"object\" && \"startDate\" in date;\n\n/**\n * Checks if the date falls within a specified date range.\n *\n * @param date - The date to be evaluated.\n * @param providedValueRange - Provided selection range.\n * @returns - True if the date falls within the range, false otherwise.\n */\nexport const dateInProvidedValueRange = (\n date: any,\n providedValueRange: any,\n) => {\n const { startDate, endDate } = providedValueRange;\n\n if (!isRange(providedValueRange) || endDate == null) return false;\n const localEndDate = endDate;\n\n const modStartDate = dayjs(startDate).format(\"YYYY-MM-DD\");\n const modEndDate = dayjs(localEndDate).format(\"YYYY-MM-DD\");\n\n const convertedDate = dayjs(date).format(\"YYYY-MM-DD\");\n\n return convertedDate >= modStartDate && convertedDate <= modEndDate;\n};\n\nexport const checkIfDateIsDisabled = (\n date?: string | number | Date | dayjs.Dayjs,\n minimumDate?: string | number | Date | dayjs.Dayjs,\n maximumDate?: string | number | Date | dayjs.Dayjs,\n) => {\n if (!minimumDate && !maximumDate) return false;\n const modStartDate = minimumDate\n ? dayjs(minimumDate).format(\"YYYY-MM-DD\")\n : undefined;\n const modEndDate = maximumDate\n ? dayjs(maximumDate).format(\"YYYY-MM-DD\")\n : undefined;\n\n const convertedDate = dayjs(date).format(\"YYYY-MM-DD\");\n\n return (\n (modStartDate !== undefined && convertedDate < modStartDate) ||\n (modEndDate !== undefined && convertedDate > modEndDate)\n );\n};\n\nexport const formatToLocale = (date: any, locale: any) => {\n return new Intl.DateTimeFormat(locale, {\n day: \"numeric\",\n month: \"short\",\n year: \"numeric\",\n }).format(date);\n};\n"],"names":[],"mappings":";;AAQO,MAAM,iBAAiB;AA0BjB,MAAA,eAAe,CAAC,OAAe,SAC1C,IAAI,KAAK,MAAM,OAAO,CAAC,EAAE,QAAQ;AAUtB,MAAA,uBAAuB,CAAC,OAAe,SAClD,IAAI,KAAK,MAAM,QAAQ,GAAG,CAAC,EAAE,OAAO;AAW/B,MAAM,cAAc,CACzB,MACA,YACA,KACA,OAAO,MACJ,IAAI,KAAK,KAAK,IAAI,MAAM,YAAY,KAAK,IAAI,CAAC;AAQ5C,MAAM,SAAS,CAAC,SACrB,OAAO,UAAU,SAAS,KAAK,IAAI,MAAM,mBACzC,CAAC,OAAO,MAAM,KAAK,QAAS,CAAA;AAEjB,MAAA,kBAAkB,CAAC,SAC9B,eAAe;AASJ,MAAA,cAAc,CAAC,OAAY,UAAe;AACrD,MAAI,EAAE,OAAO,KAAK,KAAK,OAAO,KAAK,GAAW,QAAA;AAG5C,SAAA,MAAM,SAAS,MAAM,MAAM,cAC3B,MAAM,YAAA,MAAkB,MAAM,YAAY;AAE9C;AASa,MAAA,YAAY,CAAC,OAAY,UAAe;AACnD,MAAI,EAAE,OAAO,KAAK,KAAK,OAAO,KAA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