@razorpay/blade 11.8.2 → 11.9.1

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 (230) hide show
  1. package/build/lib/native/components/Checkbox/Checkbox.js +4 -3
  2. package/build/lib/native/components/Checkbox/Checkbox.js.map +1 -1
  3. package/build/lib/native/components/Checkbox/CheckboxGroup/CheckboxGroup.js +1 -1
  4. package/build/lib/native/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
  5. package/build/lib/native/components/Checkbox/CheckboxIcon/CheckboxIcon.js +1 -1
  6. package/build/lib/native/components/Checkbox/CheckboxIcon/CheckboxIcon.js.map +1 -1
  7. package/build/lib/native/components/Checkbox/checkboxTokens.js +1 -1
  8. package/build/lib/native/components/Checkbox/checkboxTokens.js.map +1 -1
  9. package/build/lib/native/components/Form/CharacterCounter/CharacterCounter.js +2 -1
  10. package/build/lib/native/components/Form/CharacterCounter/CharacterCounter.js.map +1 -1
  11. package/build/lib/native/components/Form/FormHint.js +2 -1
  12. package/build/lib/native/components/Form/FormHint.js.map +1 -1
  13. package/build/lib/native/components/Form/FormLabel.js +3 -1
  14. package/build/lib/native/components/Form/FormLabel.js.map +1 -1
  15. package/build/lib/native/components/Form/Selector/SelectorSupportText.js +1 -1
  16. package/build/lib/native/components/Form/Selector/SelectorSupportText.js.map +1 -1
  17. package/build/lib/native/components/Form/Selector/SelectorTitle.js.map +1 -1
  18. package/build/lib/native/components/Form/formTokens.js +8 -0
  19. package/build/lib/native/components/Form/formTokens.js.map +1 -0
  20. package/build/lib/native/components/Input/BaseInput/AnimatedBaseInputWrapper.native.js +5 -3
  21. package/build/lib/native/components/Input/BaseInput/AnimatedBaseInputWrapper.native.js.map +1 -1
  22. package/build/lib/native/components/Input/BaseInput/BaseInput.js +8 -2
  23. package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
  24. package/build/lib/native/components/Input/BaseInput/BaseInputTagSlot.native.js +2 -2
  25. package/build/lib/native/components/Input/BaseInput/BaseInputTagSlot.native.js.map +1 -1
  26. package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js +4 -2
  27. package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  28. package/build/lib/native/components/Input/BaseInput/BaseInputWrapper.js +2 -3
  29. package/build/lib/native/components/Input/BaseInput/BaseInputWrapper.js.map +1 -1
  30. package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js +2 -1
  31. package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js.map +1 -1
  32. package/build/lib/native/components/Input/BaseInput/baseInputStyles.js +6 -3
  33. package/build/lib/native/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  34. package/build/lib/native/components/Input/BaseInput/baseInputTokens.js +8 -0
  35. package/build/lib/native/components/Input/BaseInput/baseInputTokens.js.map +1 -0
  36. package/build/lib/native/components/Input/BaseInput/getBaseInputBorderStyles.native.js +4 -0
  37. package/build/lib/native/components/Input/BaseInput/getBaseInputBorderStyles.native.js.map +1 -0
  38. package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +1 -1
  39. package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  40. package/build/lib/native/components/Input/OTPInput/OTPInput.js +1 -1
  41. package/build/lib/native/components/Input/OTPInput/OTPInput.js.map +1 -1
  42. package/build/lib/native/components/Input/PasswordInput/PasswordInput.js +1 -1
  43. package/build/lib/native/components/Input/PasswordInput/PasswordInput.js.map +1 -1
  44. package/build/lib/native/components/Input/TextArea/TextArea.js +2 -1
  45. package/build/lib/native/components/Input/TextArea/TextArea.js.map +1 -1
  46. package/build/lib/native/components/Input/TextInput/TextInput.js +2 -1
  47. package/build/lib/native/components/Input/TextInput/TextInput.js.map +1 -1
  48. package/build/lib/native/components/Radio/Radio.js +4 -3
  49. package/build/lib/native/components/Radio/Radio.js.map +1 -1
  50. package/build/lib/native/components/Radio/RadioGroup/RadioGroup.js +1 -1
  51. package/build/lib/native/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
  52. package/build/lib/native/components/Radio/radioTokens.js +1 -1
  53. package/build/lib/native/components/Radio/radioTokens.js.map +1 -1
  54. package/build/lib/native/components/Tag/Tag.js +1 -1
  55. package/build/lib/native/components/Tag/Tag.js.map +1 -1
  56. package/build/lib/native/components/Tag/getTagsGroup.js +1 -1
  57. package/build/lib/native/components/Tag/getTagsGroup.js.map +1 -1
  58. package/build/lib/native/components/Typography/Heading/Heading.js +2 -2
  59. package/build/lib/native/components/Typography/Heading/Heading.js.map +1 -1
  60. package/build/lib/native/components/Typography/Heading/getHeadingStyles.js +7 -0
  61. package/build/lib/native/components/Typography/Heading/getHeadingStyles.js.map +1 -0
  62. package/build/lib/native/components/Typography/Text/Text.js +1 -1
  63. package/build/lib/native/components/Typography/Text/Text.js.map +1 -1
  64. package/build/lib/native/components/index.js +1 -1
  65. package/build/lib/native/tokens/global/size.js +1 -1
  66. package/build/lib/native/tokens/global/size.js.map +1 -1
  67. package/build/lib/native/utils/getFocusRingStyles/getFocusRingStyles.native.js.map +1 -1
  68. package/build/lib/web/development/components/Checkbox/Checkbox.js +17 -3
  69. package/build/lib/web/development/components/Checkbox/Checkbox.js.map +1 -1
  70. package/build/lib/web/development/components/Checkbox/CheckboxGroup/CheckboxGroup.js +2 -0
  71. package/build/lib/web/development/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
  72. package/build/lib/web/development/components/Checkbox/CheckboxIcon/CheckboxIcon.js +4 -0
  73. package/build/lib/web/development/components/Checkbox/CheckboxIcon/CheckboxIcon.js.map +1 -1
  74. package/build/lib/web/development/components/Checkbox/checkboxTokens.js +12 -4
  75. package/build/lib/web/development/components/Checkbox/checkboxTokens.js.map +1 -1
  76. package/build/lib/web/development/components/Form/CharacterCounter/CharacterCounter.js +5 -1
  77. package/build/lib/web/development/components/Form/CharacterCounter/CharacterCounter.js.map +1 -1
  78. package/build/lib/web/development/components/Form/FormHint.js +34 -17
  79. package/build/lib/web/development/components/Form/FormHint.js.map +1 -1
  80. package/build/lib/web/development/components/Form/FormLabel.js +10 -7
  81. package/build/lib/web/development/components/Form/FormLabel.js.map +1 -1
  82. package/build/lib/web/development/components/Form/Selector/SelectorSupportText.js +8 -2
  83. package/build/lib/web/development/components/Form/Selector/SelectorSupportText.js.map +1 -1
  84. package/build/lib/web/development/components/Form/Selector/SelectorTitle.js.map +1 -1
  85. package/build/lib/web/development/components/Form/formTokens.js +53 -0
  86. package/build/lib/web/development/components/Form/formTokens.js.map +1 -0
  87. package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +23 -37
  88. package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
  89. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +200 -155
  90. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
  91. package/build/lib/web/development/components/Input/BaseInput/BaseInputTagSlot.web.js +4 -3
  92. package/build/lib/web/development/components/Input/BaseInput/BaseInputTagSlot.web.js.map +1 -1
  93. package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js +101 -34
  94. package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  95. package/build/lib/web/development/components/Input/BaseInput/BaseInputWrapper.js +3 -7
  96. package/build/lib/web/development/components/Input/BaseInput/BaseInputWrapper.js.map +1 -1
  97. package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js +14 -5
  98. package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
  99. package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js +119 -67
  100. package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  101. package/build/lib/web/development/components/Input/BaseInput/baseInputTokens.js +88 -0
  102. package/build/lib/web/development/components/Input/BaseInput/baseInputTokens.js.map +1 -0
  103. package/build/lib/web/development/components/Input/BaseInput/getBaseInputBorderStyles.web.js +23 -0
  104. package/build/lib/web/development/components/Input/BaseInput/getBaseInputBorderStyles.web.js.map +1 -0
  105. package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +11 -6
  106. package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  107. package/build/lib/web/development/components/Input/OTPInput/OTPInput.js +9 -3
  108. package/build/lib/web/development/components/Input/OTPInput/OTPInput.js.map +1 -1
  109. package/build/lib/web/development/components/Input/PasswordInput/PasswordInput.js +5 -2
  110. package/build/lib/web/development/components/Input/PasswordInput/PasswordInput.js.map +1 -1
  111. package/build/lib/web/development/components/Input/TextArea/TextArea.js +7 -3
  112. package/build/lib/web/development/components/Input/TextArea/TextArea.js.map +1 -1
  113. package/build/lib/web/development/components/Input/TextInput/TextInput.js +17 -6
  114. package/build/lib/web/development/components/Input/TextInput/TextInput.js.map +1 -1
  115. package/build/lib/web/development/components/Radio/Radio.js +10 -3
  116. package/build/lib/web/development/components/Radio/Radio.js.map +1 -1
  117. package/build/lib/web/development/components/Radio/RadioGroup/RadioGroup.js +2 -0
  118. package/build/lib/web/development/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
  119. package/build/lib/web/development/components/Radio/radioTokens.js +13 -4
  120. package/build/lib/web/development/components/Radio/radioTokens.js.map +1 -1
  121. package/build/lib/web/development/components/Table/TableBody.web.js +3 -0
  122. package/build/lib/web/development/components/Table/TableBody.web.js.map +1 -1
  123. package/build/lib/web/development/components/Tag/AnimatedTag.web.js +4 -1
  124. package/build/lib/web/development/components/Tag/AnimatedTag.web.js.map +1 -1
  125. package/build/lib/web/development/components/Tag/Tag.js +2 -2
  126. package/build/lib/web/development/components/Tag/Tag.js.map +1 -1
  127. package/build/lib/web/development/components/Tag/getTagsGroup.js +4 -1
  128. package/build/lib/web/development/components/Tag/getTagsGroup.js.map +1 -1
  129. package/build/lib/web/development/components/Typography/Heading/Heading.js +3 -3
  130. package/build/lib/web/development/components/Typography/Heading/Heading.js.map +1 -1
  131. package/build/lib/web/development/components/Typography/Heading/getHeadingStyles.js +22 -0
  132. package/build/lib/web/development/components/Typography/Heading/getHeadingStyles.js.map +1 -0
  133. package/build/lib/web/development/components/Typography/Heading/index.js +1 -1
  134. package/build/lib/web/development/components/Typography/Text/Text.js +8 -3
  135. package/build/lib/web/development/components/Typography/Text/Text.js.map +1 -1
  136. package/build/lib/web/development/components/index.js +1 -1
  137. package/build/lib/web/development/tokens/global/size.js +2 -0
  138. package/build/lib/web/development/tokens/global/size.js.map +1 -1
  139. package/build/lib/web/development/utils/getFocusRingStyles/getFocusRingStyles.web.js +1 -0
  140. package/build/lib/web/development/utils/getFocusRingStyles/getFocusRingStyles.web.js.map +1 -1
  141. package/build/lib/web/production/components/Checkbox/Checkbox.js +17 -3
  142. package/build/lib/web/production/components/Checkbox/Checkbox.js.map +1 -1
  143. package/build/lib/web/production/components/Checkbox/CheckboxGroup/CheckboxGroup.js +2 -0
  144. package/build/lib/web/production/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
  145. package/build/lib/web/production/components/Checkbox/CheckboxIcon/CheckboxIcon.js +4 -0
  146. package/build/lib/web/production/components/Checkbox/CheckboxIcon/CheckboxIcon.js.map +1 -1
  147. package/build/lib/web/production/components/Checkbox/checkboxTokens.js +12 -4
  148. package/build/lib/web/production/components/Checkbox/checkboxTokens.js.map +1 -1
  149. package/build/lib/web/production/components/Form/CharacterCounter/CharacterCounter.js +5 -1
  150. package/build/lib/web/production/components/Form/CharacterCounter/CharacterCounter.js.map +1 -1
  151. package/build/lib/web/production/components/Form/FormHint.js +34 -17
  152. package/build/lib/web/production/components/Form/FormHint.js.map +1 -1
  153. package/build/lib/web/production/components/Form/FormLabel.js +10 -7
  154. package/build/lib/web/production/components/Form/FormLabel.js.map +1 -1
  155. package/build/lib/web/production/components/Form/Selector/SelectorSupportText.js +8 -2
  156. package/build/lib/web/production/components/Form/Selector/SelectorSupportText.js.map +1 -1
  157. package/build/lib/web/production/components/Form/Selector/SelectorTitle.js.map +1 -1
  158. package/build/lib/web/production/components/Form/formTokens.js +53 -0
  159. package/build/lib/web/production/components/Form/formTokens.js.map +1 -0
  160. package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +23 -37
  161. package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
  162. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +200 -155
  163. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
  164. package/build/lib/web/production/components/Input/BaseInput/BaseInputTagSlot.web.js +4 -3
  165. package/build/lib/web/production/components/Input/BaseInput/BaseInputTagSlot.web.js.map +1 -1
  166. package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js +101 -34
  167. package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  168. package/build/lib/web/production/components/Input/BaseInput/BaseInputWrapper.js +3 -7
  169. package/build/lib/web/production/components/Input/BaseInput/BaseInputWrapper.js.map +1 -1
  170. package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js +14 -5
  171. package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
  172. package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js +119 -67
  173. package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  174. package/build/lib/web/production/components/Input/BaseInput/baseInputTokens.js +88 -0
  175. package/build/lib/web/production/components/Input/BaseInput/baseInputTokens.js.map +1 -0
  176. package/build/lib/web/production/components/Input/BaseInput/getBaseInputBorderStyles.web.js +23 -0
  177. package/build/lib/web/production/components/Input/BaseInput/getBaseInputBorderStyles.web.js.map +1 -0
  178. package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +11 -6
  179. package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  180. package/build/lib/web/production/components/Input/OTPInput/OTPInput.js +9 -3
  181. package/build/lib/web/production/components/Input/OTPInput/OTPInput.js.map +1 -1
  182. package/build/lib/web/production/components/Input/PasswordInput/PasswordInput.js +5 -2
  183. package/build/lib/web/production/components/Input/PasswordInput/PasswordInput.js.map +1 -1
  184. package/build/lib/web/production/components/Input/TextArea/TextArea.js +7 -3
  185. package/build/lib/web/production/components/Input/TextArea/TextArea.js.map +1 -1
  186. package/build/lib/web/production/components/Input/TextInput/TextInput.js +17 -6
  187. package/build/lib/web/production/components/Input/TextInput/TextInput.js.map +1 -1
  188. package/build/lib/web/production/components/Radio/Radio.js +10 -3
  189. package/build/lib/web/production/components/Radio/Radio.js.map +1 -1
  190. package/build/lib/web/production/components/Radio/RadioGroup/RadioGroup.js +2 -0
  191. package/build/lib/web/production/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
  192. package/build/lib/web/production/components/Radio/radioTokens.js +13 -4
  193. package/build/lib/web/production/components/Radio/radioTokens.js.map +1 -1
  194. package/build/lib/web/production/components/Table/TableBody.web.js +3 -0
  195. package/build/lib/web/production/components/Table/TableBody.web.js.map +1 -1
  196. package/build/lib/web/production/components/Tag/AnimatedTag.web.js +4 -1
  197. package/build/lib/web/production/components/Tag/AnimatedTag.web.js.map +1 -1
  198. package/build/lib/web/production/components/Tag/Tag.js +2 -2
  199. package/build/lib/web/production/components/Tag/Tag.js.map +1 -1
  200. package/build/lib/web/production/components/Tag/getTagsGroup.js +4 -1
  201. package/build/lib/web/production/components/Tag/getTagsGroup.js.map +1 -1
  202. package/build/lib/web/production/components/Typography/Heading/Heading.js +3 -3
  203. package/build/lib/web/production/components/Typography/Heading/Heading.js.map +1 -1
  204. package/build/lib/web/production/components/Typography/Heading/getHeadingStyles.js +22 -0
  205. package/build/lib/web/production/components/Typography/Heading/getHeadingStyles.js.map +1 -0
  206. package/build/lib/web/production/components/Typography/Heading/index.js +1 -1
  207. package/build/lib/web/production/components/Typography/Text/Text.js +8 -3
  208. package/build/lib/web/production/components/Typography/Text/Text.js.map +1 -1
  209. package/build/lib/web/production/components/index.js +1 -1
  210. package/build/lib/web/production/tokens/global/size.js +2 -0
  211. package/build/lib/web/production/tokens/global/size.js.map +1 -1
  212. package/build/lib/web/production/utils/getFocusRingStyles/getFocusRingStyles.web.js +1 -0
  213. package/build/lib/web/production/utils/getFocusRingStyles/getFocusRingStyles.web.js.map +1 -1
  214. package/build/types/components/index.d.ts +36 -15
  215. package/build/types/components/index.native.d.ts +36 -15
  216. package/build/types/tokens/index.d.ts +2 -0
  217. package/build/types/tokens/index.native.d.ts +2 -0
  218. package/package.json +1 -1
  219. package/build/lib/native/components/Input/BaseInput/BaseInputAnimatedBorder.native.js +0 -16
  220. package/build/lib/native/components/Input/BaseInput/BaseInputAnimatedBorder.native.js.map +0 -1
  221. package/build/lib/native/components/Input/BaseInput/baseInputConfig.js +0 -8
  222. package/build/lib/native/components/Input/BaseInput/baseInputConfig.js.map +0 -1
  223. package/build/lib/web/development/components/Input/BaseInput/BaseInputAnimatedBorder.web.js +0 -43
  224. package/build/lib/web/development/components/Input/BaseInput/BaseInputAnimatedBorder.web.js.map +0 -1
  225. package/build/lib/web/development/components/Input/BaseInput/baseInputConfig.js +0 -26
  226. package/build/lib/web/development/components/Input/BaseInput/baseInputConfig.js.map +0 -1
  227. package/build/lib/web/production/components/Input/BaseInput/BaseInputAnimatedBorder.web.js +0 -43
  228. package/build/lib/web/production/components/Input/BaseInput/BaseInputAnimatedBorder.web.js.map +0 -1
  229. package/build/lib/web/production/components/Input/BaseInput/baseInputConfig.js +0 -26
  230. package/build/lib/web/production/components/Input/BaseInput/baseInputConfig.js.map +0 -1
@@ -1,7 +1,8 @@
1
+ import React__default from 'react';
1
2
  import { BaseBox } from '../../Box/BaseBox/BaseBox.native.js';
2
3
  import '@babel/runtime/helpers/objectWithoutProperties';
3
4
  import '../../Typography/BaseText/BaseText.native.js';
4
- import 'react';
5
+ import { throwBladeError } from '../../../utils/logger/logger.js';
5
6
  import '@babel/runtime/helpers/slicedToArray';
6
7
  import 'react-native';
7
8
  import '../../../tokens/global/typography.js';
@@ -10,8 +11,9 @@ import '../../BladeProvider/useTheme.js';
10
11
  import { jsxs, jsx } from 'react/jsx-runtime';
11
12
  import { Text } from '../../Typography/Text/Text.js';
12
13
  import '../../Typography/Code/Code.js';
14
+ import { isValidAllowedChildren } from '../../../utils/isValidAllowedChildren/isValidAllowedChildren.js';
13
15
 
14
- var getVisualContainerStyles=function getVisualContainerStyles(){return {display:'flex',flexDirection:'row',alignItems:'center',alignSelf:'center'};};var getPrefixStyles=function getPrefixStyles(_ref){var hasLeadingIcon=_ref.hasLeadingIcon,hasPrefix=_ref.hasPrefix;if(hasPrefix&&hasLeadingIcon){return {paddingLeft:'spacing.2'};}if(hasPrefix&&!hasLeadingIcon){return {paddingLeft:'spacing.4'};}return {paddingLeft:'spacing.0'};};var getInteractionElementStyles=function getInteractionElementStyles(_ref2){var hasTrailingIcon=_ref2.hasTrailingIcon,hasInteractionElement=_ref2.hasInteractionElement,hasSuffix=_ref2.hasSuffix;if(hasInteractionElement&&(hasSuffix||hasTrailingIcon)){return {paddingRight:'spacing.2'};}if(hasInteractionElement&&!hasSuffix&&!hasTrailingIcon){return {paddingRight:'spacing.4'};}return {paddingRight:'spacing.0'};};var getSuffixStyles=function getSuffixStyles(_ref3){var hasTrailingIcon=_ref3.hasTrailingIcon,hasSuffix=_ref3.hasSuffix;if(hasSuffix&&hasTrailingIcon){return {paddingRight:'spacing.2'};}if(hasSuffix&&!hasTrailingIcon){return {paddingRight:'spacing.4'};}return {paddingRight:'spacing.0'};};var getInputVisualsToBeRendered=function getInputVisualsToBeRendered(_ref4){var leadingIcon=_ref4.leadingIcon,prefix=_ref4.prefix,interactionElement=_ref4.interactionElement,suffix=_ref4.suffix,trailingIcon=_ref4.trailingIcon;return {hasLeadingIcon:Boolean(leadingIcon),hasPrefix:Boolean(prefix),hasInteractionElement:Boolean(interactionElement),hasSuffix:Boolean(suffix),hasTrailingIcon:Boolean(trailingIcon)};};var BaseInputVisuals=function BaseInputVisuals(_ref5){var LeadingIcon=_ref5.leadingIcon,prefix=_ref5.prefix,interactionElement=_ref5.interactionElement,suffix=_ref5.suffix,TrailingIcon=_ref5.trailingIcon,isDisabled=_ref5.isDisabled;var _getInputVisualsToBeR=getInputVisualsToBeRendered({leadingIcon:LeadingIcon,prefix:prefix,interactionElement:interactionElement,suffix:suffix,trailingIcon:TrailingIcon}),hasLeadingIcon=_getInputVisualsToBeR.hasLeadingIcon,hasPrefix=_getInputVisualsToBeR.hasPrefix,hasInteractionElement=_getInputVisualsToBeR.hasInteractionElement,hasSuffix=_getInputVisualsToBeR.hasSuffix,hasTrailingIcon=_getInputVisualsToBeR.hasTrailingIcon;var hasLeadingVisuals=hasLeadingIcon||hasPrefix;var hasTrailingVisuals=hasInteractionElement||hasSuffix||hasTrailingIcon;if(hasLeadingVisuals){return jsxs(BaseBox,Object.assign({},getVisualContainerStyles(),{children:[LeadingIcon?jsx(BaseBox,{paddingLeft:"spacing.4",display:"flex",children:jsx(LeadingIcon,{size:"medium",color:isDisabled?'surface.icon.gray.disabled':'surface.icon.gray.subtle'})}):null,hasPrefix?jsx(BaseBox,Object.assign({},getPrefixStyles({hasLeadingIcon:hasLeadingIcon,hasPrefix:hasPrefix}),{children:jsx(Text,{size:"medium",variant:"body",weight:"regular",color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.subtle',children:prefix})})):null]}));}if(hasTrailingVisuals){return jsxs(BaseBox,Object.assign({alignSelf:"stretch",alignItems:"stretch"},getVisualContainerStyles(),{children:[hasInteractionElement?jsx(BaseBox,Object.assign({},getInteractionElementStyles({hasTrailingIcon:hasTrailingIcon,hasInteractionElement:hasInteractionElement,hasSuffix:hasSuffix}),{display:"flex",alignItems:"stretch",alignSelf:"stretch",children:interactionElement})):null,hasSuffix?jsx(BaseBox,Object.assign({},getSuffixStyles({hasTrailingIcon:hasTrailingIcon,hasSuffix:hasSuffix}),{children:jsx(Text,{size:"medium",variant:"body",weight:"regular",color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.subtle',children:suffix})})):null,TrailingIcon?jsx(BaseBox,{paddingRight:"spacing.4",display:"flex",children:jsx(TrailingIcon,{size:"medium",color:isDisabled?'interactive.icon.gray.disabled':'interactive.icon.gray.muted'})}):null]}));}return null;};
16
+ var getVisualContainerStyles=function getVisualContainerStyles(){return {display:'flex',flexDirection:'row',alignItems:'center',alignSelf:'center'};};var trailingIconColor={none:'surface.icon.gray.subtle',error:'feedback.icon.negative.intense',success:'feedback.icon.positive.intense'};var iconSize={medium:'medium',large:'large'};var textSize={medium:'medium',large:'large'};var getPrefixStyles=function getPrefixStyles(_ref){var hasLeadingIcon=_ref.hasLeadingIcon,hasPrefix=_ref.hasPrefix;if(hasPrefix&&hasLeadingIcon){return {paddingLeft:'spacing.3'};}if(hasPrefix&&!hasLeadingIcon){return {paddingLeft:'spacing.4'};}return {paddingLeft:'spacing.0'};};var getInteractionElementStyles=function getInteractionElementStyles(_ref2){var hasTrailingIcon=_ref2.hasTrailingIcon,hasInteractionElement=_ref2.hasInteractionElement,hasSuffix=_ref2.hasSuffix,hasTrailingButton=_ref2.hasTrailingButton;if(hasInteractionElement&&(hasSuffix||hasTrailingIcon||hasTrailingButton)){return {paddingRight:'spacing.2'};}if(hasInteractionElement&&!hasSuffix&&!hasTrailingIcon&&!hasTrailingButton){return {paddingRight:'spacing.4'};}return {paddingRight:'spacing.0'};};var getSuffixStyles=function getSuffixStyles(_ref3){var hasTrailingIcon=_ref3.hasTrailingIcon,hasSuffix=_ref3.hasSuffix,hasTrailingButton=_ref3.hasTrailingButton;if(hasSuffix&&(hasTrailingIcon||hasTrailingButton)){return {paddingRight:'spacing.3'};}if(hasSuffix&&!hasTrailingIcon&&!hasTrailingButton){return {paddingRight:'spacing.4'};}return {paddingRight:'spacing.0'};};var getTrailingIconStyles=function getTrailingIconStyles(_ref4){var hasTrailingIcon=_ref4.hasTrailingIcon,hasTrailingButton=_ref4.hasTrailingButton;if(hasTrailingIcon&&hasTrailingButton){return {paddingRight:'spacing.3'};}if(hasTrailingIcon&&!hasTrailingButton){return {paddingRight:'spacing.4'};}return {paddingRight:'spacing.0'};};var getInputVisualsToBeRendered=function getInputVisualsToBeRendered(_ref5){var leadingIcon=_ref5.leadingIcon,prefix=_ref5.prefix,interactionElement=_ref5.interactionElement,suffix=_ref5.suffix,trailingIcon=_ref5.trailingIcon,trailingButton=_ref5.trailingButton;return {hasLeadingIcon:Boolean(leadingIcon),hasPrefix:Boolean(prefix),hasInteractionElement:Boolean(interactionElement),hasSuffix:Boolean(suffix),hasTrailingIcon:Boolean(trailingIcon),hasTrailingButton:Boolean(trailingButton)};};var BaseInputVisuals=function BaseInputVisuals(_ref6){var LeadingIcon=_ref6.leadingIcon,prefix=_ref6.prefix,interactionElement=_ref6.interactionElement,suffix=_ref6.suffix,TrailingIcon=_ref6.trailingIcon,isDisabled=_ref6.isDisabled,_ref6$validationState=_ref6.validationState,validationState=_ref6$validationState===void 0?'none':_ref6$validationState,size=_ref6.size,TrailingButton=_ref6.trailingButton;var _getInputVisualsToBeR=getInputVisualsToBeRendered({leadingIcon:LeadingIcon,prefix:prefix,interactionElement:interactionElement,suffix:suffix,trailingIcon:TrailingIcon,trailingButton:TrailingButton,size:size}),hasLeadingIcon=_getInputVisualsToBeR.hasLeadingIcon,hasPrefix=_getInputVisualsToBeR.hasPrefix,hasInteractionElement=_getInputVisualsToBeR.hasInteractionElement,hasSuffix=_getInputVisualsToBeR.hasSuffix,hasTrailingIcon=_getInputVisualsToBeR.hasTrailingIcon,hasTrailingButton=_getInputVisualsToBeR.hasTrailingButton;var hasLeadingVisuals=hasLeadingIcon||hasPrefix;var hasTrailingVisuals=hasInteractionElement||hasSuffix||hasTrailingIcon||hasTrailingButton;if(__DEV__){if(hasTrailingButton&&!isValidAllowedChildren(TrailingButton,'Link')){throwBladeError({message:'trailingButton must be a valid Blade Link component',moduleName:'BaseInput'});}}if(hasLeadingVisuals){return jsxs(BaseBox,Object.assign({},getVisualContainerStyles(),{children:[LeadingIcon?jsx(BaseBox,{paddingLeft:"spacing.4",display:"flex",children:jsx(LeadingIcon,{size:iconSize[size],color:isDisabled?'surface.icon.gray.disabled':'surface.icon.gray.subtle'})}):null,hasPrefix?jsx(BaseBox,Object.assign({},getPrefixStyles({hasLeadingIcon:hasLeadingIcon,hasPrefix:hasPrefix}),{children:jsx(Text,{size:textSize[size],variant:"body",weight:"regular",color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.subtle',children:prefix})})):null]}));}if(hasTrailingVisuals){return jsxs(BaseBox,Object.assign({alignSelf:"stretch",alignItems:"stretch"},getVisualContainerStyles(),{children:[hasInteractionElement?jsx(BaseBox,Object.assign({},getInteractionElementStyles({hasTrailingIcon:hasTrailingIcon,hasInteractionElement:hasInteractionElement,hasSuffix:hasSuffix,hasTrailingButton:hasTrailingButton}),{display:"flex",alignItems:"stretch",alignSelf:"stretch",children:interactionElement})):null,hasSuffix?jsx(BaseBox,Object.assign({},getSuffixStyles({hasTrailingIcon:hasTrailingIcon,hasSuffix:hasSuffix,hasTrailingButton:hasTrailingButton}),{children:jsx(Text,{size:textSize[size],variant:"body",weight:"regular",color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.subtle',children:suffix})})):null,TrailingIcon?jsx(BaseBox,Object.assign({display:"flex"},getTrailingIconStyles({hasTrailingIcon:hasTrailingIcon,hasTrailingButton:hasTrailingButton}),{children:jsx(TrailingIcon,{size:iconSize[size],color:isDisabled?'interactive.icon.gray.disabled':trailingIconColor[validationState]})})):null,TrailingButton?jsx(BaseBox,{paddingRight:"spacing.4",display:"flex",children:React__default.cloneElement(TrailingButton,{size:size,variant:'button',isDisabled:isDisabled})}):null]}));}return null;};
15
17
 
16
18
  export { BaseInputVisuals, getInputVisualsToBeRendered };
17
19
  //# sourceMappingURL=BaseInputVisuals.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseInputVisuals.js","sources":["../../../../../../src/components/Input/BaseInput/BaseInputVisuals.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport type { ReactElement } from 'react';\nimport type { BaseInputProps } from './BaseInput';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport type { BaseBoxProps } from '~components/Box/BaseBox';\n\ntype InputVisuals = Pick<\n BaseInputProps,\n 'leadingIcon' | 'prefix' | 'interactionElement' | 'suffix' | 'trailingIcon' | 'isDisabled'\n>;\n\nconst getVisualContainerStyles = (): Pick<\n BaseBoxProps,\n 'display' | 'flexDirection' | 'alignItems' | 'alignSelf'\n> => ({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n alignSelf: 'center',\n});\n\nconst getPrefixStyles = ({\n hasLeadingIcon,\n hasPrefix,\n}: {\n hasLeadingIcon: boolean;\n hasPrefix: boolean;\n}): Pick<BaseBoxProps, 'paddingLeft'> => {\n if (hasPrefix && hasLeadingIcon) {\n return {\n paddingLeft: 'spacing.2',\n };\n }\n\n if (hasPrefix && !hasLeadingIcon) {\n return {\n paddingLeft: 'spacing.4',\n };\n }\n\n return {\n paddingLeft: 'spacing.0',\n };\n};\n\nconst getInteractionElementStyles = ({\n hasTrailingIcon,\n hasInteractionElement,\n hasSuffix,\n}: {\n hasTrailingIcon: boolean;\n hasInteractionElement: boolean;\n hasSuffix: boolean;\n}): Pick<BaseBoxProps, 'paddingRight'> => {\n if (hasInteractionElement && (hasSuffix || hasTrailingIcon)) {\n return {\n paddingRight: 'spacing.2',\n };\n }\n\n if (hasInteractionElement && !hasSuffix && !hasTrailingIcon) {\n return {\n paddingRight: 'spacing.4',\n };\n }\n\n return {\n paddingRight: 'spacing.0',\n };\n};\n\nconst getSuffixStyles = ({\n hasTrailingIcon,\n hasSuffix,\n}: {\n hasTrailingIcon: boolean;\n hasSuffix: boolean;\n}): Pick<BaseBoxProps, 'paddingRight'> => {\n if (hasSuffix && hasTrailingIcon) {\n return {\n paddingRight: 'spacing.2',\n };\n }\n\n if (hasSuffix && !hasTrailingIcon) {\n return {\n paddingRight: 'spacing.4',\n };\n }\n\n return {\n paddingRight: 'spacing.0',\n };\n};\n\nexport const getInputVisualsToBeRendered = ({\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n}: InputVisuals) => ({\n hasLeadingIcon: Boolean(leadingIcon),\n hasPrefix: Boolean(prefix),\n hasInteractionElement: Boolean(interactionElement),\n hasSuffix: Boolean(suffix),\n hasTrailingIcon: Boolean(trailingIcon),\n});\n\nexport const BaseInputVisuals = ({\n leadingIcon: LeadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon: TrailingIcon,\n isDisabled,\n}: InputVisuals): ReactElement | null => {\n const {\n hasLeadingIcon,\n hasPrefix,\n hasInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n } = getInputVisualsToBeRendered({\n leadingIcon: LeadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon: TrailingIcon,\n });\n\n const hasLeadingVisuals = hasLeadingIcon || hasPrefix;\n const hasTrailingVisuals = hasInteractionElement || hasSuffix || hasTrailingIcon;\n\n if (hasLeadingVisuals) {\n return (\n <BaseBox {...getVisualContainerStyles()}>\n {LeadingIcon ? (\n <BaseBox paddingLeft=\"spacing.4\" display=\"flex\">\n <LeadingIcon\n size=\"medium\"\n color={isDisabled ? 'surface.icon.gray.disabled' : 'surface.icon.gray.subtle'}\n />\n </BaseBox>\n ) : null}\n {hasPrefix ? (\n <BaseBox {...getPrefixStyles({ hasLeadingIcon, hasPrefix })}>\n <Text\n size=\"medium\"\n variant=\"body\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle'}\n >\n {prefix}\n </Text>\n </BaseBox>\n ) : null}\n </BaseBox>\n );\n }\n\n if (hasTrailingVisuals) {\n return (\n <BaseBox alignSelf=\"stretch\" alignItems=\"stretch\" {...getVisualContainerStyles()}>\n {hasInteractionElement ? (\n <BaseBox\n {...getInteractionElementStyles({ hasTrailingIcon, hasInteractionElement, hasSuffix })}\n display=\"flex\"\n alignItems=\"stretch\"\n alignSelf=\"stretch\"\n >\n {interactionElement}\n </BaseBox>\n ) : null}\n {hasSuffix ? (\n <BaseBox {...getSuffixStyles({ hasTrailingIcon, hasSuffix })}>\n <Text\n size=\"medium\"\n variant=\"body\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle'}\n >\n {suffix}\n </Text>\n </BaseBox>\n ) : null}\n {TrailingIcon ? (\n <BaseBox paddingRight=\"spacing.4\" display=\"flex\">\n {\n <TrailingIcon\n size=\"medium\"\n color={\n isDisabled ? 'interactive.icon.gray.disabled' : 'interactive.icon.gray.muted'\n }\n />\n }\n </BaseBox>\n ) : null}\n </BaseBox>\n );\n }\n\n return null;\n};\n"],"names":["getVisualContainerStyles","display","flexDirection","alignItems","alignSelf","getPrefixStyles","_ref","hasLeadingIcon","hasPrefix","paddingLeft","getInteractionElementStyles","_ref2","hasTrailingIcon","hasInteractionElement","hasSuffix","paddingRight","getSuffixStyles","_ref3","getInputVisualsToBeRendered","_ref4","leadingIcon","prefix","interactionElement","suffix","trailingIcon","Boolean","BaseInputVisuals","_ref5","LeadingIcon","TrailingIcon","isDisabled","_getInputVisualsToBeR","hasLeadingVisuals","hasTrailingVisuals","_jsxs","BaseBox","Object","assign","children","_jsx","size","color","Text","variant","weight"],"mappings":";;;;;;;;;;;;;AAYA,IAAMA,wBAAwB,CAAG,SAA3BA,wBAAwBA,UAGxB,CACJC,OAAO,CAAE,MAAM,CACfC,aAAa,CAAE,KAAK,CACpBC,UAAU,CAAE,QAAQ,CACpBC,SAAS,CAAE,QACb,CAAC,EAAC,CAEF,IAAMC,eAAe,CAAG,SAAlBA,eAAeA,CAAAC,IAAA,CAMoB,CALvC,IAAAC,cAAc,CAAAD,IAAA,CAAdC,cAAc,CACdC,SAAS,CAAAF,IAAA,CAATE,SAAS,CAKT,GAAIA,SAAS,EAAID,cAAc,CAAE,CAC/B,OAAO,CACLE,WAAW,CAAE,WACf,CAAC,CACH,CAEA,GAA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C,MAAA,CAAAC,MAAA,CAAKrB,EAAAA,CAAAA,eAAe,CAAC,CAAEJ,eAAe,CAAfA,eAAe,CAAEE,SAAS,CAATA,SAAU,CAAC,CAAC,EAAAwB,QAAA,CAC1DC,GAAA,CAACG,IAAI,EACHF,IAAI,CAAC,QAAQ,CACbG,OAAO,CAAC,MAAM,CACdC,MAAM,CAAC,SAAS,CAChBH,KAAK,CAAEX,UAAU,CAAG,4BAA4B,CAAG,0BAA2B,CAAAQ,QAAA,CAE7Ef,MAAM,CACH,CAAC,CAAA,CACA,CAAC,CACR,IAAI,CACPM,YAAY,CACXU,GAAA,CAACJ,OAAO,CAACpB,CAAAA,YAAY,CAAC,WAAW,CAACd,OAAO,CAAC,MAAM,CAAAqC,QAAA,CAE5CC,GAAA,CAACV,YAAY,EACXW,IAAI,CAAC,QAAQ,CACbC,KAAK,CACHX,UAAU,CAAG,gCAAgC,CAAG,6BACjD,CACF,CAAC,CAEG,CAAC,CACR,IAAI,GACD,CAAC,CAEd,CAEA,OAAO,IAAI,CACb;;;;"}
1
+ {"version":3,"file":"BaseInputVisuals.js","sources":["../../../../../../src/components/Input/BaseInput/BaseInputVisuals.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport React from 'react';\nimport type { ReactElement } from 'react';\nimport type { BaseInputProps } from './BaseInput';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport type { BaseBoxProps } from '~components/Box/BaseBox';\nimport type { IconColors } from '~components/Icons';\nimport { isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\n\ntype InputVisuals = Pick<\n BaseInputProps,\n | 'leadingIcon'\n | 'prefix'\n | 'interactionElement'\n | 'suffix'\n | 'trailingIcon'\n | 'isDisabled'\n | 'validationState'\n | 'size'\n | 'trailingButton'\n> & {\n size: NonNullable<BaseInputProps['size']>;\n};\n\nconst getVisualContainerStyles = (): Pick<\n BaseBoxProps,\n 'display' | 'flexDirection' | 'alignItems' | 'alignSelf'\n> => ({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n alignSelf: 'center',\n});\n\nconst trailingIconColor: Record<NonNullable<InputVisuals['validationState']>, IconColors> = {\n none: 'surface.icon.gray.subtle',\n error: 'feedback.icon.negative.intense',\n success: 'feedback.icon.positive.intense',\n};\n\nconst iconSize = {\n medium: 'medium',\n large: 'large',\n} as const;\n\nconst textSize = {\n medium: 'medium',\n large: 'large',\n} as const;\n\nconst getPrefixStyles = ({\n hasLeadingIcon,\n hasPrefix,\n}: {\n hasLeadingIcon: boolean;\n hasPrefix: boolean;\n}): Pick<BaseBoxProps, 'paddingLeft'> => {\n if (hasPrefix && hasLeadingIcon) {\n return {\n paddingLeft: 'spacing.3',\n };\n }\n\n if (hasPrefix && !hasLeadingIcon) {\n return {\n paddingLeft: 'spacing.4',\n };\n }\n\n return {\n paddingLeft: 'spacing.0',\n };\n};\n\nconst getInteractionElementStyles = ({\n hasTrailingIcon,\n hasInteractionElement,\n hasSuffix,\n hasTrailingButton,\n}: {\n hasTrailingIcon: boolean;\n hasInteractionElement: boolean;\n hasSuffix: boolean;\n hasTrailingButton: boolean;\n}): Pick<BaseBoxProps, 'paddingRight'> => {\n if (hasInteractionElement && (hasSuffix || hasTrailingIcon || hasTrailingButton)) {\n return {\n paddingRight: 'spacing.2',\n };\n }\n\n if (hasInteractionElement && !hasSuffix && !hasTrailingIcon && !hasTrailingButton) {\n return {\n paddingRight: 'spacing.4',\n };\n }\n\n return {\n paddingRight: 'spacing.0',\n };\n};\n\nconst getSuffixStyles = ({\n hasTrailingIcon,\n hasSuffix,\n hasTrailingButton,\n}: {\n hasTrailingIcon: boolean;\n hasSuffix: boolean;\n hasTrailingButton: boolean;\n}): Pick<BaseBoxProps, 'paddingRight'> => {\n if (hasSuffix && (hasTrailingIcon || hasTrailingButton)) {\n return {\n paddingRight: 'spacing.3',\n };\n }\n\n if (hasSuffix && !hasTrailingIcon && !hasTrailingButton) {\n return {\n paddingRight: 'spacing.4',\n };\n }\n\n return {\n paddingRight: 'spacing.0',\n };\n};\n\nconst getTrailingIconStyles = ({\n hasTrailingIcon,\n hasTrailingButton,\n}: {\n hasTrailingIcon: boolean;\n hasTrailingButton: boolean;\n}): Pick<BaseBoxProps, 'paddingRight'> => {\n if (hasTrailingIcon && hasTrailingButton) {\n return {\n paddingRight: 'spacing.3',\n };\n }\n\n if (hasTrailingIcon && !hasTrailingButton) {\n return {\n paddingRight: 'spacing.4',\n };\n }\n\n return {\n paddingRight: 'spacing.0',\n };\n};\n\nexport const getInputVisualsToBeRendered = ({\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n trailingButton,\n}: InputVisuals) => ({\n hasLeadingIcon: Boolean(leadingIcon),\n hasPrefix: Boolean(prefix),\n hasInteractionElement: Boolean(interactionElement),\n hasSuffix: Boolean(suffix),\n hasTrailingIcon: Boolean(trailingIcon),\n hasTrailingButton: Boolean(trailingButton),\n});\n\nexport const BaseInputVisuals = ({\n leadingIcon: LeadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon: TrailingIcon,\n isDisabled,\n validationState = 'none',\n size,\n trailingButton: TrailingButton,\n}: InputVisuals): ReactElement | null => {\n const {\n hasLeadingIcon,\n hasPrefix,\n hasInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n hasTrailingButton,\n } = getInputVisualsToBeRendered({\n leadingIcon: LeadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon: TrailingIcon,\n trailingButton: TrailingButton,\n size,\n });\n\n const hasLeadingVisuals = hasLeadingIcon || hasPrefix;\n const hasTrailingVisuals =\n hasInteractionElement || hasSuffix || hasTrailingIcon || hasTrailingButton;\n\n if (__DEV__) {\n if (hasTrailingButton && !isValidAllowedChildren(TrailingButton, 'Link')) {\n throwBladeError({\n message: 'trailingButton must be a valid Blade Link component',\n moduleName: 'BaseInput',\n });\n }\n }\n\n if (hasLeadingVisuals) {\n return (\n <BaseBox {...getVisualContainerStyles()}>\n {LeadingIcon ? (\n <BaseBox paddingLeft=\"spacing.4\" display=\"flex\">\n <LeadingIcon\n size={iconSize[size]}\n color={isDisabled ? 'surface.icon.gray.disabled' : 'surface.icon.gray.subtle'}\n />\n </BaseBox>\n ) : null}\n {hasPrefix ? (\n <BaseBox {...getPrefixStyles({ hasLeadingIcon, hasPrefix })}>\n <Text\n size={textSize[size]}\n variant=\"body\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle'}\n >\n {prefix}\n </Text>\n </BaseBox>\n ) : null}\n </BaseBox>\n );\n }\n\n if (hasTrailingVisuals) {\n return (\n <BaseBox alignSelf=\"stretch\" alignItems=\"stretch\" {...getVisualContainerStyles()}>\n {hasInteractionElement ? (\n <BaseBox\n {...getInteractionElementStyles({\n hasTrailingIcon,\n hasInteractionElement,\n hasSuffix,\n hasTrailingButton,\n })}\n display=\"flex\"\n alignItems=\"stretch\"\n alignSelf=\"stretch\"\n >\n {interactionElement}\n </BaseBox>\n ) : null}\n {hasSuffix ? (\n <BaseBox {...getSuffixStyles({ hasTrailingIcon, hasSuffix, hasTrailingButton })}>\n <Text\n size={textSize[size]}\n variant=\"body\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle'}\n >\n {suffix}\n </Text>\n </BaseBox>\n ) : null}\n {TrailingIcon ? (\n <BaseBox\n display=\"flex\"\n {...getTrailingIconStyles({ hasTrailingIcon, hasTrailingButton })}\n >\n {\n <TrailingIcon\n size={iconSize[size]}\n color={\n isDisabled ? 'interactive.icon.gray.disabled' : trailingIconColor[validationState]\n }\n />\n }\n </BaseBox>\n ) : null}\n {TrailingButton ? (\n <BaseBox paddingRight=\"spacing.4\" display=\"flex\">\n {React.cloneElement(TrailingButton, {\n size,\n variant: 'button',\n isDisabled,\n })}\n </BaseBox>\n ) : null}\n </BaseBox>\n );\n }\n\n return null;\n};\n"],"names":["getVisualContainerStyles","display","flexDirection","alignItems","alignSelf","trailingIconColor","none","error","success","iconSize","medium","large","textSize","getPrefixStyles","_ref","hasLeadingIcon","hasPrefix","paddingLeft","getInteractionElementStyles","_ref2","hasTrailingIcon","hasInteractionElement","hasSuffix","hasTrailingButton","paddingRight","getSuffixStyles","_ref3","getTrailingIconStyles","_ref4","getInputVisualsToBeRendered","_ref5","leadingIcon","prefix","interactionElement","suffix","trailingIcon","trailingButton","Boolean","BaseInputVisuals","_ref6","LeadingIcon","TrailingIcon","isDisabled","_ref6$validationState","validationState","size","TrailingButton","_getInputVisualsToBeR","hasLeadingVisuals","hasTrailingVisuals","__DEV__","isValidAllowedChildren","throwBladeError","message","moduleName","_jsxs","BaseBox","Object","assign","children","_jsx","color","Text","variant","weight","React","cloneElement"],"mappings":";;;;;;;;;;;;;;;AA0BA,IAAMA,wBAAwB,CAAG,SAA3BA,wBAAwBA,EAAA,CAAA,OAGxB,CACJC,OAAO,CAAE,MAAM,CACfC,aAAa,CAAE,KAAK,CACpBC,UAAU,CAAE,QAAQ,CACpBC,SAAS,CAAE,QACb,CAAC,CAAA,CAAC,CAEF,IAAMC,iBAAmF,CAAG,CAC1FC,IAAI,CAAE,0BAA0B,CAChCC,KAAK,CAAE,gCAAgC,CACvCC,OAAO,CAAE,gCACX,CAAC,CAED,IAAMC,QAAQ,CAAG,CACfC,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,OACT,CAAU,CAEV,IAAMC,QAAQ,CAAG,CACfF,MAAM,CAAE,QAAQ,CAChBC,KAAK,CAAE,OACT,CAAU,CAEV,IAAME,eAAe,CAAG,SAAlBA,eAAeA,CAAAC,IAAA,CAMoB,CAAA,IALvCC,cAAc,CAAAD,IAAA,CAAdC,cAAc,CACdC,SAAS,CAAAF,IAAA,CAATE,SAAS,CAKT,GAAIA,SAAS,EAAID,cAAc,CAAE,CAC/B,OAAO,CACLE,WAAW,CAAE,WACf,CAAC,CACH,CAEA,GAAID,SAAS,EAAI,CAACD,cAAc,CAAE,CAChC,OAA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ithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
2
2
  import React__default from 'react';
3
- import { BaseInputAnimatedBorder } from './BaseInputAnimatedBorder.native.js';
4
3
  import { AnimatedBaseInputWrapper } from './AnimatedBaseInputWrapper.native.js';
5
- import { jsxs, jsx } from 'react/jsx-runtime';
4
+ import { jsx } from 'react/jsx-runtime';
6
5
 
7
- var _excluded=["children","validationState","currentInteraction","isLabelLeftPositioned","isTextArea","showAllTags","setShowAllTagsWithAnimation","maxTagRows"];var _BaseInputWrapper=function _BaseInputWrapper(_ref,ref){var children=_ref.children,validationState=_ref.validationState,currentInteraction=_ref.currentInteraction;_ref.isLabelLeftPositioned;var isTextArea=_ref.isTextArea,showAllTags=_ref.showAllTags,setShowAllTagsWithAnimation=_ref.setShowAllTagsWithAnimation,maxTagRows=_ref.maxTagRows,props=_objectWithoutProperties(_ref,_excluded);return jsxs(AnimatedBaseInputWrapper,Object.assign({ref:ref,isTextArea:isTextArea,validationState:validationState,currentInteraction:currentInteraction,showAllTags:showAllTags,maxTagRows:maxTagRows,setShowAllTagsWithAnimation:setShowAllTagsWithAnimation},props,{children:[children,jsx(BaseInputAnimatedBorder,{currentInteraction:currentInteraction,validationState:validationState})]}));};var BaseInputWrapper=React__default.forwardRef(_BaseInputWrapper);
6
+ var _excluded=["children","validationState","currentInteraction","isLabelLeftPositioned","isTextArea","showAllTags","setShowAllTagsWithAnimation","maxTagRows"];var _BaseInputWrapper=function _BaseInputWrapper(_ref,ref){var children=_ref.children,validationState=_ref.validationState,currentInteraction=_ref.currentInteraction;_ref.isLabelLeftPositioned;var isTextArea=_ref.isTextArea,showAllTags=_ref.showAllTags,setShowAllTagsWithAnimation=_ref.setShowAllTagsWithAnimation,maxTagRows=_ref.maxTagRows,props=_objectWithoutProperties(_ref,_excluded);return jsx(AnimatedBaseInputWrapper,Object.assign({ref:ref,isTextArea:isTextArea,validationState:validationState,currentInteraction:currentInteraction,showAllTags:showAllTags,maxTagRows:maxTagRows,setShowAllTagsWithAnimation:setShowAllTagsWithAnimation},props,{children:children}));};var BaseInputWrapper=React__default.forwardRef(_BaseInputWrapper);
8
7
 
9
8
  export { BaseInputWrapper };
10
9
  //# sourceMappingURL=BaseInputWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseInputWrapper.js","sources":["../../../../../../src/components/Input/BaseInput/BaseInputWrapper.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport React from 'react';\nimport type { BaseInputProps } from './BaseInput';\nimport { BaseInputAnimatedBorder } from './BaseInputAnimatedBorder';\nimport { AnimatedBaseInputWrapper } from './AnimatedBaseInputWrapper';\nimport type { ContainerElementType } from '~utils/types';\nimport type { ActionStates } from '~utils/useInteraction';\n\ntype BaseInputWrapperProps = Pick<\n BaseInputProps,\n | 'isDisabled'\n | 'validationState'\n | 'showAllTags'\n | 'maxTagRows'\n | 'setInputWrapperRef'\n | 'isDropdownTrigger'\n> & {\n isFocused?: boolean;\n isLabelLeftPositioned?: boolean;\n currentInteraction: ActionStates;\n isTextArea?: boolean;\n setShowAllTagsWithAnimation: (showAllTagsWithAnimation: boolean) => void;\n children: React.ReactNode;\n};\n\nconst _BaseInputWrapper: React.ForwardRefRenderFunction<\n ContainerElementType,\n BaseInputWrapperProps & {\n children: ReactNode;\n }\n> = (\n {\n children,\n validationState,\n currentInteraction,\n isLabelLeftPositioned,\n isTextArea,\n showAllTags,\n setShowAllTagsWithAnimation,\n maxTagRows,\n ...props\n },\n ref,\n): ReactElement => {\n return (\n <AnimatedBaseInputWrapper\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unnecessary-type-assertion\n ref={ref as any}\n isTextArea={isTextArea}\n validationState={validationState}\n currentInteraction={currentInteraction}\n showAllTags={showAllTags}\n maxTagRows={maxTagRows}\n setShowAllTagsWithAnimation={setShowAllTagsWithAnimation}\n {...props}\n >\n {children}\n <BaseInputAnimatedBorder\n currentInteraction={currentInteraction}\n validationState={validationState}\n />\n </AnimatedBaseInputWrapper>\n );\n};\n\nexport const BaseInputWrapper = React.forwardRef(_BaseInputWrapper);\n"],"names":["_BaseInputWrapper","_ref","ref","children","validationState","currentInteraction","isLabelLeftPositioned","isTextArea","showAllTags","setShowAllTagsWithAnimation","maxTagRows","props","_objectWithoutProperties","_excluded","_jsxs","AnimatedBaseInputWrapper","Object","assign","_jsx","BaseInputAnimatedBorder","BaseInputWrapper","React","forwardRef"],"mappings":";;;;;;AACA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,iBAAA,CAAA,oBAAA,CAAA,uBAAA,CAAA,YAAA,CAAA,aAAA,CAAA,6BAAA,CAAA,YAAA,CAAA,CAwBA,IAAMA,iBAKL,CAAG,SALEA,iBAKLA,CAAAC,IAAA,CAYCC,GAAG,CACc,CAXf,IAAAC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACRC,eAAe,CAAAH,IAAA,CAAfG,eAAe,CACfC,kBAAkB,CAAAJ,IAAA,CAAlBI,kBAAkB,CACGJ,IAAA,CAArBK,qBAAqB,KACrBC,UAAU,CAAAN,IAAA,CAAVM,UAAU,CACVC,WAAW,CAAAP,IAAA,CAAXO,WAAW,CACXC,2BAA2B,CAAAR,IAAA,CAA3BQ,2BAA2B,CAC3BC,UAAU,CAAAT,IAAA,CAAVS,UAAU,CACPC,KAAK,CAAAC,wBAAA,CAAAX,IAAA,CAAAY,SAAA,EAIV,OACEC,IAAA,CAACC,wBAAwB,CAAAC,MAAA,CAAAC,MAAA,CAEvBf,CAAAA,GAAG,CAAEA,GAAW,CAChBK,UAAU,CAAEA,UAAW,CACvBH,eAAe,CAAEA,eAAgB,CACjCC,kBAAkB,CAAEA,kBAAmB,CACvCG,WAAW,CAAEA,WAAY,CACzBE,UAAU,CAAEA,UAAW,CACvBD,2BAA2B,CAAEA,2BAA4B,CACrDE,CAAAA,KAAK,EAAAR,QAAA,CAAA,CAERA,QAAQ,CACTe,GAAA,CAACC,uBAAuB,EACtBd,kBAAkB,CAAEA,kBAAmB,CACvCD,eAAe,CAAEA,eAAgB,CAClC,CAAC,CAAA,CAAA,CACsB,CAAC,CAE/B,CAAC,CAEY,IAAAgB,gBAAgB,CAAGC,cAAK,CAACC,UAAU,CAACtB,iBAAiB;;;;"}
1
+ {"version":3,"file":"BaseInputWrapper.js","sources":["../../../../../../src/components/Input/BaseInput/BaseInputWrapper.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport React from 'react';\nimport type { BaseInputProps } from './BaseInput';\nimport { AnimatedBaseInputWrapper } from './AnimatedBaseInputWrapper';\nimport type { ContainerElementType } from '~utils/types';\nimport type { ActionStates } from '~utils/useInteraction';\n\ntype BaseInputWrapperProps = Pick<\n BaseInputProps,\n | 'isDisabled'\n | 'validationState'\n | 'showAllTags'\n | 'maxTagRows'\n | 'setInputWrapperRef'\n | 'isDropdownTrigger'\n> & {\n isFocused?: boolean;\n isLabelLeftPositioned?: boolean;\n currentInteraction: ActionStates;\n isTextArea?: boolean;\n setShowAllTagsWithAnimation: (showAllTagsWithAnimation: boolean) => void;\n children: React.ReactNode;\n size: NonNullable<BaseInputProps['size']>;\n};\n\nconst _BaseInputWrapper: React.ForwardRefRenderFunction<\n ContainerElementType,\n BaseInputWrapperProps & {\n children: ReactNode;\n }\n> = (\n {\n children,\n validationState,\n currentInteraction,\n isLabelLeftPositioned,\n isTextArea,\n showAllTags,\n setShowAllTagsWithAnimation,\n maxTagRows,\n ...props\n },\n ref,\n): ReactElement => {\n return (\n <AnimatedBaseInputWrapper\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unnecessary-type-assertion\n ref={ref as any}\n isTextArea={isTextArea}\n validationState={validationState}\n currentInteraction={currentInteraction}\n showAllTags={showAllTags}\n maxTagRows={maxTagRows}\n setShowAllTagsWithAnimation={setShowAllTagsWithAnimation}\n {...props}\n >\n {children}\n </AnimatedBaseInputWrapper>\n );\n};\n\nexport const BaseInputWrapper = React.forwardRef(_BaseInputWrapper);\n"],"names":["_BaseInputWrapper","_ref","ref","children","validationState","currentInteraction","isLabelLeftPositioned","isTextArea","showAllTags","setShowAllTagsWithAnimation","maxTagRows","props","_objectWithoutProperties","_excluded","_jsx","AnimatedBaseInputWrapper","Object","assign","BaseInputWrapper","React","forwardRef"],"mappings":";;;;;AACA,IAAA,SAAA,CAAA,CAAA,UAAA,CAAA,iBAAA,CAAA,oBAAA,CAAA,uBAAA,CAAA,YAAA,CAAA,aAAA,CAAA,6BAAA,CAAA,YAAA,CAAA,CAwBA,IAAMA,iBAKL,CAAG,SALEA,iBAKLA,CAAAC,IAAA,CAYCC,GAAG,CACc,CAXf,IAAAC,QAAQ,CAAAF,IAAA,CAARE,QAAQ,CACRC,eAAe,CAAAH,IAAA,CAAfG,eAAe,CACfC,kBAAkB,CAAAJ,IAAA,CAAlBI,kBAAkB,CACGJ,IAAA,CAArBK,qBAAqB,KACrBC,UAAU,CAAAN,IAAA,CAAVM,UAAU,CACVC,WAAW,CAAAP,IAAA,CAAXO,WAAW,CACXC,2BAA2B,CAAAR,IAAA,CAA3BQ,2BAA2B,CAC3BC,UAAU,CAAAT,IAAA,CAAVS,UAAU,CACPC,KAAK,CAAAC,wBAAA,CAAAX,IAAA,CAAAY,SAAA,EAIV,OACEC,GAAA,CAACC,wBAAwB,CAAAC,MAAA,CAAAC,MAAA,CAEvBf,CAAAA,GAAG,CAAEA,GAAW,CAChBK,UAAU,CAAEA,UAAW,CACvBH,eAAe,CAAEA,eAAgB,CACjCC,kBAAkB,CAAEA,kBAAmB,CACvCG,WAAW,CAAEA,WAAY,CACzBE,UAAU,CAAEA,UAAW,CACvBD,2BAA2B,CAAEA,2BAA4B,CAAA,CACrDE,KAAK,CAAAR,CAAAA,QAAA,CAERA,QAAQ,CACe,CAAA,CAAC,CAE/B,CAAC,CAEY,IAAAe,gBAAgB,CAAGC,cAAK,CAACC,UAAU,CAACpB,iBAAiB;;;;"}
@@ -3,6 +3,7 @@ import React__default from 'react';
3
3
  import styled from 'styled-components/native';
4
4
  import { Platform } from 'react-native';
5
5
  import { getBaseInputStyles } from './baseInputStyles.js';
6
+ import { baseInputHeight } from './baseInputTokens.js';
6
7
  import '../../Typography/BaseText/BaseText.native.js';
7
8
  import '@babel/runtime/helpers/slicedToArray';
8
9
  import '../../../tokens/global/typography.js';
@@ -18,7 +19,7 @@ import 'react-native-gesture-handler';
18
19
  import '../../BottomSheet/BottomSheetStack.js';
19
20
  import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
20
21
 
21
- var _excluded=["name","isRequired","isDisabled","maxCharacters","handleOnFocus","handleOnChange","handleOnBlur","handleOnSubmit","handleOnInput","handleOnKeyDown","handleOnClick","keyboardType","keyboardReturnKeyType","autoCompleteSuggestionType","accessibilityProps","currentInteraction","setCurrentInteraction","type","numberOfLines","isTextArea","hasPopup","shouldIgnoreBlurAnimation","autoCapitalize","as"];var autoCompleteSuggestionTypeAndroid={none:'off',name:'name',email:'email',username:'username',password:'password',newPassword:'password-new',oneTimeCode:'sms-otp',telephone:'tel',postalCode:'postal-code',countryName:'postal-address-country',creditCardNumber:'cc-number',creditCardCSC:'cc-csc',creditCardExpiry:'cc-exp',creditCardExpiryMonth:'cc-exp-month',creditCardExpiryYear:'cc-exp-year'};var autoCompleteSuggestionTypeIOS={none:'none',name:'name',email:'emailAddress',username:'username',password:'password',newPassword:'newPassword',oneTimeCode:'oneTimeCode',telephone:'telephoneNumber',postalCode:'postalCode',countryName:'countryName',creditCardNumber:'creditCardNumber',creditCardCSC:'none',creditCardExpiry:'none',creditCardExpiryMonth:'none',creditCardExpiryYear:'none'};var KeyboardTypeToNativeValuesMap={text:'default',search:'default',telephone:'phone-pad',email:'email-address',url:'url',decimal:'decimal-pad'};var getInputHeight=function getInputHeight(_ref){var isTextArea=_ref.isTextArea,hasTags=_ref.hasTags,numberOfLines=_ref.numberOfLines,lineHeight=_ref.lineHeight;if(isTextArea){return `${lineHeight*(numberOfLines!=null?numberOfLines:0)}px`;}if(hasTags){return undefined;}return makeSize(size[36]);};var getRNInputStyles=function getRNInputStyles(props){return Object.assign({},getBaseInputStyles({theme:props.theme,isFocused:props.isFocused,isDisabled:!props.editable,validationState:props.validationState,leadingIcon:props.leadingIcon,prefix:props.prefix,interactionElement:props.interactionElement,suffix:props.suffix,trailingIcon:props.trailingIcon,isTextArea:props.isTextArea,hasTags:props.hasTags,isDropdownTrigger:props.isDropdownTrigger}),{lineHeight:Platform.select({android:makeSize(props.theme.typography.lineHeights[100]),ios:undefined}),textAlignVertical:'top',height:getInputHeight({isTextArea:props.isTextArea,hasTags:props.hasTags,numberOfLines:props.numberOfLines,lineHeight:props.theme.typography.lineHeights[300]})});};var StyledNativeBaseInput=styled.TextInput(function(_ref2){var id=_ref2.id,isFocused=_ref2.isFocused,theme=_ref2.theme,editable=_ref2.editable,validationState=_ref2.validationState,leadingIcon=_ref2.leadingIcon,prefix=_ref2.prefix,interactionElement=_ref2.interactionElement,suffix=_ref2.suffix,trailingIcon=_ref2.trailingIcon,isTextArea=_ref2.isTextArea,numberOfLines=_ref2.numberOfLines,isDropdownTrigger=_ref2.isDropdownTrigger,hasTags=_ref2.hasTags;return getRNInputStyles({id:id,isFocused:isFocused,theme:theme,editable:editable,validationState:validationState,leadingIcon:leadingIcon,prefix:prefix,interactionElement:interactionElement,suffix:suffix,trailingIcon:trailingIcon,isTextArea:isTextArea,numberOfLines:numberOfLines,hasTags:hasTags,isDropdownTrigger:isDropdownTrigger});});var StyledNativeBaseButton=styled.TouchableOpacity(function(_ref3){var id=_ref3.id,isFocused=_ref3.isFocused,theme=_ref3.theme,editable=_ref3.editable,validationState=_ref3.validationState,leadingIcon=_ref3.leadingIcon,prefix=_ref3.prefix,interactionElement=_ref3.interactionElement,suffix=_ref3.suffix,trailingIcon=_ref3.trailingIcon,isTextArea=_ref3.isTextArea,numberOfLines=_ref3.numberOfLines,isDropdownTrigger=_ref3.isDropdownTrigger,hasTags=_ref3.hasTags;return getRNInputStyles({id:id,isFocused:isFocused,theme:theme,editable:editable,validationState:validationState,leadingIcon:leadingIcon,prefix:prefix,interactionElement:interactionElement,suffix:suffix,trailingIcon:trailingIcon,isTextArea:isTextArea,numberOfLines:numberOfLines,isDropdownTrigger:isDropdownTrigger,hasTags:hasTags});});var _StyledBaseInput=function _StyledBaseInput(_ref4,ref){var name=_ref4.name;_ref4.isRequired;var isDisabled=_ref4.isDisabled,maxCharacters=_ref4.maxCharacters,handleOnFocus=_ref4.handleOnFocus,handleOnChange=_ref4.handleOnChange,handleOnBlur=_ref4.handleOnBlur,handleOnSubmit=_ref4.handleOnSubmit,handleOnInput=_ref4.handleOnInput,handleOnKeyDown=_ref4.handleOnKeyDown,handleOnClick=_ref4.handleOnClick,_ref4$keyboardType=_ref4.keyboardType,keyboardType=_ref4$keyboardType===void 0?'text':_ref4$keyboardType,keyboardReturnKeyType=_ref4.keyboardReturnKeyType,autoCompleteSuggestionType=_ref4.autoCompleteSuggestionType,accessibilityProps=_ref4.accessibilityProps,currentInteraction=_ref4.currentInteraction,setCurrentInteraction=_ref4.setCurrentInteraction,type=_ref4.type,numberOfLines=_ref4.numberOfLines,isTextArea=_ref4.isTextArea;_ref4.hasPopup;var shouldIgnoreBlurAnimation=_ref4.shouldIgnoreBlurAnimation,autoCapitalize=_ref4.autoCapitalize,renderAs=_ref4.as,props=_objectWithoutProperties(_ref4,_excluded);var buttonValue=props.value?props.value:props.placeholder;var _useTheme=useTheme(),theme=_useTheme.theme;var commonProps={onBlur:function onBlur(){if(!shouldIgnoreBlurAnimation){setCurrentInteraction('default');}},isFocused:currentInteraction==='focus'};return renderAs==='button'?jsx(StyledNativeBaseButton,Object.assign({ref:ref,onPress:function onPress(){handleOnClick==null?void 0:handleOnClick({name:name,value:props.value});},onFocus:function onFocus(){handleOnFocus==null?void 0:handleOnFocus({name:name,value:props.value});setCurrentInteraction('focus');},as:undefined},commonProps,props,accessibilityProps,{children:jsx(Text,{color:props.value&&!isDisabled?'surface.text.gray.subtle':'surface.text.gray.disabled',truncateAfterLines:1,textAlign:props.textAlign,children:buttonValue})})):jsx(StyledNativeBaseInput,Object.assign({ref:ref,multiline:isTextArea,numberOfLines:numberOfLines,editable:!isDisabled,maxLength:maxCharacters,placeholderTextColor:theme.colors.surface.text.gray.disabled,onFocus:function onFocus(event){handleOnFocus==null?void 0:handleOnFocus({name:name,value:event==null?void 0:event.nativeEvent.text});handleOnClick==null?void 0:handleOnClick({name:name,value:event==null?void 0:event.nativeEvent.text});setCurrentInteraction('focus');},onChangeText:function onChangeText(text){handleOnChange==null?void 0:handleOnChange({name:name,value:text});handleOnInput==null?void 0:handleOnInput({name:name,value:text});},onEndEditing:function onEndEditing(event){return handleOnBlur==null?void 0:handleOnBlur({name:name,value:event==null?void 0:event.nativeEvent.text});},onSubmitEditing:function onSubmitEditing(event){return handleOnSubmit==null?void 0:handleOnSubmit({name:name,value:event==null?void 0:event.nativeEvent.text});},onKeyPress:function onKeyPress(event){handleOnKeyDown==null?void 0:handleOnKeyDown({name:name,key:event==null?void 0:event.nativeEvent.key,event:event});},keyboardType:KeyboardTypeToNativeValuesMap[keyboardType],returnKeyType:keyboardReturnKeyType,autoCompleteType:autoCompleteSuggestionType?autoCompleteSuggestionTypeAndroid[autoCompleteSuggestionType]:undefined,secureTextEntry:type==='password',isTextArea:isTextArea,textContentType:autoCompleteSuggestionType?autoCompleteSuggestionTypeIOS[autoCompleteSuggestionType]:undefined,autoCapitalize:autoCapitalize},commonProps,props,accessibilityProps));};var StyledBaseInput=assignWithoutSideEffects(React__default.forwardRef(_StyledBaseInput),{displayName:'StyledBaseInput'});
22
+ var _excluded=["name","isRequired","isDisabled","maxCharacters","handleOnFocus","handleOnChange","handleOnBlur","handleOnSubmit","handleOnInput","handleOnKeyDown","handleOnClick","keyboardType","keyboardReturnKeyType","autoCompleteSuggestionType","accessibilityProps","currentInteraction","setCurrentInteraction","type","numberOfLines","isTextArea","hasPopup","shouldIgnoreBlurAnimation","autoCapitalize","as","$size"];var autoCompleteSuggestionTypeAndroid={none:'off',name:'name',email:'email',username:'username',password:'password',newPassword:'password-new',oneTimeCode:'sms-otp',telephone:'tel',postalCode:'postal-code',countryName:'postal-address-country',creditCardNumber:'cc-number',creditCardCSC:'cc-csc',creditCardExpiry:'cc-exp',creditCardExpiryMonth:'cc-exp-month',creditCardExpiryYear:'cc-exp-year'};var autoCompleteSuggestionTypeIOS={none:'none',name:'name',email:'emailAddress',username:'username',password:'password',newPassword:'newPassword',oneTimeCode:'oneTimeCode',telephone:'telephoneNumber',postalCode:'postalCode',countryName:'countryName',creditCardNumber:'creditCardNumber',creditCardCSC:'none',creditCardExpiry:'none',creditCardExpiryMonth:'none',creditCardExpiryYear:'none'};var KeyboardTypeToNativeValuesMap={text:'default',search:'default',telephone:'phone-pad',email:'email-address',url:'url',decimal:'decimal-pad'};var getInputHeight=function getInputHeight(_ref){var isTextArea=_ref.isTextArea,hasTags=_ref.hasTags,numberOfLines=_ref.numberOfLines,lineHeight=_ref.lineHeight,size$1=_ref.size;if(isTextArea){return `${lineHeight*(numberOfLines!=null?numberOfLines:0)}px`;}if(hasTags){return undefined;}return makeSize(size[baseInputHeight[size$1]]);};var getRNInputStyles=function getRNInputStyles(props){return Object.assign({},getBaseInputStyles({theme:props.theme,isFocused:props.isFocused,isDisabled:!props.editable,validationState:props.validationState,leadingIcon:props.leadingIcon,prefix:props.prefix,interactionElement:props.interactionElement,suffix:props.suffix,trailingIcon:props.trailingIcon,isTextArea:props.isTextArea,hasTags:props.hasTags,isDropdownTrigger:props.isDropdownTrigger,size:props.$size,valueComponentType:props.valueComponentType}),{lineHeight:Platform.select({android:makeSize(props.theme.typography.lineHeights[100]),ios:undefined}),textAlignVertical:'top',height:getInputHeight({isTextArea:props.isTextArea,hasTags:props.hasTags,numberOfLines:props.numberOfLines,lineHeight:props.theme.typography.lineHeights[300],size:props.$size})});};var StyledNativeBaseInput=styled.TextInput(function(_ref2){var id=_ref2.id,isFocused=_ref2.isFocused,theme=_ref2.theme,editable=_ref2.editable,validationState=_ref2.validationState,leadingIcon=_ref2.leadingIcon,prefix=_ref2.prefix,interactionElement=_ref2.interactionElement,suffix=_ref2.suffix,trailingIcon=_ref2.trailingIcon,isTextArea=_ref2.isTextArea,numberOfLines=_ref2.numberOfLines,isDropdownTrigger=_ref2.isDropdownTrigger,hasTags=_ref2.hasTags,$size=_ref2.$size,valueComponentType=_ref2.valueComponentType;return getRNInputStyles({id:id,isFocused:isFocused,theme:theme,editable:editable,validationState:validationState,leadingIcon:leadingIcon,prefix:prefix,interactionElement:interactionElement,suffix:suffix,trailingIcon:trailingIcon,isTextArea:isTextArea,numberOfLines:numberOfLines,hasTags:hasTags,isDropdownTrigger:isDropdownTrigger,$size:$size,valueComponentType:valueComponentType});});var StyledNativeBaseButton=styled.TouchableOpacity(function(_ref3){var id=_ref3.id,isFocused=_ref3.isFocused,theme=_ref3.theme,editable=_ref3.editable,validationState=_ref3.validationState,leadingIcon=_ref3.leadingIcon,prefix=_ref3.prefix,interactionElement=_ref3.interactionElement,suffix=_ref3.suffix,trailingIcon=_ref3.trailingIcon,isTextArea=_ref3.isTextArea,numberOfLines=_ref3.numberOfLines,isDropdownTrigger=_ref3.isDropdownTrigger,hasTags=_ref3.hasTags,$size=_ref3.$size,valueComponentType=_ref3.valueComponentType;return Object.assign({},getRNInputStyles({id:id,isFocused:isFocused,theme:theme,editable:editable,validationState:validationState,leadingIcon:leadingIcon,prefix:prefix,interactionElement:interactionElement,suffix:suffix,trailingIcon:trailingIcon,isTextArea:isTextArea,numberOfLines:numberOfLines,isDropdownTrigger:isDropdownTrigger,hasTags:hasTags,$size:$size,valueComponentType:valueComponentType}));});var _StyledBaseInput=function _StyledBaseInput(_ref4,ref){var name=_ref4.name;_ref4.isRequired;var isDisabled=_ref4.isDisabled,maxCharacters=_ref4.maxCharacters,handleOnFocus=_ref4.handleOnFocus,handleOnChange=_ref4.handleOnChange,handleOnBlur=_ref4.handleOnBlur,handleOnSubmit=_ref4.handleOnSubmit,handleOnInput=_ref4.handleOnInput,handleOnKeyDown=_ref4.handleOnKeyDown,handleOnClick=_ref4.handleOnClick,_ref4$keyboardType=_ref4.keyboardType,keyboardType=_ref4$keyboardType===void 0?'text':_ref4$keyboardType,keyboardReturnKeyType=_ref4.keyboardReturnKeyType,autoCompleteSuggestionType=_ref4.autoCompleteSuggestionType,accessibilityProps=_ref4.accessibilityProps,currentInteraction=_ref4.currentInteraction,setCurrentInteraction=_ref4.setCurrentInteraction,type=_ref4.type,numberOfLines=_ref4.numberOfLines,isTextArea=_ref4.isTextArea;_ref4.hasPopup;var shouldIgnoreBlurAnimation=_ref4.shouldIgnoreBlurAnimation,autoCapitalize=_ref4.autoCapitalize,renderAs=_ref4.as,$size=_ref4.$size,props=_objectWithoutProperties(_ref4,_excluded);var buttonValue=props.value?props.value:props.placeholder;var _useTheme=useTheme(),theme=_useTheme.theme;var commonProps={onBlur:function onBlur(){if(!shouldIgnoreBlurAnimation){setCurrentInteraction('default');}},isFocused:currentInteraction==='focus'};return renderAs==='button'?jsx(StyledNativeBaseButton,Object.assign({ref:ref,onPress:function onPress(){handleOnClick==null?void 0:handleOnClick({name:name,value:props.value});},onFocus:function onFocus(){handleOnFocus==null?void 0:handleOnFocus({name:name,value:props.value});setCurrentInteraction('focus');},as:undefined,$size:$size},commonProps,props,accessibilityProps,{children:jsx(Text,{color:props.value&&!isDisabled?'surface.text.gray.subtle':'surface.text.gray.disabled',truncateAfterLines:1,textAlign:props.textAlign,size:$size,children:buttonValue})})):jsx(StyledNativeBaseInput,Object.assign({ref:ref,multiline:isTextArea,numberOfLines:numberOfLines,editable:!isDisabled,maxLength:maxCharacters,placeholderTextColor:theme.colors.surface.text.gray.disabled,onFocus:function onFocus(event){handleOnFocus==null?void 0:handleOnFocus({name:name,value:event==null?void 0:event.nativeEvent.text});handleOnClick==null?void 0:handleOnClick({name:name,value:event==null?void 0:event.nativeEvent.text});setCurrentInteraction('focus');},onChangeText:function onChangeText(text){handleOnChange==null?void 0:handleOnChange({name:name,value:text});handleOnInput==null?void 0:handleOnInput({name:name,value:text});},onEndEditing:function onEndEditing(event){return handleOnBlur==null?void 0:handleOnBlur({name:name,value:event==null?void 0:event.nativeEvent.text});},onSubmitEditing:function onSubmitEditing(event){return handleOnSubmit==null?void 0:handleOnSubmit({name:name,value:event==null?void 0:event.nativeEvent.text});},onKeyPress:function onKeyPress(event){handleOnKeyDown==null?void 0:handleOnKeyDown({name:name,key:event==null?void 0:event.nativeEvent.key,event:event});},keyboardType:KeyboardTypeToNativeValuesMap[keyboardType],returnKeyType:keyboardReturnKeyType,autoCompleteType:autoCompleteSuggestionType?autoCompleteSuggestionTypeAndroid[autoCompleteSuggestionType]:undefined,secureTextEntry:type==='password',isTextArea:isTextArea,textContentType:autoCompleteSuggestionType?autoCompleteSuggestionTypeIOS[autoCompleteSuggestionType]:undefined,autoCapitalize:autoCapitalize,$size:$size},commonProps,props,accessibilityProps));};var StyledBaseInput=assignWithoutSideEffects(React__default.forwardRef(_StyledBaseInput),{displayName:'StyledBaseInput'});
22
23
 
23
24
  export { StyledBaseInput };
24
25
  //# sourceMappingURL=StyledBaseInput.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StyledBaseInput.native.js","sources":["../../../../../../src/components/Input/BaseInput/StyledBaseInput.native.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components/native';\nimport type { CSSObject, ThemeProps, DefaultTheme } from 'styled-components';\nimport type {\n TextInputProps,\n TextInput,\n TouchableHighlight,\n TouchableHighlightProps,\n GestureResponderEvent,\n} from 'react-native';\nimport { Platform as RNPlatform } from 'react-native';\nimport type { BaseInputProps } from './BaseInput';\nimport type { StyledBaseInputProps } from './types';\nimport { getBaseInputStyles } from './baseInputStyles';\nimport { Text } from '~components/Typography';\nimport { useTheme } from '~components/BladeProvider';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { size } from '~tokens/global';\nimport { makeSize } from '~utils/makeSize';\nimport type { Platform } from '~utils';\n\ntype StyledComponentAutoCompleteAndroid =\n | 'off'\n | 'name'\n | 'cc-csc'\n | 'cc-exp'\n | 'cc-exp-month'\n | 'cc-exp-year'\n | 'cc-number'\n | 'email'\n | 'username'\n | 'password'\n | 'postal-code'\n | 'tel'\n | undefined;\n\nconst autoCompleteSuggestionTypeAndroid = {\n none: 'off',\n name: 'name',\n email: 'email',\n username: 'username',\n password: 'password',\n newPassword: 'password-new',\n oneTimeCode: 'sms-otp',\n telephone: 'tel',\n postalCode: 'postal-code',\n countryName: 'postal-address-country',\n creditCardNumber: 'cc-number',\n creditCardCSC: 'cc-csc',\n creditCardExpiry: 'cc-exp',\n creditCardExpiryMonth: 'cc-exp-month',\n creditCardExpiryYear: 'cc-exp-year',\n} as const;\n\nconst autoCompleteSuggestionTypeIOS = {\n none: 'none',\n name: 'name',\n email: 'emailAddress',\n username: 'username',\n password: 'password',\n newPassword: 'newPassword',\n oneTimeCode: 'oneTimeCode',\n telephone: 'telephoneNumber',\n postalCode: 'postalCode',\n countryName: 'countryName',\n creditCardNumber: 'creditCardNumber',\n creditCardCSC: 'none',\n creditCardExpiry: 'none',\n creditCardExpiryMonth: 'none',\n creditCardExpiryYear: 'none',\n} as const;\n\nconst KeyboardTypeToNativeValuesMap = {\n text: 'default',\n search: 'default',\n telephone: 'phone-pad',\n email: 'email-address',\n url: 'url',\n decimal: 'decimal-pad',\n};\n\ntype StyledComponentInputProps = Omit<\n StyledBaseInputProps,\n 'accessibilityProps' | 'setCurrentInteraction' | 'currentInteraction'\n> & {\n isTextArea?: boolean;\n isFocused: boolean;\n autoCompleteType?: typeof autoCompleteSuggestionTypeAndroid[keyof typeof autoCompleteSuggestionTypeAndroid];\n editable?: boolean;\n onPress?: (event: GestureResponderEvent) => void;\n};\n\nconst getInputHeight = ({\n isTextArea,\n hasTags,\n numberOfLines,\n lineHeight,\n}: Pick<StyledBaseInputProps, 'hasTags' | 'isTextArea' | 'numberOfLines'> & {\n lineHeight: number;\n}): string | undefined => {\n if (isTextArea) {\n return `${lineHeight * (numberOfLines ?? 0)}px`;\n }\n\n if (hasTags) {\n return undefined; // we don't set height on input. We set it on wrapper to properly include tags in overall height\n }\n\n return makeSize(size[36]);\n};\n\nconst getRNInputStyles = (\n props: StyledComponentInputProps &\n ThemeProps<DefaultTheme> &\n (TextInputProps | TouchableHighlightProps),\n): CSSObject => {\n return {\n ...getBaseInputStyles({\n theme: props.theme,\n isFocused: props.isFocused,\n isDisabled: !props.editable,\n validationState: props.validationState,\n leadingIcon: props.leadingIcon,\n prefix: props.prefix,\n interactionElement: props.interactionElement,\n suffix: props.suffix,\n trailingIcon: props.trailingIcon,\n isTextArea: props.isTextArea,\n hasTags: props.hasTags,\n isDropdownTrigger: props.isDropdownTrigger,\n }),\n lineHeight: RNPlatform.select({\n android: makeSize(props.theme.typography.lineHeights[100]),\n ios: undefined,\n }),\n textAlignVertical: 'top',\n height: getInputHeight({\n isTextArea: props.isTextArea,\n hasTags: props.hasTags,\n numberOfLines: props.numberOfLines,\n lineHeight: props.theme.typography.lineHeights[300],\n }),\n };\n};\nconst StyledNativeBaseInput = styled.TextInput<StyledComponentInputProps>(\n ({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n isDropdownTrigger,\n hasTags,\n }) =>\n getRNInputStyles({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n hasTags,\n isDropdownTrigger,\n }),\n);\nconst StyledNativeBaseButton = styled.TouchableOpacity<StyledComponentInputProps>(\n ({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n isDropdownTrigger,\n hasTags,\n }) =>\n getRNInputStyles({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n isDropdownTrigger,\n hasTags,\n }),\n);\n\nconst _StyledBaseInput: React.ForwardRefRenderFunction<\n TextInput | TouchableHighlight,\n StyledBaseInputProps\n> = (\n {\n name,\n isRequired,\n isDisabled,\n maxCharacters,\n handleOnFocus,\n handleOnChange,\n handleOnBlur,\n handleOnSubmit,\n handleOnInput,\n handleOnKeyDown,\n handleOnClick,\n keyboardType = 'text',\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n accessibilityProps,\n currentInteraction,\n setCurrentInteraction,\n type,\n numberOfLines,\n isTextArea,\n hasPopup,\n shouldIgnoreBlurAnimation,\n autoCapitalize,\n as: renderAs,\n ...props\n },\n ref,\n) => {\n const buttonValue = props.value ? props.value : props.placeholder;\n const { theme } = useTheme();\n const commonProps = {\n onBlur: (): void => {\n // In certain cases like SelectInput, we want to ignore the blur animation when option item is clicked.\n // The selectinput should always look like it is in focus otherwise it triggers blur + focus again which can cause flicker\n if (!shouldIgnoreBlurAnimation) {\n setCurrentInteraction('default');\n }\n },\n isFocused: currentInteraction === 'focus',\n };\n\n return renderAs === 'button' ? (\n <StyledNativeBaseButton\n // the types of styled-components for react-native is creating a mess, so there's no other option but to type `ref` as any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n onPress={(): void => {\n handleOnClick?.({ name, value: props.value });\n }}\n onFocus={(): void => {\n handleOnFocus?.({ name, value: props.value });\n setCurrentInteraction('focus');\n }}\n as={undefined}\n {...commonProps}\n {...props}\n {...accessibilityProps}\n >\n <Text\n color={\n props.value && !isDisabled ? 'surface.text.gray.subtle' : 'surface.text.gray.disabled'\n }\n truncateAfterLines={1}\n textAlign={props.textAlign}\n >\n {buttonValue}\n </Text>\n </StyledNativeBaseButton>\n ) : (\n <StyledNativeBaseInput\n // the types of styled-components for react-native is creating a mess, so there's no other option but to type `ref` as any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n multiline={isTextArea}\n numberOfLines={numberOfLines}\n editable={!isDisabled}\n maxLength={maxCharacters}\n placeholderTextColor={theme.colors.surface.text.gray.disabled}\n onFocus={(event): void => {\n handleOnFocus?.({ name, value: event?.nativeEvent.text });\n // React Native does not have native onPress event on Input elements so for consistency of API we call it on onFocus which also gets triggered on clicks\n handleOnClick?.({ name, value: event?.nativeEvent.text });\n setCurrentInteraction('focus');\n }}\n onChangeText={(text): void => {\n handleOnChange?.({ name, value: text });\n handleOnInput?.({ name, value: text });\n }}\n onEndEditing={(event): void => handleOnBlur?.({ name, value: event?.nativeEvent.text })}\n onSubmitEditing={(event): void => handleOnSubmit?.({ name, value: event?.nativeEvent.text })}\n onKeyPress={(event): void => {\n handleOnKeyDown?.({\n name,\n key: event?.nativeEvent.key,\n event: (event as unknown) as React.KeyboardEvent<HTMLInputElement>, // TODO: handle platform specific type\n });\n }}\n // @ts-expect-error styled-components have limited keyboard types('default' | 'email-address' | 'numeric' | 'phone-pad' | 'number-pad' | 'decimal-pad') compared to the actual supported types so ignoring the error.\n // source: https://reactnative.dev/docs/textinput/#keyboardtype\n keyboardType={KeyboardTypeToNativeValuesMap[keyboardType]}\n returnKeyType={keyboardReturnKeyType}\n autoCompleteType={\n autoCompleteSuggestionType\n ? (autoCompleteSuggestionTypeAndroid[\n autoCompleteSuggestionType as Platform.CastNative<\n BaseInputProps['autoCompleteSuggestionType']\n >\n ] as StyledComponentAutoCompleteAndroid)\n : undefined\n }\n secureTextEntry={type === 'password'}\n isTextArea={isTextArea}\n textContentType={\n autoCompleteSuggestionType\n ? autoCompleteSuggestionTypeIOS[\n autoCompleteSuggestionType as Platform.CastNative<\n BaseInputProps['autoCompleteSuggestionType']\n >\n ]\n : undefined\n }\n autoCapitalize={autoCapitalize}\n {...commonProps}\n {...props}\n {...accessibilityProps}\n />\n );\n};\n\nconst StyledBaseInput = assignWithoutSideEffects(React.forwardRef(_StyledBaseInput), {\n displayName: 'StyledBaseInput',\n});\n\nexport { StyledBaseInput };\n"],"names":["autoCompleteSuggestionTypeAndroid","none","name","email","username","password","newPassword","oneTimeCode","telephone","postalCode","countryName","creditCardNumber","creditCardCSC","creditCardExpiry","creditCardExpiryMonth","creditCardExpiryYear","autoCompleteSuggestionTypeIOS","KeyboardTypeToNativeValuesMap","text","search","url","decimal","getInputHeight","_ref","isTextArea","hasTags","numberOfLines","lineHeight","undefined","makeSize","size","getRNInputStyles","props","Object","assign","getBaseInputStyles","theme","isFocused","isDisabled","editable","validationState","leadingIcon","prefix","interactionElement","suffix","trailingIcon","isDropdownTrigger","RNPlatform","select","android","typography","lineHeights","ios","textAlignVertical","height","StyledNativeBaseInput","styled","TextInput","_ref2","id","StyledNativeBaseButton","TouchableOpacity","_ref3","_StyledBaseInput","_ref4","ref","isRequired","maxCharacters","handleOnFocus","handleOnChange","handleOnBlur","handleOnSubmit","handleOnInput","handleOnKeyDown","handleOnClick","_ref4$keyboardType","keyboardType","keyboardReturnKeyType","autoCompleteSuggestionType","accessibilityProps","currentInteraction","setCurrentInteraction","type","hasPopup","shouldIgnoreBlurAnimation","autoCapitalize","renderAs","as","_objectWithoutProperties","_excluded","buttonValue","value","placeholder","_useTheme","useTheme","commonProps","onBlur","_jsx","onPress","onFocus","children","Text","color","truncateAfterLines","textAlign","multiline","maxLength","placeholderTextColor","colors","surface","gray","disabled","event","nativeEvent","onChangeText","onEndEditing","onSubmitEditing","onKeyPress","key","returnKeyType","autoCompleteType","secureTextEntry","textContentType","StyledBaseInput","assignWithoutSideEffects","React","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,MAAA,CAAA,YAAA,CAAA,YAAA,CAAA,eAAA,CAAA,eAAA,CAAA,gBAAA,CAAA,cAAA,CAAA,gBAAA,CAAA,eAAA,CAAA,iBAAA,CAAA,eAAA,CAAA,cAAA,CAAA,uBAAA,CAAA,4BAAA,CAAA,oBAAA,CAAA,oBAAA,CAAA,uBAAA,CAAA,MAAA,CAAA,eAAA,CAAA,YAAA,CAAA,UAAA,C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AAC,CAAA,CAAC,CACxFkG,eAAe,CAAE,SAAAA,eAACJ,CAAAA,KAAK,SAAWzC,cAAc,EAAdA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,cAAc,CAAG,CAAErE,IAAI,CAAJA,IAAI,CAAEyF,KAAK,CAAEqB,KAAK,EAALA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,KAAK,CAAEC,WAAW,CAAC/F,IAAK,CAAC,CAAC,EAAC,CAC7FmG,UAAU,CAAE,SAAAA,WAACL,KAAK,CAAW,CAC3BvC,eAAe,EAAA,IAAA,CAAA,KAAA,CAAA,CAAfA,eAAe,CAAG,CAChBvE,IAAI,CAAJA,IAAI,CACJoH,GAAG,CAAEN,KAAK,EAALA,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,KAAK,CAAEC,WAAW,CAACK,GAAG,CAC3BN,KAAK,CAAGA,KACV,CAAC,CAAC,CACJ,CAAE,CAGFpC,YAAY,CAAE3D,6BAA6B,CAAC2D,YAAY,CAAE,CAC1D2C,aAAa,CAAE1C,qBAAsB,CACrC2C,gBAAgB,CACd1C,0BAA0B,CACrB9E,iCAAiC,CAChC8E,0BAA0B,CAG3B,CACDlD,SACL,CACD6F,eAAe,CAAEvC,IAAI,GAAK,UAAW,CACrC1D,UAAU,CAAEA,UAAW,CACvBkG,eAAe,CACb5C,0BAA0B,CACtB9D,6BAA6B,CAC3B8D,0BAA0B,CAG3B,CACDlD,SACL,CACDyD,cAAc,CAAEA,cAAe,CAC3BU,CAAAA,WAAW,CACX/D,KAAK,CACL+C,kBAAkB,CACvB,CACF,CACH,CAAC,CAEK,IAAA4C,eAAe,CAAGC,wBAAwB,CAACC,cAAK,CAACC,UAAU,CAAC/D,gBAAgB,CAAC,CAAE,CACnFgE,WAAW,CAAE,iBACf,CAAC;;;;"}
1
+ {"version":3,"file":"StyledBaseInput.native.js","sources":["../../../../../../src/components/Input/BaseInput/StyledBaseInput.native.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components/native';\nimport type { CSSObject, ThemeProps, DefaultTheme } from 'styled-components';\nimport type {\n TextInputProps,\n TouchableHighlight,\n TouchableHighlightProps,\n GestureResponderEvent,\n TextInput,\n} from 'react-native';\nimport { Platform as RNPlatform } from 'react-native';\nimport type { BaseInputProps } from './BaseInput';\nimport type { StyledBaseInputProps } from './types';\nimport { getBaseInputStyles } from './baseInputStyles';\nimport { baseInputHeight } from './baseInputTokens';\nimport { Text } from '~components/Typography';\nimport { useTheme } from '~components/BladeProvider';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { size as sizeToken } from '~tokens/global';\nimport { makeSize } from '~utils/makeSize';\nimport type { Platform } from '~utils';\n\ntype StyledComponentAutoCompleteAndroid =\n | 'off'\n | 'name'\n | 'cc-csc'\n | 'cc-exp'\n | 'cc-exp-month'\n | 'cc-exp-year'\n | 'cc-number'\n | 'email'\n | 'username'\n | 'password'\n | 'postal-code'\n | 'tel'\n | undefined;\n\nconst autoCompleteSuggestionTypeAndroid = {\n none: 'off',\n name: 'name',\n email: 'email',\n username: 'username',\n password: 'password',\n newPassword: 'password-new',\n oneTimeCode: 'sms-otp',\n telephone: 'tel',\n postalCode: 'postal-code',\n countryName: 'postal-address-country',\n creditCardNumber: 'cc-number',\n creditCardCSC: 'cc-csc',\n creditCardExpiry: 'cc-exp',\n creditCardExpiryMonth: 'cc-exp-month',\n creditCardExpiryYear: 'cc-exp-year',\n} as const;\n\nconst autoCompleteSuggestionTypeIOS = {\n none: 'none',\n name: 'name',\n email: 'emailAddress',\n username: 'username',\n password: 'password',\n newPassword: 'newPassword',\n oneTimeCode: 'oneTimeCode',\n telephone: 'telephoneNumber',\n postalCode: 'postalCode',\n countryName: 'countryName',\n creditCardNumber: 'creditCardNumber',\n creditCardCSC: 'none',\n creditCardExpiry: 'none',\n creditCardExpiryMonth: 'none',\n creditCardExpiryYear: 'none',\n} as const;\n\nconst KeyboardTypeToNativeValuesMap = {\n text: 'default',\n search: 'default',\n telephone: 'phone-pad',\n email: 'email-address',\n url: 'url',\n decimal: 'decimal-pad',\n};\n\ntype StyledComponentInputProps = Omit<\n StyledBaseInputProps,\n 'accessibilityProps' | 'setCurrentInteraction' | 'currentInteraction'\n> & {\n isTextArea?: boolean;\n isFocused: boolean;\n autoCompleteType?: typeof autoCompleteSuggestionTypeAndroid[keyof typeof autoCompleteSuggestionTypeAndroid];\n editable?: boolean;\n onPress?: (event: GestureResponderEvent) => void;\n $size: NonNullable<BaseInputProps['size']>;\n};\n\nconst getInputHeight = ({\n isTextArea,\n hasTags,\n numberOfLines,\n lineHeight,\n size,\n}: Pick<StyledBaseInputProps, 'hasTags' | 'isTextArea' | 'numberOfLines'> & {\n lineHeight: number;\n size: NonNullable<BaseInputProps['size']>;\n}): string | undefined => {\n if (isTextArea) {\n return `${lineHeight * (numberOfLines ?? 0)}px`;\n }\n\n if (hasTags) {\n return undefined; // we don't set height on input. We set it on wrapper to properly include tags in overall height\n }\n\n return makeSize(sizeToken[baseInputHeight[size]]);\n};\n\nconst getRNInputStyles = (\n props: StyledComponentInputProps &\n ThemeProps<DefaultTheme> &\n (TextInputProps | TouchableHighlightProps),\n): CSSObject => {\n return {\n ...getBaseInputStyles({\n theme: props.theme,\n isFocused: props.isFocused,\n isDisabled: !props.editable,\n validationState: props.validationState,\n leadingIcon: props.leadingIcon,\n prefix: props.prefix,\n interactionElement: props.interactionElement,\n suffix: props.suffix,\n trailingIcon: props.trailingIcon,\n isTextArea: props.isTextArea,\n hasTags: props.hasTags,\n isDropdownTrigger: props.isDropdownTrigger,\n size: props.$size,\n valueComponentType: props.valueComponentType,\n }),\n lineHeight: RNPlatform.select({\n android: makeSize(props.theme.typography.lineHeights[100]),\n ios: undefined,\n }),\n textAlignVertical: 'top',\n height: getInputHeight({\n isTextArea: props.isTextArea,\n hasTags: props.hasTags,\n numberOfLines: props.numberOfLines,\n lineHeight: props.theme.typography.lineHeights[300],\n size: props.$size,\n }),\n };\n};\nconst StyledNativeBaseInput = styled.TextInput<StyledComponentInputProps>(\n ({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n isDropdownTrigger,\n hasTags,\n $size,\n valueComponentType,\n }) =>\n getRNInputStyles({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n hasTags,\n isDropdownTrigger,\n $size,\n valueComponentType,\n }),\n);\nconst StyledNativeBaseButton = styled.TouchableOpacity<StyledComponentInputProps>(\n ({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n isDropdownTrigger,\n hasTags,\n $size,\n valueComponentType,\n }) => ({\n ...getRNInputStyles({\n id,\n isFocused,\n theme,\n editable,\n validationState,\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n isTextArea,\n numberOfLines,\n isDropdownTrigger,\n hasTags,\n $size,\n valueComponentType,\n }),\n }),\n);\n\nconst _StyledBaseInput: React.ForwardRefRenderFunction<\n TextInput | TouchableHighlight,\n StyledBaseInputProps\n> = (\n {\n name,\n isRequired,\n isDisabled,\n maxCharacters,\n handleOnFocus,\n handleOnChange,\n handleOnBlur,\n handleOnSubmit,\n handleOnInput,\n handleOnKeyDown,\n handleOnClick,\n keyboardType = 'text',\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n accessibilityProps,\n currentInteraction,\n setCurrentInteraction,\n type,\n numberOfLines,\n isTextArea,\n hasPopup,\n shouldIgnoreBlurAnimation,\n autoCapitalize,\n as: renderAs,\n $size,\n ...props\n },\n ref,\n) => {\n const buttonValue = props.value ? props.value : props.placeholder;\n const { theme } = useTheme();\n const commonProps = {\n onBlur: (): void => {\n // In certain cases like SelectInput, we want to ignore the blur animation when option item is clicked.\n // The selectinput should always look like it is in focus otherwise it triggers blur + focus again which can cause flicker\n if (!shouldIgnoreBlurAnimation) {\n setCurrentInteraction('default');\n }\n },\n isFocused: currentInteraction === 'focus',\n };\n\n return renderAs === 'button' ? (\n <StyledNativeBaseButton\n // the types of styled-components for react-native is creating a mess, so there's no other option but to type `ref` as any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n onPress={(): void => {\n handleOnClick?.({ name, value: props.value });\n }}\n onFocus={(): void => {\n handleOnFocus?.({ name, value: props.value });\n setCurrentInteraction('focus');\n }}\n as={undefined}\n $size={$size}\n {...commonProps}\n {...props}\n {...accessibilityProps}\n >\n <Text\n color={\n props.value && !isDisabled ? 'surface.text.gray.subtle' : 'surface.text.gray.disabled'\n }\n truncateAfterLines={1}\n textAlign={props.textAlign}\n size={$size}\n >\n {buttonValue}\n </Text>\n </StyledNativeBaseButton>\n ) : (\n <StyledNativeBaseInput\n // the types of styled-components for react-native is creating a mess, so there's no other option but to type `ref` as any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n multiline={isTextArea}\n numberOfLines={numberOfLines}\n editable={!isDisabled}\n maxLength={maxCharacters}\n placeholderTextColor={theme.colors.surface.text.gray.disabled}\n onFocus={(event): void => {\n handleOnFocus?.({ name, value: event?.nativeEvent.text });\n // React Native does not have native onPress event on Input elements so for consistency of API we call it on onFocus which also gets triggered on clicks\n handleOnClick?.({ name, value: event?.nativeEvent.text });\n setCurrentInteraction('focus');\n }}\n onChangeText={(text): void => {\n handleOnChange?.({ name, value: text });\n handleOnInput?.({ name, value: text });\n }}\n onEndEditing={(event): void => handleOnBlur?.({ name, value: event?.nativeEvent.text })}\n onSubmitEditing={(event): void => handleOnSubmit?.({ name, value: event?.nativeEvent.text })}\n onKeyPress={(event): void => {\n handleOnKeyDown?.({\n name,\n key: event?.nativeEvent.key,\n event: (event as unknown) as React.KeyboardEvent<HTMLInputElement>, // TODO: handle platform specific type\n });\n }}\n // @ts-expect-error styled-components have limited keyboard types('default' | 'email-address' | 'numeric' | 'phone-pad' | 'number-pad' | 'decimal-pad') compared to the actual supported types so ignoring the error.\n // source: https://reactnative.dev/docs/textinput/#keyboardtype\n keyboardType={KeyboardTypeToNativeValuesMap[keyboardType]}\n returnKeyType={keyboardReturnKeyType}\n autoCompleteType={\n autoCompleteSuggestionType\n ? (autoCompleteSuggestionTypeAndroid[\n autoCompleteSuggestionType as Platform.CastNative<\n BaseInputProps['autoCompleteSuggestionType']\n >\n ] as StyledComponentAutoCompleteAndroid)\n : undefined\n }\n secureTextEntry={type === 'password'}\n isTextArea={isTextArea}\n textContentType={\n autoCompleteSuggestionType\n ? autoCompleteSuggestionTypeIOS[\n autoCompleteSuggestionType as Platform.CastNative<\n BaseInputProps['autoCompleteSuggestionType']\n >\n ]\n : undefined\n }\n autoCapitalize={autoCapitalize}\n $size={$size}\n {...commonProps}\n {...props}\n {...accessibilityProps}\n />\n );\n};\n\nconst StyledBaseInput = assignWithoutSideEffects(React.forwardRef(_StyledBaseInput), {\n displayName: 'StyledBaseInput',\n});\n\nexport { StyledBaseInput };\n"],"names":["autoCompleteSuggestionTypeAndroid","none","name","email","username","password","newPassword","oneTimeCode","telephone","postalCode","countryName","creditCardNumber","creditCardCSC","creditCardExpiry","creditCardExpiryMonth","creditCardExpiryYear","autoCompleteSuggestionTypeIOS","KeyboardTypeToNativeValuesMap","text","search","url","decimal","getInputHeight","_ref","isTextArea","hasTags","numberOfLines","lineHeight","size","undefined","makeSize","sizeToken","baseInputHeight","getRNInputStyles","props","Object","assign","getBaseInputStyles","theme","isFocused","isDisabled","editable","validationState","leadingIcon","prefix","interactionElement","suffix","trailingIcon","isDropdownTrigger","$size","valueComponentType","RNPlatform","select","android","typography","lineHeights","ios","textAlignVertical","height","StyledNativeBaseInput","styled","TextInput","_ref2","id","StyledNativeBaseButton","TouchableOpacity","_ref3","_StyledBaseInput","_ref4","ref","isRequired","maxCharacters","handleOnFocus","handleOnChange","handleOnBlur","handleOnSubmit","handleOnInput","handleOnKeyDown","handleOnClick","_ref4$keyboardType","keyboardType","keyboardReturnKeyType","autoCompleteSuggestionType","accessibilityProps","currentInteraction","setCurrentInteraction","type","hasPopup","shouldIgnoreBlurAnimation","autoCapitalize","renderAs","as","_objectWithoutProperties","_excluded","buttonValue","value","placeholder","_useTheme","useTheme","commonProps","onBlur","_jsx","onPress","onFocus","children","Text","color","truncateAfterLines","textAlign","multiline","maxLength","placeholderTextColor","colors","surface","gray","disabled","event","nativeEvent","onChangeText","onEndEditing","onSubmitEditing","onKeyPress","key","returnKeyType","autoCompleteType","secureTextEntry","textContentType","StyledBaseInput","assignWithoutSideEffects","React","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,MAAA,CAAA,YAAA,CAAA,YAAA,CAAA,eAAA,CAAA,eAAA,CAAA,gBAAA,CAAA,cAAA,CAAA,gBAAA,CAAA,eAAA,CAAA,iBAAA,CAAA,eAAA,CAAA,cAAA,CAAA,uBAAA,CAAA,4BAAA,CAAA,oBAAA,CAAA,oBAAA,CAAA,uBAAA,CAAA,MAAA,CAAA,eAAA,CAAA,YAAA,CAAA,UAAA,CAAA,2BAAA,CAAA,gBAAA,CAAA,IAAA,CAAA,OAAA,CAAA,CAqCA,IAAMA,iCAAiC,CAAG,CACxCC,IAAI,CAAE,KAAK,CACXC,IAAI,CAAE,MAAM,CACZC,KAAK,CAAE,OAAO,CACdC,QAAQ,CAAE,UAAU,CACpBC,QAAQ,CAAE,UAAU,CACpBC,WAAW,CAAE,cAAc,CAC3BC,WAAW,CAAE,SAAS,CACtBC,SAAS,CAAE,KAAK,CAChBC,UAAU,CAAE,aAAa,CACzBC,WAAW,CAAE,wBAAwB,CACrCC,gBAAgB,CAAE,WAAW,CAC7BC,aAAa,CAAE,QAAQ,CACvBC,gBAAgB,CAAE,QAAQ,CAC1BC,qBAAqB,CAAE,cAAc,CACrCC,oBAAoB,CAAE,aACxB,CAAU,CAEV,IAAMC,6BAA6B,CAAG,C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} from './BaseInputVisuals.js';
2
- import { BASEINPUT_DEFAULT_HEIGHT } from './baseInputConfig.js';
2
+ import { getBaseInputBorderStyles } from './getBaseInputBorderStyles.native.js';
3
+ import { baseInputBackgroundColor, baseInputBorderColor, baseInputBorderWidth, baseInputPaddingTokens, baseInputHeight, baseInputWrapperMaxHeight } from './baseInputTokens.js';
3
4
  import getTextStyles from '../../Typography/Text/getTextStyles.js';
4
5
  import { makeSpace } from '../../../utils/makeSpace/makeSpace.js';
5
6
  import { makeBorderSize } from '../../../utils/makeBorderSize/makeBorderSize.js';
@@ -8,8 +9,10 @@ import { getPlatformType } from '../../../utils/getPlatformType/getPlatformType.
8
9
  import '@babel/runtime/helpers/slicedToArray';
9
10
  import 'react';
10
11
  import '../../BladeProvider/useTheme.js';
12
+ import getIn from '../../../utils/lodashButBetter/get.js';
13
+ import getHeadingStyles from '../../Typography/Heading/getHeadingStyles.js';
11
14
 
12
- var getInputBackgroundAndBorderStyles=function getInputBackgroundAndBorderStyles(_ref){var theme=_ref.theme,isHovered=_ref.isHovered,isFocused=_ref.isFocused,isDisabled=_ref.isDisabled,validationState=_ref.validationState,isTextArea=_ref.isTextArea,isDropdownTrigger=_ref.isDropdownTrigger;var backgroundColor=theme.colors.interactive.background.gray.default;var borderBottomColor=theme.colors.interactive.background.gray.highlighted;if(isHovered){backgroundColor=theme.colors.interactive.background.gray.highlighted;}if(isFocused){backgroundColor=theme.colors.interactive.background.primary.faded;}if(isDisabled){backgroundColor=theme.colors.interactive.background.gray.disabled;borderBottomColor='transparent';}if(validationState==='error'){backgroundColor=theme.colors.interactive.background.negative.faded;borderBottomColor=theme.colors.interactive.background.negative.default;}else if(validationState==='success'){backgroundColor=theme.colors.interactive.background.positive.faded;borderBottomColor=theme.colors.interactive.background.positive.default;}return {backgroundColor:backgroundColor,borderBottomColor:borderBottomColor,borderTopLeftRadius:makeBorderSize(theme.border.radius.small),borderTopRightRadius:makeBorderSize(theme.border.radius.small),borderBottomWidth:makeBorderSize(theme.border.width.thin),borderBottomStyle:'solid',display:'flex',flexDirection:'row',width:'100%',alignItems:isTextArea?'flex-start':undefined,position:'relative',height:isDropdownTrigger?'auto':undefined};};var getLeftPadding=function getLeftPadding(_ref2){var theme=_ref2.theme,isDropdownTrigger=_ref2.isDropdownTrigger,hasLeadingIcon=_ref2.hasLeadingIcon,hasPrefix=_ref2.hasPrefix;if(isDropdownTrigger){return theme.spacing[0];}if(hasLeadingIcon||hasPrefix){return theme.spacing[3];}return theme.spacing[4];};var getBaseInputStyles=function getBaseInputStyles(_ref3){var theme=_ref3.theme,isDisabled=_ref3.isDisabled,leadingIcon=_ref3.leadingIcon,prefix=_ref3.prefix,interactionElement=_ref3.interactionElement,suffix=_ref3.suffix,trailingIcon=_ref3.trailingIcon,textAlign=_ref3.textAlign,isTextArea=_ref3.isTextArea,hasTags=_ref3.hasTags,isDropdownTrigger=_ref3.isDropdownTrigger;var _getInputVisualsToBeR=getInputVisualsToBeRendered({leadingIcon:leadingIcon,prefix:prefix,interactionElement:interactionElement,suffix:suffix,trailingIcon:trailingIcon}),hasLeadingIcon=_getInputVisualsToBeR.hasLeadingIcon,hasPrefix=_getInputVisualsToBeR.hasPrefix,hasInteractionElement=_getInputVisualsToBeR.hasInteractionElement,hasSuffix=_getInputVisualsToBeR.hasSuffix,hasTrailingIcon=_getInputVisualsToBeR.hasTrailingIcon;var isDropdownWithTags=isDropdownTrigger&&hasTags;var isReactNative=getPlatformType()==='react-native';return Object.assign({},getTextStyles({size:'medium',variant:'body',weight:'regular',color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.subtle',theme:theme}),{flex:1,backgroundColor:'transparent',paddingTop:makeSpace(theme.spacing[3]),paddingBottom:makeSpace(theme.spacing[3]),paddingLeft:makeSpace(getLeftPadding({theme:theme,isDropdownTrigger:isDropdownTrigger,hasLeadingIcon:hasLeadingIcon,hasPrefix:hasPrefix})),paddingRight:hasInteractionElement||hasSuffix||hasTrailingIcon?makeSpace(theme.spacing[3]):makeSpace(theme.spacing[4]),textAlign:textAlign,width:'100%',height:isTextArea||isDropdownWithTags?undefined:makeSpace(BASEINPUT_DEFAULT_HEIGHT),minHeight:isDropdownWithTags?undefined:makeSpace(BASEINPUT_DEFAULT_HEIGHT)},isReactNative?{}:{resize:'none'});};
15
+ var getBaseInputState=function getBaseInputState(_ref){var isFocused=_ref.isFocused,isHovered=_ref.isHovered,isDisabled=_ref.isDisabled;if(isDisabled){return 'disabled';}else if(isFocused){return 'focused';}else if(isHovered){return 'hovered';}else {return 'default';}};var getInputBackgroundAndBorderStyles=function getInputBackgroundAndBorderStyles(_ref2){var theme=_ref2.theme,isHovered=_ref2.isHovered,isFocused=_ref2.isFocused,isDisabled=_ref2.isDisabled,validationState=_ref2.validationState,isTextArea=_ref2.isTextArea,isDropdownTrigger=_ref2.isDropdownTrigger;var backgroundColor=getIn(theme.colors,baseInputBackgroundColor.default);var borderColor=getIn(theme.colors,baseInputBorderColor.default);var borderWidth=getIn(theme.border.width,baseInputBorderWidth.default);var baseInputState=getBaseInputState({isFocused:isFocused,isHovered:isHovered,isDisabled:isDisabled});backgroundColor=getIn(theme.colors,baseInputBackgroundColor[baseInputState]);borderColor=getIn(theme.colors,baseInputBorderColor[baseInputState]);borderWidth=getIn(theme.border.width,baseInputBorderWidth[baseInputState]);if(validationState==='error'){borderColor=getIn(theme.colors,baseInputBorderColor.error);borderWidth=getIn(theme.border.width,baseInputBorderWidth.error);}else if(validationState==='success'){borderColor=getIn(theme.colors,baseInputBorderColor.success);borderWidth=getIn(theme.border.width,baseInputBorderWidth.success);}return Object.assign({backgroundColor:backgroundColor,borderRadius:makeBorderSize(theme.border.radius.medium),borderStyle:'solid',display:'flex',flexDirection:'row',width:'100%',alignItems:isTextArea?'flex-start':undefined,position:'relative',height:isDropdownTrigger?'auto':undefined,border:'none'},getBaseInputBorderStyles({theme:theme,borderColor:borderColor,borderWidth:borderWidth,isFocused:isFocused}));};var getLeftPadding=function getLeftPadding(_ref3){var theme=_ref3.theme,isDropdownTrigger=_ref3.isDropdownTrigger,hasLeadingIcon=_ref3.hasLeadingIcon,hasPrefix=_ref3.hasPrefix,size=_ref3.size;if(isDropdownTrigger){return theme.spacing[0];}if(hasLeadingIcon||hasPrefix){return theme.spacing[3];}return theme.spacing[baseInputPaddingTokens.left[size]];};var getRightPadding=function getRightPadding(_ref4){var theme=_ref4.theme,hasInteractionElement=_ref4.hasInteractionElement,hasSuffix=_ref4.hasSuffix,hasTrailingIcon=_ref4.hasTrailingIcon,size=_ref4.size;if(hasInteractionElement||hasSuffix||hasTrailingIcon){return theme.spacing[3];}return theme.spacing[baseInputPaddingTokens.right[size]];};var getBaseInputStyles=function getBaseInputStyles(_ref5){var theme=_ref5.theme,isDisabled=_ref5.isDisabled,leadingIcon=_ref5.leadingIcon,prefix=_ref5.prefix,interactionElement=_ref5.interactionElement,suffix=_ref5.suffix,trailingIcon=_ref5.trailingIcon,textAlign=_ref5.textAlign,isTextArea=_ref5.isTextArea,hasTags=_ref5.hasTags,isDropdownTrigger=_ref5.isDropdownTrigger,size=_ref5.size,valueComponentType=_ref5.valueComponentType;var _getInputVisualsToBeR=getInputVisualsToBeRendered({leadingIcon:leadingIcon,prefix:prefix,interactionElement:interactionElement,suffix:suffix,trailingIcon:trailingIcon,size:size}),hasLeadingIcon=_getInputVisualsToBeR.hasLeadingIcon,hasPrefix=_getInputVisualsToBeR.hasPrefix,hasInteractionElement=_getInputVisualsToBeR.hasInteractionElement,hasSuffix=_getInputVisualsToBeR.hasSuffix,hasTrailingIcon=_getInputVisualsToBeR.hasTrailingIcon;var isDropdownWithTags=isDropdownTrigger&&hasTags;var isReactNative=getPlatformType()==='react-native';return Object.assign({},valueComponentType==='heading'?getHeadingStyles({size:size,weight:'regular',color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.subtle',theme:theme}):getTextStyles({size:size,variant:'body',weight:'regular',color:isDisabled?'surface.text.gray.disabled':'surface.text.gray.subtle',theme:theme}),{flex:1,backgroundColor:'transparent',paddingTop:makeSpace(theme.spacing[baseInputPaddingTokens.top[size]]),paddingBottom:makeSpace(theme.spacing[baseInputPaddingTokens.bottom[size]]),paddingLeft:makeSpace(getLeftPadding({theme:theme,isDropdownTrigger:isDropdownTrigger,hasLeadingIcon:hasLeadingIcon,hasPrefix:hasPrefix,size:size})),paddingRight:getRightPadding({theme:theme,hasInteractionElement:hasInteractionElement,hasSuffix:hasSuffix,hasTrailingIcon:hasTrailingIcon,size:size}),textAlign:textAlign,width:'100%',height:isTextArea||isDropdownWithTags?undefined:makeSpace(baseInputHeight[size]),minHeight:isDropdownWithTags?undefined:makeSpace(baseInputHeight[size])},isReactNative?{}:{resize:'none'});};var getAnimatedBaseInputWrapperMaxHeight=function getAnimatedBaseInputWrapperMaxHeight(_ref6){var maxTagRows=_ref6.maxTagRows,showAllTags=_ref6.showAllTags,size=_ref6.size;if(maxTagRows==='single'){return baseInputHeight[size];}if(maxTagRows==='multiple'){return baseInputWrapperMaxHeight[size];}return showAllTags?baseInputWrapperMaxHeight[size]:baseInputHeight[size];};
13
16
 
14
- export { getBaseInputStyles, getInputBackgroundAndBorderStyles };
17
+ export { getAnimatedBaseInputWrapperMaxHeight, getBaseInputState, getBaseInputStyles, getInputBackgroundAndBorderStyles };
15
18
  //# sourceMappingURL=baseInputStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"baseInputStyles.js","sources":["../../../../../../src/components/Input/BaseInput/baseInputStyles.ts"],"sourcesContent":["import type { CSSObject } from 'styled-components';\nimport type { BaseInputProps } from './BaseInput';\nimport { getInputVisualsToBeRendered } from './BaseInputVisuals';\nimport { BASEINPUT_DEFAULT_HEIGHT } from './baseInputConfig';\nimport type { Theme } from '~components/BladeProvider';\nimport getTextStyles from '~components/Typography/Text/getTextStyles';\nimport { makeSpace } from '~utils/makeSpace';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport { getPlatformType } from '~utils';\n\ntype GetInputStyles = Pick<\n BaseInputProps,\n | 'isDisabled'\n | 'validationState'\n | 'leadingIcon'\n | 'prefix'\n | 'interactionElement'\n | 'suffix'\n | 'trailingIcon'\n | 'textAlign'\n | 'isDropdownTrigger'\n> & {\n isHovered?: boolean;\n isFocused?: boolean;\n isTextArea?: boolean;\n hasTags?: boolean;\n theme: Theme;\n};\n\nexport const getInputBackgroundAndBorderStyles = ({\n theme,\n isHovered,\n isFocused,\n isDisabled,\n validationState,\n isTextArea,\n isDropdownTrigger,\n}: Pick<\n GetInputStyles,\n | 'theme'\n | 'isFocused'\n | 'isDisabled'\n | 'validationState'\n | 'isHovered'\n | 'isTextArea'\n | 'isDropdownTrigger'\n>): CSSObject => {\n // normal state\n let backgroundColor = theme.colors.interactive.background.gray.default;\n let borderBottomColor = theme.colors.interactive.background.gray.highlighted;\n\n // hoverState\n if (isHovered) {\n backgroundColor = theme.colors.interactive.background.gray.highlighted;\n }\n\n // focused state\n if (isFocused) {\n backgroundColor = theme.colors.interactive.background.primary.faded;\n }\n\n // disabled state\n if (isDisabled) {\n backgroundColor = theme.colors.interactive.background.gray.disabled;\n borderBottomColor = 'transparent';\n }\n\n // validation state\n if (validationState === 'error') {\n backgroundColor = theme.colors.interactive.background.negative.faded;\n borderBottomColor = theme.colors.interactive.background.negative.default;\n } else if (validationState === 'success') {\n backgroundColor = theme.colors.interactive.background.positive.faded;\n borderBottomColor = theme.colors.interactive.background.positive.default;\n }\n\n return {\n backgroundColor,\n borderBottomColor,\n borderTopLeftRadius: makeBorderSize(theme.border.radius.small),\n borderTopRightRadius: makeBorderSize(theme.border.radius.small),\n borderBottomWidth: makeBorderSize(theme.border.width.thin),\n borderBottomStyle: 'solid',\n display: 'flex',\n flexDirection: 'row',\n width: '100%',\n alignItems: isTextArea ? 'flex-start' : undefined,\n position: 'relative',\n height: isDropdownTrigger ? 'auto' : undefined,\n };\n};\n\nconst getLeftPadding = ({\n theme,\n isDropdownTrigger,\n hasLeadingIcon,\n hasPrefix,\n}: {\n theme: Theme;\n hasLeadingIcon: boolean;\n hasPrefix: boolean;\n isDropdownTrigger: GetInputStyles['isDropdownTrigger'];\n}): number => {\n if (isDropdownTrigger) {\n return theme.spacing[0];\n }\n\n if (hasLeadingIcon || hasPrefix) {\n return theme.spacing[3];\n }\n\n return theme.spacing[4];\n};\n\nexport const getBaseInputStyles = ({\n theme,\n isDisabled,\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n textAlign,\n isTextArea,\n hasTags,\n isDropdownTrigger,\n}: GetInputStyles): CSSObject => {\n const {\n hasLeadingIcon,\n hasPrefix,\n hasInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n } = getInputVisualsToBeRendered({\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n });\n\n const isDropdownWithTags = isDropdownTrigger && hasTags;\n const isReactNative = getPlatformType() === 'react-native';\n\n return {\n ...getTextStyles({\n size: 'medium',\n variant: 'body',\n weight: 'regular',\n color: isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle',\n theme,\n }),\n // take the full available width of parent container for input field\n flex: 1,\n backgroundColor: 'transparent',\n paddingTop: makeSpace(theme.spacing[3]),\n paddingBottom: makeSpace(theme.spacing[3]),\n paddingLeft: makeSpace(getLeftPadding({ theme, isDropdownTrigger, hasLeadingIcon, hasPrefix })),\n paddingRight:\n hasInteractionElement || hasSuffix || hasTrailingIcon\n ? makeSpace(theme.spacing[3])\n : makeSpace(theme.spacing[4]),\n textAlign,\n width: '100%',\n height: isTextArea || isDropdownWithTags ? undefined : makeSpace(BASEINPUT_DEFAULT_HEIGHT),\n minHeight: isDropdownWithTags ? undefined : makeSpace(BASEINPUT_DEFAULT_HEIGHT),\n ...(isReactNative ? {} : { resize: 'none' }),\n };\n};\n"],"names":["getInputBackgroundAndBorderStyles","_ref","theme","isHovered","isFocused","isDisabled","validationState","isTextArea","isDropdownTrigger","backgroundColor","colors","interactive","background","gray","default","borderBottomColor","highlighted","primary","faded","disabled","negative","positive","borderTopLeftRadius","makeBorderSize","border","radius","small","borderTopRightRadius","borderBottomWidth","width","thin","borderBottomStyle","display","flexDirection","alignItems","undefined","position","height","getLeftPadding","_ref2","hasLeadingIcon","hasPrefix","spacing","getBaseInputStyles","_ref3","leadingIcon","prefix","interactionElement","suffix","trailingIcon","textAlign","hasTags","_getInputVisualsToBeR","getInputVisualsToBeRendered","hasInteractionElement","hasSuffix","hasTrailingIcon","isDropdownWithTags","isReactNative","getPlatformType","Object","assign","getTextStyles","size","variant","weight","color","flex","paddingTop","makeSpace","paddingBottom","paddingLeft","paddingRight","BASEINPUT_DEFAULT_HEIGHT","minHeight","resize"],"mappings":";;;;;;;;;;;AA6Ba,IAAAA,iCAAiC,CAAG,SAApCA,iCAAiCA,CAAAC,IAAA,CAiB7B,CAhBf,IAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,SAAS,CAAAF,IAAA,CAATE,SAAS,CACTC,SAAS,CAAAH,IAAA,CAATG,SAAS,CACTC,UAAU,CAAAJ,IAAA,CAAVI,UAAU,CACVC,eAAe,CAAAL,IAAA,CAAfK,eAAe,CACfC,UAAU,CAAAN,IAAA,CAAVM,UAAU,CACVC,iBAAiB,CAAAP,IAAA,CAAjBO,iBAAiB,CAYjB,IAAIC,eAAe,CAAGP,KAAK,CAACQ,MAAM,CAACC,WAAW,CAACC,UAAU,CAACC,IAAI,CAACC,OAAO,CACtE,IAAIC,iBAAiB,CAAGb,KAAK,CAACQ,MAAM,CAACC,WAAW,CAACC,UAAU,CAACC,IAAI,CAACG,WAAW,CAG5E,GAAIb,SAAS,CAAE,CACbM,eAAe,CAAGP,KAAK,CAACQ,MAAM,CAACC,WAAW,CAACC,UAAU,CAACC,IAAI,CAACG,WAAW,CACxE,CAGA,GAAIZ,SAAS,CAAE,CACbK,eAAe,CAAGP,KAAK,CAACQ,MAAM,CAACC,WAAW,CAACC,UAAU,CAACK,OAAO,CAACC,KAAK,CACrE,CAGA,GAAIb,UAAU,CAAE,CACdI,eAAe,CAAGP,KAAK,CAACQ,MAAM,CAACC,WAAW,C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AM,CAAE,MAAO,CAAC,EAE/C;;;;"}
1
+ {"version":3,"file":"baseInputStyles.js","sources":["../../../../../../src/components/Input/BaseInput/baseInputStyles.ts"],"sourcesContent":["import type { CSSObject } from 'styled-components';\nimport type { BaseInputProps } from './BaseInput';\nimport { getInputVisualsToBeRendered } from './BaseInputVisuals';\nimport { getBaseInputBorderStyles } from './getBaseInputBorderStyles';\nimport {\n baseInputBackgroundColor,\n baseInputBorderColor,\n baseInputBorderWidth,\n baseInputHeight,\n baseInputPaddingTokens,\n baseInputWrapperMaxHeight,\n} from './baseInputTokens';\nimport type { BaseInputWrapperProps } from './types';\nimport type { Theme } from '~components/BladeProvider';\nimport getTextStyles from '~components/Typography/Text/getTextStyles';\nimport { makeSpace } from '~utils/makeSpace';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport { getPlatformType } from '~utils';\nimport getIn from '~utils/lodashButBetter/get';\nimport getHeadingStyles from '~components/Typography/Heading/getHeadingStyles';\n\ntype GetInputStyles = Pick<\n BaseInputProps,\n | 'isDisabled'\n | 'validationState'\n | 'leadingIcon'\n | 'prefix'\n | 'interactionElement'\n | 'suffix'\n | 'trailingIcon'\n | 'textAlign'\n | 'isDropdownTrigger'\n | 'valueComponentType'\n> & {\n isHovered?: boolean;\n isFocused?: boolean;\n isTextArea?: boolean;\n hasTags?: boolean;\n theme: Theme;\n size: NonNullable<BaseInputProps['size']>;\n};\n\nexport const getBaseInputState = ({\n isFocused,\n isHovered,\n isDisabled,\n}: {\n isFocused?: boolean;\n isHovered?: boolean;\n isDisabled?: boolean;\n}): 'focused' | 'hovered' | 'disabled' | 'default' => {\n if (isDisabled) {\n return 'disabled';\n } else if (isFocused) {\n return 'focused';\n } else if (isHovered) {\n return 'hovered';\n } else {\n return 'default';\n }\n};\n\nexport const getInputBackgroundAndBorderStyles = ({\n theme,\n isHovered,\n isFocused,\n isDisabled,\n validationState,\n isTextArea,\n isDropdownTrigger,\n}: Pick<\n GetInputStyles,\n | 'theme'\n | 'isFocused'\n | 'isDisabled'\n | 'validationState'\n | 'isHovered'\n | 'isTextArea'\n | 'isDropdownTrigger'\n>): CSSObject => {\n // normal state\n let backgroundColor = getIn(theme.colors, baseInputBackgroundColor.default);\n let borderColor = getIn(theme.colors, baseInputBorderColor.default);\n let borderWidth = getIn(theme.border.width, baseInputBorderWidth.default);\n\n const baseInputState = getBaseInputState({ isFocused, isHovered, isDisabled });\n\n backgroundColor = getIn(theme.colors, baseInputBackgroundColor[baseInputState]);\n borderColor = getIn(theme.colors, baseInputBorderColor[baseInputState]);\n borderWidth = getIn(theme.border.width, baseInputBorderWidth[baseInputState]);\n\n if (validationState === 'error') {\n borderColor = getIn(theme.colors, baseInputBorderColor.error);\n borderWidth = getIn(theme.border.width, baseInputBorderWidth.error);\n } else if (validationState === 'success') {\n borderColor = getIn(theme.colors, baseInputBorderColor.success);\n borderWidth = getIn(theme.border.width, baseInputBorderWidth.success);\n }\n\n return {\n backgroundColor,\n borderRadius: makeBorderSize(theme.border.radius.medium),\n borderStyle: 'solid',\n display: 'flex',\n flexDirection: 'row',\n width: '100%',\n alignItems: isTextArea ? 'flex-start' : undefined,\n position: 'relative',\n height: isDropdownTrigger ? 'auto' : undefined,\n border: 'none',\n ...getBaseInputBorderStyles({ theme, borderColor, borderWidth, isFocused }),\n };\n};\n\nconst getLeftPadding = ({\n theme,\n isDropdownTrigger,\n hasLeadingIcon,\n hasPrefix,\n size,\n}: {\n theme: Theme;\n hasLeadingIcon: boolean;\n hasPrefix: boolean;\n isDropdownTrigger: GetInputStyles['isDropdownTrigger'];\n size: GetInputStyles['size'];\n}): number => {\n if (isDropdownTrigger) {\n return theme.spacing[0];\n }\n\n if (hasLeadingIcon || hasPrefix) {\n return theme.spacing[3];\n }\n\n return theme.spacing[baseInputPaddingTokens.left[size]];\n};\n\nconst getRightPadding = ({\n theme,\n hasInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n size,\n}: {\n theme: Theme;\n hasInteractionElement: boolean;\n hasSuffix: boolean;\n hasTrailingIcon: boolean;\n size: GetInputStyles['size'];\n}): number => {\n if (hasInteractionElement || hasSuffix || hasTrailingIcon) {\n return theme.spacing[3];\n }\n return theme.spacing[baseInputPaddingTokens.right[size]];\n};\n\nexport const getBaseInputStyles = ({\n theme,\n isDisabled,\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n textAlign,\n isTextArea,\n hasTags,\n isDropdownTrigger,\n size,\n valueComponentType,\n}: GetInputStyles): CSSObject => {\n const {\n hasLeadingIcon,\n hasPrefix,\n hasInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n } = getInputVisualsToBeRendered({\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n size,\n });\n\n const isDropdownWithTags = isDropdownTrigger && hasTags;\n const isReactNative = getPlatformType() === 'react-native';\n\n return {\n ...(valueComponentType === 'heading'\n ? getHeadingStyles({\n size,\n weight: 'regular',\n color: isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle',\n theme,\n })\n : getTextStyles({\n size,\n variant: 'body',\n weight: 'regular',\n color: isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle',\n theme,\n })),\n\n // take the full available width of parent container for input field\n flex: 1,\n backgroundColor: 'transparent',\n\n paddingTop: makeSpace(theme.spacing[baseInputPaddingTokens.top[size]]),\n paddingBottom: makeSpace(theme.spacing[baseInputPaddingTokens.bottom[size]]),\n paddingLeft: makeSpace(\n getLeftPadding({ theme, isDropdownTrigger, hasLeadingIcon, hasPrefix, size }),\n ),\n paddingRight: getRightPadding({\n theme,\n hasInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n size,\n }),\n\n textAlign,\n width: '100%',\n height: isTextArea || isDropdownWithTags ? undefined : makeSpace(baseInputHeight[size]),\n minHeight: isDropdownWithTags ? undefined : makeSpace(baseInputHeight[size]),\n ...(isReactNative ? {} : { resize: 'none' }),\n };\n};\n\nexport const getAnimatedBaseInputWrapperMaxHeight = ({\n maxTagRows,\n showAllTags,\n size,\n}: Pick<BaseInputWrapperProps, 'maxTagRows' | 'showAllTags' | 'size'>): number => {\n if (maxTagRows === 'single') {\n return baseInputHeight[size];\n }\n\n if (maxTagRows === 'multiple') {\n return baseInputWrapperMaxHeight[size];\n }\n\n // In expandable, max-height depends on the state\n return showAllTags ? baseInputWrapperMaxHeight[size] : baseInputHeight[size];\n};\n"],"names":["getBaseInputState","_ref","isFocused","isHovered","isDisabled","getInputBackgroundAndBorderStyles","_ref2","theme","validationState","isTextArea","isDropdownTrigger","backgroundColor","getIn","colors","baseInputBackgroundColor","default","borderColor","baseInputBorderColor","borderWidth","border","width","baseInputBorderWidth","baseInputState","error","success","Object","assign","borderRadius","makeBorderSize","radius","medium","borderStyle","display","flexDirection","alignItems","undefined","position","height","getBaseInputBorderStyles","getLeftPadding","_ref3","hasLeadingIcon","hasPrefix","size","spacing","baseInputPaddingTokens","left","getRightPadding","_ref4","hasInteractionElement","hasSuffix","hasTrailingIcon","right","getBaseInputStyles","_ref5","leadingIcon","prefix","interactionElement","suffix","trailingIcon","textAlign","hasTags","valueComponentType","_getInputVisualsToBeR","getInputVisualsToBeRendered","isDropdownWithTags","isReactNative","getPlatformType","getHeadingStyles","weight","color","getTextStyles","variant","flex","paddingTop","makeSpace","top","paddingBottom","bottom","paddingLeft","paddingRight","baseInputHeight","minHeight","resize","getAnimatedBaseInputWrapperMaxHeight","_ref6","maxTagRows","showAllTags","baseInputWrapperMaxHeight"],"mappings":";;;;;;;;;;;;;;AA0Ca,IAAAA,iBAAiB,CAAG,SAApBA,iBAAiBA,CAAAC,IAAA,CAQwB,CAPpD,IAAAC,SAAS,CAAAD,IAAA,CAATC,SAAS,CACTC,SAAS,CAAAF,IAAA,CAATE,SAAS,CACTC,UAAU,CAAAH,IAAA,CAAVG,UAAU,CAMV,GAAIA,UAAU,CAAE,CACd,OAAO,UAAU,CACnB,CAAC,KAAUF,GAAAA,SAAS,CAAE,CACpB,OAAO,SAAS,CAClB,CAAC,KAAM,GAAI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GA,OAAO4C,WAAW,CAAGC,yBAAyB,CAAC7C,IAAI,CAAC,CAAGsC,eAAe,CAACtC,IAAI,CAAC,CAC9E;;;;"}
@@ -0,0 +1,8 @@
1
+ import '../../../tokens/global/typography.js';
2
+ import '../../../tokens/global/motion.js';
3
+ import { size } from '../../../tokens/global/size.js';
4
+
5
+ var BASEINPUT_MAX_ROWS=4;var baseInputHeight={medium:size['36'],large:size['48']};var baseInputWrapperMaxHeight={medium:baseInputHeight.medium*BASEINPUT_MAX_ROWS,large:baseInputHeight.large*BASEINPUT_MAX_ROWS};var baseInputBorderColor={default:'interactive.border.gray.default',hovered:'interactive.border.gray.highlighted',focused:'interactive.border.primary.default',disabled:'interactive.border.gray.disabled',error:'interactive.border.negative.default',success:'interactive.border.positive.default'};var baseInputBackgroundColor={default:'surface.background.gray.intense',hovered:'surface.background.gray.moderate',focused:'surface.background.gray.moderate',disabled:'surface.background.gray.intense',error:'surface.background.gray.intense',success:'surface.background.gray.intense'};var baseInputBorderWidth={default:'thin',hovered:'thin',disabled:'thin',focused:'thick',error:'thick',success:'thick'};var baseInputBorderBackgroundMotion={enter:{duration:'xgentle',easing:'standard.revealing'},exit:{duration:'gentle',easing:'standard.effective'}};var baseInputPaddingTokens={top:{medium:3,large:4},bottom:{medium:3,large:4},left:{medium:4,large:4},right:{medium:4,large:4}};var formHintLeftLabelMarginLeft={medium:136,large:192};
6
+
7
+ export { BASEINPUT_MAX_ROWS, baseInputBackgroundColor, baseInputBorderBackgroundMotion, baseInputBorderColor, baseInputBorderWidth, baseInputHeight, baseInputPaddingTokens, baseInputWrapperMaxHeight, formHintLeftLabelMarginLeft };
8
+ //# sourceMappingURL=baseInputTokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"baseInputTokens.js","sources":["../../../../../../src/components/Input/BaseInput/baseInputTokens.ts"],"sourcesContent":["import type { BaseInputProps } from './BaseInput';\nimport { size, spacing } from '~tokens/global';\n\nexport const BASEINPUT_MAX_ROWS = 4;\n\nexport const TAG_HEIGHT = size['20'];\nexport const TAG_GAP = spacing['3'];\n\n/**\n * 36px\n */\nexport const baseInputHeight: Record<\n NonNullable<BaseInputProps['size']>,\n typeof size[keyof typeof size]\n> = {\n medium: size['36'],\n large: size['48'],\n};\n\n/**\n * medium - 144px (36px height * 4 rows)\n * large - 192px (48px height * 4 rows)\n */\n// we don't want exact number but rough number to be able to animate correctly in height.\nexport const baseInputWrapperMaxHeight = {\n medium: baseInputHeight.medium * BASEINPUT_MAX_ROWS,\n large: baseInputHeight.large * BASEINPUT_MAX_ROWS,\n} as const;\n\nexport const baseInputBorderColor = {\n default: 'interactive.border.gray.default',\n hovered: 'interactive.border.gray.highlighted',\n focused: 'interactive.border.primary.default',\n disabled: 'interactive.border.gray.disabled',\n error: 'interactive.border.negative.default',\n success: 'interactive.border.positive.default',\n} as const;\n\nexport const baseInputBackgroundColor = {\n default: 'surface.background.gray.intense',\n hovered: 'surface.background.gray.moderate',\n focused: 'surface.background.gray.moderate',\n disabled: 'surface.background.gray.intense',\n error: 'surface.background.gray.intense',\n success: 'surface.background.gray.intense',\n} as const;\n\nexport const baseInputBorderWidth = {\n default: 'thin',\n hovered: 'thin',\n disabled: 'thin',\n focused: 'thick',\n error: 'thick',\n success: 'thick',\n} as const;\n\nexport const baseInputBorderBackgroundMotion = {\n enter: { duration: 'xgentle', easing: 'standard.revealing' },\n exit: { duration: 'gentle', easing: 'standard.effective' },\n} as const;\n\nexport const baseInputPaddingTokens = {\n top: {\n medium: 3,\n large: 4,\n },\n bottom: {\n medium: 3,\n large: 4,\n },\n left: {\n medium: 4,\n large: 4,\n },\n right: {\n medium: 4,\n large: 4,\n },\n} as const;\n\n/* the magic number 192 is basically max-width of label \ni.e 176 and then right margin \ni.e 16 which is the spacing between label and input field */\nexport const formHintLeftLabelMarginLeft = {\n medium: 136,\n large: 192,\n} as const;\n"],"names":["BASEINPUT_MAX_ROWS","baseInputHeight","medium","size","large","baseInputWrapperMaxHeight","baseInputBorderColor","default","hovered","focused","disabled","error","success","baseInputBackgroundColor","baseInputBorderWidth","baseInputBorderBackgroundMotion","enter","duration","easing","exit","baseInputPaddingTokens","top","bottom","left","right","formHintLeftLabelMarginLeft"],"mappings":";;;;AAGa,IAAAA,kBAAkB,CAAG,EAQrB,IAAAC,eAGZ,CAAG,CACFC,MAAM,CAAEC,IAAI,CAAC,IAAI,CAAC,CAClBC,KAAK,CAAED,IAAI,CAAC,IAAI,CAClB,EAOa,IAAAE,yBAAyB,CAAG,CACvCH,MAAM,CAAED,eAAe,CAACC,MAAM,CAAGF,kBAAkB,CACnDI,KAAK,CAAEH,eAAe,CAACG,KAAK,CAAGJ,kBACjC,EAEa,IAAAM,oBAAoB,CAAG,CAClCC,OAAO,CAAE,iCAAiC,CAC1CC,OAAO,CAAE,qCAAqC,CAC9CC,OAAO,CAAE,oCAAoC,CAC7CC,QAAQ,CAAE,kCAAkC,CAC5CC,KAAK,CAAE,qCAAqC,CAC5CC,OAAO,CAAE,qCACX,EAEa,IAAAC,wBAAwB,CAAG,CACtCN,OAAO,CAAE,iCAAiC,CAC1CC,OAAO,CAAE,kCAAkC,CAC3CC,OAAO,CAAE,kCAAkC,CAC3CC,QAAQ,CAAE,iCAAiC,CAC3CC,KAAK,CAAE,iCAAiC,CACxCC,OAAO,CAAE,iCACX,EAEa,IAAAE,oBAAoB,CAAG,CAClCP,OAAO,CAAE,MAAM,CACfC,OAAO,CAAE,MAAM,CACfE,QAAQ,CAAE,MAAM,CAChBD,OAAO,CAAE,OAAO,CAChBE,KAAK,CAAE,OAAO,CACdC,OAAO,CAAE,OACX,EAEa,IAAAG,+BAA+B,CAAG,CAC7CC,KAAK,CAAE,CAAEC,QAAQ,CAAE,SAAS,CAAEC,MAAM,CAAE,oBAAqB,CAAC,CAC5DC,IAAI,CAAE,CAAEF,QAAQ,CAAE,QAAQ,CAAEC,MAAM,CAAE,oBAAqB,CAC3D,EAEa,IAAAE,sBAAsB,CAAG,CACpCC,GAAG,CAAE,CACHnB,MAAM,CAAE,CAAC,CACTE,KAAK,CAAE,CACT,CAAC,CACDkB,MAAM,CAAE,CACNpB,MAAM,CAAE,CAAC,CACTE,KAAK,CAAE,CACT,CAAC,CACDmB,IAAI,CAAE,CACJrB,MAAM,CAAE,CAAC,CACTE,KAAK,CAAE,CACT,CAAC,CACDoB,KAAK,CAAE,CACLtB,MAAM,CAAE,CAAC,CACTE,KAAK,CAAE,CACT,CACF,EAKa,IAAAqB,2BAA2B,CAAG,CACzCvB,MAAM,CAAE,GAAG,CACXE,KAAK,CAAE,GACT;;;;"}
@@ -0,0 +1,4 @@
1
+ var getBaseInputBorderStyles=function getBaseInputBorderStyles(_ref){var borderColor=_ref.borderColor;return {borderColor:borderColor};};
2
+
3
+ export { getBaseInputBorderStyles };
4
+ //# sourceMappingURL=getBaseInputBorderStyles.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBaseInputBorderStyles.native.js","sources":["../../../../../../src/components/Input/BaseInput/getBaseInputBorderStyles.native.ts"],"sourcesContent":["import type { CSSObject } from 'styled-components';\nimport type { Theme } from '~components/BladeProvider';\n\nconst getBaseInputBorderStyles = ({\n borderColor,\n}: {\n theme: Theme;\n borderWidth: number;\n borderColor: string;\n isFocused?: boolean;\n}): CSSObject => ({\n borderColor,\n});\n\nexport { getBaseInputBorderStyles };\n"],"names":["getBaseInputBorderStyles","_ref","borderColor"],"mappings":"AAGM,IAAAA,wBAAwB,CAAG,SAA3BA,wBAAwBA,CAAAC,IAAA,CAC5B,CAAA,IAAAC,WAAW,CAAAD,IAAA,CAAXC,WAAW,CAMK,OAAA,CAChBA,WAAW,CAAXA,WACF,CAAC,CAAA;;;;"}
@@ -14,7 +14,7 @@ import { getTagsGroup } from '../../Tag/getTagsGroup.js';
14
14
  import { useFirstRender } from '../../../utils/useFirstRender.js';
15
15
  import { jsx } from 'react/jsx-runtime';
16
16
 
17
- var useControlledDropdownInput=function useControlledDropdownInput(props){var isFirstRender=useFirstRender();var _useDropdown=useDropdown(),changeCallbackTriggerer=_useDropdown.changeCallbackTriggerer,isControlled=_useDropdown.isControlled,options=_useDropdown.options,selectedIndices=_useDropdown.selectedIndices,controlledValueIndices=_useDropdown.controlledValueIndices,setSelectedIndices=_useDropdown.setSelectedIndices,selectionType=_useDropdown.selectionType,setIsControlled=_useDropdown.setIsControlled;var getValuesArrayFromIndices=function getValuesArrayFromIndices(){var indices=[];if(isControlled){indices=controlledValueIndices;}else {indices=selectedIndices;}return indices.map(function(selectionIndex){return options[selectionIndex].value;});};var selectValues=function selectValues(valuesToSelect){if(options.length>0){if(isEmpty(valuesToSelect)){setSelectedIndices([]);}else if(typeof valuesToSelect==='string'){var selectedItemIndex=options.findIndex(function(option){return option.value===valuesToSelect;});if(selectedItemIndex>=0){setSelectedIndices([selectedItemIndex]);}}else {var uniqueValues=Array.from(new Set(valuesToSelect));var userValues=selectionType==='single'?[valuesToSelect==null?void 0:valuesToSelect[0]]:uniqueValues;var selectedItemIndices=userValues.map(function(optionValue){return options.findIndex(function(option){return option.value===optionValue;});}).filter(function(value){return value>=0;});setSelectedIndices(selectedItemIndices);}}};React__default.useEffect(function(){if(options.length>0&&props.defaultValue){selectValues(props.defaultValue);}},[options.length]);React__default.useEffect(function(){if(options.length>0&&props.value!==undefined){if(!isControlled){setIsControlled(true);}selectValues(props.value);if(selectionType==='single'&&!Array.isArray(props.value)&&!props.isSelectInput){props.syncInputValueWithSelection==null?void 0:props.syncInputValueWithSelection(props.value);}}},[props.value,options]);React__default.useEffect(function(){if(!isFirstRender){props.onChange==null?void 0:props.onChange({name:props.name,values:getValuesArrayFromIndices()});}},[changeCallbackTriggerer]);};var _BaseDropdownInputTrigger=function _BaseDropdownInputTrigger(props,ref){var _props$placeholder,_props$maxRows,_props$label;var _useDropdown2=useDropdown(),isOpen=_useDropdown2.isOpen,activeTagIndex=_useDropdown2.activeTagIndex,setActiveTagIndex=_useDropdown2.setActiveTagIndex,displayValue=_useDropdown2.displayValue,selectionType=_useDropdown2.selectionType,dropdownTriggerer=_useDropdown2.dropdownTriggerer,dropdownBaseId=_useDropdown2.dropdownBaseId,selectedIndices=_useDropdown2.selectedIndices,triggererRef=_useDropdown2.triggererRef,triggererWrapperRef=_useDropdown2.triggererWrapperRef,isTagDismissedRef=_useDropdown2.isTagDismissedRef,onTriggerClick=_useDropdown2.onTriggerClick,value=_useDropdown2.value,shouldIgnoreBlurAnimation=_useDropdown2.shouldIgnoreBlurAnimation,setShouldIgnoreBlurAnimation=_useDropdown2.setShouldIgnoreBlurAnimation,activeIndex=_useDropdown2.activeIndex,hasFooterAction=_useDropdown2.hasFooterAction,hasAutoCompleteInBottomSheetHeader=_useDropdown2.hasAutoCompleteInBottomSheetHeader,options=_useDropdown2.options,removeOption=_useDropdown2.removeOption,setChangeCallbackTriggerer=_useDropdown2.setChangeCallbackTriggerer,changeCallbackTriggerer=_useDropdown2.changeCallbackTriggerer;var dropdownTriggerPlaceholder=(_props$placeholder=props.placeholder)!=null?_props$placeholder:'Select Option';var isAutoCompleteInHeader=!props.isSelectInput&&hasAutoCompleteInBottomSheetHeader;var getShowAllTags=React__default.useCallback(function(){if(hasAutoCompleteInBottomSheetHeader){if(props.isSelectInput){return false;}return true;}return isOpen;},[hasAutoCompleteInBottomSheetHeader,props.isSelectInput,isOpen]);useControlledDropdownInput({onChange:props.onChange,name:props.name,value:props.value,defaultValue:props.defaultValue,syncInputValueWithSelection:props.syncInputValueWithSelection,isSelectInput:props.isSelectInput});var getValue=function getValue(){var prefix='';if(props.labelPosition==='inside-input'&&props.label){prefix=`${props.label}: `;}if(props.isSelectInput){if(selectionType==='single'){return `${prefix}${displayValue}`;}return undefined;}return props.inputValue;};var getTags=React__default.useMemo(function(){return function(){if(selectionType==='single'){return undefined;}return getTagsGroup({tags:selectedIndices.map(function(selectedIndex){var _options$selectedInde;return (_options$selectedInde=options[selectedIndex])==null?void 0:_options$selectedInde.title;}),activeTagIndex:activeTagIndex,isDisabled:props.isDisabled,onDismiss:function onDismiss(_ref){var tagIndex=_ref.tagIndex;if(isTagDismissedRef.current){isTagDismissedRef.current.value=true;}if(!isReactNative()){var _triggererRef$current;(_triggererRef$current=triggererRef.current)==null?void 0:_triggererRef$current.focus();}removeOption(selectedIndices[tagIndex]);setChangeCallbackTriggerer(Number(changeCallbackTriggerer)+1);}});};},[selectedIndices,selectionType,activeTagIndex,changeCallbackTriggerer,options]);return jsx(BaseInput,{as:props.isSelectInput?'button':'input',ref:!isReactNative()?function(node){triggererRef.current=node;if(ref){if(typeof ref==='function'){ref(node);}else {ref.current=node;}}}:null,isDropdownTrigger:true,setInputWrapperRef:function setInputWrapperRef(wrapperNode){triggererWrapperRef.current=wrapperNode;},maxTagRows:(_props$maxRows=props.maxRows)!=null?_props$maxRows:'single',tags:getTags(),showAllTags:getShowAllTags(),activeTagIndex:activeTagIndex,setActiveTagIndex:setActiveTagIndex,shouldIgnoreBlurAnimation:shouldIgnoreBlurAnimation,setShouldIgnoreBlurAnimation:setShouldIgnoreBlurAnimation,textAlign:"left",label:props.label,placeholder:selectionType==='multiple'&&selectedIndices.length>0?undefined:dropdownTriggerPlaceholder,hideLabelText:((_props$label=props.label)==null?void 0:_props$label.length)===0,accessibilityLabel:props.accessibilityLabel,labelPosition:props.labelPosition==='inside-input'?undefined:props.labelPosition,isLabelInsideInput:props.labelPosition==='inside-input',necessityIndicator:props.necessityIndicator,autoCompleteSuggestionType:"none",validationState:props.validationState,helpText:props.helpText,errorText:props.errorText,successText:props.successText,name:props.name,isDisabled:props.isDisabled,isRequired:props.isRequired,prefix:props.prefix,suffix:props.suffix,autoFocus:props.autoFocus,value:getValue(),onClick:function onClick(e){if(props.isDisabled){return;}props.onTriggerClick==null?void 0:props.onTriggerClick(e);},onFocus:props.onFocus,onBlur:function onBlur(_ref2){var name=_ref2.name;props.onBlur==null?void 0:props.onBlur({name:name,value:value});},leadingIcon:props.icon,componentName:props.isSelectInput?MetaConstants.SelectInput:MetaConstants.AutoComplete,testID:props.testID,id:`${dropdownBaseId}-trigger`,labelId:`${dropdownBaseId}-label`,hasPopup:getActionListContainerRole(hasFooterAction,dropdownTriggerer),isPopupExpanded:isOpen,activeDescendant:activeIndex>=0?`${dropdownBaseId}-${activeIndex}`:undefined,popupId:`${dropdownBaseId}-actionlist`,onChange:props.isSelectInput?undefined:props.onInputValueChange,onKeyDown:props.onTriggerKeydown,interactionElement:isAutoCompleteInHeader?null:jsx(InputChevronIcon,{onClick:function onClick(){if(!props.isDisabled){if(!isReactNative()){var _triggererRef$current2;(_triggererRef$current2=triggererRef.current)==null?void 0:_triggererRef$current2.focus();}onTriggerClick();}},isDisabled:props.isDisabled,isOpen:isOpen})});};var BaseDropdownInputTrigger=React__default.forwardRef(_BaseDropdownInputTrigger);
17
+ var useControlledDropdownInput=function useControlledDropdownInput(props){var isFirstRender=useFirstRender();var _useDropdown=useDropdown(),changeCallbackTriggerer=_useDropdown.changeCallbackTriggerer,isControlled=_useDropdown.isControlled,options=_useDropdown.options,selectedIndices=_useDropdown.selectedIndices,controlledValueIndices=_useDropdown.controlledValueIndices,setSelectedIndices=_useDropdown.setSelectedIndices,selectionType=_useDropdown.selectionType,setIsControlled=_useDropdown.setIsControlled;var getValuesArrayFromIndices=function getValuesArrayFromIndices(){var indices=[];if(isControlled){indices=controlledValueIndices;}else {indices=selectedIndices;}return indices.map(function(selectionIndex){return options[selectionIndex].value;});};var selectValues=function selectValues(valuesToSelect){if(options.length>0){if(isEmpty(valuesToSelect)){setSelectedIndices([]);}else if(typeof valuesToSelect==='string'){var selectedItemIndex=options.findIndex(function(option){return option.value===valuesToSelect;});if(selectedItemIndex>=0){setSelectedIndices([selectedItemIndex]);}}else {var uniqueValues=Array.from(new Set(valuesToSelect));var userValues=selectionType==='single'?[valuesToSelect==null?void 0:valuesToSelect[0]]:uniqueValues;var selectedItemIndices=userValues.map(function(optionValue){return options.findIndex(function(option){return option.value===optionValue;});}).filter(function(value){return value>=0;});setSelectedIndices(selectedItemIndices);}}};React__default.useEffect(function(){if(options.length>0&&props.defaultValue){selectValues(props.defaultValue);}},[options.length]);React__default.useEffect(function(){if(options.length>0&&props.value!==undefined){if(!isControlled){setIsControlled(true);}selectValues(props.value);if(selectionType==='single'&&!Array.isArray(props.value)&&!props.isSelectInput){props.syncInputValueWithSelection==null?void 0:props.syncInputValueWithSelection(props.value);}}},[props.value,options]);React__default.useEffect(function(){if(!isFirstRender){props.onChange==null?void 0:props.onChange({name:props.name,values:getValuesArrayFromIndices()});}},[changeCallbackTriggerer]);};var _BaseDropdownInputTrigger=function _BaseDropdownInputTrigger(props,ref){var _props$placeholder,_props$maxRows,_props$label;var _useDropdown2=useDropdown(),isOpen=_useDropdown2.isOpen,activeTagIndex=_useDropdown2.activeTagIndex,setActiveTagIndex=_useDropdown2.setActiveTagIndex,displayValue=_useDropdown2.displayValue,selectionType=_useDropdown2.selectionType,dropdownTriggerer=_useDropdown2.dropdownTriggerer,dropdownBaseId=_useDropdown2.dropdownBaseId,selectedIndices=_useDropdown2.selectedIndices,triggererRef=_useDropdown2.triggererRef,triggererWrapperRef=_useDropdown2.triggererWrapperRef,isTagDismissedRef=_useDropdown2.isTagDismissedRef,onTriggerClick=_useDropdown2.onTriggerClick,value=_useDropdown2.value,shouldIgnoreBlurAnimation=_useDropdown2.shouldIgnoreBlurAnimation,setShouldIgnoreBlurAnimation=_useDropdown2.setShouldIgnoreBlurAnimation,activeIndex=_useDropdown2.activeIndex,hasFooterAction=_useDropdown2.hasFooterAction,hasAutoCompleteInBottomSheetHeader=_useDropdown2.hasAutoCompleteInBottomSheetHeader,options=_useDropdown2.options,removeOption=_useDropdown2.removeOption,setChangeCallbackTriggerer=_useDropdown2.setChangeCallbackTriggerer,changeCallbackTriggerer=_useDropdown2.changeCallbackTriggerer;var dropdownTriggerPlaceholder=(_props$placeholder=props.placeholder)!=null?_props$placeholder:'Select Option';var isAutoCompleteInHeader=!props.isSelectInput&&hasAutoCompleteInBottomSheetHeader;var getShowAllTags=React__default.useCallback(function(){if(hasAutoCompleteInBottomSheetHeader){if(props.isSelectInput){return false;}return true;}return isOpen;},[hasAutoCompleteInBottomSheetHeader,props.isSelectInput,isOpen]);useControlledDropdownInput({onChange:props.onChange,name:props.name,value:props.value,defaultValue:props.defaultValue,syncInputValueWithSelection:props.syncInputValueWithSelection,isSelectInput:props.isSelectInput});var getValue=function getValue(){var prefix='';if(props.labelPosition==='inside-input'&&props.label){prefix=`${props.label}: `;}if(props.isSelectInput){if(selectionType==='single'){return `${prefix}${displayValue}`;}return undefined;}return props.inputValue;};var getTags=React__default.useMemo(function(){return function(_ref){var size=_ref.size;if(selectionType==='single'){return undefined;}return getTagsGroup({size:size,tags:selectedIndices.map(function(selectedIndex){var _options$selectedInde;return (_options$selectedInde=options[selectedIndex])==null?void 0:_options$selectedInde.title;}),activeTagIndex:activeTagIndex,isDisabled:props.isDisabled,onDismiss:function onDismiss(_ref2){var tagIndex=_ref2.tagIndex;if(isTagDismissedRef.current){isTagDismissedRef.current.value=true;}if(!isReactNative()){var _triggererRef$current;(_triggererRef$current=triggererRef.current)==null?void 0:_triggererRef$current.focus();}removeOption(selectedIndices[tagIndex]);setChangeCallbackTriggerer(Number(changeCallbackTriggerer)+1);}});};},[selectedIndices,selectionType,activeTagIndex,changeCallbackTriggerer,options]);return jsx(BaseInput,{as:props.isSelectInput?'button':'input',ref:!isReactNative()?function(node){triggererRef.current=node;if(ref){if(typeof ref==='function'){ref(node);}else {ref.current=node;}}}:null,isDropdownTrigger:true,setInputWrapperRef:function setInputWrapperRef(wrapperNode){triggererWrapperRef.current=wrapperNode;},maxTagRows:(_props$maxRows=props.maxRows)!=null?_props$maxRows:'single',tags:getTags({size:props.size||'medium'}),showAllTags:getShowAllTags(),activeTagIndex:activeTagIndex,setActiveTagIndex:setActiveTagIndex,shouldIgnoreBlurAnimation:shouldIgnoreBlurAnimation,setShouldIgnoreBlurAnimation:setShouldIgnoreBlurAnimation,textAlign:"left",label:props.label,placeholder:selectionType==='multiple'&&selectedIndices.length>0?undefined:dropdownTriggerPlaceholder,hideLabelText:((_props$label=props.label)==null?void 0:_props$label.length)===0,accessibilityLabel:props.accessibilityLabel,labelPosition:props.labelPosition==='inside-input'?undefined:props.labelPosition,isLabelInsideInput:props.labelPosition==='inside-input',necessityIndicator:props.necessityIndicator,autoCompleteSuggestionType:"none",validationState:props.validationState,helpText:props.helpText,errorText:props.errorText,successText:props.successText,name:props.name,isDisabled:props.isDisabled,isRequired:props.isRequired,prefix:props.prefix,suffix:props.suffix,autoFocus:props.autoFocus,value:getValue(),onClick:function onClick(e){if(props.isDisabled){return;}props.onTriggerClick==null?void 0:props.onTriggerClick(e);},onFocus:props.onFocus,onBlur:function onBlur(_ref3){var name=_ref3.name;props.onBlur==null?void 0:props.onBlur({name:name,value:value});},leadingIcon:props.icon,componentName:props.isSelectInput?MetaConstants.SelectInput:MetaConstants.AutoComplete,testID:props.testID,id:`${dropdownBaseId}-trigger`,labelId:`${dropdownBaseId}-label`,hasPopup:getActionListContainerRole(hasFooterAction,dropdownTriggerer),isPopupExpanded:isOpen,activeDescendant:activeIndex>=0?`${dropdownBaseId}-${activeIndex}`:undefined,popupId:`${dropdownBaseId}-actionlist`,onChange:props.isSelectInput?undefined:props.onInputValueChange,onKeyDown:props.onTriggerKeydown,size:props.size,interactionElement:isAutoCompleteInHeader?null:jsx(InputChevronIcon,{onClick:function onClick(){if(!props.isDisabled){if(!isReactNative()){var _triggererRef$current2;(_triggererRef$current2=triggererRef.current)==null?void 0:_triggererRef$current2.focus();}onTriggerClick();}},isDisabled:props.isDisabled,isOpen:isOpen})});};var BaseDropdownInputTrigger=React__default.forwardRef(_BaseDropdownInputTrigger);
18
18
 
19
19
  export { BaseDropdownInputTrigger };
20
20
  //# sourceMappingURL=BaseDropdownInputTrigger.js.map