@vibe/core 3.70.2-alpha-23478.0 → 3.70.2

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 (737) hide show
  1. package/dist/components/AlertBanner/AlertBannerButton/AlertBannerButton.d.ts +1 -1
  2. package/dist/components/AttentionBox/AttentionBox.d.ts +3 -3
  3. package/dist/components/AttentionBox/AttentionBoxConstants.d.ts +8 -0
  4. package/dist/components/Avatar/Avatar.d.ts +2 -1
  5. package/dist/components/Avatar/AvatarBadge.d.ts +2 -1
  6. package/dist/components/Avatar/AvatarContent.d.ts +2 -1
  7. package/dist/components/BaseListItem/BaseListItem.types.d.ts +2 -1
  8. package/dist/components/BreadcrumbsBar/BreadcrumbItem/BreadcrumbContent/BreadcrumbContent.d.ts +2 -1
  9. package/dist/components/BreadcrumbsBar/BreadcrumbItem/BreadcrumbItem.d.ts +2 -1
  10. package/dist/components/ButtonGroup/ButtonGroup.d.ts +4 -4
  11. package/dist/components/ButtonGroup/ButtonGroupConstants.d.ts +8 -0
  12. package/dist/components/ButtonGroup/ButtonWrapper.d.ts +1 -1
  13. package/dist/components/Chips/Chips.d.ts +2 -1
  14. package/dist/components/ColorPicker/ColorPicker.d.ts +2 -1
  15. package/dist/components/ColorPicker/components/ColorPickerContent/ColorPickerClearButton.d.ts +2 -1
  16. package/dist/components/ColorPicker/components/ColorPickerContent/ColorPickerColorsGrid.d.ts +2 -1
  17. package/dist/components/ColorPicker/components/ColorPickerContent/ColorPickerContent.d.ts +2 -1
  18. package/dist/components/ColorPicker/components/ColorPickerItemComponent/ColorPickerItemComponent.d.ts +2 -1
  19. package/dist/components/Combobox/Combobox.d.ts +2 -1
  20. package/dist/components/Combobox/components/ComboboxConstants.d.ts +1 -1
  21. package/dist/components/EmptyState/EmptyState.types.d.ts +1 -1
  22. package/dist/components/IconButton/IconButton.d.ts +5 -4
  23. package/dist/components/LegacyModal/LegacyModalHeader/LegacyModalHeader.d.ts +2 -1
  24. package/dist/components/Link/Link.d.ts +2 -1
  25. package/dist/components/ListItemIcon/ListItemIcon.d.ts +2 -1
  26. package/dist/components/Menu/MenuItem/MenuItem.d.ts +3 -3
  27. package/dist/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.types.d.ts +1 -2
  28. package/dist/components/Menu/MenuItemButton/MenuItemButton.d.ts +4 -3
  29. package/dist/components/Modal/ModalHeader/ModalHeader.types.d.ts +2 -1
  30. package/dist/components/Modal/ModalTopActions/ModalTopActions.types.d.ts +1 -1
  31. package/dist/components/Modal/footers/ModalFooterBase/ModalFooterBase.types.d.ts +1 -1
  32. package/dist/components/Modal/footers/utils/getPropsForButton.d.ts +6 -6
  33. package/dist/components/MultiStepIndicator/MultiStepIndicator.d.ts +2 -1
  34. package/dist/components/MultiStepIndicator/components/StepIndicator/StepIndicator.d.ts +2 -1
  35. package/dist/components/NumberField/NumberField.types.d.ts +1 -1
  36. package/dist/components/Search/Search.types.d.ts +2 -1
  37. package/dist/components/Slider/Slider.d.ts +1 -1
  38. package/dist/components/Slider/SliderConstants.d.ts +1 -1
  39. package/dist/components/Slider/SliderContext.d.ts +1 -1
  40. package/dist/components/SplitButton/SplitButton.d.ts +4 -4
  41. package/dist/components/Steps/Steps.d.ts +1 -1
  42. package/dist/components/Steps/StepsCommand.d.ts +1 -1
  43. package/dist/components/Steps/StepsHeader.d.ts +1 -1
  44. package/dist/components/Table/Table/Table.d.ts +2 -1
  45. package/dist/components/Table/TableHeaderCell/TableHeaderCell.d.ts +2 -1
  46. package/dist/components/Tabs/Tab/Tab.d.ts +1 -2
  47. package/dist/components/Tipseen/TipseenContent.d.ts +1 -1
  48. package/dist/components/Toast/Toast.d.ts +1 -1
  49. package/dist/components/Toast/ToastButton/ToastButton.d.ts +1 -1
  50. package/dist/components/Toast/ToastHelpers.d.ts +1 -1
  51. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  52. package/dist/components/button/dist/Button/Button.js +2 -0
  53. package/dist/components/button/dist/Button/Button.js.map +1 -0
  54. package/dist/components/button/dist/Button/Button.module.scss.js +2 -0
  55. package/dist/components/button/dist/Button/ButtonConstants.js +2 -0
  56. package/dist/components/button/dist/Button/ButtonConstants.js.map +1 -0
  57. package/dist/components/button/dist/Button/helper/dom-helpers.js.map +1 -0
  58. package/dist/components/button/dist/Button/helper/useButtonLoading.js +2 -0
  59. package/dist/components/button/dist/Button/helper/useButtonLoading.js.map +1 -0
  60. package/dist/components/icon/dist/Icon/CustomSvgIcon/CustomSvgIcon.js +2 -0
  61. package/dist/components/icon/dist/Icon/CustomSvgIcon/CustomSvgIcon.js.map +1 -0
  62. package/dist/components/icon/dist/Icon/FontIcon/FontIcon.js +2 -0
  63. package/dist/components/icon/dist/Icon/FontIcon/FontIcon.js.map +1 -0
  64. package/dist/components/icon/dist/Icon/Icon.js +2 -0
  65. package/dist/components/icon/dist/Icon/Icon.js.map +1 -0
  66. package/dist/components/icon/dist/Icon/Icon.module.scss.js +2 -0
  67. package/dist/components/icon/dist/Icon/constants.js +2 -0
  68. package/dist/components/icon/dist/Icon/constants.js.map +1 -0
  69. package/dist/components/icon/dist/Icon/hooks/useIconProps.js +2 -0
  70. package/dist/components/icon/dist/Icon/hooks/useIconProps.js.map +1 -0
  71. package/dist/components/icon/dist/Icon/hooks/useIconScreenReaderAccessProps.js +2 -0
  72. package/dist/components/icon/dist/Icon/hooks/useIconScreenReaderAccessProps.js.map +1 -0
  73. package/dist/components/index.d.ts +3 -3
  74. package/dist/components/loader/dist/Loader/Loader.js +2 -0
  75. package/dist/components/loader/dist/Loader/Loader.js.map +1 -0
  76. package/dist/components/loader/dist/Loader/Loader.module.scss.js +2 -0
  77. package/dist/components/loader/dist/Loader/LoaderConstants.js.map +1 -0
  78. package/dist/components/next/AttentionBox/AttentionBox.types.d.ts +2 -2
  79. package/dist/components/next/AttentionBox/components/AttentionBoxButton/AttentionBoxButton.d.ts +1 -1
  80. package/dist/components/next/AttentionBox/components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon.d.ts +1 -2
  81. package/dist/components/next/AttentionBox/consts/icons.d.ts +1 -1
  82. package/dist/components/next/AttentionBox/utils/iconUtils.d.ts +1 -1
  83. package/dist/metadata.json +136 -1020
  84. package/dist/mocked_classnames/components/AlertBanner/AlertBannerButton/AlertBannerButton.d.ts +1 -1
  85. package/dist/mocked_classnames/components/AttentionBox/AttentionBox.d.ts +3 -3
  86. package/dist/mocked_classnames/components/AttentionBox/AttentionBoxConstants.d.ts +8 -0
  87. package/dist/mocked_classnames/components/Avatar/Avatar.d.ts +2 -1
  88. package/dist/mocked_classnames/components/Avatar/AvatarBadge.d.ts +2 -1
  89. package/dist/mocked_classnames/components/Avatar/AvatarContent.d.ts +2 -1
  90. package/dist/mocked_classnames/components/BaseListItem/BaseListItem.types.d.ts +2 -1
  91. package/dist/mocked_classnames/components/BreadcrumbsBar/BreadcrumbItem/BreadcrumbContent/BreadcrumbContent.d.ts +2 -1
  92. package/dist/mocked_classnames/components/BreadcrumbsBar/BreadcrumbItem/BreadcrumbItem.d.ts +2 -1
  93. package/dist/mocked_classnames/components/ButtonGroup/ButtonGroup.d.ts +4 -4
  94. package/dist/mocked_classnames/components/ButtonGroup/ButtonGroupConstants.d.ts +8 -0
  95. package/dist/mocked_classnames/components/ButtonGroup/ButtonWrapper.d.ts +1 -1
  96. package/dist/mocked_classnames/components/Chips/Chips.d.ts +2 -1
  97. package/dist/mocked_classnames/components/ColorPicker/ColorPicker.d.ts +2 -1
  98. package/dist/mocked_classnames/components/ColorPicker/components/ColorPickerContent/ColorPickerClearButton.d.ts +2 -1
  99. package/dist/mocked_classnames/components/ColorPicker/components/ColorPickerContent/ColorPickerColorsGrid.d.ts +2 -1
  100. package/dist/mocked_classnames/components/ColorPicker/components/ColorPickerContent/ColorPickerContent.d.ts +2 -1
  101. package/dist/mocked_classnames/components/ColorPicker/components/ColorPickerItemComponent/ColorPickerItemComponent.d.ts +2 -1
  102. package/dist/mocked_classnames/components/Combobox/Combobox.d.ts +2 -1
  103. package/dist/mocked_classnames/components/Combobox/components/ComboboxConstants.d.ts +1 -1
  104. package/dist/mocked_classnames/components/EmptyState/EmptyState.types.d.ts +1 -1
  105. package/dist/mocked_classnames/components/IconButton/IconButton.d.ts +5 -4
  106. package/dist/mocked_classnames/components/LegacyModal/LegacyModalHeader/LegacyModalHeader.d.ts +2 -1
  107. package/dist/mocked_classnames/components/Link/Link.d.ts +2 -1
  108. package/dist/mocked_classnames/components/ListItemIcon/ListItemIcon.d.ts +2 -1
  109. package/dist/mocked_classnames/components/Menu/MenuItem/MenuItem.d.ts +3 -3
  110. package/dist/mocked_classnames/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.types.d.ts +1 -2
  111. package/dist/mocked_classnames/components/Menu/MenuItemButton/MenuItemButton.d.ts +4 -3
  112. package/dist/mocked_classnames/components/Modal/ModalHeader/ModalHeader.types.d.ts +2 -1
  113. package/dist/mocked_classnames/components/Modal/ModalTopActions/ModalTopActions.types.d.ts +1 -1
  114. package/dist/mocked_classnames/components/Modal/footers/ModalFooterBase/ModalFooterBase.types.d.ts +1 -1
  115. package/dist/mocked_classnames/components/Modal/footers/utils/getPropsForButton.d.ts +6 -6
  116. package/dist/mocked_classnames/components/MultiStepIndicator/MultiStepIndicator.d.ts +2 -1
  117. package/dist/mocked_classnames/components/MultiStepIndicator/components/StepIndicator/StepIndicator.d.ts +2 -1
  118. package/dist/mocked_classnames/components/NumberField/NumberField.types.d.ts +1 -1
  119. package/dist/mocked_classnames/components/Search/Search.types.d.ts +2 -1
  120. package/dist/mocked_classnames/components/Slider/Slider.d.ts +1 -1
  121. package/dist/mocked_classnames/components/Slider/SliderConstants.d.ts +1 -1
  122. package/dist/mocked_classnames/components/Slider/SliderContext.d.ts +1 -1
  123. package/dist/mocked_classnames/components/SplitButton/SplitButton.d.ts +4 -4
  124. package/dist/mocked_classnames/components/Steps/Steps.d.ts +1 -1
  125. package/dist/mocked_classnames/components/Steps/StepsCommand.d.ts +1 -1
  126. package/dist/mocked_classnames/components/Steps/StepsHeader.d.ts +1 -1
  127. package/dist/mocked_classnames/components/Table/Table/Table.d.ts +2 -1
  128. package/dist/mocked_classnames/components/Table/TableHeaderCell/TableHeaderCell.d.ts +2 -1
  129. package/dist/mocked_classnames/components/Tabs/Tab/Tab.d.ts +1 -2
  130. package/dist/mocked_classnames/components/Tipseen/TipseenContent.d.ts +1 -1
  131. package/dist/mocked_classnames/components/Toast/Toast.d.ts +1 -1
  132. package/dist/mocked_classnames/components/Toast/ToastButton/ToastButton.d.ts +1 -1
  133. package/dist/mocked_classnames/components/Toast/ToastHelpers.d.ts +1 -1
  134. package/dist/mocked_classnames/components/Tooltip/Tooltip.d.ts +1 -1
  135. package/dist/mocked_classnames/components/button/dist/Button/Button.js +2 -0
  136. package/dist/mocked_classnames/components/button/dist/Button/Button.js.map +1 -0
  137. package/dist/mocked_classnames/components/button/dist/Button/Button.module.scss.js +2 -0
  138. package/dist/mocked_classnames/components/button/dist/Button/ButtonConstants.js +2 -0
  139. package/dist/mocked_classnames/components/button/dist/Button/ButtonConstants.js.map +1 -0
  140. package/dist/mocked_classnames/components/button/dist/Button/helper/dom-helpers.js.map +1 -0
  141. package/dist/mocked_classnames/components/button/dist/Button/helper/useButtonLoading.js +2 -0
  142. package/dist/mocked_classnames/components/button/dist/Button/helper/useButtonLoading.js.map +1 -0
  143. package/dist/mocked_classnames/components/icon/dist/Icon/CustomSvgIcon/CustomSvgIcon.js +2 -0
  144. package/dist/mocked_classnames/components/icon/dist/Icon/CustomSvgIcon/CustomSvgIcon.js.map +1 -0
  145. package/dist/mocked_classnames/components/icon/dist/Icon/FontIcon/FontIcon.js +2 -0
  146. package/dist/mocked_classnames/components/icon/dist/Icon/FontIcon/FontIcon.js.map +1 -0
  147. package/dist/mocked_classnames/components/icon/dist/Icon/Icon.js +2 -0
  148. package/dist/mocked_classnames/components/icon/dist/Icon/Icon.js.map +1 -0
  149. package/dist/mocked_classnames/components/icon/dist/Icon/Icon.module.scss.js +2 -0
  150. package/dist/mocked_classnames/components/icon/dist/Icon/constants.js +2 -0
  151. package/dist/mocked_classnames/components/icon/dist/Icon/constants.js.map +1 -0
  152. package/dist/mocked_classnames/components/icon/dist/Icon/hooks/useIconProps.js +2 -0
  153. package/dist/mocked_classnames/components/icon/dist/Icon/hooks/useIconProps.js.map +1 -0
  154. package/dist/mocked_classnames/components/icon/dist/Icon/hooks/useIconScreenReaderAccessProps.js +2 -0
  155. package/dist/mocked_classnames/components/icon/dist/Icon/hooks/useIconScreenReaderAccessProps.js.map +1 -0
  156. package/dist/mocked_classnames/components/index.d.ts +3 -3
  157. package/dist/mocked_classnames/components/loader/dist/Loader/Loader.js +2 -0
  158. package/dist/mocked_classnames/components/loader/dist/Loader/Loader.js.map +1 -0
  159. package/dist/mocked_classnames/components/loader/dist/Loader/Loader.module.scss.js +2 -0
  160. package/dist/mocked_classnames/components/loader/dist/Loader/LoaderConstants.js.map +1 -0
  161. package/dist/mocked_classnames/components/next/AttentionBox/AttentionBox.types.d.ts +2 -2
  162. package/dist/mocked_classnames/components/next/AttentionBox/components/AttentionBoxButton/AttentionBoxButton.d.ts +1 -1
  163. package/dist/mocked_classnames/components/next/AttentionBox/components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon.d.ts +1 -2
  164. package/dist/mocked_classnames/components/next/AttentionBox/consts/icons.d.ts +1 -1
  165. package/dist/mocked_classnames/components/next/AttentionBox/utils/iconUtils.d.ts +1 -1
  166. package/dist/mocked_classnames/packages/icons/dist/_virtual/_tslib.js.map +1 -0
  167. package/dist/mocked_classnames/packages/icons/dist/react/AddSmall.js.map +1 -0
  168. package/dist/mocked_classnames/packages/icons/dist/react/Alert.js.map +1 -0
  169. package/dist/mocked_classnames/packages/icons/dist/react/Check.js.map +1 -0
  170. package/dist/mocked_classnames/packages/icons/dist/react/CloseMedium.js.map +1 -0
  171. package/dist/mocked_classnames/packages/icons/dist/react/CloseSmall.js.map +1 -0
  172. package/dist/mocked_classnames/packages/icons/dist/react/DropdownChevronDown.js.map +1 -0
  173. package/dist/mocked_classnames/packages/icons/dist/react/DropdownChevronRight.js.map +1 -0
  174. package/dist/mocked_classnames/packages/icons/dist/react/DropdownChevronUp.js.map +1 -0
  175. package/dist/mocked_classnames/packages/icons/dist/react/Favorite.js.map +1 -0
  176. package/dist/mocked_classnames/packages/icons/dist/react/Info.js.map +1 -0
  177. package/dist/mocked_classnames/packages/icons/dist/react/Menu.js.map +1 -0
  178. package/dist/mocked_classnames/packages/icons/dist/react/MoveArrowLeft.js.map +1 -0
  179. package/dist/mocked_classnames/packages/icons/dist/react/MoveArrowRight.js.map +1 -0
  180. package/dist/mocked_classnames/packages/icons/dist/react/NavigationChevronLeft.js.map +1 -0
  181. package/dist/mocked_classnames/packages/icons/dist/react/NavigationChevronRight.js.map +1 -0
  182. package/dist/mocked_classnames/packages/icons/dist/react/NoColor.js.map +1 -0
  183. package/dist/mocked_classnames/packages/icons/dist/react/Remove.js.map +1 -0
  184. package/dist/mocked_classnames/packages/icons/dist/react/Search.js.map +1 -0
  185. package/dist/mocked_classnames/packages/icons/dist/react/Sort.js.map +1 -0
  186. package/dist/mocked_classnames/packages/icons/dist/react/SortAscending.js.map +1 -0
  187. package/dist/mocked_classnames/packages/icons/dist/react/SortDescending.js.map +1 -0
  188. package/dist/mocked_classnames/packages/icons/dist/react/Warning.js.map +1 -0
  189. package/dist/mocked_classnames/packages/shared/dist/constants/keyCodes.js +2 -0
  190. package/dist/mocked_classnames/packages/shared/dist/constants/keyCodes.js.map +1 -0
  191. package/dist/mocked_classnames/packages/shared/dist/constants/sizes.js +2 -0
  192. package/dist/mocked_classnames/packages/shared/dist/constants/sizes.js.map +1 -0
  193. package/dist/mocked_classnames/packages/shared/dist/hooks/ssr/useIsMounted.js +2 -0
  194. package/dist/mocked_classnames/packages/shared/dist/hooks/ssr/useIsMounted.js.map +1 -0
  195. package/dist/mocked_classnames/packages/shared/dist/hooks/ssr/useIsomorphicLayoutEffect.js +2 -0
  196. package/dist/mocked_classnames/packages/shared/dist/hooks/ssr/useIsomorphicLayoutEffect.js.map +1 -0
  197. package/dist/mocked_classnames/packages/shared/dist/hooks/useEventListener.js +2 -0
  198. package/dist/mocked_classnames/packages/shared/dist/hooks/useEventListener.js.map +1 -0
  199. package/dist/mocked_classnames/packages/shared/dist/hooks/useKeyEvent.js +2 -0
  200. package/dist/mocked_classnames/packages/shared/dist/hooks/useKeyEvent.js.map +1 -0
  201. package/dist/mocked_classnames/packages/shared/dist/hooks/useMergeRef.js +2 -0
  202. package/dist/mocked_classnames/packages/shared/dist/hooks/useMergeRef.js.map +1 -0
  203. package/dist/mocked_classnames/packages/shared/dist/tests/constants.js +2 -0
  204. package/dist/mocked_classnames/packages/shared/dist/tests/constants.js.map +1 -0
  205. package/dist/mocked_classnames/packages/shared/dist/tests/test-ids-utils.js +2 -0
  206. package/dist/mocked_classnames/packages/shared/dist/tests/test-ids-utils.js.map +1 -0
  207. package/dist/mocked_classnames/packages/shared/dist/types/withStaticProps.js +2 -0
  208. package/dist/mocked_classnames/packages/shared/dist/types/withStaticProps.js.map +1 -0
  209. package/dist/mocked_classnames/packages/shared/dist/utils/function-utils.js +2 -0
  210. package/dist/mocked_classnames/packages/shared/dist/utils/function-utils.js.map +1 -0
  211. package/dist/mocked_classnames/packages/shared/dist/utils/screenReaderAccessHelper.js +2 -0
  212. package/dist/mocked_classnames/packages/shared/dist/utils/screenReaderAccessHelper.js.map +1 -0
  213. package/dist/mocked_classnames/packages/shared/dist/utils/ssr-utils.js +2 -0
  214. package/dist/mocked_classnames/packages/shared/dist/utils/ssr-utils.js.map +1 -0
  215. package/dist/mocked_classnames/packages/shared/dist/utils/typesciptCssModulesHelper.js +2 -0
  216. package/dist/mocked_classnames/packages/shared/dist/utils/typesciptCssModulesHelper.js.map +1 -0
  217. package/dist/mocked_classnames/src/components/AlertBanner/AlertBanner.js +1 -1
  218. package/dist/mocked_classnames/src/components/AlertBanner/AlertBanner.js.map +1 -1
  219. package/dist/mocked_classnames/src/components/AlertBanner/AlertBannerButton/AlertBannerButton.js +1 -1
  220. package/dist/mocked_classnames/src/components/AlertBanner/AlertBannerButton/AlertBannerButton.js.map +1 -1
  221. package/dist/mocked_classnames/src/components/AttentionBox/AttentionBox.js +1 -1
  222. package/dist/mocked_classnames/src/components/AttentionBox/AttentionBox.js.map +1 -1
  223. package/dist/mocked_classnames/src/components/AttentionBox/AttentionBoxConstants.js +1 -1
  224. package/dist/mocked_classnames/src/components/AttentionBox/AttentionBoxConstants.js.map +1 -1
  225. package/dist/mocked_classnames/src/components/Avatar/Avatar.js.map +1 -1
  226. package/dist/mocked_classnames/src/components/Avatar/AvatarBadge.js +1 -1
  227. package/dist/mocked_classnames/src/components/Avatar/AvatarBadge.js.map +1 -1
  228. package/dist/mocked_classnames/src/components/Avatar/AvatarContent.js +1 -1
  229. package/dist/mocked_classnames/src/components/Avatar/AvatarContent.js.map +1 -1
  230. package/dist/mocked_classnames/src/components/BaseListItem/utils.js +1 -1
  231. package/dist/mocked_classnames/src/components/BaseListItem/utils.js.map +1 -1
  232. package/dist/mocked_classnames/src/components/BreadcrumbsBar/BreadcrumbItem/BreadcrumbContent/BreadcrumbContent.js.map +1 -1
  233. package/dist/mocked_classnames/src/components/BreadcrumbsBar/BreadcrumbItem/BreadcrumbItem.js.map +1 -1
  234. package/dist/mocked_classnames/src/components/BreadcrumbsBar/BreadcrumbsBar.js +1 -1
  235. package/dist/mocked_classnames/src/components/BreadcrumbsBar/BreadcrumbsBar.js.map +1 -1
  236. package/dist/mocked_classnames/src/components/ButtonGroup/ButtonGroup.js +1 -1
  237. package/dist/mocked_classnames/src/components/ButtonGroup/ButtonGroup.js.map +1 -1
  238. package/dist/mocked_classnames/src/components/ButtonGroup/ButtonWrapper.js +1 -1
  239. package/dist/mocked_classnames/src/components/ButtonGroup/ButtonWrapper.js.map +1 -1
  240. package/dist/mocked_classnames/src/components/Checkbox/Checkbox.js +1 -1
  241. package/dist/mocked_classnames/src/components/Checkbox/Checkbox.js.map +1 -1
  242. package/dist/mocked_classnames/src/components/Chips/Chips.js +1 -1
  243. package/dist/mocked_classnames/src/components/Chips/Chips.js.map +1 -1
  244. package/dist/mocked_classnames/src/components/ColorPicker/ColorPicker.js +1 -1
  245. package/dist/mocked_classnames/src/components/ColorPicker/ColorPicker.js.map +1 -1
  246. package/dist/mocked_classnames/src/components/ColorPicker/components/ColorPickerContent/ColorPickerClearButton.js +1 -1
  247. package/dist/mocked_classnames/src/components/ColorPicker/components/ColorPickerContent/ColorPickerClearButton.js.map +1 -1
  248. package/dist/mocked_classnames/src/components/ColorPicker/components/ColorPickerContent/ColorPickerColorsGrid.js.map +1 -1
  249. package/dist/mocked_classnames/src/components/ColorPicker/components/ColorPickerContent/ColorPickerContent.js +1 -1
  250. package/dist/mocked_classnames/src/components/ColorPicker/components/ColorPickerContent/ColorPickerContent.js.map +1 -1
  251. package/dist/mocked_classnames/src/components/ColorPicker/components/ColorPickerItemComponent/ColorPickerItemComponent.js +1 -1
  252. package/dist/mocked_classnames/src/components/ColorPicker/components/ColorPickerItemComponent/ColorPickerItemComponent.js.map +1 -1
  253. package/dist/mocked_classnames/src/components/Combobox/Combobox.js +1 -1
  254. package/dist/mocked_classnames/src/components/Combobox/Combobox.js.map +1 -1
  255. package/dist/mocked_classnames/src/components/Combobox/components/ComboboxConstants.js.map +1 -1
  256. package/dist/mocked_classnames/src/components/Combobox/components/ComboboxOption/ComboboxOption.js +1 -1
  257. package/dist/mocked_classnames/src/components/Combobox/components/ComboboxOption/ComboboxOption.js.map +1 -1
  258. package/dist/mocked_classnames/src/components/DatePicker/DateNavigationItem/DateNavigationItem.js +1 -1
  259. package/dist/mocked_classnames/src/components/DatePicker/DateNavigationItem/DateNavigationItem.js.map +1 -1
  260. package/dist/mocked_classnames/src/components/DatePicker/DatePickerHeader/DatePickerHeader.js +1 -1
  261. package/dist/mocked_classnames/src/components/DatePicker/DatePickerHeader/DatePickerHeader.js.map +1 -1
  262. package/dist/mocked_classnames/src/components/DatePicker/YearPicker/YearsList.js +1 -1
  263. package/dist/mocked_classnames/src/components/DatePicker/YearPicker/YearsList.js.map +1 -1
  264. package/dist/mocked_classnames/src/components/Dropdown/components/ChildrenContent/ChildrenContent.js +1 -1
  265. package/dist/mocked_classnames/src/components/Dropdown/components/ChildrenContent/ChildrenContent.js.map +1 -1
  266. package/dist/mocked_classnames/src/components/Dropdown/components/ClearIndicator/ClearIndicator.js +1 -1
  267. package/dist/mocked_classnames/src/components/Dropdown/components/ClearIndicator/ClearIndicator.js.map +1 -1
  268. package/dist/mocked_classnames/src/components/Dropdown/components/DropdownIndicator/DropdownIndicator.js +1 -1
  269. package/dist/mocked_classnames/src/components/Dropdown/components/DropdownIndicator/DropdownIndicator.js.map +1 -1
  270. package/dist/mocked_classnames/src/components/EmptyState/EmptyState.js +1 -1
  271. package/dist/mocked_classnames/src/components/EmptyState/EmptyState.js.map +1 -1
  272. package/dist/mocked_classnames/src/components/ExpandCollapse/ExpandCollapse.js +1 -1
  273. package/dist/mocked_classnames/src/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
  274. package/dist/mocked_classnames/src/components/FieldLabel/FieldLabel.js +1 -1
  275. package/dist/mocked_classnames/src/components/FieldLabel/FieldLabel.js.map +1 -1
  276. package/dist/mocked_classnames/src/components/IconButton/IconButton.js +1 -1
  277. package/dist/mocked_classnames/src/components/IconButton/IconButton.js.map +1 -1
  278. package/dist/mocked_classnames/src/components/Info/Info.js +1 -1
  279. package/dist/mocked_classnames/src/components/Info/Info.js.map +1 -1
  280. package/dist/mocked_classnames/src/components/LegacyModal/LegacyModalFooter/LegacyModalFooterButtons/LegacyModalFooterButtons.js +1 -1
  281. package/dist/mocked_classnames/src/components/LegacyModal/LegacyModalFooter/LegacyModalFooterButtons/LegacyModalFooterButtons.js.map +1 -1
  282. package/dist/mocked_classnames/src/components/LegacyModal/LegacyModalHeader/LegacyModalHeader.js +1 -1
  283. package/dist/mocked_classnames/src/components/LegacyModal/LegacyModalHeader/LegacyModalHeader.js.map +1 -1
  284. package/dist/mocked_classnames/src/components/Link/Link.js +1 -1
  285. package/dist/mocked_classnames/src/components/Link/Link.js.map +1 -1
  286. package/dist/mocked_classnames/src/components/ListItemIcon/ListItemIcon.js +1 -1
  287. package/dist/mocked_classnames/src/components/ListItemIcon/ListItemIcon.js.map +1 -1
  288. package/dist/mocked_classnames/src/components/Menu/MenuItem/MenuItem.js +1 -1
  289. package/dist/mocked_classnames/src/components/Menu/MenuItem/MenuItem.js.map +1 -1
  290. package/dist/mocked_classnames/src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.js +1 -1
  291. package/dist/mocked_classnames/src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.js.map +1 -1
  292. package/dist/mocked_classnames/src/components/Menu/MenuItem/components/MenuItemSubMenuIcon/MenuItemSubMenuIcon.js +1 -1
  293. package/dist/mocked_classnames/src/components/Menu/MenuItem/components/MenuItemSubMenuIcon/MenuItemSubMenuIcon.js.map +1 -1
  294. package/dist/mocked_classnames/src/components/Menu/MenuItemButton/MenuItemButton.js +1 -1
  295. package/dist/mocked_classnames/src/components/Menu/MenuItemButton/MenuItemButton.js.map +1 -1
  296. package/dist/mocked_classnames/src/components/MenuButton/MenuButton.js +1 -1
  297. package/dist/mocked_classnames/src/components/MenuButton/MenuButton.js.map +1 -1
  298. package/dist/mocked_classnames/src/components/Modal/ModalHeader/ModalHeader.js +1 -1
  299. package/dist/mocked_classnames/src/components/Modal/ModalHeader/ModalHeader.js.map +1 -1
  300. package/dist/mocked_classnames/src/components/Modal/ModalTopActions/ModalTopActions.js +1 -1
  301. package/dist/mocked_classnames/src/components/Modal/ModalTopActions/ModalTopActions.js.map +1 -1
  302. package/dist/mocked_classnames/src/components/Modal/footers/ModalFooterBase/ModalFooterBase.js +1 -1
  303. package/dist/mocked_classnames/src/components/Modal/footers/ModalFooterBase/ModalFooterBase.js.map +1 -1
  304. package/dist/mocked_classnames/src/components/MultiStepIndicator/MultiStepIndicator.js +1 -1
  305. package/dist/mocked_classnames/src/components/MultiStepIndicator/MultiStepIndicator.js.map +1 -1
  306. package/dist/mocked_classnames/src/components/MultiStepIndicator/components/StepIndicator/StepIndicator.js +1 -1
  307. package/dist/mocked_classnames/src/components/MultiStepIndicator/components/StepIndicator/StepIndicator.js.map +1 -1
  308. package/dist/mocked_classnames/src/components/NumberField/NumberField.js +1 -1
  309. package/dist/mocked_classnames/src/components/NumberField/NumberField.js.map +1 -1
  310. package/dist/mocked_classnames/src/components/NumberField/components/NumberFieldSpinButton/NumberFieldSpinButton.js +1 -1
  311. package/dist/mocked_classnames/src/components/NumberField/components/NumberFieldSpinButton/NumberFieldSpinButton.js.map +1 -1
  312. package/dist/mocked_classnames/src/components/Search/Search.js +1 -1
  313. package/dist/mocked_classnames/src/components/Search/Search.js.map +1 -1
  314. package/dist/mocked_classnames/src/components/Slider/Slider.js.map +1 -1
  315. package/dist/mocked_classnames/src/components/Slider/SliderConstants.js.map +1 -1
  316. package/dist/mocked_classnames/src/components/Slider/SliderContext.js.map +1 -1
  317. package/dist/mocked_classnames/src/components/Slider/SliderInfixHooks.js +1 -1
  318. package/dist/mocked_classnames/src/components/Slider/SliderInfixHooks.js.map +1 -1
  319. package/dist/mocked_classnames/src/components/SplitButton/SplitButton.js +1 -1
  320. package/dist/mocked_classnames/src/components/SplitButton/SplitButton.js.map +1 -1
  321. package/dist/mocked_classnames/src/components/Steps/Steps.js.map +1 -1
  322. package/dist/mocked_classnames/src/components/Steps/StepsCommand.js +1 -1
  323. package/dist/mocked_classnames/src/components/Steps/StepsCommand.js.map +1 -1
  324. package/dist/mocked_classnames/src/components/Steps/StepsHeader.js +1 -1
  325. package/dist/mocked_classnames/src/components/Steps/StepsHeader.js.map +1 -1
  326. package/dist/mocked_classnames/src/components/Table/Table/Table.js.map +1 -1
  327. package/dist/mocked_classnames/src/components/Table/Table/tableHelpers.js +1 -1
  328. package/dist/mocked_classnames/src/components/Table/Table/tableHelpers.js.map +1 -1
  329. package/dist/mocked_classnames/src/components/Table/TableHeaderCell/TableHeaderCell.js +1 -1
  330. package/dist/mocked_classnames/src/components/Table/TableHeaderCell/TableHeaderCell.js.map +1 -1
  331. package/dist/mocked_classnames/src/components/Tabs/Tab/Tab.js +1 -1
  332. package/dist/mocked_classnames/src/components/Tabs/Tab/Tab.js.map +1 -1
  333. package/dist/mocked_classnames/src/components/TextField/TextField.js +1 -1
  334. package/dist/mocked_classnames/src/components/TextField/TextField.js.map +1 -1
  335. package/dist/mocked_classnames/src/components/Tipseen/Tipseen.js +1 -1
  336. package/dist/mocked_classnames/src/components/Tipseen/Tipseen.js.map +1 -1
  337. package/dist/mocked_classnames/src/components/Tipseen/TipseenContent.js +1 -1
  338. package/dist/mocked_classnames/src/components/Tipseen/TipseenContent.js.map +1 -1
  339. package/dist/mocked_classnames/src/components/Tipseen/TipseenWizard.js.map +1 -1
  340. package/dist/mocked_classnames/src/components/Toast/Toast.js +1 -1
  341. package/dist/mocked_classnames/src/components/Toast/Toast.js.map +1 -1
  342. package/dist/mocked_classnames/src/components/Toast/ToastButton/ToastButton.js +1 -1
  343. package/dist/mocked_classnames/src/components/Toast/ToastButton/ToastButton.js.map +1 -1
  344. package/dist/mocked_classnames/src/components/Toast/ToastConstants.js +1 -1
  345. package/dist/mocked_classnames/src/components/Toast/ToastConstants.js.map +1 -1
  346. package/dist/mocked_classnames/src/components/Toast/ToastHelpers.js +1 -1
  347. package/dist/mocked_classnames/src/components/Toast/ToastHelpers.js.map +1 -1
  348. package/dist/mocked_classnames/src/components/Tooltip/Tooltip.js +1 -1
  349. package/dist/mocked_classnames/src/components/Tooltip/Tooltip.js.map +1 -1
  350. package/dist/mocked_classnames/src/components/next/AttentionBox/components/AttentionBoxButton/AttentionBoxButton.js +1 -1
  351. package/dist/mocked_classnames/src/components/next/AttentionBox/components/AttentionBoxButton/AttentionBoxButton.js.map +1 -1
  352. package/dist/mocked_classnames/src/components/next/AttentionBox/components/AttentionBoxCloseButton/AttentionBoxCloseButton.js +1 -1
  353. package/dist/mocked_classnames/src/components/next/AttentionBox/components/AttentionBoxCloseButton/AttentionBoxCloseButton.js.map +1 -1
  354. package/dist/mocked_classnames/src/components/next/AttentionBox/components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon.js +1 -1
  355. package/dist/mocked_classnames/src/components/next/AttentionBox/components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon.js.map +1 -1
  356. package/dist/mocked_classnames/src/components/next/AttentionBox/consts/icons.js +1 -1
  357. package/dist/mocked_classnames/src/components/next/AttentionBox/consts/icons.js.map +1 -1
  358. package/dist/mocked_classnames/src/components/next/AttentionBox/utils/iconUtils.js.map +1 -1
  359. package/dist/mocked_classnames/src/components/next/Dropdown/components/Trigger/TriggerActions.js +1 -1
  360. package/dist/mocked_classnames/src/components/next/Dropdown/components/Trigger/TriggerActions.js.map +1 -1
  361. package/dist/mocked_classnames/src/index.js +1 -1
  362. package/dist/mocked_classnames/types/index.d.ts +0 -1
  363. package/dist/packages/shared/dist/constants/keyCodes.js +2 -0
  364. package/dist/packages/shared/dist/constants/keyCodes.js.map +1 -0
  365. package/dist/packages/shared/dist/constants/sizes.js +2 -0
  366. package/dist/packages/shared/dist/constants/sizes.js.map +1 -0
  367. package/dist/packages/shared/dist/hooks/ssr/useIsMounted.js +2 -0
  368. package/dist/packages/shared/dist/hooks/ssr/useIsMounted.js.map +1 -0
  369. package/dist/packages/shared/dist/hooks/ssr/useIsomorphicLayoutEffect.js +2 -0
  370. package/dist/packages/shared/dist/hooks/ssr/useIsomorphicLayoutEffect.js.map +1 -0
  371. package/dist/packages/shared/dist/hooks/useEventListener.js +2 -0
  372. package/dist/packages/shared/dist/hooks/useEventListener.js.map +1 -0
  373. package/dist/packages/shared/dist/hooks/useKeyEvent.js +2 -0
  374. package/dist/packages/shared/dist/hooks/useKeyEvent.js.map +1 -0
  375. package/dist/packages/shared/dist/hooks/useMergeRef.js +2 -0
  376. package/dist/packages/shared/dist/hooks/useMergeRef.js.map +1 -0
  377. package/dist/packages/shared/dist/tests/constants.js +2 -0
  378. package/dist/packages/shared/dist/tests/constants.js.map +1 -0
  379. package/dist/packages/shared/dist/tests/test-ids-utils.js +2 -0
  380. package/dist/packages/shared/dist/tests/test-ids-utils.js.map +1 -0
  381. package/dist/packages/shared/dist/types/withStaticProps.js +2 -0
  382. package/dist/packages/shared/dist/types/withStaticProps.js.map +1 -0
  383. package/dist/packages/shared/dist/utils/function-utils.js +2 -0
  384. package/dist/packages/shared/dist/utils/function-utils.js.map +1 -0
  385. package/dist/packages/shared/dist/utils/screenReaderAccessHelper.js +2 -0
  386. package/dist/packages/shared/dist/utils/screenReaderAccessHelper.js.map +1 -0
  387. package/dist/packages/shared/dist/utils/ssr-utils.js +2 -0
  388. package/dist/packages/shared/dist/utils/ssr-utils.js.map +1 -0
  389. package/dist/packages/shared/dist/utils/typesciptCssModulesHelper.js +2 -0
  390. package/dist/packages/shared/dist/utils/typesciptCssModulesHelper.js.map +1 -0
  391. package/dist/src/components/AlertBanner/AlertBanner.js +1 -1
  392. package/dist/src/components/AlertBanner/AlertBanner.js.map +1 -1
  393. package/dist/src/components/AlertBanner/AlertBannerButton/AlertBannerButton.js +1 -1
  394. package/dist/src/components/AlertBanner/AlertBannerButton/AlertBannerButton.js.map +1 -1
  395. package/dist/src/components/AttentionBox/AttentionBox.js +1 -1
  396. package/dist/src/components/AttentionBox/AttentionBox.js.map +1 -1
  397. package/dist/src/components/AttentionBox/AttentionBoxConstants.js +1 -1
  398. package/dist/src/components/AttentionBox/AttentionBoxConstants.js.map +1 -1
  399. package/dist/src/components/Avatar/Avatar.js.map +1 -1
  400. package/dist/src/components/Avatar/AvatarBadge.js +1 -1
  401. package/dist/src/components/Avatar/AvatarBadge.js.map +1 -1
  402. package/dist/src/components/Avatar/AvatarContent.js +1 -1
  403. package/dist/src/components/Avatar/AvatarContent.js.map +1 -1
  404. package/dist/src/components/BaseListItem/utils.js +1 -1
  405. package/dist/src/components/BaseListItem/utils.js.map +1 -1
  406. package/dist/src/components/BreadcrumbsBar/BreadcrumbItem/BreadcrumbContent/BreadcrumbContent.js.map +1 -1
  407. package/dist/src/components/BreadcrumbsBar/BreadcrumbItem/BreadcrumbItem.js.map +1 -1
  408. package/dist/src/components/BreadcrumbsBar/BreadcrumbsBar.js +1 -1
  409. package/dist/src/components/BreadcrumbsBar/BreadcrumbsBar.js.map +1 -1
  410. package/dist/src/components/ButtonGroup/ButtonGroup.js +1 -1
  411. package/dist/src/components/ButtonGroup/ButtonGroup.js.map +1 -1
  412. package/dist/src/components/ButtonGroup/ButtonWrapper.js +1 -1
  413. package/dist/src/components/ButtonGroup/ButtonWrapper.js.map +1 -1
  414. package/dist/src/components/Checkbox/Checkbox.js +1 -1
  415. package/dist/src/components/Checkbox/Checkbox.js.map +1 -1
  416. package/dist/src/components/Chips/Chips.js +1 -1
  417. package/dist/src/components/Chips/Chips.js.map +1 -1
  418. package/dist/src/components/ColorPicker/ColorPicker.js +1 -1
  419. package/dist/src/components/ColorPicker/ColorPicker.js.map +1 -1
  420. package/dist/src/components/ColorPicker/components/ColorPickerContent/ColorPickerClearButton.js +1 -1
  421. package/dist/src/components/ColorPicker/components/ColorPickerContent/ColorPickerClearButton.js.map +1 -1
  422. package/dist/src/components/ColorPicker/components/ColorPickerContent/ColorPickerColorsGrid.js.map +1 -1
  423. package/dist/src/components/ColorPicker/components/ColorPickerContent/ColorPickerContent.js +1 -1
  424. package/dist/src/components/ColorPicker/components/ColorPickerContent/ColorPickerContent.js.map +1 -1
  425. package/dist/src/components/ColorPicker/components/ColorPickerItemComponent/ColorPickerItemComponent.js +1 -1
  426. package/dist/src/components/ColorPicker/components/ColorPickerItemComponent/ColorPickerItemComponent.js.map +1 -1
  427. package/dist/src/components/Combobox/Combobox.js +1 -1
  428. package/dist/src/components/Combobox/Combobox.js.map +1 -1
  429. package/dist/src/components/Combobox/components/ComboboxConstants.js.map +1 -1
  430. package/dist/src/components/Combobox/components/ComboboxOption/ComboboxOption.js +1 -1
  431. package/dist/src/components/Combobox/components/ComboboxOption/ComboboxOption.js.map +1 -1
  432. package/dist/src/components/DatePicker/DateNavigationItem/DateNavigationItem.js +1 -1
  433. package/dist/src/components/DatePicker/DateNavigationItem/DateNavigationItem.js.map +1 -1
  434. package/dist/src/components/DatePicker/DatePickerHeader/DatePickerHeader.js +1 -1
  435. package/dist/src/components/DatePicker/DatePickerHeader/DatePickerHeader.js.map +1 -1
  436. package/dist/src/components/DatePicker/YearPicker/YearsList.js +1 -1
  437. package/dist/src/components/DatePicker/YearPicker/YearsList.js.map +1 -1
  438. package/dist/src/components/Dropdown/components/ChildrenContent/ChildrenContent.js +1 -1
  439. package/dist/src/components/Dropdown/components/ChildrenContent/ChildrenContent.js.map +1 -1
  440. package/dist/src/components/Dropdown/components/ClearIndicator/ClearIndicator.js +1 -1
  441. package/dist/src/components/Dropdown/components/ClearIndicator/ClearIndicator.js.map +1 -1
  442. package/dist/src/components/Dropdown/components/DropdownIndicator/DropdownIndicator.js +1 -1
  443. package/dist/src/components/Dropdown/components/DropdownIndicator/DropdownIndicator.js.map +1 -1
  444. package/dist/src/components/EmptyState/EmptyState.js +1 -1
  445. package/dist/src/components/EmptyState/EmptyState.js.map +1 -1
  446. package/dist/src/components/ExpandCollapse/ExpandCollapse.js +1 -1
  447. package/dist/src/components/ExpandCollapse/ExpandCollapse.js.map +1 -1
  448. package/dist/src/components/FieldLabel/FieldLabel.js +1 -1
  449. package/dist/src/components/FieldLabel/FieldLabel.js.map +1 -1
  450. package/dist/src/components/IconButton/IconButton.js +1 -1
  451. package/dist/src/components/IconButton/IconButton.js.map +1 -1
  452. package/dist/src/components/Info/Info.js +1 -1
  453. package/dist/src/components/Info/Info.js.map +1 -1
  454. package/dist/src/components/LegacyModal/LegacyModalFooter/LegacyModalFooterButtons/LegacyModalFooterButtons.js +1 -1
  455. package/dist/src/components/LegacyModal/LegacyModalFooter/LegacyModalFooterButtons/LegacyModalFooterButtons.js.map +1 -1
  456. package/dist/src/components/LegacyModal/LegacyModalHeader/LegacyModalHeader.js +1 -1
  457. package/dist/src/components/LegacyModal/LegacyModalHeader/LegacyModalHeader.js.map +1 -1
  458. package/dist/src/components/Link/Link.js +1 -1
  459. package/dist/src/components/Link/Link.js.map +1 -1
  460. package/dist/src/components/ListItemIcon/ListItemIcon.js +1 -1
  461. package/dist/src/components/ListItemIcon/ListItemIcon.js.map +1 -1
  462. package/dist/src/components/Menu/MenuItem/MenuItem.js +1 -1
  463. package/dist/src/components/Menu/MenuItem/MenuItem.js.map +1 -1
  464. package/dist/src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.js +1 -1
  465. package/dist/src/components/Menu/MenuItem/components/MenuItemIcon/MenuItemIcon.js.map +1 -1
  466. package/dist/src/components/Menu/MenuItem/components/MenuItemSubMenuIcon/MenuItemSubMenuIcon.js +1 -1
  467. package/dist/src/components/Menu/MenuItem/components/MenuItemSubMenuIcon/MenuItemSubMenuIcon.js.map +1 -1
  468. package/dist/src/components/Menu/MenuItemButton/MenuItemButton.js +1 -1
  469. package/dist/src/components/Menu/MenuItemButton/MenuItemButton.js.map +1 -1
  470. package/dist/src/components/MenuButton/MenuButton.js +1 -1
  471. package/dist/src/components/MenuButton/MenuButton.js.map +1 -1
  472. package/dist/src/components/Modal/ModalHeader/ModalHeader.js +1 -1
  473. package/dist/src/components/Modal/ModalHeader/ModalHeader.js.map +1 -1
  474. package/dist/src/components/Modal/ModalTopActions/ModalTopActions.js +1 -1
  475. package/dist/src/components/Modal/ModalTopActions/ModalTopActions.js.map +1 -1
  476. package/dist/src/components/Modal/footers/ModalFooterBase/ModalFooterBase.js +1 -1
  477. package/dist/src/components/Modal/footers/ModalFooterBase/ModalFooterBase.js.map +1 -1
  478. package/dist/src/components/MultiStepIndicator/MultiStepIndicator.js +1 -1
  479. package/dist/src/components/MultiStepIndicator/MultiStepIndicator.js.map +1 -1
  480. package/dist/src/components/MultiStepIndicator/components/StepIndicator/StepIndicator.js +1 -1
  481. package/dist/src/components/MultiStepIndicator/components/StepIndicator/StepIndicator.js.map +1 -1
  482. package/dist/src/components/NumberField/NumberField.js +1 -1
  483. package/dist/src/components/NumberField/NumberField.js.map +1 -1
  484. package/dist/src/components/NumberField/components/NumberFieldSpinButton/NumberFieldSpinButton.js +1 -1
  485. package/dist/src/components/NumberField/components/NumberFieldSpinButton/NumberFieldSpinButton.js.map +1 -1
  486. package/dist/src/components/Search/Search.js +1 -1
  487. package/dist/src/components/Search/Search.js.map +1 -1
  488. package/dist/src/components/Slider/Slider.js.map +1 -1
  489. package/dist/src/components/Slider/SliderConstants.js.map +1 -1
  490. package/dist/src/components/Slider/SliderContext.js.map +1 -1
  491. package/dist/src/components/Slider/SliderInfixHooks.js +1 -1
  492. package/dist/src/components/Slider/SliderInfixHooks.js.map +1 -1
  493. package/dist/src/components/SplitButton/SplitButton.js +1 -1
  494. package/dist/src/components/SplitButton/SplitButton.js.map +1 -1
  495. package/dist/src/components/Steps/Steps.js.map +1 -1
  496. package/dist/src/components/Steps/StepsCommand.js +1 -1
  497. package/dist/src/components/Steps/StepsCommand.js.map +1 -1
  498. package/dist/src/components/Steps/StepsHeader.js +1 -1
  499. package/dist/src/components/Steps/StepsHeader.js.map +1 -1
  500. package/dist/src/components/Table/Table/Table.js.map +1 -1
  501. package/dist/src/components/Table/Table/tableHelpers.js +1 -1
  502. package/dist/src/components/Table/Table/tableHelpers.js.map +1 -1
  503. package/dist/src/components/Table/TableHeaderCell/TableHeaderCell.js +1 -1
  504. package/dist/src/components/Table/TableHeaderCell/TableHeaderCell.js.map +1 -1
  505. package/dist/src/components/Tabs/Tab/Tab.js +1 -1
  506. package/dist/src/components/Tabs/Tab/Tab.js.map +1 -1
  507. package/dist/src/components/TextField/TextField.js +1 -1
  508. package/dist/src/components/TextField/TextField.js.map +1 -1
  509. package/dist/src/components/Tipseen/Tipseen.js +1 -1
  510. package/dist/src/components/Tipseen/Tipseen.js.map +1 -1
  511. package/dist/src/components/Tipseen/TipseenContent.js +1 -1
  512. package/dist/src/components/Tipseen/TipseenContent.js.map +1 -1
  513. package/dist/src/components/Tipseen/TipseenWizard.js.map +1 -1
  514. package/dist/src/components/Toast/Toast.js +1 -1
  515. package/dist/src/components/Toast/Toast.js.map +1 -1
  516. package/dist/src/components/Toast/ToastButton/ToastButton.js +1 -1
  517. package/dist/src/components/Toast/ToastButton/ToastButton.js.map +1 -1
  518. package/dist/src/components/Toast/ToastConstants.js +1 -1
  519. package/dist/src/components/Toast/ToastConstants.js.map +1 -1
  520. package/dist/src/components/Toast/ToastHelpers.js +1 -1
  521. package/dist/src/components/Toast/ToastHelpers.js.map +1 -1
  522. package/dist/src/components/Tooltip/Tooltip.js +1 -1
  523. package/dist/src/components/Tooltip/Tooltip.js.map +1 -1
  524. package/dist/src/components/next/AttentionBox/components/AttentionBoxButton/AttentionBoxButton.js +1 -1
  525. package/dist/src/components/next/AttentionBox/components/AttentionBoxButton/AttentionBoxButton.js.map +1 -1
  526. package/dist/src/components/next/AttentionBox/components/AttentionBoxCloseButton/AttentionBoxCloseButton.js +1 -1
  527. package/dist/src/components/next/AttentionBox/components/AttentionBoxCloseButton/AttentionBoxCloseButton.js.map +1 -1
  528. package/dist/src/components/next/AttentionBox/components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon.js +1 -1
  529. package/dist/src/components/next/AttentionBox/components/AttentionBoxLeadingIcon/AttentionBoxLeadingIcon.js.map +1 -1
  530. package/dist/src/components/next/AttentionBox/consts/icons.js +1 -1
  531. package/dist/src/components/next/AttentionBox/consts/icons.js.map +1 -1
  532. package/dist/src/components/next/AttentionBox/utils/iconUtils.js.map +1 -1
  533. package/dist/src/components/next/Dropdown/components/Trigger/TriggerActions.js +1 -1
  534. package/dist/src/components/next/Dropdown/components/Trigger/TriggerActions.js.map +1 -1
  535. package/dist/src/index.js +1 -1
  536. package/dist/types/index.d.ts +0 -1
  537. package/package.json +8 -4
  538. package/dist/components/Button/Button.d.ts +0 -98
  539. package/dist/components/Button/Button.types.d.ts +0 -4
  540. package/dist/components/Button/ButtonConstants.d.ts +0 -37
  541. package/dist/components/Button/helper/useButtonLoading.d.ts +0 -5
  542. package/dist/components/Button/index.d.ts +0 -2
  543. package/dist/components/Icon/CustomSvgIcon/CustomSvgIcon.d.ts +0 -46
  544. package/dist/components/Icon/FontIcon/FontIcon.d.ts +0 -30
  545. package/dist/components/Icon/Icon.d.ts +0 -76
  546. package/dist/components/Icon/Icon.types.d.ts +0 -1
  547. package/dist/components/Icon/IconConstants.d.ts +0 -8
  548. package/dist/components/Icon/hooks/useIconProps.d.ts +0 -21
  549. package/dist/components/Icon/index.d.ts +0 -3
  550. package/dist/components/Loader/Loader.d.ts +0 -27
  551. package/dist/components/Loader/Loader.types.d.ts +0 -3
  552. package/dist/components/Loader/LoaderConstants.d.ts +0 -18
  553. package/dist/components/Loader/index.d.ts +0 -2
  554. package/dist/hooks/useIconScreenReaderAccessProps.d.ts +0 -10
  555. package/dist/icons/dist/_virtual/_tslib.js.map +0 -1
  556. package/dist/icons/dist/react/AddSmall.js.map +0 -1
  557. package/dist/icons/dist/react/Alert.js.map +0 -1
  558. package/dist/icons/dist/react/Check.js.map +0 -1
  559. package/dist/icons/dist/react/CloseMedium.js.map +0 -1
  560. package/dist/icons/dist/react/CloseSmall.js.map +0 -1
  561. package/dist/icons/dist/react/DropdownChevronDown.js.map +0 -1
  562. package/dist/icons/dist/react/DropdownChevronRight.js.map +0 -1
  563. package/dist/icons/dist/react/DropdownChevronUp.js.map +0 -1
  564. package/dist/icons/dist/react/Favorite.js.map +0 -1
  565. package/dist/icons/dist/react/Info.js.map +0 -1
  566. package/dist/icons/dist/react/Menu.js.map +0 -1
  567. package/dist/icons/dist/react/MoveArrowLeft.js.map +0 -1
  568. package/dist/icons/dist/react/MoveArrowRight.js.map +0 -1
  569. package/dist/icons/dist/react/NavigationChevronLeft.js.map +0 -1
  570. package/dist/icons/dist/react/NavigationChevronRight.js.map +0 -1
  571. package/dist/icons/dist/react/NoColor.js.map +0 -1
  572. package/dist/icons/dist/react/Remove.js.map +0 -1
  573. package/dist/icons/dist/react/Search.js.map +0 -1
  574. package/dist/icons/dist/react/Sort.js.map +0 -1
  575. package/dist/icons/dist/react/SortAscending.js.map +0 -1
  576. package/dist/icons/dist/react/SortDescending.js.map +0 -1
  577. package/dist/icons/dist/react/Warning.js.map +0 -1
  578. package/dist/mocked_classnames/components/Button/Button.d.ts +0 -98
  579. package/dist/mocked_classnames/components/Button/Button.types.d.ts +0 -4
  580. package/dist/mocked_classnames/components/Button/ButtonConstants.d.ts +0 -37
  581. package/dist/mocked_classnames/components/Button/helper/useButtonLoading.d.ts +0 -5
  582. package/dist/mocked_classnames/components/Button/index.d.ts +0 -2
  583. package/dist/mocked_classnames/components/Icon/CustomSvgIcon/CustomSvgIcon.d.ts +0 -46
  584. package/dist/mocked_classnames/components/Icon/FontIcon/FontIcon.d.ts +0 -30
  585. package/dist/mocked_classnames/components/Icon/Icon.d.ts +0 -76
  586. package/dist/mocked_classnames/components/Icon/Icon.types.d.ts +0 -1
  587. package/dist/mocked_classnames/components/Icon/IconConstants.d.ts +0 -8
  588. package/dist/mocked_classnames/components/Icon/hooks/useIconProps.d.ts +0 -21
  589. package/dist/mocked_classnames/components/Icon/index.d.ts +0 -3
  590. package/dist/mocked_classnames/components/Loader/Loader.d.ts +0 -27
  591. package/dist/mocked_classnames/components/Loader/Loader.types.d.ts +0 -3
  592. package/dist/mocked_classnames/components/Loader/LoaderConstants.d.ts +0 -18
  593. package/dist/mocked_classnames/components/Loader/index.d.ts +0 -2
  594. package/dist/mocked_classnames/hooks/useIconScreenReaderAccessProps.d.ts +0 -10
  595. package/dist/mocked_classnames/src/components/Button/Button.js +0 -2
  596. package/dist/mocked_classnames/src/components/Button/Button.js.map +0 -1
  597. package/dist/mocked_classnames/src/components/Button/Button.module.scss.js +0 -2
  598. package/dist/mocked_classnames/src/components/Button/ButtonConstants.js +0 -2
  599. package/dist/mocked_classnames/src/components/Button/ButtonConstants.js.map +0 -1
  600. package/dist/mocked_classnames/src/components/Button/helper/dom-helpers.js.map +0 -1
  601. package/dist/mocked_classnames/src/components/Button/helper/useButtonLoading.js +0 -2
  602. package/dist/mocked_classnames/src/components/Button/helper/useButtonLoading.js.map +0 -1
  603. package/dist/mocked_classnames/src/components/Icon/CustomSvgIcon/CustomSvgIcon.js +0 -2
  604. package/dist/mocked_classnames/src/components/Icon/CustomSvgIcon/CustomSvgIcon.js.map +0 -1
  605. package/dist/mocked_classnames/src/components/Icon/FontIcon/FontIcon.js +0 -2
  606. package/dist/mocked_classnames/src/components/Icon/FontIcon/FontIcon.js.map +0 -1
  607. package/dist/mocked_classnames/src/components/Icon/Icon.js +0 -2
  608. package/dist/mocked_classnames/src/components/Icon/Icon.js.map +0 -1
  609. package/dist/mocked_classnames/src/components/Icon/Icon.module.scss.js +0 -2
  610. package/dist/mocked_classnames/src/components/Icon/IconConstants.js +0 -2
  611. package/dist/mocked_classnames/src/components/Icon/IconConstants.js.map +0 -1
  612. package/dist/mocked_classnames/src/components/Icon/hooks/useIconProps.js +0 -2
  613. package/dist/mocked_classnames/src/components/Icon/hooks/useIconProps.js.map +0 -1
  614. package/dist/mocked_classnames/src/components/Loader/Loader.js +0 -2
  615. package/dist/mocked_classnames/src/components/Loader/Loader.js.map +0 -1
  616. package/dist/mocked_classnames/src/components/Loader/Loader.module.scss.js +0 -2
  617. package/dist/mocked_classnames/src/components/Loader/LoaderConstants.js.map +0 -1
  618. package/dist/mocked_classnames/src/helpers/screenReaderAccessHelper.js +0 -2
  619. package/dist/mocked_classnames/src/helpers/screenReaderAccessHelper.js.map +0 -1
  620. package/dist/mocked_classnames/src/hooks/ssr/useIsMounted.js +0 -2
  621. package/dist/mocked_classnames/src/hooks/ssr/useIsMounted.js.map +0 -1
  622. package/dist/mocked_classnames/src/hooks/useIconScreenReaderAccessProps.js +0 -2
  623. package/dist/mocked_classnames/src/hooks/useIconScreenReaderAccessProps.js.map +0 -1
  624. package/dist/mocked_classnames/types/SubIcon.d.ts +0 -3
  625. package/dist/src/components/Button/Button.js +0 -2
  626. package/dist/src/components/Button/Button.js.map +0 -1
  627. package/dist/src/components/Button/Button.module.scss.js +0 -2
  628. package/dist/src/components/Button/ButtonConstants.js +0 -2
  629. package/dist/src/components/Button/ButtonConstants.js.map +0 -1
  630. package/dist/src/components/Button/helper/dom-helpers.js.map +0 -1
  631. package/dist/src/components/Button/helper/useButtonLoading.js +0 -2
  632. package/dist/src/components/Button/helper/useButtonLoading.js.map +0 -1
  633. package/dist/src/components/Icon/CustomSvgIcon/CustomSvgIcon.js +0 -2
  634. package/dist/src/components/Icon/CustomSvgIcon/CustomSvgIcon.js.map +0 -1
  635. package/dist/src/components/Icon/FontIcon/FontIcon.js +0 -2
  636. package/dist/src/components/Icon/FontIcon/FontIcon.js.map +0 -1
  637. package/dist/src/components/Icon/Icon.js +0 -2
  638. package/dist/src/components/Icon/Icon.js.map +0 -1
  639. package/dist/src/components/Icon/Icon.module.scss.js +0 -2
  640. package/dist/src/components/Icon/IconConstants.js +0 -2
  641. package/dist/src/components/Icon/IconConstants.js.map +0 -1
  642. package/dist/src/components/Icon/hooks/useIconProps.js +0 -2
  643. package/dist/src/components/Icon/hooks/useIconProps.js.map +0 -1
  644. package/dist/src/components/Loader/Loader.js +0 -2
  645. package/dist/src/components/Loader/Loader.js.map +0 -1
  646. package/dist/src/components/Loader/Loader.module.scss.js +0 -2
  647. package/dist/src/components/Loader/LoaderConstants.js.map +0 -1
  648. package/dist/src/helpers/screenReaderAccessHelper.js +0 -2
  649. package/dist/src/helpers/screenReaderAccessHelper.js.map +0 -1
  650. package/dist/src/hooks/ssr/useIsMounted.js +0 -2
  651. package/dist/src/hooks/ssr/useIsMounted.js.map +0 -1
  652. package/dist/src/hooks/useIconScreenReaderAccessProps.js +0 -2
  653. package/dist/src/hooks/useIconScreenReaderAccessProps.js.map +0 -1
  654. package/dist/types/SubIcon.d.ts +0 -3
  655. /package/dist/{mocked_classnames/src/components → components/button/dist}/Button/Button.module.scss.js.map +0 -0
  656. /package/dist/{mocked_classnames/src/components → components/button/dist}/Button/helper/dom-helpers.js +0 -0
  657. /package/dist/{mocked_classnames/src/components → components/icon/dist}/Icon/Icon.module.scss.js.map +0 -0
  658. /package/dist/{mocked_classnames/src/components → components/loader/dist}/Loader/Loader.module.scss.js.map +0 -0
  659. /package/dist/{mocked_classnames/src/components → components/loader/dist}/Loader/LoaderConstants.js +0 -0
  660. /package/dist/{src/components → mocked_classnames/components/button/dist}/Button/Button.module.scss.js.map +0 -0
  661. /package/dist/{src/components → mocked_classnames/components/button/dist}/Button/helper/dom-helpers.js +0 -0
  662. /package/dist/{src/components → mocked_classnames/components/icon/dist}/Icon/Icon.module.scss.js.map +0 -0
  663. /package/dist/{src/components → mocked_classnames/components/loader/dist}/Loader/Loader.module.scss.js.map +0 -0
  664. /package/dist/{src/components → mocked_classnames/components/loader/dist}/Loader/LoaderConstants.js +0 -0
  665. /package/dist/{icons → mocked_classnames/packages/icons}/dist/_virtual/_tslib.js +0 -0
  666. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/AddSmall.js +0 -0
  667. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/Alert.js +0 -0
  668. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/Check.js +0 -0
  669. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/CloseMedium.js +0 -0
  670. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/CloseSmall.js +0 -0
  671. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/DropdownChevronDown.js +0 -0
  672. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/DropdownChevronRight.js +0 -0
  673. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/DropdownChevronUp.js +0 -0
  674. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/Favorite.js +0 -0
  675. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/Info.js +0 -0
  676. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/Menu.js +0 -0
  677. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/MoveArrowLeft.js +0 -0
  678. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/MoveArrowRight.js +0 -0
  679. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/NavigationChevronLeft.js +0 -0
  680. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/NavigationChevronRight.js +0 -0
  681. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/NoColor.js +0 -0
  682. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/Remove.js +0 -0
  683. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/Search.js +0 -0
  684. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/Sort.js +0 -0
  685. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/SortAscending.js +0 -0
  686. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/SortDescending.js +0 -0
  687. /package/dist/{icons → mocked_classnames/packages/icons}/dist/react/Warning.js +0 -0
  688. /package/dist/mocked_classnames/{style → packages/style}/dist/index.min.css.js +0 -0
  689. /package/dist/mocked_classnames/{style → packages/style}/dist/index.min.css.js.map +0 -0
  690. /package/dist/{mocked_classnames → packages}/icons/dist/_virtual/_tslib.js +0 -0
  691. /package/dist/{mocked_classnames → packages}/icons/dist/_virtual/_tslib.js.map +0 -0
  692. /package/dist/{mocked_classnames → packages}/icons/dist/react/AddSmall.js +0 -0
  693. /package/dist/{mocked_classnames → packages}/icons/dist/react/AddSmall.js.map +0 -0
  694. /package/dist/{mocked_classnames → packages}/icons/dist/react/Alert.js +0 -0
  695. /package/dist/{mocked_classnames → packages}/icons/dist/react/Alert.js.map +0 -0
  696. /package/dist/{mocked_classnames → packages}/icons/dist/react/Check.js +0 -0
  697. /package/dist/{mocked_classnames → packages}/icons/dist/react/Check.js.map +0 -0
  698. /package/dist/{mocked_classnames → packages}/icons/dist/react/CloseMedium.js +0 -0
  699. /package/dist/{mocked_classnames → packages}/icons/dist/react/CloseMedium.js.map +0 -0
  700. /package/dist/{mocked_classnames → packages}/icons/dist/react/CloseSmall.js +0 -0
  701. /package/dist/{mocked_classnames → packages}/icons/dist/react/CloseSmall.js.map +0 -0
  702. /package/dist/{mocked_classnames → packages}/icons/dist/react/DropdownChevronDown.js +0 -0
  703. /package/dist/{mocked_classnames → packages}/icons/dist/react/DropdownChevronDown.js.map +0 -0
  704. /package/dist/{mocked_classnames → packages}/icons/dist/react/DropdownChevronRight.js +0 -0
  705. /package/dist/{mocked_classnames → packages}/icons/dist/react/DropdownChevronRight.js.map +0 -0
  706. /package/dist/{mocked_classnames → packages}/icons/dist/react/DropdownChevronUp.js +0 -0
  707. /package/dist/{mocked_classnames → packages}/icons/dist/react/DropdownChevronUp.js.map +0 -0
  708. /package/dist/{mocked_classnames → packages}/icons/dist/react/Favorite.js +0 -0
  709. /package/dist/{mocked_classnames → packages}/icons/dist/react/Favorite.js.map +0 -0
  710. /package/dist/{mocked_classnames → packages}/icons/dist/react/Info.js +0 -0
  711. /package/dist/{mocked_classnames → packages}/icons/dist/react/Info.js.map +0 -0
  712. /package/dist/{mocked_classnames → packages}/icons/dist/react/Menu.js +0 -0
  713. /package/dist/{mocked_classnames → packages}/icons/dist/react/Menu.js.map +0 -0
  714. /package/dist/{mocked_classnames → packages}/icons/dist/react/MoveArrowLeft.js +0 -0
  715. /package/dist/{mocked_classnames → packages}/icons/dist/react/MoveArrowLeft.js.map +0 -0
  716. /package/dist/{mocked_classnames → packages}/icons/dist/react/MoveArrowRight.js +0 -0
  717. /package/dist/{mocked_classnames → packages}/icons/dist/react/MoveArrowRight.js.map +0 -0
  718. /package/dist/{mocked_classnames → packages}/icons/dist/react/NavigationChevronLeft.js +0 -0
  719. /package/dist/{mocked_classnames → packages}/icons/dist/react/NavigationChevronLeft.js.map +0 -0
  720. /package/dist/{mocked_classnames → packages}/icons/dist/react/NavigationChevronRight.js +0 -0
  721. /package/dist/{mocked_classnames → packages}/icons/dist/react/NavigationChevronRight.js.map +0 -0
  722. /package/dist/{mocked_classnames → packages}/icons/dist/react/NoColor.js +0 -0
  723. /package/dist/{mocked_classnames → packages}/icons/dist/react/NoColor.js.map +0 -0
  724. /package/dist/{mocked_classnames → packages}/icons/dist/react/Remove.js +0 -0
  725. /package/dist/{mocked_classnames → packages}/icons/dist/react/Remove.js.map +0 -0
  726. /package/dist/{mocked_classnames → packages}/icons/dist/react/Search.js +0 -0
  727. /package/dist/{mocked_classnames → packages}/icons/dist/react/Search.js.map +0 -0
  728. /package/dist/{mocked_classnames → packages}/icons/dist/react/Sort.js +0 -0
  729. /package/dist/{mocked_classnames → packages}/icons/dist/react/Sort.js.map +0 -0
  730. /package/dist/{mocked_classnames → packages}/icons/dist/react/SortAscending.js +0 -0
  731. /package/dist/{mocked_classnames → packages}/icons/dist/react/SortAscending.js.map +0 -0
  732. /package/dist/{mocked_classnames → packages}/icons/dist/react/SortDescending.js +0 -0
  733. /package/dist/{mocked_classnames → packages}/icons/dist/react/SortDescending.js.map +0 -0
  734. /package/dist/{mocked_classnames → packages}/icons/dist/react/Warning.js +0 -0
  735. /package/dist/{mocked_classnames → packages}/icons/dist/react/Warning.js.map +0 -0
  736. /package/dist/{style → packages/style}/dist/index.min.css.js +0 -0
  737. /package/dist/{style → packages/style}/dist/index.min.css.js.map +0 -0
@@ -1,2 +1,2 @@
1
- import e,{forwardRef as a,useRef as t,useCallback as o,useEffect as i,useMemo as n}from"react";import r from"classnames";import{isNil as l,noop as s}from"es-toolkit";import c from"../Icon/Icon.js";import{useSupportFirefoxLabelClick as m}from"./hooks/useSupportFirefoxLabelClick.js";import d from"../../hooks/useMergeRef.js";import{getTestId as u}from"../../tests/testIds.js";import{ComponentDefaultTestId as p,ComponentVibeId as C}from"../../tests/constants.js";import b from"../Text/Text.js";import f from"./Checkbox.module.scss.js";import E from"../../../icons/dist/react/Remove.js";import h from"../../../icons/dist/react/Check.js";var k=a((function(a,k){var v=a.className,x=a.checkboxClassName,B=a.labelClassName,N=a.ariaLabel,y=a.label,H=a.ariaLabelledBy,F=a.onChange,K=void 0===F?s:F,O=a.checked,X=a.autoFocus,g=a.indeterminate,j=void 0!==g&&g,L=a.disabled,w=void 0!==L&&L,I=a.defaultChecked,S=a.tabIndex,A=a.value,M=void 0===A?"":A,T=a.name,_=void 0===T?"":T,R=a.id,U=a.separateLabel,q=void 0!==U&&U,z=a["data-testid"],D=t(null),G=d(k,D),J=t(null),P=o((function(){var e=D.current;e&&window.requestAnimationFrame((function(){window.requestAnimationFrame((function(){e.blur()}))}))}),[D]),Q=I;l(Q)&&l(O)&&(Q=!1),i((function(){D.current&&(D.current.indeterminate=j)}),[D,j]);var V=m({inputRef:D}).onClickCapture,W=n((function(){return N||("string"==typeof y?y:"")}),[N,y]);return q?e.createElement("div",{className:r(f.wrapper,v),"data-testid":z||u(p.CHECKBOX,R),"data-vibe":C.CHECKBOX},e.createElement("input",{ref:G,id:R,className:f.input,value:M,name:_,type:"checkbox",autoFocus:X,onChange:K,defaultChecked:Q,disabled:w,"aria-label":W,"aria-labelledby":H,checked:O,tabIndex:S}),e.createElement("label",{htmlFor:R,className:r(f.checkbox,x),"data-testid":u(p.CHECKBOX_CHECKBOX,R),onMouseUp:P,onClickCapture:V},e.createElement(c,{className:f.icon,iconType:"svg",icon:j?E:h,ignoreFocusStyle:!0,ariaHidden:!0,iconSize:"16"})),!1===y?null:e.createElement("label",{htmlFor:R,className:r(f.label,B),"data-testid":u(p.CHECKBOX_LABEL,R),onMouseUp:P,onClickCapture:V},e.createElement(b,{element:"span",type:"text2"},y))):e.createElement("label",{className:r(f.wrapper,v),onMouseUp:P,"data-testid":z||u(p.CHECKBOX,R),htmlFor:R,onClickCapture:V,"data-vibe":C.CHECKBOX},e.createElement("input",{ref:G,id:R,className:f.input,value:M,name:_,type:"checkbox",autoFocus:X,onChange:K,defaultChecked:Q,disabled:w,"aria-label":W,"aria-labelledby":H,checked:O,tabIndex:S}),e.createElement("div",{className:r(f.checkbox,x),ref:J,"data-testid":u(p.CHECKBOX_CHECKBOX,R)},e.createElement(c,{className:f.icon,iconType:"svg",icon:j?E:h,ignoreFocusStyle:!0,ariaHidden:!0,iconSize:"16"})),!1===y?null:e.createElement(b,{element:"span",type:"text2",className:r(f.label,B),"data-testid":u(p.CHECKBOX_LABEL,R)},y))}));export{k as default};
1
+ import e,{forwardRef as a,useRef as t,useCallback as o,useEffect as n,useMemo as i}from"react";import r from"classnames";import{isNil as s,noop as l}from"es-toolkit";import{useSupportFirefoxLabelClick as c}from"./hooks/useSupportFirefoxLabelClick.js";import m from"../../hooks/useMergeRef.js";import{getTestId as d}from"../../tests/testIds.js";import{ComponentDefaultTestId as u,ComponentVibeId as p}from"../../tests/constants.js";import C from"../Text/Text.js";import b from"./Checkbox.module.scss.js";import f from"../../../components/icon/dist/Icon/Icon.js";import k from"../../../packages/icons/dist/react/Remove.js";import E from"../../../packages/icons/dist/react/Check.js";var h=a((function(a,h){var v=a.className,x=a.checkboxClassName,B=a.labelClassName,N=a.ariaLabel,y=a.label,H=a.ariaLabelledBy,g=a.onChange,F=void 0===g?l:g,K=a.checked,O=a.autoFocus,X=a.indeterminate,j=void 0!==X&&X,L=a.disabled,w=void 0!==L&&L,I=a.defaultChecked,S=a.tabIndex,A=a.value,M=void 0===A?"":A,T=a.name,_=void 0===T?"":T,R=a.id,U=a.separateLabel,q=void 0!==U&&U,z=a["data-testid"],D=t(null),G=m(h,D),J=t(null),P=o((function(){var e=D.current;e&&window.requestAnimationFrame((function(){window.requestAnimationFrame((function(){e.blur()}))}))}),[D]),Q=I;s(Q)&&s(K)&&(Q=!1),n((function(){D.current&&(D.current.indeterminate=j)}),[D,j]);var V=c({inputRef:D}).onClickCapture,W=i((function(){return N||("string"==typeof y?y:"")}),[N,y]);return q?e.createElement("div",{className:r(b.wrapper,v),"data-testid":z||d(u.CHECKBOX,R),"data-vibe":p.CHECKBOX},e.createElement("input",{ref:G,id:R,className:b.input,value:M,name:_,type:"checkbox",autoFocus:O,onChange:F,defaultChecked:Q,disabled:w,"aria-label":W,"aria-labelledby":H,checked:K,tabIndex:S}),e.createElement("label",{htmlFor:R,className:r(b.checkbox,x),"data-testid":d(u.CHECKBOX_CHECKBOX,R),onMouseUp:P,onClickCapture:V},e.createElement(f,{className:b.icon,iconType:"svg",icon:j?k:E,ignoreFocusStyle:!0,ariaHidden:!0,iconSize:"16"})),!1===y?null:e.createElement("label",{htmlFor:R,className:r(b.label,B),"data-testid":d(u.CHECKBOX_LABEL,R),onMouseUp:P,onClickCapture:V},e.createElement(C,{element:"span",type:"text2"},y))):e.createElement("label",{className:r(b.wrapper,v),onMouseUp:P,"data-testid":z||d(u.CHECKBOX,R),htmlFor:R,onClickCapture:V,"data-vibe":p.CHECKBOX},e.createElement("input",{ref:G,id:R,className:b.input,value:M,name:_,type:"checkbox",autoFocus:O,onChange:F,defaultChecked:Q,disabled:w,"aria-label":W,"aria-labelledby":H,checked:K,tabIndex:S}),e.createElement("div",{className:r(b.checkbox,x),ref:J,"data-testid":d(u.CHECKBOX_CHECKBOX,R)},e.createElement(f,{className:b.icon,iconType:"svg",icon:j?k:E,ignoreFocusStyle:!0,ariaHidden:!0,iconSize:"16"})),!1===y?null:e.createElement(C,{element:"span",type:"text2",className:r(b.label,B),"data-testid":d(u.CHECKBOX_LABEL,R)},y))}));export{h as default};
2
2
  //# sourceMappingURL=Checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sources":["../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useEffect, useMemo, useRef } from \"react\";\nimport cx from \"classnames\";\nimport { isNil, noop as NOOP } from \"es-toolkit\";\nimport Icon from \"../Icon/Icon\";\nimport { Check, Remove } from \"@vibe/icons\";\nimport { useSupportFirefoxLabelClick } from \"./hooks/useSupportFirefoxLabelClick\";\nimport useMergeRef from \"../../hooks/useMergeRef\";\nimport { type VibeComponentProps } from \"../../types\";\nimport { getTestId } from \"../../tests/test-ids-utils\";\nimport { ComponentDefaultTestId, ComponentVibeId } from \"../../tests/constants\";\nimport Text from \"../Text/Text\";\nimport styles from \"./Checkbox.module.scss\";\n\nexport interface CheckBoxProps extends VibeComponentProps {\n /**\n * Class name applied to the checkbox element.\n */\n checkboxClassName?: string;\n /**\n * Class name applied to the label element.\n */\n labelClassName?: string;\n /**\n * The label of the checkbox for accessibility.\n */\n ariaLabel?: string;\n /**\n * The content displayed next to the checkbox.\n */\n label?: React.ReactNode | Array<React.ReactNode>;\n /**\n * The ID of an element describing the checkbox.\n */\n ariaLabelledBy?: string;\n /**\n * Callback fired when the checkbox value changes.\n */\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n /**\n * If true, controls the checked state of the checkbox.\n */\n checked?: boolean;\n /**\n * If true, displays an indeterminate state.\n */\n indeterminate?: boolean;\n /**\n * If true, the checkbox automatically receives focus.\n */\n autoFocus?: boolean;\n /**\n * If true, the checkbox is disabled.\n */\n disabled?: boolean;\n /**\n * The initial checked state of the checkbox.\n */\n defaultChecked?: boolean;\n /**\n * The value submitted with the form when checked.\n */\n value?: string;\n /**\n * The name of the checkbox, used for form submission.\n */\n name?: string;\n /**\n * The tab order of the checkbox.\n */\n tabIndex?: number;\n /**\n * If true, uses separate labels with htmlFor/id association instead of wrapping the input.\n * If using this the id prop is required for it to function correctly.\n */\n separateLabel?: boolean;\n}\n\nconst Checkbox = forwardRef(\n (\n {\n className,\n checkboxClassName,\n labelClassName,\n ariaLabel,\n label,\n ariaLabelledBy,\n onChange = NOOP,\n checked,\n autoFocus,\n indeterminate = false,\n disabled = false,\n defaultChecked,\n tabIndex,\n value = \"\",\n name = \"\",\n id,\n separateLabel = false,\n \"data-testid\": dataTestId\n }: CheckBoxProps,\n ref: React.ForwardedRef<HTMLInputElement>\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const mergedInputRef = useMergeRef(ref, inputRef);\n const iconContainerRef = useRef<HTMLDivElement>(null);\n\n const onMouseUpCallback = useCallback(() => {\n const input = inputRef.current;\n if (!input) return;\n\n window.requestAnimationFrame(() => {\n window.requestAnimationFrame(() => {\n input.blur();\n });\n });\n }, [inputRef]);\n let overrideDefaultChecked = defaultChecked;\n\n // If component did not receive default checked and checked props, choose default checked as\n // default behavior (handle isChecked logic inside input) and set default value\n if (isNil(overrideDefaultChecked) && isNil(checked)) {\n overrideDefaultChecked = false;\n }\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.indeterminate = indeterminate;\n }\n }, [inputRef, indeterminate]);\n\n const { onClickCapture: onClickCaptureLabel } = useSupportFirefoxLabelClick({ inputRef });\n\n const finalAriaLabel = useMemo(() => {\n if (ariaLabel) return ariaLabel;\n if (typeof label === \"string\") return label;\n return \"\";\n }, [ariaLabel, label]);\n\n if (separateLabel) {\n return (\n <div\n className={cx(styles.wrapper, className)}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.CHECKBOX, id)}\n data-vibe={ComponentVibeId.CHECKBOX}\n >\n <input\n ref={mergedInputRef}\n id={id}\n className={styles.input}\n value={value}\n name={name}\n type=\"checkbox\"\n autoFocus={autoFocus}\n onChange={onChange}\n defaultChecked={overrideDefaultChecked}\n disabled={disabled}\n aria-label={finalAriaLabel}\n aria-labelledby={ariaLabelledBy}\n checked={checked}\n tabIndex={tabIndex}\n />\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\n <label\n htmlFor={id}\n className={cx(styles.checkbox, checkboxClassName)}\n data-testid={getTestId(ComponentDefaultTestId.CHECKBOX_CHECKBOX, id)}\n onMouseUp={onMouseUpCallback}\n onClickCapture={onClickCaptureLabel}\n >\n <Icon\n className={styles.icon}\n iconType=\"svg\"\n icon={indeterminate ? Remove : Check}\n ignoreFocusStyle\n ariaHidden={true}\n iconSize=\"16\"\n />\n </label>\n {label === false ? null : (\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n <label\n htmlFor={id}\n className={cx(styles.label, labelClassName)}\n data-testid={getTestId(ComponentDefaultTestId.CHECKBOX_LABEL, id)}\n onMouseUp={onMouseUpCallback}\n onClickCapture={onClickCaptureLabel}\n >\n <Text element=\"span\" type=\"text2\">\n {label}\n </Text>\n </label>\n )}\n </div>\n );\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n <label\n className={cx(styles.wrapper, className)}\n onMouseUp={onMouseUpCallback}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.CHECKBOX, id)}\n htmlFor={id}\n onClickCapture={onClickCaptureLabel}\n data-vibe={ComponentVibeId.CHECKBOX}\n >\n <input\n ref={mergedInputRef}\n id={id}\n className={styles.input}\n value={value}\n name={name}\n type=\"checkbox\"\n autoFocus={autoFocus}\n onChange={onChange}\n defaultChecked={overrideDefaultChecked}\n disabled={disabled}\n aria-label={finalAriaLabel}\n aria-labelledby={ariaLabelledBy}\n checked={checked}\n tabIndex={tabIndex}\n />\n <div\n className={cx(styles.checkbox, checkboxClassName)}\n ref={iconContainerRef}\n data-testid={getTestId(ComponentDefaultTestId.CHECKBOX_CHECKBOX, id)}\n >\n <Icon\n className={styles.icon}\n iconType=\"svg\"\n icon={indeterminate ? Remove : Check}\n ignoreFocusStyle\n ariaHidden={true}\n iconSize=\"16\"\n />\n </div>\n {label === false ? null : (\n <Text\n element=\"span\"\n type=\"text2\"\n className={cx(styles.label, labelClassName)}\n data-testid={getTestId(ComponentDefaultTestId.CHECKBOX_LABEL, id)}\n >\n {label}\n </Text>\n )}\n </label>\n );\n }\n);\n\nexport default Checkbox;\n"],"names":["Checkbox","forwardRef","_ref","ref","className","checkboxClassName","labelClassName","ariaLabel","label","ariaLabelledBy","_ref$onChange","onChange","NOOP","checked","autoFocus","_ref$indeterminate","indeterminate","_ref$disabled","disabled","defaultChecked","tabIndex","_ref$value","value","_ref$name","name","id","_ref$separateLabel","separateLabel","dataTestId","inputRef","useRef","mergedInputRef","useMergeRef","iconContainerRef","onMouseUpCallback","useCallback","input","current","window","requestAnimationFrame","blur","overrideDefaultChecked","isNil","useEffect","onClickCaptureLabel","useSupportFirefoxLabelClick","onClickCapture","finalAriaLabel","useMemo","React","createElement","cx","styles","wrapper","getTestId","ComponentDefaultTestId","CHECKBOX","ComponentVibeId","type","htmlFor","checkbox","CHECKBOX_CHECKBOX","onMouseUp","Icon","icon","iconType","Remove","Check","ignoreFocusStyle","ariaHidden","iconSize","CHECKBOX_LABEL","Text","element"],"mappings":"2nBA6EMA,IAAAA,EAAWC,GACf,SAAAC,EAqBEC,GACE,IApBAC,EAASF,EAATE,UACAC,EAAiBH,EAAjBG,kBACAC,EAAcJ,EAAdI,eACAC,EAASL,EAATK,UACAC,EAAKN,EAALM,MACAC,EAAcP,EAAdO,eAAcC,EAAAR,EACdS,SAAAA,OAAWC,IAAHF,EAAGE,EAAIF,EACfG,EAAOX,EAAPW,QACAC,EAASZ,EAATY,UAASC,EAAAb,EACTc,cAAAA,OAAgB,IAAHD,GAAQA,EAAAE,EAAAf,EACrBgB,SAAAA,OAAW,IAAHD,GAAQA,EAChBE,EAAcjB,EAAdiB,eACAC,EAAQlB,EAARkB,SAAQC,EAAAnB,EACRoB,MAAAA,OAAQ,IAAHD,EAAG,GAAEA,EAAAE,EAAArB,EACVsB,KAAAA,OAAO,IAAHD,EAAG,GAAEA,EACTE,EAAEvB,EAAFuB,GAAEC,EAAAxB,EACFyB,cAAAA,OAAgB,IAAHD,GAAQA,EACNE,EAAU1B,EAAzB,eAII2B,EAAWC,EAAyB,MACpCC,EAAiBC,EAAY7B,EAAK0B,GAClCI,EAAmBH,EAAuB,MAE1CI,EAAoBC,GAAY,WACpC,IAAMC,EAAQP,EAASQ,QAClBD,GAELE,OAAOC,uBAAsB,WAC3BD,OAAOC,uBAAsB,WAC3BH,EAAMI,MACR,GACF,GACF,GAAG,CAACX,IACAY,EAAyBtB,EAIzBuB,EAAMD,IAA2BC,EAAM7B,KACzC4B,GAAyB,GAG3BE,GAAU,WACJd,EAASQ,UACXR,EAASQ,QAAQrB,cAAgBA,EAErC,GAAG,CAACa,EAAUb,IAEd,IAAwB4B,EAAwBC,EAA4B,CAAEhB,SAAAA,IA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AAK4B,EACLN,GAAIA,EACJrB,UAAWgD,EAAOhB,MAClBd,MAAOA,EACPE,KAAMA,EACNkC,KAAK,WACL5C,UAAWA,EACXH,SAAUA,EACVQ,eAAgBsB,EAChBvB,SAAUA,EACE,aAAA6B,EACK,kBAAAtC,EACjBI,QAASA,EACTO,SAAUA,IAEZ6B,EACEC,cAAA,MAAA,CAAA9C,UAAW+C,EAAGC,EAAOQ,SAAUvD,GAC/BF,IAAK8B,gBACQqB,EAAUC,EAAuBM,kBAAmBpC,IAEjEwB,EAAAC,cAACa,EAAI,CACH3D,UAAWgD,EAAOY,KAClBC,SAAS,MACTD,KAAMhD,EAAgBkD,EAASC,EAC/BC,kBAAgB,EAChBC,YAAY,EACZC,SAAS,SAGF,IAAV9D,EAAkB,KACjByC,gBAACuB,EAAI,CACHC,QAAQ,OACRf,KAAK,QACLtD,UAAW+C,EAAGC,EAAO5C,MAAOF,GAAe,cAC9BgD,EAAUC,EAAuBgB,eAAgB9C,IAE7DjB,GAKX"}
1
+ {"version":3,"file":"Checkbox.js","sources":["../../../../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useEffect, useMemo, useRef } from \"react\";\nimport cx from \"classnames\";\nimport { isNil, noop as NOOP } from \"es-toolkit\";\nimport { Icon } from \"@vibe/icon\";\nimport { Check, Remove } from \"@vibe/icons\";\nimport { useSupportFirefoxLabelClick } from \"./hooks/useSupportFirefoxLabelClick\";\nimport useMergeRef from \"../../hooks/useMergeRef\";\nimport { type VibeComponentProps } from \"../../types\";\nimport { getTestId } from \"../../tests/test-ids-utils\";\nimport { ComponentDefaultTestId, ComponentVibeId } from \"../../tests/constants\";\nimport Text from \"../Text/Text\";\nimport styles from \"./Checkbox.module.scss\";\n\nexport interface CheckBoxProps extends VibeComponentProps {\n /**\n * Class name applied to the checkbox element.\n */\n checkboxClassName?: string;\n /**\n * Class name applied to the label element.\n */\n labelClassName?: string;\n /**\n * The label of the checkbox for accessibility.\n */\n ariaLabel?: string;\n /**\n * The content displayed next to the checkbox.\n */\n label?: React.ReactNode | Array<React.ReactNode>;\n /**\n * The ID of an element describing the checkbox.\n */\n ariaLabelledBy?: string;\n /**\n * Callback fired when the checkbox value changes.\n */\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n /**\n * If true, controls the checked state of the checkbox.\n */\n checked?: boolean;\n /**\n * If true, displays an indeterminate state.\n */\n indeterminate?: boolean;\n /**\n * If true, the checkbox automatically receives focus.\n */\n autoFocus?: boolean;\n /**\n * If true, the checkbox is disabled.\n */\n disabled?: boolean;\n /**\n * The initial checked state of the checkbox.\n */\n defaultChecked?: boolean;\n /**\n * The value submitted with the form when checked.\n */\n value?: string;\n /**\n * The name of the checkbox, used for form submission.\n */\n name?: string;\n /**\n * The tab order of the checkbox.\n */\n tabIndex?: number;\n /**\n * If true, uses separate labels with htmlFor/id association instead of wrapping the input.\n * If using this the id prop is required for it to function correctly.\n */\n separateLabel?: boolean;\n}\n\nconst Checkbox = forwardRef(\n (\n {\n className,\n checkboxClassName,\n labelClassName,\n ariaLabel,\n label,\n ariaLabelledBy,\n onChange = NOOP,\n checked,\n autoFocus,\n indeterminate = false,\n disabled = false,\n defaultChecked,\n tabIndex,\n value = \"\",\n name = \"\",\n id,\n separateLabel = false,\n \"data-testid\": dataTestId\n }: CheckBoxProps,\n ref: React.ForwardedRef<HTMLInputElement>\n ) => {\n const inputRef = useRef<HTMLInputElement>(null);\n const mergedInputRef = useMergeRef(ref, inputRef);\n const iconContainerRef = useRef<HTMLDivElement>(null);\n\n const onMouseUpCallback = useCallback(() => {\n const input = inputRef.current;\n if (!input) return;\n\n window.requestAnimationFrame(() => {\n window.requestAnimationFrame(() => {\n input.blur();\n });\n });\n }, [inputRef]);\n let overrideDefaultChecked = defaultChecked;\n\n // If component did not receive default checked and checked props, choose default checked as\n // default behavior (handle isChecked logic inside input) and set default value\n if (isNil(overrideDefaultChecked) && isNil(checked)) {\n overrideDefaultChecked = false;\n }\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.indeterminate = indeterminate;\n }\n }, [inputRef, indeterminate]);\n\n const { onClickCapture: onClickCaptureLabel } = useSupportFirefoxLabelClick({ inputRef });\n\n const finalAriaLabel = useMemo(() => {\n if (ariaLabel) return ariaLabel;\n if (typeof label === \"string\") return label;\n return \"\";\n }, [ariaLabel, label]);\n\n if (separateLabel) {\n return (\n <div\n className={cx(styles.wrapper, className)}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.CHECKBOX, id)}\n data-vibe={ComponentVibeId.CHECKBOX}\n >\n <input\n ref={mergedInputRef}\n id={id}\n className={styles.input}\n value={value}\n name={name}\n type=\"checkbox\"\n autoFocus={autoFocus}\n onChange={onChange}\n defaultChecked={overrideDefaultChecked}\n disabled={disabled}\n aria-label={finalAriaLabel}\n aria-labelledby={ariaLabelledBy}\n checked={checked}\n tabIndex={tabIndex}\n />\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\n <label\n htmlFor={id}\n className={cx(styles.checkbox, checkboxClassName)}\n data-testid={getTestId(ComponentDefaultTestId.CHECKBOX_CHECKBOX, id)}\n onMouseUp={onMouseUpCallback}\n onClickCapture={onClickCaptureLabel}\n >\n <Icon\n className={styles.icon}\n iconType=\"svg\"\n icon={indeterminate ? Remove : Check}\n ignoreFocusStyle\n ariaHidden={true}\n iconSize=\"16\"\n />\n </label>\n {label === false ? null : (\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n <label\n htmlFor={id}\n className={cx(styles.label, labelClassName)}\n data-testid={getTestId(ComponentDefaultTestId.CHECKBOX_LABEL, id)}\n onMouseUp={onMouseUpCallback}\n onClickCapture={onClickCaptureLabel}\n >\n <Text element=\"span\" type=\"text2\">\n {label}\n </Text>\n </label>\n )}\n </div>\n );\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions\n <label\n className={cx(styles.wrapper, className)}\n onMouseUp={onMouseUpCallback}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.CHECKBOX, id)}\n htmlFor={id}\n onClickCapture={onClickCaptureLabel}\n data-vibe={ComponentVibeId.CHECKBOX}\n >\n <input\n ref={mergedInputRef}\n id={id}\n className={styles.input}\n value={value}\n name={name}\n type=\"checkbox\"\n autoFocus={autoFocus}\n onChange={onChange}\n defaultChecked={overrideDefaultChecked}\n disabled={disabled}\n aria-label={finalAriaLabel}\n aria-labelledby={ariaLabelledBy}\n checked={checked}\n tabIndex={tabIndex}\n />\n <div\n className={cx(styles.checkbox, checkboxClassName)}\n ref={iconContainerRef}\n data-testid={getTestId(ComponentDefaultTestId.CHECKBOX_CHECKBOX, id)}\n >\n <Icon\n className={styles.icon}\n iconType=\"svg\"\n icon={indeterminate ? Remove : Check}\n ignoreFocusStyle\n ariaHidden={true}\n iconSize=\"16\"\n />\n </div>\n {label === false ? null : (\n <Text\n element=\"span\"\n type=\"text2\"\n className={cx(styles.label, labelClassName)}\n data-testid={getTestId(ComponentDefaultTestId.CHECKBOX_LABEL, id)}\n >\n {label}\n </Text>\n )}\n </label>\n );\n }\n);\n\nexport default Checkbox;\n"],"names":["Checkbox","forwardRef","_ref","ref","className","checkboxClassName","labelClassName","ariaLabel","label","ariaLabelledBy","_ref$onChange","onChange","NOOP","checked","autoFocus","_ref$indeterminate","indeterminate","_ref$disabled","disabled","defaultChecked","tabIndex","_ref$value","value","_ref$name","name","id","_ref$separateLabel","separateLabel","dataTestId","inputRef","useRef","mergedInputRef","useMergeRef","iconContainerRef","onMouseUpCallback","useCallback","input","current","window","requestAnimationFrame","blur","overrideDefaultChecked","isNil","useEffect","onClickCaptureLabel","useSupportFirefoxLabelClick","onClickCapture","finalAriaLabel","useMemo","React","createElement","cx","styles","wrapper","getTestId","ComponentDefaultTestId","CHECKBOX","ComponentVibeId","type","htmlFor","checkbox","CHECKBOX_CHECKBOX","onMouseUp","Icon","icon","iconType","Remove","Check","ignoreFocusStyle","ariaHidden","iconSize","CHECKBOX_LABEL","Text","element"],"mappings":"wqB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SAAUA,IAEZ6B,EACEC,cAAA,MAAA,CAAA9C,UAAW+C,EAAGC,EAAOQ,SAAUvD,GAC/BF,IAAK8B,gBACQqB,EAAUC,EAAuBM,kBAAmBpC,IAEjEwB,EAAAC,cAACa,EAAI,CACH3D,UAAWgD,EAAOY,KAClBC,SAAS,MACTD,KAAMhD,EAAgBkD,EAASC,EAC/BC,kBAAgB,EAChBC,YAAY,EACZC,SAAS,SAGF,IAAV9D,EAAkB,KACjByC,gBAACuB,EAAI,CACHC,QAAQ,OACRf,KAAK,QACLtD,UAAW+C,EAAGC,EAAO5C,MAAOF,GAAe,cAC9BgD,EAAUC,EAAuBgB,eAAgB9C,IAE7DjB,GAKX"}
@@ -1,2 +1,2 @@
1
- import{slicedToArray as e,defineProperty as o}from"../../../_virtual/_rollupPluginBabelHelpers.js";import t,{forwardRef as a,useRef as r,useState as i,useCallback as s,useMemo as n}from"react";import l from"classnames";import c from"../Icon/Icon.js";import m from"../../hooks/useMergeRef.js";import{getCSSVar as d}from"../../services/themes.js";import{ElementAllowedColor as u}from"../../utils/colors-vars-map.js";import{getElementColor as p}from"../../types/Colors.js";import v from"../Avatar/Avatar.js";import f from"../IconButton/IconButton.js";import b from"../Text/Text.js";import{getTestId as g,ComponentDefaultTestId as j}from"../../tests/testIds.js";import{AvatarType as y}from"../Avatar/AvatarConstants.js";import{withStaticProps as h}from"../../types/withStaticProps.js";import C from"../../hooks/useSetFocus/index.js";import k from"../../hooks/useClickableProps/useClickableProps.js";import x from"./Chips.module.scss.js";import{ComponentVibeId as S}from"../../tests/constants.js";import N from"../../../icons/dist/react/CloseSmall.js";var A=h(a((function(a,u){var y=a.className,h=a.avatarClassName,A=a.iconClassName,E=a.id,T=a.label,M=void 0===T?"":T,P=a.leftIcon,w=void 0===P?null:P,I=a.rightIcon,B=void 0===I?null:I,z=a.leftAvatar,H=void 0===z?null:z,L=a.rightAvatar,O=void 0===L?null:L,R=a.disabled,D=void 0!==R&&R,F=a.readOnly,_=void 0!==F&&F,U=a.allowTextSelection,q=void 0!==U&&U,G=a.color,J=void 0===G?"primary":G,K=a.iconSize,Q=void 0===K?18:K,V=a.onDelete,W=void 0===V?function(e,o){}:V,X=a.onMouseDown,Y=a.onClick,Z=a.noAnimation,$=void 0===Z||Z,ee=a.ariaLabel,oe=a.ariaHasPopup,te=void 0!==oe&&oe,ae=a.disableClickableBehavior,re=void 0!==ae&&ae,ie=a.leftAvatarType,se=void 0===ie?"img":ie,ne=a.rightAvatarType,le=void 0===ne?"img":ne,ce=a.showBorder,me=void 0!==ce&&ce,de=a.leftRenderer,ue=a.rightRenderer,pe=a.closeButtonAriaLabel,ve=void 0===pe?"Remove":pe,fe=a.noMargin,be=void 0!==fe&&fe,ge=a["data-testid"]||g(j.CHIP,E),je=!(!Y&&!X||re),ye=!_&&!D,he=ee||"string"==typeof M&&M||"",Ce=r(null),ke=r(null),xe=i(!1),Se=e(xe,2),Ne=Se[0],Ae=Se[1],Ee=s((function(){return Ae(!0)}),[]),Te=s((function(){return Ae(!1)}),[]),Me=C({ref:ke}).isFocused,Pe=m(u,ke),we=l(x.chips,y,o(o(o(o(o({},x.disabled,D),x.noAnimation,$),x.withUserSelect,q),x.border,me),x.noMargin,be)),Ie=l(x.clickable,we,o(o({},x.disabled,D),x.disableTextSelection,!q)),Be=n((function(){return{backgroundColor:D?d("disabled-background-color"):je&&(Ne||Me)?p(J,!0,!0):p(J,!0)}}),[D,je,Ne,Me,J]),ze=s((function(e){e.stopPropagation(),W&&W(E,e)}),[E,W]),He=s((function(e){void 0!==Y&&e.target!==Ce.current&&(e.preventDefault(),Y(e))}),[Y]),Le=k({onClick:He,onMouseDown:X,disabled:D,id:E,"data-testid":ge,ariaLabel:he,ariaHidden:!1,ariaHasPopup:te,ariaExpanded:!1},Pe),Oe=je?Object.assign(Object.assign({},Le),{ref:Pe,className:Ie,style:Be,onMouseEnter:Ee,onMouseLeave:Te}):{className:we,"aria-label":he,style:Be,ref:Pe,onClick:He,onMouseDown:X,id:E,"data-testid":ge,onMouseEnter:Ee,onMouseLeave:Te},Re="text"===se?{text:H}:{src:H},De="text"===se?{text:O}:{src:O};return t.createElement("div",Object.assign({},Oe,{"data-vibe":S.CHIPS}),H?t.createElement(v,Object.assign({withoutBorder:!0,className:l(x.avatar,x.left,h),customSize:18,type:se,key:E},Re)):null,w?t.createElement(c,{className:l(x.icon,x.left,A),iconType:"font",icon:w,iconSize:Q,ignoreFocusStyle:!0}):null,de&&t.createElement("div",{className:l(x.customRenderer,x.left)},de),t.createElement(b,{type:"text2",className:x.label},M),B?t.createElement(c,{className:l(x.icon,x.right,A),iconType:"font",icon:B,iconSize:Q,ignoreFocusStyle:!0}):null,O?t.createElement(v,Object.assign({withoutBorder:!0,className:l(x.avatar,x.right,h),customSize:18,type:le,key:E},De)):null,ue&&t.createElement("div",{className:l(x.customRenderer,x.right)},ue),ye&&t.createElement(f,{size:"xxs",color:"on-primary-color",className:l(x.icon,x.close),ariaLabel:ve,hideTooltip:!0,icon:N,onClick:ze,"data-testid":"".concat(ge,"-close"),ref:Ce}))})),{colors:u,avatarTypes:y});export{A as default};
1
+ import{slicedToArray as e,defineProperty as o}from"../../../_virtual/_rollupPluginBabelHelpers.js";import t,{forwardRef as a,useRef as r,useState as i,useCallback as s,useMemo as n}from"react";import l from"classnames";import c from"../../hooks/useMergeRef.js";import{getCSSVar as m}from"../../services/themes.js";import{ElementAllowedColor as d}from"../../utils/colors-vars-map.js";import{getElementColor as u}from"../../types/Colors.js";import p from"../Avatar/Avatar.js";import v from"../IconButton/IconButton.js";import f from"../Text/Text.js";import{getTestId as b,ComponentDefaultTestId as g}from"../../tests/testIds.js";import{AvatarType as j}from"../Avatar/AvatarConstants.js";import{withStaticProps as y}from"../../types/withStaticProps.js";import h from"../../hooks/useSetFocus/index.js";import k from"../../hooks/useClickableProps/useClickableProps.js";import C from"./Chips.module.scss.js";import{ComponentVibeId as x}from"../../tests/constants.js";import S from"../../../components/icon/dist/Icon/Icon.js";import N from"../../../packages/icons/dist/react/CloseSmall.js";var A=y(a((function(a,d){var j=a.className,y=a.avatarClassName,A=a.iconClassName,E=a.id,T=a.label,M=void 0===T?"":T,P=a.leftIcon,w=void 0===P?null:P,I=a.rightIcon,B=void 0===I?null:I,z=a.leftAvatar,H=void 0===z?null:z,L=a.rightAvatar,O=void 0===L?null:L,R=a.disabled,D=void 0!==R&&R,F=a.readOnly,_=void 0!==F&&F,U=a.allowTextSelection,q=void 0!==U&&U,G=a.color,J=void 0===G?"primary":G,K=a.iconSize,Q=void 0===K?18:K,V=a.onDelete,W=void 0===V?function(e,o){}:V,X=a.onMouseDown,Y=a.onClick,Z=a.noAnimation,$=void 0===Z||Z,ee=a.ariaLabel,oe=a.ariaHasPopup,te=void 0!==oe&&oe,ae=a.disableClickableBehavior,re=void 0!==ae&&ae,ie=a.leftAvatarType,se=void 0===ie?"img":ie,ne=a.rightAvatarType,le=void 0===ne?"img":ne,ce=a.showBorder,me=void 0!==ce&&ce,de=a.leftRenderer,ue=a.rightRenderer,pe=a.closeButtonAriaLabel,ve=void 0===pe?"Remove":pe,fe=a.noMargin,be=void 0!==fe&&fe,ge=a["data-testid"]||b(g.CHIP,E),je=!(!Y&&!X||re),ye=!_&&!D,he=ee||"string"==typeof M&&M||"",ke=r(null),Ce=r(null),xe=i(!1),Se=e(xe,2),Ne=Se[0],Ae=Se[1],Ee=s((function(){return Ae(!0)}),[]),Te=s((function(){return Ae(!1)}),[]),Me=h({ref:Ce}).isFocused,Pe=c(d,Ce),we=l(C.chips,j,o(o(o(o(o({},C.disabled,D),C.noAnimation,$),C.withUserSelect,q),C.border,me),C.noMargin,be)),Ie=l(C.clickable,we,o(o({},C.disabled,D),C.disableTextSelection,!q)),Be=n((function(){return{backgroundColor:D?m("disabled-background-color"):je&&(Ne||Me)?u(J,!0,!0):u(J,!0)}}),[D,je,Ne,Me,J]),ze=s((function(e){e.stopPropagation(),W&&W(E,e)}),[E,W]),He=s((function(e){void 0!==Y&&e.target!==ke.current&&(e.preventDefault(),Y(e))}),[Y]),Le=k({onClick:He,onMouseDown:X,disabled:D,id:E,"data-testid":ge,ariaLabel:he,ariaHidden:!1,ariaHasPopup:te,ariaExpanded:!1},Pe),Oe=je?Object.assign(Object.assign({},Le),{ref:Pe,className:Ie,style:Be,onMouseEnter:Ee,onMouseLeave:Te}):{className:we,"aria-label":he,style:Be,ref:Pe,onClick:He,onMouseDown:X,id:E,"data-testid":ge,onMouseEnter:Ee,onMouseLeave:Te},Re="text"===se?{text:H}:{src:H},De="text"===se?{text:O}:{src:O};return t.createElement("div",Object.assign({},Oe,{"data-vibe":x.CHIPS}),H?t.createElement(p,Object.assign({withoutBorder:!0,className:l(C.avatar,C.left,y),customSize:18,type:se,key:E},Re)):null,w?t.createElement(S,{className:l(C.icon,C.left,A),iconType:"font",icon:w,iconSize:Q,ignoreFocusStyle:!0}):null,de&&t.createElement("div",{className:l(C.customRenderer,C.left)},de),t.createElement(f,{type:"text2",className:C.label},M),B?t.createElement(S,{className:l(C.icon,C.right,A),iconType:"font",icon:B,iconSize:Q,ignoreFocusStyle:!0}):null,O?t.createElement(p,Object.assign({withoutBorder:!0,className:l(C.avatar,C.right,y),customSize:18,type:le,key:E},De)):null,ue&&t.createElement("div",{className:l(C.customRenderer,C.right)},ue),ye&&t.createElement(v,{size:"xxs",color:"on-primary-color",className:l(C.icon,C.close),ariaLabel:ve,hideTooltip:!0,icon:N,onClick:ze,"data-testid":"".concat(ge,"-close"),ref:ke}))})),{colors:d,avatarTypes:j});export{A as default};
2
2
  //# sourceMappingURL=Chips.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chips.js","sources":["../../../../src/components/Chips/Chips.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo, useRef, useState } from \"react\";\nimport cx from \"classnames\";\nimport Icon from \"../Icon/Icon\";\nimport useMergeRef from \"../../hooks/useMergeRef\";\nimport { CloseSmall } from \"@vibe/icons\";\nimport { getCSSVar } from \"../../services/themes\";\nimport { ElementAllowedColor as ElementAllowedColorEnum } from \"../../utils/colors-vars-map\";\nimport { type ElementAllowedColor, getElementColor } from \"../../types/Colors\";\nimport Avatar from \"../Avatar/Avatar\";\nimport IconButton from \"../IconButton/IconButton\";\nimport Text from \"../Text/Text\";\nimport { ComponentDefaultTestId, getTestId } from \"../../tests/test-ids-utils\";\nimport { AvatarType as AvatarTypeEnum } from \"../Avatar/AvatarConstants\";\nimport { type AvatarType } from \"../Avatar\";\nimport { type ElementContent, type SubIcon, type VibeComponentProps, withStaticProps } from \"../../types\";\n\nimport useSetFocus from \"../../hooks/useSetFocus\";\nimport useClickableProps from \"../../hooks/useClickableProps/useClickableProps\";\nimport styles from \"./Chips.module.scss\";\nimport { ComponentVibeId } from \"../../tests/constants\";\n\nconst CHIPS_AVATAR_SIZE = 18;\n\nexport interface ChipsProps extends VibeComponentProps {\n /**\n * The text or content displayed inside the chip.\n */\n label?: ElementContent;\n /**\n * If true, the chip is disabled.\n */\n disabled?: boolean;\n /**\n * If true, the chip is read-only and cannot be deleted.\n */\n readOnly?: boolean;\n /**\n * A React element displayed on the right side.\n */\n rightRenderer?: ElementContent;\n /**\n * A React element displayed on the left side.\n */\n leftRenderer?: ElementContent;\n /**\n * Icon displayed on the right side.\n */\n rightIcon?: SubIcon;\n /**\n * Icon displayed on the left side.\n */\n leftIcon?: SubIcon;\n /**\n * Image URL or text for an avatar displayed on the right.\n */\n rightAvatar?: string;\n /**\n * The type of avatar displayed on the right.\n */\n rightAvatarType?: AvatarType;\n /**\n * Image URL or text for an avatar displayed on the left.\n */\n leftAvatar?: string;\n /**\n * The type of avatar displayed on the left.\n */\n leftAvatarType?: AvatarType;\n /**\n * Class name applied to left or right icons.\n */\n iconClassName?: string;\n /**\n * Class name applied to left or right avatars.\n */\n avatarClassName?: string;\n /**\n * The background color of the chip.\n */\n color?: Exclude<ElementAllowedColor, \"dark_indigo\" | \"blackish\">;\n /**\n * The size of the icons inside the chip.\n */\n iconSize?: number | string;\n /**\n * Callback fired when the chip is deleted.\n */\n onDelete?: (id: string, event: React.MouseEvent<HTMLSpanElement>) => void;\n /**\n * If true, disables the chip's entry animation.\n */\n noAnimation?: boolean;\n /**\n * If true, allows the user to select text inside the chip.\n */\n allowTextSelection?: boolean;\n /**\n * Callback fired when the mouse button is pressed on the chip.\n */\n onMouseDown?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;\n /**\n * Callback fired when the chip is clicked.\n */\n onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;\n /**\n * The label of the chip for accessibility.\n */\n ariaLabel?: string;\n /**\n * If true, indicates that the chip has a popup.\n */\n ariaHasPopup?: boolean;\n /**\n * If true, disables all click behaviors.\n */\n disableClickableBehavior?: boolean;\n /**\n * If true, displays a border around the chip.\n */\n showBorder?: boolean;\n /**\n * The label for the close button.\n */\n closeButtonAriaLabel?: string;\n /**\n * If true, removes the default margin from the chip.\n */\n noMargin?: boolean;\n}\n\nconst Chips = forwardRef(\n (\n {\n className,\n avatarClassName,\n iconClassName,\n id,\n label = \"\",\n leftIcon = null,\n rightIcon = null,\n leftAvatar = null,\n rightAvatar = null,\n disabled = false,\n readOnly = false,\n allowTextSelection = false,\n color = \"primary\",\n iconSize = 18,\n onDelete = (_id: string, _e: React.MouseEvent<HTMLSpanElement>) => {},\n onMouseDown,\n onClick,\n noAnimation = true,\n ariaLabel,\n ariaHasPopup = false,\n \"data-testid\": dataTestId,\n disableClickableBehavior = false,\n leftAvatarType = \"img\",\n rightAvatarType = \"img\",\n showBorder = false,\n leftRenderer,\n rightRenderer,\n closeButtonAriaLabel = \"Remove\",\n noMargin = false\n }: ChipsProps,\n ref: React.ForwardedRef<HTMLDivElement>\n ) => {\n const componentDataTestId = dataTestId || getTestId(ComponentDefaultTestId.CHIP, id);\n const hasClickableWrapper = (!!onClick || !!onMouseDown) && !disableClickableBehavior;\n const hasCloseButton = !readOnly && !disabled;\n const overrideAriaLabel = ariaLabel || (typeof label === \"string\" && label) || \"\";\n\n const iconButtonRef = useRef(null);\n const componentRef = useRef(null);\n\n const [isHovered, setIsHovered] = useState(false);\n const handleMouseEnter = useCallback(() => setIsHovered(true), []);\n const handleMouseLeave = useCallback(() => setIsHovered(false), []);\n const { isFocused } = useSetFocus({ ref: componentRef });\n\n const mergedRef = useMergeRef<HTMLDivElement>(ref, componentRef);\n\n const overrideClassName = cx(styles.chips, className, {\n [styles.disabled]: disabled,\n [styles.noAnimation]: noAnimation,\n [styles.withUserSelect]: allowTextSelection,\n [styles.border]: showBorder,\n [styles.noMargin]: noMargin\n });\n const clickableClassName = cx(styles.clickable, overrideClassName, {\n [styles.disabled]: disabled,\n [styles.disableTextSelection]: !allowTextSelection\n });\n\n const backgroundColorStyle = useMemo(() => {\n let cssVar;\n if (disabled) {\n cssVar = getCSSVar(\"disabled-background-color\");\n } else if (hasClickableWrapper && (isHovered || isFocused)) {\n cssVar = getElementColor(color, true, true);\n } else {\n cssVar = getElementColor(color, true);\n }\n return { backgroundColor: cssVar };\n }, [disabled, hasClickableWrapper, isHovered, isFocused, color]);\n\n const onDeleteCallback = useCallback(\n (e: React.MouseEvent<HTMLSpanElement, MouseEvent>) => {\n e.stopPropagation();\n if (onDelete) {\n onDelete(id, e);\n }\n },\n [id, onDelete]\n );\n\n const onClickCallback = useCallback(\n (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n if (onClick !== undefined && (e.target as HTMLElement) !== iconButtonRef.current) {\n e.preventDefault();\n onClick(e);\n }\n },\n [onClick]\n );\n\n const clickableProps = useClickableProps(\n {\n onClick: onClickCallback,\n onMouseDown,\n disabled,\n id,\n \"data-testid\": componentDataTestId,\n ariaLabel: overrideAriaLabel,\n ariaHidden: false,\n ariaHasPopup,\n ariaExpanded: false\n },\n mergedRef\n );\n const wrapperProps = hasClickableWrapper\n ? {\n ...clickableProps,\n ref: mergedRef,\n className: clickableClassName,\n style: backgroundColorStyle,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave\n }\n : {\n className: overrideClassName,\n \"aria-label\": overrideAriaLabel,\n style: backgroundColorStyle,\n ref: mergedRef,\n onClick: onClickCallback,\n onMouseDown,\n id: id,\n \"data-testid\": componentDataTestId,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave\n };\n\n const leftAvatarProps = leftAvatarType === \"text\" ? { text: leftAvatar } : { src: leftAvatar };\n const rightAvatarProps = leftAvatarType === \"text\" ? { text: rightAvatar } : { src: rightAvatar };\n\n return (\n <div {...wrapperProps} data-vibe={ComponentVibeId.CHIPS}>\n {leftAvatar ? (\n <Avatar\n withoutBorder\n className={cx(styles.avatar, styles.left, avatarClassName)}\n customSize={CHIPS_AVATAR_SIZE}\n type={leftAvatarType}\n key={id}\n {...leftAvatarProps}\n />\n ) : null}\n {leftIcon ? (\n <Icon\n className={cx(styles.icon, styles.left, iconClassName)}\n iconType=\"font\"\n icon={leftIcon}\n iconSize={iconSize}\n ignoreFocusStyle\n />\n ) : null}\n {leftRenderer && <div className={cx(styles.customRenderer, styles.left)}>{leftRenderer}</div>}\n <Text type=\"text2\" className={styles.label}>\n {label}\n </Text>\n {rightIcon ? (\n <Icon\n className={cx(styles.icon, styles.right, iconClassName)}\n iconType=\"font\"\n icon={rightIcon}\n iconSize={iconSize}\n ignoreFocusStyle\n />\n ) : null}\n {rightAvatar ? (\n <Avatar\n withoutBorder\n className={cx(styles.avatar, styles.right, avatarClassName)}\n customSize={CHIPS_AVATAR_SIZE}\n type={rightAvatarType}\n key={id}\n {...rightAvatarProps}\n />\n ) : null}\n {rightRenderer && <div className={cx(styles.customRenderer, styles.right)}>{rightRenderer}</div>}\n {hasCloseButton && (\n <IconButton\n size=\"xxs\"\n color=\"on-primary-color\"\n className={cx(styles.icon, styles.close)}\n ariaLabel={closeButtonAriaLabel}\n hideTooltip\n icon={CloseSmall}\n onClick={onDeleteCallback}\n data-testid={`${componentDataTestId}-close`}\n ref={iconButtonRef}\n />\n )}\n </div>\n );\n }\n);\n\ninterface ChipsStaticProps {\n colors: typeof ElementAllowedColorEnum;\n avatarTypes: typeof AvatarTypeEnum;\n}\n\nexport default withStaticProps<ChipsProps, ChipsStaticProps>(Chips, {\n colors: ElementAllowedColorEnum,\n avatarTypes: AvatarTypeEnum\n});\n"],"names":["withStaticProps","forwardRef","_ref","ref","className","avatarClassName","iconClassName","id","_ref$label","label","_ref$leftIcon","leftIcon","_ref$rightIcon","rightIcon","_ref$leftAvatar","leftAvatar","_ref$rightAvatar","rightAvatar","_ref$disabled","disabled","_ref$readOnly","readOnly","_ref$allowTextSelecti","allowTextSelection","_ref$color","color","_ref$iconSize","iconSize","_ref$onDelete","onDelete","_id","_e","onMouseDown","onClick","_ref$noAnimation","noAnimation","ariaLabel","_ref$ariaHasPopup","ariaHasPopup","_ref$disableClickable","disableClickableBehavior","_ref$leftAvatarType","leftAvatarType","_ref$rightAvatarType","rightAvatarType","_ref$showBorder","showBorder","leftRenderer","rightRenderer","_ref$closeButtonAriaL","closeButtonAriaLabel","_ref$noMargin","noMargin","componentDataTestId","getTestId","ComponentDefaultTestId","CHIP","hasClickableWrapper","hasCloseButton","overrideAriaLabel","iconButtonRef","useRef","componentRef","_useState","useState","_useState2","_slicedToArray","isHovered","setIsHovered","handleMouseEnter","useCallback","handleMouseLeave","isFocused","useSetFocus","mergedRef","useMergeRef","overrideClassName","cx","styles","chips","_defineProperty","withUserSelect","border","clickableClassName","clickable","disableTextSelection","backgroundColorStyle","useMemo","backgroundColor","getCSSVar","getElementColor","onDeleteCallback","e","stopPropagation","onClickCallback","undefined","target","current","preventDefault","clickableProps","useClickableProps","ariaHidden","ariaExpanded","wrapperProps","Object","assign","style","onMouseEnter","onMouseLeave","leftAvatarProps","text","src","rightAvatarProps","React","createElement","ComponentVibeId","CHIPS","Avatar","withoutBorder","avatar","left","customSize","type","key","Icon","icon","iconType","ignoreFocusStyle","customRenderer","Text","right","IconButton","size","close","hideTooltip","CloseSmall","colors","ElementAllowedColorEnum","avatarTypes","AvatarTypeEnum"],"mappings":"uhCAqBA,IAsTeA,EAAAA,E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tH,UAAW0E,EAAOrE,OAClCA,GAEFI,EACCoG,EAACC,cAAAU,GACCxH,UAAWyE,EAAGC,EAAO+C,KAAM/C,EAAOoD,MAAO5H,GACzCwH,SAAS,OACTD,KAAMhH,EACNc,SAAUA,EACVoG,kBAAgB,IAEhB,KACH9G,EACCgG,EAACC,cAAAG,iBACCC,eAAa,EACblH,UAAWyE,EAAGC,EAAOyC,OAAQzC,EAAOoD,MAAO7H,GAC3CoH,WAxRc,GAyRdC,KAAM9E,GACN+E,IAAKpH,GACDyG,KAEJ,KACHhE,IAAiBiE,EAAKC,cAAA,MAAA,CAAA9G,UAAWyE,EAAGC,EAAOkD,eAAgBlD,EAAOoD,QAASlF,IAC3EU,IACCuD,EAACC,cAAAiB,GACCC,KAAK,MACL3G,MAAM,mBACNrB,UAAWyE,EAAGC,EAAO+C,KAAM/C,EAAOuD,OAClCjG,UAAWc,GACXoF,aAAW,EACXT,KAAMU,EACNtG,QAAS0D,2BACOtC,GAA2B,UAC3ClD,IAAKyD,KAKf,IAQkE,CAClE4E,OAAQC,EACRC,YAAaC"}
1
+ {"version":3,"file":"Chips.js","sources":["../../../../src/components/Chips/Chips.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useMemo, useRef, useState } from \"react\";\nimport cx from \"classnames\";\nimport { Icon } from \"@vibe/icon\";\nimport useMergeRef from \"../../hooks/useMergeRef\";\nimport { CloseSmall } from \"@vibe/icons\";\nimport { getCSSVar } from \"../../services/themes\";\nimport { ElementAllowedColor as ElementAllowedColorEnum } from \"../../utils/colors-vars-map\";\nimport { type ElementAllowedColor, getElementColor } from \"../../types/Colors\";\nimport Avatar from \"../Avatar/Avatar\";\nimport IconButton from \"../IconButton/IconButton\";\nimport Text from \"../Text/Text\";\nimport { ComponentDefaultTestId, getTestId } from \"../../tests/test-ids-utils\";\nimport { AvatarType as AvatarTypeEnum } from \"../Avatar/AvatarConstants\";\nimport { type AvatarType } from \"../Avatar\";\nimport { type ElementContent, type VibeComponentProps, withStaticProps } from \"../../types\";\nimport { type SubIcon } from \"@vibe/icon\";\nimport useSetFocus from \"../../hooks/useSetFocus\";\nimport useClickableProps from \"../../hooks/useClickableProps/useClickableProps\";\nimport styles from \"./Chips.module.scss\";\nimport { ComponentVibeId } from \"../../tests/constants\";\n\nconst CHIPS_AVATAR_SIZE = 18;\n\nexport interface ChipsProps extends VibeComponentProps {\n /**\n * The text or content displayed inside the chip.\n */\n label?: ElementContent;\n /**\n * If true, the chip is disabled.\n */\n disabled?: boolean;\n /**\n * If true, the chip is read-only and cannot be deleted.\n */\n readOnly?: boolean;\n /**\n * A React element displayed on the right side.\n */\n rightRenderer?: ElementContent;\n /**\n * A React element displayed on the left side.\n */\n leftRenderer?: ElementContent;\n /**\n * Icon displayed on the right side.\n */\n rightIcon?: SubIcon;\n /**\n * Icon displayed on the left side.\n */\n leftIcon?: SubIcon;\n /**\n * Image URL or text for an avatar displayed on the right.\n */\n rightAvatar?: string;\n /**\n * The type of avatar displayed on the right.\n */\n rightAvatarType?: AvatarType;\n /**\n * Image URL or text for an avatar displayed on the left.\n */\n leftAvatar?: string;\n /**\n * The type of avatar displayed on the left.\n */\n leftAvatarType?: AvatarType;\n /**\n * Class name applied to left or right icons.\n */\n iconClassName?: string;\n /**\n * Class name applied to left or right avatars.\n */\n avatarClassName?: string;\n /**\n * The background color of the chip.\n */\n color?: Exclude<ElementAllowedColor, \"dark_indigo\" | \"blackish\">;\n /**\n * The size of the icons inside the chip.\n */\n iconSize?: number | string;\n /**\n * Callback fired when the chip is deleted.\n */\n onDelete?: (id: string, event: React.MouseEvent<HTMLSpanElement>) => void;\n /**\n * If true, disables the chip's entry animation.\n */\n noAnimation?: boolean;\n /**\n * If true, allows the user to select text inside the chip.\n */\n allowTextSelection?: boolean;\n /**\n * Callback fired when the mouse button is pressed on the chip.\n */\n onMouseDown?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;\n /**\n * Callback fired when the chip is clicked.\n */\n onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;\n /**\n * The label of the chip for accessibility.\n */\n ariaLabel?: string;\n /**\n * If true, indicates that the chip has a popup.\n */\n ariaHasPopup?: boolean;\n /**\n * If true, disables all click behaviors.\n */\n disableClickableBehavior?: boolean;\n /**\n * If true, displays a border around the chip.\n */\n showBorder?: boolean;\n /**\n * The label for the close button.\n */\n closeButtonAriaLabel?: string;\n /**\n * If true, removes the default margin from the chip.\n */\n noMargin?: boolean;\n}\n\nconst Chips = forwardRef(\n (\n {\n className,\n avatarClassName,\n iconClassName,\n id,\n label = \"\",\n leftIcon = null,\n rightIcon = null,\n leftAvatar = null,\n rightAvatar = null,\n disabled = false,\n readOnly = false,\n allowTextSelection = false,\n color = \"primary\",\n iconSize = 18,\n onDelete = (_id: string, _e: React.MouseEvent<HTMLSpanElement>) => {},\n onMouseDown,\n onClick,\n noAnimation = true,\n ariaLabel,\n ariaHasPopup = false,\n \"data-testid\": dataTestId,\n disableClickableBehavior = false,\n leftAvatarType = \"img\",\n rightAvatarType = \"img\",\n showBorder = false,\n leftRenderer,\n rightRenderer,\n closeButtonAriaLabel = \"Remove\",\n noMargin = false\n }: ChipsProps,\n ref: React.ForwardedRef<HTMLDivElement>\n ) => {\n const componentDataTestId = dataTestId || getTestId(ComponentDefaultTestId.CHIP, id);\n const hasClickableWrapper = (!!onClick || !!onMouseDown) && !disableClickableBehavior;\n const hasCloseButton = !readOnly && !disabled;\n const overrideAriaLabel = ariaLabel || (typeof label === \"string\" && label) || \"\";\n\n const iconButtonRef = useRef(null);\n const componentRef = useRef(null);\n\n const [isHovered, setIsHovered] = useState(false);\n const handleMouseEnter = useCallback(() => setIsHovered(true), []);\n const handleMouseLeave = useCallback(() => setIsHovered(false), []);\n const { isFocused } = useSetFocus({ ref: componentRef });\n\n const mergedRef = useMergeRef<HTMLDivElement>(ref, componentRef);\n\n const overrideClassName = cx(styles.chips, className, {\n [styles.disabled]: disabled,\n [styles.noAnimation]: noAnimation,\n [styles.withUserSelect]: allowTextSelection,\n [styles.border]: showBorder,\n [styles.noMargin]: noMargin\n });\n const clickableClassName = cx(styles.clickable, overrideClassName, {\n [styles.disabled]: disabled,\n [styles.disableTextSelection]: !allowTextSelection\n });\n\n const backgroundColorStyle = useMemo(() => {\n let cssVar;\n if (disabled) {\n cssVar = getCSSVar(\"disabled-background-color\");\n } else if (hasClickableWrapper && (isHovered || isFocused)) {\n cssVar = getElementColor(color, true, true);\n } else {\n cssVar = getElementColor(color, true);\n }\n return { backgroundColor: cssVar };\n }, [disabled, hasClickableWrapper, isHovered, isFocused, color]);\n\n const onDeleteCallback = useCallback(\n (e: React.MouseEvent<HTMLSpanElement, MouseEvent>) => {\n e.stopPropagation();\n if (onDelete) {\n onDelete(id, e);\n }\n },\n [id, onDelete]\n );\n\n const onClickCallback = useCallback(\n (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n if (onClick !== undefined && (e.target as HTMLElement) !== iconButtonRef.current) {\n e.preventDefault();\n onClick(e);\n }\n },\n [onClick]\n );\n\n const clickableProps = useClickableProps(\n {\n onClick: onClickCallback,\n onMouseDown,\n disabled,\n id,\n \"data-testid\": componentDataTestId,\n ariaLabel: overrideAriaLabel,\n ariaHidden: false,\n ariaHasPopup,\n ariaExpanded: false\n },\n mergedRef\n );\n const wrapperProps = hasClickableWrapper\n ? {\n ...clickableProps,\n ref: mergedRef,\n className: clickableClassName,\n style: backgroundColorStyle,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave\n }\n : {\n className: overrideClassName,\n \"aria-label\": overrideAriaLabel,\n style: backgroundColorStyle,\n ref: mergedRef,\n onClick: onClickCallback,\n onMouseDown,\n id: id,\n \"data-testid\": componentDataTestId,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave\n };\n\n const leftAvatarProps = leftAvatarType === \"text\" ? { text: leftAvatar } : { src: leftAvatar };\n const rightAvatarProps = leftAvatarType === \"text\" ? { text: rightAvatar } : { src: rightAvatar };\n\n return (\n <div {...wrapperProps} data-vibe={ComponentVibeId.CHIPS}>\n {leftAvatar ? (\n <Avatar\n withoutBorder\n className={cx(styles.avatar, styles.left, avatarClassName)}\n customSize={CHIPS_AVATAR_SIZE}\n type={leftAvatarType}\n key={id}\n {...leftAvatarProps}\n />\n ) : null}\n {leftIcon ? (\n <Icon\n className={cx(styles.icon, styles.left, iconClassName)}\n iconType=\"font\"\n icon={leftIcon}\n iconSize={iconSize}\n ignoreFocusStyle\n />\n ) : null}\n {leftRenderer && <div className={cx(styles.customRenderer, styles.left)}>{leftRenderer}</div>}\n <Text type=\"text2\" className={styles.label}>\n {label}\n </Text>\n {rightIcon ? (\n <Icon\n className={cx(styles.icon, styles.right, iconClassName)}\n iconType=\"font\"\n icon={rightIcon}\n iconSize={iconSize}\n ignoreFocusStyle\n />\n ) : null}\n {rightAvatar ? (\n <Avatar\n withoutBorder\n className={cx(styles.avatar, styles.right, avatarClassName)}\n customSize={CHIPS_AVATAR_SIZE}\n type={rightAvatarType}\n key={id}\n {...rightAvatarProps}\n />\n ) : null}\n {rightRenderer && <div className={cx(styles.customRenderer, styles.right)}>{rightRenderer}</div>}\n {hasCloseButton && (\n <IconButton\n size=\"xxs\"\n color=\"on-primary-color\"\n className={cx(styles.icon, styles.close)}\n ariaLabel={closeButtonAriaLabel}\n hideTooltip\n icon={CloseSmall}\n onClick={onDeleteCallback}\n data-testid={`${componentDataTestId}-close`}\n ref={iconButtonRef}\n />\n )}\n </div>\n );\n }\n);\n\ninterface ChipsStaticProps {\n colors: typeof ElementAllowedColorEnum;\n avatarTypes: typeof AvatarTypeEnum;\n}\n\nexport default withStaticProps<ChipsProps, ChipsStaticProps>(Chips, {\n colors: ElementAllowedColorEnum,\n avatarTypes: AvatarTypeEnum\n});\n"],"names":["withStaticProps","forwardRef","_ref","ref","className","avatarClassName","iconClassName","id","_ref$label","label","_ref$leftIcon","leftIcon","_ref$rightIcon","rightIcon","_ref$leftAvatar","leftAvatar","_ref$rightAvatar","rightAvatar","_ref$disabled","disabled","_ref$readOnly","readOnly","_ref$allowTextSelecti","allowTextSelection","_ref$color","color","_ref$iconSize","iconSize","_ref$onDelete","onDelete","_id","_e","onMouseDown","onClick","_ref$noAnimation","noAnimation","ariaLabel","_ref$ariaHasPopup","ariaHasPopup","_ref$disableClickable","disableClickableBehavior","_ref$leftAvatarType","leftAvatarType","_ref$rightAvatarType","rightAvatarType","_ref$showBorder","showBorder","leftRenderer","rightRenderer","_ref$closeButtonAriaL","closeButtonAriaLabel","_ref$noMargin","noMargin","componentDataTestId","getTestId","ComponentDefaultTestId","CHIP","hasClickableWrapper","hasCloseButton","overrideAriaLabel","iconButtonRef","useRef","componentRef","_useState","useState","_useState2","_slicedToArray","isHovered","setIsHovered","handleMouseEnter","useCallback","handleMouseLeave","isFocused","useSetFocus","mergedRef","useMergeRef","overrideClassName","cx","styles","chips","_defineProperty","withUserSelect","border","clickableClassName","clickable","disableTextSelection","backgroundColorStyle","useMemo","backgroundColor","getCSSVar","getElementColor","onDeleteCallback","e","stopPropagation","onClickCallback","undefined","target","current","preventDefault","clickableProps","useClickableProps","ariaHidden","ariaExpanded","wrapperProps","Object","assign","style","onMouseEnter","onMouseLeave","leftAvatarProps","text","src","rightAvatarProps","React","createElement","ComponentVibeId","CHIPS","Avatar","withoutBorder","avatar","left","customSize","type","key","Icon","icon","iconType","ignoreFocusStyle","customRenderer","Text","right","IconButton","size","close","hideTooltip","CloseSmall","colors","ElementAllowedColorEnum","avatarTypes","AvatarTypeEnum"],"mappings":"2jCAqBA,IAsTeA,EAAAA,EAzMDC,GACZ,SAAAC,EAgCEC,GACE,IA/BAC,EAASF,EAATE,UACAC,EAAeH,EAAfG,gBACAC,EAAaJ,EAAbI,cACAC,EAAEL,EAAFK,GAAEC,EAAAN,EACFO,MAAAA,OAAQ,IAAHD,EAAG,GAAEA,EAAAE,EAAAR,EACVS,SAAAA,OAAW,IAAHD,EAAG,KAAIA,EAAAE,EAAAV,EACfW,UAAAA,OAAY,IAAHD,EAAG,KAAIA,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,WAxRc,GAyRdC,KAAM9E,GACN+E,IAAKpH,GACDyG,KAEJ,KACHhE,IAAiBiE,EAAKC,cAAA,MAAA,CAAA9G,UAAWyE,EAAGC,EAAOkD,eAAgBlD,EAAOoD,QAASlF,IAC3EU,IACCuD,EAACC,cAAAiB,GACCC,KAAK,MACL3G,MAAM,mBACNrB,UAAWyE,EAAGC,EAAO+C,KAAM/C,EAAOuD,OAClCjG,UAAWc,GACXoF,aAAW,EACXT,KAAMU,EACNtG,QAAS0D,2BACOtC,GAA2B,UAC3ClD,IAAKyD,KAKf,IAQkE,CAClE4E,OAAQC,EACRC,YAAaC"}
@@ -1,2 +1,2 @@
1
- import o from"classnames";import r,{forwardRef as e,useRef as t,useCallback as i}from"react";import{BaseSizes as s}from"../../constants/sizes.js";import l from"../../hooks/useMergeRef.js";import c from"../DialogContentContainer/DialogContentContainer.js";import{ColorStyle as n}from"../../utils/colors-vars-map.js";import a from"./components/ColorPickerContent/ColorPickerContent.js";import{ColorShapes as m,DEFAULT_NUMBER_OF_COLORS_IN_LINE as d}from"./ColorPickerConstants.js";import{calculateColorPickerDialogWidth as C}from"./services/ColorPickerStyleService.js";import{withStaticProps as u}from"../../types/withStaticProps.js";import{NOOP as f}from"../../utils/function-utils.js";import{getTestId as p,ComponentDefaultTestId as v}from"../../tests/testIds.js";import I from"./ColorPicker.module.scss.js";import{ComponentVibeId as S}from"../../tests/constants.js";import k from"../../../icons/dist/react/NoColor.js";var h=u(e((function(e,s){var n=e.className,m=e.onSave,u=void 0===m?f:m,h=e.value,j=void 0===h?"":h,P=e.noColorText,L=e.colorStyle,g=void 0===L?"regular":L,R=e.ColorIndicatorIcon,y=e.SelectedIndicatorIcon,O=e.shouldRenderIndicatorWithoutBackground,b=e.NoColorIcon,M=void 0===b?k:b,N=e.isBlackListMode,w=void 0===N||N,z=e.colorsList,D=void 0===z?[]:z,B=e.isMultiselect,E=e.colorSize,T=void 0===E?"medium":E,x=e.numberOfColorsInLine,K=void 0===x?d:x,U=e.focusOnMount,W=e.colorShape,_=void 0===W?"square":W,q=e.forceUseRawColorList,V=e.showColorNameTooltip,A=e.id,F=e["data-testid"],G=t(null),H=l(s,G),J=i(u,[u]),Q=C(T,K);return r.createElement(c,{ref:H,className:o(I.colorPicker,I.colorPickerDialogContent,n),ariaLabelledby:"Color Picker Dialog",ariaDescribedby:"Pick color",style:{width:Q},"data-vibe":S.COLOR_PICKER},r.createElement(a,{onValueChange:J,value:j,noColorText:P,shouldRenderIndicatorWithoutBackground:R&&O,colorStyle:g,ColorIndicatorIcon:R,SelectedIndicatorIcon:y,NoColorIcon:M,colorsList:D,isBlackListMode:w,isMultiselect:B,colorSize:T,numberOfColorsInLine:K,focusOnMount:U,colorShape:_,forceUseRawColorList:q,showColorNameTooltip:V,id:A,"data-testid":F||p(v.COLOR_PICKER,A)}))})),{sizes:s,colorStyles:n,colorSizes:s,colorShapes:m});export{h as default};
1
+ import o from"classnames";import r,{forwardRef as e,useRef as t,useCallback as i}from"react";import{BaseSizes as s}from"../../constants/sizes.js";import l from"../../hooks/useMergeRef.js";import c from"../DialogContentContainer/DialogContentContainer.js";import{ColorStyle as a}from"../../utils/colors-vars-map.js";import n from"./components/ColorPickerContent/ColorPickerContent.js";import{ColorShapes as m,DEFAULT_NUMBER_OF_COLORS_IN_LINE as d}from"./ColorPickerConstants.js";import{calculateColorPickerDialogWidth as C}from"./services/ColorPickerStyleService.js";import{withStaticProps as u}from"../../types/withStaticProps.js";import{NOOP as f}from"../../utils/function-utils.js";import{getTestId as p,ComponentDefaultTestId as v}from"../../tests/testIds.js";import I from"./ColorPicker.module.scss.js";import{ComponentVibeId as k}from"../../tests/constants.js";import S from"../../../packages/icons/dist/react/NoColor.js";var h=u(e((function(e,s){var a=e.className,m=e.onSave,u=void 0===m?f:m,h=e.value,j=void 0===h?"":h,P=e.noColorText,L=e.colorStyle,g=void 0===L?"regular":L,R=e.ColorIndicatorIcon,y=e.SelectedIndicatorIcon,O=e.shouldRenderIndicatorWithoutBackground,b=e.NoColorIcon,M=void 0===b?S:b,N=e.isBlackListMode,w=void 0===N||N,z=e.colorsList,D=void 0===z?[]:z,B=e.isMultiselect,E=e.colorSize,T=void 0===E?"medium":E,x=e.numberOfColorsInLine,K=void 0===x?d:x,U=e.focusOnMount,W=e.colorShape,_=void 0===W?"square":W,q=e.forceUseRawColorList,V=e.showColorNameTooltip,A=e.id,F=e["data-testid"],G=t(null),H=l(s,G),J=i(u,[u]),Q=C(T,K);return r.createElement(c,{ref:H,className:o(I.colorPicker,I.colorPickerDialogContent,a),ariaLabelledby:"Color Picker Dialog",ariaDescribedby:"Pick color",style:{width:Q},"data-vibe":k.COLOR_PICKER},r.createElement(n,{onValueChange:J,value:j,noColorText:P,shouldRenderIndicatorWithoutBackground:R&&O,colorStyle:g,ColorIndicatorIcon:R,SelectedIndicatorIcon:y,NoColorIcon:M,colorsList:D,isBlackListMode:w,isMultiselect:B,colorSize:T,numberOfColorsInLine:K,focusOnMount:U,colorShape:_,forceUseRawColorList:q,showColorNameTooltip:V,id:A,"data-testid":F||p(v.COLOR_PICKER,A)}))})),{sizes:s,colorStyles:a,colorSizes:s,colorShapes:m});export{h as default};
2
2
  //# sourceMappingURL=ColorPicker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker.js","sources":["../../../../src/components/ColorPicker/ColorPicker.tsx"],"sourcesContent":["import cx from \"classnames\";\nimport React, { forwardRef, useCallback, useRef } from \"react\";\nimport { BaseSizes } from \"../../constants\";\nimport useMergeRef from \"../../hooks/useMergeRef\";\nimport DialogContentContainer from \"../DialogContentContainer/DialogContentContainer\";\nimport { ColorStyle as ColorStyleEnum } from \"../../utils/colors-vars-map\";\nimport { NoColor } from \"@vibe/icons\";\nimport ColorPickerContent from \"./components/ColorPickerContent/ColorPickerContent\";\nimport { ColorShapes as ColorShapesEnum, DEFAULT_NUMBER_OF_COLORS_IN_LINE } from \"./ColorPickerConstants\";\nimport {\n type ColorShapes,\n type ColorPickerSizes,\n type ColorPickerValue,\n type ColorPickerArrayValueOnly\n} from \"./ColorPicker.types\";\nimport { calculateColorPickerDialogWidth } from \"./services/ColorPickerStyleService\";\nimport { type VibeComponentProps, type SubIcon, withStaticProps } from \"../../types\";\nimport { NOOP } from \"../../utils/function-utils\";\nimport { ComponentDefaultTestId, getTestId } from \"../../tests/test-ids-utils\";\nimport styles from \"./ColorPicker.module.scss\";\nimport { type ColorStyle } from \"../../types/Colors\";\nimport { ComponentVibeId } from \"../../tests/constants\";\n\nexport interface ColorPickerProps extends VibeComponentProps {\n /**\n * The selected color(s).\n */\n value?: ColorPickerValue;\n /**\n * Callback fired when the selected color(s) change.\n */\n onSave?: (value: ColorPickerArrayValueOnly) => void;\n /**\n * Icon displayed as an indicator inside the color.\n */\n ColorIndicatorIcon?: SubIcon;\n /**\n * Icon displayed when a color is selected.\n */\n SelectedIndicatorIcon?: SubIcon;\n /**\n * Icon used for clearing the color selection.\n */\n NoColorIcon?: SubIcon;\n /**\n * The style applied to the colors.\n */\n colorStyle?: ColorStyle;\n /**\n * Text displayed for the \"no color\" option.\n */\n noColorText?: string;\n /**\n * If true, renders the color indicator without a background.\n */\n shouldRenderIndicatorWithoutBackground?: boolean;\n /**\n * If true, treats the color list as a blacklist rather than a whitelist.\n */\n isBlackListMode?: boolean;\n /**\n * The list of colors available for selection.\n */\n colorsList?: ColorPickerArrayValueOnly;\n /**\n * If true, allows selecting multiple colors.\n */\n isMultiselect?: boolean;\n /**\n * The size of the color items.\n */\n colorSize?: ColorPickerSizes;\n /**\n * The number of colors displayed per row.\n */\n numberOfColorsInLine?: number;\n /**\n * If true, the first color is focused when the component mounts.\n */\n focusOnMount?: boolean;\n /**\n * The shape of the color items.\n */\n colorShape?: ColorShapes;\n /**\n * Used to force the component render the colorList prop as is. Usually, this flag should not be used. It's intended only for edge cases.\n * Usually, only \"monday colors\" will be rendered (unless blacklist mode is used). This flag will override this behavior.\n */\n forceUseRawColorList?: boolean;\n /**\n * Used to enable color name tooltip on each color in the component.\n * When \"tooltipContentByColor\" is supplied, it will override the color name tooltip.\n *\n */\n showColorNameTooltip?: boolean;\n}\n\nconst ColorPicker = forwardRef(\n (\n {\n className,\n onSave = NOOP,\n value = \"\",\n noColorText,\n colorStyle = \"regular\",\n ColorIndicatorIcon,\n SelectedIndicatorIcon,\n shouldRenderIndicatorWithoutBackground,\n NoColorIcon = NoColor,\n isBlackListMode = true,\n colorsList = [],\n isMultiselect,\n colorSize = \"medium\",\n numberOfColorsInLine = DEFAULT_NUMBER_OF_COLORS_IN_LINE,\n focusOnMount,\n colorShape = \"square\",\n forceUseRawColorList,\n showColorNameTooltip,\n id,\n \"data-testid\": dataTestId\n }: ColorPickerProps,\n ref: React.ForwardedRef<HTMLElement>\n ) => {\n const componentRef = useRef(null);\n const mergedRef = useMergeRef(ref, componentRef);\n\n const onChange = useCallback(onSave, [onSave]);\n\n const width = calculateColorPickerDialogWidth(colorSize as BaseSizes, numberOfColorsInLine);\n\n return (\n <DialogContentContainer\n ref={mergedRef}\n className={cx(styles.colorPicker, styles.colorPickerDialogContent, className)}\n ariaLabelledby=\"Color Picker Dialog\"\n ariaDescribedby=\"Pick color\"\n style={{ width }}\n data-vibe={ComponentVibeId.COLOR_PICKER}\n >\n <ColorPickerContent\n onValueChange={onChange}\n value={value}\n noColorText={noColorText}\n shouldRenderIndicatorWithoutBackground={ColorIndicatorIcon && shouldRenderIndicatorWithoutBackground}\n colorStyle={colorStyle}\n ColorIndicatorIcon={ColorIndicatorIcon}\n SelectedIndicatorIcon={SelectedIndicatorIcon}\n NoColorIcon={NoColorIcon}\n colorsList={colorsList}\n isBlackListMode={isBlackListMode}\n isMultiselect={isMultiselect}\n colorSize={colorSize}\n numberOfColorsInLine={numberOfColorsInLine}\n focusOnMount={focusOnMount}\n colorShape={colorShape}\n forceUseRawColorList={forceUseRawColorList}\n showColorNameTooltip={showColorNameTooltip}\n id={id}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.COLOR_PICKER, id)}\n />\n </DialogContentContainer>\n );\n }\n);\n\ninterface ColorPickerStaticProps {\n sizes: typeof BaseSizes;\n colorStyles: typeof ColorStyleEnum;\n colorSizes: typeof BaseSizes;\n colorShapes: typeof ColorShapesEnum;\n}\n\nexport default withStaticProps<ColorPickerProps, ColorPickerStaticProps>(ColorPicker, {\n sizes: BaseSizes,\n colorStyles: ColorStyleEnum,\n colorSizes: BaseSizes,\n colorShapes: ColorShapesEnum\n});\n"],"names":["withStaticProps","forwardRef","_ref","ref","className","_ref$onSave","onSave","NOOP","_ref$value","value","noColorText","_ref$colorStyle","colorStyle","ColorIndicatorIcon","SelectedIndicatorIcon","shouldRenderIndicatorWithoutBackground","_ref$NoColorIcon","NoColorIcon","NoColor","_ref$isBlackListMode","isBlackListMode","_ref$colorsList","colorsList","isMultiselect","_ref$colorSize","colorSize","_ref$numberOfColorsIn","numberOfColorsInLine","DEFAULT_NUMBER_OF_COLORS_IN_LINE","focusOnMount","_ref$colorShape","colorShape","forceUseRawColorList","showColorNameTooltip","id","dataTestId","componentRef","useRef","mergedRef","useMergeRef","onChange","useCallback","width","calculateColorPickerDialogWidth","React","createElement","DialogContentContainer","cx","styles","colorPicker","colorPickerDialogContent","ariaLabelledby","ariaDescribedby","style","ComponentVibeId","COLOR_PICKER","ColorPickerContent","onValueChange","getTestId","ComponentDefaultTestId","sizes","BaseSizes","colorStyles","ColorStyleEnum","colorSizes","colorShapes","ColorShapesEnum"],"mappings":"s5BAiGA,IA2EeA,EAAAA,EA3EKC,GAClB,SAAAC,EAuBEC,GACE,IAtBAC,EAASF,EAATE,UAASC,EAAAH,EACTI,OAAAA,OAASC,IAAHF,EAAGE,EAAIF,EAAAG,EAAAN,EACbO,MAAAA,OAAQ,IAAHD,EAAG,GAAEA,EACVE,EAAWR,EAAXQ,YAAWC,EAAAT,EACXU,WAAAA,OAAa,IAAHD,EAAG,UAASA,EACtBE,EAAkBX,EAAlBW,mBACAC,EAAqBZ,EAArBY,sBACAC,EAAsCb,EAAtCa,uCAAsCC,EAAA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sources":["../../../../src/components/ColorPicker/ColorPicker.tsx"],"sourcesContent":["import cx from \"classnames\";\nimport React, { forwardRef, useCallback, useRef } from \"react\";\nimport { BaseSizes } from \"../../constants\";\nimport useMergeRef from \"../../hooks/useMergeRef\";\nimport DialogContentContainer from \"../DialogContentContainer/DialogContentContainer\";\nimport { ColorStyle as ColorStyleEnum } from \"../../utils/colors-vars-map\";\nimport { NoColor } from \"@vibe/icons\";\nimport ColorPickerContent from \"./components/ColorPickerContent/ColorPickerContent\";\nimport { ColorShapes as ColorShapesEnum, DEFAULT_NUMBER_OF_COLORS_IN_LINE } from \"./ColorPickerConstants\";\nimport {\n type ColorShapes,\n type ColorPickerSizes,\n type ColorPickerValue,\n type ColorPickerArrayValueOnly\n} from \"./ColorPicker.types\";\nimport { calculateColorPickerDialogWidth } from \"./services/ColorPickerStyleService\";\nimport { type VibeComponentProps, withStaticProps } from \"../../types\";\nimport { type SubIcon } from \"@vibe/icon\";\nimport { NOOP } from \"../../utils/function-utils\";\nimport { ComponentDefaultTestId, getTestId } from \"../../tests/test-ids-utils\";\nimport styles from \"./ColorPicker.module.scss\";\nimport { type ColorStyle } from \"../../types/Colors\";\nimport { ComponentVibeId } from \"../../tests/constants\";\n\nexport interface ColorPickerProps extends VibeComponentProps {\n /**\n * The selected color(s).\n */\n value?: ColorPickerValue;\n /**\n * Callback fired when the selected color(s) change.\n */\n onSave?: (value: ColorPickerArrayValueOnly) => void;\n /**\n * Icon displayed as an indicator inside the color.\n */\n ColorIndicatorIcon?: SubIcon;\n /**\n * Icon displayed when a color is selected.\n */\n SelectedIndicatorIcon?: SubIcon;\n /**\n * Icon used for clearing the color selection.\n */\n NoColorIcon?: SubIcon;\n /**\n * The style applied to the colors.\n */\n colorStyle?: ColorStyle;\n /**\n * Text displayed for the \"no color\" option.\n */\n noColorText?: string;\n /**\n * If true, renders the color indicator without a background.\n */\n shouldRenderIndicatorWithoutBackground?: boolean;\n /**\n * If true, treats the color list as a blacklist rather than a whitelist.\n */\n isBlackListMode?: boolean;\n /**\n * The list of colors available for selection.\n */\n colorsList?: ColorPickerArrayValueOnly;\n /**\n * If true, allows selecting multiple colors.\n */\n isMultiselect?: boolean;\n /**\n * The size of the color items.\n */\n colorSize?: ColorPickerSizes;\n /**\n * The number of colors displayed per row.\n */\n numberOfColorsInLine?: number;\n /**\n * If true, the first color is focused when the component mounts.\n */\n focusOnMount?: boolean;\n /**\n * The shape of the color items.\n */\n colorShape?: ColorShapes;\n /**\n * Used to force the component render the colorList prop as is. Usually, this flag should not be used. It's intended only for edge cases.\n * Usually, only \"monday colors\" will be rendered (unless blacklist mode is used). This flag will override this behavior.\n */\n forceUseRawColorList?: boolean;\n /**\n * Used to enable color name tooltip on each color in the component.\n * When \"tooltipContentByColor\" is supplied, it will override the color name tooltip.\n *\n */\n showColorNameTooltip?: boolean;\n}\n\nconst ColorPicker = forwardRef(\n (\n {\n className,\n onSave = NOOP,\n value = \"\",\n noColorText,\n colorStyle = \"regular\",\n ColorIndicatorIcon,\n SelectedIndicatorIcon,\n shouldRenderIndicatorWithoutBackground,\n NoColorIcon = NoColor,\n isBlackListMode = true,\n colorsList = [],\n isMultiselect,\n colorSize = \"medium\",\n numberOfColorsInLine = DEFAULT_NUMBER_OF_COLORS_IN_LINE,\n focusOnMount,\n colorShape = \"square\",\n forceUseRawColorList,\n showColorNameTooltip,\n id,\n \"data-testid\": dataTestId\n }: ColorPickerProps,\n ref: React.ForwardedRef<HTMLElement>\n ) => {\n const componentRef = useRef(null);\n const mergedRef = useMergeRef(ref, componentRef);\n\n const onChange = useCallback(onSave, [onSave]);\n\n const width = calculateColorPickerDialogWidth(colorSize as BaseSizes, numberOfColorsInLine);\n\n return (\n <DialogContentContainer\n ref={mergedRef}\n className={cx(styles.colorPicker, styles.colorPickerDialogContent, className)}\n ariaLabelledby=\"Color Picker Dialog\"\n ariaDescribedby=\"Pick color\"\n style={{ width }}\n data-vibe={ComponentVibeId.COLOR_PICKER}\n >\n <ColorPickerContent\n onValueChange={onChange}\n value={value}\n noColorText={noColorText}\n shouldRenderIndicatorWithoutBackground={ColorIndicatorIcon && shouldRenderIndicatorWithoutBackground}\n colorStyle={colorStyle}\n ColorIndicatorIcon={ColorIndicatorIcon}\n SelectedIndicatorIcon={SelectedIndicatorIcon}\n NoColorIcon={NoColorIcon}\n colorsList={colorsList}\n isBlackListMode={isBlackListMode}\n isMultiselect={isMultiselect}\n colorSize={colorSize}\n numberOfColorsInLine={numberOfColorsInLine}\n focusOnMount={focusOnMount}\n colorShape={colorShape}\n forceUseRawColorList={forceUseRawColorList}\n showColorNameTooltip={showColorNameTooltip}\n id={id}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.COLOR_PICKER, id)}\n />\n </DialogContentContainer>\n );\n }\n);\n\ninterface ColorPickerStaticProps {\n sizes: typeof BaseSizes;\n colorStyles: typeof ColorStyleEnum;\n colorSizes: typeof BaseSizes;\n colorShapes: typeof ColorShapesEnum;\n}\n\nexport default withStaticProps<ColorPickerProps, ColorPickerStaticProps>(ColorPicker, {\n sizes: BaseSizes,\n colorStyles: ColorStyleEnum,\n colorSizes: BaseSizes,\n colorShapes: ColorShapesEnum\n});\n"],"names":["withStaticProps","forwardRef","_ref","ref","className","_ref$onSave","onSave","NOOP","_ref$value","value","noColorText","_ref$colorStyle","colorStyle","ColorIndicatorIcon","SelectedIndicatorIcon","shouldRenderIndicatorWithoutBackground","_ref$NoColorIcon","NoColorIcon","NoColor","_ref$isBlackListMode","isBlackListMode","_ref$colorsList","colorsList","isMultiselect","_ref$colorSize","colorSize","_ref$numberOfColorsIn","numberOfColorsInLine","DEFAULT_NUMBER_OF_COLORS_IN_LINE","focusOnMount","_ref$colorShape","colorShape","forceUseRawColorList","showColorNameTooltip","id","dataTestId","componentRef","useRef","mergedRef","useMergeRef","onChange","useCallback","width","calculateColorPickerDialogWidth","React","createElement","DialogContentContainer","cx","styles","colorPicker","colorPickerDialogContent","ariaLabelledby","ariaDescribedby","style","ComponentVibeId","COLOR_PICKER","ColorPickerContent","onValueChange","getTestId","ComponentDefaultTestId","sizes","BaseSizes","colorStyles","ColorStyleEnum","colorSizes","colorShapes","ColorShapesEnum"],"mappings":"+5BAkGA,IA2EeA,EAAAA,EA3EKC,GAClB,SAAAC,EAuBEC,GACE,IAtBAC,EAASF,EAATE,UAASC,EAAAH,EACTI,OAAAA,OAASC,IAAHF,EAAGE,EAAIF,EAAAG,EAAAN,EACbO,MAAAA,OAAQ,IAAHD,EAAG,GAAEA,EACVE,EAAWR,EAAXQ,YAAWC,EAAAT,EACXU,WAAAA,OAAa,IAAHD,EAAG,UAASA,EACtBE,EAAkBX,EAAlBW,mBACAC,EAAqBZ,EAArBY,sBACAC,EAAsCb,EAAtCa,uCAAsCC,EAAAd,EACtCe,YAAAA,OAAcC,IAAHF,EAAGE,EAAOF,EAAAG,EAAAjB,EACrBkB,gBAAAA,OAAkB,IAAHD,GAAOA,EAAAE,EAAAnB,EACtBoB,WAAAA,OAAa,IAAHD,EAAG,GAAEA,EACfE,EAAarB,EAAbqB,cAAaC,EAAAtB,EACbuB,UAAAA,OAAY,IAAHD,EAAG,SAAQA,EAAAE,EAAAxB,EACpByB,qBAAAA,OAAuBC,IAAHF,EAAGE,EAAgCF,EACvDG,EAAY3B,EAAZ2B,aAAYC,EAAA5B,EACZ6B,WAAAA,OAAa,IAAHD,EAAG,SAAQA,EACrBE,EAAoB9B,EAApB8B,qBACAC,EAAoB/B,EAApB+B,qBACAC,EAAEhC,EAAFgC,GACeC,EAAUjC,EAAzB,eAIIkC,EAAeC,EAAO,MACtBC,EAAYC,EAAYpC,EAAKiC,GAE7BI,EAAWC,EAAYnC,EAAQ,CAACA,IAEhCoC,EAAQC,EAAgClB,EAAwBE,GAEtE,OACEiB,EAACC,cAAAC,EACC,CAAA3C,IAAKmC,EACLlC,UAAW2C,EAAGC,EAAOC,YAAaD,EAAOE,yBAA0B9C,GACnE+C,eAAe,sBACfC,gBAAgB,aAChBC,MAAO,CAAEX,MAAAA,GACE,YAAAY,EAAgBC,cAE3BX,EAAAC,cAACW,EACC,CAAAC,cAAejB,EACf/B,MAAOA,EACPC,YAAaA,EACbK,uCAAwCF,GAAsBE,EAC9DH,WAAYA,EACZC,mBAAoBA,EACpBC,sBAAuBA,EACvBG,YAAaA,EACbK,WAAYA,EACZF,gBAAiBA,EACjBG,cAAeA,EACfE,UAAWA,EACXE,qBAAsBA,EACtBE,aAAcA,EACdE,WAAYA,EACZC,qBAAsBA,EACtBC,qBAAsBA,EACtBC,GAAIA,EAAE,cACOC,GAAcuB,EAAUC,EAAuBJ,aAAcrB,KAIlF,IAUoF,CACpF0B,MAAOC,EACPC,YAAaC,EACbC,WAAYH,EACZI,YAAaC"}
@@ -1,2 +1,2 @@
1
- import e,{forwardRef as o}from"react";import t from"../../../../hooks/useGridKeyboardNavigation/useGridKeyboardNavigation.js";import r from"../../../Button/Button.js";import{NOOP as n}from"../../../../utils/function-utils.js";import i from"./ColorPickerClearButton.module.scss.js";var a=o((function(o,a){var s=o.text,l=o.Icon,m=t({ref:a,itemsCount:1,numberOfItemsInLine:1,onItemClicked:o.onClick,getItemByIndex:n}).onSelectionAction;return e.createElement(r,{ref:a,size:"small",kind:"tertiary",onClick:function(){return m(-1)},blurOnMouseUp:!1,className:i.clearColorButton},e.createElement(l,{size:"16",className:i.clearColorIcon}),s||"Clear")}));export{a as default};
1
+ import t,{forwardRef as e}from"react";import o from"../../../../hooks/useGridKeyboardNavigation/useGridKeyboardNavigation.js";import{NOOP as r}from"../../../../utils/function-utils.js";import n from"./ColorPickerClearButton.module.scss.js";import i from"../../../../../components/button/dist/Button/Button.js";var s=e((function(e,s){var a=e.text,l=e.Icon,m=o({ref:s,itemsCount:1,numberOfItemsInLine:1,onItemClicked:e.onClick,getItemByIndex:r}).onSelectionAction;return t.createElement(i,{ref:s,size:"small",kind:"tertiary",onClick:function(){return m(-1)},blurOnMouseUp:!1,className:n.clearColorButton},t.createElement(l,{size:"16",className:n.clearColorIcon}),a||"Clear")}));export{s as default};
2
2
  //# sourceMappingURL=ColorPickerClearButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPickerClearButton.js","sources":["../../../../../../src/components/ColorPicker/components/ColorPickerContent/ColorPickerClearButton.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport useGridKeyboardNavigation from \"../../../../hooks/useGridKeyboardNavigation/useGridKeyboardNavigation\";\nimport Button from \"../../../Button/Button\";\nimport { type VibeComponentProps, type SubIcon } from \"../../../../types\";\nimport { NOOP } from \"../../../../utils/function-utils\";\nimport styles from \"./ColorPickerClearButton.module.scss\";\n\nexport interface ColorPickerClearButtonProps extends VibeComponentProps {\n /**\n * Callback fired when the clear button is clicked.\n */\n onClick: () => void;\n /**\n * The text displayed inside the button.\n */\n text?: string;\n /**\n * The icon displayed inside the button.\n */\n Icon: SubIcon;\n}\n\nconst ColorPickerClearButton = forwardRef(\n ({ onClick, text, Icon }: ColorPickerClearButtonProps, ref: React.ForwardedRef<HTMLElement>) => {\n const { onSelectionAction } = useGridKeyboardNavigation({\n ref: ref as React.MutableRefObject<HTMLElement>,\n itemsCount: 1,\n numberOfItemsInLine: 1,\n onItemClicked: onClick,\n getItemByIndex: NOOP //hack - we don't really have a grid, it's just for keyboard navigation outside the clear button\n });\n\n return (\n <Button\n ref={ref}\n size=\"small\"\n kind=\"tertiary\"\n onClick={() => onSelectionAction(-1)} //hack - we don't really have a grid, it's just for keyboard navigation outside the clear button\n blurOnMouseUp={false}\n className={styles.clearColorButton}\n >\n <Icon size=\"16\" className={styles.clearColorIcon} />\n {text || \"Clear\"}\n </Button>\n );\n }\n);\n\nexport default ColorPickerClearButton;\n"],"names":["ColorPickerClearButton","forwardRef","_ref","ref","text","Icon","onSelectionAction","useGridKeyboardNavigation","itemsCount","numberOfItemsInLine","onItemClicked","onClick","getItemByIndex","NOOP","React","createElement","Button","size","kind","blurOnMouseUp","className","styles","clearColorButton","clearColorIcon"],"mappings":"yRAsBMA,IAAAA,EAAyBC,GAC7B,SAAAC,EAAuDC,GAAwC,IAAnFC,EAAIF,EAAJE,KAAMC,EAAIH,EAAJG,KACRC,EAAsBC,EAA0B,CACtDJ,IAAKA,EACLK,WAAY,EACZC,oBAAqB,EACrBC,cALMR,EAAPS,QAMCC,eAAgBC,IALVP,kBAQR,OACEQ,EAAAC,cAACC,EAAM,CACLb,IAAKA,EACLc,KAAK,QACLC,KAAK,WACLP,QAAS,WAAA,OAAML,GAAmB,EAAE,EACpCa,eAAe,EACfC,UAAWC,EAAOC,kBAElBR,EAACC,cAAAV,EAAK,CAAAY,KAAK,KAAKG,UAAWC,EAAOE,iBACjCnB,GAAQ,QAGf"}
1
+ {"version":3,"file":"ColorPickerClearButton.js","sources":["../../../../../../src/components/ColorPicker/components/ColorPickerContent/ColorPickerClearButton.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport useGridKeyboardNavigation from \"../../../../hooks/useGridKeyboardNavigation/useGridKeyboardNavigation\";\nimport { Button } from \"@vibe/button\";\nimport { type VibeComponentProps } from \"../../../../types\";\nimport { type SubIcon } from \"@vibe/icon\";\nimport { NOOP } from \"../../../../utils/function-utils\";\nimport styles from \"./ColorPickerClearButton.module.scss\";\n\nexport interface ColorPickerClearButtonProps extends VibeComponentProps {\n /**\n * Callback fired when the clear button is clicked.\n */\n onClick: () => void;\n /**\n * The text displayed inside the button.\n */\n text?: string;\n /**\n * The icon displayed inside the button.\n */\n Icon: SubIcon;\n}\n\nconst ColorPickerClearButton = forwardRef(\n ({ onClick, text, Icon }: ColorPickerClearButtonProps, ref: React.ForwardedRef<HTMLElement>) => {\n const { onSelectionAction } = useGridKeyboardNavigation({\n ref: ref as React.MutableRefObject<HTMLElement>,\n itemsCount: 1,\n numberOfItemsInLine: 1,\n onItemClicked: onClick,\n getItemByIndex: NOOP //hack - we don't really have a grid, it's just for keyboard navigation outside the clear button\n });\n\n return (\n <Button\n ref={ref}\n size=\"small\"\n kind=\"tertiary\"\n onClick={() => onSelectionAction(-1)} //hack - we don't really have a grid, it's just for keyboard navigation outside the clear button\n blurOnMouseUp={false}\n className={styles.clearColorButton}\n >\n <Icon size=\"16\" className={styles.clearColorIcon} />\n {text || \"Clear\"}\n </Button>\n );\n }\n);\n\nexport default ColorPickerClearButton;\n"],"names":["ColorPickerClearButton","forwardRef","_ref","ref","text","Icon","onSelectionAction","useGridKeyboardNavigation","itemsCount","numberOfItemsInLine","onItemClicked","onClick","getItemByIndex","NOOP","React","createElement","Button","size","kind","blurOnMouseUp","className","styles","clearColorButton","clearColorIcon"],"mappings":"sTAuBMA,IAAAA,EAAyBC,GAC7B,SAAAC,EAAuDC,GAAwC,IAAnFC,EAAIF,EAAJE,KAAMC,EAAIH,EAAJG,KACRC,EAAsBC,EAA0B,CACtDJ,IAAKA,EACLK,WAAY,EACZC,oBAAqB,EACrBC,cALMR,EAAPS,QAMCC,eAAgBC,IALVP,kBAQR,OACEQ,EAAAC,cAACC,EAAM,CACLb,IAAKA,EACLc,KAAK,QACLC,KAAK,WACLP,QAAS,WAAA,OAAML,GAAmB,EAAE,EACpCa,eAAe,EACfC,UAAWC,EAAOC,kBAElBR,EAACC,cAAAV,EAAK,CAAAY,KAAK,KAAKG,UAAWC,EAAOE,iBACjCnB,GAAQ,QAGf"}
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPickerColorsGrid.js","sources":["../../../../../../src/components/ColorPicker/components/ColorPickerContent/ColorPickerColorsGrid.tsx"],"sourcesContent":["import React, { forwardRef, useCallback } from \"react\";\nimport useGridKeyboardNavigation from \"../../../../hooks/useGridKeyboardNavigation/useGridKeyboardNavigation\";\nimport ColorPickerItemComponent from \"../ColorPickerItemComponent/ColorPickerItemComponent\";\nimport { type CONTENT_COLORS_VALUES } from \"../../../../utils/colors-vars-map\";\nimport { type ColorPickerArrayValueOnly, type ColorPickerValueOnly } from \"../../ColorPicker.types\";\nimport { type ColorShapes, type ColorPickerSizes } from \"../../ColorPicker.types\";\nimport { type SubIcon, type VibeComponentProps } from \"../../../../types\";\nimport styles from \"./ColorPickerColorsGrid.module.scss\";\nimport { type ColorStyle } from \"../../../../types\";\n\nconst formatColorNameForTooltip = (color: ColorPickerValueOnly) => {\n return color.replace(/-|_/g, \" \").replace(/(?:^|\\s)\\S/g, function (a) {\n return a.toUpperCase();\n });\n};\n\nconst calculateColorTooltip = (\n color: ColorPickerValueOnly,\n tooltipContentByColor?: Partial<Record<CONTENT_COLORS_VALUES, string> & Record<string, string>>\n) => {\n if (tooltipContentByColor && tooltipContentByColor[color]) {\n return tooltipContentByColor[color];\n } else {\n return formatColorNameForTooltip(color);\n }\n};\n\nexport interface ColorPickerColorsGridProps extends VibeComponentProps {\n /**\n * Callback fired when a color is clicked.\n */\n onColorClicked?: (color: ColorPickerValueOnly) => void;\n /**\n * The list of colors to be displayed.\n */\n colorsToRender?: ColorPickerArrayValueOnly;\n /**\n * Icon displayed as an indicator inside the color.\n */\n ColorIndicatorIcon?: SubIcon;\n /**\n * Icon displayed when a color is selected.\n */\n SelectedIndicatorIcon?: SubIcon;\n /**\n * The style applied to the colors.\n */\n colorStyle?: ColorStyle;\n /**\n * The currently selected color or colors.\n */\n value?: string | string[];\n /**\n * If true, renders the color indicator without a background.\n */\n shouldRenderIndicatorWithoutBackground?: boolean;\n /**\n * The size of the color items.\n */\n colorSize?: ColorPickerSizes;\n /**\n * The number of colors per row.\n */\n numberOfColorsInLine?: number;\n /**\n * Custom tooltip content for specific colors.\n */\n tooltipContentByColor?: Partial<Record<CONTENT_COLORS_VALUES, string> & Record<string, string>>;\n /**\n * If true, the first color is focused when the component mounts.\n */\n focusOnMount?: boolean;\n /**\n * The shape of the color items.\n */\n colorShape?: ColorShapes;\n /**\n * If true, displays a tooltip with the color name.\n */\n showColorNameTooltip?: boolean;\n}\n\nconst ColorPickerColorsGrid = forwardRef(\n (\n {\n onColorClicked,\n colorsToRender,\n numberOfColorsInLine,\n focusOnMount,\n value,\n colorStyle,\n ColorIndicatorIcon,\n shouldRenderIndicatorWithoutBackground,\n SelectedIndicatorIcon,\n colorSize,\n tooltipContentByColor,\n colorShape,\n showColorNameTooltip: showColorNameTooltip,\n id,\n \"data-testid\": dataTestId\n }: ColorPickerColorsGridProps,\n ref: React.ForwardedRef<HTMLUListElement>\n ) => {\n const getItemByIndex = useCallback((index: number) => colorsToRender[index], [colorsToRender]);\n\n const { activeIndex, onSelectionAction } = useGridKeyboardNavigation({\n focusOnMount,\n ref: ref as React.MutableRefObject<HTMLUListElement>,\n onItemClicked: onColorClicked,\n itemsCount: colorsToRender.length,\n numberOfItemsInLine: numberOfColorsInLine,\n entryFocusStrategy: \"first\",\n getItemByIndex\n });\n\n return (\n <ul className={styles.colorsGrid} ref={ref} tabIndex={0} id={id} data-testid={dataTestId} role=\"grid\">\n {colorsToRender.map((color, index) => {\n return (\n <ColorPickerItemComponent\n key={color}\n color={color}\n onColorClicked={() => onSelectionAction(index)}\n shouldRenderIndicatorWithoutBackground={ColorIndicatorIcon && shouldRenderIndicatorWithoutBackground}\n colorStyle={colorStyle}\n ColorIndicatorIcon={ColorIndicatorIcon}\n SelectedIndicatorIcon={SelectedIndicatorIcon}\n isSelected={Array.isArray(value) ? value.includes(color) : value === color}\n isActive={index === activeIndex}\n colorSize={colorSize}\n tooltipContent={showColorNameTooltip ? calculateColorTooltip(color, tooltipContentByColor) : undefined}\n colorShape={colorShape}\n />\n );\n })}\n </ul>\n );\n }\n);\n\nexport default ColorPickerColorsGrid;\n"],"names":["calculateColorTooltip","color","tooltipContentByColor","replace","a","toUpperCase","formatColorNameForTooltip","ColorPickerColorsGrid","forwardRef","_ref","ref","onColorClicked","colorsToRender","numberOfColorsInLine","focusOnMount","value","colorStyle","ColorIndicatorIcon","shouldRenderIndicatorWithoutBackground","SelectedIndicatorIcon","colorSize","colorShape","showColorNameTooltip","id","dataTestId","getItemByIndex","useCallback","index","_useGridKeyboardNavig","useGridKeyboardNavigation","onItemClicked","itemsCount","length","numberOfItemsInLine","entryFocusStrategy","activeIndex","onSelectionAction","React","createElement","className","styles","colorsGrid","tabIndex","role","map","ColorPickerItemComponent","key","isSelected","Array","isArray","includes","isActive","tooltipContent","undefined"],"mappings":"4QAUA,IAMMA,EAAwB,SAC5BC,EACAC,GAEA,OAAIA,GAAyBA,EAAsBD,GAC1CC,EAAsBD,GAXC,SAACA,GACjC,OAAOA,EAAME,QAAQ,OAAQ,KAAKA,QAAQ,eAAe,SAAUC,GACjE,OAAOA,EAAEC,aACX,GACF,CASWC,CAA0BL,EAErC,EAyDMM,EAAwBC,GAC5B,SAAAC,EAkBEC,GACE,IAjBAC,EAAcF,EAAdE,eACAC,EAAcH,EAAdG,eACAC,EAAoBJ,EAApBI,qBACAC,EAAYL,EAAZK,aACAC,EAAKN,EAALM,MACAC,EAAUP,EAAVO,WACAC,EAAkBR,EAAlBQ,mBACAC,EAAsCT,EAAtCS,uCACAC,EAAqBV,EAArBU,sBACAC,EAASX,EAATW,UACAlB,EAAqBO,EAArBP,sBACAmB,EAAUZ,EAAVY,WACsBC,EAAoBb,EAA1Ca,qBACAC,EAAEd,EAAFc,GACeC,EAAUf,EAAzB,eAIIgB,EAAiBC,GAAY,SAACC,GAAa,OAAKf,EAAee,KAAQ,CAACf,IAE9EgB,EAA2CC,EAA0B,CACnEf,aAAAA,EACAJ,IAAKA,EACLoB,cAAenB,EACfoB,WAAYnB,EAAeoB,OAC3BC,oBAAqBpB,EACrBqB,mBAAoB,QACpBT,eAAAA,IAPMU,EAAWP,EAAXO,YAAaC,EAAiBR,EAAjBQ,kBAUrB,OACEC,EAAAC,cAAA,KAAA,CAAIC,UAAWC,EAAOC,WAAY/B,IAAKA,EAAKgC,SAAU,EAAGnB,GAAIA,gBAAiBC,EAAYmB,KAAK,QAC5F/B,EAAegC,KAAI,SAAC3C,EAAO0B,GAC1B,OACEU,gBAACQ,EAAwB,CACvBC,IAAK7C,EACLA,MAAOA,EACPU,eAAgB,WAAA,OAAMyB,EAAkBT,EAAM,EAC9CT,uCAAwCD,GAAsBC,EAC9DF,WAAYA,EACZC,mBAAoBA,EACpBE,sBAAuBA,EACvB4B,WAAYC,MAAMC,QAAQlC,GAASA,EAAMmC,SAASjD,GAASc,IAAUd,EACrEkD,SAAUxB,IAAUQ,EACpBf,UAAWA,EACXgC,eAAgB9B,EAAuBtB,EAAsBC,EAAOC,QAAyBmD,EAC7FhC,WAAYA,GAGjB,IAGP"}
1
+ {"version":3,"file":"ColorPickerColorsGrid.js","sources":["../../../../../../src/components/ColorPicker/components/ColorPickerContent/ColorPickerColorsGrid.tsx"],"sourcesContent":["import React, { forwardRef, useCallback } from \"react\";\nimport useGridKeyboardNavigation from \"../../../../hooks/useGridKeyboardNavigation/useGridKeyboardNavigation\";\nimport ColorPickerItemComponent from \"../ColorPickerItemComponent/ColorPickerItemComponent\";\nimport { type CONTENT_COLORS_VALUES } from \"../../../../utils/colors-vars-map\";\nimport { type ColorPickerArrayValueOnly, type ColorPickerValueOnly } from \"../../ColorPicker.types\";\nimport { type ColorShapes, type ColorPickerSizes } from \"../../ColorPicker.types\";\nimport { type VibeComponentProps } from \"../../../../types\";\nimport { type SubIcon } from \"@vibe/icon\";\nimport styles from \"./ColorPickerColorsGrid.module.scss\";\nimport { type ColorStyle } from \"../../../../types\";\n\nconst formatColorNameForTooltip = (color: ColorPickerValueOnly) => {\n return color.replace(/-|_/g, \" \").replace(/(?:^|\\s)\\S/g, function (a) {\n return a.toUpperCase();\n });\n};\n\nconst calculateColorTooltip = (\n color: ColorPickerValueOnly,\n tooltipContentByColor?: Partial<Record<CONTENT_COLORS_VALUES, string> & Record<string, string>>\n) => {\n if (tooltipContentByColor && tooltipContentByColor[color]) {\n return tooltipContentByColor[color];\n } else {\n return formatColorNameForTooltip(color);\n }\n};\n\nexport interface ColorPickerColorsGridProps extends VibeComponentProps {\n /**\n * Callback fired when a color is clicked.\n */\n onColorClicked?: (color: ColorPickerValueOnly) => void;\n /**\n * The list of colors to be displayed.\n */\n colorsToRender?: ColorPickerArrayValueOnly;\n /**\n * Icon displayed as an indicator inside the color.\n */\n ColorIndicatorIcon?: SubIcon;\n /**\n * Icon displayed when a color is selected.\n */\n SelectedIndicatorIcon?: SubIcon;\n /**\n * The style applied to the colors.\n */\n colorStyle?: ColorStyle;\n /**\n * The currently selected color or colors.\n */\n value?: string | string[];\n /**\n * If true, renders the color indicator without a background.\n */\n shouldRenderIndicatorWithoutBackground?: boolean;\n /**\n * The size of the color items.\n */\n colorSize?: ColorPickerSizes;\n /**\n * The number of colors per row.\n */\n numberOfColorsInLine?: number;\n /**\n * Custom tooltip content for specific colors.\n */\n tooltipContentByColor?: Partial<Record<CONTENT_COLORS_VALUES, string> & Record<string, string>>;\n /**\n * If true, the first color is focused when the component mounts.\n */\n focusOnMount?: boolean;\n /**\n * The shape of the color items.\n */\n colorShape?: ColorShapes;\n /**\n * If true, displays a tooltip with the color name.\n */\n showColorNameTooltip?: boolean;\n}\n\nconst ColorPickerColorsGrid = forwardRef(\n (\n {\n onColorClicked,\n colorsToRender,\n numberOfColorsInLine,\n focusOnMount,\n value,\n colorStyle,\n ColorIndicatorIcon,\n shouldRenderIndicatorWithoutBackground,\n SelectedIndicatorIcon,\n colorSize,\n tooltipContentByColor,\n colorShape,\n showColorNameTooltip: showColorNameTooltip,\n id,\n \"data-testid\": dataTestId\n }: ColorPickerColorsGridProps,\n ref: React.ForwardedRef<HTMLUListElement>\n ) => {\n const getItemByIndex = useCallback((index: number) => colorsToRender[index], [colorsToRender]);\n\n const { activeIndex, onSelectionAction } = useGridKeyboardNavigation({\n focusOnMount,\n ref: ref as React.MutableRefObject<HTMLUListElement>,\n onItemClicked: onColorClicked,\n itemsCount: colorsToRender.length,\n numberOfItemsInLine: numberOfColorsInLine,\n entryFocusStrategy: \"first\",\n getItemByIndex\n });\n\n return (\n <ul className={styles.colorsGrid} ref={ref} tabIndex={0} id={id} data-testid={dataTestId} role=\"grid\">\n {colorsToRender.map((color, index) => {\n return (\n <ColorPickerItemComponent\n key={color}\n color={color}\n onColorClicked={() => onSelectionAction(index)}\n shouldRenderIndicatorWithoutBackground={ColorIndicatorIcon && shouldRenderIndicatorWithoutBackground}\n colorStyle={colorStyle}\n ColorIndicatorIcon={ColorIndicatorIcon}\n SelectedIndicatorIcon={SelectedIndicatorIcon}\n isSelected={Array.isArray(value) ? value.includes(color) : value === color}\n isActive={index === activeIndex}\n colorSize={colorSize}\n tooltipContent={showColorNameTooltip ? calculateColorTooltip(color, tooltipContentByColor) : undefined}\n colorShape={colorShape}\n />\n );\n })}\n </ul>\n );\n }\n);\n\nexport default ColorPickerColorsGrid;\n"],"names":["calculateColorTooltip","color","tooltipContentByColor","replace","a","toUpperCase","formatColorNameForTooltip","ColorPickerColorsGrid","forwardRef","_ref","ref","onColorClicked","colorsToRender","numberOfColorsInLine","focusOnMount","value","colorStyle","ColorIndicatorIcon","shouldRenderIndicatorWithoutBackground","SelectedIndicatorIcon","colorSize","colorShape","showColorNameTooltip","id","dataTestId","getItemByIndex","useCallback","index","_useGridKeyboardNavig","useGridKeyboardNavigation","onItemClicked","itemsCount","length","numberOfItemsInLine","entryFocusStrategy","activeIndex","onSelectionAction","React","createElement","className","styles","colorsGrid","tabIndex","role","map","ColorPickerItemComponent","key","isSelected","Array","isArray","includes","isActive","tooltipContent","undefined"],"mappings":"4QAWA,IAMMA,EAAwB,SAC5BC,EACAC,GAEA,OAAIA,GAAyBA,EAAsBD,GAC1CC,EAAsBD,GAXC,SAACA,GACjC,OAAOA,EAAME,QAAQ,OAAQ,KAAKA,QAAQ,eAAe,SAAUC,GACjE,OAAOA,EAAEC,aACX,GACF,CASWC,CAA0BL,EAErC,EAyDMM,EAAwBC,GAC5B,SAAAC,EAkBEC,GACE,IAjBAC,EAAcF,EAAdE,eACAC,EAAcH,EAAdG,eACAC,EAAoBJ,EAApBI,qBACAC,EAAYL,EAAZK,aACAC,EAAKN,EAALM,MACAC,EAAUP,EAAVO,WACAC,EAAkBR,EAAlBQ,mBACAC,EAAsCT,EAAtCS,uCACAC,EAAqBV,EAArBU,sBACAC,EAASX,EAATW,UACAlB,EAAqBO,EAArBP,sBACAmB,EAAUZ,EAAVY,WACsBC,EAAoBb,EAA1Ca,qBACAC,EAAEd,EAAFc,GACeC,EAAUf,EAAzB,eAIIgB,EAAiBC,GAAY,SAACC,GAAa,OAAKf,EAAee,KAAQ,CAACf,IAE9EgB,EAA2CC,EAA0B,CACnEf,aAAAA,EACAJ,IAAKA,EACLoB,cAAenB,EACfoB,WAAYnB,EAAeoB,OAC3BC,oBAAqBpB,EACrBqB,mBAAoB,QACpBT,eAAAA,IAPMU,EAAWP,EAAXO,YAAaC,EAAiBR,EAAjBQ,kBAUrB,OACEC,EAAAC,cAAA,KAAA,CAAIC,UAAWC,EAAOC,WAAY/B,IAAKA,EAAKgC,SAAU,EAAGnB,GAAIA,gBAAiBC,EAAYmB,KAAK,QAC5F/B,EAAegC,KAAI,SAAC3C,EAAO0B,GAC1B,OACEU,gBAACQ,EAAwB,CACvBC,IAAK7C,EACLA,MAAOA,EACPU,eAAgB,WAAA,OAAMyB,EAAkBT,EAAM,EAC9CT,uCAAwCD,GAAsBC,EAC9DF,WAAYA,EACZC,mBAAoBA,EACpBE,sBAAuBA,EACvB4B,WAAYC,MAAMC,QAAQlC,GAASA,EAAMmC,SAASjD,GAASc,IAAUd,EACrEkD,SAAUxB,IAAUQ,EACpBf,UAAWA,EACXgC,eAAgB9B,EAAuBtB,EAAsBC,EAAOC,QAAyBmD,EAC7FhC,WAAYA,GAGjB,IAGP"}
@@ -1,2 +1,2 @@
1
- import{toConsumableArray as o}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import{difference as r,intersection as e}from"es-toolkit";import t,{forwardRef as i,useRef as l,useCallback as n,useMemo as s}from"react";import{BaseSizes as a}from"../../../../constants/sizes.js";import{ColorStyle as c,contentColors as d}from"../../../../utils/colors-vars-map.js";import{ColorShapes as m,DEFAULT_NUMBER_OF_COLORS_IN_LINE as u}from"../../ColorPickerConstants.js";import{calculateColorPickerWidth as f}from"../../services/ColorPickerStyleService.js";import{useGridKeyboardNavigationContext as p,GridKeyboardNavigationContext as C}from"../../../GridKeyboardNavigationContext/GridKeyboardNavigationContext.js";import v from"./ColorPickerClearButton.js";import I from"./ColorPickerColorsGrid.js";import{withStaticProps as h}from"../../../../types/withStaticProps.js";import S from"../../../../hooks/useMergeRef.js";import j from"../../../../../icons/dist/react/NoColor.js";var k=h(i((function(i,c){var m=i.className,h=i.onValueChange,k=i.value,y=i.noColorText,b=i.colorStyle,g=void 0===b?"regular":b,N=i.ColorIndicatorIcon,x=i.SelectedIndicatorIcon,B=i.shouldRenderIndicatorWithoutBackground,E=i.NoColorIcon,M=void 0===E?j:E,P=i.isBlackListMode,w=void 0===P||P,z=i.colorsList,L=i.isMultiselect,O=i.colorSize,R=void 0===O?a.MEDIUM:O,T=i.numberOfColorsInLine,G=void 0===T?u:T,K=i.tooltipContentByColor,U=void 0===K?{}:K,W=i.focusOnMount,_=i.colorShape,q=void 0===_?"square":_,A=i.forceUseRawColorList,D=i.showColorNameTooltip,H=i.id,V=i["data-testid"],F=l(null),J=S(c,F),Q=l(null),X=l(null),Y=n((function(){h(null)}),[h]),Z=s((function(){return A?z:w?r(d,z):e(d,z)}),[A,w,z]),$=n((function(r){if(L){var e=o(k);if(e.includes(r)){var t=e.indexOf(r);t>-1&&e.splice(t,1)}else e.push(r);h(e)}else h([r])}),[L,h,k]),oo=s((function(){return[{topElement:Q,bottomElement:X}]}),[]),ro=p(oo,F),eo=f(R,G);return t.createElement("div",{className:m,style:{width:eo},ref:J,tabIndex:-1},t.createElement(C.Provider,{value:ro},t.createElement(I,{ref:Q,onColorClicked:$,colorsToRender:Z,numberOfColorsInLine:G,focusOnMount:W,value:k,colorStyle:g,ColorIndicatorIcon:N,shouldRenderIndicatorWithoutBackground:B,SelectedIndicatorIcon:x,colorSize:R,tooltipContentByColor:U,colorShape:q,showColorNameTooltip:D,id:H,"data-testid":V}),y&&t.createElement(v,{Icon:M,onClick:Y,text:y,ref:X})))})),{sizes:a,colorStyles:c,colorSizes:a,colorShapes:m});export{k as default};
1
+ import{toConsumableArray as o}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import{difference as e,intersection as r}from"es-toolkit";import t,{forwardRef as i,useRef as l,useCallback as n,useMemo as s}from"react";import{BaseSizes as a}from"../../../../constants/sizes.js";import{ColorStyle as c,contentColors as d}from"../../../../utils/colors-vars-map.js";import{ColorShapes as m,DEFAULT_NUMBER_OF_COLORS_IN_LINE as u}from"../../ColorPickerConstants.js";import{calculateColorPickerWidth as f}from"../../services/ColorPickerStyleService.js";import{useGridKeyboardNavigationContext as p,GridKeyboardNavigationContext as C}from"../../../GridKeyboardNavigationContext/GridKeyboardNavigationContext.js";import v from"./ColorPickerClearButton.js";import I from"./ColorPickerColorsGrid.js";import{withStaticProps as h}from"../../../../types/withStaticProps.js";import S from"../../../../hooks/useMergeRef.js";import k from"../../../../../packages/icons/dist/react/NoColor.js";var j=h(i((function(i,c){var m=i.className,h=i.onValueChange,j=i.value,y=i.noColorText,g=i.colorStyle,b=void 0===g?"regular":g,N=i.ColorIndicatorIcon,x=i.SelectedIndicatorIcon,B=i.shouldRenderIndicatorWithoutBackground,E=i.NoColorIcon,M=void 0===E?k:E,P=i.isBlackListMode,w=void 0===P||P,z=i.colorsList,L=i.isMultiselect,O=i.colorSize,R=void 0===O?a.MEDIUM:O,T=i.numberOfColorsInLine,G=void 0===T?u:T,K=i.tooltipContentByColor,U=void 0===K?{}:K,W=i.focusOnMount,_=i.colorShape,q=void 0===_?"square":_,A=i.forceUseRawColorList,D=i.showColorNameTooltip,H=i.id,V=i["data-testid"],F=l(null),J=S(c,F),Q=l(null),X=l(null),Y=n((function(){h(null)}),[h]),Z=s((function(){return A?z:w?e(d,z):r(d,z)}),[A,w,z]),$=n((function(e){if(L){var r=o(j);if(r.includes(e)){var t=r.indexOf(e);t>-1&&r.splice(t,1)}else r.push(e);h(r)}else h([e])}),[L,h,j]),oo=s((function(){return[{topElement:Q,bottomElement:X}]}),[]),eo=p(oo,F),ro=f(R,G);return t.createElement("div",{className:m,style:{width:ro},ref:J,tabIndex:-1},t.createElement(C.Provider,{value:eo},t.createElement(I,{ref:Q,onColorClicked:$,colorsToRender:Z,numberOfColorsInLine:G,focusOnMount:W,value:j,colorStyle:b,ColorIndicatorIcon:N,shouldRenderIndicatorWithoutBackground:B,SelectedIndicatorIcon:x,colorSize:R,tooltipContentByColor:U,colorShape:q,showColorNameTooltip:D,id:H,"data-testid":V}),y&&t.createElement(v,{Icon:M,onClick:Y,text:y,ref:X})))})),{sizes:a,colorStyles:c,colorSizes:a,colorShapes:m});export{j as default};
2
2
  //# sourceMappingURL=ColorPickerContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPickerContent.js","sources":["../../../../../../src/components/ColorPicker/components/ColorPickerContent/ColorPickerContent.tsx"],"sourcesContent":["import { difference as _difference, intersection as _intersection } from \"es-toolkit\";\nimport React, { forwardRef, useCallback, useMemo, useRef } from \"react\";\nimport { BaseSizes } from \"../../../../constants\";\nimport {\n ColorStyle as ColorStyleEnum,\n type CONTENT_COLORS_VALUES,\n contentColors\n} from \"../../../../utils/colors-vars-map\";\nimport { NoColor } from \"@vibe/icons\";\nimport { ColorShapes as ColorShapesEnum, DEFAULT_NUMBER_OF_COLORS_IN_LINE } from \"../../ColorPickerConstants\";\nimport {\n type ColorShapes,\n type ColorPickerSizes,\n type ColorPickerValue,\n type ColorPickerArrayValueOnly\n} from \"../../ColorPicker.types\";\nimport { calculateColorPickerWidth } from \"../../services/ColorPickerStyleService\";\nimport {\n GridKeyboardNavigationContext,\n useGridKeyboardNavigationContext\n} from \"../../../GridKeyboardNavigationContext\";\nimport ColorPickerClearButton from \"./ColorPickerClearButton\";\nimport ColorPickerColorsGrid from \"./ColorPickerColorsGrid\";\nimport { type VibeComponentProps, type SubIcon, withStaticProps } from \"../../../../types\";\nimport useMergeRef from \"../../../../hooks/useMergeRef\";\nimport { type ColorStyle } from \"../../../../types\";\n\nexport interface ColorPickerContentProps extends VibeComponentProps {\n /**\n * The selected color(s).\n */\n value: ColorPickerValue;\n /**\n * Callback fired when the selected color(s) change.\n */\n onValueChange: (value: ColorPickerArrayValueOnly) => void;\n /**\n * The list of colors available for selection.\n */\n colorsList: ColorPickerArrayValueOnly;\n /**\n * Icon displayed as an indicator inside the color.\n */\n ColorIndicatorIcon?: SubIcon;\n /**\n * Icon displayed when a color is selected.\n */\n SelectedIndicatorIcon?: SubIcon;\n /**\n * Icon used for clearing the color selection.\n */\n NoColorIcon?: SubIcon;\n /**\n * The style applied to the colors.\n */\n colorStyle?: ColorStyle;\n /**\n * The size of the color items.\n */\n colorSize?: ColorPickerSizes;\n /**\n * The shape of the color items.\n */\n colorShape?: ColorShapes;\n /**\n * Custom tooltip content for specific colors.\n */\n tooltipContentByColor?: Partial<Record<CONTENT_COLORS_VALUES, string>>;\n /**\n * Text displayed for the \"no color\" option.\n */\n noColorText?: string;\n /**\n * If true, renders the color indicator without a background.\n */\n shouldRenderIndicatorWithoutBackground?: boolean;\n /**\n * If true, treats the color list as a blacklist rather than a whitelist.\n */\n isBlackListMode?: boolean;\n /**\n * The number of colors displayed per row.\n */\n numberOfColorsInLine?: number;\n /**\n * If true, the first color is focused when the component mounts.\n */\n focusOnMount?: boolean;\n /**\n * If true, allows selecting multiple colors.\n */\n isMultiselect?: boolean;\n /**\n * Used to force the component render the colorList prop as is. Usually, this flag should not be used. It's intended only for edge cases.\n * Usually, only \"monday colors\" will be rendered (unless blacklist mode is used). This flag will override this behavior.\n */\n forceUseRawColorList?: boolean;\n /**\n * Used to enable color name tooltip on each color in the component.\n * When \"tooltipContentByColor\" is supplied, it will override the color name tooltip.\n */\n showColorNameTooltip?: boolean;\n}\n\nconst ColorPickerContent = forwardRef(\n (\n {\n className,\n onValueChange,\n value,\n noColorText,\n colorStyle = \"regular\",\n ColorIndicatorIcon,\n SelectedIndicatorIcon,\n shouldRenderIndicatorWithoutBackground,\n NoColorIcon = NoColor,\n isBlackListMode = true,\n colorsList,\n isMultiselect,\n colorSize = BaseSizes.MEDIUM,\n numberOfColorsInLine = DEFAULT_NUMBER_OF_COLORS_IN_LINE,\n tooltipContentByColor = {},\n focusOnMount,\n colorShape = \"square\",\n forceUseRawColorList,\n showColorNameTooltip,\n id,\n \"data-testid\": dataTestId\n }: ColorPickerContentProps,\n ref: React.ForwardedRef<HTMLDivElement>\n ) => {\n const gridRef = useRef(null);\n const mergedRef = useMergeRef(ref, gridRef);\n const colorsRef = useRef(null);\n const buttonRef = useRef(null);\n\n const onClearButton = useCallback(() => {\n onValueChange(null);\n }, [onValueChange]);\n\n const colorsToRender = useMemo(() => {\n if (forceUseRawColorList) {\n return colorsList;\n }\n return isBlackListMode ? _difference(contentColors, colorsList) : _intersection(contentColors, colorsList);\n }, [forceUseRawColorList, isBlackListMode, colorsList]);\n\n const onColorClicked = useCallback(\n (color: CONTENT_COLORS_VALUES) => {\n if (!isMultiselect) {\n onValueChange([color]);\n return;\n }\n const colors = [...value];\n if (colors.includes(color)) {\n const indexInSelected = colors.indexOf(color);\n if (indexInSelected > -1) {\n colors.splice(indexInSelected, 1);\n }\n } else {\n colors.push(color);\n }\n onValueChange(colors);\n },\n [isMultiselect, onValueChange, value]\n );\n\n const positions = useMemo(() => [{ topElement: colorsRef, bottomElement: buttonRef }], []);\n const keyboardContext = useGridKeyboardNavigationContext(positions, gridRef);\n const width = calculateColorPickerWidth(colorSize as BaseSizes, numberOfColorsInLine);\n\n return (\n <div className={className} style={{ width }} ref={mergedRef} tabIndex={-1}>\n <GridKeyboardNavigationContext.Provider value={keyboardContext}>\n <ColorPickerColorsGrid\n ref={colorsRef}\n onColorClicked={onColorClicked}\n colorsToRender={colorsToRender}\n numberOfColorsInLine={numberOfColorsInLine}\n focusOnMount={focusOnMount}\n value={value}\n colorStyle={colorStyle}\n ColorIndicatorIcon={ColorIndicatorIcon}\n shouldRenderIndicatorWithoutBackground={shouldRenderIndicatorWithoutBackground}\n SelectedIndicatorIcon={SelectedIndicatorIcon}\n colorSize={colorSize}\n tooltipContentByColor={tooltipContentByColor}\n colorShape={colorShape}\n showColorNameTooltip={showColorNameTooltip}\n id={id}\n data-testid={dataTestId}\n />\n {noColorText && (\n <ColorPickerClearButton Icon={NoColorIcon} onClick={onClearButton} text={noColorText} ref={buttonRef} />\n )}\n </GridKeyboardNavigationContext.Provider>\n </div>\n );\n }\n);\n\ninterface ColorPickerContentStaticProps {\n sizes: typeof BaseSizes;\n colorStyles: typeof ColorStyleEnum;\n colorSizes: typeof BaseSizes;\n colorShapes: typeof ColorShapesEnum;\n}\n\nexport default withStaticProps<ColorPickerContentProps, ColorPickerContentStaticProps>(ColorPickerContent, {\n sizes: BaseSizes,\n colorStyles: ColorStyleEnum,\n colorSizes: BaseSizes,\n colorShapes: ColorShapesEnum\n});\n"],"names":["withStaticProps","forwardRef","_ref","ref","className","onValueChange","value","noColorText","_ref$colorStyle","colorStyle","ColorIndicatorIcon","SelectedIndicatorIcon","shouldRenderIndicatorWithoutBackground","_ref$NoColorIcon","NoColorIcon","NoColor","_ref$isBlackListMode","isBlackListMode","colorsList","isMultiselect","_ref$colorSize","colorSize","BaseSizes","MEDIUM","_ref$numberOfColorsIn","numberOfColorsInLine","DEFAULT_NUMBER_OF_COLORS_IN_LINE","_ref$tooltipContentBy","tooltipContentByColor","focusOnMount","_ref$colorShape","colorShape","forceUseRawColorList","showColorNameTooltip","id","dataTestId","gridRef","useRef","mergedRef","useMergeRef","colorsRef","buttonRef","onClearButton","useCallback","colorsToRender","useMemo","_difference","contentColors","_intersection","onColorClicked","color","colors","_toConsumableArray","includes","indexInSelected","indexOf","splice","push","positions","topElement","bottomElement","keyboardContext","useGridKeyboardNavigationContext","width","calculateColorPickerWidth","React","createElement","style","tabIndex","GridKeyboardNavigationContext","Provider","ColorPickerColorsGrid","ColorPickerClearButton","Icon","onClick","text","sizes","colorStyles","ColorStyleEnum","colorSizes","colorShapes","ColorShapesEnum"],"mappings":"+8BAwGA,IAwGeA,EAAAA,EAxGYC,GACzB,SAAAC,EAwBEC,GACE,IAvBAC,EAASF,EAATE,UAC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C,EAAc8C,EAVb,MAFC9C,EAAc,CAAC6C,GAalB,GACD,CAAC/B,EAAed,EAAeC,IAG3BoD,GAAYb,GAAQ,WAAA,MAAM,CAAC,CAAEc,WAAYnB,EAAWoB,cAAenB,GAAY,GAAE,IACjFoB,GAAkBC,EAAiCJ,GAAWtB,GAC9D2B,GAAQC,EAA0B3C,EAAwBI,GAEhE,OACEwC,EAAKC,cAAA,MAAA,CAAA9D,UAAWA,EAAW+D,MAAO,CAAEJ,MAAAA,IAAS5D,IAAKmC,EAAW8B,UAAW,GACtEH,EAAAC,cAACG,EAA8BC,SAAS,CAAAhE,MAAOuD,IAC7CI,EAAAC,cAACK,EAAqB,CACpBpE,IAAKqC,EACLS,eAAgBA,EAChBL,eAAgBA,EAChBnB,qBAAsBA,EACtBI,aAAcA,EACdvB,MAAOA,EACPG,WAAYA,EACZC,mBAAoBA,EACpBE,uCAAwCA,EACxCD,sBAAuBA,EACvBU,UAAWA,EACXO,sBAAuBA,EACvBG,WAAYA,EACZE,qBAAsBA,EACtBC,GAAIA,EAAE,cACOC,IAEd5B,GACC0D,EAAAC,cAACM,EAAsB,CAACC,KAAM3D,EAAa4D,QAAShC,EAAeiC,KAAMpE,EAAaJ,IAAKsC,KAKrG,IAUyG,CACzGmC,MAAOtD,EACPuD,YAAaC,EACbC,WAAYzD,EACZ0D,YAAaC"}
1
+ {"version":3,"file":"ColorPickerContent.js","sources":["../../../../../../src/components/ColorPicker/components/ColorPickerContent/ColorPickerContent.tsx"],"sourcesContent":["import { difference as _difference, intersection as _intersection } from \"es-toolkit\";\nimport React, { forwardRef, useCallback, useMemo, useRef } from \"react\";\nimport { BaseSizes } from \"../../../../constants\";\nimport {\n ColorStyle as ColorStyleEnum,\n type CONTENT_COLORS_VALUES,\n contentColors\n} from \"../../../../utils/colors-vars-map\";\nimport { NoColor } from \"@vibe/icons\";\nimport { ColorShapes as ColorShapesEnum, DEFAULT_NUMBER_OF_COLORS_IN_LINE } from \"../../ColorPickerConstants\";\nimport {\n type ColorShapes,\n type ColorPickerSizes,\n type ColorPickerValue,\n type ColorPickerArrayValueOnly\n} from \"../../ColorPicker.types\";\nimport { calculateColorPickerWidth } from \"../../services/ColorPickerStyleService\";\nimport {\n GridKeyboardNavigationContext,\n useGridKeyboardNavigationContext\n} from \"../../../GridKeyboardNavigationContext\";\nimport ColorPickerClearButton from \"./ColorPickerClearButton\";\nimport ColorPickerColorsGrid from \"./ColorPickerColorsGrid\";\nimport { type VibeComponentProps, withStaticProps } from \"../../../../types\";\nimport { type SubIcon } from \"@vibe/icon\";\nimport useMergeRef from \"../../../../hooks/useMergeRef\";\nimport { type ColorStyle } from \"../../../../types\";\n\nexport interface ColorPickerContentProps extends VibeComponentProps {\n /**\n * The selected color(s).\n */\n value: ColorPickerValue;\n /**\n * Callback fired when the selected color(s) change.\n */\n onValueChange: (value: ColorPickerArrayValueOnly) => void;\n /**\n * The list of colors available for selection.\n */\n colorsList: ColorPickerArrayValueOnly;\n /**\n * Icon displayed as an indicator inside the color.\n */\n ColorIndicatorIcon?: SubIcon;\n /**\n * Icon displayed when a color is selected.\n */\n SelectedIndicatorIcon?: SubIcon;\n /**\n * Icon used for clearing the color selection.\n */\n NoColorIcon?: SubIcon;\n /**\n * The style applied to the colors.\n */\n colorStyle?: ColorStyle;\n /**\n * The size of the color items.\n */\n colorSize?: ColorPickerSizes;\n /**\n * The shape of the color items.\n */\n colorShape?: ColorShapes;\n /**\n * Custom tooltip content for specific colors.\n */\n tooltipContentByColor?: Partial<Record<CONTENT_COLORS_VALUES, string>>;\n /**\n * Text displayed for the \"no color\" option.\n */\n noColorText?: string;\n /**\n * If true, renders the color indicator without a background.\n */\n shouldRenderIndicatorWithoutBackground?: boolean;\n /**\n * If true, treats the color list as a blacklist rather than a whitelist.\n */\n isBlackListMode?: boolean;\n /**\n * The number of colors displayed per row.\n */\n numberOfColorsInLine?: number;\n /**\n * If true, the first color is focused when the component mounts.\n */\n focusOnMount?: boolean;\n /**\n * If true, allows selecting multiple colors.\n */\n isMultiselect?: boolean;\n /**\n * Used to force the component render the colorList prop as is. Usually, this flag should not be used. It's intended only for edge cases.\n * Usually, only \"monday colors\" will be rendered (unless blacklist mode is used). This flag will override this behavior.\n */\n forceUseRawColorList?: boolean;\n /**\n * Used to enable color name tooltip on each color in the component.\n * When \"tooltipContentByColor\" is supplied, it will override the color name tooltip.\n */\n showColorNameTooltip?: boolean;\n}\n\nconst ColorPickerContent = forwardRef(\n (\n {\n className,\n onValueChange,\n value,\n noColorText,\n colorStyle = \"regular\",\n ColorIndicatorIcon,\n SelectedIndicatorIcon,\n shouldRenderIndicatorWithoutBackground,\n NoColorIcon = NoColor,\n isBlackListMode = true,\n colorsList,\n isMultiselect,\n colorSize = BaseSizes.MEDIUM,\n numberOfColorsInLine = DEFAULT_NUMBER_OF_COLORS_IN_LINE,\n tooltipContentByColor = {},\n focusOnMount,\n colorShape = \"square\",\n forceUseRawColorList,\n showColorNameTooltip,\n id,\n \"data-testid\": dataTestId\n }: ColorPickerContentProps,\n ref: React.ForwardedRef<HTMLDivElement>\n ) => {\n const gridRef = useRef(null);\n const mergedRef = useMergeRef(ref, gridRef);\n const colorsRef = useRef(null);\n const buttonRef = useRef(null);\n\n const onClearButton = useCallback(() => {\n onValueChange(null);\n }, [onValueChange]);\n\n const colorsToRender = useMemo(() => {\n if (forceUseRawColorList) {\n return colorsList;\n }\n return isBlackListMode ? _difference(contentColors, colorsList) : _intersection(contentColors, colorsList);\n }, [forceUseRawColorList, isBlackListMode, colorsList]);\n\n const onColorClicked = useCallback(\n (color: CONTENT_COLORS_VALUES) => {\n if (!isMultiselect) {\n onValueChange([color]);\n return;\n }\n const colors = [...value];\n if (colors.includes(color)) {\n const indexInSelected = colors.indexOf(color);\n if (indexInSelected > -1) {\n colors.splice(indexInSelected, 1);\n }\n } else {\n colors.push(color);\n }\n onValueChange(colors);\n },\n [isMultiselect, onValueChange, value]\n );\n\n const positions = useMemo(() => [{ topElement: colorsRef, bottomElement: buttonRef }], []);\n const keyboardContext = useGridKeyboardNavigationContext(positions, gridRef);\n const width = calculateColorPickerWidth(colorSize as BaseSizes, numberOfColorsInLine);\n\n return (\n <div className={className} style={{ width }} ref={mergedRef} tabIndex={-1}>\n <GridKeyboardNavigationContext.Provider value={keyboardContext}>\n <ColorPickerColorsGrid\n ref={colorsRef}\n onColorClicked={onColorClicked}\n colorsToRender={colorsToRender}\n numberOfColorsInLine={numberOfColorsInLine}\n focusOnMount={focusOnMount}\n value={value}\n colorStyle={colorStyle}\n ColorIndicatorIcon={ColorIndicatorIcon}\n shouldRenderIndicatorWithoutBackground={shouldRenderIndicatorWithoutBackground}\n SelectedIndicatorIcon={SelectedIndicatorIcon}\n colorSize={colorSize}\n tooltipContentByColor={tooltipContentByColor}\n colorShape={colorShape}\n showColorNameTooltip={showColorNameTooltip}\n id={id}\n data-testid={dataTestId}\n />\n {noColorText && (\n <ColorPickerClearButton Icon={NoColorIcon} onClick={onClearButton} text={noColorText} ref={buttonRef} />\n )}\n </GridKeyboardNavigationContext.Provider>\n </div>\n );\n }\n);\n\ninterface ColorPickerContentStaticProps {\n sizes: typeof BaseSizes;\n colorStyles: typeof ColorStyleEnum;\n colorSizes: typeof BaseSizes;\n colorShapes: typeof ColorShapesEnum;\n}\n\nexport default withStaticProps<ColorPickerContentProps, ColorPickerContentStaticProps>(ColorPickerContent, {\n sizes: BaseSizes,\n colorStyles: ColorStyleEnum,\n colorSizes: BaseSizes,\n colorShapes: ColorShapesEnum\n});\n"],"names":["withStaticProps","forwardRef","_ref","ref","className","onValueChange","value","noColorText","_ref$colorStyle","colorStyle","ColorIndicatorIcon","SelectedIndicatorIcon","shouldRenderIndicatorWithoutBackground","_ref$NoColorIcon","NoColorIcon","NoColor","_ref$isBlackListMode","isBlackListMode","colorsList","isMultiselect","_ref$colorSize","colorSize","BaseSizes","MEDIUM","_ref$numberOfColorsIn","numberOfColorsInLine","DEFAULT_NUMBER_OF_COLORS_IN_LINE","_ref$tooltipContentBy","tooltipContentByColor","focusOnMount","_ref$colorShape","colorShape","forceUseRawColorList","showColorNameTooltip","id","dataTestId","gridRef","useRef","mergedRef","useMergeRef","colorsRef","buttonRef","onClearButton","useCallback","colorsToRender","useMemo","_difference","contentColors","_intersection","onColorClicked","color","colors","_toConsumableArray","includes","indexInSelected","indexOf","splice","push","positions","topElement","bottomElement","keyboardContext","useGridKeyboardNavigationContext","width","calculateColorPickerWidth","React","createElement","style","tabIndex","GridKeyboardNavigationContext","Provider","ColorPickerColorsGrid","ColorPickerClearButton","Icon","onClick","text","sizes","colorStyles","ColorStyleEnum","colorSizes","colorShapes","ColorShapesEnum"],"mappings":"w9BAyGA,IAwGeA,EAAAA,EAxGYC,GACzB,SAAAC,EAwBEC,GACE,IAvBAC,EAASF,EAATE,UACAC,EAAaH,EAAbG,cACAC,EAAKJ,EAALI,MACAC,EAAWL,EAAXK,YAAWC,EAAAN,EACXO,WAAAA,OAAa,IAAHD,EAAG,UAASA,EACtBE,EAAkBR,EAAlBQ,mBACAC,EAAqBT,EAArBS,sBACAC,EAAsCV,EAAtCU,uCAAsCC,EAAAX,EACtCY,YAAAA,OAAcC,IAAHF,EAAGE,EAAOF,EAAAG,EAAAd,EACrBe,gBAAAA,OAAkB,IAAHD,GAAOA,EACtBE,EAAUhB,EAAVgB,WACAC,EAAajB,EAAbiB,cAAaC,EAAAlB,EACbmB,UAAAA,OAAS,IAAAD,EAAGE,EAAUC,OAAMH,EAAAI,EAAAtB,EAC5BuB,qBAAAA,OAAuBC,IAAHF,EAAGE,EAAgCF,EAAAG,EAAAzB,EACvD0B,sBAAAA,OAAqB,IAAAD,EAAG,CAAE,EAAAA,EAC1BE,EAAY3B,EAAZ2B,aAAYC,EAAA5B,EACZ6B,WAAAA,OAAa,IAAHD,EAAG,SAAQA,EACrBE,EAAoB9B,EAApB8B,qBACAC,EAAoB/B,EAApB+B,qBACAC,EAAEhC,EAAFgC,GACeC,EAAUjC,EAAzB,eAIIkC,EAAUC,EAAO,MACjBC,EAAYC,EA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KsC,KAKrG,IAUyG,CACzGmC,MAAOtD,EACPuD,YAAaC,EACbC,WAAYzD,EACZ0D,YAAaC"}
@@ -1,2 +1,2 @@
1
- import{defineProperty as e}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import{camelCase as o}from"es-toolkit";import{getStyle as t}from"../../../../helpers/typesciptCssModulesHelper.js";import r from"classnames";import l,{forwardRef as n,useMemo as s,useRef as c,useCallback as i,useEffect as a}from"react";import{contentColors as m}from"../../../../utils/colors-vars-map.js";import u from"../../../../utils/colors-utils.js";import d from"../../../Icon/Icon.js";import p from"../../../Tooltip/Tooltip.js";import f from"../../../Clickable/Clickable.js";import{getTestId as v}from"../../../../tests/testIds.js";import{ComponentDefaultTestId as I}from"../../../../tests/constants.js";import C from"./ColorPickerItemComponent.module.scss.js";var g=n((function(n,g){var y=n.color,E=n.onColorClicked,k=n.colorStyle,j=void 0===k?"regular":k,b=n.shouldRenderIndicatorWithoutBackground,S=n.ColorIndicatorIcon,h=n.SelectedIndicatorIcon,L=void 0===h?S:h,M=n.isSelected,N=n.colorSize,P=n.tooltipContent,T=n.isActive,W=n.colorShape,_=n["data-testid"],x=s((function(){return m.includes(y)}),[y]),A=x?u.getMondayColorAsStyle(y,j):y,R=c(null),z=i((function(){return E(y)}),[E,y]);a((function(){if((null==R?void 0:R.current)&&!b&&x){var e=R.current,o=function(e){e.target.style.background=u.getMondayColorAsStyle(y,"selected"===j?"regular":"hover")},t=function(e){e.target.style.background=A};return e.addEventListener("mouseenter",o,!1),e.addEventListener("mouseleave",t,!1),function(){e.removeEventListener("mouseenter",o,!1),e.removeEventListener("mouseleave",t,!1)}}}),[y,A,j,x,R,b]);var B=M||S,D=b?{color:A}:{};return l.createElement(p,{content:P},l.createElement("li",{className:r(C.itemWrapper,e(e(e({},C.selectedColor,M),C.active,T),C.circle,"circle"===W)),"data-testid":_||v(I.COLOR_PICKER_ITEM,y)},l.createElement("div",{className:r(C.feedbackIndicator)}),l.createElement(f,{ref:R,ariaLabel:y,className:r(C.colorItem,t(C,o("color-item-size-"+N)),e({},C.colorItemTextMode,b)),style:{background:b?"transparent":A},onClick:z,tabIndex:"-1",onMouseDown:function(e){return e.preventDefault()}},l.createElement("div",{className:r(C.colorIndicatorWrapper),style:D},B&&l.createElement(d,{icon:M?L:S,className:r(e({},C.colorIconWhite,!b)),ignoreFocusStyle:!0})))))}));export{g as default};
1
+ import{defineProperty as e}from"../../../../../_virtual/_rollupPluginBabelHelpers.js";import{camelCase as o}from"es-toolkit";import{getStyle as t}from"../../../../helpers/typesciptCssModulesHelper.js";import r from"classnames";import n,{forwardRef as l,useMemo as s,useRef as c,useCallback as i,useEffect as a}from"react";import{contentColors as m}from"../../../../utils/colors-vars-map.js";import u from"../../../../utils/colors-utils.js";import d from"../../../Tooltip/Tooltip.js";import p from"../../../Clickable/Clickable.js";import{getTestId as f}from"../../../../tests/testIds.js";import{ComponentDefaultTestId as v}from"../../../../tests/constants.js";import I from"./ColorPickerItemComponent.module.scss.js";import C from"../../../../../components/icon/dist/Icon/Icon.js";var g=l((function(l,g){var y=l.color,E=l.onColorClicked,k=l.colorStyle,j=void 0===k?"regular":k,b=l.shouldRenderIndicatorWithoutBackground,S=l.ColorIndicatorIcon,h=l.SelectedIndicatorIcon,L=void 0===h?S:h,M=l.isSelected,N=l.colorSize,P=l.tooltipContent,T=l.isActive,W=l.colorShape,_=l["data-testid"],x=s((function(){return m.includes(y)}),[y]),A=x?u.getMondayColorAsStyle(y,j):y,R=c(null),z=i((function(){return E(y)}),[E,y]);a((function(){if((null==R?void 0:R.current)&&!b&&x){var e=R.current,o=function(e){e.target.style.background=u.getMondayColorAsStyle(y,"selected"===j?"regular":"hover")},t=function(e){e.target.style.background=A};return e.addEventListener("mouseenter",o,!1),e.addEventListener("mouseleave",t,!1),function(){e.removeEventListener("mouseenter",o,!1),e.removeEventListener("mouseleave",t,!1)}}}),[y,A,j,x,R,b]);var B=M||S,D=b?{color:A}:{};return n.createElement(d,{content:P},n.createElement("li",{className:r(I.itemWrapper,e(e(e({},I.selectedColor,M),I.active,T),I.circle,"circle"===W)),"data-testid":_||f(v.COLOR_PICKER_ITEM,y)},n.createElement("div",{className:r(I.feedbackIndicator)}),n.createElement(p,{ref:R,ariaLabel:y,className:r(I.colorItem,t(I,o("color-item-size-"+N)),e({},I.colorItemTextMode,b)),style:{background:b?"transparent":A},onClick:z,tabIndex:"-1",onMouseDown:function(e){return e.preventDefault()}},n.createElement("div",{className:r(I.colorIndicatorWrapper),style:D},B&&n.createElement(C,{icon:M?L:S,className:r(e({},I.colorIconWhite,!b)),ignoreFocusStyle:!0})))))}));export{g as default};
2
2
  //# sourceMappingURL=ColorPickerItemComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPickerItemComponent.js","sources":["../../../../../../src/components/ColorPicker/components/ColorPickerItemComponent/ColorPickerItemComponent.tsx"],"sourcesContent":["import { camelCase } from \"es-toolkit\";\nimport { getStyle } from \"../../../../helpers/typesciptCssModulesHelper\";\nimport cx from \"classnames\";\nimport React, { useRef, useCallback, useMemo, forwardRef, useEffect } from \"react\";\nimport { contentColors } from \"../../../../utils/colors-vars-map\";\nimport ColorUtils from \"../../../../utils/colors-utils\";\nimport Icon from \"../../../Icon/Icon\";\nimport Tooltip from \"../../../Tooltip/Tooltip\";\nimport Clickable from \"../../../Clickable/Clickable\";\nimport { type ColorPickerValueOnly } from \"../../ColorPicker.types\";\nimport { type ColorShapes, type ColorPickerSizes } from \"../../ColorPicker.types\";\nimport { getTestId } from \"../../../../tests/test-ids-utils\";\nimport { ComponentDefaultTestId } from \"../../../../tests/constants\";\nimport { type SubIcon, type VibeComponentProps, type ElementContent, type ColorStyle } from \"../../../../types\";\nimport styles from \"./ColorPickerItemComponent.module.scss\";\n\nexport interface ColorPickerItemComponentProps extends VibeComponentProps {\n /**\n * The color value of the item.\n */\n color: ColorPickerValueOnly;\n /**\n * Callback fired when the color is clicked.\n */\n onColorClicked: (color: ColorPickerValueOnly) => void;\n /**\n * The style applied to the color.\n */\n colorStyle: ColorStyle;\n /**\n * If true, renders the color indicator without a background.\n */\n shouldRenderIndicatorWithoutBackground: boolean;\n /**\n * Icon displayed inside the color item.\n */\n ColorIndicatorIcon: SubIcon;\n /**\n * Icon displayed when the color is selected.\n */\n SelectedIndicatorIcon: SubIcon;\n /**\n * If true, the color is marked as selected.\n */\n isSelected: boolean;\n /**\n * The size of the color item.\n */\n colorSize: ColorPickerSizes;\n /**\n * Tooltip content for the color item.\n */\n tooltipContent: ElementContent;\n /**\n * If true, the color item is currently active.\n */\n isActive: boolean;\n /**\n * The shape of the color item.\n */\n colorShape: ColorShapes;\n}\n\nconst ColorPickerItemComponent = forwardRef(\n (\n {\n color,\n onColorClicked,\n colorStyle = \"regular\",\n shouldRenderIndicatorWithoutBackground,\n ColorIndicatorIcon,\n SelectedIndicatorIcon = ColorIndicatorIcon,\n isSelected,\n colorSize,\n tooltipContent,\n isActive,\n colorShape,\n \"data-testid\": dataTestId\n }: ColorPickerItemComponentProps,\n _ref: React.ForwardedRef<HTMLElement>\n ) => {\n const isMondayColor = useMemo(() => (contentColors as readonly string[]).includes(color), [color]); // casting to any since color can be one of the system content colors but can also be a custom one\n const colorAsStyle = isMondayColor ? ColorUtils.getMondayColorAsStyle(color, colorStyle) : color;\n const itemRef = useRef<HTMLDivElement>(null);\n\n const onClick = useCallback(() => onColorClicked(color), [onColorClicked, color]);\n\n useEffect(() => {\n if (!itemRef?.current || shouldRenderIndicatorWithoutBackground || !isMondayColor) return;\n const item = itemRef.current;\n const setHoverColor = (e: MouseEvent) => {\n if (colorStyle === \"selected\") {\n (e.target as HTMLDivElement).style.background = ColorUtils.getMondayColorAsStyle(color, \"regular\");\n } else {\n (e.target as HTMLDivElement).style.background = ColorUtils.getMondayColorAsStyle(color, \"hover\");\n }\n };\n const restoreToOriginalColor = (e: MouseEvent) => {\n (e.target as HTMLDivElement).style.background = colorAsStyle;\n };\n item.addEventListener(\"mouseenter\", setHoverColor, false);\n item.addEventListener(\"mouseleave\", restoreToOriginalColor, false);\n\n return () => {\n item.removeEventListener(\"mouseenter\", setHoverColor, false);\n item.removeEventListener(\"mouseleave\", restoreToOriginalColor, false);\n };\n }, [color, colorAsStyle, colorStyle, isMondayColor, itemRef, shouldRenderIndicatorWithoutBackground]);\n\n const shouldRenderIcon = isSelected || ColorIndicatorIcon;\n const colorIndicatorWrapperStyle = shouldRenderIndicatorWithoutBackground ? { color: colorAsStyle } : {};\n return (\n <Tooltip content={tooltipContent}>\n <li\n className={cx(styles.itemWrapper, {\n [styles.selectedColor]: isSelected,\n [styles.active]: isActive,\n [styles.circle]: colorShape === \"circle\"\n })}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.COLOR_PICKER_ITEM, color)}\n >\n <div className={cx(styles.feedbackIndicator)} />\n <Clickable\n ref={itemRef}\n ariaLabel={color}\n className={cx(styles.colorItem, getStyle(styles, camelCase(\"color-item-size-\" + colorSize)), {\n [styles.colorItemTextMode]: shouldRenderIndicatorWithoutBackground\n })}\n style={{ background: shouldRenderIndicatorWithoutBackground ? \"transparent\" : colorAsStyle }}\n onClick={onClick}\n tabIndex=\"-1\"\n onMouseDown={e => e.preventDefault()} // this is for quill to not lose the selection\n >\n <div className={cx(styles.colorIndicatorWrapper)} style={colorIndicatorWrapperStyle}>\n {shouldRenderIcon && (\n <Icon\n icon={isSelected ? SelectedIndicatorIcon : ColorIndicatorIcon}\n className={cx({\n [styles.colorIconWhite]: !shouldRenderIndicatorWithoutBackground\n })}\n ignoreFocusStyle\n />\n )}\n </div>\n </Clickable>\n </li>\n </Tooltip>\n );\n }\n);\n\nexport default ColorPickerItemComponent;\n"],"names":["ColorPickerItemComponent","forwardRef","_ref2","_ref","color","onColorClicked","_ref2$colorStyle","colorStyle","shouldRenderIndicatorWithoutBackground","ColorIndicatorIcon","_ref2$SelectedIndicat","SelectedIndicatorIcon","isSelected","colorSize","tooltipContent","isActive","colorShape","dataTestId","isMondayColor","useMemo","contentColors","includes","colorAsStyle","ColorUtils","getMondayColorAsStyle","itemRef","useRef","onClick","useCallback","useEffect","current","item","setHoverColor","e","target","style","background","restoreToOriginalColor","addEventListener","removeEventListener","shouldRenderIcon","colorIndicatorWrapperStyle","React","createElement","Tooltip","content","className","cx","styles","itemWrapper","_defineProperty","selectedColor","active","circle","getTestId","ComponentDefaultTestId","COLOR_PICKER_ITEM","feedbackIndicator","Clickable","ref","ariaLabel","colorItem","getStyle","camelCase","colorItemTextMode","tabIndex","onMouseDown","preventDefault","colorIndicatorWrapper","Icon","icon","colorIconWhite","ignoreFocusStyle"],"mappings":"ivBA+DMA,IAAAA,EAA2BC,GAC/B,SAAAC,EAeEC,GACE,IAdAC,EAAKF,EAALE,MACAC,EAAcH,EAAdG,eAAcC,EAAAJ,EACdK,WAAAA,OAAa,IAAHD,EAAG,UAASA,EACtBE,EAAsCN,EAAtCM,uCACAC,EAAkBP,EAAlBO,mBAAkBC,EAAAR,EAClBS,sBAAAA,OAAwBF,IAAHC,EAAGD,EAAkBC,EAC1CE,EAAUV,EAAVU,WACAC,EAASX,EAATW,UACAC,EAAcZ,EAAdY,eACAC,EAAQb,EAARa,SACAC,EAAUd,EAAVc,WACeC,EAAUf,EAAzB,eAIIgB,EAAgBC,GAAQ,WAAA,OAAOC,EAAoCC,SAASjB,EAAM,GAAE,CAACA,IACrFkB,EAAeJ,EAAgBK,EAAWC,sBAAsBpB,EAAOG,GAAcH,EACrFqB,EAAUC,EAAuB,MAEjCC,EAAUC,GAAY,WAAA,OAAMvB,EAAeD,EAAM,GAAE,CAACC,EAAgBD,IAE1EyB,GAAU,WACR,IAAKJ,aAAA,EAAAA,EAASK,WAAWtB,GAA2CU,EAApE,CACA,IAAMa,EAAON,EAAQK,QACfE,EAAgB,SAACC,GAElBA,EAAEC,OAA0BC,MAAMC,WAAab,EAAWC,sBAAsBpB,EADhE,aAAfG,EACsF,UAEA,UAGtF8B,EAAyB,SAACJ,GAC7BA,EAAEC,OAA0BC,MAAMC,WAAad,GAKlD,OAHAS,EAAKO,iBAAiB,aAAcN,GAAe,GACnDD,EAAKO,iBAAiB,aAAcD,GAAwB,GAErD,WACLN,EAAKQ,oBAAoB,aAAcP,GAAe,GACtDD,EAAKQ,oBAAoB,aAAcF,GAAwB,GAjBkB,CAmBrF,GAAG,CAACjC,EAAOkB,EAAcf,EAAYW,EAAeO,EAASjB,IAE7D,IAAMgC,EAAmB5B,GAAcH,EACjCgC,EAA6BjC,EAAyC,CAAEJ,MAAOkB,GAAiB,GACtG,OACEoB,EAACC,cAAAC,EAAQ,CAAAC,QAAS/B,GAChB4B,EAAAC,cAAA,KAAA,CACEG,UAAWC,EAAGC,EAAOC,YAAWC,EAAAA,EAAAA,EAAA,CAAA,EAC7BF,EAAOG,cAAgBvC,GACvBoC,EAAOI,OAASrC,GAChBiC,EAAOK,OAAwB,WAAfrC,IACjB,cACWC,GAAcqC,EAAUC,EAAuBC,kBAAmBpD,IAE/EsC,EAAKC,cAAA,MAAA,CAAAG,UAAWC,EAAGC,EAAOS,qBAC1Bf,EAAAC,cAACe,EAAS,CACRC,IAAKlC,EACLmC,UAAWxD,EACX0C,UAAWC,EAAGC,EAAOa,UAAWC,EAASd,EAAQe,EAAU,mBAAqBlD,IAAWqC,EAAA,CAAA,EACxFF,EAAOgB,kBAAoBxD,IAE9B2B,MAAO,CAAEC,WAAY5B,EAAyC,cAAgBc,GAC9EK,QAASA,EACTsC,SAAS,KACTC,YAAa,SAAAjC,GAAC,OAAIA,EAAEkC,gBAAgB,GAEpCzB,EAAAC,cAAA,MAAA,CAAKG,UAAWC,EAAGC,EAAOoB,uBAAwBjC,MAAOM,GACtDD,GACCE,EAAAC,cAAC0B,EAAI,CACHC,KAAM1D,EAAaD,EAAwBF,EAC3CqC,UAAWC,EAAEG,EACVF,CAAAA,EAAAA,EAAOuB,gBAAkB/D,IAE5BgE,kBACA,OAOhB"}
1
+ {"version":3,"file":"ColorPickerItemComponent.js","sources":["../../../../../../src/components/ColorPicker/components/ColorPickerItemComponent/ColorPickerItemComponent.tsx"],"sourcesContent":["import { camelCase } from \"es-toolkit\";\nimport { getStyle } from \"../../../../helpers/typesciptCssModulesHelper\";\nimport cx from \"classnames\";\nimport React, { useRef, useCallback, useMemo, forwardRef, useEffect } from \"react\";\nimport { contentColors } from \"../../../../utils/colors-vars-map\";\nimport ColorUtils from \"../../../../utils/colors-utils\";\nimport { Icon } from \"@vibe/icon\";\nimport Tooltip from \"../../../Tooltip/Tooltip\";\nimport Clickable from \"../../../Clickable/Clickable\";\nimport { type ColorPickerValueOnly } from \"../../ColorPicker.types\";\nimport { type ColorShapes, type ColorPickerSizes } from \"../../ColorPicker.types\";\nimport { getTestId } from \"../../../../tests/test-ids-utils\";\nimport { ComponentDefaultTestId } from \"../../../../tests/constants\";\nimport { type VibeComponentProps, type ElementContent, type ColorStyle } from \"../../../../types\";\nimport { type SubIcon } from \"@vibe/icon\";\nimport styles from \"./ColorPickerItemComponent.module.scss\";\n\nexport interface ColorPickerItemComponentProps extends VibeComponentProps {\n /**\n * The color value of the item.\n */\n color: ColorPickerValueOnly;\n /**\n * Callback fired when the color is clicked.\n */\n onColorClicked: (color: ColorPickerValueOnly) => void;\n /**\n * The style applied to the color.\n */\n colorStyle: ColorStyle;\n /**\n * If true, renders the color indicator without a background.\n */\n shouldRenderIndicatorWithoutBackground: boolean;\n /**\n * Icon displayed inside the color item.\n */\n ColorIndicatorIcon: SubIcon;\n /**\n * Icon displayed when the color is selected.\n */\n SelectedIndicatorIcon: SubIcon;\n /**\n * If true, the color is marked as selected.\n */\n isSelected: boolean;\n /**\n * The size of the color item.\n */\n colorSize: ColorPickerSizes;\n /**\n * Tooltip content for the color item.\n */\n tooltipContent: ElementContent;\n /**\n * If true, the color item is currently active.\n */\n isActive: boolean;\n /**\n * The shape of the color item.\n */\n colorShape: ColorShapes;\n}\n\nconst ColorPickerItemComponent = forwardRef(\n (\n {\n color,\n onColorClicked,\n colorStyle = \"regular\",\n shouldRenderIndicatorWithoutBackground,\n ColorIndicatorIcon,\n SelectedIndicatorIcon = ColorIndicatorIcon,\n isSelected,\n colorSize,\n tooltipContent,\n isActive,\n colorShape,\n \"data-testid\": dataTestId\n }: ColorPickerItemComponentProps,\n _ref: React.ForwardedRef<HTMLElement>\n ) => {\n const isMondayColor = useMemo(() => (contentColors as readonly string[]).includes(color), [color]); // casting to any since color can be one of the system content colors but can also be a custom one\n const colorAsStyle = isMondayColor ? ColorUtils.getMondayColorAsStyle(color, colorStyle) : color;\n const itemRef = useRef<HTMLDivElement>(null);\n\n const onClick = useCallback(() => onColorClicked(color), [onColorClicked, color]);\n\n useEffect(() => {\n if (!itemRef?.current || shouldRenderIndicatorWithoutBackground || !isMondayColor) return;\n const item = itemRef.current;\n const setHoverColor = (e: MouseEvent) => {\n if (colorStyle === \"selected\") {\n (e.target as HTMLDivElement).style.background = ColorUtils.getMondayColorAsStyle(color, \"regular\");\n } else {\n (e.target as HTMLDivElement).style.background = ColorUtils.getMondayColorAsStyle(color, \"hover\");\n }\n };\n const restoreToOriginalColor = (e: MouseEvent) => {\n (e.target as HTMLDivElement).style.background = colorAsStyle;\n };\n item.addEventListener(\"mouseenter\", setHoverColor, false);\n item.addEventListener(\"mouseleave\", restoreToOriginalColor, false);\n\n return () => {\n item.removeEventListener(\"mouseenter\", setHoverColor, false);\n item.removeEventListener(\"mouseleave\", restoreToOriginalColor, false);\n };\n }, [color, colorAsStyle, colorStyle, isMondayColor, itemRef, shouldRenderIndicatorWithoutBackground]);\n\n const shouldRenderIcon = isSelected || ColorIndicatorIcon;\n const colorIndicatorWrapperStyle = shouldRenderIndicatorWithoutBackground ? { color: colorAsStyle } : {};\n return (\n <Tooltip content={tooltipContent}>\n <li\n className={cx(styles.itemWrapper, {\n [styles.selectedColor]: isSelected,\n [styles.active]: isActive,\n [styles.circle]: colorShape === \"circle\"\n })}\n data-testid={dataTestId || getTestId(ComponentDefaultTestId.COLOR_PICKER_ITEM, color)}\n >\n <div className={cx(styles.feedbackIndicator)} />\n <Clickable\n ref={itemRef}\n ariaLabel={color}\n className={cx(styles.colorItem, getStyle(styles, camelCase(\"color-item-size-\" + colorSize)), {\n [styles.colorItemTextMode]: shouldRenderIndicatorWithoutBackground\n })}\n style={{ background: shouldRenderIndicatorWithoutBackground ? \"transparent\" : colorAsStyle }}\n onClick={onClick}\n tabIndex=\"-1\"\n onMouseDown={e => e.preventDefault()} // this is for quill to not lose the selection\n >\n <div className={cx(styles.colorIndicatorWrapper)} style={colorIndicatorWrapperStyle}>\n {shouldRenderIcon && (\n <Icon\n icon={isSelected ? SelectedIndicatorIcon : ColorIndicatorIcon}\n className={cx({\n [styles.colorIconWhite]: !shouldRenderIndicatorWithoutBackground\n })}\n ignoreFocusStyle\n />\n )}\n </div>\n </Clickable>\n </li>\n </Tooltip>\n );\n }\n);\n\nexport default ColorPickerItemComponent;\n"],"names":["ColorPickerItemComponent","forwardRef","_ref2","_ref","color","onColorClicked","_ref2$colorStyle","colorStyle","shouldRenderIndicatorWithoutBackground","ColorIndicatorIcon","_ref2$SelectedIndicat","SelectedIndicatorIcon","isSelected","colorSize","tooltipContent","isActive","colorShape","dataTestId","isMondayColor","useMemo","contentColors","includes","colorAsStyle","ColorUtils","getMondayColorAsStyle","itemRef","useRef","onClick","useCallback","useEffect","current","item","setHoverColor","e","target","style","background","restoreToOriginalColor","addEventListener","removeEventListener","shouldRenderIcon","colorIndicatorWrapperStyle","React","createElement","Tooltip","content","className","cx","styles","itemWrapper","_defineProperty","selectedColor","active","circle","getTestId","ComponentDefaultTestId","COLOR_PICKER_ITEM","feedbackIndicator","Clickable","ref","ariaLabel","colorItem","getStyle","camelCase","colorItemTextMode","tabIndex","onMouseDown","preventDefault","colorIndicatorWrapper","Icon","icon","colorIconWhite","ignoreFocusStyle"],"mappings":"4wBAgEMA,IAAAA,EAA2BC,GAC/B,SAAAC,EAeEC,GACE,IAdAC,EAAKF,EAALE,MACAC,EAAcH,EAAdG,eAAcC,EAAAJ,EACdK,WAAAA,OAAa,IAAHD,EAAG,UAASA,EACtBE,EAAsC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,cACWC,GAAcqC,EAAUC,EAAuBC,kBAAmBpD,IAE/EsC,EAAKC,cAAA,MAAA,CAAAG,UAAWC,EAAGC,EAAOS,qBAC1Bf,EAAAC,cAACe,EAAS,CACRC,IAAKlC,EACLmC,UAAWxD,EACX0C,UAAWC,EAAGC,EAAOa,UAAWC,EAASd,EAAQe,EAAU,mBAAqBlD,IAAWqC,EAAA,CAAA,EACxFF,EAAOgB,kBAAoBxD,IAE9B2B,MAAO,CAAEC,WAAY5B,EAAyC,cAAgBc,GAC9EK,QAASA,EACTsC,SAAS,KACTC,YAAa,SAAAjC,GAAC,OAAIA,EAAEkC,gBAAgB,GAEpCzB,EAAAC,cAAA,MAAA,CAAKG,UAAWC,EAAGC,EAAOoB,uBAAwBjC,MAAOM,GACtDD,GACCE,EAAAC,cAAC0B,EAAI,CACHC,KAAM1D,EAAaD,EAAwBF,EAC3CqC,UAAWC,EAAEG,EACVF,CAAAA,EAAAA,EAAOuB,gBAAkB/D,IAE5BgE,kBACA,OAOhB"}
@@ -1,2 +1,2 @@
1
- import{slicedToArray as e,defineProperty as o}from"../../../_virtual/_rollupPluginBabelHelpers.js";import t from"classnames";import i,{forwardRef as s,useRef as r,useState as a,useCallback as n,useMemo as l}from"react";import{camelCase as c,noop as d,isFunction as m}from"es-toolkit";import{getStyle as p}from"../../helpers/typesciptCssModulesHelper.js";import{getTestId as u,ComponentDefaultTestId as v}from"../../tests/testIds.js";import b from"../../hooks/useMergeRef.js";import f from"../Search/Search.js";import{BASE_SIZES as h}from"../../constants/sizes.js";import C from"../Button/Button.js";import g from"../Text/Text.js";import x from"./components/ComboboxOption/ComboboxOption.js";import{defaultFilter as y}from"./ComboboxService.js";import{ComboboxItems as I}from"./components/ComboboxItems/ComboboxItems.js";import{StickyCategoryHeader as O}from"./components/StickyCategoryHeader/StickyCategoryHeader.js";import{useItemsData as N,useKeyboardNavigation as j}from"./ComboboxHelpers/ComboboxHelpers.js";import{getOptionId as S}from"./helpers.js";import{withStaticProps as R}from"../../types/withStaticProps.js";import"../../utils/colors-vars-map.js";import{COMBOBOX_LISTBOX_ID as k}from"./components/ComboboxConstants.js";import F from"./Combobox.module.scss.js";import{ComponentVibeId as H}from"../../tests/constants.js";var E=R(s((function(s,h){var x=s.className,R=void 0===x?"":x,E=s.optionClassName,A=void 0===E?"":E,L=s.searchWrapperClassName,M=s.stickyCategoryClassName,B=s.searchIcon,w=s.id,T=void 0===w?"":w,z=s.placeholder,V=void 0===z?"":z,W=s.size,P=void 0===W?"medium":W,D=s.defaultVisualFocusFirstIndex,X=s.optionLineHeight,_=void 0===X?32:X,q=s.optionsListHeight,G=s.autoFocus,J=void 0!==G&&G,K=s.disabled,Q=void 0!==K&&K,U=s.options,Y=void 0===U?[]:U,Z=s.categories,$=s.withCategoriesDivider,ee=void 0!==$&&$,oe=s.noResultsMessage,te=void 0===oe?"No results found":oe,ie=s.onAddNew,se=s.addNewLabel,re=void 0===se?"Add new":se,ae=s.onClick,ne=void 0===ae?function(e){}:ae,le=s.filter,ce=void 0===le?y:le,de=s.disableFilter,me=void 0!==de&&de,pe=s.filterValue,ue=s.onFilterChanged,ve=s.loading,be=void 0!==ve&&ve,fe=s.onOptionHover,he=void 0===fe?d:fe,Ce=s.onOptionLeave,ge=void 0===Ce?d:Ce,xe=s.shouldScrollToSelectedItem,ye=void 0===xe||xe,Ie=s.noResultsRenderer,Oe=s.stickyCategories,Ne=void 0!==Oe&&Oe,je=s.optionRenderer,Se=void 0===je?null:je,Re=s.renderOnlyVisibleOptions,ke=void 0!==Re&&Re,Fe=s.clearFilterOnSelection,He=void 0!==Fe&&Fe,Ee=s.maxOptionsWithoutScroll,Ae=s.defaultFilter,Le=void 0===Ae?"":Ae,Me=s.searchInputAriaLabel,Be=void 0===Me?"Search for content":Me,we=s["data-testid"],Te=s.debounceRate,ze=s.searchInputRef,Ve=s.renderAction,We=s.hideRenderActionOnInput,Pe=r(null),De=r(null),Xe=b(h,Pe),_e=b(De,ze),qe=a(pe||Le),Ge=e(qe,2),Je=Ge[0],Ke=Ge[1];void 0!==pe&&pe!==Je&&Ke(pe);var Qe=n((function(e){oo(-1),ue&&ue(e),Ke(e)}),[Ke,ue]),Ue=n((function(e,o,t){he(e,o,t)}),[he]),Ye=l((function(){return me?Y:ce(Je,Y)}),[Y,Je,ce,me]),Ze=a(-1),$e=e(Ze,2),eo=$e[0],oo=$e[1],to=n((function(e){return void 0!==e&&Ye[e]&&!Ye[e].disabled}),[Ye]),io=n((function(){ie&&ie(Je),Ke("")}),[ie,Je,Ke]),so=Ye.length>0,ro=Je.length>0;var ao=a(),no=e(ao,2),lo=no[0],co=no[1],mo=n((function(e){var o;(null===(o=null==e?void 0:e.category)||void 0===o?void 0:o.label)!==(null==lo?void 0:lo.label)&&co(null==e?void 0:e.category)}),[lo]),po=N({categories:Z,options:Ye,filterValue:Je,withCategoriesDivider:ee,optionLineHeight:_}),uo=po.items,vo=po.itemsMap,bo=po.selectableItems,fo=n((function(e,o){ne(bo[o]),to(o)&&oo(o),He&&Qe("")}),[ne,bo,to,He,Qe]),ho=j({getOptionId:S,defaultVisualFocusFirstIndex:D,onClick:fo,isChildSelectable:to,options:bo,inputRef:_e}),Co=ho.visualFocusItemIndex,go=ho.visualFocusItemId,xo=ho.onOptionClick;return i.createElement(g,{type:"text2",ref:Xe,className:t(F.combobox,R,p(F,c("size-"+P)),o(o({},F.empty,!so),F.stickyCategory,Ne)),id:T,"data-testid":we||u(v.COMBOBOX,T),ellipsis:!1,"data-vibe":H.COMBOBOX},i.createElement("div",{className:F.comboboxList,style:{maxHeight:q}},i.createElement(f,{ref:_e,value:Je,className:t(F.comboboxSearchWrapper,L),inputAriaLabel:Be,currentAriaResultId:go,id:"combobox-search",placeholder:V,size:P,disabled:Q,onChange:Qe,autoFocus:J,loading:be,searchIconName:B,ariaExpanded:ro||so,ariaHasPopup:"listbox",searchResultsContainerId:T?"".concat(T,"-listbox"):k,debounceRate:Te,renderAction:Ve,hideRenderActionOnInput:We}),Ne&&i.createElement(O,{label:null==lo?void 0:lo.label,color:null==lo?void 0:lo.color,className:M}),so&&i.createElement(I,{stickyCategories:Ne,categories:Z,options:uo,itemsMap:vo,optionClassName:A,optionRenderer:Se,activeItemIndex:eo,onActiveCategoryChanged:mo,onOptionClick:xo,onOptionEnter:Ue,onOptionLeave:ge,optionLineHeight:_,shouldScrollToSelectedItem:ye,renderOnlyVisibleOptions:ke,maxOptionsWithoutScroll:Ee,visualFocusItemIndex:Co,id:T?"".concat(T,"-listbox"):k})),ro&&!so&&!be&&(Ie?Ie():i.createElement("div",{className:F.comboboxNoResults},i.createElement("div",{className:F.comboboxMessageWrapper},i.createElement("span",{className:F.comboboxMessage},te)),ie&&!Q&&i.createElement(C,{className:F.addNewButton,size:P,kind:"tertiary",onClick:io},i.createElement("span",{className:F.buttonLabel},m(re)?re(Je):re)))))})),{sizes:h,iconTypes:x.iconTypes});export{E as default};
1
+ import{slicedToArray as e,defineProperty as o}from"../../../_virtual/_rollupPluginBabelHelpers.js";import t from"classnames";import i,{forwardRef as s,useRef as r,useState as n,useCallback as a,useMemo as l}from"react";import{camelCase as c,noop as d,isFunction as m}from"es-toolkit";import{getStyle as p}from"../../helpers/typesciptCssModulesHelper.js";import{getTestId as u,ComponentDefaultTestId as b}from"../../tests/testIds.js";import v from"../../hooks/useMergeRef.js";import f from"../Search/Search.js";import{BASE_SIZES as h}from"../../constants/sizes.js";import C from"../Text/Text.js";import g from"./components/ComboboxOption/ComboboxOption.js";import{defaultFilter as x}from"./ComboboxService.js";import{ComboboxItems as y}from"./components/ComboboxItems/ComboboxItems.js";import{StickyCategoryHeader as I}from"./components/StickyCategoryHeader/StickyCategoryHeader.js";import{useItemsData as O,useKeyboardNavigation as N}from"./ComboboxHelpers/ComboboxHelpers.js";import{getOptionId as j}from"./helpers.js";import{withStaticProps as S}from"../../types/withStaticProps.js";import"../../utils/colors-vars-map.js";import{COMBOBOX_LISTBOX_ID as R}from"./components/ComboboxConstants.js";import k from"./Combobox.module.scss.js";import{ComponentVibeId as F}from"../../tests/constants.js";import H from"../../../components/button/dist/Button/Button.js";var E=S(s((function(s,h){var g=s.className,S=void 0===g?"":g,E=s.optionClassName,A=void 0===E?"":E,L=s.searchWrapperClassName,M=s.stickyCategoryClassName,B=s.searchIcon,w=s.id,T=void 0===w?"":w,z=s.placeholder,V=void 0===z?"":z,W=s.size,P=void 0===W?"medium":W,D=s.defaultVisualFocusFirstIndex,X=s.optionLineHeight,_=void 0===X?32:X,q=s.optionsListHeight,G=s.autoFocus,J=void 0!==G&&G,K=s.disabled,Q=void 0!==K&&K,U=s.options,Y=void 0===U?[]:U,Z=s.categories,$=s.withCategoriesDivider,ee=void 0!==$&&$,oe=s.noResultsMessage,te=void 0===oe?"No results found":oe,ie=s.onAddNew,se=s.addNewLabel,re=void 0===se?"Add new":se,ne=s.onClick,ae=void 0===ne?function(e){}:ne,le=s.filter,ce=void 0===le?x:le,de=s.disableFilter,me=void 0!==de&&de,pe=s.filterValue,ue=s.onFilterChanged,be=s.loading,ve=void 0!==be&&be,fe=s.onOptionHover,he=void 0===fe?d:fe,Ce=s.onOptionLeave,ge=void 0===Ce?d:Ce,xe=s.shouldScrollToSelectedItem,ye=void 0===xe||xe,Ie=s.noResultsRenderer,Oe=s.stickyCategories,Ne=void 0!==Oe&&Oe,je=s.optionRenderer,Se=void 0===je?null:je,Re=s.renderOnlyVisibleOptions,ke=void 0!==Re&&Re,Fe=s.clearFilterOnSelection,He=void 0!==Fe&&Fe,Ee=s.maxOptionsWithoutScroll,Ae=s.defaultFilter,Le=void 0===Ae?"":Ae,Me=s.searchInputAriaLabel,Be=void 0===Me?"Search for content":Me,we=s["data-testid"],Te=s.debounceRate,ze=s.searchInputRef,Ve=s.renderAction,We=s.hideRenderActionOnInput,Pe=r(null),De=r(null),Xe=v(h,Pe),_e=v(De,ze),qe=n(pe||Le),Ge=e(qe,2),Je=Ge[0],Ke=Ge[1];void 0!==pe&&pe!==Je&&Ke(pe);var Qe=a((function(e){oo(-1),ue&&ue(e),Ke(e)}),[Ke,ue]),Ue=a((function(e,o,t){he(e,o,t)}),[he]),Ye=l((function(){return me?Y:ce(Je,Y)}),[Y,Je,ce,me]),Ze=n(-1),$e=e(Ze,2),eo=$e[0],oo=$e[1],to=a((function(e){return void 0!==e&&Ye[e]&&!Ye[e].disabled}),[Ye]),io=a((function(){ie&&ie(Je),Ke("")}),[ie,Je,Ke]),so=Ye.length>0,ro=Je.length>0;var no=n(),ao=e(no,2),lo=ao[0],co=ao[1],mo=a((function(e){var o;(null===(o=null==e?void 0:e.category)||void 0===o?void 0:o.label)!==(null==lo?void 0:lo.label)&&co(null==e?void 0:e.category)}),[lo]),po=O({categories:Z,options:Ye,filterValue:Je,withCategoriesDivider:ee,optionLineHeight:_}),uo=po.items,bo=po.itemsMap,vo=po.selectableItems,fo=a((function(e,o){ae(vo[o]),to(o)&&oo(o),He&&Qe("")}),[ae,vo,to,He,Qe]),ho=N({getOptionId:j,defaultVisualFocusFirstIndex:D,onClick:fo,isChildSelectable:to,options:vo,inputRef:_e}),Co=ho.visualFocusItemIndex,go=ho.visualFocusItemId,xo=ho.onOptionClick;return i.createElement(C,{type:"text2",ref:Xe,className:t(k.combobox,S,p(k,c("size-"+P)),o(o({},k.empty,!so),k.stickyCategory,Ne)),id:T,"data-testid":we||u(b.COMBOBOX,T),ellipsis:!1,"data-vibe":F.COMBOBOX},i.createElement("div",{className:k.comboboxList,style:{maxHeight:q}},i.createElement(f,{ref:_e,value:Je,className:t(k.comboboxSearchWrapper,L),inputAriaLabel:Be,currentAriaResultId:go,id:"combobox-search",placeholder:V,size:P,disabled:Q,onChange:Qe,autoFocus:J,loading:ve,searchIconName:B,ariaExpanded:ro||so,ariaHasPopup:"listbox",searchResultsContainerId:T?"".concat(T,"-listbox"):R,debounceRate:Te,renderAction:Ve,hideRenderActionOnInput:We}),Ne&&i.createElement(I,{label:null==lo?void 0:lo.label,color:null==lo?void 0:lo.color,className:M}),so&&i.createElement(y,{stickyCategories:Ne,categories:Z,options:uo,itemsMap:bo,optionClassName:A,optionRenderer:Se,activeItemIndex:eo,onActiveCategoryChanged:mo,onOptionClick:xo,onOptionEnter:Ue,onOptionLeave:ge,optionLineHeight:_,shouldScrollToSelectedItem:ye,renderOnlyVisibleOptions:ke,maxOptionsWithoutScroll:Ee,visualFocusItemIndex:Co,id:T?"".concat(T,"-listbox"):R})),ro&&!so&&!ve&&(Ie?Ie():i.createElement("div",{className:k.comboboxNoResults},i.createElement("div",{className:k.comboboxMessageWrapper},i.createElement("span",{className:k.comboboxMessage},te)),ie&&!Q&&i.createElement(H,{className:k.addNewButton,size:P,kind:"tertiary",onClick:io},i.createElement("span",{className:k.buttonLabel},m(re)?re(Je):re)))))})),{sizes:h,iconTypes:g.iconTypes});export{E as default};
2
2
  //# sourceMappingURL=Combobox.js.map