@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,11 +1,13 @@
1
- import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
1
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
2
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
3
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
4
  import React__default from 'react';
5
+ import styled from 'styled-components';
5
6
  import { StyledBaseInput } from './StyledBaseInput.web.js';
6
7
  import { BaseInputVisuals } from './BaseInputVisuals.js';
7
8
  import { BaseInputWrapper } from './BaseInputWrapper.js';
8
9
  import { BaseInputTagSlot } from './BaseInputTagSlot.web.js';
10
+ import { baseInputBorderBackgroundMotion, formHintLeftLabelMarginLeft } from './baseInputTokens.js';
9
11
  import '../../Form/index.js';
10
12
  import '../../Box/BaseBox/index.js';
11
13
  import '../../Box/styledProps/index.js';
@@ -19,14 +21,20 @@ import '../../../utils/makeAccessible/index.js';
19
21
  import '../../../utils/logger/index.js';
20
22
  import { announce } from '../../LiveAnnouncer/LiveAnnouncer.web.js';
21
23
  import '../../../utils/assignWithoutSideEffects/index.js';
24
+ import '../../../utils/getFocusRingStyles/index.js';
25
+ import getIn from '../../../utils/lodashButBetter/get.js';
22
26
  import { jsxs, jsx } from 'react/jsx-runtime';
23
27
  import { throwBladeError } from '../../../utils/logger/logger.js';
24
28
  import { getPlatformType } from '../../../utils/getPlatformType/getPlatformType.js';
25
29
  import { isReactNative } from '../../../utils/platform/isReactNative.js';
30
+ import { BaseBox } from '../../Box/BaseBox/BaseBox.web.js';
31
+ import { makeBorderSize } from '../../../utils/makeBorderSize/makeBorderSize.js';
32
+ import { getFocusRingStyles } from '../../../utils/getFocusRingStyles/getFocusRingStyles.web.js';
33
+ import { castWebType } from '../../../utils/platform/castUtils.js';
34
+ import { makeMotionTime } from '../../../utils/makeMotionTime/makeMotionTime.web.js';
26
35
  import useTheme from '../../BladeProvider/useTheme.js';
27
36
  import { useBreakpoint } from '../../../utils/useBreakpoint/useBreakpoint.js';
28
37
  import { makeAccessible } from '../../../utils/makeAccessible/makeAccessible.web.js';
29
- import { BaseBox } from '../../Box/BaseBox/BaseBox.web.js';
30
38
  import { metaAttribute } from '../../../utils/metaAttribute/metaAttribute.web.js';
31
39
  import { getStyledProps } from '../../Box/styledProps/getStyledProps.js';
32
40
  import { FormLabel } from '../../Form/FormLabel.js';
@@ -35,7 +43,7 @@ import { makeSize } from '../../../utils/makeSize/makeSize.js';
35
43
  import { FormHint } from '../../Form/FormHint.js';
36
44
  import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
37
45
 
38
- var _excluded = ["as", "label", "labelPosition", "placeholder", "type", "defaultValue", "tags", "showAllTags", "activeTagIndex", "setActiveTagIndex", "name", "value", "onFocus", "onChange", "onInput", "onBlur", "onSubmit", "onClick", "onKeyDown", "isDisabled", "necessityIndicator", "validationState", "errorText", "helpText", "successText", "isRequired", "leadingIcon", "prefix", "interactionElement", "suffix", "trailingIcon", "maxCharacters", "textAlign", "autoFocus", "keyboardReturnKeyType", "keyboardType", "autoCompleteSuggestionType", "trailingHeaderSlot", "trailingFooterSlot", "numberOfLines", "id", "componentName", "accessibilityLabel", "labelId", "activeDescendant", "hideLabelText", "hideFormHint", "hasPopup", "popupId", "isPopupExpanded", "maxTagRows", "shouldIgnoreBlurAnimation", "setShouldIgnoreBlurAnimation", "autoCapitalize", "setInputWrapperRef", "testID", "isDropdownTrigger", "isLabelInsideInput"];
46
+ var _excluded = ["as", "label", "labelPosition", "placeholder", "type", "defaultValue", "tags", "showAllTags", "activeTagIndex", "setActiveTagIndex", "name", "value", "onFocus", "onChange", "onInput", "onBlur", "onSubmit", "onClick", "onKeyDown", "isDisabled", "necessityIndicator", "validationState", "errorText", "helpText", "successText", "isRequired", "leadingIcon", "prefix", "interactionElement", "suffix", "trailingIcon", "maxCharacters", "textAlign", "autoFocus", "keyboardReturnKeyType", "keyboardType", "autoCompleteSuggestionType", "trailingHeaderSlot", "trailingFooterSlot", "numberOfLines", "id", "componentName", "accessibilityLabel", "labelId", "activeDescendant", "hideLabelText", "hideFormHint", "hasPopup", "popupId", "isPopupExpanded", "maxTagRows", "shouldIgnoreBlurAnimation", "setShouldIgnoreBlurAnimation", "autoCapitalize", "setInputWrapperRef", "testID", "isDropdownTrigger", "isLabelInsideInput", "size", "trailingButton", "valueComponentType"];
39
47
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
40
48
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
41
49
  var autoCompleteSuggestionTypeValues = ['none', 'on', 'name', 'email', 'username', 'password', 'newPassword', 'oneTimeCode', 'telephone', 'postalCode', 'countryName', 'creditCardNumber', 'creditCardCSC', 'creditCardExpiry', 'creditCardExpiryMonth', 'creditCardExpiryYear'];
@@ -272,71 +280,93 @@ var getDescribedByElementId = function getDescribedByElementId(_ref10) {
272
280
  }
273
281
  return '';
274
282
  };
275
- var _BaseInput = function _BaseInput(_ref11, ref) {
276
- var _ref11$as = _ref11.as,
277
- as = _ref11$as === void 0 ? 'input' : _ref11$as,
278
- label = _ref11.label,
279
- _ref11$labelPosition = _ref11.labelPosition,
280
- labelPosition = _ref11$labelPosition === void 0 ? 'top' : _ref11$labelPosition,
281
- placeholder = _ref11.placeholder,
282
- _ref11$type = _ref11.type,
283
- type = _ref11$type === void 0 ? 'text' : _ref11$type,
284
- defaultValue = _ref11.defaultValue,
285
- tags = _ref11.tags,
286
- _ref11$showAllTags = _ref11.showAllTags,
287
- showAllTags = _ref11$showAllTags === void 0 ? false : _ref11$showAllTags,
288
- _ref11$activeTagIndex = _ref11.activeTagIndex,
289
- activeTagIndex = _ref11$activeTagIndex === void 0 ? -1 : _ref11$activeTagIndex,
290
- setActiveTagIndex = _ref11.setActiveTagIndex,
291
- name = _ref11.name,
292
- value = _ref11.value,
293
- onFocus = _ref11.onFocus,
294
- onChange = _ref11.onChange,
295
- onInput = _ref11.onInput,
296
- onBlur = _ref11.onBlur,
297
- onSubmit = _ref11.onSubmit,
298
- onClick = _ref11.onClick,
299
- onKeyDown = _ref11.onKeyDown,
300
- isDisabled = _ref11.isDisabled,
301
- necessityIndicator = _ref11.necessityIndicator,
302
- validationState = _ref11.validationState,
303
- errorText = _ref11.errorText,
304
- helpText = _ref11.helpText,
305
- successText = _ref11.successText,
306
- isRequired = _ref11.isRequired,
307
- leadingIcon = _ref11.leadingIcon,
308
- prefix = _ref11.prefix,
309
- interactionElement = _ref11.interactionElement,
310
- suffix = _ref11.suffix,
311
- trailingIcon = _ref11.trailingIcon,
312
- maxCharacters = _ref11.maxCharacters,
313
- textAlign = _ref11.textAlign,
314
- autoFocus = _ref11.autoFocus,
315
- keyboardReturnKeyType = _ref11.keyboardReturnKeyType,
316
- keyboardType = _ref11.keyboardType,
317
- autoCompleteSuggestionType = _ref11.autoCompleteSuggestionType,
318
- trailingHeaderSlot = _ref11.trailingHeaderSlot,
319
- trailingFooterSlot = _ref11.trailingFooterSlot,
320
- numberOfLines = _ref11.numberOfLines,
321
- id = _ref11.id,
322
- componentName = _ref11.componentName,
323
- accessibilityLabel = _ref11.accessibilityLabel,
324
- labelId = _ref11.labelId,
325
- activeDescendant = _ref11.activeDescendant,
326
- hideLabelText = _ref11.hideLabelText,
327
- hideFormHint = _ref11.hideFormHint,
328
- hasPopup = _ref11.hasPopup,
329
- popupId = _ref11.popupId,
330
- isPopupExpanded = _ref11.isPopupExpanded,
331
- maxTagRows = _ref11.maxTagRows,
332
- shouldIgnoreBlurAnimation = _ref11.shouldIgnoreBlurAnimation,
333
- setShouldIgnoreBlurAnimation = _ref11.setShouldIgnoreBlurAnimation,
334
- autoCapitalize = _ref11.autoCapitalize,
335
- setInputWrapperRef = _ref11.setInputWrapperRef,
336
- testID = _ref11.testID,
337
- isDropdownTrigger = _ref11.isDropdownTrigger,
338
- isLabelInsideInput = _ref11.isLabelInsideInput,
339
- styledProps = _objectWithoutProperties(_ref11, _excluded);
283
+ var FocusRingWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
284
+ displayName: "BaseInput__FocusRingWrapper",
285
+ componentId: "sc-177qd3e-0"
286
+ })(function (_ref11) {
287
+ var theme = _ref11.theme,
288
+ currentInteraction = _ref11.currentInteraction;
289
+ return {
290
+ borderRadius: makeBorderSize(theme.border.radius.medium),
291
+ width: '100%',
292
+ '&:focus-within': _objectSpread(_objectSpread({}, getFocusRingStyles({
293
+ theme: theme
294
+ })), {}, {
295
+ transitionDuration: castWebType(makeMotionTime(getIn(theme.motion.duration, baseInputBorderBackgroundMotion[currentInteraction === 'focus' ? 'enter' : 'exit'].duration))),
296
+ transitionTimingFunction: castWebType(getIn(theme.motion.easing, baseInputBorderBackgroundMotion[currentInteraction === 'focus' ? 'enter' : 'exit'].easing))
297
+ })
298
+ };
299
+ });
300
+ var _BaseInput = function _BaseInput(_ref12, ref) {
301
+ var _ref12$as = _ref12.as,
302
+ as = _ref12$as === void 0 ? 'input' : _ref12$as,
303
+ label = _ref12.label,
304
+ _ref12$labelPosition = _ref12.labelPosition,
305
+ labelPosition = _ref12$labelPosition === void 0 ? 'top' : _ref12$labelPosition,
306
+ placeholder = _ref12.placeholder,
307
+ _ref12$type = _ref12.type,
308
+ type = _ref12$type === void 0 ? 'text' : _ref12$type,
309
+ defaultValue = _ref12.defaultValue,
310
+ tags = _ref12.tags,
311
+ _ref12$showAllTags = _ref12.showAllTags,
312
+ showAllTags = _ref12$showAllTags === void 0 ? false : _ref12$showAllTags,
313
+ _ref12$activeTagIndex = _ref12.activeTagIndex,
314
+ activeTagIndex = _ref12$activeTagIndex === void 0 ? -1 : _ref12$activeTagIndex,
315
+ setActiveTagIndex = _ref12.setActiveTagIndex,
316
+ name = _ref12.name,
317
+ value = _ref12.value,
318
+ onFocus = _ref12.onFocus,
319
+ onChange = _ref12.onChange,
320
+ onInput = _ref12.onInput,
321
+ onBlur = _ref12.onBlur,
322
+ onSubmit = _ref12.onSubmit,
323
+ onClick = _ref12.onClick,
324
+ onKeyDown = _ref12.onKeyDown,
325
+ isDisabled = _ref12.isDisabled,
326
+ necessityIndicator = _ref12.necessityIndicator,
327
+ validationState = _ref12.validationState,
328
+ errorText = _ref12.errorText,
329
+ helpText = _ref12.helpText,
330
+ successText = _ref12.successText,
331
+ isRequired = _ref12.isRequired,
332
+ leadingIcon = _ref12.leadingIcon,
333
+ prefix = _ref12.prefix,
334
+ interactionElement = _ref12.interactionElement,
335
+ suffix = _ref12.suffix,
336
+ trailingIcon = _ref12.trailingIcon,
337
+ maxCharacters = _ref12.maxCharacters,
338
+ textAlign = _ref12.textAlign,
339
+ autoFocus = _ref12.autoFocus,
340
+ keyboardReturnKeyType = _ref12.keyboardReturnKeyType,
341
+ keyboardType = _ref12.keyboardType,
342
+ autoCompleteSuggestionType = _ref12.autoCompleteSuggestionType,
343
+ trailingHeaderSlot = _ref12.trailingHeaderSlot,
344
+ trailingFooterSlot = _ref12.trailingFooterSlot,
345
+ numberOfLines = _ref12.numberOfLines,
346
+ id = _ref12.id,
347
+ componentName = _ref12.componentName,
348
+ accessibilityLabel = _ref12.accessibilityLabel,
349
+ labelId = _ref12.labelId,
350
+ activeDescendant = _ref12.activeDescendant,
351
+ hideLabelText = _ref12.hideLabelText,
352
+ hideFormHint = _ref12.hideFormHint,
353
+ hasPopup = _ref12.hasPopup,
354
+ popupId = _ref12.popupId,
355
+ isPopupExpanded = _ref12.isPopupExpanded,
356
+ maxTagRows = _ref12.maxTagRows,
357
+ shouldIgnoreBlurAnimation = _ref12.shouldIgnoreBlurAnimation,
358
+ setShouldIgnoreBlurAnimation = _ref12.setShouldIgnoreBlurAnimation,
359
+ autoCapitalize = _ref12.autoCapitalize,
360
+ setInputWrapperRef = _ref12.setInputWrapperRef,
361
+ testID = _ref12.testID,
362
+ isDropdownTrigger = _ref12.isDropdownTrigger,
363
+ isLabelInsideInput = _ref12.isLabelInsideInput,
364
+ _ref12$size = _ref12.size,
365
+ size = _ref12$size === void 0 ? 'medium' : _ref12$size,
366
+ trailingButton = _ref12.trailingButton,
367
+ _ref12$valueComponent = _ref12.valueComponentType,
368
+ valueComponentType = _ref12$valueComponent === void 0 ? 'text' : _ref12$valueComponent,
369
+ styledProps = _objectWithoutProperties(_ref12, _excluded);
340
370
  var _useTheme = useTheme(),
341
371
  theme = _useTheme.theme;
342
372
  var inputWrapperRef = React__default.useRef(null);
@@ -351,8 +381,10 @@ var _BaseInput = function _BaseInput(_ref11, ref) {
351
381
  React__default.useEffect(function () {
352
382
  if (showAllTags) {
353
383
  setShowAllTagsWithAnimation(true);
384
+ } else if (maxTagRows !== 'expandable') {
385
+ setShowAllTagsWithAnimation(false);
354
386
  }
355
- }, [showAllTags]);
387
+ }, [showAllTags, maxTagRows]);
356
388
  var _useInput = useInput({
357
389
  defaultValue: defaultValue,
358
390
  value: value,
@@ -440,105 +472,117 @@ var _BaseInput = function _BaseInput(_ref11, ref) {
440
472
  position: labelPosition,
441
473
  id: labelId,
442
474
  htmlFor: inputId,
475
+ size: size,
443
476
  children: label
444
477
  }), trailingHeaderSlot === null || trailingHeaderSlot === void 0 ? void 0 : trailingHeaderSlot(value !== null && value !== void 0 ? value : inputValue)]
445
- }), /*#__PURE__*/jsxs(BaseInputWrapper, {
446
- isDropdownTrigger: isDropdownTrigger,
447
- isTextArea: isTextArea,
448
- isDisabled: isDisabled,
449
- validationState: validationState,
478
+ }), /*#__PURE__*/jsx(FocusRingWrapper, {
450
479
  currentInteraction: currentInteraction,
451
- isLabelLeftPositioned: isLabelLeftPositioned,
452
- showAllTags: showAllTags,
453
- setShowAllTagsWithAnimation: setShowAllTagsWithAnimation,
454
- ref: function ref(refNode) {
455
- if (refNode) {
456
- setInputWrapperRef === null || setInputWrapperRef === void 0 ? void 0 : setInputWrapperRef(refNode);
457
- inputWrapperRef.current = refNode;
458
- }
459
- },
460
- maxTagRows: maxTagRows,
461
- children: [/*#__PURE__*/jsx(BaseInputVisuals, {
462
- leadingIcon: leadingIcon,
463
- prefix: prefix,
464
- isDisabled: isDisabled
465
- }), /*#__PURE__*/jsx(BaseInputTagSlot, {
466
- renderAs: as,
467
- tags: tags,
480
+ children: /*#__PURE__*/jsxs(BaseInputWrapper, {
481
+ isDropdownTrigger: isDropdownTrigger,
482
+ isTextArea: isTextArea,
468
483
  isDisabled: isDisabled,
469
- showAllTags: showAllTagsWithAnimation,
470
- setFocusOnInput: function setFocusOnInput() {
471
- if (ref && !isReactNative && 'current' in ref) {
472
- var _ref$current;
473
- (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
484
+ validationState: validationState,
485
+ currentInteraction: currentInteraction,
486
+ isLabelLeftPositioned: isLabelLeftPositioned,
487
+ showAllTags: showAllTags,
488
+ setShowAllTagsWithAnimation: setShowAllTagsWithAnimation,
489
+ ref: function ref(refNode) {
490
+ if (refNode) {
491
+ setInputWrapperRef === null || setInputWrapperRef === void 0 ? void 0 : setInputWrapperRef(refNode);
492
+ inputWrapperRef.current = refNode;
474
493
  }
475
494
  },
476
- labelPrefix: isLabelInsideInput ? label : undefined,
477
- isDropdownTrigger: isDropdownTrigger,
478
- visibleTagsCountRef: visibleTagsCountRef,
479
- handleOnInputClick: function handleOnInputClick(e) {
480
- handleOnClick({
481
- name: name,
482
- value: isReactNative ? value : e
483
- });
484
- },
485
- setShouldIgnoreBlurAnimation: setShouldIgnoreBlurAnimation,
486
495
  maxTagRows: maxTagRows,
487
- inputWrapperRef: inputWrapperRef,
488
- children: /*#__PURE__*/jsx(StyledBaseInput, _objectSpread({
489
- as: as,
490
- id: inputId,
491
- ref: ref,
492
- name: name,
493
- type: type,
494
- defaultValue: defaultValue,
495
- value: value,
496
- placeholder: placeholder,
497
- isDisabled: isDisabled,
498
- validationState: validationState,
499
- isRequired: _isRequired,
500
- handleOnFocus: handleOnFocus,
501
- handleOnChange: handleOnChange,
502
- handleOnBlur: handleOnBlur,
503
- handleOnSubmit: handleOnSubmit,
504
- handleOnInput: handleOnInput,
505
- handleOnKeyDown: handleOnKeyDown,
506
- handleOnClick: handleOnClick,
496
+ size: size,
497
+ children: [/*#__PURE__*/jsx(BaseInputVisuals, {
498
+ size: size,
507
499
  leadingIcon: leadingIcon,
508
500
  prefix: prefix,
501
+ isDisabled: isDisabled
502
+ }), /*#__PURE__*/jsx(BaseInputTagSlot, {
503
+ renderAs: as,
504
+ tags: tags,
505
+ isDisabled: isDisabled,
506
+ showAllTags: showAllTagsWithAnimation,
507
+ setFocusOnInput: function setFocusOnInput() {
508
+ if (ref && !isReactNative && 'current' in ref) {
509
+ var _ref$current;
510
+ (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
511
+ }
512
+ },
513
+ labelPrefix: isLabelInsideInput ? label : undefined,
514
+ isDropdownTrigger: isDropdownTrigger,
515
+ visibleTagsCountRef: visibleTagsCountRef,
516
+ handleOnInputClick: function handleOnInputClick(e) {
517
+ handleOnClick({
518
+ name: name,
519
+ value: isReactNative ? value : e
520
+ });
521
+ },
522
+ setShouldIgnoreBlurAnimation: setShouldIgnoreBlurAnimation,
523
+ maxTagRows: maxTagRows,
524
+ inputWrapperRef: inputWrapperRef,
525
+ size: size,
526
+ children: /*#__PURE__*/jsx(StyledBaseInput, _objectSpread({
527
+ as: as,
528
+ id: inputId,
529
+ ref: ref,
530
+ name: name,
531
+ type: type,
532
+ defaultValue: defaultValue,
533
+ value: value,
534
+ placeholder: placeholder,
535
+ isDisabled: isDisabled,
536
+ validationState: validationState,
537
+ isRequired: _isRequired,
538
+ handleOnFocus: handleOnFocus,
539
+ handleOnChange: handleOnChange,
540
+ handleOnBlur: handleOnBlur,
541
+ handleOnSubmit: handleOnSubmit,
542
+ handleOnInput: handleOnInput,
543
+ handleOnKeyDown: handleOnKeyDown,
544
+ handleOnClick: handleOnClick,
545
+ leadingIcon: leadingIcon,
546
+ prefix: prefix,
547
+ interactionElement: interactionElement,
548
+ suffix: suffix,
549
+ trailingIcon: trailingIcon,
550
+ maxCharacters: maxCharacters,
551
+ textAlign: textAlign
552
+ // eslint-disable-next-line jsx-a11y/no-autofocus
553
+ ,
554
+ autoFocus: autoFocus,
555
+ keyboardReturnKeyType: keyboardReturnKeyType,
556
+ keyboardType: keyboardType,
557
+ autoCompleteSuggestionType: autoCompleteSuggestionType,
558
+ accessibilityProps: accessibilityProps,
559
+ currentInteraction: currentInteraction,
560
+ setCurrentInteraction: setCurrentInteraction,
561
+ numberOfLines: numberOfLines,
562
+ isTextArea: isTextArea || maxTagRows === 'multiple' || maxTagRows === 'expandable',
563
+ hasPopup: hasPopup,
564
+ hasTags: !!(tags && tags.length > 0),
565
+ shouldIgnoreBlurAnimation: shouldIgnoreBlurAnimation,
566
+ autoCapitalize: autoCapitalize,
567
+ isDropdownTrigger: isDropdownTrigger,
568
+ $size: size,
569
+ valueComponentType: valueComponentType
570
+ }, metaAttribute({
571
+ name: MetaConstants.StyledBaseInput
572
+ })))
573
+ }), /*#__PURE__*/jsx(BaseInputVisuals, {
509
574
  interactionElement: interactionElement,
510
575
  suffix: suffix,
511
576
  trailingIcon: trailingIcon,
512
- maxCharacters: maxCharacters,
513
- textAlign: textAlign
514
- // eslint-disable-next-line jsx-a11y/no-autofocus
515
- ,
516
- autoFocus: autoFocus,
517
- keyboardReturnKeyType: keyboardReturnKeyType,
518
- keyboardType: keyboardType,
519
- autoCompleteSuggestionType: autoCompleteSuggestionType,
520
- accessibilityProps: accessibilityProps,
521
- currentInteraction: currentInteraction,
522
- setCurrentInteraction: setCurrentInteraction,
523
- numberOfLines: numberOfLines,
524
- isTextArea: isTextArea || maxTagRows === 'multiple' || maxTagRows === 'expandable',
525
- hasPopup: hasPopup,
526
- hasTags: !!(tags && tags.length > 0),
527
- shouldIgnoreBlurAnimation: shouldIgnoreBlurAnimation,
528
- autoCapitalize: autoCapitalize,
529
- isDropdownTrigger: isDropdownTrigger
530
- }, metaAttribute({
531
- name: MetaConstants.StyledBaseInput
532
- })))
533
- }), /*#__PURE__*/jsx(BaseInputVisuals, {
534
- interactionElement: interactionElement,
535
- suffix: suffix,
536
- trailingIcon: trailingIcon,
537
- isDisabled: isDisabled
538
- })]
577
+ isDisabled: isDisabled,
578
+ validationState: validationState,
579
+ trailingButton: trailingButton,
580
+ size: size
581
+ })]
582
+ })
539
583
  })]
540
584
  }), !hideFormHint && /*#__PURE__*/jsx(BaseBox, {
541
- marginLeft: makeSize(isLabelLeftPositioned && !hideLabelText ? 136 : 0),
585
+ marginLeft: makeSize(isLabelLeftPositioned && !hideLabelText ? formHintLeftLabelMarginLeft[size] : 0),
542
586
  children: /*#__PURE__*/jsxs(BaseBox, {
543
587
  display: "flex",
544
588
  flexDirection: "row",
@@ -553,7 +597,8 @@ var _BaseInput = function _BaseInput(_ref11, ref) {
553
597
  successText: successText,
554
598
  helpTextId: helpTextId,
555
599
  errorTextId: errorTextId,
556
- successTextId: successTextId
600
+ successTextId: successTextId,
601
+ size: size
557
602
  }), trailingFooterSlot === null || trailingFooterSlot === void 0 ? void 0 : trailingFooterSlot(value !== null && value !== void 0 ? value : inputValue)]
558
603
  })
559
604
  })]