@metamask-previews/design-system-react-native 0.11.0-preview.645f8b0 → 0.11.0-preview.96aaa54

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 (196) hide show
  1. package/dist/components/AvatarAccount/AvatarAccount.cjs +4 -3
  2. package/dist/components/AvatarAccount/AvatarAccount.cjs.map +1 -1
  3. package/dist/components/AvatarAccount/AvatarAccount.constants.cjs +9 -1
  4. package/dist/components/AvatarAccount/AvatarAccount.constants.cjs.map +1 -1
  5. package/dist/components/AvatarAccount/AvatarAccount.constants.d.cts +2 -0
  6. package/dist/components/AvatarAccount/AvatarAccount.constants.d.cts.map +1 -1
  7. package/dist/components/AvatarAccount/AvatarAccount.constants.d.mts +2 -0
  8. package/dist/components/AvatarAccount/AvatarAccount.constants.d.mts.map +1 -1
  9. package/dist/components/AvatarAccount/AvatarAccount.constants.mjs +8 -0
  10. package/dist/components/AvatarAccount/AvatarAccount.constants.mjs.map +1 -1
  11. package/dist/components/AvatarAccount/AvatarAccount.d.cts.map +1 -1
  12. package/dist/components/AvatarAccount/AvatarAccount.d.mts.map +1 -1
  13. package/dist/components/AvatarAccount/AvatarAccount.mjs +4 -3
  14. package/dist/components/AvatarAccount/AvatarAccount.mjs.map +1 -1
  15. package/dist/components/AvatarBase/AvatarBase.cjs +3 -3
  16. package/dist/components/AvatarBase/AvatarBase.cjs.map +1 -1
  17. package/dist/components/AvatarBase/AvatarBase.constants.cjs +21 -21
  18. package/dist/components/AvatarBase/AvatarBase.constants.cjs.map +1 -1
  19. package/dist/components/AvatarBase/AvatarBase.constants.d.cts +1 -1
  20. package/dist/components/AvatarBase/AvatarBase.constants.d.cts.map +1 -1
  21. package/dist/components/AvatarBase/AvatarBase.constants.d.mts +1 -1
  22. package/dist/components/AvatarBase/AvatarBase.constants.d.mts.map +1 -1
  23. package/dist/components/AvatarBase/AvatarBase.constants.mjs +1 -1
  24. package/dist/components/AvatarBase/AvatarBase.constants.mjs.map +1 -1
  25. package/dist/components/AvatarBase/AvatarBase.d.cts.map +1 -1
  26. package/dist/components/AvatarBase/AvatarBase.d.mts.map +1 -1
  27. package/dist/components/AvatarBase/AvatarBase.mjs +1 -1
  28. package/dist/components/AvatarBase/AvatarBase.mjs.map +1 -1
  29. package/dist/components/AvatarBase/AvatarBase.types.cjs.map +1 -1
  30. package/dist/components/AvatarBase/AvatarBase.types.d.cts +3 -39
  31. package/dist/components/AvatarBase/AvatarBase.types.d.cts.map +1 -1
  32. package/dist/components/AvatarBase/AvatarBase.types.d.mts +3 -39
  33. package/dist/components/AvatarBase/AvatarBase.types.d.mts.map +1 -1
  34. package/dist/components/AvatarBase/AvatarBase.types.mjs.map +1 -1
  35. package/dist/components/AvatarBase/index.cjs +3 -3
  36. package/dist/components/AvatarBase/index.cjs.map +1 -1
  37. package/dist/components/AvatarBase/index.d.cts +1 -1
  38. package/dist/components/AvatarBase/index.d.cts.map +1 -1
  39. package/dist/components/AvatarBase/index.d.mts +1 -1
  40. package/dist/components/AvatarBase/index.d.mts.map +1 -1
  41. package/dist/components/AvatarBase/index.mjs +1 -1
  42. package/dist/components/AvatarBase/index.mjs.map +1 -1
  43. package/dist/components/AvatarNetwork/AvatarNetwork.types.cjs.map +1 -1
  44. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts +7 -9
  45. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts.map +1 -1
  46. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts +7 -9
  47. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts.map +1 -1
  48. package/dist/components/AvatarNetwork/AvatarNetwork.types.mjs.map +1 -1
  49. package/dist/components/Icon/assets/candlestick.svg +1 -1
  50. package/dist/components/Input/Input.cjs +4 -3
  51. package/dist/components/Input/Input.cjs.map +1 -1
  52. package/dist/components/Input/Input.constants.cjs +69 -0
  53. package/dist/components/Input/Input.constants.cjs.map +1 -0
  54. package/dist/components/Input/Input.constants.d.cts +11 -0
  55. package/dist/components/Input/Input.constants.d.cts.map +1 -0
  56. package/dist/components/Input/Input.constants.d.mts +11 -0
  57. package/dist/components/Input/Input.constants.d.mts.map +1 -0
  58. package/dist/components/Input/Input.constants.mjs +66 -0
  59. package/dist/components/Input/Input.constants.mjs.map +1 -0
  60. package/dist/components/Input/Input.d.cts.map +1 -1
  61. package/dist/components/Input/Input.d.mts.map +1 -1
  62. package/dist/components/Input/Input.mjs +4 -3
  63. package/dist/components/Input/Input.mjs.map +1 -1
  64. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs +33 -0
  65. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs.map +1 -0
  66. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts +14 -0
  67. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts.map +1 -0
  68. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts +14 -0
  69. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts.map +1 -0
  70. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs +35 -0
  71. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs.map +1 -0
  72. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs +39 -0
  73. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs.map +1 -0
  74. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts +25 -0
  75. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts.map +1 -0
  76. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts +25 -0
  77. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts.map +1 -0
  78. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs +41 -0
  79. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs.map +1 -0
  80. package/dist/components/KeyValueRow/KeyValueRow.cjs +76 -0
  81. package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -0
  82. package/dist/components/KeyValueRow/KeyValueRow.d.cts +25 -0
  83. package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -0
  84. package/dist/components/KeyValueRow/KeyValueRow.d.mts +25 -0
  85. package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -0
  86. package/dist/components/KeyValueRow/KeyValueRow.mjs +77 -0
  87. package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -0
  88. package/dist/components/KeyValueRow/KeyValueRow.types.cjs +29 -0
  89. package/dist/components/KeyValueRow/KeyValueRow.types.cjs.map +1 -0
  90. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts +177 -0
  91. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts.map +1 -0
  92. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts +177 -0
  93. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts.map +1 -0
  94. package/dist/components/KeyValueRow/KeyValueRow.types.mjs +26 -0
  95. package/dist/components/KeyValueRow/KeyValueRow.types.mjs.map +1 -0
  96. package/dist/components/KeyValueRow/KeyValueRow.utils.cjs +6 -0
  97. package/dist/components/KeyValueRow/KeyValueRow.utils.cjs.map +1 -0
  98. package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts +3 -0
  99. package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts.map +1 -0
  100. package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts +3 -0
  101. package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts.map +1 -0
  102. package/dist/components/KeyValueRow/KeyValueRow.utils.mjs +2 -0
  103. package/dist/components/KeyValueRow/KeyValueRow.utils.mjs.map +1 -0
  104. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs +29 -0
  105. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs.map +1 -0
  106. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts +17 -0
  107. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts.map +1 -0
  108. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts +17 -0
  109. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts.map +1 -0
  110. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs +31 -0
  111. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs.map +1 -0
  112. package/dist/components/KeyValueRow/index.cjs +15 -0
  113. package/dist/components/KeyValueRow/index.cjs.map +1 -0
  114. package/dist/components/KeyValueRow/index.d.cts +3 -0
  115. package/dist/components/KeyValueRow/index.d.cts.map +1 -0
  116. package/dist/components/KeyValueRow/index.d.mts +3 -0
  117. package/dist/components/KeyValueRow/index.d.mts.map +1 -0
  118. package/dist/components/KeyValueRow/index.mjs +3 -0
  119. package/dist/components/KeyValueRow/index.mjs.map +1 -0
  120. package/dist/components/TextButton/TextButton.cjs +12 -36
  121. package/dist/components/TextButton/TextButton.cjs.map +1 -1
  122. package/dist/components/TextButton/TextButton.d.cts.map +1 -1
  123. package/dist/components/TextButton/TextButton.d.mts.map +1 -1
  124. package/dist/components/TextButton/TextButton.mjs +14 -38
  125. package/dist/components/TextButton/TextButton.mjs.map +1 -1
  126. package/dist/components/TextButton/TextButton.types.cjs.map +1 -1
  127. package/dist/components/TextButton/TextButton.types.d.cts +8 -60
  128. package/dist/components/TextButton/TextButton.types.d.cts.map +1 -1
  129. package/dist/components/TextButton/TextButton.types.d.mts +8 -60
  130. package/dist/components/TextButton/TextButton.types.d.mts.map +1 -1
  131. package/dist/components/TextButton/TextButton.types.mjs.map +1 -1
  132. package/dist/components/TextButton/index.cjs +1 -3
  133. package/dist/components/TextButton/index.cjs.map +1 -1
  134. package/dist/components/TextButton/index.d.cts +0 -1
  135. package/dist/components/TextButton/index.d.cts.map +1 -1
  136. package/dist/components/TextButton/index.d.mts +0 -1
  137. package/dist/components/TextButton/index.d.mts.map +1 -1
  138. package/dist/components/TextButton/index.mjs +0 -1
  139. package/dist/components/TextButton/index.mjs.map +1 -1
  140. package/dist/components/TextField/TextField.cjs +22 -8
  141. package/dist/components/TextField/TextField.cjs.map +1 -1
  142. package/dist/components/TextField/TextField.d.cts +0 -2
  143. package/dist/components/TextField/TextField.d.cts.map +1 -1
  144. package/dist/components/TextField/TextField.d.mts +0 -2
  145. package/dist/components/TextField/TextField.d.mts.map +1 -1
  146. package/dist/components/TextField/TextField.mjs +22 -8
  147. package/dist/components/TextField/TextField.mjs.map +1 -1
  148. package/dist/components/TextField/TextField.types.cjs +0 -10
  149. package/dist/components/TextField/TextField.types.cjs.map +1 -1
  150. package/dist/components/TextField/TextField.types.d.cts +0 -14
  151. package/dist/components/TextField/TextField.types.d.cts.map +1 -1
  152. package/dist/components/TextField/TextField.types.d.mts +0 -14
  153. package/dist/components/TextField/TextField.types.d.mts.map +1 -1
  154. package/dist/components/TextField/TextField.types.mjs +1 -9
  155. package/dist/components/TextField/TextField.types.mjs.map +1 -1
  156. package/dist/components/TextField/index.cjs +1 -3
  157. package/dist/components/TextField/index.cjs.map +1 -1
  158. package/dist/components/TextField/index.d.cts +0 -1
  159. package/dist/components/TextField/index.d.cts.map +1 -1
  160. package/dist/components/TextField/index.d.mts +0 -1
  161. package/dist/components/TextField/index.d.mts.map +1 -1
  162. package/dist/components/TextField/index.mjs +0 -1
  163. package/dist/components/TextField/index.mjs.map +1 -1
  164. package/dist/components/index.cjs +1 -3
  165. package/dist/components/index.cjs.map +1 -1
  166. package/dist/components/index.d.cts +2 -2
  167. package/dist/components/index.d.cts.map +1 -1
  168. package/dist/components/index.d.mts +2 -2
  169. package/dist/components/index.d.mts.map +1 -1
  170. package/dist/components/index.mjs +2 -2
  171. package/dist/components/index.mjs.map +1 -1
  172. package/dist/types/index.cjs +18 -51
  173. package/dist/types/index.cjs.map +1 -1
  174. package/dist/types/index.d.cts +8 -55
  175. package/dist/types/index.d.cts.map +1 -1
  176. package/dist/types/index.d.mts +8 -55
  177. package/dist/types/index.d.mts.map +1 -1
  178. package/dist/types/index.mjs +8 -58
  179. package/dist/types/index.mjs.map +1 -1
  180. package/package.json +4 -5
  181. package/dist/components/TextButton/TextButton.constants.cjs +0 -12
  182. package/dist/components/TextButton/TextButton.constants.cjs.map +0 -1
  183. package/dist/components/TextButton/TextButton.constants.d.cts +0 -4
  184. package/dist/components/TextButton/TextButton.constants.d.cts.map +0 -1
  185. package/dist/components/TextButton/TextButton.constants.d.mts +0 -4
  186. package/dist/components/TextButton/TextButton.constants.d.mts.map +0 -1
  187. package/dist/components/TextButton/TextButton.constants.mjs +0 -9
  188. package/dist/components/TextButton/TextButton.constants.mjs.map +0 -1
  189. package/dist/components/TextField/TextField.constants.cjs +0 -13
  190. package/dist/components/TextField/TextField.constants.cjs.map +0 -1
  191. package/dist/components/TextField/TextField.constants.d.cts +0 -6
  192. package/dist/components/TextField/TextField.constants.d.cts.map +0 -1
  193. package/dist/components/TextField/TextField.constants.d.mts +0 -6
  194. package/dist/components/TextField/TextField.constants.d.mts.map +0 -1
  195. package/dist/components/TextField/TextField.constants.mjs +0 -10
  196. package/dist/components/TextField/TextField.constants.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,WAAW,EAAE,cAAc;;AAC3C,OAAO,EAAE,SAAS,EAAE,8BAAqB;AAEzC,OAAO,EAAE,cAAc,EAAE,8BAAoB;AAC7C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,0BAAgB;AACzC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,0BAAgB;AAE3C,OAAO,EAAE,+BAA+B,EAAE,mCAA+B;AAGzE,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EACpD,QAAQ,EACR,IAAI,GAAG,cAAc,CAAC,MAAM,EAC5B,SA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S,CACb;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useCallback } from 'react';\nimport { Pressable } from 'react-native';\n\nimport { TextButtonSize } from '../../types';\nimport { Icon, IconSize } from '../Icon';\nimport { Text, FontWeight } from '../Text';\n\nimport { MAP_TEXTBUTTON_SIZE_TEXTVARIANT } from './TextButton.constants';\nimport type { TextButtonProps } from './TextButton.types';\n\nexport const TextButton: React.FC<TextButtonProps> = ({\n children,\n size = TextButtonSize.BodyMd,\n textProps,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n isDisabled = false,\n isInverse = false,\n twClassName = '',\n accessibilityRole,\n accessibilityLabel,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n /**\n * Calculating the baselineOffset. This baselineOffset is needed to make sure\n * the TextButton aligns perfectly when placed within Text elements\n */\n // eslint-disable-next-line tailwindcss/no-custom-classname\n const { fontSize, lineHeight } = tw`text-${\n MAP_TEXTBUTTON_SIZE_TEXTVARIANT[size] as string\n }` as {\n fontSize: number;\n lineHeight: number;\n };\n const baselineOffset = (lineHeight - fontSize) / 2;\n\n const getTextColor = useCallback(\n (pressed: boolean): string => {\n if (isInverse) {\n return 'text-primary-inverse';\n }\n return pressed ? 'text-primary-default-pressed' : 'text-primary-default';\n },\n [isInverse],\n );\n\n const getTextDecoration = useCallback(\n (pressed: boolean): string =>\n isInverse || pressed ? 'underline' : 'no-underline',\n [isInverse],\n );\n\n return (\n <Text>\n <Pressable\n accessibilityRole={accessibilityRole ?? 'button'}\n accessibilityLabel={accessibilityLabel}\n disabled={isDisabled}\n style={({ pressed }) => [\n { transform: [{ translateY: baselineOffset }] },\n tw`flex-row items-center ${pressed ? 'bg-pressed' : 'bg-transparent'} ${isDisabled ? 'opacity-50' : 'opacity-100'} ${twClassName}`,\n style,\n ]}\n {...props}\n >\n {({ pressed }) => (\n <>\n {startIconName ? (\n <Icon\n name={startIconName}\n size={IconSize.Sm}\n testID=\"start-icon\"\n twClassName={`${getTextColor(pressed)} mr-1`}\n {...startIconProps}\n />\n ) : (\n startAccessory\n )}\n\n <Text\n variant={MAP_TEXTBUTTON_SIZE_TEXTVARIANT[size]}\n fontWeight={FontWeight.Medium}\n {...textProps}\n twClassName={` ${getTextColor(pressed)} ${getTextDecoration(pressed)} ${textProps?.twClassName ?? ''} `}\n >\n {children}\n </Text>\n\n {endIconName ? (\n <Icon\n name={endIconName}\n size={IconSize.Sm}\n testID=\"end-icon\"\n twClassName={`${getTextColor(pressed)} ml-1`}\n {...endIconProps}\n />\n ) : (\n endAccessory\n )}\n </>\n )}\n </Pressable>\n </Text>\n );\n};\n"]}
1
+ {"version":3,"file":"TextButton.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,QAAQ,EAAE,cAAc;;AAExC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,8BAAoB;AACrD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,0BAAgB;AAI3C,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EACpD,QAAQ,EACR,OAAO,GAAG,WAAW,CAAC,MAAM,EAC5B,UAAU,GAAG,UAAU,CAAC,MAAM,EAC9B,WAAW,EACX,iBAAiB,GAAG,MAAM,EAC1B,OAAO,EACP,SAAS,EACT,UAAU,EACV,oBAAoB,GAAG,IAAI,EAC3B,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,MAAM,aAAa,GAA8C,CAAC,CAAC,EAAE,EAAE;QACrE,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC;IAEF,MAAM,cAAc,GAA+C,CAAC,CAAC,EAAE,EAAE;QACvE,UAAU,CAAC,KAAK,CAAC,CAAC;QAClB,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,IAAI,CACH,IAAI,IAAI,CAAC,CACT,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,KAAK,CAAC,CACJ,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc,CACrE,CACD,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,SAAS,CAAC,CAAC,aAAa,CAAC,CACzB,UAAU,CAAC,CAAC,cAAc,CAAC,CAC3B,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAE3C;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React, { useState } from 'react';\n\nimport { TextVariant, TextColor } from '../../types';\nimport { Text, FontWeight } from '../Text';\n\nimport type { TextButtonProps } from './TextButton.types';\n\nexport const TextButton: React.FC<TextButtonProps> = ({\n children,\n variant = TextVariant.BodyMd,\n fontWeight = FontWeight.Medium,\n twClassName,\n accessibilityRole = 'link',\n onPress,\n onPressIn,\n onPressOut,\n suppressHighlighting = true,\n ...rest\n}) => {\n const [pressed, setPressed] = useState(false);\n\n const handlePressIn: NonNullable<TextButtonProps['onPressIn']> = (e) => {\n setPressed(true);\n onPressIn?.(e);\n };\n\n const handlePressOut: NonNullable<TextButtonProps['onPressOut']> = (e) => {\n setPressed(false);\n onPressOut?.(e);\n };\n\n return (\n <Text\n {...rest}\n accessibilityRole={accessibilityRole}\n variant={variant}\n fontWeight={fontWeight}\n color={\n pressed ? TextColor.PrimaryDefaultPressed : TextColor.PrimaryDefault\n }\n twClassName={twClassName}\n onPress={onPress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n suppressHighlighting={suppressHighlighting}\n >\n {children}\n </Text>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.types.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { PressableProps, StyleProp, ViewStyle } from 'react-native';\n\nimport type { TextButtonSize } from '../../types';\nimport type { IconProps, IconName } from '../Icon';\nimport type { TextProps } from '../Text';\n\n/**\n * TextButton component props.\n */\nexport type TextButtonProps = {\n /**\n * Required prop for the content to be rendered within the TextButton\n */\n children: string;\n /**\n * Optional prop to control the size of the TextButton\n *\n * @default TextButtonSize.BodyMd\n */\n size?: TextButtonSize;\n /**\n * Optional props to be passed to the Text component when children is a string\n */\n textProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional prop to specify an icon to show at the start of the button\n */\n startIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the start icon\n */\n startIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the start of the button\n */\n startAccessory?: React.ReactNode;\n /**\n * Optional prop to specify an icon to show at the end of the button\n */\n endIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n endIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the end of the button\n */\n endAccessory?: React.ReactNode;\n /**\n * Optional prop that when true, disables the button\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Optional prop to show the inverse state of the button, which is reserved for buttons on colored backgrounds.\n *\n * @default false\n */\n isInverse?: boolean;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n} & Omit<PressableProps, 'disabled'>;\n"]}
1
+ {"version":3,"file":"TextButton.types.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextProps } from '../Text';\n\n/**\n * Props for `TextButton`, a text-only control for links and inline actions.\n * Extends {@link Text} props.\n */\nexport type TextButtonProps = Omit<\n TextProps,\n 'children' | 'color' | 'onPress'\n> & {\n /**\n * Content shown as the label.\n */\n children: React.ReactNode;\n /**\n * Called when the user presses the label. Primary interaction for this control.\n */\n onPress?: TextProps['onPress'];\n};\n"]}
@@ -1,68 +1,16 @@
1
- import type { PressableProps, StyleProp, ViewStyle } from "react-native/index.js";
2
- import type { TextButtonSize } from "../../types/index.cjs";
3
- import type { IconProps, IconName } from "../Icon/index.cjs";
4
1
  import type { TextProps } from "../Text/index.cjs";
5
2
  /**
6
- * TextButton component props.
3
+ * Props for `TextButton`, a text-only control for links and inline actions.
4
+ * Extends {@link Text} props.
7
5
  */
8
- export type TextButtonProps = {
6
+ export type TextButtonProps = Omit<TextProps, 'children' | 'color' | 'onPress'> & {
9
7
  /**
10
- * Required prop for the content to be rendered within the TextButton
8
+ * Content shown as the label.
11
9
  */
12
- children: string;
10
+ children: React.ReactNode;
13
11
  /**
14
- * Optional prop to control the size of the TextButton
15
- *
16
- * @default TextButtonSize.BodyMd
12
+ * Called when the user presses the label. Primary interaction for this control.
17
13
  */
18
- size?: TextButtonSize;
19
- /**
20
- * Optional props to be passed to the Text component when children is a string
21
- */
22
- textProps?: Omit<Partial<TextProps>, 'children'>;
23
- /**
24
- * Optional prop to specify an icon to show at the start of the button
25
- */
26
- startIconName?: IconName;
27
- /**
28
- * Optional prop to pass additional properties to the start icon
29
- */
30
- startIconProps?: Partial<IconProps>;
31
- /**
32
- * Optional prop for a custom element to show at the start of the button
33
- */
34
- startAccessory?: React.ReactNode;
35
- /**
36
- * Optional prop to specify an icon to show at the end of the button
37
- */
38
- endIconName?: IconName;
39
- /**
40
- * Optional prop to pass additional properties to the end icon
41
- */
42
- endIconProps?: Partial<IconProps>;
43
- /**
44
- * Optional prop for a custom element to show at the end of the button
45
- */
46
- endAccessory?: React.ReactNode;
47
- /**
48
- * Optional prop that when true, disables the button
49
- *
50
- * @default false
51
- */
52
- isDisabled?: boolean;
53
- /**
54
- * Optional prop to show the inverse state of the button, which is reserved for buttons on colored backgrounds.
55
- *
56
- * @default false
57
- */
58
- isInverse?: boolean;
59
- /**
60
- * Optional prop to add twrnc overriding classNames.
61
- */
62
- twClassName?: string;
63
- /**
64
- * Optional prop to control the style.
65
- */
66
- style?: StyleProp<ViewStyle>;
67
- } & Omit<PressableProps, 'disabled'>;
14
+ onPress?: TextProps['onPress'];
15
+ };
68
16
  //# sourceMappingURL=TextButton.types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.types.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEzE,OAAO,KAAK,EAAE,cAAc,EAAE,8BAAoB;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,0BAAgB;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACjD;;OAEG;IACH,aAAa,CAAC,EAAE,QAAQ,CAAC;IACzB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC;;OAEG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAClC;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"TextButton.types.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,SAAS,EACT,UAAU,GAAG,OAAO,GAAG,SAAS,CACjC,GAAG;IACF;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAChC,CAAC"}
@@ -1,68 +1,16 @@
1
- import type { PressableProps, StyleProp, ViewStyle } from "react-native/index.js";
2
- import type { TextButtonSize } from "../../types/index.mjs";
3
- import type { IconProps, IconName } from "../Icon/index.mjs";
4
1
  import type { TextProps } from "../Text/index.mjs";
5
2
  /**
6
- * TextButton component props.
3
+ * Props for `TextButton`, a text-only control for links and inline actions.
4
+ * Extends {@link Text} props.
7
5
  */
8
- export type TextButtonProps = {
6
+ export type TextButtonProps = Omit<TextProps, 'children' | 'color' | 'onPress'> & {
9
7
  /**
10
- * Required prop for the content to be rendered within the TextButton
8
+ * Content shown as the label.
11
9
  */
12
- children: string;
10
+ children: React.ReactNode;
13
11
  /**
14
- * Optional prop to control the size of the TextButton
15
- *
16
- * @default TextButtonSize.BodyMd
12
+ * Called when the user presses the label. Primary interaction for this control.
17
13
  */
18
- size?: TextButtonSize;
19
- /**
20
- * Optional props to be passed to the Text component when children is a string
21
- */
22
- textProps?: Omit<Partial<TextProps>, 'children'>;
23
- /**
24
- * Optional prop to specify an icon to show at the start of the button
25
- */
26
- startIconName?: IconName;
27
- /**
28
- * Optional prop to pass additional properties to the start icon
29
- */
30
- startIconProps?: Partial<IconProps>;
31
- /**
32
- * Optional prop for a custom element to show at the start of the button
33
- */
34
- startAccessory?: React.ReactNode;
35
- /**
36
- * Optional prop to specify an icon to show at the end of the button
37
- */
38
- endIconName?: IconName;
39
- /**
40
- * Optional prop to pass additional properties to the end icon
41
- */
42
- endIconProps?: Partial<IconProps>;
43
- /**
44
- * Optional prop for a custom element to show at the end of the button
45
- */
46
- endAccessory?: React.ReactNode;
47
- /**
48
- * Optional prop that when true, disables the button
49
- *
50
- * @default false
51
- */
52
- isDisabled?: boolean;
53
- /**
54
- * Optional prop to show the inverse state of the button, which is reserved for buttons on colored backgrounds.
55
- *
56
- * @default false
57
- */
58
- isInverse?: boolean;
59
- /**
60
- * Optional prop to add twrnc overriding classNames.
61
- */
62
- twClassName?: string;
63
- /**
64
- * Optional prop to control the style.
65
- */
66
- style?: StyleProp<ViewStyle>;
67
- } & Omit<PressableProps, 'disabled'>;
14
+ onPress?: TextProps['onPress'];
15
+ };
68
16
  //# sourceMappingURL=TextButton.types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.types.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEzE,OAAO,KAAK,EAAE,cAAc,EAAE,8BAAoB;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,0BAAgB;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACjD;;OAEG;IACH,aAAa,CAAC,EAAE,QAAQ,CAAC;IACzB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC;;OAEG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAClC;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"TextButton.types.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,SAAS,EACT,UAAU,GAAG,OAAO,GAAG,SAAS,CACjC,GAAG;IACF;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAChC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TextButton.types.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { PressableProps, StyleProp, ViewStyle } from 'react-native';\n\nimport type { TextButtonSize } from '../../types';\nimport type { IconProps, IconName } from '../Icon';\nimport type { TextProps } from '../Text';\n\n/**\n * TextButton component props.\n */\nexport type TextButtonProps = {\n /**\n * Required prop for the content to be rendered within the TextButton\n */\n children: string;\n /**\n * Optional prop to control the size of the TextButton\n *\n * @default TextButtonSize.BodyMd\n */\n size?: TextButtonSize;\n /**\n * Optional props to be passed to the Text component when children is a string\n */\n textProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional prop to specify an icon to show at the start of the button\n */\n startIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the start icon\n */\n startIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the start of the button\n */\n startAccessory?: React.ReactNode;\n /**\n * Optional prop to specify an icon to show at the end of the button\n */\n endIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n endIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the end of the button\n */\n endAccessory?: React.ReactNode;\n /**\n * Optional prop that when true, disables the button\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Optional prop to show the inverse state of the button, which is reserved for buttons on colored backgrounds.\n *\n * @default false\n */\n isInverse?: boolean;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n} & Omit<PressableProps, 'disabled'>;\n"]}
1
+ {"version":3,"file":"TextButton.types.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextProps } from '../Text';\n\n/**\n * Props for `TextButton`, a text-only control for links and inline actions.\n * Extends {@link Text} props.\n */\nexport type TextButtonProps = Omit<\n TextProps,\n 'children' | 'color' | 'onPress'\n> & {\n /**\n * Content shown as the label.\n */\n children: React.ReactNode;\n /**\n * Called when the user presses the label. Primary interaction for this control.\n */\n onPress?: TextProps['onPress'];\n};\n"]}
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TextButton = exports.TextButtonSize = void 0;
4
- var types_1 = require("../../types/index.cjs");
5
- Object.defineProperty(exports, "TextButtonSize", { enumerable: true, get: function () { return types_1.TextButtonSize; } });
3
+ exports.TextButton = void 0;
6
4
  var TextButton_1 = require("./TextButton.cjs");
7
5
  Object.defineProperty(exports, "TextButton", { enumerable: true, get: function () { return TextButton_1.TextButton; } });
8
6
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAApC,uGAAA,cAAc,OAAA;AACvB,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export { TextButtonSize } from '../../types';\nexport { TextButton } from './TextButton';\nexport type { TextButtonProps } from './TextButton.types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export { TextButton } from './TextButton';\nexport type { TextButtonProps } from './TextButton.types';\n"]}
@@ -1,4 +1,3 @@
1
- export { TextButtonSize } from "../../types/index.cjs";
2
1
  export { TextButton } from "./TextButton.cjs";
3
2
  export type { TextButtonProps } from "./TextButton.types.cjs";
4
3
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,8BAAoB;AAC7C,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
@@ -1,4 +1,3 @@
1
- export { TextButtonSize } from "../../types/index.mjs";
2
1
  export { TextButton } from "./TextButton.mjs";
3
2
  export type { TextButtonProps } from "./TextButton.types.mjs";
4
3
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,8BAAoB;AAC7C,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
@@ -1,3 +1,2 @@
1
- export { TextButtonSize } from "../../types/index.mjs";
2
1
  export { TextButton } from "./TextButton.mjs";
3
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,8BAAoB;AAC7C,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export { TextButtonSize } from '../../types';\nexport { TextButton } from './TextButton';\nexport type { TextButtonProps } from './TextButton.types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export { TextButton } from './TextButton';\nexport type { TextButtonProps } from './TextButton.types';\n"]}
@@ -6,14 +6,25 @@ const react_1 = require("react");
6
6
  const react_native_1 = require("react-native/index.js");
7
7
  const types_1 = require("../../types/index.cjs");
8
8
  const Input_1 = require("../Input/index.cjs");
9
- const TextField_constants_1 = require("./TextField.constants.cjs");
10
- const TextField_types_1 = require("./TextField.types.cjs");
11
- exports.TextField = (0, react_1.forwardRef)(({ style, size = TextField_types_1.TextFieldSize.Md, startAccessory, endAccessory, isError = false, inputElement, isDisabled = false, autoFocus = false, twClassName, onBlur, onFocus, testID, ...props }, ref) => {
9
+ function getContainerBorderColorClass(isDisabled, isFocused, isError) {
10
+ if (isDisabled) {
11
+ return 'border-muted';
12
+ }
13
+ if (isError) {
14
+ return 'border-error-default';
15
+ }
16
+ if (isFocused) {
17
+ return 'border-default';
18
+ }
19
+ return 'border-muted';
20
+ }
21
+ exports.TextField = (0, react_1.forwardRef)(({ style, startAccessory, endAccessory, isError = false, inputElement, isDisabled = false, autoFocus = false, twClassName, onBlur, onFocus, testID, ...props }, ref) => {
12
22
  const [isFocused, setIsFocused] = (0, react_1.useState)(autoFocus);
13
23
  const inputRef = (0, react_1.useRef)(null);
14
24
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
15
25
  (0, react_1.useImperativeHandle)(ref, () => inputRef.current, []);
16
- const containerStyle = (0, react_1.useMemo)(() => tw.style('flex-row', 'items-center', 'rounded-lg', TextField_constants_1.TWCLASSMAP_TEXTFIELD_SIZE[size], 'border', 'px-4', 'bg-default', 'border-default', isError && 'border-error-default', !isDisabled && isFocused && 'border-primary-default', isDisabled && 'opacity-50', twClassName), [size, isError, isFocused, isDisabled, twClassName, tw]);
26
+ const borderColorClass = getContainerBorderColorClass(isDisabled, isFocused, isError);
27
+ const containerStyle = (0, react_1.useMemo)(() => tw.style('flex-row', 'items-center', 'gap-3', 'rounded-lg', 'h-12', 'border', borderColorClass, 'px-4', 'bg-muted', isDisabled && 'opacity-50', twClassName), [borderColorClass, isDisabled, twClassName, tw]);
17
28
  const onBlurHandler = (0, react_1.useCallback)((e) => {
18
29
  if (!isDisabled) {
19
30
  setIsFocused(false);
@@ -32,11 +43,14 @@ exports.TextField = (0, react_1.forwardRef)(({ style, size = TextField_types_1.T
32
43
  }
33
44
  }, [isDisabled]);
34
45
  return (<react_native_1.Pressable testID={testID} style={[containerStyle, style]} onPress={onPressHandler} accessible={false}>
35
- {startAccessory && (<react_native_1.View style={tw.style('mr-2')}>{startAccessory}</react_native_1.View>)}
36
- <react_native_1.View style={tw.style('flex-1')}>
37
- {inputElement ?? (<Input_1.Input {...props} ref={inputRef} textVariant={types_1.TextVariant.BodyMd} isDisabled={isDisabled} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler} isStateStylesDisabled twClassName="bg-transparent border-0"/>)}
46
+ {startAccessory}
47
+ <react_native_1.View style={tw.style('min-h-0 flex-1 justify-center')}>
48
+ {inputElement ?? (<Input_1.Input {...props} ref={inputRef} textVariant={types_1.TextVariant.BodyMd} isDisabled={isDisabled} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler} isStateStylesDisabled
49
+ // Row is `h-12` (48px) with `border` on the Pressable (1px top + bottom). Inner TextInput
50
+ // uses 46px height so the field matches a 48px-tall control without vertical overflow.
51
+ twClassName="h-[46px] bg-transparent border-0" numberOfLines={1} multiline={false}/>)}
38
52
  </react_native_1.View>
39
- {endAccessory && <react_native_1.View style={tw.style('ml-2')}>{endAccessory}</react_native_1.View>}
53
+ {endAccessory}
40
54
  </react_native_1.Pressable>);
41
55
  });
42
56
  //# sourceMappingURL=TextField.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.cjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":";;;AAAA,8FAA4E;AAC5E,iCAOe;AACf,wDAA0D;AAE1D,iDAA0C;AAC1C,8CAAiC;AAEjC,mEAAkE;AAClE,2DAAkD;AAGrC,QAAA,SAAS,GAAG,IAAA,kBAAU,EACjC,CACE,EACE,KAAK,EACL,IAAI,GAAG,+BAAa,CAAC,EAAE,EACvB,cAAc,EACd,YAAY,EACZ,OAAO,GAAG,KAAK,EACf,YAAY,EACZ,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,WAAW,EACX,MA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AAS,CAAC,CACb,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Pressable, TextInput, View } from 'react-native';\n\nimport { TextVariant } from '../../types';\nimport { Input } from '../Input';\n\nimport { TWCLASSMAP_TEXTFIELD_SIZE } from './TextField.constants';\nimport { TextFieldSize } from './TextField.types';\nimport type { TextFieldProps } from './TextField.types';\n\nexport const TextField = forwardRef<TextInput, TextFieldProps>(\n (\n {\n style,\n size = TextFieldSize.Md,\n startAccessory,\n endAccessory,\n isError = false,\n inputElement,\n isDisabled = false,\n autoFocus = false,\n twClassName,\n onBlur,\n onFocus,\n testID,\n ...props\n },\n ref,\n ) => {\n const [isFocused, setIsFocused] = useState(autoFocus);\n const inputRef = useRef<TextInput>(null);\n const tw = useTailwind();\n\n useImperativeHandle<TextInput | null, TextInput | null>(\n ref,\n () => inputRef.current,\n [],\n );\n\n const containerStyle = useMemo(\n () =>\n tw.style(\n 'flex-row',\n 'items-center',\n 'rounded-lg',\n TWCLASSMAP_TEXTFIELD_SIZE[size],\n 'border',\n 'px-4',\n 'bg-default',\n 'border-default',\n isError && 'border-error-default',\n !isDisabled && isFocused && 'border-primary-default',\n isDisabled && 'opacity-50',\n twClassName,\n ),\n [size, isError, isFocused, isDisabled, twClassName, tw],\n );\n\n const onBlurHandler = useCallback(\n (e: Parameters<NonNullable<TextFieldProps['onBlur']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(false);\n onBlur?.(e);\n }\n },\n [isDisabled, onBlur],\n );\n\n const onFocusHandler = useCallback(\n (e: Parameters<NonNullable<TextFieldProps['onFocus']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(true);\n onFocus?.(e);\n }\n },\n [isDisabled, onFocus],\n );\n\n const onPressHandler = useCallback(() => {\n if (!isDisabled && inputRef.current) {\n inputRef.current.focus();\n }\n }, [isDisabled]);\n\n return (\n <Pressable\n testID={testID}\n style={[containerStyle, style]}\n onPress={onPressHandler}\n accessible={false}\n >\n {startAccessory && (\n <View style={tw.style('mr-2')}>{startAccessory}</View>\n )}\n <View style={tw.style('flex-1')}>\n {inputElement ?? (\n <Input\n {...props}\n ref={inputRef}\n textVariant={TextVariant.BodyMd}\n isDisabled={isDisabled}\n autoFocus={autoFocus}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n isStateStylesDisabled\n twClassName=\"bg-transparent border-0\"\n />\n )}\n </View>\n {endAccessory && <View style={tw.style('ml-2')}>{endAccessory}</View>}\n </Pressable>\n );\n },\n);\n"]}
1
+ {"version":3,"file":"TextField.cjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":";;;AAAA,8FAA4E;AAC5E,iCAOe;AACf,wDAA0D;AAE1D,iDAA0C;AAC1C,8CAAiC;AAIjC,SAAS,4BAA4B,CACnC,UAAmB,EACnB,SAAkB,EAClB,OAAgB;IAEhB,IAAI,UAAU,EAAE;QACd,OAAO,cAAc,CAAC;KACvB;IACD,IAAI,OAAO,EAAE;QACX,OAAO,sBAAsB,CAAC;KAC/B;IACD,IAAI,SAAS,EAAE;QACb,OAAO,gBAAgB,CAAC;KACzB;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAEY,QAAA,SAAS,GAAG,IAAA,kBAAU,EACjC,CACE,EACE,KAAK,EACL,cAAc,EACd,YAAY,EACZ,OAAO,GAAG,KAAK,EACf,YAAY,EACZ,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,KAAK,EACjB,WAAW,EACX,MAAM,EACN,OAAO,EACP,MAAM,EACN,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,SAAS,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAY,IAAI,CAAC,CAAC;IACzC,MAAM,E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AAS,CACR,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC,CAC/B,OAAO,CAAC,CAAC,cAAc,CAAC,CACxB,UAAU,CAAC,CAAC,KAAK,CAAC,CAElB;QAAA,CAAC,cAAc,CACf;QAAA,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC,CACrD;UAAA,CAAC,YAAY,IAAI,CACf,CAAC,aAAK,CACJ,IAAI,KAAK,CAAC,CACV,GAAG,CAAC,CAAC,QAAQ,CAAC,CACd,WAAW,CAAC,CAAC,mBAAW,CAAC,MAAM,CAAC,CAChC,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,MAAM,CAAC,CAAC,aAAa,CAAC,CACtB,OAAO,CAAC,CAAC,cAAc,CAAC,CACxB,qBAAqB;QACrB,0FAA0F;QAC1F,uFAAuF;QACvF,WAAW,CAAC,kCAAkC,CAC9C,aAAa,CAAC,CAAC,CAAC,CAAC,CACjB,SAAS,CAAC,CAAC,KAAK,CAAC,EACjB,CACH,CACH;QAAA,EAAE,mBAAI,CACN;QAAA,CAAC,YAAY,CACf;MAAA,EAAE,wBAAS,CAAC,CACb,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Pressable, TextInput, View } from 'react-native';\n\nimport { TextVariant } from '../../types';\nimport { Input } from '../Input';\n\nimport type { TextFieldProps } from './TextField.types';\n\nfunction getContainerBorderColorClass(\n isDisabled: boolean,\n isFocused: boolean,\n isError: boolean,\n): string {\n if (isDisabled) {\n return 'border-muted';\n }\n if (isError) {\n return 'border-error-default';\n }\n if (isFocused) {\n return 'border-default';\n }\n return 'border-muted';\n}\n\nexport const TextField = forwardRef<TextInput, TextFieldProps>(\n (\n {\n style,\n startAccessory,\n endAccessory,\n isError = false,\n inputElement,\n isDisabled = false,\n autoFocus = false,\n twClassName,\n onBlur,\n onFocus,\n testID,\n ...props\n },\n ref,\n ) => {\n const [isFocused, setIsFocused] = useState(autoFocus);\n const inputRef = useRef<TextInput>(null);\n const tw = useTailwind();\n\n useImperativeHandle<TextInput | null, TextInput | null>(\n ref,\n () => inputRef.current,\n [],\n );\n\n const borderColorClass = getContainerBorderColorClass(\n isDisabled,\n isFocused,\n isError,\n );\n\n const containerStyle = useMemo(\n () =>\n tw.style(\n 'flex-row',\n 'items-center',\n 'gap-3',\n 'rounded-lg',\n 'h-12',\n 'border',\n borderColorClass,\n 'px-4',\n 'bg-muted',\n isDisabled && 'opacity-50',\n twClassName,\n ),\n [borderColorClass, isDisabled, twClassName, tw],\n );\n\n const onBlurHandler = useCallback(\n (e: Parameters<NonNullable<TextFieldProps['onBlur']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(false);\n onBlur?.(e);\n }\n },\n [isDisabled, onBlur],\n );\n\n const onFocusHandler = useCallback(\n (e: Parameters<NonNullable<TextFieldProps['onFocus']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(true);\n onFocus?.(e);\n }\n },\n [isDisabled, onFocus],\n );\n\n const onPressHandler = useCallback(() => {\n if (!isDisabled && inputRef.current) {\n inputRef.current.focus();\n }\n }, [isDisabled]);\n\n return (\n <Pressable\n testID={testID}\n style={[containerStyle, style]}\n onPress={onPressHandler}\n accessible={false}\n >\n {startAccessory}\n <View style={tw.style('min-h-0 flex-1 justify-center')}>\n {inputElement ?? (\n <Input\n {...props}\n ref={inputRef}\n textVariant={TextVariant.BodyMd}\n isDisabled={isDisabled}\n autoFocus={autoFocus}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n isStateStylesDisabled\n // Row is `h-12` (48px) with `border` on the Pressable (1px top + bottom). Inner TextInput\n // uses 46px height so the field matches a 48px-tall control without vertical overflow.\n twClassName=\"h-[46px] bg-transparent border-0\"\n numberOfLines={1}\n multiline={false}\n />\n )}\n </View>\n {endAccessory}\n </Pressable>\n );\n },\n);\n"]}
@@ -1,7 +1,5 @@
1
1
  import { TextInput } from "react-native/index.js";
2
- import { TextFieldSize } from "./TextField.types.cjs";
3
2
  export declare const TextField: import("react").ForwardRefExoticComponent<Omit<import("../Input/index.cjs").InputProps, "style" | "textVariant" | "isStateStylesDisabled"> & {
4
- size?: TextFieldSize | undefined;
5
3
  startAccessory?: import("react").ReactNode;
6
4
  endAccessory?: import("react").ReactNode;
7
5
  isError?: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.d.cts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AASA,OAAO,EAAa,SAAS,EAAQ,8BAAqB;AAM1D,OAAO,EAAE,aAAa,EAAE,8BAA0B;AAGlD,eAAO,MAAM,SAAS;;;;;;;;6CAuGrB,CAAC"}
1
+ {"version":3,"file":"TextField.d.cts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AASA,OAAO,EAAa,SAAS,EAAQ,8BAAqB;AAwB1D,eAAO,MAAM,SAAS;;;;;;;6CA6GrB,CAAC"}
@@ -1,7 +1,5 @@
1
1
  import { TextInput } from "react-native/index.js";
2
- import { TextFieldSize } from "./TextField.types.mjs";
3
2
  export declare const TextField: import("react").ForwardRefExoticComponent<Omit<import("../Input/index.mjs").InputProps, "style" | "textVariant" | "isStateStylesDisabled"> & {
4
- size?: TextFieldSize | undefined;
5
3
  startAccessory?: import("react").ReactNode;
6
4
  endAccessory?: import("react").ReactNode;
7
5
  isError?: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.d.mts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AASA,OAAO,EAAa,SAAS,EAAQ,8BAAqB;AAM1D,OAAO,EAAE,aAAa,EAAE,8BAA0B;AAGlD,eAAO,MAAM,SAAS;;;;;;;;6CAuGrB,CAAC"}
1
+ {"version":3,"file":"TextField.d.mts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AASA,OAAO,EAAa,SAAS,EAAQ,8BAAqB;AAwB1D,eAAO,MAAM,SAAS;;;;;;;6CA6GrB,CAAC"}
@@ -3,14 +3,25 @@ import { forwardRef, useCallback, useImperativeHandle, useMemo, useRef, useState
3
3
  import { Pressable, TextInput, View } from "react-native/index.js";
4
4
  import { TextVariant } from "../../types/index.mjs";
5
5
  import { Input } from "../Input/index.mjs";
6
- import { TWCLASSMAP_TEXTFIELD_SIZE } from "./TextField.constants.mjs";
7
- import { TextFieldSize } from "./TextField.types.mjs";
8
- export const TextField = forwardRef(({ style, size = TextFieldSize.Md, startAccessory, endAccessory, isError = false, inputElement, isDisabled = false, autoFocus = false, twClassName, onBlur, onFocus, testID, ...props }, ref) => {
6
+ function getContainerBorderColorClass(isDisabled, isFocused, isError) {
7
+ if (isDisabled) {
8
+ return 'border-muted';
9
+ }
10
+ if (isError) {
11
+ return 'border-error-default';
12
+ }
13
+ if (isFocused) {
14
+ return 'border-default';
15
+ }
16
+ return 'border-muted';
17
+ }
18
+ export const TextField = forwardRef(({ style, startAccessory, endAccessory, isError = false, inputElement, isDisabled = false, autoFocus = false, twClassName, onBlur, onFocus, testID, ...props }, ref) => {
9
19
  const [isFocused, setIsFocused] = useState(autoFocus);
10
20
  const inputRef = useRef(null);
11
21
  const tw = useTailwind();
12
22
  useImperativeHandle(ref, () => inputRef.current, []);
13
- const containerStyle = useMemo(() => tw.style('flex-row', 'items-center', 'rounded-lg', TWCLASSMAP_TEXTFIELD_SIZE[size], 'border', 'px-4', 'bg-default', 'border-default', isError && 'border-error-default', !isDisabled && isFocused && 'border-primary-default', isDisabled && 'opacity-50', twClassName), [size, isError, isFocused, isDisabled, twClassName, tw]);
23
+ const borderColorClass = getContainerBorderColorClass(isDisabled, isFocused, isError);
24
+ const containerStyle = useMemo(() => tw.style('flex-row', 'items-center', 'gap-3', 'rounded-lg', 'h-12', 'border', borderColorClass, 'px-4', 'bg-muted', isDisabled && 'opacity-50', twClassName), [borderColorClass, isDisabled, twClassName, tw]);
14
25
  const onBlurHandler = useCallback((e) => {
15
26
  if (!isDisabled) {
16
27
  setIsFocused(false);
@@ -29,11 +40,14 @@ export const TextField = forwardRef(({ style, size = TextFieldSize.Md, startAcce
29
40
  }
30
41
  }, [isDisabled]);
31
42
  return (<Pressable testID={testID} style={[containerStyle, style]} onPress={onPressHandler} accessible={false}>
32
- {startAccessory && (<View style={tw.style('mr-2')}>{startAccessory}</View>)}
33
- <View style={tw.style('flex-1')}>
34
- {inputElement ?? (<Input {...props} ref={inputRef} textVariant={TextVariant.BodyMd} isDisabled={isDisabled} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler} isStateStylesDisabled twClassName="bg-transparent border-0"/>)}
43
+ {startAccessory}
44
+ <View style={tw.style('min-h-0 flex-1 justify-center')}>
45
+ {inputElement ?? (<Input {...props} ref={inputRef} textVariant={TextVariant.BodyMd} isDisabled={isDisabled} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler} isStateStylesDisabled
46
+ // Row is `h-12` (48px) with `border` on the Pressable (1px top + bottom). Inner TextInput
47
+ // uses 46px height so the field matches a 48px-tall control without vertical overflow.
48
+ twClassName="h-[46px] bg-transparent border-0" numberOfLines={1} multiline={false}/>)}
35
49
  </View>
36
- {endAccessory && <View style={tw.style('ml-2')}>{endAccessory}</View>}
50
+ {endAccessory}
37
51
  </Pressable>);
38
52
  });
39
53
  //# sourceMappingURL=TextField.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.mjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,EACL,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN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,MAAM,CAAC,CAChC,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,MAAM,CAAC,CAAC,aAAa,CAAC,CACtB,OAAO,CAAC,CAAC,cAAc,CAAC,CACxB,qBAAqB,CACrB,WAAW,CAAC,yBAAyB,EACrC,CACH,CACH;QAAA,EAAE,IAAI,CACN;QAAA,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,CACvE;MAAA,EAAE,SAAS,CAAC,CACb,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Pressable, TextInput, View } from 'react-native';\n\nimport { TextVariant } from '../../types';\nimport { Input } from '../Input';\n\nimport { TWCLASSMAP_TEXTFIELD_SIZE } from './TextField.constants';\nimport { TextFieldSize } from './TextField.types';\nimport type { TextFieldProps } from './TextField.types';\n\nexport const TextField = forwardRef<TextInput, TextFieldProps>(\n (\n {\n style,\n size = TextFieldSize.Md,\n startAccessory,\n endAccessory,\n isError = false,\n inputElement,\n isDisabled = false,\n autoFocus = false,\n twClassName,\n onBlur,\n onFocus,\n testID,\n ...props\n },\n ref,\n ) => {\n const [isFocused, setIsFocused] = useState(autoFocus);\n const inputRef = useRef<TextInput>(null);\n const tw = useTailwind();\n\n useImperativeHandle<TextInput | null, TextInput | null>(\n ref,\n () => inputRef.current,\n [],\n );\n\n const containerStyle = useMemo(\n () =>\n tw.style(\n 'flex-row',\n 'items-center',\n 'rounded-lg',\n TWCLASSMAP_TEXTFIELD_SIZE[size],\n 'border',\n 'px-4',\n 'bg-default',\n 'border-default',\n isError && 'border-error-default',\n !isDisabled && isFocused && 'border-primary-default',\n isDisabled && 'opacity-50',\n twClassName,\n ),\n [size, isError, isFocused, isDisabled, twClassName, tw],\n );\n\n const onBlurHandler = useCallback(\n (e: Parameters<NonNullable<TextFieldProps['onBlur']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(false);\n onBlur?.(e);\n }\n },\n [isDisabled, onBlur],\n );\n\n const onFocusHandler = useCallback(\n (e: Parameters<NonNullable<TextFieldProps['onFocus']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(true);\n onFocus?.(e);\n }\n },\n [isDisabled, onFocus],\n );\n\n const onPressHandler = useCallback(() => {\n if (!isDisabled && inputRef.current) {\n inputRef.current.focus();\n }\n }, [isDisabled]);\n\n return (\n <Pressable\n testID={testID}\n style={[containerStyle, style]}\n onPress={onPressHandler}\n accessible={false}\n >\n {startAccessory && (\n <View style={tw.style('mr-2')}>{startAccessory}</View>\n )}\n <View style={tw.style('flex-1')}>\n {inputElement ?? (\n <Input\n {...props}\n ref={inputRef}\n textVariant={TextVariant.BodyMd}\n isDisabled={isDisabled}\n autoFocus={autoFocus}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n isStateStylesDisabled\n twClassName=\"bg-transparent border-0\"\n />\n )}\n </View>\n {endAccessory && <View style={tw.style('ml-2')}>{endAccessory}</View>}\n </Pressable>\n );\n },\n);\n"]}
1
+ {"version":3,"file":"TextField.mjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,EACL,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,EACT,cAAc;AACf,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,8BAAqB;AAE1D,OAAO,EAAE,WAAW,EAAE,8BAAoB;AAC1C,OAAO,EAAE,KAAK,EAAE,2BAAiB;AAIjC,SAAS,4BAA4B,CACnC,UAAmB,EACnB,SAAkB,EAClB,OAAgB;IAEhB,IAAI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C,CAAC,CACjB,SAAS,CAAC,CAAC,KAAK,CAAC,EACjB,CACH,CACH;QAAA,EAAE,IAAI,CACN;QAAA,CAAC,YAAY,CACf;MAAA,EAAE,SAAS,CAAC,CACb,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Pressable, TextInput, View } from 'react-native';\n\nimport { TextVariant } from '../../types';\nimport { Input } from '../Input';\n\nimport type { TextFieldProps } from './TextField.types';\n\nfunction getContainerBorderColorClass(\n isDisabled: boolean,\n isFocused: boolean,\n isError: boolean,\n): string {\n if (isDisabled) {\n return 'border-muted';\n }\n if (isError) {\n return 'border-error-default';\n }\n if (isFocused) {\n return 'border-default';\n }\n return 'border-muted';\n}\n\nexport const TextField = forwardRef<TextInput, TextFieldProps>(\n (\n {\n style,\n startAccessory,\n endAccessory,\n isError = false,\n inputElement,\n isDisabled = false,\n autoFocus = false,\n twClassName,\n onBlur,\n onFocus,\n testID,\n ...props\n },\n ref,\n ) => {\n const [isFocused, setIsFocused] = useState(autoFocus);\n const inputRef = useRef<TextInput>(null);\n const tw = useTailwind();\n\n useImperativeHandle<TextInput | null, TextInput | null>(\n ref,\n () => inputRef.current,\n [],\n );\n\n const borderColorClass = getContainerBorderColorClass(\n isDisabled,\n isFocused,\n isError,\n );\n\n const containerStyle = useMemo(\n () =>\n tw.style(\n 'flex-row',\n 'items-center',\n 'gap-3',\n 'rounded-lg',\n 'h-12',\n 'border',\n borderColorClass,\n 'px-4',\n 'bg-muted',\n isDisabled && 'opacity-50',\n twClassName,\n ),\n [borderColorClass, isDisabled, twClassName, tw],\n );\n\n const onBlurHandler = useCallback(\n (e: Parameters<NonNullable<TextFieldProps['onBlur']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(false);\n onBlur?.(e);\n }\n },\n [isDisabled, onBlur],\n );\n\n const onFocusHandler = useCallback(\n (e: Parameters<NonNullable<TextFieldProps['onFocus']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(true);\n onFocus?.(e);\n }\n },\n [isDisabled, onFocus],\n );\n\n const onPressHandler = useCallback(() => {\n if (!isDisabled && inputRef.current) {\n inputRef.current.focus();\n }\n }, [isDisabled]);\n\n return (\n <Pressable\n testID={testID}\n style={[containerStyle, style]}\n onPress={onPressHandler}\n accessible={false}\n >\n {startAccessory}\n <View style={tw.style('min-h-0 flex-1 justify-center')}>\n {inputElement ?? (\n <Input\n {...props}\n ref={inputRef}\n textVariant={TextVariant.BodyMd}\n isDisabled={isDisabled}\n autoFocus={autoFocus}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n isStateStylesDisabled\n // Row is `h-12` (48px) with `border` on the Pressable (1px top + bottom). Inner TextInput\n // uses 46px height so the field matches a 48px-tall control without vertical overflow.\n twClassName=\"h-[46px] bg-transparent border-0\"\n numberOfLines={1}\n multiline={false}\n />\n )}\n </View>\n {endAccessory}\n </Pressable>\n );\n },\n);\n"]}
@@ -1,13 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TextFieldSize = void 0;
4
- /**
5
- * TextFieldSize enum.
6
- */
7
- var TextFieldSize;
8
- (function (TextFieldSize) {
9
- TextFieldSize["Sm"] = "sm";
10
- TextFieldSize["Md"] = "md";
11
- TextFieldSize["Lg"] = "lg";
12
- })(TextFieldSize || (exports.TextFieldSize = TextFieldSize = {}));
13
3
  //# sourceMappingURL=TextField.types.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.types.cjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":";;;AAKA;;GAEG;AACH,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,0BAAS,CAAA;IACT,0BAAS,CAAA;IACT,0BAAS,CAAA;AACX,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB","sourcesContent":["import type { ReactNode } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport type { InputProps } from '../Input/Input.types';\n\n/**\n * TextFieldSize enum.\n */\nexport enum TextFieldSize {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n}\n\n/**\n * TextField component props.\n */\nexport type TextFieldProps = Omit<\n InputProps,\n 'textVariant' | 'isStateStylesDisabled' | 'style'\n> & {\n /**\n * Optional prop for size of the TextField.\n *\n * @default TextFieldSize.Md\n */\n size?: TextFieldSize;\n /**\n * Optional content to display before the Input.\n */\n startAccessory?: ReactNode;\n /**\n * Optional content to display after the Input.\n */\n endAccessory?: ReactNode;\n /**\n * Optional boolean to show the error state.\n *\n * @default false\n */\n isError?: boolean;\n /**\n * Optional prop to replace the default Input with a custom element.\n */\n inputElement?: ReactNode;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to customize the container style.\n */\n style?: StyleProp<ViewStyle>;\n};\n"]}
1
+ {"version":3,"file":"TextField.types.cjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport type { InputProps } from '../Input/Input.types';\n\n/**\n * TextField component props.\n */\nexport type TextFieldProps = Omit<\n InputProps,\n 'textVariant' | 'isStateStylesDisabled' | 'style'\n> & {\n /**\n * Optional content to display before the Input.\n */\n startAccessory?: ReactNode;\n /**\n * Optional content to display after the Input.\n */\n endAccessory?: ReactNode;\n /**\n * Optional boolean to show the error state.\n *\n * @default false\n */\n isError?: boolean;\n /**\n * Optional prop to replace the default Input with a custom element.\n */\n inputElement?: ReactNode;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to customize the container style.\n */\n style?: StyleProp<ViewStyle>;\n};\n"]}
@@ -1,24 +1,10 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { StyleProp, ViewStyle } from "react-native/index.js";
3
3
  import type { InputProps } from "../Input/Input.types.cjs";
4
- /**
5
- * TextFieldSize enum.
6
- */
7
- export declare enum TextFieldSize {
8
- Sm = "sm",
9
- Md = "md",
10
- Lg = "lg"
11
- }
12
4
  /**
13
5
  * TextField component props.
14
6
  */
15
7
  export type TextFieldProps = Omit<InputProps, 'textVariant' | 'isStateStylesDisabled' | 'style'> & {
16
- /**
17
- * Optional prop for size of the TextField.
18
- *
19
- * @default TextFieldSize.Md
20
- */
21
- size?: TextFieldSize;
22
8
  /**
23
9
  * Optional content to display before the Input.
24
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.types.d.cts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,iCAA6B;AAEvD;;GAEG;AACH,oBAAY,aAAa;IACvB,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;CACV;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,UAAU,EACV,aAAa,GAAG,uBAAuB,GAAG,OAAO,CAClD,GAAG;IACF;;;;OAIG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
1
+ {"version":3,"file":"TextField.types.d.cts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,iCAA6B;AAEvD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,UAAU,EACV,aAAa,GAAG,uBAAuB,GAAG,OAAO,CAClD,GAAG;IACF;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
@@ -1,24 +1,10 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { StyleProp, ViewStyle } from "react-native/index.js";
3
3
  import type { InputProps } from "../Input/Input.types.mjs";
4
- /**
5
- * TextFieldSize enum.
6
- */
7
- export declare enum TextFieldSize {
8
- Sm = "sm",
9
- Md = "md",
10
- Lg = "lg"
11
- }
12
4
  /**
13
5
  * TextField component props.
14
6
  */
15
7
  export type TextFieldProps = Omit<InputProps, 'textVariant' | 'isStateStylesDisabled' | 'style'> & {
16
- /**
17
- * Optional prop for size of the TextField.
18
- *
19
- * @default TextFieldSize.Md
20
- */
21
- size?: TextFieldSize;
22
8
  /**
23
9
  * Optional content to display before the Input.
24
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.types.d.mts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,iCAA6B;AAEvD;;GAEG;AACH,oBAAY,aAAa;IACvB,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;CACV;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,UAAU,EACV,aAAa,GAAG,uBAAuB,GAAG,OAAO,CAClD,GAAG;IACF;;;;OAIG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
1
+ {"version":3,"file":"TextField.types.d.mts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,iCAA6B;AAEvD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,UAAU,EACV,aAAa,GAAG,uBAAuB,GAAG,OAAO,CAClD,GAAG;IACF;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
@@ -1,10 +1,2 @@
1
- /**
2
- * TextFieldSize enum.
3
- */
4
- export var TextFieldSize;
5
- (function (TextFieldSize) {
6
- TextFieldSize["Sm"] = "sm";
7
- TextFieldSize["Md"] = "md";
8
- TextFieldSize["Lg"] = "lg";
9
- })(TextFieldSize || (TextFieldSize = {}));
1
+ export {};
10
2
  //# sourceMappingURL=TextField.types.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.types.mjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,0BAAS,CAAA;IACT,0BAAS,CAAA;IACT,0BAAS,CAAA;AACX,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB","sourcesContent":["import type { ReactNode } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport type { InputProps } from '../Input/Input.types';\n\n/**\n * TextFieldSize enum.\n */\nexport enum TextFieldSize {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n}\n\n/**\n * TextField component props.\n */\nexport type TextFieldProps = Omit<\n InputProps,\n 'textVariant' | 'isStateStylesDisabled' | 'style'\n> & {\n /**\n * Optional prop for size of the TextField.\n *\n * @default TextFieldSize.Md\n */\n size?: TextFieldSize;\n /**\n * Optional content to display before the Input.\n */\n startAccessory?: ReactNode;\n /**\n * Optional content to display after the Input.\n */\n endAccessory?: ReactNode;\n /**\n * Optional boolean to show the error state.\n *\n * @default false\n */\n isError?: boolean;\n /**\n * Optional prop to replace the default Input with a custom element.\n */\n inputElement?: ReactNode;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to customize the container style.\n */\n style?: StyleProp<ViewStyle>;\n};\n"]}
1
+ {"version":3,"file":"TextField.types.mjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport type { InputProps } from '../Input/Input.types';\n\n/**\n * TextField component props.\n */\nexport type TextFieldProps = Omit<\n InputProps,\n 'textVariant' | 'isStateStylesDisabled' | 'style'\n> & {\n /**\n * Optional content to display before the Input.\n */\n startAccessory?: ReactNode;\n /**\n * Optional content to display after the Input.\n */\n endAccessory?: ReactNode;\n /**\n * Optional boolean to show the error state.\n *\n * @default false\n */\n isError?: boolean;\n /**\n * Optional prop to replace the default Input with a custom element.\n */\n inputElement?: ReactNode;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to customize the container style.\n */\n style?: StyleProp<ViewStyle>;\n};\n"]}