@razorpay/blade 12.33.1 → 12.33.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/build/lib/native/components/Accordion/AccordionButton.native.js +1 -1
  2. package/build/lib/native/components/Accordion/AccordionButton.native.js.map +1 -1
  3. package/build/lib/native/components/Accordion/AccordionItemHeader.js +2 -1
  4. package/build/lib/native/components/Accordion/AccordionItemHeader.js.map +1 -1
  5. package/build/lib/native/components/Accordion/commonStyles.js +1 -1
  6. package/build/lib/native/components/Accordion/commonStyles.js.map +1 -1
  7. package/build/lib/native/components/ActionList/ActionListItem.js +1 -1
  8. package/build/lib/native/components/ActionList/ActionListItem.js.map +1 -1
  9. package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js +1 -1
  10. package/build/lib/native/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  11. package/build/lib/native/components/Button/BaseButton/BaseButton.js +1 -1
  12. package/build/lib/native/components/Button/BaseButton/BaseButton.js.map +1 -1
  13. package/build/lib/native/components/Button/BaseButton/buttonTokens.js +1 -1
  14. package/build/lib/native/components/Button/BaseButton/buttonTokens.js.map +1 -1
  15. package/build/lib/native/components/Dropdown/Dropdown.js +1 -1
  16. package/build/lib/native/components/Dropdown/Dropdown.js.map +1 -1
  17. package/build/lib/native/components/Dropdown/DropdownButton.js +1 -1
  18. package/build/lib/native/components/Dropdown/DropdownButton.js.map +1 -1
  19. package/build/lib/native/components/Dropdown/InputDropdownButton.native.js +7 -0
  20. package/build/lib/native/components/Dropdown/InputDropdownButton.native.js.map +1 -0
  21. package/build/lib/native/components/Dropdown/dropdownComponentIds.js +1 -1
  22. package/build/lib/native/components/Dropdown/dropdownComponentIds.js.map +1 -1
  23. package/build/lib/native/components/Dropdown/useDropdown.js.map +1 -1
  24. package/build/lib/native/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js +12 -0
  25. package/build/lib/native/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js.map +1 -0
  26. package/build/lib/native/components/Input/BaseInput/BaseInput.js +1 -1
  27. package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
  28. package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js +1 -1
  29. package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  30. package/build/lib/native/components/Input/BaseInput/baseInputStyles.js +1 -1
  31. package/build/lib/native/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  32. package/build/lib/native/components/Input/BaseInput/baseInputTokens.js +1 -1
  33. package/build/lib/native/components/Input/BaseInput/baseInputTokens.js.map +1 -1
  34. package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +2 -5
  35. package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  36. package/build/lib/native/components/Input/SearchInput/SearchInput.js +12 -3
  37. package/build/lib/native/components/Input/SearchInput/SearchInput.js.map +1 -1
  38. package/build/lib/native/components/Input/TextInput/TextInput.js +11 -3
  39. package/build/lib/native/components/Input/TextInput/TextInput.js.map +1 -1
  40. package/build/lib/native/components/Typography/Text/Text.js +1 -1
  41. package/build/lib/native/components/Typography/Text/Text.js.map +1 -1
  42. package/build/lib/native/components/index.js +2 -0
  43. package/build/lib/native/components/index.js.map +1 -1
  44. package/build/lib/native/utils/useControlledDropdownInput/useControlledDropdownInput.js +14 -0
  45. package/build/lib/native/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -0
  46. package/build/lib/web/development/components/Accordion/AccordionItemHeader.js +18 -2
  47. package/build/lib/web/development/components/Accordion/AccordionItemHeader.js.map +1 -1
  48. package/build/lib/web/development/components/Accordion/StyledAccordionButton.web.js +4 -3
  49. package/build/lib/web/development/components/Accordion/StyledAccordionButton.web.js.map +1 -1
  50. package/build/lib/web/development/components/Accordion/commonStyles.js +1 -11
  51. package/build/lib/web/development/components/Accordion/commonStyles.js.map +1 -1
  52. package/build/lib/web/development/components/ActionList/ActionListItem.js +2 -1
  53. package/build/lib/web/development/components/ActionList/ActionListItem.js.map +1 -1
  54. package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js +6 -3
  55. package/build/lib/web/development/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  56. package/build/lib/web/development/components/Button/BaseButton/BaseButton.js +24 -3
  57. package/build/lib/web/development/components/Button/BaseButton/BaseButton.js.map +1 -1
  58. package/build/lib/web/development/components/Button/BaseButton/StyledBaseButton.web.js +14 -2
  59. package/build/lib/web/development/components/Button/BaseButton/StyledBaseButton.web.js.map +1 -1
  60. package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js +19 -0
  61. package/build/lib/web/development/components/Button/BaseButton/buttonTokens.js.map +1 -1
  62. package/build/lib/web/development/components/Dropdown/Dropdown.js +4 -1
  63. package/build/lib/web/development/components/Dropdown/Dropdown.js.map +1 -1
  64. package/build/lib/web/development/components/Dropdown/DropdownButton.js +4 -1
  65. package/build/lib/web/development/components/Dropdown/DropdownButton.js.map +1 -1
  66. package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js +4 -2
  67. package/build/lib/web/development/components/Dropdown/DropdownOverlay.web.js.map +1 -1
  68. package/build/lib/web/development/components/Dropdown/InputDropdownButton.web.js +180 -0
  69. package/build/lib/web/development/components/Dropdown/InputDropdownButton.web.js.map +1 -0
  70. package/build/lib/web/development/components/Dropdown/dropdownComponentIds.js +2 -1
  71. package/build/lib/web/development/components/Dropdown/dropdownComponentIds.js.map +1 -1
  72. package/build/lib/web/development/components/Dropdown/index.js +1 -0
  73. package/build/lib/web/development/components/Dropdown/index.js.map +1 -1
  74. package/build/lib/web/development/components/Dropdown/useDropdown.js.map +1 -1
  75. package/build/lib/web/development/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js +40 -0
  76. package/build/lib/web/development/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js.map +1 -0
  77. package/build/lib/web/development/components/Icons/ChevronUpDownIcon/index.js +2 -0
  78. package/build/lib/web/development/components/Icons/ChevronUpDownIcon/index.js.map +1 -0
  79. package/build/lib/web/development/components/Icons/index.js +1 -0
  80. package/build/lib/web/development/components/Icons/index.js.map +1 -1
  81. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +10 -4
  82. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
  83. package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js +32 -8
  84. package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  85. package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js +2 -1
  86. package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
  87. package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js +8 -4
  88. package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  89. package/build/lib/web/development/components/Input/BaseInput/baseInputTokens.js +1 -1
  90. package/build/lib/web/development/components/Input/BaseInput/baseInputTokens.js.map +1 -1
  91. package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +25 -124
  92. package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  93. package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js +6 -4
  94. package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
  95. package/build/lib/web/development/components/Input/SearchInput/SearchInput.js +97 -30
  96. package/build/lib/web/development/components/Input/SearchInput/SearchInput.js.map +1 -1
  97. package/build/lib/web/development/components/Input/TextInput/TextInput.js +123 -31
  98. package/build/lib/web/development/components/Input/TextInput/TextInput.js.map +1 -1
  99. package/build/lib/web/development/components/Typography/Text/Text.js +0 -1
  100. package/build/lib/web/development/components/Typography/Text/Text.js.map +1 -1
  101. package/build/lib/web/development/components/index.js +2 -0
  102. package/build/lib/web/development/components/index.js.map +1 -1
  103. package/build/lib/web/development/utils/useControlledDropdownInput/index.js +2 -0
  104. package/build/lib/web/development/utils/useControlledDropdownInput/index.js.map +1 -0
  105. package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js +108 -0
  106. package/build/lib/web/development/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -0
  107. package/build/lib/web/production/components/Accordion/AccordionItemHeader.js +18 -2
  108. package/build/lib/web/production/components/Accordion/AccordionItemHeader.js.map +1 -1
  109. package/build/lib/web/production/components/Accordion/StyledAccordionButton.web.js +4 -3
  110. package/build/lib/web/production/components/Accordion/StyledAccordionButton.web.js.map +1 -1
  111. package/build/lib/web/production/components/Accordion/commonStyles.js +1 -11
  112. package/build/lib/web/production/components/Accordion/commonStyles.js.map +1 -1
  113. package/build/lib/web/production/components/ActionList/ActionListItem.js +2 -1
  114. package/build/lib/web/production/components/ActionList/ActionListItem.js.map +1 -1
  115. package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js +6 -3
  116. package/build/lib/web/production/components/BaseHeaderFooter/BaseHeader.js.map +1 -1
  117. package/build/lib/web/production/components/Button/BaseButton/BaseButton.js +24 -3
  118. package/build/lib/web/production/components/Button/BaseButton/BaseButton.js.map +1 -1
  119. package/build/lib/web/production/components/Button/BaseButton/StyledBaseButton.web.js +14 -2
  120. package/build/lib/web/production/components/Button/BaseButton/StyledBaseButton.web.js.map +1 -1
  121. package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js +19 -0
  122. package/build/lib/web/production/components/Button/BaseButton/buttonTokens.js.map +1 -1
  123. package/build/lib/web/production/components/Dropdown/Dropdown.js +4 -1
  124. package/build/lib/web/production/components/Dropdown/Dropdown.js.map +1 -1
  125. package/build/lib/web/production/components/Dropdown/DropdownButton.js +4 -1
  126. package/build/lib/web/production/components/Dropdown/DropdownButton.js.map +1 -1
  127. package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js +4 -2
  128. package/build/lib/web/production/components/Dropdown/DropdownOverlay.web.js.map +1 -1
  129. package/build/lib/web/production/components/Dropdown/InputDropdownButton.web.js +180 -0
  130. package/build/lib/web/production/components/Dropdown/InputDropdownButton.web.js.map +1 -0
  131. package/build/lib/web/production/components/Dropdown/dropdownComponentIds.js +2 -1
  132. package/build/lib/web/production/components/Dropdown/dropdownComponentIds.js.map +1 -1
  133. package/build/lib/web/production/components/Dropdown/index.js +1 -0
  134. package/build/lib/web/production/components/Dropdown/index.js.map +1 -1
  135. package/build/lib/web/production/components/Dropdown/useDropdown.js.map +1 -1
  136. package/build/lib/web/production/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js +40 -0
  137. package/build/lib/web/production/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.js.map +1 -0
  138. package/build/lib/web/production/components/Icons/ChevronUpDownIcon/index.js +2 -0
  139. package/build/lib/web/production/components/Icons/ChevronUpDownIcon/index.js.map +1 -0
  140. package/build/lib/web/production/components/Icons/index.js +1 -0
  141. package/build/lib/web/production/components/Icons/index.js.map +1 -1
  142. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +10 -4
  143. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
  144. package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js +32 -8
  145. package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  146. package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js +2 -1
  147. package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
  148. package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js +8 -4
  149. package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  150. package/build/lib/web/production/components/Input/BaseInput/baseInputTokens.js +1 -1
  151. package/build/lib/web/production/components/Input/BaseInput/baseInputTokens.js.map +1 -1
  152. package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +25 -124
  153. package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  154. package/build/lib/web/production/components/Input/PhoneNumberInput/CountrySelector.web.js +6 -4
  155. package/build/lib/web/production/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
  156. package/build/lib/web/production/components/Input/SearchInput/SearchInput.js +97 -30
  157. package/build/lib/web/production/components/Input/SearchInput/SearchInput.js.map +1 -1
  158. package/build/lib/web/production/components/Input/TextInput/TextInput.js +123 -31
  159. package/build/lib/web/production/components/Input/TextInput/TextInput.js.map +1 -1
  160. package/build/lib/web/production/components/Typography/Text/Text.js +0 -1
  161. package/build/lib/web/production/components/Typography/Text/Text.js.map +1 -1
  162. package/build/lib/web/production/components/index.js +2 -0
  163. package/build/lib/web/production/components/index.js.map +1 -1
  164. package/build/lib/web/production/utils/useControlledDropdownInput/index.js +2 -0
  165. package/build/lib/web/production/utils/useControlledDropdownInput/index.js.map +1 -0
  166. package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js +108 -0
  167. package/build/lib/web/production/utils/useControlledDropdownInput/useControlledDropdownInput.js.map +1 -0
  168. package/build/types/components/index.d.ts +3098 -3001
  169. package/build/types/components/index.native.d.ts +2719 -2686
  170. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownButton.js","sources":["../../../../../src/components/Dropdown/DropdownButton.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\n\nimport React from 'react';\nimport { useDropdown } from './useDropdown';\nimport { dropdownComponentIds } from './dropdownComponentIds';\nimport BaseButton from '~components/Button/BaseButton';\nimport type { ButtonProps } from '~components/Button';\nimport { getActionListContainerRole } from '~components/ActionList/getA11yRoles';\nimport type { BaseButtonProps } from '~components/Button/BaseButton/BaseButton';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\n\ntype DropdownButtonProps = ButtonProps & {\n onBlur?: BaseButtonProps['onBlur'];\n onKeyDown?: BaseButtonProps['onKeyDown'];\n};\n\nconst _DropdownButton = ({\n children,\n icon,\n iconPosition = 'left',\n isDisabled = false,\n isFullWidth = false,\n isLoading = false,\n onClick,\n onBlur,\n onKeyDown,\n size = 'medium',\n type = 'button',\n variant = 'primary',\n accessibilityLabel,\n testID,\n ...rest\n}: DropdownButtonProps): React.ReactElement => {\n const {\n onTriggerClick,\n onTriggerKeydown,\n dropdownBaseId,\n isOpen,\n activeIndex,\n hasFooterAction,\n triggererRef,\n } = useDropdown();\n\n return (\n // Using BaseButton here to avoid exporting onBlur and onKeyDown from Button\n // If in future we decide to export onBlur and onKeyDown on Button, this can be replaced with Button\n <BaseButton\n {...rest}\n {...(icon ? { icon, children } : { children })}\n iconPosition={iconPosition}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isLoading={isLoading}\n size={size}\n type={type}\n variant={variant}\n testID={testID}\n ref={triggererRef as any}\n accessibilityProps={{\n label: accessibilityLabel,\n hasPopup: getActionListContainerRole(hasFooterAction, 'DropdownButton'),\n expanded: isOpen,\n controls: `${dropdownBaseId}-actionlist`,\n activeDescendant: activeIndex >= 0 ? `${dropdownBaseId}-${activeIndex}` : undefined,\n }}\n onClick={(e) => {\n onTriggerClick();\n // Setting it for web fails it on native typecheck and vice versa\n onClick?.(e as any);\n }}\n onBlur={(e) => {\n // With button trigger, there is no \"value\" as such. It's just clickable items\n // Setting it for web fails it on native typecheck and vice versa\n onBlur?.(e as any);\n }}\n onKeyDown={(e) => {\n onTriggerKeydown?.({ event: e as any });\n // Setting it for web fails it on native typecheck and vice versa\n onKeyDown?.(e as any);\n }}\n />\n );\n};\n\nconst DropdownButton = assignWithoutSideEffects(_DropdownButton, {\n componentId: dropdownComponentIds.triggers.DropdownButton,\n});\n\nexport { DropdownButton };\n"],"names":["_DropdownButton","_ref","children","icon","_ref$iconPosition","iconPosition","_ref$isDisabled","isDisabled","_ref$isFullWidth","isFullWidth","_ref$isLoading","isLoading","onClick","onBlur","onKeyDown","_ref$size","size","_ref$type","type","_ref$variant","variant","accessibilityLabel","testID","rest","_objectWithoutProperties","_excluded","_useDropdown","useDropdown","onTriggerClick","onTriggerKeydown","dropdownBaseId","isOpen","activeIndex","hasFooterAction","triggererRef","_jsx","BaseButton","Object","assign","ref","accessibilityProps","label","hasPopup","getActionListContainerRole","expanded","controls","activeDescendant","undefined","e","event","DropdownButton","assignWithoutSideEffects","componentId","dropdownComponentIds","triggers"],"mappings":";;;;;;;;;6KAiBA,IAAMA,eAAe,CAAG,SAAlBA,eAAeA,CAAAC,IAAA,CAgB0B,CAf7C,IAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRC,IAAI,CAAAF,IAAA,CAAJE,IAAI,CAAAC,iBAAA,CAAAH,IAAA,CACJI,YAAY,CAAZA,YAAY,CAAAD,iBAAA,GAAG,KAAA,CAAA,CAAA,MAAM,CAAAA,iBAAA,CAAAE,eAAA,CAAAL,IAAA,CACrBM,UAAU,CAAVA,UAAU,CAAAD,eAAA,GAAG,KAAA,CAAA,CAAA,KAAK,CAAAA,eAAA,CAAAE,gBAAA,CAAAP,IAAA,CAClBQ,WAAW,CAAXA,WAAW,CAAAD,gBAAA,GAAA,KAAA,CAAA,CAAG,KAAK,CAAAA,gBAAA,CAAAE,cAAA,CAAAT,IAAA,CACnBU,SAAS,CAATA,SAAS,CAAAD,cAAA,GAAA,KAAA,CAAA,CAAG,KAAK,CAAAA,cAAA,CACjBE,QAAO,CAAAX,IAAA,CAAPW,OAAO,CACPC,OAAM,CAAAZ,IAAA,CAANY,MAAM,CACNC,UAAS,CAAAb,IAAA,CAATa,SAAS,CAAAC,SAAA,CAAAd,IAAA,CACTe,IAAI,CAAJA,IAAI,CAAAD,SAAA,UAAG,QAAQ,CAAAA,SAAA,CAAAE,SAAA,CAAAhB,IAAA,CACfiB,IAAI,CAAJA,IAAI,CAAAD,SAAA,GAAG,KAAA,CAAA,CAAA,QAAQ,CAAAA,SAAA,CAAAE,YAAA,CAAAlB,IAAA,CACfmB,OAAO,CAAPA,OAAO,CAAAD,YAAA,GAAG,KAAA,CAAA,CAAA,SAAS,CAAAA,Y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A,OAACoC,CAAAA,CAAC,CAAK,CACdpB,cAAc,EAAE,CAEhBhB,QAAO,EAAA,IAAA,CAAA,KAAA,CAAA,CAAPA,QAAO,CAAGoC,CAAQ,CAAC,CACrB,CAAE,CACFnC,MAAM,CAAE,SAAAA,MAACmC,CAAAA,CAAC,CAAK,CAGbnC,OAAM,EAANA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,OAAM,CAAGmC,CAAQ,CAAC,CACpB,CAAE,CACFlC,SAAS,CAAE,SAAAA,SAAAA,CAACkC,CAAC,CAAK,CAChBnB,gBAAgB,EAAA,IAAA,CAAA,KAAA,CAAA,CAAhBA,gBAAgB,CAAG,CAAEoB,KAAK,CAAED,CAAS,CAAC,CAAC,CAEvClC,UAAS,EAATA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,UAAS,CAAGkC,CAAQ,CAAC,CACvB,CAAE,CACH,CAAA,CAAC,CAEN,CAAC,CAEK,IAAAE,cAAc,CAAGC,wBAAwB,CAACnD,eAAe,CAAE,CAC/DoD,WAAW,CAAEC,oBAAoB,CAACC,QAAQ,CAACJ,cAC7C,CAAC;;;;"}
1
+ {"version":3,"file":"DropdownButton.js","sources":["../../../../../src/components/Dropdown/DropdownButton.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\n\nimport React from 'react';\nimport { useDropdown } from './useDropdown';\nimport { dropdownComponentIds } from './dropdownComponentIds';\nimport BaseButton from '~components/Button/BaseButton';\nimport type { ButtonProps } from '~components/Button';\nimport { getActionListContainerRole } from '~components/ActionList/getA11yRoles';\nimport type { BaseButtonProps } from '~components/Button/BaseButton/BaseButton';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\n\ntype DropdownButtonProps = ButtonProps & {\n onBlur?: BaseButtonProps['onBlur'];\n onKeyDown?: BaseButtonProps['onKeyDown'];\n};\n\nconst _DropdownButton = ({\n children,\n icon,\n iconPosition = 'left',\n isDisabled = false,\n isFullWidth = false,\n isLoading = false,\n onClick,\n onBlur,\n onKeyDown,\n size = 'medium',\n type = 'button',\n variant = 'primary',\n color = 'primary',\n accessibilityLabel,\n testID,\n ...rest\n}: DropdownButtonProps): React.ReactElement => {\n const {\n onTriggerClick,\n onTriggerKeydown,\n dropdownBaseId,\n isOpen,\n activeIndex,\n hasFooterAction,\n triggererRef,\n } = useDropdown();\n\n return (\n // Using BaseButton here to avoid exporting onBlur and onKeyDown from Button\n // If in future we decide to export onBlur and onKeyDown on Button, this can be replaced with Button\n <BaseButton\n {...rest}\n {...(icon ? { icon, children } : { children })}\n iconPosition={iconPosition}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isLoading={isLoading}\n size={size}\n type={type}\n variant={variant}\n testID={testID}\n ref={triggererRef as any}\n color={color}\n accessibilityProps={{\n label: accessibilityLabel,\n hasPopup: getActionListContainerRole(hasFooterAction, 'DropdownButton'),\n expanded: isOpen,\n controls: `${dropdownBaseId}-actionlist`,\n activeDescendant: activeIndex >= 0 ? `${dropdownBaseId}-${activeIndex}` : undefined,\n }}\n onClick={(e) => {\n onTriggerClick();\n // Setting it for web fails it on native typecheck and vice versa\n onClick?.(e as any);\n }}\n onBlur={(e) => {\n // With button trigger, there is no \"value\" as such. It's just clickable items\n // Setting it for web fails it on native typecheck and vice versa\n onBlur?.(e as any);\n }}\n onKeyDown={(e) => {\n onTriggerKeydown?.({ event: e as any });\n // Setting it for web fails it on native typecheck and vice versa\n onKeyDown?.(e as any);\n }}\n />\n );\n};\n\nconst DropdownButton = assignWithoutSideEffects(_DropdownButton, {\n componentId: dropdownComponentIds.triggers.DropdownButton,\n});\n\nexport { DropdownButton };\n"],"names":["_DropdownButton","_ref","children","icon","_ref$iconPosition","iconPosition","_ref$isDisabled","isDisabled","_ref$isFullWidth","isFullWidth","_ref$isLoading","isLoading","onClick","onBlur","onKeyDown","_ref$size","size","_ref$type","type","_ref$variant","variant","_ref$color","color","accessibilityLabel","testID","rest","_objectWithoutProperties","_excluded","_useDropdown","useDropdown","onTriggerClick","onTriggerKeydown","dropdownBaseId","isOpen","activeIndex","hasFooterAction","triggererRef","_jsx","BaseButton","Object","assign","ref","accessibilityProps","label","hasPopup","getActionListContainerRole","expanded","controls","activeDescendant","undefined","e","event","DropdownButton","assignWithoutSideEffects","componentId","dropdownComponentIds","triggers"],"mappings":";;;;;;;;;qLAiBA,IAAMA,eAAe,CAAG,SAAlBA,eAAeA,CAAAC,IAAA,CAiB0B,CAhB7C,IAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CACRC,IAAI,CAAAF,IAAA,CAAJE,IAAI,CAAAC,iBAAA,CAAAH,IAAA,CACJI,YAAY,CAAZA,YAAY,CAAAD,iBAAA,GAAG,KAAA,CAAA,CAAA,MAAM,CAAAA,iBAAA,CAAAE,eAAA,CAAAL,IAAA,CACrBM,UAAU,CAAVA,UAAU,CAAAD,eAAA,GAAG,KAAA,CAAA,CAAA,KAAK,CAAAA,eAAA,CAAAE,gBAAA,CAAAP,IAAA,CAClBQ,WAAW,CAAXA,WAAW,CAAAD,gBAAA,GAAG,KAAA,CAAA,CAAA,KAAK,CAAAA,gBAAA,CAAAE,cAAA,CAAAT,IAAA,CACnBU,SAAS,CAATA,SAAS,CAAAD,cAAA,GAAG,KAAA,CAAA,CAAA,KAAK,CAAAA,cAAA,CACjBE,QAAO,CAAAX,IAAA,CAAPW,OAAO,CACPC,OAAM,CAAAZ,IAAA,CAANY,MAAM,CACNC,UAAS,CAAAb,IAAA,CAATa,SAAS,CAAAC,SAAA,CAAAd,IAAA,CACTe,IAAI,CAAJA,IAAI,CAAAD,SAAA,GAAA,KAAA,CAAA,CAAG,QAAQ,CAAAA,SAAA,CAAAE,SAAA,CAAAhB,IAAA,CACfiB,IAAI,CAAJA,IAAI,CAAAD,SAAA,GAAA,KAAA,CAAA,CAAG,QAAQ,CAAAA,SAAA,CAAAE,YAAA,CAAAlB,IAAA,CACfmB,OAAO,CAAPA,OAAO,C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,CAChBc,QAAQ,CAAG,CAAEf,EAAAA,cAAe,aAAY,CACxCgB,gBAAgB,CAAEd,WAAW,EAAI,CAAC,CAAI,CAAEF,EAAAA,cAAe,CAAGE,CAAAA,EAAAA,WAAY,CAAC,CAAA,CAAGe,SAC5E,CAAE,CACFrC,OAAO,CAAE,SAAAA,OAAAA,CAACsC,CAAC,CAAK,CACdpB,cAAc,EAAE,CAEhBlB,QAAO,EAAPA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,QAAO,CAAGsC,CAAQ,CAAC,CACrB,CAAE,CACFrC,MAAM,CAAE,SAAAA,MAACqC,CAAAA,CAAC,CAAK,CAGbrC,OAAM,EAANA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,OAAM,CAAGqC,CAAQ,CAAC,CACpB,CAAE,CACFpC,SAAS,CAAE,SAAAA,UAACoC,CAAC,CAAK,CAChBnB,gBAAgB,EAAhBA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,gBAAgB,CAAG,CAAEoB,KAAK,CAAED,CAAS,CAAC,CAAC,CAEvCpC,UAAS,EAAA,IAAA,CAAA,KAAA,CAAA,CAATA,UAAS,CAAGoC,CAAQ,CAAC,CACvB,CAAE,CAAA,CACH,CAAC,CAEN,CAAC,CAEK,IAAAE,cAAc,CAAGC,wBAAwB,CAACrD,eAAe,CAAE,CAC/DsD,WAAW,CAAEC,oBAAoB,CAACC,QAAQ,CAACJ,cAC7C,CAAC;;;;"}
@@ -0,0 +1,7 @@
1
+ import { throwBladeError } from '../../utils/logger/logger.js';
2
+ import { jsx, Fragment } from 'react/jsx-runtime';
3
+
4
+ var InputDropdownButton=function InputDropdownButton(_props){throwBladeError({message:'InputDropdownButton is not yet implemented for native',moduleName:'InputDropdownButton'});return jsx(Fragment,{});};
5
+
6
+ export { InputDropdownButton };
7
+ //# sourceMappingURL=InputDropdownButton.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputDropdownButton.native.js","sources":["../../../../../src/components/Dropdown/InputDropdownButton.native.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { throwBladeError } from '~utils/logger';\n\nconst InputDropdownButton = (_props: any): React.ReactElement => {\n throwBladeError({\n message: 'InputDropdownButton is not yet implemented for native',\n moduleName: 'InputDropdownButton',\n });\n\n return <></>;\n};\n\nexport { InputDropdownButton };\n"],"names":["InputDropdownButton","_props","throwBladeError","message","moduleName","_jsx","_Fragment"],"mappings":";;;AAGM,IAAAA,mBAAmB,CAAG,SAAtBA,mBAAmBA,CAAIC,MAAW,CAAyB,CAC/DC,eAAe,CAAC,CACdC,OAAO,CAAE,uDAAuD,CAChEC,UAAU,CAAE,qBACd,CAAC,CAAC,CAEF,OAAOC,GAAA,CAAAC,QAAA,CAAA,EAAI,CAAC,CACd;;;;"}
@@ -1,4 +1,4 @@
1
- var dropdownComponentIds={DropdownOverlay:'DropdownOverlay',Dropdown:'Dropdown',BaseBox:'BaseBox',triggers:{SelectInput:'SelectInput',DropdownButton:'DropdownButton',DropdownLink:'DropdownLink',AutoComplete:'AutoComplete',SearchInput:'SearchInput',DropdownIconButton:'DropdownIconButton',FilterChipSelectInput:'FilterChipSelectInput'}};
1
+ var dropdownComponentIds={DropdownOverlay:'DropdownOverlay',Dropdown:'Dropdown',BaseBox:'BaseBox',triggers:{SelectInput:'SelectInput',DropdownButton:'DropdownButton',DropdownLink:'DropdownLink',AutoComplete:'AutoComplete',SearchInput:'SearchInput',DropdownIconButton:'DropdownIconButton',FilterChipSelectInput:'FilterChipSelectInput',InputDropdownButton:'InputDropdownButton'}};
2
2
 
3
3
  export { dropdownComponentIds };
4
4
  //# sourceMappingURL=dropdownComponentIds.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropdownComponentIds.js","sources":["../../../../../src/components/Dropdown/dropdownComponentIds.ts"],"sourcesContent":["export const dropdownComponentIds = {\n DropdownOverlay: 'DropdownOverlay',\n Dropdown: 'Dropdown',\n BaseBox: 'BaseBox',\n triggers: {\n SelectInput: 'SelectInput',\n DropdownButton: 'DropdownButton',\n DropdownLink: 'DropdownLink',\n AutoComplete: 'AutoComplete',\n SearchInput: 'SearchInput',\n DropdownIconButton: 'DropdownIconButton',\n FilterChipSelectInput: 'FilterChipSelectInput',\n },\n};\n"],"names":["dropdownComponentIds","DropdownOverlay","Dropdown","BaseBox","triggers","SelectInput","DropdownButton","DropdownLink","AutoComplete","SearchInput","DropdownIconButton","FilterChipSelectInput"],"mappings":"AAAa,IAAAA,oBAAoB,CAAG,CAClCC,eAAe,CAAE,iBAAiB,CAClCC,QAAQ,CAAE,UAAU,CACpBC,OAAO,CAAE,SAAS,CAClBC,QAAQ,CAAE,CACRC,WAAW,CAAE,aAAa,CAC1BC,cAAc,CAAE,gBAAgB,CAChCC,YAAY,CAAE,cAAc,CAC5BC,YAAY,CAAE,cAAc,CAC5BC,WAAW,CAAE,aAAa,CAC1BC,kBAAkB,CAAE,oBAAoB,CACxCC,qBAAqB,CAAE,uBACzB,CACF;;;;"}
1
+ {"version":3,"file":"dropdownComponentIds.js","sources":["../../../../../src/components/Dropdown/dropdownComponentIds.ts"],"sourcesContent":["export const dropdownComponentIds = {\n DropdownOverlay: 'DropdownOverlay',\n Dropdown: 'Dropdown',\n BaseBox: 'BaseBox',\n triggers: {\n SelectInput: 'SelectInput',\n DropdownButton: 'DropdownButton',\n DropdownLink: 'DropdownLink',\n AutoComplete: 'AutoComplete',\n SearchInput: 'SearchInput',\n DropdownIconButton: 'DropdownIconButton',\n FilterChipSelectInput: 'FilterChipSelectInput',\n InputDropdownButton: 'InputDropdownButton',\n },\n};\n"],"names":["dropdownComponentIds","DropdownOverlay","Dropdown","BaseBox","triggers","SelectInput","DropdownButton","DropdownLink","AutoComplete","SearchInput","DropdownIconButton","FilterChipSelectInput","InputDropdownButton"],"mappings":"AAAa,IAAAA,oBAAoB,CAAG,CAClCC,eAAe,CAAE,iBAAiB,CAClCC,QAAQ,CAAE,UAAU,CACpBC,OAAO,CAAE,SAAS,CAClBC,QAAQ,CAAE,CACRC,WAAW,CAAE,aAAa,CAC1BC,cAAc,CAAE,gBAAgB,CAChCC,YAAY,CAAE,cAAc,CAC5BC,YAAY,CAAE,cAAc,CAC5BC,WAAW,CAAE,aAAa,CAC1BC,kBAAkB,CAAE,oBAAoB,CACxCC,qBAAqB,CAAE,uBAAuB,CAC9CC,mBAAmB,CAAE,qBACvB,CACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDropdown.js","sources":["../../../../../src/components/Dropdown/useDropdown.ts"],"sourcesContent":["import React from 'react';\n\nimport {\n ensureScrollVisiblity,\n getActionFromKey,\n getIndexByLetter,\n getUpdatedIndex,\n makeInputDisplayValue,\n makeInputValue,\n performAction,\n} from './dropdownUtils';\nimport type { SelectActionsType } from './dropdownUtils';\nimport type { DropdownProps } from './types';\n\nimport { dropdownComponentIds } from './dropdownComponentIds';\nimport type { FormInputHandleOnKeyDownEvent } from '~components/Form/FormTypes';\nimport { isReactNative, isBrowser } from '~utils';\nimport type { ContainerElementType } from '~utils/types';\nimport { fireNativeEvent } from '~utils/fireNativeEvent';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\n\ntype OptionsType = {\n title: string;\n value: string;\n onClickTrigger?: (isSelected: boolean) => void;\n}[];\n\ntype DropdownContextType = {\n isOpen: boolean;\n setIsOpen: (isOpen: boolean) => void;\n close: () => void;\n /**\n * contains the indexes of selected items\n */\n selectedIndices: number[];\n setSelectedIndices: (value: number[]) => void;\n /**\n * contains the indexes of selected items during controlled selection\n */\n controlledValueIndices: number[];\n setControlledValueIndices: (value: number[]) => void;\n /**\n * contains information about all the options inside actionlist\n */\n options: OptionsType;\n setOptions: (value: OptionsType) => void;\n\n /**\n * Filtered values for AutoComplete Inputs\n */\n filteredValues: string[];\n setFilteredValues: (values: string[]) => void;\n\n /** Currently active (focussed) index */\n activeIndex: number;\n setActiveIndex: (value: number) => void;\n\n /** Currently active (focussed) tag */\n activeTagIndex: number;\n setActiveTagIndex: (value: number) => void;\n\n /**\n * Sometimes we want to ignore the blur event to keep dropdown open but not ignore the blur animation from selectinput\n * E.g. When someone clicks on Footer, we just want to ignore the blur event and not the blur animation\n */\n shouldIgnoreBlurAnimation: boolean;\n setShouldIgnoreBlurAnimation: (value: boolean) => void;\n /** Tells you if keyboard was used. Its false by default and turns into true when keydown is called */\n isKeydownPressed: boolean;\n setIsKeydownPressed: (value: boolean) => void;\n /** common baseId which is prepended to multiple other ids inside this dropdown */\n dropdownBaseId: string;\n /** Which element has triggered the dropdown */\n dropdownTriggerer?:\n | 'SelectInput'\n | 'DropdownButton'\n | 'DropdownIconButton'\n | 'AutoComplete'\n | 'DropdownLink'\n | 'SearchInput'\n | 'FilterChipSelectInput';\n\n /** ref of triggerer. Used to call focus in certain places */\n triggererRef: React.MutableRefObject<HTMLButtonElement | null>;\n headerAutoCompleteRef: React.MutableRefObject<HTMLButtonElement | null>;\n triggererWrapperRef: React.MutableRefObject<ContainerElementType | null>;\n actionListItemRef: React.RefObject<HTMLDivElement | null>;\n isTagDismissedRef: React.RefObject<{ value: boolean } | null>;\n visibleTagsCountRef: React.RefObject<{ value: number } | null>;\n\n selectionType?: DropdownProps['selectionType'];\n /** whether footer has an action item.\n * certain a11y behaviour changes happen here\n * E.g. tabbing moves focus to that action instead of outside\n */\n hasFooterAction: boolean;\n setHasFooterAction: (value: boolean) => void;\n\n /**\n * Apart from dropdownTriggerer prop, we also set this boolean because in BottomSheetHeader and DropdownHeader, the trigger can be Select but they can also have autocomplete inside of header\n */\n hasAutoCompleteInHeader: boolean;\n setHasAutoCompleteInHeader: (value: boolean) => void;\n\n /**\n * A value that can be used in dependency array to know when Dropdown value is changed.\n *\n * E.g.\n * ```ts\n * useEffect(() => {\n * console.log('Uncontrolled value change');\n * }, [changeCallbackTriggerer])\n * ```\n */\n changeCallbackTriggerer: number;\n setChangeCallbackTriggerer: (changeCallbackTriggerer: number) => void;\n\n /**\n * true when SelectInput has `value` prop (when it is controlled)\n */\n isControlled: boolean;\n setIsControlled: (isControlled: boolean) => void;\n};\n\nconst DropdownContext = React.createContext<DropdownContextType>({\n isOpen: false,\n setIsOpen: noop,\n close: noop,\n selectedIndices: [],\n setSelectedIndices: noop,\n controlledValueIndices: [],\n setControlledValueIndices: noop,\n options: [],\n setOptions: noop,\n filteredValues: [],\n setFilteredValues: noop,\n activeIndex: -1,\n setActiveIndex: noop,\n activeTagIndex: -1,\n setActiveTagIndex: noop,\n shouldIgnoreBlurAnimation: false,\n setShouldIgnoreBlurAnimation: noop,\n hasFooterAction: false,\n setHasFooterAction: noop,\n hasAutoCompleteInHeader: false,\n setHasAutoCompleteInHeader: noop,\n isKeydownPressed: false,\n setIsKeydownPressed: noop,\n changeCallbackTriggerer: 0,\n setChangeCallbackTriggerer: noop,\n isControlled: false,\n setIsControlled: noop,\n dropdownBaseId: '',\n actionListItemRef: {\n current: null,\n },\n triggererRef: {\n current: null,\n },\n headerAutoCompleteRef: {\n current: null,\n },\n isTagDismissedRef: {\n current: null,\n },\n visibleTagsCountRef: {\n current: null,\n },\n triggererWrapperRef: {\n current: null,\n },\n});\n\nlet searchTimeout: number;\nlet searchString = '';\n\ntype UseDropdownReturnValue = DropdownContextType & {\n /**\n * Click event on combobox. Toggles the dropdown\n */\n onTriggerClick: () => void;\n\n /**\n * Keydown event of combobox. Handles most of the keyboard accessibility of dropdown\n */\n onTriggerKeydown: FormInputHandleOnKeyDownEvent | undefined;\n\n /**\n * Handles the click even on option.\n *\n * Contains the logic that selects the option, moves the focus, etc\n */\n onOptionClick: (\n e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>,\n index: number,\n ) => void;\n\n /**\n * Removes the option with given optionsIndex\n */\n removeOption: (index: number) => void;\n\n /**\n * value that is used during form submissions\n */\n value: string;\n /**\n * This is the value that is displayed inside select after selection\n */\n displayValue: string;\n};\n\n/**\n * Handles almost all the functionality of dropdown.\n *\n * Returns the values from DropdownContext along with some helper functions and event handlers\n *\n */\nconst useDropdown = (): UseDropdownReturnValue => {\n const {\n isOpen,\n setIsOpen,\n close,\n selectedIndices,\n setSelectedIndices,\n activeIndex,\n setActiveIndex,\n activeTagIndex,\n setActiveTagIndex,\n visibleTagsCountRef,\n isKeydownPressed,\n setIsKeydownPressed,\n options,\n selectionType,\n changeCallbackTriggerer,\n setChangeCallbackTriggerer,\n isControlled,\n setControlledValueIndices,\n filteredValues,\n dropdownTriggerer,\n ...rest\n } = React.useContext(DropdownContext);\n\n type SelectOptionType = (\n index: number,\n properties?: {\n closeOnSelection?: boolean;\n },\n ) => boolean;\n\n const setIndices = (indices: number[]): void => {\n if (isControlled) {\n setControlledValueIndices(indices);\n } else {\n setSelectedIndices(indices);\n }\n };\n\n const removeOption = (index: number): void => {\n // remove existing item\n const existingItemIndex = selectedIndices.indexOf(index);\n if (existingItemIndex < 0) {\n return;\n }\n\n setIndices([\n ...selectedIndices.slice(0, existingItemIndex),\n ...selectedIndices.slice(existingItemIndex + 1),\n ]);\n };\n\n /**\n * Marks the given index as selected.\n *\n * In single select, it also closes the menu.\n * In multiselect, it keeps the menu open for more selections\n */\n const selectOption: SelectOptionType = (\n index,\n properties = {\n closeOnSelection: true,\n },\n ) => {\n let isSelected = false;\n\n if (index < 0 || index > options.length - 1) {\n return isSelected;\n }\n\n if (selectionType === 'multiple') {\n if (selectedIndices.includes(index)) {\n removeOption(index);\n isSelected = false;\n } else {\n setIndices([...selectedIndices, index]);\n isSelected = true;\n }\n } else {\n setIndices([index]);\n isSelected = true;\n }\n\n // Triggers `onChange` on SelectInput\n setChangeCallbackTriggerer(changeCallbackTriggerer + 1);\n\n if (activeIndex !== index) {\n setActiveIndex(index);\n }\n\n if (properties?.closeOnSelection && selectionType !== 'multiple') {\n close();\n }\n\n return isSelected;\n };\n\n /**\n * Click listener for combobox (or any triggerer of the dropdown)\n */\n const onTriggerClick = (): void => {\n if (isOpen) {\n close();\n } else {\n setIsOpen(true);\n }\n };\n\n /**\n * Function that we call when we want to move focus from one option to other\n */\n const onOptionChange = (actionType: SelectActionsType, index?: number): void => {\n setActiveTagIndex(-1);\n const newIndex = index ?? activeIndex;\n let updatedIndex: number;\n const hasAutoComplete =\n rest.hasAutoCompleteInHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n if (hasAutoComplete && filteredValues.length > 0) {\n // When its autocomplete, we don't loop over all options. We only loop on filtered options\n\n const filteredIndexes = filteredValues\n .map((filteredValue) => options.findIndex((option) => option.value === filteredValue))\n .sort((a, b) => a - b);\n\n updatedIndex =\n filteredIndexes[\n getUpdatedIndex({\n currentIndex: filteredIndexes.indexOf(newIndex),\n maxIndex: filteredIndexes.length - 1,\n actionType,\n })\n ];\n } else {\n updatedIndex = getUpdatedIndex({\n currentIndex: newIndex,\n maxIndex: options.length - 1,\n actionType,\n });\n }\n setActiveIndex(updatedIndex);\n\n const optionValues = options.map((option) => option.value);\n ensureScrollVisiblity(updatedIndex, rest.actionListItemRef.current, optionValues);\n if (isBrowser()) {\n fireNativeEvent(rest.actionListItemRef as React.RefObject<HTMLElement>, ['change', 'input']);\n }\n };\n\n /**\n * Click handler when user clicks on any particular option.\n *\n * It\n * - changes the option focus\n * - selects that option\n * - moves focus to combobox\n */\n const onOptionClick = (\n e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>,\n index: number,\n ): void => {\n setIsKeydownPressed(false);\n const actionType = getActionFromKey(e, isOpen, dropdownTriggerer);\n if (typeof actionType === 'number') {\n onOptionChange(actionType, index);\n }\n selectOption(index);\n\n if (!isReactNative()) {\n if (rest.hasAutoCompleteInHeader) {\n // move focus to autocomplete\n rest.headerAutoCompleteRef.current?.focus();\n } else {\n rest.triggererRef.current?.focus();\n }\n }\n };\n\n /**\n * Function we call to handle the typeahead.\n *\n * It takes a letter, stores that letter in searchString (and clears it after timeout) to maintain a word\n *\n * Then searches for that word in options and moves focus there.\n */\n const onComboType = (letter: string, actionType: SelectActionsType): void => {\n // open the listbox if it is closed\n setIsOpen(true);\n\n if (\n rest.hasAutoCompleteInHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete\n ) {\n return;\n }\n\n if (typeof searchTimeout === 'number') {\n window.clearTimeout(searchTimeout);\n }\n\n searchTimeout = window.setTimeout(() => {\n searchString = '';\n }, 500);\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n searchString = searchString + letter;\n const optionTitles = options.map((option) => option.title);\n const searchIndex = getIndexByLetter(optionTitles, searchString, activeIndex + 1);\n\n // if a match was found, go to it\n if (searchIndex >= 0) {\n onOptionChange(actionType, searchIndex);\n }\n // if no matches, clear the timeout and search string\n else {\n window.clearTimeout(searchTimeout);\n searchString = '';\n }\n };\n\n /**\n * Keydown event of combobox. Handles most of the keyboard accessibility of dropdown\n */\n const onTriggerKeydown = (e: {\n event: React.KeyboardEvent<HTMLInputElement | HTMLButtonElement>;\n }): void => {\n if (!isKeydownPressed && ![' ', 'Enter', 'Escape', 'Meta'].includes(e.event.key)) {\n // When keydown is not already pressed and its not Enter, Space, Command, or Escape key (those are generic keys and we only want to handle arrow keys or home buttons etc)\n setIsKeydownPressed(true);\n }\n\n const actionType = getActionFromKey(e.event, isOpen, dropdownTriggerer);\n\n if (actionType) {\n performAction(actionType, e, {\n setIsOpen,\n close,\n onOptionChange,\n onComboType,\n selectCurrentOption: () => {\n if (activeIndex < 0) {\n return;\n }\n\n const isSelected = selectOption(activeIndex);\n if (rest.hasFooterAction && !isReactNative()) {\n rest.triggererRef.current?.focus();\n }\n\n options[activeIndex].onClickTrigger?.(isSelected);\n },\n });\n }\n };\n\n return {\n isOpen,\n setIsOpen,\n close,\n selectedIndices,\n setSelectedIndices,\n filteredValues,\n removeOption,\n setControlledValueIndices,\n onTriggerClick,\n onTriggerKeydown,\n onOptionClick,\n activeIndex,\n setActiveIndex,\n activeTagIndex,\n setActiveTagIndex,\n visibleTagsCountRef,\n isKeydownPressed,\n setIsKeydownPressed,\n changeCallbackTriggerer,\n setChangeCallbackTriggerer,\n isControlled,\n options,\n value: makeInputValue(selectedIndices, options),\n displayValue: makeInputDisplayValue(selectedIndices, options),\n selectionType,\n dropdownTriggerer,\n ...rest,\n };\n};\n\nexport type { DropdownContextType, OptionsType };\nexport { useDropdown, DropdownContext };\n"],"names":["noop","DropdownContext","React","createContext","isOpen","setIsOpen","close","selectedIndices","setSelectedIndices","controlledValueIndices","setControlledValueIndices","options","setOptions","filteredValues","setFilteredValues","activeIndex","setActiveIndex","activeTagIndex","setActiveTagIndex","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","hasFooterAction","setHasFooterAction","hasAutoCompleteInHeader","setHasAutoCompleteInHeader","isKeydownPressed","setIsKeydownPressed","changeCallbackTriggerer","setChangeCallbackTriggerer","isControlled","setIsControlled","dropdownBaseId","actionListItemRef","current","triggererRef","headerAutoCompleteRef","isTagDismissedRef","visibleTagsCountRef","triggererWrapperRef","searchTimeout","searchString","useDropdown","_React$useContext","useContext","selectionType","dropdownTriggerer","rest","_objectWithoutProperties","_excluded","setIndices","indices","removeOption","index","existingItemIndex","indexOf","concat","_toConsumableArray","slice","selectOption","properties","arguments","length","undefined","closeOnSelection","isSelected","includes","onTriggerClick","onOptionChange","actionType","newIndex","updatedIndex","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","filteredIndexes","map","filteredValue","findIndex","option","value","sort","a","b","getUpdatedIndex","currentIndex","maxIndex","optionValues","ensureScrollVisiblity","isBrowser","fireNativeEvent","onOptionClick","e","getActionFromKey","isReactNative","_rest$headerAutoCompl","focus","_rest$triggererRef$cu","onComboType","letter","window","clearTimeout","setTimeout","optionTitles","title","searchIndex","getIndexByLetter","onTriggerKeydown","event","key","performAction","selectCurrentOption","_options$activeIndex$","_options$activeIndex","_rest$triggererRef$cu2","onClickTrigger","call","Object","assign","makeInputValue","displayValue","makeInputDisplayValue"],"mappings":";;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,QAAA,CAAA,WAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,oBAAA,CA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C,YAAY,CAAZA,YAAY,CACZzC,yBAAyB,CAAzBA,yBAAyB,CACzBwD,cAAc,CAAdA,cAAc,CACdyC,gBAAgB,CAAhBA,gBAAgB,CAChBhB,aAAa,CAAbA,aAAa,CACb5E,WAAW,CAAXA,WAAW,CACXC,cAAc,CAAdA,cAAc,CACdC,cAAc,CAAdA,cAAc,CACdC,iBAAiB,CAAjBA,iBAAiB,CACjBmB,mBAAmB,CAAnBA,mBAAmB,CACnBZ,gBAAgB,CAAhBA,gBAAgB,CAChBC,mBAAmB,CAAnBA,mBAAmB,CACnBC,uBAAuB,CAAvBA,uBAAuB,CACvBC,0BAA0B,CAA1BA,0BAA0B,CAC1BC,YAAY,CAAZA,YAAY,CACZlB,OAAO,CAAPA,OAAO,CACPqE,KAAK,CAAEuC,cAAc,CAAChH,eAAe,CAAEI,OAAO,CAAC,CAC/C6G,YAAY,CAAEC,qBAAqB,CAAClH,eAAe,CAAEI,OAAO,CAAC,CAC7DiC,aAAa,CAAbA,aAAa,CACbC,iBAAiB,CAAjBA,iBAAiB,CAAA,CACdC,IAAI,CAEX,CAAA;;;;"}
1
+ {"version":3,"file":"useDropdown.js","sources":["../../../../../src/components/Dropdown/useDropdown.ts"],"sourcesContent":["import React from 'react';\n\nimport {\n ensureScrollVisiblity,\n getActionFromKey,\n getIndexByLetter,\n getUpdatedIndex,\n makeInputDisplayValue,\n makeInputValue,\n performAction,\n} from './dropdownUtils';\nimport type { SelectActionsType } from './dropdownUtils';\nimport type { DropdownProps } from './types';\n\nimport { dropdownComponentIds } from './dropdownComponentIds';\nimport type { FormInputHandleOnKeyDownEvent } from '~components/Form/FormTypes';\nimport { isReactNative, isBrowser } from '~utils';\nimport type { ContainerElementType } from '~utils/types';\nimport { fireNativeEvent } from '~utils/fireNativeEvent';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = (): void => {};\n\ntype OptionsType = {\n title: string;\n value: string;\n onClickTrigger?: (isSelected: boolean) => void;\n}[];\n\ntype DropdownContextType = {\n isOpen: boolean;\n setIsOpen: (isOpen: boolean) => void;\n close: () => void;\n /**\n * contains the indexes of selected items\n */\n selectedIndices: number[];\n setSelectedIndices: (value: number[]) => void;\n /**\n * contains the indexes of selected items during controlled selection\n */\n controlledValueIndices: number[];\n setControlledValueIndices: (value: number[]) => void;\n /**\n * contains information about all the options inside actionlist\n */\n options: OptionsType;\n setOptions: (value: OptionsType) => void;\n\n /**\n * Filtered values for AutoComplete Inputs\n */\n filteredValues: string[];\n setFilteredValues: (values: string[]) => void;\n\n /** Currently active (focussed) index */\n activeIndex: number;\n setActiveIndex: (value: number) => void;\n\n /** Currently active (focussed) tag */\n activeTagIndex: number;\n setActiveTagIndex: (value: number) => void;\n\n /**\n * Sometimes we want to ignore the blur event to keep dropdown open but not ignore the blur animation from selectinput\n * E.g. When someone clicks on Footer, we just want to ignore the blur event and not the blur animation\n */\n shouldIgnoreBlurAnimation: boolean;\n setShouldIgnoreBlurAnimation: (value: boolean) => void;\n /** Tells you if keyboard was used. Its false by default and turns into true when keydown is called */\n isKeydownPressed: boolean;\n setIsKeydownPressed: (value: boolean) => void;\n /** common baseId which is prepended to multiple other ids inside this dropdown */\n dropdownBaseId: string;\n /** Which element has triggered the dropdown */\n dropdownTriggerer?:\n | 'SelectInput'\n | 'DropdownButton'\n | 'DropdownIconButton'\n | 'AutoComplete'\n | 'DropdownLink'\n | 'SearchInput'\n | 'FilterChipSelectInput'\n | 'InputDropdownButton';\n\n /** ref of triggerer. Used to call focus in certain places */\n triggererRef: React.MutableRefObject<HTMLButtonElement | null>;\n headerAutoCompleteRef: React.MutableRefObject<HTMLButtonElement | null>;\n triggererWrapperRef: React.MutableRefObject<ContainerElementType | null>;\n actionListItemRef: React.RefObject<HTMLDivElement | null>;\n isTagDismissedRef: React.RefObject<{ value: boolean } | null>;\n visibleTagsCountRef: React.RefObject<{ value: number } | null>;\n\n selectionType?: DropdownProps['selectionType'];\n /** whether footer has an action item.\n * certain a11y behaviour changes happen here\n * E.g. tabbing moves focus to that action instead of outside\n */\n hasFooterAction: boolean;\n setHasFooterAction: (value: boolean) => void;\n\n /**\n * Apart from dropdownTriggerer prop, we also set this boolean because in BottomSheetHeader and DropdownHeader, the trigger can be Select but they can also have autocomplete inside of header\n */\n hasAutoCompleteInHeader: boolean;\n setHasAutoCompleteInHeader: (value: boolean) => void;\n\n /**\n * A value that can be used in dependency array to know when Dropdown value is changed.\n *\n * E.g.\n * ```ts\n * useEffect(() => {\n * console.log('Uncontrolled value change');\n * }, [changeCallbackTriggerer])\n * ```\n */\n changeCallbackTriggerer: number;\n setChangeCallbackTriggerer: (changeCallbackTriggerer: number) => void;\n\n /**\n * true when SelectInput has `value` prop (when it is controlled)\n */\n isControlled: boolean;\n setIsControlled: (isControlled: boolean) => void;\n};\n\nconst DropdownContext = React.createContext<DropdownContextType>({\n isOpen: false,\n setIsOpen: noop,\n close: noop,\n selectedIndices: [],\n setSelectedIndices: noop,\n controlledValueIndices: [],\n setControlledValueIndices: noop,\n options: [],\n setOptions: noop,\n filteredValues: [],\n setFilteredValues: noop,\n activeIndex: -1,\n setActiveIndex: noop,\n activeTagIndex: -1,\n setActiveTagIndex: noop,\n shouldIgnoreBlurAnimation: false,\n setShouldIgnoreBlurAnimation: noop,\n hasFooterAction: false,\n setHasFooterAction: noop,\n hasAutoCompleteInHeader: false,\n setHasAutoCompleteInHeader: noop,\n isKeydownPressed: false,\n setIsKeydownPressed: noop,\n changeCallbackTriggerer: 0,\n setChangeCallbackTriggerer: noop,\n isControlled: false,\n setIsControlled: noop,\n dropdownBaseId: '',\n actionListItemRef: {\n current: null,\n },\n triggererRef: {\n current: null,\n },\n headerAutoCompleteRef: {\n current: null,\n },\n isTagDismissedRef: {\n current: null,\n },\n visibleTagsCountRef: {\n current: null,\n },\n triggererWrapperRef: {\n current: null,\n },\n});\n\nlet searchTimeout: number;\nlet searchString = '';\n\ntype UseDropdownReturnValue = DropdownContextType & {\n /**\n * Click event on combobox. Toggles the dropdown\n */\n onTriggerClick: () => void;\n\n /**\n * Keydown event of combobox. Handles most of the keyboard accessibility of dropdown\n */\n onTriggerKeydown: FormInputHandleOnKeyDownEvent | undefined;\n\n /**\n * Handles the click even on option.\n *\n * Contains the logic that selects the option, moves the focus, etc\n */\n onOptionClick: (\n e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>,\n index: number,\n ) => void;\n\n /**\n * Removes the option with given optionsIndex\n */\n removeOption: (index: number) => void;\n\n /**\n * value that is used during form submissions\n */\n value: string;\n /**\n * This is the value that is displayed inside select after selection\n */\n displayValue: string;\n};\n\n/**\n * Handles almost all the functionality of dropdown.\n *\n * Returns the values from DropdownContext along with some helper functions and event handlers\n *\n */\nconst useDropdown = (): UseDropdownReturnValue => {\n const {\n isOpen,\n setIsOpen,\n close,\n selectedIndices,\n setSelectedIndices,\n activeIndex,\n setActiveIndex,\n activeTagIndex,\n setActiveTagIndex,\n visibleTagsCountRef,\n isKeydownPressed,\n setIsKeydownPressed,\n options,\n selectionType,\n changeCallbackTriggerer,\n setChangeCallbackTriggerer,\n isControlled,\n setControlledValueIndices,\n filteredValues,\n dropdownTriggerer,\n ...rest\n } = React.useContext(DropdownContext);\n\n type SelectOptionType = (\n index: number,\n properties?: {\n closeOnSelection?: boolean;\n },\n ) => boolean;\n\n const setIndices = (indices: number[]): void => {\n if (isControlled) {\n setControlledValueIndices(indices);\n } else {\n setSelectedIndices(indices);\n }\n };\n\n const removeOption = (index: number): void => {\n // remove existing item\n const existingItemIndex = selectedIndices.indexOf(index);\n if (existingItemIndex < 0) {\n return;\n }\n\n setIndices([\n ...selectedIndices.slice(0, existingItemIndex),\n ...selectedIndices.slice(existingItemIndex + 1),\n ]);\n };\n\n /**\n * Marks the given index as selected.\n *\n * In single select, it also closes the menu.\n * In multiselect, it keeps the menu open for more selections\n */\n const selectOption: SelectOptionType = (\n index,\n properties = {\n closeOnSelection: true,\n },\n ) => {\n let isSelected = false;\n\n if (index < 0 || index > options.length - 1) {\n return isSelected;\n }\n\n if (selectionType === 'multiple') {\n if (selectedIndices.includes(index)) {\n removeOption(index);\n isSelected = false;\n } else {\n setIndices([...selectedIndices, index]);\n isSelected = true;\n }\n } else {\n setIndices([index]);\n isSelected = true;\n }\n\n // Triggers `onChange` on SelectInput\n setChangeCallbackTriggerer(changeCallbackTriggerer + 1);\n\n if (activeIndex !== index) {\n setActiveIndex(index);\n }\n\n if (properties?.closeOnSelection && selectionType !== 'multiple') {\n close();\n }\n\n return isSelected;\n };\n\n /**\n * Click listener for combobox (or any triggerer of the dropdown)\n */\n const onTriggerClick = (): void => {\n if (isOpen) {\n close();\n } else {\n setIsOpen(true);\n }\n };\n\n /**\n * Function that we call when we want to move focus from one option to other\n */\n const onOptionChange = (actionType: SelectActionsType, index?: number): void => {\n setActiveTagIndex(-1);\n const newIndex = index ?? activeIndex;\n let updatedIndex: number;\n const hasAutoComplete =\n rest.hasAutoCompleteInHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete;\n if (hasAutoComplete && filteredValues.length > 0) {\n // When its autocomplete, we don't loop over all options. We only loop on filtered options\n\n const filteredIndexes = filteredValues\n .map((filteredValue) => options.findIndex((option) => option.value === filteredValue))\n .sort((a, b) => a - b);\n\n updatedIndex =\n filteredIndexes[\n getUpdatedIndex({\n currentIndex: filteredIndexes.indexOf(newIndex),\n maxIndex: filteredIndexes.length - 1,\n actionType,\n })\n ];\n } else {\n updatedIndex = getUpdatedIndex({\n currentIndex: newIndex,\n maxIndex: options.length - 1,\n actionType,\n });\n }\n setActiveIndex(updatedIndex);\n\n const optionValues = options.map((option) => option.value);\n ensureScrollVisiblity(updatedIndex, rest.actionListItemRef.current, optionValues);\n if (isBrowser()) {\n fireNativeEvent(rest.actionListItemRef as React.RefObject<HTMLElement>, ['change', 'input']);\n }\n };\n\n /**\n * Click handler when user clicks on any particular option.\n *\n * It\n * - changes the option focus\n * - selects that option\n * - moves focus to combobox\n */\n const onOptionClick = (\n e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLInputElement>,\n index: number,\n ): void => {\n setIsKeydownPressed(false);\n const actionType = getActionFromKey(e, isOpen, dropdownTriggerer);\n if (typeof actionType === 'number') {\n onOptionChange(actionType, index);\n }\n selectOption(index);\n\n if (!isReactNative()) {\n if (rest.hasAutoCompleteInHeader) {\n // move focus to autocomplete\n rest.headerAutoCompleteRef.current?.focus();\n } else {\n rest.triggererRef.current?.focus();\n }\n }\n };\n\n /**\n * Function we call to handle the typeahead.\n *\n * It takes a letter, stores that letter in searchString (and clears it after timeout) to maintain a word\n *\n * Then searches for that word in options and moves focus there.\n */\n const onComboType = (letter: string, actionType: SelectActionsType): void => {\n // open the listbox if it is closed\n setIsOpen(true);\n\n if (\n rest.hasAutoCompleteInHeader ||\n dropdownTriggerer === dropdownComponentIds.triggers.AutoComplete\n ) {\n return;\n }\n\n if (typeof searchTimeout === 'number') {\n window.clearTimeout(searchTimeout);\n }\n\n searchTimeout = window.setTimeout(() => {\n searchString = '';\n }, 500);\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n searchString = searchString + letter;\n const optionTitles = options.map((option) => option.title);\n const searchIndex = getIndexByLetter(optionTitles, searchString, activeIndex + 1);\n\n // if a match was found, go to it\n if (searchIndex >= 0) {\n onOptionChange(actionType, searchIndex);\n }\n // if no matches, clear the timeout and search string\n else {\n window.clearTimeout(searchTimeout);\n searchString = '';\n }\n };\n\n /**\n * Keydown event of combobox. Handles most of the keyboard accessibility of dropdown\n */\n const onTriggerKeydown = (e: {\n event: React.KeyboardEvent<HTMLInputElement | HTMLButtonElement>;\n }): void => {\n if (!isKeydownPressed && ![' ', 'Enter', 'Escape', 'Meta'].includes(e.event.key)) {\n // When keydown is not already pressed and its not Enter, Space, Command, or Escape key (those are generic keys and we only want to handle arrow keys or home buttons etc)\n setIsKeydownPressed(true);\n }\n\n const actionType = getActionFromKey(e.event, isOpen, dropdownTriggerer);\n\n if (actionType) {\n performAction(actionType, e, {\n setIsOpen,\n close,\n onOptionChange,\n onComboType,\n selectCurrentOption: () => {\n if (activeIndex < 0) {\n return;\n }\n\n const isSelected = selectOption(activeIndex);\n if (rest.hasFooterAction && !isReactNative()) {\n rest.triggererRef.current?.focus();\n }\n\n options[activeIndex].onClickTrigger?.(isSelected);\n },\n });\n }\n };\n\n return {\n isOpen,\n setIsOpen,\n close,\n selectedIndices,\n setSelectedIndices,\n filteredValues,\n removeOption,\n setControlledValueIndices,\n onTriggerClick,\n onTriggerKeydown,\n onOptionClick,\n activeIndex,\n setActiveIndex,\n activeTagIndex,\n setActiveTagIndex,\n visibleTagsCountRef,\n isKeydownPressed,\n setIsKeydownPressed,\n changeCallbackTriggerer,\n setChangeCallbackTriggerer,\n isControlled,\n options,\n value: makeInputValue(selectedIndices, options),\n displayValue: makeInputDisplayValue(selectedIndices, options),\n selectionType,\n dropdownTriggerer,\n ...rest,\n };\n};\n\nexport type { DropdownContextType, OptionsType };\nexport { useDropdown, DropdownContext };\n"],"names":["noop","DropdownContext","React","createContext","isOpen","setIsOpen","close","selectedIndices","setSelectedIndices","controlledValueIndices","setControlledValueIndices","options","setOptions","filteredValues","setFilteredValues","activeIndex","setActiveIndex","activeTagIndex","setActiveTagIndex","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","hasFooterAction","setHasFooterAction","hasAutoCompleteInHeader","setHasAutoCompleteInHeader","isKeydownPressed","setIsKeydownPressed","changeCallbackTriggerer","setChangeCallbackTriggerer","isControlled","setIsControlled","dropdownBaseId","actionListItemRef","current","triggererRef","headerAutoCompleteRef","isTagDismissedRef","visibleTagsCountRef","triggererWrapperRef","searchTimeout","searchString","useDropdown","_React$useContext","useContext","selectionType","dropdownTriggerer","rest","_objectWithoutProperties","_excluded","setIndices","indices","removeOption","index","existingItemIndex","indexOf","concat","_toConsumableArray","slice","selectOption","properties","arguments","length","undefined","closeOnSelection","isSelected","includes","onTriggerClick","onOptionChange","actionType","newIndex","updatedIndex","hasAutoComplete","dropdownComponentIds","triggers","AutoComplete","filteredIndexes","map","filteredValue","findIndex","option","value","sort","a","b","getUpdatedIndex","currentIndex","maxIndex","optionValues","ensureScrollVisiblity","isBrowser","fireNativeEvent","onOptionClick","e","getActionFromKey","isReactNative","_rest$headerAutoCompl","focus","_rest$triggererRef$cu","onComboType","letter","window","clearTimeout","setTimeout","optionTitles","title","searchIndex","getIndexByLetter","onTriggerKeydown","event","key","performAction","selectCurrentOption","_options$activeIndex$","_options$activeIndex","_rest$triggererRef$cu2","onClickTrigger","call","Object","assign","makeInputValue","displayValue","makeInputDisplayValue"],"mappings":";;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,QAAA,CAAA,WAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,oBAAA,CAAA,aAAA,CAAA,gBAAA,CAAA,gBAAA,CAAA,mBAAA,CAAA,qBAAA,CAAA,kBAAA,CAAA,qBAAA,CAAA,SAAA,CAAA,eAAA,CAAA,yBAAA,CAAA,4BAAA,CAAA,cAAA,CAAA,2BAAA,CAAA,gBAAA,CAAA,mBAAA,CAAA,CAqBA,IAAMA,IAAI,CAAG,SAAPA,IAAIA,EAAe,EAAE,CA0GrB,IAAAC,eAAe,CAAGC,cAAK,CAACC,aAAa,CAAsB,CAC/DC,MAAM,CAAE,KAAK,CACbC,SAAS,CAAEL,IAAI,CACfM,KAAK,CAAEN,IAAI,CACXO,eAAe,CAAE,EAAE,CACnBC,kBAAkB,CAAER,IAAI,CACxBS,sBAAsB,CAAE,EAAE,CAC1BC,yBAAyB,CAAEV,IAAI,CAC/BW,OAAO,CAAE,EAAE,CACXC,UAAU,CAAEZ,IAAI,CAChBa,cAAc,CAAE,EAAE,CAClBC,iBAAiB,CAAEd,IAAI,CACvBe,WAAW,CAAE,CAAC,CAAC,CACfC,cAAc,CAAEhB,IAAI,CACpBiB,cAAc,CAAE,CAAC,CAAC,CAClBC,iBAAiB,CAAElB,IAAI,CACvBmB,yBAAyB,CAAE,KAAK,CAChCC,4BAA4B,CAAEpB,IAAI,CAClCqB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AA2BlB,KAAK,EAAE,CACpC,CAEA,CAAAgB,qBAAA,CAAAC,CAAAA,oBAAA,CAAAtG,OAAO,CAACI,WAAW,CAAC,EAACoG,cAAc,GAAnCH,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,qBAAA,CAAAI,IAAA,CAAAH,oBAAA,CAAsCjD,UAAU,CAAC,CACnD,CACF,CAAC,CAAC,CACJ,CACF,CAAC,CAED,OAAAqD,MAAA,CAAAC,MAAA,EACElH,MAAM,CAANA,MAAM,CACNC,SAAS,CAATA,SAAS,CACTC,KAAK,CAALA,KAAK,CACLC,eAAe,CAAfA,eAAe,CACfC,kBAAkB,CAAlBA,kBAAkB,CAClBK,cAAc,CAAdA,cAAc,CACdsC,YAAY,CAAZA,YAAY,CACZzC,yBAAyB,CAAzBA,yBAAyB,CACzBwD,cAAc,CAAdA,cAAc,CACdyC,gBAAgB,CAAhBA,gBAAgB,CAChBhB,aAAa,CAAbA,aAAa,CACb5E,WAAW,CAAXA,WAAW,CACXC,cAAc,CAAdA,cAAc,CACdC,cAAc,CAAdA,cAAc,CACdC,iBAAiB,CAAjBA,iBAAiB,CACjBmB,mBAAmB,CAAnBA,mBAAmB,CACnBZ,gBAAgB,CAAhBA,gBAAgB,CAChBC,mBAAmB,CAAnBA,mBAAmB,CACnBC,uBAAuB,CAAvBA,uBAAuB,CACvBC,0BAA0B,CAA1BA,0BAA0B,CAC1BC,YAAY,CAAZA,YAAY,CACZlB,OAAO,CAAPA,OAAO,CACPqE,KAAK,CAAEuC,cAAc,CAAChH,eAAe,CAAEI,OAAO,CAAC,CAC/C6G,YAAY,CAAEC,qBAAqB,CAAClH,eAAe,CAAEI,OAAO,CAAC,CAC7DiC,aAAa,CAAbA,aAAa,CACbC,iBAAiB,CAAjBA,iBAAiB,CAAA,CACdC,IAAI,CAEX,CAAA;;;;"}
@@ -0,0 +1,12 @@
1
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
2
+ import 'react-native-svg';
3
+ import '@babel/runtime/helpers/defineProperty';
4
+ import { jsxs, jsx } from 'react/jsx-runtime';
5
+ import Path from '../_Svg/Path/Path.native.js';
6
+ import Svg from '../_Svg/Svg/Svg.native.js';
7
+ import useIconProps from '../useIconProps/useIconProps.js';
8
+
9
+ var _excluded=["size","color"];var ChevronUpDownIcon=function ChevronUpDownIcon(_ref){var size=_ref.size,color=_ref.color,styledProps=_objectWithoutProperties(_ref,_excluded);var _useIconProps=useIconProps({size:size,color:color}),height=_useIconProps.height,width=_useIconProps.width,iconColor=_useIconProps.iconColor;return jsxs(Svg,Object.assign({},styledProps,{width:width,height:height,viewBox:"0 0 24 24",fill:"none",children:[jsx(Path,{d:"M12.7071 3.29289C12.3166 2.90237 11.6834 2.90237 11.2929 3.29289L7.29289 7.29289C6.90237 7.68342 6.90237 8.31658 7.29289 8.70711C7.68342 9.09763 8.31658 9.09763 8.70711 8.70711L12 5.41421L15.2929 8.70711C15.6834 9.09763 16.3166 9.09763 16.7071 8.70711C17.0976 8.31658 17.0976 7.68342 16.7071 7.29289L12.7071 3.29289Z",fill:iconColor}),jsx(Path,{d:"M8.70711 15.2929C8.31658 14.9024 7.68342 14.9024 7.29289 15.2929C6.90237 15.6834 6.90237 16.3166 7.29289 16.7071L11.2929 20.7071C11.6834 21.0976 12.3166 21.0976 12.7071 20.7071L16.7071 16.7071C17.0976 16.3166 17.0976 15.6834 16.7071 15.2929C16.3166 14.9024 15.6834 14.9024 15.2929 15.2929L12 18.5858L8.70711 15.2929Z",fill:iconColor})]}));};
10
+
11
+ export { ChevronUpDownIcon as default };
12
+ //# sourceMappingURL=ChevronUpDownIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChevronUpDownIcon.js","sources":["../../../../../../src/components/Icons/ChevronUpDownIcon/ChevronUpDownIcon.tsx"],"sourcesContent":["import { Svg, Path } from '../_Svg';\nimport type { IconComponent } from '..';\nimport useIconProps from '../useIconProps';\n\nconst ChevronUpDownIcon: IconComponent = ({ size, color, ...styledProps }) => {\n const { height, width, iconColor } = useIconProps({ size, color });\n\n return (\n <Svg {...styledProps} width={width} height={height} viewBox=\"0 0 24 24\" fill=\"none\">\n <Path\n d=\"M12.7071 3.29289C12.3166 2.90237 11.6834 2.90237 11.2929 3.29289L7.29289 7.29289C6.90237 7.68342 6.90237 8.31658 7.29289 8.70711C7.68342 9.09763 8.31658 9.09763 8.70711 8.70711L12 5.41421L15.2929 8.70711C15.6834 9.09763 16.3166 9.09763 16.7071 8.70711C17.0976 8.31658 17.0976 7.68342 16.7071 7.29289L12.7071 3.29289Z\"\n fill={iconColor}\n />\n <Path\n d=\"M8.70711 15.2929C8.31658 14.9024 7.68342 14.9024 7.29289 15.2929C6.90237 15.6834 6.90237 16.3166 7.29289 16.7071L11.2929 20.7071C11.6834 21.0976 12.3166 21.0976 12.7071 20.7071L16.7071 16.7071C17.0976 16.3166 17.0976 15.6834 16.7071 15.2929C16.3166 14.9024 15.6834 14.9024 15.2929 15.2929L12 18.5858L8.70711 15.2929Z\"\n fill={iconColor}\n />\n </Svg>\n );\n};\n\nexport default ChevronUpDownIcon;\n"],"names":["ChevronUpDownIcon","_ref","size","color","styledProps","_objectWithoutProperties","_excluded","_useIconProps","useIconProps","height","width","iconColor","_jsxs","Svg","Object","assign","viewBox","fill","children","_jsx","Path","d"],"mappings":";;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,CAIM,IAAAA,iBAAgC,CAAG,SAAnCA,iBAAgCA,CAAAC,IAAA,CAAwC,KAAlCC,IAAI,CAAAD,IAAA,CAAJC,IAAI,CAAEC,KAAK,CAAAF,IAAA,CAALE,KAAK,CAAKC,WAAW,CAAAC,wBAAA,CAAAJ,IAAA,CAAAK,SAAA,CAAA,CACrE,IAAAC,aAAA,CAAqCC,YAAY,CAAC,CAAEN,IAAI,CAAJA,IAAI,CAAEC,KAAK,CAALA,KAAM,CAAC,CAAC,CAA1DM,MAAM,CAAAF,aAAA,CAANE,MAAM,CAAEC,KAAK,CAAAH,aAAA,CAALG,KAAK,CAAEC,SAAS,CAAAJ,aAAA,CAATI,SAAS,CAEhC,OACEC,IAAA,CAACC,GAAG,CAAAC,MAAA,CAAAC,MAAA,CAAKX,EAAAA,CAAAA,WAAW,CAAEM,CAAAA,KAAK,CAAEA,KAAM,CAACD,MAAM,CAAEA,MAAO,CAACO,OAAO,CAAC,WAAW,CAACC,IAAI,CAAC,MAAM,CAAAC,QAAA,CAAA,CACjFC,GAAA,CAACC,IAAI,CAAA,CACHC,CAAC,CAAC,8TAA8T,CAChUJ,IAAI,CAAEN,SAAU,CACjB,CAAC,CACFQ,GAAA,CAACC,IAAI,CACHC,CAAAA,CAAC,CAAC,8TAA8T,CAChUJ,IAAI,CAAEN,SAAU,CACjB,CAAC,CAAA,CAAA,CACC,CAAC,CAEV;;;;"}
@@ -41,7 +41,7 @@ import { getOuterMotionRef, getInnerMotionRef } from '../../../utils/getMotionRe
41
41
  import { makeAnalyticsAttribute } from '../../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
42
42
  import { useInputGroupContext } from '../../InputGroup/InputGroupContext.js';
43
43
 
44
- var _excluded=["as","label","labelPosition","placeholder","type","defaultValue","tags","showAllTags","activeTagIndex","setActiveTagIndex","name","value","onFocus","onChange","onInput","onBlur","onSubmit","onClick","onKeyDown","isDisabled","necessityIndicator","validationState","errorText","helpText","successText","isRequired","leadingIcon","prefix","trailingInteractionElement","onTrailingInteractionElementClick","leadingInteractionElement","suffix","trailingIcon","maxCharacters","textAlign","autoFocus","keyboardReturnKeyType","keyboardType","autoCompleteSuggestionType","trailingHeaderSlot","trailingFooterSlot","numberOfLines","id","componentName","accessibilityLabel","labelId","activeDescendant","hideLabelText","hideFormHint","hasPopup","popupId","isPopupExpanded","maxTagRows","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","autoCapitalize","setInputWrapperRef","testID","isDropdownTrigger","isLabelInsideInput","size","trailingButton","valueComponentType","isTableInputCell","showHintsAsTooltip","_motionMeta","role","tabIndex"];var autoCompleteSuggestionTypeValues=['none','on','name','email','username','password','newPassword','oneTimeCode','telephone','postalCode','countryName','creditCardNumber','creditCardCSC','creditCardExpiry','creditCardExpiryMonth','creditCardExpiryYear'];var useTags=function useTags(tags,activeTagIndex,setActiveTagIndex){var visibleTagsCountRef=React__default.useRef(0);React__default.useEffect(function(){if(tags&&activeTagIndex>=0&&activeTagIndex<tags.length){var _tags$activeTagIndex,_tags$activeTagIndex$;var tagTitle=(_tags$activeTagIndex=tags[activeTagIndex])==null?void 0:(_tags$activeTagIndex$=_tags$activeTagIndex.props)==null?void 0:_tags$activeTagIndex$.children;if(tagTitle){announce(`Close ${tagTitle} Tag`);}}},[activeTagIndex,tags==null?void 0:tags.length]);var onTagLeft=function onTagLeft(){if(activeTagIndex<0){setActiveTagIndex==null?void 0:setActiveTagIndex(visibleTagsCountRef.current-1);}if(activeTagIndex>0){setActiveTagIndex==null?void 0:setActiveTagIndex(activeTagIndex-1);}};var onTagRight=function onTagRight(){if(activeTagIndex<visibleTagsCountRef.current-1){setActiveTagIndex==null?void 0:setActiveTagIndex(activeTagIndex+1);}};var onTagRemove=function onTagRemove(){if(activeTagIndex>=0&&activeTagIndex<visibleTagsCountRef.current&&tags){tags[activeTagIndex].props.onDismiss({tagIndex:activeTagIndex});}};var onInputKeydownTagHandler=function onInputKeydownTagHandler(key){if(tags&&tags.length>0){if(key==='ArrowRight'){onTagRight();}if(key==='ArrowLeft'){onTagLeft();}if(key==='Backspace'){onTagRemove();}}};return {onInputKeydownTagHandler:onInputKeydownTagHandler,visibleTagsCountRef:visibleTagsCountRef};};var useInput=function useInput(_ref){var value=_ref.value,defaultValue=_ref.defaultValue,onClick=_ref.onClick,onFocus=_ref.onFocus,onChange=_ref.onChange,onBlur=_ref.onBlur,onSubmit=_ref.onSubmit,onInput=_ref.onInput,onKeyDown=_ref.onKeyDown,onInputKeydownTagHandler=_ref.onInputKeydownTagHandler;if(__DEV__){if(value&&defaultValue){throwBladeError({message:`Either 'value' or 'defaultValue' shall be passed. This decides if the input field is controlled or uncontrolled`,moduleName:'Input'});}}var _React$useState=React__default.useState(defaultValue!=null?defaultValue:value),_React$useState2=_slicedToArray(_React$useState,2),inputValue=_React$useState2[0],setInputValue=_React$useState2[1];var handleOnFocus=React__default.useCallback(function(_ref2){var name=_ref2.name,value=_ref2.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value;_value=(_value$target$value=value==null?void 0:value.target.value)!=null?_value$target$value:'';}onFocus==null?void 0:onFocus({name:name,value:_value});},[onFocus]);var handleOnClick=React__default.useCallback(function(_ref3){var name=_ref3.name,value=_ref3.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$currentTarget$;_value=(_value$currentTarget$=value==null?void 0:value.currentTarget.value)!=null?_value$currentTarget$:'';}onClick==null?void 0:onClick({name:name,value:_value});},[onClick]);var handleOnSubmit=React__default.useCallback(function(_ref4){var name=_ref4.name,value=_ref4.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value2;_value=(_value$target$value2=value==null?void 0:value.target.value)!=null?_value$target$value2:'';}if(isReactNative()){onSubmit==null?void 0:onSubmit({name:name,value:_value});}},[onSubmit]);var handleOnBlur=React__default.useCallback(function(_ref5){var name=_ref5.name,value=_ref5.value;var _value='';if(getPlatformType()==='react-native'&&typeof value=='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value3;_value=(_value$target$value3=value==null?void 0:value.target.value)!=null?_value$target$value3:'';}onBlur==null?void 0:onBlur({name:name,value:_value});},[onBlur]);var handleOnChange=React__default.useCallback(function(_ref6){var name=_ref6.name,value=_ref6.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value4;_value=(_value$target$value4=value==null?void 0:value.target.value)!=null?_value$target$value4:'';}onChange==null?void 0:onChange({name:name,value:_value});setInputValue(_value);},[onChange]);var handleOnInput=React__default.useCallback(function(_ref7){var name=_ref7.name,value=_ref7.value;var _value='';if(getPlatformType()==='react-native'&&typeof value=='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value5;_value=(_value$target$value5=value==null?void 0:value.target.value)!=null?_value$target$value5:'';}onInput==null?void 0:onInput({name:name,value:_value});},[onInput]);var handleOnKeyDown=React__default.useCallback(function(_ref8){var name=_ref8.name,key=_ref8.key,code=_ref8.code,event=_ref8.event;onInputKeydownTagHandler(key);onKeyDown==null?void 0:onKeyDown({name:name,key:key,code:code,event:event});},[onKeyDown]);return {handleOnFocus:handleOnFocus,handleOnClick:handleOnClick,handleOnChange:handleOnChange,handleOnBlur:handleOnBlur,handleOnSubmit:handleOnSubmit,handleOnInput:handleOnInput,handleOnKeyDown:handleOnKeyDown,inputValue:inputValue};};var getHintType=function getHintType(_ref9){var validationState=_ref9.validationState,hasHelpText=_ref9.hasHelpText;if(validationState==='error'){return 'error';}if(validationState==='success'){return 'success';}if(hasHelpText){return 'help';}return 'help';};var getDescribedByElementId=function getDescribedByElementId(_ref10){var validationState=_ref10.validationState,hasErrorText=_ref10.hasErrorText,hasSuccessText=_ref10.hasSuccessText,hasHelpText=_ref10.hasHelpText,errorTextId=_ref10.errorTextId,successTextId=_ref10.successTextId,helpTextId=_ref10.helpTextId;if(validationState==='error'&&hasErrorText){return errorTextId;}if(validationState==='success'&&hasSuccessText){return successTextId;}if(hasHelpText){return helpTextId;}return '';};var FocusRingWrapper=styled(BaseBox)(function(_ref11){var theme=_ref11.theme,currentInteraction=_ref11.currentInteraction,isTableInputCell=_ref11.isTableInputCell;return {borderRadius:makeBorderSize(isTableInputCell?theme.border.radius.none:theme.border.radius.medium),width:'100%','&:focus-within':!isTableInputCell?Object.assign({},getFocusRingStyles(),{transitionDuration:castWebType(makeMotionTime(getIn(theme.motion.duration,baseInputBorderBackgroundMotion[currentInteraction==='focus'?'enter':'exit'].duration))),transitionTimingFunction:castWebType(theme.motion.easing[baseInputBorderBackgroundMotion[currentInteraction==='focus'?'enter':'exit'].easing])}):{}};});var _BaseInput=function _BaseInput(_ref12,ref){var _inputGroupProps$isDi,_inputGroupProps$size;var _ref12$as=_ref12.as,as=_ref12$as===void 0?'input':_ref12$as,label=_ref12.label,_ref12$labelPosition=_ref12.labelPosition,labelPosition=_ref12$labelPosition===void 0?'top':_ref12$labelPosition,placeholder=_ref12.placeholder,_ref12$type=_ref12.type,type=_ref12$type===void 0?'text':_ref12$type,defaultValue=_ref12.defaultValue,tags=_ref12.tags,_ref12$showAllTags=_ref12.showAllTags,showAllTags=_ref12$showAllTags===void 0?false:_ref12$showAllTags,_ref12$activeTagIndex=_ref12.activeTagIndex,activeTagIndex=_ref12$activeTagIndex===void 0?-1:_ref12$activeTagIndex,setActiveTagIndex=_ref12.setActiveTagIndex,name=_ref12.name,value=_ref12.value,onFocus=_ref12.onFocus,onChange=_ref12.onChange,onInput=_ref12.onInput,onBlur=_ref12.onBlur,onSubmit=_ref12.onSubmit,onClick=_ref12.onClick,onKeyDown=_ref12.onKeyDown,isDisabled=_ref12.isDisabled,necessityIndicator=_ref12.necessityIndicator,validationState=_ref12.validationState,errorText=_ref12.errorText,helpText=_ref12.helpText,successText=_ref12.successText,isRequired=_ref12.isRequired,leadingIcon=_ref12.leadingIcon,prefix=_ref12.prefix,trailingInteractionElement=_ref12.trailingInteractionElement,onTrailingInteractionElementClick=_ref12.onTrailingInteractionElementClick,leadingInteractionElement=_ref12.leadingInteractionElement,suffix=_ref12.suffix,trailingIcon=_ref12.trailingIcon,maxCharacters=_ref12.maxCharacters,textAlign=_ref12.textAlign,autoFocus=_ref12.autoFocus,keyboardReturnKeyType=_ref12.keyboardReturnKeyType,keyboardType=_ref12.keyboardType,autoCompleteSuggestionType=_ref12.autoCompleteSuggestionType,trailingHeaderSlot=_ref12.trailingHeaderSlot,trailingFooterSlot=_ref12.trailingFooterSlot,numberOfLines=_ref12.numberOfLines,id=_ref12.id,componentName=_ref12.componentName,accessibilityLabel=_ref12.accessibilityLabel,labelId=_ref12.labelId,activeDescendant=_ref12.activeDescendant,hideLabelText=_ref12.hideLabelText,hideFormHint=_ref12.hideFormHint,hasPopup=_ref12.hasPopup,popupId=_ref12.popupId,isPopupExpanded=_ref12.isPopupExpanded,maxTagRows=_ref12.maxTagRows,shouldIgnoreBlurAnimation=_ref12.shouldIgnoreBlurAnimation,setShouldIgnoreBlurAnimation=_ref12.setShouldIgnoreBlurAnimation,autoCapitalize=_ref12.autoCapitalize,setInputWrapperRef=_ref12.setInputWrapperRef,testID=_ref12.testID,isDropdownTrigger=_ref12.isDropdownTrigger,isLabelInsideInput=_ref12.isLabelInsideInput,_ref12$size=_ref12.size,size=_ref12$size===void 0?'medium':_ref12$size,trailingButton=_ref12.trailingButton,_ref12$valueComponent=_ref12.valueComponentType,valueComponentType=_ref12$valueComponent===void 0?'text':_ref12$valueComponent,_ref12$isTableInputCe=_ref12.isTableInputCell,isTableInputCell=_ref12$isTableInputCe===void 0?false:_ref12$isTableInputCe,_ref12$showHintsAsToo=_ref12.showHintsAsTooltip,showHintsAsTooltip=_ref12$showHintsAsToo===void 0?false:_ref12$showHintsAsToo,_motionMeta=_ref12._motionMeta,role=_ref12.role,tabIndex=_ref12.tabIndex,rest=_objectWithoutProperties(_ref12,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var inputRef=React__default.useRef(null);var mergedInputRef=useMergeRefs(ref,inputRef);var inputWrapperRef=React__default.useRef(null);var _useTags=useTags(tags,activeTagIndex,setActiveTagIndex),onInputKeydownTagHandler=_useTags.onInputKeydownTagHandler,visibleTagsCountRef=_useTags.visibleTagsCountRef;var _React$useState3=React__default.useState(false),_React$useState4=_slicedToArray(_React$useState3,2),showAllTagsWithAnimation=_React$useState4[0],setShowAllTagsWithAnimation=_React$useState4[1];var isReactNative=getPlatformType()==='react-native';var defaultRole=hasPopup?'combobox':undefined;var inputGroupProps=useInputGroupContext();var isInsideInputGroup=inputGroupProps.isInsideInputGroup;var _isDisabled=(_inputGroupProps$isDi=inputGroupProps.isDisabled)!=null?_inputGroupProps$isDi:isDisabled;var _size=(_inputGroupProps$size=inputGroupProps.size)!=null?_inputGroupProps$size:size;React__default.useEffect(function(){if(showAllTags){setShowAllTagsWithAnimation(true);}else if(maxTagRows!=='expandable'){setShowAllTagsWithAnimation(false);}},[showAllTags,maxTagRows]);var _useInput=useInput({defaultValue:defaultValue,value:value,onFocus:onFocus,onClick:onClick,onChange:onChange,onBlur:onBlur,onSubmit:onSubmit,onInput:onInput,onKeyDown:onKeyDown,onInputKeydownTagHandler:onInputKeydownTagHandler}),handleOnFocus=_useInput.handleOnFocus,handleOnChange=_useInput.handleOnChange,handleOnClick=_useInput.handleOnClick,handleOnBlur=_useInput.handleOnBlur,handleOnSubmit=_useInput.handleOnSubmit,handleOnInput=_useInput.handleOnInput,handleOnKeyDown=_useInput.handleOnKeyDown,inputValue=_useInput.inputValue;var _useFormId=useFormId(id),inputId=_useFormId.inputId,helpTextId=_useFormId.helpTextId,errorTextId=_useFormId.errorTextId,successTextId=_useFormId.successTextId;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var isLabelLeftPositioned=labelPosition==='left'&&matchedDeviceType==='desktop';var _useInteraction=useInteraction(),currentInteraction=_useInteraction.currentInteraction,setCurrentInteraction=_useInteraction.setCurrentInteraction;var _isRequired=isRequired||necessityIndicator==='required';var accessibilityProps=makeAccessible({required:Boolean(_isRequired),disabled:Boolean(_isDisabled),invalid:Boolean(validationState==='error'),describedBy:getDescribedByElementId({validationState:validationState,hasErrorText:Boolean(errorText),hasSuccessText:Boolean(successText),hasHelpText:Boolean(helpText),errorTextId:errorTextId,successTextId:successTextId,helpTextId:helpTextId}),label:accessibilityLabel,hasPopup:hasPopup,expanded:hasPopup?isPopupExpanded:undefined,controls:hasPopup?popupId:undefined,role:role!=null?role:defaultRole,activeDescendant:activeDescendant});var willRenderHintText=Boolean(helpText)||validationState==='success'&&Boolean(successText)||validationState==='error'&&Boolean(errorText);if(__DEV__){if(autoCompleteSuggestionType&&!autoCompleteSuggestionTypeValues.includes(autoCompleteSuggestionType)){throwBladeError({message:`Expected autoCompleteSuggestionType to be one of ${autoCompleteSuggestionTypeValues.join(', ')} but received ${autoCompleteSuggestionType}`,moduleName:'Input'});}}var isTextArea=as==='textarea';return jsxs(BaseBox,Object.assign({ref:getOuterMotionRef({_motionMeta:_motionMeta,ref:ref})},metaAttribute({name:componentName,testID:testID}),getStyledProps(rest),{children:[jsxs(BaseBox,{display:"flex",flexDirection:isLabelLeftPositioned?'row':'column',justifyContent:isLabelLeftPositioned?'center':undefined,alignItems:isLabelLeftPositioned?'center':undefined,position:"relative",width:"100%",children:[!hideLabelText&&!isLabelInsideInput&&label&&!isInsideInputGroup&&jsxs(BaseBox,{display:"flex",flexDirection:isLabelLeftPositioned?'column':'row',justifyContent:"space-between",alignSelf:isTextArea?'flex-start':undefined,marginY:isTextArea&&isLabelLeftPositioned?'spacing.3':'spacing.0',children:[jsx(FormLabel,{as:"label",necessityIndicator:necessityIndicator,position:labelPosition,id:labelId,htmlFor:inputId,size:_size,children:label}),trailingHeaderSlot==null?void 0:trailingHeaderSlot(value!=null?value:inputValue)]}),jsx(FocusRingWrapper,{currentInteraction:currentInteraction,isTableInputCell:isTableInputCell,className:"focus-ring-wrapper",children:jsxs(BaseInputWrapper,{isDropdownTrigger:isDropdownTrigger,isTextArea:isTextArea,isDisabled:_isDisabled,validationState:validationState,currentInteraction:currentInteraction,isLabelLeftPositioned:isLabelLeftPositioned,showAllTags:showAllTags,setShowAllTagsWithAnimation:setShowAllTagsWithAnimation,ref:function ref(refNode){if(refNode){setInputWrapperRef==null?void 0:setInputWrapperRef(refNode);inputWrapperRef.current=refNode;}},maxTagRows:maxTagRows,size:_size,numberOfLines:numberOfLines,onClick:function onClick(){if(!isReactNative){var _inputRef$current;(_inputRef$current=inputRef.current)==null?void 0:_inputRef$current.focus();}},isTableInputCell:isTableInputCell,children:[jsx(BaseInputVisuals,{size:_size,leadingIcon:leadingIcon,prefix:prefix,isDisabled:_isDisabled,leadingInteractionElement:leadingInteractionElement}),jsx(BaseInputTagSlot,{renderAs:as,tags:tags,isDisabled:_isDisabled,showAllTags:showAllTagsWithAnimation,setFocusOnInput:function setFocusOnInput(){var innerRef=getInnerMotionRef({_motionMeta:_motionMeta,ref:ref});if(innerRef&&!isReactNative&&'current'in innerRef){var _innerRef$current;(_innerRef$current=innerRef.current)==null?void 0:_innerRef$current.focus();}},labelPrefix:isLabelInsideInput?label:undefined,isDropdownTrigger:isDropdownTrigger,visibleTagsCountRef:visibleTagsCountRef,handleOnInputClick:function handleOnInputClick(e){handleOnClick({name:name,value:isReactNative?value:e});},setShouldIgnoreBlurAnimation:setShouldIgnoreBlurAnimation,maxTagRows:maxTagRows,inputWrapperRef:inputWrapperRef,size:_size,numberOfLines:numberOfLines,isTextArea:isTextArea,children:jsx(StyledBaseInput,Object.assign({as:as,id:inputId,ref:getInnerMotionRef({_motionMeta:_motionMeta,ref:mergedInputRef}),name:name,type:type,defaultValue:defaultValue,value:value,placeholder:placeholder,isDisabled:_isDisabled,validationState:validationState,isRequired:_isRequired,handleOnFocus:handleOnFocus,handleOnChange:handleOnChange,handleOnBlur:handleOnBlur,handleOnSubmit:handleOnSubmit,handleOnInput:handleOnInput,handleOnKeyDown:handleOnKeyDown,handleOnClick:handleOnClick,leadingIcon:leadingIcon,prefix:prefix,trailingInteractionElement:trailingInteractionElement,leadingInteractionElement:leadingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,maxCharacters:maxCharacters,textAlign:textAlign,autoFocus:autoFocus,keyboardReturnKeyType:keyboardReturnKeyType,keyboardType:keyboardType,autoCompleteSuggestionType:autoCompleteSuggestionType,accessibilityProps:accessibilityProps,currentInteraction:currentInteraction,setCurrentInteraction:setCurrentInteraction,numberOfLines:numberOfLines,isTextArea:isTextArea||maxTagRows==='multiple'||maxTagRows==='expandable',hasPopup:hasPopup,hasTags:!!(tags&&tags.length>0),shouldIgnoreBlurAnimation:shouldIgnoreBlurAnimation,autoCapitalize:autoCapitalize,isDropdownTrigger:isDropdownTrigger,$size:_size,valueComponentType:valueComponentType,isTableInputCell:isTableInputCell,tabIndex:tabIndex},metaAttribute({name:MetaConstants.StyledBaseInput}),makeAnalyticsAttribute(rest)))}),jsx(BaseInputVisuals,{trailingInteractionElement:trailingInteractionElement,onTrailingInteractionElementClick:onTrailingInteractionElementClick,suffix:suffix,trailingIcon:trailingIcon,isDisabled:_isDisabled,validationState:validationState,trailingButton:trailingButton,size:_size,errorText:errorText,successText:successText,showHintsAsTooltip:showHintsAsTooltip})]})})]}),hideFormHint||showHintsAsTooltip||isInsideInputGroup?null:jsx(BaseBox,{marginLeft:makeSize(isLabelLeftPositioned&&!hideLabelText?formHintLeftLabelMarginLeft[_size]:0),children:jsxs(BaseBox,{display:"flex",flexDirection:"row",justifyContent:willRenderHintText?'space-between':'flex-end',children:[jsx(FormHint,{type:getHintType({validationState:validationState,hasHelpText:Boolean(helpText)}),helpText:helpText,errorText:errorText,successText:successText,helpTextId:helpTextId,errorTextId:errorTextId,successTextId:successTextId,size:_size}),trailingFooterSlot==null?void 0:trailingFooterSlot(value!=null?value:inputValue)]})})]}));};var BaseInputWithRef=React__default.forwardRef(_BaseInput);var BaseInput=assignWithoutSideEffects(BaseInputWithRef,{displayName:'BaseInput'});
44
+ var _excluded=["as","label","labelPosition","placeholder","type","defaultValue","tags","showAllTags","activeTagIndex","setActiveTagIndex","name","value","onFocus","onChange","onInput","onBlur","onSubmit","onClick","onKeyDown","isDisabled","necessityIndicator","validationState","errorText","helpText","successText","isRequired","leadingIcon","prefix","trailingInteractionElement","onTrailingInteractionElementClick","leadingInteractionElement","suffix","trailingIcon","maxCharacters","textAlign","autoFocus","keyboardReturnKeyType","keyboardType","autoCompleteSuggestionType","trailingHeaderSlot","trailingFooterSlot","numberOfLines","id","componentName","accessibilityLabel","labelId","activeDescendant","hideLabelText","hideFormHint","hasPopup","popupId","isPopupExpanded","maxTagRows","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","autoCapitalize","setInputWrapperRef","testID","isDropdownTrigger","isLabelInsideInput","size","trailingButton","valueComponentType","isTableInputCell","showHintsAsTooltip","_motionMeta","role","tabIndex","leadingDropDown","trailingDropDown"];var autoCompleteSuggestionTypeValues=['none','on','name','email','username','password','newPassword','oneTimeCode','telephone','postalCode','countryName','creditCardNumber','creditCardCSC','creditCardExpiry','creditCardExpiryMonth','creditCardExpiryYear'];var useTags=function useTags(tags,activeTagIndex,setActiveTagIndex){var visibleTagsCountRef=React__default.useRef(0);React__default.useEffect(function(){if(tags&&activeTagIndex>=0&&activeTagIndex<tags.length){var _tags$activeTagIndex,_tags$activeTagIndex$;var tagTitle=(_tags$activeTagIndex=tags[activeTagIndex])==null?void 0:(_tags$activeTagIndex$=_tags$activeTagIndex.props)==null?void 0:_tags$activeTagIndex$.children;if(tagTitle){announce(`Close ${tagTitle} Tag`);}}},[activeTagIndex,tags==null?void 0:tags.length]);var onTagLeft=function onTagLeft(){if(activeTagIndex<0){setActiveTagIndex==null?void 0:setActiveTagIndex(visibleTagsCountRef.current-1);}if(activeTagIndex>0){setActiveTagIndex==null?void 0:setActiveTagIndex(activeTagIndex-1);}};var onTagRight=function onTagRight(){if(activeTagIndex<visibleTagsCountRef.current-1){setActiveTagIndex==null?void 0:setActiveTagIndex(activeTagIndex+1);}};var onTagRemove=function onTagRemove(){if(activeTagIndex>=0&&activeTagIndex<visibleTagsCountRef.current&&tags){tags[activeTagIndex].props.onDismiss({tagIndex:activeTagIndex});}};var onInputKeydownTagHandler=function onInputKeydownTagHandler(key){if(tags&&tags.length>0){if(key==='ArrowRight'){onTagRight();}if(key==='ArrowLeft'){onTagLeft();}if(key==='Backspace'){onTagRemove();}}};return {onInputKeydownTagHandler:onInputKeydownTagHandler,visibleTagsCountRef:visibleTagsCountRef};};var useInput=function useInput(_ref){var value=_ref.value,defaultValue=_ref.defaultValue,onClick=_ref.onClick,onFocus=_ref.onFocus,onChange=_ref.onChange,onBlur=_ref.onBlur,onSubmit=_ref.onSubmit,onInput=_ref.onInput,onKeyDown=_ref.onKeyDown,onInputKeydownTagHandler=_ref.onInputKeydownTagHandler;if(__DEV__){if(value&&defaultValue){throwBladeError({message:`Either 'value' or 'defaultValue' shall be passed. This decides if the input field is controlled or uncontrolled`,moduleName:'Input'});}}var _React$useState=React__default.useState(defaultValue!=null?defaultValue:value),_React$useState2=_slicedToArray(_React$useState,2),inputValue=_React$useState2[0],setInputValue=_React$useState2[1];var handleOnFocus=React__default.useCallback(function(_ref2){var name=_ref2.name,value=_ref2.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value;_value=(_value$target$value=value==null?void 0:value.target.value)!=null?_value$target$value:'';}onFocus==null?void 0:onFocus({name:name,value:_value});},[onFocus]);var handleOnClick=React__default.useCallback(function(_ref3){var name=_ref3.name,value=_ref3.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$currentTarget$;_value=(_value$currentTarget$=value==null?void 0:value.currentTarget.value)!=null?_value$currentTarget$:'';}onClick==null?void 0:onClick({name:name,value:_value});},[onClick]);var handleOnSubmit=React__default.useCallback(function(_ref4){var name=_ref4.name,value=_ref4.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value2;_value=(_value$target$value2=value==null?void 0:value.target.value)!=null?_value$target$value2:'';}if(isReactNative()){onSubmit==null?void 0:onSubmit({name:name,value:_value});}},[onSubmit]);var handleOnBlur=React__default.useCallback(function(_ref5){var name=_ref5.name,value=_ref5.value;var _value='';if(getPlatformType()==='react-native'&&typeof value=='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value3;_value=(_value$target$value3=value==null?void 0:value.target.value)!=null?_value$target$value3:'';}onBlur==null?void 0:onBlur({name:name,value:_value});},[onBlur]);var handleOnChange=React__default.useCallback(function(_ref6){var name=_ref6.name,value=_ref6.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value4;_value=(_value$target$value4=value==null?void 0:value.target.value)!=null?_value$target$value4:'';}onChange==null?void 0:onChange({name:name,value:_value});setInputValue(_value);},[onChange]);var handleOnInput=React__default.useCallback(function(_ref7){var name=_ref7.name,value=_ref7.value;var _value='';if(getPlatformType()==='react-native'&&typeof value=='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value5;_value=(_value$target$value5=value==null?void 0:value.target.value)!=null?_value$target$value5:'';}onInput==null?void 0:onInput({name:name,value:_value});},[onInput]);var handleOnKeyDown=React__default.useCallback(function(_ref8){var name=_ref8.name,key=_ref8.key,code=_ref8.code,event=_ref8.event;onInputKeydownTagHandler(key);onKeyDown==null?void 0:onKeyDown({name:name,key:key,code:code,event:event});},[onKeyDown]);return {handleOnFocus:handleOnFocus,handleOnClick:handleOnClick,handleOnChange:handleOnChange,handleOnBlur:handleOnBlur,handleOnSubmit:handleOnSubmit,handleOnInput:handleOnInput,handleOnKeyDown:handleOnKeyDown,inputValue:inputValue};};var getHintType=function getHintType(_ref9){var validationState=_ref9.validationState,hasHelpText=_ref9.hasHelpText;if(validationState==='error'){return 'error';}if(validationState==='success'){return 'success';}if(hasHelpText){return 'help';}return 'help';};var getDescribedByElementId=function getDescribedByElementId(_ref10){var validationState=_ref10.validationState,hasErrorText=_ref10.hasErrorText,hasSuccessText=_ref10.hasSuccessText,hasHelpText=_ref10.hasHelpText,errorTextId=_ref10.errorTextId,successTextId=_ref10.successTextId,helpTextId=_ref10.helpTextId;if(validationState==='error'&&hasErrorText){return errorTextId;}if(validationState==='success'&&hasSuccessText){return successTextId;}if(hasHelpText){return helpTextId;}return '';};var FocusRingWrapper=styled(BaseBox)(function(_ref11){var theme=_ref11.theme,currentInteraction=_ref11.currentInteraction,isTableInputCell=_ref11.isTableInputCell;return {borderRadius:makeBorderSize(isTableInputCell?theme.border.radius.none:theme.border.radius.medium),width:'100%','&:focus-within':!isTableInputCell?Object.assign({},getFocusRingStyles(),{transitionDuration:castWebType(makeMotionTime(getIn(theme.motion.duration,baseInputBorderBackgroundMotion[currentInteraction==='focus'?'enter':'exit'].duration))),transitionTimingFunction:castWebType(theme.motion.easing[baseInputBorderBackgroundMotion[currentInteraction==='focus'?'enter':'exit'].easing])}):{}};});var _BaseInput=function _BaseInput(_ref12,ref){var _inputGroupProps$isDi,_inputGroupProps$size;var _ref12$as=_ref12.as,as=_ref12$as===void 0?'input':_ref12$as,label=_ref12.label,_ref12$labelPosition=_ref12.labelPosition,labelPosition=_ref12$labelPosition===void 0?'top':_ref12$labelPosition,placeholder=_ref12.placeholder,_ref12$type=_ref12.type,type=_ref12$type===void 0?'text':_ref12$type,defaultValue=_ref12.defaultValue,tags=_ref12.tags,_ref12$showAllTags=_ref12.showAllTags,showAllTags=_ref12$showAllTags===void 0?false:_ref12$showAllTags,_ref12$activeTagIndex=_ref12.activeTagIndex,activeTagIndex=_ref12$activeTagIndex===void 0?-1:_ref12$activeTagIndex,setActiveTagIndex=_ref12.setActiveTagIndex,name=_ref12.name,value=_ref12.value,onFocus=_ref12.onFocus,onChange=_ref12.onChange,onInput=_ref12.onInput,onBlur=_ref12.onBlur,onSubmit=_ref12.onSubmit,onClick=_ref12.onClick,onKeyDown=_ref12.onKeyDown,isDisabled=_ref12.isDisabled,necessityIndicator=_ref12.necessityIndicator,validationState=_ref12.validationState,errorText=_ref12.errorText,helpText=_ref12.helpText,successText=_ref12.successText,isRequired=_ref12.isRequired,leadingIcon=_ref12.leadingIcon,prefix=_ref12.prefix,trailingInteractionElement=_ref12.trailingInteractionElement,onTrailingInteractionElementClick=_ref12.onTrailingInteractionElementClick,leadingInteractionElement=_ref12.leadingInteractionElement,suffix=_ref12.suffix,trailingIcon=_ref12.trailingIcon,maxCharacters=_ref12.maxCharacters,textAlign=_ref12.textAlign,autoFocus=_ref12.autoFocus,keyboardReturnKeyType=_ref12.keyboardReturnKeyType,keyboardType=_ref12.keyboardType,autoCompleteSuggestionType=_ref12.autoCompleteSuggestionType,trailingHeaderSlot=_ref12.trailingHeaderSlot,trailingFooterSlot=_ref12.trailingFooterSlot,numberOfLines=_ref12.numberOfLines,id=_ref12.id,componentName=_ref12.componentName,accessibilityLabel=_ref12.accessibilityLabel,labelId=_ref12.labelId,activeDescendant=_ref12.activeDescendant,hideLabelText=_ref12.hideLabelText,hideFormHint=_ref12.hideFormHint,hasPopup=_ref12.hasPopup,popupId=_ref12.popupId,isPopupExpanded=_ref12.isPopupExpanded,maxTagRows=_ref12.maxTagRows,shouldIgnoreBlurAnimation=_ref12.shouldIgnoreBlurAnimation,setShouldIgnoreBlurAnimation=_ref12.setShouldIgnoreBlurAnimation,autoCapitalize=_ref12.autoCapitalize,setInputWrapperRef=_ref12.setInputWrapperRef,testID=_ref12.testID,isDropdownTrigger=_ref12.isDropdownTrigger,isLabelInsideInput=_ref12.isLabelInsideInput,_ref12$size=_ref12.size,size=_ref12$size===void 0?'medium':_ref12$size,trailingButton=_ref12.trailingButton,_ref12$valueComponent=_ref12.valueComponentType,valueComponentType=_ref12$valueComponent===void 0?'text':_ref12$valueComponent,_ref12$isTableInputCe=_ref12.isTableInputCell,isTableInputCell=_ref12$isTableInputCe===void 0?false:_ref12$isTableInputCe,_ref12$showHintsAsToo=_ref12.showHintsAsTooltip,showHintsAsTooltip=_ref12$showHintsAsToo===void 0?false:_ref12$showHintsAsToo,_motionMeta=_ref12._motionMeta,role=_ref12.role,tabIndex=_ref12.tabIndex,leadingDropDown=_ref12.leadingDropDown,trailingDropDown=_ref12.trailingDropDown,rest=_objectWithoutProperties(_ref12,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var inputRef=React__default.useRef(null);var mergedInputRef=useMergeRefs(ref,inputRef);var inputWrapperRef=React__default.useRef(null);var _useTags=useTags(tags,activeTagIndex,setActiveTagIndex),onInputKeydownTagHandler=_useTags.onInputKeydownTagHandler,visibleTagsCountRef=_useTags.visibleTagsCountRef;var _React$useState3=React__default.useState(false),_React$useState4=_slicedToArray(_React$useState3,2),showAllTagsWithAnimation=_React$useState4[0],setShowAllTagsWithAnimation=_React$useState4[1];var isReactNative=getPlatformType()==='react-native';var defaultRole=hasPopup?'combobox':undefined;var inputGroupProps=useInputGroupContext();var isInsideInputGroup=inputGroupProps.isInsideInputGroup;var _isDisabled=(_inputGroupProps$isDi=inputGroupProps.isDisabled)!=null?_inputGroupProps$isDi:isDisabled;var _size=(_inputGroupProps$size=inputGroupProps.size)!=null?_inputGroupProps$size:size;React__default.useEffect(function(){if(showAllTags){setShowAllTagsWithAnimation(true);}else if(maxTagRows!=='expandable'){setShowAllTagsWithAnimation(false);}},[showAllTags,maxTagRows]);var _useInput=useInput({defaultValue:defaultValue,value:value,onFocus:onFocus,onClick:onClick,onChange:onChange,onBlur:onBlur,onSubmit:onSubmit,onInput:onInput,onKeyDown:onKeyDown,onInputKeydownTagHandler:onInputKeydownTagHandler}),handleOnFocus=_useInput.handleOnFocus,handleOnChange=_useInput.handleOnChange,handleOnClick=_useInput.handleOnClick,handleOnBlur=_useInput.handleOnBlur,handleOnSubmit=_useInput.handleOnSubmit,handleOnInput=_useInput.handleOnInput,handleOnKeyDown=_useInput.handleOnKeyDown,inputValue=_useInput.inputValue;var _useFormId=useFormId(id),inputId=_useFormId.inputId,helpTextId=_useFormId.helpTextId,errorTextId=_useFormId.errorTextId,successTextId=_useFormId.successTextId;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var isLabelLeftPositioned=labelPosition==='left'&&matchedDeviceType==='desktop';var _useInteraction=useInteraction(),currentInteraction=_useInteraction.currentInteraction,setCurrentInteraction=_useInteraction.setCurrentInteraction;var _isRequired=isRequired||necessityIndicator==='required';var accessibilityProps=makeAccessible({required:Boolean(_isRequired),disabled:Boolean(_isDisabled),invalid:Boolean(validationState==='error'),describedBy:getDescribedByElementId({validationState:validationState,hasErrorText:Boolean(errorText),hasSuccessText:Boolean(successText),hasHelpText:Boolean(helpText),errorTextId:errorTextId,successTextId:successTextId,helpTextId:helpTextId}),label:accessibilityLabel,hasPopup:hasPopup,expanded:hasPopup?isPopupExpanded:undefined,controls:hasPopup?popupId:undefined,role:role!=null?role:defaultRole,activeDescendant:activeDescendant});var willRenderHintText=Boolean(helpText)||validationState==='success'&&Boolean(successText)||validationState==='error'&&Boolean(errorText);if(__DEV__){if(autoCompleteSuggestionType&&!autoCompleteSuggestionTypeValues.includes(autoCompleteSuggestionType)){throwBladeError({message:`Expected autoCompleteSuggestionType to be one of ${autoCompleteSuggestionTypeValues.join(', ')} but received ${autoCompleteSuggestionType}`,moduleName:'Input'});}}var isTextArea=as==='textarea';return jsxs(BaseBox,Object.assign({ref:getOuterMotionRef({_motionMeta:_motionMeta,ref:ref})},metaAttribute({name:componentName,testID:testID}),getStyledProps(rest),{children:[jsxs(BaseBox,{display:"flex",flexDirection:isLabelLeftPositioned?'row':'column',justifyContent:isLabelLeftPositioned?'center':undefined,alignItems:isLabelLeftPositioned?'center':undefined,position:"relative",width:"100%",children:[!hideLabelText&&!isLabelInsideInput&&label&&!isInsideInputGroup&&jsxs(BaseBox,{display:"flex",flexDirection:isLabelLeftPositioned?'column':'row',justifyContent:"space-between",alignSelf:isTextArea?'flex-start':undefined,marginY:isTextArea&&isLabelLeftPositioned?'spacing.3':'spacing.0',children:[jsx(FormLabel,{as:"label",necessityIndicator:necessityIndicator,position:labelPosition,id:labelId,htmlFor:inputId,size:_size,children:label}),trailingHeaderSlot==null?void 0:trailingHeaderSlot(value!=null?value:inputValue)]}),jsx(FocusRingWrapper,{currentInteraction:currentInteraction,isTableInputCell:isTableInputCell,className:"focus-ring-wrapper",children:jsxs(BaseInputWrapper,{isDropdownTrigger:isDropdownTrigger,isTextArea:isTextArea,isDisabled:_isDisabled,validationState:validationState,currentInteraction:currentInteraction,isLabelLeftPositioned:isLabelLeftPositioned,showAllTags:showAllTags,setShowAllTagsWithAnimation:setShowAllTagsWithAnimation,ref:function ref(refNode){if(refNode){setInputWrapperRef==null?void 0:setInputWrapperRef(refNode);inputWrapperRef.current=refNode;}},maxTagRows:maxTagRows,size:_size,numberOfLines:numberOfLines,onClick:function onClick(){if(!isReactNative){var _inputRef$current;(_inputRef$current=inputRef.current)==null?void 0:_inputRef$current.focus();}},isTableInputCell:isTableInputCell,children:[jsx(BaseInputVisuals,{size:_size,leadingIcon:leadingIcon,prefix:prefix,isDisabled:_isDisabled,leadingInteractionElement:leadingInteractionElement,leadingDropDown:leadingDropDown}),jsx(BaseInputTagSlot,{renderAs:as,tags:tags,isDisabled:_isDisabled,showAllTags:showAllTagsWithAnimation,setFocusOnInput:function setFocusOnInput(){var innerRef=getInnerMotionRef({_motionMeta:_motionMeta,ref:ref});if(innerRef&&!isReactNative&&'current'in innerRef){var _innerRef$current;(_innerRef$current=innerRef.current)==null?void 0:_innerRef$current.focus();}},labelPrefix:isLabelInsideInput?label:undefined,isDropdownTrigger:isDropdownTrigger,visibleTagsCountRef:visibleTagsCountRef,handleOnInputClick:function handleOnInputClick(e){handleOnClick({name:name,value:isReactNative?value:e});},setShouldIgnoreBlurAnimation:setShouldIgnoreBlurAnimation,maxTagRows:maxTagRows,inputWrapperRef:inputWrapperRef,size:_size,numberOfLines:numberOfLines,isTextArea:isTextArea,hasLeadingDropDown:Boolean(leadingDropDown),children:jsx(StyledBaseInput,Object.assign({as:as,id:inputId,ref:getInnerMotionRef({_motionMeta:_motionMeta,ref:mergedInputRef}),name:name,type:type,defaultValue:defaultValue,value:value,placeholder:placeholder,isDisabled:_isDisabled,validationState:validationState,isRequired:_isRequired,handleOnFocus:handleOnFocus,handleOnChange:handleOnChange,handleOnBlur:handleOnBlur,handleOnSubmit:handleOnSubmit,handleOnInput:handleOnInput,handleOnKeyDown:handleOnKeyDown,handleOnClick:handleOnClick,leadingIcon:leadingIcon,prefix:prefix,trailingInteractionElement:trailingInteractionElement,leadingInteractionElement:leadingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,maxCharacters:maxCharacters,textAlign:textAlign,autoFocus:autoFocus,keyboardReturnKeyType:keyboardReturnKeyType,keyboardType:keyboardType,autoCompleteSuggestionType:autoCompleteSuggestionType,accessibilityProps:accessibilityProps,currentInteraction:currentInteraction,setCurrentInteraction:setCurrentInteraction,numberOfLines:numberOfLines,isTextArea:isTextArea||maxTagRows==='multiple'||maxTagRows==='expandable',hasPopup:hasPopup,hasTags:!!(tags&&tags.length>0),shouldIgnoreBlurAnimation:shouldIgnoreBlurAnimation,autoCapitalize:autoCapitalize,isDropdownTrigger:isDropdownTrigger,$size:_size,valueComponentType:valueComponentType,isTableInputCell:isTableInputCell,tabIndex:tabIndex,hasLeadingDropdown:Boolean(leadingDropDown)},metaAttribute({name:MetaConstants.StyledBaseInput}),makeAnalyticsAttribute(rest)))}),jsx(BaseInputVisuals,{trailingInteractionElement:trailingInteractionElement,onTrailingInteractionElementClick:onTrailingInteractionElementClick,suffix:suffix,trailingIcon:trailingIcon,isDisabled:_isDisabled,validationState:validationState,trailingButton:trailingButton,size:_size,errorText:errorText,successText:successText,showHintsAsTooltip:showHintsAsTooltip,trailingDropDown:trailingDropDown})]})})]}),hideFormHint||showHintsAsTooltip||isInsideInputGroup?null:jsx(BaseBox,{marginLeft:makeSize(isLabelLeftPositioned&&!hideLabelText?formHintLeftLabelMarginLeft[_size]:0),children:jsxs(BaseBox,{display:"flex",flexDirection:"row",justifyContent:willRenderHintText?'space-between':'flex-end',children:[jsx(FormHint,{type:getHintType({validationState:validationState,hasHelpText:Boolean(helpText)}),helpText:helpText,errorText:errorText,successText:successText,helpTextId:helpTextId,errorTextId:errorTextId,successTextId:successTextId,size:_size}),trailingFooterSlot==null?void 0:trailingFooterSlot(value!=null?value:inputValue)]})})]}));};var BaseInputWithRef=React__default.forwardRef(_BaseInput);var BaseInput=assignWithoutSideEffects(BaseInputWithRef,{displayName:'BaseInput'});
45
45
 
46
46
  export { BaseInput, getHintType };
47
47
  //# sourceMappingURL=BaseInput.js.map