@audira/carbon-react-native 1.0.0-beta.15 → 1.0.0-beta.17

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 (227) hide show
  1. package/lib/commonjs/_internal/hooks/index.js +10 -0
  2. package/lib/commonjs/_internal/hooks/index.js.map +1 -0
  3. package/lib/commonjs/_internal/hooks/secure-text-entry-control/UseProps.js +2 -0
  4. package/lib/commonjs/_internal/hooks/secure-text-entry-control/UseProps.js.map +1 -0
  5. package/lib/commonjs/_internal/hooks/secure-text-entry-control/index.js +17 -0
  6. package/lib/commonjs/_internal/hooks/secure-text-entry-control/index.js.map +1 -0
  7. package/lib/commonjs/_internal/hooks/secure-text-entry-control/use.js +16 -0
  8. package/lib/commonjs/_internal/hooks/secure-text-entry-control/use.js.map +1 -0
  9. package/lib/commonjs/components/index.js +47 -11
  10. package/lib/commonjs/components/index.js.map +1 -1
  11. package/lib/commonjs/components/password-input/PasswordInput.js +35 -0
  12. package/lib/commonjs/components/password-input/PasswordInput.js.map +1 -0
  13. package/lib/commonjs/components/password-input/PasswordInputProps.js +6 -0
  14. package/lib/commonjs/components/password-input/PasswordInputProps.js.map +1 -0
  15. package/lib/commonjs/components/password-input/PasswordInputRef.js +6 -0
  16. package/lib/commonjs/components/password-input/PasswordInputRef.js.map +1 -0
  17. package/lib/commonjs/components/password-input/index.js +17 -0
  18. package/lib/commonjs/components/password-input/index.js.map +1 -0
  19. package/lib/commonjs/components/password-input-field/PasswordInputField.js +35 -0
  20. package/lib/commonjs/components/password-input-field/PasswordInputField.js.map +1 -0
  21. package/lib/commonjs/components/password-input-field/PasswordInputFieldProps.js +6 -0
  22. package/lib/commonjs/components/password-input-field/PasswordInputFieldProps.js.map +1 -0
  23. package/lib/commonjs/components/password-input-field/PasswordInputFieldRef.js +6 -0
  24. package/lib/commonjs/components/password-input-field/PasswordInputFieldRef.js.map +1 -0
  25. package/lib/commonjs/components/password-input-field/_ghost-icon/GhostIcon.js +40 -0
  26. package/lib/commonjs/components/password-input-field/_ghost-icon/GhostIcon.js.map +1 -0
  27. package/lib/commonjs/components/password-input-field/_ghost-icon/GhostIconProps.js +6 -0
  28. package/lib/commonjs/components/password-input-field/_ghost-icon/GhostIconProps.js.map +1 -0
  29. package/lib/commonjs/components/password-input-field/_ghost-icon/GhostIconRef.js +6 -0
  30. package/lib/commonjs/components/password-input-field/_ghost-icon/GhostIconRef.js.map +1 -0
  31. package/lib/commonjs/components/password-input-field/_ghost-icon/index.js +17 -0
  32. package/lib/commonjs/components/password-input-field/_ghost-icon/index.js.map +1 -0
  33. package/lib/commonjs/components/password-input-field/index.js +17 -0
  34. package/lib/commonjs/components/password-input-field/index.js.map +1 -0
  35. package/lib/commonjs/components/password-input-fluid/PasswordInputFluid.js +33 -0
  36. package/lib/commonjs/components/password-input-fluid/PasswordInputFluid.js.map +1 -0
  37. package/lib/commonjs/components/password-input-fluid/PasswordInputFluidProps.js +6 -0
  38. package/lib/commonjs/components/password-input-fluid/PasswordInputFluidProps.js.map +1 -0
  39. package/lib/commonjs/components/password-input-fluid/PasswordInputFluidRef.js +6 -0
  40. package/lib/commonjs/components/password-input-fluid/PasswordInputFluidRef.js.map +1 -0
  41. package/lib/commonjs/components/password-input-fluid/index.js +17 -0
  42. package/lib/commonjs/components/password-input-fluid/index.js.map +1 -0
  43. package/lib/commonjs/components/text-area/TextArea.js +0 -2
  44. package/lib/commonjs/components/text-area/TextArea.js.map +1 -1
  45. package/lib/commonjs/components/text-input/TextInput.js +4 -0
  46. package/lib/commonjs/components/text-input/TextInput.js.map +1 -1
  47. package/lib/commonjs/components/text-input-fluid/TextInputFluid.js +21 -15
  48. package/lib/commonjs/components/text-input-fluid/TextInputFluid.js.map +1 -1
  49. package/lib/module/_internal/hooks/index.js +5 -0
  50. package/lib/module/_internal/hooks/index.js.map +1 -0
  51. package/lib/module/_internal/hooks/secure-text-entry-control/UseProps.js +2 -0
  52. package/lib/module/_internal/hooks/secure-text-entry-control/UseProps.js.map +1 -0
  53. package/lib/module/_internal/hooks/secure-text-entry-control/index.js +4 -0
  54. package/lib/module/_internal/hooks/secure-text-entry-control/index.js.map +1 -0
  55. package/lib/module/_internal/hooks/secure-text-entry-control/use.js +12 -0
  56. package/lib/module/_internal/hooks/secure-text-entry-control/use.js.map +1 -0
  57. package/lib/module/components/index.js +3 -0
  58. package/lib/module/components/index.js.map +1 -1
  59. package/lib/module/components/password-input/PasswordInput.js +31 -0
  60. package/lib/module/components/password-input/PasswordInput.js.map +1 -0
  61. package/lib/module/components/password-input/PasswordInputProps.js +4 -0
  62. package/lib/module/components/password-input/PasswordInputProps.js.map +1 -0
  63. package/lib/module/components/password-input/PasswordInputRef.js +4 -0
  64. package/lib/module/components/password-input/PasswordInputRef.js.map +1 -0
  65. package/lib/module/components/password-input/index.js +4 -0
  66. package/lib/module/components/password-input/index.js.map +1 -0
  67. package/lib/module/components/password-input-field/PasswordInputField.js +31 -0
  68. package/lib/module/components/password-input-field/PasswordInputField.js.map +1 -0
  69. package/lib/module/components/password-input-field/PasswordInputFieldProps.js +4 -0
  70. package/lib/module/components/password-input-field/PasswordInputFieldProps.js.map +1 -0
  71. package/lib/module/components/password-input-field/PasswordInputFieldRef.js +4 -0
  72. package/lib/module/components/password-input-field/PasswordInputFieldRef.js.map +1 -0
  73. package/lib/module/components/password-input-field/_ghost-icon/GhostIcon.js +35 -0
  74. package/lib/module/components/password-input-field/_ghost-icon/GhostIcon.js.map +1 -0
  75. package/lib/module/components/password-input-field/_ghost-icon/GhostIconProps.js +4 -0
  76. package/lib/module/components/password-input-field/_ghost-icon/GhostIconProps.js.map +1 -0
  77. package/lib/module/components/password-input-field/_ghost-icon/GhostIconRef.js +4 -0
  78. package/lib/module/components/password-input-field/_ghost-icon/GhostIconRef.js.map +1 -0
  79. package/lib/module/components/password-input-field/_ghost-icon/index.js +4 -0
  80. package/lib/module/components/password-input-field/_ghost-icon/index.js.map +1 -0
  81. package/lib/module/components/password-input-field/index.js +4 -0
  82. package/lib/module/components/password-input-field/index.js.map +1 -0
  83. package/lib/module/components/password-input-fluid/PasswordInputFluid.js +29 -0
  84. package/lib/module/components/password-input-fluid/PasswordInputFluid.js.map +1 -0
  85. package/lib/module/components/password-input-fluid/PasswordInputFluidProps.js +4 -0
  86. package/lib/module/components/password-input-fluid/PasswordInputFluidProps.js.map +1 -0
  87. package/lib/module/components/password-input-fluid/PasswordInputFluidRef.js +4 -0
  88. package/lib/module/components/password-input-fluid/PasswordInputFluidRef.js.map +1 -0
  89. package/lib/module/components/password-input-fluid/index.js +4 -0
  90. package/lib/module/components/password-input-fluid/index.js.map +1 -0
  91. package/lib/module/components/text-area/TextArea.js +0 -2
  92. package/lib/module/components/text-area/TextArea.js.map +1 -1
  93. package/lib/module/components/text-input/TextInput.js +4 -0
  94. package/lib/module/components/text-input/TextInput.js.map +1 -1
  95. package/lib/module/components/text-input-fluid/TextInputFluid.js +22 -16
  96. package/lib/module/components/text-input-fluid/TextInputFluid.js.map +1 -1
  97. package/lib/typescript/commonjs/_internal/hooks/index.d.ts +3 -0
  98. package/lib/typescript/commonjs/_internal/hooks/index.d.ts.map +1 -0
  99. package/lib/typescript/commonjs/_internal/hooks/secure-text-entry-control/UseProps.d.ts +5 -0
  100. package/lib/typescript/commonjs/_internal/hooks/secure-text-entry-control/UseProps.d.ts.map +1 -0
  101. package/lib/typescript/commonjs/_internal/hooks/secure-text-entry-control/index.d.ts +3 -0
  102. package/lib/typescript/commonjs/_internal/hooks/secure-text-entry-control/index.d.ts.map +1 -0
  103. package/lib/typescript/commonjs/_internal/hooks/secure-text-entry-control/use.d.ts +3 -0
  104. package/lib/typescript/commonjs/_internal/hooks/secure-text-entry-control/use.d.ts.map +1 -0
  105. package/lib/typescript/commonjs/components/index.d.ts +3 -0
  106. package/lib/typescript/commonjs/components/index.d.ts.map +1 -1
  107. package/lib/typescript/commonjs/components/password-input/PasswordInput.d.ts +4 -0
  108. package/lib/typescript/commonjs/components/password-input/PasswordInput.d.ts.map +1 -0
  109. package/lib/typescript/commonjs/components/password-input/PasswordInputProps.d.ts +4 -0
  110. package/lib/typescript/commonjs/components/password-input/PasswordInputProps.d.ts.map +1 -0
  111. package/lib/typescript/commonjs/components/password-input/PasswordInputRef.d.ts +4 -0
  112. package/lib/typescript/commonjs/components/password-input/PasswordInputRef.d.ts.map +1 -0
  113. package/lib/typescript/commonjs/components/password-input/index.d.ts +4 -0
  114. package/lib/typescript/commonjs/components/password-input/index.d.ts.map +1 -0
  115. package/lib/typescript/commonjs/components/password-input-field/PasswordInputField.d.ts +4 -0
  116. package/lib/typescript/commonjs/components/password-input-field/PasswordInputField.d.ts.map +1 -0
  117. package/lib/typescript/commonjs/components/password-input-field/PasswordInputFieldProps.d.ts +4 -0
  118. package/lib/typescript/commonjs/components/password-input-field/PasswordInputFieldProps.d.ts.map +1 -0
  119. package/lib/typescript/commonjs/components/password-input-field/PasswordInputFieldRef.d.ts +4 -0
  120. package/lib/typescript/commonjs/components/password-input-field/PasswordInputFieldRef.d.ts.map +1 -0
  121. package/lib/typescript/commonjs/components/password-input-field/_ghost-icon/GhostIcon.d.ts +4 -0
  122. package/lib/typescript/commonjs/components/password-input-field/_ghost-icon/GhostIcon.d.ts.map +1 -0
  123. package/lib/typescript/commonjs/components/password-input-field/_ghost-icon/GhostIconProps.d.ts +7 -0
  124. package/lib/typescript/commonjs/components/password-input-field/_ghost-icon/GhostIconProps.d.ts.map +1 -0
  125. package/lib/typescript/commonjs/components/password-input-field/_ghost-icon/GhostIconRef.d.ts +4 -0
  126. package/lib/typescript/commonjs/components/password-input-field/_ghost-icon/GhostIconRef.d.ts.map +1 -0
  127. package/lib/typescript/commonjs/components/password-input-field/_ghost-icon/index.d.ts +4 -0
  128. package/lib/typescript/commonjs/components/password-input-field/_ghost-icon/index.d.ts.map +1 -0
  129. package/lib/typescript/commonjs/components/password-input-field/index.d.ts +4 -0
  130. package/lib/typescript/commonjs/components/password-input-field/index.d.ts.map +1 -0
  131. package/lib/typescript/commonjs/components/password-input-fluid/PasswordInputFluid.d.ts +4 -0
  132. package/lib/typescript/commonjs/components/password-input-fluid/PasswordInputFluid.d.ts.map +1 -0
  133. package/lib/typescript/commonjs/components/password-input-fluid/PasswordInputFluidProps.d.ts +4 -0
  134. package/lib/typescript/commonjs/components/password-input-fluid/PasswordInputFluidProps.d.ts.map +1 -0
  135. package/lib/typescript/commonjs/components/password-input-fluid/PasswordInputFluidRef.d.ts +4 -0
  136. package/lib/typescript/commonjs/components/password-input-fluid/PasswordInputFluidRef.d.ts.map +1 -0
  137. package/lib/typescript/commonjs/components/password-input-fluid/index.d.ts +4 -0
  138. package/lib/typescript/commonjs/components/password-input-fluid/index.d.ts.map +1 -0
  139. package/lib/typescript/commonjs/components/text-area/TextArea.d.ts.map +1 -1
  140. package/lib/typescript/commonjs/components/text-area-field/TextAreaFieldProps.d.ts +1 -1
  141. package/lib/typescript/commonjs/components/text-area-field/TextAreaFieldProps.d.ts.map +1 -1
  142. package/lib/typescript/commonjs/components/text-input/TextInput.d.ts.map +1 -1
  143. package/lib/typescript/commonjs/components/text-input/TextInputProps.d.ts +1 -1
  144. package/lib/typescript/commonjs/components/text-input/TextInputProps.d.ts.map +1 -1
  145. package/lib/typescript/commonjs/components/text-input-fluid/TextInputFluid.d.ts.map +1 -1
  146. package/lib/typescript/commonjs/components/text-input-fluid/TextInputFluidProps.d.ts +1 -1
  147. package/lib/typescript/commonjs/components/text-input-fluid/TextInputFluidProps.d.ts.map +1 -1
  148. package/lib/typescript/module/_internal/hooks/index.d.ts +3 -0
  149. package/lib/typescript/module/_internal/hooks/index.d.ts.map +1 -0
  150. package/lib/typescript/module/_internal/hooks/secure-text-entry-control/UseProps.d.ts +5 -0
  151. package/lib/typescript/module/_internal/hooks/secure-text-entry-control/UseProps.d.ts.map +1 -0
  152. package/lib/typescript/module/_internal/hooks/secure-text-entry-control/index.d.ts +3 -0
  153. package/lib/typescript/module/_internal/hooks/secure-text-entry-control/index.d.ts.map +1 -0
  154. package/lib/typescript/module/_internal/hooks/secure-text-entry-control/use.d.ts +3 -0
  155. package/lib/typescript/module/_internal/hooks/secure-text-entry-control/use.d.ts.map +1 -0
  156. package/lib/typescript/module/components/index.d.ts +3 -0
  157. package/lib/typescript/module/components/index.d.ts.map +1 -1
  158. package/lib/typescript/module/components/password-input/PasswordInput.d.ts +4 -0
  159. package/lib/typescript/module/components/password-input/PasswordInput.d.ts.map +1 -0
  160. package/lib/typescript/module/components/password-input/PasswordInputProps.d.ts +4 -0
  161. package/lib/typescript/module/components/password-input/PasswordInputProps.d.ts.map +1 -0
  162. package/lib/typescript/module/components/password-input/PasswordInputRef.d.ts +4 -0
  163. package/lib/typescript/module/components/password-input/PasswordInputRef.d.ts.map +1 -0
  164. package/lib/typescript/module/components/password-input/index.d.ts +4 -0
  165. package/lib/typescript/module/components/password-input/index.d.ts.map +1 -0
  166. package/lib/typescript/module/components/password-input-field/PasswordInputField.d.ts +4 -0
  167. package/lib/typescript/module/components/password-input-field/PasswordInputField.d.ts.map +1 -0
  168. package/lib/typescript/module/components/password-input-field/PasswordInputFieldProps.d.ts +4 -0
  169. package/lib/typescript/module/components/password-input-field/PasswordInputFieldProps.d.ts.map +1 -0
  170. package/lib/typescript/module/components/password-input-field/PasswordInputFieldRef.d.ts +4 -0
  171. package/lib/typescript/module/components/password-input-field/PasswordInputFieldRef.d.ts.map +1 -0
  172. package/lib/typescript/module/components/password-input-field/_ghost-icon/GhostIcon.d.ts +4 -0
  173. package/lib/typescript/module/components/password-input-field/_ghost-icon/GhostIcon.d.ts.map +1 -0
  174. package/lib/typescript/module/components/password-input-field/_ghost-icon/GhostIconProps.d.ts +7 -0
  175. package/lib/typescript/module/components/password-input-field/_ghost-icon/GhostIconProps.d.ts.map +1 -0
  176. package/lib/typescript/module/components/password-input-field/_ghost-icon/GhostIconRef.d.ts +4 -0
  177. package/lib/typescript/module/components/password-input-field/_ghost-icon/GhostIconRef.d.ts.map +1 -0
  178. package/lib/typescript/module/components/password-input-field/_ghost-icon/index.d.ts +4 -0
  179. package/lib/typescript/module/components/password-input-field/_ghost-icon/index.d.ts.map +1 -0
  180. package/lib/typescript/module/components/password-input-field/index.d.ts +4 -0
  181. package/lib/typescript/module/components/password-input-field/index.d.ts.map +1 -0
  182. package/lib/typescript/module/components/password-input-fluid/PasswordInputFluid.d.ts +4 -0
  183. package/lib/typescript/module/components/password-input-fluid/PasswordInputFluid.d.ts.map +1 -0
  184. package/lib/typescript/module/components/password-input-fluid/PasswordInputFluidProps.d.ts +4 -0
  185. package/lib/typescript/module/components/password-input-fluid/PasswordInputFluidProps.d.ts.map +1 -0
  186. package/lib/typescript/module/components/password-input-fluid/PasswordInputFluidRef.d.ts +4 -0
  187. package/lib/typescript/module/components/password-input-fluid/PasswordInputFluidRef.d.ts.map +1 -0
  188. package/lib/typescript/module/components/password-input-fluid/index.d.ts +4 -0
  189. package/lib/typescript/module/components/password-input-fluid/index.d.ts.map +1 -0
  190. package/lib/typescript/module/components/text-area/TextArea.d.ts.map +1 -1
  191. package/lib/typescript/module/components/text-area-field/TextAreaFieldProps.d.ts +1 -1
  192. package/lib/typescript/module/components/text-area-field/TextAreaFieldProps.d.ts.map +1 -1
  193. package/lib/typescript/module/components/text-input/TextInput.d.ts.map +1 -1
  194. package/lib/typescript/module/components/text-input/TextInputProps.d.ts +1 -1
  195. package/lib/typescript/module/components/text-input/TextInputProps.d.ts.map +1 -1
  196. package/lib/typescript/module/components/text-input-fluid/TextInputFluid.d.ts.map +1 -1
  197. package/lib/typescript/module/components/text-input-fluid/TextInputFluidProps.d.ts +1 -1
  198. package/lib/typescript/module/components/text-input-fluid/TextInputFluidProps.d.ts.map +1 -1
  199. package/lib/typescript/tsconfig.tsbuildinfo +1 -1
  200. package/package.json +1 -1
  201. package/src/_internal/hooks/index.ts +5 -0
  202. package/src/_internal/hooks/secure-text-entry-control/UseProps.ts +4 -0
  203. package/src/_internal/hooks/secure-text-entry-control/index.ts +2 -0
  204. package/src/_internal/hooks/secure-text-entry-control/use.tsx +26 -0
  205. package/src/components/index.tsx +3 -0
  206. package/src/components/password-input/PasswordInput.tsx +61 -0
  207. package/src/components/password-input/PasswordInputProps.ts +6 -0
  208. package/src/components/password-input/PasswordInputRef.ts +6 -0
  209. package/src/components/password-input/index.ts +3 -0
  210. package/src/components/password-input-field/PasswordInputField.tsx +61 -0
  211. package/src/components/password-input-field/PasswordInputFieldProps.ts +6 -0
  212. package/src/components/password-input-field/PasswordInputFieldRef.tsx +6 -0
  213. package/src/components/password-input-field/_ghost-icon/GhostIcon.tsx +71 -0
  214. package/src/components/password-input-field/_ghost-icon/GhostIconProps.ts +12 -0
  215. package/src/components/password-input-field/_ghost-icon/GhostIconRef.ts +6 -0
  216. package/src/components/password-input-field/_ghost-icon/index.ts +3 -0
  217. package/src/components/password-input-field/index.ts +3 -0
  218. package/src/components/password-input-fluid/PasswordInputFluid.tsx +59 -0
  219. package/src/components/password-input-fluid/PasswordInputFluidProps.ts +6 -0
  220. package/src/components/password-input-fluid/PasswordInputFluidRef.ts +6 -0
  221. package/src/components/password-input-fluid/index.ts +3 -0
  222. package/src/components/text-area/TextArea.tsx +0 -2
  223. package/src/components/text-area-field/TextAreaFieldProps.ts +1 -1
  224. package/src/components/text-input/TextInput.tsx +4 -0
  225. package/src/components/text-input/TextInputProps.ts +0 -2
  226. package/src/components/text-input-fluid/TextInputFluid.tsx +10 -6
  227. package/src/components/text-input-fluid/TextInputFluidProps.ts +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@audira/carbon-react-native",
3
- "version": "1.0.0-beta.15",
3
+ "version": "1.0.0-beta.17",
4
4
  "license": "MIT",
5
5
  "homepage": "https://rakadoank.github.io/carbon-react-native",
6
6
  "repository": "https://github.com/RakaDoank/carbon-react-native",
@@ -0,0 +1,5 @@
1
+ import * as SecureTextEntryControlHook from "./secure-text-entry-control"
2
+
3
+ export {
4
+ SecureTextEntryControlHook,
5
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The `secureTextEntry`
3
+ */
4
+ export type UseProps = boolean
@@ -0,0 +1,2 @@
1
+ export type * from "./UseProps"
2
+ export * from "./use"
@@ -0,0 +1,26 @@
1
+ import {
2
+ useCallback,
3
+ useState,
4
+ } from "react"
5
+
6
+ import type {
7
+ UseProps,
8
+ } from "./UseProps"
9
+
10
+ export function use(secureTextEntryProp?: UseProps) {
11
+
12
+ const
13
+ [secureTextEntrySelf, setSecureTextEntrySelf] =
14
+ useState(true),
15
+
16
+ secureTextEntry =
17
+ secureTextEntryProp ?? secureTextEntrySelf,
18
+
19
+ toggleSecureTextEntrySelf =
20
+ useCallback(() => {
21
+ setSecureTextEntrySelf(bool => !bool)
22
+ }, [])
23
+
24
+ return [secureTextEntry, toggleSecureTextEntrySelf] as const
25
+
26
+ }
@@ -22,6 +22,9 @@ export * from "./layer"
22
22
  export * from "./loading"
23
23
  export * from "./modal"
24
24
  export * from "./modal-content"
25
+ export * from "./password-input"
26
+ export * from "./password-input-field"
27
+ export * from "./password-input-fluid"
25
28
  export * from "./radio-button"
26
29
  export * from "./radio-button-group"
27
30
  export * from "./radio-button-input"
@@ -0,0 +1,61 @@
1
+ import {
2
+ forwardRef,
3
+ } from "react"
4
+
5
+ import {
6
+ SecureTextEntryControlHook,
7
+ } from "../../_internal/hooks"
8
+
9
+ import {
10
+ GhostIcon,
11
+ } from "../password-input-field/_ghost-icon"
12
+
13
+ import {
14
+ TextInput,
15
+ } from "../text-input"
16
+
17
+ import type {
18
+ PasswordInputProps,
19
+ } from "./PasswordInputProps"
20
+
21
+ import type {
22
+ PasswordInputRef,
23
+ } from "./PasswordInputRef"
24
+
25
+ export const PasswordInput = forwardRef<PasswordInputRef, PasswordInputProps>(
26
+ function PasswordInput(
27
+ {
28
+ autoComplete = "current-password",
29
+ size = "medium",
30
+ secureTextEntry: secureTextEntryProp,
31
+ blockEndNode,
32
+ ...props
33
+ },
34
+ ref,
35
+ ) {
36
+
37
+ const
38
+ [secureTextEntry, toggleSecureTextEntrySelf] =
39
+ SecureTextEntryControlHook.use(secureTextEntryProp)
40
+
41
+ return (
42
+ <TextInput
43
+ ref={ ref }
44
+ { ...props }
45
+ autoComplete={ autoComplete }
46
+ size={ size }
47
+ secureTextEntry={ secureTextEntry }
48
+ blockEndNode={ (<>
49
+ <GhostIcon
50
+ inputSize={ size }
51
+ secureTextEntry={ secureTextEntry }
52
+ onPress={ toggleSecureTextEntrySelf }
53
+ />
54
+
55
+ { blockEndNode }
56
+ </>) }
57
+ />
58
+ )
59
+
60
+ },
61
+ )
@@ -0,0 +1,6 @@
1
+ import type {
2
+ TextInputProps,
3
+ } from "../text-input/TextInputProps"
4
+
5
+ export interface PasswordInputProps extends TextInputProps {
6
+ }
@@ -0,0 +1,6 @@
1
+ import type {
2
+ TextInputRef,
3
+ } from "../text-input/TextInputRef"
4
+
5
+ export interface PasswordInputRef extends TextInputRef {
6
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./PasswordInput"
2
+ export type * from "./PasswordInputProps"
3
+ export type * from "./PasswordInputRef"
@@ -0,0 +1,61 @@
1
+ import {
2
+ forwardRef,
3
+ } from "react"
4
+
5
+ import {
6
+ SecureTextEntryControlHook,
7
+ } from "../../_internal/hooks"
8
+
9
+ import {
10
+ TextInputField,
11
+ } from "../text-input-field"
12
+
13
+ import type {
14
+ PasswordInputFieldProps,
15
+ } from "./PasswordInputFieldProps"
16
+
17
+ import type {
18
+ PasswordInputFieldRef,
19
+ } from "./PasswordInputFieldRef"
20
+
21
+ import {
22
+ GhostIcon,
23
+ } from "./_ghost-icon"
24
+
25
+ export const PasswordInputField = forwardRef<PasswordInputFieldRef, PasswordInputFieldProps>(
26
+ function PasswordInputField(
27
+ {
28
+ autoComplete = "current-password",
29
+ size = "medium",
30
+ secureTextEntry: secureTextEntryProp,
31
+ blockEndNode,
32
+ ...props
33
+ },
34
+ ref,
35
+ ) {
36
+
37
+ const
38
+ [secureTextEntry, toggleSecureTextEntrySelf] =
39
+ SecureTextEntryControlHook.use(secureTextEntryProp)
40
+
41
+ return (
42
+ <TextInputField
43
+ ref={ ref }
44
+ { ...props }
45
+ autoComplete={ autoComplete }
46
+ size={ size }
47
+ secureTextEntry={ secureTextEntry }
48
+ blockEndNode={ (<>
49
+ <GhostIcon
50
+ inputSize={ size }
51
+ secureTextEntry={ secureTextEntry }
52
+ onPress={ toggleSecureTextEntrySelf }
53
+ />
54
+
55
+ { blockEndNode }
56
+ </>) }
57
+ />
58
+ )
59
+
60
+ },
61
+ )
@@ -0,0 +1,6 @@
1
+ import type {
2
+ TextInputFieldProps,
3
+ } from "../text-input-field/TextInputFieldProps"
4
+
5
+ export interface PasswordInputFieldProps extends TextInputFieldProps {
6
+ }
@@ -0,0 +1,6 @@
1
+ import type {
2
+ TextInputFieldRef,
3
+ } from "../text-input-field/TextInputFieldRef"
4
+
5
+ export interface PasswordInputFieldRef extends TextInputFieldRef {
6
+ }
@@ -0,0 +1,71 @@
1
+ import {
2
+ forwardRef,
3
+ } from "react"
4
+
5
+ import {
6
+ StyleSheet,
7
+ } from "react-native"
8
+
9
+ import IconViewOff from "@carbon/icons/svg/32/view--off.svg"
10
+ import IconView from "@carbon/icons/svg/32/view.svg"
11
+
12
+ import {
13
+ CommonStyleSheet,
14
+ } from "../../../_internal/style-sheets"
15
+
16
+ import {
17
+ GhostIcon as ButtonGhostIcon,
18
+ type GhostIconProps as ButtonGhostIconProps,
19
+ } from "../../button/ghost-icon"
20
+
21
+ import type {
22
+ GhostIconProps,
23
+ } from "./GhostIconProps"
24
+
25
+ import type {
26
+ GhostIconRef,
27
+ } from "./GhostIconRef"
28
+
29
+ export const GhostIcon = forwardRef<GhostIconRef, GhostIconProps>(
30
+ function GhostIcon(
31
+ {
32
+ inputSize,
33
+ secureTextEntry,
34
+ style,
35
+ ...props
36
+ },
37
+ ref,
38
+ ) {
39
+
40
+ return (
41
+ <ButtonGhostIcon
42
+ ref={ ref }
43
+ { ...props }
44
+ size={ mapInputSizeToButtonSize[inputSize] }
45
+ Icon={ secureTextEntry ? IconView : IconViewOff }
46
+ style={ [
47
+ CommonStyleSheet.absolute,
48
+ styleSheet.ghostIcon,
49
+ style,
50
+ ] }
51
+ />
52
+ )
53
+
54
+ },
55
+ )
56
+
57
+ const
58
+ styleSheet =
59
+ StyleSheet.create({
60
+ ghostIcon: {
61
+ top: 0,
62
+ right: 0,
63
+ },
64
+ }),
65
+
66
+ mapInputSizeToButtonSize: Record<GhostIconProps["inputSize"], ButtonGhostIconProps["size"]> =
67
+ {
68
+ small: "small",
69
+ medium: "medium",
70
+ large: "large_productive",
71
+ }
@@ -0,0 +1,12 @@
1
+ import type {
2
+ GhostIconProps as Props,
3
+ } from "../../button/ghost-icon/GhostIconProps"
4
+
5
+ import type {
6
+ PasswordInputFieldProps,
7
+ } from "../PasswordInputFieldProps"
8
+
9
+ export interface GhostIconProps extends Omit<Props, "Icon" | "size"> {
10
+ inputSize: NonNullable<PasswordInputFieldProps["size"]>,
11
+ secureTextEntry: boolean,
12
+ }
@@ -0,0 +1,6 @@
1
+ import type {
2
+ GhostIconRef as Ref,
3
+ } from "../../button/ghost-icon/GhostIconRef"
4
+
5
+ export interface GhostIconRef extends Ref {
6
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./GhostIcon"
2
+ export type * from "./GhostIconProps"
3
+ export type * from "./GhostIconRef"
@@ -0,0 +1,3 @@
1
+ export * from "./PasswordInputField"
2
+ export type * from "./PasswordInputFieldProps"
3
+ export type * from "./PasswordInputFieldRef"
@@ -0,0 +1,59 @@
1
+ import {
2
+ forwardRef,
3
+ } from "react"
4
+
5
+ import {
6
+ SecureTextEntryControlHook,
7
+ } from "../../_internal/hooks"
8
+
9
+ import {
10
+ GhostIcon,
11
+ } from "../password-input-field/_ghost-icon"
12
+
13
+ import {
14
+ TextInputFluid,
15
+ } from "../text-input-fluid"
16
+
17
+ import type {
18
+ PasswordInputFluidProps,
19
+ } from "./PasswordInputFluidProps"
20
+
21
+ import type {
22
+ PasswordInputFluidRef,
23
+ } from "./PasswordInputFluidRef"
24
+
25
+ export const PasswordInputFluid = forwardRef<PasswordInputFluidRef, PasswordInputFluidProps>(
26
+ function PasswordInputFluid(
27
+ {
28
+ autoComplete = "current-password",
29
+ secureTextEntry: secureTextEntryProp,
30
+ blockEndNode,
31
+ ...props
32
+ },
33
+ ref,
34
+ ) {
35
+
36
+ const
37
+ [secureTextEntry, toggleSecureTextEntrySelf] =
38
+ SecureTextEntryControlHook.use(secureTextEntryProp)
39
+
40
+ return (
41
+ <TextInputFluid
42
+ ref={ ref }
43
+ { ...props }
44
+ autoComplete={ autoComplete }
45
+ secureTextEntry={ secureTextEntry }
46
+ blockEndNode={ (<>
47
+ <GhostIcon
48
+ inputSize="medium"
49
+ secureTextEntry={ secureTextEntry }
50
+ onPress={ toggleSecureTextEntrySelf }
51
+ />
52
+
53
+ { blockEndNode }
54
+ </>) }
55
+ />
56
+ )
57
+
58
+ },
59
+ )
@@ -0,0 +1,6 @@
1
+ import type {
2
+ TextInputFluidProps,
3
+ } from "../text-input-fluid/TextInputFluidProps"
4
+
5
+ export interface PasswordInputFluidProps extends TextInputFluidProps {
6
+ }
@@ -0,0 +1,6 @@
1
+ import type {
2
+ TextInputFluidRef,
3
+ } from "../text-input-fluid/TextInputFluidRef"
4
+
5
+ export interface PasswordInputFluidRef extends TextInputFluidRef {
6
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./PasswordInputFluid"
2
+ export type * from "./PasswordInputFluidProps"
3
+ export type * from "./PasswordInputFluidRef"
@@ -83,7 +83,6 @@ export const TextArea = forwardRef<TextAreaRef, TextAreaProps>(
83
83
  readOnly,
84
84
  returnKeyType,
85
85
  enterKeyHint,
86
- secureTextEntry,
87
86
  selectTextOnFocus,
88
87
  selection,
89
88
  selectionColor,
@@ -201,7 +200,6 @@ export const TextArea = forwardRef<TextAreaRef, TextAreaProps>(
201
200
  readOnly={ readOnly }
202
201
  returnKeyType={ returnKeyType }
203
202
  enterKeyHint={ enterKeyHint }
204
- secureTextEntry={ secureTextEntry }
205
203
  selectTextOnFocus={ selectTextOnFocus }
206
204
  selection={ selection }
207
205
  selectionColor={ selectionColor }
@@ -2,5 +2,5 @@ import type {
2
2
  TextInputFieldProps,
3
3
  } from "../text-input-field/TextInputFieldProps"
4
4
 
5
- export interface TextAreaFieldProps extends Omit<TextInputFieldProps, "size" | "multiline"> {
5
+ export interface TextAreaFieldProps extends Omit<TextInputFieldProps, "size" | "multiline" | "secureTextEntry"> {
6
6
  }
@@ -45,6 +45,8 @@ export const TextInput = forwardRef<TextInputRef, TextInputProps>(
45
45
  helperText,
46
46
 
47
47
  // hoist the `TextInputFieldProps`
48
+ blockStartNode,
49
+ blockEndNode,
48
50
  size = "medium",
49
51
  interactiveState = "normal",
50
52
  textInputStyle,
@@ -167,6 +169,8 @@ export const TextInput = forwardRef<TextInputRef, TextInputProps>(
167
169
 
168
170
  <TextInputField
169
171
  ref={ textInputFieldRef }
172
+ blockStartNode={ blockStartNode }
173
+ blockEndNode={ blockEndNode }
170
174
  size={ size }
171
175
  interactiveState={ interactiveState }
172
176
  textInputStyle={ textInputStyle }
@@ -5,8 +5,6 @@ import type {
5
5
  export interface TextInputProps extends Omit<
6
6
  TextInputFieldProps,
7
7
  | "hideInteractiveStateIcon"
8
- | "blockStartNodes"
9
- | "blockEndNodes"
10
8
  > {
11
9
  label: string,
12
10
  helperText?: string,
@@ -55,6 +55,8 @@ export const TextInputFluid = forwardRef<TextInputFluidRef, TextInputFluidProps>
55
55
  interactiveState,
56
56
  style,
57
57
  textInputStyle,
58
+ blockStartNode,
59
+ blockEndNode,
58
60
  ...textInputFieldProps
59
61
  },
60
62
  ref,
@@ -71,14 +73,15 @@ export const TextInputFluid = forwardRef<TextInputFluidRef, TextInputFluidProps>
71
73
  size="medium"
72
74
  interactiveState={ interactiveState }
73
75
  hideInteractiveStateIcon
74
- blockStartNode={
76
+ blockStartNode={ (<>
75
77
  <FormLabel
76
78
  label={ label }
77
79
  style={ styleSheet.label }
78
80
  />
79
- }
80
- blockEndNode={
81
- !!helperText?.length && (
81
+ { blockStartNode }
82
+ </>) }
83
+ blockEndNode={ (<>
84
+ { !!helperText && (
82
85
  <FormHelperText
83
86
  text={ helperText }
84
87
  style={ [
@@ -101,8 +104,9 @@ export const TextInputFluid = forwardRef<TextInputFluidRef, TextInputFluidProps>
101
104
  ) : undefined
102
105
  }
103
106
  />
104
- )
105
- }
107
+ ) }
108
+ { blockEndNode }
109
+ </>) }
106
110
  style={ [
107
111
  styleSheet.textInputFluid,
108
112
  helperText?.length
@@ -6,8 +6,6 @@ export interface TextInputFluidProps extends Omit<
6
6
  TextInputFieldProps,
7
7
  | "size"
8
8
  | "hideInteractiveStateIcon"
9
- | "blockStartNodes"
10
- | "blockEndNodes"
11
9
  > {
12
10
  label: string,
13
11
  helperText?: string,