@bikdotai/bik-component-library 0.0.840-tools-beta.5 → 0.0.841-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js +1 -1
  2. package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  3. package/dist/cjs/components/SearchFilter/index.js +1 -1
  4. package/dist/cjs/components/SearchFilter/index.js.map +1 -1
  5. package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
  6. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsChip.js +1 -1
  7. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsChip.js.map +1 -1
  8. package/dist/cjs/components/avatar/Avatar.js +1 -1
  9. package/dist/cjs/components/avatar/Avatar.js.map +1 -1
  10. package/dist/cjs/components/avatar/Avatar.styled.js +12 -4
  11. package/dist/cjs/components/avatar/Avatar.styled.js.map +1 -1
  12. package/dist/cjs/components/button/themes.js +11 -11
  13. package/dist/cjs/components/button/themes.js.map +1 -1
  14. package/dist/cjs/components/card-selector/CardSelector.js +1 -1
  15. package/dist/cjs/components/card-selector/CardSelector.js.map +1 -1
  16. package/dist/cjs/components/card-selector/CardSelectorGroup.js +1 -1
  17. package/dist/cjs/components/card-selector/CardSelectorGroup.js.map +1 -1
  18. package/dist/cjs/components/carousel/carousel.js +2 -2
  19. package/dist/cjs/components/carousel/carousel.js.map +1 -1
  20. package/dist/cjs/components/checkBox/CheckBox.js +1 -1
  21. package/dist/cjs/components/checkBox/CheckBox.js.map +1 -1
  22. package/dist/cjs/components/code-block/CodeBlock.js +2 -2
  23. package/dist/cjs/components/code-block/CodeBlock.js.map +1 -1
  24. package/dist/cjs/components/colourInput/ColourInput.js +1 -1
  25. package/dist/cjs/components/colourInput/ColourInput.js.map +1 -1
  26. package/dist/cjs/components/dashboard-review-popup/DashboardReviewPopUp.js +1 -1
  27. package/dist/cjs/components/dashboard-review-popup/DashboardReviewPopUp.js.map +1 -1
  28. package/dist/cjs/components/dot-pulse/DotPulse.js +3 -3
  29. package/dist/cjs/components/dot-pulse/DotPulse.js.map +1 -1
  30. package/dist/cjs/components/dropShadow/DropShadow.js +1 -1
  31. package/dist/cjs/components/dropShadow/DropShadow.js.map +1 -1
  32. package/dist/cjs/components/dropdown/ChipInput.js +1 -1
  33. package/dist/cjs/components/dropdown/ChipInput.js.map +1 -1
  34. package/dist/cjs/components/dropdown/DropdownPopover/index.js +1 -1
  35. package/dist/cjs/components/dropdown/DropdownPopover/index.js.map +1 -1
  36. package/dist/cjs/components/dropdown-button/DropdownButton.js +1 -1
  37. package/dist/cjs/components/dropdown-button/DropdownButton.js.map +1 -1
  38. package/dist/cjs/components/floater/floater.js +1 -1
  39. package/dist/cjs/components/floater/floater.js.map +1 -1
  40. package/dist/cjs/components/input/Input.js +1 -1
  41. package/dist/cjs/components/input/Input.js.map +1 -1
  42. package/dist/cjs/components/modals/styledModal.js +2 -2
  43. package/dist/cjs/components/modals/styledModal.js.map +1 -1
  44. package/dist/cjs/components/multi-level-dropdown/MenuItem.js +1 -1
  45. package/dist/cjs/components/multi-level-dropdown/MenuItem.js.map +1 -1
  46. package/dist/cjs/components/pagination/Pagination.js +1 -1
  47. package/dist/cjs/components/pagination/Pagination.js.map +1 -1
  48. package/dist/cjs/components/progress-bar/CircularProgressBar.js +1 -1
  49. package/dist/cjs/components/progress-bar/CircularProgressBar.js.map +1 -1
  50. package/dist/cjs/components/progress-bar/ProgressBarComponent.js +2 -2
  51. package/dist/cjs/components/progress-bar/ProgressBarComponent.js.map +1 -1
  52. package/dist/cjs/components/progress-bar-v2/ProgressBarV2.js +17 -17
  53. package/dist/cjs/components/progress-bar-v2/ProgressBarV2.js.map +1 -1
  54. package/dist/cjs/components/radioButton/RadioButton.js +1 -1
  55. package/dist/cjs/components/radioButton/RadioButton.js.map +1 -1
  56. package/dist/cjs/components/radioList/RadioList.js +1 -1
  57. package/dist/cjs/components/radioList/RadioList.js.map +1 -1
  58. package/dist/cjs/components/searchBar/searchBar.js +1 -1
  59. package/dist/cjs/components/searchBar/searchBar.js.map +1 -1
  60. package/dist/cjs/components/shimmer-image/ShimmerImage.js +1 -1
  61. package/dist/cjs/components/shimmer-image/ShimmerImage.js.map +1 -1
  62. package/dist/cjs/components/side-modal/SideModal.js +1 -1
  63. package/dist/cjs/components/side-modal/SideModal.js.map +1 -1
  64. package/dist/cjs/components/spinner/Spinner.js +3 -3
  65. package/dist/cjs/components/spinner/Spinner.js.map +1 -1
  66. package/dist/cjs/components/star-rating/Star.js +1 -1
  67. package/dist/cjs/components/star-rating/Star.js.map +1 -1
  68. package/dist/cjs/components/star-rating/StarRating.js +2 -2
  69. package/dist/cjs/components/star-rating/StarRating.js.map +1 -1
  70. package/dist/cjs/components/states/StateComponent.js +1 -1
  71. package/dist/cjs/components/states/StateComponent.js.map +1 -1
  72. package/dist/cjs/components/stepper/Stepper.js +1 -1
  73. package/dist/cjs/components/stepper/Stepper.js.map +1 -1
  74. package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
  75. package/dist/cjs/components/template-preview/TemplatePreview.js.map +1 -1
  76. package/dist/cjs/components/testimonial-card/TestimonialCard.js +1 -1
  77. package/dist/cjs/components/testimonial-card/TestimonialCard.js.map +1 -1
  78. package/dist/cjs/components/thumbnail/Thumbnail.js +1 -1
  79. package/dist/cjs/components/thumbnail/Thumbnail.js.map +1 -1
  80. package/dist/cjs/components/unsatisfactory-response-list/UnsatisfactoryResponseList.js +1 -1
  81. package/dist/cjs/components/unsatisfactory-response-list/UnsatisfactoryResponseList.js.map +1 -1
  82. package/dist/cjs/components/zeroState/ZeroState.js +3 -3
  83. package/dist/cjs/components/zeroState/ZeroState.js.map +1 -1
  84. package/dist/cjs/icons/Media/Visual/FormkitNeutral.js +2 -0
  85. package/dist/cjs/icons/Media/Visual/FormkitNeutral.js.map +1 -0
  86. package/dist/cjs/icons/Media/Visual/FormkitSad.js +2 -0
  87. package/dist/cjs/icons/Media/Visual/FormkitSad.js.map +1 -0
  88. package/dist/cjs/icons/index.js +1 -1
  89. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js +66 -61
  90. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  91. package/dist/esm/components/SearchFilter/index.js +11 -10
  92. package/dist/esm/components/SearchFilter/index.js.map +1 -1
  93. package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
  94. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsChip.js +11 -10
  95. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsChip.js.map +1 -1
  96. package/dist/esm/components/avatar/Avatar.d.ts +2 -1
  97. package/dist/esm/components/avatar/Avatar.js +34 -24
  98. package/dist/esm/components/avatar/Avatar.js.map +1 -1
  99. package/dist/esm/components/avatar/Avatar.styled.d.ts +1 -0
  100. package/dist/esm/components/avatar/Avatar.styled.js +17 -8
  101. package/dist/esm/components/avatar/Avatar.styled.js.map +1 -1
  102. package/dist/esm/components/button/themes.d.ts +1 -0
  103. package/dist/esm/components/button/themes.js +61 -51
  104. package/dist/esm/components/button/themes.js.map +1 -1
  105. package/dist/esm/components/card-selector/CardSelector.js +11 -9
  106. package/dist/esm/components/card-selector/CardSelector.js.map +1 -1
  107. package/dist/esm/components/card-selector/CardSelectorGroup.js +1 -0
  108. package/dist/esm/components/card-selector/CardSelectorGroup.js.map +1 -1
  109. package/dist/esm/components/carousel/carousel.js +8 -8
  110. package/dist/esm/components/carousel/carousel.js.map +1 -1
  111. package/dist/esm/components/checkBox/CheckBox.js +8 -5
  112. package/dist/esm/components/checkBox/CheckBox.js.map +1 -1
  113. package/dist/esm/components/code-block/CodeBlock.js +14 -14
  114. package/dist/esm/components/code-block/CodeBlock.js.map +1 -1
  115. package/dist/esm/components/colourInput/ColourInput.js +11 -10
  116. package/dist/esm/components/colourInput/ColourInput.js.map +1 -1
  117. package/dist/esm/components/dashboard-review-popup/DashboardReviewPopUp.js +28 -21
  118. package/dist/esm/components/dashboard-review-popup/DashboardReviewPopUp.js.map +1 -1
  119. package/dist/esm/components/dot-pulse/DotPulse.js +15 -15
  120. package/dist/esm/components/dot-pulse/DotPulse.js.map +1 -1
  121. package/dist/esm/components/dropShadow/DropShadow.js +6 -6
  122. package/dist/esm/components/dropShadow/DropShadow.js.map +1 -1
  123. package/dist/esm/components/dropdown/ChipInput.js +10 -9
  124. package/dist/esm/components/dropdown/ChipInput.js.map +1 -1
  125. package/dist/esm/components/dropdown/DropdownPopover/index.js +26 -25
  126. package/dist/esm/components/dropdown/DropdownPopover/index.js.map +1 -1
  127. package/dist/esm/components/dropdown-button/DropdownButton.js +13 -13
  128. package/dist/esm/components/dropdown-button/DropdownButton.js.map +1 -1
  129. package/dist/esm/components/floater/floater.js +14 -13
  130. package/dist/esm/components/floater/floater.js.map +1 -1
  131. package/dist/esm/components/input/Input.js +35 -34
  132. package/dist/esm/components/input/Input.js.map +1 -1
  133. package/dist/esm/components/input/Input.model.d.ts +1 -0
  134. package/dist/esm/components/modals/styledModal.js +6 -5
  135. package/dist/esm/components/modals/styledModal.js.map +1 -1
  136. package/dist/esm/components/multi-level-dropdown/MenuItem.js +28 -27
  137. package/dist/esm/components/multi-level-dropdown/MenuItem.js.map +1 -1
  138. package/dist/esm/components/pagination/Pagination.js +7 -7
  139. package/dist/esm/components/pagination/Pagination.js.map +1 -1
  140. package/dist/esm/components/progress-bar/CircularProgressBar.js +61 -50
  141. package/dist/esm/components/progress-bar/CircularProgressBar.js.map +1 -1
  142. package/dist/esm/components/progress-bar/ProgressBarComponent.js +14 -13
  143. package/dist/esm/components/progress-bar/ProgressBarComponent.js.map +1 -1
  144. package/dist/esm/components/progress-bar-v2/ProgressBarV2.js +57 -39
  145. package/dist/esm/components/progress-bar-v2/ProgressBarV2.js.map +1 -1
  146. package/dist/esm/components/radioButton/RadioButton.js +10 -9
  147. package/dist/esm/components/radioButton/RadioButton.js.map +1 -1
  148. package/dist/esm/components/radioList/RadioList.js +28 -19
  149. package/dist/esm/components/radioList/RadioList.js.map +1 -1
  150. package/dist/esm/components/searchBar/searchBar.js +11 -10
  151. package/dist/esm/components/searchBar/searchBar.js.map +1 -1
  152. package/dist/esm/components/shimmer-image/ShimmerImage.js +19 -18
  153. package/dist/esm/components/shimmer-image/ShimmerImage.js.map +1 -1
  154. package/dist/esm/components/side-modal/SideModal.js +13 -5
  155. package/dist/esm/components/side-modal/SideModal.js.map +1 -1
  156. package/dist/esm/components/spinner/Spinner.js +19 -11
  157. package/dist/esm/components/spinner/Spinner.js.map +1 -1
  158. package/dist/esm/components/star-rating/Star.d.ts +1 -0
  159. package/dist/esm/components/star-rating/Star.js +32 -27
  160. package/dist/esm/components/star-rating/Star.js.map +1 -1
  161. package/dist/esm/components/star-rating/StarRating.js +17 -16
  162. package/dist/esm/components/star-rating/StarRating.js.map +1 -1
  163. package/dist/esm/components/states/StateComponent.js +47 -30
  164. package/dist/esm/components/states/StateComponent.js.map +1 -1
  165. package/dist/esm/components/stepper/Stepper.js +24 -16
  166. package/dist/esm/components/stepper/Stepper.js.map +1 -1
  167. package/dist/esm/components/template-preview/TemplatePreview.js +41 -40
  168. package/dist/esm/components/template-preview/TemplatePreview.js.map +1 -1
  169. package/dist/esm/components/testimonial-card/TestimonialCard.js +5 -4
  170. package/dist/esm/components/testimonial-card/TestimonialCard.js.map +1 -1
  171. package/dist/esm/components/thumbnail/Thumbnail.js +3 -3
  172. package/dist/esm/components/thumbnail/Thumbnail.js.map +1 -1
  173. package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryResponseList.js +19 -18
  174. package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryResponseList.js.map +1 -1
  175. package/dist/esm/components/zeroState/ZeroState.js +20 -13
  176. package/dist/esm/components/zeroState/ZeroState.js.map +1 -1
  177. package/dist/esm/icons/Media/Visual/FormkitNeutral.js +58 -0
  178. package/dist/esm/icons/Media/Visual/FormkitNeutral.js.map +1 -0
  179. package/dist/esm/icons/Media/Visual/FormkitSad.js +61 -0
  180. package/dist/esm/icons/Media/Visual/FormkitSad.js.map +1 -0
  181. package/dist/esm/icons/Media/Visual/index.d.ts +2 -0
  182. package/dist/esm/icons/index.d.ts +25 -25
  183. package/dist/esm/icons/index.js +420 -416
  184. package/dist/esm/icons/index.js.map +1 -1
  185. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/components/dropdown/DropdownPopover/index.tsx"],"sourcesContent":["import React, {\n\tLegacyRef,\n\tRef,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport { usePopper } from 'react-popper';\nimport { DropShadow } from '@src/components/dropShadow';\nimport { Placement, Tooltip } from '@src/components/tooltips';\nimport { COLORS } from '@src/constants/Theme';\nimport { OpenDropdownContainer, OverLapAbs } from '../Common.styled';\nimport { OpenedDropdown } from '../OpenedDropdown';\nimport { OpenDropdownProps } from '../type';\n\ntype DropdownProps = OpenDropdownProps & {\n\tisLoading?: boolean;\n\tchildren?: React.ReactNode;\n\tdisabled?: boolean;\n\tonDropdownOpen?: () => void;\n\tonDropdownVisbilityChange?: (isOpen: boolean) => void;\n\ttooltipContent?: string;\n\ttooltipDirection?: Placement;\n\tshowTooltipArrow?: boolean;\n\tallowEvents?: boolean;\n\t'data-test'?: string;\n\tisChildLoading?: boolean;\n\t/**\n\t * If true, forces the dropdown to remain open regardless of user interaction or internal state.\n\t * This prop overrides the internal openDropdown state, ensuring the dropdown stays open.\n\t * Use this prop when you need to programmatically control the dropdown's visibility from a parent component.\n\t */\n\tforceOpen?: boolean;\n};\n\nexport const DropdownPopover = React.forwardRef<\n\t{\n\t\topenDropdown: boolean;\n\t},\n\tDropdownProps\n>(\n\t(\n\t\t{\n\t\t\tchildren,\n\t\t\tonDropdownVisbilityChange,\n\t\t\tversion = '1.0',\n\t\t\ttooltipContent,\n\t\t\ttooltipDirection,\n\t\t\tshowTooltipArrow,\n\t\t\tisChildLoading,\n\t\t\tforceOpen,\n\t\t\t...openDropdownProps\n\t\t},\n\t\tunTypedRef,\n\t) => {\n\t\tconst ref = unTypedRef as React.RefObject<{ openDropdown: boolean }>;\n\t\tconst [openDropdown, setDropdownVisibility] = useState(false);\n\t\tconst [isHovering, setIsHovering] = useState(false);\n\t\tconst [referenceElement, setReferenceElement] = useState(null);\n\t\tconst [popperElement, setPopperElement] = useState(null);\n\t\tconst headerRef = useRef(null);\n\n\t\tconst { styles, attributes } = usePopper(referenceElement, popperElement, {\n\t\t\tplacement: openDropdownProps.placement,\n\t\t\tstrategy: openDropdownProps.strategy,\n\t\t});\n\n\t\tconst onCloseHandle = (data) => {\n\t\t\tif (version === '2.0' && openDropdownProps.isMultiSelect && data) {\n\t\t\t\topenDropdownProps.onSelect?.([...data]);\n\t\t\t}\n\t\t\tsetDropdownVisibility(false);\n\t\t\topenDropdownProps?.onClose?.();\n\t\t};\n\n\t\tuseImperativeHandle(\n\t\t\tref,\n\t\t\t() => {\n\t\t\t\treturn {\n\t\t\t\t\topenDropdown: openDropdown,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[],\n\t\t);\n\n\t\tuseEffect(() => {\n\t\t\tif (ref?.current) ref.current.openDropdown = openDropdown;\n\t\t}, [openDropdown]);\n\n\t\tuseEffect(() => {\n\t\t\tonDropdownVisbilityChange?.(openDropdown);\n\t\t}, [openDropdown]);\n\n\t\tconst dropDownComponent = () => {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tposition: 'relative',\n\t\t\t\t\t\t\t...(version === '3.0' && {\n\t\t\t\t\t\t\t\tbackgroundColor:\n\t\t\t\t\t\t\t\t\topenDropdown || isHovering\n\t\t\t\t\t\t\t\t\t\t? COLORS.surface.hovered\n\t\t\t\t\t\t\t\t\t\t: 'transparent',\n\t\t\t\t\t\t\t\ttransition: 'background-color 0.3s ease',\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t}}\n\t\t\t\t\t\t/** This assigment is mentioned as per react-popper's docs, so typecasting */\n\t\t\t\t\t\tref={setReferenceElement as LegacyRef<HTMLDivElement>}\n\t\t\t\t\t\tonMouseEnter={\n\t\t\t\t\t\t\tversion === '3.0' ? () => setIsHovering(true) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonMouseLeave={\n\t\t\t\t\t\t\tversion === '3.0' ? () => setIsHovering(false) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<OverLapAbs\n\t\t\t\t\t\t\tref={headerRef}\n\t\t\t\t\t\t\tallowEvents={openDropdownProps.allowEvents}\n\t\t\t\t\t\t\tdisabled={openDropdownProps.disabled}\n\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\topenDropdownProps.onDropdownOpen?.();\n\t\t\t\t\t\t\t\tif (!openDropdown) {\n\t\t\t\t\t\t\t\t\tif (!openDropdownProps.disabled) setDropdownVisibility(true);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tsetDropdownVisibility(false);\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tisChildLoading={isChildLoading}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{openDropdownProps.allowEvents ? children : null}\n\t\t\t\t\t\t</OverLapAbs>\n\t\t\t\t\t\t{openDropdownProps.allowEvents ? null : children}\n\t\t\t\t\t</div>\n\t\t\t\t\t{(openDropdown || forceOpen) && (\n\t\t\t\t\t\t<OpenDropdownContainer\n\t\t\t\t\t\t\t/** This assigment is mentioned as per react-popper's docs, so typecasting */\n\t\t\t\t\t\t\tref={setPopperElement as Ref<HTMLDivElement>}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t...styles['popper'],\n\t\t\t\t\t\t\t\tzIndex: openDropdownProps.dropdownZIndex ?? 3,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t{...attributes['popper']}\n\t\t\t\t\t\t\tdata-test={openDropdownProps['data-test']}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<DropShadow\n\t\t\t\t\t\t\t\tlevel={'z2'}\n\t\t\t\t\t\t\t\tposition={'down'}\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tborderRadius: version === '3.0' ? 4 : 8,\n\t\t\t\t\t\t\t\t\tboxShadow: '0 2px 8px 0 rgba(0, 0, 0, 0.12)',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<OpenedDropdown\n\t\t\t\t\t\t\t\t\t{...openDropdownProps}\n\t\t\t\t\t\t\t\t\tonSelect={(options) => {\n\t\t\t\t\t\t\t\t\t\tif (version === '2.0' && openDropdownProps.isMultiSelect) {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\topenDropdownProps.onSelect?.(options);\n\t\t\t\t\t\t\t\t\t\t\tsetDropdownVisibility(false);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tonClose={onCloseHandle}\n\t\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t\t\theaderRef={headerRef}\n\t\t\t\t\t\t\t\t\tzeroState={openDropdownProps?.zeroState}\n\t\t\t\t\t\t\t\t\tisDraggable={openDropdownProps.isDraggable}\n\t\t\t\t\t\t\t\t\tonOptionsReorder={openDropdownProps.onOptionsReorder}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</DropShadow>\n\t\t\t\t\t\t</OpenDropdownContainer>\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t);\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{!openDropdown && !forceOpen && tooltipContent !== undefined ? (\n\t\t\t\t\t<Tooltip\n\t\t\t\t\t\tbody={tooltipContent}\n\t\t\t\t\t\tplacement={tooltipDirection}\n\t\t\t\t\t\thideArrow={!showTooltipArrow}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div data-test={openDropdownProps['data-test']}>\n\t\t\t\t\t\t\t{dropDownComponent()}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t) : (\n\t\t\t\t\tdropDownComponent()\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t},\n);\n\nDropdownPopover.displayName = 'DropdownPopover';\n"],"names":["DropdownPopover","React","children","onDropdownVisbilityChange","version","tooltipContent","tooltipDirection","showTooltipArrow","isChildLoading","forceOpen","openDropdownProps","unTypedRef","ref","openDropdown","setDropdownVisibility","useState","isHovering","setIsHovering","referenceElement","setReferenceElement","popperElement","setPopperElement","headerRef","useRef","styles","attributes","usePopper","onCloseHandle","data","useImperativeHandle","useEffect","dropDownComponent","jsxs","Fragment","COLORS","jsx","OverLapAbs","e","OpenDropdownContainer","DropShadow","OpenedDropdown","options","Tooltip"],"mappings":"2bAoCaA,EAAkBC,EAAAA,QAAM,WAMpC,CACC,CACC,SAAAC,EACA,0BAAAC,EACA,QAAAC,EAAU,MACV,eAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,UAAAC,EACA,GAAGC,CAAA,EAEJC,IACI,CACJ,MAAMC,EAAMD,EACN,CAACE,EAAcC,CAAqB,EAAIC,EAAAA,SAAS,EAAK,EACtD,CAACC,EAAYC,CAAa,EAAIF,EAAAA,SAAS,EAAK,EAC5C,CAACG,EAAkBC,CAAmB,EAAIJ,EAAAA,SAAS,IAAI,EACvD,CAACK,EAAeC,CAAgB,EAAIN,EAAAA,SAAS,IAAI,EACjDO,EAAYC,EAAAA,OAAO,IAAI,EAEvB,CAAE,OAAAC,EAAQ,WAAAC,CAAA,EAAeC,EAAAA,UAAUR,EAAkBE,EAAe,CACzE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GG,EAAO,OACV,OAAQd,EAAkB,gBAAkB,CAAA,EAE5C,GAAGe,EAAW,OACf,YAAWf,EAAkB,WAAW,EAExC,SAAAyB,EAAAA,IAACI,EAAAA,WAAA,CACA,MAAO,KACP,SAAU,OACV,MAAO,CACN,aAAcnC,IAAY,MAAQ,EAAI,EACtC,UAAW,iCAAA,EAGZ,SAAA+B,EAAAA,IAACK,EAAAA,eAAA,CACC,GAAG9B,EACJ,SAAW+B,GAAY,CAClBrC,IAAY,OAASM,EAAkB,gBAG1CA,EAAkB,WAAW+B,CAAO,EACpC3B,EAAsB,EAAK,EAE7B,EACA,QAASa,EACT,QAAAvB,EACA,UAAAkB,EACA,UAAWZ,GAAmB,UAC9B,YAAaA,EAAkB,YAC/B,iBAAkBA,EAAkB,gBAAA,CAAA,CACrC,CAAA,CACD,CAAA,CACD,EAEF,EAIF,yBAEG,SAAA,CAACG,GAAgB,CAACJ,GAAaJ,IAAmB,OAClD8B,EAAAA,IAACO,EAAAA,QAAA,CACA,KAAMrC,EACN,UAAWC,EACX,UAAW,CAACC,EAEZ,eAAC,MAAA,CAAI,YAAWG,EAAkB,WAAW,EAC3C,YAAkB,CACpB,CAAA,CAAA,EAGDqB,GAAkB,CAEpB,CAEF,CACD,EAEA/B,EAAgB,YAAc"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/dropdown/DropdownPopover/index.tsx"],"sourcesContent":["import React, {\n\tLegacyRef,\n\tRef,\n\tuseEffect,\n\tuseImperativeHandle,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport { usePopper } from 'react-popper';\nimport { DropShadow } from '@src/components/dropShadow';\nimport { Placement, Tooltip } from '@src/components/tooltips';\nimport { COLORS } from '@src/constants/Theme';\nimport { OpenDropdownContainer, OverLapAbs } from '../Common.styled';\nimport { OpenedDropdown } from '../OpenedDropdown';\nimport { OpenDropdownProps } from '../type';\n\ntype DropdownProps = OpenDropdownProps & {\n\tisLoading?: boolean;\n\tchildren?: React.ReactNode;\n\tdisabled?: boolean;\n\tonDropdownOpen?: () => void;\n\tonDropdownVisbilityChange?: (isOpen: boolean) => void;\n\ttooltipContent?: string;\n\ttooltipDirection?: Placement;\n\tshowTooltipArrow?: boolean;\n\tallowEvents?: boolean;\n\t'data-test'?: string;\n\tisChildLoading?: boolean;\n\t/**\n\t * If true, forces the dropdown to remain open regardless of user interaction or internal state.\n\t * This prop overrides the internal openDropdown state, ensuring the dropdown stays open.\n\t * Use this prop when you need to programmatically control the dropdown's visibility from a parent component.\n\t */\n\tforceOpen?: boolean;\n};\n\nexport const DropdownPopover = React.forwardRef<\n\t{\n\t\topenDropdown: boolean;\n\t},\n\tDropdownProps\n>(\n\t(\n\t\t{\n\t\t\tchildren,\n\t\t\tonDropdownVisbilityChange,\n\t\t\tversion = '1.0',\n\t\t\ttooltipContent,\n\t\t\ttooltipDirection,\n\t\t\tshowTooltipArrow,\n\t\t\tisChildLoading,\n\t\t\tforceOpen,\n\t\t\t...openDropdownProps\n\t\t},\n\t\tunTypedRef,\n\t) => {\n\t\tconst ref = unTypedRef as React.RefObject<{ openDropdown: boolean }>;\n\t\tconst [openDropdown, setDropdownVisibility] = useState(false);\n\t\tconst [isHovering, setIsHovering] = useState(false);\n\t\tconst [referenceElement, setReferenceElement] = useState(null);\n\t\tconst [popperElement, setPopperElement] = useState(null);\n\t\tconst headerRef = useRef(null);\n\n\t\tconst { styles, attributes } = usePopper(referenceElement, popperElement, {\n\t\t\tplacement: openDropdownProps.placement,\n\t\t\tstrategy: openDropdownProps.strategy,\n\t\t});\n\n\t\tconst onCloseHandle = (data) => {\n\t\t\tif (version === '2.0' && openDropdownProps.isMultiSelect && data) {\n\t\t\t\topenDropdownProps.onSelect?.([...data]);\n\t\t\t}\n\t\t\tsetDropdownVisibility(false);\n\t\t\topenDropdownProps?.onClose?.();\n\t\t};\n\n\t\tuseImperativeHandle(\n\t\t\tref,\n\t\t\t() => {\n\t\t\t\treturn {\n\t\t\t\t\topenDropdown: openDropdown,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[],\n\t\t);\n\n\t\tuseEffect(() => {\n\t\t\tif (ref?.current) ref.current.openDropdown = openDropdown;\n\t\t}, [openDropdown]);\n\n\t\tuseEffect(() => {\n\t\t\tonDropdownVisbilityChange?.(openDropdown);\n\t\t}, [openDropdown]);\n\n\t\tconst dropDownComponent = () => {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tposition: 'relative',\n\t\t\t\t\t\t\t...(version === '3.0' && {\n\t\t\t\t\t\t\t\tbackgroundColor:\n\t\t\t\t\t\t\t\t\topenDropdown || isHovering\n\t\t\t\t\t\t\t\t\t\t? COLORS.surface.hovered\n\t\t\t\t\t\t\t\t\t\t: 'transparent',\n\t\t\t\t\t\t\t\ttransition: 'background-color 0.3s ease',\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t}}\n\t\t\t\t\t\t/** This assigment is mentioned as per react-popper's docs, so typecasting */\n\t\t\t\t\t\tref={setReferenceElement as LegacyRef<HTMLDivElement>}\n\t\t\t\t\t\tonMouseEnter={\n\t\t\t\t\t\t\tversion === '3.0' ? () => setIsHovering(true) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonMouseLeave={\n\t\t\t\t\t\t\tversion === '3.0' ? () => setIsHovering(false) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<OverLapAbs\n\t\t\t\t\t\t\tref={headerRef}\n\t\t\t\t\t\t\tdata-testid=\"dropdown-overlay\"\n\t\t\t\t\t\t\tallowEvents={openDropdownProps.allowEvents}\n\t\t\t\t\t\t\tdisabled={openDropdownProps.disabled}\n\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\topenDropdownProps.onDropdownOpen?.();\n\t\t\t\t\t\t\t\tif (!openDropdown) {\n\t\t\t\t\t\t\t\t\tif (!openDropdownProps.disabled) setDropdownVisibility(true);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tsetDropdownVisibility(false);\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tisChildLoading={isChildLoading}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{openDropdownProps.allowEvents ? children : null}\n\t\t\t\t\t\t</OverLapAbs>\n\t\t\t\t\t\t{openDropdownProps.allowEvents ? null : children}\n\t\t\t\t\t</div>\n\t\t\t\t\t{(openDropdown || forceOpen) && (\n\t\t\t\t\t\t<OpenDropdownContainer\n\t\t\t\t\t\t\t/** This assigment is mentioned as per react-popper's docs, so typecasting */\n\t\t\t\t\t\t\tref={setPopperElement as Ref<HTMLDivElement>}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t...styles['popper'],\n\t\t\t\t\t\t\t\tzIndex: openDropdownProps.dropdownZIndex ?? 3,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t{...attributes['popper']}\n\t\t\t\t\t\t\tdata-test={openDropdownProps['data-test']}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<DropShadow\n\t\t\t\t\t\t\t\tlevel={'z2'}\n\t\t\t\t\t\t\t\tposition={'down'}\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tborderRadius: version === '3.0' ? 4 : 8,\n\t\t\t\t\t\t\t\t\tboxShadow: '0 2px 8px 0 rgba(0, 0, 0, 0.12)',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<OpenedDropdown\n\t\t\t\t\t\t\t\t\t{...openDropdownProps}\n\t\t\t\t\t\t\t\t\tonSelect={(options) => {\n\t\t\t\t\t\t\t\t\t\tif (version === '2.0' && openDropdownProps.isMultiSelect) {\n\t\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\topenDropdownProps.onSelect?.(options);\n\t\t\t\t\t\t\t\t\t\t\tsetDropdownVisibility(false);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tonClose={onCloseHandle}\n\t\t\t\t\t\t\t\t\tversion={version}\n\t\t\t\t\t\t\t\t\theaderRef={headerRef}\n\t\t\t\t\t\t\t\t\tzeroState={openDropdownProps?.zeroState}\n\t\t\t\t\t\t\t\t\tisDraggable={openDropdownProps.isDraggable}\n\t\t\t\t\t\t\t\t\tonOptionsReorder={openDropdownProps.onOptionsReorder}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</DropShadow>\n\t\t\t\t\t\t</OpenDropdownContainer>\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t);\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{!openDropdown && !forceOpen && tooltipContent !== undefined ? (\n\t\t\t\t\t<Tooltip\n\t\t\t\t\t\tbody={tooltipContent}\n\t\t\t\t\t\tplacement={tooltipDirection}\n\t\t\t\t\t\thideArrow={!showTooltipArrow}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div data-test={openDropdownProps['data-test']}>\n\t\t\t\t\t\t\t{dropDownComponent()}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t) : (\n\t\t\t\t\tdropDownComponent()\n\t\t\t\t)}\n\t\t\t</>\n\t\t);\n\t},\n);\n\nDropdownPopover.displayName = 'DropdownPopover';\n"],"names":["DropdownPopover","React","children","onDropdownVisbilityChange","version","tooltipContent","tooltipDirection","showTooltipArrow","isChildLoading","forceOpen","openDropdownProps","unTypedRef","ref","openDropdown","setDropdownVisibility","useState","isHovering","setIsHovering","referenceElement","setReferenceElement","popperElement","setPopperElement","headerRef","useRef","styles","attributes","usePopper","onCloseHandle","data","useImperativeHandle","useEffect","dropDownComponent","jsxs","Fragment","COLORS","jsx","Over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EACN,UAAWC,EACX,UAAW,CAACC,EAEZ,eAAC,MAAA,CAAI,YAAWG,EAAkB,WAAW,EAC3C,YAAkB,CACpB,CAAA,CAAA,EAGDqB,GAAkB,CAEpB,CAEF,CACD,EAEA/B,EAAgB,YAAc"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),u=require("../dropdown/DropdownPopover/index.js"),b=require("../button/themes.js"),i=require("./DropdownButton.style.js"),c=require("../icon-button/IconButton.js"),p=require("../tooltips/Tooltip.js"),x=require("../spinner/Spinner.js"),a=require("../button/Button.js"),y=o=>{const r=!!o.iconButtonProps,s=r?o.iconButtonProps?.disabled:o.buttonProps?.disabled;if(r){const{iconButtonProps:n,iconButtonTooltip:e}=o,d=t.jsx(c.IconButton,{...n,style:{borderRadius:"0px",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px"}});return t.jsxs(i.DropdownButtonStyle,{type:void 0,disabled:s,isIconButton:!0,iconButtonType:n?.iconButtonType??"primary",iconButtonSize:n?.size??"default",children:[e?t.jsx(p.Tooltip,{body:e.body,tooltipContent:e.tooltipContent,placement:e.placement,children:d}):d,t.jsx("div",{className:"dd-button-divider"}),t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(u.DropdownPopover,{...o.dropdownProps,isChildLoading:!1,children:t.jsx(c.IconButton,{Icon:o.iconProps,iconButtonType:n?.iconButtonType??"primary",size:n?.size,disabled:s,style:{display:"flex",borderRadius:"0px",borderTopRightRadius:"4px",borderBottomRightRadius:"4px"}})})})]})}const{onClick:B,LeadingIcon:P,LeadingIconStyles:R,IconComponent:g,TrailingIcon:m,...l}=o.buttonProps;return t.jsxs(i.DropdownButtonStyle,{type:o.buttonProps.buttonType,disabled:o.buttonProps.disabled,size:o.buttonProps.size,children:[o.buttonProps?.isLoading&&t.jsx(i.LoaderContainer,{type:o.buttonProps.buttonType,children:t.jsx(x.Spinner,{className:"spinner",size:"small",color:b.SpinnerColorMap(o.buttonProps.buttonType||"primary",o.buttonProps.inverse)})}),t.jsx(a.Button,{...o.buttonProps,isLoading:!1,style:{borderRadius:"0px",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px",borderRight:"0px",...o.buttonProps?.size==="xs"?{border:"none",borderRadius:"0px"}:{}}}),t.jsx("div",{className:"dd-button-divider"}),t.jsx(u.DropdownPopover,{...o.dropdownProps,isChildLoading:o.buttonProps?.isLoading,children:t.jsx(a.Button,{...l,isLoading:!1,buttonText:"",TrailingIcon:o.iconProps,style:{borderRadius:"0px",borderTopRightRadius:"4px",borderBottomRightRadius:"4px",...o.buttonProps?.size==="xs"?{border:"none",borderRadius:"0px"}:{}}})})]})};exports.DropdownButton=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),u=require("../dropdown/DropdownPopover/index.js"),b=require("../button/themes.js"),i=require("./DropdownButton.style.js"),a=require("../icon-button/IconButton.js"),p=require("../tooltips/Tooltip.js"),x=require("../spinner/Spinner.js"),c=require("../button/Button.js"),y=o=>{const r=!!o.iconButtonProps,s=r?o.iconButtonProps?.disabled:o.buttonProps?.disabled;if(r){const{iconButtonProps:n,iconButtonTooltip:e}=o,d=t.jsx(a.IconButton,{...n,style:{borderRadius:"0px",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px"}});return t.jsxs(i.DropdownButtonStyle,{type:void 0,disabled:s,isIconButton:!0,iconButtonType:n?.iconButtonType??"primary",iconButtonSize:n?.size??"default",children:[e?t.jsx(p.Tooltip,{body:e.body,tooltipContent:e.tooltipContent,placement:e.placement,children:d}):d,t.jsx("div",{className:"dd-button-divider"}),t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(u.DropdownPopover,{...o.dropdownProps,isChildLoading:!1,children:t.jsx(a.IconButton,{Icon:o.iconProps,iconButtonType:n?.iconButtonType??"primary",size:n?.size,disabled:s,style:{display:"flex",borderRadius:"0px",borderTopRightRadius:"4px",borderBottomRightRadius:"4px"}})})})]})}const{onClick:B,LeadingIcon:P,LeadingIconStyles:R,IconComponent:g,TrailingIcon:h,...l}=o.buttonProps;return t.jsxs(i.DropdownButtonStyle,{type:o.buttonProps.buttonType,disabled:o.buttonProps.disabled,size:o.buttonProps.size,children:[o.buttonProps?.isLoading&&t.jsx(i.LoaderContainer,{type:o.buttonProps.buttonType,children:t.jsx(x.Spinner,{className:"spinner",size:"small",color:b.SpinnerColorMap(o.buttonProps.buttonType||"primary",o.buttonProps.inverse)})}),t.jsx(c.Button,{...o.buttonProps,isLoading:!1,style:{borderRadius:"0px",borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px",borderRight:"0px",...o.buttonProps?.size==="xs"?{border:"none",boxShadow:"none",borderRadius:"0px"}:{}}}),t.jsx("div",{className:"dd-button-divider"}),t.jsx(u.DropdownPopover,{...o.dropdownProps,isChildLoading:o.buttonProps?.isLoading,children:t.jsx(c.Button,{...l,isLoading:!1,buttonText:"",TrailingIcon:o.iconProps,style:{borderRadius:"0px",borderTopRightRadius:"4px",borderBottomRightRadius:"4px",...o.buttonProps?.size==="xs"?{border:"none",boxShadow:"none",borderRadius:"0px"}:{}}})})]})};exports.DropdownButton=y;
2
2
  //# sourceMappingURL=DropdownButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownButton.js","sources":["../../../../src/components/dropdown-button/DropdownButton.tsx"],"sourcesContent":["import React from 'react';\nimport { DropdownPopover, DropdownProps } from '@src/components/dropdown';\nimport { Button } from '../button';\nimport { ButtonProps } from '../button/model';\nimport { SpinnerColorMap } from '../button/themes';\nimport { IconButton } from '../icon-button';\nimport { IconButtonProps } from '../icon-button/model';\nimport { Spinner } from '../spinner';\nimport { Placement, Tooltip } from '../tooltips';\nimport { DropdownButtonStyle, LoaderContainer } from './DropdownButton.style';\n\nexport interface DropdownButtonProps {\n\tdropdownProps: DropdownProps;\n\ticonProps: React.FunctionComponent<React.SVGAttributes<SVGElement>>;\n\tbuttonProps?: ButtonProps;\n\ticonButtonProps?: IconButtonProps;\n\t/**\n\t * Optional tooltip shown only on the main icon button (icon mode),\n\t * not on the dropdown/chevron trigger.\n\t */\n\ticonButtonTooltip?: {\n\t\tbody?: string;\n\t\ttooltipContent?: JSX.Element;\n\t\tplacement?: Placement;\n\t};\n}\n\nexport const DropdownButton: React.FC<DropdownButtonProps> = (props) => {\n\tconst isIconMode = !!props.iconButtonProps;\n\tconst disabled = isIconMode\n\t\t? props.iconButtonProps?.disabled\n\t\t: props.buttonProps?.disabled;\n\n\tif (isIconMode) {\n\t\tconst { iconButtonProps, iconButtonTooltip } = props;\n\t\tconst iconButton = (\n\t\t\t<IconButton\n\t\t\t\t{...iconButtonProps!}\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '0px',\n\t\t\t\t\tborderTopLeftRadius: '4px',\n\t\t\t\t\tborderBottomLeftRadius: '4px',\n\t\t\t\t}}\n\t\t\t/>\n\t\t);\n\t\treturn (\n\t\t\t<DropdownButtonStyle\n\t\t\t\ttype={undefined}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisIconButton\n\t\t\t\ticonButtonType={iconButtonProps?.iconButtonType ?? 'primary'}\n\t\t\t\ticonButtonSize={iconButtonProps?.size ?? 'default'}\n\t\t\t>\n\t\t\t\t{iconButtonTooltip ? (\n\t\t\t\t\t<Tooltip\n\t\t\t\t\t\tbody={iconButtonTooltip.body}\n\t\t\t\t\t\ttooltipContent={iconButtonTooltip.tooltipContent}\n\t\t\t\t\t\tplacement={iconButtonTooltip.placement}\n\t\t\t\t\t>\n\t\t\t\t\t\t{iconButton}\n\t\t\t\t\t</Tooltip>\n\t\t\t\t) : (\n\t\t\t\t\ticonButton\n\t\t\t\t)}\n\t\t\t\t<div className=\"dd-button-divider\"></div>\n\t\t\t\t<div style={{ display: 'flex', alignItems: 'center' }}>\n\t\t\t\t\t<DropdownPopover {...props.dropdownProps} isChildLoading={false}>\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\tIcon={props.iconProps}\n\t\t\t\t\t\t\ticonButtonType={iconButtonProps?.iconButtonType ?? 'primary'}\n\t\t\t\t\t\t\tsize={iconButtonProps?.size}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\tborderRadius: '0px',\n\t\t\t\t\t\t\t\tborderTopRightRadius: '4px',\n\t\t\t\t\t\t\t\tborderBottomRightRadius: '4px',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</DropdownPopover>\n\t\t\t\t</div>\n\t\t\t</DropdownButtonStyle>\n\t\t);\n\t}\n\n\tconst {\n\t\tonClick,\n\t\tLeadingIcon,\n\t\tLeadingIconStyles,\n\t\tIconComponent,\n\t\tTrailingIcon,\n\t\t...childButtonProps\n\t} = props.buttonProps!;\n\n\treturn (\n\t\t<DropdownButtonStyle\n\t\t\ttype={props.buttonProps!.buttonType}\n\t\t\tdisabled={props.buttonProps!.disabled}\n\t\t\tsize={props.buttonProps!.size}\n\t\t>\n\t\t\t{props.buttonProps?.isLoading && (\n\t\t\t\t<LoaderContainer type={props.buttonProps.buttonType}>\n\t\t\t\t\t<Spinner\n\t\t\t\t\t\tclassName=\"spinner\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tcolor={SpinnerColorMap(\n\t\t\t\t\t\t\tprops.buttonProps.buttonType || 'primary',\n\t\t\t\t\t\t\tprops.buttonProps.inverse,\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t</LoaderContainer>\n\t\t\t)}\n\n\t\t\t<Button\n\t\t\t\t{...props.buttonProps!}\n\t\t\t\tisLoading={false}\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '0px',\n\t\t\t\t\tborderTopLeftRadius: '4px',\n\t\t\t\t\tborderBottomLeftRadius: '4px',\n\t\t\t\t\tborderRight: '0px',\n\t\t\t\t\t...(props.buttonProps?.size === 'xs'\n\t\t\t\t\t\t? { border: 'none', borderRadius: '0px' }\n\t\t\t\t\t\t: {}),\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t<div className=\"dd-button-divider\"></div>\n\t\t\t<DropdownPopover\n\t\t\t\t{...props.dropdownProps}\n\t\t\t\tisChildLoading={props.buttonProps?.isLoading}\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\t{...childButtonProps}\n\t\t\t\t\tisLoading={false}\n\t\t\t\t\tbuttonText={''}\n\t\t\t\t\tTrailingIcon={props.iconProps}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tborderRadius: '0px',\n\t\t\t\t\t\tborderTopRightRadius: '4px',\n\t\t\t\t\t\tborderBottomRightRadius: '4px',\n\t\t\t\t\t\t...(props.buttonProps?.size === 'xs'\n\t\t\t\t\t\t\t? { border: 'none', borderRadius: '0px' }\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</DropdownPopover>\n\t\t</DropdownButtonStyle>\n\t);\n};\n"],"names":["DropdownButton","props","isIconMode","disabled","iconButtonProps","iconButtonTooltip","iconButton","jsx","IconButton","jsxs","DropdownButtonStyle","Tooltip","DropdownPopover","onClick","LeadingIcon","LeadingIconStyles","IconComponent","TrailingIcon","childButtonProps","LoaderContainer","Spinner","SpinnerColorMap","Button"],"mappings":"iYA2BaA,EAAiDC,GAAU,CACvE,MAAMC,EAAa,CAAC,CAACD,EAAM,gBACrBE,EAAWD,EACdD,EAAM,iBAAiB,SACvBA,EAAM,aAAa,SAEtB,GAAIC,EAAY,CACf,KAAM,CAAE,gBAAAE,EAAiB,kBAAAC,CAAA,EAAsBJ,EACzCK,EACLC,EAAAA,IAACC,EAAAA,WAAA,CACC,GAAGJ,EACJ,MAAO,CACN,aAAc,MACd,oBAAqB,MACrB,uBAAwB,KAAA,CACzB,CAAA,EAGF,OACCK,EAAAA,KAACC,EAAAA,oBAAA,CACA,KAAM,OACN,SAAAP,EACA,aAAY,GAC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aAAa,OAAS,KAC7B,CAAE,OAAQ,OAAQ,aAAc,OAChC,CAAA,CAAC,CACL,CAAA,EAEDM,EAAAA,IAAC,MAAA,CAAI,UAAU,mBAAA,CAAoB,EACnCA,EAAAA,IAACK,EAAAA,gBAAA,CACC,GAAGX,EAAM,cACV,eAAgBA,EAAM,aAAa,UAEnC,SAAAM,EAAAA,IAACe,EAAAA,OAAA,CACC,GAAGJ,EACJ,UAAW,GACX,WAAY,GACZ,aAAcjB,EAAM,UACpB,MAAO,CACN,aAAc,MACd,qBAAsB,MACtB,wBAAyB,MACzB,GAAIA,EAAM,aAAa,OAAS,KAC7B,CAAE,OAAQ,OAAQ,aAAc,OAChC,CAAA,CAAC,CACL,CAAA,CACD,CAAA,CACD,CAAA,CAAA,CAGH"}
1
+ {"version":3,"file":"DropdownButton.js","sources":["../../../../src/components/dropdown-button/DropdownButton.tsx"],"sourcesContent":["import React from 'react';\nimport { DropdownPopover, DropdownProps } from '@src/components/dropdown';\nimport { Button } from '../button';\nimport { ButtonProps } from '../button/model';\nimport { SpinnerColorMap } from '../button/themes';\nimport { IconButton } from '../icon-button';\nimport { IconButtonProps } from '../icon-button/model';\nimport { Spinner } from '../spinner';\nimport { Placement, Tooltip } from '../tooltips';\nimport { DropdownButtonStyle, LoaderContainer } from './DropdownButton.style';\n\nexport interface DropdownButtonProps {\n\tdropdownProps: DropdownProps;\n\ticonProps: React.FunctionComponent<React.SVGAttributes<SVGElement>>;\n\tbuttonProps?: ButtonProps;\n\ticonButtonProps?: IconButtonProps;\n\t/**\n\t * Optional tooltip shown only on the main icon button (icon mode),\n\t * not on the dropdown/chevron trigger.\n\t */\n\ticonButtonTooltip?: {\n\t\tbody?: string;\n\t\ttooltipContent?: JSX.Element;\n\t\tplacement?: Placement;\n\t};\n}\n\nexport const DropdownButton: React.FC<DropdownButtonProps> = (props) => {\n\tconst isIconMode = !!props.iconButtonProps;\n\tconst disabled = isIconMode\n\t\t? props.iconButtonProps?.disabled\n\t\t: props.buttonProps?.disabled;\n\n\tif (isIconMode) {\n\t\tconst { iconButtonProps, iconButtonTooltip } = props;\n\t\tconst iconButton = (\n\t\t\t<IconButton\n\t\t\t\t{...iconButtonProps!}\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '0px',\n\t\t\t\t\tborderTopLeftRadius: '4px',\n\t\t\t\t\tborderBottomLeftRadius: '4px',\n\t\t\t\t}}\n\t\t\t/>\n\t\t);\n\t\treturn (\n\t\t\t<DropdownButtonStyle\n\t\t\t\ttype={undefined}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisIconButton\n\t\t\t\ticonButtonType={iconButtonProps?.iconButtonType ?? 'primary'}\n\t\t\t\ticonButtonSize={iconButtonProps?.size ?? 'default'}\n\t\t\t>\n\t\t\t\t{iconButtonTooltip ? (\n\t\t\t\t\t<Tooltip\n\t\t\t\t\t\tbody={iconButtonTooltip.body}\n\t\t\t\t\t\ttooltipContent={iconButtonTooltip.tooltipContent}\n\t\t\t\t\t\tplacement={iconButtonTooltip.placement}\n\t\t\t\t\t>\n\t\t\t\t\t\t{iconButton}\n\t\t\t\t\t</Tooltip>\n\t\t\t\t) : (\n\t\t\t\t\ticonButton\n\t\t\t\t)}\n\t\t\t\t<div className=\"dd-button-divider\"></div>\n\t\t\t\t<div style={{ display: 'flex', alignItems: 'center' }}>\n\t\t\t\t\t<DropdownPopover {...props.dropdownProps} isChildLoading={false}>\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\tIcon={props.iconProps}\n\t\t\t\t\t\t\ticonButtonType={iconButtonProps?.iconButtonType ?? 'primary'}\n\t\t\t\t\t\t\tsize={iconButtonProps?.size}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\tborderRadius: '0px',\n\t\t\t\t\t\t\t\tborderTopRightRadius: '4px',\n\t\t\t\t\t\t\t\tborderBottomRightRadius: '4px',\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</DropdownPopover>\n\t\t\t\t</div>\n\t\t\t</DropdownButtonStyle>\n\t\t);\n\t}\n\n\tconst {\n\t\tonClick,\n\t\tLeadingIcon,\n\t\tLeadingIconStyles,\n\t\tIconComponent,\n\t\tTrailingIcon,\n\t\t...childButtonProps\n\t} = props.buttonProps!;\n\n\treturn (\n\t\t<DropdownButtonStyle\n\t\t\ttype={props.buttonProps!.buttonType}\n\t\t\tdisabled={props.buttonProps!.disabled}\n\t\t\tsize={props.buttonProps!.size}\n\t\t>\n\t\t\t{props.buttonProps?.isLoading && (\n\t\t\t\t<LoaderContainer type={props.buttonProps.buttonType}>\n\t\t\t\t\t<Spinner\n\t\t\t\t\t\tclassName=\"spinner\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tcolor={SpinnerColorMap(\n\t\t\t\t\t\t\tprops.buttonProps.buttonType || 'primary',\n\t\t\t\t\t\t\tprops.buttonProps.inverse,\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t</LoaderContainer>\n\t\t\t)}\n\n\t\t\t<Button\n\t\t\t\t{...props.buttonProps!}\n\t\t\t\tisLoading={false}\n\t\t\t\tstyle={{\n\t\t\t\t\tborderRadius: '0px',\n\t\t\t\t\tborderTopLeftRadius: '4px',\n\t\t\t\t\tborderBottomLeftRadius: '4px',\n\t\t\t\t\tborderRight: '0px',\n\t\t\t\t\t...(props.buttonProps?.size === 'xs'\n\t\t\t\t\t\t? { border: 'none', boxShadow: 'none', borderRadius: '0px' }\n\t\t\t\t\t\t: {}),\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t<div className=\"dd-button-divider\"></div>\n\t\t\t<DropdownPopover\n\t\t\t\t{...props.dropdownProps}\n\t\t\t\tisChildLoading={props.buttonProps?.isLoading}\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\t{...childButtonProps}\n\t\t\t\t\tisLoading={false}\n\t\t\t\t\tbuttonText={''}\n\t\t\t\t\tTrailingIcon={props.iconProps}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tborderRadius: '0px',\n\t\t\t\t\t\tborderTopRightRadius: '4px',\n\t\t\t\t\t\tborderBottomRightRadius: '4px',\n\t\t\t\t\t\t...(props.buttonProps?.size === 'xs'\n\t\t\t\t\t\t\t? { border: 'none', boxShadow: 'none', borderRadius: '0px' }\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</DropdownPopover>\n\t\t</DropdownButtonStyle>\n\t);\n};\n"],"names":["DropdownButton","props","isIconMode","disabled","iconButtonProps","iconButtonTooltip","iconButton","jsx","IconButton","jsxs","DropdownButtonStyle","Tooltip","DropdownPopover","onClick","LeadingIcon","LeadingIconStyles","IconComponent","TrailingIcon","childButtonProps","LoaderContainer","Spinner","SpinnerColorMap","Button"],"mappings":"iYA2BaA,EAAiDC,GAAU,CACvE,MAAMC,EAAa,CAAC,CAACD,EAAM,gBACrBE,EAAWD,EACdD,EAAM,iBAAiB,SACvBA,EAAM,aAAa,SAEtB,GAAIC,EAAY,CACf,KAAM,CAAE,gBAAAE,EAAiB,kBAAAC,CAAA,EAAsBJ,EACzCK,EACLC,EAAAA,IAACC,EAAAA,WAAA,CACC,GAAGJ,EACJ,MAAO,CACN,aAAc,MACd,oBAAqB,MACrB,uBAAwB,KAAA,CACzB,CAAA,EAGF,OACCK,EAAAA,KAACC,EAAAA,oBAAA,CACA,KAAM,OACN,SAAAP,EACA,aAAY,GACZ,eAAgBC,GAAiB,gBAAkB,UACnD,eAAgBA,GAAiB,MAAQ,UAExC,SAAA,CAAAC,EACAE,EAAAA,IAACI,EAAAA,QAAA,CACA,KAAMN,EAAkB,KACxB,eAAgBA,EAAkB,eAClC,UAAWA,EAAkB,UAE5B,SAAAC,CAAA,CAAA,EAGFA,EAEDC,EAAAA,IAAC,MAAA,CAAI,UAAU,mBAAA,CAAoB,EACnCA,EAAAA,IAAC,MAAA,CAAI,MA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GACX,WAAY,GACZ,aAAcjB,EAAM,UACpB,MAAO,CACN,aAAc,MACd,qBAAsB,MACtB,wBAAyB,MACzB,GAAIA,EAAM,aAAa,OAAS,KAC7B,CAAE,OAAQ,OAAQ,UAAW,OAAQ,aAAc,KAAA,EACnD,CAAA,CAAC,CACL,CAAA,CACD,CAAA,CACD,CAAA,CAAA,CAGH"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),i=require("react"),O=f=>{const l=i.useRef(null),[r,s]=i.useState(0),[d,o]=i.useState(0),[h,a]=i.useState(!1),w=e=>{if(f.useDefaultOffsets){o(e.left);return}let t=0;f.leftOffset?t=e.left+f.leftOffset:t=e.left+e.width+30;const n=l?.current;if(!n){o(t);return}t>window.innerWidth-n.offsetWidth&&(t=window.innerWidth-n.offsetWidth-50),o(t)},g=e=>{if(f.useDefaultOffsets){s(e.top);return}let t=e.top;f.topOffset&&(t=e.top+f.topOffset);const n=l?.current;if(!n){s(t);return}const u=window.innerHeight;e.top+n.offsetHeight>u&&(t=e.top-(e.top+n.offsetHeight-u)-10),s(t)};return i.useEffect(()=>{if(f.refElement.current){const e=f.refElement.current.getBoundingClientRect();w(e),g(e),a(!0)}}),h?c.jsx("div",{style:{top:r,left:d,position:"fixed",zIndex:1e3},children:c.jsx("div",{ref:l,children:f.children})}):null};exports.Floater=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("react"),O=f=>{const l=i.useRef(null),[c,o]=i.useState(0),[d,s]=i.useState(0),[a,h]=i.useState(!1),w=t=>{if(f.useDefaultOffsets){s(t.left);return}let e=0;f.leftOffset?e=t.left+f.leftOffset:e=t.left+t.width+30;const n=l?.current;if(!n){s(e);return}e>window.innerWidth-n.offsetWidth&&(e=window.innerWidth-n.offsetWidth-50),s(e)},g=t=>{if(f.useDefaultOffsets){o(t.top);return}let e=t.top;f.topOffset&&(e=t.top+f.topOffset);const n=l?.current;if(!n){o(e);return}const u=window.innerHeight;t.top+n.offsetHeight>u&&(e=t.top-(t.top+n.offsetHeight-u)-10),o(e)};return i.useEffect(()=>{if(f.refElement.current){const t=f.refElement.current.getBoundingClientRect();w(t),g(t),h(!0)}}),a?r.jsx("div",{"data-testid":"floater-position",style:{top:c,left:d,position:"fixed",zIndex:1e3},children:r.jsx("div",{ref:l,children:f.children})}):null};exports.Floater=O;
2
2
  //# sourceMappingURL=floater.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"floater.js","sources":["../../../../src/components/floater/floater.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nexport type FloaterProps = {\n\tchildren?: React.ReactNode;\n\trefElement: React.MutableRefObject<any>;\n\tleftOffset?: number;\n\ttopOffset?: number;\n\tuseDefaultOffsets?: boolean;\n};\n\nexport const Floater = (props: FloaterProps) => {\n\tconst childRef = useRef<HTMLDivElement | null>(null);\n\tconst [top, setTop] = useState<number>(0);\n\tconst [left, setLeft] = useState<number>(0);\n\tconst [show, setShow] = useState<boolean>(false);\n\n\tconst calculateLeft = (rect: DOMRect) => {\n\t\tif (props.useDefaultOffsets) {\n\t\t\tsetLeft(rect.left);\n\t\t\treturn;\n\t\t}\n\n\t\tlet left = 0;\n\t\tif (props.leftOffset) {\n\t\t\tleft = rect.left + props.leftOffset;\n\t\t} else {\n\t\t\tleft = rect.left + rect.width + 30;\n\t\t}\n\t\tconst childElement: any = childRef?.current;\n\t\tif (!childElement) {\n\t\t\tsetLeft(left);\n\t\t\treturn;\n\t\t}\n\t\tif (left > window.innerWidth - childElement.offsetWidth) {\n\t\t\tleft = window.innerWidth - childElement.offsetWidth - 50;\n\t\t}\n\t\tsetLeft(left);\n\t};\n\n\tconst calculateTop = (rect: DOMRect) => {\n\t\tif (props.useDefaultOffsets) {\n\t\t\tsetTop(rect.top);\n\t\t\treturn;\n\t\t}\n\t\tlet top: number = rect.top;\n\n\t\tif (props.topOffset) {\n\t\t\ttop = rect.top + props.topOffset;\n\t\t}\n\n\t\tconst childElement: any = childRef?.current;\n\t\tif (!childElement) {\n\t\t\tsetTop(top);\n\t\t\treturn;\n\t\t}\n\t\tconst windowHeight = window.innerHeight;\n\t\tif (rect.top + childElement.offsetHeight > windowHeight) {\n\t\t\ttop =\n\t\t\t\trect.top - (rect.top + childElement.offsetHeight - windowHeight) - 10;\n\t\t}\n\t\tsetTop(top);\n\t};\n\n\tuseEffect(() => {\n\t\tif (props.refElement.current) {\n\t\t\tconst rect = props.refElement.current.getBoundingClientRect();\n\t\t\tcalculateLeft(rect);\n\t\t\tcalculateTop(rect);\n\t\t\tsetShow(true);\n\t\t}\n\t});\n\n\tif (!show) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\ttop: top,\n\t\t\t\tleft: left,\n\t\t\t\tposition: 'fixed',\n\t\t\t\tzIndex: 1000,\n\t\t\t}}\n\t\t>\n\t\t\t<div ref={childRef}>{props.children}</div>\n\t\t</div>\n\t);\n};\n"],"names":["Floater","props","childRef","useRef","top","setTop","useState","left","setLeft","show","setShow","calculateLeft","rect","childElement","calculateTop","windowHeight","useEffect","jsx"],"mappings":"wIAUaA,EAAWC,GAAwB,CAC/C,MAAMC,EAAWC,EAAAA,OAA8B,IAAI,EAC7C,CAACC,EAAKC,CAAM,EAAIC,EAAAA,SAAiB,CAAC,EAClC,CAACC,EAAMC,CAAO,EAAIF,EAAAA,SAAiB,CAAC,EACpC,CAACG,EAAMC,CAAO,EAAIJ,EAAAA,SAAkB,EAAK,EAEzCK,EAAiBC,GAAkB,CACxC,GAAIX,EAAM,kBAAmB,CAC5BO,EAAQI,EAAK,IAAI,EACjB,MACD,CAEA,IAAIL,EAAO,EACPN,EAAM,WACTM,EAAOK,EAAK,KAAOX,EAAM,WAEzBM,EAAOK,EAAK,KAAOA,EAAK,MAAQ,GAEjC,MAAMC,EAAoBX,GAAU,QACpC,GAAI,CAACW,EAAc,CAClBL,EAAQD,CAAI,EACZ,MACD,CACIA,EAAO,OAAO,WAAaM,EAAa,cAC3CN,EAAO,OAAO,WAAaM,EAAa,YAAc,IAEvDL,EAAQD,CAAI,CACb,EAEMO,EAAgBF,GAAkB,CACvC,GAAIX,EAAM,kBAAmB,CAC5BI,EAAOO,EAAK,GAAG,EACf,MACD,CACA,IAAIR,EAAcQ,EAAK,IAEnBX,EAAM,YACTG,EAAMQ,EAAK,IAAMX,EAAM,WAGxB,MAAMY,EAAoBX,GAAU,QACpC,GAAI,CAACW,EAAc,CAClBR,EAAOD,CAAG,EACV,MACD,CACA,MAAMW,EAAe,OAAO,YACxBH,EAAK,IAAMC,EAAa,aAAeE,IAC1CX,EACCQ,EAAK,KAAOA,EAAK,IAAMC,EAAa,aAAeE,GAAgB,IAErEV,EAAOD,CAAG,CACX,EAWA,OATAY,EAAAA,UAAU,IAAM,CACf,GAAIf,EAAM,WAAW,QAAS,CAC7B,MAAMW,EAAOX,EAAM,WAAW,QAAQ,sBAAA,EACtCU,EAAcC,CAAI,EAClBE,EAAaF,CAAI,EACjBF,EAAQ,EAAI,CACb,CACD,CAAC,EAEID,EAKJQ,EAAAA,IAAC,MAAA,CACA,MAAO,CACN,IAAAb,EACA,KAAAG,EACA,SAAU,QACV,OAAQ,GAAA,EAGT,SAAAU,EAAAA,IAAC,MAAA,CAAI,IAAKf,EAAW,WAAM,QAAA,CAAS,CAAA,CAAA,EAZ9B,IAeT"}
1
+ {"version":3,"file":"floater.js","sources":["../../../../src/components/floater/floater.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nexport type FloaterProps = {\n\tchildren?: React.ReactNode;\n\trefElement: React.MutableRefObject<any>;\n\tleftOffset?: number;\n\ttopOffset?: number;\n\tuseDefaultOffsets?: boolean;\n};\n\nexport const Floater = (props: FloaterProps) => {\n\tconst childRef = useRef<HTMLDivElement | null>(null);\n\tconst [top, setTop] = useState<number>(0);\n\tconst [left, setLeft] = useState<number>(0);\n\tconst [show, setShow] = useState<boolean>(false);\n\n\tconst calculateLeft = (rect: DOMRect) => {\n\t\tif (props.useDefaultOffsets) {\n\t\t\tsetLeft(rect.left);\n\t\t\treturn;\n\t\t}\n\n\t\tlet left = 0;\n\t\tif (props.leftOffset) {\n\t\t\tleft = rect.left + props.leftOffset;\n\t\t} else {\n\t\t\tleft = rect.left + rect.width + 30;\n\t\t}\n\t\tconst childElement: any = childRef?.current;\n\t\tif (!childElement) {\n\t\t\tsetLeft(left);\n\t\t\treturn;\n\t\t}\n\t\tif (left > window.innerWidth - childElement.offsetWidth) {\n\t\t\tleft = window.innerWidth - childElement.offsetWidth - 50;\n\t\t}\n\t\tsetLeft(left);\n\t};\n\n\tconst calculateTop = (rect: DOMRect) => {\n\t\tif (props.useDefaultOffsets) {\n\t\t\tsetTop(rect.top);\n\t\t\treturn;\n\t\t}\n\t\tlet top: number = rect.top;\n\n\t\tif (props.topOffset) {\n\t\t\ttop = rect.top + props.topOffset;\n\t\t}\n\n\t\tconst childElement: any = childRef?.current;\n\t\tif (!childElement) {\n\t\t\tsetTop(top);\n\t\t\treturn;\n\t\t}\n\t\tconst windowHeight = window.innerHeight;\n\t\tif (rect.top + childElement.offsetHeight > windowHeight) {\n\t\t\ttop =\n\t\t\t\trect.top - (rect.top + childElement.offsetHeight - windowHeight) - 10;\n\t\t}\n\t\tsetTop(top);\n\t};\n\n\tuseEffect(() => {\n\t\tif (props.refElement.current) {\n\t\t\tconst rect = props.refElement.current.getBoundingClientRect();\n\t\t\tcalculateLeft(rect);\n\t\t\tcalculateTop(rect);\n\t\t\tsetShow(true);\n\t\t}\n\t});\n\n\tif (!show) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tdata-testid=\"floater-position\"\n\t\t\tstyle={{\n\t\t\t\ttop: top,\n\t\t\t\tleft: left,\n\t\t\t\tposition: 'fixed',\n\t\t\t\tzIndex: 1000,\n\t\t\t}}\n\t\t>\n\t\t\t<div ref={childRef}>{props.children}</div>\n\t\t</div>\n\t);\n};\n"],"names":["Floater","props","childRef","useRef","top","setTop","useState","left","setLeft","show","setShow","calculateLeft","rect","childElement","calculateTop","windowHeight","useEffect","jsx"],"mappings":"wIAUaA,EAAWC,GAAwB,CAC/C,MAAMC,EAAWC,EAAAA,OAA8B,IAAI,EAC7C,CAACC,EAAKC,CAAM,EAAIC,EAAAA,SAAiB,CAAC,EAClC,CAACC,EAAMC,CAAO,EAAIF,EAAAA,SAAiB,CAAC,EACpC,CAACG,EAAMC,CAAO,EAAIJ,EAAAA,SAAkB,EAAK,EAEzCK,EAAiBC,GAAkB,CACxC,GAAIX,EAAM,kBAAmB,CAC5BO,EAAQI,EAAK,IAAI,EACjB,MACD,CAEA,IAAIL,EAAO,EACPN,EAAM,WACTM,EAAOK,EAAK,KAAOX,EAAM,WAEzBM,EAAOK,EAAK,KAAOA,EAAK,MAAQ,GAEjC,MAAMC,EAAoBX,GAAU,QACpC,GAAI,CAACW,EAAc,CAClBL,EAAQD,CAAI,EACZ,MACD,CACIA,EAAO,OAAO,WAAaM,EAAa,cAC3CN,EAAO,OAAO,WAAaM,EAAa,YAAc,IAEvDL,EAAQD,CAAI,CACb,EAEMO,EAAgBF,GAAkB,CACvC,GAAIX,EAAM,kBAAmB,CAC5BI,EAAOO,EAAK,GAAG,EACf,MACD,CACA,IAAIR,EAAcQ,EAAK,IAEnBX,EAAM,YACTG,EAAMQ,EAAK,IAAMX,EAAM,WAGxB,MAAMY,EAAoBX,GAAU,QACpC,GAAI,CAACW,EAAc,CAClBR,EAAOD,CAAG,EACV,MACD,CACA,MAAMW,EAAe,OAAO,YACxBH,EAAK,IAAMC,EAAa,aAAeE,IAC1CX,EACCQ,EAAK,KAAOA,EAAK,IAAMC,EAAa,aAAeE,GAAgB,IAErEV,EAAOD,CAAG,CACX,EAWA,OATAY,EAAAA,UAAU,IAAM,CACf,GAAIf,EAAM,WAAW,QAAS,CAC7B,MAAMW,EAAOX,EAAM,WAAW,QAAQ,sBAAA,EACtCU,EAAcC,CAAI,EAClBE,EAAaF,CAAI,EACjBF,EAAQ,EAAI,CACb,CACD,CAAC,EAEID,EAKJQ,EAAAA,IAAC,MAAA,CACA,cAAY,mBACZ,MAAO,CACN,IAAAb,EACA,KAAAG,EACA,SAAU,QACV,OAAQ,GAAA,EAGT,SAAAU,EAAAA,IAAC,MAAA,CAAI,IAAKf,EAAW,WAAM,QAAA,CAAS,CAAA,CAAA,EAb9B,IAgBT"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),Me=require("../../assets/icons/info.svg.js"),r=require("react"),y=require("./Input-helper.js"),te=require("../TypographyStyle.js"),ne=require("../../constants/Theme.js"),Ee=require("../../assets/icons/errorInfo.svg.js"),Le=require("./context/InputStyleProvider.js"),l=require("./Input.styled.js"),ie=require("../button/Button.js"),we=require("../tooltips/Tooltip.js"),re=r.forwardRef((e,le)=>{const{placeholder:w,leftIcon:H,rightIcon:R,labelText:v,maxCharLimit:a,isRequired:_,hintText:k,type:c,state:T,validate:se,variant:o,button:h,suffixText:p,prefixText:A,onChangeText:O,value:x,noErrorHint:ae,reset:B,rangeValidation:oe,noKeyDownChange:ce,version:ue,noMaxCharCheck:F,labelElement:q,autoGrow:j,minHeight:b,maxHeight:he,labelTextBold:de,truncateText:fe,maxCharLimitPosition:D,maxCharStyle:P,hightlightInputColor:xe,onKeyDownEvent:z,hideInputHeader:ge,hideBorder:me,inputWrapperStyles:ye,minCharsToTrigger:K,maxCharAlignment:Ie,isDisabled:N=!1,allowUnsafeInput:Ce,leftIconStyle:ve}={maxCharLimit:0,type:"text",variant:"default",maxCharLimitPosition:"TOP",minCharsToTrigger:0,maxCharAlignment:!1,...e},V=H?.icon,W=R?.icon,[S,I]=r.useState(!1),[Te,M]=r.useState(!1),[d,X]=r.useState(),U=o==="x-small"?"12px":o==="small"?"18px":"22px",C=r.useContext(Le.InputStyleContext),[G,E]=r.useState(""),je=r.useRef(null),s=le??je;r.useEffect(()=>{E(x||""),!x&&j&&(s.current.style.height=b||"48px")},[x]),r.useEffect(()=>{s.current&&e.onReferenceInit?.(s.current)},[s]),r.useEffect(()=>{const t=s.current;if(t&&["phonenumber","zip","number"].includes(c))return t.addEventListener("wheel",J,{passive:!1}),()=>{t.removeEventListener("wheel",J)}},[]),r.useEffect(()=>{B&&E("")},[B]),r.useEffect(()=>{M(!!e.isActive),e.isActive&&s.current?.focus()},[e.isActive]),r.useEffect(()=>{X(e.errorMessage)},[e.errorMessage]),r.useEffect(()=>{I(!1),(e.state==="invalid"||d||e.state==="disabled-invalid")&&I(!0),e.state==="active"&&s.current?.focus()},[e.state,d]),r.useEffect(()=>{I(!!d||e.state==="invalid")},[d,e.state]);const f=(t,...i)=>{y.isFunction(t)&&t(...i)},Y=()=>c==="zip"?6:2e3,$=t=>{const i=a!==0?a:Y(),g=[8],m=K,u=t.target.value;z&&(!u.length||u.length>=m)&&z(t),!ce&&(!u.length||u.length>=m)&&O(x||"",t),!F&&!g.includes(t.which)&&i>0&&u.length>=i&&t.preventDefault()},J=t=>{t.preventDefault()},Q=t=>{let i=t.target.value;const g=a!==0?a+1:Y(),m=K;if(!Ce&&y.shouldSanitizeForType(c)&&(i=y.sanitizeUnsafeInput(i)),!F&&g>0&&i.length>=g&&(i=i.substring(0,g-1)),e.textControl||E(i||""),m&&i&&i.length<m)return;O(i,t),j&&(s.current.style.height=`${s.current.scrollHeight}px`,i||(s.current.style.height=b||"48px"));const u=se||y.validateInput;if(!u||!y.isFunction(u))return;const[be,Se]=u(i,c,oe);I(!be),X(e.errorMessage?e.errorMessage:Se)},Z=t=>{e.skipFocus||M(!0),f(e.onFocus?.(t))},ee=t=>{e.skipFocus||M(!1),f(e.onBlur?.(t))},L=()=>n.jsxs(n.Fragment,{children:[c!=="multiline"&&n.jsx("input",{className:fe?"truncate-class":"","data-test":e["data-test"],id:e.id,style:C?.input??{},ref:s,disabled:N,type:["phonenumber","zip","number"].includes(c)?"number":c,value:G,onFocus:t=>Z(t),onBlur:t=>ee(t),placeholder:w||"Enter here",onChange:Q,onClick:t=>f(e.onClick),onKeyDown:t=>$(t)}),c==="multiline"&&n.jsx("textarea",{"data-test":e["data-test"],value:G,ref:s,onFocus:t=>Z(t),onBlur:t=>ee(t),onClick:t=>f(e.onClick),disabled:N,placeholder:w||"Enter here",onChange:Q,onKeyDown:t=>$(t),maxLength:a>0?a:void 0})]});return n.jsxs(l.RootContainer,{width:e.width,height:e.height,state:T,type:c,style:C?.RootContainer??{},children:[n.jsxs("div",{className:"flex-align-center",children:[!ae&&(!!k||!!d)&&n.jsxs(l.InputFooter,{invalid:!!d,children:[!!d&&n.jsx(Ee.default,{width:16,height:16}),d||k]}),a>0&&D==="BOTTOM"&&n.jsxs(l.MaxCharStyle,{position:"BOTTOM",style:P,children:[(x??"").toString()?.length??0,"/",a]})]}),n.jsxs(l.InputWrapper,{variant:o,state:T,width:e.width,isActive:T==="active"||Te,isInvalid:S,style:C?.InputWrapper??ye??{},version:ue,height:e.height,hightlightInputColor:xe,hideBorder:me,children:[!!V&&n.jsx(l.IconHolder,{variant:o,iconSize:U,onClick:()=>f(H?.callback),isLeft:!0,style:{...C?.IconHolder??{},...ve},children:n.jsx(V,{})}),!!A&&n.jsx(l.PrefixHolder,{variant:o,children:A}),o==="default"&&n.jsx(l.InputContainer,{height:e.height,type:e.type,minHeight:b,maxHeight:he,autoGrow:j,children:L()}),o==="small"&&n.jsx(l.InputContainerSmall,{height:e.height,type:e.type,children:L()}),o==="x-small"&&n.jsx(l.InputContainerXSmall,{height:e.height,type:e.type,children:L()}),!!W&&n.jsx(l.IconHolder,{variant:o,iconSize:U,onClick:()=>f(R?.callback),isLeft:!1,children:n.jsx(W,{})}),!!p&&n.jsx(l.SuffixHolder,{variant:o,children:p}),h&&h.text&&n.jsx(ie.Button,{buttonText:h.text,buttonType:h.buttonType,onClick:()=>f(h?.onClick)}),h&&h.buttonProps&&n.jsx(ie.Button,{...h.buttonProps})]}),!ge&&(!!v||!!a)&&n.jsxs(l.InputHeader,{invalid:S,maxCharAlignment:Ie,children:[q&&q,n.jsxs("div",{className:"label__container",children:[de?n.jsxs(te.TitleSmall,{children:[v,_?n.jsx("span",{children:"*"}):""]}):n.jsxs(te.BodySecondary,{children:[v,_?n.jsx("span",{children:"*"}):""]}),e.tooltipText&&n.jsx(we.Tooltip,{body:e.tooltipText,placement:"top",children:n.jsx("span",{children:n.jsx(Me.default,{style:{marginTop:-3},width:18,height:18,color:S?ne.COLORS.content.negative:ne.COLORS.content.primary})})})]}),a>0&&D==="TOP"&&n.jsxs(l.MaxCharStyle,{style:P,children:[(x??"").toString()?.length??0,"/",a]})]})]})});re.displayName="Input";exports.Input=re;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),Me=require("../../assets/icons/info.svg.js"),r=require("react"),y=require("./Input-helper.js"),te=require("../TypographyStyle.js"),ne=require("../../constants/Theme.js"),Ee=require("../../assets/icons/errorInfo.svg.js"),Le=require("./context/InputStyleProvider.js"),l=require("./Input.styled.js"),ie=require("../button/Button.js"),we=require("../tooltips/Tooltip.js"),re=r.forwardRef((e,le)=>{const{placeholder:H,leftIcon:R,rightIcon:v,labelText:T,maxCharLimit:a,isRequired:_,hintText:k,type:c,state:j,validate:se,variant:o,button:h,suffixText:p,prefixText:A,onChangeText:O,value:x,noErrorHint:ae,reset:B,rangeValidation:oe,noKeyDownChange:ce,version:ue,noMaxCharCheck:F,labelElement:q,autoGrow:b,minHeight:S,maxHeight:he,labelTextBold:de,truncateText:fe,maxCharLimitPosition:D,maxCharStyle:P,hightlightInputColor:xe,onKeyDownEvent:z,hideInputHeader:ge,hideBorder:me,inputWrapperStyles:ye,minCharsToTrigger:K,maxCharAlignment:Ie,isDisabled:N=!1,allowUnsafeInput:Ce,leftIconStyle:ve}={maxCharLimit:0,type:"text",variant:"default",maxCharLimitPosition:"TOP",minCharsToTrigger:0,maxCharAlignment:!1,...e},V=R?.icon,W=v?.icon,[M,I]=r.useState(!1),[Te,E]=r.useState(!1),[d,X]=r.useState(),U=o==="x-small"?"12px":o==="small"?"18px":"22px",C=r.useContext(Le.InputStyleContext),[G,L]=r.useState(""),je=r.useRef(null),s=le??je;r.useEffect(()=>{L(x||""),!x&&b&&(s.current.style.height=S||"48px")},[x]),r.useEffect(()=>{s.current&&e.onReferenceInit?.(s.current)},[s]),r.useEffect(()=>{const t=s.current;if(t&&["phonenumber","zip","number"].includes(c))return t.addEventListener("wheel",J,{passive:!1}),()=>{t.removeEventListener("wheel",J)}},[]),r.useEffect(()=>{B&&L("")},[B]),r.useEffect(()=>{E(!!e.isActive),e.isActive&&s.current?.focus()},[e.isActive]),r.useEffect(()=>{X(e.errorMessage)},[e.errorMessage]),r.useEffect(()=>{I(!1),(e.state==="invalid"||d||e.state==="disabled-invalid")&&I(!0),e.state==="active"&&s.current?.focus()},[e.state,d]),r.useEffect(()=>{I(!!d||e.state==="invalid")},[d,e.state]);const f=(t,...i)=>{y.isFunction(t)&&t(...i)},Y=()=>c==="zip"?6:2e3,$=t=>{const i=a!==0?a:Y(),g=[8],m=K,u=t.target.value;z&&(!u.length||u.length>=m)&&z(t),!ce&&(!u.length||u.length>=m)&&O(x||"",t),!F&&!g.includes(t.which)&&i>0&&u.length>=i&&t.preventDefault()},J=t=>{t.preventDefault()},Q=t=>{let i=t.target.value;const g=a!==0?a+1:Y(),m=K;if(!Ce&&y.shouldSanitizeForType(c)&&(i=y.sanitizeUnsafeInput(i)),!F&&g>0&&i.length>=g&&(i=i.substring(0,g-1)),e.textControl||L(i||""),m&&i&&i.length<m)return;O(i,t),b&&(s.current.style.height=`${s.current.scrollHeight}px`,i||(s.current.style.height=S||"48px"));const u=se||y.validateInput;if(!u||!y.isFunction(u))return;const[be,Se]=u(i,c,oe);I(!be),X(e.errorMessage?e.errorMessage:Se)},Z=t=>{e.skipFocus||E(!0),f(e.onFocus?.(t))},ee=t=>{e.skipFocus||E(!1),f(e.onBlur?.(t))},w=()=>n.jsxs(n.Fragment,{children:[c!=="multiline"&&n.jsx("input",{className:fe?"truncate-class":"","data-test":e["data-test"],id:e.id,style:C?.input??{},ref:s,disabled:N,type:["phonenumber","zip","number"].includes(c)?"number":c,value:G,onFocus:t=>Z(t),onBlur:t=>ee(t),placeholder:H||"Enter here",onChange:Q,onClick:t=>f(e.onClick),onKeyDown:t=>$(t)}),c==="multiline"&&n.jsx("textarea",{"data-test":e["data-test"],value:G,ref:s,onFocus:t=>Z(t),onBlur:t=>ee(t),onClick:t=>f(e.onClick),disabled:N,placeholder:H||"Enter here",onChange:Q,onKeyDown:t=>$(t),maxLength:a>0?a:void 0})]});return n.jsxs(l.RootContainer,{width:e.width,height:e.height,state:j,type:c,style:C?.RootContainer??{},children:[n.jsxs("div",{className:"flex-align-center",children:[!ae&&(!!k||!!d)&&n.jsxs(l.InputFooter,{invalid:!!d,children:[!!d&&n.jsx(Ee.default,{width:16,height:16}),d||k]}),a>0&&D==="BOTTOM"&&n.jsxs(l.MaxCharStyle,{position:"BOTTOM",style:P,children:[(x??"").toString()?.length??0,"/",a]})]}),n.jsxs(l.InputWrapper,{variant:o,state:j,width:e.width,isActive:j==="active"||Te,isInvalid:M,style:C?.InputWrapper??ye??{},version:ue,height:e.height,hightlightInputColor:xe,hideBorder:me,children:[!!V&&n.jsx(l.IconHolder,{variant:o,iconSize:U,onClick:()=>f(R?.callback),isLeft:!0,style:{...C?.IconHolder??{},...ve},children:n.jsx(V,{})}),!!A&&n.jsx(l.PrefixHolder,{variant:o,children:A}),o==="default"&&n.jsx(l.InputContainer,{height:e.height,type:e.type,minHeight:S,maxHeight:he,autoGrow:b,children:w()}),o==="small"&&n.jsx(l.InputContainerSmall,{height:e.height,type:e.type,children:w()}),o==="x-small"&&n.jsx(l.InputContainerXSmall,{height:e.height,type:e.type,children:w()}),!!W&&n.jsx(l.IconHolder,{variant:o,iconSize:U,onClick:()=>f(v?.callback),isLeft:!1,"data-test":v?.["data-test"],children:n.jsx(W,{})}),!!p&&n.jsx(l.SuffixHolder,{variant:o,children:p}),h&&h.text&&n.jsx(ie.Button,{buttonText:h.text,buttonType:h.buttonType,onClick:()=>f(h?.onClick)}),h&&h.buttonProps&&n.jsx(ie.Button,{...h.buttonProps})]}),!ge&&(!!T||!!a)&&n.jsxs(l.InputHeader,{invalid:M,maxCharAlignment:Ie,children:[q&&q,n.jsxs("div",{className:"label__container",children:[de?n.jsxs(te.TitleSmall,{children:[T,_?n.jsx("span",{children:"*"}):""]}):n.jsxs(te.BodySecondary,{children:[T,_?n.jsx("span",{children:"*"}):""]}),e.tooltipText&&n.jsx(we.Tooltip,{body:e.tooltipText,placement:"top",children:n.jsx("span",{children:n.jsx(Me.default,{style:{marginTop:-3},width:18,height:18,color:M?ne.COLORS.content.negative:ne.COLORS.content.primary})})})]}),a>0&&D==="TOP"&&n.jsxs(l.MaxCharStyle,{style:P,children:[(x??"").toString()?.length??0,"/",a]})]})]})});re.displayName="Input";exports.Input=re;
2
2
  //# sourceMappingURL=Input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sources":["../../../../src/components/input/Input.tsx"],"sourcesContent":["import InfoIcon from '@src/assets/icons/info.svg';\nimport React, {\n\tforwardRef,\n\tMutableRefObject,\n\tRef,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport { Button } from '@src/components/button';\nimport {\n\tisFunction,\n\tsanitizeUnsafeInput,\n\tshouldSanitizeForType,\n\tvalidateInput,\n} from '@src/components/input/Input-helper';\nimport { Tooltip } from '@src/components/tooltips';\nimport { BodySecondary, TitleSmall } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport ErrorIcon from '../../assets/icons/errorInfo.svg';\nimport { InputStyleContext } from './context/InputStyleProvider';\nimport { InputProps, InputTypeI, InputVariant } from './Input.model';\nimport * as SC from './Input.styled';\nimport { PrefixHolder, SuffixHolder } from './Input.styled';\n\nexport const Input = forwardRef(\n\t(\n\t\tprops: InputProps,\n\t\tfRef: React.ForwardedRef<HTMLInputElement | HTMLTextAreaElement | null>,\n\t) => {\n\t\tconst {\n\t\t\tplaceholder,\n\t\t\tleftIcon,\n\t\t\trightIcon,\n\t\t\tlabelText,\n\t\t\tmaxCharLimit,\n\t\t\tisRequired,\n\t\t\thintText,\n\t\t\ttype,\n\t\t\tstate,\n\t\t\tvalidate,\n\t\t\tvariant,\n\t\t\tbutton,\n\t\t\tsuffixText,\n\t\t\tprefixText,\n\t\t\tonChangeText,\n\t\t\tvalue,\n\t\t\tnoErrorHint,\n\t\t\treset,\n\t\t\trangeValidation,\n\t\t\tnoKeyDownChange,\n\t\t\tversion,\n\t\t\tnoMaxCharCheck,\n\t\t\tlabelElement,\n\t\t\tautoGrow,\n\t\t\tminHeight,\n\t\t\tmaxHeight,\n\t\t\tlabelTextBold,\n\t\t\ttruncateText,\n\t\t\tmaxCharLimitPosition,\n\t\t\tmaxCharStyle,\n\t\t\thightlightInputColor,\n\t\t\tonKeyDownEvent,\n\t\t\thideInputHeader,\n\t\t\thideBorder,\n\t\t\tinputWrapperStyles,\n\t\t\tminCharsToTrigger,\n\t\t\tmaxCharAlignment,\n\t\t\tisDisabled = false,\n\t\t\tallowUnsafeInput,\n\t\t\tleftIconStyle,\n\t\t} = {\n\t\t\tmaxCharLimit: 0,\n\t\t\ttype: 'text' as InputTypeI,\n\t\t\tvariant: 'default' as InputVariant,\n\t\t\tmaxCharLimitPosition: 'TOP',\n\t\t\tminCharsToTrigger: 0,\n\t\t\tmaxCharAlignment: false,\n\t\t\t...props,\n\t\t};\n\t\tconst LeftIcon = leftIcon?.icon;\n\t\tconst RightIcon = rightIcon?.icon;\n\t\tconst [isInvalid, setIsInvalid] = useState<boolean>(false);\n\t\tconst [isActive, setIsActive] = useState<boolean>(false);\n\t\tconst [errorMessage, setErrorMessage] = useState<string>();\n\t\tconst iconSize =\n\t\t\tvariant === 'x-small' ? '12px' : variant === 'small' ? '18px' : '22px';\n\t\tconst stylesFromOutside = useContext(InputStyleContext);\n\t\tconst [inputValue, setInputValue] = useState<string>('');\n\t\tconst _ref = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n\t\tconst inputRef: MutableRefObject<HTMLInputElement | HTMLTextAreaElement> =\n\t\t\t(fRef ?? _ref) as MutableRefObject<\n\t\t\t\tHTMLInputElement | HTMLTextAreaElement\n\t\t\t>;\n\n\t\tuseEffect(() => {\n\t\t\tsetInputValue(value || '');\n\t\t\tif (!value && autoGrow) {\n\t\t\t\tinputRef.current.style.height = minHeight || '48px';\n\t\t\t}\n\t\t}, [value]);\n\n\t\tuseEffect(() => {\n\t\t\tif (!inputRef.current) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tprops.onReferenceInit?.(inputRef.current);\n\t\t}, [inputRef]);\n\n\t\tuseEffect(() => {\n\t\t\tconst numberInput = inputRef.current;\n\t\t\tif (numberInput && ['phonenumber', 'zip', 'number'].includes(type)) {\n\t\t\t\tnumberInput.addEventListener('wheel', onWheel, { passive: false });\n\n\t\t\t\treturn () => {\n\t\t\t\t\tnumberInput.removeEventListener('wheel', onWheel);\n\t\t\t\t};\n\t\t\t}\n\t\t}, []);\n\n\t\tuseEffect(() => {\n\t\t\tif (!reset) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetInputValue('');\n\t\t}, [reset]);\n\n\t\tuseEffect(() => {\n\t\t\tsetIsActive(!!props.isActive);\n\t\t\tif (props.isActive) {\n\t\t\t\tinputRef.current?.focus();\n\t\t\t}\n\t\t}, [props.isActive]);\n\n\t\tuseEffect(() => {\n\t\t\tsetErrorMessage(props.errorMessage);\n\t\t}, [props.errorMessage]);\n\n\t\tuseEffect(() => {\n\t\t\tsetIsInvalid(false);\n\t\t\tif (\n\t\t\t\tprops.state === 'invalid' ||\n\t\t\t\terrorMessage ||\n\t\t\t\tprops.state === 'disabled-invalid'\n\t\t\t) {\n\t\t\t\tsetIsInvalid(true);\n\t\t\t}\n\t\t\tif (props.state === 'active') {\n\t\t\t\tinputRef.current?.focus();\n\t\t\t}\n\t\t}, [props.state, errorMessage]);\n\n\t\tuseEffect(() => {\n\t\t\tsetIsInvalid(!!errorMessage || props.state === 'invalid');\n\t\t}, [errorMessage, props.state]);\n\n\t\tconst executeCallback = (cb: any, ...params: any[]): void => {\n\t\t\tif (!isFunction(cb)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcb(...params);\n\t\t};\n\n\t\tconst getMaxChar = () => {\n\t\t\tif (type === 'zip') {\n\t\t\t\treturn 6;\n\t\t\t}\n\t\t\treturn 2000;\n\t\t};\n\n\t\tconst onKeyDown = (e) => {\n\t\t\tconst MAX_CHAR_LIMIT = maxCharLimit !== 0 ? maxCharLimit : getMaxChar();\n\t\t\tconst KEY_CODES_TO_BE_EXCLUDED = [8];\n\t\t\tconst MIN_CHAR_LIMIT = minCharsToTrigger;\n\t\t\tconst inputText = e.target.value;\n\t\t\tif (\n\t\t\t\tonKeyDownEvent &&\n\t\t\t\t(!inputText.length || inputText.length >= MIN_CHAR_LIMIT)\n\t\t\t) {\n\t\t\t\tonKeyDownEvent(e);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!noKeyDownChange &&\n\t\t\t\t(!inputText.length || inputText.length >= MIN_CHAR_LIMIT)\n\t\t\t) {\n\t\t\t\tonChangeText(value || '', e);\n\t\t\t}\n\t\t\tif (noMaxCharCheck) return;\n\n\t\t\tif (\n\t\t\t\t!KEY_CODES_TO_BE_EXCLUDED.includes(e.which) &&\n\t\t\t\tMAX_CHAR_LIMIT > 0 &&\n\t\t\t\tinputText.length >= MAX_CHAR_LIMIT\n\t\t\t) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t};\n\n\t\tconst onWheel = (event) => {\n\t\t\tevent.preventDefault(); // Prevent the default scroll behavior\n\t\t};\n\n\t\tconst onChange = (e) => {\n\t\t\tlet inputText = e.target.value;\n\t\t\tconst MAX_CHAR_LIMIT =\n\t\t\t\tmaxCharLimit !== 0 ? maxCharLimit + 1 : getMaxChar();\n\t\t\tconst MIN_CHAR_LIMIT = minCharsToTrigger;\n\n\t\t\tif (!allowUnsafeInput && shouldSanitizeForType(type)) {\n\t\t\t\tinputText = sanitizeUnsafeInput(inputText);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!noMaxCharCheck &&\n\t\t\t\tMAX_CHAR_LIMIT > 0 &&\n\t\t\t\tinputText.length >= MAX_CHAR_LIMIT\n\t\t\t) {\n\t\t\t\t// letting user to copy paste text upto max limit instead of blank action\n\t\t\t\tinputText = inputText.substring(0, MAX_CHAR_LIMIT - 1);\n\t\t\t}\n\n\t\t\tif (!props.textControl) {\n\t\t\t\tsetInputValue(inputText || '');\n\t\t\t}\n\t\t\tif (MIN_CHAR_LIMIT && inputText && inputText.length < MIN_CHAR_LIMIT) {\n\t\t\t\t// if minCharsToTrigger exists and is not reached, do nothing\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonChangeText(inputText, e);\n\t\t\tif (autoGrow) {\n\t\t\t\tinputRef.current.style.height = `${inputRef.current.scrollHeight}px`;\n\t\t\t\tif (!inputText) {\n\t\t\t\t\tinputRef.current.style.height = minHeight || '48px';\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst validateFunction = validate || validateInput;\n\t\t\tif (!validateFunction || !isFunction(validateFunction)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst [isValid, error] = validateFunction(\n\t\t\t\tinputText,\n\t\t\t\ttype,\n\t\t\t\trangeValidation,\n\t\t\t);\n\n\t\t\tsetIsInvalid(!isValid);\n\t\t\tsetErrorMessage(props.errorMessage ? props.errorMessage : error);\n\t\t};\n\n\t\tconst onFocus = (e) => {\n\t\t\tif (!props.skipFocus) {\n\t\t\t\tsetIsActive(true);\n\t\t\t}\n\t\t\texecuteCallback(props.onFocus?.(e));\n\t\t};\n\n\t\tconst onBlur = (e) => {\n\t\t\tif (!props.skipFocus) {\n\t\t\t\tsetIsActive(false);\n\t\t\t}\n\t\t\texecuteCallback(props.onBlur?.(e));\n\t\t};\n\n\t\tconst getInputHTML = () => {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t{type !== 'multiline' && (\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclassName={truncateText ? 'truncate-class' : ''}\n\t\t\t\t\t\t\tdata-test={props['data-test']}\n\t\t\t\t\t\t\tid={props.id}\n\t\t\t\t\t\t\tstyle={stylesFromOutside?.input ?? {}}\n\t\t\t\t\t\t\tref={inputRef as Ref<HTMLInputElement>}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\ttype={\n\t\t\t\t\t\t\t\t['phonenumber', 'zip', 'number'].includes(type)\n\t\t\t\t\t\t\t\t\t? 'number'\n\t\t\t\t\t\t\t\t\t: type\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={inputValue}\n\t\t\t\t\t\t\tonFocus={(e) => onFocus(e)}\n\t\t\t\t\t\t\tonBlur={(e) => onBlur(e)}\n\t\t\t\t\t\t\tplaceholder={placeholder || 'Enter here'}\n\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\tonClick={(e) => executeCallback(props.onClick)}\n\t\t\t\t\t\t\tonKeyDown={(e) => onKeyDown(e)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{type === 'multiline' && (\n\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\tdata-test={props['data-test']}\n\t\t\t\t\t\t\tvalue={inputValue}\n\t\t\t\t\t\t\tref={inputRef as Ref<HTMLTextAreaElement>}\n\t\t\t\t\t\t\tonFocus={(e) => onFocus(e)}\n\t\t\t\t\t\t\tonBlur={(e) => onBlur(e)}\n\t\t\t\t\t\t\tonClick={(e) => executeCallback(props.onClick)}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\tplaceholder={placeholder || 'Enter here'}\n\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\tonKeyDown={(e) => onKeyDown(e)}\n\t\t\t\t\t\t\tmaxLength={maxCharLimit > 0 ? maxCharLimit : undefined}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t);\n\t\t};\n\n\t\treturn (\n\t\t\t<SC.RootContainer\n\t\t\t\twidth={props.width}\n\t\t\t\theight={props.height}\n\t\t\t\tstate={state}\n\t\t\t\ttype={type}\n\t\t\t\tstyle={stylesFromOutside?.RootContainer ?? {}}\n\t\t\t>\n\t\t\t\t<div className=\"flex-align-center\">\n\t\t\t\t\t{!noErrorHint && (!!hintText || !!errorMessage) && (\n\t\t\t\t\t\t<SC.InputFooter invalid={!!errorMessage}>\n\t\t\t\t\t\t\t{!!errorMessage && <ErrorIcon width={16} height={16} />}\n\t\t\t\t\t\t\t{errorMessage || hintText}\n\t\t\t\t\t\t</SC.InputFooter>\n\t\t\t\t\t)}\n\t\t\t\t\t{maxCharLimit > 0 && maxCharLimitPosition === 'BOTTOM' && (\n\t\t\t\t\t\t<SC.MaxCharStyle position={'BOTTOM'} style={maxCharStyle}>\n\t\t\t\t\t\t\t{(value ?? '').toString()?.length ?? 0}/{maxCharLimit}\n\t\t\t\t\t\t</SC.MaxCharStyle>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t<SC.InputWrapper\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tstate={state}\n\t\t\t\t\twidth={props.width}\n\t\t\t\t\tisActive={state === 'active' || isActive}\n\t\t\t\t\tisInvalid={isInvalid}\n\t\t\t\t\tstyle={stylesFromOutside?.InputWrapper ?? inputWrapperStyles ?? {}}\n\t\t\t\t\tversion={version}\n\t\t\t\t\theight={props.height}\n\t\t\t\t\thightlightInputColor={hightlightInputColor}\n\t\t\t\t\thideBorder={hideBorder}\n\t\t\t\t>\n\t\t\t\t\t{!!LeftIcon && (\n\t\t\t\t\t\t<SC.IconHolder\n\t\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\t\t\tonClick={() => executeCallback(leftIcon?.callback)}\n\t\t\t\t\t\t\tisLeft={true}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t...(stylesFromOutside?.IconHolder ?? {}),\n\t\t\t\t\t\t\t\t...leftIconStyle,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<LeftIcon />\n\t\t\t\t\t\t</SC.IconHolder>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!prefixText && (\n\t\t\t\t\t\t<PrefixHolder variant={variant}>{prefixText}</PrefixHolder>\n\t\t\t\t\t)}\n\t\t\t\t\t{variant === 'default' && (\n\t\t\t\t\t\t<SC.InputContainer\n\t\t\t\t\t\t\theight={props.height}\n\t\t\t\t\t\t\ttype={props.type}\n\t\t\t\t\t\t\tminHeight={minHeight}\n\t\t\t\t\t\t\tmaxHeight={maxHeight}\n\t\t\t\t\t\t\tautoGrow={autoGrow}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{getInputHTML()}\n\t\t\t\t\t\t</SC.InputContainer>\n\t\t\t\t\t)}\n\t\t\t\t\t{variant === 'small' && (\n\t\t\t\t\t\t<SC.InputContainerSmall height={props.height} type={props.type}>\n\t\t\t\t\t\t\t{getInputHTML()}\n\t\t\t\t\t\t</SC.InputContainerSmall>\n\t\t\t\t\t)}\n\t\t\t\t\t{variant === 'x-small' && (\n\t\t\t\t\t\t<SC.InputContainerXSmall height={props.height} type={props.type}>\n\t\t\t\t\t\t\t{getInputHTML()}\n\t\t\t\t\t\t</SC.InputContainerXSmall>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!RightIcon && (\n\t\t\t\t\t\t<SC.IconHolder\n\t\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\t\t\tonClick={() => executeCallback(rightIcon?.callback)}\n\t\t\t\t\t\t\tisLeft={false}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RightIcon />\n\t\t\t\t\t\t</SC.IconHolder>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!suffixText && (\n\t\t\t\t\t\t<SuffixHolder variant={variant}>{suffixText}</SuffixHolder>\n\t\t\t\t\t)}\n\t\t\t\t\t{button && button.text && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tbuttonText={button.text}\n\t\t\t\t\t\t\tbuttonType={button.buttonType}\n\t\t\t\t\t\t\tonClick={() => executeCallback(button?.onClick)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{button && button.buttonProps && <Button {...button.buttonProps} />}\n\t\t\t\t</SC.InputWrapper>\n\t\t\t\t{!hideInputHeader && (!!labelText || !!maxCharLimit) && (\n\t\t\t\t\t<SC.InputHeader\n\t\t\t\t\t\tinvalid={isInvalid}\n\t\t\t\t\t\tmaxCharAlignment={maxCharAlignment}\n\t\t\t\t\t>\n\t\t\t\t\t\t{labelElement && labelElement}\n\t\t\t\t\t\t<div className=\"label__container\">\n\t\t\t\t\t\t\t{labelTextBold ? (\n\t\t\t\t\t\t\t\t<TitleSmall>\n\t\t\t\t\t\t\t\t\t{labelText}\n\t\t\t\t\t\t\t\t\t{isRequired ? <span>*</span> : ''}\n\t\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<BodySecondary>\n\t\t\t\t\t\t\t\t\t{labelText}\n\t\t\t\t\t\t\t\t\t{isRequired ? <span>*</span> : ''}\n\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{props.tooltipText && (\n\t\t\t\t\t\t\t\t<Tooltip body={props.tooltipText} placement={'top'}>\n\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t<InfoIcon\n\t\t\t\t\t\t\t\t\t\t\tstyle={{ marginTop: -3 }}\n\t\t\t\t\t\t\t\t\t\t\twidth={18}\n\t\t\t\t\t\t\t\t\t\t\theight={18}\n\t\t\t\t\t\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\t\t\t\t\t\tisInvalid\n\t\t\t\t\t\t\t\t\t\t\t\t\t? COLORS.content.negative\n\t\t\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.primary\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{maxCharLimit > 0 && maxCharLimitPosition === 'TOP' && (\n\t\t\t\t\t\t\t<SC.MaxCharStyle style={maxCharStyle}>\n\t\t\t\t\t\t\t\t{(value ?? '').toString()?.length ?? 0}/{maxCharLimit}\n\t\t\t\t\t\t\t</SC.MaxCharStyle>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</SC.InputHeader>\n\t\t\t\t)}\n\t\t\t</SC.RootContainer>\n\t\t);\n\t},\n);\n\nInput.displayName = 'Input';\n"],"names":["Input","forwardRef","props","fRef","placeholder","leftIcon","rightIcon","labelText","maxCharLimit","isRequired","hintText","type","state","validate","variant","button","suffixText","prefixText","onChangeText","value","noErrorHint","reset","rangeValidation","noKeyDownChange","version","noMaxCharCheck","labelElement","autoGrow","minHeight","maxHeight","labelTextBold","truncateText","maxCharLimitPosition","maxCharStyle","hightlightInputColor","onKeyDownEvent","hideInputHeader","hideBorder","inputWrapperStyles","minCharsToTrigger","maxCharAlignment","isDisabled","allowUnsafeInput","leftIconStyle","LeftIcon","RightIcon","isInvalid","setIsInvalid","useState","isActive","setIsActive","errorMessage","setErrorMessage","iconSize","stylesFromOutside","useContext","InputStyleContext","inputValue","setInputValue","_ref","useRef","inputRef","useEffect","numberInput","onWheel","executeCallback","cb","params","isFunction","getMaxChar","onKeyDown","e","MAX_CHAR_LIMIT","KEY_CODES_TO_BE_EXCLUDED","MIN_CHAR_LIMIT","inputText","event","onChange","shouldSanitizeForType","sanitizeUnsafeInput","validateFunction","validateInput","isValid","error","onFocus","onBlur","getInputHTML","jsxs","Fragment","jsx","SC.RootContainer","SC.InputFooter","ErrorIcon","SC.MaxCharStyle","SC.InputWrapper","SC.IconHolder","PrefixHolder","SC.InputContainer","SC.InputContainerSmall","SC.InputContainerXSmall","SuffixHolder","Button","SC.InputHeader","TitleSmall","BodySecondary","Tooltip","InfoIcon","COLORS"],"mappings":"qeA0BaA,GAAQC,EAAAA,WACpB,CACCC,EACAC,KACI,CACJ,KAAM,CACL,YAAAC,EACA,SAAAC,EACA,UAAAC,EACA,UAAAC,EACA,aAAAC,EACA,WAAAC,EACA,SAAAC,EACA,KAAAC,EACA,MAAAC,EACA,SAAAC,GACA,QAAAC,EACA,OAAAC,EACA,WAAAC,EACA,WAAAC,EACA,aAAAC,EACA,MAAAC,EACA,YAAAC,GACA,MAAAC,EACA,gBAAAC,GACA,gBAAAC,GACA,QAAAC,GACA,eAAAC,EACA,aAAAC,EACA,SAAAC,EACA,UAAAC,EACA,UAAAC,GACA,cAAAC,GACA,aAAAC,GACA,qBAAAC,EACA,aAAAC,EACA,qBAAAC,GACA,eAAAC,EACA,gBAAAC,GACA,WAAAC,GACA,mBAAAC,GACA,kBAAAC,EACA,iBAAAC,GACA,WAAAC,EAAa,GACb,iBAAAC,GACA,cAAAC,EAAA,EACG,CACH,aAAc,EACd,KAAM,OACN,QAAS,UACT,qBAAsB,MACtB,kBAAmB,EACnB,iBAAkB,GAClB,GAAGzC,CAAA,EAEE0C,EAAWvC,GAAU,KACrBwC,EAAYvC,GAAW,KACvB,CAACwC,EAAWC,CAAY,EAAIC,EAAAA,SAAkB,EAAK,EACnD,CAACC,GAAUC,CAAW,EAAIF,EAAAA,SAAkB,EAAK,EACjD,CAACG,EAAcC,CAAe,EAAIJ,WAAA,EAClCK,EACLvC,IAAY,UAAY,OAASA,IAAY,QAAU,OAAS,OAC3DwC,EAAoBC,EAAAA,WAAWC,oBAAiB,EAChD,CAACC,EAAYC,CAAa,EAAIV,EAAAA,SAAiB,EAAE,E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,EAAM,aACNuF,EAAAA,IAACgB,GAAAA,QAAA,CAAQ,KAAMvG,EAAM,YAAa,UAAW,MAC5C,SAAAuF,EAAAA,IAAC,OAAA,CACA,SAAAA,EAAAA,IAACiB,GAAAA,QAAA,CACA,MAAO,CAAE,UAAW,EAAA,EACpB,MAAO,GACP,OAAQ,GACR,MACC5D,EACG6D,GAAAA,OAAO,QAAQ,SACfA,GAAAA,OAAO,QAAQ,OAAA,CAAA,EAGrB,CAAA,CACD,CAAA,EAEF,EACCnG,EAAe,GAAKwB,IAAyB,cAC5C6D,EAAAA,aAAA,CAAgB,MAAO5D,EACrB,SAAA,EAAAd,GAAS,IAAI,SAAA,GAAY,QAAU,EAAE,IAAEX,CAAA,CAAA,CAC1C,CAAA,CAAA,CAAA,CAEF,CAAA,CAAA,CAIJ,CACD,EAEAR,GAAM,YAAc"}
1
+ {"version":3,"file":"Input.js","sources":["../../../../src/components/input/Input.tsx"],"sourcesContent":["import InfoIcon from '@src/assets/icons/info.svg';\nimport React, {\n\tforwardRef,\n\tMutableRefObject,\n\tRef,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport { Button } from '@src/components/button';\nimport {\n\tisFunction,\n\tsanitizeUnsafeInput,\n\tshouldSanitizeForType,\n\tvalidateInput,\n} from '@src/components/input/Input-helper';\nimport { Tooltip } from '@src/components/tooltips';\nimport { BodySecondary, TitleSmall } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport ErrorIcon from '../../assets/icons/errorInfo.svg';\nimport { InputStyleContext } from './context/InputStyleProvider';\nimport { InputProps, InputTypeI, InputVariant } from './Input.model';\nimport * as SC from './Input.styled';\nimport { PrefixHolder, SuffixHolder } from './Input.styled';\n\nexport const Input = forwardRef(\n\t(\n\t\tprops: InputProps,\n\t\tfRef: React.ForwardedRef<HTMLInputElement | HTMLTextAreaElement | null>,\n\t) => {\n\t\tconst {\n\t\t\tplaceholder,\n\t\t\tleftIcon,\n\t\t\trightIcon,\n\t\t\tlabelText,\n\t\t\tmaxCharLimit,\n\t\t\tisRequired,\n\t\t\thintText,\n\t\t\ttype,\n\t\t\tstate,\n\t\t\tvalidate,\n\t\t\tvariant,\n\t\t\tbutton,\n\t\t\tsuffixText,\n\t\t\tprefixText,\n\t\t\tonChangeText,\n\t\t\tvalue,\n\t\t\tnoErrorHint,\n\t\t\treset,\n\t\t\trangeValidation,\n\t\t\tnoKeyDownChange,\n\t\t\tversion,\n\t\t\tnoMaxCharCheck,\n\t\t\tlabelElement,\n\t\t\tautoGrow,\n\t\t\tminHeight,\n\t\t\tmaxHeight,\n\t\t\tlabelTextBold,\n\t\t\ttruncateText,\n\t\t\tmaxCharLimitPosition,\n\t\t\tmaxCharStyle,\n\t\t\thightlightInputColor,\n\t\t\tonKeyDownEvent,\n\t\t\thideInputHeader,\n\t\t\thideBorder,\n\t\t\tinputWrapperStyles,\n\t\t\tminCharsToTrigger,\n\t\t\tmaxCharAlignment,\n\t\t\tisDisabled = false,\n\t\t\tallowUnsafeInput,\n\t\t\tleftIconStyle,\n\t\t} = {\n\t\t\tmaxCharLimit: 0,\n\t\t\ttype: 'text' as InputTypeI,\n\t\t\tvariant: 'default' as InputVariant,\n\t\t\tmaxCharLimitPosition: 'TOP',\n\t\t\tminCharsToTrigger: 0,\n\t\t\tmaxCharAlignment: false,\n\t\t\t...props,\n\t\t};\n\t\tconst LeftIcon = leftIcon?.icon;\n\t\tconst RightIcon = rightIcon?.icon;\n\t\tconst [isInvalid, setIsInvalid] = useState<boolean>(false);\n\t\tconst [isActive, setIsActive] = useState<boolean>(false);\n\t\tconst [errorMessage, setErrorMessage] = useState<string>();\n\t\tconst iconSize =\n\t\t\tvariant === 'x-small' ? '12px' : variant === 'small' ? '18px' : '22px';\n\t\tconst stylesFromOutside = useContext(InputStyleContext);\n\t\tconst [inputValue, setInputValue] = useState<string>('');\n\t\tconst _ref = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n\t\tconst inputRef: MutableRefObject<HTMLInputElement | HTMLTextAreaElement> =\n\t\t\t(fRef ?? _ref) as MutableRefObject<\n\t\t\t\tHTMLInputElement | HTMLTextAreaElement\n\t\t\t>;\n\n\t\tuseEffect(() => {\n\t\t\tsetInputValue(value || '');\n\t\t\tif (!value && autoGrow) {\n\t\t\t\tinputRef.current.style.height = minHeight || '48px';\n\t\t\t}\n\t\t}, [value]);\n\n\t\tuseEffect(() => {\n\t\t\tif (!inputRef.current) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tprops.onReferenceInit?.(inputRef.current);\n\t\t}, [inputRef]);\n\n\t\tuseEffect(() => {\n\t\t\tconst numberInput = inputRef.current;\n\t\t\tif (numberInput && ['phonenumber', 'zip', 'number'].includes(type)) {\n\t\t\t\tnumberInput.addEventListener('wheel', onWheel, { passive: false });\n\n\t\t\t\treturn () => {\n\t\t\t\t\tnumberInput.removeEventListener('wheel', onWheel);\n\t\t\t\t};\n\t\t\t}\n\t\t}, []);\n\n\t\tuseEffect(() => {\n\t\t\tif (!reset) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetInputValue('');\n\t\t}, [reset]);\n\n\t\tuseEffect(() => {\n\t\t\tsetIsActive(!!props.isActive);\n\t\t\tif (props.isActive) {\n\t\t\t\tinputRef.current?.focus();\n\t\t\t}\n\t\t}, [props.isActive]);\n\n\t\tuseEffect(() => {\n\t\t\tsetErrorMessage(props.errorMessage);\n\t\t}, [props.errorMessage]);\n\n\t\tuseEffect(() => {\n\t\t\tsetIsInvalid(false);\n\t\t\tif (\n\t\t\t\tprops.state === 'invalid' ||\n\t\t\t\terrorMessage ||\n\t\t\t\tprops.state === 'disabled-invalid'\n\t\t\t) {\n\t\t\t\tsetIsInvalid(true);\n\t\t\t}\n\t\t\tif (props.state === 'active') {\n\t\t\t\tinputRef.current?.focus();\n\t\t\t}\n\t\t}, [props.state, errorMessage]);\n\n\t\tuseEffect(() => {\n\t\t\tsetIsInvalid(!!errorMessage || props.state === 'invalid');\n\t\t}, [errorMessage, props.state]);\n\n\t\tconst executeCallback = (cb: any, ...params: any[]): void => {\n\t\t\tif (!isFunction(cb)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcb(...params);\n\t\t};\n\n\t\tconst getMaxChar = () => {\n\t\t\tif (type === 'zip') {\n\t\t\t\treturn 6;\n\t\t\t}\n\t\t\treturn 2000;\n\t\t};\n\n\t\tconst onKeyDown = (e) => {\n\t\t\tconst MAX_CHAR_LIMIT = maxCharLimit !== 0 ? maxCharLimit : getMaxChar();\n\t\t\tconst KEY_CODES_TO_BE_EXCLUDED = [8];\n\t\t\tconst MIN_CHAR_LIMIT = minCharsToTrigger;\n\t\t\tconst inputText = e.target.value;\n\t\t\tif (\n\t\t\t\tonKeyDownEvent &&\n\t\t\t\t(!inputText.length || inputText.length >= MIN_CHAR_LIMIT)\n\t\t\t) {\n\t\t\t\tonKeyDownEvent(e);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!noKeyDownChange &&\n\t\t\t\t(!inputText.length || inputText.length >= MIN_CHAR_LIMIT)\n\t\t\t) {\n\t\t\t\tonChangeText(value || '', e);\n\t\t\t}\n\t\t\tif (noMaxCharCheck) return;\n\n\t\t\tif (\n\t\t\t\t!KEY_CODES_TO_BE_EXCLUDED.includes(e.which) &&\n\t\t\t\tMAX_CHAR_LIMIT > 0 &&\n\t\t\t\tinputText.length >= MAX_CHAR_LIMIT\n\t\t\t) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t};\n\n\t\tconst onWheel = (event) => {\n\t\t\tevent.preventDefault(); // Prevent the default scroll behavior\n\t\t};\n\n\t\tconst onChange = (e) => {\n\t\t\tlet inputText = e.target.value;\n\t\t\tconst MAX_CHAR_LIMIT =\n\t\t\t\tmaxCharLimit !== 0 ? maxCharLimit + 1 : getMaxChar();\n\t\t\tconst MIN_CHAR_LIMIT = minCharsToTrigger;\n\n\t\t\tif (!allowUnsafeInput && shouldSanitizeForType(type)) {\n\t\t\t\tinputText = sanitizeUnsafeInput(inputText);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t!noMaxCharCheck &&\n\t\t\t\tMAX_CHAR_LIMIT > 0 &&\n\t\t\t\tinputText.length >= MAX_CHAR_LIMIT\n\t\t\t) {\n\t\t\t\t// letting user to copy paste text upto max limit instead of blank action\n\t\t\t\tinputText = inputText.substring(0, MAX_CHAR_LIMIT - 1);\n\t\t\t}\n\n\t\t\tif (!props.textControl) {\n\t\t\t\tsetInputValue(inputText || '');\n\t\t\t}\n\t\t\tif (MIN_CHAR_LIMIT && inputText && inputText.length < MIN_CHAR_LIMIT) {\n\t\t\t\t// if minCharsToTrigger exists and is not reached, do nothing\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonChangeText(inputText, e);\n\t\t\tif (autoGrow) {\n\t\t\t\tinputRef.current.style.height = `${inputRef.current.scrollHeight}px`;\n\t\t\t\tif (!inputText) {\n\t\t\t\t\tinputRef.current.style.height = minHeight || '48px';\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst validateFunction = validate || validateInput;\n\t\t\tif (!validateFunction || !isFunction(validateFunction)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst [isValid, error] = validateFunction(\n\t\t\t\tinputText,\n\t\t\t\ttype,\n\t\t\t\trangeValidation,\n\t\t\t);\n\n\t\t\tsetIsInvalid(!isValid);\n\t\t\tsetErrorMessage(props.errorMessage ? props.errorMessage : error);\n\t\t};\n\n\t\tconst onFocus = (e) => {\n\t\t\tif (!props.skipFocus) {\n\t\t\t\tsetIsActive(true);\n\t\t\t}\n\t\t\texecuteCallback(props.onFocus?.(e));\n\t\t};\n\n\t\tconst onBlur = (e) => {\n\t\t\tif (!props.skipFocus) {\n\t\t\t\tsetIsActive(false);\n\t\t\t}\n\t\t\texecuteCallback(props.onBlur?.(e));\n\t\t};\n\n\t\tconst getInputHTML = () => {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t{type !== 'multiline' && (\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclassName={truncateText ? 'truncate-class' : ''}\n\t\t\t\t\t\t\tdata-test={props['data-test']}\n\t\t\t\t\t\t\tid={props.id}\n\t\t\t\t\t\t\tstyle={stylesFromOutside?.input ?? {}}\n\t\t\t\t\t\t\tref={inputRef as Ref<HTMLInputElement>}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\ttype={\n\t\t\t\t\t\t\t\t['phonenumber', 'zip', 'number'].includes(type)\n\t\t\t\t\t\t\t\t\t? 'number'\n\t\t\t\t\t\t\t\t\t: type\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={inputValue}\n\t\t\t\t\t\t\tonFocus={(e) => onFocus(e)}\n\t\t\t\t\t\t\tonBlur={(e) => onBlur(e)}\n\t\t\t\t\t\t\tplaceholder={placeholder || 'Enter here'}\n\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\tonClick={(e) => executeCallback(props.onClick)}\n\t\t\t\t\t\t\tonKeyDown={(e) => onKeyDown(e)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{type === 'multiline' && (\n\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\tdata-test={props['data-test']}\n\t\t\t\t\t\t\tvalue={inputValue}\n\t\t\t\t\t\t\tref={inputRef as Ref<HTMLTextAreaElement>}\n\t\t\t\t\t\t\tonFocus={(e) => onFocus(e)}\n\t\t\t\t\t\t\tonBlur={(e) => onBlur(e)}\n\t\t\t\t\t\t\tonClick={(e) => executeCallback(props.onClick)}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\tplaceholder={placeholder || 'Enter here'}\n\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\tonKeyDown={(e) => onKeyDown(e)}\n\t\t\t\t\t\t\tmaxLength={maxCharLimit > 0 ? maxCharLimit : undefined}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t);\n\t\t};\n\n\t\treturn (\n\t\t\t<SC.RootContainer\n\t\t\t\twidth={props.width}\n\t\t\t\theight={props.height}\n\t\t\t\tstate={state}\n\t\t\t\ttype={type}\n\t\t\t\tstyle={stylesFromOutside?.RootContainer ?? {}}\n\t\t\t>\n\t\t\t\t<div className=\"flex-align-center\">\n\t\t\t\t\t{!noErrorHint && (!!hintText || !!errorMessage) && (\n\t\t\t\t\t\t<SC.InputFooter invalid={!!errorMessage}>\n\t\t\t\t\t\t\t{!!errorMessage && <ErrorIcon width={16} height={16} />}\n\t\t\t\t\t\t\t{errorMessage || hintText}\n\t\t\t\t\t\t</SC.InputFooter>\n\t\t\t\t\t)}\n\t\t\t\t\t{maxCharLimit > 0 && maxCharLimitPosition === 'BOTTOM' && (\n\t\t\t\t\t\t<SC.MaxCharStyle position={'BOTTOM'} style={maxCharStyle}>\n\t\t\t\t\t\t\t{(value ?? '').toString()?.length ?? 0}/{maxCharLimit}\n\t\t\t\t\t\t</SC.MaxCharStyle>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t<SC.InputWrapper\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tstate={state}\n\t\t\t\t\twidth={props.width}\n\t\t\t\t\tisActive={state === 'active' || isActive}\n\t\t\t\t\tisInvalid={isInvalid}\n\t\t\t\t\tstyle={stylesFromOutside?.InputWrapper ?? inputWrapperStyles ?? {}}\n\t\t\t\t\tversion={version}\n\t\t\t\t\theight={props.height}\n\t\t\t\t\thightlightInputColor={hightlightInputColor}\n\t\t\t\t\thideBorder={hideBorder}\n\t\t\t\t>\n\t\t\t\t\t{!!LeftIcon && (\n\t\t\t\t\t\t<SC.IconHolder\n\t\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\t\t\tonClick={() => executeCallback(leftIcon?.callback)}\n\t\t\t\t\t\t\tisLeft={true}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t...(stylesFromOutside?.IconHolder ?? {}),\n\t\t\t\t\t\t\t\t...leftIconStyle,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<LeftIcon />\n\t\t\t\t\t\t</SC.IconHolder>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!prefixText && (\n\t\t\t\t\t\t<PrefixHolder variant={variant}>{prefixText}</PrefixHolder>\n\t\t\t\t\t)}\n\t\t\t\t\t{variant === 'default' && (\n\t\t\t\t\t\t<SC.InputContainer\n\t\t\t\t\t\t\theight={props.height}\n\t\t\t\t\t\t\ttype={props.type}\n\t\t\t\t\t\t\tminHeight={minHeight}\n\t\t\t\t\t\t\tmaxHeight={maxHeight}\n\t\t\t\t\t\t\tautoGrow={autoGrow}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{getInputHTML()}\n\t\t\t\t\t\t</SC.InputContainer>\n\t\t\t\t\t)}\n\t\t\t\t\t{variant === 'small' && (\n\t\t\t\t\t\t<SC.InputContainerSmall height={props.height} type={props.type}>\n\t\t\t\t\t\t\t{getInputHTML()}\n\t\t\t\t\t\t</SC.InputContainerSmall>\n\t\t\t\t\t)}\n\t\t\t\t\t{variant === 'x-small' && (\n\t\t\t\t\t\t<SC.InputContainerXSmall height={props.height} type={props.type}>\n\t\t\t\t\t\t\t{getInputHTML()}\n\t\t\t\t\t\t</SC.InputContainerXSmall>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!RightIcon && (\n\t\t\t\t\t\t<SC.IconHolder\n\t\t\t\t\t\t\tvariant={variant}\n\t\t\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\t\t\tonClick={() => executeCallback(rightIcon?.callback)}\n\t\t\t\t\t\t\tisLeft={false}\n\t\t\t\t\t\t\tdata-test={rightIcon?.['data-test']}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RightIcon />\n\t\t\t\t\t\t</SC.IconHolder>\n\t\t\t\t\t)}\n\t\t\t\t\t{!!suffixText && (\n\t\t\t\t\t\t<SuffixHolder variant={variant}>{suffixText}</SuffixHolder>\n\t\t\t\t\t)}\n\t\t\t\t\t{button && button.text && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tbuttonText={button.text}\n\t\t\t\t\t\t\tbuttonType={button.buttonType}\n\t\t\t\t\t\t\tonClick={() => executeCallback(button?.onClick)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{button && button.buttonProps && <Button {...button.buttonProps} />}\n\t\t\t\t</SC.InputWrapper>\n\t\t\t\t{!hideInputHeader && (!!labelText || !!maxCharLimit) && (\n\t\t\t\t\t<SC.InputHeader\n\t\t\t\t\t\tinvalid={isInvalid}\n\t\t\t\t\t\tmaxCharAlignment={maxCharAlignment}\n\t\t\t\t\t>\n\t\t\t\t\t\t{labelElement && labelElement}\n\t\t\t\t\t\t<div className=\"label__container\">\n\t\t\t\t\t\t\t{labelTextBold ? (\n\t\t\t\t\t\t\t\t<TitleSmall>\n\t\t\t\t\t\t\t\t\t{labelText}\n\t\t\t\t\t\t\t\t\t{isRequired ? <span>*</span> : ''}\n\t\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<BodySecondary>\n\t\t\t\t\t\t\t\t\t{labelText}\n\t\t\t\t\t\t\t\t\t{isRequired ? <span>*</span> : ''}\n\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{props.tooltipText && (\n\t\t\t\t\t\t\t\t<Tooltip body={props.tooltipText} placement={'top'}>\n\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t<InfoIcon\n\t\t\t\t\t\t\t\t\t\t\tstyle={{ marginTop: -3 }}\n\t\t\t\t\t\t\t\t\t\t\twidth={18}\n\t\t\t\t\t\t\t\t\t\t\theight={18}\n\t\t\t\t\t\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\t\t\t\t\t\tisInvalid\n\t\t\t\t\t\t\t\t\t\t\t\t\t? COLORS.content.negative\n\t\t\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.primary\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{maxCharLimit > 0 && maxCharLimitPosition === 'TOP' && (\n\t\t\t\t\t\t\t<SC.MaxCharStyle style={maxCharStyle}>\n\t\t\t\t\t\t\t\t{(value ?? '').toString()?.length ?? 0}/{maxCharLimit}\n\t\t\t\t\t\t\t</SC.MaxCharStyle>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</SC.InputHeader>\n\t\t\t\t)}\n\t\t\t</SC.RootContainer>\n\t\t);\n\t},\n);\n\nInput.displayName = 'Input';\n"],"names":["Input","forwardRef","props","fRef","placeholder","leftIcon","rightIcon","labelText","maxCharLimit","isRequired","hintText","type","state","validate","variant","button","suffixText","prefixText","onChangeText","value","noErrorHint","reset","rangeValidation","noKeyDownChange","version","noMaxCharCheck","labelElement","autoGrow","minHeight","maxHeight","labelTextBold","truncateText","maxCharLimitPosition","maxCharStyle","hightlightInputColor","onKeyDownEvent","hideInputHeader","hideBorder","inputWrapperStyles","minCharsToTrigger","maxCharAlignment","isDisabled","allowUnsafeInput","leftIconStyle","LeftIcon","RightIcon","isInvalid","setIsInvalid","useState","isActive","setIsActive","errorMessage","setErrorMessage","iconSize","stylesFromOutside","useContext","InputStyleContext","inputValue","setInputValue","_ref","useRef","inputRef","useEffect","numberInput","onWheel","executeCallback","cb","params","isFunction","getMaxChar","onKeyDown","e","MAX_CHAR_LIMIT","KEY_CODES_TO_BE_EXCLUDED","MIN_CHAR_LIMIT","inputText","event","onChange","shouldSanitizeForType","sanitizeUnsafeInput","validateFunction","validateInput","isValid","error","onFocus","onBlur","getInputHTML","jsxs","Fragment","jsx","SC.RootContainer","SC.InputFooter","ErrorIcon","SC.MaxCharStyle","SC.InputWrapper","SC.IconHolder","PrefixHolder","SC.InputContainer","SC.InputContainerSmall","SC.InputContainerXSmall","SuffixHolder","Button","SC.InputHeader","TitleSmall","BodySecondary","Tooltip","InfoIcon","COLORS"],"mappings":"qeA0BaA,GAAQC,EAAAA,WACpB,CACCC,EACAC,KACI,CACJ,KAAM,CACL,YAAAC,EACA,SAAAC,EACA,UAAAC,EACA,UAAAC,EACA,aAAAC,EACA,WAAAC,EACA,SAAAC,EACA,KAAAC,EACA,MAAAC,EACA,SAAAC,GACA,QAAAC,EACA,OAAAC,EACA,WAAAC,EACA,WAAAC,EACA,aAAAC,EACA,MAAAC,EACA,YAAAC,GACA,MAAAC,EACA,gBAAAC,GACA,gBAAAC,GACA,QAAAC,GACA,eAAAC,EACA,aAAAC,EACA,SAAAC,EACA,UAAAC,EACA,UAAAC,GACA,cAAAC,GACA,aAAAC,GACA,qBAAAC,EACA,aAAAC,EACA,qBAAAC,GACA,eAAAC,EACA,gBAAAC,GACA,WAAAC,GACA,mBAAAC,GACA,kBAAAC,EACA,iBAAAC,GACA,WAAAC,EAAa,GACb,iBAAAC,GACA,cAAAC,EAAA,EACG,CACH,aAAc,EACd,KAAM,OACN,QAAS,UACT,qBAAsB,MACtB,kBAAmB,EACnB,iBAAkB,GAClB,GAAGzC,CAAA,EAEE0C,EAAWvC,GAAU,KACrBwC,EAAYvC,GAAW,KACvB,CAACwC,EAAWC,CAAY,EAAIC,EAAAA,SAAkB,EAAK,EACnD,CAACC,GAAUC,CAAW,EAAIF,EAAAA,SAAkB,EAAK,EACjD,CAACG,EAAcC,CAAe,EAAIJ,WAAA,EAClCK,EACLvC,IAAY,UAAY,OAASA,IAAY,QAAU,OAAS,OAC3DwC,EAAoBC,EAAAA,WAAWC,oBAAiB,EAChD,CAACC,EAAYC,CAAa,EAAIV,EAAAA,SAAiB,EAAE,EACjDW,GAAOC,EAAAA,OAA+C,IAAI,EAC1DC,EACJ1D,IAAQwD,GAIVG,E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CAAQ,KAAMvG,EAAM,YAAa,UAAW,MAC5C,SAAAuF,EAAAA,IAAC,OAAA,CACA,SAAAA,EAAAA,IAACiB,GAAAA,QAAA,CACA,MAAO,CAAE,UAAW,EAAA,EACpB,MAAO,GACP,OAAQ,GACR,MACC5D,EACG6D,GAAAA,OAAO,QAAQ,SACfA,GAAAA,OAAO,QAAQ,OAAA,CAAA,EAGrB,CAAA,CACD,CAAA,EAEF,EACCnG,EAAe,GAAKwB,IAAyB,cAC5C6D,EAAAA,aAAA,CAAgB,MAAO5D,EACrB,SAAA,EAAAd,GAAS,IAAI,SAAA,GAAY,QAAU,EAAE,IAAEX,CAAA,CAAA,CAC1C,CAAA,CAAA,CAAA,CAEF,CAAA,CAAA,CAIJ,CACD,EAEAR,GAAM,YAAc"}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("../../assets/icons/arrow_back.svg.js"),c=require("react-dom"),u=require("styled-components"),h=require("./Modal.js"),i=require("../TypographyStyle.js"),d=require("../../constants/Theme.js"),a=require("../button/Button.js"),o=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},f=o(c),n=o(u),x=n.default.div`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("../../assets/icons/arrow_back.svg.js"),r=require("react-dom"),u=require("styled-components"),h=require("./Modal.js"),i=require("../TypographyStyle.js"),d=require("../../constants/Theme.js"),a=require("../button/Button.js"),o=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},f=o(r),n=o(u),x=n.default.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  flex: 1;
@@ -44,5 +44,5 @@
44
44
  box-shadow: ${e=>e.showShadow?"inset 0 -3px 6px rgba(0, 0, 0, 0.12)":"none"};
45
45
  `,w=n.default(a.Button)`
46
46
  margin-right: 8px;
47
- `,B=e=>typeof window>"u"?null:f.default.createPortal(t.jsx(h.Modal,{"data-test":e["data-test"],id:e.id,zIndex:e.zIndex,open:e.open,onClose:e.onClose,closeOnOutsideClick:e.closeOnOutsideClick,closeOnEscapeKey:e.closeOnEscapeKey,centralContainerStyles:e.centralContainerStyles,hideCrossButton:e.hideCrossButton,width:e.width,skipModalWithTimer:e.skipModalWithTimer,timeOut:e.timeOut,children:t.jsxs(x,{style:e.wrapperStyle??{},id:e.innerModalId,children:[(e.headingTitle||e.headingSubtitle||e.headerRightCustomElement)&&t.jsxs(y,{style:e.modalHeaderStyles??{},tintedHeader:e.tintedHeader??!1,children:[e.onBackPress&&t.jsx("div",{style:{cursor:"pointer"},onClick:r=>{e.onBackPress?e.onBackPress():r.stopPropagation()},children:t.jsx(s.default,{width:18,height:18})}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[t.jsxs(l,{children:[" ",e.headingTitle&&t.jsx(i.TitleMedium,{children:e.headingTitle})," "]}),e.isBeta&&t.jsx("div",{style:{padding:"2px 8px",borderRadius:"16px",backgroundColor:"#1877f2",height:"fit-content",width:"fit-content"},children:t.jsx(i.BodyCaption,{style:{color:d.COLORS.surface.standard},children:"BETA"})}),e.headerLeftCustomElement]}),t.jsxs(l,{children:[" ",e.headingSubtitle&&t.jsx(g,{children:e.headingSubtitle})," "]})]}),e.headerRightCustomElement&&t.jsxs(m,{children:[" ",e.headerRightCustomElement," "]})," "]}),e.children&&t.jsxs(S,{style:e.modalBodyStyles??{},showShadow:e.footerShadow??!1,children:[e.children," "]}),(e.primaryButton||e.secondaryButton||e.footerLeftCustomElement)&&t.jsxs(j,{style:e.footerContainerStyle,children:[e.footerLeftCustomElement&&t.jsx(C,{children:e.footerLeftCustomElement}),e.secondaryButton&&t.jsx(w,{...e.secondaryButton}),e.primaryButton&&t.jsx(a.Button,{...e.primaryButton})]})," "]})}),document.body);exports.StyledModal=B;
47
+ `,B=e=>typeof window>"u"?null:f.default.createPortal(t.jsx(h.Modal,{"data-test":e["data-test"],id:e.id,zIndex:e.zIndex,open:e.open,onClose:e.onClose,closeOnOutsideClick:e.closeOnOutsideClick,closeOnEscapeKey:e.closeOnEscapeKey,centralContainerStyles:e.centralContainerStyles,hideCrossButton:e.hideCrossButton,width:e.width,skipModalWithTimer:e.skipModalWithTimer,timeOut:e.timeOut,children:t.jsxs(x,{style:e.wrapperStyle??{},id:e.innerModalId,children:[(e.headingTitle||e.headingSubtitle||e.headerRightCustomElement)&&t.jsxs(y,{style:e.modalHeaderStyles??{},tintedHeader:e.tintedHeader??!1,children:[e.onBackPress&&t.jsx("div",{"data-test":(e["data-test"]||"")+"-back-button",style:{cursor:"pointer"},onClick:s=>{e.onBackPress?e.onBackPress():s.stopPropagation()},children:t.jsx(c.default,{width:18,height:18})}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[t.jsxs(l,{children:[" ",e.headingTitle&&t.jsx(i.TitleMedium,{children:e.headingTitle})," "]}),e.isBeta&&t.jsx("div",{style:{padding:"2px 8px",borderRadius:"16px",backgroundColor:"#1877f2",height:"fit-content",width:"fit-content"},children:t.jsx(i.BodyCaption,{style:{color:d.COLORS.surface.standard},children:"BETA"})}),e.headerLeftCustomElement]}),t.jsxs(l,{children:[" ",e.headingSubtitle&&t.jsx(g,{children:e.headingSubtitle})," "]})]}),e.headerRightCustomElement&&t.jsxs(m,{children:[" ",e.headerRightCustomElement," "]})," "]}),e.children&&t.jsxs(S,{style:e.modalBodyStyles??{},showShadow:e.footerShadow??!1,children:[e.children," "]}),(e.primaryButton||e.secondaryButton||e.footerLeftCustomElement)&&t.jsxs(j,{style:e.footerContainerStyle,children:[e.footerLeftCustomElement&&t.jsx(C,{children:e.footerLeftCustomElement}),e.secondaryButton&&t.jsx(w,{...e.secondaryButton}),e.primaryButton&&t.jsx(a.Button,{...e.primaryButton})]})," "]})}),document.body);exports.StyledModal=B;
48
48
  //# sourceMappingURL=styledModal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styledModal.js","sources":["../../../../src/components/modals/styledModal.tsx"],"sourcesContent":["import BackIcon from '@src/assets/icons/arrow_back.svg';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport styled from 'styled-components';\nimport { Button } from '@src/components/button';\nimport { Modal } from '@src/components/modals/Modal';\nimport {\n\tBodyCaption,\n\tBodyPrimary,\n\tTitleMedium,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport { ButtonProps } from '../button/model';\n\nconst ModalWrapper = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex: 1;\n\talign-items: flex-start;\n\toverflow: hidden;\n\tmax-width: 100%;\n`;\nconst ModalHeader = styled.div<{\n\ttintedHeader: boolean;\n}>`\n\tpadding: 16px 24px;\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-direction: row;\n\tgap: 12px;\n\tjustify-content: center;\n\tbackground-color: ${(props) =>\n\t\tprops.tintedHeader ? COLORS.background.warning.light : 'transparent'};\n\tborder-top-left-radius: ${(props) => (props.tintedHeader ? '4px' : 'none')};\n`;\n\nconst ModalTitles = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n`;\n\nconst ModalCustomisation = styled.div`\n\tdisplay: flex;\n\tmargin-left: auto;\n\tjustify-content: flex-end;\n\talign-items: center;\n`;\n\nconst ModalSubtitle = styled(BodyPrimary)`\n\tmargin-top: 4px;\n\tcolor: ${COLORS.content.secondary} !important;\n`;\n\nconst ModalFooter = styled.div`\n\tpadding: 16px 24px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: end;\n\tmargin-top: auto;\n\twidth: 100%;\n`;\n\nconst ModalFooterRightCustomisation = styled.div`\n\tmargin-right: auto;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-end;\n\theight: calc(100% - 32px);\n`;\n\nconst ModalBody = styled.div<{\n\tshowShadow: boolean;\n}>`\n\twidth: 100%;\n\tz-index: 1;\n\tbox-shadow: ${(props) =>\n\t\tprops.showShadow ? 'inset 0 -3px 6px rgba(0, 0, 0, 0.12)' : 'none'};\n`;\nconst SecondaryButtonWrapper = styled(Button)`\n\tmargin-right: 8px;\n`;\nexport const StyledModal: React.FC<{\n\t'data-test'?: string;\n\topen: boolean;\n\tonClose?: () => void;\n\tchildren?: React.ReactNode;\n\tcentralContainerStyles?: React.CSSProperties;\n\tcloseOnOutsideClick?: boolean;\n\tcloseOnEscapeKey?: boolean;\n\theadingTitle?: string;\n\theadingSubtitle?: string;\n\ttintedHeader?: boolean;\n\tprimaryButton?: ButtonProps;\n\tsecondaryButton?: ButtonProps;\n\tfooterShadow?: boolean;\n\tfooterLeftCustomElement?: React.ReactNode;\n\theaderLeftCustomElement?: React.ReactNode;\n\theaderRightCustomElement?: React.ReactNode;\n\tzIndex?: number;\n\thideCrossButton?: boolean;\n\twidth?: string;\n\twrapperStyle?: React.CSSProperties;\n\tonBackPress?: () => void;\n\tfooterContainerStyle?: React.CSSProperties;\n\tid?: string;\n\tmodalHeaderStyles?: React.CSSProperties;\n\tinnerModalId?: string;\n\tisBeta?: boolean;\n\tmodalBodyStyles?: React.CSSProperties;\n\tskipModalWithTimer?: boolean;\n\ttimeOut?: number;\n}> = (props) => {\n\tif (typeof window === 'undefined') return null;\n\n\treturn ReactDOM.createPortal(\n\t\t<Modal\n\t\t\tdata-test={props['data-test']}\n\t\t\tid={props.id}\n\t\t\tzIndex={props.zIndex}\n\t\t\topen={props.open}\n\t\t\tonClose={props.onClose}\n\t\t\tcloseOnOutsideClick={props.closeOnOutsideClick}\n\t\t\tcloseOnEscapeKey={props.closeOnEscapeKey}\n\t\t\tcentralContainerStyles={props.centralContainerStyles}\n\t\t\thideCrossButton={props.hideCrossButton}\n\t\t\twidth={props.width}\n\t\t\tskipModalWithTimer={props.skipModalWithTimer}\n\t\t\ttimeOut={props.timeOut}\n\t\t>\n\t\t\t<ModalWrapper style={props.wrapperStyle ?? {}} id={props.innerModalId}>\n\t\t\t\t{(props.headingTitle ||\n\t\t\t\t\tprops.headingSubtitle ||\n\t\t\t\t\tprops.headerRightCustomElement) && (\n\t\t\t\t\t<ModalHeader\n\t\t\t\t\t\tstyle={props.modalHeaderStyles ?? {}}\n\t\t\t\t\t\ttintedHeader={props.tintedHeader ?? false}\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.onBackPress && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={{ cursor: 'pointer' }}\n\t\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\t\tprops.onBackPress ? props.onBackPress() : e.stopPropagation();\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<BackIcon width={18} height={18} />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<div style={{ flex: 1 }}>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\tgap: '8px',\n\t\t\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ModalTitles>\n\t\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t\t{props.headingTitle && (\n\t\t\t\t\t\t\t\t\t\t<TitleMedium>{props.headingTitle}</TitleMedium>\n\t\t\t\t\t\t\t\t\t)}{' '}\n\t\t\t\t\t\t\t\t</ModalTitles>\n\t\t\t\t\t\t\t\t{props.isBeta && (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\tpadding: '2px 8px',\n\t\t\t\t\t\t\t\t\t\t\tborderRadius: '16px',\n\t\t\t\t\t\t\t\t\t\t\tbackgroundColor: '#1877f2',\n\t\t\t\t\t\t\t\t\t\t\theight: 'fit-content',\n\t\t\t\t\t\t\t\t\t\t\twidth: 'fit-content',\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<BodyCaption style={{ color: COLORS.surface.standard }}>\n\t\t\t\t\t\t\t\t\t\t\tBETA\n\t\t\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{props.headerLeftCustomElement}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<ModalTitles>\n\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t{props.headingSubtitle && (\n\t\t\t\t\t\t\t\t\t<ModalSubtitle>{props.headingSubtitle}</ModalSubtitle>\n\t\t\t\t\t\t\t\t)}{' '}\n\t\t\t\t\t\t\t</ModalTitles>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{props.headerRightCustomElement && (\n\t\t\t\t\t\t\t<ModalCustomisation>\n\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t{props.headerRightCustomElement}{' '}\n\t\t\t\t\t\t\t</ModalCustomisation>\n\t\t\t\t\t\t)}{' '}\n\t\t\t\t\t</ModalHeader>\n\t\t\t\t)}\n\t\t\t\t{props.children && (\n\t\t\t\t\t<ModalBody\n\t\t\t\t\t\tstyle={props.modalBodyStyles ?? {}}\n\t\t\t\t\t\tshowShadow={props.footerShadow ?? false}\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.children}{' '}\n\t\t\t\t\t</ModalBody>\n\t\t\t\t)}\n\t\t\t\t{(props.primaryButton ||\n\t\t\t\t\tprops.secondaryButton ||\n\t\t\t\t\tprops.footerLeftCustomElement) && (\n\t\t\t\t\t<ModalFooter style={props.footerContainerStyle}>\n\t\t\t\t\t\t{props.footerLeftCustomElement && (\n\t\t\t\t\t\t\t<ModalFooterRightCustomisation>\n\t\t\t\t\t\t\t\t{props.footerLeftCustomElement}\n\t\t\t\t\t\t\t</ModalFooterRightCustomisation>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{props.secondaryButton && (\n\t\t\t\t\t\t\t<SecondaryButtonWrapper {...props.secondaryButton} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{props.primaryButton && <Button {...props.primaryButton} />}\n\t\t\t\t\t</ModalFooter>\n\t\t\t\t)}{' '}\n\t\t\t</ModalWrapper>\n\t\t</Modal>,\n\t\tdocument.body,\n\t);\n};\n"],"names":["ModalWrapper","styled","ModalHeader","props","COLORS","ModalTitles","ModalCustomisation","ModalSubtitle","BodyPrimary","ModalFooter","ModalFooterRightCustomisation","ModalBody","SecondaryButtonWrapper","Button","StyledModal","ReactDOM","jsx","Modal","jsxs","e","BackIcon","TitleMedium","BodyCaption"],"mappings":"qaAcMA,EAAeC,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQtBC,EAAcD,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBASLE,GACpBA,EAAM,aAAeC,EAAAA,OAAO,WAAW,QAAQ,MAAQ,aAAa;AAAA,2BAC1CD,GAAWA,EAAM,aAAe,MAAQ,MAAO;AAAA,EAGrEE,EAAcJ,EAAAA,QAAO;AAAA;AAAA;AAAA,EAKrBK,EAAqBL,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAO5BM,EAAgBN,EAAAA,QAAOO,aAAW;AAAA;AAAA,UAE9BJ,EAAAA,OAAO,QAAQ,SAAS;AAAA,EAG5BK,EAAcR,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASrBS,EAAgCT,EAAAA,QAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQvCU,EAAYV,EAAAA,QAAO;AAAA;AAAA;AAAA,eAKTE,GACdA,EAAM,WAAa,uCAAyC,MAAM;AAAA,EAE9DS,EAAyBX,EAAAA,QAAOY,QAAM;AAAA;AAAA,EAG/BC,EA8BPX,GACD,OAAO,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,CAExD,CAAA,CAAA,EAGDD,EAAM,uBAAA,CAAA,CAAA,SAEPE,EAAA,CACC,SAAA,CAAA,IACAF,EAAM,iBACNa,MAACT,EAAA,CAAe,WAAM,gBAAgB,EACpC,GAAA,CAAA,CACJ,CAAA,EACD,EACCJ,EAAM,0BACNe,EAAAA,KAACZ,EAAA,CACC,SAAA,CAAA,IACAH,EAAM,yBAA0B,GAAA,EAClC,EACE,GAAA,CAAA,CAAA,EAGJA,EAAM,UACNe,EAAAA,KAACP,EAAA,CACA,MAAOR,EAAM,iBAAmB,CAAA,EAChC,WAAYA,EAAM,cAAgB,GAEjC,SAAA,CAAAA,EAAM,SAAU,GAAA,CAAA,CAAA,GAGjBA,EAAM,eACPA,EAAM,iBACNA,EAAM,0BACNe,EAAAA,KAACT,EAAA,CAAY,MAAON,EAAM,qBACxB,SAAA,CAAAA,EAAM,yBACNa,MAACN,EAAA,CACC,SAAAP,EAAM,wBACR,EAEAA,EAAM,iBACNa,MAACJ,EAAA,CAAwB,GAAGT,EAAM,gBAAiB,EAEnDA,EAAM,eAAiBa,EAAAA,IAACH,EAAAA,OAAA,CAAQ,GAAGV,EAAM,aAAA,CAAe,CAAA,EAC1D,EACE,GAAA,CAAA,CACJ,CAAA,CAAA,EAED,SAAS,IAAA"}
1
+ {"version":3,"file":"styledModal.js","sources":["../../../../src/components/modals/styledModal.tsx"],"sourcesContent":["import BackIcon from '@src/assets/icons/arrow_back.svg';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport styled from 'styled-components';\nimport { Button } from '@src/components/button';\nimport { Modal } from '@src/components/modals/Modal';\nimport {\n\tBodyCaption,\n\tBodyPrimary,\n\tTitleMedium,\n} from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport { ButtonProps } from '../button/model';\n\nconst ModalWrapper = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex: 1;\n\talign-items: flex-start;\n\toverflow: hidden;\n\tmax-width: 100%;\n`;\nconst ModalHeader = styled.div<{\n\ttintedHeader: boolean;\n}>`\n\tpadding: 16px 24px;\n\twidth: 100%;\n\tdisplay: flex;\n\tflex-direction: row;\n\tgap: 12px;\n\tjustify-content: center;\n\tbackground-color: ${(props) =>\n\t\tprops.tintedHeader ? COLORS.background.warning.light : 'transparent'};\n\tborder-top-left-radius: ${(props) => (props.tintedHeader ? '4px' : 'none')};\n`;\n\nconst ModalTitles = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n`;\n\nconst ModalCustomisation = styled.div`\n\tdisplay: flex;\n\tmargin-left: auto;\n\tjustify-content: flex-end;\n\talign-items: center;\n`;\n\nconst ModalSubtitle = styled(BodyPrimary)`\n\tmargin-top: 4px;\n\tcolor: ${COLORS.content.secondary} !important;\n`;\n\nconst ModalFooter = styled.div`\n\tpadding: 16px 24px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: end;\n\tmargin-top: auto;\n\twidth: 100%;\n`;\n\nconst ModalFooterRightCustomisation = styled.div`\n\tmargin-right: auto;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-end;\n\theight: calc(100% - 32px);\n`;\n\nconst ModalBody = styled.div<{\n\tshowShadow: boolean;\n}>`\n\twidth: 100%;\n\tz-index: 1;\n\tbox-shadow: ${(props) =>\n\t\tprops.showShadow ? 'inset 0 -3px 6px rgba(0, 0, 0, 0.12)' : 'none'};\n`;\nconst SecondaryButtonWrapper = styled(Button)`\n\tmargin-right: 8px;\n`;\nexport const StyledModal: React.FC<{\n\t'data-test'?: string;\n\topen: boolean;\n\tonClose?: () => void;\n\tchildren?: React.ReactNode;\n\tcentralContainerStyles?: React.CSSProperties;\n\tcloseOnOutsideClick?: boolean;\n\tcloseOnEscapeKey?: boolean;\n\theadingTitle?: string;\n\theadingSubtitle?: string;\n\ttintedHeader?: boolean;\n\tprimaryButton?: ButtonProps;\n\tsecondaryButton?: ButtonProps;\n\tfooterShadow?: boolean;\n\tfooterLeftCustomElement?: React.ReactNode;\n\theaderLeftCustomElement?: React.ReactNode;\n\theaderRightCustomElement?: React.ReactNode;\n\tzIndex?: number;\n\thideCrossButton?: boolean;\n\twidth?: string;\n\twrapperStyle?: React.CSSProperties;\n\tonBackPress?: () => void;\n\tfooterContainerStyle?: React.CSSProperties;\n\tid?: string;\n\tmodalHeaderStyles?: React.CSSProperties;\n\tinnerModalId?: string;\n\tisBeta?: boolean;\n\tmodalBodyStyles?: React.CSSProperties;\n\tskipModalWithTimer?: boolean;\n\ttimeOut?: number;\n}> = (props) => {\n\tif (typeof window === 'undefined') return null;\n\n\treturn ReactDOM.createPortal(\n\t\t<Modal\n\t\t\tdata-test={props['data-test']}\n\t\t\tid={props.id}\n\t\t\tzIndex={props.zIndex}\n\t\t\topen={props.open}\n\t\t\tonClose={props.onClose}\n\t\t\tcloseOnOutsideClick={props.closeOnOutsideClick}\n\t\t\tcloseOnEscapeKey={props.closeOnEscapeKey}\n\t\t\tcentralContainerStyles={props.centralContainerStyles}\n\t\t\thideCrossButton={props.hideCrossButton}\n\t\t\twidth={props.width}\n\t\t\tskipModalWithTimer={props.skipModalWithTimer}\n\t\t\ttimeOut={props.timeOut}\n\t\t>\n\t\t\t<ModalWrapper style={props.wrapperStyle ?? {}} id={props.innerModalId}>\n\t\t\t\t{(props.headingTitle ||\n\t\t\t\t\tprops.headingSubtitle ||\n\t\t\t\t\tprops.headerRightCustomElement) && (\n\t\t\t\t\t<ModalHeader\n\t\t\t\t\t\tstyle={props.modalHeaderStyles ?? {}}\n\t\t\t\t\t\ttintedHeader={props.tintedHeader ?? false}\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.onBackPress && (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tdata-test={(props['data-test'] || '') + '-back-button'}\n\t\t\t\t\t\t\t\tstyle={{ cursor: 'pointer' }}\n\t\t\t\t\t\t\t\tonClick={(e) => {\n\t\t\t\t\t\t\t\t\tprops.onBackPress ? props.onBackPress() : e.stopPropagation();\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<BackIcon width={18} height={18} />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<div style={{ flex: 1 }}>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\tgap: '8px',\n\t\t\t\t\t\t\t\t\talignItems: 'center',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ModalTitles>\n\t\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t\t{props.headingTitle && (\n\t\t\t\t\t\t\t\t\t\t<TitleMedium>{props.headingTitle}</TitleMedium>\n\t\t\t\t\t\t\t\t\t)}{' '}\n\t\t\t\t\t\t\t\t</ModalTitles>\n\t\t\t\t\t\t\t\t{props.isBeta && (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\tpadding: '2px 8px',\n\t\t\t\t\t\t\t\t\t\t\tborderRadius: '16px',\n\t\t\t\t\t\t\t\t\t\t\tbackgroundColor: '#1877f2',\n\t\t\t\t\t\t\t\t\t\t\theight: 'fit-content',\n\t\t\t\t\t\t\t\t\t\t\twidth: 'fit-content',\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<BodyCaption style={{ color: COLORS.surface.standard }}>\n\t\t\t\t\t\t\t\t\t\t\tBETA\n\t\t\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{props.headerLeftCustomElement}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<ModalTitles>\n\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t{props.headingSubtitle && (\n\t\t\t\t\t\t\t\t\t<ModalSubtitle>{props.headingSubtitle}</ModalSubtitle>\n\t\t\t\t\t\t\t\t)}{' '}\n\t\t\t\t\t\t\t</ModalTitles>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{props.headerRightCustomElement && (\n\t\t\t\t\t\t\t<ModalCustomisation>\n\t\t\t\t\t\t\t\t{' '}\n\t\t\t\t\t\t\t\t{props.headerRightCustomElement}{' '}\n\t\t\t\t\t\t\t</ModalCustomisation>\n\t\t\t\t\t\t)}{' '}\n\t\t\t\t\t</ModalHeader>\n\t\t\t\t)}\n\t\t\t\t{props.children && (\n\t\t\t\t\t<ModalBody\n\t\t\t\t\t\tstyle={props.modalBodyStyles ?? {}}\n\t\t\t\t\t\tshowShadow={props.footerShadow ?? false}\n\t\t\t\t\t>\n\t\t\t\t\t\t{props.children}{' '}\n\t\t\t\t\t</ModalBody>\n\t\t\t\t)}\n\t\t\t\t{(props.primaryButton ||\n\t\t\t\t\tprops.secondaryButton ||\n\t\t\t\t\tprops.footerLeftCustomElement) && (\n\t\t\t\t\t<ModalFooter style={props.footerContainerStyle}>\n\t\t\t\t\t\t{props.footerLeftCustomElement && (\n\t\t\t\t\t\t\t<ModalFooterRightCustomisation>\n\t\t\t\t\t\t\t\t{props.footerLeftCustomElement}\n\t\t\t\t\t\t\t</ModalFooterRightCustomisation>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{props.secondaryButton && (\n\t\t\t\t\t\t\t<SecondaryButtonWrapper {...props.secondaryButton} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{props.primaryButton && <Button {...props.primaryButton} />}\n\t\t\t\t\t</ModalFooter>\n\t\t\t\t)}{' '}\n\t\t\t</ModalWrapper>\n\t\t</Modal>,\n\t\tdocument.body,\n\t);\n};\n"],"names":["ModalWrapper","styled","ModalHeader","props","COLORS","ModalTitles","ModalCustomisation","ModalSubtitle","BodyPrimary","ModalFooter","ModalFooterRightCustomisation","ModalBody","SecondaryBut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CAAA,EAChC,WAAYA,EAAM,cAAgB,GAEjC,SAAA,CAAAA,EAAM,SAAU,GAAA,CAAA,CAAA,GAGjBA,EAAM,eACPA,EAAM,iBACNA,EAAM,0BACNe,EAAAA,KAACT,EAAA,CAAY,MAAON,EAAM,qBACxB,SAAA,CAAAA,EAAM,yBACNa,MAACN,EAAA,CACC,SAAAP,EAAM,wBACR,EAEAA,EAAM,iBACNa,MAACJ,EAAA,CAAwB,GAAGT,EAAM,gBAAiB,EAEnDA,EAAM,eAAiBa,EAAAA,IAACH,EAAAA,OAAA,CAAQ,GAAGV,EAAM,aAAA,CAAe,CAAA,EAC1D,EACE,GAAA,CAAA,CACJ,CAAA,CAAA,EAED,SAAS,IAAA"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),T=require("../../assets/icons/chevronRight2.svg.js"),x=require("react"),n=require("../../constants/Theme.js"),M=require("../TypographyStyle.js"),s=require("./MultiLevelDropdown.styled.js"),v=r=>r&&typeof r=="object"&&"default"in r?r:{default:r},o=v(x),q=({width:r,onDropdownItemClick:f,option:e,parents:O,allowParentSelection:y,maxLevels:S,currentLevel:h,renderNestedMenu:R,version:l})=>{const[C,b]=o.default.useState(!1),[c,g]=o.default.useState(!1),[m,j]=o.default.useState({top:0,left:0}),L=x.useRef({top:0,left:0}),d=!!e.children&&e.children.length>0,u=d&&(S===void 0||h<S),p=()=>{!f||(e.disabled??!1)||(!d||y)&&f(e,O)},I=a=>{const i=a.currentTarget.getBoundingClientRect();j({top:i.top,left:i.right}),L.current={top:i.top,left:i.right}};return t.jsxs(s.MenuItemWrapper,{version:l,onMouseEnter:a=>{u&&(b(!0),I(a))},onMouseLeave:()=>{b(!1)},onClick:a=>{a.stopPropagation(),p()},id:"menuItemWrapper",style:{cursor:e.disabled??!1?"not-allowed":"pointer",backgroundColor:e.disabled??!1?n.COLORS.surface.standard:"transparent"},children:[e.customComponent?e.customComponent:t.jsxs(s.MenuItemContainer,{isSelected:e.selected,isSubMenuOpen:C,isHovered:c,isDisabled:e.disabled??!1,version:l,children:[t.jsxs(s.ContentContainer,{children:[e.leadingIcon&&t.jsx(s.LeadingIconContainer,{children:e.leadingIcon}),t.jsxs("div",{children:[t.jsx(M.BodyCaption,{style:{color:e.disabled??!1?n.COLORS.content.inactive:e.selected||c?l==="3.0"?n.COLORS.text.primary:n.COLORS.content.positive:n.COLORS.content.primary},children:e.label}),e.subText&&t.jsx(M.BodyTiny,{style:{color:e.disabled??!1?n.COLORS.content.inactive:e.selected||c?l==="3.0"?n.COLORS.text.primary:n.COLORS.content.positive:n.COLORS.content.secondary,marginTop:"2px"},children:e.subText})]})]}),d?t.jsx(s.TrailingIconContainer,{children:t.jsx(T.default,{width:16,height:16,color:!u||(e.disabled??!1)?n.COLORS.content.inactive:e.selected||c?l==="3.0"?n.COLORS.text.primary:n.COLORS.content.positive:n.COLORS.content.primary})}):e.trailingIcon?t.jsx(s.TrailingIconContainer,{children:e.trailingIcon}):t.jsx(t.Fragment,{})]}),!(e.disabled??!1)&&e.children&&e.children.length>0&&u&&C&&t.jsx(s.SubMenuContainer,{width:r,className:"submenu",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:t.jsx(s.StyledSubMenuWrapper,{width:r,top:m.top,left:m.left,children:t.jsx(s.SubMenuListContainer,{version:l,children:R(e.children,[...O,e],h+1)})})})]})};exports.MenuItem=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),T=require("../../assets/icons/chevronRight2.svg.js"),x=require("react"),n=require("../../constants/Theme.js"),M=require("../TypographyStyle.js"),s=require("./MultiLevelDropdown.styled.js"),v=r=>r&&typeof r=="object"&&"default"in r?r:{default:r},o=v(x),q=({width:r,onDropdownItemClick:f,option:e,parents:O,allowParentSelection:y,maxLevels:S,currentLevel:h,renderNestedMenu:R,version:l})=>{const[C,b]=o.default.useState(!1),[c,g]=o.default.useState(!1),[m,j]=o.default.useState({top:0,left:0}),p=x.useRef({top:0,left:0}),d=!!e.children&&e.children.length>0,u=d&&(S===void 0||h<S),L=()=>{!f||(e.disabled??!1)||(!d||y)&&f(e,O)},I=a=>{const i=a.currentTarget.getBoundingClientRect();j({top:i.top,left:i.right}),p.current={top:i.top,left:i.right}};return t.jsxs(s.MenuItemWrapper,{version:l,onMouseEnter:a=>{u&&(b(!0),I(a))},onMouseLeave:()=>{b(!1)},onClick:a=>{a.stopPropagation(),L()},id:"menuItemWrapper","data-testid":"menuItemWrapper",style:{cursor:e.disabled??!1?"not-allowed":"pointer",backgroundColor:e.disabled??!1?n.COLORS.surface.standard:"transparent"},children:[e.customComponent?e.customComponent:t.jsxs(s.MenuItemContainer,{isSelected:e.selected,isSubMenuOpen:C,isHovered:c,isDisabled:e.disabled??!1,version:l,children:[t.jsxs(s.ContentContainer,{children:[e.leadingIcon&&t.jsx(s.LeadingIconContainer,{children:e.leadingIcon}),t.jsxs("div",{children:[t.jsx(M.BodyCaption,{style:{color:e.disabled??!1?n.COLORS.content.inactive:e.selected||c?l==="3.0"?n.COLORS.text.primary:n.COLORS.content.positive:n.COLORS.content.primary},children:e.label}),e.subText&&t.jsx(M.BodyTiny,{style:{color:e.disabled??!1?n.COLORS.content.inactive:e.selected||c?l==="3.0"?n.COLORS.text.primary:n.COLORS.content.positive:n.COLORS.content.secondary,marginTop:"2px"},children:e.subText})]})]}),d?t.jsx(s.TrailingIconContainer,{children:t.jsx(T.default,{width:16,height:16,color:!u||(e.disabled??!1)?n.COLORS.content.inactive:e.selected||c?l==="3.0"?n.COLORS.text.primary:n.COLORS.content.positive:n.COLORS.content.primary})}):e.trailingIcon?t.jsx(s.TrailingIconContainer,{children:e.trailingIcon}):t.jsx(t.Fragment,{})]}),!(e.disabled??!1)&&e.children&&e.children.length>0&&u&&C&&t.jsx(s.SubMenuContainer,{width:r,className:"submenu",onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:t.jsx(s.StyledSubMenuWrapper,{width:r,top:m.top,left:m.left,children:t.jsx(s.SubMenuListContainer,{version:l,children:R(e.children,[...O,e],h+1)})})})]})};exports.MenuItem=q;
2
2
  //# sourceMappingURL=MenuItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MenuItem.js","sources":["../../../../src/components/multi-level-dropdown/MenuItem.tsx"],"sourcesContent":["import ChevronRightIcon from '@src/assets/icons/chevronRight2.svg';\nimport React, { useRef } from 'react';\nimport { COLORS } from '@src/constants/Theme';\nimport { BodyCaption, BodyTiny } from '../TypographyStyle';\nimport {\n\tContentContainer,\n\tLeadingIconContainer,\n\tMenuItemContainer,\n\tMenuItemWrapper,\n\tStyledSubMenuWrapper,\n\tSubMenuContainer,\n\tSubMenuListContainer,\n\tTrailingIconContainer,\n} from './MultiLevelDropdown.styled';\nimport {\n\tMultiLevelDropdownOption,\n\tRenderNestedMenu,\n\tSingleOption,\n} from './type';\n\nexport const MenuItem: React.FC<{\n\twidth: string;\n\tonDropdownItemClick?: (\n\t\toption: MultiLevelDropdownOption,\n\t\tparents: MultiLevelDropdownOption[],\n\t) => void;\n\toption: SingleOption;\n\tparents: MultiLevelDropdownOption[];\n\tallowParentSelection?: boolean;\n\tmaxLevels?: number;\n\tcurrentLevel: number;\n\trenderNestedMenu: RenderNestedMenu;\n\tversion?: '1.0' | '2.0' | '3.0';\n}> = ({\n\twidth,\n\tonDropdownItemClick,\n\toption,\n\tparents,\n\tallowParentSelection,\n\tmaxLevels,\n\tcurrentLevel,\n\trenderNestedMenu,\n\tversion,\n}) => {\n\tconst [isSubMenuOpen, setIsSubMenuOpen] = React.useState(false);\n\tconst [isSubMenuHovered, setIsSubMenuHovered] = React.useState(false);\n\tconst [subMenuPosition, setSubMenuPosition] = React.useState({\n\t\ttop: 0,\n\t\tleft: 0,\n\t});\n\tconst positionRef = useRef<any>({ top: 0, left: 0 });\n\tconst hasChildren = !!option.children && option.children.length > 0;\n\tconst canOpenSubMenu =\n\t\thasChildren && (maxLevels === undefined || currentLevel < maxLevels);\n\n\tconst handleDropdownOptionClick = () => {\n\t\tif (!onDropdownItemClick || (option.disabled ?? false)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!hasChildren || allowParentSelection) {\n\t\t\tonDropdownItemClick(option, parents);\n\t\t}\n\t};\n\n\tconst calculateSubMenuPosition = (event: React.MouseEvent) => {\n\t\tconst rect = (event.currentTarget as HTMLElement).getBoundingClientRect();\n\t\tsetSubMenuPosition({\n\t\t\ttop: rect.top,\n\t\t\tleft: rect.right,\n\t\t});\n\t\tpositionRef.current = {\n\t\t\ttop: rect.top,\n\t\t\tleft: rect.right,\n\t\t};\n\t};\n\n\treturn (\n\t\t<MenuItemWrapper\n\t\t\tversion={version}\n\t\t\tonMouseEnter={(event) => {\n\t\t\t\tif (canOpenSubMenu) {\n\t\t\t\t\tsetIsSubMenuOpen(true);\n\t\t\t\t\tcalculateSubMenuPosition(event);\n\t\t\t\t}\n\t\t\t}}\n\t\t\tonMouseLeave={() => {\n\t\t\t\tsetIsSubMenuOpen(false);\n\t\t\t}}\n\t\t\tonClick={(e) => {\n\t\t\t\te.stopPropagation();\n\t\t\t\thandleDropdownOptionClick();\n\t\t\t}}\n\t\t\tid=\"menuItemWrapper\"\n\t\t\tstyle={{\n\t\t\t\tcursor: option.disabled ?? false ? 'not-allowed' : 'pointer',\n\t\t\t\tbackgroundColor:\n\t\t\t\t\toption.disabled ?? false ? COLORS.surface.standard : 'transparent',\n\t\t\t}}\n\t\t>\n\t\t\t{option.customComponent ? (\n\t\t\t\toption.customComponent\n\t\t\t) : (\n\t\t\t\t<MenuItemContainer\n\t\t\t\t\tisSelected={option.selected}\n\t\t\t\t\tisSubMenuOpen={isSubMenuOpen}\n\t\t\t\t\tisHovered={isSubMenuHovered}\n\t\t\t\t\tisDisabled={option.disabled ?? false}\n\t\t\t\t\tversion={version}\n\t\t\t\t>\n\t\t\t\t\t<ContentContainer>\n\t\t\t\t\t\t{option.leadingIcon && (\n\t\t\t\t\t\t\t<LeadingIconContainer>{option.leadingIcon}</LeadingIconContainer>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<BodyCaption\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tcolor:\n\t\t\t\t\t\t\t\t\t\toption.disabled ?? false\n\t\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t\t: option.selected || isSubMenuHovered\n\t\t\t\t\t\t\t\t\t\t\t? version === '3.0'\n\t\t\t\t\t\t\t\t\t\t\t\t? COLORS.text.primary\n\t\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.positive\n\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.primary,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{option.label}\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t{option.subText && (\n\t\t\t\t\t\t\t\t<BodyTiny\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tcolor:\n\t\t\t\t\t\t\t\t\t\t\toption.disabled ?? false\n\t\t\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t\t\t: option.selected || isSubMenuHovered\n\t\t\t\t\t\t\t\t\t\t\t\t? version === '3.0'\n\t\t\t\t\t\t\t\t\t\t\t\t\t? COLORS.text.primary\n\t\t\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.positive\n\t\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.secondary,\n\t\t\t\t\t\t\t\t\t\tmarginTop: '2px',\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{option.subText}\n\t\t\t\t\t\t\t\t</BodyTiny>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</ContentContainer>\n\t\t\t\t\t{hasChildren ? (\n\t\t\t\t\t\t<TrailingIconContainer>\n\t\t\t\t\t\t\t<ChevronRightIcon\n\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\t\t\t!canOpenSubMenu || (option.disabled ?? false)\n\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t: option.selected || isSubMenuHovered\n\t\t\t\t\t\t\t\t\t\t? version === '3.0'\n\t\t\t\t\t\t\t\t\t\t\t? COLORS.text.primary\n\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.positive\n\t\t\t\t\t\t\t\t\t\t: COLORS.content.primary\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</TrailingIconContainer>\n\t\t\t\t\t) : option.trailingIcon ? (\n\t\t\t\t\t\t<TrailingIconContainer>{option.trailingIcon}</TrailingIconContainer>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<></>\n\t\t\t\t\t)}\n\t\t\t\t</MenuItemContainer>\n\t\t\t)}\n\n\t\t\t{!(option.disabled ?? false) &&\n\t\t\t\toption.children &&\n\t\t\t\toption.children.length > 0 &&\n\t\t\t\tcanOpenSubMenu &&\n\t\t\t\tisSubMenuOpen && (\n\t\t\t\t\t<SubMenuContainer\n\t\t\t\t\t\twidth={width}\n\t\t\t\t\t\tclassName=\"submenu\"\n\t\t\t\t\t\tonMouseEnter={() => setIsSubMenuHovered(true)}\n\t\t\t\t\t\tonMouseLeave={() => setIsSubMenuHovered(false)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<StyledSubMenuWrapper\n\t\t\t\t\t\t\twidth={width}\n\t\t\t\t\t\t\ttop={subMenuPosition.top}\n\t\t\t\t\t\t\tleft={subMenuPosition.left}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SubMenuListContainer version={version}>\n\t\t\t\t\t\t\t\t{renderNestedMenu(\n\t\t\t\t\t\t\t\t\toption.children,\n\t\t\t\t\t\t\t\t\t[...parents, option],\n\t\t\t\t\t\t\t\t\tcurrentLevel + 1,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</SubMenuListContainer>\n\t\t\t\t\t\t</StyledSubMenuWrapper>\n\t\t\t\t\t</SubMenuContainer>\n\t\t\t\t)}\n\t\t</MenuItemWrapper>\n\t);\n};\n"],"names":["MenuItem","width","onDropdownItemClick","option","parents","allowParentSelection","maxLevels","currentLevel","renderNestedMenu","version","isSubMenuOpen","setIsSubMenuOpen","React","isSubMenuHovered","setIsSubMenuHovered","subMenuPosition","setSubMenuPosition","positionRef","useRef","hasChildren","canOpenSubMenu","handleDropdownOptionClick","calculateSubMenuPosition","event","rect","jsxs","MenuItemWrapper","e","COLORS","MenuItemContainer","ContentContainer","jsx","LeadingIconContainer","BodyCaption","BodyTiny","TrailingIconContainer","ChevronRightIcon","Fragment","SubMenuContainer","StyledSubMenuWrapper","SubMenuListContainer"],"mappings":"iXAoBaA,EAaR,CAAC,CACL,MAAAC,EACA,oBAAAC,EACA,OAAAC,EACA,QAAAC,EACA,qBAAAC,EACA,UAAAC,EACA,aAAAC,EACA,iBAAAC,EACA,QAAAC,CACD,IAAM,CACL,KAAM,CAACC,EAAeC,CAAgB,EAAIC,EAAAA,QAAM,SAAS,EAAK,EACxD,CAACC,EAAkBC,CAAmB,EAAIF,EAAAA,QAAM,SAAS,EAAK,EAC9D,CAACG,EAAiBC,CAAkB,EAAIJ,EAAAA,QAAM,SAAS,CAC5D,IAAK,EACL,KAAM,CAAA,CACN,EACKK,EAAcC,EAAAA,OAAY,CAAE,IAAK,EAAG,KAAM,EAAG,EAC7CC,EAAc,CAAC,CAAChB,EAAO,UAAYA,EAAO,SAAS,OAAS,EAC5DiB,EACLD,IAAgBb,IAAc,QAAaC,EAAeD,GAErDe,EAA4B,IAAM,CACnC,CAACnB,IAAwBC,EAAO,UAAY,MAI5C,CAACgB,GAAed,IACnBH,EAAoBC,EAAQC,CAAO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UAAYU,EACnBJ,IAAY,MACXmB,EAAAA,OAAO,KAAK,QACZA,EAAAA,OAAO,QAAQ,SAChBA,SAAO,QAAQ,UACnB,UAAW,KAAA,EAGX,SAAAzB,EAAO,OAAA,CAAA,CACT,CAAA,CAEF,CAAA,EACD,EACCgB,QACCgB,wBAAA,CACA,SAAAJ,EAAAA,IAACK,EAAAA,QAAA,CACA,MAAO,GACP,OAAQ,GACR,MACC,CAAChB,IAAmBjB,EAAO,UAAY,IACpCyB,SAAO,QAAQ,SACfzB,EAAO,UAAYU,EACnBJ,IAAY,MACXmB,EAAAA,OAAO,KAAK,QACZA,EAAAA,OAAO,QAAQ,SAChBA,EAAAA,OAAO,QAAQ,OAAA,CAAA,CAEpB,CACD,EACGzB,EAAO,mBACTgC,EAAAA,sBAAA,CAAuB,SAAAhC,EAAO,YAAA,CAAa,EAE5C4B,EAAAA,IAAAM,EAAAA,SAAA,CAAA,CAAE,CAAA,CAAA,CAAA,EAKJ,EAAElC,EAAO,UAAY,KACrBA,EAAO,UACPA,EAAO,SAAS,OAAS,GACzBiB,GACAV,GACCqB,EAAAA,IAACO,EAAAA,iBAAA,CACA,MAAArC,EACA,UAAU,UACV,aAAc,IAAMa,EAAoB,EAAI,EAC5C,aAAc,IAAMA,EAAoB,EAAK,EAE7C,SAAAiB,EAAAA,IAACQ,EAAAA,qBAAA,CACA,MAAAtC,EACA,IAAKc,EAAgB,IACrB,KAAMA,EAAgB,KAEtB,SAAAgB,EAAAA,IAACS,EAAAA,sBAAqB,QAAA/B,EACpB,SAAAD,EACAL,EAAO,SACP,CAAC,GAAGC,EAASD,CAAM,EACnBI,EAAe,CAAA,CAChB,CACD,CAAA,CAAA,CACD,CAAA,CACD,CAAA,CAAA,CAIL"}
1
+ {"version":3,"file":"MenuItem.js","sources":["../../../../src/components/multi-level-dropdown/MenuItem.tsx"],"sourcesContent":["import ChevronRightIcon from '@src/assets/icons/chevronRight2.svg';\nimport React, { useRef } from 'react';\nimport { COLORS } from '@src/constants/Theme';\nimport { BodyCaption, BodyTiny } from '../TypographyStyle';\nimport {\n\tContentContainer,\n\tLeadingIconContainer,\n\tMenuItemContainer,\n\tMenuItemWrapper,\n\tStyledSubMenuWrapper,\n\tSubMenuContainer,\n\tSubMenuListContainer,\n\tTrailingIconContainer,\n} from './MultiLevelDropdown.styled';\nimport {\n\tMultiLevelDropdownOption,\n\tRenderNestedMenu,\n\tSingleOption,\n} from './type';\n\nexport const MenuItem: React.FC<{\n\twidth: string;\n\tonDropdownItemClick?: (\n\t\toption: MultiLevelDropdownOption,\n\t\tparents: MultiLevelDropdownOption[],\n\t) => void;\n\toption: SingleOption;\n\tparents: MultiLevelDropdownOption[];\n\tallowParentSelection?: boolean;\n\tmaxLevels?: number;\n\tcurrentLevel: number;\n\trenderNestedMenu: RenderNestedMenu;\n\tversion?: '1.0' | '2.0' | '3.0';\n}> = ({\n\twidth,\n\tonDropdownItemClick,\n\toption,\n\tparents,\n\tallowParentSelection,\n\tmaxLevels,\n\tcurrentLevel,\n\trenderNestedMenu,\n\tversion,\n}) => {\n\tconst [isSubMenuOpen, setIsSubMenuOpen] = React.useState(false);\n\tconst [isSubMenuHovered, setIsSubMenuHovered] = React.useState(false);\n\tconst [subMenuPosition, setSubMenuPosition] = React.useState({\n\t\ttop: 0,\n\t\tleft: 0,\n\t});\n\tconst positionRef = useRef<any>({ top: 0, left: 0 });\n\tconst hasChildren = !!option.children && option.children.length > 0;\n\tconst canOpenSubMenu =\n\t\thasChildren && (maxLevels === undefined || currentLevel < maxLevels);\n\n\tconst handleDropdownOptionClick = () => {\n\t\tif (!onDropdownItemClick || (option.disabled ?? false)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!hasChildren || allowParentSelection) {\n\t\t\tonDropdownItemClick(option, parents);\n\t\t}\n\t};\n\n\tconst calculateSubMenuPosition = (event: React.MouseEvent) => {\n\t\tconst rect = (event.currentTarget as HTMLElement).getBoundingClientRect();\n\t\tsetSubMenuPosition({\n\t\t\ttop: rect.top,\n\t\t\tleft: rect.right,\n\t\t});\n\t\tpositionRef.current = {\n\t\t\ttop: rect.top,\n\t\t\tleft: rect.right,\n\t\t};\n\t};\n\n\treturn (\n\t\t<MenuItemWrapper\n\t\t\tversion={version}\n\t\t\tonMouseEnter={(event) => {\n\t\t\t\tif (canOpenSubMenu) {\n\t\t\t\t\tsetIsSubMenuOpen(true);\n\t\t\t\t\tcalculateSubMenuPosition(event);\n\t\t\t\t}\n\t\t\t}}\n\t\t\tonMouseLeave={() => {\n\t\t\t\tsetIsSubMenuOpen(false);\n\t\t\t}}\n\t\t\tonClick={(e) => {\n\t\t\t\te.stopPropagation();\n\t\t\t\thandleDropdownOptionClick();\n\t\t\t}}\n\t\t\tid=\"menuItemWrapper\"\n\t\t\tdata-testid=\"menuItemWrapper\"\n\t\t\tstyle={{\n\t\t\t\tcursor: option.disabled ?? false ? 'not-allowed' : 'pointer',\n\t\t\t\tbackgroundColor:\n\t\t\t\t\toption.disabled ?? false ? COLORS.surface.standard : 'transparent',\n\t\t\t}}\n\t\t>\n\t\t\t{option.customComponent ? (\n\t\t\t\toption.customComponent\n\t\t\t) : (\n\t\t\t\t<MenuItemContainer\n\t\t\t\t\tisSelected={option.selected}\n\t\t\t\t\tisSubMenuOpen={isSubMenuOpen}\n\t\t\t\t\tisHovered={isSubMenuHovered}\n\t\t\t\t\tisDisabled={option.disabled ?? false}\n\t\t\t\t\tversion={version}\n\t\t\t\t>\n\t\t\t\t\t<ContentContainer>\n\t\t\t\t\t\t{option.leadingIcon && (\n\t\t\t\t\t\t\t<LeadingIconContainer>{option.leadingIcon}</LeadingIconContainer>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<BodyCaption\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tcolor:\n\t\t\t\t\t\t\t\t\t\toption.disabled ?? false\n\t\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t\t: option.selected || isSubMenuHovered\n\t\t\t\t\t\t\t\t\t\t\t? version === '3.0'\n\t\t\t\t\t\t\t\t\t\t\t\t? COLORS.text.primary\n\t\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.positive\n\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.primary,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{option.label}\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t{option.subText && (\n\t\t\t\t\t\t\t\t<BodyTiny\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tcolor:\n\t\t\t\t\t\t\t\t\t\t\toption.disabled ?? false\n\t\t\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t\t\t: option.selected || isSubMenuHovered\n\t\t\t\t\t\t\t\t\t\t\t\t? version === '3.0'\n\t\t\t\t\t\t\t\t\t\t\t\t\t? COLORS.text.primary\n\t\t\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.positive\n\t\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.secondary,\n\t\t\t\t\t\t\t\t\t\tmarginTop: '2px',\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{option.subText}\n\t\t\t\t\t\t\t\t</BodyTiny>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</ContentContainer>\n\t\t\t\t\t{hasChildren ? (\n\t\t\t\t\t\t<TrailingIconContainer>\n\t\t\t\t\t\t\t<ChevronRightIcon\n\t\t\t\t\t\t\t\twidth={16}\n\t\t\t\t\t\t\t\theight={16}\n\t\t\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\t\t\t!canOpenSubMenu || (option.disabled ?? false)\n\t\t\t\t\t\t\t\t\t\t? COLORS.content.inactive\n\t\t\t\t\t\t\t\t\t\t: option.selected || isSubMenuHovered\n\t\t\t\t\t\t\t\t\t\t? version === '3.0'\n\t\t\t\t\t\t\t\t\t\t\t? COLORS.text.primary\n\t\t\t\t\t\t\t\t\t\t\t: COLORS.content.positive\n\t\t\t\t\t\t\t\t\t\t: COLORS.content.primary\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</TrailingIconContainer>\n\t\t\t\t\t) : option.trailingIcon ? (\n\t\t\t\t\t\t<TrailingIconContainer>{option.trailingIcon}</TrailingIconContainer>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<></>\n\t\t\t\t\t)}\n\t\t\t\t</MenuItemContainer>\n\t\t\t)}\n\n\t\t\t{!(option.disabled ?? false) &&\n\t\t\t\toption.children &&\n\t\t\t\toption.children.length > 0 &&\n\t\t\t\tcanOpenSubMenu &&\n\t\t\t\tisSubMenuOpen && (\n\t\t\t\t\t<SubMenuContainer\n\t\t\t\t\t\twidth={width}\n\t\t\t\t\t\tclassName=\"submenu\"\n\t\t\t\t\t\tonMouseEnter={() => setIsSubMenuHovered(true)}\n\t\t\t\t\t\tonMouseLeave={() => setIsSubMenuHovered(false)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<StyledSubMenuWrapper\n\t\t\t\t\t\t\twidth={width}\n\t\t\t\t\t\t\ttop={subMenuPosition.top}\n\t\t\t\t\t\t\tleft={subMenuPosition.left}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SubMenuListContainer version={version}>\n\t\t\t\t\t\t\t\t{renderNestedMenu(\n\t\t\t\t\t\t\t\t\toption.children,\n\t\t\t\t\t\t\t\t\t[...parents, option],\n\t\t\t\t\t\t\t\t\tcurrentLevel + 1,\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</SubMenuListContainer>\n\t\t\t\t\t\t</StyledSubMenuWrapper>\n\t\t\t\t\t</SubMenuContainer>\n\t\t\t\t)}\n\t\t</MenuItemWrapper>\n\t);\n};\n"],"names":["MenuItem","width","onDropdownItemClick","option","parents","allowParentSelection","maxLevels","currentLevel","renderNestedMenu","version","isSubMenuOpen","setIsSubMenuOpen","React","isSubMenuHovered","setIsSubMenuHovered","subMenuPosition","setSubMenuPosition","positionRef","useRef","hasChildren","canOpenSubMenu","handleDropdownOptionClick","calculateSubMenuPosition","event","rect","jsxs","MenuItemWrapper","e","COLORS","MenuItemContainer","ContentContainer","jsx","LeadingIconContainer","BodyCaption","BodyTiny","TrailingIconContainer","ChevronRightIcon","Fragment","SubMenuContainer","StyledSubMenuWrapper","SubMenuListContainer"],"mappings":"iXAoBaA,EAaR,CAAC,CACL,MAAAC,EACA,oBAAAC,EACA,OAAAC,EACA,QAAAC,EACA,qBAAAC,EACA,UAAAC,EACA,aAAAC,EACA,iBAAAC,EACA,QAAAC,CACD,IAAM,CACL,KAAM,CAACC,EAAeC,CAAgB,EAAIC,EAAAA,QAAM,SAAS,EAAK,EACxD,CAACC,EAAkBC,CAAmB,EAAIF,EAAAA,QAAM,SAAS,EAAK,EAC9D,CAACG,EAAiBC,CAAkB,EAAIJ,EAAAA,QAAM,SAAS,CAC5D,IAAK,EACL,KAAM,CAAA,CACN,EACKK,EAAcC,EAAAA,OAAY,CAAE,IAAK,EAAG,KAAM,EAAG,EAC7CC,EAAc,CAAC,CAAChB,EAAO,UAAYA,EAAO,SAAS,OAAS,EAC5DiB,EACLD,IAAgBb,IAAc,QAAaC,EAAeD,GAErDe,EAA4B,IAAM,CACnC,CAACnB,IAAwBC,EAAO,UAAY,MAI5C,CAACgB,GAAed,IACnBH,EAAoBC,EAAQC,CAAO,CAErC,EAEMkB,EAA4BC,GAA4B,CAC7D,MAAMC,EAAQD,EAAM,cAA8B,sBAAA,EAClDP,EAAmB,CAClB,IAAKQ,EAAK,IACV,KAAMA,EAAK,KAAA,CACX,EACDP,EAAY,QAAU,CACrB,IAAKO,EAAK,IACV,KAAMA,EAAK,KAAA,CAEb,EAEA,OACCC,EAAAA,KAACC,EAAAA,gBAAA,CACA,QAAAjB,EACA,aAAec,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,GACR,MACC,CAAChB,IAAmBjB,EAAO,UAAY,IACpCyB,SAAO,QAAQ,SACfzB,EAAO,UAAYU,EACnBJ,IAAY,MACXmB,EAAAA,OAAO,KAAK,QACZA,EAAAA,OAAO,QAAQ,SAChBA,EAAAA,OAAO,QAAQ,OAAA,CAAA,CAEpB,CACD,EACGzB,EAAO,mBACTgC,EAAAA,sBAAA,CAAuB,SAAAhC,EAAO,YAAA,CAAa,EAE5C4B,EAAAA,IAAAM,EAAAA,SAAA,CAAA,CAAE,CAAA,CAAA,CAAA,EAKJ,EAAElC,EAAO,UAAY,KACrBA,EAAO,UACPA,EAAO,SAAS,OAAS,GACzBiB,GACAV,GACCqB,EAAAA,IAACO,EAAAA,iBAAA,CACA,MAAArC,EACA,UAAU,UACV,aAAc,IAAMa,EAAoB,EAAI,EAC5C,aAAc,IAAMA,EAAoB,EAAK,EAE7C,SAAAiB,EAAAA,IAACQ,EAAAA,qBAAA,CACA,MAAAtC,EACA,IAAKc,EAAgB,IACrB,KAAMA,EAAgB,KAEtB,SAAAgB,EAAAA,IAACS,EAAAA,sBAAqB,QAAA/B,EACpB,SAAAD,EACAL,EAAO,SACP,CAAC,GAAGC,EAASD,CAAM,EACnBI,EAAe,CAAA,CAChB,CACD,CAAA,CAAA,CACD,CAAA,CACD,CAAA,CAAA,CAIL"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),y=require("react"),o=require("../TypographyStyle.js"),r=require("../../constants/Theme.js"),i=require("./Pagination.styled.js"),s=y.forwardRef(({id:a,onShowMore:t,isLoading:l,numberOfItemsLoaded:c,totalNumberOfItems:e,...d})=>n.jsx(i.Pagination,{id:a,...d,children:l?n.jsx(n.Fragment,{children:"loading..."}):n.jsx("div",{children:c<e?n.jsxs(i.Pagination,{children:[n.jsxs(o.BodySecondary,{style:{color:r.COLORS.content.secondary},children:["Showing ",c," out of ",e," ","results"]}),n.jsx(o.ButtonRegular,{style:{color:r.COLORS.content.brand,cursor:"pointer"},onClick:()=>t&&t(),children:"Show more"})]}):n.jsx(i.Pagination,{children:n.jsxs(o.BodySecondary,{style:{color:r.COLORS.content.secondary},children:["Showing all ",e," results"]})})})}));s.displayName="Pagination";exports.Pagination=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),y=require("react"),o=require("../TypographyStyle.js"),r=require("../../constants/Theme.js"),i=require("./Pagination.styled.js"),c=y.forwardRef(({id:t,onShowMore:s,isLoading:l,numberOfItemsLoaded:a,totalNumberOfItems:e,...d})=>n.jsx(i.Pagination,{id:t,"data-testid":t,...d,children:l?n.jsx(n.Fragment,{children:"loading..."}):n.jsx("div",{children:a<e?n.jsxs(i.Pagination,{children:[n.jsxs(o.BodySecondary,{style:{color:r.COLORS.content.secondary},children:["Showing ",a," out of ",e," ","results"]}),n.jsx(o.ButtonRegular,{style:{color:r.COLORS.content.brand,cursor:"pointer"},onClick:()=>s&&s(),children:"Show more"})]}):n.jsx(i.Pagination,{children:n.jsxs(o.BodySecondary,{style:{color:r.COLORS.content.secondary},children:["Showing all ",e," results"]})})})}));c.displayName="Pagination";exports.Pagination=c;
2
2
  //# sourceMappingURL=Pagination.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.js","sources":["../../../../src/components/pagination/Pagination.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { BodySecondary, ButtonRegular } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport * as Sc from './Pagination.styled';\n\nexport interface PaginationProps extends React.HTMLAttributes<HTMLDivElement> {\n\tnumberOfItemsLoaded: number;\n\ttotalNumberOfItems: number;\n\tisLoading?: boolean;\n\tonShowMore?: () => void;\n\twidth?: string;\n}\n\nexport const Pagination = forwardRef<HTMLButtonElement, PaginationProps>(\n\t({\n\t\tid,\n\t\tonShowMore,\n\t\tisLoading,\n\t\tnumberOfItemsLoaded,\n\t\ttotalNumberOfItems,\n\t\t...rest\n\t}) => {\n\t\treturn (\n\t\t\t<Sc.Pagination id={id} {...rest}>\n\t\t\t\t{isLoading ? (\n\t\t\t\t\t//TODO: @chinmayee replace with Spinner once done\n\t\t\t\t\t<>loading...</>\n\t\t\t\t) : (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t{numberOfItemsLoaded < totalNumberOfItems ? (\n\t\t\t\t\t\t\t<Sc.Pagination>\n\t\t\t\t\t\t\t\t<BodySecondary style={{ color: COLORS.content.secondary }}>\n\t\t\t\t\t\t\t\t\tShowing {numberOfItemsLoaded} out of {totalNumberOfItems}{' '}\n\t\t\t\t\t\t\t\t\tresults\n\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t\t<ButtonRegular\n\t\t\t\t\t\t\t\t\tstyle={{ color: COLORS.content.brand, cursor: 'pointer' }}\n\t\t\t\t\t\t\t\t\tonClick={() => onShowMore && onShowMore()}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tShow more\n\t\t\t\t\t\t\t\t</ButtonRegular>\n\t\t\t\t\t\t\t</Sc.Pagination>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Sc.Pagination>\n\t\t\t\t\t\t\t\t<BodySecondary style={{ color: COLORS.content.secondary }}>\n\t\t\t\t\t\t\t\t\tShowing all {totalNumberOfItems} results\n\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t</Sc.Pagination>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Sc.Pagination>\n\t\t);\n\t},\n);\n\nPagination.displayName = 'Pagination';\n"],"names":["Pagination","forwardRef","id","onShowMore","isLoading","numberOfItemsLoaded","totalNumberOfItems","rest","Sc.Pagination","jsxs","BodySecondary","COLORS","jsx","ButtonRegular"],"mappings":"qPAaaA,EAAaC,EAAAA,WACzB,CAAC,CACA,GAAAC,EACA,WAAAC,EACA,UAAAC,EACA,oBAAAC,EACA,mBAAAC,EACA,GAAGC,CAAA,UAGDC,EAAAA,WAAA,CAAc,GAAAN,EAAS,GAAGK,EACzB,SAAAH,oBAEE,SAAA,YAAA,CAAU,QAEX,MAAA,CACC,SAAAC,EAAsBC,EACtBG,EAAAA,KAACD,aAAA,CACA,SAAA,CAAAC,OAACC,EAAAA,eAAc,MAAO,CAAE,MAAOC,EAAAA,OAAO,QAAQ,WAAa,SAAA,CAAA,WACjDN,EAAoB,WAASC,EAAoB,IAAI,SAAA,EAE/D,EACAM,EAAAA,IAACC,EAAAA,cAAA,CACA,MAAO,CAAE,MAAOF,EAAAA,OAAO,QAAQ,MAAO,OAAQ,SAAA,EAC9C,QAAS,IAAMR,GAAcA,EAAA,EAC7B,SAAA,WAAA,CAAA,CAED,CAAA,CACD,EAEAS,EAAAA,IAACJ,EAAAA,WAAA,CACA,SAAAC,EAAAA,KAACC,EAAAA,cAAA,CAAc,MAAO,CAAE,MAAOC,EAAAA,OAAO,QAAQ,WAAa,SAAA,CAAA,eAC7CL,EAAmB,UAAA,EACjC,CAAA,CACD,EAEF,EAEF,CAGH,EAEAN,EAAW,YAAc"}
1
+ {"version":3,"file":"Pagination.js","sources":["../../../../src/components/pagination/Pagination.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { BodySecondary, ButtonRegular } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport * as Sc from './Pagination.styled';\n\nexport interface PaginationProps extends React.HTMLAttributes<HTMLDivElement> {\n\tnumberOfItemsLoaded: number;\n\ttotalNumberOfItems: number;\n\tisLoading?: boolean;\n\tonShowMore?: () => void;\n\twidth?: string;\n}\n\nexport const Pagination = forwardRef<HTMLButtonElement, PaginationProps>(\n\t({\n\t\tid,\n\t\tonShowMore,\n\t\tisLoading,\n\t\tnumberOfItemsLoaded,\n\t\ttotalNumberOfItems,\n\t\t...rest\n\t}) => {\n\t\treturn (\n\t\t\t<Sc.Pagination id={id} data-testid={id} {...rest}>\n\t\t\t\t{isLoading ? (\n\t\t\t\t\t//TODO: @chinmayee replace with Spinner once done\n\t\t\t\t\t<>loading...</>\n\t\t\t\t) : (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t{numberOfItemsLoaded < totalNumberOfItems ? (\n\t\t\t\t\t\t\t<Sc.Pagination>\n\t\t\t\t\t\t\t\t<BodySecondary style={{ color: COLORS.content.secondary }}>\n\t\t\t\t\t\t\t\t\tShowing {numberOfItemsLoaded} out of {totalNumberOfItems}{' '}\n\t\t\t\t\t\t\t\t\tresults\n\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t\t<ButtonRegular\n\t\t\t\t\t\t\t\t\tstyle={{ color: COLORS.content.brand, cursor: 'pointer' }}\n\t\t\t\t\t\t\t\t\tonClick={() => onShowMore && onShowMore()}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tShow more\n\t\t\t\t\t\t\t\t</ButtonRegular>\n\t\t\t\t\t\t\t</Sc.Pagination>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Sc.Pagination>\n\t\t\t\t\t\t\t\t<BodySecondary style={{ color: COLORS.content.secondary }}>\n\t\t\t\t\t\t\t\t\tShowing all {totalNumberOfItems} results\n\t\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t</Sc.Pagination>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Sc.Pagination>\n\t\t);\n\t},\n);\n\nPagination.displayName = 'Pagination';\n"],"names":["Pagination","forwardRef","id","onShowMore","isLoading","numberOfItemsLoaded","totalNumberOfItems","rest","jsx","Sc.Pagination","jsxs","BodySecondary","COLORS","ButtonRegular"],"mappings":"qPAaaA,EAAaC,EAAAA,WACzB,CAAC,CACA,GAAAC,EACA,WAAAC,EACA,UAAAC,EACA,oBAAAC,EACA,mBAAAC,EACA,GAAGC,CAAA,IAGFC,EAAAA,IAACC,EAAAA,WAAA,CAAc,GAAAP,EAAQ,cAAaA,EAAK,GAAGK,EAC1C,SAAAH,oBAEE,SAAA,YAAA,CAAU,QAEX,MAAA,CACC,SAAAC,EAAsBC,EACtBI,EAAAA,KAACD,aAAA,CACA,SAAA,CAAAC,OAACC,EAAAA,eAAc,MAAO,CAAE,MAAOC,EAAAA,OAAO,QAAQ,WAAa,SAAA,CAAA,WACjDP,EAAoB,WAASC,EAAoB,IAAI,SAAA,EAE/D,EACAE,EAAAA,IAACK,EAAAA,cAAA,CACA,MAAO,CAAE,MAAOD,EAAAA,OAAO,QAAQ,MAAO,OAAQ,SAAA,EAC9C,QAAS,IAAMT,GAAcA,EAAA,EAC7B,SAAA,WAAA,CAAA,CAED,CAAA,CACD,EAEAK,EAAAA,IAACC,EAAAA,WAAA,CACA,SAAAC,EAAAA,KAACC,EAAAA,cAAA,CAAc,MAAO,CAAE,MAAOC,EAAAA,OAAO,QAAQ,WAAa,SAAA,CAAA,eAC7CN,EAAmB,UAAA,EACjC,CAAA,CACD,EAEF,EAEF,CAGH,EAEAN,EAAW,YAAc"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),i=require("../../assets/icons/checklistIcon.svg.js"),u=({percentage:r,width:e=200,containerStyle:l})=>{const a=r<0?0:r>100?100:r,o=e/2-e/10,t=o*Math.PI*2,f=t-t*a/100,n=e/10,c=e/3;return s.jsx("div",{style:l,children:s.jsxs("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"gradientStroke",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[s.jsx("stop",{offset:"0%",stopColor:"#7000FF"}),s.jsx("stop",{offset:"100%",stopColor:"#AD00FF"})]})}),s.jsx("circle",{cx:e/2,cy:e/2,strokeWidth:n,r:o,strokeOpacity:.8,fill:"none",style:{stroke:"#ffffff"}}),s.jsx("circle",{cx:e/2,cy:e/2,strokeWidth:n,r:o,style:{stroke:"url(#gradientStroke)",strokeDasharray:t,strokeDashoffset:f},transform:`rotate(-90 ${e/2} ${e/2})`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx(i.default,{x:e/2-c/2,width:c})]})})};exports.default=u;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),f=require("../../assets/icons/checklistIcon.svg.js"),u=({percentage:e,width:r=200,containerStyle:n})=>{const l=e<0?0:e>100?100:e,t=r/2-r/10,o=t*Math.PI*2,i=o-o*l/100,c=r/10,a=r/3;return s.jsx("div",{style:n,"data-testid":"circular-progress-container",children:s.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,"data-testid":"circular-progress-svg",children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"gradientStroke",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[s.jsx("stop",{offset:"0%",stopColor:"#7000FF"}),s.jsx("stop",{offset:"100%",stopColor:"#AD00FF"})]})}),s.jsx("circle",{cx:r/2,cy:r/2,strokeWidth:c,r:t,strokeOpacity:.8,fill:"none",style:{stroke:"#ffffff"},"data-testid":"circular-progress-track"}),s.jsx("circle",{cx:r/2,cy:r/2,strokeWidth:c,r:t,style:{stroke:"url(#gradientStroke)",strokeDasharray:o,strokeDashoffset:i},transform:`rotate(-90 ${r/2} ${r/2})`,fill:"none",strokeLinecap:"round",strokeLinejoin:"round","data-testid":"circular-progress-fill"}),s.jsx(f.default,{x:r/2-a/2,width:a})]})})};exports.default=u;
2
2
  //# sourceMappingURL=CircularProgressBar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CircularProgressBar.js","sources":["../../../../src/components/progress-bar/CircularProgressBar.tsx"],"sourcesContent":["import CheckListIcon from '@src/assets/icons/checklistIcon.svg';\nimport React from 'react';\n\n//TODO: Make Inner icon dynamic and support text option also\nconst CircularProgressBar: React.FC<{\n\tpercentage: number;\n\twidth?: number;\n\tcontainerStyle?: React.CSSProperties;\n}> = ({ percentage, width = 200, containerStyle }) => {\n\tconst cleanedPercentage =\n\t\tpercentage < 0 ? 0 : percentage > 100 ? 100 : percentage;\n\tconst radius = width / 2 - width / 10;\n\tconst dashArray = radius * Math.PI * 2;\n\tconst dashOffset = dashArray - (dashArray * cleanedPercentage) / 100;\n\tconst strokeWidth = width / 10;\n\tconst innerIconWidth = width / 3;\n\treturn (\n\t\t<div style={containerStyle}>\n\t\t\t<svg width={width} height={width} viewBox={`0 0 ${width} ${width}`}>\n\t\t\t\t<defs>\n\t\t\t\t\t<linearGradient id=\"gradientStroke\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n\t\t\t\t\t\t<stop offset=\"0%\" stopColor=\"#7000FF\" />\n\t\t\t\t\t\t<stop offset=\"100%\" stopColor=\"#AD00FF\" />\n\t\t\t\t\t</linearGradient>\n\t\t\t\t</defs>\n\t\t\t\t<circle\n\t\t\t\t\tcx={width / 2}\n\t\t\t\t\tcy={width / 2}\n\t\t\t\t\tstrokeWidth={strokeWidth}\n\t\t\t\t\tr={radius}\n\t\t\t\t\tstrokeOpacity={0.8}\n\t\t\t\t\tfill={'none'}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tstroke: '#ffffff',\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t\t<circle\n\t\t\t\t\tcx={width / 2}\n\t\t\t\t\tcy={width / 2}\n\t\t\t\t\tstrokeWidth={strokeWidth}\n\t\t\t\t\tr={radius}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tstroke: 'url(#gradientStroke)',\n\t\t\t\t\t\tstrokeDasharray: dashArray,\n\t\t\t\t\t\tstrokeDashoffset: dashOffset,\n\t\t\t\t\t}}\n\t\t\t\t\ttransform={`rotate(-90 ${width / 2} ${width / 2})`}\n\t\t\t\t\tfill={'none'}\n\t\t\t\t\tstrokeLinecap={'round'}\n\t\t\t\t\tstrokeLinejoin={'round'}\n\t\t\t\t/>\n\t\t\t\t<CheckListIcon\n\t\t\t\t\tx={width / 2 - innerIconWidth / 2}\n\t\t\t\t\twidth={innerIconWidth}\n\t\t\t\t/>\n\t\t\t</svg>\n\t\t</div>\n\t);\n};\n\nexport default CircularProgressBar;\n"],"names":["CircularProgressBar","percentage","width","containerStyle","cleanedPercentage","radius","dashArray","dashOffset","strokeWidth","innerIconWidth","jsx","jsxs","CheckListIcon"],"mappings":"sMAIMA,EAID,CAAC,CAAE,WAAAC,EAAY,MAAAC,EAAQ,IAAK,eAAAC,KAAqB,CACrD,MAAMC,EACLH,EAAa,EAAI,EAAIA,EAAa,IAAM,IAAMA,EACzCI,EAASH,EAAQ,EAAIA,EAAQ,GAC7BI,EAAYD,EAAS,KAAK,GAAK,EAC/BE,EAAaD,EAAaA,EAAYF,EAAqB,IAC3DI,EAAcN,EAAQ,GACtBO,EAAiBP,EAAQ,EAC/B,OACCQ,EAAAA,IAAC,MAAA,CAAI,MAAOP,EACX,gBAAC,MAAA,CAAI,MAAAD,EAAc,OAAQA,EAAO,QAAS,OAAOA,CAAK,IAAIA,CAAK,GAC/D,SAAA,CAAAQ,EAAAA,IAAC,OAAA,CACA,SAAAC,EAAAA,KAAC,iBAAA,CAAe,GAAG,iBAAiB,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,KAChE,SAAA,CAAAD,EAAAA,IAAC,OAAA,CAAK,OAAO,KAAK,UAAU,UAAU,EACtCA,EAAAA,IAAC,OAAA,CAAK,OAAO,OAAO,UAAU,SAAA,CAAU,CAAA,CAAA,CACzC,CAAA,CACD,EACAA,EAAAA,IAAC,SAAA,CACA,GAAIR,EAAQ,EACZ,GAAIA,EAAQ,EACZ,YAAAM,EACA,EAAGH,EACH,cAAe,GACf,KAAM,OACN,MAAO,CACN,OAAQ,SAAA,CACT,CAAA,EAEDK,EAAAA,IAAC,SAAA,CACA,GAAIR,EAAQ,EACZ,GAAIA,EAAQ,EACZ,YAAAM,EACA,EAAGH,EACH,MAAO,CACN,OAAQ,uBACR,gBAAiBC,EACjB,iBAAkBC,CAAA,EAEnB,UAAW,cAAcL,EAAQ,CAAC,IAAIA,EAAQ,CAAC,IAC/C,KAAM,OACN,cAAe,QACf,eAAgB,OAAA,CAAA,EAEjBQ,EAAAA,IAACE,EAAAA,QAAA,CACA,EAAGV,EAAQ,EAAIO,EAAiB,EAChC,MAAOA,CAAA,CAAA,CACR,CAAA,CACD,CAAA,CACD,CAEF"}
1
+ {"version":3,"file":"CircularProgressBar.js","sources":["../../../../src/components/progress-bar/CircularProgressBar.tsx"],"sourcesContent":["import CheckListIcon from '@src/assets/icons/checklistIcon.svg';\nimport React from 'react';\n\n//TODO: Make Inner icon dynamic and support text option also\nconst CircularProgressBar: React.FC<{\n\tpercentage: number;\n\twidth?: number;\n\tcontainerStyle?: React.CSSProperties;\n}> = ({ percentage, width = 200, containerStyle }) => {\n\tconst cleanedPercentage =\n\t\tpercentage < 0 ? 0 : percentage > 100 ? 100 : percentage;\n\tconst radius = width / 2 - width / 10;\n\tconst dashArray = radius * Math.PI * 2;\n\tconst dashOffset = dashArray - (dashArray * cleanedPercentage) / 100;\n\tconst strokeWidth = width / 10;\n\tconst innerIconWidth = width / 3;\n\treturn (\n\t\t<div style={containerStyle} data-testid=\"circular-progress-container\">\n\t\t\t<svg\n\t\t\t\twidth={width}\n\t\t\t\theight={width}\n\t\t\t\tviewBox={`0 0 ${width} ${width}`}\n\t\t\t\tdata-testid=\"circular-progress-svg\"\n\t\t\t>\n\t\t\t\t<defs>\n\t\t\t\t\t<linearGradient id=\"gradientStroke\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n\t\t\t\t\t\t<stop offset=\"0%\" stopColor=\"#7000FF\" />\n\t\t\t\t\t\t<stop offset=\"100%\" stopColor=\"#AD00FF\" />\n\t\t\t\t\t</linearGradient>\n\t\t\t\t</defs>\n\t\t\t\t<circle\n\t\t\t\t\tcx={width / 2}\n\t\t\t\t\tcy={width / 2}\n\t\t\t\t\tstrokeWidth={strokeWidth}\n\t\t\t\t\tr={radius}\n\t\t\t\t\tstrokeOpacity={0.8}\n\t\t\t\t\tfill={'none'}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tstroke: '#ffffff',\n\t\t\t\t\t}}\n\t\t\t\t\tdata-testid=\"circular-progress-track\"\n\t\t\t\t/>\n\t\t\t\t<circle\n\t\t\t\t\tcx={width / 2}\n\t\t\t\t\tcy={width / 2}\n\t\t\t\t\tstrokeWidth={strokeWidth}\n\t\t\t\t\tr={radius}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tstroke: 'url(#gradientStroke)',\n\t\t\t\t\t\tstrokeDasharray: dashArray,\n\t\t\t\t\t\tstrokeDashoffset: dashOffset,\n\t\t\t\t\t}}\n\t\t\t\t\ttransform={`rotate(-90 ${width / 2} ${width / 2})`}\n\t\t\t\t\tfill={'none'}\n\t\t\t\t\tstrokeLinecap={'round'}\n\t\t\t\t\tstrokeLinejoin={'round'}\n\t\t\t\t\tdata-testid=\"circular-progress-fill\"\n\t\t\t\t/>\n\t\t\t\t<CheckListIcon\n\t\t\t\t\tx={width / 2 - innerIconWidth / 2}\n\t\t\t\t\twidth={innerIconWidth}\n\t\t\t\t/>\n\t\t\t</svg>\n\t\t</div>\n\t);\n};\n\nexport default CircularProgressBar;\n"],"names":["CircularProgressBar","percentage","width","containerStyle","cleanedPercentage","radius","dashArray","dashOffset","strokeWidth","innerIconWidth","jsx","jsxs","CheckListIcon"],"mappings":"sMAIMA,EAID,CAAC,CAAE,WAAAC,EAAY,MAAAC,EAAQ,IAAK,eAAAC,KAAqB,CACrD,MAAMC,EACLH,EAAa,EAAI,EAAIA,EAAa,IAAM,IAAMA,EACzCI,EAASH,EAAQ,EAAIA,EAAQ,GAC7BI,EAAYD,EAAS,KAAK,GAAK,EAC/BE,EAAaD,EAAaA,EAAYF,EAAqB,IAC3DI,EAAcN,EAAQ,GACtBO,EAAiBP,EAAQ,EAC/B,OACCQ,EAAAA,IAAC,MAAA,CAAI,MAAOP,EAAgB,cAAY,8BACvC,SAAAQ,EAAAA,KAAC,MAAA,CACA,MAAAT,EACA,OAAQA,EACR,QAAS,OAAOA,CAAK,IAAIA,CAAK,GAC9B,cAAY,wBAEZ,SAAA,CAAAQ,EAAAA,IAAC,OAAA,CACA,SAAAC,EAAAA,KAAC,iBAAA,CAAe,GAAG,iBAAiB,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,KAChE,SAAA,CAAAD,EAAAA,IAAC,OAAA,CAAK,OAAO,KAAK,UAAU,UAAU,EACtCA,EAAAA,IAAC,OAAA,CAAK,OAAO,OAAO,UAAU,SAAA,CAAU,CAAA,CAAA,CACzC,CAAA,CACD,EACAA,EAAAA,IAAC,SAAA,CACA,GAAIR,EAAQ,EACZ,GAAIA,EAAQ,EACZ,YAAAM,EACA,EAAGH,EACH,cAAe,GACf,KAAM,OACN,MAAO,CACN,OAAQ,SAAA,EAET,cAAY,yBAAA,CAAA,EAEbK,EAAAA,IAAC,SAAA,CACA,GAAIR,EAAQ,EACZ,GAAIA,EAAQ,EACZ,YAAAM,EACA,EAAGH,EACH,MAAO,CACN,OAAQ,uBACR,gBAAiBC,EACjB,iBAAkBC,CAAA,EAEnB,UAAW,cAAcL,EAAQ,CAAC,IAAIA,EAAQ,CAAC,IAC/C,KAAM,OACN,cAAe,QACf,eAAgB,QAChB,cAAY,wBAAA,CAAA,EAEbQ,EAAAA,IAACE,EAAAA,QAAA,CACA,EAAGV,EAAQ,EAAIO,EAAiB,EAChC,MAAOA,CAAA,CAAA,CACR,CAAA,CAAA,EAEF,CAEF"}
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("react-bootstrap"),n=require("styled-components"),s=require("../../constants/Theme.js"),a=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},c=a(n),l=e=>t.jsx(o,{color:e.color?e.color:s.COLORS.content.brand,children:t.jsx(r.ProgressBar,{animated:e.isAnimated,now:e.completed,style:{height:`${e.height?e.height:8}px`}})}),o=c.default.div`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),o=require("react-bootstrap"),s=require("styled-components"),n=require("../../constants/Theme.js"),a=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},c=a(s),l=e=>t.jsx(r,{color:e.color?e.color:n.COLORS.content.brand,children:t.jsx(o.ProgressBar,{animated:e.isAnimated,now:e.completed,style:{height:`${e.height?e.height:8}px`},"data-testid":"progress-bar-wrapper"})}),r=c.default.div`
2
2
  flex: 50%;
3
3
  .progress-bar {
4
4
  background: ${e=>e.color};
5
5
  }
6
- `;exports.ProgressBarComponent=l;exports.ProgressCompletedBar=o;
6
+ `;exports.ProgressBarComponent=l;exports.ProgressCompletedBar=r;
7
7
  //# sourceMappingURL=ProgressBarComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBarComponent.js","sources":["../../../../src/components/progress-bar/ProgressBarComponent.tsx"],"sourcesContent":["import { ProgressBar } from 'react-bootstrap';\nimport styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\n\nexport interface ProgressBarProps {\n\tcompleted: number;\n\tisAnimated: boolean;\n\tcolor?: string;\n\theight?: number;\n}\n\nexport const ProgressBarComponent = (props: ProgressBarProps) => {\n\treturn (\n\t\t<ProgressCompletedBar\n\t\t\tcolor={props.color ? props.color : COLORS.content.brand}\n\t\t>\n\t\t\t<ProgressBar\n\t\t\t\tanimated={props.isAnimated}\n\t\t\t\tnow={props.completed}\n\t\t\t\tstyle={{ height: `${props.height ? props.height : 8}px` }}\n\t\t\t/>\n\t\t</ProgressCompletedBar>\n\t);\n};\n\nexport const ProgressCompletedBar = styled.div<{ color: string }>`\n\tflex: 50%;\n\t.progress-bar {\n\t\tbackground: ${(props) => props.color};\n\t}\n`;\n"],"names":["ProgressBarComponent","props","jsx","ProgressCompletedBar","COLORS","ProgressBar","styled"],"mappings":"sRAWaA,EAAwBC,GAEnCC,EAAAA,IAACC,EAAA,CACA,MAAOF,EAAM,MAAQA,EAAM,MAAQG,EAAAA,OAAO,QAAQ,MAElD,SAAAF,EAAAA,IAACG,EAAAA,YAAA,CACA,SAAUJ,EAAM,WAChB,IAAKA,EAAM,UACX,MAAO,CAAE,OAAQ,GAAGA,EAAM,OAASA,EAAM,OAAS,CAAC,IAAA,CAAK,CAAA,CACzD,CAAA,EAKUE,EAAuBG,EAAAA,QAAO;AAAA;AAAA;AAAA,gBAG1BL,GAAUA,EAAM,KAAK;AAAA;AAAA"}
1
+ {"version":3,"file":"ProgressBarComponent.js","sources":["../../../../src/components/progress-bar/ProgressBarComponent.tsx"],"sourcesContent":["import { ProgressBar } from 'react-bootstrap';\nimport styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\n\nexport interface ProgressBarProps {\n\tcompleted: number;\n\tisAnimated: boolean;\n\tcolor?: string;\n\theight?: number;\n}\n\nexport const ProgressBarComponent = (props: ProgressBarProps) => {\n\treturn (\n\t\t<ProgressCompletedBar\n\t\t\tcolor={props.color ? props.color : COLORS.content.brand}\n\t\t>\n\t\t\t<ProgressBar\n\t\t\t\tanimated={props.isAnimated}\n\t\t\t\tnow={props.completed}\n\t\t\t\tstyle={{ height: `${props.height ? props.height : 8}px` }}\n\t\t\t\tdata-testid=\"progress-bar-wrapper\"\n\t\t\t/>\n\t\t</ProgressCompletedBar>\n\t);\n};\n\nexport const ProgressCompletedBar = styled.div<{ color: string }>`\n\tflex: 50%;\n\t.progress-bar {\n\t\tbackground: ${(props) => props.color};\n\t}\n`;\n"],"names":["ProgressBarComponent","props","jsx","ProgressCompletedBar","COLORS","ProgressBar","styled"],"mappings":"sRAWaA,EAAwBC,GAEnCC,EAAAA,IAACC,EAAA,CACA,MAAOF,EAAM,MAAQA,EAAM,MAAQG,EAAAA,OAAO,QAAQ,MAElD,SAAAF,EAAAA,IAACG,EAAAA,YAAA,CACA,SAAUJ,EAAM,WAChB,IAAKA,EAAM,UACX,MAAO,CAAE,OAAQ,GAAGA,EAAM,OAASA,EAAM,OAAS,CAAC,IAAA,EACnD,cAAY,sBAAA,CAAA,CACb,CAAA,EAKUE,EAAuBG,EAAAA,QAAO;AAAA;AAAA;AAAA,gBAG1BL,GAAUA,EAAM,KAAK;AAAA;AAAA"}