@bikdotai/bik-component-library 0.0.840-beta.0 → 0.0.840-tools-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 (225) hide show
  1. package/dist/cjs/assets/icons/BigCommerce.svg.js +2 -0
  2. package/dist/cjs/assets/icons/BigCommerce.svg.js.map +1 -0
  3. package/dist/cjs/assets/icons/ShipStation.svg.js +2 -0
  4. package/dist/cjs/assets/icons/ShipStation.svg.js.map +1 -0
  5. package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js +1 -1
  6. package/dist/cjs/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  7. package/dist/cjs/components/SearchFilter/index.js +1 -1
  8. package/dist/cjs/components/SearchFilter/index.js.map +1 -1
  9. package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
  10. package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
  11. package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +39 -51
  12. package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  13. package/dist/cjs/components/agent-builder/components/AgentBuilderFooter.js +1 -1
  14. package/dist/cjs/components/agent-builder/components/AgentBuilderFooter.js.map +1 -1
  15. package/dist/cjs/components/agent-builder/components/AgentBuilderTopBar.js +1 -1
  16. package/dist/cjs/components/agent-builder/components/AgentBuilderTopBar.js.map +1 -1
  17. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js +2 -2
  18. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
  19. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +1 -1
  20. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  21. package/dist/cjs/components/agent-builder/components/DiscardModal.js +1 -1
  22. package/dist/cjs/components/agent-builder/components/DiscardModal.js.map +1 -1
  23. package/dist/cjs/components/agent-builder/components/GoLiveModal.js +1 -1
  24. package/dist/cjs/components/agent-builder/components/GoLiveModal.js.map +1 -1
  25. package/dist/cjs/components/agent-builder/components/MentionEditor.js +1 -1
  26. package/dist/cjs/components/agent-builder/components/MentionEditor.js.map +1 -1
  27. package/dist/cjs/components/agent-builder/components/MentionPicker.js +22 -22
  28. package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
  29. package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js +4 -4
  30. package/dist/cjs/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
  31. package/dist/cjs/components/agent-builder/components/SelectableListSection.js +6 -6
  32. package/dist/cjs/components/agent-builder/components/SelectableListSection.js.map +1 -1
  33. package/dist/cjs/components/agent-builder/components/StepSectionHeader.js +1 -1
  34. package/dist/cjs/components/agent-builder/components/StepSectionHeader.js.map +1 -1
  35. package/dist/cjs/components/agent-builder/constants/tools.js +1 -1
  36. package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
  37. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
  38. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  39. package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js +1 -3
  40. package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
  41. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js +1 -1
  42. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  43. package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js +1 -1
  44. package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
  45. package/dist/cjs/components/agent-builder/utils/mentionSerialization.js +3 -5
  46. package/dist/cjs/components/agent-builder/utils/mentionSerialization.js.map +1 -1
  47. package/dist/cjs/components/agent-builder/utils/sourceIcons.js +1 -1
  48. package/dist/cjs/components/agent-builder/utils/sourceIcons.js.map +1 -1
  49. package/dist/cjs/components/agent-listing/AgentListing.js +1 -1
  50. package/dist/cjs/components/agent-listing/AgentListing.js.map +1 -1
  51. package/dist/cjs/components/agent-listing/AgentTable.js +1 -1
  52. package/dist/cjs/components/agent-listing/AgentTable.js.map +1 -1
  53. package/dist/cjs/components/agent-listing/AgentTableRow.js +1 -1
  54. package/dist/cjs/components/agent-listing/AgentTableRow.js.map +1 -1
  55. package/dist/cjs/components/agent-listing/DeleteAgentModal.js +1 -1
  56. package/dist/cjs/components/agent-listing/DeleteAgentModal.js.map +1 -1
  57. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsChip.js +1 -1
  58. package/dist/cjs/components/analytics-chips-and-dropdowns/AnalyticsChip.js.map +1 -1
  59. package/dist/cjs/components/button/Button.styled.js +0 -1
  60. package/dist/cjs/components/button/Button.styled.js.map +1 -1
  61. package/dist/cjs/components/button/themes.js +11 -11
  62. package/dist/cjs/components/button/themes.js.map +1 -1
  63. package/dist/cjs/components/dashboard-review-popup/DashboardReviewPopUp.js +1 -1
  64. package/dist/cjs/components/dashboard-review-popup/DashboardReviewPopUp.js.map +1 -1
  65. package/dist/cjs/components/dropdown/Dropdown.js +1 -1
  66. package/dist/cjs/components/dropdown/Dropdown.js.map +1 -1
  67. package/dist/cjs/components/dropdown-button/DropdownButton.js +1 -1
  68. package/dist/cjs/components/dropdown-button/DropdownButton.js.map +1 -1
  69. package/dist/cjs/components/input/Input.js +1 -1
  70. package/dist/cjs/components/input/Input.js.map +1 -1
  71. package/dist/cjs/components/multi-level-dropdown/MenuItem.js +1 -1
  72. package/dist/cjs/components/multi-level-dropdown/MenuItem.js.map +1 -1
  73. package/dist/cjs/components/radioButton/RadioButton.js +1 -1
  74. package/dist/cjs/components/radioButton/RadioButton.js.map +1 -1
  75. package/dist/cjs/components/radioList/RadioList.js +1 -1
  76. package/dist/cjs/components/radioList/RadioList.js.map +1 -1
  77. package/dist/cjs/components/searchBar/searchBar.js +1 -1
  78. package/dist/cjs/components/searchBar/searchBar.js.map +1 -1
  79. package/dist/cjs/components/side-modal/SideModal.js +1 -1
  80. package/dist/cjs/components/side-modal/SideModal.js.map +1 -1
  81. package/dist/cjs/components/star-rating/Star.js +1 -1
  82. package/dist/cjs/components/star-rating/Star.js.map +1 -1
  83. package/dist/cjs/components/star-rating/StarRating.js +2 -2
  84. package/dist/cjs/components/star-rating/StarRating.js.map +1 -1
  85. package/dist/cjs/components/template-preview/TemplatePreview.js +1 -1
  86. package/dist/cjs/components/template-preview/TemplatePreview.js.map +1 -1
  87. package/dist/cjs/components/thumbnail/Thumbnail.js +1 -1
  88. package/dist/cjs/components/thumbnail/Thumbnail.js.map +1 -1
  89. package/dist/cjs/components/zeroState/ZeroState.js +3 -3
  90. package/dist/cjs/components/zeroState/ZeroState.js.map +1 -1
  91. package/dist/cjs/editor/BikEditor.js +1 -1
  92. package/dist/cjs/editor/BikEditor.js.map +1 -1
  93. package/dist/cjs/editor/BikEditor.styles.js +54 -97
  94. package/dist/cjs/editor/BikEditor.styles.js.map +1 -1
  95. package/dist/cjs/editor/extensions/jsonHighlight/JsonHighlightExtension.js +3 -3
  96. package/dist/cjs/editor/extensions/jsonHighlight/JsonHighlightExtension.js.map +1 -1
  97. package/dist/cjs/icons/index.js +1 -1
  98. package/dist/esm/assets/icons/BigCommerce.svg.js +6 -0
  99. package/dist/esm/assets/icons/BigCommerce.svg.js.map +1 -0
  100. package/dist/esm/assets/icons/ShipStation.svg.js +6 -0
  101. package/dist/esm/assets/icons/ShipStation.svg.js.map +1 -0
  102. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js +61 -66
  103. package/dist/esm/components/BikGiftedChat/GiftedChat/GiftedChat.js.map +1 -1
  104. package/dist/esm/components/SearchFilter/index.js +10 -11
  105. package/dist/esm/components/SearchFilter/index.js.map +1 -1
  106. package/dist/esm/components/agent-builder/AgentBuilder.js +102 -106
  107. package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
  108. package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +7 -0
  109. package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +6 -3
  110. package/dist/esm/components/agent-builder/AgentBuilder.styled.js +106 -118
  111. package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  112. package/dist/esm/components/agent-builder/components/AgentBuilderFooter.js +21 -29
  113. package/dist/esm/components/agent-builder/components/AgentBuilderFooter.js.map +1 -1
  114. package/dist/esm/components/agent-builder/components/AgentBuilderTopBar.js +26 -27
  115. package/dist/esm/components/agent-builder/components/AgentBuilderTopBar.js.map +1 -1
  116. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +25 -25
  117. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
  118. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +23 -24
  119. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  120. package/dist/esm/components/agent-builder/components/DiscardModal.d.ts +1 -3
  121. package/dist/esm/components/agent-builder/components/DiscardModal.js +24 -33
  122. package/dist/esm/components/agent-builder/components/DiscardModal.js.map +1 -1
  123. package/dist/esm/components/agent-builder/components/GoLiveModal.js +21 -23
  124. package/dist/esm/components/agent-builder/components/GoLiveModal.js.map +1 -1
  125. package/dist/esm/components/agent-builder/components/MentionEditor.js +19 -19
  126. package/dist/esm/components/agent-builder/components/MentionEditor.js.map +1 -1
  127. package/dist/esm/components/agent-builder/components/MentionPicker.js +147 -177
  128. package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
  129. package/dist/esm/components/agent-builder/components/RestApiToolPanel.d.ts +0 -2
  130. package/dist/esm/components/agent-builder/components/RestApiToolPanel.js +105 -111
  131. package/dist/esm/components/agent-builder/components/RestApiToolPanel.js.map +1 -1
  132. package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +4 -13
  133. package/dist/esm/components/agent-builder/components/SelectableListSection.js +148 -173
  134. package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
  135. package/dist/esm/components/agent-builder/components/StepSectionHeader.js +7 -7
  136. package/dist/esm/components/agent-builder/components/StepSectionHeader.js.map +1 -1
  137. package/dist/esm/components/agent-builder/constants/tools.d.ts +2 -0
  138. package/dist/esm/components/agent-builder/constants/tools.js +22 -17
  139. package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
  140. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +103 -104
  141. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  142. package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js +102 -101
  143. package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
  144. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +142 -144
  145. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  146. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js +79 -23
  147. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
  148. package/dist/esm/components/agent-builder/utils/mentionSerialization.js +23 -35
  149. package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
  150. package/dist/esm/components/agent-builder/utils/sourceIcons.js +20 -16
  151. package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -1
  152. package/dist/esm/components/agent-listing/AgentListing.js +65 -70
  153. package/dist/esm/components/agent-listing/AgentListing.js.map +1 -1
  154. package/dist/esm/components/agent-listing/AgentTable.d.ts +0 -2
  155. package/dist/esm/components/agent-listing/AgentTable.js +15 -16
  156. package/dist/esm/components/agent-listing/AgentTable.js.map +1 -1
  157. package/dist/esm/components/agent-listing/AgentTableRow.js +11 -11
  158. package/dist/esm/components/agent-listing/AgentTableRow.js.map +1 -1
  159. package/dist/esm/components/agent-listing/DeleteAgentModal.js +8 -8
  160. package/dist/esm/components/agent-listing/DeleteAgentModal.js.map +1 -1
  161. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsChip.js +10 -11
  162. package/dist/esm/components/analytics-chips-and-dropdowns/AnalyticsChip.js.map +1 -1
  163. package/dist/esm/components/button/Button.styled.js +19 -25
  164. package/dist/esm/components/button/Button.styled.js.map +1 -1
  165. package/dist/esm/components/button/themes.d.ts +0 -1
  166. package/dist/esm/components/button/themes.js +51 -61
  167. package/dist/esm/components/button/themes.js.map +1 -1
  168. package/dist/esm/components/dashboard-review-popup/DashboardReviewPopUp.js +21 -28
  169. package/dist/esm/components/dashboard-review-popup/DashboardReviewPopUp.js.map +1 -1
  170. package/dist/esm/components/dropdown/Dropdown.js +13 -18
  171. package/dist/esm/components/dropdown/Dropdown.js.map +1 -1
  172. package/dist/esm/components/dropdown-button/DropdownButton.js +13 -13
  173. package/dist/esm/components/dropdown-button/DropdownButton.js.map +1 -1
  174. package/dist/esm/components/input/Input.js +34 -35
  175. package/dist/esm/components/input/Input.js.map +1 -1
  176. package/dist/esm/components/input/Input.model.d.ts +0 -1
  177. package/dist/esm/components/multi-level-dropdown/MenuItem.js +27 -28
  178. package/dist/esm/components/multi-level-dropdown/MenuItem.js.map +1 -1
  179. package/dist/esm/components/radioButton/RadioButton.js +9 -10
  180. package/dist/esm/components/radioButton/RadioButton.js.map +1 -1
  181. package/dist/esm/components/radioList/RadioList.js +19 -28
  182. package/dist/esm/components/radioList/RadioList.js.map +1 -1
  183. package/dist/esm/components/searchBar/searchBar.js +10 -11
  184. package/dist/esm/components/searchBar/searchBar.js.map +1 -1
  185. package/dist/esm/components/side-modal/SideModal.js +5 -13
  186. package/dist/esm/components/side-modal/SideModal.js.map +1 -1
  187. package/dist/esm/components/star-rating/Star.d.ts +0 -1
  188. package/dist/esm/components/star-rating/Star.js +27 -32
  189. package/dist/esm/components/star-rating/Star.js.map +1 -1
  190. package/dist/esm/components/star-rating/StarRating.js +16 -17
  191. package/dist/esm/components/star-rating/StarRating.js.map +1 -1
  192. package/dist/esm/components/template-preview/TemplatePreview.js +40 -41
  193. package/dist/esm/components/template-preview/TemplatePreview.js.map +1 -1
  194. package/dist/esm/components/thumbnail/Thumbnail.js +3 -3
  195. package/dist/esm/components/thumbnail/Thumbnail.js.map +1 -1
  196. package/dist/esm/components/zeroState/ZeroState.js +13 -20
  197. package/dist/esm/components/zeroState/ZeroState.js.map +1 -1
  198. package/dist/esm/editor/BikEditor.js +160 -173
  199. package/dist/esm/editor/BikEditor.js.map +1 -1
  200. package/dist/esm/editor/BikEditor.styles.d.ts +3 -20
  201. package/dist/esm/editor/BikEditor.styles.js +57 -102
  202. package/dist/esm/editor/BikEditor.styles.js.map +1 -1
  203. package/dist/esm/editor/extensions/jsonHighlight/JsonHighlightExtension.d.ts +8 -5
  204. package/dist/esm/editor/extensions/jsonHighlight/JsonHighlightExtension.js +68 -87
  205. package/dist/esm/editor/extensions/jsonHighlight/JsonHighlightExtension.js.map +1 -1
  206. package/dist/esm/icons/Media/Visual/index.d.ts +0 -2
  207. package/dist/esm/icons/index.d.ts +25 -25
  208. package/dist/esm/icons/index.js +416 -420
  209. package/dist/esm/icons/index.js.map +1 -1
  210. package/package.json +1 -1
  211. package/dist/cjs/components/agent-listing/AgentTableShimmer.js +0 -2
  212. package/dist/cjs/components/agent-listing/AgentTableShimmer.js.map +0 -1
  213. package/dist/cjs/icons/Media/Visual/FormkitNeutral.js +0 -2
  214. package/dist/cjs/icons/Media/Visual/FormkitNeutral.js.map +0 -1
  215. package/dist/cjs/icons/Media/Visual/FormkitSad.js +0 -2
  216. package/dist/cjs/icons/Media/Visual/FormkitSad.js.map +0 -1
  217. package/dist/esm/components/agent-builder/__fixtures__/agentValue.d.ts +0 -11
  218. package/dist/esm/components/agent-listing/AgentTableShimmer.d.ts +0 -12
  219. package/dist/esm/components/agent-listing/AgentTableShimmer.js +0 -20
  220. package/dist/esm/components/agent-listing/AgentTableShimmer.js.map +0 -1
  221. package/dist/esm/components/agent-listing/__fixtures__/agents.d.ts +0 -3
  222. package/dist/esm/icons/Media/Visual/FormkitNeutral.js +0 -58
  223. package/dist/esm/icons/Media/Visual/FormkitNeutral.js.map +0 -1
  224. package/dist/esm/icons/Media/Visual/FormkitSad.js +0 -61
  225. package/dist/esm/icons/Media/Visual/FormkitSad.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardReviewPopUp.js","sources":["../../../../src/components/dashboard-review-popup/DashboardReviewPopUp.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport CrossIcon from '../../assets/icons/cross.svg';\nimport { DropShadow } from '../dropShadow';\nimport { FiveStar } from './components/FiveStar';\nimport { Form } from './components/Form';\nimport { ZeroState } from './components/ZeroState';\nimport { Container, CrossIconHolder } from './DashboardReviewPopUp.styled';\n\nexport const DashboardReviewPopUp: React.FC<{\n\tonSubmit: (\n\t\tstars: number,\n\t\tquickAnswers?: string[],\n\t\treviewText?: string,\n\t) => void;\n\tonClose: () => void;\n\tquickAnswerOptions?: string[];\n\ttitleMap?: { [key: number]: string };\n\tfeedbackMap?: { [key: number]: string };\n\tfullStarSubmitText: string;\n\tonRatingChange?: (stars: number) => void;\n\tinitialText?: string;\n\tfiveStar?: { subText: string };\n}> = ({\n\tonClose,\n\tonSubmit,\n\tquickAnswerOptions,\n\ttitleMap,\n\tfeedbackMap,\n\tfullStarSubmitText,\n\tonRatingChange,\n\tinitialText,\n\tfiveStar,\n}) => {\n\tconst [starsSelected, setStartsSelected] = useState<number>(0);\n\n\tfunction handleStarSelection(stars: number) {\n\t\tsetStartsSelected(stars);\n\t\tonRatingChange?.(stars);\n\t}\n\n\treturn (\n\t\t<DropShadow level={'z2'} position={'down'}>\n\t\t\t<Container>\n\t\t\t\t<CrossIconHolder onClick={onClose}>\n\t\t\t\t\t<CrossIcon\n\t\t\t\t\t\tdata-testid=\"dashboard-review-popup-close\"\n\t\t\t\t\t\twidth={24}\n\t\t\t\t\t\theight={24}\n\t\t\t\t\t/>\n\t\t\t\t</CrossIconHolder>\n\t\t\t\t{starsSelected === 0 ? (\n\t\t\t\t\t<ZeroState\n\t\t\t\t\t\thandleStarSelection={handleStarSelection}\n\t\t\t\t\t\tinitialText={initialText}\n\t\t\t\t\t/>\n\t\t\t\t) : starsSelected === 5 ? (\n\t\t\t\t\t<FiveStar\n\t\t\t\t\t\tfullStarSubmitText={fullStarSubmitText}\n\t\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\t\thandleStarSelection={handleStarSelection}\n\t\t\t\t\t\tsubtext={fiveStar?.subText}\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<Form\n\t\t\t\t\t\ttitleMap={titleMap}\n\t\t\t\t\t\tfeedbackMap={feedbackMap}\n\t\t\t\t\t\tstars={starsSelected}\n\t\t\t\t\t\tonStarChange={handleStarSelection}\n\t\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\t\tquickAnswerOptions={quickAnswerOptions}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Container>\n\t\t</DropShadow>\n\t);\n};\n"],"names":["DashboardReviewPopUp","onClose","onSubmit","quickAnswerOptions","titleMap","feedbackMap","fullStarSubmitText","onRatingChange","initialText","fiveStar","starsSelected","setStartsSelected","useState","handleStarSelection","stars","DropShadow","Container","jsx","CrossIconHolder","CrossIcon","ZeroState","FiveStar","Form"],"mappings":";;;;;;;;AAQO,MAAMA,IAcR,CAAC;AAAA,EACL,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AACD,MAAM;AACL,QAAM,CAACC,GAAeC,CAAiB,IAAIC,EAAiB,CAAC;AAE7D,WAASC,EAAoBC,GAAe;AAC3C,IAAAH,EAAkBG,CAAK,GACvBP,IAAiBO,CAAK;AAAA,EACvB;AAEA,2BACEC,GAAA,EAAW,OAAO,MAAM,UAAU,QAClC,4BAACC,GAAA,EACA,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAgB,SAASjB,GACzB,UAAA,gBAAAgB;AAAA,MAACE;AAAAA,MAAA;AAAA,QACA,eAAY;AAAA,QACZ,OAAO;AAAA,QACP,QAAQ;AAAA,MAAA;AAAA,IAAA,GAEV;AAAA,IACCT,MAAkB,IAClB,gBAAAO;AAAA,MAACG;AAAA,MAAA;AAAA,QACA,qBAAAP;AAAA,QACA,aAAAL;AAAA,MAAA;AAAA,IAAA,IAEEE,MAAkB,IACrB,gBAAAO;AAAA,MAACI;AAAA,MAAA;AAAA,QACA,oBAAAf;AAAA,QACA,UAAAJ;AAAA,QACA,qBAAAW;AAAA,QACA,SAASJ,GAAU;AAAA,MAAA;AAAA,IAAA,IAGpB,gBAAAQ;AAAA,MAACK;AAAA,MAAA;AAAA,QACA,UAAAlB;AAAA,QACA,aAAAC;AAAA,QACA,OAAOK;AAAA,QACP,cAAcG;AAAA,QACd,UAAAX;AAAA,QACA,oBAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EACD,EAAA,CAEF,EAAA,CACD;AAEF;"}
1
+ {"version":3,"file":"DashboardReviewPopUp.js","sources":["../../../../src/components/dashboard-review-popup/DashboardReviewPopUp.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport CrossIcon from '../../assets/icons/cross.svg';\nimport { DropShadow } from '../dropShadow';\nimport { FiveStar } from './components/FiveStar';\nimport { Form } from './components/Form';\nimport { ZeroState } from './components/ZeroState';\nimport { Container, CrossIconHolder } from './DashboardReviewPopUp.styled';\n\nexport const DashboardReviewPopUp: React.FC<{\n\tonSubmit: (\n\t\tstars: number,\n\t\tquickAnswers?: string[],\n\t\treviewText?: string,\n\t) => void;\n\tonClose: () => void;\n\tquickAnswerOptions?: string[];\n\ttitleMap?: { [key: number]: string };\n\tfeedbackMap?: { [key: number]: string };\n\tfullStarSubmitText: string;\n\tonRatingChange?: (stars: number) => void;\n\tinitialText?: string;\n\tfiveStar?: { subText: string };\n}> = ({\n\tonClose,\n\tonSubmit,\n\tquickAnswerOptions,\n\ttitleMap,\n\tfeedbackMap,\n\tfullStarSubmitText,\n\tonRatingChange,\n\tinitialText,\n\tfiveStar,\n}) => {\n\tconst [starsSelected, setStartsSelected] = useState<number>(0);\n\n\tfunction handleStarSelection(stars: number) {\n\t\tsetStartsSelected(stars);\n\t\tonRatingChange?.(stars);\n\t}\n\n\treturn (\n\t\t<DropShadow level={'z2'} position={'down'}>\n\t\t\t<Container>\n\t\t\t\t<CrossIconHolder onClick={onClose}>\n\t\t\t\t\t<CrossIcon width={24} height={24} />\n\t\t\t\t</CrossIconHolder>\n\t\t\t\t{starsSelected === 0 ? (\n\t\t\t\t\t<ZeroState\n\t\t\t\t\t\thandleStarSelection={handleStarSelection}\n\t\t\t\t\t\tinitialText={initialText}\n\t\t\t\t\t/>\n\t\t\t\t) : starsSelected === 5 ? (\n\t\t\t\t\t<FiveStar\n\t\t\t\t\t\tfullStarSubmitText={fullStarSubmitText}\n\t\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\t\thandleStarSelection={handleStarSelection}\n\t\t\t\t\t\tsubtext={fiveStar?.subText}\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<Form\n\t\t\t\t\t\ttitleMap={titleMap}\n\t\t\t\t\t\tfeedbackMap={feedbackMap}\n\t\t\t\t\t\tstars={starsSelected}\n\t\t\t\t\t\tonStarChange={handleStarSelection}\n\t\t\t\t\t\tonSubmit={onSubmit}\n\t\t\t\t\t\tquickAnswerOptions={quickAnswerOptions}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</Container>\n\t\t</DropShadow>\n\t);\n};\n"],"names":["DashboardReviewPopUp","onClose","onSubmit","quickAnswerOptions","titleMap","feedbackMap","fullStarSubmitText","onRatingChange","initialText","fiveStar","starsSelected","setStartsSelected","useState","handleStarSelection","stars","DropShadow","Container","jsx","CrossIconHolder","CrossIcon","ZeroState","FiveStar","Form"],"mappings":";;;;;;;;AAQO,MAAMA,IAcR,CAAC;AAAA,EACL,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AACD,MAAM;AACL,QAAM,CAACC,GAAeC,CAAiB,IAAIC,EAAiB,CAAC;AAE7D,WAASC,EAAoBC,GAAe;AAC3C,IAAAH,EAAkBG,CAAK,GACvBP,IAAiBO,CAAK;AAAA,EACvB;AAEA,2BACEC,GAAA,EAAW,OAAO,MAAM,UAAU,QAClC,4BAACC,GAAA,EACA,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAgB,SAASjB,GACzB,UAAA,gBAAAgB,EAACE,KAAU,OAAO,IAAI,QAAQ,GAAA,CAAI,EAAA,CACnC;AAAA,IACCT,MAAkB,IAClB,gBAAAO;AAAA,MAACG;AAAA,MAAA;AAAA,QACA,qBAAAP;AAAA,QACA,aAAAL;AAAA,MAAA;AAAA,IAAA,IAEEE,MAAkB,IACrB,gBAAAO;AAAA,MAACI;AAAA,MAAA;AAAA,QACA,oBAAAf;AAAA,QACA,UAAAJ;AAAA,QACA,qBAAAW;AAAA,QACA,SAASJ,GAAU;AAAA,MAAA;AAAA,IAAA,IAGpB,gBAAAQ;AAAA,MAACK;AAAA,MAAA;AAAA,QACA,UAAAlB;AAAA,QACA,aAAAC;AAAA,QACA,OAAOK;AAAA,QACP,cAAcG;AAAA,QACd,UAAAX;AAAA,QACA,oBAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EACD,EAAA,CAEF,EAAA,CACD;AAEF;"}
@@ -26,28 +26,28 @@ const H = ({
26
26
  showTrailingIconPlaceholder: V = !1,
27
27
  showLabelsOnMoreHover: j = !1,
28
28
  value: l,
29
- showSelected: f = !1,
29
+ showSelected: h = !1,
30
30
  onDropdownVisbilityChange: z,
31
31
  ...t
32
32
  }) => {
33
- const [c, F] = g(!1), [y, I] = g(!1), i = E ?? "default", B = G(), [s, d] = g(
33
+ const [f, F] = g(!1), [y, I] = g(!1), i = E ?? "default", B = G(), [s, c] = g(
34
34
  o ?? []
35
35
  );
36
36
  function N(e) {
37
- Array.isArray(e) ? d([...e]) : d([e]), M?.(e);
37
+ Array.isArray(e) ? c([...e]) : c([e]), M?.(e);
38
38
  }
39
39
  p(() => {
40
40
  const e = [];
41
- t?.options?.forEach((h) => {
42
- h.options ? h.options.forEach((u) => {
41
+ t?.options?.forEach((d) => {
42
+ d.options ? d.options.forEach((u) => {
43
43
  u.selected && e.push({
44
44
  ...u,
45
45
  label: u.label
46
46
  });
47
- }) : h.selected && e.push(h);
48
- }), d([...e]);
47
+ }) : d.selected && e.push(d);
48
+ }), c([...e]);
49
49
  }, [t.options]), p(() => {
50
- o && d([...o]);
50
+ o && c([...o]);
51
51
  }, [o]);
52
52
  const U = Z(s), _ = w ? a : U ?? a ?? "Select an option", m = t.buttonWidth, C = m ?? t.width ?? "100%", q = t.dropdownWidth ?? C;
53
53
  return /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(
@@ -61,19 +61,14 @@ const H = ({
61
61
  zIndex: 1,
62
62
  cursor: "pointer",
63
63
  padding: i === "x-small" ? "4px 8px" : "6px 8px",
64
- backgroundColor: t.version === "3.0" ? c || y ? r.surface.hovered : r.surface.standard : f && l !== void 0 ? J.positive[100] : (
65
- // The hover wrapper also contains the popover, so while the
66
- // dropdown is open, hovering an option would grey the input
67
- // — only show hover feedback while closed.
68
- y && !c ? r.background.inactive : r.surface.standard
69
- ),
64
+ backgroundColor: t.version === "3.0" ? f || y ? r.surface.hovered : r.surface.standard : h && l !== void 0 ? J.positive[100] : y ? r.background.inactive : r.surface.standard,
70
65
  transition: "background-color 0.3s ease",
71
66
  ...A
72
67
  },
73
68
  input: {
74
69
  minHeight: "100%",
75
70
  maxWidth: "100%",
76
- color: f && l !== void 0 ? r.content.positive : "inherit"
71
+ color: h && l !== void 0 ? r.content.positive : "inherit"
77
72
  }
78
73
  },
79
74
  children: /* @__PURE__ */ n(
@@ -122,12 +117,12 @@ const H = ({
122
117
  K,
123
118
  {
124
119
  style: {
125
- transform: c ? "rotate(180deg)" : "rotate(0deg)"
120
+ transform: f ? "rotate(180deg)" : "rotate(0deg)"
126
121
  },
127
122
  onClick: O,
128
123
  width: i === "x-small" ? 16 : i === "small" ? 20 : 24,
129
124
  height: i === "x-small" ? 16 : i === "small" ? 20 : 24,
130
- color: f ? r.content.positive : r.content.primary
125
+ color: h ? r.content.positive : r.content.primary
131
126
  }
132
127
  )
133
128
  ]
@@ -146,7 +141,7 @@ const H = ({
146
141
  R?.(e);
147
142
  },
148
143
  errorMessage: t.error,
149
- isDropdownOpened: c,
144
+ isDropdownOpened: f,
150
145
  sizeToUse: i,
151
146
  containerStyle: {
152
147
  width: t.width ?? "100%",
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.js","sources":["../../../../src/components/dropdown/Dropdown.tsx"],"sourcesContent":["import React, { Ref, useEffect, useRef, useState } from 'react';\nimport { BASE_COLORS, COLORS } from '@src/constants/Theme';\nimport DownIcon from '../../assets/icons/chevronDown.svg';\nimport { Input } from '../input';\nimport { InputStyleContext } from '../input/context/InputStyleProvider';\nimport ChipInput from './ChipInput';\nimport { DropdownPopover } from './DropdownPopover';\nimport { getSelectedOptionsAsText } from './OpenedDropdown/utils/iterationOnOptions';\nimport {\n\tDropdownOption,\n\tGroupedOption,\n\tOpenDropdownProps,\n\tSingleOption,\n} from './type';\n\nexport type DropdownProps = OpenDropdownProps & {\n\tplaceHolder?: string;\n\tsize?: 'default' | 'small' | 'x-small';\n\tdisabled?: boolean;\n\tnoErrorHint?: boolean;\n\tbuttonWidth?: string;\n\tplaceHolderHeight?: string;\n\tshowPlaceholderWhenSelected?: boolean;\n\tinputStyle?: React.CSSProperties;\n\tinputType?: 'chip' | 'default';\n\tonDeleteChip?: (chip: SingleOption) => void;\n\ttruncatedText?: boolean;\n\t'data-test'?: string;\n\tshowLeadingIconInPlaceholder?: boolean;\n\tshowTrailingIconPlaceholder?: boolean;\n\tshowLabelsOnMoreHover?: boolean;\n\tbackgroundColor?: string;\n\tvalue?: string;\n\tshowSelected?: boolean;\n\t/** Fired when the dropdown opens/closes. Runs alongside internal open state. */\n\tonDropdownVisbilityChange?: (isOpen: boolean) => void;\n};\n\nfunction noop() {\n\t/** empty */\n}\n\nexport const Dropdown: React.FC<DropdownProps> = ({\n\tplaceHolder,\n\tsize,\n\tonSelect,\n\tdefaultOptions,\n\tdisabled,\n\tnoErrorHint,\n\tplaceHolderHeight,\n\tshowPlaceholderWhenSelected = false,\n\tinputStyle = {},\n\tinputType = 'default',\n\tonDeleteChip,\n\ttruncatedText,\n\tshowLeadingIconInPlaceholder = false,\n\tshowTrailingIconPlaceholder = false,\n\tshowLabelsOnMoreHover = false,\n\tvalue,\n\tshowSelected = false,\n\tonDropdownVisbilityChange,\n\t...openDropdownProps\n}) => {\n\tconst [isDropdownOpened, setDropdownOpenFlag] = useState(false);\n\tconst [isHovering, setIsHovering] = useState(false);\n\tconst sizeToUse = size ?? 'default';\n\tconst dropdownVisibilityRef = useRef<{\n\t\topenDropdown: boolean;\n\t}>();\n\tconst [selectedOption, setSelectedOption] = useState<DropdownOption[]>(\n\t\tdefaultOptions ?? [],\n\t);\n\tfunction handleSelection(option: DropdownOption | DropdownOption[]) {\n\t\tif (Array.isArray(option)) {\n\t\t\tsetSelectedOption([...option]);\n\t\t} else {\n\t\t\tsetSelectedOption([...[option]]);\n\t\t}\n\t\tonSelect?.(option);\n\t}\n\n\tuseEffect(() => {\n\t\tconst flatSelectedOption: SingleOption[] = [];\n\t\topenDropdownProps?.options?.forEach((option) => {\n\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\t(option as GroupedOption).options.forEach((op) => {\n\t\t\t\t\tif (op.selected) {\n\t\t\t\t\t\tflatSelectedOption.push({\n\t\t\t\t\t\t\t...op,\n\t\t\t\t\t\t\tlabel: op.label,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif ((option as SingleOption).selected) {\n\t\t\t\t\tflatSelectedOption.push(option as SingleOption);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tsetSelectedOption([...flatSelectedOption]);\n\t}, [openDropdownProps.options]);\n\n\tuseEffect(() => {\n\t\tif (defaultOptions) {\n\t\t\tsetSelectedOption([...defaultOptions]);\n\t\t}\n\t}, [defaultOptions]);\n\n\tconst textVal = getSelectedOptionsAsText(selectedOption);\n\tconst displayText = showPlaceholderWhenSelected\n\t\t? placeHolder\n\t\t: textVal ?? placeHolder ?? 'Select an option';\n\n\tconst configuredMaxWidth = openDropdownProps.buttonWidth;\n\n\t// Shared width for the input wrapper and dropdown popover\n\tconst inputWidth = configuredMaxWidth ?? openDropdownProps.width ?? '100%';\n\n\t// Width passed to dropdown popover — matches input box width\n\tconst dropdownWidth = openDropdownProps.dropdownWidth ?? inputWidth;\n\n\treturn (\n\t\t<>\n\t\t\t<InputStyleContext.Provider\n\t\t\t\tvalue={{\n\t\t\t\t\tInputWrapper: {\n\t\t\t\t\t\theight: placeHolderHeight\n\t\t\t\t\t\t\t? placeHolderHeight\n\t\t\t\t\t\t\t: sizeToUse === 'x-small'\n\t\t\t\t\t\t\t? 24\n\t\t\t\t\t\t\t: sizeToUse === 'small'\n\t\t\t\t\t\t\t? 32\n\t\t\t\t\t\t\t: 48,\n\t\t\t\t\t\twidth: inputWidth,\n\t\t\t\t\t\t...(configuredMaxWidth ? { maxWidth: configuredMaxWidth } : {}),\n\t\t\t\t\t\tzIndex: 1,\n\t\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t\tpadding: sizeToUse === 'x-small' ? '4px 8px' : '6px 8px',\n\t\t\t\t\t\tbackgroundColor:\n\t\t\t\t\t\t\topenDropdownProps.version === '3.0'\n\t\t\t\t\t\t\t\t? isDropdownOpened || isHovering\n\t\t\t\t\t\t\t\t\t? COLORS.surface.hovered\n\t\t\t\t\t\t\t\t\t: COLORS.surface.standard\n\t\t\t\t\t\t\t\t: showSelected && value !== undefined\n\t\t\t\t\t\t\t\t? BASE_COLORS.positive['100']\n\t\t\t\t\t\t\t\t: // The hover wrapper also contains the popover, so while the\n\t\t\t\t\t\t\t\t// dropdown is open, hovering an option would grey the input\n\t\t\t\t\t\t\t\t// — only show hover feedback while closed.\n\t\t\t\t\t\t\t\tisHovering && !isDropdownOpened\n\t\t\t\t\t\t\t\t? COLORS.background.inactive\n\t\t\t\t\t\t\t\t: COLORS.surface.standard,\n\t\t\t\t\t\ttransition: 'background-color 0.3s ease',\n\t\t\t\t\t\t...inputStyle,\n\t\t\t\t\t},\n\t\t\t\t\tinput: {\n\t\t\t\t\t\tminHeight: '100%',\n\t\t\t\t\t\tmaxWidth: '100%',\n\t\t\t\t\t\tcolor:\n\t\t\t\t\t\t\tshowSelected && value !== undefined\n\t\t\t\t\t\t\t\t? COLORS.content.positive\n\t\t\t\t\t\t\t\t: 'inherit',\n\t\t\t\t\t},\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tonMouseEnter={() => setIsHovering(true)}\n\t\t\t\t\tonMouseLeave={() => setIsHovering(false)}\n\t\t\t\t\tstyle={\n\t\t\t\t\t\topenDropdownProps.width\n\t\t\t\t\t\t\t? { width: openDropdownProps.width }\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<DropdownPopover\n\t\t\t\t\t\tdata-test={openDropdownProps['data-test']}\n\t\t\t\t\t\tref={\n\t\t\t\t\t\t\tdropdownVisibilityRef as Ref<{\n\t\t\t\t\t\t\t\topenDropdown: boolean;\n\t\t\t\t\t\t\t}>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonSelect={handleSelection}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t{...openDropdownProps}\n\t\t\t\t\t\tonDropdownVisbilityChange={(isOpen) => {\n\t\t\t\t\t\t\t// Keep the internal open flag (carat/open styling) AND forward\n\t\t\t\t\t\t\t// to a consumer-provided handler so callers can react to open state.\n\t\t\t\t\t\t\tsetDropdownOpenFlag(isOpen);\n\t\t\t\t\t\t\tonDropdownVisbilityChange?.(isOpen);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\twidth={dropdownWidth}\n\t\t\t\t\t>\n\t\t\t\t\t\t{inputType == 'default' && (\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tversion={openDropdownProps.version}\n\t\t\t\t\t\t\t\tnoErrorHint={noErrorHint}\n\t\t\t\t\t\t\t\tstate={disabled ? 'disabled' : 'none'}\n\t\t\t\t\t\t\t\tvalue={value === undefined ? displayText : value}\n\t\t\t\t\t\t\t\terrorMessage={openDropdownProps.error}\n\t\t\t\t\t\t\t\tvariant={sizeToUse}\n\t\t\t\t\t\t\t\tplaceholder={placeHolder ?? 'Select an option'}\n\t\t\t\t\t\t\t\tonChangeText={noop}\n\t\t\t\t\t\t\t\tleftIcon={\n\t\t\t\t\t\t\t\t\tshowLeadingIconInPlaceholder && selectedOption[0]?.leadingIcon\n\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\ticon: () => <>{selectedOption[0]?.leadingIcon}</>,\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\trightIcon={{\n\t\t\t\t\t\t\t\t\ticon: () => (\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\tdisplay: 'flex',\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\t\t{showTrailingIconPlaceholder &&\n\t\t\t\t\t\t\t\t\t\t\t\t(selectedOption[0] as SingleOption)?.trailingIcon}\n\t\t\t\t\t\t\t\t\t\t\t<DownIcon\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\t\ttransform: isDropdownOpened\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'rotate(180deg)'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 'rotate(0deg)',\n\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={noop}\n\t\t\t\t\t\t\t\t\t\t\t\twidth={\n\t\t\t\t\t\t\t\t\t\t\t\t\tsizeToUse === 'x-small'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 16\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: sizeToUse === 'small'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 20\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 24\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\theight={\n\t\t\t\t\t\t\t\t\t\t\t\t\tsizeToUse === 'x-small'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 16\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: sizeToUse === 'small'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 20\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 24\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\t\t\t\t\t\t\tshowSelected\n\t\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\t\t: COLORS.content.primary\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</div>\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\ttruncateText={truncatedText ?? true}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{inputType == 'chip' && (\n\t\t\t\t\t\t\t<ChipInput\n\t\t\t\t\t\t\t\tplaceholder={placeHolder ?? 'Select options'}\n\t\t\t\t\t\t\t\tchips={selectedOption as SingleOption[]}\n\t\t\t\t\t\t\t\tonDeleteChip={(chip) => {\n\t\t\t\t\t\t\t\t\tonDeleteChip?.(chip);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\terrorMessage={openDropdownProps.error}\n\t\t\t\t\t\t\t\tisDropdownOpened={isDropdownOpened}\n\t\t\t\t\t\t\t\tsizeToUse={sizeToUse}\n\t\t\t\t\t\t\t\tcontainerStyle={{\n\t\t\t\t\t\t\t\t\twidth: openDropdownProps.width ?? '100%',\n\t\t\t\t\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tshowLabelsOnMoreHover={showLabelsOnMoreHover}\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</InputStyleContext.Provider>\n\t\t</>\n\t);\n};\n\nDropdown.displayName = 'Dropdown';\n"],"names":["noop","Dropdown","placeHolder","size","onSelect","defaultOptions","disabled","noErrorHint","placeHolderHeight","showPlaceholderWhenSelected","inputStyle","inputType","onDeleteChip","truncatedText","showLeadingIconInPlaceholder","showTrailingIconPlaceholder","showLabelsOnMoreHover","value","showSelected","onDropdownVisbilityChange","openDropdownProps","isDropdownOpened","setDropdownOpenFlag","useState","isHovering","setIsHovering","sizeToUse","dropdownVisibilityRef","useRef","selectedOption","setSelectedOption","handleSelection","option","useEffect","flatSelectedOption","op","textVal","getSelectedOptionsAsText","displayText","configuredMaxWidth","inputWidth","dropdownWidth","jsx","Fragment","InputStyleContext","COLORS","BASE_COLORS","jsxs","DropdownPopover","isOpen","Input","DownIcon","ChipInput","chip"],"mappings":";;;;;;;;;AAsCA,SAASA,IAAO;AAEhB;AAEO,MAAMC,IAAoC,CAAC;AAAA,EACjD,aAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,6BAAAC,IAA8B;AAAA,EAC9B,YAAAC,IAAa,CAAA;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ACU;AAAA,kBAAA;AAAA,oBACA,aAAalD,KAAe;AAAA,oBAC5B,OAAO2B;AAAA,oBACP,cAAc,CAACwB,MAAS;AACvB,sBAAAzC,IAAeyC,CAAI;AAAA,oBACpB;AAAA,oBACA,cAAcjC,EAAkB;AAAA,oBAChC,kBAAAC;AAAA,oBACA,WAAAK;AAAA,oBACA,gBAAgB;AAAA,sBACf,OAAON,EAAkB,SAAS;AAAA,sBAClC,QAAQ;AAAA,oBAAA;AAAA,oBAET,uBAAAJ;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACD;AAAA,YAAA;AAAA,UAAA;AAAA,QAEF;AAAA,MAAA;AAAA,IACD;AAAA,EAAA,GAEF;AAEF;AAEAf,EAAS,cAAc;"}
1
+ {"version":3,"file":"Dropdown.js","sources":["../../../../src/components/dropdown/Dropdown.tsx"],"sourcesContent":["import React, { Ref, useEffect, useRef, useState } from 'react';\nimport { BASE_COLORS, COLORS } from '@src/constants/Theme';\nimport DownIcon from '../../assets/icons/chevronDown.svg';\nimport { Input } from '../input';\nimport { InputStyleContext } from '../input/context/InputStyleProvider';\nimport ChipInput from './ChipInput';\nimport { DropdownPopover } from './DropdownPopover';\nimport { getSelectedOptionsAsText } from './OpenedDropdown/utils/iterationOnOptions';\nimport {\n\tDropdownOption,\n\tGroupedOption,\n\tOpenDropdownProps,\n\tSingleOption,\n} from './type';\n\nexport type DropdownProps = OpenDropdownProps & {\n\tplaceHolder?: string;\n\tsize?: 'default' | 'small' | 'x-small';\n\tdisabled?: boolean;\n\tnoErrorHint?: boolean;\n\tbuttonWidth?: string;\n\tplaceHolderHeight?: string;\n\tshowPlaceholderWhenSelected?: boolean;\n\tinputStyle?: React.CSSProperties;\n\tinputType?: 'chip' | 'default';\n\tonDeleteChip?: (chip: SingleOption) => void;\n\ttruncatedText?: boolean;\n\t'data-test'?: string;\n\tshowLeadingIconInPlaceholder?: boolean;\n\tshowTrailingIconPlaceholder?: boolean;\n\tshowLabelsOnMoreHover?: boolean;\n\tbackgroundColor?: string;\n\tvalue?: string;\n\tshowSelected?: boolean;\n\t/** Fired when the dropdown opens/closes. Runs alongside internal open state. */\n\tonDropdownVisbilityChange?: (isOpen: boolean) => void;\n};\n\nfunction noop() {\n\t/** empty */\n}\n\nexport const Dropdown: React.FC<DropdownProps> = ({\n\tplaceHolder,\n\tsize,\n\tonSelect,\n\tdefaultOptions,\n\tdisabled,\n\tnoErrorHint,\n\tplaceHolderHeight,\n\tshowPlaceholderWhenSelected = false,\n\tinputStyle = {},\n\tinputType = 'default',\n\tonDeleteChip,\n\ttruncatedText,\n\tshowLeadingIconInPlaceholder = false,\n\tshowTrailingIconPlaceholder = false,\n\tshowLabelsOnMoreHover = false,\n\tvalue,\n\tshowSelected = false,\n\tonDropdownVisbilityChange,\n\t...openDropdownProps\n}) => {\n\tconst [isDropdownOpened, setDropdownOpenFlag] = useState(false);\n\tconst [isHovering, setIsHovering] = useState(false);\n\tconst sizeToUse = size ?? 'default';\n\tconst dropdownVisibilityRef = useRef<{\n\t\topenDropdown: boolean;\n\t}>();\n\tconst [selectedOption, setSelectedOption] = useState<DropdownOption[]>(\n\t\tdefaultOptions ?? [],\n\t);\n\tfunction handleSelection(option: DropdownOption | DropdownOption[]) {\n\t\tif (Array.isArray(option)) {\n\t\t\tsetSelectedOption([...option]);\n\t\t} else {\n\t\t\tsetSelectedOption([...[option]]);\n\t\t}\n\t\tonSelect?.(option);\n\t}\n\n\tuseEffect(() => {\n\t\tconst flatSelectedOption: SingleOption[] = [];\n\t\topenDropdownProps?.options?.forEach((option) => {\n\t\t\tif ((option as GroupedOption).options) {\n\t\t\t\t(option as GroupedOption).options.forEach((op) => {\n\t\t\t\t\tif (op.selected) {\n\t\t\t\t\t\tflatSelectedOption.push({\n\t\t\t\t\t\t\t...op,\n\t\t\t\t\t\t\tlabel: op.label,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif ((option as SingleOption).selected) {\n\t\t\t\t\tflatSelectedOption.push(option as SingleOption);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tsetSelectedOption([...flatSelectedOption]);\n\t}, [openDropdownProps.options]);\n\n\tuseEffect(() => {\n\t\tif (defaultOptions) {\n\t\t\tsetSelectedOption([...defaultOptions]);\n\t\t}\n\t}, [defaultOptions]);\n\n\tconst textVal = getSelectedOptionsAsText(selectedOption);\n\tconst displayText = showPlaceholderWhenSelected\n\t\t? placeHolder\n\t\t: textVal ?? placeHolder ?? 'Select an option';\n\n\tconst configuredMaxWidth = openDropdownProps.buttonWidth;\n\n\t// Shared width for the input wrapper and dropdown popover\n\tconst inputWidth = configuredMaxWidth ?? openDropdownProps.width ?? '100%';\n\n\t// Width passed to dropdown popover — matches input box width\n\tconst dropdownWidth = openDropdownProps.dropdownWidth ?? inputWidth;\n\n\treturn (\n\t\t<>\n\t\t\t<InputStyleContext.Provider\n\t\t\t\tvalue={{\n\t\t\t\t\tInputWrapper: {\n\t\t\t\t\t\theight: placeHolderHeight\n\t\t\t\t\t\t\t? placeHolderHeight\n\t\t\t\t\t\t\t: sizeToUse === 'x-small'\n\t\t\t\t\t\t\t? 24\n\t\t\t\t\t\t\t: sizeToUse === 'small'\n\t\t\t\t\t\t\t? 32\n\t\t\t\t\t\t\t: 48,\n\t\t\t\t\t\twidth: inputWidth,\n\t\t\t\t\t\t...(configuredMaxWidth ? { maxWidth: configuredMaxWidth } : {}),\n\t\t\t\t\t\tzIndex: 1,\n\t\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t\tpadding: sizeToUse === 'x-small' ? '4px 8px' : '6px 8px',\n\t\t\t\t\t\tbackgroundColor:\n\t\t\t\t\t\t\topenDropdownProps.version === '3.0'\n\t\t\t\t\t\t\t\t? isDropdownOpened || isHovering\n\t\t\t\t\t\t\t\t\t? COLORS.surface.hovered\n\t\t\t\t\t\t\t\t\t: COLORS.surface.standard\n\t\t\t\t\t\t\t\t: showSelected && value !== undefined\n\t\t\t\t\t\t\t\t? BASE_COLORS.positive['100']\n\t\t\t\t\t\t\t\t: isHovering\n\t\t\t\t\t\t\t\t? COLORS.background.inactive\n\t\t\t\t\t\t\t\t: COLORS.surface.standard,\n\t\t\t\t\t\ttransition: 'background-color 0.3s ease',\n\t\t\t\t\t\t...inputStyle,\n\t\t\t\t\t},\n\t\t\t\t\tinput: {\n\t\t\t\t\t\tminHeight: '100%',\n\t\t\t\t\t\tmaxWidth: '100%',\n\t\t\t\t\t\tcolor:\n\t\t\t\t\t\t\tshowSelected && value !== undefined\n\t\t\t\t\t\t\t\t? COLORS.content.positive\n\t\t\t\t\t\t\t\t: 'inherit',\n\t\t\t\t\t},\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tonMouseEnter={() => setIsHovering(true)}\n\t\t\t\t\tonMouseLeave={() => setIsHovering(false)}\n\t\t\t\t\tstyle={\n\t\t\t\t\t\topenDropdownProps.width\n\t\t\t\t\t\t\t? { width: openDropdownProps.width }\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<DropdownPopover\n\t\t\t\t\t\tdata-test={openDropdownProps['data-test']}\n\t\t\t\t\t\tref={\n\t\t\t\t\t\t\tdropdownVisibilityRef as Ref<{\n\t\t\t\t\t\t\t\topenDropdown: boolean;\n\t\t\t\t\t\t\t}>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonSelect={handleSelection}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t{...openDropdownProps}\n\t\t\t\t\t\tonDropdownVisbilityChange={(isOpen) => {\n\t\t\t\t\t\t\t// Keep the internal open flag (carat/open styling) AND forward\n\t\t\t\t\t\t\t// to a consumer-provided handler so callers can react to open state.\n\t\t\t\t\t\t\tsetDropdownOpenFlag(isOpen);\n\t\t\t\t\t\t\tonDropdownVisbilityChange?.(isOpen);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\twidth={dropdownWidth}\n\t\t\t\t\t>\n\t\t\t\t\t\t{inputType == 'default' && (\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tversion={openDropdownProps.version}\n\t\t\t\t\t\t\t\tnoErrorHint={noErrorHint}\n\t\t\t\t\t\t\t\tstate={disabled ? 'disabled' : 'none'}\n\t\t\t\t\t\t\t\tvalue={value === undefined ? displayText : value}\n\t\t\t\t\t\t\t\terrorMessage={openDropdownProps.error}\n\t\t\t\t\t\t\t\tvariant={sizeToUse}\n\t\t\t\t\t\t\t\tplaceholder={placeHolder ?? 'Select an option'}\n\t\t\t\t\t\t\t\tonChangeText={noop}\n\t\t\t\t\t\t\t\tleftIcon={\n\t\t\t\t\t\t\t\t\tshowLeadingIconInPlaceholder && selectedOption[0]?.leadingIcon\n\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\ticon: () => <>{selectedOption[0]?.leadingIcon}</>,\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\trightIcon={{\n\t\t\t\t\t\t\t\t\ticon: () => (\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\tdisplay: 'flex',\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\t\t{showTrailingIconPlaceholder &&\n\t\t\t\t\t\t\t\t\t\t\t\t(selectedOption[0] as SingleOption)?.trailingIcon}\n\t\t\t\t\t\t\t\t\t\t\t<DownIcon\n\t\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\t\ttransform: isDropdownOpened\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'rotate(180deg)'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 'rotate(0deg)',\n\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={noop}\n\t\t\t\t\t\t\t\t\t\t\t\twidth={\n\t\t\t\t\t\t\t\t\t\t\t\t\tsizeToUse === 'x-small'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 16\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: sizeToUse === 'small'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 20\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 24\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\theight={\n\t\t\t\t\t\t\t\t\t\t\t\t\tsizeToUse === 'x-small'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 16\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: sizeToUse === 'small'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 20\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 24\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tcolor={\n\t\t\t\t\t\t\t\t\t\t\t\t\tshowSelected\n\t\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\t\t: COLORS.content.primary\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</div>\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\ttruncateText={truncatedText ?? true}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{inputType == 'chip' && (\n\t\t\t\t\t\t\t<ChipInput\n\t\t\t\t\t\t\t\tplaceholder={placeHolder ?? 'Select options'}\n\t\t\t\t\t\t\t\tchips={selectedOption as SingleOption[]}\n\t\t\t\t\t\t\t\tonDeleteChip={(chip) => {\n\t\t\t\t\t\t\t\t\tonDeleteChip?.(chip);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\terrorMessage={openDropdownProps.error}\n\t\t\t\t\t\t\t\tisDropdownOpened={isDropdownOpened}\n\t\t\t\t\t\t\t\tsizeToUse={sizeToUse}\n\t\t\t\t\t\t\t\tcontainerStyle={{\n\t\t\t\t\t\t\t\t\twidth: openDropdownProps.width ?? '100%',\n\t\t\t\t\t\t\t\t\tcursor: 'pointer',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tshowLabelsOnMoreHover={showLabelsOnMoreHover}\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</InputStyleContext.Provider>\n\t\t</>\n\t);\n};\n\nDropdown.displayName = 'Dropdown';\n"],"names":["noop","Dropdown","placeHolder","size","onSelect","defaultOptions","disabled","noErrorHint","placeHolderHeight","showPlaceholderWhenSelected","inputStyle","inputType","onDeleteChip","truncatedText","showLeadingIconInPlaceholder","showTrailingIconPlaceholder","showLabelsOnMoreHover","value","showSelected","onDropdownVisbilityChange","openDropdownProps","isDropdownOpened","setDropdownOpenFlag","useState","isHovering","setIsHovering","sizeToUse","dropdownVisibilityRef","useRef","selectedOption","setSelectedOption","handleSelection","option","useEffect","flatSelectedOption","op","textVal","getSelectedOptionsAsText","displayText","configuredMaxWidth","inputWidth","dropdownWidth","jsx","Fragment","InputStyleContext","COLORS","BASE_COLORS","jsxs","DropdownPopover","isOpen","Input","DownIcon","ChipInput","chip"],"mappings":";;;;;;;;;AAsCA,SAASA,IAAO;AAEhB;AAEO,MAAMC,IAAoC,CAAC;AAAA,EACjD,aAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,6BAAAC,IAA8B;AAAA,EAC9B,YAAAC,IAAa,CAAA;AAAA,EACb,WAAAC,IAAY;AAAA,EACZ,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AAc,CAACwB,MAAS;AACvB,sBAAAzC,IAAeyC,CAAI;AAAA,oBACpB;AAAA,oBACA,cAAcjC,EAAkB;AAAA,oBAChC,kBAAAC;AAAA,oBACA,WAAAK;AAAA,oBACA,gBAAgB;AAAA,sBACf,OAAON,EAAkB,SAAS;AAAA,sBAClC,QAAQ;AAAA,oBAAA;AAAA,oBAET,uBAAAJ;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACD;AAAA,YAAA;AAAA,UAAA;AAAA,QAEF;AAAA,MAAA;AAAA,IACD;AAAA,EAAA,GAEF;AAEF;AAEAf,EAAS,cAAc;"}
@@ -1,10 +1,10 @@
1
1
  import { jsx as t, jsxs as s } from "react/jsx-runtime";
2
- import { DropdownPopover as a } from "../dropdown/DropdownPopover/index.js";
2
+ import { DropdownPopover as u } from "../dropdown/DropdownPopover/index.js";
3
3
  import { SpinnerColorMap as p } from "../button/themes.js";
4
- import { DropdownButtonStyle as u, LoaderContainer as m } from "./DropdownButton.style.js";
4
+ import { DropdownButtonStyle as a, LoaderContainer as m } from "./DropdownButton.style.js";
5
5
  import { IconButton as l } from "../icon-button/IconButton.js";
6
- import { Tooltip as x } from "../tooltips/Tooltip.js";
7
- import { Spinner as y } from "../spinner/Spinner.js";
6
+ import { Tooltip as y } from "../tooltips/Tooltip.js";
7
+ import { Spinner as x } from "../spinner/Spinner.js";
8
8
  import { Button as b } from "../button/Button.js";
9
9
  const S = (o) => {
10
10
  const e = !!o.iconButtonProps, r = e ? o.iconButtonProps?.disabled : o.buttonProps?.disabled;
@@ -21,7 +21,7 @@ const S = (o) => {
21
21
  }
22
22
  );
23
23
  return /* @__PURE__ */ s(
24
- u,
24
+ a,
25
25
  {
26
26
  type: void 0,
27
27
  disabled: r,
@@ -30,7 +30,7 @@ const S = (o) => {
30
30
  iconButtonSize: n?.size ?? "default",
31
31
  children: [
32
32
  i ? /* @__PURE__ */ t(
33
- x,
33
+ y,
34
34
  {
35
35
  body: i.body,
36
36
  tooltipContent: i.tooltipContent,
@@ -39,7 +39,7 @@ const S = (o) => {
39
39
  }
40
40
  ) : d,
41
41
  /* @__PURE__ */ t("div", { className: "dd-button-divider" }),
42
- /* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ t(a, { ...o.dropdownProps, isChildLoading: !1, children: /* @__PURE__ */ t(
42
+ /* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ t(u, { ...o.dropdownProps, isChildLoading: !1, children: /* @__PURE__ */ t(
43
43
  l,
44
44
  {
45
45
  Icon: o.iconProps,
@@ -63,18 +63,18 @@ const S = (o) => {
63
63
  LeadingIcon: B,
64
64
  LeadingIconStyles: f,
65
65
  IconComponent: R,
66
- TrailingIcon: h,
66
+ TrailingIcon: g,
67
67
  ...c
68
68
  } = o.buttonProps;
69
69
  return /* @__PURE__ */ s(
70
- u,
70
+ a,
71
71
  {
72
72
  type: o.buttonProps.buttonType,
73
73
  disabled: o.buttonProps.disabled,
74
74
  size: o.buttonProps.size,
75
75
  children: [
76
76
  o.buttonProps?.isLoading && /* @__PURE__ */ t(m, { type: o.buttonProps.buttonType, children: /* @__PURE__ */ t(
77
- y,
77
+ x,
78
78
  {
79
79
  className: "spinner",
80
80
  size: "small",
@@ -94,13 +94,13 @@ const S = (o) => {
94
94
  borderTopLeftRadius: "4px",
95
95
  borderBottomLeftRadius: "4px",
96
96
  borderRight: "0px",
97
- ...o.buttonProps?.size === "xs" ? { border: "none", boxShadow: "none", borderRadius: "0px" } : {}
97
+ ...o.buttonProps?.size === "xs" ? { border: "none", borderRadius: "0px" } : {}
98
98
  }
99
99
  }
100
100
  ),
101
101
  /* @__PURE__ */ t("div", { className: "dd-button-divider" }),
102
102
  /* @__PURE__ */ t(
103
- a,
103
+ u,
104
104
  {
105
105
  ...o.dropdownProps,
106
106
  isChildLoading: o.buttonProps?.isLoading,
@@ -115,7 +115,7 @@ const S = (o) => {
115
115
  borderRadius: "0px",
116
116
  borderTopRightRadius: "4px",
117
117
  borderBottomRightRadius: "4px",
118
- ...o.buttonProps?.size === "xs" ? { border: "none", boxShadow: "none", borderRadius: "0px" } : {}
118
+ ...o.buttonProps?.size === "xs" ? { border: "none", borderRadius: "0px" } : {}
119
119
  }
120
120
  }
121
121
  )
@@ -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', 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":";;;;;;;;AA2BO,MAAMA,IAAgD,CAACC,MAAU;AACvE,QAAMC,IAAa,CAAC,CAACD,EAAM,iBACrBE,IAAWD,IACdD,EAAM,iBAAiB,WACvBA,EAAM,aAAa;AAEtB,MAAIC,GAAY;AACf,UAAM,EAAE,iBAAAE,GAAiB,mBAAAC,EAAA,IAAsBJ,GACzCK,IACL,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,GAAGJ;AAAA,QACJ,OAAO;AAAA,UACN,cAAc;AAAA,UACd,qBAAqB;AAAA,UACrB,wBAAwB;AAAA,QAAA;AAAA,MACzB;AAAA,IAAA;AAGF,WACC,gBAAAK;AAAA,MAACC;AAAA,MAAA;AAAA,QACA,MAAM;AAAA,QACN,UAAAP;AAAA,QACA,cAAY;AAAA,QACZ,gBAAgBC,GAAiB,kBAAkB;AAAA,QACnD,gBAAgBA,GAAiB,QAAQ;AAAA,QAExC,UAAA;AAAA,UAAAC,IACA,gBAAAE;AAAA,YAACI;AAAA,YAAA;AAAA,cACA,MAAMN,EAAkB;AAAA,cACxB,gBAAgBA,EAAkB;AAAA,cAClC,WAAWA,EAAkB;AAAA,cAE5B,UAAAC;AAAA,YAAA;AAAA,UAAA,IAGFA;AAAA,UAED,gBAAAC,EAAC,OAAA,EAAI,WAAU,oBAAA,CAAoB;AAAA,UACnC,gBAAAA,EAAC,OAAA,EAAI,OAAO,EAAE,SAAS,QAAQ,YAAY,SAAA,GAC1C,4BAACK,GAAA,EAAiB,GAAGX,EAAM,eAAe,gBAAgB,IACzD,UAAA,gBAAAM;AAAA,YAACC;AAA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AI,WAAU,oBAAA,CAAoB;AAAA,QACnC,gBAAAA;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,GAAGX,EAAM;AAAA,YACV,gBAAgBA,EAAM,aAAa;AAAA,YAEnC,UAAA,gBAAAM;AAAA,cAACe;AAAA,cAAA;AAAA,gBACC,GAAGJ;AAAA,gBACJ,WAAW;AAAA,gBACX,YAAY;AAAA,gBACZ,cAAcjB,EAAM;AAAA,gBACpB,OAAO;AAAA,kBACN,cAAc;AAAA,kBACd,sBAAsB;AAAA,kBACtB,yBAAyB;AAAA,kBACzB,GAAIA,EAAM,aAAa,SAAS,OAC7B,EAAE,QAAQ,QAAQ,WAAW,QAAQ,cAAc,MAAA,IACnD,CAAA;AAAA,gBAAC;AAAA,cACL;AAAA,YAAA;AAAA,UACD;AAAA,QAAA;AAAA,MACD;AAAA,IAAA;AAAA,EAAA;AAGH;"}
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":";;;;;;;;AA2BO,MAAMA,IAAgD,CAACC,MAAU;AACvE,QAAMC,IAAa,CAAC,CAACD,EAAM,iBACrBE,IAAWD,IACdD,EAAM,iBAAiB,WACvBA,EAAM,aAAa;AAEtB,MAAIC,GAAY;AACf,UAAM,EAAE,iBAAAE,GAAiB,mBAAAC,EAAA,IAAsBJ,GACzCK,IACL,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,GAAGJ;AAAA,QACJ,OAAO;AAAA,UACN,cAAc;AAAA,UACd,qBAAqB;AAAA,UACrB,wBAAwB;AAAA,QAAA;AAAA,MACzB;AAAA,IAAA;AAGF,WACC,gBAAAK;AAAA,MAACC;AAAA,MAAA;AAAA,QACA,MAAM;AAAA,QACN,UAAAP;AAAA,QACA,cAAY;AAAA,QACZ,gBAAgBC,GAAiB,kBAAkB;AAAA,QACnD,gBAAgBA,GAAiB,QAAQ;AAAA,QAExC,UAAA;AAAA,UAAAC,IACA,gBAAAE;AAAA,YAACI;AAAA,YAAA;AAAA,cACA,MAAMN,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GD,gBAAAM;AAAA,UAACe;AAAA,UAAA;AAAA,YACC,GAAGrB,EAAM;AAAA,YACV,WAAW;AAAA,YACX,OAAO;AAAA,cACN,cAAc;AAAA,cACd,qBAAqB;AAAA,cACrB,wBAAwB;AAAA,cACxB,aAAa;AAAA,cACb,GAAIA,EAAM,aAAa,SAAS,OAC7B,EAAE,QAAQ,QAAQ,cAAc,UAChC,CAAA;AAAA,YAAC;AAAA,UACL;AAAA,QAAA;AAAA,QAED,gBAAAM,EAAC,OAAA,EAAI,WAAU,oBAAA,CAAoB;AAAA,QACnC,gBAAAA;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,GAAGX,EAAM;AAAA,YACV,gBAAgBA,EAAM,aAAa;AAAA,YAEnC,UAAA,gBAAAM;AAAA,cAACe;AAAA,cAAA;AAAA,gBACC,GAAGJ;AAAA,gBACJ,WAAW;AAAA,gBACX,YAAY;AAAA,gBACZ,cAAcjB,EAAM;AAAA,gBACpB,OAAO;AAAA,kBACN,cAAc;AAAA,kBACd,sBAAsB;AAAA,kBACtB,yBAAyB;AAAA,kBACzB,GAAIA,EAAM,aAAa,SAAS,OAC7B,EAAE,QAAQ,QAAQ,cAAc,UAChC,CAAA;AAAA,gBAAC;AAAA,cACL;AAAA,YAAA;AAAA,UACD;AAAA,QAAA;AAAA,MACD;AAAA,IAAA;AAAA,EAAA;AAGH;"}
@@ -12,15 +12,15 @@ import { Tooltip as qe } from "../tooltips/Tooltip.js";
12
12
  const Ge = Ee(
13
13
  (e, ae) => {
14
14
  const {
15
- placeholder: H,
16
- leftIcon: _,
17
- rightIcon: y,
18
- labelText: T,
15
+ placeholder: E,
16
+ leftIcon: H,
17
+ rightIcon: _,
18
+ labelText: y,
19
19
  maxCharLimit: l,
20
20
  isRequired: k,
21
21
  hintText: A,
22
22
  type: c,
23
- state: b,
23
+ state: T,
24
24
  validate: oe,
25
25
  variant: o,
26
26
  button: h,
@@ -35,8 +35,8 @@ const Ge = Ee(
35
35
  version: ue,
36
36
  noMaxCharCheck: O,
37
37
  labelElement: P,
38
- autoGrow: M,
39
- minHeight: S,
38
+ autoGrow: b,
39
+ minHeight: M,
40
40
  maxHeight: de,
41
41
  labelTextBold: fe,
42
42
  truncateText: me,
@@ -60,9 +60,9 @@ const Ge = Ee(
60
60
  minCharsToTrigger: 0,
61
61
  maxCharAlignment: !1,
62
62
  ...e
63
- }, X = _?.icon, U = y?.icon, [p, I] = v(!1), [be, w] = v(!1), [u, j] = v(), q = o === "x-small" ? "12px" : o === "small" ? "18px" : "22px", C = He(Oe), [G, L] = v(""), Me = _e(null), r = ae ?? Me;
63
+ }, X = H?.icon, U = _?.icon, [S, I] = v(!1), [be, p] = v(!1), [u, j] = v(), q = o === "x-small" ? "12px" : o === "small" ? "18px" : "22px", C = He(Oe), [G, w] = v(""), Me = _e(null), r = ae ?? Me;
64
64
  d(() => {
65
- L(m || ""), !m && M && (r.current.style.height = S || "48px");
65
+ w(m || ""), !m && b && (r.current.style.height = M || "48px");
66
66
  }, [m]), d(() => {
67
67
  r.current && e.onReferenceInit?.(r.current);
68
68
  }, [r]), d(() => {
@@ -72,9 +72,9 @@ const Ge = Ee(
72
72
  t.removeEventListener("wheel", J);
73
73
  };
74
74
  }, []), d(() => {
75
- D && L("");
75
+ D && w("");
76
76
  }, [D]), d(() => {
77
- w(!!e.isActive), e.isActive && r.current?.focus();
77
+ p(!!e.isActive), e.isActive && r.current?.focus();
78
78
  }, [e.isActive]), d(() => {
79
79
  j(e.errorMessage);
80
80
  }, [e.errorMessage]), d(() => {
@@ -92,9 +92,9 @@ const Ge = Ee(
92
92
  }, Q = (t) => {
93
93
  let i = t.target.value;
94
94
  const g = l !== 0 ? l + 1 : Y(), x = V;
95
- if (!ye && ke(c) && (i = Ae(i)), !O && g > 0 && i.length >= g && (i = i.substring(0, g - 1)), e.textControl || L(i || ""), x && i && i.length < x)
95
+ if (!ye && ke(c) && (i = Ae(i)), !O && g > 0 && i.length >= g && (i = i.substring(0, g - 1)), e.textControl || w(i || ""), x && i && i.length < x)
96
96
  return;
97
- B(i, t), M && (r.current.style.height = `${r.current.scrollHeight}px`, i || (r.current.style.height = S || "48px"));
97
+ B(i, t), b && (r.current.style.height = `${r.current.scrollHeight}px`, i || (r.current.style.height = M || "48px"));
98
98
  const s = oe || Re;
99
99
  if (!s || !te(s))
100
100
  return;
@@ -105,10 +105,10 @@ const Ge = Ee(
105
105
  );
106
106
  I(!Se), j(e.errorMessage ? e.errorMessage : pe);
107
107
  }, Z = (t) => {
108
- e.skipFocus || w(!0), f(e.onFocus?.(t));
108
+ e.skipFocus || p(!0), f(e.onFocus?.(t));
109
109
  }, ee = (t) => {
110
- e.skipFocus || w(!1), f(e.onBlur?.(t));
111
- }, E = () => /* @__PURE__ */ a(we, { children: [
110
+ e.skipFocus || p(!1), f(e.onBlur?.(t));
111
+ }, L = () => /* @__PURE__ */ a(we, { children: [
112
112
  c !== "multiline" && /* @__PURE__ */ n(
113
113
  "input",
114
114
  {
@@ -122,7 +122,7 @@ const Ge = Ee(
122
122
  value: G,
123
123
  onFocus: (t) => Z(t),
124
124
  onBlur: (t) => ee(t),
125
- placeholder: H || "Enter here",
125
+ placeholder: E || "Enter here",
126
126
  onChange: Q,
127
127
  onClick: (t) => f(e.onClick),
128
128
  onKeyDown: (t) => $(t)
@@ -138,7 +138,7 @@ const Ge = Ee(
138
138
  onBlur: (t) => ee(t),
139
139
  onClick: (t) => f(e.onClick),
140
140
  disabled: W,
141
- placeholder: H || "Enter here",
141
+ placeholder: E || "Enter here",
142
142
  onChange: Q,
143
143
  onKeyDown: (t) => $(t),
144
144
  maxLength: l > 0 ? l : void 0
@@ -150,7 +150,7 @@ const Ge = Ee(
150
150
  {
151
151
  width: e.width,
152
152
  height: e.height,
153
- state: b,
153
+ state: T,
154
154
  type: c,
155
155
  style: C?.RootContainer ?? {},
156
156
  children: [
@@ -169,10 +169,10 @@ const Ge = Ee(
169
169
  Ke,
170
170
  {
171
171
  variant: o,
172
- state: b,
172
+ state: T,
173
173
  width: e.width,
174
- isActive: b === "active" || be,
175
- isInvalid: p,
174
+ isActive: T === "active" || be,
175
+ isInvalid: S,
176
176
  style: C?.InputWrapper ?? Ce ?? {},
177
177
  version: ue,
178
178
  height: e.height,
@@ -184,7 +184,7 @@ const Ge = Ee(
184
184
  {
185
185
  variant: o,
186
186
  iconSize: q,
187
- onClick: () => f(_?.callback),
187
+ onClick: () => f(H?.callback),
188
188
  isLeft: !0,
189
189
  style: {
190
190
  ...C?.IconHolder ?? {},
@@ -199,22 +199,21 @@ const Ge = Ee(
199
199
  {
200
200
  height: e.height,
201
201
  type: e.type,
202
- minHeight: S,
202
+ minHeight: M,
203
203
  maxHeight: de,
204
- autoGrow: M,
205
- children: E()
204
+ autoGrow: b,
205
+ children: L()
206
206
  }
207
207
  ),
208
- o === "small" && /* @__PURE__ */ n(We, { height: e.height, type: e.type, children: E() }),
209
- o === "x-small" && /* @__PURE__ */ n(Xe, { height: e.height, type: e.type, children: E() }),
208
+ o === "small" && /* @__PURE__ */ n(We, { height: e.height, type: e.type, children: L() }),
209
+ o === "x-small" && /* @__PURE__ */ n(Xe, { height: e.height, type: e.type, children: L() }),
210
210
  !!U && /* @__PURE__ */ n(
211
211
  re,
212
212
  {
213
213
  variant: o,
214
214
  iconSize: q,
215
- onClick: () => f(y?.callback),
215
+ onClick: () => f(_?.callback),
216
216
  isLeft: !1,
217
- "data-test": y?.["data-test"],
218
217
  children: /* @__PURE__ */ n(U, {})
219
218
  }
220
219
  ),
@@ -231,19 +230,19 @@ const Ge = Ee(
231
230
  ]
232
231
  }
233
232
  ),
234
- !xe && (!!T || !!l) && /* @__PURE__ */ a(
233
+ !xe && (!!y || !!l) && /* @__PURE__ */ a(
235
234
  je,
236
235
  {
237
- invalid: p,
236
+ invalid: S,
238
237
  maxCharAlignment: ve,
239
238
  children: [
240
239
  P && P,
241
240
  /* @__PURE__ */ a("div", { className: "label__container", children: [
242
241
  fe ? /* @__PURE__ */ a(Fe, { children: [
243
- T,
242
+ y,
244
243
  k ? /* @__PURE__ */ n("span", { children: "*" }) : ""
245
244
  ] }) : /* @__PURE__ */ a(Be, { children: [
246
- T,
245
+ y,
247
246
  k ? /* @__PURE__ */ n("span", { children: "*" }) : ""
248
247
  ] }),
249
248
  e.tooltipText && /* @__PURE__ */ n(qe, { body: e.tooltipText, placement: "top", children: /* @__PURE__ */ n("span", { children: /* @__PURE__ */ n(
@@ -252,7 +251,7 @@ const Ge = Ee(
252
251
  style: { marginTop: -3 },
253
252
  width: 18,
254
253
  height: 18,
255
- color: p ? ne.content.negative : ne.content.primary
254
+ color: S ? ne.content.negative : ne.content.primary
256
255
  }
257
256
  ) }) })
258
257
  ] }),
@@ -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\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":";;;;;;;;;;;AA0BO,MAAMA,KAAQC;AAAA,EACpB,CACCC,GACAC,OACI;AACJ,UAAM;AAAA,MACL,aAAAC;AAAA,MACA,UAAAC;AAAA,MACA,WAAAC;AAAA,MACA,WAAAC;AAAA,MACA,cAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,MAAAC;AAAA,MACA,OAAAC;AAAA,MACA,UAAAC;AAAA,MACA,SAAAC;AAAA,MACA,QAAAC;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,OAAAC;AAAA,MACA,aAAAC;AAAA,MACA,OAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,SAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,WAAAC;AAAA,MACA,WAAAC;AAAA,MACA,eAAAC;AAAA,MACA,cAAAC;AAAA,MACA,sBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,sBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,YAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,YAAAC,IAAa;AAAA,MACb,kBAAAC;AAAA,MACA,eAAAC;AAAA,IAAA,IACG;AAAA,MACH,cAAc;AAAA,MACd,MAAM;AAAA,MACN,SAAS;AAAA,MACT,sBAAsB;AAAA,MACtB,mBAAmB;AAAA,MACnB,kBAAkB;AAAA,MAClB,GAAGzC;AAAA,IAAA,GAEE0C,IAAWvC,GAAU,MACrBwC,IAAYvC,GAAW,MACvB,CAACwC,GAAWC,CAAY,IAAIC,EAAkB,EAAK,GACnD,CAACC,IAAUC,CAAW,IAAIF,EAAkB,EAAK,GACjD,CAACG,GAAcC,CAAe,IAAIJ,EAAA,GAClCK,IACLvC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uF,EAAC,QAAA,EACA,UAAA,gBAAAA;AAAA,oBAACiB;AAAAA,oBAAA;AAAA,sBACA,OAAO,EAAE,WAAW,GAAA;AAAA,sBACpB,OAAO;AAAA,sBACP,QAAQ;AAAA,sBACR,OACC5D,IACG6D,GAAO,QAAQ,WACfA,GAAO,QAAQ;AAAA,oBAAA;AAAA,kBAAA,GAGrB,EAAA,CACD;AAAA,gBAAA,GAEF;AAAA,gBACCnG,IAAe,KAAKwB,MAAyB,2BAC5C6D,IAAA,EAAgB,OAAO5D,GACrB,UAAA;AAAA,mBAAAd,KAAS,IAAI,SAAA,GAAY,UAAU;AAAA,kBAAE;AAAA,kBAAEX;AAAA,gBAAA,EAAA,CAC1C;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAEF;AAAA,MAAA;AAAA,IAAA;AAAA,EAIJ;AACD;AAEAR,GAAM,cAAc;"}
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":";;;;;;;;;;;AA0BO,MAAMA,KAAQC;AAAA,EACpB,CACCC,GACAC,OACI;AACJ,UAAM;AAAA,MACL,aAAAC;AAAA,MACA,UAAAC;AAAA,MACA,WAAAC;AAAA,MACA,WAAAC;AAAA,MACA,cAAAC;AAAA,MACA,YAAAC;AAAA,MACA,UAAAC;AAAA,MACA,MAAAC;AAAA,MACA,OAAAC;AAAA,MACA,UAAAC;AAAA,MACA,SAAAC;AAAA,MACA,QAAAC;AAAA,MACA,YAAAC;AAAA,MACA,YAAAC;AAAA,MACA,cAAAC;AAAA,MACA,OAAAC;AAAA,MACA,aAAAC;AAAA,MACA,OAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,SAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,UAAAC;AAAA,MACA,WAAAC;AAAA,MACA,WAAAC;AAAA,MACA,eAAAC;AAAA,MACA,cAAAC;AAAA,MACA,sBAAAC;AAAA,MACA,cAAAC;AAAA,MACA,sBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,YAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,mBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,YAAAC,IAAa;AAAA,MACb,kBAAAC;AAAA,MACA,eAAAC;AAAA,IAAA,IACG;AAAA,MACH,cAAc;AAAA,MACd,MAAM;AAAA,MACN,SAAS;AAAA,MACT,sBAAsB;AAAA,MACtB,mBAAmB;AAAA,MACnB,kBAAkB;AAAA,MAClB,GAAGzC;AAAA,IAAA,GAEE0C,IAAWvC,GAAU,MACrBwC,IAAYvC,GAAW,MACvB,CAACwC,GAAWC,CAAY,IAAIC,EAAkB,EAAK,GACnD,CAACC,IAAUC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,MAAMvG,EAAM,aAAa,WAAW,OAC5C,UAAA,gBAAAuF,EAAC,QAAA,EACA,UAAA,gBAAAA;AAAA,oBAACiB;AAAAA,oBAAA;AAAA,sBACA,OAAO,EAAE,WAAW,GAAA;AAAA,sBACpB,OAAO;AAAA,sBACP,QAAQ;AAAA,sBACR,OACC5D,IACG6D,GAAO,QAAQ,WACfA,GAAO,QAAQ;AAAA,oBAAA;AAAA,kBAAA,GAGrB,EAAA,CACD;AAAA,gBAAA,GAEF;AAAA,gBACCnG,IAAe,KAAKwB,MAAyB,2BAC5C6D,IAAA,EAAgB,OAAO5D,GACrB,UAAA;AAAA,mBAAAd,KAAS,IAAI,SAAA,GAAY,UAAU;AAAA,kBAAE;AAAA,kBAAEX;AAAA,gBAAA,EAAA,CAC1C;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAEF;AAAA,MAAA;AAAA,IAAA;AAAA,EAIJ;AACD;AAEAR,GAAM,cAAc;"}
@@ -17,7 +17,6 @@ export interface InputProps {
17
17
  rightIcon?: {
18
18
  icon: React.FC;
19
19
  callback?: () => void;
20
- 'data-test'?: string;
21
20
  };
22
21
  labelElement?: React.ReactNode;
23
22
  labelText?: string;