@razorpay/blade 11.35.0 → 11.36.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 (202) hide show
  1. package/build/lib/native/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  2. package/build/lib/native/components/Card/Card.js.map +1 -1
  3. package/build/lib/native/components/Icons/Battery100PercentIcon/Battery100PercentIcon.js +12 -0
  4. package/build/lib/native/components/Icons/Battery100PercentIcon/Battery100PercentIcon.js.map +1 -0
  5. package/build/lib/native/components/Icons/Battery20PercentIcon/Battery20PercentIcon.js +12 -0
  6. package/build/lib/native/components/Icons/Battery20PercentIcon/Battery20PercentIcon.js.map +1 -0
  7. package/build/lib/native/components/Icons/Battery40PercentIcon/Battery40PercentIcon.js +12 -0
  8. package/build/lib/native/components/Icons/Battery40PercentIcon/Battery40PercentIcon.js.map +1 -0
  9. package/build/lib/native/components/Icons/Battery60PercentIcon/Battery60PercentIcon.js +12 -0
  10. package/build/lib/native/components/Icons/Battery60PercentIcon/Battery60PercentIcon.js.map +1 -0
  11. package/build/lib/native/components/Icons/Battery80PercentIcon/Battery80PercentIcon.js +12 -0
  12. package/build/lib/native/components/Icons/Battery80PercentIcon/Battery80PercentIcon.js.map +1 -0
  13. package/build/lib/native/components/Icons/BillMeIcon/BillMeIcon.js +12 -0
  14. package/build/lib/native/components/Icons/BillMeIcon/BillMeIcon.js.map +1 -0
  15. package/build/lib/native/components/Icons/NoSignalIcon/NoSignalIcon.js +12 -0
  16. package/build/lib/native/components/Icons/NoSignalIcon/NoSignalIcon.js.map +1 -0
  17. package/build/lib/native/components/Icons/Signal1BarIcon/Signal1BarIcon.js +12 -0
  18. package/build/lib/native/components/Icons/Signal1BarIcon/Signal1BarIcon.js.map +1 -0
  19. package/build/lib/native/components/Icons/Signal2BarIcon/Signal2BarIcon.js +12 -0
  20. package/build/lib/native/components/Icons/Signal2BarIcon/Signal2BarIcon.js.map +1 -0
  21. package/build/lib/native/components/Icons/Signal3BarIcon/Signal3BarIcon.js +12 -0
  22. package/build/lib/native/components/Icons/Signal3BarIcon/Signal3BarIcon.js.map +1 -0
  23. package/build/lib/native/components/Icons/Signal4BarIcon/Signal4BarIcon.js +12 -0
  24. package/build/lib/native/components/Icons/Signal4BarIcon/Signal4BarIcon.js.map +1 -0
  25. package/build/lib/native/components/Icons/SignalIcon/SignalIcon.js +12 -0
  26. package/build/lib/native/components/Icons/SignalIcon/SignalIcon.js.map +1 -0
  27. package/build/lib/native/components/Icons/SimCardIcon/SimCardIcon.js +12 -0
  28. package/build/lib/native/components/Icons/SimCardIcon/SimCardIcon.js.map +1 -0
  29. package/build/lib/native/components/Icons/TwitterIcon/TwitterIcon.js +1 -1
  30. package/build/lib/native/components/Icons/TwitterIcon/TwitterIcon.js.map +1 -1
  31. package/build/lib/native/components/Icons/UpiIcon/UpiIcon.js +12 -0
  32. package/build/lib/native/components/Icons/UpiIcon/UpiIcon.js.map +1 -0
  33. package/build/lib/native/components/Icons/YoutubeIcon/YoutubeIcon.js +12 -0
  34. package/build/lib/native/components/Icons/YoutubeIcon/YoutubeIcon.js.map +1 -0
  35. package/build/lib/native/components/Input/BaseInput/BaseInput.js +1 -1
  36. package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
  37. package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js +2 -1
  38. package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  39. package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +1 -1
  40. package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  41. package/build/lib/native/components/Input/TextInput/TextInput.js.map +1 -1
  42. package/build/lib/native/components/index.js +15 -0
  43. package/build/lib/native/components/index.js.map +1 -1
  44. package/build/lib/web/development/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  45. package/build/lib/web/development/components/Card/Card.js.map +1 -1
  46. package/build/lib/web/development/components/Icons/Battery100PercentIcon/Battery100PercentIcon.js +57 -0
  47. package/build/lib/web/development/components/Icons/Battery100PercentIcon/Battery100PercentIcon.js.map +1 -0
  48. package/build/lib/web/development/components/Icons/Battery100PercentIcon/index.js +2 -0
  49. package/build/lib/web/development/components/Icons/Battery100PercentIcon/index.js.map +1 -0
  50. package/build/lib/web/development/components/Icons/Battery20PercentIcon/Battery20PercentIcon.js +45 -0
  51. package/build/lib/web/development/components/Icons/Battery20PercentIcon/Battery20PercentIcon.js.map +1 -0
  52. package/build/lib/web/development/components/Icons/Battery20PercentIcon/index.js +2 -0
  53. package/build/lib/web/development/components/Icons/Battery20PercentIcon/index.js.map +1 -0
  54. package/build/lib/web/development/components/Icons/Battery40PercentIcon/Battery40PercentIcon.js +48 -0
  55. package/build/lib/web/development/components/Icons/Battery40PercentIcon/Battery40PercentIcon.js.map +1 -0
  56. package/build/lib/web/development/components/Icons/Battery40PercentIcon/index.js +2 -0
  57. package/build/lib/web/development/components/Icons/Battery40PercentIcon/index.js.map +1 -0
  58. package/build/lib/web/development/components/Icons/Battery60PercentIcon/Battery60PercentIcon.js +51 -0
  59. package/build/lib/web/development/components/Icons/Battery60PercentIcon/Battery60PercentIcon.js.map +1 -0
  60. package/build/lib/web/development/components/Icons/Battery60PercentIcon/index.js +2 -0
  61. package/build/lib/web/development/components/Icons/Battery60PercentIcon/index.js.map +1 -0
  62. package/build/lib/web/development/components/Icons/Battery80PercentIcon/Battery80PercentIcon.js +54 -0
  63. package/build/lib/web/development/components/Icons/Battery80PercentIcon/Battery80PercentIcon.js.map +1 -0
  64. package/build/lib/web/development/components/Icons/Battery80PercentIcon/index.js +2 -0
  65. package/build/lib/web/development/components/Icons/Battery80PercentIcon/index.js.map +1 -0
  66. package/build/lib/web/development/components/Icons/BillMeIcon/BillMeIcon.js +51 -0
  67. package/build/lib/web/development/components/Icons/BillMeIcon/BillMeIcon.js.map +1 -0
  68. package/build/lib/web/development/components/Icons/BillMeIcon/index.js +2 -0
  69. package/build/lib/web/development/components/Icons/BillMeIcon/index.js.map +1 -0
  70. package/build/lib/web/development/components/Icons/NoSignalIcon/NoSignalIcon.js +37 -0
  71. package/build/lib/web/development/components/Icons/NoSignalIcon/NoSignalIcon.js.map +1 -0
  72. package/build/lib/web/development/components/Icons/NoSignalIcon/index.js +2 -0
  73. package/build/lib/web/development/components/Icons/NoSignalIcon/index.js.map +1 -0
  74. package/build/lib/web/development/components/Icons/Signal1BarIcon/Signal1BarIcon.js +37 -0
  75. package/build/lib/web/development/components/Icons/Signal1BarIcon/Signal1BarIcon.js.map +1 -0
  76. package/build/lib/web/development/components/Icons/Signal1BarIcon/index.js +2 -0
  77. package/build/lib/web/development/components/Icons/Signal1BarIcon/index.js.map +1 -0
  78. package/build/lib/web/development/components/Icons/Signal2BarIcon/Signal2BarIcon.js +37 -0
  79. package/build/lib/web/development/components/Icons/Signal2BarIcon/Signal2BarIcon.js.map +1 -0
  80. package/build/lib/web/development/components/Icons/Signal2BarIcon/index.js +2 -0
  81. package/build/lib/web/development/components/Icons/Signal2BarIcon/index.js.map +1 -0
  82. package/build/lib/web/development/components/Icons/Signal3BarIcon/Signal3BarIcon.js +37 -0
  83. package/build/lib/web/development/components/Icons/Signal3BarIcon/Signal3BarIcon.js.map +1 -0
  84. package/build/lib/web/development/components/Icons/Signal3BarIcon/index.js +2 -0
  85. package/build/lib/web/development/components/Icons/Signal3BarIcon/index.js.map +1 -0
  86. package/build/lib/web/development/components/Icons/Signal4BarIcon/Signal4BarIcon.js +37 -0
  87. package/build/lib/web/development/components/Icons/Signal4BarIcon/Signal4BarIcon.js.map +1 -0
  88. package/build/lib/web/development/components/Icons/Signal4BarIcon/index.js +2 -0
  89. package/build/lib/web/development/components/Icons/Signal4BarIcon/index.js.map +1 -0
  90. package/build/lib/web/development/components/Icons/SignalIcon/SignalIcon.js +37 -0
  91. package/build/lib/web/development/components/Icons/SignalIcon/SignalIcon.js.map +1 -0
  92. package/build/lib/web/development/components/Icons/SignalIcon/index.js +2 -0
  93. package/build/lib/web/development/components/Icons/SignalIcon/index.js.map +1 -0
  94. package/build/lib/web/development/components/Icons/SimCardIcon/SimCardIcon.js +57 -0
  95. package/build/lib/web/development/components/Icons/SimCardIcon/SimCardIcon.js.map +1 -0
  96. package/build/lib/web/development/components/Icons/SimCardIcon/index.js +2 -0
  97. package/build/lib/web/development/components/Icons/SimCardIcon/index.js.map +1 -0
  98. package/build/lib/web/development/components/Icons/TwitterIcon/TwitterIcon.js +1 -1
  99. package/build/lib/web/development/components/Icons/TwitterIcon/TwitterIcon.js.map +1 -1
  100. package/build/lib/web/development/components/Icons/UpiIcon/UpiIcon.js +39 -0
  101. package/build/lib/web/development/components/Icons/UpiIcon/UpiIcon.js.map +1 -0
  102. package/build/lib/web/development/components/Icons/UpiIcon/index.js +2 -0
  103. package/build/lib/web/development/components/Icons/UpiIcon/index.js.map +1 -0
  104. package/build/lib/web/development/components/Icons/YoutubeIcon/YoutubeIcon.js +44 -0
  105. package/build/lib/web/development/components/Icons/YoutubeIcon/YoutubeIcon.js.map +1 -0
  106. package/build/lib/web/development/components/Icons/YoutubeIcon/index.js +2 -0
  107. package/build/lib/web/development/components/Icons/YoutubeIcon/index.js.map +1 -0
  108. package/build/lib/web/development/components/Icons/index.js +15 -0
  109. package/build/lib/web/development/components/Icons/index.js.map +1 -1
  110. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +3 -1
  111. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
  112. package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js +77 -66
  113. package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  114. package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +10 -10
  115. package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  116. package/build/lib/web/development/components/Input/TextInput/TextInput.js.map +1 -1
  117. package/build/lib/web/development/components/Modal/ModalBody.web.js.map +1 -1
  118. package/build/lib/web/development/components/index.js +15 -0
  119. package/build/lib/web/development/components/index.js.map +1 -1
  120. package/build/lib/web/production/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  121. package/build/lib/web/production/components/Card/Card.js.map +1 -1
  122. package/build/lib/web/production/components/Icons/Battery100PercentIcon/Battery100PercentIcon.js +57 -0
  123. package/build/lib/web/production/components/Icons/Battery100PercentIcon/Battery100PercentIcon.js.map +1 -0
  124. package/build/lib/web/production/components/Icons/Battery100PercentIcon/index.js +2 -0
  125. package/build/lib/web/production/components/Icons/Battery100PercentIcon/index.js.map +1 -0
  126. package/build/lib/web/production/components/Icons/Battery20PercentIcon/Battery20PercentIcon.js +45 -0
  127. package/build/lib/web/production/components/Icons/Battery20PercentIcon/Battery20PercentIcon.js.map +1 -0
  128. package/build/lib/web/production/components/Icons/Battery20PercentIcon/index.js +2 -0
  129. package/build/lib/web/production/components/Icons/Battery20PercentIcon/index.js.map +1 -0
  130. package/build/lib/web/production/components/Icons/Battery40PercentIcon/Battery40PercentIcon.js +48 -0
  131. package/build/lib/web/production/components/Icons/Battery40PercentIcon/Battery40PercentIcon.js.map +1 -0
  132. package/build/lib/web/production/components/Icons/Battery40PercentIcon/index.js +2 -0
  133. package/build/lib/web/production/components/Icons/Battery40PercentIcon/index.js.map +1 -0
  134. package/build/lib/web/production/components/Icons/Battery60PercentIcon/Battery60PercentIcon.js +51 -0
  135. package/build/lib/web/production/components/Icons/Battery60PercentIcon/Battery60PercentIcon.js.map +1 -0
  136. package/build/lib/web/production/components/Icons/Battery60PercentIcon/index.js +2 -0
  137. package/build/lib/web/production/components/Icons/Battery60PercentIcon/index.js.map +1 -0
  138. package/build/lib/web/production/components/Icons/Battery80PercentIcon/Battery80PercentIcon.js +54 -0
  139. package/build/lib/web/production/components/Icons/Battery80PercentIcon/Battery80PercentIcon.js.map +1 -0
  140. package/build/lib/web/production/components/Icons/Battery80PercentIcon/index.js +2 -0
  141. package/build/lib/web/production/components/Icons/Battery80PercentIcon/index.js.map +1 -0
  142. package/build/lib/web/production/components/Icons/BillMeIcon/BillMeIcon.js +51 -0
  143. package/build/lib/web/production/components/Icons/BillMeIcon/BillMeIcon.js.map +1 -0
  144. package/build/lib/web/production/components/Icons/BillMeIcon/index.js +2 -0
  145. package/build/lib/web/production/components/Icons/BillMeIcon/index.js.map +1 -0
  146. package/build/lib/web/production/components/Icons/NoSignalIcon/NoSignalIcon.js +37 -0
  147. package/build/lib/web/production/components/Icons/NoSignalIcon/NoSignalIcon.js.map +1 -0
  148. package/build/lib/web/production/components/Icons/NoSignalIcon/index.js +2 -0
  149. package/build/lib/web/production/components/Icons/NoSignalIcon/index.js.map +1 -0
  150. package/build/lib/web/production/components/Icons/Signal1BarIcon/Signal1BarIcon.js +37 -0
  151. package/build/lib/web/production/components/Icons/Signal1BarIcon/Signal1BarIcon.js.map +1 -0
  152. package/build/lib/web/production/components/Icons/Signal1BarIcon/index.js +2 -0
  153. package/build/lib/web/production/components/Icons/Signal1BarIcon/index.js.map +1 -0
  154. package/build/lib/web/production/components/Icons/Signal2BarIcon/Signal2BarIcon.js +37 -0
  155. package/build/lib/web/production/components/Icons/Signal2BarIcon/Signal2BarIcon.js.map +1 -0
  156. package/build/lib/web/production/components/Icons/Signal2BarIcon/index.js +2 -0
  157. package/build/lib/web/production/components/Icons/Signal2BarIcon/index.js.map +1 -0
  158. package/build/lib/web/production/components/Icons/Signal3BarIcon/Signal3BarIcon.js +37 -0
  159. package/build/lib/web/production/components/Icons/Signal3BarIcon/Signal3BarIcon.js.map +1 -0
  160. package/build/lib/web/production/components/Icons/Signal3BarIcon/index.js +2 -0
  161. package/build/lib/web/production/components/Icons/Signal3BarIcon/index.js.map +1 -0
  162. package/build/lib/web/production/components/Icons/Signal4BarIcon/Signal4BarIcon.js +37 -0
  163. package/build/lib/web/production/components/Icons/Signal4BarIcon/Signal4BarIcon.js.map +1 -0
  164. package/build/lib/web/production/components/Icons/Signal4BarIcon/index.js +2 -0
  165. package/build/lib/web/production/components/Icons/Signal4BarIcon/index.js.map +1 -0
  166. package/build/lib/web/production/components/Icons/SignalIcon/SignalIcon.js +37 -0
  167. package/build/lib/web/production/components/Icons/SignalIcon/SignalIcon.js.map +1 -0
  168. package/build/lib/web/production/components/Icons/SignalIcon/index.js +2 -0
  169. package/build/lib/web/production/components/Icons/SignalIcon/index.js.map +1 -0
  170. package/build/lib/web/production/components/Icons/SimCardIcon/SimCardIcon.js +57 -0
  171. package/build/lib/web/production/components/Icons/SimCardIcon/SimCardIcon.js.map +1 -0
  172. package/build/lib/web/production/components/Icons/SimCardIcon/index.js +2 -0
  173. package/build/lib/web/production/components/Icons/SimCardIcon/index.js.map +1 -0
  174. package/build/lib/web/production/components/Icons/TwitterIcon/TwitterIcon.js +1 -1
  175. package/build/lib/web/production/components/Icons/TwitterIcon/TwitterIcon.js.map +1 -1
  176. package/build/lib/web/production/components/Icons/UpiIcon/UpiIcon.js +39 -0
  177. package/build/lib/web/production/components/Icons/UpiIcon/UpiIcon.js.map +1 -0
  178. package/build/lib/web/production/components/Icons/UpiIcon/index.js +2 -0
  179. package/build/lib/web/production/components/Icons/UpiIcon/index.js.map +1 -0
  180. package/build/lib/web/production/components/Icons/YoutubeIcon/YoutubeIcon.js +44 -0
  181. package/build/lib/web/production/components/Icons/YoutubeIcon/YoutubeIcon.js.map +1 -0
  182. package/build/lib/web/production/components/Icons/YoutubeIcon/index.js +2 -0
  183. package/build/lib/web/production/components/Icons/YoutubeIcon/index.js.map +1 -0
  184. package/build/lib/web/production/components/Icons/index.js +15 -0
  185. package/build/lib/web/production/components/Icons/index.js.map +1 -1
  186. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +3 -1
  187. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
  188. package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js +77 -66
  189. package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  190. package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +10 -10
  191. package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
  192. package/build/lib/web/production/components/Input/TextInput/TextInput.js.map +1 -1
  193. package/build/lib/web/production/components/Modal/ModalBody.web.js.map +1 -1
  194. package/build/lib/web/production/components/index.js +15 -0
  195. package/build/lib/web/production/components/index.js.map +1 -1
  196. package/build/types/components/index.d.ts +55 -21
  197. package/build/types/components/index.native.d.ts +54 -20
  198. package/codemods/aicodemod/README.md +26 -0
  199. package/codemods/aicodemod/bin.mjs +128 -0
  200. package/codemods/aicodemod/knowledge/Table.md +596 -0
  201. package/codemods/aicodemod/knowledge/presets/dashboard/table-pattern-1.md +319 -0
  202. package/package.json +4 -2
@@ -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 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, SpacingValueType } from '~components/Box/BaseBox';\nimport type { IconColors } from '~components/Icons';\nimport { isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\nimport { Tooltip } from '~components/Tooltip';\nimport { Box } from '~components/Box';\n\ntype InputVisuals = Pick<\n BaseInputProps,\n | 'leadingIcon'\n | 'prefix'\n | 'trailingInteractionElement'\n | 'leadingInteractionElement'\n | 'suffix'\n | 'trailingIcon'\n | 'isDisabled'\n | 'validationState'\n | 'size'\n | 'trailingButton'\n | 'showHintsAsTooltip'\n | 'errorText'\n | 'successText'\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 hasLeadingInteractionElement,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingButton,\n}: {\n hasTrailingIcon: boolean;\n hasLeadingInteractionElement?: boolean;\n hasTrailingInteractionElement?: boolean;\n hasSuffix: boolean;\n hasTrailingButton: boolean;\n}): SpacingValueType => {\n if (hasTrailingInteractionElement && (hasSuffix || hasTrailingIcon || hasTrailingButton)) {\n return 'spacing.2';\n }\n\n if (hasTrailingInteractionElement && !hasSuffix && !hasTrailingIcon && !hasTrailingButton) {\n return 'spacing.4';\n }\n\n if (hasLeadingInteractionElement) {\n return 'spacing.3';\n }\n\n return 'spacing.0';\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 trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n trailingButton,\n}: InputVisuals) => ({\n hasLeadingIcon: Boolean(leadingIcon),\n hasPrefix: Boolean(prefix),\n hasTrailingInteractionElement: Boolean(trailingInteractionElement),\n hasLeadingInteractionElement: Boolean(leadingInteractionElement),\n hasSuffix: Boolean(suffix),\n hasTrailingIcon: Boolean(trailingIcon),\n hasTrailingButton: Boolean(trailingButton),\n});\n\nconst getTooltipContent = ({\n validationState,\n errorText,\n successText,\n}: {\n validationState: BaseInputProps['validationState'];\n errorText: BaseInputProps['errorText'];\n successText: BaseInputProps['errorText'];\n}): string => {\n if (validationState === 'error' && errorText) {\n return errorText;\n }\n\n if (validationState === 'success' && successText) {\n return successText;\n }\n\n return '';\n};\n\nconst ValidationIconTooltip = ({\n children,\n validationState,\n errorText,\n successText,\n showHintsAsTooltip,\n}: {\n children: ReactElement;\n validationState: BaseInputProps['validationState'];\n errorText: BaseInputProps['errorText'];\n successText: BaseInputProps['errorText'];\n showHintsAsTooltip: BaseInputProps['showHintsAsTooltip'];\n}) => {\n if (\n (showHintsAsTooltip && validationState === 'error' && errorText) ||\n (validationState === 'success' && successText)\n ) {\n return (\n <Tooltip content={getTooltipContent({ validationState, errorText, successText })}>\n <Box display=\"flex\" justifyContent=\"center\" alignItems=\"center\">\n {children}\n </Box>\n </Tooltip>\n );\n }\n\n return children;\n};\n\nexport const BaseInputVisuals = ({\n leadingIcon: LeadingIcon,\n prefix,\n trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon: TrailingIcon,\n isDisabled,\n validationState = 'none',\n size,\n showHintsAsTooltip,\n errorText,\n successText,\n trailingButton: TrailingButton,\n}: InputVisuals): ReactElement | null => {\n const {\n hasLeadingIcon,\n hasPrefix,\n hasSuffix,\n hasTrailingInteractionElement,\n hasLeadingInteractionElement,\n hasTrailingIcon,\n hasTrailingButton,\n } = getInputVisualsToBeRendered({\n leadingIcon: LeadingIcon,\n prefix,\n leadingInteractionElement,\n trailingInteractionElement,\n suffix,\n trailingIcon: TrailingIcon,\n trailingButton: TrailingButton,\n size,\n });\n\n const hasLeadingVisuals = hasLeadingInteractionElement || hasLeadingIcon || hasPrefix;\n const hasTrailingVisuals =\n hasTrailingInteractionElement || 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 {hasLeadingInteractionElement ? (\n <BaseBox\n paddingLeft={getInteractionElementStyles({\n hasTrailingIcon,\n hasLeadingInteractionElement,\n hasSuffix,\n hasTrailingButton,\n })}\n display=\"flex\"\n alignItems=\"stretch\"\n alignSelf=\"stretch\"\n >\n {leadingInteractionElement}\n </BaseBox>\n ) : null}\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.muted'}\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 {hasTrailingInteractionElement ? (\n <BaseBox\n paddingRight={getInteractionElementStyles({\n hasTrailingIcon,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingButton,\n })}\n display=\"flex\"\n alignItems=\"stretch\"\n alignSelf=\"stretch\"\n >\n {trailingInteractionElement}\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 justifyContent=\"center\"\n alignItems=\"center\"\n {...getTrailingIconStyles({ hasTrailingIcon, hasTrailingButton })}\n >\n <ValidationIconTooltip\n showHintsAsTooltip={showHintsAsTooltip}\n errorText={errorText}\n successText={successText}\n validationState={validationState}\n >\n <TrailingIcon\n size={iconSize[size]}\n color={\n isDisabled ? 'interactive.icon.gray.disabled' : trailingIconColor[validationState]\n }\n />\n </ValidationIconTooltip>\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","hasLeadingInteractionElement","hasTrailingInteractionElement","hasSuffix","hasTrailingButton","getSuffixStyles","_ref3","paddingRight","getTrailingIconStyles","_ref4","getInputVisualsToBeRendered","_ref5","leadingIcon","prefix","trailingInteractionElement","leadingInteractionElement","suffix","trailingIcon","trailingButton","Boolean","getTooltipContent","_ref6","validationState","errorText","successText","ValidationIconTooltip","_ref7","children","showHintsAsTooltip","_jsx","Tooltip","content","Box","justifyContent","BaseInputVisuals","_ref8","LeadingIcon","TrailingIcon","isDisabled","_ref8$validationState","size","TrailingButton","_getInputVisualsToBeR","hasLeadingVisuals","hasTrailingVisuals","__DEV__","isValidAllowedChildren","throwBladeError","message","moduleName","_jsxs","BaseBox","Object","assign","color","Text","variant","weight","React","cloneElement"],"mappings":";;;;;;;;;;;;;;;;;;AAgCA,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,CAAC,CAAA,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,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,GAAID,SAAS,EAAI,CAACD,cAAc,CAAE,CAChC,OAAO,CACLE,WAAW,CAAE,WACf,CAAC,CACH,CAEA,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CAAC,CAAA,CAAAuB,QAAA,CAEjEE,GAAA,CAACJ,qBAAqB,CAAA,CACpBG,kBAAkB,CAAEA,kBAAmB,CACvCL,SAAS,CAAEA,SAAU,CACrBC,WAAW,CAAEA,WAAY,CACzBF,eAAe,CAAEA,eAAgB,CAAAK,QAAA,CAEjCE,GAAA,CAACQ,YAAY,CACXG,CAAAA,IAAI,CAAEnD,QAAQ,CAACmD,IAAI,CAAE,CACrBc,KAAK,CACHhB,UAAU,CAAG,gCAAgC,CAAGrD,iBAAiB,CAACqC,eAAe,CAClF,CACF,CAAC,CACmB,CAAC,CACjB,CAAA,CAAC,CACR,IAAI,CACPmB,cAAc,CACbZ,GAAA,CAACsB,OAAO,CAAA,CAAC5C,YAAY,CAAC,WAAW,CAAC1B,OAAO,CAAC,MAAM,CAAA8C,QAAA,CAC7C+B,cAAK,CAACC,YAAY,CAAClB,cAAc,CAAE,CAClCD,IAAI,CAAJA,IAAI,CACJgB,OAAO,CAAE,QAAQ,CACjBlB,UAAU,CAAVA,UACF,CAAC,CAAC,CACK,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, SpacingValueType } from '~components/Box/BaseBox';\nimport type { IconColors } from '~components/Icons';\nimport { isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\nimport { Tooltip } from '~components/Tooltip';\nimport { Box } from '~components/Box';\nimport { isReactNative } from '~utils';\n\ntype InputVisuals = Pick<\n BaseInputProps,\n | 'leadingIcon'\n | 'prefix'\n | 'trailingInteractionElement'\n | 'onTrailingInteractionElementClick'\n | 'leadingInteractionElement'\n | 'suffix'\n | 'trailingIcon'\n | 'isDisabled'\n | 'validationState'\n | 'size'\n | 'trailingButton'\n | 'showHintsAsTooltip'\n | 'errorText'\n | 'successText'\n> & {\n size: NonNullable<BaseInputProps['size']>;\n};\n\nconst getVisualContainerStyles = ({\n shouldStretchTrailingBox,\n}: {\n shouldStretchTrailingBox?: boolean;\n} = {}): Pick<BaseBoxProps, 'display' | 'flexDirection' | 'alignItems' | 'alignSelf'> => ({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n alignSelf: shouldStretchTrailingBox ? 'stretch' : '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 hasLeadingInteractionElement,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingButton,\n}: {\n hasTrailingIcon: boolean;\n hasLeadingInteractionElement?: boolean;\n hasTrailingInteractionElement?: boolean;\n hasSuffix: boolean;\n hasTrailingButton: boolean;\n}): SpacingValueType => {\n if (hasTrailingInteractionElement && (hasSuffix || hasTrailingIcon || hasTrailingButton)) {\n return 'spacing.2';\n }\n\n if (hasTrailingInteractionElement && !hasSuffix && !hasTrailingIcon && !hasTrailingButton) {\n return 'spacing.4';\n }\n\n if (hasLeadingInteractionElement) {\n return 'spacing.3';\n }\n\n return 'spacing.0';\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 trailingInteractionElement,\n leadingInteractionElement,\n suffix,\n trailingIcon,\n trailingButton,\n}: InputVisuals) => ({\n hasLeadingIcon: Boolean(leadingIcon),\n hasPrefix: Boolean(prefix),\n hasTrailingInteractionElement: Boolean(trailingInteractionElement),\n hasLeadingInteractionElement: Boolean(leadingInteractionElement),\n hasSuffix: Boolean(suffix),\n hasTrailingIcon: Boolean(trailingIcon),\n hasTrailingButton: Boolean(trailingButton),\n});\n\nconst getTooltipContent = ({\n validationState,\n errorText,\n successText,\n}: {\n validationState: BaseInputProps['validationState'];\n errorText: BaseInputProps['errorText'];\n successText: BaseInputProps['errorText'];\n}): string => {\n if (validationState === 'error' && errorText) {\n return errorText;\n }\n\n if (validationState === 'success' && successText) {\n return successText;\n }\n\n return '';\n};\n\nconst ValidationIconTooltip = ({\n children,\n validationState,\n errorText,\n successText,\n showHintsAsTooltip,\n}: {\n children: ReactElement;\n validationState: BaseInputProps['validationState'];\n errorText: BaseInputProps['errorText'];\n successText: BaseInputProps['errorText'];\n showHintsAsTooltip: BaseInputProps['showHintsAsTooltip'];\n}) => {\n if (\n (showHintsAsTooltip && validationState === 'error' && errorText) ||\n (validationState === 'success' && successText)\n ) {\n return (\n <Tooltip content={getTooltipContent({ validationState, errorText, successText })}>\n <Box display=\"flex\" justifyContent=\"center\" alignItems=\"center\">\n {children}\n </Box>\n </Tooltip>\n );\n }\n\n return children;\n};\n\nexport const BaseInputVisuals = ({\n leadingIcon: LeadingIcon,\n prefix,\n trailingInteractionElement,\n onTrailingInteractionElementClick,\n leadingInteractionElement,\n suffix,\n trailingIcon: TrailingIcon,\n isDisabled,\n validationState = 'none',\n size,\n showHintsAsTooltip,\n errorText,\n successText,\n trailingButton: TrailingButton,\n}: InputVisuals): ReactElement | null => {\n const {\n hasLeadingIcon,\n hasPrefix,\n hasSuffix,\n hasTrailingInteractionElement,\n hasLeadingInteractionElement,\n hasTrailingIcon,\n hasTrailingButton,\n } = getInputVisualsToBeRendered({\n leadingIcon: LeadingIcon,\n prefix,\n leadingInteractionElement,\n trailingInteractionElement,\n suffix,\n trailingIcon: TrailingIcon,\n trailingButton: TrailingButton,\n size,\n });\n\n const hasLeadingVisuals = hasLeadingInteractionElement || hasLeadingIcon || hasPrefix;\n const hasTrailingVisuals =\n hasTrailingInteractionElement || 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 {hasLeadingInteractionElement ? (\n <BaseBox\n paddingLeft={getInteractionElementStyles({\n hasTrailingIcon,\n hasLeadingInteractionElement,\n hasSuffix,\n hasTrailingButton,\n })}\n display=\"flex\"\n alignItems=\"stretch\"\n alignSelf=\"stretch\"\n >\n {leadingInteractionElement}\n </BaseBox>\n ) : null}\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.muted'}\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\n {...getVisualContainerStyles({\n shouldStretchTrailingBox:\n hasTrailingInteractionElement && Boolean(onTrailingInteractionElementClick),\n })}\n >\n {hasTrailingInteractionElement ? (\n <BaseBox\n {...getVisualContainerStyles({\n shouldStretchTrailingBox:\n hasTrailingInteractionElement && Boolean(onTrailingInteractionElementClick),\n })}\n >\n <BaseBox\n paddingRight={getInteractionElementStyles({\n hasTrailingIcon,\n hasTrailingInteractionElement,\n hasSuffix,\n hasTrailingButton,\n })}\n display=\"flex\"\n alignItems=\"stretch\"\n alignSelf=\"stretch\"\n {...(!isReactNative() && { onClick: onTrailingInteractionElementClick })}\n >\n {trailingInteractionElement}\n </BaseBox>\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 justifyContent=\"center\"\n alignItems=\"center\"\n {...getTrailingIconStyles({ hasTrailingIcon, hasTrailingButton })}\n >\n <ValidationIconTooltip\n showHintsAsTooltip={showHintsAsTooltip}\n errorText={errorText}\n successText={successText}\n validationState={validationState}\n >\n <TrailingIcon\n size={iconSize[size]}\n color={\n isDisabled ? 'interactive.icon.gray.disabled' : trailingIconColor[validationState]\n }\n />\n </ValidationIconTooltip>\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","_ref","arguments","length","undefined","shouldStretchTrailingBox","display","flexDirection","alignItems","alignSelf","trailingIconColor","none","error","success","iconSize","medium","large","textSize","getPrefixStyles","_ref2","hasLeadingIcon","hasPrefix","paddingLeft","getInteractionElementStyles","_ref3","hasTrailingIcon","hasLeadingInteractionElement","hasTrailingInteractionElement","hasSuffix","hasTrailingButton","getSuffixStyles","_ref4","paddingRight","getTrailingIconStyles","_ref5","getInputVisualsToBeRendered","_ref6","leadingIcon","prefix","trailingInteractionElement","leadingInteractionElement","suffix","trailingIcon","trailingButton","Boolean","getTooltipContent","_ref7","validationState","errorText","successText","ValidationIconTooltip","_ref8","children","showHintsAsTooltip","_jsx","Tooltip","content","Box","justifyContent","BaseInputVisuals","_ref9","LeadingIcon","onTrailingInteractionElementClick","TrailingIcon","isDisabled","_ref9$validationState","size","TrailingButton","_getInputVisualsToBeR","hasLeadingVisuals","hasTrailingVisuals","__DEV__","isValidAllowedChildren","throwBladeError","message","moduleName","_jsxs","BaseBox","Object","assign","color","Text","variant","weight","isReactNative","onClick","React","cloneElement"],"mappings":";;;;;;;;;;;;;;;;;;;AAkCA,IAAMA,wBAAwB,CAAG,SAA3BA,wBAAwBA,EAAA,CAAA,IAAAC,IAAA,CAAAC,SAAA,CAAAC,MAAA,CAAA,CAAA,EAAAD,SAAA,CAAAE,CAAAA,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AAA,CAEjEE,GAAA,CAACJ,qBAAqB,CAAA,CACpBG,kBAAkB,CAAEA,kBAAmB,CACvCL,SAAS,CAAEA,SAAU,CACrBC,WAAW,CAAEA,WAAY,CACzBF,eAAe,CAAEA,eAAgB,CAAAK,QAAA,CAEjCE,GAAA,CAACS,YAAY,CAAA,CACXG,IAAI,CAAEpD,QAAQ,CAACoD,IAAI,CAAE,CACrBc,KAAK,CACHhB,UAAU,CAAG,gCAAgC,CAAGtD,iBAAiB,CAACqC,eAAe,CAClF,CACF,CAAC,CACmB,CAAC,CACjB,CAAA,CAAC,CACR,IAAI,CACPoB,cAAc,CACbb,GAAA,CAACuB,OAAO,EAAC7C,YAAY,CAAC,WAAW,CAAC1B,OAAO,CAAC,MAAM,CAAA8C,QAAA,CAC7CkC,cAAK,CAACC,YAAY,CAACpB,cAAc,CAAE,CAClCD,IAAI,CAAJA,IAAI,CACJgB,OAAO,CAAE,QAAQ,CACjBlB,UAAU,CAAVA,UACF,CAAC,CAAC,CACK,CAAC,CACR,IAAI,GACD,CAAC,CAEd,CAEA,OAAO,IAAI,CACb;;;;"}
@@ -17,7 +17,7 @@ import { rowDensityToIsTableInputCellMapping, tableEditableCellRowDensityToInput
17
17
  import { useTableEditableCell } from '../../Table/TableEditableCellContext.js';
18
18
  import { jsx } from 'react/jsx-runtime';
19
19
 
20
- 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$validationStat,_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 _useTableContext=useTableContext(),rowDensity=_useTableContext.rowDensity;var _useTableEditableCell=useTableEditableCell(),isInsideTableEditableCell=_useTableEditableCell.isInsideTableEditableCell;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]);var tableInputProps={isTableInputCell:rowDensityToIsTableInputCellMapping[rowDensity],id:'table-editable-cell-input',size:tableEditableCellRowDensityToInputSizeMap[rowDensity],trailingIcon:validationStateToInputTrailingIconMap[(_props$validationStat=props.validationState)!=null?_props$validationStat:'none'],showHintsAsTooltip:true};var isValidationStateNone=props.validationState==='none'||props.validationState===undefined;return jsx(BaseInput,Object.assign({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,trailingInteractionElement:isAutoCompleteInHeader||isInsideTableEditableCell&&!isValidationStateNone?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})},isInsideTableEditableCell?tableInputProps:undefined));};var BaseDropdownInputTrigger=React__default.forwardRef(_BaseDropdownInputTrigger);
20
+ 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$validationStat,_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 _useTableContext=useTableContext(),rowDensity=_useTableContext.rowDensity;var _useTableEditableCell=useTableEditableCell(),isInsideTableEditableCell=_useTableEditableCell.isInsideTableEditableCell;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]);var tableInputProps={isTableInputCell:rowDensityToIsTableInputCellMapping[rowDensity],id:'table-editable-cell-input',size:tableEditableCellRowDensityToInputSizeMap[rowDensity],trailingIcon:validationStateToInputTrailingIconMap[(_props$validationStat=props.validationState)!=null?_props$validationStat:'none'],showHintsAsTooltip:true};var isValidationStateNone=props.validationState==='none'||props.validationState===undefined;return jsx(BaseInput,Object.assign({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,onTrailingInteractionElementClick:function onTrailingInteractionElementClick(){if(!props.isDisabled){if(!isReactNative()){var _triggererRef$current2;(_triggererRef$current2=triggererRef.current)==null?void 0:_triggererRef$current2.focus();}onTriggerClick();}},trailingInteractionElement:isAutoCompleteInHeader||isInsideTableEditableCell&&!isValidationStateNone?null:jsx(InputChevronIcon,{isDisabled:props.isDisabled,isOpen:isOpen})},isInsideTableEditableCell?tableInputProps:undefined));};var BaseDropdownInputTrigger=React__default.forwardRef(_BaseDropdownInputTrigger);
21
21
 
22
22
  export { BaseDropdownInputTrigger };
23
23
  //# sourceMappingURL=BaseDropdownInputTrigger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseDropdownInputTrigger.js","sources":["../../../../../../src/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.tsx"],"sourcesContent":["import React from 'react';\nimport { BaseInput } from '../BaseInput';\nimport type { BaseInputProps } from '../BaseInput';\nimport { InputChevronIcon } from './InputChevronIcon';\nimport type { BaseDropdownInputTriggerProps } from './types';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport { isReactNative } from '~utils';\nimport { getActionListContainerRole } from '~components/ActionList/getA11yRoles';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { getTagsGroup } from '~components/Tag/getTagsGroup';\nimport type { BladeElementRef } from '~utils/types';\nimport { useFirstRender } from '~utils/useFirstRender';\nimport { useTableContext } from '~components/Table/TableContext';\nimport {\n rowDensityToIsTableInputCellMapping,\n tableEditableCellRowDensityToInputSizeMap,\n validationStateToInputTrailingIconMap,\n} from '~components/Table/tokens';\nimport { useTableEditableCell } from '~components/Table/TableEditableCellContext';\n\nconst useControlledDropdownInput = (\n props: Pick<\n BaseDropdownInputTriggerProps,\n | 'onChange'\n | 'name'\n | 'value'\n | 'defaultValue'\n | 'onInputValueChange'\n | 'syncInputValueWithSelection'\n | 'isSelectInput'\n >,\n): void => {\n const isFirstRender = useFirstRender();\n const {\n changeCallbackTriggerer,\n isControlled,\n options,\n selectedIndices,\n controlledValueIndices,\n setSelectedIndices,\n selectionType,\n setIsControlled,\n } = useDropdown();\n\n const getValuesArrayFromIndices = (): string[] => {\n let indices: number[] = [];\n if (isControlled) {\n indices = controlledValueIndices;\n } else {\n indices = selectedIndices;\n }\n\n return indices.map((selectionIndex) => options[selectionIndex].value);\n };\n\n const selectValues = (valuesToSelect: string | string[]): void => {\n if (options.length > 0) {\n // we use empty `''` for clearing the input\n if (isEmpty(valuesToSelect)) {\n setSelectedIndices([]);\n } else if (typeof valuesToSelect === 'string') {\n // single select control\n const selectedItemIndex = options.findIndex((option) => option.value === valuesToSelect);\n if (selectedItemIndex >= 0) {\n setSelectedIndices([selectedItemIndex]);\n }\n } else {\n // multiselect control\n\n // Handles repeated values in user state\n const uniqueValues = Array.from(new Set(valuesToSelect));\n // Handle selectionType single with multiselect values\n const userValues = selectionType === 'single' ? [valuesToSelect?.[0]] : uniqueValues;\n\n const selectedItemIndices = userValues\n .map((optionValue) => options.findIndex((option) => option.value === optionValue))\n .filter((value) => value >= 0);\n\n setSelectedIndices(selectedItemIndices);\n }\n }\n };\n\n // Handles `defaultValue` prop\n React.useEffect(() => {\n if (options.length > 0 && props.defaultValue) {\n selectValues(props.defaultValue);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [options.length]);\n\n // Handles `value` prop\n React.useEffect(() => {\n if (options.length > 0 && props.value !== undefined) {\n if (!isControlled) {\n setIsControlled(true);\n }\n\n selectValues(props.value);\n\n // in single select AutoComplete, we have to set inputValue of autocomplete according to the new selection.\n if (selectionType === 'single' && !Array.isArray(props.value) && !props.isSelectInput) {\n props.syncInputValueWithSelection?.(props.value);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.value, options]);\n\n // onChange behaviour\n React.useEffect(() => {\n // Ignore calling onChange on mount\n\n if (!isFirstRender) {\n props.onChange?.({\n name: props.name,\n values: getValuesArrayFromIndices(),\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [changeCallbackTriggerer]);\n};\n\nconst _BaseDropdownInputTrigger = (\n props: BaseDropdownInputTriggerProps,\n ref: React.ForwardedRef<BladeElementRef>,\n): React.ReactElement => {\n const {\n isOpen,\n activeTagIndex,\n setActiveTagIndex,\n displayValue,\n selectionType,\n dropdownTriggerer,\n dropdownBaseId,\n selectedIndices,\n triggererRef,\n triggererWrapperRef,\n isTagDismissedRef,\n onTriggerClick,\n value,\n shouldIgnoreBlurAnimation,\n setShouldIgnoreBlurAnimation,\n activeIndex,\n hasFooterAction,\n hasAutoCompleteInBottomSheetHeader,\n options,\n removeOption,\n setChangeCallbackTriggerer,\n changeCallbackTriggerer,\n } = useDropdown();\n const { rowDensity } = useTableContext();\n const { isInsideTableEditableCell } = useTableEditableCell();\n\n const dropdownTriggerPlaceholder = props.placeholder ?? 'Select Option';\n const isAutoCompleteInHeader = !props.isSelectInput && hasAutoCompleteInBottomSheetHeader;\n\n const getShowAllTags = React.useCallback((): boolean => {\n if (hasAutoCompleteInBottomSheetHeader) {\n // When AutoComplete is in bottomsheet header, we never want to show all tags in outer select input\n if (props.isSelectInput) {\n return false;\n }\n\n // ... And we always want to show all tags in inner AutoComplete\n return true;\n }\n\n return isOpen;\n }, [hasAutoCompleteInBottomSheetHeader, props.isSelectInput, isOpen]);\n\n useControlledDropdownInput({\n onChange: props.onChange,\n name: props.name,\n value: props.value,\n defaultValue: props.defaultValue,\n syncInputValueWithSelection: props.syncInputValueWithSelection,\n isSelectInput: props.isSelectInput,\n });\n\n const getValue = (): string | undefined => {\n let prefix = '';\n if (props.labelPosition === 'inside-input' && props.label) {\n prefix = `${props.label}: `;\n }\n\n if (props.isSelectInput) {\n if (selectionType === 'single') {\n return `${prefix}${displayValue}`;\n }\n\n // In multiselect, we return tags so no display value is required\n return undefined;\n }\n\n // In AutoComplete, input has a special value too\n return props.inputValue;\n };\n\n const getTags = React.useMemo(\n () => ({ size }: { size: NonNullable<BaseInputProps['size']> }) => {\n if (selectionType === 'single') {\n return undefined;\n }\n\n return getTagsGroup({\n size,\n tags: selectedIndices.map((selectedIndex) => options[selectedIndex]?.title),\n activeTagIndex,\n isDisabled: props.isDisabled,\n onDismiss: ({ tagIndex }) => {\n if (isTagDismissedRef.current) {\n isTagDismissedRef.current.value = true;\n }\n\n if (!isReactNative()) {\n triggererRef.current?.focus();\n }\n\n removeOption(selectedIndices[tagIndex]);\n setChangeCallbackTriggerer(Number(changeCallbackTriggerer) + 1);\n },\n });\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [selectedIndices, selectionType, activeTagIndex, changeCallbackTriggerer, options],\n );\n\n const tableInputProps: Partial<BaseInputProps> = {\n isTableInputCell: rowDensityToIsTableInputCellMapping[rowDensity],\n id: 'table-editable-cell-input',\n size: tableEditableCellRowDensityToInputSizeMap[rowDensity],\n trailingIcon: validationStateToInputTrailingIconMap[props.validationState ?? 'none'],\n showHintsAsTooltip: true,\n };\n\n const isValidationStateNone =\n props.validationState === 'none' || props.validationState === undefined;\n\n return (\n <BaseInput\n as={props.isSelectInput ? 'button' : 'input'}\n ref={\n (!isReactNative()\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (node: any) => {\n triggererRef.current = node;\n if (ref) {\n if (typeof ref === 'function') {\n ref(node);\n } else {\n ref.current = node;\n }\n }\n }\n : null) as never\n }\n isDropdownTrigger={true}\n setInputWrapperRef={(wrapperNode) => {\n triggererWrapperRef.current = wrapperNode;\n }}\n maxTagRows={props.maxRows ?? 'single'}\n tags={getTags({ size: props.size || 'medium' })}\n showAllTags={getShowAllTags()}\n activeTagIndex={activeTagIndex}\n setActiveTagIndex={setActiveTagIndex}\n shouldIgnoreBlurAnimation={shouldIgnoreBlurAnimation}\n setShouldIgnoreBlurAnimation={setShouldIgnoreBlurAnimation}\n textAlign=\"left\"\n // Form Props\n label={props.label as string}\n placeholder={\n selectionType === 'multiple' && selectedIndices.length > 0\n ? undefined\n : dropdownTriggerPlaceholder\n }\n hideLabelText={props.label?.length === 0}\n accessibilityLabel={props.accessibilityLabel}\n labelPosition={props.labelPosition === 'inside-input' ? undefined : props.labelPosition}\n isLabelInsideInput={props.labelPosition === 'inside-input'}\n necessityIndicator={props.necessityIndicator}\n autoCompleteSuggestionType=\"none\"\n validationState={props.validationState}\n helpText={props.helpText}\n errorText={props.errorText}\n successText={props.successText}\n name={props.name}\n isDisabled={props.isDisabled}\n isRequired={props.isRequired}\n prefix={props.prefix}\n suffix={props.suffix}\n autoFocus={props.autoFocus} // eslint-disable-line jsx-a11y/no-autofocus\n value={getValue()}\n onClick={(e) => {\n if (props.isDisabled) {\n return;\n }\n props.onTriggerClick?.(e);\n }}\n onFocus={props.onFocus}\n onBlur={({ name }) => {\n props.onBlur?.({ name, value });\n }}\n leadingIcon={props.icon}\n // Meta Props\n componentName={props.isSelectInput ? MetaConstants.SelectInput : MetaConstants.AutoComplete}\n testID={props.testID}\n // a11y Props\n id={`${dropdownBaseId}-trigger`}\n labelId={`${dropdownBaseId}-label`}\n hasPopup={getActionListContainerRole(hasFooterAction, dropdownTriggerer)}\n isPopupExpanded={isOpen}\n activeDescendant={activeIndex >= 0 ? `${dropdownBaseId}-${activeIndex}` : undefined}\n popupId={`${dropdownBaseId}-actionlist`}\n // Special Props for Unique behaviour between Select and AutoComplete\n onChange={props.isSelectInput ? undefined : props.onInputValueChange}\n onKeyDown={props.onTriggerKeydown}\n size={props.size}\n trailingInteractionElement={\n isAutoCompleteInHeader || (isInsideTableEditableCell && !isValidationStateNone) ? null : (\n <InputChevronIcon\n onClick={() => {\n if (!props.isDisabled) {\n // Icon onClicks to the SelectInput itself\n if (!isReactNative()) {\n triggererRef.current?.focus();\n }\n onTriggerClick();\n }\n }}\n isDisabled={props.isDisabled}\n isOpen={isOpen}\n />\n )\n }\n {...(isInsideTableEditableCell ? tableInputProps : undefined)}\n />\n );\n};\n\nconst BaseDropdownInputTrigger = React.forwardRef(_BaseDropdownInputTrigger);\n\nexport { BaseDropdownInputTrigger };\n"],"names":["useControlledDropdownInput","props","isFirstRender","useFirstRender","_useDropdown","useDropdown","changeCallbackTriggerer","isControlled","options","selectedIndices","controlledValueIndices","setSelectedIndices","selectionType","setIsControlled","getValuesArrayFromIndices","indices","map","selectionIndex","value","selectValues","valuesToSelect","length","isEmpty","selectedItemIndex","findIndex","option","uniqueValues","Array","from","Set","userValues","selectedItemIndices","optionValue","filter","React","useEffect","defaultValue","undefined","isArray","isSelectInput","syncInputValueWithSelection","onChange","name","values","_BaseDropdownInputTrigger","ref","_props$placeholder","_props$validationStat","_props$maxRows","_props$label","_useDropdown2","isOpen","activeTagIndex","setActiveTagIndex","displayValue","dropdownTriggerer","dropdownBaseId","triggererRef","triggererWrapperRef","isTagDismissedRef","onTriggerClick","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","activeIndex","hasFooterAction","hasAutoCompleteInBottomSheetHeader","removeOption","setChangeCallbackTriggerer","_useTableContext","useTableContext","rowDensity","_useTableEditableCell","useTableEditableCell","isInsideTableEditableCell","dropdownTriggerPlaceholder","placeholder","isAutoCompleteInHeader","getShowAllTags","useCallback","getValue","prefix","labelPosition","label","inputValue","getTags","useMemo","_ref","size","getTagsGroup","tags","selectedIndex","_options$selectedInde","title","isDisabled","onDismiss","_ref2","tagIndex","current","isReactNative","_triggererRef$current","focus","Number","tableInputProps","isTableInputCell","rowDensityToIsTableInputCellMapping","id","tableEditableCellRowDensityToInputSizeMap","trailingIcon","validationStateToInputTrailingIconMap","validationState","showHintsAsTooltip","isValidationStateNone","_jsx","BaseInput","Object","assign","as","node","isDropdownTrigger","setInputWrapperRef","wrapperNode","maxTagRows","maxRows","showAllTags","textAlign","hideLabelText","accessibilityLabel","isLabelInsideInput","necessityIndicator","autoCompleteSuggestionType","helpText","errorText","successText","isRequired","suffix","autoFocus","onClick","e","onFocus","onBlur","_ref3","leadingIcon","icon","componentName","MetaConstants","SelectInput","AutoComplete","testID","labelId","hasPopup","getActionListContainerRole","isPopupExpanded","activeDescendant","popupId","onInputValueChange","onKeyDown","onTri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EjD,cAAe,CAAU,QAAA,CAAA,CAChC4F,OAAO,CAAG,CAAE5F,EAAAA,cAAe,QAAQ,CACnC6F,QAAQ,CAAEC,0BAA0B,CAACtF,eAAe,CAAET,iBAAiB,CAAE,CACzEgG,eAAe,CAAEpG,MAAO,CACxBqG,gBAAgB,CAAEzF,WAAW,EAAI,CAAC,CAAI,CAAEP,EAAAA,cAAe,CAAGO,CAAAA,EAAAA,WAAY,EAAC,CAAG1B,SAAU,CACpFoH,OAAO,CAAG,GAAEjG,cAAe,CAAA,WAAA,CAAa,CAExCf,QAAQ,CAAExC,KAAK,CAACsC,aAAa,CAAGF,SAAS,CAAGpC,KAAK,CAACyJ,kBAAmB,CACrEC,SAAS,CAAE1J,KAAK,CAAC2J,gBAAiB,CAClCrE,IAAI,CAAEtF,KAAK,CAACsF,IAAK,CACjBsE,0BAA0B,CACxBjF,sBAAsB,EAAKH,yBAAyB,EAAI,CAACsC,qBAAsB,CAAG,IAAI,CACpFC,GAAA,CAAC8C,gBAAgB,CAAA,CACftB,OAAO,CAAE,SAAAA,OAAA,EAAM,CACb,GAAI,CAACvI,KAAK,CAAC4F,UAAU,CAAE,CAErB,GAAI,CAACK,aAAa,EAAE,CAAE,CAAA6D,IAAAA,sBAAA,CACpB,CAAAA,sBAAA,CAAAtG,YAAY,CAACwC,OAAO,eAApB8D,sBAAA,CAAsB3D,KAAK,EAAE,CAC/B,CACAxC,cAAc,EAAE,CAClB,CACF,CAAE,CACFiC,UAAU,CAAE5F,KAAK,CAAC4F,UAAW,CAC7B1C,MAAM,CAAEA,MAAO,CAChB,CAEJ,CACIsB,CAAAA,yBAAyB,CAAG6B,eAAe,CAAGjE,SAAS,CAC7D,CAAC,CAEN,CAAC,CAEK,IAAA2H,wBAAwB,CAAG9H,cAAK,CAAC+H,UAAU,CAACrH,yBAAyB;;;;"}
1
+ {"version":3,"file":"BaseDropdownInputTrigger.js","sources":["../../../../../../src/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.tsx"],"sourcesContent":["import React from 'react';\nimport { BaseInput } from '../BaseInput';\nimport type { BaseInputProps } from '../BaseInput';\nimport { InputChevronIcon } from './InputChevronIcon';\nimport type { BaseDropdownInputTriggerProps } from './types';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport { useDropdown } from '~components/Dropdown/useDropdown';\nimport { isReactNative } from '~utils';\nimport { getActionListContainerRole } from '~components/ActionList/getA11yRoles';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { getTagsGroup } from '~components/Tag/getTagsGroup';\nimport type { BladeElementRef } from '~utils/types';\nimport { useFirstRender } from '~utils/useFirstRender';\nimport { useTableContext } from '~components/Table/TableContext';\nimport {\n rowDensityToIsTableInputCellMapping,\n tableEditableCellRowDensityToInputSizeMap,\n validationStateToInputTrailingIconMap,\n} from '~components/Table/tokens';\nimport { useTableEditableCell } from '~components/Table/TableEditableCellContext';\n\nconst useControlledDropdownInput = (\n props: Pick<\n BaseDropdownInputTriggerProps,\n | 'onChange'\n | 'name'\n | 'value'\n | 'defaultValue'\n | 'onInputValueChange'\n | 'syncInputValueWithSelection'\n | 'isSelectInput'\n >,\n): void => {\n const isFirstRender = useFirstRender();\n const {\n changeCallbackTriggerer,\n isControlled,\n options,\n selectedIndices,\n controlledValueIndices,\n setSelectedIndices,\n selectionType,\n setIsControlled,\n } = useDropdown();\n\n const getValuesArrayFromIndices = (): string[] => {\n let indices: number[] = [];\n if (isControlled) {\n indices = controlledValueIndices;\n } else {\n indices = selectedIndices;\n }\n\n return indices.map((selectionIndex) => options[selectionIndex].value);\n };\n\n const selectValues = (valuesToSelect: string | string[]): void => {\n if (options.length > 0) {\n // we use empty `''` for clearing the input\n if (isEmpty(valuesToSelect)) {\n setSelectedIndices([]);\n } else if (typeof valuesToSelect === 'string') {\n // single select control\n const selectedItemIndex = options.findIndex((option) => option.value === valuesToSelect);\n if (selectedItemIndex >= 0) {\n setSelectedIndices([selectedItemIndex]);\n }\n } else {\n // multiselect control\n\n // Handles repeated values in user state\n const uniqueValues = Array.from(new Set(valuesToSelect));\n // Handle selectionType single with multiselect values\n const userValues = selectionType === 'single' ? [valuesToSelect?.[0]] : uniqueValues;\n\n const selectedItemIndices = userValues\n .map((optionValue) => options.findIndex((option) => option.value === optionValue))\n .filter((value) => value >= 0);\n\n setSelectedIndices(selectedItemIndices);\n }\n }\n };\n\n // Handles `defaultValue` prop\n React.useEffect(() => {\n if (options.length > 0 && props.defaultValue) {\n selectValues(props.defaultValue);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [options.length]);\n\n // Handles `value` prop\n React.useEffect(() => {\n if (options.length > 0 && props.value !== undefined) {\n if (!isControlled) {\n setIsControlled(true);\n }\n\n selectValues(props.value);\n\n // in single select AutoComplete, we have to set inputValue of autocomplete according to the new selection.\n if (selectionType === 'single' && !Array.isArray(props.value) && !props.isSelectInput) {\n props.syncInputValueWithSelection?.(props.value);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.value, options]);\n\n // onChange behaviour\n React.useEffect(() => {\n // Ignore calling onChange on mount\n\n if (!isFirstRender) {\n props.onChange?.({\n name: props.name,\n values: getValuesArrayFromIndices(),\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [changeCallbackTriggerer]);\n};\n\nconst _BaseDropdownInputTrigger = (\n props: BaseDropdownInputTriggerProps,\n ref: React.ForwardedRef<BladeElementRef>,\n): React.ReactElement => {\n const {\n isOpen,\n activeTagIndex,\n setActiveTagIndex,\n displayValue,\n selectionType,\n dropdownTriggerer,\n dropdownBaseId,\n selectedIndices,\n triggererRef,\n triggererWrapperRef,\n isTagDismissedRef,\n onTriggerClick,\n value,\n shouldIgnoreBlurAnimation,\n setShouldIgnoreBlurAnimation,\n activeIndex,\n hasFooterAction,\n hasAutoCompleteInBottomSheetHeader,\n options,\n removeOption,\n setChangeCallbackTriggerer,\n changeCallbackTriggerer,\n } = useDropdown();\n const { rowDensity } = useTableContext();\n const { isInsideTableEditableCell } = useTableEditableCell();\n\n const dropdownTriggerPlaceholder = props.placeholder ?? 'Select Option';\n const isAutoCompleteInHeader = !props.isSelectInput && hasAutoCompleteInBottomSheetHeader;\n\n const getShowAllTags = React.useCallback((): boolean => {\n if (hasAutoCompleteInBottomSheetHeader) {\n // When AutoComplete is in bottomsheet header, we never want to show all tags in outer select input\n if (props.isSelectInput) {\n return false;\n }\n\n // ... And we always want to show all tags in inner AutoComplete\n return true;\n }\n\n return isOpen;\n }, [hasAutoCompleteInBottomSheetHeader, props.isSelectInput, isOpen]);\n\n useControlledDropdownInput({\n onChange: props.onChange,\n name: props.name,\n value: props.value,\n defaultValue: props.defaultValue,\n syncInputValueWithSelection: props.syncInputValueWithSelection,\n isSelectInput: props.isSelectInput,\n });\n\n const getValue = (): string | undefined => {\n let prefix = '';\n if (props.labelPosition === 'inside-input' && props.label) {\n prefix = `${props.label}: `;\n }\n\n if (props.isSelectInput) {\n if (selectionType === 'single') {\n return `${prefix}${displayValue}`;\n }\n\n // In multiselect, we return tags so no display value is required\n return undefined;\n }\n\n // In AutoComplete, input has a special value too\n return props.inputValue;\n };\n\n const getTags = React.useMemo(\n () => ({ size }: { size: NonNullable<BaseInputProps['size']> }) => {\n if (selectionType === 'single') {\n return undefined;\n }\n\n return getTagsGroup({\n size,\n tags: selectedIndices.map((selectedIndex) => options[selectedIndex]?.title),\n activeTagIndex,\n isDisabled: props.isDisabled,\n onDismiss: ({ tagIndex }) => {\n if (isTagDismissedRef.current) {\n isTagDismissedRef.current.value = true;\n }\n\n if (!isReactNative()) {\n triggererRef.current?.focus();\n }\n\n removeOption(selectedIndices[tagIndex]);\n setChangeCallbackTriggerer(Number(changeCallbackTriggerer) + 1);\n },\n });\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [selectedIndices, selectionType, activeTagIndex, changeCallbackTriggerer, options],\n );\n\n const tableInputProps: Partial<BaseInputProps> = {\n isTableInputCell: rowDensityToIsTableInputCellMapping[rowDensity],\n id: 'table-editable-cell-input',\n size: tableEditableCellRowDensityToInputSizeMap[rowDensity],\n trailingIcon: validationStateToInputTrailingIconMap[props.validationState ?? 'none'],\n showHintsAsTooltip: true,\n };\n\n const isValidationStateNone =\n props.validationState === 'none' || props.validationState === undefined;\n\n return (\n <BaseInput\n as={props.isSelectInput ? 'button' : 'input'}\n ref={\n (!isReactNative()\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (node: any) => {\n triggererRef.current = node;\n if (ref) {\n if (typeof ref === 'function') {\n ref(node);\n } else {\n ref.current = node;\n }\n }\n }\n : null) as never\n }\n isDropdownTrigger={true}\n setInputWrapperRef={(wrapperNode) => {\n triggererWrapperRef.current = wrapperNode;\n }}\n maxTagRows={props.maxRows ?? 'single'}\n tags={getTags({ size: props.size || 'medium' })}\n showAllTags={getShowAllTags()}\n activeTagIndex={activeTagIndex}\n setActiveTagIndex={setActiveTagIndex}\n shouldIgnoreBlurAnimation={shouldIgnoreBlurAnimation}\n setShouldIgnoreBlurAnimation={setShouldIgnoreBlurAnimation}\n textAlign=\"left\"\n // Form Props\n label={props.label as string}\n placeholder={\n selectionType === 'multiple' && selectedIndices.length > 0\n ? undefined\n : dropdownTriggerPlaceholder\n }\n hideLabelText={props.label?.length === 0}\n accessibilityLabel={props.accessibilityLabel}\n labelPosition={props.labelPosition === 'inside-input' ? undefined : props.labelPosition}\n isLabelInsideInput={props.labelPosition === 'inside-input'}\n necessityIndicator={props.necessityIndicator}\n autoCompleteSuggestionType=\"none\"\n validationState={props.validationState}\n helpText={props.helpText}\n errorText={props.errorText}\n successText={props.successText}\n name={props.name}\n isDisabled={props.isDisabled}\n isRequired={props.isRequired}\n prefix={props.prefix}\n suffix={props.suffix}\n autoFocus={props.autoFocus} // eslint-disable-line jsx-a11y/no-autofocus\n value={getValue()}\n onClick={(e) => {\n if (props.isDisabled) {\n return;\n }\n props.onTriggerClick?.(e);\n }}\n onFocus={props.onFocus}\n onBlur={({ name }) => {\n props.onBlur?.({ name, value });\n }}\n leadingIcon={props.icon}\n // Meta Props\n componentName={props.isSelectInput ? MetaConstants.SelectInput : MetaConstants.AutoComplete}\n testID={props.testID}\n // a11y Props\n id={`${dropdownBaseId}-trigger`}\n labelId={`${dropdownBaseId}-label`}\n hasPopup={getActionListContainerRole(hasFooterAction, dropdownTriggerer)}\n isPopupExpanded={isOpen}\n activeDescendant={activeIndex >= 0 ? `${dropdownBaseId}-${activeIndex}` : undefined}\n popupId={`${dropdownBaseId}-actionlist`}\n // Special Props for Unique behaviour between Select and AutoComplete\n onChange={props.isSelectInput ? undefined : props.onInputValueChange}\n onKeyDown={props.onTriggerKeydown}\n size={props.size}\n onTrailingInteractionElementClick={() => {\n if (!props.isDisabled) {\n // Icon onClicks to the SelectInput itself\n if (!isReactNative()) {\n triggererRef.current?.focus();\n }\n onTriggerClick();\n }\n }}\n trailingInteractionElement={\n isAutoCompleteInHeader || (isInsideTableEditableCell && !isValidationStateNone) ? null : (\n <InputChevronIcon isDisabled={props.isDisabled} isOpen={isOpen} />\n )\n }\n {...(isInsideTableEditableCell ? tableInputProps : undefined)}\n />\n );\n};\n\nconst BaseDropdownInputTrigger = React.forwardRef(_BaseDropdownInputTrigger);\n\nexport { BaseDropdownInputTrigger };\n"],"names":["useControlledDropdownInput","props","isFirstRender","useFirstRender","_useDropdown","useDropdown","changeCallbackTriggerer","isControlled","options","selectedIndices","controlledValueIndices","setSelectedIndices","selectionType","setIsControlled","getValuesArrayFromIndices","indices","map","selectionIndex","value","selectValues","valuesToSelect","length","isEmpty","selectedItemIndex","findIndex","option","uniqueValues","Array","from","Set","userValues","selectedItemIndices","optionValue","filter","React","useEffect","defaultValue","undefined","isArray","isSelectInput","syncInputValueWithSelection","onChange","name","values","_BaseDropdownInputTrigger","ref","_props$placeholder","_props$validationStat","_props$maxRows","_props$label","_useDropdown2","isOpen","activeTagIndex","setActiveTagIndex","displayValue","dropdownTriggerer","dropdownBaseId","triggererRef","triggererWrapperRef","isTagDismissedRef","onTriggerClick","shouldIgnoreBlurAnimation","setShouldIgnoreBlurAnimation","activeIndex","hasFooterAction","hasAutoCompleteInBottomSheetHeader","removeOption","setChangeCallbackTriggerer","_useTableContext","useTableContext","rowDensity","_useTableEditableCell","useTableEditableCell","isInsideTableEditableCell","dropdownTriggerPlaceholder","placeholder","isAutoCompleteInHeader","getShowAllTags","useCallback","getValue","prefix","labelPosition","label","inputValue","getTags","useMemo","_ref","size","getTagsGroup","tags","selectedIndex","_options$selectedInde","title","isDisabled","onDismiss","_ref2","tagIndex","current","isReactNative","_triggererRef$current","focus","Number","tableInputProps","isTableInputCell","rowDensityToIsTableInputCellMapping","id","tableEditableCellRowDensityToInputSizeMap","trailingIcon","validationStateToInputTrailingIconMap","validationState","showHintsAsTooltip","isValidationStateNone","_jsx","BaseInput","Object","assign","as","node","isDropdownTrigger","setInputWrapperRef","wrapperNode","maxTagRows","maxRows","showAllTags","textAlign","hideLabelText","accessibilityLabel","isLabelInsideInput","necessityIndicator","autoCompleteSuggestionType","helpText","errorText","successText","isRequired","suffix","autoFocus","onClick","e","onFocus","onBlur","_ref3","leadingIcon","icon","componentName","MetaConstants","SelectInput","AutoComplete","testID","labelId","hasPopup","getActionListContainerRole","isPopupExpanded","activeDescendant","popupId","onInputValueChange","onKeyDown","onTriggerKeydown","onTrailingInteractionElementClick","_triggererRef$current2","trailingInteractionElement","InputChevronIcon","BaseDropdownInputTrigger","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,IAAMA,0BAA0B,CAAG,SAA7BA,0BAA0BA,CAC9BC,KASC,CACQ,CACT,IAAMC,aAAa,CAAGC,cAAc,EAAE,CACtC,IAAAC,YAAA,CASIC,WAAW,EAAE,CARfC,uBAAuB,CAAAF,YAAA,CAAvBE,uBAAuB,CACvBC,YAAY,CAAAH,YAAA,CAAZG,YAAY,CACZC,OAAO,CAAAJ,YAAA,CAAPI,OAAO,CACPC,eAAe,CAAAL,YAAA,CAAfK,eAAe,CACfC,sBAAsB,CAAAN,YAAA,CAAtBM,sBAAsB,CACtBC,k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K,CAAC2J,gBAAiB,CAClCrE,IAAI,CAAEtF,KAAK,CAACsF,IAAK,CACjBsE,iCAAiC,CAAE,SAAAA,iCAAAA,EAAM,CACvC,GAAI,CAAC5J,KAAK,CAAC4F,UAAU,CAAE,CAErB,GAAI,CAACK,aAAa,EAAE,CAAE,CAAA,IAAA4D,sBAAA,CACpB,CAAAA,sBAAA,CAAArG,YAAY,CAACwC,OAAO,GAApB6D,IAAAA,CAAAA,KAAAA,CAAAA,CAAAA,sBAAA,CAAsB1D,KAAK,EAAE,CAC/B,CACAxC,cAAc,EAAE,CAClB,CACF,CAAE,CACFmG,0BAA0B,CACxBnF,sBAAsB,EAAKH,yBAAyB,EAAI,CAACsC,qBAAsB,CAAG,IAAI,CACpFC,GAAA,CAACgD,gBAAgB,CAAA,CAACnE,UAAU,CAAE5F,KAAK,CAAC4F,UAAW,CAAC1C,MAAM,CAAEA,MAAO,CAAE,CAEpE,CACIsB,CAAAA,yBAAyB,CAAG6B,eAAe,CAAGjE,SAAS,CAC7D,CAAC,CAEN,CAAC,CAEK,IAAA4H,wBAAwB,CAAG/H,cAAK,CAACgI,UAAU,CAACtH,yBAAyB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.js","sources":["../../../../../../src/components/Input/TextInput/TextInput.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport type { ReactElement, ReactNode } from 'react';\nimport type { TextInput as TextInputReactNative } from 'react-native';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport { getKeyboardAndAutocompleteProps } from '../BaseInput/utils';\nimport type { TaggedInputProps } from '../BaseInput/useTaggedInput';\nimport { useTaggedInput } from '../BaseInput/useTaggedInput';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport type { IconComponent } from '~components/Icons';\nimport { CloseIcon } from '~components/Icons';\nimport { IconButton } from '~components/Button/IconButton';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { CharacterCounter } from '~components/Form/CharacterCounter';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Spinner } from '~components/Spinner';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getPlatformType } from '~utils';\nimport { useMergeRefs } from '~utils/useMergeRefs';\nimport type { BladeElementRef, BladeElementRefWithValue } from '~utils/types';\nimport { hintMarginTop } from '~components/Form/formTokens';\n\n// Users should use PasswordInput for input type password\ntype Type = Exclude<BaseInputProps['type'], 'password'>;\n\ntype TextInputCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'necessityIndicator'\n | 'validationState'\n | 'helpText'\n | 'errorText'\n | 'successText'\n | 'placeholder'\n | 'defaultValue'\n | 'name'\n | 'onChange'\n | 'onFocus'\n | 'onBlur'\n | 'value'\n | 'isDisabled'\n | 'isRequired'\n | 'prefix'\n | 'suffix'\n | 'maxCharacters'\n | 'autoFocus'\n | 'keyboardReturnKeyType'\n | 'autoCompleteSuggestionType'\n | 'onSubmit'\n | 'autoCapitalize'\n | 'testID'\n | 'onClick'\n | 'size'\n | 'leadingIcon'\n | 'trailingButton'\n | 'trailingIcon'\n> & {\n /**\n * Decides whether to render a clear icon button\n */\n showClearButton?: boolean;\n\n /**\n * Event handler to handle the onClick event for clear button. Used when `showClearButton` is `true`\n */\n onClearButtonClick?: () => void;\n\n /**\n * Decides whether to show a loading spinner for the input field.\n */\n isLoading?: boolean;\n\n /**\n * Icon that will be rendered at the beginning of the input field\n * @deprecated Use `leadingIcon` instead. This prop will be removed in the next major version.\n */\n icon?: IconComponent;\n /**\n * Type of Input Field to be rendered. Use `PasswordInput` for type `password`\n *\n *\n * **Note on number type**\n *\n * `type=\"number\"` internally uses `inputMode=\"numeric\"` instead of HTML's `type=\"number\"` which also allows text characters.\n * If you have a usecase where you only want to support number input, you can handle it on validations end.\n *\n * Check out [Why the GOV.UK Design System team changed the input type for numbers](https://technology.blog.gov.uk/2020/02/24/why-the-gov-uk-design-system-team-changed-the-input-type-for-numbers/) for reasoning\n *\n * @default text\n */\n type?: Type;\n} & TaggedInputProps &\n StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype TextInputPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype TextInputPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\ntype TextInputProps = (TextInputPropsWithA11yLabel | TextInputPropsWithLabel) &\n TextInputCommonProps;\n\n// need to do this to tell TS to infer type as TextInput of React Native and make it believe that `ref.current.clear()` exists\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isReactNative = (_textInputRef: any): _textInputRef is TextInputReactNative => {\n return getPlatformType() === 'react-native';\n};\n\nconst _TextInput: React.ForwardRefRenderFunction<BladeElementRef, TextInputProps> = (\n {\n label,\n accessibilityLabel,\n labelPosition = 'top',\n placeholder,\n type = 'text',\n defaultValue,\n name,\n value,\n maxCharacters,\n onChange,\n onClick,\n onFocus,\n onBlur,\n onSubmit,\n isDisabled,\n necessityIndicator,\n validationState,\n errorText,\n helpText,\n successText,\n isRequired,\n icon,\n prefix,\n showClearButton,\n onClearButtonClick,\n isLoading,\n suffix,\n autoFocus,\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n autoCapitalize,\n testID,\n size = 'medium',\n leadingIcon,\n trailingIcon,\n isTaggedInput,\n tags,\n onTagChange,\n ...styledProps\n },\n ref,\n): ReactElement => {\n const textInputRef = React.useRef<BladeElementRefWithValue>(null);\n const mergedRef = useMergeRefs(ref, textInputRef);\n const [shouldShowClearButton, setShouldShowClearButton] = useState(false);\n const [isInputFocussed, setIsInputFocussed] = useState(autoFocus ?? false);\n const {\n activeTagIndex,\n setActiveTagIndex,\n getTags,\n handleTaggedInputKeydown,\n handleTaggedInputChange,\n handleTagsClear,\n } = useTaggedInput({\n isTaggedInput,\n tags,\n onTagChange,\n isDisabled,\n onChange,\n name,\n value,\n inputRef: textInputRef,\n });\n\n React.useEffect(() => {\n setShouldShowClearButton(Boolean(showClearButton && (defaultValue ?? value)));\n }, [showClearButton, defaultValue, value]);\n\n const renderInteractionElement = (): ReactNode => {\n if (isLoading) {\n return <Spinner accessibilityLabel=\"Loading Content\" color=\"primary\" />;\n }\n\n if (shouldShowClearButton) {\n return (\n <IconButton\n size=\"medium\"\n icon={CloseIcon}\n onClick={() => {\n if (isEmpty(value) && textInputRef.current) {\n // when the input field is uncontrolled take the ref and clear the input and then call the onClearButtonClick function\n if (isReactNative(textInputRef.current)) {\n textInputRef.current.clear();\n textInputRef.current.focus();\n } else if (textInputRef.current instanceof HTMLInputElement) {\n textInputRef.current.value = '';\n textInputRef.current.focus();\n }\n }\n handleTagsClear();\n // if the input field is controlled just call the click handler and the value change shall be left upto the consumer\n onClearButtonClick?.();\n textInputRef?.current?.focus();\n setShouldShowClearButton(false);\n }}\n isDisabled={isDisabled}\n accessibilityLabel=\"Clear Input Content\"\n />\n );\n }\n\n return null;\n };\n\n return (\n <BaseInput\n id=\"textinput\"\n componentName={MetaConstants.TextInput}\n ref={mergedRef}\n label={label as string}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n placeholder={placeholder}\n defaultValue={defaultValue}\n value={value}\n name={name}\n maxCharacters={maxCharacters}\n isDropdownTrigger={isTaggedInput}\n tags={isTaggedInput ? getTags({ size }) : undefined}\n showAllTags={isInputFocussed}\n maxTagRows=\"single\"\n activeTagIndex={activeTagIndex}\n setActiveTagIndex={setActiveTagIndex}\n onChange={({ name, value }) => {\n if (showClearButton && value?.length) {\n // show the clear button when the user starts typing in\n setShouldShowClearButton(true);\n }\n\n if (shouldShowClearButton && !value?.length) {\n // hide the clear button when the input field is empty\n setShouldShowClearButton(false);\n }\n\n handleTaggedInputChange({ name, value });\n onChange?.({ name, value });\n }}\n onClick={onClick}\n onFocus={(e) => {\n setIsInputFocussed(true);\n onFocus?.(e);\n }}\n onBlur={(e) => {\n setIsInputFocussed(false);\n onBlur?.(e);\n }}\n onKeyDown={(e) => {\n handleTaggedInputKeydown(e);\n }}\n onSubmit={onSubmit}\n isDisabled={isDisabled}\n necessityIndicator={necessityIndicator}\n isRequired={isRequired}\n leadingIcon={leadingIcon ?? icon}\n prefix={prefix}\n trailingInteractionElement={renderInteractionElement()}\n trailingIcon={trailingIcon}\n suffix={suffix}\n validationState={validationState}\n errorText={errorText}\n helpText={helpText}\n successText={successText}\n trailingFooterSlot={(value) => {\n return maxCharacters ? (\n <BaseBox marginTop={hintMarginTop[size]} marginRight=\"spacing.1\">\n <CharacterCounter\n currentCount={value?.length ?? 0}\n maxCount={maxCharacters}\n size={size}\n />\n </BaseBox>\n ) : null;\n }}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n testID={testID}\n {...getKeyboardAndAutocompleteProps({\n type,\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n autoCapitalize,\n })}\n size={size}\n {...styledProps}\n />\n );\n};\n\nconst TextInput = assignWithoutSideEffects(React.forwardRef(_TextInput), {\n displayName: 'TextInput',\n});\n\nexport type { TextInputProps };\nexport { TextInput };\n"],"names":["isReactNative","_textInputRef","getPlatformType","_TextInput","_ref","ref","label","accessibilityLabel","_ref$labelPosition","labelPosition","placeholder","_ref$type","type","defaultValue","name","value","maxCharacters","onChange","onClick","onFocus","onBlur","onSubmit","isDisabled","necessityIndicator","validationState","errorText","helpText","successText","isRequired","icon","prefix","showClearButton","onClearButtonClick","isLoading","suffix","autoFocus","keyboardReturnKeyType","autoCompleteSuggestionType","autoCapitalize","testID","_ref$size","size","leadingIcon","trailingIcon","isTaggedInput","tags","onTagChange","styledProps","_objectWithoutProperties","_excluded","textInputRef","React","useRef","mergedRef","useMergeRefs","_useState","useState","_useState2","_slicedToArray","shouldShowClearButton","setShouldShowClearButton","_useState3","_useState4","isInputFocussed","setIsInputFocussed","_useTaggedInput","useTaggedInput","inputRef","activeTagIndex","setActiveTagIndex","getTags","handleTaggedInputKeydown","handleTaggedInputChange","handleTagsClear","useEffect","Boolean","renderInteractionElement","_jsx","Spinner","color","IconButton","CloseIcon","_textInputRef$current","isEmpty","current","clear","focus","HTMLInputElement","BaseInput","Object","assign","id","componentName","MetaConstants","TextInput","hideLabelText","isDropdownTrigger","undefined","showAllTags","maxTagRows","_ref2","length","e","onKeyDown","trailingInteractionElement","trailingFooterSlot","_value$length","BaseBox","marginTop","hintMarginTop","marginRight","children","CharacterCounter","currentCount","maxCount","getKeyboardAndAutocompleteProps","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,eAAA,CAAA,aAAA,CAAA,MAAA,CAAA,cAAA,CAAA,MAAA,CAAA,OAAA,CAAA,eAAA,CAAA,UAAA,CAAA,SAAA,CAAA,SAAA,CAAA,QAAA,CAAA,UAAA,CAAA,YAAA,CAAA,oBAAA,CAAA,iBAAA,CAAA,WAAA,CAAA,UAAA,CAAA,aAAA,CAAA,YAAA,CAAA,MAAA,CAAA,QAAA,CAAA,iBAAA,CAAA,oBAAA,CAAA,WAAA,CAAA,QAAA,CAAA,WAAA,CAAA,uBAAA,CAAA,4BAAA,CAAA,gBAAA,CAAA,QAAA,CAAA,MAAA,CAAA,aAAA,CAAA,cAAA,CAAA,eAAA,CAAA,MAAA,CAAA,aAAA,CAAA,CAkIA,IAAMA,aAAa,CAAG,SAAhBA,aAAaA,CAAIC,aAAkB,CAA4C,CACnF,OAAOC,eAAe,EAAE,GAAK,cAAc,CAC7C,CAAC,CAED,IAAMC,UAA2E,CAAG,SAA9EA,UAA2EA,CAAAC,IAAA,CA0C/EC,GAAG,CACc,CAzCf,IAAAC,KAAK,CAAAF,IAA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"version":3,"file":"TextInput.js","sources":["../../../../../../src/components/Input/TextInput/TextInput.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport type { ReactElement, ReactNode } from 'react';\nimport type { TextInput as TextInputReactNative } from 'react-native';\nimport type { BaseInputProps } from '../BaseInput';\nimport { BaseInput } from '../BaseInput';\nimport { getKeyboardAndAutocompleteProps } from '../BaseInput/utils';\nimport type { TaggedInputProps } from '../BaseInput/useTaggedInput';\nimport { useTaggedInput } from '../BaseInput/useTaggedInput';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport type { IconComponent } from '~components/Icons';\nimport { CloseIcon } from '~components/Icons';\nimport { IconButton } from '~components/Button/IconButton';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { MetaConstants } from '~utils/metaAttribute';\nimport { CharacterCounter } from '~components/Form/CharacterCounter';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Spinner } from '~components/Spinner';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { getPlatformType } from '~utils';\nimport { useMergeRefs } from '~utils/useMergeRefs';\nimport type { BladeElementRef, BladeElementRefWithValue } from '~utils/types';\nimport { hintMarginTop } from '~components/Form/formTokens';\n\n// Users should use PasswordInput for input type password\ntype Type = Exclude<BaseInputProps['type'], 'password'>;\n\ntype TextInputCommonProps = Pick<\n BaseInputProps,\n | 'label'\n | 'accessibilityLabel'\n | 'labelPosition'\n | 'necessityIndicator'\n | 'validationState'\n | 'helpText'\n | 'errorText'\n | 'successText'\n | 'placeholder'\n | 'defaultValue'\n | 'name'\n | 'onChange'\n | 'onFocus'\n | 'onBlur'\n | 'value'\n | 'isDisabled'\n | 'isRequired'\n | 'prefix'\n | 'suffix'\n | 'maxCharacters'\n | 'autoFocus'\n | 'keyboardReturnKeyType'\n | 'autoCompleteSuggestionType'\n | 'onSubmit'\n | 'autoCapitalize'\n | 'testID'\n | 'onClick'\n | 'size'\n | 'leadingIcon'\n | 'trailingButton'\n | 'trailingIcon'\n | 'textAlign'\n> & {\n /**\n * Decides whether to render a clear icon button\n */\n showClearButton?: boolean;\n\n /**\n * Event handler to handle the onClick event for clear button. Used when `showClearButton` is `true`\n */\n onClearButtonClick?: () => void;\n\n /**\n * Decides whether to show a loading spinner for the input field.\n */\n isLoading?: boolean;\n\n /**\n * Icon that will be rendered at the beginning of the input field\n * @deprecated Use `leadingIcon` instead. This prop will be removed in the next major version.\n */\n icon?: IconComponent;\n /**\n * Type of Input Field to be rendered. Use `PasswordInput` for type `password`\n *\n *\n * **Note on number type**\n *\n * `type=\"number\"` internally uses `inputMode=\"numeric\"` instead of HTML's `type=\"number\"` which also allows text characters.\n * If you have a usecase where you only want to support number input, you can handle it on validations end.\n *\n * Check out [Why the GOV.UK Design System team changed the input type for numbers](https://technology.blog.gov.uk/2020/02/24/why-the-gov-uk-design-system-team-changed-the-input-type-for-numbers/) for reasoning\n *\n * @default text\n */\n type?: Type;\n} & TaggedInputProps &\n StyledPropsBlade;\n\n/*\n Mandatory accessibilityLabel prop when label is not provided\n*/\ntype TextInputPropsWithA11yLabel = {\n /**\n * Label to be shown for the input field\n */\n label?: undefined;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel: string;\n};\n\n/*\n Optional accessibilityLabel prop when label is provided\n*/\ntype TextInputPropsWithLabel = {\n /**\n * Label to be shown for the input field\n */\n label: string;\n /**\n * Accessibility label for the input\n */\n accessibilityLabel?: string;\n};\n\ntype TextInputProps = (TextInputPropsWithA11yLabel | TextInputPropsWithLabel) &\n TextInputCommonProps;\n\n// need to do this to tell TS to infer type as TextInput of React Native and make it believe that `ref.current.clear()` exists\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isReactNative = (_textInputRef: any): _textInputRef is TextInputReactNative => {\n return getPlatformType() === 'react-native';\n};\n\nconst _TextInput: React.ForwardRefRenderFunction<BladeElementRef, TextInputProps> = (\n {\n label,\n accessibilityLabel,\n labelPosition = 'top',\n placeholder,\n type = 'text',\n defaultValue,\n name,\n value,\n maxCharacters,\n onChange,\n onClick,\n onFocus,\n onBlur,\n onSubmit,\n isDisabled,\n necessityIndicator,\n validationState,\n errorText,\n helpText,\n successText,\n isRequired,\n icon,\n prefix,\n showClearButton,\n onClearButtonClick,\n isLoading,\n suffix,\n autoFocus,\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n autoCapitalize,\n testID,\n size = 'medium',\n leadingIcon,\n trailingIcon,\n isTaggedInput,\n tags,\n onTagChange,\n ...styledProps\n },\n ref,\n): ReactElement => {\n const textInputRef = React.useRef<BladeElementRefWithValue>(null);\n const mergedRef = useMergeRefs(ref, textInputRef);\n const [shouldShowClearButton, setShouldShowClearButton] = useState(false);\n const [isInputFocussed, setIsInputFocussed] = useState(autoFocus ?? false);\n const {\n activeTagIndex,\n setActiveTagIndex,\n getTags,\n handleTaggedInputKeydown,\n handleTaggedInputChange,\n handleTagsClear,\n } = useTaggedInput({\n isTaggedInput,\n tags,\n onTagChange,\n isDisabled,\n onChange,\n name,\n value,\n inputRef: textInputRef,\n });\n\n React.useEffect(() => {\n setShouldShowClearButton(Boolean(showClearButton && (defaultValue ?? value)));\n }, [showClearButton, defaultValue, value]);\n\n const renderInteractionElement = (): ReactNode => {\n if (isLoading) {\n return <Spinner accessibilityLabel=\"Loading Content\" color=\"primary\" />;\n }\n\n if (shouldShowClearButton) {\n return (\n <IconButton\n size=\"medium\"\n icon={CloseIcon}\n onClick={() => {\n if (isEmpty(value) && textInputRef.current) {\n // when the input field is uncontrolled take the ref and clear the input and then call the onClearButtonClick function\n if (isReactNative(textInputRef.current)) {\n textInputRef.current.clear();\n textInputRef.current.focus();\n } else if (textInputRef.current instanceof HTMLInputElement) {\n textInputRef.current.value = '';\n textInputRef.current.focus();\n }\n }\n handleTagsClear();\n // if the input field is controlled just call the click handler and the value change shall be left upto the consumer\n onClearButtonClick?.();\n textInputRef?.current?.focus();\n setShouldShowClearButton(false);\n }}\n isDisabled={isDisabled}\n accessibilityLabel=\"Clear Input Content\"\n />\n );\n }\n\n return null;\n };\n\n return (\n <BaseInput\n id=\"textinput\"\n componentName={MetaConstants.TextInput}\n ref={mergedRef}\n label={label as string}\n accessibilityLabel={accessibilityLabel}\n hideLabelText={!Boolean(label)}\n labelPosition={labelPosition}\n placeholder={placeholder}\n defaultValue={defaultValue}\n value={value}\n name={name}\n maxCharacters={maxCharacters}\n isDropdownTrigger={isTaggedInput}\n tags={isTaggedInput ? getTags({ size }) : undefined}\n showAllTags={isInputFocussed}\n maxTagRows=\"single\"\n activeTagIndex={activeTagIndex}\n setActiveTagIndex={setActiveTagIndex}\n onChange={({ name, value }) => {\n if (showClearButton && value?.length) {\n // show the clear button when the user starts typing in\n setShouldShowClearButton(true);\n }\n\n if (shouldShowClearButton && !value?.length) {\n // hide the clear button when the input field is empty\n setShouldShowClearButton(false);\n }\n\n handleTaggedInputChange({ name, value });\n onChange?.({ name, value });\n }}\n onClick={onClick}\n onFocus={(e) => {\n setIsInputFocussed(true);\n onFocus?.(e);\n }}\n onBlur={(e) => {\n setIsInputFocussed(false);\n onBlur?.(e);\n }}\n onKeyDown={(e) => {\n handleTaggedInputKeydown(e);\n }}\n onSubmit={onSubmit}\n isDisabled={isDisabled}\n necessityIndicator={necessityIndicator}\n isRequired={isRequired}\n leadingIcon={leadingIcon ?? icon}\n prefix={prefix}\n trailingInteractionElement={renderInteractionElement()}\n trailingIcon={trailingIcon}\n suffix={suffix}\n validationState={validationState}\n errorText={errorText}\n helpText={helpText}\n successText={successText}\n trailingFooterSlot={(value) => {\n return maxCharacters ? (\n <BaseBox marginTop={hintMarginTop[size]} marginRight=\"spacing.1\">\n <CharacterCounter\n currentCount={value?.length ?? 0}\n maxCount={maxCharacters}\n size={size}\n />\n </BaseBox>\n ) : null;\n }}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n testID={testID}\n {...getKeyboardAndAutocompleteProps({\n type,\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n autoCapitalize,\n })}\n size={size}\n {...styledProps}\n />\n );\n};\n\nconst TextInput = assignWithoutSideEffects(React.forwardRef(_TextInput), {\n displayName: 'TextInput',\n});\n\nexport type { TextInputProps };\nexport { TextInput };\n"],"names":["isReactNative","_textInputRef","getPlatformType","_TextInput","_ref","ref","label","accessibilityLabel","_ref$labelPosition","labelPosition","placeholder","_ref$type","type","defaultValue","name","value","maxCharacters","onChange","onClick","onFocus","onBlur","onSubmit","isDisabled","necessityIndicator","validationState","errorText","helpText","successText","isRequired","icon","prefix","showClearButton","onClearButtonClick","isLoading","suffix","autoFocus","keyboardReturnKeyType","autoCompleteSuggestionType","autoCapitalize","testID","_ref$size","size","leadingIcon","trailingIcon","isTaggedInput","tags","onTagChange","styledProps","_objectWithoutProperties","_excluded","textInputRef","React","useRef","mergedRef","useMergeRefs","_useState","useState","_useState2","_slicedToArray","shouldShowClearButton","setShouldShowClearButton","_useState3","_useState4","isInputFocussed","setIsInputFocussed","_useTaggedInput","useTaggedInput","inputRef","activeTagIndex","setActiveTagIndex","getTags","handleTaggedInputKeydown","handleTaggedInputChange","handleTagsClear","useEffect","Boolean","renderInteractionElement","_jsx","Spinner","color","IconButton","CloseIcon","_textInputRef$current","isEmpty","current","clear","focus","HTMLInputElement","BaseInput","Object","assign","id","componentName","MetaConstants","TextInput","hideLabelText","isDropdownTrigger","undefined","showAllTags","maxTagRows","_ref2","length","e","onKeyDown","trailingInteractionElement","trailingFooterSlot","_value$length","BaseBox","marginTop","hintMarginTop","marginRight","children","CharacterCounter","currentCount","maxCount","getKeyboardAndAutocompleteProps","assignWithoutSideEffects","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,eAAA,CAAA,aAAA,CAAA,MAAA,CAAA,cAAA,CAAA,MAAA,CAAA,OAAA,CAAA,eAAA,CAAA,UAAA,CAAA,SAAA,CAAA,SAAA,CAAA,QAAA,CAAA,UAAA,CAAA,YAAA,CAAA,oBAAA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Q,CAAElG,aAAc,CACxByB,IAAI,CAAEA,IAAK,CACZ,CAAC,CACK,CAAC,CACR,IAAI,CACV,CAAE,CAEFN,SAAS,CAAEA,SAAU,CACrBI,MAAM,CAAEA,MAAO,CAAA,CACX4E,+BAA+B,CAAC,CAClCvG,IAAI,CAAJA,IAAI,CACJwB,qBAAqB,CAArBA,qBAAqB,CACrBC,0BAA0B,CAA1BA,0BAA0B,CAC1BC,cAAc,CAAdA,cACF,CAAC,CAAC,CACFG,CAAAA,IAAI,CAAEA,IAAK,EACPM,WAAW,CAChB,CAAC,CAEN,CAAC,CAEK,IAAA+C,SAAS,CAAGsB,wBAAwB,CAACjE,cAAK,CAACkE,UAAU,CAAClH,UAAU,CAAC,CAAE,CACvEmH,WAAW,CAAE,WACf,CAAC;;;;"}
@@ -80,12 +80,18 @@ export { default as BankIcon } from './Icons/BankIcon/BankIcon.js';
80
80
  export { default as BarChartAltIcon } from './Icons/BarChartAltIcon/BarChartAltIcon.js';
81
81
  export { default as BarChartIcon } from './Icons/BarChartIcon/BarChartIcon.js';
82
82
  export { default as BarCodeIcon } from './Icons/BarCodeIcon/BarCodeIcon.js';
83
+ export { default as Battery100PercentIcon } from './Icons/Battery100PercentIcon/Battery100PercentIcon.js';
84
+ export { default as Battery20PercentIcon } from './Icons/Battery20PercentIcon/Battery20PercentIcon.js';
85
+ export { default as Battery40PercentIcon } from './Icons/Battery40PercentIcon/Battery40PercentIcon.js';
86
+ export { default as Battery60PercentIcon } from './Icons/Battery60PercentIcon/Battery60PercentIcon.js';
87
+ export { default as Battery80PercentIcon } from './Icons/Battery80PercentIcon/Battery80PercentIcon.js';
83
88
  export { default as BatteryChargingIcon } from './Icons/BatteryChargingIcon/BatteryChargingIcon.js';
84
89
  export { default as BatteryIcon } from './Icons/BatteryIcon/BatteryIcon.js';
85
90
  export { default as BellIcon } from './Icons/BellIcon/BellIcon.js';
86
91
  export { default as BellOffIcon } from './Icons/BellOffIcon/BellOffIcon.js';
87
92
  export { default as BfsiIcon } from './Icons/BfsiIcon/BfsiIcon.js';
88
93
  export { default as BillIcon } from './Icons/BillIcon/BillIcon.js';
94
+ export { default as BillMeIcon } from './Icons/BillMeIcon/BillMeIcon.js';
89
95
  export { default as BluetoothIcon } from './Icons/BluetoothIcon/BluetoothIcon.js';
90
96
  export { default as BoldIcon } from './Icons/BoldIcon/BoldIcon.js';
91
97
  export { default as BookIcon } from './Icons/BookIcon/BookIcon.js';
@@ -249,6 +255,7 @@ export { default as MoveIcon } from './Icons/MoveIcon/MoveIcon.js';
249
255
  export { default as MusicIcon } from './Icons/MusicIcon/MusicIcon.js';
250
256
  export { default as MyAccountIcon } from './Icons/MyAccountIcon/MyAccountIcon.js';
251
257
  export { default as NavigationIcon } from './Icons/NavigationIcon/NavigationIcon.js';
258
+ export { default as NoSignalIcon } from './Icons/NoSignalIcon/NoSignalIcon.js';
252
259
  export { default as OctagonIcon } from './Icons/OctagonIcon/OctagonIcon.js';
253
260
  export { default as OffersIcon } from './Icons/OffersIcon/OffersIcon.js';
254
261
  export { default as OptimizerIcon } from './Icons/OptimizerIcon/OptimizerIcon.js';
@@ -317,6 +324,12 @@ export { default as ShoppingBagIcon } from './Icons/ShoppingBagIcon/ShoppingBagI
317
324
  export { default as ShoppingCartIcon } from './Icons/ShoppingCartIcon/ShoppingCartIcon.js';
318
325
  export { default as ShuffleIcon } from './Icons/ShuffleIcon/ShuffleIcon.js';
319
326
  export { default as SidebarIcon } from './Icons/SidebarIcon/SidebarIcon.js';
327
+ export { default as Signal1BarIcon } from './Icons/Signal1BarIcon/Signal1BarIcon.js';
328
+ export { default as Signal2BarIcon } from './Icons/Signal2BarIcon/Signal2BarIcon.js';
329
+ export { default as Signal3BarIcon } from './Icons/Signal3BarIcon/Signal3BarIcon.js';
330
+ export { default as Signal4BarIcon } from './Icons/Signal4BarIcon/Signal4BarIcon.js';
331
+ export { default as SignalIcon } from './Icons/SignalIcon/SignalIcon.js';
332
+ export { default as SimCardIcon } from './Icons/SimCardIcon/SimCardIcon.js';
320
333
  export { default as SkipBackIcon } from './Icons/SkipBackIcon/SkipBackIcon.js';
321
334
  export { default as SkipForwardIcon } from './Icons/SkipForwardIcon/SkipForwardIcon.js';
322
335
  export { default as SlackIcon } from './Icons/SlackIcon/SlackIcon.js';
@@ -363,6 +376,7 @@ export { default as UmbrellaIcon } from './Icons/UmbrellaIcon/UmbrellaIcon.js';
363
376
  export { default as UnderlineIcon } from './Icons/UnderlineIcon/UnderlineIcon.js';
364
377
  export { default as UnlockIcon } from './Icons/UnlockIcon/UnlockIcon.js';
365
378
  export { default as UpiAutopayIcon } from './Icons/UpiAutopayIcon/UpiAutopayIcon.js';
379
+ export { default as UpiIcon } from './Icons/UpiIcon/UpiIcon.js';
366
380
  export { default as UploadCloudIcon } from './Icons/UploadCloudIcon/UploadCloudIcon.js';
367
381
  export { default as UploadIcon } from './Icons/UploadIcon/UploadIcon.js';
368
382
  export { default as UserCheckIcon } from './Icons/UserCheckIcon/UserCheckIcon.js';
@@ -387,6 +401,7 @@ export { default as WifiOffIcon } from './Icons/WifiOffIcon/WifiOffIcon.js';
387
401
  export { default as WindIcon } from './Icons/WindIcon/WindIcon.js';
388
402
  export { default as XCircleIcon } from './Icons/XCircleIcon/XCircleIcon.js';
389
403
  export { default as XSquareIcon } from './Icons/XSquareIcon/XSquareIcon.js';
404
+ export { default as YoutubeIcon } from './Icons/YoutubeIcon/YoutubeIcon.js';
390
405
  export { default as ZapIcon } from './Icons/ZapIcon/ZapIcon.js';
391
406
  export { default as ZoomInIcon } from './Icons/ZoomInIcon/ZoomInIcon.js';
392
407
  export { default as ZoomOutIcon } from './Icons/ZoomOutIcon/ZoomOutIcon.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"propsTypes.js","sources":["../../../../../../../../src/components/Box/BaseBox/types/propsTypes.ts"],"sourcesContent":["import type { View } from 'react-native';\nimport type { CSSObject } from 'styled-components';\nimport type { MarginProps, PaddingProps, SpacingValueType } from './spacingTypes';\nimport type { MakeObjectResponsive } from './responsiveTypes';\nimport type { Theme } from '~components/BladeProvider';\nimport type { Border, Elevation } from '~tokens/global';\nimport type { PickCSSByPlatform, TestID } from '~utils/types';\nimport type { Platform } from '~utils';\nimport type { BladeCommonEvents } from '~components/types';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\n\ntype LayoutProps = MakeObjectResponsive<\n {\n height: SpacingValueType;\n minHeight: SpacingValueType;\n maxHeight: SpacingValueType;\n width: SpacingValueType;\n minWidth: SpacingValueType;\n maxWidth: SpacingValueType;\n } & PickCSSByPlatform<\n 'display' | 'overflow' | 'overflowX' | 'overflowY' | 'textAlign' | 'whiteSpace'\n >\n>;\n\ntype FlexboxProps = MakeObjectResponsive<\n {\n /**\n * This uses the native gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=gap\n */\n gap: SpacingValueType;\n /**\n * This uses the native row-gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=row-gap\n */\n rowGap: SpacingValueType;\n /**\n * This uses the native column-gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=column-gap\n */\n columnGap: SpacingValueType;\n /**\n * The **`flex`** CSS shorthand property sets how a flex _item_ will grow or shrink to fit the space available in its flex container.\n *\n * @see https://developer.mozilla.org/docs/Web/CSS/flex\n */\n flex: string | number;\n } & PickCSSByPlatform<\n | 'flexWrap'\n | 'flexDirection'\n | 'flexGrow'\n | 'flexShrink'\n | 'flexBasis'\n | 'alignItems'\n | 'alignContent'\n | 'alignSelf'\n | 'justifyItems'\n | 'justifyContent'\n | 'justifySelf'\n | 'placeSelf'\n | 'placeItems'\n | 'order'\n >\n>;\n\ntype PositionProps = MakeObjectResponsive<\n {\n top: SpacingValueType;\n right: SpacingValueType;\n bottom: SpacingValueType;\n left: SpacingValueType;\n } & PickCSSByPlatform<'position' | 'zIndex'>\n>;\n\ntype GridProps = MakeObjectResponsive<\n PickCSSByPlatform<\n | 'grid'\n | 'gridColumn'\n | 'gridRow'\n | 'gridRowStart'\n | 'gridRowEnd'\n | 'gridColumnStart'\n | 'gridColumnEnd'\n | 'gridArea'\n | 'gridAutoFlow'\n | 'gridAutoRows'\n | 'gridAutoColumns'\n | 'gridTemplate'\n | 'gridTemplateAreas'\n | 'gridTemplateColumns'\n | 'gridTemplateRows'\n >\n>;\n\ntype ColorObjects = 'feedback' | 'surface' | 'interactive';\ntype BackgroundOnlyColorObjects = 'popup' | 'overlay';\ntype BackgroundColorString<\n T extends ColorObjects | BackgroundOnlyColorObjects\n> = `${T}.background.${DotNotationToken<Theme['colors'][T]['background']>}`;\ntype BorderColorString<T extends ColorObjects> = `${T}.border.${DotNotationToken<\n Theme['colors'][T]['border']\n>}`;\n\n// Created this as an array so I can reuse it for runtime validation\nconst validBoxAsValues = [\n 'div',\n 'section',\n 'footer',\n 'header',\n 'main',\n 'aside',\n 'nav',\n 'span',\n 'label',\n] as const;\n\ntype BoxAsType = typeof validBoxAsValues[number];\n\n// Visual props that are common for both Box and BaseBox\ntype CommonBoxVisualProps = MakeObjectResponsive<\n {\n borderRadius: keyof Border['radius'];\n borderWidth: keyof Border['width'];\n borderColor: BorderColorString<'surface'>;\n borderTopWidth: keyof Border['width'];\n borderTopColor: BorderColorString<'surface'>;\n borderRightWidth: keyof Border['width'];\n borderRightColor: BorderColorString<'surface'>;\n borderBottomWidth: keyof Border['width'];\n borderBottomColor: BorderColorString<'surface'>;\n borderLeftWidth: keyof Border['width'];\n borderLeftColor: BorderColorString<'surface'>;\n borderTopLeftRadius: keyof Border['radius'];\n borderTopRightRadius: keyof Border['radius'];\n borderBottomRightRadius: keyof Border['radius'];\n borderBottomLeftRadius: keyof Border['radius'];\n } & PickCSSByPlatform<\n | 'backgroundImage'\n | 'backgroundSize'\n | 'backgroundPosition'\n | 'backgroundOrigin'\n | 'backgroundRepeat'\n | 'pointerEvents'\n | 'opacity'\n | 'visibility'\n | 'transform'\n | 'transformOrigin'\n | 'clipPath'\n | 'borderStyle'\n | 'borderTopStyle'\n | 'borderBottomStyle'\n | 'borderLeftStyle'\n | 'borderRightStyle'\n > & {\n /**\n * Sets the elevation for Box\n *\n * eg: `theme.elevation.midRaised`\n *\n * @default `theme.elevation.lowRaised`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-elevation--page\n */\n elevation?: keyof Elevation;\n }\n>;\n\n// Visual props that are specific BaseBox\n// This is used to ensure some of the more flexible BaseBox props are not passed to Box\ntype BaseBoxVisualProps = MakeObjectResponsive<\n {\n backgroundColor:\n | BackgroundColorString<'feedback'>\n | BackgroundColorString<'surface'>\n | BackgroundColorString<'interactive'>\n | BackgroundColorString<'overlay'>\n | BackgroundColorString<'popup'>\n | 'transparent'\n | (string & Record<never, never>);\n lineHeight: SpacingValueType;\n touchAction: CSSObject['touchAction'];\n userSelect: CSSObject['userSelect'];\n } & PickCSSByPlatform<\n | 'border'\n | 'borderLeft'\n | 'borderRight'\n | 'borderTop'\n | 'borderBottom'\n | 'opacity'\n | 'pointerEvents'\n | 'cursor'\n >\n>;\n\n// Visual props that are specific to Box\ntype BoxVisualProps = MakeObjectResponsive<{\n backgroundColor: BackgroundColorString<'surface'> | 'transparent';\n}> & {\n // Intentionally keeping this outside of MakeObjectResponsive since we only want as to be string and not responsive object\n // styled-components do not support passing `as` prop as an object\n as: BoxAsType;\n};\n\ntype StyledPropsBlade = Partial<\n Omit<\n MarginProps &\n Pick<FlexboxProps, 'alignSelf' | 'justifySelf' | 'placeSelf' | 'order'> &\n PositionProps &\n Pick<\n GridProps,\n | 'gridColumn'\n | 'gridRow'\n | 'gridRowStart'\n | 'gridRowEnd'\n | 'gridColumnStart'\n | 'gridColumnEnd'\n | 'gridArea'\n > &\n Pick<LayoutProps, 'display'> &\n Pick<CommonBoxVisualProps, 'visibility'>,\n '__brand__'\n >\n>;\n\ntype BoxCallbackProps = Omit<\n Platform.Select<{\n web: {\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseOver: React.MouseEventHandler<HTMLElement>;\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseEnter: React.MouseEventHandler<HTMLElement>;\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseLeave: React.MouseEventHandler<HTMLElement>;\n onScroll: React.UIEventHandler<HTMLElement>;\n };\n native: Record<'onMouseOver' | 'onMouseEnter' | 'onMouseLeave' | 'onScroll', undefined>;\n }>,\n '__brand__'\n>;\n\ntype BoxDragAndDropProps = Omit<\n Platform.Select<{\n web: {\n draggable: boolean;\n onDragStart: React.DragEventHandler<HTMLElement>;\n onDragEnter: React.DragEventHandler<HTMLElement>;\n onDragLeave: React.DragEventHandler<HTMLElement>;\n onDragOver: React.DragEventHandler<HTMLElement>;\n onDragEnd: React.DragEventHandler<HTMLElement>;\n onDrop: React.DragEventHandler<HTMLElement>;\n };\n native: Record<\n | 'draggable'\n | 'onDragStart'\n | 'onDragEnter'\n | 'onDragLeave'\n | 'onDragOver'\n | 'onDragEnd'\n | 'onDrop',\n undefined\n >;\n }>,\n '__brand__'\n>;\n\ntype BoxProps = Partial<\n PaddingProps &\n MarginProps &\n LayoutProps &\n FlexboxProps &\n PositionProps &\n GridProps &\n BoxCallbackProps &\n BoxDragAndDropProps &\n CommonBoxVisualProps &\n BoxVisualProps & {\n children?: React.ReactNode | React.ReactNode[];\n tabIndex?: number;\n id?: string;\n } & TestID\n>;\n\n// Visual props have different types for BaseBox and Box. BaseBox has more flexible types and more props exposed.\n// So first we Omit Visual props of Box\n// Then we append BaseBoxVisualProps and some other props for styled-components like class and id\ntype BaseBoxProps = Omit<BoxProps, keyof BoxVisualProps> &\n Partial<\n BaseBoxVisualProps & {\n className?: string;\n id?: string;\n tabIndex?: number;\n }\n > &\n BladeCommonEvents;\n\n// ref prop type\ntype BoxRefType = Platform.Select<{\n web: Omit<HTMLElement, 'style'>;\n native: View;\n}>;\n\nexport type { BaseBoxProps, BoxProps, BoxRefType, StyledPropsBlade, FlexboxProps };\nexport { validBoxAsValues };\n"],"names":["validBoxAsValues"],"mappings":"AA6GA;AACMA,IAAAA,gBAAgB,GAAG,CACvB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,OAAO,EACP,KAAK,EACL,MAAM,EACN,OAAO;;;;"}
1
+ {"version":3,"file":"propsTypes.js","sources":["../../../../../../../../src/components/Box/BaseBox/types/propsTypes.ts"],"sourcesContent":["import type { View } from 'react-native';\nimport type { CSSObject } from 'styled-components';\nimport type { MarginProps, PaddingProps, SpacingValueType } from './spacingTypes';\nimport type { MakeObjectResponsive } from './responsiveTypes';\nimport type { Theme } from '~components/BladeProvider';\nimport type { Border, Elevation } from '~tokens/global';\nimport type { PickCSSByPlatform, TestID } from '~utils/types';\nimport type { Platform } from '~utils';\nimport type { BladeCommonEvents } from '~components/types';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\n\ntype LayoutProps = MakeObjectResponsive<\n {\n height: SpacingValueType;\n minHeight: SpacingValueType;\n maxHeight: SpacingValueType;\n width: SpacingValueType;\n minWidth: SpacingValueType;\n maxWidth: SpacingValueType;\n } & PickCSSByPlatform<\n 'display' | 'overflow' | 'overflowX' | 'overflowY' | 'textAlign' | 'whiteSpace'\n >\n>;\n\ntype FlexboxProps = MakeObjectResponsive<\n {\n /**\n * This uses the native gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=gap\n */\n gap: SpacingValueType;\n /**\n * This uses the native row-gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=row-gap\n */\n rowGap: SpacingValueType;\n /**\n * This uses the native column-gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=column-gap\n */\n columnGap: SpacingValueType;\n /**\n * The **`flex`** CSS shorthand property sets how a flex _item_ will grow or shrink to fit the space available in its flex container.\n *\n * @see https://developer.mozilla.org/docs/Web/CSS/flex\n */\n flex: string | number;\n } & PickCSSByPlatform<\n | 'flexWrap'\n | 'flexDirection'\n | 'flexGrow'\n | 'flexShrink'\n | 'flexBasis'\n | 'alignItems'\n | 'alignContent'\n | 'alignSelf'\n | 'justifyItems'\n | 'justifyContent'\n | 'justifySelf'\n | 'placeSelf'\n | 'placeItems'\n | 'order'\n >\n>;\n\ntype PositionProps = MakeObjectResponsive<\n {\n top: SpacingValueType;\n right: SpacingValueType;\n bottom: SpacingValueType;\n left: SpacingValueType;\n } & PickCSSByPlatform<'position' | 'zIndex'>\n>;\n\ntype GridProps = MakeObjectResponsive<\n PickCSSByPlatform<\n | 'grid'\n | 'gridColumn'\n | 'gridRow'\n | 'gridRowStart'\n | 'gridRowEnd'\n | 'gridColumnStart'\n | 'gridColumnEnd'\n | 'gridArea'\n | 'gridAutoFlow'\n | 'gridAutoRows'\n | 'gridAutoColumns'\n | 'gridTemplate'\n | 'gridTemplateAreas'\n | 'gridTemplateColumns'\n | 'gridTemplateRows'\n >\n>;\n\ntype ColorObjects = 'feedback' | 'surface' | 'interactive';\ntype BackgroundOnlyColorObjects = 'popup' | 'overlay';\ntype BackgroundColorString<\n T extends ColorObjects | BackgroundOnlyColorObjects\n> = `${T}.background.${DotNotationToken<Theme['colors'][T]['background']>}`;\ntype BorderColorString<T extends ColorObjects> = `${T}.border.${DotNotationToken<\n Theme['colors'][T]['border']\n>}`;\n\n// Created this as an array so I can reuse it for runtime validation\nconst validBoxAsValues = [\n 'div',\n 'section',\n 'footer',\n 'header',\n 'main',\n 'aside',\n 'nav',\n 'span',\n 'label',\n] as const;\n\ntype BoxAsType = typeof validBoxAsValues[number];\n\n// Visual props that are common for both Box and BaseBox\ntype CommonBoxVisualProps = MakeObjectResponsive<\n {\n borderRadius: keyof Border['radius'];\n borderWidth: keyof Border['width'];\n borderColor: BorderColorString<'surface'>;\n borderTopWidth: keyof Border['width'];\n borderTopColor: BorderColorString<'surface'>;\n borderRightWidth: keyof Border['width'];\n borderRightColor: BorderColorString<'surface'>;\n borderBottomWidth: keyof Border['width'];\n borderBottomColor: BorderColorString<'surface'>;\n borderLeftWidth: keyof Border['width'];\n borderLeftColor: BorderColorString<'surface'>;\n borderTopLeftRadius: keyof Border['radius'];\n borderTopRightRadius: keyof Border['radius'];\n borderBottomRightRadius: keyof Border['radius'];\n borderBottomLeftRadius: keyof Border['radius'];\n } & PickCSSByPlatform<\n | 'backgroundImage'\n | 'backgroundSize'\n | 'backgroundPosition'\n | 'backgroundOrigin'\n | 'backgroundRepeat'\n | 'pointerEvents'\n | 'opacity'\n | 'visibility'\n | 'transform'\n | 'transformOrigin'\n | 'clipPath'\n | 'borderStyle'\n | 'borderTopStyle'\n | 'borderBottomStyle'\n | 'borderLeftStyle'\n | 'borderRightStyle'\n > & {\n /**\n * Sets the elevation for Box\n *\n * eg: `theme.elevation.midRaised`\n *\n * @default `theme.elevation.lowRaised`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-elevation--docs\n */\n elevation?: keyof Elevation;\n }\n>;\n\n// Visual props that are specific BaseBox\n// This is used to ensure some of the more flexible BaseBox props are not passed to Box\ntype BaseBoxVisualProps = MakeObjectResponsive<\n {\n backgroundColor:\n | BackgroundColorString<'feedback'>\n | BackgroundColorString<'surface'>\n | BackgroundColorString<'interactive'>\n | BackgroundColorString<'overlay'>\n | BackgroundColorString<'popup'>\n | 'transparent'\n | (string & Record<never, never>);\n lineHeight: SpacingValueType;\n touchAction: CSSObject['touchAction'];\n userSelect: CSSObject['userSelect'];\n } & PickCSSByPlatform<\n | 'border'\n | 'borderLeft'\n | 'borderRight'\n | 'borderTop'\n | 'borderBottom'\n | 'opacity'\n | 'pointerEvents'\n | 'cursor'\n >\n>;\n\n// Visual props that are specific to Box\ntype BoxVisualProps = MakeObjectResponsive<{\n backgroundColor: BackgroundColorString<'surface'> | 'transparent';\n}> & {\n // Intentionally keeping this outside of MakeObjectResponsive since we only want as to be string and not responsive object\n // styled-components do not support passing `as` prop as an object\n as: BoxAsType;\n};\n\ntype StyledPropsBlade = Partial<\n Omit<\n MarginProps &\n Pick<FlexboxProps, 'alignSelf' | 'justifySelf' | 'placeSelf' | 'order'> &\n PositionProps &\n Pick<\n GridProps,\n | 'gridColumn'\n | 'gridRow'\n | 'gridRowStart'\n | 'gridRowEnd'\n | 'gridColumnStart'\n | 'gridColumnEnd'\n | 'gridArea'\n > &\n Pick<LayoutProps, 'display'> &\n Pick<CommonBoxVisualProps, 'visibility'>,\n '__brand__'\n >\n>;\n\ntype BoxCallbackProps = Omit<\n Platform.Select<{\n web: {\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseOver: React.MouseEventHandler<HTMLElement>;\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseEnter: React.MouseEventHandler<HTMLElement>;\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseLeave: React.MouseEventHandler<HTMLElement>;\n onScroll: React.UIEventHandler<HTMLElement>;\n };\n native: Record<'onMouseOver' | 'onMouseEnter' | 'onMouseLeave' | 'onScroll', undefined>;\n }>,\n '__brand__'\n>;\n\ntype BoxDragAndDropProps = Omit<\n Platform.Select<{\n web: {\n draggable: boolean;\n onDragStart: React.DragEventHandler<HTMLElement>;\n onDragEnter: React.DragEventHandler<HTMLElement>;\n onDragLeave: React.DragEventHandler<HTMLElement>;\n onDragOver: React.DragEventHandler<HTMLElement>;\n onDragEnd: React.DragEventHandler<HTMLElement>;\n onDrop: React.DragEventHandler<HTMLElement>;\n };\n native: Record<\n | 'draggable'\n | 'onDragStart'\n | 'onDragEnter'\n | 'onDragLeave'\n | 'onDragOver'\n | 'onDragEnd'\n | 'onDrop',\n undefined\n >;\n }>,\n '__brand__'\n>;\n\ntype BoxProps = Partial<\n PaddingProps &\n MarginProps &\n LayoutProps &\n FlexboxProps &\n PositionProps &\n GridProps &\n BoxCallbackProps &\n BoxDragAndDropProps &\n CommonBoxVisualProps &\n BoxVisualProps & {\n children?: React.ReactNode | React.ReactNode[];\n tabIndex?: number;\n id?: string;\n } & TestID\n>;\n\n// Visual props have different types for BaseBox and Box. BaseBox has more flexible types and more props exposed.\n// So first we Omit Visual props of Box\n// Then we append BaseBoxVisualProps and some other props for styled-components like class and id\ntype BaseBoxProps = Omit<BoxProps, keyof BoxVisualProps> &\n Partial<\n BaseBoxVisualProps & {\n className?: string;\n id?: string;\n tabIndex?: number;\n }\n > &\n BladeCommonEvents;\n\n// ref prop type\ntype BoxRefType = Platform.Select<{\n web: Omit<HTMLElement, 'style'>;\n native: View;\n}>;\n\nexport type { BaseBoxProps, BoxProps, BoxRefType, StyledPropsBlade, FlexboxProps };\nexport { validBoxAsValues };\n"],"names":["validBoxAsValues"],"mappings":"AA6GA;AACMA,IAAAA,gBAAgB,GAAG,CACvB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,OAAO,EACP,KAAK,EACL,MAAM,EACN,OAAO;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","sources":["../../../../../../src/components/Card/Card.tsx"],"sourcesContent":["import React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport { CardSurface } from './CardSurface';\nimport { CardProvider, useVerifyInsideCard } from './CardContext';\nimport { LinkOverlay } from './LinkOverlay';\nimport { CardRoot } from './CardRoot';\nimport type { CardSpacingValueType, LinkOverlayProps } from './types';\nimport { CARD_LINK_OVERLAY_ID } from './constants';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { Elevation } from '~tokens/global';\nimport type { BoxProps } from '~components/Box';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { useVerifyAllowedChildren } from '~utils/useVerifyAllowedChildren/useVerifyAllowedChildren';\nimport type { Platform } from '~utils';\nimport { isReactNative } from '~utils';\nimport type { Theme } from '~components/BladeProvider';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\n\nexport const ComponentIds = {\n CardHeader: 'CardHeader',\n CardHeaderTrailing: 'CardHeaderTrailing',\n CardHeaderLeading: 'CardHeaderLeading',\n CardFooter: 'CardFooter',\n CardFooterTrailing: 'CardFooterTrailing',\n CardFooterLeading: 'CardFooterLeading',\n CardBody: 'CardBody',\n CardHeaderIcon: 'CardHeaderIcon',\n CardHeaderCounter: 'CardHeaderCounter',\n CardHeaderBadge: 'CardHeaderBadge',\n CardHeaderAmount: 'CardHeaderAmount',\n CardHeaderText: 'CardHeaderText',\n CardHeaderLink: 'CardHeaderLink',\n CardHeaderIconButton: 'CardHeaderIconButton',\n};\n\ntype CardSurfaceBackgroundColors = `surface.background.gray.${DotNotationToken<\n Theme['colors']['surface']['background']['gray']\n>}`;\n\nexport type CardProps = {\n /**\n * Card contents\n */\n children: React.ReactNode;\n /**\n * Sets the background color of the Card\n *\n * @default `surface.background.gray.intense`\n */\n backgroundColor?: CardSurfaceBackgroundColors;\n /**\n * Sets the border radius of the Card\n *\n * @default `medium`\n */\n borderRadius?: Extract<BoxProps['borderRadius'], 'medium' | 'large' | 'xlarge'>;\n /**\n * Sets the elevation for Cards\n *\n * eg: `theme.elevation.midRaised`\n *\n * @default `theme.elevation.lowRaised`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-elevation--page\n */\n elevation?: keyof Elevation;\n /**\n * Sets the padding equally on all sides. Only few `spacing` tokens are allowed deliberately\n * @default `spacing.7`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-spacing--page\n */\n padding?: CardSpacingValueType;\n /**\n * Sets the width of the card\n */\n width?: BoxProps['width'];\n /**\n * Sets the height of the card\n */\n height?: BoxProps['height'];\n /**\n * Sets minimum height of the card\n */\n minHeight?: BoxProps['minHeight'];\n /**\n * Sets minimum width of the card\n */\n minWidth?: BoxProps['minWidth'];\n /**\n * If `true`, the card will be in selected state\n * Card will have a primary color border around it.\n *\n * @default false\n */\n\n isSelected?: boolean;\n /**\n * Makes the Card linkable by setting the `href` prop\n *\n * @default undefined\n */\n href?: string;\n /**\n * Sets the `target` attribute for the linkable card\n */\n target?: string;\n /**\n * Sets the `rel` attribute for the linkable card\n */\n rel?: string;\n /**\n * Sets the accessibility label for the card\n * This is useful when the card has an `href` or `onClick` prop\n * Setting this will announce the label when the card is focused\n */\n accessibilityLabel?: string;\n /**\n * If `true`, the card will scale up on hover\n *\n * On mobile devices it will scale down on press\n *\n * @default false\n */\n shouldScaleOnHover?: boolean;\n /**\n * Callback triggered when the card is hovered\n */\n onHover?: () => void;\n /**\n * Callback triggered when the card is clicked\n */\n onClick?: (\n event: Platform.Select<{\n web: React.MouseEvent;\n native: GestureResponderEvent;\n }>,\n ) => void;\n /**\n * Sets the HTML element for the Card\n *\n * When `as` is set to `label`, the card will be rendered as a label element\n * This can be used to create a custom checkbox or radio button using the card\n *\n * @default undefined\n */\n as?: 'label';\n} & TestID &\n StyledPropsBlade;\n\nconst Card = ({\n children,\n backgroundColor = 'surface.background.gray.intense',\n borderRadius = 'medium',\n elevation = 'lowRaised',\n testID,\n padding = 'spacing.7',\n width,\n height,\n minHeight,\n minWidth,\n onClick,\n isSelected = false,\n accessibilityLabel,\n shouldScaleOnHover = false,\n onHover,\n href,\n target,\n rel,\n as,\n ...styledProps\n}: CardProps): React.ReactElement => {\n const [isFocused, setIsFocused] = React.useState(false);\n\n useVerifyAllowedChildren({\n children,\n componentName: 'Card',\n allowedComponents: [ComponentIds.CardHeader, ComponentIds.CardBody, ComponentIds.CardFooter],\n });\n\n const linkOverlayProps: LinkOverlayProps = {\n ...metaAttribute({ name: CARD_LINK_OVERLAY_ID }),\n ...makeAccessible({ label: accessibilityLabel, pressed: isSelected }),\n onFocus: () => {\n setIsFocused(true);\n },\n onBlur: () => {\n setIsFocused(false);\n },\n };\n const defaultRel = target && target === '_blank' ? 'noreferrer noopener' : undefined;\n\n return (\n <CardProvider>\n <CardRoot\n as={as}\n display={'block' as never}\n borderRadius=\"medium\"\n onMouseEnter={onHover as never}\n shouldScaleOnHover={shouldScaleOnHover}\n isSelected={isSelected}\n isFocused={isFocused}\n // on react native we need to pass onClick to root, because we don't need the LinkOverlay in RN\n onClick={isReactNative() ? onClick : undefined}\n width={width}\n height={height}\n minHeight={minHeight}\n minWidth={minWidth}\n href={href}\n accessibilityLabel={accessibilityLabel}\n {...metaAttribute({ name: MetaConstants.Card, testID })}\n {...getStyledProps(styledProps)}\n >\n <CardSurface\n height={height}\n minHeight={minHeight}\n padding={padding}\n borderRadius={borderRadius}\n elevation={elevation}\n textAlign={'left' as never}\n backgroundColor={backgroundColor}\n >\n {href ? (\n <LinkOverlay\n onClick={onClick}\n href={href}\n target={target}\n rel={rel ?? defaultRel}\n {...linkOverlayProps}\n />\n ) : null}\n {!href && onClick ? (\n <LinkOverlay as=\"button\" onClick={onClick} {...linkOverlayProps} />\n ) : null}\n {children}\n </CardSurface>\n </CardRoot>\n </CardProvider>\n );\n};\n\ntype CardBodyProps = {\n children: React.ReactNode;\n height?: BoxProps['height'];\n} & TestID;\n\nconst _CardBody = ({ height, children, testID }: CardBodyProps): React.ReactElement => {\n useVerifyInsideCard('CardBody');\n\n return (\n <BaseBox {...metaAttribute({ name: MetaConstants.CardBody, testID })} height={height}>\n {children}\n </BaseBox>\n );\n};\n\nconst CardBody = assignWithoutSideEffects(_CardBody, { componentId: ComponentIds.CardBody });\n\nexport { Card, CardBody };\n"],"names":["ComponentIds","CardHeader","CardHeaderTrailing","CardHeaderLeading","CardFooter","CardFooterTrailing","CardFooterLeading","CardBody","CardHeaderIcon","CardHeaderCounter","CardHeaderBadge","CardHeaderAmount","CardHeaderText","CardHeaderLink","CardHeaderIconButton","Card","_ref","children","_ref$backgroundColor","backgroundColor","_ref$borderRadius","borderRadius","_ref$elevation","elevation","testID","_ref$padding","padding","width","height","minHeight","minWidth","onClick","_ref$isSelected","isSelected","accessibilityLabel","_ref$shouldScaleOnHov","shouldScaleOnHover","onHover","href","target","rel","as","styledProps","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","isFocused","setIsFocused","useVerifyAllowedChildren","componentName","allowedComponents","linkOverlayProps","_objectSpread","metaAttribute","name","CARD_LINK_OVERLAY_ID","makeAccessible","label","pressed","onFocus","onBlur","defaultRel","undefined","_jsx","CardProvider","CardRoot","display","onMouseEnter","isReactNative","MetaConstants","getStyledProps","_jsxs","CardSurface","textAlign","LinkOverlay","_CardBody","_ref2","useVerifyInsideCard","BaseBox","assignWithoutSideEffects","componentId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBO,IAAMA,YAAY,GAAG;AAC1BC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,kBAAkB,EAAE,oBAAoB;AACxCC,EAAAA,iBAAiB,EAAE,mBAAmB;AACtCC,EAAAA,UAAU,EAAE,YAAY;AACxBC,EAAAA,kBAAkB,EAAE,oBAAoB;AACxCC,EAAAA,iBAAiB,EAAE,mBAAmB;A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AO,GAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AAAEI,IAAAA,MAAM,EAAEA,MAAO;AAAAX,IAAAA,QAAA,EAClFA,QAAAA;AAAQ,GAAA,CACF,CAAC,CAAA;AAEd,CAAC,CAAA;AAED,IAAMV,QAAQ,gBAAG4E,wBAAwB,CAACJ,SAAS,EAAE;EAAEK,WAAW,EAAEpF,YAAY,CAACO,QAAAA;AAAS,CAAC;;;;"}
1
+ {"version":3,"file":"Card.js","sources":["../../../../../../src/components/Card/Card.tsx"],"sourcesContent":["import React from 'react';\nimport type { GestureResponderEvent } from 'react-native';\nimport { CardSurface } from './CardSurface';\nimport { CardProvider, useVerifyInsideCard } from './CardContext';\nimport { LinkOverlay } from './LinkOverlay';\nimport { CardRoot } from './CardRoot';\nimport type { CardSpacingValueType, LinkOverlayProps } from './types';\nimport { CARD_LINK_OVERLAY_ID } from './constants';\nimport BaseBox from '~components/Box/BaseBox';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport type { TestID } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport type { Elevation } from '~tokens/global';\nimport type { BoxProps } from '~components/Box';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { useVerifyAllowedChildren } from '~utils/useVerifyAllowedChildren/useVerifyAllowedChildren';\nimport type { Platform } from '~utils';\nimport { isReactNative } from '~utils';\nimport type { Theme } from '~components/BladeProvider';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\n\nexport const ComponentIds = {\n CardHeader: 'CardHeader',\n CardHeaderTrailing: 'CardHeaderTrailing',\n CardHeaderLeading: 'CardHeaderLeading',\n CardFooter: 'CardFooter',\n CardFooterTrailing: 'CardFooterTrailing',\n CardFooterLeading: 'CardFooterLeading',\n CardBody: 'CardBody',\n CardHeaderIcon: 'CardHeaderIcon',\n CardHeaderCounter: 'CardHeaderCounter',\n CardHeaderBadge: 'CardHeaderBadge',\n CardHeaderAmount: 'CardHeaderAmount',\n CardHeaderText: 'CardHeaderText',\n CardHeaderLink: 'CardHeaderLink',\n CardHeaderIconButton: 'CardHeaderIconButton',\n};\n\ntype CardSurfaceBackgroundColors = `surface.background.gray.${DotNotationToken<\n Theme['colors']['surface']['background']['gray']\n>}`;\n\nexport type CardProps = {\n /**\n * Card contents\n */\n children: React.ReactNode;\n /**\n * Sets the background color of the Card\n *\n * @default `surface.background.gray.intense`\n */\n backgroundColor?: CardSurfaceBackgroundColors;\n /**\n * Sets the border radius of the Card\n *\n * @default `medium`\n */\n borderRadius?: Extract<BoxProps['borderRadius'], 'medium' | 'large' | 'xlarge'>;\n /**\n * Sets the elevation for Cards\n *\n * eg: `theme.elevation.midRaised`\n *\n * @default `theme.elevation.lowRaised`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-elevation--docs\n */\n elevation?: keyof Elevation;\n /**\n * Sets the padding equally on all sides. Only few `spacing` tokens are allowed deliberately\n * @default `spacing.7`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-spacing--docs\n */\n padding?: CardSpacingValueType;\n /**\n * Sets the width of the card\n */\n width?: BoxProps['width'];\n /**\n * Sets the height of the card\n */\n height?: BoxProps['height'];\n /**\n * Sets minimum height of the card\n */\n minHeight?: BoxProps['minHeight'];\n /**\n * Sets minimum width of the card\n */\n minWidth?: BoxProps['minWidth'];\n /**\n * If `true`, the card will be in selected state\n * Card will have a primary color border around it.\n *\n * @default false\n */\n\n isSelected?: boolean;\n /**\n * Makes the Card linkable by setting the `href` prop\n *\n * @default undefined\n */\n href?: string;\n /**\n * Sets the `target` attribute for the linkable card\n */\n target?: string;\n /**\n * Sets the `rel` attribute for the linkable card\n */\n rel?: string;\n /**\n * Sets the accessibility label for the card\n * This is useful when the card has an `href` or `onClick` prop\n * Setting this will announce the label when the card is focused\n */\n accessibilityLabel?: string;\n /**\n * If `true`, the card will scale up on hover\n *\n * On mobile devices it will scale down on press\n *\n * @default false\n */\n shouldScaleOnHover?: boolean;\n /**\n * Callback triggered when the card is hovered\n */\n onHover?: () => void;\n /**\n * Callback triggered when the card is clicked\n */\n onClick?: (\n event: Platform.Select<{\n web: React.MouseEvent;\n native: GestureResponderEvent;\n }>,\n ) => void;\n /**\n * Sets the HTML element for the Card\n *\n * When `as` is set to `label`, the card will be rendered as a label element\n * This can be used to create a custom checkbox or radio button using the card\n *\n * @default undefined\n */\n as?: 'label';\n} & TestID &\n StyledPropsBlade;\n\nconst Card = ({\n children,\n backgroundColor = 'surface.background.gray.intense',\n borderRadius = 'medium',\n elevation = 'lowRaised',\n testID,\n padding = 'spacing.7',\n width,\n height,\n minHeight,\n minWidth,\n onClick,\n isSelected = false,\n accessibilityLabel,\n shouldScaleOnHover = false,\n onHover,\n href,\n target,\n rel,\n as,\n ...styledProps\n}: CardProps): React.ReactElement => {\n const [isFocused, setIsFocused] = React.useState(false);\n\n useVerifyAllowedChildren({\n children,\n componentName: 'Card',\n allowedComponents: [ComponentIds.CardHeader, ComponentIds.CardBody, ComponentIds.CardFooter],\n });\n\n const linkOverlayProps: LinkOverlayProps = {\n ...metaAttribute({ name: CARD_LINK_OVERLAY_ID }),\n ...makeAccessible({ label: accessibilityLabel, pressed: isSelected }),\n onFocus: () => {\n setIsFocused(true);\n },\n onBlur: () => {\n setIsFocused(false);\n },\n };\n const defaultRel = target && target === '_blank' ? 'noreferrer noopener' : undefined;\n\n return (\n <CardProvider>\n <CardRoot\n as={as}\n display={'block' as never}\n borderRadius=\"medium\"\n onMouseEnter={onHover as never}\n shouldScaleOnHover={shouldScaleOnHover}\n isSelected={isSelected}\n isFocused={isFocused}\n // on react native we need to pass onClick to root, because we don't need the LinkOverlay in RN\n onClick={isReactNative() ? onClick : undefined}\n width={width}\n height={height}\n minHeight={minHeight}\n minWidth={minWidth}\n href={href}\n accessibilityLabel={accessibilityLabel}\n {...metaAttribute({ name: MetaConstants.Card, testID })}\n {...getStyledProps(styledProps)}\n >\n <CardSurface\n height={height}\n minHeight={minHeight}\n padding={padding}\n borderRadius={borderRadius}\n elevation={elevation}\n textAlign={'left' as never}\n backgroundColor={backgroundColor}\n >\n {href ? (\n <LinkOverlay\n onClick={onClick}\n href={href}\n target={target}\n rel={rel ?? defaultRel}\n {...linkOverlayProps}\n />\n ) : null}\n {!href && onClick ? (\n <LinkOverlay as=\"button\" onClick={onClick} {...linkOverlayProps} />\n ) : null}\n {children}\n </CardSurface>\n </CardRoot>\n </CardProvider>\n );\n};\n\ntype CardBodyProps = {\n children: React.ReactNode;\n height?: BoxProps['height'];\n} & TestID;\n\nconst _CardBody = ({ height, children, testID }: CardBodyProps): React.ReactElement => {\n useVerifyInsideCard('CardBody');\n\n return (\n <BaseBox {...metaAttribute({ name: MetaConstants.CardBody, testID })} height={height}>\n {children}\n </BaseBox>\n );\n};\n\nconst CardBody = assignWithoutSideEffects(_CardBody, { componentId: ComponentIds.CardBody });\n\nexport { Card, CardBody };\n"],"names":["ComponentIds","CardHeader","CardHeaderTrailing","CardHeaderLeading","CardFooter","CardFooterTrailing","CardFooterLeading","CardBody","CardHeaderIcon","CardHeaderCounter","CardHeaderBadge","CardHeaderAmount","CardHeaderText","CardHeaderLink","CardHeaderIconButton","Card","_ref","children","_ref$backgroundColor","backgroundColor","_ref$borderRadius","borderRadius","_ref$elevation","elevation","testID","_ref$padding","padding","width","height","minHeight","minWidth","onClick","_ref$isSelected","isSelected","accessibilityLabel","_ref$shouldScaleOnHov","shouldScaleOnHover","onHover","href","target","rel","as","styledProps","_objectWithoutProperties","_excluded","_React$useState","React","useState","_React$useState2","_slicedToArray","isFocused","setIsFocused","useVerifyAllowedChildren","componentName","allowedComponents","linkOverlayProps","_objectSpread","metaAttribute","name","CARD_LINK_OVERLAY_ID","makeAccessible","label","pressed","onFocus","onBlur","defaultRel","undefined","_jsx","CardProvider","CardRoot","display","onMouseEnter","isReactNative","MetaConstants","getStyledProps","_jsxs","CardSurface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