@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,73 +1,223 @@
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 { getActiveTheme, useTheme } from "../theme/index.js";
3
3
  import { cn, tv } from "../theme/tw.js";
4
4
  import { LinearGradient } from "expo-linear-gradient";
5
5
  import { View } from "react-native";
6
+
7
+ /** Gradient anchor, 0 to 1 on each axis: `{ x, y }` or `[x, y]`. */
8
+ import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
6
9
  /**
7
10
  * Decorative gradient presets. `brand` is themeable (reads `theme.gradient.primary`) —
8
11
  * use it when you want the surface to follow whatever the app's active theme defines.
9
12
  * Other presets are static constants for one-off uses. Each is [from, …, to].
10
13
  */
11
14
  const GRADIENT_PRESETS = {
12
- warm: {
13
- colors: ["#1A1714", "#C89B3C", "#B88A2E"],
14
- start: { x: 0, y: 0 },
15
- end: { x: 1, y: 1 },
15
+ warm: {
16
+ colors: ["#1A1714", "#C89B3C", "#B88A2E"],
17
+ start: {
18
+ x: 0,
19
+ y: 0
16
20
  },
17
- "neon-teal": {
18
- colors: ["#0F5C6E", "#5CC4D8"],
19
- start: { x: 0, y: 0 },
20
- end: { x: 1, y: 1 },
21
+ end: {
22
+ x: 1,
23
+ y: 1
24
+ }
25
+ },
26
+ "neon-teal": {
27
+ colors: ["#0F5C6E", "#5CC4D8"],
28
+ start: {
29
+ x: 0,
30
+ y: 0
21
31
  },
22
- "night-green": {
23
- colors: ["#0B101E", "#18223A"],
24
- start: { x: 0, y: 0 },
25
- end: { x: 1, y: 1 },
32
+ end: {
33
+ x: 1,
34
+ y: 1
35
+ }
36
+ },
37
+ "night-green": {
38
+ colors: ["#0B101E", "#18223A"],
39
+ start: {
40
+ x: 0,
41
+ y: 0
26
42
  },
27
- mesh: {
28
- colors: ["#1C3765", "#2A4A85", "#8FA9E8"],
29
- start: { x: 0, y: 0 },
30
- end: { x: 1, y: 1 },
43
+ end: {
44
+ x: 1,
45
+ y: 1
46
+ }
47
+ },
48
+ mesh: {
49
+ colors: ["#1C3765", "#2A4A85", "#8FA9E8"],
50
+ start: {
51
+ x: 0,
52
+ y: 0
31
53
  },
32
- emerald: {
33
- colors: ["#2F6B3C", "#6FCF8B"],
34
- start: { x: 0, y: 0 },
35
- end: { x: 1, y: 1 },
54
+ end: {
55
+ x: 1,
56
+ y: 1
57
+ }
58
+ },
59
+ emerald: {
60
+ colors: ["#2F6B3C", "#6FCF8B"],
61
+ start: {
62
+ x: 0,
63
+ y: 0
36
64
  },
65
+ end: {
66
+ x: 1,
67
+ y: 1
68
+ }
69
+ }
37
70
  };
38
71
  const surface = tv({
39
- variants: {
40
- radius: {
41
- none: "rounded-none",
42
- md: "rounded-xl",
43
- lg: "rounded-2xl",
44
- full: "rounded-full",
45
- },
46
- padding: {
47
- none: "p-0",
48
- sm: "p-3",
49
- md: "p-4",
50
- lg: "p-6",
51
- },
72
+ variants: {
73
+ radius: {
74
+ none: "rounded-none",
75
+ md: "rounded-xl",
76
+ lg: "rounded-2xl",
77
+ full: "rounded-full"
52
78
  },
53
- defaultVariants: { radius: "lg", padding: "none" },
79
+ padding: {
80
+ none: "p-0",
81
+ sm: "p-3",
82
+ md: "p-4",
83
+ lg: "p-6"
84
+ }
85
+ },
86
+ defaultVariants: {
87
+ radius: "lg",
88
+ padding: "none"
89
+ }
54
90
  });
55
- export function resolveGradientPreset(preset = "warm") {
56
- const surface = preset === "brand" ? GRADIENT_PRESETS.warm : GRADIENT_PRESETS[preset];
57
- return {
58
- ...surface,
59
- colors: preset === "brand" ? theme.gradient.primary : surface.colors,
60
- };
91
+ export function resolveGradientPreset(preset = "warm", theme = getActiveTheme()) {
92
+ const surface = preset === "brand" ? GRADIENT_PRESETS.warm : GRADIENT_PRESETS[preset];
93
+ return {
94
+ ...surface,
95
+ colors: preset === "brand" ? theme.gradient.primary : surface.colors
96
+ };
61
97
  }
98
+
62
99
  /**
63
100
  * Modern gradient surface. Wraps `expo-linear-gradient` with named presets +
64
101
  * tokenized radius/padding. iOS + Android (no native dep beyond the already-peer
65
102
  * `expo-linear-gradient`). Replaces the legacy `GradientContainer`.
66
103
  */
67
- function GradientSurface({ preset = "warm", colors, start, end, radius, padding, children, className, style, testID, }) {
68
- const p = resolveGradientPreset(preset);
69
- const resolvedColors = colors ?? p.colors;
70
- return (_jsxs(View, { className: cn("overflow-hidden", surface({ radius })), style: style, testID: testID, children: [_jsx(LinearGradient, { colors: [...resolvedColors], end: end ?? p.end, start: start ?? p.start, style: { position: "absolute", top: 0, left: 0, right: 0, bottom: 0 } }), _jsx(View, { className: cn(surface({ padding }), className), children: children })] }));
104
+ function GradientSurface(t0) {
105
+ const $ = _c(24);
106
+ const {
107
+ preset: t1,
108
+ colors,
109
+ start,
110
+ end,
111
+ radius,
112
+ padding,
113
+ children,
114
+ className,
115
+ style,
116
+ testID
117
+ } = t0;
118
+ const preset = t1 === undefined ? "warm" : t1;
119
+ const theme = useTheme();
120
+ let t2;
121
+ if ($[0] !== preset || $[1] !== theme) {
122
+ t2 = resolveGradientPreset(preset, theme);
123
+ $[0] = preset;
124
+ $[1] = theme;
125
+ $[2] = t2;
126
+ } else {
127
+ t2 = $[2];
128
+ }
129
+ const p = t2;
130
+ const resolvedColors = colors ?? p.colors;
131
+ let t3;
132
+ if ($[3] !== radius) {
133
+ t3 = cn("overflow-hidden", surface({
134
+ radius
135
+ }));
136
+ $[3] = radius;
137
+ $[4] = t3;
138
+ } else {
139
+ t3 = $[4];
140
+ }
141
+ let t4;
142
+ if ($[5] !== resolvedColors) {
143
+ t4 = [...resolvedColors];
144
+ $[5] = resolvedColors;
145
+ $[6] = t4;
146
+ } else {
147
+ t4 = $[6];
148
+ }
149
+ const t5 = t4;
150
+ const t6 = end ?? p.end;
151
+ const t7 = start ?? p.start;
152
+ let t8;
153
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
154
+ t8 = {
155
+ position: "absolute",
156
+ top: 0,
157
+ left: 0,
158
+ right: 0,
159
+ bottom: 0
160
+ };
161
+ $[7] = t8;
162
+ } else {
163
+ t8 = $[7];
164
+ }
165
+ let t9;
166
+ if ($[8] !== t5 || $[9] !== t6 || $[10] !== t7) {
167
+ t9 = _jsx(LinearGradient, {
168
+ colors: t5,
169
+ end: t6,
170
+ start: t7,
171
+ style: t8
172
+ });
173
+ $[8] = t5;
174
+ $[9] = t6;
175
+ $[10] = t7;
176
+ $[11] = t9;
177
+ } else {
178
+ t9 = $[11];
179
+ }
180
+ let t10;
181
+ if ($[12] !== className || $[13] !== padding) {
182
+ t10 = cn(surface({
183
+ padding
184
+ }), className);
185
+ $[12] = className;
186
+ $[13] = padding;
187
+ $[14] = t10;
188
+ } else {
189
+ t10 = $[14];
190
+ }
191
+ let t11;
192
+ if ($[15] !== children || $[16] !== t10) {
193
+ t11 = _jsx(View, {
194
+ className: t10,
195
+ children: children
196
+ });
197
+ $[15] = children;
198
+ $[16] = t10;
199
+ $[17] = t11;
200
+ } else {
201
+ t11 = $[17];
202
+ }
203
+ let t12;
204
+ if ($[18] !== style || $[19] !== t11 || $[20] !== t3 || $[21] !== t9 || $[22] !== testID) {
205
+ t12 = _jsxs(View, {
206
+ className: t3,
207
+ style: style,
208
+ testID: testID,
209
+ children: [t9, t11]
210
+ });
211
+ $[18] = style;
212
+ $[19] = t11;
213
+ $[20] = t3;
214
+ $[21] = t9;
215
+ $[22] = testID;
216
+ $[23] = t12;
217
+ } else {
218
+ t12 = $[23];
219
+ }
220
+ return t12;
71
221
  }
72
222
  export default GradientSurface;
73
223
  export { GRADIENT_PRESETS, GradientSurface };
@@ -1,21 +1,135 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { ICON_FONT_FAMILY } from "./icon-font.js";
3
+ import { MATERIAL_CODEPOINTS } from "./icon-glyphs.js";
2
4
  import { ICON_MAP } from "./icon-map.js";
5
+ import { customIconRenderer } from "./icon-registry.js";
3
6
  import { useTheme } from "../theme/index.js";
4
- import { cn } from "../theme/tw.js";
5
7
  import { SymbolView } from "expo-symbols";
6
- import { View } from "react-native";
7
- const Icon = ({ name, size = 24, color, className, style, accessible, accessibilityLabel, accessibilityRole, ...viewProps }) => {
8
- const theme = useTheme();
9
- if (typeof name !== "string" || !Object.hasOwn(ICON_MAP, name)) {
10
- throw new Error(`Unknown icon name: ${String(name)}`);
11
- }
12
- if (!Number.isFinite(size) || size <= 0) {
13
- throw new RangeError(`Invalid icon size: ${String(size)}`);
14
- }
15
- if (["type", "customIcon", "fallback", "children"].some((key) => Object.hasOwn(viewProps, key))) {
16
- throw new Error("Display.Icon accepts semantic names, not icon families or custom renderers");
8
+ import { Platform, StyleSheet, Text, View } from "react-native";
9
+ import { jsx as _jsx } from "nativewind/jsx-runtime";
10
+ const FALLBACK = "info";
11
+ const DEFAULT_SIZE = 24;
12
+ const LEGACY_PROPS = ["type", "customIcon", "fallback", "children"];
13
+ const reported = new Set();
14
+ function reportOnce(message) {
15
+ if (!__DEV__ || reported.has(message)) return;
16
+ reported.add(message);
17
+ console.error(`[Display.Icon] ${message}`);
18
+ }
19
+ function isBuiltIn(name) {
20
+ return typeof name === "string" && Object.hasOwn(ICON_MAP, name);
21
+ }
22
+
23
+ /**
24
+ * Rendered inline (not a component): one fiber per icon instead of two.
25
+ * iOS: SF Symbols, native and stateless.
26
+ * Android and web: one Material Symbols glyph in a Text — no effect, no
27
+ * per-instance font load, a single render. Icons keep their size when the
28
+ * system font scale grows, like @expo/vector-icons did.
29
+ */
30
+ function glyph(name, size, color) {
31
+ if (Platform.OS === "ios") {
32
+ return _jsx(SymbolView, {
33
+ accessibilityElementsHidden: true,
34
+ accessible: false,
35
+ importantForAccessibility: "no-hide-descendants",
36
+ name: ICON_MAP[name].sf,
37
+ size: size,
38
+ tintColor: color
39
+ });
40
+ }
41
+ return _jsx(Text, {
42
+ accessibilityElementsHidden: true,
43
+ accessible: false,
44
+ allowFontScaling: false,
45
+ importantForAccessibility: "no-hide-descendants",
46
+ style: [styles.glyph, {
47
+ color,
48
+ fontSize: size,
49
+ lineHeight: size,
50
+ width: size,
51
+ height: size
52
+ }],
53
+ children: String.fromCharCode(MATERIAL_CODEPOINTS[name])
54
+ });
55
+ }
56
+ const Icon = t0 => {
57
+ const $ = _c(4);
58
+ const {
59
+ name,
60
+ size: t1,
61
+ color,
62
+ className,
63
+ style,
64
+ accessible,
65
+ accessibilityLabel,
66
+ accessibilityRole,
67
+ ...rest
68
+ } = t0;
69
+ const size = t1 === undefined ? DEFAULT_SIZE : t1;
70
+ const theme = useTheme();
71
+ const tint = color ?? theme.text.primary;
72
+ const validSize = Number.isFinite(size) && size > 0;
73
+ if (!validSize) {
74
+ reportOnce(`Invalid size ${String(size)}. Using ${DEFAULT_SIZE}.`);
75
+ }
76
+ const glyphSize = validSize ? size : DEFAULT_SIZE;
77
+ const viewProps = {
78
+ ...rest
79
+ };
80
+ for (const key of LEGACY_PROPS) {
81
+ if (!Object.hasOwn(viewProps, key)) {
82
+ continue;
17
83
  }
18
- const icon = ICON_MAP[name];
19
- return (_jsx(View, { ...viewProps, accessibilityLabel: accessibilityLabel, accessibilityRole: accessibilityRole ?? (accessibilityLabel ? "image" : undefined), accessible: accessible ?? Boolean(accessibilityLabel), className: cn("justify-center items-center", className), style: style, children: _jsx(SymbolView, { accessibilityElementsHidden: true, accessible: false, importantForAccessibility: "no-hide-descendants", name: { ios: icon.sf, android: icon.md, web: icon.md }, size: size, tintColor: color ?? theme.text.primary }) }));
84
+ reportOnce(`"${key}" is not supported. Register custom icons with registerIcons().`);
85
+ delete viewProps[key];
86
+ }
87
+ const custom = typeof name === "string" ? customIconRenderer(name) : undefined;
88
+ const builtIn = isBuiltIn(name) ? name : undefined;
89
+ if (!custom && !builtIn) {
90
+ reportOnce(`Unknown icon "${String(name)}". Showing "${FALLBACK}".`);
91
+ }
92
+ let t2;
93
+ if ($[0] !== className) {
94
+ t2 = className ? {
95
+ className
96
+ } : null;
97
+ $[0] = className;
98
+ $[1] = t2;
99
+ } else {
100
+ t2 = $[1];
101
+ }
102
+ let t3;
103
+ if ($[2] !== style) {
104
+ t3 = [styles.box, style];
105
+ $[2] = style;
106
+ $[3] = t3;
107
+ } else {
108
+ t3 = $[3];
109
+ }
110
+ return _jsx(View, {
111
+ ...viewProps,
112
+ ...t2,
113
+ accessibilityLabel: accessibilityLabel,
114
+ accessibilityRole: accessibilityRole ?? (accessibilityLabel ? "image" : undefined),
115
+ accessible: accessible ?? Boolean(accessibilityLabel),
116
+ style: t3,
117
+ children: custom ? custom({
118
+ size: glyphSize,
119
+ color: tint
120
+ }) : glyph(builtIn ?? FALLBACK, glyphSize, tint)
121
+ });
20
122
  };
123
+ const styles = StyleSheet.create({
124
+ box: {
125
+ alignItems: "center",
126
+ justifyContent: "center"
127
+ },
128
+ glyph: {
129
+ fontFamily: ICON_FONT_FAMILY,
130
+ includeFontPadding: false,
131
+ textAlign: "center",
132
+ textAlignVertical: "center"
133
+ }
134
+ });
21
135
  export default Icon;
@@ -1,30 +1,100 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { CountBadge } from "./count-badge.js";
2
3
  import Pressable from "../primitives/Pressable.js";
3
- import { theme } from "../theme/index.js";
4
- import { Typography } from "../Typography/index.js";
5
4
  import { View } from "react-native";
6
- function IconBadge({ children, count, max = 99, dot = false, color, onPress, accessibilityLabel, testID, }) {
7
- const showCount = typeof count === "number" && count > 0;
8
- const showBadge = dot || showCount;
9
- const label = showCount ? (count > max ? `${max}+` : String(count)) : "";
10
- const badgeColor = color ?? theme.danger;
11
- const content = (_jsxs(View, { style: { position: "relative" }, children: [children, showBadge ? (_jsx(View, { style: {
12
- position: "absolute",
13
- top: -4,
14
- right: -6,
15
- minWidth: dot ? 10 : 18,
16
- height: dot ? 10 : 18,
17
- borderRadius: 999,
18
- paddingHorizontal: dot ? 0 : 4,
19
- backgroundColor: badgeColor,
20
- alignItems: "center",
21
- justifyContent: "center",
22
- borderWidth: 2,
23
- borderColor: theme.bg.card,
24
- }, children: !dot && label ? (_jsx(Typography.Text, { style: { color: theme.text.inverse, fontSize: 10, lineHeight: 12 }, children: label })) : null })) : null] }));
25
- if (onPress) {
26
- return (_jsx(Pressable, { accessibilityLabel: accessibilityLabel, hitSlop: 10, onPress: onPress, testID: testID, children: content }));
5
+ import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
6
+ function IconBadge(t0) {
7
+ const $ = _c(19);
8
+ const {
9
+ children,
10
+ count,
11
+ max: t1,
12
+ dot: t2,
13
+ color,
14
+ onPress,
15
+ accessibilityLabel,
16
+ testID
17
+ } = t0;
18
+ const max = t1 === undefined ? 99 : t1;
19
+ const dot = t2 === undefined ? false : t2;
20
+ const showCount = typeof count === "number" && count > 0;
21
+ let t3;
22
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
23
+ t3 = {
24
+ position: "relative"
25
+ };
26
+ $[0] = t3;
27
+ } else {
28
+ t3 = $[0];
29
+ }
30
+ let t4;
31
+ if ($[1] !== color || $[2] !== count || $[3] !== dot || $[4] !== max || $[5] !== showCount) {
32
+ t4 = dot || showCount ? _jsx(CountBadge, {
33
+ anchor: {
34
+ top: -4,
35
+ right: -6
36
+ },
37
+ color: color,
38
+ count: count,
39
+ dot: dot,
40
+ max: max
41
+ }) : null;
42
+ $[1] = color;
43
+ $[2] = count;
44
+ $[3] = dot;
45
+ $[4] = max;
46
+ $[5] = showCount;
47
+ $[6] = t4;
48
+ } else {
49
+ t4 = $[6];
50
+ }
51
+ let t5;
52
+ if ($[7] !== children || $[8] !== t4) {
53
+ t5 = _jsxs(View, {
54
+ style: t3,
55
+ children: [children, t4]
56
+ });
57
+ $[7] = children;
58
+ $[8] = t4;
59
+ $[9] = t5;
60
+ } else {
61
+ t5 = $[9];
62
+ }
63
+ const content = t5;
64
+ if (onPress) {
65
+ let t6;
66
+ if ($[10] !== accessibilityLabel || $[11] !== content || $[12] !== onPress || $[13] !== testID) {
67
+ t6 = _jsx(Pressable, {
68
+ accessibilityLabel: accessibilityLabel,
69
+ hitSlop: 10,
70
+ onPress: onPress,
71
+ testID: testID,
72
+ children: content
73
+ });
74
+ $[10] = accessibilityLabel;
75
+ $[11] = content;
76
+ $[12] = onPress;
77
+ $[13] = testID;
78
+ $[14] = t6;
79
+ } else {
80
+ t6 = $[14];
27
81
  }
28
- return (_jsx(View, { accessibilityLabel: accessibilityLabel, testID: testID, children: content }));
82
+ return t6;
83
+ }
84
+ let t6;
85
+ if ($[15] !== accessibilityLabel || $[16] !== content || $[17] !== testID) {
86
+ t6 = _jsx(View, {
87
+ accessibilityLabel: accessibilityLabel,
88
+ testID: testID,
89
+ children: content
90
+ });
91
+ $[15] = accessibilityLabel;
92
+ $[16] = content;
93
+ $[17] = testID;
94
+ $[18] = t6;
95
+ } else {
96
+ t6 = $[18];
97
+ }
98
+ return t6;
29
99
  }
30
100
  export default IconBadge;
@@ -16,5 +16,11 @@ export interface DisplayImageProps extends Omit<ExpoImageProps, "source" | "styl
16
16
  renderError?: (retry: () => void) => ReactNode;
17
17
  testID?: string;
18
18
  }
19
- declare function DisplayImage(props: DisplayImageProps): import("react").JSX.Element;
19
+ /**
20
+ * One native image view for the life of the component. A new `source` resets the load
21
+ * state in place instead of remounting, so a recycled FlashList cell keeps its view and
22
+ * `recyclingKey` clears the previous picture natively. Each load has a token; events
23
+ * from an older source or attempt cannot settle the current one.
24
+ */
25
+ declare function DisplayImage({ source, width, height, aspectRatio, radius, contentFit, placeholder, fallbackIcon, className, style, containerStyle, renderError, testID, onError, onLoadStart, onLoadEnd, onLoad, accessibilityLabel, accessible, ...imageProps }: DisplayImageProps): import("react").JSX.Element;
20
26
  export default DisplayImage;