@sincpro/mobile-ui 3.0.1 → 3.2.0

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 (314) hide show
  1. package/dist/Actions/Actions.Button.d.ts +6 -6
  2. package/dist/Actions/Actions.Button.js +650 -180
  3. package/dist/Actions/Actions.Dock.d.ts +1 -1
  4. package/dist/Actions/Actions.Dock.js +297 -18
  5. package/dist/Actions/Actions.FAB.js +100 -12
  6. package/dist/Actions/Actions.FilterButton.d.ts +17 -0
  7. package/dist/Actions/Actions.FilterButton.js +263 -33
  8. package/dist/Actions/Actions.IconButton.d.ts +1 -0
  9. package/dist/Actions/Actions.IconButton.js +196 -33
  10. package/dist/Actions/index.js +13 -13
  11. package/dist/Dialog/Confirmation.context.js +82 -16
  12. package/dist/Dialog/Dialog.ActionSheet.js +200 -41
  13. package/dist/Dialog/Dialog.Confirmation.js +168 -31
  14. package/dist/Dialog/Dialog.EditValue.js +437 -62
  15. package/dist/Dialog/Dialog.Sheet.d.ts +7 -3
  16. package/dist/Dialog/Dialog.Sheet.js +267 -15
  17. package/dist/Dialog/OverlayHost.d.ts +24 -0
  18. package/dist/Dialog/OverlayHost.js +230 -0
  19. package/dist/Dialog/SheetSurface.d.ts +43 -0
  20. package/dist/Dialog/SheetSurface.js +495 -0
  21. package/dist/Dialog/dialog-actions.d.ts +17 -0
  22. package/dist/Dialog/dialog-actions.js +59 -0
  23. package/dist/Dialog/index.d.ts +4 -1
  24. package/dist/Dialog/index.js +8 -7
  25. package/dist/Dialog/overlay.store.d.ts +24 -0
  26. package/dist/Dialog/overlay.store.js +59 -0
  27. package/dist/Dialog/requestConfirmation.js +20 -10
  28. package/dist/Display/Display.Accordion.js +185 -13
  29. package/dist/Display/Display.AmountSummary.js +206 -15
  30. package/dist/Display/Display.Avatar.js +93 -31
  31. package/dist/Display/Display.AvatarGroup.js +132 -17
  32. package/dist/Display/Display.Badge.d.ts +18 -2
  33. package/dist/Display/Display.Badge.js +117 -49
  34. package/dist/Display/Display.Card.js +163 -26
  35. package/dist/Display/Display.Carousel.js +459 -105
  36. package/dist/Display/Display.Chip.d.ts +4 -1
  37. package/dist/Display/Display.Chip.js +165 -31
  38. package/dist/Display/Display.CircleButton.d.ts +1 -0
  39. package/dist/Display/Display.CircleButton.js +86 -27
  40. package/dist/Display/Display.CopyableText.js +289 -66
  41. package/dist/Display/Display.CountRecords.js +60 -3
  42. package/dist/Display/Display.DataTable.js +123 -13
  43. package/dist/Display/Display.Date.js +243 -33
  44. package/dist/Display/Display.Divider.d.ts +10 -10
  45. package/dist/Display/Display.Divider.js +67 -20
  46. package/dist/Display/Display.ExpoImage.js +97 -8
  47. package/dist/Display/Display.GradientSurface.d.ts +9 -4
  48. package/dist/Display/Display.GradientSurface.js +196 -46
  49. package/dist/Display/Display.Icon.js +129 -15
  50. package/dist/Display/Display.IconBadge.js +95 -25
  51. package/dist/Display/Display.Image.d.ts +7 -1
  52. package/dist/Display/Display.Image.js +344 -39
  53. package/dist/Display/Display.KeyValue.js +90 -5
  54. package/dist/Display/Display.ListGroup.js +181 -9
  55. package/dist/Display/Display.ListItem.js +324 -28
  56. package/dist/Display/Display.Logo.js +84 -29
  57. package/dist/Display/Display.MediaCard.js +125 -4
  58. package/dist/Display/Display.MediaEmbed.d.ts +0 -5
  59. package/dist/Display/Display.MediaEmbed.js +170 -26
  60. package/dist/Display/Display.MenuButton.d.ts +2 -2
  61. package/dist/Display/Display.MenuButton.js +380 -94
  62. package/dist/Display/Display.MenuCard.js +122 -18
  63. package/dist/Display/Display.MenuGrid.js +43 -3
  64. package/dist/Display/Display.Monetary.js +90 -5
  65. package/dist/Display/Display.Pattern.js +306 -47
  66. package/dist/Display/Display.PriceTag.js +117 -14
  67. package/dist/Display/Display.ProductCard.js +154 -4
  68. package/dist/Display/Display.Rating.js +92 -11
  69. package/dist/Display/Display.SearchHistory.js +132 -6
  70. package/dist/Display/Display.SectionHeader.d.ts +5 -1
  71. package/dist/Display/Display.SectionHeader.js +125 -12
  72. package/dist/Display/Display.Stat.js +62 -3
  73. package/dist/Display/Display.StatCard.js +131 -7
  74. package/dist/Display/Display.StatusBadge.d.ts +29 -0
  75. package/dist/Display/Display.StatusBadge.js +68 -0
  76. package/dist/Display/Display.StatusDot.js +93 -18
  77. package/dist/Display/Display.Story.js +285 -35
  78. package/dist/Display/Display.StoryTray.js +354 -34
  79. package/dist/Display/Display.StoryViewer.js +571 -72
  80. package/dist/Display/Display.SwipeableRow.js +148 -20
  81. package/dist/Display/Display.Tag.d.ts +4 -1
  82. package/dist/Display/Display.Tag.js +66 -4
  83. package/dist/Display/Display.Timeline.js +102 -13
  84. package/dist/Display/Display.Tooltip.js +122 -26
  85. package/dist/Display/chevron.d.ts +6 -0
  86. package/dist/Display/chevron.js +32 -0
  87. package/dist/Display/count-badge.d.ts +21 -0
  88. package/dist/Display/count-badge.js +124 -0
  89. package/dist/Display/group-title.d.ts +10 -0
  90. package/dist/Display/group-title.js +53 -0
  91. package/dist/Display/icon-font.d.ts +3 -0
  92. package/dist/Display/icon-font.ios.d.ts +3 -0
  93. package/dist/Display/icon-font.ios.js +4 -0
  94. package/dist/Display/icon-font.js +7 -0
  95. package/dist/Display/icon-glyphs.d.ts +2 -0
  96. package/dist/Display/icon-glyphs.js +87 -0
  97. package/dist/Display/icon-map.d.ts +15 -11
  98. package/dist/Display/icon-map.js +344 -84
  99. package/dist/Display/icon-registry.d.ts +21 -0
  100. package/dist/Display/icon-registry.js +21 -0
  101. package/dist/Display/index.d.ts +6 -1
  102. package/dist/Display/index.js +53 -48
  103. package/dist/Display/pill.d.ts +16 -0
  104. package/dist/Display/pill.js +47 -0
  105. package/dist/Feedback/ErrorBoundary.js +35 -23
  106. package/dist/Feedback/Feedback.Banner.js +202 -24
  107. package/dist/Feedback/Feedback.DomainSplashScreen.js +246 -70
  108. package/dist/Feedback/Feedback.Empty.js +54 -3
  109. package/dist/Feedback/Feedback.EmptyState.js +114 -5
  110. package/dist/Feedback/Feedback.Error.d.ts +1 -1
  111. package/dist/Feedback/Feedback.Error.js +130 -5
  112. package/dist/Feedback/Feedback.Loading.d.ts +1 -1
  113. package/dist/Feedback/Feedback.Loading.js +70 -3
  114. package/dist/Feedback/Feedback.PermissionCard.js +161 -5
  115. package/dist/Feedback/Feedback.Progress.js +199 -41
  116. package/dist/Feedback/Feedback.ProgressCircle.js +184 -12
  117. package/dist/Feedback/Feedback.Skeleton.js +149 -36
  118. package/dist/Feedback/Feedback.Spinner.js +407 -79
  119. package/dist/Feedback/Feedback.Splash.js +240 -33
  120. package/dist/Feedback/Feedback.State.d.ts +17 -0
  121. package/dist/Feedback/Feedback.State.js +104 -0
  122. package/dist/Feedback/Toast.context.js +883 -167
  123. package/dist/Feedback/index.d.ts +3 -0
  124. package/dist/Feedback/index.js +15 -13
  125. package/dist/Form/Form.Checkbox.js +212 -22
  126. package/dist/Form/Form.ControlledCheckbox.d.ts +1 -1
  127. package/dist/Form/Form.ControlledCheckbox.js +46 -4
  128. package/dist/Form/Form.ControlledDropdown.d.ts +1 -1
  129. package/dist/Form/Form.ControlledDropdown.js +62 -4
  130. package/dist/Form/Form.ControlledInput.d.ts +4 -3
  131. package/dist/Form/Form.ControlledInput.js +72 -4
  132. package/dist/Form/Form.ControlledMonetaryInput.d.ts +6 -3
  133. package/dist/Form/Form.ControlledMonetaryInput.js +50 -4
  134. package/dist/Form/Form.ControlledRadioButton.d.ts +2 -2
  135. package/dist/Form/Form.ControlledRadioButton.js +45 -4
  136. package/dist/Form/Form.DatePicker.js +507 -107
  137. package/dist/Form/Form.Dropdown.js +303 -52
  138. package/dist/Form/Form.ErrorSummary.js +236 -44
  139. package/dist/Form/Form.Field.d.ts +24 -0
  140. package/dist/Form/Form.Field.js +55 -0
  141. package/dist/Form/Form.FractionalQuantityInput.js +508 -96
  142. package/dist/Form/Form.Input.d.ts +17 -3
  143. package/dist/Form/Form.Input.js +497 -29
  144. package/dist/Form/Form.KeyboardForm.d.ts +22 -8
  145. package/dist/Form/Form.KeyboardForm.js +83 -8
  146. package/dist/Form/Form.KeyboardToolbarHost.d.ts +14 -0
  147. package/dist/Form/Form.KeyboardToolbarHost.js +223 -0
  148. package/dist/Form/Form.MonetaryInput.js +164 -17
  149. package/dist/Form/Form.PickerField.d.ts +31 -0
  150. package/dist/Form/Form.PickerField.js +539 -0
  151. package/dist/Form/Form.PinInput.js +150 -15
  152. package/dist/Form/Form.QuantitySelector.js +229 -25
  153. package/dist/Form/Form.RadioButton.d.ts +1 -0
  154. package/dist/Form/Form.RadioButton.js +26 -29
  155. package/dist/Form/Form.Select.d.ts +2 -1
  156. package/dist/Form/Form.Select.js +388 -60
  157. package/dist/Form/Form.Slider.js +133 -10
  158. package/dist/Form/Form.Switch.js +99 -4
  159. package/dist/Form/choice-row.d.ts +15 -0
  160. package/dist/Form/choice-row.js +236 -0
  161. package/dist/Form/index.d.ts +11 -6
  162. package/dist/Form/index.js +26 -27
  163. package/dist/Form/input-text.d.ts +7 -0
  164. package/dist/Form/input-text.js +18 -0
  165. package/dist/Navigation/Navigation.AppBar.d.ts +3 -4
  166. package/dist/Navigation/Navigation.AppBar.js +535 -99
  167. package/dist/Navigation/Navigation.BottomNav.js +363 -98
  168. package/dist/Navigation/Navigation.CollapsingHeader.d.ts +28 -13
  169. package/dist/Navigation/Navigation.CollapsingHeader.js +369 -36
  170. package/dist/Navigation/Navigation.FloatingBar.js +71 -11
  171. package/dist/Navigation/Navigation.Menu.js +309 -95
  172. package/dist/Navigation/Navigation.MenuSection.js +80 -11
  173. package/dist/Navigation/Navigation.RowItem.d.ts +4 -2
  174. package/dist/Navigation/Navigation.RowItem.js +93 -8
  175. package/dist/Navigation/Navigation.Search.js +241 -27
  176. package/dist/Navigation/Navigation.SearchBar.d.ts +7 -1
  177. package/dist/Navigation/Navigation.SearchBar.js +218 -29
  178. package/dist/Navigation/Navigation.SearchSuggestions.js +77 -3
  179. package/dist/Navigation/Navigation.SegmentedControl.js +152 -14
  180. package/dist/Navigation/Navigation.Steps.js +105 -11
  181. package/dist/Navigation/Navigation.Tabs.js +449 -41
  182. package/dist/Navigation/index.d.ts +9 -4
  183. package/dist/Navigation/index.js +13 -13
  184. package/dist/Typography/Typography.Heading.js +33 -3
  185. package/dist/Typography/Typography.SelectableText.js +95 -7
  186. package/dist/Typography/Typography.Text.d.ts +4 -2
  187. package/dist/Typography/Typography.Text.js +217 -7
  188. package/dist/Typography/index.js +3 -3
  189. package/dist/branding.js +29 -13
  190. package/dist/icons/AddItemIcon.js +76 -2
  191. package/dist/icons/ArrangeCircle.js +82 -2
  192. package/dist/icons/ArrowDownIcon.js +63 -3
  193. package/dist/icons/ArrowUpIcon.js +63 -3
  194. package/dist/icons/BoxIcon.js +64 -2
  195. package/dist/icons/BoxTimeIcon.js +63 -2
  196. package/dist/icons/CalendarIcon.js +145 -2
  197. package/dist/icons/CardIcon.js +80 -2
  198. package/dist/icons/CashierIcon.js +39 -2
  199. package/dist/icons/CreditIcon.js +76 -3
  200. package/dist/icons/DuoIcon.js +75 -2
  201. package/dist/icons/HomeIcon.js +39 -2
  202. package/dist/icons/HomeIconOutlined.js +53 -2
  203. package/dist/icons/LogoIcon.js +87 -2
  204. package/dist/icons/MoneyReceiveIcon.js +86 -2
  205. package/dist/icons/PinIcon.js +39 -2
  206. package/dist/icons/ProfileIcon.js +47 -2
  207. package/dist/icons/SettingsIcon.js +114 -2
  208. package/dist/icons/SinpeIcon.js +60 -2
  209. package/dist/icons/ToggleOffIcon.js +53 -2
  210. package/dist/icons/WalletMoneyIcon.js +81 -2
  211. package/dist/index.d.ts +1 -0
  212. package/dist/index.js +8 -2
  213. package/dist/layouts/AuthContainer.d.ts +4 -5
  214. package/dist/layouts/AuthContainer.js +231 -7
  215. package/dist/layouts/BottomInset.js +4 -1
  216. package/dist/layouts/Container.d.ts +2 -2
  217. package/dist/layouts/Container.js +45 -3
  218. package/dist/layouts/GradientContainer.js +37 -5
  219. package/dist/layouts/PlainLayout.js +19 -3
  220. package/dist/layouts/ScrollContainer.d.ts +14 -9
  221. package/dist/layouts/ScrollContainer.js +125 -4
  222. package/dist/layouts/edges.d.ts +2 -0
  223. package/dist/layouts/edges.js +1 -0
  224. package/dist/primitives/AspectRatio.js +75 -3
  225. package/dist/primitives/Box.js +45 -3
  226. package/dist/primitives/Pressable.js +95 -5
  227. package/dist/primitives/Row.js +84 -13
  228. package/dist/primitives/Spacer.js +42 -5
  229. package/dist/primitives/Stack.js +66 -7
  230. package/dist/primitives/index.js +1 -1
  231. package/dist/theme/active.d.ts +2 -0
  232. package/dist/theme/active.js +33 -18
  233. package/dist/theme/build.js +118 -87
  234. package/dist/theme/color.js +87 -87
  235. package/dist/theme/components/ThemedActivityIndicator.d.ts +2 -15
  236. package/dist/theme/components/ThemedActivityIndicator.js +35 -3
  237. package/dist/theme/components/index.js +1 -0
  238. package/dist/theme/contrast.js +32 -33
  239. package/dist/theme/css-vars.js +71 -75
  240. package/dist/theme/dark.js +116 -97
  241. package/dist/theme/default.js +116 -97
  242. package/dist/theme/define.js +16 -12
  243. package/dist/theme/index.d.ts +1 -0
  244. package/dist/theme/index.js +7 -6
  245. package/dist/theme/on-dark-surface.d.ts +12 -0
  246. package/dist/theme/on-dark-surface.js +13 -0
  247. package/dist/theme/theme.js +1 -0
  248. package/dist/theme/tw.js +3 -1
  249. package/dist/theme/types.js +0 -18
  250. package/dist/theme/typography.d.ts +1 -1
  251. package/dist/theme/typography.js +337 -303
  252. package/dist/theme/useTheme.d.ts +4 -0
  253. package/dist/theme/useTheme.js +7 -3
  254. package/dist/theme/useThemeVars.d.ts +9 -0
  255. package/dist/theme/useThemeVars.js +23 -0
  256. package/dist/theme/validate.js +175 -166
  257. package/dist/tokens/index.js +1 -1
  258. package/dist/tokens/motion.js +30 -13
  259. package/dist/utils/async.d.ts +14 -0
  260. package/dist/utils/async.js +22 -0
  261. package/dist/utils/criteria.js +66 -85
  262. package/dist/utils/date.d.ts +8 -2
  263. package/dist/utils/date.js +63 -50
  264. package/dist/utils/image.js +8 -8
  265. package/dist/utils/intl.d.ts +1 -0
  266. package/dist/utils/intl.js +13 -0
  267. package/dist/utils/keys.js +3 -5
  268. package/dist/utils/monetary.d.ts +1 -0
  269. package/dist/utils/monetary.js +28 -24
  270. package/dist/utils/progress.js +2 -3
  271. package/dist/utils/quantity.js +25 -26
  272. package/dist/utils/reorder.js +11 -20
  273. package/dist/utils/search.d.ts +4 -0
  274. package/dist/utils/search.js +12 -0
  275. package/dist/utils/serializer.js +38 -38
  276. package/dist/utils/useReducedMotion.js +32 -30
  277. package/dist/views/AppSplashView.js +117 -3
  278. package/dist/views/AuthFormView.d.ts +4 -5
  279. package/dist/views/AuthFormView.js +119 -11
  280. package/dist/views/FormViewV2.context.js +75 -23
  281. package/dist/views/FormViewV2.d.ts +4 -5
  282. package/dist/views/FormViewV2.js +658 -92
  283. package/dist/views/ListViewV2.context.js +91 -47
  284. package/dist/views/ListViewV2.d.ts +84 -43
  285. package/dist/views/ListViewV2.js +1350 -200
  286. package/dist/views/Wizard/Wizard.context.js +248 -84
  287. package/dist/views/Wizard/Wizard.js +260 -67
  288. package/dist/views/types/IListView.js +34 -31
  289. package/dist/widgets/CollectionOptions.js +557 -138
  290. package/dist/widgets/FilterBar.js +159 -7
  291. package/dist/widgets/FilterBuilder.js +375 -102
  292. package/dist/widgets/JSONViewer.js +275 -129
  293. package/dist/widgets/PromoBanner.js +336 -42
  294. package/dist/widgets/PromoModal.d.ts +2 -2
  295. package/dist/widgets/PromoModal.js +389 -62
  296. package/dist/widgets/QueryChoice.js +150 -8
  297. package/dist/widgets/QuickActions.js +120 -31
  298. package/dist/widgets/ReorderableList.js +399 -128
  299. package/dist/widgets/TimeZoneSelectorModal.js +458 -51
  300. package/dist/widgets/index.js +3 -3
  301. package/package.json +6 -1
  302. package/tailwind.preset.js +7 -5
  303. package/dist/Form/Form.InputField.d.ts +0 -10
  304. package/dist/Form/Form.InputField.js +0 -38
  305. package/dist/Form/Form.KeyboardToolbar.d.ts +0 -22
  306. package/dist/Form/Form.KeyboardToolbar.js +0 -66
  307. package/dist/Form/Form.PasswordInput.d.ts +0 -9
  308. package/dist/Form/Form.PasswordInput.js +0 -17
  309. package/dist/Form/Form.TextInput.d.ts +0 -8
  310. package/dist/Form/Form.TextInput.js +0 -8
  311. package/dist/primitives/BaseButton.d.ts +0 -150
  312. package/dist/primitives/BaseButton.js +0 -229
  313. package/dist/utils/useSheetTranslation.d.ts +0 -5
  314. package/dist/utils/useSheetTranslation.js +0 -23
@@ -1,11 +1,25 @@
1
1
  import type { Ref } from "react";
2
2
  import { type TextInputInstance, type TextInputProps } from "react-native";
3
- interface FormInputProps extends TextInputProps {
3
+ export interface FormInputProps extends Omit<TextInputProps, "secureTextEntry"> {
4
4
  ref?: Ref<TextInputInstance>;
5
- label: string;
5
+ label?: string;
6
6
  error?: string;
7
7
  tooltip?: string;
8
+ /** `card` (default) or `outline`. Same behavior; see the class tables above. */
9
+ look?: "card" | "outline";
10
+ /** Hides the text and shows a toggle to reveal it (passwords, PINs typed as text). */
11
+ secure?: boolean;
12
+ /** Classes of the wrapper (spacing, width). */
8
13
  className?: string;
9
14
  }
10
- declare function FormInput({ label, error, tooltip, style, multiline, numberOfLines, onFocus, onBlur, className, ref, ...props }: FormInputProps): import("react").JSX.Element;
15
+ /**
16
+ * The text field of the DS. One behavior (label, focus and error states, accessibility,
17
+ * secure toggle) with two looks:
18
+ *
19
+ * | look | label | field | bottom space |
20
+ * | --------- | ---------------------- | --------------------------------------- | ------------ |
21
+ * | `card` | bodySmall, semibold | card surface, rounded-lg, ≥48 | 8 |
22
+ * | `outline` | bodyLarge | border only, rounded, 44 high | 16 |
23
+ */
24
+ declare function FormInput({ label, error, tooltip, look, secure, style, multiline, numberOfLines, onFocus, onBlur, onSubmitEditing, submitBehavior, className, ref, ...props }: FormInputProps): import("react").JSX.Element;
11
25
  export default FormInput;
@@ -1,38 +1,506 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
2
- import { theme } from "../theme/index.js";
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { Display } from "../Display/index.js";
3
+ import { inputTextStyle } from "./input-text.js";
4
+ import { useTheme } from "../theme/index.js";
3
5
  import { cn, tv } from "../theme/tw.js";
4
6
  import { Typography } from "../Typography/index.js";
5
7
  import { useState } from "react";
6
- import { TextInput, View } from "react-native";
7
- const inputContainer = tv({
8
- base: "rounded-lg bg-bg-card shadow-sm",
9
- variants: {
10
- state: {
11
- error: "border-2 border-danger",
12
- focused: "border-2 border-border-focus",
13
- default: "border border-input",
14
- },
15
- },
16
- defaultVariants: { state: "default" },
8
+ import { TextInput, TouchableOpacity, View } from "react-native";
9
+ import { KeyboardController } from "react-native-keyboard-controller";
10
+ import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
11
+ // `card`: filled surface, the default of forms built with the DS. Same box as the
12
+ // Select, DatePicker, PickerField and Dropdown triggers.
13
+ const cardBox = tv({
14
+ base: "rounded-lg bg-bg-card",
15
+ variants: {
16
+ state: {
17
+ error: "border-2 border-danger",
18
+ focused: "border-2 border-border-focus",
19
+ default: "border border-input"
20
+ }
21
+ },
22
+ defaultVariants: {
23
+ state: "default"
24
+ }
17
25
  });
18
- function FormInput({ label, error, tooltip, style, multiline = false, numberOfLines = 1, onFocus, onBlur, className, ref, ...props }) {
19
- const [isFocused, setIsFocused] = useState(false);
20
- const hasError = Boolean(error);
21
- const handleFocus = (e) => {
22
- setIsFocused(true);
23
- onFocus?.(e);
26
+
27
+ // `outline`: bordered input without surface, the look of the access forms
28
+ // (login, server, reset). The border lives on the TextInput, so the height is 44.
29
+ const outlineInput = tv({
30
+ base: "h-11 text-text-primary rounded p-2",
31
+ variants: {
32
+ state: {
33
+ error: "border-2 border-danger",
34
+ focused: "border-2 border-border-focus",
35
+ default: "border border-input"
36
+ }
37
+ },
38
+ defaultVariants: {
39
+ state: "default"
40
+ }
41
+ });
42
+ function SecureToggle(t0) {
43
+ const $ = _c(8);
44
+ const {
45
+ visible,
46
+ onToggle,
47
+ className
48
+ } = t0;
49
+ const theme = useTheme();
50
+ const t1 = visible ? "Ocultar contrase\xF1a" : "Mostrar contrase\xF1a";
51
+ const t2 = visible ? "hidden" : "visibility";
52
+ let t3;
53
+ if ($[0] !== t2 || $[1] !== theme.text.primary) {
54
+ t3 = _jsx(Display.Icon, {
55
+ color: theme.text.primary,
56
+ name: t2,
57
+ size: 22
58
+ });
59
+ $[0] = t2;
60
+ $[1] = theme.text.primary;
61
+ $[2] = t3;
62
+ } else {
63
+ t3 = $[2];
64
+ }
65
+ let t4;
66
+ if ($[3] !== className || $[4] !== onToggle || $[5] !== t1 || $[6] !== t3) {
67
+ t4 = _jsx(TouchableOpacity, {
68
+ accessibilityLabel: t1,
69
+ accessibilityRole: "button",
70
+ className: className,
71
+ hitSlop: 8,
72
+ onPress: onToggle,
73
+ children: t3
74
+ });
75
+ $[3] = className;
76
+ $[4] = onToggle;
77
+ $[5] = t1;
78
+ $[6] = t3;
79
+ $[7] = t4;
80
+ } else {
81
+ t4 = $[7];
82
+ }
83
+ return t4;
84
+ }
85
+
86
+ /**
87
+ * The text field of the DS. One behavior (label, focus and error states, accessibility,
88
+ * secure toggle) with two looks:
89
+ *
90
+ * | look | label | field | bottom space |
91
+ * | --------- | ---------------------- | --------------------------------------- | ------------ |
92
+ * | `card` | bodySmall, semibold | card surface, rounded-lg, ≥48 | 8 |
93
+ * | `outline` | bodyLarge | border only, rounded, 44 high | 16 |
94
+ */
95
+ function FormInput(t0) {
96
+ const $ = _c(98);
97
+ let className;
98
+ let error;
99
+ let label;
100
+ let onBlur;
101
+ let onFocus;
102
+ let onSubmitEditing;
103
+ let props;
104
+ let ref;
105
+ let style;
106
+ let submitBehavior;
107
+ let t1;
108
+ let t2;
109
+ let t3;
110
+ let t4;
111
+ let tooltip;
112
+ if ($[0] !== t0) {
113
+ ({
114
+ label,
115
+ error,
116
+ tooltip,
117
+ look: t1,
118
+ secure: t2,
119
+ style,
120
+ multiline: t3,
121
+ numberOfLines: t4,
122
+ onFocus,
123
+ onBlur,
124
+ onSubmitEditing,
125
+ submitBehavior,
126
+ className,
127
+ ref,
128
+ ...props
129
+ } = t0);
130
+ $[0] = t0;
131
+ $[1] = className;
132
+ $[2] = error;
133
+ $[3] = label;
134
+ $[4] = onBlur;
135
+ $[5] = onFocus;
136
+ $[6] = onSubmitEditing;
137
+ $[7] = props;
138
+ $[8] = ref;
139
+ $[9] = style;
140
+ $[10] = submitBehavior;
141
+ $[11] = t1;
142
+ $[12] = t2;
143
+ $[13] = t3;
144
+ $[14] = t4;
145
+ $[15] = tooltip;
146
+ } else {
147
+ className = $[1];
148
+ error = $[2];
149
+ label = $[3];
150
+ onBlur = $[4];
151
+ onFocus = $[5];
152
+ onSubmitEditing = $[6];
153
+ props = $[7];
154
+ ref = $[8];
155
+ style = $[9];
156
+ submitBehavior = $[10];
157
+ t1 = $[11];
158
+ t2 = $[12];
159
+ t3 = $[13];
160
+ t4 = $[14];
161
+ tooltip = $[15];
162
+ }
163
+ const look = t1 === undefined ? "card" : t1;
164
+ const secure = t2 === undefined ? false : t2;
165
+ const multiline = t3 === undefined ? false : t3;
166
+ const numberOfLines = t4 === undefined ? 1 : t4;
167
+ const theme = useTheme();
168
+ const [isFocused, setIsFocused] = useState(false);
169
+ const [revealed, setRevealed] = useState(false);
170
+ const hasError = Boolean(error);
171
+ const state = hasError ? "error" : isFocused ? "focused" : "default";
172
+ let t5;
173
+ if ($[16] !== onFocus) {
174
+ t5 = e => {
175
+ setIsFocused(true);
176
+ onFocus?.(e);
24
177
  };
25
- const handleBlur = (e) => {
26
- setIsFocused(false);
27
- onBlur?.(e);
178
+ $[16] = onFocus;
179
+ $[17] = t5;
180
+ } else {
181
+ t5 = $[17];
182
+ }
183
+ const handleFocus = t5;
184
+ let t6;
185
+ if ($[18] !== onBlur) {
186
+ t6 = e_0 => {
187
+ setIsFocused(false);
188
+ onBlur?.(e_0);
28
189
  };
29
- const getState = () => {
30
- if (hasError)
31
- return "error";
32
- if (isFocused)
33
- return "focused";
34
- return "default";
190
+ $[18] = onBlur;
191
+ $[19] = t6;
192
+ } else {
193
+ t6 = $[19];
194
+ }
195
+ const handleBlur = t6;
196
+ let t7;
197
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
198
+ t7 = () => setRevealed(_temp);
199
+ $[20] = t7;
200
+ } else {
201
+ t7 = $[20];
202
+ }
203
+ const toggle = t7;
204
+ const advances = props.returnKeyType === "next" && !multiline && !onSubmitEditing;
205
+ const t8 = error || tooltip;
206
+ const t9 = advances ? _temp2 : onSubmitEditing;
207
+ const t10 = advances ? "submit" : submitBehavior;
208
+ const t11 = secure && !revealed;
209
+ let t12;
210
+ if ($[21] !== handleBlur || $[22] !== handleFocus || $[23] !== label || $[24] !== ref || $[25] !== t10 || $[26] !== t11 || $[27] !== t8 || $[28] !== t9 || $[29] !== theme.primary || $[30] !== theme.text.tertiary) {
211
+ t12 = {
212
+ accessibilityHint: t8,
213
+ accessibilityLabel: label,
214
+ onBlur: handleBlur,
215
+ onFocus: handleFocus,
216
+ onSubmitEditing: t9,
217
+ submitBehavior: t10,
218
+ placeholderTextColor: theme.text.tertiary,
219
+ ref,
220
+ secureTextEntry: t11,
221
+ selectionColor: theme.primary,
222
+ underlineColorAndroid: "transparent"
35
223
  };
36
- return (_jsxs(View, { className: cn("mb-2", className), children: [_jsx(Typography.Text, { className: "mb-1 font-medium text-text-primary", variant: "bodySmall", children: label }), _jsx(View, { className: inputContainer({ state: getState() }), children: _jsx(TextInput, { accessibilityHint: error || tooltip, accessibilityLabel: label, className: cn("px-3 py-2.5 text-sm min-h-[48px] text-text-primary", multiline && "min-h-[64px] pt-2.5"), multiline: multiline, numberOfLines: numberOfLines, onBlur: handleBlur, onFocus: handleFocus, placeholderTextColor: theme.text.tertiary, ref: ref, selectionColor: theme.primary, style: [{ minHeight: multiline ? 64 : 48 }, style], textAlignVertical: multiline ? "top" : "center", underlineColorAndroid: "transparent", ...props }) }), hasError && (_jsx(Typography.Text, { accessibilityLiveRegion: "polite", className: "mt-0.5 text-danger", variant: "bodySmall", children: error }))] }));
224
+ $[21] = handleBlur;
225
+ $[22] = handleFocus;
226
+ $[23] = label;
227
+ $[24] = ref;
228
+ $[25] = t10;
229
+ $[26] = t11;
230
+ $[27] = t8;
231
+ $[28] = t9;
232
+ $[29] = theme.primary;
233
+ $[30] = theme.text.tertiary;
234
+ $[31] = t12;
235
+ } else {
236
+ t12 = $[31];
237
+ }
238
+ const shared = t12;
239
+ let t13;
240
+ if ($[32] !== error || $[33] !== hasError || $[34] !== look) {
241
+ t13 = hasError ? _jsx(Typography.Text, {
242
+ accessibilityLiveRegion: "polite",
243
+ className: look === "card" ? "mt-0.5 text-danger" : "mt-1 text-danger",
244
+ variant: "bodySmall",
245
+ children: error
246
+ }) : null;
247
+ $[32] = error;
248
+ $[33] = hasError;
249
+ $[34] = look;
250
+ $[35] = t13;
251
+ } else {
252
+ t13 = $[35];
253
+ }
254
+ const errorText = t13;
255
+ if (look === "outline") {
256
+ let t14;
257
+ if ($[36] !== className) {
258
+ t14 = cn("mb-4", className);
259
+ $[36] = className;
260
+ $[37] = t14;
261
+ } else {
262
+ t14 = $[37];
263
+ }
264
+ let t15;
265
+ if ($[38] !== label) {
266
+ t15 = label ? _jsx(Typography.Text, {
267
+ className: "mb-1",
268
+ variant: "bodyLarge",
269
+ children: label
270
+ }) : null;
271
+ $[38] = label;
272
+ $[39] = t15;
273
+ } else {
274
+ t15 = $[39];
275
+ }
276
+ let t16;
277
+ if ($[40] !== state) {
278
+ t16 = outlineInput({
279
+ state
280
+ });
281
+ $[40] = state;
282
+ $[41] = t16;
283
+ } else {
284
+ t16 = $[41];
285
+ }
286
+ let t17;
287
+ if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
288
+ t17 = inputTextStyle();
289
+ $[42] = t17;
290
+ } else {
291
+ t17 = $[42];
292
+ }
293
+ let t18;
294
+ if ($[43] !== style) {
295
+ t18 = [t17, style];
296
+ $[43] = style;
297
+ $[44] = t18;
298
+ } else {
299
+ t18 = $[44];
300
+ }
301
+ let t19;
302
+ if ($[45] !== multiline || $[46] !== numberOfLines || $[47] !== props || $[48] !== shared || $[49] !== t16 || $[50] !== t18) {
303
+ t19 = _jsx(TextInput, {
304
+ className: t16,
305
+ multiline: multiline,
306
+ numberOfLines: numberOfLines,
307
+ style: t18,
308
+ ...shared,
309
+ ...props
310
+ });
311
+ $[45] = multiline;
312
+ $[46] = numberOfLines;
313
+ $[47] = props;
314
+ $[48] = shared;
315
+ $[49] = t16;
316
+ $[50] = t18;
317
+ $[51] = t19;
318
+ } else {
319
+ t19 = $[51];
320
+ }
321
+ let t20;
322
+ if ($[52] !== errorText || $[53] !== t14 || $[54] !== t15 || $[55] !== t19) {
323
+ t20 = _jsxs(View, {
324
+ className: t14,
325
+ children: [t15, t19, errorText]
326
+ });
327
+ $[52] = errorText;
328
+ $[53] = t14;
329
+ $[54] = t15;
330
+ $[55] = t19;
331
+ $[56] = t20;
332
+ } else {
333
+ t20 = $[56];
334
+ }
335
+ const field = t20;
336
+ if (!secure) {
337
+ return field;
338
+ }
339
+ let t21;
340
+ if ($[57] !== revealed) {
341
+ t21 = _jsx(SecureToggle, {
342
+ className: "absolute right-3 bottom-[25px]",
343
+ onToggle: toggle,
344
+ visible: revealed
345
+ });
346
+ $[57] = revealed;
347
+ $[58] = t21;
348
+ } else {
349
+ t21 = $[58];
350
+ }
351
+ let t22;
352
+ if ($[59] !== field || $[60] !== t21) {
353
+ t22 = _jsxs(View, {
354
+ className: "mb-4 relative",
355
+ children: [field, t21]
356
+ });
357
+ $[59] = field;
358
+ $[60] = t21;
359
+ $[61] = t22;
360
+ } else {
361
+ t22 = $[61];
362
+ }
363
+ return t22;
364
+ }
365
+ let t14;
366
+ if ($[62] !== className) {
367
+ t14 = cn("mb-2", className);
368
+ $[62] = className;
369
+ $[63] = t14;
370
+ } else {
371
+ t14 = $[63];
372
+ }
373
+ let t15;
374
+ if ($[64] !== label) {
375
+ t15 = label ? _jsx(Typography.Text, {
376
+ className: "mb-1 text-text-primary",
377
+ semibold: true,
378
+ variant: "bodySmall",
379
+ children: label
380
+ }) : null;
381
+ $[64] = label;
382
+ $[65] = t15;
383
+ } else {
384
+ t15 = $[65];
385
+ }
386
+ let t16;
387
+ if ($[66] !== secure || $[67] !== state) {
388
+ t16 = cn(cardBox({
389
+ state
390
+ }), secure && "flex-row items-center");
391
+ $[66] = secure;
392
+ $[67] = state;
393
+ $[68] = t16;
394
+ } else {
395
+ t16 = $[68];
396
+ }
397
+ const t17 = multiline && "min-h-[64px] pt-2.5";
398
+ const t18 = secure && "flex-1";
399
+ let t19;
400
+ if ($[69] !== t17 || $[70] !== t18) {
401
+ t19 = cn("px-3 py-2.5 min-h-[48px] text-text-primary", t17, t18);
402
+ $[69] = t17;
403
+ $[70] = t18;
404
+ $[71] = t19;
405
+ } else {
406
+ t19 = $[71];
407
+ }
408
+ let t20;
409
+ if ($[72] === Symbol.for("react.memo_cache_sentinel")) {
410
+ t20 = inputTextStyle();
411
+ $[72] = t20;
412
+ } else {
413
+ t20 = $[72];
414
+ }
415
+ const t21 = multiline ? 64 : 48;
416
+ let t22;
417
+ if ($[73] !== t21) {
418
+ t22 = {
419
+ minHeight: t21
420
+ };
421
+ $[73] = t21;
422
+ $[74] = t22;
423
+ } else {
424
+ t22 = $[74];
425
+ }
426
+ let t23;
427
+ if ($[75] !== style || $[76] !== t22) {
428
+ t23 = [t20, t22, style];
429
+ $[75] = style;
430
+ $[76] = t22;
431
+ $[77] = t23;
432
+ } else {
433
+ t23 = $[77];
434
+ }
435
+ const t24 = multiline ? "top" : "center";
436
+ let t25;
437
+ if ($[78] !== multiline || $[79] !== numberOfLines || $[80] !== props || $[81] !== shared || $[82] !== t19 || $[83] !== t23 || $[84] !== t24) {
438
+ t25 = _jsx(TextInput, {
439
+ className: t19,
440
+ multiline: multiline,
441
+ numberOfLines: numberOfLines,
442
+ style: t23,
443
+ textAlignVertical: t24,
444
+ ...shared,
445
+ ...props
446
+ });
447
+ $[78] = multiline;
448
+ $[79] = numberOfLines;
449
+ $[80] = props;
450
+ $[81] = shared;
451
+ $[82] = t19;
452
+ $[83] = t23;
453
+ $[84] = t24;
454
+ $[85] = t25;
455
+ } else {
456
+ t25 = $[85];
457
+ }
458
+ let t26;
459
+ if ($[86] !== revealed || $[87] !== secure) {
460
+ t26 = secure ? _jsx(SecureToggle, {
461
+ className: "px-3",
462
+ onToggle: toggle,
463
+ visible: revealed
464
+ }) : null;
465
+ $[86] = revealed;
466
+ $[87] = secure;
467
+ $[88] = t26;
468
+ } else {
469
+ t26 = $[88];
470
+ }
471
+ let t27;
472
+ if ($[89] !== t16 || $[90] !== t25 || $[91] !== t26) {
473
+ t27 = _jsxs(View, {
474
+ className: t16,
475
+ children: [t25, t26]
476
+ });
477
+ $[89] = t16;
478
+ $[90] = t25;
479
+ $[91] = t26;
480
+ $[92] = t27;
481
+ } else {
482
+ t27 = $[92];
483
+ }
484
+ let t28;
485
+ if ($[93] !== errorText || $[94] !== t14 || $[95] !== t15 || $[96] !== t27) {
486
+ t28 = _jsxs(View, {
487
+ className: t14,
488
+ children: [t15, t27, errorText]
489
+ });
490
+ $[93] = errorText;
491
+ $[94] = t14;
492
+ $[95] = t15;
493
+ $[96] = t27;
494
+ $[97] = t28;
495
+ } else {
496
+ t28 = $[97];
497
+ }
498
+ return t28;
499
+ }
500
+ function _temp2() {
501
+ return KeyboardController.setFocusTo("next");
502
+ }
503
+ function _temp(value) {
504
+ return !value;
37
505
  }
38
506
  export default FormInput;
@@ -1,11 +1,25 @@
1
- import { type KeyboardToolbarProps } from "./Form.KeyboardToolbar.js";
2
- import { type ReactNode, type Ref } from "react";
3
- import type { KeyboardAwareScrollViewProps, KeyboardAwareScrollViewRef } from "react-native-keyboard-controller";
4
- export interface KeyboardFormProps extends KeyboardAwareScrollViewProps {
1
+ import type { ReactElement, ReactNode } from "react";
2
+ import { type RefreshControlProps, type StyleProp, type ViewStyle } from "react-native";
3
+ export interface KeyboardFormProps {
5
4
  children: ReactNode;
6
- ref?: Ref<KeyboardAwareScrollViewRef>;
7
- toolbar?: boolean;
5
+ /** Overrides the computed space below the focused input. */
6
+ bottomOffset?: number;
7
+ /** Height of a footer that stays above the keyboard, such as a sticky action bar. */
8
8
  stickyFooterHeight?: number;
9
- toolbarProps?: Omit<KeyboardToolbarProps, "onHeightChange">;
9
+ style?: StyleProp<ViewStyle>;
10
+ contentContainerStyle?: StyleProp<ViewStyle>;
11
+ className?: string;
12
+ contentContainerClassName?: string;
13
+ keyboardShouldPersistTaps?: "always" | "handled" | "never";
14
+ showsVerticalScrollIndicator?: boolean;
15
+ bounces?: boolean;
16
+ refreshControl?: ReactElement<RefreshControlProps>;
17
+ /** iOS: let the system inset the content under large titles and NativeTabs. */
18
+ contentInsetAdjustmentBehavior?: "automatic" | "never";
19
+ testID?: string;
10
20
  }
11
- export default function KeyboardForm({ children, toolbar, stickyFooterHeight, toolbarProps, bottomOffset, style, ...props }: KeyboardFormProps): import("react").JSX.Element;
21
+ /**
22
+ * The one keyboard-aware scroll of a form. Its inputs form a toolbar group, so
23
+ * the global KeyboardToolbarHost moves focus only among them.
24
+ */
25
+ export default function KeyboardForm({ children, bottomOffset, stickyFooterHeight, style, keyboardShouldPersistTaps, ...scroll }: KeyboardFormProps): import("react").JSX.Element;
@@ -1,9 +1,84 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
2
- import KeyboardToolbar from "./Form.KeyboardToolbar.js";
3
- import { useState } from "react";
4
- import { View } from "react-native";
5
- import { KeyboardAwareScrollView, KeyboardToolbar as NativeToolbar, } from "react-native-keyboard-controller";
6
- export default function KeyboardForm({ children, toolbar = true, stickyFooterHeight = 0, toolbarProps, bottomOffset, style, ...props }) {
7
- const [toolbarHeight, setToolbarHeight] = useState(48);
8
- return (_jsxs(View, { style: { flex: 1 }, children: [_jsx(NativeToolbar.Group, { style: { flex: 1 }, children: _jsx(KeyboardAwareScrollView, { bottomOffset: bottomOffset ?? stickyFooterHeight + (toolbar ? toolbarHeight + 24 : 24), keyboardShouldPersistTaps: "handled", style: [{ flex: 1 }, style], ...props, children: children }) }), toolbar ? (_jsx(KeyboardToolbar, { ...toolbarProps, bottomGapOffset: -stickyFooterHeight, onHeightChange: setToolbarHeight })) : null] }));
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { useKeyboardToolbarInset } from "./Form.KeyboardToolbarHost.js";
3
+ import { StyleSheet } from "react-native";
4
+ import { KeyboardAwareScrollView, KeyboardToolbar } from "react-native-keyboard-controller";
5
+
6
+ /** Space kept between the focused input and whatever sits above the keyboard. */
7
+ import { jsx as _jsx } from "nativewind/jsx-runtime";
8
+ const FOCUS_GAP = 24;
9
+ /**
10
+ * The one keyboard-aware scroll of a form. Its inputs form a toolbar group, so
11
+ * the global KeyboardToolbarHost moves focus only among them.
12
+ */
13
+ export default function KeyboardForm(t0) {
14
+ const $ = _c(15);
15
+ let bottomOffset;
16
+ let children;
17
+ let scroll;
18
+ let style;
19
+ let t1;
20
+ let t2;
21
+ if ($[0] !== t0) {
22
+ ({
23
+ children,
24
+ bottomOffset,
25
+ stickyFooterHeight: t1,
26
+ style,
27
+ keyboardShouldPersistTaps: t2,
28
+ ...scroll
29
+ } = t0);
30
+ $[0] = t0;
31
+ $[1] = bottomOffset;
32
+ $[2] = children;
33
+ $[3] = scroll;
34
+ $[4] = style;
35
+ $[5] = t1;
36
+ $[6] = t2;
37
+ } else {
38
+ bottomOffset = $[1];
39
+ children = $[2];
40
+ scroll = $[3];
41
+ style = $[4];
42
+ t1 = $[5];
43
+ t2 = $[6];
44
+ }
45
+ const stickyFooterHeight = t1 === undefined ? 0 : t1;
46
+ const keyboardShouldPersistTaps = t2 === undefined ? "handled" : t2;
47
+ const toolbarInset = useKeyboardToolbarInset();
48
+ const t3 = bottomOffset ?? stickyFooterHeight + toolbarInset + FOCUS_GAP;
49
+ let t4;
50
+ if ($[7] !== style) {
51
+ t4 = [styles.fill, style];
52
+ $[7] = style;
53
+ $[8] = t4;
54
+ } else {
55
+ t4 = $[8];
56
+ }
57
+ let t5;
58
+ if ($[9] !== children || $[10] !== keyboardShouldPersistTaps || $[11] !== scroll || $[12] !== t3 || $[13] !== t4) {
59
+ t5 = _jsx(KeyboardToolbar.Group, {
60
+ style: styles.fill,
61
+ children: _jsx(KeyboardAwareScrollView, {
62
+ bottomOffset: t3,
63
+ keyboardShouldPersistTaps: keyboardShouldPersistTaps,
64
+ style: t4,
65
+ ...scroll,
66
+ children: children
67
+ })
68
+ });
69
+ $[9] = children;
70
+ $[10] = keyboardShouldPersistTaps;
71
+ $[11] = scroll;
72
+ $[12] = t3;
73
+ $[13] = t4;
74
+ $[14] = t5;
75
+ } else {
76
+ t5 = $[14];
77
+ }
78
+ return t5;
9
79
  }
80
+ const styles = StyleSheet.create({
81
+ fill: {
82
+ flex: 1
83
+ }
84
+ });