@medway-ui/native 1.9.2 → 1.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. package/README.md +2 -2
  2. package/lib/commonjs/components/Alert.js +36 -25
  3. package/lib/commonjs/components/Alert.js.map +1 -1
  4. package/lib/commonjs/components/AlertDialog.js +22 -23
  5. package/lib/commonjs/components/AlertDialog.js.map +1 -1
  6. package/lib/commonjs/components/Avatar.js +4 -4
  7. package/lib/commonjs/components/Badge.js +22 -15
  8. package/lib/commonjs/components/Badge.js.map +1 -1
  9. package/lib/commonjs/components/Button.js +56 -42
  10. package/lib/commonjs/components/Button.js.map +1 -1
  11. package/lib/commonjs/components/CardNews.js +18 -13
  12. package/lib/commonjs/components/CardNews.js.map +1 -1
  13. package/lib/commonjs/components/Carousel.js +12 -8
  14. package/lib/commonjs/components/Carousel.js.map +1 -1
  15. package/lib/commonjs/components/Checkbox.js +5 -5
  16. package/lib/commonjs/components/Checkbox.js.map +1 -1
  17. package/lib/commonjs/components/Chip.js +52 -23
  18. package/lib/commonjs/components/Chip.js.map +1 -1
  19. package/lib/commonjs/components/Choice.js +26 -12
  20. package/lib/commonjs/components/Choice.js.map +1 -1
  21. package/lib/commonjs/components/Dialog.js +16 -8
  22. package/lib/commonjs/components/Dialog.js.map +1 -1
  23. package/lib/commonjs/components/DropdownMenu.js +35 -14
  24. package/lib/commonjs/components/DropdownMenu.js.map +1 -1
  25. package/lib/commonjs/components/EmptyState.js +5 -5
  26. package/lib/commonjs/components/EmptyState.js.map +1 -1
  27. package/lib/commonjs/components/FallbackImage.js +42 -35
  28. package/lib/commonjs/components/FallbackImage.js.map +1 -1
  29. package/lib/commonjs/components/Feed.js +6 -5
  30. package/lib/commonjs/components/Feed.js.map +1 -1
  31. package/lib/commonjs/components/FeedNotice.js +3 -3
  32. package/lib/commonjs/components/Feedback.js +2 -4
  33. package/lib/commonjs/components/Feedback.js.map +1 -1
  34. package/lib/commonjs/components/Filter.js +6 -9
  35. package/lib/commonjs/components/Filter.js.map +1 -1
  36. package/lib/commonjs/components/IndexLevel.js +4 -4
  37. package/lib/commonjs/components/Input.js +25 -20
  38. package/lib/commonjs/components/Input.js.map +1 -1
  39. package/lib/commonjs/components/InvitePopover.js +19 -8
  40. package/lib/commonjs/components/InvitePopover.js.map +1 -1
  41. package/lib/commonjs/components/Label.js +2 -2
  42. package/lib/commonjs/components/LeaderboardCard.js +3 -2
  43. package/lib/commonjs/components/LeaderboardCard.js.map +1 -1
  44. package/lib/commonjs/components/Loading.js +18 -15
  45. package/lib/commonjs/components/Loading.js.map +1 -1
  46. package/lib/commonjs/components/LoadingOverlay.js +36 -43
  47. package/lib/commonjs/components/LoadingOverlay.js.map +1 -1
  48. package/lib/commonjs/components/MemberRow.js +7 -6
  49. package/lib/commonjs/components/MemberRow.js.map +1 -1
  50. package/lib/commonjs/components/PageHeader.js +3 -2
  51. package/lib/commonjs/components/PageHeader.js.map +1 -1
  52. package/lib/commonjs/components/Popover.js +1 -1
  53. package/lib/commonjs/components/PostForm.js +38 -24
  54. package/lib/commonjs/components/PostForm.js.map +1 -1
  55. package/lib/commonjs/components/PrizeCollection.js +5 -5
  56. package/lib/commonjs/components/PrizeCollection.js.map +1 -1
  57. package/lib/commonjs/components/RadioGroup.js +65 -15
  58. package/lib/commonjs/components/RadioGroup.js.map +1 -1
  59. package/lib/commonjs/components/SectionHeader.js +3 -2
  60. package/lib/commonjs/components/SectionHeader.js.map +1 -1
  61. package/lib/commonjs/components/SegmentControl.js +4 -4
  62. package/lib/commonjs/components/Select.js +7 -6
  63. package/lib/commonjs/components/Select.js.map +1 -1
  64. package/lib/commonjs/components/Separator.js +2 -2
  65. package/lib/commonjs/components/Separator.js.map +1 -1
  66. package/lib/commonjs/components/Sheet.js +17 -11
  67. package/lib/commonjs/components/Sheet.js.map +1 -1
  68. package/lib/commonjs/components/Skeleton.js +2 -2
  69. package/lib/commonjs/components/Skeleton.js.map +1 -1
  70. package/lib/commonjs/components/Switch.js +3 -3
  71. package/lib/commonjs/components/Tabs.js +3 -2
  72. package/lib/commonjs/components/Tabs.js.map +1 -1
  73. package/lib/commonjs/components/Tag.js +52 -32
  74. package/lib/commonjs/components/Tag.js.map +1 -1
  75. package/lib/commonjs/components/Text.js +1 -1
  76. package/lib/commonjs/components/ThemedIcon.js +1 -1
  77. package/lib/commonjs/components/Toast.js +12 -12
  78. package/lib/commonjs/components/Toast.js.map +1 -1
  79. package/lib/commonjs/components/Tooltip.js +2 -2
  80. package/lib/commonjs/editor/NoteEditor.js +190 -67
  81. package/lib/commonjs/editor/NoteEditor.js.map +1 -1
  82. package/lib/commonjs/editor/editorHtml.generated.js +1 -1
  83. package/lib/commonjs/editor/editorHtml.generated.js.map +1 -1
  84. package/lib/commonjs/editor/index.js.map +1 -1
  85. package/lib/commonjs/editor/protocol.js +1 -2
  86. package/lib/commonjs/editor/protocol.js.map +1 -1
  87. package/lib/commonjs/hooks/useThemeColor.js +41 -19
  88. package/lib/commonjs/hooks/useThemeColor.js.map +1 -1
  89. package/lib/commonjs/index.js +46 -46
  90. package/lib/commonjs/lib/backdrop.js +18 -0
  91. package/lib/commonjs/lib/backdrop.js.map +1 -0
  92. package/lib/commonjs/lib/overlay-host.js +5 -3
  93. package/lib/commonjs/lib/overlay-host.js.map +1 -1
  94. package/lib/commonjs/lib/raised-surface.js +1 -1
  95. package/lib/module/components/Alert.js +36 -25
  96. package/lib/module/components/Alert.js.map +1 -1
  97. package/lib/module/components/AlertDialog.js +21 -22
  98. package/lib/module/components/AlertDialog.js.map +1 -1
  99. package/lib/module/components/Avatar.js +4 -4
  100. package/lib/module/components/Badge.js +22 -15
  101. package/lib/module/components/Badge.js.map +1 -1
  102. package/lib/module/components/Button.js +56 -42
  103. package/lib/module/components/Button.js.map +1 -1
  104. package/lib/module/components/CardNews.js +18 -13
  105. package/lib/module/components/CardNews.js.map +1 -1
  106. package/lib/module/components/Carousel.js +12 -8
  107. package/lib/module/components/Carousel.js.map +1 -1
  108. package/lib/module/components/Checkbox.js +5 -5
  109. package/lib/module/components/Checkbox.js.map +1 -1
  110. package/lib/module/components/Chip.js +52 -23
  111. package/lib/module/components/Chip.js.map +1 -1
  112. package/lib/module/components/Choice.js +26 -12
  113. package/lib/module/components/Choice.js.map +1 -1
  114. package/lib/module/components/Dialog.js +16 -8
  115. package/lib/module/components/Dialog.js.map +1 -1
  116. package/lib/module/components/DropdownMenu.js +36 -15
  117. package/lib/module/components/DropdownMenu.js.map +1 -1
  118. package/lib/module/components/EmptyState.js +5 -5
  119. package/lib/module/components/EmptyState.js.map +1 -1
  120. package/lib/module/components/FallbackImage.js +42 -35
  121. package/lib/module/components/FallbackImage.js.map +1 -1
  122. package/lib/module/components/Feed.js +6 -5
  123. package/lib/module/components/Feed.js.map +1 -1
  124. package/lib/module/components/FeedNotice.js +3 -3
  125. package/lib/module/components/Feedback.js +2 -4
  126. package/lib/module/components/Feedback.js.map +1 -1
  127. package/lib/module/components/Filter.js +6 -9
  128. package/lib/module/components/Filter.js.map +1 -1
  129. package/lib/module/components/IndexLevel.js +4 -4
  130. package/lib/module/components/Input.js +24 -18
  131. package/lib/module/components/Input.js.map +1 -1
  132. package/lib/module/components/InvitePopover.js +20 -9
  133. package/lib/module/components/InvitePopover.js.map +1 -1
  134. package/lib/module/components/Label.js +2 -2
  135. package/lib/module/components/LeaderboardCard.js +3 -2
  136. package/lib/module/components/LeaderboardCard.js.map +1 -1
  137. package/lib/module/components/Loading.js +18 -15
  138. package/lib/module/components/Loading.js.map +1 -1
  139. package/lib/module/components/LoadingOverlay.js +37 -44
  140. package/lib/module/components/LoadingOverlay.js.map +1 -1
  141. package/lib/module/components/MemberRow.js +7 -6
  142. package/lib/module/components/MemberRow.js.map +1 -1
  143. package/lib/module/components/PageHeader.js +3 -2
  144. package/lib/module/components/PageHeader.js.map +1 -1
  145. package/lib/module/components/Popover.js +1 -1
  146. package/lib/module/components/PostForm.js +38 -24
  147. package/lib/module/components/PostForm.js.map +1 -1
  148. package/lib/module/components/PrizeCollection.js +5 -5
  149. package/lib/module/components/PrizeCollection.js.map +1 -1
  150. package/lib/module/components/RadioGroup.js +65 -15
  151. package/lib/module/components/RadioGroup.js.map +1 -1
  152. package/lib/module/components/SectionHeader.js +3 -2
  153. package/lib/module/components/SectionHeader.js.map +1 -1
  154. package/lib/module/components/SegmentControl.js +4 -4
  155. package/lib/module/components/Select.js +6 -5
  156. package/lib/module/components/Select.js.map +1 -1
  157. package/lib/module/components/Separator.js +2 -2
  158. package/lib/module/components/Separator.js.map +1 -1
  159. package/lib/module/components/Sheet.js +17 -11
  160. package/lib/module/components/Sheet.js.map +1 -1
  161. package/lib/module/components/Skeleton.js +2 -2
  162. package/lib/module/components/Skeleton.js.map +1 -1
  163. package/lib/module/components/Switch.js +3 -3
  164. package/lib/module/components/Tabs.js +3 -2
  165. package/lib/module/components/Tabs.js.map +1 -1
  166. package/lib/module/components/Tag.js +52 -32
  167. package/lib/module/components/Tag.js.map +1 -1
  168. package/lib/module/components/Text.js +1 -1
  169. package/lib/module/components/ThemedIcon.js +1 -1
  170. package/lib/module/components/Toast.js +12 -12
  171. package/lib/module/components/Toast.js.map +1 -1
  172. package/lib/module/components/Tooltip.js +2 -2
  173. package/lib/module/editor/NoteEditor.js +193 -69
  174. package/lib/module/editor/NoteEditor.js.map +1 -1
  175. package/lib/module/editor/editorHtml.generated.js +1 -1
  176. package/lib/module/editor/editorHtml.generated.js.map +1 -1
  177. package/lib/module/editor/index.js.map +1 -1
  178. package/lib/module/editor/protocol.js +1 -2
  179. package/lib/module/editor/protocol.js.map +1 -1
  180. package/lib/module/hooks/useThemeColor.js +41 -19
  181. package/lib/module/hooks/useThemeColor.js.map +1 -1
  182. package/lib/module/index.js +46 -46
  183. package/lib/module/lib/backdrop.js +15 -0
  184. package/lib/module/lib/backdrop.js.map +1 -0
  185. package/lib/module/lib/overlay-host.js +6 -4
  186. package/lib/module/lib/overlay-host.js.map +1 -1
  187. package/lib/module/lib/raised-surface.js +1 -1
  188. package/lib/typescript/components/Alert.d.ts +1 -1
  189. package/lib/typescript/components/Alert.d.ts.map +1 -1
  190. package/lib/typescript/components/AlertDialog.d.ts +1 -1
  191. package/lib/typescript/components/AlertDialog.d.ts.map +1 -1
  192. package/lib/typescript/components/Badge.d.ts.map +1 -1
  193. package/lib/typescript/components/Button.d.ts +1 -0
  194. package/lib/typescript/components/Button.d.ts.map +1 -1
  195. package/lib/typescript/components/CardNews.d.ts +7 -2
  196. package/lib/typescript/components/CardNews.d.ts.map +1 -1
  197. package/lib/typescript/components/Checkbox.d.ts +3 -1
  198. package/lib/typescript/components/Checkbox.d.ts.map +1 -1
  199. package/lib/typescript/components/Chip.d.ts.map +1 -1
  200. package/lib/typescript/components/Choice.d.ts +4 -1
  201. package/lib/typescript/components/Choice.d.ts.map +1 -1
  202. package/lib/typescript/components/Dialog.d.ts +2 -1
  203. package/lib/typescript/components/Dialog.d.ts.map +1 -1
  204. package/lib/typescript/components/DropdownMenu.d.ts +3 -2
  205. package/lib/typescript/components/DropdownMenu.d.ts.map +1 -1
  206. package/lib/typescript/components/FallbackImage.d.ts.map +1 -1
  207. package/lib/typescript/components/Feed.d.ts.map +1 -1
  208. package/lib/typescript/components/Feedback.d.ts.map +1 -1
  209. package/lib/typescript/components/Filter.d.ts.map +1 -1
  210. package/lib/typescript/components/IndexLevel.d.ts +1 -1
  211. package/lib/typescript/components/Input.d.ts +5 -5
  212. package/lib/typescript/components/Input.d.ts.map +1 -1
  213. package/lib/typescript/components/InvitePopover.d.ts +1 -1
  214. package/lib/typescript/components/InvitePopover.d.ts.map +1 -1
  215. package/lib/typescript/components/LeaderboardCard.d.ts.map +1 -1
  216. package/lib/typescript/components/Loading.d.ts +1 -1
  217. package/lib/typescript/components/Loading.d.ts.map +1 -1
  218. package/lib/typescript/components/LoadingOverlay.d.ts +9 -9
  219. package/lib/typescript/components/LoadingOverlay.d.ts.map +1 -1
  220. package/lib/typescript/components/PageHeader.d.ts.map +1 -1
  221. package/lib/typescript/components/PostForm.d.ts.map +1 -1
  222. package/lib/typescript/components/RadioGroup.d.ts +4 -2
  223. package/lib/typescript/components/RadioGroup.d.ts.map +1 -1
  224. package/lib/typescript/components/SectionHeader.d.ts.map +1 -1
  225. package/lib/typescript/components/SegmentControl.d.ts +1 -1
  226. package/lib/typescript/components/Select.d.ts +2 -1
  227. package/lib/typescript/components/Select.d.ts.map +1 -1
  228. package/lib/typescript/components/Separator.d.ts.map +1 -1
  229. package/lib/typescript/components/Sheet.d.ts +2 -1
  230. package/lib/typescript/components/Sheet.d.ts.map +1 -1
  231. package/lib/typescript/components/Tabs.d.ts +4 -3
  232. package/lib/typescript/components/Tabs.d.ts.map +1 -1
  233. package/lib/typescript/components/Tag.d.ts +3 -1
  234. package/lib/typescript/components/Tag.d.ts.map +1 -1
  235. package/lib/typescript/components/ThemedIcon.d.ts +1 -1
  236. package/lib/typescript/components/Toast.d.ts +1 -1
  237. package/lib/typescript/components/Toast.d.ts.map +1 -1
  238. package/lib/typescript/editor/NoteEditor.d.ts +28 -8
  239. package/lib/typescript/editor/NoteEditor.d.ts.map +1 -1
  240. package/lib/typescript/editor/editorHtml.generated.d.ts.map +1 -1
  241. package/lib/typescript/editor/index.d.ts +1 -1
  242. package/lib/typescript/editor/index.d.ts.map +1 -1
  243. package/lib/typescript/editor/protocol.d.ts +4 -14
  244. package/lib/typescript/editor/protocol.d.ts.map +1 -1
  245. package/lib/typescript/hooks/use-toast.d.ts +1 -1
  246. package/lib/typescript/hooks/useThemeColor.d.ts.map +1 -1
  247. package/lib/typescript/index.d.ts +91 -91
  248. package/lib/typescript/index.d.ts.map +1 -1
  249. package/lib/typescript/lib/backdrop.d.ts +4 -0
  250. package/lib/typescript/lib/backdrop.d.ts.map +1 -0
  251. package/lib/typescript/lib/overlay-host.d.ts +1 -0
  252. package/lib/typescript/lib/overlay-host.d.ts.map +1 -1
  253. package/package.json +9 -14
  254. package/setup/tailwind.js +16 -8
  255. package/setup/tokens.native.css +181 -80
  256. package/src/components/Alert.tsx +37 -20
  257. package/src/components/AlertDialog.tsx +18 -19
  258. package/src/components/Badge.tsx +16 -15
  259. package/src/components/Button.tsx +64 -31
  260. package/src/components/CardNews.tsx +17 -6
  261. package/src/components/Carousel.tsx +5 -5
  262. package/src/components/Checkbox.tsx +17 -7
  263. package/src/components/Chip.tsx +49 -21
  264. package/src/components/Choice.tsx +34 -14
  265. package/src/components/Dialog.tsx +15 -5
  266. package/src/components/DropdownMenu.tsx +62 -14
  267. package/src/components/EmptyState.tsx +3 -3
  268. package/src/components/FallbackImage.tsx +32 -23
  269. package/src/components/Feed.tsx +2 -1
  270. package/src/components/Feedback.tsx +0 -1
  271. package/src/components/Filter.tsx +2 -3
  272. package/src/components/Input.tsx +83 -64
  273. package/src/components/InvitePopover.tsx +11 -3
  274. package/src/components/LeaderboardCard.tsx +4 -1
  275. package/src/components/Loading.tsx +17 -14
  276. package/src/components/LoadingOverlay.tsx +33 -50
  277. package/src/components/MemberRow.tsx +3 -3
  278. package/src/components/PageHeader.tsx +4 -1
  279. package/src/components/PostForm.tsx +28 -16
  280. package/src/components/PrizeCollection.tsx +3 -3
  281. package/src/components/RadioGroup.tsx +69 -12
  282. package/src/components/SectionHeader.tsx +4 -1
  283. package/src/components/Select.tsx +4 -3
  284. package/src/components/Separator.tsx +2 -2
  285. package/src/components/Sheet.tsx +15 -8
  286. package/src/components/Skeleton.tsx +1 -1
  287. package/src/components/Tabs.tsx +5 -4
  288. package/src/components/Tag.tsx +56 -35
  289. package/src/components/Toast.tsx +10 -6
  290. package/src/editor/NoteEditor.tsx +246 -72
  291. package/src/editor/editorHtml.generated.ts +1 -1
  292. package/src/editor/index.ts +8 -4
  293. package/src/editor/protocol.ts +4 -12
  294. package/src/hooks/useThemeColor.ts +41 -19
  295. package/src/index.ts +1 -1
  296. package/src/lib/backdrop.ts +16 -0
  297. package/src/lib/overlay-host.tsx +5 -5
@@ -1,6 +1,6 @@
1
1
  import { useEffect, type ReactNode } from "react";
2
2
  import { Modal, View, type ModalProps, type ViewProps } from "react-native";
3
- import Svg, { Circle } from "react-native-svg";
3
+ import Svg, { Circle, Path } from "react-native-svg";
4
4
  import Animated, {
5
5
  cancelAnimation,
6
6
  Easing,
@@ -16,20 +16,20 @@ import { useThemeColor, type ThemeColorToken } from "@/hooks/useThemeColor";
16
16
  import { cn } from "@/lib/utils";
17
17
 
18
18
  interface LoadingOverlaySpinnerProps {
19
- /** Icon rendered at the center of the ring, e.g. `<ThemedIcon icon={Brain} />`. */
19
+ /** Icon rendered at the center of the ring. Defaults to the Medway "m"; pass `null` to show only the ring. */
20
20
  icon?: ReactNode;
21
21
  /** Ring diameter in px. Defaults to 72. */
22
22
  size?: number;
23
- /** Ring stroke width in px. Defaults to 2. */
23
+ /** Ring stroke width in px. Defaults to 2.16. */
24
24
  trackWidth?: number;
25
- /** Theme token for the spinning arc. Defaults to `gray-stroke-muted`. */
25
+ /** Theme token for the spinning arc. Defaults to `gray-stroke`. */
26
26
  colorToken?: ThemeColorToken;
27
27
  /** Explicit arc color. Takes precedence over `colorToken`. */
28
28
  color?: string;
29
- /** Theme token for the track behind the arc. The track is hidden when omitted. */
30
- trackColorToken?: ThemeColorToken;
31
- /** Pulses the center icon opacity. Defaults to true. */
29
+ /** Pulses the center icon opacity from 20% to 100% every 400ms. Defaults to true. */
32
30
  pulse?: boolean;
31
+ /** @deprecated No effect: the ring has no track, as in Figma. Removed in the next major. */
32
+ trackColorToken?: ThemeColorToken;
33
33
  }
34
34
 
35
35
  interface LoadingOverlayCardProps
@@ -60,39 +60,31 @@ interface LoadingOverlayProps extends LoadingOverlayCardProps {
60
60
  modalProps?: Omit<ModalProps, "visible" | "onRequestClose" | "children">;
61
61
  }
62
62
 
63
- /** Rendered only when a track token is set, so the default case skips the color lookup. */
64
- function SpinnerTrack({
65
- size,
66
- radius,
67
- strokeWidth,
68
- colorToken,
69
- }: {
70
- size: number;
71
- radius: number;
72
- strokeWidth: number;
73
- colorToken: ThemeColorToken;
74
- }) {
75
- const color = useThemeColor(colorToken);
63
+ const SPIN_DURATION_MS = 1600;
64
+ const PULSE_TIMING = { duration: 400, easing: Easing.linear };
65
+ const PULSE_MIN_OPACITY = 0.2;
66
+ const LOGO_SHORT_GLYPH_VIEWBOX = "0 10.4159 59.65 41.85";
67
+ const LOGO_SHORT_GLYPH_PATH =
68
+ "M42.33 10.8959C37.32 10.8959 32.8 12.8259 29.64 15.8959C26.55 12.5459 21.96 10.4159 16.83 10.4159C8.54 10.4159 1.65 15.9859 0.25 23.3059C0.09 24.1959 0 25.1159 0 26.0459V50.4759C0 51.4659 0.8 52.2659 1.79 52.2659H9.76C10.75 52.2659 11.55 51.4659 11.55 50.4759V28.8559C11.55 25.8359 13.98 22.8859 16.97 22.4959C19.03 22.2259 20.91 22.9659 22.22 24.2759C23.35 25.4059 24.05 26.9659 24.05 28.6959V50.4759C24.05 51.4659 24.85 52.2659 25.84 52.2659H33.81C34.8 52.2659 35.6 51.4659 35.6 50.4759V28.8559C35.6 25.8359 38.03 22.8859 41.02 22.4959C43.08 22.2259 44.96 22.9659 46.27 24.2759C47.4 25.4059 48.1 26.9659 48.1 28.6959V50.4759C48.1 51.4659 48.9 52.2659 49.89 52.2659H57.86C58.85 52.2659 59.65 51.4659 59.65 50.4759V26.5259C59.65 25.0959 59.44 23.7159 59.04 22.3959C57.03 15.7659 50.31 10.8959 42.33 10.8959Z";
69
+
70
+ function LoadingOverlayMark() {
71
+ const color = useThemeColor("secondary-stroke-emphasis");
76
72
 
77
73
  return (
78
- <Circle
79
- cx={size / 2}
80
- cy={size / 2}
81
- r={radius}
82
- stroke={color}
83
- strokeWidth={strokeWidth}
84
- fill="none"
85
- />
74
+ <Svg width={20} height={14} viewBox={LOGO_SHORT_GLYPH_VIEWBOX}>
75
+ <Path d={LOGO_SHORT_GLYPH_PATH} fill={color} />
76
+ </Svg>
86
77
  );
87
78
  }
88
79
 
80
+ const DEFAULT_ICON = <LoadingOverlayMark />;
81
+
89
82
  function LoadingOverlaySpinner({
90
- icon,
83
+ icon = DEFAULT_ICON,
91
84
  size = 72,
92
- trackWidth = 2,
93
- colorToken = "gray-stroke-muted",
85
+ trackWidth = 2.16,
86
+ colorToken = "gray-stroke",
94
87
  color,
95
- trackColorToken,
96
88
  pulse = true,
97
89
  }: LoadingOverlaySpinnerProps) {
98
90
  const themeColor = useThemeColor(colorToken);
@@ -104,7 +96,7 @@ function LoadingOverlaySpinner({
104
96
 
105
97
  useEffect(() => {
106
98
  rotation.value = withRepeat(
107
- withTiming(360, { duration: 1000, easing: Easing.linear }),
99
+ withTiming(360, { duration: SPIN_DURATION_MS, easing: Easing.linear }),
108
100
  -1,
109
101
  false
110
102
  );
@@ -117,11 +109,11 @@ function LoadingOverlaySpinner({
117
109
  opacity.value = 1;
118
110
  return;
119
111
  }
120
- opacity.value = 0.4;
112
+ opacity.value = PULSE_MIN_OPACITY;
121
113
  opacity.value = withRepeat(
122
114
  withSequence(
123
- withTiming(1, { duration: 400 }),
124
- withTiming(0.4, { duration: 400 })
115
+ withTiming(1, PULSE_TIMING),
116
+ withTiming(PULSE_MIN_OPACITY, PULSE_TIMING)
125
117
  ),
126
118
  -1,
127
119
  false
@@ -147,14 +139,6 @@ function LoadingOverlaySpinner({
147
139
  >
148
140
  <Animated.View style={[{ position: "absolute" }, ringStyle]}>
149
141
  <Svg width={size} height={size} viewBox={`0 0 ${size} ${size}`}>
150
- {trackColorToken ? (
151
- <SpinnerTrack
152
- size={size}
153
- radius={radius}
154
- strokeWidth={trackWidth}
155
- colorToken={trackColorToken}
156
- />
157
- ) : null}
158
142
  <Circle
159
143
  cx={size / 2}
160
144
  cy={size / 2}
@@ -189,8 +173,8 @@ function LoadingOverlayCard({
189
173
  trackWidth,
190
174
  colorToken,
191
175
  color,
192
- trackColorToken,
193
176
  pulse,
177
+ trackColorToken: _trackColorToken,
194
178
  text = "Carregando...",
195
179
  description,
196
180
  children,
@@ -203,7 +187,7 @@ function LoadingOverlayCard({
203
187
  return (
204
188
  <View
205
189
  className={cn(
206
- "w-full min-h-[230px] items-center justify-center gap-6 rounded-xl bg-surface-card p-10",
190
+ "w-full min-h-[230px] items-center justify-center gap-6 rounded-lg bg-surface-card p-10",
207
191
  className
208
192
  )}
209
193
  {...props}
@@ -218,7 +202,7 @@ function LoadingOverlayCard({
218
202
  }
219
203
  accessibilityState={{ busy: true }}
220
204
  accessibilityLiveRegion="polite"
221
- className="w-full items-center gap-6"
205
+ className="w-full items-center gap-4"
222
206
  >
223
207
  <LoadingOverlaySpinner
224
208
  icon={icon}
@@ -226,7 +210,6 @@ function LoadingOverlayCard({
226
210
  trackWidth={trackWidth}
227
211
  colorToken={colorToken}
228
212
  color={color}
229
- trackColorToken={trackColorToken}
230
213
  pulse={pulse}
231
214
  />
232
215
 
@@ -235,7 +218,7 @@ function LoadingOverlayCard({
235
218
  {text ? (
236
219
  <Text
237
220
  className={cn(
238
- "text-center text-sm font-semibold text-content-title",
221
+ "text-center text-xs font-semibold leading-xs text-content-title",
239
222
  textClassName
240
223
  )}
241
224
  >
@@ -245,7 +228,7 @@ function LoadingOverlayCard({
245
228
  {description ? (
246
229
  <Text
247
230
  className={cn(
248
- "text-center text-sm font-medium text-content-paragraph",
231
+ "text-center text-xs font-medium leading-xs text-content-paragraph",
249
232
  descriptionClassName
250
233
  )}
251
234
  >
@@ -1,4 +1,4 @@
1
- import { cva, type VariantProps } from "class-variance-authority";
1
+ import { cva } from "class-variance-authority";
2
2
  import { type ReactNode } from "react";
3
3
  import { View, type ViewProps } from "react-native";
4
4
 
@@ -11,7 +11,7 @@ import { cn } from "@/lib/utils";
11
11
  const rankIndicatorVariants = cva("size-[22px] rounded-full", {
12
12
  variants: {
13
13
  rank: {
14
- 1: "bg-yellow-background-fill",
14
+ 1: "bg-feedback-warning-background-fill",
15
15
  2: "bg-gray-background-fill",
16
16
  3: "bg-bronze-background-fill",
17
17
  },
@@ -102,7 +102,7 @@ function MemberRow({
102
102
  {...props}
103
103
  >
104
104
  <View className="min-w-0 flex-1 flex-row items-center gap-4">
105
- <RadioGroupItem value={value} size="md" />
105
+ <RadioGroupItem value={value} size="md" accessibilityLabel={name} />
106
106
  <View className="min-w-0 flex-1 flex-row items-center gap-2">
107
107
  <Avatar size="sm" alt={avatarAlt ?? name}>
108
108
  {avatarSrc ? <AvatarImage src={avatarSrc} /> : null}
@@ -32,7 +32,10 @@ function PageHeader({
32
32
  <View className="flex-row items-start gap-3">
33
33
  {icon}
34
34
  <View className="flex-1 gap-1">
35
- <Text className="text-title-xs font-semibold text-primary-foreground">
35
+ <Text
36
+ accessibilityRole="header"
37
+ className="text-title-xs font-semibold text-primary-foreground"
38
+ >
36
39
  {title}
37
40
  </Text>
38
41
  {description ? (
@@ -7,6 +7,7 @@ import { Button } from "@/components/Button";
7
7
  import { Checkbox } from "@/components/Checkbox";
8
8
  import { Input, InputText, inputVariants } from "@/components/Input";
9
9
  import { useTrackedText } from "@/hooks/useTrackedText";
10
+ import { fontFamilyMedium } from "@/lib/typography";
10
11
  import { cn } from "@/lib/utils";
11
12
 
12
13
  interface PostFormProps extends ViewProps {
@@ -149,7 +150,7 @@ function PostFormDescription({
149
150
  )}
150
151
  accessibilityLabel={placeholder}
151
152
  {...props}
152
- style={[{ fontFamily: "MontserratMedium" }, props.style]}
153
+ style={[{ fontFamily: fontFamilyMedium }, props.style]}
153
154
  />
154
155
  <InputText className="text-right text-xs font-medium text-gray-foreground">
155
156
  {text.length} / {maxLength}
@@ -172,7 +173,13 @@ function PostFormDateTimeField({
172
173
  {label ? (
173
174
  <Text className="text-sm font-medium text-gray-foreground">{label}</Text>
174
175
  ) : null}
175
- <Pressable accessibilityRole="button" onPress={onPress} disabled={!onPress}>
176
+ <Pressable
177
+ accessibilityRole="button"
178
+ accessibilityLabel={label ?? placeholder}
179
+ accessibilityValue={value ? { text: value } : undefined}
180
+ onPress={onPress}
181
+ disabled={!onPress}
182
+ >
176
183
  <View pointerEvents="none">
177
184
  <Input
178
185
  size="lg"
@@ -216,24 +223,29 @@ function PostFormCheckboxOption({
216
223
  className={cn("flex-row items-start gap-3", disabled ? "opacity-50" : "", className)}
217
224
  {...props}
218
225
  >
219
- <Checkbox
220
- size="lg"
221
- checked={isChecked}
222
- onCheckedChange={handleCheckedChange}
223
- disabled={disabled}
224
- />
225
226
  <Pressable
226
- accessibilityRole="button"
227
+ accessibilityRole="checkbox"
228
+ accessibilityState={{ checked: isChecked, disabled: !!disabled }}
227
229
  disabled={disabled}
228
230
  onPress={toggle}
229
- className="min-w-0 flex-1 gap-1 pb-2"
231
+ className="min-w-0 flex-1 flex-row items-start gap-3"
230
232
  >
231
- <Text className="text-md font-semibold text-gray-foreground">{title}</Text>
232
- {description ? (
233
- <Text className="text-xs font-medium text-gray-foreground">
234
- {description}
235
- </Text>
236
- ) : null}
233
+ <Checkbox
234
+ size="lg"
235
+ checked={isChecked}
236
+ onCheckedChange={handleCheckedChange}
237
+ disabled={disabled}
238
+ accessible={false}
239
+ importantForAccessibility="no-hide-descendants"
240
+ />
241
+ <View className="min-w-0 flex-1 gap-1 pb-2">
242
+ <Text className="text-md font-semibold text-gray-foreground">{title}</Text>
243
+ {description ? (
244
+ <Text className="text-xs font-medium text-gray-foreground">
245
+ {description}
246
+ </Text>
247
+ ) : null}
248
+ </View>
237
249
  </Pressable>
238
250
  </View>
239
251
  );
@@ -35,7 +35,7 @@ interface PrizeItemProps extends ViewProps {
35
35
  }
36
36
 
37
37
  const rankColors: Record<1 | 2 | 3, string> = {
38
- 1: "bg-yellow-background-fill",
38
+ 1: "bg-feedback-warning-background-fill",
39
39
  2: "bg-gray-background-fill",
40
40
  3: "bg-bronze-background-fill",
41
41
  };
@@ -147,8 +147,8 @@ function PrizeItem({
147
147
  {...props}
148
148
  >
149
149
  {isNew ? (
150
- <View className="absolute -right-1 -top-1 rounded-md bg-green-background-fill px-2 py-1">
151
- <Text className="text-xs font-semibold text-green-foreground-onfill">
150
+ <View className="absolute -right-1 -top-1 rounded-md bg-feedback-success-background-fill px-2 py-1">
151
+ <Text className="text-xs font-semibold text-feedback-success-foreground-onfill">
152
152
  Novo
153
153
  </Text>
154
154
  </View>
@@ -1,18 +1,25 @@
1
1
  import { View, type ViewProps } from "react-native";
2
2
  import * as RadioGroupPrimitive from "@rn-primitives/radio-group";
3
3
  import { cva, type VariantProps } from "class-variance-authority";
4
- import { type ReactNode } from "react";
4
+ import { createContext, useContext, useMemo, type ReactNode } from "react";
5
5
  import { cn } from "@/lib/utils";
6
6
  import { getMinTouchHitSlop } from "@/lib/touch-target";
7
7
 
8
8
  interface RadioGroupItemProps
9
9
  extends RadioGroupPrimitive.ItemProps,
10
- VariantProps<typeof radioGroupVariants> {}
10
+ Omit<VariantProps<typeof radioGroupVariants>, "checked" | "disabled"> {}
11
+
12
+ interface RadioGroupState {
13
+ value: string | undefined;
14
+ disabled: boolean;
15
+ }
16
+
17
+ const RadioGroupStateContext = createContext<RadioGroupState | null>(null);
11
18
 
12
19
  const INNER_DOT_SIZES: Record<"sm" | "md" | "lg", number> = {
13
- sm: 8,
14
- md: 10,
15
- lg: 14,
20
+ sm: 6,
21
+ md: 6,
22
+ lg: 8,
16
23
  };
17
24
 
18
25
  const RADIO_DIMENSIONS: Record<"sm" | "md" | "lg", number> = {
@@ -33,34 +40,82 @@ const radioGroupVariants = cva(
33
40
  variant: {
34
41
  regular: "",
35
42
  },
43
+ checked: {
44
+ true: "bg-primary-background-fill border-primary-background-fill",
45
+ false: "",
46
+ },
47
+ disabled: {
48
+ true: "bg-gray-background-soft-muted border-gray-stroke-muted",
49
+ false: "",
50
+ },
36
51
  },
37
52
  defaultVariants: {
38
53
  size: "md",
39
54
  variant: "regular",
55
+ checked: false,
56
+ disabled: false,
40
57
  },
41
58
  }
42
59
  );
43
60
 
61
+ function getDotClassName(state: { checked: boolean; disabled: boolean }) {
62
+ if (state.disabled) return "bg-gray-background-fill-muted";
63
+ return state.checked ? "bg-primary-foreground-onfill" : "bg-primary-background-fill";
64
+ }
65
+
66
+ function RadioGroupStateProvider({
67
+ value,
68
+ disabled = false,
69
+ children,
70
+ }: {
71
+ value: string | undefined;
72
+ disabled?: boolean;
73
+ children: ReactNode;
74
+ }) {
75
+ const state = useMemo(() => ({ value, disabled }), [value, disabled]);
76
+
77
+ return (
78
+ <RadioGroupStateContext.Provider value={state}>{children}</RadioGroupStateContext.Provider>
79
+ );
80
+ }
81
+
44
82
  function RadioGroup({ className, ...props }: RadioGroupPrimitive.RootProps) {
45
83
  return (
46
- <RadioGroupPrimitive.Root className={cn("gap-3", className)} {...props} />
84
+ <RadioGroupStateProvider value={props.value} disabled={props.disabled}>
85
+ <RadioGroupPrimitive.Root className={cn("gap-3", className)} {...props} />
86
+ </RadioGroupStateProvider>
47
87
  );
48
88
  }
49
89
 
50
- function RadioGroupItem({ className, size = "md", variant, ...props }: RadioGroupItemProps) {
90
+ function RadioGroupItem({
91
+ className,
92
+ size = "md",
93
+ variant,
94
+ value,
95
+ disabled,
96
+ ...props
97
+ }: RadioGroupItemProps) {
98
+ const group = useContext(RadioGroupStateContext);
51
99
  const resolvedSize = size ?? "md";
52
100
  const dotSize = INNER_DOT_SIZES[resolvedSize];
101
+ const checked = group?.value === value;
102
+ const isDisabled = Boolean(group?.disabled || disabled);
53
103
 
54
104
  return (
55
105
  <RadioGroupPrimitive.Item
56
106
  hitSlop={getMinTouchHitSlop(RADIO_DIMENSIONS[resolvedSize])}
57
- className={cn(radioGroupVariants({ size, variant }), className)}
107
+ className={cn(
108
+ radioGroupVariants({ size, variant, checked, disabled: isDisabled }),
109
+ className
110
+ )}
111
+ value={value}
112
+ disabled={disabled}
58
113
  {...props}
59
114
  >
60
115
  <RadioGroupPrimitive.Indicator className="items-center justify-center">
61
116
  <View
62
117
  style={{ width: dotSize, height: dotSize, borderRadius: dotSize / 2 }}
63
- className="bg-primary-background-fill"
118
+ className={getDotClassName({ checked, disabled: isDisabled })}
64
119
  />
65
120
  </RadioGroupPrimitive.Indicator>
66
121
  </RadioGroupPrimitive.Item>
@@ -74,9 +129,11 @@ interface RadioGroupListProps extends RadioGroupPrimitive.RootProps {
74
129
 
75
130
  function RadioGroupList({ className, children, ...props }: RadioGroupListProps) {
76
131
  return (
77
- <RadioGroupPrimitive.Root className={cn("gap-0", className)} {...props}>
78
- {children}
79
- </RadioGroupPrimitive.Root>
132
+ <RadioGroupStateProvider value={props.value} disabled={props.disabled}>
133
+ <RadioGroupPrimitive.Root className={cn("gap-0", className)} {...props}>
134
+ {children}
135
+ </RadioGroupPrimitive.Root>
136
+ </RadioGroupStateProvider>
80
137
  );
81
138
  }
82
139
 
@@ -25,7 +25,10 @@ function SectionHeader({
25
25
  {...props}
26
26
  >
27
27
  <View className="min-w-0 flex-1 gap-0">
28
- <Text className="text-title-xs font-semibold text-primary-foreground">
28
+ <Text
29
+ accessibilityRole="header"
30
+ className="text-title-xs font-semibold text-primary-foreground"
31
+ >
29
32
  {title}
30
33
  </Text>
31
34
  {subtitle != null ? (
@@ -7,7 +7,8 @@ import React, {
7
7
  type ReactNode,
8
8
  type ReactElement,
9
9
  } from "react";
10
- import { View, Text, type ViewProps, type TextProps } from "react-native";
10
+ import { View, type ViewProps } from "react-native";
11
+ import { Text, type TextProps } from "@/components/Text";
11
12
  import * as SelectPrimitive from "@rn-primitives/select";
12
13
  import { cva } from "class-variance-authority";
13
14
  import { cn } from "@/lib/utils";
@@ -101,7 +102,7 @@ function SelectValue({ className, placeholder, ...props }: SelectPrimitive.Value
101
102
  return (
102
103
  <SelectPrimitive.Value
103
104
  className={cn(
104
- "text-gray-foreground flex-1",
105
+ "text-gray-foreground font-regular flex-1",
105
106
  size === "lg" ? "text-md" : "text-sm",
106
107
  className
107
108
  )}
@@ -155,7 +156,7 @@ function SelectItem({ className, children, icon, label, ...props }: SelectItemPr
155
156
  <SelectPrimitive.Item
156
157
  label={resolvedLabel}
157
158
  className={cn(
158
- "relative flex-row w-full items-center rounded px-2 gap-3",
159
+ "relative flex-row w-full items-center rounded-sm px-2 gap-3",
159
160
  size === "lg" ? "py-2" : "py-1.5",
160
161
  "active:bg-secondary-background-soft-emphasis",
161
162
  className
@@ -1,4 +1,4 @@
1
- import { View, type ViewProps, type AccessibilityRole } from "react-native";
1
+ import { View, type ViewProps } from "react-native";
2
2
  import { cn } from "@/lib/utils";
3
3
 
4
4
  interface SeparatorProps extends ViewProps {
@@ -9,7 +9,7 @@ interface SeparatorProps extends ViewProps {
9
9
  function Separator({ className, orientation = "horizontal", decorative = true, ...props }: SeparatorProps) {
10
10
  return (
11
11
  <View
12
- accessibilityRole={decorative ? undefined : ("separator" as AccessibilityRole)}
12
+ role={decorative ? undefined : "separator"}
13
13
  className={cn(
14
14
  "shrink-0 bg-gray-stroke-muted",
15
15
  orientation === "horizontal" ? "h-px w-full" : "w-px h-full",
@@ -3,6 +3,7 @@ import { View, ScrollView, type ViewProps } from "react-native";
3
3
  import * as DialogPrimitive from "@rn-primitives/dialog";
4
4
  import { CloseMd } from "@medway-ui/icons/native";
5
5
  import { useThemeColor } from "@/hooks/useThemeColor";
6
+ import { useBackdropStyle } from "@/lib/backdrop";
6
7
  import { cn } from "@/lib/utils";
7
8
  import { Separator } from "@/components/Separator";
8
9
 
@@ -12,6 +13,7 @@ interface SheetContainerProps extends DialogPrimitive.ContentProps {
12
13
  side?: SheetSide;
13
14
  showCloseButton?: boolean;
14
15
  overlayClassName?: string;
16
+ closeOnOverlayPress?: boolean;
15
17
  }
16
18
 
17
19
  interface SheetHeaderProps extends ViewProps {
@@ -30,10 +32,10 @@ const overlayPositionMap: Record<SheetSide, string> = {
30
32
  };
31
33
 
32
34
  const contentSizeMap: Record<SheetSide, string> = {
33
- bottom: "w-full max-h-[90%] rounded-t-xl",
34
- top: "w-full max-h-[90%] rounded-b-xl",
35
- left: "h-full max-w-[80%] rounded-r-xl",
36
- right: "h-full max-w-[80%] rounded-l-xl",
35
+ bottom: "w-full max-h-[90%] rounded-t-lg",
36
+ top: "w-full max-h-[90%] rounded-b-lg",
37
+ left: "h-full max-w-[80%] rounded-r-lg",
38
+ right: "h-full max-w-[80%] rounded-l-lg",
37
39
  };
38
40
 
39
41
  const closeButtonPositionMap: Record<SheetSide, string> = {
@@ -61,22 +63,27 @@ function SheetContainer({
61
63
  children,
62
64
  side = "bottom",
63
65
  showCloseButton = true,
66
+ closeOnOverlayPress = true,
64
67
  ...props
65
68
  }: SheetContainerProps) {
66
69
  const closeIconColor = useThemeColor("gray-foreground");
70
+ const backdropStyle = useBackdropStyle(overlayClassName);
67
71
 
68
72
  return (
69
73
  <DialogPrimitive.Portal>
70
74
  <DialogPrimitive.Overlay
71
- className={cn("absolute inset-0 bg-black-48", overlayClassName)}
75
+ className={cn("absolute inset-0", overlayClassName)}
76
+ style={backdropStyle}
77
+ closeOnPress={closeOnOverlayPress}
72
78
  />
73
79
  <DialogPrimitive.Content
74
80
  className={cn(overlayPositionMap[side])}
81
+ pointerEvents="box-none"
75
82
  {...props}
76
83
  >
77
84
  <View
78
85
  className={cn(
79
- "relative flex-col bg-background shadow-lg overflow-hidden",
86
+ "relative flex-col bg-surface-elevated shadow-lg overflow-hidden",
80
87
  contentSizeMap[side],
81
88
  className
82
89
  )}
@@ -112,7 +119,7 @@ function SheetContent({
112
119
  }) {
113
120
  return (
114
121
  <ScrollView
115
- className={cn("flex-1", containerClassName)}
122
+ className={cn(containerClassName)}
116
123
  contentContainerStyle={{ flexGrow: 1 }}
117
124
  >
118
125
  <View className={cn("px-6 py-4", className)}>{children}</View>
@@ -154,7 +161,7 @@ function SheetTitle({ className, ...props }: DialogPrimitive.TitleProps) {
154
161
  function SheetDescription({ className, ...props }: DialogPrimitive.DescriptionProps) {
155
162
  return (
156
163
  <DialogPrimitive.Description
157
- className={cn("text-md leading-md text-content-paragraph", className)}
164
+ className={cn("text-md font-regular leading-md text-content-paragraph", className)}
158
165
  {...props}
159
166
  />
160
167
  );
@@ -74,7 +74,7 @@ function Skeleton({ className, style, children, ...props }: SkeletonProps) {
74
74
  <Animated.View style={[StyleSheet.absoluteFill, animatedStyle]}>
75
75
  <View
76
76
  style={styles.background}
77
- className={cn("flex-1 bg-gray-150", classes.background)}
77
+ className={cn("flex-1 bg-gray-150 dark:bg-gray-600", classes.background)}
78
78
  />
79
79
  </Animated.View>
80
80
  {children}
@@ -3,7 +3,7 @@ import { Pressable, View } from "react-native";
3
3
 
4
4
  import { Text } from "@/components/Text";
5
5
  import * as TabsPrimitive from "@rn-primitives/tabs";
6
- import { cva, type VariantProps } from "class-variance-authority";
6
+ import { cva } from "class-variance-authority";
7
7
 
8
8
  import { cn } from "@/lib/utils";
9
9
 
@@ -53,12 +53,12 @@ interface TabsListProps extends TabsPrimitive.ListProps {
53
53
  children?: ReactNode;
54
54
  }
55
55
 
56
- interface TabsTriggerProps
57
- extends TabsPrimitive.TriggerProps,
58
- VariantProps<typeof tabsTriggerVariants> {
56
+ interface TabsTriggerProps extends TabsPrimitive.TriggerProps {
59
57
  className?: string;
60
58
  children?: ReactNode;
61
59
  icon?: ReactNode;
60
+ /** @deprecated Ignored: the active tab comes from the `Tabs` value. */
61
+ active?: boolean | null;
62
62
  }
63
63
 
64
64
  interface TabsContentProps extends TabsPrimitive.ContentProps {
@@ -109,6 +109,7 @@ function TabsTrigger({
109
109
  children,
110
110
  icon,
111
111
  value,
112
+ active,
112
113
  ...props
113
114
  }: TabsTriggerProps) {
114
115
  const variant = useTabsVariant();